@pushary/agent-hooks 1.9.1 → 1.9.2

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 (105) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
  3. package/data/cursor-plugin/CHANGELOG.md +4 -0
  4. package/data/cursor-plugin/scripts/pushary-gate.mjs +1 -1
  5. package/data/vscode-plugin/.claude-plugin/plugin.json +1 -1
  6. package/data/vscode-plugin/CHANGELOG.md +4 -0
  7. package/data/vscode-plugin/scripts/pushary-gate.mjs +1 -1
  8. package/dist/bin/pushary-bell-hook.js +23 -23
  9. package/dist/bin/pushary-bell.js +9 -9
  10. package/dist/bin/pushary-claude.js +26 -26
  11. package/dist/bin/pushary-clean.js +28 -28
  12. package/dist/bin/pushary-codex-bridge.js +18 -18
  13. package/dist/bin/pushary-codex-hook.js +31 -31
  14. package/dist/bin/pushary-codex.js +13 -13
  15. package/dist/bin/pushary-connect.js +13 -13
  16. package/dist/bin/pushary-cowork.js +5 -5
  17. package/dist/bin/pushary-daemon.js +26 -26
  18. package/dist/bin/pushary-disconnect.js +18 -18
  19. package/dist/bin/pushary-doctor.js +99 -48
  20. package/dist/bin/pushary-elicitation-hook.js +25 -25
  21. package/dist/bin/pushary-gemini-bridge.js +13 -13
  22. package/dist/bin/pushary-gemini-hook.js +28 -28
  23. package/dist/bin/pushary-hook.js +32 -32
  24. package/dist/bin/pushary-login.js +26 -23
  25. package/dist/bin/pushary-logout.js +7 -7
  26. package/dist/bin/pushary-mcp.js +9 -9
  27. package/dist/bin/pushary-mode.js +9 -9
  28. package/dist/bin/pushary-notification-hook.js +28 -28
  29. package/dist/bin/pushary-opencode-hook.js +27 -27
  30. package/dist/bin/pushary-permission-denied-hook.js +32 -32
  31. package/dist/bin/pushary-permission-hook.js +31 -31
  32. package/dist/bin/pushary-post-hook.js +28 -28
  33. package/dist/bin/pushary-prompt-hook.js +28 -28
  34. package/dist/bin/pushary-session-end-hook.js +28 -28
  35. package/dist/bin/pushary-session-start-hook.js +31 -31
  36. package/dist/bin/pushary-setup.js +69 -52
  37. package/dist/bin/pushary-stats.js +5 -5
  38. package/dist/bin/pushary-status.js +15 -15
  39. package/dist/bin/pushary-stop-hook.js +28 -28
  40. package/dist/bin/pushary-stopfailure-hook.js +28 -28
  41. package/dist/bin/pushary-suggestions.js +4 -4
  42. package/dist/bin/pushary-transcript-register.js +19 -19
  43. package/dist/bin/pushary-transcripts.js +7 -7
  44. package/dist/bin/pushary-upgrade.js +21 -21
  45. package/dist/bin/pushary-wait.js +9 -9
  46. package/dist/bin/pushary.js +6 -6
  47. package/dist/{chunk-AKCJ5SNO.js → chunk-2E4SRGYD.js} +17 -12
  48. package/dist/{chunk-LXWUYG7D.js → chunk-2XK6D4WL.js} +1 -1
  49. package/dist/{chunk-JCER3Q6P.js → chunk-35N53QLA.js} +10 -9
  50. package/dist/{chunk-J7JXA2LX.js → chunk-3O4EBTR3.js} +1 -1
  51. package/dist/{chunk-XW2B4QV2.js → chunk-4KMTRXNL.js} +2 -2
  52. package/dist/{chunk-QQJCDRD3.js → chunk-6S727YUV.js} +5 -5
  53. package/dist/{chunk-JGQ2ANHQ.js → chunk-73BH4SZY.js} +2 -2
  54. package/dist/{chunk-FVOCQSBG.js → chunk-ABIW72ST.js} +1 -1
  55. package/dist/{chunk-CGRPHFOV.js → chunk-AL4NHBZ6.js} +1 -1
  56. package/dist/{chunk-D3RS57MN.js → chunk-B6BLCHJW.js} +3 -3
  57. package/dist/{chunk-SKEP3M6M.js → chunk-BFVE3WPB.js} +2 -2
  58. package/dist/{chunk-UYHLMBPQ.js → chunk-BK3R5NRE.js} +1 -1
  59. package/dist/{chunk-HU2LWGEE.js → chunk-CEHDCHXK.js} +1 -1
  60. package/dist/{chunk-CE4UH4AP.js → chunk-COVPHB56.js} +7 -5
  61. package/dist/{chunk-7ER66HZH.js → chunk-CTYCABBH.js} +1 -1
  62. package/dist/{chunk-COSADFEH.js → chunk-DKDZXJHZ.js} +1 -1
  63. package/dist/chunk-EO23EUOK.js +14 -0
  64. package/dist/{chunk-NVLXK2I6.js → chunk-ESME4HN2.js} +5 -5
  65. package/dist/{chunk-5K43TBK4.js → chunk-EUNYNLDU.js} +3 -3
  66. package/dist/{chunk-6Q4NM2LW.js → chunk-FHLRRCUZ.js} +3 -3
  67. package/dist/{chunk-VQLWYKX7.js → chunk-FWQM6V7Z.js} +1 -1
  68. package/dist/{chunk-IITCMJ4G.js → chunk-HLNSTJND.js} +2 -2
  69. package/dist/{chunk-ZMKEKWNR.js → chunk-HZ57E6LS.js} +18 -5
  70. package/dist/{chunk-JHZAZAI3.js → chunk-HZYUDXIH.js} +5 -5
  71. package/dist/{chunk-UPTEPARD.js → chunk-IH5NZMN4.js} +2 -2
  72. package/dist/{chunk-LZMH4EGE.js → chunk-IVPVCCFT.js} +1 -1
  73. package/dist/{chunk-QXL27RY6.js → chunk-JXLANQLV.js} +1 -1
  74. package/dist/{chunk-65TOHCXT.js → chunk-KP45FGHD.js} +4 -4
  75. package/dist/{chunk-4SB46XLF.js → chunk-L52OIZXV.js} +1 -1
  76. package/dist/{chunk-P7YDVWLL.js → chunk-MZXXLIF6.js} +1 -1
  77. package/dist/{chunk-GHKNUQYU.js → chunk-N2ATGXI4.js} +2 -2
  78. package/dist/{chunk-WWDPULS3.js → chunk-PN3F7LOB.js} +8 -8
  79. package/dist/{chunk-LKKYRNJT.js → chunk-Q36G3P7I.js} +1 -1
  80. package/dist/{chunk-SWGY5WNX.js → chunk-QDCEEQUS.js} +5 -5
  81. package/dist/{chunk-RNDFGHSQ.js → chunk-RTKPR4UA.js} +1 -1
  82. package/dist/{chunk-LJI7U6PM.js → chunk-SFKU5DXZ.js} +2 -2
  83. package/dist/{chunk-KR5JASA4.js → chunk-SI327OZF.js} +44 -16
  84. package/dist/{chunk-FJPC35OW.js → chunk-U4DLXAGD.js} +1 -1
  85. package/dist/{chunk-6QSDNXGM.js → chunk-UBCTOE5X.js} +2 -2
  86. package/dist/{chunk-RS4ZOFSF.js → chunk-UBNJYMTG.js} +7 -6
  87. package/dist/{chunk-PMS3EBD2.js → chunk-UX2YSFKS.js} +1 -1
  88. package/dist/{chunk-6JTTJIKJ.js → chunk-V3P2VSX7.js} +3 -3
  89. package/dist/{chunk-IJXJW2VH.js → chunk-VMGLXL74.js} +10 -10
  90. package/dist/{chunk-PEGKBNGN.js → chunk-WCHFDVCC.js} +5 -5
  91. package/dist/{chunk-6L7TNZ43.js → chunk-WM2MEFCA.js} +1 -1
  92. package/dist/{chunk-VH6763OR.js → chunk-XOXW4D6P.js} +3 -3
  93. package/dist/{chunk-SPB3QRE7.js → chunk-XXSAGQAV.js} +4 -4
  94. package/dist/{chunk-C6PPDKVI.js → chunk-Y4AUVOR7.js} +3 -3
  95. package/dist/{chunk-DMA3QUOB.js → chunk-Y6DSV2OS.js} +3 -3
  96. package/dist/{chunk-4XT4JXMG.js → chunk-Y73RBCQD.js} +1 -1
  97. package/dist/{chunk-XEIV5QOT.js → chunk-ZFDGCEKO.js} +14 -1
  98. package/dist/{chunk-RJ7ECJSZ.js → chunk-ZNUNWWCN.js} +4 -2
  99. package/dist/{chunk-V4H33GBM.js → chunk-ZSOFZDLY.js} +6 -6
  100. package/dist/{global-upgrade-ML2RHV4W.js → global-upgrade-N24WINE7.js} +6 -6
  101. package/dist/{paths-LG3IEDDM.js → paths-53PCHAOJ.js} +2 -2
  102. package/dist/{reapply-7PFOITE4.js → reapply-2SU2ZHEK.js} +8 -8
  103. package/dist/src/index.js +20 -20
  104. package/dist/{upgrade-lock-2A2YUUEU.js → upgrade-lock-F6SM6IEZ.js} +3 -3
  105. package/package.json +1 -1
