synabun 2.0.9 → 2.0.10
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.
- package/CHANGELOG.md +29 -0
- package/README.md +1 -1
- package/THIRD-PARTY-LICENSES.md +46 -4
- package/launcher.mjs +9 -3
- package/lib/start-launcher.js +6 -1
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/neural-interface/i18n/en.json +218 -7
- package/neural-interface/i18n/pt-BR.json +220 -9
- package/neural-interface/lib/account-usage.js +5 -3
- package/neural-interface/lib/app-controls-api.js +161 -0
- package/neural-interface/lib/assistant-api.js +21 -7
- package/neural-interface/lib/assistant-brains/opencode.js +13 -1
- package/neural-interface/lib/assistant-brains/opencode2-browser-policy/index.js +44 -0
- package/neural-interface/lib/assistant-brains/opencode2-route-gate/index.js +57 -0
- package/neural-interface/lib/assistant-catalog.js +17 -2
- package/neural-interface/lib/assistant-dispatch.js +3 -0
- package/neural-interface/lib/assistant-envelope.js +19 -1
- package/neural-interface/lib/assistant-runtime.js +127 -8
- package/neural-interface/lib/claude-model-catalog.js +64 -14
- package/neural-interface/lib/codex-settings-schema.js +109 -47
- package/neural-interface/lib/editor-completion-opencode.js +132 -35
- package/neural-interface/lib/exec-loop-command.js +8 -1
- package/neural-interface/lib/launch-cache.js +293 -0
- package/neural-interface/lib/login-start.js +524 -0
- package/neural-interface/lib/native-loop-providers.js +18 -3
- package/neural-interface/lib/native-loop-runtime.js +19 -0
- package/neural-interface/lib/opencode-db-schema.js +75 -0
- package/neural-interface/lib/opencode-history.js +16 -1
- package/neural-interface/lib/opencode-protocol.js +173 -0
- package/neural-interface/lib/opencode-provider-view.js +81 -0
- package/neural-interface/lib/opencode-runtime-config.js +10 -3
- package/neural-interface/lib/opencode-serve-records.js +606 -0
- package/neural-interface/lib/opencode-v2-client.js +33 -6
- package/neural-interface/lib/opencode-v2-ws-requests.js +19 -5
- package/neural-interface/lib/opencode-worker-activity.js +229 -0
- package/neural-interface/lib/opencode2-client.js +760 -0
- package/neural-interface/lib/opencode2-proxy.js +116 -0
- package/neural-interface/lib/opencode2-translate.js +1008 -0
- package/neural-interface/lib/process-identity.js +361 -0
- package/neural-interface/lib/session-cache-builder.js +26 -5
- package/neural-interface/lib/session-title-generator.js +18 -0
- package/neural-interface/lib/style-guide/api.js +4 -3
- package/neural-interface/lib/untrusted-file-headers.js +27 -0
- package/neural-interface/package-lock.json +1343 -45
- package/neural-interface/package.json +5 -1
- package/neural-interface/public/index.html +2 -2
- package/neural-interface/public/shared/agent-runtime-options.js +55 -11
- package/neural-interface/public/shared/assistant/asst-agents-dock.js +172 -17
- package/neural-interface/public/shared/assistant/asst-api.js +11 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +195 -80
- package/neural-interface/public/shared/assistant/asst-composer.js +1 -1
- package/neural-interface/public/shared/assistant/asst-hosts.js +49 -2
- package/neural-interface/public/shared/assistant/asst-menu.js +77 -6
- package/neural-interface/public/shared/assistant/asst-panel.js +197 -33
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +28 -10
- package/neural-interface/public/shared/assistant/asst-redact.js +186 -0
- package/neural-interface/public/shared/assistant/asst-render.js +382 -36
- package/neural-interface/public/shared/assistant/asst-run-stage.js +231 -0
- package/neural-interface/public/shared/assistant/asst-sanitize.js +193 -3
- package/neural-interface/public/shared/assistant/asst-scene-styles.js +273 -0
- package/neural-interface/public/shared/assistant/asst-scenes.js +528 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel-styles.js +3 -15
- package/neural-interface/public/shared/assistant/asst-state.js +14 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +43 -0
- package/neural-interface/public/shared/assistant/asst-tool-kinds.js +13 -1
- package/neural-interface/public/shared/cc-dropdown.js +480 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +13 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +15 -3
- package/neural-interface/public/shared/cdx/cdx-styles.js +4 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +149 -35
- package/neural-interface/public/shared/cp/cp-markdown.js +4 -57
- package/neural-interface/public/shared/data-cache.js +223 -0
- package/neural-interface/public/shared/desktop-bridge.js +11 -0
- package/neural-interface/public/shared/desktop-titlebar-view.js +78 -1
- package/neural-interface/public/shared/desktop-titlebar.js +214 -28
- package/neural-interface/public/shared/desktop-update-view.js +15 -5
- package/neural-interface/public/shared/file-links.js +73 -8
- package/neural-interface/public/shared/html-shell.js +74 -80
- package/neural-interface/public/shared/launch-prefetch.js +59 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-caps.js +3 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +54 -17
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +93 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-providers.js +11 -9
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +15 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +1 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +401 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +16 -9
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +60 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +48 -19
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +195 -19
- package/neural-interface/public/shared/opencode-providers.js +39 -0
- package/neural-interface/public/shared/schedules-view.js +318 -0
- package/neural-interface/public/shared/settings/settings-app-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-app.js +243 -0
- package/neural-interface/public/shared/settings/settings-data.js +88 -0
- package/neural-interface/public/shared/settings/settings-ia.js +17 -0
- package/neural-interface/public/shared/sidepanel-session-status.js +49 -0
- package/neural-interface/public/shared/styles.css +540 -371
- package/neural-interface/public/shared/ui-assistant.js +27 -5
- package/neural-interface/public/shared/ui-automation-studio.js +67 -27
- package/neural-interface/public/shared/ui-bookmarks.js +2 -1
- package/neural-interface/public/shared/ui-claude-panel.js +76 -8
- package/neural-interface/public/shared/ui-codex-panel.js +1 -0
- package/neural-interface/public/shared/ui-detail.js +6 -6
- package/neural-interface/public/shared/ui-file-links.js +1 -0
- package/neural-interface/public/shared/ui-image-gallery.js +6 -5
- package/neural-interface/public/shared/ui-invite.js +18 -2
- package/neural-interface/public/shared/ui-link.js +9 -9
- package/neural-interface/public/shared/ui-menubar.js +232 -33
- package/neural-interface/public/shared/ui-native-loop-router.js +2 -0
- package/neural-interface/public/shared/ui-opencode-panel-v2.js +1 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +2099 -869
- package/neural-interface/public/shared/ui-sessions.js +15 -4
- package/neural-interface/public/shared/ui-settings.js +87 -36
- package/neural-interface/public/shared/ui-sidebar.js +4 -4
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +13 -0
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +55 -4
- package/neural-interface/public/shared/ui-sidepanel-tray.js +84 -8
- package/neural-interface/public/shared/ui-skills.js +70 -12
- package/neural-interface/public/shared/ui-sync.js +7 -0
- package/neural-interface/public/shared/ui-terminal.js +36 -20
- package/neural-interface/public/shared/ui-trash.js +8 -1
- package/neural-interface/public/shared/ui-tutorial-steps.js +7 -3
- package/neural-interface/public/shared/ui-tutorial.js +15 -5
- package/neural-interface/public/shared/ui-update.js +83 -14
- package/neural-interface/public/shared/ui-whiteboard.js +2 -1
- package/neural-interface/public/variant/2d/main.js +4 -1
- package/neural-interface/public/variant/3d/main.js +3 -0
- package/neural-interface/public/vendor/highlight/LICENSE +29 -0
- package/neural-interface/public/vendor/highlight/github-dark-dimmed-11.12.0.min.css +9 -0
- package/neural-interface/public/vendor/highlight/highlight-11.12.0.min.js +1262 -0
- package/neural-interface/public/vendor/highlight/manifest.json +5 -0
- package/neural-interface/public/vendor/html2canvas/LICENSE +22 -0
- package/neural-interface/public/vendor/html2canvas/html2canvas-1.4.1.min.js +20 -0
- package/neural-interface/public/vendor/html2canvas/manifest.json +4 -0
- package/neural-interface/public/vendor/marked/LICENSE.md +44 -0
- package/neural-interface/public/vendor/marked/manifest.json +4 -0
- package/neural-interface/public/vendor/marked/marked-14.1.4.esm.js +2502 -0
- package/neural-interface/public/vendor/mermaid/LICENSE +21 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/abnfDiagram-PAR5IXJI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/architecture-7GRP2DOG-M7G3SWCO.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/architectureDiagram-2PNWDENW.mjs +36 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/blockDiagram-PUWGUBOA.mjs +129 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/c4Diagram-3NLNHZP5.mjs +38 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-2NMSUPJH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-32MCUW2P.mjs +206 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-3NPNU5GP.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-3SMGFRGC.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-4CAJECRU.mjs +14 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-4OADUZ5Q.mjs +10 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5IMINLNL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5IQCK5RY.mjs +3 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5MVFYWFU.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-AQ6EADP3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-AZZRMDJM.mjs +15 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-CLS4B6BI.mjs +168 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-DZP67EKU.mjs +70 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-EICP7K5X.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-GDY2UAB4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-H7VHZCWX.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-IJBDOHL6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JFFVMJIA.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JQRUD6KW.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JZGDI5JK.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-KD6SPIPN.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-NF366YI6.mjs +231 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-NUDPKBEF.mjs +32 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-OJINMHTS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-Q6NGPIAH.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-QJSWEUOL.mjs +132 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-R7JDMUKV.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-RCXAM2GK.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-RT4MAWR3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-SFMINX4W.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-SLDQ463B.mjs +88 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-STOV2HOB.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-T5OCTHI4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-TCEHX7R3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VQC2EELJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VRZKL3EH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VTHDQ7BV.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VY2OSTJR.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-WUBWJARI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-YBMQ5JGJ.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-YDMLL4PJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-Z6V44ARX.mjs +62 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZJJ7VQJP.mjs +339 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZNLK7HRR.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZQN7UHIL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZS6VBONO.mjs +174 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZUNWM646.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-FGAMPOII.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-v2-AI5RJEK4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cose-bilkent-Q72C2OJ3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefin-OW5HDTMX-6OCTWOGG.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefinDiagram-2OOWUY4M.mjs +62 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/dagre-MPVFI544.mjs +4 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-AE4NWXFW.mjs +24 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-BUJID5UG.mjs +41 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-C44CZ5NI.mjs +24 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-EYOLEXXS.mjs +30 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-P7B6PWOJ.mjs +3 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ebnfDiagram-FTPZ3PV6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/erDiagram-H3ERR26V.mjs +99 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/eventmodeling-NTZA5JFV-WKSWQHFS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/flowDiagram-YHGXBVSY.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ganttDiagram-RWFTB7ED.mjs +292 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/gitGraph-4MIJSDKK-JH2HKYUO.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/gitGraphDiagram-MAR6GKOP.mjs +106 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/info-A6RAGUB7-3TX3OFWW.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/infoDiagram-LV547AFH.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ishikawaDiagram-PUJQGNDS.mjs +70 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/journeyDiagram-EW5QJT4W.mjs +139 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/kanban-definition-JSQERAZB.mjs +89 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/katex-CZ4GXH2S.mjs +257 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/mindmap-definition-VBJCLQLM.mjs +96 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/packet-AYTQ26CC-MKII6P3Y.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pegDiagram-7WILOQTJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pie-WAS4IAKB-6B4OPMJ5.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pieDiagram-EFA7CBSB.mjs +39 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/quadrantDiagram-WARVYA7P.mjs +7 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/radar-RG4KPBEZ-UPTR3XUL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-74A4TZTK-MEFUPFMS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-abnf-HS5TGJTU-R5YG2S5D.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-ebnf-LZEXJU2U-G5QEX2L6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-peg-WCYAUIDC-H5I2ZRY2.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroadDiagram-5NIQVNLQ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/requirementDiagram-SXREGOKZ.mjs +84 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sankeyDiagram-VV74M2VP.mjs +40 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sequenceDiagram-52ZFIFDL.mjs +162 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sizeCapture-FGA5AGYP.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-3QAKPIVI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-v2-HN2P4RDZ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/swimlanes-QLVP42QD.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/swimlanesDiagram-JKPDBFCN.mjs +8 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/timeline-definition-GS45XAXW.mjs +120 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/treeView-Q6P3EWNA-ZRJGANNQ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/treemap-WGGIJYW6-K64VN5AS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/vennDiagram-QIQU2ZRJ.mjs +34 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/wardley-WFR3VGLG-D67OWCCH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/wardleyDiagram-U6YNM66N.mjs +78 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/xychartDiagram-XJAZEDNM.mjs +7 -0
- package/neural-interface/public/vendor/mermaid/manifest.json +4 -0
- package/neural-interface/public/vendor/mermaid/mermaid-11.17.2.esm.min.mjs +14 -0
- package/neural-interface/scripts/build-vendor.mjs +84 -3
- package/neural-interface/server.js +1099 -286
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/skills/synabun/modules/schedule.md +1 -1
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
7
|
|
|
8
8
|
import { fetchProvidersFull } from './ocp-v2-providers.js';
|
|
9
|
+
import { opencodeProviders } from '../opencode-providers.js';
|
|
9
10
|
import { modelRowMeta } from './ocp-v2-status-logic.js';
|
|
10
11
|
import { openProviderSettings } from './ocp-v2-settings-link.js';
|
|
11
12
|
import { getDefaultStore } from './ocp-v2-state.js';
|
|
@@ -49,6 +50,7 @@ let _unsubscribe = null;
|
|
|
49
50
|
let _outsideHandler = null;
|
|
50
51
|
let _providersChangedHandler = null;
|
|
51
52
|
let _hiddenModelsChangedHandler = null;
|
|
53
|
+
let _providersCacheStop = null;
|
|
52
54
|
|
|
53
55
|
let _providers = []; // [{ id, name, models: [...] }]
|
|
54
56
|
let _connected = new Set();
|
|
@@ -88,7 +90,15 @@ export function mountModelPicker(rootEl, store = getDefaultStore()) {
|
|
|
88
90
|
_dd.addEventListener('click', async (event) => {
|
|
89
91
|
if (event.target.closest('.ocpv2-dd-menu')) return;
|
|
90
92
|
if (_dd.classList.contains('open')) { closeMenu(); return; }
|
|
91
|
-
|
|
93
|
+
// The kept list opens the menu at once; only a list never read shows "Loading…" until it arrives.
|
|
94
|
+
if (!_loaded) adoptKeptProviders();
|
|
95
|
+
if (!_loaded) {
|
|
96
|
+
paintMenu('');
|
|
97
|
+
openMenu();
|
|
98
|
+
try { await ensureLoaded(); } catch {}
|
|
99
|
+
repaintOpenMenu();
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
92
102
|
paintMenu('');
|
|
93
103
|
openMenu();
|
|
94
104
|
});
|
|
@@ -101,11 +111,11 @@ export function mountModelPicker(rootEl, store = getDefaultStore()) {
|
|
|
101
111
|
document.addEventListener('mousedown', _outsideHandler);
|
|
102
112
|
|
|
103
113
|
_providersChangedHandler = () => { refreshProviders(); };
|
|
104
|
-
_hiddenModelsChangedHandler = () => {
|
|
105
|
-
if (_dd?.classList.contains('open')) paintMenu(_searchInput?.value || '');
|
|
106
|
-
};
|
|
114
|
+
_hiddenModelsChangedHandler = () => { repaintOpenMenu(); };
|
|
107
115
|
document.addEventListener('ocp-providers-changed', _providersChangedHandler);
|
|
108
116
|
document.addEventListener('ocp-hidden-models-changed', _hiddenModelsChangedHandler);
|
|
117
|
+
// A background read of the kept list brought another one: the open menu follows in place.
|
|
118
|
+
_providersCacheStop = opencodeProviders.subscribe(() => { refreshProviders(); });
|
|
109
119
|
|
|
110
120
|
_unsubscribe = subscribe((event) => {
|
|
111
121
|
if (event?.type === 'config:model') applyLabelFromState();
|
|
@@ -120,6 +130,8 @@ export function unmountModelPicker() {
|
|
|
120
130
|
if (_outsideHandler) document.removeEventListener('mousedown', _outsideHandler);
|
|
121
131
|
if (_providersChangedHandler) document.removeEventListener('ocp-providers-changed', _providersChangedHandler);
|
|
122
132
|
if (_hiddenModelsChangedHandler) document.removeEventListener('ocp-hidden-models-changed', _hiddenModelsChangedHandler);
|
|
133
|
+
try { _providersCacheStop?.(); } catch {}
|
|
134
|
+
_providersCacheStop = null;
|
|
123
135
|
_outsideHandler = null;
|
|
124
136
|
_providersChangedHandler = null;
|
|
125
137
|
_hiddenModelsChangedHandler = null;
|
|
@@ -134,6 +146,26 @@ export function unmountModelPicker() {
|
|
|
134
146
|
|
|
135
147
|
// ── Loading providers ──────────────────────────────────────────────────────
|
|
136
148
|
|
|
149
|
+
function applyProviders(res) {
|
|
150
|
+
if (res?.ok === false) throw new Error(res.error || 'provider metadata unavailable');
|
|
151
|
+
const data = res?.data || {};
|
|
152
|
+
_providers = data.all || data.providers || (Array.isArray(data) ? data : []);
|
|
153
|
+
_connected = new Set(data.connected || []);
|
|
154
|
+
// If the server didn't tell us which providers are "connected", assume all
|
|
155
|
+
// returned providers are connected so the menu isn't empty.
|
|
156
|
+
if (!_connected.size && _providers.length) {
|
|
157
|
+
_connected = new Set(_providers.map((p) => p.id).filter(Boolean));
|
|
158
|
+
}
|
|
159
|
+
_loaded = true;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// The list the page already holds (data cache, read at launch or by another module): no request.
|
|
163
|
+
function adoptKeptProviders() {
|
|
164
|
+
const kept = opencodeProviders.peek('');
|
|
165
|
+
if (!kept || kept.ok === false) return;
|
|
166
|
+
try { applyProviders(kept); } catch { /* not a list: read it */ }
|
|
167
|
+
}
|
|
168
|
+
|
|
137
169
|
async function ensureLoaded() {
|
|
138
170
|
if (_loaded) return;
|
|
139
171
|
if (_loadInflight) return _loadInflight;
|
|
@@ -142,16 +174,7 @@ async function ensureLoaded() {
|
|
|
142
174
|
try {
|
|
143
175
|
const res = await fetchProvidersFull();
|
|
144
176
|
if (generation !== _loadGeneration) return;
|
|
145
|
-
|
|
146
|
-
const data = res?.data || {};
|
|
147
|
-
_providers = data.all || data.providers || (Array.isArray(data) ? data : []);
|
|
148
|
-
_connected = new Set(data.connected || []);
|
|
149
|
-
// If the server didn't tell us which providers are "connected", assume all
|
|
150
|
-
// returned providers are connected so the menu isn't empty.
|
|
151
|
-
if (!_connected.size && _providers.length) {
|
|
152
|
-
_connected = new Set(_providers.map((p) => p.id).filter(Boolean));
|
|
153
|
-
}
|
|
154
|
-
_loaded = true;
|
|
177
|
+
applyProviders(res);
|
|
155
178
|
} catch (err) {
|
|
156
179
|
console.warn('[ocp-v2-modelpicker] providers fetch failed', err);
|
|
157
180
|
} finally {
|
|
@@ -165,9 +188,23 @@ function refreshProviders() {
|
|
|
165
188
|
_loaded = false;
|
|
166
189
|
_loadInflight = null;
|
|
167
190
|
_loadGeneration += 1;
|
|
168
|
-
return ensureLoaded().finally(() => {
|
|
169
|
-
|
|
170
|
-
|
|
191
|
+
return ensureLoaded().finally(() => { repaintOpenMenu(); });
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// The open menu drawn again from the current list: the search text, its caret and the scroll position stay,
|
|
195
|
+
// and focus is put back only where it was.
|
|
196
|
+
function repaintOpenMenu() {
|
|
197
|
+
if (!_dd?.classList.contains('open') || !_menu) return;
|
|
198
|
+
const input = _searchInput;
|
|
199
|
+
const typing = !!input && document.activeElement === input;
|
|
200
|
+
const caret = typing ? [input.selectionStart, input.selectionEnd] : null;
|
|
201
|
+
const scrollTop = _menu.scrollTop;
|
|
202
|
+
paintMenu(input?.value || '');
|
|
203
|
+
_menu.scrollTop = scrollTop;
|
|
204
|
+
if (typing && _searchInput) {
|
|
205
|
+
try { _searchInput.focus({ preventScroll: true }); } catch { _searchInput.focus(); }
|
|
206
|
+
try { if (caret) _searchInput.setSelectionRange(caret[0], caret[1]); } catch { /* not a text field */ }
|
|
207
|
+
}
|
|
171
208
|
}
|
|
172
209
|
|
|
173
210
|
// ── Label sync ─────────────────────────────────────────────────────────────
|
|
@@ -12,9 +12,10 @@ import { state, emit, on } from '../state.js';
|
|
|
12
12
|
import { storage } from '../storage.js';
|
|
13
13
|
import { fetchProjects } from '../api.js';
|
|
14
14
|
import { injectStyles } from './ocp-v2-styles.js';
|
|
15
|
-
import { connect, api, hasSessionStore, onSessionCompacted, onEvent, supports, isDescendantSession } from './ocp-v2-ws.js';
|
|
15
|
+
import { connect, api, hasSessionStore, onSessionCompacted, onEvent, onReconnect, supports, isDescendantSession } from './ocp-v2-ws.js';
|
|
16
16
|
import {
|
|
17
17
|
menuSessions, pickReusableEmptySession, shareView, SHARE_CONFIRM_TEXT, createPendingRenames, createStoppedShares,
|
|
18
|
+
sessionBusyFromEvent, sessionBusyFromStatus, tabPillState, automationTurnPhase,
|
|
18
19
|
} from './ocp-v2-sessions-logic.js';
|
|
19
20
|
import {
|
|
20
21
|
forkSession, shareSession, unshareSession, undoLastTurn, restoreReverted,
|
|
@@ -82,6 +83,9 @@ let OCP_WINDOW_ID = (() => {
|
|
|
82
83
|
let STOR_TABS = `opencode-v2-tabs-${OCP_WINDOW_ID}`;
|
|
83
84
|
let STOR_AUTOMATIONS = `opencode-v2-automations-${OCP_WINDOW_ID}`;
|
|
84
85
|
let STOR_TITLE_STATES = `opencode-v2-title-states-${OCP_WINDOW_ID}`;
|
|
86
|
+
// The tabs whose session was working when last seen: after a reload their placeholder pills say so and
|
|
87
|
+
// the panel boots to ask OpenCode (ui-sidepanel-tray.js). Never read as the truth: OpenCode's answer is.
|
|
88
|
+
let STOR_BUSY = `opencode-v2-busy-${OCP_WINDOW_ID}`;
|
|
85
89
|
const STOR_WINDOW_REGISTRY = 'opencode-v2-windows';
|
|
86
90
|
const HEAL_DEBOUNCE_MS = 800;
|
|
87
91
|
const HEAL_RETRY_MAX_MS = 30000;
|
|
@@ -94,6 +98,13 @@ let _tabPills = new Map(); // sessionId -> pill element
|
|
|
94
98
|
let _tabInfoCache = new Map(); // sessionId -> last-known session info (title, etc.)
|
|
95
99
|
const _automationRunIds = new Map(); // sessionId -> native loop runId
|
|
96
100
|
const _automationRunning = new Set();
|
|
101
|
+
// sessionId → what a live automation run's turn does ('working', 'waiting' on the user, 'idle' between turns:
|
|
102
|
+
// automationTurnPhase of the run's descriptor): its pill follows the turn, not the run.
|
|
103
|
+
const _automationTurn = new Map();
|
|
104
|
+
// sessionId → working (true) or idle (false), for the tabs that are not on screen: OpenCode's run events
|
|
105
|
+
// and session:status answers say it (noteSessionBusy); the session on screen leaves its own run state
|
|
106
|
+
// here when the user moves on (renderPill), so its pill keeps moving while its turn goes on.
|
|
107
|
+
const _sessionBusy = new Map();
|
|
97
108
|
const _automationContinuedManually = new Set();
|
|
98
109
|
const _automationManualSendInFlight = new Set();
|
|
99
110
|
const _foreignActiveAutomationSessions = new Set();
|
|
@@ -173,6 +184,7 @@ function forkClonedOpenCodePersistence() {
|
|
|
173
184
|
STOR_TABS = `opencode-v2-tabs-${OCP_WINDOW_ID}`;
|
|
174
185
|
STOR_AUTOMATIONS = `opencode-v2-automations-${OCP_WINDOW_ID}`;
|
|
175
186
|
STOR_TITLE_STATES = `opencode-v2-title-states-${OCP_WINDOW_ID}`;
|
|
187
|
+
STOR_BUSY = `opencode-v2-busy-${OCP_WINDOW_ID}`;
|
|
176
188
|
if (transferableTabs.length) storage.setItem(STOR_TABS, JSON.stringify(transferableTabs));
|
|
177
189
|
if (transferableRows.length) storage.setItem(STOR_AUTOMATIONS, JSON.stringify(transferableRows));
|
|
178
190
|
if (Object.keys(transferableTitleStates).length) storage.setItem(STOR_TITLE_STATES, JSON.stringify(transferableTitleStates));
|
|
@@ -188,6 +200,7 @@ function cleanStaleOpenCodeWindows() {
|
|
|
188
200
|
storage.removeItem(`opencode-v2-tabs-${windowId}`);
|
|
189
201
|
storage.removeItem(`opencode-v2-automations-${windowId}`);
|
|
190
202
|
storage.removeItem(`opencode-v2-title-states-${windowId}`);
|
|
203
|
+
storage.removeItem(`opencode-v2-busy-${windowId}`);
|
|
191
204
|
delete registry[windowId];
|
|
192
205
|
}
|
|
193
206
|
registry[OCP_WINDOW_ID] = now;
|
|
@@ -243,6 +256,8 @@ function saveAutomationTabs() {
|
|
|
243
256
|
sessionId,
|
|
244
257
|
runId,
|
|
245
258
|
running: _automationRunning.has(sessionId),
|
|
259
|
+
// What its turn did when this was written (automationTurnPhase): a reload's placeholder pill follows it.
|
|
260
|
+
turn: _automationTurn.get(sessionId) || null,
|
|
246
261
|
ownerId: nativeLoopWindowId,
|
|
247
262
|
continuedManually: _automationContinuedManually.has(sessionId),
|
|
248
263
|
}));
|
|
@@ -264,6 +279,44 @@ function saveAutomationTabs() {
|
|
|
264
279
|
} catch {}
|
|
265
280
|
}
|
|
266
281
|
|
|
282
|
+
// ── What the tabs that are not on screen are doing (_sessionBusy) ──
|
|
283
|
+
|
|
284
|
+
function saveBusySessions() {
|
|
285
|
+
try {
|
|
286
|
+
const busy = _tabSessionIds.filter((sid) => _sessionBusy.get(sid) === true);
|
|
287
|
+
if (busy.length) storage.setItem(STOR_BUSY, JSON.stringify(busy));
|
|
288
|
+
else storage.removeItem(STOR_BUSY);
|
|
289
|
+
} catch {}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** Record what a session is doing; true when that changed. */
|
|
293
|
+
function rememberBusy(sessionId, busy) {
|
|
294
|
+
if (!sessionId || _sessionBusy.get(sessionId) === !!busy) return false;
|
|
295
|
+
_sessionBusy.set(sessionId, !!busy);
|
|
296
|
+
saveBusySessions();
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** A tab's session started or ended a turn while another one is on screen: its pill follows. */
|
|
301
|
+
function noteSessionBusy(sessionId, busy) {
|
|
302
|
+
if (rememberBusy(sessionId, busy) && _tabSessionIds.includes(sessionId)) renderPill();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Ask OpenCode what every tab that is not on screen is doing: after a boot (only the session on screen
|
|
307
|
+
* is read back by its rehydrate) and after the socket came back (their events of the outage reached no
|
|
308
|
+
* one). A server that does not answer session:status leaves what is known.
|
|
309
|
+
*/
|
|
310
|
+
async function probeTabStatuses() {
|
|
311
|
+
const activeSid = getState().sessionId;
|
|
312
|
+
await Promise.all(_tabSessionIds.filter((sid) => sid && sid !== activeSid).map(async (sid) => {
|
|
313
|
+
let res = null;
|
|
314
|
+
try { res = await api.sessionStatus({ sessionId: sid, cwd: _tabInfoCache.get(sid)?.directory || undefined }); } catch { res = null; }
|
|
315
|
+
const busy = sessionBusyFromStatus(res);
|
|
316
|
+
if (busy !== null && sid !== getState().sessionId && _tabSessionIds.includes(sid)) noteSessionBusy(sid, busy);
|
|
317
|
+
}));
|
|
318
|
+
}
|
|
319
|
+
|
|
267
320
|
try {
|
|
268
321
|
const rows = JSON.parse(storage.getItem(STOR_AUTOMATIONS) || '[]');
|
|
269
322
|
for (const row of Array.isArray(rows) ? rows : []) {
|
|
@@ -608,6 +661,9 @@ function buildPanel() {
|
|
|
608
661
|
// Sessions change outside this panel too (another window, the CLI, a title
|
|
609
662
|
// OpenCode generated): keep the open menu and the tab list in step.
|
|
610
663
|
onEvent((eventType, ev) => {
|
|
664
|
+
// A tab that is not on screen goes on running its turn: its pill says what OpenCode says it does.
|
|
665
|
+
const run = sessionBusyFromEvent(eventType, ev);
|
|
666
|
+
if (run && run.sessionId !== getState().sessionId && _tabSessionIds.includes(run.sessionId)) noteSessionBusy(run.sessionId, run.busy);
|
|
611
667
|
if (eventType !== 'session.updated' && eventType !== 'session.deleted' && eventType !== 'session.created') return;
|
|
612
668
|
if (eventType === 'session.deleted') {
|
|
613
669
|
const sid = ev?.info?.id || ev?.sessionID || ev?.sessionId;
|
|
@@ -626,6 +682,11 @@ function buildPanel() {
|
|
|
626
682
|
const sid = getState().sessionId;
|
|
627
683
|
if (sid) refreshSessionMessages(sid).catch((err) => console.warn('[ocp-v2-panel] post-compaction refresh failed', err));
|
|
628
684
|
});
|
|
685
|
+
|
|
686
|
+
// Back after an outage: what the other tabs did meanwhile reached no one (the session on screen heals itself).
|
|
687
|
+
onReconnect(() => {
|
|
688
|
+
if (_booted) probeTabStatuses().catch((err) => console.warn('[ocp-v2-panel] tab status probe failed', err));
|
|
689
|
+
});
|
|
629
690
|
}
|
|
630
691
|
|
|
631
692
|
// A reverted prompt goes back into the composer with what it carried, each
|
|
@@ -1672,6 +1733,10 @@ async function boot() {
|
|
|
1672
1733
|
create: (nav) => startFreshSession({ cwd: lastProject || undefined, nav }),
|
|
1673
1734
|
});
|
|
1674
1735
|
}
|
|
1736
|
+
// The other tabs: their turns may have outlived the page too. Asked before the placeholders go
|
|
1737
|
+
// (a short wait at most), so a working tab's pill does not blink idle in between.
|
|
1738
|
+
const probed = probeTabStatuses().catch((err) => console.warn('[ocp-v2-panel] tab status probe failed', err));
|
|
1739
|
+
await Promise.race([probed, new Promise((resolveWait) => setTimeout(resolveWait, 600))]);
|
|
1675
1740
|
_booted = true;
|
|
1676
1741
|
// Tell ui-sidepanel-tray we own opencode pills now — it drops any
|
|
1677
1742
|
// placeholder pills it was rendering from storage.
|
|
@@ -2388,9 +2453,11 @@ function removeTab(sessionId, { byUser = false } = {}) {
|
|
|
2388
2453
|
_automationRunIds.delete(sessionId);
|
|
2389
2454
|
unregisterAutomationSession(sessionId);
|
|
2390
2455
|
_automationRunning.delete(sessionId);
|
|
2456
|
+
_automationTurn.delete(sessionId);
|
|
2391
2457
|
_automationContinuedManually.delete(sessionId);
|
|
2392
2458
|
_automationManualSendInFlight.delete(sessionId);
|
|
2393
2459
|
saveAutomationTabs();
|
|
2460
|
+
if (_sessionBusy.delete(sessionId)) saveBusySessions();
|
|
2394
2461
|
const pill = _tabPills.get(sessionId);
|
|
2395
2462
|
if (pill?.isConnected) pill.remove();
|
|
2396
2463
|
_tabPills.delete(sessionId);
|
|
@@ -2481,6 +2548,8 @@ function renderPill() {
|
|
|
2481
2548
|
if (!tray) return;
|
|
2482
2549
|
const activeSid = getState().sessionId;
|
|
2483
2550
|
if (activeSid) ensureTab(activeSid, getState().sessionInfo);
|
|
2551
|
+
// What the session on screen is doing stays known for its tab once the user moves on.
|
|
2552
|
+
if (activeSid) rememberBusy(activeSid, !!getState().running);
|
|
2484
2553
|
|
|
2485
2554
|
// Drop pills for sessions no longer in the tab list
|
|
2486
2555
|
for (const [sid, pill] of Array.from(_tabPills.entries())) {
|
|
@@ -2501,7 +2570,14 @@ function renderPill() {
|
|
|
2501
2570
|
if (labelEl) labelEl.textContent = tabLabelFor(sid);
|
|
2502
2571
|
const isActive = sid === activeSid;
|
|
2503
2572
|
pill.classList.toggle('ocpv2-pill-active', isActive);
|
|
2504
|
-
pill
|
|
2573
|
+
// One pill per session, each with its own state: a tab the user left goes on showing its turn, an
|
|
2574
|
+
// automation its turn (not its run), and a session that waits on the user says so.
|
|
2575
|
+
const state = tabPillState({
|
|
2576
|
+
sessionId: sid, activeSessionId: activeSid, running: !!getState().running,
|
|
2577
|
+
busy: _sessionBusy.get(sid) === true, automation: _automationTurn.get(sid) || null,
|
|
2578
|
+
});
|
|
2579
|
+
pill.classList.toggle('ocpv2-pill-running', state === 'working');
|
|
2580
|
+
pill.classList.toggle('ocpv2-pill-waiting', state === 'waiting');
|
|
2505
2581
|
pill.style.display = (isActive && _visible) ? 'none' : '';
|
|
2506
2582
|
}
|
|
2507
2583
|
// The sub-agent pills of the session on screen sit under its pill.
|
|
@@ -2624,6 +2700,16 @@ export async function endHostedOpenCodeSessions() {
|
|
|
2624
2700
|
|
|
2625
2701
|
export function isOpencodePanelOpen() { return _visible || isChildPanelOpen(); }
|
|
2626
2702
|
|
|
2703
|
+
/**
|
|
2704
|
+
* Boot the panel without showing it (ui-sidepanel-tray.js, when a tab saved while it worked comes back
|
|
2705
|
+
* after a reload): its tabs come back and OpenCode is asked what each session does, so their pills say it.
|
|
2706
|
+
*/
|
|
2707
|
+
export async function bootOpencodePanel() {
|
|
2708
|
+
if (!_panelEl) buildPanel();
|
|
2709
|
+
await connect();
|
|
2710
|
+
await boot();
|
|
2711
|
+
}
|
|
2712
|
+
|
|
2627
2713
|
export async function toggleOpencodePanel() {
|
|
2628
2714
|
if (_visible || isChildPanelOpen()) {
|
|
2629
2715
|
requestOpencodeView({ hideAll: true });
|
|
@@ -2653,6 +2739,10 @@ export async function attachOpenCodeAutomation(run, { focus = !!run?.focus, isCa
|
|
|
2653
2739
|
}
|
|
2654
2740
|
if (running) _automationRunning.add(sessionId);
|
|
2655
2741
|
else _automationRunning.delete(sessionId);
|
|
2742
|
+
// Every update of the run (its turn starts, waits on you, ends) comes through here: the pill follows it.
|
|
2743
|
+
const phase = automationTurnPhase(run);
|
|
2744
|
+
if (phase) _automationTurn.set(sessionId, phase);
|
|
2745
|
+
else _automationTurn.delete(sessionId);
|
|
2656
2746
|
saveAutomationTabs();
|
|
2657
2747
|
const info = {
|
|
2658
2748
|
id: sessionId,
|
|
@@ -2711,6 +2801,7 @@ export async function detachOpenCodeAutomation(runId) {
|
|
|
2711
2801
|
const [sessionId] = entry;
|
|
2712
2802
|
_automationRunIds.delete(sessionId);
|
|
2713
2803
|
_automationRunning.delete(sessionId);
|
|
2804
|
+
_automationTurn.delete(sessionId);
|
|
2714
2805
|
_automationContinuedManually.delete(sessionId);
|
|
2715
2806
|
_automationManualSendInFlight.delete(sessionId);
|
|
2716
2807
|
saveAutomationTabs();
|
|
@@ -12,6 +12,7 @@ import { captureBinding, latestOnly } from './ocp-v2-binding.js';
|
|
|
12
12
|
import { setSessionMcpProfile } from './ocp-v2-session-actions.js';
|
|
13
13
|
import { storage } from '../storage.js';
|
|
14
14
|
import { on } from '../state.js';
|
|
15
|
+
import { escapeHtml } from '../utils.js';
|
|
15
16
|
|
|
16
17
|
let _currentStore = getDefaultStore();
|
|
17
18
|
const getState = () => _currentStore.getState();
|
|
@@ -507,7 +508,7 @@ function paintProfileMenu() {
|
|
|
507
508
|
const opt = document.createElement('div');
|
|
508
509
|
opt.className = 'ocpv2-dd-option' + (p.id === _currentProfile ? ' selected' : '');
|
|
509
510
|
opt.style.gap = '6px';
|
|
510
|
-
opt.innerHTML = `<span>${p.label}</span><span class="ocpv2-dd-hint">${p.hint}</span>`;
|
|
511
|
+
opt.innerHTML = `<span>${escapeHtml(p.label)}</span><span class="ocpv2-dd-hint">${escapeHtml(p.hint)}</span>`;
|
|
511
512
|
opt.addEventListener('click', async (event) => {
|
|
512
513
|
event.stopPropagation();
|
|
513
514
|
ddClose(_profileDd);
|
|
@@ -603,7 +604,7 @@ function paintRecallMenu() {
|
|
|
603
604
|
const opt = document.createElement('div');
|
|
604
605
|
opt.className = 'ocpv2-dd-option' + (p.id === _recallProfile ? ' selected' : '');
|
|
605
606
|
opt.style.gap = '6px';
|
|
606
|
-
opt.innerHTML = `<span>${p.label}</span><span class="ocpv2-dd-hint">${p.hint}</span>`;
|
|
607
|
+
opt.innerHTML = `<span>${escapeHtml(p.label)}</span><span class="ocpv2-dd-hint">${escapeHtml(p.hint)}</span>`;
|
|
607
608
|
opt.addEventListener('click', async (event) => {
|
|
608
609
|
event.stopPropagation();
|
|
609
610
|
ddClose(_recallDd);
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
2
2
|
// OpenCode V2 — one read of the provider list for every module
|
|
3
3
|
// The model picker, the variant picker, the context gauge and the composer
|
|
4
|
-
// each need
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// each need the provider list. They ask through here, so opening the panel
|
|
5
|
+
// reads it once: the compact view of GET /api/opencode/providers/full (the
|
|
6
|
+
// connected providers, opencode-providers.js), kept in the page's data cache
|
|
7
|
+
// and given at once on every later open. A change (`ocp-providers-changed`)
|
|
8
|
+
// drops the copy and reads it again.
|
|
7
9
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
8
10
|
|
|
11
|
+
import { fetchOpencodeProviders, opencodeProviders } from '../opencode-providers.js';
|
|
12
|
+
|
|
9
13
|
// Long enough to cover the burst of readers at mount and at a refresh, short
|
|
10
14
|
// enough that a later, deliberate refresh reads the server again.
|
|
11
15
|
export const PROVIDERS_SHARE_MS = 3000;
|
|
@@ -27,9 +31,7 @@ export function createSharedFetch(fetchJson, { shareMs = PROVIDERS_SHARE_MS, now
|
|
|
27
31
|
return read;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
/** The parsed body of
|
|
31
|
-
export const fetchProvidersFull =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
document.addEventListener('ocp-providers-changed', () => fetchProvidersFull.invalidate());
|
|
35
|
-
}
|
|
34
|
+
/** The parsed body of the provider list: `{ ok, data: { all, default, connected } }` (connected providers). */
|
|
35
|
+
export const fetchProvidersFull = Object.assign(() => fetchOpencodeProviders(), {
|
|
36
|
+
invalidate: () => opencodeProviders.invalidate(''),
|
|
37
|
+
});
|
|
@@ -41,16 +41,27 @@ export const ANCESTRY_MAX_DEPTH = 12;
|
|
|
41
41
|
* anything that is not a string means "unknown"
|
|
42
42
|
* Unknown is false: ancestry that cannot be established is not ancestry.
|
|
43
43
|
*/
|
|
44
|
-
export async function verifyDescendant(sessionId, ancestorId,
|
|
44
|
+
export async function verifyDescendant(sessionId, ancestorId, options = {}) {
|
|
45
|
+
return (await descendantState(sessionId, ancestorId, options)) === true;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The same walk, with "could not be read" kept apart from "no": true, false
|
|
50
|
+
* (the chain ends, or loops, without `ancestorId`), or null when a link could
|
|
51
|
+
* not be read (no `fetchParent`, a failed or odd reply). For a caller that
|
|
52
|
+
* must not take an unread link for an answer (readOpenAsks).
|
|
53
|
+
*/
|
|
54
|
+
export async function descendantState(sessionId, ancestorId, { parentOf, roots, fetchParent } = {}) {
|
|
45
55
|
if (!sessionId || !ancestorId || sessionId === ancestorId) return false;
|
|
46
56
|
const seen = new Set([sessionId]);
|
|
47
57
|
let cursor = sessionId;
|
|
48
58
|
for (let depth = 0; depth < ANCESTRY_MAX_DEPTH; depth++) {
|
|
49
59
|
let parent = parentOf?.get(cursor);
|
|
50
60
|
if (parent === undefined) {
|
|
51
|
-
if (roots?.has(cursor)
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
if (roots?.has(cursor)) return false;
|
|
62
|
+
if (typeof fetchParent !== 'function') return null;
|
|
63
|
+
try { parent = await fetchParent(cursor); } catch { return null; }
|
|
64
|
+
if (typeof parent !== 'string') return null;
|
|
54
65
|
if (parent) parentOf?.set(cursor, parent);
|
|
55
66
|
else roots?.add(cursor);
|
|
56
67
|
}
|
|
@@ -49,7 +49,7 @@ let _markedLoading = false;
|
|
|
49
49
|
function ensureMarked() {
|
|
50
50
|
if (_marked || _markedLoading || typeof window === 'undefined') return;
|
|
51
51
|
_markedLoading = true;
|
|
52
|
-
import('
|
|
52
|
+
import('/vendor/marked/marked-14.1.4.esm.js')
|
|
53
53
|
.then((mod) => {
|
|
54
54
|
_marked = mod?.marked || mod?.default || null;
|
|
55
55
|
if (_marked?.setOptions) _marked.setOptions({ breaks: true, gfm: true });
|