@pushary/agent-hooks 1.9.43 → 1.9.45

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 +11 -0
  2. package/README.md +1 -0
  3. package/dist/bin/pushary-bell-hook.js +26 -26
  4. package/dist/bin/pushary-bell.js +11 -11
  5. package/dist/bin/pushary-claude.js +33 -33
  6. package/dist/bin/pushary-clean.js +38 -38
  7. package/dist/bin/pushary-codex-bridge.js +22 -680
  8. package/dist/bin/pushary-codex-hook.js +32 -32
  9. package/dist/bin/pushary-codex-session.d.ts +1 -0
  10. package/dist/bin/pushary-codex-session.js +649 -0
  11. package/dist/bin/pushary-codex.js +12 -12
  12. package/dist/bin/pushary-connect.js +27 -27
  13. package/dist/bin/pushary-cowork.js +6 -6
  14. package/dist/bin/pushary-daemon.js +55 -55
  15. package/dist/bin/pushary-disconnect.js +26 -26
  16. package/dist/bin/pushary-doctor.js +84 -82
  17. package/dist/bin/pushary-elicitation-hook.js +26 -26
  18. package/dist/bin/pushary-gemini-bridge.js +15 -15
  19. package/dist/bin/pushary-gemini-hook.js +29 -29
  20. package/dist/bin/pushary-hook.js +32 -32
  21. package/dist/bin/pushary-login.js +16 -16
  22. package/dist/bin/pushary-logout.js +27 -27
  23. package/dist/bin/pushary-mcp.js +9 -9
  24. package/dist/bin/pushary-mode.js +14 -14
  25. package/dist/bin/pushary-notification-hook.js +25 -25
  26. package/dist/bin/pushary-opencode-hook.js +28 -28
  27. package/dist/bin/pushary-permission-denied-hook.js +30 -30
  28. package/dist/bin/pushary-permission-hook.js +29 -29
  29. package/dist/bin/pushary-post-hook.js +25 -25
  30. package/dist/bin/pushary-prompt-hook.js +25 -25
  31. package/dist/bin/pushary-session-end-hook.js +25 -25
  32. package/dist/bin/pushary-session-start-hook.js +30 -30
  33. package/dist/bin/pushary-setup.js +164 -112
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +34 -34
  36. package/dist/bin/pushary-stop-hook.js +25 -25
  37. package/dist/bin/pushary-stopfailure-hook.js +25 -25
  38. package/dist/bin/pushary-suggestions.js +14 -14
  39. package/dist/bin/pushary-transcript-register.js +18 -18
  40. package/dist/bin/pushary-transcripts.js +7 -7
  41. package/dist/bin/pushary-upgrade.js +41 -41
  42. package/dist/bin/pushary-wait.js +14 -14
  43. package/dist/bin/pushary.js +7 -6
  44. package/dist/{chunk-HC4DQXAT.js → chunk-2DORVRDB.js} +2 -2
  45. package/dist/{chunk-C6QBNBL4.js → chunk-2FUHSKXH.js} +7 -7
  46. package/dist/{chunk-45W43U2Q.js → chunk-2SXXH6JY.js} +5 -5
  47. package/dist/{chunk-JE6GG3OV.js → chunk-335ZDJ7R.js} +1 -1
  48. package/dist/{chunk-S4QT3YFG.js → chunk-3PM62C2R.js} +15 -15
  49. package/dist/{chunk-Y3N3SYBX.js → chunk-46F4BRUQ.js} +1 -1
  50. package/dist/{chunk-W3BO56VE.js → chunk-4A6VUVXV.js} +1 -1
  51. package/dist/{chunk-LDCRV6HG.js → chunk-57M4ERJK.js} +2 -1
  52. package/dist/{chunk-IMD5FN6Y.js → chunk-5DCZL3BC.js} +3 -3
  53. package/dist/chunk-6JPDAUFP.js +866 -0
  54. package/dist/{chunk-H6V5S52A.js → chunk-6TYKZ4DN.js} +3 -3
  55. package/dist/{chunk-VQL62ECJ.js → chunk-7SGYCU5C.js} +1 -1
  56. package/dist/{chunk-SATOTPXW.js → chunk-7URSJMAB.js} +1 -1
  57. package/dist/{chunk-PIZ65U3D.js → chunk-ASK2MSD2.js} +5 -5
  58. package/dist/{chunk-SCYAXV7U.js → chunk-AUOSFZJ3.js} +7 -7
  59. package/dist/{chunk-LOUZNXTJ.js → chunk-BT57FUMT.js} +2 -2
  60. package/dist/{chunk-4T2TGP4T.js → chunk-CDERSTBO.js} +94 -7
  61. package/dist/{chunk-LAAOHBLO.js → chunk-CFMCV6Z7.js} +2 -2
  62. package/dist/{chunk-ENGASUEL.js → chunk-DSGB5JLG.js} +4 -4
  63. package/dist/{chunk-ZJXEQV3A.js → chunk-ECFEYB6Z.js} +1 -1
  64. package/dist/{chunk-CIERFMQT.js → chunk-EH5ZDG6V.js} +4 -4
  65. package/dist/{chunk-IDVKJICN.js → chunk-EKGQEDQ4.js} +3 -11
  66. package/dist/{chunk-GTOBOC6M.js → chunk-EWC4P4ZL.js} +1 -1
  67. package/dist/{chunk-F7SZ2RCK.js → chunk-FOUK4CBO.js} +4 -4
  68. package/dist/{chunk-LE2YVPAT.js → chunk-GQ5KCVGK.js} +11 -11
  69. package/dist/{chunk-YRE6GUFZ.js → chunk-GZSSAY6N.js} +75 -161
  70. package/dist/{chunk-LWW7SBK3.js → chunk-H4ODQD3Y.js} +2 -2
  71. package/dist/{chunk-O7ADPLBF.js → chunk-HHX6IRSH.js} +1 -1
  72. package/dist/{chunk-H64CU2VB.js → chunk-IFT3GU7Y.js} +2 -2
  73. package/dist/{chunk-FPJHS6PA.js → chunk-IKYI63RF.js} +6 -6
  74. package/dist/{chunk-S3OWTQ6Z.js → chunk-IOVJVGIT.js} +12 -5
  75. package/dist/{chunk-RXXKFM22.js → chunk-K7EGWMDU.js} +370 -138
  76. package/dist/{chunk-AVT7GPOF.js → chunk-KS7NA5CK.js} +10 -10
  77. package/dist/{chunk-A64UCGX3.js → chunk-N2K3BSCA.js} +5 -5
  78. package/dist/{chunk-ZORCUL3Z.js → chunk-NJN5NRHZ.js} +4 -4
  79. package/dist/{chunk-Q7CUTGT4.js → chunk-OHFC3GJY.js} +1 -1
  80. package/dist/{chunk-JW4S4O4W.js → chunk-P2F3JUFX.js} +4 -4
  81. package/dist/{chunk-C54VJJ37.js → chunk-PWUIPQ2I.js} +3 -3
  82. package/dist/{chunk-F5ALKPNS.js → chunk-QQXP3CQA.js} +1 -1
  83. package/dist/{chunk-EA5NWDK7.js → chunk-R7ZQHAVL.js} +29 -0
  84. package/dist/{chunk-V5SUKRRI.js → chunk-RBJWPUI6.js} +4 -4
  85. package/dist/{chunk-J6MVBWF2.js → chunk-RFQWB5ZV.js} +1 -1
  86. package/dist/{chunk-NKBAEGT7.js → chunk-S6EGJBI5.js} +1 -1
  87. package/dist/{chunk-53KLSE2F.js → chunk-SFQSOBLM.js} +3 -3
  88. package/dist/{chunk-MSUMSXTI.js → chunk-SIN7NJD7.js} +1 -1
  89. package/dist/{chunk-55FB6OSG.js → chunk-U45OINYS.js} +1 -1
  90. package/dist/{chunk-TH74SUVV.js → chunk-U6Z56IQS.js} +2 -2
  91. package/dist/{chunk-JJWG7CBT.js → chunk-VO6XI6AX.js} +3 -3
  92. package/dist/{chunk-VIVLJK3T.js → chunk-WDIX4XZH.js} +2 -2
  93. package/dist/{chunk-Y4VZYKSW.js → chunk-WM76AN4X.js} +11 -11
  94. package/dist/{chunk-NV2LARV4.js → chunk-WPPKXVV3.js} +2 -2
  95. package/dist/{chunk-VGPEXMYM.js → chunk-XFHISCJM.js} +42 -7
  96. package/dist/{chunk-C3RVRTHS.js → chunk-YK7FGPYS.js} +3 -3
  97. package/dist/{chunk-JB4JCGRW.js → chunk-YWIFK2UB.js} +2 -2
  98. package/dist/{chunk-O4SYJVAF.js → chunk-YXGWG5PO.js} +5 -5
  99. package/dist/{chunk-XLHFWG2E.js → chunk-ZSY6BWUD.js} +2 -2
  100. package/dist/{global-upgrade-FFWOHOJ4.js → global-upgrade-U6NWZA5W.js} +6 -6
  101. package/dist/{paths-Y2WPCM5Y.js → paths-IQTB3ZZI.js} +2 -2
  102. package/dist/{reapply-N3MV3CKD.js → reapply-LILGWJO3.js} +21 -21
  103. package/dist/src/index.js +19 -19
  104. package/dist/{upgrade-lock-ZXXNRH2P.js → upgrade-lock-2BVFIDU4.js} +3 -3
  105. package/package.json +5 -2
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  readExistingMachineId
3
- } from "./chunk-W3BO56VE.js";
3
+ } from "./chunk-4A6VUVXV.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-7QLSKOSU.js";
7
7
  import {
8
8
  getBaseUrl
9
- } from "./chunk-GTOBOC6M.js";
9
+ } from "./chunk-EWC4P4ZL.js";
10
10
  import {
11
11
  clientContextHeaders,
12
12
  getPackageVersion
13
- } from "./chunk-RXXKFM22.js";
13
+ } from "./chunk-K7EGWMDU.js";
14
14
 
