@pushary/agent-hooks 1.9.51 → 1.9.53
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 +16 -0
- package/README.md +9 -0
- package/dist/{api-PPNFRSJC.js → api-K6ZROHYB.js} +7 -7
- package/dist/bin/pushary-bell-hook.js +15 -15
- package/dist/bin/pushary-bell.js +3 -3
- package/dist/bin/pushary-claude.js +16 -16
- package/dist/bin/pushary-clean.js +28 -26
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +20 -20
- package/dist/bin/pushary-codex-session.js +6 -6
- package/dist/bin/pushary-codex.js +8 -8
- package/dist/bin/pushary-connect.js +16 -16
- package/dist/bin/pushary-daemon.js +23 -21
- package/dist/bin/pushary-disconnect.js +17 -17
- package/dist/bin/pushary-doctor.js +25 -25
- package/dist/bin/pushary-elicitation-hook.js +17 -17
- package/dist/bin/pushary-gemini-bridge.js +5 -5
- package/dist/bin/pushary-gemini-hook.js +18 -18
- package/dist/bin/pushary-hook.js +18 -18
- package/dist/bin/pushary-login.js +6 -6
- package/dist/bin/pushary-logout.js +16 -16
- package/dist/bin/pushary-mcp.js +12 -7
- package/dist/bin/pushary-mode.js +6 -6
- package/dist/bin/pushary-notification-hook.js +15 -15
- package/dist/bin/pushary-opencode-hook.js +17 -17
- package/dist/bin/pushary-permission-denied-hook.js +18 -18
- package/dist/bin/pushary-permission-hook.js +18 -18
- package/dist/bin/pushary-post-hook.js +15 -15
- package/dist/bin/pushary-prompt-hook.js +15 -15
- package/dist/bin/pushary-session-end-hook.js +15 -15
- package/dist/bin/pushary-session-start-hook.js +21 -19
- package/dist/bin/pushary-setup.js +97 -92
- package/dist/bin/pushary-status.js +18 -18
- package/dist/bin/pushary-stop-hook.js +15 -15
- package/dist/bin/pushary-stopfailure-hook.js +15 -15
- package/dist/bin/pushary-suggestions.js +6 -6
- package/dist/bin/pushary-transcript-register.js +8 -8
- package/dist/bin/pushary-upgrade.js +53 -27
- package/dist/bin/pushary-wait.js +6 -6
- package/dist/bin/pushary.js +4 -4
- package/dist/{chunk-WVSM3G4C.js → chunk-2LEH5IGX.js} +1 -1
- package/dist/{chunk-X5GHIFST.js → chunk-46TC24ET.js} +1 -1
- package/dist/{chunk-EJCPHLY2.js → chunk-56ZTIY6D.js} +1 -1
- package/dist/{chunk-AA2K3H7Y.js → chunk-63IQRYVP.js} +3 -3
- package/dist/{chunk-3ICRY72Q.js → chunk-6C4S3QYD.js} +1 -1
- package/dist/{chunk-PVDSN6TB.js → chunk-ABGN5RN2.js} +6 -3
- package/dist/{chunk-ZXGDBCIH.js → chunk-ALZZVC3E.js} +1 -1
- package/dist/{chunk-5CRQCIHR.js → chunk-BL3WAGIK.js} +3 -3
- package/dist/{chunk-26MUPAKS.js → chunk-DHJSBK63.js} +1 -1
- package/dist/{chunk-UR7XX2DV.js → chunk-EK7SZJ4K.js} +1 -1
- package/dist/{chunk-3YAOJEHG.js → chunk-EPOD7QHT.js} +4 -4
- package/dist/{chunk-6QPRQVQM.js → chunk-FCMWUYIE.js} +2 -2
- package/dist/{chunk-K3BIMGP4.js → chunk-H57DXSHR.js} +2 -2
- package/dist/{chunk-UKX5WIB5.js → chunk-IHUFRAHB.js} +3 -3
- package/dist/{chunk-VD2OAF7Q.js → chunk-JOWF4Y4P.js} +1 -1
- package/dist/{chunk-PMJEN6CX.js → chunk-JPABKXK6.js} +5 -5
- package/dist/{chunk-DT5Y55FI.js → chunk-K23WMLPY.js} +3 -3
- package/dist/{chunk-SRXBOMSR.js → chunk-L5YTS2BP.js} +1 -1
- package/dist/{chunk-GTSI6NG6.js → chunk-LD4MWJMD.js} +3 -3
- package/dist/{chunk-EGKD4S5H.js → chunk-LIESRXK5.js} +1 -1
- package/dist/{chunk-PTNSIGLB.js → chunk-MHQB62K5.js} +2 -2
- package/dist/{chunk-AZHTI5JX.js → chunk-MTKV4RUQ.js} +79 -13
- package/dist/{chunk-4JM2CK2A.js → chunk-N77BH7H2.js} +9 -3
- package/dist/{chunk-DUMZORSL.js → chunk-NECZKPJN.js} +27 -4
- package/dist/{chunk-43NXSBNZ.js → chunk-NELH25J7.js} +6 -6
- package/dist/{chunk-TQ6AGJVH.js → chunk-NHVEQLQC.js} +1 -1
- package/dist/{chunk-YQDZ7ZIL.js → chunk-OML4YFBN.js} +1 -1
- package/dist/{chunk-3OLEGCMU.js → chunk-P2546BBI.js} +2 -2
- package/dist/{chunk-2YSCVT6Q.js → chunk-Q7OXI6VS.js} +3 -3
- package/dist/{chunk-RLADRNPV.js → chunk-QKU46TK5.js} +1 -1
- package/dist/{chunk-7DBTOPOT.js → chunk-RH6KR6EH.js} +3 -3
- package/dist/{chunk-W26Q2DTD.js → chunk-RL7EOD6I.js} +80 -19
- package/dist/{chunk-7YAVKENV.js → chunk-SUIB4O3S.js} +53 -13
- package/dist/{chunk-KQBXPGXO.js → chunk-T6RIKJUO.js} +1 -1
- package/dist/{chunk-DT5CACWZ.js → chunk-U2L42GVI.js} +4 -4
- package/dist/{chunk-VZRCM362.js → chunk-VQPSWD3A.js} +3 -3
- package/dist/{chunk-LXRQLDGW.js → chunk-XDCXTDHH.js} +3 -3
- package/dist/{chunk-JZDRR7BL.js → chunk-XUW2DRAQ.js} +3 -3
- package/dist/{chunk-XQHPHJHR.js → chunk-XZRLFBEA.js} +1 -1
- package/dist/{chunk-2QPHUCXU.js → chunk-ZMPR436Z.js} +6 -6
- package/dist/{codex-app-cards-switch-ZQRT7MXB.js → codex-app-cards-switch-RENOSSDD.js} +14 -6
- package/dist/{codex-desktop-launch-X7UKQ4VR.js → codex-desktop-launch-I2D6QATK.js} +5 -1
- package/dist/{codex-session-launch-IX33LOQZ.js → codex-session-launch-KLH2FSSJ.js} +10 -10
- package/dist/{global-upgrade-DGP2E2NE.js → global-upgrade-AZN3BPI3.js} +5 -5
- package/dist/{identity-YISWVJ2A.js → identity-AQIMUWYN.js} +3 -3
- package/dist/{live-capabilities-44KFBOD4.js → live-capabilities-4IIFAMHU.js} +2 -2
- package/dist/{paths-VLGX4GJA.js → paths-X4IPV2WJ.js} +2 -2
- package/dist/{reapply-35F3WDTB.js → reapply-CXODG53B.js} +18 -15
- package/dist/src/index.js +13 -13
- package/dist/{upgrade-lock-LMO3DSSU.js → upgrade-lock-AHISGKER.js} +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
announceSubscriptionRequired,
|
|
3
3
|
isDeferAnswer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DHJSBK63.js";
|
|
5
5
|
import {
|
|
6
6
|
AUTO_DECISION_WINDOW_MS,
|
|
7
7
|
DEFAULT_SESSION,
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
permissionDeniedAction,
|
|
11
11
|
releaseThrottle,
|
|
12
12
|
reportEvent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-U2L42GVI.js";
|
|
14
14
|
import {
|
|
15
15
|
askUser,
|
|
16
16
|
isDecisionStopped,
|
|
17
17
|
waitForQuestion
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ZMPR436Z.js";
|
|
19
19
|
import {
|
|
20
20
|
SubscriptionRequiredError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-P2546BBI.js";
|
|
22
22
|
import {
|
|
23
23
|
getMachineId
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-T6RIKJUO.js";
|
|
25
25
|
import {
|
|
26
26
|
machineDecisionFor,
|
|
27
27
|
parseAgentQuestionAnswers,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N77BH7H2.js";
|
|
4
4
|
import {
|
|
5
5
|
hookOwnerOf,
|
|
6
6
|
hookOwnerOfCommands,
|
|
7
7
|
liveBridgeProbe,
|
|
8
8
|
resolveBridgeStub
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q7OXI6VS.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENT_CHOICES
|
|
12
12
|
} from "./chunk-BUXDR6US.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
guardedArgv,
|
|
19
19
|
pusharyDir,
|
|
20
20
|
vscodePluginDir
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-OML4YFBN.js";
|
|
22
22
|
import {
|
|
23
23
|
readJsonSafe
|
|
24
24
|
} from "./chunk-AQFEP65J.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
describeIdleWindow,
|
|
11
11
|
idleDeadlinePassed,
|
|
12
12
|
startProcessOwnership
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-56ZTIY6D.js";
|
|
14
14
|
import {
|
|
15
15
|
spawnClaude
|
|
16
16
|
} from "./chunk-XHKBHWLX.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
isWaitForAnswerResponse,
|
|
24
24
|
withdrawQuestion,
|
|
25
25
|
writeDegraded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZMPR436Z.js";
|
|
27
27
|
import {
|
|
28
28
|
callMcpTool,
|
|
29
29
|
isRetryable
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-P2546BBI.js";
|
|
31
31
|
import {
|
|
32
32
|
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
33
33
|
AGENT_QUESTION_HEADER_MAX,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-K23WMLPY.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
6
|
} from "./chunk-VYBH6D4X.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OML4YFBN.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
12
|
} from "./chunk-AQFEP65J.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-46TC24ET.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
6
|
} from "./chunk-VYBH6D4X.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
NpmInstallError,
|
|
9
9
|
NpmMissingError,
|
|
10
10
|
NpmPermissionError
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XUW2DRAQ.js";
|
|
12
12
|
import {
|
|
13
13
|
readJsonSafe,
|
|
14
14
|
writeFileAtomic,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-LF3TLC7B.js";
|
|
23
23
|
|
|
24
24
|
// src/instruction-file.ts
|
|
25
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
25
|
+
import { accessSync, constants, existsSync, readFileSync, statSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
26
26
|
import { dirname } from "path";
|
|
27
27
|
var PUSHARY_BEGIN = "<!-- BEGIN PUSHARY (managed by @pushary/agent-hooks; do not edit this block) -->";
|
|
28
28
|
var PUSHARY_END = "<!-- END PUSHARY -->";
|
|
@@ -44,6 +44,9 @@ You have Pushary MCP tools that reach the user on their phone. Use them proactiv
|
|
|
44
44
|
|
|
45
45
|
Pass \`agentName\` as "${label} - <project folder name>" so the user knows which session is asking. If a question times out, follow \`handoffAction\` when present, otherwise \`nextAction\`: keep waiting with the same correlationId while pending. A poll ending is not question expiry. Cancel only for an explicit handoff or when the answer is no longer needed. If cancellation returns \`handoffAction: "stop"\`, stop. Otherwise, if cancellation returns false, poll once for 1 second and honor the answer that won the race.`;
|
|
46
46
|
var SHARED_AGENTS_MD_LABEL = "<your agent's name, such as Codex or Hermes>";
|
|
47
|
+
var CODEX_INSTRUCTIONS_LABEL = "Codex";
|
|
48
|
+
var GEMINI_INSTRUCTIONS_LABEL = "Gemini";
|
|
49
|
+
var OPENCODE_INSTRUCTIONS_LABEL = "OpenCode";
|
|
47
50
|
var renderAgentInstructions = (label) => instructionBody(label);
|
|
48
51
|
var KEYLESS_FALLBACK_LINE = "This repo uses Pushary phone approvals. Your teammates get agent questions on their lock screens; you do not have a key yet, so questions will fall back to the terminal. Get your own key (3-day trial): https://pushary.com/sign-up?utm_source=agents-md&utm_medium=teammate";
|
|
49
52
|
var renderProjectAgentInstructions = (label) => `${instructionBody(label)}
|
|
@@ -52,6 +55,19 @@ If this environment has no Pushary API key (no PUSHARY_API_KEY and no key in ~/.
|
|
|
52
55
|
var wrap = (body) => `${PUSHARY_BEGIN}
|
|
53
56
|
${body}
|
|
54
57
|
${PUSHARY_END}`;
|
|
58
|
+
var withInstructionBlockAppended = (existing, body) => {
|
|
59
|
+
const prefix = existing.trim() ? existing.replace(/\s*$/, "") + "\n\n" : "";
|
|
60
|
+
return prefix + wrap(body) + "\n";
|
|
61
|
+
};
|
|
62
|
+
var managedBlockRange = (text) => {
|
|
63
|
+
const start = text.indexOf(PUSHARY_BEGIN);
|
|
64
|
+
const end = text.indexOf(PUSHARY_END);
|
|
65
|
+
return start !== -1 && end > start ? { start, end: end + PUSHARY_END.length } : null;
|
|
66
|
+
};
|
|
67
|
+
var withInstructionBlockReplaced = (existing, body) => {
|
|
68
|
+
const range = managedBlockRange(existing);
|
|
69
|
+
return range ? existing.slice(0, range.start) + wrap(body) + existing.slice(range.end) : null;
|
|
70
|
+
};
|
|
55
71
|
var writeInstructionBlock = (filePath, body) => {
|
|
56
72
|
const dir = dirname(filePath);
|
|
57
73
|
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
@@ -60,17 +76,53 @@ var writeInstructionBlock = (filePath, body) => {
|
|
|
60
76
|
existing = readFileSync(filePath, "utf-8");
|
|
61
77
|
} catch {
|
|
62
78
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
writeFileSync(filePath, withInstructionBlockReplaced(existing, body) ?? withInstructionBlockAppended(existing, body), "utf-8");
|
|
80
|
+
};
|
|
81
|
+
var occurrencesOf = (marker, text) => text.split(marker).length - 1;
|
|
82
|
+
var soleManagedBlock = (text) => {
|
|
83
|
+
const begins = occurrencesOf(PUSHARY_BEGIN, text);
|
|
84
|
+
const ends = occurrencesOf(PUSHARY_END, text);
|
|
85
|
+
if (begins === 0 && ends === 0) return { kind: "none" };
|
|
86
|
+
const range = managedBlockRange(text);
|
|
87
|
+
return begins === 1 && ends === 1 && range ? { kind: "one", range } : { kind: "ambiguous" };
|
|
88
|
+
};
|
|
89
|
+
var CRLF = "\r\n";
|
|
90
|
+
var withLineEndingsOf = (sample, block) => sample.includes(CRLF) ? block.replaceAll("\n", CRLF) : block;
|
|
91
|
+
var readUtf8 = (filePath) => {
|
|
92
|
+
try {
|
|
93
|
+
const bytes = readFileSync(filePath);
|
|
94
|
+
const text = bytes.toString("utf-8");
|
|
95
|
+
return Buffer.from(text, "utf-8").equals(bytes) ? { kind: "text", text } : { kind: "not_utf8" };
|
|
96
|
+
} catch {
|
|
97
|
+
return { kind: "unreadable" };
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
var isWritable = (filePath) => {
|
|
101
|
+
try {
|
|
102
|
+
accessSync(filePath, constants.W_OK);
|
|
103
|
+
return true;
|
|
104
|
+
} catch {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var refreshInstructionBlock = (filePath, body) => {
|
|
109
|
+
if (!existsSync(filePath)) return "absent";
|
|
110
|
+
const read = readUtf8(filePath);
|
|
111
|
+
if (read.kind !== "text") return read.kind;
|
|
112
|
+
const block = soleManagedBlock(read.text);
|
|
113
|
+
if (block.kind === "none") return "absent";
|
|
114
|
+
if (block.kind === "ambiguous") return "ambiguous_markers";
|
|
115
|
+
const existing = read.text.slice(block.range.start, block.range.end);
|
|
116
|
+
const fresh = withLineEndingsOf(existing, wrap(body));
|
|
117
|
+
if (existing === fresh) return "current";
|
|
118
|
+
if (!isWritable(filePath)) return "read_only";
|
|
119
|
+
try {
|
|
120
|
+
const refreshed = read.text.slice(0, block.range.start) + fresh + read.text.slice(block.range.end);
|
|
121
|
+
writeFileAtomic(filePath, refreshed, statSync(filePath).mode & 511);
|
|
122
|
+
return "refreshed";
|
|
123
|
+
} catch {
|
|
124
|
+
return "write_failed";
|
|
72
125
|
}
|
|
73
|
-
writeFileSync(filePath, next, "utf-8");
|
|
74
126
|
};
|
|
75
127
|
var removeInstructionBlock = (filePath) => {
|
|
76
128
|
let existing = "";
|
|
@@ -550,6 +602,7 @@ var agentFailureWire = (failures) => readSetupAgentFailures(failures);
|
|
|
550
602
|
|
|
551
603
|
// src/fx-lifecycle.ts
|
|
552
604
|
import { existsSync as existsSync3 } from "fs";
|
|
605
|
+
import { join } from "path";
|
|
553
606
|
var fxRetryHint = () => `Fix it, then run ${retryAgentCommand("fx")}.`;
|
|
554
607
|
var readFxProfileForSetup = (filePath) => {
|
|
555
608
|
const read = readFxFile(filePath, readFxProfile);
|
|
@@ -571,6 +624,13 @@ var writeFxProfile = (filePath, profile) => {
|
|
|
571
624
|
}
|
|
572
625
|
writeFileAtomic(filePath, rendered.text, KEY_FILE_MODE);
|
|
573
626
|
};
|
|
627
|
+
var macAppFxBridge = (pusharyDir) => join(pusharyDir, "bin", MCP_BRIDGE_BINARY);
|
|
628
|
+
var fxServerHolder = (profilePath, appBridge) => {
|
|
629
|
+
const read = readFxFile(profilePath, readFxProfile);
|
|
630
|
+
const entry = read.kind === "profile" ? fxPusharyEntryOf(read.profile) : void 0;
|
|
631
|
+
if (!isFxPusharyEntry(entry)) return "none";
|
|
632
|
+
return fxBridgeTargetOf(entry) === appBridge ? "app" : "cli";
|
|
633
|
+
};
|
|
574
634
|
var fxSettingsReadRefusal = (filePath, read) => {
|
|
575
635
|
if (read.kind === "unreadable") return `${filePath} could not be read`;
|
|
576
636
|
if (read.kind === "refused") return `${filePath} ${FX_SETTINGS_REFUSALS[read.reason]}`;
|
|
@@ -665,9 +725,13 @@ var planFxRemoval = (profilePath, settingsPath, receiptPath) => {
|
|
|
665
725
|
|
|
666
726
|
export {
|
|
667
727
|
SHARED_AGENTS_MD_LABEL,
|
|
728
|
+
CODEX_INSTRUCTIONS_LABEL,
|
|
729
|
+
GEMINI_INSTRUCTIONS_LABEL,
|
|
730
|
+
OPENCODE_INSTRUCTIONS_LABEL,
|
|
668
731
|
renderAgentInstructions,
|
|
669
732
|
renderProjectAgentInstructions,
|
|
670
733
|
writeInstructionBlock,
|
|
734
|
+
refreshInstructionBlock,
|
|
671
735
|
removeInstructionBlock,
|
|
672
736
|
hasInstructionBlock,
|
|
673
737
|
FX_PUSHARY_TOOLS_RULE,
|
|
@@ -691,6 +755,8 @@ export {
|
|
|
691
755
|
agentFailureWire,
|
|
692
756
|
readFxProfileForSetup,
|
|
693
757
|
writeFxProfile,
|
|
758
|
+
macAppFxBridge,
|
|
759
|
+
fxServerHolder,
|
|
694
760
|
configureFxSettings,
|
|
695
761
|
inspectFxInstallation,
|
|
696
762
|
planFxRemoval
|
|
@@ -3,19 +3,20 @@ import {
|
|
|
3
3
|
addGeminiMcpServer,
|
|
4
4
|
removeGeminiMcpServer,
|
|
5
5
|
supportedClaudeEvents
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6C4S3QYD.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_CODE_AGENT,
|
|
9
9
|
compatibleToolLookup
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-U2L42GVI.js";
|
|
11
11
|
import {
|
|
12
12
|
guardBinary,
|
|
13
13
|
guardBinaryRefusing,
|
|
14
14
|
holdBudgetOf,
|
|
15
15
|
isProtectedByScope,
|
|
16
16
|
registerHookEntry
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-OML4YFBN.js";
|
|
18
18
|
import {
|
|
19
|
+
HOOK_COMPATIBLE_PROFILES,
|
|
19
20
|
HOOK_LOCATOR_BINARY,
|
|
20
21
|
PHONE_ANSWERED_TOOLS,
|
|
21
22
|
compatibleTargetFiles,
|
|
@@ -280,6 +281,10 @@ var compatibleDocuments = (profile, home) => {
|
|
|
280
281
|
}
|
|
281
282
|
return documents;
|
|
282
283
|
};
|
|
284
|
+
var compatibleRecord = (of) => HOOK_COMPATIBLE_PROFILES.reduce(
|
|
285
|
+
(record, profile) => ({ ...record, [profile.agentType]: of(profile) }),
|
|
286
|
+
{}
|
|
287
|
+
);
|
|
283
288
|
var compatibleTargetPaths = (profile, home) => compatibleTargetFiles(profile).map((file) => compatibleFilePath(file, home));
|
|
284
289
|
var compatibleConfigFile = (profile, home) => compatibleFilePath(profile.configFile, home);
|
|
285
290
|
var compatibleMcpFile = (profile, home) => profile.mcp ? compatibleFilePath(profile.mcp.file, home) : null;
|
|
@@ -489,6 +494,7 @@ export {
|
|
|
489
494
|
grokHome,
|
|
490
495
|
compatibleFilePath,
|
|
491
496
|
compatibleDocuments,
|
|
497
|
+
compatibleRecord,
|
|
492
498
|
compatibleTargetPaths,
|
|
493
499
|
compatibleConfigFile,
|
|
494
500
|
compatibleMcpFile,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-H57DXSHR.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-QKU46TK5.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
autoUpdateLock,
|
|
23
23
|
autoUpdateLog,
|
|
24
24
|
autoUpdateState
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-OML4YFBN.js";
|
|
26
26
|
import {
|
|
27
27
|
execNpm,
|
|
28
28
|
fetchLatestPublishedVersion,
|
|
29
29
|
npmErrorMessage,
|
|
30
30
|
readGlobalCliInstallAt,
|
|
31
31
|
readGlobalPrefix
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-XUW2DRAQ.js";
|
|
33
33
|
import {
|
|
34
34
|
NPX_LATEST_COMMAND
|
|
35
35
|
} from "./chunk-MC4VY5LK.js";
|
|
@@ -52,6 +52,26 @@ import { dirname } from "path";
|
|
|
52
52
|
|
|
53
53
|
// src/upgrade-finish.ts
|
|
54
54
|
var FINISHED_UPGRADE = { kind: "finished" };
|
|
55
|
+
var refreshedPartsOf = (agent) => [
|
|
56
|
+
...agent.result.hooks ? ["hooks"] : [],
|
|
57
|
+
...agent.result.mcp ? ["MCP key"] : [],
|
|
58
|
+
...agent.instructions?.outcome === "refreshed" ? ["instructions"] : []
|
|
59
|
+
];
|
|
60
|
+
var wasRefreshed = (agent) => refreshedPartsOf(agent).length > 0;
|
|
61
|
+
var INSTRUCTIONS_LEFT_BECAUSE = {
|
|
62
|
+
refreshed: null,
|
|
63
|
+
current: null,
|
|
64
|
+
absent: null,
|
|
65
|
+
read_only: "the file is read-only",
|
|
66
|
+
ambiguous_markers: "its Pushary markers do not form exactly one block",
|
|
67
|
+
not_utf8: "the file is not UTF-8 text",
|
|
68
|
+
unreadable: "the file could not be read",
|
|
69
|
+
write_failed: "the file could not be written"
|
|
70
|
+
};
|
|
71
|
+
var instructionsLeftNoteOf = (agent) => {
|
|
72
|
+
const reason = agent.instructions ? INSTRUCTIONS_LEFT_BECAUSE[agent.instructions.outcome] : null;
|
|
73
|
+
return agent.instructions && reason ? `${agent.instructions.file}: ${reason}` : null;
|
|
74
|
+
};
|
|
55
75
|
var RETRYABLE_UPGRADE_FINISH = { kind: "retryable" };
|
|
56
76
|
var SETTLED_UPGRADE_FINISH = { kind: "settled" };
|
|
57
77
|
var controlWaitsOnThePerson = (readings) => readings.controlPolicy === "legacy" || readings.controlMode === "on" && readings.controlPolicy === "unsupported";
|
|
@@ -275,6 +295,9 @@ var upgradeInstalledPackage = async (subject, effects) => {
|
|
|
275
295
|
};
|
|
276
296
|
|
|
277
297
|
export {
|
|
298
|
+
refreshedPartsOf,
|
|
299
|
+
wasRefreshed,
|
|
300
|
+
instructionsLeftNoteOf,
|
|
278
301
|
upgradeFinishOutcome,
|
|
279
302
|
upgradeFinishExitCode,
|
|
280
303
|
FINISH_UPGRADE_FLAG,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
outcomeOfFailedAsk,
|
|
5
5
|
reportMachineDenial,
|
|
6
6
|
storedWaitDeadline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JPABKXK6.js";
|
|
8
8
|
import {
|
|
9
9
|
isGatingMoment,
|
|
10
10
|
recordKeylessMoment
|
|
@@ -12,11 +12,11 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
isDeferAnswer,
|
|
14
14
|
oncePerSession
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-DHJSBK63.js";
|
|
16
16
|
import {
|
|
17
17
|
activeHookSource,
|
|
18
18
|
activeIdentity
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-N77BH7H2.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_SESSION,
|
|
22
22
|
UNNAMED_ACTION,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
reportEvent,
|
|
41
41
|
scopePathFor,
|
|
42
42
|
settleQuestionsForToolUse
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-U2L42GVI.js";
|
|
44
44
|
import {
|
|
45
45
|
repoKeyFor
|
|
46
46
|
} from "./chunk-JBT3ZSJS.js";
|
|
@@ -56,10 +56,10 @@ import {
|
|
|
56
56
|
sendNotification,
|
|
57
57
|
waitForQuestion,
|
|
58
58
|
waitsForThePhone
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-ZMPR436Z.js";
|
|
60
60
|
import {
|
|
61
61
|
getMachineId
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-T6RIKJUO.js";
|
|
63
63
|
import {
|
|
64
64
|
getApiKey,
|
|
65
65
|
getBaseUrl
|
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-6C4S3QYD.js";
|
|
6
6
|
import {
|
|
7
7
|
AGENT_CHOICES
|
|
8
8
|
} from "./chunk-BUXDR6US.js";
|
|
9
9
|
import {
|
|
10
10
|
BELL_HOOK_BINARY
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LIESRXK5.js";
|
|
12
12
|
import {
|
|
13
13
|
CODEX_HOOK_EVENTS,
|
|
14
14
|
hasCodexHooks,
|
|
15
15
|
holdBudgetOf
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OML4YFBN.js";
|
|
17
17
|
import {
|
|
18
18
|
CURSOR_GATE_EVENTS,
|
|
19
19
|
HOOK_LOCATOR_BINARY,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_SETTINGS_PATH
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JOWF4Y4P.js";
|
|
4
4
|
import {
|
|
5
5
|
readMacAppAgentKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MHQB62K5.js";
|
|
7
7
|
import {
|
|
8
8
|
findExportedKeyLines,
|
|
9
9
|
isAdoptedMacAppKey,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "./chunk-VYBH6D4X.js";
|
|
17
17
|
import {
|
|
18
18
|
absoluteUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-L5YTS2BP.js";
|
|
20
20
|
import {
|
|
21
21
|
isValidApiKey
|
|
22
22
|
} from "./chunk-LF3TLC7B.js";
|