Files
loki/scripts/test/desktop-command-validator.ts
CatoandClaude Fable 5.1 6e6ca0bc7a docs(cloud-primary): nothing left that describes the old substrate — docs, marketing, comments, focus_tab (#631)
* docs(cloud-primary): nothing left that describes the old substrate — docs, marketing, comments, focus_tab

The cloud-primary series (#615 routing, #618 OrangeCat auto-kickoff, #624
Fleet Runner 0.8.19, #630 web PTY-only) changed what the product IS. This
sweep makes every surface that describes it say so, so neither an agent
reading the repo nor a person reading the site is told about zellij tabs,
presence-based routing, a cold-start restore, or a handoff that "starts
nothing".

Inventory-driven (≈105 doc lines, ≈30 user-facing strings, ≈22 code
comments, 2 repo-level items), not a grep-and-replace:

User-facing
- /download prerequisites: the "Zellij — bundled" card is gone; copy says
  each agent runs in a terminal Fleet Runner owns.
- Quickstart, license page, executor copy (cloud is the default; "This
  computer" is a per-project choice under Runs on), marketing pillars,
  whitepaper (owned-PTY design, "where a project runs is a decision, not a
  guess", ZSH typing-guard section deleted), Control terminal panel strings
  (components renamed LiveTerminalPanel / LiveTerminalRows), peek drawer
  copy, GitHub release notes for 0.8.19, repo description + topics.

Agent-facing
- README, CLAUDE.md, AGENTS-adjacent SSOTs: cloud-local-workflows.md now
  states the stored routing rule; priority plan closes B6; multitenancy plan
  routes by builder_pref; HANDOFF.md staleness table + terminals section;
  the 2026-09-10 cold-start handoff gets a dated "superseded" section; the
  two shipped proposals (fleet-runner-pty-ownership, desktop-app) carry a
  status banner; home/README describes the eight modules that exist;
  desktop/README describes 0.8.19; roadmap seed marks the migration done;
  box-runner unit and log drop FLEETCROWN_RUNNER_PTY; 22 code comments.

Code (one coherent retirement)
- focus_tab is removed from the pending-command contract, the desktop
  validator and poller, enqueueTabCommand's type, the validator test and the
  failure classifier (START_SESSION | RETRY). The runner had rejected it
  since 0.8.19; now it cannot be enqueued at all.

Verified: tsc, eslint, 148/148 unit files, 130/130 home self-tests,
check:desktop (typecheck + build).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf

* chore(desktop): 0.8.20 — the focus_tab retirement touches desktop/, so it ships as a release

The release-drift gate is right: a desktop change without a bump goes red on
main once the next tag is minted. 0.8.19's changelog date is corrected to the
release's real publishedAt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WSNERoZZqW2TgqbAGHSQZf

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 02:41:20 -07:00

65 lines
2.1 KiB
TypeScript

import assert from "node:assert/strict";
import { validateCommand } from "../../desktop/src/main/command-validator";
const validCases = [
{ type: "inject", payload: { tab: "truthseeker", prompt: "summarize this repo" } },
{ type: "close_tab", payload: { tab: "truthseeker" } },
{
type: "launch_agent",
payload: {
tab: "truthseeker",
dir: "/home/g/dev/truthseeker",
agent: "claude",
model: "sonnet",
},
},
{
type: "switch_agent",
payload: {
tab: "truthseeker",
dir: "/home/g/dev/truthseeker",
toAgent: "codex",
fromAgent: "claude",
},
},
{ type: "auto_continue", payload: { tab: "truthseeker", enabled: true } },
{ type: "install_cli", payload: { agent: "gemini" } },
{ type: "peek_tab", payload: { tab: "truthseeker" } },
] as const;
for (const command of validCases) {
const result = validateCommand(command);
assert.equal(result.ok, true, `${command.type} should validate`);
if (result.ok) assert.equal(result.command.type, command.type);
}
const invalidCases = [
{ command: { type: "inject", payload: { tab: "truthseeker" } }, error: "prompt" },
{
command: { type: "launch_agent", payload: { tab: "truthseeker", agent: "claude" } },
error: "dir",
},
{
command: { type: "switch_agent", payload: { tab: "truthseeker", dir: "/tmp" } },
error: "toAgent",
},
{
command: { type: "auto_continue", payload: { tab: "truthseeker", enabled: "true" } },
error: "enabled",
},
{ command: { type: "install_cli", payload: {} }, error: "agent" },
{ command: { type: "peek_tab", payload: {} }, error: "tab" },
{ command: { type: "transcribe", payload: {} }, error: "does not handle" },
{ command: { type: "repair_helper", payload: {} }, error: "does not handle" },
] as const;
for (const { command, error } of invalidCases) {
const result = validateCommand(command);
assert.equal(result.ok, false, `${command.type} should fail validation`);
if (!result.ok) assert.match(result.error, new RegExp(error));
}
console.log(
`${validCases.length + invalidCases.length}/${validCases.length + invalidCases.length} desktop command validator cases passed`,
);