@neuralnomads/codenomad-dev 1.1.0-dev-20261113-1a9b0f9e → 1.1.0-dev-20261114-c8dae86e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/opencode/plugin-controls.test.js +21 -15
  2. package/dist/opencode/plugin-controls.test.js.map +1 -1
  3. package/package.json +1 -1
  4. package/public/assets/App-D0UdWSM2.js +215 -0
  5. package/public/assets/App-D0UdWSM2.js.map +1 -0
  6. package/public/assets/{FilesPanel-DMwbCv00.js → FilesPanel-BFKOqVhL.js} +4 -4
  7. package/public/assets/{FilesPanel-DMwbCv00.js.map → FilesPanel-BFKOqVhL.js.map} +1 -1
  8. package/public/assets/{StatusTab-DOghebB2.js → StatusTab-CKl50stg.js} +9 -9
  9. package/public/assets/{StatusTab-DOghebB2.js.map → StatusTab-CKl50stg.js.map} +1 -1
  10. package/public/assets/{agent-memory-cleanup-D09LNF5N.js → agent-memory-cleanup-DJuMUYIE.js} +2 -2
  11. package/public/assets/{agent-memory-cleanup-D09LNF5N.js.map → agent-memory-cleanup-DJuMUYIE.js.map} +1 -1
  12. package/public/assets/{app-tabs-BFFRsS1G.js → app-tabs-DzqGRT1h.js} +2 -2
  13. package/public/assets/{app-tabs-BFFRsS1G.js.map → app-tabs-DzqGRT1h.js.map} +1 -1
  14. package/public/assets/{client-state-D0va2vn9.js → client-state-C3lHTNnY.js} +2 -2
  15. package/public/assets/{client-state-D0va2vn9.js.map → client-state-C3lHTNnY.js.map} +1 -1
  16. package/public/assets/{client-state-BO6JwV_q.js → client-state-LxpCJ7As.js} +2 -2
  17. package/public/assets/{client-state-BO6JwV_q.js.map → client-state-LxpCJ7As.js.map} +1 -1
  18. package/public/assets/client-state-owner-commands-ode_WhLK.js +2 -0
  19. package/public/assets/{client-state-owner-commands-CU6VQEhP.js.map → client-state-owner-commands-ode_WhLK.js.map} +1 -1
  20. package/public/assets/{diff-viewer-FWGI722p.js → diff-viewer-d_llplfF.js} +2 -2
  21. package/public/assets/{diff-viewer-FWGI722p.js.map → diff-viewer-d_llplfF.js.map} +1 -1
  22. package/public/assets/{external-link-clicks-DOqdc0ik.js → external-link-clicks-BT_S6wz3.js} +2 -2
  23. package/public/assets/{external-link-clicks-DOqdc0ik.js.map → external-link-clicks-BT_S6wz3.js.map} +1 -1
  24. package/public/assets/{main-Bkm9LLSY.js → main-Bnc8FkyW.js} +6 -6
  25. package/public/assets/main-Bnc8FkyW.js.map +1 -0
  26. package/public/assets/{markdown-Df0e5bzs.js → markdown-B4sKKBx2.js} +2 -2
  27. package/public/assets/{markdown-Df0e5bzs.js.map → markdown-B4sKKBx2.js.map} +1 -1
  28. package/public/assets/{opener-startup-state-settings-card-C6udBhBA.js → opener-startup-state-settings-card-kOu4t6NL.js} +2 -2
  29. package/public/assets/{opener-startup-state-settings-card-C6udBhBA.js.map → opener-startup-state-settings-card-kOu4t6NL.js.map} +1 -1
  30. package/public/assets/{startup-state-settings-card-BydGv7OE.js → startup-state-settings-card-BbAvstdq.js} +2 -2
  31. package/public/assets/{startup-state-settings-card-BydGv7OE.js.map → startup-state-settings-card-BbAvstdq.js.map} +1 -1
  32. package/public/assets/{startup-state-settings-view-CVaxXzgE.js → startup-state-settings-view-B9j4CEK5.js} +3 -3
  33. package/public/assets/{startup-state-settings-view-CVaxXzgE.js.map → startup-state-settings-view-B9j4CEK5.js.map} +1 -1
  34. package/public/assets/{terminal-square-BeYqRxu8.js → terminal-square-BIJ_GeZj.js} +2 -2
  35. package/public/assets/{terminal-square-BeYqRxu8.js.map → terminal-square-BIJ_GeZj.js.map} +1 -1
  36. package/public/assets/{tool-call-DBade2gY.js → tool-call-QwCY5Afj.js} +4 -4
  37. package/public/assets/{tool-call-DBade2gY.js.map → tool-call-QwCY5Afj.js.map} +1 -1
  38. package/public/assets/{unified-picker-dYAbBq1q.js → unified-picker-BGT-47SC.js} +2 -2
  39. package/public/assets/{unified-picker-dYAbBq1q.js.map → unified-picker-BGT-47SC.js.map} +1 -1
  40. package/public/index.html +1 -1
  41. package/public/sw.js +1 -1
  42. package/public/sw.js.map +1 -1
  43. package/public/assets/App-B5-6zDBd.js +0 -215
  44. package/public/assets/App-B5-6zDBd.js.map +0 -1
  45. package/public/assets/client-state-owner-commands-CU6VQEhP.js +0 -2
  46. package/public/assets/main-Bkm9LLSY.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StatusTab-DOghebB2.js","sources":["../../../../../../node_modules/lucide-solid/dist/source/icons/app-window.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/blocks.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/package-search.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/package.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/unlink-2.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/x-octagon.jsx","../../../../../../node_modules/@kobalte/core/dist/chunk/UGE6PPGT.jsx","../../../../../../node_modules/@kobalte/core/dist/chunk/PYUMFHDL.jsx","../../../components/session/context-usage-panel.tsx","../../../components/info-popover-button.tsx","../../../components/session/provider-usage-console.tsx","../../../components/session/provider-usage-state.ts","../../../components/session/provider-usage-panel.tsx","../../../../../server/src/opencode/goal-contract.ts","../../../stores/session-goal-store.ts","../../../stores/session-goal.ts","../../../components/session/session-goal-line.tsx","../../../lib/integration-row-state.ts","../../../lib/integration-rows.ts","../../../lib/integrations-api.ts","../../../stores/integrations-store.ts","../../../stores/integration-bindings-store.ts","../../../stores/integrations.ts","../../../stores/plugin-controls.ts","../../../stores/plugin-sources.ts","../../../components/integration-confirmation.ts","../../../components/integration-host-installation.ts","../../../components/integration-row-binding.ts","../../../components/integration-row-indicators.tsx","../../../components/plugin-activation-switch.tsx","../../../stores/plugin-package-actions.ts","../../../components/plugin-row-actions.tsx","../../../components/integration-catalog-window.tsx","../../../components/plugin-source-add.tsx","../../../components/plugin-add-menu.tsx","../../../components/plugin-system-attention.tsx","../../../stores/plugin-controls-events.ts","../../../components/plugin-activation-controls.tsx","../../../components/integration-context.ts","../../../components/instance-service-status.tsx","../../../stores/shell-store.ts","../../../stores/shells.ts","../../../components/shell-output-dialog.tsx","../../../components/instance/shell/right-panel/tabs/StatusTab.tsx"],"sourcesContent":["import Icon from '../Icon';\nconst iconNode = [\n ['rect', { x: '2', y: '4', width: '20', height: '16', rx: '2', key: 'izxlao' }],\n ['path', { d: 'M10 4v4', key: 'pp8u80' }],\n ['path', { d: 'M2 8h20', key: 'd11cs7' }],\n ['path', { d: 'M6 4v4', key: '1svtjw' }],\n];\nconst AppWindow = (props) => <Icon {...props} name=\"AppWindow\" iconNode={iconNode}/>;\nexport default AppWindow;\n","import Icon from '../Icon';\nconst iconNode = [\n ['rect', { width: '7', height: '7', x: '14', y: '3', rx: '1', key: '6d4xhi' }],\n [\n 'path',\n {\n d: 'M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3',\n key: '1fpvtg',\n },\n ],\n];\nconst Blocks = (props) => <Icon {...props} name=\"Blocks\" iconNode={iconNode}/>;\nexport default Blocks;\n","import Icon from '../Icon';\nconst iconNode = [\n [\n 'path',\n {\n d: 'M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14',\n key: 'e7tb2h',\n },\n ],\n ['path', { d: 'm7.5 4.27 9 5.15', key: '1c824w' }],\n ['polyline', { points: '3.29 7 12 12 20.71 7', key: 'ousv84' }],\n ['line', { x1: '12', x2: '12', y1: '22', y2: '12', key: 'a4e8g8' }],\n ['circle', { cx: '18.5', cy: '15.5', r: '2.5', key: 'b5zd12' }],\n ['path', { d: 'M20.27 17.27 22 19', key: '1l4muz' }],\n];\nconst PackageSearch = (props) => (<Icon {...props} name=\"PackageSearch\" iconNode={iconNode}/>);\nexport default PackageSearch;\n","import Icon from '../Icon';\nconst iconNode = [\n ['path', { d: 'm7.5 4.27 9 5.15', key: '1c824w' }],\n [\n 'path',\n {\n d: 'M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z',\n key: 'hh9hay',\n },\n ],\n ['path', { d: 'm3.3 7 8.7 5 8.7-5', key: 'g66t2b' }],\n ['path', { d: 'M12 22V12', key: 'd0xqtd' }],\n];\nconst Package = (props) => <Icon {...props} name=\"Package\" iconNode={iconNode}/>;\nexport default Package;\n","import Icon from '../Icon';\nconst iconNode = [\n ['path', { d: 'M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2', key: '1re2ne' }],\n];\nconst Unlink2 = (props) => <Icon {...props} name=\"Unlink2\" iconNode={iconNode}/>;\nexport default Unlink2;\n","import Icon from '../Icon';\nconst iconNode = [\n [\n 'polygon',\n {\n points: '7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2',\n key: 'h1p8hx',\n },\n ],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n];\nconst XOctagon = (props) => <Icon {...props} name=\"XOctagon\" iconNode={iconNode}/>;\nexport default XOctagon;\n","import {\n createDisclosureState\n} from \"./E53DB7BS.jsx\";\nimport {\n ButtonRoot\n} from \"./UKTBL2JL.jsx\";\nimport {\n createRegisterId\n} from \"./JNCCF6MP.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\nimport {\n __export\n} from \"./5WXHJDCZ.jsx\";\n\n// src/collapsible/index.tsx\nvar collapsible_exports = {};\n__export(collapsible_exports, {\n Collapsible: () => Collapsible,\n Content: () => CollapsibleContent,\n Root: () => CollapsibleRoot,\n Trigger: () => CollapsibleTrigger,\n useCollapsibleContext: () => useCollapsibleContext\n});\n\n// src/collapsible/collapsible-content.tsx\nimport { mergeDefaultProps, mergeRefs } from \"@kobalte/utils\";\nimport {\n Show,\n createEffect,\n createSignal,\n on,\n onCleanup,\n onMount,\n splitProps\n} from \"solid-js\";\nimport { combineStyle } from \"@solid-primitives/props\";\nimport createPresence from \"solid-presence\";\n\n// src/collapsible/collapsible-context.tsx\nimport { createContext, useContext } from \"solid-js\";\nvar CollapsibleContext = createContext();\nfunction useCollapsibleContext() {\n const context = useContext(CollapsibleContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component\"\n );\n }\n return context;\n}\n\n// src/collapsible/collapsible-content.tsx\nfunction CollapsibleContent(props) {\n const [ref, setRef] = createSignal();\n const context = useCollapsibleContext();\n const mergedProps = mergeDefaultProps(\n { id: context.generateId(\"content\") },\n props\n );\n const [local, others] = splitProps(mergedProps, [\"ref\", \"id\", \"style\"]);\n const { present } = createPresence({\n show: context.shouldMount,\n element: () => ref() ?? null\n });\n const [height, setHeight] = createSignal(0);\n const [width, setWidth] = createSignal(0);\n const isOpen = () => context.isOpen() || present();\n let isMountAnimationPrevented = isOpen();\n onMount(() => {\n const raf = requestAnimationFrame(() => {\n isMountAnimationPrevented = false;\n });\n onCleanup(() => {\n cancelAnimationFrame(raf);\n });\n });\n createEffect(\n on(\n /**\n * depends on `present` because it will be `false` on\n * animation end (so when close finishes). This allows us to\n * retrieve the dimensions *before* closing.\n */\n present,\n () => {\n if (!ref()) {\n return;\n }\n ref().style.transitionDuration = \"0s\";\n ref().style.animationName = \"none\";\n const rect = ref().getBoundingClientRect();\n setHeight(rect.height);\n setWidth(rect.width);\n if (!isMountAnimationPrevented) {\n ref().style.transitionDuration = \"\";\n ref().style.animationName = \"\";\n }\n }\n )\n );\n createEffect(\n on(\n context.isOpen,\n (open) => {\n if (!open && ref()) {\n ref().style.transitionDuration = \"\";\n ref().style.animationName = \"\";\n }\n },\n { defer: true }\n )\n );\n createEffect(() => onCleanup(context.registerContentId(local.id)));\n return <Show when={present()}><Polymorphic\n as=\"div\"\n ref={mergeRefs(setRef, local.ref)}\n id={local.id}\n style={combineStyle(\n {\n \"--kb-collapsible-content-height\": height() ? `${height()}px` : void 0,\n \"--kb-collapsible-content-width\": width() ? `${width()}px` : void 0\n },\n local.style\n )}\n {...context.dataset()}\n {...others}\n /></Show>;\n}\n\n// src/collapsible/collapsible-root.tsx\nimport {\n createGenerateId,\n mergeDefaultProps as mergeDefaultProps2\n} from \"@kobalte/utils\";\nimport {\n createMemo,\n createSignal as createSignal2,\n createUniqueId,\n splitProps as splitProps2\n} from \"solid-js\";\nfunction CollapsibleRoot(props) {\n const defaultId = `collapsible-${createUniqueId()}`;\n const mergedProps = mergeDefaultProps2(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps2(mergedProps, [\n \"open\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"disabled\",\n \"forceMount\"\n ]);\n const [contentId, setContentId] = createSignal2();\n const disclosureState = createDisclosureState({\n open: () => local.open,\n defaultOpen: () => local.defaultOpen,\n onOpenChange: (isOpen) => local.onOpenChange?.(isOpen)\n });\n const dataset = createMemo(() => ({\n \"data-expanded\": disclosureState.isOpen() ? \"\" : void 0,\n \"data-closed\": !disclosureState.isOpen() ? \"\" : void 0,\n \"data-disabled\": local.disabled ? \"\" : void 0\n }));\n const context = {\n dataset,\n isOpen: disclosureState.isOpen,\n disabled: () => local.disabled ?? false,\n shouldMount: () => local.forceMount || disclosureState.isOpen(),\n contentId,\n toggle: disclosureState.toggle,\n generateId: createGenerateId(() => others.id),\n registerContentId: createRegisterId(setContentId)\n };\n return <CollapsibleContext.Provider value={context}><Polymorphic\n as=\"div\"\n {...dataset()}\n {...others}\n /></CollapsibleContext.Provider>;\n}\n\n// src/collapsible/collapsible-trigger.tsx\nimport { callHandler } from \"@kobalte/utils\";\nimport {\n splitProps as splitProps3\n} from \"solid-js\";\nfunction CollapsibleTrigger(props) {\n const context = useCollapsibleContext();\n const [local, others] = splitProps3(props, [\"onClick\"]);\n const onClick = (e) => {\n callHandler(e, local.onClick);\n context.toggle();\n };\n return <ButtonRoot\n aria-expanded={context.isOpen()}\n aria-controls={context.isOpen() ? context.contentId() : void 0}\n disabled={context.disabled()}\n onClick={onClick}\n {...context.dataset()}\n {...others}\n />;\n}\n\n// src/collapsible/index.tsx\nvar Collapsible = Object.assign(CollapsibleRoot, {\n Content: CollapsibleContent,\n Trigger: CollapsibleTrigger\n});\n\nexport {\n useCollapsibleContext,\n CollapsibleContent,\n CollapsibleRoot,\n CollapsibleTrigger,\n Collapsible,\n collapsible_exports\n};\n","import {\n createSelectableList\n} from \"./N3GAC5SS.jsx\";\nimport {\n createListState,\n createSelectableItem\n} from \"./QZDH5R5B.jsx\";\nimport {\n CollapsibleContent,\n CollapsibleRoot,\n CollapsibleTrigger,\n useCollapsibleContext\n} from \"./UGE6PPGT.jsx\";\nimport {\n createDomCollection,\n createDomCollectionItem\n} from \"./SOM3K36D.jsx\";\nimport {\n createRegisterId\n} from \"./JNCCF6MP.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\nimport {\n __export\n} from \"./5WXHJDCZ.jsx\";\n\n// src/accordion/index.tsx\nvar accordion_exports = {};\n__export(accordion_exports, {\n Accordion: () => Accordion,\n Content: () => AccordionContent,\n Header: () => AccordionHeader,\n Item: () => AccordionItem,\n Root: () => AccordionRoot,\n Trigger: () => AccordionTrigger,\n useAccordionContext: () => useAccordionContext\n});\n\n// src/accordion/accordion-content.tsx\nimport { mergeDefaultProps } from \"@kobalte/utils\";\nimport {\n createEffect,\n onCleanup,\n splitProps\n} from \"solid-js\";\nimport { combineStyle } from \"@solid-primitives/props\";\n\n// src/accordion/accordion-item-context.tsx\nimport { createContext, useContext } from \"solid-js\";\nvar AccordionItemContext = createContext();\nfunction useAccordionItemContext() {\n const context = useContext(AccordionItemContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component\"\n );\n }\n return context;\n}\n\n// src/accordion/accordion-content.tsx\nfunction AccordionContent(props) {\n const itemContext = useAccordionItemContext();\n const defaultId = itemContext.generateId(\"content\");\n const mergedProps = mergeDefaultProps(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps(mergedProps, [\"id\", \"style\"]);\n createEffect(() => onCleanup(itemContext.registerContentId(local.id)));\n return <CollapsibleContent\n role=\"region\"\n aria-labelledby={itemContext.triggerId()}\n style={combineStyle(\n {\n \"--kb-accordion-content-height\": \"var(--kb-collapsible-content-height)\",\n \"--kb-accordion-content-width\": \"var(--kb-collapsible-content-width)\"\n },\n local.style\n )}\n {...others}\n />;\n}\n\n// src/accordion/accordion-header.tsx\nfunction AccordionHeader(props) {\n const context = useCollapsibleContext();\n return <Polymorphic\n as=\"h3\"\n {...context.dataset()}\n {...props}\n />;\n}\n\n// src/accordion/accordion-item.tsx\nimport { createGenerateId, mergeDefaultProps as mergeDefaultProps2 } from \"@kobalte/utils\";\nimport {\n createSignal,\n createUniqueId,\n splitProps as splitProps2\n} from \"solid-js\";\n\n// src/accordion/accordion-context.tsx\nimport { createContext as createContext2, useContext as useContext2 } from \"solid-js\";\nvar AccordionContext = createContext2();\nfunction useAccordionContext() {\n const context = useContext2(AccordionContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component\"\n );\n }\n return context;\n}\n\n// src/accordion/accordion-item.tsx\nfunction AccordionItem(props) {\n const accordionContext = useAccordionContext();\n const defaultId = `${accordionContext.generateId(\n \"item\"\n )}-${createUniqueId()}`;\n const mergedProps = mergeDefaultProps2(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps2(mergedProps, [\"value\", \"disabled\"]);\n const [triggerId, setTriggerId] = createSignal();\n const [contentId, setContentId] = createSignal();\n const selectionManager = () => accordionContext.listState().selectionManager();\n const isExpanded = () => {\n return selectionManager().isSelected(local.value);\n };\n const context = {\n value: () => local.value,\n triggerId,\n contentId,\n generateId: createGenerateId(() => others.id),\n registerTriggerId: createRegisterId(setTriggerId),\n registerContentId: createRegisterId(setContentId)\n };\n return <AccordionItemContext.Provider value={context}><CollapsibleRoot\n open={isExpanded()}\n disabled={local.disabled}\n {...others}\n /></AccordionItemContext.Provider>;\n}\n\n// src/accordion/accordion-root.tsx\nimport {\n composeEventHandlers,\n createGenerateId as createGenerateId2,\n mergeDefaultProps as mergeDefaultProps3,\n mergeRefs\n} from \"@kobalte/utils\";\nimport {\n createSignal as createSignal2,\n createUniqueId as createUniqueId2,\n splitProps as splitProps3\n} from \"solid-js\";\nfunction AccordionRoot(props) {\n let ref;\n const defaultId = `accordion-${createUniqueId2()}`;\n const mergedProps = mergeDefaultProps3(\n {\n id: defaultId,\n multiple: false,\n collapsible: false,\n shouldFocusWrap: true\n },\n props\n );\n const [local, others] = splitProps3(mergedProps, [\n \"id\",\n \"ref\",\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"multiple\",\n \"collapsible\",\n \"shouldFocusWrap\",\n \"onKeyDown\",\n \"onMouseDown\",\n \"onFocusIn\",\n // TODO: remove next breaking\n \"onFocusOut\"\n ]);\n const [items, setItems] = createSignal2([]);\n const { DomCollectionProvider } = createDomCollection({\n items,\n onItemsChange: setItems\n });\n const listState = createListState({\n selectedKeys: () => local.value,\n defaultSelectedKeys: () => local.defaultValue,\n onSelectionChange: (value) => local.onChange?.(Array.from(value)),\n disallowEmptySelection: () => !local.multiple && !local.collapsible,\n selectionMode: () => local.multiple ? \"multiple\" : \"single\",\n dataSource: items\n });\n listState.selectionManager().setFocusedKey(\"item-1\");\n const selectableList = createSelectableList(\n {\n selectionManager: () => listState.selectionManager(),\n collection: () => listState.collection(),\n disallowEmptySelection: () => listState.selectionManager().disallowEmptySelection(),\n shouldFocusWrap: () => local.shouldFocusWrap,\n disallowTypeAhead: true,\n allowsTabNavigation: true\n },\n () => ref\n );\n const context = {\n listState: () => listState,\n generateId: createGenerateId2(() => local.id)\n };\n return <DomCollectionProvider><AccordionContext.Provider value={context}><Polymorphic\n as=\"div\"\n id={local.id}\n ref={mergeRefs((el) => ref = el, local.ref)}\n onKeyDown={composeEventHandlers([\n local.onKeyDown,\n selectableList.onKeyDown\n ])}\n onMouseDown={composeEventHandlers([\n local.onMouseDown,\n selectableList.onMouseDown\n ])}\n onFocusIn={composeEventHandlers([\n local.onFocusIn\n // TODO: remove next breaking\n ])}\n onFocusOut={composeEventHandlers([\n local.onFocusOut,\n selectableList.onFocusOut\n ])}\n {...others}\n /></AccordionContext.Provider></DomCollectionProvider>;\n}\n\n// src/accordion/accordion-trigger.tsx\nimport {\n callHandler,\n composeEventHandlers as composeEventHandlers2,\n mergeDefaultProps as mergeDefaultProps4,\n mergeRefs as mergeRefs2\n} from \"@kobalte/utils\";\nimport {\n createEffect as createEffect2,\n onCleanup as onCleanup2,\n splitProps as splitProps4\n} from \"solid-js\";\nfunction AccordionTrigger(props) {\n let ref;\n const accordionContext = useAccordionContext();\n const itemContext = useAccordionItemContext();\n const collapsibleContext = useCollapsibleContext();\n const defaultId = itemContext.generateId(\"trigger\");\n const mergedProps = mergeDefaultProps4(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps4(mergedProps, [\n \"ref\",\n \"onPointerDown\",\n \"onPointerUp\",\n \"onClick\",\n \"onKeyDown\",\n \"onMouseDown\",\n \"onFocus\"\n ]);\n createDomCollectionItem({\n getItem: () => ({\n ref: () => ref,\n type: \"item\",\n key: itemContext.value(),\n textValue: \"\",\n // not applicable here\n disabled: collapsibleContext.disabled()\n })\n });\n const selectableItem = createSelectableItem(\n {\n key: () => itemContext.value(),\n selectionManager: () => accordionContext.listState().selectionManager(),\n disabled: () => collapsibleContext.disabled(),\n shouldSelectOnPressUp: true\n },\n () => ref\n );\n const onKeyDown = (e) => {\n if ([\"Enter\", \" \"].includes(e.key)) {\n e.preventDefault();\n }\n callHandler(e, local.onKeyDown);\n callHandler(e, selectableItem.onKeyDown);\n };\n createEffect2(() => onCleanup2(itemContext.registerTriggerId(others.id)));\n return <CollapsibleTrigger\n ref={mergeRefs2((el) => ref = el, local.ref)}\n data-key={selectableItem.dataKey()}\n onPointerDown={composeEventHandlers2([\n local.onPointerDown,\n selectableItem.onPointerDown\n ])}\n onPointerUp={composeEventHandlers2([\n local.onPointerUp,\n selectableItem.onPointerUp\n ])}\n onClick={composeEventHandlers2([local.onClick, selectableItem.onClick])}\n onKeyDown={onKeyDown}\n onMouseDown={composeEventHandlers2([\n local.onMouseDown,\n selectableItem.onMouseDown\n ])}\n onFocus={composeEventHandlers2([local.onFocus, selectableItem.onFocus])}\n {...others}\n />;\n}\n\n// src/accordion/index.tsx\nvar Accordion = Object.assign(AccordionRoot, {\n Content: AccordionContent,\n Header: AccordionHeader,\n Item: AccordionItem,\n Trigger: AccordionTrigger\n});\n\nexport {\n AccordionContent,\n AccordionHeader,\n useAccordionContext,\n AccordionItem,\n AccordionRoot,\n AccordionTrigger,\n Accordion,\n accordion_exports\n};\n","import { createMemo, Show, type Component } from \"solid-js\"\nimport { getChildSessions, getSessionInfo, getThreadTotals } from \"../../stores/sessions\"\nimport { formatTokenTotal } from \"../../lib/formatters\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { UsageMetricChips } from \"../usage-metric-chips\"\n\ninterface ContextUsagePanelProps {\n instanceId: string\n sessionId: string\n class?: string\n summary?: boolean\n expanded?: boolean\n}\n\nconst ContextUsagePanel: Component<ContextUsagePanelProps> = (props) => {\n const { t } = useI18n()\n const info = createMemo(() => getSessionInfo(props.instanceId, props.sessionId))\n const hasChildren = createMemo(() => getChildSessions(props.instanceId, props.sessionId).length > 0)\n const threadTotals = createMemo(() => getThreadTotals(props.instanceId, props.sessionId))\n const tokenMetric = (label: string, value = 0) => ({ label: t(`contextUsagePanel.labels.${label}`), value: formatTokenTotal(value), full: String(value) })\n const costMetric = (label: string, value: string) => ({ label: t(`contextUsagePanel.labels.${label}`), value, full: value })\n const sessionMetrics = createMemo(() => {\n const session = info()\n const cost = session?.cost ?? 0\n return [\n tokenMetric(\"input\", session?.inputTokens),\n tokenMetric(\"output\", session?.outputTokens),\n costMetric(\"cost\", session?.isSubscriptionModel ? t(\"contextUsagePanel.included\") : `$${(cost > 0 ? cost : 0).toFixed(2)}`),\n ]\n })\n const totalMetrics = createMemo(() => [\n tokenMetric(\"totalInput\", threadTotals()?.inputTokens),\n tokenMetric(\"totalOutput\", threadTotals()?.outputTokens),\n costMetric(\"totalCost\", `$${(threadTotals()?.cost ?? 0).toFixed(2)}`),\n tokenMetric(\"totalReasoning\", threadTotals()?.reasoningTokens),\n ])\n const metrics = () => props.expanded ? [sessionMetrics()[0], sessionMetrics()[1],\n { label: t(\"messageBlock.usage.reasoning\"), value: formatTokenTotal(info()?.reasoningTokens ?? 0), full: String(info()?.reasoningTokens ?? 0) },\n sessionMetrics()[2]] : sessionMetrics()\n const summaryLabel = () => metrics().map(metric => `${metric.label}: ${metric.full}`).join(\" · \")\n\n return (\n <Show when={props.summary} fallback={\n <Show when={hasChildren()}><div class={`session-context-panel status-token-group ${props.class ?? \"\"}`} data-token-group=\"thread\">\n <UsageMetricChips metrics={totalMetrics()} />\n </div></Show>\n }>\n <span class=\"status-token-summary\" data-expanded={props.expanded || undefined} title={summaryLabel()} aria-label={summaryLabel()}>\n <UsageMetricChips metrics={metrics()} />\n </span>\n </Show>\n )\n}\n\nexport default ContextUsagePanel\n","import { Popover } from \"@kobalte/core/popover\"\nimport { Info } from \"lucide-solid\"\nimport type { JSX } from \"solid-js\"\n\n/**\n * The shared \"i\" button: a short accessible name; Enter or Space opens its text, Escape closes it and returns focus\n * to the button. `label` and `children` may be catalogue text, which never passes through the i18n catalogue.\n */\nexport function InfoPopoverButton(props: { label: string; children: JSX.Element; class?: string }) {\n return (\n <Popover placement=\"top\" gutter={4}>\n <Popover.Trigger type=\"button\" class={`section-info-trigger ${props.class ?? \"\"}`} aria-label={props.label} title={props.label}>\n <Info class=\"section-info-icon\" aria-hidden=\"true\" />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content class=\"section-info-tooltip info-popover-content\">\n <div class=\"info-popover-text\">{props.children}</div>\n </Popover.Content>\n </Popover.Portal>\n </Popover>\n )\n}\n","import { For, Show } from \"solid-js\"\nimport type { OpenCodeConsoleUsage } from \"../../../../server/src/api-types-provider-usage\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { InfoPopoverButton } from \"../info-popover-button\"\n\nexport function ProviderUsageConsole(props: { usage: OpenCodeConsoleUsage }) {\n const { t, locale } = useI18n()\n const number = (value: number) => new Intl.NumberFormat(locale()).format(value)\n const usd = (value: number) => new Intl.NumberFormat(locale(), { style: \"currency\", currency: \"USD\" }).format(value)\n const reset = (time: number) => t(\"providerUsage.resets\", { time: new Date(time).toLocaleString(locale(), { dateStyle: \"short\", timeStyle: \"short\" }) })\n return <div class=\"space-y-3 text-[11px] text-primary\">\n <section>\n <div class=\"mb-1 flex items-center gap-1\">\n <h4 class=\"font-medium\">{t(\"providerUsage.console.requests\")}</h4>\n <InfoPopoverButton label={t(\"providerUsage.console.requests\")}>{t(\"providerUsage.console.info\")}</InfoPopoverButton>\n </div>\n <dl class=\"space-y-1\">\n <For each={[ [\"24h\", \"today\"], [\"7d\", \"sevenDays\"], [\"30d\", \"thirtyDays\"] ] as const}>{([range, label]) =>\n <div class=\"flex min-w-0 flex-wrap justify-between gap-x-2\"><dt>{t(`providerUsage.console.${label}`)}</dt><dd class=\"min-w-0 break-words font-medium tabular-nums\">{number(props.usage.requests[range])}</dd></div>\n }</For>\n </dl>\n </section>\n <section>\n <h4 class=\"mb-1 font-medium\">{t(\"providerUsage.console.models\")}</h4>\n <Show when={props.usage.models.length} fallback={<p class=\"text-secondary\">{t(\"providerUsage.console.noRequests\")}</p>}>\n <table class=\"w-full table-fixed text-start text-[11px]\">\n <thead><tr><For each={[\"model\", \"provider\", \"count\"]}>{key => <th scope=\"col\" class={key === \"count\" ? \"text-end font-medium\" : \"text-start font-medium\"}>{t(`providerUsage.console.${key}`)}</th>}</For></tr></thead>\n <tbody><For each={props.usage.models}>{row => <tr>\n <td class=\"align-top break-words pe-1\"><bdi>{row.model}</bdi></td>\n <td class=\"align-top break-words pe-1\"><bdi>{row.provider}</bdi></td>\n <td class=\"break-words align-top text-end tabular-nums\">{number(row.requests)}</td>\n </tr>}</For></tbody>\n </table>\n </Show>\n </section>\n <Show when={props.usage.budgets.status === \"unavailable\" || props.usage.budgets.items.length}>\n <section>\n <h4 class=\"mb-1 font-medium\">{t(\"providerUsage.console.budgets\")}</h4>\n <Show when={props.usage.budgets.status === \"available\"} fallback={<p class=\"text-secondary\">{t(\"providerUsage.console.budgetsUnavailable\")}</p>}>\n <ul class=\"space-y-2\"><For each={props.usage.budgets.items}>{item => <li>\n <div class=\"break-words\"><bdi>{item.name}</bdi> (<bdi>{item.id}</bdi>)</div>\n <div class=\"tabular-nums\">{usd(item.spentUsd)} / {usd(item.limitUsd)}</div>\n <div class=\"text-tertiary\">{reset(item.resetAt)}</div>\n </li>}</For></ul>\n </Show>\n </section>\n </Show>\n </div>\n}\n","import type { ProviderUsageResponse } from \"../../../../server/src/api-types\"\n\nexport interface ProviderUsageSource {\n instanceId: string\n sessionId: string\n directory: string\n providerId: string\n modelId: string\n}\n\nexport const providerUsageKey = (source: ProviderUsageSource) => JSON.stringify([\n source.instanceId, source.sessionId, source.directory, source.providerId, source.modelId,\n])\n\nexport const shouldShowProviderUsageWindow = (label: string, showCreditBalance: boolean) =>\n label !== \"credits_balance\" || showCreditBalance\n\nexport const isFreeUsageSource = (source: ProviderUsageSource | null) => {\n const model = source?.modelId.trim().toLowerCase()\n return source?.providerId.trim().toLowerCase() === \"opencode\" && Boolean(model && (model === \"big-pickle\" || model.endsWith(\"-free\")))\n}\n\nexport const nextUtcMidnight = (now: number) => {\n const date = new Date(now)\n return Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate() + 1)\n}\n\n// The display snapshot is local to the mounted panel. Do not restore a global\n// browser cache before the server can revalidate the native selected account.\nexport function createProviderUsageState(\n fetchUsage: (source: ProviderUsageSource) => Promise<ProviderUsageResponse>,\n publish: (value: ProviderUsageResponse | null | undefined) => void,\n now = Date.now,\n) {\n let current: ProviderUsageSource | null = null\n let generation = 0\n let day = Math.floor(now() / 86_400_000)\n let running: { generation: number; again: boolean; promise: Promise<void> } | null = null\n const invalidate = () => { generation++; running = null; publish(undefined) }\n const expireUtcDay = () => {\n const today = Math.floor(now() / 86_400_000)\n if (day === today) return\n day = today\n if (isFreeUsageSource(current)) publish(undefined)\n }\n const refresh = (): Promise<void> => {\n const source = current\n if (!source) return Promise.resolve()\n expireUtcDay()\n if (running) {\n running.again = true\n return running.promise\n }\n const request = { generation, again: false, promise: Promise.resolve() }\n running = request\n request.promise = (async () => {\n try {\n do {\n request.again = false\n const requestDay = day\n try {\n const value = await fetchUsage(source)\n if (generation === request.generation) {\n expireUtcDay()\n if (isFreeUsageSource(source) && requestDay !== day) request.again = true\n else if (!(value.freeEstimate && value.windows.daily?.resetAt && value.windows.daily.resetAt <= now())) publish(value)\n }\n } catch {\n if (generation === request.generation) publish(null)\n }\n } while (request.again && generation === request.generation)\n } finally {\n if (running === request) running = null\n }\n })()\n return request.promise\n }\n return {\n select(source: ProviderUsageSource | null) {\n if (source && current && providerUsageKey(source) === providerUsageKey(current)) return\n current = source\n invalidate()\n },\n invalidate,\n expireUtcDay,\n refresh,\n dispose() { current = null; generation++; running = null },\n }\n}\n","import { For, Show, createEffect, createMemo, createSignal, onCleanup, type Component } from \"solid-js\"\n\nimport type { ProviderUsageResponse, ProviderUsageWindow } from \"../../../../server/src/api-types\"\nimport { serverApi } from \"../../lib/api-client\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { openExternalUrl } from \"../../lib/external-url\"\nimport { useConfig } from \"../../stores/preferences\"\nimport { openSettings } from \"../../stores/settings-screen\"\nimport { InfoPopoverButton } from \"../info-popover-button\"\nimport { ProviderUsageConsole } from \"./provider-usage-console\"\nimport { serverEvents } from \"../../lib/server-events\"\nimport { createProviderUsageState, isFreeUsageSource, nextUtcMidnight, providerUsageKey, shouldShowProviderUsageWindow, type ProviderUsageSource } from \"./provider-usage-state\"\n\ninterface ProviderUsagePanelProps {\n instanceId: string\n sessionId: string\n directory: string\n active: boolean\n providerId: string\n modelId: string\n}\n\nconst REFRESH_INTERVAL_MS = 60_000\n\nconst ProviderUsagePanel: Component<ProviderUsagePanelProps> = (props) => {\n const { t, locale } = useI18n()\n const { preferences } = useConfig()\n const source = createMemo<ProviderUsageSource | null>(() => {\n if (!props.active) return null\n const providerId = props.providerId.trim()\n if (!providerId) return null\n const modelId = props.modelId.trim()\n return { instanceId: props.instanceId, sessionId: props.sessionId, directory: props.directory, providerId, modelId }\n }, null, { equals: (a, b) => a === b || Boolean(a && b && providerUsageKey(a) === providerUsageKey(b)) })\n const [usage, setUsage] = createSignal<ProviderUsageResponse | null | undefined>()\n const state = createProviderUsageState(current => serverApi.fetchProviderUsage(\n current.instanceId, current.sessionId, current.providerId, current.modelId,\n ), value => setUsage(value))\n\n createEffect(() => {\n state.select(source())\n void state.refresh()\n })\n\n const revalidate = () => { state.invalidate(); if (source()) void state.refresh() }\n const unsubscribeEvents = serverEvents.on(\"instance.event\", event => {\n if (event.type !== \"instance.event\" || event.instanceId !== props.instanceId) return\n if (event.event.type === \"provider.updated\") {\n // Catalogue churn is not a credential switch. Revalidate in place only\n // for this native location; account/config/connection boundaries below\n // still revoke the display immediately and fence pending reads.\n if (source() && (!event.event.location || event.event.location.directory === props.directory)) void state.refresh()\n } else if (event.event.type === \"session.step.failed\" && isFreeUsageSource(source()) &&\n (!event.event.location || event.event.location.directory === props.directory) &&\n (event.event.data as { error?: { type?: string } } | undefined)?.error?.type === \"provider.quota\") {\n void state.refresh()\n } else if ([\"credential.updated\", \"credential.switched\", \"integration.updated\", \"config.updated\", \"server.connected\"].includes(event.event.type)) revalidate()\n })\n let lastInstanceStatus: string | undefined\n let lastTransportStatus: string | undefined\n const unsubscribeStatus = serverEvents.on(\"instance.eventStatus\", event => {\n if (event.type !== \"instance.eventStatus\" || event.instanceId !== props.instanceId) return\n // Repeated status snapshots are not reconnects. Include the native stream\n // generation so a new connection still fences quotas if its loss was missed.\n const key = JSON.stringify([event.instanceId, event.status, event.generation])\n if (key === lastInstanceStatus) return\n lastInstanceStatus = key\n state.invalidate()\n if (event.status === \"connected\" && source()) void state.refresh()\n })\n const unsubscribeTransport = serverEvents.onTransportStatus(status => {\n if (status === lastTransportStatus) return\n lastTransportStatus = status\n state.invalidate()\n if (status === \"connected\" && source()) void state.refresh()\n })\n const refreshTimer = setInterval(() => { if (source()) void state.refresh() }, REFRESH_INTERVAL_MS)\n createEffect(() => {\n if (!isFreeUsageSource(source())) return\n let timer: ReturnType<typeof setTimeout>\n const schedule = () => {\n timer = setTimeout(() => { state.expireUtcDay(); void state.refresh(); schedule() }, nextUtcMidnight(Date.now()) - Date.now())\n }\n schedule()\n onCleanup(() => clearTimeout(timer))\n })\n onCleanup(() => {\n state.dispose()\n clearInterval(refreshTimer)\n unsubscribeEvents()\n unsubscribeStatus()\n unsubscribeTransport()\n })\n\n const entries = createMemo(() => Object.entries(usage()?.windows ?? {}))\n const displayedLabels = createMemo(() =>\n entries().map(([label]) => label).filter(label => shouldShowProviderUsageWindow(label, preferences().showProviderUsageCreditBalance)),\n )\n const hasReadings = createMemo(() => displayedLabels().length > 0 || Boolean(usage()?.console))\n const unavailableMessage = createMemo(() => {\n const data = usage()\n if (data?.freeEstimate && data.unavailableReason === \"opencode-console-missing-credential\") return t(\"providerUsage.freeConnect\")\n const consoleMessage = data ? consoleError(data) : undefined\n if (consoleMessage) return t(consoleMessage)\n if (data?.unavailableReason === \"openai-token-sharing-unsupported\") return t(\"providerUsage.openaiTokenSharingUnsupported\")\n if (data?.unavailableReason === \"opencode-go-key-expired\") return t(\"providerUsage.openCodeGoKeyExpired\")\n if (data?.unavailableReason === \"minimax-limits-not-shared\") return t(\"providerUsage.minimaxLimitsNotShared\")\n if (data?.unavailableReason === \"invalid-base-url\") return t(\"providerUsage.invalidBaseURL\")\n if (data?.unavailableReason === \"cursor-token-expired\") return t(\"providerUsage.cursorTokenExpired\")\n if (data?.unavailableReason === \"cursor-team-unavailable\") return t(\"providerUsage.cursorTeamUnavailable\")\n if (data?.unavailableReason === \"cursor-access-denied\") return t(\"providerUsage.cursorAccessDenied\")\n if (data?.unavailableReason === \"cursor-usage-unavailable\") return t(\"providerUsage.cursorUsageUnavailable\")\n if (data?.unavailableReason === \"provider-error\") return data.providerErrorCode && /^\\d{1,8}$/.test(data.providerErrorCode) && data.providerErrorCode.trim() === data.providerErrorCode\n ? t(\"providerUsage.providerErrorCode\", { code: data.providerErrorCode }) : t(\"providerUsage.unavailable\")\n return null\n })\n // Destinations and labels belong to the UI, never to upstream response text.\n const unavailableLink = createMemo(() => usage()?.unavailableReason === \"openai-token-sharing-unsupported\"\n && usage()?.unavailableAction === \"chatgpt-usage\"\n ? { href: \"https://chatgpt.com/settings/usage\", label: t(\"providerUsage.viewChatGPTUsage\") }\n : usage()?.unavailableReason === \"opencode-go-key-expired\" && usage()?.unavailableAction === \"opencode-go-new-key\"\n ? { href: \"https://opencode.ai/console/login\", label: t(\"providerUsage.createOpenCodeGoKey\") } : null)\n\n const windowLabel = (label: string): string => {\n // Model-scoped limits arrive as `window:Model`, e.g. `requests:gemini-2.5-pro` or `7d:Opus`.\n const scope = label.indexOf(\":\")\n if (scope > 0) return `${windowLabel(label.slice(0, scope))} · ${label.slice(scope + 1)}`\n const key = ({\n \"5h\": \"fiveHours\",\n \"7d\": \"sevenDays\",\n \"7d-sonnet\": \"sevenDaysSonnet\",\n \"7d-opus\": \"sevenDaysOpus\",\n weekly: \"weekly\",\n daily: \"daily\",\n monthly: \"monthly\",\n tokens: \"tokens\",\n input_tokens: \"inputTokens\",\n output_tokens: \"outputTokens\",\n usage: \"usage\",\n \"monthly-code\": \"monthlyCode\",\n credits: \"credits\",\n key_limit: \"keyLimit\",\n per_user_limit: \"perUserLimit\",\n team_limit: \"teamLimit\",\n requests: \"requests\",\n credits_balance: \"credits\",\n billing_cycle: \"billingCycle\",\n session: \"session\",\n premium: \"premium\",\n chat: \"chat\",\n completions: \"completions\",\n \"mcp-tools\": \"mcpTools\",\n } as Record<string, string>)[label]\n return key ? t(`providerUsage.windows.${key}`) : label\n }\n\n const usedValue = (key: string, value: string) => {\n const [before, after] = t(key).split(\"{used}\")\n return <>{before}<bdi dir=\"ltr\">{value}</bdi>{after}</>\n }\n\n const displayValue = (window: ProviderUsageWindow) => {\n const consumption = window.consumption\n const number = new Intl.NumberFormat(locale(), { maximumFractionDigits: 8 })\n const estimate = usage()?.freeEstimate\n if (estimate) return estimate.requests === null ? t(\"providerUsage.unavailableValue\")\n : <bdi dir=\"ltr\">{number.format(estimate.requests)} / {number.format(estimate.reference)}</bdi>\n if (consumption && \"used\" in consumption) return usedValue(\"providerUsage.usedCountOnly\", consumption.limit === undefined\n ? number.format(consumption.used) : `${number.format(consumption.used)} / ${number.format(consumption.limit)}`)\n if (consumption && \"creditsUsed\" in consumption) return usedValue(\"providerUsage.creditsUsed\", number.format(consumption.creditsUsed))\n if (consumption && \"unlimited\" in consumption) return t(\"providerUsage.unlimited\")\n if (window.limitUSD !== undefined) return <bdi dir=\"ltr\">{new Intl.NumberFormat(locale(), { style: \"currency\", currency: \"USD\" }).format(window.limitUSD)}</bdi>\n if (window.balanceUSD) {\n const money = new Intl.NumberFormat(locale(), { style: \"currency\", currency: \"USD\" })\n // Currency formatters may include RTL marks; isolate each amount as well as the ratio.\n return <bdi dir=\"ltr\"><bdi dir=\"ltr\">{money.format(window.balanceUSD.remaining)}</bdi>\n <Show when={window.balanceUSD.total !== undefined}>{\" / \"}<bdi dir=\"ltr\">{money.format(window.balanceUSD.total!)}</bdi></Show>\n </bdi>\n }\n if (window.valueLabel) return <bdi dir=\"ltr\">{window.valueLabel}</bdi>\n if (window.usedPercent === null) return t(\"providerUsage.unavailableValue\")\n return t(\"providerUsage.usedPercent\", { percent: new Intl.NumberFormat(locale()).format(Math.round(window.usedPercent)) })\n }\n\n const resetLabel = (resetAt: number | null) => {\n if (!resetAt) return null\n const date = new Date(resetAt)\n if (!Number.isFinite(date.getTime())) return null\n const estimated = usage()?.estimated\n const time = date.toLocaleString(locale(), { dateStyle: \"short\", timeStyle: \"short\", ...(estimated ? { timeZone: \"UTC\" } : {}) })\n return t(estimated ? \"providerUsage.estimatedReset\" : \"providerUsage.resets\", { time: estimated ? `${time} UTC` : time })\n }\n\n const barColor = (percent: number | null) => {\n if (percent !== null && percent >= 80) return \"var(--status-error)\"\n if (percent !== null && percent >= 50) return \"var(--status-warning)\"\n return \"var(--status-success)\"\n }\n\n return (\n <div>\n <Show when={usage() !== undefined} fallback={<div role=\"status\" class=\"right-panel-empty-text\">{t(\"providerUsage.loading\")}</div>}>\n <Show when={usage()} fallback={<div role=\"status\" class=\"right-panel-empty-text\">{t(\"providerUsage.unavailable\")}</div>}>\n {(data) => (\n <Show\n when={data().supported && data().configured && data().ok && !unavailableMessage() && hasReadings()}\n fallback={\n <Show when={unavailableMessage()} fallback={<div role=\"status\" class=\"right-panel-empty-text\">\n {t(\n !data().supported\n ? \"providerUsage.unsupported\"\n : !data().configured\n ? \"providerUsage.notConfigured\"\n : \"providerUsage.unavailable\",\n )}\n </div>}>\n {message => <div role=\"status\" class=\"space-y-2 border border-base bg-surface-inset p-2 text-xs text-primary\">\n <div>{message()}</div>\n <Show when={unavailableLink()}>{link => <a href={link().href} target=\"_blank\" rel=\"noopener noreferrer\"\n class=\"text-accent underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent-primary)]\"\n onClick={event => { event.preventDefault(); void openExternalUrl(link().href, \"provider-usage\") }}>\n {link().label}\n </a>}</Show>\n <Show when={[\"opencode-console-missing-credential\", \"opencode-console-access-denied\", \"opencode-console-invalid-credential\"].includes(data().unavailableReason ?? \"\")}>\n <button type=\"button\" class=\"window-action mt-1\" onClick={() => void openSettings(\"providers\")}>{t(\"providerUsage.console.settings\")}</button>\n </Show>\n </div>}\n </Show>\n }\n >\n <div class=\"space-y-2\">\n <Show when={data().console}>{console => <ProviderUsageConsole usage={console()} />}</Show>\n <Show when={data().estimated}>\n <div class=\"flex items-center gap-1 text-[10px] text-tertiary\">\n <span>{t(\"providerUsage.estimated\")}</span>\n <InfoPopoverButton label={t(\"providerUsage.estimated\")}>{t(\"providerUsage.estimateInfo\")}</InfoPopoverButton>\n <Show when={data().freeEstimate?.exhausted}><span role=\"status\" class=\"font-medium text-primary\">{t(\"providerUsage.exhausted\")}</span></Show>\n </div>\n </Show>\n <For each={displayedLabels()}>\n {(label) => {\n // Retain this row's value until For reconciles a removed\n // label; its effects must not read an absent window.\n const window = createMemo<ProviderUsageWindow>(previous => usage()?.windows[label] ?? previous, usage()!.windows[label])\n const usedPercent = () => label === \"daily\" && usage()?.freeEstimate?.exhausted ? 100 : window().usedPercent\n return (\n <div>\n <div class=\"mb-1 flex flex-wrap items-baseline justify-between gap-x-2 gap-y-1 text-[11px] text-primary\">\n <span class=\"max-w-full shrink-0 font-medium\">{windowLabel(label)}</span>\n <div class=\"ms-auto flex min-w-0 max-w-full flex-wrap items-baseline justify-end gap-1.5 text-end\">\n <span class=\"min-w-0 font-medium [overflow-wrap:anywhere]\">{displayValue(window())}</span>\n <Show when={resetLabel(window().resetAt)}>\n {(reset) => (\n <>\n <span class=\"text-tertiary\" aria-hidden=\"true\">·</span>\n <span class=\"truncate text-[10px] text-tertiary\">{reset()}</span>\n </>\n )}\n </Show>\n </div>\n </div>\n <Show when={usedPercent() !== null}>\n <div class=\"h-2 overflow-hidden border border-base\" style={{ \"background-color\": \"var(--surface-inset)\" }}>\n <div\n class=\"h-full transition-[width] duration-300\"\n style={{ width: `${Math.max(0, Math.min(100, usedPercent() ?? 0))}%`, \"background-color\": barColor(usedPercent()) }}\n role=\"progressbar\"\n aria-label={t(\"providerUsage.progressLabel\", { window: windowLabel(label) })}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(usedPercent() ?? 0)}\n />\n </div>\n </Show>\n </div>\n )\n }}\n </For>\n </div>\n </Show>\n )}\n </Show>\n </Show>\n <Show when={usage()?.supported && usage()?.configured && usage()?.ok && !unavailableMessage() && hasReadings()}>\n <div class=\"mt-2 truncate text-right text-sm font-semibold text-secondary\">\n {usage()?.providerName ?? props.providerId}\n <Show when={usage()?.copilotPlan}>{plan => ` · ${t(`providerUsage.copilotPlans.${plan()}`)}`}</Show>\n </div>\n </Show>\n </div>\n )\n}\n\nexport default ProviderUsagePanel\n\nfunction consoleError(data: ProviderUsageResponse) {\n return ({\n \"opencode-console-missing-credential\": \"providerUsage.console.missingCredential\",\n \"opencode-console-access-denied\": \"providerUsage.console.accessDenied\",\n \"opencode-console-invalid-credential\": \"providerUsage.console.invalidCredential\",\n \"opencode-console-invalid-response\": \"providerUsage.console.malformed\",\n \"opencode-console-network-error\": \"providerUsage.console.network\",\n } as Record<string, string>)[data.unavailableReason ?? \"\"]\n}\n","import { z } from \"zod\"\n\n// OpenCode's built-in `/goal` plugin (`@opencode/schema/goal`; dev-docs/OPENCODE_COMPATIBILITY.md, Session goal):\n// `get({ sessionID })` answers the Session's own goal or null, every write publishes\n// `changed` in the Session's Location, and `/goal pause|resume|clear` change it.\nexport const GOAL_RPC_ID = \"opencode.goal\"\nexport const GOAL_CHANGED_EVENT = \"rpc.opencode.goal.changed\"\nexport const GOAL_COMMAND = \"goal\"\nexport type GoalCommandAction = \"pause\" | \"resume\" | \"clear\"\n\n// Only the displayed fields; unknown fields are dropped. Bounds sit far above the\n// plugin's own (4,000-character objectives) and reject only malformed answers.\nexport const goalStateSchema = z.object({\n id: z.string().min(1).max(256),\n objective: z.string().max(64 * 1024),\n status: z.enum([\"active\", \"paused\", \"complete\"]),\n reason: z.string().max(16 * 1024).optional(),\n rounds: z.number().int().nonnegative(),\n maxRounds: z.number().int().nonnegative(),\n updatedAt: z.number(),\n})\nexport type GoalState = z.infer<typeof goalStateSchema>\n\nexport const goalChangedSchema = z.object({ sessionID: z.string().min(1).max(512), goal: goalStateSchema.nullable() })\n\n/** `GET /api/workspaces/:id/sessions/:sessionId/goal`: `unsupported` without the RPC, `unavailable` on any other failure. */\nexport type SessionGoalResponse = { status: \"goal\"; goal: GoalState | null } | { status: \"unsupported\" } | { status: \"unavailable\" }\n","import { createSignal, untrack } from \"solid-js\"\nimport { goalChangedSchema, goalStateSchema, type SessionGoalResponse } from \"../../../server/src/opencode/goal-contract\"\n\n/** A Session's `/goal` as last heard: `loading` until the first answer. */\nexport type SessionGoalSnapshot = { status: \"loading\" } | SessionGoalResponse\n\nconst LOADING: SessionGoalSnapshot = { status: \"loading\" }\n\ninterface Entry {\n demand: number\n /** Bumped by every published change; a read dispatched before it is older. */\n version: number\n reading?: { dirty: boolean; promise: Promise<void>; controller: AbortController }\n}\n\n/**\n * Goals of the Sessions the Status tab shows, keyed by instance and Session.\n * Demand (a mounted goal line) reads; `changed` events and the line's own\n * commands keep it current, reconnects re-read what is shown. One read runs per\n * demanded Session with at most one trailing follow-up, and an answer is\n * published only when no change was heard since it was requested. Releasing the\n * last demand aborts the Session's queued or running read, so switching sessions\n * never queues reads for hidden ones; the next demand reads again. A failed read\n * keeps the last goal shown. Nothing reads on a timer.\n */\nexport function createSessionGoalStore(read: (instanceId: string, sessionId: string, signal: AbortSignal) => Promise<SessionGoalResponse>) {\n const [snapshots, setSnapshots] = createSignal<ReadonlyMap<string, SessionGoalSnapshot>>(new Map())\n const [busy, setBusy] = createSignal<ReadonlySet<string>>(new Set())\n const entries = new Map<string, Entry>()\n const key = (instanceId: string, sessionId: string) => `${instanceId}\\0${sessionId}`\n const publish = (stateKey: string, snapshot: SessionGoalSnapshot) => setSnapshots(current => new Map(current).set(stateKey, snapshot))\n const cancel = (entry: Entry | undefined) => {\n const reading = entry?.reading\n if (!reading) return\n entry.reading = undefined\n reading.controller.abort()\n }\n\n const refresh = (instanceId: string, sessionId: string): Promise<void> => {\n const stateKey = key(instanceId, sessionId)\n const entry = entries.get(stateKey)\n if (!entry || entry.demand === 0) return Promise.resolve()\n if (entry.reading) {\n entry.reading.dirty = true\n return entry.reading.promise\n }\n const reading = { dirty: false, promise: Promise.resolve(), controller: new AbortController() }\n const { signal } = reading.controller\n entry.reading = reading\n reading.promise = (async () => {\n try {\n do {\n reading.dirty = false\n const version = entry.version\n const answer = await read(instanceId, sessionId, signal).catch((): SessionGoalResponse => ({ status: \"unavailable\" }))\n if (signal.aborted) return\n if (entries.get(stateKey) !== entry || entry.version !== version) continue\n const shown = untrack(snapshots).get(stateKey)\n if (answer?.status === \"goal\" || answer?.status === \"unsupported\") publish(stateKey, answer)\n else if (shown?.status !== \"goal\") publish(stateKey, { status: \"unavailable\" })\n } while (reading.dirty && entries.get(stateKey) === entry && entry.demand > 0)\n } finally {\n if (entry.reading === reading) entry.reading = undefined\n }\n })()\n return reading.promise\n }\n\n return {\n state(instanceId: string, sessionId: string): SessionGoalSnapshot {\n return snapshots().get(key(instanceId, sessionId)) ?? LOADING\n },\n busy(instanceId: string, sessionId: string): boolean {\n return busy().has(key(instanceId, sessionId))\n },\n /** Reads now and tracks the Session until the returned release, whose last call aborts its read. */\n demand(instanceId: string, sessionId: string): () => void {\n const stateKey = key(instanceId, sessionId)\n let entry = entries.get(stateKey)\n if (!entry) entries.set(stateKey, entry = { demand: 0, version: 0 })\n const tracked = entry\n tracked.demand += 1\n void refresh(instanceId, sessionId)\n let released = false\n return () => {\n if (released) return\n released = true\n tracked.demand -= 1\n if (tracked.demand === 0) cancel(tracked)\n }\n },\n refresh,\n /** Re-reads the demanded Sessions (of one instance), after a reconnect missed changes. */\n refreshDemanded(instanceId?: string): Promise<void> {\n return Promise.all(Array.from(entries, ([stateKey, entry]) => {\n const [owner, sessionId] = stateKey.split(\"\\0\") as [string, string]\n return entry.demand > 0 && (instanceId === undefined || owner === instanceId) ? refresh(owner, sessionId) : undefined\n })).then(() => undefined)\n },\n /** `rpc.opencode.goal.changed`: the new value of a tracked Session's goal. */\n applyChanged(instanceId: string, data: unknown): void {\n const sessionId = goalChangedSchema.shape.sessionID.safeParse((data as { sessionID?: unknown } | null)?.sessionID)\n if (!sessionId.success) return\n const stateKey = key(instanceId, sessionId.data)\n const entry = entries.get(stateKey)\n if (!entry) return\n const goal = goalStateSchema.nullable().safeParse((data as { goal?: unknown }).goal)\n // A change this client cannot read is still a change: ask for the value\n // (a hidden Session reads on its next demand).\n if (!goal.success) return void refresh(instanceId, sessionId.data)\n entry.version += 1\n publish(stateKey, { status: \"goal\", goal: goal.data })\n },\n forget(instanceId: string, sessionId: string): void {\n const stateKey = key(instanceId, sessionId)\n cancel(entries.get(stateKey))\n entries.delete(stateKey)\n setSnapshots(current => {\n if (!current.has(stateKey)) return current\n const next = new Map(current)\n next.delete(stateKey)\n return next\n })\n },\n clearInstance(instanceId: string): void {\n const prefix = `${instanceId}\\0`\n for (const [stateKey, entry] of [...entries]) {\n if (!stateKey.startsWith(prefix)) continue\n cancel(entry)\n entries.delete(stateKey)\n }\n setSnapshots(current => new Map([...current].filter(([stateKey]) => !stateKey.startsWith(prefix))))\n },\n /** Runs one command for the Session (refusing a second meanwhile), then reads its outcome while it is shown. */\n async run(instanceId: string, sessionId: string, command: () => Promise<void>): Promise<void> {\n const stateKey = key(instanceId, sessionId)\n if (untrack(busy).has(stateKey)) return\n setBusy(current => new Set(current).add(stateKey))\n try {\n await command()\n } finally {\n setBusy(current => {\n const next = new Set(current)\n next.delete(stateKey)\n return next\n })\n void refresh(instanceId, sessionId)\n }\n },\n }\n}\n\nexport type SessionGoalStore = ReturnType<typeof createSessionGoalStore>\n","import { GOAL_CHANGED_EVENT, GOAL_COMMAND, type GoalCommandAction } from \"../../../server/src/opencode/goal-contract\"\nimport { serverApi } from \"../lib/api-client\"\nimport { createEventRefreshScheduler } from \"../lib/event-refresh-scheduler\"\nimport { tGlobal } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { getOpencodeErrorMessage } from \"../lib/opencode-api\"\nimport { serverEvents } from \"../lib/server-events\"\nimport { executeCustomCommand } from \"./session-actions\"\nimport { createSessionGoalStore } from \"./session-goal-store\"\n\n// The signal leaves the shared background budget's queue or aborts the request once the Session is hidden.\nexport const sessionGoals = createSessionGoalStore((instanceId, sessionId, signal) => serverApi.fetchSessionGoal(instanceId, sessionId, signal))\n\n// Changes published while the stream was down are lost: re-read what is shown.\nconst reconnects = createEventRefreshScheduler(instanceId => sessionGoals.refreshDemanded(instanceId))\n\nserverEvents.on(\"instance.event\", (event) => {\n if (event.type !== \"instance.event\") return\n const native = event.event as { type: string; data?: { sessionID?: unknown } }\n if (native.type === GOAL_CHANGED_EVENT) sessionGoals.applyChanged(event.instanceId, native.data)\n else if (native.type === \"session.deleted\" && typeof native.data?.sessionID === \"string\") sessionGoals.forget(event.instanceId, native.data.sessionID)\n else if (native.type === \"server.connected\") reconnects.schedule(event.instanceId, \"urgent\")\n else if (native.type === \"plugin.updated\") reconnects.schedule(event.instanceId, \"urgent\")\n})\n\nserverEvents.on(\"instance.eventStatus\", (event) => {\n if (event.type === \"instance.eventStatus\" && event.status === \"connected\") reconnects.schedule(event.instanceId, \"urgent\")\n})\n\nserverEvents.onOpen(() => void sessionGoals.refreshDemanded())\n\nserverEvents.on(\"workspace.stopped\", (event) => {\n if (event.type !== \"workspace.stopped\") return\n reconnects.cancel(event.workspaceId)\n sessionGoals.clearInstance(event.workspaceId)\n})\n\n/** `/goal pause|resume|clear` for the Session through the composer's command path; failures show a notice. */\nexport function runSessionGoalCommand(instanceId: string, sessionId: string, action: GoalCommandAction): Promise<void> {\n return sessionGoals.run(instanceId, sessionId, async () => {\n try {\n await executeCustomCommand(instanceId, sessionId, GOAL_COMMAND, action)\n } catch (error) {\n showToastNotification({ category: \"sessions\", title: tGlobal(\"instanceShell.goal.error\"),\n message: getOpencodeErrorMessage(error, tGlobal(\"instanceShell.goal.error\")), variant: \"error\" })\n }\n })\n}\n","import { Show, createEffect, createMemo, createUniqueId, onCleanup, type Component } from \"solid-js\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport { Pause, Play, Trash2 } from \"lucide-solid\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { TOOL_OUTPUT_RENDER_CHARACTER_LIMIT, getRenderTextWindow } from \"../../lib/render-text-window\"\nimport { runSessionGoalCommand, sessionGoals } from \"../../stores/session-goal\"\n\ninterface SessionGoalLineProps {\n instanceId: string\n sessionId: string\n /** The Status tab is shown: read and track the Session's goal. */\n active: boolean\n}\n\n// Plain text in one line and a tooltip, bounded like other plain text blocks\n// (dev-docs/TEXT_DISPLAY_BOUNDS.md); the plugin itself caps objectives far below.\nfunction boundedText(text: string): string {\n const window = getRenderTextWindow(text, TOOL_OUTPUT_RENDER_CHARACTER_LIMIT)\n return window.hidden > 0 ? `${window.text}…` : window.text\n}\n\n/** The shown Session's `/goal` on one line above the Status sections; nothing without a goal. */\nconst SessionGoalLine: Component<SessionGoalLineProps> = (props) => {\n const { t } = useI18n()\n const reasonId = createUniqueId()\n createEffect(() => {\n if (!props.active) return\n onCleanup(sessionGoals.demand(props.instanceId, props.sessionId))\n })\n const goal = createMemo(() => {\n const snapshot = sessionGoals.state(props.instanceId, props.sessionId)\n return snapshot.status === \"goal\" ? snapshot.goal : null\n })\n const busy = () => sessionGoals.busy(props.instanceId, props.sessionId)\n // Busy actions stay focusable (`aria-disabled`, activation ignored): a disabled\n // focused button would hand keyboard focus to the page while its command runs.\n const run = (action: \"pause\" | \"resume\" | \"clear\") => {\n if (!busy()) void runSessionGoalCommand(props.instanceId, props.sessionId, action)\n }\n\n return (\n <Show when={goal()}>\n {(current) => {\n const objective = createMemo(() => boundedText(current().objective))\n const reason = createMemo(() => current().reason ? boundedText(current().reason!) : \"\")\n const rounds = () => t(\"instanceShell.goal.rounds\", { rounds: current().rounds, max: current().maxRounds })\n // One control for Pause and Resume keeps keyboard focus when the status flips.\n const toggleLabel = () => t(current().status === \"paused\" ? \"instanceShell.goal.actions.resume\" : \"instanceShell.goal.actions.pause\")\n return (\n <div class=\"session-goal-line\" role=\"group\" aria-label={t(\"instanceShell.goal.label\")}\n aria-describedby={reason() ? reasonId : undefined} aria-busy={busy()} data-status={current().status}>\n <Tooltip placement=\"bottom-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" class=\"session-goal-summary\">\n <span class=\"session-goal-badge\" data-status={current().status}>{t(`instanceShell.goal.status.${current().status}`)}</span>\n <span class=\"session-goal-objective\"><bdi>{objective()}</bdi></span>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content class=\"section-info-tooltip session-goal-tooltip\">\n <p><bdi>{objective()}</bdi></p>\n <Show when={reason()}><p class=\"session-goal-tooltip-reason\"><bdi>{reason()}</bdi></p></Show>\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip>\n <Show when={reason()}><span id={reasonId} class=\"sr-only\">{reason()}</span></Show>\n <span class=\"session-goal-rounds\" title={rounds()}>\n <span aria-hidden=\"true\">{current().rounds}/{current().maxRounds}</span>\n <span class=\"sr-only\">{rounds()}</span>\n </span>\n <Show when={current().status !== \"complete\"}>\n <button type=\"button\" class=\"window-icon-button\" aria-label={toggleLabel()} title={toggleLabel()} aria-disabled={busy()}\n onClick={() => run(current().status === \"paused\" ? \"resume\" : \"pause\")}>\n <Show when={current().status === \"paused\"} fallback={<Pause aria-hidden=\"true\" />}><Play aria-hidden=\"true\" /></Show>\n </button>\n </Show>\n <button type=\"button\" class=\"window-icon-button\" aria-label={t(\"instanceShell.goal.actions.clear\")}\n title={t(\"instanceShell.goal.actions.clear\")} aria-disabled={busy()} onClick={() => run(\"clear\")}>\n <Trash2 aria-hidden=\"true\" />\n </button>\n </div>\n )\n }}\n </Show>\n )\n}\n\nexport default SessionGoalLine\n","import type { IntegrationBindingResponse, IntegrationHostOffer, IntegrationView } from \"../../../server/src/integration-types\"\n\ntype Entry = Pick<IntegrationView, \"family\" | \"state\" | \"status\">\n\n/** The displayed conversation's attachment, shown by a native integration's Plugins row. */\nexport type IntegrationLink = IntegrationBindingResponse\n\n/** A Plugins row's indicator: shown only when the application part needs an action. */\nexport type IntegrationAttention = \"hostAbsent\" | \"hostOutdated\" | \"incompatible\"\n\n/** The connection state of the row menu's information line. */\nexport type IntegrationConnection =\n | { state: \"offers\"; count: number }\n | { state: \"noOffer\" | \"hostClosed\" | \"unsupported\" | \"detected\" | \"absent\" | \"connected\" | \"disconnected\" | \"unknown\" }\n\nconst loadedNative = (entry: Entry) => entry.family === \"native\" && entry.state === \"ok\"\n\n/**\n * The link state of a loaded native integration for the displayed conversation: none without a conversation,\n * else the integration's own per-conversation read. Other families and unloaded integrations have no link.\n */\nexport function integrationLink(entry: Entry, binding: IntegrationBindingResponse | undefined): IntegrationLink | undefined {\n if (!loadedNative(entry) || entry.status?.host?.state === \"unsupported\") return undefined\n return binding ?? { state: \"none\" }\n}\n\nexport function integrationAttention(entry: Entry): IntegrationAttention | undefined {\n if (!loadedNative(entry)) return undefined\n const host = entry.status?.host?.state\n return host === \"absent\" ? \"hostAbsent\" : host === \"outdated\" ? \"hostOutdated\" : host === \"incompatible\" ? \"incompatible\" : undefined\n}\n\nexport function integrationConnection(entry: Entry): IntegrationConnection {\n if (entry.state !== \"ok\") return { state: \"unknown\" }\n const connection = entry.status?.connection\n if (entry.family === \"native\") {\n const host = entry.status?.host?.state\n if (host === \"unsupported\") return { state: \"unsupported\" }\n const offers = connection?.offers ?? 0\n if (offers > 0) return { state: \"offers\", count: offers }\n return { state: host === \"unknown\" ? \"hostClosed\" : \"noOffer\" }\n }\n if (entry.family === \"vendor-mcp\") return { state: connection?.state === \"connected\" ? \"detected\" : \"absent\" }\n return { state: connection?.state === \"connected\" ? \"connected\" : \"disconnected\" }\n}\n\n/** The i18n key and variables of a connection line. */\nexport function integrationConnectionMessage(connection: IntegrationConnection, app: string): [string, Record<string, string | number>] {\n if (connection.state === \"offers\") return [`integrations.connection.offers.${connection.count === 1 ? \"one\" : \"other\"}`, { app, count: connection.count }]\n return [`integrations.connection.${connection.state}`, { app }]\n}\n\n/** What the chain button does: detach, attach, or nothing with a reason shown instead. */\nexport type IntegrationChainAction = \"detach\" | \"attach\" | \"unavailable\"\n\nexport function integrationChainAction(link: IntegrationLink, unavailable: string | undefined): IntegrationChainAction {\n return link.state === \"attached\" ? \"detach\" : unavailable ? \"unavailable\" : \"attach\"\n}\n\n/** After reading the open documents: attach the only compatible one, choose between several, or none. */\nexport type IntegrationAttachChoice = { kind: \"attach\"; offerID: string } | { kind: \"choose\"; offers: IntegrationHostOffer[] } | { kind: \"none\" }\n\nexport function integrationAttachChoice(offers: readonly IntegrationHostOffer[]): IntegrationAttachChoice {\n const compatible = offers.filter(offer => offer.protocol === \"ok\")\n if (compatible.length === 0) return { kind: \"none\" }\n return compatible.length === 1 ? { kind: \"attach\", offerID: compatible[0]!.offerID } : { kind: \"choose\", offers: compatible }\n}\n\n/** The catalogue summary in the current language, else English. */\nexport function integrationSummary(entry: Pick<IntegrationView, \"summary\">, locale: string): string {\n return entry.summary[locale] ?? entry.summary[locale.split(\"-\")[0]!] ?? entry.summary.en ?? Object.values(entry.summary)[0] ?? \"\"\n}\n","import type {\n PluginActivationControl,\n PluginConfiguredSource,\n PluginControlScope,\n PluginControlsSnapshot,\n PluginRuntimeSource,\n} from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\n\n/** An integration's plugin as the plugin-controls snapshot shows it, found through the view's safe correlations. */\nexport interface IntegrationPlugin {\n /** Its declarations, in snapshot order. */\n sources: PluginConfiguredSource[]\n /** The activation control of its plugin, when a declaration loaded it or a rule names it. */\n control?: PluginActivationControl\n /** Its package as the runtime inventory reports it, for the native check/update action. */\n source?: PluginRuntimeSource\n}\n\nexport function integrationPlugin(snapshot: PluginControlsSnapshot | undefined,\n entry: Pick<IntegrationView, \"configuredSources\" | \"configuredRules\">): IntegrationPlugin {\n if (!snapshot) return { sources: [] }\n // Independent reads can reuse an index for another plugin. Only the same verified writable document joins them.\n const correlated = (item: { scope: string; path?: string; entryIndex: number },\n list: readonly { scope: PluginControlScope; entryIndex: number; expectedRevision?: string }[]) =>\n list.some(association => association.scope === item.scope && association.entryIndex === item.entryIndex\n && typeof association.expectedRevision === \"string\" && association.expectedRevision.length > 0\n && snapshot.targets.some(target => target.scope === item.scope && target.path === item.path\n && target.expectedRevision === association.expectedRevision))\n const sources = snapshot.configured.sources.filter(source => correlated(source, entry.configuredSources))\n const ids = new Set([\n ...sources.flatMap(source => source.pluginId ? [source.pluginId] : []),\n ...snapshot.configured.rules.filter(rule => correlated(rule, entry.configuredRules ?? [])).map(rule => rule.selector),\n ])\n // Two plugin IDs cannot both be this integration's: leave the switches out rather than guess.\n const control = ids.size === 1 ? snapshot.controls.find(candidate => candidate.id === [...ids][0]) : undefined\n const targets = new Set(sources.map(source => source.target))\n const source = control?.runtime?.source\n ?? snapshot.runtime.find(item => item.source.type === \"package\" && targets.has(item.source.target))?.source\n return { sources, ...(control ? { control } : {}), ...(source ? { source } : {}) }\n}\n\n/** Read-only row identity for inherited, virtual or runtime-only plugins; writable correlations stay separate. */\nexport function integrationDisplayPlugin(snapshot: PluginControlsSnapshot | undefined,\n entry: Pick<IntegrationView, \"configuredSources\" | \"configuredRules\" | \"plugin\" | \"ambiguous\">): IntegrationPlugin {\n if (entry.ambiguous) return { sources: [] }\n const configured = integrationPlugin(snapshot, entry)\n if (configured.control || configured.sources.length || !snapshot || !entry.plugin.runtimeId) return configured\n const matches = snapshot.runtime.filter(runtime => runtime.id === entry.plugin.runtimeId)\n if (matches.length !== 1) return configured\n const runtime = matches[0]!\n const controls = snapshot.controls.filter(control => control.id === runtime.id && control.runtime?.key === runtime.key)\n return { sources: [], ...(controls.length === 1 ? { control: controls[0] } : {}), source: runtime.source }\n}\n","import type { IntegrationsResponse, IntegrationHostsResponse, IntegrationAttachResponse, IntegrationDetachResponse, IntegrationInstallHostResponse, IntegrationBindingResponse } from \"../../../server/src/integration-types\"\nimport type { PluginControlScope } from \"../../../server/src/api-types\"\nimport type { PluginSourceMutationResponse } from \"../../../server/src/plugin-source-types\"\nimport type { IntegrationBindingTarget } from \"../stores/integration-bindings-store\"\nimport { CODENOMAD_API_BASE as API_BASE } from \"./api-base\"\nimport { authenticatedFetch } from \"./auth-recovery\"\nimport { backgroundReads } from \"./background-read-queue\"\nimport { HttpResponseError } from \"./retryable-file-search\"\n\n/** The catalog integrations of one Location (`GET /api/workspaces/:id/integrations`), in the shared background budget. */\nexport function fetchIntegrations(instanceId: string, directory: string, signal: AbortSignal): Promise<IntegrationsResponse> {\n const path = `/api/workspaces/${encodeURIComponent(instanceId)}/integrations?${new URLSearchParams({ directory })}`\n return backgroundReads.run(signal, async () => {\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, { signal, credentials: \"include\" })\n if (!response.ok) throw new HttpResponseError(`Request failed with ${response.status}`, response.status, response.headers.get(\"Retry-After\"))\n const value = await response.json()\n if (!value || !Array.isArray(value.integrations) || !value.catalog || ![\"fresh\", \"stale\", \"unavailable\"].includes(value.catalog.state)) {\n throw new Error(\"Invalid integration response\")\n }\n return value as IntegrationsResponse\n }, \"visible\")\n}\n\n/** Projected per-session binding only; transport failures revoke authority without exposing native diagnostics. */\nexport function fetchIntegrationBinding(target: IntegrationBindingTarget, signal: AbortSignal): Promise<IntegrationBindingResponse> {\n return backgroundReads.run(signal, async () => {\n const path = `/api/workspaces/${encodeURIComponent(target.instanceId)}/integrations/${encodeURIComponent(target.integrationId)}/binding?${new URLSearchParams({ directory: target.directory, sessionID: target.sessionID })}`\n try {\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, { signal, credentials: \"include\", cache: \"no-store\" })\n if (!response.ok) return { state: \"unknown\" }\n const value = await response.json()\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return { state: \"unknown\" }\n const keys = Object.keys(value)\n if (keys.length === 1 && (value.state === \"none\" || value.state === \"unknown\")) return { state: value.state }\n if (keys.length === 2 && keys.includes(\"label\") && value.state === \"attached\" && typeof value.label === \"string\"\n && [...value.label].length > 0 && [...value.label].length <= 120 && !/[/\\\\\\p{Cc}]/u.test(value.label)) return { state: \"attached\", label: value.label }\n } catch { /* A failed authority read is unknown; never retain a previous attachment. */ }\n return { state: \"unknown\" }\n }, \"visible\")\n}\n\n/**\n * Installs a catalog integration by ID (`POST …/integrations/:id/install`): the server builds the spec from its\n * catalog. Sent once; a lost or refused answer is an uncertain outcome the caller reconciles by a new read.\n */\nexport async function installIntegration(instanceId: string, directory: string, integrationId: string, scope: PluginControlScope,\n signal?: AbortSignal): Promise<PluginSourceMutationResponse> {\n const path = `/api/workspaces/${encodeURIComponent(instanceId)}/integrations/${encodeURIComponent(integrationId)}/install?${new URLSearchParams({ directory })}`\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, {\n signal, credentials: \"include\", cache: \"no-store\", method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" }, body: JSON.stringify({ scope }),\n })\n if (!response.ok) {\n const error = await response.json().catch(() => ({}))\n throw new HttpResponseError(\"Integration install failed\", response.status, null, typeof error?.code === \"string\" ? error.code : undefined)\n }\n const value = await response.json()\n if (!value || typeof value !== \"object\" || Object.keys(value).length !== 3 || value.scope !== scope\n || typeof value.spec !== \"string\" || !value.spec || value.reloadPending !== true) throw new Error(\"Invalid integration install response\")\n return { scope, spec: value.spec, reloadPending: true }\n}\n\n/** Fixed CodeNomad routes only; the server owns RPC identity and placement checks. Never replay mutations. */\nexport async function integrationAttachmentRequest<T extends IntegrationHostsResponse | IntegrationAttachResponse | IntegrationDetachResponse | IntegrationInstallHostResponse>(\n instanceId: string, directory: string, integrationId: string, action: \"hosts\" | \"attach\" | \"detach\" | \"install-host\",\n signal: AbortSignal, body?: { sessionID: string; offerID?: string } | Record<string, never>,\n): Promise<T> {\n const path = `/api/workspaces/${encodeURIComponent(instanceId)}/integrations/${encodeURIComponent(integrationId)}/${action}?${new URLSearchParams({ directory })}`\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, {\n signal, credentials: \"include\", cache: \"no-store\", method: action === \"hosts\" ? \"GET\" : \"POST\",\n ...(body ? { headers: { \"Content-Type\": \"application/json\" }, body: JSON.stringify(body) } : {}),\n })\n if (!response.ok) {\n const error = await response.json().catch(() => ({}))\n throw new HttpResponseError(\"Integration action failed\", response.status, null, typeof error.code === \"string\" ? error.code : undefined)\n }\n return await response.json() as T\n}\n","import { createSignal, untrack } from \"solid-js\"\nimport type { IntegrationsResponse } from \"../../../server/src/integration-types\"\n\n/** Native events after which shown integrations are read again: integration RPC events, plugin and configuration changes. */\nconst INTEGRATION_EVENT = /^rpc\\.neuralnomads\\.[a-z][a-z0-9-]{0,31}\\.(?:status_changed|hosts_changed)$/\nconst REFRESH_EVENTS = new Set([\"plugin.updated\", \"config.updated\"])\n/** Events of one instance closer than this produce one read. */\nexport const INTEGRATION_EVENT_COALESCE_MS = 300\n\nexport function isIntegrationRefreshEvent(type: string): boolean {\n return INTEGRATION_EVENT.test(type) || REFRESH_EVENTS.has(type)\n}\n\n/** A Location's integrations as last read: `loading` until the first answer; a failed read keeps the last one shown. */\nexport type IntegrationsSnapshot = { status: \"loading\" } | { status: \"error\" } | { status: \"ready\"; response: IntegrationsResponse; stale?: boolean; refreshError?: boolean }\n\nconst LOADING: IntegrationsSnapshot = { status: \"loading\" }\n\ninterface Entry {\n instanceId: string\n directory: string\n demand: number\n generation: number\n reading?: { dirty: boolean; controller: AbortController; promise: Promise<void> }\n}\n\n/**\n * Integrations of the Locations a surface shows, keyed by instance and directory. Demand reads; integration RPC\n * events (`rpc.neuralnomads.<app>.status_changed` / `hosts_changed`), `plugin.updated` and `config.updated` of an\n * instance are coalesced over 300 ms into one read per demanded Location, with at most one trailing follow-up while a\n * read runs. Releasing the last demand aborts its read. Nothing reads on a timer: without events or demand, no\n * request (hence no integration RPC) is sent.\n */\nexport function createIntegrationsStore(\n read: (instanceId: string, directory: string, signal: AbortSignal) => Promise<IntegrationsResponse>,\n clock: { setTimer?: (callback: () => void, ms: number) => unknown; clearTimer?: (timer: unknown) => void } = {},\n) {\n const setTimer = clock.setTimer ?? ((callback, ms) => setTimeout(callback, ms))\n const clearTimer = clock.clearTimer ?? (timer => clearTimeout(timer as ReturnType<typeof setTimeout>))\n const [snapshots, setSnapshots] = createSignal<ReadonlyMap<string, IntegrationsSnapshot>>(new Map())\n const entries = new Map<string, Entry>()\n const timers = new Map<string, unknown>()\n const key = (instanceId: string, directory: string) => `${instanceId}\\0${directory}`\n const publish = (stateKey: string, snapshot: IntegrationsSnapshot) => setSnapshots(current => new Map(current).set(stateKey, snapshot))\n\n const refreshEntry = (stateKey: string, entry: Entry): Promise<void> => {\n if (entry.demand === 0) return Promise.resolve()\n if (entry.reading) {\n entry.reading.dirty = true\n return entry.reading.promise\n }\n const reading = { dirty: false, controller: new AbortController(), promise: Promise.resolve() }\n entry.reading = reading\n reading.promise = (async () => {\n try {\n do {\n reading.dirty = false\n const generation = entry.generation\n const answer = await read(entry.instanceId, entry.directory, reading.controller.signal).then(\n (response): IntegrationsSnapshot => ({ status: \"ready\", response }), (): IntegrationsSnapshot => ({ status: \"error\" }))\n if (reading.controller.signal.aborted || entries.get(stateKey) !== entry) return\n if (generation !== entry.generation) continue\n const previous = snapshots().get(stateKey)\n publish(stateKey, answer.status === \"error\" && previous?.status === \"ready\" ? { ...previous, stale: true, refreshError: true } : answer)\n } while (reading.dirty && entry.demand > 0 && entries.get(stateKey) === entry)\n } finally {\n if (entry.reading === reading) entry.reading = undefined\n }\n })()\n return reading.promise\n }\n\n const refreshDemanded = (instanceId?: string): Promise<void> => Promise.all([...entries].map(([stateKey, entry]) =>\n instanceId === undefined || entry.instanceId === instanceId ? refreshEntry(stateKey, entry) : undefined)).then(() => undefined)\n\n const invalidate = (instanceId?: string): void => {\n for (const [stateKey, entry] of entries) {\n if (instanceId !== undefined && entry.instanceId !== instanceId) continue\n entry.generation++\n const previous = snapshots().get(stateKey)\n if (previous?.status === \"ready\") publish(stateKey, { ...previous, stale: true })\n }\n }\n\n return {\n state(instanceId: string, directory: string): IntegrationsSnapshot {\n return snapshots().get(key(instanceId, directory)) ?? LOADING\n },\n /** Reads now and follows the Location's events until the returned release. */\n demand(instanceId: string, directory: string): () => void {\n const stateKey = key(instanceId, directory)\n let entry = entries.get(stateKey)\n if (!entry) entries.set(stateKey, entry = { instanceId, directory, demand: 0, generation: 0 })\n const tracked = entry\n tracked.demand += 1\n if (tracked.demand === 1) {\n const previous = untrack(() => snapshots().get(stateKey))\n if (previous?.status === \"ready\") publish(stateKey, { ...previous, stale: true })\n void refreshEntry(stateKey, tracked)\n }\n let released = false\n return () => {\n if (released) return\n released = true\n tracked.demand -= 1\n if (tracked.demand > 0) return\n tracked.reading?.controller.abort()\n tracked.reading = undefined\n if (entries.get(stateKey) === tracked) entries.delete(stateKey)\n }\n },\n refreshDemanded,\n invalidate,\n /** A native event of `instanceId`: schedules one coalesced read of its demanded Locations when it may change them. */\n applyEvent(instanceId: string, type: string): void {\n if (!isIntegrationRefreshEvent(type)) return\n invalidate(instanceId)\n if (timers.has(instanceId)) return\n if (![...entries.values()].some(entry => entry.instanceId === instanceId)) return\n timers.set(instanceId, setTimer(() => {\n timers.delete(instanceId)\n void refreshDemanded(instanceId)\n }, INTEGRATION_EVENT_COALESCE_MS))\n },\n clearInstance(instanceId: string): void {\n const timer = timers.get(instanceId)\n if (timer !== undefined) clearTimer(timer)\n timers.delete(instanceId)\n for (const [stateKey, entry] of [...entries]) {\n if (entry.instanceId !== instanceId) continue\n entry.reading?.controller.abort()\n entries.delete(stateKey)\n }\n setSnapshots(current => new Map([...current].filter(([stateKey]) => !stateKey.startsWith(`${instanceId}\\0`))))\n },\n }\n}\n\nexport type IntegrationsStore = ReturnType<typeof createIntegrationsStore>\n","import { createSignal } from \"solid-js\"\nimport type { IntegrationBindingResponse } from \"../../../server/src/integration-types\"\nimport { INTEGRATION_EVENT_COALESCE_MS, isIntegrationRefreshEvent } from \"./integrations-store\"\n\nexport interface IntegrationBindingTarget { instanceId: string; directory: string; sessionID: string; integrationId: string }\nconst UNKNOWN: IntegrationBindingResponse = { state: \"unknown\" }\nconst key = (target: IntegrationBindingTarget) => JSON.stringify([target.instanceId, target.directory, target.sessionID, target.integrationId])\ninterface Entry {\n target: IntegrationBindingTarget\n demand: number\n generation: number\n timer?: unknown\n reading?: { controller: AbortController; promise: Promise<void>; dirty: boolean }\n}\n\n/** Live authority exists only while the exact conversation/Location is demanded. Invalidations revoke it immediately. */\nexport function createIntegrationBindingsStore(\n read: (target: IntegrationBindingTarget, signal: AbortSignal) => Promise<IntegrationBindingResponse>,\n clock: { setTimer?: (callback: () => void, ms: number) => unknown; clearTimer?: (timer: unknown) => void } = {},\n) {\n const setTimer = clock.setTimer ?? ((callback, ms) => setTimeout(callback, ms))\n const clearTimer = clock.clearTimer ?? (timer => clearTimeout(timer as ReturnType<typeof setTimeout>))\n const entries = new Map<string, Entry>()\n const disconnected = new Set<string>()\n let transportConnected = true\n const connected = (entry: Entry) => transportConnected && !disconnected.has(entry.target.instanceId)\n const [snapshots, setSnapshots] = createSignal<ReadonlyMap<string, IntegrationBindingResponse>>(new Map())\n const [busy, setBusy] = createSignal<ReadonlySet<string>>(new Set())\n const publish = (id: string, value: IntegrationBindingResponse) => setSnapshots(current => new Map(current).set(id, value))\n const invalidate = (id: string, entry: Entry) => { entry.generation++; publish(id, UNKNOWN) }\n const refresh = (id: string, entry: Entry): Promise<void> => {\n if (!connected(entry)) return Promise.resolve()\n if (entry.reading) { entry.reading.dirty = true; return entry.reading.promise }\n const reading = { controller: new AbortController(), dirty: false, promise: Promise.resolve() }\n entry.reading = reading\n reading.promise = (async () => {\n try {\n do {\n reading.dirty = false\n const generation = entry.generation\n const answer = await read(entry.target, reading.controller.signal).catch(() => UNKNOWN)\n if (reading.controller.signal.aborted || entries.get(id) !== entry) return\n if (generation === entry.generation) publish(id, answer)\n } while (reading.dirty && entries.get(id) === entry)\n } finally { if (entry.reading === reading) entry.reading = undefined }\n })()\n return reading.promise\n }\n const cancelTimer = (entry: Entry) => {\n if (entry.timer !== undefined) clearTimer(entry.timer)\n entry.timer = undefined\n }\n const reconcile = (id: string, entry: Entry, immediate: boolean) => {\n invalidate(id, entry)\n if (!connected(entry)) return\n if (immediate) { cancelTimer(entry); return refresh(id, entry) }\n if (entry.timer !== undefined) return\n entry.timer = setTimer(() => { entry.timer = undefined; void refresh(id, entry) }, INTEGRATION_EVENT_COALESCE_MS)\n }\n return {\n state(target: IntegrationBindingTarget): IntegrationBindingResponse { return snapshots().get(key(target)) ?? UNKNOWN },\n busy(target: IntegrationBindingTarget): boolean { return busy().has(key(target)) },\n demand(target: IntegrationBindingTarget): () => void {\n const id = key(target)\n let entry = entries.get(id)\n if (!entry) {\n entries.set(id, entry = { target: { ...target }, demand: 0, generation: 0 })\n void refresh(id, entry)\n }\n const tracked = entry\n tracked.demand++\n let released = false\n return () => {\n if (released) return\n released = true\n if (--tracked.demand > 0 || entries.get(id) !== tracked) return\n cancelTimer(tracked); tracked.reading?.controller.abort(); entries.delete(id)\n setSnapshots(current => { const next = new Map(current); next.delete(id); return next })\n }\n },\n /** An explicit new authoritative read of one demanded target; its previous answer is revoked first. */\n refresh(target: IntegrationBindingTarget): Promise<void> {\n const id = key(target)\n const entry = entries.get(id)\n return entry ? reconcile(id, entry, true) ?? Promise.resolve() : Promise.resolve()\n },\n /** Explicit view refresh: only live demands of this exact conversation and Location. */\n refreshDemanded(target: Omit<IntegrationBindingTarget, \"integrationId\">): Promise<void> {\n return Promise.all([...entries].map(([id, entry]) => entry.target.instanceId === target.instanceId\n && entry.target.directory === target.directory && entry.target.sessionID === target.sessionID\n ? reconcile(id, entry, true) : undefined)).then(() => undefined)\n },\n /** Payload-free integration events and exact-session changes are invalidation hints only. */\n applyEvent(instanceId: string, type: string, sessionID?: string): void {\n const integrationEvent = isIntegrationRefreshEvent(type)\n if (!integrationEvent && ![\"session.updated\", \"session.moved\", \"session.deleted\"].includes(type)) return\n for (const [id, entry] of entries) {\n if (entry.target.instanceId !== instanceId || (!integrationEvent && entry.target.sessionID !== sessionID)) continue\n reconcile(id, entry, false)\n }\n },\n reconnect(instanceId?: string, isConnected = true): void {\n if (instanceId === undefined) transportConnected = isConnected\n else if (isConnected) disconnected.delete(instanceId)\n else disconnected.add(instanceId)\n for (const [id, entry] of entries) {\n if (instanceId !== undefined && entry.target.instanceId !== instanceId) continue\n if (connected(entry)) void reconcile(id, entry, true)\n else {\n cancelTimer(entry); invalidate(id, entry)\n entry.reading?.controller.abort()\n entry.reading = undefined\n }\n }\n },\n clearInstance(instanceId: string): void {\n disconnected.delete(instanceId)\n for (const [id, entry] of entries) {\n if (entry.target.instanceId !== instanceId) continue\n cancelTimer(entry); entry.reading?.controller.abort(); entries.delete(id)\n setSnapshots(current => { const next = new Map(current); next.delete(id); return next })\n }\n },\n /** An admitted mutation runs once; uncertain outcomes also reconcile its captured target, if still shown. */\n async run(target: IntegrationBindingTarget, mutation: () => Promise<void>): Promise<void> {\n const id = key(target)\n if (busy().has(id)) return\n setBusy(current => new Set(current).add(id))\n const entry = entries.get(id)\n if (entry) invalidate(id, entry)\n try { await mutation() }\n finally {\n setBusy(current => { const next = new Set(current); next.delete(id); return next })\n const current = entries.get(id)\n if (current) void reconcile(id, current, true)\n }\n },\n }\n}\n","import { createSignal } from \"solid-js\"\nimport { fetchIntegrationBinding, fetchIntegrations } from \"../lib/integrations-api\"\nimport { createIntegrationBindingsStore } from \"./integration-bindings-store\"\nimport { createEventRefreshScheduler } from \"../lib/event-refresh-scheduler\"\nimport { serverEvents } from \"../lib/server-events\"\nimport { createIntegrationsStore, isIntegrationRefreshEvent } from \"./integrations-store\"\n\nexport const integrations = createIntegrationsStore(fetchIntegrations)\nexport const integrationBindings = createIntegrationBindingsStore(fetchIntegrationBinding)\n// Invalidates live offer snapshots, including across reconnects. Action receipts have their own view ownership.\nconst [epochs, setEpochs] = createSignal<ReadonlyMap<string, number>>(new Map())\nconst [sessionEpochs, setSessionEpochs] = createSignal<ReadonlyMap<string, number>>(new Map())\nconst [connectionEpoch, setConnectionEpoch] = createSignal(0)\nexport const integrationEpoch = (instanceId: string, sessionId?: string) =>\n `${connectionEpoch()}:${epochs().get(instanceId) ?? 0}:${sessionEpochs().get(`${instanceId}\\0${sessionId ?? \"\"}`) ?? 0}`\nconst invalidate = (instanceId: string) => setEpochs(current => new Map(current).set(instanceId, (current.get(instanceId) ?? 0) + 1))\nconst reconnects = createEventRefreshScheduler(instanceId => integrations.refreshDemanded(instanceId))\nserverEvents.on(\"instance.event\", event => {\n if (event.type !== \"instance.event\") return\n const type = event.event.type\n const sessionID = (event.event as { data?: { sessionID?: unknown } }).data?.sessionID\n integrationBindings.applyEvent(event.instanceId, type, typeof sessionID === \"string\" ? sessionID : undefined)\n if (isIntegrationRefreshEvent(type)) {\n invalidate(event.instanceId)\n integrations.applyEvent(event.instanceId, type)\n } else if (type === \"server.connected\") {\n integrationBindings.reconnect(event.instanceId)\n invalidate(event.instanceId)\n integrations.invalidate(event.instanceId)\n reconnects.schedule(event.instanceId, \"urgent\")\n } else if ([\"session.updated\", \"session.deleted\", \"session.moved\"].includes(type)) {\n const sessionID = (event.event as { data?: { sessionID?: unknown } }).data?.sessionID\n if (typeof sessionID !== \"string\") return\n const key = `${event.instanceId}\\0${sessionID}`\n setSessionEpochs(current => new Map(current).set(key, (current.get(key) ?? 0) + 1))\n }\n})\nserverEvents.on(\"instance.eventStatus\", event => {\n if (event.type !== \"instance.eventStatus\") return\n integrationBindings.reconnect(event.instanceId, event.status === \"connected\")\n invalidate(event.instanceId)\n integrations.invalidate(event.instanceId)\n if (event.status === \"connected\") reconnects.schedule(event.instanceId, \"urgent\")\n})\nserverEvents.onOpen(() => {\n integrationBindings.reconnect()\n setConnectionEpoch(value => value + 1)\n integrations.invalidate()\n void integrations.refreshDemanded()\n})\nserverEvents.onTransportStatus(status => {\n if (status !== \"disconnected\") return\n setConnectionEpoch(value => value + 1)\n integrations.invalidate()\n integrationBindings.reconnect(undefined, false)\n})\nserverEvents.on(\"workspace.stopped\", event => {\n if (event.type !== \"workspace.stopped\") return\n integrationBindings.clearInstance(event.workspaceId)\n invalidate(event.workspaceId)\n reconnects.cancel(event.workspaceId)\n integrations.clearInstance(event.workspaceId)\n})\n","import { createSignal } from \"solid-js\"\nimport type {\n PluginActivationMutationRequest,\n PluginActivationMutationResponse,\n PluginControlLocation,\n PluginControlScope,\n PluginControlsSnapshot,\n} from \"../../../server/src/api-types\"\nimport { serverApi } from \"../lib/api-client\"\n\nexport interface PluginControlsState {\n invalidationRevision?: number\n runtimeUnconfirmed?: ReadonlySet<string>\n snapshot?: PluginControlsSnapshot\n loading: boolean\n refreshing: boolean\n stale: boolean\n error?: unknown\n}\n\ninterface CacheRecord {\n readonly keys: Set<string>\n readonly demands: Set<{ record: CacheRecord }>\n readonly instanceId: string\n location: PluginControlLocation\n canonicalLocation: boolean\n generation: number\n invalidationRevision: number\n snapshotRevision: number\n snapshot?: PluginControlsSnapshot\n runtimeUnconfirmed: Set<string>\n loading: boolean\n refreshing: boolean\n stale: boolean\n error?: unknown\n inFlight?: Promise<void>\n inFlightController?: AbortController\n trailing: boolean\n mutationTail: Promise<void>\n}\n\ninterface PluginControlsApi {\n getPluginControls(instanceId: string, location: PluginControlLocation, signal?: AbortSignal): Promise<PluginControlsSnapshot>\n setPluginActivation(instanceId: string, payload: PluginActivationMutationRequest): Promise<PluginActivationMutationResponse>\n}\n\nconst EMPTY_STATE: PluginControlsState = { loading: false, refreshing: false, stale: false }\n\nexport class PluginControlsCache {\n private readonly records = new Map<string, CacheRecord>()\n private readonly pendingUnknownInvalidations = new Map<string, number>()\n private revision = 0\n private readonly stateSignal = createSignal<Map<string, PluginControlsState>>(new Map())\n readonly states = this.stateSignal[0]\n private readonly setStates = this.stateSignal[1]\n\n constructor(private readonly api: PluginControlsApi) {}\n\n state(instanceId: string, location: PluginControlLocation): PluginControlsState {\n return this.states().get(cacheKey(instanceId, location)) ?? EMPTY_STATE\n }\n\n /** Own visible refresh demand until deactivation/disposal; aliases share owners. */\n acquireDemand(instanceId: string, location: PluginControlLocation): () => void {\n const record = this.record(instanceId, location)\n const demand = { record }\n record.demands.add(demand)\n void this.load(instanceId, location, { force: Boolean(record.error) })\n return () => {\n // Canonical adoption can transfer the handle to a different record.\n const current = demand.record\n if (!current.demands.delete(demand) || current.demands.size > 0) return\n if (current.trailing) {\n current.trailing = false\n current.stale = true\n this.publish(current)\n }\n }\n }\n\n load(instanceId: string, location: PluginControlLocation, options?: { force?: boolean }): Promise<void> {\n const record = this.record(instanceId, location)\n if (record.snapshot && !record.stale && !options?.force) return Promise.resolve()\n return this.loadRecord(record, Boolean(options?.force || record.stale))\n }\n\n async mutate(\n instanceId: string,\n location: PluginControlLocation,\n pluginId: string,\n scope: PluginControlScope,\n enabled: boolean,\n ): Promise<PluginActivationMutationResponse> {\n const record = this.record(instanceId, location)\n const mutate = async () => {\n if (!this.isActive(record)) {\n throw new Error(\"Plugin control location is no longer active\")\n }\n const requestRevision = ++this.revision\n const response = await this.api.setPluginActivation(instanceId, {\n location: record.location,\n pluginId,\n scope,\n enabled,\n })\n if (!this.isActive(record) || !this.adoptCanonicalLocation(record, response.snapshot.location, true)) return response\n // Fence any passive read that started before the mutation became durable.\n record.generation += 1\n // A mutation overlays a durable rule onto inventory read BEFORE the write.\n // Events and completed reads during that write still require reconciliation;\n // in particular, do not roll newer runtime failures back to that inventory.\n const newerSnapshot = record.snapshot && record.snapshotRevision > requestRevision\n ? record.snapshot\n : undefined\n record.snapshot = newerSnapshot ? retainRuntime(response.snapshot, newerSnapshot) : response.snapshot\n // The write response carries pre-write inventory. Only a later read can\n // confirm a managed plugin's runtime state, even if that inventory is active.\n if (enabled && response.reloadPending && record.snapshot.controls.some(control => control.id === pluginId && control.managedBy === \"codenomad\")) {\n record.runtimeUnconfirmed.add(pluginId)\n } else if (!enabled) record.runtimeUnconfirmed.delete(pluginId)\n // Alias reads dispatched during the write must also see this publication\n // as newer, even when the mutation's dispatch revision predates them.\n record.snapshotRevision = ++this.revision\n record.error = undefined\n record.loading = false\n record.refreshing = false\n record.stale = record.stale || record.invalidationRevision > requestRevision || Boolean(newerSnapshot)\n if (record.inFlight) record.trailing = true\n this.publish(record)\n if (scope === \"global\") this.invalidateSiblingLocations(record)\n return response\n }\n const result = record.mutationTail.then(mutate, mutate)\n // Keep writes for one location ordered even when an earlier write fails.\n // The caller presents mutation failures; passive read errors remain separate.\n record.mutationTail = result.then(() => undefined, () => undefined)\n return result\n }\n\n invalidateInstance(instanceId: string): void {\n this.invalidate(instanceId)\n }\n\n invalidateAll(): void {\n this.invalidateRecords([...new Set(this.records.values())])\n }\n\n invalidateLocation(instanceId: string, location: PluginControlLocation): void {\n this.invalidate(instanceId, location)\n }\n\n private invalidate(instanceId: string, location?: PluginControlLocation): void {\n if (!location) {\n const records = [...new Set(this.records.values())].filter((record) => record.instanceId === instanceId)\n this.invalidateRecords(records)\n return\n }\n const key = cacheKey(instanceId, location)\n const target = this.records.get(key)\n if (!target) {\n // Unknown directories match nothing immediately. Remember the canonical\n // key so a WSL alias learned later can still fence its first snapshot.\n this.pendingUnknownInvalidations.set(key, ++this.revision)\n while (this.pendingUnknownInvalidations.size > 200) {\n const oldest = this.pendingUnknownInvalidations.keys().next().value\n if (oldest === undefined) break\n this.pendingUnknownInvalidations.delete(oldest)\n }\n return\n }\n this.invalidateRecords([target])\n }\n\n private invalidateSiblingLocations(current: CacheRecord): void {\n const siblings = [...new Set(this.records.values())]\n .filter((record) => record !== current && record.instanceId === current.instanceId)\n this.invalidateRecords(siblings)\n }\n\n private invalidateRecords(records: readonly CacheRecord[]): void {\n for (const record of records) {\n record.generation += 1\n record.invalidationRevision = ++this.revision\n record.stale = true\n }\n this.publishAll(records)\n }\n\n clearInstance(instanceId: string): void {\n let changed = false\n for (const record of new Set(this.records.values())) {\n if (record.instanceId !== instanceId) continue\n record.generation += 1\n record.inFlightController?.abort()\n record.inFlightController = undefined\n record.demands.clear()\n for (const key of record.keys) {\n if (this.records.get(key) === record) this.records.delete(key)\n }\n changed = true\n }\n for (const key of this.pendingUnknownInvalidations.keys()) {\n if (key.startsWith(`${JSON.stringify(instanceId)}:`)) this.pendingUnknownInvalidations.delete(key)\n }\n if (!changed) return\n this.setStates((previous) => {\n const next = new Map(previous)\n for (const key of next.keys()) {\n if (key.startsWith(`${JSON.stringify(instanceId)}:`)) next.delete(key)\n }\n return next\n })\n }\n\n private record(instanceId: string, location: PluginControlLocation): CacheRecord {\n const key = cacheKey(instanceId, location)\n const existing = this.records.get(key)\n if (existing) {\n if (!existing.canonicalLocation) existing.location = { ...location }\n return existing\n }\n const record: CacheRecord = {\n keys: new Set([key]),\n demands: new Set(),\n instanceId,\n location: { ...location },\n canonicalLocation: false,\n generation: 0,\n invalidationRevision: 0,\n snapshotRevision: 0,\n runtimeUnconfirmed: new Set(),\n loading: false,\n refreshing: false,\n stale: false,\n trailing: false,\n mutationTail: Promise.resolve(),\n }\n this.records.set(key, record)\n return record\n }\n\n private loadRecord(record: CacheRecord, force: boolean): Promise<void> {\n if (record.inFlight) {\n if (force) record.trailing = true\n return record.inFlight\n }\n const generation = record.generation\n const requestRevision = ++this.revision\n record.stale = false\n record.loading = !record.snapshot\n record.refreshing = Boolean(record.snapshot)\n record.error = undefined\n this.publish(record)\n const controller = new AbortController()\n record.inFlightController = controller\n const promise = this.api.getPluginControls(record.instanceId, record.location, controller.signal)\n .then((snapshot) => {\n if (!this.isActive(record) || generation !== record.generation) return\n if (!this.adoptCanonicalLocation(record, snapshot.location, false, { snapshot, revision: requestRevision })) return\n record.snapshot = snapshot\n confirmRuntime(record)\n record.snapshotRevision = ++this.revision\n record.error = undefined\n })\n .catch((error) => {\n if (!this.isActive(record) || generation !== record.generation) return\n // An aborted orphan fetch must not surface as a passive read error.\n if (controller.signal.aborted) return\n record.error = error\n })\n .finally(() => {\n if (!this.isActive(record) || record.inFlight !== promise) return\n record.inFlight = undefined\n if (record.inFlightController === controller) record.inFlightController = undefined\n record.loading = false\n record.refreshing = false\n const trailing = record.trailing\n record.trailing = false\n if (trailing) {\n // No follow-up may outlive its last visible owner. Keep the demand\n // as stale display state so reopening performs one reconciliation.\n record.stale = true\n }\n this.publish(record)\n })\n record.inFlight = promise\n return promise\n }\n\n private publish(record: CacheRecord): void {\n this.publishAll([record])\n }\n\n private publishAll(records: readonly CacheRecord[]): void {\n const active = records.filter((record) => this.isActive(record))\n if (active.length === 0) return\n const states = new Map<CacheRecord, PluginControlsState>()\n for (const record of active) {\n states.set(record, {\n invalidationRevision: record.invalidationRevision,\n runtimeUnconfirmed: new Set(record.runtimeUnconfirmed),\n snapshot: record.snapshot,\n loading: record.loading,\n refreshing: record.refreshing,\n stale: record.stale,\n error: record.error,\n })\n }\n this.setStates((previous) => {\n const next = new Map(previous)\n for (const [record, state] of states) {\n for (const key of record.keys) {\n if (this.records.get(key) === record) next.set(key, state)\n }\n }\n return next\n })\n for (const record of active) {\n if (record.demands.size > 0 && record.stale) void this.loadRecord(record, true)\n }\n }\n\n private isActive(record: CacheRecord): boolean {\n return [...record.keys].some((key) => this.records.get(key) === record)\n }\n\n private adoptCanonicalLocation(\n record: CacheRecord,\n location: PluginControlLocation,\n preferIncoming = false,\n incomingRead?: { snapshot: PluginControlsSnapshot; revision: number },\n ): boolean {\n const canonicalKey = cacheKey(record.instanceId, location)\n const existing = this.records.get(canonicalKey)\n let invalidatedAlias = false\n if (existing && existing !== record) {\n if (preferIncoming || !existing.snapshot) {\n if (preferIncoming) {\n // A mutation can be the first response to reveal a host/canonical\n // alias. Carry the canonical record's newer runtime and event demand\n // across the merge before publishing that mutation's durable rule.\n record.invalidationRevision = Math.max(record.invalidationRevision, existing.invalidationRevision)\n record.stale ||= existing.stale || Boolean(existing.inFlight) || existing.trailing\n if (existing.snapshot && existing.snapshotRevision > record.snapshotRevision) {\n record.snapshot = existing.snapshot\n record.snapshotRevision = existing.snapshotRevision\n }\n }\n // The canonical record may have consumed an event before this alias\n // was known. Its refresh clears stale at dispatch, so retain the\n // generation as well as queued demand before orphaning that read.\n invalidatedAlias = !preferIncoming && (existing.generation > 0 || existing.stale || existing.trailing)\n existing.generation += 1\n existing.inFlightController?.abort()\n this.mergeRecord(existing, record)\n } else {\n // Keep the canonical owner (including its mutation queue), but let a\n // genuinely newer successful alias read recover its failed refresh.\n // Completion order alone cannot authorize replacing newer publications\n // or invalidations; those require a canonical reconciliation instead.\n let adoptedRead = false\n if (existing.error) {\n if (incomingRead && !existing.inFlight\n && existing.snapshotRevision < incomingRead.revision\n && existing.invalidationRevision < incomingRead.revision) {\n existing.snapshot = incomingRead.snapshot\n existing.snapshotRevision = ++this.revision\n existing.error = undefined\n adoptedRead = true\n } else {\n existing.stale = true\n }\n }\n existing.stale ||= record.stale || record.trailing\n record.generation += 1\n record.inFlightController?.abort()\n this.mergeRecord(record, existing)\n if (adoptedRead) confirmRuntime(existing)\n this.publish(existing)\n return false\n }\n }\n this.records.set(canonicalKey, record)\n record.keys.add(canonicalKey)\n record.location = { ...location }\n record.canonicalLocation = true\n const pendingInvalidation = this.pendingUnknownInvalidations.get(canonicalKey)\n this.pendingUnknownInvalidations.delete(canonicalKey)\n if (pendingInvalidation !== undefined || invalidatedAlias) {\n if (pendingInvalidation !== undefined) {\n record.invalidationRevision = Math.max(record.invalidationRevision, pendingInvalidation)\n }\n if (preferIncoming) {\n record.stale = true\n return true\n }\n // A canonical event/demand arrived before the WSL alias was learned.\n // Discard this snapshot and retain one trailing refresh, including when\n // the canonical key already had an in-flight record of its own.\n record.generation += 1\n record.stale = true\n record.trailing = true\n this.publish(record)\n return false\n }\n return true\n }\n\n private mergeRecord(source: CacheRecord, target: CacheRecord): void {\n for (const pluginId of source.runtimeUnconfirmed) target.runtimeUnconfirmed.add(pluginId)\n for (const key of source.keys) {\n if (this.records.get(key) !== source) continue\n this.records.set(key, target)\n target.keys.add(key)\n }\n for (const demand of source.demands) {\n demand.record = target\n target.demands.add(demand)\n }\n source.demands.clear()\n }\n}\n\nfunction confirmRuntime(record: CacheRecord): void {\n for (const pluginId of record.runtimeUnconfirmed) {\n const control = record.snapshot?.controls.find(control => control.id === pluginId)\n if (control?.managedBy !== \"codenomad\" || control.runtime) record.runtimeUnconfirmed.delete(pluginId)\n }\n}\n\nfunction retainRuntime(durable: PluginControlsSnapshot, newer: PluginControlsSnapshot): PluginControlsSnapshot {\n const runtimeById = new Map(newer.runtime.flatMap((entry) => entry.id ? [[entry.id, entry] as const] : []))\n const newerControlsById = new Map(newer.controls.map(control => [control.id, control]))\n const sourceKey = (source: PluginControlsSnapshot[\"configured\"][\"sources\"][number]) => JSON.stringify([source.scope, source.path, source.entryIndex, source.target])\n const newerSources = new Map(newer.configured.sources.map(source => [sourceKey(source), source.managedBy]))\n const configuredIds = new Set(durable.configured.rules.map((rule) => rule.selector))\n const durableIds = new Set(durable.controls.map((control) => control.id))\n return {\n ...durable,\n runtime: newer.runtime,\n configured: { ...durable.configured, sources: durable.configured.sources.map(({ managedBy: _previous, ...source }) => {\n const managedBy = newerSources.get(sourceKey(source))\n return { ...source, ...(managedBy ? { managedBy } : {}) }\n }) },\n controls: [\n ...durable.controls.flatMap(({ runtime: previousRuntime, managedBy: _previous, ...control }) => {\n // Proven managed installations can attach a native failure before it exports an ID.\n const runtime = runtimeById.get(control.id) ?? newerControlsById.get(control.id)?.runtime\n const managedBy = newerControlsById.get(control.id)?.managedBy ?? runtime?.managedBy\n // A removed runtime-only plugin is no longer an inventory control;\n // exact configured IDs (including the durable rule) remain actionable.\n if (!runtime && previousRuntime && !configuredIds.has(control.id) && managedBy !== \"codenomad\") return []\n return [{ ...control, ...(managedBy ? { managedBy } : {}), ...(runtime ? { runtime } : {}) }]\n }),\n ...newer.controls.filter((control) => !durableIds.has(control.id)),\n ],\n }\n}\n\nexport const pluginControlsCache = new PluginControlsCache(serverApi)\n\nfunction cacheKey(instanceId: string, location: PluginControlLocation): string {\n return `${JSON.stringify(instanceId)}:${JSON.stringify(location.directory)}`\n}\n","import { createSignal } from \"solid-js\"\nimport type {\n PluginConfiguredSource,\n PluginControlLocation,\n PluginControlScope,\n PluginControlsSnapshot,\n} from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\nimport type { PluginSourceAddRequest, PluginSourceMutationResponse, PluginSourceRemoveRequest } from \"../../../server/src/plugin-source-types\"\nimport { serverApi } from \"../lib/api-client\"\nimport { installIntegration } from \"../lib/integrations-api\"\nimport { integrations } from \"./integrations\"\nimport { pluginControlsCache } from \"./plugin-controls\"\n\n/** How long an added source may stay absent from `plugin.list` before it is shown as not confirmed. */\nexport const PLUGIN_SOURCE_PENDING_TIMEOUT_MS = 120_000\nconst MAX_TRACKED = 100\n\n/** `pending`: added here and not yet in the inventory; `unconfirmed`: configured, but still absent\n * after the pending window (disabled, or never installed). Loaded sources use the runtime state. */\nexport type PluginSourceState = \"pending\" | \"unconfirmed\"\n\n/** `active`/`failed`: the inventory loaded the integration's plugin, or failed to; otherwise its install hint. */\nexport type IntegrationInstallState = PluginSourceState | \"active\" | \"failed\"\n\n/** One add, reserved before transmission; `spec` is known and the hint shown only once the server confirmed the write. */\ninterface Tracked { key: string; scope: PluginControlScope; startedAt: number; submitted: boolean; spec?: string; integration?: string }\ntype Submitted = Tracked & { spec: string; submitted: true }\n\ninterface Api {\n addPluginSource(instanceId: string, payload: PluginSourceAddRequest): Promise<PluginSourceMutationResponse>\n removePluginSource(instanceId: string, payload: PluginSourceRemoveRequest): Promise<PluginSourceMutationResponse>\n installIntegration(instanceId: string, directory: string, integrationId: string, scope: PluginControlScope): Promise<PluginSourceMutationResponse>\n}\n\nconst locationKey = (instanceId: string, location: PluginControlLocation) => JSON.stringify([instanceId, location.directory])\n\nexport class PluginSourcesStore {\n private readonly added = createSignal<readonly Tracked[]>([])\n private readonly removing = createSignal<ReadonlySet<string>>(new Set())\n // Bumped when a pending window closes, so derived rows change state without other events.\n private readonly tick = createSignal(0)\n\n constructor(\n private readonly api: Api,\n private readonly invalidate: (instanceId: string) => void,\n private readonly now: () => number = () => Date.now(),\n private readonly schedule: (callback: () => void, delay: number) => unknown = (callback, delay) => setTimeout(callback, delay),\n private readonly refreshIntegrations: (instanceId: string) => void = () => {},\n ) {}\n\n async add(instanceId: string, location: PluginControlLocation, scope: PluginControlScope, spec: string): Promise<void> {\n const attempt = this.begin(instanceId, location, scope)\n try {\n await this.api.addPluginSource(instanceId, { location: { directory: location.directory }, scope, spec })\n this.submitted(attempt, spec)\n } catch (error) { this.consume(attempt); throw error }\n // The response is only the durable configured state; the inventory decides what loaded.\n finally { this.invalidate(instanceId) }\n }\n\n /**\n * Installs a catalog integration by ID. The pending hint follows the spec the server returned; a lost or refused\n * answer leaves no hint and is never replayed: the refreshed inventory shows what was written.\n */\n async installIntegration(instanceId: string, location: PluginControlLocation, integrationId: string, scope: PluginControlScope): Promise<PluginSourceMutationResponse> {\n const attempt = this.begin(instanceId, location, scope, integrationId)\n try {\n const response = await this.api.installIntegration(instanceId, location.directory, integrationId, scope)\n this.submitted(attempt, response?.scope === scope && response.reloadPending === true && typeof response.spec === \"string\" ? response.spec : undefined)\n return response\n } catch (error) { this.consume(attempt); throw error }\n finally {\n this.invalidate(instanceId)\n this.refreshIntegrations(instanceId)\n }\n }\n\n /** Reserves an add before its transmission; only `submitted` makes it visible. */\n private begin(instanceId: string, location: PluginControlLocation, scope: PluginControlScope, integration?: string): Tracked {\n const entry: Tracked = { key: locationKey(instanceId, location), scope, startedAt: this.now(), submitted: false, ...(integration ? { integration } : {}) }\n this.added[1](previous => [...previous, entry].slice(-MAX_TRACKED))\n return entry\n }\n\n /** Records the confirmed spec of a reserved add; an unconfirmed answer consumes it instead. */\n private submitted(attempt: Tracked, spec: string | undefined): void {\n if (!this.added[0]().includes(attempt) || attempt.submitted) return\n if (spec === undefined) { this.consume(attempt); throw new Error(\"Plugin source addition could not be confirmed\") }\n const entry: Submitted = { ...attempt, spec, submitted: true, startedAt: this.now() }\n // A newer add of the same spec in the same scope supersedes the older hint.\n this.added[1](previous => [...previous.filter(item => item !== attempt\n && !(item.submitted && item.key === entry.key && item.spec === spec && item.scope === entry.scope)), entry].slice(-MAX_TRACKED))\n this.schedule(() => { if (this.added[0]().includes(entry)) this.tick[1](value => value + 1) }, PLUGIN_SOURCE_PENDING_TIMEOUT_MS + 1)\n }\n\n private consume(attempt: Tracked): void {\n this.added[1](previous => previous.filter(item => item !== attempt))\n }\n\n async remove(instanceId: string, location: PluginControlLocation, source: PluginConfiguredSource & { scope: PluginControlScope }): Promise<void> {\n if (!source.expectedRevision) throw new Error(\"Plugin source confirmation is unavailable\")\n const identity = removalKey(instanceId, location, source)\n if (this.removing[0]().has(identity)) return\n this.removing[1](previous => new Set(previous).add(identity))\n try {\n const response = await this.api.removePluginSource(instanceId, {\n location: { directory: location.directory }, scope: source.scope, target: source.target, entryIndex: source.entryIndex,\n expectedRevision: source.expectedRevision,\n })\n if (response?.scope !== source.scope || response.spec !== source.target || response.reloadPending !== true) throw new Error(\"Plugin source removal could not be confirmed\")\n } finally {\n // An explicit removal supersedes this view's Installing hint even when its response is\n // lost. The reconciled configured/runtime inventory determines whether a row still exists.\n const key = locationKey(instanceId, location)\n this.added[1](previous => previous.filter(item => !(item.submitted && item.key === key && item.spec === source.target && item.scope === source.scope)))\n this.removing[1](previous => { const next = new Set(previous); next.delete(identity); return next })\n this.invalidate(instanceId)\n }\n }\n\n isRemoving(instanceId: string, location: PluginControlLocation, source: PluginConfiguredSource): boolean {\n return this.removing[0]().has(removalKey(instanceId, location, source))\n }\n\n /** Specs added from this location that are still waiting for the inventory, newest last. */\n addedSpecs(instanceId: string, location: PluginControlLocation): readonly Submitted[] {\n const key = locationKey(instanceId, location)\n return this.added[0]().filter((item): item is Submitted => item.key === key && item.submitted)\n }\n\n /** State of a configured or just-added source with no runtime entry yet. */\n state(instanceId: string, location: PluginControlLocation, target: string): PluginSourceState {\n this.tick[0]()\n const tracked = this.addedSpecs(instanceId, location).find(item => item.spec === target)\n return tracked && this.now() - tracked.startedAt <= PLUGIN_SOURCE_PENDING_TIMEOUT_MS ? \"pending\" : \"unconfirmed\"\n }\n\n /**\n * Installation progress of a catalog integration from the integrations read: the inventory's loading facts\n * decide `active`/`failed`; otherwise an install sent from this location stays `pending` for the window, then\n * `unconfirmed`. `undefined` when it is neither declared, loaded nor being installed here.\n */\n installation(instanceId: string, location: PluginControlLocation, integration: Pick<IntegrationView, \"id\" | \"plugin\">): IntegrationInstallState | undefined {\n if (integration.plugin.runtime === \"loaded\") return \"active\"\n if (integration.plugin.runtime === \"failed\") return \"failed\"\n const installs = this.addedSpecs(instanceId, location).filter(item => item.integration === integration.id)\n const tracked = installs[installs.length - 1]\n if (tracked) return this.state(instanceId, location, tracked.spec)\n return integration.plugin.declared ? \"unconfirmed\" : undefined\n }\n\n clearInstance(instanceId: string): void {\n const prefix = JSON.stringify([instanceId]).slice(0, -1)\n this.added[1](previous => previous.filter(item => !item.key.startsWith(`${prefix},`)))\n }\n}\n\nfunction removalKey(instanceId: string, location: PluginControlLocation, source: PluginConfiguredSource): string {\n return JSON.stringify([instanceId, location.directory, source.scope, source.target, source.entryIndex])\n}\n\n/** Declarations the shared document primitive can remove: those in the scope's own write target. */\nexport function removableSources(snapshot: PluginControlsSnapshot | undefined, matches: (source: PluginConfiguredSource) => boolean) {\n if (!snapshot) return []\n return snapshot.configured.sources.filter((source): source is PluginConfiguredSource & { scope: PluginControlScope } => (\n (source.scope === \"global\" || source.scope === \"project\") && matches(source)\n && snapshot.targets.some(target => target.scope === source.scope && Boolean(source.path) && samePath(target.path, source.path!))\n )).map(source => ({ ...source, expectedRevision: snapshot.targets.find(target => target.scope === source.scope)?.expectedRevision }))\n}\n\nfunction samePath(left: string, right: string): boolean {\n const windows = /^[a-z]:[\\\\/]|^\\\\\\\\/i.test(left)\n const normalize = (value: string) => (windows ? value.replace(/\\\\/g, \"/\").toLowerCase() : value).replace(/\\/+$/, \"\")\n return normalize(left) === normalize(right)\n}\n\nexport const pluginSourcesStore = new PluginSourcesStore({\n addPluginSource: (instanceId, payload) => serverApi.addPluginSource(instanceId, payload),\n removePluginSource: (instanceId, payload) => serverApi.removePluginSource(instanceId, payload),\n installIntegration: (instanceId, directory, integrationId, scope) => installIntegration(instanceId, directory, integrationId, scope),\n}, instanceId => pluginControlsCache.invalidateInstance(instanceId), undefined, undefined,\ninstanceId => { void integrations.refreshDemanded(instanceId) })\n","import { showConfirmDialog, type AlertDialogState } from \"../stores/alerts\"\n\n/** Install, host install and remove confirmations enable their action this long after they are shown. */\nexport const INTEGRATION_CONFIRM_DELAY_MS = 600\n\nlet claimed = false\n\n/**\n * Reserves the single open integration or plugin-source confirmation. `undefined` while another one is open: the\n * new request shows nothing and sends nothing. The release is idempotent.\n */\nfunction claimIntegrationConfirmation(): (() => void) | undefined {\n if (claimed) return undefined\n claimed = true\n let released = false\n return () => {\n if (released) return\n released = true\n claimed = false\n }\n}\n\n/**\n * The shared guarded confirmation: Cancel first and focused, the action enabled after\n * `INTEGRATION_CONFIRM_DELAY_MS`, one at a time. Cancel, Escape, closing, expiry or `signal` resolve false.\n */\nexport async function confirmIntegrationAction(message: string, options: Omit<AlertDialogState, \"message\" | \"type\" | \"confirmDelayMs\">,\n signal?: AbortSignal): Promise<boolean> {\n const release = claimIntegrationConfirmation()\n if (!release) return false\n try {\n return await showConfirmDialog(message, { ...options, confirmDelayMs: INTEGRATION_CONFIRM_DELAY_MS }, signal)\n } finally {\n release()\n }\n}\n","import { createEffect, createMemo, createSignal, onCleanup } from \"solid-js\"\nimport type { IntegrationInstallHostResponse, IntegrationView } from \"../../../server/src/integration-types\"\nimport { integrationAttachmentRequest } from \"../lib/integrations-api\"\nimport { useI18n } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { integrationEpoch, integrations } from \"../stores/integrations\"\nimport { confirmIntegrationAction } from \"./integration-confirmation\"\n\n/** Location-scoped explicit consent; the session is only a navigation fence, never installer input. */\nexport function createIntegrationHostInstallation(props: {\n instanceId: string; directory: string; sessionId?: string; active?: boolean; entries: () => IntegrationView[]\n}) {\n const { t } = useI18n()\n const [pending, setPending] = createSignal(false)\n const identity = createMemo(() => JSON.stringify([props.instanceId, props.directory, props.sessionId, props.active !== false]))\n const epoch = createMemo(() => integrationEpoch(props.instanceId, props.sessionId))\n const eligible = (id: string) => props.active !== false ? props.entries().find(entry => entry.id === id\n && entry.family === \"native\" && entry.state === \"ok\" && entry.status?.host?.state !== \"unsupported\"\n && entry.status?.host?.state !== \"unknown\" && entry.status?.host?.action && entry.status.version) : undefined\n const signature = (id: string) => JSON.stringify(eligible(id))\n let confirmation: AbortController | undefined\n let disposed = false\n let focusGeneration = 0\n let target: { id: string; identity: string; epoch: string; signature: string } | undefined\n const cancel = () => { confirmation?.abort(); confirmation = undefined; target = undefined }\n createEffect(() => {\n const owner = identity(), generation = epoch(), entries = props.entries()\n if (target && (target.identity !== owner || target.epoch !== generation || target.signature !== signature(target.id))) { focusGeneration++; cancel() }\n void entries\n })\n onCleanup(() => { disposed = true; cancel() })\n const open = async (id: string) => {\n const entry = eligible(id)\n if (!entry || pending() || confirmation) return\n const instanceId = props.instanceId, directory = props.directory, owner = identity()\n const captured = { id, identity: owner, epoch: epoch(), signature: signature(id) }\n const opener = document.activeElement instanceof HTMLElement ? document.activeElement : undefined\n const generation = ++focusGeneration\n target = captured\n confirmation = new AbortController()\n const signal = confirmation.signal\n const action = entry.status!.host!.action!\n const accepted = await confirmIntegrationAction(t(\"integrations.installHost.warning\", { app: entry.app.name, name: entry.displayName, version: entry.status!.version }), {\n title: t(`integrations.installHost.${action}`),\n confirmLabel: t(`integrations.installHost.${action}`), variant: \"warning\",\n returnFocus: () => {\n if (!disposed && generation === focusGeneration && identity() === owner && epoch() === captured.epoch && signature(id) === captured.signature\n && opener?.isConnected && opener.checkVisibility({ checkVisibilityCSS: true, checkOpacity: true }) && !opener.closest('[inert], [aria-hidden=\"true\"]') && !opener.matches(\":disabled\")) opener.focus({ preventScroll: true })\n },\n }, signal)\n const current = accepted && !signal.aborted && target === captured && identity() === owner\n && epoch() === captured.epoch && signature(id) === captured.signature\n cancel()\n if (!current) return\n setPending(true)\n try {\n // Once admitted, cancellation/navigation cannot promise rollback. Never replay this request.\n const result = await integrationAttachmentRequest<IntegrationInstallHostResponse>(instanceId, directory, id, \"install-host\", new AbortController().signal, {})\n if (![\"installed\", \"updated\", \"unchanged\", \"refused\", \"failed\"].includes(result?.outcome)) throw new Error(\"Invalid installation result\")\n if (!disposed && identity() === owner) showToastNotification({ category: \"opencode\", variant: [\"refused\", \"failed\"].includes(result.outcome) ? \"error\" : \"success\",\n message: t(`integrations.installHost.${result.outcome}`) })\n } catch (error) {\n if (!disposed && identity() === owner) showToastNotification({ category: \"opencode\", variant: \"error\", message: t(\n error instanceof HttpResponseError && error.code === \"unsupported\" ? \"integrations.installHost.unsupported\" : \"integrations.installHost.error\") })\n } finally { setPending(false); void integrations.refreshDemanded(instanceId) }\n }\n return { pending, action: (id: string) => !pending() ? eligible(id)?.status?.host?.action : undefined, open }\n}\n","import { createEffect, createMemo, createSignal, on, onCleanup } from \"solid-js\"\nimport type {\n IntegrationAttachResponse,\n IntegrationDetachResponse,\n IntegrationHostOffer,\n IntegrationHostsResponse,\n IntegrationView,\n} from \"../../../server/src/integration-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport {\n integrationAttachChoice,\n integrationChainAction,\n integrationConnection,\n integrationConnectionMessage,\n integrationLink,\n type IntegrationLink,\n} from \"../lib/integration-row-state\"\nimport { integrationAttachmentRequest } from \"../lib/integrations-api\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { integrationBindings, integrationEpoch } from \"../stores/integrations\"\nimport type { IntegrationBindingTarget } from \"../stores/integration-bindings-store\"\n\nconst sameTarget = (left?: IntegrationBindingTarget, right?: IntegrationBindingTarget) => left === right || (!!left && !!right\n && left.instanceId === right.instanceId && left.directory === right.directory && left.sessionID === right.sessionID && left.integrationId === right.integrationId)\nconst OUTCOMES = new Set([\"busy\", \"gone\", \"refused\"])\ninterface AttachIntent { target: IntegrationBindingTarget; epoch: string; controller: AbortController }\n\n/**\n * The displayed conversation's attachment to one integration of a Plugins row: its authoritative read, demanded\n * while the row is shown, and the user's explicit attach and detach. The integration also attaches a conversation\n * itself at its first use. Every request is sent once and the binding is read again afterwards.\n */\nexport function createIntegrationRowBinding(options: {\n instanceId: () => string\n directory: () => string\n sessionId: () => string | undefined\n integration: () => IntegrationView | undefined\n active: () => boolean\n}) {\n const { t } = useI18n()\n const target = createMemo<IntegrationBindingTarget | undefined>(() => {\n const entry = options.integration(), sessionID = options.sessionId()\n return entry && sessionID && options.directory() && entry.family === \"native\" && entry.state === \"ok\" && !entry.ambiguous\n ? { instanceId: options.instanceId(), directory: options.directory(), sessionID, integrationId: entry.id } : undefined\n }, undefined, { equals: sameTarget })\n createEffect(() => {\n const value = target()\n if (!value || !options.active()) return\n onCleanup(integrationBindings.demand(value))\n })\n const link = createMemo<IntegrationLink | undefined>(() => {\n const entry = options.integration(), value = target()\n return entry ? integrationLink(entry, value ? integrationBindings.state(value) : undefined) : undefined\n })\n const [reading, setReading] = createSignal(false)\n /** The documents offered to choose from, while that menu is open. */\n const [choices, setChoices] = createSignal<Array<IntegrationHostOffer & { attach: () => void }>>()\n const epoch = createMemo(() => integrationEpoch(options.instanceId(), options.sessionId()))\n let intent: AttachIntent | undefined\n let disposed = false\n const revoke = () => {\n intent?.controller.abort(); intent = undefined\n setChoices(undefined); setReading(false)\n }\n createEffect(on(() => [target(), options.active(), epoch()] as const, revoke, { defer: true }))\n onCleanup(() => { disposed = true; revoke() })\n const owns = (captured: AttachIntent) => !disposed && intent === captured && !captured.controller.signal.aborted\n && options.active() && sameTarget(target(), captured.target) && epoch() === captured.epoch\n const busy = () => { const value = target(); return reading() || (value ? integrationBindings.busy(value) : false) }\n const fail = (value: IntegrationBindingTarget, key = \"integrations.error.retry\", vars?: Record<string, string>) => {\n if (!disposed && options.active() && sameTarget(target(), value)) showToastNotification({ category: \"opencode\", variant: \"error\", message: t(key, vars) })\n }\n /** Why the conversation cannot be attached now, or undefined when it can. */\n const unavailable = createMemo(() => {\n const entry = options.integration()\n if (!entry || link()?.state === \"attached\") return undefined\n if (!options.sessionId()) return t(\"integrations.link.noConversation\")\n const connection = integrationConnection(entry)\n if (connection.state === \"offers\") return undefined\n const [key, vars] = integrationConnectionMessage(connection, entry.app.name)\n return t(key, vars)\n })\n\n /** At most one `detachHost` for the displayed conversation. */\n const detach = async () => {\n const value = target()\n if (disposed || !value || link()?.state !== \"attached\" || busy() || !options.active()) return\n await integrationBindings.run(value, async () => {\n try {\n const result = await integrationAttachmentRequest<IntegrationDetachResponse>(value.instanceId, value.directory, value.integrationId,\n \"detach\", new AbortController().signal, { sessionID: value.sessionID })\n if (result?.outcome !== \"detached\" && result?.outcome !== \"none\") throw new Error(\"Invalid detach result\")\n } catch { fail(value) }\n })\n }\n /** At most one `attachHost` of the displayed conversation to the chosen offer. */\n const attach = async (captured: AttachIntent, offerID: string) => {\n if (!owns(captured) || busy() || chainAction() !== \"attach\") return\n const value = captured.target\n await integrationBindings.run(value, async () => {\n if (!owns(captured)) return\n // Consume consent at dispatch; the admitted mutation has its own lifetime and is never replayed.\n revoke()\n try {\n const result = await integrationAttachmentRequest<IntegrationAttachResponse>(value.instanceId, value.directory, value.integrationId,\n \"attach\", new AbortController().signal, { sessionID: value.sessionID, offerID })\n if (result?.outcome === \"attached\") return\n if (OUTCOMES.has(result?.outcome)) fail(value, `integrations.outcome.${result.outcome}`)\n else throw new Error(\"Invalid attach result\")\n } catch { fail(value) }\n })\n }\n /** What the chain button does now. */\n const chainAction = () => { const value = link(); return value ? integrationChainAction(value, unavailable()) : \"unavailable\" }\n /** The chain button: detach when attached; else read the offers, attach the only one or offer the choice. */\n const activate = async () => {\n if (chainAction() === \"detach\") return detach()\n const value = target(), entry = options.integration()\n if (disposed || !value || !entry || chainAction() !== \"attach\" || busy() || !options.active()) return\n const captured: AttachIntent = { target: value, epoch: epoch(), controller: new AbortController() }\n intent = captured\n setReading(true)\n try {\n const result = await integrationAttachmentRequest<IntegrationHostsResponse>(value.instanceId, value.directory, value.integrationId,\n \"hosts\", captured.controller.signal)\n if (!owns(captured)) return\n if (!Array.isArray(result?.offers)) throw new Error(\"Invalid hosts result\")\n const choice = integrationAttachChoice(result.offers)\n if (choice.kind === \"none\") { fail(value, \"integrations.connection.noOffer\", { app: entry.app.name }); revoke() }\n else if (choice.kind === \"attach\") { setReading(false); await attach(captured, choice.offerID) }\n else setChoices(choice.offers.map(offer => ({ ...offer, attach: () => void attach(captured, offer.offerID) })))\n } catch { if (owns(captured)) { fail(value); revoke() } }\n finally { if (intent === captured) setReading(false) }\n }\n return { link, busy, unavailable, chainAction, choices, closeChoices: () => { if (choices()) revoke() }, activate, detach }\n}\n\nexport type IntegrationRowBinding = ReturnType<typeof createIntegrationRowBinding>\n","import { For, Show, splitProps, type JSX } from \"solid-js\"\nimport { DropdownMenu } from \"@kobalte/core/dropdown-menu\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport { AlertTriangle, Link2, Unlink2 } from \"lucide-solid\"\nimport { useI18n } from \"../lib/i18n\"\nimport type { IntegrationAttention } from \"../lib/integration-row-state\"\nimport type { IntegrationRowBinding } from \"./integration-row-binding\"\n\n/** A focusable icon whose text is its accessible name and its tooltip. */\nfunction Indicator(props: { label: string; children: JSX.Element } & Record<`data-${string}`, string | undefined>) {\n const [, data] = splitProps(props, [\"label\", \"children\"])\n return <Tooltip placement=\"top\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" role=\"img\" class=\"plugin-control-indicator\" aria-label={props.label} {...data}>\n {props.children}\n </Tooltip.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\"><bdi>{props.label}</bdi></Tooltip.Content></Tooltip.Portal>\n </Tooltip>\n}\n\n/**\n * The chain button of a native integration's row: pressed while the displayed conversation is attached. A click\n * detaches it, or attaches it to the only open document, or opens the choice between several documents.\n */\nexport function IntegrationLinkButton(props: { binding: IntegrationRowBinding }) {\n const { t } = useI18n()\n const link = () => props.binding.link()!\n const attached = () => link().state === \"attached\"\n const state = () => {\n const value = link()\n return value.state === \"attached\" ? t(\"integrations.link.attached\", { label: value.label }) : t(`integrations.link.${value.state}`)\n }\n const action = () => {\n const next = props.binding.chainAction()\n return next === \"detach\" ? t(\"integrations.detachConversation\") : next === \"attach\" ? t(\"integrations.attachConversation\") : props.binding.unavailable() ?? \"\"\n }\n const disabled = () => props.binding.busy() || props.binding.chainAction() === \"unavailable\"\n return <DropdownMenu placement=\"bottom-end\" gutter={4} open={props.binding.choices() !== undefined}\n onOpenChange={open => { if (!open) props.binding.closeChoices(); else if (!disabled()) void props.binding.activate() }}>\n <Tooltip placement=\"top\" openDelay={300}>\n <DropdownMenu.Trigger as={Tooltip.Trigger} type=\"button\" class=\"icon-button-compact icon-toggle plugin-control-link\"\n data-integration-link={link().state} aria-pressed={attached()} aria-disabled={disabled() ? \"true\" : undefined}\n aria-busy={props.binding.busy()} aria-label={`${state()} — ${action()}`}>\n <Show when={link().state === \"none\"} fallback={<Link2 class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": props.binding.busy() }} aria-hidden=\"true\" />}>\n <Unlink2 class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": props.binding.busy() }} aria-hidden=\"true\" />\n </Show>\n </DropdownMenu.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\"><bdi>{state()}</bdi>{\"\\n\"}{action()}</Tooltip.Content></Tooltip.Portal>\n </Tooltip>\n <DropdownMenu.Portal>\n <DropdownMenu.Content class=\"action-overflow-content\" data-integration-offers>\n <DropdownMenu.Group>\n <DropdownMenu.GroupLabel class=\"action-overflow-info\">{t(\"integrations.attachChoose\")}</DropdownMenu.GroupLabel>\n <For each={props.binding.choices() ?? []}>{offer => (\n <DropdownMenu.Item class=\"action-overflow-item\" onSelect={() => void offer.attach()}>\n <span class=\"action-overflow-item-icon\" aria-hidden=\"true\"><Link2 class=\"h-3.5 w-3.5\" /></span>\n <span class=\"action-overflow-item-label\"><bdi>{offer.label}</bdi></span>\n </DropdownMenu.Item>\n )}</For>\n </DropdownMenu.Group>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu>\n}\n\n/** Shown only when the application part needs an action, named in the row menu. */\nexport function IntegrationAttentionIndicator(props: { attention: IntegrationAttention; app: string }) {\n const { t } = useI18n()\n return <Indicator label={t(`integrations.attention.${props.attention}`, { app: props.app })} data-integration-attention={props.attention}>\n <AlertTriangle class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Indicator>\n}\n","import { createSignal, onCleanup } from \"solid-js\"\nimport Switch from \"@suid/material/Switch\"\nimport type { PluginActivationControl, PluginControlLocation, PluginControlScope } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { getLogger } from \"../lib/logger\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { pluginControlsCache } from \"../stores/plugin-controls\"\nimport { ACCENT_SWITCH_SX } from \"./settings/settings-switch\"\n\nconst log = getLogger(\"session\")\nconst [pending, setPending] = createSignal<ReadonlySet<string>>(new Set())\nconst pendingKey = (instanceId: string, location: PluginControlLocation, scope: PluginControlScope, pluginId: string) =>\n JSON.stringify([instanceId, location.directory, scope, pluginId])\n\n/** One activation mutation per plugin, scope and Location at a time, shared by every surface that shows the switch. */\nexport function isPluginActivationPending(instanceId: string, location: PluginControlLocation, scope: PluginControlScope, pluginId: string): boolean {\n return pending().has(pendingKey(instanceId, location, scope, pluginId))\n}\n\nexport function pluginScopeChecked(control: PluginActivationControl, scope: PluginControlScope): boolean {\n const scoped = control[scope]\n if (scoped !== \"default\") return scoped === \"enabled\"\n return scope === \"project\" ? pluginScopeChecked(control, \"global\") : true\n}\n\nfunction errorMessageKey(error: unknown): string {\n if (!(error instanceof HttpResponseError)) return \"instanceServiceStatus.plugins.errors.save\"\n if (error.status === 403) return \"instanceServiceStatus.plugins.errors.forbidden\"\n if (error.status === 409) return \"instanceServiceStatus.plugins.errors.conflict\"\n if (error.status === 422) return \"instanceServiceStatus.plugins.errors.invalidConfig\"\n return \"instanceServiceStatus.plugins.errors.save\"\n}\n\n/**\n * The Global or Project activation switch of one plugin: the native activation-rule mutation, without confirmation.\n * Feedback belongs to the surface that started it, while it still shows the same Location.\n */\nexport function PluginActivationSwitch(props: {\n instanceId: string\n location: PluginControlLocation\n control: PluginActivationControl | undefined\n scope: PluginControlScope\n available: boolean\n /** Accessible name; it includes the plugin's name and the scope. */\n label: string\n /** The plugin's shown name in error feedback; its ID otherwise. */\n name?: string\n describedBy?: string\n active?: boolean\n /** Shown but not writable here, with this reason as its tooltip; it stays focusable. */\n lockedReason?: string\n /** An integration's switch: the accent switch of Yolo and the settings, where a plain plugin's is the green variant. */\n integration?: boolean\n}) {\n const { t } = useI18n()\n let disposed = false\n onCleanup(() => { disposed = true })\n const isPending = () => Boolean(props.control && isPluginActivationPending(props.instanceId, props.location, props.scope, props.control.id))\n const toggle = async (control: PluginActivationControl, enabled: boolean) => {\n const instanceId = props.instanceId, location = { directory: props.location.directory }, scope = props.scope\n const key = pendingKey(instanceId, location, scope, control.id)\n if (pending().has(key)) return\n setPending(current => new Set(current).add(key))\n try {\n await pluginControlsCache.mutate(instanceId, location, control.id, scope, enabled)\n } catch (error) {\n log.error(\"Failed to update plugin activation rule\", { pluginId: control.id, scope, error })\n if (!disposed && props.active !== false && props.instanceId === instanceId && props.location.directory === location.directory) {\n showToastNotification({ category: \"opencode\", variant: \"error\",\n message: t(errorMessageKey(error), { name: props.name ?? control.id, scope: t(`instanceServiceStatus.plugins.scope.${scope}`) }) })\n }\n } finally {\n setPending(current => { const next = new Set(current); next.delete(key); return next })\n }\n }\n return (\n <div class=\"plugin-control-switch\" data-scope={props.scope} data-locked={props.lockedReason ? \"\" : undefined}\n data-integration={props.integration ? \"\" : undefined} title={props.lockedReason}>\n <Switch\n checked={props.control ? pluginScopeChecked(props.control, props.scope) : false}\n disabled={!props.available}\n color={props.integration ? \"primary\" : \"success\"}\n size=\"small\"\n sx={props.integration ? ACCENT_SWITCH_SX : undefined}\n inputProps={{\n \"aria-label\": props.label,\n \"aria-describedby\": props.describedBy,\n \"aria-disabled\": isPending() || !props.available || Boolean(props.lockedReason),\n \"aria-busy\": isPending(),\n }}\n onChange={(event, nextChecked) => {\n const current = props.control\n if (isPending() || !props.available || props.lockedReason || !current) {\n // SUID restores the controlled checked value before calling us.\n // Cancel native activation too, while retaining keyboard focus.\n event.preventDefault()\n return\n }\n void toggle(current, Boolean(nextChecked))\n }}\n />\n </div>\n )\n}\n","import { createSignal } from \"solid-js\"\nimport { getRootClient } from \"./opencode-client\"\nimport { pluginControlsCache } from \"./plugin-controls\"\nimport type { PluginControlLocation } from \"../../../server/src/api-types\"\nimport { requestLocationOptions, toRequestLocation } from \"./request-locations\"\n\nconst [pending, setPending] = createSignal<ReadonlySet<string>>(new Set())\nconst key = (instanceId: string, target: string) => JSON.stringify([instanceId, target])\nexport const isPluginPackagePending = (instanceId: string, target: string) => pending().has(key(instanceId, target))\n\n// Native updates are serialized by package target and affect the daemon's shared\n// package cache. Keep admission beyond component lifetimes; never replay writes.\nexport async function runPluginPackageAction(instanceId: string, location: PluginControlLocation, target: string, action: \"check\" | \"update\") {\n const identity = key(instanceId, target)\n if (pending().has(identity)) return\n setPending(previous => new Set(previous).add(identity))\n try {\n const client = getRootClient(instanceId), options = requestLocationOptions(location)\n const scoped = toRequestLocation(location)\n if (action === \"check\") await client.plugin.check({ location: scoped, target }, options)\n else await client.plugin.update({ location: scoped, targets: [target] }, options)\n } finally {\n setPending(previous => { const next = new Set(previous); next.delete(identity); return next })\n pluginControlsCache.invalidateInstance(instanceId)\n }\n}\n","import { For, Show, createEffect, createMemo, onCleanup } from \"solid-js\"\nimport { DropdownMenu } from \"@kobalte/core/dropdown-menu\"\nimport { AppWindow, Download, Info, MoreHorizontal, PackageSearch, RefreshCw, Trash2, Unlink2 } from \"lucide-solid\"\nimport type { PluginConfiguredSource, PluginControlLocation, PluginControlScope, PluginRuntimeSource } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { isPluginPackagePending, runPluginPackageAction } from \"../stores/plugin-package-actions\"\nimport { pluginSourcesStore } from \"../stores/plugin-sources\"\nimport { confirmIntegrationAction } from \"./integration-confirmation\"\nimport { serverEvents } from \"../lib/server-events\"\n\ntype RemovableSource = PluginConfiguredSource & { scope: PluginControlScope }\ntype Item =\n | { kind: \"host\"; action: \"install\" | \"update\" }\n | { kind: \"detach\" }\n | { kind: \"package\"; action: \"check\" | \"update\"; target: string }\n | { kind: \"remove\"; source: RemovableSource }\n | { kind: \"refresh\" }\n\nexport const PLUGIN_SOURCE_CONFIRM_EXPIRY_MS = 120_000\n\n/** One compact menu per Plugins row: for an integration its connection state, the application part's\n * installation and the displayed conversation's detach; the native package check/update, removal of each removable\n * declaration from its scope's own document, and Refresh for sources the inventory never confirmed. */\nexport function PluginRowActions(props: {\n instanceId: string\n location: PluginControlLocation\n name: string\n source?: PluginRuntimeSource\n removable: readonly RemovableSource[]\n refresh?: () => void\n active?: boolean\n consentEpoch?: number\n sessionId?: string\n /** An integration's connection state, labelling the menu's items. */\n info?: string\n /** Installs or updates an integration's application part, after its own confirmation. */\n hostAction?: { action: \"install\" | \"update\"; run: () => void }\n /** Detaches the displayed conversation from an integration's application. */\n detach?: { run: () => void; busy: boolean }\n}) {\n const { t } = useI18n()\n let afterClose: (() => void | Promise<void>) | undefined\n let generation = 0\n let confirmation: AbortController | undefined\n let trigger: HTMLButtonElement | undefined\n let surface: HTMLElement | null | undefined\n let admittedOwner: string | undefined\n let disposed = false\n const presentationOwner = () => JSON.stringify([props.instanceId, props.location.directory, props.sessionId, props.active !== false])\n const fallback = () => surface?.querySelector<HTMLButtonElement>(\"[data-plugin-refresh]\")\n const restoreFocus = () => {\n if (trigger?.isConnected && !trigger.disabled) trigger.focus()\n else fallback()?.focus()\n }\n const cancel = () => confirmation?.abort()\n const ownership = createMemo(() => JSON.stringify([props.instanceId, props.location.directory,\n props.sessionId, props.source?.type === \"package\" ? props.source.target : null, props.active !== false,\n props.consentEpoch, props.removable]))\n createEffect(() => { ownership(); generation++; cancel() })\n onCleanup(serverEvents.onTransportStatus(status => { if (status === \"disconnected\") cancel() }))\n onCleanup(serverEvents.on(\"instance.eventStatus\", event => { if (event.type === \"instance.eventStatus\" && event.instanceId === props.instanceId) cancel() }))\n onCleanup(() => {\n disposed = true; generation++; cancel()\n if (admittedOwner && (document.activeElement === trigger || document.activeElement === document.body)) queueMicrotask(() => {\n if (presentationOwner() !== admittedOwner || props.active === false) return\n if (surface?.isConnected) fallback()?.focus()\n })\n })\n const pkg = () => props.source?.type === \"package\" ? props.source : undefined\n const packageBusy = () => Boolean(pkg()?.updating || (pkg() && isPluginPackagePending(props.instanceId, pkg()!.target)))\n const removing = (source: RemovableSource) => pluginSourcesStore.isRemoving(props.instanceId, props.location, source)\n const busy = () => packageBusy() || props.removable.some(removing)\n const scopeLabel = (scope: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${scope}`)\n // Stable descriptors: icons are created by the item renderer, once per rendered item.\n const hostAction = () => props.hostAction?.action\n const items = createMemo<Item[]>(() => [\n ...(hostAction() ? [{ kind: \"host\" as const, action: hostAction()! }] : []),\n ...(props.detach ? [{ kind: \"detach\" as const }] : []),\n ...(pkg() ? [{ kind: \"package\" as const, action: pkg()!.outdated ? \"update\" as const : \"check\" as const, target: pkg()!.target }] : []),\n ...props.removable.filter(source => source.expectedRevision).map(source => ({ kind: \"remove\" as const, source })),\n ...(props.refresh ? [{ kind: \"refresh\" as const }] : []),\n ])\n const packageLabel = (item: Extract<Item, { kind: \"package\" }>) => t(`settings.pluginPackages.${item.action}`, { target: item.target })\n const label = (item: Item) => item.kind === \"package\" ? packageLabel(item)\n : item.kind === \"host\" ? t(`integrations.installHost.${item.action}`)\n : item.kind === \"detach\" ? t(\"integrations.detachConversation\")\n : item.kind === \"remove\" ? t(\"instanceServiceStatus.plugins.sources.remove\", { scope: scopeLabel(item.source.scope) })\n : t(\"instanceServiceStatus.plugins.refresh\")\n const hint = (item: Item) => item.kind === \"package\" ? t(\"settings.pluginPackages.shared\")\n : item.kind === \"host\" ? t(\"integrations.installHost.machine\")\n : item.kind === \"remove\" ? `${item.source.target}\\n${item.source.path ?? \"\"}` : undefined\n // A lone package action is the trigger itself; an integration's menu always opens on its connection state.\n const lonePackage = () => !props.info && items().length === 1 && items()[0]!.kind === \"package\"\n const triggerLabel = () => lonePackage() ? packageLabel(items()[0] as Extract<Item, { kind: \"package\" }>)\n : t(\"instanceServiceStatus.plugins.sources.actions\", { name: props.name })\n const itemDisabled = (item: Item) => busy() || props.active === false || (item.kind === \"detach\" && props.detach?.busy === true)\n\n const runPackage = (item: Extract<Item, { kind: \"package\" }>) => {\n if (packageBusy() || props.active === false) return\n const owner = presentationOwner()\n void runPluginPackageAction(props.instanceId, { ...props.location }, item.target, item.action).catch(() => {\n if (!disposed && owner === presentationOwner()) showToastNotification({ category: \"opencode\", variant: \"error\", message: t(\"settings.pluginPackages.error\", { target: item.target }) })\n })\n }\n const runRemove = async (source: RemovableSource) => {\n if (removing(source) || confirmation || props.active === false || !source.expectedRevision) return\n const captured = generation\n const instanceId = props.instanceId, location = { ...props.location }, selected = { ...source }\n const owner = ownership()\n const feedbackOwner = presentationOwner()\n surface = trigger?.closest<HTMLElement>(\".plugin-controls\")\n confirmation = new AbortController()\n const signal = confirmation.signal\n const action = t(\"instanceServiceStatus.plugins.sources.remove\", { scope: scopeLabel(source.scope) })\n const accepted = await confirmIntegrationAction(t(\"instanceServiceStatus.plugins.sources.removeWarning\"), {\n title: `${action} — ⁨${props.name}⁩`,\n detail: `${source.target}\\n${source.scope === \"global\" ? t(\"instanceServiceStatus.plugins.sources.removeGlobalWarning\") + \"\\n\" : \"\"}${t(\"instanceServiceStatus.plugins.sources.removeRecovery\")}`,\n confirmLabel: action, variant: \"warning\",\n expiresAfterMs: PLUGIN_SOURCE_CONFIRM_EXPIRY_MS, returnFocus: () => { if (presentationOwner() === feedbackOwner) restoreFocus() },\n }, signal)\n confirmation = undefined\n if (!accepted || signal.aborted || captured !== generation || ownership() !== owner) return\n admittedOwner = feedbackOwner\n void pluginSourcesStore.remove(instanceId, location, selected).catch(error => {\n if (!surface?.isConnected || presentationOwner() !== feedbackOwner) return\n const stale = error instanceof HttpResponseError && error.status === 409\n showToastNotification({ category: \"opencode\", variant: \"error\", message: t(stale\n ? \"instanceServiceStatus.plugins.sources.errors.removeStale\"\n : \"instanceServiceStatus.plugins.sources.errors.remove\", { name: source.target, scope: scopeLabel(source.scope) }) })\n })\n }\n const run = (item: Item) => item.kind === \"package\" ? runPackage(item)\n : item.kind === \"host\" ? (afterClose = () => props.hostAction?.run())\n : item.kind === \"detach\" ? props.detach?.run()\n : item.kind === \"remove\" ? (afterClose = () => runRemove(item.source)) : props.refresh?.()\n\n const icon = (item: Item, pulse = false) => item.kind === \"package\"\n ? (item.action === \"update\"\n ? <Download class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": pulse }} aria-hidden=\"true\" />\n : <PackageSearch class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": pulse }} aria-hidden=\"true\" />)\n : item.kind === \"host\" ? <AppWindow class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n : item.kind === \"detach\" ? <Unlink2 class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n : item.kind === \"remove\" ? <Trash2 class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n : <RefreshCw class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n\n const entries = () => <For each={items()}>{item => (\n <DropdownMenu.Item class=\"action-overflow-item\" disabled={itemDisabled(item)}\n title={hint(item)} onSelect={() => run(item)}>\n <span class=\"action-overflow-item-icon\" aria-hidden=\"true\">{icon(item)}</span>\n <span class=\"action-overflow-item-label\">{label(item)}</span>\n </DropdownMenu.Item>\n )}</For>\n\n return <Show when={items().length > 0 || props.info}>\n <DropdownMenu placement=\"bottom-end\" gutter={4}>\n <DropdownMenu.Trigger type=\"button\" class=\"icon-button-compact\" disabled={busy() || props.active === false}\n ref={trigger}\n title={!props.info && items().length === 1 ? [label(items()[0]!), hint(items()[0]!)].filter(Boolean).join(\"\\n\") : triggerLabel()}\n aria-label={triggerLabel()} aria-busy={busy()}>\n <Show when={lonePackage()} fallback={<MoreHorizontal class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": busy() }} aria-hidden=\"true\" />}>\n {icon(items()[0]!, busy())}\n </Show>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content class=\"action-overflow-content\" onCloseAutoFocus={() => {\n const action = afterClose; afterClose = undefined\n if (action) queueMicrotask(() => void action())\n }}>\n <Show when={props.info} fallback={entries()}>{info => (\n <DropdownMenu.Group>\n <DropdownMenu.GroupLabel class=\"action-overflow-info\" data-integration-connection>\n <Info class=\"h-3.5 w-3.5\" aria-hidden=\"true\" /><bdi>{info()}</bdi>\n </DropdownMenu.GroupLabel>\n {entries()}\n </DropdownMenu.Group>\n )}</Show>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu>\n </Show>\n}\n","import { Dialog } from \"@kobalte/core/dialog\"\nimport { For, Show, createEffect, createMemo, createSignal, onCleanup, type Accessor } from \"solid-js\"\nimport { BookOpen, RefreshCw } from \"lucide-solid\"\nimport type { PluginControlLocation, PluginControlScope } from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\nimport { openExternalUrl } from \"../lib/external-url\"\nimport { useI18n } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { integrationEpoch, integrations } from \"../stores/integrations\"\nimport { pluginSourcesStore } from \"../stores/plugin-sources\"\nimport { InfoPopoverButton } from \"./info-popover-button\"\nimport { confirmIntegrationAction } from \"./integration-confirmation\"\nimport { integrationSummary } from \"../lib/integration-row-state\"\nimport WindowCloseButton from \"./window-close-button\"\n\n/** Catalogue entries that can be installed here: neither declared nor loaded, and not ambiguous. */\nexport function installableIntegrations(entries: readonly IntegrationView[]): IntegrationView[] {\n return entries.filter(entry => !entry.ambiguous && !entry.plugin.declared && entry.plugin.runtime === undefined)\n}\n\n/**\n * \"Add an integration…\": one row per installable catalogue entry, in catalogue order. Install confirms, closes the\n * window and installs by catalogue ID; the integration's Status section then shows the installation.\n */\nexport function IntegrationCatalogWindow(props: {\n instanceId: string\n location: PluginControlLocation\n projectAvailable: boolean\n active?: boolean\n sessionId?: string\n open: boolean\n onClose: () => void\n /** The \"+\" trigger, focused again on close when it is still shown. */\n trigger: () => HTMLElement | undefined\n}) {\n const { t, locale } = useI18n()\n const state = createMemo(() => integrations.state(props.instanceId, props.location.directory))\n const response = () => { const value = state(); return value.status === \"ready\" ? value.response : undefined }\n const catalog = () => response()?.catalog\n const rows = createMemo(() => installableIntegrations(response()?.integrations ?? []))\n const unavailable = () => state().status === \"error\" || catalog()?.state === \"unavailable\"\n const scopeLabel = (scope: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${scope}`)\n const date = () => {\n const value = catalog()?.fetchedAt\n return value ? new Intl.DateTimeFormat(locale(), { dateStyle: \"medium\" }).format(new Date(value)) : \"\"\n }\n const refresh = () => void integrations.refreshDemanded(props.instanceId)\n const focusTrigger = () => {\n const trigger = props.trigger()\n if (trigger?.isConnected && trigger.getClientRects().length) trigger.focus()\n else document.querySelector<HTMLElement>('[data-status-section-trigger=\"plugins\"]')?.focus()\n }\n\n const active = () => props.active !== false\n const identity = createMemo(() => JSON.stringify([props.instanceId, props.location.directory, props.sessionId, active(), props.open,\n integrationEpoch(props.instanceId, props.sessionId)]))\n let confirmation: AbortController | undefined\n createEffect(() => { identity(); confirmation?.abort() })\n onCleanup(() => confirmation?.abort())\n const install = async (entry: IntegrationView, scope: PluginControlScope) => {\n if (!active() || confirmation) return\n const instanceId = props.instanceId, location = { directory: props.location.directory }\n const owner = identity()\n confirmation = new AbortController()\n const signal = confirmation.signal\n const accepted = await confirmIntegrationAction(t(\"integrations.install.confirm\", { name: entry.displayName, scope: scopeLabel(scope) }), {\n title: t(\"integrations.install.title\"), confirmLabel: t(\"integrations.catalog.install\"), variant: \"warning\",\n ...(scope === \"project\" ? { detail: t(\"instanceServiceStatus.plugins.sources.projectWarning\") } : {}),\n returnFocus: focusTrigger,\n }, signal)\n confirmation = undefined\n if (!accepted || signal.aborted || identity() !== owner) return\n props.onClose()\n try {\n // Sent once: a lost answer is reconciled by the next read, never replayed.\n await pluginSourcesStore.installIntegration(instanceId, location, entry.id, scope)\n showToastNotification({ category: \"opencode\", variant: \"info\", message: t(\"integrations.message.installRequested\") })\n } catch {\n showToastNotification({ category: \"opencode\", variant: \"error\", message: t(\"integrations.install.error\") })\n }\n }\n\n return <Show when={props.open}>\n <Dialog open modal onOpenChange={next => { if (!next) props.onClose() }}>\n <Dialog.Portal><Dialog.Overlay class=\"modal-overlay z-[1300]\" />\n <Dialog.Content role=\"dialog\" class=\"window-shell integration-catalog\" onCloseAutoFocus={event => { event.preventDefault(); focusTrigger() }}>\n <header class=\"window-header\">\n <Dialog.Title class=\"window-title\">{t(\"integrations.catalog.title\")}</Dialog.Title>\n <WindowCloseButton onClose={props.onClose} />\n </header>\n <div class=\"window-body integration-catalog-body\">\n <Show when={unavailable()}>\n <p class=\"integration-catalog-state\" role=\"status\">\n {t(\"integrations.catalogUnavailable\")}\n <button type=\"button\" class=\"icon-button-compact\" aria-label={t(\"integrations.refresh\")} title={t(\"integrations.refresh\")} onClick={refresh}>\n <RefreshCw class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </button>\n </p>\n </Show>\n <Show when={!unavailable() && catalog()?.state === \"stale\"}>\n <p class=\"integration-catalog-state\" role=\"status\">{t(\"integrations.catalogStale\", { date: date() })}</p>\n </Show>\n <Show when={!unavailable() && response()}>\n <Show when={rows().length > 0} fallback={<p class=\"integration-catalog-state\">{t(\"integrations.catalog.allInstalled\")}</p>}>\n <ul class=\"integration-catalog-list\">\n <For each={rows()}>{entry => <IntegrationCatalogRow t={t} entry={entry} summary={() => integrationSummary(entry, locale())}\n projectAvailable={props.projectAvailable} disabled={props.active === false} onInstall={scope => void install(entry, scope)} />}</For>\n </ul>\n </Show>\n </Show>\n </div>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog>\n </Show>\n}\n\nfunction IntegrationCatalogRow(props: {\n t: (key: string, vars?: Record<string, any>) => string\n entry: IntegrationView\n summary: Accessor<string>\n projectAvailable: boolean\n disabled: boolean\n onInstall: (scope: PluginControlScope) => void\n}) {\n const t = props.t\n const [scope, setScope] = createSignal<PluginControlScope>(\"global\")\n // D18: a native integration installs in Global only; its scope selector stays focusable to show why.\n const globalOnly = () => props.entry.family === \"native\"\n const scopeLabel = (value: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${value}`)\n return <li class=\"integration-catalog-row\" data-catalog-integration={props.entry.id}>\n <span class=\"integration-catalog-name\"><bdi>{props.entry.displayName}</bdi></span>\n <span class=\"integration-state-badge badge-shape\" data-integration-family={props.entry.family}>{t(`integrations.catalog.family.${props.entry.family}`)}</span>\n <InfoPopoverButton label={t(\"integrations.info\", { name: props.entry.displayName })}><p>{props.summary()}</p></InfoPopoverButton>\n <Show when={props.entry.docs}>{docs => (\n <button type=\"button\" class=\"section-info-trigger\" aria-label={t(\"integrations.docs\")} title={t(\"integrations.docs\")}\n onClick={() => void openExternalUrl(docs(), \"integration-docs\")}><BookOpen class=\"section-info-icon\" aria-hidden=\"true\" /></button>\n )}</Show>\n <select class=\"integration-catalog-scope\" aria-label={`${t(\"integrations.catalog.scope\")} — ${props.entry.displayName}`}\n value={globalOnly() ? \"global\" : scope()} aria-disabled={globalOnly() ? \"true\" : undefined}\n title={globalOnly() ? t(\"integrations.section.scopeGlobalOnly\") : undefined}\n onMouseDown={event => { if (globalOnly()) event.preventDefault() }}\n onKeyDown={event => { if (globalOnly() && event.key !== \"Tab\" && event.key !== \"Escape\") event.preventDefault() }}\n onChange={event => { if (globalOnly()) event.currentTarget.value = \"global\"; else setScope(event.currentTarget.value as PluginControlScope) }}>\n <option value=\"global\">{scopeLabel(\"global\")}</option>\n <option value=\"project\" disabled={!props.projectAvailable || globalOnly()}>{scopeLabel(\"project\")}</option>\n </select>\n <button type=\"button\" class=\"window-text-button\" disabled={props.disabled}\n aria-label={`${t(\"integrations.catalog.install\")} — ${props.entry.displayName}`}\n onClick={() => props.onInstall(globalOnly() ? \"global\" : scope())}>{t(\"integrations.catalog.install\")}</button>\n </li>\n}\n","import { Show, createEffect, createSignal, createUniqueId, on } from \"solid-js\"\nimport { Popover } from \"@kobalte/core/popover\"\nimport type { PluginControlLocation, PluginControlScope } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { getLogger } from \"../lib/logger\"\nimport { nativeSelectListOpen } from \"../lib/native-select-open\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { pluginSourcesStore } from \"../stores/plugin-sources\"\n\nconst log = getLogger(\"session\")\n\n/** \"Add a plugin…\" of the Plugins \"+\" menu: a transient window, anchored to that menu's trigger, that adds one\n * registry or Git package to a scope's OpenCode configuration. Success is shown by the row, never here. */\nexport function PluginSourceAdd(props: {\n instanceId: string\n location: PluginControlLocation\n projectAvailable: boolean\n active?: boolean\n open: boolean\n onOpenChange: (open: boolean) => void\n anchor: () => HTMLElement | undefined\n}) {\n const { t } = useI18n()\n const id = createUniqueId()\n const [spec, setSpec] = createSignal(\"\")\n const [scope, setScope] = createSignal<PluginControlScope>(\"global\")\n const [pending, setPending] = createSignal(false)\n const [error, setError] = createSignal<string>()\n const scopeLabel = (value: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${value}`)\n const setOpen = (next: boolean) => props.onOpenChange(next)\n createEffect(on(() => props.open, open => { if (open) { setSpec(\"\"); setScope(\"global\"); setError(undefined) } }))\n\n const openChange = (next: boolean) => {\n if (pending()) return\n setOpen(next)\n }\n\n const submit = async (event: SubmitEvent) => {\n event.preventDefault()\n const value = spec().trim()\n if (!value || pending() || props.active === false) return\n // Never widen the chosen scope: an unavailable Project target is refused by the server.\n const target = scope()\n setPending(true)\n setError(undefined)\n try {\n await pluginSourcesStore.add(props.instanceId, props.location, target, value)\n setOpen(false)\n } catch (failure) {\n log.error(\"Failed to add plugin source\", { scope: target, error: failure })\n setError(t(errorKey(failure), { scope: scopeLabel(target), global: scopeLabel(\"global\") }))\n } finally {\n setPending(false)\n }\n }\n\n return (\n <Popover placement=\"bottom-start\" gutter={4} open={props.open} onOpenChange={openChange} anchorRef={props.anchor}>\n <Popover.Portal>\n <Popover.Content class=\"window-shell plugin-source-add\" aria-busy={pending()}\n onCloseAutoFocus={event => { event.preventDefault(); const anchor = props.anchor(); if (anchor?.isConnected) anchor.focus() }}>\n <header class=\"window-header\">\n <Popover.Title class=\"window-title\">{t(\"instanceServiceStatus.plugins.sources.addTitle\")}</Popover.Title>\n </header>\n <form onSubmit={event => void submit(event)}>\n <div class=\"window-body plugin-source-add-body\">\n <label for={`${id}-spec`}>{t(\"instanceServiceStatus.plugins.sources.spec\")}</label>\n <input id={`${id}-spec`} class=\"form-input\" name=\"spec\" autocomplete=\"off\" autocapitalize=\"none\" autocorrect=\"off\"\n spellcheck={false} required maxLength={512} placeholder={t(\"instanceServiceStatus.plugins.sources.specPlaceholder\")}\n value={spec()} disabled={pending()} aria-invalid={Boolean(error())} aria-describedby={`${id}-trust ${id}-error`}\n onInput={event => { setSpec(event.currentTarget.value); setError(undefined) }} />\n <label for={`${id}-scope`}>{t(\"instanceServiceStatus.plugins.sources.scope\")}</label>\n <select id={`${id}-scope`} value={scope()} disabled={pending()}\n on:keydown={(event) => { if (event.key === \"Escape\" && nativeSelectListOpen(event.currentTarget)) event.stopPropagation() }}\n onChange={event => setScope(event.currentTarget.value as PluginControlScope)}>\n <option value=\"global\">{scopeLabel(\"global\")}</option>\n <option value=\"project\" disabled={!props.projectAvailable}>{scopeLabel(\"project\")}</option>\n </select>\n <Popover.Description id={`${id}-trust`} class=\"plugin-source-add-note\">\n {t(\"instanceServiceStatus.plugins.sources.trust\")}\n </Popover.Description>\n <Show when={scope() === \"project\"}>\n <p class=\"plugin-source-add-note\" role=\"note\">{t(\"instanceServiceStatus.plugins.sources.projectWarning\")}</p>\n </Show>\n <p id={`${id}-error`} class=\"plugin-source-add-error\" role=\"alert\">{error() ?? \"\"}</p>\n </div>\n <div class=\"window-footer\">\n <button type=\"submit\" class=\"window-action\" disabled={pending() || !spec().trim()} aria-busy={pending()}>\n {t(pending() ? \"instanceServiceStatus.plugins.sources.adding\" : \"instanceServiceStatus.plugins.sources.submit\")}\n </button>\n </div>\n </form>\n </Popover.Content>\n </Popover.Portal>\n </Popover>\n )\n}\n\nfunction errorKey(error: unknown): string {\n if (!(error instanceof HttpResponseError)) return \"instanceServiceStatus.plugins.sources.errors.add\"\n const known: Record<string, string> = {\n \"invalid-spec\": \"instanceServiceStatus.plugins.sources.errors.invalidSpec\",\n \"local-path\": \"instanceServiceStatus.plugins.sources.errors.localPath\",\n \"plugin-id\": \"instanceServiceStatus.plugins.sources.errors.pluginId\",\n duplicate: \"instanceServiceStatus.plugins.sources.errors.duplicate\",\n \"global-only\": \"instanceServiceStatus.plugins.sources.errors.globalOnly\",\n timeout: \"instanceServiceStatus.plugins.sources.errors.timeout\",\n }\n if (error.code && known[error.code]) return known[error.code]!\n if (error.status === 403) return \"instanceServiceStatus.plugins.sources.errors.forbidden\"\n if (error.status === 409) return \"instanceServiceStatus.plugins.sources.errors.conflict\"\n if (error.status === 422) return \"instanceServiceStatus.plugins.sources.errors.invalidConfig\"\n if (error.status === 503) return \"instanceServiceStatus.plugins.sources.errors.unavailable\"\n return \"instanceServiceStatus.plugins.sources.errors.add\"\n}\n","import { For, createSignal } from \"solid-js\"\nimport { DropdownMenu } from \"@kobalte/core/dropdown-menu\"\nimport { Blocks, Package, Plus } from \"lucide-solid\"\nimport type { PluginControlLocation } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { IntegrationCatalogWindow } from \"./integration-catalog-window\"\nimport { PluginSourceAdd } from \"./plugin-source-add\"\n\ntype Item = { kind: \"integration\" | \"plugin\" }\n// Stable descriptors: icons are created by the item renderer, once per rendered item.\nconst ITEMS: readonly Item[] = [{ kind: \"integration\" }, { kind: \"plugin\" }]\n\n/** The Plugins \"+\" menu: \"Add an integration…\" (the reviewed catalogue) and \"Add a plugin…\" (any package). */\nexport function PluginAddMenu(props: {\n instanceId: string\n location: PluginControlLocation\n projectAvailable: boolean\n active?: boolean\n sessionId?: string\n}) {\n const { t } = useI18n()\n const [plugin, setPlugin] = createSignal(false)\n const [catalog, setCatalog] = createSignal(false)\n let trigger: HTMLButtonElement | undefined\n let afterClose: (() => void) | undefined\n const label = (item: Item) => t(item.kind === \"integration\" ? \"integrations.add\" : \"instanceServiceStatus.plugins.sources.addPlugin\")\n return <>\n <DropdownMenu placement=\"bottom-start\" gutter={4}>\n <DropdownMenu.Trigger ref={trigger} type=\"button\" class=\"icon-button-compact\" disabled={props.active === false}\n title={t(\"instanceServiceStatus.plugins.sources.add\")} aria-label={t(\"instanceServiceStatus.plugins.sources.add\")}>\n <Plus class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content class=\"action-overflow-content\" onCloseAutoFocus={event => {\n const action = afterClose; afterClose = undefined\n if (!action) return\n // The next window takes focus; never hand it back to the trigger first.\n event.preventDefault()\n queueMicrotask(action)\n }}>\n <For each={ITEMS}>{item => (\n <DropdownMenu.Item class=\"action-overflow-item\" disabled={props.active === false}\n onSelect={() => { afterClose = () => (item.kind === \"integration\" ? setCatalog : setPlugin)(true) }}>\n <span class=\"action-overflow-item-icon\" aria-hidden=\"true\">\n {item.kind === \"integration\" ? <Blocks class=\"h-3.5 w-3.5\" /> : <Package class=\"h-3.5 w-3.5\" />}\n </span>\n <span class=\"action-overflow-item-label\">{label(item)}</span>\n </DropdownMenu.Item>\n )}</For>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu>\n <PluginSourceAdd instanceId={props.instanceId} location={props.location} projectAvailable={props.projectAvailable} active={props.active}\n open={plugin()} onOpenChange={setPlugin} anchor={() => trigger} />\n <IntegrationCatalogWindow instanceId={props.instanceId} location={props.location} projectAvailable={props.projectAvailable}\n active={props.active} sessionId={props.sessionId} open={catalog()} onClose={() => setCatalog(false)} trigger={() => trigger} />\n </>\n}\n","import { For, Show, createMemo, createSignal, createUniqueId, onCleanup } from \"solid-js\"\nimport type { PluginActivationControl, PluginConfigScope, PluginControlLocation, PluginControlScope, PluginControlsSnapshot, PluginRuntimeInventoryEntry } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { pluginControlsCache } from \"../stores/plugin-controls\"\nimport { InfoPopoverButton } from \"./info-popover-button\"\n\nconst VALUE_PLACEHOLDER = \"\\ufffc\"\nconst isolatedValue = (text: string, value: string) => text.split(VALUE_PLACEHOLDER)\n .flatMap((part, index) => index ? [<bdi>{value}</bdi>, part] : [part])\n\ninterface AttentionEntry {\n key: string\n name: string\n control?: PluginActivationControl\n runtime?: PluginRuntimeInventoryEntry\n}\n\nexport function PluginSystemAttention(props: {\n instanceId: string\n location: PluginControlLocation\n snapshot?: PluginControlsSnapshot\n runtimeUnconfirmed?: ReadonlySet<string>\n active?: boolean\n restoreFocus: () => void\n}) {\n const { t } = useI18n()\n const headingId = `plugin-system-attention-${createUniqueId()}`\n const entries = createMemo(() => {\n const result = new Map<string, AttentionEntry>()\n const represented = new Set<string>()\n const representedRuntimeKeys = new Set<string>()\n for (const control of props.snapshot?.controls ?? []) {\n if (control.managedBy !== \"codenomad\") continue\n if (control.runtime?.source.type === \"package\") represented.add(control.runtime.source.target)\n if (control.runtime?.source.type === \"local\") represented.add(control.runtime.source.path)\n if (control.runtime) representedRuntimeKeys.add(control.runtime.key)\n result.set(`id:${control.id}`, { key: `id:${control.id}`, name: control.id, control, runtime: control.runtime })\n }\n for (const runtime of props.snapshot?.runtime ?? []) {\n if (runtime.managedBy !== \"codenomad\") continue\n if (representedRuntimeKeys.has(runtime.key)) continue\n const name = runtime.id ?? (runtime.source.type === \"package\" ? runtime.source.target : runtime.source.type === \"local\" ? runtime.source.path : runtime.key)\n const key = runtime.id ? `id:${runtime.id}` : `target:${name}`\n if (runtime.source.type === \"package\") represented.add(runtime.source.target)\n if (runtime.source.type === \"local\") represented.add(runtime.source.path)\n if (!result.has(key)) result.set(key, { key, name, runtime })\n }\n for (const source of props.snapshot?.configured.sources ?? []) {\n if (source.managedBy !== \"codenomad\" || represented.has(source.target) || (source.pluginId && result.has(`id:${source.pluginId}`))) continue\n const key = `target:${source.target}`\n result.set(key, { key, name: source.pluginId ?? source.target })\n }\n return new Map([...result].filter(([, entry]) => entry.control?.effective === \"disabled\" || entry.runtime?.state.status !== \"active\" || props.runtimeUnconfirmed?.has(entry.name)))\n })\n const keys = createMemo(() => [...entries().keys()])\n const renderEntry = (key: string) => {\n const entry = () => entries().get(key)\n const [pending, setPending] = createSignal(false)\n const [mutationScope, setMutationScope] = createSignal<PluginControlScope>()\n const [error, setError] = createSignal<string>()\n let row: HTMLDivElement | undefined\n let disposed = false\n const restoreFocus = () => {\n if (props.active === false) return\n requestAnimationFrame(() => {\n if (props.active !== false && document.activeElement === document.body) props.restoreFocus()\n })\n }\n onCleanup(() => {\n disposed = true\n if (row?.contains(document.activeElement)) restoreFocus()\n })\n const disabled = () => entry()?.control?.effective === \"disabled\"\n const scope = (): PluginControlScope | undefined => {\n if (!disabled()) return\n const controlling = entry()?.control?.controllingRule?.scope\n const writable = (value: string | undefined) => props.snapshot?.targets.some(target => target.scope === value)\n if ((controlling === \"global\" || controlling === \"project\") && writable(controlling)) return controlling\n return writable(\"project\") ? \"project\" : undefined\n }\n const scopeLabel = (value: string | undefined) => t(`instanceServiceStatus.plugins.scope.${value ?? \"project\"}`)\n const configurations = createMemo(() => {\n const current = entry(), runtime = current?.runtime?.source\n const target = runtime?.type === \"package\" ? runtime.target : runtime?.type === \"local\" ? runtime.path : undefined\n const sources = props.snapshot?.configured.sources.filter(source => source.managedBy === \"codenomad\" && (\n (source.pluginId && source.pluginId === current?.name) || source.target === target || `target:${source.target}` === key\n )) ?? []\n const rule = current?.control?.controllingRule\n const records: Array<{ scope: PluginConfigScope; path?: string }> = sources.map(source => ({ scope: source.scope, path: source.path ?? source.target }))\n if (rule) {\n const path = rule.path ?? props.snapshot?.targets.find(target => target.scope === rule.scope)?.path\n records.push({ scope: rule.scope, path })\n }\n if (!records.length) {\n const target = props.snapshot?.targets.find(target => target.scope === \"global\") ?? props.snapshot?.targets[0]\n if (target) records.push({ scope: target.scope, path: target.path })\n }\n return [...new Map(records.map(record => [JSON.stringify(record), record])).values()]\n })\n const shownScopes = () => [...new Set(configurations().map(record => scopeLabel(record.scope)))].join(\" / \")\n const label = () => t(`instanceServiceStatus.plugins.system.${disabled() ? \"disabled\" : props.runtimeUnconfirmed?.has(entry()?.name ?? \"\") ? \"unconfirmed\" : entry()?.runtime?.state.status === \"failed\" ? \"failed\" : \"unconfirmed\"}`,\n { name: VALUE_PLACEHOLDER, scope: scopeLabel(entry()?.control?.controllingRule?.scope) })\n const failed = () => {\n const state = entry()?.runtime?.state\n return state?.status === \"failed\" ? state : undefined\n }\n const runtimeDetails = createMemo(() => {\n const source = entry()?.runtime?.source\n return source?.type === \"local\" || source?.type === \"package\"\n ? isolatedValue(t(`instanceServiceStatus.plugins.source.${source.type}`, { source: VALUE_PLACEHOLDER }), source.type === \"local\" ? source.path : source.target)\n : undefined\n })\n const Details = () => {\n let container: HTMLDivElement | undefined\n onCleanup(() => {\n if (!entries().has(key) && container?.closest(\".info-popover-content\")?.contains(document.activeElement)) restoreFocus()\n })\n return <div ref={container} class=\"plugin-system-attention-details\">\n <div><bdi>{entry()?.name}</bdi></div>\n <Show when={runtimeDetails()}>{value => <div>{value()}</div>}</Show>\n <For each={configurations()}>{record => <div>{scopeLabel(record.scope)}<Show when={record.path}>{path => <> — <bdi>{path()}</bdi></>}</Show></div>}</For>\n <Show when={failed()}>{failure => <>\n <div><bdi>{failure().error}</bdi></div>\n <Show when={failure().ref}>{ref => <div>{isolatedValue(t(\"instanceServiceStatus.plugins.sources.failureRef\", { ref: VALUE_PLACEHOLDER }), ref())}</div>}</Show>\n </>}</Show>\n </div>\n }\n const active = () => props.active !== false\n const reenable = async () => {\n const current = entry(), targetScope = scope()\n if (!current?.control || !targetScope || pending() || !active()) return\n const instanceId = props.instanceId, location = { directory: props.location.directory }\n setMutationScope(targetScope)\n setPending(true)\n setError(undefined)\n try {\n await pluginControlsCache.mutate(instanceId, location, current.control.id, targetScope, true)\n } catch {\n if (!disposed && active() && props.instanceId === instanceId && props.location.directory === location.directory) {\n setError(t(\"instanceServiceStatus.plugins.errors.save\", { name: current.name, scope: scopeLabel(targetScope) }))\n }\n } finally {\n if (!disposed) setPending(false)\n }\n }\n const renderAction = () => {\n let button: HTMLButtonElement | undefined\n onCleanup(() => { if (button === document.activeElement) restoreFocus() })\n return <button ref={button} type=\"button\" class=\"window-text-button\" aria-busy={pending()} aria-disabled={pending()}\n aria-label={t(\"instanceServiceStatus.plugins.system.reenableAriaLabel\", { name: entry()?.name ?? \"\", scope: scopeLabel(scope() ?? mutationScope()) })}\n onClick={() => void reenable()}>\n {t(pending() ? \"instanceServiceStatus.plugins.system.reenabling\" : \"instanceServiceStatus.plugins.system.reenable\")}\n </button>\n }\n return <div ref={row} class=\"plugin-system-attention-entry\" data-system-plugin={key}>\n <div class=\"plugin-system-attention-row\">\n <span class=\"plugin-system-attention-label\">{isolatedValue(label(), entry()?.name ?? \"\")}</span>\n <Show when={!disabled() || (scope() && scope() !== entry()?.control?.controllingRule?.scope)}>\n <span class=\"plugin-system-attention-scope\">{disabled() ? scopeLabel(scope()) : shownScopes()}</span>\n </Show>\n <InfoPopoverButton label={t(\"instanceServiceStatus.plugins.system.details\", { name: entry()?.name ?? \"\" })}>\n <Details />\n </InfoPopoverButton>\n <Show when={scope() || pending()}>{(_scope) => renderAction()}</Show>\n </div>\n <Show when={error()}><span role=\"alert\">{error()}</span></Show>\n </div>\n }\n return <Show when={keys().length > 0}>\n <div class=\"plugin-system-attention\" role=\"status\" aria-live=\"polite\" aria-labelledby={headingId}>\n <div id={headingId} class=\"plugin-system-attention-heading\">{t(\"instanceServiceStatus.plugins.system.attention\")}</div>\n <For each={keys()}>{renderEntry}</For>\n </div>\n </Show>\n}\n","import type { WorkspaceEventPayload } from \"../../../server/src/api-types\"\nimport { serverEvents } from \"../lib/server-events\"\nimport { pluginControlsCache } from \"./plugin-controls\"\nimport { pluginSourcesStore } from \"./plugin-sources\"\n\ntype InstanceEvent = Extract<WorkspaceEventPayload, { type: \"instance.event\" }>\n\nserverEvents.on(\"instance.event\", (event) => {\n const payload = event as InstanceEvent\n if (payload.event.type !== \"config.updated\" && payload.event.type !== \"plugin.updated\") return\n if (payload.event.type === \"config.updated\") {\n // A config event does not identify whether its changed document was global.\n // Mark every worktree snapshot stale, but let visible consumers demand reads.\n pluginControlsCache.invalidateInstance(payload.instanceId)\n return\n }\n const directory = payload.event.location?.directory\n if (directory) {\n pluginControlsCache.invalidateLocation(payload.instanceId, { directory })\n return\n }\n pluginControlsCache.invalidateInstance(payload.instanceId)\n})\n\nserverEvents.on(\"instance.eventStatus\", (event) => {\n if (event.type === \"instance.eventStatus\" && event.status === \"connected\") {\n pluginControlsCache.invalidateInstance(event.instanceId)\n }\n})\n\n// Renderer-to-backend reconnects are independent of the native subscription.\n// The event transport has no replay; visible demand reconciles these snapshots,\n// while hidden worktrees remain stale until their next activation.\nserverEvents.onOpen(() => pluginControlsCache.invalidateAll())\n\nserverEvents.on(\"workspace.stopped\", (event) => {\n if (event.type !== \"workspace.stopped\") return\n pluginControlsCache.clearInstance(event.workspaceId)\n pluginSourcesStore.clearInstance(event.workspaceId)\n})\n","import { For, Show, createEffect, createMemo, createUniqueId, onCleanup, type Component } from \"solid-js\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport { Loader2, RefreshCw } from \"lucide-solid\"\nimport type {\n PluginConfiguredSource,\n PluginControlLocation,\n PluginControlScope,\n PluginRuntimeInventoryEntry,\n PluginRuntimeSource,\n} from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { integrationAttention, integrationConnection, integrationConnectionMessage } from \"../lib/integration-row-state\"\nimport { integrationDisplayPlugin } from \"../lib/integration-rows\"\nimport { integrationBindings, integrations } from \"../stores/integrations\"\nimport { pluginControlsCache } from \"../stores/plugin-controls\"\nimport { pluginSourcesStore, removableSources } from \"../stores/plugin-sources\"\nimport { createIntegrationHostInstallation } from \"./integration-host-installation\"\nimport { createIntegrationRowBinding } from \"./integration-row-binding\"\nimport { IntegrationAttentionIndicator, IntegrationLinkButton } from \"./integration-row-indicators\"\nimport { PluginActivationSwitch } from \"./plugin-activation-switch\"\nimport { PluginRowActions } from \"./plugin-row-actions\"\nimport { PluginAddMenu } from \"./plugin-add-menu\"\nimport { PluginSystemAttention } from \"./plugin-system-attention\"\nimport \"../stores/plugin-controls-events\"\n\ninterface PluginActivationControlsProps {\n instanceId: string\n location: PluginControlLocation\n active?: boolean\n session?: { id: string; title?: string; metadata?: Record<string, unknown> }\n}\n\nexport const PluginActivationControls: Component<PluginActivationControlsProps> = (props) => {\n const { t } = useI18n()\n const headingId = `plugin-controls-${createUniqueId()}`\n const noticeId = `${headingId}-notice`\n const globalLabelId = `plugin-controls-${createUniqueId()}-global`\n const projectLabelId = `plugin-controls-${createUniqueId()}-project`\n const directory = createMemo(() => props.location.directory)\n createEffect(() => {\n const instanceId = props.instanceId, location = directory()\n if (props.active === false || !location) return\n onCleanup(integrations.demand(instanceId, location))\n })\n // A source that designates an ambiguous integration belongs to none: its row says so.\n const nonConforming = (sources: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[]) => {\n const value = integrations.state(props.instanceId, directory())\n return value.status === \"ready\" && sourcesOverlap(value.response.ambiguousSources ?? [], sources)\n }\n const nonConformingLabel = (sources: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[]) => (\n <Show when={nonConforming(sources)}>\n <span class=\"integration-state-badge badge-shape\" data-integration-state=\"nonConforming\">{t(\"integrations.state.nonConforming\")}</span>\n </Show>\n )\n let cachedLocation: PluginControlLocation | undefined\n const requestLocation = (): PluginControlLocation => {\n if (!cachedLocation || cachedLocation.directory !== directory()) {\n cachedLocation = { directory: directory() }\n }\n return cachedLocation\n }\n const state = createMemo(() => pluginControlsCache.state(props.instanceId, requestLocation()))\n const consentEpoch = () => state().invalidationRevision\n const snapshot = createMemo(() => state().snapshot)\n let refreshButton: HTMLButtonElement | undefined\n // Recognised integrations by the plugin ID or the declared target of their row; an ambiguous one has no row of its own.\n const recognised = createMemo(() => {\n const value = integrations.state(props.instanceId, directory())\n const byControl = new Map<string, IntegrationView>(), byTarget = new Map<string, IntegrationView>()\n for (const entry of value.status === \"ready\" ? value.response.integrations : []) {\n if (entry.ambiguous) continue\n const plugin = integrationDisplayPlugin(snapshot(), entry)\n if (plugin.control) byControl.set(plugin.control.id, entry)\n for (const source of plugin.sources) byTarget.set(source.target, entry)\n }\n return { byControl, byTarget }\n })\n // Fresh reads only: installing an application part needs a current status.\n const freshIntegrations = () => {\n const value = integrations.state(props.instanceId, directory())\n return value.status === \"ready\" && !value.stale ? value.response.integrations : []\n }\n const installation = createIntegrationHostInstallation({\n get instanceId() { return props.instanceId },\n get directory() { return directory() },\n get sessionId() { return props.session?.id },\n get active() { return props.active },\n entries: freshIntegrations,\n })\n const controls = createMemo(() => (\n snapshot()?.controls.filter((control) => control.managedBy !== \"codenomad\" && !control.builtin && control.runtime?.source.type !== \"builtin\") ?? []\n ))\n const controlsById = createMemo(() => new Map(controls().map((control) => [control.id, control])))\n const controlIds = createMemo(() => [...controlsById().keys()])\n // A source can fail before exporting a plugin ID. Keep its native target\n // actionable without inventing an ID that could become an activation rule.\n const runtimesByTarget = createMemo(() => {\n const represented = new Set(controls().flatMap(control =>\n control.runtime?.source.type === \"package\" ? [control.runtime.source.target]\n : control.runtime?.source.type === \"local\" ? [control.runtime.source.path] : []))\n const entries = new Map<string, PluginRuntimeInventoryEntry>()\n for (const entry of snapshot()?.runtime ?? []) {\n if (entry.managedBy === \"codenomad\") continue\n const target = entry.source.type === \"package\" ? entry.source.target\n : entry.source.type === \"local\" && entry.state.status === \"failed\" ? entry.source.path : undefined\n if (!target || represented.has(target)) continue\n if (!entries.has(target)) entries.set(target, entry)\n }\n return entries\n })\n const runtimeTargets = createMemo(() => [...runtimesByTarget().keys()])\n // Declarations and just-added specs the inventory does not report yet: installing,\n // disabled, or never confirmed. Their rows carry no switch (no plugin ID is known).\n const sourceTargets = createMemo(() => {\n const loaded = new Set((snapshot()?.runtime ?? []).flatMap(entry => entry.source.type === \"package\" ? [entry.source.target]\n : entry.source.type === \"local\" ? [entry.source.path] : []))\n const targets = new Set<string>()\n const configured = new Set<string>()\n for (const source of snapshot()?.configured.sources ?? []) {\n configured.add(source.target)\n if (source.managedBy === \"codenomad\") continue\n if (!source.pluginId && !loaded.has(source.target)) targets.add(source.target)\n }\n // An added spec removed elsewhere stops being shown once its pending window closes.\n for (const added of pluginSourcesStore.addedSpecs(props.instanceId, requestLocation())) {\n if (snapshot()?.configured.sources.some(source => source.target === added.spec && source.managedBy === \"codenomad\")) continue\n if (loaded.has(added.spec)) continue\n if (configured.has(added.spec) || pluginSourcesStore.state(props.instanceId, requestLocation(), added.spec) === \"pending\") targets.add(added.spec)\n }\n return [...targets]\n })\n const projectAvailable = () => snapshot()?.targets.some((target) => target.scope === \"project\") === true\n createEffect(() => {\n const instanceId = props.instanceId\n const location = requestLocation()\n if (props.active === false) return\n onCleanup(pluginControlsCache.acquireDemand(instanceId, location))\n })\n\n const bidi = (text: string): string => `⁨${text}⁩`\n\n const sourceLabel = (source: PluginRuntimeSource): string => {\n if (source.type === \"package\") return t(\"instanceServiceStatus.plugins.source.package\", { source: source.target })\n if (source.type === \"local\") return t(\"instanceServiceStatus.plugins.source.local\", { source: source.path })\n if (source.type === \"builtin\") return t(\"instanceServiceStatus.plugins.source.builtin\")\n return t(\"instanceServiceStatus.plugins.source.sdk\")\n }\n\n // Version, update availability, failure and its native log reference, for any plugin row.\n const runtimeLines = (entry: PluginRuntimeInventoryEntry | undefined): string[] => {\n if (!entry) return []\n const lines = [sourceLabel(entry.source)]\n if (entry.source.type === \"package\" && entry.source.version) {\n lines.push(t(\"instanceServiceStatus.plugins.sources.version\", { version: entry.source.version }))\n }\n if (entry.source.type === \"package\" && entry.source.outdated) lines.push(t(\"instanceServiceStatus.plugins.sources.outdated\"))\n if (entry.state.status === \"failed\") {\n lines.push(`${t(\"instanceServiceStatus.plugins.runtime.failed\")} — ${entry.state.error}`)\n if (entry.state.ref) lines.push(t(\"instanceServiceStatus.plugins.sources.failureRef\", { ref: entry.state.ref }))\n }\n return lines\n }\n\n // A desktop-app (GUI) package loads those parts only from Global configuration.\n const guiNotice = (entry: PluginRuntimeInventoryEntry | undefined, declaredIn: readonly { scope: string }[]): string[] => (\n entry?.features.gui && declaredIn.some(source => source.scope !== \"global\")\n ? [t(\"instanceServiceStatus.plugins.sources.guiGlobalOnly\")] : []\n )\n\n const declarationsFor = (matches: (source: PluginConfiguredSource) => boolean) => (\n snapshot()?.configured.sources.filter(matches) ?? []\n )\n const refresh = () => {\n if (props.active === false) return\n void pluginControlsCache.load(props.instanceId, requestLocation(), { force: true })\n void integrations.refreshDemanded(props.instanceId)\n if (props.session) void integrationBindings.refreshDemanded({\n instanceId: props.instanceId, directory: directory(), sessionID: props.session.id,\n })\n }\n\n const renderControl = (pluginId: string) => {\n // Key rows by ID, but read every displayed value from the current snapshot.\n // Passive refreshes must not replace the focused row's DOM.\n const control = createMemo(() => controlsById().get(pluginId))\n const failed = () => control()?.runtime?.state.status === \"failed\"\n const overridden = () => Boolean(control() && control()?.project !== \"default\")\n const isAvailable = (scope: PluginControlScope): boolean =>\n snapshot()?.targets.some((target) => target.scope === scope) === true\n const matchesControl = (source: PluginConfiguredSource) => {\n const runtime = control()?.runtime?.source\n return source.pluginId === pluginId || (runtime?.type === \"package\" && runtime.target === source.target)\n }\n const removable = createMemo(() => removableSources(snapshot(), matchesControl), [], {\n equals: (left, right) => left.length === right.length && left.every((source, index) => sameSource(source, right[index]!)),\n })\n const integration = () => recognised().byControl.get(pluginId)\n const name = () => integration()?.displayName ?? pluginId\n const version = () => {\n const source = control()?.runtime?.source\n return integration()?.version ?? (source?.type === \"package\" ? source.version : undefined)\n }\n const binding = createIntegrationRowBinding({\n instanceId: () => props.instanceId, directory, sessionId: () => props.session?.id, integration, active: () => props.active !== false,\n })\n const attention = () => { const entry = integration(); return entry ? integrationAttention(entry) : undefined }\n const connection = () => {\n const entry = integration()\n if (!entry) return undefined\n const [key, vars] = integrationConnectionMessage(integrationConnection(entry), entry.app.name)\n return t(key, vars)\n }\n const hostAction = createMemo(() => {\n const entry = integration(), action = entry ? installation.action(entry.id) : undefined\n return entry && action ? { action, run: () => void installation.open(entry.id) } : undefined\n }, undefined, { equals: (left, right) => left?.action === right?.action })\n const detach = () => binding.link()?.state === \"attached\" ? { run: () => void binding.detach(), busy: binding.busy() } : undefined\n const details = () => {\n const current = control(), entry = integration()\n const lines = [t(`instanceServiceStatus.plugins.kind.${entry ? \"integration\" : \"plugin\"}`, { id: pluginId }),\n ...runtimeLines(current?.runtime), ...guiNotice(current?.runtime, declarationsFor(matchesControl))]\n const part = entry?.status?.host?.partVersion\n if (entry && part) lines.push(t(\"integrations.partVersion\", { app: entry.app.name, version: part }))\n if (!failed() && overridden()) lines.push(t(\"instanceServiceStatus.plugins.globalOverridden\"))\n for (const target of snapshot()?.targets ?? []) {\n lines.push(`${scopeLabel(target.scope)} — ${target.path}`)\n }\n if (!isAvailable(\"project\")) lines.push(t(\"instanceServiceStatus.plugins.scope.unavailable\"))\n if (state().error) lines.push(t(\"instanceServiceStatus.plugins.errors.refresh\"))\n return lines.map(bidi).join(\"\\n\")\n }\n const renderSwitch = (scope: PluginControlScope) => {\n const labelId = scope === \"global\" ? globalLabelId : projectLabelId\n return <PluginActivationSwitch instanceId={props.instanceId} location={requestLocation()} control={control()} scope={scope}\n lockedReason={scope === \"project\" && integration()?.family === \"native\" ? t(\"integrations.section.scopeGlobalOnly\") : undefined}\n available={isAvailable(scope)} active={props.active} describedBy={isAvailable(scope) ? labelId : `${labelId} ${noticeId}`}\n integration={Boolean(integration())} name={name()}\n label={bidi(t(\"instanceServiceStatus.plugins.toggleAriaLabel\", { name: `${name()} — ${scopeLabel(scope)}` }))} />\n }\n const nameId = `${headingId}-name-${pluginId}`\n return (\n <div class=\"plugin-control-row\" data-plugin-id={pluginId} data-integration={integration()?.id} role=\"group\" aria-labelledby={nameId}>\n <div class=\"plugin-control-identity\"><span class=\"plugin-control-title\"><Tooltip placement=\"top-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" id={nameId} class=\"plugin-control-name\"><bdi>{name()}</bdi></Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\">{details()}</Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip>\n <Show when={version()}>{value => <span class=\"plugin-control-version\"><bdi>{value()}</bdi></span>}</Show></span>\n <Show when={binding.link()}><IntegrationLinkButton binding={binding} /></Show>\n <Show when={attention()}>{value => <IntegrationAttentionIndicator attention={value()} app={integration()!.app.name} />}</Show>\n {nonConformingLabel(declarationsFor(matchesControl))}<PluginRowActions instanceId={props.instanceId} location={requestLocation()} name={name()}\n source={control()?.runtime?.source} removable={removable()} refresh={refresh} active={props.active} consentEpoch={consentEpoch()} sessionId={props.session?.id}\n info={connection()} hostAction={hostAction()} detach={detach()} /></div>\n {renderSwitch(\"global\")}\n {renderSwitch(\"project\")}\n </div>\n )\n }\n\n const removableFor = (target: string) => createMemo(() => removableSources(snapshot(), source => source.target === target), [], {\n equals: (left, right) => left.length === right.length && left.every((source, index) => sameSource(source, right[index]!)),\n })\n\n const renderRuntime = (target: string) => {\n const entry = () => runtimesByTarget().get(target)\n const nameId = createUniqueId()\n const removable = removableFor(target)\n const integration = () => recognised().byTarget.get(target)\n const packageVersion = () => { const source = entry()?.source; return source?.type === \"package\" ? source.version : undefined }\n const details = () => {\n const current = entry()\n const lines = current ? runtimeLines(current) : [target]\n if (integration()) lines.unshift(t(\"instanceServiceStatus.plugins.kind.integration\", { id: integration()!.displayName }))\n lines.push(...guiNotice(current, declarationsFor(source => source.target === target)))\n return lines.map(bidi).join(\"\\n\")\n }\n return <div class=\"plugin-control-row\" data-package-target={entry()?.source.type === \"package\" ? target : undefined}\n data-local-path={entry()?.source.type === \"local\" ? target : undefined} data-integration={integration()?.id} role=\"group\" aria-labelledby={nameId}>\n <div class=\"plugin-control-identity\">\n <span class=\"plugin-control-title\"><Tooltip placement=\"top-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" id={nameId} class=\"plugin-control-name\"><bdi>{integration()?.displayName ?? target}</bdi></Tooltip.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\">{details()}</Tooltip.Content></Tooltip.Portal>\n </Tooltip>\n <Show when={packageVersion()}>{value => <span class=\"plugin-control-version\"><bdi>{value()}</bdi></span>}</Show></span>\n {nonConformingLabel(declarationsFor(source => source.target === target))}\n <PluginRowActions instanceId={props.instanceId} location={requestLocation()} name={target} source={entry()?.source}\n removable={removable()} refresh={refresh} active={props.active} consentEpoch={consentEpoch()} sessionId={props.session?.id} />\n </div>\n </div>\n }\n\n // Configured or just-added sources absent from the inventory. Pending rows stay busy until\n // `plugin.list` reports the target (it then becomes an ordinary row) or the window closes.\n const renderSource = (target: string) => {\n const nameId = createUniqueId()\n const removable = removableFor(target)\n const state = () => pluginSourcesStore.state(props.instanceId, requestLocation(), target)\n const integration = () => recognised().byTarget.get(target)\n const details = () => [\n ...(integration() ? [t(\"instanceServiceStatus.plugins.kind.integration\", { id: integration()!.displayName })] : []),\n t(\"instanceServiceStatus.plugins.source.package\", { source: target }),\n t(state() === \"pending\" ? \"instanceServiceStatus.plugins.sources.pending\" : \"instanceServiceStatus.plugins.sources.unconfirmed\"),\n ...declarationsFor(source => source.target === target).map(source => source.scope === \"global\" || source.scope === \"project\"\n ? `${scopeLabel(source.scope)} — ${source.path ?? \"\"}` : source.path ?? \"\"),\n ].map(bidi).join(\"\\n\")\n return <div class=\"plugin-control-row\" data-source-target={target} data-source-state={state()} data-integration={integration()?.id}\n role=\"group\" aria-labelledby={nameId} aria-busy={state() === \"pending\"}>\n <div class=\"plugin-control-identity\">\n <span class=\"plugin-control-title\"><Tooltip placement=\"top-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" id={nameId} class=\"plugin-control-name\"><bdi>{integration()?.displayName ?? target}</bdi></Tooltip.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\">{details()}</Tooltip.Content></Tooltip.Portal>\n </Tooltip></span>\n <Show when={state() === \"pending\"} fallback={<span class=\"plugin-source-state\" role=\"status\">{t(\"instanceServiceStatus.plugins.sources.unconfirmedLabel\")}</span>}>\n <span class=\"plugin-source-state\" role=\"status\">\n <Loader2 class=\"h-3 w-3 animate-spin\" aria-hidden=\"true\" />{t(\"instanceServiceStatus.plugins.sources.pendingLabel\")}\n </span>\n </Show>\n {nonConformingLabel(declarationsFor(source => source.target === target))}\n <PluginRowActions instanceId={props.instanceId} location={requestLocation()} name={target} removable={removable()}\n refresh={state() === \"unconfirmed\" ? refresh : undefined} active={props.active} consentEpoch={consentEpoch()} sessionId={props.session?.id} />\n </div>\n </div>\n }\n\n return (\n <section\n class=\"plugin-controls\"\n aria-label={t(\"instanceServiceStatus.sections.plugins\")}\n >\n <Show when={snapshot() && !snapshot()?.targets.some((target) => target.scope === \"project\")}>\n <span id={noticeId} class=\"sr-only\">{t(\"instanceServiceStatus.plugins.scope.unavailable\")}</span>\n </Show>\n <PluginSystemAttention instanceId={props.instanceId} location={requestLocation()} snapshot={snapshot()} active={props.active}\n runtimeUnconfirmed={state().runtimeUnconfirmed}\n restoreFocus={() => refreshButton?.focus()} />\n <div class=\"plugin-controls-header\">\n <div class=\"plugin-controls-header-actions\">\n <button\n ref={refreshButton}\n type=\"button\"\n class=\"icon-button-compact\"\n data-plugin-refresh\n title={t(\"instanceServiceStatus.plugins.refresh\")}\n aria-label={t(\"instanceServiceStatus.plugins.refresh\")}\n aria-busy={state().loading || state().refreshing}\n disabled={state().loading || state().refreshing}\n onClick={refresh}\n >\n <RefreshCw class=\"h-3.5 w-3.5\" classList={{ \"animate-spin\": state().loading || state().refreshing }} aria-hidden=\"true\" />\n </button>\n <Show when={snapshot()}>\n <PluginAddMenu instanceId={props.instanceId} location={requestLocation()} sessionId={props.session?.id} projectAvailable={projectAvailable()} active={props.active} />\n </Show>\n </div>\n <span id={globalLabelId} class=\"plugin-control-scope-label\">{scopeLabel(\"global\")}</span>\n <span id={projectLabelId} class=\"plugin-control-scope-label\">{scopeLabel(\"project\")}</span>\n </div>\n\n <Show when={snapshot()} fallback={\n <div class=\"right-panel-empty-text\" role=\"status\">\n <p>{state().loading\n ? t(\"instanceServiceStatus.plugins.loading\")\n : state().error\n ? t(\"instanceServiceStatus.plugins.errors.load\")\n : t(\"instanceServiceStatus.plugins.loading\")}</p>\n </div>\n }>\n <Show when={controlIds().length + runtimeTargets().length + sourceTargets().length > 0} fallback={<p class=\"right-panel-empty-text\">{t(\"instanceServiceStatus.plugins.empty\")}</p>}>\n <div class=\"plugin-control-list\">\n <For each={controlIds()}>{renderControl}</For>\n <For each={runtimeTargets()}>{renderRuntime}</For>\n <For each={sourceTargets()}>{renderSource}</For>\n </div>\n </Show>\n </Show>\n </section>\n )\n\n function scopeLabel(value: PluginControlScope): string {\n return t(`instanceServiceStatus.plugins.scope.${value}`)\n }\n\n}\n\nfunction sourcesOverlap(left: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[], right: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[]): boolean {\n return left.some(source => right.some(other => other.scope === source.scope && other.entryIndex === source.entryIndex))\n}\n\nexport function sameSource(left: PluginConfiguredSource, right: PluginConfiguredSource): boolean {\n return left.scope === right.scope && left.target === right.target && left.entryIndex === right.entryIndex && left.path === right.path && left.expectedRevision === right.expectedRevision\n}\n","import { createMemo } from \"solid-js\"\nimport { getActiveCatalogLocation } from \"../stores/sessions\"\nimport { activeSessionId, sessions } from \"../stores/session-state\"\n\n/**\n * The Location the Plugins and integration surfaces of an instance manage (its active catalog Location, else its\n * folder) and the displayed conversation, only when that conversation belongs to this Location.\n */\nexport function createIntegrationContext(instanceId: () => string, folder: () => string) {\n const location = createMemo(() => getActiveCatalogLocation(instanceId()) ?? { directory: folder() })\n const session = createMemo(() => {\n const id = activeSessionId().get(instanceId())\n const session = id ? sessions().get(instanceId())?.get(id) : undefined\n return session?.location.directory === location().directory ? session : undefined\n })\n return { location, session }\n}\n","import { For, Show, createMemo, createSignal, type Component } from \"solid-js\"\nimport Switch from \"@suid/material/Switch\"\nimport type { Instance, RawMcpStatus } from \"../types/instance\"\nimport { useOptionalInstanceMetadataContext } from \"../lib/contexts/instance-metadata-context\"\nimport { useI18n } from \"../lib/i18n\"\nimport { getLogger } from \"../lib/logger\"\nimport { PluginActivationControls } from \"./plugin-activation-controls\"\nimport { createIntegrationContext } from \"./integration-context\"\n\nconst log = getLogger(\"session\")\n\ntype ServiceSection = \"mcp\" | \"plugins\"\n\ninterface InstanceServiceStatusProps {\n sections?: ServiceSection[]\n showSectionHeadings?: boolean\n pluginsActive?: boolean\n class?: string\n initialInstance?: Instance\n}\n\ntype ParsedMcpStatus = {\n name: string\n status: \"running\" | \"stopped\" | \"error\"\n error?: string\n}\n\nfunction parseMcpStatus(status?: RawMcpStatus): ParsedMcpStatus[] {\n if (!status) return []\n return status.data.map((server) => {\n const rawStatus = server.status.status\n let mapped: ParsedMcpStatus[\"status\"]\n if (rawStatus === \"connected\") mapped = \"running\"\n else if (rawStatus === \"failed\") mapped = \"error\"\n else mapped = \"stopped\"\n return {\n name: server.name,\n status: mapped,\n error: server.status.status === \"failed\" ? server.status.error : undefined,\n }\n })\n}\n\nconst InstanceServiceStatus: Component<InstanceServiceStatusProps> = (props) => {\n const { t } = useI18n()\n const metadataContext = useOptionalInstanceMetadataContext()\n const instance = metadataContext?.instance ?? (() => {\n if (props.initialInstance) {\n return props.initialInstance\n }\n throw new Error(\"InstanceServiceStatus requires InstanceMetadataProvider or initialInstance prop\")\n })\n const isLoading = metadataContext?.isLoading ?? (() => false)\n const refreshMetadata = metadataContext?.refreshMetadata ?? (async () => Promise.resolve())\n const sections = createMemo<ServiceSection[]>(() => props.sections ?? [\"mcp\", \"plugins\"])\n const includeMcp = createMemo(() => sections().includes(\"mcp\"))\n const includePlugins = createMemo(() => sections().includes(\"plugins\"))\n const showHeadings = () => props.showSectionHeadings !== false\n\n const metadataAccessor = metadataContext?.metadata ?? (() => instance().metadata)\n const metadata = createMemo(() => metadataAccessor())\n const hasMcpMetadata = () => metadata()?.mcpStatus !== undefined\n\n const mcpServers = createMemo(() => parseMcpStatus(metadata()?.mcpStatus ?? undefined))\n\n const isMcpLoading = () => isLoading() || !hasMcpMetadata()\n const { location: pluginLocation, session: attachmentSession } = createIntegrationContext(() => instance().id, () => instance().folder)\n\n\n const [pendingMcpActions, setPendingMcpActions] = createSignal<Record<string, \"connect\" | \"disconnect\">>({})\n\n const setPendingMcpAction = (name: string, action?: \"connect\" | \"disconnect\") => {\n setPendingMcpActions((prev) => {\n const next = { ...prev }\n if (action) next[name] = action\n else delete next[name]\n return next\n })\n }\n\n const toggleMcpServer = async (serverName: string, shouldEnable: boolean) => {\n const client = instance().client\n if (!client?.mcp) return\n const action: \"connect\" | \"disconnect\" = shouldEnable ? \"connect\" : \"disconnect\"\n setPendingMcpAction(serverName, action)\n try {\n const resolved = metadata()?.mcpStatus?.location\n const location = resolved\n ? { directory: resolved.directory }\n : { directory: instance().folder }\n if (shouldEnable) {\n await client.mcp.connect({ server: serverName, location })\n } else {\n await client.mcp.disconnect({ server: serverName, location })\n }\n await refreshMetadata()\n } catch (error) {\n log.error(\"Failed to toggle MCP server\", { serverName, action, error })\n } finally {\n setPendingMcpAction(serverName)\n }\n }\n\n const renderEmptyState = (message: string) => (\n <p class=\"right-panel-empty-text\" role=\"status\">\n {message}\n </p>\n )\n\n const renderMcpSection = () => (\n <section class=\"space-y-1.5\">\n <Show when={showHeadings()}>\n <div class=\"text-xs font-medium text-muted uppercase tracking-wide\">\n {t(\"instanceServiceStatus.sections.mcp\")}\n </div>\n </Show>\n <Show\n when={!isMcpLoading() && mcpServers().length > 0}\n fallback={renderEmptyState(isMcpLoading() ? t(\"instanceServiceStatus.mcp.loading\") : t(\"instanceServiceStatus.mcp.empty\"))}\n >\n <div class=\"space-y-1.5\">\n <For each={mcpServers()}>\n {(server) => {\n const pendingAction = () => pendingMcpActions()[server.name]\n const isPending = () => Boolean(pendingAction())\n const isRunning = () => server.status === \"running\"\n const switchDisabled = () => isPending() || !instance().client\n const statusDotClass = () => {\n if (isPending()) return \"status-dot animate-pulse\"\n // A connected server is idle; only pending operations need motion.\n if (server.status === \"running\") return \"status-dot ready\"\n if (server.status === \"error\") return \"status-dot error\"\n return \"status-dot stopped\"\n }\n const statusDotStyle = () => (isPending() ? { background: \"var(--status-warning)\" } : undefined)\n return (\n <div class=\"px-2 py-1.5 border bg-surface-secondary border-base\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-xs text-primary font-medium truncate\">{server.name}</span>\n <div class=\"flex items-center gap-3 flex-shrink-0\">\n <div class=\"flex items-center gap-1.5 text-xs text-secondary\">\n <Show when={isPending()}>\n <svg class=\"animate-spin h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\" />\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n </Show>\n <div class={statusDotClass()} style={statusDotStyle()} />\n </div>\n <div class=\"flex items-center gap-1.5\">\n <Switch\n checked={isRunning()}\n disabled={switchDisabled()}\n color=\"success\"\n size=\"small\"\n inputProps={{ \"aria-label\": t(\"instanceServiceStatus.mcp.toggleAriaLabel\", { name: server.name }) }}\n onChange={(_, checked) => {\n if (switchDisabled()) return\n void toggleMcpServer(server.name, Boolean(checked))\n }}\n />\n </div>\n </div>\n\n </div>\n <Show when={server.error}>\n {(error) => (\n <div class=\"text-[11px] mt-1 break-words\" style={{ color: \"var(--status-error)\" }}>\n {error()}\n </div>\n )}\n </Show>\n </div>\n )\n }}\n </For>\n </div>\n </Show>\n </section>\n )\n\n return (\n <div class={props.class}>\n <Show when={includeMcp()}>{renderMcpSection()}</Show>\n <Show when={includePlugins()}>\n <Show when={props.pluginsActive !== false}>\n <PluginActivationControls\n instanceId={instance().id}\n location={pluginLocation()}\n active={props.pluginsActive}\n session={attachmentSession()}\n />\n </Show>\n </Show>\n </div>\n )\n}\n\nexport default InstanceServiceStatus\n","import { createSignal, untrack } from \"solid-js\"\nimport type { OpenCodeClient, ShellInfo } from \"@opencode/client\"\nimport { requestLocationOptions } from \"./request-locations\"\n\nconst MAX_SHELL_OUTPUT_DISPLAY_CHARS = 4 * 1024 * 1024\n\nexport function appendShellOutput(current: string, chunk: string): { output: string; truncated: boolean } {\n const output = current + chunk\n if (output.length <= MAX_SHELL_OUTPUT_DISPLAY_CHARS) return { output, truncated: false }\n\n let start = output.length - MAX_SHELL_OUTPUT_DISPLAY_CHARS\n if (output.charCodeAt(start) >= 0xdc00 && output.charCodeAt(start) <= 0xdfff) start += 1\n if (output[start] === \"\\u001b\" && output[start + 1] === \"\\\\\") start += 2\n else if (output[start] === \"\\\\\" && output[start - 1] === \"\\u001b\") start += 1\n const escape = output.lastIndexOf(\"\\u001b\", start)\n if (escape >= 0) {\n let end = -1\n let controlSequence = false\n if (output[escape + 1] === \"[\") {\n controlSequence = true\n for (let index = escape + 2; index < output.length; index += 1) {\n const code = output.charCodeAt(index)\n if (code === 0x18 || code === 0x1a) {\n end = index + 1\n break\n }\n if (code >= 0x40 && code <= 0x7e) {\n end = index + 1\n break\n }\n }\n } else if (output[escape + 1] === \"]\") {\n controlSequence = true\n const bell = output.indexOf(\"\\u0007\", escape + 2)\n const stringTerminator = output.indexOf(\"\\u001b\\\\\", escape + 2)\n const cancel = output.slice(escape + 2).search(/[\\u0018\\u001a]/)\n const terminators = [bell < 0 ? Infinity : bell + 1, stringTerminator < 0 ? Infinity : stringTerminator + 2, cancel < 0 ? Infinity : escape + 3 + cancel]\n end = Math.min(...terminators)\n if (!Number.isFinite(end)) end = -1\n } else if ([\"P\", \"X\", \"^\", \"_\"].includes(output[escape + 1] ?? \"\")) {\n controlSequence = true\n const stringTerminator = output.indexOf(\"\\u001b\\\\\", escape + 2)\n const cancel = output.slice(escape + 2).search(/[\\u0018\\u001a]/)\n end = Math.min(stringTerminator < 0 ? Infinity : stringTerminator + 2, cancel < 0 ? Infinity : escape + 3 + cancel)\n if (!Number.isFinite(end)) end = -1\n }\n if (controlSequence && end >= start) start = end\n else if (controlSequence && end < 0 && escape < start) start = output.length\n }\n return { output: output.slice(start), truncated: true }\n}\n\nexport interface ShellApi {\n list(directory: string, workspaceID?: string): Promise<{ data: ShellInfo[]; location?: { directory: string } }>\n remove(directory: string, shellId: string, workspaceID?: string): Promise<void>\n output(directory: string, shellId: string, cursor?: number, workspaceID?: string): Promise<{ output: string; cursor: number; size: number; truncated: boolean }>\n}\n\nexport interface ShellState {\n items: ShellInfo[]\n nativeDirectory?: string\n loading: boolean\n failed: boolean\n}\n\nexport interface ShellRefreshEvent {\n type: string\n location?: { directory?: string; workspaceID?: string }\n data?: { info?: { cwd?: string } }\n}\n\nconst EMPTY_STATE: ShellState = { items: [], loading: false, failed: false }\n// Creation precedes background admission; the tool's terminal event confirms it.\nconst SHELL_EVENTS = new Set([\"shell.created\", \"shell.exited\", \"shell.deleted\", \"session.tool.success\", \"session.tool.failed\", \"server.connected\"])\n\nexport function createShellApi(client: OpenCodeClient, listBackground?: ShellApi[\"list\"]): ShellApi {\n const location = (directory: string) => ({ directory })\n return {\n list: listBackground ?? ((directory, workspaceID) => client.shell.list({ location: location(directory) }, requestLocationOptions({ directory, workspaceID }))),\n remove: (directory, shellId, workspaceID) => client.shell.remove({ id: shellId, location: location(directory) }, requestLocationOptions({ directory, workspaceID })),\n output: async (directory, shellId, cursor = 0, workspaceID) => (await client.shell.output({\n id: shellId,\n location: location(directory),\n cursor,\n limit: 1024 * 1024,\n }, requestLocationOptions({ directory, workspaceID }))).data,\n }\n}\n\nexport function createShellStore(apiForInstance: (instanceId: string) => ShellApi) {\n const [states, setStates] = createSignal<Map<string, ShellState>>(new Map())\n const requests = new Map<string, { promise: Promise<void>; dirty: boolean }>()\n const demands = new Map<string, number>()\n const key = (instanceId: string, directory: string, workspaceID?: string) => JSON.stringify([instanceId, directory, workspaceID])\n const setState = (stateKey: string, state: ShellState) => setStates((current) => new Map(current).set(stateKey, state))\n const readState = (stateKey: string): ShellState => untrack(() => states().get(stateKey) ?? EMPTY_STATE)\n\n const load = async (instanceId: string, directory: string, workspaceID?: string, refresh = false): Promise<void> => {\n if (!instanceId || !directory) return\n const stateKey = key(instanceId, directory, workspaceID)\n const pending = requests.get(stateKey)\n if (pending) {\n if (refresh) pending.dirty = true\n return pending.promise\n }\n const request = { promise: Promise.resolve(), dirty: false }\n requests.set(stateKey, request)\n setState(stateKey, { ...readState(stateKey), loading: true, failed: false })\n request.promise = Promise.resolve().then(async () => {\n do {\n request.dirty = false\n try {\n const inventory = await apiForInstance(instanceId).list(directory, workspaceID)\n const items = inventory.data\n if (!request.dirty) {\n const previous = new Map(readState(stateKey).items.map(item => [item.id, item]))\n const stable = items.map(item => {\n const old = previous.get(item.id)\n return old && JSON.stringify(old) === JSON.stringify(item) ? old : item\n })\n setState(stateKey, { items: stable, nativeDirectory: inventory.location?.directory ?? directory, loading: false, failed: false })\n }\n } catch {\n if (!request.dirty) setState(stateKey, { ...readState(stateKey), loading: false, failed: true })\n }\n } while (request.dirty)\n }).finally(() => requests.delete(stateKey))\n return request.promise\n }\n\n const refreshForEvent = async (instanceId: string, event: ShellRefreshEvent): Promise<void> => {\n if (!SHELL_EVENTS.has(event.type)) return\n const eventDirectory = event.location?.directory ?? event.data?.info?.cwd\n const tracked = Array.from(untrack(states).keys())\n .map((stateKey): [string, string, string | null] => JSON.parse(stateKey))\n .filter(([trackedInstanceId, directory, workspaceID]) => trackedInstanceId === instanceId\n && demands.has(key(instanceId, directory, workspaceID ?? undefined)))\n const matching = eventDirectory ? tracked.filter(([, directory, workspaceID]) => {\n if (event.location?.workspaceID !== undefined && event.location.workspaceID !== workspaceID) return false\n const stateKey = key(instanceId, directory, workspaceID ?? undefined)\n const state = readState(stateKey)\n const nativeDirectory = state.nativeDirectory\n // Until the first successful inventory, its native alias is unknown.\n // Events coalesce during the read and recover an initial read failure.\n return sameDirectory(directory, eventDirectory) || (nativeDirectory !== undefined\n ? sameDirectory(nativeDirectory, eventDirectory) : requests.has(stateKey) || state.failed)\n }) : tracked\n await Promise.all(matching.map(([, directory, workspaceID]) => load(instanceId, directory, workspaceID ?? undefined, true)))\n }\n\n const remove = async (instanceId: string, directory: string, shellId: string, workspaceID?: string): Promise<boolean> => {\n try {\n await apiForInstance(instanceId).remove(directory, shellId, workspaceID)\n await load(instanceId, directory, workspaceID, true)\n return true\n } catch { return false }\n }\n\n const output = (instanceId: string, directory: string, shellId: string, cursor?: number, workspaceID?: string) =>\n apiForInstance(instanceId).output(directory, shellId, cursor, workspaceID)\n const getState = (instanceId: string, directory: string, workspaceID?: string): ShellState => states().get(key(instanceId, directory, workspaceID)) ?? EMPTY_STATE\n const watch = (instanceId: string, directory: string, workspaceID?: string) => {\n const stateKey = key(instanceId, directory, workspaceID)\n demands.set(stateKey, (demands.get(stateKey) ?? 0) + 1)\n return () => {\n const remaining = (demands.get(stateKey) ?? 1) - 1\n if (remaining) demands.set(stateKey, remaining)\n else demands.delete(stateKey)\n }\n }\n return { getState, load, watch, refreshForEvent, remove, output }\n}\n\nfunction sameDirectory(left: string, right: string): boolean {\n const normalize = (value: string) => {\n const normalized = value.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\")\n return /^[A-Za-z]:\\//.test(normalized) || normalized.startsWith(\"//\") ? normalized.toLowerCase() : normalized\n }\n return normalize(left) === normalize(right)\n}\n","import { serverEvents } from \"../lib/server-events\"\nimport { getRootClient } from \"./opencode-client\"\nimport { createShellApi, createShellStore, type ShellRefreshEvent } from \"./shell-store\"\nimport { serverApi } from \"../lib/api-client\"\n\nconst shellStore = createShellStore((instanceId) => createShellApi(getRootClient(instanceId),\n (directory, workspaceID) => {\n if (workspaceID !== undefined) return Promise.reject(new Error(\"Background shell inventory requires a public directory location\"))\n return serverApi.fetchBackgroundShells(instanceId, directory)\n }))\n\nserverEvents.on(\"instance.event\", (event) => {\n if (event.type !== \"instance.event\") return\n void shellStore.refreshForEvent(event.instanceId, event.event as ShellRefreshEvent)\n})\n\nserverEvents.on(\"instance.eventStatus\", (event) => {\n if (event.type !== \"instance.eventStatus\" || event.status !== \"connected\") return\n void shellStore.refreshForEvent(event.instanceId, { type: \"server.connected\" })\n})\n\nexport { shellStore }\n","import { Show, createEffect, createSignal, createUniqueId, onCleanup } from \"solid-js\"\nimport type { ShellInfo } from \"@opencode/client\"\n\nimport { createAnsiStreamRenderer, hasAnsi } from \"../lib/ansi\"\nimport { useI18n } from \"../lib/i18n\"\nimport { appendShellOutput } from \"../stores/shell-store\"\nimport { shellStore } from \"../stores/shells\"\nimport { OutputWindow } from \"./output-window\"\n\ninterface ShellOutputDialogProps {\n open: boolean\n instanceId: string\n directory: string\n workspaceID?: string\n shell: ShellInfo | null\n onClose: () => void\n}\n\nexport function ShellOutputDialog(props: ShellOutputDialogProps) {\n const { t } = useI18n()\n const id = `shell-output-${createUniqueId()}`\n const [output, setOutput] = createSignal(\"\")\n const [outputHtml, setOutputHtml] = createSignal(\"\")\n const [ansiEnabled, setAnsiEnabled] = createSignal(false)\n const [truncated, setTruncated] = createSignal(false)\n const [loading, setLoading] = createSignal(false)\n\n createEffect(() => {\n const shell = props.shell\n const directory = props.directory\n const workspaceID = props.workspaceID\n if (!props.open || !shell || !directory) return\n\n let active = true\n let cursor = 0\n let raw = \"\"\n let timer: ReturnType<typeof setTimeout> | undefined\n const render = () => {\n const ansi = hasAnsi(raw)\n setAnsiEnabled(ansi)\n if (!ansi) return setOutputHtml(\"\")\n const renderer = createAnsiStreamRenderer()\n setOutputHtml(renderer.render(raw))\n }\n const poll = async () => {\n try {\n const result = await shellStore.output(props.instanceId, directory, shell.id, cursor, workspaceID)\n if (!active) return\n cursor = result.cursor\n if (result.output) {\n const next = appendShellOutput(raw, result.output)\n raw = next.output\n setOutput(raw)\n setTruncated((current) => current || result.truncated || next.truncated)\n render()\n } else if (result.truncated) {\n setTruncated(true)\n }\n } catch {\n if (!active) return\n setAnsiEnabled(false)\n setOutputHtml(\"\")\n setOutput(t(\"backgroundProcessOutputDialog.loadErrorFallback\"))\n } finally {\n if (!active) return\n setLoading(false)\n timer = setTimeout(poll, 1000)\n }\n }\n\n setOutput(\"\")\n setOutputHtml(\"\")\n setAnsiEnabled(false)\n setTruncated(false)\n setLoading(true)\n void poll()\n onCleanup(() => {\n active = false\n if (timer) clearTimeout(timer)\n })\n })\n\n return (\n <OutputWindow id={id} open={props.open} title={t(\"backgroundProcessOutputDialog.title\")}\n subtitle={props.shell?.command} onClose={props.onClose}>\n <Show when={loading()}><p class=\"text-xs text-secondary\">{t(\"backgroundProcessOutputDialog.loading\")}</p></Show>\n <Show when={truncated()}><p class=\"mb-2 text-xs text-secondary\">{t(\"backgroundProcessOutputDialog.truncatedNotice\")}</p></Show>\n <Show when={!loading()}>\n <Show when={ansiEnabled()} fallback={\n <pre class=\"border border-base bg-surface-inset p-4 font-mono text-xs text-primary whitespace-pre-wrap break-all\">{output()}</pre>\n }>\n <pre class=\"border border-base bg-surface-inset p-4 font-mono text-xs text-primary whitespace-pre-wrap break-all\" innerHTML={outputHtml()} />\n </Show>\n </Show>\n </OutputWindow>\n )\n}\n","import { For, Show, createEffect, createMemo, createSignal, createUniqueId, onCleanup, untrack, type Accessor, type Component, type JSX } from \"solid-js\"\nimport type { LocationRef, ShellInfo } from \"@opencode/client\"\nimport {\n DragDropProvider,\n DragDropSensors,\n SortableProvider,\n closestCenter,\n createSortable,\n type DragEvent as SolidDndDragEvent,\n} from \"@thisbeyond/solid-dnd\"\nimport { Accordion } from \"@kobalte/core\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport Switch from \"@suid/material/Switch\"\n\nimport { ChevronRight, GripVertical, Info, TerminalSquare, Trash2, XOctagon } from \"lucide-solid\"\n\nimport type { Instance } from \"../../../../../types/instance\"\nimport type { Session } from \"../../../../../types/session\"\n\nimport ContextUsagePanel from \"../../../../session/context-usage-panel\"\nimport ProviderUsagePanel from \"../../../../session/provider-usage-panel\"\nimport SessionGoalLine from \"../../../../session/session-goal-line\"\nimport InstanceServiceStatus from \"../../../../instance-service-status\"\nimport { togglePermissionAutoAcceptForSession } from \"../../../../../stores/instances\"\nimport { isPermissionAutoAcceptEnabled } from \"../../../../../stores/permission-auto-accept\"\nimport { applyRightPanelItemCustomization, reorderStatusSections, type RightPanelCustomization, type RightPanelSectionModule } from \"../registry\"\nimport { createCoreStatusSectionManifest } from \"../core-plugin\"\nimport { shellStore } from \"../../../../../stores/shells\"\nimport { showConfirmDialog } from \"../../../../../stores/alerts\"\nimport { showToastNotification } from \"../../../../../lib/notifications\"\nimport { ShellOutputDialog } from \"../../../../shell-output-dialog\"\n\ninterface StatusTabProps {\n t: (key: string, vars?: Record<string, any>) => string\n\n instanceId: string\n instance: Instance\n\n activeSession: Accessor<Session | null>\n\n isActive: Accessor<boolean>\n expandedItems: Accessor<string[]>\n onExpandedItemsChange: (values: string[]) => void\n customization: Accessor<RightPanelCustomization>\n onCustomizationChange: (updater: (current: RightPanelCustomization) => RightPanelCustomization) => void\n extraSections?: readonly RightPanelSectionModule[]\n extraContent?: readonly (() => JSX.Element)[]\n}\n\ninterface SortableStatusSectionProps {\n section: RightPanelSectionModule\n expanded: boolean\n t: (key: string, vars?: Record<string, any>) => string\n}\n\nconst SortableStatusSection: Component<SortableStatusSectionProps> = (props) => {\n const sortable = createSortable(props.section.id)\n const regionLabelId = createUniqueId()\n const tooltip = () => props.section.tooltip ?? props.t(props.section.tooltipKey)\n return (\n <div ref={sortable} class={`right-panel-section-draggable ${sortable.isActiveDraggable ? \"right-panel-section-draggable-active\" : \"\"}`}\n data-status-section={props.section.id}>\n <Accordion.Item value={props.section.id} class=\"right-panel-accordion-item\">\n <Accordion.Header class=\"right-panel-accordion-header-row\">\n <Accordion.Trigger class=\"right-panel-accordion-trigger\" data-status-section-trigger={props.section.id}>\n <span class=\"section-left\">\n <ChevronRight class=\"right-panel-accordion-chevron disclosure-chevron\" />\n <span class=\"section-label\">{props.section.label ?? props.t(props.section.labelKey)}</span>\n </span>\n <Show when={props.section.renderStatus}>{(status) => status()()}</Show>\n <Show when={!props.expanded && props.section.renderSummary}>\n {(summary) => <span class=\"right-panel-section-summary\">{summary()()}</span>}\n </Show>\n </Accordion.Trigger>\n <Show when={props.section.renderHeaderActions}>{(actions) => actions()()}</Show>\n <Show when={props.section.renderInfo} fallback={\n <Tooltip openDelay={200} gutter={4} placement=\"top\">\n <Tooltip.Trigger as=\"button\" type=\"button\" class=\"section-info-trigger\" aria-label={tooltip()}>\n <Info class=\"section-info-icon\" />\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content class=\"section-info-tooltip\">{tooltip()}</Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip>\n }>{(info) => info()()}</Show>\n <GripVertical class=\"right-panel-section-grip\" aria-hidden=\"true\" />\n </Accordion.Header>\n <Show when={props.section.regionLabel}>\n {(name) => <span id={regionLabelId} class=\"sr-only\">{name()}</span>}\n </Show>\n <Accordion.Content class=\"right-panel-accordion-content\" {...(props.section.regionLabel ? { \"aria-labelledby\": regionLabelId } : {})}>\n {props.section.render()}\n </Accordion.Content>\n </Accordion.Item>\n </div>\n )\n}\n\nconst autoExpandedKeys = new WeakMap<Accessor<string[]>, Map<string, string>>()\n\nconst StatusTab: Component<StatusTabProps> = (props) => {\n let escaping = false\n const isSectionExpanded = (id: string) => props.expandedItems().includes(id)\n const shellLocation = createMemo(() => props.activeSession()?.location ?? { directory: props.instance.folder })\n const shellState = createMemo(() => shellStore.getState(props.instanceId, shellLocation().directory, shellLocation().workspaceID))\n const [outputShell, setOutputShell] = createSignal<{ shell: ShellInfo; location: LocationRef; instanceId: string } | null>(null)\n\n createEffect(() => {\n if (!props.isActive() || !isSectionExpanded(\"background-processes\")\n || props.customization().hiddenStatusSectionIds.includes(\"background-processes\")) return\n const { directory, workspaceID } = shellLocation()\n onCleanup(shellStore.watch(props.instanceId, directory, workspaceID))\n void shellStore.load(props.instanceId, directory, workspaceID)\n })\n\n const renderYoloModeSection = () => {\n const session = props.activeSession()\n if (!session) {\n return (\n <div class=\"right-panel-empty right-panel-empty--left\">\n <span class=\"text-xs\">{props.t(\"instanceShell.yoloMode.noSessionSelected\")}</span>\n </div>\n )\n }\n\n return (\n <div class=\"flex items-center justify-between gap-2 border border-base bg-surface-secondary px-3 py-2\">\n <p class=\"min-w-0 text-xs leading-5 text-secondary\">{props.t(\"instanceShell.yoloMode.description\")}</p>\n <div class=\"-mr-2 shrink-0\">\n <Switch\n class=\"yolo-mode-switch\"\n checked={isPermissionAutoAcceptEnabled(props.instanceId, session.id)}\n size=\"small\"\n sx={{\n \"& .MuiSwitch-switchBase.Mui-checked\": { color: \"var(--session-yolo-accent)\" },\n \"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track\": { backgroundColor: \"var(--session-yolo-accent)\" },\n }}\n inputProps={{ \"aria-label\": props.t(\"instanceShell.yoloMode.title\") }}\n onChange={() => togglePermissionAutoAcceptForSession(props.instanceId, session.id)}\n />\n </div>\n </div>\n )\n }\n\n const removeShell = async (shellId: string, command: string, running: boolean) => {\n const instanceId = props.instanceId\n const location = { ...shellLocation() }\n const confirmed = await showConfirmDialog(\n props.t(\"instanceShell.backgroundProcesses.remove.message\", { title: command }),\n {\n title: props.t(\"instanceShell.backgroundProcesses.remove.title\"),\n confirmLabel: props.t(running\n ? \"instanceShell.backgroundProcesses.actions.stopRemove\"\n : \"instanceShell.backgroundProcesses.actions.remove\"),\n },\n )\n if (confirmed && !await shellStore.remove(instanceId, location.directory, shellId, location.workspaceID)) {\n showToastNotification({ category: \"sessions\", message: props.t(\"instanceShell.backgroundProcesses.error\"), variant: \"error\" })\n }\n }\n\n const renderBackgroundProcesses = () => (\n <Show\n when={!shellState().failed}\n fallback={<div class=\"right-panel-empty right-panel-empty--left\"><span class=\"text-xs\">{props.t(\"instanceShell.backgroundProcesses.error\")}</span></div>}\n >\n <Show\n when={!shellState().loading || shellState().items.length > 0}\n fallback={<div class=\"right-panel-empty right-panel-empty--left\"><span class=\"text-xs\">{props.t(\"instanceShell.backgroundProcesses.loading\")}</span></div>}\n >\n <Show\n when={shellState().items.length > 0}\n fallback={<div class=\"right-panel-empty right-panel-empty--left\"><span class=\"text-xs\">{props.t(\"instanceShell.backgroundProcesses.empty\")}</span></div>}\n >\n <div class=\"flex flex-col gap-1\">\n <For each={shellState().items}>\n {(shell) => {\n const running = () => shell.status === \"running\"\n return (\n <article class=\"status-process-card\" title={[shell.command, shell.shell, shell.cwd,\n props.t(`instanceShell.backgroundProcesses.status.${shell.status}`),\n shell.pid === undefined ? \"\" : props.t(\"instanceShell.backgroundProcesses.pid\", { pid: shell.pid }),\n shell.exit === undefined ? \"\" : props.t(\"instanceShell.backgroundProcesses.exitCode\", { code: shell.exit }),\n ].filter(Boolean).join(\"\\n\")}>\n <span class=\"min-w-0 flex-1 truncate text-xs text-primary\">{shell.command}</span>\n <div class=\"status-process-actions\">\n <button\n type=\"button\"\n class=\"window-icon-button\"\n title={props.t(\"instanceShell.backgroundProcesses.actions.output\")}\n aria-label={props.t(\"instanceShell.backgroundProcesses.actions.output\")}\n onClick={() => setOutputShell({ shell, location: { ...shellLocation() }, instanceId: props.instanceId })}\n >\n <TerminalSquare class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"window-icon-button\"\n title={props.t(running() ? \"instanceShell.backgroundProcesses.actions.stopRemove\" : \"instanceShell.backgroundProcesses.actions.remove\")}\n aria-label={props.t(running() ? \"instanceShell.backgroundProcesses.actions.stopRemove\" : \"instanceShell.backgroundProcesses.actions.remove\")}\n disabled={shellState().loading}\n onClick={() => void removeShell(shell.id, shell.command, running())}\n >\n <Show when={running()} fallback={<Trash2 class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />}>\n <XOctagon class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Show>\n </button>\n </div>\n </article>\n )\n }}\n </For>\n </div>\n </Show>\n </Show>\n </Show>\n )\n\n const renderProviderUsage = () => (\n <Show when={props.activeSession()} fallback={<div class=\"right-panel-empty-text\">{props.t(\"providerUsage.noSession\")}</div>}>\n {(session) => (\n <div class=\"border border-base bg-surface-secondary px-3 py-2\">\n <ProviderUsagePanel instanceId={props.instanceId} sessionId={session().id} directory={session().location.directory}\n providerId={session().model.providerId} modelId={session().model.modelId}\n active={props.isActive() && props.expandedItems().includes(\"provider-usage\")} />\n </div>\n )}\n </Show>\n )\n\n // Built once: a changed extra-section list must never recreate (remount) the core sections.\n const coreSections = untrack(() => createCoreStatusSectionManifest({\n renderTokens: () => (\n <Show when={props.activeSession()?.id}>\n <ContextUsagePanel instanceId={props.instanceId} sessionId={props.activeSession()!.id} />\n </Show>\n ),\n renderTokensSummary: () => (\n <Show when={props.activeSession()?.id}>\n <ContextUsagePanel instanceId={props.instanceId} sessionId={props.activeSession()!.id} summary expanded={isSectionExpanded(\"tokens\")} />\n </Show>\n ),\n renderYoloModeSection,\n renderProviderUsage,\n renderBackgroundProcesses,\n renderMcpStatus: () => <InstanceServiceStatus initialInstance={props.instance} sections={[\"mcp\"]} showSectionHeadings={false} class=\"space-y-2\" />,\n renderPluginStatus: () => (\n <InstanceServiceStatus\n initialInstance={props.instance}\n sections={[\"plugins\"]}\n showSectionHeadings={false}\n pluginsActive={props.isActive() && isSectionExpanded(\"plugins\")}\n class=\"space-y-2\"\n />\n ),\n }).statusSections ?? [])\n const allStatusSections = createMemo<RightPanelSectionModule[]>(() => [...coreSections, ...(props.extraSections ?? [])])\n const statusSections = createMemo<RightPanelSectionModule[]>(() =>\n applyRightPanelItemCustomization(\n allStatusSections(),\n props.customization().statusSectionOrder,\n props.customization().hiddenStatusSectionIds,\n ),\n )\n\n const moveSection = (sourceId: string, targetId: string) => {\n if (!sourceId || sourceId === targetId) return\n const ids = statusSections().map((section) => section.id)\n if (!ids.includes(sourceId) || !ids.includes(targetId)) return\n props.onCustomizationChange((current) => ({\n ...current,\n statusSectionOrder: reorderStatusSections(current.statusSectionOrder, ids, sourceId, targetId),\n }))\n }\n\n\n // An expected action expands its section once per key; a later user collapse holds until the key changes,\n // across the tab's remounts (the expanded set belongs to the panel).\n let autoExpanded = autoExpandedKeys.get(props.expandedItems)\n if (!autoExpanded) autoExpandedKeys.set(props.expandedItems, autoExpanded = new Map())\n createEffect(() => {\n const additions: string[] = []\n for (const section of allStatusSections()) {\n const key = section.autoExpandKey?.()\n if (key === null) continue\n if (!key) { autoExpanded!.delete(section.id); continue }\n if (autoExpanded!.get(section.id) === key) continue\n autoExpanded!.set(section.id, key)\n if (!untrack(props.expandedItems).includes(section.id)) additions.push(section.id)\n }\n if (additions.length) props.onExpandedItemsChange([...untrack(props.expandedItems), ...additions])\n })\n\n const handleSectionDragEnd = ({ draggable, droppable }: SolidDndDragEvent) => {\n if (!droppable) return\n moveSection(String(draggable.id), String(droppable.id))\n }\n\n return (\n <div class=\"status-tab-container\">\n <Show when={props.activeSession()?.id}>\n {(sessionId) => <SessionGoalLine instanceId={props.instanceId} sessionId={sessionId()} active={props.isActive()} />}\n </Show>\n <Accordion.Root\n class=\"right-panel-accordion\"\n collapsible\n multiple\n value={props.expandedItems()}\n // Kobalte's list keyboard model clears every expanded item on Escape. Escape closes the popover,\n // tooltip or window it was meant for; it never collapses Status.\n onKeyDown={(event: KeyboardEvent) => {\n escaping = event.key === \"Escape\"\n if (escaping) queueMicrotask(() => { escaping = false })\n }}\n onChange={(values: string[]) => { if (!escaping) props.onExpandedItemsChange(values) }}\n >\n <DragDropProvider collisionDetector={closestCenter} onDragEnd={handleSectionDragEnd}>\n <DragDropSensors>\n <SortableProvider ids={statusSections().map((section) => section.id)}>\n <For each={statusSections()}>\n {(section) => <SortableStatusSection section={section} expanded={isSectionExpanded(section.id)} t={props.t} />}\n </For>\n </SortableProvider>\n </DragDropSensors>\n </DragDropProvider>\n </Accordion.Root>\n <For each={props.extraContent ?? []}>{(render) => render()}</For>\n <ShellOutputDialog\n open={Boolean(outputShell())}\n instanceId={outputShell()?.instanceId ?? props.instanceId}\n directory={outputShell()?.location.directory ?? shellLocation().directory}\n workspaceID={outputShell()?.location.workspaceID}\n shell={outputShell()?.shell ?? null}\n onClose={() => setOutputShell(null)}\n />\n </div>\n )\n}\n\nexport default StatusTab\n"],"names":["iconNode","x","y","width","height","rx","key","d","AppWindow","props","_$createComponent","Icon","_$mergeProps","name","Blocks","points","x1","x2","y1","y2","cx","cy","r","PackageSearch","Package","Unlink2","XOctagon","collapsible_exports","__export","Collapsible","Content","CollapsibleContent","Root","CollapsibleRoot","Trigger","CollapsibleTrigger","useCollapsibleContext","CollapsibleContext","createContext","context","useContext","Error","ref","setRef","createSignal","mergedProps","mergeDefaultProps","id","generateId","local","others","splitProps","present","createPresence","show","shouldMount","element","setHeight","setWidth","isMountAnimationPrevented","isOpen","onMount","raf","requestAnimationFrame","onCleanup","cancelAnimationFrame","createEffect","on","style","transitionDuration","animationName","rect","getBoundingClientRect","open","defer","registerContentId","Show","when","children","Polymorphic","as","r$","_ref$","mergeRefs","combineStyle","dataset","defaultId","createUniqueId","mergeDefaultProps2","splitProps2","contentId","setContentId","createSignal2","disclosureState","createDisclosureState","defaultOpen","onOpenChange","createMemo","disabled","forceMount","toggle","createGenerateId","createRegisterId","Provider","value","splitProps3","ButtonRoot","_$memo","onClick","e","callHandler","Object","assign","accordion_exports","Accordion","AccordionContent","Header","AccordionHeader","Item","AccordionItem","AccordionRoot","AccordionTrigger","useAccordionContext","AccordionItemContext","useAccordionItemContext","itemContext","role","triggerId","AccordionContext","createContext2","useContext2","accordionContext","setTriggerId","selectionManager","listState","isExpanded","isSelected","registerTriggerId","createUniqueId2","mergeDefaultProps3","multiple","collapsible","shouldFocusWrap","items","setItems","DomCollectionProvider","createDomCollection","onItemsChange","createListState","selectedKeys","defaultSelectedKeys","defaultValue","onSelectionChange","onChange","Array","from","disallowEmptySelection","selectionMode","dataSource","setFocusedKey","selectableList","createSelectableList","collection","disallowTypeAhead","allowsTabNavigation","createGenerateId2","el","onKeyDown","composeEventHandlers","onMouseDown","onFocusIn","onFocusOut","collapsibleContext","mergeDefaultProps4","splitProps4","createDomCollectionItem","getItem","type","textValue","selectableItem","createSelectableItem","shouldSelectOnPressUp","includes","preventDefault","createEffect2","onCleanup2","_ref$2","mergeRefs2","dataKey","onPointerDown","composeEventHandlers2","onPointerUp","onFocus","ContextUsagePanel","t","useI18n","info","getSessionInfo","instanceId","sessionId","hasChildren","getChildSessions","length","threadTotals","getThreadTotals","tokenMetric","label","formatTokenTotal","full","String","costMetric","sessionMetrics","session","cost","inputTokens","outputTokens","isSubscriptionModel","toFixed","totalMetrics","reasoningTokens","metrics","expanded","summaryLabel","map","metric","join","summary","fallback","_el$2","_tmpl$2","_$insert","UsageMetricChips","_$effect","_$className","class","_el$","_tmpl$","_p$","_v$","undefined","_v$2","_v$3","_$setAttribute","a","InfoPopoverButton","Popover","placement","gutter","title","Info","Portal","ProviderUsageConsole","locale","number","Intl","NumberFormat","format","usd","currency","reset","time","Date","toLocaleString","dateStyle","timeStyle","_tmpl$4","firstChild","_el$3","_el$4","_el$5","nextSibling","_el$6","_el$7","For","each","range","_el$13","_tmpl$5","_el$14","_el$15","usage","requests","models","_el$16","_tmpl$6","_el$8","_el$9","_el$0","_el$1","_el$17","_tmpl$7","_el$18","_tmpl$8","_el$19","_el$20","_el$21","_el$22","_el$23","row","model","provider","budgets","status","_el$10","_tmpl$3","_el$11","_el$24","_el$12","_el$25","_tmpl$9","_el$26","_el$27","_el$28","_el$29","_el$30","_el$31","_el$32","item","spentUsd","limitUsd","resetAt","providerUsageKey","source","shouldShowProviderUsageWindow","showCreditBalance","isFreeUsageSource","nextUtcMidnight","now","date","createProviderUsageState","fetchUsage","publish","current","generation","day","running","invalidate","expireUtcDay","today","request","requestDay","_a","REFRESH_INTERVAL_MS","ProviderUsagePanel","preferences","useConfig","active","providerId","trim","modelId","directory","equals","b","Boolean","setUsage","state","serverApi","fetchProviderUsage","select","refresh","revalidate","unsubscribeEvents","serverEvents","event","location","data","error","lastInstanceStatus","lastTransportStatus","unsubscribeStatus","JSON","stringify","unsubscribeTransport","onTransportStatus","refreshTimer","setInterval","timer","schedule","setTimeout","clearTimeout","dispose","clearInterval","entries","windows","displayedLabels","filter","showProviderUsageCreditBalance","hasReadings","console","unavailableMessage","freeEstimate","unavailableReason","consoleMessage","consoleError","providerErrorCode","test","code","unavailableLink","unavailableAction","href","windowLabel","scope","indexOf","slice","weekly","daily","monthly","tokens","input_tokens","output_tokens","credits","key_limit","per_user_limit","team_limit","credits_balance","billing_cycle","premium","chat","completions","usedValue","before","after","split","displayValue","window","consumption","maximumFractionDigits","estimate","reference","limit","used","creditsUsed","limitUSD","balanceUSD","money","remaining","total","valueLabel","usedPercent","percent","Math","round","resetLabel","Number","isFinite","getTime","estimated","timeZone","barColor","supported","configured","ok","_tmpl$1","message","_tmpl$10","$$click","openExternalUrl","link","_tmpl$0","openSettings","exhausted","previous","_tmpl$12","_tmpl$13","_tmpl$14","_tmpl$11","max","min","_v$4","_$setStyleProperty","o","providerName","copilotPlan","plan","_$delegateEvents","GOAL_CHANGED_EVENT","GOAL_COMMAND","goalStateSchema","z.object","z.string","z.enum","z.number","goalChangedSchema","LOADING","createSessionGoalStore","read","snapshots","setSnapshots","busy","setBusy","stateKey","snapshot","cancel","entry","reading","signal","version","answer","shown","untrack","tracked","released","owner","goal","next","prefix","command","sessionGoals","reconnects","createEventRefreshScheduler","native","runSessionGoalCommand","action","executeCustomCommand","showToastNotification","tGlobal","getOpencodeErrorMessage","boundedText","text","getRenderTextWindow","TOOL_OUTPUT_RENDER_CHARACTER_LIMIT","hidden","SessionGoalLine","reasonId","demand","run","objective","reason","rounds","maxRounds","toggleLabel","Tooltip","openDelay","tabindex","Pause","Play","Trash2","_v$5","_v$6","_v$7","_v$8","_v$9","_v$0","_v$1","i","n","s","h","loadedNative","integrationLink","binding","_b","integrationAttention","host","integrationConnection","connection","_c","offers","integrationConnectionMessage","app","integrationChainAction","unavailable","integrationAttachChoice","compatible","offer","integrationSummary","integrationPlugin","correlated","list","association","target","sources","ids","rule","control","candidate","targets","integrationDisplayPlugin","matches","runtime","controls","fetchIntegrations","path","backgroundReads","response","authenticatedFetch","API_BASE","HttpResponseError","fetchIntegrationBinding","keys","installIntegration","integrationId","integrationAttachmentRequest","body","INTEGRATION_EVENT","REFRESH_EVENTS","INTEGRATION_EVENT_COALESCE_MS","isIntegrationRefreshEvent","createIntegrationsStore","clock","setTimer","callback","ms","clearTimer","timers","refreshEntry","refreshDemanded","UNKNOWN","createIntegrationBindingsStore","disconnected","transportConnected","connected","cancelTimer","reconcile","immediate","sessionID","integrationEvent","isConnected","mutation","integrations","integrationBindings","epochs","setEpochs","sessionEpochs","setSessionEpochs","connectionEpoch","setConnectionEpoch","integrationEpoch","EMPTY_STATE","PluginControlsCache","api","cacheKey","record","options","pluginId","enabled","mutate","requestRevision","newerSnapshot","retainRuntime","result","records","oldest","siblings","changed","existing","force","controller","promise","confirmRuntime","trailing","states","preferIncoming","incomingRead","canonicalKey","invalidatedAlias","adoptedRead","pendingInvalidation","durable","newer","runtimeById","newerControlsById","sourceKey","newerSources","configuredIds","durableIds","_previous","managedBy","previousRuntime","pluginControlsCache","PLUGIN_SOURCE_PENDING_TIMEOUT_MS","locationKey","PluginSourcesStore","delay","refreshIntegrations","spec","attempt","integration","identity","removalKey","installs","removableSources","samePath","left","right","normalize","pluginSourcesStore","payload","INTEGRATION_CONFIRM_DELAY_MS","claimed","claimIntegrationConfirmation","confirmIntegrationAction","release","showConfirmDialog","createIntegrationHostInstallation","pending","setPending","epoch","eligible","_d","_f","_e","signature","confirmation","disposed","focusGeneration","captured","opener","sameTarget","OUTCOMES","createIntegrationRowBinding","setReading","choices","setChoices","intent","revoke","owns","fail","vars","detach","attach","offerID","chainAction","choice","Indicator","IntegrationLinkButton","attached","DropdownMenu","activate","closeChoices","Link2","classList","Group","GroupLabel","onSelect","IntegrationAttentionIndicator","attention","AlertTriangle","log","getLogger","Set","pendingKey","isPluginActivationPending","has","pluginScopeChecked","scoped","errorMessageKey","PluginActivationSwitch","isPending","add","category","variant","delete","Switch","checked","available","color","size","sx","ACCENT_SWITCH_SX","inputProps","describedBy","lockedReason","nextChecked","isPluginPackagePending","runPluginPackageAction","client","getRootClient","requestLocationOptions","toRequestLocation","PLUGIN_SOURCE_CONFIRM_EXPIRY_MS","PluginRowActions","afterClose","trigger","surface","admittedOwner","presentationOwner","querySelector","restoreFocus","focus","abort","ownership","consentEpoch","removable","document","activeElement","queueMicrotask","pkg","packageBusy","updating","removing","isRemoving","some","scopeLabel","hostAction","kind","outdated","expectedRevision","packageLabel","hint","lonePackage","triggerLabel","itemDisabled","runPackage","catch","runRemove","selected","feedbackOwner","closest","AbortController","accepted","detail","confirmLabel","expiresAfterMs","returnFocus","aborted","remove","stale","icon","pulse","Download","RefreshCw","MoreHorizontal","onCloseAutoFocus","installableIntegrations","ambiguous","plugin","declared","IntegrationCatalogWindow","catalog","rows","fetchedAt","DateTimeFormat","focusTrigger","getClientRects","install","displayName","onClose","Dialog","modal","Overlay","Title","WindowCloseButton","IntegrationCatalogRow","projectAvailable","onInstall","setScope","globalOnly","family","docs","BookOpen","_v$10","addEventListener","currentTarget","$$keydown","$$mousedown","PluginSourceAdd","setSpec","setError","setOpen","openChange","submit","failure","errorKey","global","anchorRef","anchor","$$input","_$addEventListener","nativeSelectListOpen","stopPropagation","Description","known","duplicate","timeout","ITEMS","PluginAddMenu","setPlugin","setCatalog","Plus","_c$","VALUE_PLACEHOLDER","isolatedValue","flatMap","part","index","PluginSystemAttention","headingId","Map","represented","representedRuntimeKeys","set","effective","runtimeUnconfirmed","renderEntry","get","mutationScope","setMutationScope","contains","controlling","controllingRule","writable","configurations","find","push","values","shownScopes","failed","runtimeDetails","Details","container","_$use","reenable","targetScope","renderAction","button","_ref$3","PluginActivationControls","noticeId","globalLabelId","projectLabelId","nonConforming","sourcesOverlap","ambiguousSources","nonConformingLabel","cachedLocation","requestLocation","invalidationRevision","refreshButton","recognised","byControl","byTarget","installation","freshIntegrations","builtin","controlsById","controlIds","runtimesByTarget","runtimeTargets","sourceTargets","loaded","added","addedSpecs","acquireDemand","bidi","sourceLabel","runtimeLines","lines","guiNotice","declaredIn","features","gui","declarationsFor","load","renderControl","overridden","project","isAvailable","matchesControl","every","sameSource","details","partVersion","renderSwitch","labelId","nameId","removableFor","renderRuntime","packageVersion","unshift","renderSource","Loader2","loading","refreshing","other","entryIndex","createIntegrationContext","folder","getActiveCatalogLocation","activeSessionId","sessions","parseMcpStatus","server","rawStatus","mapped","InstanceServiceStatus","metadataContext","useOptionalInstanceMetadataContext","instance","initialInstance","isLoading","refreshMetadata","Promise","resolve","sections","includeMcp","includePlugins","showHeadings","showSectionHeadings","metadataAccessor","metadata","hasMcpMetadata","mcpStatus","mcpServers","isMcpLoading","pluginLocation","attachmentSession","pendingMcpActions","setPendingMcpActions","setPendingMcpAction","prev","toggleMcpServer","serverName","shouldEnable","mcp","resolved","connect","disconnect","renderEmptyState","renderMcpSection","pendingAction","isRunning","switchDisabled","statusDotClass","statusDotStyle","background","_","_$style","pluginsActive","MAX_SHELL_OUTPUT_DISPLAY_CHARS","appendShellOutput","chunk","output","start","escape","end","controlSequence","bell","stringTerminator","terminators","SHELL_EVENTS","createShellApi","listBackground","workspaceID","shellId","cursor","createShellStore","apiForInstance","setStates","demands","setState","readState","inventory","stable","old","eventDirectory","trackedInstanceId","matching","nativeDirectory","sameDirectory","normalized","shellStore","ShellOutputDialog","setOutput","outputHtml","setOutputHtml","ansiEnabled","setAnsiEnabled","truncated","setTruncated","setLoading","shell","raw","render","ansi","hasAnsi","renderer","createAnsiStreamRenderer","poll","OutputWindow","subtitle","innerHTML","SortableStatusSection","sortable","createSortable","section","regionLabelId","tooltip","tooltipKey","ChevronRight","labelKey","renderStatus","renderSummary","renderHeaderActions","actions","renderInfo","GripVertical","regionLabel","isActiveDraggable","autoExpandedKeys","WeakMap","StatusTab","escaping","isSectionExpanded","expandedItems","shellLocation","activeSession","shellState","getState","outputShell","setOutputShell","isActive","customization","hiddenStatusSectionIds","watch","renderYoloModeSection","isPermissionAutoAcceptEnabled","backgroundColor","togglePermissionAutoAcceptForSession","removeShell","renderBackgroundProcesses","TerminalSquare","cwd","pid","exit","renderProviderUsage","coreSections","createCoreStatusSectionManifest","renderTokens","renderTokensSummary","renderMcpStatus","renderPluginStatus","statusSections","allStatusSections","extraSections","applyRightPanelItemCustomization","statusSectionOrder","moveSection","sourceId","targetId","onCustomizationChange","reorderStatusSections","autoExpanded","additions","autoExpandKey","onExpandedItemsChange","handleSectionDragEnd","draggable","droppable","DragDropProvider","collisionDetector","closestCenter","onDragEnd","DragDropSensors","SortableProvider","extraContent"],"mappings":"s6CACA,MAAMA,GAAW,CACb,CAAC,OAAQ,CAAEC,EAAG,IAAKC,EAAG,IAAKC,MAAO,KAAMC,OAAQ,KAAMC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I,CAAA,MAAEwR,EAAQovB,GAAc,EAAA,IAC5B/4B,YAAU,OAAA,QAAE+4B,EAAAA,EAAAA,IAAAA,YAAAA,EAAe/4B,aAAc7L,EAAM6L,UAAU,EAAA,IACzDwJ,WAAS,OAAA,QAAEuvB,EAAAA,EAAAA,IAAAA,YAAAA,EAAezuB,SAASd,YAAamvB,IAAgBnvB,SAAS,EAAA,IACzEqrB,aAAW,OAAA,OAAEkE,EAAAA,EAAAA,IAAAA,YAAAA,EAAezuB,SAASuqB,WAAW,EAAA,IAChD4B,OAAK,OAAA,QAAEsC,EAAAA,EAAAA,IAAAA,YAAAA,EAAetC,QAAS,IAAI,EACnC1O,QAASA,IAAMiR,EAAe,IAAI,CAAA,CAAC,EAAA,IAAA,EAAA7yB,CAAA,GAAA,CAI3C,EAEwBiL,GAAA,CAAA,OAAA,CAAA","x_google_ignoreList":[0,1,2,3,4,5,6,7]}
1
+ {"version":3,"file":"StatusTab-CKl50stg.js","sources":["../../../../../../node_modules/lucide-solid/dist/source/icons/app-window.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/blocks.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/package-search.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/package.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/unlink-2.jsx","../../../../../../node_modules/lucide-solid/dist/source/icons/x-octagon.jsx","../../../../../../node_modules/@kobalte/core/dist/chunk/UGE6PPGT.jsx","../../../../../../node_modules/@kobalte/core/dist/chunk/PYUMFHDL.jsx","../../../components/session/context-usage-panel.tsx","../../../components/info-popover-button.tsx","../../../components/session/provider-usage-console.tsx","../../../components/session/provider-usage-state.ts","../../../components/session/provider-usage-panel.tsx","../../../../../server/src/opencode/goal-contract.ts","../../../stores/session-goal-store.ts","../../../stores/session-goal.ts","../../../components/session/session-goal-line.tsx","../../../lib/integration-row-state.ts","../../../lib/integration-rows.ts","../../../lib/integrations-api.ts","../../../stores/integrations-store.ts","../../../stores/integration-bindings-store.ts","../../../stores/integrations.ts","../../../stores/plugin-controls.ts","../../../stores/plugin-sources.ts","../../../components/integration-confirmation.ts","../../../components/integration-host-installation.ts","../../../components/integration-row-binding.ts","../../../components/integration-row-indicators.tsx","../../../components/plugin-activation-switch.tsx","../../../stores/plugin-package-actions.ts","../../../components/plugin-row-actions.tsx","../../../components/integration-catalog-window.tsx","../../../components/plugin-source-add.tsx","../../../components/plugin-add-menu.tsx","../../../components/plugin-system-attention.tsx","../../../stores/plugin-controls-events.ts","../../../components/plugin-activation-controls.tsx","../../../components/integration-context.ts","../../../components/instance-service-status.tsx","../../../stores/shell-store.ts","../../../stores/shells.ts","../../../components/shell-output-dialog.tsx","../../../components/instance/shell/right-panel/tabs/StatusTab.tsx"],"sourcesContent":["import Icon from '../Icon';\nconst iconNode = [\n ['rect', { x: '2', y: '4', width: '20', height: '16', rx: '2', key: 'izxlao' }],\n ['path', { d: 'M10 4v4', key: 'pp8u80' }],\n ['path', { d: 'M2 8h20', key: 'd11cs7' }],\n ['path', { d: 'M6 4v4', key: '1svtjw' }],\n];\nconst AppWindow = (props) => <Icon {...props} name=\"AppWindow\" iconNode={iconNode}/>;\nexport default AppWindow;\n","import Icon from '../Icon';\nconst iconNode = [\n ['rect', { width: '7', height: '7', x: '14', y: '3', rx: '1', key: '6d4xhi' }],\n [\n 'path',\n {\n d: 'M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3',\n key: '1fpvtg',\n },\n ],\n];\nconst Blocks = (props) => <Icon {...props} name=\"Blocks\" iconNode={iconNode}/>;\nexport default Blocks;\n","import Icon from '../Icon';\nconst iconNode = [\n [\n 'path',\n {\n d: 'M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14',\n key: 'e7tb2h',\n },\n ],\n ['path', { d: 'm7.5 4.27 9 5.15', key: '1c824w' }],\n ['polyline', { points: '3.29 7 12 12 20.71 7', key: 'ousv84' }],\n ['line', { x1: '12', x2: '12', y1: '22', y2: '12', key: 'a4e8g8' }],\n ['circle', { cx: '18.5', cy: '15.5', r: '2.5', key: 'b5zd12' }],\n ['path', { d: 'M20.27 17.27 22 19', key: '1l4muz' }],\n];\nconst PackageSearch = (props) => (<Icon {...props} name=\"PackageSearch\" iconNode={iconNode}/>);\nexport default PackageSearch;\n","import Icon from '../Icon';\nconst iconNode = [\n ['path', { d: 'm7.5 4.27 9 5.15', key: '1c824w' }],\n [\n 'path',\n {\n d: 'M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z',\n key: 'hh9hay',\n },\n ],\n ['path', { d: 'm3.3 7 8.7 5 8.7-5', key: 'g66t2b' }],\n ['path', { d: 'M12 22V12', key: 'd0xqtd' }],\n];\nconst Package = (props) => <Icon {...props} name=\"Package\" iconNode={iconNode}/>;\nexport default Package;\n","import Icon from '../Icon';\nconst iconNode = [\n ['path', { d: 'M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2', key: '1re2ne' }],\n];\nconst Unlink2 = (props) => <Icon {...props} name=\"Unlink2\" iconNode={iconNode}/>;\nexport default Unlink2;\n","import Icon from '../Icon';\nconst iconNode = [\n [\n 'polygon',\n {\n points: '7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2',\n key: 'h1p8hx',\n },\n ],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n];\nconst XOctagon = (props) => <Icon {...props} name=\"XOctagon\" iconNode={iconNode}/>;\nexport default XOctagon;\n","import {\n createDisclosureState\n} from \"./E53DB7BS.jsx\";\nimport {\n ButtonRoot\n} from \"./UKTBL2JL.jsx\";\nimport {\n createRegisterId\n} from \"./JNCCF6MP.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\nimport {\n __export\n} from \"./5WXHJDCZ.jsx\";\n\n// src/collapsible/index.tsx\nvar collapsible_exports = {};\n__export(collapsible_exports, {\n Collapsible: () => Collapsible,\n Content: () => CollapsibleContent,\n Root: () => CollapsibleRoot,\n Trigger: () => CollapsibleTrigger,\n useCollapsibleContext: () => useCollapsibleContext\n});\n\n// src/collapsible/collapsible-content.tsx\nimport { mergeDefaultProps, mergeRefs } from \"@kobalte/utils\";\nimport {\n Show,\n createEffect,\n createSignal,\n on,\n onCleanup,\n onMount,\n splitProps\n} from \"solid-js\";\nimport { combineStyle } from \"@solid-primitives/props\";\nimport createPresence from \"solid-presence\";\n\n// src/collapsible/collapsible-context.tsx\nimport { createContext, useContext } from \"solid-js\";\nvar CollapsibleContext = createContext();\nfunction useCollapsibleContext() {\n const context = useContext(CollapsibleContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component\"\n );\n }\n return context;\n}\n\n// src/collapsible/collapsible-content.tsx\nfunction CollapsibleContent(props) {\n const [ref, setRef] = createSignal();\n const context = useCollapsibleContext();\n const mergedProps = mergeDefaultProps(\n { id: context.generateId(\"content\") },\n props\n );\n const [local, others] = splitProps(mergedProps, [\"ref\", \"id\", \"style\"]);\n const { present } = createPresence({\n show: context.shouldMount,\n element: () => ref() ?? null\n });\n const [height, setHeight] = createSignal(0);\n const [width, setWidth] = createSignal(0);\n const isOpen = () => context.isOpen() || present();\n let isMountAnimationPrevented = isOpen();\n onMount(() => {\n const raf = requestAnimationFrame(() => {\n isMountAnimationPrevented = false;\n });\n onCleanup(() => {\n cancelAnimationFrame(raf);\n });\n });\n createEffect(\n on(\n /**\n * depends on `present` because it will be `false` on\n * animation end (so when close finishes). This allows us to\n * retrieve the dimensions *before* closing.\n */\n present,\n () => {\n if (!ref()) {\n return;\n }\n ref().style.transitionDuration = \"0s\";\n ref().style.animationName = \"none\";\n const rect = ref().getBoundingClientRect();\n setHeight(rect.height);\n setWidth(rect.width);\n if (!isMountAnimationPrevented) {\n ref().style.transitionDuration = \"\";\n ref().style.animationName = \"\";\n }\n }\n )\n );\n createEffect(\n on(\n context.isOpen,\n (open) => {\n if (!open && ref()) {\n ref().style.transitionDuration = \"\";\n ref().style.animationName = \"\";\n }\n },\n { defer: true }\n )\n );\n createEffect(() => onCleanup(context.registerContentId(local.id)));\n return <Show when={present()}><Polymorphic\n as=\"div\"\n ref={mergeRefs(setRef, local.ref)}\n id={local.id}\n style={combineStyle(\n {\n \"--kb-collapsible-content-height\": height() ? `${height()}px` : void 0,\n \"--kb-collapsible-content-width\": width() ? `${width()}px` : void 0\n },\n local.style\n )}\n {...context.dataset()}\n {...others}\n /></Show>;\n}\n\n// src/collapsible/collapsible-root.tsx\nimport {\n createGenerateId,\n mergeDefaultProps as mergeDefaultProps2\n} from \"@kobalte/utils\";\nimport {\n createMemo,\n createSignal as createSignal2,\n createUniqueId,\n splitProps as splitProps2\n} from \"solid-js\";\nfunction CollapsibleRoot(props) {\n const defaultId = `collapsible-${createUniqueId()}`;\n const mergedProps = mergeDefaultProps2(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps2(mergedProps, [\n \"open\",\n \"defaultOpen\",\n \"onOpenChange\",\n \"disabled\",\n \"forceMount\"\n ]);\n const [contentId, setContentId] = createSignal2();\n const disclosureState = createDisclosureState({\n open: () => local.open,\n defaultOpen: () => local.defaultOpen,\n onOpenChange: (isOpen) => local.onOpenChange?.(isOpen)\n });\n const dataset = createMemo(() => ({\n \"data-expanded\": disclosureState.isOpen() ? \"\" : void 0,\n \"data-closed\": !disclosureState.isOpen() ? \"\" : void 0,\n \"data-disabled\": local.disabled ? \"\" : void 0\n }));\n const context = {\n dataset,\n isOpen: disclosureState.isOpen,\n disabled: () => local.disabled ?? false,\n shouldMount: () => local.forceMount || disclosureState.isOpen(),\n contentId,\n toggle: disclosureState.toggle,\n generateId: createGenerateId(() => others.id),\n registerContentId: createRegisterId(setContentId)\n };\n return <CollapsibleContext.Provider value={context}><Polymorphic\n as=\"div\"\n {...dataset()}\n {...others}\n /></CollapsibleContext.Provider>;\n}\n\n// src/collapsible/collapsible-trigger.tsx\nimport { callHandler } from \"@kobalte/utils\";\nimport {\n splitProps as splitProps3\n} from \"solid-js\";\nfunction CollapsibleTrigger(props) {\n const context = useCollapsibleContext();\n const [local, others] = splitProps3(props, [\"onClick\"]);\n const onClick = (e) => {\n callHandler(e, local.onClick);\n context.toggle();\n };\n return <ButtonRoot\n aria-expanded={context.isOpen()}\n aria-controls={context.isOpen() ? context.contentId() : void 0}\n disabled={context.disabled()}\n onClick={onClick}\n {...context.dataset()}\n {...others}\n />;\n}\n\n// src/collapsible/index.tsx\nvar Collapsible = Object.assign(CollapsibleRoot, {\n Content: CollapsibleContent,\n Trigger: CollapsibleTrigger\n});\n\nexport {\n useCollapsibleContext,\n CollapsibleContent,\n CollapsibleRoot,\n CollapsibleTrigger,\n Collapsible,\n collapsible_exports\n};\n","import {\n createSelectableList\n} from \"./N3GAC5SS.jsx\";\nimport {\n createListState,\n createSelectableItem\n} from \"./QZDH5R5B.jsx\";\nimport {\n CollapsibleContent,\n CollapsibleRoot,\n CollapsibleTrigger,\n useCollapsibleContext\n} from \"./UGE6PPGT.jsx\";\nimport {\n createDomCollection,\n createDomCollectionItem\n} from \"./SOM3K36D.jsx\";\nimport {\n createRegisterId\n} from \"./JNCCF6MP.jsx\";\nimport {\n Polymorphic\n} from \"./FLVHQV4A.jsx\";\nimport {\n __export\n} from \"./5WXHJDCZ.jsx\";\n\n// src/accordion/index.tsx\nvar accordion_exports = {};\n__export(accordion_exports, {\n Accordion: () => Accordion,\n Content: () => AccordionContent,\n Header: () => AccordionHeader,\n Item: () => AccordionItem,\n Root: () => AccordionRoot,\n Trigger: () => AccordionTrigger,\n useAccordionContext: () => useAccordionContext\n});\n\n// src/accordion/accordion-content.tsx\nimport { mergeDefaultProps } from \"@kobalte/utils\";\nimport {\n createEffect,\n onCleanup,\n splitProps\n} from \"solid-js\";\nimport { combineStyle } from \"@solid-primitives/props\";\n\n// src/accordion/accordion-item-context.tsx\nimport { createContext, useContext } from \"solid-js\";\nvar AccordionItemContext = createContext();\nfunction useAccordionItemContext() {\n const context = useContext(AccordionItemContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component\"\n );\n }\n return context;\n}\n\n// src/accordion/accordion-content.tsx\nfunction AccordionContent(props) {\n const itemContext = useAccordionItemContext();\n const defaultId = itemContext.generateId(\"content\");\n const mergedProps = mergeDefaultProps(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps(mergedProps, [\"id\", \"style\"]);\n createEffect(() => onCleanup(itemContext.registerContentId(local.id)));\n return <CollapsibleContent\n role=\"region\"\n aria-labelledby={itemContext.triggerId()}\n style={combineStyle(\n {\n \"--kb-accordion-content-height\": \"var(--kb-collapsible-content-height)\",\n \"--kb-accordion-content-width\": \"var(--kb-collapsible-content-width)\"\n },\n local.style\n )}\n {...others}\n />;\n}\n\n// src/accordion/accordion-header.tsx\nfunction AccordionHeader(props) {\n const context = useCollapsibleContext();\n return <Polymorphic\n as=\"h3\"\n {...context.dataset()}\n {...props}\n />;\n}\n\n// src/accordion/accordion-item.tsx\nimport { createGenerateId, mergeDefaultProps as mergeDefaultProps2 } from \"@kobalte/utils\";\nimport {\n createSignal,\n createUniqueId,\n splitProps as splitProps2\n} from \"solid-js\";\n\n// src/accordion/accordion-context.tsx\nimport { createContext as createContext2, useContext as useContext2 } from \"solid-js\";\nvar AccordionContext = createContext2();\nfunction useAccordionContext() {\n const context = useContext2(AccordionContext);\n if (context === void 0) {\n throw new Error(\n \"[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component\"\n );\n }\n return context;\n}\n\n// src/accordion/accordion-item.tsx\nfunction AccordionItem(props) {\n const accordionContext = useAccordionContext();\n const defaultId = `${accordionContext.generateId(\n \"item\"\n )}-${createUniqueId()}`;\n const mergedProps = mergeDefaultProps2(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps2(mergedProps, [\"value\", \"disabled\"]);\n const [triggerId, setTriggerId] = createSignal();\n const [contentId, setContentId] = createSignal();\n const selectionManager = () => accordionContext.listState().selectionManager();\n const isExpanded = () => {\n return selectionManager().isSelected(local.value);\n };\n const context = {\n value: () => local.value,\n triggerId,\n contentId,\n generateId: createGenerateId(() => others.id),\n registerTriggerId: createRegisterId(setTriggerId),\n registerContentId: createRegisterId(setContentId)\n };\n return <AccordionItemContext.Provider value={context}><CollapsibleRoot\n open={isExpanded()}\n disabled={local.disabled}\n {...others}\n /></AccordionItemContext.Provider>;\n}\n\n// src/accordion/accordion-root.tsx\nimport {\n composeEventHandlers,\n createGenerateId as createGenerateId2,\n mergeDefaultProps as mergeDefaultProps3,\n mergeRefs\n} from \"@kobalte/utils\";\nimport {\n createSignal as createSignal2,\n createUniqueId as createUniqueId2,\n splitProps as splitProps3\n} from \"solid-js\";\nfunction AccordionRoot(props) {\n let ref;\n const defaultId = `accordion-${createUniqueId2()}`;\n const mergedProps = mergeDefaultProps3(\n {\n id: defaultId,\n multiple: false,\n collapsible: false,\n shouldFocusWrap: true\n },\n props\n );\n const [local, others] = splitProps3(mergedProps, [\n \"id\",\n \"ref\",\n \"value\",\n \"defaultValue\",\n \"onChange\",\n \"multiple\",\n \"collapsible\",\n \"shouldFocusWrap\",\n \"onKeyDown\",\n \"onMouseDown\",\n \"onFocusIn\",\n // TODO: remove next breaking\n \"onFocusOut\"\n ]);\n const [items, setItems] = createSignal2([]);\n const { DomCollectionProvider } = createDomCollection({\n items,\n onItemsChange: setItems\n });\n const listState = createListState({\n selectedKeys: () => local.value,\n defaultSelectedKeys: () => local.defaultValue,\n onSelectionChange: (value) => local.onChange?.(Array.from(value)),\n disallowEmptySelection: () => !local.multiple && !local.collapsible,\n selectionMode: () => local.multiple ? \"multiple\" : \"single\",\n dataSource: items\n });\n listState.selectionManager().setFocusedKey(\"item-1\");\n const selectableList = createSelectableList(\n {\n selectionManager: () => listState.selectionManager(),\n collection: () => listState.collection(),\n disallowEmptySelection: () => listState.selectionManager().disallowEmptySelection(),\n shouldFocusWrap: () => local.shouldFocusWrap,\n disallowTypeAhead: true,\n allowsTabNavigation: true\n },\n () => ref\n );\n const context = {\n listState: () => listState,\n generateId: createGenerateId2(() => local.id)\n };\n return <DomCollectionProvider><AccordionContext.Provider value={context}><Polymorphic\n as=\"div\"\n id={local.id}\n ref={mergeRefs((el) => ref = el, local.ref)}\n onKeyDown={composeEventHandlers([\n local.onKeyDown,\n selectableList.onKeyDown\n ])}\n onMouseDown={composeEventHandlers([\n local.onMouseDown,\n selectableList.onMouseDown\n ])}\n onFocusIn={composeEventHandlers([\n local.onFocusIn\n // TODO: remove next breaking\n ])}\n onFocusOut={composeEventHandlers([\n local.onFocusOut,\n selectableList.onFocusOut\n ])}\n {...others}\n /></AccordionContext.Provider></DomCollectionProvider>;\n}\n\n// src/accordion/accordion-trigger.tsx\nimport {\n callHandler,\n composeEventHandlers as composeEventHandlers2,\n mergeDefaultProps as mergeDefaultProps4,\n mergeRefs as mergeRefs2\n} from \"@kobalte/utils\";\nimport {\n createEffect as createEffect2,\n onCleanup as onCleanup2,\n splitProps as splitProps4\n} from \"solid-js\";\nfunction AccordionTrigger(props) {\n let ref;\n const accordionContext = useAccordionContext();\n const itemContext = useAccordionItemContext();\n const collapsibleContext = useCollapsibleContext();\n const defaultId = itemContext.generateId(\"trigger\");\n const mergedProps = mergeDefaultProps4(\n { id: defaultId },\n props\n );\n const [local, others] = splitProps4(mergedProps, [\n \"ref\",\n \"onPointerDown\",\n \"onPointerUp\",\n \"onClick\",\n \"onKeyDown\",\n \"onMouseDown\",\n \"onFocus\"\n ]);\n createDomCollectionItem({\n getItem: () => ({\n ref: () => ref,\n type: \"item\",\n key: itemContext.value(),\n textValue: \"\",\n // not applicable here\n disabled: collapsibleContext.disabled()\n })\n });\n const selectableItem = createSelectableItem(\n {\n key: () => itemContext.value(),\n selectionManager: () => accordionContext.listState().selectionManager(),\n disabled: () => collapsibleContext.disabled(),\n shouldSelectOnPressUp: true\n },\n () => ref\n );\n const onKeyDown = (e) => {\n if ([\"Enter\", \" \"].includes(e.key)) {\n e.preventDefault();\n }\n callHandler(e, local.onKeyDown);\n callHandler(e, selectableItem.onKeyDown);\n };\n createEffect2(() => onCleanup2(itemContext.registerTriggerId(others.id)));\n return <CollapsibleTrigger\n ref={mergeRefs2((el) => ref = el, local.ref)}\n data-key={selectableItem.dataKey()}\n onPointerDown={composeEventHandlers2([\n local.onPointerDown,\n selectableItem.onPointerDown\n ])}\n onPointerUp={composeEventHandlers2([\n local.onPointerUp,\n selectableItem.onPointerUp\n ])}\n onClick={composeEventHandlers2([local.onClick, selectableItem.onClick])}\n onKeyDown={onKeyDown}\n onMouseDown={composeEventHandlers2([\n local.onMouseDown,\n selectableItem.onMouseDown\n ])}\n onFocus={composeEventHandlers2([local.onFocus, selectableItem.onFocus])}\n {...others}\n />;\n}\n\n// src/accordion/index.tsx\nvar Accordion = Object.assign(AccordionRoot, {\n Content: AccordionContent,\n Header: AccordionHeader,\n Item: AccordionItem,\n Trigger: AccordionTrigger\n});\n\nexport {\n AccordionContent,\n AccordionHeader,\n useAccordionContext,\n AccordionItem,\n AccordionRoot,\n AccordionTrigger,\n Accordion,\n accordion_exports\n};\n","import { createMemo, Show, type Component } from \"solid-js\"\nimport { getChildSessions, getSessionInfo, getThreadTotals } from \"../../stores/sessions\"\nimport { formatTokenTotal } from \"../../lib/formatters\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { UsageMetricChips } from \"../usage-metric-chips\"\n\ninterface ContextUsagePanelProps {\n instanceId: string\n sessionId: string\n class?: string\n summary?: boolean\n expanded?: boolean\n}\n\nconst ContextUsagePanel: Component<ContextUsagePanelProps> = (props) => {\n const { t } = useI18n()\n const info = createMemo(() => getSessionInfo(props.instanceId, props.sessionId))\n const hasChildren = createMemo(() => getChildSessions(props.instanceId, props.sessionId).length > 0)\n const threadTotals = createMemo(() => getThreadTotals(props.instanceId, props.sessionId))\n const tokenMetric = (label: string, value = 0) => ({ label: t(`contextUsagePanel.labels.${label}`), value: formatTokenTotal(value), full: String(value) })\n const costMetric = (label: string, value: string) => ({ label: t(`contextUsagePanel.labels.${label}`), value, full: value })\n const sessionMetrics = createMemo(() => {\n const session = info()\n const cost = session?.cost ?? 0\n return [\n tokenMetric(\"input\", session?.inputTokens),\n tokenMetric(\"output\", session?.outputTokens),\n costMetric(\"cost\", session?.isSubscriptionModel ? t(\"contextUsagePanel.included\") : `$${(cost > 0 ? cost : 0).toFixed(2)}`),\n ]\n })\n const totalMetrics = createMemo(() => [\n tokenMetric(\"totalInput\", threadTotals()?.inputTokens),\n tokenMetric(\"totalOutput\", threadTotals()?.outputTokens),\n costMetric(\"totalCost\", `$${(threadTotals()?.cost ?? 0).toFixed(2)}`),\n tokenMetric(\"totalReasoning\", threadTotals()?.reasoningTokens),\n ])\n const metrics = () => props.expanded ? [sessionMetrics()[0], sessionMetrics()[1],\n { label: t(\"messageBlock.usage.reasoning\"), value: formatTokenTotal(info()?.reasoningTokens ?? 0), full: String(info()?.reasoningTokens ?? 0) },\n sessionMetrics()[2]] : sessionMetrics()\n const summaryLabel = () => metrics().map(metric => `${metric.label}: ${metric.full}`).join(\" · \")\n\n return (\n <Show when={props.summary} fallback={\n <Show when={hasChildren()}><div class={`session-context-panel status-token-group ${props.class ?? \"\"}`} data-token-group=\"thread\">\n <UsageMetricChips metrics={totalMetrics()} />\n </div></Show>\n }>\n <span class=\"status-token-summary\" data-expanded={props.expanded || undefined} title={summaryLabel()} aria-label={summaryLabel()}>\n <UsageMetricChips metrics={metrics()} />\n </span>\n </Show>\n )\n}\n\nexport default ContextUsagePanel\n","import { Popover } from \"@kobalte/core/popover\"\nimport { Info } from \"lucide-solid\"\nimport type { JSX } from \"solid-js\"\n\n/**\n * The shared \"i\" button: a short accessible name; Enter or Space opens its text, Escape closes it and returns focus\n * to the button. `label` and `children` may be catalogue text, which never passes through the i18n catalogue.\n */\nexport function InfoPopoverButton(props: { label: string; children: JSX.Element; class?: string }) {\n return (\n <Popover placement=\"top\" gutter={4}>\n <Popover.Trigger type=\"button\" class={`section-info-trigger ${props.class ?? \"\"}`} aria-label={props.label} title={props.label}>\n <Info class=\"section-info-icon\" aria-hidden=\"true\" />\n </Popover.Trigger>\n <Popover.Portal>\n <Popover.Content class=\"section-info-tooltip info-popover-content\">\n <div class=\"info-popover-text\">{props.children}</div>\n </Popover.Content>\n </Popover.Portal>\n </Popover>\n )\n}\n","import { For, Show } from \"solid-js\"\nimport type { OpenCodeConsoleUsage } from \"../../../../server/src/api-types-provider-usage\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { InfoPopoverButton } from \"../info-popover-button\"\n\nexport function ProviderUsageConsole(props: { usage: OpenCodeConsoleUsage }) {\n const { t, locale } = useI18n()\n const number = (value: number) => new Intl.NumberFormat(locale()).format(value)\n const usd = (value: number) => new Intl.NumberFormat(locale(), { style: \"currency\", currency: \"USD\" }).format(value)\n const reset = (time: number) => t(\"providerUsage.resets\", { time: new Date(time).toLocaleString(locale(), { dateStyle: \"short\", timeStyle: \"short\" }) })\n return <div class=\"space-y-3 text-[11px] text-primary\">\n <section>\n <div class=\"mb-1 flex items-center gap-1\">\n <h4 class=\"font-medium\">{t(\"providerUsage.console.requests\")}</h4>\n <InfoPopoverButton label={t(\"providerUsage.console.requests\")}>{t(\"providerUsage.console.info\")}</InfoPopoverButton>\n </div>\n <dl class=\"space-y-1\">\n <For each={[ [\"24h\", \"today\"], [\"7d\", \"sevenDays\"], [\"30d\", \"thirtyDays\"] ] as const}>{([range, label]) =>\n <div class=\"flex min-w-0 flex-wrap justify-between gap-x-2\"><dt>{t(`providerUsage.console.${label}`)}</dt><dd class=\"min-w-0 break-words font-medium tabular-nums\">{number(props.usage.requests[range])}</dd></div>\n }</For>\n </dl>\n </section>\n <section>\n <h4 class=\"mb-1 font-medium\">{t(\"providerUsage.console.models\")}</h4>\n <Show when={props.usage.models.length} fallback={<p class=\"text-secondary\">{t(\"providerUsage.console.noRequests\")}</p>}>\n <table class=\"w-full table-fixed text-start text-[11px]\">\n <thead><tr><For each={[\"model\", \"provider\", \"count\"]}>{key => <th scope=\"col\" class={key === \"count\" ? \"text-end font-medium\" : \"text-start font-medium\"}>{t(`providerUsage.console.${key}`)}</th>}</For></tr></thead>\n <tbody><For each={props.usage.models}>{row => <tr>\n <td class=\"align-top break-words pe-1\"><bdi>{row.model}</bdi></td>\n <td class=\"align-top break-words pe-1\"><bdi>{row.provider}</bdi></td>\n <td class=\"break-words align-top text-end tabular-nums\">{number(row.requests)}</td>\n </tr>}</For></tbody>\n </table>\n </Show>\n </section>\n <Show when={props.usage.budgets.status === \"unavailable\" || props.usage.budgets.items.length}>\n <section>\n <h4 class=\"mb-1 font-medium\">{t(\"providerUsage.console.budgets\")}</h4>\n <Show when={props.usage.budgets.status === \"available\"} fallback={<p class=\"text-secondary\">{t(\"providerUsage.console.budgetsUnavailable\")}</p>}>\n <ul class=\"space-y-2\"><For each={props.usage.budgets.items}>{item => <li>\n <div class=\"break-words\"><bdi>{item.name}</bdi> (<bdi>{item.id}</bdi>)</div>\n <div class=\"tabular-nums\">{usd(item.spentUsd)} / {usd(item.limitUsd)}</div>\n <div class=\"text-tertiary\">{reset(item.resetAt)}</div>\n </li>}</For></ul>\n </Show>\n </section>\n </Show>\n </div>\n}\n","import type { ProviderUsageResponse } from \"../../../../server/src/api-types\"\n\nexport interface ProviderUsageSource {\n instanceId: string\n sessionId: string\n directory: string\n providerId: string\n modelId: string\n}\n\nexport const providerUsageKey = (source: ProviderUsageSource) => JSON.stringify([\n source.instanceId, source.sessionId, source.directory, source.providerId, source.modelId,\n])\n\nexport const shouldShowProviderUsageWindow = (label: string, showCreditBalance: boolean) =>\n label !== \"credits_balance\" || showCreditBalance\n\nexport const isFreeUsageSource = (source: ProviderUsageSource | null) => {\n const model = source?.modelId.trim().toLowerCase()\n return source?.providerId.trim().toLowerCase() === \"opencode\" && Boolean(model && (model === \"big-pickle\" || model.endsWith(\"-free\")))\n}\n\nexport const nextUtcMidnight = (now: number) => {\n const date = new Date(now)\n return Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate() + 1)\n}\n\n// The display snapshot is local to the mounted panel. Do not restore a global\n// browser cache before the server can revalidate the native selected account.\nexport function createProviderUsageState(\n fetchUsage: (source: ProviderUsageSource) => Promise<ProviderUsageResponse>,\n publish: (value: ProviderUsageResponse | null | undefined) => void,\n now = Date.now,\n) {\n let current: ProviderUsageSource | null = null\n let generation = 0\n let day = Math.floor(now() / 86_400_000)\n let running: { generation: number; again: boolean; promise: Promise<void> } | null = null\n const invalidate = () => { generation++; running = null; publish(undefined) }\n const expireUtcDay = () => {\n const today = Math.floor(now() / 86_400_000)\n if (day === today) return\n day = today\n if (isFreeUsageSource(current)) publish(undefined)\n }\n const refresh = (): Promise<void> => {\n const source = current\n if (!source) return Promise.resolve()\n expireUtcDay()\n if (running) {\n running.again = true\n return running.promise\n }\n const request = { generation, again: false, promise: Promise.resolve() }\n running = request\n request.promise = (async () => {\n try {\n do {\n request.again = false\n const requestDay = day\n try {\n const value = await fetchUsage(source)\n if (generation === request.generation) {\n expireUtcDay()\n if (isFreeUsageSource(source) && requestDay !== day) request.again = true\n else if (!(value.freeEstimate && value.windows.daily?.resetAt && value.windows.daily.resetAt <= now())) publish(value)\n }\n } catch {\n if (generation === request.generation) publish(null)\n }\n } while (request.again && generation === request.generation)\n } finally {\n if (running === request) running = null\n }\n })()\n return request.promise\n }\n return {\n select(source: ProviderUsageSource | null) {\n if (source && current && providerUsageKey(source) === providerUsageKey(current)) return\n current = source\n invalidate()\n },\n invalidate,\n expireUtcDay,\n refresh,\n dispose() { current = null; generation++; running = null },\n }\n}\n","import { For, Show, createEffect, createMemo, createSignal, onCleanup, type Component } from \"solid-js\"\n\nimport type { ProviderUsageResponse, ProviderUsageWindow } from \"../../../../server/src/api-types\"\nimport { serverApi } from \"../../lib/api-client\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { openExternalUrl } from \"../../lib/external-url\"\nimport { useConfig } from \"../../stores/preferences\"\nimport { openSettings } from \"../../stores/settings-screen\"\nimport { InfoPopoverButton } from \"../info-popover-button\"\nimport { ProviderUsageConsole } from \"./provider-usage-console\"\nimport { serverEvents } from \"../../lib/server-events\"\nimport { createProviderUsageState, isFreeUsageSource, nextUtcMidnight, providerUsageKey, shouldShowProviderUsageWindow, type ProviderUsageSource } from \"./provider-usage-state\"\n\ninterface ProviderUsagePanelProps {\n instanceId: string\n sessionId: string\n directory: string\n active: boolean\n providerId: string\n modelId: string\n}\n\nconst REFRESH_INTERVAL_MS = 60_000\n\nconst ProviderUsagePanel: Component<ProviderUsagePanelProps> = (props) => {\n const { t, locale } = useI18n()\n const { preferences } = useConfig()\n const source = createMemo<ProviderUsageSource | null>(() => {\n if (!props.active) return null\n const providerId = props.providerId.trim()\n if (!providerId) return null\n const modelId = props.modelId.trim()\n return { instanceId: props.instanceId, sessionId: props.sessionId, directory: props.directory, providerId, modelId }\n }, null, { equals: (a, b) => a === b || Boolean(a && b && providerUsageKey(a) === providerUsageKey(b)) })\n const [usage, setUsage] = createSignal<ProviderUsageResponse | null | undefined>()\n const state = createProviderUsageState(current => serverApi.fetchProviderUsage(\n current.instanceId, current.sessionId, current.providerId, current.modelId,\n ), value => setUsage(value))\n\n createEffect(() => {\n state.select(source())\n void state.refresh()\n })\n\n const revalidate = () => { state.invalidate(); if (source()) void state.refresh() }\n const unsubscribeEvents = serverEvents.on(\"instance.event\", event => {\n if (event.type !== \"instance.event\" || event.instanceId !== props.instanceId) return\n if (event.event.type === \"provider.updated\") {\n // Catalogue churn is not a credential switch. Revalidate in place only\n // for this native location; account/config/connection boundaries below\n // still revoke the display immediately and fence pending reads.\n if (source() && (!event.event.location || event.event.location.directory === props.directory)) void state.refresh()\n } else if (event.event.type === \"session.step.failed\" && isFreeUsageSource(source()) &&\n (!event.event.location || event.event.location.directory === props.directory) &&\n (event.event.data as { error?: { type?: string } } | undefined)?.error?.type === \"provider.quota\") {\n void state.refresh()\n } else if ([\"credential.updated\", \"credential.switched\", \"integration.updated\", \"config.updated\", \"server.connected\"].includes(event.event.type)) revalidate()\n })\n let lastInstanceStatus: string | undefined\n let lastTransportStatus: string | undefined\n const unsubscribeStatus = serverEvents.on(\"instance.eventStatus\", event => {\n if (event.type !== \"instance.eventStatus\" || event.instanceId !== props.instanceId) return\n // Repeated status snapshots are not reconnects. Include the native stream\n // generation so a new connection still fences quotas if its loss was missed.\n const key = JSON.stringify([event.instanceId, event.status, event.generation])\n if (key === lastInstanceStatus) return\n lastInstanceStatus = key\n state.invalidate()\n if (event.status === \"connected\" && source()) void state.refresh()\n })\n const unsubscribeTransport = serverEvents.onTransportStatus(status => {\n if (status === lastTransportStatus) return\n lastTransportStatus = status\n state.invalidate()\n if (status === \"connected\" && source()) void state.refresh()\n })\n const refreshTimer = setInterval(() => { if (source()) void state.refresh() }, REFRESH_INTERVAL_MS)\n createEffect(() => {\n if (!isFreeUsageSource(source())) return\n let timer: ReturnType<typeof setTimeout>\n const schedule = () => {\n timer = setTimeout(() => { state.expireUtcDay(); void state.refresh(); schedule() }, nextUtcMidnight(Date.now()) - Date.now())\n }\n schedule()\n onCleanup(() => clearTimeout(timer))\n })\n onCleanup(() => {\n state.dispose()\n clearInterval(refreshTimer)\n unsubscribeEvents()\n unsubscribeStatus()\n unsubscribeTransport()\n })\n\n const entries = createMemo(() => Object.entries(usage()?.windows ?? {}))\n const displayedLabels = createMemo(() =>\n entries().map(([label]) => label).filter(label => shouldShowProviderUsageWindow(label, preferences().showProviderUsageCreditBalance)),\n )\n const hasReadings = createMemo(() => displayedLabels().length > 0 || Boolean(usage()?.console))\n const unavailableMessage = createMemo(() => {\n const data = usage()\n if (data?.freeEstimate && data.unavailableReason === \"opencode-console-missing-credential\") return t(\"providerUsage.freeConnect\")\n const consoleMessage = data ? consoleError(data) : undefined\n if (consoleMessage) return t(consoleMessage)\n if (data?.unavailableReason === \"openai-token-sharing-unsupported\") return t(\"providerUsage.openaiTokenSharingUnsupported\")\n if (data?.unavailableReason === \"opencode-go-key-expired\") return t(\"providerUsage.openCodeGoKeyExpired\")\n if (data?.unavailableReason === \"minimax-limits-not-shared\") return t(\"providerUsage.minimaxLimitsNotShared\")\n if (data?.unavailableReason === \"invalid-base-url\") return t(\"providerUsage.invalidBaseURL\")\n if (data?.unavailableReason === \"cursor-token-expired\") return t(\"providerUsage.cursorTokenExpired\")\n if (data?.unavailableReason === \"cursor-team-unavailable\") return t(\"providerUsage.cursorTeamUnavailable\")\n if (data?.unavailableReason === \"cursor-access-denied\") return t(\"providerUsage.cursorAccessDenied\")\n if (data?.unavailableReason === \"cursor-usage-unavailable\") return t(\"providerUsage.cursorUsageUnavailable\")\n if (data?.unavailableReason === \"provider-error\") return data.providerErrorCode && /^\\d{1,8}$/.test(data.providerErrorCode) && data.providerErrorCode.trim() === data.providerErrorCode\n ? t(\"providerUsage.providerErrorCode\", { code: data.providerErrorCode }) : t(\"providerUsage.unavailable\")\n return null\n })\n // Destinations and labels belong to the UI, never to upstream response text.\n const unavailableLink = createMemo(() => usage()?.unavailableReason === \"openai-token-sharing-unsupported\"\n && usage()?.unavailableAction === \"chatgpt-usage\"\n ? { href: \"https://chatgpt.com/settings/usage\", label: t(\"providerUsage.viewChatGPTUsage\") }\n : usage()?.unavailableReason === \"opencode-go-key-expired\" && usage()?.unavailableAction === \"opencode-go-new-key\"\n ? { href: \"https://opencode.ai/console/login\", label: t(\"providerUsage.createOpenCodeGoKey\") } : null)\n\n const windowLabel = (label: string): string => {\n // Model-scoped limits arrive as `window:Model`, e.g. `requests:gemini-2.5-pro` or `7d:Opus`.\n const scope = label.indexOf(\":\")\n if (scope > 0) return `${windowLabel(label.slice(0, scope))} · ${label.slice(scope + 1)}`\n const key = ({\n \"5h\": \"fiveHours\",\n \"7d\": \"sevenDays\",\n \"7d-sonnet\": \"sevenDaysSonnet\",\n \"7d-opus\": \"sevenDaysOpus\",\n weekly: \"weekly\",\n daily: \"daily\",\n monthly: \"monthly\",\n tokens: \"tokens\",\n input_tokens: \"inputTokens\",\n output_tokens: \"outputTokens\",\n usage: \"usage\",\n \"monthly-code\": \"monthlyCode\",\n credits: \"credits\",\n key_limit: \"keyLimit\",\n per_user_limit: \"perUserLimit\",\n team_limit: \"teamLimit\",\n requests: \"requests\",\n credits_balance: \"credits\",\n billing_cycle: \"billingCycle\",\n session: \"session\",\n premium: \"premium\",\n chat: \"chat\",\n completions: \"completions\",\n \"mcp-tools\": \"mcpTools\",\n } as Record<string, string>)[label]\n return key ? t(`providerUsage.windows.${key}`) : label\n }\n\n const usedValue = (key: string, value: string) => {\n const [before, after] = t(key).split(\"{used}\")\n return <>{before}<bdi dir=\"ltr\">{value}</bdi>{after}</>\n }\n\n const displayValue = (window: ProviderUsageWindow) => {\n const consumption = window.consumption\n const number = new Intl.NumberFormat(locale(), { maximumFractionDigits: 8 })\n const estimate = usage()?.freeEstimate\n if (estimate) return estimate.requests === null ? t(\"providerUsage.unavailableValue\")\n : <bdi dir=\"ltr\">{number.format(estimate.requests)} / {number.format(estimate.reference)}</bdi>\n if (consumption && \"used\" in consumption) return usedValue(\"providerUsage.usedCountOnly\", consumption.limit === undefined\n ? number.format(consumption.used) : `${number.format(consumption.used)} / ${number.format(consumption.limit)}`)\n if (consumption && \"creditsUsed\" in consumption) return usedValue(\"providerUsage.creditsUsed\", number.format(consumption.creditsUsed))\n if (consumption && \"unlimited\" in consumption) return t(\"providerUsage.unlimited\")\n if (window.limitUSD !== undefined) return <bdi dir=\"ltr\">{new Intl.NumberFormat(locale(), { style: \"currency\", currency: \"USD\" }).format(window.limitUSD)}</bdi>\n if (window.balanceUSD) {\n const money = new Intl.NumberFormat(locale(), { style: \"currency\", currency: \"USD\" })\n // Currency formatters may include RTL marks; isolate each amount as well as the ratio.\n return <bdi dir=\"ltr\"><bdi dir=\"ltr\">{money.format(window.balanceUSD.remaining)}</bdi>\n <Show when={window.balanceUSD.total !== undefined}>{\" / \"}<bdi dir=\"ltr\">{money.format(window.balanceUSD.total!)}</bdi></Show>\n </bdi>\n }\n if (window.valueLabel) return <bdi dir=\"ltr\">{window.valueLabel}</bdi>\n if (window.usedPercent === null) return t(\"providerUsage.unavailableValue\")\n return t(\"providerUsage.usedPercent\", { percent: new Intl.NumberFormat(locale()).format(Math.round(window.usedPercent)) })\n }\n\n const resetLabel = (resetAt: number | null) => {\n if (!resetAt) return null\n const date = new Date(resetAt)\n if (!Number.isFinite(date.getTime())) return null\n const estimated = usage()?.estimated\n const time = date.toLocaleString(locale(), { dateStyle: \"short\", timeStyle: \"short\", ...(estimated ? { timeZone: \"UTC\" } : {}) })\n return t(estimated ? \"providerUsage.estimatedReset\" : \"providerUsage.resets\", { time: estimated ? `${time} UTC` : time })\n }\n\n const barColor = (percent: number | null) => {\n if (percent !== null && percent >= 80) return \"var(--status-error)\"\n if (percent !== null && percent >= 50) return \"var(--status-warning)\"\n return \"var(--status-success)\"\n }\n\n return (\n <div>\n <Show when={usage() !== undefined} fallback={<div role=\"status\" class=\"right-panel-empty-text\">{t(\"providerUsage.loading\")}</div>}>\n <Show when={usage()} fallback={<div role=\"status\" class=\"right-panel-empty-text\">{t(\"providerUsage.unavailable\")}</div>}>\n {(data) => (\n <Show\n when={data().supported && data().configured && data().ok && !unavailableMessage() && hasReadings()}\n fallback={\n <Show when={unavailableMessage()} fallback={<div role=\"status\" class=\"right-panel-empty-text\">\n {t(\n !data().supported\n ? \"providerUsage.unsupported\"\n : !data().configured\n ? \"providerUsage.notConfigured\"\n : \"providerUsage.unavailable\",\n )}\n </div>}>\n {message => <div role=\"status\" class=\"space-y-2 border border-base bg-surface-inset p-2 text-xs text-primary\">\n <div>{message()}</div>\n <Show when={unavailableLink()}>{link => <a href={link().href} target=\"_blank\" rel=\"noopener noreferrer\"\n class=\"text-accent underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent-primary)]\"\n onClick={event => { event.preventDefault(); void openExternalUrl(link().href, \"provider-usage\") }}>\n {link().label}\n </a>}</Show>\n <Show when={[\"opencode-console-missing-credential\", \"opencode-console-access-denied\", \"opencode-console-invalid-credential\"].includes(data().unavailableReason ?? \"\")}>\n <button type=\"button\" class=\"window-action mt-1\" onClick={() => void openSettings(\"providers\")}>{t(\"providerUsage.console.settings\")}</button>\n </Show>\n </div>}\n </Show>\n }\n >\n <div class=\"space-y-2\">\n <Show when={data().console}>{console => <ProviderUsageConsole usage={console()} />}</Show>\n <Show when={data().estimated}>\n <div class=\"flex items-center gap-1 text-[10px] text-tertiary\">\n <span>{t(\"providerUsage.estimated\")}</span>\n <InfoPopoverButton label={t(\"providerUsage.estimated\")}>{t(\"providerUsage.estimateInfo\")}</InfoPopoverButton>\n <Show when={data().freeEstimate?.exhausted}><span role=\"status\" class=\"font-medium text-primary\">{t(\"providerUsage.exhausted\")}</span></Show>\n </div>\n </Show>\n <For each={displayedLabels()}>\n {(label) => {\n // Retain this row's value until For reconciles a removed\n // label; its effects must not read an absent window.\n const window = createMemo<ProviderUsageWindow>(previous => usage()?.windows[label] ?? previous, usage()!.windows[label])\n const usedPercent = () => label === \"daily\" && usage()?.freeEstimate?.exhausted ? 100 : window().usedPercent\n return (\n <div>\n <div class=\"mb-1 flex flex-wrap items-baseline justify-between gap-x-2 gap-y-1 text-[11px] text-primary\">\n <span class=\"max-w-full shrink-0 font-medium\">{windowLabel(label)}</span>\n <div class=\"ms-auto flex min-w-0 max-w-full flex-wrap items-baseline justify-end gap-1.5 text-end\">\n <span class=\"min-w-0 font-medium [overflow-wrap:anywhere]\">{displayValue(window())}</span>\n <Show when={resetLabel(window().resetAt)}>\n {(reset) => (\n <>\n <span class=\"text-tertiary\" aria-hidden=\"true\">·</span>\n <span class=\"truncate text-[10px] text-tertiary\">{reset()}</span>\n </>\n )}\n </Show>\n </div>\n </div>\n <Show when={usedPercent() !== null}>\n <div class=\"h-2 overflow-hidden border border-base\" style={{ \"background-color\": \"var(--surface-inset)\" }}>\n <div\n class=\"h-full transition-[width] duration-300\"\n style={{ width: `${Math.max(0, Math.min(100, usedPercent() ?? 0))}%`, \"background-color\": barColor(usedPercent()) }}\n role=\"progressbar\"\n aria-label={t(\"providerUsage.progressLabel\", { window: windowLabel(label) })}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(usedPercent() ?? 0)}\n />\n </div>\n </Show>\n </div>\n )\n }}\n </For>\n </div>\n </Show>\n )}\n </Show>\n </Show>\n <Show when={usage()?.supported && usage()?.configured && usage()?.ok && !unavailableMessage() && hasReadings()}>\n <div class=\"mt-2 truncate text-right text-sm font-semibold text-secondary\">\n {usage()?.providerName ?? props.providerId}\n <Show when={usage()?.copilotPlan}>{plan => ` · ${t(`providerUsage.copilotPlans.${plan()}`)}`}</Show>\n </div>\n </Show>\n </div>\n )\n}\n\nexport default ProviderUsagePanel\n\nfunction consoleError(data: ProviderUsageResponse) {\n return ({\n \"opencode-console-missing-credential\": \"providerUsage.console.missingCredential\",\n \"opencode-console-access-denied\": \"providerUsage.console.accessDenied\",\n \"opencode-console-invalid-credential\": \"providerUsage.console.invalidCredential\",\n \"opencode-console-invalid-response\": \"providerUsage.console.malformed\",\n \"opencode-console-network-error\": \"providerUsage.console.network\",\n } as Record<string, string>)[data.unavailableReason ?? \"\"]\n}\n","import { z } from \"zod\"\n\n// OpenCode's built-in `/goal` plugin (`@opencode/schema/goal`; dev-docs/OPENCODE_COMPATIBILITY.md, Session goal):\n// `get({ sessionID })` answers the Session's own goal or null, every write publishes\n// `changed` in the Session's Location, and `/goal pause|resume|clear` change it.\nexport const GOAL_RPC_ID = \"opencode.goal\"\nexport const GOAL_CHANGED_EVENT = \"rpc.opencode.goal.changed\"\nexport const GOAL_COMMAND = \"goal\"\nexport type GoalCommandAction = \"pause\" | \"resume\" | \"clear\"\n\n// Only the displayed fields; unknown fields are dropped. Bounds sit far above the\n// plugin's own (4,000-character objectives) and reject only malformed answers.\nexport const goalStateSchema = z.object({\n id: z.string().min(1).max(256),\n objective: z.string().max(64 * 1024),\n status: z.enum([\"active\", \"paused\", \"complete\"]),\n reason: z.string().max(16 * 1024).optional(),\n rounds: z.number().int().nonnegative(),\n maxRounds: z.number().int().nonnegative(),\n updatedAt: z.number(),\n})\nexport type GoalState = z.infer<typeof goalStateSchema>\n\nexport const goalChangedSchema = z.object({ sessionID: z.string().min(1).max(512), goal: goalStateSchema.nullable() })\n\n/** `GET /api/workspaces/:id/sessions/:sessionId/goal`: `unsupported` without the RPC, `unavailable` on any other failure. */\nexport type SessionGoalResponse = { status: \"goal\"; goal: GoalState | null } | { status: \"unsupported\" } | { status: \"unavailable\" }\n","import { createSignal, untrack } from \"solid-js\"\nimport { goalChangedSchema, goalStateSchema, type SessionGoalResponse } from \"../../../server/src/opencode/goal-contract\"\n\n/** A Session's `/goal` as last heard: `loading` until the first answer. */\nexport type SessionGoalSnapshot = { status: \"loading\" } | SessionGoalResponse\n\nconst LOADING: SessionGoalSnapshot = { status: \"loading\" }\n\ninterface Entry {\n demand: number\n /** Bumped by every published change; a read dispatched before it is older. */\n version: number\n reading?: { dirty: boolean; promise: Promise<void>; controller: AbortController }\n}\n\n/**\n * Goals of the Sessions the Status tab shows, keyed by instance and Session.\n * Demand (a mounted goal line) reads; `changed` events and the line's own\n * commands keep it current, reconnects re-read what is shown. One read runs per\n * demanded Session with at most one trailing follow-up, and an answer is\n * published only when no change was heard since it was requested. Releasing the\n * last demand aborts the Session's queued or running read, so switching sessions\n * never queues reads for hidden ones; the next demand reads again. A failed read\n * keeps the last goal shown. Nothing reads on a timer.\n */\nexport function createSessionGoalStore(read: (instanceId: string, sessionId: string, signal: AbortSignal) => Promise<SessionGoalResponse>) {\n const [snapshots, setSnapshots] = createSignal<ReadonlyMap<string, SessionGoalSnapshot>>(new Map())\n const [busy, setBusy] = createSignal<ReadonlySet<string>>(new Set())\n const entries = new Map<string, Entry>()\n const key = (instanceId: string, sessionId: string) => `${instanceId}\\0${sessionId}`\n const publish = (stateKey: string, snapshot: SessionGoalSnapshot) => setSnapshots(current => new Map(current).set(stateKey, snapshot))\n const cancel = (entry: Entry | undefined) => {\n const reading = entry?.reading\n if (!reading) return\n entry.reading = undefined\n reading.controller.abort()\n }\n\n const refresh = (instanceId: string, sessionId: string): Promise<void> => {\n const stateKey = key(instanceId, sessionId)\n const entry = entries.get(stateKey)\n if (!entry || entry.demand === 0) return Promise.resolve()\n if (entry.reading) {\n entry.reading.dirty = true\n return entry.reading.promise\n }\n const reading = { dirty: false, promise: Promise.resolve(), controller: new AbortController() }\n const { signal } = reading.controller\n entry.reading = reading\n reading.promise = (async () => {\n try {\n do {\n reading.dirty = false\n const version = entry.version\n const answer = await read(instanceId, sessionId, signal).catch((): SessionGoalResponse => ({ status: \"unavailable\" }))\n if (signal.aborted) return\n if (entries.get(stateKey) !== entry || entry.version !== version) continue\n const shown = untrack(snapshots).get(stateKey)\n if (answer?.status === \"goal\" || answer?.status === \"unsupported\") publish(stateKey, answer)\n else if (shown?.status !== \"goal\") publish(stateKey, { status: \"unavailable\" })\n } while (reading.dirty && entries.get(stateKey) === entry && entry.demand > 0)\n } finally {\n if (entry.reading === reading) entry.reading = undefined\n }\n })()\n return reading.promise\n }\n\n return {\n state(instanceId: string, sessionId: string): SessionGoalSnapshot {\n return snapshots().get(key(instanceId, sessionId)) ?? LOADING\n },\n busy(instanceId: string, sessionId: string): boolean {\n return busy().has(key(instanceId, sessionId))\n },\n /** Reads now and tracks the Session until the returned release, whose last call aborts its read. */\n demand(instanceId: string, sessionId: string): () => void {\n const stateKey = key(instanceId, sessionId)\n let entry = entries.get(stateKey)\n if (!entry) entries.set(stateKey, entry = { demand: 0, version: 0 })\n const tracked = entry\n tracked.demand += 1\n void refresh(instanceId, sessionId)\n let released = false\n return () => {\n if (released) return\n released = true\n tracked.demand -= 1\n if (tracked.demand === 0) cancel(tracked)\n }\n },\n refresh,\n /** Re-reads the demanded Sessions (of one instance), after a reconnect missed changes. */\n refreshDemanded(instanceId?: string): Promise<void> {\n return Promise.all(Array.from(entries, ([stateKey, entry]) => {\n const [owner, sessionId] = stateKey.split(\"\\0\") as [string, string]\n return entry.demand > 0 && (instanceId === undefined || owner === instanceId) ? refresh(owner, sessionId) : undefined\n })).then(() => undefined)\n },\n /** `rpc.opencode.goal.changed`: the new value of a tracked Session's goal. */\n applyChanged(instanceId: string, data: unknown): void {\n const sessionId = goalChangedSchema.shape.sessionID.safeParse((data as { sessionID?: unknown } | null)?.sessionID)\n if (!sessionId.success) return\n const stateKey = key(instanceId, sessionId.data)\n const entry = entries.get(stateKey)\n if (!entry) return\n const goal = goalStateSchema.nullable().safeParse((data as { goal?: unknown }).goal)\n // A change this client cannot read is still a change: ask for the value\n // (a hidden Session reads on its next demand).\n if (!goal.success) return void refresh(instanceId, sessionId.data)\n entry.version += 1\n publish(stateKey, { status: \"goal\", goal: goal.data })\n },\n forget(instanceId: string, sessionId: string): void {\n const stateKey = key(instanceId, sessionId)\n cancel(entries.get(stateKey))\n entries.delete(stateKey)\n setSnapshots(current => {\n if (!current.has(stateKey)) return current\n const next = new Map(current)\n next.delete(stateKey)\n return next\n })\n },\n clearInstance(instanceId: string): void {\n const prefix = `${instanceId}\\0`\n for (const [stateKey, entry] of [...entries]) {\n if (!stateKey.startsWith(prefix)) continue\n cancel(entry)\n entries.delete(stateKey)\n }\n setSnapshots(current => new Map([...current].filter(([stateKey]) => !stateKey.startsWith(prefix))))\n },\n /** Runs one command for the Session (refusing a second meanwhile), then reads its outcome while it is shown. */\n async run(instanceId: string, sessionId: string, command: () => Promise<void>): Promise<void> {\n const stateKey = key(instanceId, sessionId)\n if (untrack(busy).has(stateKey)) return\n setBusy(current => new Set(current).add(stateKey))\n try {\n await command()\n } finally {\n setBusy(current => {\n const next = new Set(current)\n next.delete(stateKey)\n return next\n })\n void refresh(instanceId, sessionId)\n }\n },\n }\n}\n\nexport type SessionGoalStore = ReturnType<typeof createSessionGoalStore>\n","import { GOAL_CHANGED_EVENT, GOAL_COMMAND, type GoalCommandAction } from \"../../../server/src/opencode/goal-contract\"\nimport { serverApi } from \"../lib/api-client\"\nimport { createEventRefreshScheduler } from \"../lib/event-refresh-scheduler\"\nimport { tGlobal } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { getOpencodeErrorMessage } from \"../lib/opencode-api\"\nimport { serverEvents } from \"../lib/server-events\"\nimport { executeCustomCommand } from \"./session-actions\"\nimport { createSessionGoalStore } from \"./session-goal-store\"\n\n// The signal leaves the shared background budget's queue or aborts the request once the Session is hidden.\nexport const sessionGoals = createSessionGoalStore((instanceId, sessionId, signal) => serverApi.fetchSessionGoal(instanceId, sessionId, signal))\n\n// Changes published while the stream was down are lost: re-read what is shown.\nconst reconnects = createEventRefreshScheduler(instanceId => sessionGoals.refreshDemanded(instanceId))\n\nserverEvents.on(\"instance.event\", (event) => {\n if (event.type !== \"instance.event\") return\n const native = event.event as { type: string; data?: { sessionID?: unknown } }\n if (native.type === GOAL_CHANGED_EVENT) sessionGoals.applyChanged(event.instanceId, native.data)\n else if (native.type === \"session.deleted\" && typeof native.data?.sessionID === \"string\") sessionGoals.forget(event.instanceId, native.data.sessionID)\n else if (native.type === \"server.connected\") reconnects.schedule(event.instanceId, \"urgent\")\n else if (native.type === \"plugin.updated\") reconnects.schedule(event.instanceId, \"urgent\")\n})\n\nserverEvents.on(\"instance.eventStatus\", (event) => {\n if (event.type === \"instance.eventStatus\" && event.status === \"connected\") reconnects.schedule(event.instanceId, \"urgent\")\n})\n\nserverEvents.onOpen(() => void sessionGoals.refreshDemanded())\n\nserverEvents.on(\"workspace.stopped\", (event) => {\n if (event.type !== \"workspace.stopped\") return\n reconnects.cancel(event.workspaceId)\n sessionGoals.clearInstance(event.workspaceId)\n})\n\n/** `/goal pause|resume|clear` for the Session through the composer's command path; failures show a notice. */\nexport function runSessionGoalCommand(instanceId: string, sessionId: string, action: GoalCommandAction): Promise<void> {\n return sessionGoals.run(instanceId, sessionId, async () => {\n try {\n await executeCustomCommand(instanceId, sessionId, GOAL_COMMAND, action)\n } catch (error) {\n showToastNotification({ category: \"sessions\", title: tGlobal(\"instanceShell.goal.error\"),\n message: getOpencodeErrorMessage(error, tGlobal(\"instanceShell.goal.error\")), variant: \"error\" })\n }\n })\n}\n","import { Show, createEffect, createMemo, createUniqueId, onCleanup, type Component } from \"solid-js\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport { Pause, Play, Trash2 } from \"lucide-solid\"\nimport { useI18n } from \"../../lib/i18n\"\nimport { TOOL_OUTPUT_RENDER_CHARACTER_LIMIT, getRenderTextWindow } from \"../../lib/render-text-window\"\nimport { runSessionGoalCommand, sessionGoals } from \"../../stores/session-goal\"\n\ninterface SessionGoalLineProps {\n instanceId: string\n sessionId: string\n /** The Status tab is shown: read and track the Session's goal. */\n active: boolean\n}\n\n// Plain text in one line and a tooltip, bounded like other plain text blocks\n// (dev-docs/TEXT_DISPLAY_BOUNDS.md); the plugin itself caps objectives far below.\nfunction boundedText(text: string): string {\n const window = getRenderTextWindow(text, TOOL_OUTPUT_RENDER_CHARACTER_LIMIT)\n return window.hidden > 0 ? `${window.text}…` : window.text\n}\n\n/** The shown Session's `/goal` on one line above the Status sections; nothing without a goal. */\nconst SessionGoalLine: Component<SessionGoalLineProps> = (props) => {\n const { t } = useI18n()\n const reasonId = createUniqueId()\n createEffect(() => {\n if (!props.active) return\n onCleanup(sessionGoals.demand(props.instanceId, props.sessionId))\n })\n const goal = createMemo(() => {\n const snapshot = sessionGoals.state(props.instanceId, props.sessionId)\n return snapshot.status === \"goal\" ? snapshot.goal : null\n })\n const busy = () => sessionGoals.busy(props.instanceId, props.sessionId)\n // Busy actions stay focusable (`aria-disabled`, activation ignored): a disabled\n // focused button would hand keyboard focus to the page while its command runs.\n const run = (action: \"pause\" | \"resume\" | \"clear\") => {\n if (!busy()) void runSessionGoalCommand(props.instanceId, props.sessionId, action)\n }\n\n return (\n <Show when={goal()}>\n {(current) => {\n const objective = createMemo(() => boundedText(current().objective))\n const reason = createMemo(() => current().reason ? boundedText(current().reason!) : \"\")\n const rounds = () => t(\"instanceShell.goal.rounds\", { rounds: current().rounds, max: current().maxRounds })\n // One control for Pause and Resume keeps keyboard focus when the status flips.\n const toggleLabel = () => t(current().status === \"paused\" ? \"instanceShell.goal.actions.resume\" : \"instanceShell.goal.actions.pause\")\n return (\n <div class=\"session-goal-line\" role=\"group\" aria-label={t(\"instanceShell.goal.label\")}\n aria-describedby={reason() ? reasonId : undefined} aria-busy={busy()} data-status={current().status}>\n <Tooltip placement=\"bottom-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" class=\"session-goal-summary\">\n <span class=\"session-goal-badge\" data-status={current().status}>{t(`instanceShell.goal.status.${current().status}`)}</span>\n <span class=\"session-goal-objective\"><bdi>{objective()}</bdi></span>\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content class=\"section-info-tooltip session-goal-tooltip\">\n <p><bdi>{objective()}</bdi></p>\n <Show when={reason()}><p class=\"session-goal-tooltip-reason\"><bdi>{reason()}</bdi></p></Show>\n </Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip>\n <Show when={reason()}><span id={reasonId} class=\"sr-only\">{reason()}</span></Show>\n <span class=\"session-goal-rounds\" title={rounds()}>\n <span aria-hidden=\"true\">{current().rounds}/{current().maxRounds}</span>\n <span class=\"sr-only\">{rounds()}</span>\n </span>\n <Show when={current().status !== \"complete\"}>\n <button type=\"button\" class=\"window-icon-button\" aria-label={toggleLabel()} title={toggleLabel()} aria-disabled={busy()}\n onClick={() => run(current().status === \"paused\" ? \"resume\" : \"pause\")}>\n <Show when={current().status === \"paused\"} fallback={<Pause aria-hidden=\"true\" />}><Play aria-hidden=\"true\" /></Show>\n </button>\n </Show>\n <button type=\"button\" class=\"window-icon-button\" aria-label={t(\"instanceShell.goal.actions.clear\")}\n title={t(\"instanceShell.goal.actions.clear\")} aria-disabled={busy()} onClick={() => run(\"clear\")}>\n <Trash2 aria-hidden=\"true\" />\n </button>\n </div>\n )\n }}\n </Show>\n )\n}\n\nexport default SessionGoalLine\n","import type { IntegrationBindingResponse, IntegrationHostOffer, IntegrationView } from \"../../../server/src/integration-types\"\n\ntype Entry = Pick<IntegrationView, \"family\" | \"state\" | \"status\">\n\n/** The displayed conversation's attachment, shown by a native integration's Plugins row. */\nexport type IntegrationLink = IntegrationBindingResponse\n\n/** A Plugins row's indicator: shown only when the application part needs an action. */\nexport type IntegrationAttention = \"hostAbsent\" | \"hostOutdated\" | \"incompatible\"\n\n/** The connection state of the row menu's information line. */\nexport type IntegrationConnection =\n | { state: \"offers\"; count: number }\n | { state: \"noOffer\" | \"hostClosed\" | \"unsupported\" | \"detected\" | \"absent\" | \"connected\" | \"disconnected\" | \"unknown\" }\n\nconst loadedNative = (entry: Entry) => entry.family === \"native\" && entry.state === \"ok\"\n\n/**\n * The link state of a loaded native integration for the displayed conversation: none without a conversation,\n * else the integration's own per-conversation read. Other families and unloaded integrations have no link.\n */\nexport function integrationLink(entry: Entry, binding: IntegrationBindingResponse | undefined): IntegrationLink | undefined {\n if (!loadedNative(entry) || entry.status?.host?.state === \"unsupported\") return undefined\n return binding ?? { state: \"none\" }\n}\n\nexport function integrationAttention(entry: Entry): IntegrationAttention | undefined {\n if (!loadedNative(entry)) return undefined\n const host = entry.status?.host?.state\n return host === \"absent\" ? \"hostAbsent\" : host === \"outdated\" ? \"hostOutdated\" : host === \"incompatible\" ? \"incompatible\" : undefined\n}\n\nexport function integrationConnection(entry: Entry): IntegrationConnection {\n if (entry.state !== \"ok\") return { state: \"unknown\" }\n const connection = entry.status?.connection\n if (entry.family === \"native\") {\n const host = entry.status?.host?.state\n if (host === \"unsupported\") return { state: \"unsupported\" }\n const offers = connection?.offers ?? 0\n if (offers > 0) return { state: \"offers\", count: offers }\n return { state: host === \"unknown\" ? \"hostClosed\" : \"noOffer\" }\n }\n if (entry.family === \"vendor-mcp\") return { state: connection?.state === \"connected\" ? \"detected\" : \"absent\" }\n return { state: connection?.state === \"connected\" ? \"connected\" : \"disconnected\" }\n}\n\n/** The i18n key and variables of a connection line. */\nexport function integrationConnectionMessage(connection: IntegrationConnection, app: string): [string, Record<string, string | number>] {\n if (connection.state === \"offers\") return [`integrations.connection.offers.${connection.count === 1 ? \"one\" : \"other\"}`, { app, count: connection.count }]\n return [`integrations.connection.${connection.state}`, { app }]\n}\n\n/** What the chain button does: detach, attach, or nothing with a reason shown instead. */\nexport type IntegrationChainAction = \"detach\" | \"attach\" | \"unavailable\"\n\nexport function integrationChainAction(link: IntegrationLink, unavailable: string | undefined): IntegrationChainAction {\n return link.state === \"attached\" ? \"detach\" : unavailable ? \"unavailable\" : \"attach\"\n}\n\n/** After reading the open documents: attach the only compatible one, choose between several, or none. */\nexport type IntegrationAttachChoice = { kind: \"attach\"; offerID: string } | { kind: \"choose\"; offers: IntegrationHostOffer[] } | { kind: \"none\" }\n\nexport function integrationAttachChoice(offers: readonly IntegrationHostOffer[]): IntegrationAttachChoice {\n const compatible = offers.filter(offer => offer.protocol === \"ok\")\n if (compatible.length === 0) return { kind: \"none\" }\n return compatible.length === 1 ? { kind: \"attach\", offerID: compatible[0]!.offerID } : { kind: \"choose\", offers: compatible }\n}\n\n/** The catalogue summary in the current language, else English. */\nexport function integrationSummary(entry: Pick<IntegrationView, \"summary\">, locale: string): string {\n return entry.summary[locale] ?? entry.summary[locale.split(\"-\")[0]!] ?? entry.summary.en ?? Object.values(entry.summary)[0] ?? \"\"\n}\n","import type {\n PluginActivationControl,\n PluginConfiguredSource,\n PluginControlScope,\n PluginControlsSnapshot,\n PluginRuntimeSource,\n} from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\n\n/** An integration's plugin as the plugin-controls snapshot shows it, found through the view's safe correlations. */\nexport interface IntegrationPlugin {\n /** Its declarations, in snapshot order. */\n sources: PluginConfiguredSource[]\n /** The activation control of its plugin, when a declaration loaded it or a rule names it. */\n control?: PluginActivationControl\n /** Its package as the runtime inventory reports it, for the native check/update action. */\n source?: PluginRuntimeSource\n}\n\nexport function integrationPlugin(snapshot: PluginControlsSnapshot | undefined,\n entry: Pick<IntegrationView, \"configuredSources\" | \"configuredRules\">): IntegrationPlugin {\n if (!snapshot) return { sources: [] }\n // Independent reads can reuse an index for another plugin. Only the same verified writable document joins them.\n const correlated = (item: { scope: string; path?: string; entryIndex: number },\n list: readonly { scope: PluginControlScope; entryIndex: number; expectedRevision?: string }[]) =>\n list.some(association => association.scope === item.scope && association.entryIndex === item.entryIndex\n && typeof association.expectedRevision === \"string\" && association.expectedRevision.length > 0\n && snapshot.targets.some(target => target.scope === item.scope && target.path === item.path\n && target.expectedRevision === association.expectedRevision))\n const sources = snapshot.configured.sources.filter(source => correlated(source, entry.configuredSources))\n const ids = new Set([\n ...sources.flatMap(source => source.pluginId ? [source.pluginId] : []),\n ...snapshot.configured.rules.filter(rule => correlated(rule, entry.configuredRules ?? [])).map(rule => rule.selector),\n ])\n // Two plugin IDs cannot both be this integration's: leave the switches out rather than guess.\n const control = ids.size === 1 ? snapshot.controls.find(candidate => candidate.id === [...ids][0]) : undefined\n const targets = new Set(sources.map(source => source.target))\n const source = control?.runtime?.source\n ?? snapshot.runtime.find(item => item.source.type === \"package\" && targets.has(item.source.target))?.source\n return { sources, ...(control ? { control } : {}), ...(source ? { source } : {}) }\n}\n\n/** Read-only row identity for inherited, virtual or runtime-only plugins; writable correlations stay separate. */\nexport function integrationDisplayPlugin(snapshot: PluginControlsSnapshot | undefined,\n entry: Pick<IntegrationView, \"configuredSources\" | \"configuredRules\" | \"plugin\" | \"ambiguous\">): IntegrationPlugin {\n if (entry.ambiguous) return { sources: [] }\n const configured = integrationPlugin(snapshot, entry)\n if (configured.control || configured.sources.length || !snapshot || !entry.plugin.runtimeId) return configured\n const matches = snapshot.runtime.filter(runtime => runtime.id === entry.plugin.runtimeId)\n if (matches.length !== 1) return configured\n const runtime = matches[0]!\n const controls = snapshot.controls.filter(control => control.id === runtime.id && control.runtime?.key === runtime.key)\n return { sources: [], ...(controls.length === 1 ? { control: controls[0] } : {}), source: runtime.source }\n}\n","import type { IntegrationsResponse, IntegrationHostsResponse, IntegrationAttachResponse, IntegrationDetachResponse, IntegrationInstallHostResponse, IntegrationBindingResponse } from \"../../../server/src/integration-types\"\nimport type { PluginControlScope } from \"../../../server/src/api-types\"\nimport type { PluginSourceMutationResponse } from \"../../../server/src/plugin-source-types\"\nimport type { IntegrationBindingTarget } from \"../stores/integration-bindings-store\"\nimport { CODENOMAD_API_BASE as API_BASE } from \"./api-base\"\nimport { authenticatedFetch } from \"./auth-recovery\"\nimport { backgroundReads } from \"./background-read-queue\"\nimport { HttpResponseError } from \"./retryable-file-search\"\n\n/** The catalog integrations of one Location (`GET /api/workspaces/:id/integrations`), in the shared background budget. */\nexport function fetchIntegrations(instanceId: string, directory: string, signal: AbortSignal): Promise<IntegrationsResponse> {\n const path = `/api/workspaces/${encodeURIComponent(instanceId)}/integrations?${new URLSearchParams({ directory })}`\n return backgroundReads.run(signal, async () => {\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, { signal, credentials: \"include\" })\n if (!response.ok) throw new HttpResponseError(`Request failed with ${response.status}`, response.status, response.headers.get(\"Retry-After\"))\n const value = await response.json()\n if (!value || !Array.isArray(value.integrations) || !value.catalog || ![\"fresh\", \"stale\", \"unavailable\"].includes(value.catalog.state)) {\n throw new Error(\"Invalid integration response\")\n }\n return value as IntegrationsResponse\n }, \"visible\")\n}\n\n/** Projected per-session binding only; transport failures revoke authority without exposing native diagnostics. */\nexport function fetchIntegrationBinding(target: IntegrationBindingTarget, signal: AbortSignal): Promise<IntegrationBindingResponse> {\n return backgroundReads.run(signal, async () => {\n const path = `/api/workspaces/${encodeURIComponent(target.instanceId)}/integrations/${encodeURIComponent(target.integrationId)}/binding?${new URLSearchParams({ directory: target.directory, sessionID: target.sessionID })}`\n try {\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, { signal, credentials: \"include\", cache: \"no-store\" })\n if (!response.ok) return { state: \"unknown\" }\n const value = await response.json()\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return { state: \"unknown\" }\n const keys = Object.keys(value)\n if (keys.length === 1 && (value.state === \"none\" || value.state === \"unknown\")) return { state: value.state }\n if (keys.length === 2 && keys.includes(\"label\") && value.state === \"attached\" && typeof value.label === \"string\"\n && [...value.label].length > 0 && [...value.label].length <= 120 && !/[/\\\\\\p{Cc}]/u.test(value.label)) return { state: \"attached\", label: value.label }\n } catch { /* A failed authority read is unknown; never retain a previous attachment. */ }\n return { state: \"unknown\" }\n }, \"visible\")\n}\n\n/**\n * Installs a catalog integration by ID (`POST …/integrations/:id/install`): the server builds the spec from its\n * catalog. Sent once; a lost or refused answer is an uncertain outcome the caller reconciles by a new read.\n */\nexport async function installIntegration(instanceId: string, directory: string, integrationId: string, scope: PluginControlScope,\n signal?: AbortSignal): Promise<PluginSourceMutationResponse> {\n const path = `/api/workspaces/${encodeURIComponent(instanceId)}/integrations/${encodeURIComponent(integrationId)}/install?${new URLSearchParams({ directory })}`\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, {\n signal, credentials: \"include\", cache: \"no-store\", method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" }, body: JSON.stringify({ scope }),\n })\n if (!response.ok) {\n const error = await response.json().catch(() => ({}))\n throw new HttpResponseError(\"Integration install failed\", response.status, null, typeof error?.code === \"string\" ? error.code : undefined)\n }\n const value = await response.json()\n if (!value || typeof value !== \"object\" || Object.keys(value).length !== 3 || value.scope !== scope\n || typeof value.spec !== \"string\" || !value.spec || value.reloadPending !== true) throw new Error(\"Invalid integration install response\")\n return { scope, spec: value.spec, reloadPending: true }\n}\n\n/** Fixed CodeNomad routes only; the server owns RPC identity and placement checks. Never replay mutations. */\nexport async function integrationAttachmentRequest<T extends IntegrationHostsResponse | IntegrationAttachResponse | IntegrationDetachResponse | IntegrationInstallHostResponse>(\n instanceId: string, directory: string, integrationId: string, action: \"hosts\" | \"attach\" | \"detach\" | \"install-host\",\n signal: AbortSignal, body?: { sessionID: string; offerID?: string } | Record<string, never>,\n): Promise<T> {\n const path = `/api/workspaces/${encodeURIComponent(instanceId)}/integrations/${encodeURIComponent(integrationId)}/${action}?${new URLSearchParams({ directory })}`\n const response = await authenticatedFetch(API_BASE ? new URL(path, API_BASE).toString() : path, {\n signal, credentials: \"include\", cache: \"no-store\", method: action === \"hosts\" ? \"GET\" : \"POST\",\n ...(body ? { headers: { \"Content-Type\": \"application/json\" }, body: JSON.stringify(body) } : {}),\n })\n if (!response.ok) {\n const error = await response.json().catch(() => ({}))\n throw new HttpResponseError(\"Integration action failed\", response.status, null, typeof error.code === \"string\" ? error.code : undefined)\n }\n return await response.json() as T\n}\n","import { createSignal, untrack } from \"solid-js\"\nimport type { IntegrationsResponse } from \"../../../server/src/integration-types\"\n\n/** Native events after which shown integrations are read again: integration RPC events, plugin and configuration changes. */\nconst INTEGRATION_EVENT = /^rpc\\.neuralnomads\\.[a-z][a-z0-9-]{0,31}\\.(?:status_changed|hosts_changed)$/\nconst REFRESH_EVENTS = new Set([\"plugin.updated\", \"config.updated\"])\n/** Events of one instance closer than this produce one read. */\nexport const INTEGRATION_EVENT_COALESCE_MS = 300\n\nexport function isIntegrationRefreshEvent(type: string): boolean {\n return INTEGRATION_EVENT.test(type) || REFRESH_EVENTS.has(type)\n}\n\n/** A Location's integrations as last read: `loading` until the first answer; a failed read keeps the last one shown. */\nexport type IntegrationsSnapshot = { status: \"loading\" } | { status: \"error\" } | { status: \"ready\"; response: IntegrationsResponse; stale?: boolean; refreshError?: boolean }\n\nconst LOADING: IntegrationsSnapshot = { status: \"loading\" }\n\ninterface Entry {\n instanceId: string\n directory: string\n demand: number\n generation: number\n reading?: { dirty: boolean; controller: AbortController; promise: Promise<void> }\n}\n\n/**\n * Integrations of the Locations a surface shows, keyed by instance and directory. Demand reads; integration RPC\n * events (`rpc.neuralnomads.<app>.status_changed` / `hosts_changed`), `plugin.updated` and `config.updated` of an\n * instance are coalesced over 300 ms into one read per demanded Location, with at most one trailing follow-up while a\n * read runs. Releasing the last demand aborts its read. Nothing reads on a timer: without events or demand, no\n * request (hence no integration RPC) is sent.\n */\nexport function createIntegrationsStore(\n read: (instanceId: string, directory: string, signal: AbortSignal) => Promise<IntegrationsResponse>,\n clock: { setTimer?: (callback: () => void, ms: number) => unknown; clearTimer?: (timer: unknown) => void } = {},\n) {\n const setTimer = clock.setTimer ?? ((callback, ms) => setTimeout(callback, ms))\n const clearTimer = clock.clearTimer ?? (timer => clearTimeout(timer as ReturnType<typeof setTimeout>))\n const [snapshots, setSnapshots] = createSignal<ReadonlyMap<string, IntegrationsSnapshot>>(new Map())\n const entries = new Map<string, Entry>()\n const timers = new Map<string, unknown>()\n const key = (instanceId: string, directory: string) => `${instanceId}\\0${directory}`\n const publish = (stateKey: string, snapshot: IntegrationsSnapshot) => setSnapshots(current => new Map(current).set(stateKey, snapshot))\n\n const refreshEntry = (stateKey: string, entry: Entry): Promise<void> => {\n if (entry.demand === 0) return Promise.resolve()\n if (entry.reading) {\n entry.reading.dirty = true\n return entry.reading.promise\n }\n const reading = { dirty: false, controller: new AbortController(), promise: Promise.resolve() }\n entry.reading = reading\n reading.promise = (async () => {\n try {\n do {\n reading.dirty = false\n const generation = entry.generation\n const answer = await read(entry.instanceId, entry.directory, reading.controller.signal).then(\n (response): IntegrationsSnapshot => ({ status: \"ready\", response }), (): IntegrationsSnapshot => ({ status: \"error\" }))\n if (reading.controller.signal.aborted || entries.get(stateKey) !== entry) return\n if (generation !== entry.generation) continue\n const previous = snapshots().get(stateKey)\n publish(stateKey, answer.status === \"error\" && previous?.status === \"ready\" ? { ...previous, stale: true, refreshError: true } : answer)\n } while (reading.dirty && entry.demand > 0 && entries.get(stateKey) === entry)\n } finally {\n if (entry.reading === reading) entry.reading = undefined\n }\n })()\n return reading.promise\n }\n\n const refreshDemanded = (instanceId?: string): Promise<void> => Promise.all([...entries].map(([stateKey, entry]) =>\n instanceId === undefined || entry.instanceId === instanceId ? refreshEntry(stateKey, entry) : undefined)).then(() => undefined)\n\n const invalidate = (instanceId?: string): void => {\n for (const [stateKey, entry] of entries) {\n if (instanceId !== undefined && entry.instanceId !== instanceId) continue\n entry.generation++\n const previous = snapshots().get(stateKey)\n if (previous?.status === \"ready\") publish(stateKey, { ...previous, stale: true })\n }\n }\n\n return {\n state(instanceId: string, directory: string): IntegrationsSnapshot {\n return snapshots().get(key(instanceId, directory)) ?? LOADING\n },\n /** Reads now and follows the Location's events until the returned release. */\n demand(instanceId: string, directory: string): () => void {\n const stateKey = key(instanceId, directory)\n let entry = entries.get(stateKey)\n if (!entry) entries.set(stateKey, entry = { instanceId, directory, demand: 0, generation: 0 })\n const tracked = entry\n tracked.demand += 1\n if (tracked.demand === 1) {\n const previous = untrack(() => snapshots().get(stateKey))\n if (previous?.status === \"ready\") publish(stateKey, { ...previous, stale: true })\n void refreshEntry(stateKey, tracked)\n }\n let released = false\n return () => {\n if (released) return\n released = true\n tracked.demand -= 1\n if (tracked.demand > 0) return\n tracked.reading?.controller.abort()\n tracked.reading = undefined\n if (entries.get(stateKey) === tracked) entries.delete(stateKey)\n }\n },\n refreshDemanded,\n invalidate,\n /** A native event of `instanceId`: schedules one coalesced read of its demanded Locations when it may change them. */\n applyEvent(instanceId: string, type: string): void {\n if (!isIntegrationRefreshEvent(type)) return\n invalidate(instanceId)\n if (timers.has(instanceId)) return\n if (![...entries.values()].some(entry => entry.instanceId === instanceId)) return\n timers.set(instanceId, setTimer(() => {\n timers.delete(instanceId)\n void refreshDemanded(instanceId)\n }, INTEGRATION_EVENT_COALESCE_MS))\n },\n clearInstance(instanceId: string): void {\n const timer = timers.get(instanceId)\n if (timer !== undefined) clearTimer(timer)\n timers.delete(instanceId)\n for (const [stateKey, entry] of [...entries]) {\n if (entry.instanceId !== instanceId) continue\n entry.reading?.controller.abort()\n entries.delete(stateKey)\n }\n setSnapshots(current => new Map([...current].filter(([stateKey]) => !stateKey.startsWith(`${instanceId}\\0`))))\n },\n }\n}\n\nexport type IntegrationsStore = ReturnType<typeof createIntegrationsStore>\n","import { createSignal } from \"solid-js\"\nimport type { IntegrationBindingResponse } from \"../../../server/src/integration-types\"\nimport { INTEGRATION_EVENT_COALESCE_MS, isIntegrationRefreshEvent } from \"./integrations-store\"\n\nexport interface IntegrationBindingTarget { instanceId: string; directory: string; sessionID: string; integrationId: string }\nconst UNKNOWN: IntegrationBindingResponse = { state: \"unknown\" }\nconst key = (target: IntegrationBindingTarget) => JSON.stringify([target.instanceId, target.directory, target.sessionID, target.integrationId])\ninterface Entry {\n target: IntegrationBindingTarget\n demand: number\n generation: number\n timer?: unknown\n reading?: { controller: AbortController; promise: Promise<void>; dirty: boolean }\n}\n\n/** Live authority exists only while the exact conversation/Location is demanded. Invalidations revoke it immediately. */\nexport function createIntegrationBindingsStore(\n read: (target: IntegrationBindingTarget, signal: AbortSignal) => Promise<IntegrationBindingResponse>,\n clock: { setTimer?: (callback: () => void, ms: number) => unknown; clearTimer?: (timer: unknown) => void } = {},\n) {\n const setTimer = clock.setTimer ?? ((callback, ms) => setTimeout(callback, ms))\n const clearTimer = clock.clearTimer ?? (timer => clearTimeout(timer as ReturnType<typeof setTimeout>))\n const entries = new Map<string, Entry>()\n const disconnected = new Set<string>()\n let transportConnected = true\n const connected = (entry: Entry) => transportConnected && !disconnected.has(entry.target.instanceId)\n const [snapshots, setSnapshots] = createSignal<ReadonlyMap<string, IntegrationBindingResponse>>(new Map())\n const [busy, setBusy] = createSignal<ReadonlySet<string>>(new Set())\n const publish = (id: string, value: IntegrationBindingResponse) => setSnapshots(current => new Map(current).set(id, value))\n const invalidate = (id: string, entry: Entry) => { entry.generation++; publish(id, UNKNOWN) }\n const refresh = (id: string, entry: Entry): Promise<void> => {\n if (!connected(entry)) return Promise.resolve()\n if (entry.reading) { entry.reading.dirty = true; return entry.reading.promise }\n const reading = { controller: new AbortController(), dirty: false, promise: Promise.resolve() }\n entry.reading = reading\n reading.promise = (async () => {\n try {\n do {\n reading.dirty = false\n const generation = entry.generation\n const answer = await read(entry.target, reading.controller.signal).catch(() => UNKNOWN)\n if (reading.controller.signal.aborted || entries.get(id) !== entry) return\n if (generation === entry.generation) publish(id, answer)\n } while (reading.dirty && entries.get(id) === entry)\n } finally { if (entry.reading === reading) entry.reading = undefined }\n })()\n return reading.promise\n }\n const cancelTimer = (entry: Entry) => {\n if (entry.timer !== undefined) clearTimer(entry.timer)\n entry.timer = undefined\n }\n const reconcile = (id: string, entry: Entry, immediate: boolean) => {\n invalidate(id, entry)\n if (!connected(entry)) return\n if (immediate) { cancelTimer(entry); return refresh(id, entry) }\n if (entry.timer !== undefined) return\n entry.timer = setTimer(() => { entry.timer = undefined; void refresh(id, entry) }, INTEGRATION_EVENT_COALESCE_MS)\n }\n return {\n state(target: IntegrationBindingTarget): IntegrationBindingResponse { return snapshots().get(key(target)) ?? UNKNOWN },\n busy(target: IntegrationBindingTarget): boolean { return busy().has(key(target)) },\n demand(target: IntegrationBindingTarget): () => void {\n const id = key(target)\n let entry = entries.get(id)\n if (!entry) {\n entries.set(id, entry = { target: { ...target }, demand: 0, generation: 0 })\n void refresh(id, entry)\n }\n const tracked = entry\n tracked.demand++\n let released = false\n return () => {\n if (released) return\n released = true\n if (--tracked.demand > 0 || entries.get(id) !== tracked) return\n cancelTimer(tracked); tracked.reading?.controller.abort(); entries.delete(id)\n setSnapshots(current => { const next = new Map(current); next.delete(id); return next })\n }\n },\n /** An explicit new authoritative read of one demanded target; its previous answer is revoked first. */\n refresh(target: IntegrationBindingTarget): Promise<void> {\n const id = key(target)\n const entry = entries.get(id)\n return entry ? reconcile(id, entry, true) ?? Promise.resolve() : Promise.resolve()\n },\n /** Explicit view refresh: only live demands of this exact conversation and Location. */\n refreshDemanded(target: Omit<IntegrationBindingTarget, \"integrationId\">): Promise<void> {\n return Promise.all([...entries].map(([id, entry]) => entry.target.instanceId === target.instanceId\n && entry.target.directory === target.directory && entry.target.sessionID === target.sessionID\n ? reconcile(id, entry, true) : undefined)).then(() => undefined)\n },\n /** Payload-free integration events and exact-session changes are invalidation hints only. */\n applyEvent(instanceId: string, type: string, sessionID?: string): void {\n const integrationEvent = isIntegrationRefreshEvent(type)\n if (!integrationEvent && ![\"session.updated\", \"session.moved\", \"session.deleted\"].includes(type)) return\n for (const [id, entry] of entries) {\n if (entry.target.instanceId !== instanceId || (!integrationEvent && entry.target.sessionID !== sessionID)) continue\n reconcile(id, entry, false)\n }\n },\n reconnect(instanceId?: string, isConnected = true): void {\n if (instanceId === undefined) transportConnected = isConnected\n else if (isConnected) disconnected.delete(instanceId)\n else disconnected.add(instanceId)\n for (const [id, entry] of entries) {\n if (instanceId !== undefined && entry.target.instanceId !== instanceId) continue\n if (connected(entry)) void reconcile(id, entry, true)\n else {\n cancelTimer(entry); invalidate(id, entry)\n entry.reading?.controller.abort()\n entry.reading = undefined\n }\n }\n },\n clearInstance(instanceId: string): void {\n disconnected.delete(instanceId)\n for (const [id, entry] of entries) {\n if (entry.target.instanceId !== instanceId) continue\n cancelTimer(entry); entry.reading?.controller.abort(); entries.delete(id)\n setSnapshots(current => { const next = new Map(current); next.delete(id); return next })\n }\n },\n /** An admitted mutation runs once; uncertain outcomes also reconcile its captured target, if still shown. */\n async run(target: IntegrationBindingTarget, mutation: () => Promise<void>): Promise<void> {\n const id = key(target)\n if (busy().has(id)) return\n setBusy(current => new Set(current).add(id))\n const entry = entries.get(id)\n if (entry) invalidate(id, entry)\n try { await mutation() }\n finally {\n setBusy(current => { const next = new Set(current); next.delete(id); return next })\n const current = entries.get(id)\n if (current) void reconcile(id, current, true)\n }\n },\n }\n}\n","import { createSignal } from \"solid-js\"\nimport { fetchIntegrationBinding, fetchIntegrations } from \"../lib/integrations-api\"\nimport { createIntegrationBindingsStore } from \"./integration-bindings-store\"\nimport { createEventRefreshScheduler } from \"../lib/event-refresh-scheduler\"\nimport { serverEvents } from \"../lib/server-events\"\nimport { createIntegrationsStore, isIntegrationRefreshEvent } from \"./integrations-store\"\n\nexport const integrations = createIntegrationsStore(fetchIntegrations)\nexport const integrationBindings = createIntegrationBindingsStore(fetchIntegrationBinding)\n// Invalidates live offer snapshots, including across reconnects. Action receipts have their own view ownership.\nconst [epochs, setEpochs] = createSignal<ReadonlyMap<string, number>>(new Map())\nconst [sessionEpochs, setSessionEpochs] = createSignal<ReadonlyMap<string, number>>(new Map())\nconst [connectionEpoch, setConnectionEpoch] = createSignal(0)\nexport const integrationEpoch = (instanceId: string, sessionId?: string) =>\n `${connectionEpoch()}:${epochs().get(instanceId) ?? 0}:${sessionEpochs().get(`${instanceId}\\0${sessionId ?? \"\"}`) ?? 0}`\nconst invalidate = (instanceId: string) => setEpochs(current => new Map(current).set(instanceId, (current.get(instanceId) ?? 0) + 1))\nconst reconnects = createEventRefreshScheduler(instanceId => integrations.refreshDemanded(instanceId))\nserverEvents.on(\"instance.event\", event => {\n if (event.type !== \"instance.event\") return\n const type = event.event.type\n const sessionID = (event.event as { data?: { sessionID?: unknown } }).data?.sessionID\n integrationBindings.applyEvent(event.instanceId, type, typeof sessionID === \"string\" ? sessionID : undefined)\n if (isIntegrationRefreshEvent(type)) {\n invalidate(event.instanceId)\n integrations.applyEvent(event.instanceId, type)\n } else if (type === \"server.connected\") {\n integrationBindings.reconnect(event.instanceId)\n invalidate(event.instanceId)\n integrations.invalidate(event.instanceId)\n reconnects.schedule(event.instanceId, \"urgent\")\n } else if ([\"session.updated\", \"session.deleted\", \"session.moved\"].includes(type)) {\n const sessionID = (event.event as { data?: { sessionID?: unknown } }).data?.sessionID\n if (typeof sessionID !== \"string\") return\n const key = `${event.instanceId}\\0${sessionID}`\n setSessionEpochs(current => new Map(current).set(key, (current.get(key) ?? 0) + 1))\n }\n})\nserverEvents.on(\"instance.eventStatus\", event => {\n if (event.type !== \"instance.eventStatus\") return\n integrationBindings.reconnect(event.instanceId, event.status === \"connected\")\n invalidate(event.instanceId)\n integrations.invalidate(event.instanceId)\n if (event.status === \"connected\") reconnects.schedule(event.instanceId, \"urgent\")\n})\nserverEvents.onOpen(() => {\n integrationBindings.reconnect()\n setConnectionEpoch(value => value + 1)\n integrations.invalidate()\n void integrations.refreshDemanded()\n})\nserverEvents.onTransportStatus(status => {\n if (status !== \"disconnected\") return\n setConnectionEpoch(value => value + 1)\n integrations.invalidate()\n integrationBindings.reconnect(undefined, false)\n})\nserverEvents.on(\"workspace.stopped\", event => {\n if (event.type !== \"workspace.stopped\") return\n integrationBindings.clearInstance(event.workspaceId)\n invalidate(event.workspaceId)\n reconnects.cancel(event.workspaceId)\n integrations.clearInstance(event.workspaceId)\n})\n","import { createSignal } from \"solid-js\"\nimport type {\n PluginActivationMutationRequest,\n PluginActivationMutationResponse,\n PluginControlLocation,\n PluginControlScope,\n PluginControlsSnapshot,\n} from \"../../../server/src/api-types\"\nimport { serverApi } from \"../lib/api-client\"\n\nexport interface PluginControlsState {\n invalidationRevision?: number\n runtimeUnconfirmed?: ReadonlySet<string>\n snapshot?: PluginControlsSnapshot\n loading: boolean\n refreshing: boolean\n stale: boolean\n error?: unknown\n}\n\ninterface CacheRecord {\n readonly keys: Set<string>\n readonly demands: Set<{ record: CacheRecord }>\n readonly instanceId: string\n location: PluginControlLocation\n canonicalLocation: boolean\n generation: number\n invalidationRevision: number\n snapshotRevision: number\n snapshot?: PluginControlsSnapshot\n runtimeUnconfirmed: Set<string>\n loading: boolean\n refreshing: boolean\n stale: boolean\n error?: unknown\n inFlight?: Promise<void>\n inFlightController?: AbortController\n trailing: boolean\n mutationTail: Promise<void>\n}\n\ninterface PluginControlsApi {\n getPluginControls(instanceId: string, location: PluginControlLocation, signal?: AbortSignal): Promise<PluginControlsSnapshot>\n setPluginActivation(instanceId: string, payload: PluginActivationMutationRequest): Promise<PluginActivationMutationResponse>\n}\n\nconst EMPTY_STATE: PluginControlsState = { loading: false, refreshing: false, stale: false }\n\nexport class PluginControlsCache {\n private readonly records = new Map<string, CacheRecord>()\n private readonly pendingUnknownInvalidations = new Map<string, number>()\n private revision = 0\n private readonly stateSignal = createSignal<Map<string, PluginControlsState>>(new Map())\n readonly states = this.stateSignal[0]\n private readonly setStates = this.stateSignal[1]\n\n constructor(private readonly api: PluginControlsApi) {}\n\n state(instanceId: string, location: PluginControlLocation): PluginControlsState {\n return this.states().get(cacheKey(instanceId, location)) ?? EMPTY_STATE\n }\n\n /** Own visible refresh demand until deactivation/disposal; aliases share owners. */\n acquireDemand(instanceId: string, location: PluginControlLocation): () => void {\n const record = this.record(instanceId, location)\n const demand = { record }\n record.demands.add(demand)\n void this.load(instanceId, location, { force: Boolean(record.error) })\n return () => {\n // Canonical adoption can transfer the handle to a different record.\n const current = demand.record\n if (!current.demands.delete(demand) || current.demands.size > 0) return\n if (current.trailing) {\n current.trailing = false\n current.stale = true\n this.publish(current)\n }\n }\n }\n\n load(instanceId: string, location: PluginControlLocation, options?: { force?: boolean }): Promise<void> {\n const record = this.record(instanceId, location)\n if (record.snapshot && !record.stale && !options?.force) return Promise.resolve()\n return this.loadRecord(record, Boolean(options?.force || record.stale))\n }\n\n async mutate(\n instanceId: string,\n location: PluginControlLocation,\n pluginId: string,\n scope: PluginControlScope,\n enabled: boolean,\n ): Promise<PluginActivationMutationResponse> {\n const record = this.record(instanceId, location)\n const mutate = async () => {\n if (!this.isActive(record)) {\n throw new Error(\"Plugin control location is no longer active\")\n }\n const requestRevision = ++this.revision\n const response = await this.api.setPluginActivation(instanceId, {\n location: record.location,\n pluginId,\n scope,\n enabled,\n })\n if (!this.isActive(record) || !this.adoptCanonicalLocation(record, response.snapshot.location, true)) return response\n // Fence any passive read that started before the mutation became durable.\n record.generation += 1\n // A mutation overlays a durable rule onto inventory read BEFORE the write.\n // Events and completed reads during that write still require reconciliation;\n // in particular, do not roll newer runtime failures back to that inventory.\n const newerSnapshot = record.snapshot && record.snapshotRevision > requestRevision\n ? record.snapshot\n : undefined\n record.snapshot = newerSnapshot ? retainRuntime(response.snapshot, newerSnapshot) : response.snapshot\n // The write response carries pre-write inventory. Only a later read can\n // confirm a managed plugin's runtime state, even if that inventory is active.\n if (enabled && response.reloadPending && record.snapshot.controls.some(control => control.id === pluginId && control.managedBy === \"codenomad\")) {\n record.runtimeUnconfirmed.add(pluginId)\n } else if (!enabled) record.runtimeUnconfirmed.delete(pluginId)\n // Alias reads dispatched during the write must also see this publication\n // as newer, even when the mutation's dispatch revision predates them.\n record.snapshotRevision = ++this.revision\n record.error = undefined\n record.loading = false\n record.refreshing = false\n record.stale = record.stale || record.invalidationRevision > requestRevision || Boolean(newerSnapshot)\n if (record.inFlight) record.trailing = true\n this.publish(record)\n if (scope === \"global\") this.invalidateSiblingLocations(record)\n return response\n }\n const result = record.mutationTail.then(mutate, mutate)\n // Keep writes for one location ordered even when an earlier write fails.\n // The caller presents mutation failures; passive read errors remain separate.\n record.mutationTail = result.then(() => undefined, () => undefined)\n return result\n }\n\n invalidateInstance(instanceId: string): void {\n this.invalidate(instanceId)\n }\n\n invalidateAll(): void {\n this.invalidateRecords([...new Set(this.records.values())])\n }\n\n invalidateLocation(instanceId: string, location: PluginControlLocation): void {\n this.invalidate(instanceId, location)\n }\n\n private invalidate(instanceId: string, location?: PluginControlLocation): void {\n if (!location) {\n const records = [...new Set(this.records.values())].filter((record) => record.instanceId === instanceId)\n this.invalidateRecords(records)\n return\n }\n const key = cacheKey(instanceId, location)\n const target = this.records.get(key)\n if (!target) {\n // Unknown directories match nothing immediately. Remember the canonical\n // key so a WSL alias learned later can still fence its first snapshot.\n this.pendingUnknownInvalidations.set(key, ++this.revision)\n while (this.pendingUnknownInvalidations.size > 200) {\n const oldest = this.pendingUnknownInvalidations.keys().next().value\n if (oldest === undefined) break\n this.pendingUnknownInvalidations.delete(oldest)\n }\n return\n }\n this.invalidateRecords([target])\n }\n\n private invalidateSiblingLocations(current: CacheRecord): void {\n const siblings = [...new Set(this.records.values())]\n .filter((record) => record !== current && record.instanceId === current.instanceId)\n this.invalidateRecords(siblings)\n }\n\n private invalidateRecords(records: readonly CacheRecord[]): void {\n for (const record of records) {\n record.generation += 1\n record.invalidationRevision = ++this.revision\n record.stale = true\n }\n this.publishAll(records)\n }\n\n clearInstance(instanceId: string): void {\n let changed = false\n for (const record of new Set(this.records.values())) {\n if (record.instanceId !== instanceId) continue\n record.generation += 1\n record.inFlightController?.abort()\n record.inFlightController = undefined\n record.demands.clear()\n for (const key of record.keys) {\n if (this.records.get(key) === record) this.records.delete(key)\n }\n changed = true\n }\n for (const key of this.pendingUnknownInvalidations.keys()) {\n if (key.startsWith(`${JSON.stringify(instanceId)}:`)) this.pendingUnknownInvalidations.delete(key)\n }\n if (!changed) return\n this.setStates((previous) => {\n const next = new Map(previous)\n for (const key of next.keys()) {\n if (key.startsWith(`${JSON.stringify(instanceId)}:`)) next.delete(key)\n }\n return next\n })\n }\n\n private record(instanceId: string, location: PluginControlLocation): CacheRecord {\n const key = cacheKey(instanceId, location)\n const existing = this.records.get(key)\n if (existing) {\n if (!existing.canonicalLocation) existing.location = { ...location }\n return existing\n }\n const record: CacheRecord = {\n keys: new Set([key]),\n demands: new Set(),\n instanceId,\n location: { ...location },\n canonicalLocation: false,\n generation: 0,\n invalidationRevision: 0,\n snapshotRevision: 0,\n runtimeUnconfirmed: new Set(),\n loading: false,\n refreshing: false,\n stale: false,\n trailing: false,\n mutationTail: Promise.resolve(),\n }\n this.records.set(key, record)\n return record\n }\n\n private loadRecord(record: CacheRecord, force: boolean): Promise<void> {\n if (record.inFlight) {\n if (force) record.trailing = true\n return record.inFlight\n }\n const generation = record.generation\n const requestRevision = ++this.revision\n record.stale = false\n record.loading = !record.snapshot\n record.refreshing = Boolean(record.snapshot)\n record.error = undefined\n this.publish(record)\n const controller = new AbortController()\n record.inFlightController = controller\n const promise = this.api.getPluginControls(record.instanceId, record.location, controller.signal)\n .then((snapshot) => {\n if (!this.isActive(record) || generation !== record.generation) return\n if (!this.adoptCanonicalLocation(record, snapshot.location, false, { snapshot, revision: requestRevision })) return\n record.snapshot = snapshot\n confirmRuntime(record)\n record.snapshotRevision = ++this.revision\n record.error = undefined\n })\n .catch((error) => {\n if (!this.isActive(record) || generation !== record.generation) return\n // An aborted orphan fetch must not surface as a passive read error.\n if (controller.signal.aborted) return\n record.error = error\n })\n .finally(() => {\n if (!this.isActive(record) || record.inFlight !== promise) return\n record.inFlight = undefined\n if (record.inFlightController === controller) record.inFlightController = undefined\n record.loading = false\n record.refreshing = false\n const trailing = record.trailing\n record.trailing = false\n if (trailing) {\n // No follow-up may outlive its last visible owner. Keep the demand\n // as stale display state so reopening performs one reconciliation.\n record.stale = true\n }\n this.publish(record)\n })\n record.inFlight = promise\n return promise\n }\n\n private publish(record: CacheRecord): void {\n this.publishAll([record])\n }\n\n private publishAll(records: readonly CacheRecord[]): void {\n const active = records.filter((record) => this.isActive(record))\n if (active.length === 0) return\n const states = new Map<CacheRecord, PluginControlsState>()\n for (const record of active) {\n states.set(record, {\n invalidationRevision: record.invalidationRevision,\n runtimeUnconfirmed: new Set(record.runtimeUnconfirmed),\n snapshot: record.snapshot,\n loading: record.loading,\n refreshing: record.refreshing,\n stale: record.stale,\n error: record.error,\n })\n }\n this.setStates((previous) => {\n const next = new Map(previous)\n for (const [record, state] of states) {\n for (const key of record.keys) {\n if (this.records.get(key) === record) next.set(key, state)\n }\n }\n return next\n })\n for (const record of active) {\n if (record.demands.size > 0 && record.stale) void this.loadRecord(record, true)\n }\n }\n\n private isActive(record: CacheRecord): boolean {\n return [...record.keys].some((key) => this.records.get(key) === record)\n }\n\n private adoptCanonicalLocation(\n record: CacheRecord,\n location: PluginControlLocation,\n preferIncoming = false,\n incomingRead?: { snapshot: PluginControlsSnapshot; revision: number },\n ): boolean {\n const canonicalKey = cacheKey(record.instanceId, location)\n const existing = this.records.get(canonicalKey)\n let invalidatedAlias = false\n if (existing && existing !== record) {\n if (preferIncoming || !existing.snapshot) {\n if (preferIncoming) {\n // A mutation can be the first response to reveal a host/canonical\n // alias. Carry the canonical record's newer runtime and event demand\n // across the merge before publishing that mutation's durable rule.\n record.invalidationRevision = Math.max(record.invalidationRevision, existing.invalidationRevision)\n record.stale ||= existing.stale || Boolean(existing.inFlight) || existing.trailing\n if (existing.snapshot && existing.snapshotRevision > record.snapshotRevision) {\n record.snapshot = existing.snapshot\n record.snapshotRevision = existing.snapshotRevision\n }\n }\n // The canonical record may have consumed an event before this alias\n // was known. Its refresh clears stale at dispatch, so retain the\n // generation as well as queued demand before orphaning that read.\n invalidatedAlias = !preferIncoming && (existing.generation > 0 || existing.stale || existing.trailing)\n existing.generation += 1\n existing.inFlightController?.abort()\n this.mergeRecord(existing, record)\n } else {\n // Keep the canonical owner (including its mutation queue), but let a\n // genuinely newer successful alias read recover its failed refresh.\n // Completion order alone cannot authorize replacing newer publications\n // or invalidations; those require a canonical reconciliation instead.\n let adoptedRead = false\n if (existing.error) {\n if (incomingRead && !existing.inFlight\n && existing.snapshotRevision < incomingRead.revision\n && existing.invalidationRevision < incomingRead.revision) {\n existing.snapshot = incomingRead.snapshot\n existing.snapshotRevision = ++this.revision\n existing.error = undefined\n adoptedRead = true\n } else {\n existing.stale = true\n }\n }\n existing.stale ||= record.stale || record.trailing\n record.generation += 1\n record.inFlightController?.abort()\n this.mergeRecord(record, existing)\n if (adoptedRead) confirmRuntime(existing)\n this.publish(existing)\n return false\n }\n }\n this.records.set(canonicalKey, record)\n record.keys.add(canonicalKey)\n record.location = { ...location }\n record.canonicalLocation = true\n const pendingInvalidation = this.pendingUnknownInvalidations.get(canonicalKey)\n this.pendingUnknownInvalidations.delete(canonicalKey)\n if (pendingInvalidation !== undefined || invalidatedAlias) {\n if (pendingInvalidation !== undefined) {\n record.invalidationRevision = Math.max(record.invalidationRevision, pendingInvalidation)\n }\n if (preferIncoming) {\n record.stale = true\n return true\n }\n // A canonical event/demand arrived before the WSL alias was learned.\n // Discard this snapshot and retain one trailing refresh, including when\n // the canonical key already had an in-flight record of its own.\n record.generation += 1\n record.stale = true\n record.trailing = true\n this.publish(record)\n return false\n }\n return true\n }\n\n private mergeRecord(source: CacheRecord, target: CacheRecord): void {\n for (const pluginId of source.runtimeUnconfirmed) target.runtimeUnconfirmed.add(pluginId)\n for (const key of source.keys) {\n if (this.records.get(key) !== source) continue\n this.records.set(key, target)\n target.keys.add(key)\n }\n for (const demand of source.demands) {\n demand.record = target\n target.demands.add(demand)\n }\n source.demands.clear()\n }\n}\n\nfunction confirmRuntime(record: CacheRecord): void {\n for (const pluginId of record.runtimeUnconfirmed) {\n const control = record.snapshot?.controls.find(control => control.id === pluginId)\n if (control?.managedBy !== \"codenomad\" || control.runtime) record.runtimeUnconfirmed.delete(pluginId)\n }\n}\n\nfunction retainRuntime(durable: PluginControlsSnapshot, newer: PluginControlsSnapshot): PluginControlsSnapshot {\n const runtimeById = new Map(newer.runtime.flatMap((entry) => entry.id ? [[entry.id, entry] as const] : []))\n const newerControlsById = new Map(newer.controls.map(control => [control.id, control]))\n const sourceKey = (source: PluginControlsSnapshot[\"configured\"][\"sources\"][number]) => JSON.stringify([source.scope, source.path, source.entryIndex, source.target])\n const newerSources = new Map(newer.configured.sources.map(source => [sourceKey(source), source.managedBy]))\n const configuredIds = new Set(durable.configured.rules.map((rule) => rule.selector))\n const durableIds = new Set(durable.controls.map((control) => control.id))\n return {\n ...durable,\n runtime: newer.runtime,\n configured: { ...durable.configured, sources: durable.configured.sources.map(({ managedBy: _previous, ...source }) => {\n const managedBy = newerSources.get(sourceKey(source))\n return { ...source, ...(managedBy ? { managedBy } : {}) }\n }) },\n controls: [\n ...durable.controls.flatMap(({ runtime: previousRuntime, managedBy: _previous, ...control }) => {\n // Proven managed installations can attach a native failure before it exports an ID.\n const runtime = runtimeById.get(control.id) ?? newerControlsById.get(control.id)?.runtime\n const managedBy = newerControlsById.get(control.id)?.managedBy ?? runtime?.managedBy\n // A removed runtime-only plugin is no longer an inventory control;\n // exact configured IDs (including the durable rule) remain actionable.\n if (!runtime && previousRuntime && !configuredIds.has(control.id) && managedBy !== \"codenomad\") return []\n return [{ ...control, ...(managedBy ? { managedBy } : {}), ...(runtime ? { runtime } : {}) }]\n }),\n ...newer.controls.filter((control) => !durableIds.has(control.id)),\n ],\n }\n}\n\nexport const pluginControlsCache = new PluginControlsCache(serverApi)\n\nfunction cacheKey(instanceId: string, location: PluginControlLocation): string {\n return `${JSON.stringify(instanceId)}:${JSON.stringify(location.directory)}`\n}\n","import { createSignal } from \"solid-js\"\nimport type {\n PluginConfiguredSource,\n PluginControlLocation,\n PluginControlScope,\n PluginControlsSnapshot,\n} from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\nimport type { PluginSourceAddRequest, PluginSourceMutationResponse, PluginSourceRemoveRequest } from \"../../../server/src/plugin-source-types\"\nimport { serverApi } from \"../lib/api-client\"\nimport { installIntegration } from \"../lib/integrations-api\"\nimport { integrations } from \"./integrations\"\nimport { pluginControlsCache } from \"./plugin-controls\"\n\n/** How long an added source may stay absent from `plugin.list` before it is shown as not confirmed. */\nexport const PLUGIN_SOURCE_PENDING_TIMEOUT_MS = 120_000\nconst MAX_TRACKED = 100\n\n/** `pending`: added here and not yet in the inventory; `unconfirmed`: configured, but still absent\n * after the pending window (disabled, or never installed). Loaded sources use the runtime state. */\nexport type PluginSourceState = \"pending\" | \"unconfirmed\"\n\n/** `active`/`failed`: the inventory loaded the integration's plugin, or failed to; otherwise its install hint. */\nexport type IntegrationInstallState = PluginSourceState | \"active\" | \"failed\"\n\n/** One add, reserved before transmission; `spec` is known and the hint shown only once the server confirmed the write. */\ninterface Tracked { key: string; scope: PluginControlScope; startedAt: number; submitted: boolean; spec?: string; integration?: string }\ntype Submitted = Tracked & { spec: string; submitted: true }\n\ninterface Api {\n addPluginSource(instanceId: string, payload: PluginSourceAddRequest): Promise<PluginSourceMutationResponse>\n removePluginSource(instanceId: string, payload: PluginSourceRemoveRequest): Promise<PluginSourceMutationResponse>\n installIntegration(instanceId: string, directory: string, integrationId: string, scope: PluginControlScope): Promise<PluginSourceMutationResponse>\n}\n\nconst locationKey = (instanceId: string, location: PluginControlLocation) => JSON.stringify([instanceId, location.directory])\n\nexport class PluginSourcesStore {\n private readonly added = createSignal<readonly Tracked[]>([])\n private readonly removing = createSignal<ReadonlySet<string>>(new Set())\n // Bumped when a pending window closes, so derived rows change state without other events.\n private readonly tick = createSignal(0)\n\n constructor(\n private readonly api: Api,\n private readonly invalidate: (instanceId: string) => void,\n private readonly now: () => number = () => Date.now(),\n private readonly schedule: (callback: () => void, delay: number) => unknown = (callback, delay) => setTimeout(callback, delay),\n private readonly refreshIntegrations: (instanceId: string) => void = () => {},\n ) {}\n\n async add(instanceId: string, location: PluginControlLocation, scope: PluginControlScope, spec: string): Promise<void> {\n const attempt = this.begin(instanceId, location, scope)\n try {\n await this.api.addPluginSource(instanceId, { location: { directory: location.directory }, scope, spec })\n this.submitted(attempt, spec)\n } catch (error) { this.consume(attempt); throw error }\n // The response is only the durable configured state; the inventory decides what loaded.\n finally { this.invalidate(instanceId) }\n }\n\n /**\n * Installs a catalog integration by ID. The pending hint follows the spec the server returned; a lost or refused\n * answer leaves no hint and is never replayed: the refreshed inventory shows what was written.\n */\n async installIntegration(instanceId: string, location: PluginControlLocation, integrationId: string, scope: PluginControlScope): Promise<PluginSourceMutationResponse> {\n const attempt = this.begin(instanceId, location, scope, integrationId)\n try {\n const response = await this.api.installIntegration(instanceId, location.directory, integrationId, scope)\n this.submitted(attempt, response?.scope === scope && response.reloadPending === true && typeof response.spec === \"string\" ? response.spec : undefined)\n return response\n } catch (error) { this.consume(attempt); throw error }\n finally {\n this.invalidate(instanceId)\n this.refreshIntegrations(instanceId)\n }\n }\n\n /** Reserves an add before its transmission; only `submitted` makes it visible. */\n private begin(instanceId: string, location: PluginControlLocation, scope: PluginControlScope, integration?: string): Tracked {\n const entry: Tracked = { key: locationKey(instanceId, location), scope, startedAt: this.now(), submitted: false, ...(integration ? { integration } : {}) }\n this.added[1](previous => [...previous, entry].slice(-MAX_TRACKED))\n return entry\n }\n\n /** Records the confirmed spec of a reserved add; an unconfirmed answer consumes it instead. */\n private submitted(attempt: Tracked, spec: string | undefined): void {\n if (!this.added[0]().includes(attempt) || attempt.submitted) return\n if (spec === undefined) { this.consume(attempt); throw new Error(\"Plugin source addition could not be confirmed\") }\n const entry: Submitted = { ...attempt, spec, submitted: true, startedAt: this.now() }\n // A newer add of the same spec in the same scope supersedes the older hint.\n this.added[1](previous => [...previous.filter(item => item !== attempt\n && !(item.submitted && item.key === entry.key && item.spec === spec && item.scope === entry.scope)), entry].slice(-MAX_TRACKED))\n this.schedule(() => { if (this.added[0]().includes(entry)) this.tick[1](value => value + 1) }, PLUGIN_SOURCE_PENDING_TIMEOUT_MS + 1)\n }\n\n private consume(attempt: Tracked): void {\n this.added[1](previous => previous.filter(item => item !== attempt))\n }\n\n async remove(instanceId: string, location: PluginControlLocation, source: PluginConfiguredSource & { scope: PluginControlScope }): Promise<void> {\n if (!source.expectedRevision) throw new Error(\"Plugin source confirmation is unavailable\")\n const identity = removalKey(instanceId, location, source)\n if (this.removing[0]().has(identity)) return\n this.removing[1](previous => new Set(previous).add(identity))\n try {\n const response = await this.api.removePluginSource(instanceId, {\n location: { directory: location.directory }, scope: source.scope, target: source.target, entryIndex: source.entryIndex,\n expectedRevision: source.expectedRevision,\n })\n if (response?.scope !== source.scope || response.spec !== source.target || response.reloadPending !== true) throw new Error(\"Plugin source removal could not be confirmed\")\n } finally {\n // An explicit removal supersedes this view's Installing hint even when its response is\n // lost. The reconciled configured/runtime inventory determines whether a row still exists.\n const key = locationKey(instanceId, location)\n this.added[1](previous => previous.filter(item => !(item.submitted && item.key === key && item.spec === source.target && item.scope === source.scope)))\n this.removing[1](previous => { const next = new Set(previous); next.delete(identity); return next })\n this.invalidate(instanceId)\n }\n }\n\n isRemoving(instanceId: string, location: PluginControlLocation, source: PluginConfiguredSource): boolean {\n return this.removing[0]().has(removalKey(instanceId, location, source))\n }\n\n /** Specs added from this location that are still waiting for the inventory, newest last. */\n addedSpecs(instanceId: string, location: PluginControlLocation): readonly Submitted[] {\n const key = locationKey(instanceId, location)\n return this.added[0]().filter((item): item is Submitted => item.key === key && item.submitted)\n }\n\n /** State of a configured or just-added source with no runtime entry yet. */\n state(instanceId: string, location: PluginControlLocation, target: string): PluginSourceState {\n this.tick[0]()\n const tracked = this.addedSpecs(instanceId, location).find(item => item.spec === target)\n return tracked && this.now() - tracked.startedAt <= PLUGIN_SOURCE_PENDING_TIMEOUT_MS ? \"pending\" : \"unconfirmed\"\n }\n\n /**\n * Installation progress of a catalog integration from the integrations read: the inventory's loading facts\n * decide `active`/`failed`; otherwise an install sent from this location stays `pending` for the window, then\n * `unconfirmed`. `undefined` when it is neither declared, loaded nor being installed here.\n */\n installation(instanceId: string, location: PluginControlLocation, integration: Pick<IntegrationView, \"id\" | \"plugin\">): IntegrationInstallState | undefined {\n if (integration.plugin.runtime === \"loaded\") return \"active\"\n if (integration.plugin.runtime === \"failed\") return \"failed\"\n const installs = this.addedSpecs(instanceId, location).filter(item => item.integration === integration.id)\n const tracked = installs[installs.length - 1]\n if (tracked) return this.state(instanceId, location, tracked.spec)\n return integration.plugin.declared ? \"unconfirmed\" : undefined\n }\n\n clearInstance(instanceId: string): void {\n const prefix = JSON.stringify([instanceId]).slice(0, -1)\n this.added[1](previous => previous.filter(item => !item.key.startsWith(`${prefix},`)))\n }\n}\n\nfunction removalKey(instanceId: string, location: PluginControlLocation, source: PluginConfiguredSource): string {\n return JSON.stringify([instanceId, location.directory, source.scope, source.target, source.entryIndex])\n}\n\n/** Declarations the shared document primitive can remove: those in the scope's own write target. */\nexport function removableSources(snapshot: PluginControlsSnapshot | undefined, matches: (source: PluginConfiguredSource) => boolean) {\n if (!snapshot) return []\n return snapshot.configured.sources.filter((source): source is PluginConfiguredSource & { scope: PluginControlScope } => (\n (source.scope === \"global\" || source.scope === \"project\") && matches(source)\n && snapshot.targets.some(target => target.scope === source.scope && Boolean(source.path) && samePath(target.path, source.path!))\n )).map(source => ({ ...source, expectedRevision: snapshot.targets.find(target => target.scope === source.scope)?.expectedRevision }))\n}\n\nfunction samePath(left: string, right: string): boolean {\n const windows = /^[a-z]:[\\\\/]|^\\\\\\\\/i.test(left)\n const normalize = (value: string) => (windows ? value.replace(/\\\\/g, \"/\").toLowerCase() : value).replace(/\\/+$/, \"\")\n return normalize(left) === normalize(right)\n}\n\nexport const pluginSourcesStore = new PluginSourcesStore({\n addPluginSource: (instanceId, payload) => serverApi.addPluginSource(instanceId, payload),\n removePluginSource: (instanceId, payload) => serverApi.removePluginSource(instanceId, payload),\n installIntegration: (instanceId, directory, integrationId, scope) => installIntegration(instanceId, directory, integrationId, scope),\n}, instanceId => pluginControlsCache.invalidateInstance(instanceId), undefined, undefined,\ninstanceId => { void integrations.refreshDemanded(instanceId) })\n","import { showConfirmDialog, type AlertDialogState } from \"../stores/alerts\"\n\n/** Install, host install and remove confirmations enable their action this long after they are shown. */\nexport const INTEGRATION_CONFIRM_DELAY_MS = 600\n\nlet claimed = false\n\n/**\n * Reserves the single open integration or plugin-source confirmation. `undefined` while another one is open: the\n * new request shows nothing and sends nothing. The release is idempotent.\n */\nfunction claimIntegrationConfirmation(): (() => void) | undefined {\n if (claimed) return undefined\n claimed = true\n let released = false\n return () => {\n if (released) return\n released = true\n claimed = false\n }\n}\n\n/**\n * The shared guarded confirmation: Cancel first and focused, the action enabled after\n * `INTEGRATION_CONFIRM_DELAY_MS`, one at a time. Cancel, Escape, closing, expiry or `signal` resolve false.\n */\nexport async function confirmIntegrationAction(message: string, options: Omit<AlertDialogState, \"message\" | \"type\" | \"confirmDelayMs\">,\n signal?: AbortSignal): Promise<boolean> {\n const release = claimIntegrationConfirmation()\n if (!release) return false\n try {\n return await showConfirmDialog(message, { ...options, confirmDelayMs: INTEGRATION_CONFIRM_DELAY_MS }, signal)\n } finally {\n release()\n }\n}\n","import { createEffect, createMemo, createSignal, onCleanup } from \"solid-js\"\nimport type { IntegrationInstallHostResponse, IntegrationView } from \"../../../server/src/integration-types\"\nimport { integrationAttachmentRequest } from \"../lib/integrations-api\"\nimport { useI18n } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { integrationEpoch, integrations } from \"../stores/integrations\"\nimport { confirmIntegrationAction } from \"./integration-confirmation\"\n\n/** Location-scoped explicit consent; the session is only a navigation fence, never installer input. */\nexport function createIntegrationHostInstallation(props: {\n instanceId: string; directory: string; sessionId?: string; active?: boolean; entries: () => IntegrationView[]\n}) {\n const { t } = useI18n()\n const [pending, setPending] = createSignal(false)\n const identity = createMemo(() => JSON.stringify([props.instanceId, props.directory, props.sessionId, props.active !== false]))\n const epoch = createMemo(() => integrationEpoch(props.instanceId, props.sessionId))\n const eligible = (id: string) => props.active !== false ? props.entries().find(entry => entry.id === id\n && entry.family === \"native\" && entry.state === \"ok\" && entry.status?.host?.state !== \"unsupported\"\n && entry.status?.host?.state !== \"unknown\" && entry.status?.host?.action && entry.status.version) : undefined\n const signature = (id: string) => JSON.stringify(eligible(id))\n let confirmation: AbortController | undefined\n let disposed = false\n let focusGeneration = 0\n let target: { id: string; identity: string; epoch: string; signature: string } | undefined\n const cancel = () => { confirmation?.abort(); confirmation = undefined; target = undefined }\n createEffect(() => {\n const owner = identity(), generation = epoch(), entries = props.entries()\n if (target && (target.identity !== owner || target.epoch !== generation || target.signature !== signature(target.id))) { focusGeneration++; cancel() }\n void entries\n })\n onCleanup(() => { disposed = true; cancel() })\n const open = async (id: string) => {\n const entry = eligible(id)\n if (!entry || pending() || confirmation) return\n const instanceId = props.instanceId, directory = props.directory, owner = identity()\n const captured = { id, identity: owner, epoch: epoch(), signature: signature(id) }\n const opener = document.activeElement instanceof HTMLElement ? document.activeElement : undefined\n const generation = ++focusGeneration\n target = captured\n confirmation = new AbortController()\n const signal = confirmation.signal\n const action = entry.status!.host!.action!\n const accepted = await confirmIntegrationAction(t(\"integrations.installHost.warning\", { app: entry.app.name, name: entry.displayName, version: entry.status!.version }), {\n title: t(`integrations.installHost.${action}`),\n confirmLabel: t(`integrations.installHost.${action}`), variant: \"warning\",\n returnFocus: () => {\n if (!disposed && generation === focusGeneration && identity() === owner && epoch() === captured.epoch && signature(id) === captured.signature\n && opener?.isConnected && opener.checkVisibility({ checkVisibilityCSS: true, checkOpacity: true }) && !opener.closest('[inert], [aria-hidden=\"true\"]') && !opener.matches(\":disabled\")) opener.focus({ preventScroll: true })\n },\n }, signal)\n const current = accepted && !signal.aborted && target === captured && identity() === owner\n && epoch() === captured.epoch && signature(id) === captured.signature\n cancel()\n if (!current) return\n setPending(true)\n try {\n // Once admitted, cancellation/navigation cannot promise rollback. Never replay this request.\n const result = await integrationAttachmentRequest<IntegrationInstallHostResponse>(instanceId, directory, id, \"install-host\", new AbortController().signal, {})\n if (![\"installed\", \"updated\", \"unchanged\", \"refused\", \"failed\"].includes(result?.outcome)) throw new Error(\"Invalid installation result\")\n if (!disposed && identity() === owner) showToastNotification({ category: \"opencode\", variant: [\"refused\", \"failed\"].includes(result.outcome) ? \"error\" : \"success\",\n message: t(`integrations.installHost.${result.outcome}`) })\n } catch (error) {\n if (!disposed && identity() === owner) showToastNotification({ category: \"opencode\", variant: \"error\", message: t(\n error instanceof HttpResponseError && error.code === \"unsupported\" ? \"integrations.installHost.unsupported\" : \"integrations.installHost.error\") })\n } finally { setPending(false); void integrations.refreshDemanded(instanceId) }\n }\n return { pending, action: (id: string) => !pending() ? eligible(id)?.status?.host?.action : undefined, open }\n}\n","import { createEffect, createMemo, createSignal, on, onCleanup } from \"solid-js\"\nimport type {\n IntegrationAttachResponse,\n IntegrationDetachResponse,\n IntegrationHostOffer,\n IntegrationHostsResponse,\n IntegrationView,\n} from \"../../../server/src/integration-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport {\n integrationAttachChoice,\n integrationChainAction,\n integrationConnection,\n integrationConnectionMessage,\n integrationLink,\n type IntegrationLink,\n} from \"../lib/integration-row-state\"\nimport { integrationAttachmentRequest } from \"../lib/integrations-api\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { integrationBindings, integrationEpoch } from \"../stores/integrations\"\nimport type { IntegrationBindingTarget } from \"../stores/integration-bindings-store\"\n\nconst sameTarget = (left?: IntegrationBindingTarget, right?: IntegrationBindingTarget) => left === right || (!!left && !!right\n && left.instanceId === right.instanceId && left.directory === right.directory && left.sessionID === right.sessionID && left.integrationId === right.integrationId)\nconst OUTCOMES = new Set([\"busy\", \"gone\", \"refused\"])\ninterface AttachIntent { target: IntegrationBindingTarget; epoch: string; controller: AbortController }\n\n/**\n * The displayed conversation's attachment to one integration of a Plugins row: its authoritative read, demanded\n * while the row is shown, and the user's explicit attach and detach. The integration also attaches a conversation\n * itself at its first use. Every request is sent once and the binding is read again afterwards.\n */\nexport function createIntegrationRowBinding(options: {\n instanceId: () => string\n directory: () => string\n sessionId: () => string | undefined\n integration: () => IntegrationView | undefined\n active: () => boolean\n}) {\n const { t } = useI18n()\n const target = createMemo<IntegrationBindingTarget | undefined>(() => {\n const entry = options.integration(), sessionID = options.sessionId()\n return entry && sessionID && options.directory() && entry.family === \"native\" && entry.state === \"ok\" && !entry.ambiguous\n ? { instanceId: options.instanceId(), directory: options.directory(), sessionID, integrationId: entry.id } : undefined\n }, undefined, { equals: sameTarget })\n createEffect(() => {\n const value = target()\n if (!value || !options.active()) return\n onCleanup(integrationBindings.demand(value))\n })\n const link = createMemo<IntegrationLink | undefined>(() => {\n const entry = options.integration(), value = target()\n return entry ? integrationLink(entry, value ? integrationBindings.state(value) : undefined) : undefined\n })\n const [reading, setReading] = createSignal(false)\n /** The documents offered to choose from, while that menu is open. */\n const [choices, setChoices] = createSignal<Array<IntegrationHostOffer & { attach: () => void }>>()\n const epoch = createMemo(() => integrationEpoch(options.instanceId(), options.sessionId()))\n let intent: AttachIntent | undefined\n let disposed = false\n const revoke = () => {\n intent?.controller.abort(); intent = undefined\n setChoices(undefined); setReading(false)\n }\n createEffect(on(() => [target(), options.active(), epoch()] as const, revoke, { defer: true }))\n onCleanup(() => { disposed = true; revoke() })\n const owns = (captured: AttachIntent) => !disposed && intent === captured && !captured.controller.signal.aborted\n && options.active() && sameTarget(target(), captured.target) && epoch() === captured.epoch\n const busy = () => { const value = target(); return reading() || (value ? integrationBindings.busy(value) : false) }\n const fail = (value: IntegrationBindingTarget, key = \"integrations.error.retry\", vars?: Record<string, string>) => {\n if (!disposed && options.active() && sameTarget(target(), value)) showToastNotification({ category: \"opencode\", variant: \"error\", message: t(key, vars) })\n }\n /** Why the conversation cannot be attached now, or undefined when it can. */\n const unavailable = createMemo(() => {\n const entry = options.integration()\n if (!entry || link()?.state === \"attached\") return undefined\n if (!options.sessionId()) return t(\"integrations.link.noConversation\")\n const connection = integrationConnection(entry)\n if (connection.state === \"offers\") return undefined\n const [key, vars] = integrationConnectionMessage(connection, entry.app.name)\n return t(key, vars)\n })\n\n /** At most one `detachHost` for the displayed conversation. */\n const detach = async () => {\n const value = target()\n if (disposed || !value || link()?.state !== \"attached\" || busy() || !options.active()) return\n await integrationBindings.run(value, async () => {\n try {\n const result = await integrationAttachmentRequest<IntegrationDetachResponse>(value.instanceId, value.directory, value.integrationId,\n \"detach\", new AbortController().signal, { sessionID: value.sessionID })\n if (result?.outcome !== \"detached\" && result?.outcome !== \"none\") throw new Error(\"Invalid detach result\")\n } catch { fail(value) }\n })\n }\n /** At most one `attachHost` of the displayed conversation to the chosen offer. */\n const attach = async (captured: AttachIntent, offerID: string) => {\n if (!owns(captured) || busy() || chainAction() !== \"attach\") return\n const value = captured.target\n await integrationBindings.run(value, async () => {\n if (!owns(captured)) return\n // Consume consent at dispatch; the admitted mutation has its own lifetime and is never replayed.\n revoke()\n try {\n const result = await integrationAttachmentRequest<IntegrationAttachResponse>(value.instanceId, value.directory, value.integrationId,\n \"attach\", new AbortController().signal, { sessionID: value.sessionID, offerID })\n if (result?.outcome === \"attached\") return\n if (OUTCOMES.has(result?.outcome)) fail(value, `integrations.outcome.${result.outcome}`)\n else throw new Error(\"Invalid attach result\")\n } catch { fail(value) }\n })\n }\n /** What the chain button does now. */\n const chainAction = () => { const value = link(); return value ? integrationChainAction(value, unavailable()) : \"unavailable\" }\n /** The chain button: detach when attached; else read the offers, attach the only one or offer the choice. */\n const activate = async () => {\n if (chainAction() === \"detach\") return detach()\n const value = target(), entry = options.integration()\n if (disposed || !value || !entry || chainAction() !== \"attach\" || busy() || !options.active()) return\n const captured: AttachIntent = { target: value, epoch: epoch(), controller: new AbortController() }\n intent = captured\n setReading(true)\n try {\n const result = await integrationAttachmentRequest<IntegrationHostsResponse>(value.instanceId, value.directory, value.integrationId,\n \"hosts\", captured.controller.signal)\n if (!owns(captured)) return\n if (!Array.isArray(result?.offers)) throw new Error(\"Invalid hosts result\")\n const choice = integrationAttachChoice(result.offers)\n if (choice.kind === \"none\") { fail(value, \"integrations.connection.noOffer\", { app: entry.app.name }); revoke() }\n else if (choice.kind === \"attach\") { setReading(false); await attach(captured, choice.offerID) }\n else setChoices(choice.offers.map(offer => ({ ...offer, attach: () => void attach(captured, offer.offerID) })))\n } catch { if (owns(captured)) { fail(value); revoke() } }\n finally { if (intent === captured) setReading(false) }\n }\n return { link, busy, unavailable, chainAction, choices, closeChoices: () => { if (choices()) revoke() }, activate, detach }\n}\n\nexport type IntegrationRowBinding = ReturnType<typeof createIntegrationRowBinding>\n","import { For, Show, splitProps, type JSX } from \"solid-js\"\nimport { DropdownMenu } from \"@kobalte/core/dropdown-menu\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport { AlertTriangle, Link2, Unlink2 } from \"lucide-solid\"\nimport { useI18n } from \"../lib/i18n\"\nimport type { IntegrationAttention } from \"../lib/integration-row-state\"\nimport type { IntegrationRowBinding } from \"./integration-row-binding\"\n\n/** A focusable icon whose text is its accessible name and its tooltip. */\nfunction Indicator(props: { label: string; children: JSX.Element } & Record<`data-${string}`, string | undefined>) {\n const [, data] = splitProps(props, [\"label\", \"children\"])\n return <Tooltip placement=\"top\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" role=\"img\" class=\"plugin-control-indicator\" aria-label={props.label} {...data}>\n {props.children}\n </Tooltip.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\"><bdi>{props.label}</bdi></Tooltip.Content></Tooltip.Portal>\n </Tooltip>\n}\n\n/**\n * The chain button of a native integration's row: pressed while the displayed conversation is attached. A click\n * detaches it, or attaches it to the only open document, or opens the choice between several documents.\n */\nexport function IntegrationLinkButton(props: { binding: IntegrationRowBinding }) {\n const { t } = useI18n()\n const link = () => props.binding.link()!\n const attached = () => link().state === \"attached\"\n const state = () => {\n const value = link()\n return value.state === \"attached\" ? t(\"integrations.link.attached\", { label: value.label }) : t(`integrations.link.${value.state}`)\n }\n const action = () => {\n const next = props.binding.chainAction()\n return next === \"detach\" ? t(\"integrations.detachConversation\") : next === \"attach\" ? t(\"integrations.attachConversation\") : props.binding.unavailable() ?? \"\"\n }\n const disabled = () => props.binding.busy() || props.binding.chainAction() === \"unavailable\"\n return <DropdownMenu placement=\"bottom-end\" gutter={4} open={props.binding.choices() !== undefined}\n onOpenChange={open => { if (!open) props.binding.closeChoices(); else if (!disabled()) void props.binding.activate() }}>\n <Tooltip placement=\"top\" openDelay={300}>\n <DropdownMenu.Trigger as={Tooltip.Trigger} type=\"button\" class=\"icon-button-compact icon-toggle plugin-control-link\"\n data-integration-link={link().state} aria-pressed={attached()} aria-disabled={disabled() ? \"true\" : undefined}\n aria-busy={props.binding.busy()} aria-label={`${state()} — ${action()}`}>\n <Show when={link().state === \"none\"} fallback={<Link2 class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": props.binding.busy() }} aria-hidden=\"true\" />}>\n <Unlink2 class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": props.binding.busy() }} aria-hidden=\"true\" />\n </Show>\n </DropdownMenu.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\"><bdi>{state()}</bdi>{\"\\n\"}{action()}</Tooltip.Content></Tooltip.Portal>\n </Tooltip>\n <DropdownMenu.Portal>\n <DropdownMenu.Content class=\"action-overflow-content\" data-integration-offers>\n <DropdownMenu.Group>\n <DropdownMenu.GroupLabel class=\"action-overflow-info\">{t(\"integrations.attachChoose\")}</DropdownMenu.GroupLabel>\n <For each={props.binding.choices() ?? []}>{offer => (\n <DropdownMenu.Item class=\"action-overflow-item\" onSelect={() => void offer.attach()}>\n <span class=\"action-overflow-item-icon\" aria-hidden=\"true\"><Link2 class=\"h-3.5 w-3.5\" /></span>\n <span class=\"action-overflow-item-label\"><bdi>{offer.label}</bdi></span>\n </DropdownMenu.Item>\n )}</For>\n </DropdownMenu.Group>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu>\n}\n\n/** Shown only when the application part needs an action, named in the row menu. */\nexport function IntegrationAttentionIndicator(props: { attention: IntegrationAttention; app: string }) {\n const { t } = useI18n()\n return <Indicator label={t(`integrations.attention.${props.attention}`, { app: props.app })} data-integration-attention={props.attention}>\n <AlertTriangle class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Indicator>\n}\n","import { createSignal, onCleanup } from \"solid-js\"\nimport Switch from \"@suid/material/Switch\"\nimport type { PluginActivationControl, PluginControlLocation, PluginControlScope } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { getLogger } from \"../lib/logger\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { pluginControlsCache } from \"../stores/plugin-controls\"\nimport { ACCENT_SWITCH_SX } from \"./settings/settings-switch\"\n\nconst log = getLogger(\"session\")\nconst [pending, setPending] = createSignal<ReadonlySet<string>>(new Set())\nconst pendingKey = (instanceId: string, location: PluginControlLocation, scope: PluginControlScope, pluginId: string) =>\n JSON.stringify([instanceId, location.directory, scope, pluginId])\n\n/** One activation mutation per plugin, scope and Location at a time, shared by every surface that shows the switch. */\nexport function isPluginActivationPending(instanceId: string, location: PluginControlLocation, scope: PluginControlScope, pluginId: string): boolean {\n return pending().has(pendingKey(instanceId, location, scope, pluginId))\n}\n\nexport function pluginScopeChecked(control: PluginActivationControl, scope: PluginControlScope): boolean {\n const scoped = control[scope]\n if (scoped !== \"default\") return scoped === \"enabled\"\n return scope === \"project\" ? pluginScopeChecked(control, \"global\") : true\n}\n\nfunction errorMessageKey(error: unknown): string {\n if (!(error instanceof HttpResponseError)) return \"instanceServiceStatus.plugins.errors.save\"\n if (error.status === 403) return \"instanceServiceStatus.plugins.errors.forbidden\"\n if (error.status === 409) return \"instanceServiceStatus.plugins.errors.conflict\"\n if (error.status === 422) return \"instanceServiceStatus.plugins.errors.invalidConfig\"\n return \"instanceServiceStatus.plugins.errors.save\"\n}\n\n/**\n * The Global or Project activation switch of one plugin: the native activation-rule mutation, without confirmation.\n * Feedback belongs to the surface that started it, while it still shows the same Location.\n */\nexport function PluginActivationSwitch(props: {\n instanceId: string\n location: PluginControlLocation\n control: PluginActivationControl | undefined\n scope: PluginControlScope\n available: boolean\n /** Accessible name; it includes the plugin's name and the scope. */\n label: string\n /** The plugin's shown name in error feedback; its ID otherwise. */\n name?: string\n describedBy?: string\n active?: boolean\n /** Shown but not writable here, with this reason as its tooltip; it stays focusable. */\n lockedReason?: string\n /** An integration's switch: the accent switch of Yolo and the settings, where a plain plugin's is the green variant. */\n integration?: boolean\n}) {\n const { t } = useI18n()\n let disposed = false\n onCleanup(() => { disposed = true })\n const isPending = () => Boolean(props.control && isPluginActivationPending(props.instanceId, props.location, props.scope, props.control.id))\n const toggle = async (control: PluginActivationControl, enabled: boolean) => {\n const instanceId = props.instanceId, location = { directory: props.location.directory }, scope = props.scope\n const key = pendingKey(instanceId, location, scope, control.id)\n if (pending().has(key)) return\n setPending(current => new Set(current).add(key))\n try {\n await pluginControlsCache.mutate(instanceId, location, control.id, scope, enabled)\n } catch (error) {\n log.error(\"Failed to update plugin activation rule\", { pluginId: control.id, scope, error })\n if (!disposed && props.active !== false && props.instanceId === instanceId && props.location.directory === location.directory) {\n showToastNotification({ category: \"opencode\", variant: \"error\",\n message: t(errorMessageKey(error), { name: props.name ?? control.id, scope: t(`instanceServiceStatus.plugins.scope.${scope}`) }) })\n }\n } finally {\n setPending(current => { const next = new Set(current); next.delete(key); return next })\n }\n }\n return (\n <div class=\"plugin-control-switch\" data-scope={props.scope} data-locked={props.lockedReason ? \"\" : undefined}\n data-integration={props.integration ? \"\" : undefined} title={props.lockedReason}>\n <Switch\n checked={props.control ? pluginScopeChecked(props.control, props.scope) : false}\n disabled={!props.available}\n color={props.integration ? \"primary\" : \"success\"}\n size=\"small\"\n sx={props.integration ? ACCENT_SWITCH_SX : undefined}\n inputProps={{\n \"aria-label\": props.label,\n \"aria-describedby\": props.describedBy,\n \"aria-disabled\": isPending() || !props.available || Boolean(props.lockedReason),\n \"aria-busy\": isPending(),\n }}\n onChange={(event, nextChecked) => {\n const current = props.control\n if (isPending() || !props.available || props.lockedReason || !current) {\n // SUID restores the controlled checked value before calling us.\n // Cancel native activation too, while retaining keyboard focus.\n event.preventDefault()\n return\n }\n void toggle(current, Boolean(nextChecked))\n }}\n />\n </div>\n )\n}\n","import { createSignal } from \"solid-js\"\nimport { getRootClient } from \"./opencode-client\"\nimport { pluginControlsCache } from \"./plugin-controls\"\nimport type { PluginControlLocation } from \"../../../server/src/api-types\"\nimport { requestLocationOptions, toRequestLocation } from \"./request-locations\"\n\nconst [pending, setPending] = createSignal<ReadonlySet<string>>(new Set())\nconst key = (instanceId: string, target: string) => JSON.stringify([instanceId, target])\nexport const isPluginPackagePending = (instanceId: string, target: string) => pending().has(key(instanceId, target))\n\n// Native updates are serialized by package target and affect the daemon's shared\n// package cache. Keep admission beyond component lifetimes; never replay writes.\nexport async function runPluginPackageAction(instanceId: string, location: PluginControlLocation, target: string, action: \"check\" | \"update\") {\n const identity = key(instanceId, target)\n if (pending().has(identity)) return\n setPending(previous => new Set(previous).add(identity))\n try {\n const client = getRootClient(instanceId), options = requestLocationOptions(location)\n const scoped = toRequestLocation(location)\n if (action === \"check\") await client.plugin.check({ location: scoped, target }, options)\n else await client.plugin.update({ location: scoped, targets: [target] }, options)\n } finally {\n setPending(previous => { const next = new Set(previous); next.delete(identity); return next })\n pluginControlsCache.invalidateInstance(instanceId)\n }\n}\n","import { For, Show, createEffect, createMemo, onCleanup } from \"solid-js\"\nimport { DropdownMenu } from \"@kobalte/core/dropdown-menu\"\nimport { AppWindow, Download, Info, MoreHorizontal, PackageSearch, RefreshCw, Trash2, Unlink2 } from \"lucide-solid\"\nimport type { PluginConfiguredSource, PluginControlLocation, PluginControlScope, PluginRuntimeSource } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { isPluginPackagePending, runPluginPackageAction } from \"../stores/plugin-package-actions\"\nimport { pluginSourcesStore } from \"../stores/plugin-sources\"\nimport { confirmIntegrationAction } from \"./integration-confirmation\"\nimport { serverEvents } from \"../lib/server-events\"\n\ntype RemovableSource = PluginConfiguredSource & { scope: PluginControlScope }\ntype Item =\n | { kind: \"host\"; action: \"install\" | \"update\" }\n | { kind: \"detach\" }\n | { kind: \"package\"; action: \"check\" | \"update\"; target: string }\n | { kind: \"remove\"; source: RemovableSource }\n | { kind: \"refresh\" }\n\nexport const PLUGIN_SOURCE_CONFIRM_EXPIRY_MS = 120_000\n\n/** One compact menu per Plugins row: for an integration its connection state, the application part's\n * installation and the displayed conversation's detach; the native package check/update, removal of each removable\n * declaration from its scope's own document, and Refresh for sources the inventory never confirmed. */\nexport function PluginRowActions(props: {\n instanceId: string\n location: PluginControlLocation\n name: string\n source?: PluginRuntimeSource\n removable: readonly RemovableSource[]\n refresh?: () => void\n active?: boolean\n consentEpoch?: number\n sessionId?: string\n /** An integration's connection state, labelling the menu's items. */\n info?: string\n /** Installs or updates an integration's application part, after its own confirmation. */\n hostAction?: { action: \"install\" | \"update\"; run: () => void }\n /** Detaches the displayed conversation from an integration's application. */\n detach?: { run: () => void; busy: boolean }\n}) {\n const { t } = useI18n()\n let afterClose: (() => void | Promise<void>) | undefined\n let generation = 0\n let confirmation: AbortController | undefined\n let trigger: HTMLButtonElement | undefined\n let surface: HTMLElement | null | undefined\n let admittedOwner: string | undefined\n let disposed = false\n const presentationOwner = () => JSON.stringify([props.instanceId, props.location.directory, props.sessionId, props.active !== false])\n const fallback = () => surface?.querySelector<HTMLButtonElement>(\"[data-plugin-refresh]\")\n const restoreFocus = () => {\n if (trigger?.isConnected && !trigger.disabled) trigger.focus()\n else fallback()?.focus()\n }\n const cancel = () => confirmation?.abort()\n const ownership = createMemo(() => JSON.stringify([props.instanceId, props.location.directory,\n props.sessionId, props.source?.type === \"package\" ? props.source.target : null, props.active !== false,\n props.consentEpoch, props.removable]))\n createEffect(() => { ownership(); generation++; cancel() })\n onCleanup(serverEvents.onTransportStatus(status => { if (status === \"disconnected\") cancel() }))\n onCleanup(serverEvents.on(\"instance.eventStatus\", event => { if (event.type === \"instance.eventStatus\" && event.instanceId === props.instanceId) cancel() }))\n onCleanup(() => {\n disposed = true; generation++; cancel()\n if (admittedOwner && (document.activeElement === trigger || document.activeElement === document.body)) queueMicrotask(() => {\n if (presentationOwner() !== admittedOwner || props.active === false) return\n if (surface?.isConnected) fallback()?.focus()\n })\n })\n const pkg = () => props.source?.type === \"package\" ? props.source : undefined\n const packageBusy = () => Boolean(pkg()?.updating || (pkg() && isPluginPackagePending(props.instanceId, pkg()!.target)))\n const removing = (source: RemovableSource) => pluginSourcesStore.isRemoving(props.instanceId, props.location, source)\n const busy = () => packageBusy() || props.removable.some(removing)\n const scopeLabel = (scope: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${scope}`)\n // Stable descriptors: icons are created by the item renderer, once per rendered item.\n const hostAction = () => props.hostAction?.action\n const items = createMemo<Item[]>(() => [\n ...(hostAction() ? [{ kind: \"host\" as const, action: hostAction()! }] : []),\n ...(props.detach ? [{ kind: \"detach\" as const }] : []),\n ...(pkg() ? [{ kind: \"package\" as const, action: pkg()!.outdated ? \"update\" as const : \"check\" as const, target: pkg()!.target }] : []),\n ...props.removable.filter(source => source.expectedRevision).map(source => ({ kind: \"remove\" as const, source })),\n ...(props.refresh ? [{ kind: \"refresh\" as const }] : []),\n ])\n const packageLabel = (item: Extract<Item, { kind: \"package\" }>) => t(`settings.pluginPackages.${item.action}`, { target: item.target })\n const label = (item: Item) => item.kind === \"package\" ? packageLabel(item)\n : item.kind === \"host\" ? t(`integrations.installHost.${item.action}`)\n : item.kind === \"detach\" ? t(\"integrations.detachConversation\")\n : item.kind === \"remove\" ? t(\"instanceServiceStatus.plugins.sources.remove\", { scope: scopeLabel(item.source.scope) })\n : t(\"instanceServiceStatus.plugins.refresh\")\n const hint = (item: Item) => item.kind === \"package\" ? t(\"settings.pluginPackages.shared\")\n : item.kind === \"host\" ? t(\"integrations.installHost.machine\")\n : item.kind === \"remove\" ? `${item.source.target}\\n${item.source.path ?? \"\"}` : undefined\n // A lone package action is the trigger itself; an integration's menu always opens on its connection state.\n const lonePackage = () => !props.info && items().length === 1 && items()[0]!.kind === \"package\"\n const triggerLabel = () => lonePackage() ? packageLabel(items()[0] as Extract<Item, { kind: \"package\" }>)\n : t(\"instanceServiceStatus.plugins.sources.actions\", { name: props.name })\n const itemDisabled = (item: Item) => busy() || props.active === false || (item.kind === \"detach\" && props.detach?.busy === true)\n\n const runPackage = (item: Extract<Item, { kind: \"package\" }>) => {\n if (packageBusy() || props.active === false) return\n const owner = presentationOwner()\n void runPluginPackageAction(props.instanceId, { ...props.location }, item.target, item.action).catch(() => {\n if (!disposed && owner === presentationOwner()) showToastNotification({ category: \"opencode\", variant: \"error\", message: t(\"settings.pluginPackages.error\", { target: item.target }) })\n })\n }\n const runRemove = async (source: RemovableSource) => {\n if (removing(source) || confirmation || props.active === false || !source.expectedRevision) return\n const captured = generation\n const instanceId = props.instanceId, location = { ...props.location }, selected = { ...source }\n const owner = ownership()\n const feedbackOwner = presentationOwner()\n surface = trigger?.closest<HTMLElement>(\".plugin-controls\")\n confirmation = new AbortController()\n const signal = confirmation.signal\n const action = t(\"instanceServiceStatus.plugins.sources.remove\", { scope: scopeLabel(source.scope) })\n const accepted = await confirmIntegrationAction(t(\"instanceServiceStatus.plugins.sources.removeWarning\"), {\n title: `${action} — ⁨${props.name}⁩`,\n detail: `${source.target}\\n${source.scope === \"global\" ? t(\"instanceServiceStatus.plugins.sources.removeGlobalWarning\") + \"\\n\" : \"\"}${t(\"instanceServiceStatus.plugins.sources.removeRecovery\")}`,\n confirmLabel: action, variant: \"warning\",\n expiresAfterMs: PLUGIN_SOURCE_CONFIRM_EXPIRY_MS, returnFocus: () => { if (presentationOwner() === feedbackOwner) restoreFocus() },\n }, signal)\n confirmation = undefined\n if (!accepted || signal.aborted || captured !== generation || ownership() !== owner) return\n admittedOwner = feedbackOwner\n void pluginSourcesStore.remove(instanceId, location, selected).catch(error => {\n if (!surface?.isConnected || presentationOwner() !== feedbackOwner) return\n const stale = error instanceof HttpResponseError && error.status === 409\n showToastNotification({ category: \"opencode\", variant: \"error\", message: t(stale\n ? \"instanceServiceStatus.plugins.sources.errors.removeStale\"\n : \"instanceServiceStatus.plugins.sources.errors.remove\", { name: source.target, scope: scopeLabel(source.scope) }) })\n })\n }\n const run = (item: Item) => item.kind === \"package\" ? runPackage(item)\n : item.kind === \"host\" ? (afterClose = () => props.hostAction?.run())\n : item.kind === \"detach\" ? props.detach?.run()\n : item.kind === \"remove\" ? (afterClose = () => runRemove(item.source)) : props.refresh?.()\n\n const icon = (item: Item, pulse = false) => item.kind === \"package\"\n ? (item.action === \"update\"\n ? <Download class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": pulse }} aria-hidden=\"true\" />\n : <PackageSearch class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": pulse }} aria-hidden=\"true\" />)\n : item.kind === \"host\" ? <AppWindow class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n : item.kind === \"detach\" ? <Unlink2 class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n : item.kind === \"remove\" ? <Trash2 class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n : <RefreshCw class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n\n const entries = () => <For each={items()}>{item => (\n <DropdownMenu.Item class=\"action-overflow-item\" disabled={itemDisabled(item)}\n title={hint(item)} onSelect={() => run(item)}>\n <span class=\"action-overflow-item-icon\" aria-hidden=\"true\">{icon(item)}</span>\n <span class=\"action-overflow-item-label\">{label(item)}</span>\n </DropdownMenu.Item>\n )}</For>\n\n return <Show when={items().length > 0 || props.info}>\n <DropdownMenu placement=\"bottom-end\" gutter={4}>\n <DropdownMenu.Trigger type=\"button\" class=\"icon-button-compact\" disabled={busy() || props.active === false}\n ref={trigger}\n title={!props.info && items().length === 1 ? [label(items()[0]!), hint(items()[0]!)].filter(Boolean).join(\"\\n\") : triggerLabel()}\n aria-label={triggerLabel()} aria-busy={busy()}>\n <Show when={lonePackage()} fallback={<MoreHorizontal class=\"h-3.5 w-3.5\" classList={{ \"animate-pulse\": busy() }} aria-hidden=\"true\" />}>\n {icon(items()[0]!, busy())}\n </Show>\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content class=\"action-overflow-content\" onCloseAutoFocus={() => {\n const action = afterClose; afterClose = undefined\n if (action) queueMicrotask(() => void action())\n }}>\n <Show when={props.info} fallback={entries()}>{info => (\n <DropdownMenu.Group>\n <DropdownMenu.GroupLabel class=\"action-overflow-info\" data-integration-connection>\n <Info class=\"h-3.5 w-3.5\" aria-hidden=\"true\" /><bdi>{info()}</bdi>\n </DropdownMenu.GroupLabel>\n {entries()}\n </DropdownMenu.Group>\n )}</Show>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu>\n </Show>\n}\n","import { Dialog } from \"@kobalte/core/dialog\"\nimport { For, Show, createEffect, createMemo, createSignal, onCleanup, type Accessor } from \"solid-js\"\nimport { BookOpen, RefreshCw } from \"lucide-solid\"\nimport type { PluginControlLocation, PluginControlScope } from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\nimport { openExternalUrl } from \"../lib/external-url\"\nimport { useI18n } from \"../lib/i18n\"\nimport { showToastNotification } from \"../lib/notifications\"\nimport { integrationEpoch, integrations } from \"../stores/integrations\"\nimport { pluginSourcesStore } from \"../stores/plugin-sources\"\nimport { InfoPopoverButton } from \"./info-popover-button\"\nimport { confirmIntegrationAction } from \"./integration-confirmation\"\nimport { integrationSummary } from \"../lib/integration-row-state\"\nimport WindowCloseButton from \"./window-close-button\"\n\n/** Catalogue entries that can be installed here: neither declared nor loaded, and not ambiguous. */\nexport function installableIntegrations(entries: readonly IntegrationView[]): IntegrationView[] {\n return entries.filter(entry => !entry.ambiguous && !entry.plugin.declared && entry.plugin.runtime === undefined)\n}\n\n/**\n * \"Add an integration…\": one row per installable catalogue entry, in catalogue order. Install confirms, closes the\n * window and installs by catalogue ID; the integration's Status section then shows the installation.\n */\nexport function IntegrationCatalogWindow(props: {\n instanceId: string\n location: PluginControlLocation\n projectAvailable: boolean\n active?: boolean\n sessionId?: string\n open: boolean\n onClose: () => void\n /** The \"+\" trigger, focused again on close when it is still shown. */\n trigger: () => HTMLElement | undefined\n}) {\n const { t, locale } = useI18n()\n const state = createMemo(() => integrations.state(props.instanceId, props.location.directory))\n const response = () => { const value = state(); return value.status === \"ready\" ? value.response : undefined }\n const catalog = () => response()?.catalog\n const rows = createMemo(() => installableIntegrations(response()?.integrations ?? []))\n const unavailable = () => state().status === \"error\" || catalog()?.state === \"unavailable\"\n const scopeLabel = (scope: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${scope}`)\n const date = () => {\n const value = catalog()?.fetchedAt\n return value ? new Intl.DateTimeFormat(locale(), { dateStyle: \"medium\" }).format(new Date(value)) : \"\"\n }\n const refresh = () => void integrations.refreshDemanded(props.instanceId)\n const focusTrigger = () => {\n const trigger = props.trigger()\n if (trigger?.isConnected && trigger.getClientRects().length) trigger.focus()\n else document.querySelector<HTMLElement>('[data-status-section-trigger=\"plugins\"]')?.focus()\n }\n\n const active = () => props.active !== false\n const identity = createMemo(() => JSON.stringify([props.instanceId, props.location.directory, props.sessionId, active(), props.open,\n integrationEpoch(props.instanceId, props.sessionId)]))\n let confirmation: AbortController | undefined\n createEffect(() => { identity(); confirmation?.abort() })\n onCleanup(() => confirmation?.abort())\n const install = async (entry: IntegrationView, scope: PluginControlScope) => {\n if (!active() || confirmation) return\n const instanceId = props.instanceId, location = { directory: props.location.directory }\n const owner = identity()\n confirmation = new AbortController()\n const signal = confirmation.signal\n const accepted = await confirmIntegrationAction(t(\"integrations.install.confirm\", { name: entry.displayName, scope: scopeLabel(scope) }), {\n title: t(\"integrations.install.title\"), confirmLabel: t(\"integrations.catalog.install\"), variant: \"warning\",\n ...(scope === \"project\" ? { detail: t(\"instanceServiceStatus.plugins.sources.projectWarning\") } : {}),\n returnFocus: focusTrigger,\n }, signal)\n confirmation = undefined\n if (!accepted || signal.aborted || identity() !== owner) return\n props.onClose()\n try {\n // Sent once: a lost answer is reconciled by the next read, never replayed.\n await pluginSourcesStore.installIntegration(instanceId, location, entry.id, scope)\n showToastNotification({ category: \"opencode\", variant: \"info\", message: t(\"integrations.message.installRequested\") })\n } catch {\n showToastNotification({ category: \"opencode\", variant: \"error\", message: t(\"integrations.install.error\") })\n }\n }\n\n return <Show when={props.open}>\n <Dialog open modal onOpenChange={next => { if (!next) props.onClose() }}>\n <Dialog.Portal><Dialog.Overlay class=\"modal-overlay z-[1300]\" />\n <Dialog.Content role=\"dialog\" class=\"window-shell integration-catalog\" onCloseAutoFocus={event => { event.preventDefault(); focusTrigger() }}>\n <header class=\"window-header\">\n <Dialog.Title class=\"window-title\">{t(\"integrations.catalog.title\")}</Dialog.Title>\n <WindowCloseButton onClose={props.onClose} />\n </header>\n <div class=\"window-body integration-catalog-body\">\n <Show when={unavailable()}>\n <p class=\"integration-catalog-state\" role=\"status\">\n {t(\"integrations.catalogUnavailable\")}\n <button type=\"button\" class=\"icon-button-compact\" aria-label={t(\"integrations.refresh\")} title={t(\"integrations.refresh\")} onClick={refresh}>\n <RefreshCw class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </button>\n </p>\n </Show>\n <Show when={!unavailable() && catalog()?.state === \"stale\"}>\n <p class=\"integration-catalog-state\" role=\"status\">{t(\"integrations.catalogStale\", { date: date() })}</p>\n </Show>\n <Show when={!unavailable() && response()}>\n <Show when={rows().length > 0} fallback={<p class=\"integration-catalog-state\">{t(\"integrations.catalog.allInstalled\")}</p>}>\n <ul class=\"integration-catalog-list\">\n <For each={rows()}>{entry => <IntegrationCatalogRow t={t} entry={entry} summary={() => integrationSummary(entry, locale())}\n projectAvailable={props.projectAvailable} disabled={props.active === false} onInstall={scope => void install(entry, scope)} />}</For>\n </ul>\n </Show>\n </Show>\n </div>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog>\n </Show>\n}\n\nfunction IntegrationCatalogRow(props: {\n t: (key: string, vars?: Record<string, any>) => string\n entry: IntegrationView\n summary: Accessor<string>\n projectAvailable: boolean\n disabled: boolean\n onInstall: (scope: PluginControlScope) => void\n}) {\n const t = props.t\n const [scope, setScope] = createSignal<PluginControlScope>(\"global\")\n // D18: a native integration installs in Global only; its scope selector stays focusable to show why.\n const globalOnly = () => props.entry.family === \"native\"\n const scopeLabel = (value: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${value}`)\n return <li class=\"integration-catalog-row\" data-catalog-integration={props.entry.id}>\n <span class=\"integration-catalog-name\"><bdi>{props.entry.displayName}</bdi></span>\n <span class=\"integration-state-badge badge-shape\" data-integration-family={props.entry.family}>{t(`integrations.catalog.family.${props.entry.family}`)}</span>\n <InfoPopoverButton label={t(\"integrations.info\", { name: props.entry.displayName })}><p>{props.summary()}</p></InfoPopoverButton>\n <Show when={props.entry.docs}>{docs => (\n <button type=\"button\" class=\"section-info-trigger\" aria-label={t(\"integrations.docs\")} title={t(\"integrations.docs\")}\n onClick={() => void openExternalUrl(docs(), \"integration-docs\")}><BookOpen class=\"section-info-icon\" aria-hidden=\"true\" /></button>\n )}</Show>\n <select class=\"integration-catalog-scope\" aria-label={`${t(\"integrations.catalog.scope\")} — ${props.entry.displayName}`}\n value={globalOnly() ? \"global\" : scope()} aria-disabled={globalOnly() ? \"true\" : undefined}\n title={globalOnly() ? t(\"integrations.section.scopeGlobalOnly\") : undefined}\n onMouseDown={event => { if (globalOnly()) event.preventDefault() }}\n onKeyDown={event => { if (globalOnly() && event.key !== \"Tab\" && event.key !== \"Escape\") event.preventDefault() }}\n onChange={event => { if (globalOnly()) event.currentTarget.value = \"global\"; else setScope(event.currentTarget.value as PluginControlScope) }}>\n <option value=\"global\">{scopeLabel(\"global\")}</option>\n <option value=\"project\" disabled={!props.projectAvailable || globalOnly()}>{scopeLabel(\"project\")}</option>\n </select>\n <button type=\"button\" class=\"window-text-button\" disabled={props.disabled}\n aria-label={`${t(\"integrations.catalog.install\")} — ${props.entry.displayName}`}\n onClick={() => props.onInstall(globalOnly() ? \"global\" : scope())}>{t(\"integrations.catalog.install\")}</button>\n </li>\n}\n","import { Show, createEffect, createSignal, createUniqueId, on } from \"solid-js\"\nimport { Popover } from \"@kobalte/core/popover\"\nimport type { PluginControlLocation, PluginControlScope } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { getLogger } from \"../lib/logger\"\nimport { nativeSelectListOpen } from \"../lib/native-select-open\"\nimport { HttpResponseError } from \"../lib/retryable-file-search\"\nimport { pluginSourcesStore } from \"../stores/plugin-sources\"\n\nconst log = getLogger(\"session\")\n\n/** \"Add a plugin…\" of the Plugins \"+\" menu: a transient window, anchored to that menu's trigger, that adds one\n * registry or Git package to a scope's OpenCode configuration. Success is shown by the row, never here. */\nexport function PluginSourceAdd(props: {\n instanceId: string\n location: PluginControlLocation\n projectAvailable: boolean\n active?: boolean\n open: boolean\n onOpenChange: (open: boolean) => void\n anchor: () => HTMLElement | undefined\n}) {\n const { t } = useI18n()\n const id = createUniqueId()\n const [spec, setSpec] = createSignal(\"\")\n const [scope, setScope] = createSignal<PluginControlScope>(\"global\")\n const [pending, setPending] = createSignal(false)\n const [error, setError] = createSignal<string>()\n const scopeLabel = (value: PluginControlScope) => t(`instanceServiceStatus.plugins.scope.${value}`)\n const setOpen = (next: boolean) => props.onOpenChange(next)\n createEffect(on(() => props.open, open => { if (open) { setSpec(\"\"); setScope(\"global\"); setError(undefined) } }))\n\n const openChange = (next: boolean) => {\n if (pending()) return\n setOpen(next)\n }\n\n const submit = async (event: SubmitEvent) => {\n event.preventDefault()\n const value = spec().trim()\n if (!value || pending() || props.active === false) return\n // Never widen the chosen scope: an unavailable Project target is refused by the server.\n const target = scope()\n setPending(true)\n setError(undefined)\n try {\n await pluginSourcesStore.add(props.instanceId, props.location, target, value)\n setOpen(false)\n } catch (failure) {\n log.error(\"Failed to add plugin source\", { scope: target, error: failure })\n setError(t(errorKey(failure), { scope: scopeLabel(target), global: scopeLabel(\"global\") }))\n } finally {\n setPending(false)\n }\n }\n\n return (\n <Popover placement=\"bottom-start\" gutter={4} open={props.open} onOpenChange={openChange} anchorRef={props.anchor}>\n <Popover.Portal>\n <Popover.Content class=\"window-shell plugin-source-add\" aria-busy={pending()}\n onCloseAutoFocus={event => { event.preventDefault(); const anchor = props.anchor(); if (anchor?.isConnected) anchor.focus() }}>\n <header class=\"window-header\">\n <Popover.Title class=\"window-title\">{t(\"instanceServiceStatus.plugins.sources.addTitle\")}</Popover.Title>\n </header>\n <form onSubmit={event => void submit(event)}>\n <div class=\"window-body plugin-source-add-body\">\n <label for={`${id}-spec`}>{t(\"instanceServiceStatus.plugins.sources.spec\")}</label>\n <input id={`${id}-spec`} class=\"form-input\" name=\"spec\" autocomplete=\"off\" autocapitalize=\"none\" autocorrect=\"off\"\n spellcheck={false} required maxLength={512} placeholder={t(\"instanceServiceStatus.plugins.sources.specPlaceholder\")}\n value={spec()} disabled={pending()} aria-invalid={Boolean(error())} aria-describedby={`${id}-trust ${id}-error`}\n onInput={event => { setSpec(event.currentTarget.value); setError(undefined) }} />\n <label for={`${id}-scope`}>{t(\"instanceServiceStatus.plugins.sources.scope\")}</label>\n <select id={`${id}-scope`} value={scope()} disabled={pending()}\n on:keydown={(event) => { if (event.key === \"Escape\" && nativeSelectListOpen(event.currentTarget)) event.stopPropagation() }}\n onChange={event => setScope(event.currentTarget.value as PluginControlScope)}>\n <option value=\"global\">{scopeLabel(\"global\")}</option>\n <option value=\"project\" disabled={!props.projectAvailable}>{scopeLabel(\"project\")}</option>\n </select>\n <Popover.Description id={`${id}-trust`} class=\"plugin-source-add-note\">\n {t(\"instanceServiceStatus.plugins.sources.trust\")}\n </Popover.Description>\n <Show when={scope() === \"project\"}>\n <p class=\"plugin-source-add-note\" role=\"note\">{t(\"instanceServiceStatus.plugins.sources.projectWarning\")}</p>\n </Show>\n <p id={`${id}-error`} class=\"plugin-source-add-error\" role=\"alert\">{error() ?? \"\"}</p>\n </div>\n <div class=\"window-footer\">\n <button type=\"submit\" class=\"window-action\" disabled={pending() || !spec().trim()} aria-busy={pending()}>\n {t(pending() ? \"instanceServiceStatus.plugins.sources.adding\" : \"instanceServiceStatus.plugins.sources.submit\")}\n </button>\n </div>\n </form>\n </Popover.Content>\n </Popover.Portal>\n </Popover>\n )\n}\n\nfunction errorKey(error: unknown): string {\n if (!(error instanceof HttpResponseError)) return \"instanceServiceStatus.plugins.sources.errors.add\"\n const known: Record<string, string> = {\n \"invalid-spec\": \"instanceServiceStatus.plugins.sources.errors.invalidSpec\",\n \"local-path\": \"instanceServiceStatus.plugins.sources.errors.localPath\",\n \"plugin-id\": \"instanceServiceStatus.plugins.sources.errors.pluginId\",\n duplicate: \"instanceServiceStatus.plugins.sources.errors.duplicate\",\n \"global-only\": \"instanceServiceStatus.plugins.sources.errors.globalOnly\",\n timeout: \"instanceServiceStatus.plugins.sources.errors.timeout\",\n }\n if (error.code && known[error.code]) return known[error.code]!\n if (error.status === 403) return \"instanceServiceStatus.plugins.sources.errors.forbidden\"\n if (error.status === 409) return \"instanceServiceStatus.plugins.sources.errors.conflict\"\n if (error.status === 422) return \"instanceServiceStatus.plugins.sources.errors.invalidConfig\"\n if (error.status === 503) return \"instanceServiceStatus.plugins.sources.errors.unavailable\"\n return \"instanceServiceStatus.plugins.sources.errors.add\"\n}\n","import { For, createSignal } from \"solid-js\"\nimport { DropdownMenu } from \"@kobalte/core/dropdown-menu\"\nimport { Blocks, Package, Plus } from \"lucide-solid\"\nimport type { PluginControlLocation } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { IntegrationCatalogWindow } from \"./integration-catalog-window\"\nimport { PluginSourceAdd } from \"./plugin-source-add\"\n\ntype Item = { kind: \"integration\" | \"plugin\" }\n// Stable descriptors: icons are created by the item renderer, once per rendered item.\nconst ITEMS: readonly Item[] = [{ kind: \"integration\" }, { kind: \"plugin\" }]\n\n/** The Plugins \"+\" menu: \"Add an integration…\" (the reviewed catalogue) and \"Add a plugin…\" (any package). */\nexport function PluginAddMenu(props: {\n instanceId: string\n location: PluginControlLocation\n projectAvailable: boolean\n active?: boolean\n sessionId?: string\n}) {\n const { t } = useI18n()\n const [plugin, setPlugin] = createSignal(false)\n const [catalog, setCatalog] = createSignal(false)\n let trigger: HTMLButtonElement | undefined\n let afterClose: (() => void) | undefined\n const label = (item: Item) => t(item.kind === \"integration\" ? \"integrations.add\" : \"instanceServiceStatus.plugins.sources.addPlugin\")\n return <>\n <DropdownMenu placement=\"bottom-start\" gutter={4}>\n <DropdownMenu.Trigger ref={trigger} type=\"button\" class=\"icon-button-compact\" disabled={props.active === false}\n title={t(\"instanceServiceStatus.plugins.sources.add\")} aria-label={t(\"instanceServiceStatus.plugins.sources.add\")}>\n <Plus class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </DropdownMenu.Trigger>\n <DropdownMenu.Portal>\n <DropdownMenu.Content class=\"action-overflow-content\" onCloseAutoFocus={event => {\n const action = afterClose; afterClose = undefined\n if (!action) return\n // The next window takes focus; never hand it back to the trigger first.\n event.preventDefault()\n queueMicrotask(action)\n }}>\n <For each={ITEMS}>{item => (\n <DropdownMenu.Item class=\"action-overflow-item\" disabled={props.active === false}\n onSelect={() => { afterClose = () => (item.kind === \"integration\" ? setCatalog : setPlugin)(true) }}>\n <span class=\"action-overflow-item-icon\" aria-hidden=\"true\">\n {item.kind === \"integration\" ? <Blocks class=\"h-3.5 w-3.5\" /> : <Package class=\"h-3.5 w-3.5\" />}\n </span>\n <span class=\"action-overflow-item-label\">{label(item)}</span>\n </DropdownMenu.Item>\n )}</For>\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu>\n <PluginSourceAdd instanceId={props.instanceId} location={props.location} projectAvailable={props.projectAvailable} active={props.active}\n open={plugin()} onOpenChange={setPlugin} anchor={() => trigger} />\n <IntegrationCatalogWindow instanceId={props.instanceId} location={props.location} projectAvailable={props.projectAvailable}\n active={props.active} sessionId={props.sessionId} open={catalog()} onClose={() => setCatalog(false)} trigger={() => trigger} />\n </>\n}\n","import { For, Show, createMemo, createSignal, createUniqueId, onCleanup } from \"solid-js\"\nimport type { PluginActivationControl, PluginConfigScope, PluginControlLocation, PluginControlScope, PluginControlsSnapshot, PluginRuntimeInventoryEntry } from \"../../../server/src/api-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { pluginControlsCache } from \"../stores/plugin-controls\"\nimport { InfoPopoverButton } from \"./info-popover-button\"\n\nconst VALUE_PLACEHOLDER = \"\\ufffc\"\nconst isolatedValue = (text: string, value: string) => text.split(VALUE_PLACEHOLDER)\n .flatMap((part, index) => index ? [<bdi>{value}</bdi>, part] : [part])\n\ninterface AttentionEntry {\n key: string\n name: string\n control?: PluginActivationControl\n runtime?: PluginRuntimeInventoryEntry\n}\n\nexport function PluginSystemAttention(props: {\n instanceId: string\n location: PluginControlLocation\n snapshot?: PluginControlsSnapshot\n runtimeUnconfirmed?: ReadonlySet<string>\n active?: boolean\n restoreFocus: () => void\n}) {\n const { t } = useI18n()\n const headingId = `plugin-system-attention-${createUniqueId()}`\n const entries = createMemo(() => {\n const result = new Map<string, AttentionEntry>()\n const represented = new Set<string>()\n const representedRuntimeKeys = new Set<string>()\n for (const control of props.snapshot?.controls ?? []) {\n if (control.managedBy !== \"codenomad\") continue\n if (control.runtime?.source.type === \"package\") represented.add(control.runtime.source.target)\n if (control.runtime?.source.type === \"local\") represented.add(control.runtime.source.path)\n if (control.runtime) representedRuntimeKeys.add(control.runtime.key)\n result.set(`id:${control.id}`, { key: `id:${control.id}`, name: control.id, control, runtime: control.runtime })\n }\n for (const runtime of props.snapshot?.runtime ?? []) {\n if (runtime.managedBy !== \"codenomad\") continue\n if (representedRuntimeKeys.has(runtime.key)) continue\n const name = runtime.id ?? (runtime.source.type === \"package\" ? runtime.source.target : runtime.source.type === \"local\" ? runtime.source.path : runtime.key)\n const key = runtime.id ? `id:${runtime.id}` : `target:${name}`\n if (runtime.source.type === \"package\") represented.add(runtime.source.target)\n if (runtime.source.type === \"local\") represented.add(runtime.source.path)\n if (!result.has(key)) result.set(key, { key, name, runtime })\n }\n for (const source of props.snapshot?.configured.sources ?? []) {\n if (source.managedBy !== \"codenomad\" || represented.has(source.target) || (source.pluginId && result.has(`id:${source.pluginId}`))) continue\n const key = `target:${source.target}`\n result.set(key, { key, name: source.pluginId ?? source.target })\n }\n return new Map([...result].filter(([, entry]) => entry.control?.effective === \"disabled\" || entry.runtime?.state.status !== \"active\" || props.runtimeUnconfirmed?.has(entry.name)))\n })\n const keys = createMemo(() => [...entries().keys()])\n const renderEntry = (key: string) => {\n const entry = () => entries().get(key)\n const [pending, setPending] = createSignal(false)\n const [mutationScope, setMutationScope] = createSignal<PluginControlScope>()\n const [error, setError] = createSignal<string>()\n let row: HTMLDivElement | undefined\n let disposed = false\n const restoreFocus = () => {\n if (props.active === false) return\n requestAnimationFrame(() => {\n if (props.active !== false && document.activeElement === document.body) props.restoreFocus()\n })\n }\n onCleanup(() => {\n disposed = true\n if (row?.contains(document.activeElement)) restoreFocus()\n })\n const disabled = () => entry()?.control?.effective === \"disabled\"\n const scope = (): PluginControlScope | undefined => {\n if (!disabled()) return\n const controlling = entry()?.control?.controllingRule?.scope\n const writable = (value: string | undefined) => props.snapshot?.targets.some(target => target.scope === value)\n if ((controlling === \"global\" || controlling === \"project\") && writable(controlling)) return controlling\n return writable(\"project\") ? \"project\" : undefined\n }\n const scopeLabel = (value: string | undefined) => t(`instanceServiceStatus.plugins.scope.${value ?? \"project\"}`)\n const configurations = createMemo(() => {\n const current = entry(), runtime = current?.runtime?.source\n const target = runtime?.type === \"package\" ? runtime.target : runtime?.type === \"local\" ? runtime.path : undefined\n const sources = props.snapshot?.configured.sources.filter(source => source.managedBy === \"codenomad\" && (\n (source.pluginId && source.pluginId === current?.name) || source.target === target || `target:${source.target}` === key\n )) ?? []\n const rule = current?.control?.controllingRule\n const records: Array<{ scope: PluginConfigScope; path?: string }> = sources.map(source => ({ scope: source.scope, path: source.path ?? source.target }))\n if (rule) {\n const path = rule.path ?? props.snapshot?.targets.find(target => target.scope === rule.scope)?.path\n records.push({ scope: rule.scope, path })\n }\n if (!records.length) {\n const target = props.snapshot?.targets.find(target => target.scope === \"global\") ?? props.snapshot?.targets[0]\n if (target) records.push({ scope: target.scope, path: target.path })\n }\n return [...new Map(records.map(record => [JSON.stringify(record), record])).values()]\n })\n const shownScopes = () => [...new Set(configurations().map(record => scopeLabel(record.scope)))].join(\" / \")\n const label = () => t(`instanceServiceStatus.plugins.system.${disabled() ? \"disabled\" : props.runtimeUnconfirmed?.has(entry()?.name ?? \"\") ? \"unconfirmed\" : entry()?.runtime?.state.status === \"failed\" ? \"failed\" : \"unconfirmed\"}`,\n { name: VALUE_PLACEHOLDER, scope: scopeLabel(entry()?.control?.controllingRule?.scope) })\n const failed = () => {\n const state = entry()?.runtime?.state\n return state?.status === \"failed\" ? state : undefined\n }\n const runtimeDetails = createMemo(() => {\n const source = entry()?.runtime?.source\n return source?.type === \"local\" || source?.type === \"package\"\n ? isolatedValue(t(`instanceServiceStatus.plugins.source.${source.type}`, { source: VALUE_PLACEHOLDER }), source.type === \"local\" ? source.path : source.target)\n : undefined\n })\n const Details = () => {\n let container: HTMLDivElement | undefined\n onCleanup(() => {\n if (!entries().has(key) && container?.closest(\".info-popover-content\")?.contains(document.activeElement)) restoreFocus()\n })\n return <div ref={container} class=\"plugin-system-attention-details\">\n <div><bdi>{entry()?.name}</bdi></div>\n <Show when={runtimeDetails()}>{value => <div>{value()}</div>}</Show>\n <For each={configurations()}>{record => <div>{scopeLabel(record.scope)}<Show when={record.path}>{path => <> — <bdi>{path()}</bdi></>}</Show></div>}</For>\n <Show when={failed()}>{failure => <>\n <div><bdi>{failure().error}</bdi></div>\n <Show when={failure().ref}>{ref => <div>{isolatedValue(t(\"instanceServiceStatus.plugins.sources.failureRef\", { ref: VALUE_PLACEHOLDER }), ref())}</div>}</Show>\n </>}</Show>\n </div>\n }\n const active = () => props.active !== false\n const reenable = async () => {\n const current = entry(), targetScope = scope()\n if (!current?.control || !targetScope || pending() || !active()) return\n const instanceId = props.instanceId, location = { directory: props.location.directory }\n setMutationScope(targetScope)\n setPending(true)\n setError(undefined)\n try {\n await pluginControlsCache.mutate(instanceId, location, current.control.id, targetScope, true)\n } catch {\n if (!disposed && active() && props.instanceId === instanceId && props.location.directory === location.directory) {\n setError(t(\"instanceServiceStatus.plugins.errors.save\", { name: current.name, scope: scopeLabel(targetScope) }))\n }\n } finally {\n if (!disposed) setPending(false)\n }\n }\n const renderAction = () => {\n let button: HTMLButtonElement | undefined\n onCleanup(() => { if (button === document.activeElement) restoreFocus() })\n return <button ref={button} type=\"button\" class=\"window-text-button\" aria-busy={pending()} aria-disabled={pending()}\n aria-label={t(\"instanceServiceStatus.plugins.system.reenableAriaLabel\", { name: entry()?.name ?? \"\", scope: scopeLabel(scope() ?? mutationScope()) })}\n onClick={() => void reenable()}>\n {t(pending() ? \"instanceServiceStatus.plugins.system.reenabling\" : \"instanceServiceStatus.plugins.system.reenable\")}\n </button>\n }\n return <div ref={row} class=\"plugin-system-attention-entry\" data-system-plugin={key}>\n <div class=\"plugin-system-attention-row\">\n <span class=\"plugin-system-attention-label\">{isolatedValue(label(), entry()?.name ?? \"\")}</span>\n <Show when={!disabled() || (scope() && scope() !== entry()?.control?.controllingRule?.scope)}>\n <span class=\"plugin-system-attention-scope\">{disabled() ? scopeLabel(scope()) : shownScopes()}</span>\n </Show>\n <InfoPopoverButton label={t(\"instanceServiceStatus.plugins.system.details\", { name: entry()?.name ?? \"\" })}>\n <Details />\n </InfoPopoverButton>\n <Show when={scope() || pending()}>{(_scope) => renderAction()}</Show>\n </div>\n <Show when={error()}><span role=\"alert\">{error()}</span></Show>\n </div>\n }\n return <Show when={keys().length > 0}>\n <div class=\"plugin-system-attention\" role=\"status\" aria-live=\"polite\" aria-labelledby={headingId}>\n <div id={headingId} class=\"plugin-system-attention-heading\">{t(\"instanceServiceStatus.plugins.system.attention\")}</div>\n <For each={keys()}>{renderEntry}</For>\n </div>\n </Show>\n}\n","import type { WorkspaceEventPayload } from \"../../../server/src/api-types\"\nimport { serverEvents } from \"../lib/server-events\"\nimport { pluginControlsCache } from \"./plugin-controls\"\nimport { pluginSourcesStore } from \"./plugin-sources\"\n\ntype InstanceEvent = Extract<WorkspaceEventPayload, { type: \"instance.event\" }>\n\nserverEvents.on(\"instance.event\", (event) => {\n const payload = event as InstanceEvent\n if (payload.event.type !== \"config.updated\" && payload.event.type !== \"plugin.updated\") return\n if (payload.event.type === \"config.updated\") {\n // A config event does not identify whether its changed document was global.\n // Mark every worktree snapshot stale, but let visible consumers demand reads.\n pluginControlsCache.invalidateInstance(payload.instanceId)\n return\n }\n const directory = payload.event.location?.directory\n if (directory) {\n pluginControlsCache.invalidateLocation(payload.instanceId, { directory })\n return\n }\n pluginControlsCache.invalidateInstance(payload.instanceId)\n})\n\nserverEvents.on(\"instance.eventStatus\", (event) => {\n if (event.type === \"instance.eventStatus\" && event.status === \"connected\") {\n pluginControlsCache.invalidateInstance(event.instanceId)\n }\n})\n\n// Renderer-to-backend reconnects are independent of the native subscription.\n// The event transport has no replay; visible demand reconciles these snapshots,\n// while hidden worktrees remain stale until their next activation.\nserverEvents.onOpen(() => pluginControlsCache.invalidateAll())\n\nserverEvents.on(\"workspace.stopped\", (event) => {\n if (event.type !== \"workspace.stopped\") return\n pluginControlsCache.clearInstance(event.workspaceId)\n pluginSourcesStore.clearInstance(event.workspaceId)\n})\n","import { For, Show, createEffect, createMemo, createUniqueId, onCleanup, type Component } from \"solid-js\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport { Loader2, RefreshCw } from \"lucide-solid\"\nimport type {\n PluginConfiguredSource,\n PluginControlLocation,\n PluginControlScope,\n PluginRuntimeInventoryEntry,\n PluginRuntimeSource,\n} from \"../../../server/src/api-types\"\nimport type { IntegrationView } from \"../../../server/src/integration-types\"\nimport { useI18n } from \"../lib/i18n\"\nimport { integrationAttention, integrationConnection, integrationConnectionMessage } from \"../lib/integration-row-state\"\nimport { integrationDisplayPlugin } from \"../lib/integration-rows\"\nimport { integrationBindings, integrations } from \"../stores/integrations\"\nimport { pluginControlsCache } from \"../stores/plugin-controls\"\nimport { pluginSourcesStore, removableSources } from \"../stores/plugin-sources\"\nimport { createIntegrationHostInstallation } from \"./integration-host-installation\"\nimport { createIntegrationRowBinding } from \"./integration-row-binding\"\nimport { IntegrationAttentionIndicator, IntegrationLinkButton } from \"./integration-row-indicators\"\nimport { PluginActivationSwitch } from \"./plugin-activation-switch\"\nimport { PluginRowActions } from \"./plugin-row-actions\"\nimport { PluginAddMenu } from \"./plugin-add-menu\"\nimport { PluginSystemAttention } from \"./plugin-system-attention\"\nimport \"../stores/plugin-controls-events\"\n\ninterface PluginActivationControlsProps {\n instanceId: string\n location: PluginControlLocation\n active?: boolean\n session?: { id: string; title?: string; metadata?: Record<string, unknown> }\n}\n\nexport const PluginActivationControls: Component<PluginActivationControlsProps> = (props) => {\n const { t } = useI18n()\n const headingId = `plugin-controls-${createUniqueId()}`\n const noticeId = `${headingId}-notice`\n const globalLabelId = `plugin-controls-${createUniqueId()}-global`\n const projectLabelId = `plugin-controls-${createUniqueId()}-project`\n const directory = createMemo(() => props.location.directory)\n createEffect(() => {\n const instanceId = props.instanceId, location = directory()\n if (props.active === false || !location) return\n onCleanup(integrations.demand(instanceId, location))\n })\n // A source that designates an ambiguous integration belongs to none: its row says so.\n const nonConforming = (sources: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[]) => {\n const value = integrations.state(props.instanceId, directory())\n return value.status === \"ready\" && sourcesOverlap(value.response.ambiguousSources ?? [], sources)\n }\n const nonConformingLabel = (sources: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[]) => (\n <Show when={nonConforming(sources)}>\n <span class=\"integration-state-badge badge-shape\" data-integration-state=\"nonConforming\">{t(\"integrations.state.nonConforming\")}</span>\n </Show>\n )\n let cachedLocation: PluginControlLocation | undefined\n const requestLocation = (): PluginControlLocation => {\n if (!cachedLocation || cachedLocation.directory !== directory()) {\n cachedLocation = { directory: directory() }\n }\n return cachedLocation\n }\n const state = createMemo(() => pluginControlsCache.state(props.instanceId, requestLocation()))\n const consentEpoch = () => state().invalidationRevision\n const snapshot = createMemo(() => state().snapshot)\n let refreshButton: HTMLButtonElement | undefined\n // Recognised integrations by the plugin ID or the declared target of their row; an ambiguous one has no row of its own.\n const recognised = createMemo(() => {\n const value = integrations.state(props.instanceId, directory())\n const byControl = new Map<string, IntegrationView>(), byTarget = new Map<string, IntegrationView>()\n for (const entry of value.status === \"ready\" ? value.response.integrations : []) {\n if (entry.ambiguous) continue\n const plugin = integrationDisplayPlugin(snapshot(), entry)\n if (plugin.control) byControl.set(plugin.control.id, entry)\n for (const source of plugin.sources) byTarget.set(source.target, entry)\n }\n return { byControl, byTarget }\n })\n // Fresh reads only: installing an application part needs a current status.\n const freshIntegrations = () => {\n const value = integrations.state(props.instanceId, directory())\n return value.status === \"ready\" && !value.stale ? value.response.integrations : []\n }\n const installation = createIntegrationHostInstallation({\n get instanceId() { return props.instanceId },\n get directory() { return directory() },\n get sessionId() { return props.session?.id },\n get active() { return props.active },\n entries: freshIntegrations,\n })\n const controls = createMemo(() => (\n snapshot()?.controls.filter((control) => control.managedBy !== \"codenomad\" && !control.builtin && control.runtime?.source.type !== \"builtin\") ?? []\n ))\n const controlsById = createMemo(() => new Map(controls().map((control) => [control.id, control])))\n const controlIds = createMemo(() => [...controlsById().keys()])\n // A source can fail before exporting a plugin ID. Keep its native target\n // actionable without inventing an ID that could become an activation rule.\n const runtimesByTarget = createMemo(() => {\n const represented = new Set(controls().flatMap(control =>\n control.runtime?.source.type === \"package\" ? [control.runtime.source.target]\n : control.runtime?.source.type === \"local\" ? [control.runtime.source.path] : []))\n const entries = new Map<string, PluginRuntimeInventoryEntry>()\n for (const entry of snapshot()?.runtime ?? []) {\n if (entry.managedBy === \"codenomad\") continue\n const target = entry.source.type === \"package\" ? entry.source.target\n : entry.source.type === \"local\" && entry.state.status === \"failed\" ? entry.source.path : undefined\n if (!target || represented.has(target)) continue\n if (!entries.has(target)) entries.set(target, entry)\n }\n return entries\n })\n const runtimeTargets = createMemo(() => [...runtimesByTarget().keys()])\n // Declarations and just-added specs the inventory does not report yet: installing,\n // disabled, or never confirmed. Their rows carry no switch (no plugin ID is known).\n const sourceTargets = createMemo(() => {\n const loaded = new Set((snapshot()?.runtime ?? []).flatMap(entry => entry.source.type === \"package\" ? [entry.source.target]\n : entry.source.type === \"local\" ? [entry.source.path] : []))\n const targets = new Set<string>()\n const configured = new Set<string>()\n for (const source of snapshot()?.configured.sources ?? []) {\n configured.add(source.target)\n if (source.managedBy === \"codenomad\") continue\n if (!source.pluginId && !loaded.has(source.target)) targets.add(source.target)\n }\n // An added spec removed elsewhere stops being shown once its pending window closes.\n for (const added of pluginSourcesStore.addedSpecs(props.instanceId, requestLocation())) {\n if (snapshot()?.configured.sources.some(source => source.target === added.spec && source.managedBy === \"codenomad\")) continue\n if (loaded.has(added.spec)) continue\n if (configured.has(added.spec) || pluginSourcesStore.state(props.instanceId, requestLocation(), added.spec) === \"pending\") targets.add(added.spec)\n }\n return [...targets]\n })\n const projectAvailable = () => snapshot()?.targets.some((target) => target.scope === \"project\") === true\n createEffect(() => {\n const instanceId = props.instanceId\n const location = requestLocation()\n if (props.active === false) return\n onCleanup(pluginControlsCache.acquireDemand(instanceId, location))\n })\n\n const bidi = (text: string): string => `⁨${text}⁩`\n\n const sourceLabel = (source: PluginRuntimeSource): string => {\n if (source.type === \"package\") return t(\"instanceServiceStatus.plugins.source.package\", { source: source.target })\n if (source.type === \"local\") return t(\"instanceServiceStatus.plugins.source.local\", { source: source.path })\n if (source.type === \"builtin\") return t(\"instanceServiceStatus.plugins.source.builtin\")\n return t(\"instanceServiceStatus.plugins.source.sdk\")\n }\n\n // Version, update availability, failure and its native log reference, for any plugin row.\n const runtimeLines = (entry: PluginRuntimeInventoryEntry | undefined): string[] => {\n if (!entry) return []\n const lines = [sourceLabel(entry.source)]\n if (entry.source.type === \"package\" && entry.source.version) {\n lines.push(t(\"instanceServiceStatus.plugins.sources.version\", { version: entry.source.version }))\n }\n if (entry.source.type === \"package\" && entry.source.outdated) lines.push(t(\"instanceServiceStatus.plugins.sources.outdated\"))\n if (entry.state.status === \"failed\") {\n lines.push(`${t(\"instanceServiceStatus.plugins.runtime.failed\")} — ${entry.state.error}`)\n if (entry.state.ref) lines.push(t(\"instanceServiceStatus.plugins.sources.failureRef\", { ref: entry.state.ref }))\n }\n return lines\n }\n\n // A desktop-app (GUI) package loads those parts only from Global configuration.\n const guiNotice = (entry: PluginRuntimeInventoryEntry | undefined, declaredIn: readonly { scope: string }[]): string[] => (\n entry?.features.gui && declaredIn.some(source => source.scope !== \"global\")\n ? [t(\"instanceServiceStatus.plugins.sources.guiGlobalOnly\")] : []\n )\n\n const declarationsFor = (matches: (source: PluginConfiguredSource) => boolean) => (\n snapshot()?.configured.sources.filter(matches) ?? []\n )\n const refresh = () => {\n if (props.active === false) return\n void pluginControlsCache.load(props.instanceId, requestLocation(), { force: true })\n void integrations.refreshDemanded(props.instanceId)\n if (props.session) void integrationBindings.refreshDemanded({\n instanceId: props.instanceId, directory: directory(), sessionID: props.session.id,\n })\n }\n\n const renderControl = (pluginId: string) => {\n // Key rows by ID, but read every displayed value from the current snapshot.\n // Passive refreshes must not replace the focused row's DOM.\n const control = createMemo(() => controlsById().get(pluginId))\n const failed = () => control()?.runtime?.state.status === \"failed\"\n const overridden = () => Boolean(control() && control()?.project !== \"default\")\n const isAvailable = (scope: PluginControlScope): boolean =>\n snapshot()?.targets.some((target) => target.scope === scope) === true\n const matchesControl = (source: PluginConfiguredSource) => {\n const runtime = control()?.runtime?.source\n return source.pluginId === pluginId || (runtime?.type === \"package\" && runtime.target === source.target)\n }\n const removable = createMemo(() => removableSources(snapshot(), matchesControl), [], {\n equals: (left, right) => left.length === right.length && left.every((source, index) => sameSource(source, right[index]!)),\n })\n const integration = () => recognised().byControl.get(pluginId)\n const name = () => integration()?.displayName ?? pluginId\n const version = () => {\n const source = control()?.runtime?.source\n return integration()?.version ?? (source?.type === \"package\" ? source.version : undefined)\n }\n const binding = createIntegrationRowBinding({\n instanceId: () => props.instanceId, directory, sessionId: () => props.session?.id, integration, active: () => props.active !== false,\n })\n const attention = () => { const entry = integration(); return entry ? integrationAttention(entry) : undefined }\n const connection = () => {\n const entry = integration()\n if (!entry) return undefined\n const [key, vars] = integrationConnectionMessage(integrationConnection(entry), entry.app.name)\n return t(key, vars)\n }\n const hostAction = createMemo(() => {\n const entry = integration(), action = entry ? installation.action(entry.id) : undefined\n return entry && action ? { action, run: () => void installation.open(entry.id) } : undefined\n }, undefined, { equals: (left, right) => left?.action === right?.action })\n const detach = () => binding.link()?.state === \"attached\" ? { run: () => void binding.detach(), busy: binding.busy() } : undefined\n const details = () => {\n const current = control(), entry = integration()\n const lines = [t(`instanceServiceStatus.plugins.kind.${entry ? \"integration\" : \"plugin\"}`, { id: pluginId }),\n ...runtimeLines(current?.runtime), ...guiNotice(current?.runtime, declarationsFor(matchesControl))]\n const part = entry?.status?.host?.partVersion\n if (entry && part) lines.push(t(\"integrations.partVersion\", { app: entry.app.name, version: part }))\n if (!failed() && overridden()) lines.push(t(\"instanceServiceStatus.plugins.globalOverridden\"))\n for (const target of snapshot()?.targets ?? []) {\n lines.push(`${scopeLabel(target.scope)} — ${target.path}`)\n }\n if (!isAvailable(\"project\")) lines.push(t(\"instanceServiceStatus.plugins.scope.unavailable\"))\n if (state().error) lines.push(t(\"instanceServiceStatus.plugins.errors.refresh\"))\n return lines.map(bidi).join(\"\\n\")\n }\n const renderSwitch = (scope: PluginControlScope) => {\n const labelId = scope === \"global\" ? globalLabelId : projectLabelId\n return <PluginActivationSwitch instanceId={props.instanceId} location={requestLocation()} control={control()} scope={scope}\n lockedReason={scope === \"project\" && integration()?.family === \"native\" ? t(\"integrations.section.scopeGlobalOnly\") : undefined}\n available={isAvailable(scope)} active={props.active} describedBy={isAvailable(scope) ? labelId : `${labelId} ${noticeId}`}\n integration={Boolean(integration())} name={name()}\n label={bidi(t(\"instanceServiceStatus.plugins.toggleAriaLabel\", { name: `${name()} — ${scopeLabel(scope)}` }))} />\n }\n const nameId = `${headingId}-name-${pluginId}`\n return (\n <div class=\"plugin-control-row\" data-plugin-id={pluginId} data-integration={integration()?.id} role=\"group\" aria-labelledby={nameId}>\n <div class=\"plugin-control-identity\"><span class=\"plugin-control-title\"><Tooltip placement=\"top-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" id={nameId} class=\"plugin-control-name\"><bdi>{name()}</bdi></Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\">{details()}</Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip>\n <Show when={version()}>{value => <span class=\"plugin-control-version\"><bdi>{value()}</bdi></span>}</Show></span>\n <Show when={binding.link()}><IntegrationLinkButton binding={binding} /></Show>\n <Show when={attention()}>{value => <IntegrationAttentionIndicator attention={value()} app={integration()!.app.name} />}</Show>\n {nonConformingLabel(declarationsFor(matchesControl))}<PluginRowActions instanceId={props.instanceId} location={requestLocation()} name={name()}\n source={control()?.runtime?.source} removable={removable()} refresh={refresh} active={props.active} consentEpoch={consentEpoch()} sessionId={props.session?.id}\n info={connection()} hostAction={hostAction()} detach={detach()} /></div>\n {renderSwitch(\"global\")}\n {renderSwitch(\"project\")}\n </div>\n )\n }\n\n const removableFor = (target: string) => createMemo(() => removableSources(snapshot(), source => source.target === target), [], {\n equals: (left, right) => left.length === right.length && left.every((source, index) => sameSource(source, right[index]!)),\n })\n\n const renderRuntime = (target: string) => {\n const entry = () => runtimesByTarget().get(target)\n const nameId = createUniqueId()\n const removable = removableFor(target)\n const integration = () => recognised().byTarget.get(target)\n const packageVersion = () => { const source = entry()?.source; return source?.type === \"package\" ? source.version : undefined }\n const details = () => {\n const current = entry()\n const lines = current ? runtimeLines(current) : [target]\n if (integration()) lines.unshift(t(\"instanceServiceStatus.plugins.kind.integration\", { id: integration()!.displayName }))\n lines.push(...guiNotice(current, declarationsFor(source => source.target === target)))\n return lines.map(bidi).join(\"\\n\")\n }\n return <div class=\"plugin-control-row\" data-package-target={entry()?.source.type === \"package\" ? target : undefined}\n data-local-path={entry()?.source.type === \"local\" ? target : undefined} data-integration={integration()?.id} role=\"group\" aria-labelledby={nameId}>\n <div class=\"plugin-control-identity\">\n <span class=\"plugin-control-title\"><Tooltip placement=\"top-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" id={nameId} class=\"plugin-control-name\"><bdi>{integration()?.displayName ?? target}</bdi></Tooltip.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\">{details()}</Tooltip.Content></Tooltip.Portal>\n </Tooltip>\n <Show when={packageVersion()}>{value => <span class=\"plugin-control-version\"><bdi>{value()}</bdi></span>}</Show></span>\n {nonConformingLabel(declarationsFor(source => source.target === target))}\n <PluginRowActions instanceId={props.instanceId} location={requestLocation()} name={target} source={entry()?.source}\n removable={removable()} refresh={refresh} active={props.active} consentEpoch={consentEpoch()} sessionId={props.session?.id} />\n </div>\n </div>\n }\n\n // Configured or just-added sources absent from the inventory. Pending rows stay busy until\n // `plugin.list` reports the target (it then becomes an ordinary row) or the window closes.\n const renderSource = (target: string) => {\n const nameId = createUniqueId()\n const removable = removableFor(target)\n const state = () => pluginSourcesStore.state(props.instanceId, requestLocation(), target)\n const integration = () => recognised().byTarget.get(target)\n const details = () => [\n ...(integration() ? [t(\"instanceServiceStatus.plugins.kind.integration\", { id: integration()!.displayName })] : []),\n t(\"instanceServiceStatus.plugins.source.package\", { source: target }),\n t(state() === \"pending\" ? \"instanceServiceStatus.plugins.sources.pending\" : \"instanceServiceStatus.plugins.sources.unconfirmed\"),\n ...declarationsFor(source => source.target === target).map(source => source.scope === \"global\" || source.scope === \"project\"\n ? `${scopeLabel(source.scope)} — ${source.path ?? \"\"}` : source.path ?? \"\"),\n ].map(bidi).join(\"\\n\")\n return <div class=\"plugin-control-row\" data-source-target={target} data-source-state={state()} data-integration={integration()?.id}\n role=\"group\" aria-labelledby={nameId} aria-busy={state() === \"pending\"}>\n <div class=\"plugin-control-identity\">\n <span class=\"plugin-control-title\"><Tooltip placement=\"top-start\" openDelay={300}>\n <Tooltip.Trigger as=\"span\" tabindex=\"0\" id={nameId} class=\"plugin-control-name\"><bdi>{integration()?.displayName ?? target}</bdi></Tooltip.Trigger>\n <Tooltip.Portal><Tooltip.Content class=\"section-info-tooltip plugin-control-tooltip\">{details()}</Tooltip.Content></Tooltip.Portal>\n </Tooltip></span>\n <Show when={state() === \"pending\"} fallback={<span class=\"plugin-source-state\" role=\"status\">{t(\"instanceServiceStatus.plugins.sources.unconfirmedLabel\")}</span>}>\n <span class=\"plugin-source-state\" role=\"status\">\n <Loader2 class=\"h-3 w-3 animate-spin\" aria-hidden=\"true\" />{t(\"instanceServiceStatus.plugins.sources.pendingLabel\")}\n </span>\n </Show>\n {nonConformingLabel(declarationsFor(source => source.target === target))}\n <PluginRowActions instanceId={props.instanceId} location={requestLocation()} name={target} removable={removable()}\n refresh={state() === \"unconfirmed\" ? refresh : undefined} active={props.active} consentEpoch={consentEpoch()} sessionId={props.session?.id} />\n </div>\n </div>\n }\n\n return (\n <section\n class=\"plugin-controls\"\n aria-label={t(\"instanceServiceStatus.sections.plugins\")}\n >\n <Show when={snapshot() && !snapshot()?.targets.some((target) => target.scope === \"project\")}>\n <span id={noticeId} class=\"sr-only\">{t(\"instanceServiceStatus.plugins.scope.unavailable\")}</span>\n </Show>\n <PluginSystemAttention instanceId={props.instanceId} location={requestLocation()} snapshot={snapshot()} active={props.active}\n runtimeUnconfirmed={state().runtimeUnconfirmed}\n restoreFocus={() => refreshButton?.focus()} />\n <div class=\"plugin-controls-header\">\n <div class=\"plugin-controls-header-actions\">\n <button\n ref={refreshButton}\n type=\"button\"\n class=\"icon-button-compact\"\n data-plugin-refresh\n title={t(\"instanceServiceStatus.plugins.refresh\")}\n aria-label={t(\"instanceServiceStatus.plugins.refresh\")}\n aria-busy={state().loading || state().refreshing}\n disabled={state().loading || state().refreshing}\n onClick={refresh}\n >\n <RefreshCw class=\"h-3.5 w-3.5\" classList={{ \"animate-spin\": state().loading || state().refreshing }} aria-hidden=\"true\" />\n </button>\n <Show when={snapshot()}>\n <PluginAddMenu instanceId={props.instanceId} location={requestLocation()} sessionId={props.session?.id} projectAvailable={projectAvailable()} active={props.active} />\n </Show>\n </div>\n <span id={globalLabelId} class=\"plugin-control-scope-label\">{scopeLabel(\"global\")}</span>\n <span id={projectLabelId} class=\"plugin-control-scope-label\">{scopeLabel(\"project\")}</span>\n </div>\n\n <Show when={snapshot()} fallback={\n <div class=\"right-panel-empty-text\" role=\"status\">\n <p>{state().loading\n ? t(\"instanceServiceStatus.plugins.loading\")\n : state().error\n ? t(\"instanceServiceStatus.plugins.errors.load\")\n : t(\"instanceServiceStatus.plugins.loading\")}</p>\n </div>\n }>\n <Show when={controlIds().length + runtimeTargets().length + sourceTargets().length > 0} fallback={<p class=\"right-panel-empty-text\">{t(\"instanceServiceStatus.plugins.empty\")}</p>}>\n <div class=\"plugin-control-list\">\n <For each={controlIds()}>{renderControl}</For>\n <For each={runtimeTargets()}>{renderRuntime}</For>\n <For each={sourceTargets()}>{renderSource}</For>\n </div>\n </Show>\n </Show>\n </section>\n )\n\n function scopeLabel(value: PluginControlScope): string {\n return t(`instanceServiceStatus.plugins.scope.${value}`)\n }\n\n}\n\nfunction sourcesOverlap(left: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[], right: readonly Pick<PluginConfiguredSource, \"scope\" | \"entryIndex\">[]): boolean {\n return left.some(source => right.some(other => other.scope === source.scope && other.entryIndex === source.entryIndex))\n}\n\nexport function sameSource(left: PluginConfiguredSource, right: PluginConfiguredSource): boolean {\n return left.scope === right.scope && left.target === right.target && left.entryIndex === right.entryIndex && left.path === right.path && left.expectedRevision === right.expectedRevision\n}\n","import { createMemo } from \"solid-js\"\nimport { getActiveCatalogLocation } from \"../stores/sessions\"\nimport { activeSessionId, sessions } from \"../stores/session-state\"\n\n/**\n * The Location the Plugins and integration surfaces of an instance manage (its active catalog Location, else its\n * folder) and the displayed conversation, only when that conversation belongs to this Location.\n */\nexport function createIntegrationContext(instanceId: () => string, folder: () => string) {\n const location = createMemo(() => getActiveCatalogLocation(instanceId()) ?? { directory: folder() })\n const session = createMemo(() => {\n const id = activeSessionId().get(instanceId())\n const session = id ? sessions().get(instanceId())?.get(id) : undefined\n return session?.location.directory === location().directory ? session : undefined\n })\n return { location, session }\n}\n","import { For, Show, createMemo, createSignal, type Component } from \"solid-js\"\nimport Switch from \"@suid/material/Switch\"\nimport type { Instance, RawMcpStatus } from \"../types/instance\"\nimport { useOptionalInstanceMetadataContext } from \"../lib/contexts/instance-metadata-context\"\nimport { useI18n } from \"../lib/i18n\"\nimport { getLogger } from \"../lib/logger\"\nimport { PluginActivationControls } from \"./plugin-activation-controls\"\nimport { createIntegrationContext } from \"./integration-context\"\n\nconst log = getLogger(\"session\")\n\ntype ServiceSection = \"mcp\" | \"plugins\"\n\ninterface InstanceServiceStatusProps {\n sections?: ServiceSection[]\n showSectionHeadings?: boolean\n pluginsActive?: boolean\n class?: string\n initialInstance?: Instance\n}\n\ntype ParsedMcpStatus = {\n name: string\n status: \"running\" | \"stopped\" | \"error\"\n error?: string\n}\n\nfunction parseMcpStatus(status?: RawMcpStatus): ParsedMcpStatus[] {\n if (!status) return []\n return status.data.map((server) => {\n const rawStatus = server.status.status\n let mapped: ParsedMcpStatus[\"status\"]\n if (rawStatus === \"connected\") mapped = \"running\"\n else if (rawStatus === \"failed\") mapped = \"error\"\n else mapped = \"stopped\"\n return {\n name: server.name,\n status: mapped,\n error: server.status.status === \"failed\" ? server.status.error : undefined,\n }\n })\n}\n\nconst InstanceServiceStatus: Component<InstanceServiceStatusProps> = (props) => {\n const { t } = useI18n()\n const metadataContext = useOptionalInstanceMetadataContext()\n const instance = metadataContext?.instance ?? (() => {\n if (props.initialInstance) {\n return props.initialInstance\n }\n throw new Error(\"InstanceServiceStatus requires InstanceMetadataProvider or initialInstance prop\")\n })\n const isLoading = metadataContext?.isLoading ?? (() => false)\n const refreshMetadata = metadataContext?.refreshMetadata ?? (async () => Promise.resolve())\n const sections = createMemo<ServiceSection[]>(() => props.sections ?? [\"mcp\", \"plugins\"])\n const includeMcp = createMemo(() => sections().includes(\"mcp\"))\n const includePlugins = createMemo(() => sections().includes(\"plugins\"))\n const showHeadings = () => props.showSectionHeadings !== false\n\n const metadataAccessor = metadataContext?.metadata ?? (() => instance().metadata)\n const metadata = createMemo(() => metadataAccessor())\n const hasMcpMetadata = () => metadata()?.mcpStatus !== undefined\n\n const mcpServers = createMemo(() => parseMcpStatus(metadata()?.mcpStatus ?? undefined))\n\n const isMcpLoading = () => isLoading() || !hasMcpMetadata()\n const { location: pluginLocation, session: attachmentSession } = createIntegrationContext(() => instance().id, () => instance().folder)\n\n\n const [pendingMcpActions, setPendingMcpActions] = createSignal<Record<string, \"connect\" | \"disconnect\">>({})\n\n const setPendingMcpAction = (name: string, action?: \"connect\" | \"disconnect\") => {\n setPendingMcpActions((prev) => {\n const next = { ...prev }\n if (action) next[name] = action\n else delete next[name]\n return next\n })\n }\n\n const toggleMcpServer = async (serverName: string, shouldEnable: boolean) => {\n const client = instance().client\n if (!client?.mcp) return\n const action: \"connect\" | \"disconnect\" = shouldEnable ? \"connect\" : \"disconnect\"\n setPendingMcpAction(serverName, action)\n try {\n const resolved = metadata()?.mcpStatus?.location\n const location = resolved\n ? { directory: resolved.directory }\n : { directory: instance().folder }\n if (shouldEnable) {\n await client.mcp.connect({ server: serverName, location })\n } else {\n await client.mcp.disconnect({ server: serverName, location })\n }\n await refreshMetadata()\n } catch (error) {\n log.error(\"Failed to toggle MCP server\", { serverName, action, error })\n } finally {\n setPendingMcpAction(serverName)\n }\n }\n\n const renderEmptyState = (message: string) => (\n <p class=\"right-panel-empty-text\" role=\"status\">\n {message}\n </p>\n )\n\n const renderMcpSection = () => (\n <section class=\"space-y-1.5\">\n <Show when={showHeadings()}>\n <div class=\"text-xs font-medium text-muted uppercase tracking-wide\">\n {t(\"instanceServiceStatus.sections.mcp\")}\n </div>\n </Show>\n <Show\n when={!isMcpLoading() && mcpServers().length > 0}\n fallback={renderEmptyState(isMcpLoading() ? t(\"instanceServiceStatus.mcp.loading\") : t(\"instanceServiceStatus.mcp.empty\"))}\n >\n <div class=\"space-y-1.5\">\n <For each={mcpServers()}>\n {(server) => {\n const pendingAction = () => pendingMcpActions()[server.name]\n const isPending = () => Boolean(pendingAction())\n const isRunning = () => server.status === \"running\"\n const switchDisabled = () => isPending() || !instance().client\n const statusDotClass = () => {\n if (isPending()) return \"status-dot animate-pulse\"\n // A connected server is idle; only pending operations need motion.\n if (server.status === \"running\") return \"status-dot ready\"\n if (server.status === \"error\") return \"status-dot error\"\n return \"status-dot stopped\"\n }\n const statusDotStyle = () => (isPending() ? { background: \"var(--status-warning)\" } : undefined)\n return (\n <div class=\"px-2 py-1.5 border bg-surface-secondary border-base\">\n <div class=\"flex items-center justify-between gap-2\">\n <span class=\"text-xs text-primary font-medium truncate\">{server.name}</span>\n <div class=\"flex items-center gap-3 flex-shrink-0\">\n <div class=\"flex items-center gap-1.5 text-xs text-secondary\">\n <Show when={isPending()}>\n <svg class=\"animate-spin h-3 w-3\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\" />\n <path\n class=\"opacity-75\"\n fill=\"currentColor\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n />\n </svg>\n </Show>\n <div class={statusDotClass()} style={statusDotStyle()} />\n </div>\n <div class=\"flex items-center gap-1.5\">\n <Switch\n checked={isRunning()}\n disabled={switchDisabled()}\n color=\"success\"\n size=\"small\"\n inputProps={{ \"aria-label\": t(\"instanceServiceStatus.mcp.toggleAriaLabel\", { name: server.name }) }}\n onChange={(_, checked) => {\n if (switchDisabled()) return\n void toggleMcpServer(server.name, Boolean(checked))\n }}\n />\n </div>\n </div>\n\n </div>\n <Show when={server.error}>\n {(error) => (\n <div class=\"text-[11px] mt-1 break-words\" style={{ color: \"var(--status-error)\" }}>\n {error()}\n </div>\n )}\n </Show>\n </div>\n )\n }}\n </For>\n </div>\n </Show>\n </section>\n )\n\n return (\n <div class={props.class}>\n <Show when={includeMcp()}>{renderMcpSection()}</Show>\n <Show when={includePlugins()}>\n <Show when={props.pluginsActive !== false}>\n <PluginActivationControls\n instanceId={instance().id}\n location={pluginLocation()}\n active={props.pluginsActive}\n session={attachmentSession()}\n />\n </Show>\n </Show>\n </div>\n )\n}\n\nexport default InstanceServiceStatus\n","import { createSignal, untrack } from \"solid-js\"\nimport type { OpenCodeClient, ShellInfo } from \"@opencode/client\"\nimport { requestLocationOptions } from \"./request-locations\"\n\nconst MAX_SHELL_OUTPUT_DISPLAY_CHARS = 4 * 1024 * 1024\n\nexport function appendShellOutput(current: string, chunk: string): { output: string; truncated: boolean } {\n const output = current + chunk\n if (output.length <= MAX_SHELL_OUTPUT_DISPLAY_CHARS) return { output, truncated: false }\n\n let start = output.length - MAX_SHELL_OUTPUT_DISPLAY_CHARS\n if (output.charCodeAt(start) >= 0xdc00 && output.charCodeAt(start) <= 0xdfff) start += 1\n if (output[start] === \"\\u001b\" && output[start + 1] === \"\\\\\") start += 2\n else if (output[start] === \"\\\\\" && output[start - 1] === \"\\u001b\") start += 1\n const escape = output.lastIndexOf(\"\\u001b\", start)\n if (escape >= 0) {\n let end = -1\n let controlSequence = false\n if (output[escape + 1] === \"[\") {\n controlSequence = true\n for (let index = escape + 2; index < output.length; index += 1) {\n const code = output.charCodeAt(index)\n if (code === 0x18 || code === 0x1a) {\n end = index + 1\n break\n }\n if (code >= 0x40 && code <= 0x7e) {\n end = index + 1\n break\n }\n }\n } else if (output[escape + 1] === \"]\") {\n controlSequence = true\n const bell = output.indexOf(\"\\u0007\", escape + 2)\n const stringTerminator = output.indexOf(\"\\u001b\\\\\", escape + 2)\n const cancel = output.slice(escape + 2).search(/[\\u0018\\u001a]/)\n const terminators = [bell < 0 ? Infinity : bell + 1, stringTerminator < 0 ? Infinity : stringTerminator + 2, cancel < 0 ? Infinity : escape + 3 + cancel]\n end = Math.min(...terminators)\n if (!Number.isFinite(end)) end = -1\n } else if ([\"P\", \"X\", \"^\", \"_\"].includes(output[escape + 1] ?? \"\")) {\n controlSequence = true\n const stringTerminator = output.indexOf(\"\\u001b\\\\\", escape + 2)\n const cancel = output.slice(escape + 2).search(/[\\u0018\\u001a]/)\n end = Math.min(stringTerminator < 0 ? Infinity : stringTerminator + 2, cancel < 0 ? Infinity : escape + 3 + cancel)\n if (!Number.isFinite(end)) end = -1\n }\n if (controlSequence && end >= start) start = end\n else if (controlSequence && end < 0 && escape < start) start = output.length\n }\n return { output: output.slice(start), truncated: true }\n}\n\nexport interface ShellApi {\n list(directory: string, workspaceID?: string): Promise<{ data: ShellInfo[]; location?: { directory: string } }>\n remove(directory: string, shellId: string, workspaceID?: string): Promise<void>\n output(directory: string, shellId: string, cursor?: number, workspaceID?: string): Promise<{ output: string; cursor: number; size: number; truncated: boolean }>\n}\n\nexport interface ShellState {\n items: ShellInfo[]\n nativeDirectory?: string\n loading: boolean\n failed: boolean\n}\n\nexport interface ShellRefreshEvent {\n type: string\n location?: { directory?: string; workspaceID?: string }\n data?: { info?: { cwd?: string } }\n}\n\nconst EMPTY_STATE: ShellState = { items: [], loading: false, failed: false }\n// Creation precedes background admission; the tool's terminal event confirms it.\nconst SHELL_EVENTS = new Set([\"shell.created\", \"shell.exited\", \"shell.deleted\", \"session.tool.success\", \"session.tool.failed\", \"server.connected\"])\n\nexport function createShellApi(client: OpenCodeClient, listBackground?: ShellApi[\"list\"]): ShellApi {\n const location = (directory: string) => ({ directory })\n return {\n list: listBackground ?? ((directory, workspaceID) => client.shell.list({ location: location(directory) }, requestLocationOptions({ directory, workspaceID }))),\n remove: (directory, shellId, workspaceID) => client.shell.remove({ id: shellId, location: location(directory) }, requestLocationOptions({ directory, workspaceID })),\n output: async (directory, shellId, cursor = 0, workspaceID) => (await client.shell.output({\n id: shellId,\n location: location(directory),\n cursor,\n limit: 1024 * 1024,\n }, requestLocationOptions({ directory, workspaceID }))).data,\n }\n}\n\nexport function createShellStore(apiForInstance: (instanceId: string) => ShellApi) {\n const [states, setStates] = createSignal<Map<string, ShellState>>(new Map())\n const requests = new Map<string, { promise: Promise<void>; dirty: boolean }>()\n const demands = new Map<string, number>()\n const key = (instanceId: string, directory: string, workspaceID?: string) => JSON.stringify([instanceId, directory, workspaceID])\n const setState = (stateKey: string, state: ShellState) => setStates((current) => new Map(current).set(stateKey, state))\n const readState = (stateKey: string): ShellState => untrack(() => states().get(stateKey) ?? EMPTY_STATE)\n\n const load = async (instanceId: string, directory: string, workspaceID?: string, refresh = false): Promise<void> => {\n if (!instanceId || !directory) return\n const stateKey = key(instanceId, directory, workspaceID)\n const pending = requests.get(stateKey)\n if (pending) {\n if (refresh) pending.dirty = true\n return pending.promise\n }\n const request = { promise: Promise.resolve(), dirty: false }\n requests.set(stateKey, request)\n setState(stateKey, { ...readState(stateKey), loading: true, failed: false })\n request.promise = Promise.resolve().then(async () => {\n do {\n request.dirty = false\n try {\n const inventory = await apiForInstance(instanceId).list(directory, workspaceID)\n const items = inventory.data\n if (!request.dirty) {\n const previous = new Map(readState(stateKey).items.map(item => [item.id, item]))\n const stable = items.map(item => {\n const old = previous.get(item.id)\n return old && JSON.stringify(old) === JSON.stringify(item) ? old : item\n })\n setState(stateKey, { items: stable, nativeDirectory: inventory.location?.directory ?? directory, loading: false, failed: false })\n }\n } catch {\n if (!request.dirty) setState(stateKey, { ...readState(stateKey), loading: false, failed: true })\n }\n } while (request.dirty)\n }).finally(() => requests.delete(stateKey))\n return request.promise\n }\n\n const refreshForEvent = async (instanceId: string, event: ShellRefreshEvent): Promise<void> => {\n if (!SHELL_EVENTS.has(event.type)) return\n const eventDirectory = event.location?.directory ?? event.data?.info?.cwd\n const tracked = Array.from(untrack(states).keys())\n .map((stateKey): [string, string, string | null] => JSON.parse(stateKey))\n .filter(([trackedInstanceId, directory, workspaceID]) => trackedInstanceId === instanceId\n && demands.has(key(instanceId, directory, workspaceID ?? undefined)))\n const matching = eventDirectory ? tracked.filter(([, directory, workspaceID]) => {\n if (event.location?.workspaceID !== undefined && event.location.workspaceID !== workspaceID) return false\n const stateKey = key(instanceId, directory, workspaceID ?? undefined)\n const state = readState(stateKey)\n const nativeDirectory = state.nativeDirectory\n // Until the first successful inventory, its native alias is unknown.\n // Events coalesce during the read and recover an initial read failure.\n return sameDirectory(directory, eventDirectory) || (nativeDirectory !== undefined\n ? sameDirectory(nativeDirectory, eventDirectory) : requests.has(stateKey) || state.failed)\n }) : tracked\n await Promise.all(matching.map(([, directory, workspaceID]) => load(instanceId, directory, workspaceID ?? undefined, true)))\n }\n\n const remove = async (instanceId: string, directory: string, shellId: string, workspaceID?: string): Promise<boolean> => {\n try {\n await apiForInstance(instanceId).remove(directory, shellId, workspaceID)\n await load(instanceId, directory, workspaceID, true)\n return true\n } catch { return false }\n }\n\n const output = (instanceId: string, directory: string, shellId: string, cursor?: number, workspaceID?: string) =>\n apiForInstance(instanceId).output(directory, shellId, cursor, workspaceID)\n const getState = (instanceId: string, directory: string, workspaceID?: string): ShellState => states().get(key(instanceId, directory, workspaceID)) ?? EMPTY_STATE\n const watch = (instanceId: string, directory: string, workspaceID?: string) => {\n const stateKey = key(instanceId, directory, workspaceID)\n demands.set(stateKey, (demands.get(stateKey) ?? 0) + 1)\n return () => {\n const remaining = (demands.get(stateKey) ?? 1) - 1\n if (remaining) demands.set(stateKey, remaining)\n else demands.delete(stateKey)\n }\n }\n return { getState, load, watch, refreshForEvent, remove, output }\n}\n\nfunction sameDirectory(left: string, right: string): boolean {\n const normalize = (value: string) => {\n const normalized = value.replace(/\\\\/g, \"/\").replace(/\\/+$/, \"\")\n return /^[A-Za-z]:\\//.test(normalized) || normalized.startsWith(\"//\") ? normalized.toLowerCase() : normalized\n }\n return normalize(left) === normalize(right)\n}\n","import { serverEvents } from \"../lib/server-events\"\nimport { getRootClient } from \"./opencode-client\"\nimport { createShellApi, createShellStore, type ShellRefreshEvent } from \"./shell-store\"\nimport { serverApi } from \"../lib/api-client\"\n\nconst shellStore = createShellStore((instanceId) => createShellApi(getRootClient(instanceId),\n (directory, workspaceID) => {\n if (workspaceID !== undefined) return Promise.reject(new Error(\"Background shell inventory requires a public directory location\"))\n return serverApi.fetchBackgroundShells(instanceId, directory)\n }))\n\nserverEvents.on(\"instance.event\", (event) => {\n if (event.type !== \"instance.event\") return\n void shellStore.refreshForEvent(event.instanceId, event.event as ShellRefreshEvent)\n})\n\nserverEvents.on(\"instance.eventStatus\", (event) => {\n if (event.type !== \"instance.eventStatus\" || event.status !== \"connected\") return\n void shellStore.refreshForEvent(event.instanceId, { type: \"server.connected\" })\n})\n\nexport { shellStore }\n","import { Show, createEffect, createSignal, createUniqueId, onCleanup } from \"solid-js\"\nimport type { ShellInfo } from \"@opencode/client\"\n\nimport { createAnsiStreamRenderer, hasAnsi } from \"../lib/ansi\"\nimport { useI18n } from \"../lib/i18n\"\nimport { appendShellOutput } from \"../stores/shell-store\"\nimport { shellStore } from \"../stores/shells\"\nimport { OutputWindow } from \"./output-window\"\n\ninterface ShellOutputDialogProps {\n open: boolean\n instanceId: string\n directory: string\n workspaceID?: string\n shell: ShellInfo | null\n onClose: () => void\n}\n\nexport function ShellOutputDialog(props: ShellOutputDialogProps) {\n const { t } = useI18n()\n const id = `shell-output-${createUniqueId()}`\n const [output, setOutput] = createSignal(\"\")\n const [outputHtml, setOutputHtml] = createSignal(\"\")\n const [ansiEnabled, setAnsiEnabled] = createSignal(false)\n const [truncated, setTruncated] = createSignal(false)\n const [loading, setLoading] = createSignal(false)\n\n createEffect(() => {\n const shell = props.shell\n const directory = props.directory\n const workspaceID = props.workspaceID\n if (!props.open || !shell || !directory) return\n\n let active = true\n let cursor = 0\n let raw = \"\"\n let timer: ReturnType<typeof setTimeout> | undefined\n const render = () => {\n const ansi = hasAnsi(raw)\n setAnsiEnabled(ansi)\n if (!ansi) return setOutputHtml(\"\")\n const renderer = createAnsiStreamRenderer()\n setOutputHtml(renderer.render(raw))\n }\n const poll = async () => {\n try {\n const result = await shellStore.output(props.instanceId, directory, shell.id, cursor, workspaceID)\n if (!active) return\n cursor = result.cursor\n if (result.output) {\n const next = appendShellOutput(raw, result.output)\n raw = next.output\n setOutput(raw)\n setTruncated((current) => current || result.truncated || next.truncated)\n render()\n } else if (result.truncated) {\n setTruncated(true)\n }\n } catch {\n if (!active) return\n setAnsiEnabled(false)\n setOutputHtml(\"\")\n setOutput(t(\"backgroundProcessOutputDialog.loadErrorFallback\"))\n } finally {\n if (!active) return\n setLoading(false)\n timer = setTimeout(poll, 1000)\n }\n }\n\n setOutput(\"\")\n setOutputHtml(\"\")\n setAnsiEnabled(false)\n setTruncated(false)\n setLoading(true)\n void poll()\n onCleanup(() => {\n active = false\n if (timer) clearTimeout(timer)\n })\n })\n\n return (\n <OutputWindow id={id} open={props.open} title={t(\"backgroundProcessOutputDialog.title\")}\n subtitle={props.shell?.command} onClose={props.onClose}>\n <Show when={loading()}><p class=\"text-xs text-secondary\">{t(\"backgroundProcessOutputDialog.loading\")}</p></Show>\n <Show when={truncated()}><p class=\"mb-2 text-xs text-secondary\">{t(\"backgroundProcessOutputDialog.truncatedNotice\")}</p></Show>\n <Show when={!loading()}>\n <Show when={ansiEnabled()} fallback={\n <pre class=\"border border-base bg-surface-inset p-4 font-mono text-xs text-primary whitespace-pre-wrap break-all\">{output()}</pre>\n }>\n <pre class=\"border border-base bg-surface-inset p-4 font-mono text-xs text-primary whitespace-pre-wrap break-all\" innerHTML={outputHtml()} />\n </Show>\n </Show>\n </OutputWindow>\n )\n}\n","import { For, Show, createEffect, createMemo, createSignal, createUniqueId, onCleanup, untrack, type Accessor, type Component, type JSX } from \"solid-js\"\nimport type { LocationRef, ShellInfo } from \"@opencode/client\"\nimport {\n DragDropProvider,\n DragDropSensors,\n SortableProvider,\n closestCenter,\n createSortable,\n type DragEvent as SolidDndDragEvent,\n} from \"@thisbeyond/solid-dnd\"\nimport { Accordion } from \"@kobalte/core\"\nimport { Tooltip } from \"@kobalte/core/tooltip\"\nimport Switch from \"@suid/material/Switch\"\n\nimport { ChevronRight, GripVertical, Info, TerminalSquare, Trash2, XOctagon } from \"lucide-solid\"\n\nimport type { Instance } from \"../../../../../types/instance\"\nimport type { Session } from \"../../../../../types/session\"\n\nimport ContextUsagePanel from \"../../../../session/context-usage-panel\"\nimport ProviderUsagePanel from \"../../../../session/provider-usage-panel\"\nimport SessionGoalLine from \"../../../../session/session-goal-line\"\nimport InstanceServiceStatus from \"../../../../instance-service-status\"\nimport { togglePermissionAutoAcceptForSession } from \"../../../../../stores/instances\"\nimport { isPermissionAutoAcceptEnabled } from \"../../../../../stores/permission-auto-accept\"\nimport { applyRightPanelItemCustomization, reorderStatusSections, type RightPanelCustomization, type RightPanelSectionModule } from \"../registry\"\nimport { createCoreStatusSectionManifest } from \"../core-plugin\"\nimport { shellStore } from \"../../../../../stores/shells\"\nimport { showConfirmDialog } from \"../../../../../stores/alerts\"\nimport { showToastNotification } from \"../../../../../lib/notifications\"\nimport { ShellOutputDialog } from \"../../../../shell-output-dialog\"\n\ninterface StatusTabProps {\n t: (key: string, vars?: Record<string, any>) => string\n\n instanceId: string\n instance: Instance\n\n activeSession: Accessor<Session | null>\n\n isActive: Accessor<boolean>\n expandedItems: Accessor<string[]>\n onExpandedItemsChange: (values: string[]) => void\n customization: Accessor<RightPanelCustomization>\n onCustomizationChange: (updater: (current: RightPanelCustomization) => RightPanelCustomization) => void\n extraSections?: readonly RightPanelSectionModule[]\n extraContent?: readonly (() => JSX.Element)[]\n}\n\ninterface SortableStatusSectionProps {\n section: RightPanelSectionModule\n expanded: boolean\n t: (key: string, vars?: Record<string, any>) => string\n}\n\nconst SortableStatusSection: Component<SortableStatusSectionProps> = (props) => {\n const sortable = createSortable(props.section.id)\n const regionLabelId = createUniqueId()\n const tooltip = () => props.section.tooltip ?? props.t(props.section.tooltipKey)\n return (\n <div ref={sortable} class={`right-panel-section-draggable ${sortable.isActiveDraggable ? \"right-panel-section-draggable-active\" : \"\"}`}\n data-status-section={props.section.id}>\n <Accordion.Item value={props.section.id} class=\"right-panel-accordion-item\">\n <Accordion.Header class=\"right-panel-accordion-header-row\">\n <Accordion.Trigger class=\"right-panel-accordion-trigger\" data-status-section-trigger={props.section.id}>\n <span class=\"section-left\">\n <ChevronRight class=\"right-panel-accordion-chevron disclosure-chevron\" />\n <span class=\"section-label\">{props.section.label ?? props.t(props.section.labelKey)}</span>\n </span>\n <Show when={props.section.renderStatus}>{(status) => status()()}</Show>\n <Show when={!props.expanded && props.section.renderSummary}>\n {(summary) => <span class=\"right-panel-section-summary\">{summary()()}</span>}\n </Show>\n </Accordion.Trigger>\n <Show when={props.section.renderHeaderActions}>{(actions) => actions()()}</Show>\n <Show when={props.section.renderInfo} fallback={\n <Tooltip openDelay={200} gutter={4} placement=\"top\">\n <Tooltip.Trigger as=\"button\" type=\"button\" class=\"section-info-trigger\" aria-label={tooltip()}>\n <Info class=\"section-info-icon\" />\n </Tooltip.Trigger>\n <Tooltip.Portal>\n <Tooltip.Content class=\"section-info-tooltip\">{tooltip()}</Tooltip.Content>\n </Tooltip.Portal>\n </Tooltip>\n }>{(info) => info()()}</Show>\n <GripVertical class=\"right-panel-section-grip\" aria-hidden=\"true\" />\n </Accordion.Header>\n <Show when={props.section.regionLabel}>\n {(name) => <span id={regionLabelId} class=\"sr-only\">{name()}</span>}\n </Show>\n <Accordion.Content class=\"right-panel-accordion-content\" {...(props.section.regionLabel ? { \"aria-labelledby\": regionLabelId } : {})}>\n {props.section.render()}\n </Accordion.Content>\n </Accordion.Item>\n </div>\n )\n}\n\nconst autoExpandedKeys = new WeakMap<Accessor<string[]>, Map<string, string>>()\n\nconst StatusTab: Component<StatusTabProps> = (props) => {\n let escaping = false\n const isSectionExpanded = (id: string) => props.expandedItems().includes(id)\n const shellLocation = createMemo(() => props.activeSession()?.location ?? { directory: props.instance.folder })\n const shellState = createMemo(() => shellStore.getState(props.instanceId, shellLocation().directory, shellLocation().workspaceID))\n const [outputShell, setOutputShell] = createSignal<{ shell: ShellInfo; location: LocationRef; instanceId: string } | null>(null)\n\n createEffect(() => {\n if (!props.isActive() || !isSectionExpanded(\"background-processes\")\n || props.customization().hiddenStatusSectionIds.includes(\"background-processes\")) return\n const { directory, workspaceID } = shellLocation()\n onCleanup(shellStore.watch(props.instanceId, directory, workspaceID))\n void shellStore.load(props.instanceId, directory, workspaceID)\n })\n\n const renderYoloModeSection = () => {\n const session = props.activeSession()\n if (!session) {\n return (\n <div class=\"right-panel-empty right-panel-empty--left\">\n <span class=\"text-xs\">{props.t(\"instanceShell.yoloMode.noSessionSelected\")}</span>\n </div>\n )\n }\n\n return (\n <div class=\"flex items-center justify-between gap-2 border border-base bg-surface-secondary px-3 py-2\">\n <p class=\"min-w-0 text-xs leading-5 text-secondary\">{props.t(\"instanceShell.yoloMode.description\")}</p>\n <div class=\"-mr-2 shrink-0\">\n <Switch\n class=\"yolo-mode-switch\"\n checked={isPermissionAutoAcceptEnabled(props.instanceId, session.id)}\n size=\"small\"\n sx={{\n \"& .MuiSwitch-switchBase.Mui-checked\": { color: \"var(--session-yolo-accent)\" },\n \"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track\": { backgroundColor: \"var(--session-yolo-accent)\" },\n }}\n inputProps={{ \"aria-label\": props.t(\"instanceShell.yoloMode.title\") }}\n onChange={() => togglePermissionAutoAcceptForSession(props.instanceId, session.id)}\n />\n </div>\n </div>\n )\n }\n\n const removeShell = async (shellId: string, command: string, running: boolean) => {\n const instanceId = props.instanceId\n const location = { ...shellLocation() }\n const confirmed = await showConfirmDialog(\n props.t(\"instanceShell.backgroundProcesses.remove.message\", { title: command }),\n {\n title: props.t(\"instanceShell.backgroundProcesses.remove.title\"),\n confirmLabel: props.t(running\n ? \"instanceShell.backgroundProcesses.actions.stopRemove\"\n : \"instanceShell.backgroundProcesses.actions.remove\"),\n },\n )\n if (confirmed && !await shellStore.remove(instanceId, location.directory, shellId, location.workspaceID)) {\n showToastNotification({ category: \"sessions\", message: props.t(\"instanceShell.backgroundProcesses.error\"), variant: \"error\" })\n }\n }\n\n const renderBackgroundProcesses = () => (\n <Show\n when={!shellState().failed}\n fallback={<div class=\"right-panel-empty right-panel-empty--left\"><span class=\"text-xs\">{props.t(\"instanceShell.backgroundProcesses.error\")}</span></div>}\n >\n <Show\n when={!shellState().loading || shellState().items.length > 0}\n fallback={<div class=\"right-panel-empty right-panel-empty--left\"><span class=\"text-xs\">{props.t(\"instanceShell.backgroundProcesses.loading\")}</span></div>}\n >\n <Show\n when={shellState().items.length > 0}\n fallback={<div class=\"right-panel-empty right-panel-empty--left\"><span class=\"text-xs\">{props.t(\"instanceShell.backgroundProcesses.empty\")}</span></div>}\n >\n <div class=\"flex flex-col gap-1\">\n <For each={shellState().items}>\n {(shell) => {\n const running = () => shell.status === \"running\"\n return (\n <article class=\"status-process-card\" title={[shell.command, shell.shell, shell.cwd,\n props.t(`instanceShell.backgroundProcesses.status.${shell.status}`),\n shell.pid === undefined ? \"\" : props.t(\"instanceShell.backgroundProcesses.pid\", { pid: shell.pid }),\n shell.exit === undefined ? \"\" : props.t(\"instanceShell.backgroundProcesses.exitCode\", { code: shell.exit }),\n ].filter(Boolean).join(\"\\n\")}>\n <span class=\"min-w-0 flex-1 truncate text-xs text-primary\">{shell.command}</span>\n <div class=\"status-process-actions\">\n <button\n type=\"button\"\n class=\"window-icon-button\"\n title={props.t(\"instanceShell.backgroundProcesses.actions.output\")}\n aria-label={props.t(\"instanceShell.backgroundProcesses.actions.output\")}\n onClick={() => setOutputShell({ shell, location: { ...shellLocation() }, instanceId: props.instanceId })}\n >\n <TerminalSquare class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"window-icon-button\"\n title={props.t(running() ? \"instanceShell.backgroundProcesses.actions.stopRemove\" : \"instanceShell.backgroundProcesses.actions.remove\")}\n aria-label={props.t(running() ? \"instanceShell.backgroundProcesses.actions.stopRemove\" : \"instanceShell.backgroundProcesses.actions.remove\")}\n disabled={shellState().loading}\n onClick={() => void removeShell(shell.id, shell.command, running())}\n >\n <Show when={running()} fallback={<Trash2 class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />}>\n <XOctagon class=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n </Show>\n </button>\n </div>\n </article>\n )\n }}\n </For>\n </div>\n </Show>\n </Show>\n </Show>\n )\n\n const renderProviderUsage = () => (\n <Show when={props.activeSession()} fallback={<div class=\"right-panel-empty-text\">{props.t(\"providerUsage.noSession\")}</div>}>\n {(session) => (\n <div class=\"border border-base bg-surface-secondary px-3 py-2\">\n <ProviderUsagePanel instanceId={props.instanceId} sessionId={session().id} directory={session().location.directory}\n providerId={session().model.providerId} modelId={session().model.modelId}\n active={props.isActive() && props.expandedItems().includes(\"provider-usage\")} />\n </div>\n )}\n </Show>\n )\n\n // Built once: a changed extra-section list must never recreate (remount) the core sections.\n const coreSections = untrack(() => createCoreStatusSectionManifest({\n renderTokens: () => (\n <Show when={props.activeSession()?.id}>\n <ContextUsagePanel instanceId={props.instanceId} sessionId={props.activeSession()!.id} />\n </Show>\n ),\n renderTokensSummary: () => (\n <Show when={props.activeSession()?.id}>\n <ContextUsagePanel instanceId={props.instanceId} sessionId={props.activeSession()!.id} summary expanded={isSectionExpanded(\"tokens\")} />\n </Show>\n ),\n renderYoloModeSection,\n renderProviderUsage,\n renderBackgroundProcesses,\n renderMcpStatus: () => <InstanceServiceStatus initialInstance={props.instance} sections={[\"mcp\"]} showSectionHeadings={false} class=\"space-y-2\" />,\n renderPluginStatus: () => (\n <InstanceServiceStatus\n initialInstance={props.instance}\n sections={[\"plugins\"]}\n showSectionHeadings={false}\n pluginsActive={props.isActive() && isSectionExpanded(\"plugins\")}\n class=\"space-y-2\"\n />\n ),\n }).statusSections ?? [])\n const allStatusSections = createMemo<RightPanelSectionModule[]>(() => [...coreSections, ...(props.extraSections ?? [])])\n const statusSections = createMemo<RightPanelSectionModule[]>(() =>\n applyRightPanelItemCustomization(\n allStatusSections(),\n props.customization().statusSectionOrder,\n props.customization().hiddenStatusSectionIds,\n ),\n )\n\n const moveSection = (sourceId: string, targetId: string) => {\n if (!sourceId || sourceId === targetId) return\n const ids = statusSections().map((section) => section.id)\n if (!ids.includes(sourceId) || !ids.includes(targetId)) return\n props.onCustomizationChange((current) => ({\n ...current,\n statusSectionOrder: reorderStatusSections(current.statusSectionOrder, ids, sourceId, targetId),\n }))\n }\n\n\n // An expected action expands its section once per key; a later user collapse holds until the key changes,\n // across the tab's remounts (the expanded set belongs to the panel).\n let autoExpanded = autoExpandedKeys.get(props.expandedItems)\n if (!autoExpanded) autoExpandedKeys.set(props.expandedItems, autoExpanded = new Map())\n createEffect(() => {\n const additions: string[] = []\n for (const section of allStatusSections()) {\n const key = section.autoExpandKey?.()\n if (key === null) continue\n if (!key) { autoExpanded!.delete(section.id); continue }\n if (autoExpanded!.get(section.id) === key) continue\n autoExpanded!.set(section.id, key)\n if (!untrack(props.expandedItems).includes(section.id)) additions.push(section.id)\n }\n if (additions.length) props.onExpandedItemsChange([...untrack(props.expandedItems), ...additions])\n })\n\n const handleSectionDragEnd = ({ draggable, droppable }: SolidDndDragEvent) => {\n if (!droppable) return\n moveSection(String(draggable.id), String(droppable.id))\n }\n\n return (\n <div class=\"status-tab-container\">\n <Show when={props.activeSession()?.id}>\n {(sessionId) => <SessionGoalLine instanceId={props.instanceId} sessionId={sessionId()} active={props.isActive()} />}\n </Show>\n <Accordion.Root\n class=\"right-panel-accordion\"\n collapsible\n multiple\n value={props.expandedItems()}\n // Kobalte's list keyboard model clears every expanded item on Escape. Escape closes the popover,\n // tooltip or window it was meant for; it never collapses Status.\n onKeyDown={(event: KeyboardEvent) => {\n escaping = event.key === \"Escape\"\n if (escaping) queueMicrotask(() => { escaping = false })\n }}\n onChange={(values: string[]) => { if (!escaping) props.onExpandedItemsChange(values) }}\n >\n <DragDropProvider collisionDetector={closestCenter} onDragEnd={handleSectionDragEnd}>\n <DragDropSensors>\n <SortableProvider ids={statusSections().map((section) => section.id)}>\n <For each={statusSections()}>\n {(section) => <SortableStatusSection section={section} expanded={isSectionExpanded(section.id)} t={props.t} />}\n </For>\n </SortableProvider>\n </DragDropSensors>\n </DragDropProvider>\n </Accordion.Root>\n <For each={props.extraContent ?? []}>{(render) => render()}</For>\n <ShellOutputDialog\n open={Boolean(outputShell())}\n instanceId={outputShell()?.instanceId ?? props.instanceId}\n directory={outputShell()?.location.directory ?? shellLocation().directory}\n workspaceID={outputShell()?.location.workspaceID}\n shell={outputShell()?.shell ?? null}\n onClose={() => setOutputShell(null)}\n />\n </div>\n )\n}\n\nexport default StatusTab\n"],"names":["iconNode","x","y","width","height","rx","key","d","AppWindow","props","_$createComponent","Icon","_$mergeProps","name","Blocks","points","x1","x2","y1","y2","cx","cy","r","PackageSearch","Package","Unlink2","XOctagon","collapsible_exports","__export","Collapsible","Content","CollapsibleContent","Root","CollapsibleRoot","Trigger","CollapsibleTrigger","useCollapsibleContext","CollapsibleContext","createContext","context","useContext","Error","ref","setRef","createSignal","mergedProps","mergeDefaultProps","id","generateId","local","others","splitProps","present","createPresence","show","shouldMount","element","setHeight","setWidth","isMountAnimationPrevented","isOpen","onMount","raf","requestAnimationFrame","onCleanup","cancelAnimationFrame","createEffect","on","style","transitionDuration","animationName","rect","getBoundingClientRect","open","defer","registerContentId","Show","when","children","Polymorphic","as","r$","_ref$","mergeRefs","combineStyle","dataset","defaultId","createUniqueId","mergeDefaultProps2","splitProps2","contentId","setContentId","createSignal2","disclosureState","createDisclosureState","defaultOpen","onOpenChange","createMemo","disabled","forceMount","toggle","createGenerateId","createRegisterId","Provider","value","splitProps3","ButtonRoot","_$memo","onClick","e","callHandler","Object","assign","accordion_exports","Accordion","AccordionContent","Header","AccordionHeader","Item","AccordionItem","AccordionRoot","AccordionTrigger","useAccordionContext","AccordionItemContext","useAccordionItemContext","itemContext","role","triggerId","AccordionContext","createContext2","useContext2","accordionContext","setTriggerId","selectionManager","listState","isExpanded","isSelected","registerTriggerId","createUniqueId2","mergeDefaultProps3","multiple","collapsible","shouldFocusWrap","items","setItems","DomCollectionProvider","createDomCollection","onItemsChange","createListState","selectedKeys","defaultSelectedKeys","defaultValue","onSelectionChange","onChange","Array","from","disallowEmptySelection","selectionMode","dataSource","setFocusedKey","selectableList","createSelectableList","collection","disallowTypeAhead","allowsTabNavigation","createGenerateId2","el","onKeyDown","composeEventHandlers","onMouseDown","onFocusIn","onFocusOut","collapsibleContext","mergeDefaultProps4","splitProps4","createDomCollectionItem","getItem","type","textValue","selectableItem","createSelectableItem","shouldSelectOnPressUp","includes","preventDefault","createEffect2","onCleanup2","_ref$2","mergeRefs2","dataKey","onPointerDown","composeEventHandlers2","onPointerUp","onFocus","ContextUsagePanel","t","useI18n","info","getSessionInfo","instanceId","sessionId","hasChildren","getChildSessions","length","threadTotals","getThreadTotals","tokenMetric","label","formatTokenTotal","full","String","costMetric","sessionMetrics","session","cost","inputTokens","outputTokens","isSubscriptionModel","toFixed","totalMetrics","reasoningTokens","metrics","expanded","summaryLabel","map","metric","join","summary","fallback","_el$2","_tmpl$2","_$insert","UsageMetricChips","_$effect","_$className","class","_el$","_tmpl$","_p$","_v$","undefined","_v$2","_v$3","_$setAttribute","a","InfoPopoverButton","Popover","placement","gutter","title","Info","Portal","ProviderUsageConsole","locale","number","Intl","NumberFormat","format","usd","currency","reset","time","Date","toLocaleString","dateStyle","timeStyle","_tmpl$4","firstChild","_el$3","_el$4","_el$5","nextSibling","_el$6","_el$7","For","each","range","_el$13","_tmpl$5","_el$14","_el$15","usage","requests","models","_el$16","_tmpl$6","_el$8","_el$9","_el$0","_el$1","_el$17","_tmpl$7","_el$18","_tmpl$8","_el$19","_el$20","_el$21","_el$22","_el$23","row","model","provider","budgets","status","_el$10","_tmpl$3","_el$11","_el$24","_el$12","_el$25","_tmpl$9","_el$26","_el$27","_el$28","_el$29","_el$30","_el$31","_el$32","item","spentUsd","limitUsd","resetAt","providerUsageKey","source","shouldShowProviderUsageWindow","showCreditBalance","isFreeUsageSource","nextUtcMidnight","now","date","createProviderUsageState","fetchUsage","publish","current","generation","day","running","invalidate","expireUtcDay","today","request","requestDay","_a","REFRESH_INTERVAL_MS","ProviderUsagePanel","preferences","useConfig","active","providerId","trim","modelId","directory","equals","b","Boolean","setUsage","state","serverApi","fetchProviderUsage","select","refresh","revalidate","unsubscribeEvents","serverEvents","event","location","data","error","lastInstanceStatus","lastTransportStatus","unsubscribeStatus","JSON","stringify","unsubscribeTransport","onTransportStatus","refreshTimer","setInterval","timer","schedule","setTimeout","clearTimeout","dispose","clearInterval","entries","windows","displayedLabels","filter","showProviderUsageCreditBalance","hasReadings","console","unavailableMessage","freeEstimate","unavailableReason","consoleMessage","consoleError","providerErrorCode","test","code","unavailableLink","unavailableAction","href","windowLabel","scope","indexOf","slice","weekly","daily","monthly","tokens","input_tokens","output_tokens","credits","key_limit","per_user_limit","team_limit","credits_balance","billing_cycle","premium","chat","completions","usedValue","before","after","split","displayValue","window","consumption","maximumFractionDigits","estimate","reference","limit","used","creditsUsed","limitUSD","balanceUSD","money","remaining","total","valueLabel","usedPercent","percent","Math","round","resetLabel","Number","isFinite","getTime","estimated","timeZone","barColor","supported","configured","ok","_tmpl$1","message","_tmpl$10","$$click","openExternalUrl","link","_tmpl$0","openSettings","exhausted","previous","_tmpl$12","_tmpl$13","_tmpl$14","_tmpl$11","max","min","_v$4","_$setStyleProperty","o","providerName","copilotPlan","plan","_$delegateEvents","GOAL_CHANGED_EVENT","GOAL_COMMAND","goalStateSchema","z.object","z.string","z.enum","z.number","goalChangedSchema","LOADING","createSessionGoalStore","read","snapshots","setSnapshots","busy","setBusy","stateKey","snapshot","cancel","entry","reading","signal","version","answer","shown","untrack","tracked","released","owner","goal","next","prefix","command","sessionGoals","reconnects","createEventRefreshScheduler","native","runSessionGoalCommand","action","executeCustomCommand","showToastNotification","tGlobal","getOpencodeErrorMessage","boundedText","text","getRenderTextWindow","TOOL_OUTPUT_RENDER_CHARACTER_LIMIT","hidden","SessionGoalLine","reasonId","demand","run","objective","reason","rounds","maxRounds","toggleLabel","Tooltip","openDelay","tabindex","Pause","Play","Trash2","_v$5","_v$6","_v$7","_v$8","_v$9","_v$0","_v$1","i","n","s","h","loadedNative","integrationLink","binding","_b","integrationAttention","host","integrationConnection","connection","_c","offers","integrationConnectionMessage","app","integrationChainAction","unavailable","integrationAttachChoice","compatible","offer","integrationSummary","integrationPlugin","correlated","list","association","target","sources","ids","rule","control","candidate","targets","integrationDisplayPlugin","matches","runtime","controls","fetchIntegrations","path","backgroundReads","response","authenticatedFetch","API_BASE","HttpResponseError","fetchIntegrationBinding","keys","installIntegration","integrationId","integrationAttachmentRequest","body","INTEGRATION_EVENT","REFRESH_EVENTS","INTEGRATION_EVENT_COALESCE_MS","isIntegrationRefreshEvent","createIntegrationsStore","clock","setTimer","callback","ms","clearTimer","timers","refreshEntry","refreshDemanded","UNKNOWN","createIntegrationBindingsStore","disconnected","transportConnected","connected","cancelTimer","reconcile","immediate","sessionID","integrationEvent","isConnected","mutation","integrations","integrationBindings","epochs","setEpochs","sessionEpochs","setSessionEpochs","connectionEpoch","setConnectionEpoch","integrationEpoch","EMPTY_STATE","PluginControlsCache","api","cacheKey","record","options","pluginId","enabled","mutate","requestRevision","newerSnapshot","retainRuntime","result","records","oldest","siblings","changed","existing","force","controller","promise","confirmRuntime","trailing","states","preferIncoming","incomingRead","canonicalKey","invalidatedAlias","adoptedRead","pendingInvalidation","durable","newer","runtimeById","newerControlsById","sourceKey","newerSources","configuredIds","durableIds","_previous","managedBy","previousRuntime","pluginControlsCache","PLUGIN_SOURCE_PENDING_TIMEOUT_MS","locationKey","PluginSourcesStore","delay","refreshIntegrations","spec","attempt","integration","identity","removalKey","installs","removableSources","samePath","left","right","normalize","pluginSourcesStore","payload","INTEGRATION_CONFIRM_DELAY_MS","claimed","claimIntegrationConfirmation","confirmIntegrationAction","release","showConfirmDialog","createIntegrationHostInstallation","pending","setPending","epoch","eligible","_d","_f","_e","signature","confirmation","disposed","focusGeneration","captured","opener","sameTarget","OUTCOMES","createIntegrationRowBinding","setReading","choices","setChoices","intent","revoke","owns","fail","vars","detach","attach","offerID","chainAction","choice","Indicator","IntegrationLinkButton","attached","DropdownMenu","activate","closeChoices","Link2","classList","Group","GroupLabel","onSelect","IntegrationAttentionIndicator","attention","AlertTriangle","log","getLogger","Set","pendingKey","isPluginActivationPending","has","pluginScopeChecked","scoped","errorMessageKey","PluginActivationSwitch","isPending","add","category","variant","delete","Switch","checked","available","color","size","sx","ACCENT_SWITCH_SX","inputProps","describedBy","lockedReason","nextChecked","isPluginPackagePending","runPluginPackageAction","client","getRootClient","requestLocationOptions","toRequestLocation","PLUGIN_SOURCE_CONFIRM_EXPIRY_MS","PluginRowActions","afterClose","trigger","surface","admittedOwner","presentationOwner","querySelector","restoreFocus","focus","abort","ownership","consentEpoch","removable","document","activeElement","queueMicrotask","pkg","packageBusy","updating","removing","isRemoving","some","scopeLabel","hostAction","kind","outdated","expectedRevision","packageLabel","hint","lonePackage","triggerLabel","itemDisabled","runPackage","catch","runRemove","selected","feedbackOwner","closest","AbortController","accepted","detail","confirmLabel","expiresAfterMs","returnFocus","aborted","remove","stale","icon","pulse","Download","RefreshCw","MoreHorizontal","onCloseAutoFocus","installableIntegrations","ambiguous","plugin","declared","IntegrationCatalogWindow","catalog","rows","fetchedAt","DateTimeFormat","focusTrigger","getClientRects","install","displayName","onClose","Dialog","modal","Overlay","Title","WindowCloseButton","IntegrationCatalogRow","projectAvailable","onInstall","setScope","globalOnly","family","docs","BookOpen","_v$10","addEventListener","currentTarget","$$keydown","$$mousedown","PluginSourceAdd","setSpec","setError","setOpen","openChange","submit","failure","errorKey","global","anchorRef","anchor","$$input","_$addEventListener","nativeSelectListOpen","stopPropagation","Description","known","duplicate","timeout","ITEMS","PluginAddMenu","setPlugin","setCatalog","Plus","_c$","VALUE_PLACEHOLDER","isolatedValue","flatMap","part","index","PluginSystemAttention","headingId","Map","represented","representedRuntimeKeys","set","effective","runtimeUnconfirmed","renderEntry","get","mutationScope","setMutationScope","contains","controlling","controllingRule","writable","configurations","find","push","values","shownScopes","failed","runtimeDetails","Details","container","_$use","reenable","targetScope","renderAction","button","_ref$3","PluginActivationControls","noticeId","globalLabelId","projectLabelId","nonConforming","sourcesOverlap","ambiguousSources","nonConformingLabel","cachedLocation","requestLocation","invalidationRevision","refreshButton","recognised","byControl","byTarget","installation","freshIntegrations","builtin","controlsById","controlIds","runtimesByTarget","runtimeTargets","sourceTargets","loaded","added","addedSpecs","acquireDemand","bidi","sourceLabel","runtimeLines","lines","guiNotice","declaredIn","features","gui","declarationsFor","load","renderControl","overridden","project","isAvailable","matchesControl","every","sameSource","details","partVersion","renderSwitch","labelId","nameId","removableFor","renderRuntime","packageVersion","unshift","renderSource","Loader2","loading","refreshing","other","entryIndex","createIntegrationContext","folder","getActiveCatalogLocation","activeSessionId","sessions","parseMcpStatus","server","rawStatus","mapped","InstanceServiceStatus","metadataContext","useOptionalInstanceMetadataContext","instance","initialInstance","isLoading","refreshMetadata","Promise","resolve","sections","includeMcp","includePlugins","showHeadings","showSectionHeadings","metadataAccessor","metadata","hasMcpMetadata","mcpStatus","mcpServers","isMcpLoading","pluginLocation","attachmentSession","pendingMcpActions","setPendingMcpActions","setPendingMcpAction","prev","toggleMcpServer","serverName","shouldEnable","mcp","resolved","connect","disconnect","renderEmptyState","renderMcpSection","pendingAction","isRunning","switchDisabled","statusDotClass","statusDotStyle","background","_","_$style","pluginsActive","MAX_SHELL_OUTPUT_DISPLAY_CHARS","appendShellOutput","chunk","output","start","escape","end","controlSequence","bell","stringTerminator","terminators","SHELL_EVENTS","createShellApi","listBackground","workspaceID","shellId","cursor","createShellStore","apiForInstance","setStates","demands","setState","readState","inventory","stable","old","eventDirectory","trackedInstanceId","matching","nativeDirectory","sameDirectory","normalized","shellStore","ShellOutputDialog","setOutput","outputHtml","setOutputHtml","ansiEnabled","setAnsiEnabled","truncated","setTruncated","setLoading","shell","raw","render","ansi","hasAnsi","renderer","createAnsiStreamRenderer","poll","OutputWindow","subtitle","innerHTML","SortableStatusSection","sortable","createSortable","section","regionLabelId","tooltip","tooltipKey","ChevronRight","labelKey","renderStatus","renderSummary","renderHeaderActions","actions","renderInfo","GripVertical","regionLabel","isActiveDraggable","autoExpandedKeys","WeakMap","StatusTab","escaping","isSectionExpanded","expandedItems","shellLocation","activeSession","shellState","getState","outputShell","setOutputShell","isActive","customization","hiddenStatusSectionIds","watch","renderYoloModeSection","isPermissionAutoAcceptEnabled","backgroundColor","togglePermissionAutoAcceptForSession","removeShell","renderBackgroundProcesses","TerminalSquare","cwd","pid","exit","renderProviderUsage","coreSections","createCoreStatusSectionManifest","renderTokens","renderTokensSummary","renderMcpStatus","renderPluginStatus","statusSections","allStatusSections","extraSections","applyRightPanelItemCustomization","statusSectionOrder","moveSection","sourceId","targetId","onCustomizationChange","reorderStatusSections","autoExpanded","additions","autoExpandKey","onExpandedItemsChange","handleSectionDragEnd","draggable","droppable","DragDropProvider","collisionDetector","closestCenter","onDragEnd","DragDropSensors","SortableProvider","extraContent"],"mappings":"s6CACA,MAAMA,GAAW,CACb,CAAC,OAAQ,CAAEC,EAAG,IAAKC,EAAG,IAAKC,MAAO,KAAMC,OAAQ,KAAMC,GAAI,IAAKC,IAAK,QAAS,CAAC,EAC9E,CAAC,OAAQ,CAAEC,EAAG,UAAWD,IAAK,QAAS,CAAC,EACxC,CAAC,OAAQ,CAAEC,EAAG,UAAWD,IAAK,QAAS,CAAC,EACxC,CAAC,OAAQ,CAAEC,EAAG,SAAUD,IAAK,QAAS,CAAC,CAAC,EAEtCE,GAAaC,GAAKC,EAAMC,GAAIC,GAAKH,EAAK,CAAEI,KAAI,YAAA,SAAab,EAAkB,CAAA,CAAA,ECN3EA,GAAW,CACb,CAAC,OAAQ,CAAEG,MAAO,IAAKC,OAAQ,IAAKH,EAAG,KAAMC,EAAG,IAAKG,GAAI,IAAKC,IAAK,QAAS,CAAC,EAC7E,CACI,OACA,CACIC,EAAG,8FACHD,IAAK,QACT,CAAC,CACJ,EAECQ,GAAUL,GAAKC,EAAMC,GAAIC,GAAKH,EAAK,CAAEI,KAAI,SAAA,SAAUb,EAAkB,CAAA,CAAA,ECVrEA,GAAW,CACb,CACI,OACA,CACIO,EAAG,8GACHD,IAAK,QACT,CAAC,EAEL,CAAC,OAAQ,CAAEC,EAAG,mBAAoBD,IAAK,QAAS,CAAC,EACjD,CAAC,WAAY,CAAES,OAAQ,uBAAwBT,IAAK,QAAS,CAAC,EAC9D,CAAC,OAAQ,CAAEU,GAAI,KAAMC,GAAI,KAAMC,GAAI,KAAMC,GAAI,KAAMb,IAAK,QAAS,CAAC,EAClE,CAAC,SAAU,CAAEc,GAAI,OAAQC,GAAI,OAA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