remote-codex 0.1.5 → 0.1.7
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.
- package/apps/supervisor-api/dist/index.js +7749 -5501
- package/apps/supervisor-web/dist/assets/{highlighted-body-OFNGDK62-D-RjOTTL.js → highlighted-body-OFNGDK62-0cYcfOfd.js} +1 -1
- package/apps/supervisor-web/dist/assets/index-CbIt0KnL.css +32 -0
- package/apps/supervisor-web/dist/assets/index-nH6a8Wwn.js +377 -0
- package/apps/supervisor-web/dist/assets/{xterm-D8iZbRww.js → xterm-DisVWgDR.js} +1 -1
- package/apps/supervisor-web/dist/index.html +2 -2
- package/package.json +5 -1
- package/packages/agent-runtime/src/index.ts +2 -0
- package/packages/agent-runtime/src/registry.ts +44 -0
- package/packages/agent-runtime/src/types.ts +531 -0
- package/packages/codex/src/appServerManager.test.ts +328 -0
- package/packages/codex/src/appServerManager.ts +656 -0
- package/packages/codex/src/historyItems.ts +1185 -0
- package/packages/codex/src/hookHistory.ts +224 -0
- package/packages/codex/src/index.ts +6 -0
- package/packages/codex/src/jsonrpc.test.ts +58 -0
- package/packages/codex/src/jsonrpc.ts +198 -0
- package/packages/codex/src/requestMapper.test.ts +127 -0
- package/packages/codex/src/requestMapper.ts +511 -0
- package/packages/codex/src/runtimeAdapter.ts +692 -0
- package/packages/codex/src/types.ts +403 -0
- package/packages/db/migrations/0014_thread_history_items.sql +12 -0
- package/packages/db/migrations/0015_agent_provider_fields.sql +14 -0
- package/packages/db/migrations/0016_remove_codex_thread_goal_id.sql +46 -0
- package/packages/db/migrations/0017_remove_codex_thread_columns.sql +85 -0
- package/packages/db/src/client.ts +53 -0
- package/packages/db/src/index.ts +5 -0
- package/packages/db/src/migrate.test.ts +36 -0
- package/packages/db/src/migrate.ts +84 -0
- package/packages/db/src/repositories.ts +893 -0
- package/packages/db/src/schema.ts +177 -0
- package/packages/db/src/seed.ts +51 -0
- package/packages/shared/src/index.ts +878 -0
- package/scripts/service-manager.mjs +6 -4
- package/apps/supervisor-web/dist/assets/index-CdG3ogmZ.js +0 -376
- package/apps/supervisor-web/dist/assets/index-QM8NQf3e.css +0 -32
|
@@ -0,0 +1,878 @@
|
|
|
1
|
+
export type ApiErrorCode =
|
|
2
|
+
| 'bad_request'
|
|
3
|
+
| 'not_found'
|
|
4
|
+
| 'conflict'
|
|
5
|
+
| 'codex_goal_error'
|
|
6
|
+
| 'forbidden'
|
|
7
|
+
| 'goal_feature_disabled'
|
|
8
|
+
| 'internal_error'
|
|
9
|
+
| 'service_unavailable';
|
|
10
|
+
|
|
11
|
+
export interface ApiErrorShape {
|
|
12
|
+
code: ApiErrorCode;
|
|
13
|
+
message: string;
|
|
14
|
+
details?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RuntimeConfigDto {
|
|
18
|
+
appName: string;
|
|
19
|
+
appVersion: string;
|
|
20
|
+
host: string;
|
|
21
|
+
port: number;
|
|
22
|
+
workspaceRoot: string;
|
|
23
|
+
environment: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type AgentBackendIdDto = 'codex' | 'claude';
|
|
27
|
+
|
|
28
|
+
export interface AgentRuntimeStatusDto {
|
|
29
|
+
state: 'starting' | 'ready' | 'degraded' | 'stopped' | 'failed';
|
|
30
|
+
transport: 'stdio' | 'sdk' | 'none';
|
|
31
|
+
lastStartedAt: string | null;
|
|
32
|
+
lastError: string | null;
|
|
33
|
+
restartCount: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface AgentProviderCapabilitiesDto {
|
|
37
|
+
sessions: {
|
|
38
|
+
list: boolean;
|
|
39
|
+
read: boolean;
|
|
40
|
+
resume: boolean;
|
|
41
|
+
importLocal: boolean;
|
|
42
|
+
};
|
|
43
|
+
turns: {
|
|
44
|
+
start: boolean;
|
|
45
|
+
streamInput: boolean;
|
|
46
|
+
steer: boolean;
|
|
47
|
+
interrupt: boolean;
|
|
48
|
+
compact: boolean;
|
|
49
|
+
};
|
|
50
|
+
branching: {
|
|
51
|
+
fork: boolean;
|
|
52
|
+
hardRollback: boolean;
|
|
53
|
+
resumeAt: boolean;
|
|
54
|
+
rewindFiles: boolean;
|
|
55
|
+
};
|
|
56
|
+
controls: {
|
|
57
|
+
planMode: boolean;
|
|
58
|
+
permissionRequests: boolean;
|
|
59
|
+
sandboxMode: boolean;
|
|
60
|
+
fastServiceTier: boolean;
|
|
61
|
+
goals: boolean;
|
|
62
|
+
};
|
|
63
|
+
management: {
|
|
64
|
+
models: boolean;
|
|
65
|
+
mcpStatus: boolean;
|
|
66
|
+
skills: boolean;
|
|
67
|
+
hooks: boolean;
|
|
68
|
+
hookTrust: boolean;
|
|
69
|
+
hostConfigFiles: boolean;
|
|
70
|
+
providerSettings: boolean;
|
|
71
|
+
};
|
|
72
|
+
usage: {
|
|
73
|
+
contextWindow: boolean;
|
|
74
|
+
tokenUsage: boolean;
|
|
75
|
+
costUsd: boolean;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface AgentBackendDto {
|
|
80
|
+
provider: AgentBackendIdDto;
|
|
81
|
+
displayName: string;
|
|
82
|
+
description: string;
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
isDefault: boolean;
|
|
85
|
+
status: AgentRuntimeStatusDto;
|
|
86
|
+
capabilities: AgentProviderCapabilitiesDto;
|
|
87
|
+
managementSchema: AgentBackendManagementSchemaDto;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface AgentBackendConfigFileSchemaDto {
|
|
91
|
+
name: string;
|
|
92
|
+
label: string;
|
|
93
|
+
description: string;
|
|
94
|
+
roles?: Array<'runtime' | 'auth' | 'mcp' | 'hooks' | 'providerSettings'>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export type AgentBackendToolboxActionDto =
|
|
98
|
+
| 'fast'
|
|
99
|
+
| 'compact'
|
|
100
|
+
| 'goal'
|
|
101
|
+
| 'fork'
|
|
102
|
+
| 'skills'
|
|
103
|
+
| 'mcp'
|
|
104
|
+
| 'hooks';
|
|
105
|
+
|
|
106
|
+
export interface AgentBackendToolboxItemSchemaDto {
|
|
107
|
+
action: AgentBackendToolboxActionDto;
|
|
108
|
+
command: string;
|
|
109
|
+
label: string;
|
|
110
|
+
description?: string | null;
|
|
111
|
+
panel?: 'fork' | 'skills' | 'mcp' | 'hooks' | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface AgentBackendHookCommandTemplateDto {
|
|
115
|
+
eventName: AgentHookEventNameDto;
|
|
116
|
+
command: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface AgentBackendManagementSchemaDto {
|
|
120
|
+
hostConfigFiles: AgentBackendConfigFileSchemaDto[];
|
|
121
|
+
toolboxItems: AgentBackendToolboxItemSchemaDto[];
|
|
122
|
+
hookCommandTemplates: AgentBackendHookCommandTemplateDto[];
|
|
123
|
+
configArchives: boolean;
|
|
124
|
+
buildRestart: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export interface ModelOptionDto {
|
|
128
|
+
id: string;
|
|
129
|
+
model: string;
|
|
130
|
+
displayName: string;
|
|
131
|
+
description: string;
|
|
132
|
+
isDefault: boolean;
|
|
133
|
+
hidden: boolean;
|
|
134
|
+
supportedReasoningEfforts: ReasoningEffortOptionDto[];
|
|
135
|
+
defaultReasoningEffort: ReasoningEffortDto;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface VersionDto {
|
|
139
|
+
name: string;
|
|
140
|
+
version: string;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface HealthDto {
|
|
144
|
+
status: 'ok';
|
|
145
|
+
timestamp: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export type ProviderHostFileNameDto = string;
|
|
149
|
+
|
|
150
|
+
export interface ProviderHostFileDto {
|
|
151
|
+
name: ProviderHostFileNameDto;
|
|
152
|
+
path: string;
|
|
153
|
+
exists: boolean;
|
|
154
|
+
content: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface UpdateProviderHostFileInput {
|
|
158
|
+
content: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface ProviderHostConfigArchiveFileDto {
|
|
162
|
+
name: ProviderHostFileNameDto;
|
|
163
|
+
exists: boolean;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface ProviderHostConfigArchiveDto {
|
|
167
|
+
id: string;
|
|
168
|
+
label: string;
|
|
169
|
+
createdAt: string;
|
|
170
|
+
updatedAt: string;
|
|
171
|
+
files: Record<string, ProviderHostConfigArchiveFileDto>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface CreateProviderHostConfigArchiveInput {
|
|
175
|
+
label?: string;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export interface RenameProviderHostConfigArchiveInput {
|
|
179
|
+
label: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface ApplyProviderHostConfigArchiveResultDto {
|
|
183
|
+
archive: ProviderHostConfigArchiveDto;
|
|
184
|
+
status: AgentRuntimeStatusDto;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface WorkspaceDto {
|
|
188
|
+
id: string;
|
|
189
|
+
hostId: string;
|
|
190
|
+
label: string;
|
|
191
|
+
absPath: string;
|
|
192
|
+
isFavorite: boolean;
|
|
193
|
+
createdAt: string;
|
|
194
|
+
lastOpenedAt: string | null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface CreateWorkspaceFromPathInput {
|
|
198
|
+
absPath: string;
|
|
199
|
+
label?: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface CreateWorkspaceFromGitInput {
|
|
203
|
+
gitUrl: string;
|
|
204
|
+
label?: string;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type CreateWorkspaceInput = CreateWorkspaceFromPathInput | CreateWorkspaceFromGitInput;
|
|
208
|
+
|
|
209
|
+
export interface WorkspaceSettingsDto {
|
|
210
|
+
workspaceRoot: string;
|
|
211
|
+
devHome: string;
|
|
212
|
+
defaultBackend: AgentBackendIdDto;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface UpdateWorkspaceSettingsInput {
|
|
216
|
+
devHome: string;
|
|
217
|
+
defaultBackend?: AgentBackendIdDto;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export interface UpdateWorkspaceInput {
|
|
221
|
+
label: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export type ThreadSourceDto = 'supervisor' | 'local_codex_import';
|
|
225
|
+
|
|
226
|
+
export interface UpdateWorkspaceFavoriteInput {
|
|
227
|
+
isFavorite: boolean;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface WorkspaceTreeNodeDto {
|
|
231
|
+
name: string;
|
|
232
|
+
absPath: string;
|
|
233
|
+
kind: 'file' | 'directory';
|
|
234
|
+
hasChildren: boolean;
|
|
235
|
+
isHidden: boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface WorkspaceTreeDto {
|
|
239
|
+
rootPath: string;
|
|
240
|
+
currentPath: string;
|
|
241
|
+
nodes: WorkspaceTreeNodeDto[];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export type ApprovalMode = 'yolo' | 'guarded';
|
|
245
|
+
export type ReasoningEffortDto = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
246
|
+
export type CollaborationModeDto = 'default' | 'plan';
|
|
247
|
+
export type SandboxModeDto = 'read-only' | 'workspace-write' | 'danger-full-access';
|
|
248
|
+
|
|
249
|
+
export interface ReasoningEffortOptionDto {
|
|
250
|
+
reasoningEffort: ReasoningEffortDto;
|
|
251
|
+
description: string;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export type ThreadStatusDto =
|
|
255
|
+
| 'idle'
|
|
256
|
+
| 'running'
|
|
257
|
+
| 'interrupted'
|
|
258
|
+
| 'failed'
|
|
259
|
+
| 'not_loaded'
|
|
260
|
+
| 'system_error';
|
|
261
|
+
|
|
262
|
+
export interface ThreadContextUsageDto {
|
|
263
|
+
availability: 'available' | 'unavailable';
|
|
264
|
+
remainingPercent: number | null;
|
|
265
|
+
tokensInContextWindow: number | null;
|
|
266
|
+
modelContextWindow: number | null;
|
|
267
|
+
updatedAt: string | null;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export interface ThreadDto {
|
|
271
|
+
id: string;
|
|
272
|
+
workspaceId: string;
|
|
273
|
+
provider: AgentBackendIdDto;
|
|
274
|
+
providerSessionId: string | null;
|
|
275
|
+
source: ThreadSourceDto;
|
|
276
|
+
title: string;
|
|
277
|
+
model: string | null;
|
|
278
|
+
reasoningEffort: ReasoningEffortDto | null;
|
|
279
|
+
fastMode?: boolean;
|
|
280
|
+
collaborationMode: CollaborationModeDto;
|
|
281
|
+
approvalMode: ApprovalMode;
|
|
282
|
+
sandboxMode?: SandboxModeDto | null;
|
|
283
|
+
status: ThreadStatusDto;
|
|
284
|
+
summaryText: string | null;
|
|
285
|
+
lastError: string | null;
|
|
286
|
+
activeTurnId: string | null;
|
|
287
|
+
isLoaded: boolean;
|
|
288
|
+
isPinned: boolean;
|
|
289
|
+
createdAt: string;
|
|
290
|
+
updatedAt: string;
|
|
291
|
+
lastTurnStartedAt: string | null;
|
|
292
|
+
lastTurnCompletedAt: string | null;
|
|
293
|
+
contextUsage?: ThreadContextUsageDto;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface ThreadHistoryItemDto {
|
|
297
|
+
id: string;
|
|
298
|
+
kind:
|
|
299
|
+
| 'userMessage'
|
|
300
|
+
| 'agentMessage'
|
|
301
|
+
| 'image'
|
|
302
|
+
| 'plan'
|
|
303
|
+
| 'contextCompaction'
|
|
304
|
+
| 'reasoning'
|
|
305
|
+
| 'commandExecution'
|
|
306
|
+
| 'webSearch'
|
|
307
|
+
| 'fileChange'
|
|
308
|
+
| 'hook'
|
|
309
|
+
| 'toolCall'
|
|
310
|
+
| 'other';
|
|
311
|
+
text: string;
|
|
312
|
+
previewText?: string;
|
|
313
|
+
detailText?: string | null;
|
|
314
|
+
hasDeferredDetail?: boolean | null;
|
|
315
|
+
sequence?: number | null;
|
|
316
|
+
status?: string | null;
|
|
317
|
+
assetPath?: string | null;
|
|
318
|
+
changedFiles?: number | null;
|
|
319
|
+
addedLines?: number | null;
|
|
320
|
+
removedLines?: number | null;
|
|
321
|
+
hookEventName?: string | null;
|
|
322
|
+
hookEventLabel?: string | null;
|
|
323
|
+
hookHandlerType?: string | null;
|
|
324
|
+
hookScope?: string | null;
|
|
325
|
+
hookSource?: string | null;
|
|
326
|
+
hookSourcePath?: string | null;
|
|
327
|
+
hookStatusMessage?: string | null;
|
|
328
|
+
hookOutputEntries?: Array<{
|
|
329
|
+
kind: string;
|
|
330
|
+
text: string;
|
|
331
|
+
}> | null;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export interface ThreadHistoryItemDetailDto {
|
|
335
|
+
id: string;
|
|
336
|
+
kind: ThreadHistoryItemDto['kind'];
|
|
337
|
+
title: string;
|
|
338
|
+
text: string;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface ThreadTurnTokenBreakdownDto {
|
|
342
|
+
totalTokens: number;
|
|
343
|
+
inputTokens: number;
|
|
344
|
+
cachedInputTokens: number;
|
|
345
|
+
outputTokens: number;
|
|
346
|
+
reasoningOutputTokens: number;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export interface ThreadTurnTokenUsageDto {
|
|
350
|
+
total: ThreadTurnTokenBreakdownDto;
|
|
351
|
+
last: ThreadTurnTokenBreakdownDto;
|
|
352
|
+
modelContextWindow: number | null;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export type ThreadTurnPricingTierDto = 'standard' | 'fast';
|
|
356
|
+
|
|
357
|
+
export interface ThreadTurnPriceEstimateDto {
|
|
358
|
+
pricingModelKey: string;
|
|
359
|
+
pricingTierKey: ThreadTurnPricingTierDto;
|
|
360
|
+
currency: 'USD';
|
|
361
|
+
inputUsd: number;
|
|
362
|
+
cachedInputUsd: number;
|
|
363
|
+
outputUsd: number;
|
|
364
|
+
totalUsd: number;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export interface ThreadTurnDto {
|
|
368
|
+
id: string;
|
|
369
|
+
startedAt: string | null;
|
|
370
|
+
status: 'completed' | 'interrupted' | 'failed' | 'inProgress';
|
|
371
|
+
error: string | null;
|
|
372
|
+
model?: string | null;
|
|
373
|
+
reasoningEffort?: ReasoningEffortDto | null;
|
|
374
|
+
reasoningEffortAvailable?: boolean | null;
|
|
375
|
+
tokenUsage?: ThreadTurnTokenUsageDto | null;
|
|
376
|
+
priceEstimate?: ThreadTurnPriceEstimateDto | null;
|
|
377
|
+
items: ThreadHistoryItemDto[];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export interface ThreadActionQuestionOptionDto {
|
|
381
|
+
label: string;
|
|
382
|
+
description: string;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
export interface ThreadActionQuestionDto {
|
|
386
|
+
id: string;
|
|
387
|
+
header: string;
|
|
388
|
+
question: string;
|
|
389
|
+
isOther: boolean;
|
|
390
|
+
isSecret: boolean;
|
|
391
|
+
options: ThreadActionQuestionOptionDto[] | null;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
export interface ThreadActionRequestDto {
|
|
395
|
+
id: string;
|
|
396
|
+
kind: 'requestUserInput' | 'planDecision';
|
|
397
|
+
title: string;
|
|
398
|
+
description: string | null;
|
|
399
|
+
turnId: string | null;
|
|
400
|
+
itemId: string | null;
|
|
401
|
+
createdAt: string;
|
|
402
|
+
questions: ThreadActionQuestionDto[];
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export interface ThreadAnsweredRequestNoteDto {
|
|
406
|
+
id: string;
|
|
407
|
+
turnId: string | null;
|
|
408
|
+
title: string;
|
|
409
|
+
summaryLines: string[];
|
|
410
|
+
createdAt: string;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
export interface ThreadActivityNoteDto {
|
|
414
|
+
id: string;
|
|
415
|
+
kind: 'fastMode' | 'forkCreated' | 'forkSource';
|
|
416
|
+
createdAt: string;
|
|
417
|
+
text?: string;
|
|
418
|
+
anchorTurnId?: string | null;
|
|
419
|
+
linkedThreadId?: string;
|
|
420
|
+
linkedThreadTitle?: string | null;
|
|
421
|
+
turnIndex?: number | null;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export type AgentSkillScopeDto = 'user' | 'repo' | 'system' | 'admin';
|
|
425
|
+
|
|
426
|
+
export interface AgentSkillInterfaceDto {
|
|
427
|
+
displayName?: string;
|
|
428
|
+
shortDescription?: string;
|
|
429
|
+
brandColor?: string;
|
|
430
|
+
defaultPrompt?: string;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface AgentSkillDto {
|
|
434
|
+
name: string;
|
|
435
|
+
description: string;
|
|
436
|
+
shortDescription?: string;
|
|
437
|
+
interface?: AgentSkillInterfaceDto;
|
|
438
|
+
path: string;
|
|
439
|
+
scope: AgentSkillScopeDto;
|
|
440
|
+
enabled: boolean;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export interface AgentSkillErrorDto {
|
|
444
|
+
path: string;
|
|
445
|
+
message: string;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export interface ThreadSkillsDto {
|
|
449
|
+
cwd: string;
|
|
450
|
+
skills: AgentSkillDto[];
|
|
451
|
+
errors: AgentSkillErrorDto[];
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export type AgentMcpAuthStatusDto =
|
|
455
|
+
| 'unsupported'
|
|
456
|
+
| 'notLoggedIn'
|
|
457
|
+
| 'bearerToken'
|
|
458
|
+
| 'oAuth';
|
|
459
|
+
|
|
460
|
+
export interface AgentMcpToolDto {
|
|
461
|
+
name: string;
|
|
462
|
+
title: string | null;
|
|
463
|
+
description: string | null;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
export interface AgentMcpServerDto {
|
|
467
|
+
name: string;
|
|
468
|
+
authStatus: AgentMcpAuthStatusDto;
|
|
469
|
+
tools: AgentMcpToolDto[];
|
|
470
|
+
resourceCount: number;
|
|
471
|
+
resourceTemplateCount: number;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export interface ThreadMcpServersDto {
|
|
475
|
+
servers: AgentMcpServerDto[];
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export type AgentHookEventNameDto =
|
|
479
|
+
| 'preToolUse'
|
|
480
|
+
| 'permissionRequest'
|
|
481
|
+
| 'postToolUse'
|
|
482
|
+
| 'preCompact'
|
|
483
|
+
| 'postCompact'
|
|
484
|
+
| 'sessionStart'
|
|
485
|
+
| 'userPromptSubmit'
|
|
486
|
+
| 'stop';
|
|
487
|
+
|
|
488
|
+
export type AgentHookHandlerTypeDto = 'command' | 'prompt' | 'agent';
|
|
489
|
+
export type AgentHookSourceDto =
|
|
490
|
+
| 'system'
|
|
491
|
+
| 'user'
|
|
492
|
+
| 'project'
|
|
493
|
+
| 'mdm'
|
|
494
|
+
| 'sessionFlags'
|
|
495
|
+
| 'plugin'
|
|
496
|
+
| 'cloudRequirements'
|
|
497
|
+
| 'legacyManagedConfigFile'
|
|
498
|
+
| 'legacyManagedConfigMdm'
|
|
499
|
+
| 'unknown';
|
|
500
|
+
export type AgentHookTrustStatusDto = 'managed' | 'untrusted' | 'trusted' | 'modified';
|
|
501
|
+
|
|
502
|
+
export interface AgentHookDto {
|
|
503
|
+
key: string;
|
|
504
|
+
eventName: AgentHookEventNameDto;
|
|
505
|
+
handlerType: AgentHookHandlerTypeDto;
|
|
506
|
+
matcher: string | null;
|
|
507
|
+
command: string | null;
|
|
508
|
+
timeoutSec: number;
|
|
509
|
+
statusMessage: string | null;
|
|
510
|
+
sourcePath: string;
|
|
511
|
+
source: AgentHookSourceDto;
|
|
512
|
+
pluginId: string | null;
|
|
513
|
+
displayOrder: number;
|
|
514
|
+
enabled: boolean;
|
|
515
|
+
isManaged: boolean;
|
|
516
|
+
currentHash: string;
|
|
517
|
+
trustStatus: AgentHookTrustStatusDto;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export interface AgentHookErrorDto {
|
|
521
|
+
path: string;
|
|
522
|
+
message: string;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export interface ThreadHooksDto {
|
|
526
|
+
cwd: string;
|
|
527
|
+
hooks: AgentHookDto[];
|
|
528
|
+
warnings: string[];
|
|
529
|
+
errors: AgentHookErrorDto[];
|
|
530
|
+
globalHooksPath: string;
|
|
531
|
+
projectHooksPath: string;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export interface CreateThreadHookInput {
|
|
535
|
+
scope: 'global' | 'project';
|
|
536
|
+
eventName: AgentHookEventNameDto;
|
|
537
|
+
matcher?: string | null;
|
|
538
|
+
command: string;
|
|
539
|
+
timeoutSec?: number | null;
|
|
540
|
+
statusMessage?: string | null;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export interface ThreadHookTargetInput {
|
|
544
|
+
scope: 'global' | 'project';
|
|
545
|
+
eventName: AgentHookEventNameDto;
|
|
546
|
+
matcher?: string | null;
|
|
547
|
+
command: string;
|
|
548
|
+
timeoutSec?: number | null;
|
|
549
|
+
statusMessage?: string | null;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
export interface UpdateThreadHookInput extends CreateThreadHookInput {
|
|
553
|
+
target: ThreadHookTargetInput;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
export interface TrustThreadHookInput {
|
|
557
|
+
key: string;
|
|
558
|
+
currentHash: string;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
export interface UntrustThreadHookInput {
|
|
562
|
+
key: string;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export type ThreadGoalStatusDto =
|
|
566
|
+
| 'active'
|
|
567
|
+
| 'paused'
|
|
568
|
+
| 'budgetLimited'
|
|
569
|
+
| 'complete'
|
|
570
|
+
| 'terminated';
|
|
571
|
+
|
|
572
|
+
export interface ThreadGoalDto {
|
|
573
|
+
threadId: string;
|
|
574
|
+
localGoalId?: string | null;
|
|
575
|
+
objective: string;
|
|
576
|
+
status: ThreadGoalStatusDto;
|
|
577
|
+
tokenBudget: number | null;
|
|
578
|
+
tokensUsed: number;
|
|
579
|
+
timeUsedSeconds: number;
|
|
580
|
+
createdAt: string;
|
|
581
|
+
updatedAt: string;
|
|
582
|
+
completedAt?: string | null;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
export interface UpdateThreadGoalInput {
|
|
586
|
+
objective?: string | null;
|
|
587
|
+
status?: ThreadGoalStatusDto | null;
|
|
588
|
+
tokenBudget?: number | null;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
export interface ThreadLivePlanDto {
|
|
592
|
+
turnId: string;
|
|
593
|
+
explanation: string | null;
|
|
594
|
+
plan: Array<{ step: string; status: string }>;
|
|
595
|
+
updatedAt: string;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export interface ThreadPendingSteerDto {
|
|
599
|
+
id: string;
|
|
600
|
+
clientRequestId: string | null;
|
|
601
|
+
turnId: string;
|
|
602
|
+
prompt: string;
|
|
603
|
+
createdAt: string;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export interface ThreadLiveItemsDto {
|
|
607
|
+
turnId: string;
|
|
608
|
+
items: ThreadHistoryItemDto[];
|
|
609
|
+
updatedAt: string;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
export interface ThreadDetailDto {
|
|
613
|
+
thread: ThreadDto;
|
|
614
|
+
workspace: WorkspaceDto;
|
|
615
|
+
workspacePathStatus: 'present' | 'missing';
|
|
616
|
+
turns: ThreadTurnDto[];
|
|
617
|
+
totalTurnCount?: number;
|
|
618
|
+
pendingRequests: ThreadActionRequestDto[];
|
|
619
|
+
pendingSteers: ThreadPendingSteerDto[];
|
|
620
|
+
answeredRequestNotes?: ThreadAnsweredRequestNoteDto[];
|
|
621
|
+
activityNotes?: ThreadActivityNoteDto[];
|
|
622
|
+
goal?: ThreadGoalDto | null;
|
|
623
|
+
goalHistory?: ThreadGoalDto[];
|
|
624
|
+
livePlan?: ThreadLivePlanDto | null;
|
|
625
|
+
liveItems?: ThreadLiveItemsDto | null;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export interface ThreadExportTurnOptionDto {
|
|
629
|
+
turnId: string;
|
|
630
|
+
turnNumber: number;
|
|
631
|
+
startedAt: string | null;
|
|
632
|
+
status: ThreadTurnDto['status'];
|
|
633
|
+
userPromptPreview: string;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export interface ThreadExportTurnOptionsDto {
|
|
637
|
+
turns: ThreadExportTurnOptionDto[];
|
|
638
|
+
totalTurnCount: number;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
export type ThreadExportPdfModeDto = 'latest' | 'selected';
|
|
642
|
+
export type ThreadExportPdfProfileDto = 'review' | 'technical';
|
|
643
|
+
export type ThreadExportFormatDto = 'pdf' | 'html';
|
|
644
|
+
|
|
645
|
+
export interface ExportThreadPdfInput {
|
|
646
|
+
format?: ThreadExportFormatDto;
|
|
647
|
+
mode: ThreadExportPdfModeDto;
|
|
648
|
+
limit?: number;
|
|
649
|
+
turnIds?: string[];
|
|
650
|
+
profile?: ThreadExportPdfProfileDto;
|
|
651
|
+
options?: {
|
|
652
|
+
includeTokenAndPrice?: boolean;
|
|
653
|
+
includeCommandOutput?: boolean;
|
|
654
|
+
includeAbsolutePaths?: boolean;
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export interface ThreadForkTurnOptionDto {
|
|
659
|
+
turnId: string;
|
|
660
|
+
turnIndex: number;
|
|
661
|
+
startedAt: string | null;
|
|
662
|
+
status: ThreadTurnDto['status'];
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
export interface ForkThreadInput {
|
|
666
|
+
mode: 'latest' | 'turn';
|
|
667
|
+
turnId?: string;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export interface ThreadForkResultDto {
|
|
671
|
+
thread: ThreadDetailDto;
|
|
672
|
+
sourceThreadId: string;
|
|
673
|
+
sourceTurnId: string | null;
|
|
674
|
+
sourceTurnIndex: number | null;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
export type ShellStatusDto =
|
|
678
|
+
| 'not_created'
|
|
679
|
+
| 'creating'
|
|
680
|
+
| 'running'
|
|
681
|
+
| 'attached'
|
|
682
|
+
| 'detached'
|
|
683
|
+
| 'exited'
|
|
684
|
+
| 'not_found'
|
|
685
|
+
| 'workspace_missing';
|
|
686
|
+
|
|
687
|
+
export interface ShellSessionDto {
|
|
688
|
+
id: string;
|
|
689
|
+
threadId: string;
|
|
690
|
+
workspaceId: string;
|
|
691
|
+
tmuxSessionName: string;
|
|
692
|
+
cwd: string;
|
|
693
|
+
status: Exclude<ShellStatusDto, 'not_created' | 'workspace_missing'>;
|
|
694
|
+
attachedViewerId: string | null;
|
|
695
|
+
createdAt: string;
|
|
696
|
+
updatedAt: string;
|
|
697
|
+
lastActivityAt: string | null;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
export interface ThreadShellStateDto {
|
|
701
|
+
threadId: string;
|
|
702
|
+
workspaceId: string;
|
|
703
|
+
workspacePathStatus: 'present' | 'missing';
|
|
704
|
+
state: ShellStatusDto;
|
|
705
|
+
shell: ShellSessionDto | null;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
export interface ShellCreateInput {
|
|
709
|
+
cols?: number;
|
|
710
|
+
rows?: number;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
export interface ShellAttachInput {
|
|
714
|
+
cols: number;
|
|
715
|
+
rows: number;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export interface ShellDetachInput {
|
|
719
|
+
viewerId: string;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
export interface ShellInputInput {
|
|
723
|
+
viewerId: string;
|
|
724
|
+
data: string;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
export interface ShellResizeInput {
|
|
728
|
+
viewerId: string;
|
|
729
|
+
cols: number;
|
|
730
|
+
rows: number;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
export interface CreateThreadInput {
|
|
734
|
+
workspaceId: string;
|
|
735
|
+
title?: string;
|
|
736
|
+
provider?: AgentBackendIdDto;
|
|
737
|
+
model: string;
|
|
738
|
+
approvalMode: ApprovalMode;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export interface UpdateThreadSettingsInput {
|
|
742
|
+
model?: string;
|
|
743
|
+
reasoningEffort?: ReasoningEffortDto | null;
|
|
744
|
+
fastMode?: boolean;
|
|
745
|
+
collaborationMode?: CollaborationModeDto;
|
|
746
|
+
sandboxMode?: SandboxModeDto | null;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export interface UpdateThreadInput {
|
|
750
|
+
title: string;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export interface ImportThreadInput {
|
|
754
|
+
sessionId: string;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
export interface SendThreadPromptInput {
|
|
758
|
+
prompt: string;
|
|
759
|
+
clientRequestId?: string;
|
|
760
|
+
model?: string;
|
|
761
|
+
reasoningEffort?: ReasoningEffortDto | null;
|
|
762
|
+
collaborationMode?: CollaborationModeDto;
|
|
763
|
+
sandboxMode?: SandboxModeDto | null;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
export type PromptAttachmentKindDto = 'photo' | 'file';
|
|
767
|
+
|
|
768
|
+
export interface PromptAttachmentManifestEntryDto {
|
|
769
|
+
clientId: string;
|
|
770
|
+
kind: PromptAttachmentKindDto;
|
|
771
|
+
originalName: string;
|
|
772
|
+
placeholder: string;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
export interface InterruptTurnInput {
|
|
776
|
+
turnId?: string;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
export interface ResumeThreadInput {
|
|
780
|
+
model?: string;
|
|
781
|
+
sandboxMode?: SandboxModeDto | null;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export interface ThreadActionRequestAnswerDto {
|
|
785
|
+
answers: string[];
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
export interface RespondThreadActionRequestInput {
|
|
789
|
+
answers: Record<string, ThreadActionRequestAnswerDto>;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export interface ThreadEventEnvelope {
|
|
793
|
+
type:
|
|
794
|
+
| 'thread.updated'
|
|
795
|
+
| 'thread.context.updated'
|
|
796
|
+
| 'thread.goal.updated'
|
|
797
|
+
| 'thread.goal.cleared'
|
|
798
|
+
| 'thread.turn.token.updated'
|
|
799
|
+
| 'thread.turn.started'
|
|
800
|
+
| 'thread.item.started'
|
|
801
|
+
| 'thread.item.completed'
|
|
802
|
+
| 'thread.plan.updated'
|
|
803
|
+
| 'thread.request.created'
|
|
804
|
+
| 'thread.request.resolved'
|
|
805
|
+
| 'thread.output.delta'
|
|
806
|
+
| 'thread.turn.completed'
|
|
807
|
+
| 'thread.turn.failed';
|
|
808
|
+
threadId: string;
|
|
809
|
+
timestamp: string;
|
|
810
|
+
payload: Record<string, unknown>;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
export interface ShellEventEnvelope {
|
|
814
|
+
type:
|
|
815
|
+
| 'shell.connected'
|
|
816
|
+
| 'shell.status'
|
|
817
|
+
| 'shell.output'
|
|
818
|
+
| 'shell.detached'
|
|
819
|
+
| 'shell.exited'
|
|
820
|
+
| 'shell.error';
|
|
821
|
+
shellId: string;
|
|
822
|
+
timestamp: string;
|
|
823
|
+
payload: Record<string, unknown>;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
export interface SupervisorConnectedEnvelope {
|
|
827
|
+
type: 'supervisor.connected';
|
|
828
|
+
timestamp: string;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export interface SupervisorPongEnvelope {
|
|
832
|
+
type: 'supervisor.pong';
|
|
833
|
+
timestamp: string;
|
|
834
|
+
payload: {
|
|
835
|
+
requestTimestamp: string | null;
|
|
836
|
+
};
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
export type SupervisorSocketServerEnvelope =
|
|
840
|
+
| SupervisorConnectedEnvelope
|
|
841
|
+
| SupervisorPongEnvelope
|
|
842
|
+
| ThreadEventEnvelope
|
|
843
|
+
| ShellEventEnvelope;
|
|
844
|
+
|
|
845
|
+
export type SupervisorSocketClientEnvelope =
|
|
846
|
+
| {
|
|
847
|
+
type: 'supervisor.ping';
|
|
848
|
+
timestamp: string;
|
|
849
|
+
}
|
|
850
|
+
| {
|
|
851
|
+
type: 'shell.attach';
|
|
852
|
+
shellId: string;
|
|
853
|
+
cols: number;
|
|
854
|
+
rows: number;
|
|
855
|
+
}
|
|
856
|
+
| {
|
|
857
|
+
type: 'shell.detach';
|
|
858
|
+
shellId: string;
|
|
859
|
+
viewerId: string;
|
|
860
|
+
}
|
|
861
|
+
| {
|
|
862
|
+
type: 'shell.input';
|
|
863
|
+
shellId: string;
|
|
864
|
+
viewerId: string;
|
|
865
|
+
data: string;
|
|
866
|
+
}
|
|
867
|
+
| {
|
|
868
|
+
type: 'shell.resize';
|
|
869
|
+
shellId: string;
|
|
870
|
+
viewerId: string;
|
|
871
|
+
cols: number;
|
|
872
|
+
rows: number;
|
|
873
|
+
}
|
|
874
|
+
| {
|
|
875
|
+
type: 'shell.clear';
|
|
876
|
+
shellId: string;
|
|
877
|
+
viewerId: string;
|
|
878
|
+
};
|