pushary 1.9.5 → 1.9.7

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 (100) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/data/cowork/SKILL.md +11 -10
  3. package/dist/bin/pushary-bell-hook.js +23 -23
  4. package/dist/bin/pushary-bell.js +9 -9
  5. package/dist/bin/pushary-claude.js +26 -26
  6. package/dist/bin/pushary-clean.js +35 -35
  7. package/dist/bin/pushary-codex-bridge.js +18 -18
  8. package/dist/bin/pushary-codex-hook.js +31 -31
  9. package/dist/bin/pushary-codex.js +13 -13
  10. package/dist/bin/pushary-connect.js +13 -13
  11. package/dist/bin/pushary-cowork.js +5 -5
  12. package/dist/bin/pushary-daemon.js +27 -26
  13. package/dist/bin/pushary-disconnect.js +24 -24
  14. package/dist/bin/pushary-doctor.js +42 -39
  15. package/dist/bin/pushary-elicitation-hook.js +25 -25
  16. package/dist/bin/pushary-gemini-bridge.js +13 -13
  17. package/dist/bin/pushary-gemini-hook.js +28 -28
  18. package/dist/bin/pushary-hook.js +32 -32
  19. package/dist/bin/pushary-login.js +12 -12
  20. package/dist/bin/pushary-logout.js +7 -7
  21. package/dist/bin/pushary-mcp.js +9 -9
  22. package/dist/bin/pushary-mode.js +9 -9
  23. package/dist/bin/pushary-notification-hook.js +28 -28
  24. package/dist/bin/pushary-opencode-hook.js +27 -27
  25. package/dist/bin/pushary-permission-denied-hook.js +32 -32
  26. package/dist/bin/pushary-permission-hook.js +31 -31
  27. package/dist/bin/pushary-post-hook.js +28 -28
  28. package/dist/bin/pushary-prompt-hook.js +28 -28
  29. package/dist/bin/pushary-session-end-hook.js +28 -28
  30. package/dist/bin/pushary-session-start-hook.js +32 -31
  31. package/dist/bin/pushary-setup.js +57 -55
  32. package/dist/bin/pushary-stats.js +5 -5
  33. package/dist/bin/pushary-status.js +15 -15
  34. package/dist/bin/pushary-stop-hook.js +28 -28
  35. package/dist/bin/pushary-stopfailure-hook.js +28 -28
  36. package/dist/bin/pushary-suggestions.js +4 -4
  37. package/dist/bin/pushary-transcript-register.js +19 -19
  38. package/dist/bin/pushary-transcripts.js +7 -7
  39. package/dist/bin/pushary-upgrade.js +34 -28
  40. package/dist/bin/pushary-wait.js +9 -9
  41. package/dist/bin/pushary.js +6 -6
  42. package/dist/{chunk-VZGCXECP.js → chunk-3GNUXXDZ.js} +2 -2
  43. package/dist/{chunk-LBTOB7Z7.js → chunk-3PVDOCFI.js} +61 -17
  44. package/dist/{chunk-FQKFONAS.js → chunk-4D2AYNSE.js} +2 -2
  45. package/dist/{chunk-7AV2KBZC.js → chunk-4FK6RZVJ.js} +1 -1
  46. package/dist/{chunk-RKEVFUBN.js → chunk-4YO4T5FV.js} +3 -3
  47. package/dist/{chunk-KSJCYP4I.js → chunk-6DJTDHBI.js} +1 -1
  48. package/dist/{chunk-23R4BMUP.js → chunk-7264S5HZ.js} +1 -1
  49. package/dist/{chunk-UQBJTGLX.js → chunk-7OIWWZAD.js} +3 -3
  50. package/dist/{chunk-5DU7LJ7L.js → chunk-ADSQDYYG.js} +2 -2
  51. package/dist/{chunk-V3TD72QA.js → chunk-ANEAA37E.js} +3 -3
  52. package/dist/{chunk-FYEQSB6N.js → chunk-AQ55ZSSS.js} +1 -1
  53. package/dist/{chunk-IX5EFNCI.js → chunk-AUUXS44H.js} +1 -1
  54. package/dist/{chunk-CPMVKL6H.js → chunk-AVNKVF7N.js} +4 -4
  55. package/dist/{chunk-V3ASMZLF.js → chunk-BTQGAXZ3.js} +8 -8
  56. package/dist/{chunk-M7MMZURA.js → chunk-CBQACHKY.js} +1 -1
  57. package/dist/{chunk-UM7DXK6V.js → chunk-D6S5EKXA.js} +5 -5
  58. package/dist/{chunk-2JOP4D2G.js → chunk-EB4XGVBG.js} +2 -2
  59. package/dist/{chunk-4LVFBQJ3.js → chunk-GKI6LFAV.js} +2 -2
  60. package/dist/{chunk-NUYECJ57.js → chunk-H37L7TT3.js} +1 -1
  61. package/dist/{chunk-FNOY2K4N.js → chunk-H7MMU64M.js} +3 -2
  62. package/dist/{chunk-XXBOA4ZL.js → chunk-HPRZJKRO.js} +1 -1
  63. package/dist/{chunk-NI2BRIHL.js → chunk-JCWZ23MJ.js} +3 -3
  64. package/dist/chunk-JWKBDSPF.js +69 -0
  65. package/dist/{chunk-XEZWDDR5.js → chunk-JWQZSYCK.js} +1 -1
  66. package/dist/{chunk-ELQAQZNO.js → chunk-JXISQ7DT.js} +3 -3
  67. package/dist/{chunk-L5XJZKF2.js → chunk-KFKL3FHS.js} +3 -3
  68. package/dist/{chunk-QEY4SCXT.js → chunk-KT5E2RLS.js} +1 -1
  69. package/dist/{chunk-K2J6OGGN.js → chunk-KYO45G5L.js} +1 -1
  70. package/dist/{chunk-CV2IAVD5.js → chunk-L76HTPU6.js} +3 -3
  71. package/dist/{chunk-GBKM4ULB.js → chunk-MBK7N46B.js} +6 -6
  72. package/dist/{chunk-5T65DZBH.js → chunk-MNWRUGMH.js} +1 -1
  73. package/dist/{chunk-NH63BTRO.js → chunk-MZPXVH4A.js} +5 -5
  74. package/dist/{chunk-EYKHHCLA.js → chunk-N4EUSDKX.js} +4 -4
  75. package/dist/{chunk-G3W5GP6O.js → chunk-NIBFSARF.js} +25 -6
  76. package/dist/{chunk-JSVBVV2Q.js → chunk-QFEM7R6T.js} +9 -9
  77. package/dist/{chunk-TNCINDSF.js → chunk-QQ4HBXZC.js} +6 -6
  78. package/dist/{chunk-SBR2UKUO.js → chunk-QR6VE5ME.js} +35 -3
  79. package/dist/{chunk-Q6KNNFGG.js → chunk-QTO6HEZD.js} +27 -8
  80. package/dist/{chunk-ZJSII7OP.js → chunk-R3YW55MY.js} +10 -10
  81. package/dist/{chunk-LSYSKKWW.js → chunk-RQGODFQN.js} +8 -4
  82. package/dist/{chunk-ORBTANP2.js → chunk-RQSOEB4S.js} +1 -1
  83. package/dist/{chunk-ZW7KE2GP.js → chunk-SBLPHUEB.js} +1 -1
  84. package/dist/{chunk-3Z7NUGXO.js → chunk-SD3272LS.js} +4 -4
  85. package/dist/{chunk-HOTK2D2S.js → chunk-STQRUH3S.js} +1 -1
  86. package/dist/{chunk-6OUATBSK.js → chunk-T7Y5EADL.js} +2 -2
  87. package/dist/{chunk-6WKOOF2H.js → chunk-UFVGSEWH.js} +2 -2
  88. package/dist/{chunk-KTIY7ZIA.js → chunk-VXRXFU6Q.js} +9 -7
  89. package/dist/{chunk-2KH5NTKR.js → chunk-W2KI5KPD.js} +2 -2
  90. package/dist/{chunk-GRFV6GPY.js → chunk-X5NXPCIC.js} +7 -1
  91. package/dist/{chunk-2PFD44YK.js → chunk-XWAYAO3V.js} +2 -2
  92. package/dist/{chunk-2DSUVY6R.js → chunk-Z6HPS67T.js} +1 -1
  93. package/dist/{chunk-ZBF5WAP7.js → chunk-ZUTU43FT.js} +4 -4
  94. package/dist/{global-upgrade-GWD4OADP.js → global-upgrade-E2HUEB4B.js} +6 -6
  95. package/dist/{paths-MJGE4UFY.js → paths-QVTEGNZV.js} +2 -2
  96. package/dist/{reapply-U6BMGCAB.js → reapply-5QVKM6LA.js} +11 -8
  97. package/dist/src/index.js +20 -20
  98. package/dist/{upgrade-lock-HQP6XCER.js → upgrade-lock-JCIDZMHF.js} +5 -3
  99. package/package.json +1 -1
  100. package/dist/chunk-G7CZUI4G.js +0 -38
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-ZBF5WAP7.js";
6
+ } from "./chunk-ZUTU43FT.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
@@ -14,17 +14,18 @@ import {
14
14
  cliPackagePathSegments,
15
15
  globalUpgradeEntry,
16
16
  ownPackageRoot
17
- } from "./chunk-SBR2UKUO.js";
17
+ } from "./chunk-QR6VE5ME.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
+ var PENDING_FINISH_RETRY_DELAYS_MS = [5 * 60 * 1e3, 60 * 60 * 1e3];
25
+ var FIRST_FINISH_ATTEMPT = 1;
25
26
  var AUTO_UPDATE_FLAG = "--auto";
