@rynx-ai/server 0.1.0 → 0.1.10-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.
Files changed (65) hide show
  1. package/dist/browser-surface-control-queue.d.ts +42 -0
  2. package/dist/browser-surface-control-queue.js +187 -0
  3. package/dist/browser-surface-ws.d.ts +16 -0
  4. package/dist/browser-surface-ws.js +356 -0
  5. package/dist/control-api.d.ts +76 -4
  6. package/dist/control-api.js +3014 -133
  7. package/dist/control-web/assets/highlighted-body-OFNGDK62-DHu2g-rk.js +1 -0
  8. package/dist/control-web/assets/index-B6Pb5j9M.js +666 -0
  9. package/dist/control-web/assets/index-BU-_Qud_.css +32 -0
  10. package/dist/control-web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  11. package/dist/control-web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  12. package/dist/control-web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  13. package/dist/control-web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  14. package/dist/control-web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  15. package/dist/control-web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  16. package/dist/control-web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  17. package/dist/control-web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  18. package/dist/control-web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  19. package/dist/control-web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  20. package/dist/control-web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  21. package/dist/control-web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  22. package/dist/control-web/assets/mermaid-GHXKKRXX-CSYzOmBR.js +131 -0
  23. package/dist/control-web/assets/rynx-wordmark-LL1QRYHD.png +0 -0
  24. package/dist/control-web/favicon.png +0 -0
  25. package/dist/control-web/favicon.svg +38 -0
  26. package/dist/control-web/index.html +16 -0
  27. package/dist/control-web-dist.d.ts +1 -1
  28. package/dist/control-web-dist.js +19 -14
  29. package/dist/desktop-browser-host.d.ts +170 -0
  30. package/dist/desktop-browser-host.js +1018 -0
  31. package/dist/direct-runtime-browser-inspect-server.d.ts +72 -0
  32. package/dist/direct-runtime-browser-inspect-server.js +749 -0
  33. package/dist/direct-runtime-browser-surface-server.d.ts +74 -0
  34. package/dist/direct-runtime-browser-surface-server.js +821 -0
  35. package/dist/direct-runtime-server.d.ts +143 -0
  36. package/dist/direct-runtime-server.js +1959 -0
  37. package/dist/emulator-surface-ws.d.ts +8 -0
  38. package/dist/emulator-surface-ws.js +198 -0
  39. package/dist/machine-session-service.d.ts +265 -0
  40. package/dist/machine-session-service.js +822 -0
  41. package/dist/provider-cli-host.d.ts +10 -0
  42. package/dist/provider-cli-host.js +1 -0
  43. package/dist/remote-runtime-dispatcher.d.ts +94 -0
  44. package/dist/remote-runtime-dispatcher.js +403 -0
  45. package/dist/remote-runtime-session-projection.d.ts +19 -0
  46. package/dist/remote-runtime-session-projection.js +566 -0
  47. package/dist/remote-runtime.d.ts +22 -0
  48. package/dist/remote-runtime.js +32 -0
  49. package/dist/runtime-web-auth.d.ts +26 -0
  50. package/dist/runtime-web-auth.js +132 -0
  51. package/dist/server.d.ts +364 -12
  52. package/dist/server.js +341 -100
  53. package/dist/session-browser-service.d.ts +248 -0
  54. package/dist/session-browser-service.js +772 -0
  55. package/dist/session-browser-surface-coordinator.d.ts +24 -0
  56. package/dist/session-browser-surface-coordinator.js +669 -0
  57. package/dist/session-emulator-service.d.ts +167 -0
  58. package/dist/session-emulator-service.js +464 -0
  59. package/dist/session-runtime-index.d.ts +23 -0
  60. package/dist/session-runtime-index.js +96 -0
  61. package/dist/session-terminal-host.d.ts +51 -0
  62. package/dist/session-terminal-host.js +270 -0
  63. package/dist/terminal-ws.d.ts +12 -20
  64. package/dist/terminal-ws.js +421 -97
  65. package/package.json +14 -7
@@ -1,8 +1,16 @@
1
1
  import Router from "@koa/router";
2
2
  import { type AgentSpec, type AuthMaterial, type ConversationRuntime, type MachineSessionRecord, type AgentRuntimeId, type SessionBus, type SessionLogStore, type SkillInstallRecipe } from "@rynx-ai/core";
3
3
  import type { ControlChannel, ControlChannelType, ControlInstanceConfig, ControlAgentSummary, SkillSummary, SkillDetail } from "@rynx-ai/protocol/control";
