@pushary/agent-hooks 1.9.62 → 1.9.64

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 (130) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +2 -2
  3. package/dist/{api-7HLZRIUV.js → api-HDLTZTVR.js} +10 -11
  4. package/dist/bin/pushary-bell-hook.js +27 -30
  5. package/dist/bin/pushary-bell.js +10 -11
  6. package/dist/bin/pushary-claude.js +29 -32
  7. package/dist/bin/pushary-clean.js +63 -42
  8. package/dist/bin/pushary-codex-bridge.js +22 -24
  9. package/dist/bin/pushary-codex-hook.js +33 -36
  10. package/dist/bin/pushary-codex-session.js +8 -8
  11. package/dist/bin/pushary-codex.js +13 -15
  12. package/dist/bin/pushary-connect.js +26 -29
  13. package/dist/bin/pushary-cowork.js +5 -5
  14. package/dist/bin/pushary-daemon.js +39 -41
  15. package/dist/bin/pushary-disconnect.js +60 -40
  16. package/dist/bin/pushary-doctor.js +89 -46
  17. package/dist/bin/pushary-elicitation-hook.js +28 -31
  18. package/dist/bin/pushary-gemini-bridge.js +16 -18
  19. package/dist/bin/pushary-gemini-hook.js +30 -33
  20. package/dist/bin/pushary-hook.js +31 -34
  21. package/dist/bin/pushary-login.js +27 -16
  22. package/dist/bin/pushary-logout.js +26 -29
  23. package/dist/bin/pushary-mcp.js +11 -12
  24. package/dist/bin/pushary-mode.js +14 -15
  25. package/dist/bin/pushary-notification-hook.js +26 -29
  26. package/dist/bin/pushary-opencode-hook.js +29 -32
  27. package/dist/bin/pushary-permission-denied-hook.js +31 -34
  28. package/dist/bin/pushary-permission-hook.js +30 -33
  29. package/dist/bin/pushary-post-hook.js +26 -29
  30. package/dist/bin/pushary-prompt-hook.js +26 -29
  31. package/dist/bin/pushary-session-end-hook.js +28 -31
  32. package/dist/bin/pushary-session-start-hook.js +35 -37
  33. package/dist/bin/pushary-setup.js +361 -4412
  34. package/dist/bin/pushary-stats.js +5 -5
  35. package/dist/bin/pushary-status.js +32 -35
  36. package/dist/bin/pushary-stop-hook.js +26 -29
  37. package/dist/bin/pushary-stopfailure-hook.js +26 -29
  38. package/dist/bin/pushary-suggestions.js +14 -15
  39. package/dist/bin/pushary-transcript-register.js +18 -21
  40. package/dist/bin/pushary-transcripts.js +63 -11
  41. package/dist/bin/pushary-upgrade.js +41 -43
  42. package/dist/bin/pushary-wait.js +14 -15
  43. package/dist/bin/pushary.js +7 -8
  44. package/dist/{chunk-SJCPIYWJ.js → chunk-2CEVEMJE.js} +3 -3
  45. package/dist/{chunk-3YGUWPNZ.js → chunk-2EY4HGLG.js} +3 -3
  46. package/dist/{chunk-ESXGCZDA.js → chunk-2KID4FK4.js} +4 -4
  47. package/dist/{chunk-EO6CL4PD.js → chunk-2PKHGHMA.js} +2 -2
  48. package/dist/{chunk-PSCXEH42.js → chunk-2VADJ6JH.js} +2 -2
  49. package/dist/{chunk-GV43RXR2.js → chunk-2YXBCZ3Z.js} +1 -1
  50. package/dist/{chunk-7GU4PXE5.js → chunk-2Z7I7DHT.js} +1 -1
  51. package/dist/{chunk-4K6YZPZ3.js → chunk-3KXBRSL3.js} +1 -1
  52. package/dist/{chunk-YQK72JGV.js → chunk-42PD2MQH.js} +5 -5
  53. package/dist/{chunk-EUNSJKJJ.js → chunk-57PU5OBL.js} +21 -14
  54. package/dist/{chunk-5R23J52J.js → chunk-5NP3OJ5P.js} +7 -9
  55. package/dist/{chunk-UWCPY4RY.js → chunk-5TNGBDIE.js} +2 -2
  56. package/dist/{chunk-ZEDGKCCM.js → chunk-5TUDGSDC.js} +1 -1
  57. package/dist/{chunk-M7MEVILL.js → chunk-66FRMK7V.js} +4 -4
  58. package/dist/{chunk-3LBB7GVF.js → chunk-6HPLEGUP.js} +4 -4
  59. package/dist/{chunk-LCNN7UOE.js → chunk-6QPDBD7Q.js} +3 -57
  60. package/dist/{chunk-AFV3FQNG.js → chunk-7UBDBJTG.js} +4 -4
  61. package/dist/{chunk-RFCEVROB.js → chunk-A5KQXZR7.js} +3 -3
  62. package/dist/{chunk-G3ZDCYMU.js → chunk-ADRPW7KU.js} +2 -2
  63. package/dist/{chunk-OZRT64BB.js → chunk-AN7C3CHH.js} +1 -1
  64. package/dist/{chunk-6JAWNRDR.js → chunk-AQAPPSDV.js} +3 -3
  65. package/dist/{chunk-FG5HMJ7C.js → chunk-BAGBCSXA.js} +4 -2
  66. package/dist/{chunk-W3CBFLIX.js → chunk-BLAIETMP.js} +18 -4
  67. package/dist/{chunk-CFIQ3252.js → chunk-BSZIPIFA.js} +128 -26
  68. package/dist/{chunk-7EHZXZB2.js → chunk-CCNH4PJ2.js} +12 -12
  69. package/dist/{chunk-NZLQ6GMX.js → chunk-CJADXAJU.js} +9 -9
  70. package/dist/{chunk-TMHE5CVX.js → chunk-DCMRNIDM.js} +4 -4
  71. package/dist/{chunk-QW3FRUFB.js → chunk-DVYVGBPB.js} +1 -1
  72. package/dist/{chunk-RSNN2TPE.js → chunk-E23RKH3T.js} +9 -9
  73. package/dist/{chunk-ZJFJUAHS.js → chunk-E2LB6JNV.js} +6 -6
  74. package/dist/{chunk-HSRNWCXJ.js → chunk-EEM65CGJ.js} +3 -3
  75. package/dist/chunk-H4BKC2GN.js +1201 -0
  76. package/dist/{chunk-7NXB7OVX.js → chunk-HVOQUPSO.js} +1 -1
  77. package/dist/{chunk-R3CLBNST.js → chunk-IZTDX2MX.js} +3 -3
  78. package/dist/{chunk-RU37NSZH.js → chunk-JTOBQUIL.js} +3 -3
  79. package/dist/{chunk-W6MYFAOK.js → chunk-JX3DHGZX.js} +44 -32
  80. package/dist/{chunk-7NJ4TDUH.js → chunk-KA7JIMTG.js} +6 -6
  81. package/dist/chunk-KEPESIIR.js +4117 -0
  82. package/dist/{chunk-EA6574W2.js → chunk-KX3RMF6T.js} +12 -6
  83. package/dist/{chunk-BIUSODLS.js → chunk-LA7CKRZN.js} +2 -2
  84. package/dist/{chunk-A4CZPUQ6.js → chunk-LMC5UPL7.js} +1 -1
  85. package/dist/{chunk-EVZDYG7L.js → chunk-LV6DX4P6.js} +2 -2
  86. package/dist/{chunk-LWR5VKNC.js → chunk-MIPJ2VXP.js} +12 -14
  87. package/dist/{chunk-557ZE5EX.js → chunk-ML2Q6WWE.js} +37 -214
  88. package/dist/{chunk-FXECTHAG.js → chunk-MNKIR2ZB.js} +37 -4
  89. package/dist/{chunk-LILS32LF.js → chunk-MPPTIZ2G.js} +212 -254
  90. package/dist/{chunk-VUFHYMSP.js → chunk-MXPOLQZH.js} +1 -1
  91. package/dist/{chunk-MYEALNW6.js → chunk-NOH3EJFH.js} +1 -1
  92. package/dist/{chunk-GFAG72LR.js → chunk-NUEPJ5W6.js} +7 -3
  93. package/dist/chunk-NYV45Q25.js +111 -0
  94. package/dist/{chunk-NAZRRXZM.js → chunk-O7PCNYEY.js} +2 -2
  95. package/dist/{chunk-7E2ZN7XA.js → chunk-OQKSF5ST.js} +3 -5
  96. package/dist/{chunk-VF3IL56Q.js → chunk-PLMX3IHG.js} +3 -3
  97. package/dist/{chunk-F35YILEN.js → chunk-PMLQRB3D.js} +1 -1
  98. package/dist/{chunk-SJJYXMJP.js → chunk-Q6ID23SU.js} +6 -6
  99. package/dist/{chunk-SDOWT67G.js → chunk-QECRQWLV.js} +5 -5
  100. package/dist/{chunk-Q4WTIKM6.js → chunk-QNATBOUH.js} +3 -3
  101. package/dist/{chunk-QIPW7OVB.js → chunk-QPPBH5NY.js} +5 -5
  102. package/dist/{chunk-7ETELRQX.js → chunk-QSW3HAKI.js} +16 -5
  103. package/dist/{chunk-FVERRWDP.js → chunk-RY4EPMZX.js} +2 -2
  104. package/dist/{chunk-MURJ4WAL.js → chunk-SROWUG5W.js} +1 -1
  105. package/dist/{chunk-UUAVYIWJ.js → chunk-TJUJAK5L.js} +4 -2
  106. package/dist/{chunk-3IFCXMC6.js → chunk-TR3GP5MH.js} +1 -1
  107. package/dist/{chunk-FX7KDF47.js → chunk-VHKK3US3.js} +3 -3
  108. package/dist/{chunk-6HIYOY6I.js → chunk-VNRWQCGU.js} +6 -6
  109. package/dist/{chunk-67Q3Q5IO.js → chunk-XF3AWNMO.js} +6 -6
  110. package/dist/{chunk-44FNEAXK.js → chunk-XJIIU36L.js} +1 -1
  111. package/dist/{chunk-DFKEJARZ.js → chunk-Y64JGYTB.js} +1 -1
  112. package/dist/{chunk-FYS27SUS.js → chunk-YUDZCJYC.js} +10 -10
  113. package/dist/{codex-app-cards-switch-IIL7IPP6.js → codex-app-cards-switch-JQ6356VX.js} +11 -12
  114. package/dist/{codex-desktop-launch-XCLMYVBD.js → codex-desktop-launch-YUB2LOAG.js} +1 -1
  115. package/dist/{codex-session-launch-UMVALJ3A.js → codex-session-launch-UKMAORXS.js} +19 -21
  116. package/dist/{config-5N3GUJD5.js → config-YY54G3CC.js} +3 -3
  117. package/dist/{global-upgrade-5F4CSXED.js → global-upgrade-Y4USGPS2.js} +10 -12
  118. package/dist/{identity-7ULYW4RL.js → identity-W5CYL5RC.js} +4 -5
  119. package/dist/{live-capabilities-QTSFXA6T.js → live-capabilities-JRNNA5EP.js} +5 -7
  120. package/dist/{paths-HEMK2ALW.js → paths-4MEBINV3.js} +7 -3
  121. package/dist/reapply-ZN7C3CB3.js +63 -0
  122. package/dist/src/index.js +20 -23
  123. package/dist/{upgrade-lock-IAZC5644.js → upgrade-lock-QAWUV2DO.js} +4 -5
  124. package/dist/{usage-NEFDYSRT.js → usage-43C2DHDU.js} +3 -3
  125. package/package.json +1 -1
  126. package/dist/chunk-6ICPEJY5.js +0 -20
  127. package/dist/chunk-6YSEOXP5.js +0 -615
  128. package/dist/chunk-LL2KHEJH.js +0 -41
  129. package/dist/chunk-QENTGE75.js +0 -86
  130. package/dist/reapply-AMFKVYZV.js +0 -63