15
15
  // src/cli/net.ts
16
16
  import { createRequire } from "module";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-C3RVRTHS.js";
3
+ } from "./chunk-YK7FGPYS.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOOK_HOLD_BUDGET_ENV,
3
3
  hookHoldBudgetProof
4
- } from "./chunk-RXXKFM22.js";
4
+ } from "./chunk-K7EGWMDU.js";
5
5
 
6
6
  // src/hold-budget.ts
7
7
  var takeHookHoldBudget = (args = process.argv.slice(2), env = process.env) => {
@@ -2,23 +2,23 @@ import {
2
2
  CLAUDE_HOOK_EVENTS,
3
3
  GEMINI_HOOK_EVENTS,
4
4
  hasGeminiHooks
5
- } from "./chunk-IMD5FN6Y.js";
5
+ } from "./chunk-5DCZL3BC.js";
6
6
  import {
7
7
  AGENT_CHOICES
8
- } from "./chunk-Q7CUTGT4.js";
8
+ } from "./chunk-OHFC3GJY.js";
9
9
  import {
10
10
  BELL_HOOK_BINARY
11
- } from "./chunk-55FB6OSG.js";
11
+ } from "./chunk-U45OINYS.js";
12
12
  import {
13
13
  CODEX_HOOK_EVENTS,
14
14
  hasCodexHooks,
15
15
  holdBudgetOf
16
- } from "./chunk-S3OWTQ6Z.js";
16
+ } from "./chunk-IOVJVGIT.js";
17
17
  import {
18
18
  CURSOR_GATE_EVENTS,
19
19
  HOOK_LOCATOR_BINARY,
20
20
  hookCommandHoldBudget
21
- } from "./chunk-RXXKFM22.js";
21
+ } from "./chunk-K7EGWMDU.js";
22
22
 
