wave-agent-sdk 0.19.3 → 0.19.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.
@@ -16,7 +16,12 @@ export declare class BackgroundTaskManager {
16
16
  private workdir;
17
17
  constructor(container: Container, options: BackgroundTaskManagerOptions);
18
18
  private get notificationQueue();
19
- private notifyTasksChange;
19
+ /**
20
+ * Fire the onBackgroundTasksChange callback so UI consumers refresh.
21
+ * Public so other managers (e.g. WorkflowManager) can trigger a refresh
22
+ * when their state changes without mutating a background task.
23
+ */
24
+ notifyTasksChange(): void;
20
25
  generateId(): string;
21
26
  addTask(task: BackgroundTask): void;
22
27
  getTask(id: string): BackgroundTask | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"backgroundTaskManager.d.ts","sourceRoot":"","sources":["../../src/managers/backgroundTaskManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,EAAE,cAAc,EAAmB,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,8BAA8B;IAC7C,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,IAAI,CAAC;CAC7D;AAED,MAAM,WAAW,4BAA4B;IAC3C,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAC3C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,qBAAqB;IAO9B,OAAO,CAAC,SAAS;IANnB,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,OAAO,CAAS;gBAGd,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,4BAA4B;IAMvC,OAAO,KAAK,iBAAiB,GAE5B;IAED,OAAO,CAAC,iBAAiB;IAIlB,UAAU,IAAI,MAAM;IA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,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,qBAAqB;IAO9B,OAAO,CAAC,SAAS;IANnB,OAAO,CAAC,KAAK,CAAqC;IAClD,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,SAAS,CAAiC;IAClD,OAAO,CAAC,OAAO,CAAS;gBAGd,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,4BAA4B;IAMvC,OAAO,KAAK,iBAAiB,GAE5B;IAED;;;;OAIG;IACI,iBAAiB,IAAI,IAAI;IAIzB,UAAU,IAAI,MAAM;IAIpB,OAAO,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IAKnC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI/C,WAAW,IAAI,cAAc,EAAE;IAI/B,UAAU,CACf,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,MAAM,IAAI,CAAA;KAAE;IA8KnD,YAAY,CACjB,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,MAAM,EACf,aAAa,GAAE,MAAW,EAC1B,aAAa,GAAE,MAAW,GACzB,MAAM;IAqIF,SAAS,CACd,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,MAAM,GACd;QACD,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAoCD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAgC7B,OAAO,IAAI,IAAI;CAUvB"}
@@ -15,6 +15,11 @@ export class BackgroundTaskManager {
15
15
  get notificationQueue() {
16
16
  return this.container.get("NotificationQueue");
17
17
  }
18
+ /**
19
+ * Fire the onBackgroundTasksChange callback so UI consumers refresh.
20
+ * Public so other managers (e.g. WorkflowManager) can trigger a refresh
21
+ * when their state changes without mutating a background task.
22
+ */
18
23
  notifyTasksChange() {
19
24
  this.callbacks.onBackgroundTasksChange?.(Array.from(this.tasks.values()));
20
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"workflowManager.d.ts","sourceRoot":"","sources":["../../src/managers/workflowManager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAelD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAOxD,qBAAa,eAAe;IAC1B,OAAO,CAAC,IAAI,CAAkC;IAC9C,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,OAAO,CAAC,gBAAgB,CAAmD;IAC3E,OAAO,CAAC,SAAS,CAAY;IAC7B,OAAO,CAAC,aAAa,CAA8B;gBAEvC,SAAS,EAAE,SAAS;IAKhC,OAAO,KAAK,UAAU,GAOrB;IAED,OAAO,KAAK,qBAAqB,GAEhC;IAED,OAAO,KAAK,iBAAiB,GAE5B;IAED,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,KAAK,OAAO,GAElB;IAED,OAAO,KAAK,UAAU,GASrB;IAED;;;OAGG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,OAAO,EACd,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1D,OAAO,CAAC,WAAW,CAAC;IAoDvB;;;OAGG;IACG,QAAQ,CACZ,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAClC,OAAO,CAAC,IAAI,CAAC;IA2NhB;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,I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AAI,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAC1D,OAAO,CAAC,WAAW,CAAC;IAoDvB;;;OAGG;IACG,QAAQ,CACZ,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAClC,OAAO,CAAC,IAAI,CAAC;IA6NhB;;OAEG;IACG,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7C;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAY5B;;;OAGG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAUlD;;OAEG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBlE;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAsB5B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAcxC;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAI9C;;OAEG;IACH,OAAO,IAAI,IAAI;CAkBhB"}
@@ -112,9 +112,16 @@ export class WorkflowManager {
112
112
  ? run.args.budget
113
113
  : null);
114
114
  const progressReporter = new ProgressReporter(run.meta, runId);
115
- // Forward progress events via onProgress callback
115
+ // Forward progress events: mirror live counts onto the WorkflowRun and
116
+ // trigger a UI refresh so /workflows updates mid-execution (not just at
117
+ // completion). The UI reads getWorkflowRuns() -> listRuns(), which returns
118
+ // these same in-memory run objects.
116
119
  const onProgress = (event) => {
117
120
  logger.debug(`[Workflow:${runId}] progress: ${event.type} phase=${event.phaseIndex} agent=${event.agentIndex}`);
121
+ run.phases = progressReporter.getPhaseStates();
122
+ run.totalAgents = progressReporter.totalAgents;
123
+ run.totalTokens = progressReporter.totalTokens;
124
+ this.backgroundTaskManager.notifyTasksChange();
118
125
  };
119
126
  progressReporter.onEvent(onProgress);
120
127
  // Journal — load previous journal if resuming
@@ -175,9 +182,6 @@ export class WorkflowManager {
175
182
  sessionDir: this.sessionDir,
176
183
  runDir: path.join(this.sessionDir, "workflows", runId),
177
184
  agentControllers: runAgentControllers,
178
- onProgress: (event) => {
179
- logger.debug(`[Workflow:${runId}] progress: ${event.type} phase=${event.phaseIndex} agent=${event.agentIndex}`);
180
- },
181
185
  onLog: (message) => {
182
186
  logger.info(`[Workflow:${runId}] ${message}`);
183
187
  },
@@ -1,7 +1,7 @@
1
1
  import { relative, join, isAbsolute } from "path";
2
2
  import * as fs from "fs";
3
3
  import { logger } from "../utils/globalLogger.js";
4
- import { getDisplayPath } from "../utils/path.js";
4
+ import { getDisplayPath, toPosixPath } from "../utils/path.js";
5
5
  import { LSP_TOOL_NAME } from "../constants/tools.js";
6
6
  export const MAX_RESULTS = 1000;
7
7
  export const MAX_FILES = 100;
@@ -25,10 +25,10 @@ function formatUri(uri, workdir) {
25
25
  const relativePath = relative(workdir, path);
26
26
  if (relativePath.length < path.length &&
27
27
  !relativePath.startsWith("../../")) {
28
- return relativePath;
28
+ return toPosixPath(relativePath);
29
29
  }
30
30
  }
31
- return path;
31
+ return toPosixPath(path);
32
32
  }
33
33
  /**
34
34
  * Formats an error message when no results are found, including context from the file
@@ -6,10 +6,16 @@
6
6
  */
7
7
  export declare function resolvePath(filePath: string, workdir: string): string;
8
8
  /**
9
- * Get relative path for display, use relative path if shorter and not in parent directory
9
+ * Get relative path for display, use relative path if shorter and not in parent directory.
10
+ *
11
+ * The returned path is always normalized to forward slashes (posix) regardless of
12
+ * platform. This keeps display output consistent across Windows/Unix so that logs,
13
+ * LLM context, and tests don't need platform-specific branches — `path.relative`
14
+ * and `path.join` produce backslashes on Windows, which we collapse here.
15
+ *
10
16
  * @param filePath Absolute path
11
17
  * @param workdir Working directory
12
- * @returns Path for display (relative or absolute)
18
+ * @returns Path for display (relative or absolute), always forward-slash
13
19
  */
14
20
  export declare function getDisplayPath(filePath: string, workdir: string): string;
15
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/utils/path.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAarE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBxE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C"}
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/utils/path.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAarE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAwBxE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7C"}
@@ -20,10 +20,16 @@ export function resolvePath(filePath, workdir) {
20
20
  return resolve(workdir, filePath);
21
21
  }
22
22
  /**
23
- * Get relative path for display, use relative path if shorter and not in parent directory
23
+ * Get relative path for display, use relative path if shorter and not in parent directory.
24
+ *
25
+ * The returned path is always normalized to forward slashes (posix) regardless of
26
+ * platform. This keeps display output consistent across Windows/Unix so that logs,
27
+ * LLM context, and tests don't need platform-specific branches — `path.relative`
28
+ * and `path.join` produce backslashes on Windows, which we collapse here.
29
+ *
24
30
  * @param filePath Absolute path
25
31
  * @param workdir Working directory
26
- * @returns Path for display (relative or absolute)
32
+ * @returns Path for display (relative or absolute), always forward-slash
27
33
  */
28
34
  export function getDisplayPath(filePath, workdir) {
29
35
  if (!filePath) {
@@ -38,13 +44,13 @@ export function getDisplayPath(filePath, workdir) {
38
44
  // If the relative path is shorter than the absolute path and does not start with .. (not in parent directory), use the relative path
39
45
  if (relativePath.length < filePath.length &&
40
46
  !relativePath.startsWith("..")) {
41
- return relativePath;
47
+ return toPosixPath(relativePath);
42
48
  }
43
49
  }
44
50
  catch {
45
51
  // If calculating the relative path fails, keep the original path
46
52
  }
47
- return filePath;
53
+ return toPosixPath(filePath);
48
54
  }
49
55
  /**
50
56
  * Convert backslashes to forward slashes for shell compatibility on Windows.
@@ -1 +1 @@
1
- {"version":3,"file":"pathEncoder.d.ts","sourceRoot":"","sources":["../../src/utils/pathEncoder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAA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
37
37
  let encoded = pathToEncode;
38
- // Remove leading slash to avoid empty directory names
39
- if (encoded.startsWith("/")) {
38
+ // Remove Windows drive letter prefix (e.g. "D:") so encoded names are
39
+ // stable across platforms — path.resolve("/home/user/project") yields
40
+ // "D:\home\user\project" on Windows and we want the same encoded name
41
+ // as on Linux ("home-user-project").
42
+ encoded = encoded.replace(/^[a-zA-Z]:/, "");
43
+ // Remove leading slash/backslash to avoid empty directory names
44
+ if (encoded.startsWith("/") || encoded.startsWith("\\")) {
40
45
  encoded = encoded.substring(1);
41
46
  }
42
47
  // Replace path separators with hyphens
@@ -3,7 +3,7 @@ import { ConcurrencyLimiter } from "./concurrencyLimiter.js";
3
3
  import { BudgetTracker } from "./budgetTracker.js";
4
4
  import { ProgressReporter } from "./progressReporter.js";
5
5
  import { Journal } from "./journal.js";
6
- import type { BudgetInfo, WorkflowProgressEvent } from "./types.js";
6
+ import type { BudgetInfo } from "./types.js";
7
7
  interface WorkflowApiContext {
8
8
  subagentManager: SubagentManager;
9
9
  concurrencyLimiter: ConcurrencyLimiter;
@@ -21,8 +21,6 @@ interface WorkflowApiContext {
21
21
  runDir: string;
22
22
  /** Per-agent abort controllers for kill/skip support */
23
23
  agentControllers: Map<number, AbortController>;
24
- /** Optional callback for progress events */
25
- onProgress?: (event: WorkflowProgressEvent) => void;
26
24
  }
27
25
  interface AgentOpts {
28
26
  label?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"workflowApis.d.ts","sourceRoot":"","sources":["../../src/workflow/workflowApis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,KAA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": "SDK for building AI-powered development tools and agents",
5
5
  "keywords": [
6
6
  "ai",
@@ -16,7 +16,7 @@ async function main() {
16
16
  }
17
17
 
18
18
  const manifestContent = fs.readFileSync(MANIFEST_PATH, "utf-8");
19
- const jsonContent = manifestContent.replace(/^#!.*\n/, "");
19
+ const jsonContent = manifestContent.replace(/^#!.*\r?\n/, "");
20
20
  const manifest = JSON.parse(jsonContent);
21
21
  const platforms = manifest.platforms;
22
22
 
@@ -35,7 +35,12 @@ export class BackgroundTaskManager {
35
35
  return this.container.get<NotificationQueue>("NotificationQueue")!;
36
36
  }
37
37
 
38
- private notifyTasksChange(): void {
38
+ /**
39
+ * Fire the onBackgroundTasksChange callback so UI consumers refresh.
40
+ * Public so other managers (e.g. WorkflowManager) can trigger a refresh
41
+ * when their state changes without mutating a background task.
42
+ */
43
+ public notifyTasksChange(): void {
39
44
  this.callbacks.onBackgroundTasksChange?.(Array.from(this.tasks.values()));
40
45
  }
41
46
 
@@ -164,13 +164,20 @@ export class WorkflowManager {
164
164
  );
165
165
  const progressReporter = new ProgressReporter(run.meta, runId);
166
166
 
167
- // Forward progress events via onProgress callback
167
+ // Forward progress events: mirror live counts onto the WorkflowRun and
168
+ // trigger a UI refresh so /workflows updates mid-execution (not just at
169
+ // completion). The UI reads getWorkflowRuns() -> listRuns(), which returns
170
+ // these same in-memory run objects.
168
171
  const onProgress = (
169
172
  event: import("../workflow/types.js").WorkflowProgressEvent,
170
173
  ) => {
171
174
  logger.debug(
172
175
  `[Workflow:${runId}] progress: ${event.type} phase=${event.phaseIndex} agent=${event.agentIndex}`,
173
176
  );
177
+ run.phases = progressReporter.getPhaseStates();
178
+ run.totalAgents = progressReporter.totalAgents;
179
+ run.totalTokens = progressReporter.totalTokens;
180
+ this.backgroundTaskManager.notifyTasksChange();
174
181
  };
175
182
  progressReporter.onEvent(onProgress);
176
183
 
@@ -251,11 +258,6 @@ export class WorkflowManager {
251
258
  sessionDir: this.sessionDir,
252
259
  runDir: path.join(this.sessionDir, "workflows", runId),
253
260
  agentControllers: runAgentControllers,
254
- onProgress: (event) => {
255
- logger.debug(
256
- `[Workflow:${runId}] progress: ${event.type} phase=${event.phaseIndex} agent=${event.agentIndex}`,
257
- );
258
- },
259
261
  onLog: (message: string) => {
260
262
  logger.info(`[Workflow:${runId}] ${message}`);
261
263
  },
@@ -2,7 +2,7 @@ import type { ToolPlugin, ToolResult, ToolContext } from "./types.js";
2
2
  import { relative, join, isAbsolute } from "path";
3
3
  import * as fs from "fs";
4
4
  import { logger } from "../utils/globalLogger.js";
5
- import { getDisplayPath } from "../utils/path.js";
5
+ import { getDisplayPath, toPosixPath } from "../utils/path.js";
6
6
  import { LSP_TOOL_NAME } from "../constants/tools.js";
7
7
  import type {
8
8
  LspLocation as Location,
@@ -45,10 +45,10 @@ function formatUri(uri: string, workdir?: string): string {
45
45
  relativePath.length < path.length &&
46
46
  !relativePath.startsWith("../../")
47
47
  ) {
48
- return relativePath;
48
+ return toPosixPath(relativePath);
49
49
  }
50
50
  }
51
- return path;
51
+ return toPosixPath(path);
52
52
  }
53
53
 
54
54
  /**
package/src/utils/path.ts CHANGED
@@ -24,10 +24,16 @@ export function resolvePath(filePath: string, workdir: string): string {
24
24
  }
25
25
 
26
26
  /**
27
- * Get relative path for display, use relative path if shorter and not in parent directory
27
+ * Get relative path for display, use relative path if shorter and not in parent directory.
28
+ *
29
+ * The returned path is always normalized to forward slashes (posix) regardless of
30
+ * platform. This keeps display output consistent across Windows/Unix so that logs,
31
+ * LLM context, and tests don't need platform-specific branches — `path.relative`
32
+ * and `path.join` produce backslashes on Windows, which we collapse here.
33
+ *
28
34
  * @param filePath Absolute path
29
35
  * @param workdir Working directory
30
- * @returns Path for display (relative or absolute)
36
+ * @returns Path for display (relative or absolute), always forward-slash
31
37
  */
32
38
  export function getDisplayPath(filePath: string, workdir: string): string {
33
39
  if (!filePath) {
@@ -47,12 +53,12 @@ export function getDisplayPath(filePath: string, workdir: string): string {
47
53
  relativePath.length < filePath.length &&
48
54
  !relativePath.startsWith("..")
49
55
  ) {
50
- return relativePath;
56
+ return toPosixPath(relativePath);
51
57
  }
52
58
  } catch {
53
59
  // If calculating the relative path fails, keep the original path
54
60
  }
55
- return filePath;
61
+ return toPosixPath(filePath);
56
62
  }
57
63
 
58
64
  /**
@@ -86,8 +86,14 @@ export class PathEncoder {
86
86
  // Convert to safe directory name
87
87
  let encoded = pathToEncode;
88
88
 
89
- // Remove leading slash to avoid empty directory names
90
- if (encoded.startsWith("/")) {
89
+ // Remove Windows drive letter prefix (e.g. "D:") so encoded names are
90
+ // stable across platforms — path.resolve("/home/user/project") yields
91
+ // "D:\home\user\project" on Windows and we want the same encoded name
92
+ // as on Linux ("home-user-project").
93
+ encoded = encoded.replace(/^[a-zA-Z]:/, "");
94
+
95
+ // Remove leading slash/backslash to avoid empty directory names
96
+ if (encoded.startsWith("/") || encoded.startsWith("\\")) {
91
97
  encoded = encoded.substring(1);
92
98
  }
93
99
 
@@ -5,7 +5,7 @@ import { ConcurrencyLimiter } from "./concurrencyLimiter.js";
5
5
  import { BudgetTracker } from "./budgetTracker.js";
6
6
  import { ProgressReporter } from "./progressReporter.js";
7
7
  import { Journal } from "./journal.js";
8
- import type { BudgetInfo, AgentMeta, WorkflowProgressEvent } from "./types.js";
8
+ import type { BudgetInfo, AgentMeta } from "./types.js";
9
9
  import {
10
10
  createStructuredOutputPrompt,
11
11
  createStructuredOutputTool,
@@ -54,8 +54,6 @@ interface WorkflowApiContext {
54
54
  runDir: string;
55
55
  /** Per-agent abort controllers for kill/skip support */
56
56
  agentControllers: Map<number, AbortController>;
57
- /** Optional callback for progress events */
58
- onProgress?: (event: WorkflowProgressEvent) => void;
59
57
  }
60
58
 
61
59
  interface AgentOpts {