@rynx-ai/server 0.1.0 → 0.1.9

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 (63) 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 +14 -0
  4. package/dist/browser-surface-ws.js +355 -0
  5. package/dist/control-api.d.ts +59 -4
  6. package/dist/control-api.js +2213 -132
  7. package/dist/control-web/assets/highlighted-body-OFNGDK62-e-w61YLy.js +1 -0
  8. package/dist/control-web/assets/index-BQ7XVBKO.css +32 -0
  9. package/dist/control-web/assets/index-ClpzuBJx.js +606 -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-DZn7Hbr2.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 +153 -0
  30. package/dist/desktop-browser-host.js +936 -0
  31. package/dist/direct-runtime-browser-surface-server.d.ts +74 -0
  32. package/dist/direct-runtime-browser-surface-server.js +821 -0
  33. package/dist/direct-runtime-server.d.ts +137 -0
  34. package/dist/direct-runtime-server.js +1931 -0
  35. package/dist/emulator-surface-ws.d.ts +6 -0
  36. package/dist/emulator-surface-ws.js +197 -0
  37. package/dist/machine-session-service.d.ts +182 -0
  38. package/dist/machine-session-service.js +559 -0
  39. package/dist/provider-cli-host.d.ts +10 -0
  40. package/dist/provider-cli-host.js +1 -0
  41. package/dist/remote-runtime-dispatcher.d.ts +94 -0
  42. package/dist/remote-runtime-dispatcher.js +380 -0
  43. package/dist/remote-runtime-session-projection.d.ts +19 -0
  44. package/dist/remote-runtime-session-projection.js +556 -0
  45. package/dist/remote-runtime.d.ts +22 -0
  46. package/dist/remote-runtime.js +32 -0
  47. package/dist/runtime-web-auth.d.ts +21 -0
  48. package/dist/runtime-web-auth.js +92 -0
  49. package/dist/server.d.ts +292 -10
  50. package/dist/server.js +314 -98
  51. package/dist/session-browser-service.d.ts +218 -0
  52. package/dist/session-browser-service.js +686 -0
  53. package/dist/session-browser-surface-coordinator.d.ts +23 -0
  54. package/dist/session-browser-surface-coordinator.js +563 -0
  55. package/dist/session-emulator-service.d.ts +167 -0
  56. package/dist/session-emulator-service.js +464 -0
  57. package/dist/session-runtime-index.d.ts +17 -0
  58. package/dist/session-runtime-index.js +86 -0
  59. package/dist/session-terminal-host.d.ts +46 -0
  60. package/dist/session-terminal-host.js +252 -0
  61. package/dist/terminal-ws.d.ts +9 -20
  62. package/dist/terminal-ws.js +420 -97
  63. package/package.json +9 -7
@@ -1,8 +1,14 @@
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";
4
5
  import type { CodexSessionStore, InjectOutcome } from "@rynx-ai/runtime";
5
6
  import type { ChannelManager } from "./channel-manager.js";
7
+ import type { DaemonManagementHost, RemoteRuntimeAdminHost, RuntimeTargetControlHost, RuntimeConnectionResolverHost, RuntimeLocalBrowserAutomationHost } from "./server.js";
8
+ import type { ProviderCliManagementHost } from "./provider-cli-host.js";
9
+ import { type DaemonRuntimeHost } from "./remote-runtime.js";
10
+ import { SessionRuntimeIndex } from "./session-runtime-index.js";
11
+ import type { SessionEmulatorService } from "./session-emulator-service.js";
6
12
  export interface ControlEmulatorDeps {
7
13
  doctor(): Promise<unknown>;
8
14
  devices(): Promise<unknown[]>;
@@ -67,6 +73,7 @@ export interface ControlEmulatorDeps {
67
73
  }>;
68
74
  liveTouch?(input: {
69
75
  device?: string;
76
+ signal?: AbortSignal;
70
77
  }): Promise<{
71
78
  ok: true;
72
79
  backend: "ios" | "android";
@@ -78,6 +85,17 @@ export interface ControlEmulatorDeps {
78
85
  }): void;
79
86
  close(): void;
80
87
  }>;
88
+ imageStream?(input: {
89
+ device?: string;
90
+ signal?: AbortSignal;
91
+ }): Promise<{
92
+ ok: true;
93
+ backend: "ios" | "android";
94
+ device: string;
95
+ contentType: "image/jpeg";
96
+ nextFrame(): Promise<Buffer>;
97
+ close(): void;
98
+ }>;
81
99
  readScreenshotFile?(input: {
82
100
  file: string;
83
101
  }): Promise<{
@@ -108,7 +126,10 @@ export interface ControlPlaneDeps {
108
126
  }): void;
109
127
  removeChannel(id: string): void;
