synabun 2.4.1 → 2.4.3
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 +50 -0
- package/README.md +1 -1
- package/docs/browser-extension-bridge.md +46 -6
- package/lib/data-home-files.js +4 -2
- package/lib/first-launch-protection.js +8 -2
- package/lib/release-npm-ci.mjs +23 -1
- package/lib/update-snapshot.js +11 -4
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +25 -2
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +62 -17
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/browser-bench.d.ts +22 -22
- package/mcp-server/dist/services/memory-maintenance.d.ts +1 -0
- package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-maintenance.js +34 -45
- package/mcp-server/dist/services/memory-maintenance.js.map +1 -1
- package/mcp-server/dist/services/memory-migration-copy.d.ts +144 -0
- package/mcp-server/dist/services/memory-migration-copy.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-copy.js +467 -0
- package/mcp-server/dist/services/memory-migration-copy.js.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts +2 -0
- package/mcp-server/dist/services/memory-migration-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-migration-worker.js +60 -0
- package/mcp-server/dist/services/memory-migration-worker.js.map +1 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts +4 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-retrieval.js +188 -40
- package/mcp-server/dist/services/memory-retrieval.js.map +1 -1
- package/mcp-server/dist/services/memory-schema.d.ts +58 -2
- package/mcp-server/dist/services/memory-schema.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-schema.js +190 -13
- package/mcp-server/dist/services/memory-schema.js.map +1 -1
- package/mcp-server/dist/services/memory-sessions.d.ts +19 -1
- package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-sessions.js +56 -20
- package/mcp-server/dist/services/memory-sessions.js.map +1 -1
- package/mcp-server/dist/services/memory-verification.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-verification.js +8 -5
- package/mcp-server/dist/services/memory-verification.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +5 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +19 -2
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts +2 -0
- package/mcp-server/dist/services/retrieval-reader-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js +76 -0
- package/mcp-server/dist/services/retrieval-reader-worker.js.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts +38 -0
- package/mcp-server/dist/services/retrieval-reader.d.ts.map +1 -0
- package/mcp-server/dist/services/retrieval-reader.js +145 -0
- package/mcp-server/dist/services/retrieval-reader.js.map +1 -0
- package/mcp-server/dist/services/sqlite-write.d.ts +14 -0
- package/mcp-server/dist/services/sqlite-write.d.ts.map +1 -0
- package/mcp-server/dist/services/sqlite-write.js +94 -0
- package/mcp-server/dist/services/sqlite-write.js.map +1 -0
- package/mcp-server/dist/services/sqlite.d.ts +39 -0
- package/mcp-server/dist/services/sqlite.d.ts.map +1 -1
- package/mcp-server/dist/services/sqlite.js +249 -8
- package/mcp-server/dist/services/sqlite.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.d.ts +1 -1
- package/mcp-server/dist/services/typesafe-config.d.ts +7 -1
- package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe-config.js +32 -10
- package/mcp-server/dist/services/typesafe-config.js.map +1 -1
- package/mcp-server/dist/services/typesafe.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe.js +9 -7
- package/mcp-server/dist/services/typesafe.js.map +1 -1
- package/mcp-server/dist/services/vector-cache.d.ts +32 -0
- package/mcp-server/dist/services/vector-cache.d.ts.map +1 -1
- package/mcp-server/dist/services/vector-cache.js +161 -8
- package/mcp-server/dist/services/vector-cache.js.map +1 -1
- package/mcp-server/dist/tools/agent-definition.d.ts +2 -2
- package/mcp-server/dist/tools/agents.d.ts +11 -7
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +27 -9
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts +1 -1
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-advanced.js +10 -3
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
- package/mcp-server/dist/tools/browser-extension-setup.d.ts +5 -0
- package/mcp-server/dist/tools/browser-extension-setup.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-extension-setup.js +29 -0
- package/mcp-server/dist/tools/browser-extension-setup.js.map +1 -0
- package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -1
- package/mcp-server/dist/tools/browser-interact.js +6 -1
- package/mcp-server/dist/tools/browser-interact.js.map +1 -1
- package/mcp-server/dist/tools/fb-groups.d.ts +2 -2
- package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
- package/mcp-server/dist/tools/tool-groups.d.ts +1 -1
- package/mcp-server/package-lock.json +5 -5
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +20 -2
- package/mcp-server/src/index.ts +59 -17
- package/mcp-server/src/services/memory-maintenance.ts +31 -28
- package/mcp-server/src/services/memory-migration-copy.ts +419 -0
- package/mcp-server/src/services/memory-migration-worker.ts +55 -0
- package/mcp-server/src/services/memory-retrieval.ts +173 -32
- package/mcp-server/src/services/memory-schema.ts +194 -12
- package/mcp-server/src/services/memory-sessions.ts +54 -21
- package/mcp-server/src/services/memory-verification.ts +7 -4
- package/mcp-server/src/services/neural-interface.ts +22 -2
- package/mcp-server/src/services/retrieval-reader-worker.ts +67 -0
- package/mcp-server/src/services/retrieval-reader.ts +131 -0
- package/mcp-server/src/services/sqlite-write.ts +60 -0
- package/mcp-server/src/services/sqlite.ts +246 -8
- package/mcp-server/src/services/typesafe-config.ts +25 -6
- package/mcp-server/src/services/typesafe.ts +9 -7
- package/mcp-server/src/services/vector-cache.ts +154 -9
- package/mcp-server/src/tools/agents.ts +26 -9
- package/mcp-server/src/tools/browser-advanced.ts +10 -3
- package/mcp-server/src/tools/browser-extension-setup.ts +36 -0
- package/mcp-server/src/tools/browser-interact.ts +5 -1
- package/neural-interface/i18n/en.json +313 -2
- package/neural-interface/i18n/pt-BR.json +321 -10
- package/neural-interface/lib/agents/split.js +32 -4
- package/neural-interface/lib/assistant-api.js +52 -8
- package/neural-interface/lib/assistant-brains/claude.js +2 -0
- package/neural-interface/lib/assistant-brains/opencode.js +121 -7
- package/neural-interface/lib/assistant-catalog.js +2 -2
- package/neural-interface/lib/assistant-config.js +0 -7
- package/neural-interface/lib/assistant-dispatch.js +281 -95
- package/neural-interface/lib/assistant-envelope.js +40 -0
- package/neural-interface/lib/assistant-persona.js +16 -4
- package/neural-interface/lib/assistant-pricing.js +65 -14
- package/neural-interface/lib/assistant-router.js +131 -47
- package/neural-interface/lib/assistant-run-wait.js +45 -28
- package/neural-interface/lib/assistant-runtime.js +133 -42
- package/neural-interface/lib/backup-contents.js +158 -0
- package/neural-interface/lib/backup-crypto-io.js +330 -0
- package/neural-interface/lib/backup-crypto-worker.js +130 -0
- package/neural-interface/lib/backup-crypto.js +525 -0
- package/neural-interface/lib/backup-download.js +268 -0
- package/neural-interface/lib/backup-encryption.js +318 -0
- package/neural-interface/lib/backup-groups.js +287 -0
- package/neural-interface/lib/backup-restore-session.js +176 -0
- package/neural-interface/lib/backup-restore-stage.js +60 -0
- package/neural-interface/lib/backup-service.js +788 -233
- package/neural-interface/lib/backup-zip-reader.js +30 -18
- package/neural-interface/lib/backup-zip-writer.js +34 -10
- package/neural-interface/lib/browser-extension-adapter.js +89 -15
- package/neural-interface/lib/browser-extension-archive.js +149 -0
- package/neural-interface/lib/browser-extension-bridge.js +24 -10
- package/neural-interface/lib/browser-extension-folder.js +596 -76
- package/neural-interface/lib/browser-extension-package.js +200 -0
- package/neural-interface/lib/browser-extension-pin.js +84 -0
- package/neural-interface/lib/browser-extension-pin.json +33 -0
- package/{browser-extension/protocol.js → neural-interface/lib/browser-extension-protocol.js} +91 -6
- package/neural-interface/lib/browser-extension-setup.js +105 -18
- package/neural-interface/lib/claude-agent-bridge.js +1 -0
- package/neural-interface/lib/claude-session-cleanup.js +5 -1
- package/neural-interface/lib/cli-install.js +23 -3
- package/neural-interface/lib/cli-update-planner.js +171 -9
- package/neural-interface/lib/client-diagnostics.js +42 -0
- package/neural-interface/lib/confined-fs.js +7 -2
- package/neural-interface/lib/coordination/README.md +8 -2
- package/neural-interface/lib/coordination/contract.js +161 -0
- package/neural-interface/lib/coordination/database.js +999 -0
- package/neural-interface/lib/coordination/operations.js +436 -0
- package/neural-interface/lib/coordination/service.js +68 -537
- package/neural-interface/lib/coordination/storage-worker.js +101 -0
- package/neural-interface/lib/coordination/store.js +219 -1111
- package/neural-interface/lib/db.js +70 -32
- package/neural-interface/lib/health-count.js +37 -0
- package/neural-interface/lib/loop-stall.js +139 -0
- package/neural-interface/lib/maritaca/client.js +2 -2
- package/neural-interface/lib/maritaca/models.js +12 -17
- package/neural-interface/lib/maritaca/opencode.js +4 -2
- package/neural-interface/lib/memory-api.js +9 -1
- package/neural-interface/lib/memory-session-capture.js +42 -10
- package/neural-interface/lib/memory-store-gate.js +313 -0
- package/neural-interface/lib/memory-store-migrate.js +65 -0
- package/neural-interface/lib/memory-timers.js +7 -7
- package/neural-interface/lib/native-loop-providers.js +23 -17
- package/neural-interface/lib/native-loop-runtime.js +48 -9
- package/neural-interface/lib/opencode-build-preflight.js +18 -1
- package/neural-interface/lib/opencode-native-boundary.js +69 -8
- package/neural-interface/lib/opencode-provider-view.js +14 -3
- package/neural-interface/lib/opencode-shell-read.js +107 -0
- package/neural-interface/lib/opencode-stop-failures.js +40 -0
- package/neural-interface/lib/opencode-turn-release.js +173 -0
- package/neural-interface/lib/opencode-v2-client.js +4 -1
- package/neural-interface/lib/opencode-v2-ws-requests.js +65 -1
- package/neural-interface/lib/opencode2-client.js +343 -7
- package/neural-interface/lib/opencode2-translate.js +161 -4
- package/neural-interface/lib/recall-impact.js +122 -0
- package/neural-interface/lib/scratch-evidence.js +420 -0
- package/neural-interface/lib/scratch-process-guard.js +139 -0
- package/neural-interface/lib/scratch-references.js +279 -0
- package/neural-interface/lib/scratch-retention-core.js +385 -0
- package/neural-interface/lib/scratch-retention-worker.js +37 -0
- package/neural-interface/lib/scratch-retention.js +151 -0
- package/neural-interface/lib/session-cache-builder.js +31 -43
- package/neural-interface/lib/session-cache-worker.js +157 -0
- package/neural-interface/lib/session-indexer.js +28 -21
- package/neural-interface/lib/session-search-index.js +85 -0
- package/neural-interface/lib/skills/creation.js +1 -1
- package/neural-interface/lib/sqlite-integrity-worker.js +3 -1
- package/neural-interface/lib/style-guide/store.js +43 -3
- package/neural-interface/lib/system-restore.js +50 -0
- package/neural-interface/lib/teams/api.js +15 -6
- package/neural-interface/lib/teams/claims.js +67 -31
- package/neural-interface/lib/teams/index.js +7 -7
- package/neural-interface/lib/teams/integration.js +40 -40
- package/neural-interface/lib/teams/landing.js +6 -6
- package/neural-interface/lib/teams/recovery.js +24 -23
- package/neural-interface/lib/teams/scheduler.js +194 -95
- package/neural-interface/lib/teams/state.js +14 -14
- package/neural-interface/lib/teams/worktrees.js +27 -27
- package/neural-interface/lib/terminal-token-redaction.js +83 -0
- package/neural-interface/lib/whatsapp/bridge.js +54 -7
- package/neural-interface/lib/worker-confinement.js +47 -2
- package/neural-interface/lib/worker-mcp-channel.js +2 -0
- package/neural-interface/lib/worker-resume.js +5 -0
- package/neural-interface/lib/worker-stop.js +86 -0
- package/neural-interface/package-lock.json +5 -5
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/extension-setup.html +5 -2
- package/neural-interface/public/index.html +233 -24
- package/neural-interface/public/onboarding.html +259 -34
- package/neural-interface/public/shared/agents/studio/ax-library.js +0 -6
- package/neural-interface/public/shared/agents/studio/ax-main.js +14 -7
- package/neural-interface/public/shared/agy/agy-options.js +11 -0
- package/neural-interface/public/shared/agy/agy-panel.js +67 -20
- package/neural-interface/public/shared/agy/agy-styles.js +14 -12
- package/neural-interface/public/shared/agy/agy-tabs-logic.js +4 -1
- package/neural-interface/public/shared/api.js +1 -1
- package/neural-interface/public/shared/assistant/asst-api.js +28 -3
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +13 -6
- package/neural-interface/public/shared/assistant/asst-control.js +2 -0
- package/neural-interface/public/shared/assistant/asst-motion-gate.js +78 -4
- package/neural-interface/public/shared/assistant/asst-panel.js +87 -3
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +27 -0
- package/neural-interface/public/shared/assistant/asst-render.js +243 -44
- package/neural-interface/public/shared/assistant/asst-route.js +100 -21
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +1 -1
- package/neural-interface/public/shared/assistant/asst-shell-logic.js +200 -0
- package/neural-interface/public/shared/assistant/asst-shell.js +111 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +4 -2
- package/neural-interface/public/shared/assistant/asst-state.js +11 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +11 -23
- package/neural-interface/public/shared/assistant/route-identity.js +2 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +9 -0
- package/neural-interface/public/shared/cdx/cdx-settings.js +3 -1
- package/neural-interface/public/shared/cdx/cdx-styles.js +6 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +54 -9
- package/neural-interface/public/shared/client-diagnostics.js +94 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +7 -2
- package/neural-interface/public/shared/cp/cp-styles.js +1 -1
- package/neural-interface/public/shared/effort-i18n.js +118 -0
- package/neural-interface/public/shared/extension-setup/es-page.js +10 -4
- package/neural-interface/public/shared/extension-setup/es-view.js +25 -10
- package/neural-interface/public/shared/html-shell.js +4 -52
- package/neural-interface/public/shared/loading-diagnostic-entry.js +64 -0
- package/neural-interface/public/shared/memory-store-wait.js +52 -0
- package/neural-interface/public/shared/morelogin-profile-field.js +1 -1
- package/neural-interface/public/shared/mtc/mtc-logic.js +2 -1
- package/neural-interface/public/shared/mtc/mtc-panel.js +25 -3
- package/neural-interface/public/shared/mtc/mtc-styles.js +13 -12
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +7 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +5 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-location-logic.js +109 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +1 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +8 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +152 -8
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +7 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +53 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +52 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +22 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-block.js +165 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-shell-logic.js +346 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-shell.js +108 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +49 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +67 -93
- package/neural-interface/public/shared/ocp-v2/ocp-v2-tools-logic.js +20 -5
- package/neural-interface/public/shared/ocp-v2/ocp-v2-tools.js +7 -1
- package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +17 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +7 -2
- package/neural-interface/public/shared/output-format.js +294 -0
- package/neural-interface/public/shared/provider-icons.js +6 -0
- package/neural-interface/public/shared/schedules-view.js +2 -1
- package/neural-interface/public/shared/server-presence.js +77 -0
- package/neural-interface/public/shared/settings/settings-backup-contents.js +241 -0
- package/neural-interface/public/shared/settings/settings-backup-download.js +298 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-backup-encryption.js +545 -0
- package/neural-interface/public/shared/settings/settings-browser-extension.js +54 -12
- package/neural-interface/public/shared/settings/settings-ia.js +1 -1
- package/neural-interface/public/shared/shell-stop-view.js +83 -0
- package/neural-interface/public/shared/skills/studio/sx-geometry.js +12 -3
- package/neural-interface/public/shared/skills/studio/sx-main.js +14 -7
- package/neural-interface/public/shared/studio-attention.js +6 -0
- package/neural-interface/public/shared/styles.css +341 -437
- package/neural-interface/public/shared/tour/tour-actor.js +14 -3
- package/neural-interface/public/shared/transcript-rows.js +28 -3
- package/neural-interface/public/shared/tray-auto-close.js +49 -6
- package/neural-interface/public/shared/ui-agents.js +1 -2
- package/neural-interface/public/shared/ui-automation-studio.js +168 -108
- package/neural-interface/public/shared/ui-claude-panel.js +62 -65
- package/neural-interface/public/shared/ui-loading.js +124 -17
- package/neural-interface/public/shared/ui-native-loop-router.js +52 -0
- package/neural-interface/public/shared/ui-navbar.js +2 -1
- package/neural-interface/public/shared/ui-output.js +533 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +165 -128
- package/neural-interface/public/shared/ui-scroll-follow.js +101 -6
- package/neural-interface/public/shared/ui-sessions.js +2 -2
- package/neural-interface/public/shared/ui-settings-entry.js +18 -0
- package/neural-interface/public/shared/ui-settings.js +224 -65
- package/neural-interface/public/shared/ui-sidepanel-tray.js +3 -2
- package/neural-interface/public/shared/ui-tooltip.js +16 -0
- package/neural-interface/public/shared/ui-tutorial.js +5 -6
- package/neural-interface/public/shared/ui-worker-end.js +27 -8
- package/neural-interface/public/shared/worker-end.js +9 -4
- package/neural-interface/public/variant/2d/main.js +5 -0
- package/neural-interface/public/variant/3d/app.js +10 -0
- package/neural-interface/public/variant/3d/main.js +5 -1
- package/neural-interface/scripts/scratch-retention.mjs +20 -0
- package/neural-interface/server.js +725 -173
- package/npm-shrinkwrap.json +5 -5
- package/package.json +1 -2
- package/scripts/restore-data-home-from-backup.mjs +175 -8
- package/setup.js +18 -4
- package/browser-extension/content.js +0 -189
- package/browser-extension/engine.js +0 -508
- 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 +0 -56
- package/browser-extension/popup-strings.js +0 -250
- package/browser-extension/popup-view.js +0 -151
- package/browser-extension/popup.css +0 -166
- package/browser-extension/popup.html +0 -108
- package/browser-extension/popup.js +0 -359
- package/browser-extension/service-worker.js +0 -275
- package/browser-extension/setup-content.js +0 -36
- package/browser-extension/tokens.css +0 -326
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from './agy-events.js';
|
|
27
27
|
import {
|
|
28
28
|
dropdownEntries, elicitationContent, elicitationFields, modeEntries, optionByCategory, permissionCard, quickOption,
|
|
29
|
-
secondaryOptions, toggledValue, withValue,
|
|
29
|
+
localizeThinkingEntries, secondaryOptions, toggledValue, withValue,
|
|
30
30
|
} from './agy-options.js';
|
|
31
31
|
import {
|
|
32
32
|
attachmentProblem, attachmentType, automationEvent, MAX_TABS, newTab, openSessionRequest, promptRequest, restoreTabs, runGeminiDir, serializeTabs, sessionLoadNotice, stagedPicture, tabLabel,
|
|
@@ -47,6 +47,7 @@ import { dropdownHTML, setDropdownDisabled, setDropdownItems, wireDropdowns, clo
|
|
|
47
47
|
import { renderMarkdown } from '../cp/cp-markdown.js';
|
|
48
48
|
import { createKeyedHtmlList } from '../dom-morph.js';
|
|
49
49
|
import { watchTranscriptRows } from '../transcript-rows.js';
|
|
50
|
+
import { createStickyScrollController } from '../ui-scroll-follow.js';
|
|
50
51
|
import { fetchProjects } from '../api.js';
|
|
51
52
|
import { createCliInstallController } from '../cli-install-controller.js';
|
|
52
53
|
import { setCliInstallTranslator } from '../cli-install-view.js';
|
|
@@ -57,6 +58,7 @@ import { runAwaitsAnswer, runTurnLive } from '../sidepanel-session-status.js';
|
|
|
57
58
|
import { wireFileLinks } from '../ui-file-links.js';
|
|
58
59
|
import { notify, NOTIF_TYPE } from '../ui-notifications.js';
|
|
59
60
|
import { forgetGreeting, mountGreeting } from '../greeting/greeting-card.js';
|
|
61
|
+
import { composerHoldsDraft, markAutoCloseKeep } from '../tray-auto-close.js';
|
|
60
62
|
|
|
61
63
|
export const PANEL_OWNER = 'antigravity-sidepanel';
|
|
62
64
|
const ICON = ICONS.mark;
|
|
@@ -556,10 +558,12 @@ function blockedNow() {
|
|
|
556
558
|
return '';
|
|
557
559
|
}
|
|
558
560
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
+
// `tab` is the tab the message is for: the one on screen, or (from drainQueue only) a tab in the background
|
|
562
|
+
// whose turn ended with its queue to go on, whose composer is not the one on screen and is never touched.
|
|
563
|
+
async function send({ text: given = null, staged: givenStaged = null, fromQueue = false, tab = activeTab() } = {}) {
|
|
561
564
|
if (!tab || tab.automationActive) return;
|
|
562
|
-
const
|
|
565
|
+
const onScreen = tab === activeTab();
|
|
566
|
+
const input = onScreen ? $('.agy-input') : null;
|
|
563
567
|
const text = given ?? (input?.value || '');
|
|
564
568
|
const rt = runtimeOf(tab);
|
|
565
569
|
const staged = givenStaged ?? rt.staged;
|
|
@@ -644,7 +648,7 @@ async function send({ text: given = null, staged: givenStaged = null, fromQueue
|
|
|
644
648
|
rt.notice = null;
|
|
645
649
|
tab.running = true;
|
|
646
650
|
tab.startedAt = Date.now();
|
|
647
|
-
hideHints();
|
|
651
|
+
if (onScreen) hideHints();
|
|
648
652
|
saveTabs();
|
|
649
653
|
renderTabs();
|
|
650
654
|
renderAttachments();
|
|
@@ -666,13 +670,20 @@ async function send({ text: given = null, staged: givenStaged = null, fromQueue
|
|
|
666
670
|
}
|
|
667
671
|
}
|
|
668
672
|
|
|
673
|
+
/**
|
|
674
|
+
* Send the next prompt queued in `tab`, the tab it was typed in, as the Claude Code and Codex panels do: a tab in
|
|
675
|
+
* the background whose turn ends goes on with its own queue, one prompt per turn in the order they were queued
|
|
676
|
+
* (the next one goes at that prompt's turn:end). A paused queue waits; so does one that cannot be sent now (a
|
|
677
|
+
* send under way, a running automation, a missing or broken agy): the prompt stays first in its queue.
|
|
678
|
+
*/
|
|
669
679
|
function drainQueue(tab) {
|
|
670
680
|
const rt = runtimeOf(tab);
|
|
671
|
-
if (!rt.queue.length || rt.queuePaused || tab.running) { renderQueue(); return; }
|
|
681
|
+
if (!rt.queue.length || rt.queuePaused || tab.running || rt.sending || tab.automationActive) { renderQueue(tab); return; }
|
|
682
|
+
if (blockedNow()) { if (tab === activeTab()) nudgeSetup(); renderQueue(tab); return; }
|
|
672
683
|
const next = rt.queue.shift();
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
684
|
+
// send() takes the prompt before its first await (rt.sending), so the mark below still says 'queue'.
|
|
685
|
+
send({ tab, text: next.text, staged: next.staged, fromQueue: true });
|
|
686
|
+
renderQueue(tab);
|
|
676
687
|
}
|
|
677
688
|
|
|
678
689
|
async function stop() {
|
|
@@ -1023,7 +1034,7 @@ function closeTab(idx, { closeSession = true } = {}) {
|
|
|
1023
1034
|
if (tab.automationRunId) {
|
|
1024
1035
|
const runId = tab.automationRunId;
|
|
1025
1036
|
window.dispatchEvent(new CustomEvent('native-loop:dismissed', { detail: { runId } }));
|
|
1026
|
-
endWorkerRunOnClose(runId, () => fetch('/api/loop/stop', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ runId }) }).catch(() => {}), { busy: !!tab.running });
|
|
1037
|
+
endWorkerRunOnClose(runId, () => fetch('/api/loop/stop', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ runId, action: 'tab_close' }) }).catch(() => {}), { busy: !!tab.running });
|
|
1027
1038
|
forgetWorkerEnd(runId);
|
|
1028
1039
|
}
|
|
1029
1040
|
tab.pillEl?.remove();
|
|
@@ -1042,7 +1053,7 @@ function closeTab(idx, { closeSession = true } = {}) {
|
|
|
1042
1053
|
// ── Rendering ──
|
|
1043
1054
|
function scheduleRender(tab = null, { follow = false } = {}) {
|
|
1044
1055
|
if (tab && tab !== activeTab()) { renderPills(); return; }
|
|
1045
|
-
if (follow) { const rt = runtimeOf(activeTab()); if (rt) rt.scrolledUp = false; }
|
|
1056
|
+
if (follow) { const rt = runtimeOf(activeTab()); if (rt) rt.scrolledUp = false; _scroll?.setFollowing(true); }
|
|
1046
1057
|
// A closed panel draws nothing: a pass rebuilds the whole transcript and reads its layout, once per frame
|
|
1047
1058
|
// for as long as a session streams there. Its pill says what the session does; showing the panel draws
|
|
1048
1059
|
// everything (setVisible → renderAll), from the same state.
|
|
@@ -1185,7 +1196,7 @@ function renderPickers() {
|
|
|
1185
1196
|
modelInput.dataset.configId = model?.id || '';
|
|
1186
1197
|
}
|
|
1187
1198
|
if (thinkingInput) {
|
|
1188
|
-
const entries = thinking ? dropdownEntries(thinking) : [{ value: '', label: T('thinking'), selected: true }];
|
|
1199
|
+
const entries = thinking ? localizeThinkingEntries(dropdownEntries(thinking), t) : [{ value: '', label: T('thinking'), selected: true }];
|
|
1189
1200
|
setDropdownItems(thinkingInput, entries);
|
|
1190
1201
|
setDropdownDisabled(thinkingInput, locked || !thinking);
|
|
1191
1202
|
thinkingInput.dataset.configId = thinking?.id || '';
|
|
@@ -1260,9 +1271,13 @@ function renderAttachments() {
|
|
|
1260
1271
|
box.innerHTML = staged.map((file, idx) => `<span class="agy-chip" title="${esc(file.path || file.name)}">${file.mimeType?.startsWith('image/') && file.dataUrl ? `<img src="${esc(file.dataUrl)}" alt="">` : ''}<span>${esc(file.name)}</span><button type="button" data-unstage="${idx}" aria-label="${esc(T('attachmentRemove', { name: file.name }))}">×</button></span>`).join('');
|
|
1261
1272
|
}
|
|
1262
1273
|
|
|
1263
|
-
function renderQueue() {
|
|
1274
|
+
function renderQueue(tab = activeTab()) {
|
|
1275
|
+
// The tray's auto-close keeps a tab while its queue holds prompts (autoCloseKeepOf): said at every change,
|
|
1276
|
+
// for a tab in the background too; only the tab on screen has its queue drawn.
|
|
1277
|
+
if (tab?.pillEl) markAutoCloseKeep(tab.pillEl, autoCloseKeepOf(tab));
|
|
1278
|
+
if (tab !== activeTab()) return;
|
|
1264
1279
|
const box = $('.agy-queue');
|
|
1265
|
-
const rt = runtimeOf(
|
|
1280
|
+
const rt = runtimeOf(tab);
|
|
1266
1281
|
if (!box) return;
|
|
1267
1282
|
const queue = rt?.queue || [];
|
|
1268
1283
|
box.hidden = !queue.length;
|
|
@@ -1278,6 +1293,12 @@ function renderQueue() {
|
|
|
1278
1293
|
// its whole transcript replaced on every frame; now it is the row being written.
|
|
1279
1294
|
let _transcriptList = null;
|
|
1280
1295
|
let _transcriptListBox = null;
|
|
1296
|
+
// The transcript's bottom follow (ui-scroll-follow.js): one controller over the one transcript element,
|
|
1297
|
+
// the panel's per-tab scrolledUp intent restored into it before a tab's rows are drawn (as Maritaca does).
|
|
1298
|
+
// It follows late layout and a message area whose height changes, which a write inside renderTranscript
|
|
1299
|
+
// alone never saw; its own scroll events never detach it.
|
|
1300
|
+
let _scroll = null;
|
|
1301
|
+
let _followTabId = null;
|
|
1281
1302
|
function transcriptList(box) {
|
|
1282
1303
|
if (_transcriptListBox !== box) { _transcriptList = createKeyedHtmlList(box); _transcriptListBox = box; }
|
|
1283
1304
|
return _transcriptList;
|
|
@@ -1316,8 +1337,10 @@ function renderTranscript() {
|
|
|
1316
1337
|
if (!box) return;
|
|
1317
1338
|
const tab = activeTab();
|
|
1318
1339
|
const rt = runtimeOf(tab);
|
|
1319
|
-
if (!tab || !rt) { box.innerHTML = ''; transcriptList(box).forget(); return; }
|
|
1320
|
-
|
|
1340
|
+
if (!tab || !rt) { box.innerHTML = ''; transcriptList(box).forget(); _followTabId = null; return; }
|
|
1341
|
+
// Another tab's rows are about to be drawn: restore this tab's follow intent into the shared controller
|
|
1342
|
+
// first (it cancels the preceding tab's queued scroll), as Maritaca's renderTranscript does.
|
|
1343
|
+
if (_followTabId !== tab.id) { _scroll?.setFollowing(!rt.scrolledUp); _followTabId = tab.id; }
|
|
1321
1344
|
const setup = currentSetup();
|
|
1322
1345
|
const rows = rt.transcript.rows;
|
|
1323
1346
|
const ctx = {
|
|
@@ -1353,11 +1376,20 @@ function renderTranscript() {
|
|
|
1353
1376
|
}
|
|
1354
1377
|
box._agyEmpty = null;
|
|
1355
1378
|
if (setupBlock) parts.unshift({ key: `${tab.id}:setup`, html: setupBlock });
|
|
1379
|
+
// Save the reader's scroll position before patching: replacing the streaming row in WebKit
|
|
1380
|
+
// briefly empties the flex scroller and resets scrollTop to 0 unless restored when not following.
|
|
1381
|
+
const prevScrollTop = box.scrollTop;
|
|
1356
1382
|
replaceKeepingFocus(box, parts, rt);
|
|
1357
1383
|
placeWorkerEnd(box, tab);
|
|
1358
1384
|
// A kept setup block keeps its classes: the nudge is set to what it is now, not only added.
|
|
1359
1385
|
box.querySelector('.agy-setup')?.classList.toggle('agy-nudge', !!_setup.nudge);
|
|
1360
|
-
|
|
1386
|
+
// The follow write is the controller's (instant, generation-checked): it also answers late layout and a
|
|
1387
|
+
// message-area height change between renders. force re-asserts the intent the tab was drawn with, so a
|
|
1388
|
+
// scroll event from the rows being replaced cannot detach it; a reader who scrolled up is left alone.
|
|
1389
|
+
const stick = _scroll?.isFollowing() ?? !rt.scrolledUp;
|
|
1390
|
+
rt.scrolledUp = !stick;
|
|
1391
|
+
if (stick) _scroll?.scrollToBottom({ force: true, immediate: true });
|
|
1392
|
+
else box.scrollTop = prevScrollTop;
|
|
1361
1393
|
const jump = $('.agy-jump');
|
|
1362
1394
|
if (jump) jump.hidden = !rt.scrolledUp;
|
|
1363
1395
|
}
|
|
@@ -1563,6 +1595,18 @@ function chooseHint(idx) {
|
|
|
1563
1595
|
renderComposer();
|
|
1564
1596
|
}
|
|
1565
1597
|
|
|
1598
|
+
// What the tray's auto-close must leave open (tray-auto-close.js), or '': a tab with prompts in its queue that
|
|
1599
|
+
// were never sent ('queue': paused or not, and while one taken off it is still on its way, `sending`), else a tab
|
|
1600
|
+
// holding an unsent draft, its text (in the composer while the tab is the one on screen) and its staged
|
|
1601
|
+
// attachments. The user's X closes it as before. renderQueue repaints the mark at every change of a queue.
|
|
1602
|
+
function autoCloseKeepOf(tab) {
|
|
1603
|
+
if (!tab) return '';
|
|
1604
|
+
const rt = _runtime.get(tab.id);
|
|
1605
|
+
if (rt?.queue.length || rt?.sending) return 'queue';
|
|
1606
|
+
const input = tab === activeTab() ? $('.agy-input') : null;
|
|
1607
|
+
return composerHoldsDraft(input ? input.value : tab.draft, rt?.staged) ? 'draft' : '';
|
|
1608
|
+
}
|
|
1609
|
+
|
|
1566
1610
|
// ── Tray pills (shown for tabs with something in them while the panel is closed, or not the active tab) ──
|
|
1567
1611
|
function renderPills() {
|
|
1568
1612
|
const tray = document.getElementById('term-minimized-tray');
|
|
@@ -1572,6 +1616,8 @@ function renderPills() {
|
|
|
1572
1616
|
const pill = document.createElement('div');
|
|
1573
1617
|
pill.className = 'term-minimized-pill agy-session-pill';
|
|
1574
1618
|
pill.dataset.tabId = tab.id;
|
|
1619
|
+
pill.getAutomationRunId = () => tab.automationRunId;
|
|
1620
|
+
pill.keepFromAutoClose = () => autoCloseKeepOf(tab);
|
|
1575
1621
|
pill.tabIndex = 0;
|
|
1576
1622
|
pill.innerHTML = `<span class="term-minimized-pill-icon agy-mark">${ICON}</span><span class="term-minimized-pill-label"></span><button class="term-minimized-pill-close" data-tooltip="${esc(T('closeTab'))}" data-tooltip-pos="top">×</button>`;
|
|
1577
1623
|
const openIt = () => {
|
|
@@ -1603,6 +1649,7 @@ function renderPills() {
|
|
|
1603
1649
|
const needsYou = !!(tab.needsYou || tab.automationAwaits);
|
|
1604
1650
|
tab.pillEl.classList.toggle('agy-pill-attention', needsYou);
|
|
1605
1651
|
tab.pillEl.classList.toggle('agy-pill-running', !needsYou && !!tab.running);
|
|
1652
|
+
markAutoCloseKeep(tab.pillEl, autoCloseKeepOf(tab));
|
|
1606
1653
|
const meaningful = !!(tab.sessionId || tab.running || tab.draft || tab.automationRunId || tab.needsYou);
|
|
1607
1654
|
tab.pillEl.style.display = meaningful && (!_visible || tab !== activeTab()) ? '' : 'none';
|
|
1608
1655
|
}
|
|
@@ -2263,8 +2310,7 @@ function wire() {
|
|
|
2263
2310
|
$('.agy-jump').addEventListener('click', () => {
|
|
2264
2311
|
const rt = runtimeOf(activeTab());
|
|
2265
2312
|
if (rt) rt.scrolledUp = false;
|
|
2266
|
-
|
|
2267
|
-
if (box) box.scrollTop = box.scrollHeight;
|
|
2313
|
+
_scroll?.scrollToBottom({ force: true, immediate: true });
|
|
2268
2314
|
$('.agy-jump').hidden = true;
|
|
2269
2315
|
});
|
|
2270
2316
|
const transcript = $('.agy-transcript');
|
|
@@ -2272,10 +2318,11 @@ function wire() {
|
|
|
2272
2318
|
// Rows far from the screen are skipped by the engine, at their exact size (transcript-rows.js). The rows
|
|
2273
2319
|
// stay the same nodes from one pass to the next now (transcriptList), so what is known of them holds.
|
|
2274
2320
|
watchTranscriptRows(transcript);
|
|
2321
|
+
_scroll = createStickyScrollController(transcript);
|
|
2275
2322
|
transcript.addEventListener('scroll', () => {
|
|
2276
2323
|
const rt = runtimeOf(activeTab());
|
|
2277
2324
|
if (!rt) return;
|
|
2278
|
-
rt.scrolledUp =
|
|
2325
|
+
rt.scrolledUp = !_scroll.isFollowing();
|
|
2279
2326
|
const jump = $('.agy-jump');
|
|
2280
2327
|
if (jump) jump.hidden = !rt.scrolledUp;
|
|
2281
2328
|
});
|
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
// the tray pill).
|
|
9
9
|
|
|
10
10
|
import { installCodeCopy } from '../ui-code-copy.js';
|
|
11
|
+
import { installOutput } from '../ui-output.js';
|
|
11
12
|
|
|
12
13
|
export function injectAntigravityStyles() {
|
|
13
14
|
// The Copy button of every code block: its stylesheet and its one click listener, in this document.
|
|
14
15
|
installCodeCopy(document);
|
|
16
|
+
// The reading layer of an agent's answer (prose, tables, code): one stylesheet for the six panels.
|
|
17
|
+
installOutput(document);
|
|
15
18
|
if (document.getElementById('antigravity-panel-styles')) return;
|
|
16
19
|
const style = document.createElement('style');
|
|
17
20
|
style.id = 'antigravity-panel-styles';
|
|
@@ -212,18 +215,9 @@ export function injectAntigravityStyles() {
|
|
|
212
215
|
.agy-msg-agent, .agy-msg-relay { flex-direction: column; color: var(--agy-text); word-break: break-word; }
|
|
213
216
|
.agy-msg-relay { margin: 0 var(--agy-space-2); border-left: 2px solid var(--agy-border-strong); padding-left: var(--agy-space-3); }
|
|
214
217
|
.agy-msg-relay-label { font-size: var(--agy-fs-sm); color: var(--agy-text-3); }
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
.agy-md
|
|
218
|
-
.agy-md :is(h1, h2, h3, h4) { margin: 12px 0 6px; font-size: var(--agy-fs-lg); font-weight: 600; line-height: var(--agy-lh-tight); }
|
|
219
|
-
.agy-md :is(ul, ol) { padding-left: 18px; }
|
|
220
|
-
.agy-md a { color: var(--agy-link); }
|
|
221
|
-
.agy-md code { font-family: var(--agy-mono); font-size: 0.92em; background: var(--agy-surface-2); padding: 1px 4px; border-radius: var(--agy-radius-sm); }
|
|
222
|
-
.agy-md pre { background: var(--agy-surface-1); border-radius: var(--agy-radius-md); padding: 8px 10px; overflow-x: auto; font: var(--agy-fs-sm)/1.55 var(--agy-mono); }
|
|
223
|
-
.agy-md pre code { background: none; padding: 0; }
|
|
224
|
-
.agy-md blockquote { border-left: 2px solid var(--agy-border-strong); padding-left: 10px; color: var(--agy-text-2); }
|
|
225
|
-
.agy-md table { border-collapse: collapse; display: block; overflow-x: auto; }
|
|
226
|
-
.agy-md :is(th, td) { border: 1px solid var(--agy-border); padding: 3px 8px; text-align: left; }
|
|
218
|
+
/* An answer's prose, tables and code are the shared reading layer (../ui-output.js): one system for the six
|
|
219
|
+
side panels. A tag is never styled here again; this panel's voice is its link colour. */
|
|
220
|
+
.agy-md { --sbo-link: var(--agy-link); }
|
|
227
221
|
.agy-attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
|
|
228
222
|
.agy-msg-image { display: block; width: auto; height: auto; max-width: min(220px, 100%); max-height: 180px; object-fit: contain; border-radius: var(--agy-radius-sm); }
|
|
229
223
|
.agy-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 2px 6px; border-radius: var(--agy-radius-sm); background: var(--agy-surface-2); color: var(--agy-text-2); font-size: var(--agy-fs-sm); }
|
|
@@ -624,6 +618,14 @@ export function injectAntigravityStyles() {
|
|
|
624
618
|
.agy-panel { transition: none; }
|
|
625
619
|
.agy-panel *, .agy-pop * { animation: none !important; transition: none !important; }
|
|
626
620
|
}
|
|
621
|
+
|
|
622
|
+
/* ── Reading pass (2026-11-21) ──
|
|
623
|
+
An answer's prose, tables and code are ../ui-output.js. Here: what the user wrote reads at the answer's size,
|
|
624
|
+
a turn's footer is legible, and what the agent says right before a tool call is secondary text (colour only). */
|
|
625
|
+
.agy-msg-text { font-size: var(--agy-fs-lg); }
|
|
626
|
+
.agy-turn-foot { font-size: var(--agy-fs-sm); }
|
|
627
|
+
.agy-msg-agent:has(+ .agy-card) .agy-md { --sbo-text: var(--agy-text-2); --sbo-strong: var(--agy-text); }
|
|
628
|
+
@media (hover: none) { .agy-turn-actions { opacity: 1; } }
|
|
627
629
|
`;
|
|
628
630
|
document.head.appendChild(style);
|
|
629
631
|
}
|
|
@@ -143,7 +143,10 @@ export function automationEvent(payload) {
|
|
|
143
143
|
const event = message?.event ?? message;
|
|
144
144
|
if (!event || typeof event !== 'object') return null;
|
|
145
145
|
if (event.type === 'synabun.user_prompt' || eventType === 'synabun.user_prompt') return { kind: 'user', text: String(event.text || ''), iteration: message.iteration ?? null };
|
|
146
|
-
if (event.type === 'synabun.confinement')
|
|
146
|
+
if (event.type === 'synabun.confinement') {
|
|
147
|
+
const [label, severity] = event.action === 'warned' ? ['Guard warning', 'warning'] : event.action === 'noted' ? ['Guard note', 'info'] : ['Refused', 'error'];
|
|
148
|
+
return { kind: 'notice', text: `${label}: ${event.reason || event.rule || ''}`.trim(), severity };
|
|
149
|
+
}
|
|
147
150
|
if (event.type === 'synabun.provider_exit') return { kind: 'notice', text: `Antigravity stopped${event.error ? `: ${event.error}` : ''}`, severity: 'error' };
|
|
148
151
|
if (event.type === 'synabun.error') return { kind: 'notice', text: String(event.message || event.error || 'Error'), severity: 'error' };
|
|
149
152
|
if (typeof event.sessionUpdate === 'string') return { kind: 'update', update: event };
|
|
@@ -1348,7 +1348,7 @@ export async function sendClientLoopLog(terminalSessionId, tag, msg, meta) {
|
|
|
1348
1348
|
export async function stopLoop(terminalSessionId) {
|
|
1349
1349
|
return jsonFetch('/api/loop/stop', {
|
|
1350
1350
|
method: 'POST',
|
|
1351
|
-
...jsonBody(
|
|
1351
|
+
...jsonBody({ terminalSessionId, action: 'stop' }),
|
|
1352
1352
|
});
|
|
1353
1353
|
}
|
|
1354
1354
|
|
|
@@ -40,6 +40,31 @@ function jsonBody(data, method = 'POST') {
|
|
|
40
40
|
|
|
41
41
|
const enc = encodeURIComponent;
|
|
42
42
|
|
|
43
|
+
// ── A shell command's output (OpenCode brain) ─
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* One page of what a command of this conversation printed. Never throws and raises no guest toast: a page that
|
|
47
|
+
* cannot be read is the terminal block's to say. → { status, data: { output, cursor, size, from } } or { ok: false, status, error }.
|
|
48
|
+
*/
|
|
49
|
+
export async function readAssistantShellOutput(sessionId, { shellId, cursor, tail, limit } = {}) {
|
|
50
|
+
const query = new URLSearchParams();
|
|
51
|
+
if (Number.isSafeInteger(cursor) && cursor >= 0) query.set('cursor', String(cursor));
|
|
52
|
+
if (Number.isSafeInteger(tail) && tail > 0) query.set('tail', String(tail));
|
|
53
|
+
if (Number.isSafeInteger(limit) && limit > 0) query.set('limit', String(limit));
|
|
54
|
+
const search = query.toString();
|
|
55
|
+
let res;
|
|
56
|
+
try {
|
|
57
|
+
res = await fetch(`/api/assistant/sessions/${enc(sessionId)}/shells/${enc(shellId)}/output${search ? `?${search}` : ''}`, { credentials: 'same-origin' });
|
|
58
|
+
} catch (error) {
|
|
59
|
+
return { ok: false, error: error?.message || 'The output could not be read.' };
|
|
60
|
+
}
|
|
61
|
+
let body = null;
|
|
62
|
+
try { body = await res.json(); } catch { /* not JSON */ }
|
|
63
|
+
if (!res.ok || !body?.ok) return { ok: false, status: res.status, error: body?.error || `HTTP ${res.status}` };
|
|
64
|
+
const { ok: _ok, ...data } = body;
|
|
65
|
+
return { status: res.status, data };
|
|
66
|
+
}
|
|
67
|
+
|
|
43
68
|
// ── Catalog ──────────────────────────────────
|
|
44
69
|
|
|
45
70
|
export function fetchAssistantCatalog({ force = false } = {}) {
|
|
@@ -65,7 +90,7 @@ export function fetchManageCatalog({ force = false } = {}) {
|
|
|
65
90
|
|
|
66
91
|
// ── Routing (model routes) ───────────────────
|
|
67
92
|
|
|
68
|
-
/** → { ok, version, routing:{ defaultMode, askBelow, waitSeconds,
|
|
93
|
+
/** → { ok, version, routing:{ defaultMode, askBelow, waitSeconds, preferences, ladders, catalogFilter }, taskClasses, modes } */
|
|
69
94
|
export function getRouting() {
|
|
70
95
|
return jsonFetch('/api/assistant/routing');
|
|
71
96
|
}
|
|
@@ -230,7 +255,7 @@ export function sendAssistantRun(runId, text, { origin = 'user' } = {}) {
|
|
|
230
255
|
}
|
|
231
256
|
|
|
232
257
|
export function stopAssistantRun(runId, reason) {
|
|
233
|
-
return jsonFetch(`/api/assistant/runs/${enc(runId)}/stop`, jsonBody(
|
|
258
|
+
return jsonFetch(`/api/assistant/runs/${enc(runId)}/stop`, jsonBody({ reason, action: 'stop' }));
|
|
234
259
|
}
|
|
235
260
|
|
|
236
261
|
/** Remove one finished run from the agents tray (409 RUN_ACTIVE while it still runs). */
|
|
@@ -249,7 +274,7 @@ export function focusAssistantRun(runId) {
|
|
|
249
274
|
}
|
|
250
275
|
|
|
251
276
|
export function killAllAssistantRuns(assistantSessionId) {
|
|
252
|
-
return jsonFetch('/api/assistant/kill-all', jsonBody({ assistantSessionId }));
|
|
277
|
+
return jsonFetch('/api/assistant/kill-all', jsonBody({ assistantSessionId, action: 'stop' }));
|
|
253
278
|
}
|
|
254
279
|
|
|
255
280
|
// ── Claude accounts ──────────────────────────
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
modelSelectorValue,
|
|
31
31
|
} from '../agent-runtime-options.js';
|
|
32
32
|
import { getHiddenModels, HIDDEN_MODELS_EVENT, hiddenModelMatch } from '../ocp-hidden-models.js';
|
|
33
|
-
import {
|
|
33
|
+
import { effortDescFor } from '../effort-i18n.js';
|
|
34
34
|
import { on } from '../state.js';
|
|
35
35
|
import { registerLaunchPrefetch } from '../launch-prefetch.js';
|
|
36
36
|
import { fetchAssistantCatalog, fetchProjects, patchClaudeAccount, patchCodexAccount, setClaudeWorkerAccount, setCodexWorkerAccount } from './asst-api.js';
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
PLAN_MODE_PROVIDERS,
|
|
55
55
|
permissionModeLabel,
|
|
56
56
|
PROVIDERS,
|
|
57
|
+
displayProvider,
|
|
57
58
|
providerMeta,
|
|
58
59
|
projectLabel,
|
|
59
60
|
resolveBrainDefaults,
|
|
@@ -64,6 +65,7 @@ import {
|
|
|
64
65
|
AGENT_DENSITIES,
|
|
65
66
|
agentDensityFigures,
|
|
66
67
|
normalizeAgentDensity,
|
|
68
|
+
brainEffortWord,
|
|
67
69
|
} from './asst-state.js';
|
|
68
70
|
|
|
69
71
|
let _projectsCache = null;
|
|
@@ -703,16 +705,18 @@ export async function openModelMenu(anchor, opts = {}) {
|
|
|
703
705
|
const hiddenCount = metadata.hiddenCounts[provider] || 0;
|
|
704
706
|
const note = opts.routingEditor && provider === run ? tr('assistant.routes.menu.hiddenCount', '{count} hidden in Models', { count: hiddenCount }) : warnSwitch && run !== b.provider ? tr('assistant.brain.newConversation', 'starts a new conversation') : '';
|
|
705
707
|
items.push({ kind: 'header', label: meta.label, icon: meta.icon, color: meta.color, note });
|
|
708
|
+
const rowBrand = provider === 'maritaca' ? { icon: meta.icon, color: meta.color } : {};
|
|
706
709
|
const unavailable = models.filter(m => m.status === 'unavailable');
|
|
707
710
|
if (unavailable.length) items.push({ kind: 'info', label: tr('assistant.routes.menu.maritacaUnavailable', 'Register Maritaca under Settings → OpenCode → Providers') });
|
|
708
711
|
for (const m of models) {
|
|
709
712
|
if (m.status === 'unavailable') {
|
|
710
|
-
items.push({ id: `${provider}:${m.id}`, label: m.label, desc: modelDesc(m, tr, false), tag: tierTag(m, tr), keywords: `${meta.label} ${m.id}`, disabled: true, title: m.hint || '' });
|
|
713
|
+
items.push({ ...rowBrand, id: `${provider}:${m.id}`, label: m.label, desc: modelDesc(m, tr, false), tag: tierTag(m, tr), keywords: `${meta.label} ${m.id}`, disabled: true, title: m.hint || '' });
|
|
711
714
|
continue;
|
|
712
715
|
}
|
|
713
716
|
const target = runnableProvider(provider, m);
|
|
714
717
|
items.push({
|
|
715
718
|
kind: 'radio',
|
|
719
|
+
...rowBrand,
|
|
716
720
|
id: `${provider}:${m.id}`,
|
|
717
721
|
label: m.label,
|
|
718
722
|
desc: modelDesc(m, tr, opts.routingEditor),
|
|
@@ -908,7 +912,10 @@ export function createBrainPicker(host, hooks = {}) {
|
|
|
908
912
|
const model = catalogModelRow(brain.provider, brain.model) || modelOf(brain);
|
|
909
913
|
return brainEffortChoices(brain.provider, getEffortLevelsForModel(brain.provider, model)).map((e) => (e.key === 'auto'
|
|
910
914
|
? { ...e, label: t('assistant.brain.effortAuto', e.label), desc: t('assistant.brain.effortAutoDesc', e.desc) }
|
|
911
|
-
: e.key === 'none' ? { ...e, label: t('assistant.brain.effortNone', e.label), desc: t('assistant.brain.effortNoneDesc', e.desc) }
|
|
915
|
+
: e.key === 'none' ? { ...e, label: t('assistant.brain.effortNone', e.label), desc: t('assistant.brain.effortNoneDesc', e.desc) }
|
|
916
|
+
// Codex / Antigravity: the `off` row is "Default" (stored as no effort); its words are its own.
|
|
917
|
+
: e.id === 'off' ? { ...e, label: t('assistant.brain.effortDefault', e.label), desc: effortDescFor(e.desc, hooks.t) }
|
|
918
|
+
: { ...e, label: brainEffortWord(e.id, e.label, hooks.t), desc: effortDescFor(e.desc, hooks.t) }));
|
|
912
919
|
}
|
|
913
920
|
|
|
914
921
|
function accountOf(brain) {
|
|
@@ -965,7 +972,7 @@ export function createBrainPicker(host, hooks = {}) {
|
|
|
965
972
|
}
|
|
966
973
|
|
|
967
974
|
function values(brain = currentBrain()) {
|
|
968
|
-
const meta =
|
|
975
|
+
const meta = providerMeta(displayProvider(brain));
|
|
969
976
|
const efforts = effortsFor(brain);
|
|
970
977
|
// Claude's Auto row stands for no effort and for the `off` a server writes when it resets a level.
|
|
971
978
|
const level = efforts.find(e => e.id === brain.effort)
|
|
@@ -979,9 +986,9 @@ export function createBrainPicker(host, hooks = {}) {
|
|
|
979
986
|
effort: brain.provider === 'opencode'
|
|
980
987
|
? (brain.agent || t('assistant.brain.agentDefault', 'default'))
|
|
981
988
|
// Antigravity has no "off" level: no level is the model's own default ("Default").
|
|
982
|
-
: (level ? level.label : (brain.effort || (brain.provider === 'antigravity' ? (efforts.find(e => e.id === 'off')?.label || t('assistant.brain.effortOff', 'off')) : t('assistant.brain.effortOff', 'off')))),
|
|
989
|
+
: (level ? level.label : (brainEffortWord(brain.effort, brain.effort, hooks.t) || (brain.provider === 'antigravity' ? (efforts.find(e => e.id === 'off')?.label || t('assistant.brain.effortOff', 'off')) : t('assistant.brain.effortOff', 'off')))),
|
|
983
990
|
variantSupported: brain.provider === 'opencode' && hasEfforts,
|
|
984
|
-
variant: level ? level.label : (brain.effort || t('assistant.brain.variantDefault', 'default variant')),
|
|
991
|
+
variant: level ? level.label : (brainEffortWord(brain.effort, brain.effort, hooks.t) || t('assistant.brain.variantDefault', 'default variant')),
|
|
985
992
|
project: brain.project ? projectLabel(brain.project, _projectsCache || []) : t('assistant.brain.projectHome', 'Home'),
|
|
986
993
|
mode: permissionModeLabel(brain, (id, fallback) => t(`assistant.brain.modes.${id}`, fallback)),
|
|
987
994
|
mcp: toolListView(toolCatalog, brain.tools, { translate: hooks.t }).summary,
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
import { normalizeProvider } from './asst-state.js';
|
|
39
39
|
import { sanitizeInto } from './asst-sanitize.js';
|
|
40
40
|
import { decorateCodeBlocks } from '../ui-code-copy.js';
|
|
41
|
+
import { decorateOutput } from '../ui-output.js';
|
|
41
42
|
import { fill, maskEcho, redactInput } from './asst-tool-kinds.js';
|
|
42
43
|
import { mascotSvg, paintMascot, stillFrame } from '../synabun-mascot.js';
|
|
43
44
|
import { splitRecommended } from './asst-followups.js';
|
|
@@ -1071,6 +1072,7 @@ function renderPlanBody(body, n, hooks) {
|
|
|
1071
1072
|
catch { planEl.textContent = n.plan; } // no DOM to parse into (a test DOM): the plain text
|
|
1072
1073
|
// A block of the plan gets the shared Copy button (../ui-code-copy.js).
|
|
1073
1074
|
try { decorateCodeBlocks(planEl); } catch { /* a test DOM without selectors */ }
|
|
1075
|
+
try { decorateOutput(planEl); } catch { /* the same */ }
|
|
1074
1076
|
body.appendChild(planEl);
|
|
1075
1077
|
}
|
|
1076
1078
|
|
|
@@ -12,24 +12,43 @@
|
|
|
12
12
|
// not, so a loop nobody sees is never free; the observer is the browser's own,
|
|
13
13
|
// so watching costs nothing while the transcript scrolls.
|
|
14
14
|
//
|
|
15
|
-
// createMotionGate({ IntersectionObserver }?) → { watch(el), unwatch(el), disconnect(), size() }
|
|
15
|
+
// createMotionGate({ IntersectionObserver, onMark }?) → { watch(el), unwatch(el), disconnect(), size() }
|
|
16
|
+
// createMarkSettle({ reconsider }) → { hold(row), holds(row), size(), dispose() }
|
|
16
17
|
//
|
|
17
18
|
// No observer (an old engine, a test without one): nothing is marked, every
|
|
18
19
|
// loop runs as before. DOM-light on purpose: tests/assistant-motion-gate.test.mjs
|
|
19
20
|
// drives it with a stand-in observer.
|
|
21
|
+
//
|
|
22
|
+
// A mark pauses nothing until the engine has styled it, and Chromium styles
|
|
23
|
+
// nothing inside a transcript row it skips (transcript-rows.js hands a row far
|
|
24
|
+
// from the screen to `content-visibility: auto`). A holder that leaves the
|
|
25
|
+
// screen in one jump is marked in the same frame as its row is made far, by
|
|
26
|
+
// two observers whose callbacks the engine runs in either order: when the row
|
|
27
|
+
// came first the pause never reached the animations, which stayed `running`
|
|
28
|
+
// for as long as the row was away. `onMark` tells the host of every mark that
|
|
29
|
+
// changed; createMarkSettle keeps the holder's row plain until that mark has
|
|
30
|
+
// been styled (the host: asst-panel.js).
|
|
20
31
|
|
|
21
32
|
export const OFFSCREEN_ATTR = 'data-offscreen';
|
|
22
33
|
const PRUNE_EVERY = 32; // watched holders between two sweeps for ones that left the document
|
|
34
|
+
/**
|
|
35
|
+
* Frames a row stays plain after a mark changed under it. The first of them may be the frame the mark was
|
|
36
|
+
* written in (its callbacks run before that frame is styled); the second cannot be, so every frame in
|
|
37
|
+
* between was styled with the mark in it and the row plain.
|
|
38
|
+
*/
|
|
39
|
+
export const SETTLE_FRAMES = 2;
|
|
23
40
|
|
|
24
|
-
export function createMotionGate({ IntersectionObserver: IO = globalThis.IntersectionObserver } = {}) {
|
|
41
|
+
export function createMotionGate({ IntersectionObserver: IO = globalThis.IntersectionObserver, onMark = null } = {}) {
|
|
25
42
|
const watched = new Set();
|
|
26
43
|
let io = null; // undefined: no observer here
|
|
27
44
|
|
|
28
45
|
function mark(el, off) {
|
|
46
|
+
let changed = false;
|
|
29
47
|
try {
|
|
30
|
-
if (off) { if (!el.hasAttribute(OFFSCREEN_ATTR)) el.setAttribute(OFFSCREEN_ATTR, ''); }
|
|
31
|
-
else if (el.hasAttribute(OFFSCREEN_ATTR)) el.removeAttribute(OFFSCREEN_ATTR);
|
|
48
|
+
if (off) { if (!el.hasAttribute(OFFSCREEN_ATTR)) { el.setAttribute(OFFSCREEN_ATTR, ''); changed = true; } }
|
|
49
|
+
else if (el.hasAttribute(OFFSCREEN_ATTR)) { el.removeAttribute(OFFSCREEN_ATTR); changed = true; }
|
|
32
50
|
} catch { /* not an element */ }
|
|
51
|
+
if (changed && typeof onMark === 'function') { try { onMark(el, off); } catch { /* the mark stands */ } }
|
|
33
52
|
}
|
|
34
53
|
|
|
35
54
|
function observer() {
|
|
@@ -78,3 +97,58 @@ export function createMotionGate({ IntersectionObserver: IO = globalThis.Interse
|
|
|
78
97
|
|
|
79
98
|
return { watch, unwatch, disconnect, size: () => watched.size };
|
|
80
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The rows a mark just changed under, each kept plain until the mark has been styled.
|
|
103
|
+
*
|
|
104
|
+
* `hold(row)` holds a row for SETTLE_FRAMES frames and asks `reconsider(row)` at once (a row already made
|
|
105
|
+
* far is made plain again, in the task that wrote the mark) and once more when the hold ends (the row may
|
|
106
|
+
* be far from then on). `holds(row)` is what the row watcher's `skip` asks. Nothing here reads a style or a
|
|
107
|
+
* layout, and no frame is asked for while no row is held. A page that draws no frame (a hidden tab) keeps
|
|
108
|
+
* its rows held, and plain, until it draws again. Without `requestAnimationFrame` nothing is ever held.
|
|
109
|
+
*
|
|
110
|
+
* @param {object} options
|
|
111
|
+
* @param {(row: Element) => void} options.reconsider decide again whether the row is far (the row watcher's)
|
|
112
|
+
*/
|
|
113
|
+
export function createMarkSettle({
|
|
114
|
+
reconsider,
|
|
115
|
+
frames = SETTLE_FRAMES,
|
|
116
|
+
requestFrame = globalThis.requestAnimationFrame,
|
|
117
|
+
cancelFrame = globalThis.cancelAnimationFrame,
|
|
118
|
+
} = {}) {
|
|
119
|
+
/** @type {Map<Element, number>} row → frames it is still held for */
|
|
120
|
+
const held = new Map();
|
|
121
|
+
let request = 0;
|
|
122
|
+
let disposed = false;
|
|
123
|
+
|
|
124
|
+
const again = (row) => { try { reconsider?.(row); } catch { /* the row or its watcher is gone */ } };
|
|
125
|
+
|
|
126
|
+
function frame() {
|
|
127
|
+
request = 0;
|
|
128
|
+
if (disposed) return;
|
|
129
|
+
for (const [row, left] of Array.from(held)) {
|
|
130
|
+
if (left > 1) { held.set(row, left - 1); continue; }
|
|
131
|
+
held.delete(row);
|
|
132
|
+
again(row);
|
|
133
|
+
}
|
|
134
|
+
if (held.size) request = requestFrame(frame);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function hold(row) {
|
|
138
|
+
if (disposed || !row || typeof requestFrame !== 'function') return false;
|
|
139
|
+
held.set(row, frames); // a second mark under a held row starts its count again
|
|
140
|
+
again(row);
|
|
141
|
+
if (!request) request = requestFrame(frame);
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function dispose() {
|
|
146
|
+
if (disposed) return;
|
|
147
|
+
disposed = true;
|
|
148
|
+
if (request && typeof cancelFrame === 'function') { try { cancelFrame(request); } catch { /* already gone */ } }
|
|
149
|
+
request = 0;
|
|
150
|
+
held.clear();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
return { hold, holds: (row) => held.has(row), size: () => held.size, dispose };
|
|
154
|
+
}
|