@maiaos/node 0.1.0-canary.2 → 0.1.0-canary.4

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/README.md CHANGED
@@ -1,281 +1,67 @@
1
- # Maia Node (`@maiaos/node`)
1
+ # @maiaos/node
2
2
 
3
- [![npm canary](https://img.shields.io/npm/v/@maiaos/node/canary?label=npm%20canary)](https://www.npmjs.com/package/@maiaos/node)
3
+ Maia Node, the local authority of Maia OS: one process per machine and profile
4
+ that owns Sessions, turns, worker accounts, durable state, event order and
5
+ receipts for swarms of AI coding agents.
4
6
 
5
- Maia Node is the local authority of Maia OS: one process per machine and
6
- profile that owns Sessions, turns, worker accounts, durable state, event order
7
- and receipts for swarms of AI coding agents such as Claude Code and Codex.
7
+ > **Pre-release.** npm carries only `nightly` and `canary` builds, which are
8
+ > not release-qualified. No stable release exists
9
+ > ([D-132](https://github.com/vllnt/maia/blob/main/docs/decisions.md#d-132)).
8
10
 
9
- Every Maia client (the `maia` CLI, the `maia mcp` MCP server, the
10
- `@maiaos/sdk` TypeScript SDK and the Desktop app) reaches the Node through its
11
- authenticated loopback API; none of them owns state. The Node validates and
12
- authorizes each operation, stores the result in SQLite, writes a receipt and
13
- runs workers as child processes under a native process host.
11
+ ## Requirements
14
12
 
15
- ## Run it
13
+ - Node.js 24.22.1.
14
+ - macOS on Apple silicon or Linux x64, the platforms whose process host the
15
+ published builds ship (Linux is a source candidate). Windows is unsupported
16
+ and fails with `platform_unsupported`.
17
+ - On Linux, set pnpm's `packageImportMethod` to `clone-or-copy` before you
18
+ install: the Node refuses a process host with a second hard link, which pnpm
19
+ makes on ext4. Worker containment also needs a delegated cgroup v2 subtree
20
+ and Linux 6.12 or later
21
+ ([operations](https://github.com/vllnt/maia/blob/main/docs/operations.md)).
22
+ - Claude Code or the Codex CLI, for workers.
16
23
 
17
- In development, run a Node inside an isolated dev worktree, so it never touches
18
- your real `~/.maia`:
24
+ ## Install
19
25
 
20
26
  ```sh
21
- pnpm dev:worktree create try-maia
22
- cd ../maiaos-worktrees/try-maia
23
- pnpm dev:node # builds the Node and runs it in the foreground
24
- pnpm maia status # in a second terminal: the Node reports ready
27
+ pnpm add -g @maiaos/node@nightly
25
28
  ```
26
29
 
27
- The executable itself:
30
+ Install the [`maia` CLI](https://github.com/vllnt/maia/blob/main/apps/cli/README.md)
31
+ with it to drive the Node.
28
32
 
29
- ```sh
30
- pnpm --filter @maiaos/node build
31
- node services/node/dist/bin/maia-node.mjs --help
32
- node services/node/dist/bin/maia-node.mjs --desktop --profile <name>
33
- ```
34
-
35
- `--desktop` runs the authenticated local Node in the foreground, and
36
- `--profile` selects its runtime storage (`default` when omitted).
37
- For a Desktop-owned child, the native host sets `MAIA_DESKTOP_PARENT_PIPE=1`
38
- and retains its stdin writer. EOF or a pipe error interrupts the existing
39
- Node scope, including during startup, to drain and release runtime authority.
40
- A separate Effect deadline kills this process after 10 seconds if its drain
41
- stalls. A drain that finishes after SIGINT, SIGTERM or a closed pipe exits 0,
42
- so systemd logs no failure for a restart; a failed drain or startup keeps its
43
- non-zero code. Without that explicit flag, stdin closure does not stop the Node;
44
- attached local services and remote Nodes keep their own lifetimes. The
45
- self-kill deadline requires a responsive Node event loop.
46
- `maia-node remote probe|install|rollback|uninstall <ssh-host>` installs a
47
- pinned Node on a Linux host as a systemd user service, and `maia-node bridge`
48
- serves that host's Node API over SSH standard input and output, with no
49
- listener beyond loopback ([remote Node install](../../docs/operations.md#remote-node-install)).
50
- The local Node also registers remote Nodes (`node.remote.*`, S14): a preview
51
- probes and plans in a Node-scoped job, a confirmation bound to the plan
52
- digest records a receipt and runs the same install or uninstall, and the
53
- install pins `codex` and `claude` with a PATH of their directories, the Maia
54
- runtime and the system directories ([D-080](../../docs/decisions.md#d-080)).
55
- A local background service is planned (RL3). `@maiaos/node@canary` is
56
- published on npm for installation testing only; npm's automatic `latest` tag
57
- also points at a canary build.
58
-
59
- ## Key concepts
60
-
61
- - **One authority.** The Node alone validates, authorizes, persists, executes,
62
- orders events and writes receipts. Clients are projections: a cached client
63
- state never overwrites newer Node state.
64
- - **Node API.** The Node binds an ephemeral port on `127.0.0.1` only and writes
65
- an owner-private connection descriptor and bearer credential to its profile
66
- runtime directory. Unary operations use `POST /api/v1/operations`;
67
- observations use the `/api/v1/observations` WebSocket. A restart replaces the
68
- credential.
69
- - **Live observation (S12a).** `observe.events` replays committed journal rows
70
- from SQLite, which stays the source of cursors and replay. An idle
71
- subscriber wakes as soon as a journal append commits: a TEMP trigger on
72
- `domain_events` signals every append on the Node's connection, and a burst
73
- coalesces into one wake. The five-second heartbeat proves liveness and
74
- publishes filtered progress.
75
- - **Live Session items (S12b and S12c, source candidates).** A per-Session
76
- writer assigns each Codex or Claude Code item record its owner sequence. The live lane coalesces
77
- deltas for 33 ms and offers them to bounded attachment queues (256 records,
78
- 2 MiB); a full queue gets `resync`. The durable lane commits finished items
79
- in one transaction per 400 ms (`session_stream_records`, migration v50), and
80
- startup closes what a crashed epoch left open. `session.attach` on the
81
- observation socket replays or snapshots, synchronizes the open items, then
82
- streams live records.
83
- - **Profiles.** A profile has its own runtime directory, database and
84
- observability files. Each dev worktree runs its own profile and `MAIA_HOME`.
85
- - **Sessions and executors.** A Session runs one vendor executor, Codex through
86
- `codex app-server` or Claude Code through the Claude Agent SDK. A reading
87
- Session runs read-only in its Workspace; a coding Session (`--base`) gets a
88
- worktree of its own and writes only there, with `session diff` and
89
- `session archive` to review and retire it
90
- ([coding Sessions](../../docs/maia-swarm/external-executors.md#coding-sessions)).
91
- A Session is bound to
92
- one account Connection; when the caller names only the executor kind, the
93
- Node picks the eligible account with the most usage left. At most 8 Sessions
94
- run at once on a Node; each account allows 2 by default (1–16, set with
95
- `maia login <claude|codex> --max-sessions` or `maia connection capacity set`).
96
- - **Accounts.** A Connection is a named Codex or Claude Code account, either a
97
- Maia-managed account root or the system default login. The vendor CLI keeps
98
- custody of the credential; Maia never reads it. Vendor usage-limit signals
99
- mark an account `limited` until its reset time. A gateway Connection is an
100
- AI gateway's base URL with its API key in an owner-only `gateway-key` file;
101
- Claude Code and Codex Sessions on it receive the URL and key through their
102
- launch environment.
103
- - **Process hosts.** On macOS a native helper owns each worker's process groups,
104
- limits and cleanup proof (cooperative, not a sandbox). On Linux a helper puts
105
- each process tree in its own cgroup v2 directory and confines it with
106
- Landlock and seccomp; it needs a systemd user unit with `Delegate=yes` and
107
- Linux 6.12 or later, and it bounds the tree, not the user. Both are source
108
- candidates. A Windows Job Object helper exists in source but is unqualified:
109
- Windows is unsupported in v1 and fails with `platform_unsupported`. A host
110
- without qualified process authority fails closed. A vendor launch permit
111
- records where its host keeps the tree (the macOS process group, the Linux
112
- tree cgroups' parent), and after a crash the restarted Node frees the
113
- vendor only once that record shows the tree ended
114
- ([D-098](../../docs/decisions.md#d-098)).
115
- - **Mutations.** Every mutation checks a revision or command ID and returns a
116
- receipt; replaying a command ID returns the first result instead of acting
117
- twice. Project and container metadata, agent permissions, integration plans
118
- and the voice relay also need a preview and an explicit confirmation.
119
- - **Port leases (S16).** `port.lease.acquire|renew|release|list` grant 1–8
120
- loopback ports from `MAIA_PORT_RANGE` (default `41000-41999`) to a Session
121
- or the operator. Leases are advisory: the Node never restricts a bind or
122
- stops a process. A port is granted only when connects to `127.0.0.1` and
123
- `[::1]` are refused and a loopback bind succeeds. Leases last 15 minutes
124
- unless renewed, and end with their Session, at expiry or at Node start.
125
- Codex and Claude Code Sessions that hold leases receive `MAIA_PORTS`.
126
- - **Emergency holds.** A person holds exact Projects or accounts with a
127
- previewed, confirmed `hold.place`. Every new Session, start, resume, turn,
128
- Run dispatch and voice relay on a held target fails with `held`, checked in
129
- the transaction that admits it; account selection skips held accounts. A
130
- `stop` hold also stops the Sessions running on its targets in the same
131
- transaction, then ends their runtimes. Holds survive restarts, recovery never
132
- resumes held work, and `hold.release` restores admission. See
133
- [operations](../../docs/operations.md#emergency-holds-implemented-today-source-candidate).
134
- - **Worker credentials and fan-out guards (S18a, S18b).** Each Codex or
135
- Claude Code launch gets its own Session credential (`session-credential/`),
136
- revoked when its runtime ends; `Authorization: Maia-Session` admits that
137
- Session's role operations (`application/session-request.ts`). Both roles
138
- list Sessions only in the credential's Project, before pagination; an
139
- explicit other Project is refused. Human and external-coordinator lists
140
- retain whole-Node visibility ([D-092](../../docs/decisions.md#d-092)). The Linux
141
- helper denies Claude Code trees reads of the runtime directory and auth
142
- file; Codex's profile denies them to Codex commands
143
- ([D-110](../../docs/decisions.md#d-110)).
144
- `session-guard/` keeps each Session's role, parent and depth and the
145
- per-Project depth, live-children, messages-per-minute and
146
- leases-per-Session limits (`project.guard.*`), checked in the write that
147
- creates, sends or leases. See
148
- [vendor executors](../../docs/maia-swarm/external-executors.md#session-bound-worker-credential).
149
- - **Control dispatch.** An operator or coordinator request with a feature
150
- descriptor goes through `application/feature-handlers.ts`: one
151
- context-preserving adapter per registered Node handler, which forwards the
152
- command ID and any attached credential, selects the executor's services and
153
- fails closed when one is not composed (adopted-Session resume preflight,
154
- legacy versus interactive `terminal.create`, voice relay availability).
155
- Undescribed methods keep explicit routes in `application/control-request.ts`
156
- until their descriptors land.
157
- - **Model providers.** `provider.pool.list` reads the owner-only `auth.json`
158
- that `maia login` writes. The managed Pi worker leases one credential in
159
- memory per Session and releases it after a cleanup proof.
160
-
161
- ## Status
162
-
163
- Implemented as source candidates, not release-qualified:
164
-
165
- - the Node API, SQLite storage with checksummed migrations, and receipts with
166
- command-ID replay;
167
- - Projects, execution Workspaces, Workspace containers and confirmed Project
168
- metadata;
169
- - Sessions with Codex and Claude Code executors: create, start, stop, resume,
170
- rename, observe, events, with titles (given at creation or taken from the
171
- first turn); turns: send, wait, show, interrupt;
172
- - reference resolution (`reference.resolve`): an ID, ID prefix, name or
173
- Session title, or the registered folder containing a path, to one exact ID
174
- or its candidates;
175
- - Connections, sign-in, usage and integration approval of vendor executables;
176
- - record-only external questions (`interaction.*`), presentation reads, live
177
- terminals on macOS, and the release-disabled voice orchestrator;
178
- - emergency holds on exact Projects and accounts (`hold.*`, S20);
179
- - the Run ledger over executor Sessions (`run.ledger.*`, S19): a task graph
180
- whose dispatches are Codex or Claude Code Session turns, Task state derived
181
- from dispatches, three failed dispatches stop a Task, and the
182
- `session.observe` attention value.
183
- - Session-bound worker credentials, coding-worker MCP launch configuration,
184
- roles and per-Project fan-out guards
185
- (`project.guard.*`, S18a and S18b).
186
-
187
- Planned: Pi item adapters and the Desktop timeline
188
- (S12d) on the S12b stream, host and agent observability
189
- (S15), advisory leases (S16, in progress), Node and capability holds with `capability.revoke`, coding
190
- workers (S5), the installer and
191
- background service (RL3) and updates (RL4). The
192
- [roadmap](../../ROADMAP.md#v1-external-brain-and-vendor-executors) tracks each
193
- slice.
33
+ ## Usage
194
34
 
195
- ## Direction: Control Nodes, Execution Nodes and principals
196
-
197
- The Node is designed to grow into an organization's agent hub. None of this is
198
- implemented:
199
-
200
- - one **Control Node** owns durable truth for team Workspaces, starting from an
201
- explicit first-owner bootstrap
202
- ([design](../../docs/team-workspaces-and-control-nodes.md));
203
- - every request resolves a server-created **principal** with explicit Project
204
- **grants**; callers never supply identity, operator rights or grants
205
- ([identity, authentication and tenancy](../../docs/maia-node/architecture.md#identity-authentication-and-tenancy));
206
- - enrolled **Execution Nodes** (your computer, a VPS, other servers) provide
207
- capacity through one-time pairing and Node-issued certificates;
208
- - **A2A** peers map each accepted task to one durable Maia task and never
209
- receive worker leases or mutation authority.
210
-
211
- ## Development
35
+ Run the Node in the foreground, then check it from a second terminal with the
36
+ CLI:
212
37
 
213
38
  ```sh
214
- pnpm --filter @maiaos/node build
215
- pnpm --filter @maiaos/node lint
216
- pnpm --filter @maiaos/node typecheck
217
- pnpm --filter @maiaos/node test
218
- pnpm test:resource-diagnostic # from the repository root
219
- pnpm --filter @maiaos/node test:observation-benchmark
39
+ maia-node --desktop --profile <name> # --profile defaults to "default"
40
+ maia --profile <name> status # the Node reports ready
220
41
  ```
221
42
 
222
- The observation benchmark commits through a real SQLite journal after seeded
223
- idle gaps of 0–3 s and times delivery to an SDK subscriber over loopback; it
224
- fails above a p95 of 50 ms and writes `.artifacts/benchmarks/`. Measured on an
225
- Apple M4 Pro (12 cores, macOS 27.2, Node 24.19.0) while parallel test runs
226
- loaded the machine (load average 5–32), 100 samples each:
227
-
228
- | Measure | Before S12a | After S12a |
229
- | -------------------------------------- | ------------------------ | -------------------- |
230
- | Commit to subscriber, p50 / p95 / max | 3,410 / 4,874 / 4,957 ms | 1.9 / 4.7 / 19.8 ms |
231
- | Idle CPU per 60 s, 8 subscribers | 222 ms (165–279) | 267 ms (207–334) |
232
- | 10,000 commits, 142 forced resumptions | not measured | none lost or doubled |
233
-
234
- The idle row is the median and range of six alternating runs each; the spread
235
- between runs is wider than the difference. The new wait races two Effect
236
- fibers where the old loop slept, about 60 µs per wait in a microbenchmark,
237
- roughly 6 ms of CPU per minute for eight idle subscribers.
238
-
239
- The S12b acceptance test (`src/runtime/node-api/observation/attach.integration.test.ts`)
240
- drives a synthetic harness into the real hub, the real Node API server, the
241
- SDK and the in-process `maia session attach` command, and times each delta
242
- until the CLI writes it. Same machine and load conditions:
43
+ The Node binds an ephemeral port on `127.0.0.1` only and writes an
44
+ owner-private connection descriptor and credential to its profile directory.
45
+ Every client reaches it through `@maiaos/sdk`; none of them owns state.
243
46
 
244
- | Measure (S12b) | Result |
245
- | ------------------------------------------------- | ---------------------------------- |
246
- | Harness delta to CLI line, 1 streaming Session | p50 18.8 ms, p95 36.0 ms (150) |
247
- | Harness delta to CLI line, 100 streaming Sessions | p50 21.1 ms, p95 39.3 ms (900) |
248
- | Durable writes per streaming Session | at most 2.78 per second |
249
- | Catch-up of 1,000 records to `synchronized` | p50 15.8 ms, p95 22.9 ms (10 runs) |
250
- | Viewer beside a stalled subscriber | p95 36.1 ms; stalled one: `resync` |
47
+ From a source checkout, `pnpm dev:node` runs a Node inside an isolated dev
48
+ worktree and never touches your real `~/.maia`. See the
49
+ [quick start](https://github.com/vllnt/maia#quick-start).
251
50
 
252
- At 100 Sessions six viewers attach (the observation socket admits eight), and
253
- every Session streams a delta every 20 ms. S12c runs the same test with each
254
- delta sent as an Agent SDK partial message through the Claude adapter:
255
-
256
- | Measure (S12c, Claude adapter) | Result |
257
- | ------------------------------------------------- | ------------------------------ |
258
- | Harness delta to CLI line, 1 streaming Session | p50 18.8 ms, p95 34.6 ms (150) |
259
- | Harness delta to CLI line, 100 streaming Sessions | p50 19.2 ms, p95 37.2 ms (900) |
260
- | Durable writes per streaming Session | at most 2.55 per second |
261
-
262
- Tests use deterministic clocks, identifiers, transports and disposable SQLite.
263
- Package tests get a throwaway `MAIA_HOME`; never point a test at your real
264
- `~/.maia`.
265
-
266
- ## Documentation
51
+ ## Status
267
52
 
268
- - [Node architecture](../../docs/maia-node/architecture.md): Sessions,
269
- activations, supervision, events, observation streaming and recovery
270
- - [Operations](../../docs/operations.md): deployment, SQLite, identity, backup
271
- and observability
272
- - [External brain and vendor executors](../../docs/maia-swarm/external-executors.md):
273
- executor, account and containment decisions
274
- - [Release, update and compatibility](../../docs/release.md): the planned
275
- installer, service and update flow
276
- - Scope READMEs: [harness adapters](./src/harness/README.md) and
277
- [Project and Workspace storage](./src/project-workspace/README.md)
53
+ **Source candidate.** The Node validates and authorizes each operation, stores
54
+ the result in SQLite, writes a receipt and runs Codex and Claude Code workers
55
+ as child processes under a native process host. A local background service is
56
+ planned. The
57
+ [roadmap](https://github.com/vllnt/maia/blob/main/ROADMAP.md) tracks each
58
+ slice.
278
59
 
279
- ## License
60
+ ## Links
280
61
 
281
- No license has been published yet. All rights reserved.
62
+ - [Node architecture](https://github.com/vllnt/maia/blob/main/docs/maia-node/architecture.md)
63
+ - [Operations](https://github.com/vllnt/maia/blob/main/docs/operations.md):
64
+ lifecycle, remote Nodes, SQLite, backup and observability
65
+ - [Vendor executors](https://github.com/vllnt/maia/blob/main/docs/maia-swarm/external-executors.md)
66
+ - [Security policy](https://github.com/vllnt/maia/blob/main/SECURITY.md)
67
+ - [Repository](https://github.com/vllnt/maia)
@@ -0,0 +1,105 @@
1
+ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
2
+ import { Cause, Clock, Deferred, Effect, Exit, Fiber, Option, Ref, Runtime, } from "effect";
3
+ import { ShutdownDeadline } from "../runtime/desktop-parent/index.js";
4
+ /** How long, in milliseconds, the process waits for readers to take its output once the command ends. */
5
+ const OUTPUT_DEADLINE = 5000;
6
+ /**
7
+ * Twin of `watch` in apps/cli/src/bootstrap/exit.ts: keep the two in step.
8
+ * Watches a stream from the start and returns its drain. An empty write
9
+ * completes after every earlier write; a stream that fails or closes takes no
10
+ * more output. A reader that closes fails its stream with EPIPE, and the error
11
+ * listener keeps that error from replacing the command's exit code. Skip a
12
+ * stream with nothing queued: on macOS even an empty write fails with EPIPE
13
+ * once the reader has closed.
14
+ */
15
+ const watch = (output) => Effect.gen(function* () {
16
+ const ended = yield* Deferred.make();
17
+ const end = () => {
18
+ Deferred.doneUnsafe(ended, Effect.succeed(true));
19
+ };
20
+ output.on("error", end);
21
+ output.on("close", end);
22
+ const flushed = Effect.callback((resume) => {
23
+ if (output.writableLength === 0) {
24
+ resume(Effect.succeed(true));
25
+ return;
26
+ }
27
+ output.write("", () => {
28
+ resume(Effect.succeed(true));
29
+ });
30
+ });
31
+ return Effect.raceFirst(Deferred.await(ended), flushed);
32
+ });
33
+ /** A drained interrupt is a clean stop (systemd logs no failure for a restart). */
34
+ const exitCode = (exit) => {
35
+ if (Exit.isSuccess(exit))
36
+ return exit.value;
37
+ if (Cause.hasInterruptsOnly(exit.cause))
38
+ return 0;
39
+ return Runtime.getErrorExitCode(Cause.squash(exit.cause));
40
+ };
41
+ /**
42
+ * Waits for every drain up to OUTPUT_DEADLINE, and never past the shutdown
43
+ * deadline that a closed Desktop parent pipe sets. None when time runs out.
44
+ */
45
+ const drainBy = (drains, deadline) => Effect.gen(function* () {
46
+ const now = Number((yield* Clock.monotonicTimeNanos) / 1000000n);
47
+ // A wait of 0 or less ends at once.
48
+ const left = (yield* Ref.get(deadline)) - now;
49
+ return yield* Effect.all(drains, {
50
+ concurrency: "unbounded",
51
+ discard: true,
52
+ }).pipe(Effect.timeoutOption(Math.min(OUTPUT_DEADLINE, left)));
53
+ });
54
+ /**
55
+ * Runs the command, then waits for stdout and stderr to reach their readers
56
+ * (see drainBy), and leaves with the command's code. Signals cannot cut that
57
+ * wait short. A failed stream loses its own queued output but neither the
58
+ * code nor the other stream's output. Exit 0 after drained output waits for
59
+ * the event loop instead: a Node that keeps its profile lock for an unsettled
60
+ * telemetry write lives until that write settles. A closed Desktop parent pipe
61
+ * interrupts the command without a signal, so an interrupt leaves explicitly,
62
+ * even while a telemetry write holds the lock.
63
+ */
64
+ export const exitAfterOutput = (command, host) => Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
65
+ const drains = [yield* watch(host.stdout), yield* watch(host.stderr)];
66
+ // runMain installs its SIGINT and SIGTERM listeners after starting the
67
+ // fiber, and leaves them installed if the fiber already finished.
68
+ yield* Effect.yieldNow;
69
+ // The command runs as its own fiber, so its end interrupts and awaits
70
+ // the fibers it forked, such as the Desktop wrapper's Node. A signal
71
+ // interrupts this wait instead: pass it on and await the command. A
72
+ // signal during that cleanup ends the fiber interrupted, so keep the
73
+ // command's own exit.
74
+ const outcome = yield* Deferred.make();
75
+ const deadline = yield* Ref.make(Number.POSITIVE_INFINITY);
76
+ const running = yield* Effect.forkChild(command.pipe(Effect.onExit((exit) => Deferred.succeed(outcome, exit)), Effect.provideService(ShutdownDeadline, deadline)), { startImmediately: true });
77
+ yield* Effect.exit(restore(Fiber.await(running)));
78
+ yield* Fiber.interrupt(running);
79
+ const exit = yield* Deferred.await(outcome);
80
+ const code = exitCode(exit);
81
+ const inTime = yield* drainBy(drains, deadline);
82
+ if (code !== 0 || Exit.isFailure(exit) || Option.isNone(inTime)) {
83
+ host.exit(code);
84
+ }
85
+ }));
86
+ /**
87
+ * A signal during the drain after exit 0 ends the fiber interrupted; runMain
88
+ * then exits 0. Once the fiber ends, runMain removes its listeners, so a later
89
+ * signal takes its default action.
90
+ */
91
+ const teardown = (exit, onExit) => {
92
+ if (Exit.isFailure(exit) && !Cause.hasInterruptsOnly(exit.cause)) {
93
+ Runtime.defaultTeardown(exit, onExit);
94
+ return;
95
+ }
96
+ onExit(0);
97
+ };
98
+ /** The process entry: runMain owns SIGINT and SIGTERM for the whole run. */
99
+ export const runCommand = (command, host) => {
100
+ NodeRuntime.runMain(exitAfterOutput(command, host), {
101
+ disableErrorReporting: true,
102
+ teardown,
103
+ });
104
+ };
105
+ //# sourceMappingURL=exit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exit.js","sourceRoot":"","sources":["../../src/bin/exit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,0CAA0C,CAAC;AACxE,OAAO,EACL,KAAK,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,GACR,MAAM,QAAQ,CAAC;AAEhB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AActE,yGAAyG;AACzG,MAAM,eAAe,GAAG,IAAI,CAAC;AAE7B;;;;;;;;GAQG;AACH,MAAM,KAAK,GAAG,CAAC,MAAc,EAAsC,EAAE,CACnE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAQ,CAAC;IAC3C,MAAM,GAAG,GAAG,GAAG,EAAE;QACf,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC,CAAC;IACF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IACxB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAO,CAAC,MAAM,EAAE,EAA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,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAClD,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAChD,IAAI,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CACH,CAAC;AAEJ;;;;GAIG;AACH,MAAM,QAAQ,GAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;IAClD,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACtC,OAAO;IACT,CAAC;IACD,MAAM,CAAC,CAAC,CAAC,CAAC;AACZ,CAAC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,OAA8B,EAC9B,IAAoB,EACd,EAAE;IACR,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;QAClD,qBAAqB,EAAE,IAAI;QAC3B,QAAQ;KACT,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -5,17 +5,17 @@ Generated from the exact esbuild input graph. Do not edit by hand.
5
5
  ================================================================================
6
6
  @anthropic-ai/claude-agent-sdk 0.3.285
7
7
  Declared license: SEE LICENSE IN README.md
8
- Bundled source: node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.285_@anthropic-ai+sdk@0.124.0_zod@4.4.3__zod@4.4.3/node_modules/@anthropic-ai/claude-agent-sdk
8
+ Bundled source: node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.285_@anthropic-ai+sdk@0.124.0_zod@4.6.7__zod@4.6.7/node_modules/@anthropic-ai/claude-agent-sdk
9
9
 
10
- --- node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.285_@anthropic-ai+sdk@0.124.0_zod@4.4.3__zod@4.4.3/node_modules/@anthropic-ai/claude-agent-sdk/LICENSE.md ---
10
+ --- node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.285_@anthropic-ai+sdk@0.124.0_zod@4.6.7__zod@4.6.7/node_modules/@anthropic-ai/claude-agent-sdk/LICENSE.md ---
11
11
  © Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.
12
12
 
13
13
  ================================================================================
14
14
  @anthropic-ai/sdk 0.124.0
15
15
  Declared license: MIT
16
- Bundled source: node_modules/.pnpm/@anthropic-ai+sdk@0.124.0_zod@4.4.3/node_modules/@anthropic-ai/sdk
16
+ Bundled source: node_modules/.pnpm/@anthropic-ai+sdk@0.124.0_zod@4.6.7/node_modules/@anthropic-ai/sdk
17
17
 
18
- --- node_modules/.pnpm/@anthropic-ai+sdk@0.124.0_zod@4.4.3/node_modules/@anthropic-ai/sdk/LICENSE ---
18
+ --- node_modules/.pnpm/@anthropic-ai+sdk@0.124.0_zod@4.6.7/node_modules/@anthropic-ai/sdk/LICENSE ---
19
19
  Copyright 2023 Anthropic, PBC.
20
20
 
21
21
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@@ -27,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
27
27
  ================================================================================
28
28
  @earendil-works/pi-agent-core 1.0.0
29
29
  Declared license: MIT
30
- Bundled source: node_modules/.pnpm/@earendil-works+pi-agent-core@1.0.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+_d4c1f7ee96d6f5ebdd19f05590d69587/node_modules/@earendil-works/pi-agent-core
30
+ Bundled source: node_modules/.pnpm/@earendil-works+pi-agent-core@1.0.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+_1cbdcdb54bed9951d94bc3a8c6012857/node_modules/@earendil-works/pi-agent-core
31
31
 
32
32
  --- third-party/pi/1.0.0/LICENSE ---
33
33
  MIT License
@@ -87,7 +87,7 @@ No other package or release is covered.
87
87
  ================================================================================
88
88
  @earendil-works/pi-ai 1.0.0
89
89
  Declared license: MIT
90
- Bundled source: node_modules/.pnpm/@earendil-works+pi-ai@1.0.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signatur_705b8cd9e29c50de90578a4fe63a9836/node_modules/@earendil-works/pi-ai
90
+ Bundled source: node_modules/.pnpm/@earendil-works+pi-ai@1.0.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signatur_266ec03411b655632c4370b9e0020682/node_modules/@earendil-works/pi-ai
91
91
 
92
92
  --- third-party/pi/1.0.0/LICENSE ---
93
93
  MIT License
@@ -207,7 +207,7 @@ No other package or release is covered.
207
207
  ================================================================================
208
208
  @earendil-works/pi-coding-agent 1.0.0
209
209
  Declared license: MIT
210
- Bundled source: node_modules/.pnpm/@earendil-works+pi-coding-agent@1.0.0_@aws-sdk+credential-provider-node@3.972.84_@smith_6dfdb0ce825b5db34d88fed2ef7173fb/node_modules/@earendil-works/pi-coding-agent
210
+ Bundled source: node_modules/.pnpm/@earendil-works+pi-coding-agent@1.0.0_@aws-sdk+credential-provider-node@3.972.84_@smith_40f29ede8821fb5b93989ab9d2923b41/node_modules/@earendil-works/pi-coding-agent
211
211
 
212
212
  --- third-party/pi/1.0.0/LICENSE ---
213
213
  MIT License
@@ -999,11 +999,11 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
999
999
  OTHER DEALINGS IN THE SOFTWARE.
1000
1000
 
1001
1001
  ================================================================================
1002
- brace-expansion 5.0.9
1002
+ brace-expansion 5.0.12
1003
1003
  Declared license: MIT
1004
- Bundled source: node_modules/.pnpm/brace-expansion@5.0.9/node_modules/brace-expansion
1004
+ Bundled source: node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion
1005
1005
 
1006
- --- node_modules/.pnpm/brace-expansion@5.0.9/node_modules/brace-expansion/LICENSE ---
1006
+ --- node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/LICENSE ---
1007
1007
  MIT License
1008
1008
 
1009
1009
  Copyright Julian Gruber <julian@juliangruber.com>
@@ -3198,9 +3198,9 @@ SOFTWARE.
3198
3198
  ================================================================================
3199
3199
  openai 7.19.0
3200
3200
  Declared license: Apache-2.0
3201
- Bundled source: node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.3_undici@8.10.2_ws@8.22.0_zod@4.4.3/node_modules/openai
3201
+ Bundled source: node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.3_undici@8.12.2_ws@8.22.0_zod@4.6.7/node_modules/openai
3202
3202
 
3203
- --- node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.3_undici@8.10.2_ws@8.22.0_zod@4.4.3/node_modules/openai/LICENSE ---
3203
+ --- node_modules/.pnpm/openai@7.19.0_@aws-sdk+credential-provider-node@3.972.84_@smithy+signature-v4@5.7.3_undici@8.12.2_ws@8.22.0_zod@4.6.7/node_modules/openai/LICENSE ---
3204
3204
  Apache License
3205
3205
  Version 2.0, January 2004
3206
3206
  http://www.apache.org/licenses/
@@ -3741,11 +3741,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
3741
3741
  THE SOFTWARE.
3742
3742
 
3743
3743
  ================================================================================
3744
- undici 8.10.2
3744
+ undici 8.12.2
3745
3745
  Declared license: MIT
3746
- Bundled source: node_modules/.pnpm/undici@8.10.2/node_modules/undici
3746
+ Bundled source: node_modules/.pnpm/undici@8.12.2/node_modules/undici
3747
3747
 
3748
- --- node_modules/.pnpm/undici@8.10.2/node_modules/undici/LICENSE ---
3748
+ --- node_modules/.pnpm/undici@8.12.2/node_modules/undici/LICENSE ---
3749
3749
  MIT License
3750
3750
 
3751
3751
  Copyright (c) Matteo Collina and Undici contributors
@@ -3906,3 +3906,12 @@ Signing: missing_release_signature
3906
3906
  Compiler/runtime notice: No third-party compiler or runtime payload is bundled; the helper dynamically links only the Apple platform libraries recorded above.
3907
3907
  Runtime dependencies:
3908
3908
  /usr/lib/libSystem.B.dylib
3909
+
3910
+ Artifact: services/node/dist/bin/maia-process-host-linux-x64
3911
+ Target: linux-x64
3912
+ Compiler: cc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
3913
+ SDK: glibc 2.39
3914
+ Signing: missing_release_signature
3915
+ Compiler/runtime notice: No third-party compiler or runtime payload is bundled; the helper dynamically links only the system C library recorded above.
3916
+ Runtime dependencies:
3917
+ libc.so.6