@pushary/agent-hooks 1.9.26 → 1.9.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/data/SKILL.md +1 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +1 -1
- package/data/vscode-plugin/skills/pushary/SKILL.md +1 -1
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +24 -24
- package/dist/bin/pushary-clean.js +29 -29
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +32 -32
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +36 -32
- package/dist/bin/pushary-disconnect.js +24 -24
- package/dist/bin/pushary-doctor.js +35 -35
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +29 -29
- package/dist/bin/pushary-hook.js +40 -32
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +24 -24
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +35 -35
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-SCFKXAHX.js → chunk-3OFFLLSJ.js} +21 -13
- package/dist/{chunk-DDRSG6JL.js → chunk-3TF5FHAT.js} +5 -5
- package/dist/{chunk-PTJYAKZX.js → chunk-43DOHHZZ.js} +2 -2
- package/dist/{chunk-CXG7XA4E.js → chunk-56U55YDV.js} +3 -3
- package/dist/{chunk-GRL4VVUP.js → chunk-5NXOJ3JG.js} +3 -3
- package/dist/{chunk-MPBWPDXQ.js → chunk-64LLZV5F.js} +8 -7
- package/dist/{chunk-RQPJEYLM.js → chunk-74YRZTGP.js} +2 -2
- package/dist/{chunk-TVP5UU33.js → chunk-7DXPQW2H.js} +250 -38
- package/dist/{chunk-47RVFUEG.js → chunk-7RKX7WRQ.js} +1 -1
- package/dist/{chunk-F2HVTVQG.js → chunk-7TBCGHJT.js} +2 -2
- package/dist/{chunk-BWXRLXNE.js → chunk-7ZWU4BNG.js} +5 -5
- package/dist/{chunk-GEN4YTNR.js → chunk-A24TEUD6.js} +11 -11
- package/dist/{chunk-RZTIB2TY.js → chunk-AR7XOG6W.js} +1 -1
- package/dist/{chunk-4GKLAQY4.js → chunk-AXGA3WJI.js} +1 -1
- package/dist/{chunk-3DLVLVEM.js → chunk-BG7T5MNV.js} +1 -1
- package/dist/{chunk-2YF72RC5.js → chunk-BXUYF5HB.js} +3 -3
- package/dist/{chunk-3ZDIA6ZC.js → chunk-CJTTAF4O.js} +3 -3
- package/dist/{chunk-L62RNE5F.js → chunk-COEOZ2NC.js} +5 -5
- package/dist/{chunk-KTRRDTZN.js → chunk-EBO5KWWC.js} +1 -1
- package/dist/{chunk-5FL4M4YF.js → chunk-EP425PGA.js} +8 -8
- package/dist/{chunk-BIV2LKDK.js → chunk-FD3QASU3.js} +18 -9
- package/dist/{chunk-GPDABKLD.js → chunk-FY2XCYLK.js} +5 -5
- package/dist/{chunk-BIKHLGEL.js → chunk-FYYWKCPO.js} +2 -2
- package/dist/{chunk-ZPLDPPZO.js → chunk-GXZFDZJG.js} +1 -1
- package/dist/{chunk-NCAVDVXP.js → chunk-HRAZMBUX.js} +1 -1
- package/dist/{chunk-CW72FZ2M.js → chunk-ICMVPBRQ.js} +2 -2
- package/dist/{chunk-3HBLQXCJ.js → chunk-IDXEDMWI.js} +3 -3
- package/dist/{chunk-4YWINUPJ.js → chunk-IWPQBWFN.js} +1 -1
- package/dist/{chunk-TS3CRCI7.js → chunk-IWYBFBRW.js} +32 -4
- package/dist/{chunk-AF2QZRYH.js → chunk-JOZWN4YI.js} +32 -22
- package/dist/{chunk-KJ2W7ECE.js → chunk-L5ZMZOQL.js} +2 -2
- package/dist/{chunk-LGMSGVDN.js → chunk-ME2PKG7C.js} +2 -2
- package/dist/{chunk-OGTWSEWN.js → chunk-MNHY3EIN.js} +1 -1
- package/dist/{chunk-5UKZXDHV.js → chunk-OK4WDRGM.js} +1 -1
- package/dist/{chunk-PUJQFTKF.js → chunk-OQKV3OXH.js} +1 -1
- package/dist/{chunk-JXHJYLFF.js → chunk-S3NAONBN.js} +4 -4
- package/dist/{chunk-Y5O4TO7U.js → chunk-SGAQYFGS.js} +1 -1
- package/dist/{chunk-3TRGUDQ3.js → chunk-TAPGV2YV.js} +4 -4
- package/dist/{chunk-3G4R2FLX.js → chunk-UJZ3KD4E.js} +2 -2
- package/dist/{chunk-R5ABJ5H5.js → chunk-UMTGSFAI.js} +39 -10
- package/dist/{chunk-K4OV2VLB.js → chunk-URZOKMAV.js} +2 -2
- package/dist/{chunk-XUVKAWV3.js → chunk-V5BIWNB3.js} +1 -1
- package/dist/{chunk-FDT7KSQY.js → chunk-VAJLOCFP.js} +2 -2
- package/dist/{chunk-P7WJ2KKO.js → chunk-VU6O4P2N.js} +5 -5
- package/dist/{chunk-IU5PAJDG.js → chunk-VYKUGORF.js} +4 -4
- package/dist/{chunk-CA2EOOZG.js → chunk-W6MUIG6S.js} +3 -3
- package/dist/{chunk-XDTGYZIT.js → chunk-WIAWMH6T.js} +4 -4
- package/dist/{chunk-FA3YPD4P.js → chunk-YRB2VBKK.js} +2 -2
- package/dist/{chunk-I52A3NLY.js → chunk-YTCMVHW5.js} +1 -1
- package/dist/{chunk-TEQJNXJH.js → chunk-YW7JQ7Z4.js} +5 -5
- package/dist/{chunk-ZXYHVZZZ.js → chunk-ZH32OREM.js} +1 -1
- package/dist/{chunk-PPOQG2U6.js → chunk-ZMWCN3QS.js} +4 -4
- package/dist/{chunk-AG5ATWVT.js → chunk-ZREXC363.js} +3 -3
- package/dist/{chunk-AXOMDPA7.js → chunk-ZX5ISG5O.js} +10 -9
- package/dist/{global-upgrade-3XKMGVAR.js → global-upgrade-MBW4MRJ2.js} +6 -6
- package/dist/{paths-UB2IUM57.js → paths-H4XMIYUS.js} +2 -2
- package/dist/{reapply-B7KMGQH7.js → reapply-JFEY77OC.js} +22 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-6LLAEJTW.js → upgrade-lock-2RGMG5ZV.js} +3 -3
- package/package.json +1 -1
|
@@ -298,6 +298,7 @@ var normalizeAgentId = (value, accepted) => {
|
|
|
298
298
|
|
|
299
299
|
// ../contracts/src/agent-wiring.ts
|
|
300
300
|
var COMPATIBLE_AGENT_TYPES = ["qwen_code", "codebuddy", "qoder", "droid", "devin", "antigravity_cli"];
|
|
301
|
+
var isCompatibleAgentType = (value) => typeof value === "string" && COMPATIBLE_AGENT_TYPES.includes(value);
|
|
301
302
|
var CANONICAL_PATH_KEYS = ["file_path", "path", "notebook_path"];
|
|
302
303
|
var CANONICAL_COMMAND_KEYS = ["command"];
|
|
303
304
|
var SHELL_TOOLS = /* @__PURE__ */ new Set(["Bash", "PowerShell"]);
|
|
@@ -315,7 +316,34 @@ var withCanonicalInputKeys = (profile, toolInput) => {
|
|
|
315
316
|
return renamed.length === 0 ? toolInput : { ...toolInput, ...Object.fromEntries(renamed) };
|
|
316
317
|
};
|
|
317
318
|
var canonicalToolName = (profile, toolName) => profile.toolAliases[toolName] ?? toolName;
|
|
319
|
+
var TASK_OUTPUT_TOOL = "BashOutput";
|
|
320
|
+
var TASK_STOP_TOOL = "KillShell";
|
|
321
|
+
var BLANK_TASK_INPUT_TOOL = "TaskInput";
|
|
322
|
+
var SHELL_TOOL = "Bash";
|
|
323
|
+
var typesText = (value) => typeof value === "string" && value.trim().length > 0;
|
|
324
|
+
var taskIdOf = (control, toolInput) => typeof toolInput[control.taskKey] === "string" ? { task_id: toolInput[control.taskKey] } : {};
|
|
325
|
+
var typedIntoTask = (control, toolInput) => {
|
|
326
|
+
const text = toolInput[control.inputKey];
|
|
327
|
+
if (typesText(text)) return { tool: SHELL_TOOL, input: { command: text }, unreadable: false };
|
|
328
|
+
return {
|
|
329
|
+
tool: BLANK_TASK_INPUT_TOOL,
|
|
330
|
+
input: { ...taskIdOf(control, toolInput), input: typeof text === "string" ? text : "" },
|
|
331
|
+
unreadable: false
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
var taskControlLookup = (control, toolInput) => {
|
|
335
|
+
const action = toolInput[control.actionKey];
|
|
336
|
+
if (action === control.typingAction) return typedIntoTask(control, toolInput);
|
|
337
|
+
if (action === control.stopAction) return { tool: TASK_STOP_TOOL, input: taskIdOf(control, toolInput), unreadable: false };
|
|
338
|
+
if (typeof action === "string" && control.outputActions.includes(action)) {
|
|
339
|
+
return { tool: TASK_OUTPUT_TOOL, input: taskIdOf(control, toolInput), unreadable: false };
|
|
340
|
+
}
|
|
341
|
+
return { tool: control.name, input: toolInput, unreadable: false };
|
|
342
|
+
};
|
|
343
|
+
var controlsTasks = (profile, toolName) => profile.taskControl?.name === toolName ? profile.taskControl : void 0;
|
|
318
344
|
var toToolLookup = (profile, toolName, toolInput, resolvePath = (path) => path) => {
|
|
345
|
+
const taskControl = controlsTasks(profile, toolName);
|
|
346
|
+
if (taskControl) return taskControlLookup(taskControl, toolInput);
|
|
319
347
|
const tool = canonicalToolName(profile, toolName);
|
|
320
348
|
if (SHELL_TOOLS.has(tool)) {
|
|
321
349
|
const command = firstString(toolInput, [...profile.shellCommandKeys, ...CANONICAL_COMMAND_KEYS]);
|
|
@@ -453,7 +481,8 @@ var QWEN_CODE = {
|
|
|
453
481
|
instructions: { file: [".qwen", "QWEN.md"], label: "Qwen Code" },
|
|
454
482
|
permissionRuleFile: null,
|
|
455
483
|
configDirIsShared: false,
|
|
456
|
-
soleGate: null
|
|
484
|
+
soleGate: null,
|
|
485
|
+
taskControl: null
|
|
457
486
|
};
|
|
458
487
|
var CODEBUDDY = {
|
|
459
488
|
agentType: "codebuddy",
|
|
@@ -476,7 +505,8 @@ var CODEBUDDY = {
|
|
|
476
505
|
instructions: { file: [".codebuddy", "CODEBUDDY.md"], label: "CodeBuddy" },
|
|
477
506
|
permissionRuleFile: [".codebuddy", "settings.json"],
|
|
478
507
|
configDirIsShared: false,
|
|
479
|
-
soleGate: null
|
|
508
|
+
soleGate: null,
|
|
509
|
+
taskControl: null
|
|
480
510
|
};
|
|
481
511
|
var QODER = {
|
|
482
512
|
agentType: "qoder",
|
|
@@ -499,7 +529,8 @@ var QODER = {
|
|
|
499
529
|
instructions: null,
|
|
500
530
|
permissionRuleFile: null,
|
|
501
531
|
configDirIsShared: false,
|
|
502
|
-
soleGate: null
|
|
532
|
+
soleGate: null,
|
|
533
|
+
taskControl: null
|
|
503
534
|
};
|
|
504
535
|
var DROID = {
|
|
505
536
|
agentType: "droid",
|
|
@@ -527,7 +558,8 @@ var DROID = {
|
|
|
527
558
|
instructions: null,
|
|
528
559
|
permissionRuleFile: null,
|
|
529
560
|
configDirIsShared: false,
|
|
530
|
-
soleGate: null
|
|
561
|
+
soleGate: null,
|
|
562
|
+
taskControl: null
|
|
531
563
|
};
|
|
532
564
|
var DEVIN = {
|
|
533
565
|
agentType: "devin",
|
|
@@ -560,7 +592,17 @@ var DEVIN = {
|
|
|
560
592
|
instructions: null,
|
|
561
593
|
permissionRuleFile: null,
|
|
562
594
|
configDirIsShared: false,
|
|
563
|
-
soleGate: null
|
|
595
|
+
soleGate: null,
|
|
596
|
+
taskControl: null
|
|
597
|
+
};
|
|
598
|
+
var ANTIGRAVITY_TASK_CONTROL = {
|
|
599
|
+
name: "manage_task",
|
|
600
|
+
actionKey: "Action",
|
|
601
|
+
taskKey: "TaskId",
|
|
602
|
+
inputKey: "Input",
|
|
603
|
+
typingAction: "send_input",
|
|
604
|
+
outputActions: ["list", "status"],
|
|
605
|
+
stopAction: "kill"
|
|
564
606
|
};
|
|
565
607
|
var ANTIGRAVITY_CLI = {
|
|
566
608
|
agentType: "antigravity_cli",
|
|
@@ -599,8 +641,10 @@ var ANTIGRAVITY_CLI = {
|
|
|
599
641
|
file: [".gemini", "antigravity-cli", "settings.json"],
|
|
600
642
|
key: "toolPermission",
|
|
601
643
|
value: "always-proceed",
|
|
602
|
-
receipt: [".pushary", "setup", "antigravity-tool-permission.json"]
|
|
603
|
-
|
|
644
|
+
receipt: [".pushary", "setup", "antigravity-tool-permission.json"],
|
|
645
|
+
coveredTools: [ANTIGRAVITY_TASK_CONTROL.name]
|
|
646
|
+
},
|
|
647
|
+
taskControl: ANTIGRAVITY_TASK_CONTROL
|
|
604
648
|
};
|
|
605
649
|
var HOOK_COMPATIBLE_PROFILES = Object.freeze([QWEN_CODE, CODEBUDDY, QODER, DROID, DEVIN, ANTIGRAVITY_CLI]);
|
|
606
650
|
var hookCompatibleProfile = (agentType) => HOOK_COMPATIBLE_PROFILES.find((profile) => profile.agentType === agentType);
|
|
@@ -989,6 +1033,17 @@ var serializeDeclinedAgents = (agents) => `${JSON.stringify(declinedAgentsDocume
|
|
|
989
1033
|
var withDeclinedAgent = (agents, agent) => canonicalAgents([...agents, agent]);
|
|
990
1034
|
var withoutDeclinedAgent = (agents, agent) => agents.filter((candidate) => candidate !== agent);
|
|
991
1035
|
|
|
1036
|
+
// ../contracts/src/cli-version-standing.ts
|
|
1037
|
+
var FIRST_AUTO_UPDATING_RELEASE = [1, 5, 0];
|
|
1038
|
+
var MIN_SAFE_RELEASE = [1, 9, 26];
|
|
1039
|
+
var formatReleaseVersion = (version) => version.join(".");
|
|
1040
|
+
var FIRST_AUTO_UPDATING_CLI_VERSION = formatReleaseVersion(FIRST_AUTO_UPDATING_RELEASE);
|
|
1041
|
+
var MIN_SAFE_CLI_VERSION = formatReleaseVersion(MIN_SAFE_RELEASE);
|
|
1042
|
+
|
|
1043
|
+
// ../contracts/src/auto-update-report.ts
|
|
1044
|
+
var AUTO_UPDATE_RESULTS = ["updated", "current", "needs_manual", "failed", "finish_pending", "finish_blocked"];
|
|
1045
|
+
var isAutoUpdateResult = (value) => typeof value === "string" && AUTO_UPDATE_RESULTS.includes(value);
|
|
1046
|
+
|
|
992
1047
|
// ../contracts/src/index.ts
|
|
993
1048
|
var KEY_SCOPES = ["full_access", "agent", "connector", "bound"];
|
|
994
1049
|
var normalizeKeyScope = (value) => typeof value === "string" && KEY_SCOPES.includes(value) ? value : null;
|
|
@@ -1663,15 +1718,16 @@ var verdictForPolicy = (policy) => {
|
|
|
1663
1718
|
return "requires_human";
|
|
1664
1719
|
};
|
|
1665
1720
|
var policyIntent = (policy) => isAutoApprove(policy) ? PATTERN_INTENT.grant : PATTERN_INTENT.restrict;
|
|
1666
|
-
var
|
|
1721
|
+
var restricts = (policy) => policyIntent(policy) === PATTERN_INTENT.restrict;
|
|
1722
|
+
var appliesToThisCall = (policy, repoKey, sessionId) => isRepoKeyMatch(policy.repoKey, repoKey) && (!policy.sessionId || policy.sessionId === sessionId);
|
|
1723
|
+
var selectGoverningRule = (policies, toolName, args, repoKey, sessionId, restrictedArgs = args) => {
|
|
1667
1724
|
let best;
|
|
1668
1725
|
let bestWeight = 0;
|
|
1669
1726
|
let bestScoped = -1;
|
|
1670
1727
|
let bestLength = -1;
|
|
1671
1728
|
for (const candidate of policies) {
|
|
1672
|
-
if (!
|
|
1673
|
-
|
|
1674
|
-
const rank = matchToolPatternAny(candidate.tool, toolName, args, policyIntent(candidate));
|
|
1729
|
+
if (!appliesToThisCall(candidate, repoKey, sessionId)) continue;
|
|
1730
|
+
const rank = matchToolPatternAny(candidate.tool, toolName, restricts(candidate) ? restrictedArgs : args, policyIntent(candidate));
|
|
1675
1731
|
if (rank === "none") continue;
|
|
1676
1732
|
const weight = matchRankWeight(rank);
|
|
1677
1733
|
const scoped = candidate.sessionId ? 2 : candidate.repoKey ? 1 : 0;
|
|
@@ -2448,15 +2504,14 @@ var replacesTheCrontab = ({ program, args }) => program !== void 0 && basenameOf
|
|
|
2448
2504
|
var FIND_DELETE = "-delete";
|
|
2449
2505
|
var FIND_RUNNERS = /* @__PURE__ */ new Set(["-exec", "-execdir", "-ok", "-okdir"]);
|
|
2450
2506
|
var FIND_RUNNER_END = /* @__PURE__ */ new Set([";", "+"]);
|
|
2507
|
+
var FIND = "find";
|
|
2508
|
+
var commandsRunByFind = ({ program, args }) => program === void 0 || basenameOf(program.text) !== FIND ? [] : args.flatMap((arg, index) => FIND_RUNNERS.has(arg.text) ? [{ program: args[index + 1], args: args.slice(index + 2, findRunnerEnd(args, index + 2)) }] : []);
|
|
2451
2509
|
var losesDataVisibly = (toolName, invocation, normalized, depth) => {
|
|
2452
2510
|
const { program, args } = invocation;
|
|
2453
2511
|
if (program === void 0) return false;
|
|
2454
2512
|
const name = basenameOf(program.text);
|
|
2455
|
-
if (name ===
|
|
2456
|
-
return args.some((arg) => arg.text === FIND_DELETE) ||
|
|
2457
|
-
program: args[index + 1],
|
|
2458
|
-
args: args.slice(index + 2, findRunnerEnd(args, index + 2))
|
|
2459
|
-
}, depth + 1));
|
|
2513
|
+
if (name === FIND) {
|
|
2514
|
+
return args.some((arg) => arg.text === FIND_DELETE) || commandsRunByFind(invocation).some((run) => invocationHasAVisibleConsequence(toolName, run, depth + 1));
|
|
2460
2515
|
}
|
|
2461
2516
|
const destructiveArguments = destructiveArgumentsOf(name, args);
|
|
2462
2517
|
return destructiveArguments !== void 0 && args.some((arg) => namesDestructiveArgument(arg.text, destructiveArguments)) || namesDestructiveWordInAnyCase(name, args.map((arg) => arg.text)) || gitDiscardsWork(invocation) || changesAService(invocation) || replacesTheCrontab(invocation) || isCoveredByPolicy(VISIBLE_DATA_LOSS_PATTERNS, toolName, normalized);
|
|
@@ -2619,7 +2674,8 @@ var runsADownloadedScript = (invocations) => {
|
|
|
2619
2674
|
var pipedSegmentsOf = (command) => (shellSegmentsReadingAPipe(commandForReading(command)) ?? []).map((segment) => innermostInvocation(invocationOf(withoutShellGrouping(segment))));
|
|
2620
2675
|
var pipesIntoASqlClient = (command) => pipedSegmentsOf(command).some((invocation) => sqlClientSyntaxOf(invocation) !== void 0);
|
|
2621
2676
|
var pipesFetchedCodeIntoAnInterpreter = (command, invocations) => invocations.some(fetches) && pipedSegmentsOf(command).some(runsWhatItReads);
|
|
2622
|
-
var
|
|
2677
|
+
var WORDS_THAT_OPEN_A_COMMAND = String.raw`if|then|elif|else|do|while|until|!`;
|
|
2678
|
+
var SHELL_GROUPING_PREFIX = new RegExp(String.raw`^\s*(?:(?:${WORDS_THAT_OPEN_A_COMMAND})\s+|[({]\s*)+`);
|
|
2623
2679
|
var GROUP_OPENER_BY_CLOSER = /* @__PURE__ */ new Map([[")", "("], ["}", "{"]]);
|
|
2624
2680
|
var occurrencesOf = (text, character) => text.split(character).length - 1;
|
|
2625
2681
|
var closesAGroupItDidNotOpen = (text) => {
|
|
@@ -2736,6 +2792,116 @@ var commandHasAVisibleConsequenceAt = (toolName, command, depth) => {
|
|
|
2736
2792
|
return invocations.some((invocation) => invocationHasAVisibleConsequence(toolName, invocation, depth)) || pipesIntoASqlClient(command) || pipesFetchedCodeIntoAnInterpreter(command, invocations) || runsADownloadedScript(invocations);
|
|
2737
2793
|
};
|
|
2738
2794
|
var commandHasAVisibleConsequence = (toolName, command) => commandHasAVisibleConsequenceAt(toolName, command, 0);
|
|
2795
|
+
var MAX_SPELLING_DEPTH = 3;
|
|
2796
|
+
var GIT_GLOBAL_OPTIONS_WITH_A_VALUE = /* @__PURE__ */ new Set([
|
|
2797
|
+
"-C",
|
|
2798
|
+
"-c",
|
|
2799
|
+
"--git-dir",
|
|
2800
|
+
"--work-tree",
|
|
2801
|
+
"--namespace",
|
|
2802
|
+
"--super-prefix",
|
|
2803
|
+
"--config-env"
|
|
2804
|
+
]);
|
|
2805
|
+
var GIT_GLOBAL_FLAGS = /* @__PURE__ */ new Set([
|
|
2806
|
+
"-p",
|
|
2807
|
+
"--paginate",
|
|
2808
|
+
"-P",
|
|
2809
|
+
"--no-pager",
|
|
2810
|
+
"--bare",
|
|
2811
|
+
"--exec-path",
|
|
2812
|
+
"--html-path",
|
|
2813
|
+
"--man-path",
|
|
2814
|
+
"--info-path",
|
|
2815
|
+
"--no-replace-objects",
|
|
2816
|
+
"--no-lazy-fetch",
|
|
2817
|
+
"--no-optional-locks",
|
|
2818
|
+
"--no-advice",
|
|
2819
|
+
"--literal-pathspecs",
|
|
2820
|
+
"--glob-pathspecs",
|
|
2821
|
+
"--noglob-pathspecs",
|
|
2822
|
+
"--icase-pathspecs"
|
|
2823
|
+
]);
|
|
2824
|
+
var GIT_OPTION_AND_ITS_VALUE = 2;
|
|
2825
|
+
var GIT_OPTION_ALONE = 1;
|
|
2826
|
+
var NOT_A_GIT_GLOBAL_OPTION = 0;
|
|
2827
|
+
var gitGlobalOptionWidth = (text) => {
|
|
2828
|
+
if (GIT_GLOBAL_OPTIONS_WITH_A_VALUE.has(text)) return GIT_OPTION_AND_ITS_VALUE;
|
|
2829
|
+
const name = longOptionName(text);
|
|
2830
|
+
return GIT_GLOBAL_OPTIONS_WITH_A_VALUE.has(name) || GIT_GLOBAL_FLAGS.has(name) ? GIT_OPTION_ALONE : NOT_A_GIT_GLOBAL_OPTION;
|
|
2831
|
+
};
|
|
2832
|
+
var argsAfterGitGlobalOptions = (args) => {
|
|
2833
|
+
let index = 0;
|
|
2834
|
+
while (index < args.length) {
|
|
2835
|
+
const width = gitGlobalOptionWidth(args[index]?.text ?? "");
|
|
2836
|
+
if (width === NOT_A_GIT_GLOBAL_OPTION) break;
|
|
2837
|
+
index += width;
|
|
2838
|
+
}
|
|
2839
|
+
return args.slice(index);
|
|
2840
|
+
};
|
|
2841
|
+
var gitReadingsPastGlobalOptions = ({ program, args }) => {
|
|
2842
|
+
if (program === void 0 || basenameOf(program.text) !== GIT) return [];
|
|
2843
|
+
const rest = argsAfterGitGlobalOptions(args);
|
|
2844
|
+
return rest.length === args.length ? [] : [{ program, args: rest }];
|
|
2845
|
+
};
|
|
2846
|
+
var CURRENT_DIRECTORY_STEP = /\/\.(?=\/)/g;
|
|
2847
|
+
var LEADING_CURRENT_DIRECTORY = /^(?:\.\/+)+(?=[^/])/;
|
|
2848
|
+
var canonicalPathWord = (text) => text.replace(CURRENT_DIRECTORY_STEP, "").replace(LEADING_CURRENT_DIRECTORY, "");
|
|
2849
|
+
var verbatimInvocationText = (invocation) => wordsOfInvocation(invocation).map((word) => asOneShellWord(word.text)).join(" ");
|
|
2850
|
+
var canonicalInvocationText = (invocation) => invocationTextWith(invocation, (word) => asOneShellWord(canonicalPathWord(word.text)));
|
|
2851
|
+
var spellingsOfAnInvocation = (invocation, innermost) => [invocation, innermost, ...gitReadingsPastGlobalOptions(innermost), ...readingsPastGlobalFlags(innermost)].flatMap((reading) => [verbatimInvocationText(reading), canonicalInvocationText(reading)]);
|
|
2852
|
+
var NO_INLINE_SCRIPT = { kind: "none" };
|
|
2853
|
+
var HIDDEN_INLINE_SCRIPT = { kind: "hidden" };
|
|
2854
|
+
var passesAnInlineScript = ({ program, args }) => {
|
|
2855
|
+
const name = basenameOf(program?.text ?? "");
|
|
2856
|
+
return name === EVAL || SHELLS.has(name) && args.some((arg) => SCRIPT_FLAG_CLUSTER.test(arg.text));
|
|
2857
|
+
};
|
|
2858
|
+
var shellReadsItsScript = (invocation) => SHELLS.has(basenameOf(invocation.program?.text ?? "")) && runsWhatItReads(invocation);
|
|
2859
|
+
var inlineScriptsOf = (invocation, heredocs) => {
|
|
2860
|
+
const script = shellScriptOf(invocation);
|
|
2861
|
+
if (script !== null) return { kind: "readable", scripts: [script] };
|
|
2862
|
+
if (passesAnInlineScript(invocation)) return HIDDEN_INLINE_SCRIPT;
|
|
2863
|
+
if (!shellReadsItsScript(invocation)) return NO_INLINE_SCRIPT;
|
|
2864
|
+
return heredocs.length > 0 ? { kind: "readable", scripts: heredocs } : HIDDEN_INLINE_SCRIPT;
|
|
2865
|
+
};
|
|
2866
|
+
var programIsHidden = ({ program }) => program?.expands ?? false;
|
|
2867
|
+
var SUBSTITUTION_AS_A_PROGRAM = new RegExp(String.raw`(?:^|[;&|({\n]|(?:^|[\s;&|({])(?:${WORDS_THAT_OPEN_A_COMMAND})\s)\s*"?(?:\$\(|\`)`);
|
|
2868
|
+
var runsASubstitutionAsAProgram = (command) => {
|
|
2869
|
+
const visible = shellVisibleText(withHeredocBodiesSetAside(commandForReading(command)).text);
|
|
2870
|
+
return visible !== null && SUBSTITUTION_AS_A_PROGRAM.test(visible);
|
|
2871
|
+
};
|
|
2872
|
+
var parsedSpelledSegment = (segment) => {
|
|
2873
|
+
const text = withoutShellGrouping(segment);
|
|
2874
|
+
return { text, invocation: invocationOf(text), heredocs: [], feedsASubstitution: false };
|
|
2875
|
+
};
|
|
2876
|
+
var roughSpelledSegment = ({ invocation, heredocs, feedsASubstitution }) => ({ text: verbatimInvocationText(invocation), invocation, heredocs, feedsASubstitution });
|
|
2877
|
+
var segmentHidesWhatItRuns = (segment, innermost, scripts) => programIsHidden(innermost) || scripts.kind === "hidden" || segment.feedsASubstitution && passesAnInlineScript(innermost);
|
|
2878
|
+
var commandsNestedIn = (innermost, scripts) => [
|
|
2879
|
+
...scripts.kind === "readable" ? scripts.scripts : [],
|
|
2880
|
+
...commandsRunByFind(innermost).map(verbatimInvocationText)
|
|
2881
|
+
];
|
|
2882
|
+
var spelledSegmentsOf = (command) => {
|
|
2883
|
+
const parsed = readableCommandSegments(command);
|
|
2884
|
+
return parsed === null ? roughSegmentsOf(command).map(roughSpelledSegment) : parsed.map(parsedSpelledSegment);
|
|
2885
|
+
};
|
|
2886
|
+
var SPELLINGS_OF_AN_UNREADABLE_COMMAND = { forms: [], hidesWhatItRuns: true };
|
|
2887
|
+
var commandSpellingsAt = (command, depth) => {
|
|
2888
|
+
if (depth > MAX_SPELLING_DEPTH) return SPELLINGS_OF_AN_UNREADABLE_COMMAND;
|
|
2889
|
+
const forms = [];
|
|
2890
|
+
let hidesWhatItRuns = runsASubstitutionAsAProgram(command);
|
|
2891
|
+
for (const segment of spelledSegmentsOf(command)) {
|
|
2892
|
+
const innermost = innermostInvocation(segment.invocation);
|
|
2893
|
+
const scripts = inlineScriptsOf(innermost, segment.heredocs);
|
|
2894
|
+
forms.push(segment.text, ...spellingsOfAnInvocation(segment.invocation, innermost));
|
|
2895
|
+
hidesWhatItRuns ||= segmentHidesWhatItRuns(segment, innermost, scripts);
|
|
2896
|
+
for (const nested of commandsNestedIn(innermost, scripts)) {
|
|
2897
|
+
const inner = commandSpellingsAt(nested, depth + 1);
|
|
2898
|
+
forms.push(nested, ...inner.forms);
|
|
2899
|
+
hidesWhatItRuns ||= inner.hidesWhatItRuns;
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
return { forms, hidesWhatItRuns };
|
|
2903
|
+
};
|
|
2904
|
+
var commandSpellings = (command) => commandSpellingsAt(command, 0);
|
|
2739
2905
|
var withoutSessionToolGrants = (config) => ({
|
|
2740
2906
|
...config,
|
|
2741
2907
|
policies: config.policies.filter((policy) => !isSessionToolGrant(policy))
|
|
@@ -3296,9 +3462,10 @@ var findBestRoute = (routes, toolName, args, repoKey) => {
|
|
|
3296
3462
|
let bestWeight = 0;
|
|
3297
3463
|
let bestScoped = -1;
|
|
3298
3464
|
let bestLength = -1;
|
|
3465
|
+
const { forms } = restrictionReadingOf(routes.map((route) => route.toolPattern), toolName, args);
|
|
3299
3466
|
for (const candidate of routes) {
|
|
3300
3467
|
if (!isRepoKeyMatch(candidate.repoKey, repoKey)) continue;
|
|
3301
|
-
const rank = matchToolPatternAny(candidate.toolPattern, toolName,
|
|
3468
|
+
const rank = matchToolPatternAny(candidate.toolPattern, toolName, forms, PATTERN_INTENT.restrict);
|
|
3302
3469
|
if (rank === "none") continue;
|
|
3303
3470
|
const weight = matchRankWeight(rank);
|
|
3304
3471
|
const scoped = candidate.repoKey ? 1 : 0;
|
|
@@ -3329,11 +3496,39 @@ var isCodexCoordinationTool = (toolName) => CODEX_COORDINATION_TOOL_NAMES.has(to
|
|
|
3329
3496
|
var isNamedByARule = (rank) => rank !== void 0 && rank !== "wildcard";
|
|
3330
3497
|
var isSpecificArgumentRank = (rank) => rank === "exact" || rank === "prefix";
|
|
3331
3498
|
var shellReadOnlyFloorApplies = (toolName, arg, rank) => !isSpecificArgumentRank(rank) && toolName === "Bash" && typeof arg === "string" && isSafeReadOnlyCommand(arg);
|
|
3332
|
-
var
|
|
3499
|
+
var AGENT_TASK_CONTROL_TOOLS = [TASK_OUTPUT_TOOL, TASK_STOP_TOOL];
|
|
3500
|
+
var AGENT_TASK_CONTROL_TOOL_NAMES = new Set(AGENT_TASK_CONTROL_TOOLS);
|
|
3501
|
+
var readsOrStopsItsOwnWork = (toolName) => isCodexCoordinationTool(toolName) || AGENT_TASK_CONTROL_TOOL_NAMES.has(toolName);
|
|
3502
|
+
var coordinationFloorApplies = (toolName, rank) => readsOrStopsItsOwnWork(toolName) && !isNamedByARule(rank);
|
|
3503
|
+
var POSIX_SHELL_TOOLS = /* @__PURE__ */ new Set(["Bash", "Monitor"]);
|
|
3504
|
+
var argumentsAsWritten = (args) => ({ forms: args, hidesWhatItRuns: false });
|
|
3505
|
+
var namesAnArgumentOf = (pattern, toolName) => pattern.startsWith(`${toolName}(`);
|
|
3506
|
+
var isSpelledOut = (form) => form.length > 0;
|
|
3507
|
+
var restrictionReadingOf = (restrictingPatterns, toolName, args) => {
|
|
3508
|
+
const command = toolName in POLICY_COMMAND_KEYS ? args[0] : void 0;
|
|
3509
|
+
if (command === void 0 || !restrictingPatterns.some((pattern) => namesAnArgumentOf(pattern, toolName))) {
|
|
3510
|
+
return argumentsAsWritten(args);
|
|
3511
|
+
}
|
|
3512
|
+
const spellings = commandSpellings(command);
|
|
3513
|
+
return {
|
|
3514
|
+
forms: [.../* @__PURE__ */ new Set([...args, ...spellings.forms.filter(isSpelledOut)])],
|
|
3515
|
+
hidesWhatItRuns: POSIX_SHELL_TOOLS.has(toolName) && spellings.hidesWhatItRuns
|
|
3516
|
+
};
|
|
3517
|
+
};
|
|
3518
|
+
var restrictingPatternsOf = (policies) => policies.filter(restricts).map((policy) => policy.tool);
|
|
3519
|
+
var policyReadingOf = (policies, toolName, args) => restrictionReadingOf(restrictingPatternsOf(policies), toolName, args);
|
|
3520
|
+
var stricterRule = (current, challenger) => current !== void 0 && (challenger === void 0 || restraintRank(current.policy) > restraintRank(challenger.policy)) ? current : challenger;
|
|
3521
|
+
var restrictsAnArgumentOf = (policy, toolName) => restricts(policy) && namesAnArgumentOf(policy.tool, toolName);
|
|
3522
|
+
var strictestRuleNamingAnArgument = (pool, toolName, repoKey, sessionId) => pool.filter((policy) => restrictsAnArgumentOf(policy, toolName) && appliesToThisCall(policy, repoKey, sessionId)).reduce((strictest, policy) => stricterRule(strictest, { policy, rank: "prefix" }), void 0);
|
|
3523
|
+
var governingRuleForReading = (pool, toolName, args, reading, repoKey, sessionId) => {
|
|
3524
|
+
const selected = selectGoverningRule(pool, toolName, args, repoKey, sessionId, reading.forms);
|
|
3525
|
+
return reading.hidesWhatItRuns ? stricterRule(selected, strictestRuleNamingAnArgument(pool, toolName, repoKey, sessionId)) : selected;
|
|
3526
|
+
};
|
|
3333
3527
|
var resolveAutoResolveOrigin = (config, toolName, toolInput, cwd, repoKey, sessionId) => {
|
|
3334
3528
|
const args = toolInput ? policyArgForms(toolName, toolInput, cwd) : [];
|
|
3335
3529
|
const arg = args[0];
|
|
3336
|
-
const
|
|
3530
|
+
const reading = policyReadingOf(config.policies, toolName, args);
|
|
3531
|
+
const rank = governingRuleForReading(config.policies, toolName, args, reading, repoKey, sessionId)?.rank;
|
|
3337
3532
|
if (shellReadOnlyFloorApplies(toolName, arg, rank) || coordinationFloorApplies(toolName, rank)) {
|
|
3338
3533
|
return DECISION_ORIGIN.safeReadonly;
|
|
3339
3534
|
}
|
|
@@ -3344,28 +3539,37 @@ var wildcardRuleOf = (pool) => {
|
|
|
3344
3539
|
return wildcard ? { policy: wildcard, rank: "wildcard" } : void 0;
|
|
3345
3540
|
};
|
|
3346
3541
|
var withSiteDelivery = (rule, siteMode) => isAutoApprove(rule.policy) || isAutoDeny(rule.policy) ? rule : { ...rule, policy: { ...rule.policy, mode: siteMode.mode, pushFirstSeconds: siteMode.pushFirstSeconds } };
|
|
3347
|
-
var
|
|
3348
|
-
const
|
|
3349
|
-
const arg = args[0];
|
|
3350
|
-
const specificRule = (pool) => pool.length === 0 ? void 0 : selectGoverningRule(pool, toolName, args, repoKey, sessionId);
|
|
3542
|
+
var layeredGoverningRule = (config, toolName, args, reading, repoKey, sessionId) => {
|
|
3543
|
+
const specificRule = (pool) => pool.length === 0 ? void 0 : governingRuleForReading(pool, toolName, args, reading, repoKey, sessionId);
|
|
3351
3544
|
const written = config.policies.filter((p) => !p.origin);
|
|
3352
3545
|
const presets = config.policies.filter((p) => p.origin === "preset");
|
|
3353
3546
|
const builtins = config.policies.filter((p) => p.origin === "builtin");
|
|
3354
3547
|
const siteMode = wildcardRuleOf(written);
|
|
3355
3548
|
const presetRule = specificRule(presets);
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3549
|
+
return specificRule(written) ?? (presetRule && siteMode ? withSiteDelivery(presetRule, siteMode.policy) : presetRule) ?? siteMode ?? wildcardRuleOf(presets) ?? specificRule(builtins) ?? wildcardRuleOf(builtins);
|
|
3550
|
+
};
|
|
3551
|
+
var unmatchedPolicyOf = (config, toolName) => ({
|
|
3552
|
+
tool: toolName,
|
|
3553
|
+
timeoutSeconds: config.defaultTimeoutSeconds,
|
|
3554
|
+
timeoutAction: config.defaultTimeoutAction,
|
|
3555
|
+
mode: config.defaultMode ?? "push_first",
|
|
3556
|
+
pushFirstSeconds: config.defaultPushFirstSeconds ?? 20
|
|
3557
|
+
});
|
|
3558
|
+
var stricterOfTheReadings = (asWritten, asSpelled, unmatched) => restraintRank(asWritten?.policy ?? unmatched) > restraintRank(asSpelled?.policy ?? unmatched) ? asWritten : asSpelled;
|
|
3559
|
+
var resolvePolicy = (config, toolName, modeOverride, toolInput, cwd, repoKey, sessionId) => {
|
|
3560
|
+
const args = toolInput ? policyArgForms(toolName, toolInput, cwd) : [];
|
|
3561
|
+
const arg = args[0];
|
|
3562
|
+
const unmatched = unmatchedPolicyOf(config, toolName);
|
|
3563
|
+
const asWritten = layeredGoverningRule(config, toolName, args, argumentsAsWritten(args), repoKey, sessionId);
|
|
3564
|
+
const asSpelled = layeredGoverningRule(config, toolName, args, policyReadingOf(config.policies, toolName, args), repoKey, sessionId);
|
|
3565
|
+
const match = stricterOfTheReadings(asWritten, asSpelled, unmatched);
|
|
3566
|
+
let base = match?.policy ?? unmatched;
|
|
3364
3567
|
const governedBySpecificRule = isSpecificArgumentRank(match?.rank);
|
|
3365
3568
|
const governedBySessionToolGrant = match?.rank === "tool" && isSessionToolGrant(match.policy);
|
|
3366
3569
|
const governedByStandingShellAllow = match?.rank === "tool" && isStandingShellAllow(match.policy);
|
|
3367
3570
|
const governingMode = base.mode;
|
|
3368
|
-
const
|
|
3571
|
+
const aRuleNamesASpelling = isSpecificArgumentRank(asSpelled?.rank);
|
|
3572
|
+
const approvedByReadOnlyFloor = !isAutoDeny(base) && (shellReadOnlyFloorApplies(toolName, arg, match?.rank) && !aRuleNamesASpelling || coordinationFloorApplies(toolName, match?.rank));
|
|
3369
3573
|
if (governedBySessionToolGrant && !approvedByReadOnlyFloor && typeof arg === "string" && commandNeedsAPerson(toolName, arg)) {
|
|
3370
3574
|
return resolvePolicy(withoutSessionToolGrants(config), toolName, modeOverride, toolInput, cwd, repoKey, sessionId);
|
|
3371
3575
|
}
|
|
@@ -3580,11 +3784,13 @@ var everyCommandSegmentGranted = (rules, toolName, command) => {
|
|
|
3580
3784
|
const segments = readableCommandSegments(command);
|
|
3581
3785
|
return segments !== null && segments.every((segment) => isSafeReadOnlyCommand(segment) || anyRuleGrants(rules, toolName, [segment]));
|
|
3582
3786
|
};
|
|
3583
|
-
var
|
|
3787
|
+
var agentRuleReadingOf = (rules, toolName, args) => {
|
|
3788
|
+
const reading = restrictionReadingOf([...rules.ask, ...rules.deny], toolName, args);
|
|
3584
3789
|
const command = toolName in POLICY_COMMAND_KEYS ? args[0] : void 0;
|
|
3585
3790
|
const normalized = command === void 0 ? null : normalizedCommand(command);
|
|
3586
|
-
return normalized === null ?
|
|
3791
|
+
return normalized === null ? reading : { ...reading, forms: [...reading.forms, normalized] };
|
|
3587
3792
|
};
|
|
3793
|
+
var anyRuleRestrictsReading = (rules, toolName, reading) => anyRuleRestricts(rules, toolName, reading.forms) || reading.hidesWhatItRuns && rules.some((rule) => namesAnArgumentOf(rule, toolName));
|
|
3588
3794
|
var allowRulesGrant = (rules, toolName, args) => {
|
|
3589
3795
|
const command = args[0];
|
|
3590
3796
|
return toolName in POLICY_COMMAND_KEYS && command !== void 0 ? everyCommandSegmentGranted(rules, toolName, command) : anyRuleGrants(rules, toolName, args);
|
|
@@ -3596,8 +3802,8 @@ var inputNeedsAPerson = (toolName, toolInput) => {
|
|
|
3596
3802
|
};
|
|
3597
3803
|
var agentRulesAllowEveryInput = (rules, toolName, toolInputs, cwd) => rules.allow.length > 0 && toolInputs.length > 0 && toolInputs.every((toolInput) => {
|
|
3598
3804
|
const args = policyArgForms(toolName, toolInput, cwd);
|
|
3599
|
-
const
|
|
3600
|
-
return allowRulesGrant(rules.allow, toolName, args) && !
|
|
3805
|
+
const reading = agentRuleReadingOf(rules, toolName, args);
|
|
3806
|
+
return allowRulesGrant(rules.allow, toolName, args) && !anyRuleRestrictsReading(rules.ask, toolName, reading) && !anyRuleRestrictsReading(rules.deny, toolName, reading) && !inputNeedsAPerson(toolName, toolInput);
|
|
3601
3807
|
});
|
|
3602
3808
|
var isDefaultRule = (policy) => policy.origin === "builtin" || policy.tool === WILDCARD_TOOL_PATTERN;
|
|
3603
3809
|
var isApprovalRoutePattern = (value) => typeof value === "object" && value !== null && typeof value.toolPattern === "string" && ["string", "undefined"].includes(typeof value.repoKey);
|
|
@@ -3611,7 +3817,8 @@ var aChosenRuleGoverns = (input) => {
|
|
|
3611
3817
|
if (routes === null) return true;
|
|
3612
3818
|
return input.toolInputs.some((toolInput) => {
|
|
3613
3819
|
const args = policyArgForms(input.toolName, toolInput, input.cwd);
|
|
3614
|
-
|
|
3820
|
+
const reading = policyReadingOf(chosen, input.toolName, args);
|
|
3821
|
+
return governingRuleForReading(chosen, input.toolName, args, reading, input.repoKey, input.sessionId) !== void 0 || findBestRoute(routes, input.toolName, args, input.repoKey) !== void 0;
|
|
3615
3822
|
});
|
|
3616
3823
|
};
|
|
3617
3824
|
var claudeAllowlistOwnsCall = (input, verdict, permissionMode, rules) => rules !== null && verdict.kind === "gate" && !verdict.scopeReason && !aChosenRuleGoverns(input) && !isAskedInEveryMode(input.toolName) && claudeConsultsItsAllowlist(permissionMode) && agentRulesAllowEveryInput(rules, input.toolName, input.toolInputs, input.cwd);
|
|
@@ -4096,8 +4303,12 @@ export {
|
|
|
4096
4303
|
MANAGED_PROVIDERS,
|
|
4097
4304
|
DISCONNECT_AGENT_IDS,
|
|
4098
4305
|
normalizeAgentId,
|
|
4306
|
+
isCompatibleAgentType,
|
|
4099
4307
|
PHONE_ANSWERED_TOOLS,
|
|
4100
4308
|
canonicalToolName,
|
|
4309
|
+
TASK_OUTPUT_TOOL,
|
|
4310
|
+
TASK_STOP_TOOL,
|
|
4311
|
+
BLANK_TASK_INPUT_TOOL,
|
|
4101
4312
|
toToolLookup,
|
|
4102
4313
|
SOLE_GATE_UNDECIDED_REASON,
|
|
4103
4314
|
SOLE_GATE_SUBSCRIPTION_REASON,
|
|
@@ -4133,6 +4344,7 @@ export {
|
|
|
4133
4344
|
serializeDeclinedAgents,
|
|
4134
4345
|
withDeclinedAgent,
|
|
4135
4346
|
withoutDeclinedAgent,
|
|
4347
|
+
isAutoUpdateResult,
|
|
4136
4348
|
normalizeKeyScope,
|
|
4137
4349
|
isApprovalMode,
|
|
4138
4350
|
approvalModeWithoutLocalPrompt,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
resolvePackageVersionFromBinary,
|
|
11
11
|
resolvePathBinary,
|
|
12
12
|
resolvePathBinaryAsync
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TAPGV2YV.js";
|
|
14
14
|
import {
|
|
15
15
|
MANAGED_PROVIDERS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7DXPQW2H.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/codex-install.ts
|
|
19
19
|
var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YTCMVHW5.js";
|
|
8
8
|
import {
|
|
9
9
|
describeAutoUpdateCheck,
|
|
10
10
|
globalInstallLocation,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
readAutoUpdateState,
|
|
15
15
|
updateAutoUpdateState,
|
|
16
16
|
upgradeEntryFor
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IWYBFBRW.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -27,10 +27,10 @@ import {
|
|
|
27
27
|
npmErrorMessage,
|
|
28
28
|
readGlobalCliInstallAt,
|
|
29
29
|
readGlobalPrefix
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TAPGV2YV.js";
|
|
31
31
|
import {
|
|
32
32
|
NPX_LATEST_COMMAND
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-7RKX7WRQ.js";
|
|
34
34
|
import {
|
|
35
35
|
commandsPackage,
|
|
36
36
|
globalUpgradeEntry,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
isSameMajorVersion,
|
|
40
40
|
ownPackageRoot,
|
|
41
41
|
packageVersionAt
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-7DXPQW2H.js";
|
|
43
43
|
|
|
44
44
|
// src/global-upgrade.ts
|
|
45
45
|
import { existsSync } from "fs";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defersToNativeMode,
|
|
3
3
|
reportMachineDenial
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YRB2VBKK.js";
|
|
5
5
|
import {
|
|
6
6
|
isGatingMoment,
|
|
7
7
|
recordKeylessMoment
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-BG7T5MNV.js";
|
|
9
9
|
import {
|
|
10
10
|
announceSubscriptionRequired,
|
|
11
11
|
isDeferAnswer,
|
|
12
12
|
oncePerSession
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZH32OREM.js";
|
|
14
14
|
import {
|
|
15
15
|
activeHookSource,
|
|
16
16
|
activeIdentity
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZX5ISG5O.js";
|
|
18
18
|
import {
|
|
19
19
|
DEFAULT_SESSION,
|
|
20
20
|
UNNAMED_ACTION,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
reportEvent,
|
|
40
40
|
scopePathFor,
|
|
41
41
|
settleQuestionsForToolUse
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-FD3QASU3.js";
|
|
43
43
|
import {
|
|
44
44
|
askUser,
|
|
45
45
|
cancelQuestion,
|
|
@@ -51,20 +51,20 @@ import {
|
|
|
51
51
|
sendNotification,
|
|
52
52
|
waitForQuestion,
|
|
53
53
|
waitsForThePhone
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-3TF5FHAT.js";
|
|
55
55
|
import {
|
|
56
56
|
SubscriptionRequiredError
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-ZREXC363.js";
|
|
58
58
|
import {
|
|
59
59
|
getMachineId
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-IWPQBWFN.js";
|
|
61
61
|
import {
|
|
62
62
|
getApiKey,
|
|
63
63
|
getBaseUrl
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-OK4WDRGM.js";
|
|
65
65
|
import {
|
|
66
66
|
NPX_LATEST_COMMAND
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-7RKX7WRQ.js";
|
|
68
68
|
import {
|
|
69
69
|
AGENT_QUESTION_STRATEGY,
|
|
70
70
|
DECISION_STOP_REASON,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
questionHandedToTheTerminal,
|
|
107
107
|
resolveGate,
|
|
108
108
|
timeoutActionWithoutLocalPrompt
|
|
109
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-7DXPQW2H.js";
|
|
110
110
|
|
|
111
111
|
// src/claude-permission-rules.ts
|
|
112
112
|
import { readFileSync, statSync } from "fs";
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
NOTIFICATION_MATCHED_TYPES,
|
|
7
7
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-V5BIWNB3.js";
|
|
9
9
|
import {
|
|
10
10
|
isProtectedByScope,
|
|
11
11
|
registerHookEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TAPGV2YV.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
15
15
|
HOOK_BUDGETS,
|
|
16
16
|
HOOK_LOCATOR_BINARY
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7DXPQW2H.js";
|
|
18
18
|
|
|
19
19
|
// src/gemini-config.ts
|
|
20
20
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|