@hunsu/bridge 0.1.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/LICENSE +157 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +70 -0
- package/dist/execute/execute-model.d.ts +50 -0
- package/dist/execute/execute-model.js +17 -0
- package/dist/execute/execute-workflow.d.ts +27 -0
- package/dist/execute/execute-workflow.js +65 -0
- package/dist/execute/execution-plan.d.ts +6 -0
- package/dist/execute/execution-plan.js +337 -0
- package/dist/index.d.ts +1001 -0
- package/dist/index.js +7702 -0
- package/package.json +42 -0
- package/src/cli.ts +82 -0
- package/src/execute/execute-model.ts +72 -0
- package/src/execute/execute-workflow.ts +115 -0
- package/src/execute/execution-plan.ts +379 -0
- package/src/index.ts +9685 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1001 @@
|
|
|
1
|
+
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
|
+
import { type TeamRunEvent, type JsonRpcMessage, type Runner, type RunnerAppServerCommandAction, type RunnerAppServerItem } from "@hunsu/codex-runner";
|
|
3
|
+
import { type BridgeRuntimeConfig } from "@hunsu/config";
|
|
4
|
+
import { type CommitSha, type ArtifactActionCommandRunner, type ArtifactActionRunPlan, type ArtifactActionRunRecord } from "@hunsu/core";
|
|
5
|
+
import type { HunsuPortApplyResult, HunsuPortInspection, HunsuPortPlan } from "@hunsu/core";
|
|
6
|
+
import type { ManagerConfig } from "@hunsu/protocol";
|
|
7
|
+
import { type Result } from "@hunsu/protocol";
|
|
8
|
+
import { type ExecuteRunStatus } from "./execute/execute-model.ts";
|
|
9
|
+
import type { AgentConversationRef, ArtifactRecord, BoardProjection, Command, DomainEvent, HarnessSnapshot, HubPackageLock, HunsuRecord, ReadyHunsuDraft, LineRecord, LocalSnapshotSkillMetadata, MoveId, MoveOutcome, NodeId, PathId, ExecutionPlan, MemberPath, PositiveInteger, RegistryPackageSkillMetadata, SkillMetaSkillMetadata, SkillSnapshotFile, Destination, DestinationSeed, WorktreeRef } from "@hunsu/protocol";
|
|
10
|
+
export type StudioRunStatus = ExecuteRunStatus;
|
|
11
|
+
export type StudioSkillFile = {
|
|
12
|
+
path: string;
|
|
13
|
+
size: number;
|
|
14
|
+
text?: string;
|
|
15
|
+
};
|
|
16
|
+
export type StudioSkillSummary = LocalSnapshotSkillMetadata & {
|
|
17
|
+
files: StudioSkillFile[];
|
|
18
|
+
};
|
|
19
|
+
export type ApmSkillReference = {
|
|
20
|
+
kind: "registry-package";
|
|
21
|
+
registryKind: "apm";
|
|
22
|
+
name: string;
|
|
23
|
+
registry: string;
|
|
24
|
+
package: string;
|
|
25
|
+
version: string;
|
|
26
|
+
};
|
|
27
|
+
export type ApmSkillRegistryClient = {
|
|
28
|
+
resolveSkill(ref: ApmSkillReference): Promise<RegistryPackageSkillMetadata>;
|
|
29
|
+
fetchSkillFiles(lock: RegistryPackageSkillMetadata): Promise<SkillSnapshotFile[]>;
|
|
30
|
+
};
|
|
31
|
+
export type SkillMetaInstallOptions = {
|
|
32
|
+
env?: Record<string, string | undefined>;
|
|
33
|
+
home?: string;
|
|
34
|
+
};
|
|
35
|
+
export type SkillMetaInstaller = {
|
|
36
|
+
install(skill: SkillMetaSkillMetadata, cwd: string, options: SkillMetaInstallOptions): Promise<void>;
|
|
37
|
+
};
|
|
38
|
+
export type StudioRunState = {
|
|
39
|
+
runId: string;
|
|
40
|
+
roadmapId?: string;
|
|
41
|
+
executeId: string;
|
|
42
|
+
requestId: string;
|
|
43
|
+
lineId: string;
|
|
44
|
+
repositoryPath?: string;
|
|
45
|
+
provider: "codex";
|
|
46
|
+
source?: "live" | "rehydrated";
|
|
47
|
+
status: StudioRunStatus;
|
|
48
|
+
selectedDestinationIds: string[];
|
|
49
|
+
harnessLock?: HubPackageLock;
|
|
50
|
+
sourceNodeId?: NodeId;
|
|
51
|
+
sourceMoveId?: MoveId;
|
|
52
|
+
targetMoveOrdinal?: PositiveInteger;
|
|
53
|
+
worktree?: WorktreeRef;
|
|
54
|
+
conversationRef?: AgentConversationRef;
|
|
55
|
+
outcome?: MoveOutcome;
|
|
56
|
+
providerThreadId?: string;
|
|
57
|
+
providerTeamThreadId?: string;
|
|
58
|
+
providerTeamPlanningTurnId?: string;
|
|
59
|
+
providerMemberThreadId?: string;
|
|
60
|
+
providerFinalizerThreadId?: string;
|
|
61
|
+
providerTurnIds?: string[];
|
|
62
|
+
finalResponse?: string;
|
|
63
|
+
attemptCount?: 0 | PositiveInteger;
|
|
64
|
+
maxAttemptCount?: PositiveInteger;
|
|
65
|
+
currentExecution?: ExecutionPlan;
|
|
66
|
+
memberEvaluations?: StudioMemberPathEvaluation[];
|
|
67
|
+
executionPlanPlan?: MemberPath[];
|
|
68
|
+
pathCommits?: Record<string, CommitSha>;
|
|
69
|
+
planExecutionTransition?: StudioExecutionTransition;
|
|
70
|
+
memberPathRuns?: StudioMemberPathRun[];
|
|
71
|
+
terminalMemberPathId?: PathId;
|
|
72
|
+
terminalPathCommit?: CommitSha;
|
|
73
|
+
moveFinalizerMessage?: string;
|
|
74
|
+
moveFinalizerCommit?: CommitSha;
|
|
75
|
+
error?: string;
|
|
76
|
+
debugEvents: TeamRunEvent[];
|
|
77
|
+
rawAppServerMessages: StudioRawAppServerMessage[];
|
|
78
|
+
codexTurns: StudioCodexTurn[];
|
|
79
|
+
codexItems: StudioCodexItem[];
|
|
80
|
+
agentSessionIds?: string[];
|
|
81
|
+
agentSessions: AgentSession[];
|
|
82
|
+
activeItemIds: string[];
|
|
83
|
+
activeAgentSessionId?: string;
|
|
84
|
+
liveStatus?: StudioLiveStatus;
|
|
85
|
+
assistantTranscript: StudioAssistantTranscript[];
|
|
86
|
+
startedAt: string;
|
|
87
|
+
updatedAt: string;
|
|
88
|
+
};
|
|
89
|
+
export type StudioRunSummary = Omit<StudioRunState, "currentExecution" | "debugEvents" | "rawAppServerMessages" | "codexItems" | "assistantTranscript" | "finalResponse" | "moveFinalizerMessage"> & {
|
|
90
|
+
finalResponse?: string;
|
|
91
|
+
moveFinalizerMessage?: string;
|
|
92
|
+
debugEventCount: number;
|
|
93
|
+
rawAppServerMessageCount: number;
|
|
94
|
+
codexItemCount: number;
|
|
95
|
+
assistantTranscriptCount: number;
|
|
96
|
+
};
|
|
97
|
+
export type StudioRawAppServerMessage = {
|
|
98
|
+
direction: "server-notification" | "server-request";
|
|
99
|
+
method?: string;
|
|
100
|
+
providerThreadId?: string;
|
|
101
|
+
providerTurnId?: string;
|
|
102
|
+
message: JsonRpcMessage;
|
|
103
|
+
at: string;
|
|
104
|
+
};
|
|
105
|
+
export type StudioCodexTurn = {
|
|
106
|
+
providerThreadId: string;
|
|
107
|
+
providerTurnId: string;
|
|
108
|
+
status: "started" | "completed";
|
|
109
|
+
startedAt?: string;
|
|
110
|
+
completedAt?: string;
|
|
111
|
+
};
|
|
112
|
+
export type StudioCodexItem = {
|
|
113
|
+
itemId: string;
|
|
114
|
+
providerThreadId?: string;
|
|
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 {};
|