@bastani/atomic 0.9.19-alpha.10 → 0.9.19-alpha.11

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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.19-alpha.11] - 2026-09-13
6
+
7
+ ### Fixed
8
+
9
+ - Repeated nested `ctx.workflow()` invocations no longer collide on Intercom route ownership during model fallback.
10
+
5
11
  ## [0.9.19-alpha.10] - 2026-09-13
6
12
 
7
13
  ### Added
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
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": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
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": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
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": [
@@ -6,6 +6,12 @@ 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.19-alpha.11] - 2026-09-13
10
+
11
+ ### Fixed
12
+
13
+ - Repeated nested `ctx.workflow()` invocations use unambiguous Intercom boundary identities, preventing duplicate-owner and heavy-initialization warnings during model fallback while preserving route ownership checks.
14
+
9
15
  ## [0.9.19-alpha.10] - 2026-09-13
10
16
 
11
17
  ### Added
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -68525,19 +68525,57 @@ function formatWorkflowStageTarget(rootRunId, ...segments) {
68525
68525
 
68526
68526
  // dist/builtin/workflows/src/shared/pending-stage-status.ts
68527
68527
  function workflowBoundarySegments(runs, runId) {
68528
+ return createWorkflowBoundarySegmentsResolver(runs)(runId);
68529
+ }
68530
+ function createWorkflowBoundarySegmentsResolver(runs) {
68528
68531
  const runById = new Map(runs.map((run) => [run.id, run]));
68529
- const segments = [];
68530
- let current = runById.get(runId);
68531
- while (current !== undefined && current.parentRunId !== undefined) {
68532
- const parent = runById.get(current.parentRunId);
68533
- const boundary = parent?.stages.find((stage) => stage.id === current?.parentStageId);
68534
- if (parent === undefined || boundary === undefined)
68535
- return;
68536
- const boundaryName = boundary.name;
68537
- segments.unshift(boundaryName.length > 0 && !boundaryName.includes("/") && !boundaryName.includes("*") ? boundaryName : current.id);
68538
- current = parent;
68532
+ const stagesByRun = new Map;
68533
+ const childrenByParent = new Map;
68534
+ for (const run of runs) {
68535
+ const byId = new Map;
68536
+ const byName = new Map;
68537
+ for (const stage of run.stages) {
68538
+ const ids = byId.get(stage.id) ?? [];
68539
+ ids.push(stage);
68540
+ byId.set(stage.id, ids);
68541
+ const names = byName.get(stage.name) ?? [];
68542
+ names.push(stage);
68543
+ byName.set(stage.name, names);
68544
+ }
68545
+ stagesByRun.set(run.id, { byId, byName });
68546
+ if (run.parentRunId === undefined || run.parentStageId === undefined)
68547
+ continue;
68548
+ const byStage = childrenByParent.get(run.parentRunId) ?? new Map;
68549
+ const children = byStage.get(run.parentStageId) ?? [];
68550
+ children.push(run);
68551
+ byStage.set(run.parentStageId, children);
68552
+ childrenByParent.set(run.parentRunId, byStage);
68539
68553
  }
68540
- return current === undefined ? undefined : segments;
68554
+ const cachedSegments = new Map;
68555
+ return (runId) => {
68556
+ if (cachedSegments.has(runId))
68557
+ return cachedSegments.get(runId);
68558
+ const segments = [];
68559
+ let current = runById.get(runId);
68560
+ while (current !== undefined && current.parentRunId !== undefined) {
68561
+ const parent = runById.get(current.parentRunId);
68562
+ const stages = stagesByRun.get(current.parentRunId);
68563
+ const boundary = current.parentStageId === undefined ? undefined : stages?.byId.get(current.parentStageId)?.[0];
68564
+ if (parent === undefined || stages === undefined || boundary === undefined) {
68565
+ cachedSegments.set(runId, undefined);
68566
+ return;
68567
+ }
68568
+ const boundaryName = boundary.name;
68569
+ const matchingBoundaries = stages.byId.get(boundaryName) ?? stages.byName.get(boundaryName);
68570
+ const matchingBoundary = matchingBoundaries?.length === 1 ? matchingBoundaries[0] : undefined;
68571
+ const children = matchingBoundary === undefined ? undefined : childrenByParent.get(parent.id)?.get(matchingBoundary.id);
68572
+ segments.unshift(boundaryName.length > 0 && !boundaryName.includes("/") && !boundaryName.includes("*") && children?.length === 1 && children[0]?.id === current.id ? boundaryName : current.id);
68573
+ current = parent;
68574
+ }
68575
+ const result = current === undefined ? undefined : segments;
68576
+ cachedSegments.set(runId, result);
68577
+ return result;
68578
+ };
68541
68579
  }
68542
68580
  function workflowBoundaryHops(runs, runId) {
68543
68581
  const runById = new Map(runs.map((run) => [run.id, run]));
@@ -113030,6 +113068,7 @@ function registerPendingStageIntercomBridge(pi, activeStore) {
113030
113068
  return;
113031
113069
  const ownedRunIds = new Set;
113032
113070
  const runs = activeStore.runs();
113071
+ const resolveBoundarySegments = createWorkflowBoundarySegmentsResolver(runs);
113033
113072
  for (const run of runs) {
113034
113073
  const rootRunId = durableRootRunIdForRun(runs, run.id);
113035
113074
  if (rootRunId === undefined)
@@ -113050,7 +113089,7 @@ function registerPendingStageIntercomBridge(pi, activeStore) {
113050
113089
  ...run.stages.filter((stage) => !isNonAgentStage(stage) && workflowInvocationOwnsGroup(workflowInvocationIntercomGroup(rootRunId), stage.intercomGroup ?? workflowInvocationIntercomGroup(rootRunId))).map((stage) => ({
113051
113090
  stageId: stage.id,
113052
113091
  stageName: stage.name,
113053
- target: stageRouteTarget(runs, rootRunId, run.id, stage.id),
113092
+ target: stageRouteTarget(runs, rootRunId, run.id, stage.id, resolveBoundarySegments),
113054
113093
  lifecycle: stage.sessionId === undefined && stage.sessionFile === undefined ? "pending" : "running",
113055
113094
  routeEligible: stage.pendingStageDeliveryAvailable === true && (stage.status === "pending" || stage.status === "running" || stage.status === "awaiting_input" || stage.status === "paused" || stage.status === "blocked"),
113056
113095
  group: stage.intercomGroup ?? workflowInvocationIntercomGroup(rootRunId)
@@ -113058,7 +113097,7 @@ function registerPendingStageIntercomBridge(pi, activeStore) {
113058
113097
  ...nonAgentNodes(run).map((node) => ({
113059
113098
  stageId: node.id,
113060
113099
  stageName: node.name,
113061
- target: stageRouteTarget(runs, rootRunId, run.id, node.id),
113100
+ target: stageRouteTarget(runs, rootRunId, run.id, node.id, resolveBoundarySegments),
113062
113101
  lifecycle: "pending",
113063
113102
  routeEligible: false,
113064
113103
  recipientPurpose: "control",
@@ -113181,8 +113220,8 @@ function registerPendingStageIntercomBridge(pi, activeStore) {
113181
113220
  pi.on?.("session_shutdown", dispose);
113182
113221
  return dispose;
113183
113222
  }
113184
- function stageRouteTarget(runs, rootRunId, runId, stageId) {
113185
- const boundarySegments = runId === rootRunId ? [] : workflowBoundarySegments(runs, runId);
113223
+ function stageRouteTarget(runs, rootRunId, runId, stageId, resolveBoundarySegments = (id) => workflowBoundarySegments(runs, id)) {
113224
+ const boundarySegments = runId === rootRunId ? [] : resolveBoundarySegments(runId);
113186
113225
  return formatWorkflowStageTarget(rootRunId, ...boundarySegments ?? [runId], stageId);
113187
113226
  }
113188
113227
  function possibleStageRows(runs, rootRunId, rootRun) {
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bastani/atomic",
9
- "version": "0.9.19-alpha.10",
9
+ "version": "0.9.19-alpha.11",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@bastani/atomic-natives": "0.9.19-alpha.10",
13
- "@bastani/pi-ai": "0.9.19-alpha.10",
12
+ "@bastani/atomic-natives": "0.9.19-alpha.11",
13
+ "@bastani/pi-ai": "0.9.19-alpha.11",
14
14
  "@dbos-inc/dbos-sdk": "4.25.14",
15
15
  "@earendil-works/pi-agent-core": "0.85.1",
16
16
  "@earendil-works/pi-client": "0.85.1",
@@ -518,18 +518,18 @@
518
518
  }
519
519
  },
520
520
  "node_modules/@bastani/atomic-natives": {
521
- "version": "0.9.19-alpha.10",
522
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.19-alpha.10.tgz",
521
+ "version": "0.9.19-alpha.11",
522
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.19-alpha.11.tgz",
523
523
  "license": "MIT",
524
524
  "optionalDependencies": {
525
- "@bastani/atomic-natives-darwin-arm64": "0.9.19-alpha.10",
526
- "@bastani/atomic-natives-darwin-x64": "0.9.19-alpha.10",
527
- "@bastani/atomic-natives-linux-arm64-gnu": "0.9.19-alpha.10",
528
- "@bastani/atomic-natives-linux-arm64-musl": "0.9.19-alpha.10",
529
- "@bastani/atomic-natives-linux-x64-gnu": "0.9.19-alpha.10",
530
- "@bastani/atomic-natives-linux-x64-musl": "0.9.19-alpha.10",
531
- "@bastani/atomic-natives-win32-arm64-msvc": "0.9.19-alpha.10",
532
- "@bastani/atomic-natives-win32-x64-msvc": "0.9.19-alpha.10"
525
+ "@bastani/atomic-natives-darwin-arm64": "0.9.19-alpha.11",
526
+ "@bastani/atomic-natives-darwin-x64": "0.9.19-alpha.11",
527
+ "@bastani/atomic-natives-linux-arm64-gnu": "0.9.19-alpha.11",
528
+ "@bastani/atomic-natives-linux-arm64-musl": "0.9.19-alpha.11",
529
+ "@bastani/atomic-natives-linux-x64-gnu": "0.9.19-alpha.11",
530
+ "@bastani/atomic-natives-linux-x64-musl": "0.9.19-alpha.11",
531
+ "@bastani/atomic-natives-win32-arm64-msvc": "0.9.19-alpha.11",
532
+ "@bastani/atomic-natives-win32-x64-msvc": "0.9.19-alpha.11"
533
533
  },
534
534
  "engines": {
535
535
  "bun": ">=1.4.2",
@@ -537,8 +537,8 @@
537
537
  }
538
538
  },
539
539
  "node_modules/@bastani/atomic-natives-darwin-arm64": {
540
- "version": "0.9.19-alpha.10",
541
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.19-alpha.10.tgz",
540
+ "version": "0.9.19-alpha.11",
541
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.19-alpha.11.tgz",
542
542
  "license": "MIT",
543
543
  "os": [
544
544
  "darwin"
@@ -549,8 +549,8 @@
549
549
  "optional": true
550
550
  },
551
551
  "node_modules/@bastani/atomic-natives-darwin-x64": {
552
- "version": "0.9.19-alpha.10",
553
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.19-alpha.10.tgz",
552
+ "version": "0.9.19-alpha.11",
553
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.19-alpha.11.tgz",
554
554
  "license": "MIT",
555
555
  "os": [
556
556
  "darwin"
@@ -561,8 +561,8 @@
561
561
  "optional": true
562
562
  },
563
563
  "node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
564
- "version": "0.9.19-alpha.10",
565
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.19-alpha.10.tgz",
564
+ "version": "0.9.19-alpha.11",
565
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.19-alpha.11.tgz",
566
566
  "license": "MIT",
567
567
  "os": [
568
568
  "linux"
@@ -576,8 +576,8 @@
576
576
  "optional": true
577
577
  },
578
578
  "node_modules/@bastani/atomic-natives-linux-arm64-musl": {
579
- "version": "0.9.19-alpha.10",
580
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.19-alpha.10.tgz",
579
+ "version": "0.9.19-alpha.11",
580
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.19-alpha.11.tgz",
581
581
  "license": "MIT",
582
582
  "os": [
583
583
  "linux"
@@ -591,8 +591,8 @@
591
591
  "optional": true
592
592
  },
593
593
  "node_modules/@bastani/atomic-natives-linux-x64-gnu": {
594
- "version": "0.9.19-alpha.10",
595
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.19-alpha.10.tgz",
594
+ "version": "0.9.19-alpha.11",
595
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.19-alpha.11.tgz",
596
596
  "license": "MIT",
597
597
  "os": [
598
598
  "linux"
@@ -606,8 +606,8 @@
606
606
  "optional": true
607
607
  },
608
608
  "node_modules/@bastani/atomic-natives-linux-x64-musl": {
609
- "version": "0.9.19-alpha.10",
610
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.19-alpha.10.tgz",
609
+ "version": "0.9.19-alpha.11",
610
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.19-alpha.11.tgz",
611
611
  "license": "MIT",
612
612
  "os": [
613
613
  "linux"
@@ -621,8 +621,8 @@
621
621
  "optional": true
622
622
  },
623
623
  "node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
624
- "version": "0.9.19-alpha.10",
625
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.19-alpha.10.tgz",
624
+ "version": "0.9.19-alpha.11",
625
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.19-alpha.11.tgz",
626
626
  "license": "MIT",
627
627
  "os": [
628
628
  "win32"
@@ -633,8 +633,8 @@
633
633
  "optional": true
634
634
  },
635
635
  "node_modules/@bastani/atomic-natives-win32-x64-msvc": {
636
- "version": "0.9.19-alpha.10",
637
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.19-alpha.10.tgz",
636
+ "version": "0.9.19-alpha.11",
637
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.19-alpha.11.tgz",
638
638
  "license": "MIT",
639
639
  "os": [
640
640
  "win32"
@@ -645,8 +645,8 @@
645
645
  "optional": true
646
646
  },
647
647
  "node_modules/@bastani/pi-ai": {
648
- "version": "0.9.19-alpha.10",
649
- "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.19-alpha.10.tgz",
648
+ "version": "0.9.19-alpha.11",
649
+ "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.19-alpha.11.tgz",
650
650
  "license": "MIT",
651
651
  "dependencies": {
652
652
  "@anthropic-ai/sdk": "0.124.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.19-alpha.10",
3
+ "version": "0.9.19-alpha.11",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "atomicConfig": {
@@ -79,8 +79,8 @@
79
79
  "prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
80
80
  },
81
81
  "dependencies": {
82
- "@bastani/atomic-natives": "0.9.19-alpha.10",
83
- "@bastani/pi-ai": "0.9.19-alpha.10",
82
+ "@bastani/atomic-natives": "0.9.19-alpha.11",
83
+ "@bastani/pi-ai": "0.9.19-alpha.11",
84
84
  "@dbos-inc/dbos-sdk": "4.25.14",
85
85
  "@earendil-works/pi-agent-core": "0.85.1",
86
86
  "@earendil-works/pi-client": "0.85.1",