@pushary/agent-hooks 1.9.49 → 1.9.51

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 (120) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +0 -1
  3. package/dist/api-PPNFRSJC.js +55 -0
  4. package/dist/bin/pushary-bell-hook.js +28 -25
  5. package/dist/bin/pushary-bell.js +13 -11
  6. package/dist/bin/pushary-claude.js +36 -32
  7. package/dist/bin/pushary-clean.js +68 -42
  8. package/dist/bin/pushary-codex-bridge.js +23 -20
  9. package/dist/bin/pushary-codex-hook.js +35 -31
  10. package/dist/bin/pushary-codex-session.js +17 -616
  11. package/dist/bin/pushary-codex.js +15 -12
  12. package/dist/bin/pushary-connect.js +31 -28
  13. package/dist/bin/pushary-cowork.js +7 -6
  14. package/dist/bin/pushary-daemon.js +55 -52
  15. package/dist/bin/pushary-disconnect.js +29 -26
  16. package/dist/bin/pushary-doctor.js +57 -52
  17. package/dist/bin/pushary-elicitation-hook.js +28 -25
  18. package/dist/bin/pushary-gemini-bridge.js +17 -15
  19. package/dist/bin/pushary-gemini-hook.js +32 -28
  20. package/dist/bin/pushary-hook.js +34 -31
  21. package/dist/bin/pushary-login.js +19 -16
  22. package/dist/bin/pushary-logout.js +30 -27
  23. package/dist/bin/pushary-mcp.js +11 -9
  24. package/dist/bin/pushary-mode.js +16 -14
  25. package/dist/bin/pushary-notification-hook.js +27 -24
  26. package/dist/bin/pushary-opencode-hook.js +31 -27
  27. package/dist/bin/pushary-permission-denied-hook.js +32 -29
  28. package/dist/bin/pushary-permission-hook.js +31 -28
  29. package/dist/bin/pushary-post-hook.js +27 -24
  30. package/dist/bin/pushary-prompt-hook.js +27 -24
  31. package/dist/bin/pushary-session-end-hook.js +27 -24
  32. package/dist/bin/pushary-session-start-hook.js +32 -29
  33. package/dist/bin/pushary-setup.js +145 -82
  34. package/dist/bin/pushary-stats.js +8 -7
  35. package/dist/bin/pushary-status.js +35 -32
  36. package/dist/bin/pushary-stop-hook.js +27 -24
  37. package/dist/bin/pushary-stopfailure-hook.js +27 -24
  38. package/dist/bin/pushary-suggestions.js +16 -14
  39. package/dist/bin/pushary-transcript-register.js +19 -17
  40. package/dist/bin/pushary-transcripts.js +10 -9
  41. package/dist/bin/pushary-upgrade.js +46 -42
  42. package/dist/bin/pushary-wait.js +16 -14
  43. package/dist/bin/pushary.js +10 -8
  44. package/dist/{chunk-IF2UPWD2.js → chunk-26MUPAKS.js} +1 -1
  45. package/dist/{chunk-AWMMABVB.js → chunk-2QPHUCXU.js} +49 -135
  46. package/dist/{chunk-WEY5ZHDB.js → chunk-2YSCVT6Q.js} +5 -5
  47. package/dist/chunk-36NGFHE4.js +72 -0
  48. package/dist/{chunk-25SYEAW4.js → chunk-3ICRY72Q.js} +3 -3
  49. package/dist/{chunk-LZYJMSOY.js → chunk-3OLEGCMU.js} +3 -3
  50. package/dist/{chunk-B7LV6W7U.js → chunk-3RPN7AAT.js} +1 -1
  51. package/dist/{chunk-VCZN7NAB.js → chunk-3YAOJEHG.js} +7 -5
  52. package/dist/{chunk-TGCIFEDE.js → chunk-43NXSBNZ.js} +13 -11
  53. package/dist/{chunk-Y74IJ2IO.js → chunk-4JM2CK2A.js} +4 -4
  54. package/dist/{chunk-KEAIIVW3.js → chunk-4QQEUJL4.js} +2 -2
  55. package/dist/{chunk-XNZB274I.js → chunk-5463UUO2.js} +1 -1
  56. package/dist/{chunk-ZMYLVFXC.js → chunk-5CRQCIHR.js} +14 -9
  57. package/dist/{chunk-KIO2MZQC.js → chunk-6QPRQVQM.js} +5 -3
  58. package/dist/{chunk-4PCJ6DYK.js → chunk-6SWMKF5E.js} +2 -2
  59. package/dist/{chunk-Y7WD72J7.js → chunk-7CLLWDCP.js} +1 -1
  60. package/dist/{chunk-TYTIDEBW.js → chunk-7DBTOPOT.js} +5 -5
  61. package/dist/chunk-7YAVKENV.js +271 -0
  62. package/dist/{chunk-34AQAQKW.js → chunk-AA2K3H7Y.js} +4 -4
  63. package/dist/{chunk-DH4BWFU7.js → chunk-AZHTI5JX.js} +5 -5
  64. package/dist/{chunk-PA54A437.js → chunk-BUXDR6US.js} +1 -1
  65. package/dist/{chunk-VUS6QGND.js → chunk-CQ5JGRML.js} +5 -1
  66. package/dist/{chunk-YVO4HIHX.js → chunk-DT5CACWZ.js} +12 -10
  67. package/dist/{chunk-LLRYP5TR.js → chunk-DT5Y55FI.js} +5 -5
  68. package/dist/{chunk-ZTTCYHOM.js → chunk-DUMZORSL.js} +8 -6
  69. package/dist/{chunk-XTVEW2NG.js → chunk-EGKD4S5H.js} +1 -1
  70. package/dist/{chunk-FPKQGWAF.js → chunk-EJCPHLY2.js} +2 -2
  71. package/dist/{chunk-YTYXFA5M.js → chunk-FI73DGNB.js} +1 -1
  72. package/dist/{chunk-JGNYCRB2.js → chunk-FV34HT35.js} +1 -1
  73. package/dist/{chunk-KK2DIUVV.js → chunk-GCN73COS.js} +1 -1
  74. package/dist/{chunk-SE4JFMLW.js → chunk-GTSI6NG6.js} +8 -6
  75. package/dist/chunk-JBT3ZSJS.js +92 -0
  76. package/dist/chunk-JZDRR7BL.js +427 -0
  77. package/dist/{chunk-KBGKWB5T.js → chunk-K3BIMGP4.js} +4 -2
  78. package/dist/{chunk-LY3OJFBW.js → chunk-KQBXPGXO.js} +2 -1
  79. package/dist/{chunk-OR5F63C2.js → chunk-LF3TLC7B.js} +2 -168
  80. package/dist/{chunk-QYBL4EHD.js → chunk-LXRQLDGW.js} +11 -11
  81. package/dist/{chunk-ZOKMGBPR.js → chunk-MC4VY5LK.js} +16 -5
  82. package/dist/{chunk-OW4DNSQ6.js → chunk-NSY2V7XU.js} +1 -1
  83. package/dist/{chunk-X3RCIOIH.js → chunk-ONCWYACA.js} +1 -1
  84. package/dist/{chunk-EP6S6VY3.js → chunk-PMJEN6CX.js} +6 -6
  85. package/dist/{chunk-K73CBZKW.js → chunk-PTNSIGLB.js} +4 -4
  86. package/dist/chunk-PVDSN6TB.js +729 -0
  87. package/dist/chunk-QTOLNRET.js +169 -0
  88. package/dist/{chunk-APASKZ2I.js → chunk-RLADRNPV.js} +5 -3
  89. package/dist/{chunk-BOVSUH4N.js → chunk-S6RNS4UL.js} +2 -2
  90. package/dist/{chunk-34RXPM5U.js → chunk-SRXBOMSR.js} +3 -3
  91. package/dist/{chunk-HXRH7ZCK.js → chunk-TQ6AGJVH.js} +2 -2
  92. package/dist/{chunk-SALUTWPX.js → chunk-UKX5WIB5.js} +4 -4
  93. package/dist/{chunk-ABMEBN2R.js → chunk-UR7XX2DV.js} +6 -4
  94. package/dist/{chunk-BXK6ZJVJ.js → chunk-UVT6B6XN.js} +2 -2
  95. package/dist/{chunk-5Q2FRMPC.js → chunk-VD2OAF7Q.js} +4 -4
  96. package/dist/{chunk-XH3F66VD.js → chunk-VYBH6D4X.js} +3 -3
  97. package/dist/{chunk-UCF3EZZL.js → chunk-VZRCM362.js} +13 -13
  98. package/dist/{chunk-7RMSB4A2.js → chunk-W26Q2DTD.js} +14 -12
  99. package/dist/{chunk-OWQHE2VV.js → chunk-WVSM3G4C.js} +19 -4
  100. package/dist/{chunk-GDDXGBTM.js → chunk-X5GHIFST.js} +2 -2
  101. package/dist/chunk-XCEN33UP.js +7 -0
  102. package/dist/{chunk-UHVD7BSV.js → chunk-XQHPHJHR.js} +6 -6
  103. package/dist/{chunk-OZLGTMIY.js → chunk-XSUJ2PQY.js} +2 -2
  104. package/dist/{chunk-ZYYQJSIO.js → chunk-YQDZ7ZIL.js} +44 -462
  105. package/dist/{chunk-PXUNPXOX.js → chunk-ZOP3I2GQ.js} +3 -3
  106. package/dist/{chunk-WLT6J3SB.js → chunk-ZXGDBCIH.js} +2 -2
  107. package/dist/codex-app-cards-switch-ZQRT7MXB.js +52 -0
  108. package/dist/codex-desktop-launch-X7UKQ4VR.js +27 -0
  109. package/dist/codex-session-launch-IX33LOQZ.js +331 -0
  110. package/dist/config-HX6ZNOIL.js +14 -0
  111. package/dist/{global-upgrade-AIUSS2YH.js → global-upgrade-DGP2E2NE.js} +8 -6
  112. package/dist/identity-YISWVJ2A.js +15 -0
  113. package/dist/live-capabilities-44KFBOD4.js +53 -0
  114. package/dist/{paths-RO34TYNM.js → paths-VLGX4GJA.js} +4 -2
  115. package/dist/{reapply-KTNPP4XE.js → reapply-35F3WDTB.js} +24 -21
  116. package/dist/src/index.d.ts +3 -3
  117. package/dist/src/index.js +22 -19
  118. package/dist/{upgrade-lock-5UAGXIW7.js → upgrade-lock-LMO3DSSU.js} +5 -3
  119. package/dist/usage-ZC6BKIE3.js +10 -0
  120. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  APPROVAL_SETTINGS_PATH
