@rynx-ai/runtime 0.1.11-beta.4 → 0.1.11-beta.40
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/claude/executor.d.ts +19 -5
- package/dist/claude/executor.js +56 -12
- package/dist/claude/models.d.ts +0 -5
- package/dist/claude/models.js +1 -7
- package/dist/claude/native-bridge.d.ts +103 -1
- package/dist/claude/native-bridge.js +445 -30
- package/dist/claude/native-hook-main.js +81 -1
- package/dist/claude/native-hooks.js +7 -0
- package/dist/claude/native-integration.d.ts +178 -26
- package/dist/claude/native-integration.js +1528 -170
- package/dist/claude/session-status.d.ts +39 -0
- package/dist/claude/session-status.js +163 -0
- package/dist/claude/transcript-clone.d.ts +18 -0
- package/dist/claude/transcript-clone.js +497 -0
- package/dist/claude/transcript.d.ts +27 -4
- package/dist/claude/transcript.js +158 -47
- package/dist/codex-app-server/client.d.ts +10 -6
- package/dist/codex-app-server/client.js +67 -15
- package/dist/codex-app-server/forwarder.d.ts +92 -3
- package/dist/codex-app-server/forwarder.js +532 -57
- package/dist/codex-app-server/mapping.d.ts +3 -6
- package/dist/codex-app-server/mapping.js +206 -36
- package/dist/codex-app-server/mcp-startup.d.ts +13 -0
- package/dist/codex-app-server/mcp-startup.js +63 -0
- package/dist/codex-app-server/process-registry.d.ts +36 -0
- package/dist/codex-app-server/process-registry.js +320 -0
- package/dist/codex-app-server/protocol.d.ts +64 -7
- package/dist/codex-app-server/ws-channel.d.ts +7 -0
- package/dist/codex-app-server/ws-channel.js +104 -28
- package/dist/codex-home.d.ts +35 -3
- package/dist/codex-home.js +323 -18
- package/dist/codex-session-store.d.ts +23 -0
- package/dist/codex-session-store.js +21 -0
- package/dist/host.d.ts +103 -46
- package/dist/host.js +1988 -634
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/input-resources.d.ts +4 -0
- package/dist/input-resources.js +21 -5
- package/dist/models-catalog.d.ts +2 -1
- package/dist/models-catalog.js +94 -6
- package/dist/runner/child.d.ts +97 -28
- package/dist/runner/child.js +1486 -100
- package/dist/runner/manager.d.ts +110 -29
- package/dist/runner/manager.js +1481 -246
- package/dist/runner/protocol.d.ts +212 -24
- package/dist/runner/protocol.js +5 -0
- package/dist/runner/startup-policy.d.ts +7 -0
- package/dist/runner/startup-policy.js +10 -0
- package/dist/runner/transport.d.ts +18 -2
- package/dist/runner/transport.js +82 -3
- package/dist/runner-main.js +8 -3
- package/dist/terminal/claude-tui.d.ts +3 -1
- package/dist/terminal/claude-tui.js +3 -1
- package/dist/terminal/codex-tui.d.ts +4 -0
- package/dist/terminal/codex-tui.js +5 -0
- package/dist/terminal/control-parser.d.ts +39 -0
- package/dist/terminal/control-parser.js +172 -0
- package/dist/terminal/registry.d.ts +18 -15
- package/dist/terminal/registry.js +44 -23
- package/dist/terminal/spool.d.ts +47 -0
- package/dist/terminal/spool.js +231 -0
- package/dist/terminal/tmux.d.ts +126 -74
- package/dist/terminal/tmux.js +807 -211
- package/package.json +4 -4
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import type { SkillMeta } from "@rynx-ai/core";
|
|
2
|
+
export interface MaterializedClaudePlugin {
|
|
3
|
+
pluginDir: string;
|
|
4
|
+
}
|
|
5
|
+
/** Stable Claude `--plugin-dir` owned by one Rynx Session. */
|
|
6
|
+
export declare function claudePluginDir(sessionId: string): string;
|
|
2
7
|
/**
|
|
3
|
-
*
|
|
8
|
+
* Return the existing Session-owned plugin directory as-is. It is the durable
|
|
9
|
+
* Provider input for this Session, not an immutable shared cache: runtime files
|
|
10
|
+
* created inside it (for example Python `__pycache__`) remain part of that
|
|
11
|
+
* Session and do not trigger SkillRef replay.
|
|
12
|
+
*/
|
|
13
|
+
export declare function reuseClaudePlugin(sessionId: string): Promise<MaterializedClaudePlugin | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Materialize a selected catalog skill subset into a Session-owned Claude
|
|
4
16
|
* `--plugin-dir` (a dir with `skills/<name>/SKILL.md` + a `.claude-plugin/plugin.json`
|
|
5
17
|
* manifest — claude's mechanism for exposing skills outside its host dirs, since
|
|
6
18
|
* it doesn't scan `~/.rynx/skills`). Consumed by the claude-native live launch.
|
|
7
19
|
*
|
|
20
|
+
* The committed path is deterministic and survives Provider/runner restarts.
|
|
21
|
+
* An existing directory is returned as-is. The first materialization is built
|
|
22
|
+
* in a sibling staging directory and renamed into the stable path so a crash
|
|
23
|
+
* cannot expose a partially copied plugin.
|
|
24
|
+
*
|
|
8
25
|
* Returns `null` when there's nothing to add. Rynx-managed Claude sessions load
|
|
9
26
|
* no host/project/local setting sources, so this explicit plugin directory is
|
|
10
27
|
* the only native skill channel; the selected subset is enforced exactly.
|
|
11
28
|
*/
|
|
12
|
-
export declare function
|
|
13
|
-
pluginDir?: string;
|
|
14
|
-
cleanup?: () => Promise<void>;
|
|
15
|
-
} | null>;
|
|
29
|
+
export declare function materializeClaudePlugin(sessionId: string, selected: SkillMeta[] | null | undefined): Promise<MaterializedClaudePlugin | null>;
|
package/dist/claude/executor.js
CHANGED
|
@@ -1,26 +1,70 @@
|
|
|
1
|
-
import { cp, mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
1
|
+
import { cp, mkdir, mkdtemp, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
3
2
|
import path from "node:path";
|
|
3
|
+
import { runtimeSessionStateDir } from "../runtime-state-paths.js";
|
|
4
|
+
/** Stable Claude `--plugin-dir` owned by one Rynx Session. */
|
|
5
|
+
export function claudePluginDir(sessionId) {
|
|
6
|
+
return path.join(runtimeSessionStateDir(sessionId), "claude-plugin");
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
9
|
+
* Return the existing Session-owned plugin directory as-is. It is the durable
|
|
10
|
+
* Provider input for this Session, not an immutable shared cache: runtime files
|
|
11
|
+
* created inside it (for example Python `__pycache__`) remain part of that
|
|
12
|
+
* Session and do not trigger SkillRef replay.
|
|
13
|
+
*/
|
|
14
|
+
export async function reuseClaudePlugin(sessionId) {
|
|
15
|
+
const pluginDir = claudePluginDir(sessionId);
|
|
16
|
+
try {
|
|
17
|
+
return (await stat(pluginDir)).isDirectory() ? { pluginDir } : null;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Materialize a selected catalog skill subset into a Session-owned Claude
|
|
6
25
|
* `--plugin-dir` (a dir with `skills/<name>/SKILL.md` + a `.claude-plugin/plugin.json`
|
|
7
26
|
* manifest — claude's mechanism for exposing skills outside its host dirs, since
|
|
8
27
|
* it doesn't scan `~/.rynx/skills`). Consumed by the claude-native live launch.
|
|
9
28
|
*
|
|
29
|
+
* The committed path is deterministic and survives Provider/runner restarts.
|
|
30
|
+
* An existing directory is returned as-is. The first materialization is built
|
|
31
|
+
* in a sibling staging directory and renamed into the stable path so a crash
|
|
32
|
+
* cannot expose a partially copied plugin.
|
|
33
|
+
*
|
|
10
34
|
* Returns `null` when there's nothing to add. Rynx-managed Claude sessions load
|
|
11
35
|
* no host/project/local setting sources, so this explicit plugin directory is
|
|
12
36
|
* the only native skill channel; the selected subset is enforced exactly.
|
|
13
37
|
*/
|
|
14
|
-
export async function
|
|
38
|
+
export async function materializeClaudePlugin(sessionId, selected) {
|
|
15
39
|
if (selected == null || selected.length === 0)
|
|
16
40
|
return null;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
41
|
+
const reused = await reuseClaudePlugin(sessionId);
|
|
42
|
+
if (reused)
|
|
43
|
+
return reused;
|
|
44
|
+
const pluginDir = claudePluginDir(sessionId);
|
|
45
|
+
const stateDir = runtimeSessionStateDir(sessionId);
|
|
46
|
+
await mkdir(stateDir, { recursive: true, mode: 0o700 });
|
|
47
|
+
const stagingDir = await mkdtemp(path.join(stateDir, ".claude-plugin-stage-"));
|
|
48
|
+
try {
|
|
49
|
+
const skillsRoot = path.join(stagingDir, "skills");
|
|
50
|
+
await mkdir(skillsRoot, { recursive: true });
|
|
51
|
+
for (const skill of selected) {
|
|
52
|
+
await cp(skill.dir, path.join(skillsRoot, skill.name), { recursive: true });
|
|
53
|
+
}
|
|
54
|
+
await mkdir(path.join(stagingDir, ".claude-plugin"), { recursive: true });
|
|
55
|
+
await writeFile(path.join(stagingDir, ".claude-plugin", "plugin.json"), `${JSON.stringify({ name: "rynx-agent-skills", description: "Per-agent skill subset" }, null, 2)}\n`);
|
|
56
|
+
try {
|
|
57
|
+
await rename(stagingDir, pluginDir);
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const concurrent = await reuseClaudePlugin(sessionId);
|
|
61
|
+
if (!concurrent)
|
|
62
|
+
throw error;
|
|
63
|
+
return concurrent;
|
|
64
|
+
}
|
|
65
|
+
return { pluginDir };
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
await rm(stagingDir, { recursive: true, force: true });
|
|
22
69
|
}
|
|
23
|
-
await mkdir(path.join(dir, ".claude-plugin"), { recursive: true });
|
|
24
|
-
await writeFile(path.join(dir, ".claude-plugin", "plugin.json"), `${JSON.stringify({ name: "rynx-agent-skills", description: "Per-agent skill subset" }, null, 2)}\n`);
|
|
25
|
-
return { pluginDir: dir, cleanup: () => rm(dir, { recursive: true, force: true }) };
|
|
26
70
|
}
|
package/dist/claude/models.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import type { ModelInfo, ModelListResponse } from "../codex-app-server/protocol.js";
|
|
2
|
-
/**
|
|
3
|
-
* Default model for the claude runtime when `CLAUDE_MODEL` is unset. Kept in
|
|
4
|
-
* sync with the `CLAUDE_MODEL` default in {@link import("../config.js")}.
|
|
5
|
-
*/
|
|
6
|
-
export declare const CLAUDE_DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
7
2
|
/** Build the `ModelInfo[]` for the claude runtime. */
|
|
8
3
|
export declare function claudeModelInfos(): ModelInfo[];
|
|
9
4
|
/** {@link ModelListResponse} for the claude runtime (broker `listModels`). */
|
package/dist/claude/models.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default model for the claude runtime when `CLAUDE_MODEL` is unset. Kept in
|
|
3
|
-
* sync with the `CLAUDE_MODEL` default in {@link import("../config.js")}.
|
|
4
|
-
*/
|
|
5
|
-
export const CLAUDE_DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
6
1
|
/**
|
|
7
2
|
* Static catalogue of Claude models the `/model` card and `/models` reply offer
|
|
8
3
|
* for the claude runtime. Unlike codex/traex (which query a live app-server),
|
|
@@ -12,7 +7,7 @@ export const CLAUDE_DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
|
12
7
|
*/
|
|
13
8
|
const CLAUDE_MODEL_IDS = [
|
|
14
9
|
{ id: "claude-opus-4-8", displayName: "Claude Opus 4.8 · 最强" },
|
|
15
|
-
{ id: "claude-sonnet-4-6", displayName: "Claude Sonnet 4.6 ·
|
|
10
|
+
{ id: "claude-sonnet-4-6", displayName: "Claude Sonnet 4.6 · 均衡" },
|
|
16
11
|
{ id: "claude-haiku-4-5", displayName: "Claude Haiku 4.5 · 最快" },
|
|
17
12
|
{ id: "claude-opus-4-7", displayName: "Claude Opus 4.7" },
|
|
18
13
|
{ id: "claude-opus-4-6", displayName: "Claude Opus 4.6" },
|
|
@@ -24,7 +19,6 @@ export function claudeModelInfos() {
|
|
|
24
19
|
id,
|
|
25
20
|
model: id,
|
|
26
21
|
displayName,
|
|
27
|
-
isDefault: id === CLAUDE_DEFAULT_MODEL,
|
|
28
22
|
}));
|
|
29
23
|
}
|
|
30
24
|
/** {@link ModelListResponse} for the claude runtime (broker `listModels`). */
|
|
@@ -4,6 +4,10 @@ export declare const STATE_FILE = "state.json";
|
|
|
4
4
|
export declare const DELTAS_FILE = "message_deltas.jsonl";
|
|
5
5
|
export declare const STATUS_FILE = "status.json";
|
|
6
6
|
export declare const FORWARDER_STATE_FILE = "transcript_forwarder.json";
|
|
7
|
+
export declare const HOOK_FORWARDER_STATE_FILE = "hook_forwarder.json";
|
|
8
|
+
export declare const SUBAGENT_FORWARDER_STATE_FILE = "subagent_forwarder.json";
|
|
9
|
+
export declare const DELTA_FORWARDER_STATE_FILE = "message_deltas_forwarder.json";
|
|
10
|
+
export declare const COMPACTION_FORWARDER_STATE_FILE = "compaction_forwarder.json";
|
|
7
11
|
export declare const INTERACTIONS_FILE = "interactions.jsonl";
|
|
8
12
|
export declare const INTERACTION_ACKS_FILE = "interaction-acks.jsonl";
|
|
9
13
|
export declare const INTERACTION_RESULTS_DIR = "interaction-results";
|
|
@@ -82,9 +86,15 @@ export interface ClaudeBridgeState {
|
|
|
82
86
|
transcriptPath?: string;
|
|
83
87
|
/** Claude's own session uuid (from the hook payload `session_id`). */
|
|
84
88
|
claudeSessionId?: string;
|
|
89
|
+
/** Native Session ids already observed by this stable bridge owner. */
|
|
90
|
+
seenClaudeSessionIds?: string[];
|
|
85
91
|
lastHookEventName?: string;
|
|
86
92
|
}
|
|
87
93
|
export declare function readClaudeState(bridgeDir: string): ClaudeBridgeState;
|
|
94
|
+
/** Capture the pre-SessionStart identity before state.json is advanced. The
|
|
95
|
+
* observer hook and forwarder use these stable facts to distinguish a new
|
|
96
|
+
* branch from a later resume into an already-seen native Session. */
|
|
97
|
+
export declare function annotateClaudeResumeContext(bridgeDir: string, payload: Record<string, unknown>): void;
|
|
88
98
|
/**
|
|
89
99
|
* Append one Claude hook payload to `hooks.jsonl` and fold its key fields into
|
|
90
100
|
* `state.json` (transcript path + claude session id + last event). The payload
|
|
@@ -100,22 +110,53 @@ export interface JsonlReadResult<T> {
|
|
|
100
110
|
* line is left unconsumed so the next poll retries it once its newline lands. */
|
|
101
111
|
nextOffset: number;
|
|
102
112
|
}
|
|
113
|
+
export interface JsonlRecordEntry<T> {
|
|
114
|
+
record: T;
|
|
115
|
+
/** Byte offset at which this complete record begins. */
|
|
116
|
+
byteOffset: number;
|
|
117
|
+
/** One-based physical line number, including blank/malformed lines. */
|
|
118
|
+
lineNumber: number;
|
|
119
|
+
}
|
|
120
|
+
export interface JsonlEntryReadResult<T> extends JsonlReadResult<T> {
|
|
121
|
+
entries: JsonlRecordEntry<T>[];
|
|
122
|
+
nextLineCursor: number;
|
|
123
|
+
}
|
|
103
124
|
/** Read complete newline-terminated JSON records appended after `byteOffset`. */
|
|
104
125
|
export declare function readJsonlFrom<T = unknown>(path: string, byteOffset: number): JsonlReadResult<T>;
|
|
126
|
+
/** Read complete records with their stable byte/line source positions. */
|
|
127
|
+
export declare function readJsonlEntriesFrom<T = unknown>(path: string, byteOffset: number, startLineCursor?: number): JsonlEntryReadResult<T>;
|
|
105
128
|
/** One parsed Claude hook event (the fields the forwarder acts on + the raw payload). */
|
|
106
129
|
export interface HookEvent {
|
|
130
|
+
/** One-based record position in the append-only hook stream. */
|
|
131
|
+
eventCursor: number;
|
|
132
|
+
/** Byte offset immediately after this complete JSONL record. */
|
|
133
|
+
byteOffset: number;
|
|
134
|
+
/** Wall-clock time when the hook observer captured this payload. */
|
|
135
|
+
recordedAt?: number;
|
|
107
136
|
eventName?: string;
|
|
108
137
|
transcriptPath?: string;
|
|
109
138
|
/** Claude's session uuid — subagent hooks report a `subagents/…` transcript path. */
|
|
110
139
|
sessionId?: string;
|
|
111
140
|
source?: string;
|
|
141
|
+
/** Authoritative live background-shell count carried by a Stop hook. */
|
|
142
|
+
backgroundTaskCount?: number;
|
|
112
143
|
payload: Record<string, unknown>;
|
|
113
144
|
}
|
|
114
145
|
/** Tail `hooks.jsonl` from a byte offset into parsed {@link HookEvent}s. */
|
|
115
|
-
export declare function readHookEventsFrom(bridgeDir: string, byteOffset: number): {
|
|
146
|
+
export declare function readHookEventsFrom(bridgeDir: string, byteOffset: number, startEventCursor?: number): {
|
|
116
147
|
events: HookEvent[];
|
|
117
148
|
nextOffset: number;
|
|
118
149
|
};
|
|
150
|
+
export interface HookForwardState {
|
|
151
|
+
eventCursor: number;
|
|
152
|
+
byteOffset: number;
|
|
153
|
+
cursorFingerprint?: string;
|
|
154
|
+
}
|
|
155
|
+
/** Read and validate the durable hook cursor. A replaced/truncated hook stream
|
|
156
|
+
* restarts at zero; event handlers provide their own stable deduplication. */
|
|
157
|
+
export declare function readHookForwardState(bridgeDir: string): HookForwardState | undefined;
|
|
158
|
+
/** Persist one consumed hook record before another poll can observe it. */
|
|
159
|
+
export declare function writeHookForwardState(bridgeDir: string, state: HookForwardState): void;
|
|
119
160
|
/** One streamed assistant-text chunk from `message_deltas.jsonl` (MessageDisplay). */
|
|
120
161
|
export interface MessageDelta {
|
|
121
162
|
messageId: string;
|
|
@@ -123,6 +164,31 @@ export interface MessageDelta {
|
|
|
123
164
|
final: boolean;
|
|
124
165
|
delta: string;
|
|
125
166
|
}
|
|
167
|
+
export interface DeltaForwardState {
|
|
168
|
+
byteOffset: number;
|
|
169
|
+
}
|
|
170
|
+
export interface PendingCompactionState {
|
|
171
|
+
sequence: number;
|
|
172
|
+
claudeSessionId?: string;
|
|
173
|
+
transcriptPath?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface CompactionForwardState {
|
|
176
|
+
/** Logical Provider generation. clear/fork starts a fresh reconciliation
|
|
177
|
+
* domain even though the bridge directory remains stable. */
|
|
178
|
+
generation: string;
|
|
179
|
+
lastSequence: number;
|
|
180
|
+
persistedSequences: number[];
|
|
181
|
+
lastPrecompactCursor: number;
|
|
182
|
+
pending?: PendingCompactionState;
|
|
183
|
+
expectCompletionAckSequence?: number;
|
|
184
|
+
}
|
|
185
|
+
export declare function readCompactionForwardState(bridgeDir: string, generation: string): CompactionForwardState;
|
|
186
|
+
export declare function writeCompactionForwardState(bridgeDir: string, state: CompactionForwardState): void;
|
|
187
|
+
/** Read the process-wide MessageDisplay cursor. It deliberately survives
|
|
188
|
+
* logical Session rotation; if the append log was truncated by a fresh Claude
|
|
189
|
+
* process, restart at zero. */
|
|
190
|
+
export declare function readDeltaForwardState(bridgeDir: string): DeltaForwardState;
|
|
191
|
+
export declare function writeDeltaForwardState(bridgeDir: string, state: DeltaForwardState): void;
|
|
126
192
|
/** Tail `message_deltas.jsonl` from a byte offset into {@link MessageDelta}s. */
|
|
127
193
|
export declare function readMessageDeltasFrom(bridgeDir: string, byteOffset: number): {
|
|
128
194
|
deltas: MessageDelta[];
|
|
@@ -166,12 +232,26 @@ export interface TranscriptForwardState {
|
|
|
166
232
|
transcriptPath: string;
|
|
167
233
|
/** Primary dedup: bytes already forwarded. A restart seeks here. */
|
|
168
234
|
byteOffset: number;
|
|
235
|
+
/** Complete physical JSONL lines consumed at `byteOffset`. */
|
|
236
|
+
lineCursor?: number;
|
|
169
237
|
/** Secondary dedup: recently-forwarded record source ids (a bounded ring), so a
|
|
170
238
|
* re-read (fingerprint reset / mid-poll death) doesn't re-emit. */
|
|
171
239
|
seenSourceIds: string[];
|
|
172
240
|
/** SHA-256 of `byteOffset` (8-byte BE) + up to 256 bytes before it. On restart a
|
|
173
241
|
* mismatch means the file was truncated/replaced → don't seek into a stale offset. */
|
|
174
242
|
cursorFingerprint?: string;
|
|
243
|
+
/** Open Claude turn restored across a runner restart so later records remain
|
|
244
|
+
* grouped under the same canonical response. */
|
|
245
|
+
currentTurnId?: string;
|
|
246
|
+
currentResponseId?: string;
|
|
247
|
+
turnOpen?: boolean;
|
|
248
|
+
/** Split local-command input awaiting its later output record. Rynx stores a
|
|
249
|
+
* combined terminal item, so the command text and owning turn must survive a
|
|
250
|
+
* runner restart between those two native transcript records. */
|
|
251
|
+
activeTerminalCommand?: {
|
|
252
|
+
command: string;
|
|
253
|
+
turnId?: string;
|
|
254
|
+
};
|
|
175
255
|
}
|
|
176
256
|
/** Cap on `seenSourceIds` (matches reference implementation's `_MAX_SEEN_SOURCE_IDS`). */
|
|
177
257
|
export declare const MAX_SEEN_SOURCE_IDS = 2000;
|
|
@@ -186,5 +266,27 @@ export declare function writeForwardState(bridgeDir: string, state: TranscriptFo
|
|
|
186
266
|
export declare function readForwardState(bridgeDir: string): TranscriptForwardState | undefined;
|
|
187
267
|
/** Drop the forwarder cursor (a `/clear` starts fresh). */
|
|
188
268
|
export declare function resetForwardState(bridgeDir: string): void;
|
|
269
|
+
export interface NativeSubagentForwardState {
|
|
270
|
+
agentId: string;
|
|
271
|
+
parentToolCallId: string;
|
|
272
|
+
/** Canonical parent response retained after the parent transcript cursor has
|
|
273
|
+
* advanced, so a runner restart keeps late child items in the same Turn. */
|
|
274
|
+
parentResponseId?: string;
|
|
275
|
+
transcriptPath: string;
|
|
276
|
+
byteOffset: number;
|
|
277
|
+
lineCursor?: number;
|
|
278
|
+
seenSourceIds: string[];
|
|
279
|
+
/** Split local-command input represented by the latest handled child item. */
|
|
280
|
+
terminalCommand?: string;
|
|
281
|
+
}
|
|
282
|
+
/** Parent Task/tool ids already consumed by the main transcript cursor. Kept
|
|
283
|
+
* independently of concrete child agents because Claude may create the child
|
|
284
|
+
* meta file only after the parent record was durably acknowledged. */
|
|
285
|
+
export declare function readSubagentParentResponses(bridgeDir: string, parentTranscriptPath: string): Map<string, string>;
|
|
286
|
+
/** Read independent Claude native sub-agent cursors for one parent transcript. */
|
|
287
|
+
export declare function readSubagentForwardStates(bridgeDir: string, parentTranscriptPath: string): NativeSubagentForwardState[];
|
|
288
|
+
/** Atomically persist every native sub-agent's independent delivery cursor. */
|
|
289
|
+
export declare function writeSubagentForwardStates(bridgeDir: string, parentTranscriptPath: string, states: readonly NativeSubagentForwardState[], parentResponses?: ReadonlyMap<string, string>): void;
|
|
290
|
+
export declare function resetSubagentForwardStates(bridgeDir: string): void;
|
|
189
291
|
/** Read the latest `status.json` snapshot, or undefined if absent/malformed. */
|
|
190
292
|
export declare function readClaudeStatus(bridgeDir: string): ClaudeStatusState | undefined;
|