Commit Graph
4 Commits
Author SHA1 Message Date
Georgy Butaev b08ac4da14 feat(desktop): project selection + auto-sync on connect + Sync to Web (agent token to /runtime-state); switch to canonical injectIntoTab; ui-public-download-* classes (zero design violations); forward custom prompts as queueHead; clean lint; broad docs/marketing/scripts updates for FleetCrown desktop runtime 2026-06-02 12:17:12 +02:00
g-but e81aa7fd96 test(home): pin the renderQueueBlock contract that e6bd03b + 1cacfd2 rely on
Two ships shipped the queue-into-prompt path: e6bd03b added the queue
field to OrchestrationTaskRequest + renderQueueBlock in
src/lib/orchestration/renderers.ts; 1cacfd2 plumbed it through home/'s
render.ts + /api/dispatch. Neither was covered by the existing
home/render self-tests (which only verified that all 12 intents
produce non-empty strings).

A future change to renderQueueBlock — different header wording, item
ordering, overflow threshold — would silently break both stacks
without any regression signal. Four new cases pin the contract:

  • queue items render under 'User's prompt queue for this project'
    and are 1-indexed
  • empty queue → no block (suppression for the trivial case)
  • undefined queue → no block (back-compat for callers that don't
    plumb queue yet)
  • queue > 10 items → first 10 + '…and N more' overflow indicator

home/render: 16 tests (was 12); full home/ suite total: 89/89.
tsc clean.
2026-05-20 11:50:19 +02:00
g-but 1cacfd2417 feat(home): /api/dispatch surfaces the queue context to the agent
home/render.ts gained an optional queue field (mirroring
OrchestrationTaskRequest.queue from e6bd03b); home/server.ts's
/api/dispatch now sources the queue from caller-supplied body OR
falls back to /tmp/agent-queue-<tab> (the file mirror cloud's
/api/beacon/queue/[tab] writes for cross-stack visibility). Either
source threads through buildPromptForDispatch → renderPromptForDispatch
→ renderQueueBlock, so a home/-dispatched prompt now carries the
same 'User's prompt queue for this project' block the cloud path
already had. Closes the asymmetry: home/ and cloud both surface
queue context to the agent now.

Queue items added after the drained head still render — the agent
sees both what they're currently working on (the dispatch prompt
itself) and what's queued behind it.

tsc clean, npm run test:home 85/85.
2026-05-20 11:39:54 +02:00
g-butandClaude Opus 4.7 39947c5545 feat(home): M7 — real prompt renderer in home/, retiring the m6 stub
Seventh milestone of the greenfield rewrite. home/render.ts is now a thin
adapter over src/lib/orchestration/renderers.ts:renderTaskForAdapter — the
existing SSOT for prompt text. The home/ Brain produces full, agent-ready
prompts for every canonical intent instead of the M6 placeholder string.

  home/render.ts          renderPromptForDispatch({project, projectPath?,
                          intent, adapter?, customInstructions?}) → string
                          Reuses renderTaskForAdapter; no duplication of
                          the per-intent bodies. Inline self-test covers all
                          12 canonical intents (next_best, test_and_fix,
                          quality, full_audit, product, ux_review,
                          deploy_check, commit_push, close_session,
                          hard_stop, continue, custom) — 12/12 pass.

  home/server.ts          buildPromptForDispatch now uses the new renderer.
                          The queue-drain case (decision.action.prompt is
                          set) collapses to intent="custom" with the queue
                          item as customInstructions — matches today's
                          flip in /api/orchestration/run when a queueHead
                          exists.

POST /api/dispatch body now accepts an optional projectPath so the renderer
can produce "Work on the project at /home/g/dev/<x>" instead of falling
back to the project name. Missing path is harmless — agents are already
in the right cwd.

What this commit deliberately does NOT do:
  - write a worker that consumes bridge.dispatch (next session — the new
    M8 milestone, since M7 split cleanly into render + dispatch consumer)
  - retire /api/control/dispatch on Vercel (parity check first)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 02:08:54 +02:00