talos-code 0.0.1 → 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/LICENSE +661 -0
- package/README.md +111 -3
- package/THIRD_PARTY_NOTICES.md +40 -0
- package/dist/archive/zip.js +73 -0
- package/dist/args.js +97 -0
- package/dist/automations/history-store.js +34 -0
- package/dist/automations/policy-store.js +43 -0
- package/dist/automations/runner.js +107 -0
- package/dist/automations/schedule.js +85 -0
- package/dist/automations/windows-task.js +53 -0
- package/dist/commands/advanced-cli.js +233 -0
- package/dist/commands/checkpoint-cli.js +45 -0
- package/dist/commands/config-cli.js +107 -0
- package/dist/commands/context.js +17 -0
- package/dist/commands/extensions-cli.js +207 -0
- package/dist/commands/project-cli.js +74 -0
- package/dist/commands/project-commands.js +143 -0
- package/dist/commands/provider-cli.js +185 -0
- package/dist/commands/services-cli.js +248 -0
- package/dist/commands/session-cli.js +171 -0
- package/dist/commands/system-cli.js +405 -0
- package/dist/config/commands.js +60 -0
- package/dist/config/load.js +382 -0
- package/dist/config/migrations.js +48 -0
- package/dist/config/types.js +11 -0
- package/dist/diagnostics/development-log.js +154 -0
- package/dist/diagnostics/doctor.js +104 -0
- package/dist/diagnostics/redact.js +80 -0
- package/dist/diagnostics/zip.js +52 -0
- package/dist/errors.js +156 -0
- package/dist/events/bridge.js +130 -0
- package/dist/extensions/installer.js +178 -0
- package/dist/extensions/package-schema.js +24 -0
- package/dist/headless/result.js +84 -0
- package/dist/headless/run.js +230 -0
- package/dist/i18n/en/approval.js +43 -0
- package/dist/i18n/en/common.js +9 -0
- package/dist/i18n/en/credentials.js +82 -0
- package/dist/i18n/en/errors.js +246 -0
- package/dist/i18n/en/firstrun.js +89 -0
- package/dist/i18n/en/providers.js +37 -0
- package/dist/i18n/en/screen.js +736 -0
- package/dist/i18n/en/tools.js +127 -0
- package/dist/i18n/en.js +14 -0
- package/dist/i18n/error-view.js +307 -0
- package/dist/i18n/index.js +19 -0
- package/dist/i18n/kernel-map.js +139 -0
- package/dist/io.js +45 -0
- package/dist/main.js +330 -0
- package/dist/paths.js +41 -0
- package/dist/protocol/v2/codec.js +9 -0
- package/dist/protocol/v2/events.js +555 -0
- package/dist/protocol/v2/index.js +4 -0
- package/dist/protocol/v2/replay.js +28 -0
- package/dist/protocol/v2/types.js +1 -0
- package/dist/provider/control-plane.js +135 -0
- package/dist/provider/environment-keys.js +275 -0
- package/dist/provider/health.js +110 -0
- package/dist/provider/missing-key.js +48 -0
- package/dist/provider/model-catalog.js +168 -0
- package/dist/provider/provider-text.js +13 -0
- package/dist/provider/store.js +95 -0
- package/dist/provider/system-keyring.js +214 -0
- package/dist/runtime/active-run.js +63 -0
- package/dist/runtime/agent-tree.js +74 -0
- package/dist/runtime/attachments.js +84 -0
- package/dist/runtime/brokered-executor.js +395 -0
- package/dist/runtime/context-status.js +76 -0
- package/dist/runtime/create-runtime.js +111 -0
- package/dist/runtime/model-profile.js +361 -0
- package/dist/runtime/output-store.js +137 -0
- package/dist/runtime/provider-attempts.js +185 -0
- package/dist/runtime/replay-buffer.js +153 -0
- package/dist/runtime/repo.js +95 -0
- package/dist/runtime/session-facade.js +135 -0
- package/dist/runtime/session-summary.js +125 -0
- package/dist/runtime/supervisor.js +262 -0
- package/dist/runtime/talos-composition.js +1006 -0
- package/dist/runtime/types.js +5 -0
- package/dist/runtime/usage-snapshot.js +82 -0
- package/dist/security/auto-classifier.js +38 -0
- package/dist/security/credential-free-environment.js +54 -0
- package/dist/security/evaluate.js +243 -0
- package/dist/security/execution-backends.js +236 -0
- package/dist/security/execution-broker.js +102 -0
- package/dist/security/forge-scan.js +74 -0
- package/dist/security/from-approval.js +39 -0
- package/dist/security/mxc-execution-backend.js +281 -0
- package/dist/security/permission-engine.js +138 -0
- package/dist/security/permission-explanation.js +54 -0
- package/dist/security/persist.js +179 -0
- package/dist/security/plugin-guard.js +230 -0
- package/dist/security/process-tree-evidence-store.js +74 -0
- package/dist/security/process-tree-probe.js +554 -0
- package/dist/security/project-resource-inventory.js +186 -0
- package/dist/security/project-trust-gate.js +38 -0
- package/dist/security/project-trust.js +367 -0
- package/dist/security/rule-parser.js +201 -0
- package/dist/security/shell-segmentation.js +68 -0
- package/dist/security/trust-authority.js +324 -0
- package/dist/security/types.js +1 -0
- package/dist/security/workspace-identity.js +102 -0
- package/dist/services/automation-facade.js +59 -0
- package/dist/services/forge-facade.js +77 -0
- package/dist/services/hook-facade.js +240 -0
- package/dist/services/index.js +16 -0
- package/dist/services/library-facade.js +174 -0
- package/dist/services/mcp-facade.js +348 -0
- package/dist/services/memory-facade.js +126 -0
- package/dist/services/notes-facade.js +157 -0
- package/dist/services/plugin-facade.js +308 -0
- package/dist/services/research-facade.js +110 -0
- package/dist/services/task-board-facade.js +236 -0
- package/dist/services/workflow-catalog.js +246 -0
- package/dist/sessions/export-format.js +98 -0
- package/dist/sessions/metadata-store.js +160 -0
- package/dist/sessions/share.js +122 -0
- package/dist/sessions/transfer.js +16 -0
- package/dist/subcommands.js +62 -0
- package/dist/tui/agent-roster.js +36 -0
- package/dist/tui/app.js +3761 -0
- package/dist/tui/approval.js +36 -0
- package/dist/tui/boot/boot-sequence.js +76 -0
- package/dist/tui/boot/cinematic.js +243 -0
- package/dist/tui/boot/desktop-logo.js +82 -0
- package/dist/tui/boot.js +3 -0
- package/dist/tui/busy-input.js +58 -0
- package/dist/tui/catalog-service.js +559 -0
- package/dist/tui/components/assistant-stream.js +1 -0
- package/dist/tui/components/command-menu.js +68 -0
- package/dist/tui/components/composer.js +219 -0
- package/dist/tui/components/diff.js +35 -0
- package/dist/tui/components/footer.js +48 -0
- package/dist/tui/components/header.js +6 -0
- package/dist/tui/components/markdown.js +305 -0
- package/dist/tui/components/status-indicator.js +32 -0
- package/dist/tui/components/terminal-shell.js +205 -0
- package/dist/tui/components/thinking-row.js +19 -0
- package/dist/tui/components/tool-row.js +97 -0
- package/dist/tui/components/transcript-virtualizer.js +165 -0
- package/dist/tui/components/transcript.js +43 -0
- package/dist/tui/diff-model.js +77 -0
- package/dist/tui/editor-history.js +21 -0
- package/dist/tui/editor.js +210 -0
- package/dist/tui/event-adapter.js +436 -0
- package/dist/tui/exit-output.js +58 -0
- package/dist/tui/external-editor.js +53 -0
- package/dist/tui/file-completion.js +89 -0
- package/dist/tui/focus-manager.js +5 -0
- package/dist/tui/highlight.js +30 -0
- package/dist/tui/input-router.js +18 -0
- package/dist/tui/interrupt.js +99 -0
- package/dist/tui/keybindings.js +194 -0
- package/dist/tui/keymap-resolver.js +91 -0
- package/dist/tui/launch-state.js +139 -0
- package/dist/tui/line-diff.js +57 -0
- package/dist/tui/live-activity.js +45 -0
- package/dist/tui/metrics.js +123 -0
- package/dist/tui/onboarding.js +36 -0
- package/dist/tui/overlays/agent-tree.js +39 -0
- package/dist/tui/overlays/approval-dialog.js +640 -0
- package/dist/tui/overlays/automation-center.js +51 -0
- package/dist/tui/overlays/checkpoint-picker.js +47 -0
- package/dist/tui/overlays/context-inspector.js +36 -0
- package/dist/tui/overlays/effort-line.js +110 -0
- package/dist/tui/overlays/forge-center.js +46 -0
- package/dist/tui/overlays/help-dialog.js +16 -0
- package/dist/tui/overlays/history-picker.js +37 -0
- package/dist/tui/overlays/hook-center.js +70 -0
- package/dist/tui/overlays/library-center.js +55 -0
- package/dist/tui/overlays/mcp-center.js +60 -0
- package/dist/tui/overlays/memory-center.js +63 -0
- package/dist/tui/overlays/model-picker.js +72 -0
- package/dist/tui/overlays/notes-center.js +53 -0
- package/dist/tui/overlays/overlay-host.js +8 -0
- package/dist/tui/overlays/plugin-center.js +76 -0
- package/dist/tui/overlays/provider-picker.js +145 -0
- package/dist/tui/overlays/queue-editor.js +32 -0
- package/dist/tui/overlays/research-center.js +59 -0
- package/dist/tui/overlays/scroll-window.js +234 -0
- package/dist/tui/overlays/session-picker.js +115 -0
- package/dist/tui/overlays/tasks-center.js +83 -0
- package/dist/tui/overlays/theme-picker.js +21 -0
- package/dist/tui/overlays/transcript-search.js +58 -0
- package/dist/tui/overlays/trust-center.js +29 -0
- package/dist/tui/overlays/workflow-center.js +46 -0
- package/dist/tui/project-file-index.js +214 -0
- package/dist/tui/project-references.js +85 -0
- package/dist/tui/project-trust-prompt.js +287 -0
- package/dist/tui/prompt-history-store.js +116 -0
- package/dist/tui/queue-store.js +110 -0
- package/dist/tui/regions/budget.js +59 -0
- package/dist/tui/regions/views.js +96 -0
- package/dist/tui/render-coordinator.js +148 -0
- package/dist/tui/render-scheduler.js +4 -0
- package/dist/tui/run.js +69 -0
- package/dist/tui/selection-list.js +29 -0
- package/dist/tui/session-controller.js +778 -0
- package/dist/tui/session-export.js +54 -0
- package/dist/tui/shell-input.js +35 -0
- package/dist/tui/shell-layout.js +48 -0
- package/dist/tui/shell-model.js +98 -0
- package/dist/tui/slash-commands.js +80 -0
- package/dist/tui/state.js +151 -0
- package/dist/tui/status-bar.js +125 -0
- package/dist/tui/status-view.js +40 -0
- package/dist/tui/terminal-capabilities.js +9 -0
- package/dist/tui/terminal-session.js +11 -0
- package/dist/tui/text-width.js +66 -0
- package/dist/tui/theme-catalog.js +25 -0
- package/dist/tui/theme-store.js +23 -0
- package/dist/tui/theme.js +23 -0
- package/dist/tui/tool-display.js +135 -0
- package/dist/tui/tool-facts.js +1 -0
- package/dist/tui/tools/bash-renderer.js +32 -0
- package/dist/tui/tools/change.js +61 -0
- package/dist/tui/tools/edit-renderer.js +17 -0
- package/dist/tui/tools/generic-renderer.js +13 -0
- package/dist/tui/tools/list-renderer.js +14 -0
- package/dist/tui/tools/read-renderer.js +13 -0
- package/dist/tui/tools/registry.js +20 -0
- package/dist/tui/tools/row-format.js +187 -0
- package/dist/tui/tools/search-renderer.js +38 -0
- package/dist/tui/tools/shared.js +97 -0
- package/dist/tui/tools/write-renderer.js +15 -0
- package/dist/tui/transcript-model.js +441 -0
- package/dist/tui/ui-preferences.js +79 -0
- package/dist/tui/usage-view.js +77 -0
- package/dist/tui/vim-mode.js +99 -0
- package/dist/update/check.js +15 -0
- package/dist/update/npm.js +51 -0
- package/dist/update/run.js +129 -0
- package/dist/version.js +2 -0
- package/dist/workspace/checkpoint-store.js +210 -0
- package/dist/workspace/checkpoint.js +413 -0
- package/dist/workspace/restore.js +232 -0
- package/package.json +63 -5
- package/vendor/context-engine/package.json +11 -0
- package/vendor/context-engine/src/compaction-planner.mjs +57 -0
- package/vendor/context-engine/src/contracts.mjs +48 -0
- package/vendor/context-engine/src/engine.mjs +445 -0
- package/vendor/context-engine/src/node/context-export.mjs +164 -0
- package/vendor/context-engine/src/node/legacy-import.mjs +92 -0
- package/vendor/context-engine/src/node/migrations/001-context.sql +126 -0
- package/vendor/context-engine/src/node/sqlite-store.mjs +85 -0
- package/vendor/context-engine/src/node/sqlite-worker.mjs +559 -0
- package/vendor/context-engine/src/profiles.mjs +10 -0
- package/vendor/context-engine/src/retrieval.mjs +104 -0
- package/vendor/context-engine/src/summary.mjs +97 -0
- package/vendor/context-engine/src/usage.mjs +34 -0
- package/vendor/harness-ui/package.json +38 -0
- package/vendor/harness-ui/src/acp-agent.mjs +350 -0
- package/vendor/harness-ui/src/agent-service.mjs +2188 -0
- package/vendor/harness-ui/src/agui-events.mjs +452 -0
- package/vendor/harness-ui/src/ambiente-solo-server.mjs +121 -0
- package/vendor/harness-ui/src/artifact-store.mjs +39 -0
- package/vendor/harness-ui/src/assistenza.mjs +123 -0
- package/vendor/harness-ui/src/automation-scheduler.mjs +69 -0
- package/vendor/harness-ui/src/automation-store.mjs +145 -0
- package/vendor/harness-ui/src/browser-annota.mjs +639 -0
- package/vendor/harness-ui/src/browser-frame.mjs +211 -0
- package/vendor/harness-ui/src/browser-proxy-universale.mjs +519 -0
- package/vendor/harness-ui/src/browser-proxy.mjs +87 -0
- package/vendor/harness-ui/src/browser-sessione-viva.mjs +329 -0
- package/vendor/harness-ui/src/browser-stream.mjs +445 -0
- package/vendor/harness-ui/src/browser-vivo.mjs +694 -0
- package/vendor/harness-ui/src/chat-image-attachments.mjs +72 -0
- package/vendor/harness-ui/src/config.mjs +697 -0
- package/vendor/harness-ui/src/contesto-del-progetto.mjs +385 -0
- package/vendor/harness-ui/src/context-asset-adapter.mjs +72 -0
- package/vendor/harness-ui/src/context-desktop-service.mjs +253 -0
- package/vendor/harness-ui/src/context-embedding-runtime.mjs +252 -0
- package/vendor/harness-ui/src/context-inference-scheduler.mjs +81 -0
- package/vendor/harness-ui/src/context-native-compaction.mjs +75 -0
- package/vendor/harness-ui/src/context-provider-adapter.mjs +141 -0
- package/vendor/harness-ui/src/context-runtime.mjs +118 -0
- package/vendor/harness-ui/src/context-token-counters.mjs +184 -0
- package/vendor/harness-ui/src/context-tool-catalog.mjs +86 -0
- package/vendor/harness-ui/src/context-tool-output.mjs +72 -0
- package/vendor/harness-ui/src/costo-elenco.mjs +252 -0
- package/vendor/harness-ui/src/custom-task.mjs +171 -0
- package/vendor/harness-ui/src/doctor.mjs +142 -0
- package/vendor/harness-ui/src/document-filename.mjs +97 -0
- package/vendor/harness-ui/src/document-generator.mjs +493 -0
- package/vendor/harness-ui/src/document-report.mjs +331 -0
- package/vendor/harness-ui/src/duckduckgo-search.mjs +155 -0
- package/vendor/harness-ui/src/elenco-profondo.mjs +337 -0
- package/vendor/harness-ui/src/favicon-proxy.mjs +113 -0
- package/vendor/harness-ui/src/forge-contract.mjs +221 -0
- package/vendor/harness-ui/src/frequent-dirs.mjs +134 -0
- package/vendor/harness-ui/src/generated-image-store.mjs +147 -0
- package/vendor/harness-ui/src/generation-idle.mjs +332 -0
- package/vendor/harness-ui/src/gguf-header.mjs +207 -0
- package/vendor/harness-ui/src/git-service.mjs +626 -0
- package/vendor/harness-ui/src/gitignore-elenco.mjs +604 -0
- package/vendor/harness-ui/src/harness-receipt-keypair.mjs +207 -0
- package/vendor/harness-ui/src/hf-direct-transfer.mjs +170 -0
- package/vendor/harness-ui/src/hf-hub-client.mjs +106 -0
- package/vendor/harness-ui/src/hf-image-proxy.mjs +105 -0
- package/vendor/harness-ui/src/hf-model-transfer.mjs +245 -0
- package/vendor/harness-ui/src/hook-registry.mjs +186 -0
- package/vendor/harness-ui/src/http-app.mjs +6259 -0
- package/vendor/harness-ui/src/http-lifecycle.mjs +132 -0
- package/vendor/harness-ui/src/id-archivio.mjs +27 -0
- package/vendor/harness-ui/src/image-generator.mjs +143 -0
- package/vendor/harness-ui/src/istruzioni-di-progetto.mjs +234 -0
- package/vendor/harness-ui/src/kernel/dist/kernelPerIlBanco.js +518 -0
- package/vendor/harness-ui/src/kernel/talosHarness.mjs +10437 -0
- package/vendor/harness-ui/src/library-policy-store.mjs +175 -0
- package/vendor/harness-ui/src/library-store.mjs +652 -0
- package/vendor/harness-ui/src/llama-server-supervisor.mjs +629 -0
- package/vendor/harness-ui/src/local-model-store.mjs +339 -0
- package/vendor/harness-ui/src/local-runtime-contract.mjs +66 -0
- package/vendor/harness-ui/src/local-runtime-events.mjs +44 -0
- package/vendor/harness-ui/src/local-runtime-llama-server.mjs +244 -0
- package/vendor/harness-ui/src/local-runtime-probe.mjs +401 -0
- package/vendor/harness-ui/src/machine-capacity.mjs +66 -0
- package/vendor/harness-ui/src/mappa-cartelle.mjs +491 -0
- package/vendor/harness-ui/src/mcp-client.mjs +98 -0
- package/vendor/harness-ui/src/mcp-registry.mjs +157 -0
- package/vendor/harness-ui/src/mcp-session.mjs +177 -0
- package/vendor/harness-ui/src/memory-store.mjs +227 -0
- package/vendor/harness-ui/src/model-catalog-models-dev.mjs +276 -0
- package/vendor/harness-ui/src/model-catalog.mjs +129 -0
- package/vendor/harness-ui/src/model-destination.mjs +189 -0
- package/vendor/harness-ui/src/modifica-ancorata.mjs +177 -0
- package/vendor/harness-ui/src/native-provider-adapter.mjs +205 -0
- package/vendor/harness-ui/src/notes-store.mjs +250 -0
- package/vendor/harness-ui/src/openai-compatible-runtime.mjs +428 -0
- package/vendor/harness-ui/src/openrouter-oauth.mjs +339 -0
- package/vendor/harness-ui/src/path-policy.mjs +442 -0
- package/vendor/harness-ui/src/plugin-registry.mjs +780 -0
- package/vendor/harness-ui/src/plugin-session.mjs +180 -0
- package/vendor/harness-ui/src/process-policy.mjs +345 -0
- package/vendor/harness-ui/src/prompt-enhancer-provider.mjs +94 -0
- package/vendor/harness-ui/src/provider-auth-cloud.mjs +95 -0
- package/vendor/harness-ui/src/provider-credential-store.mjs +541 -0
- package/vendor/harness-ui/src/provider-probe.mjs +582 -0
- package/vendor/harness-ui/src/provider-registry.mjs +1633 -0
- package/vendor/harness-ui/src/pty-terminal.mjs +312 -0
- package/vendor/harness-ui/src/public-problem.mjs +109 -0
- package/vendor/harness-ui/src/research/card.mjs +235 -0
- package/vendor/harness-ui/src/research/citations.mjs +142 -0
- package/vendor/harness-ui/src/research/collector.mjs +275 -0
- package/vendor/harness-ui/src/research/deposito-a-pezzi.mjs +139 -0
- package/vendor/harness-ui/src/research/dossier.mjs +114 -0
- package/vendor/harness-ui/src/research/esportazioni.mjs +560 -0
- package/vendor/harness-ui/src/research/fetch-cache.mjs +465 -0
- package/vendor/harness-ui/src/research/fidelity.mjs +122 -0
- package/vendor/harness-ui/src/research/independence.mjs +159 -0
- package/vendor/harness-ui/src/research/ledger.mjs +166 -0
- package/vendor/harness-ui/src/research/markdown-server.mjs +565 -0
- package/vendor/harness-ui/src/research/narration.mjs +181 -0
- package/vendor/harness-ui/src/research/open-cards.mjs +131 -0
- package/vendor/harness-ui/src/research/opposing.mjs +305 -0
- package/vendor/harness-ui/src/research/outline.mjs +111 -0
- package/vendor/harness-ui/src/research/page-budget.mjs +209 -0
- package/vendor/harness-ui/src/research/pdf.mjs +291 -0
- package/vendor/harness-ui/src/research/plan.mjs +301 -0
- package/vendor/harness-ui/src/research/raccolta-viva.mjs +452 -0
- package/vendor/harness-ui/src/research/recheck-document.mjs +69 -0
- package/vendor/harness-ui/src/research/recheck-history.mjs +192 -0
- package/vendor/harness-ui/src/research/recheck.mjs +194 -0
- package/vendor/harness-ui/src/research/report.mjs +203 -0
- package/vendor/harness-ui/src/research/run.mjs +527 -0
- package/vendor/harness-ui/src/research/synthesis.mjs +318 -0
- package/vendor/harness-ui/src/research/verification.mjs +572 -0
- package/vendor/harness-ui/src/research-orchestrator.mjs +2679 -0
- package/vendor/harness-ui/src/research-store.mjs +1133 -0
- package/vendor/harness-ui/src/runtime-build-manifest.mjs +26 -0
- package/vendor/harness-ui/src/runtime-contract.mjs +59 -0
- package/vendor/harness-ui/src/runtime-owner-adapter.mjs +1348 -0
- package/vendor/harness-ui/src/runtime-owner-contract.mjs +32 -0
- package/vendor/harness-ui/src/scheda-di-lavoro.mjs +249 -0
- package/vendor/harness-ui/src/search-source-store.mjs +172 -0
- package/vendor/harness-ui/src/session-registry.mjs +6095 -0
- package/vendor/harness-ui/src/session-store.mjs +220 -0
- package/vendor/harness-ui/src/sessione-pronta.mjs +73 -0
- package/vendor/harness-ui/src/setup-stato.mjs +31 -0
- package/vendor/harness-ui/src/sezioni-istruzioni.mjs +204 -0
- package/vendor/harness-ui/src/skill-registry.mjs +120 -0
- package/vendor/harness-ui/src/sse-replay-coalescente.mjs +0 -0
- package/vendor/harness-ui/src/static-files.mjs +96 -0
- package/vendor/harness-ui/src/stream-partition.mjs +123 -0
- package/vendor/harness-ui/src/subagent-orchestrator.mjs +453 -0
- package/vendor/harness-ui/src/task-catalog.mjs +65 -0
- package/vendor/harness-ui/src/tasks-store.mjs +220 -0
- package/vendor/harness-ui/src/terminal-registry.mjs +312 -0
- package/vendor/harness-ui/src/terminal-ws.mjs +170 -0
- package/vendor/harness-ui/src/tool-forge-store.mjs +299 -0
- package/vendor/harness-ui/src/tool-schema-normalize.mjs +100 -0
- package/vendor/harness-ui/src/usage-cache.mjs +315 -0
- package/vendor/harness-ui/src/workspace-browser.mjs +213 -0
- package/vendor/harness-ui/src/workspace-context.mjs +124 -0
- package/vendor/harness-ui/src/workspace-disk.mjs +62 -0
- package/vendor/harness-ui/src/workspace-files.mjs +589 -0
- package/vendor/harness-ui/src/workspace-info.mjs +189 -0
- package/vendor/harness-ui/src/workspace-launch-store.mjs +150 -0
- package/vendor/harness-ui/src/workspace-tree.mjs +67 -0
- package/vendor/harness-ui/src/workspace-watcher.mjs +161 -0
- package/vendor/manifest.json +170 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { chmod, mkdir, open, readFile, rename, rm, stat } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
export const SESSION_METADATA_SCHEMA = 'talos.cli.session-metadata.v1';
|
|
5
|
+
export const SESSION_METADATA_MAX_TAGS = 32;
|
|
6
|
+
export const SESSION_METADATA_TAG_MAX_BYTES = 96;
|
|
7
|
+
export const SESSION_METADATA_STORE_MAX_BYTES = 64 * 1024;
|
|
8
|
+
export class SessionMetadataError extends Error {
|
|
9
|
+
code;
|
|
10
|
+
constructor(code, message = code) { super(message); this.name = 'SessionMetadataError'; this.code = code; }
|
|
11
|
+
}
|
|
12
|
+
function fail(message = 'Session metadata is invalid.') { throw new SessionMetadataError('SESSION_METADATA_INVALID', message); }
|
|
13
|
+
function sessionId(value) {
|
|
14
|
+
if (typeof value !== 'string' || !value.trim() || value.length > 512 || /[\0\r\n]/u.test(value))
|
|
15
|
+
fail('Session id is invalid.');
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
function tagValue(value) {
|
|
19
|
+
if (typeof value !== 'string')
|
|
20
|
+
fail('Tag is invalid.');
|
|
21
|
+
const normalized = value.normalize('NFKC').trim().replace(/\s+/gu, ' ').toLowerCase();
|
|
22
|
+
if (!normalized || /[\u0000-\u001f\u007f-\u009f\u2028\u2029\p{Bidi_Control}\p{Default_Ignorable_Code_Point}]/u.test(normalized) || Buffer.byteLength(normalized, 'utf8') > SESSION_METADATA_TAG_MAX_BYTES)
|
|
23
|
+
fail('Tag is invalid.');
|
|
24
|
+
return normalized;
|
|
25
|
+
}
|
|
26
|
+
export const SESSION_METADATA_NAME_MAX = 80;
|
|
27
|
+
function nameValue(value) {
|
|
28
|
+
if (typeof value !== 'string')
|
|
29
|
+
fail('Name is invalid.');
|
|
30
|
+
const normalized = value.normalize('NFKC').trim().replace(/\s+/gu, ' ');
|
|
31
|
+
if (!normalized || normalized.length > SESSION_METADATA_NAME_MAX || /[\u0000-\u001f\u007f-\u009f\u2028\u2029\p{Bidi_Control}]/u.test(normalized))
|
|
32
|
+
fail('Name is invalid.');
|
|
33
|
+
return normalized;
|
|
34
|
+
}
|
|
35
|
+
function timestamp(value) { return typeof value === 'string' && value.length <= 64 && !Number.isNaN(Date.parse(value)); }
|
|
36
|
+
function validate(value, expectedSessionId) {
|
|
37
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
38
|
+
fail();
|
|
39
|
+
const row = value;
|
|
40
|
+
if (row.schema !== SESSION_METADATA_SCHEMA || row.sessionId !== expectedSessionId || typeof row.pinned !== 'boolean' || !timestamp(row.createdAt) || !timestamp(row.updatedAt) || !Array.isArray(row.tags) || row.tags.length > SESSION_METADATA_MAX_TAGS)
|
|
41
|
+
fail();
|
|
42
|
+
const tags = [];
|
|
43
|
+
const seen = new Set();
|
|
44
|
+
for (const raw of row.tags) {
|
|
45
|
+
const normalized = tagValue(raw);
|
|
46
|
+
if (raw !== normalized || seen.has(normalized))
|
|
47
|
+
fail();
|
|
48
|
+
seen.add(normalized);
|
|
49
|
+
tags.push(normalized);
|
|
50
|
+
}
|
|
51
|
+
if (row.name !== undefined && nameValue(row.name) !== row.name)
|
|
52
|
+
fail();
|
|
53
|
+
return { schema: SESSION_METADATA_SCHEMA, sessionId: expectedSessionId, tags, pinned: row.pinned, ...(row.name !== undefined ? { name: row.name } : {}), createdAt: row.createdAt, updatedAt: row.updatedAt };
|
|
54
|
+
}
|
|
55
|
+
async function privateDir(dirname) { await mkdir(dirname, { recursive: true, mode: 0o700 }); try {
|
|
56
|
+
await chmod(dirname, 0o700);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (process.platform !== 'win32')
|
|
60
|
+
throw error;
|
|
61
|
+
} }
|
|
62
|
+
async function syncDir(dirname) { try {
|
|
63
|
+
const handle = await open(dirname, 'r');
|
|
64
|
+
try {
|
|
65
|
+
await handle.sync();
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
await handle.close();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (process.platform !== 'win32')
|
|
73
|
+
throw error;
|
|
74
|
+
} }
|
|
75
|
+
async function atomicWrite(file, body) {
|
|
76
|
+
const dirname = path.dirname(file);
|
|
77
|
+
await privateDir(dirname);
|
|
78
|
+
const temp = path.join(dirname, `.${path.basename(file)}.${process.pid}.${randomUUID()}.tmp`);
|
|
79
|
+
try {
|
|
80
|
+
const handle = await open(temp, 'wx', 0o600);
|
|
81
|
+
try {
|
|
82
|
+
await handle.writeFile(body, 'utf8');
|
|
83
|
+
await handle.sync();
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
await handle.close();
|
|
87
|
+
}
|
|
88
|
+
await rename(temp, file);
|
|
89
|
+
try {
|
|
90
|
+
await chmod(file, 0o600);
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (process.platform !== 'win32')
|
|
94
|
+
throw error;
|
|
95
|
+
}
|
|
96
|
+
await syncDir(dirname);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
await rm(temp, { force: true }).catch(() => { });
|
|
100
|
+
if (error instanceof SessionMetadataError)
|
|
101
|
+
throw error;
|
|
102
|
+
throw Object.assign(new SessionMetadataError('SESSION_METADATA_WRITE_FAILED', 'Session metadata could not be written atomically.'), { cause: error });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export function sessionMetadataRoot(dataRoot) { if (typeof dataRoot !== 'string' || !dataRoot.trim())
|
|
106
|
+
fail('Data root is invalid.'); return path.join(dataRoot, 'session-metadata'); }
|
|
107
|
+
export function createSessionMetadataStore({ rootDir }) {
|
|
108
|
+
if (typeof rootDir !== 'string' || !rootDir.trim())
|
|
109
|
+
fail('Metadata root is invalid.');
|
|
110
|
+
const fileForSession = (id) => path.join(rootDir, `${createHash('sha256').update(sessionId(id)).digest('hex')}.json`);
|
|
111
|
+
async function get(idValue) {
|
|
112
|
+
const id = sessionId(idValue), file = fileForSession(id);
|
|
113
|
+
let info;
|
|
114
|
+
try {
|
|
115
|
+
info = await stat(file);
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
if (error.code === 'ENOENT')
|
|
119
|
+
return null;
|
|
120
|
+
throw Object.assign(new SessionMetadataError('SESSION_METADATA_READ_FAILED'), { cause: error });
|
|
121
|
+
}
|
|
122
|
+
if (!info.isFile() || info.size > SESSION_METADATA_STORE_MAX_BYTES)
|
|
123
|
+
fail();
|
|
124
|
+
let parsed;
|
|
125
|
+
try {
|
|
126
|
+
parsed = JSON.parse(await readFile(file, 'utf8'));
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
fail('Session metadata is not valid JSON.');
|
|
130
|
+
}
|
|
131
|
+
return validate(parsed, id);
|
|
132
|
+
}
|
|
133
|
+
async function save(row) {
|
|
134
|
+
const valid = validate(row, sessionId(row.sessionId));
|
|
135
|
+
const body = `${JSON.stringify(valid)}\n`;
|
|
136
|
+
if (Buffer.byteLength(body, 'utf8') > SESSION_METADATA_STORE_MAX_BYTES)
|
|
137
|
+
throw new SessionMetadataError('SESSION_METADATA_LIMIT', 'Session metadata exceeds its byte budget.');
|
|
138
|
+
await atomicWrite(fileForSession(valid.sessionId), body);
|
|
139
|
+
return valid;
|
|
140
|
+
}
|
|
141
|
+
async function mutate(idValue, change) {
|
|
142
|
+
const id = sessionId(idValue), current = await get(id), now = new Date().toISOString();
|
|
143
|
+
const next = current ? { ...current, tags: [...current.tags] } : { schema: SESSION_METADATA_SCHEMA, sessionId: id, tags: [], pinned: false, createdAt: now, updatedAt: now };
|
|
144
|
+
change(next);
|
|
145
|
+
next.updatedAt = now;
|
|
146
|
+
return save(next);
|
|
147
|
+
}
|
|
148
|
+
async function addTag(id, rawTag) { const tag = tagValue(rawTag); return mutate(id, row => { if (row.tags.includes(tag))
|
|
149
|
+
return; if (row.tags.length >= SESSION_METADATA_MAX_TAGS)
|
|
150
|
+
throw new SessionMetadataError('SESSION_METADATA_LIMIT', `A session can have at most ${SESSION_METADATA_MAX_TAGS} tags.`); row.tags.push(tag); }); }
|
|
151
|
+
async function removeTag(id, rawTag) { const tag = tagValue(rawTag); return mutate(id, row => { row.tags = row.tags.filter(value => value !== tag); }); }
|
|
152
|
+
async function setPinned(id, pinned) { if (typeof pinned !== 'boolean')
|
|
153
|
+
fail('Pin state is invalid.'); return mutate(id, row => { row.pinned = pinned; }); }
|
|
154
|
+
/** R5b D2: `null` clears the name. */
|
|
155
|
+
async function setName(id, name) { const value = name === null ? null : nameValue(name); return mutate(id, row => { if (value === null)
|
|
156
|
+
delete row.name;
|
|
157
|
+
else
|
|
158
|
+
row.name = value; }); }
|
|
159
|
+
return { fileForSession, get, addTag, removeTag, setPinned, setName };
|
|
160
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { chmod, mkdir, open, rename, rm } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { createRedactor, redactObject } from "../diagnostics/redact.js";
|
|
5
|
+
export const SESSION_SHARE_SCHEMA = 'talos.cli.session-share.v1';
|
|
6
|
+
export const SESSION_SHARE_MAX_BYTES = 64 * 1024 * 1024;
|
|
7
|
+
function coded(code, message = code) { return Object.assign(new Error(message), { code }); }
|
|
8
|
+
function textOrNull(value) { return typeof value === 'string' && value.trim() ? value.trim() : null; }
|
|
9
|
+
const WINDOWS_DRIVE_ABSOLUTE = /(?:^|[^A-Za-z0-9])[A-Za-z]:[\\/]/u;
|
|
10
|
+
const WINDOWS_UNC_ABSOLUTE = /(?:^|[^\\])\\\\[^\\\r\n]+\\[^\\\r\n]+/u;
|
|
11
|
+
const FILE_URI_ABSOLUTE = /\bfile:\/\/\//iu;
|
|
12
|
+
const POSIX_ABSOLUTE = /(?<![A-Za-z0-9:/])\/(?!\/)[^/\s]/u;
|
|
13
|
+
function hasAbsolutePath(value) { return WINDOWS_DRIVE_ABSOLUTE.test(value) || WINDOWS_UNC_ABSOLUTE.test(value) || FILE_URI_ABSOLUTE.test(value) || POSIX_ABSOLUTE.test(value); }
|
|
14
|
+
function redactPathText(value) { return hasAbsolutePath(value) ? '[REDACTED_PATH]' : value; }
|
|
15
|
+
function redactPaths(value) {
|
|
16
|
+
if (Array.isArray(value))
|
|
17
|
+
return value.map(redactPaths);
|
|
18
|
+
if (value && typeof value === 'object') {
|
|
19
|
+
const out = {};
|
|
20
|
+
for (const [k, v] of Object.entries(value))
|
|
21
|
+
out[k] = redactPaths(v);
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
return typeof value === 'string' ? redactPathText(value) : value;
|
|
25
|
+
}
|
|
26
|
+
function safeEvents(payload, secrets) {
|
|
27
|
+
const raw = payload?.eventi ?? payload?.events ?? [];
|
|
28
|
+
if (!Array.isArray(raw))
|
|
29
|
+
throw coded('SESSION_SHARE_INVALID', 'Session events are invalid.');
|
|
30
|
+
return raw.filter((event) => event && typeof event === 'object' && !Array.isArray(event) && event.type !== 'ApprovalRequested').map((event) => redactPaths(redactObject(event, secrets)));
|
|
31
|
+
}
|
|
32
|
+
const SESSION_FIELDS = new Set(['id', 'name', 'project', 'model', 'parentId', 'depth', 'delegatedTask', 'forkedFrom', 'startedAt', 'updatedAt', 'endedAt', 'outcome', 'interrupted', 'usage', 'delegationOutcome', 'delegationEvidence', 'tags', 'pinned']);
|
|
33
|
+
function containsAbsolutePath(value) {
|
|
34
|
+
if (typeof value === 'string')
|
|
35
|
+
return hasAbsolutePath(value);
|
|
36
|
+
if (Array.isArray(value))
|
|
37
|
+
return value.some(containsAbsolutePath);
|
|
38
|
+
return Boolean(value && typeof value === 'object' && Object.values(value).some(containsAbsolutePath));
|
|
39
|
+
}
|
|
40
|
+
function validateShare(value) {
|
|
41
|
+
if (!value || value.schema !== SESSION_SHARE_SCHEMA || value.redacted !== true || !value.session || typeof value.session !== 'object' || Array.isArray(value.session) || !Array.isArray(value.events))
|
|
42
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
43
|
+
const top = Object.keys(value).sort().join(',');
|
|
44
|
+
if (top !== 'createdAt,events,redacted,schema,session' || typeof value.createdAt !== 'string' || Number.isNaN(Date.parse(value.createdAt)))
|
|
45
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
46
|
+
const session = value.session, keys = Object.keys(session);
|
|
47
|
+
if (keys.length !== SESSION_FIELDS.size || keys.some(key => !SESSION_FIELDS.has(key)))
|
|
48
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
49
|
+
if (typeof session.id !== 'string' || !session.id || !Number.isSafeInteger(session.depth) || session.depth < 0 || typeof session.outcome !== 'string' || !session.outcome || typeof session.interrupted !== 'boolean' || !Array.isArray(session.tags) || session.tags.some((tag) => typeof tag !== 'string') || typeof session.pinned !== 'boolean')
|
|
50
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
51
|
+
for (const key of ['name', 'project', 'model', 'parentId', 'delegatedTask', 'forkedFrom', 'startedAt', 'updatedAt', 'endedAt'])
|
|
52
|
+
if (session[key] !== null && typeof session[key] !== 'string')
|
|
53
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
54
|
+
if (value.events.some((event) => !event || typeof event !== 'object' || Array.isArray(event) || event.type === 'ApprovalRequested') || containsAbsolutePath(value))
|
|
55
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
export function buildSafeSessionShare({ summary, metadata, payload, secrets = [] }) {
|
|
59
|
+
if (!summary || typeof summary !== 'object')
|
|
60
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
61
|
+
const id = textOrNull(summary.id ?? summary.sessionId);
|
|
62
|
+
if (!id)
|
|
63
|
+
throw coded('SESSION_SHARE_INVALID');
|
|
64
|
+
const redactor = createRedactor(secrets);
|
|
65
|
+
const safeText = (value) => { const text = textOrNull(value); return text === null ? null : redactPathText(redactor.text(text)); };
|
|
66
|
+
const share = {
|
|
67
|
+
schema: SESSION_SHARE_SCHEMA, redacted: true, createdAt: new Date().toISOString(),
|
|
68
|
+
session: {
|
|
69
|
+
id, name: safeText(summary.name), project: safeText(summary.project), model: safeText(summary.model),
|
|
70
|
+
parentId: safeText(summary.parentId), depth: Number.isSafeInteger(summary.depth) && summary.depth >= 0 ? summary.depth : 0, delegatedTask: safeText(summary.delegatedTask), forkedFrom: safeText(summary.forkedFrom),
|
|
71
|
+
startedAt: safeText(summary.startedAt), updatedAt: safeText(summary.updatedAt), endedAt: safeText(summary.endedAt), outcome: safeText(summary.outcome) ?? 'unknown', interrupted: summary.interrupted === true,
|
|
72
|
+
usage: redactPaths(summary.usage ?? null), delegationOutcome: redactPaths(summary.delegationOutcome ?? null), delegationEvidence: redactPaths(summary.delegationEvidence ?? null),
|
|
73
|
+
tags: (metadata?.tags ?? []).map(tag => redactPathText(redactor.text(tag))), pinned: metadata?.pinned === true,
|
|
74
|
+
},
|
|
75
|
+
events: safeEvents(payload, secrets),
|
|
76
|
+
};
|
|
77
|
+
return validateShare(share);
|
|
78
|
+
}
|
|
79
|
+
async function syncDir(dirname) { try {
|
|
80
|
+
const handle = await open(dirname, 'r');
|
|
81
|
+
try {
|
|
82
|
+
await handle.sync();
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
await handle.close();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
if (process.platform !== 'win32')
|
|
90
|
+
throw error;
|
|
91
|
+
} }
|
|
92
|
+
export async function writeSafeSessionShare(file, share) {
|
|
93
|
+
const valid = validateShare(share), body = `${JSON.stringify(valid, null, 2)}\n`;
|
|
94
|
+
if (Buffer.byteLength(body, 'utf8') > SESSION_SHARE_MAX_BYTES)
|
|
95
|
+
throw coded('SESSION_SHARE_LIMIT');
|
|
96
|
+
const dirname = path.dirname(path.resolve(file));
|
|
97
|
+
await mkdir(dirname, { recursive: true, mode: 0o700 });
|
|
98
|
+
const target = path.resolve(file), temp = path.join(dirname, `.${path.basename(target)}.${process.pid}.${randomUUID()}.tmp`);
|
|
99
|
+
try {
|
|
100
|
+
const handle = await open(temp, 'wx', 0o600);
|
|
101
|
+
try {
|
|
102
|
+
await handle.writeFile(body, 'utf8');
|
|
103
|
+
await handle.sync();
|
|
104
|
+
}
|
|
105
|
+
finally {
|
|
106
|
+
await handle.close();
|
|
107
|
+
}
|
|
108
|
+
await rename(temp, target);
|
|
109
|
+
try {
|
|
110
|
+
await chmod(target, 0o600);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
if (process.platform !== 'win32')
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
await syncDir(dirname);
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
await rm(temp, { force: true }).catch(() => { });
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
export async function exportCliSession(file, data) { if (data.header.schema !== 'talos.cli.session.v1')
|
|
4
|
+
throw new Error('SESSION_SCHEMA_UNSUPPORTED'); await mkdir(dirname(file), { recursive: true }); const tmp = `${file}.tmp-${process.pid}`; await writeFile(tmp, `${JSON.stringify(data, null, 2)}\n`, { mode: 0o600 }); await rename(tmp, file); }
|
|
5
|
+
export async function importCliSession(file) { let parsed; try {
|
|
6
|
+
parsed = JSON.parse(await readFile(file, 'utf8'));
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
throw new Error('SESSION_IMPORT_INVALID');
|
|
10
|
+
} if (!parsed || typeof parsed !== 'object')
|
|
11
|
+
throw new Error('SESSION_IMPORT_INVALID'); const p = parsed; if (p.header?.schema !== 'talos.cli.session.v1')
|
|
12
|
+
throw new Error('SESSION_SCHEMA_UNSUPPORTED'); if (!Array.isArray(p.events))
|
|
13
|
+
throw new Error('SESSION_IMPORT_INVALID'); let dropped = 0; const events = p.events.filter(e => { if (e && typeof e === 'object' && e.type === 'ApprovalRequested') {
|
|
14
|
+
dropped++;
|
|
15
|
+
return false;
|
|
16
|
+
} return true; }); return { header: p.header, events, pendingApprovalsDropped: dropped }; }
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { homedir } from 'node:os';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
import { ensureCliPaths, resolveCliPaths } from "./paths.js";
|
|
4
|
+
import { findTalosRepoRoot } from "./runtime/repo.js";
|
|
5
|
+
import { renderSafeTalosFailure } from "./errors.js";
|
|
6
|
+
import { runConfigCommand } from "./commands/config-cli.js";
|
|
7
|
+
import { runProviderCommand, runModelCommand } from "./commands/provider-cli.js";
|
|
8
|
+
import { runSessionCommand } from "./commands/session-cli.js";
|
|
9
|
+
import { runNotesCommand, runTasksCommand, runMemoryCommand, runLibraryCommand, runForgeCommand } from "./commands/services-cli.js";
|
|
10
|
+
import { runMcpCommand, runHookCommand, runPluginCommand, runCustomCommand } from "./commands/extensions-cli.js";
|
|
11
|
+
import { runResearchCommand, runAutomationCommand } from "./commands/advanced-cli.js";
|
|
12
|
+
import { runProjectCommand } from "./commands/project-cli.js";
|
|
13
|
+
import { runCheckpointCommand } from "./commands/checkpoint-cli.js";
|
|
14
|
+
async function defaultRuntimeContext(x) { const { createCliRuntimeContext } = await import("./runtime/create-runtime.js"); return createCliRuntimeContext(x); }
|
|
15
|
+
function emitFailure(io, inv, error) { const failure = renderSafeTalosFailure(inv.outputFormat, error, { component: 'cli', verbose: inv.verbose }); if (failure.toStderr)
|
|
16
|
+
io.writeErr(failure.text);
|
|
17
|
+
else
|
|
18
|
+
io.writeOut(failure.text); return failure.exitCode; }
|
|
19
|
+
export async function runSubcommand(inv, deps) {
|
|
20
|
+
const io = deps.io;
|
|
21
|
+
const [family, ...args] = inv.positionals;
|
|
22
|
+
if (!family)
|
|
23
|
+
return emitFailure(io, inv, Object.assign(new Error('Subcommand required'), { code: 'CLI_USAGE_ERROR' }));
|
|
24
|
+
try {
|
|
25
|
+
const projectRoot = resolve(inv.project ?? process.cwd());
|
|
26
|
+
const paths = deps.paths ?? resolveCliPaths(process.env, process.platform, homedir());
|
|
27
|
+
await ensureCliPaths(paths);
|
|
28
|
+
const repoRoot = deps.repoRoot ?? findTalosRepoRoot(process.cwd());
|
|
29
|
+
const ctx = { invocation: inv, io, projectRoot, paths, repoRoot, createRuntimeContext: deps.createRuntimeContext ?? defaultRuntimeContext };
|
|
30
|
+
switch (family) {
|
|
31
|
+
case 'project': return await runProjectCommand(ctx, args);
|
|
32
|
+
case 'config': return await runConfigCommand(ctx, args);
|
|
33
|
+
case 'provider': return await runProviderCommand(ctx, args);
|
|
34
|
+
case 'model': return await runModelCommand(ctx, args);
|
|
35
|
+
case 'session': return await runSessionCommand(ctx, args);
|
|
36
|
+
case 'mcp': return await runMcpCommand(ctx, args);
|
|
37
|
+
case 'hook': return await runHookCommand(ctx, args);
|
|
38
|
+
case 'plugin': return await runPluginCommand(ctx, args);
|
|
39
|
+
case 'command': return await runCustomCommand(ctx, args);
|
|
40
|
+
case 'memory': return await runMemoryCommand(ctx, args);
|
|
41
|
+
case 'notes': return await runNotesCommand(ctx, args);
|
|
42
|
+
case 'tasks': return await runTasksCommand(ctx, args);
|
|
43
|
+
case 'library': return await runLibraryCommand(ctx, args);
|
|
44
|
+
case 'research': return await runResearchCommand(ctx, args);
|
|
45
|
+
case 'automation': return await runAutomationCommand(ctx, args);
|
|
46
|
+
case 'forge': return await runForgeCommand(ctx, args);
|
|
47
|
+
case 'checkpoint': return await runCheckpointCommand(ctx, args);
|
|
48
|
+
case 'doctor':
|
|
49
|
+
case 'logs':
|
|
50
|
+
case 'diagnostic':
|
|
51
|
+
case 'update':
|
|
52
|
+
case 'init': {
|
|
53
|
+
const { runSystemCommand } = await import("./commands/system-cli.js");
|
|
54
|
+
return await runSystemCommand(ctx, family, args);
|
|
55
|
+
}
|
|
56
|
+
default: throw new Error(`Unsupported subcommand: ${family}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return emitFailure(io, inv, error);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
function rowOf(node, level, focusId) {
|
|
2
|
+
const collisionCount = node.collisions.length;
|
|
3
|
+
return {
|
|
4
|
+
id: node.id,
|
|
5
|
+
parentId: node.parentId,
|
|
6
|
+
level,
|
|
7
|
+
nativeDepth: node.nativeDepth,
|
|
8
|
+
role: node.nativeDepth === 0 && node.parentId === null ? 'main' : 'subagent',
|
|
9
|
+
focused: node.id === focusId,
|
|
10
|
+
name: node.name,
|
|
11
|
+
task: node.task,
|
|
12
|
+
model: node.model,
|
|
13
|
+
outcome: node.outcome,
|
|
14
|
+
interrupted: node.interrupted,
|
|
15
|
+
startedAt: node.startedAt,
|
|
16
|
+
updatedAt: node.updatedAt,
|
|
17
|
+
endedAt: node.endedAt,
|
|
18
|
+
usage: node.usage ? { ...node.usage } : null,
|
|
19
|
+
collisionCount,
|
|
20
|
+
hasCollision: collisionCount > 0,
|
|
21
|
+
delegationOutcome: node.delegationOutcome,
|
|
22
|
+
delegationEvidence: node.delegationEvidence ? { ...node.delegationEvidence } : null,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function agentRosterRows(tree) {
|
|
26
|
+
if (!tree)
|
|
27
|
+
return [];
|
|
28
|
+
const rows = [];
|
|
29
|
+
const visit = (node, level) => {
|
|
30
|
+
rows.push(rowOf(node, level, tree.focusId));
|
|
31
|
+
for (const child of node.children)
|
|
32
|
+
visit(child, level + 1);
|
|
33
|
+
};
|
|
34
|
+
visit(tree.root, 0);
|
|
35
|
+
return rows;
|
|
36
|
+
}
|