@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,182 @@
|
|
|
1
|
+
// Store locale di Cowork: persistenza su filesystem, zero dipendenze.
|
|
2
|
+
//
|
|
3
|
+
// Layout su disco (baseDir, default ~/.talos/cowork):
|
|
4
|
+
// <baseDir>/workspaces.jsonl -> log append-only dei workspace (ultimo vince per id)
|
|
5
|
+
// <baseDir>/<workspaceId>/sessions.jsonl -> log append-only delle sessioni del workspace
|
|
6
|
+
// <baseDir>/<workspaceId>/messages/<sessionId>.jsonl -> messaggi collaborativi
|
|
7
|
+
// <baseDir>/<workspaceId>/sync.jsonl -> sync log locale (vedi sync.ts)
|
|
8
|
+
//
|
|
9
|
+
// Tutto append-only come le Session del core: nessuna riscrittura in-place,
|
|
10
|
+
// stato ricostruito leggendo il log (ultima entry per id vince). Le scritture
|
|
11
|
+
// cross-finestra passano da un lock cooperativo (lockfile atomico).
|
|
12
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
13
|
+
import { homedir } from "node:os";
|
|
14
|
+
import { join } from "node:path";
|
|
15
|
+
import { CoworkError } from "./types.js";
|
|
16
|
+
// Directory di default per i dati Cowork.
|
|
17
|
+
export function defaultCoworkDir(env = process.env) {
|
|
18
|
+
return env["TALOS_COWORK_DIR"] ?? join(env["TALOS_HOME"] ?? join(homedir(), ".talos"), "cowork");
|
|
19
|
+
}
|
|
20
|
+
// Legge un file JSONL ritornando le entry parse-abili (salta righe corrotte).
|
|
21
|
+
function readJsonl(file) {
|
|
22
|
+
if (!existsSync(file))
|
|
23
|
+
return [];
|
|
24
|
+
const out = [];
|
|
25
|
+
for (const line of readFileSync(file, "utf8").split("\n")) {
|
|
26
|
+
if (!line.trim())
|
|
27
|
+
continue;
|
|
28
|
+
try {
|
|
29
|
+
out.push(JSON.parse(line));
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
/* riga corrotta: salta (resilienza come Session.load) */
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
// Riduce un log append-only allo stato corrente: ultima entry per id vince.
|
|
38
|
+
function reduceById(entries) {
|
|
39
|
+
const map = new Map();
|
|
40
|
+
for (const e of entries)
|
|
41
|
+
map.set(e.id, e);
|
|
42
|
+
return map;
|
|
43
|
+
}
|
|
44
|
+
// Lock cooperativo: crea un lockfile in modo atomico (wx). Se esiste, ritenta
|
|
45
|
+
// con backoff fino a timeoutMs. Lock stantii (oltre staleMs) vengono rotti.
|
|
46
|
+
// Esportato per riuso dal sync layer (scritture concorrenti sul sync log).
|
|
47
|
+
export function withLock(lockFile, fn, timeoutMs = 3000, staleMs = 10_000) {
|
|
48
|
+
const start = Date.now();
|
|
49
|
+
for (;;) {
|
|
50
|
+
try {
|
|
51
|
+
writeFileSync(lockFile, String(process.pid), { flag: "wx" });
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Lock occupato: rompilo se stantio (la finestra che lo teneva e' morta).
|
|
56
|
+
try {
|
|
57
|
+
if (existsSync(lockFile) && Date.now() - statSync(lockFile).mtimeMs > staleMs) {
|
|
58
|
+
rmSync(lockFile, { force: true });
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
/* corsa con un altro: ritenta */
|
|
64
|
+
}
|
|
65
|
+
if (Date.now() - start > timeoutMs) {
|
|
66
|
+
throw new CoworkError(`lock non acquisito: ${lockFile}`, "lock_timeout");
|
|
67
|
+
}
|
|
68
|
+
sleepBusy(15);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
return fn();
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
try {
|
|
76
|
+
rmSync(lockFile, { force: true });
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
/* gia' rimosso */
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Attesa busy minima (zero dipendenze, niente async nel percorso di lock).
|
|
84
|
+
function sleepBusy(ms) {
|
|
85
|
+
const end = Date.now() + ms;
|
|
86
|
+
while (Date.now() < end) {
|
|
87
|
+
/* spin breve: i lock Cowork sono a bassa contesa (poche finestre) */
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export class CoworkStore {
|
|
91
|
+
baseDir;
|
|
92
|
+
constructor(baseDir, env = process.env) {
|
|
93
|
+
this.baseDir = baseDir ?? defaultCoworkDir(env);
|
|
94
|
+
mkdirSync(this.baseDir, { recursive: true });
|
|
95
|
+
}
|
|
96
|
+
get workspacesFile() {
|
|
97
|
+
return join(this.baseDir, "workspaces.jsonl");
|
|
98
|
+
}
|
|
99
|
+
workspaceDir(workspaceId) {
|
|
100
|
+
return join(this.baseDir, workspaceId);
|
|
101
|
+
}
|
|
102
|
+
sessionsFile(workspaceId) {
|
|
103
|
+
return join(this.workspaceDir(workspaceId), "sessions.jsonl");
|
|
104
|
+
}
|
|
105
|
+
messagesFile(workspaceId, sessionId) {
|
|
106
|
+
return join(this.workspaceDir(workspaceId), "messages", `${sessionId}.jsonl`);
|
|
107
|
+
}
|
|
108
|
+
syncFile(workspaceId) {
|
|
109
|
+
return join(this.workspaceDir(workspaceId), "sync.jsonl");
|
|
110
|
+
}
|
|
111
|
+
// ---- Workspace -----------------------------------------------------------
|
|
112
|
+
listWorkspaces(includeArchived = false) {
|
|
113
|
+
const map = reduceById(readJsonl(this.workspacesFile));
|
|
114
|
+
return [...map.values()]
|
|
115
|
+
.filter((w) => includeArchived || !w.archived)
|
|
116
|
+
.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
117
|
+
}
|
|
118
|
+
getWorkspace(id) {
|
|
119
|
+
return reduceById(readJsonl(this.workspacesFile)).get(id) ?? null;
|
|
120
|
+
}
|
|
121
|
+
requireWorkspace(id) {
|
|
122
|
+
const w = this.getWorkspace(id);
|
|
123
|
+
if (!w)
|
|
124
|
+
throw new CoworkError(`workspace ${id} inesistente`, "workspace_not_found");
|
|
125
|
+
return w;
|
|
126
|
+
}
|
|
127
|
+
// Persiste un workspace (snapshot completo). Append-only: lo stato e' la
|
|
128
|
+
// riduzione del log, quindi salvare = accodare lo snapshot aggiornato.
|
|
129
|
+
putWorkspace(ws) {
|
|
130
|
+
mkdirSync(this.workspaceDir(ws.id), { recursive: true });
|
|
131
|
+
mkdirSync(join(this.workspaceDir(ws.id), "messages"), { recursive: true });
|
|
132
|
+
withLock(this.workspacesFile + ".lock", () => {
|
|
133
|
+
appendFileSync(this.workspacesFile, JSON.stringify(ws) + "\n", "utf8");
|
|
134
|
+
});
|
|
135
|
+
return ws;
|
|
136
|
+
}
|
|
137
|
+
// ---- Sessioni ------------------------------------------------------------
|
|
138
|
+
listSessions(workspaceId, includeArchived = false) {
|
|
139
|
+
const map = reduceById(readJsonl(this.sessionsFile(workspaceId)));
|
|
140
|
+
return [...map.values()]
|
|
141
|
+
.filter((s) => includeArchived || !s.archived)
|
|
142
|
+
.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
143
|
+
}
|
|
144
|
+
getSession(workspaceId, sessionId) {
|
|
145
|
+
return reduceById(readJsonl(this.sessionsFile(workspaceId))).get(sessionId) ?? null;
|
|
146
|
+
}
|
|
147
|
+
requireSession(workspaceId, sessionId) {
|
|
148
|
+
const s = this.getSession(workspaceId, sessionId);
|
|
149
|
+
if (!s)
|
|
150
|
+
throw new CoworkError(`sessione ${sessionId} inesistente`, "session_not_found");
|
|
151
|
+
return s;
|
|
152
|
+
}
|
|
153
|
+
putSession(session) {
|
|
154
|
+
const file = this.sessionsFile(session.workspaceId);
|
|
155
|
+
mkdirSync(this.workspaceDir(session.workspaceId), { recursive: true });
|
|
156
|
+
withLock(file + ".lock", () => {
|
|
157
|
+
appendFileSync(file, JSON.stringify(session) + "\n", "utf8");
|
|
158
|
+
});
|
|
159
|
+
return session;
|
|
160
|
+
}
|
|
161
|
+
// ---- Messaggi collaborativi ---------------------------------------------
|
|
162
|
+
listMessages(workspaceId, sessionId) {
|
|
163
|
+
return readJsonl(this.messagesFile(workspaceId, sessionId));
|
|
164
|
+
}
|
|
165
|
+
appendMessage(workspaceId, sessionId, msg) {
|
|
166
|
+
const file = this.messagesFile(workspaceId, sessionId);
|
|
167
|
+
mkdirSync(join(this.workspaceDir(workspaceId), "messages"), { recursive: true });
|
|
168
|
+
withLock(file + ".lock", () => {
|
|
169
|
+
appendFileSync(file, JSON.stringify(msg) + "\n", "utf8");
|
|
170
|
+
});
|
|
171
|
+
return msg;
|
|
172
|
+
}
|
|
173
|
+
// ---- Manutenzione --------------------------------------------------------
|
|
174
|
+
// Elenco grezzo degli id workspace presenti su disco (anche orfani).
|
|
175
|
+
diskWorkspaceIds() {
|
|
176
|
+
if (!existsSync(this.baseDir))
|
|
177
|
+
return [];
|
|
178
|
+
return readdirSync(this.baseDir, { withFileTypes: true })
|
|
179
|
+
.filter((d) => d.isDirectory())
|
|
180
|
+
.map((d) => d.name);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CoworkSyncEvent, CoworkSyncListener, CoworkSyncType } from "./types.js";
|
|
2
|
+
export declare class CoworkSyncChannel {
|
|
3
|
+
readonly workspaceId: string;
|
|
4
|
+
private readonly file;
|
|
5
|
+
private readonly clientId;
|
|
6
|
+
private readonly pollMs;
|
|
7
|
+
private watcher;
|
|
8
|
+
private pollTimer;
|
|
9
|
+
private lastSeq;
|
|
10
|
+
private readonly listeners;
|
|
11
|
+
private closed;
|
|
12
|
+
constructor(workspaceId: string, file: string, clientId: string, pollMs?: number);
|
|
13
|
+
publish<P>(type: CoworkSyncType, payload: P): CoworkSyncEvent<P>;
|
|
14
|
+
subscribe(listener: CoworkSyncListener): () => void;
|
|
15
|
+
private drain;
|
|
16
|
+
private ensureWatching;
|
|
17
|
+
private stopWatching;
|
|
18
|
+
poll(): void;
|
|
19
|
+
close(): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Sync layer locale di Cowork: propaga eventi tra finestre/processi della
|
|
2
|
+
// stessa macchina senza un server. Tutto su filesystem, zero dipendenze.
|
|
3
|
+
//
|
|
4
|
+
// Meccanismo:
|
|
5
|
+
// - ogni workspace ha un sync.jsonl append-only (CoworkSyncEvent per riga);
|
|
6
|
+
// - `seq` è monotono per file (max esistente + 1), assegnato sotto lock;
|
|
7
|
+
// - ogni finestra registra un watcher (fs.watch + poll di fallback) e legge
|
|
8
|
+
// le entry oltre l'ultimo seq processato;
|
|
9
|
+
// - gli eventi con `origin` uguale al proprio clientId vengono ignorati
|
|
10
|
+
// (non rieseguo cio' che ho generato io).
|
|
11
|
+
//
|
|
12
|
+
// Robusto a: scritture concorrenti (lock), watcher che non scatta su tutte le
|
|
13
|
+
// piattaforme (poll), righe corrotte (skip), file ancora inesistente.
|
|
14
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, watch } from "node:fs";
|
|
15
|
+
import { dirname } from "node:path";
|
|
16
|
+
import { withLock } from "./store.js";
|
|
17
|
+
// Legge tutte le entry del sync log (skip righe corrotte).
|
|
18
|
+
function readSyncLog(file) {
|
|
19
|
+
if (!existsSync(file))
|
|
20
|
+
return [];
|
|
21
|
+
const out = [];
|
|
22
|
+
for (const line of readFileSync(file, "utf8").split("\n")) {
|
|
23
|
+
if (!line.trim())
|
|
24
|
+
continue;
|
|
25
|
+
try {
|
|
26
|
+
out.push(JSON.parse(line));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
/* riga parziale/corrotta: salta */
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
// Seq massimo presente nel log (0 se vuoto).
|
|
35
|
+
function maxSeq(file) {
|
|
36
|
+
let max = 0;
|
|
37
|
+
for (const e of readSyncLog(file))
|
|
38
|
+
if (e.seq > max)
|
|
39
|
+
max = e.seq;
|
|
40
|
+
return max;
|
|
41
|
+
}
|
|
42
|
+
// Canale di sync per UN workspace. Una finestra ne istanzia uno per workspace
|
|
43
|
+
// aperto; `clientId` la identifica (per filtrare i propri eventi).
|
|
44
|
+
export class CoworkSyncChannel {
|
|
45
|
+
workspaceId;
|
|
46
|
+
file;
|
|
47
|
+
clientId;
|
|
48
|
+
pollMs;
|
|
49
|
+
watcher = null;
|
|
50
|
+
pollTimer = null;
|
|
51
|
+
lastSeq = 0;
|
|
52
|
+
listeners = new Set();
|
|
53
|
+
closed = false;
|
|
54
|
+
constructor(workspaceId, file, clientId, pollMs = 1000) {
|
|
55
|
+
this.workspaceId = workspaceId;
|
|
56
|
+
this.file = file;
|
|
57
|
+
this.clientId = clientId;
|
|
58
|
+
this.pollMs = pollMs;
|
|
59
|
+
mkdirSync(dirname(this.file), { recursive: true });
|
|
60
|
+
// Parti dalla coda: gli eventi storici non vanno rigiocati all'apertura.
|
|
61
|
+
this.lastSeq = maxSeq(this.file);
|
|
62
|
+
}
|
|
63
|
+
// Pubblica un evento. Assegna seq sotto lock (monotono per file) e accoda.
|
|
64
|
+
publish(type, payload) {
|
|
65
|
+
// Prima consegna gli eventi remoti ancora pendenti: pubblicare avanza il
|
|
66
|
+
// cursore, quindi se non li drenassimo ora andrebbero persi (avrebbero seq
|
|
67
|
+
// inferiore al nostro nuovo evento e non verrebbero piu' riletti).
|
|
68
|
+
this.drain();
|
|
69
|
+
const event = withLock(this.file + ".lock", () => {
|
|
70
|
+
const seq = maxSeq(this.file) + 1;
|
|
71
|
+
const ev = {
|
|
72
|
+
seq,
|
|
73
|
+
type,
|
|
74
|
+
workspaceId: this.workspaceId,
|
|
75
|
+
origin: this.clientId,
|
|
76
|
+
ts: Date.now(),
|
|
77
|
+
payload,
|
|
78
|
+
};
|
|
79
|
+
appendFileSync(this.file, JSON.stringify(ev) + "\n", "utf8");
|
|
80
|
+
return ev;
|
|
81
|
+
});
|
|
82
|
+
// Avanzo il mio cursore oltre il mio stesso evento (filtrato per origin).
|
|
83
|
+
if (event.seq > this.lastSeq)
|
|
84
|
+
this.lastSeq = event.seq;
|
|
85
|
+
return event;
|
|
86
|
+
}
|
|
87
|
+
// Registra un listener per gli eventi ALTRUI (origin diverso). Ritorna una
|
|
88
|
+
// funzione per disiscriversi.
|
|
89
|
+
subscribe(listener) {
|
|
90
|
+
this.listeners.add(listener);
|
|
91
|
+
this.ensureWatching();
|
|
92
|
+
return () => {
|
|
93
|
+
this.listeners.delete(listener);
|
|
94
|
+
if (this.listeners.size === 0)
|
|
95
|
+
this.stopWatching();
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
// Drena gli eventi nuovi (seq > lastSeq) e notifica i listener. Gli eventi
|
|
99
|
+
// generati da questa stessa finestra (origin === clientId) sono saltati.
|
|
100
|
+
drain() {
|
|
101
|
+
if (this.closed)
|
|
102
|
+
return;
|
|
103
|
+
const events = readSyncLog(this.file).filter((e) => e.seq > this.lastSeq);
|
|
104
|
+
if (events.length === 0)
|
|
105
|
+
return;
|
|
106
|
+
for (const ev of events.sort((a, b) => a.seq - b.seq)) {
|
|
107
|
+
if (ev.seq > this.lastSeq)
|
|
108
|
+
this.lastSeq = ev.seq;
|
|
109
|
+
if (ev.origin === this.clientId)
|
|
110
|
+
continue;
|
|
111
|
+
for (const l of this.listeners) {
|
|
112
|
+
try {
|
|
113
|
+
l(ev);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
/* listener difettoso: non blocca gli altri */
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
ensureWatching() {
|
|
122
|
+
if (this.watcher || this.pollTimer)
|
|
123
|
+
return;
|
|
124
|
+
// fs.watch è reattivo ma non affidabile su tutte le piattaforme/FS: lo
|
|
125
|
+
// affianchiamo a un poll di sicurezza a bassa frequenza.
|
|
126
|
+
try {
|
|
127
|
+
this.watcher = watch(dirname(this.file), (_event, filename) => {
|
|
128
|
+
if (!filename || String(filename).startsWith("sync.jsonl"))
|
|
129
|
+
this.drain();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
/* watch non disponibile: il poll basta */
|
|
134
|
+
}
|
|
135
|
+
this.pollTimer = setInterval(() => this.drain(), this.pollMs);
|
|
136
|
+
// Non tenere vivo il processo solo per il poll del sync.
|
|
137
|
+
if (typeof this.pollTimer.unref === "function")
|
|
138
|
+
this.pollTimer.unref();
|
|
139
|
+
}
|
|
140
|
+
stopWatching() {
|
|
141
|
+
if (this.watcher) {
|
|
142
|
+
try {
|
|
143
|
+
this.watcher.close();
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
/* gia' chiuso */
|
|
147
|
+
}
|
|
148
|
+
this.watcher = null;
|
|
149
|
+
}
|
|
150
|
+
if (this.pollTimer) {
|
|
151
|
+
clearInterval(this.pollTimer);
|
|
152
|
+
this.pollTimer = null;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Forza un drain immediato (utile nei test e dopo una publish remota nota).
|
|
156
|
+
poll() {
|
|
157
|
+
this.drain();
|
|
158
|
+
}
|
|
159
|
+
close() {
|
|
160
|
+
this.closed = true;
|
|
161
|
+
this.listeners.clear();
|
|
162
|
+
this.stopWatching();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export interface CoworkMember {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly displayName: string;
|
|
4
|
+
readonly userId?: string;
|
|
5
|
+
readonly role: CoworkRole;
|
|
6
|
+
readonly joinedAt: number;
|
|
7
|
+
}
|
|
8
|
+
export type CoworkRole = "owner" | "editor" | "viewer";
|
|
9
|
+
export interface CoworkPresence {
|
|
10
|
+
readonly memberId: string;
|
|
11
|
+
readonly displayName: string;
|
|
12
|
+
readonly clientId: string;
|
|
13
|
+
readonly activeSessionId: string | null;
|
|
14
|
+
readonly status: PresenceStatus;
|
|
15
|
+
readonly lastSeen: number;
|
|
16
|
+
}
|
|
17
|
+
export type PresenceStatus = "online" | "idle" | "offline";
|
|
18
|
+
export interface CoworkWorkspace {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly root: string;
|
|
22
|
+
readonly model: string;
|
|
23
|
+
readonly members: readonly CoworkMember[];
|
|
24
|
+
readonly createdBy: string;
|
|
25
|
+
readonly createdAt: number;
|
|
26
|
+
readonly updatedAt: number;
|
|
27
|
+
readonly archived: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface CoworkWorkspacePatch {
|
|
30
|
+
readonly name?: string;
|
|
31
|
+
readonly model?: string;
|
|
32
|
+
readonly archived?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface CoworkSession {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly workspaceId: string;
|
|
37
|
+
readonly title: string;
|
|
38
|
+
readonly model: string;
|
|
39
|
+
readonly createdBy: string;
|
|
40
|
+
readonly createdAt: number;
|
|
41
|
+
readonly updatedAt: number;
|
|
42
|
+
readonly contributors: readonly string[];
|
|
43
|
+
readonly archived: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface CoworkMessage {
|
|
46
|
+
readonly role: "user" | "assistant" | "tool";
|
|
47
|
+
readonly text: string;
|
|
48
|
+
readonly authorId?: string;
|
|
49
|
+
readonly toolCalls?: readonly unknown[];
|
|
50
|
+
readonly toolResults?: readonly unknown[];
|
|
51
|
+
readonly ts: number;
|
|
52
|
+
}
|
|
53
|
+
export type CoworkSyncType = "workspace_created" | "workspace_updated" | "workspace_archived" | "member_joined" | "member_left" | "session_created" | "session_updated" | "session_archived" | "message_appended" | "agent_event" | "presence";
|
|
54
|
+
export interface CoworkSyncEvent<P = unknown> {
|
|
55
|
+
readonly seq: number;
|
|
56
|
+
readonly type: CoworkSyncType;
|
|
57
|
+
readonly workspaceId: string;
|
|
58
|
+
readonly origin: string;
|
|
59
|
+
readonly ts: number;
|
|
60
|
+
readonly payload: P;
|
|
61
|
+
}
|
|
62
|
+
export interface MessageAppendedPayload {
|
|
63
|
+
readonly sessionId: string;
|
|
64
|
+
readonly message: CoworkMessage;
|
|
65
|
+
}
|
|
66
|
+
export interface AgentEventPayload {
|
|
67
|
+
readonly sessionId: string;
|
|
68
|
+
readonly event: unknown;
|
|
69
|
+
}
|
|
70
|
+
export interface PresencePayload {
|
|
71
|
+
readonly presence: CoworkPresence;
|
|
72
|
+
}
|
|
73
|
+
export type CoworkSyncListener = (event: CoworkSyncEvent) => void;
|
|
74
|
+
export declare class CoworkError extends Error {
|
|
75
|
+
readonly code: CoworkErrorCode;
|
|
76
|
+
constructor(message: string, code: CoworkErrorCode);
|
|
77
|
+
}
|
|
78
|
+
export type CoworkErrorCode = "workspace_not_found" | "session_not_found" | "member_not_found" | "permission_denied" | "lock_timeout" | "invalid_state";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Cowork: modulo desktop collaborativo interno. Workspace condivisi, sessioni
|
|
2
|
+
// agente e sincronizzazione locale tra finestre/processi della stessa macchina.
|
|
3
|
+
//
|
|
4
|
+
// Il motore sottostante e' Vascend Talos (bootstrap/runTurn via SDK). Cowork
|
|
5
|
+
// aggiunge sopra l'engine il concetto di WORKSPACE condiviso (cartella +
|
|
6
|
+
// membri + sessioni) e un SYNC layer locale append-only che propaga gli eventi
|
|
7
|
+
// alle altre finestre desktop senza un server (tutto su filesystem).
|
|
8
|
+
//
|
|
9
|
+
// Filosofia di progetto: zero dipendenze a runtime, immutabilita', file
|
|
10
|
+
// piccoli. Persistenza JSONL append-only come le sessioni del core.
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Errori di dominio
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
export class CoworkError extends Error {
|
|
15
|
+
code;
|
|
16
|
+
constructor(message, code) {
|
|
17
|
+
super(message);
|
|
18
|
+
this.code = code;
|
|
19
|
+
this.name = "CoworkError";
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Tool CORE che danno all'agente visibilita' e controllo sulle estensioni.
|
|
2
|
+
// Non sono deferred: poche voci, utili spesso (l'utente le chiede esplicitamente).
|
|
3
|
+
export function registerExtensionTools(tools, host) {
|
|
4
|
+
tools.register({
|
|
5
|
+
name: "extensions_list",
|
|
6
|
+
description: "Elenca le estensioni installate in .talos/extensions con il loro stato (abilitata/caricata) e cosa registrano (tool, comandi, shortcut, eventi, hook) piu' le impostazioni correnti.",
|
|
7
|
+
schema: { type: "object", properties: {} },
|
|
8
|
+
handler: async () => {
|
|
9
|
+
const inv = host.inventory();
|
|
10
|
+
if (!inv.length)
|
|
11
|
+
return "Nessuna estensione installata in .talos/extensions.";
|
|
12
|
+
const lines = inv.map((e) => {
|
|
13
|
+
const state = e.enabled ? (e.loaded ? "abilitata" : "abilitata (non caricata)") : "DISABILITATA";
|
|
14
|
+
const reg = [];
|
|
15
|
+
if (e.tools.length)
|
|
16
|
+
reg.push(`tool: ${e.tools.join(", ")}`);
|
|
17
|
+
if (e.commands.length)
|
|
18
|
+
reg.push(`comandi: /${e.commands.join(", /")}`);
|
|
19
|
+
if (e.shortcuts.length)
|
|
20
|
+
reg.push(`shortcut: ${e.shortcuts.join(", ")}`);
|
|
21
|
+
if (e.flags.length)
|
|
22
|
+
reg.push(`flag: ${e.flags.join(", ")}`);
|
|
23
|
+
if (e.renderers.length)
|
|
24
|
+
reg.push(`renderer: ${e.renderers.join(", ")}`);
|
|
25
|
+
if (e.providers.length)
|
|
26
|
+
reg.push(`provider: ${e.providers.join(", ")}`);
|
|
27
|
+
if (e.events.length)
|
|
28
|
+
reg.push(`eventi: ${e.events.join(", ")}`);
|
|
29
|
+
if (e.systemHooks)
|
|
30
|
+
reg.push(`hook system prompt: ${e.systemHooks}`);
|
|
31
|
+
const opts = Object.keys(e.options).length ? `\n impostazioni: ${JSON.stringify(e.options)}` : "";
|
|
32
|
+
return `- ${e.id} [${state}]${reg.length ? `\n ${reg.join("\n ")}` : "\n (nessuna registrazione)"}${opts}`;
|
|
33
|
+
});
|
|
34
|
+
return lines.join("\n");
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
tools.register({
|
|
38
|
+
name: "extensions_set",
|
|
39
|
+
description: "Gestisce un'estensione: abilitala/disabilitala o imposta un'opzione. L'impostazione e' persistita e le estensioni vengono ricaricate. Indica l'estensione con il nome del file (es. 'background-run.ts', anche senza estensione).",
|
|
40
|
+
schema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
id: { type: "string", description: "nome del file estensione (es. background-run.ts)" },
|
|
44
|
+
enabled: { type: "boolean", description: "abilita (true) o disabilita (false) l'estensione" },
|
|
45
|
+
option_key: { type: "string", description: "chiave dell'opzione da impostare" },
|
|
46
|
+
option_value: { description: "valore dell'opzione (JSON: stringa/numero/bool/oggetto)" },
|
|
47
|
+
},
|
|
48
|
+
required: ["id"],
|
|
49
|
+
},
|
|
50
|
+
handler: async (input) => {
|
|
51
|
+
const args = input;
|
|
52
|
+
const id = host.resolveId(args.id);
|
|
53
|
+
if (!id)
|
|
54
|
+
return `Estensione '${args.id}' non trovata in .talos/extensions.`;
|
|
55
|
+
const done = [];
|
|
56
|
+
if (typeof args.enabled === "boolean") {
|
|
57
|
+
const r = await host.setEnabled(id, args.enabled);
|
|
58
|
+
if (!r.ok)
|
|
59
|
+
return r.reason ?? "operazione fallita";
|
|
60
|
+
done.push(args.enabled ? "abilitata" : "disabilitata");
|
|
61
|
+
}
|
|
62
|
+
if (args.option_key) {
|
|
63
|
+
const r = await host.setOption(id, args.option_key, args.option_value);
|
|
64
|
+
if (!r.ok)
|
|
65
|
+
return r.reason ?? "operazione fallita";
|
|
66
|
+
done.push(`opzione '${args.option_key}' impostata`);
|
|
67
|
+
}
|
|
68
|
+
if (!done.length)
|
|
69
|
+
return `Nessuna modifica indicata per '${id}'. Usa enabled e/o option_key.`;
|
|
70
|
+
return `${id}: ${done.join(", ")}. Estensioni ricaricate.`;
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { ToolRegistry } from "../tools/registry.js";
|
|
2
|
+
import type { ExtensionApi, ExtensionContext, ExtensionEvents, ExtensionUi, EventName, EventOutcome, FlagDef, MessageRenderer, ShortcutDef, SlashCommand, CustomProviderConfig } from "./types.js";
|
|
3
|
+
export interface HostBindings {
|
|
4
|
+
readonly ui?: ExtensionUi;
|
|
5
|
+
readonly mode?: ExtensionContext["mode"];
|
|
6
|
+
readonly isProjectTrusted?: () => boolean;
|
|
7
|
+
readonly contextUsage?: () => {
|
|
8
|
+
tokens: number;
|
|
9
|
+
window: number;
|
|
10
|
+
};
|
|
11
|
+
readonly systemPrompt?: () => string;
|
|
12
|
+
readonly registerProvider?: (name: string, config: CustomProviderConfig) => void;
|
|
13
|
+
readonly unregisterProvider?: (name: string) => void;
|
|
14
|
+
readonly setSessionName?: (name: string) => void;
|
|
15
|
+
readonly setLabel?: (entryId: string, label: string) => void;
|
|
16
|
+
readonly appendEntry?: (customType: string, data?: unknown) => void;
|
|
17
|
+
readonly sessionEntries?: () => readonly import("../core/session.js").SessionNode[];
|
|
18
|
+
readonly sessionLeafId?: () => string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface ExtensionInfo {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly enabled: boolean;
|
|
23
|
+
readonly loaded: boolean;
|
|
24
|
+
readonly tools: readonly string[];
|
|
25
|
+
readonly commands: readonly string[];
|
|
26
|
+
readonly shortcuts: readonly string[];
|
|
27
|
+
readonly flags: readonly string[];
|
|
28
|
+
readonly renderers: readonly string[];
|
|
29
|
+
readonly providers: readonly string[];
|
|
30
|
+
readonly events: readonly string[];
|
|
31
|
+
readonly systemHooks: number;
|
|
32
|
+
readonly options: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export declare class ExtensionHost {
|
|
35
|
+
private readonly tools;
|
|
36
|
+
private readonly cwd;
|
|
37
|
+
readonly commands: Map<string, SlashCommand>;
|
|
38
|
+
readonly shortcuts: Map<string, ShortcutDef>;
|
|
39
|
+
readonly flags: Map<string, FlagDef>;
|
|
40
|
+
readonly renderers: Map<string, MessageRenderer>;
|
|
41
|
+
readonly pendingUserMessages: string[];
|
|
42
|
+
readonly pendingMessages: {
|
|
43
|
+
content: string;
|
|
44
|
+
display: boolean;
|
|
45
|
+
}[];
|
|
46
|
+
private readonly systemHooks;
|
|
47
|
+
private readonly systemAppends;
|
|
48
|
+
private readonly handlers;
|
|
49
|
+
private readonly piFlagValues;
|
|
50
|
+
private readonly sharedEvents;
|
|
51
|
+
private bindings;
|
|
52
|
+
private readonly perExt;
|
|
53
|
+
private currentExt;
|
|
54
|
+
private knownFiles;
|
|
55
|
+
private settings;
|
|
56
|
+
constructor(tools: ToolRegistry, cwd: string);
|
|
57
|
+
bind(bindings: HostBindings): void;
|
|
58
|
+
private slot;
|
|
59
|
+
private ctx;
|
|
60
|
+
private adaptTool;
|
|
61
|
+
private api;
|
|
62
|
+
publicApi(): ExtensionApi;
|
|
63
|
+
runFlag(name: string, value: string | undefined): Promise<{
|
|
64
|
+
ok: boolean;
|
|
65
|
+
reason?: string;
|
|
66
|
+
}>;
|
|
67
|
+
hasHandlers(event: EventName): boolean;
|
|
68
|
+
emit<E extends EventName>(event: E, payload: ExtensionEvents[E]): Promise<EventOutcome[]>;
|
|
69
|
+
applySystem(base: string): string;
|
|
70
|
+
loadModule(spec: string, cacheBust?: boolean): Promise<void>;
|
|
71
|
+
loadDir(cacheBust?: boolean): Promise<void>;
|
|
72
|
+
private unloadOne;
|
|
73
|
+
private unloadAll;
|
|
74
|
+
private allTools;
|
|
75
|
+
reload(): Promise<{
|
|
76
|
+
before: string[];
|
|
77
|
+
after: string[];
|
|
78
|
+
added: string[];
|
|
79
|
+
removed: string[];
|
|
80
|
+
}>;
|
|
81
|
+
inventory(): ExtensionInfo[];
|
|
82
|
+
setEnabled(id: string, enabled: boolean): Promise<{
|
|
83
|
+
ok: boolean;
|
|
84
|
+
reason?: string;
|
|
85
|
+
}>;
|
|
86
|
+
setOption(id: string, key: string, value: unknown): Promise<{
|
|
87
|
+
ok: boolean;
|
|
88
|
+
reason?: string;
|
|
89
|
+
}>;
|
|
90
|
+
resolveId(input: string): string | null;
|
|
91
|
+
}
|