@@ -1,32 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  registerTranscript
4
- } from "../chunk-WWDPULS3.js";
4
+ } from "../chunk-PN3F7LOB.js";
5
5
  import "../chunk-SGZJ5LYH.js";
6
- import "../chunk-65TOHCXT.js";
7
- import "../chunk-HU2LWGEE.js";
8
- import "../chunk-LXWUYG7D.js";
9
- import "../chunk-5K43TBK4.js";
10
- import "../chunk-PEGKBNGN.js";
11
- import "../chunk-D3RS57MN.js";
12
- import "../chunk-COSADFEH.js";
13
- import "../chunk-FJPC35OW.js";
14
- import "../chunk-PMS3EBD2.js";
15
- import "../chunk-7ER66HZH.js";
6
+ import "../chunk-KP45FGHD.js";
7
+ import "../chunk-CEHDCHXK.js";
8
+ import "../chunk-2XK6D4WL.js";
9
+ import "../chunk-EUNYNLDU.js";
10
+ import "../chunk-WCHFDVCC.js";
11
+ import "../chunk-B6BLCHJW.js";
12
+ import "../chunk-DKDZXJHZ.js";
13
+ import "../chunk-U4DLXAGD.js";
14
+ import "../chunk-UX2YSFKS.js";
15
+ import "../chunk-CTYCABBH.js";
16
16
  import "../chunk-XHKBHWLX.js";