@@ -0,0 +1,111 @@
1
+ import {
2
+ NpmInstallError,
3
+ NpmMissingError,
4
+ NpmPermissionError,
5
+ writeFileAtomic
6
+ } from "./chunk-BSZIPIFA.js";
7
+ import {
8
+ NPX_LATEST_COMMAND
9
+ } from "./chunk-BAGBCSXA.js";
10
+ import {
11
+ readSetupAgentFailures
12
+ } from "./chunk-MNKIR2ZB.js";
13
+
14
+ // src/setup/config-write.ts
15
+ var AgentConfigWriteError = class extends Error {
16
+ constructor(error) {
17
+ super(error instanceof Error ? error.message : String(error), { cause: error });
18
+ this.name = "AgentConfigWriteError";
19
+ }
20
+ };
21
+ var writeSetupConfigFile = (path, content, mode = 384) => {
22
+ try {
23
+ writeFileAtomic(path, content, mode);
24
+ } catch (error) {
25
+ throw new AgentConfigWriteError(error);
26
+ }
27
+ };
28
+ var writeSetupConfigJson = (path, value, mode) => writeSetupConfigFile(path, `${JSON.stringify(value, null, 2)}
29
+ `, mode);
30
+
31
+ // src/setup/agent-failure.ts
32
+ var AgentConfigError = class extends Error {
33
+ kind;
34
+ filePath;
35
+ constructor(kind, filePath, message) {
36
+ super(message);
37
+ this.name = "AgentConfigError";
38
+ this.kind = kind;
39
+ this.filePath = filePath;
40
+ }
41
+ };
42
+ var configFailureKind = (readFailure) => readFailure === "unparseable" ? "config-unparseable" : "config-unreadable";
43
+ var AGENT_FAILURE_DETAILS = {
44
+ "not-wired": "reported success but its config is not there.",
45
+ "app-account-mismatch": "Pushary for Mac set it up with an account that does not match this setup, so it was left as it is."
46
+ };
47
+ var DESCRIBED_FAILURE_REMEDIES = {
48
+ "not-wired": "retry-agent",
49
+ "app-account-mismatch": "match-mac-account"
50
+ };
51
+ var describedAgentFailure = (agent, kind) => ({
52
+ agent,
53
+ kind,
54
+ detail: AGENT_FAILURE_DETAILS[kind],
55
+ remedy: DESCRIBED_FAILURE_REMEDIES[kind],
56
+ stage: kind === "not-wired" ? "hook-validation" : "account-check"
57
+ });
58
+ var NPM_PERMISSION_REMEDIES = {
59
+ "global-prefix": "fix-npm-prefix",
60
+ "file-in-use": "close-node-programs"
61
+ };
62
+ var remedyForError = (error) => {
63
+ if (error instanceof NpmMissingError) return "install-node";
64
+ if (error instanceof NpmPermissionError) return NPM_PERMISSION_REMEDIES[error.kind];
65
+ return "retry-agent";
66
+ };
67
+ var setupFailureDiagnostic = (error) => {
68
+ if (error instanceof AgentConfigError) return { stage: "config-read" };
69
+ if (error instanceof AgentConfigWriteError) return { stage: "config-write", diagnosticCode: "config-write-failed" };
70
+ if (error instanceof NpmMissingError) return { stage: "runtime-install", diagnosticCode: "npm-missing" };
71
+ if (error instanceof NpmPermissionError) {
72
+ return { stage: "runtime-install", diagnosticCode: error.kind === "global-prefix" ? "npm-global-prefix-denied" : "npm-file-in-use" };
73
+ }
74
+ if (error instanceof NpmInstallError) return { stage: "runtime-install", diagnosticCode: "npm-install-failed" };
75
+ return { stage: "unknown" };
76
+ };
77
+ var agentFailureFromError = (agent, error, describeError) => ({
78
+ agent,
79
+ kind: error instanceof AgentConfigError ? error.kind : "installer-error",
80
+ detail: describeError(error),
81
+ remedy: remedyForError(error),
82
+ ...setupFailureDiagnostic(error)
83
+ });
84
+ var retryAgentCommand = (agent) => `${NPX_LATEST_COMMAND} setup --agents ${agent}`;
85
+ var takeOverHooksCommand = (agent) => `${retryAgentCommand(agent)} --take-over-hooks`;
86
+ var matchMacAccountStep = (agent, setupAccount) => `Sign Pushary for Mac into ${setupAccount ?? "this setup's account"}, or run ${takeOverHooksCommand(agent)}`;
87
+ var UNCHECKED_ACCOUNT = "an account that could not be checked";
88
+ var describeMacAccountMismatch = (mismatch) => [
89
+ `${mismatch.agentName}: Pushary for Mac uses ${mismatch.macAccount ?? UNCHECKED_ACCOUNT}. This setup uses ${mismatch.setupAccount ?? UNCHECKED_ACCOUNT}.`,
90
+ matchMacAccountStep(mismatch.agent, mismatch.setupAccount)
91
+ ];
92
+ var REMAINING_AGENTS_CONTINUE = "Other agents will continue. Re-run setup to retry.";
93
+ var afterAgentFailureNote = (agentsStillToSetUp) => agentsStillToSetUp > 0 ? REMAINING_AGENTS_CONTINUE : null;
94
+ var failedAgentsContext = (configuredAgentNames) => configuredAgentNames.length > 0 ? `(configured: ${configuredAgentNames.join(", ")})` : null;
95
+ var agentFailureWire = (failures) => readSetupAgentFailures(failures);
96
+
97
+ export {
98
+ AgentConfigWriteError,
99
+ writeSetupConfigFile,
100
+ writeSetupConfigJson,
101
+ AgentConfigError,
102
+ configFailureKind,
103
+ describedAgentFailure,
104
+ agentFailureFromError,
105
+ retryAgentCommand,
106
+ matchMacAccountStep,
107
+ describeMacAccountMismatch,
108
+ afterAgentFailureNote,
109
+ failedAgentsContext,
110
+ agentFailureWire
111
+ };
@@ -4,10 +4,10 @@ import {
4
4
  keyPrefix,
5
5
  readConfigFileKey,
6
6
  readMacAppKeyPrefix
7
- } from "./chunk-W3CBFLIX.js";
7
+ } from "./chunk-BLAIETMP.js";
8
8
  import {
9
9
  NPX_LATEST_COMMAND
10
- } from "./chunk-FG5HMJ7C.js";
10
+ } from "./chunk-BAGBCSXA.js";
11
11
 