26
27
  var NON_GLOBAL_INSTALL_SEGMENTS = ["/_npx/", "/.volta/"];
27
- var AUTO_UPDATE_RESULTS = ["updated", "current", "needs_manual", "failed", "finish_pending"];
28
+ var AUTO_UPDATE_RESULTS = ["updated", "current", "needs_manual", "failed", "finish_pending", "finish_blocked"];
28
29
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
29
30
  var isAutoUpdateResult = (value) => typeof value === "string" && AUTO_UPDATE_RESULTS.some((result) => result === value);
30
31
  var stringField = (record, key) => {
@@ -35,6 +36,10 @@ var booleanField = (record, key) => {
35
36
  const value = record[key];
36
37
  return typeof value === "boolean" ? value : void 0;
37
38
  };
39
+ var attemptCountField = (record, key) => {
40
+ const value = record[key];
41
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= FIRST_FINISH_ATTEMPT ? value : void 0;
42
+ };
38
43
  var parseAutoUpdateState = (value) => {
39
44
  if (!isRecord(value)) return {};
40
45
  return {
@@ -45,7 +50,8 @@ var parseAutoUpdateState = (value) => {
45
50
  to: stringField(value, "to"),
46
51
  at: stringField(value, "at"),
47
52
  detail: stringField(value, "detail"),
48
- announced: booleanField(value, "announced")
53
+ announced: booleanField(value, "announced"),
54
+ finishAttempts: attemptCountField(value, "finishAttempts")
49
55
  };
50
56
  };
51
57
  var isAutoUpdateDisabledByEnv = (env) => isDisabledByEnv(env, AUTO_UPDATE_DISABLE_ENV);
@@ -82,14 +88,17 @@ var checkedWithinInterval = (lastCheckAt, now, interval) => {
82
88
  const elapsed = now - last;
83
89
  return elapsed >= 0 && elapsed < interval;
84
90
  };
91
+ var finishAttemptsOf = (state) => state.finishAttempts ?? FIRST_FINISH_ATTEMPT;
92
+ var pendingFinishRetryDelay = (finishAttempts) => PENDING_FINISH_RETRY_DELAYS_MS[finishAttempts - FIRST_FINISH_ATTEMPT] ?? AUTO_UPDATE_INTERVAL_MS;
93
+ var autoUpdateCheckInterval = (state) => state.lastResult === "finish_pending" ? pendingFinishRetryDelay(finishAttemptsOf(state)) : AUTO_UPDATE_INTERVAL_MS;
94
+ var nextFinishAttempt = (previous, to) => previous.lastResult === "finish_pending" && previous.to === to ? finishAttemptsOf(previous) + 1 : FIRST_FINISH_ATTEMPT;
85
95
  var autoUpdateDecision = (input) => {
86
96
  if (input.isSubagentStart) return { kind: "skip", reason: "subagent_start" };
87
97
  const offReason = autoUpdateOffReason(input);
88
98
  if (offReason !== null) return { kind: "skip", reason: offReason };
89
99
  const location = input.packageRoot === void 0 ? null : globalInstallLocation(input.packageRoot);
90
100
  if (location === null) return { kind: "skip", reason: "not_global_install" };
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" };
101
+ if (checkedWithinInterval(input.state.lastCheckAt, input.now, autoUpdateCheckInterval(input.state))) return { kind: "skip", reason: "checked_recently" };
93
102
  return { kind: "check", ...location };
94
103
  };
95
104
  var parseAutoUpdateFlag = (args) => {
@@ -104,6 +113,7 @@ var parseAutoUpdateFlag = (args) => {
104
113
  var AUTO_UPDATE_RESULT_LABELS = {
105
114
  updated: "updated",
106
115
  finish_pending: "installed; configuration refresh pending",
116
+ finish_blocked: "installed; configuration refresh needs your action",
107
117
  current: "up to date",
108
118
  needs_manual: "needs a manual upgrade",
109
119
  failed: "failed"
@@ -113,7 +123,12 @@ var describeAutoUpdateCheck = (state) => {
113
123
  const label = state.lastResult ? AUTO_UPDATE_RESULT_LABELS[state.lastResult] : "no result recorded";
114
124
  return [label, versionsOf(state), state.detail].filter(Boolean).join(", ");
115
125
  };
116
- var hasPendingUpgradeFinish = (state, installed) => state.to === installed && (state.lastResult === "finish_pending" || state.lastResult === "updated" && Boolean(state.detail));
126
+ var UNFINISHED_AUTO_UPDATE_RESULTS = ["failed", "finish_pending", "finish_blocked"];
127
+ var isUnfinishedAutoUpdate = (state) => state.lastResult !== void 0 && UNFINISHED_AUTO_UPDATE_RESULTS.includes(state.lastResult);
128
+ var isRetryableFinishRecord = (state) => state.lastResult === "finish_pending" || state.lastResult === "updated" && Boolean(state.detail);
129
+ var hasRetryableUpgradeFinish = (state, installed) => state.to === installed && isRetryableFinishRecord(state);
130
+ var hasSettledUpgradeFinish = (state, installed) => state.to === installed && state.lastResult === "finish_blocked";
131
+ var hasPendingUpgradeFinish = (state, installed) => hasRetryableUpgradeFinish(state, installed) || hasSettledUpgradeFinish(state, installed);
117
132
  var pendingAutoUpdateAnnouncement = (state) => state.lastResult === "updated" && state.announced !== true && state.from && state.to ? { from: state.from, to: state.to } : null;
118
133
  var describeAutoUpdateAnnouncement = (announcement) => `Pushary updated itself from ${announcement.from} to ${announcement.to}.`;
119
134
  var takeAutoUpdateAnnouncement = (statePath, markAnnounced) => {
@@ -168,8 +183,12 @@ export {
168
183
  autoUpdateOffReason,
169
184
  globalInstallLocation,
170
185
  upgradeEntryFor,
186
+ nextFinishAttempt,
171
187
  parseAutoUpdateFlag,
172
188
  describeAutoUpdateCheck,
189
+ isUnfinishedAutoUpdate,
190
+ hasRetryableUpgradeFinish,
191
+ hasSettledUpgradeFinish,
173
192
  hasPendingUpgradeFinish,
174
193
  describeAutoUpdateAnnouncement,
175
194
  takeAutoUpdateAnnouncement,
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  activeHookSource,
3
3
  activeIdentity
4
- } from "./chunk-NH63BTRO.js";
4
+ } from "./chunk-MZPXVH4A.js";
5
5
  import {
6
6
  defersToNativeMode,
7
7
  reportMachineDenial
8
- } from "./chunk-VZGCXECP.js";
8
+ } from "./chunk-3GNUXXDZ.js";
9
9
  import {
10
10
  isGatingMoment,
11
11
  recordKeylessMoment
12
- } from "./chunk-M7MMZURA.js";
12
+ } from "./chunk-CBQACHKY.js";
13
13
  import {
14
14
  announceSubscriptionRequired,
15
15
  denyReasonFrom,
@@ -39,7 +39,7 @@ import {
39
39
  reportEvent,
40
40
  scopePathFor,
41
41
  settleQuestionsForToolUse
42
- } from "./chunk-JSVBVV2Q.js";
42
+ } from "./chunk-QFEM7R6T.js";
43
43
  import {
44
44
  DEFAULT_SESSION
45
45
  } from "./chunk-N6IOSZOE.js";
@@ -55,20 +55,20 @@ import {
55
55
  requestGate,
56
56
  sendNotification,
57
57
  waitForQuestion
58
- } from "./chunk-UM7DXK6V.js";
58
+ } from "./chunk-D6S5EKXA.js";
59
59
  import {
60
60
  SubscriptionRequiredError
61
- } from "./chunk-CV2IAVD5.js";
61
+ } from "./chunk-L76HTPU6.js";
62
62
  import {
63
63
  getMachineId
64
- } from "./chunk-K2J6OGGN.js";
64
+ } from "./chunk-KYO45G5L.js";
65
65
  import {
66
66
  getApiKey,
67
67
  getBaseUrl
68
- } from "./chunk-2DSUVY6R.js";
68
+ } from "./chunk-Z6HPS67T.js";
69
69
  import {
70
70
  NPX_LATEST_COMMAND
71
- } from "./chunk-HOTK2D2S.js";
71
+ } from "./chunk-STQRUH3S.js";
72
72
  import {
73
73
  AGENT_QUESTION_STRATEGY,
74
74
  GATE_BLOCK_REASON_MAX_LENGTH,
@@ -96,7 +96,7 @@ import {
96
96
  parseAgentQuestions,
97
97
  resolveGate,
98
98
  stoppedOutput
99
- } from "./chunk-SBR2UKUO.js";
99
+ } from "./chunk-QR6VE5ME.js";
100
100
 
