pushary 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
@@ -0,0 +1,331 @@
1
+ import {
2
+ processGroupHasNothingLeftToSignal
3
+ } from "./chunk-XCEN33UP.js";
4
+ import {
5
+ CodexNativeApprovals,
6
+ answerCodexElicitation,
7
+ answerCodexQuestions,
8
+ claimOwnedQuestion,
9
+ closesOwnedQuestion,
10
+ codexQuestionOwner,
11
+ isCodexQuestionLeftWithTheLocalClient,
12
+ planCodexElicitation,
13
+ reportOwnedQuestion
14
+ } from "./chunk-GTSI6NG6.js";
15
+ import "./chunk-UVT6B6XN.js";
16
+ import "./chunk-WVSM3G4C.js";
17
+ import "./chunk-RIVNNBEK.js";
18
+ import "./chunk-EJCPHLY2.js";
19
+ import "./chunk-5463UUO2.js";
20
+ import "./chunk-GCN73COS.js";
21
+ import "./chunk-XHKBHWLX.js";
22
+ import "./chunk-6ICPEJY5.js";
23
+ import "./chunk-JBT3ZSJS.js";
24
+ import {
25
+ writeDegraded
26
+ } from "./chunk-2QPHUCXU.js";
27
+ import "./chunk-POFBE6ZY.js";
28
+ import "./chunk-3OLEGCMU.js";
29
+ import "./chunk-SRXBOMSR.js";
30
+ import "./chunk-UR7XX2DV.js";
31
+ import "./chunk-KQBXPGXO.js";
32
+ import "./chunk-7QLSKOSU.js";
33
+ import "./chunk-KZERVKTD.js";
34
+ import "./chunk-YQDZ7ZIL.js";
35
+ import "./chunk-JZDRR7BL.js";
36
+ import "./chunk-AQFEP65J.js";
37
+ import "./chunk-CQ5JGRML.js";
38
+ import "./chunk-MC4VY5LK.js";
39
+ import "./chunk-QTOLNRET.js";
40
+ import {
41
+ canonicalJsonText
42
+ } from "./chunk-LF3TLC7B.js";
43
+
44
+ // src/codex-session-launch.ts
45
+ import { spawn as spawn2 } from "child_process";
46
+ import { stat } from "fs/promises";
47
+ import { resolve } from "path";
48
+
49
+ // src/codex-shared-session.ts
50
+ import { spawn } from "child_process";
51
+ import { mkdtemp, rm } from "fs/promises";
52
+ import { createServer } from "http";
53
+ import { tmpdir } from "os";
54
+ import { join } from "path";
55
+ import WebSocket, { WebSocketServer } from "ws";
56
+
57
+ // src/codex-shared-questions.ts
58
+ import { createHash, randomUUID } from "crypto";
59
+ var CodexSharedQuestions = class {
60
+ constructor(options) {
61
+ this.options = options;
62
+ }
63
+ generation = randomUUID();
64
+ pending = /* @__PURE__ */ new Map();
65
+ retired = /* @__PURE__ */ new Set();
66
+ tasks = /* @__PURE__ */ new Set();
67
+ closed = false;
68
+ handle(message, threadId) {
69
+ if (this.closed || !message.method) return;
70
+ const params = message.params ?? {};
71
+ if (message.id === void 0) {
72
+ for (const [id2, pending2] of this.pending) {
73
+ const closed = pending2.dispatch ? closesOwnedQuestion(pending2.dispatch.owner, message.method, params) : message.method === "serverRequest/resolved" && params.requestId === id2 || params.threadId === pending2.threadId && ["thread/closed", "thread/archived", "turn/completed"].includes(message.method);
74
+ if (closed) {
75
+ pending2.controller.abort();
76
+ this.pending.delete(id2);
77
+ this.retired.add(id2);
78
+ if (pending2.dispatch) {
79
+ const task2 = reportOwnedQuestion(this.options, pending2.dispatch, "request_closed").finally(() => this.tasks.delete(task2));
80
+ this.tasks.add(task2);
81
+ }
82
+ }
83
+ }
84
+ return;
85
+ }
86
+ const id = message.id;
87
+ if (typeof id !== "string" && !(typeof id === "number" && Number.isSafeInteger(id))) return;
88
+ if (this.retired.has(id)) return;
89
+ const subjectHash = createHash("sha256").update(canonicalJsonText(params)).digest("hex");
90
+ const existing = this.pending.get(id);
91
+ if (existing) {
92
+ if (existing.subjectHash !== subjectHash) {
93
+ existing.controller.abort();
94
+ this.pending.delete(id);
95
+ this.retired.add(id);
96
+ }
97
+ return;
98
+ }
99
+ if (this.pending.size >= 8) return;
100
+ const isQuestion = message.method === "item/tool/requestUserInput";
101
+ if (!isQuestion && message.method !== "mcpServer/elicitation/request") return;
102
+ const owner = isQuestion ? codexQuestionOwner(params, id, { machineId: this.options.machineId, generation: this.generation, threadId }) : null;
103
+ if (isQuestion ? !owner : !planCodexElicitation(params, threadId)) return;
104
+ const duration = params.autoResolutionMs;
105
+ if (duration != null && (typeof duration !== "number" || !Number.isFinite(duration) || duration < 0)) return;
106
+ const dispatch = owner ? { owner, correlationIds: [], deadline: typeof duration === "number" ? Date.now() + duration : null } : void 0;
107
+ const pending = { controller: new AbortController(), dispatch, threadId, subjectHash };
108
+ this.pending.set(id, pending);
109
+ const task = this.answer(id, params, pending).finally(() => this.tasks.delete(task));
110
+ this.tasks.add(task);
111
+ }
112
+ async answer(id, params, pending) {
113
+ const signal = AbortSignal.any([this.options.signal, pending.controller.signal]);
114
+ const options = { ...this.options, shared: true, signal };
115
+ const dispatch = pending.dispatch;
116
+ try {
117
+ const result = dispatch ? await answerCodexQuestions(options, params, signal, "request_user_input", dispatch) : await answerCodexElicitation(options, params, pending.threadId, signal);
118
+ if (signal.aborted || this.closed || "action" in result && result.action !== "accept") return;
119
+ if (dispatch) await claimOwnedQuestion(options, dispatch);
120
+ if (signal.aborted || this.closed || this.pending.get(id) !== pending) return;
121
+ if (dispatch?.deadline != null && Date.now() >= dispatch.deadline) throw new Error("Question expired");
122
+ this.options.reply(id, result);
123
+ if (dispatch) await reportOwnedQuestion(options, dispatch, "reply_queued");
124
+ } catch (error) {
125
+ if (!signal.aborted && !isCodexQuestionLeftWithTheLocalClient(error)) writeDegraded("questions", { reason: "shared_codex_question_unavailable", fallback: "native client", event: "question" });
126
+ } finally {
127
+ if (dispatch && (!dispatch.claimId || signal.aborted)) await reportOwnedQuestion(options, dispatch, "unavailable");
128
+ if (!dispatch?.claimId || signal.aborted) {
129
+ this.pending.delete(id);
130
+ this.retired.add(id);
131
+ }
132
+ }
133
+ }
134
+ async close() {
135
+ this.closed = true;
136
+ for (const pending of this.pending.values()) pending.controller.abort();
137
+ await Promise.allSettled(this.tasks);
138
+ await Promise.allSettled([...this.pending.values()].flatMap((pending) => pending.dispatch ? [reportOwnedQuestion(this.options, pending.dispatch, "unavailable")] : []));
139
+ this.pending.clear();
140
+ }
141
+ };
142
+
143
+ // src/codex-shared-session.ts
144
+ var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
145
+ var requestId = (value) => typeof value === "string" || typeof value === "number" && Number.isSafeInteger(value);
146
+ var MAX_MESSAGE_BYTES = 16 * 1024 * 1024;
147
+ var startCodexSharedSession = async (options) => {
148
+ if (process.platform === "win32") throw new Error("Managed Codex sessions currently require macOS or Linux");
149
+ options.signal.throwIfAborted();
150
+ const directory = await mkdtemp(join(tmpdir(), "pushary-codex-"));
151
+ const socketPath = join(directory, "terminal.sock");
152
+ const controller = new AbortController();
153
+ const signal = AbortSignal.any([controller.signal, options.signal]);
154
+ const http = createServer((_request, response) => {
155
+ response.writeHead(404);
156
+ response.end();
157
+ });
158
+ const websocket = new WebSocketServer({ server: http, maxPayload: MAX_MESSAGE_BYTES, perMessageDeflate: false });
159
+ const child = spawn(options.binary, ["app-server"], {
160
+ cwd: options.cwd,
161
+ env: { ...options.env ?? process.env, PUSHARY_CODEX_BRIDGE: "1" },
162
+ stdio: ["pipe", "pipe", "pipe"],
163
+ detached: true
164
+ });
165
+ child.stderr.resume();
166
+ const exited = new Promise((resolve2) => {
167
+ child.once("exit", () => {
168
+ controller.abort(new Error("Codex app-server stopped"));
169
+ resolve2();
170
+ });
171
+ child.once("error", () => {
172
+ controller.abort(new Error("Could not start Codex app-server"));
173
+ resolve2();
174
+ });
175
+ });
176
+ let terminal = null;
177
+ let closing = null;
178
+ let buffered = "";
179
+ const unanswered = /* @__PURE__ */ new Set();
180
+ const write = (message) => {
181
+ if (signal.aborted || child.stdin.destroyed) throw new Error("Codex connection closed");
182
+ child.stdin.write(JSON.stringify(message) + "\n");
183
+ };
184
+ const reply = (id, result) => {
185
+ if (!unanswered.delete(id)) throw new Error("Native request already answered");
186
+ write({ id, result });
187
+ };
188
+ const approvals = new CodexNativeApprovals({ ...options, signal, shared: true, reply });
189
+ const questions = new CodexSharedQuestions({ ...options, signal, reply });
190
+ const observeNative = (message) => {
191
+ if (typeof message.method !== "string") return;
192
+ if (requestId(message.id)) unanswered.add(message.id);
193
+ if (!record(message.params)) return;
194
+ if (message.method === "serverRequest/resolved" && requestId(message.params.requestId)) unanswered.delete(message.params.requestId);
195
+ const event = { id: message.id, method: message.method, params: message.params };
196
+ const threadId = typeof message.params.threadId === "string" ? message.params.threadId : null;
197
+ if (!approvals.handle(event, threadId)) questions.handle(event, threadId);
198
+ };
199
+ child.stdout.setEncoding("utf8");
200
+ child.stdout.on("data", (chunk) => {
201
+ buffered += chunk;
202
+ let end;
203
+ while ((end = buffered.indexOf("\n")) >= 0) {
204
+ const line = buffered.slice(0, end);
205
+ buffered = buffered.slice(end + 1);
206
+ if (!line.trim()) continue;
207
+ if (Buffer.byteLength(line) > MAX_MESSAGE_BYTES) {
208
+ controller.abort();
209
+ return;
210
+ }
211
+ try {
212
+ const message = JSON.parse(line);
213
+ if (!record(message)) throw new Error("Invalid Codex message");
214
+ observeNative(message);
215
+ if (terminal?.readyState === WebSocket.OPEN) terminal.send(line);
216
+ } catch {
217
+ controller.abort();
218
+ return;
219
+ }
220
+ }
221
+ if (Buffer.byteLength(buffered) > MAX_MESSAGE_BYTES) controller.abort();
222
+ });
223
+ child.stdin.on("error", () => controller.abort());
224
+ websocket.on("connection", (client) => {
225
+ if (terminal || signal.aborted) {
226
+ client.close();
227
+ return;
228
+ }
229
+ terminal = client;
230
+ client.on("error", () => controller.abort());
231
+ client.on("close", () => controller.abort());
232
+ client.on("message", (bytes) => {
233
+ try {
234
+ const message = JSON.parse(bytes.toString());
235
+ if (!record(message)) throw new Error("Invalid terminal message");
236
+ if (requestId(message.id) && !("method" in message)) {
237
+ if (!unanswered.delete(message.id)) return;
238
+ approvals.handle({ method: "serverRequest/resolved", params: { requestId: message.id } }, null);
239
+ questions.handle({ method: "serverRequest/resolved", params: { requestId: message.id } }, null);
240
+ }
241
+ write(message);
242
+ } catch {
243
+ controller.abort();
244
+ }
245
+ });
246
+ });
247
+ const signalServerGroup = (signal2) => {
248
+ if (!child.pid) return false;
249
+ try {
250
+ process.kill(-child.pid, signal2);
251
+ return true;
252
+ } catch (error) {
253
+ if (processGroupHasNothingLeftToSignal(error)) return false;
254
+ throw error;
255
+ }
256
+ };
257
+ const stopServer = async () => {
258
+ signalServerGroup("SIGTERM");
259
+ const deadline = Date.now() + 2e3;
260
+ while (signalServerGroup(0) && Date.now() < deadline) await new Promise((resolve2) => setTimeout(resolve2, 25));
261
+ if (signalServerGroup(0)) signalServerGroup("SIGKILL");
262
+ await exited;
263
+ };
264
+ const close = () => {
265
+ if (closing) return closing;
266
+ closing = Promise.resolve().then(async () => {
267
+ controller.abort();
268
+ terminal?.terminate();
269
+ websocket.close();
270
+ http.close();
271
+ try {
272
+ await Promise.all([approvals.close(), questions.close(), stopServer()]);
273
+ } finally {
274
+ await rm(directory, { recursive: true, force: true });
275
+ }
276
+ });
277
+ return closing;
278
+ };
279
+ signal.addEventListener("abort", () => {
280
+ void close();
281
+ }, { once: true });
282
+ try {
283
+ await new Promise((resolve2, reject) => {
284
+ http.once("error", reject);
285
+ http.listen(socketPath, resolve2);
286
+ });
287
+ signal.throwIfAborted();
288
+ return { endpoint: "unix://" + socketPath, signal, close };
289
+ } catch (error) {
290
+ await close();
291
+ throw error;
292
+ }
293
+ };
294
+
295
+ // src/codex-session-launch.ts
296
+ var codexSessionDirectory = (args, cwd) => {
297
+ if (args.length === 0) return cwd;
298
+ if (args.length === 2 && args[0] === "--cwd" && args[1]) return resolve(cwd, args[1]);
299
+ throw new Error("Usage: pushary codex [--cwd <directory>]");
300
+ };
301
+ var launchCodexSession = async (options) => {
302
+ if (!(await stat(options.cwd)).isDirectory()) throw new Error("Codex needs a project directory");
303
+ const session = await startCodexSharedSession(options);
304
+ try {
305
+ process.stderr.write("[pushary] Managed Codex session. Supported questions and native permissions can reach Pushary; other prompts stay in this terminal.\n");
306
+ const tui = spawn2(options.binary, ["--remote", session.endpoint], {
307
+ cwd: options.cwd,
308
+ env: { ...options.env ?? process.env, PUSHARY_CODEX_BRIDGE: "1" },
309
+ stdio: "inherit"
310
+ });
311
+ const stop = () => {
312
+ tui.kill("SIGTERM");
313
+ };
314
+ session.signal.addEventListener("abort", stop, { once: true });
315
+ if (session.signal.aborted) stop();
316
+ try {
317
+ return await new Promise((resolve2, reject) => {
318
+ tui.once("error", reject);
319
+ tui.once("close", (code) => resolve2(code ?? 1));
320
+ });
321
+ } finally {
322
+ session.signal.removeEventListener("abort", stop);
323
+ }
324
+ } finally {
325
+ await session.close();
326
+ }
327
+ };
328
+ export {
329
+ codexSessionDirectory,
330
+ launchCodexSession
331
+ };
@@ -0,0 +1,14 @@
1
+ import {
2
+ configFilePath,
3
+ getApiKey,
4
+ getBaseUrl,
5
+ resetKeyDriftWarning
6
+ } from "./chunk-CQ5JGRML.js";
7
+ import "./chunk-MC4VY5LK.js";
8
+ import "./chunk-LF3TLC7B.js";
9
+ export {
10
+ configFilePath,
11
+ getApiKey,
12
+ getBaseUrl,
13
+ resetKeyDriftWarning
14
+ };
@@ -5,15 +5,17 @@ import {
5
5
  readGlobalUpgradeSubject,
6
6
  upgradeInstalledPackage,
7
7
  withUpgradeLock
8
- } from "./chunk-ZTTCYHOM.js";
9
- import "./chunk-KBGKWB5T.js";
10
- import "./chunk-APASKZ2I.js";
8
+ } from "./chunk-DUMZORSL.js";
9
+ import "./chunk-K3BIMGP4.js";
10
+ import "./chunk-RLADRNPV.js";
11
11
  import "./chunk-POFBE6ZY.js";