12
12
  // src/key-signed-out.ts
13
13
  var VERDICT_BY_CHECK = {
@@ -1,13 +1,11 @@
1
1
  import {
2
2
  autoUpdateLock
3
- } from "./chunk-6YSEOXP5.js";
3
+ } from "./chunk-H4BKC2GN.js";
4
4
  import {
5
5
  installPackageGlobally,
6
- npmErrorMessage
7
- } from "./chunk-CFIQ3252.js";
8
- import {
6
+ npmErrorMessage,
9
7
  writeJsonAtomic
10
- } from "./chunk-QENTGE75.js";
8
+ } from "./chunk-BSZIPIFA.js";
11
9
 
12
10
  // src/upgrade-lock.ts
13
11
  import { fork } from "child_process";
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-POFBE6ZY.js";
4
4
  import {
5
5
  autoUpdateState
6
- } from "./chunk-6YSEOXP5.js";
6
+ } from "./chunk-H4BKC2GN.js";
7
7
  import {
8
8
  readJsonSafe,
9
9
  writeJsonAtomic
10
- } from "./chunk-QENTGE75.js";
10
+ } from "./chunk-BSZIPIFA.js";
11
11
  import {
12
12
  CLI_PACKAGE_NAMES,
13
13
  POSIX_GLOBAL_ROOT_SEGMENTS,
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-QTOLNRET.js";
18
18
  import {
19
19
  isAutoUpdateResult
20
- } from "./chunk-FXECTHAG.js";
20
+ } from "./chunk-MNKIR2ZB.js";
21
21
 