4
+ import type { SessionInteractionResolution } from "@rynx-ai/protocol";
5
+ import { type RemoteRuntimeRpcParams, type RemoteRuntimeRpcResultFor } from "@rynx-ai/protocol/remote-runtime-rpc";
4
6
  import type { CodexSessionStore, InjectOutcome } from "@rynx-ai/runtime";
5
7
  import type { ChannelManager } from "./channel-manager.js";
8
+ import type { DaemonManagementHost, RemoteRuntimeAdminHost, RuntimeTargetControlHost, RuntimeConnectionResolverHost, RuntimeLocalBrowserAutomationHost } from "./server.js";
9
+ import type { ProviderCliManagementHost } from "./provider-cli-host.js";
10
+ import { type DaemonRuntimeHost } from "./remote-runtime.js";
11
+ import { SessionRuntimeIndex } from "./session-runtime-index.js";
12
+ import type { SessionEmulatorService } from "./session-emulator-service.js";
13
+ import { type RuntimeWebAccessPolicy } from "./runtime-web-auth.js";
6
14
  export interface ControlEmulatorDeps {
7
15
  doctor(): Promise<unknown>;
8
16
  devices(): Promise<unknown[]>;
@@ -67,6 +75,7 @@ export interface ControlEmulatorDeps {
67
75
  }>;
68
76
  liveTouch?(input: {
69
77
  device?: string;
78
+ signal?: AbortSignal;
70
79
  }): Promise<{
71
80
  ok: true;
72
81
  backend: "ios" | "android";
@@ -78,6 +87,17 @@ export interface ControlEmulatorDeps {
78
87
  }): void;
79
88
  close(): void;
80
89
  }>;
90
+ imageStream?(input: {
91
+ device?: string;
92
+ signal?: AbortSignal;
93
+ }): Promise<{
94
+ ok: true;
95
+ backend: "ios" | "android";
96
+ device: string;
97
+ contentType: "image/jpeg";
98
+ nextFrame(): Promise<Buffer>;
99
+ close(): void;
100
+ }>;
81
101
  readScreenshotFile?(input: {
82
102
  file: string;
83
103
  }): Promise<{
@@ -108,7 +128,10 @@ export interface ControlPlaneDeps {
108
128
  }): void;
109
129
  removeChannel(id: string): void;
110
130
  /** Run a channel type's authorize flow; resolves with the options to persist. */
111
- authorizeChannel(type: string, emit: (material: AuthMaterial) => void, signal: AbortSignal): Promise<Record<string, unknown>>;
131
+ authorizeChannel(type: string, context: {
132
+ instanceId?: string;
133
+ config: Record<string, unknown>;
134
+ }, emit: (material: AuthMaterial) => void, signal: AbortSignal): Promise<Record<string, unknown>>;
112
135
  listInstancesConfig(): ControlInstanceConfig[];
