@gitroll/tacitt-cli 0.4.0 → 0.4.2
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/dist/{agent-setup-CQRWVUWR.mjs → agent-setup-Bpsi-BCv.mjs} +2 -2
- package/dist/agent-setup-worker.mjs +5 -5
- package/dist/cli.mjs +81 -27
- package/dist/codex-title-worker.mjs +1 -1
- package/dist/configured-preview-worker.mjs +5 -5
- package/dist/configured-session-worker.mjs +5 -5
- package/dist/{frame-waS5FnN5.mjs → frame-IeDOLy1o.mjs} +1 -1
- package/dist/{heap-BaTNC9kf.mjs → heap-DiOlSa8T.mjs} +6 -6
- package/dist/inspection-worker.mjs +4 -4
- package/dist/{job-DrcpSL_9.mjs → job-BII94L2c.mjs} +3 -3
- package/dist/{locate-U3-nkird.mjs → locate-CBiw-CJK.mjs} +5 -0
- package/dist/{model-D7UnGeag.mjs → model-DGTsARtV.mjs} +1 -1
- package/dist/operation-executor.mjs +3 -3
- package/dist/preview-worker.mjs +1 -1
- package/dist/privacy-validator.mjs +1 -1
- package/dist/{query-ByD0Rp_o.mjs → query-CVqWNFYf.mjs} +886 -269
- package/dist/{run-3UIkr7GZ.mjs → run-BGlf-W0M.mjs} +4 -4
- package/dist/{src-DES7hBAP.mjs → src-37kIclGK.mjs} +170 -41
- package/dist/{src-DNn7SifS.mjs → src-CBTvOa44.mjs} +46 -3
- package/dist/{src-CmP73EcD.mjs → src-D4nrfC2S.mjs} +222 -19
- package/dist/store-database-worker.mjs +1 -1
- package/dist/web/assets/index-D3g_ATU-.js +69 -0
- package/dist/web/assets/{index-Clg6Pfv_.css → index-D5DEG5Ue.css} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/skills/tacitt/SKILL.md +3 -3
- package/skills/tacitt/references/INDEX.md +10 -10
- package/skills/tacitt/references/commands.md +2 -0
- package/skills/tacitt/references/journey.md +3 -3
- package/skills/tacitt/references/send.md +38 -12
- package/skills/tacitt/scripts/INDEX.md +36 -36
- package/skills/tacitt/scripts/journey-card-consolidation.mjs +2 -4
- package/skills/tacitt/scripts/journey-state.d.mts +30 -0
- package/skills/tacitt/scripts/journey-state.mjs +56 -3
- package/skills/tacitt/scripts/journey-tasks.d.mts +8 -0
- package/skills/tacitt/scripts/journey-tasks.mjs +4 -1
- package/skills/tacitt/scripts/privacy-validator.mjs +2 -0
- package/skills/tacitt/scripts/review.mjs +110 -9
- package/dist/web/assets/index-BkuUI3Eu.js +0 -67
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { tn as sessionSchema } from "./locate-
|
|
2
|
-
import { t as createZstdFrameCheck$1 } from "./frame-
|
|
3
|
-
import "./src-
|
|
4
|
-
import { a as isRecord } from "./model-
|
|
1
|
+
import { tn as sessionSchema } from "./locate-CBiw-CJK.mjs";
|
|
2
|
+
import { t as createZstdFrameCheck$1 } from "./frame-IeDOLy1o.mjs";
|
|
3
|
+
import "./src-CBTvOa44.mjs";
|
|
4
|
+
import { a as isRecord } from "./model-DGTsARtV.mjs";
|
|
5
5
|
import { constants } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { lstat, open, stat } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { An as nativeBoolean, Hn as defaultLimits, In as retainedMainTextNodes, Mn as nativeItems, Nn as nativeText, Qt as sourceSnapshotId, Tn as parseNativeRecord, Zt as observeSource, jn as nativeField, nr as ProcessingError, vn as walkNativeFields } from "./locate-
|
|
2
|
-
import { Ot as nativeAdapterVersions, ni as gitMetadataBudgetBytes, tt as reviewInventory } from "./src-
|
|
3
|
-
import { a as isRecord, i as errorCode, n as checkDiscoveryAbort, o as unresolvedMetadata, r as discoveryBounds, t as DiscoveryWarnings } from "./model-
|
|
4
|
-
import { c as previewLimits, d as checkOpenSource, f as checkSource, h as openSource, i as pageFits, l as previewSourceVersion, m as noSymlinks, p as fileSnapshot, r as previewHeapLimits, s as previewMessageSchema, u as createZstdFrameCheck } from "./run-
|
|
1
|
+
import { An as nativeBoolean, Hn as defaultLimits, In as retainedMainTextNodes, Mn as nativeItems, Nn as nativeText, Qt as sourceSnapshotId, Tn as parseNativeRecord, Zt as observeSource, jn as nativeField, nr as ProcessingError, vn as walkNativeFields } from "./locate-CBiw-CJK.mjs";
|
|
2
|
+
import { Ot as nativeAdapterVersions, ni as gitMetadataBudgetBytes, tt as reviewInventory } from "./src-CBTvOa44.mjs";
|
|
3
|
+
import { a as isRecord, i as errorCode, n as checkDiscoveryAbort, o as unresolvedMetadata, r as discoveryBounds, t as DiscoveryWarnings } from "./model-DGTsARtV.mjs";
|
|
4
|
+
import { c as previewLimits, d as checkOpenSource, f as checkSource, h as openSource, i as pageFits, l as previewSourceVersion, m as noSymlinks, p as fileSnapshot, r as previewHeapLimits, s as previewMessageSchema, u as createZstdFrameCheck } from "./run-BGlf-W0M.mjs";
|
|
5
5
|
import { a as titleHintLimits, n as titleHeapLimits, o as titleInputSchema, r as decodeTitleError, s as titleReplySchema } from "./heap-1FYhGds4.mjs";
|
|
6
6
|
import { constants } from "node:fs";
|
|
7
7
|
import { lstat, open, opendir, readFile, readdir, realpath, stat } from "node:fs/promises";
|
|
@@ -672,13 +672,18 @@ const excludedRecords = /* @__PURE__ */ new Set([
|
|
|
672
672
|
"tools-used"
|
|
673
673
|
]);
|
|
674
674
|
/** Prove every conversational carrier, rather than trusting a deduplicated diagnostic node. */
|
|
675
|
-
function claudeMainProseComplete(root, selection) {
|
|
675
|
+
function claudeMainProseComplete(root, selection, onAnomaly) {
|
|
676
676
|
if (root.kind !== "object" || selection.diagnostics.some((item) => item.code === "unknown-source-role")) return false;
|
|
677
677
|
const type = nativeText(nativeField(root, "type"));
|
|
678
|
+
const skipped = (shape) => {
|
|
679
|
+
onAnomaly?.(shape);
|
|
680
|
+
return true;
|
|
681
|
+
};
|
|
678
682
|
if (excludedRecords.has(type ?? "")) return true;
|
|
679
683
|
const metaContext = nativeBoolean(nativeField(root, "isMeta")) === true || nativeBoolean(nativeField(root, "isCompactSummary")) === true || type === "assistant";
|
|
680
684
|
const text = (node) => {
|
|
681
685
|
if (node?.kind !== "string") return false;
|
|
686
|
+
if (selection.omitRecord === true) return true;
|
|
682
687
|
const edit = selection.edits.find((item) => item.nodeId === node.id);
|
|
683
688
|
if (!edit) return false;
|
|
684
689
|
const remainder = edit.replacement ?? (edit.mode.kind === "remove" ? "" : node.value);
|
|
@@ -691,32 +696,40 @@ function claudeMainProseComplete(root, selection) {
|
|
|
691
696
|
"command-input"
|
|
692
697
|
].includes(edit.role);
|
|
693
698
|
};
|
|
694
|
-
const content = (node, role) => {
|
|
699
|
+
const content = (node, role, queued = false) => {
|
|
695
700
|
if (node?.kind === "string") return text(node);
|
|
696
701
|
if (node?.kind !== "array") return false;
|
|
697
702
|
return node.items.every((block) => {
|
|
698
703
|
if (block.kind !== "object") return false;
|
|
699
704
|
const kind = nativeText(nativeField(block, "type"));
|
|
700
705
|
if (kind === "text") return text(nativeField(block, "text"));
|
|
701
|
-
if (role === "user") return [
|
|
706
|
+
if (role === "user" && (queued || nativeBoolean(nativeField(root, "isSidechain")) !== true)) return [
|
|
702
707
|
"tool_result",
|
|
703
708
|
"image",
|
|
704
709
|
"document"
|
|
705
710
|
].includes(kind ?? "");
|
|
706
|
-
|
|
711
|
+
if ((role === "user" ? [
|
|
712
|
+
"tool_result",
|
|
713
|
+
"image",
|
|
714
|
+
"document"
|
|
715
|
+
] : [
|
|
707
716
|
"tool_use",
|
|
708
717
|
"thinking",
|
|
709
718
|
"redacted_thinking"
|
|
710
|
-
].includes(kind ?? "");
|
|
719
|
+
]).includes(kind ?? "")) return true;
|
|
720
|
+
return skipped("claude-block");
|
|
711
721
|
});
|
|
712
722
|
};
|
|
713
723
|
if (type === "attachment") {
|
|
714
|
-
if (selection.omitRecord === true) return true;
|
|
715
724
|
const attachment = nativeField(root, "attachment");
|
|
716
|
-
if (nativeText(nativeField(attachment, "type"))
|
|
717
|
-
|
|
725
|
+
if (nativeText(nativeField(attachment, "type")) === "queued_command") return selection.omitRecord === true || content(nativeField(attachment, "prompt"), "user", true);
|
|
726
|
+
if (nativeField(root, "message") || nativeText(nativeField(nativeField(root, "origin"), "kind")) === "human" || nativeText(nativeField(nativeField(attachment, "origin"), "kind")) === "human") return false;
|
|
727
|
+
return selection.omitRecord === true;
|
|
728
|
+
}
|
|
729
|
+
if (type !== "user" && type !== "assistant") {
|
|
730
|
+
if (!type || nativeField(root, "message") || nativeText(nativeField(nativeField(root, "origin"), "kind")) === "human" || type === "queued_command") return false;
|
|
731
|
+
return skipped("claude-row");
|
|
718
732
|
}
|
|
719
|
-
if (type !== "user" && type !== "assistant") return false;
|
|
720
733
|
const message = nativeField(root, "message");
|
|
721
734
|
const role = nativeField(message, "role");
|
|
722
735
|
if (message?.kind !== "object" || role && nativeText(role) !== type) return false;
|
|
@@ -774,8 +787,29 @@ const excludedCompleted = /* @__PURE__ */ new Set([
|
|
|
774
787
|
]);
|
|
775
788
|
const typeOf = (node) => nativeText(nativeField(node, "type"));
|
|
776
789
|
/** Every conversational carrier must be accounted for, including later blocks and runtime copies. */
|
|
777
|
-
function codexMainProseComplete(root, selection) {
|
|
790
|
+
function codexMainProseComplete(root, selection, onAnomaly) {
|
|
778
791
|
if (root.kind !== "object" || selection.diagnostics.some((item) => item.code === "unknown-source-role")) return false;
|
|
792
|
+
const skipped = (shape) => {
|
|
793
|
+
onAnomaly?.(shape);
|
|
794
|
+
return true;
|
|
795
|
+
};
|
|
796
|
+
const topType = typeOf(root);
|
|
797
|
+
if (!topType) return false;
|
|
798
|
+
if (![
|
|
799
|
+
"session_meta",
|
|
800
|
+
"turn_context",
|
|
801
|
+
"world_state",
|
|
802
|
+
"token_usage_record",
|
|
803
|
+
"inter_agent_communication_metadata",
|
|
804
|
+
"retained_context",
|
|
805
|
+
"response_item",
|
|
806
|
+
"compacted",
|
|
807
|
+
"event_msg"
|
|
808
|
+
].includes(topType)) return [
|
|
809
|
+
"message",
|
|
810
|
+
"user_message",
|
|
811
|
+
"UserMessage"
|
|
812
|
+
].includes(topType) ? false : skipped("codex-row");
|
|
779
813
|
const payload = nativeField(root, "payload");
|
|
780
814
|
if (payload?.kind !== "object") return false;
|
|
781
815
|
const text = (node) => {
|
|
@@ -839,10 +873,12 @@ function codexMainProseComplete(root, selection) {
|
|
|
839
873
|
const item = (node) => {
|
|
840
874
|
if (node.kind !== "object") return false;
|
|
841
875
|
const type = typeOf(node);
|
|
876
|
+
if (!type) return false;
|
|
842
877
|
if (type === "message") return message(node);
|
|
843
878
|
if (type === "agent_message") return message(node, "assistant");
|
|
844
879
|
if (type === "configuration_update") return !selection.diagnostics.some((diagnostic) => diagnostic.code === "unsupported-native-shape" && diagnostic.nodeId === node.id);
|
|
845
|
-
|
|
880
|
+
if (["user_message", "UserMessage"].includes(type ?? "")) return false;
|
|
881
|
+
return excludedItems.has(type ?? "") || skipped("codex-item");
|
|
846
882
|
};
|
|
847
883
|
const type = typeOf(root);
|
|
848
884
|
if (type === "session_meta") return !selection.diagnostics.some((item) => item.code === "unsupported-native-shape");
|
|
@@ -860,16 +896,18 @@ function codexMainProseComplete(root, selection) {
|
|
|
860
896
|
}
|
|
861
897
|
if (type !== "event_msg") return false;
|
|
862
898
|
const event = typeOf(payload);
|
|
899
|
+
if (!event) return false;
|
|
863
900
|
if (event === "user_message" || event === "agent_message") return message(payload, event === "user_message" ? "user" : "assistant");
|
|
864
901
|
if (event === "task_complete") {
|
|
865
902
|
const last = nativeField(payload, "last_agent_message");
|
|
866
903
|
return !last || last.kind === "literal" && last.raw === "null" || content(last);
|
|
867
904
|
}
|
|
868
905
|
if (event === "thread_goal_updated") return content(nativeField(nativeField(payload, "goal"), "objective"));
|
|
869
|
-
if (event !== "item_completed" && event !== "item_started") return excludedRuntime.has(event ?? "");
|
|
906
|
+
if (event !== "item_completed" && event !== "item_started") return ["message", "UserMessage"].includes(event ?? "") ? false : excludedRuntime.has(event ?? "") || skipped("codex-event");
|
|
870
907
|
const completed = nativeField(payload, "item");
|
|
871
908
|
if (completed?.kind !== "object") return false;
|
|
872
909
|
const completedType = typeOf(completed);
|
|
910
|
+
if (!completedType) return false;
|
|
873
911
|
if (completedType === "AgentMessage") {
|
|
874
912
|
const body = nativeField(completed, "content");
|
|
875
913
|
const questions = nativeField(completed, "questions");
|
|
@@ -877,12 +915,17 @@ function codexMainProseComplete(root, selection) {
|
|
|
877
915
|
}
|
|
878
916
|
if (completedType === "UserMessage") return content(nativeField(completed, "content"), true);
|
|
879
917
|
if (completedType === "Plan") return content(nativeField(completed, "text"));
|
|
880
|
-
if (completedType === "Extension")
|
|
881
|
-
"
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
918
|
+
if (completedType === "Extension") {
|
|
919
|
+
const kind = nativeText(nativeField(completed, "kind"));
|
|
920
|
+
if (!kind) return false;
|
|
921
|
+
return [
|
|
922
|
+
"web.search",
|
|
923
|
+
"image_gen.generation",
|
|
924
|
+
"clock.sleep"
|
|
925
|
+
].includes(kind) || skipped("codex-extension");
|
|
926
|
+
}
|
|
927
|
+
if (["message", "user_message"].includes(completedType ?? "")) return false;
|
|
928
|
+
return excludedCompleted.has(completedType ?? "") || skipped("codex-item");
|
|
886
929
|
}
|
|
887
930
|
//#endregion
|
|
888
931
|
//#region packages/harnesses/src/retention/claude/source.ts
|
|
@@ -2178,6 +2221,55 @@ function messageText(text, selection, worker, compact, user) {
|
|
|
2178
2221
|
}
|
|
2179
2222
|
if (user && browserContextAmbiguous(value, typed ?? value)) selection.diagnose("inseparable-context", text);
|
|
2180
2223
|
}
|
|
2224
|
+
const blockKeys = {
|
|
2225
|
+
text: [
|
|
2226
|
+
"type",
|
|
2227
|
+
"text",
|
|
2228
|
+
"citations",
|
|
2229
|
+
"cache_control"
|
|
2230
|
+
],
|
|
2231
|
+
thinking: [
|
|
2232
|
+
"type",
|
|
2233
|
+
"thinking",
|
|
2234
|
+
"signature"
|
|
2235
|
+
],
|
|
2236
|
+
redacted_thinking: ["type", "data"],
|
|
2237
|
+
tool_use: [
|
|
2238
|
+
"type",
|
|
2239
|
+
"id",
|
|
2240
|
+
"name",
|
|
2241
|
+
"input",
|
|
2242
|
+
"cache_control"
|
|
2243
|
+
],
|
|
2244
|
+
tool_result: [
|
|
2245
|
+
"type",
|
|
2246
|
+
"tool_use_id",
|
|
2247
|
+
"content",
|
|
2248
|
+
"is_error",
|
|
2249
|
+
"cache_control"
|
|
2250
|
+
],
|
|
2251
|
+
image: [
|
|
2252
|
+
"type",
|
|
2253
|
+
"source",
|
|
2254
|
+
"cache_control"
|
|
2255
|
+
],
|
|
2256
|
+
document: [
|
|
2257
|
+
"type",
|
|
2258
|
+
"source",
|
|
2259
|
+
"title",
|
|
2260
|
+
"context",
|
|
2261
|
+
"citations",
|
|
2262
|
+
"cache_control"
|
|
2263
|
+
]
|
|
2264
|
+
};
|
|
2265
|
+
/** Only call for harness blocks; person-text carriers keep their strict gate. */
|
|
2266
|
+
function skipBlockDrift(block, selection) {
|
|
2267
|
+
if (block.kind !== "object") return;
|
|
2268
|
+
const kind = nativeText(nativeField(block, "type"));
|
|
2269
|
+
const keys = kind !== void 0 && Object.hasOwn(blockKeys, kind) ? blockKeys[kind] : void 0;
|
|
2270
|
+
if (!keys) return;
|
|
2271
|
+
for (const property of block.properties) if (!keys.includes(property.key.value)) selection.injected(property.value, "derived");
|
|
2272
|
+
}
|
|
2181
2273
|
//#endregion
|
|
2182
2274
|
//#region packages/harnesses/src/retention/claude/sidecar.ts
|
|
2183
2275
|
function patchBody(node, selection) {
|
|
@@ -2487,7 +2579,14 @@ function createClaudeRetention(options) {
|
|
|
2487
2579
|
if (type === "attachment") return attachment(root, recordSettings.sourceRole === "worker", selection);
|
|
2488
2580
|
if (!type || !metadataTypes$1.has(type) && type !== "user" && type !== "assistant") {
|
|
2489
2581
|
selection.diagnose("unsupported-native-shape", root);
|
|
2490
|
-
|
|
2582
|
+
const result = selection.result();
|
|
2583
|
+
let tolerated = false;
|
|
2584
|
+
return claudeMainProseComplete(root, result, () => {
|
|
2585
|
+
tolerated = true;
|
|
2586
|
+
}) && tolerated ? {
|
|
2587
|
+
...result,
|
|
2588
|
+
omitRecord: true
|
|
2589
|
+
} : result;
|
|
2491
2590
|
}
|
|
2492
2591
|
association.checkSource(root);
|
|
2493
2592
|
if (skills.apply(root, association, selection)) return selection.result();
|
|
@@ -2522,8 +2621,9 @@ function attachment(root, worker, selection) {
|
|
|
2522
2621
|
else selection.diagnose("unsupported-native-shape", block);
|
|
2523
2622
|
}
|
|
2524
2623
|
else messageText(prompt, selection, worker, false, true);
|
|
2525
|
-
|
|
2526
|
-
|
|
2624
|
+
if (root.kind === "object") {
|
|
2625
|
+
for (const property of root.properties) if (property.key.value.startsWith("rendered")) selection.injected(property.value, "derived");
|
|
2626
|
+
}
|
|
2527
2627
|
selection.injected(nativeField(origin, "body"), "instructions");
|
|
2528
2628
|
return selection.result();
|
|
2529
2629
|
}
|
|
@@ -2558,6 +2658,7 @@ function message$1(root, type, association, options, selection) {
|
|
|
2558
2658
|
}
|
|
2559
2659
|
for (const block of nativeItems(content)) {
|
|
2560
2660
|
const kind = nativeText(nativeField(block, "type"));
|
|
2661
|
+
if (kind === "tool_use" || nativeBoolean(nativeField(root, "isSidechain")) === true || kind === "tool_result") skipBlockDrift(block, selection);
|
|
2561
2662
|
if (kind === "text") messageText(nativeField(block, "text"), selection, options.sourceRole === "worker", compact, type === "user");
|
|
2562
2663
|
else if (kind === "thinking" && type === "assistant") {
|
|
2563
2664
|
selection.text(nativeField(block, "thinking"), "reasoning");
|
|
@@ -2569,7 +2670,10 @@ function message$1(root, type, association, options, selection) {
|
|
|
2569
2670
|
const name = association.register(block, selection);
|
|
2570
2671
|
if (name) generatedInput(name, block, selection);
|
|
2571
2672
|
} else if (kind === "tool_result" && type === "user") result$1(block, results.length === 1 ? sidecar : void 0, association, options, selection);
|
|
2572
|
-
else
|
|
2673
|
+
else {
|
|
2674
|
+
selection.diagnose("unsupported-native-shape", block);
|
|
2675
|
+
if (type === "assistant" || nativeBoolean(nativeField(root, "isSidechain")) === true) selection.injected(block, "derived");
|
|
2676
|
+
}
|
|
2573
2677
|
}
|
|
2574
2678
|
}
|
|
2575
2679
|
function result$1(block, sidecar, association, options, selection) {
|
|
@@ -3602,7 +3706,13 @@ function createCodexRetention(options) {
|
|
|
3602
3706
|
const retained = nativeField(nativeField(payload, "retained_context"), "user_messages");
|
|
3603
3707
|
for (const item of nativeItems(retained)) browserContextCopy(context, nativeField(item, "text"));
|
|
3604
3708
|
} else if (type !== "token_usage_record" && type !== "inter_agent_communication_metadata") unsupported(context, root);
|
|
3605
|
-
|
|
3709
|
+
let tolerated = false;
|
|
3710
|
+
return codexMainProseComplete(root, context, () => {
|
|
3711
|
+
tolerated = true;
|
|
3712
|
+
}) && tolerated ? {
|
|
3713
|
+
...context,
|
|
3714
|
+
omitRecord: true
|
|
3715
|
+
} : context;
|
|
3606
3716
|
};
|
|
3607
3717
|
}
|
|
3608
3718
|
//#endregion
|
|
@@ -3625,8 +3735,14 @@ const metadataTypes = /* @__PURE__ */ new Set(["summary", "file-history-snapshot
|
|
|
3625
3735
|
function claudeMetadataRecord(root) {
|
|
3626
3736
|
return metadataTypes.has(nativeText(nativeField(root, "type")) ?? "");
|
|
3627
3737
|
}
|
|
3738
|
+
function claudeIdentityType(type) {
|
|
3739
|
+
return typeof type === "string" && nativeTypes.has(type);
|
|
3740
|
+
}
|
|
3741
|
+
function claudeIdentityRecord(root) {
|
|
3742
|
+
return claudeIdentityType(nativeText(nativeField(root, "type")));
|
|
3743
|
+
}
|
|
3628
3744
|
function claudeIdentity(root) {
|
|
3629
|
-
if (!
|
|
3745
|
+
if (!claudeIdentityRecord(root)) return unknownIdentity();
|
|
3630
3746
|
const marker = nativeField(root, "isSidechain");
|
|
3631
3747
|
const sidechain = nativeBoolean(marker);
|
|
3632
3748
|
if (marker !== void 0 && sidechain === void 0) throw new ProcessingError("PROCESSING_UNSUPPORTED");
|
|
@@ -3761,14 +3877,14 @@ function codex(source, subagent) {
|
|
|
3761
3877
|
/** Decoded discovery record; undefined until a record names the launch surface. */
|
|
3762
3878
|
function recordLaunch(value, harness) {
|
|
3763
3879
|
if (!isRecord(value)) return void 0;
|
|
3764
|
-
if (harness === "claude") return claude(value["entrypoint"]);
|
|
3880
|
+
if (harness === "claude") return claudeIdentityType(value["type"]) ? claude(value["entrypoint"]) : void 0;
|
|
3765
3881
|
const payload = value["payload"];
|
|
3766
3882
|
if (value["type"] !== "session_meta" || !isRecord(payload)) return void 0;
|
|
3767
3883
|
const source = payload["source"];
|
|
3768
3884
|
return codex(source, isRecord(source) && "subagent" in source);
|
|
3769
3885
|
}
|
|
3770
3886
|
function claudeLaunch(root) {
|
|
3771
|
-
return claude(nativeText(nativeField(root, "entrypoint")));
|
|
3887
|
+
return claudeIdentityRecord(root) ? claude(nativeText(nativeField(root, "entrypoint"))) : void 0;
|
|
3772
3888
|
}
|
|
3773
3889
|
function codexLaunch(root) {
|
|
3774
3890
|
const payload = nativeField(root, "payload");
|
|
@@ -4258,6 +4374,7 @@ function createNativeAdapters() {
|
|
|
4258
4374
|
claude: Object.freeze({
|
|
4259
4375
|
version: nativeAdapterVersions.claude,
|
|
4260
4376
|
source: claudeSourceInspector,
|
|
4377
|
+
identityRecord: claudeIdentityRecord,
|
|
4261
4378
|
retention: createClaudeRetention,
|
|
4262
4379
|
mainProseComplete: claudeMainProseComplete,
|
|
4263
4380
|
annotations: describeClaudeRecord,
|
|
@@ -4273,6 +4390,7 @@ function createNativeAdapters() {
|
|
|
4273
4390
|
codex: Object.freeze({
|
|
4274
4391
|
version: nativeAdapterVersions.codex,
|
|
4275
4392
|
source: codexSourceInspector,
|
|
4393
|
+
identityRecord: (root) => nativeText(nativeField(root, "type")) === "session_meta",
|
|
4276
4394
|
retention: createCodexRetention,
|
|
4277
4395
|
mainProseComplete: codexMainProseComplete,
|
|
4278
4396
|
annotations: codexAnnotations,
|
|
@@ -4356,25 +4474,31 @@ function nativeEvidence(part, harness, signal) {
|
|
|
4356
4474
|
//#endregion
|
|
4357
4475
|
//#region packages/harnesses/src/metadata/launch-probe.ts
|
|
4358
4476
|
const markers = {
|
|
4359
|
-
claude: Buffer.from("\"
|
|
4477
|
+
claude: Buffer.from("\"sessionId\""),
|
|
4360
4478
|
codex: Buffer.from("\"session_meta\"")
|
|
4361
4479
|
};
|
|
4362
|
-
function lineLaunch(line, harness) {
|
|
4480
|
+
function lineLaunch(line, harness, inspector, signal) {
|
|
4363
4481
|
if (!line.includes(markers[harness])) return void 0;
|
|
4364
4482
|
try {
|
|
4365
|
-
const
|
|
4366
|
-
|
|
4483
|
+
const text = line.toString("utf8");
|
|
4484
|
+
const value = JSON.parse(text);
|
|
4485
|
+
if (!boundedDepth(value)) return void 0;
|
|
4486
|
+
inspector.inspect(parseNativeRecord(text, defaultLimits, signal));
|
|
4487
|
+
const launch = recordLaunch(value, harness);
|
|
4488
|
+
return inspector.current().sessionId === null || launch === void 0 ? void 0 : { launch };
|
|
4367
4489
|
} catch {
|
|
4368
4490
|
return;
|
|
4369
4491
|
}
|
|
4370
4492
|
}
|
|
4371
4493
|
/**
|
|
4372
4494
|
* Launch-only continuation of a plain JSONL head that hit its byte allowance before any
|
|
4373
|
-
* record
|
|
4374
|
-
* can
|
|
4495
|
+
* record established native identity. It reads up to the discovered size and parses only records
|
|
4496
|
+
* that can name native identity, so oversized leading records cannot hide an automation launch from
|
|
4375
4497
|
* classification. Records above the native record bound are skipped, never buffered.
|
|
4376
4498
|
*/
|
|
4377
4499
|
async function probeLaunch(part, harness, signal) {
|
|
4500
|
+
const inspector = createNativeAdapters()[harness].source(part);
|
|
4501
|
+
const activeSignal = signal ?? new AbortController().signal;
|
|
4378
4502
|
const handle = await openSource(part, "append");
|
|
4379
4503
|
try {
|
|
4380
4504
|
const chunk = new Uint8Array(discoveryBounds.chunkBytes);
|
|
@@ -4390,8 +4514,8 @@ async function probeLaunch(part, harness, signal) {
|
|
|
4390
4514
|
let view = Buffer.from(chunk.subarray(0, bytesRead));
|
|
4391
4515
|
for (let newline = view.indexOf(10); newline >= 0; newline = view.indexOf(10)) {
|
|
4392
4516
|
if (!skipping) {
|
|
4393
|
-
const
|
|
4394
|
-
if (
|
|
4517
|
+
const result = lineLaunch(Buffer.concat([...pending, view.subarray(0, newline)]), harness, inspector, activeSignal);
|
|
4518
|
+
if (result !== void 0) return result.launch;
|
|
4395
4519
|
}
|
|
4396
4520
|
pending = [];
|
|
4397
4521
|
pendingBytes = 0;
|
|
@@ -4406,7 +4530,7 @@ async function probeLaunch(part, harness, signal) {
|
|
|
4406
4530
|
skipping = true;
|
|
4407
4531
|
} else pending.push(view);
|
|
4408
4532
|
}
|
|
4409
|
-
return skipping ? void 0 : lineLaunch(Buffer.concat(pending), harness);
|
|
4533
|
+
return skipping ? void 0 : lineLaunch(Buffer.concat(pending), harness, inspector, activeSignal)?.launch;
|
|
4410
4534
|
} finally {
|
|
4411
4535
|
try {
|
|
4412
4536
|
await checkOpenSource(part, handle, "append");
|
|
@@ -4495,6 +4619,7 @@ async function metadataStream(part, harness, options) {
|
|
|
4495
4619
|
let journalOnly = journalPath;
|
|
4496
4620
|
let journalRecords = 0;
|
|
4497
4621
|
let launch;
|
|
4622
|
+
let launchKnown = false;
|
|
4498
4623
|
let headExhausted = false;
|
|
4499
4624
|
const sufficient = () => fields.cwd !== null && fields.sourceSessionId !== null && fields.createdAt !== null;
|
|
4500
4625
|
const parseHeadTitle = (line) => {
|
|
@@ -4533,7 +4658,10 @@ async function metadataStream(part, harness, options) {
|
|
|
4533
4658
|
return;
|
|
4534
4659
|
}
|
|
4535
4660
|
readFields(value, harness, fields);
|
|
4536
|
-
|
|
4661
|
+
if (!launchKnown && native.sourceSessionId() !== null) {
|
|
4662
|
+
launch = recordLaunch(value, harness);
|
|
4663
|
+
launchKnown = launch !== void 0;
|
|
4664
|
+
}
|
|
4537
4665
|
readTitleRecord(text, value, harness, titles, true, fields.sourceSessionId, options.signal);
|
|
4538
4666
|
const interaction = interactionTime(value, harness);
|
|
4539
4667
|
if (interaction.kind === "interaction") lastInteractionAt = interaction.timestamp;
|
|
@@ -4599,7 +4727,7 @@ async function metadataStream(part, harness, options) {
|
|
|
4599
4727
|
}
|
|
4600
4728
|
}
|
|
4601
4729
|
checkDiscoveryAbort(options.signal);
|
|
4602
|
-
if (headExhausted &&
|
|
4730
|
+
if (headExhausted && !launchKnown && readMode === "append") launch = await probeLaunch(part, harness, options.signal);
|
|
4603
4731
|
const workflowJournal = journalOnly && journalRecords > 0 && !stopped;
|
|
4604
4732
|
const complete = !stopped && !incompleteRecord && unchanged;
|
|
4605
4733
|
if (journalPath && !workflowJournal) warnings.add("UNCONFIRMED_WORKFLOW_JOURNAL");
|
|
@@ -4741,6 +4869,7 @@ async function scanRoot(path, harness, state, warnings, signal) {
|
|
|
4741
4869
|
id: randomUUID(),
|
|
4742
4870
|
path: child,
|
|
4743
4871
|
root,
|
|
4872
|
+
harnessRelativePath: `${basename(path)}/${relative(root, child).split(sep).join("/")}`,
|
|
4744
4873
|
representation: entry.name.endsWith(".zst") ? "jsonl.zst" : "jsonl",
|
|
4745
4874
|
snapshot
|
|
4746
4875
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as bCountSchema, $n as scalarAfter, $t as fileIdentitySchema, A as bDuplicateMirror, B as bEvidenceReader, Bn as validatePlan, Bt as sessionPeriodSchema, C as validateBUnit, Ct as cardsSubmitSchema, D as uncoveredBObligations, Dn as entityDictionaryVersion, Dt as privacyResolveSchema, E as bLiterals, En as cleanupImplementationVersion, Et as packageConfirmActionSchema, Ft as termTypeInfo, G as subtractBRanges, Gn as detectStatic, H as codePointLength, Ht as ApplicationError, I as bIssue, It as termTypeSchema, J as bRetainedGroupSchema, Jt as reviewFamilies, Kt as familyNeedsReview, L as bOverlaps, Ln as validateProfile, Lt as termTypes, M as bLegacyBindings, Mt as reviewTermsResultSchema, N as bUnitFragments, Nt as termAssessmentSchema, O as indexBRanges, Ot as privacyTermKey, P as bAdoptedObligations, Pt as termOverrideValueSchema, Q as bAnchorSchema, Qt as sourceSnapshotId, R as unownedBObligations, Rn as orderProfile, Rt as deselectOutsidePeriod, S as validateBFields, St as cardsConfirmActionSchema, T as bLiteralTerms, Tt as emptyJourneyPrivacy, U as codePointSlice, Ut as UnfinishedJourneyError, V as bDigest, Vn as copyData, Vt as classificationTitleMaskSchema, W as createCodePointIndex, Wt as safeCode, X as bSessionDecisionSchema, Xn as createEntityMatcher, Xt as sourceKey, Y as bReviewSubmissionSchema, Yt as sourceGraph, Z as bTermSchema, Zt as observeSource, _ as semanticFindingSchema, _n as gapReasons, _t as hideConfirmSchema, a as reviewChunkSchema, at as journeyExceptionSchema, b as validateBReview, bn as staticDefaults, bt as journeyConfigurationSchema, c as textDigest, ct as journeyPreferenceScopeSchema, dt as nativeJourneySchema, en as inventorySchema, er as scalarBefore, et as bIdSchema, f as reviewAlignmentAuditSchema, ft as journeyGuidanceSchema, g as validateReviewAlignment, h as reviewFindingsDigest, hn as inspectionSemanticVersions, ht as journeyDescribeSchema, i as reviewBatchSchema, in as nativeSourceIdentitySchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, l as validateReview, lt as journeyProjectTypeSchema, m as reviewAlignmentSchema, mn as currentDetectorVersion, mt as delegatedDecisionSchema, n as compileBFindings, nn as sourcePartSchema, nt as journeyAccessSchema, o as reviewDigest, ot as journeyIdSchema, p as reviewAlignmentInputSchema, pt as journeyInstructionInputSchema, q as bRepresentationSchema, qn as staticCategories, qt as familySelected, r as reviewBatchChunks, rt as journeyChoiceSchema, s as reviewSubmitSchema, st as journeyKindSchema, tr as defaultDetectionLimits, tt as bMethod, u as findingReferenceKey, ut as journeyWorkTypeSchema, vt as hidePlanInputSchema, w as bLiteralAdmitted, x as createBAnalysisUnits, xn as staticOptions, xt as cardAnswerActionSchema, y as validateBClassification, yn as createStaticProcessor, yt as hidePlanResourceSchema, z as bAnchorKey } from "./locate-
|
|
1
|
+
import { $ as bCountSchema, $n as scalarAfter, $t as fileIdentitySchema, A as bDuplicateMirror, B as bEvidenceReader, Bn as validatePlan, Bt as sessionPeriodSchema, C as validateBUnit, Ct as cardsSubmitSchema, D as uncoveredBObligations, Dn as entityDictionaryVersion, Dt as privacyResolveSchema, E as bLiterals, En as cleanupImplementationVersion, Et as packageConfirmActionSchema, Ft as termTypeInfo, G as subtractBRanges, Gn as detectStatic, H as codePointLength, Ht as ApplicationError, I as bIssue, It as termTypeSchema, J as bRetainedGroupSchema, Jt as reviewFamilies, Kt as familyNeedsReview, L as bOverlaps, Ln as validateProfile, Lt as termTypes, M as bLegacyBindings, Mt as reviewTermsResultSchema, N as bUnitFragments, Nt as termAssessmentSchema, O as indexBRanges, Ot as privacyTermKey, P as bAdoptedObligations, Pt as termOverrideValueSchema, Q as bAnchorSchema, Qt as sourceSnapshotId, R as unownedBObligations, Rn as orderProfile, Rt as deselectOutsidePeriod, S as validateBFields, St as cardsConfirmActionSchema, T as bLiteralTerms, Tt as emptyJourneyPrivacy, U as codePointSlice, Ut as UnfinishedJourneyError, V as bDigest, Vn as copyData, Vt as classificationTitleMaskSchema, W as createCodePointIndex, Wt as safeCode, X as bSessionDecisionSchema, Xn as createEntityMatcher, Xt as sourceKey, Y as bReviewSubmissionSchema, Yt as sourceGraph, Z as bTermSchema, Zt as observeSource, _ as semanticFindingSchema, _n as gapReasons, _t as hideConfirmSchema, a as reviewChunkSchema, at as journeyExceptionSchema, b as validateBReview, bn as staticDefaults, bt as journeyConfigurationSchema, c as textDigest, ct as journeyPreferenceScopeSchema, dt as nativeJourneySchema, en as inventorySchema, er as scalarBefore, et as bIdSchema, f as reviewAlignmentAuditSchema, ft as journeyGuidanceSchema, g as validateReviewAlignment, h as reviewFindingsDigest, hn as inspectionSemanticVersions, ht as journeyDescribeSchema, i as reviewBatchSchema, in as nativeSourceIdentitySchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, l as validateReview, lt as journeyProjectTypeSchema, m as reviewAlignmentSchema, mn as currentDetectorVersion, mt as delegatedDecisionSchema, n as compileBFindings, nn as sourcePartSchema, nt as journeyAccessSchema, o as reviewDigest, ot as journeyIdSchema, p as reviewAlignmentInputSchema, pt as journeyInstructionInputSchema, q as bRepresentationSchema, qn as staticCategories, qt as familySelected, r as reviewBatchChunks, rt as journeyChoiceSchema, s as reviewSubmitSchema, st as journeyKindSchema, tr as defaultDetectionLimits, tt as bMethod, u as findingReferenceKey, ut as journeyWorkTypeSchema, vt as hidePlanInputSchema, w as bLiteralAdmitted, x as createBAnalysisUnits, xn as staticOptions, xt as cardAnswerActionSchema, y as validateBClassification, yn as createStaticProcessor, yt as hidePlanResourceSchema, z as bAnchorKey } from "./locate-CBiw-CJK.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createHash, createHmac, createSecretKey, randomUUID } from "node:crypto";
|
|
4
4
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
@@ -1566,10 +1566,50 @@ const sendItemSchema = z.object({
|
|
|
1566
1566
|
/** The receipt whose bytes were PUT but not yet completed: the next step completes it (BL-210). */
|
|
1567
1567
|
uploadedReceiptId: journeyIdSchema.nullable().optional(),
|
|
1568
1568
|
/**
|
|
1569
|
+
* Bare `settings_changed` refusals in a row for the uploaded bytes: Passport's scope kept
|
|
1570
|
+
* moving, so the next completion waits longer (ADR 0235). Cleared with the upload marker.
|
|
1571
|
+
*/
|
|
1572
|
+
busyRefusals: count$13.positive().optional(),
|
|
1573
|
+
/**
|
|
1569
1574
|
* Passport answered `bundle_mismatch` to this Work's checksum upload: the rest of this Send
|
|
1570
1575
|
* uploads through staging (ADR 0231).
|
|
1571
1576
|
*/
|
|
1572
1577
|
checksumUploadRefused: z.literal(true).optional(),
|
|
1578
|
+
/** Write-ahead upload intent; completion probes recover an unacknowledged blob PUT. */
|
|
1579
|
+
sessionUpload: z.object({
|
|
1580
|
+
key: journeyDigestSchema,
|
|
1581
|
+
sha256: journeyDigestSchema
|
|
1582
|
+
}).strict().nullable().optional(),
|
|
1583
|
+
/** Exact write-ahead membership request; never rebase it after an uncertain PUT. */
|
|
1584
|
+
sessionMembership: z.object({
|
|
1585
|
+
workId: journeyIdSchema,
|
|
1586
|
+
expectedRevision: count$13,
|
|
1587
|
+
keys: z.array(journeyDigestSchema),
|
|
1588
|
+
title: z.string(),
|
|
1589
|
+
access
|
|
1590
|
+
}).strict().optional(),
|
|
1591
|
+
/** Membership readback retained for visible conflict recovery. */
|
|
1592
|
+
membershipConflict: z.object({
|
|
1593
|
+
revision: count$13,
|
|
1594
|
+
keys: z.array(journeyDigestSchema)
|
|
1595
|
+
}).strict().optional(),
|
|
1596
|
+
/** Informational readback for a freshly prepared recovery; never a write fence. */
|
|
1597
|
+
recoveryReview: z.object({
|
|
1598
|
+
previousSendId: journeyIdSchema,
|
|
1599
|
+
revision: count$13,
|
|
1600
|
+
currentAccess: z.enum([
|
|
1601
|
+
"public",
|
|
1602
|
+
"private",
|
|
1603
|
+
"removed"
|
|
1604
|
+
]).nullable(),
|
|
1605
|
+
currentKeys: z.array(journeyDigestSchema),
|
|
1606
|
+
proposedKeys: z.array(journeyDigestSchema)
|
|
1607
|
+
}).strict().optional(),
|
|
1608
|
+
/** Acknowledged membership revision and later scan identity; never a write-ahead intent. */
|
|
1609
|
+
sessionAssembly: z.object({
|
|
1610
|
+
revision: count$13,
|
|
1611
|
+
scanId: journeyIdSchema.nullable()
|
|
1612
|
+
}).strict().optional(),
|
|
1573
1613
|
status: z.enum([
|
|
1574
1614
|
"ready",
|
|
1575
1615
|
"target",
|
|
@@ -1582,6 +1622,8 @@ const sendItemSchema = z.object({
|
|
|
1582
1622
|
error: z.string().nullable()
|
|
1583
1623
|
}).strict();
|
|
1584
1624
|
const journeySendSchema = z.object({
|
|
1625
|
+
/** Passport advertised parallel-completes when this Send was confirmed (ADR 0235). */
|
|
1626
|
+
parallelCompletes: z.literal(true).optional(),
|
|
1585
1627
|
id: journeyIdSchema,
|
|
1586
1628
|
journeyId: journeyIdSchema,
|
|
1587
1629
|
revision: count$13,
|
|
@@ -1616,7 +1658,7 @@ const journeySendSchema = z.object({
|
|
|
1616
1658
|
error: z.string().nullable(),
|
|
1617
1659
|
/**
|
|
1618
1660
|
* When this Send replaced the owner's earlier Passport Works and how many it retired; a
|
|
1619
|
-
*
|
|
1661
|
+
* historical marker is retained for compatibility only (superseded by ADR 0242).
|
|
1620
1662
|
*/
|
|
1621
1663
|
replaced: z.object({
|
|
1622
1664
|
at: z.iso.datetime(),
|
|
@@ -5760,7 +5802,7 @@ async function readGroupItems(storage, value) {
|
|
|
5760
5802
|
//#region packages/application/src/export/versions.ts
|
|
5761
5803
|
/** Current built-in admission, annotation and retention contracts; implementations share these. */
|
|
5762
5804
|
const nativeAdapterVersions = Object.freeze({
|
|
5763
|
-
claude: "claude-native-export-
|
|
5805
|
+
claude: "claude-native-export-v19",
|
|
5764
5806
|
codex: "codex-native-export-v16"
|
|
5765
5807
|
});
|
|
5766
5808
|
/** Shared metadata annotation/preparation semantics, independent of serialization formats. */
|
|
@@ -6993,6 +7035,7 @@ const manualUploadSchema = z.object({
|
|
|
6993
7035
|
subject: z.string().nullable(),
|
|
6994
7036
|
confirmedAt: z.iso.datetime().nullable(),
|
|
6995
7037
|
status: journeySendSchema.shape.status,
|
|
7038
|
+
parallelCompletes: journeySendSchema.shape.parallelCompletes,
|
|
6996
7039
|
items: z.array(sendItemSchema),
|
|
6997
7040
|
/** The result slot holding each item's primary ZIP, keyed by the item's logical Work ID. */
|
|
6998
7041
|
slots: z.record(journeyIdSchema, count$2),
|