@pushary/agent-hooks 1.9.50 → 1.9.52
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.
- package/CHANGELOG.md +22 -0
- package/README.md +9 -1
- package/dist/api-K6ZROHYB.js +55 -0
- package/dist/bin/pushary-bell-hook.js +28 -25
- package/dist/bin/pushary-bell.js +13 -11
- package/dist/bin/pushary-claude.js +37 -33
- package/dist/bin/pushary-clean.js +68 -42
- package/dist/bin/pushary-codex-bridge.js +23 -20
- package/dist/bin/pushary-codex-hook.js +36 -32
- package/dist/bin/pushary-codex-session.js +17 -616
- package/dist/bin/pushary-codex.js +15 -12
- package/dist/bin/pushary-connect.js +31 -28
- package/dist/bin/pushary-cowork.js +7 -6
- package/dist/bin/pushary-daemon.js +57 -52
- package/dist/bin/pushary-disconnect.js +29 -26
- package/dist/bin/pushary-doctor.js +58 -53
- package/dist/bin/pushary-elicitation-hook.js +29 -26
- package/dist/bin/pushary-gemini-bridge.js +17 -15
- package/dist/bin/pushary-gemini-hook.js +33 -29
- package/dist/bin/pushary-hook.js +34 -31
- package/dist/bin/pushary-login.js +19 -16
- package/dist/bin/pushary-logout.js +30 -27
- package/dist/bin/pushary-mcp.js +16 -9
- package/dist/bin/pushary-mode.js +16 -14
- package/dist/bin/pushary-notification-hook.js +27 -24
- package/dist/bin/pushary-opencode-hook.js +32 -28
- package/dist/bin/pushary-permission-denied-hook.js +32 -29
- package/dist/bin/pushary-permission-hook.js +31 -28
- package/dist/bin/pushary-post-hook.js +27 -24
- package/dist/bin/pushary-prompt-hook.js +27 -24
- package/dist/bin/pushary-session-end-hook.js +27 -24
- package/dist/bin/pushary-session-start-hook.js +34 -29
- package/dist/bin/pushary-setup.js +195 -138
- package/dist/bin/pushary-stats.js +8 -7
- package/dist/bin/pushary-status.js +35 -32
- package/dist/bin/pushary-stop-hook.js +27 -24
- package/dist/bin/pushary-stopfailure-hook.js +27 -24
- package/dist/bin/pushary-suggestions.js +16 -14
- package/dist/bin/pushary-transcript-register.js +19 -17
- package/dist/bin/pushary-transcripts.js +10 -9
- package/dist/bin/pushary-upgrade.js +76 -46
- package/dist/bin/pushary-wait.js +16 -14
- package/dist/bin/pushary.js +10 -8
- package/dist/{chunk-GBKSCDEK.js → chunk-2LEH5IGX.js} +17 -4
- package/dist/chunk-36NGFHE4.js +72 -0
- package/dist/{chunk-B7LV6W7U.js → chunk-3RPN7AAT.js} +1 -1
- package/dist/{chunk-GDDXGBTM.js → chunk-46TC24ET.js} +2 -2
- package/dist/{chunk-KEAIIVW3.js → chunk-4QQEUJL4.js} +2 -2
- package/dist/{chunk-XNZB274I.js → chunk-5463UUO2.js} +1 -1
- package/dist/{chunk-FPKQGWAF.js → chunk-56ZTIY6D.js} +2 -2
- package/dist/{chunk-34AQAQKW.js → chunk-63IQRYVP.js} +4 -4
- package/dist/{chunk-25SYEAW4.js → chunk-6C4S3QYD.js} +3 -3
- package/dist/{chunk-4PCJ6DYK.js → chunk-6SWMKF5E.js} +2 -2
- package/dist/{chunk-Y7WD72J7.js → chunk-7CLLWDCP.js} +1 -1
- package/dist/{chunk-WLT6J3SB.js → chunk-ALZZVC3E.js} +2 -2
- package/dist/{chunk-ZMYLVFXC.js → chunk-BL3WAGIK.js} +14 -9
- package/dist/{chunk-PA54A437.js → chunk-BUXDR6US.js} +1 -1
- package/dist/{chunk-VUS6QGND.js → chunk-CQ5JGRML.js} +5 -1
- package/dist/{chunk-IF2UPWD2.js → chunk-DHJSBK63.js} +1 -1
- package/dist/chunk-DMJFW4KL.js +729 -0
- package/dist/{chunk-ABMEBN2R.js → chunk-EK7SZJ4K.js} +6 -4
- package/dist/{chunk-VCZN7NAB.js → chunk-EPOD7QHT.js} +7 -5
- package/dist/{chunk-KIO2MZQC.js → chunk-FCMWUYIE.js} +5 -3
- package/dist/{chunk-YTYXFA5M.js → chunk-FI73DGNB.js} +1 -1
- package/dist/{chunk-JGNYCRB2.js → chunk-FV34HT35.js} +1 -1
- package/dist/{chunk-KK2DIUVV.js → chunk-GCN73COS.js} +1 -1
- package/dist/{chunk-KBGKWB5T.js → chunk-H57DXSHR.js} +4 -2
- package/dist/{chunk-SALUTWPX.js → chunk-IHUFRAHB.js} +4 -4
- package/dist/chunk-JBT3ZSJS.js +92 -0
- package/dist/{chunk-5Q2FRMPC.js → chunk-JOWF4Y4P.js} +4 -4
- package/dist/{chunk-EP6S6VY3.js → chunk-JPABKXK6.js} +6 -6
- package/dist/{chunk-LLRYP5TR.js → chunk-K23WMLPY.js} +5 -5
- package/dist/{chunk-34RXPM5U.js → chunk-L5YTS2BP.js} +3 -3
- package/dist/{chunk-SE4JFMLW.js → chunk-LD4MWJMD.js} +8 -6
- package/dist/{chunk-OR5F63C2.js → chunk-LF3TLC7B.js} +2 -168
- package/dist/{chunk-XTVEW2NG.js → chunk-LIESRXK5.js} +1 -1
- package/dist/{chunk-ZOKMGBPR.js → chunk-MC4VY5LK.js} +16 -5
- package/dist/{chunk-K73CBZKW.js → chunk-MHQB62K5.js} +4 -4
- package/dist/{chunk-DH4BWFU7.js → chunk-MTKV4RUQ.js} +82 -16
- package/dist/{chunk-Y74IJ2IO.js → chunk-N77BH7H2.js} +10 -4
- package/dist/{chunk-ZTTCYHOM.js → chunk-NECZKPJN.js} +31 -6
- package/dist/{chunk-TGCIFEDE.js → chunk-NELH25J7.js} +13 -11
- package/dist/{chunk-HXRH7ZCK.js → chunk-NHVEQLQC.js} +2 -2
- package/dist/{chunk-OW4DNSQ6.js → chunk-NSY2V7XU.js} +1 -1
- package/dist/chunk-OHSHDQZF.js +271 -0
- package/dist/{chunk-ZYYQJSIO.js → chunk-OML4YFBN.js} +44 -462
- package/dist/{chunk-X3RCIOIH.js → chunk-ONCWYACA.js} +1 -1
- package/dist/{chunk-LZYJMSOY.js → chunk-P2546BBI.js} +3 -3
- package/dist/{chunk-WEY5ZHDB.js → chunk-Q7OXI6VS.js} +5 -5
- package/dist/{chunk-APASKZ2I.js → chunk-QKU46TK5.js} +5 -3
- package/dist/chunk-QTOLNRET.js +169 -0
- package/dist/{chunk-TYTIDEBW.js → chunk-RH6KR6EH.js} +5 -5
- package/dist/{chunk-7RMSB4A2.js → chunk-RL7EOD6I.js} +87 -24
- package/dist/{chunk-BOVSUH4N.js → chunk-S6RNS4UL.js} +2 -2
- package/dist/{chunk-LY3OJFBW.js → chunk-T6RIKJUO.js} +2 -1
- package/dist/{chunk-YVO4HIHX.js → chunk-U2L42GVI.js} +12 -10
- package/dist/{chunk-BXK6ZJVJ.js → chunk-UVT6B6XN.js} +2 -2
- package/dist/{chunk-UCF3EZZL.js → chunk-VQPSWD3A.js} +13 -13
- package/dist/{chunk-XH3F66VD.js → chunk-VYBH6D4X.js} +3 -3
- package/dist/chunk-XCEN33UP.js +7 -0
- package/dist/{chunk-GTGXQ7FJ.js → chunk-XDCXTDHH.js} +11 -11
- package/dist/{chunk-OZLGTMIY.js → chunk-XSUJ2PQY.js} +2 -2
- package/dist/chunk-XUW2DRAQ.js +427 -0
- package/dist/{chunk-UHVD7BSV.js → chunk-XZRLFBEA.js} +6 -6
- package/dist/{chunk-AWMMABVB.js → chunk-ZMPR436Z.js} +52 -138
- package/dist/{chunk-PXUNPXOX.js → chunk-ZOP3I2GQ.js} +3 -3
- package/dist/codex-app-cards-switch-OUQ3DUWF.js +52 -0
- package/dist/codex-desktop-launch-EIFLPLB7.js +27 -0
- package/dist/codex-session-launch-KLH2FSSJ.js +331 -0
- package/dist/config-HX6ZNOIL.js +14 -0
- package/dist/{global-upgrade-AIUSS2YH.js → global-upgrade-AZN3BPI3.js} +8 -6
- package/dist/identity-AQIMUWYN.js +15 -0
- package/dist/live-capabilities-4IIFAMHU.js +53 -0
- package/dist/{paths-RO34TYNM.js → paths-X4IPV2WJ.js} +4 -2
- package/dist/{reapply-KTNPP4XE.js → reapply-CXODG53B.js} +27 -21
- package/dist/src/index.d.ts +3 -3
- package/dist/src/index.js +22 -19
- package/dist/{upgrade-lock-5UAGXIW7.js → upgrade-lock-AHISGKER.js} +5 -3
- package/dist/usage-ZC6BKIE3.js +10 -0
- package/package.json +1 -1
|
@@ -1,32 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SubscriptionRequiredError,
|
|
3
|
+
callMcpTool
|
|
4
|
+
} from "./chunk-P2546BBI.js";
|
|
1
5
|
import {
|
|
2
6
|
CLIENT_REPORT_DISABLE_ENV,
|
|
3
7
|
isDisabledByEnv
|
|
4
8
|
} from "./chunk-POFBE6ZY.js";
|
|
5
|
-
import {
|
|
6
|
-
SubscriptionRequiredError,
|
|
7
|
-
callMcpTool
|
|
8
|
-
} from "./chunk-LZYJMSOY.js";
|
|
9
9
|
import {
|
|
10
10
|
installNetworkDefaults,
|
|
11
11
|
isNetworkFailure
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EK7SZJ4K.js";
|
|
13
13
|
import {
|
|
14
14
|
clientReportClaims
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OML4YFBN.js";
|
|
16
16
|
import {
|
|
17
17
|
getApiKey,
|
|
18
18
|
getBaseUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CQ5JGRML.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,
|
|
28
26
|
truncateLine
|
|
29
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LF3TLC7B.js";
|
|
28
|
+
|
|
29
|
+
// src/api.ts
|
|
30
|
+
import { randomUUID } from "crypto";
|
|
31
|
+
|
|
32
|
+
// src/validate.ts
|
|
33
|
+
var isPolicyConfig = (data) => {
|
|
34
|
+
if (!data || typeof data !== "object") return false;
|
|
35
|
+
const d = data;
|
|
36
|
+
return (d.resolvedAgent === void 0 || typeof d.resolvedAgent === "string") && Array.isArray(d.policies) && typeof d.defaultTimeoutSeconds === "number" && typeof d.defaultTimeoutAction === "string";
|
|
37
|
+
};
|
|
38
|
+
var isAskUserResponse = (data) => {
|
|
39
|
+
if (!data || typeof data !== "object") return false;
|
|
40
|
+
const d = data;
|
|
41
|
+
return typeof d.correlationId === "string" && typeof d.status === "string" && (d.answered === void 0 || typeof d.answered === "boolean") && (d.value === void 0 || typeof d.value === "string") && (d.note === void 0 || typeof d.note === "string") && (d.waitEndsAt === void 0 || typeof d.waitEndsAt === "string");
|
|
42
|
+
};
|
|
43
|
+
var isWaitForAnswerResponse = (data) => {
|
|
44
|
+
if (!data || typeof data !== "object") return false;
|
|
45
|
+
const d = data;
|
|
46
|
+
return typeof d.answered === "boolean";
|
|
47
|
+
};
|
|
48
|
+
var GATE_REPLY_KINDS = ["kill", "allow", "deny", "ask", "no_opinion"];
|
|
49
|
+
var isSettlementOutputs = (value) => {
|
|
50
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
51
|
+
const outputs = value;
|
|
52
|
+
return (outputs.approve === void 0 || typeof outputs.approve === "string") && (outputs.deny === void 0 || typeof outputs.deny === "string");
|
|
53
|
+
};
|
|
54
|
+
var isGateReply = (data) => {
|
|
55
|
+
if (!data || typeof data !== "object") return false;
|
|
56
|
+
const d = data;
|
|
57
|
+
return GATE_REPLY_KINDS.includes(d.kind) && (d.output === void 0 || typeof d.output === "string") && (d.correlationId === void 0 || typeof d.correlationId === "string") && (d.deadlineSeconds === void 0 || typeof d.deadlineSeconds === "number") && (d.noDevices === void 0 || typeof d.noDevices === "boolean") && (d.suppressed === void 0 || typeof d.suppressed === "boolean") && (d.settlementOutputs === void 0 || isSettlementOutputs(d.settlementOutputs));
|
|
58
|
+
};
|
|
59
|
+
var isBlockedActionClaim = (data) => {
|
|
60
|
+
if (!data || typeof data !== "object") return false;
|
|
61
|
+
return typeof data.granted === "boolean";
|
|
62
|
+
};
|
|
30
63
|
|
|
31
64
|
// src/client-report-claim.ts
|
|
32
65
|
import { createHash } from "crypto";
|
|
@@ -145,41 +178,6 @@ var writeDegraded = (subsystem, report) => {
|
|
|
145
178
|
void reportClientError({ kind: "degraded", code: `${subsystem}:${report.reason}` });
|
|
146
179
|
};
|
|
147
180
|
|
|
148
|
-
// src/api.ts
|
|
149
|
-
import { randomUUID } from "crypto";
|
|
150
|
-
|
|
151
|
-
// src/validate.ts
|
|
152
|
-
var isPolicyConfig = (data) => {
|
|
153
|
-
if (!data || typeof data !== "object") return false;
|
|
154
|
-
const d = data;
|
|
155
|
-
return (d.resolvedAgent === void 0 || typeof d.resolvedAgent === "string") && Array.isArray(d.policies) && typeof d.defaultTimeoutSeconds === "number" && typeof d.defaultTimeoutAction === "string";
|
|
156
|
-
};
|
|
157
|
-
var isAskUserResponse = (data) => {
|
|
158
|
-
if (!data || typeof data !== "object") return false;
|
|
159
|
-
const d = data;
|
|
160
|
-
return typeof d.correlationId === "string" && typeof d.status === "string" && (d.answered === void 0 || typeof d.answered === "boolean") && (d.value === void 0 || typeof d.value === "string") && (d.note === void 0 || typeof d.note === "string") && (d.waitEndsAt === void 0 || typeof d.waitEndsAt === "string");
|
|
161
|
-
};
|
|
162
|
-
var isWaitForAnswerResponse = (data) => {
|
|
163
|
-
if (!data || typeof data !== "object") return false;
|
|
164
|
-
const d = data;
|
|
165
|
-
return typeof d.answered === "boolean";
|
|
166
|
-
};
|
|
167
|
-
var GATE_REPLY_KINDS = ["kill", "allow", "deny", "ask", "no_opinion"];
|
|
168
|
-
var isSettlementOutputs = (value) => {
|
|
169
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
170
|
-
const outputs = value;
|
|
171
|
-
return (outputs.approve === void 0 || typeof outputs.approve === "string") && (outputs.deny === void 0 || typeof outputs.deny === "string");
|
|
172
|
-
};
|
|
173
|
-
var isGateReply = (data) => {
|
|
174
|
-
if (!data || typeof data !== "object") return false;
|
|
175
|
-
const d = data;
|
|
176
|
-
return GATE_REPLY_KINDS.includes(d.kind) && (d.output === void 0 || typeof d.output === "string") && (d.correlationId === void 0 || typeof d.correlationId === "string") && (d.deadlineSeconds === void 0 || typeof d.deadlineSeconds === "number") && (d.noDevices === void 0 || typeof d.noDevices === "boolean") && (d.suppressed === void 0 || typeof d.suppressed === "boolean") && (d.settlementOutputs === void 0 || isSettlementOutputs(d.settlementOutputs));
|
|
177
|
-
};
|
|
178
|
-
var isBlockedActionClaim = (data) => {
|
|
179
|
-
if (!data || typeof data !== "object") return false;
|
|
180
|
-
return typeof data.granted === "boolean";
|
|
181
|
-
};
|
|
182
|
-
|
|
183
181
|
// src/api.ts
|
|
184
182
|
installNetworkDefaults();
|
|
185
183
|
var isDecisionStopped = (result) => result.handoffAction === "stop" || ["cancelled", "unavailable", "stopped", "missing"].includes(result.status ?? "");
|
|
@@ -202,17 +200,17 @@ var withinAskUserLimits = (params) => ({
|
|
|
202
200
|
blocker: truncateOptional(params.blocker, DECISION_LINE_MAX),
|
|
203
201
|
permissionMode: boundedPermissionMode(params.permissionMode)
|
|
204
202
|
});
|
|
205
|
-
var askUser = async (apiKey, params, timeoutMs = 15e3) => {
|
|
203
|
+
var askUser = async (apiKey, params, timeoutMs = 15e3, baseUrl) => {
|
|
206
204
|
const identified = params.toolUseId || params.requestId ? params : { ...params, requestId: randomUUID() };
|
|
207
|
-
const result = await callMcpTool(apiKey, "ask_user", { ...withinAskUserLimits(identified), pausedAware: true, wait: false }, { maxRetries: 3, timeoutMs });
|
|
205
|
+
const result = await callMcpTool(apiKey, "ask_user", { ...withinAskUserLimits(identified), pausedAware: true, wait: false }, { maxRetries: 3, timeoutMs, baseUrl });
|
|
208
206
|
if (!isAskUserResponse(result)) throw new Error("Invalid ask_user response");
|
|
209
207
|
return result;
|
|
210
208
|
};
|
|
211
|
-
var waitForAnswer = async (apiKey, correlationId, timeoutMs = 3e4, signal) => {
|
|
209
|
+
var waitForAnswer = async (apiKey, correlationId, timeoutMs = 3e4, signal, baseUrl) => {
|
|
212
210
|
const result = await callMcpTool(apiKey, "wait_for_answer", {
|
|
213
211
|
correlationId,
|
|
214
212
|
timeoutMs
|
|
215
|
-
}, { timeoutMs: timeoutMs + 1e4, signal });
|
|
213
|
+
}, { timeoutMs: timeoutMs + 1e4, signal, baseUrl });
|
|
216
214
|
if (!isWaitForAnswerResponse(result)) throw new Error("Invalid wait_for_answer response");
|
|
217
215
|
return result;
|
|
218
216
|
};
|
|
@@ -224,7 +222,7 @@ var nextLongPollMs = (deadlineMs, nowMs) => {
|
|
|
224
222
|
return hold >= MIN_LONG_POLL_MS ? hold : null;
|
|
225
223
|
};
|
|
226
224
|
var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3) => {
|
|
227
|
-
const sleep = (ms) => new Promise((
|
|
225
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
228
226
|
while (Date.now() < deadlineMs) {
|
|
229
227
|
const hold = nextLongPollMs(deadlineMs, Date.now());
|
|
230
228
|
if (hold === null) {
|
|
@@ -244,8 +242,8 @@ var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3
|
|
|
244
242
|
}
|
|
245
243
|
return withdrawQuestion(apiKey, correlationId);
|
|
246
244
|
};
|
|
247
|
-
var cancelQuestion = async (apiKey, correlationId, signal) => {
|
|
248
|
-
return callMcpTool(apiKey, "cancel_question", { correlationId }, { signal, timeoutMs: 4e3, maxRetries: 1 });
|
|
245
|
+
var cancelQuestion = async (apiKey, correlationId, signal, baseUrl) => {
|
|
246
|
+
return callMcpTool(apiKey, "cancel_question", { correlationId }, { signal, timeoutMs: 4e3, maxRetries: 1, baseUrl });
|
|
249
247
|
};
|
|
250
248
|
var withdrawQuestion = async (apiKey, correlationId, transport = { cancelQuestion, waitForAnswer }) => {
|
|
251
249
|
try {
|
|
@@ -298,90 +296,6 @@ var claimBlockedAction = async (apiKey, request, timeoutMs) => {
|
|
|
298
296
|
}
|
|
299
297
|
};
|
|
300
298
|
|
|
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
|
-
|
|
385
299
|
export {
|
|
386
300
|
reportClientError,
|
|
387
301
|
exitAfterClientReports,
|
|
@@ -397,6 +311,7 @@ export {
|
|
|
397
311
|
unavailableQuestionUnlessSubscriptionRequired,
|
|
398
312
|
askUser,
|
|
399
313
|
waitForAnswer,
|
|
314
|
+
WAIT_RESPONSE_GRACE_MS,
|
|
400
315
|
nextLongPollMs,
|
|
401
316
|
pollForAnswer,
|
|
402
317
|
cancelQuestion,
|
|
@@ -404,6 +319,5 @@ export {
|
|
|
404
319
|
waitForQuestion,
|
|
405
320
|
sendNotification,
|
|
406
321
|
requestGate,
|
|
407
|
-
claimBlockedAction
|
|
408
|
-
repoKeyFor
|
|
322
|
+
claimBlockedAction
|
|
409
323
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BUXDR6US.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
6
|
} from "./chunk-GMXKITVA.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7QLSKOSU.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MC4VY5LK.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-
|
|
20
|
+
} from "./chunk-LF3TLC7B.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/cowork.ts
|
|
23
23
|
import { readFileSync } from "fs";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CODEX_APP_CARDS_DIRECTORY,
|
|
3
|
+
CODEX_APP_CARDS_LOGIN_ITEM,
|
|
4
|
+
codexAppCardsCommand,
|
|
5
|
+
codexAppCardsCommandOnThisMac,
|
|
6
|
+
codexAppCardsInstallation,
|
|
7
|
+
codexAppCardsLoginItem,
|
|
8
|
+
codexAppCardsLoginScript,
|
|
9
|
+
codexAppCardsPaths,
|
|
10
|
+
codexAppCardsReceiptFrom,
|
|
11
|
+
codexAppCardsStatus,
|
|
12
|
+
codexAppCardsStatusLine,
|
|
13
|
+
removeCodexAppCards,
|
|
14
|
+
removeCodexAppCardsFromThisMac,
|
|
15
|
+
runsFromATemporaryFolder,
|
|
16
|
+
turnCodexAppCardsOff,
|
|
17
|
+
turnCodexAppCardsOn
|
|
18
|
+
} from "./chunk-OHSHDQZF.js";
|
|
19
|
+
import "./chunk-DMJFW4KL.js";
|
|
20
|
+
import "./chunk-XCEN33UP.js";
|
|
21
|
+
import "./chunk-QCGNGEGE.js";
|
|
22
|
+
import "./chunk-BL3WAGIK.js";
|
|
23
|
+
import "./chunk-XHKBHWLX.js";
|
|
24
|
+
import "./chunk-VYBH6D4X.js";
|
|
25
|
+
import "./chunk-36NGFHE4.js";
|
|
26
|
+
import "./chunk-T6RIKJUO.js";
|
|
27
|
+
import "./chunk-4QQEUJL4.js";
|
|
28
|
+
import "./chunk-OML4YFBN.js";
|
|
29
|
+
import "./chunk-XUW2DRAQ.js";
|
|
30
|
+
import "./chunk-AQFEP65J.js";
|
|
31
|
+
import "./chunk-CQ5JGRML.js";
|
|
32
|
+
import "./chunk-MC4VY5LK.js";
|
|
33
|
+
import "./chunk-QTOLNRET.js";
|
|
34
|
+
import "./chunk-LF3TLC7B.js";
|
|
35
|
+
export {
|
|
36
|
+
CODEX_APP_CARDS_DIRECTORY,
|
|
37
|
+
CODEX_APP_CARDS_LOGIN_ITEM,
|
|
38
|
+
codexAppCardsCommand,
|
|
39
|
+
codexAppCardsCommandOnThisMac,
|
|
40
|
+
codexAppCardsInstallation,
|
|
41
|
+
codexAppCardsLoginItem,
|
|
42
|
+
codexAppCardsLoginScript,
|
|
43
|
+
codexAppCardsPaths,
|
|
44
|
+
codexAppCardsReceiptFrom,
|
|
45
|
+
codexAppCardsStatus,
|
|
46
|
+
codexAppCardsStatusLine,
|
|
47
|
+
removeCodexAppCards,
|
|
48
|
+
removeCodexAppCardsFromThisMac,
|
|
49
|
+
runsFromATemporaryFolder,
|
|
50
|
+
turnCodexAppCardsOff,
|
|
51
|
+
turnCodexAppCardsOn
|
|
52
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codexDesktopCommand,
|
|
3
|
+
codexEngineBehindLauncher,
|
|
4
|
+
codexPassThroughScript,
|
|
5
|
+
desktopEngine,
|
|
6
|
+
desktopEngineFromManifest,
|
|
7
|
+
desktopProxyScript,
|
|
8
|
+
installedCodexApp,
|
|
9
|
+
shellQuoted,
|
|
10
|
+
writeDesktopProxy
|
|
11
|
+
} from "./chunk-DMJFW4KL.js";
|
|
12
|
+
import "./chunk-XCEN33UP.js";
|
|
13
|
+
import {
|
|
14
|
+
CODEX_APP_LAUNCH_VARIABLE
|
|
15
|
+
} from "./chunk-36NGFHE4.js";
|
|
16
|
+
export {
|
|
17
|
+
CODEX_APP_LAUNCH_VARIABLE,
|
|
18
|
+
codexDesktopCommand,
|
|
19
|
+
codexEngineBehindLauncher,
|
|
20
|
+
codexPassThroughScript,
|
|
21
|
+
desktopEngine,
|
|
22
|
+
desktopEngineFromManifest,
|
|
23
|
+
desktopProxyScript,
|
|
24
|
+
installedCodexApp,
|
|
25
|
+
shellQuoted,
|
|
26
|
+
writeDesktopProxy
|
|
27
|
+
};
|