101
101
  // src/claude-permission-rules.ts
102
102
  import { readFileSync, statSync } from "fs";
@@ -2,7 +2,7 @@ import {
2
2
  autoUpdateLock,
3
3
  installPackageGlobally,
4
4
  npmErrorMessage
5
- } from "./chunk-ZBF5WAP7.js";
5
+ } from "./chunk-ZUTU43FT.js";
6
6
  import {
7
7
  writeJsonAtomic
8
8
  } from "./chunk-T7E75EKA.js";
@@ -133,7 +133,7 @@ var releaseAutoUpdateLock = (lockPath) => {
133
133
  server.close();
134
134
  }
135
135
  };
136
- var finishWithUpgradeLock = (request) => new Promise((resolve, reject) => {
136
+ var forkFinishWithUpgradeLock = (request) => new Promise((resolve, reject) => {
137
137
  const path = canonicalLockPath(request.lockPath ?? autoUpdateLock());
138
138
  const server = heldLocks.get(path);
139
139
  if (!server) return reject(new Error("Cannot finish an upgrade without its lock"));
@@ -154,10 +154,13 @@ var finishWithUpgradeLock = (request) => new Promise((resolve, reject) => {
154
154
  });
155
155
  child.once("exit", (code, signal) => {
156
156
  clearTimeout(timer);
157
- if (code === 0) resolve();
158
- else reject(new Error(`Upgrade finish exited with ${signal ?? code}`));
157
+ resolve({ code, signal });
159
158
  });
160
159
  });
160
+ var finishWithUpgradeLock = async (request) => {
161
+ const exit = await forkFinishWithUpgradeLock(request);
162
+ if (exit.code !== 0) throw new Error(`Upgrade finish exited with ${exit.signal ?? exit.code}`);
163
+ };
161
164
  var installWithUpgradeLock = (request, lockPath = autoUpdateLock(), runNpm) => {
162
165
  const path = canonicalLockPath(lockPath);
163
166
  if (!heldLocks.has(path)) throw new Error("Cannot install an upgrade without its lock");
@@ -170,6 +173,7 @@ export {
170
173
  claimUpgradeLock,
171
174
  ownsUpgradeLock,
172
175
  releaseAutoUpdateLock,
176
+ forkFinishWithUpgradeLock,
173
177
  finishWithUpgradeLock,
174
178
  installWithUpgradeLock
175
179
  };
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  describeKeyCheck,
6
6
  keyCheckFromResponse
7
- } from "./chunk-L5XJZKF2.js";
7
+ } from "./chunk-KFKL3FHS.js";
8
8
  import {
9
9
  EXIT
10
10
  } from "./chunk-KZERVKTD.js";
@@ -9,7 +9,7 @@ import {
9
9
  SETUP_CONNECT_MODES,
10
10
  isSetupConnectMode,
11
11
  isValidApiKey
12
- } from "./chunk-SBR2UKUO.js";
12
+ } from "./chunk-QR6VE5ME.js";
13
13
 
