@bastani/atomic 0.9.41-alpha.1 → 0.9.41-alpha.2

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/builtin/intercom/package.json +2 -2
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/package.json +3 -3
  5. package/dist/builtin/web-access/package.json +2 -2
  6. package/dist/builtin/workflows/CHANGELOG.md +8 -0
  7. package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
  8. package/dist/builtin/workflows/builtin/{chunk-qjqn389g.js → chunk-2jfst7e4.js} +72 -10
  9. package/dist/builtin/workflows/builtin/{chunk-4bwtzyjq.js → chunk-49kkbdpr.js} +1 -1
  10. package/dist/builtin/workflows/builtin/{chunk-qdd897wm.js → chunk-apagcs4r.js} +1 -1
  11. package/dist/builtin/workflows/builtin/{chunk-454hz1qt.js → chunk-dcxscfnb.js} +1 -1
  12. package/dist/builtin/workflows/builtin/{chunk-bjva9j5k.js → chunk-hx8v4p97.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-85mx6wcf.js → chunk-k5q3t7je.js} +1 -1
  14. package/dist/builtin/workflows/builtin/{chunk-8kkv04hz.js → chunk-n2gkzkty.js} +1 -1
  15. package/dist/builtin/workflows/builtin/{chunk-y45tkftg.js → chunk-txbc93t6.js} +1 -1
  16. package/dist/builtin/workflows/builtin/{chunk-x0vvjyzg.js → chunk-w4xp1w1f.js} +1 -1
  17. package/dist/builtin/workflows/builtin/{chunk-5eh0brtd.js → chunk-z3pajrfs.js} +1 -1
  18. package/dist/builtin/workflows/builtin/classify-and-act.js +2 -2
  19. package/dist/builtin/workflows/builtin/fan-out-and-synthesize.js +2 -2
  20. package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
  21. package/dist/builtin/workflows/builtin/goal.js +2 -2
  22. package/dist/builtin/workflows/builtin/index.js +10 -10
  23. package/dist/builtin/workflows/builtin/loop-until-done.js +2 -2
  24. package/dist/builtin/workflows/builtin/open-claude-design.js +2 -2
  25. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  26. package/dist/builtin/workflows/builtin/tournament.js +2 -2
  27. package/dist/builtin/workflows/package.json +2 -2
  28. package/dist/builtin/workflows/src/extension/index.bundle.mjs +511 -28
  29. package/dist/builtin/workflows/src/index.js +582 -99
  30. package/dist/core/model-config.d.ts +28 -0
  31. package/dist/core/model-config.d.ts.map +1 -1
  32. package/dist/core/provider-composer-internal.d.ts +2 -1
  33. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  34. package/dist/core/provider-composer-internal.js +8 -6
  35. package/dist/core/provider-composer-internal.js.map +1 -1
  36. package/dist/core/tools/grep.js +1 -1
  37. package/dist/core/tools/grep.js.map +1 -1
  38. package/docs/models-configuration.md +9 -0
  39. package/docs/models.md +3 -1
  40. package/docs/providers.md +1 -1
  41. package/docs/workflows/authoring.md +1 -1
  42. package/npm-shrinkwrap.json +67 -54
  43. package/package.json +6 -6
  44. package/schemas/models.schema.json +21 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.41-alpha.2] - 2026-10-22
