@pushary/agent-hooks 1.9.158 → 1.9.162

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.
Files changed (146) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +1 -0
  3. package/dist/{api-MRFKFDVV.js → api-7NPCSUGY.js} +17 -13
  4. package/dist/bin/pushary-audit.js +7 -7
  5. package/dist/bin/pushary-bell-hook.js +31 -31
  6. package/dist/bin/pushary-bell.js +16 -16
  7. package/dist/bin/pushary-calls.d.ts +1 -0
  8. package/dist/bin/pushary-calls.js +287 -0
  9. package/dist/bin/pushary-claude.js +37 -37
  10. package/dist/bin/pushary-clean.js +47 -45
  11. package/dist/bin/pushary-codex-bridge.js +27 -27
  12. package/dist/bin/pushary-codex-hook.js +197 -60
  13. package/dist/bin/pushary-codex-session.js +8 -8
  14. package/dist/bin/pushary-codex.js +19 -19
  15. package/dist/bin/pushary-connect.js +41 -40
  16. package/dist/bin/pushary-cowork.js +6 -6
  17. package/dist/bin/pushary-daemon.js +52 -51
  18. package/dist/bin/pushary-disconnect.js +39 -37
  19. package/dist/bin/pushary-display-hook.js +20 -1
  20. package/dist/bin/pushary-doctor.js +61 -59
  21. package/dist/bin/pushary-elicitation-hook.js +32 -32
  22. package/dist/bin/pushary-gemini-bridge.js +19 -19
  23. package/dist/bin/pushary-gemini-hook.js +36 -36
  24. package/dist/bin/pushary-hook.js +39 -38
  25. package/dist/bin/pushary-login.js +28 -28
  26. package/dist/bin/pushary-logout.js +34 -33
  27. package/dist/bin/pushary-mcp.js +15 -15
  28. package/dist/bin/pushary-mode.js +21 -21
  29. package/dist/bin/pushary-notification-hook.js +30 -30
  30. package/dist/bin/pushary-opencode-hook.js +399 -45
  31. package/dist/bin/pushary-permission-denied-hook.js +39 -38
  32. package/dist/bin/pushary-permission-hook.js +39 -38
  33. package/dist/bin/pushary-post-hook.js +31 -31
  34. package/dist/bin/pushary-prompt-hook.js +30 -30
  35. package/dist/bin/pushary-session-end-hook.js +30 -30
  36. package/dist/bin/pushary-session-start-hook.js +41 -40
  37. package/dist/bin/pushary-setup.js +73 -72
  38. package/dist/bin/pushary-stats.js +6 -6
  39. package/dist/bin/pushary-status.js +40 -39
  40. package/dist/bin/pushary-stop-hook.js +30 -30
  41. package/dist/bin/pushary-stopfailure-hook.js +30 -30
  42. package/dist/bin/pushary-suggestions.js +21 -21
  43. package/dist/bin/pushary-transcript-register.js +21 -21
  44. package/dist/bin/pushary-transcripts.js +32 -32
  45. package/dist/bin/pushary-upgrade.js +50 -49
  46. package/dist/bin/pushary-wait.js +23 -23
  47. package/dist/bin/pushary.js +10 -9
  48. package/dist/{chunk-RRVFN432.js → chunk-2H7SDIM7.js} +1 -1
  49. package/dist/{chunk-DHI3X5WK.js → chunk-44DRCGP2.js} +2 -2
  50. package/dist/chunk-4IBUBMMP.js +885 -0
  51. package/dist/{chunk-RL5JLDRE.js → chunk-4U3GYVIW.js} +2 -2
  52. package/dist/{chunk-NW63PGKF.js → chunk-53IBMDX2.js} +12 -7
  53. package/dist/{chunk-XNJ2HOEL.js → chunk-5TU26542.js} +3 -3
  54. package/dist/{chunk-UVWKMFLQ.js → chunk-5ZS73ZLX.js} +2 -2
  55. package/dist/{chunk-4SN4FHFZ.js → chunk-644AKJMN.js} +2 -2
  56. package/dist/{chunk-TZJR5ESF.js → chunk-6QQUGYH6.js} +7 -7
  57. package/dist/{chunk-4B5K6YIP.js → chunk-72SYV43F.js} +1 -1
  58. package/dist/{chunk-JKRQL2BL.js → chunk-A5DXHJVS.js} +5 -5
  59. package/dist/{chunk-K3OCYJPK.js → chunk-AP26EU5H.js} +3 -3
  60. package/dist/{chunk-MLPPQ556.js → chunk-AQKMKVAD.js} +13 -13
  61. package/dist/{chunk-N5SSADNW.js → chunk-BHT76IIB.js} +4 -4
  62. package/dist/{chunk-TMWXWBFP.js → chunk-BMOGTNLK.js} +6 -6
  63. package/dist/{chunk-SNQOEDZ2.js → chunk-CSDB5VTI.js} +1 -1
  64. package/dist/{chunk-YPFOTFEG.js → chunk-CWH4LBUW.js} +1 -1
  65. package/dist/{chunk-FTTSQAF4.js → chunk-DAMTDSAE.js} +1 -1
  66. package/dist/{chunk-MHYX5Q3F.js → chunk-DSWUG4NV.js} +1 -1
  67. package/dist/{chunk-K3I2NMEF.js → chunk-EFKJCBWA.js} +8 -8
  68. package/dist/{chunk-CIAJ55EQ.js → chunk-EKELMI3A.js} +42 -34
  69. package/dist/{chunk-EGBI4GRS.js → chunk-EPQTCF6A.js} +2 -2
  70. package/dist/{chunk-4WL2MINE.js → chunk-FIR2MGSB.js} +1 -1
  71. package/dist/{chunk-N2LWKWNY.js → chunk-G5IL6C6S.js} +3 -3
  72. package/dist/{chunk-IKC33YKC.js → chunk-G6M6YJK4.js} +5 -2
  73. package/dist/{chunk-SZMDRBNK.js → chunk-GJOHGES6.js} +2 -2
  74. package/dist/{chunk-TPLTB256.js → chunk-H7OY4AAT.js} +4 -4
  75. package/dist/{chunk-IVOELLUK.js → chunk-HAOYL5JP.js} +39 -8
  76. package/dist/{chunk-Q7WCDUFV.js → chunk-I35XT5YY.js} +6 -6
  77. package/dist/{chunk-AOP55JR2.js → chunk-I5ANEYUK.js} +14 -3
  78. package/dist/{chunk-TKBCLK4B.js → chunk-I5HCOOAA.js} +5 -5
  79. package/dist/{chunk-IIK3CZXJ.js → chunk-IUXXEM4Q.js} +8 -7
  80. package/dist/{chunk-FGVBFDNV.js → chunk-J6KDUXJF.js} +1 -1
  81. package/dist/{chunk-XHCX6DOY.js → chunk-JCTS7COD.js} +5 -5
  82. package/dist/{chunk-AGYD6XNI.js → chunk-L3LFCZ5D.js} +3 -3
  83. package/dist/{chunk-3QU4WXAH.js → chunk-L44II2WD.js} +5 -5
  84. package/dist/{chunk-PBPQRJ2T.js → chunk-L6BMVCQQ.js} +5 -5
  85. package/dist/{chunk-LVZBLKAU.js → chunk-L6NG6EZS.js} +1 -1
  86. package/dist/{chunk-EHRWEXRN.js → chunk-LGR7WXI5.js} +2 -2
  87. package/dist/{chunk-2MPT7YQK.js → chunk-LQDIOUVU.js} +5 -3
  88. package/dist/{chunk-XSIZKQ2C.js → chunk-LVRFOGQY.js} +11 -11
  89. package/dist/{chunk-HA2SRYYP.js → chunk-M2ZGNZRS.js} +94 -0
  90. package/dist/{chunk-ZYDE6QRW.js → chunk-M74WT5NA.js} +3 -3
  91. package/dist/chunk-NX3Y36VY.js +242 -0
  92. package/dist/{chunk-ANQBLZAE.js → chunk-OH2WAG47.js} +1 -1
  93. package/dist/{chunk-GTYVNVBZ.js → chunk-P4KAYIMX.js} +4 -4
  94. package/dist/{chunk-4I2SHNEU.js → chunk-PIIKLAFY.js} +3 -3
  95. package/dist/{chunk-J7HSUQK2.js → chunk-QKNHNDOY.js} +3 -3
  96. package/dist/{chunk-ALQWZCUT.js → chunk-RKURAOFK.js} +4 -4
  97. package/dist/{chunk-TYBVQ33X.js → chunk-RUAGEPUJ.js} +6 -6
  98. package/dist/{chunk-IOKJJ2SY.js → chunk-SFYX32FX.js} +4 -4
  99. package/dist/{chunk-OCWXE4PR.js → chunk-SKA3U7QI.js} +11 -9
  100. package/dist/{chunk-X254TRBU.js → chunk-SQ4RPZ6O.js} +4 -4
  101. package/dist/chunk-SRSXZINE.js +18 -0
  102. package/dist/{chunk-CAMFNSJS.js → chunk-SVVZFXDX.js} +6 -6
  103. package/dist/{chunk-QVVBU2JU.js → chunk-SVWCMYR7.js} +24 -9
  104. package/dist/{chunk-MTITL2IG.js → chunk-TMDCIVZ2.js} +5 -5
  105. package/dist/{chunk-B3BOAYRO.js → chunk-TUXX7TKR.js} +3 -3
  106. package/dist/{chunk-CSZWWPNS.js → chunk-U4LHE5DH.js} +1 -1
  107. package/dist/{chunk-3UNZ7HRN.js → chunk-UBY7NJCU.js} +20 -18
  108. package/dist/{chunk-ORQ7THNZ.js → chunk-UPCIKGWA.js} +1 -1
  109. package/dist/{chunk-WIIMW5YO.js → chunk-UQTQ6HPO.js} +2 -0
  110. package/dist/{chunk-V36P4KS4.js → chunk-V3TWYF32.js} +1 -1
  111. package/dist/{chunk-N3CFEMLS.js → chunk-VGLIGBAJ.js} +6 -6
  112. package/dist/{chunk-PND5IGC7.js → chunk-VUGF2OC7.js} +6 -6
  113. package/dist/{chunk-APCJZFTJ.js → chunk-W3FE7GTH.js} +1 -1
  114. package/dist/{chunk-GHHVXARK.js → chunk-WCWWO5QL.js} +1 -1
  115. package/dist/{chunk-TSR3FPGL.js → chunk-WIFMTEQI.js} +1 -1
  116. package/dist/{chunk-AMIUB22C.js → chunk-WWSR5LMP.js} +1 -1
  117. package/dist/{chunk-CCKY3JDB.js → chunk-X5QSIMXA.js} +4 -4
  118. package/dist/{chunk-T3PZQNIK.js → chunk-XIICM4TX.js} +2 -2
  119. package/dist/{chunk-C6PAIHLP.js → chunk-XOSSXRIR.js} +10 -10
  120. package/dist/{chunk-QP3TCKRZ.js → chunk-Y3ELKLNH.js} +18 -16
  121. package/dist/{chunk-H6CL3T2S.js → chunk-Y6ILCLKE.js} +1 -1
  122. package/dist/{chunk-UDLWNOXX.js → chunk-YEVRMDG7.js} +2 -2
  123. package/dist/{chunk-CS4Z44F5.js → chunk-YH6EHCKQ.js} +87 -8
  124. package/dist/{chunk-2L52USKM.js → chunk-YPG3RXWO.js} +3 -3
  125. package/dist/{chunk-AZZNHW3R.js → chunk-YUF3AYAP.js} +9 -6
  126. package/dist/{chunk-4NHQAMSK.js → chunk-Z23SHFIC.js} +4 -4
  127. package/dist/{chunk-6GGK3T24.js → chunk-ZC42UG7B.js} +5 -5
  128. package/dist/{chunk-UPI3JDHZ.js → chunk-ZT55PJSW.js} +3 -3
  129. package/dist/{chunk-PI3BOI3A.js → chunk-ZWNFP4HZ.js} +1 -1
  130. package/dist/{codex-app-cards-switch-CXXDGH7R.js → codex-app-cards-switch-PJEY3EU5.js} +14 -14
  131. package/dist/{codex-card-routing-WP4IHJFN.js → codex-card-routing-MNAMCRPO.js} +2 -2
  132. package/dist/{codex-desktop-launch-EN7ACHC6.js → codex-desktop-launch-AUNDRYOL.js} +1 -1
  133. package/dist/{codex-session-launch-7BV4VTJW.js → codex-session-launch-IZNSTT7N.js} +23 -23
  134. package/dist/{config-SZMMBOJV.js → config-LG2RJO37.js} +4 -4
  135. package/dist/{global-upgrade-I5J6BDHA.js → global-upgrade-QE5Q3BYW.js} +11 -11
  136. package/dist/{identity-GLJNTNHW.js → identity-3BT6LWOP.js} +5 -5
  137. package/dist/{live-capabilities-AYO7FOHS.js → live-capabilities-IKTQBLVH.js} +5 -5
  138. package/dist/{paths-NRBEF3T2.js → paths-VEUTZJOY.js} +4 -4
  139. package/dist/reapply-BC2AF55M.js +69 -0
  140. package/dist/src/index.js +39 -38
  141. package/dist/{upgrade-lock-H6SU7MJR.js → upgrade-lock-NUGEPR75.js} +5 -5
  142. package/dist/usage-TEB5CX2Y.js +11 -0
  143. package/package.json +2 -1
  144. package/dist/chunk-GLDSXDRV.js +0 -593
  145. package/dist/reapply-J2QUV7J2.js +0 -68
  146. package/dist/usage-MY3DIFBG.js +0 -11
