@dotobokuri/fleet-console 1.8.0 → 1.9.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.
Files changed (65) hide show
  1. package/AGENTS.md +6 -4
  2. package/dist/cli-bin.mjs +1824 -599
  3. package/dist/cli.d.ts +4 -0
  4. package/dist/cli.mjs +1824 -599
  5. package/dist/client/assets/{_baseUniq-BvJBBAyx.js → _baseUniq-_nKBty4x.js} +1 -1
  6. package/dist/client/assets/{arc-_In9IKSA.js → arc-DEjqUlkY.js} +1 -1
  7. package/dist/client/assets/{architectureDiagram-Q4EWVU46-Ch4p9PP9.js → architectureDiagram-Q4EWVU46-CPF3RLab.js} +1 -1
  8. package/dist/client/assets/{blockDiagram-DXYQGD6D-dV3nM6N6.js → blockDiagram-DXYQGD6D-DguupB0e.js} +1 -1
  9. package/dist/client/assets/{c4Diagram-AHTNJAMY-Cd4rkDvb.js → c4Diagram-AHTNJAMY-Dd7AVc09.js} +1 -1
  10. package/dist/client/assets/channel-DA6xE92d.js +1 -0
  11. package/dist/client/assets/{chunk-4BX2VUAB-BdFP7-t8.js → chunk-4BX2VUAB-CSIihHG7.js} +1 -1
  12. package/dist/client/assets/{chunk-4TB4RGXK-CwZmzqqH.js → chunk-4TB4RGXK-DR_cPI3H.js} +1 -1
  13. package/dist/client/assets/{chunk-55IACEB6-jonfKM4s.js → chunk-55IACEB6-97czQ3iV.js} +1 -1
  14. package/dist/client/assets/{chunk-EDXVE4YY-Di2ByMxa.js → chunk-EDXVE4YY-piQCPtjQ.js} +1 -1
  15. package/dist/client/assets/{chunk-FMBD7UC4-DXLnCQWV.js → chunk-FMBD7UC4-BIeV9l0L.js} +1 -1
  16. package/dist/client/assets/{chunk-OYMX7WX6-DpgtrxyA.js → chunk-OYMX7WX6-DWUJBKm_.js} +1 -1
  17. package/dist/client/assets/{chunk-QZHKN3VN-BdkOO2d4.js → chunk-QZHKN3VN-DHL5fPU4.js} +1 -1
  18. package/dist/client/assets/{chunk-YZCP3GAM-Hfgm6DyM.js → chunk-YZCP3GAM-Dk19Wldz.js} +1 -1
  19. package/dist/client/assets/classDiagram-6PBFFD2Q-D46R_D_e.js +1 -0
  20. package/dist/client/assets/classDiagram-v2-HSJHXN6E-D46R_D_e.js +1 -0
  21. package/dist/client/assets/clone-DV233GSJ.js +1 -0
  22. package/dist/client/assets/{cose-bilkent-S5V4N54A-DqClnVsA.js → cose-bilkent-S5V4N54A-CcROwyfn.js} +1 -1
  23. package/dist/client/assets/{dagre-KV5264BT-DlVHx9hg.js → dagre-KV5264BT-kdHN8OcZ.js} +1 -1
  24. package/dist/client/assets/{diagram-5BDNPKRD-DJVcbz8w.js → diagram-5BDNPKRD-yqi72mWd.js} +1 -1
  25. package/dist/client/assets/{diagram-G4DWMVQ6-ZCER6PqU.js → diagram-G4DWMVQ6-CTjHbP--.js} +1 -1
  26. package/dist/client/assets/{diagram-MMDJMWI5-DFt5a-B8.js → diagram-MMDJMWI5-BCGN9v8i.js} +1 -1
  27. package/dist/client/assets/{diagram-TYMM5635-DXPsYs4b.js → diagram-TYMM5635-p6gtwFXr.js} +1 -1
  28. package/dist/client/assets/{erDiagram-SMLLAGMA-BEiMZzzV.js → erDiagram-SMLLAGMA-BHNCT04F.js} +1 -1
  29. package/dist/client/assets/{flowDiagram-DWJPFMVM-DTBFF-X2.js → flowDiagram-DWJPFMVM-DP-E6Gb1.js} +1 -1
  30. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-nE9kklkz.js → ganttDiagram-T4ZO3ILL-COKcadl7.js} +1 -1
  31. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-VD6J4jc_.js → gitGraphDiagram-UUTBAWPF-CVkte06j.js} +1 -1
  32. package/dist/client/assets/{graph-CuZGH1eI.js → graph-BljmCiGu.js} +1 -1
  33. package/dist/client/assets/index-B7IECSX7.css +1 -0
  34. package/dist/client/assets/index-CSTdaEyG.js +777 -0
  35. package/dist/client/assets/{infoDiagram-42DDH7IO-BdxLeDgE.js → infoDiagram-42DDH7IO-Dh_U82lE.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-OG_S8qjo.js → ishikawaDiagram-UXIWVN3A-BtZhb0mv.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-VCZTEJTY-CvZPwJCs.js → journeyDiagram-VCZTEJTY-_Zd4No67.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-6JOO6SKY-4hgVjEGs.js → kanban-definition-6JOO6SKY-CpIIMkPJ.js} +1 -1
  39. package/dist/client/assets/{layout-BHDLAxp5.js → layout-ButG21vs.js} +1 -1
  40. package/dist/client/assets/{linear-WT8NWS1o.js → linear-C-frnGuN.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-UWKHwZrH.js → mermaid.core-ISlBhdkY.js} +4 -4
  42. package/dist/client/assets/{min-CkGW0p-k.js → min-CalB2Q9y.js} +1 -1
  43. package/dist/client/assets/{mindmap-definition-QFDTVHPH-BxjJxQqR.js → mindmap-definition-QFDTVHPH-BfilPIUD.js} +1 -1
  44. package/dist/client/assets/{pieDiagram-DEJITSTG-BTjPSbyX.js → pieDiagram-DEJITSTG-Dm_1WIPT.js} +1 -1
  45. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-D2fCxzGw.js → quadrantDiagram-34T5L4WZ-DMzRgLeF.js} +1 -1
  46. package/dist/client/assets/{requirementDiagram-MS252O5E-CtElLmk8.js → requirementDiagram-MS252O5E-Bl1lUR6U.js} +1 -1
  47. package/dist/client/assets/{sankeyDiagram-XADWPNL6-DGqMKAC2.js → sankeyDiagram-XADWPNL6-VxDrFumf.js} +1 -1
  48. package/dist/client/assets/{sequenceDiagram-FGHM5R23-B8Yva4cR.js → sequenceDiagram-FGHM5R23-BoB_k7L2.js} +1 -1
  49. package/dist/client/assets/{stateDiagram-FHFEXIEX-BxBGow-_.js → stateDiagram-FHFEXIEX-C8DFihD3.js} +1 -1
  50. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DlDadEC7.js +1 -0
  51. package/dist/client/assets/{timeline-definition-GMOUNBTQ-CUcV7Qpm.js → timeline-definition-GMOUNBTQ-G5hn4rEl.js} +1 -1
  52. package/dist/client/assets/{vennDiagram-DHZGUBPP-DS0hFmpX.js → vennDiagram-DHZGUBPP-D_jMNDmm.js} +1 -1
  53. package/dist/client/assets/{wardley-RL74JXVD-Dhd3kp0H.js → wardley-RL74JXVD-Clc5Li47.js} +1 -1
  54. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-B6QDK0rE.js → wardleyDiagram-NUSXRM2D-Bygn2On7.js} +1 -1
  55. package/dist/client/assets/{xychartDiagram-5P7HB3ND-tiuCrAL_.js → xychartDiagram-5P7HB3ND-arK3uijt.js} +1 -1
  56. package/dist/client/index.html +2 -2
  57. package/package.json +1 -1
  58. package/postinstall.mjs +29 -0
  59. package/dist/client/assets/channel-F-hXrSqZ.js +0 -1
  60. package/dist/client/assets/classDiagram-6PBFFD2Q-DqXQgyK4.js +0 -1
  61. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DqXQgyK4.js +0 -1
  62. package/dist/client/assets/clone-kL599Cyi.js +0 -1
  63. package/dist/client/assets/index-ClU0e8Rv.js +0 -734
  64. package/dist/client/assets/index-VeebE_4d.css +0 -1
  65. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-COhEt-rs.js +0 -1