12
12
  import "./chunk-KZERVKTD.js";
13
- import "./chunk-ZYYQJSIO.js";
13
+ import "./chunk-YQDZ7ZIL.js";
14
+ import "./chunk-JZDRR7BL.js";
14
15
  import "./chunk-AQFEP65J.js";
15
- import "./chunk-ZOKMGBPR.js";
16
- import "./chunk-OR5F63C2.js";
16
+ import "./chunk-MC4VY5LK.js";
17
+ import "./chunk-QTOLNRET.js";
18
+ import "./chunk-LF3TLC7B.js";
17
19
  export {
18
20
  finishGlobalUpgrade,
19
21
  finishUpgradeWithLock,
@@ -0,0 +1,15 @@
1
+ import {
2
+ getMachineId,
3
+ getOrCreateMachineId,
4
+ readExistingMachineId
5
+ } from "./chunk-KQBXPGXO.js";
6
+ import "./chunk-YQDZ7ZIL.js";
7
+ import "./chunk-JZDRR7BL.js";
8
+ import "./chunk-AQFEP65J.js";
9
+ import "./chunk-QTOLNRET.js";
10
+ import "./chunk-LF3TLC7B.js";
11
+ export {
12
+ getMachineId,
13
+ getOrCreateMachineId,
14
+ readExistingMachineId
15
+ };
@@ -0,0 +1,53 @@
1
+ import {
2
+ CLAUDE_BRIDGE_CAPABILITY,
3
+ CLAUDE_RESUME_CAPABILITY,
4
+ CODEX_BRIDGE_CAPABILITY,
5
+ CODEX_RESUME_CAPABILITY,
6
+ GEMINI_BRIDGE_CAPABILITY,
7
+ GEMINI_RESUME_CAPABILITY,
8
+ SPAWN_CAPABILITY,
9
+ codexBinaryIsBroken,
10
+ detectLaunchableProviderCapabilities,
11
+ detectProviderLiveCapabilities,
12
+ discoverProviderInventory,
13
+ expectedLaunchCapabilities,
14
+ geminiLiveCapabilities,
15
+ hasSpawnProvider,
16
+ launchAdvertisement,
17
+ launchableProviders,
18
+ missingControlPrerequisite,
19
+ phoneStartIsRequired,
20
+ providerLiveCapabilities,
21
+ resolveControlPolicy,
22
+ resolveProviderBinary,
23
+ trackProviderInventory
24
+ } from "./chunk-WVSM3G4C.js";
25
+ import "./chunk-RIVNNBEK.js";
26
+ import "./chunk-6ICPEJY5.js";
27
+ import "./chunk-JZDRR7BL.js";
28
+ import "./chunk-QTOLNRET.js";
29
+ import "./chunk-LF3TLC7B.js";
30
+ export {
31
+ CLAUDE_BRIDGE_CAPABILITY,
32
+ CLAUDE_RESUME_CAPABILITY,
33
+ CODEX_BRIDGE_CAPABILITY,
34
+ CODEX_RESUME_CAPABILITY,
35
+ GEMINI_BRIDGE_CAPABILITY,
36
+ GEMINI_RESUME_CAPABILITY,
37
+ SPAWN_CAPABILITY,
38
+ codexBinaryIsBroken,
39
+ detectLaunchableProviderCapabilities,
40
+ detectProviderLiveCapabilities,
41
+ discoverProviderInventory,
42
+ expectedLaunchCapabilities,
43
+ geminiLiveCapabilities,
44
+ hasSpawnProvider,
45
+ launchAdvertisement,
46
+ launchableProviders,
47
+ missingControlPrerequisite,
48
+ phoneStartIsRequired,
49
+ providerLiveCapabilities,
50
+ resolveControlPolicy,
51
+ resolveProviderBinary,
52
+ trackProviderInventory
53
+ };
@@ -32,8 +32,10 @@ import {
32
32
  pusharyDir,
33
33
  vscodePluginDir,
34
34
  vscodePluginMcp
35
- } from "./chunk-ZYYQJSIO.js";
36
- import "./chunk-OR5F63C2.js";
35
+ } from "./chunk-YQDZ7ZIL.js";
36
+ import "./chunk-JZDRR7BL.js";
37
+ import "./chunk-QTOLNRET.js";
38
+ import "./chunk-LF3TLC7B.js";
37
39
  export {
38
40
  autoUpdateLock,
39
41
  autoUpdateLog,
@@ -11,34 +11,37 @@ import {
11
11
  reapplyOpenCodePlugin,
12
12
  reapplyVsCodePlugin,
13
13
  repairCodexHolds
14
- } from "./chunk-7RMSB4A2.js";
15
- import "./chunk-KIO2MZQC.js";
16
- import "./chunk-LLRYP5TR.js";
17
- import "./chunk-Y74IJ2IO.js";
18
- import "./chunk-WEY5ZHDB.js";
19
- import "./chunk-25SYEAW4.js";
20
- import "./chunk-PA54A437.js";
21
- import "./chunk-XTVEW2NG.js";
22
- import "./chunk-GMXKITVA.js";
14
+ } from "./chunk-W26Q2DTD.js";
15
+ import "./chunk-6QPRQVQM.js";
16
+ import "./chunk-DT5Y55FI.js";
23
17
  import "./chunk-RIVNNBEK.js";