17
17
  import "../chunk-6ICPEJY5.js";
18
- import "../chunk-RNDFGHSQ.js";
18
+ import "../chunk-RTKPR4UA.js";
19
19
  import "../chunk-GMXKITVA.js";
20
- import "../chunk-RJ7ECJSZ.js";
21
- import "../chunk-J7JXA2LX.js";
20
+ import "../chunk-ZNUNWWCN.js";
21
+ import "../chunk-3O4EBTR3.js";
22
22
  import "../chunk-7QLSKOSU.js";
23
23
  import "../chunk-KZERVKTD.js";
24
- import "../chunk-6QSDNXGM.js";
25
- import "../chunk-ZMKEKWNR.js";
24
+ import "../chunk-UBCTOE5X.js";
25
+ import "../chunk-HZ57E6LS.js";
26
26
  import "../chunk-T7E75EKA.js";
27
- import "../chunk-4SB46XLF.js";
28
- import "../chunk-FVOCQSBG.js";
29
- import "../chunk-XEIV5QOT.js";
27
+ import "../chunk-L52OIZXV.js";
28
+ import "../chunk-ABIW72ST.js";
29
+ import "../chunk-ZFDGCEKO.js";
30
30
 
31
31
  // bin/pushary-transcript-register.ts
32
32
  var raw = "";
@@ -6,17 +6,17 @@ import {
6
6
  } from "../chunk-SGZJ5LYH.js";
7
7
  import {
8
8
  transcriptsEnabled
9
- } from "../chunk-7ER66HZH.js";
9
+ } from "../chunk-CTYCABBH.js";
10
10
  import {
11
11
  exitOnHelpFlag
12
- } from "../chunk-JGQ2ANHQ.js";
13
- import "../chunk-RJ7ECJSZ.js";
12
+ } from "../chunk-73BH4SZY.js";
13
+ import "../chunk-ZNUNWWCN.js";
14
14
  import "../chunk-KZERVKTD.js";
15
- import "../chunk-6QSDNXGM.js";
15
+ import "../chunk-UBCTOE5X.js";
16
16
  import "../chunk-T7E75EKA.js";
17
- import "../chunk-4SB46XLF.js";
18
- import "../chunk-FVOCQSBG.js";
19
- import "../chunk-XEIV5QOT.js";
17
+ import "../chunk-L52OIZXV.js";
18
+ import "../chunk-ABIW72ST.js";
19
+ import "../chunk-ZFDGCEKO.js";
20
20
 
21
21
  // bin/pushary-transcripts.ts
22
22
  exitOnHelpFlag("transcripts");
@@ -7,28 +7,28 @@ import {
7
7
  runAutoUpdate,
8
8
  upgradeInstalledPackage,
9
9
  withUpgradeLock
10
- } from "../chunk-QQJCDRD3.js";
10
+ } from "../chunk-6S727YUV.js";
11
11
  import {
12
12
  installWithUpgradeLock
13
- } from "../chunk-QXL27RY6.js";
13
+ } from "../chunk-JXLANQLV.js";
14
14
  import {
15
15
  describeCodexTrustConfirmation
16
- } from "../chunk-VQLWYKX7.js";
16
+ } from "../chunk-FWQM6V7Z.js";
17
17
  import {
18
18
  ensureCodexTrustAfterReapply,
19
19
  reapplyAllAgents
20
- } from "../chunk-SWGY5WNX.js";
21
- import "../chunk-KR5JASA4.js";
20
+ } from "../chunk-QDCEEQUS.js";
21
+ import "../chunk-SI327OZF.js";
22
22
  import {
23
23
  waitForMachineReadiness
24
- } from "../chunk-AKCJ5SNO.js";
25
- import "../chunk-6Q4NM2LW.js";
24
+ } from "../chunk-2E4SRGYD.js";
25
+ import "../chunk-FHLRRCUZ.js";
26
26
  import {
27
27
  detectProviderLiveCapabilities,
28
28
  expectedLaunchCapabilities,
29
29
  hasSpawnProvider,
30
30
  resolveControlPolicy
31
- } from "../chunk-IITCMJ4G.js";
31
+ } from "../chunk-HLNSTJND.js";
32
32
  import "../chunk-RIVNNBEK.js";
