@rynx-ai/server 0.1.11-beta.1 → 0.1.11-beta.3

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.
@@ -1,16 +1,15 @@
1
1
  import Router from "@koa/router";
2
- import { type AgentSpec, type AuthMaterial, type ConversationRuntime, type MachineSessionRecord, type AgentRuntimeId, type SessionBus, type SessionLogStore, type SkillInstallRecipe } from "@rynx-ai/core";
3
- import type { ControlChannel, ControlChannelType, ControlInstanceConfig, ControlAgentSummary, SkillSummary, SkillDetail } from "@rynx-ai/protocol/control";
2
+ import { type ConversationRuntime, type MachineSessionRecord, type ResolvedExecutionSnapshot, type SessionWorkspaceSnapshot, type SessionBus, type SessionLogStore, type SkillInstallRecipe } from "@rynx-ai/core";
3
+ import type { ControlAgentSummary, SkillSummary, SkillDetail } from "@rynx-ai/protocol/control";
4
4
  import type { SessionInteractionResolution } from "@rynx-ai/protocol";
5
5
  import { type RemoteRuntimeRpcParams, type RemoteRuntimeRpcResultFor } from "@rynx-ai/protocol/remote-runtime-rpc";
6
- import type { CodexSessionStore, InjectOutcome } from "@rynx-ai/runtime";
7
- import type { ChannelManager } from "./channel-manager.js";
8
6
  import type { DaemonManagementHost, RemoteRuntimeAdminHost, RuntimeTargetControlHost, RuntimeConnectionResolverHost, RuntimeLocalBrowserAutomationHost } from "./server.js";
9
7
  import type { ProviderCliManagementHost } from "./provider-cli-host.js";
10
8
  import { type DaemonRuntimeHost } from "./remote-runtime.js";
11
9
  import { SessionRuntimeIndex } from "./session-runtime-index.js";
12
10
  import type { SessionEmulatorService } from "./session-emulator-service.js";
13
11
  import { type RuntimeWebAccessPolicy } from "./runtime-web-auth.js";
12
+ import type { MachineSessionService } from "./machine-session-service.js";
14
13
  export interface ControlEmulatorDeps {
15
14
  doctor(): Promise<unknown>;
16
15
  devices(): Promise<unknown[]>;
@@ -113,37 +112,6 @@ export interface ControlEmulatorDeps {
113
112
  }): Promise<unknown>;
114
113
  }
115
114
  export interface ControlPlaneDeps {
116
- listChannelTypes(): ControlChannelType[];
117
- listChannels(): ControlChannel[];
118
- createChannel(input: {
119
- name: string;
120
- type: string;
121
- options?: Record<string, unknown>;
122
- }): {
123
- id: string;
124
- };
125
- setChannel(id: string, patch: {
126
- name?: string;
127
- options?: Record<string, unknown>;
128
- }): void;
129
- removeChannel(id: string): void;
130
- /** Run a channel type's authorize flow; resolves with the options to persist. */
131
- authorizeChannel(type: string, context: {
132
- instanceId?: string;
133
- config: Record<string, unknown>;
134
- }, emit: (material: AuthMaterial) => void, signal: AbortSignal): Promise<Record<string, unknown>>;
135
- listInstancesConfig(): ControlInstanceConfig[];
136
- createInstance(input: {
137
- channelId: string;
138
- agent?: string;
139
- }): {
140
- id: string;
141
- };
142
- setInstance(id: string, patch: {
143
- agent?: string;
144
- enabled?: boolean;
145
- }): void;
146
- removeInstance(id: string): void;
147
115
  listAgents(): Promise<ControlAgentSummary[]>;
148
116
  getAgent(name: string): Promise<unknown | null>;
149
117
  /** Validate + persist an agent spec; throws on a schema violation (→ 400). */
@@ -198,7 +166,6 @@ export interface LocalSessionResourceHost {
198
166
  deleteResource(input: RemoteRuntimeRpcParams<"session.resource.delete">): Promise<RemoteRuntimeRpcResultFor<"session.resource.delete">>;
199
167
  }
200
168
  export declare function createControlRouter(opts: {
201
- manager: ChannelManager;
202
169
  deps: ControlPlaneDeps;
203
170
  /** Present ⇒ the control plane can run agent sessions (see `/api/sessions`). */
204
171
  runtime?: ConversationRuntime;
@@ -208,30 +175,19 @@ export declare function createControlRouter(opts: {
208
175
  * and (codex-native live mode) bring up + inject into a session's forwarder. */
209
176
  runnerManager?: {
210
177
  stopRunner(localThreadId: string): void;
211
- ensureLiveSession?(localThreadId: string, opts?: {
212
- cwd?: string;
213
- cols?: number;
214
- rows?: number;
215
- runtime?: AgentRuntimeId;
216
- agentName?: string;
217
- agentSpec?: AgentSpec;
178
+ interruptLiveSession?(localThreadId: string): Promise<boolean>;
179
+ ensureLiveSession?(localThreadId: string, opts: {
180
+ workspace: SessionWorkspaceSnapshot;
181
+ execution: ResolvedExecutionSnapshot;
218
182
  }): Promise<boolean>;
219
183
  lastLiveSessionError?(localThreadId: string): string | undefined;
220
- injectMessage?(localThreadId: string, text: string): Promise<InjectOutcome>;
221
- interruptLiveSession?(localThreadId: string): Promise<boolean>;
184
+ injectMessage?(localThreadId: string, text: string): Promise<"injected" | "notLive" | "notReady" | "failed">;
222
185
  resolveInteraction?(localThreadId: string, interactionId: string, resolution: SessionInteractionResolution): Promise<{
223
186
  disposition: "applied" | "already_resolved" | "not_found" | "invalid";
224
187
  }>;
225
188
  };
226
- /** Global codex/claude session store. Lets the control plane resume a
227
- * non-console session on its original runtime/model/cwd binding. */
228
- sessionStore?: CodexSessionStore;
229
189
  /** Trusted, cached plugin supervisor health. No plugin RPC is awaited here. */
230
190
  pluginRuntimeStatus?: () => unknown;
231
- /** Local-host-only runtime refresh used by the core CLI after a plugin command. */
232
- pluginRuntimeReload?: (pluginId: string) => Promise<unknown>;
233
- /** Idempotent local-host-only readiness check for an unchanged plugin runtime. */
234
- pluginRuntimeEnsure?: (pluginId: string) => Promise<unknown>;
235
191
  /** Complete local authority; its token is published only in the mode-0600 endpoint file. */
236
192
  daemonManagement?: DaemonManagementHost;
237
193
  /** Runtime application port shared by future Local and Direct bindings. */
@@ -246,6 +202,8 @@ export declare function createControlRouter(opts: {
246
202
  runtimeConnectionResolver?: RuntimeConnectionResolverHost;
247
203
  /** Same-daemon resource authority for the `local` selector. */
248
204
  localSessionResources?: LocalSessionResourceHost;
205
+ /** Canonical same-daemon Session service used by legacy Local API aliases. */
206
+ localMachineSessions?: MachineSessionService;
249
207
  sessionEmulators?: SessionEmulatorService;
250
208
  /** Ends host-owned long-lived HTTP responses before the server drains. */
251
209
  shutdownSignal?: AbortSignal;