package/AGENTS.md CHANGED
@@ -8,19 +8,21 @@
8
8
  - The server lifecycle: lock file, runtime paths, health probe, and build-stale detection are console-owned. `fleet-console` is the daemon, not a launcher over someone else's daemon.
9
9
  - The `fleet-console` CLI entry point (`./cli` export, `dist/cli.mjs`): `start` (the default when no subcommand is given) ensures the local console server and opens the console URL in a browser; if a healthy daemon already exists, it opens that daemon's URL without starting a new server or erroring. `stop` stops the console server; `restart` stops the console server then starts a fresh one and opens it; `status` prints server health, endpoint, console URL, and registered-workspace count. The server binds to an OS-assigned random loopback port and records the actual port in the lock file, so consumers discover the port from the lock endpoint. `--help`/`-h` prints the banner-style help. `fleet console <args>` in `fleet-cli` relays the full argument list to this CLI as a child process, so every subcommand works through both `fleet console …` and the standalone `fleet-console …` binary. The root `pnpm fleet-console` script runs it from source via `tsx`; unpublished local runs isolate runtime files under the project workspace `.fleet/console` unless `FLEET_CONSOLE_DIR` is set, while published stable builds continue using the OS temp directory.
10
10
  - Console-owned terminal sessions are spawned server-side and observed in-process; carrier events flow directly into the observer store and browser SSE without a separate fleet-cli registration channel.