14
14
  // src/setup/options.ts
15
15
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AGENT_CHOICES
3
- } from "./chunk-ZW7KE2GP.js";
3
+ } from "./chunk-SBLPHUEB.js";
4
4
  import {
5
5
  isBridgeLocator
6
- } from "./chunk-5T65DZBH.js";
6
+ } from "./chunk-MNWRUGMH.js";
7
7
  import {
8
8
  pusharyHookExecutable
9
- } from "./chunk-RKEVFUBN.js";
9
+ } from "./chunk-4YO4T5FV.js";
10
10
  import {
11
11
  BELL_HOOK_BINARY
12
- } from "./chunk-23R4BMUP.js";
12
+ } from "./chunk-7264S5HZ.js";
13
13
 
14
14
  // src/setup/hook-ownership.ts
15
15
  var commandsIn = (value) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_AGENT_CHOICES
3
- } from "./chunk-SBR2UKUO.js";
3
+ } from "./chunk-QR6VE5ME.js";
4
4
 
5
5
  // src/cli/commands.ts
6
6
  var NPX_LATEST_COMMAND = "npx pushary@latest";
@@ -10,10 +10,10 @@ import {
10
10
  resolvePackageVersionFromBinary,
11
11
  resolvePathBinary,
12
12
  resolvePathBinaryAsync
13
- } from "./chunk-ZBF5WAP7.js";
13
+ } from "./chunk-ZUTU43FT.js";
14
14
  import {
15
15
  MANAGED_PROVIDERS
16
- } from "./chunk-SBR2UKUO.js";
16
+ } from "./chunk-QR6VE5ME.js";
17
17
 