22
22
  // src/auto-update.ts
23
23
  import { spawn } from "child_process";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-6YSEOXP5.js";
3
+ } from "./chunk-H4BKC2GN.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -4,30 +4,30 @@ import {
4
4
  postLiveSession,
5
5
  postLiveSessionUntilAccepted,
6
6
  startLiveSessionHeartbeat
7
- } from "./chunk-GFAG72LR.js";
7
+ } from "./chunk-NUEPJ5W6.js";
8
8
  import {
9
9
  SESSION_IDLE_TIMEOUT_MS,
10
10
  describeIdleWindow,
11
11
  idleDeadlinePassed,
12
12
  startProcessOwnership
13
- } from "./chunk-RFCEVROB.js";
13
+ } from "./chunk-A5KQXZR7.js";
14
14
  import {
15
15
  spawnClaude
16
16
  } from "./chunk-XHKBHWLX.js";
17
17
  import {
18
18
  repoKeyFor
19
- } from "./chunk-4K6YZPZ3.js";
19
+ } from "./chunk-3KXBRSL3.js";
20
20
  import {
21
21
  isAskUserResponse,
22
22
  isDecisionStopped,
23
23
  isWaitForAnswerResponse,
24
24
  withdrawQuestion,
25
25
  writeDegraded
26
- } from "./chunk-RSNN2TPE.js";
26
+ } from "./chunk-E23RKH3T.js";
27
27
  import {
28
28
  callMcpTool,
29
29
  isRetryable
30
- } from "./chunk-ESXGCZDA.js";
30
+ } from "./chunk-2KID4FK4.js";
31
31
  import {
32
32
  AGENT_QUESTION_DESCRIPTION_MAX,
33
33
  AGENT_QUESTION_HEADER_MAX,
@@ -48,7 +48,7 @@ import {
48
48
  parseCodexQuestions,
49
49
  planElicitationAsk,
50
50
  readElicitationFields
51
- } from "./chunk-FXECTHAG.js";
51
+ } from "./chunk-MNKIR2ZB.js";
52
52
 
