@hunsu/bridge 0.1.2 → 0.2.0-next.1
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/README.md +27 -0
- package/dist/cli.js +155 -69
- package/dist/index.d.ts +114 -1001
- package/dist/index.js +155 -7702
- package/package.json +16 -9
- package/dist/cli.d.ts +0 -2
- package/dist/execute/execute-model.d.ts +0 -50
- package/dist/execute/execute-model.js +0 -17
- package/dist/execute/execute-workflow.d.ts +0 -27
- package/dist/execute/execute-workflow.js +0 -65
- package/dist/execute/execution-plan.d.ts +0 -6
- package/dist/execute/execution-plan.js +0 -337
- package/src/cli.ts +0 -82
- package/src/execute/execute-model.ts +0 -72
- package/src/execute/execute-workflow.ts +0 -115
- package/src/execute/execution-plan.ts +0 -379
- package/src/index.ts +0 -9685
package/dist/index.d.ts
CHANGED
|
@@ -1,1001 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export type
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
providerTurnId?: string;
|
|
116
|
-
type: string;
|
|
117
|
-
status: "started" | "streaming" | "completed";
|
|
118
|
-
title: string;
|
|
119
|
-
detail?: string;
|
|
120
|
-
text?: string;
|
|
121
|
-
summary?: string[];
|
|
122
|
-
content?: string[];
|
|
123
|
-
command?: string;
|
|
124
|
-
cwd?: string;
|
|
125
|
-
commandActions?: RunnerAppServerCommandAction[];
|
|
126
|
-
output?: string;
|
|
127
|
-
changes?: unknown;
|
|
128
|
-
rawItem?: RunnerAppServerItem;
|
|
129
|
-
durationMs?: number;
|
|
130
|
-
startedAt?: string;
|
|
131
|
-
completedAt?: string;
|
|
132
|
-
updatedAt: string;
|
|
133
|
-
};
|
|
134
|
-
export type StudioLiveStatus = {
|
|
135
|
-
phase: "working" | "thinking" | "exploring" | "running" | "waiting" | "idle";
|
|
136
|
-
headline: string;
|
|
137
|
-
detail?: string;
|
|
138
|
-
itemId?: string;
|
|
139
|
-
providerTurnId?: string;
|
|
140
|
-
updatedAt: string;
|
|
141
|
-
};
|
|
142
|
-
export type StudioAssistantTranscript = {
|
|
143
|
-
itemId: string;
|
|
144
|
-
providerThreadId?: string;
|
|
145
|
-
providerTurnId?: string;
|
|
146
|
-
text: string;
|
|
147
|
-
status: "streaming" | "completed";
|
|
148
|
-
updatedAt: string;
|
|
149
|
-
};
|
|
150
|
-
export type AgentSessionOwner = {
|
|
151
|
-
kind: "TeamPlan";
|
|
152
|
-
runId: string;
|
|
153
|
-
executeId: string;
|
|
154
|
-
attempt: PositiveInteger;
|
|
155
|
-
} | {
|
|
156
|
-
kind: "ExecutionPlan";
|
|
157
|
-
runId: string;
|
|
158
|
-
executeId: string;
|
|
159
|
-
attempt: PositiveInteger;
|
|
160
|
-
pathId: PathId;
|
|
161
|
-
executorId: string;
|
|
162
|
-
} | {
|
|
163
|
-
kind: "MoveFinalizer";
|
|
164
|
-
runId: string;
|
|
165
|
-
executeId: string;
|
|
166
|
-
moveId?: MoveId;
|
|
167
|
-
} | {
|
|
168
|
-
kind: "HunsuDraft";
|
|
169
|
-
draftSessionId: string;
|
|
170
|
-
};
|
|
171
|
-
export type AgentSessionRouteKind = "Plan" | "Path" | "HunsuDraft";
|
|
172
|
-
export type AgentSessionRouteRef = {
|
|
173
|
-
kind: "Route";
|
|
174
|
-
routeKind: AgentSessionRouteKind;
|
|
175
|
-
routeId: string;
|
|
176
|
-
sourceLineId: string;
|
|
177
|
-
sourceNodeId: string;
|
|
178
|
-
targetNodeId?: string;
|
|
179
|
-
worktree?: WorktreeRef;
|
|
180
|
-
runId?: string;
|
|
181
|
-
executeId?: string;
|
|
182
|
-
draftSessionId?: string;
|
|
183
|
-
};
|
|
184
|
-
export type AgentInteractionRequest = {
|
|
185
|
-
interactionId: string;
|
|
186
|
-
prompt: string;
|
|
187
|
-
createdAt: string;
|
|
188
|
-
};
|
|
189
|
-
export type AgentSessionState = {
|
|
190
|
-
type: "waiting";
|
|
191
|
-
reason?: string;
|
|
192
|
-
} | {
|
|
193
|
-
type: "starting";
|
|
194
|
-
startedAt: string;
|
|
195
|
-
} | {
|
|
196
|
-
type: "executing";
|
|
197
|
-
provider: StudioAgentSessionRef;
|
|
198
|
-
activeItemIds: string[];
|
|
199
|
-
} | {
|
|
200
|
-
type: "interactWait";
|
|
201
|
-
provider: StudioAgentSessionRef;
|
|
202
|
-
interaction: AgentInteractionRequest;
|
|
203
|
-
activeItemIds: string[];
|
|
204
|
-
} | {
|
|
205
|
-
type: "completed";
|
|
206
|
-
provider?: StudioAgentSessionRef;
|
|
207
|
-
finalResponse?: string;
|
|
208
|
-
completedAt: string;
|
|
209
|
-
} | {
|
|
210
|
-
type: "failed";
|
|
211
|
-
provider?: StudioAgentSessionRef;
|
|
212
|
-
error: string;
|
|
213
|
-
completedAt: string;
|
|
214
|
-
};
|
|
215
|
-
export type AgentMessageRole = "user" | "assistant" | "tool" | "reasoning" | "system";
|
|
216
|
-
export type AgentMessage = {
|
|
217
|
-
sessionId: string;
|
|
218
|
-
messageId: string;
|
|
219
|
-
itemId: string;
|
|
220
|
-
role: AgentMessageRole;
|
|
221
|
-
type: string;
|
|
222
|
-
status: "started" | "streaming" | "completed";
|
|
223
|
-
title: string;
|
|
224
|
-
text?: string;
|
|
225
|
-
summary?: string[];
|
|
226
|
-
content?: string[];
|
|
227
|
-
command?: string;
|
|
228
|
-
cwd?: string;
|
|
229
|
-
commandActions?: RunnerAppServerCommandAction[];
|
|
230
|
-
output?: string;
|
|
231
|
-
changes?: unknown;
|
|
232
|
-
durationMs?: number;
|
|
233
|
-
revision: number;
|
|
234
|
-
createdAt: string;
|
|
235
|
-
updatedAt: string;
|
|
236
|
-
completedAt?: string;
|
|
237
|
-
};
|
|
238
|
-
export type AgentSession = {
|
|
239
|
-
sessionId: string;
|
|
240
|
-
roadmapId?: string;
|
|
241
|
-
routeRef: AgentSessionRouteRef;
|
|
242
|
-
runId?: string;
|
|
243
|
-
executeId?: string;
|
|
244
|
-
owner: AgentSessionOwner;
|
|
245
|
-
state: AgentSessionState;
|
|
246
|
-
provider?: StudioAgentSessionRef;
|
|
247
|
-
messages: AgentMessage[];
|
|
248
|
-
activeItemIds: string[];
|
|
249
|
-
finalResponse?: string;
|
|
250
|
-
error?: string;
|
|
251
|
-
revision: number;
|
|
252
|
-
createdAt: string;
|
|
253
|
-
updatedAt: string;
|
|
254
|
-
};
|
|
255
|
-
export type StudioExecuteView = StudioRunSummary & {
|
|
256
|
-
executeId: string;
|
|
257
|
-
teamRouteId: string;
|
|
258
|
-
selectedDestinationIds: string[];
|
|
259
|
-
sourceMoveId?: MoveId;
|
|
260
|
-
targetMoveOrdinal?: PositiveInteger;
|
|
261
|
-
statusLabel: string;
|
|
262
|
-
outcomeLabel?: "Arrived" | "Accident";
|
|
263
|
-
memberEvaluations: StudioMemberPathEvaluation[];
|
|
264
|
-
};
|
|
265
|
-
export type StudioRoadmapView = BoardProjection & {
|
|
266
|
-
roadmap: BoardProjection;
|
|
267
|
-
destinations: Destination[];
|
|
268
|
-
teams: LineRecord[];
|
|
269
|
-
moves: BoardProjection["moves"];
|
|
270
|
-
hunsus: BoardProjection["hunsus"];
|
|
271
|
-
};
|
|
272
|
-
export type StudioExecuteCompletionFacts = {
|
|
273
|
-
summary: string;
|
|
274
|
-
evidence: string[];
|
|
275
|
-
risks: string[];
|
|
276
|
-
};
|
|
277
|
-
export type StudioMemberPathEvaluation = StudioExecuteCompletionFacts & {
|
|
278
|
-
terminalPathId?: PathId;
|
|
279
|
-
terminalPathCommit?: CommitSha;
|
|
280
|
-
attempt: PositiveInteger;
|
|
281
|
-
at: string;
|
|
282
|
-
};
|
|
283
|
-
export type StudioAgentSessionRef = {
|
|
284
|
-
providerThreadId: string;
|
|
285
|
-
providerTurnId: string;
|
|
286
|
-
};
|
|
287
|
-
export type StudioEncodedRuntimeFile = {
|
|
288
|
-
path: string;
|
|
289
|
-
commit: CommitSha;
|
|
290
|
-
text: string;
|
|
291
|
-
};
|
|
292
|
-
export type StudioExecutionFileState = "present" | "none";
|
|
293
|
-
export type StudioExecutionNextState = StudioExecutionFileState | "pending";
|
|
294
|
-
export type StudioExecutionTransition = {
|
|
295
|
-
path: string;
|
|
296
|
-
previousCommit?: CommitSha;
|
|
297
|
-
previous?: StudioEncodedRuntimeFile;
|
|
298
|
-
previousState: StudioExecutionFileState;
|
|
299
|
-
nextCommit?: CommitSha;
|
|
300
|
-
next?: StudioEncodedRuntimeFile;
|
|
301
|
-
nextState: StudioExecutionNextState;
|
|
302
|
-
};
|
|
303
|
-
type StudioMemberPathRunBase = {
|
|
304
|
-
pathId: PathId;
|
|
305
|
-
executorId: string;
|
|
306
|
-
goal: string;
|
|
307
|
-
requires: MemberPath["requires"];
|
|
308
|
-
attempt: PositiveInteger;
|
|
309
|
-
agentSessionId?: string;
|
|
310
|
-
dependencyPathIds: PathId[];
|
|
311
|
-
dependencyOutputs: string[];
|
|
312
|
-
currentExecutionFile?: StudioEncodedRuntimeFile;
|
|
313
|
-
currentExecutionTransition?: StudioExecutionTransition;
|
|
314
|
-
startedAt: string;
|
|
315
|
-
};
|
|
316
|
-
export type StudioMemberPathRun = (StudioMemberPathRunBase & {
|
|
317
|
-
status: "planned" | "starting";
|
|
318
|
-
}) | (StudioMemberPathRunBase & {
|
|
319
|
-
status: "executing";
|
|
320
|
-
session: StudioAgentSessionRef;
|
|
321
|
-
}) | (StudioMemberPathRunBase & {
|
|
322
|
-
status: "completed";
|
|
323
|
-
session: StudioAgentSessionRef;
|
|
324
|
-
finalResponse: string;
|
|
325
|
-
commit?: CommitSha;
|
|
326
|
-
parentCommit?: CommitSha;
|
|
327
|
-
treeChanged?: boolean;
|
|
328
|
-
completedAt: string;
|
|
329
|
-
}) | (StudioMemberPathRunBase & {
|
|
330
|
-
status: "failed";
|
|
331
|
-
session?: StudioAgentSessionRef;
|
|
332
|
-
error: string;
|
|
333
|
-
finalResponse?: string;
|
|
334
|
-
commit?: CommitSha;
|
|
335
|
-
parentCommit?: CommitSha;
|
|
336
|
-
treeChanged?: boolean;
|
|
337
|
-
completedAt: string;
|
|
338
|
-
});
|
|
339
|
-
export type StudioServerState = {
|
|
340
|
-
events: DomainEvent[];
|
|
341
|
-
runs: Record<string, StudioRunState>;
|
|
342
|
-
agentSessions: Record<string, AgentSession>;
|
|
343
|
-
hunsuDrafts: Record<string, StudioHunsuDraftSession>;
|
|
344
|
-
hunsuDraftArtifacts: Record<string, StudioHunsuDraftArtifact>;
|
|
345
|
-
filesystemCapabilities: Record<string, FilesystemBrowseCapability>;
|
|
346
|
-
liveSubscribers: Set<StudioLiveSubscriber>;
|
|
347
|
-
agentSessionSubscribers: Set<AgentSessionSubscriber>;
|
|
348
|
-
};
|
|
349
|
-
export type StudioServerSecurityOptions = {
|
|
350
|
-
authToken?: string;
|
|
351
|
-
allowedOrigins?: string[];
|
|
352
|
-
allowNoOrigin?: boolean;
|
|
353
|
-
};
|
|
354
|
-
export type StudioServerOptions = {
|
|
355
|
-
state?: StudioServerState;
|
|
356
|
-
cwd?: string;
|
|
357
|
-
persist?: boolean;
|
|
358
|
-
runner?: Runner;
|
|
359
|
-
actionRunner?: ArtifactActionCommandRunner;
|
|
360
|
-
apmSkillRegistryClient?: ApmSkillRegistryClient;
|
|
361
|
-
roadmapRegistryPath?: string;
|
|
362
|
-
runtimeConfig?: BridgeRuntimeConfig;
|
|
363
|
-
security?: StudioServerSecurityOptions;
|
|
364
|
-
};
|
|
365
|
-
export type StudioCommandResult = {
|
|
366
|
-
acceptedEvents: DomainEvent[];
|
|
367
|
-
board: BoardProjection;
|
|
368
|
-
};
|
|
369
|
-
export type StudioCommandRequest = Command | {
|
|
370
|
-
commands: Command[];
|
|
371
|
-
};
|
|
372
|
-
export type RepositorySelectionRequest = {
|
|
373
|
-
cwd: string;
|
|
374
|
-
};
|
|
375
|
-
export type RepositorySelectionResult = {
|
|
376
|
-
repository: WorktreeStatus;
|
|
377
|
-
board: BoardProjection;
|
|
378
|
-
};
|
|
379
|
-
export type RoadmapRegistryEntry = {
|
|
380
|
-
roadmapId: string;
|
|
381
|
-
displayName: string;
|
|
382
|
-
repositoryPath: string;
|
|
383
|
-
lastOpenedAt: string;
|
|
384
|
-
lastKnownBranch?: string;
|
|
385
|
-
health: "ok" | "missing";
|
|
386
|
-
};
|
|
387
|
-
export type RoadmapOpenRequest = {
|
|
388
|
-
path?: string;
|
|
389
|
-
cwd?: string;
|
|
390
|
-
browseToken?: string;
|
|
391
|
-
title?: string;
|
|
392
|
-
};
|
|
393
|
-
export type RoadmapPortRequest = RoadmapOpenRequest & {
|
|
394
|
-
goal?: string;
|
|
395
|
-
destinations?: DestinationSeed[];
|
|
396
|
-
};
|
|
397
|
-
export type RoadmapOpenResult = {
|
|
398
|
-
roadmap: RoadmapRegistryEntry;
|
|
399
|
-
repository: WorktreeStatus;
|
|
400
|
-
board: BoardProjection;
|
|
401
|
-
};
|
|
402
|
-
export type RoadmapPortInspectResult = {
|
|
403
|
-
port: HunsuPortInspection;
|
|
404
|
-
plan?: HunsuPortPlan;
|
|
405
|
-
};
|
|
406
|
-
export type RoadmapPortApplyResult = RoadmapOpenResult & {
|
|
407
|
-
port: HunsuPortApplyResult;
|
|
408
|
-
};
|
|
409
|
-
export type BrowseRootId = string & {
|
|
410
|
-
readonly __brand: "BrowseRootId";
|
|
411
|
-
};
|
|
412
|
-
export type BrowseToken = string & {
|
|
413
|
-
readonly __brand: "BrowseToken";
|
|
414
|
-
};
|
|
415
|
-
export type CanonicalLocalPath = string & {
|
|
416
|
-
readonly __brand: "CanonicalLocalPath";
|
|
417
|
-
};
|
|
418
|
-
export type FilesystemBrowseRoot = {
|
|
419
|
-
rootId: BrowseRootId;
|
|
420
|
-
path: CanonicalLocalPath;
|
|
421
|
-
label: string;
|
|
422
|
-
};
|
|
423
|
-
export type FilesystemBrowseCapability = {
|
|
424
|
-
browseToken: BrowseToken;
|
|
425
|
-
rootId: BrowseRootId;
|
|
426
|
-
path: CanonicalLocalPath;
|
|
427
|
-
displayPath: string;
|
|
428
|
-
issuedAt: string;
|
|
429
|
-
expiresAt: string;
|
|
430
|
-
};
|
|
431
|
-
export type FilesystemBrowseError = {
|
|
432
|
-
code: "no_roots" | "invalid_root" | "outside_root" | "not_directory" | "protected_path" | "invalid_grant" | "expired_grant";
|
|
433
|
-
message: string;
|
|
434
|
-
};
|
|
435
|
-
export type FilesystemBrowseEntry = {
|
|
436
|
-
kind: "directory";
|
|
437
|
-
name: string;
|
|
438
|
-
path: string;
|
|
439
|
-
rootId: BrowseRootId;
|
|
440
|
-
type: "directory";
|
|
441
|
-
isGitRepository: boolean;
|
|
442
|
-
isRoadmap: boolean;
|
|
443
|
-
};
|
|
444
|
-
export type FilesystemBrowseResult = {
|
|
445
|
-
path: string;
|
|
446
|
-
parent?: string;
|
|
447
|
-
rootId: BrowseRootId;
|
|
448
|
-
roots: FilesystemBrowseRoot[];
|
|
449
|
-
entries: FilesystemBrowseEntry[];
|
|
450
|
-
};
|
|
451
|
-
export type FilesystemGrantRequest = {
|
|
452
|
-
rootId?: string;
|
|
453
|
-
path?: string;
|
|
454
|
-
};
|
|
455
|
-
export type FilesystemGrantResult = {
|
|
456
|
-
capability: FilesystemBrowseCapability;
|
|
457
|
-
};
|
|
458
|
-
export type MoveFileNode = {
|
|
459
|
-
kind: "directory";
|
|
460
|
-
name: string;
|
|
461
|
-
path: string;
|
|
462
|
-
} | {
|
|
463
|
-
kind: "textFile";
|
|
464
|
-
name: string;
|
|
465
|
-
path: string;
|
|
466
|
-
size: number;
|
|
467
|
-
} | {
|
|
468
|
-
kind: "binaryFile";
|
|
469
|
-
name: string;
|
|
470
|
-
path: string;
|
|
471
|
-
size: number;
|
|
472
|
-
} | {
|
|
473
|
-
kind: "tooLarge";
|
|
474
|
-
name: string;
|
|
475
|
-
path: string;
|
|
476
|
-
size: number;
|
|
477
|
-
} | {
|
|
478
|
-
kind: "hiddenRuntime";
|
|
479
|
-
name: string;
|
|
480
|
-
path: string;
|
|
481
|
-
};
|
|
482
|
-
export type MoveFileTree = {
|
|
483
|
-
moveId: string;
|
|
484
|
-
commit: string;
|
|
485
|
-
path: string;
|
|
486
|
-
parent?: string;
|
|
487
|
-
nodes: MoveFileNode[];
|
|
488
|
-
changedPaths: string[];
|
|
489
|
-
runtimeCapsule: MoveRuntimeCapsule;
|
|
490
|
-
};
|
|
491
|
-
export type MoveFileBlob = {
|
|
492
|
-
kind: "text";
|
|
493
|
-
moveId: string;
|
|
494
|
-
commit: string;
|
|
495
|
-
path: string;
|
|
496
|
-
text: string;
|
|
497
|
-
language?: string;
|
|
498
|
-
size: number;
|
|
499
|
-
} | {
|
|
500
|
-
kind: "binary";
|
|
501
|
-
moveId: string;
|
|
502
|
-
commit: string;
|
|
503
|
-
path: string;
|
|
504
|
-
size: number;
|
|
505
|
-
} | {
|
|
506
|
-
kind: "tooLarge";
|
|
507
|
-
moveId: string;
|
|
508
|
-
commit: string;
|
|
509
|
-
path: string;
|
|
510
|
-
size: number;
|
|
511
|
-
maxBytes: number;
|
|
512
|
-
} | {
|
|
513
|
-
kind: "hiddenRuntime";
|
|
514
|
-
moveId: string;
|
|
515
|
-
commit: string;
|
|
516
|
-
path: string;
|
|
517
|
-
};
|
|
518
|
-
export type MoveFileReadError = {
|
|
519
|
-
code: "unknown_move" | "invalid_path" | "not_found" | "not_file" | "git_error";
|
|
520
|
-
message: string;
|
|
521
|
-
};
|
|
522
|
-
export type MoveRuntimeCapsule = {
|
|
523
|
-
hiddenRuntimeFileCount: number;
|
|
524
|
-
runtimePaths: string[];
|
|
525
|
-
summary: string;
|
|
526
|
-
};
|
|
527
|
-
export type StudioRunStartRequest = {
|
|
528
|
-
requestId?: string;
|
|
529
|
-
lineId?: string;
|
|
530
|
-
selectedDestinationIds?: string[];
|
|
531
|
-
};
|
|
532
|
-
export type StudioRunActionRequest = {
|
|
533
|
-
runId: string;
|
|
534
|
-
};
|
|
535
|
-
export type StudioActionRunStartRequest = {
|
|
536
|
-
actionId?: string;
|
|
537
|
-
moveId?: string;
|
|
538
|
-
commit?: string;
|
|
539
|
-
env?: Record<string, string>;
|
|
540
|
-
dryRun?: boolean;
|
|
541
|
-
};
|
|
542
|
-
export type StudioLineDecisionRequest = {
|
|
543
|
-
lineId: string;
|
|
544
|
-
reason?: string;
|
|
545
|
-
};
|
|
546
|
-
export type StudioMoveCompletionRequest = {
|
|
547
|
-
runId: string;
|
|
548
|
-
fromRef: string;
|
|
549
|
-
summary: string;
|
|
550
|
-
destinationIds?: string[];
|
|
551
|
-
evidence: string[];
|
|
552
|
-
risks?: string[];
|
|
553
|
-
approvedRisks?: boolean;
|
|
554
|
-
};
|
|
555
|
-
export type StudioRunResult = {
|
|
556
|
-
run: StudioRunSummary;
|
|
557
|
-
execute: StudioExecuteView;
|
|
558
|
-
board: BoardProjection;
|
|
559
|
-
};
|
|
560
|
-
export type StudioMoveCompletionResult = StudioRunResult & {
|
|
561
|
-
moveId: string;
|
|
562
|
-
commit: string;
|
|
563
|
-
acceptedEvents: DomainEvent[];
|
|
564
|
-
};
|
|
565
|
-
export type StudioHunsuDraftStatus = "draft" | "ready" | "confirmed" | "discarded" | "failed";
|
|
566
|
-
export type StudioHunsuDraftChatRole = "user" | "draft-agent" | "system";
|
|
567
|
-
export type StudioHunsuDraftMessage = {
|
|
568
|
-
messageId: string;
|
|
569
|
-
role: StudioHunsuDraftChatRole;
|
|
570
|
-
text: string;
|
|
571
|
-
createdAt: string;
|
|
572
|
-
};
|
|
573
|
-
export type StudioHunsuDraftRuntimeFileChange = {
|
|
574
|
-
path: string;
|
|
575
|
-
kind: "added" | "updated" | "removed";
|
|
576
|
-
summary: string;
|
|
577
|
-
diff: string;
|
|
578
|
-
};
|
|
579
|
-
export type StudioHunsuDraftRuntimeFileDiff = {
|
|
580
|
-
path: string;
|
|
581
|
-
kind: "added" | "updated" | "removed";
|
|
582
|
-
diff: string;
|
|
583
|
-
};
|
|
584
|
-
export type StudioHunsuDraftChanges = {
|
|
585
|
-
draftSessionId: string;
|
|
586
|
-
sourceNodeId: string;
|
|
587
|
-
requestDir: string;
|
|
588
|
-
previousDir: string;
|
|
589
|
-
ok: boolean;
|
|
590
|
-
summary: string;
|
|
591
|
-
errors: string[];
|
|
592
|
-
files: StudioHunsuDraftRuntimeFileChange[];
|
|
593
|
-
checkedAt?: string;
|
|
594
|
-
};
|
|
595
|
-
export type StudioHunsuDraftDiffArtifact = {
|
|
596
|
-
diffArtifactId: string;
|
|
597
|
-
draftSessionId: string;
|
|
598
|
-
status: "pass" | "failed";
|
|
599
|
-
newTeamName?: string;
|
|
600
|
-
files: StudioHunsuDraftRuntimeFileDiff[];
|
|
601
|
-
errors: string[];
|
|
602
|
-
failedReason?: string;
|
|
603
|
-
checkedAt: string;
|
|
604
|
-
draftSurfaceHash: string;
|
|
605
|
-
};
|
|
606
|
-
type StudioHunsuDraftDiffArtifactRecord = Omit<StudioHunsuDraftDiffArtifact, "files"> & {
|
|
607
|
-
summary: string;
|
|
608
|
-
files: StudioHunsuDraftRuntimeFileChange[];
|
|
609
|
-
readyDraft?: ReadyHunsuDraft;
|
|
610
|
-
};
|
|
611
|
-
export type StudioHunsuDraftArtifact = {
|
|
612
|
-
artifactId: string;
|
|
613
|
-
kind: "source-protocol";
|
|
614
|
-
repositoryPath: string;
|
|
615
|
-
roadmapId?: string;
|
|
616
|
-
draftSessionId: string;
|
|
617
|
-
baseArtifactId?: string;
|
|
618
|
-
value: unknown;
|
|
619
|
-
createdAt: string;
|
|
620
|
-
};
|
|
621
|
-
export type StudioHunsuDraftSession = {
|
|
622
|
-
draftSessionId: string;
|
|
623
|
-
roadmapId?: string;
|
|
624
|
-
repositoryPath: string;
|
|
625
|
-
sourceLineId: string;
|
|
626
|
-
sourceNodeId: string;
|
|
627
|
-
sourceMoveId?: string;
|
|
628
|
-
routeId: string;
|
|
629
|
-
worktree?: WorktreeRef;
|
|
630
|
-
agentSessionIds: string[];
|
|
631
|
-
activeAgentSessionId?: string;
|
|
632
|
-
draftAgentSessionId?: string;
|
|
633
|
-
sourceArtifactId: string;
|
|
634
|
-
currentArtifactId: string;
|
|
635
|
-
managerLock?: HubPackageLock;
|
|
636
|
-
manager: ManagerConfig;
|
|
637
|
-
confirmedHunsuId?: string;
|
|
638
|
-
confirmedNodeId?: string;
|
|
639
|
-
providerThreadId?: string;
|
|
640
|
-
messages: StudioHunsuDraftMessage[];
|
|
641
|
-
readyDraft?: ReadyHunsuDraft;
|
|
642
|
-
latestDiffArtifactId?: string;
|
|
643
|
-
diffArtifacts: Record<string, StudioHunsuDraftDiffArtifactRecord>;
|
|
644
|
-
status: StudioHunsuDraftStatus;
|
|
645
|
-
error?: string;
|
|
646
|
-
createdAt: string;
|
|
647
|
-
updatedAt: string;
|
|
648
|
-
};
|
|
649
|
-
export type StudioHunsuDraftStartRequest = {
|
|
650
|
-
sourceNodeId?: string;
|
|
651
|
-
sourceMoveId?: string;
|
|
652
|
-
sourceLineId?: string;
|
|
653
|
-
managerLock?: HubPackageLock;
|
|
654
|
-
message?: string;
|
|
655
|
-
};
|
|
656
|
-
export type StudioHunsuDraftMessageRequest = {
|
|
657
|
-
message: string;
|
|
658
|
-
};
|
|
659
|
-
export type StudioHunsuDraftResult = {
|
|
660
|
-
draft: StudioHunsuDraftSession;
|
|
661
|
-
board: BoardProjection;
|
|
662
|
-
diffArtifact?: StudioHunsuDraftDiffArtifact;
|
|
663
|
-
acceptedEvents?: DomainEvent[];
|
|
664
|
-
hunsu?: HunsuRecord;
|
|
665
|
-
};
|
|
666
|
-
export type StudioHunsuDraftDiffArtifactResult = {
|
|
667
|
-
diffArtifact: StudioHunsuDraftDiffArtifact;
|
|
668
|
-
};
|
|
669
|
-
export type StudioHunsuDraftCheckCommandChangedFile = {
|
|
670
|
-
path: string;
|
|
671
|
-
kind: "added" | "updated" | "removed";
|
|
672
|
-
};
|
|
673
|
-
export type StudioHunsuDraftCheckCommandPassResult = {
|
|
674
|
-
status: "pass";
|
|
675
|
-
draftSessionId: string;
|
|
676
|
-
diffArtifactId: string;
|
|
677
|
-
marker: string;
|
|
678
|
-
checkedAt: string;
|
|
679
|
-
changedFiles: StudioHunsuDraftCheckCommandChangedFile[];
|
|
680
|
-
};
|
|
681
|
-
export type StudioHunsuDraftCheckCommandFailedResult = {
|
|
682
|
-
status: "failed";
|
|
683
|
-
draftSessionId: string;
|
|
684
|
-
diffArtifactId: string;
|
|
685
|
-
marker: string;
|
|
686
|
-
checkedAt: string;
|
|
687
|
-
failedReason: string;
|
|
688
|
-
errors: string[];
|
|
689
|
-
};
|
|
690
|
-
export type StudioHunsuDraftCheckCommandResult = StudioHunsuDraftCheckCommandPassResult | StudioHunsuDraftCheckCommandFailedResult;
|
|
691
|
-
export type HunsuDraftRouteRuntimeFile = {
|
|
692
|
-
schema: "hunsu.hunsu-draft-route.v1";
|
|
693
|
-
draftSessionId: string;
|
|
694
|
-
roadmapId?: string;
|
|
695
|
-
repositoryPath: string;
|
|
696
|
-
routeId: string;
|
|
697
|
-
sourceLineId: string;
|
|
698
|
-
sourceNodeId: string;
|
|
699
|
-
sourceMoveId?: string;
|
|
700
|
-
sourceArtifactId: string;
|
|
701
|
-
currentArtifactId: string;
|
|
702
|
-
managerLock?: HubPackageLock;
|
|
703
|
-
manager: ManagerConfig;
|
|
704
|
-
confirmedHunsuId?: string;
|
|
705
|
-
confirmedNodeId?: string;
|
|
706
|
-
status: StudioHunsuDraftStatus;
|
|
707
|
-
readyDraft?: ReadyHunsuDraft;
|
|
708
|
-
latestDiffArtifactId?: string;
|
|
709
|
-
diffArtifacts?: Record<string, StudioHunsuDraftDiffArtifactRecord>;
|
|
710
|
-
worktree?: WorktreeRef;
|
|
711
|
-
updatedAt: string;
|
|
712
|
-
};
|
|
713
|
-
export type StudioLiveEvent = {
|
|
714
|
-
type: "runs.snapshot";
|
|
715
|
-
runs: StudioRunSummary[];
|
|
716
|
-
executes: StudioExecuteView[];
|
|
717
|
-
} | {
|
|
718
|
-
type: "run.updated";
|
|
719
|
-
run: StudioRunSummary;
|
|
720
|
-
execute: StudioExecuteView;
|
|
721
|
-
board?: BoardProjection;
|
|
722
|
-
};
|
|
723
|
-
export type StudioLiveSubscriber = (event: StudioLiveEvent) => void;
|
|
724
|
-
export type AgentSessionListResult = {
|
|
725
|
-
sessions: AgentSession[];
|
|
726
|
-
};
|
|
727
|
-
export type AgentSessionResult = {
|
|
728
|
-
session: AgentSession;
|
|
729
|
-
};
|
|
730
|
-
export type AgentSessionLifecyclePatch = {
|
|
731
|
-
type: "agentSession.lifecycle";
|
|
732
|
-
sessionId: string;
|
|
733
|
-
roadmapId?: string;
|
|
734
|
-
routeRef: AgentSessionRouteRef;
|
|
735
|
-
runId?: string;
|
|
736
|
-
executeId?: string;
|
|
737
|
-
owner: AgentSessionOwner;
|
|
738
|
-
state: AgentSessionState;
|
|
739
|
-
provider?: StudioAgentSessionRef;
|
|
740
|
-
activeItemIds: string[];
|
|
741
|
-
finalResponse?: string;
|
|
742
|
-
error?: string;
|
|
743
|
-
sessionRevision: number;
|
|
744
|
-
updatedAt: string;
|
|
745
|
-
};
|
|
746
|
-
export type AgentSessionEvent = {
|
|
747
|
-
type: "agentSession.snapshot";
|
|
748
|
-
sessions: AgentSession[];
|
|
749
|
-
} | AgentSessionLifecyclePatch | {
|
|
750
|
-
type: "agentMessage.delta";
|
|
751
|
-
sessionId: string;
|
|
752
|
-
roadmapId?: string;
|
|
753
|
-
routeRef: AgentSessionRouteRef;
|
|
754
|
-
runId?: string;
|
|
755
|
-
executeId?: string;
|
|
756
|
-
messageId: string;
|
|
757
|
-
itemId: string;
|
|
758
|
-
role: AgentMessageRole;
|
|
759
|
-
messageType: string;
|
|
760
|
-
title: string;
|
|
761
|
-
field: "text" | "output" | "summary" | "content";
|
|
762
|
-
delta: string;
|
|
763
|
-
contentIndex?: number;
|
|
764
|
-
messageRevision: number;
|
|
765
|
-
sessionRevision: number;
|
|
766
|
-
createdAt: string;
|
|
767
|
-
updatedAt: string;
|
|
768
|
-
} | {
|
|
769
|
-
type: "agentMessage.completed";
|
|
770
|
-
sessionId: string;
|
|
771
|
-
roadmapId?: string;
|
|
772
|
-
routeRef: AgentSessionRouteRef;
|
|
773
|
-
runId?: string;
|
|
774
|
-
executeId?: string;
|
|
775
|
-
messageId: string;
|
|
776
|
-
itemId: string;
|
|
777
|
-
role: AgentMessageRole;
|
|
778
|
-
messageType: string;
|
|
779
|
-
title: string;
|
|
780
|
-
status: "completed";
|
|
781
|
-
text?: string;
|
|
782
|
-
summary?: string[];
|
|
783
|
-
content?: string[];
|
|
784
|
-
command?: string;
|
|
785
|
-
cwd?: string;
|
|
786
|
-
commandActions?: RunnerAppServerCommandAction[];
|
|
787
|
-
output?: string;
|
|
788
|
-
changes?: unknown;
|
|
789
|
-
messageRevision: number;
|
|
790
|
-
sessionRevision: number;
|
|
791
|
-
createdAt: string;
|
|
792
|
-
completedAt: string;
|
|
793
|
-
durationMs?: number;
|
|
794
|
-
updatedAt: string;
|
|
795
|
-
};
|
|
796
|
-
export type AgentSessionSubscriber = (event: AgentSessionEvent) => void;
|
|
797
|
-
export type WorktreeChange = {
|
|
798
|
-
status: string;
|
|
799
|
-
path: string;
|
|
800
|
-
};
|
|
801
|
-
export type WorktreeStatus = {
|
|
802
|
-
root: string;
|
|
803
|
-
branch: string;
|
|
804
|
-
clean: boolean;
|
|
805
|
-
changes: WorktreeChange[];
|
|
806
|
-
};
|
|
807
|
-
export type MoveDiff = {
|
|
808
|
-
moveId: string;
|
|
809
|
-
commit: string;
|
|
810
|
-
headCommit: string;
|
|
811
|
-
baseCommit?: string;
|
|
812
|
-
baseMoveId?: string;
|
|
813
|
-
files: MoveDiffFile[];
|
|
814
|
-
tree: MoveDiffTreeNode[];
|
|
815
|
-
text: string;
|
|
816
|
-
};
|
|
817
|
-
export type MoveDiffFileKind = "added" | "modified" | "removed" | "renamed" | "copied" | "typeChanged";
|
|
818
|
-
export type MoveDiffFile = {
|
|
819
|
-
path: string;
|
|
820
|
-
oldPath?: string;
|
|
821
|
-
kind: MoveDiffFileKind;
|
|
822
|
-
patch: string;
|
|
823
|
-
};
|
|
824
|
-
export type MoveDiffTreeNode = {
|
|
825
|
-
kind: "directory";
|
|
826
|
-
name: string;
|
|
827
|
-
path: string;
|
|
828
|
-
changedFileCount: number;
|
|
829
|
-
children: MoveDiffTreeNode[];
|
|
830
|
-
} | {
|
|
831
|
-
kind: "file";
|
|
832
|
-
name: string;
|
|
833
|
-
path: string;
|
|
834
|
-
oldPath?: string;
|
|
835
|
-
changeKind: MoveDiffFileKind;
|
|
836
|
-
};
|
|
837
|
-
export declare function createStudioState(events?: DomainEvent[]): StudioServerState;
|
|
838
|
-
export declare function createBridgeApiAuthToken(): string;
|
|
839
|
-
export type StudioBridgeStartOptions = {
|
|
840
|
-
cwd?: string;
|
|
841
|
-
webUrl?: string;
|
|
842
|
-
noOpen?: boolean;
|
|
843
|
-
dryRun?: boolean;
|
|
844
|
-
json?: boolean;
|
|
845
|
-
env?: Record<string, string | undefined>;
|
|
846
|
-
};
|
|
847
|
-
export type StudioBridgeStartInfo = {
|
|
848
|
-
bridgeApiUrl: string;
|
|
849
|
-
studioUrl: string;
|
|
850
|
-
allowedOrigin: string;
|
|
851
|
-
};
|
|
852
|
-
export declare function startStudioBridge(options?: StudioBridgeStartOptions): Promise<StudioBridgeStartInfo>;
|
|
853
|
-
export declare function createStudioServer(options?: StudioServerOptions): import("http").Server<typeof IncomingMessage, typeof ServerResponse>;
|
|
854
|
-
type ArtifactActionApiOptions = {
|
|
855
|
-
cwd: string;
|
|
856
|
-
roadmapId?: string;
|
|
857
|
-
actionRunner?: ArtifactActionCommandRunner;
|
|
858
|
-
ambientEnv?: Record<string, string | undefined>;
|
|
859
|
-
processEnv?: Record<string, string | undefined>;
|
|
860
|
-
worktreeRoot?: string;
|
|
861
|
-
};
|
|
862
|
-
export declare function createHttpApmSkillRegistryClient(fetchImpl?: typeof fetch): ApmSkillRegistryClient;
|
|
863
|
-
export declare function planStudioArtifactActionRun(request: StudioActionRunStartRequest, options: ArtifactActionApiOptions): ArtifactActionRunPlan;
|
|
864
|
-
export declare function startStudioArtifactActionRun(request: StudioActionRunStartRequest, options: ArtifactActionApiOptions): ArtifactActionRunRecord;
|
|
865
|
-
export declare function boardFromEvents(events: DomainEvent[]): BoardProjection;
|
|
866
|
-
export declare function subscribeStudioLiveEvents(state: StudioServerState, subscriber: StudioLiveSubscriber, options?: {
|
|
867
|
-
cwd?: string;
|
|
868
|
-
}): () => void;
|
|
869
|
-
type AgentSessionSubscriptionScope = {
|
|
870
|
-
cwd?: string;
|
|
871
|
-
roadmapId?: string;
|
|
872
|
-
sessionId?: string;
|
|
873
|
-
};
|
|
874
|
-
export declare function subscribeAgentSessionEvents(state: StudioServerState, subscriber: AgentSessionSubscriber, options?: AgentSessionSubscriptionScope): () => void;
|
|
875
|
-
export declare function toStudioRoadmapView(board: BoardProjection): StudioRoadmapView;
|
|
876
|
-
export declare function toStudioExecuteView(run: StudioRunState | StudioRunSummary): StudioExecuteView;
|
|
877
|
-
export declare function findArtifact(board: BoardProjection, artifactId: string): ArtifactRecord | undefined;
|
|
878
|
-
export declare function readWorktreeStatus(cwd?: string): WorktreeStatus;
|
|
879
|
-
export declare function listRoadmapRegistry(options?: {
|
|
880
|
-
roadmapRegistryPath?: string;
|
|
881
|
-
}): RoadmapRegistryEntry[];
|
|
882
|
-
export declare function openStudioRoadmap(request: RoadmapOpenRequest, state: StudioServerState, options?: {
|
|
883
|
-
persist?: boolean;
|
|
884
|
-
roadmapRegistryPath?: string;
|
|
885
|
-
}): RoadmapOpenResult;
|
|
886
|
-
export declare function createStudioRoadmap(request: RoadmapOpenRequest, state: StudioServerState, options?: {
|
|
887
|
-
persist?: boolean;
|
|
888
|
-
roadmapRegistryPath?: string;
|
|
889
|
-
}): RoadmapOpenResult;
|
|
890
|
-
export declare function inspectStudioPort(request: RoadmapPortRequest): RoadmapPortInspectResult;
|
|
891
|
-
export declare function applyStudioPort(request: RoadmapPortRequest, state: StudioServerState, options?: {
|
|
892
|
-
roadmapRegistryPath?: string;
|
|
893
|
-
}): RoadmapPortApplyResult;
|
|
894
|
-
export declare function loadStudioRoadmap(roadmapId: string, state: StudioServerState, options?: {
|
|
895
|
-
persist?: boolean;
|
|
896
|
-
roadmapRegistryPath?: string;
|
|
897
|
-
}): RoadmapOpenResult;
|
|
898
|
-
export declare function resolveRoadmapRepositoryPath(roadmapId: string, options?: {
|
|
899
|
-
roadmapRegistryPath?: string;
|
|
900
|
-
}): string;
|
|
901
|
-
export declare function filesystemBrowseRoots(cwd?: string): string[];
|
|
902
|
-
export declare function filesystemBrowseRootEntries(cwd?: string): FilesystemBrowseRoot[];
|
|
903
|
-
export declare function browseFilesystem(path: string | undefined, options?: {
|
|
904
|
-
cwd?: string;
|
|
905
|
-
rootId?: string;
|
|
906
|
-
}): FilesystemBrowseResult;
|
|
907
|
-
export declare function tryBrowseFilesystem(path: string | undefined, options?: {
|
|
908
|
-
cwd?: string;
|
|
909
|
-
rootId?: string;
|
|
910
|
-
}): Result<FilesystemBrowseResult, FilesystemBrowseError>;
|
|
911
|
-
export declare function createFilesystemBrowseGrant(request: FilesystemGrantRequest, state: StudioServerState, options?: {
|
|
912
|
-
cwd?: string;
|
|
913
|
-
}): FilesystemGrantResult;
|
|
914
|
-
export declare function tryCreateFilesystemBrowseGrant(request: FilesystemGrantRequest, state: StudioServerState, options?: {
|
|
915
|
-
cwd?: string;
|
|
916
|
-
}): Result<FilesystemGrantResult, FilesystemBrowseError>;
|
|
917
|
-
export declare function createRouteWorktree(cwd: string, routeId: string, createdAt?: string, requestedBaseRef?: string, requestedWorktreeRoot?: string): WorktreeRef;
|
|
918
|
-
export declare function createExecuteWorktree(cwd: string, executeId: string, createdAt?: string, requestedBaseRef?: string, requestedWorktreeRoot?: string): WorktreeRef;
|
|
919
|
-
export declare function readMoveDiff(board: BoardProjection, moveId: string, cwd?: string): MoveDiff;
|
|
920
|
-
export declare function readMoveFileTree(board: BoardProjection, moveId: string, cwd?: string, path?: string): MoveFileTree;
|
|
921
|
-
export declare function tryReadMoveFileTree(board: BoardProjection, moveId: string, cwd?: string, path?: string): Result<MoveFileTree, MoveFileReadError>;
|
|
922
|
-
export declare function readMoveFileBlob(board: BoardProjection, moveId: string, cwd?: string, path?: string): MoveFileBlob;
|
|
923
|
-
export declare function tryReadMoveFileBlob(board: BoardProjection, moveId: string, cwd?: string, path?: string): Result<MoveFileBlob, MoveFileReadError>;
|
|
924
|
-
export declare function selectStudioRepository(cwd: string, state: StudioServerState, options?: {
|
|
925
|
-
persist?: boolean;
|
|
926
|
-
forceRoot?: boolean;
|
|
927
|
-
}): RepositorySelectionResult;
|
|
928
|
-
export declare function ensureStudioRepository(cwd: string, options?: {
|
|
929
|
-
forceRoot?: boolean;
|
|
930
|
-
}): string;
|
|
931
|
-
export declare function executeStudioCommand(command: Command, state: StudioServerState, options?: {
|
|
932
|
-
cwd?: string;
|
|
933
|
-
persist?: boolean;
|
|
934
|
-
}): Promise<StudioCommandResult>;
|
|
935
|
-
export declare function executeStudioCommands(commands: Command[], state: StudioServerState, options?: {
|
|
936
|
-
cwd?: string;
|
|
937
|
-
persist?: boolean;
|
|
938
|
-
}): Promise<StudioCommandResult>;
|
|
939
|
-
export declare function startStudioRun(request: StudioRunStartRequest, state: StudioServerState, options?: {
|
|
940
|
-
cwd?: string;
|
|
941
|
-
persist?: boolean;
|
|
942
|
-
runner?: Runner;
|
|
943
|
-
apmSkillRegistryClient?: ApmSkillRegistryClient;
|
|
944
|
-
routeWorktreeRoot?: string;
|
|
945
|
-
roadmapId?: string;
|
|
946
|
-
}): Promise<StudioRunResult>;
|
|
947
|
-
export declare function pauseStudioRun(request: StudioRunActionRequest, state: StudioServerState, options?: {
|
|
948
|
-
cwd?: string;
|
|
949
|
-
persist?: boolean;
|
|
950
|
-
runner?: Runner;
|
|
951
|
-
}): Promise<StudioRunResult>;
|
|
952
|
-
export declare function resumeStudioRun(request: StudioRunActionRequest, state: StudioServerState, options?: {
|
|
953
|
-
cwd?: string;
|
|
954
|
-
persist?: boolean;
|
|
955
|
-
runner?: Runner;
|
|
956
|
-
apmSkillRegistryClient?: ApmSkillRegistryClient;
|
|
957
|
-
}): Promise<StudioRunResult>;
|
|
958
|
-
export declare function stopStudioRun(request: StudioRunActionRequest, state: StudioServerState, options?: {
|
|
959
|
-
cwd?: string;
|
|
960
|
-
persist?: boolean;
|
|
961
|
-
runner?: Runner;
|
|
962
|
-
}): Promise<StudioRunResult>;
|
|
963
|
-
export declare function completeStudioMove(request: StudioMoveCompletionRequest, state: StudioServerState, options?: {
|
|
964
|
-
cwd?: string;
|
|
965
|
-
persist?: boolean;
|
|
966
|
-
}): Promise<StudioMoveCompletionResult>;
|
|
967
|
-
export declare function completeStudioMoveFromExecuteCompletion(completion: StudioExecuteCompletionFacts, state: StudioServerState, options: {
|
|
968
|
-
cwd?: string;
|
|
969
|
-
persist?: boolean;
|
|
970
|
-
runId: string;
|
|
971
|
-
runner?: Runner;
|
|
972
|
-
}): Promise<StudioMoveCompletionResult | undefined>;
|
|
973
|
-
export declare function recordStudioAccidentFromExecute(reason: string, evidence: string[], state: StudioServerState, options: {
|
|
974
|
-
cwd?: string;
|
|
975
|
-
persist?: boolean;
|
|
976
|
-
runId: string;
|
|
977
|
-
summary?: string;
|
|
978
|
-
risks?: string[];
|
|
979
|
-
}): Promise<StudioMoveCompletionResult>;
|
|
980
|
-
export declare function decideStudioLine(decision: "accept" | "reject", request: StudioLineDecisionRequest, state: StudioServerState, options?: {
|
|
981
|
-
cwd?: string;
|
|
982
|
-
persist?: boolean;
|
|
983
|
-
}): Promise<StudioCommandResult>;
|
|
984
|
-
export type MemberCodexEnvironmentPhase = "team" | "member" | "move-finalizer";
|
|
985
|
-
export type MemberCodexEnvironmentPreparationOptions = {
|
|
986
|
-
phase?: MemberCodexEnvironmentPhase;
|
|
987
|
-
executorId?: string;
|
|
988
|
-
apmSkillRegistryClient?: ApmSkillRegistryClient;
|
|
989
|
-
skillMetaInstaller?: SkillMetaInstaller;
|
|
990
|
-
env?: Record<string, string | undefined>;
|
|
991
|
-
home?: string;
|
|
992
|
-
};
|
|
993
|
-
export declare function prepareMemberCodexEnvironmentForExecute(cwd: string, harness?: HarnessSnapshot, options?: MemberCodexEnvironmentPreparationOptions): Promise<void>;
|
|
994
|
-
export declare function materializeCodexSkillsForExecute(cwd: string, harness?: HarnessSnapshot, options?: {
|
|
995
|
-
apmSkillRegistryClient?: ApmSkillRegistryClient;
|
|
996
|
-
skillMetaInstaller?: SkillMetaInstaller;
|
|
997
|
-
}): Promise<void>;
|
|
998
|
-
export declare function createNpxSkillsAddInstaller(command?: string): SkillMetaInstaller;
|
|
999
|
-
export declare function listCodexSkills(env?: Record<string, string | undefined>, home?: string): StudioSkillSummary[];
|
|
1000
|
-
export declare function listCodexPlugins(env?: Record<string, string | undefined>, home?: string): string[];
|
|
1001
|
-
export {};
|
|
1
|
+
export const HUNSU_BRIDGE_VERSION: "0.2.0-next.1";
|
|
2
|
+
export const HUNSU_BRIDGE_PROTOCOL_VERSION: "local-bridge-v1";
|
|
3
|
+
export const BRIDGE_CLI_RESULT_SCHEMA: "hunsu.bridge.cli-result.v1";
|
|
4
|
+
|
|
5
|
+
export type BridgeCliResult<T = unknown> =
|
|
6
|
+
| { schema: "hunsu.bridge.cli-result.v1"; ok: true; code: string; message: string; value?: T }
|
|
7
|
+
| { schema: "hunsu.bridge.cli-result.v1"; ok: false; code: string; message: string; recovery?: { command?: string; documentation?: string } };
|
|
8
|
+
|
|
9
|
+
export type HunsuPathInput = {
|
|
10
|
+
home?: string;
|
|
11
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
12
|
+
platform?: "aix" | "android" | "darwin" | "freebsd" | "haiku" | "linux" | "netbsd" | "openbsd" | "sunos" | "win32" | "cygwin";
|
|
13
|
+
userHome?: string;
|
|
14
|
+
localAppData?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type HunsuPaths = {
|
|
18
|
+
home: string;
|
|
19
|
+
homeOwnershipFile: string;
|
|
20
|
+
configFile: string;
|
|
21
|
+
workspacesFile: string;
|
|
22
|
+
credentialsFile: string;
|
|
23
|
+
runtimeFile: string;
|
|
24
|
+
logsDirectory: string;
|
|
25
|
+
structuredLogFile: string;
|
|
26
|
+
runtimeDirectory: string;
|
|
27
|
+
runtimeStagingDirectory: string;
|
|
28
|
+
runtimeVersionsDirectory: string;
|
|
29
|
+
runtimeInstallFile: string;
|
|
30
|
+
setupTransactionFile: string;
|
|
31
|
+
setupLockFile: string;
|
|
32
|
+
daemonLockFile: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type BridgeHealth = {
|
|
36
|
+
ok: true;
|
|
37
|
+
service: "hunsu-bridge";
|
|
38
|
+
version: string;
|
|
39
|
+
protocolVersion: "local-bridge-v1";
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type ControlEndpointProbe =
|
|
43
|
+
| { state: "offline" }
|
|
44
|
+
| { state: "foreign-listener" }
|
|
45
|
+
| { state: "hunsu-healthy" }
|
|
46
|
+
| { state: "hunsu-unhealthy"; status?: number };
|
|
47
|
+
|
|
48
|
+
export type BridgeControlRequest = {
|
|
49
|
+
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
50
|
+
body?: unknown;
|
|
51
|
+
timeoutMs?: number;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type BridgeControlClient = {
|
|
55
|
+
endpoint(): Promise<string>;
|
|
56
|
+
probe(): Promise<ControlEndpointProbe>;
|
|
57
|
+
health(): Promise<BridgeHealth | undefined>;
|
|
58
|
+
request<T = unknown>(path: string, input?: BridgeControlRequest): Promise<BridgeCliResult<T>>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type RelaySocket = {
|
|
62
|
+
readyState: number;
|
|
63
|
+
send(data: string): void;
|
|
64
|
+
close(code?: number, reason?: string): void;
|
|
65
|
+
addEventListener(type: "open" | "close" | "error" | "message", listener: (event: { data?: unknown }) => void): void;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type BridgeDaemonOptions = HunsuPathInput & {
|
|
69
|
+
host?: string;
|
|
70
|
+
port?: number;
|
|
71
|
+
cwd?: string;
|
|
72
|
+
runtimePath?: string;
|
|
73
|
+
webUrl?: string;
|
|
74
|
+
development?: boolean;
|
|
75
|
+
serviceManager?: "windows-task-scheduler" | "macos-launch-agent" | "linux-systemd-user" | "development";
|
|
76
|
+
fetchImpl?: typeof fetch;
|
|
77
|
+
openBrowser?: (url: string) => Promise<void>;
|
|
78
|
+
socketFactory?: (url: string) => RelaySocket;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export type BridgeRuntimeIdentity = {
|
|
82
|
+
schema: "hunsu.bridge.runtime.v1";
|
|
83
|
+
instanceId: string;
|
|
84
|
+
daemonPid: number;
|
|
85
|
+
version: string;
|
|
86
|
+
protocolVersion: "local-bridge-v1";
|
|
87
|
+
startedAt: string;
|
|
88
|
+
endpoint: string;
|
|
89
|
+
runtimePath: string;
|
|
90
|
+
serviceManager: NonNullable<BridgeDaemonOptions["serviceManager"]>;
|
|
91
|
+
lastHealthyAt: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export type RunningBridgeDaemon = {
|
|
95
|
+
identity: BridgeRuntimeIdentity;
|
|
96
|
+
paths: HunsuPaths;
|
|
97
|
+
server: { readonly listening: boolean };
|
|
98
|
+
close(): Promise<void>;
|
|
99
|
+
waitUntilClosed(): Promise<void>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export function resolveHunsuHome(input?: HunsuPathInput): string;
|
|
103
|
+
export function resolveHunsuPaths(input?: HunsuPathInput): HunsuPaths;
|
|
104
|
+
export function createBridgeControlClient(options?: HunsuPathInput & {
|
|
105
|
+
paths?: HunsuPaths;
|
|
106
|
+
endpoint?: string;
|
|
107
|
+
fetchImpl?: typeof fetch;
|
|
108
|
+
timeoutMs?: number;
|
|
109
|
+
}): BridgeControlClient;
|
|
110
|
+
export function startBridgeDaemon(options?: BridgeDaemonOptions): Promise<RunningBridgeDaemon>;
|
|
111
|
+
export function runBridgeCli(
|
|
112
|
+
argv?: string[],
|
|
113
|
+
io?: { stdout(text: string): void; stderr(text: string): void }
|
|
114
|
+
): Promise<number>;
|