23
23
  // src/diagnostics/bridge.ts
24
24
  import { execFileSync } from "child_process";
@@ -1,17 +1,17 @@
1
+ import {
2
+ readControlMode
3
+ } from "./chunk-YK7FGPYS.js";
1
4
  import {
2
5
  needsShell,
3
6
  spawnClaude
4
7
  } from "./chunk-XHKBHWLX.js";
5
- import {
6
- readControlMode
7
- } from "./chunk-C3RVRTHS.js";
8
8
  import {
9
9
  getMachineId
10
- } from "./chunk-W3BO56VE.js";
10
+ } from "./chunk-4A6VUVXV.js";
11
11
  import {
12
12
  pusharyDir,
13
13
  resolveGlobalBinary
14
- } from "./chunk-S3OWTQ6Z.js";
14
+ } from "./chunk-IOVJVGIT.js";
15
15
  import {
16
16
  readJsonSafe,
17
17
  writeFileAtomic,
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-AQFEP65J.js";
21
21
  import {
22
22
  getApiKey
23
- } from "./chunk-GTOBOC6M.js";
23
+ } from "./chunk-EWC4P4ZL.js";
24
24
  import {
25
25
  CLI_PACKAGE_NAMES,
26
26
  cmdShimTarget,
@@ -28,7 +28,7 @@ import {
28
28
  globalPackageFolder,
29
29
  globalRootFor,
30
30
  isRecord
31
- } from "./chunk-RXXKFM22.js";
31
+ } from "./chunk-K7EGWMDU.js";
32
32
 