53
53
  // src/codex-question-owner.ts
54
54
  import { createHash } from "crypto";
@@ -3,24 +3,24 @@ import {
3
3
  expectedLaunchCapabilities,
4
4
  hasSpawnProvider,
5
5
  resolveControlPolicy
6
- } from "./chunk-TMHE5CVX.js";
6
+ } from "./chunk-DCMRNIDM.js";
7
7
  import {
8
8
  daemonHasRemoteProof,
9
9
  daemonServiceManagerAvailable,
10
10
  hasDaemonServiceDefinition,
11
11
  readDaemonNeedsLogin,
12
12
  readDaemonStatus
13
- } from "./chunk-5R23J52J.js";
13
+ } from "./chunk-5NP3OJ5P.js";
14
14
  import {
15
15
  readControlMode,
16
16
  readKeySource
17
- } from "./chunk-W3CBFLIX.js";
17
+ } from "./chunk-BLAIETMP.js";
18
18
  import {
19
19
  getMachineId
20
- } from "./chunk-G3ZDCYMU.js";
20
+ } from "./chunk-ADRPW7KU.js";
21
21
  import {
22
22
  getBaseUrl
23
- } from "./chunk-DFKEJARZ.js";
23
+ } from "./chunk-Y64JGYTB.js";
24
24
  import {
25
25
  getPackageVersion
26
26
  } from "./chunk-QTOLNRET.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pusharyFetch
3
- } from "./chunk-HSRNWCXJ.js";
3
+ } from "./chunk-EEM65CGJ.js";
4
4
  import {
5
5
  NetworkError
6
6
  } from "./chunk-PPY5N2E6.js";
@@ -9,11 +9,11 @@ import {
9
9
  } from "./chunk-KZERVKTD.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-DFKEJARZ.js";
12
+ } from "./chunk-Y64JGYTB.js";
13
13
  import {
14
14
  isValidApiKey,
15
15
  normalizeKeyScope
16
- } from "./chunk-FXECTHAG.js";
16
+ } from "./chunk-MNKIR2ZB.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,18 +1,18 @@
1
1
  import {
2
2
  macAppBridgeAvailable
3
- } from "./chunk-6HIYOY6I.js";
3
+ } from "./chunk-VNRWQCGU.js";
4
4
  import {
5
5
  keyPrefix
6
- } from "./chunk-W3CBFLIX.js";
6
+ } from "./chunk-BLAIETMP.js";
7
7
  import {
8
8
  bridgeAgentKey
9
- } from "./chunk-6YSEOXP5.js";
9
+ } from "./chunk-H4BKC2GN.js";
10
10
  import {
11
11
  readJsonSafe
12
- } from "./chunk-QENTGE75.js";
12
+ } from "./chunk-BSZIPIFA.js";
13
13
  import {
14
14
  isValidApiKey
15
- } from "./chunk-FXECTHAG.js";
15
+ } from "./chunk-MNKIR2ZB.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,9 +1,16 @@
1
1
  import {
2
+ compressTranscriptRecord,
2
3
  redactSecretsFromContent
3
- } from "./chunk-FXECTHAG.js";
4
+ } from "./chunk-MNKIR2ZB.js";
4
5
 