33
33
  import {
34
34
  AUTO_UPDATE_DISABLE_ENV,
@@ -38,8 +38,8 @@ import {
38
38
  parseAutoUpdateFlag,
39
39
  readAutoUpdateState,
40
40
  updateAutoUpdateState
41
- } from "../chunk-CE4UH4AP.js";
42
- import "../chunk-5K43TBK4.js";
41
+ } from "../chunk-COVPHB56.js";
42
+ import "../chunk-EUNYNLDU.js";
43
43
  import {
44
44
  daemonHasRemoteProof,
45
45
  daemonServiceManagerAvailable,
@@ -50,23 +50,23 @@ import {
50
50
  replaceDaemonService,
51
51
  stopDaemonService,
52
52
  waitForDaemonRemoteProof
53
- } from "../chunk-PEGKBNGN.js";
54
- import "../chunk-D3RS57MN.js";
53
+ } from "../chunk-WCHFDVCC.js";
54
+ import "../chunk-B6BLCHJW.js";
55
55
  import "../chunk-XHKBHWLX.js";
56
56
  import "../chunk-6ICPEJY5.js";
57
- import "../chunk-RNDFGHSQ.js";
57
+ import "../chunk-RTKPR4UA.js";
58
58
  import "../chunk-POFBE6ZY.js";
59
59
  import {
60
60
  exitOnHelpFlag
61
- } from "../chunk-JGQ2ANHQ.js";
61
+ } from "../chunk-73BH4SZY.js";
62
62
  import {
63
63
  readControlMode
64
- } from "../chunk-RJ7ECJSZ.js";
65
- import "../chunk-J7JXA2LX.js";
64
+ } from "../chunk-ZNUNWWCN.js";
65
+ import "../chunk-3O4EBTR3.js";
66
66
  import {
67
67
  EXIT
68
68
  } from "../chunk-KZERVKTD.js";
69
- import "../chunk-6QSDNXGM.js";
69
+ import "../chunk-UBCTOE5X.js";
70
70
  import {
71
71
  LATEST_TAG,
72
72
  autoUpdateState,
@@ -76,19 +76,19 @@ import {
76
76
  fetchLatestPublishedVersion,
77
77
  geminiSettings,
78
78
  vscodePluginDir
79
- } from "../chunk-ZMKEKWNR.js";
79
+ } from "../chunk-HZ57E6LS.js";
80
80
  import "../chunk-T7E75EKA.js";
81
81
  import {
82
82
  getApiKey
83
- } from "../chunk-4SB46XLF.js";
83
+ } from "../chunk-L52OIZXV.js";
84
84
  import {
85
85
  NPX_LATEST_COMMAND
86
- } from "../chunk-FVOCQSBG.js";
86
+ } from "../chunk-ABIW72ST.js";
87
87
  import {
88
88
  CANONICAL_PACKAGE,
89
89
  LEGACY_PACKAGE,
90
90
  getPackageVersion
91
- } from "../chunk-XEIV5QOT.js";
91
+ } from "../chunk-ZFDGCEKO.js";
92
92
 
93
93
  // bin/pushary-upgrade.ts
94
94
  import { existsSync } from "fs";
@@ -4,33 +4,33 @@ import {
4
4
  } from "../chunk-CVWG2N3Y.js";
5
5
  import {
6
6
  exitOnFailedResponse
7
- } from "../chunk-LZMH4EGE.js";
7
+ } from "../chunk-IVPVCCFT.js";
8
8
  import {
9
9
  createIo
10
10
  } from "../chunk-U4TMAANR.js";
11
11
  import {
12
12
  exitOnHelpFlag
13
- } from "../chunk-JGQ2ANHQ.js";
13
+ } from "../chunk-73BH4SZY.js";
14
14
  import {
15
15
  rejectUnknownFlags
16
16
  } from "../chunk-GMXKITVA.js";
17
- import "../chunk-DMA3QUOB.js";
18
- import "../chunk-6JTTJIKJ.js";
19
- import "../chunk-J7JXA2LX.js";
17
+ import "../chunk-Y6DSV2OS.js";
18
+ import "../chunk-V3P2VSX7.js";
19
+ import "../chunk-3O4EBTR3.js";
20
20
  import {
21
21
  UsageError
22
22
  } from "../chunk-7QLSKOSU.js";
23
23
  import {
24
24
  EXIT
25
25
  } from "../chunk-KZERVKTD.js";
26
- import "../chunk-ZMKEKWNR.js";
26
+ import "../chunk-HZ57E6LS.js";
27
27
  import "../chunk-T7E75EKA.js";