18
+ import "./chunk-4JM2CK2A.js";
19
+ import "./chunk-2YSCVT6Q.js";
20
+ import "./chunk-3ICRY72Q.js";
21
+ import "./chunk-BUXDR6US.js";
22
+ import "./chunk-EGKD4S5H.js";
23
+ import "./chunk-GMXKITVA.js";
24
24
  import "./chunk-XHKBHWLX.js";
25
25
  import "./chunk-6ICPEJY5.js";
26
- import "./chunk-YVO4HIHX.js";
27
- import "./chunk-B7LV6W7U.js";
28
- import "./chunk-KEAIIVW3.js";
29
- import "./chunk-AWMMABVB.js";
26
+ import "./chunk-DT5CACWZ.js";
27
+ import "./chunk-3RPN7AAT.js";
28
+ import "./chunk-JBT3ZSJS.js";
29
+ import "./chunk-2QPHUCXU.js";
30
30
  import "./chunk-POFBE6ZY.js";
31
- import "./chunk-LZYJMSOY.js";
32
- import "./chunk-34RXPM5U.js";
33
- import "./chunk-ABMEBN2R.js";
34
- import "./chunk-LY3OJFBW.js";
31
+ import "./chunk-3OLEGCMU.js";
32
+ import "./chunk-SRXBOMSR.js";
33
+ import "./chunk-UR7XX2DV.js";
34
+ import "./chunk-KQBXPGXO.js";
35
35
  import "./chunk-7QLSKOSU.js";