11
- - Console durable state is persisted in `~/.fleet/console/state.json` (`createDurableJsonStore`, `sensitivity: "sensitive"`). The console server is the sole writer; the file stores `{ version: 1, theaters, operations }`. On startup the server restores Theaters and Operations into a dormant state (no PTY), and Operation state survives console restarts.
12
- - A capture inbound channel writes `~/.fleet/console/captures/{fleetSessionId}.json`. Provider CLI SessionStart hooks record provider session ids via `fleet-console hook capture-session <provider>`; the server reads the capture file, merges the provider session id into durable state, and cleans up the capture file. This is separate from the console lock file in `os.tmpdir()`.
11
+ - Console durable state is persisted in the console data directory's `state.json` (`createDurableJsonStore`, `sensitivity: "sensitive"`). The data directory follows the release channel: published stable builds use `~/.fleet/console/state.json`, while unpublished local runs (`pnpm fleet-console`/`tsx`) use the project workspace `.fleet/console/state.json` co-located with the lock, so a dev console never shares Theaters/Operations with a globally installed one. Setting `FLEET_CONSOLE_DIR` relocates the durable state (and captures) into that directory too — co-located with the lock, matching the runtime-file escape hatch — so a read-only checkout can point its writable runtime slot away from the project tree. The console server is the sole writer; the file stores `{ version: 1, theaters, operations }`. On startup the server restores Theaters and Operations into a dormant state (no PTY), and Operation state survives console restarts. Each Operation also records whether its label came from the operator or from automatic naming (`labelSource`), so the prompt-derived auto-name never overwrites a manual rename.
12
+ - A capture inbound channel writes `{fleetSessionId}.json` under the same console data directory's `captures/` (`~/.fleet/console/captures/` for stable, the project `.fleet/console/captures/` for local runs). Provider CLI SessionStart hooks record provider session ids via `fleet-console hook capture-session <provider>`; the server reads the capture file, merges the provider session id into durable state, and cleans up the capture file. This is separate from the console lock file in `os.tmpdir()` (stable) / the project `.fleet/console` lock (local).
13
13
  - The React SPA served from the console backend at `/console/`: layout, components, styles, and visual identity. The global navigation bar owns **Theater** selection — a project root directory that groups console-owned terminal sessions and Codex wiki context. The Operations sidebar (under the Operation nav tab) lists terminal sessions filtered to the active Theater and provides a launch control that asks the operator to choose an Agent CLI before starting a new terminal session; each session lists its carrier job history (active and finished) in registration order, and selecting a job opens a centered streaming overlay over that session's terminal, scoped to the active session's jobs. A console-wide Operation quick-search (Cmd/Ctrl+K) searches terminal sessions across all Theaters, switches to the selected Operation's Theater, selects that Operation, and navigates to `/operations`; on `/codex` paths the same shortcut yields to Codex's own search.