28
28
  import {
29
29
  getApiKey,
30
30
  getBaseUrl
31
- } from "../chunk-4SB46XLF.js";
32
- import "../chunk-FVOCQSBG.js";
33
- import "../chunk-XEIV5QOT.js";
31
+ } from "../chunk-L52OIZXV.js";
32
+ import "../chunk-ABIW72ST.js";
33
+ import "../chunk-ZFDGCEKO.js";
34
34
 
35
35
  // bin/pushary-wait.ts
36
36
  exitOnHelpFlag("wait");
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  installNetworkDefaults
4
- } from "../chunk-6JTTJIKJ.js";
5
- import "../chunk-J7JXA2LX.js";
4
+ } from "../chunk-V3P2VSX7.js";
5
+ import "../chunk-3O4EBTR3.js";
6
6
  import "../chunk-7QLSKOSU.js";
7
7
  import {
8
8
  EXIT
9
9
  } from "../chunk-KZERVKTD.js";
10
- import "../chunk-ZMKEKWNR.js";
10
+ import "../chunk-HZ57E6LS.js";
11
11
  import "../chunk-T7E75EKA.js";
12
- import "../chunk-4SB46XLF.js";
12
+ import "../chunk-L52OIZXV.js";
13
13
  import {
14
14
  COMMANDS,
15
15
  isCommandName,
16
16
  renderHelp
17
- } from "../chunk-FVOCQSBG.js";
17
+ } from "../chunk-ABIW72ST.js";
18
18
  import {
19
19
  getPackageVersion
20
- } from "../chunk-XEIV5QOT.js";
20
+ } from "../chunk-ZFDGCEKO.js";
21
21
 
22
22
  // src/cli/runtime.ts
23
23
  var supportsRuntime = (version) => {
@@ -3,27 +3,27 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-IITCMJ4G.js";
6
+ } from "./chunk-HLNSTJND.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-PEGKBNGN.js";
13
+ } from "./chunk-WCHFDVCC.js";
14
14
  import {
15
15
  readControlMode,
16
16
  readKeySource
17
- } from "./chunk-RJ7ECJSZ.js";
17
+ } from "./chunk-ZNUNWWCN.js";
18
18
  import {
19
19
  getMachineId
20
- } from "./chunk-J7JXA2LX.js";
20
+ } from "./chunk-3O4EBTR3.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-4SB46XLF.js";
23
+ } from "./chunk-L52OIZXV.js";
24
24
  import {
25
25
  getPackageVersion
26
- } from "./chunk-XEIV5QOT.js";
26
+ } from "./chunk-ZFDGCEKO.js";
27
27
 
28
28
  // src/machines.ts
29
29
  import { hostname } from "os";
@@ -67,7 +67,11 @@ var parseMachine = (value) => {
67
67
  online: raw.online === true
68
68
  };
69
69
  };