113
136
  createInstance(input: {
114
137
  channelId: string;
@@ -150,11 +173,30 @@ export interface ControlPlaneDeps {
150
173
  createSessionMeta(meta: StoredSessionMeta): void;
151
174
  setSessionTitle(id: string, title: string): void;
152
175
  removeSessionMeta(id: string): void;
176
+ consumeControlLink?(token: string): {
177
+ sessionId: string;
178
+ } | null;
153
179
  }
154
180
  /** Persisted meta for an agent session — the unified machine-session record.
155
181
  * Runtime `status` is held separately by the server (idle after a restart);
156
182
  * transcripts persist via {@link SessionLogStore}. */
157
183
  export type StoredSessionMeta = MachineSessionRecord;
184
+ /** Session-owned resource fence shared by canonical and legacy local deletion paths. */
185
+ export interface SessionResourceLifecycle {
186
+ beforeDelete?(sessionId: string): void | Promise<void>;
187
+ afterDelete?(sessionId: string): void | Promise<void>;
188
+ }
189
+ /** In-process Local Runtime resource authority. Direct targets continue through
190
+ * the bounded Remote Runtime RPC transport; Local avoids serial base64 frames. */
191
+ export interface LocalSessionResourceHost {
192
+ resourcePolicy(sessionId: string): Promise<RemoteRuntimeRpcResultFor<"session.resource.policy.get">> | RemoteRuntimeRpcResultFor<"session.resource.policy.get">;
193
+ beginResourceUpload(input: RemoteRuntimeRpcParams<"session.resource.upload.begin">): Promise<RemoteRuntimeRpcResultFor<"session.resource.upload.begin">>;
194
+ writeResourceUploadChunk(input: RemoteRuntimeRpcParams<"session.resource.upload.chunk">): Promise<RemoteRuntimeRpcResultFor<"session.resource.upload.chunk">>;
195
+ commitResourceUpload(input: RemoteRuntimeRpcParams<"session.resource.upload.commit">): Promise<RemoteRuntimeRpcResultFor<"session.resource.upload.commit">>;
196
+ getResource(input: RemoteRuntimeRpcParams<"session.resource.get">): Promise<RemoteRuntimeRpcResultFor<"session.resource.get">>;
197
+ readResource(input: RemoteRuntimeRpcParams<"session.resource.read">): Promise<RemoteRuntimeRpcResultFor<"session.resource.read">>;
198
+ deleteResource(input: RemoteRuntimeRpcParams<"session.resource.delete">): Promise<RemoteRuntimeRpcResultFor<"session.resource.delete">>;
199
+ }
158
200
  export declare function createControlRouter(opts: {
159
201
  manager: ChannelManager;
160
202
  deps: ControlPlaneDeps;
@@ -162,11 +204,10 @@ export declare function createControlRouter(opts: {
162
204
  runtime?: ConversationRuntime;
163
205
  sessionBus?: SessionBus;
164
206
  sessionLog?: SessionLogStore;
165
- /** Used to stop a session's runner on close, resolve interactive approvals,
207
+ /** Used to stop a session's runner on close, resolve active interactions,
166
208
  * and (codex-native live mode) bring up + inject into a session's forwarder. */
167
209
  runnerManager?: {
168
210
  stopRunner(localThreadId: string): void;
169
- resolveApproval?(localThreadId: string, approvalId: string, decision: "acceptForSession" | "accept" | "decline" | "cancel"): void;
170
211
  ensureLiveSession?(localThreadId: string, opts?: {
171
212
  cwd?: string;
172
213
  cols?: number;
@@ -175,14 +216,45 @@ export declare function createControlRouter(opts: {
175
216
  agentName?: string;
176
217
  agentSpec?: AgentSpec;
177
218
  }): Promise<boolean>;
219
+ lastLiveSessionError?(localThreadId: string): string | undefined;
178
220
  injectMessage?(localThreadId: string, text: string): Promise<InjectOutcome>;
179
221
  interruptLiveSession?(localThreadId: string): Promise<boolean>;
222
+ resolveInteraction?(localThreadId: string, interactionId: string, resolution: SessionInteractionResolution): Promise<{
223
+ disposition: "applied" | "already_resolved" | "not_found" | "invalid";
224
+ }>;
180
225
  };
181
226
  /** Global codex/claude session store. Lets the control plane resume a
182
227
  * non-console session on its original runtime/model/cwd binding. */
183
228
  sessionStore?: CodexSessionStore;
229
+ /** Trusted, cached plugin supervisor health. No plugin RPC is awaited here. */
230
+ 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
+ /** Complete local authority; its token is published only in the mode-0600 endpoint file. */
236
+ daemonManagement?: DaemonManagementHost;
237
+ /** Runtime application port shared by future Local and Direct bindings. */
238
+ remoteRuntime?: DaemonRuntimeHost;
239
+ /** Loopback-only pairing/client-grant administration. */
240
+ remoteRuntimeAdmin?: RemoteRuntimeAdminHost;
241
+ /** Local BFF authority for Local and explicitly paired Direct Runtime targets. */
242
+ runtimeTargetControl?: RuntimeTargetControlHost;
243
+ /** Browser-facing access boundary. Internal daemon management remains loopback-only. */
244
+ runtimeWebAccess?: RuntimeWebAccessPolicy;
245
+ /** Resolves an explicit Runtime selector without exposing Direct credentials. */
246
+ runtimeConnectionResolver?: RuntimeConnectionResolverHost;
247
+ /** Same-daemon resource authority for the `local` selector. */
248
+ localSessionResources?: LocalSessionResourceHost;
249
+ sessionEmulators?: SessionEmulatorService;
250
+ /** Ends host-owned long-lived HTTP responses before the server drains. */
251
+ shutdownSignal?: AbortSignal;
252
+ sessionRuntimeIndex?: SessionRuntimeIndex;
253
+ sessionLifecycle?: SessionResourceLifecycle;
254
+ runtimeLocalBrowser?: RuntimeLocalBrowserAutomationHost;
255
+ providerClis?: ProviderCliManagementHost;
184
256
  }): Router;
185
257
  /** Derive a one-line session title from the first user message: collapse
186
- * whitespace, trim, and truncate to `limit` chars + an ellipsis (omnigent's
258
+ * whitespace, trim, and truncate to `limit` chars + an ellipsis (reference implementation's
187
259
  * rule — no LLM call). */
188
260
  export declare function synthesizeSessionTitle(message: string, limit?: number): string;