33
33
  // src/daemon-lifecycle.ts
34
34
  import { dirname, join, win32 as win32Path } from "path";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  parseSseMessages
3
- } from "./chunk-53KLSE2F.js";
3
+ } from "./chunk-SFQSOBLM.js";
4
4
  import {
5
5
  NPX_LATEST_COMMAND
6
- } from "./chunk-LDCRV6HG.js";
6
+ } from "./chunk-57M4ERJK.js";
7
7
 
8
8
  // src/mcp-stdio-bridge.ts
9
9
  var MCP_BRIDGE_BINARY = "pushary-mcp";
@@ -5,26 +5,28 @@ import {
5
5
  import {
6
6
  SubscriptionRequiredError,
7
7
  callMcpTool
8
- } from "./chunk-53KLSE2F.js";
8
+ } from "./chunk-SFQSOBLM.js";
9
9
  import {
10
10
  installNetworkDefaults,
11
11
  isNetworkFailure
12
- } from "./chunk-H6V5S52A.js";
12
+ } from "./chunk-6TYKZ4DN.js";
13
13
  import {
14
14
  clientReportClaims
15
- } from "./chunk-S3OWTQ6Z.js";
15
+ } from "./chunk-IOVJVGIT.js";
16
16
  import {
17
17
  getApiKey,
18
18
  getBaseUrl
19
- } from "./chunk-GTOBOC6M.js";
19
+ } from "./chunk-EWC4P4ZL.js";
20
20
  import {
21
21
  ASK_AGENT_NAME_MAX,
22
22
  CLIENT_REPORT_PATH,
23
23
  DECISION_LINE_MAX,
24
24
  GATE_PERMISSION_MODE_MAX_LENGTH,
25
25
  degradedLine,
26
+ localRepoKey,
27
+ normalizeRepoRemote,
26
28
  truncateLine
27
- } from "./chunk-RXXKFM22.js";
29
+ } from "./chunk-K7EGWMDU.js";
28
30
 
29
31
  // src/client-report-claim.ts
30
32
  import { createHash } from "crypto";
@@ -222,7 +224,7 @@ var nextLongPollMs = (deadlineMs, nowMs) => {
222
224
  return hold >= MIN_LONG_POLL_MS ? hold : null;
223
225
  };