3
- } from "./chunk-5Q2FRMPC.js";
3
+ } from "./chunk-VD2OAF7Q.js";
4
4
  import {
5
5
  readMacAppAgentKey
6
- } from "./chunk-K73CBZKW.js";
6
+ } from "./chunk-PTNSIGLB.js";
7
7
  import {
8
8
  findExportedKeyLines,
9
9
  isAdoptedMacAppKey,
@@ -13,13 +13,13 @@ import {
13
13
  readConfigFileKey,
14
14
  readKeySource,
15
15
  readMacAppKeyPrefix
16
- } from "./chunk-XH3F66VD.js";
16
+ } from "./chunk-VYBH6D4X.js";
17
17
  import {
18
18
  absoluteUrl
19
- } from "./chunk-34RXPM5U.js";
19
+ } from "./chunk-SRXBOMSR.js";
20
20
  import {
21
21
  isValidApiKey
22
- } from "./chunk-OR5F63C2.js";
22
+ } from "./chunk-LF3TLC7B.js";
23
23
 
24
24
  // src/key-revocation.ts
25
25
  var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
@@ -0,0 +1,271 @@
1
+ import {
2
+ codexPassThroughScript,
3
+ desktopEngine,
4
+ desktopProxyScript,
5
+ installedCodexApp,
6
+ shellQuoted
7
+ } from "./chunk-PVDSN6TB.js";
8
+ import {
9
+ writeHuman
10
+ } from "./chunk-QCGNGEGE.js";
11
+ import {
12
+ xml
13
+ } from "./chunk-5CRQCIHR.js";
14
+ import {
15
+ CODEX_APP_LAUNCH_VARIABLE
16
+ } from "./chunk-36NGFHE4.js";
17
+ import {
18
+ writeFileAtomic
19
+ } from "./chunk-AQFEP65J.js";
20
+
21
+ // src/codex-app-cards-switch.ts
22
+ import { execFileSync } from "child_process";
23
+ import { existsSync, mkdirSync, readFileSync, rmSync } from "fs";
24
+ import { homedir } from "os";
25
+ import { join } from "path";
26
+ var CODEX_APP_CARDS_LOGIN_ITEM = "com.pushary.codex-app-cards";
27
+ var CODEX_APP_CARDS_DIRECTORY = "codex-app";
28
+ var LAUNCHCTL = "/bin/launchctl";
29
+ var LAUNCHER_NAME = "codex";
30
+ var RECEIPT_NAME = "turned-on.json";
31
+ var PRIVATE_DIRECTORY_MODE = 448;
32
+ var PRIVATE_PROGRAM_MODE = 448;
33
+ var PRIVATE_FILE_MODE = 384;
34
+ var LOGIN_ITEM_DIRECTORY_MODE = 493;
35
+ var LOGIN_ITEM_MODE = 420;
36
+ var MAC_APP_HELPER = "/Contents/Helpers/pushary-native-transcripts";
37
+ var TEMPORARY_NPX_FOLDER = "/_npx/";
38
+ var codexAppCardsPaths = (homeDir, uid) => {
39
+ const launcherDirectory = join(homeDir, ".pushary", CODEX_APP_CARDS_DIRECTORY);
40
+ const loginItemDirectory = join(homeDir, "Library", "LaunchAgents");
41
+ return {
42
+ launcherDirectory,
43
+ launcherPath: join(launcherDirectory, LAUNCHER_NAME),
44
+ receiptPath: join(launcherDirectory, RECEIPT_NAME),
45
+ loginItemDirectory,
46
+ loginItemPath: join(loginItemDirectory, `${CODEX_APP_CARDS_LOGIN_ITEM}.plist`),
47
+ loginItemTarget: `gui/${uid}/${CODEX_APP_CARDS_LOGIN_ITEM}`
48
+ };
49
+ };
50
+ var codexAppCardsLoginScript = (launcherPath, engine) => [
51
+ `if [ -x ${shellQuoted(launcherPath)} ] && [ -x ${shellQuoted(engine)} ]`,
52
+ `&& [ -z "$(${LAUNCHCTL} getenv ${CODEX_APP_LAUNCH_VARIABLE})" ];`,
53
+ `then ${LAUNCHCTL} setenv ${CODEX_APP_LAUNCH_VARIABLE} ${shellQuoted(launcherPath)}; fi`
54
+ ].join(" ");
55
+ var codexAppCardsLoginItem = (launcherPath, engine) => `<?xml version="1.0" encoding="UTF-8"?>
56
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
57
+ <plist version="1.0">
58
+ <dict>
59
+ <key>Label</key>
60
+ <string>${CODEX_APP_CARDS_LOGIN_ITEM}</string>
61
+ <key>ProgramArguments</key>
62
+ <array>
63
+ <string>/bin/sh</string>
64
+ <string>-c</string>
65
+ <string>${xml(codexAppCardsLoginScript(launcherPath, engine))}</string>
66
+ </array>
67
+ <key>RunAtLoad</key>
68
+ <true/>
69
+ </dict>
70
+ </plist>
71
+ `;
72
+ var isAString = (value) => typeof value === "string";
73
+ var codexAppCardsReceiptFrom = (contents) => {
74
+ if (contents === null) return null;
75
+ let parsed;
76
+ try {
77
+ parsed = JSON.parse(contents);
78
+ } catch {
79
+ return null;
80
+ }
81
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return null;
82
+ const { entry, app, engine } = parsed;
83
+ return Array.isArray(entry) && entry.length > 0 && entry.every(isAString) && isAString(app) && isAString(engine) ? { entry, app, engine } : null;
84
+ };
85
+ var codexAppCardsInstallation = (input) => {
86
+ const paths = codexAppCardsPaths(input.homeDir, input.uid);
87
+ return {
88
+ paths,
89
+ launcherScript: desktopProxyScript(input.entry, input.app, input.engine, { turnsItselfOffWithoutTheEngine: true }),
90
+ loginItem: codexAppCardsLoginItem(paths.launcherPath, input.engine),
91
+ receipt: { entry: input.entry, app: input.app, engine: input.engine }
92
+ };
93
+ };
94
+ var isAbsolutePath = (value) => value.startsWith("/");
95
+ var whatTheLauncherCannotRun = (receipt, machine) => {
96
+ if (receipt === null) return null;
97
+ if (!machine.exists(receipt.engine)) return { kind: "on_but_the_codex_engine_moved", engine: receipt.engine };
98
+ const missing = receipt.entry.filter(isAbsolutePath).find((path) => !machine.exists(path));
99
+ return missing === void 0 ? null : { kind: "on_but_pushary_is_missing", missing };
100
+ };
101
+ var codexAppCardsStatus = (paths, machine) => {
102
+ const value = machine.launchVariable();
103
+ if (value.length > 0 && value !== paths.launcherPath) return { kind: "another_program_owns_the_launch", value };
104
+ const launcherIsThere = machine.exists(paths.launcherPath);
105
+ const setForThisLogin = value === paths.launcherPath && launcherIsThere;
106
+ const setAtEveryLogin = launcherIsThere && machine.exists(paths.loginItemPath);
107
+ if (!setForThisLogin && !setAtEveryLogin) return { kind: "off" };
108
+ const cannotRun = whatTheLauncherCannotRun(codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath)), machine);
109
+ if (cannotRun) return cannotRun;
110
+ if (setForThisLogin && setAtEveryLogin) return { kind: "on" };
111
+ return setForThisLogin ? { kind: "on_until_logout" } : { kind: "on_after_next_login" };
112
+ };
113
+ var turnCodexAppCardsOn = (installation, machine) => {
114
+ const { paths } = installation;
115
+ const value = machine.launchVariable();
116
+ if (value.length > 0 && value !== paths.launcherPath) return { kind: "another_program_owns_the_launch", value };
117
+ machine.makeDirectory(paths.launcherDirectory, PRIVATE_DIRECTORY_MODE);
118
+ machine.writeFile(paths.launcherPath, installation.launcherScript, PRIVATE_PROGRAM_MODE);
119
+ machine.writeFile(paths.receiptPath, `${JSON.stringify(installation.receipt, null, 2)}
120
+ `, PRIVATE_FILE_MODE);
121
+ machine.makeDirectory(paths.loginItemDirectory, LOGIN_ITEM_DIRECTORY_MODE);
122
+ machine.writeFile(paths.loginItemPath, installation.loginItem, LOGIN_ITEM_MODE);
123
+ machine.setLaunchVariable(paths.launcherPath);
124
+ return { kind: "on" };
125
+ };
126
+ var leaveOnlyThePathToTheEngine = (paths, machine) => {
127
+ const receipt = codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath));
128
+ const launcher = machine.readFile(paths.launcherPath);
129
+ if (receipt === null || launcher === null) return;
130
+ const onlyThePathToTheEngine = codexPassThroughScript(receipt.engine);
131
+ if (launcher !== onlyThePathToTheEngine) machine.writeFile(paths.launcherPath, onlyThePathToTheEngine, PRIVATE_PROGRAM_MODE);
132
+ };
133
+ var turnCodexAppCardsOff = (paths, machine) => {
134
+ const value = machine.launchVariable();
135
+ const ours = value === paths.launcherPath;
136
+ const loginItemIsThere = machine.exists(paths.loginItemPath);
137
+ leaveOnlyThePathToTheEngine(paths, machine);
138
+ if (ours) machine.unsetLaunchVariable();
139
+ if (loginItemIsThere) {
140
+ machine.unloadLoginItem(paths.loginItemTarget);
141
+ machine.remove(paths.loginItemPath);
142
+ }
143
+ return { wasOn: ours || loginItemIsThere, launchLeftToAnotherProgram: value.length > 0 && !ours ? value : null };
144
+ };
145
+ var turnedOnByTheMacApp = (receipt) => receipt !== null && receipt.entry[0].endsWith(MAC_APP_HELPER);
146
+ var removeCodexAppCards = (request, machine) => {
147
+ const paths = codexAppCardsPaths(request.homeDir, request.uid);
148
+ if (!machine.exists(paths.launcherDirectory) && !machine.exists(paths.loginItemPath)) return "absent";
149
+ const keptOnForTheMacApp = request.keepWhatTheMacAppTurnedOn && turnedOnByTheMacApp(codexAppCardsReceiptFrom(machine.readFile(paths.receiptPath))) && codexAppCardsStatus(paths, machine).kind !== "off";
150
+ if (keptOnForTheMacApp) return "kept_for_the_mac_app";
151
+ if (request.dryRun) return "removed";
152
+ turnCodexAppCardsOff(paths, machine);
153
+ machine.remove(paths.launcherDirectory);
154
+ return "removed";
155
+ };
156
+ var launchctl = (args) => execFileSync(LAUNCHCTL, [...args], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
157
+ var launchctlIgnoringFailure = (args) => {
158
+ try {
159
+ return launchctl(args);
160
+ } catch {
161
+ return "";
162
+ }
163
+ };
164
+ var fileContents = (path) => {
165
+ try {
166
+ return readFileSync(path, "utf8");
167
+ } catch {
168
+ return null;
169
+ }
170
+ };
171
+ var thisMacsCodexAppCardsMachine = () => ({
172
+ launchVariable: () => launchctlIgnoringFailure(["getenv", CODEX_APP_LAUNCH_VARIABLE]).trim(),
173
+ setLaunchVariable: (value) => {
174
+ launchctl(["setenv", CODEX_APP_LAUNCH_VARIABLE, value]);
175
+ },
176
+ unsetLaunchVariable: () => {
177
+ launchctl(["unsetenv", CODEX_APP_LAUNCH_VARIABLE]);
178
+ },
179
+ unloadLoginItem: (target) => {
180
+ launchctlIgnoringFailure(["bootout", target]);
181
+ },
182
+ exists: existsSync,
183
+ readFile: fileContents,
184
+ makeDirectory: (path, mode) => {
185
+ mkdirSync(path, { recursive: true, mode });
186
+ },
187
+ writeFile: (path, contents, mode) => {
188
+ writeFileAtomic(path, contents, mode);
189
+ },
190
+ remove: (path) => {
191
+ rmSync(path, { recursive: true, force: true });
192
+ }
193
+ });
194
+ var removeCodexAppCardsFromThisMac = (request) => removeCodexAppCards(request, thisMacsCodexAppCardsMachine());
195
+ var USAGE = "Usage: pushary codex --app-cards on [path/to/Codex.app] | off | status";
196
+ var TAKES_EFFECT_AFTER_REOPENING = "Quit Codex and open it again.";
197
+ var TURN_THEM_ON_AGAIN = "Run the same command with on to repair it.";
198
+ var runsFromATemporaryFolder = (entry) => entry.some((part) => part.includes(TEMPORARY_NPX_FOLDER));
199
+ var ownedByAnotherProgram = (value) => `Another program already starts the Codex app through ${value}. Pushary did not change it.`;
200
+ var codexAppCardsStatusLine = (status) => {
201
+ switch (status.kind) {
202
+ case "on":
203
+ return "Codex app cards are on.";
204
+ case "off":
205
+ return "Codex app cards are off.";
206
+ case "on_until_logout":
207
+ return "Codex app cards are on until you log out. Turn them on again to keep them on.";
208
+ case "on_after_next_login":
209
+ return "Codex app cards start the next time you log in. Turn them on again to start now.";
210
+ case "on_but_pushary_is_missing":
211
+ return `Codex app cards are on, but no card can reach Pushary: ${status.missing} is gone. Codex itself works. ${TURN_THEM_ON_AGAIN}`;
212
+ case "on_but_the_codex_engine_moved":
213
+ return `Codex app cards are on, but the Codex engine is no longer at ${status.engine}. ${TURN_THEM_ON_AGAIN}`;
214
+ case "another_program_owns_the_launch":
215
+ return ownedByAnotherProgram(status.value);
216
+ }
217
+ };
218
+ var codexAppCardsCommand = async (args, entry, readAccount, machine, say) => {
219
+ const [action, chosenApp, ...rest] = args;
220
+ const uid = process.getuid?.();
221
+ if (uid === void 0) throw new Error("Codex app cards need macOS");
222
+ const paths = codexAppCardsPaths(homedir(), uid);
223
+ if (action === "status" && chosenApp === void 0) {
224
+ say(codexAppCardsStatusLine(codexAppCardsStatus(paths, machine)));
225
+ return 0;
226
+ }
227
+ if (action === "off" && chosenApp === void 0) {
228
+ const turnedOff = turnCodexAppCardsOff(paths, machine);
229
+ say(turnedOff.wasOn ? `Codex app cards are off. ${TAKES_EFFECT_AFTER_REOPENING}` : "Codex app cards were already off.");
230
+ if (turnedOff.launchLeftToAnotherProgram) say(ownedByAnotherProgram(turnedOff.launchLeftToAnotherProgram));
231
+ return 0;
232
+ }
233
+ if (action !== "on" || rest.length > 0) throw new Error(USAGE);
234
+ if (!await readAccount()) throw new Error("Connect Pushary before turning Codex app cards on");
235
+ const app = installedCodexApp(chosenApp);
236
+ const engine = await desktopEngine(app);
237
+ const turnedOn = turnCodexAppCardsOn(codexAppCardsInstallation({ homeDir: homedir(), uid, entry, app, engine }), machine);
238
+ if (turnedOn.kind === "another_program_owns_the_launch") {
239
+ say(ownedByAnotherProgram(turnedOn.value));
240
+ return 1;
241
+ }
242
+ say(`Codex app cards are on. ${TAKES_EFFECT_AFTER_REOPENING}`);
243
+ say("From then on, when Codex asks to use an app on this Mac, the question also reaches Pushary. Everything else in Codex stays as it is.");
244
+ say("Turn them off by running the same command with off.");
245
+ if (runsFromATemporaryFolder(entry)) say("This copy of Pushary runs from a temporary npx folder. If that folder is cleared, the cards stop reaching Pushary and Codex keeps working. Install Pushary with npm install -g pushary and turn them on again to make it last.");
246
+ return 0;
247
+ };
248
+ var sayToThePerson = (line) => {
249
+ writeHuman(`${line}
250
+ `);
251
+ };
252
+ var codexAppCardsCommandOnThisMac = (args, entry, readAccount) => codexAppCardsCommand(args, entry, readAccount, thisMacsCodexAppCardsMachine(), sayToThePerson);
253
+
254
+ export {
255
+ CODEX_APP_CARDS_LOGIN_ITEM,
256
+ CODEX_APP_CARDS_DIRECTORY,
257
+ codexAppCardsPaths,
258
+ codexAppCardsLoginScript,
259
+ codexAppCardsLoginItem,
260
+ codexAppCardsReceiptFrom,
261
+ codexAppCardsInstallation,
262
+ codexAppCardsStatus,
263
+ turnCodexAppCardsOn,
264
+ turnCodexAppCardsOff,
265
+ removeCodexAppCards,
266
+ removeCodexAppCardsFromThisMac,
267
+ runsFromATemporaryFolder,
268
+ codexAppCardsStatusLine,
269
+ codexAppCardsCommand,
270
+ codexAppCardsCommandOnThisMac
271
+ };
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  compatibleConfigFile,
3
3
  hasCompatibleHooks
4
- } from "./chunk-Y74IJ2IO.js";
4
+ } from "./chunk-4JM2CK2A.js";
5
5
  import {
6
6
  pusharyHookExecutable
7
- } from "./chunk-WEY5ZHDB.js";
7
+ } from "./chunk-2YSCVT6Q.js";
8
8
  import {
9
9
  isProtectedByScope,
10
10
  registerHookEntry
11
- } from "./chunk-ZYYQJSIO.js";
11
+ } from "./chunk-YQDZ7ZIL.js";
12
12
  import {
13
13
  isRecord
14
- } from "./chunk-OR5F63C2.js";
14
+ } from "./chunk-LF3TLC7B.js";
15
15
 
