@pushary/agent-hooks 1.9.44 → 1.9.46
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 +10 -0
- package/README.md +1 -1
- package/dist/bin/pushary-bell-hook.js +25 -26
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +32 -34
- package/dist/bin/pushary-clean.js +30 -31
- package/dist/bin/pushary-codex-bridge.js +22 -690
- package/dist/bin/pushary-codex-hook.js +32 -34
- package/dist/bin/pushary-codex-session.js +439 -42
- package/dist/bin/pushary-codex.js +12 -13
- package/dist/bin/pushary-connect.js +24 -25
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +42 -43
- package/dist/bin/pushary-disconnect.js +24 -25
- package/dist/bin/pushary-doctor.js +35 -36
- package/dist/bin/pushary-elicitation-hook.js +25 -26
- package/dist/bin/pushary-gemini-bridge.js +22 -22
- package/dist/bin/pushary-gemini-hook.js +29 -31
- package/dist/bin/pushary-hook.js +30 -31
- package/dist/bin/pushary-login.js +13 -13
- package/dist/bin/pushary-logout.js +24 -25
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -25
- package/dist/bin/pushary-opencode-hook.js +28 -30
- package/dist/bin/pushary-permission-denied-hook.js +29 -30
- package/dist/bin/pushary-permission-hook.js +28 -29
- package/dist/bin/pushary-post-hook.js +24 -25
- package/dist/bin/pushary-prompt-hook.js +24 -25
- package/dist/bin/pushary-session-end-hook.js +24 -25
- package/dist/bin/pushary-session-start-hook.js +29 -30
- package/dist/bin/pushary-setup.js +37 -38
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +27 -28
- package/dist/bin/pushary-stop-hook.js +24 -25
- package/dist/bin/pushary-stopfailure-hook.js +24 -25
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +31 -32
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-KYLY6UMN.js → chunk-2IFTZZ5K.js} +1 -1
- package/dist/{chunk-L2ZM7LXN.js → chunk-2PTJHEX4.js} +2 -2
- package/dist/{chunk-3IRC3XFG.js → chunk-2UABJ75E.js} +2 -2
- package/dist/{chunk-MRQJCIFO.js → chunk-2VNHP2OE.js} +1 -1
- package/dist/{chunk-TKTS3SIM.js → chunk-2X3PPRNC.js} +3 -3
- package/dist/{chunk-E76QCZIA.js → chunk-2ZD53EQW.js} +2 -2
- package/dist/{chunk-SI2NC6UU.js → chunk-35TUEZ5E.js} +3 -3
- package/dist/{chunk-7UM4NCUI.js → chunk-5NXD6ZHQ.js} +2 -2
- package/dist/{chunk-42CVAOC5.js → chunk-5O6GB64K.js} +2 -2
- package/dist/{chunk-OWQOMGBF.js → chunk-7XSIUY5F.js} +1 -1
- package/dist/{chunk-4WBAHVBK.js → chunk-BKJP2MQN.js} +6 -6
- package/dist/{chunk-W2TA4EVZ.js → chunk-CA6F44OF.js} +7 -7
- package/dist/{chunk-DD6IBKEJ.js → chunk-CJKEU4EZ.js} +4 -4
- package/dist/{chunk-JNU3LV47.js → chunk-EDSXF7NV.js} +25 -4
- package/dist/{chunk-75M7NFFC.js → chunk-EKDSF3IX.js} +1 -1
- package/dist/{chunk-PQAFH4DF.js → chunk-ELLN4XAF.js} +2 -2
- package/dist/{chunk-T4CKP47U.js → chunk-EP4MD6TH.js} +5 -5
- package/dist/{chunk-4JHEZ2PV.js → chunk-EW52AGOV.js} +4 -4
- package/dist/chunk-FMDGUCER.js +866 -0
- package/dist/{chunk-53UZN7JW.js → chunk-FQW7AV6U.js} +3 -3
- package/dist/{chunk-XPQDBTW4.js → chunk-FQWI6XQG.js} +1 -1
- package/dist/{chunk-MIBCRQWK.js → chunk-G227SH2O.js} +2 -2
- package/dist/{chunk-OR6KJOHE.js → chunk-GG6C4CHH.js} +2 -2
- package/dist/{chunk-2NVXFWQY.js → chunk-GQZF6DPL.js} +1 -1
- package/dist/{chunk-FI2F5KZJ.js → chunk-HTQPDODV.js} +4 -4
- package/dist/{chunk-SWDPCDLT.js → chunk-HX34VBPE.js} +4 -4
- package/dist/{chunk-OZ7MLVDM.js → chunk-I5EQ5NJD.js} +8 -8
- package/dist/{chunk-IWHDNMM3.js → chunk-JPGY5LSF.js} +5 -5
- package/dist/{chunk-S2ALW446.js → chunk-KJNWVAS6.js} +3 -3
- package/dist/{chunk-TJZUQRMH.js → chunk-LA4S2KIM.js} +3 -3
- package/dist/{chunk-RGBTKOCC.js → chunk-LEMQA4HM.js} +5 -5
- package/dist/{chunk-UC4PNLMK.js → chunk-LNO25UX4.js} +6 -6
- package/dist/{chunk-CESLE4UN.js → chunk-MBB4XJIN.js} +7 -7
- package/dist/{chunk-UJXLVH66.js → chunk-MOUUDZOZ.js} +1 -1
- package/dist/{chunk-6EV3B5CD.js → chunk-NO3ADUD4.js} +1 -1
- package/dist/{chunk-KILK6SWZ.js → chunk-NULG2ZUG.js} +4 -4
- package/dist/{chunk-CAJCCQ7N.js → chunk-NWZZTHWF.js} +1 -1
- package/dist/{chunk-FKDZU6YX.js → chunk-OI6YNNI5.js} +4 -4
- package/dist/{chunk-CEZTYTBN.js → chunk-ON2WCBIN.js} +11 -13
- package/dist/{chunk-ALY7ZBNB.js → chunk-P2FHZ65U.js} +1 -1
- package/dist/{chunk-UY5E2UUW.js → chunk-PGULTXDJ.js} +5 -5
- package/dist/{chunk-GRAPJKDK.js → chunk-PZPYL65I.js} +1 -1
- package/dist/{chunk-FYNMFSIZ.js → chunk-SEKQAYVP.js} +2 -2
- package/dist/{chunk-GBCR2FH2.js → chunk-T623UG5T.js} +3 -3
- package/dist/{chunk-OSMNLNPF.js → chunk-UCRG5QGN.js} +1 -1
- package/dist/{chunk-GOEIW2VH.js → chunk-UGXRDY3O.js} +182 -39
- package/dist/{chunk-PGHN5D4N.js → chunk-UI3WDOV3.js} +2 -2
- package/dist/{chunk-WMO2XVG4.js → chunk-ULEX43F7.js} +1 -1
- package/dist/{chunk-LEHBWBCG.js → chunk-UP2RNIHL.js} +4 -4
- package/dist/{chunk-UZVF6MP2.js → chunk-VTF7LKDB.js} +5 -5
- package/dist/{chunk-M2L7625S.js → chunk-W7MXYDGP.js} +2 -2
- package/dist/{chunk-T3KMJI4W.js → chunk-WN3MDHAM.js} +2 -2
- package/dist/{chunk-BKK3JCTD.js → chunk-WYD4PYTL.js} +12 -14
- package/dist/{chunk-TWATOPHK.js → chunk-XAMFOUXA.js} +2 -2
- package/dist/{chunk-WBD7HZEZ.js → chunk-ZGGSQTCO.js} +1 -1
- package/dist/{chunk-HV4TEKNP.js → chunk-ZYS4UHEC.js} +4 -4
- package/dist/{global-upgrade-QSSDYZCZ.js → global-upgrade-A7EADTOL.js} +6 -6
- package/dist/{paths-55DDFLY4.js → paths-UIPHTZH4.js} +2 -2
- package/dist/{reapply-MEU66ALO.js → reapply-JAT4DS6G.js} +21 -22
- package/dist/src/index.js +19 -20
- package/dist/{upgrade-lock-YLXAU4AD.js → upgrade-lock-YUSXU5I5.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-5ZSBQHCM.js +0 -161
- package/dist/chunk-SVCT5D7K.js +0 -196
|
@@ -3,21 +3,30 @@ import {
|
|
|
3
3
|
isDisabledByEnv
|
|
4
4
|
} from "./chunk-POFBE6ZY.js";
|
|
5
5
|
import {
|
|
6
|
+
SubscriptionRequiredError,
|
|
7
|
+
callMcpTool
|
|
8
|
+
} from "./chunk-FQW7AV6U.js";
|
|
9
|
+
import {
|
|
10
|
+
installNetworkDefaults,
|
|
6
11
|
isNetworkFailure
|
|
7
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KJNWVAS6.js";
|
|
8
13
|
import {
|
|
9
14
|
clientReportClaims
|
|
10
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EW52AGOV.js";
|
|
11
16
|
import {
|
|
12
17
|
getApiKey,
|
|
13
18
|
getBaseUrl
|
|
14
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7XSIUY5F.js";
|
|
15
20
|
import {
|
|
21
|
+
ASK_AGENT_NAME_MAX,
|
|
16
22
|
CLIENT_REPORT_PATH,
|
|
23
|
+
DECISION_LINE_MAX,
|
|
24
|
+
GATE_PERMISSION_MODE_MAX_LENGTH,
|
|
17
25
|
degradedLine,
|
|
18
26
|
localRepoKey,
|
|
19
|
-
normalizeRepoRemote
|
|
20
|
-
|
|
27
|
+
normalizeRepoRemote,
|
|
28
|
+
truncateLine
|
|
29
|
+
} from "./chunk-EDSXF7NV.js";
|
|
21
30
|
|
|
22
31
|
// src/client-report-claim.ts
|
|
23
32
|
import { createHash } from "crypto";
|
|
@@ -136,6 +145,159 @@ var writeDegraded = (subsystem, report) => {
|
|
|
136
145
|
void reportClientError({ kind: "degraded", code: `${subsystem}:${report.reason}` });
|
|
137
146
|
};
|
|
138
147
|
|
|
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
|
+
// src/api.ts
|
|
184
|
+
installNetworkDefaults();
|
|
185
|
+
var isDecisionStopped = (result) => result.handoffAction === "stop" || ["cancelled", "unavailable", "stopped", "missing"].includes(result.status ?? "");
|
|
186
|
+
var isAwayPaused = (result) => result.paused === true;
|
|
187
|
+
var isLocalQuestionHandoff = (result) => !isAwayPaused(result) && (result.suppressed === true || result.noDevices === true || result.status === "terminal" || result.status === "notified");
|
|
188
|
+
var waitsForThePhone = (result) => result.answered !== true && !isAwayPaused(result) && !isLocalQuestionHandoff(result);
|
|
189
|
+
var STOPPED = { answered: false, handoffAction: "stop" };
|
|
190
|
+
var unavailableQuestionUnlessSubscriptionRequired = (error) => {
|
|
191
|
+
if (error instanceof SubscriptionRequiredError) throw error;
|
|
192
|
+
return { correlationId: "", status: "unavailable" };
|
|
193
|
+
};
|
|
194
|
+
var truncateOptional = (text, max) => text === void 0 ? void 0 : truncateLine(text, max);
|
|
195
|
+
var boundedPermissionMode = (value) => typeof value === "string" && value.length > 0 ? value.slice(0, GATE_PERMISSION_MODE_MAX_LENGTH) : void 0;
|
|
196
|
+
var withinAskUserLimits = (params) => ({
|
|
197
|
+
...params,
|
|
198
|
+
question: params.question,
|
|
199
|
+
agentName: truncateOptional(params.agentName, ASK_AGENT_NAME_MAX),
|
|
200
|
+
intent: truncateOptional(params.intent, DECISION_LINE_MAX),
|
|
201
|
+
action: truncateOptional(params.action, DECISION_LINE_MAX),
|
|
202
|
+
blocker: truncateOptional(params.blocker, DECISION_LINE_MAX),
|
|
203
|
+
permissionMode: boundedPermissionMode(params.permissionMode)
|
|
204
|
+
});
|
|
205
|
+
var askUser = async (apiKey, params, timeoutMs = 15e3) => {
|
|
206
|
+
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 });
|
|
208
|
+
if (!isAskUserResponse(result)) throw new Error("Invalid ask_user response");
|
|
209
|
+
return result;
|
|
210
|
+
};
|
|
211
|
+
var waitForAnswer = async (apiKey, correlationId, timeoutMs = 3e4, signal) => {
|
|
212
|
+
const result = await callMcpTool(apiKey, "wait_for_answer", {
|
|
213
|
+
correlationId,
|
|
214
|
+
timeoutMs
|
|
215
|
+
}, { timeoutMs: timeoutMs + 1e4, signal });
|
|
216
|
+
if (!isWaitForAnswerResponse(result)) throw new Error("Invalid wait_for_answer response");
|
|
217
|
+
return result;
|
|
218
|
+
};
|
|
219
|
+
var WAIT_RESPONSE_GRACE_MS = 2e3;
|
|
220
|
+
var MIN_LONG_POLL_MS = 1e3;
|
|
221
|
+
var MAX_LONG_POLL_MS = 3e4;
|
|
222
|
+
var nextLongPollMs = (deadlineMs, nowMs) => {
|
|
223
|
+
const hold = Math.min(deadlineMs - nowMs - WAIT_RESPONSE_GRACE_MS, MAX_LONG_POLL_MS);
|
|
224
|
+
return hold >= MIN_LONG_POLL_MS ? hold : null;
|
|
225
|
+
};
|
|
226
|
+
var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3) => {
|
|
227
|
+
const sleep = (ms) => new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
228
|
+
while (Date.now() < deadlineMs) {
|
|
229
|
+
const hold = nextLongPollMs(deadlineMs, Date.now());
|
|
230
|
+
if (hold === null) {
|
|
231
|
+
await sleep(Math.max(0, deadlineMs - Date.now()));
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
let answer;
|
|
235
|
+
try {
|
|
236
|
+
answer = await waitForAnswer(apiKey, correlationId, hold, AbortSignal.timeout(Math.max(1, deadlineMs - Date.now())));
|
|
237
|
+
} catch {
|
|
238
|
+
const late = await withdrawQuestion(apiKey, correlationId);
|
|
239
|
+
return late.answered ? late : STOPPED;
|
|
240
|
+
}
|
|
241
|
+
if (isDecisionStopped(answer) || answer.answered) return answer;
|
|
242
|
+
if (answer.status === "expired") return STOPPED;
|
|
243
|
+
await sleep(Math.min(pollInterval, Math.max(0, deadlineMs - Date.now())));
|
|
244
|
+
}
|
|
245
|
+
return withdrawQuestion(apiKey, correlationId);
|
|
246
|
+
};
|
|
247
|
+
var cancelQuestion = async (apiKey, correlationId, signal) => {
|
|
248
|
+
return callMcpTool(apiKey, "cancel_question", { correlationId }, { signal, timeoutMs: 4e3, maxRetries: 1 });
|
|
249
|
+
};
|
|
250
|
+
var withdrawQuestion = async (apiKey, correlationId, transport = { cancelQuestion, waitForAnswer }) => {
|
|
251
|
+
try {
|
|
252
|
+
const cancelled = await transport.cancelQuestion(apiKey, correlationId, AbortSignal.timeout(4e3));
|
|
253
|
+
if (!cancelled || isDecisionStopped(cancelled)) return STOPPED;
|
|
254
|
+
if (cancelled.cancelled === true) return { answered: false, status: "withdrawn" };
|
|
255
|
+
const late = await transport.waitForAnswer(apiKey, correlationId, 1e3, AbortSignal.timeout(2e3));
|
|
256
|
+
if (late.answered || isDecisionStopped(late)) return late;
|
|
257
|
+
return late.status === "expired" ? { answered: false, status: "withdrawn" } : STOPPED;
|
|
258
|
+
} catch {
|
|
259
|
+
return STOPPED;
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
var waitForQuestion = async (apiKey, question, deadlineMs, pollInterval = 2e3) => {
|
|
263
|
+
if (isDecisionStopped(question) || question.answered) return { ...question, answered: !!question.answered };
|
|
264
|
+
if (question.status === "expired") return STOPPED;
|
|
265
|
+
return isAwayPaused(question) || isLocalQuestionHandoff(question) ? withdrawQuestion(apiKey, question.correlationId) : pollForAnswer(apiKey, question.correlationId, deadlineMs, pollInterval);
|
|
266
|
+
};
|
|
267
|
+
var sendNotification = async (apiKey, params, timeoutMs = 15e3, signal) => {
|
|
268
|
+
await callMcpTool(apiKey, "send_notification", { ...params }, { maxRetries: signal ? 1 : 3, timeoutMs, signal });
|
|
269
|
+
};
|
|
270
|
+
var GATE_PATH = "/api/agent/gate";
|
|
271
|
+
var BLOCKED_ACTION_CLAIM_PATH = "/api/agent/blocked-action/claim";
|
|
272
|
+
var postAgentRequest = async (apiKey, path, body, timeoutMs) => {
|
|
273
|
+
const response = await fetch(`${getBaseUrl()}${path}`, {
|
|
274
|
+
method: "POST",
|
|
275
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` },
|
|
276
|
+
body: JSON.stringify(body),
|
|
277
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
278
|
+
});
|
|
279
|
+
if (!response.ok) throw new Error(`${path} rejected (${response.status})`);
|
|
280
|
+
return response.json();
|
|
281
|
+
};
|
|
282
|
+
var requestGate = async (apiKey, request, timeoutMs = 15e3) => {
|
|
283
|
+
try {
|
|
284
|
+
const reply = await postAgentRequest(apiKey, GATE_PATH, request, timeoutMs);
|
|
285
|
+
return isGateReply(reply) ? reply : null;
|
|
286
|
+
} catch (error) {
|
|
287
|
+
void reportClientError({ kind: clientErrorKindOf(error), code: "gate_request_failed" });
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
var claimBlockedAction = async (apiKey, request, timeoutMs) => {
|
|
292
|
+
try {
|
|
293
|
+
const reply = await postAgentRequest(apiKey, BLOCKED_ACTION_CLAIM_PATH, request, timeoutMs);
|
|
294
|
+
return isBlockedActionClaim(reply) ? reply.granted : null;
|
|
295
|
+
} catch (error) {
|
|
296
|
+
void reportClientError({ kind: clientErrorKindOf(error), code: "blocked_action_claim_failed" });
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
139
301
|
// src/repo.ts
|
|
140
302
|
import { existsSync, readFileSync, statSync } from "fs";
|
|
141
303
|
import { basename, dirname, isAbsolute, join as join2, resolve } from "path";
|
|
@@ -220,38 +382,6 @@ var repoKeyFor = (cwd) => {
|
|
|
220
382
|
return derived;
|
|
221
383
|
};
|
|
222
384
|
|
|
223
|
-
// src/validate.ts
|
|
224
|
-
var isPolicyConfig = (data) => {
|
|
225
|
-
if (!data || typeof data !== "object") return false;
|
|
226
|
-
const d = data;
|
|
227
|
-
return (d.resolvedAgent === void 0 || typeof d.resolvedAgent === "string") && Array.isArray(d.policies) && typeof d.defaultTimeoutSeconds === "number" && typeof d.defaultTimeoutAction === "string";
|
|
228
|
-
};
|
|
229
|
-
var isAskUserResponse = (data) => {
|
|
230
|
-
if (!data || typeof data !== "object") return false;
|
|
231
|
-
const d = data;
|
|
232
|
-
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");
|
|
233
|
-
};
|
|
234
|
-
var isWaitForAnswerResponse = (data) => {
|
|
235
|
-
if (!data || typeof data !== "object") return false;
|
|
236
|
-
const d = data;
|
|
237
|
-
return typeof d.answered === "boolean";
|
|
238
|
-
};
|
|
239
|
-
var GATE_REPLY_KINDS = ["kill", "allow", "deny", "ask", "no_opinion"];
|
|
240
|
-
var isSettlementOutputs = (value) => {
|
|
241
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
242
|
-
const outputs = value;
|
|
243
|
-
return (outputs.approve === void 0 || typeof outputs.approve === "string") && (outputs.deny === void 0 || typeof outputs.deny === "string");
|
|
244
|
-
};
|
|
245
|
-
var isGateReply = (data) => {
|
|
246
|
-
if (!data || typeof data !== "object") return false;
|
|
247
|
-
const d = data;
|
|
248
|
-
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));
|
|
249
|
-
};
|
|
250
|
-
var isBlockedActionClaim = (data) => {
|
|
251
|
-
if (!data || typeof data !== "object") return false;
|
|
252
|
-
return typeof data.granted === "boolean";
|
|
253
|
-
};
|
|
254
|
-
|
|
255
385
|
export {
|
|
256
386
|
reportClientError,
|
|
257
387
|
exitAfterClientReports,
|
|
@@ -260,7 +390,20 @@ export {
|
|
|
260
390
|
isPolicyConfig,
|
|
261
391
|
isAskUserResponse,
|
|
262
392
|
isWaitForAnswerResponse,
|
|
263
|
-
|
|
264
|
-
|
|
393
|
+
isDecisionStopped,
|
|
394
|
+
isAwayPaused,
|
|
395
|
+
isLocalQuestionHandoff,
|
|
396
|
+
waitsForThePhone,
|
|
397
|
+
unavailableQuestionUnlessSubscriptionRequired,
|
|
398
|
+
askUser,
|
|
399
|
+
waitForAnswer,
|
|
400
|
+
nextLongPollMs,
|
|
401
|
+
pollForAnswer,
|
|
402
|
+
cancelQuestion,
|
|
403
|
+
withdrawQuestion,
|
|
404
|
+
waitForQuestion,
|
|
405
|
+
sendNotification,
|
|
406
|
+
requestGate,
|
|
407
|
+
claimBlockedAction,
|
|
265
408
|
repoKeyFor
|
|
266
409
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EW52AGOV.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe
|
|
6
6
|
} from "./chunk-AQFEP65J.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EDSXF7NV.js";
|
|
10
10
|
|
|
11
11
|
// src/process-ownership.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VTF7LKDB.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LA4S2KIM.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EW52AGOV.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
12
|
} from "./chunk-AQFEP65J.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EDSXF7NV.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,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OI6YNNI5.js";
|
|
4
4
|
import {
|
|
5
5
|
hookOwnerOf,
|
|
6
6
|
hookOwnerOfCommands,
|
|
7
7
|
liveBridgeProbe,
|
|
8
8
|
resolveBridgeStub
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EP4MD6TH.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENT_CHOICES
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NO3ADUD4.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-
|
|
21
|
+
} from "./chunk-EW52AGOV.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-
|
|
32
|
+
} from "./chunk-EDSXF7NV.js";
|
|
33
33
|
|
|
34
34
|
// src/opencode-plugin.ts
|
|
35
35
|
var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DISCONNECT_AGENT_IDS,
|
|
3
3
|
SETUP_AGENT_CHOICES,
|
|
4
4
|
isApprovalMode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EDSXF7NV.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/mode-request.ts
|
|
8
8
|
var parseDuration = (value) => {
|
|
@@ -36,7 +36,7 @@ var describeMode = (mode) => {
|
|
|
36
36
|
var npxLatestCommandFor = (platform) => `${platform === "win32" ? "npx.cmd" : "npx"} pushary@latest`;
|
|
37
37
|
var NPX_LATEST_COMMAND = npxLatestCommandFor(process.platform);
|
|
38
38
|
var COMMAND_LIST = [
|
|
39
|
-
{ name: "codex", module: "pushary-codex-session", summary: "Start
|
|
39
|
+
{ name: "codex", module: "pushary-codex-session", summary: "Start Codex with Pushary native approvals", detail: ["Use --cwd <directory> to choose a terminal project.", "Use --desktop [app path] for an experimental fresh Desktop launch. Quit Desktop first; running apps are not attached."] },
|
|
40
40
|
{
|
|
41
41
|
name: "cowork",
|
|
42
42
|
module: "pushary-cowork",
|
|
@@ -2,37 +2,35 @@ import {
|
|
|
2
2
|
IDLE_PROMPT_NOTIFICATION,
|
|
3
3
|
NOTIFICATION_PUSH_TYPES,
|
|
4
4
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
cancelQuestion,
|
|
8
|
-
sendNotification,
|
|
9
|
-
waitForAnswer
|
|
10
|
-
} from "./chunk-5ZSBQHCM.js";
|
|
5
|
+
} from "./chunk-NWZZTHWF.js";
|
|
11
6
|
import {
|
|
12
7
|
reportedInstallSource
|
|
13
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-W7MXYDGP.js";
|
|
14
9
|
import {
|
|
10
|
+
cancelQuestion,
|
|
15
11
|
clientErrorKindOf,
|
|
16
12
|
isPolicyConfig,
|
|
17
13
|
repoKeyFor,
|
|
18
|
-
reportClientError
|
|
19
|
-
|
|
14
|
+
reportClientError,
|
|
15
|
+
sendNotification,
|
|
16
|
+
waitForAnswer
|
|
17
|
+
} from "./chunk-UGXRDY3O.js";
|
|
20
18
|
import {
|
|
21
19
|
withRetry
|
|
22
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FQW7AV6U.js";
|
|
23
21
|
import {
|
|
24
22
|
getMachineId
|
|
25
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ULEX43F7.js";
|
|
26
24
|
import {
|
|
27
25
|
canonicalJson
|
|
28
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EW52AGOV.js";
|
|
29
27
|
import {
|
|
30
28
|
writeFileAtomic
|
|
31
29
|
} from "./chunk-AQFEP65J.js";
|
|
32
30
|
import {
|
|
33
31
|
getApiKey,
|
|
34
32
|
getBaseUrl
|
|
35
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-7XSIUY5F.js";
|
|
36
34
|
import {
|
|
37
35
|
ACTION_BODY_MAX,
|
|
38
36
|
AGENTS,
|
|
@@ -65,7 +63,7 @@ import {
|
|
|
65
63
|
toToolLookup,
|
|
66
64
|
truncateLine,
|
|
67
65
|
unansweredRefusalReason
|
|
68
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-EDSXF7NV.js";
|
|
69
67
|
|
|
70
68
|
// ../hook-mapping/src/describe.ts
|
|
71
69
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VTF7LKDB.js";
|
|
4
4
|
import {
|
|
5
5
|
grokHome
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OI6YNNI5.js";
|
|
7
7
|
import {
|
|
8
8
|
codexHomeFrom,
|
|
9
9
|
resolvePathBinary
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EW52AGOV.js";
|
|
11
11
|
import {
|
|
12
12
|
HOOK_COMPATIBLE_PROFILES
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EDSXF7NV.js";
|
|
14
14
|
|
|
15
15
|
// src/hermes-config.ts
|
|
16
16
|
import { execFileSync } from "child_process";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
readGlobalUpgradeSubject,
|
|
6
6
|
upgradeInstalledPackage,
|
|
7
7
|
withUpgradeLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-PGULTXDJ.js";
|
|
9
|
+
import "./chunk-FQWI6XQG.js";
|
|
10
|
+
import "./chunk-2UABJ75E.js";
|
|
11
11
|
import "./chunk-POFBE6ZY.js";
|
|
12
12
|
import "./chunk-KZERVKTD.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-EW52AGOV.js";
|
|
14
14
|
import "./chunk-AQFEP65J.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-WN3MDHAM.js";
|
|
16
|
+
import "./chunk-EDSXF7NV.js";
|
|
17
17
|
export {
|
|
18
18
|
finishGlobalUpgrade,
|
|
19
19
|
finishUpgradeWithLock,
|
|
@@ -11,35 +11,34 @@ import {
|
|
|
11
11
|
reapplyOpenCodePlugin,
|
|
12
12
|
reapplyVsCodePlugin,
|
|
13
13
|
repairCodexHolds
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-MBB4XJIN.js";
|
|
15
|
+
import "./chunk-2ZD53EQW.js";
|
|
16
|
+
import "./chunk-VTF7LKDB.js";
|
|
17
|
+
import "./chunk-OI6YNNI5.js";
|
|
18
|
+
import "./chunk-EP4MD6TH.js";
|
|
19
|
+
import "./chunk-35TUEZ5E.js";
|
|
20
|
+
import "./chunk-NO3ADUD4.js";
|
|
21
|
+
import "./chunk-UCRG5QGN.js";
|
|
22
22
|
import "./chunk-GMXKITVA.js";
|
|
23
|
-
import "./chunk-XHKBHWLX.js";
|
|
24
23
|
import "./chunk-RIVNNBEK.js";
|
|
24
|
+
import "./chunk-XHKBHWLX.js";
|
|
25
25
|
import "./chunk-6ICPEJY5.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-GOEIW2VH.js";
|
|
26
|
+
import "./chunk-WYD4PYTL.js";
|
|
27
|
+
import "./chunk-NWZZTHWF.js";
|
|
28
|
+
import "./chunk-W7MXYDGP.js";
|
|
29
|
+
import "./chunk-UGXRDY3O.js";
|
|
31
30
|
import "./chunk-POFBE6ZY.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-FQW7AV6U.js";
|
|
32
|
+
import "./chunk-2X3PPRNC.js";
|
|
33
|
+
import "./chunk-KJNWVAS6.js";
|
|
34
|
+
import "./chunk-ULEX43F7.js";
|
|
36
35
|
import "./chunk-7QLSKOSU.js";
|
|
37
36
|
import "./chunk-KZERVKTD.js";
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-EW52AGOV.js";
|
|
39
38
|
import "./chunk-AQFEP65J.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-7XSIUY5F.js";
|
|
40
|
+
import "./chunk-WN3MDHAM.js";
|
|
41
|
+
import "./chunk-EDSXF7NV.js";
|
|
43
42
|
export {
|
|
44
43
|
ensureCodexTrustAfterReapply,
|
|
45
44
|
inspectConfiguredManagedProviders,
|
package/dist/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-ON2WCBIN.js";
|
|
4
|
+
import "../chunk-LNO25UX4.js";
|
|
5
|
+
import "../chunk-PZPYL65I.js";
|
|
6
|
+
import "../chunk-GQZF6DPL.js";
|
|
7
|
+
import "../chunk-OI6YNNI5.js";
|
|
8
|
+
import "../chunk-35TUEZ5E.js";
|
|
9
9
|
import {
|
|
10
10
|
fetchAccountPublicKey
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-2VNHP2OE.js";
|
|
12
12
|
import "../chunk-6ICPEJY5.js";
|
|
13
13
|
import {
|
|
14
14
|
fetchModeOverride,
|
|
@@ -18,32 +18,31 @@ import {
|
|
|
18
18
|
handlePostToolUse,
|
|
19
19
|
handleStop,
|
|
20
20
|
reportEvent
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-WYD4PYTL.js";
|
|
22
|
+
import "../chunk-NWZZTHWF.js";
|
|
23
|
+
import "../chunk-W7MXYDGP.js";
|
|
23
24
|
import {
|
|
24
25
|
askUser,
|
|
25
26
|
cancelQuestion,
|
|
26
27
|
waitForAnswer
|
|
27
|
-
} from "../chunk-
|
|
28
|
-
import "../chunk-M2L7625S.js";
|
|
29
|
-
import "../chunk-GOEIW2VH.js";
|
|
28
|
+
} from "../chunk-UGXRDY3O.js";
|
|
30
29
|
import "../chunk-POFBE6ZY.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-FQW7AV6U.js";
|
|
31
|
+
import "../chunk-2X3PPRNC.js";
|
|
32
|
+
import "../chunk-KJNWVAS6.js";
|
|
33
|
+
import "../chunk-ULEX43F7.js";
|
|
35
34
|
import "../chunk-7QLSKOSU.js";
|
|
36
35
|
import "../chunk-KZERVKTD.js";
|
|
37
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-EW52AGOV.js";
|
|
38
37
|
import "../chunk-AQFEP65J.js";
|
|
39
38
|
import {
|
|
40
39
|
getApiKey,
|
|
41
40
|
getBaseUrl
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import "../chunk-
|
|
41
|
+
} from "../chunk-7XSIUY5F.js";
|
|
42
|
+
import "../chunk-WN3MDHAM.js";
|
|
44
43
|
import {
|
|
45
44
|
resolvePolicy
|
|
46
|
-
} from "../chunk-
|
|
45
|
+
} from "../chunk-EDSXF7NV.js";
|
|
47
46
|
export {
|
|
48
47
|
askUser,
|
|
49
48
|
cancelQuestion,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
installWithUpgradeLock,
|
|
6
6
|
ownsUpgradeLock,
|
|
7
7
|
releaseAutoUpdateLock
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-FQWI6XQG.js";
|
|
9
|
+
import "./chunk-EW52AGOV.js";
|
|
10
10
|
import "./chunk-AQFEP65J.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-EDSXF7NV.js";
|
|
12
12
|
export {
|
|
13
13
|
claimUpgradeLock,
|
|
14
14
|
finishWithUpgradeLock,
|