synabun 2.0.9 → 2.1.0
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 +115 -0
- package/README.md +25 -2
- package/THIRD-PARTY-LICENSES.md +68 -4
- package/bin/synabun.js +71 -24
- package/docs/whatsapp.md +2 -2
- package/hooks/claude-code/pre-websearch.mjs +12 -1
- package/hooks/claude-code/shared.mjs +5 -0
- package/hooks/claude-code/stop.mjs +1 -1
- package/launcher.mjs +9 -3
- package/lib/claude-hooks.js +172 -18
- package/lib/client-config-repair.js +17 -8
- package/lib/desktop-app.js +7 -1
- package/lib/external-tools.js +1 -1
- package/lib/first-launch-protection.js +57 -12
- package/lib/mcp-dist.js +176 -0
- package/lib/release-npm-ci.mjs +138 -0
- package/lib/release-publish.mjs +91 -0
- package/lib/release-scan.mjs +50 -0
- package/lib/server-crash-record.js +123 -0
- package/lib/server-exit.js +318 -0
- package/lib/server-supervisor.js +508 -0
- package/lib/start-launcher.js +43 -5
- package/lib/tools-cli.js +45 -0
- package/lib/update-snapshot.js +228 -0
- package/lib/virustotal.mjs +192 -0
- package/lib/windows-crash-event.js +269 -0
- package/mcp-server/dist/http.d.ts +20 -1
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +59 -12
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts +33 -27
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +128 -143
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/preload.js +1 -1
- package/mcp-server/dist/preload.js.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.d.ts +6 -2
- package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.js +81 -28
- package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
- package/mcp-server/dist/services/memory-judge-backfill.d.ts +6 -0
- package/mcp-server/dist/services/memory-judge-backfill.d.ts.map +1 -1
- package/mcp-server/dist/services/memory-judge-backfill.js +7 -1
- package/mcp-server/dist/services/memory-judge-backfill.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +16 -10
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +67 -11
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/server-instructions.d.ts +7 -2
- package/mcp-server/dist/services/server-instructions.d.ts.map +1 -1
- package/mcp-server/dist/services/server-instructions.js +20 -62
- package/mcp-server/dist/services/server-instructions.js.map +1 -1
- package/mcp-server/dist/services/tool-catalog.d.ts +120 -0
- package/mcp-server/dist/services/tool-catalog.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-catalog.js +339 -0
- package/mcp-server/dist/services/tool-catalog.js.map +1 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.d.ts +12 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.js +40 -0
- package/mcp-server/dist/services/tool-list-refresh-barrier.js.map +1 -0
- package/mcp-server/dist/services/tool-list.d.ts +108 -0
- package/mcp-server/dist/services/tool-list.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-list.js +334 -0
- package/mcp-server/dist/services/tool-list.js.map +1 -0
- package/mcp-server/dist/services/tool-runtime.d.ts +161 -0
- package/mcp-server/dist/services/tool-runtime.d.ts.map +1 -0
- package/mcp-server/dist/services/tool-runtime.js +400 -0
- package/mcp-server/dist/services/tool-runtime.js.map +1 -0
- package/mcp-server/dist/services/whiteboard-geometry.d.ts +26 -2
- package/mcp-server/dist/services/whiteboard-geometry.d.ts.map +1 -1
- package/mcp-server/dist/services/whiteboard-geometry.js +91 -8
- package/mcp-server/dist/services/whiteboard-geometry.js.map +1 -1
- package/mcp-server/dist/tools/agents.d.ts +10 -10
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +22 -13
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/browser-batch.d.ts +3 -3
- package/mcp-server/dist/tools/image-tools.d.ts +1 -1
- package/mcp-server/dist/tools/image-tools.js +1 -1
- package/mcp-server/dist/tools/skill-tools.d.ts +505 -0
- package/mcp-server/dist/tools/skill-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/skill-tools.js +639 -0
- package/mcp-server/dist/tools/skill-tools.js.map +1 -0
- package/mcp-server/dist/tools/skill.d.ts +7 -0
- package/mcp-server/dist/tools/skill.d.ts.map +1 -0
- package/mcp-server/dist/tools/skill.js +11 -0
- package/mcp-server/dist/tools/skill.js.map +1 -0
- package/mcp-server/dist/tools/tool-groups.d.ts +68 -0
- package/mcp-server/dist/tools/tool-groups.d.ts.map +1 -0
- package/mcp-server/dist/tools/tool-groups.js +147 -0
- package/mcp-server/dist/tools/tool-groups.js.map +1 -0
- package/mcp-server/dist/tools/whiteboard-format.d.ts.map +1 -1
- package/mcp-server/dist/tools/whiteboard-format.js +7 -4
- package/mcp-server/dist/tools/whiteboard-format.js.map +1 -1
- package/mcp-server/dist/tools/whiteboard-tools.d.ts +64 -13
- package/mcp-server/dist/tools/whiteboard-tools.d.ts.map +1 -1
- package/mcp-server/dist/tools/whiteboard-tools.js +30 -5
- package/mcp-server/dist/tools/whiteboard-tools.js.map +1 -1
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/src/http.ts +75 -12
- package/mcp-server/src/index.ts +147 -154
- package/mcp-server/src/preload.ts +12 -12
- package/mcp-server/src/services/codex-config-heal.ts +80 -29
- package/mcp-server/src/services/memory-judge-backfill.ts +7 -1
- package/mcp-server/src/services/neural-interface.ts +79 -20
- package/mcp-server/src/services/server-instructions.ts +27 -63
- package/mcp-server/src/services/tool-catalog.ts +403 -0
- package/mcp-server/src/services/tool-list-refresh-barrier.ts +33 -0
- package/mcp-server/src/services/tool-list.ts +410 -0
- package/mcp-server/src/services/tool-runtime.ts +457 -0
- package/mcp-server/src/services/whiteboard-geometry.ts +94 -9
- package/mcp-server/src/tools/agents.ts +22 -14
- package/mcp-server/src/tools/image-tools.ts +1 -1
- package/mcp-server/src/tools/skill-tools.ts +589 -0
- package/mcp-server/src/tools/skill.ts +13 -0
- package/mcp-server/src/tools/tool-groups.ts +164 -0
- package/mcp-server/src/tools/whiteboard-format.ts +9 -3
- package/mcp-server/src/tools/whiteboard-tools.ts +39 -5
- package/neural-interface/i18n/en.json +3680 -206
- package/neural-interface/i18n/pt-BR.json +3628 -157
- package/neural-interface/lib/account-usage.js +5 -3
- package/neural-interface/lib/app-controls-api.js +161 -0
- package/neural-interface/lib/assistant-api.js +148 -35
- package/neural-interface/lib/assistant-brains/claude.js +4 -3
- package/neural-interface/lib/assistant-brains/codex-browser-policy-hook.mjs +12 -2
- package/neural-interface/lib/assistant-brains/codex-route-gate-hook.mjs +32 -9
- package/neural-interface/lib/assistant-brains/codex.js +9 -5
- package/neural-interface/lib/assistant-brains/opencode.js +122 -44
- package/neural-interface/lib/assistant-brains/opencode2-browser-policy/index.js +59 -0
- package/neural-interface/lib/assistant-brains/opencode2-route-gate/index.js +97 -0
- package/neural-interface/lib/assistant-catalog.js +23 -9
- package/neural-interface/lib/assistant-dispatch.js +874 -156
- package/neural-interface/lib/assistant-envelope.js +22 -2
- package/neural-interface/lib/assistant-persona.js +80 -11
- package/neural-interface/lib/assistant-plan-permissions.js +10 -9
- package/neural-interface/lib/assistant-route-gate-codex.js +3 -0
- package/neural-interface/lib/assistant-route-gate.js +6 -4
- package/neural-interface/lib/assistant-router.js +13 -8
- package/neural-interface/lib/assistant-runtime.js +183 -26
- package/neural-interface/lib/assistant-task-prompt.js +78 -14
- package/neural-interface/lib/assistant-tools.js +51 -0
- package/neural-interface/lib/backup-service.js +620 -3
- package/neural-interface/lib/backup-zip-reader.js +10 -5
- package/neural-interface/lib/backup-zip-writer.js +257 -0
- package/neural-interface/lib/browser-execution.js +10 -2
- package/neural-interface/lib/browser-guard-cdp.js +83 -0
- package/neural-interface/lib/browser-network-guard.js +284 -0
- package/neural-interface/lib/browser-policy-roots.js +64 -0
- package/neural-interface/lib/browser-tool-policy.js +186 -31
- package/neural-interface/lib/claude-agent-bridge.js +4 -2
- package/neural-interface/lib/claude-hooks-status.js +103 -0
- package/neural-interface/lib/claude-model-catalog.js +64 -14
- package/neural-interface/lib/claude-temporary.js +5 -11
- package/neural-interface/lib/cli-install.js +18 -138
- package/neural-interface/lib/cli-resolver.js +4 -1
- package/neural-interface/lib/cli-update-planner.js +32 -31
- package/neural-interface/lib/cloudflared/tunnel.js +42 -2
- package/neural-interface/lib/codex-mcp-approvals.js +11 -0
- package/neural-interface/lib/codex-settings-schema.js +109 -47
- package/neural-interface/lib/codex-worker-app-server.js +172 -0
- package/neural-interface/lib/confined-fs.js +30 -3
- package/neural-interface/lib/crash-notice-api.js +98 -0
- package/neural-interface/lib/editor-completion-opencode.js +164 -67
- package/neural-interface/lib/exec-loop-command.js +4 -1
- package/neural-interface/lib/http-guards.js +8 -2
- package/neural-interface/lib/install-details.js +4 -1
- package/neural-interface/lib/launch-cache.js +293 -0
- package/neural-interface/lib/login-start.js +524 -0
- package/neural-interface/lib/mcp-agent-servers.js +67 -0
- package/neural-interface/lib/mcp-client-config.js +0 -29
- package/neural-interface/lib/mcp-external-servers.js +323 -0
- package/neural-interface/lib/{mcp-profile-refresh-coordinator.js → mcp-tools-refresh-coordinator.js} +4 -4
- package/neural-interface/lib/morelogin.js +30 -0
- package/neural-interface/lib/native-loop-providers.js +565 -50
- package/neural-interface/lib/native-loop-runtime.js +287 -41
- package/neural-interface/lib/opencode-config.js +557 -0
- package/neural-interface/lib/opencode-db-schema.js +58 -0
- package/neural-interface/lib/opencode-history.js +49 -204
- package/neural-interface/lib/opencode-mcp-ready.js +108 -0
- package/neural-interface/lib/opencode-native-boundary.js +44 -0
- package/neural-interface/lib/opencode-protocol.js +310 -0
- package/neural-interface/lib/opencode-provider-view.js +81 -0
- package/neural-interface/lib/opencode-runtime-config.js +32 -15
- package/neural-interface/lib/opencode-serve-records.js +624 -0
- package/neural-interface/lib/opencode-v2-client.js +53 -131
- package/neural-interface/lib/opencode-v2-ws-requests.js +35 -195
- package/neural-interface/lib/opencode-worker-activity.js +229 -0
- package/neural-interface/lib/opencode-worker-data.js +27 -0
- package/neural-interface/lib/opencode2-client.js +796 -0
- package/neural-interface/lib/opencode2-proxy.js +76 -0
- package/neural-interface/lib/opencode2-translate.js +1057 -0
- package/neural-interface/lib/owner-authority.js +249 -0
- package/neural-interface/lib/page-session.js +275 -0
- package/neural-interface/lib/peer-identity.js +763 -0
- package/neural-interface/lib/process-identity.js +361 -0
- package/neural-interface/lib/request-gate.js +17 -2
- package/neural-interface/lib/rulesets/api.js +1 -1
- package/neural-interface/lib/rulesets/fs-safe.js +1 -1
- package/neural-interface/lib/rulesets/installer.js +92 -27
- package/neural-interface/lib/rulesets/json-edit.js +1 -1
- package/neural-interface/lib/session-cache-builder.js +18 -10
- package/neural-interface/lib/session-title-generator.js +58 -18
- package/neural-interface/lib/skills/api-v2.js +495 -0
- package/neural-interface/lib/skills/bundle.js +418 -0
- package/neural-interface/lib/skills/catalog.js +294 -0
- package/neural-interface/lib/skills/creation-api.js +191 -0
- package/neural-interface/lib/skills/creation-brief.js +247 -0
- package/neural-interface/lib/skills/creation-sources.js +267 -0
- package/neural-interface/lib/skills/creation.js +843 -0
- package/neural-interface/lib/skills/deploy.js +564 -0
- package/neural-interface/lib/skills/digest.js +119 -0
- package/neural-interface/lib/skills/discover.js +111 -0
- package/neural-interface/lib/skills/draft-confinement.js +214 -0
- package/neural-interface/lib/skills/eval-confinement.js +397 -0
- package/neural-interface/lib/skills/eval-sandbox.js +280 -0
- package/neural-interface/lib/skills/eval-trace.js +119 -0
- package/neural-interface/lib/skills/evals-api.js +212 -0
- package/neural-interface/lib/skills/evals.js +1573 -0
- package/neural-interface/lib/skills/export.js +200 -0
- package/neural-interface/lib/skills/frontmatter.js +64 -0
- package/neural-interface/lib/skills/health.js +75 -0
- package/neural-interface/lib/skills/json-edit.js +165 -0
- package/neural-interface/lib/skills/known-bridge-digests.json +387 -0
- package/neural-interface/lib/skills/known-bridges.js +96 -0
- package/neural-interface/lib/skills/library.js +823 -0
- package/neural-interface/lib/skills/local-store.js +21 -0
- package/neural-interface/lib/skills/migration.js +433 -0
- package/neural-interface/lib/skills/operations.js +45 -0
- package/neural-interface/lib/skills/ownership.js +427 -0
- package/neural-interface/lib/skills/packages.js +88 -0
- package/neural-interface/lib/skills/reviews.js +212 -0
- package/neural-interface/lib/skills/revision.js +80 -0
- package/neural-interface/lib/skills/roots.js +262 -0
- package/neural-interface/lib/skills/runtime-checks.js +355 -0
- package/neural-interface/lib/skills/scan-assets.js +252 -0
- package/neural-interface/lib/skills/scan-context.js +26 -0
- package/neural-interface/lib/skills/scan-shell.js +324 -0
- package/neural-interface/lib/skills/scan.js +364 -0
- package/neural-interface/lib/skills/scanners.js +54 -0
- package/neural-interface/lib/skills/service.js +522 -0
- package/neural-interface/lib/skills/telemetry.js +113 -0
- package/neural-interface/lib/sqlite-integrity-worker.js +22 -0
- package/neural-interface/lib/style-guide/api.js +4 -3
- package/neural-interface/lib/tool-lists.js +124 -0
- package/neural-interface/lib/untrusted-file-headers.js +27 -0
- package/neural-interface/lib/whatsapp/bridge.js +6 -3
- package/neural-interface/lib/worker-confinement.js +1192 -0
- package/neural-interface/lib/worker-guard-setting.js +56 -0
- package/neural-interface/lib/worker-mcp-channel.js +175 -0
- package/neural-interface/lib/worker-relay-ports.js +227 -0
- package/neural-interface/lib/worker-resume.js +229 -0
- package/neural-interface/lib/worker-sandbox.js +299 -0
- package/neural-interface/package-lock.json +1354 -50
- package/neural-interface/package.json +6 -2
- package/neural-interface/public/index.html +5 -3
- package/neural-interface/public/index2d.html +19 -11
- package/neural-interface/public/onboarding.html +2 -2
- package/neural-interface/public/shared/account-menu.js +8 -5
- package/neural-interface/public/shared/agent-runtime-options.js +76 -16
- package/neural-interface/public/shared/api.js +1527 -1336
- package/neural-interface/public/shared/app-frame.js +192 -0
- package/neural-interface/public/shared/assistant/asst-agents-dock.js +205 -19
- package/neural-interface/public/shared/assistant/asst-api.js +11 -3
- package/neural-interface/public/shared/assistant/asst-ask-styles.js +270 -0
- package/neural-interface/public/shared/assistant/asst-ask-tail.js +118 -0
- package/neural-interface/public/shared/assistant/asst-ask.js +397 -0
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +241 -112
- package/neural-interface/public/shared/assistant/asst-composer.js +1 -1
- package/neural-interface/public/shared/assistant/asst-control.js +157 -26
- package/neural-interface/public/shared/assistant/asst-followups-card.js +383 -0
- package/neural-interface/public/shared/assistant/asst-followups.js +417 -0
- package/neural-interface/public/shared/assistant/asst-hosts.js +49 -2
- package/neural-interface/public/shared/assistant/asst-limit-dock.js +40 -0
- package/neural-interface/public/shared/assistant/asst-limit-wait.js +294 -0
- package/neural-interface/public/shared/assistant/asst-limit.js +168 -0
- package/neural-interface/public/shared/assistant/asst-mascot.js +49 -12
- package/neural-interface/public/shared/assistant/asst-menu.js +84 -12
- package/neural-interface/public/shared/assistant/asst-panel.js +303 -44
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +93 -58
- package/neural-interface/public/shared/assistant/asst-redact.js +186 -0
- package/neural-interface/public/shared/assistant/asst-render.js +770 -100
- package/neural-interface/public/shared/assistant/asst-route.js +83 -12
- package/neural-interface/public/shared/assistant/asst-run-stage.js +231 -0
- package/neural-interface/public/shared/assistant/asst-sanitize.js +193 -3
- package/neural-interface/public/shared/assistant/asst-scene-styles.js +273 -0
- package/neural-interface/public/shared/assistant/asst-scenes.js +530 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel-styles.js +3 -15
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +67 -4
- package/neural-interface/public/shared/assistant/asst-slash.js +9 -7
- package/neural-interface/public/shared/assistant/asst-state.js +25 -15
- package/neural-interface/public/shared/assistant/asst-stop.js +127 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +102 -21
- package/neural-interface/public/shared/assistant/asst-tool-kinds.js +165 -13
- package/neural-interface/public/shared/automation-context.js +5 -2
- package/neural-interface/public/shared/cc-dropdown.js +550 -0
- package/neural-interface/public/shared/cdx/cdx-context-menu.js +10 -9
- package/neural-interface/public/shared/cdx/cdx-copy.js +16 -0
- package/neural-interface/public/shared/cdx/cdx-output-model.js +22 -1
- package/neural-interface/public/shared/cdx/cdx-output.js +8 -7
- package/neural-interface/public/shared/cdx/cdx-panel.js +58 -150
- package/neural-interface/public/shared/cdx/cdx-protocol.js +28 -1
- package/neural-interface/public/shared/cdx/cdx-render.js +62 -32
- package/neural-interface/public/shared/cdx/cdx-requests.js +3 -3
- package/neural-interface/public/shared/cdx/cdx-skill-hints.js +54 -0
- package/neural-interface/public/shared/cdx/cdx-styles.js +15 -3
- package/neural-interface/public/shared/cdx/cdx-tabs.js +201 -74
- package/neural-interface/public/shared/cdx/cdx-ws.js +0 -1
- package/neural-interface/public/shared/cli-install-view.js +4 -8
- package/neural-interface/public/shared/cli-status.js +2 -2
- package/neural-interface/public/shared/constants.js +2 -2
- package/neural-interface/public/shared/context-menu-areas.js +34 -0
- package/neural-interface/public/shared/context-menu-logic.js +243 -0
- package/neural-interface/public/shared/context-menu-model.js +366 -0
- package/neural-interface/public/shared/context-menu.js +372 -0
- package/neural-interface/public/shared/cp/cp-context-menu.js +10 -9
- package/neural-interface/public/shared/cp/cp-markdown.js +4 -57
- package/neural-interface/public/shared/crash-notice-view.js +168 -0
- package/neural-interface/public/shared/data-cache.js +223 -0
- package/neural-interface/public/shared/desktop-bridge.js +11 -0
- package/neural-interface/public/shared/desktop-titlebar-view.js +78 -1
- package/neural-interface/public/shared/desktop-titlebar.js +214 -28
- package/neural-interface/public/shared/desktop-update-view.js +35 -5
- package/neural-interface/public/shared/editor/editor-panel-logic.js +2 -2
- package/neural-interface/public/shared/file-links.js +73 -8
- package/neural-interface/public/shared/html-shell.js +78 -86
- package/neural-interface/public/shared/i18n.js +2 -0
- package/neural-interface/public/shared/launch-prefetch.js +59 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-approvals.js +7 -7
- package/neural-interface/public/shared/ocp-v2/ocp-v2-binding.js +4 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-caps.js +3 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-changes-logic.js +3 -101
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +9 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-compact-button.js +1 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-composer-logic.js +2 -6
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-menu.js +11 -11
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-model.js +0 -3
- package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +8 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +7 -7
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +54 -17
- package/neural-interface/public/shared/ocp-v2/ocp-v2-outcome-notifications.js +16 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +140 -254
- package/neural-interface/public/shared/ocp-v2/ocp-v2-plan.js +1 -2
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +97 -203
- package/neural-interface/public/shared/ocp-v2/ocp-v2-providers.js +11 -9
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +15 -4
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +7 -22
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +401 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +20 -13
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +8 -61
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +53 -82
- package/neural-interface/public/shared/ocp-v2/ocp-v2-slash-hints.js +16 -15
- package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +8 -21
- package/neural-interface/public/shared/ocp-v2/ocp-v2-status-logic.js +1 -99
- package/neural-interface/public/shared/ocp-v2/ocp-v2-status.js +5 -35
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +48 -40
- package/neural-interface/public/shared/ocp-v2/{ocp-v2-profile-inheritance.js → ocp-v2-tools-inheritance.js} +16 -16
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +205 -62
- package/neural-interface/public/shared/opencode-providers.js +39 -0
- package/neural-interface/public/shared/page-session.js +96 -0
- package/neural-interface/public/shared/registry.js +5 -3
- package/neural-interface/public/shared/retired-2d.js +3 -0
- package/neural-interface/public/shared/schedules-view.js +452 -0
- package/neural-interface/public/shared/settings/settings-app-pane.js +335 -0
- package/neural-interface/public/shared/settings/settings-app.js +243 -0
- package/neural-interface/public/shared/settings/settings-claude-hooks.js +135 -0
- package/neural-interface/public/shared/settings/settings-data.js +90 -0
- package/neural-interface/public/shared/settings/settings-ia.js +23 -6
- package/neural-interface/public/shared/settings/settings-opencode.js +89 -0
- package/neural-interface/public/shared/settings/settings-skill-folders-pane.js +265 -0
- package/neural-interface/public/shared/settings/settings-skill-folders.js +130 -0
- package/neural-interface/public/shared/settings/settings-worker-guard.js +72 -0
- package/neural-interface/public/shared/sidepanel-session-status.js +49 -0
- package/neural-interface/public/shared/skills/ss-args.js +96 -0
- package/neural-interface/public/shared/skills/ss-creation.js +219 -0
- package/neural-interface/public/shared/skills/ss-dialog.js +130 -0
- package/neural-interface/public/shared/skills/ss-doc.js +173 -0
- package/neural-interface/public/shared/skills/ss-eval-adapters.js +269 -0
- package/neural-interface/public/shared/skills/ss-eval-grade.js +359 -0
- package/neural-interface/public/shared/skills/ss-eval-optimise.js +153 -0
- package/neural-interface/public/shared/skills/ss-eval-plan.js +315 -0
- package/neural-interface/public/shared/skills/ss-evals.js +417 -0
- package/neural-interface/public/shared/skills/ss-form.js +159 -0
- package/neural-interface/public/shared/skills/ss-frontmatter.js +376 -0
- package/neural-interface/public/shared/skills/ss-ids.js +32 -0
- package/neural-interface/public/shared/skills/ss-lint.js +141 -0
- package/neural-interface/public/shared/skills/ss-presets.js +117 -0
- package/neural-interface/public/shared/skills/ss-profiles.js +475 -0
- package/neural-interface/public/shared/skills/ss-resources.js +165 -0
- package/neural-interface/public/shared/skills/ss-review-view.js +190 -0
- package/neural-interface/public/shared/skills/ss-tabs.js +79 -0
- package/neural-interface/public/shared/skills/ss-unicode.js +135 -0
- package/neural-interface/public/shared/skills/studio/sx-actions.js +222 -0
- package/neural-interface/public/shared/skills/studio/sx-cm.js +101 -0
- package/neural-interface/public/shared/skills/studio/sx-create-ai-view.js +749 -0
- package/neural-interface/public/shared/skills/studio/sx-create-ai.js +236 -0
- package/neural-interface/public/shared/skills/studio/sx-create-view.js +254 -0
- package/neural-interface/public/shared/skills/studio/sx-create.js +126 -0
- package/neural-interface/public/shared/skills/studio/sx-diff-view.js +43 -0
- package/neural-interface/public/shared/skills/studio/sx-diff.js +133 -0
- package/neural-interface/public/shared/skills/studio/sx-docs.js +480 -0
- package/neural-interface/public/shared/skills/studio/sx-dom.js +229 -0
- package/neural-interface/public/shared/skills/studio/sx-edit-view.js +848 -0
- package/neural-interface/public/shared/skills/studio/sx-editor-model.js +193 -0
- package/neural-interface/public/shared/skills/studio/sx-errors.js +22 -0
- package/neural-interface/public/shared/skills/studio/sx-geometry.js +82 -0
- package/neural-interface/public/shared/skills/studio/sx-import.js +262 -0
- package/neural-interface/public/shared/skills/studio/sx-inspector.js +308 -0
- package/neural-interface/public/shared/skills/studio/sx-install-flow.js +279 -0
- package/neural-interface/public/shared/skills/studio/sx-install.js +296 -0
- package/neural-interface/public/shared/skills/studio/sx-library-view.js +639 -0
- package/neural-interface/public/shared/skills/studio/sx-library.js +475 -0
- package/neural-interface/public/shared/skills/studio/sx-main.js +681 -0
- package/neural-interface/public/shared/skills/studio/sx-operations-view.js +98 -0
- package/neural-interface/public/shared/skills/studio/sx-operations.js +11 -0
- package/neural-interface/public/shared/skills/studio/sx-plan.js +158 -0
- package/neural-interface/public/shared/skills/studio/sx-publish-view.js +621 -0
- package/neural-interface/public/shared/skills/studio/sx-review-view.js +369 -0
- package/neural-interface/public/shared/skills/studio/sx-review.js +148 -0
- package/neural-interface/public/shared/skills/studio/sx-scan.js +35 -0
- package/neural-interface/public/shared/skills/studio/sx-snippets.js +96 -0
- package/neural-interface/public/shared/skills/studio/sx-subject.js +248 -0
- package/neural-interface/public/shared/skills/studio/sx-test-view.js +994 -0
- package/neural-interface/public/shared/skills/studio/sx-test.js +328 -0
- package/neural-interface/public/shared/skills/studio/sx-versions-view.js +241 -0
- package/neural-interface/public/shared/skills/studio/sx-workspace-view.js +425 -0
- package/neural-interface/public/shared/styleguide/sg-panel.js +4 -2
- package/neural-interface/public/shared/styles.css +2065 -2150
- package/neural-interface/public/shared/synabun-mascot.js +1115 -9
- package/neural-interface/public/shared/tool-list-picker.js +55 -0
- package/neural-interface/public/shared/tool-list-storage.js +24 -0
- package/neural-interface/public/shared/tool-list-view.js +112 -0
- package/neural-interface/public/shared/tour/tour-actor.js +268 -0
- package/neural-interface/public/shared/tour/tour-beats.js +336 -0
- package/neural-interface/public/shared/tour/tour-engine.js +884 -0
- package/neural-interface/public/shared/tour/tour-ink.js +390 -0
- package/neural-interface/public/shared/tour/tour-stage.js +440 -0
- package/neural-interface/public/shared/tour/tour-state.js +40 -0
- package/neural-interface/public/shared/tour/tour-tips.js +99 -0
- package/neural-interface/public/shared/tour/tour.css +144 -0
- package/neural-interface/public/shared/ui-assistant.js +27 -5
- package/neural-interface/public/shared/ui-automation-studio.js +155 -152
- package/neural-interface/public/shared/ui-bookmarks.js +2 -1
- package/neural-interface/public/shared/ui-claude-panel.js +153 -13
- package/neural-interface/public/shared/ui-codex-panel.js +1 -0
- package/neural-interface/public/shared/ui-command-runner.js +6 -3
- package/neural-interface/public/shared/ui-context-menu.js +295 -0
- package/neural-interface/public/shared/ui-cost-widget.js +57 -59
- package/neural-interface/public/shared/ui-crash-notice.js +187 -0
- package/neural-interface/public/shared/ui-detail.js +21 -9
- package/neural-interface/public/shared/ui-file-links.js +1 -0
- package/neural-interface/public/shared/ui-image-gallery.js +56 -52
- package/neural-interface/public/shared/ui-invite.js +18 -2
- package/neural-interface/public/shared/ui-keybinds.js +26 -1
- package/neural-interface/public/shared/ui-link.js +9 -9
- package/neural-interface/public/shared/ui-menubar.js +229 -40
- package/neural-interface/public/shared/ui-native-loop-router-state.js +5 -0
- package/neural-interface/public/shared/ui-native-loop-router.js +9 -1
- package/neural-interface/public/shared/ui-navbar.js +4 -24
- package/neural-interface/public/shared/ui-opencode-panel-v2.js +1 -0
- package/neural-interface/public/shared/ui-panels.js +96 -65
- package/neural-interface/public/shared/ui-schedules-studio.js +2267 -953
- package/neural-interface/public/shared/ui-sessions.js +20 -7
- package/neural-interface/public/shared/ui-settings.js +679 -496
- package/neural-interface/public/shared/ui-sidebar.js +4 -4
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +13 -0
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +56 -5
- package/neural-interface/public/shared/ui-sidepanel-state.js +23 -12
- package/neural-interface/public/shared/ui-sidepanel-tray.js +84 -8
- package/neural-interface/public/shared/ui-sidepanel-windows.js +16 -11
- package/neural-interface/public/shared/ui-skills.js +42 -2781
- package/neural-interface/public/shared/ui-styleguide.js +5 -2
- package/neural-interface/public/shared/ui-sync.js +22 -5
- package/neural-interface/public/shared/ui-terminal.js +159 -199
- package/neural-interface/public/shared/ui-tool-updates.js +3 -1
- package/neural-interface/public/shared/ui-tooltip.js +10 -5
- package/neural-interface/public/shared/ui-trash.js +14 -5
- package/neural-interface/public/shared/ui-tutorial-layout.js +3 -117
- package/neural-interface/public/shared/ui-tutorial-preview.js +103 -0
- package/neural-interface/public/shared/ui-tutorial-steps.js +3 -61
- package/neural-interface/public/shared/ui-tutorial.css +47 -100
- package/neural-interface/public/shared/ui-tutorial.js +285 -499
- package/neural-interface/public/shared/ui-update.js +121 -16
- package/neural-interface/public/shared/ui-whiteboard.js +313 -59
- package/neural-interface/public/shared/ui-worker-end.js +4 -0
- package/neural-interface/public/shared/ui-workspaces.js +3 -2
- package/neural-interface/public/shared/view-variant.js +66 -0
- package/neural-interface/public/shared/whatsapp/wa-view.js +1 -1
- package/neural-interface/public/shared/whiteboard-list.js +172 -0
- package/neural-interface/public/shared/worker-end.js +10 -3
- package/neural-interface/public/shared/worker-restart.js +12 -0
- package/neural-interface/public/sidepanel-session.html +1 -1
- package/neural-interface/public/variant/2d/background.js +2 -1
- package/neural-interface/public/variant/2d/context-menu.js +8 -2
- package/neural-interface/public/variant/2d/graph.js +42 -20
- package/neural-interface/public/variant/2d/hulls.js +14 -9
- package/neural-interface/public/variant/2d/lasso.js +11 -7
- package/neural-interface/public/variant/2d/main.js +36 -2
- package/neural-interface/public/variant/2d/minimap.js +11 -13
- package/neural-interface/public/variant/3d/main.js +72 -6
- package/neural-interface/public/variant/3d/map-controls.js +24 -9
- package/neural-interface/public/vendor/caveat/OFL.txt +93 -0
- package/neural-interface/public/vendor/caveat/caveat-latin-400-normal.woff2 +0 -0
- package/neural-interface/public/vendor/caveat/caveat-latin-700-normal.woff2 +0 -0
- package/neural-interface/public/vendor/caveat/caveat.css +17 -0
- package/neural-interface/public/vendor/caveat/manifest.json +12 -0
- package/neural-interface/public/vendor/highlight/LICENSE +29 -0
- package/neural-interface/public/vendor/highlight/github-dark-dimmed-11.12.0.min.css +9 -0
- package/neural-interface/public/vendor/highlight/highlight-11.12.0.min.js +1262 -0
- package/neural-interface/public/vendor/highlight/manifest.json +5 -0
- package/neural-interface/public/vendor/html2canvas/LICENSE +22 -0
- package/neural-interface/public/vendor/html2canvas/html2canvas-1.4.1.min.js +20 -0
- package/neural-interface/public/vendor/html2canvas/manifest.json +4 -0
- package/neural-interface/public/vendor/marked/LICENSE.md +44 -0
- package/neural-interface/public/vendor/marked/manifest.json +4 -0
- package/neural-interface/public/vendor/marked/marked-14.1.4.esm.js +2502 -0
- package/neural-interface/public/vendor/mermaid/LICENSE +21 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/abnfDiagram-PAR5IXJI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/architecture-7GRP2DOG-M7G3SWCO.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/architectureDiagram-2PNWDENW.mjs +36 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/blockDiagram-PUWGUBOA.mjs +129 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/c4Diagram-3NLNHZP5.mjs +38 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-2NMSUPJH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-32MCUW2P.mjs +206 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-3NPNU5GP.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-3SMGFRGC.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-4CAJECRU.mjs +14 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-4OADUZ5Q.mjs +10 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5IMINLNL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5IQCK5RY.mjs +3 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-5MVFYWFU.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-AQ6EADP3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-AZZRMDJM.mjs +15 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-CLS4B6BI.mjs +168 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-DZP67EKU.mjs +70 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-EICP7K5X.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-GDY2UAB4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-H7VHZCWX.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-IJBDOHL6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JFFVMJIA.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JQRUD6KW.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-JZGDI5JK.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-KD6SPIPN.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-NF366YI6.mjs +231 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-NUDPKBEF.mjs +32 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-OJINMHTS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-Q6NGPIAH.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-QJSWEUOL.mjs +132 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-R7JDMUKV.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-RCXAM2GK.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-RT4MAWR3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-SFMINX4W.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-SLDQ463B.mjs +88 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-STOV2HOB.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-T5OCTHI4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-TCEHX7R3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VQC2EELJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VRZKL3EH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VTHDQ7BV.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-VY2OSTJR.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-WUBWJARI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-YBMQ5JGJ.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-YDMLL4PJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-Z6V44ARX.mjs +62 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZJJ7VQJP.mjs +339 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZNLK7HRR.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZQN7UHIL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZS6VBONO.mjs +174 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZUNWM646.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-FGAMPOII.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-v2-AI5RJEK4.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cose-bilkent-Q72C2OJ3.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefin-OW5HDTMX-6OCTWOGG.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/cynefinDiagram-2OOWUY4M.mjs +62 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/dagre-MPVFI544.mjs +4 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-AE4NWXFW.mjs +24 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-BUJID5UG.mjs +41 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-C44CZ5NI.mjs +24 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-EYOLEXXS.mjs +30 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/diagram-P7B6PWOJ.mjs +3 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ebnfDiagram-FTPZ3PV6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/erDiagram-H3ERR26V.mjs +99 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/eventmodeling-NTZA5JFV-WKSWQHFS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/flowDiagram-YHGXBVSY.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ganttDiagram-RWFTB7ED.mjs +292 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/gitGraph-4MIJSDKK-JH2HKYUO.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/gitGraphDiagram-MAR6GKOP.mjs +106 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/info-A6RAGUB7-3TX3OFWW.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/infoDiagram-LV547AFH.mjs +2 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/ishikawaDiagram-PUJQGNDS.mjs +70 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/journeyDiagram-EW5QJT4W.mjs +139 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/kanban-definition-JSQERAZB.mjs +89 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/katex-CZ4GXH2S.mjs +257 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/mindmap-definition-VBJCLQLM.mjs +96 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/packet-AYTQ26CC-MKII6P3Y.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pegDiagram-7WILOQTJ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pie-WAS4IAKB-6B4OPMJ5.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/pieDiagram-EFA7CBSB.mjs +39 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/quadrantDiagram-WARVYA7P.mjs +7 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/radar-RG4KPBEZ-UPTR3XUL.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-74A4TZTK-MEFUPFMS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-abnf-HS5TGJTU-R5YG2S5D.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-ebnf-LZEXJU2U-G5QEX2L6.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroad-peg-WCYAUIDC-H5I2ZRY2.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/railroadDiagram-5NIQVNLQ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/requirementDiagram-SXREGOKZ.mjs +84 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sankeyDiagram-VV74M2VP.mjs +40 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sequenceDiagram-52ZFIFDL.mjs +162 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/sizeCapture-FGA5AGYP.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-3QAKPIVI.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-v2-HN2P4RDZ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/swimlanes-QLVP42QD.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/swimlanesDiagram-JKPDBFCN.mjs +8 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/timeline-definition-GS45XAXW.mjs +120 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/treeView-Q6P3EWNA-ZRJGANNQ.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/treemap-WGGIJYW6-K64VN5AS.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/vennDiagram-QIQU2ZRJ.mjs +34 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/wardley-WFR3VGLG-D67OWCCH.mjs +1 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/wardleyDiagram-U6YNM66N.mjs +78 -0
- package/neural-interface/public/vendor/mermaid/chunks/mermaid.esm.min/xychartDiagram-XJAZEDNM.mjs +7 -0
- package/neural-interface/public/vendor/mermaid/manifest.json +4 -0
- package/neural-interface/public/vendor/mermaid/mermaid-11.17.2.esm.min.mjs +14 -0
- package/neural-interface/public/vendor/yaml/LICENSE +13 -0
- package/neural-interface/public/vendor/yaml/manifest.json +4 -0
- package/neural-interface/public/vendor/yaml/yaml-2.9.1.min.js +137 -0
- package/neural-interface/scripts/build-vendor.mjs +116 -3
- package/neural-interface/server.js +4834 -2541
- package/neural-interface/templates/rulesets/core.md +1 -1
- package/neural-interface/templates/rulesets/legacy-hashes.json +18 -0
- package/neural-interface/templates/rulesets/manifest.json +8 -8
- package/npm-shrinkwrap.json +18 -12
- package/package.json +16 -3
- package/postinstall.js +9 -4
- package/preuninstall.js +1 -1
- package/setup.js +97 -322
- package/skills/skill-forge/SKILL.md +177 -0
- package/skills/skill-forge/evals/evals.json +54 -0
- package/skills/skill-forge/references/package.md +105 -0
- package/skills/skill-forge/references/review-and-recovery.md +63 -0
- package/skills/skill-forge/references/runtime-profiles.md +20 -0
- package/skills/skill-forge/references/sources-and-capabilities.md +51 -0
- package/skills/synabun/SKILL.md +10 -7
- package/skills/synabun/modules/audit.md +1 -5
- package/skills/synabun/modules/changelog.md +1 -5
- package/skills/synabun/modules/idea.md +1 -1
- package/skills/synabun/modules/memorize.md +6 -9
- package/skills/synabun/modules/schedule.md +5 -5
- package/mcp-server/dist/services/profiles.d.ts +0 -120
- package/mcp-server/dist/services/profiles.d.ts.map +0 -1
- package/mcp-server/dist/services/profiles.js +0 -387
- package/mcp-server/dist/services/profiles.js.map +0 -1
- package/mcp-server/dist/tools/leonardo-browser-tools.d.ts +0 -97
- package/mcp-server/dist/tools/leonardo-browser-tools.d.ts.map +0 -1
- package/mcp-server/dist/tools/leonardo-browser-tools.js +0 -228
- package/mcp-server/dist/tools/leonardo-browser-tools.js.map +0 -1
- package/mcp-server/dist/tools/leonardo.d.ts +0 -13
- package/mcp-server/dist/tools/leonardo.d.ts.map +0 -1
- package/mcp-server/dist/tools/leonardo.js +0 -21
- package/mcp-server/dist/tools/leonardo.js.map +0 -1
- package/mcp-server/dist/tools/profile.d.ts +0 -17
- package/mcp-server/dist/tools/profile.d.ts.map +0 -1
- package/mcp-server/dist/tools/profile.js +0 -114
- package/mcp-server/dist/tools/profile.js.map +0 -1
- package/mcp-server/src/services/profiles.ts +0 -428
- package/mcp-server/src/tools/leonardo-browser-tools.ts +0 -291
- package/mcp-server/src/tools/leonardo.ts +0 -30
- package/mcp-server/src/tools/profile.ts +0 -122
- package/neural-interface/lib/assistant-brains/opencode-browser-policy.js +0 -47
- package/neural-interface/lib/assistant-brains/opencode-route-gate.js +0 -62
- package/neural-interface/lib/mcp-profile-servers.js +0 -120
- package/neural-interface/public/shared/ui-tutorial-draw.js +0 -311
- package/skills/leonardo/SKILL.md +0 -168
- package/skills/leonardo/icon.svg +0 -1
- package/skills/leonardo/modules/browser-guide.md +0 -378
- package/skills/leonardo/modules/image-prompter.md +0 -283
- package/skills/leonardo/modules/model-advisor.md +0 -100
- package/skills/leonardo/modules/prompt-library.md +0 -110
- package/skills/leonardo/modules/style-guide.md +0 -186
- package/skills/leonardo/modules/video-prompter.md +0 -317
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun — AI skill creation: what a request is (P3)
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// The request the Studio's Create place (and the Assistant's `skill` tool) sends to start drafting a skill with AI:
|
|
6
|
+
// the owner's words, an optional example of a good result, the sources the draft is made from, the options, and the
|
|
7
|
+
// worker that drafts it. The server checks it with the same function (lib/skills/creation.js) before anything runs:
|
|
8
|
+
// one reading of a request for the page and the server. No DOM and no imports.
|
|
9
|
+
//
|
|
10
|
+
// describe the owner's words only
|
|
11
|
+
// conversation one session transcript of Claude Code, Codex or OpenCode (read by the server, as data)
|
|
12
|
+
// url a web page, read by the server with the SynaBun browser before the worker starts (as data)
|
|
13
|
+
// repo a registered project, read by the server: its file tree, docs, manifests and the files named
|
|
14
|
+
// memory a recall over SynaBun's memory
|
|
15
|
+
// import an imported skill (a staged import), or a skill of the catalog or the library, as the starting point
|
|
16
|
+
|
|
17
|
+
export const SOURCE_KINDS = Object.freeze(['describe', 'conversation', 'url', 'repo', 'memory', 'import']);
|
|
18
|
+
export const CONVERSATION_PROVIDERS = Object.freeze(['claude-code', 'codex', 'opencode']);
|
|
19
|
+
/**
|
|
20
|
+
* Who drafts: Claude Code only. A drafting worker reads hostile sources, so it is held to its folder with file tools
|
|
21
|
+
* only (lib/skills/draft-confinement.js), which Claude Code enforces before any permission mode; Codex starts MCP
|
|
22
|
+
* servers outside its sandbox and OpenCode answers its own permission prompts, so neither can be held there yet.
|
|
23
|
+
*/
|
|
24
|
+
/** The providers a drafting run can be held to its folder on (lib/skills/draft-confinement.js draftConfinementSupport). */
|
|
25
|
+
export const DRAFT_PROVIDERS = Object.freeze(['claude-code', 'codex', 'opencode']);
|
|
26
|
+
export const CREATION_TARGET_RUNTIMES = Object.freeze(['claude', 'codex', 'opencode', 'agents']);
|
|
27
|
+
|
|
28
|
+
/** The stages of a creation, in order; the last four end it. */
|
|
29
|
+
export const CREATION_STAGES = Object.freeze(['queued', 'gathering', 'drafting', 'checking', 'submitting', 'done', 'failed', 'cancelled', 'interrupted']);
|
|
30
|
+
export const ACTIVE_CREATION_STAGES = Object.freeze(['queued', 'gathering', 'drafting', 'checking', 'submitting']);
|
|
31
|
+
export const isActiveCreation = (state) => ACTIVE_CREATION_STAGES.includes(String(state || ''));
|
|
32
|
+
|
|
33
|
+
export const CREATION_LIMITS = Object.freeze({
|
|
34
|
+
promptChars: 8000, exampleChars: 8000, nameChars: 64, sources: 5,
|
|
35
|
+
urlChars: 2000, queryChars: 500, memoryLimit: { min: 1, max: 20, default: 10 },
|
|
36
|
+
paths: 20, pathChars: 512, sessionIdChars: 128, labelChars: 200, targets: 8, projectPathChars: 2000,
|
|
37
|
+
// The drafting worker's work time (minutes of work, not of waiting) and its spend ceiling when a budget is set.
|
|
38
|
+
maxMinutes: { min: 20, max: 90, default: 30 },
|
|
39
|
+
budgetUsd: { min: 0.5, max: 20, default: 3 },
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
43
|
+
const SESSION_RE = /^[A-Za-z0-9_.:-]{6,128}$/;
|
|
44
|
+
const STAGING_RE = /^[0-9a-f]{24}$/;
|
|
45
|
+
const SKILL_RE = /^skl_[0-9a-f]{20}$/;
|
|
46
|
+
const ARTIFACT_RE = /^art_[0-9a-f]{20}$/;
|
|
47
|
+
const MODEL_RE = /^[A-Za-z0-9._:/@[\]-]{1,200}$/;
|
|
48
|
+
const EFFORT_RE = /^[a-z]{2,20}$/;
|
|
49
|
+
const ACCOUNT_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
50
|
+
|
|
51
|
+
const str = (v) => (typeof v === 'string' ? v : '');
|
|
52
|
+
const isObject = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
53
|
+
|
|
54
|
+
/** A relative path inside a project: no absolute path, no "..", forward slashes. */
|
|
55
|
+
export function relativePathProblem(p) {
|
|
56
|
+
const s = str(p);
|
|
57
|
+
if (!s.trim()) return 'empty';
|
|
58
|
+
if (s.length > CREATION_LIMITS.pathChars) return 'too-long';
|
|
59
|
+
if (s.startsWith('/') || s.startsWith('~') || /^[A-Za-z]:/.test(s) || s.includes('\\') || s.includes('\0')) return 'absolute';
|
|
60
|
+
if (s.split('/').some((part) => part === '..')) return 'parent';
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* A web address the server may open for a draft: http or https, no user name or password in it, and nothing a URL
|
|
66
|
+
* parser would quietly drop (a line break, a tab, a control character or a space): what is checked is what is opened.
|
|
67
|
+
*/
|
|
68
|
+
export function urlProblem(u) {
|
|
69
|
+
const s = str(u).trim();
|
|
70
|
+
if (!s) return 'empty';
|
|
71
|
+
if (s.length > CREATION_LIMITS.urlChars) return 'too-long';
|
|
72
|
+
if (/[\s\u0000-\u001f\u007f-\u009f\u2028\u2029]/.test(s)) return 'invalid';
|
|
73
|
+
let parsed;
|
|
74
|
+
try { parsed = new URL(s); } catch { return 'invalid'; }
|
|
75
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') return 'scheme';
|
|
76
|
+
if (parsed.username || parsed.password) return 'credentials';
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The address as the browser will open it (the parser's own spelling), or '' when urlProblem() refuses it. */
|
|
81
|
+
export function normalizedUrl(u) {
|
|
82
|
+
if (urlProblem(u)) return '';
|
|
83
|
+
try { return new URL(str(u).trim()).href; } catch { return ''; }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function normalizeSource(raw, i, problems) {
|
|
87
|
+
const at = `sources[${i}]`;
|
|
88
|
+
if (!isObject(raw)) { problems.push({ field: at, code: 'source-shape' }); return null; }
|
|
89
|
+
const kind = raw.kind;
|
|
90
|
+
if (!SOURCE_KINDS.includes(kind)) { problems.push({ field: `${at}.kind`, code: 'source-kind' }); return null; }
|
|
91
|
+
const label = str(raw.label).slice(0, CREATION_LIMITS.labelChars);
|
|
92
|
+
if (kind === 'describe') return { kind };
|
|
93
|
+
if (kind === 'conversation') {
|
|
94
|
+
const provider = raw.provider;
|
|
95
|
+
if (!CONVERSATION_PROVIDERS.includes(provider)) problems.push({ field: `${at}.provider`, code: 'conversation-provider' });
|
|
96
|
+
const sessionId = str(raw.sessionId).trim();
|
|
97
|
+
if (!SESSION_RE.test(sessionId)) problems.push({ field: `${at}.sessionId`, code: 'conversation-session' });
|
|
98
|
+
const project = str(raw.project).trim() || null;
|
|
99
|
+
return { kind, provider, sessionId, project, label };
|
|
100
|
+
}
|
|
101
|
+
if (kind === 'url') {
|
|
102
|
+
const url = str(raw.url).trim();
|
|
103
|
+
const why = urlProblem(url);
|
|
104
|
+
if (why) problems.push({ field: `${at}.url`, code: `url-${why}` });
|
|
105
|
+
return { kind, url: why ? url : normalizedUrl(url), label };
|
|
106
|
+
}
|
|
107
|
+
if (kind === 'repo') {
|
|
108
|
+
const project = str(raw.project).trim();
|
|
109
|
+
if (!project) problems.push({ field: `${at}.project`, code: 'repo-project' });
|
|
110
|
+
const paths = Array.isArray(raw.paths) ? raw.paths : [];
|
|
111
|
+
if (paths.length > CREATION_LIMITS.paths) problems.push({ field: `${at}.paths`, code: 'repo-paths-many' });
|
|
112
|
+
const clean = [];
|
|
113
|
+
paths.slice(0, CREATION_LIMITS.paths).forEach((p, j) => {
|
|
114
|
+
const why = relativePathProblem(p);
|
|
115
|
+
if (why) problems.push({ field: `${at}.paths[${j}]`, code: `repo-path-${why}` });
|
|
116
|
+
else if (!clean.includes(p)) clean.push(p);
|
|
117
|
+
});
|
|
118
|
+
return { kind, project, paths: clean, label };
|
|
119
|
+
}
|
|
120
|
+
if (kind === 'memory') {
|
|
121
|
+
const query = str(raw.query).trim();
|
|
122
|
+
if (!query) problems.push({ field: `${at}.query`, code: 'memory-query' });
|
|
123
|
+
else if (query.length > CREATION_LIMITS.queryChars) problems.push({ field: `${at}.query`, code: 'memory-query-long' });
|
|
124
|
+
const { min, max, default: dflt } = CREATION_LIMITS.memoryLimit;
|
|
125
|
+
const limit = Number.isInteger(raw.limit) ? Math.min(max, Math.max(min, raw.limit)) : dflt;
|
|
126
|
+
const project = str(raw.project).trim() || null;
|
|
127
|
+
return { kind, query, limit, project, label };
|
|
128
|
+
}
|
|
129
|
+
// import: exactly one of a staged import, a library skill, a catalog entry.
|
|
130
|
+
const given = ['stagingId', 'skillId', 'artifactId'].filter((k) => raw[k] !== undefined && raw[k] !== null && raw[k] !== '');
|
|
131
|
+
if (given.length !== 1) { problems.push({ field: at, code: 'import-one' }); return { kind, label }; }
|
|
132
|
+
const key = given[0];
|
|
133
|
+
const value = str(raw[key]);
|
|
134
|
+
const ok = key === 'stagingId' ? STAGING_RE.test(value) : key === 'skillId' ? SKILL_RE.test(value) : ARTIFACT_RE.test(value);
|
|
135
|
+
if (!ok) problems.push({ field: `${at}.${key}`, code: 'import-id' });
|
|
136
|
+
return { kind, [key]: value, label };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Check and normalize a creation request.
|
|
141
|
+
* @param {object} body
|
|
142
|
+
* @param {{ submitDefault?: boolean }} [o] whether the draft goes to Review by itself when the request does not say
|
|
143
|
+
* (the Studio: yes; the Assistant: no, it looks first)
|
|
144
|
+
* @returns {{ ok: boolean, request: object, problems: { field: string, code: string }[] }}
|
|
145
|
+
*/
|
|
146
|
+
export function normalizeCreationRequest(body, { submitDefault = true } = {}) {
|
|
147
|
+
const problems = [];
|
|
148
|
+
const b = isObject(body) ? body : {};
|
|
149
|
+
const prompt = str(b.prompt).trim();
|
|
150
|
+
if (prompt.length > CREATION_LIMITS.promptChars) problems.push({ field: 'prompt', code: 'prompt-long' });
|
|
151
|
+
const example = str(b.example).trim();
|
|
152
|
+
if (example.length > CREATION_LIMITS.exampleChars) problems.push({ field: 'example', code: 'example-long' });
|
|
153
|
+
const name = str(b.name).trim();
|
|
154
|
+
if (name && (name.length > CREATION_LIMITS.nameChars || !NAME_RE.test(name))) problems.push({ field: 'name', code: 'name-format' });
|
|
155
|
+
const invocation = b.invocation === 'manual' ? 'manual' : 'auto';
|
|
156
|
+
const rawSources = Array.isArray(b.sources) ? b.sources : [];
|
|
157
|
+
if (rawSources.length > CREATION_LIMITS.sources) problems.push({ field: 'sources', code: 'sources-many' });
|
|
158
|
+
const sources = rawSources.slice(0, CREATION_LIMITS.sources).map((s, i) => normalizeSource(s, i, problems)).filter((s) => s && s.kind !== 'describe');
|
|
159
|
+
if (!prompt && !sources.length) problems.push({ field: 'prompt', code: 'prompt-required' });
|
|
160
|
+
// The worker that drafts: a provider, a model (or its default), an effort; null leaves it to the owner's route.
|
|
161
|
+
let target = null;
|
|
162
|
+
if (b.target !== undefined && b.target !== null) {
|
|
163
|
+
const t = isObject(b.target) ? b.target : {};
|
|
164
|
+
if (!DRAFT_PROVIDERS.includes(t.provider)) problems.push({ field: 'target.provider', code: 'target-provider' });
|
|
165
|
+
const model = str(t.model).trim();
|
|
166
|
+
if (model && !MODEL_RE.test(model)) problems.push({ field: 'target.model', code: 'target-model' });
|
|
167
|
+
const effort = str(t.effort).trim();
|
|
168
|
+
if (effort && !EFFORT_RE.test(effort)) problems.push({ field: 'target.effort', code: 'target-effort' });
|
|
169
|
+
target = { provider: t.provider, model: model || null, effort: effort || null };
|
|
170
|
+
}
|
|
171
|
+
const mm = CREATION_LIMITS.maxMinutes;
|
|
172
|
+
const maxMinutes = Number.isFinite(Number(b.maxMinutes)) && Number(b.maxMinutes) > 0 ? Math.min(mm.max, Math.max(mm.min, Math.round(Number(b.maxMinutes)))) : mm.default;
|
|
173
|
+
const bu = CREATION_LIMITS.budgetUsd;
|
|
174
|
+
const budgetUsd = Number.isFinite(Number(b.budgetUsd)) && Number(b.budgetUsd) > 0 ? Math.min(bu.max, Math.max(bu.min, Number(b.budgetUsd))) : bu.default;
|
|
175
|
+
// Where the owner may install it, as the Review card and the install plan read a target (lib/skills/deploy.js
|
|
176
|
+
// normalizeTarget): a runtime, user or project scope, an account, a project's path. Kept whole; what is not one
|
|
177
|
+
// is refused here (the server also checks that a project is registered).
|
|
178
|
+
const targets = [];
|
|
179
|
+
const rawTargets = Array.isArray(b.targets) ? b.targets : [];
|
|
180
|
+
if (rawTargets.length > CREATION_LIMITS.targets) problems.push({ field: 'targets', code: 'targets-many' });
|
|
181
|
+
rawTargets.slice(0, CREATION_LIMITS.targets).forEach((t, i) => {
|
|
182
|
+
const at = `targets[${i}]`;
|
|
183
|
+
if (!isObject(t) || !CREATION_TARGET_RUNTIMES.includes(t.runtime)) { problems.push({ field: `${at}.runtime`, code: 'targets-runtime' }); return; }
|
|
184
|
+
const scope = t.scope === undefined || t.scope === null || t.scope === '' ? 'user' : t.scope;
|
|
185
|
+
if (scope !== 'user' && scope !== 'project') { problems.push({ field: `${at}.scope`, code: 'targets-scope' }); return; }
|
|
186
|
+
if (t.runtime === 'agents' && scope !== 'user') { problems.push({ field: `${at}.scope`, code: 'targets-agents-scope' }); return; }
|
|
187
|
+
const accountId = t.accountId === undefined || t.accountId === null || t.accountId === '' ? 'default' : t.accountId;
|
|
188
|
+
if (typeof accountId !== 'string' || !ACCOUNT_RE.test(accountId)) { problems.push({ field: `${at}.accountId`, code: 'targets-account' }); return; }
|
|
189
|
+
let projectPath = null;
|
|
190
|
+
if (scope === 'project') {
|
|
191
|
+
projectPath = str(t.projectPath).trim();
|
|
192
|
+
const absolute = projectPath.startsWith('/') || /^[A-Za-z]:[\\/]/.test(projectPath);
|
|
193
|
+
if (!projectPath || !absolute || projectPath.length > CREATION_LIMITS.projectPathChars || /[\u0000-\u001f\u007f]/.test(projectPath)) { problems.push({ field: `${at}.projectPath`, code: 'targets-project' }); return; }
|
|
194
|
+
}
|
|
195
|
+
const key = scope === 'project' ? `${t.runtime}:project:${projectPath}` : `${t.runtime}:user:${accountId}`;
|
|
196
|
+
if (targets.some((x) => x.key === key)) return;
|
|
197
|
+
targets.push({ key, runtime: t.runtime, scope, accountId, ...(projectPath ? { projectPath } : {}) });
|
|
198
|
+
});
|
|
199
|
+
const submit = typeof b.submit === 'boolean' ? b.submit : submitDefault;
|
|
200
|
+
return {
|
|
201
|
+
ok: problems.length === 0,
|
|
202
|
+
request: { prompt, example, name, invocation, sources, target, maxMinutes, budgetUsd: Math.round(budgetUsd * 100) / 100, targets: targets.length ? targets.map(({ key: _k, ...t }) => t) : [{ runtime: 'claude', scope: 'user', accountId: 'default' }], submit },
|
|
203
|
+
problems,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Where a source came from, in a few words (a chip's label when the request carries none). */
|
|
208
|
+
export function sourceSummary(source) {
|
|
209
|
+
if (!isObject(source)) return '';
|
|
210
|
+
if (source.label) return source.label;
|
|
211
|
+
switch (source.kind) {
|
|
212
|
+
case 'conversation': return `${source.provider} ${String(source.sessionId || '').slice(0, 8)}`;
|
|
213
|
+
case 'url': { try { const u = new URL(source.url); return `${u.hostname}${u.pathname === '/' ? '' : u.pathname}`.slice(0, 80); } catch { return String(source.url || '').slice(0, 80); } }
|
|
214
|
+
case 'repo': { const parts = String(source.project || '').split(/[\\/]/).filter(Boolean); return `${parts[parts.length - 1] || source.project}${source.paths?.length ? ` (${source.paths.length})` : ''}`; }
|
|
215
|
+
case 'memory': return `“${String(source.query || '').slice(0, 60)}”`;
|
|
216
|
+
case 'import': return source.stagingId ? 'import' : source.skillId || 'catalog';
|
|
217
|
+
default: return '';
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun Neural Interface — Skills Studio: questions asked inside the panel
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// The Studio panel is above the page's other layers, so its questions are drawn inside it, over its content:
|
|
6
|
+
// a modal dialog (role alertdialog, aria-modal, labelled by its title and described by its text). While one is
|
|
7
|
+
// open, no key reaches the page under it (taken at the window in the capture phase): Escape answers "cancel"
|
|
8
|
+
// and goes no further (the panel's own Escape, which closes things, never sees it). Inside it a key does what
|
|
9
|
+
// it does where it is (a field, a dropdown) and stops there; Tab stays inside, the arrows move between buttons. A click on the dim area outside answers "cancel" too. One question at a
|
|
10
|
+
// time: a second one gives the first up (it answers null). When it is answered the keyboard goes back to where
|
|
11
|
+
// it was.
|
|
12
|
+
|
|
13
|
+
const KEY_EVENTS = ['keydown', 'keyup', 'keypress'];
|
|
14
|
+
let _open = null; // { giveUp }
|
|
15
|
+
|
|
16
|
+
/** Whether a question is open in a Studio panel now. */
|
|
17
|
+
export const dialogOpen = () => !!_open;
|
|
18
|
+
|
|
19
|
+
/** Give up the open question (it answers null), if there is one. */
|
|
20
|
+
export function closeDialog() { _open?.giveUp(); }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Ask a question inside the panel.
|
|
24
|
+
* @param {object} o
|
|
25
|
+
* @param {HTMLElement} o.host the panel it is drawn in
|
|
26
|
+
* @param {string} o.title
|
|
27
|
+
* @param {(string|Node)[]} [o.lines] the text, a paragraph each (a string is text, never markup)
|
|
28
|
+
* @param {{ id: string, label: string, kind?: 'primary'|'danger'|'plain', disabled?: boolean }[]} o.buttons left to right
|
|
29
|
+
* @param {string} [o.focus] the button the keyboard starts on (default: the last one that is not danger)
|
|
30
|
+
* @param {string|null} [o.cancelId] what Escape and a click outside answer; null: they answer null
|
|
31
|
+
* @param {HTMLElement|null} [o.extra] more content after the text (a checkbox, a list)
|
|
32
|
+
* @param {(answer: string, ui: object) => boolean} [o.accept] called before the answer is given: false keeps it open
|
|
33
|
+
* @returns {Promise<string|null>} the id of the button, or `cancelId` / null
|
|
34
|
+
*/
|
|
35
|
+
export function askInPanel({ host, title, lines = [], buttons, focus = null, cancelId = 'cancel', extra = null, accept = null, wide = false }) {
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
_open?.giveUp();
|
|
38
|
+
const before = document.activeElement;
|
|
39
|
+
const overlay = document.createElement('div');
|
|
40
|
+
overlay.className = 'ss-file-dialog-overlay ss-dlg-overlay';
|
|
41
|
+
const backdrop = document.createElement('div');
|
|
42
|
+
backdrop.className = 'ss-fd-backdrop';
|
|
43
|
+
const box = document.createElement('div');
|
|
44
|
+
box.className = `ss-file-dialog ss-dlg${wide ? ' ss-dlg--wide' : ''}`;
|
|
45
|
+
const uid = `ss-dlg-${Math.random().toString(36).slice(2, 8)}`;
|
|
46
|
+
box.setAttribute('role', 'alertdialog');
|
|
47
|
+
box.setAttribute('aria-modal', 'true');
|
|
48
|
+
box.setAttribute('aria-labelledby', `${uid}-title`);
|
|
49
|
+
box.setAttribute('aria-describedby', `${uid}-body`);
|
|
50
|
+
const head = document.createElement('div');
|
|
51
|
+
head.className = 'ss-dlg-title';
|
|
52
|
+
head.id = `${uid}-title`;
|
|
53
|
+
head.textContent = title;
|
|
54
|
+
const body = document.createElement('div');
|
|
55
|
+
body.className = 'ss-dlg-body';
|
|
56
|
+
body.id = `${uid}-body`;
|
|
57
|
+
for (const line of lines.filter((l) => l !== null && l !== undefined && l !== '')) {
|
|
58
|
+
if (typeof line === 'string') { const p = document.createElement('p'); p.textContent = line; body.append(p); }
|
|
59
|
+
else body.append(line);
|
|
60
|
+
}
|
|
61
|
+
if (extra) body.append(extra);
|
|
62
|
+
const bar = document.createElement('div');
|
|
63
|
+
bar.className = 'ss-dlg-actions';
|
|
64
|
+
const byId = new Map();
|
|
65
|
+
for (const b of buttons) {
|
|
66
|
+
const node = document.createElement('button');
|
|
67
|
+
node.type = 'button';
|
|
68
|
+
node.className = `ss-dlg-btn${b.kind ? ` ss-dlg-btn--${b.kind}` : ''}`;
|
|
69
|
+
node.textContent = b.label;
|
|
70
|
+
node.dataset.answer = b.id;
|
|
71
|
+
if (b.disabled) node.disabled = true;
|
|
72
|
+
node.addEventListener('click', () => done(b.id));
|
|
73
|
+
bar.append(node);
|
|
74
|
+
byId.set(b.id, node);
|
|
75
|
+
}
|
|
76
|
+
box.append(head, body, bar);
|
|
77
|
+
overlay.append(backdrop, box);
|
|
78
|
+
|
|
79
|
+
const enabled = () => [...bar.querySelectorAll('button')].filter((b) => !b.disabled);
|
|
80
|
+
const focusables = () => [...box.querySelectorAll('button:not(:disabled), input:not(:disabled):not([type="hidden"]), textarea:not(:disabled), [tabindex="0"]')];
|
|
81
|
+
// At the window, before anything: a key meant for the page under the question goes nowhere. Escape answers.
|
|
82
|
+
const outside = (event) => {
|
|
83
|
+
if (box.contains(event.target)) return;
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
if (event.type !== 'keydown') return;
|
|
86
|
+
if (event.key === 'Escape') { event.preventDefault(); done(cancelId); return; }
|
|
87
|
+
if (event.key === 'Tab') { event.preventDefault(); (focusables()[0])?.focus(); }
|
|
88
|
+
};
|
|
89
|
+
// Inside it, a key first does what it does where it is (a field, a dropdown), then stops at the question.
|
|
90
|
+
const inside = (event) => {
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
if (event.type !== 'keydown' || event.defaultPrevented || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
93
|
+
if (event.key === 'Escape') { event.preventDefault(); done(cancelId); return; }
|
|
94
|
+
const list = enabled();
|
|
95
|
+
const index = list.indexOf(document.activeElement);
|
|
96
|
+
if ((event.key === 'ArrowRight' || event.key === 'ArrowLeft') && index >= 0) {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
list[(index + (event.key === 'ArrowLeft' ? -1 : 1) + list.length) % list.length]?.focus();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (event.key === 'Tab') {
|
|
102
|
+
const all = focusables();
|
|
103
|
+
const at = all.indexOf(document.activeElement);
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
all[(at + (event.shiftKey ? -1 : 1) + all.length) % all.length]?.focus();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
for (const type of KEY_EVENTS) box.addEventListener(type, inside);
|
|
109
|
+
let answered = false;
|
|
110
|
+
const ui = { box, body, bar, byId, setDisabled: (id, on) => { const n = byId.get(id); if (n) n.disabled = !!on; } };
|
|
111
|
+
function done(answer, { replaced = false } = {}) {
|
|
112
|
+
if (answered) return;
|
|
113
|
+
if (!replaced && answer !== cancelId && answer !== null && typeof accept === 'function' && accept(answer, ui) === false) return;
|
|
114
|
+
answered = true;
|
|
115
|
+
if (_open === handle) _open = null;
|
|
116
|
+
for (const type of KEY_EVENTS) window.removeEventListener(type, outside, true);
|
|
117
|
+
overlay.remove();
|
|
118
|
+
if (!replaced && before?.isConnected) before.focus({ preventScroll: true });
|
|
119
|
+
resolve(answer);
|
|
120
|
+
}
|
|
121
|
+
const handle = { giveUp: () => done(null, { replaced: true }) };
|
|
122
|
+
_open = handle;
|
|
123
|
+
backdrop.addEventListener('click', () => done(cancelId));
|
|
124
|
+
for (const type of KEY_EVENTS) window.addEventListener(type, outside, true);
|
|
125
|
+
host.append(overlay);
|
|
126
|
+
const start = (focus && byId.get(focus)) || [...buttons].reverse().map((b) => byId.get(b.id)).find((n) => n && !n.disabled && !n.classList.contains('ss-dlg-btn--danger')) || enabled()[0];
|
|
127
|
+
start?.focus({ preventScroll: true });
|
|
128
|
+
ui.done = done;
|
|
129
|
+
});
|
|
130
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// ═══════════════════════════════════════════
|
|
2
|
+
// SynaBun Neural Interface — Skills Studio: a file as it is on disk and as it is edited
|
|
3
|
+
// ═══════════════════════════════════════════
|
|
4
|
+
//
|
|
5
|
+
// A <textarea> holds every line break as "\n" and shows a byte-order mark as an invisible first character. A
|
|
6
|
+
// file is edited in that form, and written back as it was: the mark when it had one, and each line that is
|
|
7
|
+
// still there with the line ending it had (a file that mixes CRLF and LF keeps the mix). A line the user wrote
|
|
8
|
+
// takes the ending most of the file uses. Opening a file, switching tabs or saving it unchanged writes nothing
|
|
9
|
+
// new: the bytes that come back are the bytes that were read.
|
|
10
|
+
//
|
|
11
|
+
// Also here: whether bytes are text that can be edited at all (a PNG cannot), and the revision of a text. No
|
|
12
|
+
// DOM and no imports: loaded by `node --test` as it is, and by the server for the text check.
|
|
13
|
+
|
|
14
|
+
export const BOM = '';
|
|
15
|
+
|
|
16
|
+
/** The lines of a text with the line break that ends each one ('' for the last). `\r\n`, `\n` and a lone `\r` are breaks. */
|
|
17
|
+
export function splitLines(text) {
|
|
18
|
+
const s = String(text ?? '');
|
|
19
|
+
const lines = [];
|
|
20
|
+
let start = 0;
|
|
21
|
+
for (let i = 0; i < s.length; i++) {
|
|
22
|
+
const c = s.charCodeAt(i);
|
|
23
|
+
if (c === 13) {
|
|
24
|
+
const eol = s.charCodeAt(i + 1) === 10 ? '\r\n' : '\r';
|
|
25
|
+
lines.push({ text: s.slice(start, i), eol });
|
|
26
|
+
i += eol.length - 1;
|
|
27
|
+
start = i + 1;
|
|
28
|
+
} else if (c === 10) {
|
|
29
|
+
lines.push({ text: s.slice(start, i), eol: '\n' });
|
|
30
|
+
start = i + 1;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
lines.push({ text: s.slice(start), eol: '' });
|
|
34
|
+
return lines;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The line ending most lines of a text end with ("\n" when none leads, or there are none). */
|
|
38
|
+
export function dominantEol(lines) {
|
|
39
|
+
let crlf = 0; let lf = 0; let cr = 0;
|
|
40
|
+
for (const line of lines) {
|
|
41
|
+
if (line.eol === '\r\n') crlf++;
|
|
42
|
+
else if (line.eol === '\n') lf++;
|
|
43
|
+
else if (line.eol === '\r') cr++;
|
|
44
|
+
}
|
|
45
|
+
if (crlf > lf && crlf >= cr) return '\r\n';
|
|
46
|
+
if (cr > lf && cr > crlf) return '\r';
|
|
47
|
+
return '\n';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The text as it is edited: no byte-order mark, every line break "\n".
|
|
52
|
+
* @returns {{ text: string, bom: boolean, eol: '\n' | '\r\n' | '\r', mixed: boolean }}
|
|
53
|
+
*/
|
|
54
|
+
export function toEditing(raw) {
|
|
55
|
+
const s = String(raw ?? '');
|
|
56
|
+
const bom = s.charCodeAt(0) === 0xFEFF;
|
|
57
|
+
const lines = splitLines(bom ? s.slice(1) : s);
|
|
58
|
+
const kinds = new Set(lines.filter((l) => l.eol).map((l) => l.eol));
|
|
59
|
+
return { text: lines.map((l) => l.text).join('\n'), bom, eol: dominantEol(lines), mixed: kinds.size > 1 };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Whether the edited text is what the file holds (line endings and the byte-order mark aside). */
|
|
63
|
+
export function sameAsSaved(savedRaw, editedText) {
|
|
64
|
+
return toEditing(savedRaw).text === String(editedText ?? '').replace(/\r\n?/g, '\n');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Edits further apart than this many changed lines in the middle of a file get the file's own ending, not each line's. */
|
|
68
|
+
export const MAX_ALIGNED_EDITS = 1000;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The lines two lists have in common, in order (a longest common subsequence, by Myers' algorithm): pairs of
|
|
72
|
+
* indexes `[i in a, j in b]`. Null when the lists differ by more than `maxEdits` inserted or removed lines.
|
|
73
|
+
*/
|
|
74
|
+
export function commonLines(a, b, maxEdits = MAX_ALIGNED_EDITS) {
|
|
75
|
+
const n = a.length; const m = b.length;
|
|
76
|
+
const maxD = Math.min(n + m, maxEdits);
|
|
77
|
+
const off = maxD + 1;
|
|
78
|
+
const v = new Int32Array(2 * maxD + 3);
|
|
79
|
+
const trace = []; // trace[d]: v for k in [-d-1, d+1] as it was when step d began
|
|
80
|
+
for (let d = 0; d <= maxD; d++) {
|
|
81
|
+
trace.push(v.slice(off - d - 1, off + d + 2));
|
|
82
|
+
for (let k = -d; k <= d; k += 2) {
|
|
83
|
+
let x = (k === -d || (k !== d && v[off + k - 1] < v[off + k + 1])) ? v[off + k + 1] : v[off + k - 1] + 1;
|
|
84
|
+
let y = x - k;
|
|
85
|
+
while (x < n && y < m && a[x] === b[y]) { x++; y++; }
|
|
86
|
+
v[off + k] = x;
|
|
87
|
+
if (x >= n && y >= m) {
|
|
88
|
+
// Back through the steps: every diagonal move is a line both lists keep.
|
|
89
|
+
const kept = [];
|
|
90
|
+
let cx = n; let cy = m;
|
|
91
|
+
for (let s = d; s >= 0; s--) {
|
|
92
|
+
const win = trace[s];
|
|
93
|
+
const at = (kk) => win[kk + s + 1];
|
|
94
|
+
const kk = cx - cy;
|
|
95
|
+
const prevK = (kk === -s || (kk !== s && at(kk - 1) < at(kk + 1))) ? kk + 1 : kk - 1;
|
|
96
|
+
const px = at(prevK);
|
|
97
|
+
const py = px - prevK;
|
|
98
|
+
while (cx > px && cy > py) { kept.push([cx - 1, cy - 1]); cx--; cy--; }
|
|
99
|
+
if (s > 0) { cx = px; cy = py; }
|
|
100
|
+
}
|
|
101
|
+
return kept.reverse();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The text to write: the edited text with the file's byte-order mark and line endings put back.
|
|
110
|
+
* @param {string} savedRaw the file as it was read (or last saved)
|
|
111
|
+
* @param {string} editedText the editor's text ("\n" line breaks)
|
|
112
|
+
* @returns {string} exactly `savedRaw` when nothing but line breaks differs
|
|
113
|
+
*/
|
|
114
|
+
export function fromEditing(savedRaw, editedText) {
|
|
115
|
+
const saved = String(savedRaw ?? '');
|
|
116
|
+
const edited = String(editedText ?? '').replace(/\r\n?/g, '\n');
|
|
117
|
+
const bom = saved.charCodeAt(0) === 0xFEFF;
|
|
118
|
+
const before = splitLines(bom ? saved.slice(1) : saved);
|
|
119
|
+
const beforeText = before.map((l) => l.text);
|
|
120
|
+
const after = edited.split('\n');
|
|
121
|
+
if (beforeText.join('\n') === edited) return saved;
|
|
122
|
+
const fallback = dominantEol(before);
|
|
123
|
+
const eols = new Array(after.length).fill(null);
|
|
124
|
+
// The same lines at the start and at the end keep their endings; what lies between is aligned line by line.
|
|
125
|
+
let head = 0;
|
|
126
|
+
const shorter = Math.min(before.length, after.length);
|
|
127
|
+
while (head < shorter && beforeText[head] === after[head]) { eols[head] = before[head].eol; head++; }
|
|
128
|
+
let tail = 0;
|
|
129
|
+
while (tail < shorter - head && beforeText[before.length - 1 - tail] === after[after.length - 1 - tail]) {
|
|
130
|
+
eols[after.length - 1 - tail] = before[before.length - 1 - tail].eol;
|
|
131
|
+
tail++;
|
|
132
|
+
}
|
|
133
|
+
const midBefore = beforeText.slice(head, before.length - tail);
|
|
134
|
+
const midAfter = after.slice(head, after.length - tail);
|
|
135
|
+
if (midBefore.length && midAfter.length) {
|
|
136
|
+
const kept = commonLines(midBefore, midAfter, MAX_ALIGNED_EDITS);
|
|
137
|
+
if (kept) for (const [i, j] of kept) eols[head + j] = before[head + i].eol;
|
|
138
|
+
}
|
|
139
|
+
const last = after.length - 1;
|
|
140
|
+
const out = after.map((line, i) => {
|
|
141
|
+
let eol = eols[i];
|
|
142
|
+
if (i === last) eol = '';
|
|
143
|
+
else if (!eol) eol = fallback; // a new line, or one that was last and is not any more
|
|
144
|
+
return line + eol;
|
|
145
|
+
});
|
|
146
|
+
return (bom ? BOM : '') + out.join('');
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// ── Text or not ──
|
|
150
|
+
|
|
151
|
+
const TEXT_DECODER = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { fatal: true }) : null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Whether bytes are text the editor can show and write back unchanged: UTF-8, and no control byte a text file
|
|
155
|
+
* does not hold (NUL and the like; tab, line breaks, form feed and escape are text). A PNG, a PDF, a font, a
|
|
156
|
+
* compiled program are not.
|
|
157
|
+
* @param {Uint8Array} bytes
|
|
158
|
+
*/
|
|
159
|
+
export function isEditableText(bytes) {
|
|
160
|
+
if (!bytes || typeof bytes.length !== 'number') return false;
|
|
161
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
162
|
+
const b = bytes[i];
|
|
163
|
+
if (b < 0x09 || (b > 0x0D && b < 0x20 && b !== 0x1B)) return false;
|
|
164
|
+
}
|
|
165
|
+
if (!TEXT_DECODER) return true;
|
|
166
|
+
try { TEXT_DECODER.decode(bytes); return true; } catch { return false; }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** A string that came back from a server that decoded bytes as UTF-8 without checking: it holds what decoding replaced. */
|
|
170
|
+
export function looksDecodedFromBinary(text) {
|
|
171
|
+
const s = String(text ?? '');
|
|
172
|
+
return s.includes('\u0000') || s.includes('�');
|
|
173
|
+
}
|