{
  "$schema": "https://pi-tui.ratstack.sh/schema/pattern.schema.json",
  "aka": [
    "Submitted input interception"
  ],
  "animated": false,
  "apis": [
    {
      "name": "pi.on",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#events"
    },
    {
      "name": "InputEventResult",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#events"
    },
    {
      "name": "ctx.ui.setStatus",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "CustomEditor",
      "url": null
    },
    {
      "name": "setWidget",
      "url": null
    },
    {
      "name": "setStatus",
      "url": null
    }
  ],
  "applicability": [
    "Use this when an alias or input rewrite should not replace the editor."
  ],
  "category": "keys",
  "categoryLabel": "Keys and focus",
  "consequences": [
    "Submitted text can continue, transform or be handled locally.",
    "Handler ordering affects what later extensions receive."
  ],
  "family": "behavioral",
  "familyLabel": "Behavioral",
  "id": "input-switch",
  "implementation": [
    "Handlers run in extension registration order.",
    "A handled result stops normal processing."
  ],
  "intent": "Continue, transform or handle submitted input before normal processing.",
  "jsonUrl": "https://pi-tui.ratstack.sh/patterns/input-switch.json",
  "kind": "screen",
  "knownUses": [
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [
        {
          "file": "packages/coding-agent/src/core/extensions/types.ts",
          "lines": "460-505",
          "sha": "3e5d91f2",
          "url": "https://github.com/earendil-works/pi/blob/3e5d91f28775b2f2df21ef3f0ec3bd799610a447/packages/coding-agent/src/core/extensions/types.ts#L460-L505"
        }
      ],
      "repo": "earendil-works/pi",
      "repoUrl": "https://github.com/earendil-works/pi",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "dot314",
      "repoUrl": "https://github.com/nicobailon/dot314",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "pi-boomerang",
      "repoUrl": "https://github.com/nicobailon/pi-boomerang",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "pi-mcp-adapter",
      "repoUrl": "https://github.com/nicobailon/pi-mcp-adapter",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "pi-powerline-footer",
      "repoUrl": "https://github.com/nicobailon/pi-powerline-footer",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "pi-review-loop",
      "repoUrl": "https://github.com/nicobailon/pi-review-loop",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "pi-skill-palette",
      "repoUrl": "https://github.com/nicobailon/pi-skill-palette",
      "title": "Allow extensions to intercept submitted input"
    },
    {
      "example": "nico-input-event-interception",
      "moreRefs": 0,
      "refs": [],
      "repo": "pi-subagents",
      "repoUrl": "https://github.com/nicobailon/pi-subagents",
      "title": "Allow extensions to intercept submitted input"
    }
  ],
  "linkedFrom": [],
  "links": {
    "agentGuide": "https://pi-tui.ratstack.sh/llms.txt",
    "index": "https://pi-tui.ratstack.sh/patterns.md",
    "skill": "https://pi-tui.ratstack.sh/skills/build-pi-tui-component.md"
  },
  "mdUrl": "https://pi-tui.ratstack.sh/patterns/input-switch.md",
  "motivation": "Nico's upstream input event supports aliases and rewriting without replacing the editor.",
  "name": "Input Switch",
  "participants": [
    {
      "name": "pi.on",
      "role": "Registers ordered extension event handlers.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#events"
    },
    {
      "name": "InputEventResult",
      "role": "Declares continue, transform or handled input outcomes.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#events"
    },
    {
      "name": "ctx.ui.setStatus",
      "role": "Writes or clears one named footer slot.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "Input handlers",
      "role": "Continue, transform or consume the submitted input in order.",
      "url": null
    }
  ],
  "pi": "1.0.3",
  "related": [
    {
      "how": "changes the editor rather than submission",
      "id": "editor-steward",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/editor-steward.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/editor-steward.md",
      "name": "Editor Steward",
      "url": "https://pi-tui.ratstack.sh/patterns/editor-steward/"
    }
  ],
  "sampleCode": {
    "code": "// Input Switch: continue, rewrite or consume a real editor submission.\n// Synthetic dispatcher uses Pi's InputEventResult; no model or pi.on runtime exists here.\nimport { Text } from \"@earendil-works/pi-tui\";\nimport { CustomEditor, type InputEventResult } from \"@earendil-works/pi-coding-agent\";\nimport type { PatternStory } from \"../../../src/pattern.ts\";\n\nexport const story: PatternStory = {\n  id: \"input-switch\",\n  title: \"Input Switch\",\n  kind: \"screen\",\n  apis: [\"InputEventResult\", \"CustomEditor\", \"setWidget\", \"setStatus\"],\n  states: [\n    { id: \"continue\", label: \"Normal input\", steps: [\n      { type: \"text\", text: \"Review the parser tests\" }, { type: \"keys\", data: \"\\r\" },\n    ] },\n    { id: \"transform\", label: \"Rewritten input\", steps: [\n      { type: \"text\", text: \"/audit\" }, { type: \"keys\", data: \"\\r\" },\n    ] },\n    { id: \"handled\", label: \"Handled locally\", steps: [\n      { type: \"text\", text: \"/hold\" }, { type: \"keys\", data: \"\\r\" },\n    ] },\n  ],\n  setup({ ui, theme }) {\n    let delivered = 0;\n    ui.setHeader(() => new Text(theme.fg(\"accent\", \"Pi · Input Switch\"), 0, 0));\n    const inputHandler = (text: string): InputEventResult => {\n      if (text === \"/audit\") return { action: \"transform\", text: \"Review the parser tests\" };\n      if (text === \"/hold\") return { action: \"handled\" };\n      return { action: \"continue\" };\n    };\n    ui.setEditorComponent((tui, editorTheme, keys) => {\n      const editor = new CustomEditor(tui, editorTheme, keys);\n      editor.onSubmit = original => {\n        const result = inputHandler(original);\n        const consumed = result.action === \"handled\";\n        const submitted = result.action === \"transform\" ? result.text : original;\n        if (!consumed) delivered++;\n        ui.setWidget(\"input-route\", [\n          theme.fg(\"muted\", \"Submitted: \" + original),\n          theme.fg(consumed ? \"warning\" : \"accent\", \"Handler → \" + result.action),\n          theme.fg(\"text\", consumed ? \"Local command · no host delivery\" : \"Synthetic host: \" + submitted),\n          theme.fg(\"dim\", \"Delivered submissions: \" + delivered),\n        ]);\n        ui.setStatus(\"input-switch\", theme.fg(consumed ? \"warning\" : \"success\", consumed ? \"held locally\" : \"delivered\"));\n      };\n      return editor;\n    });\n    ui.setWidget(\"input-hint\", [theme.fg(\"muted\", \"Enter send · /audit alias · /hold local\")], { placement: \"belowEditor\" });\n    return () => {\n      ui.setStatus(\"input-switch\", undefined);\n      ui.setWidget(\"input-route\", undefined);\n      ui.setWidget(\"input-hint\", undefined);\n      ui.setEditorComponent(undefined);\n    };\n  },\n};\n",
    "lang": "ts",
    "path": "stories/patterns/behavioral/input-switch.ts"
  },
  "states": [
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Input Switch, Normal input state, 40 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-40-dark.13b81e8a657c.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Input Switch, Normal input state, 40 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-40-light.d130288a75a4.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Input Switch, Normal input state, 60 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-60-dark.899f973a7520.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Input Switch, Normal input state, 60 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-60-light.0dd6084787f0.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Input Switch, Normal input state, 80 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-80-dark.67b399751e36.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Input Switch, Normal input state, 80 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-80-light.47df7b56ce76.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Input Switch, Normal input state, 120 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-120-dark.7140703de7cf.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Input Switch, Normal input state, 120 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/continue-120-light.5fc7417439f3.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show the original synthetic submission reaching the host.",
      "id": "continue",
      "label": "Normal input",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Input Switch, Rewritten input state, 40 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-40-dark.7ac60cf11433.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Input Switch, Rewritten input state, 40 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-40-light.3331813501bf.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Input Switch, Rewritten input state, 60 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-60-dark.61a62085106c.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Input Switch, Rewritten input state, 60 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-60-light.dd8ea149cf7b.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Input Switch, Rewritten input state, 80 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-80-dark.76cb39cc8c5e.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Input Switch, Rewritten input state, 80 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-80-light.a2f09bf31ffa.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Input Switch, Rewritten input state, 120 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-120-dark.d69a0c84a8bf.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Input Switch, Rewritten input state, 120 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/transform-120-light.3c3cd67a9cf3.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show an alias expanded into visible submitted text.",
      "id": "transform",
      "label": "Rewritten input",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Input Switch, Handled locally state, 40 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-40-dark.f3e9bb4b1a25.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Input Switch, Handled locally state, 40 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-40-light.1f0772db9efa.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Input Switch, Handled locally state, 60 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-60-dark.88c244afac2d.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Input Switch, Handled locally state, 60 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-60-light.ce0118efbdaf.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Input Switch, Handled locally state, 80 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-80-dark.60295c1b57e8.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Input Switch, Handled locally state, 80 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-80-light.3e0f503e6142.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Input Switch, Handled locally state, 120 columns, dark theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-120-dark.00fe6f8b87d2.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Input Switch, Handled locally state, 120 columns, light theme, 14 rows",
          "animated": false,
          "animation": null,
          "checks": [
            {
              "evidence": [],
              "name": "width",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "style-leak",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "hard-coded-colour",
              "status": "pass",
              "verdict": "pass"
            },
            {
              "evidence": [],
              "name": "height",
              "status": "pass",
              "verdict": "pass"
            }
          ],
          "h": 616,
          "rows": 14,
          "still": "https://pi-tui.ratstack.sh/frames/input-switch/handled-120-light.20cc7affdb6e.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Consume an input and show a keyed status instead of starting a model turn.",
      "id": "handled",
      "label": "Handled locally",
      "problems": []
    }
  ],
  "structure": "submission -> input handlers\n  continue / transform / handled",
  "thumbnails": {
    "dark": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/input-switch/dark.49bad6d0ac2d.webp"
    },
    "light": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/input-switch/light.8970839e68e1.webp"
    }
  },
  "url": "https://pi-tui.ratstack.sh/patterns/input-switch/",
  "widths": [
    40,
    60,
    80,
    120
  ]
}
