import type { Board } from "./model.js"; /** * One thing to paste. * * The old flow asked a person to hold three screens in their head at once: a settings page telling * them to run `npx @staves/cli init` in a terminal, a connect sheet repeating it, and a handoff prompt * that carried the board's URL but no way to reach it — closing with "if MCP is unavailable, help me * connect it", which hands the agent a problem and no instructions. Somebody in a fresh project, which * is exactly when none of it is set up, got the confusing half of all three. * * The thing nobody was using: **the coding agent can run the command itself.** It has a terminal, it is * standing in the project, and it is already being asked to do work there. So there is no reason to * make a person relay a shell command between two windows. One paste, and the agent bootstraps. * * So this builds a prompt that is complete on its own: how to connect if it is not connected, which * board out of all of them, where that board lives, what the conversation was about, and what the * agent is and is not allowed to do. What it contains changes with what is already true — an agent * that is connected should not be told to set itself up, and being told to anyway is how a person * learns to skim the instructions. */ export interface HandoffFacts { /** the board's id, which is what every command needs to name it */ board: string; /** where the log lives, so a local agent knows which project it is standing in */ dir?: string; /** the page this board is served from, for a person following along */ url?: string; /** agents already connected and writing to this board, by name */ connected: string[]; /** a hosted workspace connects differently from a local one */ hosted?: boolean; /** the job the conversation is scoped to, or "board" */ scope?: string; /** what the person said they wanted to work on */ intention?: string; /** what they had typed and not sent */ draft?: string; } export interface Handoff { /** the whole thing, ready to paste into a coding agent */ prompt: string; /** true when nothing is connected yet and the prompt therefore carries setup */ needsSetup: boolean; /** what is connected right now, for the interface to say so plainly */ connected: string[]; /** the everyday commands, worth showing once a connection exists */ commands: { label: string; command: string; what: string; }[]; } /** What someone reaches for once the connection works. Not setup — the day-to-day. */ export declare function commandsFor(facts: HandoffFacts): Handoff["commands"]; /** * How to reach this board, for any prompt that asks an agent to do something with it. * * Shared rather than written twice: the export from Share & hand off carried the board's contents and * no way to write back to it, closing with "if Staves MCP is available" — the same conditional with no * instructions that made the other flow confusing. An agent holding a workflow it cannot reach can * only describe it back at you. */ export declare function connectionBlock(facts: HandoffFacts): string; export declare function handoff(board: Board, facts: HandoffFacts): Handoff;