@ctlflow/fleet 0.0.0-stage → 0.1.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.
@@ -0,0 +1,109 @@
1
+ # Fleet sessions
2
+
3
+ ## Management
4
+
5
+ Open a fleet's **Agents** tab: the agents table comes first, followed by the
6
+ fleet-wide **Native sessions** controls. For one agent, open its **Session** tab.
7
+ The fleet owner and administrators can request:
8
+
9
+ | Action | Native execution | History and delivery |
10
+ | --- | --- | --- |
11
+ | Resume session(s) | Start stopped agents or wake sleeping native engines; retain active bindings. | Resume full saved native histories, identities and current configured parameters. Delivery follows the fleet's existing setting. |
12
+ | Stop session(s) | Close the selected listeners and owned engines. | Retain native histories, accounts, permissions and unread positions. The controller remains connected. |
13
+ | Start with fresh history | Stop selected agents, prepare private exports and restart with fresh model contexts. | Archive old bindings; retain identity, credentials, permissions, Matrix messages and configured parameters. Confirmation is required. |
14
+
15
+ Fleet scope means all enrolled agents in that fleet; agent scope means only the
16
+ selected agent. Fresh-history confirmation names the scope and explains that model
17
+ context is being replaced. Cancelling confirmation submits nothing. Stopping also
18
+ confirms that running operating-system commands are not frozen for later continuation.
19
+
20
+ The paginated operations table shows pending, running, succeeded or failed results
21
+ reported by the controller. Acceptance is not completion. A failed fleet operation
22
+ may contain successful peers; inspect the per-agent errors before retrying. An
23
+ offline controller cannot accept a session operation through management.
24
+
25
+ **Delivery** is separate: pausing delivery retains active bindings and any live
26
+ native engines. Resuming sessions does not silently enable a fleet whose delivery
27
+ was paused. fleetd itself hosts the listeners: one binding per active agent, not
28
+ one listener process per agent. Each fleet has its scoped controller connection.
29
+
30
+ ## Automatic sleep
31
+
32
+ Crossfire's Policy page sets fleet idle sleep; the default is 30 minutes and zero
33
+ disables it. An idle native engine can be closed while its receiver remains
34
+ online. Sleeping is not stopped: eligible chat, scheduled or broadcast input
35
+ wakes it and resumes the exact saved history. Busy histories, pending decisions,
36
+ input or receipts and unknown activity prevent sleep.
37
+
38
+ `fleet show` exposes native phase, desired binding intent, last native activity,
39
+ listener activity and history availability separately. `fleet agent contexts`
40
+ reads saved context IDs while sleeping or stopped without waking a process.
41
+ Attachment requires a live native endpoint; GET never launches one. Use Resume
42
+ sessions or `fleet agent start` to wake a sleeping native engine for a terminal
43
+ without changing its binding or sending a model prompt.
44
+
45
+ Orderly daemon shutdown preserves desired activation. Starting the same daemon
46
+ root after a reboot restores active bindings with retained histories; explicitly
47
+ stopped agents remain stopped. No automatic operating-system boot service is
48
+ installed. Preserve the controller root as well as fleet workareas and credentials.
49
+
50
+ ## CLI
51
+
52
+ ```sh
53
+ fleet stop research
54
+ fleet start research
55
+ fleet agent stop research analyst-west
56
+ fleet agent start research analyst-west
57
+ ```
58
+
59
+ Start defaults to full saved native history. No resume flag or transcript replay is
60
+ needed. The runtime retains its full conversation context even though controller
61
+ RPC responses omit old turn payloads. Missing or broken established bindings cause
62
+ a visible failure; they never silently fall back to new history.
63
+
64
+ Only an explicit flag selects fresh history:
65
+
66
+ ```sh
67
+ fleet start research --fresh-history
68
+ fleet agent start research analyst-west --fresh-history
69
+ fleet agent start research analyst-west --fresh-history --operation-id YOUR_UUID
70
+ ```
71
+
72
+ The flag is the CLI's explicit destructive intent. The command prints an operation
73
+ ID; retry uncertain submission with that same ID and identical arguments, not a
74
+ new ID. Fleet-wide and per-agent start and stop commands accept `--operation-id UUID`.
75
+ The controller persists outcomes and pins unacknowledged remote operations
76
+ so reconnects cannot repeat a completed reset. If the controller dies during an
77
+ operation, it reports that interrupted operation as failed rather than guessing
78
+ that it completed or silently performing another reset.
79
+
80
+ ## Boundaries
81
+
82
+ First enrollment authorizes initialization of an agent's primary native history.
83
+ Successful binding consumes that authorization. Explicit fresh history authorizes
84
+ another initialization only after the old context is safely retired. In per-room
85
+ mode, a new room obtains its own history when first used; changing history mode is
86
+ an explicit configuration change, not an ordinary restart fallback.
87
+
88
+ Every Crossfire agent is fleet-owned. The coding session performing setup remains
89
+ independent and is never adopted, stopped or reset. Native history is not a
90
+ guarantee that an unfinished shell process survives a stop.
91
+ This feature does not delete workarea files, Matrix chats or old native archives.
92
+
93
+ A full machine restart and abruptly killing only fleetd are different. A native
94
+ app-server can survive `SIGKILL` of fleetd and retain its history's writer lock.
95
+ The replacement refuses that competing writer, not silently resumes or adopts
96
+ it. Safely stop the verified orphan before ordinary saved-history restoration.
97
+
98
+ Local stop records actual native close through the same current controller/run
99
+ receipt used by management operations. If acknowledgment fails, native processes
100
+ remain stopped and the error stays visible; automatic recovery is not blocked by
101
+ that network failure. Retry stop with a new operation ID after checking the
102
+ reported outcome. Pending proofs retry only while their exact controller
103
+ generation remains valid. After generation turnover, explicitly resume and stop
104
+ the binding to obtain current evidence. Retirement and fleet archive stay refused
105
+ until Crossfire confirms settled receipts and actual native stop.
106
+
107
+ - [History exports, unread positions and reset preparation](https://github.com/control-flow-project/crossfire/blob/main/services/crossfire/docs/history.md)
108
+ - [Configured runtime parameters and history modes](configuration.md)
109
+ - [Controller recovery and private API](https://github.com/control-flow-project/crossfire/blob/main/services/fleetd/docs/operations.md)
package/package.json CHANGED
@@ -1,6 +1,22 @@
1
1
  {
2
2
  "name": "@ctlflow/fleet",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "publishConfig": { "access": "public" },
6
+ "type": "module",
7
+ "devDependencies": { "@ctlflow/crossfire-test-support": "0.1.0" },
8
+ "bin": { "fleet": "./dist/bin/fleet.mjs" },
9
+ "files": ["dist/bin", "docs", "README.md"],
10
+ "exports": { "./executable": "./dist/bin/fleet.mjs", "./package.json": "./package.json" },
11
+ "dependencies": { "@ctlflow/fleetd": "0.1.0" },
12
+ "engines": {
13
+ "node": ">=26.0.0",
14
+ "npm": ">=11.17.0"
15
+ },
16
+ "scripts": {
17
+ "typecheck": "tsc -p tsconfig.json --noEmit",
18
+ "build": "node ../../scripts/build-service.mjs fleet",
19
+ "build:package": "node scripts/build-package.mjs",
20
+ "test": "node ../../scripts/test.mjs fleet all"
21
+ }
22
+ }