@myagentroam/node 0.9.9 → 0.9.11

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 (214) hide show
  1. package/dist/capabilities.js +2 -92
  2. package/dist/claude-agent-sdk.js +2 -330
  3. package/dist/claude-channel.js +2 -44
  4. package/dist/codex-app-server.js +2 -503
  5. package/dist/config.js +2 -56
  6. package/dist/connector/node-connector-options.js +2 -1
  7. package/dist/connector/node-operation-router.js +2 -22
  8. package/dist/connector.js +2 -845
  9. package/dist/control-outbound-scheduler.js +2 -154
  10. package/dist/database.js +2 -1418
  11. package/dist/event-buffer.js +2 -19
  12. package/dist/fake-runner.js +2 -129
  13. package/dist/health.js +2 -3
  14. package/dist/main.js +2 -54
  15. package/dist/migrations/v001.js +3 -144
  16. package/dist/migrations/v002.js +2 -143
  17. package/dist/migrations/v003.js +2 -44
  18. package/dist/migrations/v004.js +34 -30
  19. package/dist/native-jsonl-reader.js +2 -186
  20. package/dist/native-session-history.js +2 -1119
  21. package/dist/opencode-runtime.js +2 -80
  22. package/dist/opencode-server.js +2 -263
  23. package/dist/operational.js +2 -122
  24. package/dist/process-tree.js +2 -18
  25. package/dist/rotating-log.js +2 -67
  26. package/dist/runner/abstract-runner.js +2 -232
  27. package/dist/runner/claude/managed-run-controller.js +2 -345
  28. package/dist/runner/claude-code-runner.js +2 -303
  29. package/dist/runner/codex/composer-image-markers.js +2 -0
  30. package/dist/runner/codex/conversation-parser.js +2 -861
  31. package/dist/runner/codex/managed-run-controller.js +2 -460
  32. package/dist/runner/codex-runner.js +2 -628
  33. package/dist/runner/fake-test-runner.js +2 -47
  34. package/dist/runner/opencode/conversation-parser.js +2 -221
  35. package/dist/runner/opencode/managed-run-controller.js +2 -537
  36. package/dist/runner/opencode-runner.js +2 -448
  37. package/dist/runner/runner-registry.js +2 -90
  38. package/dist/runner-command-engine.js +2 -70
  39. package/dist/runner-profiles.js +2 -215
  40. package/dist/runner-usage.js +2 -190
  41. package/dist/runtime-command-detector.js +2 -73
  42. package/dist/runtime-state.js +2 -982
  43. package/dist/service/attachment-domain-state.js +2 -7
  44. package/dist/service/conversation-history-service.js +2 -457
  45. package/dist/service/conversation-segment-service.js +2 -162
  46. package/dist/service/external-session-resume-service.js +2 -118
  47. package/dist/service/fake-managed-run-service.js +2 -60
  48. package/dist/service/managed-runner-session-service.js +2 -35
  49. package/dist/service/mcp-installation-verifier.js +2 -87
  50. package/dist/service/mcp-node-operation-service.js +2 -90
  51. package/dist/service/mcp-package-installer.js +2 -136
  52. package/dist/service/native-session-projection-service.js +2 -280
  53. package/dist/service/native-session-watch-service.js +2 -383
  54. package/dist/service/node-connection-lifecycle-service.js +2 -84
  55. package/dist/service/node-control-channel.js +2 -85
  56. package/dist/service/node-control-message-service.js +2 -107
  57. package/dist/service/node-request-service.js +2 -52
  58. package/dist/service/node-run-event-bridge.js +2 -83
  59. package/dist/service/node-terminal-channel.js +2 -182
  60. package/dist/service/node-upgrade-coordinator.js +2 -137
  61. package/dist/service/node-workspace-coordinator.js +2 -70
  62. package/dist/service/recent-run-projection-service.js +2 -78
  63. package/dist/service/run-attachment-service.js +2 -194
  64. package/dist/service/run-domain-state.js +2 -4
  65. package/dist/service/run-event-service.js +2 -193
  66. package/dist/service/run-workbench-service.js +2 -104
  67. package/dist/service/runner-channel-message-service.js +2 -20
  68. package/dist/service/runner-interaction-service.js +2 -243
  69. package/dist/service/runner-service.js +2 -71
  70. package/dist/service/session-catalog-service.js +2 -224
  71. package/dist/service/session-command-service.js +2 -76
  72. package/dist/service/session-context-service.js +2 -101
  73. package/dist/service/session-domain-state.js +2 -9
  74. package/dist/service/session-identity-service.js +2 -86
  75. package/dist/service/session-lifecycle-service.js +2 -240
  76. package/dist/service/session-message-service.js +2 -173
  77. package/dist/service/session-presentation-service.js +2 -43
  78. package/dist/service/session-query-service.js +2 -82
  79. package/dist/service/skill-directory-service.js +2 -238
  80. package/dist/service/skill-install-service.js +2 -434
  81. package/dist/service/skill-node-operation-service.js +2 -206
  82. package/dist/service/terminal-relay-state.js +2 -3
  83. package/dist/service/terminal-service.js +2 -52
  84. package/dist/service/workbench-event-service.js +2 -19
  85. package/dist/service/workbench-manifest-service.js +2 -69
  86. package/dist/service/workspace-change-service.js +2 -86
  87. package/dist/service/workspace-content-search-service.js +2 -477
  88. package/dist/service/workspace-domain-state.js +2 -41
  89. package/dist/service/workspace-file-service.js +2 -122
  90. package/dist/service/workspace-git-exclude-service.js +2 -119
  91. package/dist/service/workspace-queue-workbench-service.js +2 -304
  92. package/dist/service/workspace-service.js +2 -69
  93. package/dist/service/workspace-session-service.js +2 -139
  94. package/dist/service/workspace-upload-service.js +2 -262
  95. package/dist/service/workspace-watch-service.js +2 -146
  96. package/dist/service/workspace-workbench-service.js +2 -405
  97. package/dist/service.js +2 -38
  98. package/dist/storage.js +2 -32
  99. package/dist/supervisor.js +2 -136
  100. package/dist/terminal.js +2 -416
  101. package/dist/util/node-operation-parsers.js +2 -382
  102. package/dist/util/personal-instructions.js +2 -31
  103. package/dist/util/runner-error.js +2 -52
  104. package/dist/util/runner-native-session-parsers.js +2 -490
  105. package/dist/util/safe-error.js +2 -5
  106. package/dist/util/secret-environment.js +2 -25
  107. package/dist/workspace.js +2 -1519
  108. package/package.json +3 -3
  109. package/dist/capabilities.d.ts +0 -12
  110. package/dist/claude-agent-sdk.d.ts +0 -92
  111. package/dist/claude-channel.d.ts +0 -28
  112. package/dist/codex-app-server.d.ts +0 -133
  113. package/dist/config.d.ts +0 -18
  114. package/dist/connector/node-connector-options.d.ts +0 -27
  115. package/dist/connector/node-operation-router.d.ts +0 -9
  116. package/dist/connector.d.ts +0 -94
  117. package/dist/control-outbound-scheduler.d.ts +0 -29
  118. package/dist/database.d.ts +0 -305
  119. package/dist/event-buffer.d.ts +0 -9
  120. package/dist/fake-runner.d.ts +0 -42
  121. package/dist/health.d.ts +0 -4
  122. package/dist/main.d.ts +0 -2
  123. package/dist/migrations/v001.d.ts +0 -3
  124. package/dist/migrations/v002.d.ts +0 -4
  125. package/dist/migrations/v003.d.ts +0 -4
  126. package/dist/migrations/v004.d.ts +0 -4
  127. package/dist/native-jsonl-reader.d.ts +0 -35
  128. package/dist/native-session-history.d.ts +0 -126
  129. package/dist/opencode-runtime.d.ts +0 -33
  130. package/dist/opencode-server.d.ts +0 -49
  131. package/dist/operational.d.ts +0 -39
  132. package/dist/process-tree.d.ts +0 -9
  133. package/dist/rotating-log.d.ts +0 -17
  134. package/dist/runner/abstract-runner.d.ts +0 -172
  135. package/dist/runner/claude/managed-run-controller.d.ts +0 -51
  136. package/dist/runner/claude-code-runner.d.ts +0 -72
  137. package/dist/runner/codex/conversation-parser.d.ts +0 -59
  138. package/dist/runner/codex/managed-run-controller.d.ts +0 -90
  139. package/dist/runner/codex-runner.d.ts +0 -103
  140. package/dist/runner/fake-test-runner.d.ts +0 -26
  141. package/dist/runner/opencode/conversation-parser.d.ts +0 -31
  142. package/dist/runner/opencode/managed-run-controller.d.ts +0 -82
  143. package/dist/runner/opencode-runner.d.ts +0 -71
  144. package/dist/runner/runner-registry.d.ts +0 -19
  145. package/dist/runner-command-engine.d.ts +0 -28
  146. package/dist/runner-profiles.d.ts +0 -15
  147. package/dist/runner-usage.d.ts +0 -33
  148. package/dist/runtime-command-detector.d.ts +0 -3
  149. package/dist/runtime-state.d.ts +0 -171
  150. package/dist/service/attachment-domain-state.d.ts +0 -7
  151. package/dist/service/conversation-history-service.d.ts +0 -43
  152. package/dist/service/conversation-segment-service.d.ts +0 -20
  153. package/dist/service/external-session-resume-service.d.ts +0 -34
  154. package/dist/service/fake-managed-run-service.d.ts +0 -28
  155. package/dist/service/managed-runner-session-service.d.ts +0 -12
  156. package/dist/service/mcp-installation-verifier.d.ts +0 -9
  157. package/dist/service/mcp-node-operation-service.d.ts +0 -11
  158. package/dist/service/mcp-package-installer.d.ts +0 -8
  159. package/dist/service/native-session-projection-service.d.ts +0 -52
  160. package/dist/service/native-session-watch-service.d.ts +0 -62
  161. package/dist/service/node-connection-lifecycle-service.d.ts +0 -36
  162. package/dist/service/node-control-channel.d.ts +0 -32
  163. package/dist/service/node-control-message-service.d.ts +0 -27
  164. package/dist/service/node-request-service.d.ts +0 -14
  165. package/dist/service/node-run-event-bridge.d.ts +0 -40
  166. package/dist/service/node-terminal-channel.d.ts +0 -29
  167. package/dist/service/node-upgrade-coordinator.d.ts +0 -29
  168. package/dist/service/node-workspace-coordinator.d.ts +0 -29
  169. package/dist/service/recent-run-projection-service.d.ts +0 -14
  170. package/dist/service/run-attachment-service.d.ts +0 -38
  171. package/dist/service/run-domain-state.d.ts +0 -4
  172. package/dist/service/run-event-service.d.ts +0 -33
  173. package/dist/service/run-workbench-service.d.ts +0 -25
  174. package/dist/service/runner-channel-message-service.d.ts +0 -13
  175. package/dist/service/runner-interaction-service.d.ts +0 -39
  176. package/dist/service/runner-service.d.ts +0 -46
  177. package/dist/service/session-catalog-service.d.ts +0 -45
  178. package/dist/service/session-command-service.d.ts +0 -24
  179. package/dist/service/session-context-service.d.ts +0 -35
  180. package/dist/service/session-domain-state.d.ts +0 -9
  181. package/dist/service/session-identity-service.d.ts +0 -24
  182. package/dist/service/session-lifecycle-service.d.ts +0 -31
  183. package/dist/service/session-message-service.d.ts +0 -33
  184. package/dist/service/session-presentation-service.d.ts +0 -34
  185. package/dist/service/session-query-service.d.ts +0 -35
  186. package/dist/service/skill-directory-service.d.ts +0 -20
  187. package/dist/service/skill-install-service.d.ts +0 -21
  188. package/dist/service/skill-node-operation-service.d.ts +0 -44
  189. package/dist/service/terminal-relay-state.d.ts +0 -6
  190. package/dist/service/terminal-service.d.ts +0 -12
  191. package/dist/service/workbench-event-service.d.ts +0 -9
  192. package/dist/service/workbench-manifest-service.d.ts +0 -90
  193. package/dist/service/workspace-change-service.d.ts +0 -9
  194. package/dist/service/workspace-content-search-service.d.ts +0 -14
  195. package/dist/service/workspace-domain-state.d.ts +0 -79
  196. package/dist/service/workspace-file-service.d.ts +0 -18
  197. package/dist/service/workspace-git-exclude-service.d.ts +0 -4
  198. package/dist/service/workspace-queue-workbench-service.d.ts +0 -86
  199. package/dist/service/workspace-service.d.ts +0 -15
  200. package/dist/service/workspace-session-service.d.ts +0 -23
  201. package/dist/service/workspace-upload-service.d.ts +0 -39
  202. package/dist/service/workspace-watch-service.d.ts +0 -23
  203. package/dist/service/workspace-workbench-service.d.ts +0 -58
  204. package/dist/service.d.ts +0 -4
  205. package/dist/storage.d.ts +0 -2
  206. package/dist/supervisor.d.ts +0 -1
  207. package/dist/terminal.d.ts +0 -133
  208. package/dist/util/node-operation-parsers.d.ts +0 -92
  209. package/dist/util/personal-instructions.d.ts +0 -2
  210. package/dist/util/runner-error.d.ts +0 -6
  211. package/dist/util/runner-native-session-parsers.d.ts +0 -74
  212. package/dist/util/safe-error.d.ts +0 -2
  213. package/dist/util/secret-environment.d.ts +0 -1
  214. package/dist/workspace.d.ts +0 -217