18
18
  // src/setup/codex-install.ts
19
19
  var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-KZERVKTD.js";
4
4
  import {
5
5
  renderCommandHelp
6
- } from "./chunk-HOTK2D2S.js";
6
+ } from "./chunk-STQRUH3S.js";
7
7
  import {
8
8
  getPackageVersion
9
- } from "./chunk-SBR2UKUO.js";
9
+ } from "./chunk-QR6VE5ME.js";
10
10
 
11
11
  // src/cli/usage.ts
12
12
  var exitOnHelpFlag = (command) => {
@@ -4,14 +4,14 @@ import {
4
4
  } from "./chunk-XHKBHWLX.js";
5
5
  import {
6
6
  readControlMode
7
- } from "./chunk-5DU7LJ7L.js";
7
+ } from "./chunk-ADSQDYYG.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-K2J6OGGN.js";
10
+ } from "./chunk-KYO45G5L.js";
11
11
  import {
12
12
  pusharyDir,
13
13
  resolveGlobalBinary
14
- } from "./chunk-ZBF5WAP7.js";
14
+ } from "./chunk-ZUTU43FT.js";
15
15
  import {
16
16
  readJsonSafe,
17
17
  writeFileAtomic,
@@ -20,14 +20,14 @@ import {
20
20
  } from "./chunk-T7E75EKA.js";
21
21
  import {
22
22
  getApiKey
23
- } from "./chunk-2DSUVY6R.js";
23
+ } from "./chunk-Z6HPS67T.js";
24
24
  import {
25
25
  CLI_PACKAGE_NAMES,
26
26
  cmdShimTarget,
27
27
  getPackageVersion,
28
28
  globalPackageFolder,
29
29
  globalRootFor
30
- } from "./chunk-SBR2UKUO.js";
30
+ } from "./chunk-QR6VE5ME.js";
31
31
 
32
32
  // src/daemon-lifecycle.ts
33
33
  import { dirname, join, win32 as win32Path } from "path";
@@ -38,7 +38,8 @@ import { execFileSync } from "child_process";
38
38
  var daemonNeedsHandoff = (status) => status.kind === "version-mismatch" || status.kind === "configuration-mismatch" || status.kind === "unresponsive" && status.processAlive === true;
