@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,38 @@
|
|
|
1
|
+
import { type CodeEdge, type CodeEvent, type CodeImport, type CodeSymbol, type FeatureArea, type TestMapping } from "./code-graph-types.js";
|
|
2
|
+
import { type CodeEventSink } from "./code-events.js";
|
|
3
|
+
export type SourceReader = (file: string) => string | null;
|
|
4
|
+
export interface CodeGraphMemoryOptions {
|
|
5
|
+
readonly sink?: CodeEventSink;
|
|
6
|
+
readonly reader?: SourceReader;
|
|
7
|
+
readonly now?: () => number;
|
|
8
|
+
}
|
|
9
|
+
export declare class CodeGraphMemory {
|
|
10
|
+
private readonly files;
|
|
11
|
+
private readonly sink;
|
|
12
|
+
private readonly reader;
|
|
13
|
+
private readonly clock;
|
|
14
|
+
constructor(opts?: CodeGraphMemoryOptions);
|
|
15
|
+
indexFile(file: string, source: string): readonly CodeEvent[];
|
|
16
|
+
indexFromDisk(file: string): readonly CodeEvent[];
|
|
17
|
+
removeFile(file: string): readonly CodeEvent[];
|
|
18
|
+
private emitAll;
|
|
19
|
+
recordTestResult(testFile: string, passed: boolean, opts?: {
|
|
20
|
+
readonly message?: string;
|
|
21
|
+
readonly covers?: readonly string[];
|
|
22
|
+
}): CodeEvent;
|
|
23
|
+
symbols(): readonly CodeSymbol[];
|
|
24
|
+
symbol(id: string): CodeSymbol | null;
|
|
25
|
+
symbolsOf(file: string): readonly CodeSymbol[];
|
|
26
|
+
apiOf(file: string): readonly string[];
|
|
27
|
+
importsOf(file: string): readonly CodeImport[];
|
|
28
|
+
indexedFiles(): readonly string[];
|
|
29
|
+
dependencyGraph(): readonly CodeEdge[];
|
|
30
|
+
dependents(file: string): readonly string[];
|
|
31
|
+
testMappings(): readonly TestMapping[];
|
|
32
|
+
coveredBy(testFile: string): readonly string[];
|
|
33
|
+
testsFor(sourceFile: string): readonly string[];
|
|
34
|
+
private mappingFor;
|
|
35
|
+
featureAreas(): readonly FeatureArea[];
|
|
36
|
+
private resolveImport;
|
|
37
|
+
private matchIndexed;
|
|
38
|
+
}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
// CodeGraphMemory (metodo Danilov, Memory OS).
|
|
2
|
+
//
|
|
3
|
+
// Indice in-memory della STRUTTURA del repository:
|
|
4
|
+
// - simboli (per id e per file)
|
|
5
|
+
// - import / dipendenze (grafo orientato file -> file)
|
|
6
|
+
// - API pubbliche per file (export)
|
|
7
|
+
// - test mapping (test -> sorgenti coperti, derivato dagli import)
|
|
8
|
+
// - feature areas (raggruppamenti per cartella di dominio)
|
|
9
|
+
//
|
|
10
|
+
// Quando un file viene (ri)indicizzato, fa il DIFF con lo stato precedente ed
|
|
11
|
+
// emette gli eventi del dominio code verso un CodeEventSink iniettabile:
|
|
12
|
+
// code.file.touched, code.symbol.changed, code.import.added,
|
|
13
|
+
// code.api.changed, code.contract.changed.
|
|
14
|
+
// I risultati dei test producono code.test.failed / code.test.passed.
|
|
15
|
+
//
|
|
16
|
+
// Modulo di SOLA INDICIZZAZIONE: legge sorgenti (passati come stringa o via un
|
|
17
|
+
// reader iniettabile) e aggiorna l'indice; non scrive su disco. La persistenza
|
|
18
|
+
// degli eventi e' responsabilita' del sink. Zero dipendenze a runtime.
|
|
19
|
+
import { featureAreaOf, } from "./code-graph-types.js";
|
|
20
|
+
import {} from "./code-events.js";
|
|
21
|
+
import { isTestFile, parseSource, publicApiOf } from "./code-parser.js";
|
|
22
|
+
export class CodeGraphMemory {
|
|
23
|
+
files = new Map();
|
|
24
|
+
sink;
|
|
25
|
+
reader;
|
|
26
|
+
clock;
|
|
27
|
+
constructor(opts = {}) {
|
|
28
|
+
this.sink = opts.sink ?? null;
|
|
29
|
+
this.reader = opts.reader ?? null;
|
|
30
|
+
this.clock = opts.now ?? (() => Date.now());
|
|
31
|
+
}
|
|
32
|
+
// --- indicizzazione -------------------------------------------------------
|
|
33
|
+
// (Ri)indicizza un file dal suo sorgente, diffando con lo stato precedente ed
|
|
34
|
+
// emettendo gli eventi conseguenti. Ritorna gli eventi emessi (per test).
|
|
35
|
+
indexFile(file, source) {
|
|
36
|
+
const norm = normPath(file);
|
|
37
|
+
const parsed = parseSource(norm, source);
|
|
38
|
+
const prev = this.files.get(norm);
|
|
39
|
+
const at = this.clock();
|
|
40
|
+
const area = featureAreaOf(norm);
|
|
41
|
+
const events = [];
|
|
42
|
+
const next = {
|
|
43
|
+
file: norm,
|
|
44
|
+
symbols: new Map(parsed.symbols.map((s) => [s.id, s])),
|
|
45
|
+
imports: parsed.imports,
|
|
46
|
+
api: publicApiOf(parsed),
|
|
47
|
+
isTest: parsed.isTest,
|
|
48
|
+
};
|
|
49
|
+
// 1) file.touched sempre (un file e' stato (ri)visto).
|
|
50
|
+
events.push({ type: "code.file.touched", file: norm, area, at });
|
|
51
|
+
// 2) diff simboli: added / modified (firma) / removed.
|
|
52
|
+
const prevSymbols = prev?.symbols ?? new Map();
|
|
53
|
+
for (const [id, sym] of next.symbols) {
|
|
54
|
+
const before = prevSymbols.get(id);
|
|
55
|
+
if (!before) {
|
|
56
|
+
events.push({ type: "code.symbol.changed", file: norm, symbol: sym, change: "added", area, at });
|
|
57
|
+
// contratto: se il simbolo nasce gia' pubblico con firma.
|
|
58
|
+
if (sym.exported && sym.signature) {
|
|
59
|
+
events.push({ type: "code.contract.changed", file: norm, symbol: sym, area, at });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (before.signature !== sym.signature || before.exported !== sym.exported) {
|
|
63
|
+
events.push({ type: "code.symbol.changed", file: norm, symbol: sym, change: "modified", area, at });
|
|
64
|
+
if (sym.exported && before.signature !== sym.signature) {
|
|
65
|
+
events.push({
|
|
66
|
+
type: "code.contract.changed",
|
|
67
|
+
file: norm,
|
|
68
|
+
symbol: sym,
|
|
69
|
+
previousSignature: before.signature,
|
|
70
|
+
area,
|
|
71
|
+
at,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
for (const [id, before] of prevSymbols) {
|
|
77
|
+
if (!next.symbols.has(id)) {
|
|
78
|
+
events.push({ type: "code.symbol.changed", file: norm, symbol: before, change: "removed", area, at });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// 3) import nuovi.
|
|
82
|
+
const prevModules = new Set((prev?.imports ?? []).map((i) => i.module));
|
|
83
|
+
for (const imp of next.imports) {
|
|
84
|
+
if (!prevModules.has(imp.module)) {
|
|
85
|
+
events.push({ type: "code.import.added", file: norm, import: imp, area, at });
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// 4) api.changed: diff dell'insieme di export.
|
|
89
|
+
const beforeApi = new Set(prev?.api ?? []);
|
|
90
|
+
const afterApi = new Set(next.api);
|
|
91
|
+
const apiAdded = [...afterApi].filter((n) => !beforeApi.has(n));
|
|
92
|
+
const apiRemoved = [...beforeApi].filter((n) => !afterApi.has(n));
|
|
93
|
+
if (prev && (apiAdded.length || apiRemoved.length)) {
|
|
94
|
+
events.push({ type: "code.api.changed", file: norm, apiAdded, apiRemoved, area, at });
|
|
95
|
+
}
|
|
96
|
+
else if (!prev && afterApi.size > 0) {
|
|
97
|
+
// primo index di un file con API pubblica: registra l'API come "aggiunta".
|
|
98
|
+
events.push({ type: "code.api.changed", file: norm, apiAdded: [...afterApi], apiRemoved: [], area, at });
|
|
99
|
+
}
|
|
100
|
+
this.files.set(norm, next);
|
|
101
|
+
this.emitAll(events);
|
|
102
|
+
return events;
|
|
103
|
+
}
|
|
104
|
+
// Indicizza un file leggendolo col reader iniettato. No-op se assente.
|
|
105
|
+
indexFromDisk(file) {
|
|
106
|
+
if (!this.reader)
|
|
107
|
+
return [];
|
|
108
|
+
const src = this.reader(normPath(file));
|
|
109
|
+
if (src == null)
|
|
110
|
+
return [];
|
|
111
|
+
return this.indexFile(file, src);
|
|
112
|
+
}
|
|
113
|
+
// Rimuove un file dall'indice ed emette removed per i suoi simboli.
|
|
114
|
+
removeFile(file) {
|
|
115
|
+
const norm = normPath(file);
|
|
116
|
+
const prev = this.files.get(norm);
|
|
117
|
+
if (!prev)
|
|
118
|
+
return [];
|
|
119
|
+
const at = this.clock();
|
|
120
|
+
const area = featureAreaOf(norm);
|
|
121
|
+
const events = [];
|
|
122
|
+
for (const sym of prev.symbols.values()) {
|
|
123
|
+
events.push({ type: "code.symbol.changed", file: norm, symbol: sym, change: "removed", area, at });
|
|
124
|
+
}
|
|
125
|
+
if (prev.api.length) {
|
|
126
|
+
events.push({ type: "code.api.changed", file: norm, apiAdded: [], apiRemoved: [...prev.api], area, at });
|
|
127
|
+
}
|
|
128
|
+
this.files.delete(norm);
|
|
129
|
+
this.emitAll(events);
|
|
130
|
+
return events;
|
|
131
|
+
}
|
|
132
|
+
emitAll(events) {
|
|
133
|
+
if (!this.sink)
|
|
134
|
+
return;
|
|
135
|
+
for (const e of events) {
|
|
136
|
+
try {
|
|
137
|
+
this.sink.emit(e);
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
// best effort
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// --- risultati test -------------------------------------------------------
|
|
145
|
+
// Registra l'esito di un test ed emette code.test.failed / code.test.passed.
|
|
146
|
+
// `covers` opzionale: se assente, viene derivato dal test mapping (import).
|
|
147
|
+
recordTestResult(testFile, passed, opts = {}) {
|
|
148
|
+
const norm = normPath(testFile);
|
|
149
|
+
const at = this.clock();
|
|
150
|
+
const covers = opts.covers ?? this.coveredBy(norm);
|
|
151
|
+
const area = featureAreaOf(norm);
|
|
152
|
+
const event = passed
|
|
153
|
+
? { type: "code.test.passed", file: norm, testFile: norm, covers, area, at }
|
|
154
|
+
: { type: "code.test.failed", file: norm, testFile: norm, covers, message: opts.message ?? "", area, at };
|
|
155
|
+
this.emitAll([event]);
|
|
156
|
+
return event;
|
|
157
|
+
}
|
|
158
|
+
// --- query / viste --------------------------------------------------------
|
|
159
|
+
// Tutti i simboli indicizzati (ordine di file, poi di riga).
|
|
160
|
+
symbols() {
|
|
161
|
+
const out = [];
|
|
162
|
+
for (const fs of this.files.values())
|
|
163
|
+
out.push(...fs.symbols.values());
|
|
164
|
+
return out.sort((a, b) => a.file.localeCompare(b.file) || a.line - b.line);
|
|
165
|
+
}
|
|
166
|
+
// Simbolo per id (es. "src/foo.ts#bar"), o null.
|
|
167
|
+
symbol(id) {
|
|
168
|
+
for (const fs of this.files.values()) {
|
|
169
|
+
const s = fs.symbols.get(id);
|
|
170
|
+
if (s)
|
|
171
|
+
return s;
|
|
172
|
+
}
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
// Simboli definiti in un file.
|
|
176
|
+
symbolsOf(file) {
|
|
177
|
+
const fs = this.files.get(normPath(file));
|
|
178
|
+
return fs ? [...fs.symbols.values()] : [];
|
|
179
|
+
}
|
|
180
|
+
// API pubblica (export) di un file.
|
|
181
|
+
apiOf(file) {
|
|
182
|
+
return this.files.get(normPath(file))?.api ?? [];
|
|
183
|
+
}
|
|
184
|
+
// Import di un file.
|
|
185
|
+
importsOf(file) {
|
|
186
|
+
return this.files.get(normPath(file))?.imports ?? [];
|
|
187
|
+
}
|
|
188
|
+
// File indicizzati.
|
|
189
|
+
indexedFiles() {
|
|
190
|
+
return [...this.files.keys()].sort();
|
|
191
|
+
}
|
|
192
|
+
// Grafo delle dipendenze: archi file -> file (import relativi risolti a path
|
|
193
|
+
// di file indicizzati). Gli import esterni (pacchetti) non producono archi.
|
|
194
|
+
dependencyGraph() {
|
|
195
|
+
const out = [];
|
|
196
|
+
const seen = new Set();
|
|
197
|
+
for (const fs of this.files.values()) {
|
|
198
|
+
for (const imp of fs.imports) {
|
|
199
|
+
if (imp.external)
|
|
200
|
+
continue;
|
|
201
|
+
const to = this.resolveImport(fs.file, imp.module);
|
|
202
|
+
if (!to)
|
|
203
|
+
continue;
|
|
204
|
+
const key = `${fs.file}->${to}`;
|
|
205
|
+
if (seen.has(key))
|
|
206
|
+
continue;
|
|
207
|
+
seen.add(key);
|
|
208
|
+
out.push({ from: fs.file, to });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return out;
|
|
212
|
+
}
|
|
213
|
+
// File che dipendono (importano) dal file dato (dipendenze inverse).
|
|
214
|
+
dependents(file) {
|
|
215
|
+
const target = normPath(file);
|
|
216
|
+
const out = new Set();
|
|
217
|
+
for (const e of this.dependencyGraph()) {
|
|
218
|
+
if (e.to === target)
|
|
219
|
+
out.add(e.from);
|
|
220
|
+
}
|
|
221
|
+
return [...out].sort();
|
|
222
|
+
}
|
|
223
|
+
// Test mapping: per ogni file di test, i sorgenti che copre (via import) e i
|
|
224
|
+
// simboli sorgente referenziati nel test.
|
|
225
|
+
testMappings() {
|
|
226
|
+
const out = [];
|
|
227
|
+
for (const fs of this.files.values()) {
|
|
228
|
+
if (!fs.isTest)
|
|
229
|
+
continue;
|
|
230
|
+
out.push(this.mappingFor(fs));
|
|
231
|
+
}
|
|
232
|
+
return out.sort((a, b) => a.testFile.localeCompare(b.testFile));
|
|
233
|
+
}
|
|
234
|
+
// Sorgenti coperti da un file di test (path relativi risolti).
|
|
235
|
+
coveredBy(testFile) {
|
|
236
|
+
const fs = this.files.get(normPath(testFile));
|
|
237
|
+
if (!fs || !fs.isTest)
|
|
238
|
+
return [];
|
|
239
|
+
return this.mappingFor(fs).covers;
|
|
240
|
+
}
|
|
241
|
+
// Test che coprono un file sorgente (mappa inversa).
|
|
242
|
+
testsFor(sourceFile) {
|
|
243
|
+
const target = normPath(sourceFile);
|
|
244
|
+
const out = new Set();
|
|
245
|
+
for (const m of this.testMappings()) {
|
|
246
|
+
if (m.covers.includes(target))
|
|
247
|
+
out.add(m.testFile);
|
|
248
|
+
}
|
|
249
|
+
return [...out].sort();
|
|
250
|
+
}
|
|
251
|
+
mappingFor(fs) {
|
|
252
|
+
const covers = new Set();
|
|
253
|
+
const symbols = new Set();
|
|
254
|
+
for (const imp of fs.imports) {
|
|
255
|
+
if (imp.external)
|
|
256
|
+
continue;
|
|
257
|
+
const to = this.resolveImport(fs.file, imp.module);
|
|
258
|
+
if (!to)
|
|
259
|
+
continue;
|
|
260
|
+
covers.add(to);
|
|
261
|
+
// simboli importati dal sorgente coperto
|
|
262
|
+
const api = new Set(this.apiOf(to));
|
|
263
|
+
for (const name of imp.names) {
|
|
264
|
+
if (api.has(name))
|
|
265
|
+
symbols.add(`${to}#${name}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return { testFile: fs.file, covers: [...covers].sort(), symbols: [...symbols].sort() };
|
|
269
|
+
}
|
|
270
|
+
// Feature areas: raggruppa i file indicizzati per cartella di dominio.
|
|
271
|
+
featureAreas() {
|
|
272
|
+
const byArea = new Map();
|
|
273
|
+
for (const file of this.files.keys()) {
|
|
274
|
+
const id = featureAreaOf(file);
|
|
275
|
+
const list = byArea.get(id) ?? [];
|
|
276
|
+
list.push(file);
|
|
277
|
+
byArea.set(id, list);
|
|
278
|
+
}
|
|
279
|
+
return [...byArea.entries()]
|
|
280
|
+
.map(([id, files]) => ({ id, label: id, files: files.sort() }))
|
|
281
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
282
|
+
}
|
|
283
|
+
// Risoluzione di un import relativo a un path di file indicizzato. Prova le
|
|
284
|
+
// estensioni TS/JS e l'index di cartella. Ritorna null se non risolvibile a
|
|
285
|
+
// un file noto (gli archi esistono solo verso file indicizzati).
|
|
286
|
+
resolveImport(fromFile, module) {
|
|
287
|
+
if (module.startsWith(".")) {
|
|
288
|
+
const baseDir = dirOf(fromFile);
|
|
289
|
+
const raw = joinPath(baseDir, module);
|
|
290
|
+
return this.matchIndexed(raw);
|
|
291
|
+
}
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
matchIndexed(rawNoExt) {
|
|
295
|
+
// .js -> prova la controparte .ts (sorgente) e poi .js.
|
|
296
|
+
const candidates = [];
|
|
297
|
+
const base = rawNoExt.replace(/\.[cm]?[jt]sx?$/, "");
|
|
298
|
+
const exts = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs"];
|
|
299
|
+
for (const ext of exts)
|
|
300
|
+
candidates.push(base + ext);
|
|
301
|
+
for (const ext of exts)
|
|
302
|
+
candidates.push(joinPath(rawNoExt, "index" + ext));
|
|
303
|
+
// anche il path cosi' com'e' (se gia' indicizzato con estensione)
|
|
304
|
+
candidates.unshift(rawNoExt);
|
|
305
|
+
for (const c of candidates) {
|
|
306
|
+
const n = normPath(c);
|
|
307
|
+
if (this.files.has(n))
|
|
308
|
+
return n;
|
|
309
|
+
}
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// --- helper path (puri, no node:path per restare leggeri/testabili) --------
|
|
314
|
+
function normPath(p) {
|
|
315
|
+
return p.replace(/\\/g, "/").replace(/^\.\//, "");
|
|
316
|
+
}
|
|
317
|
+
function dirOf(file) {
|
|
318
|
+
const norm = normPath(file);
|
|
319
|
+
const i = norm.lastIndexOf("/");
|
|
320
|
+
return i < 0 ? "" : norm.slice(0, i);
|
|
321
|
+
}
|
|
322
|
+
// Risolve "base" + "./rel" o "../rel" in un path normalizzato senza ".." .
|
|
323
|
+
function joinPath(base, rel) {
|
|
324
|
+
const parts = (base ? base.split("/") : []).filter(Boolean);
|
|
325
|
+
for (const seg of normPath(rel).split("/")) {
|
|
326
|
+
if (seg === "" || seg === ".")
|
|
327
|
+
continue;
|
|
328
|
+
if (seg === "..")
|
|
329
|
+
parts.pop();
|
|
330
|
+
else
|
|
331
|
+
parts.push(seg);
|
|
332
|
+
}
|
|
333
|
+
return parts.join("/");
|
|
334
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToolRegistry } from "../tools/registry.js";
|
|
2
|
+
export interface CodeGraphToolObservation {
|
|
3
|
+
readonly toolName: string;
|
|
4
|
+
readonly input: Readonly<Record<string, unknown>>;
|
|
5
|
+
readonly output: string;
|
|
6
|
+
readonly isError: boolean;
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
readonly sessionDir: string;
|
|
9
|
+
readonly scopeId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CodeGraphObservationResult {
|
|
12
|
+
readonly indexed: boolean;
|
|
13
|
+
readonly file?: string;
|
|
14
|
+
readonly events?: number;
|
|
15
|
+
readonly reason?: "unsupported" | "tool-error" | "outside-project" | "not-source" | "too-large" | "unchanged" | "unreadable";
|
|
16
|
+
}
|
|
17
|
+
export declare function installCodeGraphRuntime(registry: ToolRegistry): void;
|
|
18
|
+
export declare function observeCodeGraphToolResult(observation: CodeGraphToolObservation): CodeGraphObservationResult;
|
|
19
|
+
export declare function resetCodeGraphRuntimes(): void;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// Runtime bridge tra i tool di filesystem e CodeGraphMemory.
|
|
2
|
+
//
|
|
3
|
+
// Il grafo strutturale esisteva gia', ma nessun percorso di produzione lo
|
|
4
|
+
// alimentava. Questo modulo osserva soltanto tool di lettura/scrittura conclusi
|
|
5
|
+
// con successo, indicizza file sorgente confinati nella cwd e persiste gli
|
|
6
|
+
// eventi nel MemoryStore consumato dal Context Window Compiler.
|
|
7
|
+
//
|
|
8
|
+
// Best effort per costruzione: un errore dell'indice non cambia mai l'esito del
|
|
9
|
+
// tool e non puo' interrompere la chat.
|
|
10
|
+
import { createHash } from "node:crypto";
|
|
11
|
+
import { readFileSync, realpathSync, statSync } from "node:fs";
|
|
12
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
13
|
+
import { CodeGraphMemory } from "./code-graph-memory.js";
|
|
14
|
+
import { MemoryStoreCodeEventSink } from "./code-events.js";
|
|
15
|
+
import { normalizeMcpToolResult, textFromMcpToolResult } from "../mcp/protocol.js";
|
|
16
|
+
const SOURCE_EXTENSIONS = new Set([
|
|
17
|
+
".ts", ".tsx", ".mts", ".cts",
|
|
18
|
+
".js", ".jsx", ".mjs", ".cjs",
|
|
19
|
+
]);
|
|
20
|
+
const MAX_SOURCE_BYTES = 2 * 1024 * 1024;
|
|
21
|
+
const MAX_RUNTIMES = 16;
|
|
22
|
+
const OBSERVED_TOOLS = new Set(["read_file", "write_file", "edit_file"]);
|
|
23
|
+
const WRAPPED = Symbol("talos.code-graph-runtime");
|
|
24
|
+
const runtimes = new Map();
|
|
25
|
+
// Decora i tool filesystem gia' presenti nel registro. Il wrapper mantiene il
|
|
26
|
+
// relativo stato direct/deferred e viene attraversato anche da tool_invoke,
|
|
27
|
+
// che recupera lo stesso ToolRegistry. Installazioni ripetute sono no-op.
|
|
28
|
+
export function installCodeGraphRuntime(registry) {
|
|
29
|
+
for (const name of OBSERVED_TOOLS) {
|
|
30
|
+
const original = registry.get(name);
|
|
31
|
+
if (!original || isWrapped(original))
|
|
32
|
+
continue;
|
|
33
|
+
const deferred = registry.isDeferred(name);
|
|
34
|
+
const wrapped = {
|
|
35
|
+
...original,
|
|
36
|
+
handler: async (input, ctx) => {
|
|
37
|
+
const output = await original.handler(input, ctx);
|
|
38
|
+
const textOutput = textFromMcpToolResult(normalizeMcpToolResult(output));
|
|
39
|
+
const scopeId = ctx.roomStoreId ?? ctx.sessionId;
|
|
40
|
+
if (ctx.sessionDir && scopeId) {
|
|
41
|
+
observeCodeGraphToolResult({
|
|
42
|
+
toolName: name,
|
|
43
|
+
input,
|
|
44
|
+
output: textOutput,
|
|
45
|
+
isError: false,
|
|
46
|
+
cwd: ctx.cwd,
|
|
47
|
+
sessionDir: ctx.sessionDir,
|
|
48
|
+
scopeId,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return output;
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(wrapped, WRAPPED, { value: true });
|
|
55
|
+
registry.register(wrapped, deferred);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Osserva un risultato tool e aggiorna il grafo caldo. Non lancia mai.
|
|
59
|
+
export function observeCodeGraphToolResult(observation) {
|
|
60
|
+
try {
|
|
61
|
+
if (!OBSERVED_TOOLS.has(observation.toolName)) {
|
|
62
|
+
return { indexed: false, reason: "unsupported" };
|
|
63
|
+
}
|
|
64
|
+
if (observation.isError || outputLooksFailed(observation.output)) {
|
|
65
|
+
return { indexed: false, reason: "tool-error" };
|
|
66
|
+
}
|
|
67
|
+
const args = toolArguments(observation.input);
|
|
68
|
+
const rawPath = stringArg(args, "path", "file", "file_path");
|
|
69
|
+
if (!rawPath)
|
|
70
|
+
return { indexed: false, reason: "unreadable" };
|
|
71
|
+
const target = confinedSource(observation.cwd, rawPath);
|
|
72
|
+
if (!target)
|
|
73
|
+
return { indexed: false, reason: "outside-project" };
|
|
74
|
+
if (!SOURCE_EXTENSIONS.has(target.extension)) {
|
|
75
|
+
return { indexed: false, file: target.relativePath, reason: "not-source" };
|
|
76
|
+
}
|
|
77
|
+
const stat = statSync(target.absolutePath);
|
|
78
|
+
if (!stat.isFile())
|
|
79
|
+
return { indexed: false, file: target.relativePath, reason: "unreadable" };
|
|
80
|
+
if (stat.size > MAX_SOURCE_BYTES) {
|
|
81
|
+
return { indexed: false, file: target.relativePath, reason: "too-large" };
|
|
82
|
+
}
|
|
83
|
+
const source = readFileSync(target.absolutePath, "utf8");
|
|
84
|
+
const digest = createHash("sha1").update(source).digest("hex");
|
|
85
|
+
const state = runtimeFor(observation);
|
|
86
|
+
if (state.hashes.get(target.relativePath) === digest) {
|
|
87
|
+
return { indexed: false, file: target.relativePath, reason: "unchanged" };
|
|
88
|
+
}
|
|
89
|
+
const events = state.graph.indexFile(target.relativePath, source);
|
|
90
|
+
state.hashes.set(target.relativePath, digest);
|
|
91
|
+
state.lastUsed = Date.now();
|
|
92
|
+
return { indexed: true, file: target.relativePath, events: events.length };
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return { indexed: false, reason: "unreadable" };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Solo per test e teardown di host embedded.
|
|
99
|
+
export function resetCodeGraphRuntimes() {
|
|
100
|
+
runtimes.clear();
|
|
101
|
+
}
|
|
102
|
+
function runtimeFor(observation) {
|
|
103
|
+
const root = canonicalRoot(observation.cwd);
|
|
104
|
+
const key = `${root}\u0000${observation.sessionDir}\u0000${observation.scopeId}`;
|
|
105
|
+
const current = runtimes.get(key);
|
|
106
|
+
if (current) {
|
|
107
|
+
current.lastUsed = Date.now();
|
|
108
|
+
return current;
|
|
109
|
+
}
|
|
110
|
+
const state = {
|
|
111
|
+
graph: new CodeGraphMemory({
|
|
112
|
+
sink: MemoryStoreCodeEventSink.open(observation.sessionDir, observation.scopeId),
|
|
113
|
+
}),
|
|
114
|
+
hashes: new Map(),
|
|
115
|
+
lastUsed: Date.now(),
|
|
116
|
+
};
|
|
117
|
+
runtimes.set(key, state);
|
|
118
|
+
trimRuntimes();
|
|
119
|
+
return state;
|
|
120
|
+
}
|
|
121
|
+
function trimRuntimes() {
|
|
122
|
+
if (runtimes.size <= MAX_RUNTIMES)
|
|
123
|
+
return;
|
|
124
|
+
const oldest = [...runtimes.entries()]
|
|
125
|
+
.sort((a, b) => a[1].lastUsed - b[1].lastUsed || a[0].localeCompare(b[0]))[0];
|
|
126
|
+
if (oldest)
|
|
127
|
+
runtimes.delete(oldest[0]);
|
|
128
|
+
}
|
|
129
|
+
function canonicalRoot(cwd) {
|
|
130
|
+
try {
|
|
131
|
+
return realpathSync(cwd);
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return resolve(cwd);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function confinedSource(cwd, rawPath) {
|
|
138
|
+
try {
|
|
139
|
+
const root = canonicalRoot(cwd);
|
|
140
|
+
const requested = resolve(root, rawPath);
|
|
141
|
+
const absolutePath = realpathSync(requested);
|
|
142
|
+
const rel = relative(root, absolutePath);
|
|
143
|
+
if (!rel || rel === "." || isAbsolute(rel) || rel === ".." || rel.startsWith(`..${sep}`))
|
|
144
|
+
return null;
|
|
145
|
+
const relativePath = rel.replace(/\\/g, "/");
|
|
146
|
+
const match = /\.[^.\/]+$/.exec(relativePath.toLowerCase());
|
|
147
|
+
return { absolutePath, relativePath, extension: match?.[0] ?? "" };
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function toolArguments(input) {
|
|
154
|
+
if (typeof input["path"] === "string" || typeof input["file"] === "string" || typeof input["file_path"] === "string") {
|
|
155
|
+
return input;
|
|
156
|
+
}
|
|
157
|
+
const nested = input["args"] ?? input["arguments"] ?? input["parameters"] ?? input["input"];
|
|
158
|
+
if (nested && typeof nested === "object" && !Array.isArray(nested)) {
|
|
159
|
+
return nested;
|
|
160
|
+
}
|
|
161
|
+
if (typeof nested === "string") {
|
|
162
|
+
try {
|
|
163
|
+
const parsed = JSON.parse(nested);
|
|
164
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
165
|
+
return parsed;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
catch {
|
|
169
|
+
// Un wrapper non interpretabile non deve influire sul tool principale.
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return input;
|
|
173
|
+
}
|
|
174
|
+
function stringArg(input, ...keys) {
|
|
175
|
+
for (const key of keys) {
|
|
176
|
+
const value = input[key];
|
|
177
|
+
if (typeof value === "string" && value.trim())
|
|
178
|
+
return value.trim();
|
|
179
|
+
}
|
|
180
|
+
return "";
|
|
181
|
+
}
|
|
182
|
+
function outputLooksFailed(output) {
|
|
183
|
+
const normalized = output.trim().toLowerCase();
|
|
184
|
+
return /^(errore|eccezione|bloccato)\b/.test(normalized)
|
|
185
|
+
|| normalized.includes("rifiutata dall'utente")
|
|
186
|
+
|| normalized.includes("rifiutato dall'utente");
|
|
187
|
+
}
|
|
188
|
+
function isWrapped(tool) {
|
|
189
|
+
return Boolean(tool[WRAPPED]);
|
|
190
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type SymbolKind = "function" | "class" | "interface" | "type" | "enum" | "const" | "variable" | "method" | "unknown";
|
|
2
|
+
export interface CodeSymbol {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly kind: SymbolKind;
|
|
6
|
+
readonly file: string;
|
|
7
|
+
readonly exported: boolean;
|
|
8
|
+
readonly line: number;
|
|
9
|
+
readonly signature: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CodeImport {
|
|
12
|
+
readonly file: string;
|
|
13
|
+
readonly module: string;
|
|
14
|
+
readonly names: readonly string[];
|
|
15
|
+
readonly external: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface CodeEdge {
|
|
18
|
+
readonly from: string;
|
|
19
|
+
readonly to: string;
|
|
20
|
+
}
|
|
21
|
+
export interface TestMapping {
|
|
22
|
+
readonly testFile: string;
|
|
23
|
+
readonly covers: readonly string[];
|
|
24
|
+
readonly symbols: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export interface FeatureArea {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly files: readonly string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ParsedFile {
|
|
32
|
+
readonly file: string;
|
|
33
|
+
readonly symbols: readonly CodeSymbol[];
|
|
34
|
+
readonly imports: readonly CodeImport[];
|
|
35
|
+
readonly isTest: boolean;
|
|
36
|
+
}
|
|
37
|
+
export type CodeEventType = "code.symbol.changed" | "code.file.touched" | "code.import.added" | "code.api.changed" | "code.contract.changed" | "code.test.failed" | "code.test.passed";
|
|
38
|
+
export type SymbolChange = "added" | "modified" | "removed";
|
|
39
|
+
export interface CodeEvent {
|
|
40
|
+
readonly type: CodeEventType;
|
|
41
|
+
readonly file: string;
|
|
42
|
+
readonly symbol?: CodeSymbol;
|
|
43
|
+
readonly change?: SymbolChange;
|
|
44
|
+
readonly previousSignature?: string;
|
|
45
|
+
readonly import?: CodeImport;
|
|
46
|
+
readonly apiAdded?: readonly string[];
|
|
47
|
+
readonly apiRemoved?: readonly string[];
|
|
48
|
+
readonly testFile?: string;
|
|
49
|
+
readonly covers?: readonly string[];
|
|
50
|
+
readonly message?: string;
|
|
51
|
+
readonly area?: string;
|
|
52
|
+
readonly note?: string;
|
|
53
|
+
readonly at: number;
|
|
54
|
+
}
|
|
55
|
+
export declare function symbolId(file: string, name: string): string;
|
|
56
|
+
export declare function codeActionLabel(type: CodeEventType): string;
|
|
57
|
+
export declare function isPublicName(name: string): boolean;
|
|
58
|
+
export declare function featureAreaOf(file: string): string;
|