5
6
  // src/crypto.ts
6
7
  import nacl from "tweetnacl";
8
+
9
+ // ../contracts/src/transcript-record-node.ts
10
+ import { deflateRawSync, inflateRawSync } from "zlib";
11
+ var deflateRaw = (raw) => new Uint8Array(deflateRawSync(raw));
12
+
13
+ // src/crypto.ts
7
14
  var EPH_PUB_LEN = nacl.box.publicKeyLength;
8
15
  var BOX_NONCE_LEN = nacl.box.nonceLength;
9
16
  var SECRETBOX_NONCE_LEN = nacl.secretbox.nonceLength;
@@ -23,14 +30,17 @@ var wrapSessionKey = (sessionKey, accountPublicKey) => {
23
30
  bundle.set(box, EPH_PUB_LEN + BOX_NONCE_LEN);
24
31
  return toBase64(bundle);
25
32
  };
26
- var encryptRecord = (plaintext, sessionKey) => {
33
+ var sealRecordBytes = (plaintext, sessionKey) => {
27
34
  const nonce = nacl.randomBytes(SECRETBOX_NONCE_LEN);
28
- const box = nacl.secretbox(utf8Encode(plaintext), nonce, sessionKey);
35
+ const box = nacl.secretbox(plaintext, nonce, sessionKey);
29
36
  const bundle = new Uint8Array(SECRETBOX_NONCE_LEN + box.length);
30
37
  bundle.set(nonce, 0);
31
38
  bundle.set(box, SECRETBOX_NONCE_LEN);
32
39
  return toBase64(bundle);
33
40
  };
41
+ var encryptRecord = (plaintext, sessionKey) => sealRecordBytes(utf8Encode(plaintext), sessionKey);
42
+ var encryptCompressedRecord = (plaintext, sessionKey) => sealRecordBytes(compressTranscriptRecord(utf8Encode(plaintext), deflateRaw), sessionKey);
43
+ var recordSealerFor = (compressRecords) => compressRecords ? encryptCompressedRecord : encryptRecord;
34
44
 
35
45
  // src/transcript-capture.ts
36
46
  import { createHmac } from "crypto";
@@ -123,7 +133,7 @@ var redactDeep = (value) => {
123
133
  return value;
124
134
  };
125
135
  var localIdFor = (parsed, rawLine, sessionKey) => typeof parsed.uuid === "string" && parsed.uuid.length > 0 ? parsed.uuid : createHmac("sha256", sessionKey).update(rawLine).digest("hex").slice(0, 32);
126
- var buildTranscriptRecords = (lines, sessionKey, seen = /* @__PURE__ */ new Set()) => {
136
+ var buildTranscriptRecords = (lines, sessionKey, seen = /* @__PURE__ */ new Set(), sealRecord = encryptRecord) => {
127
137
  const records = [];
128
138
  const nextSeen = new Set(seen);
129
139
  for (const line of lines) {
@@ -142,7 +152,7 @@ var buildTranscriptRecords = (lines, sessionKey, seen = /* @__PURE__ */ new Set(
142
152
  nextSeen.add(localId);
143
153
  const redacted = redactDeep(parsed);
144
154
  fitWithinPlaintextBudget(redacted);
145
- const content = encryptRecord(JSON.stringify(redacted), sessionKey);
155
+ const content = sealRecord(JSON.stringify(redacted), sessionKey);
146
156
  records.push({ localId, content });
147
157
  }
148
158
  return { records, seen: nextSeen };
@@ -153,5 +163,6 @@ export {
153
163
  generateSessionKey,
154
164
  wrapSessionKey,
155
165
  encryptRecord,
166
+ recordSealerFor,
156
167
  buildTranscriptRecords
157
168
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  findNativeClaudeInstall
3
- } from "./chunk-VUFHYMSP.js";
3
+ } from "./chunk-MXPOLQZH.js";
4
4
  import {
5
5
  isFile
6
- } from "./chunk-QENTGE75.js";
6
+ } from "./chunk-BSZIPIFA.js";
7
7
 
8
8
  // src/wrapper/claudeBinary.ts
9
9
  import { homedir } from "os";
@@ -10,7 +10,7 @@ import {
10
10
  isSetupConnectMode,
11
11
  isValidApiKey,
12
12
  normalizeAgentId
13
- } from "./chunk-FXECTHAG.js";
13
+ } from "./chunk-MNKIR2ZB.js";
14
14
 
15
15
  // src/setup/options.ts
16
16
  var AGENT_CHOICES = SETUP_AGENT_CHOICES;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-DFKEJARZ.js";
3
+ } from "./chunk-Y64JGYTB.js";
4
4
 
5
5
  // src/transcript-api.ts
6
6
  var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
@@ -12,14 +12,16 @@ var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
12
12
  if (!res.ok) return null;
13
13
  const data = await res.json();
14
14
  if (typeof data.publicKey !== "string" || data.publicKey.length === 0) return null;
15
+ const phoneReadsCompressedRecords = data.readsCompressedRecords === true;
15
16
  if (data.providerRecovery === void 0 || data.providerRecovery === null) {
16
- return { phonePublicKey: data.publicKey, provider: null };
17
+ return { phonePublicKey: data.publicKey, phoneReadsCompressedRecords, provider: null };
17
18
  }
18
19
  if (typeof data.providerRecovery !== "object") return null;
19
20
  const provider = data.providerRecovery;
20
21
  if (typeof provider.required !== "boolean" || typeof provider.keyId !== "string" || provider.keyId.length === 0 || typeof provider.publicKey !== "string" || provider.publicKey.length === 0) return null;
21
22
  return {
22
23
  phonePublicKey: data.publicKey,
24
+ phoneReadsCompressedRecords,
23
25
  provider: { required: provider.required, keyId: provider.keyId, publicKey: provider.publicKey }
24
26
  };
25
27
  } catch {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SESSION
3
- } from "./chunk-LWR5VKNC.js";
3
+ } from "./chunk-MIPJ2VXP.js";
4
4
 