110
128
  /** 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>>;
129
+ authorizeChannel(type: string, context: {
130
+ instanceId?: string;
131
+ config: Record<string, unknown>;
132
+ }, emit: (material: AuthMaterial) => void, signal: AbortSignal): Promise<Record<string, unknown>>;
112
133
  listInstancesConfig(): ControlInstanceConfig[];
113
134
  createInstance(input: {
114
135
  channelId: string;
@@ -150,11 +171,19 @@ export interface ControlPlaneDeps {
150
171
  createSessionMeta(meta: StoredSessionMeta): void;
151
172
  setSessionTitle(id: string, title: string): void;
152
173
  removeSessionMeta(id: string): void;
174
+ consumeControlLink?(token: string): {
175
+ sessionId: string;
176
+ } | null;
153
177
  }
154
178
  /** Persisted meta for an agent session — the unified machine-session record.
155
179
  * Runtime `status` is held separately by the server (idle after a restart);
156
180
  * transcripts persist via {@link SessionLogStore}. */
157
181
  export type StoredSessionMeta = MachineSessionRecord;
182
+ /** Session-owned resource fence shared by canonical and legacy local deletion paths. */
183
+ export interface SessionResourceLifecycle {
184
+ beforeDelete?(sessionId: string): void | Promise<void>;
185
+ afterDelete?(sessionId: string): void | Promise<void>;
186
+ }
158
187
  export declare function createControlRouter(opts: {
159
188
  manager: ChannelManager;
160
189
  deps: ControlPlaneDeps;
@@ -162,11 +191,10 @@ export declare function createControlRouter(opts: {
162
191
  runtime?: ConversationRuntime;
163
192
  sessionBus?: SessionBus;
164
193
  sessionLog?: SessionLogStore;
165
- /** Used to stop a session's runner on close, resolve interactive approvals,
194
+ /** Used to stop a session's runner on close, resolve active interactions,
166
195
  * and (codex-native live mode) bring up + inject into a session's forwarder. */
167
196
  runnerManager?: {
168
197
  stopRunner(localThreadId: string): void;
169
- resolveApproval?(localThreadId: string, approvalId: string, decision: "acceptForSession" | "accept" | "decline" | "cancel"): void;
170
198
  ensureLiveSession?(localThreadId: string, opts?: {
171
199
  cwd?: string;
172
200
  cols?: number;
@@ -175,14 +203,41 @@ export declare function createControlRouter(opts: {
175
203
  agentName?: string;
176
204
  agentSpec?: AgentSpec;
177
205
  }): Promise<boolean>;
206
+ lastLiveSessionError?(localThreadId: string): string | undefined;
178
207
  injectMessage?(localThreadId: string, text: string): Promise<InjectOutcome>;
179
208
  interruptLiveSession?(localThreadId: string): Promise<boolean>;
209
+ resolveInteraction?(localThreadId: string, interactionId: string, resolution: SessionInteractionResolution): Promise<{
210
+ disposition: "applied" | "already_resolved" | "not_found" | "invalid";
211
+ }>;
180
212
  };
181
213
  /** Global codex/claude session store. Lets the control plane resume a
182
214
  * non-console session on its original runtime/model/cwd binding. */
183
215
  sessionStore?: CodexSessionStore;
216
+ /** Trusted, cached plugin supervisor health. No plugin RPC is awaited here. */
217
+ pluginRuntimeStatus?: () => unknown;
218
+ /** Local-host-only runtime refresh used by the core CLI after a plugin command. */
219
+ pluginRuntimeReload?: (pluginId: string) => Promise<unknown>;
220
+ /** Idempotent local-host-only readiness check for an unchanged plugin runtime. */
221
+ pluginRuntimeEnsure?: (pluginId: string) => Promise<unknown>;
222
+ /** Complete local authority; its token is published only in the mode-0600 endpoint file. */
223
+ daemonManagement?: DaemonManagementHost;
224
+ /** Runtime application port shared by future Local and Direct bindings. */
225
+ remoteRuntime?: DaemonRuntimeHost;
226
+ /** Loopback-only pairing/client-grant administration. */
227
+ remoteRuntimeAdmin?: RemoteRuntimeAdminHost;
228
+ /** Local BFF authority for Local and explicitly paired Direct Runtime targets. */
229
+ runtimeTargetControl?: RuntimeTargetControlHost;
230
+ /** Resolves an explicit Runtime selector without exposing Direct credentials. */
231
+ runtimeConnectionResolver?: RuntimeConnectionResolverHost;
232
+ sessionEmulators?: SessionEmulatorService;
233
+ /** Ends host-owned long-lived HTTP responses before the server drains. */
234
+ shutdownSignal?: AbortSignal;
235
+ sessionRuntimeIndex?: SessionRuntimeIndex;
236
+ sessionLifecycle?: SessionResourceLifecycle;
237
+ runtimeLocalBrowser?: RuntimeLocalBrowserAutomationHost;
238
+ providerClis?: ProviderCliManagementHost;
184
239
  }): Router;
185
240
  /** Derive a one-line session title from the first user message: collapse
186
- * whitespace, trim, and truncate to `limit` chars + an ellipsis (omnigent's
241
+ * whitespace, trim, and truncate to `limit` chars + an ellipsis (reference implementation's
187
242
  * rule — no LLM call). */
188
243
  export declare function synthesizeSessionTitle(message: string, limit?: number): string;