@remits/remits-cli 0.1.124 → 0.1.126

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
@@ -64,6 +64,9 @@ remits-cli install --skills --overwrite true
64
64
 
65
65
  ## How It Works
66
66
 
67
+ - `cli/index.js` opens with a line-numbered code Table of Contents. Section entries are generated from
68
+ the `##` section marker comments in the file. Run `npm run prepare:index-toc` after moving sections;
69
+ `npm test` checks that the prepared line numbers still point at the real headings.
67
70
  - `components stage` has three modes, and the difference decides what a run in the lane resolves:
68
71
  - **default (full snapshot)** — uploads the whole repository manifest and reconciles the lane to it, so stale aliases from prior stages are removed. Correct as a complete snapshot and as a "what is stale here?" reset; a poor progress signal, because the lane then holds every component in the repo.
69
72
  - **`--workset`** — uploads only the components git reports changed and reconciles the lane to exactly those. The normal iteration mode. `--changed-only --replace-lane` is the explicit spelling.
@@ -89,7 +92,7 @@ remits-cli install --skills --overwrite true
89
92
  - `remits-cli start` scans the machine for `account-info.json` files and rebuilds `~/.remits-cli/account-repos.json` before bringing up the background service.
90
93
  - Front-stage guides are **not** bundled with the CLI npm package. For account-work commands (`components`, `test`, `token`, `tools`, `tool`) and on `auth`, `remits-cli` downloads the latest guides from the authenticated `/cli/guides` endpoint and writes them into the current account repo: root `platform-overview.md` / `development-guide.md`, `guides/*.md`, `guides/features/*.md`, and the agent-guidance files `CLAUDE.md` / `AGENTS.md` / `GEMINI.md` (from `docs/front-stage/remits-components-zip-readme.md`).
91
94
  - Guide sync requires authentication. If no valid session exists and the terminal is interactive, the CLI auto-authenticates first; in non-interactive contexts (CI, agent sandboxes) it skips silently so guides are only ever delivered to users who can authenticate to the platform.
92
- - During account-repo discovery, `remits-cli` also overwrites the installed remits-cli `SKILL.md` for `claude`, `codex`, and `gemini` so local agents stay on the latest packaged instructions.
95
+ - On every command, `remits-cli` refreshes the installed remits-cli `SKILL.md` and reference files for `claude`, `codex`, and `gemini` so local agents stay on the latest packaged instructions.
93
96
  - The platform repo's `docs/front-stage/` tree remains the single source of truth; the platform serves it from the classpath, so published CLI versions never carry guide content.
94
97
  - Authenticated users also get the **core Remits platform repo** locally. After guide sync (and on `auth` / discovery), `remits-cli` first reuses any existing local copy it already knows about, can detect directly (`REMITS_PLATFORM_DIR`, the running CLI source in dev, `~/remits`), or can discover under the configured scan roots; only if none is found does it clone `git@github.com:tmillhouse/remits.git` (default `~/remits`, override with `REMITS_PLATFORM_DIR`; cloning only runs in an interactive terminal). On each authenticated run it also fast-forwards the repo (`git pull --ff-only`, once per process) so back-stage analysis runs against current code — skipped automatically if the working tree is dirty, so local work is never clobbered. The repo is tracked in `~/.remits-cli/account-repos.json` under the reserved `platform` entry so agents can analyze back-stage seams and open a fix PR when a front-stage failure turns out to be platform brittleness.
95
98
  - Branch defaults to the current local git branch.
@@ -106,7 +109,7 @@ remits-cli install --skills --overwrite true
106
109
  - `--variant-branch <name|none>` is available on `test run`, `token`, `tools`, and `tool`. Use it to probe a committed branch variant from any checkout; omit it to resolve the execution account's normal subscription, or pass `none`/`trunk` to force subscription semantics from a variant checkout.
107
110
  - On `test run`, `--branch <name>` is only the Redis staging namespace. Pair an unused value with `--variant-branch none` when existing staged entries on the real git branch would shadow committed trunk/variant rows. Do not apply that shortcut to `components sync` or `components commit`, where `--branch` names the GitHub branch to reconcile.
108
111
 
109
- ## Service, Dashboard, WebSocket, and Tmux Lifecycle
112
+ ## Service, Dashboard, and WebSocket Lifecycle
110
113
 
111
114
  - The primary lifecycle commands are `remits-cli start`, `remits-cli stop`, and `remits-cli status`.
112
115
  - `remits-cli listen`, `remits-cli listen stop`, and `remits-cli listen status` still work as compatibility aliases.
@@ -116,16 +119,14 @@ remits-cli install --skills --overwrite true
116
119
  - `remits-cli status` reports whether the background service is alive, prints the dashboard URL when available, and prints the resolved session tuple: Account ID, User ID, current git branch, and active data mode.
117
120
  - `remits-cli whoami` prints only the resolved session tuple. Use `--base-url`, `--account-id`, and `--data-mode` to prove the exact host/account/lane before running a tool or test.
118
121
  - Both print **two** data modes. "Data mode" governs `tool` / `tools` / `token` and falls back to the stored session lane; "Data mode (test run)" governs `test run`, which ignores the session and defaults to `test` unless `--data-mode prod` is passed. The test-run line also reports its source, such as `cliDefault` or `explicitFlag`.
119
- - `remits-cli stop` stops the background service, kills the shared tmux session, and clears pane tracking state.
122
+ - `remits-cli stop` stops the background service.
120
123
  - The service starts a localhost dashboard that acts as a control center for remits-cli integration state.