39
39
  var DAEMON_REMOTE_PROOF_MAX_AGE_MS = 18e4;
40
40
  var DAEMON_REMOTE_PROOF_CLOCK_SKEW_MS = 3e4;
41
- var DAEMON_STARTUP_TIMEOUT_MS = 3e4;
41
+ var DAEMON_STARTUP_TIMEOUT_MS = 5e3;
42
+ var DAEMON_COLD_START_TIMEOUT_MS = 3e4;
42
43
  var remoteProofIsFresh = (timestamp, now) => {
43
44
  if (timestamp === null) return false;
44
45
  const age = now - Date.parse(timestamp);
@@ -1096,7 +1097,7 @@ var ensureDaemonRunning = async (options = {}) => {
1096
1097
  var waitForDaemonRemoteProof = async (options = {}) => {
1097
1098
  const sleep = options.sleep ?? wait;
1098
1099
  const pollIntervalMs = options.pollIntervalMs ?? 250;
1099
- const attempts = Math.max(1, Math.ceil((options.waitTimeoutMs ?? DAEMON_STARTUP_TIMEOUT_MS) / pollIntervalMs));
1100
+ const attempts = Math.max(1, Math.ceil((options.waitTimeoutMs ?? DAEMON_COLD_START_TIMEOUT_MS) / pollIntervalMs));
1100
1101
  let status = readDaemonStatus(options);
1101
1102
  for (let attempt = 0; attempt < attempts; attempt++) {
1102
1103
  status = readDaemonStatus(options);
@@ -1107,6 +1108,7 @@ var waitForDaemonRemoteProof = async (options = {}) => {
1107
1108
  };
1108
1109
 
1109
1110
  export {
1111
+ DAEMON_COLD_START_TIMEOUT_MS,
1110
1112
  daemonHasRemoteProof,
1111
1113
  daemonServiceManagerAvailable,
1112
1114
  DAEMON_LEASE_RENEW_INTERVAL_MS,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-CV2IAVD5.js";
3
+ } from "./chunk-L76HTPU6.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-HOTK2D2S.js";
6
+ } from "./chunk-STQRUH3S.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -1,7 +1,10 @@
1
+ import {
2
+ guardedArgv
3
+ } from "./chunk-ZUTU43FT.js";
1
4
  import {
2
5
  HOOK_BUDGETS,
3
6
  OPENCODE_APPROVAL_EVENT
4
- } from "./chunk-SBR2UKUO.js";
7
+ } from "./chunk-QR6VE5ME.js";
5
8
 
6
9
  // src/opencode-plugin.ts
7
10
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -305,6 +308,8 @@ import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync
305
308
  import { homedir } from "os";
306
309
  import { join } from "path";
307
310
  var OPENCODE_HOOK_BINARY = "pushary-opencode-hook";
311
+ var OPENCODE_HOOK_ARGS = ["--source", "opencode"];
312
+ var openCodeHookArgv = (resolvedBinary) => guardedArgv({ kind: "binary", path: resolvedBinary ?? OPENCODE_HOOK_BINARY, runtime: "node" }, OPENCODE_HOOK_ARGS);
308
313
  var openCodeConfigDirFrom = (home, env = process.env) => env.OPENCODE_CONFIG_DIR?.trim() || join(env.XDG_CONFIG_HOME?.trim() || join(home, ".config"), "opencode");
309
314
  var openCodeConfigDir = () => openCodeConfigDirFrom(homedir());
310
315
  var OPENCODE_PLUGIN_PATH = `${OPENCODE_PLUGIN_DIR}/${OPENCODE_PLUGIN_FILE}`;
@@ -363,6 +368,7 @@ export {
363
368
  OPENCODE_PLUGIN_SIBLING_CONTENTS,
364
369
  isOpenCodePluginOurs,
365
370
  OPENCODE_HOOK_BINARY,
371
+ openCodeHookArgv,
366
372
  openCodeConfigDirFrom,
367
373
  openCodeConfigDir,
368
374
  openCodePluginDir,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-V3ASMZLF.js";
3
+ } from "./chunk-BTQGAXZ3.js";
4
4
  import {
5
5
  writeDegraded
6
- } from "./chunk-CPMVKL6H.js";
6
+ } from "./chunk-AVNKVF7N.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"];
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-HOTK2D2S.js";
3
+ } from "./chunk-STQRUH3S.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -13,7 +13,7 @@ import {
13
13
  isReleaseVersion,
14
14
  ownPackageName,
15
15
  withHookHoldBudget
16
- } from "./chunk-SBR2UKUO.js";
16
+ } from "./chunk-QR6VE5ME.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-GWD4OADP.js");
369
- const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-HQP6XCER.js");
370
- const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-MJGE4UFY.js");
368
+ const { withUpgradeLock } = await import("./global-upgrade-E2HUEB4B.js");
369
+ const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-JCIDZMHF.js");
370
+ const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-QVTEGNZV.js");
371
371
  let result = "skipped";
