{"version":3,"file":"tool-output-view.d.ts","sourceRoot":"","sources":["../../src/core/tool-output-view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvD,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,EAAE,SAAS,cAAc,EAA8B,CAAC;AAEtF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,IAAI,CAAC;AAE5B,uFAAuF;AACvF,eAAO,MAAM,wBAAwB,EAAE,cAAuB,CAAC;AAE/D,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,EAAE,cAAuB,CAAC;AAE3D,iFAAiF;AACjF,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAIxE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAInE,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,GAAG,UAAU,GAAG,cAAc,CAI9G","sourcesContent":["/**\n * How much of a tool call the transcript shows. Three stops on one dial, least\n * to most, cycled with `app.view.cycleForward` / `app.view.cycleBackward`:\n *\n * - `radar` — one line per *chain*: a run of consecutive tool calls collapsed to\n *   the shape it had while working, or what it amounted to once it is over.\n * - `peek` — the tool's own call line and the first few lines of what came back.\n *   The default.\n * - `full` — the same call line with nothing trimmed away.\n *\n * There is no separate expand state. `full` *is* the expanded view, and\n * `app.tools.expand` jumps straight to it from any stop and back again — which\n * is why the dial is the only thing that has to be remembered, and why `full`\n * can finally mean full.\n *\n * This lives in core rather than next to the renderer because the settings\n * manager persists it, and core must not reach into the interactive UI.\n */\nexport type ToolOutputView = \"radar\" | \"peek\" | \"full\";\n\n/** The dial's order, least to most. Cycling wraps at both ends. */\nexport const TOOL_OUTPUT_VIEWS: readonly ToolOutputView[] = [\"radar\", \"peek\", \"full\"];\n\n/**\n * How many lines of a result the `peek` stop shows.\n *\n * Short on purpose. `peek` is the working view — it replaced one that folded\n * the body away entirely — so it has to stay scannable while a run of a dozen\n * calls lands. Its job is \"did this find anything, and roughly what\", not\n * \"read the output\"; the whole result is one `app.tools.expand` away.\n */\nexport const PEEK_LINES = 5;\n\n/** Where a fresh install starts: enough of the result to judge it, no wall of text. */\nexport const DEFAULT_TOOL_OUTPUT_VIEW: ToolOutputView = \"peek\";\n\n/** The stop `app.tools.expand` jumps to, and returns from. */\nexport const MAX_TOOL_OUTPUT_VIEW: ToolOutputView = \"full\";\n\n/** One-line description per view, shared by the settings pane and `/hotkeys`. */\nexport const TOOL_OUTPUT_VIEW_DESCRIPTIONS: Record<ToolOutputView, string> = {\n\tradar: \"one line per run of tool calls; failures still show why they failed\",\n\tpeek: \"the call line and the first few lines of the result\",\n\tfull: \"the call line and the whole result\",\n};\n\n/**\n * Values written by versions that had `collapsed` / `peek` / `standard` / `glance`.\n *\n * `peek` is a live name again and needs no entry: a config that still says it\n * lands on the stop it always meant, the light one. `glance` — the call line\n * with its body folded away — becomes that same stop, because a handful of\n * result lines answers \"did this find anything\" better than a folded body did.\n * `collapsed`, which hid a call's result with no way to see it, becomes `radar`,\n * which hides the same body but says what came back.\n */\nexport const LEGACY_TOOL_OUTPUT_VIEWS: Record<string, ToolOutputView> = {\n\tcollapsed: \"radar\",\n\tglance: \"peek\",\n\tstandard: \"full\",\n};\n\nexport function isToolOutputView(value: unknown): value is ToolOutputView {\n\treturn typeof value === \"string\" && (TOOL_OUTPUT_VIEWS as readonly string[]).includes(value);\n}\n\n/** Next stop on the dial, wrapping at both ends. */\nexport function cycleToolOutputView(current: ToolOutputView, direction: \"forward\" | \"backward\"): ToolOutputView {\n\tconst index = TOOL_OUTPUT_VIEWS.indexOf(current);\n\tconst step = direction === \"forward\" ? 1 : TOOL_OUTPUT_VIEWS.length - 1;\n\treturn TOOL_OUTPUT_VIEWS[(index + step) % TOOL_OUTPUT_VIEWS.length];\n}\n"]}