70
- var machineReadiness = (machines, machineId, expectedCapabilities, now = Date.now()) => {
70
+ var serverClockOffsetMs = (response, receivedAt) => {
71
+ const serverTime = Date.parse(response.headers.get("date") ?? "");
72
+ return Number.isFinite(serverTime) ? serverTime - receivedAt : 0;
73
+ };
74
+ var machineReadiness = (machines, machineId, expectedCapabilities, now = Date.now(), clockOffsetMs = 0) => {
71
75
  const machine = machines.find((item) => item.machineId === machineId);
72
76
  if (!machine) return { kind: "not-ready", detail: "this machine has not heartbeated to the server" };
73
77
  if (!machine.online) return { kind: "not-ready", detail: "the server reports this machine offline" };
@@ -77,15 +81,15 @@ var machineReadiness = (machines, machineId, expectedCapabilities, now = Date.no
77
81
  if (machine.lastControlAt === null || !Number.isFinite(Date.parse(machine.lastControlAt))) {
78
82
  return { kind: "not-ready", detail: "the server has not observed this machine polling the control queue" };
79
83
  }
80
- if (!daemonHasRemoteProof({ kind: "running", lastSuccessfulHeartbeatAt: machine.lastSeenAt, lastSuccessfulControlAt: machine.lastControlAt }, now)) {
84
+ if (!daemonHasRemoteProof({ kind: "running", lastSuccessfulHeartbeatAt: machine.lastSeenAt, lastSuccessfulControlAt: machine.lastControlAt }, now + clockOffsetMs)) {
81
85
  return { kind: "not-ready", detail: "the heartbeat or control-queue proof is stale; wake this machine and retry pushary doctor" };
82
86
  }
83
87
  const missing = expectedCapabilities.filter((capability) => !machine.capabilities.includes(capability));
84
- return missing.length === 0 ? { kind: "ready", machine } : { kind: "not-ready", detail: `the server is missing capabilities: ${missing.join(", ")}` };
88
+ return missing.length === 0 ? { kind: "ready", machine, clockOffsetMs } : { kind: "not-ready", detail: `the server is missing capabilities: ${missing.join(", ")}` };
85
89
  };
86
90
  var readMachineReadiness = async (apiKey, expectedCapabilities, deps = {}) => {
87
91
  const listed = await listMachines(apiKey, deps);
88
- return listed.kind === "ok" ? machineReadiness(listed.machines, deps.machineId ?? getMachineId(), expectedCapabilities, deps.now?.()) : listed.kind === "unsupported" ? { kind: "unsupported", detail: "the server does not report machine readiness yet" } : listed;
92
+ return listed.kind === "ok" ? machineReadiness(listed.machines, deps.machineId ?? getMachineId(), expectedCapabilities, deps.now?.(), listed.clockOffsetMs) : listed.kind === "unsupported" ? { kind: "unsupported", detail: "the server does not report machine readiness yet" } : listed;
89
93
  };
90
94
  var waitForMachineReadiness = async (apiKey, expectedCapabilities, deps = {}) => {
91
95
  const attempts = deps.attempts ?? 21;
@@ -106,11 +110,12 @@ var listMachines = async (apiKey, deps = {}) => {
106
110
  headers: { Authorization: `Bearer ${apiKey}` },
107
111
  signal: AbortSignal.timeout(1e4)
108
112
  });
113
+ const clockOffsetMs = serverClockOffsetMs(res, (deps.now ?? Date.now)());
109
114
  if (res.status === 404) return { kind: "unsupported" };
110
115
  if (!res.ok) return { kind: "failed", detail: `HTTP ${res.status}` };
111
116
  const body = await res.json().catch(() => null);
112
117
  const list = body && Array.isArray(body.machines) ? body.machines : [];
113
- return { kind: "ok", machines: list.map(parseMachine).filter((m) => m !== null) };
118
+ return { kind: "ok", machines: list.map(parseMachine).filter((m) => m !== null), clockOffsetMs };
114
119
  } catch (err) {
115
120
  return { kind: "failed", detail: err instanceof Error ? err.message : "network error" };
116
121
  }
@@ -136,7 +141,7 @@ var readManagedControlEvidence = (apiKey, providers, serverProof) => {
136
141
  const keyCurrent = Boolean(apiKey) && readKeySource().key === apiKey && readDaemonNeedsLogin().kind !== "blocked";
137
142
  const policy = resolveControlPolicy({ mode: readControlMode(), providerAvailable, managerAvailable, servicePresent: serviceInstalled || daemon.kind !== "absent" });
138
143
  const localProof = daemonHasRemoteProof(daemon, now);
139
- const remote = serverProof?.kind === "ready" ? machineReadiness([serverProof.machine], daemon.machineId ?? "", expectedLaunchCapabilities(providers), now) : serverProof;
144
+ const remote = serverProof?.kind === "ready" ? machineReadiness([serverProof.machine], daemon.machineId ?? "", expectedLaunchCapabilities(providers), now, serverProof.clockOffsetMs) : serverProof;
140
145
  return {
141
146
  ready: keyCurrent && policy === "enabled" && providerAvailable && managerAvailable && serviceInstalled && localProof && remote?.kind === "ready",
142
147
  keyCurrent,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HOOK_LOCATOR_BINARY
3
- } from "./chunk-XEIV5QOT.js";
3
+ } from "./chunk-ZFDGCEKO.js";
4
4
 
5
5
  // src/diagnostics/bridge.ts
6
6
  import { execFileSync } from "child_process";
@@ -14,36 +14,36 @@ import {
14
14
  IDLE_PROMPT_NOTIFICATION,
15
15
  NOTIFICATION_PUSH_TYPES,
16
16
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
17
- } from "./chunk-RNDFGHSQ.js";
17
+ } from "./chunk-RTKPR4UA.js";
18
18
  import {
19
19
  cancelQuestion,
20
20
  isPolicyConfig,
21
21
  sendNotification,
22
22
  waitForAnswer
23
- } from "./chunk-JHZAZAI3.js";
23
+ } from "./chunk-HZYUDXIH.js";
24
24
  import {
25
25
  clientErrorKindOf,
26
26
  reportClientError
27
- } from "./chunk-SPB3QRE7.js";
27
+ } from "./chunk-XXSAGQAV.js";
28
28
  import {
29
29
  withRetry
30
- } from "./chunk-VH6763OR.js";
30
+ } from "./chunk-XOXW4D6P.js";
31
31
  import {
32
32
  getMachineId
33
- } from "./chunk-J7JXA2LX.js";
33
+ } from "./chunk-3O4EBTR3.js";
34
34
  import {
35
35
  reportedInstallSource
36
- } from "./chunk-6QSDNXGM.js";
36
+ } from "./chunk-UBCTOE5X.js";
37
37
  import {
38
38
  canonicalJson
39
- } from "./chunk-ZMKEKWNR.js";
39
+ } from "./chunk-HZ57E6LS.js";
40
40
  import {
41
41
  writeFileAtomic
42
42
  } from "./chunk-T7E75EKA.js";