372
372
  const install = async () => {
373
373
  const platform = process.platform;
@@ -5,15 +5,15 @@ import {
5
5
  readGlobalUpgradeSubject,
6
6
  upgradeInstalledPackage,
7
7
  withUpgradeLock
8
- } from "./chunk-LBTOB7Z7.js";
9
- import "./chunk-LSYSKKWW.js";
10
- import "./chunk-Q6KNNFGG.js";
8
+ } from "./chunk-3PVDOCFI.js";
9
+ import "./chunk-RQGODFQN.js";
10
+ import "./chunk-QTO6HEZD.js";
11
11
  import "./chunk-POFBE6ZY.js";
12
12
  import "./chunk-KZERVKTD.js";
13
- import "./chunk-ZBF5WAP7.js";
13
+ import "./chunk-ZUTU43FT.js";
14
14
  import "./chunk-T7E75EKA.js";
15
- import "./chunk-HOTK2D2S.js";
16
- import "./chunk-SBR2UKUO.js";
15
+ import "./chunk-STQRUH3S.js";
16
+ import "./chunk-QR6VE5ME.js";
17
17
  export {
18
18
  finishGlobalUpgrade,
19
19
  finishUpgradeWithLock,
@@ -32,8 +32,8 @@ import {
32
32
  pusharyDir,
33
33
  vscodePluginDir,
34
34
  vscodePluginMcp
35
- } from "./chunk-ZBF5WAP7.js";
36
- import "./chunk-SBR2UKUO.js";
35
+ } from "./chunk-ZUTU43FT.js";
36
+ import "./chunk-QR6VE5ME.js";
37
37
  export {
38
38
  autoUpdateLock,
39
39
  autoUpdateLog,
@@ -7,20 +7,22 @@ import {
7
7
  reapplyCodexSettings,
8
8
  reapplyCursorPlugin,
9
9
  reapplyGeminiSettings,
10
+ reapplyOpenCodePlugin,
10
11
  reapplyVsCodePlugin,
11
12
  repairCodexHolds
12
- } from "./chunk-G3W5GP6O.js";
13
- import "./chunk-FNOY2K4N.js";
14
- import "./chunk-V3TD72QA.js";
13
+ } from "./chunk-NIBFSARF.js";
14
+ import "./chunk-H7MMU64M.js";
15
+ import "./chunk-X5NXPCIC.js";
16
+ import "./chunk-ANEAA37E.js";
15
17
  import "./chunk-RIVNNBEK.js";
16
- import "./chunk-RKEVFUBN.js";
17
- import "./chunk-NI2BRIHL.js";
18
+ import "./chunk-4YO4T5FV.js";
19
+ import "./chunk-JCWZ23MJ.js";
18
20
  import "./chunk-XHKBHWLX.js";
19
21
  import "./chunk-6ICPEJY5.js";
20
- import "./chunk-KSJCYP4I.js";
21
- import "./chunk-ZBF5WAP7.js";
22
+ import "./chunk-6DJTDHBI.js";
23
+ import "./chunk-ZUTU43FT.js";
22
24
  import "./chunk-T7E75EKA.js";
23
- import "./chunk-SBR2UKUO.js";
25
+ import "./chunk-QR6VE5ME.js";
24
26
  export {
25
27
  ensureCodexTrustAfterReapply,
26
28
  inspectConfiguredManagedProviders,
@@ -30,6 +32,7 @@ export {
30
32
  reapplyCodexSettings,
31
33
  reapplyCursorPlugin,
32
34
  reapplyGeminiSettings,
35
+ reapplyOpenCodePlugin,
33
36
  reapplyVsCodePlugin,
34
37
  repairCodexHolds
35
38
  };
package/dist/src/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-ZJSII7OP.js";
4
- import "../chunk-NH63BTRO.js";
5
- import "../chunk-V3TD72QA.js";
6
- import "../chunk-VZGCXECP.js";
7
- import "../chunk-M7MMZURA.js";
3
+ } from "../chunk-R3YW55MY.js";
4
+ import "../chunk-MZPXVH4A.js";
5
+ import "../chunk-ANEAA37E.js";
6
+ import "../chunk-3GNUXXDZ.js";
7
+ import "../chunk-CBQACHKY.js";
8
8
  import "../chunk-5OP5MQI7.js";
9
- import "../chunk-NI2BRIHL.js";
9
+ import "../chunk-JCWZ23MJ.js";
10
10
  import {
11
11
  fetchAccountPublicKey
12
- } from "../chunk-7AV2KBZC.js";
12
+ } from "../chunk-4FK6RZVJ.js";
13
13
  import "../chunk-6ICPEJY5.js";
14
14
  import {
15
15
  fetchModeOverride,
@@ -19,33 +19,33 @@ import {
19
19
  handlePostToolUse,
20
20
  handleStop,
21
21
  reportEvent
22
- } from "../chunk-JSVBVV2Q.js";
22
+ } from "../chunk-QFEM7R6T.js";
23
23
  import "../chunk-N6IOSZOE.js";