5
5
  // src/answer.ts
6
6
  var isDeferAnswer = (value) => value === "defer";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SETUP_FLAGS
3
- } from "./chunk-MURJ4WAL.js";
3
+ } from "./chunk-SROWUG5W.js";
4
4
  import {
5
5
  parseFlags
6
6
  } from "./chunk-NMUI3ZWG.js";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-PPY5N2E6.js";
10
10
  import {
11
11
  NPX_LATEST_COMMAND
12
- } from "./chunk-FG5HMJ7C.js";
12
+ } from "./chunk-BAGBCSXA.js";
13
13
  import {
14
14
  CLAUDE_CONNECTOR_GUIDE,
15
15
  CLAUDE_CONNECTOR_STEPS,
@@ -17,7 +17,7 @@ import {
17
17
  CLAUDE_CONNECTOR_URL,
18
18
  COWORK_CONNECTOR_LIMIT,
19
19
  COWORK_STANDING_INSTRUCTIONS
20
- } from "./chunk-FXECTHAG.js";
20
+ } from "./chunk-MNKIR2ZB.js";
21
21
 
22
22
  // src/cli/cowork.ts
23
23
  import { readFileSync } from "fs";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-557ZE5EX.js";
3
+ } from "./chunk-ML2Q6WWE.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-7NJ4TDUH.js";
9
+ } from "./chunk-KA7JIMTG.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
- } from "./chunk-MURJ4WAL.js";
12
+ } from "./chunk-SROWUG5W.js";
13
13
  import {
14
14
  claudeSettings,
15
15
  codexHooksJson,
@@ -18,10 +18,10 @@ import {
18
18
  guardedArgv,
19
19
  pusharyDir,
20
20
  vscodePluginDir
21
- } from "./chunk-6YSEOXP5.js";
21
+ } from "./chunk-H4BKC2GN.js";
22
22
  import {
23
23
  readJsonSafe
24
- } from "./chunk-QENTGE75.js";
24
+ } from "./chunk-BSZIPIFA.js";
25
25
  import {
26
26
  HOOK_BUDGETS,
27
27
  HOOK_COMPATIBLE_PROFILES,
@@ -29,7 +29,7 @@ import {
29
29
  OPENCODE_APPROVAL_EVENT,
30
30
  hookCompatibleProfile,
31
31
  isRecord
32
- } from "./chunk-FXECTHAG.js";
32
+ } from "./chunk-MNKIR2ZB.js";
33
33
 
34
34
  // src/opencode-plugin.ts
35
35
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  announceSubscriptionRequired,
3
3
  isDeferAnswer
4
- } from "./chunk-3IFCXMC6.js";
4
+ } from "./chunk-TR3GP5MH.js";
5
5
  import {
6
6
  AUTO_DECISION_WINDOW_MS,
7
7
  DEFAULT_SESSION,
@@ -10,19 +10,19 @@ import {
10
10
  permissionDeniedAction,
11
11
  releaseThrottle,
12
12
  reportEvent
13
- } from "./chunk-LWR5VKNC.js";
13
+ } from "./chunk-MIPJ2VXP.js";
14
14
  import {
15
15
  askUser,
16
16
  isDecisionStopped,
17
17
  isQuestionLimitRefusal,
18
18
  waitForQuestion
19
- } from "./chunk-RSNN2TPE.js";
19
+ } from "./chunk-E23RKH3T.js";
20
20
  import {
21
21
  SubscriptionRequiredError
22
- } from "./chunk-ESXGCZDA.js";
22
+ } from "./chunk-2KID4FK4.js";
23
23
  import {
24
24
  getMachineId
25
- } from "./chunk-G3ZDCYMU.js";
25
+ } from "./chunk-ADRPW7KU.js";
26
26
  import {
27
27
  ASK_CONTEXT_MAX,
28
28
  agentQuestionContext,
@@ -34,7 +34,7 @@ import {
34
34
  questionsShownAsASet,
35
35
  shouldDeferToNativeMode,
36
36
  wireVerdictFor
37
- } from "./chunk-FXECTHAG.js";
37
+ } from "./chunk-MNKIR2ZB.js";
38
38
 
