{
  "schemaVersion": 0,
  "id": "zcode-acp-quota",
  "kind": "ui",
  "name": "zcode-acp quota dock",
  "purpose": "Reads the read-only quota config option and renders it in the composer dock.",
  "source": {
    "pluginId": "plugin-zcode-acp-quota",
    "packageId": "pkg-zcode-acp-quota-5"
  },
  "code": {
    "client": "// zcode-acp quota-dock plugin v5 (seeded by zcode-acp-server, ADR-0021)\n// v2: sticky last-known quota text (a mid-turn options push without the\n// quota option no longer drops the node) + order:-1 so compact width\n// truncation sacrifices trailing stats sections before QUOTA.\n// v5: quota-only — the per-turn TPS segment was removed (martty's own UI\n// now shows throughput) and the dock renders the quota line only (GLM /\n// Opencode Go / Ollama Cloud segments, whichever are configured).\nreturn {\n  inject: [\"tuiSlots\", \"acpSessionConfig\"],\n  apply: (ctx) => {\n    let panel\n    let quotaText = null\n    const readQuota = (options) => {\n      const list = options || ctx.acpSessionConfig.list()\n      const found = (list || []).filter((o) => o && o.id === \"quota\")[0]\n      if (!found || typeof found.currentValue !== \"string\") return\n      // Sticky: only an explicit empty string clears; a missing option keeps\n      // the last-known text so full-replace pushes without quota cannot\n      // erase the dock line.\n      quotaText = found.currentValue.length > 0 ? found.currentValue : null\n    }\n    const nodes = () => {\n      if (!quotaText) return []\n      return [{ id: \"zcode-acp-quota-gauge\", kind: \"generic\", title: quotaText, body: \"\" }]\n    }\n    const render = () => { if (panel) { try { panel.update(nodes()) } catch (err) {} } }\n    const stopSlot = ctx.tuiSlots.inject(\"conversation.composer.dock\", () => {\n      panel = ctx.tuiSlots.register({ name: \"conversation.composer.dock\", id: \"zcode-acp-quota\", order: -1 }, nodes())\n      return () => panel.dispose()\n    })\n    readQuota()\n    const stopSub = ctx.acpSessionConfig.subscribe((snap) => { readQuota(snap && snap.options); render() })\n    return () => { stopSub && stopSub(); stopSlot && stopSlot() }\n  },\n}"
  }
}