24
- import "../chunk-KSJCYP4I.js";
24
+ import "../chunk-6DJTDHBI.js";
25
25
  import {
26
26
  askUser,
27
27
  cancelQuestion,
28
28
  waitForAnswer
29
- } from "../chunk-UM7DXK6V.js";
30
- import "../chunk-CPMVKL6H.js";
29
+ } from "../chunk-D6S5EKXA.js";
30
+ import "../chunk-AVNKVF7N.js";
31
31
  import "../chunk-POFBE6ZY.js";
32
- import "../chunk-CV2IAVD5.js";
33
- import "../chunk-L5XJZKF2.js";
34
- import "../chunk-ELQAQZNO.js";
35
- import "../chunk-K2J6OGGN.js";
32
+ import "../chunk-L76HTPU6.js";
33
+ import "../chunk-KFKL3FHS.js";
34
+ import "../chunk-JXISQ7DT.js";
35
+ import "../chunk-KYO45G5L.js";
36
36
  import "../chunk-7QLSKOSU.js";
37
37
  import "../chunk-KZERVKTD.js";
38
- import "../chunk-FQKFONAS.js";
39
- import "../chunk-ZBF5WAP7.js";
38
+ import "../chunk-4D2AYNSE.js";
39
+ import "../chunk-ZUTU43FT.js";
40
40
  import "../chunk-T7E75EKA.js";
41
41
  import {
42
42
  getApiKey,
43
43
  getBaseUrl
44
- } from "../chunk-2DSUVY6R.js";
45
- import "../chunk-HOTK2D2S.js";
44
+ } from "../chunk-Z6HPS67T.js";
45
+ import "../chunk-STQRUH3S.js";
46
46
  import {
47
47
  resolvePolicy
48
- } from "../chunk-SBR2UKUO.js";
48
+ } from "../chunk-QR6VE5ME.js";
49
49
  export {
50
50
  askUser,
51
51
  cancelQuestion,
@@ -1,16 +1,18 @@
1
1
  import {
2
2
  claimUpgradeLock,
3
3
  finishWithUpgradeLock,
4
+ forkFinishWithUpgradeLock,
4
5
  installWithUpgradeLock,
5
6
  ownsUpgradeLock,
6
7
  releaseAutoUpdateLock
7
- } from "./chunk-LSYSKKWW.js";
8
- import "./chunk-ZBF5WAP7.js";
8
+ } from "./chunk-RQGODFQN.js";
9
+ import "./chunk-ZUTU43FT.js";
9
10
  import "./chunk-T7E75EKA.js";
10
- import "./chunk-SBR2UKUO.js";
11
+ import "./chunk-QR6VE5ME.js";
11
12
  export {
12
13
  claimUpgradeLock,
13
14
  finishWithUpgradeLock,
15
+ forkFinishWithUpgradeLock,
14
16
  installWithUpgradeLock,
15
17
  ownsUpgradeLock,
16
18
  releaseAutoUpdateLock
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushary",
3
- "version": "1.9.5",
3
+ "version": "1.9.7",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",
@@ -1,38 +0,0 @@
1
- import {
2
- NPX_LATEST_COMMAND
3
- } from "./chunk-HOTK2D2S.js";
4
-
5
- // src/setup/codex-trust.ts
6
- var CODEX_TRUST_TELEMETRY = {
7
- verified: "verified",
8
- refused: "manual",
9
- unlisted: "manual",
10
- skipped: "unverified",
11
- unavailable: "unverified"
12
- };
13
- var isUnanswered = (confirmation) => confirmation.kind === "skipped" || confirmation.kind === "unavailable";
14
- var codexTrustOutcome = (confirmation, portedTrustWritten) => isUnanswered(confirmation) && !portedTrustWritten ? "manual" : CODEX_TRUST_TELEMETRY[confirmation.kind];
15
- var CODEX_TRUST_REFUSED = "Codex did not accept the trust Pushary asked for, so its hooks are not trusted yet. Open Codex, run /hooks, and choose Trust for the Pushary hooks.";
16
- var describeUnlistedCodexHooks = (warnings) => {
17
- const said = warnings[0] ? ` Codex said: ${warnings[0]}` : "";
18
- return `Codex does not list the Pushary hooks, so it will not run them.${said} Run ${NPX_LATEST_COMMAND} doctor for details.`;
19
- };
20
- var describeCodexTrustConfirmation = (confirmation) => {
21
- switch (confirmation.kind) {
22
- case "verified":
23
- return confirmation.wrote ? "Codex trusted the Pushary hooks when asked, and confirmed it." : "Codex confirms the Pushary hooks are trusted.";
24
- case "refused":
25
- return confirmation.writeError ? `${CODEX_TRUST_REFUSED} Codex said: ${confirmation.writeError}` : CODEX_TRUST_REFUSED;
26
- case "unlisted":
27
- return describeUnlistedCodexHooks(confirmation.warnings);
28
- case "skipped":
29
- return `Pushary did not ask Codex to confirm the trust: ${confirmation.reason}.`;
30
- case "unavailable":
31
- return `Codex could not be asked to confirm the Pushary hooks are trusted (${confirmation.reason}).`;
32
- }
33
- };
34
-
35
- export {
36
- codexTrustOutcome,
37
- describeCodexTrustConfirmation
38
- };