224
226
  var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3) => {
225
- const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
227
+ const sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
226
228
  while (Date.now() < deadlineMs) {
227
229
  const hold = nextLongPollMs(deadlineMs, Date.now());
228
230
  if (hold === null) {
@@ -296,6 +298,90 @@ var claimBlockedAction = async (apiKey, request, timeoutMs) => {
296
298
  }
297
299
  };
298
300
 
301
+ // src/repo.ts
302
+ import { existsSync, readFileSync, statSync } from "fs";
303
+ import { basename, dirname, isAbsolute, join as join2, resolve } from "path";
304
+ var MAX_PARENT_WALK = 64;
305
+ var GIT_FILE_PREFIX = "gitdir:";
306
+ var findGitDir = (startDir) => {
307
+ let current = resolve(startDir);
308
+ for (let depth = 0; depth < MAX_PARENT_WALK; depth += 1) {
309
+ const candidate = join2(current, ".git");
310
+ try {
311
+ if (existsSync(candidate)) {
312
+ if (statSync(candidate).isDirectory()) return candidate;
313
+ const pointer = readFileSync(candidate, "utf-8").trim();
314
+ if (pointer.startsWith(GIT_FILE_PREFIX)) {
315
+ const target = pointer.slice(GIT_FILE_PREFIX.length).trim();
316
+ return isAbsolute(target) ? target : resolve(current, target);
317
+ }
318
+ }
319
+ } catch {
320
+ }
321
+ const parent = dirname(current);
322
+ if (parent === current) return void 0;
323
+ current = parent;
324
+ }
325
+ return void 0;
326
+ };
327
+ var configPathFor = (gitDir) => {
328
+ const index = gitDir.replace(/\\/g, "/").indexOf("/worktrees/");
329
+ return index === -1 ? join2(gitDir, "config") : join2(gitDir.slice(0, index), "config");
330
+ };
331
+ var ORIGIN_SECTION = /^\[remote "origin"\]/;
332
+ var SECTION_HEADER = /^\[/;
333
+ var URL_LINE = /^url\s*=\s*(.+)$/;
334
+ var readOriginRemote = (gitDir) => {
335
+ try {
336
+ const configPath = configPathFor(gitDir);
337
+ if (!existsSync(configPath)) return void 0;
338
+ let inOrigin = false;
339
+ for (const rawLine of readFileSync(configPath, "utf-8").split("\n")) {
340
+ const line = rawLine.trim();
341
+ if (SECTION_HEADER.test(line)) {
342
+ inOrigin = ORIGIN_SECTION.test(line);
343
+ continue;
344
+ }
345
+ if (!inOrigin) continue;
346
+ const url = URL_LINE.exec(line);
347
+ if (url) return url[1]?.trim();
348
+ }
349
+ } catch {
350
+ }
351
+ return void 0;
352
+ };
353
+ var deriveRepoKey = (cwd) => {
354
+ const dir = cwd && cwd.length > 0 ? cwd : process.cwd();
355
+ try {
356
+ const gitDir = findGitDir(dir);
357
+ if (gitDir) {
358
+ const remote = readOriginRemote(gitDir);
359
+ const normalized = remote ? normalizeRepoRemote(remote) : void 0;
360
+ if (normalized) return normalized;
361
+ const root = gitDir.endsWith(".git") ? dirname(gitDir) : dir;
362
+ return localRepoKey(basename(root));
363
+ }
364
+ return localRepoKey(basename(resolve(dir)));
365
+ } catch {
366
+ return void 0;
367
+ }
368
+ };
369
+ var repoKeyCache = /* @__PURE__ */ new Map();
370
+ var REPO_KEY_ENV = "PUSHARY_REPO_KEY";
371
+ var repoKeyFor = (cwd) => {
372
+ const override = process.env[REPO_KEY_ENV];
373
+ if (typeof override === "string") {
374
+ const trimmed = override.trim();
375
+ if (trimmed.toLowerCase() === "off") return void 0;
376
+ if (trimmed.length > 0) return trimmed.toLowerCase();
377
+ }
378
+ const dir = cwd && cwd.length > 0 ? cwd : process.cwd();
379
+ if (repoKeyCache.has(dir)) return repoKeyCache.get(dir);
380
+ const derived = deriveRepoKey(dir);
381
+ repoKeyCache.set(dir, derived);
382
+ return derived;
383
+ };
384
+
299
385
  export {
300
386
  reportClientError,
301
387
  exitAfterClientReports,
@@ -318,5 +404,6 @@ export {
318
404
  waitForQuestion,
319
405
  sendNotification,
320
406
  requestGate,
321
- claimBlockedAction
407
+ claimBlockedAction,
408
+ repoKeyFor
322
409
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  configFilePath
3
- } from "./chunk-GTOBOC6M.js";
3
+ } from "./chunk-EWC4P4ZL.js";
4
4
  import {
5
5
  normalizeInstallSource
6
- } from "./chunk-RXXKFM22.js";
6
+ } from "./chunk-K7EGWMDU.js";
7
7
 
8
8
  // src/install-source.ts
9
9
  import { readFileSync } from "fs";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-V5SUKRRI.js";
4
+ } from "./chunk-RBJWPUI6.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-PIZ65U3D.js";
7
+ } from "./chunk-ASK2MSD2.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-S3OWTQ6Z.js";
11
+ } from "./chunk-IOVJVGIT.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-RXXKFM22.js";
14
+ } from "./chunk-K7EGWMDU.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-YRE6GUFZ.js";
3
+ } from "./chunk-GZSSAY6N.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-S4QT3YFG.js";
3
+ } from "./chunk-3PM62C2R.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-V5SUKRRI.js";
6
+ } from "./chunk-RBJWPUI6.js";
7
7
  import {
8
8
  writeDegraded
9
- } from "./chunk-4T2TGP4T.js";
9
+ } from "./chunk-CDERSTBO.js";
10
10
  import {
11
11
  claudeShapedHookInput,
12
12
  hookCompatibleProfileBySource,
13
13
  isGrokHookPayload,
14
14
  isGrokSessionEndStop
15
- } from "./chunk-RXXKFM22.js";
15
+ } from "./chunk-K7EGWMDU.js";
16
16
 
