@bastani/atomic 0.9.16 → 0.9.17-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.
- package/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/README.md +1 -1
- package/dist/builtin/intercom/broker/broker.ts +30 -17
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/package.json +1 -1
- package/docs/intercom.md +1 -1
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.17-alpha.1] - 2026-08-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Idle intercom brokers now exit after the 5-second shutdown window even when no session ever registered, including sockets that close before register. An evicted incumbent does not delete a successor's socket or pid file ([#2765](https://github.com/bastani-inc/atomic/issues/2765)).
|
|
10
|
+
|
|
5
11
|
## [0.9.16] - 2026-08-29
|
|
6
12
|
|
|
7
13
|
Cumulative release of the `0.9.16-alpha.1` – `0.9.16-alpha.11` prereleases. The summary below covers the user-visible outcome of that work; the per-change detail remains in the prerelease sections below.
|
|
@@ -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.17-alpha.1] - 2026-08-29
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Idle brokers now exit after the 5-second shutdown window even when no session ever registered, including sockets that close before `register`. An evicted incumbent does not delete a successor's socket or pid file ([#2765](https://github.com/bastani-inc/atomic/issues/2765)).
|
|
12
|
+
|
|
7
13
|
## [0.9.16] - 2026-08-29
|
|
8
14
|
|
|
9
15
|
Cumulative release of the `0.9.16-alpha.1` – `0.9.16-alpha.11` prereleases. The summary below covers the user-visible outcome of that work; the per-change detail remains in the prerelease sections below.
|
|
@@ -451,7 +451,7 @@ graph TB
|
|
|
451
451
|
B2 <-->|Local Socket/Pipe| B3
|
|
452
452
|
```
|
|
453
453
|
|
|
454
|
-
The broker is a standalone TypeScript process that manages session registration and message routing. It auto-spawns when the first session that invokes Intercom needs it and exits after 5 seconds when
|
|
454
|
+
The broker is a standalone TypeScript process that manages session registration and message routing. It auto-spawns when the first session that invokes Intercom needs it and exits after 5 seconds when it last has no registered sessions, including brokers that never received a connection and sockets that close before register. Clients now reconnect automatically if the broker disappears and later comes back.
|
|
455
455
|
|
|
456
456
|
Messages use length-prefixed JSON over a local socket/pipe transport (4-byte length + JSON payload) to handle fragmentation properly. The protocol includes request correlation for session listing, explicit delivery failures, and validation for malformed or out-of-order messages.
|
|
457
457
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// only position from which the stderr cap covers the other modules' own initialization.
|
|
3
3
|
import "./bounded-stderr-install.js";
|
|
4
4
|
import net from "net";
|
|
5
|
-
import { writeFileSync, unlinkSync, mkdirSync } from "fs";
|
|
5
|
+
import { writeFileSync, unlinkSync, mkdirSync, readFileSync } from "fs";
|
|
6
6
|
import { randomUUID } from "crypto";
|
|
7
7
|
import { writeMessage, createMessageReader } from "./framing.js";
|
|
8
8
|
import { getBrokerPidPath, getBrokerSocketPath, getIntercomDirPath } from "./paths.js";
|
|
@@ -146,6 +146,7 @@ class IntercomBroker {
|
|
|
146
146
|
this.server.listen(SOCKET_PATH, () => {
|
|
147
147
|
writeFileSync(PID_PATH, String(process.pid));
|
|
148
148
|
console.log(`Intercom broker started (pid: ${process.pid})`);
|
|
149
|
+
this.scheduleShutdownCheck();
|
|
149
150
|
});
|
|
150
151
|
process.on("SIGTERM", () => this.shutdown());
|
|
151
152
|
process.on("SIGINT", () => this.shutdown());
|
|
@@ -166,10 +167,8 @@ class IntercomBroker {
|
|
|
166
167
|
socket.on("data", reader);
|
|
167
168
|
|
|
168
169
|
socket.on("close", () => {
|
|
169
|
-
if (sessionId)
|
|
170
|
-
|
|
171
|
-
this.scheduleShutdownCheck();
|
|
172
|
-
}
|
|
170
|
+
if (sessionId) this.disconnectSession(sessionId);
|
|
171
|
+
this.scheduleShutdownCheck();
|
|
173
172
|
});
|
|
174
173
|
|
|
175
174
|
socket.on("error", (error) => {
|
|
@@ -918,6 +917,25 @@ class IntercomBroker {
|
|
|
918
917
|
}
|
|
919
918
|
}
|
|
920
919
|
|
|
920
|
+
private readPidFile(): number | undefined {
|
|
921
|
+
try {
|
|
922
|
+
const pid = Number.parseInt(readFileSync(PID_PATH, "utf-8").trim(), 10);
|
|
923
|
+
return Number.isFinite(pid) ? pid : undefined;
|
|
924
|
+
} catch {
|
|
925
|
+
return undefined;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/** Unlink the pid file only while this process still owns PID_PATH. */
|
|
930
|
+
private unlinkRuntimeFilesIfOwned(): void {
|
|
931
|
+
if (this.readPidFile() !== process.pid) return;
|
|
932
|
+
try {
|
|
933
|
+
unlinkSync(PID_PATH);
|
|
934
|
+
} catch {
|
|
935
|
+
// The PID file may already be gone if startup never completed.
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
921
939
|
private shutdown(): void {
|
|
922
940
|
console.log("Broker shutting down");
|
|
923
941
|
|
|
@@ -931,19 +949,14 @@ class IntercomBroker {
|
|
|
931
949
|
this.liveWorkflowStageRouteActivations.clear();
|
|
932
950
|
for (const pending of this.pendingStageNotificationAcknowledgments.values()) clearTimeout(pending.timeout);
|
|
933
951
|
this.pendingStageNotificationAcknowledgments.clear();
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
try {
|
|
942
|
-
unlinkSync(PID_PATH);
|
|
943
|
-
} catch {
|
|
944
|
-
// The PID file may already be gone if startup never completed.
|
|
952
|
+
const ownsRuntime = this.readPidFile() === process.pid;
|
|
953
|
+
this.unlinkRuntimeFilesIfOwned();
|
|
954
|
+
// Node unlinks a Unix socket path on server.close() even after a successor
|
|
955
|
+
// rebound that path. Skip close when we no longer own the pid; process.exit
|
|
956
|
+
// still closes our fd. Windows named pipes are not path-unlinked this way.
|
|
957
|
+
if (process.platform === "win32" || ownsRuntime) {
|
|
958
|
+
this.server.close();
|
|
945
959
|
}
|
|
946
|
-
this.server.close();
|
|
947
960
|
process.exit(0);
|
|
948
961
|
}
|
|
949
962
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/intercom",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17-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.
|
|
3
|
+
"version": "0.9.17-alpha.1",
|
|
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.
|
|
3
|
+
"version": "0.9.17-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": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/web-access",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17-alpha.1",
|
|
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": [
|
package/docs/intercom.md
CHANGED
|
@@ -470,7 +470,7 @@ graph TB
|
|
|
470
470
|
B2 <-->|Local Socket/Pipe| B3
|
|
471
471
|
```
|
|
472
472
|
|
|
473
|
-
The broker is a standalone process that manages session registration and message routing. It auto-spawns when the first session that invokes Intercom needs it and exits 5 seconds after
|
|
473
|
+
The broker is a standalone process that manages session registration and message routing. It auto-spawns when the first session that invokes Intercom needs it and exits 5 seconds after it last has no registered sessions, including brokers that never received a connection and sockets that close before register; clients reconnect automatically if the broker restarts. A spawn lock keyed by PID and timestamp prevents duplicate brokers when multiple sessions start at once.
|
|
474
474
|
|
|
475
475
|
Transport is local IPC only — a Unix domain socket on macOS/Linux or a named pipe on Windows — using length-prefixed JSON (4-byte length + payload) with request correlation for session listing, explicit delivery failures, and validation of malformed or out-of-order messages. `ask` stays client-side: the broker routes plain messages, and the client waits for the matching reply before returning it as the tool result.
|
|
476
476
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17-alpha.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@bastani/atomic",
|
|
9
|
-
"version": "0.9.
|
|
9
|
+
"version": "0.9.17-alpha.1",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@bastani/atomic-natives": "0.9.
|
|
13
|
-
"@bastani/pi-ai": "0.9.
|
|
12
|
+
"@bastani/atomic-natives": "0.9.17-alpha.1",
|
|
13
|
+
"@bastani/pi-ai": "0.9.17-alpha.1",
|
|
14
14
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
15
15
|
"@earendil-works/pi-agent-core": "^0.84.4",
|
|
16
16
|
"@earendil-works/pi-client": "^0.84.4",
|
|
@@ -517,18 +517,18 @@
|
|
|
517
517
|
}
|
|
518
518
|
},
|
|
519
519
|
"node_modules/@bastani/atomic-natives": {
|
|
520
|
-
"version": "0.9.
|
|
521
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.
|
|
520
|
+
"version": "0.9.17-alpha.1",
|
|
521
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.17-alpha.1.tgz",
|
|
522
522
|
"license": "MIT",
|
|
523
523
|
"optionalDependencies": {
|
|
524
|
-
"@bastani/atomic-natives-darwin-arm64": "0.9.
|
|
525
|
-
"@bastani/atomic-natives-darwin-x64": "0.9.
|
|
526
|
-
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.
|
|
527
|
-
"@bastani/atomic-natives-linux-arm64-musl": "0.9.
|
|
528
|
-
"@bastani/atomic-natives-linux-x64-gnu": "0.9.
|
|
529
|
-
"@bastani/atomic-natives-linux-x64-musl": "0.9.
|
|
530
|
-
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.
|
|
531
|
-
"@bastani/atomic-natives-win32-x64-msvc": "0.9.
|
|
524
|
+
"@bastani/atomic-natives-darwin-arm64": "0.9.17-alpha.1",
|
|
525
|
+
"@bastani/atomic-natives-darwin-x64": "0.9.17-alpha.1",
|
|
526
|
+
"@bastani/atomic-natives-linux-arm64-gnu": "0.9.17-alpha.1",
|
|
527
|
+
"@bastani/atomic-natives-linux-arm64-musl": "0.9.17-alpha.1",
|
|
528
|
+
"@bastani/atomic-natives-linux-x64-gnu": "0.9.17-alpha.1",
|
|
529
|
+
"@bastani/atomic-natives-linux-x64-musl": "0.9.17-alpha.1",
|
|
530
|
+
"@bastani/atomic-natives-win32-arm64-msvc": "0.9.17-alpha.1",
|
|
531
|
+
"@bastani/atomic-natives-win32-x64-msvc": "0.9.17-alpha.1"
|
|
532
532
|
},
|
|
533
533
|
"engines": {
|
|
534
534
|
"bun": ">=1.4.0",
|
|
@@ -536,8 +536,8 @@
|
|
|
536
536
|
}
|
|
537
537
|
},
|
|
538
538
|
"node_modules/@bastani/atomic-natives-darwin-arm64": {
|
|
539
|
-
"version": "0.9.
|
|
540
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.
|
|
539
|
+
"version": "0.9.17-alpha.1",
|
|
540
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.17-alpha.1.tgz",
|
|
541
541
|
"license": "MIT",
|
|
542
542
|
"os": [
|
|
543
543
|
"darwin"
|
|
@@ -548,8 +548,8 @@
|
|
|
548
548
|
"optional": true
|
|
549
549
|
},
|
|
550
550
|
"node_modules/@bastani/atomic-natives-darwin-x64": {
|
|
551
|
-
"version": "0.9.
|
|
552
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.
|
|
551
|
+
"version": "0.9.17-alpha.1",
|
|
552
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.17-alpha.1.tgz",
|
|
553
553
|
"license": "MIT",
|
|
554
554
|
"os": [
|
|
555
555
|
"darwin"
|
|
@@ -560,8 +560,8 @@
|
|
|
560
560
|
"optional": true
|
|
561
561
|
},
|
|
562
562
|
"node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
|
|
563
|
-
"version": "0.9.
|
|
564
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.
|
|
563
|
+
"version": "0.9.17-alpha.1",
|
|
564
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.17-alpha.1.tgz",
|
|
565
565
|
"license": "MIT",
|
|
566
566
|
"os": [
|
|
567
567
|
"linux"
|
|
@@ -575,8 +575,8 @@
|
|
|
575
575
|
"optional": true
|
|
576
576
|
},
|
|
577
577
|
"node_modules/@bastani/atomic-natives-linux-arm64-musl": {
|
|
578
|
-
"version": "0.9.
|
|
579
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.
|
|
578
|
+
"version": "0.9.17-alpha.1",
|
|
579
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.17-alpha.1.tgz",
|
|
580
580
|
"license": "MIT",
|
|
581
581
|
"os": [
|
|
582
582
|
"linux"
|
|
@@ -590,8 +590,8 @@
|
|
|
590
590
|
"optional": true
|
|
591
591
|
},
|
|
592
592
|
"node_modules/@bastani/atomic-natives-linux-x64-gnu": {
|
|
593
|
-
"version": "0.9.
|
|
594
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.
|
|
593
|
+
"version": "0.9.17-alpha.1",
|
|
594
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.17-alpha.1.tgz",
|
|
595
595
|
"license": "MIT",
|
|
596
596
|
"os": [
|
|
597
597
|
"linux"
|
|
@@ -605,8 +605,8 @@
|
|
|
605
605
|
"optional": true
|
|
606
606
|
},
|
|
607
607
|
"node_modules/@bastani/atomic-natives-linux-x64-musl": {
|
|
608
|
-
"version": "0.9.
|
|
609
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.
|
|
608
|
+
"version": "0.9.17-alpha.1",
|
|
609
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.17-alpha.1.tgz",
|
|
610
610
|
"license": "MIT",
|
|
611
611
|
"os": [
|
|
612
612
|
"linux"
|
|
@@ -620,8 +620,8 @@
|
|
|
620
620
|
"optional": true
|
|
621
621
|
},
|
|
622
622
|
"node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
|
|
623
|
-
"version": "0.9.
|
|
624
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.
|
|
623
|
+
"version": "0.9.17-alpha.1",
|
|
624
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.17-alpha.1.tgz",
|
|
625
625
|
"license": "MIT",
|
|
626
626
|
"os": [
|
|
627
627
|
"win32"
|
|
@@ -632,8 +632,8 @@
|
|
|
632
632
|
"optional": true
|
|
633
633
|
},
|
|
634
634
|
"node_modules/@bastani/atomic-natives-win32-x64-msvc": {
|
|
635
|
-
"version": "0.9.
|
|
636
|
-
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.
|
|
635
|
+
"version": "0.9.17-alpha.1",
|
|
636
|
+
"resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.17-alpha.1.tgz",
|
|
637
637
|
"license": "MIT",
|
|
638
638
|
"os": [
|
|
639
639
|
"win32"
|
|
@@ -644,8 +644,8 @@
|
|
|
644
644
|
"optional": true
|
|
645
645
|
},
|
|
646
646
|
"node_modules/@bastani/pi-ai": {
|
|
647
|
-
"version": "0.9.
|
|
648
|
-
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.
|
|
647
|
+
"version": "0.9.17-alpha.1",
|
|
648
|
+
"resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.17-alpha.1.tgz",
|
|
649
649
|
"license": "MIT",
|
|
650
650
|
"dependencies": {
|
|
651
651
|
"@anthropic-ai/sdk": "0.91.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bastani/atomic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.17-alpha.1",
|
|
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.
|
|
83
|
-
"@bastani/pi-ai": "0.9.
|
|
82
|
+
"@bastani/atomic-natives": "0.9.17-alpha.1",
|
|
83
|
+
"@bastani/pi-ai": "0.9.17-alpha.1",
|
|
84
84
|
"@dbos-inc/dbos-sdk": "4.25.14",
|
|
85
85
|
"@earendil-works/pi-agent-core": "^0.84.4",
|
|
86
86
|
"@earendil-works/pi-client": "^0.84.4",
|