pushary 1.9.118 → 1.9.120
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 +16 -0
- package/data/cursor-plugin/scripts/pushary-gate.mjs +13 -2
- package/data/vscode-plugin/scripts/pushary-gate.mjs +12 -1
- package/dist/{api-Q2HBBRLT.js → api-QFUMNTEQ.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +27 -27
- package/dist/bin/pushary-bell.js +10 -10
- package/dist/bin/pushary-claude.js +25 -25
- package/dist/bin/pushary-clean.js +34 -34
- package/dist/bin/pushary-codex-bridge.js +21 -21
- package/dist/bin/pushary-codex-hook.js +34 -34
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +15 -15
- package/dist/bin/pushary-connect.js +28 -28
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +42 -42
- package/dist/bin/pushary-disconnect.js +27 -27
- package/dist/bin/pushary-display-hook.js +17 -17
- package/dist/bin/pushary-doctor.js +42 -42
- package/dist/bin/pushary-elicitation-hook.js +27 -27
- package/dist/bin/pushary-gemini-bridge.js +15 -15
- package/dist/bin/pushary-gemini-hook.js +31 -31
- package/dist/bin/pushary-hook.js +33 -33
- package/dist/bin/pushary-login.js +21 -21
- package/dist/bin/pushary-logout.js +26 -26
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +15 -15
- package/dist/bin/pushary-notification-hook.js +26 -26
- package/dist/bin/pushary-opencode-hook.js +30 -30
- package/dist/bin/pushary-permission-denied-hook.js +33 -33
- package/dist/bin/pushary-permission-hook.js +33 -33
- package/dist/bin/pushary-post-hook.js +26 -26
- package/dist/bin/pushary-prompt-hook.js +26 -26
- package/dist/bin/pushary-session-end-hook.js +26 -26
- package/dist/bin/pushary-session-start-hook.js +35 -35
- package/dist/bin/pushary-setup.js +49 -49
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +32 -32
- package/dist/bin/pushary-stop-hook.js +26 -26
- package/dist/bin/pushary-stopfailure-hook.js +26 -26
- package/dist/bin/pushary-suggestions.js +15 -15
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +40 -40
- package/dist/bin/pushary-wait.js +15 -15
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-AN6AKKHO.js → chunk-2AMSWODQ.js} +2 -2
- package/dist/{chunk-GX3QCU32.js → chunk-2ZT4XV4I.js} +6 -6
- package/dist/{chunk-MTG3JLMP.js → chunk-33NEYAK2.js} +4 -4
- package/dist/{chunk-WELDACYF.js → chunk-363YZ5WJ.js} +1 -1
- package/dist/{chunk-BQVB563P.js → chunk-3DD44QTA.js} +5 -5
- package/dist/{chunk-LWY2U7NZ.js → chunk-3GFJ7CXQ.js} +4 -4
- package/dist/{chunk-7K6DZPYV.js → chunk-47HCNA5U.js} +1 -1
- package/dist/{chunk-XWVEAAZO.js → chunk-4DSJF5JD.js} +3 -3
- package/dist/{chunk-4PXJ2LBU.js → chunk-4FLMGGWB.js} +2 -2
- package/dist/{chunk-SMBFZFVN.js → chunk-5JZCFZUT.js} +8 -8
- package/dist/{chunk-D3PHTY54.js → chunk-5KCUQ3B7.js} +3 -3
- package/dist/{chunk-VIR7SCIQ.js → chunk-5NHWNILG.js} +5 -5
- package/dist/{chunk-H6YES2DS.js → chunk-6CJ7D6EQ.js} +5 -5
- package/dist/{chunk-A2TAWW5L.js → chunk-6FR5ZYMS.js} +1 -1
- package/dist/{chunk-CKR43BBJ.js → chunk-7VRL6XYM.js} +1 -1
- package/dist/{chunk-CVIJBTGE.js → chunk-7YRKM4AB.js} +6 -6
- package/dist/{chunk-K5H4YAMZ.js → chunk-A5YOWKPR.js} +10 -10
- package/dist/{chunk-TOUMNM7M.js → chunk-AIABYHHZ.js} +6 -6
- package/dist/{chunk-46ZIEQGC.js → chunk-B4M2XZNQ.js} +2 -2
- package/dist/{chunk-UKCCVMI2.js → chunk-BYP2R2PF.js} +1 -1
- package/dist/{chunk-WLXXEFHA.js → chunk-BZ6N5DDZ.js} +60 -16
- package/dist/{chunk-JBWEGNKE.js → chunk-CPBS6LS3.js} +3 -3
- package/dist/{chunk-B6HPULOG.js → chunk-EDNCFLR7.js} +3 -3
- package/dist/{chunk-7YQPI4UE.js → chunk-EG2E2562.js} +1 -1
- package/dist/{chunk-NJSCVQ6S.js → chunk-EU4NV7SS.js} +2 -2
- package/dist/{chunk-WCSPOQ5W.js → chunk-F24QURGP.js} +4 -4
- package/dist/{chunk-FLBMCN45.js → chunk-H4LCCX7W.js} +6 -6
- package/dist/{chunk-OP2ZDOBR.js → chunk-HHZSB6KL.js} +151 -6
- package/dist/{chunk-QASBFNVD.js → chunk-HSFTTGOB.js} +2 -2
- package/dist/{chunk-GAYUSL24.js → chunk-HVGN7TRN.js} +1 -1
- package/dist/{chunk-WZZHWX7Q.js → chunk-INKDRMSK.js} +5 -5
- package/dist/{chunk-FNT4VWXV.js → chunk-IYUAMUO6.js} +1 -1
- package/dist/{chunk-RPW7LX2L.js → chunk-J4AJVM5F.js} +3 -3
- package/dist/{chunk-R4BBSIUK.js → chunk-J6ACLE2A.js} +2 -2
- package/dist/{chunk-MG5WFAND.js → chunk-K4RIBZ32.js} +1 -1
- package/dist/{chunk-NPMVVR6I.js → chunk-KESS6HAK.js} +2 -2
- package/dist/{chunk-YQVZQM53.js → chunk-KG7UZSCD.js} +6 -6
- package/dist/{chunk-XSUNHOAP.js → chunk-L37Q4BR6.js} +4 -4
- package/dist/{chunk-KOEQIRDA.js → chunk-MZX35RFX.js} +1 -1
- package/dist/{chunk-P2H6TDL4.js → chunk-NBKH6SKN.js} +1 -1
- package/dist/{chunk-TUQ6R6DD.js → chunk-NVOQBKIL.js} +4 -4
- package/dist/{chunk-5FJPEDMZ.js → chunk-NXWQZBOK.js} +3 -3
- package/dist/{chunk-IKX4X4LJ.js → chunk-ODXZPMKN.js} +3 -3
- package/dist/{chunk-5UIRDDJN.js → chunk-PEMESJZY.js} +3 -3
- package/dist/{chunk-F5C6XZZ7.js → chunk-PTONPJWL.js} +4 -4
- package/dist/{chunk-CTBNVQND.js → chunk-RHTAI4XP.js} +10 -10
- package/dist/{chunk-M2PLZ5V3.js → chunk-RM7MNCCA.js} +5 -5
- package/dist/{chunk-FAL7WRMM.js → chunk-RWS4DRFK.js} +3 -3
- package/dist/{chunk-UJ6UCGY4.js → chunk-SJPH24TK.js} +4 -4
- package/dist/{chunk-UXVCDVPL.js → chunk-SSTO42XS.js} +1 -1
- package/dist/{chunk-CUQOWRYT.js → chunk-SUI5JE6T.js} +1 -1
- package/dist/{chunk-2WCARUXQ.js → chunk-T57CIR6H.js} +1 -1
- package/dist/{chunk-C664L36M.js → chunk-TAHUCUY3.js} +2 -2
- package/dist/{chunk-KWDQI7TI.js → chunk-UFRRAAYD.js} +4 -4
- package/dist/{chunk-PZLNBKMS.js → chunk-UZL3VQCE.js} +5 -5
- package/dist/{chunk-H7B6LLP4.js → chunk-VKRRUT45.js} +13 -6
- package/dist/{chunk-6UN3AUIS.js → chunk-W4MZBZU3.js} +3 -3
- package/dist/{chunk-I7LP4DKM.js → chunk-W744DTUT.js} +341 -37
- package/dist/{chunk-SAISSZZA.js → chunk-WFHUECGB.js} +6 -6
- package/dist/{chunk-UNXVORET.js → chunk-XOPOX5QY.js} +47 -29
- package/dist/{chunk-FEP7FXBP.js → chunk-XRRY45XB.js} +3 -3
- package/dist/{chunk-EJYLQNMC.js → chunk-XSSG5JLJ.js} +1 -1
- package/dist/{chunk-QO6SWGLH.js → chunk-XUAGV5VH.js} +2 -2
- package/dist/{chunk-BUNRL7QV.js → chunk-YOSATSUD.js} +2 -2
- package/dist/{chunk-Q64D24NF.js → chunk-YQGPBLIT.js} +2 -2
- package/dist/{chunk-BBLXVKW2.js → chunk-YQUJQGJU.js} +4 -4
- package/dist/{chunk-T5N42XDU.js → chunk-YZORQXN7.js} +1 -1
- package/dist/{chunk-RMUKFMT3.js → chunk-ZMKZ5WHS.js} +1 -1
- package/dist/{chunk-ZGYLMVNB.js → chunk-ZR35L635.js} +2 -2
- package/dist/{chunk-A23GIPWY.js → chunk-ZRTUS6WD.js} +12 -5
- package/dist/{chunk-QQ24SUBD.js → chunk-ZV7G73KH.js} +3 -3
- package/dist/{chunk-X4UWBBFI.js → chunk-ZWUVJ3DV.js} +3 -3
- package/dist/{codex-app-cards-switch-45UK7FRY.js → codex-app-cards-switch-545ISCGQ.js} +11 -11
- package/dist/{codex-card-routing-7B77ISR2.js → codex-card-routing-IKNAEEMC.js} +2 -2
- package/dist/{codex-desktop-launch-DWC7Q5A6.js → codex-desktop-launch-VQNI4GUS.js} +1 -1
- package/dist/{codex-session-launch-MK2CXFRQ.js → codex-session-launch-OGOGHTM7.js} +18 -18
- package/dist/{config-OHLNHWP4.js → config-VGWGOR2V.js} +3 -3
- package/dist/{global-upgrade-KKFYAQVO.js → global-upgrade-GUHXKJPO.js} +9 -9
- package/dist/{identity-AKGGBW3A.js → identity-FORDJUYW.js} +4 -4
- package/dist/{live-capabilities-O6MAYZZS.js → live-capabilities-VA3VXZOZ.js} +4 -4
- package/dist/{paths-5XEJTZAS.js → paths-5XZPI4LD.js} +3 -3
- package/dist/{reapply-VQFRLS3P.js → reapply-77JJ3QV2.js} +28 -28
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +32 -32
- package/dist/{upgrade-lock-6HGNG7RT.js → upgrade-lock-EEPLQBLA.js} +4 -4
- package/dist/{usage-ATA2A3TZ.js → usage-27IDH6UH.js} +3 -3
- package/package.json +2 -2
|
@@ -27,11 +27,11 @@ import {
|
|
|
27
27
|
toolResultErrorText,
|
|
28
28
|
transcriptTokensIn,
|
|
29
29
|
transcriptUsageRequest
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-HVGN7TRN.js";
|
|
31
31
|
import {
|
|
32
32
|
branchFor,
|
|
33
33
|
repoKeyFor
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-363YZ5WJ.js";
|
|
35
35
|
import {
|
|
36
36
|
cancelQuestion,
|
|
37
37
|
clientErrorKindOf,
|
|
@@ -39,34 +39,35 @@ import {
|
|
|
39
39
|
reportClientError,
|
|
40
40
|
sendNotification,
|
|
41
41
|
waitForAnswer
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-KG7UZSCD.js";
|
|
43
43
|
import {
|
|
44
|
+
isRetryable,
|
|
44
45
|
withRetry
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-UZL3VQCE.js";
|
|
46
47
|
import {
|
|
47
48
|
fetchAsCredential
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-47HCNA5U.js";
|
|
49
50
|
import {
|
|
50
51
|
getMachineId
|
|
51
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-6FR5ZYMS.js";
|
|
52
53
|
import {
|
|
53
54
|
reportedInstallSource
|
|
54
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-B4M2XZNQ.js";
|
|
55
56
|
import {
|
|
56
57
|
IDLE_PROMPT_NOTIFICATION,
|
|
57
58
|
NOTIFICATION_PUSH_TYPES,
|
|
58
59
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS,
|
|
59
60
|
canonicalJson,
|
|
60
61
|
claudeConfigDir
|
|
61
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-ZRTUS6WD.js";
|
|
62
63
|
import {
|
|
63
64
|
compareVersion,
|
|
64
65
|
parseVersion
|
|
65
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-ODXZPMKN.js";
|
|
66
67
|
import {
|
|
67
68
|
getApiKey,
|
|
68
69
|
getBaseUrl
|
|
69
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-MZX35RFX.js";
|
|
70
71
|
import {
|
|
71
72
|
writeFileAtomic,
|
|
72
73
|
writeJsonAtomicDurable
|
|
@@ -95,7 +96,7 @@ import {
|
|
|
95
96
|
resolveAutoResolveOrigin,
|
|
96
97
|
resolvePolicy,
|
|
97
98
|
unansweredRefusalReason
|
|
98
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-W744DTUT.js";
|
|
99
100
|
|
|
100
101
|
// src/pending.ts
|
|
101
102
|
import { join } from "path";
|
|
@@ -369,14 +370,14 @@ var policyRequestFor = (agentType) => ({
|
|
|
369
370
|
agent: agentType,
|
|
370
371
|
repoAware: REPO_AWARE_AGENTS.includes(agentType)
|
|
371
372
|
});
|
|
372
|
-
var POLICY_CACHE_FORMAT = "
|
|
373
|
+
var POLICY_CACHE_FORMAT = "v3";
|
|
373
374
|
var policyCacheFile = (apiKey, agent, repoAware = false) => {
|
|
374
375
|
const parts = [apiKey, agent, repoAware ? "repoAware" : void 0, "sessionToolAware"].filter(Boolean);
|
|
375
376
|
const hash = createHash2("sha256").update(parts.join(":")).digest("hex").slice(0, 12);
|
|
376
377
|
return join2(tmpdir2(), `pushary-policy-${POLICY_CACHE_FORMAT}-${hash}.json`);
|
|
377
378
|
};
|
|
378
379
|
var POLICY_REQUEST_CAPABILITIES_VALUE = policyRequestCapabilitiesHeaderValue(CLI_POLICY_REQUEST_CAPABILITIES);
|
|
379
|
-
var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId) => {
|
|
380
|
+
var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId, signal) => {
|
|
380
381
|
return withRetry(async () => {
|
|
381
382
|
const baseUrl = getBaseUrl();
|
|
382
383
|
const params = new URLSearchParams();
|
|
@@ -389,7 +390,7 @@ var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId) => {
|
|
|
389
390
|
const url = query ? `${baseUrl}/api/mcp/policy?${query}` : `${baseUrl}/api/mcp/policy`;
|
|
390
391
|
const response = await fetchAsCredential(apiKey, url, {
|
|
391
392
|
headers: { "Authorization": `Bearer ${apiKey}`, [POLICY_REQUEST_CAPABILITIES_HEADER]: POLICY_REQUEST_CAPABILITIES_VALUE },
|
|
392
|
-
signal: AbortSignal.timeout(1e4)
|
|
393
|
+
signal: AbortSignal.any([AbortSignal.timeout(1e4), ...signal ? [signal] : []])
|
|
393
394
|
});
|
|
394
395
|
if (!response.ok) {
|
|
395
396
|
throw new Error(`Failed to fetch policy: ${response.status}`);
|
|
@@ -397,9 +398,9 @@ var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId) => {
|
|
|
397
398
|
const raw = await response.json();
|
|
398
399
|
if (!isPolicyConfig(raw)) throw new Error("Invalid policy response");
|
|
399
400
|
return raw;
|
|
400
|
-
}, { maxAttempts: 2 });
|
|
401
|
+
}, { maxAttempts: 2, shouldRetry: (error) => signal?.aborted !== true && isRetryable(error) });
|
|
401
402
|
};
|
|
402
|
-
var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessionId) => {
|
|
403
|
+
var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessionId, signal) => {
|
|
403
404
|
const path = policyCacheFile(apiKey, agent, repoAware);
|
|
404
405
|
let staleCache = null;
|
|
405
406
|
if (existsSync2(path)) {
|
|
@@ -419,7 +420,7 @@ var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessio
|
|
|
419
420
|
}
|
|
420
421
|
}
|
|
421
422
|
try {
|
|
422
|
-
const policy = await fetchPolicy(apiKey, agent, repoAware, sessionId);
|
|
423
|
+
const policy = await fetchPolicy(apiKey, agent, repoAware, sessionId, signal);
|
|
423
424
|
try {
|
|
424
425
|
writeFileSync2(path, JSON.stringify({ ...policy, _cachedAt: Date.now(), _policyVersion: expectedVersion ?? null, _sessionId: sessionId ?? null }), { encoding: "utf-8", mode: 384 });
|
|
425
426
|
} catch {
|
|
@@ -430,6 +431,18 @@ var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessio
|
|
|
430
431
|
throw new Error("Failed to fetch policy and no cached policy available");
|
|
431
432
|
}
|
|
432
433
|
};
|
|
434
|
+
var readFreshPolicyOfAnySession = (path, expectedVersion) => {
|
|
435
|
+
try {
|
|
436
|
+
const cached = JSON.parse(readFileSync2(path, "utf-8"));
|
|
437
|
+
if (!isRecord(cached) || typeof cached._cachedAt !== "number") return null;
|
|
438
|
+
if (Date.now() - cached._cachedAt >= CACHE_TTL_MS) return null;
|
|
439
|
+
if (expectedVersion != null && (cached._policyVersion ?? null) !== expectedVersion) return null;
|
|
440
|
+
return isPolicyConfig(cached) ? cached : null;
|
|
441
|
+
} catch {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
var getPolicyForStandingDenies = async (apiKey, expectedVersion, agent, repoAware, sessionId, signal) => readFreshPolicyOfAnySession(policyCacheFile(apiKey, agent, repoAware), expectedVersion) ?? getPolicy(apiKey, expectedVersion, agent, repoAware, sessionId, signal);
|
|
433
446
|
var readCachedPolicy = (apiKey, agent, repoAware = false) => {
|
|
434
447
|
const path = policyCacheFile(apiKey, agent, repoAware);
|
|
435
448
|
try {
|
|
@@ -446,6 +459,7 @@ var modeStateCacheFile = (apiKey) => {
|
|
|
446
459
|
const hash = createHash2("sha256").update(`mode:${apiKey}`).digest("hex").slice(0, 12);
|
|
447
460
|
return join2(tmpdir2(), `pushary-mode-${hash}.json`);
|
|
448
461
|
};
|
|
462
|
+
var wasFetchedForSession = (cached, sessionId) => (cached.sessionId ?? null) === (sessionId ?? null);
|
|
449
463
|
var readLastGoodMode = (apiKey) => {
|
|
450
464
|
try {
|
|
451
465
|
const path = modeStateCacheFile(apiKey);
|
|
@@ -473,25 +487,25 @@ var unknownMode = () => ({
|
|
|
473
487
|
scope: null,
|
|
474
488
|
degraded: true
|
|
475
489
|
});
|
|
476
|
-
var degradedFallback = (apiKey, authoritative = false) => {
|
|
490
|
+
var degradedFallback = (apiKey, sessionId, authoritative = false) => {
|
|
477
491
|
if (authoritative) return unknownMode();
|
|
478
492
|
const last = readLastGoodMode(apiKey);
|
|
479
|
-
if (last
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
return unknownMode();
|
|
493
|
+
if (!last || Date.now() - last.at >= MODE_GRACE_MS) return unknownMode();
|
|
494
|
+
if (wasFetchedForSession(last, sessionId)) return { ...last.state, degraded: false };
|
|
495
|
+
return { ...unknownMode(), kill: last.state.kill === true };
|
|
483
496
|
};
|
|
484
497
|
var MODE_REUSE_MS = CACHE_TTL_MS;
|
|
485
498
|
var readReusableMode = (apiKey, sessionId, maxAgeMs) => {
|
|
486
499
|
const last = readLastGoodMode(apiKey);
|
|
487
|
-
if (!last || (last
|
|
500
|
+
if (!last || !wasFetchedForSession(last, sessionId)) return null;
|
|
488
501
|
if (Date.now() - last.at >= maxAgeMs) return null;
|
|
489
502
|
return { ...last.state, degraded: false };
|
|
490
503
|
};
|
|
491
|
-
var
|
|
504
|
+
var unansweredModeRead = (state) => ({ state, answeredLive: false });
|
|
505
|
+
var readModeState = async (apiKey, sessionId, reuseWithinMs, signal) => {
|
|
492
506
|
if (reuseWithinMs > 0) {
|
|
493
507
|
const reusable = readReusableMode(apiKey, sessionId, reuseWithinMs);
|
|
494
|
-
if (reusable) return reusable;
|
|
508
|
+
if (reusable) return unansweredModeRead(reusable);
|
|
495
509
|
}
|
|
496
510
|
try {
|
|
497
511
|
const baseUrl = getBaseUrl();
|
|
@@ -502,21 +516,23 @@ var fetchModeState = async (apiKey, sessionId, reuseWithinMs = 0, signal) => {
|
|
|
502
516
|
});
|
|
503
517
|
if (!response.ok) {
|
|
504
518
|
void reportClientError({ kind: "http_status", code: `mode_http_${response.status}` });
|
|
505
|
-
return degradedFallback(apiKey, response.status === 401 || response.status === 403);
|
|
519
|
+
return unansweredModeRead(degradedFallback(apiKey, sessionId, response.status === 401 || response.status === 403));
|
|
506
520
|
}
|
|
507
521
|
const body = await response.json();
|
|
508
522
|
if (!isProvenModeResponse(body)) {
|
|
509
523
|
void reportClientError({ kind: "invalid_response", code: "mode_response_unproven" });
|
|
510
|
-
return degradedFallback(apiKey);
|
|
524
|
+
return unansweredModeRead(degradedFallback(apiKey, sessionId));
|
|
511
525
|
}
|
|
512
526
|
const state = modeStateFromResponse(body);
|
|
513
527
|
writeLastGoodMode(apiKey, state, sessionId);
|
|
514
|
-
return state;
|
|
528
|
+
return { state, answeredLive: true };
|
|
515
529
|
} catch (error) {
|
|
516
530
|
void reportClientError({ kind: clientErrorKindOf(error), code: "mode_fetch_failed" });
|
|
517
|
-
return degradedFallback(apiKey);
|
|
531
|
+
return unansweredModeRead(degradedFallback(apiKey, sessionId));
|
|
518
532
|
}
|
|
519
533
|
};
|
|
534
|
+
var fetchModeState = async (apiKey, sessionId, reuseWithinMs = 0, signal) => (await readModeState(apiKey, sessionId, reuseWithinMs, signal)).state;
|
|
535
|
+
var fetchLiveModeState = (apiKey, sessionId, signal) => readModeState(apiKey, sessionId, 0, signal);
|
|
520
536
|
var fetchModeOverride = async (apiKey) => (await fetchModeState(apiKey)).mode;
|
|
521
537
|
|
|
522
538
|
// src/usage.ts
|
|
@@ -1677,8 +1693,10 @@ export {
|
|
|
1677
1693
|
releaseThrottle,
|
|
1678
1694
|
policyRequestFor,
|
|
1679
1695
|
getPolicy,
|
|
1696
|
+
getPolicyForStandingDenies,
|
|
1680
1697
|
readCachedPolicy,
|
|
1681
1698
|
fetchModeState,
|
|
1699
|
+
fetchLiveModeState,
|
|
1682
1700
|
fetchModeOverride,
|
|
1683
1701
|
readLastUserPrompt,
|
|
1684
1702
|
CODEX_AGENT,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6FR5ZYMS.js";
|
|
4
4
|
import {
|
|
5
5
|
getBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MZX35RFX.js";
|
|
7
7
|
import {
|
|
8
8
|
NetworkError
|
|
9
9
|
} from "./chunk-YU2EUD7O.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
clientContextHeaders,
|
|
15
15
|
redactSecretsFromContent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-W744DTUT.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/net.ts
|
|
19
19
|
import { createRequire } from "module";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZRTUS6WD.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-ZVU6WMMU.js";
|
|
18
18
|
import {
|
|
19
19
|
isAutoUpdateResult
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-W744DTUT.js";
|
|
21
21
|
|
|
22
22
|
// src/auto-update.ts
|
|
23
23
|
import { spawn } from "child_process";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
codexHome,
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZRTUS6WD.js";
|
|
11
11
|
import {
|
|
12
12
|
resolvePathBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ODXZPMKN.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-ZVU6WMMU.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-ROVLRXBI.js";
|
|
4
4
|
import {
|
|
5
5
|
parseVersion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ODXZPMKN.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W744DTUT.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/agent-probe.ts
|
|
12
12
|
import { execSync } from "child_process";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notificationAnswerStep
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AIABYHHZ.js";
|
|
4
4
|
import {
|
|
5
5
|
canChangeApprovalSettings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KESS6HAK.js";
|
|
7
7
|
import {
|
|
8
8
|
matchMacAccountStep,
|
|
9
9
|
retryAgentCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EDNCFLR7.js";
|
|
11
11
|
import {
|
|
12
12
|
EXIT
|
|
13
13
|
} from "./chunk-BG4HHB7E.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7VRL6XYM.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/closing.ts
|
|
19
19
|
var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
claudeConfigDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZRTUS6WD.js";
|
|
4
4
|
import {
|
|
5
5
|
claudePermissionRulesFromSettings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-W744DTUT.js";
|
|
7
7
|
|
|
8
8
|
// src/claude-permission-rules.ts
|
|
9
9
|
import { readFileSync, statSync } from "fs";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formatVersion,
|
|
4
4
|
quoteIfNeeded,
|
|
5
5
|
shellDoubleQuoted
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ODXZPMKN.js";
|
|
7
7
|
import {
|
|
8
8
|
writeFileAtomic
|
|
9
9
|
} from "./chunk-T5I4PKOQ.js";
|
|
@@ -13,12 +13,13 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_MCP_PRETOOLUSE_MATCHER,
|
|
15
15
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
16
|
+
CLAUDE_REFUSALS_ONLY_PRETOOLUSE_MATCHER,
|
|
16
17
|
CODEX_QUESTION_TOOLS,
|
|
17
18
|
HOOK_BUDGETS,
|
|
18
19
|
HOOK_LOCATOR_BINARY,
|
|
19
20
|
PRETOOLUSE_GATED_TOOLS,
|
|
20
21
|
withHookHoldBudget
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-W744DTUT.js";
|
|
22
23
|
|
|
23
24
|
// src/setup/paths.ts
|
|
24
25
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -744,6 +745,11 @@ var CLAUDE_MCP_ROUTE_HOLD_HOOK = {
|
|
|
744
745
|
cliOnly: true,
|
|
745
746
|
since: ESTABLISHED
|
|
746
747
|
};
|
|
748
|
+
var CLAUDE_REFUSALS_ONLY_HOOK = {
|
|
749
|
+
...CLAUDE_MCP_ROUTE_HOLD_HOOK,
|
|
750
|
+
matcher: CLAUDE_REFUSALS_ONLY_PRETOOLUSE_MATCHER
|
|
751
|
+
};
|
|
752
|
+
var CLAUDE_EXTRA_PRETOOLUSE_HOOKS = [CLAUDE_MCP_ROUTE_HOLD_HOOK, CLAUDE_REFUSALS_ONLY_HOOK];
|
|
747
753
|
var supportedClaudeEvents = (version) => CLAUDE_HOOK_EVENTS.filter((hook) => version ? atLeast(version, hook.since) : hook.since === ESTABLISHED);
|
|
748
754
|
var registrationSignatures = (events, version) => Object.fromEntries(
|
|
749
755
|
events.map((hook) => [hook.event, `registered|${version ? formatVersion(version) : "unknown"}`])
|
|
@@ -892,9 +898,10 @@ var addPusharyHooks = (settings, binDir, version = null) => {
|
|
|
892
898
|
delete hooks[known.event];
|
|
893
899
|
}
|
|
894
900
|
}
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
hooks.
|
|
901
|
+
for (const extra of CLAUDE_EXTRA_PRETOOLUSE_HOOKS) {
|
|
902
|
+
if (!supported.has(extra.event)) continue;
|
|
903
|
+
const current = Array.isArray(hooks[extra.event]) ? hooks[extra.event] : [];
|
|
904
|
+
hooks[extra.event] = [...current, entry(extra, resolve2)];
|
|
898
905
|
}
|
|
899
906
|
};
|
|
900
907
|
var entry = (definition, resolve2) => ({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XRRY45XB.js";
|
|
4
4
|
import {
|
|
5
5
|
getBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MZX35RFX.js";
|
|
7
7
|
import {
|
|
8
8
|
NetworkError
|
|
9
9
|
} from "./chunk-YU2EUD7O.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-W744DTUT.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
hermesAppWiringRecord,
|
|
6
6
|
hermesConfigReceipt,
|
|
7
7
|
hermesSetupReceipt
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZRTUS6WD.js";
|
|
9
9
|
import {
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ODXZPMKN.js";
|
|
12
12
|
import {
|
|
13
13
|
readJsonSafe,
|
|
14
14
|
writeJsonAtomic
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "./chunk-ZVU6WMMU.js";
|
|
20
20
|
import {
|
|
21
21
|
isRecord
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-W744DTUT.js";
|
|
23
23
|
|
|
24
24
|
// src/hermes/plugin-payload.ts
|
|
25
25
|
import { createHash } from "crypto";
|
|
@@ -22,22 +22,22 @@ import {
|
|
|
22
22
|
turnCodexAppCardsOff,
|
|
23
23
|
turnCodexAppCardsOn,
|
|
24
24
|
whyLaunchctlFailed
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-TAHUCUY3.js";
|
|
26
|
+
import "./chunk-5KCUQ3B7.js";
|
|
27
27
|
import "./chunk-XCEN33UP.js";
|
|
28
28
|
import "./chunk-QCGNGEGE.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-WFHUECGB.js";
|
|
30
30
|
import "./chunk-XHKBHWLX.js";
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-6FR5ZYMS.js";
|
|
32
|
+
import "./chunk-CPBS6LS3.js";
|
|
33
|
+
import "./chunk-B4M2XZNQ.js";
|
|
34
|
+
import "./chunk-ZRTUS6WD.js";
|
|
35
|
+
import "./chunk-ODXZPMKN.js";
|
|
36
|
+
import "./chunk-MZX35RFX.js";
|
|
37
37
|
import "./chunk-T5I4PKOQ.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-7VRL6XYM.js";
|
|
39
39
|
import "./chunk-ZVU6WMMU.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-W744DTUT.js";
|
|
41
41
|
import "./chunk-E46NE7FB.js";
|
|
42
42
|
import "./chunk-MLKGABMK.js";
|
|
43
43
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deriveToolTarget
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HVGN7TRN.js";
|
|
4
4
|
import {
|
|
5
5
|
TOOL_NAME_MAX_LENGTH,
|
|
6
6
|
codexElicitationToolName
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-W744DTUT.js";
|
|
8
8
|
import "./chunk-MLKGABMK.js";
|
|
9
9
|
|
|
10
10
|
// src/codex-card-routing.ts
|
|
@@ -11,37 +11,37 @@ import {
|
|
|
11
11
|
isCodexQuestionLeftWithTheLocalClient,
|
|
12
12
|
planCodexElicitation,
|
|
13
13
|
reportOwnedQuestion
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-H4LCCX7W.js";
|
|
15
|
+
import "./chunk-BYP2R2PF.js";
|
|
16
|
+
import "./chunk-W4MZBZU3.js";
|
|
17
|
+
import "./chunk-YQGPBLIT.js";
|
|
18
18
|
import "./chunk-N5P2FLOJ.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-HSFTTGOB.js";
|
|
20
20
|
import "./chunk-ROVLRXBI.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-4DSJF5JD.js";
|
|
22
22
|
import "./chunk-XMSDA5WA.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-363YZ5WJ.js";
|
|
24
24
|
import {
|
|
25
25
|
writeDegraded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-KG7UZSCD.js";
|
|
27
27
|
import "./chunk-POFBE6ZY.js";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-UZL3VQCE.js";
|
|
29
|
+
import "./chunk-ZV7G73KH.js";
|
|
30
|
+
import "./chunk-XRRY45XB.js";
|
|
31
31
|
import "./chunk-XHKBHWLX.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-47HCNA5U.js";
|
|
33
|
+
import "./chunk-6FR5ZYMS.js";
|
|
34
|
+
import "./chunk-ZRTUS6WD.js";
|
|
35
|
+
import "./chunk-ODXZPMKN.js";
|
|
36
|
+
import "./chunk-MZX35RFX.js";
|
|
37
37
|
import "./chunk-YU2EUD7O.js";
|
|
38
38
|
import "./chunk-T5I4PKOQ.js";
|
|
39
39
|
import "./chunk-BG4HHB7E.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-7VRL6XYM.js";
|
|
41
41
|
import "./chunk-ZVU6WMMU.js";
|
|
42
42
|
import {
|
|
43
43
|
canonicalJsonText
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-W744DTUT.js";
|
|
45
45
|
import "./chunk-MLKGABMK.js";
|
|
46
46
|
|
|
47
47
|
// 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-MZX35RFX.js";
|
|
7
|
+
import "./chunk-7VRL6XYM.js";
|
|
8
|
+
import "./chunk-W744DTUT.js";
|
|
9
9
|
import "./chunk-MLKGABMK.js";
|
|
10
10
|
export {
|
|
11
11
|
configFilePath,
|
|
@@ -7,20 +7,20 @@ import {
|
|
|
7
7
|
recordUnfinishedUpgrade,
|
|
8
8
|
upgradeInstalledPackage,
|
|
9
9
|
withUpgradeLock
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-7YRKM4AB.js";
|
|
11
|
+
import "./chunk-J6ACLE2A.js";
|
|
12
|
+
import "./chunk-W4MZBZU3.js";
|
|
13
|
+
import "./chunk-YQGPBLIT.js";
|
|
14
14
|
import "./chunk-ROVLRXBI.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-XUAGV5VH.js";
|
|
16
16
|
import "./chunk-POFBE6ZY.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-ZRTUS6WD.js";
|
|
18
|
+
import "./chunk-ODXZPMKN.js";
|
|
19
19
|
import "./chunk-T5I4PKOQ.js";
|
|
20
20
|
import "./chunk-BG4HHB7E.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-7VRL6XYM.js";
|
|
22
22
|
import "./chunk-ZVU6WMMU.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-W744DTUT.js";
|
|
24
24
|
import "./chunk-MLKGABMK.js";
|
|
25
25
|
export {
|
|
26
26
|
finishGlobalUpgrade,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
getMachineId,
|
|
3
3
|
getOrCreateMachineId,
|
|
4
4
|
readExistingMachineId
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-6FR5ZYMS.js";
|
|
6
|
+
import "./chunk-ZRTUS6WD.js";
|
|
7
|
+
import "./chunk-ODXZPMKN.js";
|
|
8
8
|
import "./chunk-T5I4PKOQ.js";
|
|
9
9
|
import "./chunk-ZVU6WMMU.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-W744DTUT.js";
|
|
11
11
|
import "./chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
13
13
|
getMachineId,
|
|
@@ -22,13 +22,13 @@ import {
|
|
|
22
22
|
resolveControlPolicy,
|
|
23
23
|
resolveProviderBinary,
|
|
24
24
|
trackProviderInventory
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
25
|
+
} from "./chunk-W4MZBZU3.js";
|
|
26
|
+
import "./chunk-YQGPBLIT.js";
|
|
27
27
|
import "./chunk-ROVLRXBI.js";
|
|
28
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-ODXZPMKN.js";
|
|
29
29
|
import "./chunk-T5I4PKOQ.js";
|
|
30
30
|
import "./chunk-ZVU6WMMU.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-W744DTUT.js";
|
|
32
32
|
import "./chunk-MLKGABMK.js";
|
|
33
33
|
export {
|
|
34
34
|
CLAUDE_BRIDGE_CAPABILITY,
|
|
@@ -39,11 +39,11 @@ import {
|
|
|
39
39
|
serviceOwedBackMark,
|
|
40
40
|
vscodePluginDir,
|
|
41
41
|
vscodePluginMcp
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-ZRTUS6WD.js";
|
|
43
|
+
import "./chunk-ODXZPMKN.js";
|
|
44
44
|
import "./chunk-T5I4PKOQ.js";
|
|
45
45
|
import "./chunk-ZVU6WMMU.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-W744DTUT.js";
|
|
47
47
|
import "./chunk-MLKGABMK.js";
|
|
48
48
|
export {
|
|
49
49
|
autoUpdateLock,
|