@elpapi42/pi-fleet 0.1.0-beta.0

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 ADDED
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0-beta.0 — 2026-07-20
4
+
5
+ First public beta of Pi Fleet.
6
+
7
+ ### Included
8
+
9
+ - Seven-command JSON-first CLI: `create`, `send`, `receive`, `status`, `list`, `watch`, and `destroy`.
10
+ - Named resident Pi processes with restore-on-address from native Pi sessions.
11
+ - Exact compatible Pi argument passthrough after `--` and Fleet-owned `--cwd`.
12
+ - Ordered repeated steering input and idle-based latest-assistant response retrieval.
13
+ - Raw live Pi session JSONL watching.
14
+ - SQLite-backed names, latest responses, operation idempotency, and conservative crash recovery.
15
+ - Verified immutable runtime materialization with recursively hashed production dependencies.
16
+ - Linux process-group cleanup, bounded capacity/streams, and systemd service foundations.
17
+ - Managed `@earendil-works/pi-coding-agent@0.80.10` runtime dependency.
18
+
19
+ ### Beta limitations
20
+
21
+ - Release validation covers Linux x64 only.
22
+ - Actual logout/reboot recovery is not yet validated.
23
+ - macOS launchd and descendant containment are not release-validated.
24
+ - Service management has no public supported CLI yet.
25
+ - Automatic runtime upgrades and binary rollback across schema migrations are not supported.
26
+ - `watch` cannot guarantee exactly-once output under arbitrary external session rewrites.
27
+
28
+ Pi sessions remain user-owned and are never deleted by `pifleet destroy` or npm uninstall.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 elpapi42
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,201 @@
1
+ # Pi Fleet
2
+
3
+ Pi Fleet is a local runtime and machine-first CLI for named, long-lived Pi agents.
4
+
5
+ ```text
6
+ create · send · receive · status · list · watch · destroy
7
+ ```
8
+
9
+ Fleet keeps a Pi process resident when possible, restores it from the same native Pi session when absent, accepts repeated steering input, and returns the latest assistant message after Pi becomes idle. Pi sessions remain under your control: Fleet references them but never copies or deletes them.
10
+
11
+ > **Beta:** `0.1.0-beta.0` is release-validated on Linux x64 with Pi `0.80.10`. macOS, actual logout/reboot recovery, automatic upgrades, and public service-management UX are not yet release-validated.
12
+
13
+ ## Install
14
+
15
+ Requirements:
16
+
17
+ - Linux x64
18
+ - Node.js `^22.19.0 || ^24.0.0`
19
+ - normal Pi provider credentials and configuration
20
+
21
+ Install the beta globally:
22
+
23
+ ```bash
24
+ npm install --global @elpapi42/pi-fleet@beta
25
+ pifleet --version
26
+ pifleet list
27
+ ```
28
+
29
+ `npx @elpapi42/pi-fleet@beta` is suitable for evaluation, but a global installation is recommended for continued use. Fleet materializes a verified runtime independently of the npm installation/cache, and evaluation can leave that runtime and Fleet state behind intentionally.
30
+
31
+ Pi Fleet includes the tested Pi coding-agent package. It uses your normal Pi configuration, provider credentials, extensions, skills, and project resources. **Do not put API keys or other secrets in CLI arguments:** Fleet persists accepted Pi arguments so it can restore the agent. Use Pi's credential configuration or provider environment variables instead.
32
+
33
+ ## Quick start
34
+
35
+ Create a promptless named agent in the current project:
36
+
37
+ ```bash
38
+ pifleet create reviewer --cwd "$PWD"
39
+ ```
40
+
41
+ Send work and retrieve the latest assistant message after Pi becomes idle:
42
+
43
+ ```bash
44
+ pifleet send reviewer "Review the authentication changes"
45
+ pifleet receive reviewer --human
46
+ ```
47
+
48
+ Inspect and remove Fleet management:
49
+
50
+ ```bash
51
+ pifleet status reviewer
52
+ pifleet list
53
+ pifleet destroy reviewer
54
+ ```
55
+
56
+ `destroy` stops Fleet's managed process and removes the Fleet name. It **never deletes the Pi session**.
57
+
58
+ ## Commands
59
+
60
+ ```text
61
+ pifleet create NAME [INITIAL_INSTRUCTIONS] [--cwd PATH] [--human] [-- PI_OPTIONS...]
62
+ pifleet send NAME MESSAGE [--human]
63
+ pifleet receive NAME [--timeout DURATION] [--human]
64
+ pifleet status NAME [--human]
65
+ pifleet list [--human]
66
+ pifleet watch NAME
67
+ pifleet destroy NAME [--human]
68
+ ```
69
+
70
+ Finite commands emit JSON by default. Add `--human` for concise human output. `watch` has no human mode: stdout is only raw, complete records appended to the selected Pi session JSONL.
71
+
72
+ Messages can be read explicitly from stdin with `-`:
73
+
74
+ ```bash
75
+ git diff | pifleet send reviewer -
76
+ pifleet create researcher - < instructions.md
77
+ ```
78
+
79
+ ### Native Pi arguments
80
+
81
+ Fleet owns only its small command surface. `--cwd` belongs before the first literal `--`; native Pi options belong after it and retain their token order:
82
+
83
+ ```bash
84
+ pifleet create reviewer \
85
+ --cwd /workspace/project \
86
+ -- \
87
+ --session /absolute/path/to/session.jsonl \
88
+ --model anthropic/claude-sonnet-4 \
89
+ --thinking high
90
+ ```
91
+
92
+ Supported native session selection includes:
93
+
94
+ ```bash
95
+ pifleet create existing -- --session /path/to/session.jsonl
96
+ pifleet create exact-id -- --session-id SESSION_ID
97
+ pifleet create forked -- --fork /path/to/source.jsonl
98
+ pifleet create latest -- --continue
99
+ ```
100
+
101
+ Pi interprets these options directly. An existing or missing `--session` path follows native Pi behavior, and an exact `--session-id` remains exact. Fleet records the concrete selected session only so later process restoration reopens the same conversation. Headless `--resume` is not supported because it requires interactive selection before RPC mode.
102
+
103
+ Positional Pi prompts and `@file` inputs after `--` are rejected; use Fleet's optional create instructions or `send` so input remains ordered.
104
+
105
+ ## Communication semantics
106
+
107
+ `send` uses Pi's normal context-sensitive prompt operation with steering behavior:
108
+
109
+ - while Pi is active, input is queued as steering;
110
+ - while Pi is idle, input begins normal work;
111
+ - repeated sends are accepted in order;
112
+ - acknowledgement means Pi accepted/queued the input, not that it completed or produced a distinct response.
113
+
114
+ `receive` deliberately has no per-send response correlation:
115
+
116
+ - while Pi is busy or restoring, it waits for Pi to become idle;
117
+ - once idle, it returns Pi's latest assistant message;
118
+ - when already idle, it returns immediately;
119
+ - with no assistant message, it returns `no_response`;
120
+ - `--timeout 0` performs an immediate poll;
121
+ - timing out does not cancel or change Pi.
122
+
123
+ ## Sessions and `watch`
124
+
125
+ Pi and you own session files, IDs, locations, creation, migration, and deletion. Fleet never copies, relocates, or deletes them.
126
+
127
+ ```bash
128
+ pifleet watch reviewer > live-session.jsonl
129
+ ```
130
+
131
+ `watch` is live-only. For an existing file it begins at the current EOF; for a not-yet-materialized file it waits and begins at byte zero. It does not emit Fleet wrappers, history, or transient RPC events. Concurrent external rewrites can invalidate tailing; detectable replacement, truncation, lag, or runtime loss is reported on stderr.
132
+
133
+ ## Runtime and local data
134
+
135
+ The short-lived CLI connects to one private per-user runtime. On first operational use, Fleet verifies and materializes an immutable runtime release, then starts it in the background. A registered native service is preferred when present; service management is experimental and is not part of the seven-command beta interface.
136
+
137
+ Linux defaults:
138
+
139
+ ```text
140
+ Fleet state: ~/.local/state/pi-fleet/
141
+ Materialized code: ~/.local/share/pi-fleet/releases/
142
+ Runtime socket: $XDG_RUNTIME_DIR/pifleet-$UID/control.sock
143
+ (or the system temporary directory when XDG_RUNTIME_DIR is absent)
144
+ Pi sessions: Pi's normal ~/.pi storage or the exact path you selected
145
+ ```
146
+
147
+ `PIFLEET_STATE_ROOT` and `PIFLEET_APPLICATION_ROOT` can override Fleet-owned locations. A CLI invocation whose state root differs from an installed service fails immediately with repair guidance instead of connecting to the wrong database.
148
+
149
+ ## Uninstall and recovery
150
+
151
+ Before uninstalling, destroy agents you no longer want Fleet to manage:
152
+
153
+ ```bash
154
+ pifleet list --human
155
+ pifleet destroy AGENT_NAME
156
+ npm uninstall --global @elpapi42/pi-fleet
157
+ ```
158
+
159
+ Removing the npm package does not delete Pi sessions, Fleet's SQLite state, materialized runtime releases, or an already-running runtime/service. This protects durable agents from package-manager changes. Reinstalling the same or a compatible version reconnects to the preserved state.
160
+
161
+ There is intentionally no automatic self-update, telemetry, remote transport, or npm `postinstall` service registration. Database migrations are forward-only; installing an older binary after a newer schema migration is not a supported rollback strategy.
162
+
163
+ For support, include:
164
+
165
+ ```bash
166
+ node --version
167
+ pifleet --version
168
+ pifleet list
169
+ pifleet status AGENT_NAME
170
+ ```
171
+
172
+ Do not include API keys, message contents, session contents, or private paths unnecessarily. Report reproducible issues at <https://github.com/elpapi42/pi-fleet/issues>.
173
+
174
+ ## Beta limitations
175
+
176
+ - Release validation currently covers Linux x64 only.
177
+ - Actual logout and host reboot recovery remain unvalidated.
178
+ - launchd and macOS descendant containment remain unvalidated.
179
+ - Native service install/repair/uninstall exists internally but has no supported public UX yet.
180
+ - Runtime upgrades are not automatic; active runtimes are not silently replaced.
181
+ - Session tails cannot promise exactly-once behavior under arbitrary external mutation.
182
+ - A promptless missing session path may remain physically unmaterialized until Pi writes conversation content, following native Pi behavior.
183
+
184
+ ## Development
185
+
186
+ ```bash
187
+ npm ci
188
+ npm run typecheck
189
+ npm run lint
190
+ npm run format:check
191
+ npm test
192
+ npm run build
193
+ npm run test:package
194
+ npm run test:platform
195
+ ```
196
+
197
+ See [`IMPLEMENTATION_PLAN.md`](./IMPLEMENTATION_PLAN.md) for architecture, completed evidence, and remaining release gates.
198
+
199
+ ## License
200
+
201
+ MIT © elpapi42
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ const minimumNode22Minor = 19;
4
+ const [major, minor] = process.versions.node.split(".").map(Number);
5
+ const isSupported = (major === 22 && minor >= minimumNode22Minor) || major === 24;
6
+
7
+ if (!isSupported) {
8
+ process.stderr.write(
9
+ `Pi Fleet runtime requires Node ^22.19.0 or ^24.0.0; found ${process.versions.node}. Run the installer repair operation with a supported Node executable.\n`,
10
+ );
11
+ process.exitCode = 1;
12
+ } else {
13
+ const runtime = await import("../dist/runtime.mjs");
14
+ await runtime.runRuntime();
15
+ }
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ const minimumNode22Minor = 19;
4
+ const [major, minor] = process.versions.node.split(".").map(Number);
5
+ const isSupported = (major === 22 && minor >= minimumNode22Minor) || major === 24;
6
+
7
+ if (!isSupported) {
8
+ process.stderr.write(
9
+ `pifleet requires Node ^22.19.0 or ^24.0.0; found ${process.versions.node}.\n`,
10
+ );
11
+ process.exitCode = 1;
12
+ } else {
13
+ const cli = await import("../dist/cli.mjs");
14
+ process.exitCode = await cli.runCli(process.argv.slice(2));
15
+ }