@scotthuang/agent-knock-knock 0.13.12 → 0.13.14
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 +25 -0
- package/README.md +4 -4
- package/dist/src/claude-lifecycle-compatibility.js +25 -4
- package/dist/src/claude-lifecycle-compatibility.js.map +1 -1
- package/dist/src/claude-local-transcript-provider.js +12 -19
- package/dist/src/claude-local-transcript-provider.js.map +1 -1
- package/dist/src/claude-terminal-agent-adapter.js +27 -11
- package/dist/src/claude-terminal-agent-adapter.js.map +1 -1
- package/dist/src/claude-transcript-record-order.d.ts +17 -0
- package/dist/src/claude-transcript-record-order.js +81 -0
- package/dist/src/claude-transcript-record-order.js.map +1 -0
- package/dist/src/codex-app-server-interaction-client.js +5 -3
- package/dist/src/codex-app-server-interaction-client.js.map +1 -1
- package/dist/src/codex-app-server-read-client.d.ts +2 -0
- package/dist/src/codex-app-server-read-client.js +4 -1
- package/dist/src/codex-app-server-read-client.js.map +1 -1
- package/dist/src/codex-async-question-adapter.d.ts +2 -2
- package/dist/src/codex-async-question-adapter.js +8 -3
- package/dist/src/codex-async-question-adapter.js.map +1 -1
- package/dist/src/codex-fullscreen-composer-proof.d.ts +3 -3
- package/dist/src/codex-fullscreen-composer-proof.js +109 -20
- package/dist/src/codex-fullscreen-composer-proof.js.map +1 -1
- package/dist/src/codex-lifecycle-compatibility.d.ts +6 -0
- package/dist/src/codex-lifecycle-compatibility.js +16 -3
- package/dist/src/codex-lifecycle-compatibility.js.map +1 -1
- package/dist/src/codex-paginated-async-answer.js +24 -13
- package/dist/src/codex-paginated-async-answer.js.map +1 -1
- package/dist/src/codex-paginated-async-response.js +4 -1
- package/dist/src/codex-paginated-async-response.js.map +1 -1
- package/dist/src/codex-paginated-observation.js +4 -1
- package/dist/src/codex-paginated-observation.js.map +1 -1
- package/dist/src/codex-paginated-questionnaire-runtime.js +2 -1
- package/dist/src/codex-paginated-questionnaire-runtime.js.map +1 -1
- package/dist/src/codex-paginated-task.d.ts +5 -1
- package/dist/src/codex-paginated-task.js +8 -3
- package/dist/src/codex-paginated-task.js.map +1 -1
- package/dist/src/codex-paginated-thread-binding.d.ts +4 -0
- package/dist/src/codex-paginated-thread-binding.js +29 -6
- package/dist/src/codex-paginated-thread-binding.js.map +1 -1
- package/dist/src/codex-paginated-thread-facts.d.ts +5 -1
- package/dist/src/codex-paginated-watch.js +5 -3
- package/dist/src/codex-paginated-watch.js.map +1 -1
- package/dist/src/codex-status-history-navigation.d.ts +17 -0
- package/dist/src/codex-status-history-navigation.js +260 -0
- package/dist/src/codex-status-history-navigation.js.map +1 -0
- package/dist/src/codex-terminal-agent-adapter.d.ts +2 -0
- package/dist/src/codex-terminal-agent-adapter.js +126 -5
- package/dist/src/codex-terminal-agent-adapter.js.map +1 -1
- package/dist/src/herdr-terminal-control-provider.d.ts +2 -0
- package/dist/src/herdr-terminal-control-provider.js +35 -8
- package/dist/src/herdr-terminal-control-provider.js.map +1 -1
- package/dist/src/semantic-tool-schemas.js +1 -1
- package/dist/src/semantic-tool-schemas.js.map +1 -1
- package/dist/src/terminal-agent-bridge.d.ts +2 -1
- package/dist/src/terminal-agent-bridge.js +50 -7
- package/dist/src/terminal-agent-bridge.js.map +1 -1
- package/dist/src/terminal-composer-classifier.js +17 -10
- package/dist/src/terminal-composer-classifier.js.map +1 -1
- package/dist/src/terminal-control-provider.d.ts +4 -0
- package/dist/src/terminal-control-provider.js +57 -6
- package/dist/src/terminal-control-provider.js.map +1 -1
- package/dist/src/terminal-human-explicit-send-cli-adapter.js +1 -1
- package/dist/src/terminal-human-explicit-send-cli-adapter.js.map +1 -1
- package/dist/src/terminal-interaction-core.js +2 -1
- package/dist/src/terminal-interaction-core.js.map +1 -1
- package/dist/src/terminal-interaction-response-bridge.js +8 -7
- package/dist/src/terminal-interaction-response-bridge.js.map +1 -1
- package/dist/src/terminal-model-control-profile.d.ts +4 -1
- package/dist/src/terminal-model-control-profile.js +68 -2
- package/dist/src/terminal-model-control-profile.js.map +1 -1
- package/dist/src/terminal-model-control.js +5 -3
- package/dist/src/terminal-model-control.js.map +1 -1
- package/dist/src/terminal-monitor-decision-policy.d.ts +1 -1
- package/dist/src/terminal-native-inspection-bridge.d.ts +1 -1
- package/dist/src/terminal-native-inspection-bridge.js +42 -10
- package/dist/src/terminal-native-inspection-bridge.js.map +1 -1
- package/dist/src/terminal-questionnaire-adapter.js +25 -4
- package/dist/src/terminal-questionnaire-adapter.js.map +1 -1
- package/dist/src/terminal-runtime-cli-adapter.js +3 -2
- package/dist/src/terminal-runtime-cli-adapter.js.map +1 -1
- package/dist/src/terminal-send-watch-policy.js +5 -2
- package/dist/src/terminal-send-watch-policy.js.map +1 -1
- package/dist/src/terminal-watch-cli-adapter.js +3 -2
- package/dist/src/terminal-watch-cli-adapter.js.map +1 -1
- package/dist/src/terminal-watch-interaction-runtime.js +3 -1
- package/dist/src/terminal-watch-interaction-runtime.js.map +1 -1
- package/docs/claude-2.1.285-compatibility.md +133 -0
- package/docs/codex-0.159.0-compatibility.md +232 -0
- package/docs/codex-0.159.2-compatibility.md +226 -0
- package/docs/quickstart-herdr.md +2 -2
- package/docs/quickstart-tmux.md +3 -3
- package/package.json +5 -2
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.14 - 2026-10-01
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Support Codex CLI 0.159.2 and the reviewed 0.159.0 foreground/0.159.2 shared-backend pair. Bind the physical and backend versions separately for paginated Send, Watch, native questions, and answer receipts; reject unreviewed pairs and backend drift.
|
|
8
|
+
- Add exact Claude Code 2.1.285 lifecycle, native status, question, and model-control profiles while retaining earlier version checks.
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Recover clipped Codex `/status` cards through bounded native history navigation, requiring a complete card, unique captured overlap, and restoration before using its thread identity. Correct locale-free tmux viewport parsing, Herdr visible-screen reads, and native style checks.
|
|
13
|
+
- Continue read-only confirmation of a single Codex async answer for up to 15 seconds after dispatch, including a timed-out RPC, without repeating the answer.
|
|
14
|
+
- Recognize Claude's named-session Composer and Bash ask-rule prompt, and read transcript attachments written before their parent records without changing conversation order or weakening identity checks.
|
|
15
|
+
|
|
16
|
+
## 0.13.13 - 2026-09-30
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Extend the paginated task adapter to Codex 0.159.0 for physical Send, exact task Watch, native questions and answer receipts, and completion callbacks.
|
|
21
|
+
- Preserve existing string-cursor pagination while accepting 0.159.0 as an independently checked client/backend version.
|
|
22
|
+
- Keep the existing 0.158.0 support and the documented 0.157.x limitations. Store writer protocol remains 8 and Terminal Watch schema remains 3.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- Parse Codex 0.159.0 borderless native status output and wrapped fields while retaining exact fresh-card, session, and Composer checks. Separate native activity (including Thinking, Waiting, Compacting, and dynamic headers) and queued-question regions from the status card so active Watch binding and question-answer identity checks can complete. Display text remains outside task identity evidence.
|
|
27
|
+
|
|
3
28
|
## 0.13.12 - 2026-09-29
|
|
4
29
|
|
|
5
30
|
### Fixed
|
package/README.md
CHANGED
|
@@ -76,11 +76,11 @@ Open a Web conversation and enter `/akk list`. The connector gives every convers
|
|
|
76
76
|
|
|
77
77
|
Suppose several Codex or Claude Code jobs are already running in tmux or Herdr:
|
|
78
78
|
|
|
79
|
-
Codex CLI 0.158.0 supports exact paginated task Watches for ordinary terminal
|
|
79
|
+
Codex CLI 0.158.0/0.159.0/0.159.2 supports exact paginated task Watches for ordinary terminal
|
|
80
80
|
Send, native question responses, and durable completion callbacks. The adapter
|
|
81
81
|
checks the foreground thread and server version before attaching; uncertain
|
|
82
|
-
answers are never automatically replayed. See the [0.158.0 compatibility
|
|
83
|
-
review](docs/codex-0.
|
|
82
|
+
answers are never automatically replayed. See the [0.158.0/0.159.0/0.159.2 compatibility
|
|
83
|
+
review](docs/codex-0.159.2-compatibility.md) for managed-session and already-open
|
|
84
84
|
question boundaries. Codex 0.157.x retains its [partial compatibility](docs/codex-0.157.1-compatibility.md).
|
|
85
85
|
|
|
86
86
|
- **Watch without babysitting.** `/akk watch <terminal>` observes work already in progress and sends a callback when it finishes, needs approval, or becomes blocked. You can leave the terminal and continue from your phone or another chat client.
|
|
@@ -137,7 +137,7 @@ Skill SHA-256 digests; an older, missing, or drifted handshake fails closed
|
|
|
137
137
|
instead of mounting a partial tool surface. Connector package versions remain
|
|
138
138
|
independent of one another.
|
|
139
139
|
|
|
140
|
-
In the current OpenClaw plugin and core Host Adapter, an idle Codex pane with ambiguous foreground rollout identity may advertise `identify_foreground`. That action issues one closed `/status` command to the exact pane. It does not mutate the AKK Store, but it does type into the visible terminal. Its 30-second result is diagnostic only and grants no later authority. The separate `identify_and_send` action keeps one terminal lock across the probe and one requested task, then relies on exact request acceptance—not the status card—for durable Session and Turn identity. List and Status never run this probe. Codex 0.158.0 exact Send and active-task Watch use a separate closed `/status` transaction to bind the foreground paginated thread; subsequent observation is read-only.
|
|
140
|
+
In the current OpenClaw plugin and core Host Adapter, an idle Codex pane with ambiguous foreground rollout identity may advertise `identify_foreground`. That action issues one closed `/status` command to the exact pane. It does not mutate the AKK Store, but it does type into the visible terminal. Its 30-second result is diagnostic only and grants no later authority. The separate `identify_and_send` action keeps one terminal lock across the probe and one requested task, then relies on exact request acceptance—not the status card—for durable Session and Turn identity. List and Status never run this probe. Codex 0.158.0/0.159.0/0.159.2 exact Send and active-task Watch use a separate closed `/status` transaction to bind the foreground paginated thread; subsequent observation is read-only.
|
|
141
141
|
|
|
142
142
|
AKK is local-first: there is no hosted control plane or telemetry. It stores only the local state needed for routing, lifecycle recovery, callback delivery, and idempotency.
|
|
143
143
|
|
|
@@ -45,8 +45,8 @@ const CLAUDE_STATUS_PANEL_FIELDS_2_1_261 = Object.freeze([
|
|
|
45
45
|
...CLAUDE_STATUS_PANEL_FIELDS_2_1_251,
|
|
46
46
|
"Organization policy"
|
|
47
47
|
]);
|
|
48
|
-
// Observed in Claude Code 2.1.282 /status.
|
|
49
|
-
//
|
|
48
|
+
// Observed in Claude Code 2.1.282 and 2.1.285 /status. The 2.1.282 runtime
|
|
49
|
+
// remains unverified: only its bounded status-field difference was checked.
|
|
50
50
|
const CLAUDE_STATUS_PANEL_FIELDS_2_1_282 = Object.freeze([
|
|
51
51
|
...CLAUDE_STATUS_PANEL_FIELDS_2_1_261,
|
|
52
52
|
"Auto mode server"
|
|
@@ -179,12 +179,33 @@ const CLAUDE_LIFECYCLE_PROFILES = Object.freeze({
|
|
|
179
179
|
"2.1.266",
|
|
180
180
|
"2.1.267"
|
|
181
181
|
])
|
|
182
|
+
}),
|
|
183
|
+
"2.1.285": Object.freeze({
|
|
184
|
+
lifecycleBehaviorProfile: "claude-code-2.1.285",
|
|
185
|
+
nativeInspectionBehaviorProfile: "claude-code-2.1.285-native-status",
|
|
186
|
+
nativeInspectionComposerStableMs: 80,
|
|
187
|
+
nativeInspectionComposerSettleTimeoutMs: 5_000,
|
|
188
|
+
nativeStatusPanelFields: CLAUDE_STATUS_PANEL_FIELDS_2_1_282,
|
|
189
|
+
nativeStatusPanelRequiredValues: Object.freeze({
|
|
190
|
+
"Session kind": "interactive"
|
|
191
|
+
}),
|
|
192
|
+
resumableSourceVersions: Object.freeze([
|
|
193
|
+
"2.1.218",
|
|
194
|
+
"2.1.226",
|
|
195
|
+
"2.1.237",
|
|
196
|
+
"2.1.251",
|
|
197
|
+
"2.1.259",
|
|
198
|
+
"2.1.263",
|
|
199
|
+
"2.1.266",
|
|
200
|
+
"2.1.267",
|
|
201
|
+
"2.1.285"
|
|
202
|
+
])
|
|
182
203
|
})
|
|
183
204
|
});
|
|
184
205
|
/**
|
|
185
206
|
* Best-effort runtime protocol for complete x.y.z Claude Code versions
|
|
186
|
-
* that AKK has not regression-tested yet. This deliberately reuses the
|
|
187
|
-
*
|
|
207
|
+
* that AKK has not regression-tested yet. This deliberately reuses the existing
|
|
208
|
+
* bounded Status modal shape; a real TUI change therefore fails at
|
|
188
209
|
* observation instead of being blocked solely by its version number.
|
|
189
210
|
*/
|
|
190
211
|
const CLAUDE_UNVERIFIED_LIFECYCLE_PROFILE = Object.freeze({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-lifecycle-compatibility.js","sourceRoot":"","sources":["../../src/claude-lifecycle-compatibility.ts"],"names":[],"mappings":"AAUA,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,SAAS;IACT,cAAc;IACd,YAAY;IACZ,KAAK;IACL,YAAY;IACZ,oBAAoB;IACpB,OAAO;IACP,aAAa;IACb,iBAAiB;CAClB,CAAC,CAAC;AAEH,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,SAAS;IACT,cAAc;IACd,YAAY;IACZ,cAAc;IACd,KAAK;IACL,YAAY;IACZ,oBAAoB;IACpB,OAAO;IACP,aAAa;IACb,iBAAiB;CAClB,CAAC,CAAC;AAEH,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,SAAS;IACT,cAAc;IACd,YAAY;IACZ,cAAc;IACd,cAAc;IACd,KAAK;IACL,YAAY;IACZ,oBAAoB;IACpB,OAAO;IACP,aAAa;IACb,iBAAiB;IACjB,iBAAiB;IACjB,wBAAwB;IACxB,2BAA2B;CAC5B,CAAC,CAAC;AAEH,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAC/E,yBAAyB;AACzB,MAAM,kCAAkC,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,GAAG,kCAAkC;IACrC,qBAAqB;CACtB,CAAC,CAAC;AAEH,
|
|
1
|
+
{"version":3,"file":"claude-lifecycle-compatibility.js","sourceRoot":"","sources":["../../src/claude-lifecycle-compatibility.ts"],"names":[],"mappings":"A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B,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,YAAgC;IAEhC,OAAO,mCAAmC,CAAC,YAAY,CAAC;QACtD,EAAE,+BAA+B,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,gCAAgC;IAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,qCAAqC,CACnD,mBAAuC,EACvC,kBAAsC;IAEtC,OAAO,4BAA4B,CAAC,mBAAmB,CAAC;QACtD,4BAA4B,CAAC,kBAAkB,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,qCAAqC;IACnD,OAAO,CAAC,GAAG,IAAI,GAAG,CAChB,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC;aACrC,MAAM,CACL,mCAAmC,EACnC,2CAA2C,CAC5C;aACA,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC,CACzD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -4,6 +4,7 @@ import os from "node:os";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { isClaudeAgentIdleState } from "./claude-terminal-agent-adapter.js";
|
|
6
6
|
import { claudeLifecycleSourceVersionSupported, claudeRuntimeLifecycleCompatibilityProfile, DEFAULT_CLAUDE_LIFECYCLE_VERSION, } from "./claude-lifecycle-compatibility.js";
|
|
7
|
+
import { assertParentsPrecedeChildren, earliestClaudeTranscriptRecordOffset, initialClaudeTranscriptCheckpointRecords, orderClaudePrewrittenAttachments } from "./claude-transcript-record-order.js";
|
|
7
8
|
import { redactString } from "./runtime-log.js";
|
|
8
9
|
import { isRecord } from "./value-guards.js";
|
|
9
10
|
import { validateTerminalSubmissionAcceptanceEvidence } from "./terminal-submission-facts.js";
|
|
@@ -465,7 +466,7 @@ export function captureClaudeHumanStartedActiveTaskAnchor(options) {
|
|
|
465
466
|
throw new Error("Claude active-task transcript has an incomplete JSONL tail; retry");
|
|
466
467
|
}
|
|
467
468
|
const recordEntries = readBoundedCompleteJsonlTail(opened.fd, before.size, maxBytes);
|
|
468
|
-
const records = recordEntries.map((entry) => entry.record);
|
|
469
|
+
const records = orderClaudePrewrittenAttachments(recordEntries.map((entry) => entry.record));
|
|
469
470
|
const after = fs.fstatSync(opened.fd);
|
|
470
471
|
if (!sameStableTranscriptFile(before, after)) {
|
|
471
472
|
throw new Error("Claude active-task transcript changed while it was captured; retry");
|
|
@@ -517,7 +518,8 @@ export function captureClaudeHumanStartedActiveTaskAnchor(options) {
|
|
|
517
518
|
})) {
|
|
518
519
|
return undefined;
|
|
519
520
|
}
|
|
520
|
-
|
|
521
|
+
const activeTurn = pendingApprovalTurn(snapshot);
|
|
522
|
+
if (!activeTurn) {
|
|
521
523
|
throw new Error("Claude active root prompt has no unique unfinished foreground chain");
|
|
522
524
|
}
|
|
523
525
|
const base = {
|
|
@@ -535,7 +537,7 @@ export function captureClaudeHumanStartedActiveTaskAnchor(options) {
|
|
|
535
537
|
request_hash: requestHash,
|
|
536
538
|
claude_version: claudeVersion,
|
|
537
539
|
transcript_file_id: fileId,
|
|
538
|
-
turn_start_offset_bytes: promptEntry.offsetBytes,
|
|
540
|
+
turn_start_offset_bytes: earliestClaudeTranscriptRecordOffset(recordEntries, activeTurn.descendants, promptEntry.offsetBytes),
|
|
539
541
|
observed_end_offset_bytes: before.size
|
|
540
542
|
};
|
|
541
543
|
return {
|
|
@@ -604,7 +606,7 @@ export function observeClaudeHumanStartedActiveTask(options) {
|
|
|
604
606
|
throw new Error("Claude active-task JSONL record exceeded the bounded local read limit");
|
|
605
607
|
}
|
|
606
608
|
const safeResumeOffsetBytes = resumeOffsetBytes + completeLength;
|
|
607
|
-
const suffixRecords = readCompleteJsonlRecordEntries(opened.fd, resumeOffsetBytes, completeLength, { preReadBuffer: suffixBuffer.subarray(0, completeLength) }).map((entry) => entry.record);
|
|
609
|
+
const suffixRecords = orderClaudePrewrittenAttachments(readCompleteJsonlRecordEntries(opened.fd, resumeOffsetBytes, completeLength, { preReadBuffer: suffixBuffer.subarray(0, completeLength) }).map((entry) => entry.record));
|
|
608
610
|
const after = fs.fstatSync(opened.fd);
|
|
609
611
|
if (!sameStableTranscriptFile(before, after)) {
|
|
610
612
|
assertObservableClaudeActiveTaskAgent(options.agentRows, anchor);
|
|
@@ -615,7 +617,9 @@ export function observeClaudeHumanStartedActiveTask(options) {
|
|
|
615
617
|
checkpoint
|
|
616
618
|
};
|
|
617
619
|
}
|
|
618
|
-
const advanced = advanceClaudeHumanStartedActiveTaskCheckpoint(anchor, checkpoint,
|
|
620
|
+
const advanced = advanceClaudeHumanStartedActiveTaskCheckpoint(anchor, checkpoint, checkpoint.record_count === 0
|
|
621
|
+
? initialClaudeTranscriptCheckpointRecords(suffixRecords, anchor.prompt_uuid, hasTurnCompletionSignal)
|
|
622
|
+
: suffixRecords, safeResumeOffsetBytes);
|
|
619
623
|
if (advanced.completion) {
|
|
620
624
|
return { status: "completed", completion: advanced.completion };
|
|
621
625
|
}
|
|
@@ -744,7 +748,7 @@ function isActiveClaudeAgentState(agent) {
|
|
|
744
748
|
return agent.status === "working" ||
|
|
745
749
|
agent.status === "busy" ||
|
|
746
750
|
(agent.status === "waiting" &&
|
|
747
|
-
["dialog open", "permission prompt"].includes(agent.waitingFor ?? ""));
|
|
751
|
+
["dialog open", "permission prompt", "input needed"].includes(agent.waitingFor ?? ""));
|
|
748
752
|
}
|
|
749
753
|
function isObservableClaudeAgentState(agent) {
|
|
750
754
|
return isClaudeAgentIdleState(agent) || isActiveClaudeAgentState(agent);
|
|
@@ -2090,8 +2094,8 @@ function openRelativeTranscript(projectsRoot, relativePath) {
|
|
|
2090
2094
|
}
|
|
2091
2095
|
}
|
|
2092
2096
|
function readCompleteJsonlRecords(fd, offset, length) {
|
|
2093
|
-
return readCompleteJsonlRecordEntries(fd, offset, length)
|
|
2094
|
-
.map((entry) => entry.record);
|
|
2097
|
+
return orderClaudePrewrittenAttachments(readCompleteJsonlRecordEntries(fd, offset, length)
|
|
2098
|
+
.map((entry) => entry.record));
|
|
2095
2099
|
}
|
|
2096
2100
|
function readBoundedCompleteJsonlTail(fd, endOffset, maxBytes) {
|
|
2097
2101
|
const offset = Math.max(0, endOffset - maxBytes);
|
|
@@ -2170,17 +2174,6 @@ function descendantRecords(records, recordsByUuid, ancestorUuid, predicate) {
|
|
|
2170
2174
|
return records.filter((record) => predicate(record) &&
|
|
2171
2175
|
descendantChain(recordsByUuid, ancestorUuid, record) !== undefined);
|
|
2172
2176
|
}
|
|
2173
|
-
function assertParentsPrecedeChildren(records, recordsByUuid) {
|
|
2174
|
-
const indexes = new Map(records.map((record, index) => [record, index]));
|
|
2175
|
-
for (const record of records) {
|
|
2176
|
-
const parentUuid = uuidValue(record.parentUuid);
|
|
2177
|
-
const parent = parentUuid ? recordsByUuid.get(parentUuid) : undefined;
|
|
2178
|
-
if (parent && (indexes.get(parent) ?? Number.POSITIVE_INFINITY) >=
|
|
2179
|
-
(indexes.get(record) ?? Number.NEGATIVE_INFINITY)) {
|
|
2180
|
-
throw new Error("Claude transcript parent UUID does not precede its child record");
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
2177
|
function descendantChain(recordsByUuid, ancestorUuid, descendant) {
|
|
2185
2178
|
const reversed = [];
|
|
2186
2179
|
let current = descendant;
|