pushary 1.9.64 → 1.9.66
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 +18 -1
- package/dist/{api-HDLTZTVR.js → api-GDSVUTI2.js} +12 -10
- package/dist/bin/pushary-bell-hook.js +25 -27
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +26 -28
- package/dist/bin/pushary-clean.js +39 -36
- package/dist/bin/pushary-codex-bridge.js +21 -22
- package/dist/bin/pushary-codex-hook.js +30 -32
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +25 -26
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +37 -39
- package/dist/bin/pushary-disconnect.js +25 -26
- package/dist/bin/pushary-doctor.js +66 -44
- package/dist/bin/pushary-elicitation-hook.js +25 -27
- package/dist/bin/pushary-gemini-bridge.js +15 -16
- package/dist/bin/pushary-gemini-hook.js +27 -29
- package/dist/bin/pushary-hook.js +29 -31
- package/dist/bin/pushary-login.js +19 -19
- package/dist/bin/pushary-logout.js +25 -26
- package/dist/bin/pushary-mcp.js +11 -11
- package/dist/bin/pushary-mode.js +14 -14
- package/dist/bin/pushary-notification-hook.js +24 -26
- package/dist/bin/pushary-opencode-hook.js +26 -28
- package/dist/bin/pushary-permission-denied-hook.js +29 -31
- package/dist/bin/pushary-permission-hook.js +32 -31
- package/dist/bin/pushary-post-hook.js +24 -26
- package/dist/bin/pushary-prompt-hook.js +24 -26
- package/dist/bin/pushary-session-end-hook.js +26 -28
- package/dist/bin/pushary-session-start-hook.js +33 -35
- package/dist/bin/pushary-setup.js +68 -54
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +30 -31
- package/dist/bin/pushary-stop-hook.js +24 -26
- package/dist/bin/pushary-stopfailure-hook.js +24 -26
- package/dist/bin/pushary-suggestions.js +14 -14
- package/dist/bin/pushary-transcript-register.js +16 -18
- package/dist/bin/pushary-transcripts.js +17 -17
- package/dist/bin/pushary-upgrade.js +37 -38
- package/dist/bin/pushary-wait.js +14 -14
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-7UBDBJTG.js → chunk-26W46E46.js} +4 -4
- package/dist/{chunk-MIPJ2VXP.js → chunk-2BL6KWN7.js} +9 -9
- package/dist/{chunk-42PD2MQH.js → chunk-32ZT2ATY.js} +5 -5
- package/dist/{chunk-2EY4HGLG.js → chunk-376TUN72.js} +3 -3
- package/dist/{chunk-A5KQXZR7.js → chunk-3ELJIG2R.js} +3 -3
- package/dist/{chunk-ML2Q6WWE.js → chunk-3EZP5ZPS.js} +5 -4
- package/dist/{chunk-66FRMK7V.js → chunk-3FQX74E4.js} +3 -3
- package/dist/{chunk-HVOQUPSO.js → chunk-45KMS76L.js} +1 -1
- package/dist/{chunk-LA7CKRZN.js → chunk-4APD2DPI.js} +2 -2
- package/dist/{chunk-5NP3OJ5P.js → chunk-57NTMVMI.js} +6 -6
- package/dist/{chunk-NYV45Q25.js → chunk-5FJDODOA.js} +3 -3
- package/dist/{chunk-RY4EPMZX.js → chunk-5J7OZBJ4.js} +2 -2
- package/dist/{chunk-XJIIU36L.js → chunk-6BGVSV2Q.js} +1 -1
- package/dist/{chunk-2YXBCZ3Z.js → chunk-6RJZSBPD.js} +1 -1
- package/dist/{chunk-MPPTIZ2G.js → chunk-6ZXCWK27.js} +5 -5
- package/dist/{chunk-VNRWQCGU.js → chunk-7LK3Y6ET.js} +63 -6
- package/dist/{chunk-Y64JGYTB.js → chunk-A47UKPC7.js} +1 -1
- package/dist/{chunk-5TNGBDIE.js → chunk-AVWECJSN.js} +2 -2
- package/dist/{chunk-CCNH4PJ2.js → chunk-AWGBL4P3.js} +211 -24
- package/dist/{chunk-LMC5UPL7.js → chunk-B6JC676X.js} +1 -1
- package/dist/{chunk-QPPBH5NY.js → chunk-CN6JFM62.js} +5 -5
- package/dist/{chunk-BLAIETMP.js → chunk-CNJ7SI5V.js} +4 -4
- package/dist/{chunk-DVYVGBPB.js → chunk-DBUHSUL7.js} +1 -1
- package/dist/{chunk-CJADXAJU.js → chunk-DIUTSF6I.js} +4 -4
- package/dist/{chunk-JX3DHGZX.js → chunk-DKMVVBXO.js} +30 -17
- package/dist/{chunk-2CEVEMJE.js → chunk-DPU6H4JY.js} +3 -3
- package/dist/{chunk-MNKIR2ZB.js → chunk-EJR5JXMV.js} +24 -1
- package/dist/{chunk-VHKK3US3.js → chunk-EU2ZOZC3.js} +3 -3
- package/dist/{chunk-AN7C3CHH.js → chunk-G6VJZ3RB.js} +1 -1
- package/dist/{chunk-H4BKC2GN.js → chunk-GDLT32I4.js} +3 -3
- package/dist/{chunk-EEM65CGJ.js → chunk-GECU7V44.js} +3 -3
- package/dist/{chunk-BAGBCSXA.js → chunk-GO7YKPT3.js} +1 -1
- package/dist/{chunk-QECRQWLV.js → chunk-GWYCKTXS.js} +5 -5
- package/dist/{chunk-2PKHGHMA.js → chunk-HUGVJBDN.js} +2 -2
- package/dist/{chunk-ADRPW7KU.js → chunk-IA5VWIHV.js} +2 -2
- package/dist/{chunk-6HPLEGUP.js → chunk-IGO3AGZK.js} +4 -4
- package/dist/{chunk-PMLQRB3D.js → chunk-IQ3GKPFM.js} +1 -1
- package/dist/{chunk-LV6DX4P6.js → chunk-JL3SZJJP.js} +2 -2
- package/dist/{chunk-BSZIPIFA.js → chunk-KS3O6O7E.js} +3 -3
- package/dist/{chunk-IZTDX2MX.js → chunk-MDIGG3Q7.js} +3 -3
- package/dist/{chunk-JTOBQUIL.js → chunk-MNNQEUQC.js} +3 -3
- package/dist/{chunk-2KID4FK4.js → chunk-Q5RNYE2L.js} +4 -4
- package/dist/{chunk-KX3RMF6T.js → chunk-QBNICXMC.js} +6 -6
- package/dist/{chunk-YUDZCJYC.js → chunk-QN25WBXL.js} +9 -7
- package/dist/{chunk-NUEPJ5W6.js → chunk-QOIPUYUD.js} +3 -5
- package/dist/{chunk-QNATBOUH.js → chunk-QR2QWGQI.js} +3 -3
- package/dist/{chunk-NOH3EJFH.js → chunk-R7C2FS33.js} +1 -1
- package/dist/{chunk-MXPOLQZH.js → chunk-RJ6JEHCP.js} +1 -1
- package/dist/{chunk-E2LB6JNV.js → chunk-RSZQEEEW.js} +7 -6
- package/dist/{chunk-57PU5OBL.js → chunk-SVKCYUYP.js} +11 -13
- package/dist/{chunk-DCMRNIDM.js → chunk-T6YLXO6N.js} +4 -4
- package/dist/{chunk-Q6ID23SU.js → chunk-TQNFDNJA.js} +6 -6
- package/dist/{chunk-SROWUG5W.js → chunk-UTAARXYQ.js} +1 -1
- package/dist/{chunk-OQKSF5ST.js → chunk-V3YBVOTZ.js} +2 -2
- package/dist/{chunk-XF3AWNMO.js → chunk-V4EOFOB2.js} +6 -6
- package/dist/{chunk-PLMX3IHG.js → chunk-VURDLVAQ.js} +3 -3
- package/dist/{chunk-AQAPPSDV.js → chunk-XDDSURY3.js} +3 -3
- package/dist/{chunk-QSW3HAKI.js → chunk-XEXF2OFZ.js} +61 -2
- package/dist/{chunk-2Z7I7DHT.js → chunk-XFQAK35L.js} +1 -1
- package/dist/{chunk-5TUDGSDC.js → chunk-XGFFNERF.js} +1 -1
- package/dist/{chunk-2VADJ6JH.js → chunk-XIJTXRWB.js} +2 -2
- package/dist/{chunk-3KXBRSL3.js → chunk-XXIJBYNW.js} +1 -1
- package/dist/{chunk-O7PCNYEY.js → chunk-YB3HMDKE.js} +2 -2
- package/dist/{chunk-KA7JIMTG.js → chunk-YQDCTID4.js} +115 -9
- package/dist/{chunk-E23RKH3T.js → chunk-ZAZUDYSF.js} +26 -12
- package/dist/{chunk-TR3GP5MH.js → chunk-ZJV7SFIJ.js} +1 -1
- package/dist/{codex-app-cards-switch-JQ6356VX.js → codex-app-cards-switch-W7OLKOMO.js} +11 -11
- package/dist/{codex-desktop-launch-YUB2LOAG.js → codex-desktop-launch-U6V3AXZF.js} +1 -1
- package/dist/{codex-session-launch-UKMAORXS.js → codex-session-launch-EFU46WBL.js} +18 -19
- package/dist/{config-YY54G3CC.js → config-UC4LMCNX.js} +3 -3
- package/dist/{global-upgrade-Y4USGPS2.js → global-upgrade-ABF5O3HU.js} +10 -10
- package/dist/{identity-W5CYL5RC.js → identity-3ZUZPHN6.js} +4 -4
- package/dist/{live-capabilities-JRNNA5EP.js → live-capabilities-BXWXJARK.js} +5 -5
- package/dist/{paths-4MEBINV3.js → paths-FO76CFRQ.js} +3 -3
- package/dist/{reapply-ZN7C3CB3.js → reapply-3T3DFUAI.js} +26 -27
- package/dist/src/index.js +30 -20
- package/dist/{upgrade-lock-QAWUV2DO.js → upgrade-lock-EZ5JIPJE.js} +4 -4
- package/dist/{usage-43C2DHDU.js → usage-Y6BL7RUD.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-6QPDBD7Q.js +0 -118
- package/dist/chunk-TJUJAK5L.js +0 -62
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GDLT32I4.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
7
|
writeJsonAtomic
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KS3O6O7E.js";
|
|
9
9
|
|
|
10
10
|
// src/upgrade-lock.ts
|
|
11
11
|
import { fork } from "child_process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
announceSubscriptionRequired,
|
|
3
3
|
isDeferAnswer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZJV7SFIJ.js";
|
|
5
5
|
import {
|
|
6
6
|
AUTO_DECISION_WINDOW_MS,
|
|
7
7
|
DEFAULT_SESSION,
|
|
@@ -10,19 +10,19 @@ import {
|
|
|
10
10
|
permissionDeniedAction,
|
|
11
11
|
releaseThrottle,
|
|
12
12
|
reportEvent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2BL6KWN7.js";
|
|
14
14
|
import {
|
|
15
15
|
askUser,
|
|
16
16
|
isDecisionStopped,
|
|
17
17
|
isQuestionLimitRefusal,
|
|
18
18
|
waitForQuestion
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZAZUDYSF.js";
|
|
20
20
|
import {
|
|
21
21
|
SubscriptionRequiredError
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Q5RNYE2L.js";
|
|
23
23
|
import {
|
|
24
24
|
getMachineId
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IA5VWIHV.js";
|
|
26
26
|
import {
|
|
27
27
|
ASK_CONTEXT_MAX,
|
|
28
28
|
agentQuestionContext,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
questionsShownAsASet,
|
|
35
35
|
shouldDeferToNativeMode,
|
|
36
36
|
wireVerdictFor
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-EJR5JXMV.js";
|
|
38
38
|
|
|
39
39
|
// src/machine-decision-audit.ts
|
|
40
40
|
import { basename } from "path";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GDLT32I4.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KS3O6O7E.js";
|
|
11
11
|
import {
|
|
12
12
|
CLI_PACKAGE_NAMES,
|
|
13
13
|
POSIX_GLOBAL_ROOT_SEGMENTS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-QTOLNRET.js";
|
|
18
18
|
import {
|
|
19
19
|
isAutoUpdateResult
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EJR5JXMV.js";
|
|
21
21
|
|
|
22
22
|
// src/auto-update.ts
|
|
23
23
|
import { spawn } from "child_process";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GDLT32I4.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe,
|
|
6
6
|
writeFileAtomic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KS3O6O7E.js";
|
|
8
8
|
import {
|
|
9
9
|
DECLINED_AGENTS_FILE,
|
|
10
10
|
DISCONNECT_AGENT_IDS,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
serializeDeclinedAgents,
|
|
14
14
|
withDeclinedAgent,
|
|
15
15
|
withoutDeclinedAgent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EJR5JXMV.js";
|
|
17
17
|
|
|
18
18
|
// src/declined-agents-file.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -1,7 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getBaseUrl
|
|
3
|
+
} from "./chunk-A47UKPC7.js";
|
|
1
4
|
import {
|
|
2
5
|
compressTranscriptRecord,
|
|
3
6
|
redactSecretsFromContent
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EJR5JXMV.js";
|
|
8
|
+
|
|
9
|
+
// src/transcript-api.ts
|
|
10
|
+
var fetchTranscriptRecipients = async (apiKey, baseUrl = getBaseUrl()) => {
|
|
11
|
+
try {
|
|
12
|
+
const res = await fetch(`${baseUrl}/api/agent/encryption-account`, {
|
|
13
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
14
|
+
signal: AbortSignal.timeout(5e3)
|
|
15
|
+
});
|
|
16
|
+
if (!res.ok) return null;
|
|
17
|
+
const data = await res.json();
|
|
18
|
+
if (typeof data.publicKey !== "string" || data.publicKey.length === 0) return null;
|
|
19
|
+
const phoneReadsCompressedRecords = data.readsCompressedRecords === true;
|
|
20
|
+
if (data.providerRecovery === void 0 || data.providerRecovery === null) {
|
|
21
|
+
return { phonePublicKey: data.publicKey, phoneReadsCompressedRecords, provider: null };
|
|
22
|
+
}
|
|
23
|
+
if (typeof data.providerRecovery !== "object") return null;
|
|
24
|
+
const provider = data.providerRecovery;
|
|
25
|
+
if (typeof provider.required !== "boolean" || typeof provider.keyId !== "string" || provider.keyId.length === 0 || typeof provider.publicKey !== "string" || provider.publicKey.length === 0) return null;
|
|
26
|
+
return {
|
|
27
|
+
phonePublicKey: data.publicKey,
|
|
28
|
+
phoneReadsCompressedRecords,
|
|
29
|
+
provider: { required: provider.required, keyId: provider.keyId, publicKey: provider.publicKey }
|
|
30
|
+
};
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var fetchAccountPublicKey = async (apiKey, baseUrl = getBaseUrl()) => (await fetchTranscriptRecipients(apiKey, baseUrl))?.phonePublicKey ?? null;
|
|
36
|
+
var uploadTranscriptRecords = async (apiKey, params, baseUrl = getBaseUrl()) => {
|
|
37
|
+
try {
|
|
38
|
+
const res = await fetch(`${baseUrl}/api/agent/transcript`, {
|
|
39
|
+
method: "POST",
|
|
40
|
+
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
|
|
41
|
+
body: JSON.stringify(params),
|
|
42
|
+
signal: AbortSignal.timeout(15e3)
|
|
43
|
+
});
|
|
44
|
+
const body = await res.json().catch(() => null);
|
|
45
|
+
const keyRegistered = body?.keyRegistered === true;
|
|
46
|
+
const keyConflict = body?.keyConflict === true;
|
|
47
|
+
const keyUnavailable = res.status === 503;
|
|
48
|
+
const ids = (value) => Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
49
|
+
return {
|
|
50
|
+
ok: res.ok && !keyConflict && (params.dataEncryptionKey === void 0 || keyRegistered),
|
|
51
|
+
keyRegistered,
|
|
52
|
+
keyConflict,
|
|
53
|
+
keyUnavailable,
|
|
54
|
+
settledIds: Array.isArray(body?.settledIds) ? ids(body.settledIds) : null,
|
|
55
|
+
rejectedIds: ids(body?.rejectedIds)
|
|
56
|
+
};
|
|
57
|
+
} catch {
|
|
58
|
+
return { ok: false, keyRegistered: false, keyConflict: false, keyUnavailable: false, settledIds: null, rejectedIds: [] };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
5
61
|
|
|
6
62
|
// src/crypto.ts
|
|
7
63
|
import nacl from "tweetnacl";
|
|
@@ -164,5 +220,8 @@ export {
|
|
|
164
220
|
wrapSessionKey,
|
|
165
221
|
encryptRecord,
|
|
166
222
|
recordSealerFor,
|
|
167
|
-
buildTranscriptRecords
|
|
223
|
+
buildTranscriptRecords,
|
|
224
|
+
fetchTranscriptRecipients,
|
|
225
|
+
fetchAccountPublicKey,
|
|
226
|
+
uploadTranscriptRecords
|
|
168
227
|
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
keyPrefix,
|
|
5
5
|
readConfigFileKey,
|
|
6
6
|
readMacAppKeyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CNJ7SI5V.js";
|
|
8
8
|
import {
|
|
9
9
|
NPX_LATEST_COMMAND
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GO7YKPT3.js";
|
|
11
11
|
|
|
12
12
|
// src/key-signed-out.ts
|
|
13
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GEMINI_HOOK_EVENTS,
|
|
3
|
-
hasGeminiHooks
|
|
4
|
-
} from "./chunk-6QPDBD7Q.js";
|
|
5
1
|
import {
|
|
6
2
|
AGENT_CHOICES
|
|
7
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTAARXYQ.js";
|
|
8
4
|
import {
|
|
9
5
|
BELL_HOOK_BINARY
|
|
10
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IQ3GKPFM.js";
|
|
11
7
|
import {
|
|
12
8
|
CLAUDE_HOOK_EVENTS,
|
|
13
9
|
CODEX_HOOK_EVENTS,
|
|
14
10
|
HOOK_SHELL,
|
|
15
11
|
hasCodexHooks,
|
|
16
|
-
holdBudgetOf
|
|
17
|
-
|
|
12
|
+
holdBudgetOf,
|
|
13
|
+
isProtectedByScope,
|
|
14
|
+
registerHookEntry
|
|
15
|
+
} from "./chunk-GDLT32I4.js";
|
|
18
16
|
import {
|
|
19
17
|
CURSOR_GATE_EVENTS,
|
|
18
|
+
HOOK_BUDGETS,
|
|
20
19
|
HOOK_LOCATOR_BINARY,
|
|
21
20
|
hookCommandHoldBudget
|
|
22
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-EJR5JXMV.js";
|
|
23
22
|
|
|
24
23
|
// src/diagnostics/bridge.ts
|
|
25
24
|
import { execFileSync } from "child_process";
|
|
@@ -97,6 +96,105 @@ var liveBridgeProbe = () => ({
|
|
|
97
96
|
home: homedir()
|
|
98
97
|
});
|
|
99
98
|
|
|
99
|
+
// src/gemini-config.ts
|
|
100
|
+
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
101
|
+
var GEMINI_MCP_URL = "https://pushary.com/api/mcp/mcp";
|
|
102
|
+
var GEMINI_HOOK_EVENTS = [
|
|
103
|
+
{ event: "BeforeTool", matcher: "run_shell_command|write_file|replace|mcp_.*", delivery: "approval", timeoutMs: HOOK_BUDGETS.gemini.budgetSeconds * 1e3 },
|
|
104
|
+
{ event: "AfterTool", matcher: "run_shell_command|write_file|replace|mcp_.*", delivery: "telemetry", timeoutMs: 1e4 },
|
|
105
|
+
{ event: "BeforeAgent", delivery: "telemetry", timeoutMs: 1e4 },
|
|
106
|
+
{ event: "AfterAgent", delivery: "telemetry", timeoutMs: 1e4 },
|
|
107
|
+
{ event: "SessionStart", delivery: "telemetry", timeoutMs: 1e4 },
|
|
108
|
+
{ event: "SessionEnd", delivery: "telemetry", timeoutMs: 1e4 }
|
|
109
|
+
];
|
|
110
|
+
var asRecord = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
111
|
+
var ensureRecord = (target, key) => {
|
|
112
|
+
const existing = asRecord(target[key]);
|
|
113
|
+
if (existing) return existing;
|
|
114
|
+
const created = {};
|
|
115
|
+
target[key] = created;
|
|
116
|
+
return created;
|
|
117
|
+
};
|
|
118
|
+
var isPusharyGeminiHook = (entry, scope) => {
|
|
119
|
+
const hooks = asRecord(entry)?.hooks;
|
|
120
|
+
if (!Array.isArray(hooks)) return false;
|
|
121
|
+
return hooks.some((hook) => {
|
|
122
|
+
const command = String(asRecord(hook)?.command ?? "");
|
|
123
|
+
if (isProtectedByScope(command, scope)) return false;
|
|
124
|
+
return command.includes(GEMINI_HOOK_BINARY) || command.includes(HOOK_LOCATOR_BINARY);
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
var addGeminiMcpServer = (settings, apiKey) => {
|
|
128
|
+
const mcpServers = ensureRecord(settings, "mcpServers");
|
|
129
|
+
mcpServers.pushary = {
|
|
130
|
+
httpUrl: GEMINI_MCP_URL,
|
|
131
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
132
|
+
trust: true
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
var addGeminiHooks = (settings, command) => {
|
|
136
|
+
const hooks = ensureRecord(settings, "hooks");
|
|
137
|
+
for (const definition of GEMINI_HOOK_EVENTS) {
|
|
138
|
+
const existing = Array.isArray(hooks[definition.event]) ? hooks[definition.event] : [];
|
|
139
|
+
hooks[definition.event] = registerHookEntry(existing, isPusharyGeminiHook, {
|
|
140
|
+
...definition.matcher ? { matcher: definition.matcher } : {},
|
|
141
|
+
hooks: [{
|
|
142
|
+
name: "pushary",
|
|
143
|
+
type: "command",
|
|
144
|
+
command,
|
|
145
|
+
timeout: definition.timeoutMs
|
|
146
|
+
}]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
var removeGeminiHooks = (settings, scope) => {
|
|
151
|
+
const hooks = asRecord(settings.hooks);
|
|
152
|
+
if (!hooks) return false;
|
|
153
|
+
let changed = false;
|
|
154
|
+
for (const definition of GEMINI_HOOK_EVENTS) {
|
|
155
|
+
const entries = hooks[definition.event];
|
|
156
|
+
if (!Array.isArray(entries)) continue;
|
|
157
|
+
const filtered = entries.filter((entry) => !isPusharyGeminiHook(entry, scope));
|
|
158
|
+
if (filtered.length !== entries.length) {
|
|
159
|
+
if (filtered.length === 0) {
|
|
160
|
+
delete hooks[definition.event];
|
|
161
|
+
} else {
|
|
162
|
+
hooks[definition.event] = filtered;
|
|
163
|
+
}
|
|
164
|
+
changed = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (Object.keys(hooks).length === 0) delete settings.hooks;
|
|
168
|
+
return changed;
|
|
169
|
+
};
|
|
170
|
+
var removeGeminiMcpServer = (settings) => {
|
|
171
|
+
const mcpServers = asRecord(settings.mcpServers);
|
|
172
|
+
if (!mcpServers?.pushary) return false;
|
|
173
|
+
delete mcpServers.pushary;
|
|
174
|
+
if (Object.keys(mcpServers).length === 0) delete settings.mcpServers;
|
|
175
|
+
return true;
|
|
176
|
+
};
|
|
177
|
+
var removeGeminiSettings = (settings, scope) => {
|
|
178
|
+
const mcpRemoved = scope?.keepMcpServer === true ? false : removeGeminiMcpServer(settings);
|
|
179
|
+
const hooksRemoved = removeGeminiHooks(settings, scope);
|
|
180
|
+
return mcpRemoved || hooksRemoved;
|
|
181
|
+
};
|
|
182
|
+
var hasGeminiHooks = (settings) => {
|
|
183
|
+
const hooks = asRecord(settings.hooks);
|
|
184
|
+
if (!hooks) return false;
|
|
185
|
+
return GEMINI_HOOK_EVENTS.some((definition) => {
|
|
186
|
+
const entries = hooks[definition.event];
|
|
187
|
+
return Array.isArray(entries) && entries.some((entry) => isPusharyGeminiHook(entry));
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
var missingGeminiHookEvents = (settings) => {
|
|
191
|
+
const hooks = asRecord(settings.hooks);
|
|
192
|
+
return GEMINI_HOOK_EVENTS.filter((definition) => {
|
|
193
|
+
const entries = hooks?.[definition.event];
|
|
194
|
+
return !Array.isArray(entries) || !entries.some((entry) => isPusharyGeminiHook(entry));
|
|
195
|
+
}).map((definition) => definition.event);
|
|
196
|
+
};
|
|
197
|
+
|
|
100
198
|
// src/diagnostics/wiring.ts
|
|
101
199
|
var record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
102
200
|
var CLAUDE_HOOK_BINARY = /pushary-[a-z-]*hook/;
|
|
@@ -326,6 +424,14 @@ export {
|
|
|
326
424
|
describeBridgeResolution,
|
|
327
425
|
isBridgeLocator,
|
|
328
426
|
liveBridgeProbe,
|
|
427
|
+
GEMINI_HOOK_BINARY,
|
|
428
|
+
GEMINI_HOOK_EVENTS,
|
|
429
|
+
addGeminiMcpServer,
|
|
430
|
+
addGeminiHooks,
|
|
431
|
+
removeGeminiMcpServer,
|
|
432
|
+
removeGeminiSettings,
|
|
433
|
+
hasGeminiHooks,
|
|
434
|
+
missingGeminiHookEvents,
|
|
329
435
|
pusharyHookExecutable,
|
|
330
436
|
claudeWired,
|
|
331
437
|
codexWired,
|
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
McpToolError,
|
|
7
7
|
SubscriptionRequiredError,
|
|
8
8
|
callMcpTool
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Q5RNYE2L.js";
|
|
10
10
|
import {
|
|
11
11
|
installNetworkDefaults,
|
|
12
12
|
isNetworkFailure
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GECU7V44.js";
|
|
14
14
|
import {
|
|
15
15
|
clientReportClaims
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GDLT32I4.js";
|
|
17
17
|
import {
|
|
18
18
|
getApiKey,
|
|
19
19
|
getBaseUrl
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A47UKPC7.js";
|
|
21
21
|
import {
|
|
22
22
|
ASK_AGENT_NAME_MAX,
|
|
23
23
|
CLIENT_REPORT_PATH,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
TOOL_FAILURE_CODES,
|
|
27
27
|
degradedLine,
|
|
28
28
|
truncateLine
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-EJR5JXMV.js";
|
|
30
30
|
|
|
31
31
|
// src/api.ts
|
|
32
32
|
import { randomUUID } from "crypto";
|
|
@@ -235,25 +235,38 @@ var nextLongPollMs = (deadlineMs, nowMs) => {
|
|
|
235
235
|
const hold = Math.min(deadlineMs - nowMs - WAIT_RESPONSE_GRACE_MS, MAX_LONG_POLL_MS);
|
|
236
236
|
return hold >= MIN_LONG_POLL_MS ? hold : null;
|
|
237
237
|
};
|
|
238
|
-
var
|
|
239
|
-
|
|
238
|
+
var ABANDONED_WAIT = { answered: false, status: "abandoned" };
|
|
239
|
+
var sleepUnlessAborted = (ms, signal) => new Promise((resolve) => {
|
|
240
|
+
const wake = () => {
|
|
241
|
+
clearTimeout(timer);
|
|
242
|
+
signal?.removeEventListener("abort", wake);
|
|
243
|
+
resolve();
|
|
244
|
+
};
|
|
245
|
+
const timer = setTimeout(wake, ms);
|
|
246
|
+
signal?.addEventListener("abort", wake, { once: true });
|
|
247
|
+
});
|
|
248
|
+
var boundedBy = (timeoutMs, signal) => signal ? AbortSignal.any([AbortSignal.timeout(timeoutMs), signal]) : AbortSignal.timeout(timeoutMs);
|
|
249
|
+
var pollForAnswer = async (apiKey, correlationId, deadlineMs, pollInterval = 2e3, signal) => {
|
|
240
250
|
while (Date.now() < deadlineMs) {
|
|
251
|
+
if (signal?.aborted) return ABANDONED_WAIT;
|
|
241
252
|
const hold = nextLongPollMs(deadlineMs, Date.now());
|
|
242
253
|
if (hold === null) {
|
|
243
|
-
await
|
|
254
|
+
await sleepUnlessAborted(Math.max(0, deadlineMs - Date.now()), signal);
|
|
244
255
|
continue;
|
|
245
256
|
}
|
|
246
257
|
let answer;
|
|
247
258
|
try {
|
|
248
|
-
answer = await waitForAnswer(apiKey, correlationId, hold,
|
|
259
|
+
answer = await waitForAnswer(apiKey, correlationId, hold, boundedBy(Math.max(1, deadlineMs - Date.now()), signal));
|
|
249
260
|
} catch {
|
|
261
|
+
if (signal?.aborted) return ABANDONED_WAIT;
|
|
250
262
|
const late = await withdrawQuestion(apiKey, correlationId);
|
|
251
263
|
return late.answered ? late : STOPPED;
|
|
252
264
|
}
|
|
253
265
|
if (isDecisionStopped(answer) || answer.answered) return answer;
|
|
254
266
|
if (answer.status === "expired") return STOPPED;
|
|
255
|
-
await
|
|
267
|
+
await sleepUnlessAborted(Math.min(pollInterval, Math.max(0, deadlineMs - Date.now())), signal);
|
|
256
268
|
}
|
|
269
|
+
if (signal?.aborted) return ABANDONED_WAIT;
|
|
257
270
|
return withdrawQuestion(apiKey, correlationId);
|
|
258
271
|
};
|
|
259
272
|
var cancelQuestion = async (apiKey, correlationId, signal, baseUrl) => {
|
|
@@ -271,10 +284,10 @@ var withdrawQuestion = async (apiKey, correlationId, transport = { cancelQuestio
|
|
|
271
284
|
return STOPPED;
|
|
272
285
|
}
|
|
273
286
|
};
|
|
274
|
-
var waitForQuestion = async (apiKey, question, deadlineMs, pollInterval = 2e3) => {
|
|
287
|
+
var waitForQuestion = async (apiKey, question, deadlineMs, pollInterval = 2e3, signal) => {
|
|
275
288
|
if (isDecisionStopped(question) || question.answered) return { ...question, answered: !!question.answered };
|
|
276
289
|
if (question.status === "expired") return STOPPED;
|
|
277
|
-
return isAwayPaused(question) || isLocalQuestionHandoff(question) ? withdrawQuestion(apiKey, question.correlationId) : pollForAnswer(apiKey, question.correlationId, deadlineMs, pollInterval);
|
|
290
|
+
return isAwayPaused(question) || isLocalQuestionHandoff(question) ? withdrawQuestion(apiKey, question.correlationId) : pollForAnswer(apiKey, question.correlationId, deadlineMs, pollInterval, signal);
|
|
278
291
|
};
|
|
279
292
|
var sendNotification = async (apiKey, params, timeoutMs = 15e3, signal) => {
|
|
280
293
|
await callMcpTool(apiKey, "send_notification", { ...params }, { maxRetries: signal ? 1 : 3, timeoutMs, signal });
|
|
@@ -328,6 +341,7 @@ export {
|
|
|
328
341
|
waitForAnswer,
|
|
329
342
|
WAIT_RESPONSE_GRACE_MS,
|
|
330
343
|
nextLongPollMs,
|
|
344
|
+
ABANDONED_WAIT,
|
|
331
345
|
pollForAnswer,
|
|
332
346
|
cancelQuestion,
|
|
333
347
|
withdrawQuestion,
|
|
@@ -22,22 +22,22 @@ import {
|
|
|
22
22
|
turnCodexAppCardsOff,
|
|
23
23
|
turnCodexAppCardsOn,
|
|
24
24
|
whyLaunchctlFailed
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-DPU6H4JY.js";
|
|
26
|
+
import "./chunk-AVWECJSN.js";
|
|
27
27
|
import "./chunk-XCEN33UP.js";
|
|
28
28
|
import "./chunk-QCGNGEGE.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-57NTMVMI.js";
|
|
30
30
|
import "./chunk-XHKBHWLX.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-CNJ7SI5V.js";
|
|
32
32
|
import "./chunk-E46NE7FB.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-IA5VWIHV.js";
|
|
34
|
+
import "./chunk-XIJTXRWB.js";
|
|
35
|
+
import "./chunk-GDLT32I4.js";
|
|
36
|
+
import "./chunk-KS3O6O7E.js";
|
|
37
|
+
import "./chunk-A47UKPC7.js";
|
|
38
|
+
import "./chunk-GO7YKPT3.js";
|
|
39
39
|
import "./chunk-QTOLNRET.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-EJR5JXMV.js";
|
|
41
41
|
import "./chunk-MLKGABMK.js";
|
|
42
42
|
export {
|
|
43
43
|
CODEX_APP_CARDS_DIRECTORY,
|
|
@@ -11,34 +11,33 @@ import {
|
|
|
11
11
|
isCodexQuestionLeftWithTheLocalClient,
|
|
12
12
|
planCodexElicitation,
|
|
13
13
|
reportOwnedQuestion
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-TJUJAK5L.js";
|
|
14
|
+
} from "./chunk-TQNFDNJA.js";
|
|
15
|
+
import "./chunk-QOIPUYUD.js";
|
|
16
|
+
import "./chunk-T6YLXO6N.js";
|
|
17
|
+
import "./chunk-MDIGG3Q7.js";
|
|
18
|
+
import "./chunk-3ELJIG2R.js";
|
|
19
|
+
import "./chunk-RJ6JEHCP.js";
|
|
20
|
+
import "./chunk-XEXF2OFZ.js";
|
|
22
21
|
import "./chunk-XHKBHWLX.js";
|
|
23
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-XXIJBYNW.js";
|
|
24
23
|
import {
|
|
25
24
|
writeDegraded
|
|
26
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZAZUDYSF.js";
|
|
27
26
|
import "./chunk-POFBE6ZY.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-Q5RNYE2L.js";
|
|
28
|
+
import "./chunk-QR2QWGQI.js";
|
|
29
|
+
import "./chunk-GECU7V44.js";
|
|
30
|
+
import "./chunk-IA5VWIHV.js";
|
|
32
31
|
import "./chunk-PPY5N2E6.js";
|
|
33
32
|
import "./chunk-KZERVKTD.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-GDLT32I4.js";
|
|
34
|
+
import "./chunk-KS3O6O7E.js";
|
|
35
|
+
import "./chunk-A47UKPC7.js";
|
|
36
|
+
import "./chunk-GO7YKPT3.js";
|
|
38
37
|
import "./chunk-QTOLNRET.js";
|
|
39
38
|
import {
|
|
40
39
|
canonicalJsonText
|
|
41
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-EJR5JXMV.js";
|
|
42
41
|
import "./chunk-MLKGABMK.js";
|
|
43
42
|
|
|
44
43
|
// src/codex-session-launch.ts
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
getApiKey,
|
|
4
4
|
getBaseUrl,
|
|
5
5
|
resetKeyDriftWarning
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-A47UKPC7.js";
|
|
7
|
+
import "./chunk-GO7YKPT3.js";
|
|
8
|
+
import "./chunk-EJR5JXMV.js";
|
|
9
9
|
import "./chunk-MLKGABMK.js";
|
|
10
10
|
export {
|
|
11
11
|
configFilePath,
|
|
@@ -7,19 +7,19 @@ import {
|
|
|
7
7
|
recordUnfinishedUpgrade,
|
|
8
8
|
upgradeInstalledPackage,
|
|
9
9
|
withUpgradeLock
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-RSZQEEEW.js";
|
|
11
|
+
import "./chunk-V3YBVOTZ.js";
|
|
12
|
+
import "./chunk-T6YLXO6N.js";
|
|
13
|
+
import "./chunk-MDIGG3Q7.js";
|
|
14
|
+
import "./chunk-RJ6JEHCP.js";
|
|
15
|
+
import "./chunk-VURDLVAQ.js";
|
|
16
16
|
import "./chunk-POFBE6ZY.js";
|
|
17
17
|
import "./chunk-KZERVKTD.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-GDLT32I4.js";
|
|
19
|
+
import "./chunk-KS3O6O7E.js";
|
|
20
|
+
import "./chunk-GO7YKPT3.js";
|
|
21
21
|
import "./chunk-QTOLNRET.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-EJR5JXMV.js";
|
|
23
23
|
import "./chunk-MLKGABMK.js";
|
|
24
24
|
export {
|
|
25
25
|
finishGlobalUpgrade,
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getMachineId,
|
|
3
3
|
getOrCreateMachineId,
|
|
4
4
|
readExistingMachineId
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-IA5VWIHV.js";
|
|
6
|
+
import "./chunk-GDLT32I4.js";
|
|
7
|
+
import "./chunk-KS3O6O7E.js";
|
|
8
8
|
import "./chunk-QTOLNRET.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-EJR5JXMV.js";
|
|
10
10
|
import "./chunk-MLKGABMK.js";
|
|
11
11
|
export {
|
|
12
12
|
getMachineId,
|