36
36
  import "./chunk-KZERVKTD.js";
37
- import "./chunk-ZYYQJSIO.js";
37
+ import "./chunk-4QQEUJL4.js";
38
+ import "./chunk-YQDZ7ZIL.js";
39
+ import "./chunk-JZDRR7BL.js";
38
40
  import "./chunk-AQFEP65J.js";
39
- import "./chunk-VUS6QGND.js";
40
- import "./chunk-ZOKMGBPR.js";
41
- import "./chunk-OR5F63C2.js";
41
+ import "./chunk-CQ5JGRML.js";
42
+ import "./chunk-MC4VY5LK.js";
43
+ import "./chunk-QTOLNRET.js";
44
+ import "./chunk-LF3TLC7B.js";
42
45
  export {
43
46
  ensureCodexTrustAfterReapply,
44
47
  inspectConfiguredManagedProviders,
@@ -187,9 +187,9 @@ interface AnswerResult {
187
187
  note?: string;
188
188
  }
189
189
 
190
- declare const askUser: (apiKey: string, params: AskUserParams, timeoutMs?: number) => Promise<AskUserResponse>;
191
- declare const waitForAnswer: (apiKey: string, correlationId: string, timeoutMs?: number, signal?: AbortSignal) => Promise<AnswerResult>;
192
- declare const cancelQuestion: (apiKey: string, correlationId: string, signal?: AbortSignal) => Promise<{
190
+ declare const askUser: (apiKey: string, params: AskUserParams, timeoutMs?: number, baseUrl?: string) => Promise<AskUserResponse>;
191
+ declare const waitForAnswer: (apiKey: string, correlationId: string, timeoutMs?: number, signal?: AbortSignal, baseUrl?: string) => Promise<AnswerResult>;
192
+ declare const cancelQuestion: (apiKey: string, correlationId: string, signal?: AbortSignal, baseUrl?: string) => Promise<{
193
193
  cancelled?: boolean;
194
194
  status?: string;
195
195
  handoffAction?: string;
package/dist/src/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  handlePreToolUse
3
- } from "../chunk-TGCIFEDE.js";
4
- import "../chunk-EP6S6VY3.js";
5
- import "../chunk-Y7WD72J7.js";
6
- import "../chunk-IF2UPWD2.js";
7
- import "../chunk-Y74IJ2IO.js";
8
- import "../chunk-25SYEAW4.js";
3
+ } from "../chunk-43NXSBNZ.js";
4
+ import "../chunk-PMJEN6CX.js";
5
+ import "../chunk-7CLLWDCP.js";
6
+ import "../chunk-26MUPAKS.js";
7
+ import "../chunk-4JM2CK2A.js";
8
+ import "../chunk-3ICRY72Q.js";
9
9
  import {
10
10
  fetchAccountPublicKey
11
- } from "../chunk-KK2DIUVV.js";
11
+ } from "../chunk-GCN73COS.js";
12
12
  import "../chunk-6ICPEJY5.js";