16
16
  // src/cursor-config.ts
17
17
  var hookCommandOf = (entry) => {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  MCP_BRIDGE_BINARY
3
- } from "./chunk-GDDXGBTM.js";
3
+ } from "./chunk-X5GHIFST.js";
4
4
  import {
5
5
  KEY_FILE_MODE
6
- } from "./chunk-XH3F66VD.js";
6
+ } from "./chunk-VYBH6D4X.js";
7
7
  import {
8
8
  NpmInstallError,
9
9
  NpmMissingError,
10
10
  NpmPermissionError
11
- } from "./chunk-ZYYQJSIO.js";
11
+ } from "./chunk-JZDRR7BL.js";
12
12
  import {
13
13
  readJsonSafe,
14
14
  writeFileAtomic,
@@ -16,10 +16,10 @@ import {
16
16
  } from "./chunk-AQFEP65J.js";
17
17
  import {
18
18
  NPX_LATEST_COMMAND
19
- } from "./chunk-ZOKMGBPR.js";
19
+ } from "./chunk-MC4VY5LK.js";
20
20
  import {
21
21
  readSetupAgentFailures
22
- } from "./chunk-OR5F63C2.js";
22
+ } from "./chunk-LF3TLC7B.js";
23
23
 
24
24
  // src/instruction-file.ts