14
14
  - The Codex/Fleet Wiki web surface under `/console/codex`: the console-owned Codex server gateway, workspace registry, wiki API routes, migrated vanilla TypeScript Maritime Codex client, `fleet wiki` compatibility helpers, and standalone `fleet-wiki` binary shim. The console-level **TheaterRegistry** is the source of truth for project roots and does not require a Fleet Wiki knowledge root; the Codex `WorkspaceRegistry` is the subset of Theaters whose directories contain a Fleet Wiki knowledge root. Codex must remain mounted under the Fleet Console GNB without an iframe or proxy daemon.
15
15
  - The observer-side client contract: REST snapshot fetches and the SSE consumption loop with reconnect/resync.
16
16
  - The streaming view model: the event reducer that folds `CarrierJobStreamEvent` timelines into per-job, per-track views with incremental text accumulation.
17
+ - Console self-update (`POST /update/apply`): the console backend owns an independent detached self-update worker that re-installs the globally published `fleet-cli` and `fleet-console` packages, writes a status file and a log file under the console data directory, and blocks the request while any active terminal session is live. The route enforces exact loopback Origin, rejects local/unpublished builds, re-checks the latest release before accepting, and returns `202 { status: "accepted" }` only after the worker has been spawned and detached. The worker shuts down the console server and re-opens a browser on the new server at a fresh OS-assigned random loopback port once the install completes; the old tab is intentionally not preserved. Console must never import or depend on `@dotobokuri/fleet-cli` for this flow.
17
18
 
18
19
  ## Codex / Fleet Wiki Surface
19
20
 
20
21
  - Canonical Codex workspace routes live under `/console/codex/w/:ws/...`; MRU-compatible API routes live under `/console/codex/api/...`. Do not reintroduce global `/api/...` wiki routes because console owns its own local API namespace.
21
22
  - The console-level **Theater** is the parent concept for project roots. Codex workspaces share the same id space (`workspaceHash(realpath(dir))`) but are a strict subset of the Theater registry (`hasWiki=true`). The Codex left workspace switcher is removed; Theater selection in the global navigation bar is the only workspace switch, and Theaters without a Fleet Wiki knowledge root render a "Codex 없음" state instead of mounting a wiki surface.
22
23
  - The migrated Codex client stays Vanilla TypeScript under `client/src/codex/**`; do not rewrite it into React state or components beyond the React mount host.
