@bastani/atomic 0.9.38 → 0.9.39-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.
- package/CHANGELOG.md +19 -0
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/index.bundle.mjs +216 -2
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +16 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +14 -0
- package/dist/builtin/workflows/package.json +3 -3
- package/dist/builtin/workflows/src/durable/journal/resolution.d.ts +2 -15
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +593 -131
- package/dist/builtin/workflows/src/index.js +301 -27
- package/dist/cli.js +13 -6
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +4 -1
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -0
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +1 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/agent-session.d.ts +1 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +13 -10
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +2 -0
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +5 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/loader-api.d.ts.map +1 -1
- package/dist/core/extensions/loader-api.js +4 -0
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +1 -0
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +3 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts.map +1 -1
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/extensions/ui-types.d.ts +6 -0
- package/dist/core/extensions/ui-types.d.ts.map +1 -1
- package/dist/core/extensions/ui-types.js +10 -0
- package/dist/core/extensions/ui-types.js.map +1 -1
- package/dist/core/sdk-types.d.ts +7 -1
- package/dist/core/sdk-types.d.ts.map +1 -1
- package/dist/core/sdk-types.js.map +1 -1
- package/dist/core/sdk.js +1 -0
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager-core.d.ts +1 -0
- package/dist/core/session-manager-core.d.ts.map +1 -1
- package/dist/core/session-manager-core.js +12 -0
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/storage/provider.d.ts +14 -0
- package/dist/core/storage/provider.d.ts.map +1 -1
- package/dist/core/storage/provider.js.map +1 -1
- package/dist/core/storage/session/legacy-session-store.d.ts +4 -1
- package/dist/core/storage/session/legacy-session-store.d.ts.map +1 -1
- package/dist/core/storage/session/legacy-session-store.js +42 -2
- package/dist/core/storage/session/legacy-session-store.js.map +1 -1
- package/dist/core/storage/session/legacy-session-summary.d.ts +8 -0
- package/dist/core/storage/session/legacy-session-summary.d.ts.map +1 -1
- package/dist/core/storage/session/legacy-session-summary.js +42 -2
- package/dist/core/storage/session/legacy-session-summary.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +0 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-tui.d.ts +0 -1
- package/dist/modes/interactive/interactive-tui.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-tui.js +8 -13
- package/dist/modes/interactive/interactive-tui.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +0 -1
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -1
- package/dist/modes/interactive/program-status-reporter.js +0 -4
- package/dist/modes/interactive/program-status-reporter.js.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.d.ts.map +1 -1
- package/dist/modes/interactive-engine/create-isolated-runtime.js +2 -0
- package/dist/modes/interactive-engine/create-isolated-runtime.js.map +1 -1
- package/dist/modes/interactive-engine/engine-heap.d.ts +24 -0
- package/dist/modes/interactive-engine/engine-heap.d.ts.map +1 -0
- package/dist/modes/interactive-engine/engine-heap.js +88 -0
- package/dist/modes/interactive-engine/engine-heap.js.map +1 -0
- package/dist/modes/rpc/rpc-client-api.d.ts +1 -0
- package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-api.js +3 -0
- package/dist/modes/rpc/rpc-client-api.js.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-command-handler.js +7 -0
- package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +9 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/heap-relaunch.d.ts +14 -0
- package/dist/utils/heap-relaunch.d.ts.map +1 -0
- package/dist/utils/heap-relaunch.js +59 -0
- package/dist/utils/heap-relaunch.js.map +1 -0
- package/docs/environment-variables.md +2 -1
- package/docs/intercom/reference.md +1 -1
- package/docs/rpc/protocol.md +23 -0
- package/docs/sdk/web-server.md +1 -1
- package/docs/sdk.md +10 -1
- package/docs/session-format.md +1 -0
- package/docs/sessions.md +2 -0
- package/docs/settings.md +1 -1
- package/docs/workflows/api-reference.md +1 -1
- package/docs/workflows/operations.md +5 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.39-alpha.2] - 2026-10-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fullscreen overlays that show chat messages (the workflow graph, stage chat, and the `/tasks` transcript) no longer write OSC 133 shell-integration marks to the terminal, so terminals keep the program status without Atomic re-sending an identical OSC 7501 report on every overlay frame ([#3739](https://github.com/bastani-inc/atomic/issues/3739))
|
|
10
|
+
|
|
11
|
+
## [0.9.39-alpha.1] - 2026-10-19
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Added RPC `delete_session` (`{"type":"delete_session","sessionId":"<id>"}`, or `{"type":"delete_session","id":"<id>"}` when `sessionId` is omitted), `RpcClient.deleteSession(sessionId)`, and `SessionManager.deleteSession(sessionId)` to delete a stored session and its entries from SQLite or JSONL storage. The session currently open in the process cannot be deleted and returns an error ([#3740](https://github.com/bastani-inc/atomic/issues/3740)).
|
|
16
|
+
- Added `createAgentSession({ journal })` so each SDK session can choose its workflow journal (file path, caller-owned database, process-local memory, adapter, or supplied journal) without the process-wide `ATOMIC_WORKFLOW_JOURNAL_PATH` ([#3743](https://github.com/bastani-inc/atomic/issues/3743)).
|
|
17
|
+
- When Atomic runs on Node, the process that runs agents now gets half of system memory for its heap when that is more than Node's default limit (about 4 GiB), so large machines can run more subagents and workflow stages at once. This applies to the interactive engine and to headless runs (`-p`, `--mode json`, `--mode rpc`), which restart themselves once with the larger heap. Set `ATOMIC_HEAP_MB` to choose the size or `0` to keep Node's default; an explicit `--max-old-space-size` in `NODE_OPTIONS` still wins.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- `/export` and the RPC `export_html` command now export sessions stored in the default SQLite session store instead of refusing them, reading entries through the session store rather than a session file ([#3741](https://github.com/bastani-inc/atomic/issues/3741))
|
|
22
|
+
- When the earlier JSONL sessions folder holds several copies of one session, such as conflict copies left by a file-sync tool, the default store now lists and imports the copy with the newest message instead of the alphabetically first file.
|
|
23
|
+
|
|
5
24
|
## [0.9.38] - 2026-10-18
|
|
6
25
|
|
|
7
26
|
### 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.39-alpha.1] - 2026-10-19
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- A workflow stage whose session was released from memory when its run ended stays in the session list under its previous name, as `closed · reply: post-mortem only`, while the session that ran the workflow is open. An ask to it reopens the stage's saved conversation, runs one turn with the question, and returns that turn's answer, or a failure if the conversation cannot be reopened; a plain send reaches the session that ran the workflow ([#3622](https://github.com/bastani-inc/atomic/issues/3622) by [@vishnu363728](https://github.com/vishnu363728)).
|
|
12
|
+
|
|
7
13
|
## [0.9.38] - 2026-10-18
|
|
8
14
|
|
|
9
15
|
### Fixed
|
|
@@ -6464,6 +6464,197 @@ function clearRuntimeIntercomGroup(sessionId) {
|
|
|
6464
6464
|
}
|
|
6465
6465
|
var init_runtime_group = () => {};
|
|
6466
6466
|
|
|
6467
|
+
// dist/builtin/intercom/released-stage-peers.ts
|
|
6468
|
+
function isReleasedStageAnnouncement(value) {
|
|
6469
|
+
const route = value;
|
|
6470
|
+
const live = route.liveRoute;
|
|
6471
|
+
return typeof route.runId === "string" && route.runId.length > 0 && typeof route.stageId === "string" && route.stageId.length > 0 && typeof route.stageName === "string" && typeof route.sessionId === "string" && route.sessionId.length > 0 && typeof route.group === "string" && (route.model === undefined || typeof route.model === "string") && typeof route.answer === "function" && (live === undefined || typeof live.capability === "string" && Array.isArray(live.stageKeys) && live.stageKeys.every((key) => typeof key === "string"));
|
|
6472
|
+
}
|
|
6473
|
+
function peerKey(route) {
|
|
6474
|
+
return `${route.runId}\x00${route.stageId}`;
|
|
6475
|
+
}
|
|
6476
|
+
function askPrompt(from, message) {
|
|
6477
|
+
const attachments = message.content.attachments?.length ? formatAttachments(message.content.attachments) : "";
|
|
6478
|
+
return [
|
|
6479
|
+
`**\uD83D\uDCE8 From ${from.name || from.id}** (${from.cwd})`,
|
|
6480
|
+
"",
|
|
6481
|
+
`${message.content.text}${attachments}`,
|
|
6482
|
+
"",
|
|
6483
|
+
"---",
|
|
6484
|
+
"This workflow stage finished earlier and was reopened from its saved conversation to answer this ask.",
|
|
6485
|
+
"Answer in your final message; Atomic delivers it to the asker. Do not call the intercom tool to reply."
|
|
6486
|
+
].join(`
|
|
6487
|
+
`);
|
|
6488
|
+
}
|
|
6489
|
+
|
|
6490
|
+
class ReleasedStagePeers {
|
|
6491
|
+
deps;
|
|
6492
|
+
peers = new Map;
|
|
6493
|
+
constructor(deps) {
|
|
6494
|
+
this.deps = deps;
|
|
6495
|
+
}
|
|
6496
|
+
get size() {
|
|
6497
|
+
return this.peers.size;
|
|
6498
|
+
}
|
|
6499
|
+
async adopt(route) {
|
|
6500
|
+
const key = peerKey(route);
|
|
6501
|
+
const previous = this.peers.get(key);
|
|
6502
|
+
if (previous !== undefined)
|
|
6503
|
+
await this.close(previous);
|
|
6504
|
+
const peer = {
|
|
6505
|
+
route,
|
|
6506
|
+
returnAddress: `${route.sessionId}:released-stage`,
|
|
6507
|
+
client: null,
|
|
6508
|
+
connecting: null,
|
|
6509
|
+
reconnectTimer: null,
|
|
6510
|
+
reconnectAttempt: 0,
|
|
6511
|
+
closed: false,
|
|
6512
|
+
answering: new Set
|
|
6513
|
+
};
|
|
6514
|
+
this.peers.set(key, peer);
|
|
6515
|
+
await this.connect(peer);
|
|
6516
|
+
}
|
|
6517
|
+
async disconnectAll() {
|
|
6518
|
+
const peers = [...this.peers.values()];
|
|
6519
|
+
this.peers.clear();
|
|
6520
|
+
await Promise.all(peers.map((peer) => this.close(peer)));
|
|
6521
|
+
}
|
|
6522
|
+
connect(peer) {
|
|
6523
|
+
if (peer.connecting !== null)
|
|
6524
|
+
return peer.connecting;
|
|
6525
|
+
const attempt = this.connectOnce(peer).then(() => {
|
|
6526
|
+
peer.reconnectAttempt = 0;
|
|
6527
|
+
}, (error) => {
|
|
6528
|
+
if (peer.connecting === attempt)
|
|
6529
|
+
peer.connecting = null;
|
|
6530
|
+
this.scheduleReconnect(peer);
|
|
6531
|
+
throw toError3(error);
|
|
6532
|
+
});
|
|
6533
|
+
peer.connecting = attempt;
|
|
6534
|
+
const settled = () => {
|
|
6535
|
+
if (peer.connecting === attempt)
|
|
6536
|
+
peer.connecting = null;
|
|
6537
|
+
};
|
|
6538
|
+
attempt.then(settled, settled);
|
|
6539
|
+
return attempt;
|
|
6540
|
+
}
|
|
6541
|
+
async connectOnce(peer) {
|
|
6542
|
+
const { route } = peer;
|
|
6543
|
+
await this.deps.prepare();
|
|
6544
|
+
if (peer.closed)
|
|
6545
|
+
return;
|
|
6546
|
+
const group = normalizeGroup(route.group);
|
|
6547
|
+
const client = this.deps.createClient(peer.returnAddress);
|
|
6548
|
+
client.on("message", (from, message, channel) => {
|
|
6549
|
+
if (peer.client !== client)
|
|
6550
|
+
return;
|
|
6551
|
+
this.receive(peer, client, from, message, channel);
|
|
6552
|
+
});
|
|
6553
|
+
client.on("disconnected", () => {
|
|
6554
|
+
if (peer.client !== client)
|
|
6555
|
+
return;
|
|
6556
|
+
peer.client = null;
|
|
6557
|
+
this.scheduleReconnect(peer);
|
|
6558
|
+
});
|
|
6559
|
+
client.on("error", () => {});
|
|
6560
|
+
peer.client = client;
|
|
6561
|
+
try {
|
|
6562
|
+
const now = Date.now();
|
|
6563
|
+
await client.connect({
|
|
6564
|
+
name: resolveIntercomPresenceName(undefined, route.sessionId),
|
|
6565
|
+
cwd: this.deps.cwd(),
|
|
6566
|
+
model: route.model ?? "unknown",
|
|
6567
|
+
pid: process.pid,
|
|
6568
|
+
startedAt: now,
|
|
6569
|
+
lastActivity: now,
|
|
6570
|
+
status: RELEASED_STAGE_STATUS,
|
|
6571
|
+
replyCapability: "live",
|
|
6572
|
+
groups: [group],
|
|
6573
|
+
group
|
|
6574
|
+
}, undefined, undefined, undefined, group);
|
|
6575
|
+
if (route.liveRoute !== undefined && route.liveRoute.stageKeys.length > 0) {
|
|
6576
|
+
try {
|
|
6577
|
+
await client.registerLiveWorkflowStageRoute(route.runId, [...route.liveRoute.stageKeys], route.liveRoute.capability);
|
|
6578
|
+
} catch (error) {
|
|
6579
|
+
if (!(error instanceof IntercomLiveRouteRefusedError))
|
|
6580
|
+
throw error;
|
|
6581
|
+
}
|
|
6582
|
+
}
|
|
6583
|
+
if (peer.closed) {
|
|
6584
|
+
peer.client = null;
|
|
6585
|
+
await client.disconnect();
|
|
6586
|
+
}
|
|
6587
|
+
} catch (error) {
|
|
6588
|
+
if (peer.client === client)
|
|
6589
|
+
peer.client = null;
|
|
6590
|
+
try {
|
|
6591
|
+
await client.disconnect();
|
|
6592
|
+
} catch {}
|
|
6593
|
+
throw error;
|
|
6594
|
+
}
|
|
6595
|
+
}
|
|
6596
|
+
scheduleReconnect(peer) {
|
|
6597
|
+
if (peer.closed || peer.reconnectTimer !== null || peer.connecting !== null)
|
|
6598
|
+
return;
|
|
6599
|
+
peer.reconnectTimer = setTimeout(() => {
|
|
6600
|
+
peer.reconnectTimer = null;
|
|
6601
|
+
if (peer.closed)
|
|
6602
|
+
return;
|
|
6603
|
+
peer.reconnectAttempt += 1;
|
|
6604
|
+
this.connect(peer).catch(() => {});
|
|
6605
|
+
}, reconnectDelayMs(peer.reconnectAttempt));
|
|
6606
|
+
}
|
|
6607
|
+
receive(peer, client, from, message, channel) {
|
|
6608
|
+
if (message.expectsReply !== true || channel !== undefined) {
|
|
6609
|
+
this.deps.relay(from, message, channel);
|
|
6610
|
+
return;
|
|
6611
|
+
}
|
|
6612
|
+
if (peer.answering.has(message.id))
|
|
6613
|
+
return;
|
|
6614
|
+
peer.answering.add(message.id);
|
|
6615
|
+
this.answer(peer, client, from, message).finally(() => peer.answering.delete(message.id));
|
|
6616
|
+
}
|
|
6617
|
+
async answer(peer, client, from, message) {
|
|
6618
|
+
let reply;
|
|
6619
|
+
try {
|
|
6620
|
+
reply = { text: await peer.route.answer(askPrompt(from, message)) };
|
|
6621
|
+
} catch (error) {
|
|
6622
|
+
const failure = `Released workflow stage could not answer: ${toError3(error).message}`;
|
|
6623
|
+
reply = { text: failure, replyError: failure };
|
|
6624
|
+
}
|
|
6625
|
+
if (peer.closed || !client.isConnected())
|
|
6626
|
+
return;
|
|
6627
|
+
try {
|
|
6628
|
+
await client.send(from.id, { ...reply, replyTo: message.id, requirePendingReply: true });
|
|
6629
|
+
} catch {}
|
|
6630
|
+
}
|
|
6631
|
+
async close(peer) {
|
|
6632
|
+
peer.closed = true;
|
|
6633
|
+
if (peer.reconnectTimer !== null)
|
|
6634
|
+
clearTimeout(peer.reconnectTimer);
|
|
6635
|
+
peer.reconnectTimer = null;
|
|
6636
|
+
if (this.peers.get(peerKey(peer.route)) === peer)
|
|
6637
|
+
this.peers.delete(peerKey(peer.route));
|
|
6638
|
+
try {
|
|
6639
|
+
await peer.connecting;
|
|
6640
|
+
} catch {}
|
|
6641
|
+
const client = peer.client;
|
|
6642
|
+
peer.client = null;
|
|
6643
|
+
if (client === null)
|
|
6644
|
+
return;
|
|
6645
|
+
try {
|
|
6646
|
+
await client.disconnect();
|
|
6647
|
+
} catch {}
|
|
6648
|
+
}
|
|
6649
|
+
}
|
|
6650
|
+
var RELEASED_STAGE_EVENT = "atomic:workflow-released-stage", RELEASED_STAGE_STATUS = "closed · reply: post-mortem only";
|
|
6651
|
+
var init_released_stage_peers = __esm(() => {
|
|
6652
|
+
init_group();
|
|
6653
|
+
init_intercom_utils();
|
|
6654
|
+
init_live_route_refusal();
|
|
6655
|
+
init_reconnect_backoff();
|
|
6656
|
+
});
|
|
6657
|
+
|
|
6467
6658
|
// dist/builtin/intercom/supervisor-authorization-registry.ts
|
|
6468
6659
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
6469
6660
|
|
|
@@ -6545,6 +6736,16 @@ function piIntercomExtension(pi, testOverrides = {}) {
|
|
|
6545
6736
|
const pendingStageRoutes = new Map;
|
|
6546
6737
|
const pendingStageRouteClients = new Map;
|
|
6547
6738
|
const supervisorAuthorizations = new SupervisorAuthorizationRegistry;
|
|
6739
|
+
const releasedStagePeers = new ReleasedStagePeers({
|
|
6740
|
+
prepare: () => spawnBrokerIfNeeded(config.brokerCommand, config.brokerArgs),
|
|
6741
|
+
createClient: (returnAddress) => new IntercomClient(returnAddress),
|
|
6742
|
+
cwd: () => getLiveContext()?.cwd ?? process.cwd(),
|
|
6743
|
+
relay: (from, message, channel) => {
|
|
6744
|
+
const liveContext = getLiveContext();
|
|
6745
|
+
if (liveContext)
|
|
6746
|
+
handleIncomingMessage(liveContext, from, message, channel);
|
|
6747
|
+
}
|
|
6748
|
+
});
|
|
6548
6749
|
let inboundFlushTimer = null;
|
|
6549
6750
|
function rejectReplyWaiter(error) {
|
|
6550
6751
|
replyWaiters.rejectAll(error);
|
|
@@ -7243,6 +7444,13 @@ function piIntercomExtension(pi, testOverrides = {}) {
|
|
|
7243
7444
|
payload.completion = completion;
|
|
7244
7445
|
completion.catch(() => {});
|
|
7245
7446
|
});
|
|
7447
|
+
pi.events.on(RELEASED_STAGE_EVENT, (payload) => {
|
|
7448
|
+
if (typeof payload !== "object" || payload === null || !isReleasedStageAnnouncement(payload))
|
|
7449
|
+
return;
|
|
7450
|
+
if (!getLiveContext())
|
|
7451
|
+
return;
|
|
7452
|
+
releasedStagePeers.adopt(payload).catch(() => {});
|
|
7453
|
+
});
|
|
7246
7454
|
async function pendingStageNotificationClient(runId) {
|
|
7247
7455
|
const route = pendingStageRoutes.get(runId);
|
|
7248
7456
|
if (route === undefined)
|
|
@@ -7307,7 +7515,10 @@ function piIntercomExtension(pi, testOverrides = {}) {
|
|
|
7307
7515
|
registerIntercomLifecycle(pi, {
|
|
7308
7516
|
config,
|
|
7309
7517
|
client: () => client,
|
|
7310
|
-
disconnectAuxiliaryClients:
|
|
7518
|
+
disconnectAuxiliaryClients: async () => {
|
|
7519
|
+
await disconnectPendingStageRouteClients();
|
|
7520
|
+
await releasedStagePeers.disconnectAll();
|
|
7521
|
+
},
|
|
7311
7522
|
setClient: (value) => {
|
|
7312
7523
|
client = value;
|
|
7313
7524
|
if (value === null)
|
|
@@ -7449,6 +7660,7 @@ var init_index_heavy = __esm(() => {
|
|
|
7449
7660
|
init_group();
|
|
7450
7661
|
init_runtime_group();
|
|
7451
7662
|
init_reconnect_backoff();
|
|
7663
|
+
init_released_stage_peers();
|
|
7452
7664
|
init_supervisor_authorization_registry();
|
|
7453
7665
|
if (process.env.ATOMIC_TEST_LAZY_IMPORT_SENTINEL === "1") {
|
|
7454
7666
|
process.env.ATOMIC_INTERCOM_HEAVY_IMPORTED = "1";
|
|
@@ -7710,6 +7922,7 @@ var SUBAGENT_SUPERVISOR_AUTHORIZATION_EVENT2 = "subagent:supervisor-authorizatio
|
|
|
7710
7922
|
var WORKFLOW_STAGE_LATE_MESSAGE_EVENT = "atomic:workflow-stage-late-message";
|
|
7711
7923
|
var PENDING_STAGE_ROUTE_EVENT2 = "atomic:workflow-pending-stage-route";
|
|
7712
7924
|
var PENDING_STAGE_UNDELIVERABLE_EVENT2 = "atomic:workflow-pending-stage-undeliverable";
|
|
7925
|
+
var RELEASED_STAGE_EVENT2 = "atomic:workflow-released-stage";
|
|
7713
7926
|
function isPendingStageUndeliverableRelay(value) {
|
|
7714
7927
|
if (typeof value !== "object" || value === null)
|
|
7715
7928
|
return false;
|
|
@@ -8211,7 +8424,8 @@ function intercom(pi, options = {}) {
|
|
|
8211
8424
|
for (const eventName of [
|
|
8212
8425
|
SUBAGENT_CONTROL_INTERCOM_EVENT2,
|
|
8213
8426
|
SUBAGENT_RESULT_INTERCOM_EVENT3,
|
|
8214
|
-
PENDING_STAGE_ROUTE_EVENT2
|
|
8427
|
+
PENDING_STAGE_ROUTE_EVENT2,
|
|
8428
|
+
RELEASED_STAGE_EVENT2
|
|
8215
8429
|
]) {
|
|
8216
8430
|
pi.events.on(eventName, (payload) => {
|
|
8217
8431
|
const ctx = latestLifecycleContext();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.39-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": [
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.39-alpha.1] - 2026-10-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- A finished in-process subagent child no longer keeps its disposed agent session reachable for as long as its task exists. The task keeps the child's transcript entries for inspection but releases the session itself, so a long-lived parent session that launches many children stops accumulating their memory ([#3622](https://github.com/bastani-inc/atomic/issues/3622) by [@vishnu363728](https://github.com/vishnu363728)).
|
|
10
|
+
|
|
5
11
|
## [0.9.38] - 2026-10-18
|
|
6
12
|
|
|
7
13
|
### Breaking Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/subagents",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.39-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": [
|
|
@@ -10746,6 +10746,11 @@ function createTestSession(sessionManager, spec) {
|
|
|
10746
10746
|
dispose: testOptions.dispose ?? (() => {})
|
|
10747
10747
|
};
|
|
10748
10748
|
}
|
|
10749
|
+
function settledTranscript(manager) {
|
|
10750
|
+
const sessionId = manager.getSessionId();
|
|
10751
|
+
const entries = manager.getEntries();
|
|
10752
|
+
return { getSessionId: () => sessionId, getEntries: () => [...entries] };
|
|
10753
|
+
}
|
|
10749
10754
|
function nativeStatus(value) {
|
|
10750
10755
|
return value === "killed" ? "interrupted" : value;
|
|
10751
10756
|
}
|
|
@@ -10960,6 +10965,7 @@ class SubagentControlRuntime {
|
|
|
10960
10965
|
const configuredThinking = candidate.thinkingLevel ?? admitted.policy.thinkingLevel;
|
|
10961
10966
|
let effectiveModelId = candidateModelId;
|
|
10962
10967
|
let effectiveThinking = initialThinkingForAttempt(candidateModelId, configuredThinking);
|
|
10968
|
+
let transcriptManager;
|
|
10963
10969
|
let attemptedModels = candidateModelId ? [candidateModelId] : [];
|
|
10964
10970
|
const selectedModel = candidate.model ?? admitted.policy.model;
|
|
10965
10971
|
if (selectedModel)
|
|
@@ -11066,6 +11072,7 @@ class SubagentControlRuntime {
|
|
|
11066
11072
|
try {
|
|
11067
11073
|
const workflow = workflowMetadataFromContext(admitted.spec.parent?.orchestrationContext);
|
|
11068
11074
|
const sessionManager = admitted.sessionManager ? await SessionManager.open(admitted.sessionManager.getSessionStore(), admitted.sessionManager.getSessionId(), admitted.policy.cwd) : await SessionManager.create(admitted.policy.cwd, admitted.sessionDir, workflow ? { internal: true, workflow } : { internal: true });
|
|
11075
|
+
transcriptManager = sessionManager;
|
|
11069
11076
|
taskHooks?.bindTranscript?.(sessionManager);
|
|
11070
11077
|
if (workflow)
|
|
11071
11078
|
await sessionManager.markSessionInternal(workflow);
|
|
@@ -11336,6 +11343,10 @@ class SubagentControlRuntime {
|
|
|
11336
11343
|
try {
|
|
11337
11344
|
unsubscribe?.();
|
|
11338
11345
|
} catch {}
|
|
11346
|
+
const settleTranscript = () => {
|
|
11347
|
+
if (transcriptManager !== undefined)
|
|
11348
|
+
taskHooks?.bindTranscript?.(settledTranscript(transcriptManager));
|
|
11349
|
+
};
|
|
11339
11350
|
if (onCleanup) {
|
|
11340
11351
|
onCleanup((async () => {
|
|
11341
11352
|
try {
|
|
@@ -11352,12 +11363,16 @@ class SubagentControlRuntime {
|
|
|
11352
11363
|
}
|
|
11353
11364
|
]
|
|
11354
11365
|
};
|
|
11366
|
+
} finally {
|
|
11367
|
+
settleTranscript();
|
|
11355
11368
|
}
|
|
11356
11369
|
})());
|
|
11357
11370
|
} else {
|
|
11358
11371
|
try {
|
|
11359
11372
|
await session?.dispose();
|
|
11360
|
-
} catch {}
|
|
11373
|
+
} catch {} finally {
|
|
11374
|
+
settleTranscript();
|
|
11375
|
+
}
|
|
11361
11376
|
}
|
|
11362
11377
|
if (this.attemptTokens.get(admitted.identity.path) === token)
|
|
11363
11378
|
this.attemptTokens.delete(admitted.identity.path);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.39-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": [
|
|
@@ -6,6 +6,20 @@ 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.39-alpha.1] - 2026-10-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `workflow({ action: "status", runId, summary: true })` returns a compact status of one run: status, timing, final outputs (`result`), error and blockers (failed or blocked stages and tools, and stages awaiting input), without the stage and tool history ([#3744](https://github.com/bastani-inc/atomic/issues/3744)).
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `workflow({ action: "status", runId })` for a run another session started now includes the run's final outputs in `detail.result`, because the journal now records them when the run finishes; runs finished by an earlier version have no recorded outputs ([#3744](https://github.com/bastani-inc/atomic/issues/3744)).
|
|
18
|
+
- A workflow run that finishes after receiving a sticky Intercom message (for example a send to `workflow:<rootRunId>/**`) no longer prints `pending stage delivery sweep failed: Workflow execution for <runId> is retired`, and its leftover sticky messages are settled instead of staying queued ([#3745](https://github.com/bastani-inc/atomic/issues/3745)).
|
|
19
|
+
- The `workflow` tool now honours the session's settings, including in-memory `workflows.journal` settings, and a per-session `journal` passed to `createAgentSession`, instead of reading only `ATOMIC_WORKFLOW_JOURNAL_PATH` and `settings.json`. A memory journal selected through session settings belongs to that session alone, and disposing a session closes the journals it opened (once no other session shares them) instead of keeping them and their process-exit hooks until exit ([#3743](https://github.com/bastani-inc/atomic/issues/3743)).
|
|
20
|
+
- Disposing a session now leaves its paused workflow runs `paused` and resumable instead of turning them `failed` with `SessionClosed`, and a run whose stage was mid-step when the session closed is paused rather than failed. `session.workflows.resume(runId)` still adopts the released runs ([#3742](https://github.com/bastani-inc/atomic/issues/3742)).
|
|
21
|
+
- Completed workflow stages no longer keep their agent sessions in memory for the life of the process, which could exhaust the V8 heap in long-running sessions. When a run ends, including a run that failed and can be resumed, each completed stage whose conversation is saved is disposed and dropped from the stage registry and completed-workflow inspection; attaching to it or messaging it reopens the saved conversation without rerunning the workflow, and the stage stays in the Intercom list as `closed · reply: post-mortem only` for as long as the session that ran the workflow is open: an ask to it reopens the saved conversation, runs one turn with the question, and returns that turn's answer. A stage with a mounted chat (visible or hidden), queued or in-flight messages, an active turn, compaction or retry, or no saved transcript stays live until the session that ran the workflow is replaced or shut down, and a stage reopened by attach, a message, or an Intercom ask stays in memory until then ([#3622](https://github.com/bastani-inc/atomic/issues/3622) by [@vishnu363728](https://github.com/vishnu363728)).
|
|
22
|
+
|
|
9
23
|
## [0.9.38] - 2026-10-18
|
|
10
24
|
|
|
11
25
|
### Breaking Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/workflows",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.39-alpha.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Atomic extension for multi-stage workflow authoring and execution.",
|
|
6
6
|
"contributors": [
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"test:unit": "npm --prefix ../.. run test:unit --",
|
|
66
66
|
"test:integration": "npm --prefix ../.. run test:integration --",
|
|
67
67
|
"test:all": "npm --prefix ../.. run test:all --",
|
|
68
|
-
"typecheck": "
|
|
69
|
-
"lint": "
|
|
68
|
+
"typecheck": "node ../../scripts/bun-typecheck.mjs -p ../../tsconfig.json",
|
|
69
|
+
"lint": "node ../../scripts/bun-typecheck.mjs -p ../../tsconfig.json"
|
|
70
70
|
},
|
|
71
71
|
"pi": {
|
|
72
72
|
"extensions": [
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RunJournalOption, type StorageSelection, type StorageSettingsSelection } from "@bastani/atomic/storage";
|
|
2
2
|
import type { RunJournal } from "./types.js";
|
|
3
|
-
export type RunJournalOption
|
|
4
|
-
path: string;
|
|
5
|
-
prefix?: string;
|
|
6
|
-
} | {
|
|
7
|
-
database: SqliteDatabase;
|
|
8
|
-
prefix?: string;
|
|
9
|
-
} | {
|
|
10
|
-
memory: true;
|
|
11
|
-
} | {
|
|
12
|
-
adapter: string;
|
|
13
|
-
options?: AdapterOptions;
|
|
14
|
-
secrets?: Readonly<Record<string, SecretRef>>;
|
|
15
|
-
prefix?: string;
|
|
16
|
-
} | RunJournal;
|
|
3
|
+
export type { RunJournalOption };
|
|
17
4
|
export interface RunJournalSettings {
|
|
18
5
|
workflows?: string[] | {
|
|
19
6
|
journal?: StorageSettingsSelection;
|