13
13
  import {
14
14
  fetchModeOverride,
@@ -18,31 +18,34 @@ import {
18
18
  handlePostToolUse,
19
19
  handleStop,
20
20
  reportEvent
21
- } from "../chunk-YVO4HIHX.js";
22
- import "../chunk-B7LV6W7U.js";
23
- import "../chunk-KEAIIVW3.js";
21
+ } from "../chunk-DT5CACWZ.js";
22
+ import "../chunk-3RPN7AAT.js";
23
+ import "../chunk-JBT3ZSJS.js";
24
24
  import {
25
25
  askUser,
26
26
  cancelQuestion,
27
27
  waitForAnswer
28
- } from "../chunk-AWMMABVB.js";
28
+ } from "../chunk-2QPHUCXU.js";
29
29
  import "../chunk-POFBE6ZY.js";
30
- import "../chunk-LZYJMSOY.js";
31
- import "../chunk-34RXPM5U.js";
32
- import "../chunk-ABMEBN2R.js";
33
- import "../chunk-LY3OJFBW.js";
30
+ import "../chunk-3OLEGCMU.js";
31
+ import "../chunk-SRXBOMSR.js";
32
+ import "../chunk-UR7XX2DV.js";
33
+ import "../chunk-KQBXPGXO.js";
34
34
  import "../chunk-7QLSKOSU.js";
