@rynx-ai/server 0.1.10 → 0.1.11-beta.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/control-api.d.ts +10 -52
- package/dist/control-api.js +588 -335
- package/dist/control-web/assets/{highlighted-body-OFNGDK62-DgFZpTNw.js → highlighted-body-OFNGDK62-DWWsUtHF.js} +1 -1
- package/dist/control-web/assets/index-BnX7NWJX.js +689 -0
- package/dist/control-web/assets/index-CUoWRX2i.css +32 -0
- package/dist/control-web/assets/{mermaid-GHXKKRXX-BDikE3W1.js → mermaid-GHXKKRXX-C1fxAgiw.js} +3 -3
- package/dist/control-web/index.html +2 -2
- package/dist/machine-session-service.d.ts +106 -23
- package/dist/machine-session-service.js +290 -53
- package/dist/remote-runtime-dispatcher.d.ts +12 -2
- package/dist/remote-runtime-dispatcher.js +52 -0
- package/dist/remote-runtime-session-projection.js +1 -0
- package/dist/server.d.ts +36 -28
- package/dist/server.js +81 -140
- package/dist/session-runtime-index.js +7 -0
- package/package.json +7 -7
- package/dist/channel-manager.d.ts +0 -60
- package/dist/channel-manager.js +0 -106
- package/dist/control-web/assets/index-CnVtOmLv.css +0 -32
- package/dist/control-web/assets/index-Dlywgy58.js +0 -661
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
8
8
|
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
9
9
|
<title>rynx · control</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-BnX7NWJX.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CUoWRX2i.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This service deliberately has no HTTP, Koa, WebSocket, or Direct-binding
|
|
5
|
-
* knowledge. Durable records, live state, events, and interruption remain owned
|
|
6
|
-
* by the daemon process and arrive through narrow injected ports. Local and
|
|
7
|
-
* Direct adapters can therefore expose the same behavior without copying state
|
|
8
|
-
* into a Control Plane database.
|
|
9
|
-
*/
|
|
10
|
-
import { type AgentRuntimeId, type AgentSpec, type ConversationRuntime, type SessionProviderId, type ReasoningEffort, type RuntimeUserInput, type SessionBus, type SessionLogStore, type SessionRegistry } from "@rynx-ai/core";
|
|
11
|
-
import type { SequencedSessionEvent, SessionInteractionResolution, SessionItem, UserContentPart } from "@rynx-ai/protocol";
|
|
1
|
+
import { type AgentRuntimeId, type ConversationRuntime, type ResolvedExecutionSnapshot, type SessionWorkspaceSnapshot, type SessionProviderId, type MachineSessionRecord, type ReasoningEffort, type RuntimeUserInput, type SessionBus, type SessionLogStore, type SessionRegistry } from "@rynx-ai/core";
|
|
2
|
+
import type { SequencedSessionEvent, SessionEvent, SessionInteractionResolution, SessionItem, UserContentPart } from "@rynx-ai/protocol";
|
|
12
3
|
import type { RemoteRuntimeSessionResourceDeleteParams, RemoteRuntimeSessionResourceDeleteResult, RemoteRuntimeSessionResourceGetParams, RemoteRuntimeSessionResourceGetResult, RemoteRuntimeSessionResourcePolicyResult, RemoteRuntimeSessionResourceReadParams, RemoteRuntimeSessionResourceReadResult, RemoteRuntimeSessionResourceUploadBeginParams, RemoteRuntimeSessionResourceUploadBeginResult, RemoteRuntimeSessionResourceUploadChunkParams, RemoteRuntimeSessionResourceUploadChunkResult, RemoteRuntimeSessionResourceUploadCommitParams, RemoteRuntimeSessionResourceUploadCommitResult } from "@rynx-ai/protocol/remote-runtime-rpc";
|
|
13
4
|
import type { ControlAgentSummary, ControlSessionInteractionResolveDisposition, ControlSessionRuntimeSnapshot } from "@rynx-ai/protocol/control";
|
|
14
5
|
import { type RemoteRuntimeSessionInterruptResult, type RemoteRuntimeSessionLaunchOptionsListResult, type RemoteRuntimeSessionListParams, type RemoteRuntimeSessionListResult, type RemoteRuntimeSessionSnapshotParams } from "@rynx-ai/protocol/remote-runtime-rpc";
|
|
15
|
-
import {
|
|
6
|
+
import type { CodexRuntimeStatus, InjectOutcome } from "@rynx-ai/runtime";
|
|
16
7
|
export interface MachineSessionRuntimeStatePort {
|
|
17
8
|
snapshot(sessionId: string): ControlSessionRuntimeSnapshot;
|
|
18
9
|
remove?(sessionId: string): void;
|
|
@@ -63,23 +54,17 @@ export interface MachineSessionResourcePort {
|
|
|
63
54
|
}
|
|
64
55
|
export interface MachineSessionRunnerPort {
|
|
65
56
|
ensureLiveSession(sessionId: string, options?: {
|
|
66
|
-
cwd?: string;
|
|
67
57
|
cols?: number;
|
|
68
58
|
rows?: number;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
agentName?: string;
|
|
72
|
-
agentSpec?: AgentSpec;
|
|
59
|
+
workspace?: SessionWorkspaceSnapshot;
|
|
60
|
+
execution?: ResolvedExecutionSnapshot;
|
|
73
61
|
}): Promise<boolean>;
|
|
74
62
|
/** Start the Provider TUI pane without waiting for its native thread to bind. */
|
|
75
63
|
startLiveSession?(sessionId: string, options?: {
|
|
76
|
-
cwd?: string;
|
|
77
64
|
cols?: number;
|
|
78
65
|
rows?: number;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
agentName?: string;
|
|
82
|
-
agentSpec?: AgentSpec;
|
|
66
|
+
workspace?: SessionWorkspaceSnapshot;
|
|
67
|
+
execution?: ResolvedExecutionSnapshot;
|
|
83
68
|
}): Promise<boolean>;
|
|
84
69
|
lastLiveSessionError?(sessionId: string): string | undefined;
|
|
85
70
|
injectMessage(sessionId: string, input: RuntimeUserInput | string): Promise<InjectOutcome>;
|
|
@@ -87,15 +72,69 @@ export interface MachineSessionRunnerPort {
|
|
|
87
72
|
resolveInteraction(sessionId: string, interactionId: string, resolution: SessionInteractionResolution): Promise<{
|
|
88
73
|
disposition: ControlSessionInteractionResolveDisposition;
|
|
89
74
|
}>;
|
|
75
|
+
/** Internal Provider fork. RunnerManager fences both source and target before
|
|
76
|
+
* invoking `beforeProviderFork`, then commits the native Provider context. */
|
|
77
|
+
forkSession?(sourceSessionId: string, targetSessionId: string, options: {
|
|
78
|
+
workspace: SessionWorkspaceSnapshot;
|
|
79
|
+
execution: ResolvedExecutionSnapshot;
|
|
80
|
+
beforeProviderFork: () => Promise<void>;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
ok: true;
|
|
83
|
+
} | {
|
|
84
|
+
ok: false;
|
|
85
|
+
message: string;
|
|
86
|
+
}>;
|
|
90
87
|
/** Backend-free readiness probe for launch options and direct Provider creation. */
|
|
91
88
|
getStatus?(options: {
|
|
92
89
|
runtime: AgentRuntimeId;
|
|
93
90
|
}): Promise<CodexRuntimeStatus>;
|
|
94
91
|
}
|
|
92
|
+
export type MachineSessionForkOperationState = "reserved" | "completed" | "target_deleted";
|
|
93
|
+
export interface MachineSessionForkOperationRecord {
|
|
94
|
+
operationId: string;
|
|
95
|
+
requestHash: string;
|
|
96
|
+
sourceSessionId: string;
|
|
97
|
+
targetSessionId: string;
|
|
98
|
+
title?: string;
|
|
99
|
+
forkPosition?: number;
|
|
100
|
+
state: MachineSessionForkOperationState;
|
|
101
|
+
error?: string;
|
|
102
|
+
}
|
|
103
|
+
/** Durable idempotency + atomic Session/history/resource publication boundary.
|
|
104
|
+
* The daemon implementation owns SQLite and resource files; the application
|
|
105
|
+
* service never exposes a target before this port commits it. */
|
|
106
|
+
export interface MachineSessionForkStorePort {
|
|
107
|
+
claim(input: {
|
|
108
|
+
operationId: string;
|
|
109
|
+
requestHash: string;
|
|
110
|
+
sourceSessionId: string;
|
|
111
|
+
title?: string;
|
|
112
|
+
}): MachineSessionForkOperationRecord | Promise<MachineSessionForkOperationRecord>;
|
|
113
|
+
commit(input: {
|
|
114
|
+
operationId: string;
|
|
115
|
+
target: MachineSessionRecord;
|
|
116
|
+
items: SessionItem[];
|
|
117
|
+
}): void | Promise<void>;
|
|
118
|
+
/** Publish a fork already performed inside a live Provider TUI. Unlike
|
|
119
|
+
* `commit`, this has no caller-supplied idempotency operation because the
|
|
120
|
+
* Provider-created target Session id is itself the durable identity. */
|
|
121
|
+
publishNativeFork(input: {
|
|
122
|
+
sourceSessionId: string;
|
|
123
|
+
target: MachineSessionRecord;
|
|
124
|
+
items: SessionItem[];
|
|
125
|
+
}): void | Promise<void>;
|
|
126
|
+
markError(operationId: string, error: string): void | Promise<void>;
|
|
127
|
+
listReserved(): MachineSessionForkOperationRecord[] | Promise<MachineSessionForkOperationRecord[]>;
|
|
128
|
+
hasReservedSource(sessionId: string): boolean | Promise<boolean>;
|
|
129
|
+
markTargetDeleted(sessionId: string): void | Promise<void>;
|
|
130
|
+
}
|
|
95
131
|
export interface MachineSessionServicePorts {
|
|
96
132
|
registry: Pick<SessionRegistry, "create" | "get" | "list" | "setTitle" | "remove">;
|
|
97
133
|
log: Pick<SessionLogStore, "list" | "listSessions" | "snapshot" | "deleteSession">;
|
|
98
134
|
events: Pick<SessionBus, "subscribe"> & Partial<Pick<SessionBus, "close">>;
|
|
135
|
+
/** Canonical persistence + fan-out for user turns accepted before a native
|
|
136
|
+
* Terminal has finished starting. */
|
|
137
|
+
publishEvent?: (sessionId: string, event: SessionEvent) => void | Promise<void>;
|
|
99
138
|
runtimeState: MachineSessionRuntimeStatePort;
|
|
100
139
|
interruption: MachineSessionInterruptPort;
|
|
101
140
|
/** External Session-owned resources fenced before and finalized after deletion. */
|
|
@@ -111,9 +150,23 @@ export interface MachineSessionServicePorts {
|
|
|
111
150
|
/** Native Session execution belongs to the target daemon, never the caller. */
|
|
112
151
|
execution?: {
|
|
113
152
|
runtime: Pick<ConversationRuntime, "resolveRuntime">;
|
|
153
|
+
resolve(input: {
|
|
154
|
+
agent?: string;
|
|
155
|
+
provider?: SessionProviderId;
|
|
156
|
+
model?: string;
|
|
157
|
+
reasoningEffort?: ReasoningEffort;
|
|
158
|
+
cwd: string;
|
|
159
|
+
}): Promise<ResolvedExecutionSnapshot>;
|
|
114
160
|
runner: MachineSessionRunnerPort;
|
|
115
|
-
sessionStore?: Pick<CodexSessionStore, "get">;
|
|
116
161
|
};
|
|
162
|
+
/** Resolve a temporary Project selection, or create a Session-only fallback directory. */
|
|
163
|
+
workspace?: {
|
|
164
|
+
resolve(projectId?: string): Promise<SessionWorkspaceSnapshot>;
|
|
165
|
+
/** Remove an unbound Session-only allocation after creation fails. Project
|
|
166
|
+
* directories are never passed to this hook. */
|
|
167
|
+
discardUnbound?(workspace: SessionWorkspaceSnapshot): Promise<void>;
|
|
168
|
+
};
|
|
169
|
+
forks?: MachineSessionForkStorePort;
|
|
117
170
|
}
|
|
118
171
|
export interface MachineSessionServiceOptions {
|
|
119
172
|
/** Maximum summaries returned in one list page. */
|
|
@@ -148,6 +201,7 @@ interface MachineSessionCreateOptions {
|
|
|
148
201
|
model?: string;
|
|
149
202
|
reasoningEffort?: ReasoningEffort;
|
|
150
203
|
title?: string;
|
|
204
|
+
projectId?: string;
|
|
151
205
|
}
|
|
152
206
|
export type MachineSessionCreateInput = MachineSessionCreateOptions & ({
|
|
153
207
|
agent: string;
|
|
@@ -159,6 +213,20 @@ export type MachineSessionCreateInput = MachineSessionCreateOptions & ({
|
|
|
159
213
|
export interface MachineSessionCreateResult {
|
|
160
214
|
sessionId: string;
|
|
161
215
|
}
|
|
216
|
+
export interface MachineSessionForkInput {
|
|
217
|
+
sourceSessionId: string;
|
|
218
|
+
operationId: string;
|
|
219
|
+
title?: string;
|
|
220
|
+
}
|
|
221
|
+
export interface MachineSessionForkResult {
|
|
222
|
+
sessionId: string;
|
|
223
|
+
disposition: "created" | "replayed";
|
|
224
|
+
}
|
|
225
|
+
export interface MachineSessionNativeRotationInput {
|
|
226
|
+
sourceSessionId: string;
|
|
227
|
+
targetSessionId: string;
|
|
228
|
+
kind: "clear" | "fork";
|
|
229
|
+
}
|
|
162
230
|
export interface MachineSessionMessageResult {
|
|
163
231
|
ok: true;
|
|
164
232
|
injected: true;
|
|
@@ -211,6 +279,7 @@ export declare class MachineSessionService {
|
|
|
211
279
|
private readonly pendingMessageRetryMs;
|
|
212
280
|
private readonly pendingDeliveries;
|
|
213
281
|
private readonly cancelledPendingDeliveries;
|
|
282
|
+
private readonly forkTasks;
|
|
214
283
|
constructor(ports: MachineSessionServicePorts, options?: MachineSessionServiceOptions);
|
|
215
284
|
list(input?: MachineSessionListInput): Promise<MachineSessionListPage>;
|
|
216
285
|
snapshot(input: MachineSessionSnapshotInput): Promise<MachineSessionSnapshotPage>;
|
|
@@ -231,6 +300,16 @@ export declare class MachineSessionService {
|
|
|
231
300
|
launchOptions(): Promise<RemoteRuntimeSessionLaunchOptionsListResult>;
|
|
232
301
|
/** Create target-owned Session identity from one Agent preset or direct Provider. */
|
|
233
302
|
create(input: MachineSessionCreateInput): Promise<MachineSessionCreateResult>;
|
|
303
|
+
/** Create one independent Session at the source's stable Provider/canonical
|
|
304
|
+
* boundary. Project and Agent selectors are intentionally absent: the target
|
|
305
|
+
* receives exact copies of the source's already-frozen snapshots. */
|
|
306
|
+
fork(input: MachineSessionForkInput): Promise<MachineSessionForkResult>;
|
|
307
|
+
/** Publish a Provider TUI `/clear` or `/fork` after its native binding has
|
|
308
|
+
* already been persisted. The source snapshots remain the only workspace and
|
|
309
|
+
* execution authority; Provider events cannot alter them during rotation. */
|
|
310
|
+
recordNativeRotation(input: MachineSessionNativeRotationInput): Promise<void>;
|
|
311
|
+
private performFork;
|
|
312
|
+
private assertForkableSource;
|
|
234
313
|
/** Inject one turn through the target daemon's native single-writer runner. */
|
|
235
314
|
sendMessage(sessionIdInput: string, messageInput: string | MachineSessionMessageInput): Promise<MachineSessionMessageResult>;
|
|
236
315
|
resourcePolicy(sessionIdInput: string): RemoteRuntimeSessionResourcePolicyResult;
|
|
@@ -259,6 +338,10 @@ export declare class MachineSessionService {
|
|
|
259
338
|
private runtimeReadiness;
|
|
260
339
|
private probeRuntimeReadiness;
|
|
261
340
|
private requireExecution;
|
|
341
|
+
private requireWorkspace;
|
|
342
|
+
private requireForks;
|
|
343
|
+
private assertNotForkReserved;
|
|
344
|
+
private resumeReservedForks;
|
|
262
345
|
}
|
|
263
346
|
/** One-line title derived from the first user message; no model call. */
|
|
264
347
|
export declare function synthesizeSessionTitle(message: string, limit?: number): string;
|