@myagentroam/node 0.9.9 → 0.9.10

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,305 +0,0 @@
1
- import { DatabaseSync } from 'node:sqlite';
2
- import { type AgentRunStatus, type RunnerDefaultConfiguration, type RunnerName } from '@myagentroam/protocol';
3
- import { type McpCatalogEntry, type McpInstallationConfiguration, type McpRuntimeDescriptor } from '@myagentroam/protocol';
4
- import type { NativeSessionHistory } from './native-session-history.js';
5
- export interface NodeMcpInstallation {
6
- readonly targetKind: 'NODE' | 'WORKSPACE';
7
- readonly targetId: string;
8
- readonly catalogEntryId: string;
9
- readonly serverName: string;
10
- readonly displayName: string;
11
- readonly version: string;
12
- readonly enabled: boolean;
13
- readonly runtime: McpRuntimeDescriptor;
14
- readonly configuration: McpInstallationConfiguration;
15
- readonly installedAt: number;
16
- }
17
- export type RunRecoveryState = 'ACTIVE' | 'SUSPECT' | 'LOST';
18
- export type ApprovalStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'EXPIRED';
19
- /** Whether a native session ID was created by this Node or merely discovered. */
20
- export type NativeSessionControl = 'MAR_MANAGED' | 'EXTERNAL';
21
- export interface NodeWorkspace {
22
- readonly id: string;
23
- readonly path: string;
24
- readonly kind: 'DIRECTORY' | 'GIT_WORKSPACE';
25
- readonly gitSummary: unknown | null;
26
- }
27
- export interface NodeAgentSession {
28
- readonly id: string;
29
- readonly nodeId: string;
30
- readonly workspaceId: string;
31
- readonly runner: RunnerName;
32
- readonly externalSessionId: string | null;
33
- readonly nativeControl: NativeSessionControl;
34
- readonly channelToken: string | null;
35
- readonly cwd: string;
36
- /** Runner preferences chosen when this managed session was created. */
37
- readonly model: string | null;
38
- readonly effort: string | null;
39
- readonly access: string | null;
40
- readonly customTitle: string | null;
41
- readonly runnerTitle: string | null;
42
- readonly pinnedAt: number | null;
43
- readonly pinOrder?: number | null;
44
- /** False only for a local record absent from the current Runner discovery result. */
45
- readonly externalDiscovered?: boolean;
46
- readonly titleSource: 'AUTO' | 'RUNNER' | 'CUSTOM';
47
- readonly lastActivityAt: number;
48
- readonly createdAt: number;
49
- }
50
- export interface NativeSessionMetadata {
51
- readonly customTitle: string | null;
52
- readonly runnerTitle: string | null;
53
- readonly runnerTitlePending: boolean;
54
- readonly pinnedAt: number | null;
55
- readonly pinOrder: number | null;
56
- readonly model: string | null;
57
- readonly effort: string | null;
58
- readonly access: string | null;
59
- }
60
- export interface NodeAgentRun {
61
- readonly id: string;
62
- readonly sessionId: string;
63
- readonly nodeId: string;
64
- readonly workspaceId: string;
65
- readonly runner: RunnerName;
66
- readonly status: AgentRunStatus;
67
- readonly recoveryState: RunRecoveryState;
68
- readonly version: number;
69
- readonly clientMessageId: string;
70
- /** Server-authenticated user that submitted this Run. Internal lifecycle metadata only. */
71
- readonly initiatedByUserId?: number;
72
- readonly createdAt: number;
73
- readonly updatedAt: number;
74
- }
75
- export interface NodeRunEvent {
76
- readonly id: number;
77
- readonly runId: string;
78
- readonly sequence: number;
79
- readonly eventType: string;
80
- readonly payload: unknown;
81
- /** The authoritative lifecycle state carried by a Runner terminal event. */
82
- readonly status?: AgentRunStatus;
83
- readonly createdAt: number;
84
- }
85
- export interface ConversationPage {
86
- readonly turns: readonly NodeConversationTurn[];
87
- readonly nextCursor: string | null;
88
- }
89
- export interface ConversationItemPage {
90
- readonly items: readonly NodeConversationItem[];
91
- readonly nextCursor: string | null;
92
- }
93
- /** Local structural projection; protocol validation remains at the boundary. */
94
- export interface NodeConversationItem {
95
- readonly id: string;
96
- readonly sessionId: string;
97
- readonly turnId: string;
98
- readonly runId: string | null;
99
- readonly parentItemId: string | null;
100
- readonly sourceSequence: number | null;
101
- readonly revision: number;
102
- readonly kind: string;
103
- readonly status: string;
104
- readonly payload: unknown;
105
- readonly startedAt: number | null;
106
- readonly completedAt: number | null;
107
- }
108
- export interface NodeConversationTurn {
109
- readonly id: string;
110
- readonly sessionId: string;
111
- readonly runId: string | null;
112
- readonly userItemId: string | null;
113
- readonly status: string;
114
- readonly model: string | null;
115
- readonly effort: string | null;
116
- readonly access: string | null;
117
- readonly rewind?: {
118
- readonly before: string | null;
119
- readonly after: string;
120
- };
121
- readonly items: readonly NodeConversationItem[];
122
- readonly startedAt: number | null;
123
- readonly completedAt: number | null;
124
- }
125
- export interface NodeMessageAttachmentInput {
126
- readonly name: string;
127
- readonly mime: string;
128
- readonly dataBase64: string;
129
- }
130
- export interface NodeApproval {
131
- readonly id: string;
132
- readonly runId: string;
133
- readonly status: ApprovalStatus;
134
- readonly payload: unknown;
135
- readonly expiresAt: number;
136
- readonly createdAt: number;
137
- readonly decidedAt: number | null;
138
- }
139
- /** Terminal output and input are deliberately never part of this projection. */
140
- export interface NodeTerminalSession {
141
- readonly id: string;
142
- readonly workspaceId: string | null;
143
- readonly profileId: string;
144
- readonly state: 'RUNNING' | 'EXITED' | 'CLOSED';
145
- readonly exitCode: number | null;
146
- readonly rows: number;
147
- readonly cols: number;
148
- readonly latestSequence: number;
149
- readonly createdAt: number;
150
- readonly updatedAt: number;
151
- }
152
- export declare class NodeDatabase {
153
- private readonly now;
154
- activeWorkspaceLeaseCount(): number;
155
- readonly raw: DatabaseSync;
156
- constructor(path: string, nodeId: string | (() => string), now?: () => number);
157
- close(): void;
158
- getRunnerDefaults(): readonly RunnerDefaultConfiguration[];
159
- saveRunnerDefaults(input: RunnerDefaultConfiguration): RunnerDefaultConfiguration;
160
- listMcpInstallations(targetKind: 'NODE' | 'WORKSPACE', targetId?: string): readonly NodeMcpInstallation[];
161
- saveMcpInstallation(input: {
162
- readonly targetKind: 'NODE' | 'WORKSPACE';
163
- readonly targetId?: string;
164
- readonly entry: McpCatalogEntry;
165
- readonly enabled: boolean;
166
- readonly configuration: NodeMcpInstallation['configuration'];
167
- }): NodeMcpInstallation;
168
- removeMcpInstallation(targetKind: 'NODE' | 'WORKSPACE', targetId: string, serverName: string): boolean;
169
- effectiveMcpInstallations(workspaceId: string): readonly NodeMcpInstallation[];
170
- /**
171
- * Stores only terminal lifecycle metadata. PTY input/output must remain in
172
- * the Node-local bounded replay buffer and must never be passed here.
173
- */
174
- saveTerminalSession(input: NodeTerminalSession): NodeTerminalSession;
175
- getTerminalSession(id: string): NodeTerminalSession | undefined;
176
- listTerminalSessions(): readonly NodeTerminalSession[];
177
- /** A restart cannot safely reattach an orphaned PTY, so record it as closed. */
178
- closeRunningTerminalSessions(): void;
179
- saveWorkspace(input: Omit<NodeWorkspace, 'id'> & {
180
- readonly id?: string;
181
- }): NodeWorkspace;
182
- listWorkspaces(): readonly NodeWorkspace[];
183
- getWorkspace(id: string): NodeWorkspace | undefined;
184
- /** Unregisters a Workspace registration without deleting its local directory. */
185
- removeWorkspace(id: string): NodeWorkspace;
186
- createAgentSession(input: {
187
- readonly workspaceId: string;
188
- readonly runner: RunnerName;
189
- readonly externalSessionId?: string;
190
- /** A caller-supplied native ID is always treated as an unverified external session. */
191
- readonly nativeControl?: NativeSessionControl;
192
- readonly cwd: string;
193
- /** Runner/native history title; never treated as a user override. */
194
- readonly title?: string;
195
- readonly model?: string;
196
- readonly effort?: string;
197
- readonly access?: string;
198
- }): NodeAgentSession;
199
- getAgentSession(id: string): NodeAgentSession | undefined;
200
- updateAgentSessionConfiguration(input: {
201
- readonly sessionId: string;
202
- readonly model: string;
203
- readonly effort: string;
204
- readonly access: string;
205
- }): NodeAgentSession;
206
- listAgentSessions(): readonly NodeAgentSession[];
207
- findAgentSessionByExternalSession(runner: RunnerName, externalSessionId: string): NodeAgentSession | undefined;
208
- setNativeControl(sessionId: string, nativeControl: NativeSessionControl): void;
209
- setExternalSessionId(sessionId: string, externalSessionId: string): void;
210
- setChannelToken(sessionId: string, token: string): void;
211
- updateSessionMetadata(input: {
212
- readonly sessionId: string;
213
- readonly customTitle?: string | null;
214
- readonly pinned?: boolean;
215
- }): NodeAgentSession;
216
- getNativeSessionMetadata(runner: RunnerName, externalSessionId: string, workspaceId: string): NativeSessionMetadata | undefined;
217
- saveNativeSessionMetadata(input: {
218
- readonly runner: RunnerName;
219
- readonly externalSessionId: string;
220
- readonly workspaceId: string;
221
- readonly customTitle?: string | null;
222
- readonly runnerTitle?: string | null;
223
- readonly runnerTitlePending?: boolean;
224
- readonly pinned?: boolean;
225
- readonly model?: string | null;
226
- readonly effort?: string | null;
227
- readonly access?: string | null;
228
- }): NativeSessionMetadata;
229
- listSessionRecords(workspaceId: string): readonly {
230
- readonly id: string;
231
- readonly workspaceId: string;
232
- readonly runner: RunnerName;
233
- readonly pinOrder: number | null;
234
- readonly metadata: NativeSessionMetadata;
235
- }[];
236
- movePinnedSession(sessionId: string, direction: 'up' | 'down'): void;
237
- deleteSessionRecord(sessionId: string): boolean;
238
- /**
239
- * Replaces only transcript-derived, run-less history. Managed Run turns are
240
- * never touched by a vendor file scan.
241
- */
242
- syncNativeTranscript(sessionId: string, history: NativeSessionHistory): boolean;
243
- createMessageRun(input: {
244
- readonly sessionId: string;
245
- readonly clientMessageId: string;
246
- readonly content: string;
247
- readonly attachments?: readonly NodeMessageAttachmentInput[];
248
- }): {
249
- readonly run: NodeAgentRun;
250
- readonly created: boolean;
251
- };
252
- getRun(id: string): NodeAgentRun | undefined;
253
- listRunsForSession(sessionId: string): readonly NodeAgentRun[];
254
- getRunInput(id: string): string | undefined;
255
- transitionRun(runId: string, next: AgentRunStatus): NodeAgentRun;
256
- appendRunEvent(input: {
257
- readonly runId: string;
258
- readonly sequence: number;
259
- readonly eventType: string;
260
- readonly payload: unknown;
261
- readonly status?: AgentRunStatus;
262
- }): NodeRunEvent | undefined;
263
- listRunEvents(runId: string, after?: number): readonly NodeRunEvent[];
264
- /**
265
- * Returns durable final item snapshots. Run events stay internal to the
266
- * replay path; callers never need to reconstruct native runner payloads.
267
- */
268
- listConversationTurns(input: {
269
- readonly sessionId: string;
270
- readonly cursor?: string;
271
- readonly limit?: number;
272
- /** File transcript history takes precedence when it is available and no managed Run is live. */
273
- readonly nativeOnly?: boolean;
274
- }): ConversationPage;
275
- hasNativeTranscript(sessionId: string): boolean;
276
- /** Session detail cursor is intentionally distinct from history paging. */
277
- listConversationItems(input: {
278
- readonly sessionId: string;
279
- readonly cursor?: string;
280
- readonly limit?: number;
281
- }): ConversationItemPage;
282
- createApproval(input: {
283
- readonly runId: string;
284
- readonly approvalId: string;
285
- readonly payload: unknown;
286
- readonly expiresAt: number;
287
- }): NodeApproval;
288
- getApproval(id: string): NodeApproval | undefined;
289
- listApprovals(runId: string): readonly NodeApproval[];
290
- /** Persists an expiry so a later decision cannot resurrect an old prompt. */
291
- expireApproval(id: string): NodeApproval;
292
- expireDueApprovals(): readonly NodeApproval[];
293
- decideApproval(id: string, decision: 'APPROVED' | 'REJECTED'): NodeApproval;
294
- listNonterminalRuns(): readonly NodeAgentRun[];
295
- lastRunSequence(runId: string): number;
296
- markActiveRunsSuspect(): void;
297
- hasActiveWorkspaceLease(workspaceId: string): boolean;
298
- reconcileRun(runId: string, active: boolean): void;
299
- private releaseLease;
300
- private recordConversationItemChange;
301
- private projectApproval;
302
- private readConversationTurn;
303
- private projectRunEvent;
304
- private readonly nodeIdProvider;
305
- }
@@ -1,9 +0,0 @@
1
- import { type NodeEnvelope, type WorkbenchEvent } from '@myagentroam/protocol';
2
- /** Keeps live page-level frames only until the current Server connection ACKs them. */
3
- export declare class ReliableWorkbenchEventBuffer {
4
- private readonly pending;
5
- queue(event: WorkbenchEvent): NodeEnvelope;
6
- acknowledge(replyTo: string | undefined): boolean;
7
- clear(): void;
8
- get size(): number;
9
- }
@@ -1,42 +0,0 @@
1
- export type FakeRunnerStep = {
2
- readonly type: 'text';
3
- readonly text: string;
4
- } | {
5
- readonly type: 'tool';
6
- readonly name: string;
7
- readonly input?: unknown;
8
- } | {
9
- readonly type: 'approval';
10
- readonly id?: string;
11
- readonly payload?: unknown;
12
- readonly timeoutMs?: number;
13
- } | {
14
- readonly type: 'success';
15
- readonly payload?: unknown;
16
- } | {
17
- readonly type: 'failure';
18
- readonly code?: string;
19
- } | {
20
- readonly type: 'long-running';
21
- } | {
22
- readonly type: 'disconnect';
23
- };
24
- export type FakeRunnerStatus = 'STARTING' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED' | 'INTERRUPTED';
25
- export interface FakeRunnerCallbacks {
26
- readonly event: (eventType: string, payload: unknown, status?: FakeRunnerStatus) => void;
27
- readonly approval: (approvalId: string, payload: unknown, expiresAt: number) => void;
28
- readonly disconnect: () => void;
29
- }
30
- /** Test-only deterministic runner; it is never part of node capabilities. */
31
- export declare class FakeRunner {
32
- private readonly now;
33
- private readonly active;
34
- constructor(now?: () => number);
35
- start(runId: string, script: readonly FakeRunnerStep[], callbacks: FakeRunnerCallbacks): Promise<void>;
36
- decide(runId: string, approvalId: string, decision: 'APPROVED' | 'REJECTED'): boolean;
37
- interrupt(runId: string): boolean;
38
- cancel(runId: string): boolean;
39
- private stopped;
40
- private waitForDecision;
41
- private stopWaitingForApproval;
42
- }
package/dist/health.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare function getNodeHealth(): {
2
- status: 'ok';
3
- platform: NodeJS.Platform;
4
- };
package/dist/main.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,3 +0,0 @@
1
- export declare const NODE_SCHEMA_V1: string;
2
- import type { DatabaseSync } from 'node:sqlite';
3
- export declare function assertNodeSchema(database: DatabaseSync): void;
@@ -1,4 +0,0 @@
1
- import type { DatabaseSync } from 'node:sqlite';
2
- export declare const NODE_SCHEMA_VERSION_V2 = 2;
3
- export declare function migrateNodeSchemaV2(database: DatabaseSync): void;
4
- export declare function assertNodeSchemaV2(database: DatabaseSync): void;
@@ -1,4 +0,0 @@
1
- import type { DatabaseSync } from 'node:sqlite';
2
- export declare const NODE_SCHEMA_VERSION_V3 = 3;
3
- export declare function migrateNodeSchemaV3(database: DatabaseSync): void;
4
- export declare function assertNodeSchemaV3(database: DatabaseSync): void;
@@ -1,4 +0,0 @@
1
- import type { DatabaseSync } from 'node:sqlite';
2
- export declare const NODE_SCHEMA_VERSION_V4 = 4;
3
- export declare function migrateNodeSchemaV4(database: DatabaseSync): void;
4
- export declare function assertNodeSchemaV4(database: DatabaseSync): void;
@@ -1,35 +0,0 @@
1
- export interface JsonlWindow {
2
- readonly content: string;
3
- readonly truncated: boolean;
4
- readonly size: number;
5
- }
6
- export interface JsonlBackwardWindow extends JsonlWindow {
7
- readonly pageContent: string;
8
- readonly start: number;
9
- readonly end: number;
10
- readonly snapshotEnd: number;
11
- readonly fileAnchor: string;
12
- readonly anchorBytes: number;
13
- }
14
- export declare function readJsonlFileAnchor(path: string, anchorBytes: number): Promise<string | undefined>;
15
- /** Reads one newline-aligned window backwards from an opaque byte boundary. */
16
- export declare function readJsonlBackwardWindow(path: string, options: {
17
- readonly headBytes: number;
18
- readonly targetLines: number;
19
- readonly maxBytes: number;
20
- readonly page?: {
21
- readonly snapshotEnd: number;
22
- readonly nextEnd: number;
23
- readonly fileAnchor: string;
24
- readonly anchorBytes: number;
25
- };
26
- }): Promise<JsonlBackwardWindow | undefined>;
27
- /** Reads bounded head/tail windows without ever loading an unbounded transcript. */
28
- export declare function readJsonlWindow(path: string, options: {
29
- readonly headBytes?: number;
30
- readonly tailBytes?: number;
31
- }): Promise<JsonlWindow | undefined>;
32
- /** Parses records one at a time, avoiding the allocation of a full line array. */
33
- export declare function forEachJsonlRecord(content: string, visit: (record: Record<string, unknown>) => void): void;
34
- export declare function listJsonlFiles(directory: string): Promise<readonly string[]>;
35
- export declare function mapConcurrent<T, R>(values: readonly T[], concurrency: number, map: (value: T, index: number) => Promise<R>): Promise<readonly R[]>;
@@ -1,126 +0,0 @@
1
- import type { RunnerName } from '@myagentroam/protocol';
2
- export interface NativeTranscriptMessage {
3
- readonly kind: 'message';
4
- readonly role: 'USER' | 'ASSISTANT';
5
- readonly text: string;
6
- readonly createdAt: number | null;
7
- readonly nativeId?: string;
8
- }
9
- export interface NativeTranscriptToolCall {
10
- readonly kind: 'tool_call';
11
- readonly toolUseId: string;
12
- readonly toolName: string;
13
- readonly input: unknown;
14
- readonly inputSummary: string | null;
15
- readonly inputTruncated: boolean;
16
- readonly outputSummary: string | null;
17
- readonly outputTruncated: boolean;
18
- /** Metadata only: native transcript image bytes are never retained here. */
19
- readonly imageAttachments?: readonly NativeTranscriptImageAttachment[];
20
- readonly failed: boolean;
21
- readonly createdAt: number | null;
22
- readonly nativeId?: string;
23
- }
24
- export interface NativeTranscriptUnknown {
25
- readonly kind: 'unknown';
26
- readonly sourceEventType: string;
27
- readonly label: string;
28
- readonly createdAt: number | null;
29
- readonly nativeId?: string;
30
- }
31
- export interface NativeTranscriptReasoningSummary {
32
- readonly kind: 'reasoning_summary';
33
- readonly sections: readonly {
34
- readonly index: number;
35
- readonly text: string;
36
- }[];
37
- readonly createdAt: number | null;
38
- readonly nativeId?: string;
39
- }
40
- export interface NativeTranscriptImageAttachment {
41
- readonly name: string;
42
- readonly mime: string;
43
- /** Codex-owned local artifact path; never sent to Web. */
44
- readonly localPath?: string;
45
- }
46
- export type NativeTranscriptItem = NativeTranscriptMessage | NativeTranscriptToolCall | NativeTranscriptReasoningSummary | NativeTranscriptUnknown;
47
- export interface NativeSessionHistory {
48
- readonly runner: RunnerName;
49
- readonly externalSessionId: string;
50
- readonly cwd: string;
51
- readonly title?: string;
52
- readonly digest: string;
53
- readonly items: readonly NativeTranscriptItem[];
54
- /**
55
- * Latest timestamp of a visible conversation or tool item. Filesystem
56
- * metadata is deliberately excluded: runners can rewrite transcript-side
57
- * metadata without adding a user-visible conversation record.
58
- */
59
- readonly lastActivityAt: number;
60
- /** The bounded reader omitted bytes between its header and tail windows. */
61
- readonly truncated?: boolean;
62
- /** Opaque paging facts for reading the preceding newline-aligned JSONL window. */
63
- readonly windowStart?: number;
64
- readonly windowEnd?: number;
65
- readonly snapshotEnd?: number;
66
- readonly fileAnchor?: string;
67
- readonly anchorBytes?: number;
68
- /** The supplied page cursor no longer matched this transcript. */
69
- readonly cursorReset?: boolean;
70
- /** Page-size input used to derive the stable JSONL line window. */
71
- readonly windowReadLimit?: number;
72
- }
73
- /** Actual context-window facts emitted by the Codex native transcript. */
74
- export interface NativeCodexContextUsage {
75
- readonly usedTokens: number;
76
- readonly maxTokens: number;
77
- }
78
- export interface NativeClaudeContextUsage {
79
- readonly model: string;
80
- readonly usedTokens: number;
81
- readonly maxTokens: number;
82
- }
83
- /**
84
- * Read-only adapter for the supported vendor JSONL stores. It requires an
85
- * explicit cwd on the record and returns normalized visible messages and tool
86
- * cards; no raw vendor events or hidden reasoning are exposed to the Workbench.
87
- */
88
- export declare function discoverNativeSessions(runner: RunnerName, workspacePath: string): Promise<readonly NativeSessionHistory[]>;
89
- /**
90
- * Reads every supported transcript header before applying a Workspace filter.
91
- * A short Runner-level snapshot is shared across Workspaces and refreshes only
92
- * files whose size or modification time changed. A fixed file-count cutoff
93
- * would silently hide older sessions from a project with a large global history.
94
- */
95
- export declare function discoverAllNativeSessions(runner: RunnerName): Promise<readonly NativeSessionHistory[]>;
96
- /** Reads one already-discovered external session again to follow appended JSONL records. */
97
- export declare function readNativeSession(runner: RunnerName, workspacePath: string, externalSessionId: string, page?: {
98
- readonly snapshotEnd: number;
99
- readonly nextEnd: number;
100
- readonly fileAnchor: string;
101
- readonly anchorBytes: number;
102
- readonly readLimit?: number;
103
- }, limit?: number): Promise<NativeSessionHistory | undefined>;
104
- /**
105
- * Codex records the most recent prompt token count alongside the model context
106
- * window in `event_msg/token_count`. Read only the tail of an already
107
- * discovered transcript: the count is append-only and never needs a costly
108
- * full-history scan.
109
- */
110
- export declare function readCodexNativeContextUsage(workspacePath: string, externalSessionId: string): Promise<NativeCodexContextUsage | undefined>;
111
- /** Reads the latest actual Claude prompt occupancy without starting a CLI/SDK control stream. */
112
- export declare function readClaudeNativeContextUsage(workspacePath: string, externalSessionId: string, options?: {
113
- readonly environment?: NodeJS.ProcessEnv;
114
- readonly settingsPath?: string;
115
- }): Promise<NativeClaudeContextUsage | undefined>;
116
- export declare function claudeContextWindowTokens(options?: {
117
- readonly environment?: NodeJS.ProcessEnv;
118
- readonly settingsPath?: string;
119
- }): Promise<number>;
120
- /**
121
- * Permanently removes exactly one previously discovered transcript. The
122
- * caller supplies no path: the in-process discovery index resolves it, then
123
- * the record is re-read and its runner/cwd/native ID are checked again before
124
- * unlinking. This keeps a destructive operation bounded to one known file.
125
- */
126
- export declare function removeNativeSession(runner: RunnerName, workspacePath: string, externalSessionId: string): Promise<void>;
@@ -1,33 +0,0 @@
1
- export interface OpenCodeProbe {
2
- readonly available: boolean;
3
- readonly compatible: boolean;
4
- readonly version?: string;
5
- }
6
- export interface OpenCodeProviderCatalog {
7
- readonly connected?: readonly string[];
8
- readonly default?: Readonly<Record<string, string>>;
9
- readonly all?: readonly {
10
- readonly id?: string;
11
- readonly name?: string;
12
- readonly source?: 'env' | 'config' | 'custom' | 'api';
13
- readonly models?: Readonly<Record<string, {
14
- readonly id?: string;
15
- readonly name?: string;
16
- readonly variants?: Readonly<Record<string, {
17
- readonly disabled?: boolean;
18
- }>>;
19
- readonly limit?: {
20
- readonly context?: number;
21
- };
22
- }>>;
23
- }[];
24
- }
25
- export interface OpenCodeProfileModel {
26
- readonly id: string;
27
- readonly label: string;
28
- readonly supportedEfforts: string[];
29
- }
30
- export declare function probeOpenCode(command?: string): OpenCodeProbe;
31
- export declare function probeOpenCodeAsync(command?: string): Promise<OpenCodeProbe>;
32
- export declare function openCodeProfileModels(catalog: OpenCodeProviderCatalog): OpenCodeProfileModel[];
33
- export declare function openCodeContextLimits(catalog: OpenCodeProviderCatalog): ReadonlyMap<string, number>;
@@ -1,49 +0,0 @@
1
- import { spawn } from 'node:child_process';
2
- import type { OpenCodeProviderCatalog } from './opencode-runtime.js';
3
- export interface OpenCodeServerOptions {
4
- readonly command?: string;
5
- readonly startTimeoutMs?: number;
6
- readonly spawnProcess?: typeof spawn;
7
- }
8
- export declare class OpenCodeServerClient {
9
- private readonly options;
10
- private child;
11
- private client;
12
- private starting;
13
- private environment;
14
- constructor(options?: OpenCodeServerOptions);
15
- configureEnvironment(environment: Readonly<Record<string, string>>): void;
16
- start(): Promise<void>;
17
- private startServer;
18
- providers(directory: string): Promise<OpenCodeProviderCatalog>;
19
- configureMcp(directory: string, mcp: unknown): Promise<void>;
20
- sessions(directory: string, limit?: number): Promise<readonly unknown[]>;
21
- sessionStatus(directory: string): Promise<Readonly<Record<string, unknown>>>;
22
- createSession(directory: string, title?: string): Promise<unknown>;
23
- forkSession(directory: string, sessionID: string, messageID: string): Promise<unknown>;
24
- messages(directory: string, sessionID: string, limit?: number): Promise<readonly unknown[]>;
25
- updateSession(directory: string, sessionID: string, title: string): Promise<unknown>;
26
- deleteSession(directory: string, sessionID: string): Promise<unknown>;
27
- abort(directory: string, sessionID: string): Promise<unknown>;
28
- summarize(directory: string, sessionID: string, model: string): Promise<unknown>;
29
- replyPermission(directory: string, requestID: string, decision: 'APPROVED' | 'REJECTED'): Promise<unknown>;
30
- replyQuestion(directory: string, requestID: string, answers: readonly (readonly string[])[]): Promise<unknown>;
31
- rejectQuestion(directory: string, requestID: string): Promise<unknown>;
32
- prompt(input: {
33
- readonly directory: string;
34
- readonly sessionID: string;
35
- readonly text: string;
36
- readonly model: string;
37
- readonly variant?: string;
38
- readonly agent?: 'plan' | 'build';
39
- readonly system?: string;
40
- readonly attachments?: readonly {
41
- readonly name: string;
42
- readonly mime: 'image/png' | 'image/jpeg' | 'image/gif' | 'image/webp';
43
- readonly dataBase64: string;
44
- }[];
45
- }): Promise<unknown>;
46
- subscribe(directory: string, signal: AbortSignal, onEvent: (event: unknown) => void, onReady?: () => void): Promise<void>;
47
- stop(): Promise<void>;
48
- private requireClient;
49
- }
@@ -1,39 +0,0 @@
1
- export interface RunnerProbeResult {
2
- readonly status: number | null;
3
- readonly stdout: string;
4
- readonly stderr: string;
5
- }
6
- export declare function runRunnerProbe(command: string, args: readonly string[], options: {
7
- readonly env?: NodeJS.ProcessEnv;
8
- readonly timeoutMs: number;
9
- }): Promise<RunnerProbeResult>;
10
- export interface NodeMetricSnapshot {
11
- readonly connectionAttempts: number;
12
- readonly reconnects: number;
13
- readonly heartbeats: number;
14
- readonly runnerFailures: number;
15
- }
16
- export declare class NodeMetrics {
17
- private connectionAttempts;
18
- private reconnects;
19
- private heartbeats;
20
- private runnerFailures;
21
- connectedAttempt(): void;
22
- reconnectScheduled(): void;
23
- heartbeatSent(): void;
24
- runnerFailed(): void;
25
- snapshot(): NodeMetricSnapshot;
26
- }
27
- export declare function redactLogValue(value: unknown): unknown;
28
- export declare function minimalRunnerEnvironment(input?: NodeJS.ProcessEnv): Record<string, string>;
29
- /** Windows npm CLIs are `.cmd` shims and require the controlled command processor path. */
30
- export declare function platformCliCommand(command: string, platform?: NodeJS.Platform): string;
31
- /**
32
- * Runs only Node-owned CLI arguments through Windows' command processor so npm
33
- * `.cmd` shims work without enabling `shell: true` on the actual child process.
34
- */
35
- export declare function platformCliInvocation(command: string, args: readonly string[], platform?: NodeJS.Platform, comspec?: string): {
36
- readonly command: string;
37
- readonly args: readonly string[];
38
- };
39
- export declare function nodeLog(event: string, fields?: Record<string, unknown>): void;