@@ -1,52 +0,0 @@
1
- import type { NodeCapabilities, RunnerDefaultConfiguration } from '@myagentroam/protocol';
2
- import type { CodexSessionControl } from '../codex-app-server.js';
3
- import type { NodeAgentSession, NodeDatabase } from '../database.js';
4
- import type { NodeRuntimeState } from '../runtime-state.js';
5
- import type { RunnerRegistry } from '../runner/runner-registry.js';
6
- import type { RunnerDiscoveryContext } from '../runner/abstract-runner.js';
7
- import type { CommandStateStore } from '../runner-command-engine.js';
8
- import type { SessionDomainState } from './session-domain-state.js';
9
- interface NativeSessionProjectionServiceOptions {
10
- readonly database: () => NodeDatabase | undefined;
11
- readonly nodeId: () => string;
12
- readonly runtime: NodeRuntimeState;
13
- readonly runners: RunnerRegistry;
14
- readonly capabilities: () => NodeCapabilities;
15
- readonly state: SessionDomainState<NodeAgentSession, unknown>;
16
- readonly commands: CommandStateStore;
17
- readonly present: (session: NodeAgentSession) => NodeAgentSession & {
18
- readonly control: CodexSessionControl;
19
- };
20
- }
21
- export declare class NativeSessionProjectionService {
22
- private readonly options;
23
- constructor(options: NativeSessionProjectionServiceOptions);
24
- discover(runnerName: NodeAgentSession['runner'], workspaceId?: string): Promise<readonly NodeAgentSession[]>;
25
- discoverCodex(workspaceId?: string): Promise<{
26
- readonly sessions: readonly (NodeAgentSession & {
27
- readonly control: CodexSessionControl;
28
- })[];
29
- }>;
30
- list(): Promise<readonly (NodeAgentSession & {
31
- readonly control: CodexSessionControl;
32
- })[]>;
33
- discoverWorkspace(workspaceId: string): Promise<readonly NodeAgentSession[]>;
34
- resolve(sessionId: string): Promise<NodeAgentSession | undefined>;
35
- resolveCurrent(sessionId: string): Promise<NodeAgentSession | undefined>;
36
- createMetadataProjection(sessionId: string): Promise<NodeAgentSession | undefined>;
37
- resumedConfiguration(session: NodeAgentSession): RunnerDefaultConfiguration;
38
- ensureResumedConfiguration(session: NodeAgentSession): NodeAgentSession;
39
- rename(session: NodeAgentSession, input: {
40
- readonly title?: string | null;
41
- readonly pinned?: boolean;
42
- }): Promise<void>;
43
- project(input: Parameters<RunnerDiscoveryContext['createProjection']>[0]): NodeAgentSession;
44
- remember(sessions: readonly NodeAgentSession[]): void;
45
- projectionForNative(native: NodeAgentSession): NodeAgentSession | undefined;
46
- managedForNative(native: NodeAgentSession): NodeAgentSession | undefined;
47
- nativeIds(session: NodeAgentSession): ReadonlySet<string>;
48
- forget(session: NodeAgentSession, knownNativeIds: ReadonlySet<string>): void;
49
- private isManagedProjection;
50
- private requireDatabase;
51
- }
52
- export {};
@@ -1,62 +0,0 @@
1
- import type { NodeAgentSession } from '../database.js';
2
- import type { NodeOperationHandler } from '../connector/node-operation-router.js';
3
- export interface NativeSessionWatchOptions<TPage extends {
4
- readonly turns: readonly unknown[];
5
- readonly source?: unknown;
6
- }> {
7
- readonly resolve: (sessionId: string) => Promise<NodeAgentSession | undefined>;
8
- readonly managedActive: (session: NodeAgentSession) => boolean;
9
- readonly suspended?: (sessionId: string) => boolean;
10
- readonly refreshActivity: (session: NodeAgentSession) => Promise<void>;
11
- readonly present: (session: NodeAgentSession) => unknown;
12
- readonly readPage: (session: NodeAgentSession, limit: number) => Promise<TPage>;
13
- readonly convergePage: (previous: TPage | undefined, previousObserved: TPage | undefined, next: TPage, previousAuthority: unknown) => {
14
- readonly page: TPage;
15
- readonly authority: unknown;
16
- };
17
- readonly projectInitialPage?: (session: NodeAgentSession, page: TPage, unit: 'SEGMENT', limit: number) => unknown;
18
- readonly emitSession: (session: unknown) => void;
19
- readonly emitPage: (session: NodeAgentSession, page: TPage) => void;
20
- readonly nodeId?: () => string;
21
- readonly nodeGeneration?: () => string;
22
- readonly emitWatchEvent?: (payload: unknown) => void;
23
- }
24
- export declare class NativeSessionWatchService<TPage extends {
25
- readonly turns: readonly unknown[];
26
- readonly source?: unknown;
27
- }> {
28
- private readonly options;
29
- private readonly watches;
30
- private readonly leases;
31
- private snapshotSequence;
32
- constructor(options: NativeSessionWatchOptions<TPage>);
33
- operations(): Readonly<Record<string, NodeOperationHandler>>;
34
- private executeWatch;
35
- private executeUnwatch;
36
- watch(session: NodeAgentSession): {
37
- readonly expiresAt: number;
38
- } | undefined;
39
- renew(session: NodeAgentSession): {
40
- readonly expiresAt: number;
41
- } | undefined;
42
- stop(sessionId: string): void;
43
- clear(): void;
44
- has(sessionId: string): boolean;
45
- entry(sessionId: string): {
46
- readonly expiresAt: number;
47
- } | undefined;
48
- get size(): number;
49
- refresh(sessionId: string, limit?: number, emit?: boolean): Promise<TPage | undefined>;
50
- private performRefresh;
51
- private sessionHash;
52
- private ownerKey;
53
- private accepted;
54
- private initializeLease;
55
- private removeLease;
56
- private emitObservedPage;
57
- private failSession;
58
- private releaseSessionLeases;
59
- private leaseTimer;
60
- private latestLeaseExpiry;
61
- private refreshTimer;
62
- }
@@ -1,36 +0,0 @@
1
- import type { NodeCapabilities } from '@myagentroam/protocol';
2
- import { type NodeConfig } from '../config.js';
3
- import type { NodeMetrics } from '../operational.js';
4
- import type { NodeControlChannel } from './node-control-channel.js';
5
- import type { NodeTerminalChannel } from './node-terminal-channel.js';
6
- interface NodeConnectionLifecycleServiceOptions {
7
- readonly config: () => NodeConfig | undefined;
8
- readonly setConfig: (config: NodeConfig) => void;
9
- readonly configPath: string | undefined;
10
- readonly capabilities: () => NodeCapabilities;
11
- readonly detectCapabilities: () => NodeCapabilities | Promise<NodeCapabilities>;
12
- readonly capabilitiesProvided: boolean;
13
- readonly stopped: () => boolean;
14
- readonly setCapabilities: (capabilities: NodeCapabilities) => void;
15
- readonly control: NodeControlChannel;
16
- readonly terminal: NodeTerminalChannel;
17
- readonly metrics: NodeMetrics;
18
- readonly heartbeatMs: number;
19
- readonly refreshMs: number;
20
- readonly onConnected?: () => void;
21
- }
22
- /** Owns registration completion, heartbeat and background capability refresh timers. */
23
- export declare class NodeConnectionLifecycleService {
24
- private readonly options;
25
- private heartbeat;
26
- private refreshTimer;
27
- private refreshing;
28
- constructor(options: NodeConnectionLifecycleServiceOptions);
29
- start(): void;
30
- startCapabilityRefresh(): void;
31
- stop(): void;
32
- register(nodeId: string, credential: string): Promise<void>;
33
- connected(): void;
34
- refreshCapabilities(): Promise<void>;
35
- }
36
- export {};
@@ -1,32 +0,0 @@
1
- import WebSocket from 'ws';
2
- import { type NodeCapabilities, type NodeEnvelope } from '@myagentroam/protocol';
3
- import type { NodeConfig } from '../config.js';
4
- interface NodeControlChannelOptions {
5
- readonly config: () => NodeConfig | undefined;
6
- readonly capabilities: () => NodeCapabilities;
7
- readonly stopped: () => boolean;
8
- readonly reconnect: boolean;
9
- readonly reconnectDelay: (attempt: number) => number;
10
- readonly onConnecting: (attempt: number) => void;
11
- readonly onReconnectScheduled: () => void;
12
- readonly onMessage: (raw: string) => void;
13
- readonly onClose: (code: number, reason: string) => void;
14
- }
15
- export declare class NodeControlChannel {
16
- private readonly options;
17
- private socket;
18
- private readonly outbound;
19
- private reconnectTimer;
20
- private attempts;
21
- constructor(options: NodeControlChannelOptions);
22
- connect(): void;
23
- connected(): boolean;
24
- /** Keeps transport injection at the transport boundary for contract tests. */
25
- replaceSocketForTesting(socket: WebSocket | undefined): void;
26
- close(code?: number, reason?: string): void;
27
- stop(): void;
28
- send(type: string, payload: unknown, replyTo?: string): void;
29
- sendEnvelope(envelope: NodeEnvelope): void;
30
- private scheduleReconnect;
31
- }
32
- export {};
@@ -1,27 +0,0 @@
1
- import { type NodeEnvelope } from '@myagentroam/protocol';
2
- import type { NodeConfig } from '../config.js';
3
- import type { RunnerRegistry } from '../runner/runner-registry.js';
4
- interface NodeControlMessageServiceOptions {
5
- readonly config: () => NodeConfig | undefined;
6
- readonly register: (nodeId: string, credential: string) => Promise<void>;
7
- readonly connected: () => void;
8
- readonly close: (code: number, reason: string) => void;
9
- readonly inspectWorkspace: (envelope: NodeEnvelope) => Promise<void>;
10
- readonly handleNodeRequest: (envelope: NodeEnvelope) => Promise<void>;
11
- readonly reconcileRuns: (envelope: NodeEnvelope) => void;
12
- readonly runners: RunnerRegistry;
13
- readonly deliverSessionChannelMessage: (envelope: NodeEnvelope) => void;
14
- readonly completeUncontrolledCancellation: (runId: string) => void;
15
- readonly send: (type: string, payload: unknown, replyTo?: string) => void;
16
- }
17
- /** Owns parsing and dispatch of the closed Node control-message protocol. */
18
- export declare class NodeControlMessageService {
19
- private readonly options;
20
- constructor(options: NodeControlMessageServiceOptions);
21
- handle(raw: string): void;
22
- private dispatch;
23
- private register;
24
- private decideApproval;
25
- private cancelRun;
26
- }
27
- export {};
@@ -1,14 +0,0 @@
1
- import type { NodeEnvelope } from '@myagentroam/protocol';
2
- interface NodeRequestServiceOptions {
3
- readonly nodeId: () => string | undefined;
4
- readonly databaseAvailable: () => boolean;
5
- readonly execute: (operation: string, data: unknown) => Promise<unknown>;
6
- readonly send: (type: string, payload: unknown, replyTo?: string) => void;
7
- }
8
- /** Validates and executes the closed Admin-facing Node operation envelope. */
9
- export declare class NodeRequestService {
10
- private readonly options;
11
- constructor(options: NodeRequestServiceOptions);
12
- handle(envelope: NodeEnvelope): Promise<void>;
13
- }
14
- export {};
@@ -1,40 +0,0 @@
1
- import type { NodeEnvelope, WorkbenchEventCategory } from '@myagentroam/protocol';
2
- import type { FakeRunnerStatus } from '../fake-runner.js';
3
- import type { CodexRunner } from '../runner/codex-runner.js';
4
- import type { ClaudeCodeRunner } from '../runner/claude-code-runner.js';
5
- import type { OpenCodeRunner } from '../runner/opencode-runner.js';
6
- import type { NodeRuntimeState } from '../runtime-state.js';
7
- import type { RunDomainState } from './run-domain-state.js';
8
- import type { RunEventService } from './run-event-service.js';
9
- import type { WorkbenchEventService } from './workbench-event-service.js';
10
- import type { WorkspaceQueueWorkbenchService } from './workspace-queue-workbench-service.js';
11
- import type { RunnerImageAttachment } from './run-attachment-service.js';
12
- export declare function workbenchPayloadSessionId(runtime: NodeRuntimeState, category: WorkbenchEventCategory, payload: unknown): string | undefined;
13
- interface NodeRunEventBridgeOptions {
14
- readonly runtime: NodeRuntimeState;
15
- readonly state: RunDomainState;
16
- readonly events: RunEventService;
17
- readonly workbench: WorkbenchEventService;
18
- readonly queues: WorkspaceQueueWorkbenchService<RunnerImageAttachment>;
19
- readonly codex: CodexRunner;
20
- readonly claude: ClaudeCodeRunner;
21
- readonly openCode: OpenCodeRunner;
22
- readonly send: (type: string, payload: unknown, replyTo?: string) => void;
23
- }
24
- /** Bridges process-local Run state to normalized control and Workbench events. */
25
- export declare class NodeRunEventBridge {
26
- private readonly options;
27
- constructor(options: NodeRunEventBridgeOptions);
28
- publishApproval(input: {
29
- readonly runId: string;
30
- readonly approvalId: string;
31
- readonly payload: unknown;
32
- readonly expiresAt: number;
33
- }): void;
34
- emitRun(runId: string, eventType: string, payload: unknown, status?: FakeRunnerStatus): void;
35
- emitWorkbench(category: WorkbenchEventCategory, payload: unknown): void;
36
- emitQueue(workspaceId: string, sessionId: string): void;
37
- migrateRunnerSessionIdentity(sessionId: string, nativeSessionId: string): void;
38
- reconcile(envelope: NodeEnvelope): void;
39
- }
40
- export {};
@@ -1,29 +0,0 @@
1
- import type { NodeConfig } from '../config.js';
2
- import type { TerminalManager } from '../terminal.js';
3
- interface NodeTerminalChannelOptions {
4
- readonly config: () => NodeConfig | undefined;
5
- readonly controlConnected: () => boolean;
6
- readonly stopped: () => boolean;
7
- readonly reconnect: boolean;
8
- readonly reconnectDelay: (attempt: number) => number;
9
- readonly manager: TerminalManager;
10
- }
11
- export declare class NodeTerminalChannel {
12
- private readonly options;
13
- private socket;
14
- private reconnectTimer;
15
- private attempts;
16
- private readonly state;
17
- constructor(options: NodeTerminalChannelOptions);
18
- connect(): void;
19
- disconnect(): void;
20
- stop(): void;
21
- private scheduleReconnect;
22
- private handle;
23
- private publish;
24
- private sendFrame;
25
- private send;
26
- private invalid;
27
- private releaseAttachments;
28
- }
29
- export {};
@@ -1,29 +0,0 @@
1
- import type { NodeUpgradeStatus } from '@myagentroam/protocol';
2
- export declare class NodeUpgradeCoordinator {
3
- private readonly requestPath;
4
- private readonly activeRunCount;
5
- private readonly onStatus;
6
- private readonly onReady;
7
- private readonly now;
8
- private status;
9
- private timer;
10
- constructor(requestPath: () => string, activeRunCount: () => number, onStatus: (status: NodeUpgradeStatus) => void, onReady: () => void, now?: () => number);
11
- snapshot(): NodeUpgradeStatus;
12
- loadResult(resultPath: string): Promise<void>;
13
- request(data: unknown): {
14
- status: 'ACCEPTED' | 'ALREADY_PENDING';
15
- targetVersion: string;
16
- activeRunCount: number;
17
- };
18
- cancel(): {
19
- cancelled: true;
20
- };
21
- blocks(operation: string): boolean;
22
- pending(): boolean;
23
- stop(): void;
24
- private checkReady;
25
- private checkReadySafely;
26
- private update;
27
- private clearTimer;
28
- }
29
- export declare function nodeUpgradeRequestPath(databasePath: string): string;
@@ -1,29 +0,0 @@
1
- import type { NodeEnvelope } from '@myagentroam/protocol';
2
- import type { NodeConfig } from '../config.js';
3
- import type { NodeAgentSession, NodeDatabase, NodeWorkspace } from '../database.js';
4
- import type { TerminalSummary } from '../terminal.js';
5
- import type { WorkspaceChangeService } from './workspace-change-service.js';
6
- import type { WorkspaceSessionService } from './workspace-session-service.js';
7
- import type { WorkspaceWatchService } from './workspace-watch-service.js';
8
- interface NodeWorkspaceCoordinatorOptions {
9
- readonly config: () => NodeConfig | undefined;
10
- readonly database: () => NodeDatabase | undefined;
11
- readonly watches: WorkspaceWatchService;
12
- readonly sessions: WorkspaceSessionService;
13
- readonly changes: WorkspaceChangeService;
14
- readonly emit: (workspaceId: string, topic: 'files' | 'changes', revision: number) => void;
15
- readonly send: (type: string, payload: unknown, replyTo?: string) => void;
16
- }
17
- /** Coordinates Workspace invalidation, inspection and persisted Terminal summaries. */
18
- export declare class NodeWorkspaceCoordinator {
19
- private readonly options;
20
- constructor(options: NodeWorkspaceCoordinatorOptions);
21
- require(workspaceId: unknown): NodeWorkspace;
22
- clearWatches(workspaceId: string): void;
23
- cachedSessions(workspaceId: string): Promise<readonly NodeAgentSession[]>;
24
- invalidate(workspaceId: string): void;
25
- invalidateChanges(workspaceId: string): void;
26
- persistTerminal(summary: TerminalSummary): void;
27
- inspect(envelope: NodeEnvelope): Promise<void>;
28
- }
29
- export {};
@@ -1,14 +0,0 @@
1
- import type { NodeAgentRun, NodeAgentSession } from '../database.js';
2
- import type { RecentRunProjection, RecentRunProjectionMessage } from '@myagentroam/protocol';
3
- export declare class RecentRunProjectionService {
4
- private readonly emit;
5
- private readonly now;
6
- private readonly runs;
7
- private readonly cleanupTimer;
8
- constructor(emit: (message: RecentRunProjectionMessage) => void, now?: () => number);
9
- record(run: NodeAgentRun, session: NodeAgentSession): void;
10
- snapshot(): readonly RecentRunProjection[];
11
- publishSnapshot(): void;
12
- dispose(): void;
13
- private cleanup;
14
- }
@@ -1,38 +0,0 @@
1
- import type { CodexComposerInput } from '../codex-app-server.js';
2
- import type { NodeAgentSession, NodeMessageAttachmentInput } from '../database.js';
3
- import type { NativeTranscriptImageAttachment } from '../native-session-history.js';
4
- import { AttachmentDomainState } from './attachment-domain-state.js';
5
- export interface CachedRunImages {
6
- images: readonly NodeMessageAttachmentInput[];
7
- expiresAt: number | undefined;
8
- timer: NodeJS.Timeout | undefined;
9
- }
10
- export interface NativeImageSource {
11
- readonly name: string;
12
- readonly mime: string;
13
- readonly path: string;
14
- readonly root: string;
15
- }
16
- export type RunnerImageAttachment = NodeMessageAttachmentInput & {
17
- readonly mime: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
18
- };
19
- export declare class RunAttachmentService {
20
- private readonly nativeImageRoots;
21
- readonly state: AttachmentDomainState<CachedRunImages, NativeImageSource>;
22
- constructor(nativeImageRoots: (session: NodeAgentSession) => readonly string[]);
23
- materializeCodex(runId: string, attachments: readonly RunnerImageAttachment[]): Promise<readonly Extract<CodexComposerInput, {
24
- readonly type: 'localImage';
25
- }>[]>;
26
- persistFiles(workspacePath: string, runId: string, attachments: readonly NodeMessageAttachmentInput[]): Promise<readonly string[]>;
27
- cleanup(runId: string): void;
28
- cache(runId: string, images: readonly NodeMessageAttachmentInput[]): void;
29
- append(runId: string, images: readonly NodeMessageAttachmentInput[]): readonly Record<string, unknown>[];
30
- read(runId: string, imageIndex: number): NodeMessageAttachmentInput | undefined;
31
- registerNative(session: NodeAgentSession, images: readonly NativeTranscriptImageAttachment[]): readonly Record<string, unknown>[];
32
- readNative(runId: string, imageIndex: number): Promise<(NativeImageSource & {
33
- readonly dataBase64: string;
34
- }) | undefined>;
35
- expire(runId: string): void;
36
- clear(runId: string): void;
37
- dispose(): void;
38
- }
@@ -1,4 +0,0 @@
1
- export declare class RunDomainState {
2
- readonly active: Set<string>;
3
- readonly interruptRequested: Set<string>;
4
- }
@@ -1,33 +0,0 @@
1
- import type { WorkbenchEventCategory } from '@myagentroam/protocol';
2
- import type { NodeAgentSession } from '../database.js';
3
- import type { FakeRunnerStatus } from '../fake-runner.js';
4
- import { NodeMetrics } from '../operational.js';
5
- import { NodeRuntimeState } from '../runtime-state.js';
6
- import { RunDomainState } from './run-domain-state.js';
7
- export interface RunEventServiceOptions {
8
- readonly runtime: NodeRuntimeState;
9
- readonly metrics: NodeMetrics;
10
- readonly state: RunDomainState;
11
- readonly isBootstrapSession: (sessionId: string) => boolean;
12
- readonly presentSession: (session: NodeAgentSession) => unknown;
13
- readonly rejectBootstrap: (sessionId: string, code: string) => void;
14
- readonly emitWorkbench: (category: WorkbenchEventCategory, payload: unknown) => void;
15
- readonly cleanupAttachments: (runId: string) => void;
16
- readonly expireImages: (runId: string) => void;
17
- readonly scheduleContextRefresh: (sessionId: string) => void;
18
- readonly dispatchQueue: (sessionId: string) => Promise<void>;
19
- readonly removeQueuedStart: (runId: string) => void;
20
- }
21
- export declare class RunEventService {
22
- private readonly options;
23
- private readonly sequences;
24
- private readonly pendingText;
25
- constructor(options: RunEventServiceOptions);
26
- emit(runId: string, eventType: string, payload: unknown, status?: FakeRunnerStatus): void;
27
- clear(): void;
28
- flushPendingText(runId: string): void;
29
- private enqueueText;
30
- private flushText;
31
- private emitNow;
32
- private notificationPayload;
33
- }
@@ -1,25 +0,0 @@
1
- import type { NodeOperationHandler } from '../connector/node-operation-router.js';
2
- import type { NodeRuntimeState } from '../runtime-state.js';
3
- export interface RunWorkbenchServiceOptions {
4
- readonly runtime: NodeRuntimeState;
5
- readonly readImage: (runId: string, imageIndex: number) => Promise<unknown | undefined>;
6
- readonly respondUserInput: (runId: string, requestId: string, answers: Record<string, unknown>) => void;
7
- readonly cancelQueued: (runId: string) => void;
8
- readonly pauseQueue: (sessionId: string) => void;
9
- readonly emitRun: (runId: string, eventType: string, payload: unknown, status?: 'CANCELLED') => void;
10
- readonly control: (operation: string, payload: Record<string, unknown>) => void;
11
- readonly markInterrupted: (runId: string) => void;
12
- }
13
- export declare class RunWorkbenchService {
14
- private readonly options;
15
- constructor(options: RunWorkbenchServiceOptions);
16
- operations(): Readonly<Record<string, NodeOperationHandler>>;
17
- private get;
18
- private image;
19
- private respond;
20
- private interruptSession;
21
- private cancelOrInterrupt;
22
- private approvals;
23
- private decideApproval;
24
- private requireRun;
25
- }
@@ -1,13 +0,0 @@
1
- import type { NodeEnvelope } from '@myagentroam/protocol';
2
- import type { RunnerInteractionService } from './runner-interaction-service.js';
3
- interface RunnerChannelMessageServiceOptions {
4
- readonly interactions: RunnerInteractionService;
5
- readonly send: (type: string, payload: unknown, replyTo?: string) => void;
6
- }
7
- /** Validates shared-control channel messages before delivery to a Runner. */
8
- export declare class RunnerChannelMessageService {
9
- private readonly options;
10
- constructor(options: RunnerChannelMessageServiceOptions);
11
- handle(envelope: NodeEnvelope): void;
12
- }
13
- export {};
@@ -1,39 +0,0 @@
1
- import type { NodeRuntimeState } from '../runtime-state.js';
2
- import type { NodeAgentSession } from '../database.js';
3
- import type { RunnerRegistry } from '../runner/runner-registry.js';
4
- import type { ClaudeCodeRunner } from '../runner/claude-code-runner.js';
5
- import type { CodexRunner } from '../runner/codex-runner.js';
6
- import { type PublicConversationItem } from '../runner/codex/conversation-parser.js';
7
- import type { RunDomainState } from './run-domain-state.js';
8
- interface RunnerInteractionServiceOptions {
9
- readonly runtime: NodeRuntimeState;
10
- readonly state: RunDomainState;
11
- readonly codex: () => CodexRunner;
12
- readonly claude: () => ClaudeCodeRunner;
13
- readonly runners: RunnerRegistry;
14
- readonly emitRun: (runId: string, eventType: string, payload: unknown, status?: 'FAILED' | 'CANCELLED' | 'INTERRUPTED') => void;
15
- readonly emitItem: (runId: string, item: PublicConversationItem) => void;
16
- readonly approvalTimeoutMs: number;
17
- readonly publishApproval: (input: {
18
- readonly runId: string;
19
- readonly approvalId: string;
20
- readonly payload: unknown;
21
- readonly expiresAt: number;
22
- }) => void;
23
- }
24
- export declare class RunnerInteractionService {
25
- private readonly options;
26
- constructor(options: RunnerInteractionServiceOptions);
27
- requestClaudeApproval(runId: string, toolName: string, toolInput: Record<string, unknown>): Promise<import("@anthropic-ai/claude-agent-sdk").PermissionResult>;
28
- requestClaudeUserInput(runId: string, toolInput: Record<string, unknown>, toolUseId: string): Promise<import("@anthropic-ai/claude-agent-sdk").PermissionResult>;
29
- deliverChannel(runner: NodeAgentSession['runner'], sessionId: string, messageId: string, senderId: string, token: string, content: string): import("../claude-channel.js").ChannelDelivery;
30
- decideCodexApproval(approvalId: string, decision: 'APPROVED' | 'REJECTED'): boolean;
31
- decideClaudeApproval(approvalId: string, decision: 'APPROVED' | 'REJECTED'): boolean;
32
- cancelClaudeRun(runId: string, intent: 'CANCEL' | 'INTERRUPT'): boolean;
33
- cancelCodexTurn(runId: string, threadId: string, turnId: string, cwd: string, terminalStatus: 'CANCELLED' | 'INTERRUPTED'): Promise<void>;
34
- respondUserInput(runId: string, requestId: string, rawAnswers: Record<string, unknown>): void;
35
- completeCancelledRun(runId: string): boolean;
36
- private respondCodexUserInput;
37
- private answers;
38
- }
39
- export {};
@@ -1,46 +0,0 @@
1
- import { type NodeCapabilities } from '@myagentroam/protocol';
2
- import type { NodeDatabase } from '../database.js';
3
- import type { NodeOperationHandler } from '../connector/node-operation-router.js';
4
- import type { RunnerRegistry } from '../runner/runner-registry.js';
5
- import type { RunnerUsageReader } from '../runner-usage.js';
6
- export declare class RunnerService {
7
- private readonly database;
8
- private readonly capabilities;
9
- private readonly runners;
10
- private readonly usage;
11
- constructor(database: () => NodeDatabase, capabilities: () => NodeCapabilities, runners: RunnerRegistry, usage: RunnerUsageReader);
12
- operations(): Readonly<Record<string, NodeOperationHandler>>;
13
- profiles(): readonly {
14
- runner: "codex" | "claude-code" | "opencode";
15
- capabilities: string[];
16
- models: {
17
- id: string;
18
- label: string;
19
- supportedEfforts: string[];
20
- isDefault?: boolean | undefined;
21
- defaultEffort?: string | undefined;
22
- }[];
23
- accessOptions: {
24
- id: string;
25
- description: string;
26
- label: string;
27
- }[];
28
- commands: {
29
- id: string;
30
- description: string;
31
- available: boolean;
32
- runner: "codex" | "claude-code" | "opencode";
33
- reasonCode: string | null;
34
- label: string;
35
- inputHint: string;
36
- source: "CODEX_APP_SERVER" | "CLAUDE_AGENT_SDK" | "OPENCODE_SERVER";
37
- interaction: "RUNNER_TEXT" | "IMMEDIATE_ACTION" | "TOGGLE" | "VALUE";
38
- stateLabel?: string | undefined;
39
- }[];
40
- }[];
41
- private refreshProfiles;
42
- private usageStatuses;
43
- private readUsage;
44
- private listProfiles;
45
- private saveDefaults;
46
- }
@@ -1,45 +0,0 @@
1
- import type { NodeOperationHandler } from '../connector/node-operation-router.js';
2
- import type { NodeAgentSession, NodeConversationTurn, NodeDatabase } from '../database.js';
3
- import type { NodeRuntimeState } from '../runtime-state.js';
4
- import type { ExternalSessionResumeService } from './external-session-resume-service.js';
5
- import type { NativeSessionProjectionService } from './native-session-projection-service.js';
6
- import type { RunnerRegistry } from '../runner/runner-registry.js';
7
- interface SessionCatalogServiceOptions {
8
- readonly database: () => NodeDatabase;
9
- readonly nodeId: () => string;
10
- readonly runtime: NodeRuntimeState;
11
- readonly runners: RunnerRegistry;
12
- readonly projection: NativeSessionProjectionService;
13
- readonly resume: ExternalSessionResumeService;
14
- readonly cachedNative: () => readonly NodeAgentSession[];
15
- readonly cachedWorkspace: (workspaceId: string) => Promise<readonly NodeAgentSession[]>;
16
- readonly present: (session: NodeAgentSession) => NodeAgentSession;
17
- readonly projectionForNative: (session: NodeAgentSession) => NodeAgentSession | undefined;
18
- readonly nativeIds: (session: NodeAgentSession) => ReadonlySet<string>;
19
- readonly forget: (session: NodeAgentSession, nativeIds: ReadonlySet<string>) => void;
20
- readonly refreshActivity: (session: NodeAgentSession) => Promise<void>;
21
- readonly externalActivity: (sessionId: string) => unknown;
22
- readonly history: (session: NodeAgentSession, input: {
23
- readonly cursor?: string;
24
- readonly limit?: number;
25
- }) => Promise<{
26
- readonly turns: readonly NodeConversationTurn[];
27
- readonly nextCursor: string | null;
28
- }>;
29
- readonly emitSession: (session: NodeAgentSession) => void;
30
- }
31
- export declare class SessionCatalogService {
32
- private readonly options;
33
- private rewindQueue;
34
- constructor(options: SessionCatalogServiceOptions);
35
- operations(): Readonly<Record<string, NodeOperationHandler>>;
36
- private list;
37
- private mergePersisted;
38
- private resume;
39
- private enqueueRewind;
40
- private rewind;
41
- private findTurn;
42
- private remove;
43
- }
44
- export declare function rewindTitle(sourceTitle: string, existingTitles?: readonly string[]): string;
45
- export {};
@@ -1,24 +0,0 @@
1
- import type { RunnerProfile } from '@myagentroam/protocol';
2
- import type { NodeOperationHandler } from '../connector/node-operation-router.js';
3
- import type { NodeAgentSession } from '../database.js';
4
- import type { NodeRuntimeState } from '../runtime-state.js';
5
- import type { RunnerRegistry } from '../runner/runner-registry.js';
6
- import type { ExternalSessionResumeService } from './external-session-resume-service.js';
7
- import type { NativeSessionProjectionService } from './native-session-projection-service.js';
8
- interface SessionCommandServiceOptions {
9
- readonly runtime: NodeRuntimeState;
10
- readonly runners: RunnerRegistry;
11
- readonly projection: NativeSessionProjectionService;
12
- readonly resume: ExternalSessionResumeService;
13
- readonly profiles: () => readonly RunnerProfile[];
14
- readonly present: (session: NodeAgentSession) => unknown;
15
- readonly resumeQueueAfterCommandRun: (sessionId: string) => void;
16
- }
17
- export declare class SessionCommandService {
18
- private readonly options;
19
- constructor(options: SessionCommandServiceOptions);
20
- operations(): Readonly<Record<string, NodeOperationHandler>>;
21
- private runnerCommand;
22
- private sessionCommand;
23
- }
24
- export {};