@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,259 @@
|
|
|
1
|
+
import { runTurn } from "../core/agent.js";
|
|
2
|
+
import { Session } from "../core/session.js";
|
|
3
|
+
import { createUserInbox } from "../core/user-inbox.js";
|
|
4
|
+
import { kingdomLive } from "./kingdom-live.js";
|
|
5
|
+
import { disjointAreas } from "./team-areas.js";
|
|
6
|
+
import { fileActor, withFileActor } from "../core/file-coordination.js";
|
|
7
|
+
import { launchGranular, granularConcurrency, formatGranularReport, } from "./granular-launcher.js";
|
|
8
|
+
const REF_RE = /^t\d{1,2}$/i;
|
|
9
|
+
function nestedUnits(specs) {
|
|
10
|
+
const seen = new Set();
|
|
11
|
+
return specs.slice(0, 32).flatMap((spec, index) => {
|
|
12
|
+
const id = String(spec.slug || `expert-${index + 1}`).trim()
|
|
13
|
+
.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || `expert-${index + 1}`;
|
|
14
|
+
const goal = String(spec.goal || "").trim();
|
|
15
|
+
if (!goal || seen.has(id.toLowerCase()))
|
|
16
|
+
return [];
|
|
17
|
+
seen.add(id.toLowerCase());
|
|
18
|
+
return [{
|
|
19
|
+
id,
|
|
20
|
+
goal,
|
|
21
|
+
assignment: spec,
|
|
22
|
+
...(spec.after?.length ? { deps: [...spec.after] } : {}),
|
|
23
|
+
}];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function maxTeamDepth(opts) {
|
|
27
|
+
if (Number.isInteger(opts.maxDepth) && Number(opts.maxDepth) > 0)
|
|
28
|
+
return Math.min(5, Number(opts.maxDepth));
|
|
29
|
+
const configured = Number(process.env["TALOS_KINGDOM_MAX_DEPTH"]);
|
|
30
|
+
return Number.isInteger(configured) && configured > 0 ? Math.min(5, configured) : 3;
|
|
31
|
+
}
|
|
32
|
+
function nestedTaskFields(slug) {
|
|
33
|
+
const parts = slug.split("/").filter(Boolean);
|
|
34
|
+
return {
|
|
35
|
+
...(parts[0] ? { workstreamId: parts[0] } : {}),
|
|
36
|
+
...(parts[1] ? { taskRefs: [parts[1]], parentTaskRef: parts[1] } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function nestedActivity(slug, event) {
|
|
40
|
+
if (event.type === "kingdom")
|
|
41
|
+
return event;
|
|
42
|
+
if (event.type === "turn_start")
|
|
43
|
+
return {
|
|
44
|
+
type: "kingdom", phase: "vassal", slug, state: "active", label: "Pianifica il task", ...nestedTaskFields(slug),
|
|
45
|
+
};
|
|
46
|
+
if (event.type === "tool_call" && event.call.name === "team_say") {
|
|
47
|
+
const rawTo = String(event.call.input["to"] ?? "tutti").trim() || "tutti";
|
|
48
|
+
const parts = slug.split("/").filter(Boolean);
|
|
49
|
+
const parent = parts.slice(0, -1).join("/");
|
|
50
|
+
const knownPrefix = parts.includes(rawTo);
|
|
51
|
+
const to = rawTo === "tutti" || rawTo === "orchestratore" || rawTo.includes("/") || knownPrefix
|
|
52
|
+
? rawTo
|
|
53
|
+
: (parent ? `${parent}/${rawTo}` : rawTo);
|
|
54
|
+
return {
|
|
55
|
+
type: "kingdom",
|
|
56
|
+
phase: "message",
|
|
57
|
+
from: slug,
|
|
58
|
+
to,
|
|
59
|
+
kind: "message",
|
|
60
|
+
text: String(event.call.input["text"] ?? "").slice(0, 900),
|
|
61
|
+
...(parts[0] ? { workstreamId: parts[0] } : {}),
|
|
62
|
+
...(parts[1] ? { taskRef: parts[1] } : {}),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (event.type === "tool_call")
|
|
66
|
+
return {
|
|
67
|
+
type: "kingdom", phase: "vassal", slug, state: "active", label: event.call.name, ...nestedTaskFields(slug),
|
|
68
|
+
};
|
|
69
|
+
if (event.type === "done")
|
|
70
|
+
return {
|
|
71
|
+
type: "kingdom", phase: "vassal", slug, state: "done", ...nestedTaskFields(slug),
|
|
72
|
+
};
|
|
73
|
+
if (event.type === "error")
|
|
74
|
+
return {
|
|
75
|
+
type: "kingdom", phase: "vassal", slug, state: "error", label: event.message, ...nestedTaskFields(slug),
|
|
76
|
+
};
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
// Regola di marcatura per una unita' che coincide con una stanza del piano.
|
|
80
|
+
// Senza questa, il lavoro piu' granulare e' anche l'unico invisibile all'utente.
|
|
81
|
+
function markRule(unit, castle) {
|
|
82
|
+
if (!castle || !REF_RE.test(unit.id))
|
|
83
|
+
return "";
|
|
84
|
+
return `\n@attivita[mia]: ${unit.id} del gruppo ${castle}: marcala con vascend_mark(group="${castle}", task="${unit.id}", status="running") all'apertura e "completed" (o "failed") alla chiusura`;
|
|
85
|
+
}
|
|
86
|
+
// Preambolo (notazione Danilov) di una UNITA' granulare: piu' stretto di quello
|
|
87
|
+
// del castello: una sola unita', niente sotto-scomposizione, resta nel confine.
|
|
88
|
+
function unitSteer(unit, peers, castle) {
|
|
89
|
+
const others = peers.filter((p) => p !== unit.id);
|
|
90
|
+
return `[UNITA' ${unit.id}]
|
|
91
|
+
INDICE
|
|
92
|
+
1 = ruolo
|
|
93
|
+
2 = dipendenze
|
|
94
|
+
3 = confine
|
|
95
|
+
|
|
96
|
+
DEFINIZIONI
|
|
97
|
+
@ruolo[unita]: id=${unit.id}, granularita=fine, peer=[${others.join(", ") || "nessuno"}]
|
|
98
|
+
@dipendenze[done]: ${(unit.deps ?? []).join(", ") || "nessuna (gia' soddisfatte: parti subito)"}
|
|
99
|
+
@confine[regola]: esegui SOLO questa unita', NON scomporla ulteriormente, NON toccare il lavoro delle altre unita'${markRule(unit, castle)}
|
|
100
|
+
|
|
101
|
+
RELAZIONI
|
|
102
|
+
@R1: @ruolo[unita] -> @confine[regola] [ una sola unita', niente sovrapposizioni ]
|
|
103
|
+
|
|
104
|
+
OUTPUT: esegui l'unita' e basta; le dipendenze sono gia' completate.
|
|
105
|
+
|
|
106
|
+
OBIETTIVO_UNITA'
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
109
|
+
// Costruisce il TaskRunner che esegue una unita' come sessione di agente.
|
|
110
|
+
export function makeAgentUnitRunner(opts) {
|
|
111
|
+
const { harness, kingdomId, castleSlug, signal, confirm, cwd, isolated } = opts;
|
|
112
|
+
const peers = opts.units.map((u) => u.id);
|
|
113
|
+
const depth = opts.depth ?? 2;
|
|
114
|
+
const maxDepth = maxTeamDepth(opts);
|
|
115
|
+
return async (unit, ctx) => {
|
|
116
|
+
const workerPool = Array.isArray(harness.config.workerModelPool)
|
|
117
|
+
? harness.config.workerModelPool : undefined;
|
|
118
|
+
const unitIndex = Math.max(0, opts.units.findIndex((item) => item.id === unit.id));
|
|
119
|
+
const selected = unit.assignment?.model || (workerPool && workerPool.length
|
|
120
|
+
? workerPool[unitIndex % workerPool.length]
|
|
121
|
+
: harness.config.model);
|
|
122
|
+
if (workerPool && (!workerPool.length || !workerPool.includes(selected))) {
|
|
123
|
+
throw new Error(`modello collaboratore non autorizzato: ${selected}`);
|
|
124
|
+
}
|
|
125
|
+
const resolved = harness.providers.resolve(selected);
|
|
126
|
+
if (!resolved)
|
|
127
|
+
throw new Error("modello non configurato");
|
|
128
|
+
const storageSlug = `${castleSlug}-${unit.id}`.replace(/[^a-zA-Z0-9_.-]+/g, "-");
|
|
129
|
+
const session = Session.create(harness.config.sessionDir, `${kingdomId}-${storageSlug}`);
|
|
130
|
+
const planCastle = unit.assignment?.castle ?? (opts.markCastle && REF_RE.test(unit.id) ? opts.markCastle : undefined);
|
|
131
|
+
const planTasks = unit.assignment?.tasks ?? (planCastle ? [unit.id] : undefined);
|
|
132
|
+
const workerTools = harness.tools.scoped(unit.assignment?.tools);
|
|
133
|
+
for (const name of ["team_say", "team_inbox", "team_wait", "team_report", "vascend_status"])
|
|
134
|
+
workerTools.promote(name);
|
|
135
|
+
const runConfig = {
|
|
136
|
+
...harness.config,
|
|
137
|
+
model: resolved.modelId,
|
|
138
|
+
roomStoreId: kingdomId,
|
|
139
|
+
roomNamespace: storageSlug,
|
|
140
|
+
...(opts.planStoreId ? { planStoreId: opts.planStoreId } : {}),
|
|
141
|
+
planCastle, planTasks,
|
|
142
|
+
...(unit.assignment?.effort && ["low", "medium", "high", "max"].includes(unit.assignment.effort)
|
|
143
|
+
? { effort: unit.assignment.effort } : {}),
|
|
144
|
+
...(cwd ? { cwd } : {}),
|
|
145
|
+
};
|
|
146
|
+
const self = `${castleSlug}/${unit.id}`;
|
|
147
|
+
const spawnKingdom = depth < maxDepth ? async (specs) => {
|
|
148
|
+
const units = nestedUnits(specs);
|
|
149
|
+
if (!units.length)
|
|
150
|
+
return "team non avviato: nessun task valido";
|
|
151
|
+
for (const child of units) {
|
|
152
|
+
const slug = `${self}/${child.id}`;
|
|
153
|
+
const route = slug.split("/").filter(Boolean);
|
|
154
|
+
ctx.emit({
|
|
155
|
+
type: "kingdom",
|
|
156
|
+
phase: "vassal",
|
|
157
|
+
slug,
|
|
158
|
+
parent: self,
|
|
159
|
+
role: "collaboratore",
|
|
160
|
+
goal: child.goal,
|
|
161
|
+
state: "start",
|
|
162
|
+
...(route[0] ? { workstreamId: route[0] } : {}),
|
|
163
|
+
...(route[1] ? { taskRefs: [route[1]], parentTaskRef: route[1] } : {}),
|
|
164
|
+
});
|
|
165
|
+
ctx.emit({
|
|
166
|
+
type: "kingdom",
|
|
167
|
+
phase: "message",
|
|
168
|
+
kind: "assignment",
|
|
169
|
+
from: self,
|
|
170
|
+
to: slug,
|
|
171
|
+
text: `Task assegnato: ${child.goal.slice(0, 900)}`,
|
|
172
|
+
...(route[0] ? { workstreamId: route[0] } : {}),
|
|
173
|
+
...(route[1] ? { taskRef: route[1] } : {}),
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const report = await launchGranularKingdom({
|
|
177
|
+
...opts,
|
|
178
|
+
harness: { ...harness, config: runConfig, tools: workerTools },
|
|
179
|
+
castleSlug: self,
|
|
180
|
+
units,
|
|
181
|
+
depth: depth + 1,
|
|
182
|
+
maxDepth,
|
|
183
|
+
markCastle: undefined,
|
|
184
|
+
onEvent: (id, event) => {
|
|
185
|
+
const mapped = nestedActivity(`${self}/${id}`, event);
|
|
186
|
+
if (mapped)
|
|
187
|
+
ctx.emit(mapped);
|
|
188
|
+
},
|
|
189
|
+
onNotice: (text) => ctx.emit({ type: "kingdom", phase: "notice", text: `[${self}] ${text}` }),
|
|
190
|
+
});
|
|
191
|
+
return formatGranularReport(report);
|
|
192
|
+
} : undefined;
|
|
193
|
+
// Anche il sotto-collaboratore ha la sua casella: la scheda laterale non
|
|
194
|
+
// distingue i livelli, e nemmeno chi ci scrive dentro deve farlo.
|
|
195
|
+
const inbox = createUserInbox();
|
|
196
|
+
kingdomLive.register(kingdomId, self, inbox);
|
|
197
|
+
const deps = {
|
|
198
|
+
provider: resolved.provider,
|
|
199
|
+
tools: workerTools,
|
|
200
|
+
session,
|
|
201
|
+
config: runConfig,
|
|
202
|
+
confirm,
|
|
203
|
+
ask: opts.ask,
|
|
204
|
+
host: undefined,
|
|
205
|
+
inbox,
|
|
206
|
+
...(opts.fileCoordination ? {
|
|
207
|
+
fileCoordination: withFileActor(opts.fileCoordination, fileActor(`${opts.fileCoordination.actor.id}:${self}`, self, "subagent")),
|
|
208
|
+
} : {}),
|
|
209
|
+
...(spawnKingdom ? { spawnKingdom } : {}),
|
|
210
|
+
kingdom: { id: kingdomId, self, isolated: Boolean(isolated), peers: [castleSlug, ...peers.map((peer) => `${castleSlug}/${peer}`)] },
|
|
211
|
+
};
|
|
212
|
+
let summary = "";
|
|
213
|
+
let runError = "";
|
|
214
|
+
let completed = false;
|
|
215
|
+
const sink = (event) => {
|
|
216
|
+
if (event.type === "text")
|
|
217
|
+
summary += event.delta;
|
|
218
|
+
if (event.type === "error")
|
|
219
|
+
runError = event.message;
|
|
220
|
+
if (event.type === "done")
|
|
221
|
+
completed = true;
|
|
222
|
+
ctx.emit(event);
|
|
223
|
+
};
|
|
224
|
+
const input = unitSteer(unit, peers, opts.markCastle)
|
|
225
|
+
+ (planCastle ? `\nPIANO_ASSEGNATO: ${planCastle}; task: ${(planTasks ?? []).join(", ")}. Consulta vascend_status e aggiorna solo queste attivita.\n` : "")
|
|
226
|
+
+ (unit.assignment?.area?.length ? `\nAREA_ASSEGNATA: ${unit.assignment.area.join(", ")}\n` : "")
|
|
227
|
+
+ (unit.assignment?.instructions ? `\nISTRUZIONI_AGGIUNTIVE\n${unit.assignment.instructions}\n` : "")
|
|
228
|
+
+ (ctx.prerequisites?.length ? "\nPREREQUISITI_COMPLETATI (risultati da verificare)\n"
|
|
229
|
+
+ ctx.prerequisites.map((result) => `[${result.id}] ${result.summary}`).join("\n").slice(0, 6000) + "\n" : "") + unit.goal;
|
|
230
|
+
try {
|
|
231
|
+
await runTurn(deps, input, sink, ctx.signal);
|
|
232
|
+
}
|
|
233
|
+
finally {
|
|
234
|
+
deps.fileCoordination?.hub.clearActor(deps.fileCoordination.actor.id);
|
|
235
|
+
kingdomLive.release(kingdomId, self);
|
|
236
|
+
}
|
|
237
|
+
if (ctx.signal.aborted)
|
|
238
|
+
throw new Error("interrotta");
|
|
239
|
+
if (runError || !completed)
|
|
240
|
+
throw new Error(runError || "unita' terminata senza completamento verificato");
|
|
241
|
+
return { summary: summary.trim() };
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
// Endpoint completo: lancia le unita' granulari di un castello in parallelo.
|
|
245
|
+
export async function launchGranularKingdom(opts) {
|
|
246
|
+
const runner = makeAgentUnitRunner(opts);
|
|
247
|
+
return launchGranular({
|
|
248
|
+
units: opts.units,
|
|
249
|
+
runner,
|
|
250
|
+
signal: opts.signal,
|
|
251
|
+
concurrency: opts.concurrency ?? granularConcurrency(process.env),
|
|
252
|
+
// Children share their parent's directory, including within a worktree.
|
|
253
|
+
compatible: (left, right) => disjointAreas([
|
|
254
|
+
{ slug: left.id, area: left.assignment?.area }, { slug: right.id, area: right.assignment?.area },
|
|
255
|
+
], opts.cwd ?? opts.harness.config.cwd).disjoint,
|
|
256
|
+
...(opts.onEvent ? { onEvent: opts.onEvent } : {}),
|
|
257
|
+
...(opts.onNotice ? { onNotice: opts.onNotice } : {}),
|
|
258
|
+
});
|
|
259
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { AgentEvent, SpawnAgentSpec } from "../core/types.js";
|
|
2
|
+
export type TaskUnitStatus = "pending" | "running" | "done" | "failed" | "skipped";
|
|
3
|
+
export interface TaskUnit {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly goal: string;
|
|
6
|
+
readonly deps?: readonly string[];
|
|
7
|
+
readonly weight?: number;
|
|
8
|
+
readonly assignment?: SpawnAgentSpec;
|
|
9
|
+
}
|
|
10
|
+
export interface TaskUnitResult {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly status: TaskUnitStatus;
|
|
13
|
+
readonly summary: string;
|
|
14
|
+
readonly error?: string;
|
|
15
|
+
readonly blockedBy?: readonly string[];
|
|
16
|
+
readonly startedAt?: number;
|
|
17
|
+
readonly endedAt?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface TaskRunResult {
|
|
20
|
+
readonly summary: string;
|
|
21
|
+
}
|
|
22
|
+
export type TaskRunner = (unit: TaskUnit, ctx: {
|
|
23
|
+
readonly signal: AbortSignal;
|
|
24
|
+
readonly emit: (event: AgentEvent) => void;
|
|
25
|
+
readonly prerequisites?: readonly TaskUnitResult[];
|
|
26
|
+
}) => Promise<TaskRunResult>;
|
|
27
|
+
export interface GranularLaunchSpec {
|
|
28
|
+
readonly units: readonly TaskUnit[];
|
|
29
|
+
readonly runner: TaskRunner;
|
|
30
|
+
readonly signal: AbortSignal;
|
|
31
|
+
readonly concurrency?: number;
|
|
32
|
+
readonly onEvent?: (id: string, event: AgentEvent) => void;
|
|
33
|
+
readonly onNotice?: (text: string) => void;
|
|
34
|
+
readonly compatible?: (left: TaskUnit, right: TaskUnit) => boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface GranularLaunchReport {
|
|
37
|
+
readonly results: readonly TaskUnitResult[];
|
|
38
|
+
readonly ok: boolean;
|
|
39
|
+
readonly done: number;
|
|
40
|
+
readonly failed: number;
|
|
41
|
+
readonly skipped: number;
|
|
42
|
+
}
|
|
43
|
+
export declare class GraphError extends Error {
|
|
44
|
+
}
|
|
45
|
+
export declare function topoOrder(units: readonly TaskUnit[]): string[];
|
|
46
|
+
export declare function granularConcurrency(env: NodeJS.ProcessEnv, fallback?: number): number;
|
|
47
|
+
export declare function launchGranular(spec: GranularLaunchSpec): Promise<GranularLaunchReport>;
|
|
48
|
+
export declare function formatGranularReport(report: GranularLaunchReport): string;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// Errore di validazione del grafo (dipendenze mancanti o cicli): meglio fallire
|
|
2
|
+
// subito e chiaro che lanciare un DAG malformato.
|
|
3
|
+
export class GraphError extends Error {
|
|
4
|
+
}
|
|
5
|
+
// Valida il grafo: id unici, dipendenze esistenti, nessun ciclo. Ritorna un
|
|
6
|
+
// ordine topologico (solo per diagnostica/test; lo scheduler usa la prontezza
|
|
7
|
+
// dinamica, non quest'ordine fisso).
|
|
8
|
+
export function topoOrder(units) {
|
|
9
|
+
const ids = new Set();
|
|
10
|
+
for (const u of units) {
|
|
11
|
+
if (ids.has(u.id))
|
|
12
|
+
throw new GraphError(`id duplicato: ${u.id}`);
|
|
13
|
+
ids.add(u.id);
|
|
14
|
+
}
|
|
15
|
+
for (const u of units) {
|
|
16
|
+
for (const d of u.deps ?? []) {
|
|
17
|
+
if (!ids.has(d))
|
|
18
|
+
throw new GraphError(`dipendenza inesistente: ${u.id} -> ${d}`);
|
|
19
|
+
if (d === u.id)
|
|
20
|
+
throw new GraphError(`auto-dipendenza: ${u.id}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// Kahn: rimuovi iterativamente i nodi senza dipendenze residue.
|
|
24
|
+
const indeg = new Map();
|
|
25
|
+
const dependents = new Map();
|
|
26
|
+
for (const u of units)
|
|
27
|
+
indeg.set(u.id, (u.deps ?? []).length);
|
|
28
|
+
for (const u of units) {
|
|
29
|
+
for (const d of u.deps ?? []) {
|
|
30
|
+
const arr = dependents.get(d) ?? [];
|
|
31
|
+
arr.push(u.id);
|
|
32
|
+
dependents.set(d, arr);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const ready = units.filter((u) => (indeg.get(u.id) ?? 0) === 0).map((u) => u.id);
|
|
36
|
+
ready.sort();
|
|
37
|
+
const order = [];
|
|
38
|
+
while (ready.length) {
|
|
39
|
+
const id = ready.shift();
|
|
40
|
+
order.push(id);
|
|
41
|
+
for (const dep of dependents.get(id) ?? []) {
|
|
42
|
+
const n = (indeg.get(dep) ?? 0) - 1;
|
|
43
|
+
indeg.set(dep, n);
|
|
44
|
+
if (n === 0) {
|
|
45
|
+
ready.push(dep);
|
|
46
|
+
ready.sort();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (order.length !== units.length) {
|
|
51
|
+
const cyc = units.map((u) => u.id).filter((id) => !order.includes(id));
|
|
52
|
+
throw new GraphError(`ciclo nel grafo delle dipendenze: ${cyc.join(", ")}`);
|
|
53
|
+
}
|
|
54
|
+
return order;
|
|
55
|
+
}
|
|
56
|
+
// Concorrenza del granular launcher (override via env). Indipendente dalla
|
|
57
|
+
// concorrenza dei castelli (TALOS_KINGDOM_CONCURRENCY): si possono volere molte
|
|
58
|
+
// unita' piccole in volo anche con pochi castelli.
|
|
59
|
+
export function granularConcurrency(env, fallback = 4) {
|
|
60
|
+
const n = Number(env["TALOS_GRANULAR_CONCURRENCY"]);
|
|
61
|
+
return Number.isInteger(n) && n > 0 ? n : fallback;
|
|
62
|
+
}
|
|
63
|
+
// launchGranular: ENDPOINT di lancio granulare. Avvia ogni TaskUnit come unita'
|
|
64
|
+
// separata (via il runner), rispettando il DAG delle dipendenze, con un pool di
|
|
65
|
+
// concorrenza. Un fallimento NON abbatte il lancio: le unita' indipendenti
|
|
66
|
+
// proseguono; i discendenti dell'unita' fallita vengono SKIPPATI (segnalati come
|
|
67
|
+
// bloccati). Ritorna un report aggregato. Deterministico nell'ordine dei
|
|
68
|
+
// risultati (= ordine delle unita' in input).
|
|
69
|
+
export async function launchGranular(spec) {
|
|
70
|
+
const { units, runner, signal, onEvent, onNotice } = spec;
|
|
71
|
+
// Valida subito: un grafo malformato fa fallire l'intero lancio in modo netto.
|
|
72
|
+
topoOrder(units);
|
|
73
|
+
const limit = Math.max(1, spec.concurrency ?? granularConcurrency(process.env));
|
|
74
|
+
const byId = new Map(units.map((u) => [u.id, u]));
|
|
75
|
+
const status = new Map();
|
|
76
|
+
const result = new Map();
|
|
77
|
+
for (const u of units)
|
|
78
|
+
status.set(u.id, "pending");
|
|
79
|
+
// Una unita' e' PRONTA se e' pending e tutte le sue deps sono "done". Se una
|
|
80
|
+
// dep e' failed/skipped, l'unita' va a sua volta SKIPPATA (a cascata).
|
|
81
|
+
const readyOrSkip = () => {
|
|
82
|
+
const ready = [];
|
|
83
|
+
const skipped = [];
|
|
84
|
+
for (const u of units) {
|
|
85
|
+
if (status.get(u.id) !== "pending")
|
|
86
|
+
continue;
|
|
87
|
+
const deps = u.deps ?? [];
|
|
88
|
+
const bad = deps.filter((d) => {
|
|
89
|
+
const s = status.get(d);
|
|
90
|
+
return s === "failed" || s === "skipped";
|
|
91
|
+
});
|
|
92
|
+
if (bad.length) {
|
|
93
|
+
skipped.push(u);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const allDone = deps.every((d) => status.get(d) === "done");
|
|
97
|
+
if (allDone)
|
|
98
|
+
ready.push(u);
|
|
99
|
+
}
|
|
100
|
+
// A parita' di prontezza, pesi piu' alti (e id, per determinismo) per primi.
|
|
101
|
+
ready.sort((a, b) => (b.weight ?? 0) - (a.weight ?? 0) || a.id.localeCompare(b.id));
|
|
102
|
+
return { ready, skipped };
|
|
103
|
+
};
|
|
104
|
+
const launchOne = async (unit) => {
|
|
105
|
+
status.set(unit.id, "running");
|
|
106
|
+
onNotice?.(`[${unit.id}] avviata`);
|
|
107
|
+
const startedAt = Date.now();
|
|
108
|
+
const emit = (event) => onEvent?.(unit.id, event);
|
|
109
|
+
try {
|
|
110
|
+
const r = await runner(unit, { signal, emit, prerequisites: (unit.deps ?? []).map((id) => result.get(id)) });
|
|
111
|
+
status.set(unit.id, "done");
|
|
112
|
+
result.set(unit.id, { id: unit.id, status: "done", summary: r.summary.trim(), startedAt, endedAt: Date.now() });
|
|
113
|
+
onNotice?.(`[${unit.id}] completata`);
|
|
114
|
+
}
|
|
115
|
+
catch (err) {
|
|
116
|
+
status.set(unit.id, "failed");
|
|
117
|
+
result.set(unit.id, { id: unit.id, status: "failed", summary: "", error: err.message, startedAt, endedAt: Date.now() });
|
|
118
|
+
onNotice?.(`[${unit.id}] FALLITA: ${err.message}`);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
// Scheduler a pool: a ogni giro marca gli skip a cascata, riempie il pool con
|
|
122
|
+
// le unita' pronte fino al limite, attende che almeno una termini, ripete.
|
|
123
|
+
// Finche' restano unita' pending/running.
|
|
124
|
+
const inFlight = new Set();
|
|
125
|
+
const drainSkips = () => {
|
|
126
|
+
// Propaga gli skip in modo transitivo: marcare uno skip puo' renderne
|
|
127
|
+
// skippabili altri (discendenti), quindi itera fino a punto fisso.
|
|
128
|
+
for (;;) {
|
|
129
|
+
const { skipped } = readyOrSkip();
|
|
130
|
+
if (!skipped.length)
|
|
131
|
+
break;
|
|
132
|
+
for (const u of skipped) {
|
|
133
|
+
status.set(u.id, "skipped");
|
|
134
|
+
const blockedBy = (u.deps ?? []).filter((d) => {
|
|
135
|
+
const s = status.get(d);
|
|
136
|
+
return s === "failed" || s === "skipped";
|
|
137
|
+
});
|
|
138
|
+
result.set(u.id, { id: u.id, status: "skipped", summary: "", blockedBy });
|
|
139
|
+
onNotice?.(`[${u.id}] saltata (bloccata da ${blockedBy.join(", ") || "?"})`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
for (;;) {
|
|
144
|
+
if (signal.aborted)
|
|
145
|
+
break;
|
|
146
|
+
drainSkips();
|
|
147
|
+
const { ready } = readyOrSkip();
|
|
148
|
+
// Riempie il pool con le unita' pronte fino al limite di concorrenza.
|
|
149
|
+
for (const u of ready) {
|
|
150
|
+
if (inFlight.size >= limit)
|
|
151
|
+
break;
|
|
152
|
+
if (status.get(u.id) !== "pending")
|
|
153
|
+
continue;
|
|
154
|
+
if (spec.compatible && units.some((active) => status.get(active.id) === "running" && !spec.compatible(u, active)))
|
|
155
|
+
continue;
|
|
156
|
+
const p = launchOne(u).finally(() => inFlight.delete(p));
|
|
157
|
+
inFlight.add(p);
|
|
158
|
+
}
|
|
159
|
+
if (!inFlight.size) {
|
|
160
|
+
// Niente in volo: o abbiamo finito, o restano solo pending bloccati che il
|
|
161
|
+
// prossimo drainSkips chiarira'; se non cambia nulla, esci.
|
|
162
|
+
const pendingLeft = units.some((u) => status.get(u.id) === "pending");
|
|
163
|
+
if (!pendingLeft)
|
|
164
|
+
break;
|
|
165
|
+
// Marca eventuali skip residui ed esci se ancora bloccato senza progresso.
|
|
166
|
+
drainSkips();
|
|
167
|
+
const stillPending = units.some((u) => status.get(u.id) === "pending");
|
|
168
|
+
const stillReady = readyOrSkip().ready.length > 0;
|
|
169
|
+
if (stillPending && !stillReady)
|
|
170
|
+
break; // stallo: nessuna unita' avviabile
|
|
171
|
+
if (!stillReady)
|
|
172
|
+
break;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
await Promise.race(inFlight);
|
|
176
|
+
}
|
|
177
|
+
// Se interrotti, qualunque unita' ancora pending/running resta non-done.
|
|
178
|
+
await Promise.allSettled([...inFlight]);
|
|
179
|
+
for (const u of units) {
|
|
180
|
+
if (!result.has(u.id)) {
|
|
181
|
+
const s = status.get(u.id) ?? "pending";
|
|
182
|
+
result.set(u.id, { id: u.id, status: s === "running" ? "failed" : "skipped", summary: "", error: s === "running" ? "interrotta" : undefined });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const results = units.map((u) => result.get(u.id));
|
|
186
|
+
const done = results.filter((r) => r.status === "done").length;
|
|
187
|
+
const failed = results.filter((r) => r.status === "failed").length;
|
|
188
|
+
const skipped = results.filter((r) => r.status === "skipped").length;
|
|
189
|
+
return { results, ok: failed === 0 && skipped === 0, done, failed, skipped };
|
|
190
|
+
}
|
|
191
|
+
// Riepilogo del lancio in notazione Danilov (per la chat/log dell'Imperatore).
|
|
192
|
+
export function formatGranularReport(report) {
|
|
193
|
+
const mark = {
|
|
194
|
+
done: "✓", failed: "✗", skipped: "⊘", running: "…", pending: "·",
|
|
195
|
+
};
|
|
196
|
+
const rows = report.results
|
|
197
|
+
.map((r) => `@unit[${r.id}]: ${mark[r.status]} ${r.status}${r.error ? ` · errore: ${r.error}` : ""}${r.blockedBy?.length ? ` · bloccata da ${r.blockedBy.join(", ")}` : ""}`)
|
|
198
|
+
.join("\n");
|
|
199
|
+
return `[GRANULAR_LAUNCH]
|
|
200
|
+
@esito[totale]: ${report.done} done · ${report.failed} failed · ${report.skipped} skipped${report.ok ? " · OK" : ""}
|
|
201
|
+
${rows}`;
|
|
202
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface KingdomMessage {
|
|
2
|
+
readonly seq: number;
|
|
3
|
+
readonly from: string;
|
|
4
|
+
readonly to: string | null;
|
|
5
|
+
readonly text: string;
|
|
6
|
+
readonly ts: number;
|
|
7
|
+
}
|
|
8
|
+
export interface InboxCursor {
|
|
9
|
+
readonly last: number;
|
|
10
|
+
readonly seen?: readonly number[];
|
|
11
|
+
}
|
|
12
|
+
export declare function consumeInbox(board: readonly KingdomMessage[], me: string, cursor: InboxCursor, filter?: (message: KingdomMessage) => boolean): {
|
|
13
|
+
messages: KingdomMessage[];
|
|
14
|
+
cursor: InboxCursor;
|
|
15
|
+
};
|
|
16
|
+
export declare class KingdomBus {
|
|
17
|
+
private readonly boards;
|
|
18
|
+
private readonly cursors;
|
|
19
|
+
private seq;
|
|
20
|
+
post(kingdomId: string, from: string, to: string | null, text: string, ts: number): KingdomMessage;
|
|
21
|
+
inbox(kingdomId: string, me: string, filter?: (message: KingdomMessage) => boolean): KingdomMessage[];
|
|
22
|
+
history(kingdomId: string): readonly KingdomMessage[];
|
|
23
|
+
clear(kingdomId: string): void;
|
|
24
|
+
}
|
|
25
|
+
export declare const kingdomBus: KingdomBus;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Bus di messaggi tra vassalli di un regno (Kingdoms Mode): cooperazione ATTIVA
|
|
2
|
+
// stile team Claude Code. Un vassallo annuncia/chiede ("ho finito X", "mi serve
|
|
3
|
+
// Y prima di Z"), gli altri leggono dalla loro inbox e si coordinano (procedono
|
|
4
|
+
// con cio' che possono o aspettano un prerequisito). Store in-memory di processo,
|
|
5
|
+
// keyed per kingdomId; cursore di lettura per vassallo.
|
|
6
|
+
const MAX_BOARD = 500;
|
|
7
|
+
// A filtered wait acknowledges only matching messages. Keep a bounded set of
|
|
8
|
+
// receipts beyond the first unread message so unrelated mail is not lost.
|
|
9
|
+
export function consumeInbox(board, me, cursor, filter = () => true) {
|
|
10
|
+
const seen = new Set(cursor.seen ?? []);
|
|
11
|
+
const unread = board.filter((message) => message.seq > cursor.last && !seen.has(message.seq)
|
|
12
|
+
&& message.from !== me && (message.to === null || message.to === me));
|
|
13
|
+
const messages = unread.filter(filter);
|
|
14
|
+
for (const message of messages)
|
|
15
|
+
seen.add(message.seq);
|
|
16
|
+
const remaining = unread.filter((message) => !seen.has(message.seq));
|
|
17
|
+
const last = remaining.length ? remaining[0].seq - 1 : (board.at(-1)?.seq ?? cursor.last);
|
|
18
|
+
const retained = new Set(board.map((message) => message.seq));
|
|
19
|
+
return { messages, cursor: { last, seen: [...seen].filter((seq) => seq > last && retained.has(seq)) } };
|
|
20
|
+
}
|
|
21
|
+
export class KingdomBus {
|
|
22
|
+
boards = new Map();
|
|
23
|
+
cursors = new Map();
|
|
24
|
+
seq = 0;
|
|
25
|
+
post(kingdomId, from, to, text, ts) {
|
|
26
|
+
const m = { seq: (this.seq += 1), from, to: to && to.trim() ? to.trim() : null, text, ts };
|
|
27
|
+
const board = this.boards.get(kingdomId) ?? [];
|
|
28
|
+
board.push(m);
|
|
29
|
+
if (board.length > MAX_BOARD)
|
|
30
|
+
board.splice(0, board.length - MAX_BOARD);
|
|
31
|
+
this.boards.set(kingdomId, board);
|
|
32
|
+
return m;
|
|
33
|
+
}
|
|
34
|
+
// Messaggi NON ancora letti da `me` (destinati a me o broadcast, non miei).
|
|
35
|
+
// Avanza il cursore di lettura di `me`.
|
|
36
|
+
inbox(kingdomId, me, filter) {
|
|
37
|
+
const board = this.boards.get(kingdomId) ?? [];
|
|
38
|
+
const key = `${kingdomId}::${me}`;
|
|
39
|
+
const read = consumeInbox(board, me, this.cursors.get(key) ?? { last: 0 }, filter);
|
|
40
|
+
this.cursors.set(key, read.cursor);
|
|
41
|
+
return read.messages;
|
|
42
|
+
}
|
|
43
|
+
// Tutti i messaggi del regno (per il riepilogo/log), senza toccare i cursori.
|
|
44
|
+
history(kingdomId) {
|
|
45
|
+
return this.boards.get(kingdomId) ?? [];
|
|
46
|
+
}
|
|
47
|
+
clear(kingdomId) {
|
|
48
|
+
this.boards.delete(kingdomId);
|
|
49
|
+
for (const k of [...this.cursors.keys()])
|
|
50
|
+
if (k.startsWith(`${kingdomId}::`))
|
|
51
|
+
this.cursors.delete(k);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export const kingdomBus = new KingdomBus();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type KingdomMessage } from "./kingdom-bus.js";
|
|
2
|
+
export interface KingdomChannelOptions {
|
|
3
|
+
readonly maxBoard?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare class PersistentKingdomChannel {
|
|
6
|
+
private readonly sessionDir;
|
|
7
|
+
private readonly maxBoard;
|
|
8
|
+
constructor(sessionDir: string, opts?: KingdomChannelOptions);
|
|
9
|
+
post(kingdomId: string, from: string, to: string | null, text: string, ts: number): KingdomMessage;
|
|
10
|
+
inbox(kingdomId: string, me: string, filter?: (message: KingdomMessage) => boolean): KingdomMessage[];
|
|
11
|
+
history(kingdomId: string): readonly KingdomMessage[];
|
|
12
|
+
clear(kingdomId: string): void;
|
|
13
|
+
}
|
|
14
|
+
export declare function getKingdomChannel(sessionDir: string, opts?: KingdomChannelOptions): PersistentKingdomChannel;
|
|
15
|
+
export interface KingdomBusLike {
|
|
16
|
+
post(kingdomId: string, from: string, to: string | null, text: string, ts: number): KingdomMessage;
|
|
17
|
+
inbox(kingdomId: string, me: string, filter?: (message: KingdomMessage) => boolean): KingdomMessage[];
|
|
18
|
+
history(kingdomId: string): readonly KingdomMessage[];
|
|
19
|
+
clear(kingdomId: string): void;
|
|
20
|
+
}
|
|
21
|
+
export declare function kingdomIpcEnabled(env: NodeJS.ProcessEnv): boolean;
|
|
22
|
+
export declare function resolveKingdomBus(env: NodeJS.ProcessEnv, sessionDir?: string): KingdomBusLike;
|