synabun 2.3.1 → 2.4.1
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 +41 -0
- package/README.md +1 -1
- package/browser-extension/content.js +189 -0
- package/browser-extension/engine.js +508 -0
- package/browser-extension/icons/icon-128.png +0 -0
- package/browser-extension/icons/icon-16.png +0 -0
- package/browser-extension/icons/icon-32.png +0 -0
- package/browser-extension/icons/icon-48.png +0 -0
- package/browser-extension/icons/status-off-16.png +0 -0
- package/browser-extension/icons/status-off-32.png +0 -0
- package/browser-extension/icons/status-off-48.png +0 -0
- package/browser-extension/icons/status-on-16.png +0 -0
- package/browser-extension/icons/status-on-32.png +0 -0
- package/browser-extension/icons/status-on-48.png +0 -0
- package/browser-extension/manifest.json +56 -0
- package/browser-extension/popup-strings.js +250 -0
- package/browser-extension/popup-view.js +151 -0
- package/browser-extension/popup.css +166 -0
- package/browser-extension/popup.html +108 -0
- package/browser-extension/popup.js +359 -0
- package/browser-extension/protocol.js +232 -0
- package/browser-extension/service-worker.js +275 -0
- package/browser-extension/setup-content.js +36 -0
- package/browser-extension/tokens.css +326 -0
- package/docs/browser-extension-bridge.md +84 -0
- package/docs/whatsapp.md +1 -1
- package/lib/data-home-files.js +45 -0
- package/lib/data-home-migration.js +34 -58
- package/mcp-server/dist/http.d.ts +2 -0
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +9 -1
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts +11 -0
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +38 -3
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.d.ts +6 -2
- package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -1
- package/mcp-server/dist/services/browser-route-flow.js +10 -3
- package/mcp-server/dist/services/browser-route-flow.js.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.js +7 -0
- package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +95 -3
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +168 -23
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/team-context.d.ts +18 -0
- package/mcp-server/dist/services/team-context.d.ts.map +1 -0
- package/mcp-server/dist/services/team-context.js +29 -0
- package/mcp-server/dist/services/team-context.js.map +1 -0
- package/mcp-server/dist/services/tool-catalog.d.ts +5 -2
- package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -1
- package/mcp-server/dist/services/tool-catalog.js +22 -6
- package/mcp-server/dist/services/tool-catalog.js.map +1 -1
- package/mcp-server/dist/services/tool-list.d.ts.map +1 -1
- package/mcp-server/dist/services/tool-list.js +4 -0
- package/mcp-server/dist/services/tool-list.js.map +1 -1
- package/mcp-server/dist/services/tool-runtime.d.ts +8 -1
- package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -1
- package/mcp-server/dist/services/tool-runtime.js +18 -1
- package/mcp-server/dist/services/tool-runtime.js.map +1 -1
- package/mcp-server/dist/tools/agent-definition.d.ts +133 -0
- package/mcp-server/dist/tools/agent-definition.d.ts.map +1 -0
- package/mcp-server/dist/tools/agent-definition.js +483 -0
- package/mcp-server/dist/tools/agent-definition.js.map +1 -0
- package/mcp-server/dist/tools/agents.d.ts +92 -9
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +163 -20
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +8 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +70 -6
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/git-tools.d.ts +4 -2
- package/mcp-server/dist/tools/git-tools.d.ts.map +1 -1
- package/mcp-server/dist/tools/git-tools.js +283 -2
- package/mcp-server/dist/tools/git-tools.js.map +1 -1
- package/mcp-server/dist/tools/morelogin.d.ts +8 -2
- package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
- package/mcp-server/dist/tools/morelogin.js +22 -5
- package/mcp-server/dist/tools/morelogin.js.map +1 -1
- package/mcp-server/dist/tools/team.d.ts +32 -0
- package/mcp-server/dist/tools/team.d.ts.map +1 -0
- package/mcp-server/dist/tools/team.js +87 -0
- package/mcp-server/dist/tools/team.js.map +1 -0
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +9 -1
- package/mcp-server/src/index.ts +34 -4
- package/mcp-server/src/services/browser-route-flow.ts +12 -5
- package/mcp-server/src/services/codex-config-heal.ts +7 -0
- package/mcp-server/src/services/neural-interface.ts +191 -29
- package/mcp-server/src/services/team-context.ts +27 -0
- package/mcp-server/src/services/tool-catalog.ts +26 -8
- package/mcp-server/src/services/tool-list.ts +4 -0
- package/mcp-server/src/services/tool-runtime.ts +21 -2
- package/mcp-server/src/tools/agent-definition.ts +458 -0
- package/mcp-server/src/tools/agents.ts +177 -19
- package/mcp-server/src/tools/browser-advanced.ts +60 -6
- package/mcp-server/src/tools/git-tools.ts +249 -3
- package/mcp-server/src/tools/morelogin.ts +20 -5
- package/mcp-server/src/tools/team.ts +97 -0
- package/neural-interface/i18n/en.json +1119 -47
- package/neural-interface/i18n/pt-BR.json +1119 -47
- package/neural-interface/lib/account-usage.js +1 -1
- package/neural-interface/lib/agents/builtins.json +207 -0
- package/neural-interface/lib/agents/density.js +101 -0
- package/neural-interface/lib/agents/forge-host.js +223 -0
- package/neural-interface/lib/agents/native-export-targets.js +190 -0
- package/neural-interface/lib/agents/native-export.js +365 -0
- package/neural-interface/lib/agents/registry.js +885 -0
- package/neural-interface/lib/agents/resolve.js +603 -0
- package/neural-interface/lib/agents/schema.js +642 -0
- package/neural-interface/lib/agents/split.js +37 -0
- package/neural-interface/lib/agents-studio-api.js +591 -0
- package/neural-interface/lib/assistant-api.js +76 -7
- package/neural-interface/lib/assistant-brains/opencode.js +60 -11
- package/neural-interface/lib/assistant-catalog.js +2 -0
- package/neural-interface/lib/assistant-continuity.js +49 -0
- package/neural-interface/lib/assistant-dispatch.js +351 -121
- package/neural-interface/lib/assistant-persona.js +105 -8
- package/neural-interface/lib/assistant-route-gate.js +24 -9
- package/neural-interface/lib/assistant-router.js +432 -47
- package/neural-interface/lib/assistant-run-tail.js +151 -0
- package/neural-interface/lib/assistant-run-wait.js +183 -0
- package/neural-interface/lib/assistant-runtime.js +449 -94
- package/neural-interface/lib/assistant-task-prompt.js +11 -2
- package/neural-interface/lib/assistant-usage.js +3 -2
- package/neural-interface/lib/automation-approval.js +2 -2
- package/neural-interface/lib/backup-service.js +64 -105
- package/neural-interface/lib/browser-close-evidence.js +80 -0
- package/neural-interface/lib/browser-default.js +210 -0
- package/neural-interface/lib/browser-extension-adapter.js +264 -0
- package/neural-interface/lib/browser-extension-bridge.js +441 -0
- package/neural-interface/lib/browser-extension-folder.js +116 -0
- package/neural-interface/lib/browser-extension-setup.js +140 -0
- package/neural-interface/lib/browser-profile-choices.js +3 -3
- package/neural-interface/lib/browser-tool-policy.js +1 -1
- package/neural-interface/lib/claude-account-links.js +301 -0
- package/neural-interface/lib/claude-accounts.js +45 -20
- package/neural-interface/lib/claude-agent-bridge.js +142 -10
- package/neural-interface/lib/claude-model-catalog.js +6 -0
- package/neural-interface/lib/claude-panel-session.js +33 -0
- package/neural-interface/lib/codex-accounts.js +67 -24
- package/neural-interface/lib/coordination/README.md +384 -0
- package/neural-interface/lib/coordination/service.js +563 -0
- package/neural-interface/lib/coordination/store.js +1138 -0
- package/neural-interface/lib/db.js +22 -1
- package/neural-interface/lib/effort-levels.js +10 -1
- package/neural-interface/lib/memory-list-page.js +49 -0
- package/neural-interface/lib/memory-list-stamp.js +60 -0
- package/neural-interface/lib/morelogin-outside-close.js +186 -0
- package/neural-interface/lib/morelogin-profile-failures.js +206 -0
- package/neural-interface/lib/morelogin-start-cooldown.js +160 -0
- package/neural-interface/lib/morelogin.js +194 -8
- package/neural-interface/lib/native-loop-runtime.js +26 -7
- package/neural-interface/lib/opencode-build-preflight.js +28 -8
- package/neural-interface/lib/opencode-native-boundary.js +83 -13
- package/neural-interface/lib/opencode-serve-records.js +14 -9
- package/neural-interface/lib/page-session.js +1 -1
- package/neural-interface/lib/peer-identity.js +73 -29
- package/neural-interface/lib/process-identity.js +68 -7
- package/neural-interface/lib/request-gate.js +3 -0
- package/neural-interface/lib/screenshot-location.js +33 -0
- package/neural-interface/lib/session-cache-builder.js +41 -3
- package/neural-interface/lib/skills/creation.js +1 -1
- package/neural-interface/lib/skills/known-bridge-digests.json +40 -0
- package/neural-interface/lib/studio-attention.js +56 -0
- package/neural-interface/lib/teams/README.md +382 -0
- package/neural-interface/lib/teams/api.js +287 -0
- package/neural-interface/lib/teams/brief.js +185 -0
- package/neural-interface/lib/teams/claims.js +315 -0
- package/neural-interface/lib/teams/git.js +293 -0
- package/neural-interface/lib/teams/index.js +122 -0
- package/neural-interface/lib/teams/integration.js +580 -0
- package/neural-interface/lib/teams/landing.js +184 -0
- package/neural-interface/lib/teams/recovery.js +256 -0
- package/neural-interface/lib/teams/scheduler.js +1474 -0
- package/neural-interface/lib/teams/schema.js +559 -0
- package/neural-interface/lib/teams/state.js +181 -0
- package/neural-interface/lib/teams/test-runner.js +86 -0
- package/neural-interface/lib/teams/test-sandbox.js +99 -0
- package/neural-interface/lib/teams/worktrees.js +757 -0
- package/neural-interface/lib/tool-permission-choices.js +226 -0
- package/neural-interface/lib/whatsapp/cards.js +24 -10
- package/neural-interface/lib/worker-confinement.js +206 -6
- package/neural-interface/package-lock.json +2 -2
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/extension-setup.html +107 -0
- package/neural-interface/public/index.html +103 -12
- package/neural-interface/public/offline.html +4 -3
- package/neural-interface/public/shared/agent-runtime-options.js +3 -1
- package/neural-interface/public/shared/agents/studio/ax-agent-view.js +614 -0
- package/neural-interface/public/shared/agents/studio/ax-api.js +198 -0
- package/neural-interface/public/shared/agents/studio/ax-create-view.js +221 -0
- package/neural-interface/public/shared/agents/studio/ax-diff.js +143 -0
- package/neural-interface/public/shared/agents/studio/ax-editor-view.js +392 -0
- package/neural-interface/public/shared/agents/studio/ax-export-view.js +94 -0
- package/neural-interface/public/shared/agents/studio/ax-form.js +191 -0
- package/neural-interface/public/shared/agents/studio/ax-icons.js +87 -0
- package/neural-interface/public/shared/agents/studio/ax-library-view.js +158 -0
- package/neural-interface/public/shared/agents/studio/ax-library.js +162 -0
- package/neural-interface/public/shared/agents/studio/ax-main.js +712 -0
- package/neural-interface/public/shared/agents/studio/ax-native-export.js +35 -0
- package/neural-interface/public/shared/agents/studio/ax-options.js +198 -0
- package/neural-interface/public/shared/agents/studio/ax-review-view.js +175 -0
- package/neural-interface/public/shared/agents/studio/ax-revisions-view.js +189 -0
- package/neural-interface/public/shared/agents/studio/ax-runs-view.js +202 -0
- package/neural-interface/public/shared/agents/studio/ax-runs.js +82 -0
- package/neural-interface/public/shared/agents/studio/ax-teams-view.js +256 -0
- package/neural-interface/public/shared/agents/studio/ax-teams.js +200 -0
- package/neural-interface/public/shared/agents/studio/ax-templates.js +50 -0
- package/neural-interface/public/shared/agents/studio/ax-ui.js +194 -0
- package/neural-interface/public/shared/agents/studio/ax-views.js +170 -0
- package/neural-interface/public/shared/agy/agy-panel.js +142 -28
- package/neural-interface/public/shared/agy/agy-styles.js +25 -5
- package/neural-interface/public/shared/api.js +2 -1
- package/neural-interface/public/shared/assistant/asst-account-menu.js +13 -13
- package/neural-interface/public/shared/assistant/asst-ask-styles.js +2 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +91 -9
- package/neural-interface/public/shared/assistant/asst-control.js +3 -0
- package/neural-interface/public/shared/assistant/asst-interaction-hold.js +99 -0
- package/neural-interface/public/shared/assistant/asst-limit-dismissals.js +111 -0
- package/neural-interface/public/shared/assistant/asst-limit-dock.js +37 -3
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +30 -7
- package/neural-interface/public/shared/assistant/asst-panel.js +177 -30
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +15 -8
- package/neural-interface/public/shared/assistant/asst-render.js +37 -6
- package/neural-interface/public/shared/assistant/asst-route.js +80 -12
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +148 -70
- package/neural-interface/public/shared/assistant/asst-roving.js +17 -1
- package/neural-interface/public/shared/assistant/asst-scene-styles.js +7 -2
- package/neural-interface/public/shared/assistant/asst-scenes.js +12 -1
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +12 -2
- package/neural-interface/public/shared/assistant/asst-state.js +66 -1
- package/neural-interface/public/shared/assistant/asst-styles.js +98 -44
- package/neural-interface/public/shared/assistant/route-identity.js +16 -0
- package/neural-interface/public/shared/cc-dropdown.js +21 -15
- package/neural-interface/public/shared/cdx/cdx-output.js +10 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +18 -16
- package/neural-interface/public/shared/cdx/cdx-plan.js +3 -2
- package/neural-interface/public/shared/cdx/cdx-render.js +122 -45
- package/neural-interface/public/shared/cdx/cdx-requests.js +4 -4
- package/neural-interface/public/shared/cdx/cdx-styles.js +8 -36
- package/neural-interface/public/shared/cdx/cdx-tabs.js +110 -42
- package/neural-interface/public/shared/claude-panel-lazy.js +12 -0
- package/neural-interface/public/shared/code-copy.js +120 -0
- package/neural-interface/public/shared/constants.js +7 -0
- package/neural-interface/public/shared/context-menu-model.js +1 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
- package/neural-interface/public/shared/cp/cp-session-model.js +86 -5
- package/neural-interface/public/shared/cp/cp-session-settings.js +58 -30
- package/neural-interface/public/shared/cp/cp-styles.js +9 -0
- package/neural-interface/public/shared/dom-change-flag.js +66 -0
- package/neural-interface/public/shared/dom-morph.js +124 -0
- package/neural-interface/public/shared/extension-setup/es-page.css +134 -0
- package/neural-interface/public/shared/extension-setup/es-page.js +120 -0
- package/neural-interface/public/shared/extension-setup/es-view.js +100 -0
- package/neural-interface/public/shared/html-shell.js +34 -4
- package/neural-interface/public/shared/i18n.js +14 -1
- package/neural-interface/public/shared/idle-queue.js +78 -0
- package/neural-interface/public/shared/iface-config.js +227 -0
- package/neural-interface/public/shared/lazy-module.js +108 -0
- package/neural-interface/public/shared/memory-list.js +117 -0
- package/neural-interface/public/shared/morelogin-profile-choices.js +1 -1
- package/neural-interface/public/shared/morelogin-profile-field.js +3 -3
- package/neural-interface/public/shared/mtc/mtc-panel.js +3 -1
- package/neural-interface/public/shared/mtc/mtc-styles.js +4 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +35 -15
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +77 -23
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +3 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +24 -21
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +16 -5
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +16 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +27 -43
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +73 -9
- package/neural-interface/public/shared/owner-authority-view.js +4 -10
- package/neural-interface/public/shared/page-session.js +1 -1
- package/neural-interface/public/shared/schedules-view.js +2 -2
- package/neural-interface/public/shared/session-project-items.js +11 -0
- package/neural-interface/public/shared/settings/settings-ai-browser.js +119 -0
- package/neural-interface/public/shared/settings/settings-browser-extension.js +446 -0
- package/neural-interface/public/shared/settings/settings-ia.js +4 -2
- package/neural-interface/public/shared/settings/settings-morelogin-cooldown.js +63 -0
- package/neural-interface/public/shared/settings/settings-tool-permissions.js +70 -0
- package/neural-interface/public/shared/sidepanel-lazy.js +40 -0
- package/neural-interface/public/shared/sidepanel-session-status.js +8 -14
- package/neural-interface/public/shared/sidepanel-shown.js +73 -0
- package/neural-interface/public/shared/start-bridge.js +2 -2
- package/neural-interface/public/shared/storage.js +6 -1
- package/neural-interface/public/shared/studio-attention.js +83 -0
- package/neural-interface/public/shared/styles.css +694 -50
- package/neural-interface/public/shared/term-browser-tabs.js +34 -0
- package/neural-interface/public/shared/transcript-rows.js +334 -0
- package/neural-interface/public/shared/tray-auto-close.js +106 -0
- package/neural-interface/public/shared/ui-agents.js +97 -0
- package/neural-interface/public/shared/ui-antigravity-panel.js +16 -14
- package/neural-interface/public/shared/ui-automation-studio.js +3 -3
- package/neural-interface/public/shared/ui-claude-panel.js +162 -95
- package/neural-interface/public/shared/ui-code-copy.js +256 -0
- package/neural-interface/public/shared/ui-codex-panel.js +14 -10
- package/neural-interface/public/shared/ui-context-menu.js +1 -1
- package/neural-interface/public/shared/ui-file-explorer.js +2 -3
- package/neural-interface/public/shared/ui-games.js +1 -1
- package/neural-interface/public/shared/ui-loading.js +83 -19
- package/neural-interface/public/shared/ui-maritaca-panel.js +12 -11
- package/neural-interface/public/shared/ui-menubar.js +23 -0
- package/neural-interface/public/shared/ui-native-loop-router.js +50 -21
- package/neural-interface/public/shared/ui-navbar.js +15 -9
- package/neural-interface/public/shared/ui-opencode-panel-v2.js +13 -11
- package/neural-interface/public/shared/ui-owner-authority.js +48 -25
- package/neural-interface/public/shared/ui-schedules-studio.js +3 -3
- package/neural-interface/public/shared/ui-scroll-follow.js +39 -0
- package/neural-interface/public/shared/ui-sessions.js +3 -3
- package/neural-interface/public/shared/ui-settings-entry.js +55 -0
- package/neural-interface/public/shared/ui-settings.js +363 -400
- package/neural-interface/public/shared/ui-sidepanel-layout.js +44 -25
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +22 -9
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +10 -2
- package/neural-interface/public/shared/ui-sidepanel-tray.js +36 -41
- package/neural-interface/public/shared/ui-sidepanel-windows.js +14 -1
- package/neural-interface/public/shared/ui-styleguide.js +10 -2
- package/neural-interface/public/shared/ui-sync.js +6 -0
- package/neural-interface/public/shared/ui-terminal.js +13 -9
- package/neural-interface/public/shared/ui-tooltip.js +28 -7
- package/neural-interface/public/shared/ui-topright-overflow.js +26 -4
- package/neural-interface/public/shared/ui-tray-columns.js +375 -0
- package/neural-interface/public/shared/ui-whiteboard.js +51 -6
- package/neural-interface/public/shared/ui-worker-end.js +28 -1
- package/neural-interface/public/shared/ui-workspaces.js +13 -0
- package/neural-interface/public/shared/window-keys.js +71 -0
- package/neural-interface/public/sw.js +4 -3
- package/neural-interface/public/variant/2d/main.js +2 -0
- package/neural-interface/public/variant/3d/app.js +620 -0
- package/neural-interface/public/variant/3d/boot-reveal.js +47 -0
- package/neural-interface/public/variant/3d/main.js +30 -544
- package/neural-interface/public/variant/3d/map-controls.js +4 -2
- package/neural-interface/public/vendor/fonts/fonts.css +508 -0
- package/neural-interface/public/vendor/fonts/inter-OFL.txt +93 -0
- package/neural-interface/public/vendor/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-cyrillic.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-greek-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-greek.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-latin-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-latin.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/inter-vietnamese.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-OFL.txt +93 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-cyrillic.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-greek.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-latin-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-latin.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/jetbrains-mono-vietnamese.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/manifest.json +142 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-OFL.txt +93 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-latin-ext.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-latin.woff2 +0 -0
- package/neural-interface/public/vendor/fonts/space-grotesk-vietnamese.woff2 +0 -0
- package/neural-interface/scripts/boot-graph.mjs +270 -0
- package/neural-interface/scripts/vendor-fonts.mjs +124 -0
- package/neural-interface/server.js +1083 -164
- package/npm-shrinkwrap.json +2 -2
- package/package.json +4 -1
- package/skills/agent-forge/SKILL.md +182 -0
- package/skills/agent-forge/evals/evals.json +56 -0
- package/skills/agent-forge/references/definition-fields.md +61 -0
- package/skills/agent-forge/references/examples.md +105 -0
- package/skills/agent-forge/references/instructions.md +51 -0
- package/skills/agent-forge/references/review-and-export.md +84 -0
|
@@ -30,7 +30,7 @@ import { query, startup } from '@anthropic-ai/claude-agent-sdk';
|
|
|
30
30
|
import { CLAUDE_EFFORT_LEVELS, CLAUDE_EFFORT_OFF, isThinkingOff } from './claude-model-catalog.js';
|
|
31
31
|
import { CLAUDE_NOT_INSTALLED, resolveClaudeSdkExecutable } from './claude-executable.js';
|
|
32
32
|
import { diagnoseLaunchFailure, isNativeBinaryLaunchFailure } from './native-binary-runtime.js';
|
|
33
|
-
import { normalizePanelSession, startSignature, applyPanelSessionOptions, liveSettingsPatch, normalizeMcpServers, mergeTabMcpServers } from './claude-panel-session.js';
|
|
33
|
+
import { normalizePanelSession, startSignature, startSignatureWithoutThinking, thinkingRestartNeeded, applyPanelSessionOptions, liveSettingsPatch, normalizeMcpServers, mergeTabMcpServers } from './claude-panel-session.js';
|
|
34
34
|
import { SESSION_REQUESTS, runSessionRequest, slimRewind, slimMcpStatus } from './claude-panel-requests.js';
|
|
35
35
|
import { applyTemporaryOptions, plansDirsOf, snapshotPlanFiles, planFileOfToolCall, removeTemporaryPlanFiles } from './claude-temporary.js';
|
|
36
36
|
import { rootBypassBlock } from './claude-bypass-policy.js';
|
|
@@ -124,6 +124,8 @@ export const PANEL_CAPABILITIES = Object.freeze([
|
|
|
124
124
|
'bypass_mode', // Bypass is the SDK's bypassPermissions: a tab's process can take it (query `permissionMode`, `set_permission_mode`, the plan card's `planDecision`); `mode_changed` carries `reason` when it was refused or undone
|
|
125
125
|
'mode_statements', // the page numbers its statements of the tab's mode (`modeSeq`) and every mode report (init, status, mode_changed, reattach_result) returns the number applied; `set_permission_mode {fromSettings}` and a plan answer's `planExit` go back to the mode the user's settings name
|
|
126
126
|
'temporary_chat', // query / warm / `config` `temporary: true`: a conversation that leaves nothing behind (lib/claude-temporary.js); `temporary_ended` when its process is gone
|
|
127
|
+
'thinking_effective', // the panel sends the thinking that runs (no saved Off to a model that always thinks) and `thinkingAlwaysOn: true` for such a model; thinking restarts the process only when how it was started cannot give that (thinkingRestartNeeded)
|
|
128
|
+
'thinking_deferral', // a thinking switch that would restart the process waits while background tasks or wakeups run; system/runtime_notice (level info) carries `thinking: { state: deferred | still | ready | made | cancelled, wants, runs, pending }`
|
|
127
129
|
]);
|
|
128
130
|
|
|
129
131
|
const WARM_TTL_MS = 3 * 60 * 1000; // an unused warm process is closed after this
|
|
@@ -555,6 +557,8 @@ export class ClaudeSession {
|
|
|
555
557
|
log(`session create: adopted the warm process (resume=${this.sessionId || 'none'})`);
|
|
556
558
|
this._startModeSeen = false;
|
|
557
559
|
this.q = w.handle.query(this.input);
|
|
560
|
+
// (How this process was started, for _thinkingRestart: the warm one's own options.)
|
|
561
|
+
this._startedThinkingOff = w.thinkingOff === true;
|
|
558
562
|
if (this.panel) this._noteProcessStarted();
|
|
559
563
|
this.pumpPromise = this._pump(this.q);
|
|
560
564
|
return this.q;
|
|
@@ -606,7 +610,7 @@ export class ClaudeSession {
|
|
|
606
610
|
const before = JSON.stringify(this._sessionCrons);
|
|
607
611
|
this._sessionCrons = Array.isArray(input?.session_crons) ? input.session_crons : [];
|
|
608
612
|
// Panel sessions: the scheduled wakeups of this session, when they change.
|
|
609
|
-
if (this.panel && JSON.stringify(this._sessionCrons) !== before) this._announceCrons();
|
|
613
|
+
if (this.panel && JSON.stringify(this._sessionCrons) !== before) { this._announceCrons(); this._thinkingWorkSettled(); }
|
|
610
614
|
}
|
|
611
615
|
return {};
|
|
612
616
|
}],
|
|
@@ -788,6 +792,9 @@ export class ClaudeSession {
|
|
|
788
792
|
// Off is the user's pick, not the model's default: without it an
|
|
789
793
|
// effortLevel in the user's settings would still apply.
|
|
790
794
|
// `none` is the Assistant's Off (route card, dispatch, brain turns): the same, for every session.
|
|
795
|
+
// (A model that rejects disabled thinking, Opus 5.5, is sent adaptive thinking by the CLI anyway, at the
|
|
796
|
+
// effort its settings give: the Assistant corrects `none` to the lowest level before it gets here,
|
|
797
|
+
// effort-levels.js thinkingAlwaysOn, from the CLI's own `supportsThinkingOff`.)
|
|
791
798
|
if ((this.panel && this.effort === 'off') || this.effort === CLAUDE_EFFORT_OFF) options.thinking = { type: 'disabled' };
|
|
792
799
|
if (this.effort && CLAUDE_EFFORT_LEVELS.includes(this.effort)) {
|
|
793
800
|
// Panel sessions use the typed option; every other caller keeps the flag it had.
|
|
@@ -845,7 +852,7 @@ export class ClaudeSession {
|
|
|
845
852
|
// Start the process now; hand it the input queue when the first prompt comes.
|
|
846
853
|
// (`bypass`: started in Bypass, as the tab's stated mode or as the mode this session saw the user's
|
|
847
854
|
// settings name. A process kept ready is a process of this session's all the same: see _mayBypass.)
|
|
848
|
-
const w = { sig: this._warmSignature(), input: this.input, abortController: this.abortController, handle: null, ready: false, closed: false, timer: null, bypass: this._startAskedBypass === true || (this._startedFromSettings === true && this.permissionMode === BYPASS) };
|
|
855
|
+
const w = { sig: this._warmSignature(), input: this.input, abortController: this.abortController, handle: null, ready: false, closed: false, timer: null, bypass: this._startAskedBypass === true || (this._startedFromSettings === true && this.permissionMode === BYPASS), thinkingOff: options.thinking?.type === 'disabled' };
|
|
849
856
|
this._warm = w;
|
|
850
857
|
log(`warm start: resume=${this.sessionId || 'none'} model=${this.model || 'default'} cwd=${workDir} cli=${runtimeLabel}`);
|
|
851
858
|
const startupFactory = typeof deps.startupFactory === 'function' ? deps.startupFactory : startup;
|
|
@@ -866,6 +873,9 @@ export class ClaudeSession {
|
|
|
866
873
|
log(`session create: resume=${this.sessionId || 'none'} model=${this.model || 'default'} effort=${this.effort || 'default'} mode=${this.permissionMode} cwd=${workDir} sdk=${SDK_VERSION} cli=${runtimeLabel}${sessionOpts.ownerKey ? ` owner=${sessionOpts.ownerKey}` : ''}`);
|
|
867
874
|
const queryFactory = typeof deps.queryFactory === 'function' ? deps.queryFactory : query;
|
|
868
875
|
this.q = queryFactory({ prompt: this.input, options });
|
|
876
|
+
// Whether this process was started with thinking disabled (an Off effort or the session settings):
|
|
877
|
+
// what a later message's thinking is compared with (_thinkingRestart), never the message before it.
|
|
878
|
+
this._startedThinkingOff = options.thinking?.type === 'disabled';
|
|
869
879
|
if (this.panel) this._noteProcessStarted();
|
|
870
880
|
this.pumpPromise = this._pump(this.q);
|
|
871
881
|
return this.q;
|
|
@@ -1084,6 +1094,13 @@ export class ClaudeSession {
|
|
|
1084
1094
|
// What this process is in, and whether it may be in Bypass (see "what is" below):
|
|
1085
1095
|
// a process launched in Bypass may be in it from its launch.
|
|
1086
1096
|
this._cli = { q: this.q, mode: this._launchMode || '', may: this._startAskedBypass === true, at: 0, sends: 0 };
|
|
1097
|
+
// A thinking switch that waited for background work (_handleQuery) is made: this process was started with
|
|
1098
|
+
// the thinking the tab asks for. The tab is told what runs now.
|
|
1099
|
+
if (this._thinkingDeferred) {
|
|
1100
|
+
this._thinkingDeferred = false;
|
|
1101
|
+
this._thinkingNotice('made');
|
|
1102
|
+
}
|
|
1103
|
+
this._thinkingReadyTold = false;
|
|
1087
1104
|
}
|
|
1088
1105
|
|
|
1089
1106
|
// Panel sessions: a turn at the session's process. Socket messages are
|
|
@@ -1242,10 +1259,72 @@ export class ClaudeSession {
|
|
|
1242
1259
|
if (msg.typesafe !== undefined && (msg.typesafe === 'off') !== !!this.typesafeOff) return 'the judgment setting';
|
|
1243
1260
|
if (msg.accountId !== undefined && account !== (this.accountId || '')) return 'the Claude account';
|
|
1244
1261
|
if (msg.toolPolicy !== undefined && (TOOL_POLICY_DISALLOW[msg.toolPolicy] ? msg.toolPolicy : null) !== (this.toolPolicy || null)) return 'the tool policy';
|
|
1245
|
-
|
|
1262
|
+
const session = msg.session !== undefined ? normalizePanelSession(msg.session) : this.panelSession;
|
|
1263
|
+
if (msg.session !== undefined && startSignatureWithoutThinking(session) !== startSignatureWithoutThinking(this.panelSession || normalizePanelSession(null))) return 'the session settings';
|
|
1264
|
+
// (A panel message that sends no effort clears it.)
|
|
1265
|
+
if (this._thinkingRestart({ effort: effort || null, session, alwaysOn: msg.thinkingAlwaysOn === true })) return 'the thinking setting';
|
|
1246
1266
|
return '';
|
|
1247
1267
|
}
|
|
1248
1268
|
|
|
1269
|
+
// Panel sessions: does the thinking this message asks for need a new process? Thinking disabled (an Off
|
|
1270
|
+
// effort, or Off in the session settings) is a start-up option. It is compared with how the running process
|
|
1271
|
+
// was started (_startedThinkingOff), never with the message before: the panel leaves a saved Off out for a
|
|
1272
|
+
// model that always thinks (`thinkingAlwaysOn`), and that is no change. Claude Code resolves the start-up
|
|
1273
|
+
// value against each request's model, so a process started with it stays right on such a model, and a
|
|
1274
|
+
// process started without it restarts once, at the first message that asks for Off where it can be off.
|
|
1275
|
+
// (lib/claude-panel-session.js thinkingRestartNeeded. Other sessions keep their own rule in _handleQuery.)
|
|
1276
|
+
_thinkingRestart({ effort = this.effort, session = this.panelSession, alwaysOn = false } = {}) {
|
|
1277
|
+
if (!this.panel || !this.q) return false;
|
|
1278
|
+
const wantOff = isThinkingOff(effort, { panel: true }) || session?.start?.thinkingOff === true;
|
|
1279
|
+
return thinkingRestartNeeded({ startedOff: this._startedThinkingOff === true, wantOff, lenient: alwaysOn === true || !effort });
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
// Panel sessions: does the tab ask for thinking disabled (its effort, or Off in the session settings)?
|
|
1283
|
+
_panelWantsThinkingOff(effort = this.effort, session = this.panelSession) {
|
|
1284
|
+
return isThinkingOff(effort, { panel: true }) || session?.start?.thinkingOff === true;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// Panel sessions: what keeps a thinking switch waiting, in words ("1 background task", "2 scheduled wakeups").
|
|
1288
|
+
_pendingWorkWords() {
|
|
1289
|
+
const parts = [];
|
|
1290
|
+
const tasks = this._bgTasks.size;
|
|
1291
|
+
const crons = this._sessionCrons.length;
|
|
1292
|
+
if (tasks) parts.push(`${tasks} background task${tasks === 1 ? '' : 's'}`);
|
|
1293
|
+
if (crons) parts.push(`${crons} scheduled wakeup${crons === 1 ? '' : 's'}`);
|
|
1294
|
+
return parts.join(' and ') || 'background work';
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
// Panel sessions: a thinking switch that waits for background work, told to the tab as a runtime notice (the
|
|
1298
|
+
// panel draws an `info` one as a status line), so the Think toggle's new state is never taken for what runs.
|
|
1299
|
+
// `thinking` carries the same in fields: { state: deferred | still | ready | made | cancelled, wants, runs,
|
|
1300
|
+
// pending } (wants / runs: 'on' | 'off'; runs is how the running process was started).
|
|
1301
|
+
_thinkingNotice(state) {
|
|
1302
|
+
if (!this.panel) return;
|
|
1303
|
+
const runs = this._startedThinkingOff === true ? 'off' : 'on';
|
|
1304
|
+
const wants = runs === 'on' ? 'off' : 'on';
|
|
1305
|
+
const pending = { tasks: this._bgTasks.size, wakeups: this._sessionCrons.length };
|
|
1306
|
+
let message;
|
|
1307
|
+
if (state === 'deferred') {
|
|
1308
|
+
message = `Thinking ${wants} is waiting: ${this._pendingWorkWords()} still running, and the switch restarts the session, which would end ${pending.tasks + pending.wakeups === 1 ? 'it' : 'them'}. This message runs with thinking ${runs}. The switch is made with your first message after the background work finishes.`;
|
|
1309
|
+
} else if (state === 'still') {
|
|
1310
|
+
message = `Thinking ${wants} is still waiting for ${this._pendingWorkWords()}: this message runs with thinking ${runs}.`;
|
|
1311
|
+
} else if (state === 'ready') {
|
|
1312
|
+
message = `The background work finished: thinking ${wants} is made with your next message.`;
|
|
1313
|
+
} else if (state === 'made') {
|
|
1314
|
+
message = `Thinking is ${runs} now: the session restarted with it.`;
|
|
1315
|
+
} else if (state === 'cancelled') {
|
|
1316
|
+
message = `Thinking stays ${runs}: the switch that was waiting is no longer asked for.`;
|
|
1317
|
+
} else return;
|
|
1318
|
+
this._thinkingReadyTold = state === 'ready';
|
|
1319
|
+
this.sendEvent({ type: 'system', subtype: 'runtime_notice', level: 'info', message, thinking: { state, wants: state === 'made' || state === 'cancelled' ? runs : wants, runs, pending }, session_id: this.sessionId });
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// Panel sessions: the background work a thinking switch waited for is over (a task list or the wakeups changed).
|
|
1323
|
+
_thinkingWorkSettled() {
|
|
1324
|
+
if (!this.panel || !this._thinkingDeferred || !this.q || this._hasPendingWork() || this._thinkingReadyTold) return;
|
|
1325
|
+
this._thinkingNotice('ready');
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1249
1328
|
// A temporary chat cannot be resumed, so a stalled stream is not answered
|
|
1250
1329
|
// with a new process: the turn is stopped and the tab is told. A process
|
|
1251
1330
|
// that does not even take the stop is gone, and the chat with it.
|
|
@@ -1539,6 +1618,8 @@ export class ClaudeSession {
|
|
|
1539
1618
|
ambient: !!t.ambient,
|
|
1540
1619
|
});
|
|
1541
1620
|
}
|
|
1621
|
+
// (Panel sessions: a thinking switch that waited for these can now be made.)
|
|
1622
|
+
this._thinkingWorkSettled();
|
|
1542
1623
|
}
|
|
1543
1624
|
|
|
1544
1625
|
// A background agent reported back: close its card with the real outcome.
|
|
@@ -2991,7 +3072,8 @@ export class ClaudeSession {
|
|
|
2991
3072
|
if (msg.session !== undefined) {
|
|
2992
3073
|
const next = normalizePanelSession(msg.session);
|
|
2993
3074
|
// What is fixed at start changed: the session restarts with it.
|
|
2994
|
-
|
|
3075
|
+
// (Thinking is judged apart, against how the process was started: _thinkingRestart.)
|
|
3076
|
+
if (this.q && startSignatureWithoutThinking(next) !== startSignatureWithoutThinking(this.panelSession || normalizePanelSession(null))) policyChanged = true;
|
|
2995
3077
|
this.panelSession = next;
|
|
2996
3078
|
}
|
|
2997
3079
|
}
|
|
@@ -3004,7 +3086,6 @@ export class ClaudeSession {
|
|
|
3004
3086
|
if (cwd) this.cwd = cwd;
|
|
3005
3087
|
// A panel tab that sends no effort means "the model's default": a level that
|
|
3006
3088
|
// was set goes back to it, live when a session exists.
|
|
3007
|
-
const prevEffort = this.effort;
|
|
3008
3089
|
const effortCleared = this.panel && !effort && !!this.effort;
|
|
3009
3090
|
if (effort) this.effort = effort;
|
|
3010
3091
|
else if (effortCleared) this.effort = null;
|
|
@@ -3048,14 +3129,65 @@ export class ClaudeSession {
|
|
|
3048
3129
|
// (Off disables thinking, a start-up option: to or from it the session restarts. Outside the panel
|
|
3049
3130
|
// 'off' is Auto: a level back to the model's default switches live, `effortLevel: null`.)
|
|
3050
3131
|
const thinkingOff = (value) => isThinkingOff(value, { panel: !!this.panel });
|
|
3132
|
+
// Panel sessions: Off is judged against how the running process was started (_thinkingRestart), so an
|
|
3133
|
+
// Off the panel leaves out for a model that always thinks, or asks again of a process that already has
|
|
3134
|
+
// it, restarts nothing; the effort then switches live like any other.
|
|
3135
|
+
let thinkingChanged = this._thinkingRestart({ alwaysOn: msg.thinkingAlwaysOn === true });
|
|
3136
|
+
// Panel sessions, the same deferral as the brain's below: a restart for thinking alone would end the CLI's
|
|
3137
|
+
// background tasks and wakeups (_hasPendingWork). While there are any, this turn runs on the process as it
|
|
3138
|
+
// is and the switch waits (_thinkingDeferred); every later message judges thinking again against how the
|
|
3139
|
+
// process was started, so the first one with nothing pending restarts with it (before its prompt is sent:
|
|
3140
|
+
// the restart below), and one that asks for the started state again cancels it with no restart. The tab is
|
|
3141
|
+
// told each step (_thinkingNotice), so it never takes the switch for made. Any other reason to restart
|
|
3142
|
+
// (folder, conversation, account, tool policy, start-up settings) restarts as it always did.
|
|
3143
|
+
let thinkingWaits = false;
|
|
3144
|
+
if (this.panel && this.q) {
|
|
3145
|
+
const otherRestart = cwdChanged || sessionChanged || newChat || typesafeChanged || policyChanged
|
|
3146
|
+
|| (effortChanged && typeof this.q.applyFlagSettings !== 'function');
|
|
3147
|
+
if (thinkingChanged && !otherRestart && this._hasPendingWork()) {
|
|
3148
|
+
if (!this._thinkingDeferred) log(`panel: thinking ${this._panelWantsThinkingOff() ? 'off' : 'on'} waits: background work is running in session ${this.sessionId || '(new)'}; no restart`);
|
|
3149
|
+
this._thinkingNotice(this._thinkingDeferred ? 'still' : 'deferred');
|
|
3150
|
+
this._thinkingDeferred = true;
|
|
3151
|
+
thinkingChanged = false;
|
|
3152
|
+
thinkingWaits = true;
|
|
3153
|
+
} else if (!thinkingChanged && this._thinkingDeferred) {
|
|
3154
|
+
log(`panel: the thinking switch that waited is no longer asked for in session ${this.sessionId || '(new)'}`);
|
|
3155
|
+
this._thinkingDeferred = false;
|
|
3156
|
+
this._thinkingNotice('cancelled');
|
|
3157
|
+
}
|
|
3158
|
+
// (A switch made now, by the restart below: _noteProcessStarted reports it.)
|
|
3159
|
+
}
|
|
3160
|
+
// Other sessions (the Assistant's brain): Off is judged against how the running process was started too,
|
|
3161
|
+
// so a switch that waited (below) and was taken back costs nothing. In step, this is the old rule: a change
|
|
3162
|
+
// to or from Off restarts.
|
|
3163
|
+
const thinkingMismatch = !this.panel && !!this.q && thinkingOff(this.effort) !== (this._startedThinkingOff === true);
|
|
3164
|
+
let offSwitch = this.panel ? thinkingChanged : thinkingMismatch;
|
|
3165
|
+
// Other sessions: a restart ends the CLI's background tasks (a background Bash, an agent) and its wakeups,
|
|
3166
|
+
// whose task-notification is the turn that wakes the brain to read them. While there are any, a turn that
|
|
3167
|
+
// would restart for thinking alone runs on the process as it is (its level is applied live below); the
|
|
3168
|
+
// first turn with nothing pending gets the process its effort asks for.
|
|
3169
|
+
if (!this.panel && this.q && offSwitch && !cwdChanged && !sessionChanged && !newChat && !typesafeChanged && !policyChanged) {
|
|
3170
|
+
if (this._hasPendingWork()) {
|
|
3171
|
+
if (!this._thinkingDeferred) log(`thinking ${thinkingOff(this.effort) ? 'off' : 'on'} waits: background work is running in session ${this.sessionId || '(new)'}; no restart`);
|
|
3172
|
+
this._thinkingDeferred = true;
|
|
3173
|
+
offSwitch = false;
|
|
3174
|
+
} else if (this._thinkingDeferred) {
|
|
3175
|
+
// The switch that waited: now, with nothing left to lose (the restart below starts the process it asks for).
|
|
3176
|
+
effortChanged = true;
|
|
3177
|
+
this._thinkingDeferred = false;
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
if (!this.panel && !thinkingMismatch) this._thinkingDeferred = false;
|
|
3181
|
+
// (Panel sessions: an Off that waits has no level to apply; the process keeps the level it runs at.)
|
|
3182
|
+
if (thinkingWaits && thinkingOff(effort)) effortChanged = false;
|
|
3051
3183
|
if (this.q && effortChanged && !cwdChanged && !sessionChanged && !newChat
|
|
3052
|
-
&& !
|
|
3184
|
+
&& !offSwitch
|
|
3053
3185
|
&& typeof this.q.applyFlagSettings === 'function') {
|
|
3054
3186
|
const effortLevel = CLAUDE_EFFORT_LEVELS.includes(effort) ? effort : null;
|
|
3055
3187
|
this.q.applyFlagSettings({ effortLevel }).catch(err => log('applyFlagSettings(effort) failed:', err.message));
|
|
3056
3188
|
effortChanged = false;
|
|
3057
3189
|
}
|
|
3058
|
-
if (this.q && this.panel && !cwdChanged && !sessionChanged && !newChat && !policyChanged
|
|
3190
|
+
if (this.q && this.panel && !cwdChanged && !sessionChanged && !newChat && !policyChanged && !thinkingChanged
|
|
3059
3191
|
&& typeof this.q.applyFlagSettings === 'function') {
|
|
3060
3192
|
// Fast mode, output style and the main-thread agent switch on the live
|
|
3061
3193
|
// session; so does a return to the default effort.
|
|
@@ -3070,8 +3202,8 @@ export class ClaudeSession {
|
|
|
3070
3202
|
}
|
|
3071
3203
|
}
|
|
3072
3204
|
|
|
3073
|
-
if (this.q && (cwdChanged || effortChanged || sessionChanged || newChat || typesafeChanged || policyChanged)) {
|
|
3074
|
-
log(`config change (cwd=${!!cwdChanged} effort=${!!effortChanged} session=${!!sessionChanged} newChat=${newChat} typesafe=${typesafeChanged}${policyChanged ? ' toolPolicy=true' : ''}) — recreating query`);
|
|
3205
|
+
if (this.q && (cwdChanged || effortChanged || sessionChanged || newChat || typesafeChanged || policyChanged || thinkingChanged)) {
|
|
3206
|
+
log(`config change (cwd=${!!cwdChanged} effort=${!!effortChanged} session=${!!sessionChanged} newChat=${newChat} typesafe=${typesafeChanged}${policyChanged ? ' toolPolicy=true' : ''}${thinkingChanged ? ' thinking=true' : ''}) — recreating query`);
|
|
3075
3207
|
const restarted = this._endQuery({ graceful: true }).then(() => {
|
|
3076
3208
|
if (this.destroyed) return;
|
|
3077
3209
|
this.ensureQuery();
|
|
@@ -106,6 +106,8 @@ export function onClaudeModelsChanged(listener) {
|
|
|
106
106
|
export function claudeModelsSignature(models) {
|
|
107
107
|
return JSON.stringify((Array.isArray(models) ? models : []).map(m => [
|
|
108
108
|
m?.id || '', m?.resolvedModel || '', m?.label || '', m?.contextWindow || 0, (m?.effortLevels || []).join(','),
|
|
109
|
+
// Whether thinking can be off: a list kept from before the CLI said so differs from the one that says it.
|
|
110
|
+
typeof m?.supportsThinkingOff === 'boolean' ? m.supportsThinkingOff : null,
|
|
109
111
|
]));
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -207,6 +209,10 @@ export function normalizeClaudeModel(model) {
|
|
|
207
209
|
// Which controls the sidepanel may offer for this model (Auto mode, thinking).
|
|
208
210
|
supportsAutoMode: model?.supportsAutoMode === true,
|
|
209
211
|
supportsAdaptiveThinking: model?.supportsAdaptiveThinking === true,
|
|
212
|
+
// Whether the CLI can run this model with thinking off (`--thinking disabled`). false: the model rejects disabled
|
|
213
|
+
// thinking and the CLI sends adaptive thinking instead, at the effort its settings give (Opus 5.5 on Claude Code
|
|
214
|
+
// 2.1.326). null: an older CLI that does not say.
|
|
215
|
+
supportsThinkingOff: typeof model?.supportsThinkingOff === 'boolean' ? model.supportsThinkingOff : null,
|
|
210
216
|
cliReady: true,
|
|
211
217
|
...(id === 'default' ? { tier: 'default' } : {}),
|
|
212
218
|
};
|
|
@@ -150,6 +150,39 @@ export function startSignature(cfg) {
|
|
|
150
150
|
return JSON.stringify(cfg?.start || {});
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* The same, without thinking. A panel session decides thinking against what its
|
|
155
|
+
* running process was started with (thinkingRestartNeeded), never against the
|
|
156
|
+
* last message: the panel leaves a saved Off out of what it sends for a model
|
|
157
|
+
* that always thinks, and a value dropped for that reason is no change.
|
|
158
|
+
*/
|
|
159
|
+
export function startSignatureWithoutThinking(cfg) {
|
|
160
|
+
const { thinkingOff: _thinking, ...rest } = cfg?.start || {};
|
|
161
|
+
return JSON.stringify(rest);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Must a running panel process restart for its thinking?
|
|
166
|
+
* Thinking disabled is a start-up option, and Claude Code resolves it for every
|
|
167
|
+
* request against that request's model: on a model that rejects disabled
|
|
168
|
+
* thinking (its `supportsThinkingOff: false`, Opus 5.5) a process started with it
|
|
169
|
+
* thinks adaptively, and after a switch to a model that can turn thinking off
|
|
170
|
+
* the same process honours Off again.
|
|
171
|
+
* @param o.startedOff the process was started with thinking disabled
|
|
172
|
+
* @param o.wantOff what this message asks for: Off by the effort or by the session settings
|
|
173
|
+
* @param o.lenient leaving thinking disabled changes nothing on the model in use: it always
|
|
174
|
+
* thinks (the panel's `thinkingAlwaysOn`), or the message states no effort
|
|
175
|
+
* (a model without levels: a cleared effort never restarted the session)
|
|
176
|
+
* @returns {boolean}
|
|
177
|
+
*/
|
|
178
|
+
export function thinkingRestartNeeded({ startedOff = false, wantOff = false, lenient = false } = {}) {
|
|
179
|
+
if (!!startedOff === !!wantOff) return false;
|
|
180
|
+
// Started without the flag, asked for Off: only a new process can honour it.
|
|
181
|
+
if (!startedOff) return true;
|
|
182
|
+
// Started with it, no longer asked for: kept where it does nothing; ended where thinking would be off.
|
|
183
|
+
return !lenient;
|
|
184
|
+
}
|
|
185
|
+
|
|
153
186
|
/**
|
|
154
187
|
* The programmatic MCP server set of a session: the host's own entries (SynaBun,
|
|
155
188
|
* a brain's extras) plus the tab's. Used at start and again by setMcpServers,
|
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
// accounts). Default is the ambient CODEX_HOME (or ~/.codex); every added
|
|
7
7
|
// account owns ~/.codex-accounts/<id>, whose config.toml, prompts/ and
|
|
8
8
|
// AGENTS.md link back to Default's so model, MCP and tool settings stay shared,
|
|
9
|
-
// while auth.json, sessions/ and the state database stay its own.
|
|
9
|
+
// while auth.json, sessions/ and the state database stay its own. How a file
|
|
10
|
+
// and a folder are linked on each system, and kept in step where a link cannot
|
|
11
|
+
// be made (Windows without Developer Mode: a hard link, which Codex's own
|
|
12
|
+
// rename-write of config.toml splits), is lib/claude-account-links.js, the
|
|
13
|
+
// same functions the Claude accounts use.
|
|
10
14
|
//
|
|
11
15
|
// One account, two credentials, one mode. Each account can hold a ChatGPT
|
|
12
16
|
// login (Codex's own, in its CODEX_HOME: auth.json or the keyring Codex is set
|
|
@@ -26,13 +30,14 @@
|
|
|
26
30
|
// Codex as it is.
|
|
27
31
|
|
|
28
32
|
import {
|
|
29
|
-
existsSync,
|
|
33
|
+
existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync,
|
|
30
34
|
} from 'node:fs';
|
|
31
35
|
import { dirname, join, resolve, sep } from 'node:path';
|
|
32
36
|
import { homedir } from 'node:os';
|
|
33
37
|
import { readProfileApiKey, saveProfileApiKey, clearProfileApiKey } from './claude-profile-api-key.js';
|
|
34
38
|
import { apiKeyHint, resolveClaudeAuth } from './claude-accounts.js';
|
|
35
39
|
import { normalizeAdminSandbox, sandboxElevationFor } from './agent-sandbox-elevation.js';
|
|
40
|
+
import { sameSharedRecords, syncSharedEntries } from './claude-account-links.js';
|
|
36
41
|
|
|
37
42
|
export const CODEX_DEFAULT_ACCOUNT_ID = 'default';
|
|
38
43
|
export const CODEX_AUTH_MODES = Object.freeze(['subscription', 'apiKey']);
|
|
@@ -48,7 +53,14 @@ export const CODEX_CREDENTIAL_ENV = Object.freeze([
|
|
|
48
53
|
// An app-server that runs on a key SynaBun holds: nothing it is told is kept,
|
|
49
54
|
// and the account's own auth.json (its ChatGPT login) is not read or replaced.
|
|
50
55
|
export const CODEX_EPHEMERAL_STORE_ARGS = Object.freeze(['-c', 'cli_auth_credentials_store="ephemeral"']);
|
|
51
|
-
|
|
56
|
+
// What a named account shares with Default, and nothing else: auth.json (the ChatGPT login), `.synabun-api-key`,
|
|
57
|
+
// sessions/, the history and the state database are an account's own and are never linked or copied.
|
|
58
|
+
export const CODEX_SHARED_FILES = Object.freeze(['config.toml', 'AGENTS.md']);
|
|
59
|
+
export const CODEX_SHARED_FOLDERS = Object.freeze(['prompts']);
|
|
60
|
+
const SHARED_NAMES = [...CODEX_SHARED_FILES, ...CODEX_SHARED_FOLDERS];
|
|
61
|
+
// The one file SynaBun itself leaves in an account where the link could not be made: a launch makes a missing
|
|
62
|
+
// config.toml (server.js ensureCanonicalCodexConfig). An AGENTS.md found in an account is the owner's.
|
|
63
|
+
const ADOPTED_FILES = ['config.toml'];
|
|
52
64
|
const STATUS_MAX_AGE_MS = 5 * 60_000;
|
|
53
65
|
|
|
54
66
|
export class CodexAccountError extends Error {
|
|
@@ -148,6 +160,9 @@ export function createCodexAccounts({
|
|
|
148
160
|
prepareDefaultConfig = () => {},
|
|
149
161
|
// () => the Admin sandbox setting (lib/agent-sandbox-setting.js): which Windows sandbox every launch may use.
|
|
150
162
|
adminSandbox = () => false,
|
|
163
|
+
platform = process.platform,
|
|
164
|
+
// The file system the shared links are made with (node:fs; a test stands in for Windows rights).
|
|
165
|
+
linkFs = undefined,
|
|
151
166
|
} = {}) {
|
|
152
167
|
if (!dataHome) throw new Error('createCodexAccounts requires dataHome');
|
|
153
168
|
const registryPath = resolve(dataHome, 'data', 'codex-accounts.json');
|
|
@@ -278,6 +293,8 @@ export function createCodexAccounts({
|
|
|
278
293
|
if (!profile || !profile.home) {
|
|
279
294
|
return { ok: false, accountId: wanted, code: 'account_unavailable', message: 'That Codex account is no longer set up in SynaBun.' };
|
|
280
295
|
}
|
|
296
|
+
// The account reads Default's config.toml and AGENTS.md: in step before every launch.
|
|
297
|
+
if (wanted !== CODEX_DEFAULT_ACCOUNT_ID) syncShared(wanted);
|
|
281
298
|
const { row, key } = describeProfile(profile, data);
|
|
282
299
|
const apiKey = row.mode === 'apiKey' && row.apiKey.source === 'synabun' && key ? key : null;
|
|
283
300
|
// A launch override, never written into config.toml: Default's home is the user's own ~/.codex.
|
|
@@ -396,32 +413,58 @@ export function createCodexAccounts({
|
|
|
396
413
|
for (const listener of [...listeners]) { try { listener({ accountId, ...extra }); } catch {} }
|
|
397
414
|
}
|
|
398
415
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
416
|
+
/**
|
|
417
|
+
* Put the shared entries of one account (or every named account) in order: a hard link or a copy two writes
|
|
418
|
+
* apart brought back in step (Codex writes config.toml as a new file renamed over the old one), a missing
|
|
419
|
+
* entry linked only with `linkMissing`, which making the account asks for.
|
|
420
|
+
*
|
|
421
|
+
* On Windows, once per account (`sharedChecked` on its row): an account made while SynaBun linked these files
|
|
422
|
+
* with a symbolic link only, which Windows refuses without Developer Mode or administrator rights, has no
|
|
423
|
+
* AGENTS.md and a config.toml of its own that a launch made for it. Its missing entries are linked, and that
|
|
424
|
+
* config.toml becomes Default's again (what it held is kept in the account's backups/).
|
|
425
|
+
* Never throws; returns what it did per account.
|
|
426
|
+
*/
|
|
427
|
+
function syncShared(id = null, { linkMissing = false } = {}) {
|
|
428
|
+
const results = [];
|
|
429
|
+
try {
|
|
430
|
+
const data = load();
|
|
431
|
+
let changed = false;
|
|
432
|
+
for (const account of data.accounts) {
|
|
433
|
+
if (account.id === CODEX_DEFAULT_ACCOUNT_ID || (id && account.id !== id)) continue;
|
|
434
|
+
if (!account.home || resolve(account.home) === defaultHome || !existsSync(account.home)) continue;
|
|
435
|
+
const firstCheck = platform === 'win32' && account.sharedChecked !== true;
|
|
436
|
+
const result = syncSharedEntries({
|
|
437
|
+
defaultHome, home: account.home, names: SHARED_NAMES, fileNames: CODEX_SHARED_FILES, recorded: account.shared || {},
|
|
438
|
+
linkMissing: linkMissing || firstCheck, adopt: firstCheck ? ADOPTED_FILES : [],
|
|
439
|
+
platform, fs: linkFs, now, log, tag: 'codex-accounts',
|
|
440
|
+
});
|
|
441
|
+
if (!sameSharedRecords(account.shared || {}, result.modes)) {
|
|
442
|
+
if (Object.keys(result.modes).length) account.shared = result.modes; else delete account.shared;
|
|
443
|
+
changed = true;
|
|
411
444
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
445
|
+
// A check that could not finish (a file in use) is made again by the next start or launch.
|
|
446
|
+
if (firstCheck && !result.failed.length) { account.sharedChecked = true; changed = true; }
|
|
447
|
+
results.push({ id: account.id, linked: result.linked, repaired: result.repaired });
|
|
448
|
+
}
|
|
449
|
+
if (changed) save(data);
|
|
450
|
+
} catch (error) {
|
|
451
|
+
log('codex-accounts', `shared files check failed: ${error?.message || error}`);
|
|
452
|
+
}
|
|
453
|
+
return results;
|
|
419
454
|
}
|
|
420
455
|
function seedHome(id) {
|
|
421
456
|
const account = id && id !== CODEX_DEFAULT_ACCOUNT_ID ? profileFor(id) : null;
|
|
422
457
|
if (!account) throw new CodexAccountError('ACCOUNT_NOT_FOUND', `Codex account not found: ${id}`, 404);
|
|
423
458
|
mkdirSync(resolve(account.home, 'sessions'), { recursive: true });
|
|
424
|
-
|
|
459
|
+
try { prepareDefaultConfig(); } catch (error) { log('codex-accounts', `config repair failed: ${error?.message || error}`); }
|
|
460
|
+
// config.toml and prompts/ are made when missing (shared from the start); AGENTS.md is not ours to create.
|
|
461
|
+
try {
|
|
462
|
+
mkdirSync(resolve(defaultHome, 'prompts'), { recursive: true });
|
|
463
|
+
const config = resolve(defaultHome, 'config.toml');
|
|
464
|
+
if (!existsSync(config)) writeFileSync(config, '', 'utf8');
|
|
465
|
+
} catch (error) { log('codex-accounts', `default home not ready: ${error?.message || error}`); }
|
|
466
|
+
const { linked } = syncShared(account.id, { linkMissing: true })[0] || { linked: [] };
|
|
467
|
+
return { home: account.home, linked };
|
|
425
468
|
}
|
|
426
469
|
|
|
427
470
|
function create({ label } = {}) {
|
|
@@ -497,6 +540,6 @@ export function createCodexAccounts({
|
|
|
497
540
|
registryRows: () => load().accounts,
|
|
498
541
|
get: describe, find: describe,
|
|
499
542
|
launchFor, unusableReason, setMode, noteNativeStatus, forgetNativeStatus, noteSubscriptionSignIn, setNativeStatusReader,
|
|
500
|
-
refreshStatus, stale, subscribe, create, rename, remove, seedHome,
|
|
543
|
+
refreshStatus, stale, subscribe, create, rename, remove, seedHome, syncShared,
|
|
501
544
|
};
|
|
502
545
|
}
|