@rynx-ai/runtime 0.1.11-beta.33 → 0.1.11-beta.35

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 (36) hide show
  1. package/dist/claude/native-bridge.d.ts +16 -1
  2. package/dist/claude/native-bridge.js +91 -17
  3. package/dist/claude/native-hook-main.js +1 -0
  4. package/dist/claude/native-integration.d.ts +10 -0
  5. package/dist/claude/native-integration.js +100 -6
  6. package/dist/codex-app-server/forwarder.js +23 -1
  7. package/dist/codex-app-server/mapping.js +34 -10
  8. package/dist/codex-app-server/process-registry.d.ts +36 -0
  9. package/dist/codex-app-server/process-registry.js +320 -0
  10. package/dist/codex-app-server/ws-channel.d.ts +7 -0
  11. package/dist/codex-app-server/ws-channel.js +85 -9
  12. package/dist/codex-home.d.ts +35 -3
  13. package/dist/codex-home.js +321 -14
  14. package/dist/host.d.ts +11 -25
  15. package/dist/host.js +147 -132
  16. package/dist/index.d.ts +2 -2
  17. package/dist/index.js +1 -1
  18. package/dist/runner/child.d.ts +25 -3
  19. package/dist/runner/child.js +359 -64
  20. package/dist/runner/manager.d.ts +33 -18
  21. package/dist/runner/manager.js +229 -49
  22. package/dist/runner/protocol.d.ts +79 -7
  23. package/dist/runner/transport.d.ts +9 -2
  24. package/dist/runner/transport.js +55 -3
  25. package/dist/runner-main.js +8 -3
  26. package/dist/terminal/codex-tui.d.ts +4 -0
  27. package/dist/terminal/codex-tui.js +5 -0
  28. package/dist/terminal/control-parser.d.ts +39 -0
  29. package/dist/terminal/control-parser.js +172 -0
  30. package/dist/terminal/registry.d.ts +18 -15
  31. package/dist/terminal/registry.js +43 -23
  32. package/dist/terminal/spool.d.ts +47 -0
  33. package/dist/terminal/spool.js +231 -0
  34. package/dist/terminal/tmux.d.ts +93 -84
  35. package/dist/terminal/tmux.js +675 -200
  36. package/package.json +3 -4
@@ -1,5 +1,6 @@
1
1
  import { type AgentCapabilities, type LiveSessionFailure, type ResolvedExecutionSnapshot, type RuntimeTurnOptions, type RuntimeUserInput, type SessionCollaborationMode, type SessionInteractionResolution, type SessionWorkspaceSnapshot } from "@rynx-ai/core";
2
2
  import type { SessionEvent } from "@rynx-ai/core";
3
+ import { type TerminalLifecycle } from "../terminal/registry.js";
3
4
  import type { TerminalInjector } from "../claude/native-integration.js";
4
5
  import type { ResolveInteractionResult } from "../interactions.js";
5
6
  import { type InjectResult } from "./protocol.js";
@@ -23,6 +24,11 @@ interface LiveCodexProvider {
23
24
  cwd: string;
24
25
  env?: Record<string, string>;
25
26
  skipTraexStartupPrompts?: boolean;
27
+ scrollback?: number;
28
+ tmuxAllowPassthrough?: boolean;
29
+ tmuxStartOnAttach?: boolean;
30
+ keepAliveAfterExit?: boolean;
31
+ lifecycle: TerminalLifecycle;
26
32
  } | null>;
