@vascend/talos 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +202 -0
- package/dist/backend/asset-events.d.ts +31 -0
- package/dist/backend/asset-events.js +149 -0
- package/dist/backend/assets.d.ts +31 -0
- package/dist/backend/assets.js +210 -0
- package/dist/backend/auth.d.ts +18 -0
- package/dist/backend/auth.js +59 -0
- package/dist/backend/config.d.ts +14 -0
- package/dist/backend/config.js +41 -0
- package/dist/backend/conversations.d.ts +21 -0
- package/dist/backend/conversations.js +141 -0
- package/dist/backend/crypto.d.ts +9 -0
- package/dist/backend/crypto.js +68 -0
- package/dist/backend/engine.d.ts +13 -0
- package/dist/backend/engine.js +78 -0
- package/dist/backend/http.d.ts +25 -0
- package/dist/backend/http.js +112 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +24 -0
- package/dist/backend/routes.d.ts +14 -0
- package/dist/backend/routes.js +169 -0
- package/dist/backend/sdk.d.ts +12 -0
- package/dist/backend/sdk.js +11 -0
- package/dist/backend/server.d.ts +12 -0
- package/dist/backend/server.js +91 -0
- package/dist/backend/temp-image-store.d.ts +46 -0
- package/dist/backend/temp-image-store.js +197 -0
- package/dist/backend/types.d.ts +103 -0
- package/dist/backend/types.js +29 -0
- package/dist/backend/users.d.ts +13 -0
- package/dist/backend/users.js +76 -0
- package/dist/backend/ws-handler.d.ts +14 -0
- package/dist/backend/ws-handler.js +72 -0
- package/dist/backend/ws.d.ts +19 -0
- package/dist/backend/ws.js +146 -0
- package/dist/core/agent.d.ts +56 -0
- package/dist/core/agent.js +1783 -0
- package/dist/core/background.d.ts +45 -0
- package/dist/core/background.js +140 -0
- package/dist/core/bootstrap.d.ts +45 -0
- package/dist/core/bootstrap.js +294 -0
- package/dist/core/cli-args.d.ts +41 -0
- package/dist/core/cli-args.js +282 -0
- package/dist/core/collapsible-output.d.ts +38 -0
- package/dist/core/collapsible-output.js +143 -0
- package/dist/core/compaction-checkpoint.d.ts +9 -0
- package/dist/core/compaction-checkpoint.js +58 -0
- package/dist/core/compaction.d.ts +42 -0
- package/dist/core/compaction.js +270 -0
- package/dist/core/config.d.ts +49 -0
- package/dist/core/config.js +417 -0
- package/dist/core/context-ledger.d.ts +99 -0
- package/dist/core/context-ledger.js +222 -0
- package/dist/core/context-policy.d.ts +17 -0
- package/dist/core/context-policy.js +81 -0
- package/dist/core/continuation-review.d.ts +23 -0
- package/dist/core/continuation-review.js +64 -0
- package/dist/core/crash-report.d.ts +3 -0
- package/dist/core/crash-report.js +27 -0
- package/dist/core/credentials.d.ts +11 -0
- package/dist/core/credentials.js +183 -0
- package/dist/core/doctor.d.ts +24 -0
- package/dist/core/doctor.js +125 -0
- package/dist/core/effort.d.ts +5 -0
- package/dist/core/effort.js +42 -0
- package/dist/core/env-paths.d.ts +3 -0
- package/dist/core/env-paths.js +38 -0
- package/dist/core/execution-guidance.d.ts +9 -0
- package/dist/core/execution-guidance.js +73 -0
- package/dist/core/execution-target.d.ts +41 -0
- package/dist/core/execution-target.js +69 -0
- package/dist/core/file-coordination.d.ts +66 -0
- package/dist/core/file-coordination.js +176 -0
- package/dist/core/file-lease-store.d.ts +14 -0
- package/dist/core/file-lease-store.js +89 -0
- package/dist/core/image-limits.d.ts +26 -0
- package/dist/core/image-limits.js +205 -0
- package/dist/core/interruptible-completion.d.ts +3 -0
- package/dist/core/interruptible-completion.js +42 -0
- package/dist/core/kingdoms-mode-state.d.ts +24 -0
- package/dist/core/kingdoms-mode-state.js +139 -0
- package/dist/core/licenza.d.ts +38 -0
- package/dist/core/licenza.js +125 -0
- package/dist/core/model-limits.d.ts +2 -0
- package/dist/core/model-limits.js +36 -0
- package/dist/core/output-lifecycle.d.ts +44 -0
- package/dist/core/output-lifecycle.js +190 -0
- package/dist/core/package-update.d.ts +15 -0
- package/dist/core/package-update.js +121 -0
- package/dist/core/permission-queue.d.ts +2 -0
- package/dist/core/permission-queue.js +20 -0
- package/dist/core/prompt-attachment.d.ts +21 -0
- package/dist/core/prompt-attachment.js +123 -0
- package/dist/core/request-plan.d.ts +16 -0
- package/dist/core/request-plan.js +36 -0
- package/dist/core/run-timing.d.ts +17 -0
- package/dist/core/run-timing.js +123 -0
- package/dist/core/self-update.d.ts +17 -0
- package/dist/core/self-update.js +54 -0
- package/dist/core/session-refs.d.ts +27 -0
- package/dist/core/session-refs.js +126 -0
- package/dist/core/session-storage.d.ts +4 -0
- package/dist/core/session-storage.js +48 -0
- package/dist/core/session-title.d.ts +1 -0
- package/dist/core/session-title.js +21 -0
- package/dist/core/session-usage.d.ts +17 -0
- package/dist/core/session-usage.js +74 -0
- package/dist/core/session.d.ts +58 -0
- package/dist/core/session.js +296 -0
- package/dist/core/settings.d.ts +17 -0
- package/dist/core/settings.js +107 -0
- package/dist/core/storage-retention.d.ts +21 -0
- package/dist/core/storage-retention.js +227 -0
- package/dist/core/text-sanitize.d.ts +1 -0
- package/dist/core/text-sanitize.js +35 -0
- package/dist/core/tool-artifacts.d.ts +6 -0
- package/dist/core/tool-artifacts.js +51 -0
- package/dist/core/tool-compress.d.ts +8 -0
- package/dist/core/tool-compress.js +111 -0
- package/dist/core/tool-executor.d.ts +16 -0
- package/dist/core/tool-executor.js +97 -0
- package/dist/core/tool-result-index.d.ts +52 -0
- package/dist/core/tool-result-index.js +327 -0
- package/dist/core/tool-result-store.d.ts +38 -0
- package/dist/core/tool-result-store.js +190 -0
- package/dist/core/tool-scheduler.d.ts +16 -0
- package/dist/core/tool-scheduler.js +35 -0
- package/dist/core/trust.d.ts +21 -0
- package/dist/core/trust.js +95 -0
- package/dist/core/types.d.ts +402 -0
- package/dist/core/types.js +1 -0
- package/dist/core/update-check.d.ts +26 -0
- package/dist/core/update-check.js +89 -0
- package/dist/core/update-process.d.ts +10 -0
- package/dist/core/update-process.js +31 -0
- package/dist/core/user-inbox.d.ts +23 -0
- package/dist/core/user-inbox.js +56 -0
- package/dist/core/user-input.d.ts +10 -0
- package/dist/core/user-input.js +35 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +10 -0
- package/dist/core/vibe-modes.d.ts +38 -0
- package/dist/core/vibe-modes.js +383 -0
- package/dist/core/workspace-roots.d.ts +13 -0
- package/dist/core/workspace-roots.js +91 -0
- package/dist/core/workspace-sessions.d.ts +51 -0
- package/dist/core/workspace-sessions.js +243 -0
- package/dist/cowork/client.d.ts +29 -0
- package/dist/cowork/client.js +49 -0
- package/dist/cowork/engine-bridge.d.ts +22 -0
- package/dist/cowork/engine-bridge.js +98 -0
- package/dist/cowork/index.d.ts +11 -0
- package/dist/cowork/index.js +16 -0
- package/dist/cowork/ipc.d.ts +97 -0
- package/dist/cowork/ipc.js +96 -0
- package/dist/cowork/manager.d.ts +66 -0
- package/dist/cowork/manager.js +325 -0
- package/dist/cowork/store.d.ts +23 -0
- package/dist/cowork/store.js +182 -0
- package/dist/cowork/sync.d.ts +20 -0
- package/dist/cowork/sync.js +164 -0
- package/dist/cowork/types.d.ts +78 -0
- package/dist/cowork/types.js +21 -0
- package/dist/extensions/ext-tools.d.ts +3 -0
- package/dist/extensions/ext-tools.js +73 -0
- package/dist/extensions/loader.d.ts +91 -0
- package/dist/extensions/loader.js +474 -0
- package/dist/extensions/settings.d.ts +20 -0
- package/dist/extensions/settings.js +86 -0
- package/dist/extensions/types.d.ts +219 -0
- package/dist/extensions/types.js +1 -0
- package/dist/horizon/async-queue.d.ts +9 -0
- package/dist/horizon/async-queue.js +46 -0
- package/dist/horizon/engine.d.ts +85 -0
- package/dist/horizon/engine.js +603 -0
- package/dist/horizon/index.d.ts +4 -0
- package/dist/horizon/index.js +2 -0
- package/dist/horizon/main-team.d.ts +163 -0
- package/dist/horizon/main-team.js +774 -0
- package/dist/horizon/types.d.ts +233 -0
- package/dist/horizon/types.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +233 -0
- package/dist/mcp/protocol.d.ts +81 -0
- package/dist/mcp/protocol.js +122 -0
- package/dist/package.json +1 -0
- package/dist/packages/packages.d.ts +12 -0
- package/dist/packages/packages.js +323 -0
- package/dist/prompts/templates.d.ts +13 -0
- package/dist/prompts/templates.js +139 -0
- package/dist/providers/anthropic-oauth.d.ts +13 -0
- package/dist/providers/anthropic-oauth.js +124 -0
- package/dist/providers/anthropic.d.ts +27 -0
- package/dist/providers/anthropic.js +526 -0
- package/dist/providers/catalog.d.ts +15 -0
- package/dist/providers/catalog.js +166 -0
- package/dist/providers/effort.d.ts +12 -0
- package/dist/providers/effort.js +102 -0
- package/dist/providers/model-catalog.d.ts +43 -0
- package/dist/providers/model-catalog.js +70 -0
- package/dist/providers/model-effort.d.ts +5 -0
- package/dist/providers/model-effort.js +43 -0
- package/dist/providers/model-registry.d.ts +39 -0
- package/dist/providers/model-registry.js +142 -0
- package/dist/providers/models-dev.d.ts +9 -0
- package/dist/providers/models-dev.js +97 -0
- package/dist/providers/oauth-callback-server.d.ts +28 -0
- package/dist/providers/oauth-callback-server.js +184 -0
- package/dist/providers/oauth-orchestrator.d.ts +58 -0
- package/dist/providers/oauth-orchestrator.js +159 -0
- package/dist/providers/oauth-store.d.ts +12 -0
- package/dist/providers/oauth-store.js +139 -0
- package/dist/providers/open-browser.d.ts +20 -0
- package/dist/providers/open-browser.js +92 -0
- package/dist/providers/openai-compat.d.ts +14 -0
- package/dist/providers/openai-compat.js +523 -0
- package/dist/providers/openai-oauth.d.ts +15 -0
- package/dist/providers/openai-oauth.js +382 -0
- package/dist/providers/openrouter-auth.d.ts +73 -0
- package/dist/providers/openrouter-auth.js +321 -0
- package/dist/providers/openrouter-manual-fallback.d.ts +25 -0
- package/dist/providers/openrouter-manual-fallback.js +161 -0
- package/dist/providers/openrouter.d.ts +15 -0
- package/dist/providers/openrouter.js +107 -0
- package/dist/providers/plan-limits.d.ts +6 -0
- package/dist/providers/plan-limits.js +175 -0
- package/dist/providers/provider-reset.d.ts +4 -0
- package/dist/providers/provider-reset.js +83 -0
- package/dist/providers/quota-limits.d.ts +4 -0
- package/dist/providers/quota-limits.js +33 -0
- package/dist/providers/registry.d.ts +33 -0
- package/dist/providers/registry.js +213 -0
- package/dist/providers/retry.d.ts +37 -0
- package/dist/providers/retry.js +347 -0
- package/dist/rpc/server.d.ts +23 -0
- package/dist/rpc/server.js +222 -0
- package/dist/sdk.d.ts +67 -0
- package/dist/sdk.js +64 -0
- package/dist/skills/skills.d.ts +17 -0
- package/dist/skills/skills.js +155 -0
- package/dist/text-sanitize.js +28 -0
- package/dist/tools/ask-user.d.ts +2 -0
- package/dist/tools/ask-user.js +60 -0
- package/dist/tools/builtin.d.ts +48 -0
- package/dist/tools/builtin.js +2494 -0
- package/dist/tools/capabilities.d.ts +5 -0
- package/dist/tools/capabilities.js +55 -0
- package/dist/tools/computer-capture.d.ts +2 -0
- package/dist/tools/computer-capture.js +91 -0
- package/dist/tools/computer-posix.d.ts +5 -0
- package/dist/tools/computer-posix.js +136 -0
- package/dist/tools/computer-use.d.ts +14 -0
- package/dist/tools/computer-use.js +108 -0
- package/dist/tools/discovery.d.ts +12 -0
- package/dist/tools/discovery.js +205 -0
- package/dist/tools/execute.d.ts +2 -0
- package/dist/tools/execute.js +73 -0
- package/dist/tools/normalize-input.d.ts +17 -0
- package/dist/tools/normalize-input.js +174 -0
- package/dist/tools/output-artifact.d.ts +3 -0
- package/dist/tools/output-artifact.js +80 -0
- package/dist/tools/pagination.d.ts +15 -0
- package/dist/tools/pagination.js +93 -0
- package/dist/tools/plan-status.d.ts +2 -0
- package/dist/tools/plan-status.js +109 -0
- package/dist/tools/program-input.d.ts +3 -0
- package/dist/tools/program-input.js +19 -0
- package/dist/tools/program.d.ts +3 -0
- package/dist/tools/program.js +567 -0
- package/dist/tools/protocol-catalog.d.ts +12 -0
- package/dist/tools/protocol-catalog.js +46 -0
- package/dist/tools/ramification-tools.d.ts +12 -0
- package/dist/tools/ramification-tools.js +528 -0
- package/dist/tools/regex-compat.d.ts +9 -0
- package/dist/tools/regex-compat.js +96 -0
- package/dist/tools/registry.d.ts +51 -0
- package/dist/tools/registry.js +185 -0
- package/dist/tools/resolve.d.ts +2 -0
- package/dist/tools/resolve.js +107 -0
- package/dist/tools/shell-env.d.ts +2 -0
- package/dist/tools/shell-env.js +7 -0
- package/dist/tools/team-input.d.ts +3 -0
- package/dist/tools/team-input.js +129 -0
- package/dist/tools/team-tools.d.ts +7 -0
- package/dist/tools/team-tools.js +348 -0
- package/dist/tools/workspace-sessions.d.ts +2 -0
- package/dist/tools/workspace-sessions.js +35 -0
- package/dist/tui/account-entry.d.ts +1 -0
- package/dist/tui/account-entry.js +93 -0
- package/dist/tui/attachment-highlight.d.ts +1 -0
- package/dist/tui/attachment-highlight.js +24 -0
- package/dist/tui/attachment-refs.d.ts +2 -0
- package/dist/tui/attachment-refs.js +3 -0
- package/dist/tui/bottom-input.d.ts +219 -0
- package/dist/tui/bottom-input.js +1958 -0
- package/dist/tui/branding.d.ts +107 -0
- package/dist/tui/branding.js +750 -0
- package/dist/tui/clipboard-image.d.ts +10 -0
- package/dist/tui/clipboard-image.js +163 -0
- package/dist/tui/clipboard-text.d.ts +9 -0
- package/dist/tui/clipboard-text.js +51 -0
- package/dist/tui/clipboard-windows.d.ts +8 -0
- package/dist/tui/clipboard-windows.js +84 -0
- package/dist/tui/collapsible-command.d.ts +15 -0
- package/dist/tui/collapsible-command.js +48 -0
- package/dist/tui/command-feedback.d.ts +10 -0
- package/dist/tui/command-feedback.js +46 -0
- package/dist/tui/command-output-registry.d.ts +28 -0
- package/dist/tui/command-output-registry.js +103 -0
- package/dist/tui/command-transcript.d.ts +12 -0
- package/dist/tui/command-transcript.js +90 -0
- package/dist/tui/commands.d.ts +20 -0
- package/dist/tui/commands.js +131 -0
- package/dist/tui/context-bar.d.ts +4 -0
- package/dist/tui/context-bar.js +74 -0
- package/dist/tui/context-meter.d.ts +25 -0
- package/dist/tui/context-meter.js +81 -0
- package/dist/tui/cost-binding.d.ts +8 -0
- package/dist/tui/cost-binding.js +43 -0
- package/dist/tui/cost-tracker.d.ts +49 -0
- package/dist/tui/cost-tracker.js +122 -0
- package/dist/tui/diff.d.ts +9 -0
- package/dist/tui/diff.js +119 -0
- package/dist/tui/i18n-catalog.d.ts +5 -0
- package/dist/tui/i18n-catalog.js +184 -0
- package/dist/tui/i18n.d.ts +6 -0
- package/dist/tui/i18n.js +10 -0
- package/dist/tui/image-attachments.d.ts +46 -0
- package/dist/tui/image-attachments.js +167 -0
- package/dist/tui/images.d.ts +12 -0
- package/dist/tui/images.js +87 -0
- package/dist/tui/intro.d.ts +13 -0
- package/dist/tui/intro.js +109 -0
- package/dist/tui/language-preference.d.ts +6 -0
- package/dist/tui/language-preference.js +24 -0
- package/dist/tui/live-output.d.ts +2 -0
- package/dist/tui/live-output.js +18 -0
- package/dist/tui/locales.d.ts +19 -0
- package/dist/tui/locales.js +22 -0
- package/dist/tui/login-menu.d.ts +17 -0
- package/dist/tui/login-menu.js +58 -0
- package/dist/tui/logo.d.ts +8 -0
- package/dist/tui/logo.js +305 -0
- package/dist/tui/markdown-inline.d.ts +3 -0
- package/dist/tui/markdown-inline.js +99 -0
- package/dist/tui/markdown-table.d.ts +4 -0
- package/dist/tui/markdown-table.js +63 -0
- package/dist/tui/markdown.d.ts +11 -0
- package/dist/tui/markdown.js +257 -0
- package/dist/tui/mcp-transcript.d.ts +7 -0
- package/dist/tui/mcp-transcript.js +40 -0
- package/dist/tui/model-details.d.ts +2 -0
- package/dist/tui/model-details.js +21 -0
- package/dist/tui/model-selection.d.ts +7 -0
- package/dist/tui/model-selection.js +41 -0
- package/dist/tui/native-scrollback.d.ts +27 -0
- package/dist/tui/native-scrollback.js +134 -0
- package/dist/tui/onboarding.d.ts +72 -0
- package/dist/tui/onboarding.js +207 -0
- package/dist/tui/paste-collapse.d.ts +39 -0
- package/dist/tui/paste-collapse.js +117 -0
- package/dist/tui/perm-mode.d.ts +8 -0
- package/dist/tui/perm-mode.js +41 -0
- package/dist/tui/prompt-queue-store.d.ts +26 -0
- package/dist/tui/prompt-queue-store.js +87 -0
- package/dist/tui/prompt-queue.d.ts +47 -0
- package/dist/tui/prompt-queue.js +187 -0
- package/dist/tui/provider-menu.d.ts +33 -0
- package/dist/tui/provider-menu.js +175 -0
- package/dist/tui/question.d.ts +24 -0
- package/dist/tui/question.js +32 -0
- package/dist/tui/queue-screen.d.ts +25 -0
- package/dist/tui/queue-screen.js +152 -0
- package/dist/tui/queue-team.d.ts +3 -0
- package/dist/tui/queue-team.js +28 -0
- package/dist/tui/queued-questions.d.ts +20 -0
- package/dist/tui/queued-questions.js +163 -0
- package/dist/tui/quick-help.d.ts +1 -0
- package/dist/tui/quick-help.js +53 -0
- package/dist/tui/repl.d.ts +78 -0
- package/dist/tui/repl.js +4130 -0
- package/dist/tui/restore-queued-input.d.ts +3 -0
- package/dist/tui/restore-queued-input.js +20 -0
- package/dist/tui/review-detail.d.ts +6 -0
- package/dist/tui/review-detail.js +56 -0
- package/dist/tui/review-files.d.ts +3 -0
- package/dist/tui/review-files.js +22 -0
- package/dist/tui/review-render.d.ts +22 -0
- package/dist/tui/review-render.js +98 -0
- package/dist/tui/review-screen.d.ts +38 -0
- package/dist/tui/review-screen.js +358 -0
- package/dist/tui/review-store.d.ts +60 -0
- package/dist/tui/review-store.js +270 -0
- package/dist/tui/review-team.d.ts +2 -0
- package/dist/tui/review-team.js +27 -0
- package/dist/tui/selector-mouse.d.ts +26 -0
- package/dist/tui/selector-mouse.js +65 -0
- package/dist/tui/selector.d.ts +51 -0
- package/dist/tui/selector.js +299 -0
- package/dist/tui/session-replay.d.ts +10 -0
- package/dist/tui/session-replay.js +78 -0
- package/dist/tui/session-usage.d.ts +22 -0
- package/dist/tui/session-usage.js +55 -0
- package/dist/tui/skill-transcript.d.ts +5 -0
- package/dist/tui/skill-transcript.js +31 -0
- package/dist/tui/startup.d.ts +5 -0
- package/dist/tui/startup.js +61 -0
- package/dist/tui/status-line-loader.d.ts +8 -0
- package/dist/tui/status-line-loader.js +33 -0
- package/dist/tui/status-line.d.ts +38 -0
- package/dist/tui/status-line.js +213 -0
- package/dist/tui/system-language.d.ts +8 -0
- package/dist/tui/system-language.js +41 -0
- package/dist/tui/task-labels.d.ts +2 -0
- package/dist/tui/task-labels.js +7 -0
- package/dist/tui/term-bg.d.ts +4 -0
- package/dist/tui/term-bg.js +67 -0
- package/dist/tui/terminal-screen.d.ts +12 -0
- package/dist/tui/terminal-screen.js +1 -0
- package/dist/tui/terminal-text.d.ts +7 -0
- package/dist/tui/terminal-text.js +123 -0
- package/dist/tui/theme.d.ts +25 -0
- package/dist/tui/theme.js +383 -0
- package/dist/tui/tool-style.d.ts +7 -0
- package/dist/tui/tool-style.js +119 -0
- package/dist/tui/update-prompt.d.ts +14 -0
- package/dist/tui/update-prompt.js +104 -0
- package/dist/tui/usage-footer.d.ts +9 -0
- package/dist/tui/usage-footer.js +123 -0
- package/dist/tui/vascend-login.d.ts +68 -0
- package/dist/tui/vascend-login.js +355 -0
- package/dist/tui/web-login.d.ts +28 -0
- package/dist/tui/web-login.js +115 -0
- package/dist/vascend/activity-status.d.ts +12 -0
- package/dist/vascend/activity-status.js +68 -0
- package/dist/vascend/architecture-map.d.ts +73 -0
- package/dist/vascend/architecture-map.js +424 -0
- package/dist/vascend/attention-layout.d.ts +19 -0
- package/dist/vascend/attention-layout.js +141 -0
- package/dist/vascend/budget-allocator.d.ts +31 -0
- package/dist/vascend/budget-allocator.js +79 -0
- package/dist/vascend/candidate-collector.d.ts +20 -0
- package/dist/vascend/candidate-collector.js +220 -0
- package/dist/vascend/code-events.d.ts +24 -0
- package/dist/vascend/code-events.js +304 -0
- package/dist/vascend/code-graph-memory.d.ts +38 -0
- package/dist/vascend/code-graph-memory.js +334 -0
- package/dist/vascend/code-graph-runtime.d.ts +19 -0
- package/dist/vascend/code-graph-runtime.js +190 -0
- package/dist/vascend/code-graph-types.d.ts +58 -0
- package/dist/vascend/code-graph-types.js +50 -0
- package/dist/vascend/code-parser.d.ts +4 -0
- package/dist/vascend/code-parser.js +257 -0
- package/dist/vascend/competitor-knowledge.d.ts +53 -0
- package/dist/vascend/competitor-knowledge.js +262 -0
- package/dist/vascend/completeness.d.ts +16 -0
- package/dist/vascend/completeness.js +90 -0
- package/dist/vascend/context-autotuner.d.ts +45 -0
- package/dist/vascend/context-autotuner.js +231 -0
- package/dist/vascend/context-candidate.d.ts +45 -0
- package/dist/vascend/context-candidate.js +150 -0
- package/dist/vascend/context-capsule.d.ts +51 -0
- package/dist/vascend/context-capsule.js +133 -0
- package/dist/vascend/context-fabric.d.ts +108 -0
- package/dist/vascend/context-fabric.js +480 -0
- package/dist/vascend/context-feedback-loop.d.ts +56 -0
- package/dist/vascend/context-feedback-loop.js +204 -0
- package/dist/vascend/context-learning-identity.d.ts +4 -0
- package/dist/vascend/context-learning-identity.js +8 -0
- package/dist/vascend/context-links.d.ts +14 -0
- package/dist/vascend/context-links.js +83 -0
- package/dist/vascend/context-lint.d.ts +22 -0
- package/dist/vascend/context-lint.js +91 -0
- package/dist/vascend/context-market-selection.d.ts +17 -0
- package/dist/vascend/context-market-selection.js +50 -0
- package/dist/vascend/context-metrics.d.ts +25 -0
- package/dist/vascend/context-metrics.js +57 -0
- package/dist/vascend/context-pack-render.d.ts +16 -0
- package/dist/vascend/context-pack-render.js +52 -0
- package/dist/vascend/context-pareto.d.ts +33 -0
- package/dist/vascend/context-pareto.js +165 -0
- package/dist/vascend/context-pattern-explorer.d.ts +41 -0
- package/dist/vascend/context-pattern-explorer.js +276 -0
- package/dist/vascend/context-regret.d.ts +32 -0
- package/dist/vascend/context-regret.js +93 -0
- package/dist/vascend/context-retriever.d.ts +22 -0
- package/dist/vascend/context-retriever.js +243 -0
- package/dist/vascend/context-scope-index.d.ts +5 -0
- package/dist/vascend/context-scope-index.js +96 -0
- package/dist/vascend/context-scorer.d.ts +35 -0
- package/dist/vascend/context-scorer.js +162 -0
- package/dist/vascend/context-search-index.d.ts +12 -0
- package/dist/vascend/context-search-index.js +25 -0
- package/dist/vascend/context-snapshot.d.ts +22 -0
- package/dist/vascend/context-snapshot.js +135 -0
- package/dist/vascend/context-window-compiler.d.ts +42 -0
- package/dist/vascend/context-window-compiler.js +237 -0
- package/dist/vascend/contract-memory.d.ts +61 -0
- package/dist/vascend/contract-memory.js +435 -0
- package/dist/vascend/council.d.ts +58 -0
- package/dist/vascend/council.js +337 -0
- package/dist/vascend/decision-promotion.d.ts +48 -0
- package/dist/vascend/decision-promotion.js +410 -0
- package/dist/vascend/delta-context.d.ts +12 -0
- package/dist/vascend/delta-context.js +36 -0
- package/dist/vascend/dev-context-compiler.d.ts +27 -0
- package/dist/vascend/dev-context-compiler.js +133 -0
- package/dist/vascend/dev-context-layout.d.ts +30 -0
- package/dist/vascend/dev-context-layout.js +262 -0
- package/dist/vascend/evidence-slots.d.ts +14 -0
- package/dist/vascend/evidence-slots.js +55 -0
- package/dist/vascend/expansion-levels.d.ts +15 -0
- package/dist/vascend/expansion-levels.js +178 -0
- package/dist/vascend/file-lock.d.ts +7 -0
- package/dist/vascend/file-lock.js +95 -0
- package/dist/vascend/granular-kingdom.d.ts +25 -0
- package/dist/vascend/granular-kingdom.js +259 -0
- package/dist/vascend/granular-launcher.d.ts +48 -0
- package/dist/vascend/granular-launcher.js +202 -0
- package/dist/vascend/kingdom-bus.d.ts +25 -0
- package/dist/vascend/kingdom-bus.js +54 -0
- package/dist/vascend/kingdom-channel.d.ts +22 -0
- package/dist/vascend/kingdom-channel.js +180 -0
- package/dist/vascend/kingdom-kpi.d.ts +48 -0
- package/dist/vascend/kingdom-kpi.js +172 -0
- package/dist/vascend/kingdom-live.d.ts +28 -0
- package/dist/vascend/kingdom-live.js +61 -0
- package/dist/vascend/kingdom-run.d.ts +18 -0
- package/dist/vascend/kingdom-run.js +506 -0
- package/dist/vascend/kingdom-scribe.d.ts +20 -0
- package/dist/vascend/kingdom-scribe.js +52 -0
- package/dist/vascend/kingdom.d.ts +79 -0
- package/dist/vascend/kingdom.js +870 -0
- package/dist/vascend/lexical-index.d.ts +10 -0
- package/dist/vascend/lexical-index.js +99 -0
- package/dist/vascend/lexical-search.d.ts +29 -0
- package/dist/vascend/lexical-search.js +262 -0
- package/dist/vascend/long-term-context.d.ts +51 -0
- package/dist/vascend/long-term-context.js +194 -0
- package/dist/vascend/mandate.d.ts +33 -0
- package/dist/vascend/mandate.js +107 -0
- package/dist/vascend/memory-packet.d.ts +13 -0
- package/dist/vascend/memory-packet.js +155 -0
- package/dist/vascend/memory-status.d.ts +22 -0
- package/dist/vascend/memory-status.js +73 -0
- package/dist/vascend/memory-store.d.ts +62 -0
- package/dist/vascend/memory-store.js +273 -0
- package/dist/vascend/objective-revision.d.ts +69 -0
- package/dist/vascend/objective-revision.js +319 -0
- package/dist/vascend/patch-plan-store.d.ts +33 -0
- package/dist/vascend/patch-plan-store.js +240 -0
- package/dist/vascend/patch-plan.d.ts +97 -0
- package/dist/vascend/patch-plan.js +345 -0
- package/dist/vascend/plan-progress.d.ts +11 -0
- package/dist/vascend/plan-progress.js +68 -0
- package/dist/vascend/plan-store.d.ts +64 -0
- package/dist/vascend/plan-store.js +460 -0
- package/dist/vascend/proof-chains.d.ts +19 -0
- package/dist/vascend/proof-chains.js +120 -0
- package/dist/vascend/ramification-store.d.ts +25 -0
- package/dist/vascend/ramification-store.js +94 -0
- package/dist/vascend/ramification.d.ts +193 -0
- package/dist/vascend/ramification.js +583 -0
- package/dist/vascend/recall-planner.d.ts +17 -0
- package/dist/vascend/recall-planner.js +109 -0
- package/dist/vascend/requirements.d.ts +31 -0
- package/dist/vascend/requirements.js +151 -0
- package/dist/vascend/reviewer.d.ts +9 -0
- package/dist/vascend/reviewer.js +93 -0
- package/dist/vascend/room-graph.d.ts +29 -0
- package/dist/vascend/room-graph.js +242 -0
- package/dist/vascend/room-memory.d.ts +57 -0
- package/dist/vascend/room-memory.js +631 -0
- package/dist/vascend/runtime.d.ts +84 -0
- package/dist/vascend/runtime.js +286 -0
- package/dist/vascend/self-improve.d.ts +104 -0
- package/dist/vascend/self-improve.js +396 -0
- package/dist/vascend/session-search.d.ts +52 -0
- package/dist/vascend/session-search.js +349 -0
- package/dist/vascend/supersession-graph.d.ts +14 -0
- package/dist/vascend/supersession-graph.js +70 -0
- package/dist/vascend/team-areas.d.ts +9 -0
- package/dist/vascend/team-areas.js +28 -0
- package/dist/vascend/team-handoff.d.ts +24 -0
- package/dist/vascend/team-handoff.js +37 -0
- package/dist/vascend/team-scheduler.d.ts +13 -0
- package/dist/vascend/team-scheduler.js +74 -0
- package/dist/vascend/team-session.d.ts +42 -0
- package/dist/vascend/team-session.js +142 -0
- package/dist/vascend/test-failure-memory.d.ts +76 -0
- package/dist/vascend/test-failure-memory.js +354 -0
- package/dist/vascend/token-market.d.ts +42 -0
- package/dist/vascend/token-market.js +144 -0
- package/dist/vascend/tuner-baseline-store.d.ts +52 -0
- package/dist/vascend/tuner-baseline-store.js +446 -0
- package/dist/vascend/user-profile.d.ts +44 -0
- package/dist/vascend/user-profile.js +131 -0
- package/dist/vascend/vision.d.ts +94 -0
- package/dist/vascend/vision.js +375 -0
- package/dist/vascend/work-agent.d.ts +12 -0
- package/dist/vascend/work-agent.js +83 -0
- package/dist/vascend/work-queue.d.ts +62 -0
- package/dist/vascend/work-queue.js +255 -0
- package/dist/vascend/work-runner.d.ts +64 -0
- package/dist/vascend/work-runner.js +137 -0
- package/dist/vascend/worktree.d.ts +38 -0
- package/dist/vascend/worktree.js +206 -0
- package/dist/vendor/computer-use/README.md +7 -0
- package/dist/vendor/computer-use/computer-desktop.js +211 -0
- package/dist/vendor/computer-use/computer-observe.js +315 -0
- package/dist/vendor/computer-use/computer-scripts.js +1230 -0
- package/dist/vendor/computer-use/computer-tools.js +2136 -0
- package/dist/vendor/computer-use/package.json +1 -0
- package/dist/vendor/computer-use/rac/atomic-input.js +91 -0
- package/dist/vendor/computer-use/rac/grammatica.js +101 -0
- package/dist/vendor/computer-use/rac/parser.js +185 -0
- package/dist/vendor/computer-use/rac/protocol.js +136 -0
- package/install.ps1 +30 -0
- package/install.sh +50 -0
- package/package.json +56 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// Squadre VIVE: chi sta lavorando adesso, per sessione.
|
|
2
|
+
//
|
|
3
|
+
// Il problema che risolve. Finora ingaggiare dei collaboratori voleva dire
|
|
4
|
+
// restare fermi dentro la tool call finche' l'ultimo non aveva finito: l'agente
|
|
5
|
+
// principale era parcheggiato, e "farsi dare una mano DURANTE la conversazione"
|
|
6
|
+
// era inesprimibile — non per una scelta di prodotto, per come era scritto il
|
|
7
|
+
// codice. Qui la promessa del lavoro viene messa da parte invece che attesa, e
|
|
8
|
+
// il turno continua: si puo' parlare con chi lavora, correggerlo, e raccogliere
|
|
9
|
+
// i risultati quando ha senso.
|
|
10
|
+
//
|
|
11
|
+
// Registro di processo, non persistenza: una squadra vive quanto il processo
|
|
12
|
+
// che la esegue. Cio' che deve sopravvivere alla sessione sta nel piano a rami
|
|
13
|
+
// e nella memoria, non qui.
|
|
14
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
15
|
+
import { saveTeamHandoff } from "./team-handoff.js";
|
|
16
|
+
const teams = new Map();
|
|
17
|
+
function key(sessionId, teamId) {
|
|
18
|
+
return `${sessionId}\u0000${teamId}`;
|
|
19
|
+
}
|
|
20
|
+
function snapshot(team) {
|
|
21
|
+
return {
|
|
22
|
+
revision: team.revision,
|
|
23
|
+
...(team.persistenceError ? { persistenceError: team.persistenceError } : {}),
|
|
24
|
+
id: team.id,
|
|
25
|
+
sessionId: team.sessionId,
|
|
26
|
+
members: team.members,
|
|
27
|
+
startedAt: team.startedAt,
|
|
28
|
+
work: team.work,
|
|
29
|
+
done: team.done,
|
|
30
|
+
report: team.report,
|
|
31
|
+
failed: team.failed,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// Registra una squadra appena avviata. La promessa NON viene attesa qui: le si
|
|
35
|
+
// attacca solo come finira', cosi' il registro sa dire "hanno finito" senza che
|
|
36
|
+
// nessuno sia rimasto ad aspettare.
|
|
37
|
+
export function registerTeam(input) {
|
|
38
|
+
const team = {
|
|
39
|
+
sessionDir: input.sessionDir,
|
|
40
|
+
revision: 0,
|
|
41
|
+
id: input.id,
|
|
42
|
+
sessionId: input.sessionId,
|
|
43
|
+
members: input.members.map((member) => ({ ...member, status: member.status ?? "queued" })),
|
|
44
|
+
startedAt: input.at,
|
|
45
|
+
work: input.work,
|
|
46
|
+
done: false,
|
|
47
|
+
report: "",
|
|
48
|
+
failed: false,
|
|
49
|
+
};
|
|
50
|
+
teams.set(key(input.sessionId, input.id), team);
|
|
51
|
+
checkpoint(team);
|
|
52
|
+
void input.work.then((report) => {
|
|
53
|
+
team.done = true;
|
|
54
|
+
team.report = String(report ?? "");
|
|
55
|
+
team.failed = team.members.some((member) => member.status === "failed");
|
|
56
|
+
team.members = team.members.map((member) => ({ ...member,
|
|
57
|
+
status: member.status === "failed" ? "failed" : "completed" }));
|
|
58
|
+
checkpoint(team);
|
|
59
|
+
}, (error) => {
|
|
60
|
+
team.done = true;
|
|
61
|
+
team.failed = true;
|
|
62
|
+
team.report = error instanceof Error ? error.message : String(error);
|
|
63
|
+
team.members = team.members.map((member) => member.status === "completed" ? member
|
|
64
|
+
: { ...member, status: "failed", error: team.report });
|
|
65
|
+
checkpoint(team);
|
|
66
|
+
});
|
|
67
|
+
return snapshot(team);
|
|
68
|
+
}
|
|
69
|
+
// La squadra piu' recente di questa sessione. E' quella con cui si parla quando
|
|
70
|
+
// non se ne indica una: nella pratica ce n'e' una sola per volta.
|
|
71
|
+
export function teamForSession(sessionId) {
|
|
72
|
+
let ultima = null;
|
|
73
|
+
for (const team of teams.values()) {
|
|
74
|
+
if (team.sessionId !== sessionId)
|
|
75
|
+
continue;
|
|
76
|
+
if (!ultima || team.startedAt >= ultima.startedAt)
|
|
77
|
+
ultima = team;
|
|
78
|
+
}
|
|
79
|
+
return ultima ? snapshot(ultima) : null;
|
|
80
|
+
}
|
|
81
|
+
export function teamById(sessionId, teamId) {
|
|
82
|
+
const team = teams.get(key(sessionId, teamId));
|
|
83
|
+
return team ? snapshot(team) : null;
|
|
84
|
+
}
|
|
85
|
+
// Quelli che stanno ancora lavorando, per dirlo a chi chiede.
|
|
86
|
+
export function pendingMembers(team) {
|
|
87
|
+
return team.done ? [] : team.members.filter((member) => member.status !== "completed" && member.status !== "failed").map((m) => m.slug);
|
|
88
|
+
}
|
|
89
|
+
export function teamByKingdom(teamId) {
|
|
90
|
+
for (const team of teams.values())
|
|
91
|
+
if (team.id === teamId)
|
|
92
|
+
return snapshot(team);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
export function updateTeamMember(teamId, slug, patch) {
|
|
96
|
+
for (const team of teams.values()) {
|
|
97
|
+
if (team.id !== teamId)
|
|
98
|
+
continue;
|
|
99
|
+
team.members = team.members.map((member) => member.slug === slug ? { ...member, ...patch } : member);
|
|
100
|
+
team.failed = team.members.some((member) => member.status === "failed");
|
|
101
|
+
checkpoint(team);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function checkpoint(team) {
|
|
105
|
+
if (!team.sessionDir) {
|
|
106
|
+
team.revision++;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
const saved = saveTeamHandoff(team.sessionDir, { id: team.id, sessionId: team.sessionId,
|
|
111
|
+
members: team.members, done: team.done, failed: team.failed, report: team.report });
|
|
112
|
+
team.revision = saved.revision;
|
|
113
|
+
delete team.persistenceError;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
team.persistenceError = error instanceof Error ? error.message : String(error);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export async function waitForTeamChange(team, signal, interrupted) {
|
|
120
|
+
const signature = (current) => JSON.stringify(current.members.map((member) => [member.slug, member.status]));
|
|
121
|
+
const before = signature(team);
|
|
122
|
+
const deadline = Date.now() + 30_000;
|
|
123
|
+
while (!signal.aborted && !interrupted() && Date.now() < deadline) {
|
|
124
|
+
const current = teamById(team.sessionId, team.id);
|
|
125
|
+
if (!current || current.done || signature(current) !== before)
|
|
126
|
+
return;
|
|
127
|
+
try {
|
|
128
|
+
await delay(100, undefined, { signal });
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
export function forgetTeam(sessionId, teamId) {
|
|
136
|
+
teams.delete(key(sessionId, teamId));
|
|
137
|
+
}
|
|
138
|
+
// Solo per i test: il registro e' di processo e non deve travasare da un test
|
|
139
|
+
// all'altro.
|
|
140
|
+
export function __resetTeams() {
|
|
141
|
+
teams.clear();
|
|
142
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type RoomRecord } from "./room-memory.js";
|
|
2
|
+
export type FailureStatus = "open" | "fixed" | "superseded";
|
|
3
|
+
export type TestEventType = "test.failed" | "test.fixed" | "test.superseded";
|
|
4
|
+
export interface TestFailureInput {
|
|
5
|
+
readonly file: string;
|
|
6
|
+
readonly testName?: string;
|
|
7
|
+
readonly command?: string;
|
|
8
|
+
readonly error: string;
|
|
9
|
+
readonly stack?: string;
|
|
10
|
+
readonly suspectedCause?: string;
|
|
11
|
+
readonly fixedBy?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FailureRecord {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly file: string;
|
|
16
|
+
readonly testName?: string;
|
|
17
|
+
readonly command?: string;
|
|
18
|
+
readonly error: string;
|
|
19
|
+
readonly stack?: string;
|
|
20
|
+
readonly suspectedCause?: string;
|
|
21
|
+
readonly fixedBy?: string;
|
|
22
|
+
readonly status: FailureStatus;
|
|
23
|
+
readonly openedAt: number;
|
|
24
|
+
readonly updatedAt: number;
|
|
25
|
+
}
|
|
26
|
+
export interface TestFailureEvent {
|
|
27
|
+
readonly type: TestEventType;
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly file: string;
|
|
30
|
+
readonly testName?: string;
|
|
31
|
+
readonly command?: string;
|
|
32
|
+
readonly error: string;
|
|
33
|
+
readonly stack?: string;
|
|
34
|
+
readonly suspectedCause?: string;
|
|
35
|
+
readonly fixedBy?: string;
|
|
36
|
+
readonly status: FailureStatus;
|
|
37
|
+
readonly at: number;
|
|
38
|
+
}
|
|
39
|
+
export interface TestEventSink {
|
|
40
|
+
emit(event: TestFailureEvent): void;
|
|
41
|
+
}
|
|
42
|
+
export declare function failureId(file: string, testName?: string, command?: string): string;
|
|
43
|
+
export declare function formatTestFailureRecord(room: string, event: TestFailureEvent): RoomRecord;
|
|
44
|
+
export declare class RoomMemoryTestSink implements TestEventSink {
|
|
45
|
+
private readonly sessionDir;
|
|
46
|
+
private readonly storeId;
|
|
47
|
+
private readonly namespace;
|
|
48
|
+
private constructor();
|
|
49
|
+
static open(sessionDir: string, storeId: string, namespace?: string): RoomMemoryTestSink;
|
|
50
|
+
emit(event: TestFailureEvent): void;
|
|
51
|
+
}
|
|
52
|
+
export declare class InMemoryTestSink implements TestEventSink {
|
|
53
|
+
private readonly events;
|
|
54
|
+
emit(event: TestFailureEvent): void;
|
|
55
|
+
all(): readonly TestFailureEvent[];
|
|
56
|
+
ofType(type: TestEventType): readonly TestFailureEvent[];
|
|
57
|
+
}
|
|
58
|
+
export declare class TestFailureMemory {
|
|
59
|
+
private readonly file;
|
|
60
|
+
private readonly sink;
|
|
61
|
+
private events;
|
|
62
|
+
private constructor();
|
|
63
|
+
static open(sessionDir: string, storeId: string, sink?: TestEventSink): TestFailureMemory;
|
|
64
|
+
private load;
|
|
65
|
+
private writeEvent;
|
|
66
|
+
record(input: TestFailureInput, at?: number): FailureRecord;
|
|
67
|
+
markFixed(id: string, fixedBy?: string, at?: number): FailureRecord | undefined;
|
|
68
|
+
markSuperseded(id: string, at?: number): FailureRecord | undefined;
|
|
69
|
+
allEvents(): readonly TestFailureEvent[];
|
|
70
|
+
records(): readonly FailureRecord[];
|
|
71
|
+
byId(id: string): FailureRecord | undefined;
|
|
72
|
+
byFile(file: string): readonly FailureRecord[];
|
|
73
|
+
byTestName(testName: string): readonly FailureRecord[];
|
|
74
|
+
open(): readonly FailureRecord[];
|
|
75
|
+
query(file: string, testName?: string): readonly FailureRecord[];
|
|
76
|
+
}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// Dominio EVENTI TEST FALLITI: TestFailureMemory salva ogni fallimento di
|
|
2
|
+
// test o typecheck come evento del dominio "test.*" e lo rende richiamabile
|
|
3
|
+
// via il tool `recall`, cosi' l'agente non ripete fix gia' tentati e falliti.
|
|
4
|
+
//
|
|
5
|
+
// test.failed — un test/typecheck e' fallito (apertura: status=open)
|
|
6
|
+
// test.fixed — il fallimento e' stato risolto (status=fixed, fixedBy)
|
|
7
|
+
// test.superseded — il fallimento e' stato rimpiazzato da uno piu' recente
|
|
8
|
+
// o non e' piu' rilevante (status=superseded)
|
|
9
|
+
//
|
|
10
|
+
// Ogni fallimento e' un FailureRecord con id stabile (derivato da file +
|
|
11
|
+
// testName + command). Il ciclo di vita e' open -> fixed | superseded.
|
|
12
|
+
// Lo store e' un log append-only (JSONL): lo stato corrente di ogni fallimento
|
|
13
|
+
// si DERIVA riducendo gli eventi in ordine (event sourcing leggero, coerente
|
|
14
|
+
// con MemoryStore). Ogni evento e' anche indicizzato come stanza Danilov
|
|
15
|
+
// (RoomRecord livello 0) cosi' una query recall "questo test e' gia' fallito?"
|
|
16
|
+
// trova causa sospetta e fix gia' tentato.
|
|
17
|
+
//
|
|
18
|
+
// Filosofia del progetto: zero dipendenze a runtime, immutabilita', il sink
|
|
19
|
+
// recall e' una primitiva iniettabile (non hardcoded), nessun throw che possa
|
|
20
|
+
// rompere la pipeline di test che alimenta la memoria.
|
|
21
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
23
|
+
import { dirname, join } from "node:path";
|
|
24
|
+
import { RoomMemory } from "./room-memory.js";
|
|
25
|
+
import { withLockSync } from "./file-lock.js";
|
|
26
|
+
// Id STABILE di un fallimento: stessa coppia (file, testName, command) ->
|
|
27
|
+
// stesso id, cosi' un re-run dello stesso fallimento lo riconosce e non crea
|
|
28
|
+
// duplicati. Hash corto, deterministico, indipendente dal messaggio d'errore
|
|
29
|
+
// (che puo' variare leggermente tra run).
|
|
30
|
+
export function failureId(file, testName, command) {
|
|
31
|
+
const key = `${norm(file)}\u0000${norm(testName)}\u0000${norm(command)}`;
|
|
32
|
+
return "tf_" + createHash("sha1").update(key).digest("hex").slice(0, 12);
|
|
33
|
+
}
|
|
34
|
+
function norm(v) {
|
|
35
|
+
return (v ?? "").trim().toLowerCase();
|
|
36
|
+
}
|
|
37
|
+
// Etichetta umana breve del tipo evento (per titolo/azione Danilov).
|
|
38
|
+
function actionLabel(type) {
|
|
39
|
+
switch (type) {
|
|
40
|
+
case "test.failed": return "fallito";
|
|
41
|
+
case "test.fixed": return "risolto";
|
|
42
|
+
case "test.superseded": return "superato";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Tokenizza valori in termini per l'indice recall: token interi + sotto-parole
|
|
46
|
+
// (split su -, ., _, /, spazi) cosi' un fallimento e' richiamabile cercando
|
|
47
|
+
// anche una sola parola del nome file o del test.
|
|
48
|
+
function terms(...values) {
|
|
49
|
+
const out = new Set();
|
|
50
|
+
for (const v of values) {
|
|
51
|
+
if (!v)
|
|
52
|
+
continue;
|
|
53
|
+
for (const whole of v.toLowerCase().match(/[a-z0-9_./-]{2,}/g) ?? []) {
|
|
54
|
+
const t = whole.replace(/^[^a-z0-9]+|[^a-z0-9]+$/g, "");
|
|
55
|
+
if (t.length >= 2)
|
|
56
|
+
out.add(t);
|
|
57
|
+
for (const part of whole.split(/[-._/\s]+/)) {
|
|
58
|
+
if (part.length >= 2)
|
|
59
|
+
out.add(part);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [...out].filter((t) => t.length >= 2);
|
|
64
|
+
}
|
|
65
|
+
function escapeValue(value) {
|
|
66
|
+
return value.replace(/\s+/g, " ").trim().replace(/"/g, "'");
|
|
67
|
+
}
|
|
68
|
+
// Costruisce il RoomRecord Danilov di un evento test (stanza livello 0).
|
|
69
|
+
// `room` e' l'id assegnato dallo store (namespaced, es. "testfail-R1"). Il body
|
|
70
|
+
// e' un blocco INDICE/DEFINIZIONI/RELAZIONI/OUTPUT, coerente con la memoria,
|
|
71
|
+
// cosi' la ricerca BM25 di RoomMemory lo trova per termini.
|
|
72
|
+
export function formatTestFailureRecord(room, event) {
|
|
73
|
+
const action = actionLabel(event.type);
|
|
74
|
+
const where = event.testName ? `${event.file} :: ${event.testName}` : event.file;
|
|
75
|
+
const title = `${event.type}: ${where}`;
|
|
76
|
+
const indexTerms = [
|
|
77
|
+
...terms(event.file, event.testName, event.command),
|
|
78
|
+
...terms(event.error, event.suspectedCause, event.fixedBy),
|
|
79
|
+
"test",
|
|
80
|
+
"failure",
|
|
81
|
+
"fallimento",
|
|
82
|
+
action,
|
|
83
|
+
event.status,
|
|
84
|
+
];
|
|
85
|
+
const uniqTerms = [...new Set(indexTerms)].filter(Boolean).slice(0, 24);
|
|
86
|
+
const def = [
|
|
87
|
+
`@evento[${room}]: type=${event.type}, action=${action}, status=${event.status}, at=${event.at}`,
|
|
88
|
+
`@fallimento[${event.id}]: file="${escapeValue(event.file)}"${event.testName ? `, test="${escapeValue(event.testName)}"` : ""}${event.command ? `, command="${escapeValue(event.command)}"` : ""}`,
|
|
89
|
+
`@errore[${event.id}]: "${escapeValue(event.error).slice(0, 600)}"`,
|
|
90
|
+
];
|
|
91
|
+
if (event.stack) {
|
|
92
|
+
def.push(`@stack[${event.id}]: "${escapeValue(event.stack).slice(0, 800)}"`);
|
|
93
|
+
}
|
|
94
|
+
if (event.suspectedCause) {
|
|
95
|
+
def.push(`@causa_sospetta[${event.id}]: "${escapeValue(event.suspectedCause).slice(0, 400)}"`);
|
|
96
|
+
}
|
|
97
|
+
if (event.fixedBy) {
|
|
98
|
+
def.push(`@risolto_da[${event.id}]: "${escapeValue(event.fixedBy).slice(0, 400)}"`);
|
|
99
|
+
}
|
|
100
|
+
const rel = `@R: ${room} -> ${event.type} -> fallimento:${event.id} -> status:${event.status} [ ${action} ]`;
|
|
101
|
+
const lesson = event.type === "test.failed"
|
|
102
|
+
? `fix gia' tentato registrato; PRIMA di ritentare consulta causa sospetta e fixedBy per non ripetere un fix fallito`
|
|
103
|
+
: event.type === "test.fixed"
|
|
104
|
+
? `risolto da: ${escapeValue(event.fixedBy ?? "(non indicato)")}`
|
|
105
|
+
: `superato da un fallimento piu' recente o non piu' rilevante`;
|
|
106
|
+
const body = `INDICE
|
|
107
|
+
${uniqTerms.map((t, i) => `${i + 1} = ${t}`).join("\n")}
|
|
108
|
+
|
|
109
|
+
DEFINIZIONI
|
|
110
|
+
${def.join("\n")}
|
|
111
|
+
|
|
112
|
+
RELAZIONI
|
|
113
|
+
${rel}
|
|
114
|
+
|
|
115
|
+
OUTPUT: ${where} ${action} (status=${event.status}); ${lesson}; richiamabile via recall.`;
|
|
116
|
+
return {
|
|
117
|
+
room,
|
|
118
|
+
level: 0,
|
|
119
|
+
title: escapeValue(title).slice(0, 160),
|
|
120
|
+
terms: uniqTerms,
|
|
121
|
+
body,
|
|
122
|
+
children: [],
|
|
123
|
+
parent: null,
|
|
124
|
+
createdAt: event.at,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// Sink concreto su RoomMemory: indicizza ogni evento test come stanza
|
|
128
|
+
// richiamabile via recall. Usa il namespace "testfail" per gli id
|
|
129
|
+
// (testfail-R1, ...) cosi' gli eventi test non collidono con le stanze
|
|
130
|
+
// conversazionali e sono filtrabili. Non lancia mai (best-effort).
|
|
131
|
+
export class RoomMemoryTestSink {
|
|
132
|
+
sessionDir;
|
|
133
|
+
storeId;
|
|
134
|
+
namespace;
|
|
135
|
+
constructor(sessionDir, storeId, namespace) {
|
|
136
|
+
this.sessionDir = sessionDir;
|
|
137
|
+
this.storeId = storeId;
|
|
138
|
+
this.namespace = namespace;
|
|
139
|
+
}
|
|
140
|
+
// `storeId` e' l'id dello store stanze (sessionId o id regno in Kingdoms).
|
|
141
|
+
static open(sessionDir, storeId, namespace = "testfail") {
|
|
142
|
+
return new RoomMemoryTestSink(sessionDir, storeId, namespace);
|
|
143
|
+
}
|
|
144
|
+
emit(event) {
|
|
145
|
+
try {
|
|
146
|
+
const mem = RoomMemory.open(this.sessionDir, this.storeId);
|
|
147
|
+
// Scrittura sicura cross-processo: id monotono su vista fresca.
|
|
148
|
+
mem.appendRoomNamespaced((room) => formatTestFailureRecord(room, event), this.namespace);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
// L'indicizzazione recall e' best-effort: non deve rompere la pipeline.
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Sink in-memory per i test/uso programmatico: tiene gli eventi e li espone.
|
|
156
|
+
export class InMemoryTestSink {
|
|
157
|
+
events = [];
|
|
158
|
+
emit(event) {
|
|
159
|
+
this.events.push(event);
|
|
160
|
+
}
|
|
161
|
+
all() {
|
|
162
|
+
return this.events;
|
|
163
|
+
}
|
|
164
|
+
ofType(type) {
|
|
165
|
+
return this.events.filter((e) => e.type === type);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// Riduce un evento sul record corrente di un fallimento (event sourcing).
|
|
169
|
+
function reduceEvent(prev, event) {
|
|
170
|
+
if (!prev) {
|
|
171
|
+
return {
|
|
172
|
+
id: event.id,
|
|
173
|
+
file: event.file,
|
|
174
|
+
testName: event.testName,
|
|
175
|
+
command: event.command,
|
|
176
|
+
error: event.error,
|
|
177
|
+
stack: event.stack,
|
|
178
|
+
suspectedCause: event.suspectedCause,
|
|
179
|
+
fixedBy: event.fixedBy,
|
|
180
|
+
status: event.status,
|
|
181
|
+
openedAt: event.at,
|
|
182
|
+
updatedAt: event.at,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
...prev,
|
|
187
|
+
// Un nuovo test.failed riapre/aggiorna error e stack; gli altri eventi
|
|
188
|
+
// preservano i dati di apertura ma aggiornano lo stato e le annotazioni.
|
|
189
|
+
error: event.type === "test.failed" ? event.error : prev.error,
|
|
190
|
+
stack: event.type === "test.failed" ? (event.stack ?? prev.stack) : prev.stack,
|
|
191
|
+
suspectedCause: event.suspectedCause ?? prev.suspectedCause,
|
|
192
|
+
fixedBy: event.fixedBy ?? prev.fixedBy,
|
|
193
|
+
status: event.status,
|
|
194
|
+
updatedAt: event.at,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
// TestFailureMemory: registro append-only dei fallimenti di test/typecheck.
|
|
198
|
+
// Persiste gli eventi in <sessionDir>/<storeId>.test-failures.jsonl e deriva
|
|
199
|
+
// lo stato corrente di ogni fallimento riducendo gli eventi in ordine. Emette
|
|
200
|
+
// ogni evento anche al sink recall (RoomMemory) per renderlo richiamabile.
|
|
201
|
+
export class TestFailureMemory {
|
|
202
|
+
file;
|
|
203
|
+
sink;
|
|
204
|
+
events = [];
|
|
205
|
+
constructor(file, sink) {
|
|
206
|
+
this.file = file;
|
|
207
|
+
this.sink = sink;
|
|
208
|
+
}
|
|
209
|
+
// Apre/crea il registro. `sink` di default indicizza su RoomMemory (recall);
|
|
210
|
+
// passare un InMemoryTestSink per test/uso programmatico senza side-effect.
|
|
211
|
+
static open(sessionDir, storeId, sink) {
|
|
212
|
+
const file = join(sessionDir, `${storeId}.test-failures.jsonl`);
|
|
213
|
+
const effectiveSink = sink ?? RoomMemoryTestSink.open(sessionDir, storeId);
|
|
214
|
+
const mem = new TestFailureMemory(file, effectiveSink);
|
|
215
|
+
mem.load();
|
|
216
|
+
return mem;
|
|
217
|
+
}
|
|
218
|
+
load() {
|
|
219
|
+
this.events = [];
|
|
220
|
+
if (!existsSync(this.file))
|
|
221
|
+
return;
|
|
222
|
+
const raw = readFileSync(this.file, "utf8");
|
|
223
|
+
for (const line of raw.split("\n")) {
|
|
224
|
+
if (!line.trim())
|
|
225
|
+
continue;
|
|
226
|
+
try {
|
|
227
|
+
this.events.push(JSON.parse(line));
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// riga corrotta: ignorata
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
writeEvent(event) {
|
|
235
|
+
this.events.push(event);
|
|
236
|
+
mkdirSync(dirname(this.file), { recursive: true });
|
|
237
|
+
withLockSync(this.file, () => {
|
|
238
|
+
appendFileSync(this.file, JSON.stringify(event) + "\n", "utf8");
|
|
239
|
+
});
|
|
240
|
+
this.sink.emit(event);
|
|
241
|
+
}
|
|
242
|
+
// Registra un fallimento di test/typecheck. Apre (o riapre) il fallimento
|
|
243
|
+
// con status=open e ritorna il record corrente. Id stabile su (file,
|
|
244
|
+
// testName, command): un re-run dello stesso fallimento non duplica l'id.
|
|
245
|
+
record(input, at = Date.now()) {
|
|
246
|
+
const id = failureId(input.file, input.testName, input.command);
|
|
247
|
+
const event = {
|
|
248
|
+
type: "test.failed",
|
|
249
|
+
id,
|
|
250
|
+
file: input.file,
|
|
251
|
+
testName: input.testName,
|
|
252
|
+
command: input.command,
|
|
253
|
+
error: input.error,
|
|
254
|
+
stack: input.stack,
|
|
255
|
+
suspectedCause: input.suspectedCause,
|
|
256
|
+
fixedBy: input.fixedBy,
|
|
257
|
+
status: "open",
|
|
258
|
+
at,
|
|
259
|
+
};
|
|
260
|
+
this.writeEvent(event);
|
|
261
|
+
return this.byId(id);
|
|
262
|
+
}
|
|
263
|
+
// Segna un fallimento come risolto (status=fixed). `fixedBy` documenta il fix
|
|
264
|
+
// applicato (cosi' un recall futuro sa cosa ha funzionato). Ritorna il record
|
|
265
|
+
// aggiornato, o undefined se l'id non esiste.
|
|
266
|
+
markFixed(id, fixedBy, at = Date.now()) {
|
|
267
|
+
const cur = this.byId(id);
|
|
268
|
+
if (!cur)
|
|
269
|
+
return undefined;
|
|
270
|
+
const event = {
|
|
271
|
+
...toEventBase(cur),
|
|
272
|
+
type: "test.fixed",
|
|
273
|
+
fixedBy: fixedBy ?? cur.fixedBy,
|
|
274
|
+
status: "fixed",
|
|
275
|
+
at,
|
|
276
|
+
};
|
|
277
|
+
this.writeEvent(event);
|
|
278
|
+
return this.byId(id);
|
|
279
|
+
}
|
|
280
|
+
// Segna un fallimento come superato (status=superseded): non piu' rilevante
|
|
281
|
+
// o rimpiazzato da uno piu' recente. Ritorna il record aggiornato o undefined.
|
|
282
|
+
markSuperseded(id, at = Date.now()) {
|
|
283
|
+
const cur = this.byId(id);
|
|
284
|
+
if (!cur)
|
|
285
|
+
return undefined;
|
|
286
|
+
const event = {
|
|
287
|
+
...toEventBase(cur),
|
|
288
|
+
type: "test.superseded",
|
|
289
|
+
status: "superseded",
|
|
290
|
+
at,
|
|
291
|
+
};
|
|
292
|
+
this.writeEvent(event);
|
|
293
|
+
return this.byId(id);
|
|
294
|
+
}
|
|
295
|
+
// Tutti gli eventi grezzi, in ordine cronologico (log append-only).
|
|
296
|
+
allEvents() {
|
|
297
|
+
return this.events;
|
|
298
|
+
}
|
|
299
|
+
// Vista derivata: lo stato corrente di OGNI fallimento noto (uno per id),
|
|
300
|
+
// ordinato per ultimo aggiornamento (piu' recente prima).
|
|
301
|
+
records() {
|
|
302
|
+
const byId = new Map();
|
|
303
|
+
for (const event of this.events) {
|
|
304
|
+
byId.set(event.id, reduceEvent(byId.get(event.id), event));
|
|
305
|
+
}
|
|
306
|
+
return [...byId.values()].sort((a, b) => b.updatedAt - a.updatedAt);
|
|
307
|
+
}
|
|
308
|
+
// Record corrente di un fallimento per id (undefined se sconosciuto).
|
|
309
|
+
byId(id) {
|
|
310
|
+
let acc;
|
|
311
|
+
for (const event of this.events) {
|
|
312
|
+
if (event.id === id)
|
|
313
|
+
acc = reduceEvent(acc, event);
|
|
314
|
+
}
|
|
315
|
+
return acc;
|
|
316
|
+
}
|
|
317
|
+
// Fallimenti per file (match esatto, normalizzato). Utile per "questo file
|
|
318
|
+
// ha gia' rotto dei test?".
|
|
319
|
+
byFile(file) {
|
|
320
|
+
const key = norm(file);
|
|
321
|
+
return this.records().filter((r) => norm(r.file) === key);
|
|
322
|
+
}
|
|
323
|
+
// Fallimenti per nome del test (match esatto, normalizzato).
|
|
324
|
+
byTestName(testName) {
|
|
325
|
+
const key = norm(testName);
|
|
326
|
+
return this.records().filter((r) => norm(r.testName) === key);
|
|
327
|
+
}
|
|
328
|
+
// I fallimenti ancora APERTI (status=open): quelli su cui c'e' un fix da
|
|
329
|
+
// trovare o da non ripetere.
|
|
330
|
+
open() {
|
|
331
|
+
return this.records().filter((r) => r.status === "open");
|
|
332
|
+
}
|
|
333
|
+
// "Questo test/file e' gia' fallito prima?" — match per file (+ testName se
|
|
334
|
+
// dato), per evitare di ritentare un fix gia' fallito. Ritorna i record che
|
|
335
|
+
// matchano, piu' recente prima.
|
|
336
|
+
query(file, testName) {
|
|
337
|
+
const fkey = norm(file);
|
|
338
|
+
const tkey = testName ? norm(testName) : undefined;
|
|
339
|
+
return this.records().filter((r) => norm(r.file) === fkey && (tkey === undefined || norm(r.testName) === tkey));
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
// Estrae la base evento dai dati correnti di un record (per markFixed/Superseded).
|
|
343
|
+
function toEventBase(r) {
|
|
344
|
+
return {
|
|
345
|
+
id: r.id,
|
|
346
|
+
file: r.file,
|
|
347
|
+
testName: r.testName,
|
|
348
|
+
command: r.command,
|
|
349
|
+
error: r.error,
|
|
350
|
+
stack: r.stack,
|
|
351
|
+
suspectedCause: r.suspectedCause,
|
|
352
|
+
fixedBy: r.fixedBy,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type BestExpansionOptions } from "./expansion-levels.js";
|
|
2
|
+
import { type ContextCapsule, type ExpansionLevel } from "./context-capsule.js";
|
|
3
|
+
export interface CapsuleBid {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly relevance: number;
|
|
6
|
+
readonly dependency: number;
|
|
7
|
+
readonly riskReduction: number;
|
|
8
|
+
readonly novelty: number;
|
|
9
|
+
readonly trust: number;
|
|
10
|
+
readonly tokenCost: number;
|
|
11
|
+
readonly bid: number;
|
|
12
|
+
readonly desiredLevel: ExpansionLevel;
|
|
13
|
+
}
|
|
14
|
+
export interface MarketContext {
|
|
15
|
+
readonly relevance?: ReadonlyMap<string, number>;
|
|
16
|
+
readonly novelty?: ReadonlyMap<string, number>;
|
|
17
|
+
readonly tokenBudget: number;
|
|
18
|
+
readonly expansion?: BestExpansionOptions;
|
|
19
|
+
}
|
|
20
|
+
export declare function computeBid(c: ContextCapsule, ctx: MarketContext): CapsuleBid;
|
|
21
|
+
export interface MarketAllocation {
|
|
22
|
+
readonly capsule: ContextCapsule;
|
|
23
|
+
readonly bid: CapsuleBid;
|
|
24
|
+
readonly level: ExpansionLevel | "drop";
|
|
25
|
+
readonly tokensUsed: number;
|
|
26
|
+
}
|
|
27
|
+
export interface MarketResult {
|
|
28
|
+
readonly admitted: readonly MarketAllocation[];
|
|
29
|
+
readonly dropped: readonly MarketAllocation[];
|
|
30
|
+
readonly tokensUsed: number;
|
|
31
|
+
readonly tokenBudget: number;
|
|
32
|
+
}
|
|
33
|
+
export declare function runTokenMarket(capsules: readonly ContextCapsule[], ctx: MarketContext): MarketResult;
|
|
34
|
+
export interface ZonePricingInput {
|
|
35
|
+
readonly congestion: number;
|
|
36
|
+
readonly stalePenalty: number;
|
|
37
|
+
readonly missionNeed: number;
|
|
38
|
+
}
|
|
39
|
+
export declare function zonePrice(input: ZonePricingInput): number;
|
|
40
|
+
export declare function formatMarketResult(r: MarketResult, opts?: {
|
|
41
|
+
readonly top?: number;
|
|
42
|
+
}): string;
|