pushary 1.9.103 → 1.9.104
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 +4 -0
- package/README.md +1 -0
- package/dist/{api-3O3GJV3V.js → api-QOG7JVXE.js} +13 -12
- package/dist/bin/pushary-audit.d.ts +1 -0
- package/dist/bin/pushary-audit.js +263 -0
- package/dist/bin/pushary-bell-hook.js +31 -30
- package/dist/bin/pushary-bell.js +14 -13
- package/dist/bin/pushary-claude.js +42 -41
- package/dist/bin/pushary-clean.js +40 -39
- package/dist/bin/pushary-codex-bridge.js +25 -24
- package/dist/bin/pushary-codex-hook.js +39 -38
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +17 -16
- package/dist/bin/pushary-connect.js +33 -32
- package/dist/bin/pushary-cowork.js +8 -8
- package/dist/bin/pushary-daemon.js +52 -50
- package/dist/bin/pushary-disconnect.js +32 -31
- package/dist/bin/pushary-display-hook.js +21 -20
- package/dist/bin/pushary-doctor.js +56 -54
- package/dist/bin/pushary-elicitation-hook.js +31 -30
- package/dist/bin/pushary-gemini-bridge.js +16 -15
- package/dist/bin/pushary-gemini-hook.js +34 -33
- package/dist/bin/pushary-hook.js +36 -35
- package/dist/bin/pushary-login.js +27 -26
- package/dist/bin/pushary-logout.js +33 -32
- package/dist/bin/pushary-mcp.js +14 -13
- package/dist/bin/pushary-mode.js +19 -18
- package/dist/bin/pushary-notification-hook.js +31 -30
- package/dist/bin/pushary-opencode-hook.js +33 -32
- package/dist/bin/pushary-permission-denied-hook.js +35 -34
- package/dist/bin/pushary-permission-hook.js +36 -35
- package/dist/bin/pushary-post-hook.js +31 -30
- package/dist/bin/pushary-prompt-hook.js +31 -30
- package/dist/bin/pushary-session-end-hook.js +33 -32
- package/dist/bin/pushary-session-start-hook.js +41 -40
- package/dist/bin/pushary-setup.js +71 -69
- package/dist/bin/pushary-stats.js +6 -6
- package/dist/bin/pushary-status.js +39 -38
- package/dist/bin/pushary-stop-hook.js +31 -30
- package/dist/bin/pushary-stopfailure-hook.js +31 -30
- package/dist/bin/pushary-suggestions.js +19 -18
- package/dist/bin/pushary-transcript-register.js +22 -21
- package/dist/bin/pushary-transcripts.js +30 -29
- package/dist/bin/pushary-upgrade.js +48 -46
- package/dist/bin/pushary-wait.js +19 -18
- package/dist/bin/pushary.js +11 -9
- package/dist/{chunk-YETNUPV5.js → chunk-2MRLDEQY.js} +3 -3
- package/dist/{chunk-KOUB4ZLX.js → chunk-3A7REECH.js} +1 -1
- package/dist/{chunk-O5ZKMUTP.js → chunk-3KEY3453.js} +6 -6
- package/dist/{chunk-JVE4P54I.js → chunk-4HBWXZPI.js} +5 -3
- package/dist/{chunk-WYJ6QM7K.js → chunk-4JBCPRWZ.js} +2 -2
- package/dist/{chunk-J6SSLXSU.js → chunk-4OLWSYX5.js} +4 -4
- package/dist/{chunk-JECH4NJL.js → chunk-4QI6SBNR.js} +6 -4
- package/dist/{chunk-UOE26LPT.js → chunk-5BX57BGT.js} +7 -7
- package/dist/{chunk-4FAJQPFY.js → chunk-5YVBVJOH.js} +330 -0
- package/dist/{chunk-4TVLPGJV.js → chunk-6B4R7HUV.js} +1 -1
- package/dist/{chunk-JKOAAIJD.js → chunk-7RHEZVAE.js} +5 -5
- package/dist/{chunk-RVSRPDRF.js → chunk-AE2BQ3XM.js} +2 -2
- package/dist/{chunk-SRE6XJ3K.js → chunk-AG7PFGGE.js} +7 -7
- package/dist/{chunk-O7ITTNDD.js → chunk-AYWX6M7J.js} +5 -3
- package/dist/{chunk-JUA7MX2V.js → chunk-BDSI2NEN.js} +4 -4
- package/dist/{chunk-KZERVKTD.js → chunk-BG4HHB7E.js} +2 -1
- package/dist/{chunk-ZCYLCD6L.js → chunk-CC4LGKEZ.js} +5 -5
- package/dist/{chunk-CQ7QE4W2.js → chunk-CFTPHNBY.js} +1 -1
- package/dist/{chunk-AFGMZZEB.js → chunk-FH6PHTUD.js} +2 -2
- package/dist/{chunk-IOQ3ZCAE.js → chunk-FQNMUJTK.js} +1 -1
- package/dist/{chunk-AWF5WICI.js → chunk-FVERRWDP.js} +2 -2
- package/dist/{chunk-KTM2X3XQ.js → chunk-FXTUSTQG.js} +16 -16
- package/dist/{chunk-ZXK46QT4.js → chunk-FYQHXN4X.js} +2 -2
- package/dist/{chunk-AZSOH2SF.js → chunk-GV2MF4NY.js} +2 -2
- package/dist/{chunk-4QO267OY.js → chunk-GV5TEADP.js} +1 -1
- package/dist/{chunk-FF7L4B3W.js → chunk-HB7FHRTT.js} +9 -9
- package/dist/{chunk-T7G6IIV4.js → chunk-HHEFOGT2.js} +3 -3
- package/dist/{chunk-3OIUMHHO.js → chunk-HJ4EBHK4.js} +2 -2
- package/dist/{chunk-MK2XE66G.js → chunk-HXZYBYBD.js} +3 -3
- package/dist/{chunk-SA4PCB6N.js → chunk-I3T5YV5I.js} +7 -7
- package/dist/{chunk-KLJ2CTT7.js → chunk-ID4BZRBW.js} +4 -4
- package/dist/{chunk-Y7KRX7U4.js → chunk-IVAXF3JG.js} +1 -1
- package/dist/{chunk-RMFL62HR.js → chunk-JGRBWTDW.js} +14 -12
- package/dist/{chunk-WPK2UWDU.js → chunk-JMTOQXHV.js} +2 -2
- package/dist/{chunk-QD57EL3I.js → chunk-JVZVO3K5.js} +3 -3
- package/dist/{chunk-KACD6W6J.js → chunk-KDIZS7FN.js} +1 -1
- package/dist/{chunk-T6TQETDN.js → chunk-LIDIA5JW.js} +4 -4
- package/dist/{chunk-G7RMOSRX.js → chunk-M7BDKARZ.js} +1 -1
- package/dist/{chunk-Y3SZVZF6.js → chunk-N4RIGNDX.js} +2 -2
- package/dist/{chunk-7BIVBOD5.js → chunk-NGY2WS3X.js} +5 -5
- package/dist/{chunk-HYAQIKYB.js → chunk-NKA2PEQQ.js} +6 -6
- package/dist/{chunk-MP3SEXXJ.js → chunk-OFRQNTJD.js} +1 -1
- package/dist/{chunk-NZQEABRO.js → chunk-OPV6724W.js} +13 -11
- package/dist/{chunk-SXAZPWL7.js → chunk-ORIVT4BL.js} +8 -6
- package/dist/{chunk-V5DV7XZN.js → chunk-PK6LBL3Z.js} +4 -4
- package/dist/{chunk-6N5DQG5F.js → chunk-PYUN7HNY.js} +2 -2
- package/dist/chunk-QENTGE75.js +86 -0
- package/dist/{chunk-PM34Z5WX.js → chunk-RDUY7MKN.js} +6 -6
- package/dist/{chunk-X3HBR57D.js → chunk-RUN772MN.js} +7 -7
- package/dist/{chunk-VD6CAELE.js → chunk-RYUIXLZ5.js} +4 -4
- package/dist/{chunk-2PR5EP7N.js → chunk-SJCHJQKT.js} +4 -4
- package/dist/{chunk-EOD3DBIN.js → chunk-SJJCCFD5.js} +3 -3
- package/dist/{chunk-3K7PB5LI.js → chunk-SPM4VNED.js} +3 -3
- package/dist/{chunk-3Q2X3T3U.js → chunk-SVZPRTCK.js} +1 -1
- package/dist/{chunk-UQWEH7CK.js → chunk-TMJK3CLD.js} +5 -5
- package/dist/{chunk-AHIAB7JQ.js → chunk-TYH7SNKD.js} +1 -1
- package/dist/{chunk-COBOR3ST.js → chunk-TYM6IH5F.js} +6 -4
- package/dist/{chunk-VJOMBYY5.js → chunk-U5DBYW63.js} +1 -1
- package/dist/{chunk-TLERJKSE.js → chunk-UL52HYKN.js} +1 -1
- package/dist/{chunk-Z2TX7DVU.js → chunk-UUYLBSAU.js} +15 -13
- package/dist/{chunk-7OZOFTTB.js → chunk-UYJLXAP4.js} +7 -7
- package/dist/{chunk-BQHZRH6S.js → chunk-VAZCGOLS.js} +26 -110
- package/dist/{chunk-LURFSDCL.js → chunk-VUFHYMSP.js} +1 -1
- package/dist/{chunk-JPKJBKZE.js → chunk-VZY4GD4T.js} +9 -9
- package/dist/{chunk-5PW25NHB.js → chunk-WBLK4WLO.js} +5 -5
- package/dist/{chunk-2S5J5YI2.js → chunk-XDTE55H7.js} +5 -5
- package/dist/{chunk-3ITURBPE.js → chunk-XTMAVKO3.js} +5 -5
- package/dist/{chunk-E7WJQBK3.js → chunk-XXNXMX2G.js} +14 -14
- package/dist/{chunk-WZNLWDSL.js → chunk-XXPA3X6L.js} +7 -7
- package/dist/{chunk-PWGD5EP6.js → chunk-YDT6TVGN.js} +7 -1
- package/dist/{chunk-NMUI3ZWG.js → chunk-YPY4YCIZ.js} +1 -1
- package/dist/{chunk-PPY5N2E6.js → chunk-YU2EUD7O.js} +1 -1
- package/dist/{chunk-WVAJSBI2.js → chunk-ZBT3U2VB.js} +3 -3
- package/dist/{chunk-AVXG5QB2.js → chunk-ZUXDGVW4.js} +5 -5
- package/dist/{codex-app-cards-switch-D475JLP5.js → codex-app-cards-switch-6IDDWXYS.js} +13 -12
- package/dist/{codex-desktop-launch-WOPEZMO6.js → codex-desktop-launch-VP4TXVCM.js} +1 -1
- package/dist/{codex-session-launch-AWWECV2L.js → codex-session-launch-OACJB5NN.js} +22 -21
- package/dist/{config-A5EC37VZ.js → config-S7HAIK6E.js} +3 -3
- package/dist/{global-upgrade-V6FA6MUF.js → global-upgrade-OOFEGR4H.js} +12 -11
- package/dist/{identity-BEPQQHNR.js → identity-QSM6MVAH.js} +5 -4
- package/dist/{live-capabilities-EAM2QN73.js → live-capabilities-NSVW362T.js} +6 -5
- package/dist/{paths-2IEEYSHM.js → paths-KFRRYJWL.js} +4 -3
- package/dist/reapply-7H3VCPW4.js +65 -0
- package/dist/src/index.js +37 -36
- package/dist/{upgrade-lock-DLGVC34L.js → upgrade-lock-BJKRXNMC.js} +5 -4
- package/dist/usage-KGWL6WKQ.js +11 -0
- package/package.json +2 -1
- package/dist/reapply-LDCMRN6Q.js +0 -64
- package/dist/usage-U6H5UFS2.js +0 -11
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findNativeClaudeInstall
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VUFHYMSP.js";
|
|
4
4
|
import {
|
|
5
5
|
parseVersion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VAZCGOLS.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5YVBVJOH.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
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4JBCPRWZ.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PK6LBL3Z.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NGY2WS3X.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3A7REECH.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YDT6TVGN.js";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_STOP_DEFAULT_SECONDS,
|
|
19
19
|
APPROVAL_MODE_META,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
classifyConfirmResponse,
|
|
22
22
|
isAnswerSource,
|
|
23
23
|
roundTripAsk
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-5YVBVJOH.js";
|
|
25
25
|
|
|
26
26
|
// src/reach.ts
|
|
27
27
|
var reachVerdict = (channels) => {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AYWX6M7J.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
|
-
npmExitedOnPermissionDenied
|
|
7
|
+
npmExitedOnPermissionDenied
|
|
8
|
+
} from "./chunk-VAZCGOLS.js";
|
|
9
|
+
import {
|
|
8
10
|
writeJsonAtomic
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-QENTGE75.js";
|
|
10
12
|
|
|
11
13
|
// src/upgrade-lock.ts
|
|
12
14
|
import { fork } from "child_process";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
absoluteUrl
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NGY2WS3X.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_SCOPE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5YVBVJOH.js";
|
|
7
7
|
|
|
8
8
|
// src/cli/approval-settings-pages.ts
|
|
9
9
|
var API_KEYS_PATH = "/dashboard/agent/settings";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
realpath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2MRLDEQY.js";
|
|
4
4
|
import {
|
|
5
5
|
findNativeClaudeInstall
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VUFHYMSP.js";
|
|
7
7
|
import {
|
|
8
8
|
readGlobalPrefixAsync,
|
|
9
9
|
resolveGlobalBinary,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
resolvePackageVersionFromBinary,
|
|
14
14
|
resolvePathBinary,
|
|
15
15
|
resolvePathBinaryAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VAZCGOLS.js";
|
|
17
17
|
import {
|
|
18
18
|
MANAGED_PROVIDERS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5YVBVJOH.js";
|
|
20
20
|
|
|
21
21
|
// src/live-capabilities.ts
|
|
22
22
|
import { homedir } from "os";
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NpmInstallError,
|
|
3
3
|
NpmMissingError,
|
|
4
|
-
NpmPermissionError
|
|
4
|
+
NpmPermissionError
|
|
5
|
+
} from "./chunk-VAZCGOLS.js";
|
|
6
|
+
import {
|
|
5
7
|
writeFileAtomic
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QENTGE75.js";
|
|
7
9
|
import {
|
|
8
10
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YDT6TVGN.js";
|
|
10
12
|
import {
|
|
11
13
|
readSetupAgentFailures
|
|
12
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5YVBVJOH.js";
|
|
13
15
|
|
|
14
16
|
// src/setup/config-write.ts
|
|
15
17
|
var AgentConfigWriteError = class extends Error {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CLAUDE_CODE_AGENT
|
|
3
|
+
} from "./chunk-UUYLBSAU.js";
|
|
1
4
|
import {
|
|
2
5
|
addGeminiMcpServer,
|
|
3
6
|
removeGeminiMcpServer
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
CLAUDE_CODE_AGENT
|
|
7
|
-
} from "./chunk-Z2TX7DVU.js";
|
|
7
|
+
} from "./chunk-RYUIXLZ5.js";
|
|
8
8
|
import {
|
|
9
9
|
compatibleToolLookup
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OFRQNTJD.js";
|
|
11
11
|
import {
|
|
12
12
|
CLAUDE_HOOK_EVENTS,
|
|
13
13
|
PUSHARY_MCP_URL,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isPusharyHook,
|
|
20
20
|
registerHookEntry,
|
|
21
21
|
removeClaudeMcpServers
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-AYWX6M7J.js";
|
|
23
23
|
import {
|
|
24
24
|
HOOK_COMPATIBLE_PROFILES,
|
|
25
25
|
PHONE_ANSWERED_TOOLS,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
pusharyMissingReason,
|
|
31
31
|
refusalOutput,
|
|
32
32
|
withHookHoldBudget
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-5YVBVJOH.js";
|
|
34
34
|
|
|
35
35
|
// src/config-document.ts
|
|
36
36
|
import { parse, stringify } from "smol-toml";
|
|
@@ -1041,6 +1041,327 @@ var toolsCoveredByGateEntry = (coverage, matcher) => {
|
|
|
1041
1041
|
var toolMatches = (match, toolName) => match.kind === "named" ? match.tools.includes(toolName) : toolName.startsWith(match.prefix);
|
|
1042
1042
|
var cursorGateOwnsToolCall = (registration, toolName) => typeof toolName === "string" && registration.some((match) => toolMatches(match, toolName));
|
|
1043
1043
|
|
|
1044
|
+
// ../contracts/src/audit-chain.ts
|
|
1045
|
+
var AUDIT_CHAIN_FORMAT = "pushary-audit-chain-v1";
|
|
1046
|
+
var AUDIT_CHAIN_GENESIS_HASH = "0".repeat(64);
|
|
1047
|
+
var AUDIT_CHAIN_EVENTS = ["asked", "decision"];
|
|
1048
|
+
var AUDIT_PAYLOAD_STATUSES = ["included", "aged_out", "superseded", "changed_since_recorded"];
|
|
1049
|
+
var AUDIT_CHAIN_EXPORT_MAX_ENTRIES = 1e4;
|
|
1050
|
+
var AUDIT_CHECKPOINT_KEY_ID_LENGTH = 16;
|
|
1051
|
+
var AUDIT_CHECKPOINT_PINNED_KEY_IDS = ["6a4173b664d4d7a7"];
|
|
1052
|
+
var AUDIT_CHECKPOINT_INTERVAL_MS = 60 * 60 * 1e3;
|
|
1053
|
+
var AUDIT_CHECKPOINT_SWEEP_MS = 10 * 60 * 1e3;
|
|
1054
|
+
var AUDIT_CHAIN_PASS_INTERVAL_MS = 60 * 1e3;
|
|
1055
|
+
var AUDIT_CHECKPOINT_MAX_AGE_MS = AUDIT_CHECKPOINT_INTERVAL_MS + 2 * AUDIT_CHECKPOINT_SWEEP_MS;
|
|
1056
|
+
var AUDIT_CHAIN_FINDING_SEVERITY = {
|
|
1057
|
+
entry_altered: "tampered",
|
|
1058
|
+
entry_changed: "tampered",
|
|
1059
|
+
unrecorded_change: "unverified",
|
|
1060
|
+
invalid_status: "tampered",
|
|
1061
|
+
decision_rewritten: "tampered",
|
|
1062
|
+
asked_twice: "tampered",
|
|
1063
|
+
row_missing: "unverified",
|
|
1064
|
+
broken_link: "tampered",
|
|
1065
|
+
sequence_gap: "tampered",
|
|
1066
|
+
genesis_mismatch: "tampered",
|
|
1067
|
+
checkpoint_mismatch: "tampered",
|
|
1068
|
+
checkpoint_outside_export: "unverified",
|
|
1069
|
+
bad_signature: "tampered",
|
|
1070
|
+
wrong_key_id: "tampered",
|
|
1071
|
+
unpinned_key: "unverified",
|
|
1072
|
+
history_rewritten: "tampered",
|
|
1073
|
+
conflicting_checkpoint: "tampered",
|
|
1074
|
+
rolled_back: "tampered",
|
|
1075
|
+
older_page: "unverified",
|
|
1076
|
+
unsigned: "unverified",
|
|
1077
|
+
stale_signature: "unverified",
|
|
1078
|
+
older_export: "unverified"
|
|
1079
|
+
};
|
|
1080
|
+
var canonicalAuditPayload = (payload) => `{${Object.keys(payload).sort().map((key) => `${JSON.stringify(key)}:${JSON.stringify(payload[key] ?? null)}`).join(",")}}`;
|
|
1081
|
+
var isFinalAuditDecision = (decision) => decision.response !== null || decision.answeredAt !== null;
|
|
1082
|
+
var auditPayloadHash = (payload, sha256Hex) => sha256Hex(canonicalAuditPayload(payload));
|
|
1083
|
+
var auditEntryMessage = (header) => JSON.stringify([
|
|
1084
|
+
AUDIT_CHAIN_FORMAT,
|
|
1085
|
+
header.prevHash,
|
|
1086
|
+
header.seq,
|
|
1087
|
+
header.event,
|
|
1088
|
+
header.interactionId,
|
|
1089
|
+
header.interactionCreatedAt,
|
|
1090
|
+
header.decisionFinal,
|
|
1091
|
+
header.payloadHash
|
|
1092
|
+
]);
|
|
1093
|
+
var auditCheckpointMessage = (checkpoint) => `${AUDIT_CHAIN_FORMAT}:checkpoint
|
|
1094
|
+
${checkpoint.siteId}
|
|
1095
|
+
${checkpoint.seq}
|
|
1096
|
+
${checkpoint.headHash}
|
|
1097
|
+
${checkpoint.signedAt}`;
|
|
1098
|
+
var auditKeyIdOf = (publicKey, sha256Hex) => sha256Hex(publicKey).slice(0, AUDIT_CHECKPOINT_KEY_ID_LENGTH);
|
|
1099
|
+
var HASH_PATTERN = /^[0-9a-f]{64}$/;
|
|
1100
|
+
var AUDIT_TIMESTAMP_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}Z$/;
|
|
1101
|
+
var EXPORT_TIMESTAMP_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/;
|
|
1102
|
+
var isCalendarInstant = (isoMilliseconds) => {
|
|
1103
|
+
const time = Date.parse(isoMilliseconds);
|
|
1104
|
+
return Number.isFinite(time) && new Date(time).toISOString() === isoMilliseconds;
|
|
1105
|
+
};
|
|
1106
|
+
var isAuditTimestamp = (value) => typeof value === "string" && AUDIT_TIMESTAMP_PATTERN.test(value) && isCalendarInstant(`${value.slice(0, 23)}Z`);
|
|
1107
|
+
var isNullableAuditTimestamp = (value) => value === null || isAuditTimestamp(value);
|
|
1108
|
+
var isExportTimestamp = (value) => typeof value === "string" && EXPORT_TIMESTAMP_PATTERN.test(value) && isCalendarInstant(value);
|
|
1109
|
+
var isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1110
|
+
var isHash = (value) => typeof value === "string" && HASH_PATTERN.test(value);
|
|
1111
|
+
var isText = (value) => typeof value === "string";
|
|
1112
|
+
var isNullableText = (value) => value === null || typeof value === "string";
|
|
1113
|
+
var isNullableNumber = (value) => value === null || typeof value === "number" && Number.isFinite(value);
|
|
1114
|
+
var isSeq = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
1115
|
+
var isNullableSeq = (value) => value === null || isSeq(value);
|
|
1116
|
+
var isAuditChainEvent = (value) => typeof value === "string" && AUDIT_CHAIN_EVENTS.includes(value);
|
|
1117
|
+
var isAuditPayloadStatus = (value) => typeof value === "string" && AUDIT_PAYLOAD_STATUSES.includes(value);
|
|
1118
|
+
var readText = (value, field) => {
|
|
1119
|
+
const fieldValue = value[field];
|
|
1120
|
+
return isText(fieldValue) ? fieldValue : void 0;
|
|
1121
|
+
};
|
|
1122
|
+
var readNullableText = (value, field) => {
|
|
1123
|
+
const fieldValue = value[field];
|
|
1124
|
+
return isNullableText(fieldValue) ? fieldValue : void 0;
|
|
1125
|
+
};
|
|
1126
|
+
var ASKED_TEXT_FIELDS = ["id", "siteId", "type", "content", "createdAt"];
|
|
1127
|
+
var ASKED_NULLABLE_FIELDS = ["questionType", "context", "contextPayloadSha256", "correlationId", "externalId", "sessionId", "agentType", "agentName", "machineId", "toolName", "toolTarget", "requestedByUserId"];
|
|
1128
|
+
var DECISION_NULLABLE_FIELDS = ["response", "responseSource", "note", "decisionOutcome", "decisionOrigin", "decidedByUserId", "decidedByActor", "riskClass", "answeredAt"];
|
|
1129
|
+
var isComplete = (record4, fields) => fields.every((field) => field in record4);
|
|
1130
|
+
var readFields = (value, fields, read) => {
|
|
1131
|
+
const result = {};
|
|
1132
|
+
for (const field of fields) {
|
|
1133
|
+
const fieldValue = read(value, field);
|
|
1134
|
+
if (fieldValue === void 0) return null;
|
|
1135
|
+
result[field] = fieldValue;
|
|
1136
|
+
}
|
|
1137
|
+
return isComplete(result, fields) ? result : null;
|
|
1138
|
+
};
|
|
1139
|
+
var ASKED_PAYLOAD_KEYS = /* @__PURE__ */ new Set(["event", ...ASKED_TEXT_FIELDS, ...ASKED_NULLABLE_FIELDS]);
|
|
1140
|
+
var DECISION_PAYLOAD_KEYS = /* @__PURE__ */ new Set(["event", "id", "autoResolved", "decisionLatencyMs", ...DECISION_NULLABLE_FIELDS]);
|
|
1141
|
+
var hasOnlyKeys = (value, keys2) => Object.keys(value).every((key) => keys2.has(key));
|
|
1142
|
+
var parseAskedPayload = (value) => {
|
|
1143
|
+
const text3 = readFields(value, ASKED_TEXT_FIELDS, readText);
|
|
1144
|
+
const nullable = readFields(value, ASKED_NULLABLE_FIELDS, readNullableText);
|
|
1145
|
+
if (!text3 || !nullable || !hasOnlyKeys(value, ASKED_PAYLOAD_KEYS)) return null;
|
|
1146
|
+
if (nullable.contextPayloadSha256 !== null && !isHash(nullable.contextPayloadSha256)) return null;
|
|
1147
|
+
return { event: "asked", ...text3, ...nullable };
|
|
1148
|
+
};
|
|
1149
|
+
var parseDecisionPayload = (value) => {
|
|
1150
|
+
const id = readText(value, "id");
|
|
1151
|
+
const nullable = readFields(value, DECISION_NULLABLE_FIELDS, readNullableText);
|
|
1152
|
+
const { autoResolved, decisionLatencyMs } = value;
|
|
1153
|
+
if (id === void 0 || !nullable || typeof autoResolved !== "boolean" || !isNullableNumber(decisionLatencyMs)) return null;
|
|
1154
|
+
if (!hasOnlyKeys(value, DECISION_PAYLOAD_KEYS)) return null;
|
|
1155
|
+
return { event: "decision", id, ...nullable, autoResolved, decisionLatencyMs };
|
|
1156
|
+
};
|
|
1157
|
+
var parsePayload = (event, status, value) => {
|
|
1158
|
+
if (status !== "included") return value === null ? null : void 0;
|
|
1159
|
+
if (!isPlainObject(value) || value.event !== event) return void 0;
|
|
1160
|
+
return (event === "asked" ? parseAskedPayload(value) : parseDecisionPayload(value)) ?? void 0;
|
|
1161
|
+
};
|
|
1162
|
+
var parseEntry = (value) => {
|
|
1163
|
+
if (!isPlainObject(value)) return null;
|
|
1164
|
+
const { seq, event, interactionId, interactionCreatedAt, decisionFinal, payloadHash, prevHash, entryHash, recordedAt, payloadStatus } = value;
|
|
1165
|
+
if (!isSeq(seq) || !isAuditChainEvent(event) || !isText(interactionId) || !isAuditTimestamp(interactionCreatedAt) || typeof decisionFinal !== "boolean" || !isHash(payloadHash) || !isHash(prevHash) || !isHash(entryHash) || !isText(recordedAt) || !isAuditPayloadStatus(payloadStatus)) return null;
|
|
1166
|
+
const payload = parsePayload(event, payloadStatus, value.payload);
|
|
1167
|
+
if (payload === void 0) return null;
|
|
1168
|
+
return { seq, event, interactionId, interactionCreatedAt, decisionFinal, payloadHash, prevHash, entryHash, recordedAt, payloadStatus, payload };
|
|
1169
|
+
};
|
|
1170
|
+
var parseAuditChainCheckpoint = (value) => {
|
|
1171
|
+
if (!isPlainObject(value)) return null;
|
|
1172
|
+
const { siteId, seq, headHash, signedAt, keyId, publicKey, signature } = value;
|
|
1173
|
+
if (!isText(siteId) || !isSeq(seq) || !isHash(headHash) || !isAuditTimestamp(signedAt) || !isText(keyId) || !isText(publicKey) || !isText(signature)) return null;
|
|
1174
|
+
return { siteId, seq, headHash, signedAt, keyId, publicKey, signature };
|
|
1175
|
+
};
|
|
1176
|
+
var parseAllOrNothing = (values, parse) => {
|
|
1177
|
+
if (!Array.isArray(values)) return null;
|
|
1178
|
+
const parsed = [];
|
|
1179
|
+
for (const value of values) {
|
|
1180
|
+
const item = parse(value);
|
|
1181
|
+
if (item === null) return null;
|
|
1182
|
+
parsed.push(item);
|
|
1183
|
+
}
|
|
1184
|
+
return parsed;
|
|
1185
|
+
};
|
|
1186
|
+
var entriesFitPage = (entries, beforeSeq) => beforeSeq === null || entries.every((entry) => entry.seq < beforeSeq);
|
|
1187
|
+
var parseSite = (value) => {
|
|
1188
|
+
if (!isPlainObject(value)) return null;
|
|
1189
|
+
const { siteId, siteName, beforeSeq, retentionFloor } = value;
|
|
1190
|
+
if (!isText(siteId) || !isText(siteName) || !isNullableSeq(beforeSeq) || !isNullableAuditTimestamp(retentionFloor)) return null;
|
|
1191
|
+
const entries = parseAllOrNothing(value.entries, parseEntry);
|
|
1192
|
+
const checkpoints = parseAllOrNothing(value.checkpoints, parseAuditChainCheckpoint);
|
|
1193
|
+
if (!entries || !checkpoints || !entriesFitPage(entries, beforeSeq)) return null;
|
|
1194
|
+
return { siteId, siteName, beforeSeq, retentionFloor, entries, checkpoints };
|
|
1195
|
+
};
|
|
1196
|
+
var parseAuditChainExport = (value) => {
|
|
1197
|
+
if (!isPlainObject(value) || value.format !== AUDIT_CHAIN_FORMAT || !isExportTimestamp(value.exportedAt)) return null;
|
|
1198
|
+
const sites = parseAllOrNothing(value.sites, parseSite);
|
|
1199
|
+
return sites && sites.length > 0 ? { format: AUDIT_CHAIN_FORMAT, exportedAt: value.exportedAt, sites } : null;
|
|
1200
|
+
};
|
|
1201
|
+
var boundaryGapFindings = (entries, beforeSeq) => {
|
|
1202
|
+
const findings = beforeSeq === null ? [] : [{ kind: "older_page", beforeSeq }];
|
|
1203
|
+
const first = entries[0];
|
|
1204
|
+
if (first && first.seq > 1 && entries.length < AUDIT_CHAIN_EXPORT_MAX_ENTRIES) findings.push({ kind: "sequence_gap", afterSeq: 0, seq: first.seq });
|
|
1205
|
+
const lastSeq = entries[entries.length - 1]?.seq ?? 0;
|
|
1206
|
+
if (beforeSeq !== null && lastSeq < beforeSeq - 1) findings.push({ kind: "sequence_gap", afterSeq: lastSeq, seq: beforeSeq });
|
|
1207
|
+
return findings;
|
|
1208
|
+
};
|
|
1209
|
+
var linkFindings = (entries) => {
|
|
1210
|
+
const findings = [];
|
|
1211
|
+
entries.forEach((entry, index) => {
|
|
1212
|
+
const previous = entries[index - 1];
|
|
1213
|
+
if (!previous) {
|
|
1214
|
+
if (entry.seq === 1 && entry.prevHash !== AUDIT_CHAIN_GENESIS_HASH) findings.push({ kind: "genesis_mismatch", seq: entry.seq });
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
if (entry.seq !== previous.seq + 1) findings.push({ kind: "sequence_gap", afterSeq: previous.seq, seq: entry.seq });
|
|
1218
|
+
if (entry.prevHash !== previous.entryHash) findings.push({ kind: "broken_link", seq: entry.seq });
|
|
1219
|
+
});
|
|
1220
|
+
return findings;
|
|
1221
|
+
};
|
|
1222
|
+
var entryHashFindings = (entries, crypto) => entries.flatMap((entry) => crypto.sha256Hex(auditEntryMessage(entry)) === entry.entryHash ? [] : [{ kind: "entry_altered", seq: entry.seq }]);
|
|
1223
|
+
var payloadMatchesEntry = (payload, entry, siteId, crypto) => {
|
|
1224
|
+
if (payload.id !== entry.interactionId || auditPayloadHash(payload, crypto.sha256Hex) !== entry.payloadHash) return false;
|
|
1225
|
+
return payload.event === "asked" ? payload.siteId === siteId && payload.createdAt === entry.interactionCreatedAt : isFinalAuditDecision(payload) === entry.decisionFinal;
|
|
1226
|
+
};
|
|
1227
|
+
var lastDecisionSeqByInteraction = (entries) => {
|
|
1228
|
+
const lastSeq = /* @__PURE__ */ new Map();
|
|
1229
|
+
for (const entry of entries) {
|
|
1230
|
+
if (entry.event === "decision") lastSeq.set(entry.interactionId, Math.max(entry.seq, lastSeq.get(entry.interactionId) ?? 0));
|
|
1231
|
+
}
|
|
1232
|
+
return lastSeq;
|
|
1233
|
+
};
|
|
1234
|
+
var goneBeforeRetentionEnded = (entry, retentionFloor) => retentionFloor === null || entry.interactionCreatedAt >= retentionFloor;
|
|
1235
|
+
var payloadFindings = (site, entries, crypto) => {
|
|
1236
|
+
const lastDecisionSeq = lastDecisionSeqByInteraction(entries);
|
|
1237
|
+
return entries.flatMap((entry) => {
|
|
1238
|
+
const invalid = { kind: "invalid_status", seq: entry.seq, status: entry.payloadStatus };
|
|
1239
|
+
const hasLaterDecision = entry.event === "decision" && (lastDecisionSeq.get(entry.interactionId) ?? 0) > entry.seq;
|
|
1240
|
+
switch (entry.payloadStatus) {
|
|
1241
|
+
case "included":
|
|
1242
|
+
if (hasLaterDecision) return [invalid];
|
|
1243
|
+
return entry.payload && payloadMatchesEntry(entry.payload, entry, site.siteId, crypto) ? [] : [{ kind: "entry_changed", seq: entry.seq }];
|
|
1244
|
+
case "changed_since_recorded":
|
|
1245
|
+
if (entry.event === "asked" || hasLaterDecision) return [invalid];
|
|
1246
|
+
return [{ kind: entry.decisionFinal ? "entry_changed" : "unrecorded_change", seq: entry.seq }];
|
|
1247
|
+
case "superseded":
|
|
1248
|
+
return entry.event === "asked" || entry.decisionFinal || !hasLaterDecision && site.beforeSeq === null ? [invalid] : [];
|
|
1249
|
+
case "aged_out":
|
|
1250
|
+
return goneBeforeRetentionEnded(entry, site.retentionFloor) ? [{ kind: "row_missing", seq: entry.seq }] : [];
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1253
|
+
};
|
|
1254
|
+
var decisionSequenceFindings = (entries) => {
|
|
1255
|
+
const asked = /* @__PURE__ */ new Set();
|
|
1256
|
+
const decidedFinally = /* @__PURE__ */ new Set();
|
|
1257
|
+
return entries.flatMap((entry) => {
|
|
1258
|
+
if (entry.event === "asked") {
|
|
1259
|
+
const repeated = asked.has(entry.interactionId);
|
|
1260
|
+
asked.add(entry.interactionId);
|
|
1261
|
+
return repeated ? [{ kind: "asked_twice", seq: entry.seq }] : [];
|
|
1262
|
+
}
|
|
1263
|
+
const afterFinal = decidedFinally.has(entry.interactionId);
|
|
1264
|
+
if (entry.decisionFinal) decidedFinally.add(entry.interactionId);
|
|
1265
|
+
return afterFinal ? [{ kind: "decision_rewritten", seq: entry.seq }] : [];
|
|
1266
|
+
});
|
|
1267
|
+
};
|
|
1268
|
+
var payloadCountsOf = (entries) => ({
|
|
1269
|
+
included: entries.filter((entry) => entry.payloadStatus === "included").length,
|
|
1270
|
+
aged_out: entries.filter((entry) => entry.payloadStatus === "aged_out").length,
|
|
1271
|
+
superseded: entries.filter((entry) => entry.payloadStatus === "superseded").length,
|
|
1272
|
+
changed_since_recorded: entries.filter((entry) => entry.payloadStatus === "changed_since_recorded").length
|
|
1273
|
+
});
|
|
1274
|
+
var findingsForCheckpoint = (checkpoint, siteId, hashBySeq, crypto, pinnedKeyIds) => {
|
|
1275
|
+
const findings = [];
|
|
1276
|
+
const entryHash = hashBySeq.get(checkpoint.seq);
|
|
1277
|
+
if (entryHash === void 0) findings.push({ kind: "checkpoint_outside_export", seq: checkpoint.seq });
|
|
1278
|
+
else if (entryHash !== checkpoint.headHash) findings.push({ kind: "checkpoint_mismatch", seq: checkpoint.seq });
|
|
1279
|
+
if (checkpoint.siteId !== siteId || !crypto.verifyEd25519(auditCheckpointMessage(checkpoint), checkpoint.signature, checkpoint.publicKey)) {
|
|
1280
|
+
findings.push({ kind: "bad_signature", seq: checkpoint.seq });
|
|
1281
|
+
}
|
|
1282
|
+
if (auditKeyIdOf(checkpoint.publicKey, crypto.sha256Hex) !== checkpoint.keyId) findings.push({ kind: "wrong_key_id", seq: checkpoint.seq });
|
|
1283
|
+
else if (!pinnedKeyIds.includes(checkpoint.keyId)) findings.push({ kind: "unpinned_key", seq: checkpoint.seq, keyId: checkpoint.keyId });
|
|
1284
|
+
return findings;
|
|
1285
|
+
};
|
|
1286
|
+
var checkpointWorthRemembering = (findings, pinnedKeyIds) => findings.every((finding) => finding.kind === "unpinned_key" && pinnedKeyIds.length === 0);
|
|
1287
|
+
var freshCheckpointCutoffFor = (exportedAt) => auditTimestampFromDate(new Date(Date.parse(exportedAt) - AUDIT_CHECKPOINT_MAX_AGE_MS));
|
|
1288
|
+
var signatureFindings = (site, lastSeq, exportedAt) => {
|
|
1289
|
+
if (lastSeq === null) return [];
|
|
1290
|
+
const newest = [...site.checkpoints].sort((left, right) => right.seq - left.seq)[0];
|
|
1291
|
+
if (!newest) return [{ kind: "unsigned" }];
|
|
1292
|
+
const unsignedTail = site.beforeSeq === null && lastSeq > newest.seq && newest.signedAt < freshCheckpointCutoffFor(exportedAt);
|
|
1293
|
+
return unsignedTail ? [{ kind: "stale_signature", seq: newest.seq, signedAt: newest.signedAt }] : [];
|
|
1294
|
+
};
|
|
1295
|
+
var newestHeadOf = (heads) => [...heads].sort((left, right) => right.seq - left.seq)[0];
|
|
1296
|
+
var tailFindings = (site, lastSeq, exportedAt, knownForSite) => {
|
|
1297
|
+
if (site.beforeSeq !== null) return [];
|
|
1298
|
+
const beyond = knownForSite.filter((head) => head.seq > lastSeq);
|
|
1299
|
+
const rolledBack = newestHeadOf(beyond.filter((head) => head.exportedAt < exportedAt));
|
|
1300
|
+
if (rolledBack) return [{ kind: "rolled_back", seq: rolledBack.seq }];
|
|
1301
|
+
const seenInLaterExport = newestHeadOf(beyond);
|
|
1302
|
+
return seenInLaterExport ? [{ kind: "older_export", seq: seenInLaterExport.seq, exportedAt: seenInLaterExport.exportedAt }] : [];
|
|
1303
|
+
};
|
|
1304
|
+
var knownHeadFindings = (site, hashBySeq, lastSeq, exportedAt, known) => {
|
|
1305
|
+
const exported = new Map(site.checkpoints.map((checkpoint) => [checkpoint.seq, checkpoint.headHash]));
|
|
1306
|
+
const knownForSite = known.filter((checkpoint) => checkpoint.siteId === site.siteId);
|
|
1307
|
+
const findings = knownForSite.flatMap((checkpoint) => {
|
|
1308
|
+
const found = [];
|
|
1309
|
+
const entryHash = hashBySeq.get(checkpoint.seq);
|
|
1310
|
+
if (entryHash !== void 0 && entryHash !== checkpoint.headHash) found.push({ kind: "history_rewritten", seq: checkpoint.seq });
|
|
1311
|
+
const exportedHash = exported.get(checkpoint.seq);
|
|
1312
|
+
if (exportedHash !== void 0 && exportedHash !== checkpoint.headHash) found.push({ kind: "conflicting_checkpoint", seq: checkpoint.seq });
|
|
1313
|
+
return found;
|
|
1314
|
+
});
|
|
1315
|
+
return [...findings, ...tailFindings(site, lastSeq, exportedAt, knownForSite)];
|
|
1316
|
+
};
|
|
1317
|
+
var verifyAuditChainSite = (site, crypto, options) => {
|
|
1318
|
+
const entries = [...site.entries].sort((left, right) => left.seq - right.seq);
|
|
1319
|
+
const hashBySeq = new Map(entries.map((entry) => [entry.seq, entry.entryHash]));
|
|
1320
|
+
const firstSeq = entries[0]?.seq ?? null;
|
|
1321
|
+
const lastSeq = entries[entries.length - 1]?.seq ?? null;
|
|
1322
|
+
const checkpointResults = site.checkpoints.map((checkpoint) => ({
|
|
1323
|
+
checkpoint,
|
|
1324
|
+
findings: findingsForCheckpoint(checkpoint, site.siteId, hashBySeq, crypto, options.pinnedKeyIds)
|
|
1325
|
+
}));
|
|
1326
|
+
return {
|
|
1327
|
+
siteId: site.siteId,
|
|
1328
|
+
siteName: site.siteName,
|
|
1329
|
+
exportedAt: options.exportedAt,
|
|
1330
|
+
entryCount: entries.length,
|
|
1331
|
+
firstSeq,
|
|
1332
|
+
lastSeq,
|
|
1333
|
+
lastEntryHash: entries[entries.length - 1]?.entryHash ?? null,
|
|
1334
|
+
payloadCounts: payloadCountsOf(entries),
|
|
1335
|
+
signedCheckpoints: site.checkpoints.length,
|
|
1336
|
+
truncated: firstSeq !== null && firstSeq > 1,
|
|
1337
|
+
retentionFloor: site.retentionFloor,
|
|
1338
|
+
findings: [
|
|
1339
|
+
...boundaryGapFindings(entries, site.beforeSeq),
|
|
1340
|
+
...linkFindings(entries),
|
|
1341
|
+
...entryHashFindings(entries, crypto),
|
|
1342
|
+
...payloadFindings(site, entries, crypto),
|
|
1343
|
+
...decisionSequenceFindings(entries),
|
|
1344
|
+
...signatureFindings(site, lastSeq, options.exportedAt),
|
|
1345
|
+
...checkpointResults.flatMap((result) => result.findings),
|
|
1346
|
+
...knownHeadFindings(site, hashBySeq, lastSeq ?? 0, options.exportedAt, options.knownHeads)
|
|
1347
|
+
],
|
|
1348
|
+
verifiedCheckpoints: checkpointResults.filter((result) => checkpointWorthRemembering(result.findings, options.pinnedKeyIds)).map((result) => result.checkpoint)
|
|
1349
|
+
};
|
|
1350
|
+
};
|
|
1351
|
+
var auditChainVerdictTampered = (verdict) => verdict.findings.some((finding) => AUDIT_CHAIN_FINDING_SEVERITY[finding.kind] === "tampered");
|
|
1352
|
+
var auditHeadsToRemember = (verdict) => {
|
|
1353
|
+
if (auditChainVerdictTampered(verdict)) return [];
|
|
1354
|
+
const headOf = (seq, headHash) => ({ siteId: verdict.siteId, seq, headHash, exportedAt: verdict.exportedAt });
|
|
1355
|
+
const newestEntry = verdict.lastSeq !== null && verdict.lastEntryHash !== null ? [headOf(verdict.lastSeq, verdict.lastEntryHash)] : [];
|
|
1356
|
+
return [...verdict.verifiedCheckpoints.map((checkpoint) => headOf(checkpoint.seq, checkpoint.headHash)), ...newestEntry];
|
|
1357
|
+
};
|
|
1358
|
+
var parseAuditKnownHead = (value) => {
|
|
1359
|
+
if (!isPlainObject(value)) return null;
|
|
1360
|
+
const { siteId, seq, headHash, exportedAt } = value;
|
|
1361
|
+
return isText(siteId) && isSeq(seq) && isHash(headHash) && isExportTimestamp(exportedAt) ? { siteId, seq, headHash, exportedAt } : null;
|
|
1362
|
+
};
|
|
1363
|
+
var auditTimestampFromDate = (date) => date.toISOString().replace(/Z$/, "000Z");
|
|
1364
|
+
|
|
1044
1365
|
// ../contracts/src/receipt-evidence.ts
|
|
1045
1366
|
var RECEIPT_TARGET_MAX_LENGTH = 256;
|
|
1046
1367
|
var GIT_BRANCH_MAX_LENGTH = 256;
|
|
@@ -8204,6 +8525,15 @@ var hookActivationResult = (report) => {
|
|
|
8204
8525
|
};
|
|
8205
8526
|
|
|
8206
8527
|
export {
|
|
8528
|
+
AUDIT_CHECKPOINT_PINNED_KEY_IDS,
|
|
8529
|
+
AUDIT_CHECKPOINT_MAX_AGE_MS,
|
|
8530
|
+
AUDIT_CHAIN_FINDING_SEVERITY,
|
|
8531
|
+
parseAllOrNothing,
|
|
8532
|
+
parseAuditChainExport,
|
|
8533
|
+
verifyAuditChainSite,
|
|
8534
|
+
auditChainVerdictTampered,
|
|
8535
|
+
auditHeadsToRemember,
|
|
8536
|
+
parseAuditKnownHead,
|
|
8207
8537
|
redactSecrets,
|
|
8208
8538
|
redactSecretsFromContent,
|
|
8209
8539
|
redactSecretsDeep,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RDUY7MKN.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NKA2PEQQ.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AYWX6M7J.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-QENTGE75.js";
|
|
13
13
|
import {
|
|
14
14
|
isRecord,
|
|
15
15
|
isValidApiKey
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5YVBVJOH.js";
|
|
17
17
|
|
|
18
18
|
// src/shared-mcp-key.ts
|
|
19
19
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
codexHome,
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AYWX6M7J.js";
|
|
11
11
|
import {
|
|
12
12
|
resolvePathBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VAZCGOLS.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-ZVU6WMMU.js";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
forkFinishWithUpgradeLock,
|
|
4
4
|
installWithUpgradeLock,
|
|
5
5
|
releaseAutoUpdateLock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4HBWXZPI.js";
|
|
7
7
|
import {
|
|
8
8
|
phoneStartIsRequired
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4OLWSYX5.js";
|
|
10
10
|
import {
|
|
11
11
|
describeAutoUpdateCheck,
|
|
12
12
|
globalInstallLocation,
|
|
@@ -18,25 +18,25 @@ import {
|
|
|
18
18
|
readAutoUpdateState,
|
|
19
19
|
updateAutoUpdateState,
|
|
20
20
|
upgradeEntryFor
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-SJJCCFD5.js";
|
|
22
22
|
import {
|
|
23
23
|
autoUpdateLock,
|
|
24
24
|
autoUpdateLog,
|
|
25
25
|
autoUpdateState
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-AYWX6M7J.js";
|
|
27
27
|
import {
|
|
28
28
|
execNpm,
|
|
29
29
|
fetchLatestPublishedVersion,
|
|
30
30
|
npmErrorMessage,
|
|
31
31
|
readGlobalCliInstallAt,
|
|
32
32
|
readGlobalPrefix
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-VAZCGOLS.js";
|
|
34
34
|
import {
|
|
35
35
|
EXIT
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-BG4HHB7E.js";
|
|
37
37
|
import {
|
|
38
38
|
NPX_LATEST_COMMAND
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-YDT6TVGN.js";
|
|
40
40
|
import {
|
|
41
41
|
commandsPackage,
|
|
42
42
|
globalUpgradeEntry,
|
|
@@ -2,9 +2,11 @@ import {
|
|
|
2
2
|
atLeast,
|
|
3
3
|
formatVersion,
|
|
4
4
|
quoteIfNeeded,
|
|
5
|
-
shellDoubleQuoted
|
|
5
|
+
shellDoubleQuoted
|
|
6
|
+
} from "./chunk-VAZCGOLS.js";
|
|
7
|
+
import {
|
|
6
8
|
writeFileAtomic
|
|
7
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QENTGE75.js";
|
|
8
10
|
import {
|
|
9
11
|
cmdShimScriptOf
|
|
10
12
|
} from "./chunk-ZVU6WMMU.js";
|
|
@@ -15,7 +17,7 @@ import {
|
|
|
15
17
|
HOOK_LOCATOR_BINARY,
|
|
16
18
|
PRETOOLUSE_GATED_TOOLS,
|
|
17
19
|
withHookHoldBudget
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5YVBVJOH.js";
|
|
19
21
|
|
|
20
22
|
// src/setup/paths.ts
|
|
21
23
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5BX57BGT.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RYUIXLZ5.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AYWX6M7J.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-5YVBVJOH.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|