@@ -11,10 +11,10 @@ import {
11
11
  isNewerVersion,
12
12
  isReleaseVersion,
13
13
  ownPackageName
14
- } from "./chunk-WIIMW5YO.js";
14
+ } from "./chunk-UQTQ6HPO.js";
15
15
  import {
16
16
  redactSecretsFromContent
17
- } from "./chunk-HA2SRYYP.js";
17
+ } from "./chunk-M2ZGNZRS.js";
18
18
 
19
19
  // src/shell-quote.ts
20
20
  var shellDoubleQuoted = (text) => `"${text.replace(/(["\\$`])/g, "\\$1")}"`;
@@ -398,10 +398,39 @@ var fetchLatestPublishedVersion = async (request) => {
398
398
  };
399
399
  var POSIX_SHELL_WORD = /^[\w@%+=:,./-]+$/;
400
400
  var quoteForPosixShell = (value) => POSIX_SHELL_WORD.test(value) ? value : `'${value.replaceAll("'", `'\\''`)}'`;
401
+ var prefixFlagOf = (request) => request.prefix === void 0 ? "" : ` --prefix ${quoteForPosixShell(request.prefix)}`;
402
+ var packageSpecOf = (request) => quoteForPosixShell(`${request.packageName}@${request.version}`);
401
403
  var installPackageGlobally = (request, runNpm = execNpm) => {
402
- const prefixFlag = request.prefix === void 0 ? "" : ` --prefix ${quoteForPosixShell(request.prefix)}`;
403
- const spec = quoteForPosixShell(`${request.packageName}@${request.version}`);
404
- runNpm(`install -g --no-workspaces${prefixFlag} ${spec}`, { timeout: request.timeoutMs });
404
+ runNpm(`install -g --no-workspaces${prefixFlagOf(request)} ${packageSpecOf(request)}`, { timeout: request.timeoutMs });
405
+ };
406
+ var PREVIEW_TIMEOUT_MS = 3e4;
407
+ var UNAVAILABLE_PREVIEW = { kind: "unavailable" };
408
+ var npmOutputText = (output) => typeof output === "string" ? output : Buffer.isBuffer(output) ? output.toString() : "";
409
+ var packedVersionOf = (entry, packageName) => {
410
+ if (typeof entry !== "object" || entry === null || Reflect.get(entry, "name") !== packageName) return void 0;
411
+ const version = Reflect.get(entry, "version");
412
+ return typeof version === "string" && isReleaseVersion(version) ? version : void 0;
413
+ };
414
+ var packedPackageVersionIn = (output, packageName) => {
415
+ try {
416
+ const packed = JSON.parse(output);
417
+ return Array.isArray(packed) ? packed.map((entry) => packedVersionOf(entry, packageName)).find((version) => version !== void 0) : void 0;
418
+ } catch {
419
+ return void 0;
420
+ }
421
+ };
422
+ var previewGlobalInstall = (request, runNpm = execNpm) => {
423
+ try {
424
+ const output = runNpm(`pack --global --dry-run --json --ignore-scripts --no-workspaces${prefixFlagOf(request)} ${packageSpecOf(request)}`, { timeout: Math.min(request.timeoutMs, PREVIEW_TIMEOUT_MS) });
425
+ const version = packedPackageVersionIn(npmOutputText(output), request.packageName);
426
+ return version === void 0 ? UNAVAILABLE_PREVIEW : { kind: "resolved", version };
427
+ } catch (error) {
428
+ return npmExitedOnReleaseAge(error) ? { kind: "refused_for_release_age", refusal: error } : UNAVAILABLE_PREVIEW;
429
+ }
430
+ };
431
+ var throwIfNpmPolicyRefuses = (request, runNpm = execNpm) => {
432
+ const preview = previewGlobalInstall(request, runNpm);
433
+ if (preview.kind === "refused_for_release_age") throw preview.refusal;
405
434
  };
406
435
  var needsGlobalInstall = (requested, installed, binaryPresent) => requested !== installed || !binaryPresent;
407
436
  var setupWouldDowngrade = (requested, installed) => installed !== void 0 && isReleaseVersion(installed) && isReleaseVersion(requested) && isNewerVersion(installed, requested);
@@ -426,9 +455,9 @@ var installGlobally = (options) => {
426
455
  }
427
456
  const started = (async () => {
428
457
  if (!npmIsOnPath()) throw new NpmMissingError();
429
- const { withUpgradeLock } = await import("./global-upgrade-I5J6BDHA.js");
430
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-H6SU7MJR.js");
431
- const { autoUpdateLock } = await import("./paths-NRBEF3T2.js");
458
+ const { withUpgradeLock } = await import("./global-upgrade-QE5Q3BYW.js");
459
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-NUGEPR75.js");
460
+ const { autoUpdateLock } = await import("./paths-VEUTZJOY.js");
432
461
  let result = "skipped";
433
462
  const install = async () => {
434
463
  const platform = process.platform;
@@ -509,6 +538,8 @@ export {
509
538
  quoteIfNeeded,
510
539
  fetchLatestPublishedVersion,
511
540
  installPackageGlobally,
541
+ previewGlobalInstall,
542
+ throwIfNpmPolicyRefuses,
512
543
  plannedGlobalPackage,
513
544
  installGlobally
514
545
  };
@@ -13,10 +13,10 @@ import {
13
13
  uninstallOpenClawPlugin,
14
14
  unsetOpenClawEntry,
15
15
  writeOpenClawEntry
16
- } from "./chunk-CCKY3JDB.js";
16
+ } from "./chunk-X5QSIMXA.js";
17
17
  import {
18
18
  needsShell
19
- } from "./chunk-H6CL3T2S.js";
19
+ } from "./chunk-Y6ILCLKE.js";
20
20
  import {
21
21
  OPENCLAW_ENVIRONMENT_KEYS,
22
22
  hermesAppWiringRecord,
@@ -25,10 +25,10 @@ import {
25
25
  openClawDirectoriesToLookIn,
26
26
  openClawPluginFolder,
27
27
  openClawSetupReceiptDirectory
28
- } from "./chunk-B3BOAYRO.js";
28
+ } from "./chunk-TUXX7TKR.js";
29
29
  import {
30
30
  resolvePathBinary
31
- } from "./chunk-IVOELLUK.js";
31
+ } from "./chunk-HAOYL5JP.js";
32
32
  import {
33
33
  readJsonSafe,
34
34
  writeJsonAtomic
@@ -36,10 +36,10 @@ import {
36
36
  import {
37
37
  isNewerVersion,
38
38
  isReleaseVersion
39
- } from "./chunk-WIIMW5YO.js";
39
+ } from "./chunk-UQTQ6HPO.js";
40
40
  import {
41
41
  isRecord
42
- } from "./chunk-HA2SRYYP.js";
42
+ } from "./chunk-M2ZGNZRS.js";
43
43
 
44
44
  // src/hermes/plugin-payload.ts
45
45
  import { createHash } from "crypto";
@@ -1,11 +1,12 @@
1
1
  import {
2
+ LATEST_DIST_TAG,
2
3
  isReleaseVersion
3
- } from "./chunk-WIIMW5YO.js";
4
+ } from "./chunk-UQTQ6HPO.js";
4
5
  import {
5
6
  DISCONNECT_AGENT_IDS,
6
7
  SETUP_AGENT_CHOICES,
7
8
  isApprovalMode
8
- } from "./chunk-HA2SRYYP.js";
9
+ } from "./chunk-M2ZGNZRS.js";
9
10
 
10
11
  // src/cli/mode-request.ts
11
12
  var parseDuration = (value) => {
@@ -38,8 +39,9 @@ var describeMode = (mode) => {
38
39
  // src/cli/commands.ts
39
40
  var npxLatestCommandFor = (platform) => `${platform === "win32" ? "npx.cmd" : "npx"} pushary@latest`;
40
41
  var NPX_LATEST_COMMAND = npxLatestCommandFor(process.platform);
42
+ var isRecoveryVersion = (version) => version === LATEST_DIST_TAG || isReleaseVersion(version) && version !== "0.0.0";
41
43
  var npmExecSetupCommandFor = (platform, agents, version) => {
42
- if (!isReleaseVersion(version) || version === "0.0.0") throw new Error("Recovery requires a known release version");
44
+ if (!isRecoveryVersion(version)) throw new Error("Recovery requires a known release version or the latest tag");
43
45
  return `${platform === "win32" ? "npm.cmd" : "npm"} exec --yes --package=pushary@${version} -c "pushary setup --agents ${agents.join(",")}"`;
44
46
  };
45
47
  var COMMAND_LIST = [
@@ -118,6 +120,7 @@ var COMMAND_LIST = [
118
120
  { name: "clean", module: "pushary-clean", summary: "Remove Pushary from this machine (--everything: the Mac app's setup too, --dry-run: preview)" },
119
121
  { name: "mode", module: "pushary-mode", summary: "Choose where approval requests appear" },
120
122
  { name: "wait", module: "pushary-wait", summary: 'Show or set the "wait for your phone" ladder (pushary wait 45)' },
123
+ { name: "calls", module: "pushary-calls", summary: "Get a phone call when an approval waits: add your number, confirm it, turn calls on or off" },
121
124
  { name: "stats", module: "pushary-stats", summary: "Show the approval moments your agents hit while not connected" },
122
125
  {
123
126
  name: "audit",
@@ -180,6 +183,14 @@ var COMMAND_OPTIONS = {
180
183
  ["--everything", "Also revoke the key this CLI created (any other key is only removed) and remove what the Mac app set up: quits it, then its keychain items, local state and editor extension"],
181
184
  ["--yes", "Remove everything without asking"]
182
185
  ],
186
+ calls: [
187
+ ["on", "Add your number, confirm it with a test call, and turn calls on"],
188
+ ["off", "Turn calls off"],
189
+ ["status", "Show your number, whether calls are on, and minutes left (default)"],
190
+ ["--number <+1 415 555 0134>", "Your mobile number with its country code, instead of being asked"],
191
+ ["--name <first name>", "The name the call greets you with, instead of being asked"],
192
+ ["--yes", "Agree to be called without being asked"]
193
+ ],
183
194
  transcripts: [
184
195
  ["on", "Sync encrypted transcripts from this machine so your phone shows the conversation"],
185
196
  ["off", "Stop syncing transcripts from this machine"],
@@ -4,13 +4,13 @@ import {
4
4
  configFailureKind,
5
5
  retryAgentCommand,
6
6
  writeSetupConfigFile
7
- } from "./chunk-2L52USKM.js";
7
+ } from "./chunk-YPG3RXWO.js";
8
8
  import {
9
9
  MCP_BRIDGE_BINARY
10
- } from "./chunk-K3OCYJPK.js";
10
+ } from "./chunk-AP26EU5H.js";
11
11
  import {
12
12
  KEY_FILE_MODE
13
- } from "./chunk-ZYDE6QRW.js";
13
+ } from "./chunk-M74WT5NA.js";
14
14
  import {
15
15
  CLINE_SERVER_NAME_TAKEN,
16
16
  CLINE_SETTINGS_REFUSALS,
@@ -32,10 +32,10 @@ import {
32
32
  withClinePusharyServer,
33
33
  withRefreshedClineKey,
34
34
  withoutClinePusharyServer
35
- } from "./chunk-B3BOAYRO.js";
35
+ } from "./chunk-TUXX7TKR.js";
36
36
  import {
37
37
  resolveGlobalBinary
38
- } from "./chunk-IVOELLUK.js";
38
+ } from "./chunk-HAOYL5JP.js";
39
39
  import {
40
40
  readJsonSafe,
41
41
  writeFileAtomic,
@@ -2,31 +2,31 @@ import {
2
2
  SIGNED_OUT_ON_MAC_MESSAGE,
3
3
  describeSignedOutKey,
4
4
  readSignedOutDiagnosis
5
- } from "./chunk-DHI3X5WK.js";
5
+ } from "./chunk-44DRCGP2.js";
6
6
  import {
7
7
  APPROVAL_RULES_PATH
8
- } from "./chunk-SZMDRBNK.js";
8
+ } from "./chunk-GJOHGES6.js";
9
9
  import {
10
10
  createIo
11
- } from "./chunk-GHHVXARK.js";
11
+ } from "./chunk-WCWWO5QL.js";
12
12
  import {
13
13
  absoluteUrl,
14
14
  checkApiKey,
15
15
  describeKeyCheck,
16
16
  keyCheckFromResponse
17
- } from "./chunk-PBPQRJ2T.js";
17
+ } from "./chunk-L6BMVCQQ.js";
18
18
  import {
19
19
  readKeySource
20
- } from "./chunk-ZYDE6QRW.js";
20
+ } from "./chunk-M74WT5NA.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-FTTSQAF4.js";
23
+ } from "./chunk-DAMTDSAE.js";
24
24
  import {
25
25
  EXIT
26
26
  } from "./chunk-BG4HHB7E.js";
27
27
  import {
28
28
  KEY_SCOPE
29
- } from "./chunk-HA2SRYYP.js";
29
+ } from "./chunk-M2ZGNZRS.js";
30
30
 
31
31
  // src/cli/report-key.ts
32
32
  var { dim, yellow } = createIo();
@@ -108,5 +108,6 @@ var exitOnFailedSettingsRequest = async (response, settings) => {
108
108
 
109
109
  export {
110
110
  printKeyCheck,
111
+ exitOnFailedResponse,
111
112
  exitOnFailedSettingsRequest
112
113
  };
@@ -9,7 +9,7 @@ import {
9
9
  isSetupConnectMode,
10
10
  isValidApiKey,
11
11
  normalizeAgentId
12
- } from "./chunk-HA2SRYYP.js";
12
+ } from "./chunk-M2ZGNZRS.js";
13
13
 
14
14
  // src/setup/options.ts
15
15
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-OYIN77HO.js";
6
6
  import {
7
7
  readMacAppAgentKey
8
- } from "./chunk-X254TRBU.js";
8
+ } from "./chunk-SQ4RPZ6O.js";
9
9
  import {
10
10
  API_KEYS_PATH
11
- } from "./chunk-SZMDRBNK.js";
11
+ } from "./chunk-GJOHGES6.js";
12
12
  import {
13
13
  absoluteUrl
14
- } from "./chunk-PBPQRJ2T.js";
14
+ } from "./chunk-L6BMVCQQ.js";
15
15
  import {
16
16
  findExportedKeyLines,
17
17
  isAdoptedMacAppKey,
@@ -21,10 +21,10 @@ import {
21
21
  readConfigFileKey,
22
22
  readKeySource,
23
23
  readMacAppKeyPrefix
24
- } from "./chunk-ZYDE6QRW.js";
24
+ } from "./chunk-M74WT5NA.js";
25
25
  import {
26
26
  isValidApiKey
27
- } from "./chunk-HA2SRYYP.js";
27
+ } from "./chunk-M2ZGNZRS.js";
28
28
 
29
29
  // src/cli/held-key-revocation.ts
30
30
  var readCliHeldKeys = (profiles) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  realpath
3
- } from "./chunk-EGBI4GRS.js";
3
+ } from "./chunk-EPQTCF6A.js";
4
4
  import {
5
5
  findNativeClaudeInstall
6
6
  } from "./chunk-CYTPQDQY.js";
@@ -12,7 +12,7 @@ import {
12
12
  resolvePackageVersionFromBinary,
13
13
  resolvePathBinary,
14
14
  resolvePathBinaryAsync
15
- } from "./chunk-IVOELLUK.js";
15
+ } from "./chunk-HAOYL5JP.js";
16
16
  import {
17
17
  CLAUDE_BRIDGE_CAPABILITY,
18
18
  CLAUDE_RESUME_CAPABILITY,
@@ -23,7 +23,7 @@ import {
23
23
  MANAGED_PROVIDERS,
24
24
  SPAWN_CAPABILITY,
25
25
  sessionProvidersAdvertisedBy
26
- } from "./chunk-HA2SRYYP.js";
26
+ } from "./chunk-M2ZGNZRS.js";
27
27
 
28
28
  // src/live-capabilities.ts
29
29
  import { accessSync, constants, statSync as statSync2 } from "fs";
@@ -1,22 +1,22 @@
1
1
  import {
2
2
  cursorGateOwnsClaudeCall,
3
3
  readCursorGateRegistration
4
- } from "./chunk-GTYVNVBZ.js";
4
+ } from "./chunk-P4KAYIMX.js";
5
5
  import {
6
6
  registerTranscript
7
- } from "./chunk-C6PAIHLP.js";
7
+ } from "./chunk-XOSSXRIR.js";
8
8
  import {
9
9
  namedEvent
10
- } from "./chunk-MTITL2IG.js";
10
+ } from "./chunk-TMDCIVZ2.js";
11
11
  import {
12
12
  writeDegraded
13
- } from "./chunk-CS4Z44F5.js";
13
+ } from "./chunk-YH6EHCKQ.js";
14
14
  import {
15
15
  claudeShapedHookInput,
16
16
  hookCompatibleProfileBySource,
17
17
  isGrokHookPayload,
18
18
  isGrokSessionEndStop
19
- } from "./chunk-HA2SRYYP.js";
19
+ } from "./chunk-M2ZGNZRS.js";
20
20
 
21
21
  // src/tool-hook-input.ts
22
22
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-PND5IGC7.js";
3
+ } from "./chunk-VUGF2OC7.js";
4
+ import {
5
+ getBaseUrl
6
+ } from "./chunk-DAMTDSAE.js";
4
7
  import {
5
8
  NetworkError
6
9
  } from "./chunk-YU2EUD7O.js";
7
- import {
8
- getBaseUrl
9
- } from "./chunk-FTTSQAF4.js";
10
10
  import {
11
11
  EXIT
12
12
  } from "./chunk-BG4HHB7E.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-HA2SRYYP.js";
16
+ } from "./chunk-M2ZGNZRS.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;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-HA2SRYYP.js";
4
+ } from "./chunk-M2ZGNZRS.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-B3BOAYRO.js";
3
+ } from "./chunk-TUXX7TKR.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-TODDEIYG.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-HA2SRYYP.js";
9
+ } from "./chunk-M2ZGNZRS.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-B3BOAYRO.js";
3
+ } from "./chunk-TUXX7TKR.js";
4
4
  import {
5
5
  installPackageGlobally,
6
- npmErrorMessage
7
- } from "./chunk-IVOELLUK.js";
6
+ npmErrorMessage,
7
+ throwIfNpmPolicyRefuses
8
+ } from "./chunk-HAOYL5JP.js";
8
9
  import {
9
10
  writeJsonAtomic
10
11
  } from "./chunk-TODDEIYG.js";
@@ -165,6 +166,7 @@ var writeSettledLockRecord = (path) => writeJsonAtomic(path, { pid: process.pid,
165
166
  var installWithUpgradeLock = (request, lockPath = autoUpdateLock(), runNpm) => {
166
167
  const path = canonicalLockPath(lockPath);
167
168
  if (!heldLocks.has(path)) throw new Error("Cannot install an upgrade without its lock");
169
+ throwIfNpmPolicyRefuses(request, runNpm);
168
170
  writeJsonAtomic(path, { pid: process.pid, format: KERNEL_LOCK_FORMAT, installationPending: true }, 384);
169
171
  installPackageGlobally(request, runNpm);
170
172
  writeSettledLockRecord(path);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ensureCodexTrustsPusharyHooks
3
- } from "./chunk-4NHQAMSK.js";
3
+ } from "./chunk-Z23SHFIC.js";
4
4
  import {
5
5
  hermesReceiptPaths,
6
6
  hermesSetupPredatesThePluginFolder,
@@ -9,7 +9,7 @@ import {
9
9
  refreshHermesPluginFiles,
10
10
  refreshOpenClawPlugin,
11
11
  shippedHermesPlugin
12
- } from "./chunk-Q7WCDUFV.js";
12
+ } from "./chunk-I35XT5YY.js";
13
13
  import {
14
14
  fxIgnoresInstructionsFile,
15
15
  fxInstructionsBody,
@@ -18,7 +18,7 @@ import {
18
18
  macAppFxBridge,
19
19
  refreshClineKey,
20
20
  switchFxHttpEntryToBridge
21
- } from "./chunk-TKBCLK4B.js";
21
+ } from "./chunk-I5HCOOAA.js";
22
22
  import {
23
23
  OPENCODE_HOOK_BINARY,
24
24
  agentHookOwner,
@@ -31,16 +31,16 @@ import {
31
31
  openCodePluginDir,
32
32
  openCodeWired,
33
33
  withOpenCodeAskRules
34
- } from "./chunk-GLDSXDRV.js";
34
+ } from "./chunk-NX3Y36VY.js";
35
35
  import {
36
36
  detectClaudeVersion
37
- } from "./chunk-EGBI4GRS.js";
37
+ } from "./chunk-EPQTCF6A.js";
38
38
  import {
39
39
  addCompatibleHooks,
40
40
  compatibleConfigFile,
41
41
  compatibleInstructionsFile,
42
42
  hasCompatibleHooks
43
- } from "./chunk-MTITL2IG.js";
43
+ } from "./chunk-TMDCIVZ2.js";
44
44
  import {
45
45
  GEMINI_HOOK_BINARY,
46
46
  addGeminiHooks,
@@ -52,10 +52,10 @@ import {
52
52
  geminiWired,
53
53
  hasGeminiHooks,
54
54
  planHooks
55
- } from "./chunk-TPLTB256.js";
55
+ } from "./chunk-H7OY4AAT.js";
56
56
  import {
57
57
  KEY_FILE_MODE
58
- } from "./chunk-ZYDE6QRW.js";
58
+ } from "./chunk-M74WT5NA.js";
59
59
  import {
60
60
  CLAUDE_CODE_PUSHARY_PERMISSION_RULES,
61
61
  CLAUDE_HOOK_BINARY,
@@ -102,13 +102,13 @@ import {
102
102
  renderAgentInstructions,
103
103
  supportedClaudeEvents,
104
104
  vscodePluginMcp
105
- } from "./chunk-B3BOAYRO.js";
105
+ } from "./chunk-TUXX7TKR.js";
106
106
  import {
107
107
  formatVersion,
108
108
  hookCommandsUseBareNames,
109
109
  resolveGlobalBinDir,
110
110
  resolveGlobalBinary
111
- } from "./chunk-IVOELLUK.js";
111
+ } from "./chunk-HAOYL5JP.js";
112
112
  import {
113
113
  readJsonSafe,
114
114
  writeFileAtomic,
@@ -118,7 +118,7 @@ import {
118
118
  HOOK_COMPATIBLE_PROFILES,
119
119
  isCompatibleAgentType,
120
120
  isRecord
121
- } from "./chunk-HA2SRYYP.js";
121
+ } from "./chunk-M2ZGNZRS.js";
122
122
 
123
123
  // src/reapply.ts
124
124
  import { dirname, join } from "path";
@@ -3596,6 +3596,93 @@ var shellCommandStringOf = (shell, args) => {
3596
3596
  return operand === void 0 || operand.expands ? UNREADABLE2 : { kind: "readable", script: operand.text };
3597
3597
  };
3598
3598
 
3599
+ // ../contracts/src/phone-call-setup.ts
3600
+ var PHONE_CALL_SETUP_PATH = "/api/v1/server/calls";
3601
+ var PHONE_CALL_SETUP_TEST_CALL_PARAM = "testCall";
3602
+ var TEST_CALL_PROGRESS = ["calling", "confirmed", "not_confirmed", "not_answered", "failed"];
3603
+ var PHONE_NUMBER_REJECTIONS = [
3604
+ "not_a_number",
3605
+ "not_a_supported_country",
3606
+ "crown_dependency_number",
3607
+ "service_number",
3608
+ "not_a_mobile_number",
3609
+ "wrong_length",
3610
+ "country_not_available"
3611
+ ];
3612
+ var PHONE_CALL_SETUP_ERRORS = [
3613
+ "unauthorized",
3614
+ "no_site",
3615
+ "not_available",
3616
+ "invalid_input",
3617
+ "phone_rejected",
3618
+ "phone_required",
3619
+ "consent_required",
3620
+ "invalid_rules",
3621
+ "invalid_time_zone",
3622
+ "invalid_name",
3623
+ "country_not_available",
3624
+ "daily_test_limit",
3625
+ "number_test_limit",
3626
+ "no_minutes",
3627
+ "not_entitled",
3628
+ "daily_limit",
3629
+ "busy",
3630
+ "provider_failed",
3631
+ "unknown_call"
3632
+ ];
3633
+ var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3634
+ var isOneOf = (values, value) => typeof value === "string" && values.includes(value);
3635
+ var isNullableString = (value) => value === null || typeof value === "string";
3636
+ var isWholeNumber = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
3637
+ var isStringList = (value) => Array.isArray(value) && value.every((item) => typeof item === "string");
3638
+ var STATUS_BOOLEANS = ["confirmed", "consented", "enabled", "ready", "weekdaysOnly", "entitled"];
3639
+ var STATUS_COUNTS = ["callAfterSeconds", "startHour", "endHour", "secondsLeft", "testCallsLeftToday"];
3640
+ var parsePhoneCallSetupStatus = (value) => {
3641
+ if (!isRecord2(value)) return null;
3642
+ if (!isNullableString(value.number) || !isNullableString(value.firstName)) return null;
3643
+ if (typeof value.timeZone !== "string" || typeof value.suggestedCountry !== "string" || !isStringList(value.liveCountries)) return null;
3644
+ if (!STATUS_BOOLEANS.every((field) => typeof value[field] === "boolean")) return null;
3645
+ if (!STATUS_COUNTS.every((field) => isWholeNumber(value[field]))) return null;
3646
+ return {
3647
+ number: value.number,
3648
+ firstName: value.firstName,
3649
+ timeZone: value.timeZone,
3650
+ confirmed: value.confirmed === true,
3651
+ consented: value.consented === true,
3652
+ enabled: value.enabled === true,
3653
+ ready: value.ready === true,
3654
+ callAfterSeconds: Number(value.callAfterSeconds),
3655
+ startHour: Number(value.startHour),
3656
+ endHour: Number(value.endHour),
3657
+ weekdaysOnly: value.weekdaysOnly === true,
3658
+ entitled: value.entitled === true,
3659
+ secondsLeft: Number(value.secondsLeft),
3660
+ testCallsLeftToday: Number(value.testCallsLeftToday),
3661
+ liveCountries: value.liveCountries,
3662
+ suggestedCountry: value.suggestedCountry
3663
+ };
3664
+ };
3665
+ var parseRefusal = (value) => {
3666
+ if (!isOneOf(PHONE_CALL_SETUP_ERRORS, value.error)) return null;
3667
+ if (value.phoneRejection === void 0) return { ok: false, error: value.error };
3668
+ return isOneOf(PHONE_NUMBER_REJECTIONS, value.phoneRejection) ? { ok: false, error: value.error, phoneRejection: value.phoneRejection } : null;
3669
+ };
3670
+ var parsePhoneCallSetupReply = (value) => {
3671
+ if (!isRecord2(value)) return null;
3672
+ if (value.ok === false) return parseRefusal(value);
3673
+ if (value.ok !== true) return null;
3674
+ const status = parsePhoneCallSetupStatus(value.status);
3675
+ if (status === null) return null;
3676
+ if (value.testCallId === void 0) return { ok: true, status };
3677
+ return typeof value.testCallId === "string" && value.testCallId.length > 0 ? { ok: true, status, testCallId: value.testCallId } : null;
3678
+ };
3679
+ var parseTestCallReply = (value) => {
3680
+ if (!isRecord2(value)) return null;
3681
+ if (value.ok === true) return isOneOf(TEST_CALL_PROGRESS, value.progress) ? { ok: true, progress: value.progress } : null;
3682
+ if (value.ok === false && isOneOf(PHONE_CALL_SETUP_ERRORS, value.error)) return { ok: false, error: value.error };
3683
+ return null;
3684
+ };
3685
+
3599
3686
  // ../contracts/src/chatgpt-plugin.ts
3600
3687
  var CHATGPT_CONNECTOR_TEST = `@Pushary use ask_user to ask \u201C${CONNECTOR_SETUP_QUESTION}\u201D with type \u201Cconfirm\u201D and agentName \u201CChatGPT - Setup check\u201D. Wait for my answer and tell me which answer you received.`;
3601
3688
  var CHATGPT_CONNECTOR_STARTER = `@Pushary ${connectorStarterPrompt("Use agentName \u201CChatGPT - <task name>\u201D.")}`;
@@ -9212,6 +9299,7 @@ var GATE_ALLOW_SOURCE = {
9212
9299
  allowlist: "allowlist",
9213
9300
  policy: "policy"
9214
9301
  };
9302
+ var isGateRefusal = (verdict) => verdict.kind === "kill" || verdict.kind === "deny";
9215
9303
  var PUSHARY_TOOL_PREFIX = "mcp__pushary__";
9216
9304
  var PUSHARY_CONNECTOR_TOOL_PREFIXES = ["mcp__claude_ai_Pushary__", "mcp__plugin_pushary_pushary__"];
9217
9305
  var SERVER_AND_TOOL_SEPARATOR = "__";
@@ -10187,6 +10275,7 @@ export {
10187
10275
  AGENT_QUESTION_DESCRIPTION_MAX,
10188
10276
  parseAgentQuestions,
10189
10277
  isTypedAnswerQuestion,
10278
+ isAgentQuestionSet,
10190
10279
  parseAgentQuestionAnswers,
10191
10280
  CODEX_QUESTION_TOOLS,
10192
10281
  isCodexQuestionTool,
@@ -10248,6 +10337,10 @@ export {
10248
10337
  claudeTurnEndOutput,
10249
10338
  PENDING_COMMAND_PREFIX,
10250
10339
  pendingCommandInstruction,
10340
+ PHONE_CALL_SETUP_PATH,
10341
+ PHONE_CALL_SETUP_TEST_CALL_PARAM,
10342
+ parsePhoneCallSetupReply,
10343
+ parseTestCallReply,
10251
10344
  degradedLine,
10252
10345
  API_KEY_PREFIX_PATTERN,
10253
10346
  isValidApiKey,
@@ -10366,6 +10459,7 @@ export {
10366
10459
  resolveAutoResolveOrigin,
10367
10460
  resolvePolicy,
10368
10461
  KILL_REASON,
10462
+ isGateRefusal,
10369
10463
  PUSHARY_TOOL_PREFIX,
10370
10464
  PUSHARY_CONNECTOR_TOOL_PREFIXES,
10371
10465
  isPusharyOwnTool,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  resolveInstallSourceFor
3
- } from "./chunk-UDLWNOXX.js";
3
+ } from "./chunk-YEVRMDG7.js";
4
4
  import {
5
5
  configFilePath
6
- } from "./chunk-FTTSQAF4.js";
6
+ } from "./chunk-DAMTDSAE.js";
7
7
  import {
8
8
  backupFile,
9
9
  readJsonSafe,
@@ -14,7 +14,7 @@ import {
14
14
  API_KEY_PREFIX_PATTERN,
15
15
  isRecord,
16
16
  isValidApiKey
17
- } from "./chunk-HA2SRYYP.js";
17
+ } from "./chunk-M2ZGNZRS.js";
18
18
 
19
19
  // src/shell-alias.ts
20
20
  import { homedir } from "os";