@rynx-ai/runtime 0.1.11-beta.37 → 0.1.11-beta.39
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/native-bridge.d.ts +85 -0
- package/dist/claude/native-bridge.js +335 -17
- package/dist/claude/native-hook-main.js +18 -1
- package/dist/claude/native-hooks.js +7 -0
- package/dist/claude/native-integration.d.ts +120 -18
- package/dist/claude/native-integration.js +1200 -161
- 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 +131 -30
- package/dist/codex-session-store.d.ts +23 -0
- package/dist/codex-session-store.js +21 -0
- package/dist/host.d.ts +31 -2
- package/dist/host.js +551 -72
- package/dist/runner/child.d.ts +29 -5
- package/dist/runner/child.js +635 -54
- package/dist/runner/manager.d.ts +25 -0
- package/dist/runner/manager.js +805 -115
- package/dist/runner/protocol.d.ts +76 -3
- package/dist/runner/transport.d.ts +9 -0
- package/dist/runner/transport.js +39 -12
- package/package.json +2 -2
package/dist/runner/child.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type AgentCapabilities, type LiveSessionFailure, type ResolvedExecutionSnapshot, type RuntimeTurnOptions, type RuntimeUserInput, type SessionCollaborationMode, type SessionInteractionResolution, type SessionWorkspaceSnapshot } from "@rynx-ai/core";
|
|
2
|
-
import type { SessionEvent } from "@rynx-ai/core";
|
|
3
2
|
import { type TerminalLifecycle } from "../terminal/registry.js";
|
|
4
3
|
import type { TerminalInjector } from "../claude/native-integration.js";
|
|
4
|
+
import type { MirrorEmitter } from "../host.js";
|
|
5
5
|
import type { ResolveInteractionResult } from "../interactions.js";
|
|
6
6
|
import { type InjectResult } from "./protocol.js";
|
|
7
|
-
import type
|
|
7
|
+
import { type ChildTransport } from "./transport.js";
|
|
8
8
|
/** Re-target the mirror to a freshly minted rynx session (claude `/clear`·`/fork`)
|
|
9
9
|
* + record the terminal transfer with the daemon. The child owns the transport,
|
|
10
10
|
* so it supplies this to the host. */
|
|
@@ -13,7 +13,8 @@ type RetargetMirror = (newSessionId: string, meta: {
|
|
|
13
13
|
workspace: SessionWorkspaceSnapshot;
|
|
14
14
|
execution: ResolvedExecutionSnapshot;
|
|
15
15
|
parentSessionId?: string;
|
|
16
|
-
|
|
16
|
+
beforeApplied?: () => void | Promise<void>;
|
|
17
|
+
}) => void | Promise<void>;
|
|
17
18
|
/** Codex-native live-session methods the executor (a `LocalAgentHost`) exposes
|
|
18
19
|
* beyond the `AgentExecutor`/`AgentCapabilities` contract. Duck-typed so the
|
|
19
20
|
* runner works with any executor (a claude-only host simply lacks them). */
|
|
@@ -30,7 +31,7 @@ interface LiveCodexProvider {
|
|
|
30
31
|
keepAliveAfterExit?: boolean;
|
|
31
32
|
lifecycle: TerminalLifecycle;
|
|
32
33
|
} | null>;
|
|
33
|
-
ensureLiveCodexSession?(localThreadId: string, emit:
|
|
34
|
+
ensureLiveCodexSession?(localThreadId: string, emit: MirrorEmitter, opts: {
|
|
34
35
|
workspace: SessionWorkspaceSnapshot;
|
|
35
36
|
execution: ResolvedExecutionSnapshot;
|
|
36
37
|
retargetMirror?: RetargetMirror;
|
|
@@ -80,6 +81,10 @@ export interface RunnerSessionDeps {
|
|
|
80
81
|
/** Invoked on a `shutdown` message (default: close transport). */
|
|
81
82
|
onShutdown?: () => void;
|
|
82
83
|
}
|
|
84
|
+
/** Delivery retry schedule: 1, 2, 4, 8, 16, 30, 30… seconds.
|
|
85
|
+
* Clamp before exponentiation so an indefinitely transient outage cannot
|
|
86
|
+
* overflow after thousands of attempts. */
|
|
87
|
+
export declare function mirrorRetryDelayMs(failedAttempt: number): number;
|
|
83
88
|
export declare class RunnerSession {
|
|
84
89
|
private readonly transport;
|
|
85
90
|
private readonly executor;
|
|
@@ -99,11 +104,17 @@ export declare class RunnerSession {
|
|
|
99
104
|
private readonly cancelledTerminalOpens;
|
|
100
105
|
/** Session ids with a live codex forwarder started here (stopped on shutdown). */
|
|
101
106
|
private readonly liveIds;
|
|
102
|
-
private
|
|
107
|
+
private readonly mirrorQueues;
|
|
108
|
+
private readonly mirrorAcks;
|
|
103
109
|
private readonly mirrorImageAcks;
|
|
110
|
+
private readonly mirrorRetryWaiters;
|
|
111
|
+
private readonly rotationPublishAcks;
|
|
112
|
+
private readonly rotationAppliedAcks;
|
|
104
113
|
/** Provider name retained for asynchronous Terminal-exit diagnostics. */
|
|
105
114
|
private readonly liveRuntimes;
|
|
106
115
|
private readonly terminalStatuses;
|
|
116
|
+
private consecutiveMirrorFailures;
|
|
117
|
+
private mirrorDegraded;
|
|
107
118
|
private shuttingDown;
|
|
108
119
|
private shutdownPromise;
|
|
109
120
|
constructor({ transport, executor, onShutdown }: RunnerSessionDeps);
|
|
@@ -119,8 +130,21 @@ export declare class RunnerSession {
|
|
|
119
130
|
private transferNativeSessionResources;
|
|
120
131
|
private enqueueMirror;
|
|
121
132
|
private sendMirroredEvent;
|
|
133
|
+
private deliverMirrorImageEvent;
|
|
134
|
+
private deliverMirrorImageTransportFrame;
|
|
135
|
+
private deliverMirrorEvent;
|
|
136
|
+
private noteMirrorDeliveryFailed;
|
|
137
|
+
private noteMirrorDeliveryRecovered;
|
|
138
|
+
private sendMirrorEventFrame;
|
|
139
|
+
private abandonMirrorDelivery;
|
|
140
|
+
private waitForMirrorRetry;
|
|
141
|
+
private cancelMirrorGeneration;
|
|
142
|
+
private rejectMirrorAcks;
|
|
122
143
|
private sendMirrorImageFrame;
|
|
123
144
|
private rejectMirrorImageAcks;
|
|
145
|
+
private sendRotationFrame;
|
|
146
|
+
private sendRotationAppliedFrame;
|
|
147
|
+
private rejectRotationAcks;
|
|
124
148
|
/**
|
|
125
149
|
* Eagerly bring up a session's codex-native live view. Fresh sessions connect
|
|
126
150
|
* the discovery listener before launching the detached TUI; known-thread
|