121
- - The dashboard shows websocket connection health, topic subscriptions, tmux session/panes, the discovered account repo index, global state files, and per-repo remits-cli files.
122
- - If websocket connections are disconnected or the tmux session is missing, the dashboard exposes actions to reconnect websockets or recreate the tmux session.
124
+ - The dashboard shows websocket connection health, topic subscriptions, registered agents, live and recent worker runs, the discovered account repo index, global state files, and per-repo remits-cli files.
125
+ - If websocket connections are disconnected, the dashboard exposes an action to reconnect them.
123
126
  - The service groups sessions by `baseUrl` so one websocket connection can service multiple authenticated accounts on the same Remits environment.
124
127
  - Websocket subscriptions are deduplicated by user topic. If multiple authenticated accounts share the same websocket topic, the listener subscribes once and maps that topic back to all related accounts.
125
- - The daemon keeps STOMP heartbeats enabled and runs a maintenance watchdog that recreates unhealthy websocket connections and recreates the shared tmux session if it disappears.
128
+ - The daemon keeps STOMP heartbeats enabled and runs a maintenance watchdog that recreates unhealthy websocket connections.
126
129
  - If the machine sleeps, the network drops, or auth sessions change while the daemon is already running, the service now attempts to reconnect and resubscribe automatically once connectivity returns.
127
- - Incoming websocket messages of type `remits-cli` are dispatched into dedicated tmux windows so the selected agent can continue working interactively with a full terminal view.
128
- - The listener creates a shared tmux session named `remits-listener`.
129
130
  - Support tickets are the primary unit of dispatched work. A serving agent launches one fresh worker process per routed ticket.
130
131
  - Agent sessions register themselves with `remits-cli agent register` or `remits-cli agent serve`; `serve` also starts the local supervisor.
131
132
  - Tickets are delivered by durable routing on the ticket record, then the agent asks for routed work with `remits-cli agent work`.
@@ -179,12 +180,14 @@ There are two separate state areas:
179
180
  PID for the background remits-cli service process.
180
181
  - `~/.remits-cli/service-state.json`
181
182
  Dashboard URL, repo scan summary, and websocket state snapshot for the running service.
182
- - `~/.remits-cli/dispatch-panes.json`
183
- Persistent map of support ticket routing key to the active tmux pane id for that ticket's dedicated window. `ticketId` is preferred, with legacy `taskId` fallback.
184
183
  - `~/.remits-cli/account-repos.json`
185
184
  Index of known account repositories on this machine, rebuilt by `remits-cli start` via account-info discovery and also refreshed when commands run inside an account repo.
186
- - `~/.remits-cli/tmux-activity.log`
187
- Human-readable global activity log for listener and tmux lifecycle events.
185
+ - `~/.remits-cli/agents.json`
186
+ Agent sessions registered from this machine, including the process each one is anchored to.
187
+ - `~/.remits-cli/workers.json`
188
+ Active and recent ticket worker state for serving agents.
189
+ - `~/.remits-cli/activity.log`
190
+ Human-readable global activity log for service lifecycle, websocket events, agent registration, and ticket routing.
188
191
 
189
192
  ## Control Center
190
193
 
@@ -192,21 +195,20 @@ There are two separate state areas:
192
195
  - Open that page in a browser to inspect the full local remits-cli integration state without manually opening JSON files.
193
196
  - The page refreshes automatically and includes the latest global state files plus per-repo `account-info.json`, local tools snapshot, and current session log tail for every indexed account repo. Large account configuration fields live in `account-configurations.json` and should be opened only when needed.
194
197
 
195
- ## Tmux Activity Log
198
+ ## Activity Log
196
199
 
197
- - `~/.remits-cli/tmux-activity.log` is the quickest way to understand what the listener is doing.
198
- - It records timestamped lifecycle events such as listener start/stop, websocket connect/disconnect, topic subscription, dispatch receipt, pane creation, follow-up delivery, pane replacement, and dispatch failures.
199
- - Prompt bodies are not written verbatim to this log. The log stores summarized metadata such as `accountId`, `ticketId`, any legacy `taskId`, available keys, and prompt length.
200
+ - `~/.remits-cli/activity.log` is the quickest way to understand what the service, websocket clients, and local agents are doing.
201
+ - It records timestamped lifecycle events such as service start/stop, websocket connect/disconnect, topic subscription, agent registration/heartbeat, ticket routing, worker launch, and worker completion.
202
+ - Prompt bodies are not written verbatim to this log. The log stores summarized metadata such as `accountId`, `ticketId`, available keys, and prompt length.
200
203
  - Typical inspection commands:
201
204
 
202
205
  ```bash
203
- tail -f ~/.remits-cli/tmux-activity.log
204
- tail -n 200 ~/.remits-cli/tmux-activity.log
206
+ tail -f ~/.remits-cli/activity.log
207
+ tail -n 200 ~/.remits-cli/activity.log
205
208
  ```
206
209
 
207
210
  ## Operational Notes
208
211
 
209
- - `tmux` must be installed for agent dispatch to work. Without it, websocket dispatch is received but agent panes cannot be created.
210
212
  - In sandboxed local agent environments, `remits-cli` network calls may fail with `ENOTFOUND`, `EAI_AGAIN`, `ECONNREFUSED`, `EPERM`, or similar errors even when dispatch worked correctly. That means the command needs escalated permissions or must be run outside the sandbox.
211
213
  - If the platform returns a 500 or other unexpected server-side failure, stop normal task execution and escalate to a Remits system admin. Agents should not invent workarounds for platform faults.
212
214
  - Recommended durable update flow for agents: `components stage --workset` for testing, then `git add/commit/push`, then `remits-cli components sync --safe`, then `git pull --ff-only` to confirm platform-generated files like `account-info.json`. To verify the COMMITTED variant rather than your staging, run `components clear --all` first — staged entries still win for CLI-scoped runs.