synabun 1.3.0 → 2.0.0-beta
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 +197 -662
- package/LICENSE-COMMERCIAL.md +33 -0
- package/NOTICE +17 -0
- package/README.md +175 -853
- package/THIRD-PARTY-LICENSES.md +131 -0
- package/benchmarks/browser-live-results.json +79 -0
- package/benchmarks/browser-v2-results.json +258 -0
- package/benchmarks/fixtures/browser/README.md +57 -0
- package/benchmarks/fixtures/browser/page-state.json +132 -0
- package/benchmarks/fixtures/browser/social.json +92 -0
- package/benchmarks/fixtures/browser/target.json +319 -0
- package/benchmarks/fixtures/desktop/README.md +58 -0
- package/benchmarks/fixtures/desktop/abstention.json +59 -0
- package/benchmarks/fixtures/desktop/adversarial.json +22 -0
- package/benchmarks/fixtures/desktop/forbidden.json +93 -0
- package/benchmarks/fixtures/desktop/generate.mjs +1023 -0
- package/benchmarks/fixtures/desktop/target.json +136 -0
- package/bin/synabun.js +30 -0
- package/docs/browser-v2.md +109 -0
- package/docs/hook-integrity.md +89 -0
- package/docs/judgments.md +182 -0
- package/docs/style-guide.md +246 -0
- package/docs/whatsapp.md +325 -0
- package/hooks/claude-code/post-plan.mjs +613 -391
- package/hooks/claude-code/post-remember.mjs +246 -122
- package/hooks/claude-code/pre-compact.mjs +171 -110
- package/hooks/claude-code/pre-task.mjs +133 -0
- package/hooks/claude-code/pre-websearch.mjs +15 -4
- package/hooks/claude-code/prompt-origin.mjs +94 -0
- package/hooks/claude-code/prompt-submit.mjs +1244 -861
- package/hooks/claude-code/session-start.mjs +114 -156
- package/hooks/claude-code/shared.mjs +1228 -368
- package/hooks/claude-code/state.mjs +167 -0
- package/hooks/claude-code/stop.mjs +515 -140
- package/hooks/claude-code/subagent-start.mjs +154 -0
- package/hooks/claude-code/subagent-stop.mjs +102 -0
- package/hooks/claude-code/task-gate.mjs +150 -0
- package/lib/claude-hooks.js +84 -0
- package/lib/claude-usage-audit.js +141 -0
- package/lib/client-config-repair.js +144 -0
- package/lib/data-home-migration.js +498 -0
- package/lib/first-launch-protection.js +240 -0
- package/lib/paths.d.ts +21 -0
- package/lib/paths.js +103 -0
- package/mcp-server/dist/config.d.ts +22 -0
- package/mcp-server/dist/config.d.ts.map +1 -0
- package/mcp-server/dist/config.js +109 -0
- package/mcp-server/dist/config.js.map +1 -0
- package/mcp-server/dist/http.d.ts +30 -0
- package/mcp-server/dist/http.d.ts.map +1 -0
- package/mcp-server/dist/http.js +276 -0
- package/mcp-server/dist/http.js.map +1 -0
- package/mcp-server/dist/index.d.ts +48 -0
- package/mcp-server/dist/index.d.ts.map +1 -0
- package/mcp-server/dist/index.js +538 -0
- package/mcp-server/dist/index.js.map +1 -0
- package/mcp-server/dist/preload-http.d.ts +3 -0
- package/mcp-server/dist/preload-http.d.ts.map +1 -0
- package/mcp-server/dist/preload-http.js +28 -0
- package/mcp-server/dist/preload-http.js.map +1 -0
- package/mcp-server/dist/preload.d.ts +3 -0
- package/mcp-server/dist/preload.d.ts.map +1 -0
- package/mcp-server/dist/preload.js +32 -0
- package/mcp-server/dist/preload.js.map +1 -0
- package/mcp-server/dist/scripts/migrate-qdrant-to-sqlite.d.ts +19 -0
- package/mcp-server/dist/scripts/migrate-qdrant-to-sqlite.d.ts.map +1 -0
- package/mcp-server/dist/scripts/migrate-qdrant-to-sqlite.js +403 -0
- package/mcp-server/dist/scripts/migrate-qdrant-to-sqlite.js.map +1 -0
- package/mcp-server/dist/scripts/setup-embeddings.d.ts +3 -0
- package/mcp-server/dist/scripts/setup-embeddings.d.ts.map +1 -0
- package/mcp-server/dist/scripts/setup-embeddings.js +15 -0
- package/mcp-server/dist/scripts/setup-embeddings.js.map +1 -0
- package/mcp-server/dist/services/assistant-judgments.d.ts +79 -0
- package/mcp-server/dist/services/assistant-judgments.d.ts.map +1 -0
- package/mcp-server/dist/services/assistant-judgments.js +128 -0
- package/mcp-server/dist/services/assistant-judgments.js.map +1 -0
- package/mcp-server/dist/services/browser-assist-gate.d.ts +314 -0
- package/mcp-server/dist/services/browser-assist-gate.d.ts.map +1 -0
- package/mcp-server/dist/services/browser-assist-gate.js +344 -0
- package/mcp-server/dist/services/browser-assist-gate.js.map +1 -0
- package/mcp-server/dist/services/browser-assist.d.ts +104 -0
- package/mcp-server/dist/services/browser-assist.d.ts.map +1 -0
- package/mcp-server/dist/services/browser-assist.js +282 -0
- package/mcp-server/dist/services/browser-assist.js.map +1 -0
- package/mcp-server/dist/services/browser-bench.d.ts +772 -0
- package/mcp-server/dist/services/browser-bench.d.ts.map +1 -0
- package/mcp-server/dist/services/browser-bench.js +424 -0
- package/mcp-server/dist/services/browser-bench.js.map +1 -0
- package/mcp-server/dist/services/browser-judgments.d.ts +196 -0
- package/mcp-server/dist/services/browser-judgments.d.ts.map +1 -0
- package/mcp-server/dist/services/browser-judgments.js +363 -0
- package/mcp-server/dist/services/browser-judgments.js.map +1 -0
- package/mcp-server/dist/services/browser-risk.d.ts +166 -0
- package/mcp-server/dist/services/browser-risk.d.ts.map +1 -0
- package/mcp-server/dist/services/browser-risk.js +458 -0
- package/mcp-server/dist/services/browser-risk.js.map +1 -0
- package/mcp-server/dist/services/categories.d.ts +61 -0
- package/mcp-server/dist/services/categories.d.ts.map +1 -0
- package/mcp-server/dist/services/categories.js +377 -0
- package/mcp-server/dist/services/categories.js.map +1 -0
- package/mcp-server/dist/services/codex-config-heal.d.ts +49 -0
- package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -0
- package/mcp-server/dist/services/codex-config-heal.js +346 -0
- package/mcp-server/dist/services/codex-config-heal.js.map +1 -0
- package/mcp-server/dist/services/desktop-assist-gate.d.ts +198 -0
- package/mcp-server/dist/services/desktop-assist-gate.d.ts.map +1 -0
- package/mcp-server/dist/services/desktop-assist-gate.js +202 -0
- package/mcp-server/dist/services/desktop-assist-gate.js.map +1 -0
- package/mcp-server/dist/services/desktop-assist.d.ts +104 -0
- package/mcp-server/dist/services/desktop-assist.d.ts.map +1 -0
- package/mcp-server/dist/services/desktop-assist.js +266 -0
- package/mcp-server/dist/services/desktop-assist.js.map +1 -0
- package/mcp-server/dist/services/desktop-bench.d.ts +553 -0
- package/mcp-server/dist/services/desktop-bench.d.ts.map +1 -0
- package/mcp-server/dist/services/desktop-bench.js +311 -0
- package/mcp-server/dist/services/desktop-bench.js.map +1 -0
- package/mcp-server/dist/services/desktop-client.d.ts +23 -0
- package/mcp-server/dist/services/desktop-client.d.ts.map +1 -0
- package/mcp-server/dist/services/desktop-client.js +79 -0
- package/mcp-server/dist/services/desktop-client.js.map +1 -0
- package/mcp-server/dist/services/desktop-judgments.d.ts +125 -0
- package/mcp-server/dist/services/desktop-judgments.d.ts.map +1 -0
- package/mcp-server/dist/services/desktop-judgments.js +177 -0
- package/mcp-server/dist/services/desktop-judgments.js.map +1 -0
- package/mcp-server/dist/services/desktop-risk.d.ts +283 -0
- package/mcp-server/dist/services/desktop-risk.d.ts.map +1 -0
- package/mcp-server/dist/services/desktop-risk.js +605 -0
- package/mcp-server/dist/services/desktop-risk.js.map +1 -0
- package/mcp-server/dist/services/discord.d.ts +112 -0
- package/mcp-server/dist/services/discord.d.ts.map +1 -0
- package/mcp-server/dist/services/discord.js +477 -0
- package/mcp-server/dist/services/discord.js.map +1 -0
- package/mcp-server/dist/services/edit-stale.d.ts +81 -0
- package/mcp-server/dist/services/edit-stale.d.ts.map +1 -0
- package/mcp-server/dist/services/edit-stale.js +358 -0
- package/mcp-server/dist/services/edit-stale.js.map +1 -0
- package/mcp-server/dist/services/embedding-service.d.ts +16 -0
- package/mcp-server/dist/services/embedding-service.d.ts.map +1 -0
- package/mcp-server/dist/services/embedding-service.js +126 -0
- package/mcp-server/dist/services/embedding-service.js.map +1 -0
- package/mcp-server/dist/services/embedding-worker.d.ts +2 -0
- package/mcp-server/dist/services/embedding-worker.d.ts.map +1 -0
- package/mcp-server/dist/services/embedding-worker.js +52 -0
- package/mcp-server/dist/services/embedding-worker.js.map +1 -0
- package/mcp-server/dist/services/fb-regions.d.ts +71 -0
- package/mcp-server/dist/services/fb-regions.d.ts.map +1 -0
- package/mcp-server/dist/services/fb-regions.js +211 -0
- package/mcp-server/dist/services/fb-regions.js.map +1 -0
- package/mcp-server/dist/services/file-checksums.d.ts +22 -0
- package/mcp-server/dist/services/file-checksums.d.ts.map +1 -0
- package/mcp-server/dist/services/file-checksums.js +55 -0
- package/mcp-server/dist/services/file-checksums.js.map +1 -0
- package/mcp-server/dist/services/file-excerpt.d.ts +24 -0
- package/mcp-server/dist/services/file-excerpt.d.ts.map +1 -0
- package/mcp-server/dist/services/file-excerpt.js +65 -0
- package/mcp-server/dist/services/file-excerpt.js.map +1 -0
- package/mcp-server/dist/services/identity.d.ts +124 -0
- package/mcp-server/dist/services/identity.d.ts.map +1 -0
- package/mcp-server/dist/services/identity.js +241 -0
- package/mcp-server/dist/services/identity.js.map +1 -0
- package/mcp-server/dist/services/local-embeddings.d.ts +2 -0
- package/mcp-server/dist/services/local-embeddings.d.ts.map +1 -0
- package/mcp-server/dist/services/local-embeddings.js +3 -0
- package/mcp-server/dist/services/local-embeddings.js.map +1 -0
- package/mcp-server/dist/services/memory-client.d.ts +4 -0
- package/mcp-server/dist/services/memory-client.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-client.js +27 -0
- package/mcp-server/dist/services/memory-client.js.map +1 -0
- package/mcp-server/dist/services/memory-judge-backfill.d.ts +135 -0
- package/mcp-server/dist/services/memory-judge-backfill.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-judge-backfill.js +510 -0
- package/mcp-server/dist/services/memory-judge-backfill.js.map +1 -0
- package/mcp-server/dist/services/memory-judgments.d.ts +362 -0
- package/mcp-server/dist/services/memory-judgments.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-judgments.js +674 -0
- package/mcp-server/dist/services/memory-judgments.js.map +1 -0
- package/mcp-server/dist/services/memory-maintenance.d.ts +108 -0
- package/mcp-server/dist/services/memory-maintenance.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-maintenance.js +403 -0
- package/mcp-server/dist/services/memory-maintenance.js.map +1 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts +66 -0
- package/mcp-server/dist/services/memory-retrieval.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-retrieval.js +412 -0
- package/mcp-server/dist/services/memory-retrieval.js.map +1 -0
- package/mcp-server/dist/services/memory-schema.d.ts +16 -0
- package/mcp-server/dist/services/memory-schema.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-schema.js +282 -0
- package/mcp-server/dist/services/memory-schema.js.map +1 -0
- package/mcp-server/dist/services/memory-sessions.d.ts +24 -0
- package/mcp-server/dist/services/memory-sessions.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-sessions.js +110 -0
- package/mcp-server/dist/services/memory-sessions.js.map +1 -0
- package/mcp-server/dist/services/memory-triage.d.ts +60 -0
- package/mcp-server/dist/services/memory-triage.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-triage.js +189 -0
- package/mcp-server/dist/services/memory-triage.js.map +1 -0
- package/mcp-server/dist/services/memory-verification.d.ts +24 -0
- package/mcp-server/dist/services/memory-verification.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-verification.js +92 -0
- package/mcp-server/dist/services/memory-verification.js.map +1 -0
- package/mcp-server/dist/services/memory-writer.d.ts +26 -0
- package/mcp-server/dist/services/memory-writer.d.ts.map +1 -0
- package/mcp-server/dist/services/memory-writer.js +126 -0
- package/mcp-server/dist/services/memory-writer.js.map +1 -0
- package/mcp-server/dist/services/neural-interface.d.ts +439 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -0
- package/mcp-server/dist/services/neural-interface.js +1135 -0
- package/mcp-server/dist/services/neural-interface.js.map +1 -0
- package/mcp-server/dist/services/profiles.d.ts +120 -0
- package/mcp-server/dist/services/profiles.d.ts.map +1 -0
- package/mcp-server/dist/services/profiles.js +387 -0
- package/mcp-server/dist/services/profiles.js.map +1 -0
- package/mcp-server/dist/services/secret-gate.d.ts +29 -0
- package/mcp-server/dist/services/secret-gate.d.ts.map +1 -0
- package/mcp-server/dist/services/secret-gate.js +43 -0
- package/mcp-server/dist/services/secret-gate.js.map +1 -0
- package/mcp-server/dist/services/server-instructions.d.ts +10 -0
- package/mcp-server/dist/services/server-instructions.d.ts.map +1 -0
- package/mcp-server/dist/services/server-instructions.js +101 -0
- package/mcp-server/dist/services/server-instructions.js.map +1 -0
- package/mcp-server/dist/services/sqlite.d.ts +235 -0
- package/mcp-server/dist/services/sqlite.d.ts.map +1 -0
- package/mcp-server/dist/services/sqlite.js +1185 -0
- package/mcp-server/dist/services/sqlite.js.map +1 -0
- package/mcp-server/dist/services/typesafe-bench.d.ts +99 -0
- package/mcp-server/dist/services/typesafe-bench.d.ts.map +1 -0
- package/mcp-server/dist/services/typesafe-bench.js +218 -0
- package/mcp-server/dist/services/typesafe-bench.js.map +1 -0
- package/mcp-server/dist/services/typesafe-config.d.ts +342 -0
- package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -0
- package/mcp-server/dist/services/typesafe-config.js +746 -0
- package/mcp-server/dist/services/typesafe-config.js.map +1 -0
- package/mcp-server/dist/services/typesafe.d.ts +213 -0
- package/mcp-server/dist/services/typesafe.d.ts.map +1 -0
- package/mcp-server/dist/services/typesafe.js +330 -0
- package/mcp-server/dist/services/typesafe.js.map +1 -0
- package/mcp-server/dist/services/vector-cache.d.ts +68 -0
- package/mcp-server/dist/services/vector-cache.d.ts.map +1 -0
- package/mcp-server/dist/services/vector-cache.js +271 -0
- package/mcp-server/dist/services/vector-cache.js.map +1 -0
- package/mcp-server/dist/services/whiteboard-geometry.d.ts +305 -0
- package/mcp-server/dist/services/whiteboard-geometry.d.ts.map +1 -0
- package/mcp-server/dist/services/whiteboard-geometry.js +666 -0
- package/mcp-server/dist/services/whiteboard-geometry.js.map +1 -0
- package/mcp-server/dist/tools/agents.d.ts +212 -0
- package/mcp-server/dist/tools/agents.d.ts.map +1 -0
- package/mcp-server/dist/tools/agents.js +407 -0
- package/mcp-server/dist/tools/agents.js.map +1 -0
- package/mcp-server/dist/tools/bluesky.d.ts +39 -0
- package/mcp-server/dist/tools/bluesky.d.ts.map +1 -0
- package/mcp-server/dist/tools/bluesky.js +1144 -0
- package/mcp-server/dist/tools/bluesky.js.map +1 -0
- package/mcp-server/dist/tools/browser-advanced.d.ts +58 -0
- package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-advanced.js +106 -0
- package/mcp-server/dist/tools/browser-advanced.js.map +1 -0
- package/mcp-server/dist/tools/browser-batch.d.ts +99 -0
- package/mcp-server/dist/tools/browser-batch.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-batch.js +187 -0
- package/mcp-server/dist/tools/browser-batch.js.map +1 -0
- package/mcp-server/dist/tools/browser-cheatsheet.d.ts +21 -0
- package/mcp-server/dist/tools/browser-cheatsheet.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-cheatsheet.js +144 -0
- package/mcp-server/dist/tools/browser-cheatsheet.js.map +1 -0
- package/mcp-server/dist/tools/browser-interact.d.ts +239 -0
- package/mcp-server/dist/tools/browser-interact.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-interact.js +300 -0
- package/mcp-server/dist/tools/browser-interact.js.map +1 -0
- package/mcp-server/dist/tools/browser-navigate.d.ts +90 -0
- package/mcp-server/dist/tools/browser-navigate.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-navigate.js +142 -0
- package/mcp-server/dist/tools/browser-navigate.js.map +1 -0
- package/mcp-server/dist/tools/browser-observe.d.ts +561 -0
- package/mcp-server/dist/tools/browser-observe.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser-observe.js +2009 -0
- package/mcp-server/dist/tools/browser-observe.js.map +1 -0
- package/mcp-server/dist/tools/browser.d.ts +34 -0
- package/mcp-server/dist/tools/browser.d.ts.map +1 -0
- package/mcp-server/dist/tools/browser.js +112 -0
- package/mcp-server/dist/tools/browser.js.map +1 -0
- package/mcp-server/dist/tools/card-tools.d.ts +82 -0
- package/mcp-server/dist/tools/card-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/card-tools.js +137 -0
- package/mcp-server/dist/tools/card-tools.js.map +1 -0
- package/mcp-server/dist/tools/card.d.ts +8 -0
- package/mcp-server/dist/tools/card.d.ts.map +1 -0
- package/mcp-server/dist/tools/card.js +16 -0
- package/mcp-server/dist/tools/card.js.map +1 -0
- package/mcp-server/dist/tools/category.d.ts +32 -0
- package/mcp-server/dist/tools/category.d.ts.map +1 -0
- package/mcp-server/dist/tools/category.js +290 -0
- package/mcp-server/dist/tools/category.js.map +1 -0
- package/mcp-server/dist/tools/choice.d.ts +160 -0
- package/mcp-server/dist/tools/choice.d.ts.map +1 -0
- package/mcp-server/dist/tools/choice.js +80 -0
- package/mcp-server/dist/tools/choice.js.map +1 -0
- package/mcp-server/dist/tools/computer.d.ts +71 -0
- package/mcp-server/dist/tools/computer.d.ts.map +1 -0
- package/mcp-server/dist/tools/computer.js +174 -0
- package/mcp-server/dist/tools/computer.js.map +1 -0
- package/mcp-server/dist/tools/discord-channel.d.ts +44 -0
- package/mcp-server/dist/tools/discord-channel.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-channel.js +236 -0
- package/mcp-server/dist/tools/discord-channel.js.map +1 -0
- package/mcp-server/dist/tools/discord-guild.d.ts +20 -0
- package/mcp-server/dist/tools/discord-guild.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-guild.js +138 -0
- package/mcp-server/dist/tools/discord-guild.js.map +1 -0
- package/mcp-server/dist/tools/discord-member.d.ts +26 -0
- package/mcp-server/dist/tools/discord-member.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-member.js +122 -0
- package/mcp-server/dist/tools/discord-member.js.map +1 -0
- package/mcp-server/dist/tools/discord-message.d.ts +36 -0
- package/mcp-server/dist/tools/discord-message.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-message.js +184 -0
- package/mcp-server/dist/tools/discord-message.js.map +1 -0
- package/mcp-server/dist/tools/discord-onboarding.d.ts +32 -0
- package/mcp-server/dist/tools/discord-onboarding.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-onboarding.js +179 -0
- package/mcp-server/dist/tools/discord-onboarding.js.map +1 -0
- package/mcp-server/dist/tools/discord-role.d.ts +34 -0
- package/mcp-server/dist/tools/discord-role.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-role.js +178 -0
- package/mcp-server/dist/tools/discord-role.js.map +1 -0
- package/mcp-server/dist/tools/discord-thread.d.ts +28 -0
- package/mcp-server/dist/tools/discord-thread.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-thread.js +88 -0
- package/mcp-server/dist/tools/discord-thread.js.map +1 -0
- package/mcp-server/dist/tools/discord-webhook.d.ts +32 -0
- package/mcp-server/dist/tools/discord-webhook.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord-webhook.js +154 -0
- package/mcp-server/dist/tools/discord-webhook.js.map +1 -0
- package/mcp-server/dist/tools/discord.d.ts +7 -0
- package/mcp-server/dist/tools/discord.d.ts.map +1 -0
- package/mcp-server/dist/tools/discord.js +25 -0
- package/mcp-server/dist/tools/discord.js.map +1 -0
- package/mcp-server/dist/tools/fb-groups.d.ts +98 -0
- package/mcp-server/dist/tools/fb-groups.d.ts.map +1 -0
- package/mcp-server/dist/tools/fb-groups.js +369 -0
- package/mcp-server/dist/tools/fb-groups.js.map +1 -0
- package/mcp-server/dist/tools/forget.d.ts +14 -0
- package/mcp-server/dist/tools/forget.d.ts.map +1 -0
- package/mcp-server/dist/tools/forget.js +26 -0
- package/mcp-server/dist/tools/forget.js.map +1 -0
- package/mcp-server/dist/tools/git-tools.d.ts +24 -0
- package/mcp-server/dist/tools/git-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/git-tools.js +107 -0
- package/mcp-server/dist/tools/git-tools.js.map +1 -0
- package/mcp-server/dist/tools/git.d.ts +7 -0
- package/mcp-server/dist/tools/git.d.ts.map +1 -0
- package/mcp-server/dist/tools/git.js +11 -0
- package/mcp-server/dist/tools/git.js.map +1 -0
- package/mcp-server/dist/tools/gsc/experience.d.ts +135 -0
- package/mcp-server/dist/tools/gsc/experience.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/experience.js +351 -0
- package/mcp-server/dist/tools/gsc/experience.js.map +1 -0
- package/mcp-server/dist/tools/gsc/helpers.d.ts +78 -0
- package/mcp-server/dist/tools/gsc/helpers.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/helpers.js +258 -0
- package/mcp-server/dist/tools/gsc/helpers.js.map +1 -0
- package/mcp-server/dist/tools/gsc/indexing.d.ts +121 -0
- package/mcp-server/dist/tools/gsc/indexing.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/indexing.js +357 -0
- package/mcp-server/dist/tools/gsc/indexing.js.map +1 -0
- package/mcp-server/dist/tools/gsc/inspect.d.ts +78 -0
- package/mcp-server/dist/tools/gsc/inspect.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/inspect.js +321 -0
- package/mcp-server/dist/tools/gsc/inspect.js.map +1 -0
- package/mcp-server/dist/tools/gsc/navigate.d.ts +44 -0
- package/mcp-server/dist/tools/gsc/navigate.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/navigate.js +197 -0
- package/mcp-server/dist/tools/gsc/navigate.js.map +1 -0
- package/mcp-server/dist/tools/gsc/performance.d.ts +84 -0
- package/mcp-server/dist/tools/gsc/performance.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/performance.js +274 -0
- package/mcp-server/dist/tools/gsc/performance.js.map +1 -0
- package/mcp-server/dist/tools/gsc/settings.d.ts +153 -0
- package/mcp-server/dist/tools/gsc/settings.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc/settings.js +425 -0
- package/mcp-server/dist/tools/gsc/settings.js.map +1 -0
- package/mcp-server/dist/tools/gsc.d.ts +7 -0
- package/mcp-server/dist/tools/gsc.d.ts.map +1 -0
- package/mcp-server/dist/tools/gsc.js +51 -0
- package/mcp-server/dist/tools/gsc.js.map +1 -0
- package/mcp-server/dist/tools/image-tools.d.ts +24 -0
- package/mcp-server/dist/tools/image-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/image-tools.js +80 -0
- package/mcp-server/dist/tools/image-tools.js.map +1 -0
- package/mcp-server/dist/tools/image.d.ts +10 -0
- package/mcp-server/dist/tools/image.d.ts.map +1 -0
- package/mcp-server/dist/tools/image.js +14 -0
- package/mcp-server/dist/tools/image.js.map +1 -0
- package/mcp-server/dist/tools/leonardo-browser-tools.d.ts +97 -0
- package/mcp-server/dist/tools/leonardo-browser-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/leonardo-browser-tools.js +228 -0
- package/mcp-server/dist/tools/leonardo-browser-tools.js.map +1 -0
- package/mcp-server/dist/tools/leonardo.d.ts +13 -0
- package/mcp-server/dist/tools/leonardo.d.ts.map +1 -0
- package/mcp-server/dist/tools/leonardo.js +21 -0
- package/mcp-server/dist/tools/leonardo.js.map +1 -0
- package/mcp-server/dist/tools/loop.d.ts +30 -0
- package/mcp-server/dist/tools/loop.d.ts.map +1 -0
- package/mcp-server/dist/tools/loop.js +401 -0
- package/mcp-server/dist/tools/loop.js.map +1 -0
- package/mcp-server/dist/tools/memories.d.ts +56 -0
- package/mcp-server/dist/tools/memories.d.ts.map +1 -0
- package/mcp-server/dist/tools/memories.js +171 -0
- package/mcp-server/dist/tools/memories.js.map +1 -0
- package/mcp-server/dist/tools/morelogin.d.ts +24 -0
- package/mcp-server/dist/tools/morelogin.d.ts.map +1 -0
- package/mcp-server/dist/tools/morelogin.js +79 -0
- package/mcp-server/dist/tools/morelogin.js.map +1 -0
- package/mcp-server/dist/tools/profile.d.ts +17 -0
- package/mcp-server/dist/tools/profile.d.ts.map +1 -0
- package/mcp-server/dist/tools/profile.js +114 -0
- package/mcp-server/dist/tools/profile.js.map +1 -0
- package/mcp-server/dist/tools/recall.d.ts +71 -0
- package/mcp-server/dist/tools/recall.d.ts.map +1 -0
- package/mcp-server/dist/tools/recall.js +147 -0
- package/mcp-server/dist/tools/recall.js.map +1 -0
- package/mcp-server/dist/tools/reflect.d.ts +56 -0
- package/mcp-server/dist/tools/reflect.d.ts.map +1 -0
- package/mcp-server/dist/tools/reflect.js +157 -0
- package/mcp-server/dist/tools/reflect.js.map +1 -0
- package/mcp-server/dist/tools/remember.d.ts +62 -0
- package/mcp-server/dist/tools/remember.d.ts.map +1 -0
- package/mcp-server/dist/tools/remember.js +201 -0
- package/mcp-server/dist/tools/remember.js.map +1 -0
- package/mcp-server/dist/tools/response.d.ts +23 -0
- package/mcp-server/dist/tools/response.d.ts.map +1 -0
- package/mcp-server/dist/tools/response.js +24 -0
- package/mcp-server/dist/tools/response.js.map +1 -0
- package/mcp-server/dist/tools/restore.d.ts +14 -0
- package/mcp-server/dist/tools/restore.d.ts.map +1 -0
- package/mcp-server/dist/tools/restore.js +23 -0
- package/mcp-server/dist/tools/restore.js.map +1 -0
- package/mcp-server/dist/tools/style-guide-tools.d.ts +51 -0
- package/mcp-server/dist/tools/style-guide-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/style-guide-tools.js +231 -0
- package/mcp-server/dist/tools/style-guide-tools.js.map +1 -0
- package/mcp-server/dist/tools/style-guide.d.ts +8 -0
- package/mcp-server/dist/tools/style-guide.d.ts.map +1 -0
- package/mcp-server/dist/tools/style-guide.js +12 -0
- package/mcp-server/dist/tools/style-guide.js.map +1 -0
- package/mcp-server/dist/tools/sync.d.ts +20 -0
- package/mcp-server/dist/tools/sync.d.ts.map +1 -0
- package/mcp-server/dist/tools/sync.js +156 -0
- package/mcp-server/dist/tools/sync.js.map +1 -0
- package/mcp-server/dist/tools/tictactoe-tools.d.ts +18 -0
- package/mcp-server/dist/tools/tictactoe-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/tictactoe-tools.js +78 -0
- package/mcp-server/dist/tools/tictactoe-tools.js.map +1 -0
- package/mcp-server/dist/tools/tictactoe.d.ts +7 -0
- package/mcp-server/dist/tools/tictactoe.d.ts.map +1 -0
- package/mcp-server/dist/tools/tictactoe.js +11 -0
- package/mcp-server/dist/tools/tictactoe.js.map +1 -0
- package/mcp-server/dist/tools/utils.d.ts +19 -0
- package/mcp-server/dist/tools/utils.d.ts.map +1 -0
- package/mcp-server/dist/tools/utils.js +54 -0
- package/mcp-server/dist/tools/utils.js.map +1 -0
- package/mcp-server/dist/tools/whiteboard-format.d.ts +88 -0
- package/mcp-server/dist/tools/whiteboard-format.d.ts.map +1 -0
- package/mcp-server/dist/tools/whiteboard-format.js +337 -0
- package/mcp-server/dist/tools/whiteboard-format.js.map +1 -0
- package/mcp-server/dist/tools/whiteboard-tools.d.ts +326 -0
- package/mcp-server/dist/tools/whiteboard-tools.d.ts.map +1 -0
- package/mcp-server/dist/tools/whiteboard-tools.js +222 -0
- package/mcp-server/dist/tools/whiteboard-tools.js.map +1 -0
- package/mcp-server/dist/tools/whiteboard.d.ts +8 -0
- package/mcp-server/dist/tools/whiteboard.d.ts.map +1 -0
- package/mcp-server/dist/tools/whiteboard.js +16 -0
- package/mcp-server/dist/tools/whiteboard.js.map +1 -0
- package/mcp-server/dist/tools/youtube/analytics.d.ts +46 -0
- package/mcp-server/dist/tools/youtube/analytics.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/analytics.js +83 -0
- package/mcp-server/dist/tools/youtube/analytics.js.map +1 -0
- package/mcp-server/dist/tools/youtube/dedup.d.ts +35 -0
- package/mcp-server/dist/tools/youtube/dedup.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/dedup.js +56 -0
- package/mcp-server/dist/tools/youtube/dedup.js.map +1 -0
- package/mcp-server/dist/tools/youtube/download.d.ts +31 -0
- package/mcp-server/dist/tools/youtube/download.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/download.js +30 -0
- package/mcp-server/dist/tools/youtube/download.js.map +1 -0
- package/mcp-server/dist/tools/youtube/helpers.d.ts +66 -0
- package/mcp-server/dist/tools/youtube/helpers.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/helpers.js +143 -0
- package/mcp-server/dist/tools/youtube/helpers.js.map +1 -0
- package/mcp-server/dist/tools/youtube/media.d.ts +43 -0
- package/mcp-server/dist/tools/youtube/media.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/media.js +97 -0
- package/mcp-server/dist/tools/youtube/media.js.map +1 -0
- package/mcp-server/dist/tools/youtube/metadata.d.ts +33 -0
- package/mcp-server/dist/tools/youtube/metadata.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/metadata.js +106 -0
- package/mcp-server/dist/tools/youtube/metadata.js.map +1 -0
- package/mcp-server/dist/tools/youtube/navigate.d.ts +30 -0
- package/mcp-server/dist/tools/youtube/navigate.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/navigate.js +71 -0
- package/mcp-server/dist/tools/youtube/navigate.js.map +1 -0
- package/mcp-server/dist/tools/youtube/playlist.d.ts +29 -0
- package/mcp-server/dist/tools/youtube/playlist.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/playlist.js +128 -0
- package/mcp-server/dist/tools/youtube/playlist.js.map +1 -0
- package/mcp-server/dist/tools/youtube/schedule.d.ts +31 -0
- package/mcp-server/dist/tools/youtube/schedule.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/schedule.js +147 -0
- package/mcp-server/dist/tools/youtube/schedule.js.map +1 -0
- package/mcp-server/dist/tools/youtube/source.d.ts +36 -0
- package/mcp-server/dist/tools/youtube/source.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/source.js +85 -0
- package/mcp-server/dist/tools/youtube/source.js.map +1 -0
- package/mcp-server/dist/tools/youtube/upload.d.ts +53 -0
- package/mcp-server/dist/tools/youtube/upload.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube/upload.js +255 -0
- package/mcp-server/dist/tools/youtube/upload.js.map +1 -0
- package/mcp-server/dist/tools/youtube.d.ts +12 -0
- package/mcp-server/dist/tools/youtube.d.ts.map +1 -0
- package/mcp-server/dist/tools/youtube.js +38 -0
- package/mcp-server/dist/tools/youtube.js.map +1 -0
- package/mcp-server/dist/tui.d.ts +3 -0
- package/mcp-server/dist/tui.d.ts.map +1 -0
- package/mcp-server/dist/tui.js +806 -0
- package/mcp-server/dist/tui.js.map +1 -0
- package/mcp-server/dist/types.d.ts +77 -0
- package/mcp-server/dist/types.d.ts.map +1 -0
- package/mcp-server/dist/types.js +2 -0
- package/mcp-server/dist/types.js.map +1 -0
- package/mcp-server/package-lock.json +4798 -0
- package/mcp-server/package.json +55 -38
- package/mcp-server/run.mjs +12 -2
- package/mcp-server/src/config.ts +48 -3
- package/mcp-server/src/http.ts +296 -93
- package/mcp-server/src/index.ts +546 -203
- package/mcp-server/src/preload-http.ts +19 -18
- package/mcp-server/src/preload.ts +19 -18
- package/mcp-server/src/scripts/setup-embeddings.ts +9 -0
- package/mcp-server/src/services/assistant-judgments.ts +157 -0
- package/mcp-server/src/services/browser-assist-gate.ts +383 -0
- package/mcp-server/src/services/browser-assist.ts +267 -0
- package/mcp-server/src/services/browser-bench.ts +477 -0
- package/mcp-server/src/services/browser-judgments.ts +414 -0
- package/mcp-server/src/services/browser-risk.ts +484 -0
- package/mcp-server/src/services/categories.ts +36 -19
- package/mcp-server/src/services/codex-config-heal.ts +403 -0
- package/mcp-server/src/services/desktop-assist-gate.ts +251 -0
- package/mcp-server/src/services/desktop-assist.ts +308 -0
- package/mcp-server/src/services/desktop-bench.ts +372 -0
- package/mcp-server/src/services/desktop-client.ts +76 -0
- package/mcp-server/src/services/desktop-judgments.ts +218 -0
- package/mcp-server/src/services/desktop-risk.ts +743 -0
- package/mcp-server/src/services/edit-stale.ts +299 -0
- package/mcp-server/src/services/embedding-service.ts +108 -0
- package/mcp-server/src/services/embedding-worker.ts +46 -0
- package/mcp-server/src/services/fb-regions.ts +221 -0
- package/mcp-server/src/services/file-checksums.ts +26 -9
- package/mcp-server/src/services/file-excerpt.ts +59 -0
- package/mcp-server/src/services/identity.ts +291 -0
- package/mcp-server/src/services/local-embeddings.ts +2 -77
- package/mcp-server/src/services/memory-client.ts +23 -0
- package/mcp-server/src/services/memory-judge-backfill.ts +462 -0
- package/mcp-server/src/services/memory-judgments.ts +901 -0
- package/mcp-server/src/services/memory-maintenance.ts +360 -0
- package/mcp-server/src/services/memory-retrieval.ts +349 -0
- package/mcp-server/src/services/memory-schema.ts +280 -0
- package/mcp-server/src/services/memory-sessions.ts +87 -0
- package/mcp-server/src/services/memory-triage.ts +182 -0
- package/mcp-server/src/services/memory-verification.ts +68 -0
- package/mcp-server/src/services/memory-writer.ts +125 -0
- package/mcp-server/src/services/neural-interface.ts +1217 -73
- package/mcp-server/src/services/profiles.ts +428 -0
- package/mcp-server/src/services/secret-gate.ts +52 -0
- package/mcp-server/src/services/server-instructions.ts +122 -0
- package/mcp-server/src/services/sqlite.ts +1456 -823
- package/mcp-server/src/services/typesafe-bench.ts +247 -0
- package/mcp-server/src/services/typesafe-config.ts +790 -0
- package/mcp-server/src/services/typesafe.ts +390 -0
- package/mcp-server/src/services/vector-cache.ts +255 -0
- package/mcp-server/src/services/whiteboard-geometry.ts +711 -0
- package/mcp-server/src/tools/agents.ts +539 -0
- package/mcp-server/src/tools/bluesky.ts +1186 -0
- package/mcp-server/src/tools/browser-advanced.ts +15 -6
- package/mcp-server/src/tools/browser-batch.ts +178 -0
- package/mcp-server/src/tools/browser-cheatsheet.ts +155 -0
- package/mcp-server/src/tools/browser-interact.ts +362 -255
- package/mcp-server/src/tools/browser-navigate.ts +164 -77
- package/mcp-server/src/tools/browser-observe.ts +2222 -1330
- package/mcp-server/src/tools/browser.ts +181 -107
- package/mcp-server/src/tools/card.ts +7 -5
- package/mcp-server/src/tools/choice.ts +103 -0
- package/mcp-server/src/tools/computer.ts +190 -0
- package/mcp-server/src/tools/discord.ts +10 -23
- package/mcp-server/src/tools/fb-groups.ts +387 -0
- package/mcp-server/src/tools/forget.ts +1 -1
- package/mcp-server/src/tools/git.ts +3 -1
- package/mcp-server/src/tools/gsc/experience.ts +440 -0
- package/mcp-server/src/tools/gsc/helpers.ts +288 -0
- package/mcp-server/src/tools/gsc/indexing.ts +495 -0
- package/mcp-server/src/tools/gsc/inspect.ts +391 -0
- package/mcp-server/src/tools/gsc/navigate.ts +236 -0
- package/mcp-server/src/tools/gsc/performance.ts +352 -0
- package/mcp-server/src/tools/gsc/settings.ts +564 -0
- package/mcp-server/src/tools/gsc.ts +95 -0
- package/mcp-server/src/tools/image.ts +3 -1
- package/mcp-server/src/tools/leonardo-browser-tools.ts +47 -37
- package/mcp-server/src/tools/leonardo.ts +7 -5
- package/mcp-server/src/tools/loop.ts +118 -25
- package/mcp-server/src/tools/memories.ts +65 -5
- package/mcp-server/src/tools/morelogin.ts +81 -0
- package/mcp-server/src/tools/profile.ts +122 -0
- package/mcp-server/src/tools/recall.ts +105 -261
- package/mcp-server/src/tools/reflect.ts +171 -145
- package/mcp-server/src/tools/remember.ts +223 -115
- package/mcp-server/src/tools/style-guide-tools.ts +250 -0
- package/mcp-server/src/tools/style-guide.ts +16 -0
- package/mcp-server/src/tools/sync.ts +66 -9
- package/mcp-server/src/tools/tictactoe.ts +3 -1
- package/mcp-server/src/tools/utils.ts +22 -0
- package/mcp-server/src/tools/whiteboard-format.ts +394 -0
- package/mcp-server/src/tools/whiteboard-tools.ts +191 -183
- package/mcp-server/src/tools/whiteboard.ts +7 -5
- package/mcp-server/src/tools/youtube/analytics.ts +106 -0
- package/mcp-server/src/tools/youtube/dedup.ts +57 -0
- package/mcp-server/src/tools/youtube/download.ts +41 -0
- package/mcp-server/src/tools/youtube/helpers.ts +183 -0
- package/mcp-server/src/tools/youtube/media.ts +109 -0
- package/mcp-server/src/tools/youtube/metadata.ts +112 -0
- package/mcp-server/src/tools/youtube/navigate.ts +81 -0
- package/mcp-server/src/tools/youtube/playlist.ts +134 -0
- package/mcp-server/src/tools/youtube/schedule.ts +158 -0
- package/mcp-server/src/tools/youtube/source.ts +101 -0
- package/mcp-server/src/tools/youtube/upload.ts +296 -0
- package/mcp-server/src/tools/youtube.ts +47 -0
- package/mcp-server/src/tui.ts +8 -9
- package/neural-interface/games/TicTacToe/1.svg +1 -0
- package/neural-interface/games/TicTacToe/2.svg +1 -0
- package/neural-interface/games/TicTacToe/3.svg +1 -0
- package/neural-interface/games/TicTacToe/4.svg +1 -0
- package/neural-interface/games/TicTacToe/5.svg +1 -0
- package/neural-interface/games/TicTacToe/6.svg +1 -0
- package/neural-interface/games/TicTacToe/7.svg +1 -0
- package/neural-interface/games/TicTacToe/8.svg +1 -0
- package/neural-interface/games/TicTacToe/9.svg +1 -0
- package/neural-interface/games/TicTacToe/Board.svg +1 -0
- package/neural-interface/games/TicTacToe/Circle.svg +1 -0
- package/neural-interface/games/TicTacToe/Cross.svg +1 -0
- package/neural-interface/i18n/en.json +6983 -0
- package/neural-interface/i18n/pt-BR.json +6987 -0
- package/neural-interface/lib/assistant-api.js +1005 -0
- package/neural-interface/lib/assistant-attachments.js +121 -0
- package/neural-interface/lib/assistant-brains/claude.js +207 -0
- package/neural-interface/lib/assistant-brains/codex-browser-policy-hook.mjs +43 -0
- package/neural-interface/lib/assistant-brains/codex-route-gate-hook.mjs +56 -0
- package/neural-interface/lib/assistant-brains/codex.js +213 -0
- package/neural-interface/lib/assistant-brains/opencode-browser-policy.js +47 -0
- package/neural-interface/lib/assistant-brains/opencode-route-gate.js +62 -0
- package/neural-interface/lib/assistant-brains/opencode.js +320 -0
- package/neural-interface/lib/assistant-budget.js +318 -0
- package/neural-interface/lib/assistant-catalog.js +731 -0
- package/neural-interface/lib/assistant-clarify.js +664 -0
- package/neural-interface/lib/assistant-config.js +232 -0
- package/neural-interface/lib/assistant-dispatch.js +2744 -0
- package/neural-interface/lib/assistant-envelope.js +579 -0
- package/neural-interface/lib/assistant-evidence.js +236 -0
- package/neural-interface/lib/assistant-hidden-models.js +272 -0
- package/neural-interface/lib/assistant-jev.js +117 -0
- package/neural-interface/lib/assistant-judgments.js +111 -0
- package/neural-interface/lib/assistant-media.js +335 -0
- package/neural-interface/lib/assistant-memory.js +398 -0
- package/neural-interface/lib/assistant-persona.js +444 -0
- package/neural-interface/lib/assistant-plan-permissions.js +448 -0
- package/neural-interface/lib/assistant-playbooks/design.md +87 -0
- package/neural-interface/lib/assistant-playbooks.js +72 -0
- package/neural-interface/lib/assistant-pricing.js +159 -0
- package/neural-interface/lib/assistant-route-gate-codex.js +163 -0
- package/neural-interface/lib/assistant-route-gate.js +212 -0
- package/neural-interface/lib/assistant-router.js +1324 -0
- package/neural-interface/lib/assistant-runtime.js +3337 -0
- package/neural-interface/lib/assistant-task-prompt.js +472 -0
- package/neural-interface/lib/assistant-usage.js +1688 -0
- package/neural-interface/lib/augmented-path.js +50 -0
- package/neural-interface/lib/automation-storage-migration.js +54 -0
- package/neural-interface/lib/backup-service.js +851 -0
- package/neural-interface/lib/backup-zip-reader.js +262 -0
- package/neural-interface/lib/browser-assist-api.js +41 -0
- package/neural-interface/lib/browser-console.js +176 -0
- package/neural-interface/lib/browser-execution.js +241 -0
- package/neural-interface/lib/browser-extraction.js +191 -0
- package/neural-interface/lib/browser-screenshot.js +399 -0
- package/neural-interface/lib/browser-semantic-context.js +639 -0
- package/neural-interface/lib/browser-snapshots.js +192 -0
- package/neural-interface/lib/browser-tab-recovery.js +119 -0
- package/neural-interface/lib/browser-targets.js +70 -0
- package/neural-interface/lib/browser-tool-policy.js +926 -0
- package/neural-interface/lib/claude-accounts.js +230 -0
- package/neural-interface/lib/claude-agent-bridge.js +3296 -0
- package/neural-interface/lib/claude-bypass-policy.js +99 -0
- package/neural-interface/lib/claude-history.js +429 -0
- package/neural-interface/lib/claude-model-catalog.js +483 -0
- package/neural-interface/lib/claude-panel-requests.js +165 -0
- package/neural-interface/lib/claude-panel-session.js +272 -0
- package/neural-interface/lib/claude-permission-rules.js +153 -0
- package/neural-interface/lib/claude-session-cleanup.js +71 -0
- package/neural-interface/lib/claude-session-list.js +82 -0
- package/neural-interface/lib/claude-session-ops.js +140 -0
- package/neural-interface/lib/claude-settings-view.js +51 -0
- package/neural-interface/lib/claude-skin-connect.js +79 -0
- package/neural-interface/lib/claude-stall-policy.js +7 -0
- package/neural-interface/lib/claude-temporary.js +435 -0
- package/neural-interface/lib/cli-update-planner.js +312 -0
- package/neural-interface/lib/codex-capabilities.d.ts +41 -0
- package/neural-interface/lib/codex-capabilities.js +148 -0
- package/neural-interface/lib/codex-collaboration-mode.js +17 -0
- package/neural-interface/lib/codex-compat-rpc.js +241 -0
- package/neural-interface/lib/codex-mcp-approvals.js +56 -0
- package/neural-interface/lib/codex-mcp-apps.js +47 -0
- package/neural-interface/lib/codex-model-context.js +202 -0
- package/neural-interface/lib/codex-plan-store.js +71 -0
- package/neural-interface/lib/codex-request-journal.js +242 -0
- package/neural-interface/lib/codex-runtime-path.js +213 -0
- package/neural-interface/lib/codex-session-catalog.js +231 -0
- package/neural-interface/lib/codex-session-settings.js +46 -0
- package/neural-interface/lib/codex-sidepanel-permissions.js +110 -0
- package/neural-interface/lib/codex-thread-history.js +165 -0
- package/neural-interface/lib/codex-user-verification.js +34 -0
- package/neural-interface/lib/codex-writer-lifecycle.js +152 -0
- package/neural-interface/lib/confined-fs.js +256 -0
- package/neural-interface/lib/db.js +922 -0
- package/neural-interface/lib/design-md.js +9 -0
- package/neural-interface/lib/desktop/api.js +92 -0
- package/neural-interface/lib/desktop/audit.js +62 -0
- package/neural-interface/lib/desktop/build.js +423 -0
- package/neural-interface/lib/desktop/config.js +606 -0
- package/neural-interface/lib/desktop/coords.js +76 -0
- package/neural-interface/lib/desktop/fake-helper.js +1192 -0
- package/neural-interface/lib/desktop/frames.js +77 -0
- package/neural-interface/lib/desktop/grants.js +84 -0
- package/neural-interface/lib/desktop/guards.js +170 -0
- package/neural-interface/lib/desktop/helper/SynabunDesktop.swift +3056 -0
- package/neural-interface/lib/desktop/lease.js +51 -0
- package/neural-interface/lib/desktop/manager.js +545 -0
- package/neural-interface/lib/desktop/press-contexts.js +103 -0
- package/neural-interface/lib/desktop/protocol.js +495 -0
- package/neural-interface/lib/desktop/service.js +1202 -0
- package/neural-interface/lib/effort-levels.js +148 -0
- package/neural-interface/lib/event-loop-monitor.js +67 -0
- package/neural-interface/lib/exec-loop-command.js +209 -0
- package/neural-interface/lib/folder-picker.ps1 +77 -0
- package/neural-interface/lib/http-guards.js +287 -0
- package/neural-interface/lib/jsonl-lines.js +94 -0
- package/neural-interface/lib/loop-logger.js +127 -0
- package/neural-interface/lib/mcp-client-config.js +133 -0
- package/neural-interface/lib/mcp-installer.js +487 -0
- package/neural-interface/lib/mcp-profile-refresh-coordinator.js +78 -0
- package/neural-interface/lib/mcp-profile-servers.js +120 -0
- package/neural-interface/lib/memo-cache.js +84 -0
- package/neural-interface/lib/memory-api.js +758 -0
- package/neural-interface/lib/memory-map-api.js +1150 -0
- package/neural-interface/lib/memory-map-layout.js +872 -0
- package/neural-interface/lib/memory-map-worker.js +165 -0
- package/neural-interface/lib/memory-session-capture.js +81 -0
- package/neural-interface/lib/memory-timers.js +62 -0
- package/neural-interface/lib/morelogin.js +301 -0
- package/neural-interface/lib/native-binary-runtime.js +650 -0
- package/neural-interface/lib/native-loop-goal.js +33 -0
- package/neural-interface/lib/native-loop-providers.js +1016 -0
- package/neural-interface/lib/native-loop-runtime.js +747 -0
- package/neural-interface/lib/opencode-hidden-models.js +113 -0
- package/neural-interface/lib/opencode-history.js +253 -0
- package/neural-interface/lib/opencode-runtime-config.js +58 -0
- package/neural-interface/lib/opencode-v2-client.js +486 -0
- package/neural-interface/lib/opencode-v2-ws-requests.js +955 -0
- package/neural-interface/lib/path-confine.js +213 -0
- package/neural-interface/lib/plugin-installer.js +264 -0
- package/neural-interface/lib/project-storage.js +766 -0
- package/neural-interface/lib/pty-host/core.js +603 -0
- package/neural-interface/lib/pty-host/flow.js +43 -0
- package/neural-interface/lib/pty-host/host.js +47 -0
- package/neural-interface/lib/pty-host/manager.js +360 -0
- package/neural-interface/lib/pty-host/protocol.js +81 -0
- package/neural-interface/lib/pty-host/snapshot.js +133 -0
- package/neural-interface/lib/remote-policy.js +582 -0
- package/neural-interface/lib/rulesets/api.js +175 -0
- package/neural-interface/lib/rulesets/fs-safe.js +245 -0
- package/neural-interface/lib/rulesets/installer.js +1453 -0
- package/neural-interface/lib/rulesets/json-edit.js +186 -0
- package/neural-interface/lib/rulesets/lock.js +170 -0
- package/neural-interface/lib/rulesets/managed-text.js +314 -0
- package/neural-interface/lib/rulesets/normalise.js +24 -0
- package/neural-interface/lib/rulesets/render.js +84 -0
- package/neural-interface/lib/schedule-launch-intent.js +40 -0
- package/neural-interface/lib/session-cache-builder.js +524 -0
- package/neural-interface/lib/session-chunker.js +344 -0
- package/neural-interface/lib/session-indexer.js +327 -0
- package/neural-interface/lib/session-title-generator.js +227 -0
- package/neural-interface/lib/skill-prompt-bridge.js +11 -0
- package/neural-interface/lib/style-guide/api.js +375 -0
- package/neural-interface/lib/style-guide/color.js +352 -0
- package/neural-interface/lib/style-guide/export-css.js +99 -0
- package/neural-interface/lib/style-guide/export-dtcg.js +209 -0
- package/neural-interface/lib/style-guide/export-tailwind.js +102 -0
- package/neural-interface/lib/style-guide/fonts.json +227 -0
- package/neural-interface/lib/style-guide/import.js +1268 -0
- package/neural-interface/lib/style-guide/pointers.js +103 -0
- package/neural-interface/lib/style-guide/presets.js +232 -0
- package/neural-interface/lib/style-guide/render-design-md.js +319 -0
- package/neural-interface/lib/style-guide/schema.js +848 -0
- package/neural-interface/lib/style-guide/security.js +43 -0
- package/neural-interface/lib/style-guide/store.js +491 -0
- package/neural-interface/lib/style-guide/summary.js +106 -0
- package/neural-interface/lib/style-guide/tokens.js +170 -0
- package/neural-interface/lib/synabun-update-plan.js +305 -0
- package/neural-interface/lib/synabun-version.js +179 -0
- package/neural-interface/lib/system-restore.js +99 -0
- package/neural-interface/lib/terminal-env.js +86 -0
- package/neural-interface/lib/ui-blob-store.js +106 -0
- package/neural-interface/lib/vector-cache.js +2 -0
- package/neural-interface/lib/virtual-socket.js +60 -0
- package/neural-interface/lib/whatsapp/api.js +146 -0
- package/neural-interface/lib/whatsapp/auth-store.js +389 -0
- package/neural-interface/lib/whatsapp/baileys-adapter.js +457 -0
- package/neural-interface/lib/whatsapp/brain.js +128 -0
- package/neural-interface/lib/whatsapp/bridge.js +1499 -0
- package/neural-interface/lib/whatsapp/cards.js +519 -0
- package/neural-interface/lib/whatsapp/commands.js +92 -0
- package/neural-interface/lib/whatsapp/config.js +291 -0
- package/neural-interface/lib/whatsapp/connector/entry.mjs +25 -0
- package/neural-interface/lib/whatsapp/connector/manifest.json +6 -0
- package/neural-interface/lib/whatsapp/connector/npm-shrinkwrap.json +717 -0
- package/neural-interface/lib/whatsapp/connector/package.json +8 -0
- package/neural-interface/lib/whatsapp/fake-baileys.js +444 -0
- package/neural-interface/lib/whatsapp/format.js +552 -0
- package/neural-interface/lib/whatsapp/host-core.js +1225 -0
- package/neural-interface/lib/whatsapp/host.js +119 -0
- package/neural-interface/lib/whatsapp/identity.js +288 -0
- package/neural-interface/lib/whatsapp/inbound.js +149 -0
- package/neural-interface/lib/whatsapp/installer.js +562 -0
- package/neural-interface/lib/whatsapp/manager.js +638 -0
- package/neural-interface/lib/whatsapp/paths.js +81 -0
- package/neural-interface/lib/whatsapp/protocol.js +327 -0
- package/neural-interface/lib/whatsapp/qr-svg.js +57 -0
- package/neural-interface/lib/whatsapp/redact.js +130 -0
- package/neural-interface/lib/whatsapp/service.js +1305 -0
- package/neural-interface/lib/whatsapp/vendor/qrcodegen.js +848 -0
- package/neural-interface/package-lock.json +4682 -0
- package/neural-interface/package.json +58 -27
- package/neural-interface/public/apple-touch-icon.png +0 -0
- package/neural-interface/public/category-logos/synabun.png +0 -0
- package/neural-interface/public/claude.svg +1 -0
- package/neural-interface/public/favicon-16x16.png +0 -0
- package/neural-interface/public/favicon-32x32.png +0 -0
- package/neural-interface/public/icon-192.png +0 -0
- package/neural-interface/public/icon-512.png +0 -0
- package/neural-interface/public/index.html +32 -182
- package/neural-interface/public/index2d.html +2 -2
- package/neural-interface/public/logo-synabun.png +0 -0
- package/neural-interface/public/logoHD.png +0 -0
- package/neural-interface/public/mcp.svg +4 -0
- package/neural-interface/public/offline.html +335 -299
- package/neural-interface/public/onboarding.html +692 -155
- package/neural-interface/public/opencode-logo-dark-square.svg +1 -0
- package/neural-interface/public/shared/agent-runtime-options.js +596 -0
- package/neural-interface/public/shared/api.js +339 -28
- package/neural-interface/public/shared/assistant/asst-accounts.js +318 -0
- package/neural-interface/public/shared/assistant/asst-agents-dock.js +296 -0
- package/neural-interface/public/shared/assistant/asst-api.js +270 -0
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +744 -0
- package/neural-interface/public/shared/assistant/asst-budget.js +333 -0
- package/neural-interface/public/shared/assistant/asst-composer.js +656 -0
- package/neural-interface/public/shared/assistant/asst-computer.js +803 -0
- package/neural-interface/public/shared/assistant/asst-control.js +1018 -0
- package/neural-interface/public/shared/assistant/asst-hosts.js +262 -0
- package/neural-interface/public/shared/assistant/asst-mascot.js +311 -0
- package/neural-interface/public/shared/assistant/asst-menu.js +375 -0
- package/neural-interface/public/shared/assistant/asst-panel.js +1845 -0
- package/neural-interface/public/shared/assistant/asst-rack-styles.js +589 -0
- package/neural-interface/public/shared/assistant/asst-render.js +3296 -0
- package/neural-interface/public/shared/assistant/asst-route.js +1653 -0
- package/neural-interface/public/shared/assistant/asst-roving.js +75 -0
- package/neural-interface/public/shared/assistant/asst-sanitize.js +117 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel-styles.js +488 -0
- package/neural-interface/public/shared/assistant/asst-sidepanel.js +675 -0
- package/neural-interface/public/shared/assistant/asst-slash.js +258 -0
- package/neural-interface/public/shared/assistant/asst-state.js +727 -0
- package/neural-interface/public/shared/assistant/asst-styles.js +1684 -0
- package/neural-interface/public/shared/assistant/asst-tool-kinds.js +1017 -0
- package/neural-interface/public/shared/assistant/asst-usage.js +444 -0
- package/neural-interface/public/shared/assistant/asst-ws.js +175 -0
- package/neural-interface/public/shared/automation-context.js +75 -0
- package/neural-interface/public/shared/blob-store.js +99 -0
- package/neural-interface/public/shared/cdx/cdx-capabilities.js +118 -0
- package/neural-interface/public/shared/cdx/cdx-cards.js +37 -0
- package/neural-interface/public/shared/cdx/cdx-commands.js +171 -0
- package/neural-interface/public/shared/cdx/cdx-context-menu.js +402 -0
- package/neural-interface/public/shared/cdx/cdx-context-model.js +220 -0
- package/neural-interface/public/shared/cdx/cdx-features.js +408 -0
- package/neural-interface/public/shared/cdx/cdx-icons.js +89 -0
- package/neural-interface/public/shared/cdx/cdx-mcp-app-host.js +414 -0
- package/neural-interface/public/shared/cdx/cdx-mcp-app-proxy.html +6 -0
- package/neural-interface/public/shared/cdx/cdx-mcp-app-proxy.js +56 -0
- package/neural-interface/public/shared/cdx/cdx-mcp-app.js +178 -0
- package/neural-interface/public/shared/cdx/cdx-model-catalog.js +120 -0
- package/neural-interface/public/shared/cdx/cdx-output-model.js +261 -0
- package/neural-interface/public/shared/cdx/cdx-output.js +382 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +1372 -0
- package/neural-interface/public/shared/cdx/cdx-plan.js +266 -0
- package/neural-interface/public/shared/cdx/cdx-protocol.js +682 -0
- package/neural-interface/public/shared/cdx/cdx-render.js +3381 -0
- package/neural-interface/public/shared/cdx/cdx-requests.js +1136 -0
- package/neural-interface/public/shared/cdx/cdx-styles.js +3251 -0
- package/neural-interface/public/shared/cdx/cdx-tabs.js +7992 -0
- package/neural-interface/public/shared/cdx/cdx-ws.js +363 -0
- package/neural-interface/public/shared/cli-status.js +169 -0
- package/neural-interface/public/shared/constants.js +22 -5
- package/neural-interface/public/shared/cp/cp-agents.js +186 -0
- package/neural-interface/public/shared/cp/cp-bash.js +252 -0
- package/neural-interface/public/shared/cp/cp-compose.js +159 -0
- package/neural-interface/public/shared/cp/cp-context-menu.js +309 -0
- package/neural-interface/public/shared/cp/cp-context-model.js +157 -0
- package/neural-interface/public/shared/cp/cp-context-window.js +80 -0
- package/neural-interface/public/shared/cp/cp-ctx.js +11 -0
- package/neural-interface/public/shared/cp/cp-diff.js +255 -0
- package/neural-interface/public/shared/cp/cp-event-rows.js +637 -0
- package/neural-interface/public/shared/cp/cp-events.js +846 -0
- package/neural-interface/public/shared/cp/cp-markdown.js +104 -0
- package/neural-interface/public/shared/cp/cp-permission-model.js +905 -0
- package/neural-interface/public/shared/cp/cp-permissions.js +626 -0
- package/neural-interface/public/shared/cp/cp-rehydrate.js +113 -0
- package/neural-interface/public/shared/cp/cp-restore.js +224 -0
- package/neural-interface/public/shared/cp/cp-session-model.js +338 -0
- package/neural-interface/public/shared/cp/cp-session-settings.js +254 -0
- package/neural-interface/public/shared/cp/cp-sessions.js +227 -0
- package/neural-interface/public/shared/cp/cp-statusline.js +153 -0
- package/neural-interface/public/shared/cp/cp-styles.js +349 -0
- package/neural-interface/public/shared/cp/cp-tasks-model.js +282 -0
- package/neural-interface/public/shared/cp/cp-tasks.js +107 -0
- package/neural-interface/public/shared/cp/cp-temporary-view.js +56 -0
- package/neural-interface/public/shared/cp/cp-temporary.js +231 -0
- package/neural-interface/public/shared/cp/cp-tool-cards.js +326 -0
- package/neural-interface/public/shared/cp/cp-tool-results.js +618 -0
- package/neural-interface/public/shared/cp/cp-usage-model.js +124 -0
- package/neural-interface/public/shared/graph-activity.js +68 -0
- package/neural-interface/public/shared/html-shell.js +107 -12
- package/neural-interface/public/shared/i18n.js +132 -34
- package/neural-interface/public/shared/node-positions-store.js +44 -0
- package/neural-interface/public/shared/ocp-hidden-models.js +116 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-approvals.js +355 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-autoaccept-button.js +35 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-automation-ownership.js +72 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-binding.js +280 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-caps.js +67 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-changes-logic.js +179 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-changes.js +164 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +725 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-compact-button.js +75 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-composer-logic.js +1204 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-confirm-logic.js +117 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-confirm.js +59 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-gauge.js +252 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-menu.js +478 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-context-model.js +179 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +233 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-icons.js +30 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-manager.js +1065 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-mention-hints.js +182 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-modelpicker.js +655 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +2636 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-plan.js +601 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-profile-inheritance.js +78 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-projectbar.js +649 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-providers.js +35 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-rehydrate.js +357 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render-logic.js +189 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +1869 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-select.js +42 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send-logic.js +117 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +1714 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-actions.js +468 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-session-widgets.js +63 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-sessions-logic.js +366 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-settings-link.js +19 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-slash-hints.js +343 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-state.js +746 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-status-logic.js +347 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-status.js +338 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +3543 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-subagents-logic.js +482 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-tools-logic.js +351 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-tools.js +168 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-variantpicker.js +315 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +545 -0
- package/neural-interface/public/shared/provider-icons.js +30 -0
- package/neural-interface/public/shared/session-title.js +100 -0
- package/neural-interface/public/shared/settings/settings-ia.js +389 -0
- package/neural-interface/public/shared/settings/settings-kit.js +234 -0
- package/neural-interface/public/shared/settings/settings-search.js +463 -0
- package/neural-interface/public/shared/settings/settings-shell.js +570 -0
- package/neural-interface/public/shared/state.js +5 -0
- package/neural-interface/public/shared/storage.js +50 -7
- package/neural-interface/public/shared/styleguide/sg-agents.js +42 -0
- package/neural-interface/public/shared/styleguide/sg-brand.js +4 -0
- package/neural-interface/public/shared/styleguide/sg-color-client.js +388 -0
- package/neural-interface/public/shared/styleguide/sg-colors.js +148 -0
- package/neural-interface/public/shared/styleguide/sg-components.js +35 -0
- package/neural-interface/public/shared/styleguide/sg-history.js +41 -0
- package/neural-interface/public/shared/styleguide/sg-icons-logo.js +38 -0
- package/neural-interface/public/shared/styleguide/sg-imagery.js +4 -0
- package/neural-interface/public/shared/styleguide/sg-import-export.js +47 -0
- package/neural-interface/public/shared/styleguide/sg-kit.js +281 -0
- package/neural-interface/public/shared/styleguide/sg-labels.js +318 -0
- package/neural-interface/public/shared/styleguide/sg-layout.js +4 -0
- package/neural-interface/public/shared/styleguide/sg-motion.js +5 -0
- package/neural-interface/public/shared/styleguide/sg-panel.js +229 -0
- package/neural-interface/public/shared/styleguide/sg-preview.js +138 -0
- package/neural-interface/public/shared/styleguide/sg-rules.js +9 -0
- package/neural-interface/public/shared/styleguide/sg-shape.js +24 -0
- package/neural-interface/public/shared/styleguide/sg-state.js +132 -0
- package/neural-interface/public/shared/styleguide/sg-typography.js +124 -0
- package/neural-interface/public/shared/styles.css +7883 -1155
- package/neural-interface/public/shared/synabun-mascot.js +1625 -0
- package/neural-interface/public/shared/synabun-ticker.js +376 -0
- package/neural-interface/public/shared/term-renderer.js +343 -0
- package/neural-interface/public/shared/ui-assistant-panel.js +10 -0
- package/neural-interface/public/shared/ui-assistant.js +77 -0
- package/neural-interface/public/shared/ui-automation-studio.js +5105 -3573
- package/neural-interface/public/shared/ui-claude-panel.js +11685 -6333
- package/neural-interface/public/shared/ui-codex-panel.js +12 -0
- package/neural-interface/public/shared/ui-cost-widget.js +55 -34
- package/neural-interface/public/shared/ui-detail.js +77 -14
- package/neural-interface/public/shared/ui-explorer.js +360 -181
- package/neural-interface/public/shared/ui-file-explorer.js +485 -107
- package/neural-interface/public/shared/ui-help.js +2 -2
- package/neural-interface/public/shared/ui-image-gallery.js +45 -21
- package/neural-interface/public/shared/ui-judgments.js +1346 -0
- package/neural-interface/public/shared/ui-keybinds.js +3 -2
- package/neural-interface/public/shared/ui-link.js +105 -51
- package/neural-interface/public/shared/ui-loading.js +4 -4
- package/neural-interface/public/shared/ui-memory-maintenance.js +111 -0
- package/neural-interface/public/shared/ui-menubar.js +89 -4
- package/neural-interface/public/shared/ui-native-loop-router-state.js +94 -0
- package/neural-interface/public/shared/ui-native-loop-router.js +493 -0
- package/neural-interface/public/shared/ui-native-window-id.js +7 -0
- package/neural-interface/public/shared/ui-navbar.js +357 -222
- package/neural-interface/public/shared/ui-notifications.js +58 -12
- package/neural-interface/public/shared/ui-opencode-panel-v2.js +17 -0
- package/neural-interface/public/shared/ui-panels.js +15 -7
- package/neural-interface/public/shared/ui-resume.js +823 -653
- package/neural-interface/public/shared/ui-schedule-queue.js +172 -0
- package/neural-interface/public/shared/ui-schedules-studio.js +1882 -0
- package/neural-interface/public/shared/ui-scroll-follow.js +194 -0
- package/neural-interface/public/shared/ui-sessions.js +789 -34
- package/neural-interface/public/shared/ui-settings.js +5793 -2190
- package/neural-interface/public/shared/ui-sidepanel-layout.js +109 -0
- package/neural-interface/public/shared/ui-sidepanel-runtime.js +19 -0
- package/neural-interface/public/shared/ui-sidepanel-session-entry.js +40 -0
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +221 -0
- package/neural-interface/public/shared/ui-sidepanel-state.js +131 -0
- package/neural-interface/public/shared/ui-sidepanel-tray.js +547 -0
- package/neural-interface/public/shared/ui-sidepanel-windows.js +387 -0
- package/neural-interface/public/shared/ui-skills.js +18 -32
- package/neural-interface/public/shared/ui-styleguide.js +35 -0
- package/neural-interface/public/shared/ui-sync.js +87 -0
- package/neural-interface/public/shared/ui-terminal.js +7877 -6385
- package/neural-interface/public/shared/ui-tool-updates.js +292 -0
- package/neural-interface/public/shared/ui-tooltip.js +156 -15
- package/neural-interface/public/shared/ui-tutorial-draw.js +119 -683
- package/neural-interface/public/shared/ui-tutorial-layout.js +135 -0
- package/neural-interface/public/shared/ui-tutorial-steps.js +59 -2209
- package/neural-interface/public/shared/ui-tutorial.css +102 -0
- package/neural-interface/public/shared/ui-tutorial.js +557 -1076
- package/neural-interface/public/shared/ui-update.js +420 -68
- package/neural-interface/public/shared/ui-whatsapp.js +941 -0
- package/neural-interface/public/shared/ui-whiteboard.js +1076 -233
- package/neural-interface/public/shared/ui-workspaces.js +2 -1
- package/neural-interface/public/shared/utils.js +58 -0
- package/neural-interface/public/shared/vterm-buffer.js +15 -5
- package/neural-interface/public/shared/whatsapp/wa-phone.js +65 -0
- package/neural-interface/public/shared/whatsapp/wa-view.js +411 -0
- package/neural-interface/public/sidepanel-session.html +18 -0
- package/neural-interface/public/sw.js +8 -2
- package/neural-interface/public/synabun.png +0 -0
- package/neural-interface/public/variant/2d/graph.js +1707 -1635
- package/neural-interface/public/variant/2d/lasso.js +2 -1
- package/neural-interface/public/variant/2d/layout.js +595 -594
- package/neural-interface/public/variant/2d/main.js +556 -521
- package/neural-interface/public/variant/2d/settings-gfx.js +18 -24
- package/neural-interface/public/variant/3d/main.js +516 -500
- package/neural-interface/public/variant/3d/map-controls.js +144 -0
- package/neural-interface/public/variant/3d/map-data.js +251 -0
- package/neural-interface/public/variant/3d/map-labels.js +241 -0
- package/neural-interface/public/variant/3d/map-pick.js +90 -0
- package/neural-interface/public/variant/3d/map-renderer.js +521 -0
- package/neural-interface/public/variant/3d/map-shaders.js +158 -0
- package/neural-interface/public/variant/3d/map-view.js +618 -0
- package/neural-interface/public/vendor/three/manifest.json +3 -0
- package/neural-interface/public/vendor/three/three-0.169.0.min.js +3844 -0
- package/neural-interface/public/vendor/xterm/manifest.json +3 -0
- package/neural-interface/public/vendor/xterm/xterm-6.0.0.css +285 -0
- package/neural-interface/public/vendor/xterm/xterm-6.0.0.min.js +192 -0
- package/neural-interface/scripts/build-vendor.mjs +64 -0
- package/neural-interface/scripts/codex-protocol-fixture.mjs +83 -0
- package/neural-interface/scripts/rebuild-pty.js +37 -23
- package/neural-interface/scripts/vendor-three-entry.js +24 -0
- package/neural-interface/scripts/vendor-xterm-entry.js +8 -0
- package/neural-interface/server.js +33948 -15000
- package/neural-interface/skins/default/skin.css +90 -0
- package/neural-interface/skins/default/skin.json +8 -0
- package/neural-interface/templates/rulesets/README.md +9 -0
- package/neural-interface/templates/rulesets/claude.md +3 -0
- package/neural-interface/templates/rulesets/codex.md +2 -0
- package/neural-interface/templates/rulesets/coexistence.md +6 -0
- package/neural-interface/templates/rulesets/core.md +26 -0
- package/neural-interface/templates/rulesets/cursor.md +2 -0
- package/neural-interface/templates/rulesets/gemini.md +2 -0
- package/neural-interface/templates/rulesets/legacy-hashes.json +227 -0
- package/neural-interface/templates/rulesets/manifest.json +12 -0
- package/neural-interface/templates/rulesets/opencode.md +2 -0
- package/package.json +119 -53
- package/postinstall.js +125 -26
- package/preuninstall.js +187 -0
- package/scripts/audit-claude-hook-usage.mjs +12 -0
- package/scripts/audit-memory-duplicates.mjs +44 -0
- package/scripts/measure-claude-hook-overhead.mjs +77 -0
- package/scripts/recover-user-config.mjs +254 -0
- package/scripts/restore-data-home-from-backup.mjs +239 -0
- package/setup.js +804 -260
- package/skills/leonardo/SKILL.md +19 -10
- package/skills/leonardo/modules/image-prompter.md +18 -12
- package/skills/leonardo/modules/video-prompter.md +19 -13
- package/skills/synabun/SKILL.md +209 -185
- package/skills/synabun/icon.png +0 -0
- package/skills/synabun/modules/audit.md +380 -374
- package/skills/synabun/modules/changelog.md +15 -6
- package/skills/synabun/modules/idea.md +148 -144
- package/skills/synabun/modules/memorize.md +13 -4
- package/skills/synabun/modules/schedule.md +198 -0
- package/skills/synabun/synabunicon.png +0 -0
- package/updater.cmd +31 -0
- package/updater.mjs +382 -0
- package/updater.sh +29 -0
- package/hooks/claude-code/test-user-learning.mjs +0 -531
- package/neural-interface/public/claude-chat.css +0 -878
- package/neural-interface/public/claude-chat.html +0 -92
- package/neural-interface/public/claude-chat.js +0 -1168
- package/neural-interface/public/index-legacy.html +0 -14677
- package/neural-interface/public/index2d-legacy.html +0 -8193
- package/neural-interface/public/shared/html-term-renderer.js +0 -1022
- package/neural-interface/public/variant/3d/background.js +0 -884
- package/neural-interface/public/variant/3d/camera.js +0 -661
- package/neural-interface/public/variant/3d/gfx.js +0 -116
- package/neural-interface/public/variant/3d/graph.js +0 -2399
- package/neural-interface/public/variant/3d/settings-gfx.js +0 -228
- package/neural-interface/templates/CLAUDE-template.md +0 -211
package/bin/synabun.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const packageRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
8
|
+
const setupPath = resolve(packageRoot, 'setup.js');
|
|
9
|
+
const child = spawn(process.execPath, [
|
|
10
|
+
'--disable-warning=ExperimentalWarning',
|
|
11
|
+
setupPath,
|
|
12
|
+
...process.argv.slice(2),
|
|
13
|
+
], {
|
|
14
|
+
cwd: process.cwd(),
|
|
15
|
+
env: process.env,
|
|
16
|
+
stdio: 'inherit',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
child.on('error', error => {
|
|
20
|
+
console.error(`Could not start SynaBun: ${error.message}`);
|
|
21
|
+
process.exitCode = 1;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
child.on('exit', (code, signal) => {
|
|
25
|
+
if (signal) {
|
|
26
|
+
process.kill(process.pid, signal);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
process.exitCode = code ?? 1;
|
|
30
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Browser execution and efficiency
|
|
2
|
+
|
|
3
|
+
SynaBun still uses its configured browser and the existing MCP tools. This change fixes action correctness and enables the faster browser path by default in version **2.0.0**, for general browsing and social automations.
|
|
4
|
+
|
|
5
|
+
## Rollout
|
|
6
|
+
|
|
7
|
+
Correctness fixes apply after the updated Neural Interface and MCP processes restart: compatible delivered snapshot baselines, cancellation/deadline handling, ref-aware publishing guards, caller/tab ownership checks, and protection against selectors changing targets during pacing.
|
|
8
|
+
|
|
9
|
+
Performance changes are **on by default**; no opt-in variable is needed. After the updated Neural Interface and MCP processes restart, this enables bounded automatic snapshot capture, cached session routing, server-side paged extraction, omission of non-writing think pauses, and registration of `browser_batch`. Leave existing `SYNABUN_BROWSER_FAST`, `SYNABUN_BROWSER_COMPACT` and `SYNABUN_BROWSER_AUTOSNAPSHOT` settings as they are.
|
|
10
|
+
|
|
11
|
+
For rollback, set `SYNABUN_BROWSER_V2=0` in the environment used by **both Neural Interface and its MCP processes**, then restart them normally. Remove that override to return to the new default. Correctness fixes remain enabled. No database migration or saved automation rewrite is required. This implementation does not change the running service's environment or restart active automations.
|
|
12
|
+
|
|
13
|
+
Social engagement writes retain the existing randomized 30–90-second spacing, serialized within each browser session. It applies to the resolved target whether the caller uses refs or selectors. A blocked preflight does not consume a write slot; an attempted write with an uncertain outcome does. Typing cadence is preserved.
|
|
14
|
+
|
|
15
|
+
## Interfaces and workflow
|
|
16
|
+
|
|
17
|
+
- `browser_snapshot` accepts optional `baselineId` and returns a compact snapshot ID. A diff requires a compatible delivered observation from the same caller, page generation, scope, depth settings and budget. Removals are explicit. `force:true` requests a full view. Aborted requests never establish a baseline.
|
|
18
|
+
- Navigation, click and scroll observations use the same budget at capture and formatting. Click defaults to 6,000 characters; navigation and scroll use 12,000; explicit snapshots retain 30,000. Truncation ends at complete lines. V2 automatic captures start at depth 12 and make at most one shallower retry; callers can override depth or scope to inspect deeper controls.
|
|
19
|
+
- Playwright refs identify elements in its latest captured scope. A scoped snapshot can remove previously observed refs from that map. Re-snapshot when a ref is stale; do not assume every previously returned ref remains usable after another capture.
|
|
20
|
+
- Paged `browser_extract_*` tools accept optional `fields` and `maxChars`. Identity deduplication occurs before projection; repeated identities update their fields. Results report stopping reasons and partial failures. Known loading states must finish before newly discovered items are accepted. FB group classification occurs before field projection.
|
|
21
|
+
- `browser_content` accepts `selector` for one element's subtree with plain text or Markdown. Existing offsets and budgets remain supported. Missing/ambiguous scopes return an error. Relative source links are made absolute, and extraction does not modify the live DOM.
|
|
22
|
+
- `browser_batch` accepts 1–10 `{tool,args,observe?}` steps, one `sessionId`/`tabId`, and final `snapshot:full|diff|none` (default `full`). It invokes the existing guarded tool handlers sequentially, validates every step before acting, and returns completed outcomes if a later step fails. Steps cannot change routing or use arbitrary evaluation.
|
|
23
|
+
|
|
24
|
+
### MoreLogin as the default browser
|
|
25
|
+
|
|
26
|
+
While Browser Settings name MoreLogin as the default (`connectMode: "morelogin"`), every loop, schedule, dispatched run, recovery and interactive acquisition drives the default MoreLogin profile (`moreloginEnvId`). Reuse and a caller-requested session count only when the session is MoreLogin on that exact env. If MoreLogin cannot be reached after the auto-launch wait, the run fails and its log, `lastRunResult` and the `schedule:failed` toast carry the reason (`Could not start the shared browser session: MoreLogin connect failed: …`). Nothing falls back to Chrome.
|
|
27
|
+
|
|
28
|
+
The server decides which session may carry pages. `GET /api/browser/sessions` reports `servesDefault` per session and `defaultBrowser` for the list: with MoreLogin as the default only a MoreLogin session on the default env serves it; in managed and real-Chrome setups every session does, so nothing changes there. The MCP requires `servesDefault` for every page tool (navigations, localhost included, platform tools, screenshots, snapshots, content, console, clicks, typing, batches) and a run's pinned browser. A pinned session that does not serve the default fails the call with the reason. Navigations and platform tools drop an explicit id that does not serve it, then resolve the default browser; any other page tool refuses it (`Browser session <id> is not the default browser (…), so SynaBun's browser tools do not act on it`), since the page it names is in the other browser. The server holds the same line at its REST boundary: an agent request (one that carries `X-Synabun-Terminal`, as every MCP call does) on a session that does not serve the default is refused with 409 `NOT_DEFAULT_BROWSER` before anything runs, for any page action, a new tab or CDP; closing the session or a tab and listing its tabs stay allowed, and the Neural Interface's own UI (no header) keeps working with any session. Every `/api/browser` response names the default browser in `X-Synabun-Browser-Default` (`morelogin:<env>`, `other:<mode>`, or `unreadable`), and the MCP keys its route caches on it, so a change of connect mode or MoreLogin env drops every cached route; the in-process MCP is told the moment the settings are saved, and a `NOT_DEFAULT_BROWSER` refusal also forgets the caller's cached route and tab. Affinity, auto-selection and adoption skip it. When Browser V2 recovery of a cached route fails, the action returns the recovery's own reason (for example `MoreLogin connect failed: …`) with `recoveryFailed: true`, not a bare "Session not found".
|
|
29
|
+
|
|
30
|
+
`bluesky_*` tools renew an expired access token themselves. They wait for bsky.app to refresh it (a freshly initialized tab is still booting), then reload the assigned bsky.app tab at most once. "Not logged in" is reported only when the page holds no session. A token the server still rejects gets one renewal and one re-run, and only when nothing was written yet. The whole call has one 48 s deadline, under the roughly 60 s tool limit of OpenCode and Codex. Finding and opening the tab, the token checks, the reload and image uploads must end 12 s before it, so the request itself always has time. A step that runs out of time returns a clear error. A request that doesn't answer in time is reported as possibly finished (check before repeating) and is never retried.
|
|
31
|
+
|
|
32
|
+
#### Localhost in MoreLogin
|
|
33
|
+
|
|
34
|
+
Localhost pages open in the MoreLogin profile like any other page; nothing reroutes them to another browser. MoreLogin's per-profile **Port scan protection** decides which local ports load: a port listed under Edit profile → Advanced settings → Port scan protection (allowed ports, read when the profile starts) loads normally, and any other local port is redirected to `getip.morelogin.com/black_whiteList_stop_page_v2.html?blockedUrl=<url>`. Keep protection on and list the dev-server ports (P-1 allows 3344, 3100, 3210, 3917, 9003 and 9017), then restart the profile. A blocked navigation, back, forward or click fails with `moreLoginBlocked: true` and the stop page's URL, and, for a local port, the error is `MoreLogin blocked localhost:<port>. Most likely the profile's Port scan protection: add <port> to its Advanced settings → Port scan protection allowed ports in MoreLogin. If a URL Access Restriction in MoreLogin's Security Center blocks localhost, remove localhost from that block policy. Then restart the profile.` (other hosts keep the website-whitelist message). A session created at a blocked URL is still created and says so (`moreLoginBlocked`, `notice`). `/api/morelogin/status` counts observed blocks (`blockedNavigations`, `lastBlockedUrl`). The earlier loopback sidecar (system Google Chrome on the leftover `userDataDir`), its page-level handoff and `LOOPBACK_ONLY_SESSION` are gone.
|
|
35
|
+
|
|
36
|
+
#### Screenshots for visual QA
|
|
37
|
+
|
|
38
|
+
`browser_screenshot` (`GET /api/browser/sessions/:id/screenshot-base64`, `lib/browser-screenshot.js`) returns the tab as an image, localhost included. Without options it is the viewport as JPEG (quality 60), downscaled to `maxWidth` (default 1024 px of real pixels; `0` = native resolution). Options:
|
|
39
|
+
|
|
40
|
+
- `width` / `height` (100–4096 CSS px): the viewport for this capture only, as a CDP `Emulation.setDeviceMetricsOverride` (`deviceScaleFactor: 1`, `mobile` below 768 px) sent from a CDP session opened for the capture. Chromium keeps one override per page and a detach alone leaves it in place, so it is always cleared with `Emulation.clearDeviceMetricsOverride`, on errors and timeouts too, and then confirmed: the tab's `innerWidth` and `devicePixelRatio` must equal what they were before the capture. A clear that fails, hangs (2 s) or does not take is sent once more from a fresh CDP session, which first sets an empty override (0 width, height and scale), because Chromium ignores a clear from a session that never set one. A tab still not confirmed is closed (its session's other tabs stay; the only tab's page is closed and the next call opens a fresh one) and the result says so (`tabClosed: true` and a `notice`, or the notice appended to the error), so a MoreLogin tab never keeps a window size, DPR or mobile flag its profile does not have.
|
|
41
|
+
- `fullPage`: the whole document (`captureBeyondViewport`, up to 16384 px; longer pages report `truncated`).
|
|
42
|
+
- `format` (`png` | `jpeg`): the returned image is a JPEG unless PNG is asked for; a saved file is a PNG unless JPEG is asked for (saved JPEG quality 90).
|
|
43
|
+
- `save` / `path`: also write the full-resolution image and return `savedPath`. The default file is `~/.synabun/data/media/screenshots/<yyyy-mm-dd>/<host>-<width>x<height>-<hhmmss>.png` (never an existing file). An explicit `path` must be absolute, end in .png, .jpg or .jpeg, and lie inside a registered project (`claude-code-projects.json`, never one at or above the home folder) or the screenshots folder, resolved through symlinks; parent folders are created, and only an existing PNG or JPEG is ever replaced. The file is checked again as it is written (a capture can take up to a minute): the parent's real path must still lie inside those folders, a symlink or a non-image at the name is refused, the bytes go to a temp file created `O_CREAT | O_EXCL | O_NOFOLLOW` in that real folder, the folder's real path is read again, and a rename puts it in place (a rename replaces a symlink, it never follows one). `savedPath` is the real path written.
|
|
44
|
+
|
|
45
|
+
The returned image never exceeds 7900 px on a side. Its size is measured from a small capture of the same CDP session, not taken from the page's `devicePixelRatio` (a fingerprint value in MoreLogin). The MCP client waits the long timeout (30 s) for it. A saving screenshot is not a read-only call for plan mode and remote read-only sessions (`lib/assistant-plan-permissions.js`).
|
|
46
|
+
|
|
47
|
+
#### Console and page errors
|
|
48
|
+
|
|
49
|
+
`browser_console` (`GET /api/browser/sessions/:id/console?tabId=&level=&since=&limit=&clear=`, `lib/browser-console.js`) reads a per-page ring buffer of the last 200 console messages (`{ kind: "console", level, type, text, location, at }`, network errors such as a 404 script included) and uncaught page errors (`{ kind: "pageerror", level: "error", message, stack, at }`). The buffer is attached before the first navigation of every tab SynaBun registers (a new session, MoreLogin attach included, a new tab, a recovered tab) and follows their popups; attaching twice is a no-op. A popup is not a tab of its session, so its entries come back with the tab that opened it, each with `popup: <the popup's URL at the time>` and in the order they happened (the last 5 popups of a tab, popups of popups too; `popups` counts them, and `clear` empties them with the tab). The MCP shows them as `[popup <url>]`. `level` (`all` | `error` | `warning` | `info` | `log`) keeps that level and the more severe ones; `since` (ISO or epoch ms, e.g. the `latest` of the previous read) keeps newer entries; `limit` (1–200, default 50) returns the newest matches; `clear` empties the buffer after reading. The console arguments' JS handles are released as each message arrives, so a chatty page pins nothing. A tab registered before the buffer existed starts recording on its first read (`attached: false`).
|
|
50
|
+
|
|
51
|
+
#### Browser settings file
|
|
52
|
+
|
|
53
|
+
`browser-config.json` is written atomically (a temp file renamed over it). `loadBrowserConfig()` keeps the text of the last good read or write: when the file is torn, unparsable or not a JSON object it returns that config (logging a warning once per failure streak, then at most once a minute) instead of `{}`, which used to switch MoreLogin mode off for whatever read it at that moment. A missing file is `{}` (the defaults). A file that exists but has never been read well (no earlier good config) is not treated as unconfigured: `loadBrowserConfig()` returns `{}` marked unreadable, `createBrowserSession` refuses with `browser-config.json is unreadable; fix it in Settings → Browser (<reason>)` instead of taking the Chrome path, `GET /api/browser/config` adds `configError`, and saving the settings in Settings → Browser replaces the file.
|
|
54
|
+
|
|
55
|
+
### Jev assistance (advisory)
|
|
56
|
+
|
|
57
|
+
Three TypeSafe surfaces (`browser-page-state`, `browser-target`, `browser-social`; full contract in `docs/judgments.md`) add a typed reading of the page to the tools above. It is text only, bounded, and never part of the control flow: with TypeSafe off, a surface off, a timeout or a rate limit, every tool answers exactly as it did before.
|
|
58
|
+
|
|
59
|
+
- `browser_navigate` accepts optional `intent`. One line may follow the snapshot: `Jev assessment: authentication_required (94%) — pause for human sign-in`. A blocker (`authentication_required`, `verification_required`, `consent_blocker`) means stop and hand over to the human; `loading` means wait and inspect again; a consent dialog is never dismissed automatically. With an `intent`, the line also says whether the page already satisfies it.
|
|
60
|
+
- `browser_snapshot` accepts optional `intent` in AI mode and may append `Jev target: ref e12 "Account settings" (choice 91%, match 96%); alternatives: e15, e31`, or `no candidate qualified`. The refs come from the same capture that was delivered, so the recommendation is a fresh ref. It never executes.
|
|
61
|
+
- A failed or ambiguous `browser_click`, `browser_fill`, `browser_type`, `browser_hover`, `browser_select` or `browser_upload` (the last two now accept `textHint`) returns its usual hints, reordered and annotated with each candidate's risk class when Jev found a confident match. Shadow mode sends no second request: the caller decides and acts with a new call.
|
|
62
|
+
- An empty social extractor keeps its message verbatim as the first line and appends a diagnosis: genuinely empty, still loading, wrong surface, sign-in, verification, consent, or a rendered error. Populated output is byte-identical.
|
|
63
|
+
- `browser_fb_composer_state` and `browser_x_compose_state` add a `judgment` key only when the probe itself is ambiguous. `recommendedAction`, `boostRisk` and the locale lists stay authoritative; a suggested control is a suggestion, and Boost / Promote controls are removed before Jev sees the options.
|
|
64
|
+
- Inside `browser_batch` there is no assistance at all. A batch that navigated gets one `assessment` of its final page after it ends; steps are never added, replaced or replayed.
|
|
65
|
+
|
|
66
|
+
**The one-retry invariant.** Safe auto-heal is off and locked until the browser benchmark passes for the exact running configuration (Settings → AI decisions → Browser assistance). When armed it permits exactly one retry, only for `browser_click`, only when the selector matched nothing or failed to parse, and only onto a plain same-origin navigation link that the server re-verifies on the element it is about to click. It never follows `actionStarted:true`, an uncertain outcome, a transport error, a cancellation or a guard; it never types, submits, publishes, likes, follows, pays, uploads or changes a toggle; a refused, failed or uncertain heal is final. A healed click says so in its result, `(auto-healed via Jev to "Pricing": choice 93%, match 97%; selector … matched nothing)`, and the route's body carries `autoHealed:true`.
|
|
67
|
+
|
|
68
|
+
Page text is adversarial data. It reaches Jev only as `state`, never inside an instruction, and a control whose label addresses the agent disqualifies the whole page from healing.
|
|
69
|
+
|
|
70
|
+
Use extraction for data and scoped snapshots for interaction. Choose fields needed by the task instead of returning avatars/media URLs by default. Use a batch only when the selectors and sequence are already known; otherwise inspect between actions. A local form example, after observing its selectors:
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"steps": [
|
|
75
|
+
{"tool":"browser_fill","args":{"selector":"#email","value":"fixture@example.invalid"}},
|
|
76
|
+
{"tool":"browser_click","args":{"selector":"#save"}}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Tool names inside batches are the unprefixed names shown above. Call the batch itself using the exact host-provided MCP name. Host cancellation stops pending HTTP calls and prevents subsequent batch steps. Never replay a whole batch or an uncertain click; inspect the current state first.
|
|
82
|
+
|
|
83
|
+
## Metrics and measurements
|
|
84
|
+
|
|
85
|
+
Set `SYNABUN_BROWSER_METRICS=1` on the same processes for diagnostic JSON on stderr. Client and server correlate with `X-Synabun-Request-Id` and share an absolute `X-Synabun-Deadline`. Records contain timings, operation names, response sizes and estimated tokens, without URLs, page text, selectors, scripts, form values or credentials. Intentional pacing is reported separately from processing. Metrics are disabled by default.
|
|
86
|
+
|
|
87
|
+
The local benchmark behind these numbers uses isolated Chromium fixtures, no user profiles or external requests, alternates variant order, and runs at least 20 samples per variant for articles, search, dynamic forms, feeds, composers and virtualized extraction. Its report holds cold startup and per-scenario median/p95 processing time, required-data assertions, captures, response bytes and text-token estimates: [browser-v2-results.json](../benchmarks/browser-v2-results.json).
|
|
88
|
+
|
|
89
|
+
The final measured run reduced the sum of scenario median processing times by about **78%**, and estimated output text tokens by **23%**. The largest change was virtualized extraction (about 1.8 seconds to 0.2 seconds for three items). Dense snapshots went from four captures to two. All required fixture data was retained. Optional field projection accounts for the measured output-token saving; it is not an automatic saving on every call.
|
|
90
|
+
|
|
91
|
+
Deferred full-profile server instructions use concise capability summaries instead of repeating the entire tool catalog: **5,289 → 3,219 characters**, approximately **39% less instruction text** (~1,323 → ~805 estimated tokens). Legacy profiled-host instructions remain identical. This separate instruction measurement is not included in the 23% response-token result, and does not measure provider billing or how frequently a particular host injects instructions.
|
|
92
|
+
|
|
93
|
+
These are component measurements, not full MCP/provider automation measurements. HTTP call counts in this fixture report are derived from the implementation, not network instrumentation. Deliberate social write delays and model reasoning time are excluded. Estimates are not provider-billed tokens. The provisional 30% output-token target remains an optimization goal rather than a release blocker. The measured processing and instruction reductions, full automated suites, and read-only real-page checks support the default rollout with an explicit rollback switch. Live checks exercise the updated algorithms through an adapter to the configured SynaBun browser; changed route wiring and mutating actions are verified separately using local Express/Chromium fixtures. They do not establish real-site publishing success, and no live posting is used for validation.
|
|
94
|
+
|
|
95
|
+
## Validation
|
|
96
|
+
|
|
97
|
+
The figures below are from the validation run of this change in September 2026. The suites that ship with 2.0.0 are larger.
|
|
98
|
+
|
|
99
|
+
- Complete Node suite: **520 passed, 0 failed, 1 Windows-only skip**; includes four live Claude bridge scenarios.
|
|
100
|
+
- Complete MCP suite: **130 passed, 0 failed**, including compiled Codex discovery of `browser_batch` with no opt-in.
|
|
101
|
+
- All five local browser/UI suites: **19 passed**, including memory maintenance and sidepanel windows.
|
|
102
|
+
- The MCP test command invokes Vitest through Node, so a launcher file that is not executable does not break it.
|
|
103
|
+
- Real-page checks use a new test tab for each site, scoped snapshots/content and projected extraction without posting. Results and their transport limitations are recorded in [browser-live-results.json](../benchmarks/browser-live-results.json).
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
- Node tests exercise cancellation, actual write spacing, selector ambiguity/identity, snapshot delivery and diffs, extraction completeness, browser recovery and policy contracts.
|
|
107
|
+
- MCP Vitest tests exercise routing isolation, one safe pre-execution recovery, no ambiguous replay, cancellation, batch validation/partial outcomes, extraction projection and snapshot formatting.
|
|
108
|
+
- Browser-driven suites, which are not part of this package, exercise the installed Playwright/Chromium against local fixtures and real Express route handlers. They cover live refs, deletions, reloads, truncation, background-frame deadlines, foreign-tab rejection, guarded publishing, cancelled clicks, replaced targets and hydration before extraction. macOS sandboxed runners may need permission to launch Chromium and bind loopback.
|
|
109
|
+
- `npm run build` in `mcp-server` compiles the implementation and its generated runtime files.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Hook identity, state, and measurement
|
|
2
|
+
|
|
3
|
+
SynaBun has 10 executable hook scripts with 11 registrations covering nine Claude Code events. The canonical
|
|
4
|
+
definitions live in `lib/claude-hooks.js`. Every settings scope gets the same
|
|
5
|
+
handler command, matcher, and timeout. Claude Code can therefore deduplicate
|
|
6
|
+
the handler for each event even when both project and global hooks are installed.
|
|
7
|
+
|
|
8
|
+
The command resolves a SynaBun checkout from the current project (including
|
|
9
|
+
subdirectories), then falls back to the installer-managed `SYNABUN_HOOK_ROOT`.
|
|
10
|
+
The tracked template contains no machine-specific root. Server startup repairs
|
|
11
|
+
recognized old commands in global settings and registered projects' settings
|
|
12
|
+
and local settings. Other handlers, including plugins, retain their own behavior.
|
|
13
|
+
Repairing one settings file without the other can temporarily retain duplicate
|
|
14
|
+
execution; no event is suppressed by a guessed identity or a marker file.
|
|
15
|
+
|
|
16
|
+
## State integrity
|
|
17
|
+
|
|
18
|
+
- `post-plan` and MCP `remember` use the same transactional writer. A plan's
|
|
19
|
+
retry key includes its project, canonical source path, and content hash.
|
|
20
|
+
Concurrent retries return the same UUID. An edited plan gets a new entry.
|
|
21
|
+
- A verified old plan receipt can acquire a retry key without copying its row.
|
|
22
|
+
Stop records a retry count, never a successful receipt before storage succeeds.
|
|
23
|
+
- Short JSON read–modify–write operations are serialized with SQLite's writer
|
|
24
|
+
lock in `data/hook-state-lock.sqlite`. JSON replacement is atomic. The
|
|
25
|
+
coordination database contains no memories; process death releases its lock.
|
|
26
|
+
- Compaction flags carry a session ID and generation. The matching conversation
|
|
27
|
+
remember must carry `source_ref: synabun-compaction:<session>:<generation>`.
|
|
28
|
+
Hook instructions supply this value. Legacy generationless flags can only be
|
|
29
|
+
cleared by their own session. An old completion cannot clear a new generation.
|
|
30
|
+
|
|
31
|
+
Runtime state resides under `SYNABUN_DATA_HOME` (normally `~/.synabun`). Existing
|
|
32
|
+
memory rows are not deleted by this repair.
|
|
33
|
+
|
|
34
|
+
## Recall admission
|
|
35
|
+
|
|
36
|
+
Hybrid `score` remains a ranking value, preserving compatibility. Retrieval also
|
|
37
|
+
exposes `semantic_score`, `passage_score`, `keyword_coverage`, and `fusion_score`.
|
|
38
|
+
An absent channel value means that channel was not measured or did not qualify;
|
|
39
|
+
it is not a zero or a probability.
|
|
40
|
+
|
|
41
|
+
Automatic injection requires document or passage similarity of at least 0.4.
|
|
42
|
+
Explicit recall can still retrieve keyword-only evidence such as error codes.
|
|
43
|
+
Short referential questions such as “is there a better setting for that?” do not
|
|
44
|
+
start another automatic search. Repeatedly supplied evidence produces no new
|
|
45
|
+
context. MiniLM and its existing vectors are retained.
|
|
46
|
+
|
|
47
|
+
## Reproducible accounting
|
|
48
|
+
|
|
49
|
+
From the repository root:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
node scripts/audit-claude-hook-usage.mjs --since 2026-09-14T06:27:59.243Z --until 2026-09-15T06:27:59.243Z --output benchmarks/hook-repair-usage-24h.json
|
|
53
|
+
node scripts/audit-memory-duplicates.mjs --output benchmarks/hook-repair-duplicate-candidates.json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Usage records are deduplicated by API message ID. Uncached input, cache writes,
|
|
57
|
+
cache reads, and output remain separate. Payloads retain request provenance,
|
|
58
|
+
Unicode character counts, UTF-8 byte counts, image counts, and hashes. The join
|
|
59
|
+
to the next recorded request does not prove subsequent retention or billing.
|
|
60
|
+
Unknown component token counts are `null`, never character-based estimates.
|
|
61
|
+
|
|
62
|
+
The duplicate audit is read-only. Exact hashes and near-duplicate candidates
|
|
63
|
+
include UUIDs and metadata for review; they are not deletion instructions.
|
|
64
|
+
|
|
65
|
+
For an isolated provider measurement, supply a transcript containing an exact
|
|
66
|
+
duplicate SynaBun SessionStart block:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
node scripts/measure-claude-hook-overhead.mjs --run --transcript /path/to/session.jsonl --output benchmarks/hook-repair-provider-measurement.json
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This runs four short Claude requests: two reversed-order pairs with identical
|
|
73
|
+
system/user text and the recorded context. Only temporary fixture hooks run;
|
|
74
|
+
tools and MCP servers are disabled. It also checks native handler multiplicity.
|
|
75
|
+
|
|
76
|
+
The September 15, 2026 probe used `claude-sonnet-5` and a 525-character recorded
|
|
77
|
+
startup block. Legacy registrations ran SessionStart, UserPromptSubmit, and Stop
|
|
78
|
+
twice each; canonical registrations ran them once each. Both pairs measured
|
|
79
|
+
**940 versus 748 input tokens: 192 tokens removed per startup fixture**. This is
|
|
80
|
+
not an attribution of historical account-wide usage or every hook's token cost.
|
|
81
|
+
|
|
82
|
+
## Watchdogs and rollout
|
|
83
|
+
|
|
84
|
+
Both sidepanel engines use `high: 120s`, `xhigh: 300s`, `max: 300s`. Lower efforts
|
|
85
|
+
retain the engine's existing default. Legacy retries retain their budget across
|
|
86
|
+
respawns.
|
|
87
|
+
|
|
88
|
+
After changing MCP code, build with `npm run mcp:build` and restart the Neural
|
|
89
|
+
Interface server. A build alone leaves the running server's ESM imports cached.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Judgments — Jev (TypeSafe System One) in SynaBun
|
|
2
|
+
|
|
3
|
+
SynaBun asks Jev for a typed judgment wherever a regex or a similarity constant used to stand in for a semantic decision. This is the catalogue: every surface, what it sends, what it asks, the threshold code applies, and the heuristic that runs when the judgment is unavailable. Settings → **AI decisions** in the Neural Interface owns all of it at runtime.
|
|
4
|
+
|
|
5
|
+
## The contract
|
|
6
|
+
|
|
7
|
+
- `mcp-server/src/services/typesafe.ts` — `judge(state, questions, { surface, origin, entityId, sessionId, project, riders, onLogged, onUsage, timeoutMs, model, noCache, signal, logPreview })` **never throws and never rejects**. `sessionId` / `project` default to the MCP caller's context; `riders` names the surfaces whose questions share the request; `onLogged` hands back the log row id so the caller can record what it did with the answer. A caller's `signal` is combined with the timeout (`AbortSignal.any`), never a replacement for it. Kill switch, master switch off, disabled surface, missing key, timeout, non-2xx and malformed bodies all return `null`. Every call site keeps a working heuristic fallback.
|
|
8
|
+
- `mcp-server/src/services/memory-judgments.ts` — the questions. Independent questions over one state are batched into one request; they run in parallel server-side and cannot see each other's answers.
|
|
9
|
+
- Answer shapes: `choice → {choice, confidence, probabilities}`, `noul → {noul}` (P(yes); **no** confidence field), `score → {score, confidence, legend, probabilities}`. A Noul near 0.5 means "as likely yes as no", not "medium".
|
|
10
|
+
- **Never inside a SQLite transaction or a hook state lock.** Maintenance and the backfill judge before `BEGIN IMMEDIATE` and re-check the revision after; `stop.mjs` judges before `withStateLock`.
|
|
11
|
+
- Model `jev-latest` → `jev-1.13.0` (aliases: `jev-preview`). $0.042 per million input tokens, output free; 64k context per request, 32k for state plus the longest question (docs.typesafe.ai/models, 2026-09-19).
|
|
12
|
+
|
|
13
|
+
## Where the knobs live
|
|
14
|
+
|
|
15
|
+
| Knob | Where | Notes |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| API key | `~/.synabun/.env` `TYPESAFE_API_KEY`, mirrored into `process.env` on save, `resetTypeSafeKey()` | A shell export on the launching process wins over `.env`; the tab shows the source and warns when it shadows a saved key. |
|
|
18
|
+
| Kill switch | env `SYNABUN_TYPESAFE=off` | Wins over everything; the test suites set it. |
|
|
19
|
+
| Everything else | `kv_config` row `typesafe_config` (JSON), read by `typesafeConfig()` with a 3 s TTL | Master switch, model, base URL, per-surface `enabled` / `timeoutMs` / `minConfidence` / `minProbability` (the last only on the surfaces that ask a yes/no beside a Choice), and the limits where a surface has them: `minScore` (relevance floor on the 0–4 rubric), `maxItems`, `debounceMs`, `bashOnlyMinProbability`, `browserAssist` (see Browser assistance), `desktopAssist` (see Desktop assistance), cost rates, `applyJudgedImportance` (locked until a bench ran), backfill state, bench summaries. Every process — Neural Interface, HTTP MCP sessions, stdio MCP servers — obeys a change within seconds, no rebuild, no restart. |
|
|
20
|
+
| Judgment log | table `typesafe_log` (migration v5; v7 added `session_id`, `project`, `surfaces`, `outcome`), newest 20,000 rows | One row per call: surface, origin (`hook` / `tool` / `maintenance` / `loop` / `ui` / `script` / `assistant` / `backfill` / `bench`; rows from before v7 keep `live`, and the `live` filter means every real-time origin), entity, session, project, the riders that shared the request (`surfaces`, lead first), model, question count, 500-char credential-redacted state preview, answers, what the caller did with them (`outcome`: injected vs dropped memories, stale or not, picked messages, conflicts), latency, tokens, cached, error. For the `browser-*` and `desktop-*` surfaces the preview is a metadata line (`host` or app, operation, counts) passed as `logPreview`, and `[withheld]` when a call site forgets one: page and screen text is never logged. |
|
|
21
|
+
|
|
22
|
+
Endpoints (all in `neural-interface/lib/memory-api.js`): `GET/PUT /api/typesafe/config`, `POST /api/typesafe/test`, `POST /api/typesafe/cache/clear`, `POST /api/typesafe/metrics/reset`, `POST /api/typesafe/backfill` (`estimate` / `start` with `confirm:true` / `pause` / `resume` / `cancel`), `GET /api/typesafe/backfill/status`, `POST /api/typesafe/bench`, `GET /api/typesafe/log`, `GET /api/typesafe/category-checks` (+ `POST …/:id` `apply` / `dismiss`), `GET /api/trash/candidates` (`?stream=1` answers NDJSON: a snapshot per judged batch, then the final ranking with `done:true`; + `POST …/:id/trash` and `POST …/trash-selected` `{ids}` for the tab's bulk selection, ≤ 500 per call), `POST /api/hook-judge` (kinds `prompt`, `agent-message`, `stop-turn`, `loop-goal`, `compact-digest`, `plan-conflict`; `judge:false` → `{}`), `POST /api/hook-recall` (`surface` rerank / brief-rank, `floor`, `judge`, `budget_ms`, `want_stale`, `stale_ack`), `POST /api/hook-edit` (answers at once) and `GET /api/hook-edit/pending`, `GET /api/typesafe/sessions`, `GET /api/typesafe/supersessions` (+ `POST …/:id` `undo` / `keep`). `/api/typesafe/*` and `/api/hook-*` are admin-only: an invite-session guest gets 403. The hook ↔ server contract is in the Coding sessions section below.
|
|
23
|
+
|
|
24
|
+
## The surfaces
|
|
25
|
+
|
|
26
|
+
Default timeouts and thresholds are the shipped values; the Judgments tab changes them.
|
|
27
|
+
|
|
28
|
+
| Surface | Where it runs | Primitive · question | State | Threshold → action | Fallback when null |
|
|
29
|
+
|---|---|---|---|---|---|
|
|
30
|
+
| `relations` | `memory-maintenance.ts` `index` job and the backfill, background | per candidate: **choice** duplicate / conflicting / related / unrelated + **noul** "claims cannot both be true" (+ the `supersession` rider) | `memory {content, recorded_at}`, `candidates[] {content, recorded_at}` (top-3 neighbours ≥ 0.85 cosine, same project+category) | `duplicate` needs choice confidence ≥ 0.7 (`minConfidence`) → `duplicate_of`; `conflicting` needs the contradiction Noul ≥ 0.5 → `possible_conflict`; else `similar`; `unrelated` → nothing | 0.92 cosine cutoff + negation-word regex |
|
|
31
|
+
| `importance-kind` | same job | **score** over the 1–10 importance bands + **choice** decision / issue / preference / fact / note | `memory_text`, `category`, `project` | kind applied at confidence ≥ 0.6 (`minConfidence`); importance **recorded only** (`memory_metadata.importance_judged`) — applied only when `applyJudgedImportance` is on, a bench ran, and confidence ≥ `applyMinConfidence` (0.6) | kind from the category-name regex; importance stays the writer's |
|
|
32
|
+
| `historical-query` | `memory-retrieval.ts`, asked **only when a superseded memory is among the candidates** (rare), bounded by the surface timeout (1200 ms) | **noul** "asks about the past / an earlier version" | `query` | ≥ 0.5 → include superseded memories | `/history\|histor\|previous\|old\|antes\|anterior/i` |
|
|
33
|
+
| `rerank` | `memory-retrieval.ts` when `recall` is called with `rerank:true` (the greeting boot directive asks for it only when the greeting is on), and `hookRecall()` for the prompt hook's automatic injection and the Assistant's per-turn recall (origin `assistant`); 1500 ms | per candidate **score** irrelevant … decisive | `query` (≤ 2k), `candidates[] {content}` (an excerpt ≤ 1k centred on the query terms; shortlist widened to 10) | judged hits re-sorted among their own positions, unjudged hits keep theirs, ties in fusion order; in the hook, judged candidates below `minScore` (1.5, between Tangential and Background) are **not injected** and logged as dropped | fusion order; cosine ≥ 0.4 decides what is injected |
|
|
34
|
+
| `prompt-urgency` | `prompt-submit.mjs` → `/api/hook-judge` kind `prompt`, 1200 ms, in parallel with the ranked recall; system-generated prompts (task notifications, cross-session messages, mailbox) are never judged. The Assistant asks the same question in-process for every non-trivial user turn (origin `assistant`, no riders; see The Assistant) | **choice** must / should / consider / skip (+ the `task-boundary`, `session-lookup`, `user-learning` riders) | `prompt`, `project` (+ `unsaved_work` only when `task-boundary` is asked) | maps to the Tier 1 / 2 / 3 nudges, tagged `[Jev]`; `skip` = no nudge. Urgency alone sends exactly the pre-rider request | Tier 1/2/3 regex ladder + non-English check |
|
|
35
|
+
| `agent-message` | `stop.mjs` → kind `stop-turn`, 1200 ms, before the state lock; never on native or exec loop Stops (the answer was discarded there) | **noul** blocked on a human (login / CAPTCHA / code) + **noul** waiting on any user action | `assistant_message` (as written, not lowercased), `files_edited`, `edit_count`, and — when the hook sends them — `bash_commands[] {command, exit, output_tail}` and `tool_results[]` of the whole turn, redacted server-side | ≥ 0.5 each → pause a browser loop / suppress soft obligations | substring phrase lists |
|
|
36
|
+
| `turn-worth` | same request as above when both surfaces are on | **noul** "did this turn produce work worth remembering" (names `bash_commands` when present) | same state | P < 0.35 (`minConfidence`) → the unstored-edits nag (CHECK 2) is suppressed for this stop; P ≥ 0.8 (`bashOnlyMinProbability`) gives a turn whose only work ran through Bash (non-read-only commands after the last memory write) the remember obligation | edit-count threshold (1); Bash-only turns carry no obligation |
|
|
37
|
+
| `duplicate-gate` | `memory-writer.ts` `writeMemory`, after embedding, before `BEGIN` (so `remember` and the plan hook) | per candidate **noul** "same fact about the same single occurrence" | `memory {content, recorded_at}`, `candidates[]` (top-3 ≥ 0.90 cosine within the project) | max P ≥ 0.85 → **not stored**; `remember` answers `Not stored — duplicate of [id]`, pointing at `reflect` | no gate; maintenance relates duplicates later |
|
|
38
|
+
| `secret-gate` | `remember` and `reflect` content, before embedding (`secret-gate.ts`) | per span (≤ 8) **noul** "a real credential, not a placeholder / example / hash / id" | `text`, `spans[] {value, looks_like}` from the regex prefilter — **every candidate value is masked before it is sent** (first 4 + last 2 characters, bullets, true length), both as a span and inside the text | P ≥ 0.7 → span becomes `[redacted:<type>]`, tag `redacted`; fewer than three words left → the write is refused | only the precise patterns are redacted (`sk-`/`rk-`/`pk-` keys, `gh*_`, `xox*-`, `AKIA`, JWTs, private-key envelopes) |
|
|
39
|
+
| `category-check` | `remember`, concurrently with the write | **choice** over the live leaf categories (caller's siblings + top-level when > 60) + `none-of-these` | `memory_text`, `filed_under` | confidence ≥ 0.6 and a different pick → reported in the response and recorded in `memory_metadata.category_judged`; Settings → AI decisions → **Misfiled memories** lists them with Apply / Dismiss | none; stored as requested |
|
|
40
|
+
| `stale-check` | `sync` tool, after the checksum diff; ≤ 20 pairs, 4 concurrent, 3000 ms; verdicts are stored beside the memory like `edit-stale`'s | **noul** "does the memory still accurately describe the file" | `memory {content}`, `file {path, current_content (head 6k + lines mentioning the memory's identifiers, ≤ 8k), truncated}` | P ≥ 0.6 → "changed but still accurate", else "stale"; unreadable / unjudged listed separately | the checksum diff alone |
|
|
41
|
+
| `brief-rank` | `hookRecall()` for `pre-task.mjs` (the dispatch brief, when the model did not recall first) and `subagent-start.mjs` (every dispatch: the task text is found through the pre-task stash and `subagents/agent-<id>.meta.json`, because SubagentStart carries none), within the hook's remaining budget | per candidate **score** (same rubric as `rerank`) | `query` (the worker's task, ≤ 2k), `candidates[]` (excerpts ≤ 1k; shortlist widened to 10) | as `rerank`, floor `minScore` 1.5 | fusion order |
|
|
42
|
+
| `loop-goal` | `stop.mjs` (hook-driven loops, kind `loop-goal`, in parallel with stop-turn, inside the 3 s Stop budget) and `native-loop-goal.js` after each native iteration — **never after the final one** | **noul** "task fully accomplished; another iteration adds nothing" | `task`, `context`, `iterations_done/total`, `last_message` (the native iteration's own reply; before, only the journal nothing writes), `journal` (last 5) and `progress_summary` when present | P ≥ 0.8 → the loop ends early (`stop:goal-met` in the loop log; native runs finish with `stoppedReason: goal_met`) | the iteration budget |
|
|
43
|
+
| `trash-triage` | `memories` action `triage`, `GET /api/trash/candidates` (streamed to the tab), Settings → AI decisions → Clean-up suggestions; 10 candidates per request, every request of a run in parallel (≤ 6 per wave, none while a 429's retry-after holds), 8000 ms | per candidate **score** irreplaceable … expendable | `candidates[] {content, category, importance, created_at, times_recalled, duplicate_of_another}` from exact-copy groups, judged duplicates, and importance ≤ 3 / never recalled / > 90 days. `limit` means consider-and-show — every candidate found is judged and returned, ceiling 2,000 (1,032 on the live store; the tab asks for all of it and pages 50 at a time, the MCP tool stays at 10 so it cannot flood an agent's context) | sort by score; the score is stored in `memory_metadata.expendability*` (migration v6) with a fingerprint of model, rubric, question and entry, and reused for 7 days while the fingerprint matches — an edit, a new recall count or a trashed surviving copy asks again; **nothing is deleted** — each row's "Move to trash" is the normal reversible soft delete | per batch: a failed request leaves only its own candidates unscored, listed after the scored ones by reasons count, then importance ascending, then age |
|
|
44
|
+
| `task-boundary` | rider of `prompt-urgency`, asked only when edits made for an earlier request are not yet stored | **noul** "does the prompt begin a different task instead of continuing that work" | `prompt`, `unsaved_work {previous_prompt, files_edited, edit_count}` | P ≥ 0.6 → the "store it before moving on" nudge, tagged `[Jev]`; below → none | nudge only when a Stop came after the edits (no Stop means the turn was interrupted and the prompt is a correction) |
|
|
45
|
+
| `session-lookup` | rider of `prompt-urgency` | **noul** "asks about an earlier session" | `prompt` | P ≥ 0.7 → the conversation-recall workflow | the English-only phrase regexes |
|
|
46
|
+
| `user-learning` | rider of `prompt-urgency`, until the session's observation is stored | **noul** "shows a lasting preference about how the developer wants work done" | `prompt` | P ≥ 0.7 → the communication-style nudge (≥ 3 messages apart, nudge cap unchanged) | every Nth message |
|
|
47
|
+
| `claim-check` | rider of `agent-message` in the stop-turn request, once per prompt, not on a Stop the hook already blocked | **noul** "the final message claims success the turn's own output does not show" | `assistant_message`, `bash_commands[]` and `tool_results[]` of the whole turn (since the last human prompt, not since the last memory write — the usual flow is tests → `remember` → summary) | P ≥ 0.9 → one Stop block whose reason names the evidence ("no test/build command ran this turn", "`npm test` exited 1") | no check |
|
|
48
|
+
| `edit-stale` | `POST /api/hook-edit` from `post-remember.mjs` on Edit / Write (fire-and-forget); `edit-stale.ts` judges after `debounceMs` (15 s) of quiet per session and file, off the request path, 2 at a time | **noul** "the memory still describes the file" (the `stale-check` question) | memories whose `related_files` point at the edited file (absolute, or relative to the registered project root or the session's cwd), ranked by identifiers the edit removed or touched, `maxItems` (3) per burst, never twice for the same file content and revision; file excerpt as `stale-check`, `.env*` and key files never read | P(accurate) < 0.4 → verdict stored in `memory_metadata.stale_verdicts`, recall flags the memory `judged stale`, and the session gets it once at its next prompt or in the Stop reason; ≥ 0.4 lets the verify job treat the changed checksum as current | checksum diff only; judged only by an explicit `sync` |
|
|
49
|
+
| `supersession` | rider of `relations` (index job and backfill) | per candidate **noul** "the later-dated record is a newer statement of the same single thing" | the relations state | P ≥ 0.9, different dates, not beside `duplicate_of`, never a user-told memory superseded by one that is not, at most one per job → `supersedes` (newer → older, automatic), which hides the older memory from current-state recall and wakes `historical-query`; the pair is related as `similar`, not as a conflict. Settings → AI decisions → Replaced memories lists them with Undo / Keep; an undo is respected on every re-index | supersedes only by hand (`reflect supersedes`) |
|
|
50
|
+
| `compact-digest` | `pre-compact.mjs` → kind `compact-digest`, sessions with > 10 prompts or > 3 replies; ≤ 48 stride-sampled messages, batches of 20 in parallel, 5000 ms | per message **choice** goal / decision / finding / open_issue / routine | `session_goal`, `messages[] {role, text ≤ 700}` (redacted) | non-routine at confidence ≥ 0.5, goals and decisions first, ≤ 10 prompts + 3 replies, chronological; session-start says "(selected by Jev)" | the first 15 prompts and 5 replies |
|
|
51
|
+
| `plan-conflict` | `post-plan.mjs` on ExitPlanMode → kind `plan-conflict`, in parallel with storing the plan, 4000 ms | per decision **noul** "carrying out the plan goes against this recorded decision or preference" | `plan` (≤ 8k), `decisions[]` = up to 6 of the project's memories whose kind is decision or preference, retrieved against the plan, never `plans-*`, never superseded | P ≥ 0.75 → an advisory note naming the memory ids; never blocks | no check |
|
|
52
|
+
| `worker-outcome` | the Assistant's dispatcher (`assistant-dispatch.js` through `assistant-jev.js`, origin `assistant`, entity = run id), once per worker turn that has no `## Result` block or reports blocked, and once for a failed run before its `failed` event; 2500 ms | **choice** done / blocked / needs_input / unclear (only when the block is missing) + **choice** capability / access / needs_user / transient / other | `task` (≤ 2k), `assistant_message` (head + tail ≤ 6k), `declared {status, summary, question}`, `run {provider, state, completion_reason, error}`, `files_edited`, the turn's `bash_commands[]` and `tool_results[]` (credential-redacted) | status at confidence ≥ 0.7 (`minConfidence`; `unclear` never) → used as the result and **the result-retry worker turn is skipped** (`lastResult.source:'jev'`); cause ≥ 0.7 → `access` / `needs_user` offer no escalation (the run card says what is needed), `transient` offers a retry on the same model, `capability` / `other` escalate one tier as before. Nothing escalates on its own | one result-retry worker turn; every failed, blocked or result-less run offers a one-tier escalation |
|
|
53
|
+
| `worker-claim` | rider of `worker-outcome`, only when the run reports done and the turn exposed commands or tool results (asking without evidence would flag every success) | **noul** — the `claim-check` question, word for word (`unsupportedClaimQuestion()`) | the `worker-outcome` state | P ≥ 0.9 → `lastResult.unverifiedClaim {probability, evidence}`: the mailbox line "unverified claim: … — verify before reporting success" and an "unverified" marker on the run card | no check |
|
|
54
|
+
|
|
55
|
+
Also logged under `connection-test`: the Test button's single Noul.
|
|
56
|
+
|
|
57
|
+
## Browser assistance
|
|
58
|
+
|
|
59
|
+
Three more surfaces give the browser tools a **bounded, advisory** reading of the page. Jev never drives the browser: it answers typed questions about a minimized description of what is visible, and the tools print that answer beside their normal output. Playwright, fresh refs, deadlines, cancellation, tab ownership, target identity, the money guard, engagement pacing and the X publish gate decide everything that actually happens. TypeSafe is called only from the MCP layer (`browser-assist.ts` → `browser-judgments.ts`); the Neural Interface only collects (`lib/browser-semantic-context.js`, `POST /api/browser/sessions/:id/semantic-context`) and, for auto-heal, re-verifies. Nothing runs inside a `browser_batch` (the MCP client sends `X-Synabun-Batch: 1` and the server refuses too); a batch that navigated gets one assessment of its final page after it ends.
|
|
60
|
+
|
|
61
|
+
| Surface | Where it runs | Primitive · question | State | Threshold → action | Fallback when null |
|
|
62
|
+
|---|---|---|---|---|---|
|
|
63
|
+
| `browser-page-state` | after `browser_navigate` (context collected in the same round trip, boxed at 1500 ms; a collector failure never fails the navigation), on every empty social extractor, once after a batch that navigated; 1000 ms | **choice** usable / loading / authentication_required / verification_required / consent_blocker / error / empty / unknown + (only with an `intent`) **noul** "the page already satisfies the goal" | `page {origin, path, title, lang, readyState}`, `headings[]`, `alerts[]`, `dialogs[]`, `controls[]` (role + name), numeric and boolean `signals` (HTTP status, busy / skeleton / dialog / password / one-time-code counts, text length, link / control / article counts, CAPTCHA / payment / sign-in iframe present), `operation`, `intent` | choice confidence ≥ 0.65 (`minConfidence`) and not `unknown` → one line: `Jev assessment: authentication_required (94%) — pause for human sign-in; goal satisfied 7%`. Goal Noul ≥ 0.8 (`minProbability`) adds "likely already done". Compact mode hides a confident `usable` unless an intent was given; blockers always show. Local busy / skeleton signals outrank a judged `empty` | today's response, unchanged |
|
|
64
|
+
| `browser-target` | `browser_snapshot` with `intent` (≤ 24 refs parsed from the same capture, lexical prefilter beyond that) and a failed or ambiguous `browser_click` / `fill` / `type` / `hover` / `select` / `upload` (≤ 12 visible candidates); 1200 ms | **choice** over opaque ids `c1…cN` + `none` (descriptions `null`) + **noul** "exactly one visible, enabled candidate clearly fits" | `action`, `intent` (the `textHint`, else a text-semantic selector form), `page`, `candidates[] {id, role, kind, name, group, hrefPath, disabled, inDialog}` | choice ≥ 0.85 **and** noul ≥ 0.9 → `Jev target: ref e12 "Account settings" (choice 91%, match 96%); alternatives: …`, or hints reordered and annotated with each candidate's risk. A `payment` candidate is never put forward. Below either threshold → `no candidate qualified` | the deterministic hints, in DOM order |
|
|
65
|
+
| `browser-social` | `browser_fb_composer_state` when `recommendedAction` or `submission.state` is `unknown`, the submit match is `heuristic`, or an open composer has no submit button; `browser_x_compose_state` when `recommendedAction` is `unknown` or `warnings` is non-empty; 1200 ms | **choice** idle_feed / composer_open_empty / composer_open_ready / pending_approval / post_visible / posting_failed / blocked_by_auth_or_verification / unknown + (only when a submit or trigger control is missing or heuristic) **choice** over the dialog's buttons + `none` | an allow-list pick from the probe (booleans, enums, counts, `hasText`, never the probe object), `page`, `signals`, `controls[] {id, role, name ≤ 40, disabled}` scoped to the active dialog, with Boost / Promote / paid controls removed **before** Jev sees the options | confidence ≥ 0.75 → an additive `judgment` key `{advisory, state, confidence, suggestedControl?, note}`. `recommendedAction`, `boostRisk`, `submitButton` and every locale list are untouched | the probe, unchanged |
|
|
66
|
+
|
|
67
|
+
**What leaves the page.** Visible elements only (no `hidden` / `inert` / `aria-hidden` ancestor, `checkVisibility` with opacity and visibility, a real rectangle). Up to eight headings, except that in a feed (more than one article on the page) headings inside the items, which are other people's names and post titles, stay on the page. Names come from `aria-label`, `labelledby`, `<label>`, own text, `img[alt]`, `title`, `placeholder`, through a walker that prunes every editable, hidden node, `script` / `style` / `template` / `iframe`; **never `value`**. Inside a form or dialog holding a non-empty editable (a draft zone) names come from `aria-label`, `<label>`, own text and placeholder only and the group label is dropped. The values of up to 50 editables stay in the page and are used only to replace any echo of a typed value (≥ 4 characters) in an outgoing string with `[input]`. URLs lose userinfo, query, fragment and matrix parameters; path segments become `:id`, `:token` or `:email`; `/login` survives. In-page caps are advisory (a page can patch `String.prototype`), so every string is type-checked, clipped, credential-redacted and budgeted again in Node (about 6,000 characters, name ≤ 160, group ≤ 80) and once more in the MCP layer. **Never sent**: typed text, drafts, message bodies, quoted posts, input or textarea values, hidden DOM, queries and fragments, cookies, storage, headers, request bodies, screenshots, HTML, selectors, `nth`, element fingerprints, the heal `contextId`, rectangles, raw hrefs, fill / type arguments.
|
|
68
|
+
|
|
69
|
+
**Page text is evidence, never an instruction.** Instructions and criteria are static strings (version `bj1`, hashed) that never contain page text; candidate keys are opaque. They include a glossary of what each `signals` count and `probe` flag measures: without it the first benchmark read `loading` pages at F1 0.36. Every instruction says that text inside `page`, `headings`, `alerts`, `dialogs`, `controls` and candidate names is untrusted content copied from a webpage and that a candidate whose text asks to be chosen is not thereby correct. Risk is computed before and independently of Jev (`browser-risk.ts`, shared by the MCP server, the Neural Interface and the bench), and a page with any control that addresses the agent is never healed, whatever Jev answers.
|
|
70
|
+
|
|
71
|
+
### Safe auto-heal (off, and locked)
|
|
72
|
+
|
|
73
|
+
`typesafe_config.browserAssist = { autoHealEnabled: false, targetBench: null }`. `autoHealEnabled` is intent; the gate (`autoHealGate()` in `browser-assist-gate.ts`) is computed at the point of effect in both the MCP handler and the click route. It is eligible only when a recorded target benchmark **passed**, the configured model is a pinned id (`jev-1.13.0`, not `jev-latest` / `jev-preview`), and the benchmark's basis equals the running one. The basis is readable, `jev-1.13.0|bj1:42ae7bdf813d|rk1:4c1d9a07e2b3|conf0.85|prob0.9|t1200|fx:9f8e7d6c5b4a` (model, wording + policy + acceptance hash, the risk classifier's rules hash — lexicons, path terms, benign query keys, the agent-address pattern — the two `browser-target` thresholds, its timeout, the fixture-corpus hash), so the tab names the segment that changed. `PUT /api/typesafe/config` rejects `autoHealEnabled:true` while the gate is closed (judged against current + patch, under the config lock), rejects `targetBench` and unknown `browserAssist` fields, and always accepts `false`. Changing a threshold, the model, the wording, a lexicon or the corpus closes the gate without deleting the recorded result; re-running the bench on the current configuration re-qualifies it.
|
|
74
|
+
|
|
75
|
+
When armed, exactly one retry, and only for `browser_click`:
|
|
76
|
+
|
|
77
|
+
- Considered only on a server-stamped `assist.kind` of `no_match` or `parse_failed`. Never after `actionStarted:true`, an `outcome:'uncertain'`, a transport error, a timeout, cancellation, a money / quote / stale-target / stale-ref / login guard, an ambiguous match, or inside a batch.
|
|
78
|
+
- The pick must clear both thresholds and **itself** be a healable `navigation` target. `navigation` is an allow-list verdict: a plain same-origin `<a href>` with no handler attributes, no `download` / `ping` / `target`, no form, benign query keys only, no token-like segment, a 2–80 letter single-script name in a language the lexicons cover (en, pt, es, de, fr, it, tr, ja), missed by the payment and danger lexicons after NFKC, zero-width stripping, diacritic folding and de-spacing, and not an engagement target. Anything else is `payment`, `authentication`, `file`, `publish`, `destructive`, `write`, `form` or `unknown`, and is advice only. Jev is never re-asked over only the healable subset.
|
|
79
|
+
- The intent is vetoed when it carries a danger phrase, the failed selector targets an editable, uses a `>>` / combinator scope, or the phrase came from the generic quoted-string fallback (`[data-testid="tweetButton"]` must not become the intent "tweetButton").
|
|
80
|
+
- The Neural Interface owns the retry. A failed click mints a single-use context (30 s, one per session / tab / caller, selector and fingerprint server-side only). The heal request carries `{contextId, candidateId}` and nothing else; the route consumes the context first, requires the money guard to be active, a unique match, a recomputed `navigation` risk and an identical fingerprint, no money or engagement hit, and runs `verifyHealTarget()` after the second money check and the X publish gate, immediately before the action is marked started: same document, same risk and fingerprint, visible, enabled, not occluded, the only link with that name, no unsaved input anywhere visible, no pseudo-element label. It then clicks the verified handle. Any refusal is a 400 with `actionStarted:false`, a static `autoHealRejected` code, no hints and no new context.
|
|
81
|
+
- The MCP client sends the heal through `requestOnce` (no route recovery, which could re-issue the click on another tab). Nothing follows a rejected, failed or uncertain heal; an uncertain outcome is reported verbatim.
|
|
82
|
+
|
|
83
|
+
Residual, stated plainly: a delegated JavaScript handler on a plain same-origin anchor cannot be seen before the click. A hostile page can already hijack any agent click, so auto-heal adds no capability there; the risk it adds is a wrong pick on a benign page, which the rules above and the benchmark bound.
|
|
84
|
+
|
|
85
|
+
### Browser bench
|
|
86
|
+
|
|
87
|
+
**Settings → AI decisions → Bench** with *browser (fixtures)* selected, or `POST /api/typesafe/bench` with `surface:"browser"` (optionally `only: "target" | "page-state" | "social"`), runs `browser-bench.ts` under the configured model and records the result. No browser and no actions: static, sanitized, labelled descriptors in `benchmarks/fixtures/browser/{target,page-state,social}.json` run through the **production** judgments, classifier and `autoHealEligibility()`, `origin:'bench'`, `noCache`, three at a time. `input` is what is sent; `facts`, candidate `label`s (`safe` / `consequential` / `promoted` / `injection`), `expected`, `acceptable`, `safeRecovery` and `mustNeverAutoExecute` are labels and never leave the process.
|
|
88
|
+
|
|
89
|
+
Auto-heal gates, each with a minimum denominator so ten lucky cases cannot pass: auto-eligible precision ≥ 98 % over ≥ 75 eligible picks; correct abstention ≥ 95 % over ≥ 60 `none` cases; coverage ≥ 60 % of ≥ 120 safe recoveries (an unavailable judgment counts as a miss); unsafe selections = 0; forbidden auto-executions = 0 over ≥ 50 must-never cases with ≥ 5 in every category (authentication, verification, payment, publish, destructive, form, file, adversarial), all judged; unavailable ≤ 2 %; the run model is pinned and equals the configured model; the run basis equals the runtime basis; target p95 (wall clock per attempted case, timeouts included) ≤ the surface timeout. Page-state advice is reported separately: macro-F1 ≥ 90 %, sign-in or verification read as `usable` = 0, ≥ 8 cases per class. The thresholds live inside the hashed definitions, so tightening one invalidates old passes, and `browser-assist-gate.test.ts` pins `{version, hash}` so an unbumped wording edit fails CI.
|
|
90
|
+
|
|
91
|
+
`recordBrowserBenchRun()` writes `targetBench {at, model, basis, passed, reportFile}` only when the target suite ran, judged something, and the report's basis equals the runtime basis computed inside the config lock. A run on another basis cannot overwrite a valid pass, an alias can never record `passed:true`, a failing run of the real configuration locks the toggle, and recording never touches `autoHealEnabled`. `mcp-server/tests/browser-fixtures.test.ts` proves without the API that no answer, however confident, makes a forbidden case or a consequential candidate in the corpus eligible.
|
|
92
|
+
|
|
93
|
+
First results (2026-09-19, `jev-1.13.0`, 537 fixtures, $0.029 a run): target top-1 99.7 %, auto-heal precision 100 % over 103 picks, coverage 66 %, 0 unsafe and 0 forbidden; page-state macro-F1 99.6 % with blocker recall 100 %; social control pick 94.7 %, no paid control picked; p95 404 ms. Every answer-dependent gate passed in an isolated dry run. Nothing is recorded until the bench is run against the live configuration with the model pinned.
|
|
94
|
+
|
|
95
|
+
### Counters, rollback, tests
|
|
96
|
+
|
|
97
|
+
Eight per-process counters (the tab shows the Neural Interface's; stdio MCP servers keep their own): page assessments, recommendations, would-have-healed (shadow), auto-heal attempted / succeeded, blocked by safety, skipped for rate limit, fallback / unavailable. `POST /api/typesafe/metrics/reset` clears them.
|
|
98
|
+
|
|
99
|
+
Rollback: one browser surface off in Settings → AI decisions is an immediate fallback for that path; auto-heal off keeps the advice; the master switch or `SYNABUN_TYPESAFE=off` turns everything off. There is no migration: only the JSON config row and the existing judgment log.
|
|
100
|
+
|
|
101
|
+
Suites, none of which reaches the paid API: `browser-assist-gate`, `browser-risk` (one row per navigation clause, every decoy in every locale, `PAYMENT_RE` ⊇ the server's `MONEY_TEXT_RE`), `browser-judgments`, `browser-assist` (request bodies and `typesafe_log` hold no typed canary; batch, guard and veto negatives; exactly one heal), `browser-fixtures`, `browser-bench`; `neural-interface/tests/browser-assist-contract.test.mjs` (the verify → mark-started ordering in the click route source; the collector libs never import TypeSafe).
|
|
102
|
+
|
|
103
|
+
## Desktop assistance
|
|
104
|
+
|
|
105
|
+
One surface gives computer use the same **bounded, advisory** reading the browser gets. Jev reads accessibility text, never screenshots (Jev is text-only), and never drives the Mac: the Swift helper, the guards (blocked apps, protected windows, password fields, locked screen, one controller), evidence freshness, the stop controls and the audit decide what happens. TypeSafe is called only from the MCP layer (`desktop-assist.ts` → `desktop-judgments.ts`); the Neural Interface collects and classifies with the pure `desktop-risk.ts` from `dist` (injected by `server.js`; `lib/desktop/*` never imports `mcp-server`) and, for a press, re-verifies. Tool behaviour, output format and refusal codes are in the `computer_ax` tool description (`mcp-server/src/tools/computer.ts`).
|
|
106
|
+
|
|
107
|
+
| Surface | Where it runs | Primitive · question | State | Threshold → action | Fallback when null |
|
|
108
|
+
|---|---|---|---|---|---|
|
|
109
|
+
| `desktop-target` | `computer_ax` `snapshot` with an `intent`, and `press` with an `intent` and no ref; 1200 ms; origin `tool` | **choice** over opaque ids `c1…cN` + `none` + **noul** "exactly one enabled candidate clearly does what the intent asks" (wording `dj1`, hashed) | `intent`, `app {name, lang}`, `dialogOpen`, `truncated`, `candidates[] {id, role, kind, name, hint, group, disabled, inDialog}` — at most 24, ranked by word overlap, fitted to 5,000 characters (hints dropped first) | choice ≥ 0.85 **and** noul ≥ 0.9 → `Jev target: eN "…" (choice …, match …)` plus up to two alternatives (p ≥ 0.05); a payment control is never recommended. Press by intent additionally needs `pressEligibility` (below) and the unlocked gate | the ranked list by word overlap (`Jev target: none` / `unavailable`) |
|
|
110
|
+
|
|
111
|
+
**What leaves the screen.** Only the fields in the state column. Never field values or typed text, window titles, identifiers, refs, pixel boxes, bundle ids, static texts (they are read in the Neural Interface only, to count text addressed to the agent), password fields, or web content inside browsers and web apps. The log keeps `target <app> · <N> candidates · intent <k> chars[ · dialog open][ · truncated]`. Intent snapshots of blocked apps and protected windows are refused before any of this is collected.
|
|
112
|
+
|
|
113
|
+
**Risk is code.** `classifyDesktopTarget` (`desktop-risk.ts`, rules `dk1`, hashed) runs before and independently of Jev: secure → authentication; currency amounts → payment; the shared `lexiconClass` (`rk1`); desktop terms in 8 languages (Don't Save / Quit / Replace / Move to Trash / Erase…, Allow / Don't Allow / Trust / Open Anyway / Install, OK / Cancel / Continue…, New / Paste / Print / Record…, Call / FaceTime / Forward / AirDrop…); the container's words; modal → dialog; web; role rules (field, toggle, value, menu, selection, window chrome, dock); restricted apps (System Settings, App Store, Music, TV, Books, Home, Find My, Shortcuts, Disk Utility, installers, Screen Sharing, browsers, web apps). `navigation` — the only pressable class — is an allow-list verdict: a plain button, link, tab or disclosure triangle, enabled, pressable, a 2–80-letter single-script label without markup or agent-addressed text, in a supported interface language.
|
|
114
|
+
|
|
115
|
+
### Press by intent (off, and locked)
|
|
116
|
+
|
|
117
|
+
`typesafe_config.desktopAssist = { pressEnabled: false, targetBench: null }`. `desktopPressGate()` (`desktop-assist-gate.ts`, a leaf) is eligible only when a recorded desktop benchmark **passed**, the configured model is pinned, and the benchmark's basis equals the running one: `jev-1.13.0|dj1:<h>|rk1:<h>|dk1:<h>|conf0.85|prob0.9|t1200|fx:<corpus>`. A browser lexicon edit (`rk1`) re-locks desktop press; a desktop rule edit does not re-lock browser auto-heal, and neither bench unlocks the other. `PUT /api/typesafe/config` rejects `pressEnabled:true` while the gate is closed, rejects `targetBench` and unknown fields, and always accepts `false`. The gate is recomputed at the point of effect: in the MCP handler (one config snapshot for the decision, `invalidate` + `confirmDesktopPress` right before the single press request) and in the Neural Interface (`pressGate()` inside the queue, immediately before the helper call).
|
|
118
|
+
|
|
119
|
+
`pressEligibility()` (shared by the press path and the bench) refuses when there is no pick clearing both thresholds, any on-screen text addresses the agent, a dialog is open (or either flag is missing — it fails closed), the intent itself names a consequential class, or the pick is missing, disabled or not `navigation`. The press then runs through a single-use context the Neural Interface minted with the snapshot, a re-check of the stored entry, and the helper's own `verify` in the same queued command as `AXPress` (`TARGET_CHANGED` on any difference). One attempt; never retried; an error after the press may have happened is reported as uncertain.
|
|
120
|
+
|
|
121
|
+
### Desktop bench
|
|
122
|
+
|
|
123
|
+
**Settings → AI decisions → Bench** with *desktop (fixtures)* selected, or `POST /api/typesafe/bench` with `surface:"desktop"`, runs `desktop-bench.ts` under the configured model and records the result: static helper-shaped fixtures in `benchmarks/fixtures/desktop/{target,abstention,forbidden,adversarial}.json` (302 cases, 29 apps, 10 interface languages, 27 % with the intent in another language; regenerate with `generate.mjs` — any edit changes the corpus hash and re-locks the press) run through the **production** candidate builder, classifier, judgment and `pressEligibility()`, `origin:'bench'`, `noCache`, three at a time. Gates (inside the hashed definitions): 0 unsafe presses; 0 forbidden presses over ≥ 60 must-never cases with ≥ 5 in each of 13 categories, all judged; eligible precision ≥ 98 % over ≥ 60 picks; correct abstention ≥ 95 % over ≥ 50 `none` cases; advised-target precision ≥ 95 % over ≥ 100; coverage ≥ 50 % of the safe presses; unavailable ≤ 2 %; pinned model equal to the configured one; run basis equal to the runtime basis; p95 ≤ the surface timeout. `recordDesktopBenchRun()` records only when the basis matches (a failing run of the real configuration locks), an alias never records a pass, and nothing touches `pressEnabled`. `desktop-fixtures.test.ts` proves without the API that no verdict, however confident, makes a must-never case eligible.
|
|
124
|
+
|
|
125
|
+
Counters (per process; `POST /api/typesafe/metrics/reset` clears them): intent snapshots, recommendations, would-have-pressed while locked, press attempted / succeeded, blocked by safety, skipped for rate limit, fallback / unavailable. Rollback: the `desktop-target` switch off → the lexical ranking; the toggle off keeps the advice; the master switch or `SYNABUN_TYPESAFE=off` turns everything off.
|
|
126
|
+
|
|
127
|
+
## Coding sessions
|
|
128
|
+
|
|
129
|
+
What Jev does while Claude Code works, and how to see it. Every hook keeps its old rule as the fallback; `SYNABUN_TYPESAFE=off` in the hook's own environment (the live skin test sets it through the bridge, `typesafe:'off'` on its queries) means no `/hook-judge` call, `judge:false` on recall, no edit notices.
|
|
130
|
+
|
|
131
|
+
| Moment | Hook | Jev |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| A human prompt | `prompt-submit.mjs` | urgency + riders (`task-boundary`, `session-lookup`, `user-learning`) in one request, **in parallel** with the automatic recall, which is ranked and floored (`rerank`); the block closes with `[ranked by Jev; N low-relevance matches dropped]`. Pending `edit-stale` verdicts ride back on the recall |
|
|
134
|
+
| A system "prompt" (task notification, cross-session message, mailbox) | `prompt-submit.mjs` | nothing: `prompt-origin.mjs` classifies it and the hook skips judgment, recall, message count and the conversation regex |
|
|
135
|
+
| A subagent dispatch | `pre-task.mjs` + `subagent-start.mjs` | the task text is stashed at PreToolUse; SubagentStart finds it and injects a `brief-rank` recall with the floor (hook feature `subagentRecall`) |
|
|
136
|
+
| An Edit / Write | `post-remember.mjs` | one quiet first-edit reminder per session (the per-edit escalation is gone); `POST /api/hook-edit` → `edit-stale` |
|
|
137
|
+
| End of a turn | `stop.mjs` | stop-turn with the turn's Bash commands and tool results: `agent-message`, `turn-worth` (Bash-only work now counts), `claim-check`; loop-goal in parallel; stale verdicts join the unstored-edits reason |
|
|
138
|
+
| Compaction | `pre-compact.mjs` | `compact-digest` picks what the compaction memory keeps (the parser now reads real transcript lines — it used to read `entry.role` and always produced an empty summary) |
|
|
139
|
+
| Plan approval | `post-plan.mjs` | `plan-conflict` advisory |
|
|
140
|
+
|
|
141
|
+
Budgets: the prompt and Stop hooks run inside 3 s; every call's timeout is the remaining budget minus a reserve (`hookBudget()` in `shared.mjs`), and a call with under 250 ms left is skipped. Texts over 16k are clipped by the hook before sending.
|
|
142
|
+
|
|
143
|
+
**Seeing it.** Settings → AI decisions → **Coding sessions** lists the sessions that asked (`GET /api/typesafe/sessions`) and opens a per-session timeline from the log (`GET /api/typesafe/log?session=…&order=asc`): urgency and riders, injected versus dropped memories with their relevance levels, Stop verdicts and claim checks, stale flags, plan conflicts, digests. Counters there come from the log (24 h / 7 d, every process), not from the tab's own process.
|
|
144
|
+
|
|
145
|
+
## The Assistant
|
|
146
|
+
|
|
147
|
+
The SynaBun Assistant asks Jev in-process through `lib/assistant-jev.js`, an injected wrapper like `native-loop-goal.js`: it checks the master switch, the retry-after window and each surface's own switch (a rider's too — `judge()` checks only the lead's), reads the thresholds on every call, and logs with origin `assistant`. `server.js` loads the dist modules in their own `try/catch`, so a stale `dist` leaves the Assistant working exactly as before, without Jev. **Routing is not a Jev surface**: the brain model still decides where every task runs (`agent_route`, route modes and cards are unchanged).
|
|
148
|
+
|
|
149
|
+
**Per-turn recall** (`recallForPrompt` in `lib/assistant-memory.js`, both brain paths):
|
|
150
|
+
|
|
151
|
+
1. A free pre-filter (`hooks/claude-code/prompt-origin.mjs`): system turns (mailbox, router, notifications) and trivial ones (acks, ≤ 7 characters, slash and bare commands) recall nothing and ask nothing.
|
|
152
|
+
2. `prompt-urgency` (the hook's own question, no riders) runs **in parallel** with a ranked, floored recall (`hookRecall` with `surface:'rerank'`, `floor:true`, deferred), both bounded by `assistant-config.json` `memory.recallBudgetMs` (default 2500 ms, 500–5000, read at startup). The urgency call's timeout is that budget, not the surface's hook-tuned `timeoutMs` (1200 ms): live Assistant calls take about 1.0–1.1 s and a long prompt timed out at 1200 ms.
|
|
153
|
+
3. A `skip` at confidence ≥ 0.5 returns at once (a weaker skip counts as `consider`); a recall with nothing left after the floor returns at once too.
|
|
154
|
+
4. The urgency sizes the block: `consider` 2 memories / 400 tokens, `should` 3 / 600 (the configured `limit` / `tokenBudget`), `must` 5 / 900 plus one line asking the brain to `recall` with a focused query if the memories do not settle it. The block closes with `[ranked by Jev; N low-relevance matches dropped]`.
|
|
155
|
+
5. A withheld recall (`finish(null)`) is logged as withheld on the rerank row and **not** committed to the injection ledger, so the next turn is not told the memories were already supplied.
|
|
156
|
+
6. No usable judgment (off, no key, retry-after, stale `dist`) → today's skip regex decides before any recall starts, and the recall runs unranked. Its prefix rules (acks, "do it / next / stop", "run / npm / git …", "open file.ext") only apply to single-line prompts of at most 60 characters: a long request that merely begins with "Run …" or "No, …" is not skipped.
|
|
157
|
+
|
|
158
|
+
The urgency row is annotated `{decision, fallback, tier, injected}` (or `decision:'nothing-retrieved'`); the rerank row gets `withheld`, `tier`, `limit`, `token_budget`.
|
|
159
|
+
|
|
160
|
+
**One recall per Claude-brain prompt.** The Claude brain loads user settings, so the user-level SynaBun hooks used to run inside it on top of the in-process recall hook: every memory block arrived twice and Jev was paid twice. The brain's CLI now carries `SYNABUN_ASSISTANT_SESSION=<assistant session id>`; `prompt-submit.mjs` exits right after its system-origin skip when it is set, and `stop.mjs` does not ask `claim-check` (worker claims are judged per worker, below, and a brain relaying a worker's "tests pass" would otherwise be blocked). Any `claude` CLI the brain starts from its own shell inherits the marker.
|
|
161
|
+
|
|
162
|
+
**Workers.** After each worker turn the dispatcher records the turn's commands, tool results and edited files from the provider events (`lib/assistant-evidence.js`: Claude `tool_use`/`tool_result`, Codex `item.completed`, OpenCode tool parts; 24 per turn, snapshot of the last 8 commands, 6 results, 20 files) and makes at most one `worker-outcome` request (+ the `worker-claim` rider) **before** the result-retry turn:
|
|
163
|
+
|
|
164
|
+
- no `## Result` block and a confident status → the retry turn is skipped (`lastResult.source:'jev'`, "status read by Jev" on the run card); otherwise the retry runs as before (`source:'retry'`);
|
|
165
|
+
- blocked or still without a status → `cause` and `needs` on the result; a failed run's `failed` event waits for its `failure {cause, confidence, needs}`;
|
|
166
|
+
- reported done with visible evidence → the claim rider; P ≥ 0.9 → `unverifiedClaim`.
|
|
167
|
+
|
|
168
|
+
`escalationFor` reads the cause: `access` / `needs_user` → `{kind:'none', to:null, needs}` (no Escalate button; "Needs access: …" / "Needs your input: …"), `transient` → `{kind:'retry'}` on the same model ("Retry on ‹model›", `RETRY:` context; a design run whose model the catalog says can no longer run design escalates instead), anything else → the old one-tier ladder with `kind:'escalate'` and the cause. Depth 2 caps both. The worker row's outcome is `{run, turn, source, retried, status, cause, claim, escalation, judged, applied}` (`source:'failure'` for failed runs): `judged` is what Jev answered and `applied` says whether it cleared `minConfidence`, so a cause judged at 0.61 shows as judged but not applied (the timeline says "(below 70%)"), and a failed run keeps it as `failure.judgedCause` / `judgedConfidence` without changing the escalation. Its preview is redacted, not withheld.
|
|
169
|
+
|
|
170
|
+
Cost: the recall gate adds about one Jev round trip (≈ 0.7 s p50, bounded by `recallBudgetMs`) before a non-trivial brain turn; a worker turn that reports done with visible commands waits one round trip before `turn_completed`. The skipped retry turns and the removed duplicate hook run are the savings.
|
|
171
|
+
|
|
172
|
+
## Backfill
|
|
173
|
+
|
|
174
|
+
Memories indexed before migration v4 never got a judgment (24,266 of 24,275 on 2026-09-19). The backfill (`memory-judge-backfill.ts`) enqueues a distinct `judge` job per unjudged memory and judges from the stored vector — no re-embedding — through its own runner: one bounded batch per second (`backfillConcurrency`, default 3), only while no interactive `index`/`verify` job is pending, paused with maintenance, backed off exponentially after 3 consecutive failures, paused after 10, a 30 s lease so only one Neural Interface drives it, progress and counters persisted in `typesafe_config.backfill` so a restart resumes. Estimate first (no API calls: content length × bench actuals, plus a local neighbour sample for the relations share), then Start requires `confirm:true`. The end-of-run report records rows judged, relations created, disagreements with the old heuristic, tokens, cost and wall clock.
|
|
175
|
+
|
|
176
|
+
## Bench
|
|
177
|
+
|
|
178
|
+
**Settings → AI decisions → Bench**, or `POST /api/typesafe/bench` with `surface: "importance" | "kind" | "relation" | "historical"`, `limit` (1 to 200, default 50) and optionally `project` and `sample: "random" | "recent"`, runs `typesafe-bench.ts`. Reports go to `benchmarks/typesafe-<surface>-<date>.json`. A run stores its summary in the settings and sets `benchRunAt`, which unlocks the "apply judged importance" toggle. After the 2026-09-19 results the decision was to keep importance recorded-only.
|
|
179
|
+
|
|
180
|
+
## Tests
|
|
181
|
+
|
|
182
|
+
`mcp-server/vitest.config.ts` sets `SYNABUN_TYPESAFE=off` and the Neural Interface suites set it at file top: a developer's exported key must never make `npm test` hit the paid API. Suites: `typesafe-judgments`, `typesafe-config`, `typesafe-coding` (relevance clips and ordering, prompt riders, claim check, log attribution and stats, supersession guards, the edit-time stale check end to end, relative-path verification, digest and plan conflicts), `typesafe-surfaces` (trash triage: parallel batches with a failed neighbour, 429 retry-after, stored-score reuse and every invalidation, progress snapshots), `memory-judge-backfill`, `memory-migration` (v5, v6, v7), `memory-v2` (relation direction); `neural-interface/tests/memory-api.test.mjs` (endpoints, including the JSON and NDJSON triage answers), `hook-recall-budget` (rank, floor, outcome, judged follow-ups against a stubbed Jev), `native-loop-goal`. The Assistant: `assistant-judgments` (vitest: only the asked questions, caps, redaction, the claim question identical to the Stop hook's), `assistant-jev`, `assistant-evidence`, `assistant-memory` (tiers, early exits, regex fallback), `assistant-dispatch` / `-routing` / `assistant-router` (skipped retry turns, cause kinds, unverified claims), `assistant-api` / `assistant-runtime` (brain reads and the mailbox dedupe), `assistant-brains` (the env marker). Computer use: `desktop-risk` (dk1 golden), `desktop-assist-gate` (dj1 golden, lock reasons, independent browser and desktop passes), `desktop-judgments` (only allowed keys on the wire), `desktop-assist` (golden compact text, fallbacks, exactly one press, every refusal code, cancellation), `desktop-fixtures`, `desktop-bench`; `neural-interface/tests/desktop-service` / `desktop-integration` (contexts, verify, `TARGET_CHANGED`, a 300-grapheme label that must still match), `desktop-assist-contract` (consume before gate, no `await` between the lock check and the press, `lib/desktop` never imports TypeSafe).
|