43
43
  import {
44
44
  getApiKey,
45
45
  getBaseUrl
46
- } from "./chunk-4SB46XLF.js";
46
+ } from "./chunk-L52OIZXV.js";
47
47
  import {
48
48
  ACTION_BODY_MAX,
49
49
  AGENT_LABELS_BY_TYPE,
@@ -70,7 +70,7 @@ import {
70
70
  resolvePolicy,
71
71
  toToolLookup,
72
72
  truncateLine
73
- } from "./chunk-XEIV5QOT.js";
73
+ } from "./chunk-ZFDGCEKO.js";
74
74
 
75
75
  // src/policy.ts
76
76
  import { createHash } from "crypto";
@@ -576,6 +576,7 @@ var rawActionBody = (toolName, toolInput) => {
576
576
  if (toolName === "Bash" || toolName === "PowerShell" || toolName === "Monitor" || toolName === "run_shell_command" || toolName === "shell" || toolName === "apply_patch") {
577
577
  return firstString(toolInput.command);
578
578
  }
579
+ if (toolName === "write_stdin" || toolName === "request_permissions") return JSON.stringify(toolInput, null, 2);
579
580
  return firstString(toolInput.url, toolInput.href);
580
581
  };
581
582
  var deriveActionBody = (toolName, toolInput) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-ZMKEKWNR.js";
3
+ } from "./chunk-HZ57E6LS.js";
4
4
  import {
5
5
  writeFileAtomic
6
6
  } from "./chunk-T7E75EKA.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  pusharyHookExecutable
3
- } from "./chunk-5K43TBK4.js";
3
+ } from "./chunk-EUNYNLDU.js";
4
4
  import {
5
5
  isProtectedByScope,
6
6
  registerHookEntry
7
- } from "./chunk-ZMKEKWNR.js";
7
+ } from "./chunk-HZ57E6LS.js";
8
8
 
9
9
  // src/skills-cli.ts
10
10
  import { execSync } from "child_process";
@@ -3,7 +3,7 @@ import {
3
3
  finishWithUpgradeLock,
4
4
  installWithUpgradeLock,
5
5
  releaseAutoUpdateLock
6
- } from "./chunk-QXL27RY6.js";
6
+ } from "./chunk-JXLANQLV.js";
7
7
  import {
8
8
  describeAutoUpdateCheck,
9
9
  globalInstallLocation,
@@ -11,7 +11,7 @@ import {
11
11
  readAutoUpdateState,
12
12
  updateAutoUpdateState,
13
13
  upgradeEntryFor
14
- } from "./chunk-CE4UH4AP.js";
14
+ } from "./chunk-COVPHB56.js";
15
15
  import {
16
16
  EXIT
17
17
  } from "./chunk-KZERVKTD.js";
@@ -24,10 +24,10 @@ import {
24
24
  npmErrorMessage,
25
25
  readGlobalCliInstallAt,
26
26
  readGlobalPrefix
27
- } from "./chunk-ZMKEKWNR.js";
27
+ } from "./chunk-HZ57E6LS.js";
28
28
  import {
29
29
  NPX_LATEST_COMMAND
30
- } from "./chunk-FVOCQSBG.js";
30
+ } from "./chunk-ABIW72ST.js";
31
31
  import {
32
32
  commandsPackage,
33
33
  globalUpgradeEntry,
@@ -36,7 +36,7 @@ import {
36
36
  isSameMajorVersion,
37
37
  ownPackageRoot,
38
38
  packageVersionAt
39
- } from "./chunk-XEIV5QOT.js";
39
+ } from "./chunk-ZFDGCEKO.js";
40
40
 
41
41
  // src/global-upgrade.ts
42
42
  import { existsSync } from "fs";
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-FVOCQSBG.js";
6
+ } from "./chunk-ABIW72ST.js";
7
7
  import {
8
8
  getPackageVersion
9
- } from "./chunk-XEIV5QOT.js";
9
+ } from "./chunk-ZFDGCEKO.js";
10
10
 
11
11
  // src/cli/usage.ts
12
12
  var exitOnHelpFlag = (command) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_AGENT_CHOICES
3
- } from "./chunk-XEIV5QOT.js";
3
+ } from "./chunk-ZFDGCEKO.js";
4
4
 
5
5
  // src/cli/commands.ts
6
6
  var NPX_LATEST_COMMAND = "npx pushary@latest";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_BUDGETS,
3
3
  OPENCODE_APPROVAL_EVENT
4
- } from "./chunk-XEIV5QOT.js";
4
+ } from "./chunk-ZFDGCEKO.js";
5
5
 
6
6
  // src/opencode-plugin.ts
