@leitwerk-dev/process-analysis 0.1.2 → 0.1.4

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/dist/index.js CHANGED
@@ -1,595 +1,38 @@
1
- // src/index.ts
2
- import path3 from "path";
1
+ import path from "node:path";
3
2
  import { localRepoChangeCapabilities } from "@leitwerk-dev/local-repo-change";
4
3
  import { coreHostCapabilities } from "@leitwerk-dev/process-sdk";
5
-
6
- // src/process-definition.ts
7
- import { rm } from "fs/promises";
8
- import { trimString as trimString2 } from "@leitwerk-dev/domain";
9
- import {
10
- formatLocalRepoChangeLaunchErrors,
11
- localRepoChangeImportedPlanLauncherId
12
- } from "@leitwerk-dev/local-repo-change";
13
- import {
14
- createEmptyStructuralProcessState,
15
- flow,
16
- humanTurn,
17
- revisionAction
18
- } from "@leitwerk-dev/process-sdk";
19
-
20
- // src/actions.ts
21
- var processAnalysisActionIds = {
22
- completeAnalysis: "complete_analysis",
23
- askFollowup: "ask_followup",
24
- refineAnalysis: "refine_analysis",
25
- refreshSnapshot: "refresh_snapshot",
26
- startLocalRepoChange: "start_local_repo_change"
27
- };
28
- var followupForm = {
29
- id: "process_analysis_followup",
30
- title: "Follow up",
31
- fields: [
32
- {
33
- id: "message",
34
- label: "Question or refinement",
35
- kind: "textarea",
36
- primaryPrompt: true,
37
- required: true
38
- }
39
- ],
40
- submitLabel: "Send"
41
- };
42
- var handoffForm = {
43
- id: "process_analysis_handoff",
44
- title: "Start Local Repo Change",
45
- fields: [
46
- {
47
- id: "note",
48
- label: "Handoff note",
49
- kind: "textarea",
50
- primaryPrompt: true,
51
- description: "Optional implementation direction to prepend to the analysis."
52
- }
53
- ],
54
- submitLabel: "Start change"
55
- };
56
-
57
- // src/params.ts
58
- import { trimString } from "@leitwerk-dev/domain";
59
- var processAnalysisParamsCodec = {
60
- parse(value) {
61
- const record = typeof value === "object" && value !== null ? value : {};
62
- return {
63
- processRef: trimString(record.processRef),
64
- instruction: trimString(record.instruction),
65
- analysisCwd: trimString(record.analysisCwd)
66
- };
67
- },
68
- serialize(value) {
69
- return value;
70
- }
71
- };
72
- function validateProcessAnalysisLaunchInput(input) {
73
- const processRef = trimString(input.processRef);
74
- const instruction = trimString(input.instruction);
75
- const errors = [];
76
- if (!processRef)
77
- errors.push({ code: "required", fieldId: "processRef", message: "processRef is required" });
78
- if (!instruction)
79
- errors.push({ code: "required", fieldId: "instruction", message: "instruction is required" });
80
- return errors.length ? { ok: false, errors } : { ok: true, value: { processRef, instruction } };
81
- }
82
-
83
- // src/server-runtime.ts
84
- import { execFile as execFileCb } from "child_process";
85
- import path from "path";
86
- import { promisify } from "util";
87
- import { resolveGitBinary } from "@leitwerk-dev/process-sdk/git-binary";
88
- var execFile = promisify(execFileCb);
89
- var runtime = {
90
- analysisCwd: path.resolve(process.cwd()),
91
- serverBaseUrl: "http://localhost",
92
- processWorkspacesDir: null,
93
- processLaunches: null
94
- };
95
- function configureProcessAnalysisRuntime(overrides) {
96
- runtime.analysisCwd = overrides.analysisCwd ? path.resolve(overrides.analysisCwd) : runtime.analysisCwd;
97
- runtime.serverBaseUrl = overrides.serverBaseUrl ?? runtime.serverBaseUrl;
98
- runtime.processWorkspacesDir = overrides.processWorkspacesDir ?? null;
99
- runtime.processLaunches = overrides.processLaunches ?? null;
100
- }
101
- function getProcessAnalysisRuntime() {
102
- return runtime;
103
- }
104
- async function runGit(args) {
105
- try {
106
- const { stdout } = await execFile(resolveGitBinary(), ["-C", runtime.analysisCwd, ...args], {
107
- encoding: "utf8"
108
- });
109
- return stdout.trim();
110
- } catch {
111
- return null;
112
- }
113
- }
114
- async function isProcessAnalysisRuntimeGitRepo() {
115
- return await runGit(["rev-parse", "--is-inside-work-tree"]) === "true";
116
- }
117
- async function resolveProcessAnalysisRuntimeRepoConfig() {
118
- const originHead = await runGit([
119
- "symbolic-ref",
120
- "--quiet",
121
- "--short",
122
- "refs/remotes/origin/HEAD"
123
- ]);
124
- const baseBranch = originHead?.startsWith("origin/") ? originHead.slice("origin/".length) : "main";
125
- return {
126
- repoLocator: runtime.analysisCwd,
127
- baseBranch
128
- };
129
- }
130
-
131
- // src/snapshot-downloader.ts
132
- import { mkdir, writeFile } from "fs/promises";
133
- import path2 from "path";
134
-
135
- // src/process-ref.ts
136
- var ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]*$/;
137
- function resolveProcessRef(input) {
138
- const raw = input.processRef.trim();
139
- if (!raw) throw new Error("processRef is required");
140
- const currentOrigin = new URL(input.serverBaseUrl).origin;
141
- let id = "";
142
- if (ID_RE.test(raw) && !raw.includes("/")) {
143
- id = raw;
144
- } else {
145
- let url;
146
- try {
147
- url = raw.startsWith("/") ? new URL(raw, currentOrigin) : new URL(raw);
148
- } catch {
149
- throw new Error("processRef must be a process id or process URL");
150
- }
151
- if (url.protocol !== "http:" && url.protocol !== "https:")
152
- throw new Error("Only http(s) process URLs are supported");
153
- if (url.username || url.password)
154
- throw new Error("Credentials in process URLs are not allowed");
155
- const parts = url.pathname.split("/").filter(Boolean);
156
- const apiIndex = parts[0] === "api" ? 1 : 0;
157
- if (parts[apiIndex] !== "processes" || !parts[apiIndex + 1])
158
- throw new Error("URL must point to /processes/:id or /api/processes/:id");
159
- id = decodeURIComponent(parts[apiIndex + 1]);
160
- }
161
- if (!ID_RE.test(id)) throw new Error("process id is missing or invalid");
162
- return {
163
- id,
164
- origin: currentOrigin,
165
- apiUrl: `${currentOrigin}/api/processes/${encodeURIComponent(id)}`
166
- };
167
- }
168
-
169
- // src/snapshot-markdown.ts
170
- function fence(value, language = "json") {
171
- let marker = "```";
172
- while (value.includes(marker)) marker += "`";
173
- return `${marker}${language}
174
- ${value.endsWith("\n") ? value : `${value}
175
- `}${marker}`;
176
- }
177
- function jsonMarkdown(title, value) {
178
- return `# ${title}
179
-
180
- ${fence(JSON.stringify(value, null, 2))}
181
- `;
182
- }
183
- function buildSummaryMarkdown(input) {
184
- const detail = input.detail;
185
- return [
186
- "# Process snapshot summary",
187
- `- Source: ${input.sourceUrl}`,
188
- `- Process id: ${String(detail.id ?? "unknown")}`,
189
- `- Process type: ${String(detail.processId ?? "unknown")}`,
190
- `- Title: ${String(detail.title ?? "(untitled)")}`,
191
- `- Lifecycle: ${String(detail.lifecycleStatus ?? "unknown")}`,
192
- `- Selected turn: ${String(detail.selectedTurnId ?? "none")}`,
193
- "",
194
- "## Primary path",
195
- fence(JSON.stringify(input.primaryPath, null, 2))
196
- ].join("\n");
197
- }
198
- function buildRecordsMarkdown(title, value) {
199
- if (Array.isArray(value))
200
- return [
201
- `# ${title}`,
202
- "",
203
- ...value.map((item, i) => `## ${i + 1}
204
-
205
- ${fence(JSON.stringify(item, null, 2))}`)
206
- ].join("\n");
207
- return jsonMarkdown(title, value);
208
- }
209
-
210
- // src/snapshot-downloader.ts
211
- var SNAPSHOT_FETCH_TIMEOUT_MS = 3e4;
212
- async function fetchJson(url) {
213
- let response;
214
- try {
215
- response = await fetch(url, {
216
- headers: { accept: "application/json" },
217
- signal: AbortSignal.timeout(SNAPSHOT_FETCH_TIMEOUT_MS)
218
- });
219
- } catch (error) {
220
- const message = error instanceof Error ? error.message : String(error);
221
- throw new Error(`Network error fetching ${url}: ${message}`);
222
- }
223
- if (!response.ok)
224
- throw new Error(`Failed to fetch ${url}: ${response.status} ${response.statusText}`);
225
- try {
226
- return await response.json();
227
- } catch (error) {
228
- const message = error instanceof Error ? error.message : String(error);
229
- throw new Error(`Invalid JSON response from ${url}: ${message}`);
230
- }
231
- }
232
- async function writeJson(file, value) {
233
- await writeFile(file, `${JSON.stringify(value, null, 2)}
234
- `, "utf8");
235
- }
236
- async function downloadProcessSnapshot(input) {
237
- const runtime2 = getProcessAnalysisRuntime();
238
- if (!runtime2.processWorkspacesDir) throw new Error("processWorkspacesDir is not configured");
239
- const ref = resolveProcessRef({
240
- processRef: input.processRef,
241
- serverBaseUrl: runtime2.serverBaseUrl
242
- });
243
- const detail = await fetchJson(ref.apiUrl);
244
- const primaryPath = await fetchJson(`${ref.apiUrl}/primary-path`);
245
- const sourceWorkspace = path2.join(runtime2.processWorkspacesDir, ref.id);
246
- const baseDir = path2.join(
247
- sourceWorkspace,
248
- ".leitwerk",
249
- "process-analysis",
250
- input.analysisProcessId
251
- );
252
- await mkdir(baseDir, { recursive: true });
253
- await writeJson(path2.join(baseDir, "process-detail.json"), detail);
254
- await writeJson(path2.join(baseDir, "primary-path.json"), primaryPath);
255
- await writeFile(
256
- path2.join(baseDir, "summary.md"),
257
- buildSummaryMarkdown({ detail, primaryPath, sourceUrl: ref.apiUrl }),
258
- "utf8"
259
- );
260
- await writeFile(
261
- path2.join(baseDir, "turn-records.md"),
262
- buildRecordsMarkdown(
263
- "Turn records",
264
- detail.turnRecords ?? detail.turns ?? []
265
- ),
266
- "utf8"
267
- );
268
- await writeFile(
269
- path2.join(baseDir, "events.md"),
270
- buildRecordsMarkdown("Events", detail.events ?? []),
271
- "utf8"
272
- );
273
- await writeFile(
274
- path2.join(baseDir, "chronicle.md"),
275
- jsonMarkdown("Chronicle", detail.chronicle ?? detail),
276
- "utf8"
277
- );
278
- return {
279
- sourceProcessId: ref.id,
280
- apiUrl: ref.apiUrl,
281
- snapshotDir: baseDir,
282
- primaryPath,
283
- downloadedAt: (/* @__PURE__ */ new Date()).toISOString()
284
- };
285
- }
286
-
287
- // src/state.ts
288
- import { parseStructuralProcessState } from "@leitwerk-dev/process-sdk";
289
- function parseSnapshot(value) {
290
- if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
291
- const r = value;
292
- if (typeof r.sourceProcessId !== "string" || typeof r.snapshotDir !== "string") return null;
293
- return {
294
- sourceProcessId: r.sourceProcessId,
295
- apiUrl: typeof r.apiUrl === "string" ? r.apiUrl : "",
296
- snapshotDir: r.snapshotDir,
297
- primaryPath: r.primaryPath,
298
- downloadedAt: typeof r.downloadedAt === "string" ? r.downloadedAt : ""
299
- };
300
- }
301
- var processAnalysisStateCodec = {
302
- parse(value) {
303
- const r = typeof value === "object" && value !== null ? value : {};
304
- return {
305
- ...parseStructuralProcessState(r),
306
- snapshot: parseSnapshot(r.snapshot),
307
- pendingHandoffInput: r.pendingHandoffInput && typeof r.pendingHandoffInput === "object" ? r.pendingHandoffInput : null
308
- };
309
- },
310
- serialize(value) {
311
- return value;
312
- }
313
- };
314
-
315
- // src/process-definition.ts
316
- var turnIds = {
317
- downloadProcess: "download_process",
318
- analyzeProcess: "analyze_process",
319
- analysisDecision: "analysis_decision",
320
- handoff: "handoff_local_repo_change"
321
- };
322
- var products = { analysis: "analysis" };
323
- function analysisPrompt(ctx) {
324
- const snapshot = ctx.state.snapshot;
325
- if (!snapshot) throw new Error("No process snapshot is available for analysis");
326
- return [
327
- "Analyze the referenced leitwerk process for the operator.",
328
- "You are in read-only analysis mode. Use only read and bash inspection commands. Do not modify files.",
329
- "Run from the server launch directory shown below. Code/repo inspection must happen only from that analysis directory. Limit process-specific evidence to the downloaded snapshot directory unless the operator asks for repository code inspection.",
330
- `Original instruction:
331
- ${ctx.params.instruction}`,
332
- `Snapshot directory: ${snapshot.snapshotDir}
333
- Analysis directory: ${ctx.params.analysisCwd}
334
- Source: ${snapshot.apiUrl}`,
335
- "Publish a concise analysis with: findings, evidence, likely root cause, and recommended next steps. If a repository change is needed, include implementation guidance suitable for handoff."
336
- ].join("\n\n");
337
- }
338
- async function runHandoff(launchPlanner, ctx, input = {}) {
339
- const runtime2 = getProcessAnalysisRuntime();
340
- if (!runtime2.processLaunches) throw new Error("process launch service is not configured");
341
- const snapshot = ctx.state.snapshot;
342
- if (!snapshot) throw new Error("No process snapshot is available for handoff");
343
- if (!await isProcessAnalysisRuntimeGitRepo()) {
344
- throw new Error(
345
- `Cannot start Local Repo Change handoff: server launch directory is not a git repository (${runtime2.analysisCwd})`
346
- );
347
- }
348
- const runtimeRepo = await resolveProcessAnalysisRuntimeRepoConfig();
349
- const note = trimString2(input.note);
350
- const analysis = trimString2(input.analysisMarkdown);
351
- const prompt = [
352
- "Implement the fix identified by a process analysis handoff.",
353
- note ? `Operator handoff note:
354
- ${note}` : null,
355
- `Original analysis instruction:
356
- ${ctx.params.instruction}`
357
- ].filter(Boolean).join("\n\n");
358
- const importedPlanMarkdown = [
359
- "# Imported process-analysis plan",
360
- `- Source process: ${snapshot.sourceProcessId}`,
361
- `- Source URL: ${snapshot.apiUrl}`,
362
- `- Analysis process: ${ctx.process.id}`,
363
- `- Snapshot directory: ${snapshot.snapshotDir}`,
364
- "",
365
- "## Operator instruction",
366
- ctx.params.instruction,
367
- note ? `
368
- ## Handoff note
369
- ${note}` : "",
370
- "\n## Analysis",
371
- analysis || "No analysis markdown was available."
372
- ].join("\n");
373
- const metadata = {
374
- processAnalysisHandoff: {
375
- sourceAnalysisProcessId: ctx.process.id,
376
- sourceProcessId: snapshot.sourceProcessId,
377
- sourceProcessUrl: snapshot.apiUrl
378
- }
379
- };
380
- const planned = launchPlanner.plan({
381
- input: {
382
- launchKind: "imported_plan",
383
- repoLocator: runtimeRepo.repoLocator,
384
- baseBranch: runtimeRepo.baseBranch,
385
- workBranch: "",
386
- prompt,
387
- importedPlanMarkdown
4
+ import { createProcessAnalysisProcess } from "./process-definition.js";
5
+ import { configureProcessAnalysisRuntime } from "./server-runtime.js";
6
+ export const manifest = {
7
+ id: "process-analysis",
8
+ version: "0.1.0",
9
+ optional: ["local-repo-change"],
10
+ };
11
+ const processAnalysisExtension = {
12
+ manifest,
13
+ setupCatalog(api) {
14
+ const planner = api.get(localRepoChangeCapabilities.launchPlanner);
15
+ api.registerProcess(createProcessAnalysisProcess(Array.isArray(planner) ? undefined : planner));
388
16
  },
389
- metadata
390
- });
391
- if (!planned.ok) {
392
- throw new Error(
393
- `Invalid local repo change handoff input: ${formatLocalRepoChangeLaunchErrors(planned.errors)}`
394
- );
395
- }
396
- const handoffDedupKey = `process-analysis:${ctx.process.id}:local-repo-change`;
397
- const result = await runtime2.processLaunches.createProcessFromLaunchConfig({
398
- launcherId: localRepoChangeImportedPlanLauncherId,
399
- launchConfig: planned.launchConfig,
400
- handoffDedupKey
401
- });
402
- if (!result.ok) {
403
- throw new Error(`Failed to launch local repo change: ${JSON.stringify(result.body)}`);
404
- }
405
- return { linkedId: result.process.id, reused: result.reused };
406
- }
407
- var downloadTurn = flow.serverAutomatic(turnIds.downloadProcess).description("Download process snapshot").run(async (ctx) => {
408
- const snapshot = await downloadProcessSnapshot({
409
- analysisProcessId: ctx.process.id,
410
- processRef: ctx.params.processRef
411
- });
412
- return {
413
- outcome: "downloaded",
414
- params: {},
415
- markdown: `Downloaded process snapshot to ${snapshot.snapshotDir}.`,
416
- state: { ...ctx.state, snapshot }
417
- };
418
- }).outcome(
419
- "downloaded",
420
- (outcome) => outcome.description("Snapshot downloaded").to(turnIds.analyzeProcess)
421
- );
422
- var analyzeTurn = flow.llm(turnIds.analyzeProcess).description("Analyze process").tools("read", "bash").freshPrimary().buildPrompt(analysisPrompt).publish(products.analysis).to(turnIds.analysisDecision);
423
- function buildDecisionTurn(handoffAvailable) {
424
- const reviseAnalysis = (label) => revisionAction({
425
- label,
426
- acceptanceState: "neutral",
427
- form: followupForm,
428
- to: turnIds.analyzeProcess,
429
- queueTarget: { productName: products.analysis },
430
- schedulable: true
431
- });
432
- return humanTurn({
433
- description: "Review process analysis",
434
- reviewProduct: products.analysis,
435
- commentary: handoffAvailable ? "Ask follow-up questions, refresh the snapshot, or hand the analysis to a Local Repo Change process." : "Ask follow-up questions, refine the analysis, or refresh the snapshot.",
436
- actions: {
437
- [processAnalysisActionIds.completeAnalysis]: {
438
- label: "Complete analysis",
439
- acceptanceState: "accepted",
440
- complete: true
441
- },
442
- [processAnalysisActionIds.askFollowup]: reviseAnalysis("Ask follow-up"),
443
- [processAnalysisActionIds.refineAnalysis]: reviseAnalysis("Refine analysis"),
444
- [processAnalysisActionIds.refreshSnapshot]: {
445
- label: "Refresh snapshot",
446
- acceptanceState: "neutral",
447
- to: turnIds.downloadProcess
448
- },
449
- ...handoffAvailable ? {
450
- [processAnalysisActionIds.startLocalRepoChange]: {
451
- label: "Start Local Repo Change",
452
- acceptanceState: "accepted",
453
- form: handoffForm,
454
- to: turnIds.handoff,
455
- effect: ({ ctx, input }) => ({
456
- state: {
457
- ...ctx.state,
458
- pendingHandoffInput: {
459
- ...input,
460
- analysisMarkdown: ctx.readProductTurnResultMarkdown(products.analysis) ?? ""
461
- }
462
- }
463
- })
464
- }
465
- } : {}
466
- }
467
- });
468
- }
469
- function buildHandoffTurn(launchPlanner) {
470
- return flow.serverAutomatic(turnIds.handoff).description("Start Local Repo Change handoff").run(async (ctx) => {
471
- const result = await runHandoff(launchPlanner, ctx, ctx.state.pendingHandoffInput ?? {});
472
- return {
473
- outcome: "launched",
474
- params: { linkedProcessId: result.linkedId, reused: result.reused },
475
- markdown: `${result.reused ? "Reused" : "Created"} Local Repo Change process ${result.linkedId}.`,
476
- state: { ...ctx.state, pendingHandoffInput: null }
477
- };
478
- }).outcome(
479
- "launched",
480
- (outcome) => outcome.description("Local Repo Change process linked").requiredString("linkedProcessId", "Linked process id").boolean("reused", "Whether an existing handoff was reused").complete()
481
- );
482
- }
483
- function createProcessAnalysisProcess(launchPlanner) {
484
- let processBuilder = flow.process("process_analysis_process").displayName("Process Analysis").entry(turnIds.downloadProcess).codecs({ params: processAnalysisParamsCodec, state: processAnalysisStateCodec }).piConfig({ sessionCwdTemplate: "{{{analysisCwd}}}" }).initialState(() => ({
485
- ...createEmptyStructuralProcessState(),
486
- snapshot: null,
487
- pendingHandoffInput: null
488
- })).turn(downloadTurn).turn(analyzeTurn).turn({ id: turnIds.analysisDecision, definition: buildDecisionTurn(Boolean(launchPlanner)) });
489
- if (launchPlanner) {
490
- processBuilder = processBuilder.turn(buildHandoffTurn(launchPlanner));
491
- }
492
- return processBuilder.server((api) => {
493
- api.onCleanup(async (ctx) => {
494
- const snapshotDir = ctx.state.snapshot?.snapshotDir;
495
- if (!snapshotDir) return {};
496
- await rm(snapshotDir, { recursive: true, force: true });
497
- return { state: { ...ctx.state, snapshot: null } };
498
- });
499
- }).launcher((api) => {
500
- api.launcher({
501
- id: "process_analysis_process.ui_launcher",
502
- label: "Process Analysis",
503
- description: "Download an leitwerk process snapshot and analyze it read-only.",
504
- visibility: "ui",
505
- ui: {
506
- card: { title: "Process Analysis", description: "Analyze another process by id or URL." },
507
- launchConfigSchema: {
508
- id: "process_analysis_form",
509
- title: "Process Analysis",
510
- fields: [
511
- {
512
- id: "processRef",
513
- label: "Process id or URL",
514
- kind: "text",
515
- required: true,
516
- rememberRecentValues: true
517
- },
518
- { id: "instruction", label: "What to analyze", kind: "textarea", required: true }
519
- ],
520
- submitLabel: "Start analysis"
521
- },
522
- resolveDefaults() {
523
- return { processRef: "", instruction: "" };
524
- },
525
- resolveLaunchConfig(input) {
526
- const validated = validateProcessAnalysisLaunchInput(input);
527
- if (!validated.ok) return { ok: false, errors: validated.errors };
528
- const runtime2 = getProcessAnalysisRuntime();
529
- return {
530
- ok: true,
531
- launchConfig: {
532
- processId: "process_analysis_process",
533
- params: { ...validated.value, analysisCwd: runtime2.analysisCwd },
534
- startTurnId: turnIds.downloadProcess,
535
- titleSourceFields: [
536
- { label: "Analysis instruction", value: validated.value.instruction }
537
- ]
538
- }
539
- };
17
+ setupServer(api) {
18
+ const deps = api.get(coreHostCapabilities.serverSetup);
19
+ if (deps && !Array.isArray(deps)) {
20
+ configureProcessAnalysisRuntime({
21
+ analysisCwd: path.resolve(process.cwd()),
22
+ serverBaseUrl: deps.serverBaseUrl,
23
+ processWorkspacesDir: deps.processWorkspacesDir ?? null,
24
+ processLaunches: deps.processLaunches,
25
+ });
540
26
  }
541
- }
542
- });
543
- }).define();
544
- }
545
- var processAnalysisProcess = createProcessAnalysisProcess();
546
- var processAnalysisTurnIds = turnIds;
547
-
548
- // src/index.ts
549
- var manifest = {
550
- id: "process-analysis",
551
- version: "0.1.0",
552
- optional: ["local-repo-change"]
553
- };
554
- var processAnalysisExtension = {
555
- manifest,
556
- setupCatalog(api) {
557
- const planner = api.get(localRepoChangeCapabilities.launchPlanner);
558
- api.registerProcess(createProcessAnalysisProcess(Array.isArray(planner) ? void 0 : planner));
559
- },
560
- setupServer(api) {
561
- const deps = api.get(coreHostCapabilities.serverSetup);
562
- if (deps && !Array.isArray(deps)) {
563
- configureProcessAnalysisRuntime({
564
- analysisCwd: path3.resolve(process.cwd()),
565
- serverBaseUrl: deps.serverBaseUrl,
566
- processWorkspacesDir: deps.processWorkspacesDir ?? null,
567
- processLaunches: deps.processLaunches
568
- });
569
- }
570
- }
571
- };
572
- var index_default = processAnalysisExtension;
573
- export {
574
- buildRecordsMarkdown,
575
- buildSummaryMarkdown,
576
- configureProcessAnalysisRuntime,
577
- createProcessAnalysisProcess,
578
- index_default as default,
579
- downloadProcessSnapshot,
580
- followupForm,
581
- getProcessAnalysisRuntime,
582
- handoffForm,
583
- isProcessAnalysisRuntimeGitRepo,
584
- jsonMarkdown,
585
- manifest,
586
- processAnalysisActionIds,
587
- processAnalysisParamsCodec,
588
- processAnalysisProcess,
589
- processAnalysisStateCodec,
590
- processAnalysisTurnIds,
591
- resolveProcessAnalysisRuntimeRepoConfig,
592
- resolveProcessRef,
593
- validateProcessAnalysisLaunchInput
27
+ },
594
28
  };
29
+ export default processAnalysisExtension;
30
+ export * from "./actions.js";
31
+ export * from "./params.js";
32
+ export * from "./process-definition.js";
33
+ export * from "./process-ref.js";
34
+ export * from "./server-runtime.js";
35
+ export * from "./snapshot-downloader.js";
36
+ export * from "./snapshot-markdown.js";
37
+ export * from "./state.js";
595
38
  //# sourceMappingURL=index.js.map