25
25
  import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
@@ -10,7 +10,7 @@ import {
10
10
  isSetupConnectMode,
11
11
  isValidApiKey,
12
12
  normalizeAgentId
13
- } from "./chunk-OR5F63C2.js";
13
+ } from "./chunk-LF3TLC7B.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
  NPX_LATEST_COMMAND
3
- } from "./chunk-ZOKMGBPR.js";
3
+ } from "./chunk-MC4VY5LK.js";
4
4
 
5
5
  // src/config.ts
6
6
  import { readFileSync } from "fs";
@@ -28,6 +28,9 @@ var warnOnKeyDrift = (envKey) => {
28
28
  `
29
29
  );
30
30
  };
31
+ var resetKeyDriftWarning = () => {
32
+ driftChecked = false;
33
+ };
31
34
  var getApiKey = () => {
32
35
  const envKey = process.env.PUSHARY_API_KEY?.trim();
33
36
  if (envKey) {
@@ -44,6 +47,7 @@ var getBaseUrl = () => process.env.PUSHARY_BASE_URL?.trim() || process.env.PUSHA
44
47
 
45
48
  export {
46
49
  configFilePath,
50
+ resetKeyDriftWarning,
47
51
  getApiKey,
48
52
  getBaseUrl
49
53
  };
@@ -2,35 +2,37 @@ import {
2
2
  IDLE_PROMPT_NOTIFICATION,
3
3
  NOTIFICATION_PUSH_TYPES,
4
4
  POSTTOOLUSE_MIRROR_ONLY_TOOLS
5
- } from "./chunk-B7LV6W7U.js";
5
+ } from "./chunk-3RPN7AAT.js";
6
6
  import {
7
- reportedInstallSource
8
- } from "./chunk-KEAIIVW3.js";
7
+ repoKeyFor
8
+ } from "./chunk-JBT3ZSJS.js";
9
9
  import {
10
10
  cancelQuestion,
11
11
  clientErrorKindOf,
12
12
  isPolicyConfig,
13
- repoKeyFor,
14
13
  reportClientError,
15
14
  sendNotification,
16
15
  waitForAnswer
17
- } from "./chunk-AWMMABVB.js";
16
+ } from "./chunk-2QPHUCXU.js";
18
17
  import {
19
18
  withRetry
20
- } from "./chunk-LZYJMSOY.js";
19
+ } from "./chunk-3OLEGCMU.js";
21
20
  import {
22
21
  getMachineId
23
- } from "./chunk-LY3OJFBW.js";
22
+ } from "./chunk-KQBXPGXO.js";
23
+ import {
24
+ reportedInstallSource
25
+ } from "./chunk-4QQEUJL4.js";
24
26
  import {
25
27
  canonicalJson
26
- } from "./chunk-ZYYQJSIO.js";
28
+ } from "./chunk-YQDZ7ZIL.js";
27
29
  import {
28
30
  writeFileAtomic
29
31
  } from "./chunk-AQFEP65J.js";
30
32
  import {
31
33
  getApiKey,
32
34
  getBaseUrl
33
- } from "./chunk-VUS6QGND.js";
35
+ } from "./chunk-CQ5JGRML.js";
34
36
  import {
35
37
  ACTION_BODY_MAX,
36
38
  AGENTS,
@@ -64,7 +66,7 @@ import {
64
66
  toToolLookup,
65
67
  truncateLine,
66
68
  unansweredRefusalReason
67
- } from "./chunk-OR5F63C2.js";
69
+ } from "./chunk-LF3TLC7B.js";
68
70
 
69
71
  // ../hook-mapping/src/describe.ts
70
72
  import { isAbsolute, relative, resolve } from "path";
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  compatibleConfigFile
3
- } from "./chunk-Y74IJ2IO.js";
3
+ } from "./chunk-4JM2CK2A.js";
4
4
  import {
5
5
  hookOwnerOf,
6
6
  hookOwnerOfCommands,
7
7
  liveBridgeProbe,
8
8
  resolveBridgeStub
9
- } from "./chunk-WEY5ZHDB.js";
9
+ } from "./chunk-2YSCVT6Q.js";
10
10
  import {
11
11
  AGENT_CHOICES
12
- } from "./chunk-PA54A437.js";
12
+ } from "./chunk-BUXDR6US.js";
13
13
  import {
14
14
  claudeSettings,
15
15
  codexHooksJson,
@@ -18,7 +18,7 @@ import {
18
18
  guardedArgv,
19
19
  pusharyDir,
20
20
  vscodePluginDir
21
- } from "./chunk-ZYYQJSIO.js";
21
+ } from "./chunk-YQDZ7ZIL.js";
22
22
  import {
23
23
  readJsonSafe
24
24
  } from "./chunk-AQFEP65J.js";
@@ -29,7 +29,7 @@ import {
29
29
  OPENCODE_APPROVAL_EVENT,
30
30
  hookCompatibleProfile,
31
31
  isRecord
32
- } from "./chunk-OR5F63C2.js";
32
+ } from "./chunk-LF3TLC7B.js";
33
33
 
34
34
  // src/opencode-plugin.ts
35
35
  var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
@@ -4,7 +4,7 @@ import {
4
4
  forkFinishWithUpgradeLock,
5
5
  installWithUpgradeLock,
6
6
  releaseAutoUpdateLock
7
- } from "./chunk-KBGKWB5T.js";
7
+ } from "./chunk-K3BIMGP4.js";
8
8
  import {
9
9
  describeAutoUpdateCheck,
10
10
  globalInstallLocation,
@@ -14,23 +14,25 @@ import {
14
14
  readAutoUpdateState,
15
15
  updateAutoUpdateState,
16
16
  upgradeEntryFor
17
- } from "./chunk-APASKZ2I.js";
17
+ } from "./chunk-RLADRNPV.js";
18
18
  import {
19
19
  EXIT
20
20
  } from "./chunk-KZERVKTD.js";
21
21
  import {
22
22
  autoUpdateLock,
23
23
  autoUpdateLog,
24
- autoUpdateState,
24
+ autoUpdateState
25
+ } from "./chunk-YQDZ7ZIL.js";
26
+ import {
25
27
  execNpm,
26
28
  fetchLatestPublishedVersion,
27
29
  npmErrorMessage,
28
30
  readGlobalCliInstallAt,
29
31
  readGlobalPrefix
30
- } from "./chunk-ZYYQJSIO.js";
32
+ } from "./chunk-JZDRR7BL.js";
31
33
  import {
32
34
  NPX_LATEST_COMMAND
33
- } from "./chunk-ZOKMGBPR.js";
35
+ } from "./chunk-MC4VY5LK.js";
34
36
  import {
35
37
  commandsPackage,
36
38
  globalUpgradeEntry,
@@ -39,7 +41,7 @@ import {
39
41
  isSameMajorVersion,
40
42
  ownPackageRoot,
41
43
  packageVersionAt
42
- } from "./chunk-OR5F63C2.js";
44
+ } from "./chunk-QTOLNRET.js";
43
45
 
44
46
  // src/global-upgrade.ts
45
47
  import { existsSync } from "fs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  guardBinary
3
- } from "./chunk-ZYYQJSIO.js";
3
+ } from "./chunk-YQDZ7ZIL.js";
4
4
 
5
5
  // src/bell/install.ts
6
6
  import { join } from "path";
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pusharyDir
3
- } from "./chunk-ZYYQJSIO.js";
3
+ } from "./chunk-YQDZ7ZIL.js";
4
4
  import {
5
5
  readJsonSafe
6
6
  } from "./chunk-AQFEP65J.js";
7
7
  import {
8
8
  isRecord
9
- } from "./chunk-OR5F63C2.js";
9
+ } from "./chunk-LF3TLC7B.js";
10
10
 
11
11
  // src/process-ownership.ts
12
12
  import { createHash, randomUUID } from "crypto";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-3EGEA4KH.js";
10
10
  import {
11
11
  getBaseUrl
12
- } from "./chunk-VUS6QGND.js";
12
+ } from "./chunk-CQ5JGRML.js";
13
13
 
14
14
  // src/cli/login-ui.ts
15
15
  import { hostname } from "os";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  readTranscriptPreference
3
- } from "./chunk-XH3F66VD.js";
3
+ } from "./chunk-VYBH6D4X.js";
4
4
 
5
5
  // src/transcript-setting.ts
6
6
  var transcriptEnvironmentPreference = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getBaseUrl
3
- } from "./chunk-VUS6QGND.js";
3
+ } from "./chunk-CQ5JGRML.js";
4
4
 
5
5
  // src/transcript-api.ts
6
6
  var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
@@ -4,28 +4,30 @@ import {
4
4
  postLiveSession,
5
5
  postLiveSessionUntilAccepted,
6
6
  startLiveSessionHeartbeat
7
- } from "./chunk-BXK6ZJVJ.js";
7
+ } from "./chunk-UVT6B6XN.js";
8
8
  import {
9
9
  SESSION_IDLE_TIMEOUT_MS,
10
10
  describeIdleWindow,
11
11
  idleDeadlinePassed,
12
12
  startProcessOwnership
13
- } from "./chunk-FPKQGWAF.js";
13
+ } from "./chunk-EJCPHLY2.js";
14
14
  import {
15
15
  spawnClaude
16
16
  } from "./chunk-XHKBHWLX.js";
17
+ import {
18
+ repoKeyFor
19
+ } from "./chunk-JBT3ZSJS.js";
17
20
  import {
18
21
  isAskUserResponse,
19
22
  isDecisionStopped,
20
23
  isWaitForAnswerResponse,
21
- repoKeyFor,
22
24
  withdrawQuestion,
23
25
  writeDegraded
24
- } from "./chunk-AWMMABVB.js";
26
+ } from "./chunk-2QPHUCXU.js";
25
27
  import {
26
28
  callMcpTool,
27
29
  isRetryable
28
- } from "./chunk-LZYJMSOY.js";
30
+ } from "./chunk-3OLEGCMU.js";
29
31
  import {
30
32
  AGENT_QUESTION_DESCRIPTION_MAX,
31
33
  AGENT_QUESTION_HEADER_MAX,
@@ -46,7 +48,7 @@ import {
46
48
  parseCodexQuestions,
47
49
  planElicitationAsk,
48
50
  readElicitationFields
49
- } from "./chunk-OR5F63C2.js";
51
+ } from "./chunk-LF3TLC7B.js";
50
52
 
51
53
  // src/codex-question-owner.ts
52
54
  import { createHash } from "crypto";