@bastani/atomic 0.9.26 → 0.9.27-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  3. package/dist/builtin/intercom/index.bundle.mjs +21 -6
  4. package/dist/builtin/intercom/package.json +1 -1
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/subagents/src/extension/index.bundle.mjs +693 -642
  9. package/dist/builtin/web-access/package.json +1 -1
  10. package/dist/builtin/workflows/CHANGELOG.md +8 -0
  11. package/dist/builtin/workflows/package.json +1 -1
  12. package/dist/builtin/workflows/src/extension/index.bundle.mjs +71 -20
  13. package/dist/builtin/workflows/src/index.js +31 -10
  14. package/dist/codemode-worker.js +3309 -0
  15. package/dist/config.d.ts +7 -1
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +38 -12
  18. package/dist/config.js.map +1 -1
  19. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
  20. package/dist/core/agent-session-custom-message-commit.js +6 -0
  21. package/dist/core/agent-session-custom-message-commit.js.map +1 -1
  22. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  23. package/dist/core/agent-session-extension-bindings.js +22 -6
  24. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  25. package/dist/core/agent-session-services.d.ts.map +1 -1
  26. package/dist/core/agent-session-services.js +3 -1
  27. package/dist/core/agent-session-services.js.map +1 -1
  28. package/dist/core/agent-session-tasks.js +9 -4
  29. package/dist/core/agent-session-tasks.js.map +1 -1
  30. package/dist/core/auth-storage-backends.d.ts +3 -0
  31. package/dist/core/auth-storage-backends.d.ts.map +1 -1
  32. package/dist/core/auth-storage-backends.js +45 -1
  33. package/dist/core/auth-storage-backends.js.map +1 -1
  34. package/dist/core/auth-storage.d.ts.map +1 -1
  35. package/dist/core/auth-storage.js +14 -0
  36. package/dist/core/auth-storage.js.map +1 -1
  37. package/dist/core/extensions/provider-types.d.ts +3 -2
  38. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  39. package/dist/core/extensions/provider-types.js.map +1 -1
  40. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  41. package/dist/core/extensions/runner-events.js +10 -1
  42. package/dist/core/extensions/runner-events.js.map +1 -1
  43. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  44. package/dist/extensions/codemode/execute.js +40 -6
  45. package/dist/extensions/codemode/execute.js.map +1 -1
  46. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  47. package/dist/extensions/codemode/tool.js +1 -0
  48. package/dist/extensions/codemode/tool.js.map +1 -1
  49. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  50. package/dist/extensions/mcp/tools.js +4 -9
  51. package/dist/extensions/mcp/tools.js.map +1 -1
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -0
  55. package/dist/index.js.map +1 -1
  56. package/dist/modes/interactive/interactive-agent-events.js +21 -0
  57. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  58. package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
  59. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  60. package/dist/modes/interactive/interactive-mode-base.js +1 -0
  61. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  62. package/dist/modes/interactive/interactive-mode-helpers.js +1 -1
  63. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  64. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  65. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  66. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  67. package/dist/modes/interactive/interactive-process-lifecycle.js +7 -4
  68. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  69. package/dist/utils/output-files.d.ts +7 -0
  70. package/dist/utils/output-files.d.ts.map +1 -0
  71. package/dist/utils/output-files.js +20 -0
  72. package/dist/utils/output-files.js.map +1 -0
  73. package/docs/codemode.md +3 -3
  74. package/docs/extensions/api-reference.md +3 -1
  75. package/docs/extensions.md +2 -0
  76. package/docs/sdk.md +2 -0
  77. package/docs/settings.md +2 -0
  78. package/docs/subagents.md +4 -0
  79. package/docs/workflows/api-reference.md +6 -2
  80. package/docs/workflows/operations.md +10 -10
  81. package/npm-shrinkwrap.json +32 -32
  82. package/package.json +6 -6
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.27-alpha.1] - 2026-10-04
6
+
7
+ ### Changed
8
+
9
+ - Codemode `image()` also saves each image to a private temp file and names its path before the image, so later turns can copy or move it ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
10
+ - Full codemode text output and binary MCP resources now use exclusively created, user-readable-only temp files ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
11
+
12
+ ### Fixed
13
+
14
+ - Fixed subscription logins such as Sign in with ChatGPT losing rotated OAuth tokens when a request or model refresh was cancelled ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
15
+ - Fixed codemode failing after an update removed the running npm install, and added a restart hint when errors occur after the install changes ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
16
+ - Fixed dead terminal stdin errors such as `read EIO` and `setRawMode ENOTTY` being reported as crashes ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
17
+ - Fixed slow OAuth token rotation failing model refresh after the request-authentication waiting deadline ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
18
+ - Fixed unrelated extension and filesystem errors being mistaken for dead-terminal exits, restoring crash reports and extension hints ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
19
+ - Fixed slow OAuth rotation blocking logout and credential updates for unrelated providers. File-backed rotation now uses a provider-specific lock and preserves concurrent logout or credential replacement ([#3429](https://github.com/bastani-inc/atomic/issues/3429)).
20
+ - Fixed failed `/reload` retiring cleanup leaving in-flight workflows unreachable. The replacement extensions now finish starting, pending settings take effect, joined Intercom groups and workflow-stage targets by name or ID survive, and the error names the underlying cleanup exception. Successful reloads also preserve live, pending, and future workflow-stage routing ([#3425](https://github.com/bastani-inc/atomic/issues/3425)).
21
+ - Background subagent completions now reach workflow-stage chats as visible notices that trigger a parent turn before acknowledgment, even while other notices arrive ([#3427](https://github.com/bastani-inc/atomic/issues/3427)).
22
+
5
23
  ## [0.9.26] - 2026-10-04
6
24
 
7
25
  ### Breaking Changes
@@ -4,6 +4,12 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.9.27-alpha.1] - 2026-10-04
8
+
9
+ ### Fixed
10
+
11
+ - Fixed joined workflow groups being lost when extensions reload, including when retiring cleanup fails ([#3425](https://github.com/bastani-inc/atomic/issues/3425)).
12
+
7
13
  ## [0.9.26] - 2026-10-04
8
14
 
9
15
  ### Fixed
@@ -6392,7 +6392,7 @@ var exports_index_heavy = {};
6392
6392
  __export(exports_index_heavy, {
6393
6393
  default: () => piIntercomExtension
6394
6394
  });
6395
- import { APP_NAME } from "@bastani/atomic";
6395
+ import { APP_NAME, sessionScopedExtensionState } from "@bastani/atomic";
6396
6396
  import { appendFileSync } from "node:fs";
6397
6397
  function isPendingStageUndeliverableEvent(value) {
6398
6398
  if (typeof value !== "object" || value === null)
@@ -6437,6 +6437,7 @@ function piIntercomExtension(pi, testOverrides = {}) {
6437
6437
  let agentRunning = false;
6438
6438
  let sessionHomeGroup = null;
6439
6439
  let joinedGroups = null;
6440
+ const sessionMemberships = sessionScopedExtensionState(pi.lifecycleScope ?? pi.events ?? pi, "intercom:session-memberships:v1", () => new Map);
6440
6441
  const activeTools = new Map;
6441
6442
  let replyTracker = new ReplyTracker;
6442
6443
  const replyWaiters = new ReplyWaiterRegistry(DEFAULT_REPLY_TIMEOUT_MS, config.maxPendingAsks);
@@ -6501,13 +6502,20 @@ function piIntercomExtension(pi, testOverrides = {}) {
6501
6502
  function setJoinedGroups(groups) {
6502
6503
  joinedGroups = normalizeGroups(groups);
6503
6504
  const sessionId = currentSessionId;
6504
- if (sessionId)
6505
- setRuntimeIntercomGroup(sessionId, currentIntercomGroup());
6505
+ if (!sessionId)
6506
+ return;
6507
+ setRuntimeIntercomGroup(sessionId, currentIntercomGroup());
6508
+ sessionMemberships.set(sessionId, [...joinedGroups]);
6506
6509
  }
6507
6510
  function clearJoinedGroups() {
6511
+ if (currentSessionId)
6512
+ sessionMemberships.delete(currentSessionId);
6513
+ releaseJoinedGroups();
6514
+ }
6515
+ function releaseJoinedGroups() {
6508
6516
  joinedGroups = null;
6509
6517
  const sessionId = currentSessionId;
6510
- if (sessionId)
6518
+ if (sessionId && !sessionMemberships.has(sessionId))
6511
6519
  clearRuntimeIntercomGroup(sessionId);
6512
6520
  }
6513
6521
  function buildRegistration() {
@@ -7194,6 +7202,10 @@ function piIntercomExtension(pi, testOverrides = {}) {
7194
7202
  resolveSessionTarget: resolveSessionTargetId,
7195
7203
  homeGroup: currentIntercomGroup
7196
7204
  });
7205
+ pi.on("session_shutdown", (event) => {
7206
+ if (event.reason !== "reload" && currentSessionId)
7207
+ sessionMemberships.delete(currentSessionId);
7208
+ });
7197
7209
  registerIntercomLifecycle(pi, {
7198
7210
  config,
7199
7211
  client: () => client,
@@ -7223,7 +7235,7 @@ function piIntercomExtension(pi, testOverrides = {}) {
7223
7235
  clearReconnectTimer,
7224
7236
  setRuntimeContext: (value) => {
7225
7237
  if (value === null) {
7226
- clearJoinedGroups();
7238
+ releaseJoinedGroups();
7227
7239
  sessionHomeGroup = null;
7228
7240
  } else {
7229
7241
  sessionHomeGroup = resolveHomeGroup(config, value);
@@ -7259,7 +7271,10 @@ function piIntercomExtension(pi, testOverrides = {}) {
7259
7271
  restoreIntercomSessionIdEnv,
7260
7272
  currentStatus
7261
7273
  });
7262
- pi.on("session_start", async (_event, ctx) => {
7274
+ pi.on("session_start", async (event, ctx) => {
7275
+ const retainedMemberships = event.reason === "reload" ? sessionMemberships.get(ctx.sessionManager.getSessionId()) : undefined;
7276
+ if (retainedMemberships)
7277
+ setJoinedGroups(retainedMemberships);
7263
7278
  const pendingStageDelivery = ctx.orchestrationContext?.kind === "workflow-stage" ? ctx.orchestrationContext.pendingStageDelivery : undefined;
7264
7279
  if (pendingStageDelivery === undefined) {
7265
7280
  if (ctx.subagentPolicy?.intercom !== undefined)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.9.26",
3
+ "version": "0.9.27-alpha.1",
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.26",
3
+ "version": "0.9.27-alpha.1",
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": [
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.27-alpha.1] - 2026-10-04
6
+
7
+ ### Fixed
8
+
9
+ - Simultaneous subagent calls preserve each caller's wait policy and return only that caller's results instead of a shared parallel receipt ([#3427](https://github.com/bastani-inc/atomic/issues/3427)).
10
+ - Simultaneous subagent calls with mixed foreground and background waits now share the configured concurrency limit; returning a background receipt does not free a running child's slot ([#3427](https://github.com/bastani-inc/atomic/issues/3427)).
11
+ - Single-agent calls with mixed wait policies keep progress files isolated per run instead of overwriting an existing project `progress.md` ([#3427](https://github.com/bastani-inc/atomic/issues/3427)).
12
+
5
13
  ## [0.9.23] - 2026-09-27
6
14
 
7
15
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.26",
3
+ "version": "0.9.27-alpha.1",
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": [