@kontourai/station-cli 0.6.0 → 0.7.0-nightly.2465.36865249714

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.
Files changed (3) hide show
  1. package/README.md +97 -81
  2. package/dist/station.mjs +492 -352
  3. package/package.json +9 -9
package/README.md CHANGED
@@ -1,39 +1,40 @@
1
1
  # @kontourai/station-cli
2
2
 
3
- Station is Kontour's local-first agent workspace: you direct agent work, and
4
- the gate verdicts, evidence, and trust state stay in the same context as the
5
- work. A Station is the process that holds all of that — on your laptop, a home
6
- server, or another machine on your tailnet.
3
+ Station is Kontour's local-first agent workspace. It keeps execution history
4
+ and configured workflow evidence beside the work, on your laptop, a home
5
+ server, or another machine you connect to. A completed run is not a passed gate.
7
6
 
8
7
  This package is the **client** CLI for those Stations. It is a terminal front end
9
8
  for Stations that are already running: chat with agents, read and interrupt
10
- sessions, drive projects, tasks, skills, and every other Station
11
- surface, over HTTP. It does not run a Station itself — see
12
- [What this CLI does not do](#what-this-cli-does-not-do).
9
+ sessions, and manage projects, tasks, and skills over HTTP. It also supports
10
+ selected host-local operations against an
11
+ existing installation. Building and installing a backend remain checkout
12
+ operations; see [What this CLI does not do](#what-this-cli-does-not-do).
13
13
 
14
14
  ## Availability
15
15
 
16
- The `npx`/`npm install -g` forms below work once `@kontourai/station-cli` is
17
- live on the npm registry (station#4536; check with `npm view
18
- @kontourai/station-cli`) — until then they 404, and `./station` from a
19
- Station checkout, further down this section, is the way to run the CLI.
16
+ `@kontourai/station-cli` is published on npm. Check the live version and
17
+ available dist-tags before scripting an install:
20
18
 
21
- Run the CLI with `npx`, pinned to the channel dist-tag matching the Station
22
- you are operating — `nightly` for a Station Nightly host, `latest` for a
23
- stable one:
19
+ ```bash
20
+ npm view @kontourai/station-cli version dist-tags
21
+ ```
22
+
23
+ Run the published stable client with `npx`:
24
24
 
25
25
  ```bash
26
26
  npx @kontourai/station-cli@latest --help
27
- npx @kontourai/station-cli@nightly --help
28
27
  ```
29
28
 
30
- `npx` resolves and caches that exact published version per invocation, so the
31
- channel tag is the whole story: no separate install/upgrade step, and no
32
- ambiguity about which build is running. For latency-sensitive or scripted use,
33
- an explicit global install pins one version instead of resolving on every
34
- call: `npm install -g @kontourai/station-cli@<tag>`.
29
+ `npx` resolves and caches the published version per invocation. For
30
+ latency-sensitive or scripted use, an explicit global install pins one version
31
+ instead: `npm install -g @kontourai/station-cli@<version-or-published-tag>`.
32
+ Use a channel tag only after `npm view` reports it.
35
33
 
36
- **Inside a Station checkout**, `./station` runs that tree's own build directly
34
+ The examples below use `station` for a globally installed command. With `npx`,
35
+ keep the `npx @kontourai/station-cli@latest` prefix on subsequent commands too.
36
+
37
+ **Inside a Station checkout**, `./station` runs that tree's TypeScript sources
37
38
  — this is the local-invocation path when the registry isn't the point (working
38
39
  on the CLI itself, or a channel tag you don't want to depend on):
39
40
 
@@ -41,28 +42,33 @@ on the CLI itself, or a channel tag you don't want to depend on):
41
42
  ./station <command> [args]
42
43
  ```
43
44
 
44
- It refuses to run against a stale build rather than silently executing old
45
- code — see [the CLI reference](https://github.com/kontourai/station/blob/main/docs/reference/cli.md#invocation)
46
- for the freshness gate and the three-tier invocation story (`npx` / `./station`
47
- / the `station-dev` global dev shim).
45
+ The separate `station-dev` shim runs the checkout's built CLI bundle and
46
+ checks its source timestamps for obvious staleness. That check is approximate;
47
+ `./station` does not use it. See [the CLI reference](https://github.com/kontourai/station/blob/main/docs/reference/cli.md#invocation)
48
+ for the entry-point and build boundaries.
48
49
 
49
- Every invocation reports where it came from: `station --version` prints the
50
- CLI version, its build channel, and the source revision the artifact was built
51
- from, so a wrong-binary mistake is visible instead of guessed at.
50
+ `station --version` reports the CLI version. Bundles also report their stamped
51
+ build channel and source revision; the source launcher reports
52
+ `development source checkout` without a revision.
52
53
 
53
- ## Sixty seconds to a working setup
54
+ ## Connect to a Station
54
55
 
55
56
  Choose a Station you can reach. Setup saves it on this device, performs pairing
56
57
  when needed, and deliberately selects the default Station.
57
58
 
58
59
  ```bash
59
60
  npx @kontourai/station-cli@latest setup existing box-b https://box-b.tailnet.ts.net --pair
60
- # or use Kontour's hosted Station
61
+ # or select the configured hosted endpoint
61
62
  npx @kontourai/station-cli@latest setup hosted
62
63
  ```
63
64
 
65
+ `setup hosted` pairs with the fixed endpoint `https://station.kontourai.io`.
66
+ That command's existence does not establish service availability or your access
67
+ to it. Use `setup existing` for an endpoint you choose.
68
+
64
69
  The CLI registers a device request and waits. An operator approves it **on the
65
- host** (`station environment access approve <request-id>` there). When they do,
70
+ host** (`station environment access approve <request-id>` there, with the
71
+ existing Station home selected). When they do,
66
72
  the CLI stores the issued bearer credential in the operating-system keyring and
67
73
  saves only its reference with the Station entry. That Station becomes the
68
74
  default only after pairing succeeds.
@@ -110,7 +116,7 @@ $ station stations list
110
116
  * = default Station.
111
117
  ```
112
118
 
113
- Every command that talks to a Station resolves its target in this order:
119
+ Commands using the shared target resolver select a Station in this order:
114
120
 
115
121
  | | Source | Example |
116
122
  |---|---|---|
@@ -140,12 +146,17 @@ sandbox, an ephemeral session, and user config ignored, or Claude in safe plan
140
146
  mode with only Read/Glob/Grep tools, using argv arrays and a run-local prompt
141
147
  file. With both available,
142
148
  select one explicitly. No available agent still
143
- leaves portable artifacts successfully. The bundled CLI does not inspect the
144
- local host filesystem or run the source-only doctor report.
145
- Problem text stays local unless `--search-issues` (or the equivalent TTY
146
- confirmation) explicitly authorizes a fixed, read-only Station issue search.
147
- Successful agent output is bounded and re-redacted into local `diagnosis.md`
148
- and `issue-draft.md`; triage has no GitHub write or repair operation.
149
+ leaves portable artifacts successfully. The bundled triage command does not
150
+ collect local host filesystem diagnostics or run the source-only doctor report.
151
+ `--search-issues` (or the equivalent TTY confirmation) authorizes a fixed,
152
+ read-only Station issue search. Launching an agent separately makes the run files
153
+ available to that agent and its configured model service; use `--context-only`
154
+ to collect without launching one. The first 64 KiB of agent stdout is re-redacted
155
+ into local `diagnosis.md` and `issue-draft.md`, including after an unsuccessful
156
+ exit. Live stdout is forwarded before redaction and stderr is inherited directly.
157
+ Stored-artifact redaction does not protect terminal output. Triage has no GitHub
158
+ write or repair operation; its mode flags are requests to the installed agent,
159
+ not independent proof of that agent's enforcement.
149
160
 
150
161
  The versioned store lives at `$STATION_ROOT/config/profiles.json` (default
151
162
  `~/.station/config/profiles.json`) and is shared with native Desktop. It
@@ -166,57 +177,58 @@ records the canonical invoked directory and selected Station in the
166
177
  owner-controlled shared store; repository files cannot redirect the target.
167
178
  The selection names a saved Station and never embeds an endpoint or credential.
168
179
 
169
- Requests give up after 30 seconds. Override with
180
+ SDK-backed requests give up after 30 seconds. Override with
170
181
  `STATION_REQUEST_TIMEOUT_MS=<ms>`, or `0` to disable the deadline. Streams —
171
- chat and session turns, orchestration and approval event streams, live
172
- monitoring, knowledge reindexing — are deliberately exempt, because they are
173
- open-ended by design.
182
+ orchestration and approval events and live monitoring — have no overall
183
+ deadline. Chat sends a bounded JSON acceptance request, then observes the turn
184
+ on a separate event stream. Knowledge reindexing and migration also opt out of
185
+ the request deadline. The current checkpoint-restore and Operate event-stream
186
+ paths bypass the shared credential client and cannot authenticate to a protected
187
+ Station; see the reference.
174
188
 
175
189
  ## What this CLI does not do
176
190
 
177
- **It does not run a Station.** These verbs act on a Station *repository
178
- checkout* — building the app, starting or upgrading it, installing OS
179
- services, putting the launcher on PATH:
180
-
181
- `build` · `doctor` · `fresh` · `link` · `service` · `shortcut` · `start` ·
182
- `upgrade`
183
-
184
- They are not part of the published CLI. Run them from the root of a Station
185
- checkout with its own launcher, which is where they have always lived:
191
+ **It does not build or install a backend.** Source-oriented commands such as
192
+ `build`, `dev`, `fresh`, `home`, `link`, `shortcut`, `start`, `stop`, and
193
+ `upgrade`, plus `setup local` and service installation, require a Station
194
+ repository checkout, not this published CLI. (A prebuilt server archive that
195
+ `install.sh` installed carries its own lifecycle CLI, which can also install a
196
+ service and run `upgrade`; see the reference.) Use the checkout's launcher:
186
197
 
187
198
  ```console
188
199
  $ station start
189
200
  Error: `station start` runs against a Station repository checkout, so it is not part of the published CLI.
190
201
  Run it from the root of a Station checkout with the bundled launcher:
191
202
  ./station start
192
- The published CLI drives Stations that are already running — see `station stations`, `station setup hosted`, and `--api-base`.
203
+ The published CLI drives Stations that are already running — see `station stations` and `--api-base`.
193
204
  ```
194
205
 
195
- **Some `environment` verbs are host-local.** Identity, credential, and
196
- device-approval commands read secrets that only exist on the machine running
197
- the Station, so they answer from the host's own `./station` and nowhere else:
198
- `environment show`, `environment credential`, `environment reset`, and
199
- `environment offer`, and `environment access list|approve|deny`.
200
-
201
- ```console
202
- $ station environment show
203
- Error: Environment security commands require the Station repository launcher (./station).
204
- ```
206
+ **Selected local operations are available in the published CLI.** `open`,
207
+ `doctor`, `environment show`, `environment credential show`, `environment offer`,
208
+ `environment access list|approve|deny|devices|scope`, and `service status|start|stop` support
209
+ an existing local installation. Local authorization validates the selected
210
+ owner-only home and the loopback listener; it does not create a missing home.
211
+ Service start/stop controls an existing OS service rather than building or
212
+ installing a backend. See the [availability table](../../docs/reference/cli.md)
213
+ for the full boundary and prerequisites.
205
214
 
206
- `station environment access request` is the exception, and the one you want
207
- here: it is the *requester* side of pairing, and it is a pure client.
215
+ `environment peers`, `environment credential rotate`, and `environment reset`
216
+ remain checkout-only. `station environment access request` is the requester
217
+ side of pairing and works as a remote client operation.
208
218
 
209
- The packaged CLI never starts, stops, builds, installs, or otherwise manages a
210
- Station backend implicitly. A bare invocation (including `--inline`,
219
+ The packaged CLI never creates or starts a backend implicitly. A bare invocation (including `--inline`,
211
220
  `--service`, and `--temp-home`) explains how to pair with an existing host or
212
- how to use `./station` from a checkout. Host-side pairing offers and approvals
213
- remain in that host's UI/checkout; the packaged client only requests access.
221
+ how to use `./station` from a checkout. The command admission authority is
222
+ [distribution.ts](src/distribution.ts); command behavior is composed in
223
+ [cli.ts](src/cli.ts). This distribution distinction also appears in the
224
+ [architecture reading path](../../docs/architecture.md#reading-path).
214
225
 
215
226
  `station --version` reports immutable bundle metadata: the CLI version, its
216
227
  build channel, and the source revision stamped when that artifact was built.
217
- It does not inspect a nearby checkout or a backend build manifest. Local source
218
- builds report the `development` channel (and a dirty revision when applicable),
219
- independent of `STATION_CHANNEL`.
228
+ It does not inspect a nearby checkout or a backend build manifest. Invoking
229
+ `./station --version` reports `development source checkout`, independent of
230
+ `STATION_CHANNEL`; it does not print a source SHA. A locally built bundle has
231
+ its own build-time provenance, including a dirty revision when applicable.
220
232
 
221
233
  The package test packs one exact tarball, records its SHA-256, then installs
222
234
  that same tarball into an isolated consumer with `npm install --ignore-scripts`.
@@ -224,17 +236,19 @@ This proves dependency resolution without claiming publication or
224
236
  native-keyring behavior. Windows and physical native-keyring verification are
225
237
  **NOT_VERIFIED** until exercised on those platforms.
226
238
 
227
- `station --help` prints the same boundary in its closing note, so the printed
228
- command list never claims a verb this CLI cannot run.
239
+ `station --help` includes a checkout-command note. That note currently lists
240
+ `service` as a whole; the supported packaged exceptions are
241
+ `service status|start|stop`, as described above.
229
242
 
230
243
  ## Requirements
231
244
 
232
245
  - **Node 24** (`engines: 24.x`). The CLI is a bundle, not a binary; it needs a
233
246
  host Node.
234
- - **A reachable Station.** Everything this CLI does, apart from managing
235
- its own saved Stations and config, is an HTTP call to a Station server. With no
236
- Station saved, commands use a running local desktop Station when available,
237
- then fall back to the selected channel's runtime-resolver loopback origin.
247
+ - **A reachable Station for API commands.** With no Station saved, API commands
248
+ use a running local desktop Station when available, then fall back to the
249
+ selected channel's runtime-resolver loopback origin. Saved-Station management,
250
+ local diagnostics, and existing-service control also use host-local storage
251
+ or operating-system services; they are not all HTTP calls.
238
252
 
239
253
  Transport failures name the Station that was targeted *and where that address
240
254
  came from*, so a wrong-target mistake never looks like a broken Station:
@@ -253,11 +267,13 @@ station --version
253
267
  ```
254
268
 
255
269
  `--help` is recognised at any depth, and per-command help carries the flag
256
- detail. Unknown input is always a failure, never a help request: the CLI exits
257
- non-zero and names the nearest real command or action.
270
+ detail. Unknown commands and actions fail with a diagnostic. Flag validation
271
+ belongs to each command; use the documented spelling, including
272
+ `--model-option=key=value` rather than a space-separated value.
258
273
 
259
- The full prose reference — every verb, every flag, and the complete tier
260
- table — ships with the Station repository as `docs/reference/cli.md`.
274
+ The prose reference and availability table ship with the Station repository as
275
+ `docs/reference/cli.md`. Its implementation links and stated limits distinguish
276
+ current behavior from commands that need further qualification.
261
277
 
262
278
  ## Related packages
263
279