39
39
  // src/machine-decision-audit.ts
40
40
  import { basename } from "path";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isSafeReadOnlyCommand
3
- } from "./chunk-FXECTHAG.js";
3
+ } from "./chunk-MNKIR2ZB.js";
4
4
 
5
5
  // src/ledger.ts
6
6
  import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  NPX_LATEST_COMMAND
3
- } from "./chunk-FG5HMJ7C.js";
3
+ } from "./chunk-BAGBCSXA.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  registerTranscript
3
- } from "./chunk-EUNSJKJJ.js";
3
+ } from "./chunk-57PU5OBL.js";
4
4
  import {
5
5
  namedEvent
6
- } from "./chunk-557ZE5EX.js";
6
+ } from "./chunk-ML2Q6WWE.js";
7
7
  import {
8
8
  isBridgeLocator,
9
9
  liveBridgeProbe,
10
10
  pusharyHookExecutable,
11
11
  resolveBridgeStub
12
- } from "./chunk-7NJ4TDUH.js";
13
- import {
14
- atLeast,
15
- parseVersion
16
- } from "./chunk-6ICPEJY5.js";
12
+ } from "./chunk-KA7JIMTG.js";
17
13
  import {
18
14
  writeDegraded
19
- } from "./chunk-RSNN2TPE.js";
15
+ } from "./chunk-E23RKH3T.js";
20
16
  import {
21
17
  cursorUserHooks
22
- } from "./chunk-6YSEOXP5.js";
18
+ } from "./chunk-H4BKC2GN.js";
19
+ import {
20
+ atLeast,
21
+ parseVersion
22
+ } from "./chunk-BSZIPIFA.js";
23
23
  import {
24
24
  CURSOR_GATE_COVERAGE,
25
25
  CURSOR_GATE_SCRIPT,
@@ -33,7 +33,7 @@ import {
33
33
  isGrokSessionEndStop,
34
34
  isRecord,
35
35
  toolsCoveredByGateEntry
36
- } from "./chunk-FXECTHAG.js";
36
+ } from "./chunk-MNKIR2ZB.js";
37
37
 
38
38
  // src/tool-hook-input.ts
39
39
  var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
@@ -22,23 +22,22 @@ import {
22
22
  turnCodexAppCardsOff,
23
23
  turnCodexAppCardsOn,
24
24
  whyLaunchctlFailed
25
- } from "./chunk-SJCPIYWJ.js";
26
- import "./chunk-UWCPY4RY.js";
25
+ } from "./chunk-2CEVEMJE.js";
26
+ import "./chunk-5TNGBDIE.js";
27
27
  import "./chunk-XCEN33UP.js";
28
28
  import "./chunk-QCGNGEGE.js";
29
- import "./chunk-5R23J52J.js";
29
+ import "./chunk-5NP3OJ5P.js";
30
30
  import "./chunk-XHKBHWLX.js";
31
- import "./chunk-W3CBFLIX.js";
31
+ import "./chunk-BLAIETMP.js";
32
32
  import "./chunk-E46NE7FB.js";
33
- import "./chunk-G3ZDCYMU.js";
34
- import "./chunk-PSCXEH42.js";
35
- import "./chunk-6YSEOXP5.js";
36
- import "./chunk-CFIQ3252.js";
37
- import "./chunk-QENTGE75.js";
38
- import "./chunk-DFKEJARZ.js";
39
- import "./chunk-FG5HMJ7C.js";
33
+ import "./chunk-ADRPW7KU.js";
34
+ import "./chunk-2VADJ6JH.js";
35
+ import "./chunk-H4BKC2GN.js";
36
+ import "./chunk-BSZIPIFA.js";
37
+ import "./chunk-Y64JGYTB.js";
38
+ import "./chunk-BAGBCSXA.js";
40
39
  import "./chunk-QTOLNRET.js";
41
- import "./chunk-FXECTHAG.js";
40
+ import "./chunk-MNKIR2ZB.js";
42
41
  import "./chunk-MLKGABMK.js";
43
42
  export {
44
43
  CODEX_APP_CARDS_DIRECTORY,
@@ -11,7 +11,7 @@ import {
11
11
  installedCodexApp,
12
12
  shellQuoted,
13
13
  writeDesktopProxy
14
- } from "./chunk-UWCPY4RY.js";
14
+ } from "./chunk-5TNGBDIE.js";
15
15
  import "./chunk-XCEN33UP.js";
16
16
  import {
17
17
  CODEX_APP_LAUNCH_VARIABLE