pushary 1.9.103 → 1.9.105
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 +8 -0
- package/README.md +1 -0
- package/dist/{api-3O3GJV3V.js → api-RL5CPDTH.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 +32 -30
- package/dist/bin/pushary-bell.js +14 -13
- package/dist/bin/pushary-claude.js +42 -41
- package/dist/bin/pushary-clean.js +42 -41
- package/dist/bin/pushary-codex-bridge.js +25 -24
- package/dist/bin/pushary-codex-hook.js +40 -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 +501 -72
- package/dist/bin/pushary-disconnect.js +32 -31
- package/dist/bin/pushary-display-hook.js +21 -20
- package/dist/bin/pushary-doctor.js +63 -61
- package/dist/bin/pushary-elicitation-hook.js +32 -30
- package/dist/bin/pushary-gemini-bridge.js +16 -15
- package/dist/bin/pushary-gemini-hook.js +35 -33
- package/dist/bin/pushary-hook.js +38 -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 +32 -30
- package/dist/bin/pushary-opencode-hook.js +34 -32
- package/dist/bin/pushary-permission-denied-hook.js +37 -34
- package/dist/bin/pushary-permission-hook.js +38 -35
- package/dist/bin/pushary-post-hook.js +32 -30
- package/dist/bin/pushary-prompt-hook.js +32 -30
- package/dist/bin/pushary-session-end-hook.js +34 -32
- package/dist/bin/pushary-session-start-hook.js +42 -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 +32 -30
- package/dist/bin/pushary-stopfailure-hook.js +32 -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-WYJ6QM7K.js → chunk-2HC5ISDW.js} +2 -2
- package/dist/{chunk-FF7L4B3W.js → chunk-43PNDDB3.js} +9 -9
- package/dist/{chunk-2PR5EP7N.js → chunk-4EMPELDR.js} +4 -4
- package/dist/{chunk-3OIUMHHO.js → chunk-4XE3DVF7.js} +2 -2
- package/dist/{chunk-EOD3DBIN.js → chunk-5IAW6G3K.js} +3 -3
- package/dist/{chunk-QD57EL3I.js → chunk-6DKMZBRK.js} +3 -3
- package/dist/{chunk-MP3SEXXJ.js → chunk-76JOLPST.js} +1 -1
- package/dist/{chunk-ZXK46QT4.js → chunk-772NHSQB.js} +2 -2
- package/dist/{chunk-JUA7MX2V.js → chunk-A37RKFI3.js} +4 -4
- package/dist/{chunk-TLERJKSE.js → chunk-ASCQXNCL.js} +1 -1
- package/dist/{chunk-WZNLWDSL.js → chunk-ATVZAEM5.js} +7 -7
- package/dist/{chunk-WPK2UWDU.js → chunk-B5Q44HKN.js} +2 -2
- package/dist/{chunk-HYAQIKYB.js → chunk-B7O4CXFX.js} +6 -6
- package/dist/{chunk-KZERVKTD.js → chunk-BG4HHB7E.js} +2 -1
- package/dist/{chunk-3Q2X3T3U.js → chunk-CJTJ55DR.js} +1 -1
- package/dist/{chunk-SRE6XJ3K.js → chunk-CKWV3T7O.js} +7 -7
- package/dist/{chunk-AZSOH2SF.js → chunk-DA57ZI62.js} +2 -2
- package/dist/{chunk-WVAJSBI2.js → chunk-DH22FQAS.js} +3 -3
- package/dist/{chunk-JPKJBKZE.js → chunk-DIVVLBZZ.js} +9 -9
- package/dist/{chunk-KTM2X3XQ.js → chunk-DS672F57.js} +16 -16
- package/dist/{chunk-7BIVBOD5.js → chunk-EMSRB2KH.js} +5 -5
- package/dist/{chunk-T7G6IIV4.js → chunk-FE5JENEJ.js} +3 -3
- package/dist/{chunk-JECH4NJL.js → chunk-FJYUB3ZK.js} +6 -4
- package/dist/{chunk-4TVLPGJV.js → chunk-FUTFQSRA.js} +1 -1
- package/dist/{chunk-UQWEH7CK.js → chunk-G5HGV6D4.js} +5 -5
- package/dist/{chunk-MK2XE66G.js → chunk-GBHP3LML.js} +7 -5
- package/dist/{chunk-J6SSLXSU.js → chunk-GESW4OSZ.js} +4 -4
- package/dist/{chunk-KOUB4ZLX.js → chunk-GKCDMAUM.js} +1 -1
- package/dist/{chunk-VJOMBYY5.js → chunk-GUIS6ASL.js} +1 -1
- package/dist/{chunk-KACD6W6J.js → chunk-HH5NNPB5.js} +1 -1
- package/dist/{chunk-3ITURBPE.js → chunk-HLYZEZOI.js} +5 -5
- package/dist/{chunk-NZQEABRO.js → chunk-HONSMBF2.js} +13 -11
- package/dist/{chunk-G7RMOSRX.js → chunk-HXBQTPKC.js} +1 -1
- package/dist/{chunk-6N5DQG5F.js → chunk-I3IUS4SR.js} +2 -2
- package/dist/{chunk-ZCYLCD6L.js → chunk-IAASPG5B.js} +5 -5
- package/dist/{chunk-YETNUPV5.js → chunk-IGO5NDQY.js} +3 -3
- package/dist/{chunk-PM34Z5WX.js → chunk-IHQRLJEP.js} +12 -12
- package/dist/{chunk-X3HBR57D.js → chunk-J2HIFUAT.js} +7 -7
- package/dist/{chunk-7OZOFTTB.js → chunk-J5PUKKCT.js} +10 -9
- package/dist/{chunk-O7ITTNDD.js → chunk-JCSJEMTA.js} +210 -60
- package/dist/{chunk-AWF5WICI.js → chunk-JDGLNYDZ.js} +2 -2
- package/dist/{chunk-UOE26LPT.js → chunk-JLJJRBTD.js} +8 -7
- package/dist/{chunk-Z2TX7DVU.js → chunk-KHZCJP7P.js} +15 -13
- package/dist/{chunk-5PW25NHB.js → chunk-LK3WA6MK.js} +5 -5
- package/dist/{chunk-KLJ2CTT7.js → chunk-LL7SW4RL.js} +4 -4
- package/dist/{chunk-4QO267OY.js → chunk-LMDXQIYT.js} +1 -1
- package/dist/{chunk-VD6CAELE.js → chunk-MFJHLVIZ.js} +11 -95
- package/dist/{chunk-E7WJQBK3.js → chunk-MLLL2ET6.js} +17 -61
- package/dist/{chunk-COBOR3ST.js → chunk-NM44KCO6.js} +6 -4
- package/dist/{chunk-4FAJQPFY.js → chunk-O5TB2LMQ.js} +338 -0
- package/dist/{chunk-AVXG5QB2.js → chunk-OBZQPBUI.js} +5 -5
- package/dist/chunk-OINGJICB.js +108 -0
- package/dist/{chunk-RMFL62HR.js → chunk-P3H6I656.js} +14 -12
- package/dist/{chunk-Y7KRX7U4.js → chunk-P3VVRBBI.js} +1 -1
- package/dist/{chunk-V5DV7XZN.js → chunk-PFZCLG55.js} +4 -4
- package/dist/{chunk-2S5J5YI2.js → chunk-QCFWJZGT.js} +5 -5
- package/dist/{chunk-SA4PCB6N.js → chunk-RKQVMFHN.js} +11 -93
- package/dist/{chunk-LURFSDCL.js → chunk-ROVLRXBI.js} +1 -1
- package/dist/{chunk-JKOAAIJD.js → chunk-S2TTGX6F.js} +5 -5
- package/dist/{chunk-Y3SZVZF6.js → chunk-S75UO75C.js} +2 -2
- package/dist/chunk-T5I4PKOQ.js +122 -0
- package/dist/{chunk-3K7PB5LI.js → chunk-TXMYET7E.js} +3 -3
- package/dist/{chunk-CQ7QE4W2.js → chunk-UUJQK7DJ.js} +1 -1
- package/dist/{chunk-SXAZPWL7.js → chunk-UXIUCMFO.js} +8 -6
- package/dist/{chunk-JVE4P54I.js → chunk-VCWLGM77.js} +5 -3
- package/dist/{chunk-RVSRPDRF.js → chunk-VKTW5WVB.js} +2 -2
- package/dist/{chunk-T6TQETDN.js → chunk-WTREXZGS.js} +4 -4
- package/dist/chunk-WUIWHGKF.js +56 -0
- package/dist/{chunk-IOQ3ZCAE.js → chunk-X3QG5RT5.js} +1 -1
- package/dist/{chunk-O5ZKMUTP.js → chunk-X4TZN52V.js} +6 -6
- package/dist/{chunk-AHIAB7JQ.js → chunk-XN527J4W.js} +1 -1
- package/dist/{chunk-PWGD5EP6.js → chunk-YDQ6OJMF.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-AFGMZZEB.js → chunk-Z5FV7LTD.js} +2 -2
- package/dist/{chunk-BQHZRH6S.js → chunk-ZCBTCW3T.js} +26 -110
- package/dist/{codex-app-cards-switch-D475JLP5.js → codex-app-cards-switch-FD2ZWLYL.js} +13 -12
- package/dist/{codex-desktop-launch-WOPEZMO6.js → codex-desktop-launch-BN5OABPN.js} +1 -1
- package/dist/{codex-session-launch-AWWECV2L.js → codex-session-launch-O3PHQWTS.js} +22 -21
- package/dist/{config-A5EC37VZ.js → config-KWP7UXYG.js} +3 -3
- package/dist/{global-upgrade-V6FA6MUF.js → global-upgrade-NBSY5436.js} +12 -11
- package/dist/{identity-BEPQQHNR.js → identity-RP5I7KTV.js} +5 -4
- package/dist/{live-capabilities-EAM2QN73.js → live-capabilities-XC6C47ZH.js} +6 -5
- package/dist/{paths-2IEEYSHM.js → paths-OE5APZ4Q.js} +8 -3
- package/dist/reapply-DRZ32BIB.js +65 -0
- package/dist/src/index.js +39 -36
- package/dist/{upgrade-lock-DLGVC34L.js → upgrade-lock-LWTVHYAJ.js} +5 -4
- package/dist/usage-5YESCANM.js +11 -0
- package/package.json +2 -1
- package/dist/reapply-LDCMRN6Q.js +0 -64
- package/dist/usage-U6H5UFS2.js +0 -11
|
@@ -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;
|
|
@@ -3187,6 +3508,11 @@ var MIN_SAFE_CLI_VERSION = formatReleaseVersion(MIN_SAFE_RELEASE);
|
|
|
3187
3508
|
var AUTO_UPDATE_RESULTS = ["updated", "current", "needs_manual", "failed", "finish_pending", "finish_blocked"];
|
|
3188
3509
|
var isAutoUpdateResult = (value) => typeof value === "string" && AUTO_UPDATE_RESULTS.includes(value);
|
|
3189
3510
|
|
|
3511
|
+
// ../contracts/src/hook-wiring-report.ts
|
|
3512
|
+
var HOOK_WIRING_REPORT_VERSION = 1;
|
|
3513
|
+
var HOOK_WIRING_PROFILE_LENGTH = 16;
|
|
3514
|
+
var HOOK_WIRING_PROFILE_PATTERN = new RegExp(`^[0-9a-f]{${HOOK_WIRING_PROFILE_LENGTH}}$`);
|
|
3515
|
+
|
|
3190
3516
|
// ../contracts/src/answer-drafts.ts
|
|
3191
3517
|
var ANSWER_DRAFT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
3192
3518
|
|
|
@@ -8204,6 +8530,15 @@ var hookActivationResult = (report) => {
|
|
|
8204
8530
|
};
|
|
8205
8531
|
|
|
8206
8532
|
export {
|
|
8533
|
+
AUDIT_CHECKPOINT_PINNED_KEY_IDS,
|
|
8534
|
+
AUDIT_CHECKPOINT_MAX_AGE_MS,
|
|
8535
|
+
AUDIT_CHAIN_FINDING_SEVERITY,
|
|
8536
|
+
parseAllOrNothing,
|
|
8537
|
+
parseAuditChainExport,
|
|
8538
|
+
verifyAuditChainSite,
|
|
8539
|
+
auditChainVerdictTampered,
|
|
8540
|
+
auditHeadsToRemember,
|
|
8541
|
+
parseAuditKnownHead,
|
|
8207
8542
|
redactSecrets,
|
|
8208
8543
|
redactSecretsFromContent,
|
|
8209
8544
|
redactSecretsDeep,
|
|
@@ -8282,6 +8617,7 @@ export {
|
|
|
8282
8617
|
CURSOR_GATE_COVERAGE,
|
|
8283
8618
|
isCursorHookPayload,
|
|
8284
8619
|
NO_CURSOR_GATE,
|
|
8620
|
+
matcherMatchesEveryCall,
|
|
8285
8621
|
toolsCoveredByGateEntry,
|
|
8286
8622
|
cursorGateOwnsToolCall,
|
|
8287
8623
|
claudeTurnEndOutput,
|
|
@@ -8313,6 +8649,8 @@ export {
|
|
|
8313
8649
|
withDeclinedAgent,
|
|
8314
8650
|
withoutDeclinedAgent,
|
|
8315
8651
|
isAutoUpdateResult,
|
|
8652
|
+
HOOK_WIRING_REPORT_VERSION,
|
|
8653
|
+
HOOK_WIRING_PROFILE_LENGTH,
|
|
8316
8654
|
SESSION_HISTORY_BACKFILL_LIMIT_BYTES,
|
|
8317
8655
|
PERSONAL_QUESTION_CAPABILITY,
|
|
8318
8656
|
isQuestionOwner,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IHQRLJEP.js";
|
|
4
4
|
import {
|
|
5
5
|
nativeClaudeInstallPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ROVLRXBI.js";
|
|
7
7
|
import {
|
|
8
8
|
grokHome
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JLJJRBTD.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeConfigDir,
|
|
12
12
|
clineDataDirectory,
|
|
13
13
|
codexHomeFrom
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-JCSJEMTA.js";
|
|
15
15
|
import {
|
|
16
16
|
HOOK_COMPATIBLE_PROFILES
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
18
18
|
|
|
19
19
|
// src/vscode-config.ts
|
|
20
20
|
import { homedir } from "os";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
pusharyHookExecutable
|
|
3
|
+
} from "./chunk-MFJHLVIZ.js";
|
|
4
|
+
import {
|
|
5
|
+
bridgeResolvesToApp,
|
|
6
|
+
cursorUserHooks,
|
|
7
|
+
executableFileName,
|
|
8
|
+
isBridgeLocator,
|
|
9
|
+
liveBridgeProbe
|
|
10
|
+
} from "./chunk-JCSJEMTA.js";
|
|
11
|
+
import {
|
|
12
|
+
atLeast,
|
|
13
|
+
parseVersion
|
|
14
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
15
|
+
import {
|
|
16
|
+
CURSOR_GATE_COVERAGE,
|
|
17
|
+
CURSOR_GATE_SCRIPT,
|
|
18
|
+
HOOK_VERSION_PATTERN,
|
|
19
|
+
NO_CURSOR_GATE,
|
|
20
|
+
cursorGateOwnsToolCall,
|
|
21
|
+
isCursorHookPayload,
|
|
22
|
+
isRecord,
|
|
23
|
+
toolsCoveredByGateEntry
|
|
24
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
25
|
+
|
|
26
|
+
// src/cursor-gate-registration.ts
|
|
27
|
+
import { dirname, isAbsolute, join, resolve } from "path";
|
|
28
|
+
var FIRST_PLUGIN_VERSION_HANDLING = {
|
|
29
|
+
beforeShellExecution: [0, 1, 0],
|
|
30
|
+
beforeMCPExecution: [0, 2, 1],
|
|
31
|
+
preToolUse: [0, 2, 2]
|
|
32
|
+
};
|
|
33
|
+
var COMMAND_HOOK_TYPE = "command";
|
|
34
|
+
var PLUGIN_MANIFEST = join(".cursor-plugin", "plugin.json");
|
|
35
|
+
var isCursorGateScript = (executable) => executableFileName(executable) === CURSOR_GATE_SCRIPT;
|
|
36
|
+
var fromHooksDirectory = (path, environment) => isAbsolute(path) ? path : resolve(dirname(environment.hooksFile), path);
|
|
37
|
+
var pluginManifestBeside = (script) => join(dirname(dirname(script)), PLUGIN_MANIFEST);
|
|
38
|
+
var versionIn = (manifest) => {
|
|
39
|
+
try {
|
|
40
|
+
const parsed = JSON.parse(manifest);
|
|
41
|
+
return isRecord(parsed) && typeof parsed.version === "string" && HOOK_VERSION_PATTERN.test(parsed.version) ? parseVersion(parsed.version) : null;
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var pluginVersionOf = (script, probe) => {
|
|
47
|
+
const manifest = probe.readFile(pluginManifestBeside(script));
|
|
48
|
+
return manifest === null ? null : versionIn(manifest);
|
|
49
|
+
};
|
|
50
|
+
var gateScriptHandles = (script, event, probe) => {
|
|
51
|
+
if (!probe.exists(script)) return false;
|
|
52
|
+
const version = pluginVersionOf(script, probe);
|
|
53
|
+
return version !== null && atLeast(version, FIRST_PLUGIN_VERSION_HANDLING[event]);
|
|
54
|
+
};
|
|
55
|
+
var isLiveCursorGateCommand = (command, event, environment) => {
|
|
56
|
+
const executable = pusharyHookExecutable(command);
|
|
57
|
+
if (executable === null) return false;
|
|
58
|
+
const target = fromHooksDirectory(executable, environment);
|
|
59
|
+
if (isCursorGateScript(executable)) return gateScriptHandles(target, event, environment.probe);
|
|
60
|
+
return isBridgeLocator(executable) && bridgeResolvesToApp(target, environment.probe);
|
|
61
|
+
};
|
|
62
|
+
var isCommandHook = (entry) => entry.type === void 0 || entry.type === COMMAND_HOOK_TYPE;
|
|
63
|
+
var entriesOn = (hooks, event) => {
|
|
64
|
+
const entries = Object.hasOwn(hooks, event) ? hooks[event] : void 0;
|
|
65
|
+
return Array.isArray(entries) ? entries.filter(isRecord) : [];
|
|
66
|
+
};
|
|
67
|
+
var runsALiveGate = (entry, event, isLiveGate) => isCommandHook(entry) && typeof entry.command === "string" && isLiveGate(entry.command, event);
|
|
68
|
+
var toolsCoveredOn = (hooks, coverage, isLiveGate) => entriesOn(hooks, coverage.event).filter((entry) => runsALiveGate(entry, coverage.event, isLiveGate)).flatMap((entry) => toolsCoveredByGateEntry(coverage, entry.matcher) ?? []);
|
|
69
|
+
var cursorGateRegistrationOf = (document, isLiveGate) => {
|
|
70
|
+
if (!isRecord(document) || !isRecord(document.hooks)) return NO_CURSOR_GATE;
|
|
71
|
+
const hooks = document.hooks;
|
|
72
|
+
return CURSOR_GATE_COVERAGE.flatMap((coverage) => toolsCoveredOn(hooks, coverage, isLiveGate));
|
|
73
|
+
};
|
|
74
|
+
var coversEveryTool = (covers, covered) => {
|
|
75
|
+
if (covers.kind === "prefix") return covered.some((match) => match.kind === "prefix" && match.prefix === covers.prefix);
|
|
76
|
+
return covers.tools.every((tool) => covered.some((match) => match.kind === "named" && match.tools.includes(tool)));
|
|
77
|
+
};
|
|
78
|
+
var NO_LIVE_CURSOR_GATE = { full: [], partial: [] };
|
|
79
|
+
var liveCursorGateCoverage = (document, environment) => {
|
|
80
|
+
if (!isRecord(document) || !isRecord(document.hooks)) return NO_LIVE_CURSOR_GATE;
|
|
81
|
+
const hooks = document.hooks;
|
|
82
|
+
const isLiveGate = (command, event) => isLiveCursorGateCommand(command, event, environment);
|
|
83
|
+
const coverage = CURSOR_GATE_COVERAGE.map((gate) => {
|
|
84
|
+
const covered = toolsCoveredOn(hooks, gate, isLiveGate);
|
|
85
|
+
return { event: gate.event, coversEveryTool: coversEveryTool(gate.covers, covered), coversSomeTool: covered.length > 0 };
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
full: coverage.filter((gate) => gate.coversEveryTool).map((gate) => gate.event),
|
|
89
|
+
partial: coverage.filter((gate) => gate.coversSomeTool && !gate.coversEveryTool).map((gate) => gate.event)
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
var userCursorGateEnvironment = () => ({ hooksFile: cursorUserHooks(), probe: liveBridgeProbe() });
|
|
93
|
+
var readCursorGateRegistration = (environment = userCursorGateEnvironment()) => {
|
|
94
|
+
try {
|
|
95
|
+
const raw = environment.probe.readFile(environment.hooksFile);
|
|
96
|
+
if (raw === null) return NO_CURSOR_GATE;
|
|
97
|
+
return cursorGateRegistrationOf(JSON.parse(raw), (command, event) => isLiveCursorGateCommand(command, event, environment));
|
|
98
|
+
} catch {
|
|
99
|
+
return NO_CURSOR_GATE;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var cursorGateOwnsClaudeCall = (payload, readRegistration) => isCursorHookPayload(payload) && cursorGateOwnsToolCall(readRegistration(), payload.tool_name);
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
liveCursorGateCoverage,
|
|
106
|
+
readCursorGateRegistration,
|
|
107
|
+
cursorGateOwnsClaudeCall
|
|
108
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VKTW5WVB.js";
|
|
4
4
|
import {
|
|
5
5
|
hermesReceiptPaths,
|
|
6
6
|
hermesSetupPredatesThePluginFolder,
|
|
7
7
|
installHermesPlugin,
|
|
8
8
|
refreshHermesPluginFiles,
|
|
9
9
|
shippedHermesPlugin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NM44KCO6.js";
|
|
11
11
|
import {
|
|
12
12
|
fxIgnoresInstructionsFile,
|
|
13
13
|
fxInstructionsBody,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
macAppFxBridge,
|
|
17
17
|
refreshClineKey,
|
|
18
18
|
switchFxHttpEntryToBridge
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-UXIUCMFO.js";
|
|
20
20
|
import {
|
|
21
21
|
OPENCODE_HOOK_BINARY,
|
|
22
22
|
agentHookOwner,
|
|
@@ -28,16 +28,16 @@ import {
|
|
|
28
28
|
openCodePluginDir,
|
|
29
29
|
openCodeWired,
|
|
30
30
|
withOpenCodeAskRules
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-IHQRLJEP.js";
|
|
32
32
|
import {
|
|
33
33
|
detectClaudeVersion
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-IGO5NDQY.js";
|
|
35
35
|
import {
|
|
36
36
|
addCompatibleHooks,
|
|
37
37
|
compatibleConfigFile,
|
|
38
38
|
compatibleInstructionsFile,
|
|
39
39
|
hasCompatibleHooks
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-JLJJRBTD.js";
|
|
41
41
|
import {
|
|
42
42
|
GEMINI_HOOK_BINARY,
|
|
43
43
|
addGeminiHooks,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
geminiWired,
|
|
50
50
|
hasGeminiHooks,
|
|
51
51
|
planHooks
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-MFJHLVIZ.js";
|
|
53
53
|
import {
|
|
54
54
|
CLAUDE_HOOK_BINARY,
|
|
55
55
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -95,21 +95,23 @@ import {
|
|
|
95
95
|
renderAgentInstructions,
|
|
96
96
|
supportedClaudeEvents,
|
|
97
97
|
vscodePluginMcp
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-JCSJEMTA.js";
|
|
99
99
|
import {
|
|
100
100
|
formatVersion,
|
|
101
101
|
hookCommandsUseBareNames,
|
|
102
|
-
readJsonSafe,
|
|
103
102
|
resolveGlobalBinDir,
|
|
104
|
-
resolveGlobalBinary
|
|
103
|
+
resolveGlobalBinary
|
|
104
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
105
|
+
import {
|
|
106
|
+
readJsonSafe,
|
|
105
107
|
writeFileAtomic,
|
|
106
108
|
writeJsonAtomic
|
|
107
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
108
110
|
import {
|
|
109
111
|
HOOK_COMPATIBLE_PROFILES,
|
|
110
112
|
isCompatibleAgentType,
|
|
111
113
|
isRecord
|
|
112
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
113
115
|
|
|
114
116
|
// src/reapply.ts
|
|
115
117
|
import { dirname, join } from "path";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EMSRB2KH.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LL7SW4RL.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GKCDMAUM.js";
|
|
10
10
|
import {
|
|
11
11
|
isRecord,
|
|
12
12
|
isToolErrorResult,
|
|
13
13
|
toolFailureCodeOfResult
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
15
15
|
|
|
16
16
|
// src/retry.ts
|
|
17
17
|
var isRetryable = (err) => {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
notificationAnswerStep
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X4TZN52V.js";
|
|
4
4
|
import {
|
|
5
5
|
canChangeApprovalSettings
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2HC5ISDW.js";
|
|
7
7
|
import {
|
|
8
8
|
matchMacAccountStep,
|
|
9
9
|
retryAgentCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FJYUB3ZK.js";
|
|
11
11
|
import {
|
|
12
12
|
EXIT
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BG4HHB7E.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YDQ6OJMF.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/closing.ts
|
|
19
19
|
var ACTIVITY_URL = "pushary.com/dashboard/agent/activity";
|