23
- - Codex has two presentation modes — **Full** (the dedicated `/console/codex` route) and **Side** (a right-docked overlay panel over the current route). A single shared mount host (`codex-host.ts`) is relocated between containers with `appendChild` and is never mounted twice — the Vanilla client is a module-level singleton, so exactly one Codex instance is ever live and switching modes must not `destroy()`+remount. In every mode the URL stays `/console/codex/...`; Side keeps the previously active route mounted as a background via the react-router `<Routes location=…>` pattern, and a direct deep-link or refresh onto `/codex` always renders Full. The view mode is a **global-navigation-bar-only** toggle persisted at `fleet-console.codex.view-mode` (`route`|`side`); the Side panel width persists at `fleet-console.codex.side-width` with no fixed min/max (viewport-bounded only), and the Codex layout is container-responsive — it sheds the rail, then the nav, as the panel narrows, leaving only the reading content.
24
+ - Codex has two presentation modes — **Full** (the dedicated `/console/codex` route) and **Side** (a right-docked overlay panel over the current route). A single shared mount host (`codex-host.ts`) is relocated between containers with `appendChild` and is never mounted twice — the Vanilla client is a module-level singleton, so exactly one Codex instance is ever live and switching modes must not `destroy()`+remount. In every mode the URL stays `/console/codex/...`; Side keeps the previously active route mounted as a background via the react-router `<Routes location=…>` pattern, and a direct deep-link or refresh onto `/codex` always renders Full. The view mode persists at `fleet-console.codex.view-mode` (`route`|`side`) and is switchable both from the global navigation bar (on the Codex route) and, while Side is closed, from a right-edge handle shown on any non-Codex route that opens Side directly (navigates to `/codex` and switches to `side`); the Side panel width persists at `fleet-console.codex.side-width` with no fixed min/max (viewport-bounded only), and the Codex layout is container-responsive — it sheds the rail, then the nav, as the panel narrows, leaving only the reading content. While Side is open, the ⌘K command palette is scoped to the Side panel region instead of rendering full-screen (driven by a `data-codex-side` body marker plus the `--codex-side-width` body variable), and the panel header carries manual collapse toggles for the left (Nav) and right (ToC/Manifest) panes — persisted at `fleet-console.codex.nav-collapsed`/`fleet-console.codex.rail-collapsed` and applied via `app-shell--nav-collapsed`/`app-shell--rail-collapsed` grid classes, independent of the container-query auto-collapse. The pane-collapse state is owned by the Vanilla Codex module and exposed to the React surface only through the `codex-host.ts` boundary.
25
+ - The Codex reading surface uses a single `app-shell` grid for every route. The reading measure (78ch at 17px / 1.78) is owned by `.markdown-body` and its reading-wrapper siblings (`.document-header`, `.related-list`) — never the shell grid; the shell max-width is 1680px and the rail track is `clamp(272px, 20vw, 320px)`. Shell modifiers are limited to `app-shell--wide` (browse routes home/index-md/log/conflicts/queue — rail removed), `app-shell--raw` (raw source — rail removed, full-width body, sidebar kept; the old `renderRawShell()` is gone), and the Side-only `app-shell--nav-collapsed`/`app-shell--rail-collapsed`. Modifiers only set grid columns/areas (single-class or `:where()` specificity) so the 900px/560px container queries still win by cascade, and queue-detail keeps its own internal `1fr + 300px` layout. The reading rail renders the ToC before the Manifest (the Manifest is an open-by-default `<details>`), the ToC has an `IntersectionObserver` scroll-spy that cleans up on every route change, and below 760px the rail is replaced by a document-level ToC drawer (a focus-trapped `role="dialog"`). Reading entries carry a breadcrumb and drop a duplicate title only when the first markdown H1 exactly normalizes to the entry title. Codex typography is tokenized through `--font-size-*`; brass = active/location and aurora = live/link semantics, glass surfaces, self-hosted Fraunces/Manrope/JetBrains Mono, and `prefers-reduced-motion` short-circuits are unchanged.
24
26
  - Preserve Maritime Codex UX: reading flow, raw viewer, Drydock queue, conflicts, index/log views, command palette, Manifest/ToC rails, copy-context actions, diagram lightbox, brass/aurora roles, and self-hosted fonts.
25
27
  - Preserve wiki security invariants: Host allowlist, Origin guard, write-surface loopback gate, DOMPurify markdown sanitization, Mermaid `securityLevel: "strict"` with `htmlLabels: false` and no `bindFunctions`, path containment, and lockfile bearer auth for admin workspace registration.
26
28
  - Browser payloads must not expose MCP/session tokens, terminal tickets, or Codex admin tokens.
@@ -54,7 +56,7 @@
54
56
 
55
57
  ## Layout
56
58
 