17
17
  // src/tool-hook-input.ts
18
18
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
@@ -3,11 +3,11 @@ import {
3
3
  decodePublicKey,
4
4
  generateSessionKey,
5
5
  wrapSessionKey
6
- } from "./chunk-MSUMSXTI.js";
6
+ } from "./chunk-SIN7NJD7.js";
7
7
  import {
8
8
  fetchTranscriptRecipients,
9
9
  uploadTranscriptRecords
10
- } from "./chunk-J6MVBWF2.js";
10
+ } from "./chunk-RFQWB5ZV.js";
11
11
 
12
12
  // src/live-session.ts
13
13
  var MAX_TRANSCRIPT_QUEUE = 100;
@@ -24,19 +24,11 @@ var liveSessionSleep = (ms, signal) => new Promise((resolve) => {
24
24
  signal.addEventListener("abort", done, { once: true });
25
25
  });
26
26
  var postLiveSession = (options, path, body) => {
27
- const controller = new AbortController();
28
- const abort = () => controller.abort();
29
- const timeout = setTimeout(abort, options.requestTimeoutMs ?? 1e4);
30
- if (options.signal.aborted) abort();
31
- else options.signal.addEventListener("abort", abort, { once: true });
32
27
  return fetch(`${options.baseUrl}${path}`, {
33
28
  method: "POST",
34
29
  headers: { Authorization: `Bearer ${options.apiKey}`, "Content-Type": "application/json" },
35
30
  body: JSON.stringify(body),
36
- signal: controller.signal
37
- }).finally(() => {
38
- clearTimeout(timeout);
39
- options.signal.removeEventListener("abort", abort);
31
+ signal: AbortSignal.any([options.signal, AbortSignal.timeout(options.requestTimeoutMs ?? 1e4)])
40
32
  });
41
33
  };
42
34
  var postLiveSessionUntilAccepted = async (options, path, body) => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-LDCRV6HG.js";
3
+ } from "./chunk-57M4ERJK.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-O4SYJVAF.js";
3
+ } from "./chunk-YXGWG5PO.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-C3RVRTHS.js";
6
+ } from "./chunk-YK7FGPYS.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-S3OWTQ6Z.js";
9
+ } from "./chunk-IOVJVGIT.js";
10
10
  import {
11
11
  readJsonSafe
12
12
  } from "./chunk-AQFEP65J.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-RXXKFM22.js";
15
+ } from "./chunk-K7EGWMDU.js";
16
16
 
17
17
  // src/shared-mcp-key.ts
18
18
  var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
@@ -1,29 +1,29 @@
1
- import {
2
- detectProviderLiveCapabilities,
3
- expectedLaunchCapabilities,
4
- hasSpawnProvider,
5
- resolveControlPolicy
6
- } from "./chunk-NV2LARV4.js";
7
1
  import {
8
2
  daemonHasRemoteProof,
9
3
  daemonServiceManagerAvailable,
10
4
  hasDaemonServiceDefinition,
11
5
  readDaemonNeedsLogin,
12
6
  readDaemonStatus
13
- } from "./chunk-SCYAXV7U.js";
7
+ } from "./chunk-AUOSFZJ3.js";
14
8
  import {
15
9
  readControlMode,
16
10
  readKeySource
17
- } from "./chunk-C3RVRTHS.js";
11
+ } from "./chunk-YK7FGPYS.js";
12
+ import {
13
+ detectProviderLiveCapabilities,
14
+ expectedLaunchCapabilities,
15
+ hasSpawnProvider,
16
+ resolveControlPolicy
17
+ } from "./chunk-WPPKXVV3.js";
18
18
  import {
19
19
  getMachineId
20
- } from "./chunk-W3BO56VE.js";
20
+ } from "./chunk-4A6VUVXV.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-GTOBOC6M.js";
23
+ } from "./chunk-EWC4P4ZL.js";
24
24
  import {
25
25
  getPackageVersion
26
- } from "./chunk-RXXKFM22.js";
26
+ } from "./chunk-K7EGWMDU.js";
27
27
 
28
28
  // src/machines.ts
29
29
  import { hostname } from "os";