{
  "$schema": "https://pi-tui.ratstack.sh/schema/pattern.schema.json",
  "aka": [
    "Mode-aware UI"
  ],
  "animated": false,
  "apis": [
    {
      "name": "ExtensionContext.mode",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#account-for-each-mode"
    },
    {
      "name": "ExtensionContext.hasUI",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#account-for-each-mode"
    },
    {
      "name": "ctx.ui.confirm",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "ctx.ui.setWidget",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "setWidget",
      "url": null
    },
    {
      "name": "Text",
      "url": null
    }
  ],
  "applicability": [
    "Use this when the same extension runs in TUI, RPC, JSON or print mode."
  ],
  "category": "lifecycle",
  "categoryLabel": "Lifecycle and mounting",
  "consequences": [
    "Non-interactive work need not depend on terminal rendering.",
    "RPC supports dialogs but not custom terminal components."
  ],
  "family": "lifecycle",
  "familyLabel": "Lifecycle",
  "id": "mode-fence",
  "implementation": [
    "hasUI includes RPC and does not imply terminal components.",
    "Do not copy the incomplete 0.65-era headless adapter.",
    "Treat false or undefined dialog results as safe cancellation."
  ],
  "intent": "Keep terminal components separate from dialog-capable and no-UI modes.",
  "jsonUrl": "https://pi-tui.ratstack.sh/patterns/mode-fence.json",
  "kind": "screen",
  "knownUses": [
    {
      "example": "headless-ui-context",
      "moreRefs": 0,
      "refs": [
        {
          "file": "daemon/headless-ui.js",
          "lines": "4-24",
          "sha": "8dce54fe",
          "url": "https://github.com/nicobailon/pi-discord/blob/8dce54fe2a42108d0cc992579818fe74cb458c37/daemon/headless-ui.js#L4-L24"
        }
      ],
      "repo": "pi-discord",
      "repoUrl": "https://github.com/nicobailon/pi-discord",
      "title": "Refuse headless dialogs safely"
    },
    {
      "example": "editor-component",
      "moreRefs": 0,
      "refs": [
        {
          "file": "raw-paste/index.ts",
          "lines": "95-104",
          "sha": "bca5070b",
          "url": "https://github.com/nicobailon/pi-extensions/blob/bca5070b541ffa7d273e74036dcd7d5f8b63eed3/raw-paste/index.ts#L95-L104"
        }
      ],
      "repo": "pi-extensions",
      "repoUrl": "https://github.com/nicobailon/pi-extensions",
      "title": "Session-scoped editor component mount"
    },
    {
      "example": "status-widget-pair",
      "moreRefs": 0,
      "refs": [
        {
          "file": "extensions/plan-mode.ts",
          "lines": "575-590",
          "sha": "17cce138",
          "url": "https://github.com/nicobailon/dot314/blob/17cce138f3f687211d0485d204408a9650953c61/extensions/plan-mode.ts#L575-L590"
        },
        {
          "file": "extensions/pi-codex-goal/src/goal-runtime-status.ts",
          "lines": "42-63",
          "sha": "17cce138",
          "url": "https://github.com/nicobailon/dot314/blob/17cce138f3f687211d0485d204408a9650953c61/extensions/pi-codex-goal/src/goal-runtime-status.ts#L42-L63"
        },
        {
          "file": "extensions/plan-mode.ts",
          "lines": "1-18",
          "sha": "17cce138",
          "url": "https://github.com/nicobailon/dot314/blob/17cce138f3f687211d0485d204408a9650953c61/extensions/plan-mode.ts#L1-L18"
        }
      ],
      "repo": "dot314",
      "repoUrl": "https://github.com/nicobailon/dot314",
      "title": "Separate compact status from structured detail"
    },
    {
      "example": "status-widget-pair",
      "moreRefs": 0,
      "refs": [
        {
          "file": "runtime/session-state.ts",
          "lines": "49-78",
          "sha": "a0e4700b",
          "url": "https://github.com/nicobailon/pi-custom-compaction/blob/a0e4700badb1c5c1c2dd12eeb250ff067fa67b7e/runtime/session-state.ts#L49-L78"
        },
        {
          "file": "runtime/session-state.ts",
          "lines": "105-183",
          "sha": "a0e4700b",
          "url": "https://github.com/nicobailon/pi-custom-compaction/blob/a0e4700badb1c5c1c2dd12eeb250ff067fa67b7e/runtime/session-state.ts#L105-L183"
        }
      ],
      "repo": "pi-custom-compaction",
      "repoUrl": "https://github.com/nicobailon/pi-custom-compaction",
      "title": "Separate compact status from structured detail"
    },
    {
      "example": "status-widget-pair",
      "moreRefs": 0,
      "refs": [
        {
          "file": "ralph-wiggum/index.ts",
          "lines": "190-215",
          "sha": "bca5070b",
          "url": "https://github.com/nicobailon/pi-extensions/blob/bca5070b541ffa7d273e74036dcd7d5f8b63eed3/ralph-wiggum/index.ts#L190-L215"
        }
      ],
      "repo": "pi-extensions",
      "repoUrl": "https://github.com/nicobailon/pi-extensions",
      "title": "Separate compact status from structured detail"
    },
    {
      "example": "status-widget-pair",
      "moreRefs": 0,
      "refs": [
        {
          "file": "index.ts",
          "lines": "72-82",
          "sha": "92b4c9c3",
          "url": "https://github.com/nicobailon/pi-memory-workbench/blob/92b4c9c3ad07841418d77118bf8bd02ad204f7c4/index.ts#L72-L82"
        }
      ],
      "repo": "pi-memory-workbench",
      "repoUrl": "https://github.com/nicobailon/pi-memory-workbench",
      "title": "Separate compact status from structured detail"
    },
    {
      "example": "status-widget-pair",
      "moreRefs": 0,
      "refs": [
        {
          "file": "index.ts",
          "lines": "295-305",
          "sha": "09937ed6",
          "url": "https://github.com/nicobailon/pi-messenger/blob/09937ed647a1b07a3b595bf75943feacb80ff123/index.ts#L295-L305"
        }
      ],
      "repo": "pi-messenger",
      "repoUrl": "https://github.com/nicobailon/pi-messenger",
      "title": "Separate compact status from structured detail"
    }
  ],
  "linkedFrom": [
    {
      "how": "guards the available mount surface",
      "id": "deferred-crest",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/deferred-crest.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/deferred-crest.md",
      "name": "Deferred Crest",
      "url": "https://pi-tui.ratstack.sh/patterns/deferred-crest/"
    }
  ],
  "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/mode-fence.md",
  "motivation": "The Discord host cannot answer terminal prompts and its old UI adapter lacks parts of the current contract.",
  "name": "Mode Fence",
  "participants": [
    {
      "name": "ExtensionContext.mode",
      "role": "Separates TUI from RPC, JSON and print modes.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#account-for-each-mode"
    },
    {
      "name": "ExtensionContext.hasUI",
      "role": "Reports dialog-capable TUI or RPC availability.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#account-for-each-mode"
    },
    {
      "name": "ctx.ui.confirm",
      "role": "Returns a confirmation decision.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "ctx.ui.setWidget",
      "role": "Mounts, replaces or clears one near-editor widget.",
      "url": "https://github.com/earendil-works/pi/blob/v1.0.3/packages/coding-agent/docs/extensions.md#interact-with-the-user"
    },
    {
      "name": "Cancellation result",
      "role": "Prevents an unavailable prompt from implying approval.",
      "url": null
    }
  ],
  "pi": "1.0.3",
  "related": [
    {
      "how": "settles terminal-only custom interactions",
      "id": "done-contract",
      "jsonUrl": "https://pi-tui.ratstack.sh/patterns/done-contract.json",
      "mdUrl": "https://pi-tui.ratstack.sh/patterns/done-contract.md",
      "name": "Done Contract",
      "url": "https://pi-tui.ratstack.sh/patterns/done-contract/"
    }
  ],
  "sampleCode": {
    "code": "// Mode Fence: distinguish terminal mounts, RPC dialogs, and no-UI cancellation.\nimport { Text } from \"@earendil-works/pi-tui\";\nimport type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport type { PatternStory } from \"../../../src/pattern.ts\";\n\ntype ModeFixture = Pick<ExtensionContext, \"mode\" | \"hasUI\"> & { confirmed: boolean };\n\nexport const story: PatternStory = {\n  id: \"mode-fence\", title: \"Mode Fence\", kind: \"screen\",\n  apis: [\"ExtensionContext.mode\", \"ExtensionContext.hasUI\", \"setWidget\", \"Text\"],\n  states: [\n    { id: \"tui\", label: \"Terminal mode\" },\n    { id: \"rpc\", label: \"RPC client\", steps: [{ type: \"action\", name: \"rpc\" }] },\n    { id: \"headless\", label: \"No UI\", steps: [{ type: \"action\", name: \"print\" }] },\n  ],\n  setup({ ui, theme, action }) {\n    // RPC/print are fixture transcripts, not real runtimes in this TUI harness.\n    const renderFixture = ({ mode, hasUI, confirmed }: ModeFixture) => {\n      ui.setWidget(\"terminal\", undefined);\n      let terminalMounted = false;\n      if (mode === \"tui\") {\n        ui.setWidget(\"terminal\", (_tui, theme) =>\n          new Text(theme.fg(\"accent\", \"Terminal task preview · 3 tasks\"), 0, 0));\n        terminalMounted = true;\n      }\n      // Synthetic client-observed confirmation. No unavailable dialog is called.\n      const approved = hasUI && confirmed;\n      ui.setWidget(\"mode\", [\n        theme.fg(\"accent\", \"Mode: \" + mode + \" · hasUI: \" + hasUI),\n        theme.fg(\"muted\", terminalMounted ? \"Terminal factory mounted\" : \"Terminal factory skipped\"),\n        theme.fg(approved ? \"success\" : \"warning\", approved\n          ? \"Fixture dialog result: approved\" : \"No UI · action cancelled safely\"),\n      ]);\n    };\n    ui.setEditorText(\"Review the mode decision.\");\n    action(\"rpc\", () => renderFixture({ mode: \"rpc\", hasUI: true, confirmed: true }));\n    action(\"print\", () => renderFixture({ mode: \"print\", hasUI: false, confirmed: false }));\n    renderFixture({ mode: \"tui\", hasUI: true, confirmed: true });\n  },\n};\n",
    "lang": "ts",
    "path": "stories/patterns/lifecycle/mode-fence.ts"
  },
  "states": [
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Mode Fence, Terminal mode state, 40 columns, dark theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-40-dark.955fc6c541fd.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Mode Fence, Terminal mode state, 40 columns, light theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-40-light.50a75c983b92.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Mode Fence, Terminal mode state, 60 columns, dark theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-60-dark.44bbce1c33e7.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Mode Fence, Terminal mode state, 60 columns, light theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-60-light.d8ec64f503fb.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Mode Fence, Terminal mode state, 80 columns, dark theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-80-dark.f4b8f67a5979.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Mode Fence, Terminal mode state, 80 columns, light theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-80-light.0943ef59feb0.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Mode Fence, Terminal mode state, 120 columns, dark theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-120-dark.9239c82af2c2.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Mode Fence, Terminal mode state, 120 columns, light theme, 13 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": 572,
          "rows": 13,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/tui-120-light.a6929739027a.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show a mounted synthetic component in TUI mode.",
      "id": "tui",
      "label": "Terminal mode",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Mode Fence, RPC client state, 40 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-40-dark.f63d5232aca0.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Mode Fence, RPC client state, 40 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-40-light.13969e470a35.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Mode Fence, RPC client state, 60 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-60-dark.703a67631250.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Mode Fence, RPC client state, 60 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-60-light.65801c32bdad.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Mode Fence, RPC client state, 80 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-80-dark.c77016ba3341.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Mode Fence, RPC client state, 80 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-80-light.e9bc45f27b06.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Mode Fence, RPC client state, 120 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-120-dark.1a99f2f04c2d.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Mode Fence, RPC client state, 120 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/rpc-120-light.d199b7d34cbb.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show a synthetic client-observed dialog result with no terminal factory mount.",
      "id": "rpc",
      "label": "RPC client",
      "problems": []
    },
    {
      "dont": false,
      "expectFail": [],
      "frames": [
        {
          "alt": "Mode Fence, No UI state, 40 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-40-dark.ce7f747d5986.webp",
          "theme": "dark",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Mode Fence, No UI state, 40 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-40-light.52cbe10d172c.webp",
          "theme": "light",
          "w": 800,
          "width": 40
        },
        {
          "alt": "Mode Fence, No UI state, 60 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-60-dark.7e7b000c8d05.webp",
          "theme": "dark",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Mode Fence, No UI state, 60 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-60-light.56f10e40faae.webp",
          "theme": "light",
          "w": 1200,
          "width": 60
        },
        {
          "alt": "Mode Fence, No UI state, 80 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-80-dark.0e106df6ffac.webp",
          "theme": "dark",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Mode Fence, No UI state, 80 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-80-light.a78e21bdf97b.webp",
          "theme": "light",
          "w": 1600,
          "width": 80
        },
        {
          "alt": "Mode Fence, No UI state, 120 columns, dark theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-120-dark.34b68d802fd4.webp",
          "theme": "dark",
          "w": 2400,
          "width": 120
        },
        {
          "alt": "Mode Fence, No UI state, 120 columns, light theme, 12 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": 528,
          "rows": 12,
          "still": "https://pi-tui.ratstack.sh/frames/mode-fence/headless-120-light.74f1b9dde6c4.webp",
          "theme": "light",
          "w": 2400,
          "width": 120
        }
      ],
      "how": "Show a fixture transcript recording a skipped mount and a cancelled action in print mode.",
      "id": "headless",
      "label": "No UI",
      "problems": []
    }
  ],
  "structure": "ctx.mode -> terminal mount?\nctx.hasUI -> supported dialog?\nno UI -> safe cancellation",
  "thumbnails": {
    "dark": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/mode-fence/dark.57205a2b013e.webp"
    },
    "light": {
      "animation": null,
      "src": "https://pi-tui.ratstack.sh/thumbs/mode-fence/light.6af8bb7518b6.webp"
    }
  },
  "url": "https://pi-tui.ratstack.sh/patterns/mode-fence/",
  "widths": [
    40,
    60,
    80,
    120
  ]
}
