MCPcopy Create free account
hub / github.com/cursor/plugins / isOperatorModeEnabled

Function isOperatorModeEnabled

orchestrate/skills/orchestrate/scripts/cli/util.ts:492–506  ·  view source on GitHub ↗
(
  flagPath: string = operatorModeFlagPath()
)

Source from the content-addressed store, hash-verified

490 * surface. If workers can write that home directory, use a stronger boundary.
491 */
492export function isOperatorModeEnabled(
493 flagPath: string = operatorModeFlagPath()
494): boolean {
495 if (typeof process.getuid !== "function") return false;
496 try {
497 const stat = lstatSync(flagPath);
498 return (
499 stat.isFile() &&
500 stat.uid === process.getuid() &&
501 (stat.mode & 0o777) === 0o600
502 );
503 } catch {
504 return false;
505 }
506}
507
508export function assertOperatorModeOrBail(
509 action: string,

Callers 3

assertOperatorModeOrBailFunction · 0.85

Calls 1

operatorModeFlagPathFunction · 0.85

Tested by

no test coverage detected