27
33
  ensureLiveCodexSession?(localThreadId: string, emit: (event: SessionEvent) => void, opts: {
28
34
  workspace: SessionWorkspaceSnapshot;
@@ -45,13 +51,16 @@ interface LiveCodexProvider {
45
51
  * observer/forwarder, and evict the owned app-server while preserving the
46
52
  * durable native-session binding for a later cold resume. */
47
53
  teardownLiveCodexSession?(localThreadId: string, error?: Error): boolean;
54
+ /** Cleanup coupled runtime resources after an auxiliary terminal is
55
+ * intentionally idle-reaped. Unexpected auxiliary exit does not call this. */
56
+ teardownAuxiliaryTerminalRuntime?(localThreadId: string): Promise<void>;
48
57
  injectMessage?(localThreadId: string, input: RuntimeUserInput | string, options?: RuntimeTurnOptions): Promise<InjectResult>;
49
58
  updateCollaborationMode?(localThreadId: string, mode: SessionCollaborationMode): Promise<void>;
50
59
  interruptLive?(localThreadId: string): Promise<boolean>;
51
60
  stopLiveCodexSession?(localThreadId: string, opts?: {
52
61
  deferClaudeInteractionCleanup?: boolean;
53
62
  }): void;
54
- finalizeStoppedLiveSessions?(): void;
63
+ finalizeStoppedLiveSessions?(): void | Promise<void>;
55
64
  resolveInteraction?(localThreadId: string, interactionId: string, resolution: SessionInteractionResolution): Promise<ResolveInteractionResult>;
56
65
  /** Hand the session's tmux pane injector to the host (which doesn't own
57
66
  * tmux). Claude uses it for messages; Codex uses it only for TUI-local
@@ -77,10 +86,13 @@ export declare class RunnerSession {
77
86
  private readonly onShutdown;
78
87
  /** Live terminals hosted by this session, and per-attach client handles. */
79
88
  private readonly terminals;
89
+ private readonly preparations;
80
90
  private readonly attachments;
81
91
  private readonly attachmentThreadIds;
92
+ private readonly attachmentRoles;
82
93
  private readonly traexStartupWatchers;
83
94
  private readonly traexStartupGates;
95
+ private readonly codexStartupMonitors;
84
96
  private readonly terminalWatchers;
85
97
  /** Opens are async; a close received before attach resolves tombstones the id. */
86
98
  private readonly pendingTerminalOpens;
@@ -91,7 +103,9 @@ export declare class RunnerSession {
91
103
  private readonly mirrorImageAcks;
92
104
  /** Provider name retained for asynchronous Terminal-exit diagnostics. */
93
105
  private readonly liveRuntimes;
106
+ private readonly terminalStatuses;
94
107
  private shuttingDown;
108
+ private shutdownPromise;
95
109
  constructor({ transport, executor, onShutdown }: RunnerSessionDeps);
96
110
  private handle;
97
111
  private get liveProvider();
@@ -102,6 +116,7 @@ export declare class RunnerSession {
102
116
  * new session AND tells the daemon to alias the runner (terminal transfer) so
103
117
  * the new session stays injectable. */
104
118
  private mirrorChannel;
119
+ private transferNativeSessionResources;
105
120
  private enqueueMirror;
106
121
  private sendMirroredEvent;
107
122
  private sendMirrorImageFrame;
@@ -122,6 +137,7 @@ export declare class RunnerSession {
122
137
  private inject;
123
138
  private updateCollaborationMode;
124
139
  private interruptLive;
140
+ private reapTerminal;
125
141
  /** Launch (idempotently) the session's codex TUI pane from the executor's
126
142
  * `codexTerminalSpec`. Shares the `${id}-main` terminal id with `term.open`,
127
143
  * so the web attach reuses the same detached pane. */
@@ -132,10 +148,16 @@ export declare class RunnerSession {
132
148
  private stopLive;
133
149
  /** Stop event forwarding, kill native terminals/hooks, then synchronously
134
150
  * scrub provider handoff files before the child process is allowed to exit. */
135
- shutdown(): void;
151
+ shutdown(): Promise<void>;
136
152
  private openTerminal;
137
- /** Attach an already-created terminal and forward its data/exit to the parent. */
153
+ /** Prepare captured history without starting the live control client. */
138
154
  private attachExisting;
155
+ private readTerminalSeed;
156
+ private startTerminal;
157
+ private readTerminalOutput;
158
+ private writeTerminalInput;
159
+ private resizeTerminal;
160
+ private sendTerminalOperationError;
139
161
  private runCap;
140
162
  private dispatchCap;
141
163
  }