57
- - `src/` — Node-side backend and CLI lifecycle: the HTTP server (`server.ts`), security headers, static serving (`static-console.ts`), observer routes (including `/observer/theaters*` Theater registry, session launch, and `DELETE /observer/theaters/:theaterId` for Theater plus cascading Operation/capture removal), the SSE helper, `codex/` (Fleet Wiki/Codex API gateway and workspace registration), `theaters.ts` (console-level in-memory TheaterRegistry backed by durable state), `theater.ts` (Theater id hash, realpath canonicalization, and label helpers), `terminal/` (PTY ticket/session/ws transport, `POST /terminal/sessions/:sessionId/resume` for lazy on-open resume of dormant Operations, and `DELETE /terminal/sessions/:sessionId` which kills a live session and removes it or simply removes a dormant session, persisting the change in all cases; console terminal sessions resolve Agent CLI launch specs through `@dotobokuri/fleet-admiral`, spawn the selected provider CLI directly, inject carrier job completion system-reminders (and, on Operation rename, a `/rename <name>` slash command) only into the originating session's PTY, bridge carrier runtime events into console-owned observability, and surface Claude input-waiting pauses (AskUserQuestion and permission/idle/elicitation notifications) to the browser as a transient observer-SSE attention signal that raises a notification toast, without exposing MCP/session tokens, terminal tickets, or system reminders to the browser; closing the browser view or switching Operations does not terminate the PTY — live sessions persist until the child process exits, an operator explicitly terminates the session, or the server stops; restarting the console restores Operations in a dormant state without a PTY and resumes them lazily when opened), the lifecycle modules (`lock.ts`, `paths.ts`, `health.ts`, `stale.ts`), and the CLI (`cli.ts`, `cli-bin.ts`, `browser.ts`, `help-style.ts`). Built by tsup to `dist/cli.mjs` and `dist/cli-bin.mjs`. `help-style.ts` is a CLI-help-only **self-hosted** style helper shared by the console and Codex compatibility CLIs; it must not import from `fleet-cli`, `packages/*`, or `client/`, and changes to the shared banner/SGR vocabulary require manual sync across those copies.
59
+ - `src/` — Node-side backend and CLI lifecycle: the HTTP server (`server.ts`), security headers, static serving (`static-console.ts`), observer routes (including `/observer/theaters*` Theater registry, session launch, and `DELETE /observer/theaters/:theaterId` for Theater plus cascading Operation/capture removal), the SSE helper, `codex/` (Fleet Wiki/Codex API gateway and workspace registration), `theaters.ts` (console-level in-memory TheaterRegistry backed by durable state), `theater.ts` (Theater id hash, realpath canonicalization, and label helpers), `terminal/` (PTY ticket/session/ws transport, `POST /terminal/sessions/:sessionId/resume` for lazy on-open resume of dormant Operations, and `DELETE /terminal/sessions/:sessionId` which kills a live session and removes it or simply removes a dormant session, persisting the change in all cases; console terminal sessions resolve Agent CLI launch specs through `@dotobokuri/fleet-admiral`, spawn the selected provider CLI directly, inject carrier job completion system-reminders (and, on Operation rename, a `/rename <name>` slash command) only into the originating session's PTY, bridge carrier runtime events into console-owned observability, and surface Claude input-waiting pauses (AskUserQuestion and permission/idle/elicitation notifications) to the browser as a transient observer-SSE attention signal that surfaces in the Theater-grouped Notification Cluster (non-visible Operations only), without exposing MCP/session tokens, terminal tickets, or system reminders to the browser; closing the browser view or switching Operations does not terminate the PTY — live sessions persist until the child process exits, an operator explicitly terminates the session, or the server stops; restarting the console restores Operations in a dormant state without a PTY and resumes them lazily when opened), the lifecycle modules (`lock.ts`, `paths.ts`, `health.ts`, `stale.ts`), the self-update orchestrator (`update-apply.ts`), and the CLI (`cli.ts`, `cli-bin.ts`, `browser.ts`, `help-style.ts`). Built by tsup to `dist/cli.mjs` and `dist/cli-bin.mjs`. `help-style.ts` is a CLI-help-only **self-hosted** style helper shared by the console and Codex compatibility CLIs; it must not import from `fleet-cli`, `packages/*`, or `client/`, and changes to the shared banner/SGR vocabulary require manual sync across those copies.
58
60
  - `client/` — the Vite React SPA (`client/src/`, `client/index.html`, `client/vite.config.ts`). Must not import Node-only modules or the console backend (`src/`).
59
61
  - `tests/` — vitest suites for the reducer, SSE parser, store, terminal, and CLI lifecycle.
60
62