@pushary/agent-hooks 1.9.8 → 1.9.10
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 +14 -0
- package/dist/bin/pushary-bell-hook.js +22 -23
- package/dist/bin/pushary-bell.js +13 -13
- package/dist/bin/pushary-claude.js +26 -27
- package/dist/bin/pushary-clean.js +124 -51
- package/dist/bin/pushary-codex-bridge.js +20 -20
- package/dist/bin/pushary-codex-hook.js +34 -35
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +41 -18
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +35 -37
- package/dist/bin/pushary-disconnect.js +29 -32
- package/dist/bin/pushary-doctor.js +101 -78
- package/dist/bin/pushary-elicitation-hook.js +25 -26
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +29 -30
- package/dist/bin/pushary-hook.js +36 -37
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +18 -78
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +29 -30
- package/dist/bin/pushary-opencode-hook.js +28 -29
- package/dist/bin/pushary-permission-denied-hook.js +30 -31
- package/dist/bin/pushary-permission-hook.js +33 -34
- package/dist/bin/pushary-post-hook.js +30 -31
- package/dist/bin/pushary-prompt-hook.js +29 -30
- package/dist/bin/pushary-session-end-hook.js +29 -30
- package/dist/bin/pushary-session-start-hook.js +33 -35
- package/dist/bin/pushary-setup.js +147 -116
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +48 -18
- package/dist/bin/pushary-stop-hook.js +29 -30
- package/dist/bin/pushary-stopfailure-hook.js +29 -30
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +18 -19
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +38 -44
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-CKV3UPMU.js → chunk-2HFSKYLN.js} +2 -2
- package/dist/{chunk-ZN3C6GBG.js → chunk-2HXG2QDI.js} +4 -4
- package/dist/{chunk-5QUPKDI5.js → chunk-2M52CFVO.js} +1 -1
- package/dist/{chunk-KF3UZLYI.js → chunk-2S34OPHS.js} +1 -1
- package/dist/{chunk-2A53H4S6.js → chunk-5MQYA3YL.js} +22 -21
- package/dist/{chunk-I5IJRMNV.js → chunk-5RGA636G.js} +21 -9
- package/dist/{chunk-IAD2RT4L.js → chunk-6KNC6KLL.js} +4 -4
- package/dist/{chunk-KHNFLYJO.js → chunk-7HGR5GNY.js} +4 -4
- package/dist/{chunk-BEJRK4DF.js → chunk-AKPHYSEL.js} +5 -4
- package/dist/{chunk-ZBK6E2OR.js → chunk-APP43AW7.js} +1 -1
- package/dist/chunk-BOSXFI7L.js +52 -0
- package/dist/{chunk-WS4H76EP.js → chunk-BTFUSQFB.js} +2 -2
- package/dist/{chunk-B64KHETR.js → chunk-BVPPYR7B.js} +3 -3
- package/dist/{chunk-TCWKTUAE.js → chunk-BVSIM4EF.js} +2 -2
- package/dist/{chunk-BXET3ALR.js → chunk-C6QTMWJZ.js} +2 -2
- package/dist/{chunk-IHO3YQAN.js → chunk-CJYM4ZHV.js} +2 -2
- package/dist/{chunk-6TE27XZR.js → chunk-DAOQT4WK.js} +2 -2
- package/dist/{chunk-V5HPPF3E.js → chunk-DL6QHS7V.js} +1 -1
- package/dist/{chunk-DPGSLWOS.js → chunk-DWO4RLYK.js} +10 -10
- package/dist/{chunk-GU3EJCVV.js → chunk-EA5NWDK7.js} +4 -0
- package/dist/{chunk-I6MJXLMY.js → chunk-EVC765EO.js} +2 -2
- package/dist/{chunk-WG3K4TCH.js → chunk-GQYX24UC.js} +1 -1
- package/dist/{chunk-N4QSPI3B.js → chunk-GTZ4HIHU.js} +15 -13
- package/dist/{chunk-DUZVXBBU.js → chunk-H4F5O3RE.js} +1 -1
- package/dist/{chunk-MKTJEXZ3.js → chunk-I3W7GJ5R.js} +3 -3
- package/dist/{chunk-ZSTSEBG7.js → chunk-IIVZZMSO.js} +1 -1
- package/dist/{chunk-KRCR2CRQ.js → chunk-LDQGURCF.js} +11 -11
- package/dist/{chunk-2WXF3QJR.js → chunk-LXA236ZQ.js} +2 -2
- package/dist/{chunk-CD47ZFFZ.js → chunk-MD4SVNT6.js} +1 -1
- package/dist/{chunk-CLOSJ4ES.js → chunk-MISUKJGW.js} +1 -1
- package/dist/{chunk-DKMD6AWR.js → chunk-NQ67AF3V.js} +4 -4
- package/dist/{chunk-HRULIYDU.js → chunk-OL2Z7WI4.js} +2 -2
- package/dist/{chunk-MXHTGVFZ.js → chunk-PNC5ZQFS.js} +16 -20
- package/dist/{chunk-3I6IVOZV.js → chunk-PR2VDVCP.js} +3 -3
- package/dist/{chunk-FQ2GORVG.js → chunk-Q3UMWSE4.js} +2 -2
- package/dist/{chunk-MFF3ONG5.js → chunk-QAGWWDXQ.js} +78 -8
- package/dist/{chunk-M6BZZFVQ.js → chunk-QGRENWJL.js} +1 -1
- package/dist/{chunk-LKLVTG3V.js → chunk-RPQLZLKC.js} +5 -5
- package/dist/{chunk-KFF7G225.js → chunk-S2DAKKQQ.js} +3 -3
- package/dist/chunk-SB2GN6OP.js +71 -0
- package/dist/{chunk-2QGYMY7A.js → chunk-SIHYBIEN.js} +142 -4
- package/dist/{chunk-ZW3XZLJC.js → chunk-SJDMULE7.js} +5 -5
- package/dist/{chunk-IHFDPV7C.js → chunk-SMVMLWCD.js} +1 -1
- package/dist/{chunk-QOLITCIP.js → chunk-T6ZN4TEF.js} +1 -1
- package/dist/{chunk-7DVNSQWF.js → chunk-TCXL5FQQ.js} +2 -2
- package/dist/{chunk-7PT35RY2.js → chunk-U5FP5JIS.js} +2 -2
- package/dist/{chunk-ZBHUHJG6.js → chunk-UJZ7AGSC.js} +6 -4
- package/dist/{chunk-TCQ43LSG.js → chunk-UM5WXBKN.js} +3 -3
- package/dist/{chunk-2QTO5YIT.js → chunk-XKMGHVXW.js} +6 -6
- package/dist/{chunk-LWOO567I.js → chunk-XXLCYKVS.js} +3 -3
- package/dist/{chunk-MGRFDGWU.js → chunk-Y7JM47CI.js} +2 -2
- package/dist/{chunk-NWDG3MSW.js → chunk-YUQHUGTH.js} +1 -1
- package/dist/{chunk-WWOHTTVP.js → chunk-Z2Q2VH43.js} +2 -2
- package/dist/{chunk-DL7XWKYV.js → chunk-ZGADIZDS.js} +2 -2
- package/dist/{chunk-2VZAALEJ.js → chunk-ZSGJYSF2.js} +8 -8
- package/dist/{global-upgrade-I56HNM23.js → global-upgrade-PUM44JUH.js} +6 -6
- package/dist/{paths-AGY43CXS.js → paths-U2MJGNBT.js} +2 -2
- package/dist/{reapply-IA5XUKWW.js → reapply-PRKV4EO7.js} +22 -24
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-B34TAUKV.js → upgrade-lock-QZSVLEM7.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-3Z3A37WD.js +0 -77
- package/dist/chunk-OP7IHC2I.js +0 -24
- package/dist/chunk-YIG2R3BJ.js +0 -145
|
@@ -2,17 +2,23 @@ import {
|
|
|
2
2
|
CLAUDE_HOOK_EVENTS,
|
|
3
3
|
GEMINI_HOOK_EVENTS,
|
|
4
4
|
hasGeminiHooks
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PR2VDVCP.js";
|
|
6
|
+
import {
|
|
7
|
+
AGENT_CHOICES
|
|
8
|
+
} from "./chunk-ZGADIZDS.js";
|
|
9
|
+
import {
|
|
10
|
+
BELL_HOOK_BINARY
|
|
11
|
+
} from "./chunk-GQYX24UC.js";
|
|
6
12
|
import {
|
|
7
13
|
CODEX_HOOK_EVENTS,
|
|
8
14
|
hasCodexHooks,
|
|
9
15
|
holdBudgetOf
|
|
10
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UJZ7AGSC.js";
|
|
11
17
|
import {
|
|
12
18
|
CURSOR_GATE_EVENTS,
|
|
13
19
|
HOOK_LOCATOR_BINARY,
|
|
14
20
|
hookCommandHoldBudget
|
|
15
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5RGA636G.js";
|
|
16
22
|
|
|
17
23
|
// src/diagnostics/bridge.ts
|
|
18
24
|
import { execFileSync } from "child_process";
|
|
@@ -206,6 +212,126 @@ var describeHoldTimeout = (holder) => {
|
|
|
206
212
|
var describeOtherHolder = (holder) => `another hook also registered on ${holder.event}: ${holderExecutable(holder.command)} (${describeHoldTimeout(holder)})`;
|
|
207
213
|
var describeHoldSentence = (agentLabel) => `${agentLabel} waits for every hook on an event, so the terminal cannot move until that one returns, however fast your phone answered.`;
|
|
208
214
|
|
|
215
|
+
// src/setup/hook-ownership.ts
|
|
216
|
+
var commandsIn = (value) => {
|
|
217
|
+
if (Array.isArray(value)) return value.flatMap(commandsIn);
|
|
218
|
+
if (!value || typeof value !== "object") return [];
|
|
219
|
+
return Object.entries(value).flatMap(([key, item]) => key === "command" && typeof item === "string" ? [item] : commandsIn(item));
|
|
220
|
+
};
|
|
221
|
+
var isRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
222
|
+
var hasPaidPusharyCommand = (value) => commandsIn(value).some((command) => {
|
|
223
|
+
const executable = pusharyHookExecutable(command);
|
|
224
|
+
const name = executable?.split(/[/\\]/).pop()?.replace(/\.(cmd|exe|mjs)$/i, "");
|
|
225
|
+
return executable !== null && !isBridgeLocator(executable) && name !== BELL_HOOK_BINARY;
|
|
226
|
+
});
|
|
227
|
+
var hasAppCommand = (value) => commandsIn(value).some((command) => {
|
|
228
|
+
const executable = pusharyHookExecutable(command);
|
|
229
|
+
return executable !== null && isBridgeLocator(executable);
|
|
230
|
+
});
|
|
231
|
+
var mcpBearerKey = (document, containerKey, headersKey) => {
|
|
232
|
+
const servers = isRecord(document?.[containerKey]) ? document[containerKey] : null;
|
|
233
|
+
const pushary = isRecord(servers?.pushary) ? servers.pushary : null;
|
|
234
|
+
const headers = isRecord(pushary?.[headersKey]) ? pushary[headersKey] : null;
|
|
235
|
+
const authorization = headers?.Authorization;
|
|
236
|
+
const match = typeof authorization === "string" ? authorization.trim().match(/^Bearer\s+(\S+)$/) : null;
|
|
237
|
+
return match?.[1] ?? null;
|
|
238
|
+
};
|
|
239
|
+
var captureMcpServer = (document, containerKey) => {
|
|
240
|
+
const container = document[containerKey];
|
|
241
|
+
const servers = isRecord(container) ? container : null;
|
|
242
|
+
if (!servers && Object.hasOwn(document, containerKey)) {
|
|
243
|
+
return { present: false, containerValue: structuredClone(container) };
|
|
244
|
+
}
|
|
245
|
+
return servers && Object.hasOwn(servers, "pushary") ? { present: true, value: structuredClone(servers.pushary) } : { present: false };
|
|
246
|
+
};
|
|
247
|
+
var restoreMcpServer = (document, containerKey, snapshot) => {
|
|
248
|
+
const before = JSON.stringify(document);
|
|
249
|
+
const existing = isRecord(document[containerKey]) ? document[containerKey] : null;
|
|
250
|
+
if (snapshot.present) {
|
|
251
|
+
const servers = existing ?? {};
|
|
252
|
+
servers.pushary = structuredClone(snapshot.value);
|
|
253
|
+
document[containerKey] = servers;
|
|
254
|
+
} else if (Object.hasOwn(snapshot, "containerValue")) {
|
|
255
|
+
document[containerKey] = structuredClone(snapshot.containerValue);
|
|
256
|
+
} else if (existing && Object.hasOwn(existing, "pushary")) {
|
|
257
|
+
delete existing.pushary;
|
|
258
|
+
if (Object.keys(existing).length === 0) delete document[containerKey];
|
|
259
|
+
}
|
|
260
|
+
return JSON.stringify(document) !== before;
|
|
261
|
+
};
|
|
262
|
+
var DEFAULT_HOOKS_KEY_PATH = ["hooks"];
|
|
263
|
+
var hooksAt = (document, hooksKeyPath) => hooksKeyPath.reduce(
|
|
264
|
+
(node, key) => isRecord(node) ? node[key] : void 0,
|
|
265
|
+
document
|
|
266
|
+
);
|
|
267
|
+
var captureHookTakeover = (agent, document, hooksKeyPath = DEFAULT_HOOKS_KEY_PATH) => {
|
|
268
|
+
const located = hooksAt(document, hooksKeyPath);
|
|
269
|
+
const hooks = isRecord(located) ? located : null;
|
|
270
|
+
if (!hooks) return null;
|
|
271
|
+
const captured = {};
|
|
272
|
+
for (const [event, entries] of Object.entries(hooks)) {
|
|
273
|
+
if (!Array.isArray(entries)) continue;
|
|
274
|
+
const appEntries = entries.flatMap((value, index) => isRecord(value) && hasAppCommand(value) ? [{ index, value: structuredClone(value) }] : []);
|
|
275
|
+
if (appEntries.length > 0) captured[event] = appEntries;
|
|
276
|
+
}
|
|
277
|
+
return Object.keys(captured).length > 0 ? { version: 1, agent, hooks: captured } : null;
|
|
278
|
+
};
|
|
279
|
+
var isHookTakeoverReceipt = (value) => {
|
|
280
|
+
if (!isRecord(value) || value.version !== 1 || typeof value.agent !== "string" || !AGENT_CHOICES.includes(value.agent) || !isRecord(value.hooks)) return false;
|
|
281
|
+
const expectsMcp = ["claude_code", "codex", "gemini_cli", "vscode"].includes(value.agent);
|
|
282
|
+
if (value.mcpServer !== void 0 !== expectsMcp) return false;
|
|
283
|
+
if (value.codexTrust !== void 0 !== (value.agent === "codex")) return false;
|
|
284
|
+
if (value.codexTrust !== void 0 && !isRecord(value.codexTrust)) return false;
|
|
285
|
+
if (value.mcpServer !== void 0 && (!isRecord(value.mcpServer) || typeof value.mcpServer.present !== "boolean" || value.mcpServer.present && !Object.hasOwn(value.mcpServer, "value"))) return false;
|
|
286
|
+
return Object.values(value.hooks).every((entries) => Array.isArray(entries) && entries.length > 0 && entries.every((item) => isRecord(item) && Number.isInteger(item.index) && item.index >= 0 && isRecord(item.value)));
|
|
287
|
+
};
|
|
288
|
+
var restoreHookTakeover = (document, receipt) => {
|
|
289
|
+
const before = JSON.stringify(document);
|
|
290
|
+
const appOwnsNow = hookOwnerOf(document) === "app";
|
|
291
|
+
const hooks = isRecord(document.hooks) ? document.hooks : {};
|
|
292
|
+
for (const [event, value] of Object.entries(hooks)) {
|
|
293
|
+
if (!Array.isArray(value)) continue;
|
|
294
|
+
const kept = value.filter((entry) => !hasPaidPusharyCommand(entry));
|
|
295
|
+
if (kept.length === 0) delete hooks[event];
|
|
296
|
+
else hooks[event] = kept;
|
|
297
|
+
}
|
|
298
|
+
if (!appOwnsNow) {
|
|
299
|
+
for (const [event, snapshots] of Object.entries(receipt.hooks)) {
|
|
300
|
+
const entries = Array.isArray(hooks[event]) ? [...hooks[event]] : [];
|
|
301
|
+
for (const snapshot of snapshots) {
|
|
302
|
+
entries.splice(Math.min(snapshot.index, entries.length), 0, structuredClone(snapshot.value));
|
|
303
|
+
}
|
|
304
|
+
hooks[event] = entries;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
document.hooks = hooks;
|
|
308
|
+
return JSON.stringify(document) !== before;
|
|
309
|
+
};
|
|
310
|
+
var hookOwnerOf = (document, appAvailable = true, hooksKeyPath = DEFAULT_HOOKS_KEY_PATH) => hookOwnerOfCommands(commandsIn(hooksAt(document, hooksKeyPath)), appAvailable);
|
|
311
|
+
var hookOwnerOfCommands = (commands, appAvailable = true) => {
|
|
312
|
+
const executables = commands.map(pusharyHookExecutable).filter((executable) => executable !== null);
|
|
313
|
+
if (appAvailable && executables.some(isBridgeLocator)) return "app";
|
|
314
|
+
if (executables.some((executable) => !isBridgeLocator(executable))) return "cli";
|
|
315
|
+
return "none";
|
|
316
|
+
};
|
|
317
|
+
var planHooks = (context) => {
|
|
318
|
+
if (context.owner !== "app") return "install";
|
|
319
|
+
if (context.takeOverHooks) return "install";
|
|
320
|
+
return "keep";
|
|
321
|
+
};
|
|
322
|
+
var describeAppOwnership = (agentName) => `The Pushary Mac app owns ${agentName}'s hooks.`;
|
|
323
|
+
var KEEP_HINT = "Kept with the app's account. Pass --take-over-hooks to have the CLI own them instead.";
|
|
324
|
+
var OWNER_LABELS = {
|
|
325
|
+
app: "the Pushary Mac app",
|
|
326
|
+
cli: "the CLI"
|
|
327
|
+
};
|
|
328
|
+
var describeHookOwnership = (entries, names) => {
|
|
329
|
+
const owned = entries.filter((entry) => entry.owner !== "none");
|
|
330
|
+
if (owned.length === 0) return null;
|
|
331
|
+
const parts = owned.map((entry) => `${names[entry.agent]} by ${OWNER_LABELS[entry.owner]}${entry.kept ? " (kept)" : ""}`);
|
|
332
|
+
return `Hooks: ${parts.join(", ")}.`;
|
|
333
|
+
};
|
|
334
|
+
|
|
209
335
|
export {
|
|
210
336
|
resolveBridgeStub,
|
|
211
337
|
describeBridgeResolution,
|
|
@@ -225,5 +351,17 @@ export {
|
|
|
225
351
|
codexUnprovenHolds,
|
|
226
352
|
holdsLong,
|
|
227
353
|
describeOtherHolder,
|
|
228
|
-
describeHoldSentence
|
|
354
|
+
describeHoldSentence,
|
|
355
|
+
mcpBearerKey,
|
|
356
|
+
captureMcpServer,
|
|
357
|
+
restoreMcpServer,
|
|
358
|
+
captureHookTakeover,
|
|
359
|
+
isHookTakeoverReceipt,
|
|
360
|
+
restoreHookTakeover,
|
|
361
|
+
hookOwnerOf,
|
|
362
|
+
hookOwnerOfCommands,
|
|
363
|
+
planHooks,
|
|
364
|
+
describeAppOwnership,
|
|
365
|
+
KEEP_HINT,
|
|
366
|
+
describeHookOwnership
|
|
229
367
|
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
forkFinishWithUpgradeLock,
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
releaseAutoUpdateLock
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DL6QHS7V.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-U5FP5JIS.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-UJZ7AGSC.js";
|
|
31
31
|
import {
|
|
32
32
|
NPX_LATEST_COMMAND
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-TCXL5FQQ.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-5RGA636G.js";
|
|
43
43
|
|
|
44
44
|
// src/global-upgrade.ts
|
|
45
45
|
import { existsSync } from "fs";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DISCONNECT_AGENT_IDS,
|
|
3
3
|
SETUP_AGENT_CHOICES,
|
|
4
4
|
isApprovalMode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5RGA636G.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/mode-request.ts
|
|
8
8
|
var parseDuration = (value) => {
|
|
@@ -141,7 +141,7 @@ var COMMAND_OPTIONS = {
|
|
|
141
141
|
],
|
|
142
142
|
clean: [
|
|
143
143
|
["--dry-run", "List everything it would remove and change nothing"],
|
|
144
|
-
["--everything", "Also remove what the Mac app set up: quits it, then its keychain items, local state and editor extension"],
|
|
144
|
+
["--everything", "Also revoke the keys the CLI wrote (config.json and its shell profile export) and remove what the Mac app set up: quits it, then its keychain items, local state and editor extension"],
|
|
145
145
|
["--yes", "Remove everything without asking"]
|
|
146
146
|
],
|
|
147
147
|
transcripts: [
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UJZ7AGSC.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
cliPackagePathSegments,
|
|
15
15
|
globalUpgradeEntry,
|
|
16
16
|
ownPackageRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5RGA636G.js";
|
|
18
18
|
|
|
19
19
|
// src/auto-update.ts
|
|
20
20
|
import { spawn } from "child_process";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isReleaseVersion,
|
|
14
14
|
ownPackageName,
|
|
15
15
|
withHookHoldBudget
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5RGA636G.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/paths.ts
|
|
19
19
|
import { homedir as homedir2 } from "os";
|
|
@@ -365,9 +365,9 @@ var installGlobally = (options) => {
|
|
|
365
365
|
}
|
|
366
366
|
const started = (async () => {
|
|
367
367
|
if (!npmIsOnPath()) throw new NpmMissingError();
|
|
368
|
-
const { withUpgradeLock } = await import("./global-upgrade-
|
|
369
|
-
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-
|
|
370
|
-
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-
|
|
368
|
+
const { withUpgradeLock } = await import("./global-upgrade-PUM44JUH.js");
|
|
369
|
+
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-QZSVLEM7.js");
|
|
370
|
+
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-U2MJGNBT.js");
|
|
371
371
|
let result = "skipped";
|
|
372
372
|
const install = async () => {
|
|
373
373
|
const platform = process.platform;
|
|
@@ -438,6 +438,7 @@ var guardHookCommand = (target, platform = process.platform) => {
|
|
|
438
438
|
return `${HOOK_SHELL} '${HOOK_GUARD_SCRIPTS[guardKindOf(target)]}' ${path}`;
|
|
439
439
|
};
|
|
440
440
|
var guardBinary = (path, platform) => guardHookCommand({ kind: "binary", path, runtime: "node" }, platform);
|
|
441
|
+
var guardNodeScript = (script, platform) => guardHookCommand({ kind: "node", script }, platform);
|
|
441
442
|
var guardCursorGate = (script, platform) => guardHookCommand({ kind: "cursor_gate", script }, platform);
|
|
442
443
|
var guardedArgv = (target, args = [], platform = process.platform) => {
|
|
443
444
|
const path = targetPath(target);
|
|
@@ -853,6 +854,7 @@ export {
|
|
|
853
854
|
installGlobally,
|
|
854
855
|
holdBudgetOf,
|
|
855
856
|
guardBinary,
|
|
857
|
+
guardNodeScript,
|
|
856
858
|
guardCursorGate,
|
|
857
859
|
guardedArgv,
|
|
858
860
|
registerHookEntry,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H4F5O3RE.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2M52CFVO.js";
|
|
10
10
|
import {
|
|
11
11
|
clientContextHeaders,
|
|
12
12
|
getPackageVersion
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5RGA636G.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/net.ts
|
|
16
16
|
import { createRequire } from "module";
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EVC765EO.js";
|
|
7
7
|
import {
|
|
8
8
|
daemonHasRemoteProof,
|
|
9
9
|
daemonServiceManagerAvailable,
|
|
10
10
|
hasDaemonServiceDefinition,
|
|
11
11
|
readDaemonNeedsLogin,
|
|
12
12
|
readDaemonStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RPQLZLKC.js";
|
|
14
14
|
import {
|
|
15
15
|
readControlMode,
|
|
16
16
|
readKeySource
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GTZ4HIHU.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-H4F5O3RE.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2M52CFVO.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-5RGA636G.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UM5WXBKN.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-KZERVKTD.js";
|
|
10
10
|
import {
|
|
11
11
|
getBaseUrl
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2M52CFVO.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5RGA636G.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UJZ7AGSC.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5RGA636G.js";
|
|
15
15
|
|
|
16
16
|
// src/codex-app-server.ts
|
|
17
17
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DWO4RLYK.js";
|
|
4
4
|
import {
|
|
5
5
|
writeDegraded
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NQ67AF3V.js";
|
|
7
7
|
|
|
8
8
|
// src/tool-hook-input.ts
|
|
9
9
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
isSetupConnectMode,
|
|
11
11
|
isValidApiKey,
|
|
12
12
|
normalizeAgentId
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5RGA636G.js";
|
|
14
14
|
|
|
15
15
|
// src/setup/options.ts
|
|
16
16
|
var AGENT_CHOICES = SETUP_AGENT_CHOICES;
|
|
@@ -42,7 +42,7 @@ var SETUP_FLAGS = {
|
|
|
42
42
|
bools: ["key-stdin", "skip-phone", "yes", "y", "json", "dry-run", "take-over-hooks", "help", "h"],
|
|
43
43
|
values: ["key", "connect", "agents", "verify", "control", "transcripts"]
|
|
44
44
|
};
|
|
45
|
-
var effectiveControlMode = (options, stored
|
|
45
|
+
var effectiveControlMode = (options, stored) => options.controlExplicit ? options.control : stored ?? options.control;
|
|
46
46
|
var parseAgentSelection = (raw, yes) => {
|
|
47
47
|
if (raw === void 0) {
|
|
48
48
|
return yes ? { kind: "auto" } : { kind: "ask" };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clientErrorKindOf,
|
|
3
|
-
reportClientError
|
|
4
|
-
} from "./chunk-DKMD6AWR.js";
|
|
5
1
|
import {
|
|
6
2
|
SubscriptionRequiredError,
|
|
7
3
|
callMcpTool
|
|
8
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-I3W7GJ5R.js";
|
|
5
|
+
import {
|
|
6
|
+
clientErrorKindOf,
|
|
7
|
+
reportClientError
|
|
8
|
+
} from "./chunk-NQ67AF3V.js";
|
|
9
9
|
import {
|
|
10
10
|
installNetworkDefaults
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UM5WXBKN.js";
|
|
12
12
|
import {
|
|
13
13
|
getBaseUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2M52CFVO.js";
|
|
15
15
|
import {
|
|
16
16
|
ASK_AGENT_NAME_MAX,
|
|
17
17
|
ASK_QUESTION_MAX,
|
|
18
18
|
DECISION_LINE_MAX,
|
|
19
19
|
truncateLine
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5RGA636G.js";
|
|
21
21
|
|
|
22
22
|
// src/api.ts
|
|
23
23
|
import { randomUUID } from "crypto";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readGlobalUpgradeSubject,
|
|
6
6
|
upgradeInstalledPackage,
|
|
7
7
|
withUpgradeLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-SJDMULE7.js";
|
|
9
|
+
import "./chunk-DL6QHS7V.js";
|
|
10
|
+
import "./chunk-U5FP5JIS.js";
|
|
11
11
|
import "./chunk-POFBE6ZY.js";
|
|
12
12
|
import "./chunk-KZERVKTD.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-UJZ7AGSC.js";
|
|
14
14
|
import "./chunk-T7E75EKA.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-TCXL5FQQ.js";
|
|
16
|
+
import "./chunk-5RGA636G.js";
|
|
17
17
|
export {
|
|
18
18
|
finishGlobalUpgrade,
|
|
19
19
|
finishUpgradeWithLock,
|
|
@@ -10,38 +10,36 @@ import {
|
|
|
10
10
|
reapplyOpenCodePlugin,
|
|
11
11
|
reapplyVsCodePlugin,
|
|
12
12
|
repairCodexHolds
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-MGRFDGWU.js";
|
|
16
|
-
import "./chunk-MFF3ONG5.js";
|
|
17
|
-
import "./chunk-KHNFLYJO.js";
|
|
13
|
+
} from "./chunk-PNC5ZQFS.js";
|
|
14
|
+
import "./chunk-Y7JM47CI.js";
|
|
18
15
|
import "./chunk-RIVNNBEK.js";
|
|
19
|
-
import "./chunk-YIG2R3BJ.js";
|
|
20
|
-
import "./chunk-DL7XWKYV.js";
|
|
21
|
-
import "./chunk-2QGYMY7A.js";
|
|
22
|
-
import "./chunk-3I6IVOZV.js";
|
|
23
|
-
import "./chunk-WG3K4TCH.js";
|
|
24
16
|
import "./chunk-XHKBHWLX.js";
|
|
17
|
+
import "./chunk-QAGWWDXQ.js";
|
|
18
|
+
import "./chunk-7HGR5GNY.js";
|
|
19
|
+
import "./chunk-SIHYBIEN.js";
|
|
20
|
+
import "./chunk-PR2VDVCP.js";
|
|
21
|
+
import "./chunk-ZGADIZDS.js";
|
|
22
|
+
import "./chunk-GQYX24UC.js";
|
|
23
|
+
import "./chunk-GMXKITVA.js";
|
|
25
24
|
import "./chunk-6ICPEJY5.js";
|
|
26
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-LDQGURCF.js";
|
|
27
26
|
import "./chunk-N6IOSZOE.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-MD4SVNT6.js";
|
|
28
|
+
import "./chunk-ZSGJYSF2.js";
|
|
29
|
+
import "./chunk-I3W7GJ5R.js";
|
|
30
|
+
import "./chunk-XXLCYKVS.js";
|
|
31
|
+
import "./chunk-NQ67AF3V.js";
|
|
31
32
|
import "./chunk-POFBE6ZY.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-LWOO567I.js";
|
|
35
|
-
import "./chunk-TCQ43LSG.js";
|
|
36
|
-
import "./chunk-DUZVXBBU.js";
|
|
33
|
+
import "./chunk-UM5WXBKN.js";
|
|
34
|
+
import "./chunk-H4F5O3RE.js";
|
|
37
35
|
import "./chunk-7QLSKOSU.js";
|
|
38
36
|
import "./chunk-KZERVKTD.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-Q3UMWSE4.js";
|
|
38
|
+
import "./chunk-UJZ7AGSC.js";
|
|
41
39
|
import "./chunk-T7E75EKA.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-2M52CFVO.js";
|
|
41
|
+
import "./chunk-TCXL5FQQ.js";
|
|
42
|
+
import "./chunk-5RGA636G.js";
|
|
45
43
|
export {
|
|
46
44
|
ensureCodexTrustAfterReapply,
|
|
47
45
|
inspectConfiguredManagedProviders,
|
package/dist/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-ZSTSEBG7.js";
|
|
3
|
+
} from "../chunk-5MQYA3YL.js";
|
|
4
|
+
import "../chunk-CJYM4ZHV.js";
|
|
5
|
+
import "../chunk-IIVZZMSO.js";
|
|
7
6
|
import "../chunk-5OP5MQI7.js";
|
|
8
|
-
import "../chunk-3I6IVOZV.js";
|
|
9
7
|
import {
|
|
10
8
|
fetchAccountPublicKey
|
|
11
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-MISUKJGW.js";
|
|
10
|
+
import "../chunk-7HGR5GNY.js";
|
|
11
|
+
import "../chunk-PR2VDVCP.js";
|
|
12
12
|
import "../chunk-6ICPEJY5.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchModeOverride,
|
|
@@ -18,33 +18,33 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-LDQGURCF.js";
|
|
22
22
|
import "../chunk-N6IOSZOE.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-MD4SVNT6.js";
|
|
24
24
|
import {
|
|
25
25
|
askUser,
|
|
26
26
|
cancelQuestion,
|
|
27
27
|
waitForAnswer
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-ZSGJYSF2.js";
|
|
29
|
+
import "../chunk-I3W7GJ5R.js";
|
|
30
|
+
import "../chunk-XXLCYKVS.js";
|
|
31
|
+
import "../chunk-NQ67AF3V.js";
|
|
30
32
|
import "../chunk-POFBE6ZY.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-TCQ43LSG.js";
|
|
34
|
-
import "../chunk-DUZVXBBU.js";
|
|
33
|
+
import "../chunk-UM5WXBKN.js";
|
|
34
|
+
import "../chunk-H4F5O3RE.js";
|
|
35
35
|
import "../chunk-7QLSKOSU.js";
|
|
36
36
|
import "../chunk-KZERVKTD.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-Q3UMWSE4.js";
|
|
38
|
+
import "../chunk-UJZ7AGSC.js";
|
|
39
39
|
import "../chunk-T7E75EKA.js";
|
|
40
40
|
import {
|
|
41
41
|
getApiKey,
|
|
42
42
|
getBaseUrl
|
|
43
|
-
} from "../chunk-
|
|
44
|
-
import "../chunk-
|
|
43
|
+
} from "../chunk-2M52CFVO.js";
|
|
44
|
+
import "../chunk-TCXL5FQQ.js";
|
|
45
45
|
import {
|
|
46
46
|
resolvePolicy
|
|
47
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-5RGA636G.js";
|
|
48
48
|
export {
|
|
49
49
|
askUser,
|
|
50
50
|
cancelQuestion,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
ownsUpgradeLock,
|
|
7
7
|
releaseAutoUpdateLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-DL6QHS7V.js";
|
|
9
|
+
import "./chunk-UJZ7AGSC.js";
|
|
10
10
|
import "./chunk-T7E75EKA.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-5RGA636G.js";
|
|
12
12
|
export {
|
|
13
13
|
claimUpgradeLock,
|
|
14
14
|
finishWithUpgradeLock,
|