35
35
  import "../chunk-KZERVKTD.js";
36
- import "../chunk-ZYYQJSIO.js";
36
+ import "../chunk-4QQEUJL4.js";
37
+ import "../chunk-YQDZ7ZIL.js";
38
+ import "../chunk-JZDRR7BL.js";
37
39
  import "../chunk-AQFEP65J.js";
38
40
  import {
39
41
  getApiKey,
40
42
  getBaseUrl
41
- } from "../chunk-VUS6QGND.js";
42
- import "../chunk-ZOKMGBPR.js";
43
+ } from "../chunk-CQ5JGRML.js";
44
+ import "../chunk-MC4VY5LK.js";
45
+ import "../chunk-QTOLNRET.js";
43
46
  import {
44
47
  resolvePolicy
45
- } from "../chunk-OR5F63C2.js";
48
+ } from "../chunk-LF3TLC7B.js";
46
49
  export {
47
50
  askUser,
48
51
  cancelQuestion,
@@ -5,10 +5,12 @@ import {
5
5
  installWithUpgradeLock,
6
6
  ownsUpgradeLock,
7
7
  releaseAutoUpdateLock
8
- } from "./chunk-KBGKWB5T.js";
9
- import "./chunk-ZYYQJSIO.js";
8
+ } from "./chunk-K3BIMGP4.js";
9
+ import "./chunk-YQDZ7ZIL.js";
10
+ import "./chunk-JZDRR7BL.js";
10
11
  import "./chunk-AQFEP65J.js";
11
- import "./chunk-OR5F63C2.js";
12
+ import "./chunk-QTOLNRET.js";
13
+ import "./chunk-LF3TLC7B.js";
12
14
  export {
13
15
  claimUpgradeLock,
14
16
  finishWithUpgradeLock,
@@ -0,0 +1,10 @@
1
+ import {
2
+ exitOnHelpFlag
3
+ } from "./chunk-S6RNS4UL.js";
4
+ import "./chunk-KZERVKTD.js";
5
+ import "./chunk-MC4VY5LK.js";
6
+ import "./chunk-QTOLNRET.js";
7
+ import "./chunk-LF3TLC7B.js";
8
+ export {
9
+ exitOnHelpFlag
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pushary",
3
- "version": "1.9.49",
3
+ "version": "1.9.51",
4
4
  "description": "Permission hooks for AI coding agents: route tool approvals through Pushary push notifications",
5
5
  "keywords": [
6
6
  "pushary",