6
+
7
+ Workflows that drop a promise stop crashing Atomic, and classifiers can read images.
8
+
9
+ - **Workflow failures stay inside their run:** an unhandled `ctx` rejection, a stray `ctx.exit()`, or a branch that outlives a kill or quit now fails or ends only its own run instead of the whole process, and `/workflow status` can inspect runs whose child workflows were still starting ([#3846](https://github.com/bastani-inc/atomic/issues/3846), [#3849](https://github.com/bastani-inc/atomic/pull/3849))
10
+ - **Image input for more classifiers:** `models.classify()` accepts `images` for Jev and Clef on Cloudflare Workers AI and OpenRouter, with corrected Workers AI pricing and `compat` settings for proxies ([#3847](https://github.com/bastani-inc/atomic/pull/3847))
11
+ - **Terminal and rendering fixes:** Rex terminal support, terminal modes restored on unexpected exit, Markdown tables after unclosed `$$` blocks, CJK emphasis, `@` autocomplete with regex characters, and a `grep` tool that ignores your ripgrep config ([#3847](https://github.com/bastani-inc/atomic/pull/3847))
12
+
13
+ ### Added
14
+
15
+ - Codemode `models.classify()` now also accepts `images` for TypeSafe's Jev and Cloudflare's Clef models on `cloudflare-workers-ai` and OpenRouter, next to Jev on `typesafe`, and lists Clef Omni and Jev 1.14 on Workers AI. See [Use classifier models](docs/models.md#use-classifier-models). Provider-level `compat` in `models.json` now also applies to classifier models, with the System One fields `imageInput` and `sendImageOptInHeader` for proxies that serve another service's classifiers. Extension classifier models accept `compat` too. See [Models Configuration](docs/models-configuration.md#typesafe-system-one).
16
+ - Added support for the Rex terminal (`TERM_PROGRAM=rex`): OSC 8 hyperlinks, truecolor, and inline images. Links previously fell back to the `text (url)` format ([#11131](https://github.com/earendil-works/pi/issues/11131), [#11150](https://github.com/earendil-works/pi/pull/11150) by [@petrroll](https://github.com/petrroll), [#11183](https://github.com/earendil-works/pi/pull/11183) by [@nihaals](https://github.com/nihaals))
17
+
18
+ ### Fixed
19
+
20
+ - Fixed Cloudflare Workers AI classifier pricing: Clef Flash costs $0.038 and Jev $0.042 per million input tokens instead of Jev being listed as free.
21
+ - Fixed the `grep` tool following ripgrep's `RIPGREP_CONFIG_PATH` whenever it searches with `rg`, such as with `literal: true`, where config options like `--ignore-case` silently changed what the tool returned. The tool now runs `rg --no-config` ([#11203](https://github.com/earendil-works/pi/issues/11203))
22
+ - Fixed `@` file autocomplete returning no results for queries containing regex metacharacters such as `[` or `(` ([#10972](https://github.com/earendil-works/pi/issues/10972))
23
+ - Fixed an unclosed `$$` display-math block swallowing or corrupting every Markdown table after it ([#11159](https://github.com/earendil-works/pi/issues/11159))
24
+ - Fixed terminal modes (mouse tracking, focus reporting, Kitty keyboard protocol, bracketed paste, alternate screen) staying enabled when the process exits without calling `stop()`. A process `exit` handler now restores them synchronously ([#11170](https://github.com/earendil-works/pi/issues/11170))
25
+ - Fixed Markdown bold and italic not rendering next to CJK punctuation ([#10730](https://github.com/earendil-works/pi/pull/10730) by [@theBucky](https://github.com/theBucky))
26
+ - A rejection that workflow code leaves unhandled no longer ends the whole Atomic process. This covers a rejected `ctx.tool`, `ctx.task`, `ctx.chain`, `ctx.parallel`, `ctx.workflow`, `ctx.ui` prompt (`input`, `confirm`, `select`, `editor` or `custom`) or stage method call (`prompt`, `complete`, `steer`, `sendUserMessage`, `setModel`, `compact` and the other promise-returning stage methods), including one that is started and never awaited (`void ctx.task(...)` used to leave the run `completed` with no sign of the failure), a `ctx.tool` call made after its run has stopped (`ctx.tool admission is closed for this run`), a string, number or `undefined` thrown from a `ctx.tool` callback, and an error the workflow file throws or receives from `fs` itself, for example in a rolling pool that keeps `branch.finally(...)` as a separate promise. It also covers `ctx.exit()` called inside such a branch, which ends the run as exited with the status and outputs it asked for (on Bun the process used to end right after the run reported `completed`), and a child workflow's own branch that uses `ctx` after its parent exited. Stopping a run no longer ends the process either: a branch that keeps running after `/workflow quit`, a kill, or an abort signal from the code that started the run, and then calls `ctx.stage`, `ctx.task`, `ctx.workflow` or `ctx.exit()`, or that was waiting on a `ctx.ui` prompt when the run was killed, could end it with `workflow killed` (a kill), the quit error (`/workflow quit`), an `AbortError` or `atomic-workflows: HIL aborted` right after the run reported `killed` or `paused`, and the run keeps that status. `ctx.exit()` called in such a branch while the run is paused ends the run as exited once the run resumes, and a kill of the paused run still ends it as `killed` (on Node it used to end as `failed` with `Workflow exit is waiting for explicit resume`, and on Bun the process ended). The rejection fails its own run when it surfaces before that run decides its final status, so other runs, stages, and the interactive engine keep going; a `ctx.task`, `ctx.chain`, `ctx.parallel`, `ctx.workflow`, `ctx.ui` or stage method rejection that the workflow awaits or catches reaches that code unchanged and does not fail the run. Once the run has ended, an error that a `ctx` call rejected with, what `ctx.exit()` threw and the reason the run was stopped with are ignored (the reason of a kill is the string `workflow killed`, which is ignored by value for the rest of the process, so a branch that wakes up long after the run ended is covered too), and so is an error thrown by the workflow file for the next 30 seconds, so the remaining branches of a failing pool cannot end the process; a later one ends it as before. On Node the owning run is identified exactly; on Bun a `ctx` call's rejection, what `ctx.exit()` threw and the reason the run was stopped with are matched by identity (a `ctx` call's string, number or `undefined` only within the event-loop turn in which the call rejected, and the string a kill uses by value), and an error thrown by the workflow file itself is matched through its stack to the run of the file that calls `workflow()`, but only when no other run of that file is running or has run at the same time (a child workflow defined in the same file does not count), so a primitive thrown outside a `ctx` call on Bun is still fatal, and an error that either of two overlapping runs of one file could have thrown ends the process as before instead of failing a run that may be healthy. This works the same in the bundled install as in a source checkout. A rejection that belongs to no workflow run, including one raised by Atomic's own code, ends the process as before, with its original error and stack, and `--unhandled-rejections=warn|none|warn-with-error-code` are honored ([#3846](https://github.com/bastani-inc/atomic/issues/3846))
27
+ - A workflow that omits `name` is now named after the file that defines it when Atomic runs from the bundled install, as it already was in a source checkout, instead of after the bundled extension file (`index.bundle`) ([#3846](https://github.com/bastani-inc/atomic/issues/3846))
28
+ - `/workflow status <runId>` no longer reports `durable checkpoint topology is malformed or incomplete` for a running or crashed run whose child `ctx.workflow` calls have started but not yet recorded a stage or tool of their own, such as a pool of concurrent children when the process was killed. The children now show as running, and a crashed run can be inspected and resumed. A run that fails while such children are still starting now cancels them first, so its status can be inspected as well ([#3846](https://github.com/bastani-inc/atomic/issues/3846))
29
+
5
30
  ## [0.9.41-alpha.1] - 2026-10-21
6
31
 
7
32
  ### Breaking Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.9.41-alpha.1",
3
+ "version": "0.9.41-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@bastani/atomic": "*",
47
- "@earendil-works/pi-tui": "^1.3.0",
47
+ "@earendil-works/pi-tui": "^1.4.0",
48
48
  "typebox": "*"
49
49
  },
50
50
  "peerDependenciesMeta": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.9.41-alpha.1",
3
+ "version": "0.9.41-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic's pi-compatible MCP integration for server connections, OAuth, tools, resources, and terminal management.",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.41-alpha.1",
3
+ "version": "0.9.41-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -35,8 +35,8 @@
35
35
  "peerDependencies": {
36
36
  "@bastani/atomic": "*",
37
37
  "@bastani/pi-ai": "*",
38
- "@earendil-works/pi-agent-core": "^1.3.0",
39
- "@earendil-works/pi-tui": "^1.3.0",
38
+ "@earendil-works/pi-agent-core": "^1.4.0",
39
+ "@earendil-works/pi-tui": "^1.4.0",
40
40
  "typebox": "*"
41
41
  },
42
42
  "peerDependenciesMeta": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.41-alpha.1",
3
+ "version": "0.9.41-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@bastani/atomic": "*",
34
- "@earendil-works/pi-tui": "^1.3.0"
34
+ "@earendil-works/pi-tui": "^1.4.0"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@bastani/atomic": {
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.41-alpha.2] - 2026-10-22
10
+
11
+ ### Fixed
12
+
13
+ - A rejection that workflow code leaves unhandled no longer ends the whole Atomic process. This covers a rejected `ctx.tool`, `ctx.task`, `ctx.chain`, `ctx.parallel`, `ctx.workflow`, `ctx.ui` prompt (`input`, `confirm`, `select`, `editor` or `custom`) or stage method call (`prompt`, `complete`, `steer`, `sendUserMessage`, `setModel`, `compact` and the other promise-returning stage methods), including one that is started and never awaited (`void ctx.task(...)` used to leave the run `completed` with no sign of the failure), a `ctx.tool` call made after its run has stopped (`ctx.tool admission is closed for this run`), a string, number or `undefined` thrown from a `ctx.tool` callback, and an error the workflow file throws or receives from `fs` itself, for example in a rolling pool that keeps `branch.finally(...)` as a separate promise. It also covers `ctx.exit()` called inside such a branch, which ends the run as exited with the status and outputs it asked for (on Bun the process used to end right after the run reported `completed`), and a child workflow's own branch that uses `ctx` after its parent exited. Stopping a run no longer ends the process either: a branch that keeps running after `/workflow quit`, a kill, or an abort signal from the code that started the run, and then calls `ctx.stage`, `ctx.task`, `ctx.workflow` or `ctx.exit()`, or that was waiting on a `ctx.ui` prompt when the run was killed, could end it with `workflow killed` (a kill), the quit error (`/workflow quit`), an `AbortError` or `atomic-workflows: HIL aborted` right after the run reported `killed` or `paused`, and the run keeps that status. `ctx.exit()` called in such a branch while the run is paused ends the run as exited once the run resumes, and a kill of the paused run still ends it as `killed` (on Node it used to end as `failed` with `Workflow exit is waiting for explicit resume`, and on Bun the process ended). The rejection fails its own run when it surfaces before that run decides its final status, so other runs, stages, and the interactive engine keep going; a `ctx.task`, `ctx.chain`, `ctx.parallel`, `ctx.workflow`, `ctx.ui` or stage method rejection that the workflow awaits or catches reaches that code unchanged and does not fail the run. Once the run has ended, an error that a `ctx` call rejected with, what `ctx.exit()` threw and the reason the run was stopped with are ignored (the reason of a kill is the string `workflow killed`, which is ignored by value for the rest of the process, so a branch that wakes up long after the run ended is covered too), and so is an error thrown by the workflow file for the next 30 seconds, so the remaining branches of a failing pool cannot end the process; a later one ends it as before. On Node the owning run is identified exactly; on Bun a `ctx` call's rejection, what `ctx.exit()` threw and the reason the run was stopped with are matched by identity (a `ctx` call's string, number or `undefined` only within the event-loop turn in which the call rejected, and the string a kill uses by value), and an error thrown by the workflow file itself is matched through its stack to the run of the file that calls `workflow()`, but only when no other run of that file is running or has run at the same time (a child workflow defined in the same file does not count), so a primitive thrown outside a `ctx` call on Bun is still fatal, and an error that either of two overlapping runs of one file could have thrown ends the process as before instead of failing a run that may be healthy. This works the same in the bundled install as in a source checkout. A rejection that belongs to no workflow run, including one raised by Atomic's own code, ends the process as before, with its original error and stack, and `--unhandled-rejections=warn|none|warn-with-error-code` are honored ([#3846](https://github.com/bastani-inc/atomic/issues/3846))
14
+ - A workflow that omits `name` is now named after the file that defines it when Atomic runs from the bundled install, as it already was in a source checkout, instead of after the bundled extension file (`index.bundle`) ([#3846](https://github.com/bastani-inc/atomic/issues/3846))
15
+ - `/workflow status <runId>` no longer reports `durable checkpoint topology is malformed or incomplete` for a running or crashed run whose child `ctx.workflow` calls have started but not yet recorded a stage or tool of their own, such as a pool of concurrent children when the process was killed. The children now show as running, and a crashed run can be inspected and resumed. A run that fails while such children are still starting now cancels them first, so its status can be inspected as well ([#3846](https://github.com/bastani-inc/atomic/issues/3846))
16
+
9
17
  ## [0.9.41-alpha.1] - 2026-10-21
10
18
 
11
19
  ### Added
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  adversarial_verification_default
3
- } from "./chunk-qdd897wm.js";
3
+ } from "./chunk-apagcs4r.js";
4
4
  import"./chunk-2377r57g.js";
5
5
  import"./chunk-n1910xc4.js";
6
- import"./chunk-qjqn389g.js";
6
+ import"./chunk-2jfst7e4.js";
7
7
  import"./chunk-9cm2ckq2.js";
8
8
  export {
9
9
  adversarial_verification_default as default
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // dist/builtin/workflows/src/authoring/workflow.ts
6
6
  import { basename } from "node:path";
7
- import { fileURLToPath } from "node:url";
7
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
8
8
 
9
9
  // dist/builtin/workflows/src/shared/budget.ts
10
10
  function validateWorkflowBudget(value, label = "budget") {
@@ -37,6 +37,59 @@ function assertWorkflowBudget(value, label = "budget") {
37
37
  // dist/builtin/workflows/src/shared/workflow-heartbeat-contract.ts
38
38
  var DEFAULT_WORKFLOW_HEARTBEAT_INTERVAL_MINUTES = 15;
39
39
 
40
+ // dist/builtin/workflows/src/runs/shared/prompt-callsite.ts
41
+ import { fileURLToPath } from "node:url";
42
+ var PACKAGED_WORKFLOW_RUNTIME_ROOTS = ["/dist/builtin/workflows/src/"];
43
+ function normalizeSlashes(path) {
44
+ return path.replace(/\\/g, "/");
45
+ }
46
+ function normalizeStackPath(framePath) {
47
+ let normalized = framePath;
48
+ if (normalized.startsWith("file://")) {
49
+ try {
50
+ normalized = fileURLToPath(normalized);
51
+ } catch {
52
+ try {
53
+ normalized = decodeURIComponent(new URL(normalized).pathname);
54
+ } catch {}
55
+ }
56
+ }
57
+ normalized = normalizeSlashes(normalized).replace(/^\/([A-Za-z]:\/)/, "$1");
58
+ return normalized;
59
+ }
60
+ function currentModuleRuntimeRoot() {
61
+ const modulePath = normalizeStackPath(fileURLToPath(import.meta.url));
62
+ const markers = ["packages/workflows/src/", ...PACKAGED_WORKFLOW_RUNTIME_ROOTS.map((root) => root.slice(1))];
63
+ for (const marker of markers) {
64
+ const index = modulePath.indexOf(marker);
65
+ if (index >= 0)
66
+ return modulePath.slice(0, index + marker.length);
67
+ }
68
+ return;
69
+ }
70
+ var CURRENT_WORKFLOW_RUNTIME_ROOT = currentModuleRuntimeRoot();
71
+ function isWorkflowRuntimeFrame(normalizedPath) {
72
+ const path = normalizeSlashes(normalizedPath);
73
+ if (path.startsWith("packages/workflows/src/"))
74
+ return true;
75
+ if (CURRENT_WORKFLOW_RUNTIME_ROOT !== undefined && path.startsWith(CURRENT_WORKFLOW_RUNTIME_ROOT)) {
76
+ return true;
77
+ }
78
+ const comparable = path.startsWith("/") ? path : `/${path}`;
79
+ return PACKAGED_WORKFLOW_RUNTIME_ROOTS.some((runtimeRoot) => comparable.includes(runtimeRoot));
80
+ }
81
+
82
+ // dist/builtin/workflows/src/shared/workflow-source.ts
83
+ var WORKFLOW_SOURCES = new WeakMap;
84
+ var OWN_MODULE_PATH = normalizeStackPath(import.meta.url);
85
+ function isWorkflowRuntimeModule(path) {
86
+ const normalized = normalizeStackPath(path);
87
+ return normalized === OWN_MODULE_PATH || isWorkflowRuntimeFrame(normalized);
88
+ }
89
+ function recordWorkflowSource(definition, path) {
90
+ WORKFLOW_SOURCES.set(definition, path);
91
+ }
92
+
40
93
  // dist/builtin/workflows/src/workflows/identity.ts
41
94
  function normalizeWorkflowName(name) {
42
95
  if (!name || typeof name !== "string") {
@@ -67,7 +120,7 @@ function stackFilePath(line) {
67
120
  if (!rawPath.startsWith("file://"))
68
121
  return rawPath;
69
122
  try {
70
- return fileURLToPath(rawPath);
123
+ return fileURLToPath2(rawPath);
71
124
  } catch {
72
125
  return;
73
126
  }
@@ -78,8 +131,10 @@ function isWorkflowAuthoringImplementationFrame(filePath) {
78
131
  return false;
79
132
  return normalized.includes("/packages/workflows/") || normalized.includes("/dist/builtin/workflows/") || normalized.includes("/.atomic/agent/extensions/workflows/");
80
133
  }
81
- function workflowNameFromCaller() {
82
- const stack = new Error().stack;
134
+ function callerSourcePath(entry) {
135
+ const capture = new Error;
136
+ Error.captureStackTrace(capture, entry);
137
+ const stack = capture.stack;
83
138
  if (stack === undefined)
84
139
  return;
85
140
  for (const line of stack.split(`
@@ -89,14 +144,18 @@ function workflowNameFromCaller() {
89
144
  continue;
90
145
  if (isWorkflowAuthoringImplementationFrame(filePath))
91
146
  continue;
92
- const base = basename(filePath.replace(/\\/g, "/")).replace(/\.[cm]?[jt]sx?$/, "");
93
- if (base.length > 0)
94
- return base;
147
+ return isWorkflowRuntimeModule(filePath) ? undefined : filePath;
95
148
  }
96
149
  return;
97
150
  }
98
- function resolveWorkflowName(name) {
99
- const resolved = name ?? workflowNameFromCaller();
151
+ function workflowNameFromSourcePath(filePath) {
152
+ if (filePath === undefined)
153
+ return;
154
+ const base = basename(filePath.replace(/\\/g, "/")).replace(/\.[cm]?[jt]sx?$/, "");
155
+ return base.length > 0 ? base : undefined;
156
+ }
157
+ function resolveWorkflowName(name, sourcePath) {
158
+ const resolved = name ?? workflowNameFromSourcePath(sourcePath);
100
159
  if (resolved === undefined) {
101
160
  throw new TypeError("workflow: name must be provided when caller filename cannot be inferred");
102
161
  }
@@ -132,7 +191,8 @@ function workflow(spec) {
132
191
  throw new TypeError("workflow: heartbeatIntervalMinutes must be a non-negative finite number");
133
192
  }
134
193
  assertWorkflowBudget(spec.budget, "workflow: budget");
135
- const name = resolveWorkflowName(spec.name);
194
+ const source = callerSourcePath(workflow);
195
+ const name = resolveWorkflowName(spec.name, source);
136
196
  const normalizedName = normalizeWorkflowName(name);
137
197
  requireNonEmptyString(normalizedName, "normalized name");
138
198
  const frozenInputs = freezeSchemaMap(spec.inputs ?? {});
@@ -154,6 +214,8 @@ function workflow(spec) {
154
214
  run
155
215
  };
156
216
  const branded = stampWorkflowDefinition(definition);
217
+ if (source !== undefined)
218
+ recordWorkflowSource(branded, source);
157
219
  return Object.freeze(branded);
158
220
  }
159
221
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  parse_rubric,
7
7
  normalize_criteria,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  parse_rubric,
7
7
  normalize_criteria,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  score_progress,
7
7
  classify_trend
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  stableArtifactRoot
7
7
  } from "./chunk-rc5ec5xx.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
 
6
6
  // dist/builtin/workflows/builtin/open-claude-design.ts
7
7
  import { Type as Type2 } from "typebox";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  keepContext,
7
7
  REVIEWER_CALIBRATION_RULES,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  keepContext,
7
7
  REVIEWER_CALIBRATION_RULES,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  stableArtifactRoot
7
7
  } from "./chunk-rc5ec5xx.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  workflow,
3
3
  withBuiltinContext
4
- } from "./chunk-qjqn389g.js";
4
+ } from "./chunk-2jfst7e4.js";
5
5
  import {
6
6
  scoring_prompt_reads,
7
7
  build_scoring_prompt
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  DEFAULT_ACTION_CATEGORIES2,
3
3
  classify_and_act_default
4
- } from "./chunk-bjva9j5k.js";
5
- import"./chunk-qjqn389g.js";
4
+ } from "./chunk-hx8v4p97.js";
5
+ import"./chunk-2jfst7e4.js";
6
6
  import"./chunk-9cm2ckq2.js";
7
7
  export {
8
8
  DEFAULT_ACTION_CATEGORIES2 as DEFAULT_ACTION_CATEGORIES,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  fan_out_and_synthesize_default
3
- } from "./chunk-x0vvjyzg.js";
4
- import"./chunk-qjqn389g.js";
3
+ } from "./chunk-w4xp1w1f.js";
4
+ import"./chunk-2jfst7e4.js";
5
5
  import"./chunk-9cm2ckq2.js";
6
6
  export {
7
7
  fan_out_and_synthesize_default as default
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  generate_and_filter_default
3
- } from "./chunk-5eh0brtd.js";
3
+ } from "./chunk-z3pajrfs.js";
4
4
  import"./chunk-2377r57g.js";
5
5
  import"./chunk-n1910xc4.js";
6
- import"./chunk-qjqn389g.js";
6
+ import"./chunk-2jfst7e4.js";
7
7
  import"./chunk-9cm2ckq2.js";
8
8
  export {
9
9
  generate_and_filter_default as default
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  goal_default
3
- } from "./chunk-y45tkftg.js";
3
+ } from "./chunk-txbc93t6.js";
4
4
  import"./chunk-8x61e0s7.js";
5
5
  import"./chunk-2377r57g.js";
6
6
  import"./chunk-z0d03ktm.js";
7
7
  import"./chunk-n1910xc4.js";
8
- import"./chunk-qjqn389g.js";
8
+ import"./chunk-2jfst7e4.js";
9
9
  import"./chunk-9cm2ckq2.js";
10
10
  export {
11
11
  goal_default as default
@@ -1,36 +1,36 @@
1
- import"./chunk-qjqn389g.js";
1
+ import"./chunk-2jfst7e4.js";
2
2
  import"./chunk-9cm2ckq2.js";
3
3
  import"./chunk-n1910xc4.js";
4
4
  import"./chunk-2377r57g.js";
5
5
  import {
6
6
  adversarial_verification_default
7
- } from "./chunk-qdd897wm.js";
7
+ } from "./chunk-apagcs4r.js";
8
8
  import {
9
9
  classify_and_act_default
10
- } from "./chunk-bjva9j5k.js";
10
+ } from "./chunk-hx8v4p97.js";
11
11
  import {
12
12
  fan_out_and_synthesize_default
13
- } from "./chunk-x0vvjyzg.js";
13
+ } from "./chunk-w4xp1w1f.js";
14
14
  import {
15
15
  generate_and_filter_default
16
- } from "./chunk-5eh0brtd.js";
16
+ } from "./chunk-z3pajrfs.js";
17
17
  import {
18
18
  goal_default
19
- } from "./chunk-y45tkftg.js";
19
+ } from "./chunk-txbc93t6.js";
20
20
  import"./chunk-8x61e0s7.js";
21
21
  import"./chunk-z0d03ktm.js";
22
22
  import {
23
23
  open_claude_design_default
24
- } from "./chunk-85mx6wcf.js";
24
+ } from "./chunk-k5q3t7je.js";
25
25
  import {
26
26
  loop_until_done_default
27
- } from "./chunk-454hz1qt.js";
27
+ } from "./chunk-dcxscfnb.js";
28
28
  import {
29
29
  ralph_default
30
- } from "./chunk-8kkv04hz.js";
30
+ } from "./chunk-n2gkzkty.js";
31
31
  import {
32
32
  tournament_default
33
- } from "./chunk-4bwtzyjq.js";
33
+ } from "./chunk-49kkbdpr.js";
34
34
  export {
35
35
  adversarial_verification_default as adversarialVerification,
36
36
  classify_and_act_default as classifyAndAct,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  loop_until_done_default
3
- } from "./chunk-454hz1qt.js";
3
+ } from "./chunk-dcxscfnb.js";
4
4
  import"./chunk-z0d03ktm.js";
5
5
  import"./chunk-n1910xc4.js";
6
- import"./chunk-qjqn389g.js";
6
+ import"./chunk-2jfst7e4.js";
7
7
  import"./chunk-9cm2ckq2.js";
8
8
  export {
9
9
  loop_until_done_default as default
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  open_claude_design_default
3
- } from "./chunk-85mx6wcf.js";
4
- import"./chunk-qjqn389g.js";
3
+ } from "./chunk-k5q3t7je.js";
4
+ import"./chunk-2jfst7e4.js";
5
5
  import"./chunk-9cm2ckq2.js";
6
6
  export {
7
7
  open_claude_design_default as default
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ralph_default
3
- } from "./chunk-8kkv04hz.js";
3
+ } from "./chunk-n2gkzkty.js";
4
4
  import"./chunk-8x61e0s7.js";
5
5
  import"./chunk-2377r57g.js";
6
6
  import"./chunk-z0d03ktm.js";
7
7
  import"./chunk-n1910xc4.js";
8
- import"./chunk-qjqn389g.js";
8
+ import"./chunk-2jfst7e4.js";
9
9
  import"./chunk-9cm2ckq2.js";
10
10
  export {
11
11
  ralph_default as default
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  tournament_default
3
- } from "./chunk-4bwtzyjq.js";
3
+ } from "./chunk-49kkbdpr.js";
4
4
  import"./chunk-2377r57g.js";
5
5
  import"./chunk-n1910xc4.js";
6
- import"./chunk-qjqn389g.js";
6
+ import"./chunk-2jfst7e4.js";
7
7
  import"./chunk-9cm2ckq2.js";
8
8
  export {
9
9
  tournament_default as default
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.41-alpha.1",
3
+ "version": "0.9.41-alpha.2",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -85,7 +85,7 @@
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@bastani/atomic": "*",
88
- "@earendil-works/pi-tui": "^1.3.0",
88
+ "@earendil-works/pi-tui": "^1.4.0",
89
89
  "typebox": "*"
90
90
  },
91
91
  "peerDependenciesMeta": {