@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,528 @@
|
|
|
1
|
+
import { resolveKingdomBus } from "../vascend/kingdom-channel.js";
|
|
2
|
+
import { RamificationStore } from "../vascend/ramification-store.js";
|
|
3
|
+
import { teamForSession } from "../vascend/team-session.js";
|
|
4
|
+
import { addBranch, addNode, consultOnNode, crosstalkFor, frontier, judgeNode, postAcrossNodes, progress, proposeMutation, renderCrosstalk, resolveProposal, startNode, submitNode, } from "../vascend/ramification.js";
|
|
5
|
+
// I tool della ramificazione: come un team fa un piano lungo e lo porta avanti
|
|
6
|
+
// nodo per nodo, dove ogni nodo e' una sessione intera di lavoro.
|
|
7
|
+
//
|
|
8
|
+
// Il piano vive nella CONVERSAZIONE, non nella sessione: e' l'unico modo perche'
|
|
9
|
+
// il nodo 40 sappia cosa e' stato deciso al nodo 3, in una sessione che allora
|
|
10
|
+
// non esisteva.
|
|
11
|
+
function conversationScope(ctx) {
|
|
12
|
+
// In una sessione delegata il piano resta quello della conversazione madre:
|
|
13
|
+
// altrimenti ogni collaboratore aprirebbe un piano suo e la ramificazione si
|
|
14
|
+
// sfarinerebbe in tanti alberi scollegati.
|
|
15
|
+
return String(ctx.planStoreId || ctx.roomStoreId || ctx.sessionId || "default");
|
|
16
|
+
}
|
|
17
|
+
function openStore(ctx) {
|
|
18
|
+
if (!ctx.sessionDir)
|
|
19
|
+
return null;
|
|
20
|
+
return RamificationStore.open(ctx.sessionDir, conversationScope(ctx));
|
|
21
|
+
}
|
|
22
|
+
// Chi sta parlando. Dentro una sessione delegata e' lo slug del collaboratore,
|
|
23
|
+
// altrimenti e' l'agente principale.
|
|
24
|
+
function speaker(ctx) {
|
|
25
|
+
return String(ctx.kingdom?.self || "orchestratore");
|
|
26
|
+
}
|
|
27
|
+
function text(input, key) {
|
|
28
|
+
const value = input[key];
|
|
29
|
+
return typeof value === "string" ? value.trim() : "";
|
|
30
|
+
}
|
|
31
|
+
function strings(input, key) {
|
|
32
|
+
const value = input[key];
|
|
33
|
+
if (!Array.isArray(value))
|
|
34
|
+
return [];
|
|
35
|
+
return value.map((item) => String(item ?? "").trim()).filter(Boolean);
|
|
36
|
+
}
|
|
37
|
+
function noStore() {
|
|
38
|
+
return "piano a rami non disponibile: manca una sessione persistente";
|
|
39
|
+
}
|
|
40
|
+
/* Riga di stato del nodo, in coda alla risposta. La legge l'utente in chat, e
|
|
41
|
+
la legge l'host per aggiornare la board: senza il RAMO un aggiornamento non
|
|
42
|
+
si puo' agganciare a niente, perche' i passaggi vivono dentro il loro ramo. */
|
|
43
|
+
function segnaleNodo(node, stato, extra) {
|
|
44
|
+
return `[nodo] ${node.id} · ramo ${node.branch} · ${stato}${extra ? ` · ${extra}` : ""}`;
|
|
45
|
+
}
|
|
46
|
+
function renderStatus(roadmap) {
|
|
47
|
+
const righe = [`obiettivo: ${roadmap.goal}`];
|
|
48
|
+
if (roadmap.acceptance.length)
|
|
49
|
+
righe.push(`accettazione: ${roadmap.acceptance.join(" · ")}`);
|
|
50
|
+
for (const riga of progress(roadmap)) {
|
|
51
|
+
righe.push(`ramo ${riga.branch} (${riga.owner}): ${riga.committed}/${riga.total} approvati`
|
|
52
|
+
+ (riga.current ? `, ora ${riga.current}` : "")
|
|
53
|
+
+ (riga.blocked.length ? `, bloccati ${riga.blocked.join(", ")}` : ""));
|
|
54
|
+
}
|
|
55
|
+
const prendibili = frontier(roadmap);
|
|
56
|
+
// I nodi prendibili sono INDIPENDENTI fra loro: possono partire tutti adesso,
|
|
57
|
+
// ognuno nella sua sessione. Metterli in fila e' lavoro perso.
|
|
58
|
+
righe.push(prendibili.length
|
|
59
|
+
? `prendibili adesso (indipendenti, possono partire in contemporanea): ${prendibili.map((n) => n.id).join(", ")}`
|
|
60
|
+
: "niente di prendibile: o e' tutto in corso, o aspetta un giudizio");
|
|
61
|
+
const inAttesa = roadmap.proposals.filter((p) => p.state === "pending");
|
|
62
|
+
if (inAttesa.length) {
|
|
63
|
+
righe.push(`proposte in attesa: ${inAttesa.map((p) => `${p.id} (${p.by}) ${p.reason}`).join(" | ")}`);
|
|
64
|
+
}
|
|
65
|
+
return righe.join("\n");
|
|
66
|
+
}
|
|
67
|
+
/* Il percorso si disegna INSIEME. Se hai una squadra ingaggiata e non le hai
|
|
68
|
+
ancora rivolto la parola, un piano scritto da solo non e' il piano del team:
|
|
69
|
+
e' un compito consegnato. Chi lavora su un pezzo sa cose che tu non sai —
|
|
70
|
+
e' il motivo per cui l'hai ingaggiato — e quelle cose cambiano il percorso,
|
|
71
|
+
non il modo di eseguirlo. Quindi qui si controlla che ci si sia parlati:
|
|
72
|
+
almeno una tua parola e almeno una loro risposta. */
|
|
73
|
+
function teamNonSentita(ctx) {
|
|
74
|
+
const team = teamForSession(String(ctx.sessionId || ""));
|
|
75
|
+
if (!team || !team.members.length)
|
|
76
|
+
return "";
|
|
77
|
+
const io = String(ctx.kingdom?.self || "orchestratore");
|
|
78
|
+
const storia = resolveKingdomBus(process.env, ctx.sessionDir).history(team.id);
|
|
79
|
+
const hoParlato = storia.some((m) => m.from === io);
|
|
80
|
+
const hannoRisposto = storia.some((m) => m.from !== io);
|
|
81
|
+
if (hoParlato && hannoRisposto)
|
|
82
|
+
return "";
|
|
83
|
+
const chi = team.members.map((m) => m.slug).join(", ");
|
|
84
|
+
return `hai ingaggiato ${chi} ma `
|
|
85
|
+
+ (!hoParlato
|
|
86
|
+
? "non gli hai ancora detto niente. "
|
|
87
|
+
: "non hai ancora sentito cosa ne pensano. ")
|
|
88
|
+
+ "Il percorso lo disegnate insieme: raccontagli la situazione con team_say, "
|
|
89
|
+
+ "senti il loro parere (team_wait), e solo dopo scrivi i rami. Chi lavorera' su un pezzo "
|
|
90
|
+
+ "sa cose che tu non sai — e' il motivo per cui l'hai chiamato.";
|
|
91
|
+
}
|
|
92
|
+
// ram_plan: il team stila il percorso. Rami e nodi in una chiamata sola, perche'
|
|
93
|
+
// e' cosi' che si progetta — guardando l'insieme, non un nodo per volta.
|
|
94
|
+
export const ramPlanTool = {
|
|
95
|
+
name: "ram_plan",
|
|
96
|
+
description: "Il PERCORSO di un lavoro che non si chiude in una conversazione: rami e nodi, un livello SOPRA i "
|
|
97
|
+
+ "passaggi. Ogni ramo ha un titolare e una visione (il metro con cui giudichera' i suoi nodi); ogni "
|
|
98
|
+
+ "nodo e' una sessione intera di lavoro, e un nodo si sblocca solo quando i suoi prerequisiti sono "
|
|
99
|
+
+ "stati APPROVATI, non quando sono finiti. Qui NON si scrivono i passaggi: dentro un nodo li pianifica "
|
|
100
|
+
+ "con vascend_plan la sessione che lo esegue, che e' l'unica a sapere come farlo. Un mandato dice cosa "
|
|
101
|
+
+ "deve essere vero alla fine, non come arrivarci.",
|
|
102
|
+
schema: {
|
|
103
|
+
type: "object",
|
|
104
|
+
properties: {
|
|
105
|
+
goal: { type: "string", description: "l'obiettivo lungo, in una frase" },
|
|
106
|
+
acceptance: { type: "array", items: { type: "string" }, description: "criteri di accettazione finali, verificabili" },
|
|
107
|
+
founders: { type: "array", items: { type: "string" }, description: "chi puo' riscrivere il futuro dei rami (default: chi chiama)" },
|
|
108
|
+
branches: {
|
|
109
|
+
type: "array",
|
|
110
|
+
description: "i rami del piano",
|
|
111
|
+
items: {
|
|
112
|
+
type: "object",
|
|
113
|
+
properties: {
|
|
114
|
+
id: { type: "string", description: "id breve del ramo, es. prodotto" },
|
|
115
|
+
owner: { type: "string", description: "chi lo porta avanti e ne giudica i nodi" },
|
|
116
|
+
vision: { type: "string", description: "cosa deve essere vero perche' il ramo sia riuscito" },
|
|
117
|
+
},
|
|
118
|
+
required: ["id", "vision"],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
nodes: {
|
|
122
|
+
type: "array",
|
|
123
|
+
description: "i nodi, in ordine; ognuno e' una sessione di lavoro",
|
|
124
|
+
items: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
id: { type: "string", description: "id del nodo, es. N01" },
|
|
128
|
+
branch: { type: "string", description: "ramo di appartenenza" },
|
|
129
|
+
title: { type: "string" },
|
|
130
|
+
mandate: { type: "string", description: "cosa deve essere VERO alla fine del nodo; non i passaggi per arrivarci" },
|
|
131
|
+
acceptance: { type: "array", items: { type: "string" }, description: "criteri verificabili del nodo" },
|
|
132
|
+
after: { type: "array", items: { type: "string" }, description: "nodi che devono essere approvati prima" },
|
|
133
|
+
},
|
|
134
|
+
required: ["id", "branch", "mandate"],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: ["goal"],
|
|
139
|
+
},
|
|
140
|
+
handler: async (input, ctx) => {
|
|
141
|
+
const store = openStore(ctx);
|
|
142
|
+
if (!store)
|
|
143
|
+
return noStore();
|
|
144
|
+
const now = Date.now();
|
|
145
|
+
const chi = speaker(ctx);
|
|
146
|
+
if (!store.has()) {
|
|
147
|
+
// Solo alla CREAZIONE: aggiungere un ramo a un percorso gia' aperto e'
|
|
148
|
+
// un'altra cosa, e passa comunque dalle proposte.
|
|
149
|
+
const muti = teamNonSentita(ctx);
|
|
150
|
+
if (muti)
|
|
151
|
+
return muti;
|
|
152
|
+
const founders = strings(input, "founders");
|
|
153
|
+
const creato = store.create({
|
|
154
|
+
goal: text(input, "goal"),
|
|
155
|
+
acceptance: strings(input, "acceptance"),
|
|
156
|
+
founders: founders.length ? founders : [chi],
|
|
157
|
+
at: now,
|
|
158
|
+
});
|
|
159
|
+
if (!creato.ok)
|
|
160
|
+
return creato.reason;
|
|
161
|
+
}
|
|
162
|
+
const rami = Array.isArray(input["branches"]) ? input["branches"] : [];
|
|
163
|
+
for (const ramo of rami) {
|
|
164
|
+
const esito = store.apply((roadmap) => addBranch(roadmap, {
|
|
165
|
+
id: String(ramo["id"] ?? ""),
|
|
166
|
+
owner: String(ramo["owner"] ?? chi),
|
|
167
|
+
vision: String(ramo["vision"] ?? ""),
|
|
168
|
+
at: now,
|
|
169
|
+
}));
|
|
170
|
+
if (!esito.ok)
|
|
171
|
+
return `ramo ${String(ramo["id"] ?? "")}: ${esito.reason}`;
|
|
172
|
+
}
|
|
173
|
+
const nodi = Array.isArray(input["nodes"]) ? input["nodes"] : [];
|
|
174
|
+
for (const nodo of nodi) {
|
|
175
|
+
const esito = store.apply((roadmap) => addNode(roadmap, {
|
|
176
|
+
id: String(nodo["id"] ?? ""),
|
|
177
|
+
branch: String(nodo["branch"] ?? ""),
|
|
178
|
+
title: String(nodo["title"] ?? ""),
|
|
179
|
+
mandate: String(nodo["mandate"] ?? ""),
|
|
180
|
+
acceptance: Array.isArray(nodo["acceptance"]) ? nodo["acceptance"].map(String) : [],
|
|
181
|
+
after: Array.isArray(nodo["after"]) ? nodo["after"].map(String) : [],
|
|
182
|
+
by: chi,
|
|
183
|
+
at: now,
|
|
184
|
+
}));
|
|
185
|
+
if (!esito.ok)
|
|
186
|
+
return `nodo ${String(nodo["id"] ?? "")}: ${esito.reason}`;
|
|
187
|
+
}
|
|
188
|
+
const roadmap = store.current();
|
|
189
|
+
return roadmap ? renderStatus(roadmap) : noStore();
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
// ram_status: dove siamo. E' la prima cosa che una sessione nuova deve chiedere.
|
|
193
|
+
export const ramStatusTool = {
|
|
194
|
+
name: "ram_status",
|
|
195
|
+
description: "Dove e' arrivato il piano a rami: cosa e' approvato, cosa e' in corso, cosa e' bloccato e da cosa, "
|
|
196
|
+
+ "quali nodi sono PRENDIBILI adesso. Chiamalo all'inizio di una sessione che continua un lavoro lungo: "
|
|
197
|
+
+ "si riparte dalla frontiera, non dal principio.",
|
|
198
|
+
schema: { type: "object", properties: {} },
|
|
199
|
+
handler: async (_input, ctx) => {
|
|
200
|
+
const store = openStore(ctx);
|
|
201
|
+
if (!store)
|
|
202
|
+
return noStore();
|
|
203
|
+
const roadmap = store.current();
|
|
204
|
+
if (!roadmap)
|
|
205
|
+
return "nessun piano a rami per questa conversazione";
|
|
206
|
+
return renderStatus(roadmap);
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
// ram_take: questa sessione prende un nodo. Un nodo e' una sessione: qui si
|
|
210
|
+
// dichiara quale.
|
|
211
|
+
export const ramTakeTool = {
|
|
212
|
+
name: "ram_take",
|
|
213
|
+
description: "Prendi un nodo prendibile: da qui in avanti questa sessione E' quel nodo. Ritorna il mandato e i "
|
|
214
|
+
+ "criteri di accettazione. Un nodo bloccato viene rifiutato dicendo cosa manca.",
|
|
215
|
+
schema: {
|
|
216
|
+
type: "object",
|
|
217
|
+
properties: { node: { type: "string", description: "id del nodo" } },
|
|
218
|
+
required: ["node"],
|
|
219
|
+
},
|
|
220
|
+
handler: async (input, ctx) => {
|
|
221
|
+
const store = openStore(ctx);
|
|
222
|
+
if (!store)
|
|
223
|
+
return noStore();
|
|
224
|
+
const id = text(input, "node");
|
|
225
|
+
const esito = store.apply((roadmap) => startNode(roadmap, {
|
|
226
|
+
id,
|
|
227
|
+
sessionId: String(ctx.sessionId || ""),
|
|
228
|
+
by: speaker(ctx),
|
|
229
|
+
at: Date.now(),
|
|
230
|
+
}));
|
|
231
|
+
if (!esito.ok)
|
|
232
|
+
return esito.reason;
|
|
233
|
+
const node = esito.roadmap?.nodes[id];
|
|
234
|
+
const branch = esito.roadmap?.branches.find((b) => b.id === node?.branch);
|
|
235
|
+
if (!node)
|
|
236
|
+
return esito.reason || "nodo preso";
|
|
237
|
+
return [
|
|
238
|
+
`preso ${node.id} (${node.branch})`,
|
|
239
|
+
`mandato: ${node.mandate}`,
|
|
240
|
+
branch ? `visione del ramo: ${branch.vision}` : "",
|
|
241
|
+
node.acceptance.length ? `accettazione: ${node.acceptance.join(" · ")}` : "",
|
|
242
|
+
"Adesso pianifica i TUOI passaggi con vascend_plan (compaiono sulla board) e lavora: il percorso a "
|
|
243
|
+
+ "rami non si tocca da qui. Quando hai finito consegna con ram_submit — senza artefatto e senza "
|
|
244
|
+
+ "prove non e' una consegna.",
|
|
245
|
+
segnaleNodo(node, "in corso", `sessione ${String(ctx.sessionId || "")}`),
|
|
246
|
+
].filter(Boolean).join("\n");
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
export const ramSubmitTool = {
|
|
250
|
+
name: "ram_submit",
|
|
251
|
+
description: "Consegna il nodo che questa sessione sta eseguendo: cosa hai prodotto, cosa hai verificato e come, "
|
|
252
|
+
+ "e il commit che lo fissa. La consegna NON sblocca i nodi successivi: li sblocca il giudizio di chi "
|
|
253
|
+
+ "possiede il ramo.",
|
|
254
|
+
schema: {
|
|
255
|
+
type: "object",
|
|
256
|
+
properties: {
|
|
257
|
+
node: { type: "string", description: "id del nodo" },
|
|
258
|
+
artifact: { type: "string", description: "cosa hai prodotto (percorso, componente, documento)" },
|
|
259
|
+
tests: { type: "array", items: { type: "string" }, description: "prove eseguite" },
|
|
260
|
+
evidence: { type: "array", items: { type: "string" }, description: "cosa hai osservato che lo dimostra" },
|
|
261
|
+
commit: { type: "string", description: "commit o marcatore che fissa il lavoro" },
|
|
262
|
+
},
|
|
263
|
+
required: ["node", "artifact", "evidence"],
|
|
264
|
+
},
|
|
265
|
+
handler: async (input, ctx) => {
|
|
266
|
+
const store = openStore(ctx);
|
|
267
|
+
if (!store)
|
|
268
|
+
return noStore();
|
|
269
|
+
const now = Date.now();
|
|
270
|
+
const esito = store.apply((roadmap) => submitNode(roadmap, {
|
|
271
|
+
id: text(input, "node"),
|
|
272
|
+
transaction: {
|
|
273
|
+
artifact: text(input, "artifact"),
|
|
274
|
+
tests: strings(input, "tests"),
|
|
275
|
+
evidence: strings(input, "evidence"),
|
|
276
|
+
commit: text(input, "commit"),
|
|
277
|
+
at: now,
|
|
278
|
+
},
|
|
279
|
+
by: speaker(ctx),
|
|
280
|
+
at: now,
|
|
281
|
+
}));
|
|
282
|
+
if (!esito.ok)
|
|
283
|
+
return esito.reason;
|
|
284
|
+
const consegnato = esito.roadmap?.nodes[text(input, "node")];
|
|
285
|
+
return [
|
|
286
|
+
`${text(input, "node")} consegnato, in attesa di giudizio`,
|
|
287
|
+
consegnato ? segnaleNodo(consegnato, "consegnato") : "",
|
|
288
|
+
].filter(Boolean).join(String.fromCharCode(10));
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
// ram_ask: si chiede prima di giudicare. La risposta arriva parlando.
|
|
292
|
+
export const ramAskTool = {
|
|
293
|
+
name: "ram_ask",
|
|
294
|
+
description: "Chiedi a qualcuno un parere su un nodo consegnato, prima di giudicarlo: a chi lo ha fatto, o a chi "
|
|
295
|
+
+ "conosce il pezzo che tocca. Resta la traccia della domanda; la risposta arriva parlando.",
|
|
296
|
+
schema: {
|
|
297
|
+
type: "object",
|
|
298
|
+
properties: {
|
|
299
|
+
node: { type: "string", description: "id del nodo" },
|
|
300
|
+
who: { type: "string", description: "a chi lo chiedi" },
|
|
301
|
+
question: { type: "string", description: "la domanda" },
|
|
302
|
+
},
|
|
303
|
+
required: ["node", "who", "question"],
|
|
304
|
+
},
|
|
305
|
+
handler: async (input, ctx) => {
|
|
306
|
+
const store = openStore(ctx);
|
|
307
|
+
if (!store)
|
|
308
|
+
return noStore();
|
|
309
|
+
const esito = store.apply((roadmap) => consultOnNode(roadmap, {
|
|
310
|
+
id: text(input, "node"),
|
|
311
|
+
who: text(input, "who"),
|
|
312
|
+
question: text(input, "question"),
|
|
313
|
+
by: speaker(ctx),
|
|
314
|
+
at: Date.now(),
|
|
315
|
+
}));
|
|
316
|
+
return esito.ok ? `chiesto a ${text(input, "who")} su ${text(input, "node")}` : esito.reason;
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
export const ramJudgeTool = {
|
|
320
|
+
name: "ram_judge",
|
|
321
|
+
description: "Il cancello: giudica un nodo consegnato rispetto alla visione del ramo e ai criteri del nodo. "
|
|
322
|
+
+ "`pass` sblocca i nodi che dipendevano da lui; `return` lo rimanda indietro con le ragioni; "
|
|
323
|
+
+ "`replan` dice che il lavoro ha scoperto qualcosa che rende sbagliato il seguito — allora si propone "
|
|
324
|
+
+ "una riscrittura con ram_propose. Giudica chi possiede il ramo.",
|
|
325
|
+
schema: {
|
|
326
|
+
type: "object",
|
|
327
|
+
properties: {
|
|
328
|
+
node: { type: "string", description: "id del nodo" },
|
|
329
|
+
decision: { type: "string", enum: ["pass", "return", "replan"], description: "l'esito" },
|
|
330
|
+
reason: { type: "string", description: "il perche' (obbligatorio se non e' pass)" },
|
|
331
|
+
consulted: { type: "array", items: { type: "string" }, description: "con chi ne hai parlato" },
|
|
332
|
+
},
|
|
333
|
+
required: ["node", "decision"],
|
|
334
|
+
},
|
|
335
|
+
handler: async (input, ctx) => {
|
|
336
|
+
const store = openStore(ctx);
|
|
337
|
+
if (!store)
|
|
338
|
+
return noStore();
|
|
339
|
+
const decision = text(input, "decision");
|
|
340
|
+
if (!["pass", "return", "replan"].includes(decision))
|
|
341
|
+
return "decisione non valida: pass, return o replan";
|
|
342
|
+
const esito = store.apply((roadmap) => judgeNode(roadmap, {
|
|
343
|
+
id: text(input, "node"),
|
|
344
|
+
decision,
|
|
345
|
+
reason: text(input, "reason"),
|
|
346
|
+
consulted: strings(input, "consulted"),
|
|
347
|
+
by: speaker(ctx),
|
|
348
|
+
at: Date.now(),
|
|
349
|
+
}));
|
|
350
|
+
if (!esito.ok)
|
|
351
|
+
return esito.reason;
|
|
352
|
+
if (!esito.roadmap)
|
|
353
|
+
return "giudicato";
|
|
354
|
+
const giudicato = esito.roadmap.nodes[text(input, "node")];
|
|
355
|
+
const stato = decision === "pass" ? "approvato" : decision === "return" ? "rimandato indietro" : "da ripianificare";
|
|
356
|
+
return [
|
|
357
|
+
renderStatus(esito.roadmap),
|
|
358
|
+
giudicato ? segnaleNodo(giudicato, stato, text(input, "reason")) : "",
|
|
359
|
+
].filter(Boolean).join(String.fromCharCode(10));
|
|
360
|
+
},
|
|
361
|
+
};
|
|
362
|
+
export const ramProposeTool = {
|
|
363
|
+
name: "ram_propose",
|
|
364
|
+
description: "Proponi di riscrivere il FUTURO di un ramo, quando il lavoro ha scoperto un limite che il seguito "
|
|
365
|
+
+ "del piano dava per risolto. Non lo applichi: lo proponi, con il motivo, e decide il team che ha "
|
|
366
|
+
+ "aperto la ramificazione. I nodi gia' approvati non si toccano.",
|
|
367
|
+
schema: {
|
|
368
|
+
type: "object",
|
|
369
|
+
properties: {
|
|
370
|
+
id: { type: "string", description: "id della proposta, es. P1" },
|
|
371
|
+
branch: { type: "string", description: "ramo interessato" },
|
|
372
|
+
reason: { type: "string", description: "il limite che l'ha causata" },
|
|
373
|
+
add: {
|
|
374
|
+
type: "array",
|
|
375
|
+
description: "nodi da aggiungere",
|
|
376
|
+
items: {
|
|
377
|
+
type: "object",
|
|
378
|
+
properties: {
|
|
379
|
+
id: { type: "string" },
|
|
380
|
+
branch: { type: "string" },
|
|
381
|
+
title: { type: "string" },
|
|
382
|
+
mandate: { type: "string" },
|
|
383
|
+
acceptance: { type: "array", items: { type: "string" } },
|
|
384
|
+
after: { type: "array", items: { type: "string" } },
|
|
385
|
+
},
|
|
386
|
+
required: ["id", "branch", "mandate"],
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
drop: { type: "array", items: { type: "string" }, description: "nodi non ancora consegnati da togliere" },
|
|
390
|
+
retarget: {
|
|
391
|
+
type: "array",
|
|
392
|
+
description: "nodi da riscrivere (mandato, criteri, prerequisiti)",
|
|
393
|
+
items: {
|
|
394
|
+
type: "object",
|
|
395
|
+
properties: {
|
|
396
|
+
id: { type: "string" },
|
|
397
|
+
mandate: { type: "string" },
|
|
398
|
+
acceptance: { type: "array", items: { type: "string" } },
|
|
399
|
+
after: { type: "array", items: { type: "string" } },
|
|
400
|
+
},
|
|
401
|
+
required: ["id"],
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
required: ["id", "reason"],
|
|
406
|
+
},
|
|
407
|
+
handler: async (input, ctx) => {
|
|
408
|
+
const store = openStore(ctx);
|
|
409
|
+
if (!store)
|
|
410
|
+
return noStore();
|
|
411
|
+
const mutation = {
|
|
412
|
+
...(Array.isArray(input["add"]) ? { add: input["add"] } : {}),
|
|
413
|
+
...(Array.isArray(input["drop"]) ? { drop: strings(input, "drop") } : {}),
|
|
414
|
+
...(Array.isArray(input["retarget"]) ? { retarget: input["retarget"] } : {}),
|
|
415
|
+
};
|
|
416
|
+
const esito = store.apply((roadmap) => proposeMutation(roadmap, {
|
|
417
|
+
id: text(input, "id"),
|
|
418
|
+
branch: text(input, "branch"),
|
|
419
|
+
mutation,
|
|
420
|
+
reason: text(input, "reason"),
|
|
421
|
+
by: speaker(ctx),
|
|
422
|
+
at: Date.now(),
|
|
423
|
+
}));
|
|
424
|
+
return esito.ok
|
|
425
|
+
? `proposta ${text(input, "id")} in attesa: decide il team che ha aperto la ramificazione`
|
|
426
|
+
: esito.reason;
|
|
427
|
+
},
|
|
428
|
+
};
|
|
429
|
+
export const ramDecideTool = {
|
|
430
|
+
name: "ram_decide",
|
|
431
|
+
description: "Decidi su una proposta di riscrittura: accettata, il futuro del ramo cambia adesso; rifiutata, "
|
|
432
|
+
+ "servono le ragioni. Decide solo il team che ha aperto la ramificazione.",
|
|
433
|
+
schema: {
|
|
434
|
+
type: "object",
|
|
435
|
+
properties: {
|
|
436
|
+
id: { type: "string", description: "id della proposta" },
|
|
437
|
+
accept: { type: "boolean", description: "true accetta, false rifiuta" },
|
|
438
|
+
reason: { type: "string", description: "il perche'" },
|
|
439
|
+
},
|
|
440
|
+
required: ["id", "accept"],
|
|
441
|
+
},
|
|
442
|
+
handler: async (input, ctx) => {
|
|
443
|
+
const store = openStore(ctx);
|
|
444
|
+
if (!store)
|
|
445
|
+
return noStore();
|
|
446
|
+
const esito = store.apply((roadmap) => resolveProposal(roadmap, {
|
|
447
|
+
id: text(input, "id"),
|
|
448
|
+
accept: input["accept"] === true,
|
|
449
|
+
reason: text(input, "reason"),
|
|
450
|
+
by: speaker(ctx),
|
|
451
|
+
at: Date.now(),
|
|
452
|
+
}));
|
|
453
|
+
if (!esito.ok)
|
|
454
|
+
return esito.reason;
|
|
455
|
+
return esito.roadmap ? renderStatus(esito.roadmap) : "deciso";
|
|
456
|
+
},
|
|
457
|
+
};
|
|
458
|
+
// ram_tell / ram_hear: il canale fra NODI, cioe' fra sessioni diverse. Distinto
|
|
459
|
+
// dai messaggi fra agenti della stessa stanza, e marcato come tale.
|
|
460
|
+
export const ramTellTool = {
|
|
461
|
+
name: "ram_tell",
|
|
462
|
+
description: "Scrivi a un altro nodo del piano, cioe' a un'ALTRA sessione. Usalo quando scopri qualcosa che "
|
|
463
|
+
+ "riguarda il lavoro di un altro ramo. Chi legge vedra' che arriva da un'altra sessione, con nodo, "
|
|
464
|
+
+ "ramo e sessione di provenienza: non e' un collega della sua attivita. Ometti `to` per dirlo a tutti.",
|
|
465
|
+
schema: {
|
|
466
|
+
type: "object",
|
|
467
|
+
properties: {
|
|
468
|
+
from: { type: "string", description: "il nodo da cui scrivi (quello che questa sessione sta eseguendo)" },
|
|
469
|
+
to: { type: "string", description: "nodo o ramo destinatario; ometti per tutti" },
|
|
470
|
+
text: { type: "string", description: "il messaggio" },
|
|
471
|
+
},
|
|
472
|
+
required: ["from", "text"],
|
|
473
|
+
},
|
|
474
|
+
handler: async (input, ctx) => {
|
|
475
|
+
const store = openStore(ctx);
|
|
476
|
+
if (!store)
|
|
477
|
+
return noStore();
|
|
478
|
+
const esito = store.apply((roadmap) => postAcrossNodes(roadmap, {
|
|
479
|
+
fromNode: text(input, "from"),
|
|
480
|
+
who: speaker(ctx),
|
|
481
|
+
to: text(input, "to"),
|
|
482
|
+
text: text(input, "text"),
|
|
483
|
+
at: Date.now(),
|
|
484
|
+
}));
|
|
485
|
+
return esito.ok ? "inviato" : esito.reason;
|
|
486
|
+
},
|
|
487
|
+
};
|
|
488
|
+
export const ramHearTool = {
|
|
489
|
+
name: "ram_hear",
|
|
490
|
+
description: "Leggi cosa ti hanno scritto le ALTRE sessioni del piano. Ogni riga dice da quale nodo, ramo e "
|
|
491
|
+
+ "sessione arriva. Controllalo prima di dare per buono qualcosa che un altro ramo potrebbe aver "
|
|
492
|
+
+ "smentito.",
|
|
493
|
+
schema: {
|
|
494
|
+
type: "object",
|
|
495
|
+
properties: {
|
|
496
|
+
node: { type: "string", description: "il nodo che questa sessione sta eseguendo" },
|
|
497
|
+
since: { type: "number", description: "leggi solo dopo questo numero di sequenza" },
|
|
498
|
+
},
|
|
499
|
+
required: ["node"],
|
|
500
|
+
},
|
|
501
|
+
handler: async (input, ctx) => {
|
|
502
|
+
const store = openStore(ctx);
|
|
503
|
+
if (!store)
|
|
504
|
+
return noStore();
|
|
505
|
+
const roadmap = store.current();
|
|
506
|
+
if (!roadmap)
|
|
507
|
+
return "nessun piano a rami per questa conversazione";
|
|
508
|
+
const messaggi = crosstalkFor(roadmap, {
|
|
509
|
+
node: text(input, "node"),
|
|
510
|
+
since: Number(input["since"]) || 0,
|
|
511
|
+
});
|
|
512
|
+
if (!messaggi.length)
|
|
513
|
+
return "niente dalle altre sessioni";
|
|
514
|
+
return messaggi.map((m) => `${m.seq}. ${renderCrosstalk(m)}`).join("\n");
|
|
515
|
+
},
|
|
516
|
+
};
|
|
517
|
+
export const ramificationTools = [
|
|
518
|
+
ramPlanTool,
|
|
519
|
+
ramStatusTool,
|
|
520
|
+
ramTakeTool,
|
|
521
|
+
ramSubmitTool,
|
|
522
|
+
ramAskTool,
|
|
523
|
+
ramJudgeTool,
|
|
524
|
+
ramProposeTool,
|
|
525
|
+
ramDecideTool,
|
|
526
|
+
ramTellTool,
|
|
527
|
+
ramHearTool,
|
|
528
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface CompiledPattern {
|
|
2
|
+
readonly regex: RegExp;
|
|
3
|
+
readonly notes: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
export declare class PatternError extends Error {
|
|
6
|
+
}
|
|
7
|
+
export declare function compileSearchPattern(pattern: string, opts?: {
|
|
8
|
+
readonly ignoreCase?: boolean;
|
|
9
|
+
}): CompiledPattern;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Compatibilita' fra le regex che i modelli SCRIVONO e quelle che JavaScript
|
|
2
|
+
// ESEGUE.
|
|
3
|
+
//
|
|
4
|
+
// I modelli producono pattern in stile ripgrep/Rust/Python, perche' e' quello
|
|
5
|
+
// che vedono ovunque: `(?i)password`, `(?P<name>...)`, `\A...\z`. Il motore di
|
|
6
|
+
// JavaScript non conosce nessuna di queste forme e solleva
|
|
7
|
+
// "Invalid regular expression: unrecognized character after (?", quindi la
|
|
8
|
+
// ricerca falliva del tutto e l'agente perdeva un giro a indovinare perche'.
|
|
9
|
+
//
|
|
10
|
+
// Qui traduciamo le forme equivalenti e lasciamo fallire solo cio' che davvero
|
|
11
|
+
// non ha corrispondenza. Modulo PURO, nessuna dipendenza.
|
|
12
|
+
export class PatternError extends Error {
|
|
13
|
+
}
|
|
14
|
+
// Flag inline supportate (stessa lettera in JS). `x` (extended) e `U`
|
|
15
|
+
// (ungreedy) non hanno equivalente e vengono dichiarate non supportate.
|
|
16
|
+
const INLINE_FLAGS = new Set(["i", "m", "s"]);
|
|
17
|
+
// Legge i gruppi di flag inline in TESTA al pattern: (?i), (?im), (?i-s), uno
|
|
18
|
+
// dopo l'altro. Ritorna le flag attive e il resto del pattern.
|
|
19
|
+
function takeLeadingFlags(pattern) {
|
|
20
|
+
const flags = new Set();
|
|
21
|
+
const unsupported = new Set();
|
|
22
|
+
let rest = pattern;
|
|
23
|
+
for (;;) {
|
|
24
|
+
const match = /^\(\?([a-zA-Z]*)(?:-([a-zA-Z]+))?\)/.exec(rest);
|
|
25
|
+
if (!match)
|
|
26
|
+
break;
|
|
27
|
+
const on = match[1] ?? "";
|
|
28
|
+
const off = match[2] ?? "";
|
|
29
|
+
// `(?)` non e' un gruppo di flag valido: lascialo al motore.
|
|
30
|
+
if (!on && !off)
|
|
31
|
+
break;
|
|
32
|
+
for (const flag of on) {
|
|
33
|
+
if (INLINE_FLAGS.has(flag))
|
|
34
|
+
flags.add(flag);
|
|
35
|
+
else
|
|
36
|
+
unsupported.add(flag);
|
|
37
|
+
}
|
|
38
|
+
for (const flag of off)
|
|
39
|
+
flags.delete(flag);
|
|
40
|
+
rest = rest.slice(match[0].length);
|
|
41
|
+
}
|
|
42
|
+
return { flags, rest, unsupported };
|
|
43
|
+
}
|
|
44
|
+
// Traduzioni testuali sicure verso la sintassi JavaScript.
|
|
45
|
+
function translateBody(pattern) {
|
|
46
|
+
const notes = [];
|
|
47
|
+
let body = pattern;
|
|
48
|
+
// Gruppi con nome in stile Python/Rust: (?P<x>...) -> (?<x>...)
|
|
49
|
+
if (/\(\?P</.test(body)) {
|
|
50
|
+
body = body.replace(/\(\?P</g, "(?<");
|
|
51
|
+
notes.push("gruppi (?P<nome>) tradotti in (?<nome>)");
|
|
52
|
+
}
|
|
53
|
+
// Ancore Rust: \A inizio testo, \z / \Z fine testo.
|
|
54
|
+
if (/\\A/.test(body)) {
|
|
55
|
+
body = body.replace(/\\A/g, "^");
|
|
56
|
+
notes.push("\\A tradotto in ^");
|
|
57
|
+
}
|
|
58
|
+
if (/\\[zZ]/.test(body)) {
|
|
59
|
+
body = body.replace(/\\[zZ]/g, "$");
|
|
60
|
+
notes.push("\\z tradotto in $");
|
|
61
|
+
}
|
|
62
|
+
return { body, notes };
|
|
63
|
+
}
|
|
64
|
+
// Compila un pattern di ricerca. `ignoreCase` e' la richiesta esplicita del
|
|
65
|
+
// chiamante (parametro del tool); le flag inline si sommano a quella.
|
|
66
|
+
export function compileSearchPattern(pattern, opts = {}) {
|
|
67
|
+
if (!pattern)
|
|
68
|
+
throw new PatternError("pattern vuoto");
|
|
69
|
+
const notes = [];
|
|
70
|
+
const leading = takeLeadingFlags(pattern);
|
|
71
|
+
if (leading.unsupported.size) {
|
|
72
|
+
throw new PatternError(`flag inline non supportate in JavaScript: (?${[...leading.unsupported].join("")}). `
|
|
73
|
+
+ "Usa i parametri del tool (ignore_case) o riscrivi il pattern.");
|
|
74
|
+
}
|
|
75
|
+
const flags = new Set(leading.flags);
|
|
76
|
+
if (opts.ignoreCase)
|
|
77
|
+
flags.add("i");
|
|
78
|
+
if (leading.flags.size) {
|
|
79
|
+
notes.push(`flag inline (?${[...leading.flags].join("")}) applicate come flag del motore`);
|
|
80
|
+
}
|
|
81
|
+
const translated = translateBody(leading.rest);
|
|
82
|
+
notes.push(...translated.notes);
|
|
83
|
+
// Flag inline rimaste in mezzo al pattern: JavaScript non le supporta e
|
|
84
|
+
// spostarle cambierebbe il significato. Meglio dirlo che indovinare.
|
|
85
|
+
const midPattern = /\(\?[a-zA-Z]*(?:-[a-zA-Z]+)?\)/.exec(translated.body);
|
|
86
|
+
if (midPattern) {
|
|
87
|
+
throw new PatternError(`flag inline ${midPattern[0]} in mezzo al pattern: JavaScript le accetta solo come flag globali. `
|
|
88
|
+
+ "Spostale all'inizio del pattern o usa ignore_case.");
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
return { regex: new RegExp(translated.body, [...flags].sort().join("")), notes };
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
throw new PatternError(err.message);
|
|
95
|
+
}
|
|
96
|
+
}
|