7
7
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -5,16 +5,16 @@ import {
5
5
  import {
6
6
  NOTIFICATION_MATCHED_TYPES,
7
7
  POSTTOOLUSE_MIRRORED_TOOLS
8
- } from "./chunk-RNDFGHSQ.js";
8
+ } from "./chunk-RTKPR4UA.js";
9
9
  import {
10
10
  isProtectedByScope,
11
11
  registerHookEntry
12
- } from "./chunk-ZMKEKWNR.js";
12
+ } from "./chunk-HZ57E6LS.js";
13
13
  import {
14
14
  CLAUDE_PRETOOLUSE_MATCHER,
15
15
  HOOK_BUDGETS,
16
16
  HOOK_LOCATOR_BINARY
17
- } from "./chunk-XEIV5QOT.js";
17
+ } from "./chunk-ZFDGCEKO.js";
18
18
 
19
19
  // src/gemini-config.ts
20
20
  var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-FJPC35OW.js";
6
+ } from "./chunk-U4DLXAGD.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-PMS3EBD2.js";
10
+ } from "./chunk-UX2YSFKS.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-XEIV5QOT.js";
4
+ } from "./chunk-ZFDGCEKO.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -9,7 +9,7 @@ import {
9
9
  SETUP_CONNECT_MODES,
10
10
  isSetupConnectMode,
11
11
  isValidApiKey
12
- } from "./chunk-XEIV5QOT.js";
12
+ } from "./chunk-ZFDGCEKO.js";
13
13
 
14
14
  // src/setup/options.ts
15
15
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-ZMKEKWNR.js";
6
+ } from "./chunk-HZ57E6LS.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -14,13 +14,14 @@ import {
14
14
  cliPackagePathSegments,
15
15
  globalUpgradeEntry,
16
16
  ownPackageRoot
17
- } from "./chunk-XEIV5QOT.js";
17
+ } from "./chunk-ZFDGCEKO.js";
18
18
 
19
19
  // src/auto-update.ts
20
20
  import { spawn } from "child_process";
21
21
  import { dirname } from "path";
22
22
  var AUTO_UPDATE_DISABLE_ENV = "PUSHARY_DISABLE_AUTOUPDATE";
23
23
  var AUTO_UPDATE_INTERVAL_MS = 24 * 60 * 60 * 1e3;
24
+ var PENDING_FINISH_RETRY_MS = 5 * 60 * 1e3;
24
25
  var AUTO_UPDATE_FLAG = "--auto";
25
26
  var NON_GLOBAL_INSTALL_SEGMENTS = ["/_npx/", "/.volta/"];
26
27
  var AUTO_UPDATE_RESULTS = ["updated", "current", "needs_manual", "failed", "finish_pending"];
@@ -75,11 +76,11 @@ var globalInstallLocation = (packageRoot) => {
75
76
  return null;
76
77
  };
77
78
  var upgradeEntryFor = (location, platform = process.platform) => globalUpgradeEntry(location.prefix, location.packageName, platform);
78
- var checkedWithinInterval = (lastCheckAt, now) => {
79
+ var checkedWithinInterval = (lastCheckAt, now, interval) => {
79
80
  const last = lastCheckAt === void 0 ? Number.NaN : Date.parse(lastCheckAt);
80
81
  if (Number.isNaN(last)) return false;
81
82
  const elapsed = now - last;
82
- return elapsed >= 0 && elapsed < AUTO_UPDATE_INTERVAL_MS;
83
+ return elapsed >= 0 && elapsed < interval;
83
84
  };
84
85
  var autoUpdateDecision = (input) => {
85
86
  if (input.isSubagentStart) return { kind: "skip", reason: "subagent_start" };
@@ -87,7 +88,8 @@ var autoUpdateDecision = (input) => {
87
88
  if (offReason !== null) return { kind: "skip", reason: offReason };
88
89
  const location = input.packageRoot === void 0 ? null : globalInstallLocation(input.packageRoot);
89
90
  if (location === null) return { kind: "skip", reason: "not_global_install" };
90
- if (checkedWithinInterval(input.state.lastCheckAt, input.now)) return { kind: "skip", reason: "checked_recently" };
91
+ const interval = input.state.lastResult === "finish_pending" ? PENDING_FINISH_RETRY_MS : AUTO_UPDATE_INTERVAL_MS;
92
+ if (checkedWithinInterval(input.state.lastCheckAt, input.now, interval)) return { kind: "skip", reason: "checked_recently" };
91
93
  return { kind: "check", ...location };
92
94
  };
93
95
  var parseAutoUpdateFlag = (args) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-RJ7ECJSZ.js";
3
+ } from "./chunk-ZNUNWWCN.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-ZMKEKWNR.js";
3
+ } from "./chunk-HZ57E6LS.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -0,0 +1,14 @@
1
+ // src/cli/json.ts
2
+ var writeStdoutFully = (text) => new Promise((resolve, reject) => {
3
+ const settle = (error) => {
4
+ if (!error) process.stdout.off("error", settle);
5
+ if (error && (!("code" in error) || error.code !== "EPIPE")) reject(error);
6
+ else resolve();
7
+ };
8
+ process.stdout.once("error", settle);
9
+ process.stdout.write(text, settle);
10
+ });
11
+
12
+ export {
13
+ writeStdoutFully
14
+ };