talos-code 0.0.1 → 0.2.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/CHANGELOG.md +87 -0
- package/LICENSE +661 -0
- package/README.md +116 -3
- package/THIRD_PARTY_NOTICES.md +40 -0
- package/dist/archive/zip.js +73 -0
- package/dist/args.js +100 -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 +244 -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 +46 -0
- package/dist/i18n/en/common.js +9 -0
- package/dist/i18n/en/credentials.js +92 -0
- package/dist/i18n/en/errors.js +267 -0
- package/dist/i18n/en/firstrun.js +101 -0
- package/dist/i18n/en/providers.js +37 -0
- package/dist/i18n/en/screen.js +774 -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 +331 -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/openrouter-login.js +172 -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-archive.js +69 -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 +265 -0
- package/dist/runtime/talos-composition.js +1011 -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/agent-view.js +51 -0
- package/dist/tui/app.js +4098 -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 +560 -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 +38 -0
- package/dist/tui/components/terminal-shell.js +214 -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/descendant-approvals.js +104 -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 +148 -0
- package/dist/tui/line-diff.js +57 -0
- package/dist/tui/live-activity.js +56 -0
- package/dist/tui/metrics.js +123 -0
- package/dist/tui/onboarding.js +36 -0
- package/dist/tui/overlays/agent-tree.js +43 -0
- package/dist/tui/overlays/approval-dialog.js +642 -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 +77 -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 +171 -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 +289 -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 +791 -0
- package/dist/tui/session-export.js +54 -0
- package/dist/tui/setup-wizard.js +46 -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 +82 -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 +27 -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 +64 -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,77 @@
|
|
|
1
|
+
function row(kind, text, oldLine = null, newLine = null) { return { kind, text, oldLine, newLine }; }
|
|
2
|
+
function headerPaths(line) {
|
|
3
|
+
const body = line.slice('diff --git '.length);
|
|
4
|
+
const quoted = [...body.matchAll(/"((?:\\.|[^"])*)"|([^\s]+)/gu)].map(match => (match[1] ?? match[2] ?? '').replace(/\\(["\\])/gu, '$1'));
|
|
5
|
+
return { oldPath: quoted[0] ?? '', newPath: quoted[1] ?? '' };
|
|
6
|
+
}
|
|
7
|
+
function pathHeader(line) { return line.slice(4).split('\t')[0] ?? ''; }
|
|
8
|
+
export function parseUnifiedDiff(input) {
|
|
9
|
+
const source = String(input ?? '');
|
|
10
|
+
if (!source.trim() || source.trim() === '(no changes)')
|
|
11
|
+
return { files: [], plain: source.trim() === '(no changes)' ? [row('plain', '(no changes)')] : [], empty: true };
|
|
12
|
+
const lines = source.split(/\r?\n/u), files = [], plain = [];
|
|
13
|
+
let current = null;
|
|
14
|
+
let oldLine = null, newLine = null, inHunk = false;
|
|
15
|
+
const finish = () => { if (current) {
|
|
16
|
+
files.push(current);
|
|
17
|
+
current = null;
|
|
18
|
+
} oldLine = null; newLine = null; inHunk = false; };
|
|
19
|
+
for (const line of lines) {
|
|
20
|
+
if (line.startsWith('diff --git ')) {
|
|
21
|
+
finish();
|
|
22
|
+
const paths = headerPaths(line);
|
|
23
|
+
current = { ...paths, rows: [] };
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (!current) {
|
|
27
|
+
plain.push(row('plain', line));
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
if (line.startsWith('--- ')) {
|
|
31
|
+
current.oldPath = pathHeader(line);
|
|
32
|
+
current.rows.push(row('meta', line));
|
|
33
|
+
inHunk = false;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (line.startsWith('+++ ')) {
|
|
37
|
+
current.newPath = pathHeader(line);
|
|
38
|
+
current.rows.push(row('meta', line));
|
|
39
|
+
inHunk = false;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const hunk = /^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?:.*)$/u.exec(line);
|
|
43
|
+
if (hunk) {
|
|
44
|
+
oldLine = Number(hunk[1]);
|
|
45
|
+
newLine = Number(hunk[3]);
|
|
46
|
+
inHunk = true;
|
|
47
|
+
current.rows.push(row('hunk', line));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (inHunk && line.startsWith('\')) {
|
|
51
|
+
current.rows.push(row('no-newline', line));
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (inHunk && line.startsWith('+')) {
|
|
55
|
+
current.rows.push(row('add', line.slice(1), null, newLine));
|
|
56
|
+
newLine = (newLine ?? 0) + 1;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (inHunk && line.startsWith('-')) {
|
|
60
|
+
current.rows.push(row('remove', line.slice(1), oldLine, null));
|
|
61
|
+
oldLine = (oldLine ?? 0) + 1;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (inHunk && line.startsWith(' ')) {
|
|
65
|
+
current.rows.push(row('context', line.slice(1), oldLine, newLine));
|
|
66
|
+
oldLine = (oldLine ?? 0) + 1;
|
|
67
|
+
newLine = (newLine ?? 0) + 1;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
current.rows.push(row('meta', line));
|
|
71
|
+
inHunk = false;
|
|
72
|
+
oldLine = null;
|
|
73
|
+
newLine = null;
|
|
74
|
+
}
|
|
75
|
+
finish();
|
|
76
|
+
return { files, plain, empty: files.length === 0 && plain.every(item => item.text.trim() === '' || item.text.trim() === '(no changes)') };
|
|
77
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const EDITOR_HISTORY_LIMIT = 100;
|
|
2
|
+
export function createEditorHistory(limit = EDITOR_HISTORY_LIMIT) {
|
|
3
|
+
const bounded = Math.max(1, Math.trunc(limit));
|
|
4
|
+
return { past: [], future: [], limit: bounded };
|
|
5
|
+
}
|
|
6
|
+
function boundedTail(rows, limit) { return rows.length > limit ? rows.slice(rows.length - limit) : rows; }
|
|
7
|
+
export function pushEditorHistory(history, value) {
|
|
8
|
+
return { past: boundedTail([...history.past, value], history.limit), future: [], limit: history.limit };
|
|
9
|
+
}
|
|
10
|
+
export function undoEditorHistory(history, current) {
|
|
11
|
+
if (history.past.length === 0)
|
|
12
|
+
return null;
|
|
13
|
+
const value = history.past[history.past.length - 1];
|
|
14
|
+
return { value, history: { past: history.past.slice(0, -1), future: [current, ...history.future].slice(0, history.limit), limit: history.limit } };
|
|
15
|
+
}
|
|
16
|
+
export function redoEditorHistory(history, current) {
|
|
17
|
+
if (history.future.length === 0)
|
|
18
|
+
return null;
|
|
19
|
+
const value = history.future[0];
|
|
20
|
+
return { value, history: { past: boundedTail([...history.past, current], history.limit), future: history.future.slice(1), limit: history.limit } };
|
|
21
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { createEditorHistory, pushEditorHistory, redoEditorHistory, undoEditorHistory } from "./editor-history.js";
|
|
2
|
+
import { splitGraphemes } from "./text-width.js";
|
|
3
|
+
const clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
4
|
+
const clonePastes = (pastes) => pastes.map(paste => ({ ...paste }));
|
|
5
|
+
function clearPreferred(state) { const { preferredColumn: _, ...rest } = state; return rest; }
|
|
6
|
+
function clearSelection(state) { const { selectionAnchor: _, ...rest } = state; return rest; }
|
|
7
|
+
function clearTransient(state) { return clearSelection(clearPreferred(state)); }
|
|
8
|
+
function snapshot(state) { return { text: state.text, cursor: clamp(state.cursor, 0, state.text.length), collapsedPastes: clonePastes(state.collapsedPastes) }; }
|
|
9
|
+
function withCursor(state, cursor, extendSelection = false) {
|
|
10
|
+
const nextCursor = clamp(cursor, 0, state.text.length);
|
|
11
|
+
const base = clearPreferred(state);
|
|
12
|
+
if (!extendSelection)
|
|
13
|
+
return { ...clearSelection(base), cursor: nextCursor };
|
|
14
|
+
const anchor = state.selectionAnchor ?? clamp(state.cursor, 0, state.text.length);
|
|
15
|
+
if (anchor === nextCursor)
|
|
16
|
+
return { ...clearSelection(base), cursor: nextCursor };
|
|
17
|
+
return { ...base, cursor: nextCursor, selectionAnchor: anchor };
|
|
18
|
+
}
|
|
19
|
+
function restoreSnapshot(state, value, editHistory) {
|
|
20
|
+
return { ...clearTransient(state), text: value.text, cursor: clamp(value.cursor, 0, value.text.length), collapsedPastes: clonePastes(value.collapsedPastes), editHistory };
|
|
21
|
+
}
|
|
22
|
+
export function previousGraphemeBoundary(text, cursor) { let offset = 0, previous = 0; for (const g of splitGraphemes(text)) {
|
|
23
|
+
const next = offset + g.length;
|
|
24
|
+
if (next >= cursor)
|
|
25
|
+
return previous;
|
|
26
|
+
previous = next;
|
|
27
|
+
offset = next;
|
|
28
|
+
} return previous; }
|
|
29
|
+
export function nextGraphemeBoundary(text, cursor) { let offset = 0; for (const g of splitGraphemes(text)) {
|
|
30
|
+
offset += g.length;
|
|
31
|
+
if (offset > cursor)
|
|
32
|
+
return offset;
|
|
33
|
+
} return text.length; }
|
|
34
|
+
function graphemeBoundaryAtOrBefore(text, cursor) { const target = clamp(cursor, 0, text.length); let offset = 0; for (const g of splitGraphemes(text)) {
|
|
35
|
+
const next = offset + g.length;
|
|
36
|
+
if (next > target)
|
|
37
|
+
return offset;
|
|
38
|
+
if (next === target)
|
|
39
|
+
return next;
|
|
40
|
+
offset = next;
|
|
41
|
+
} return text.length; }
|
|
42
|
+
export function createEditorState(text = '') { return { text, cursor: text.length, killBuffer: '', collapsedPastes: [], editHistory: createEditorHistory() }; }
|
|
43
|
+
export function replaceEditorText(_state, text) { return createEditorState(text); }
|
|
44
|
+
export function draftOf(state) { return { text: state.text, collapsedPastes: clonePastes(state.collapsedPastes) }; }
|
|
45
|
+
export function draftText(draft) { return typeof draft === 'string' ? draft : draft.text; }
|
|
46
|
+
export function editorFromDraft(draft) {
|
|
47
|
+
const text = draftText(draft), state = createEditorState(text);
|
|
48
|
+
if (typeof draft === 'string')
|
|
49
|
+
return state;
|
|
50
|
+
const valid = draft.collapsedPastes.filter(paste => Number.isSafeInteger(paste.start) && Number.isSafeInteger(paste.end) && paste.start >= 0 && paste.end > paste.start && paste.end <= text.length);
|
|
51
|
+
const pastes = [...valid].sort((a, b) => a.start - b.start).filter((paste, index, sorted) => index === 0 || paste.start >= sorted[index - 1].end);
|
|
52
|
+
return { ...state, collapsedPastes: clonePastes(pastes) };
|
|
53
|
+
}
|
|
54
|
+
export function selectionRange(state) {
|
|
55
|
+
if (state.selectionAnchor === undefined)
|
|
56
|
+
return null;
|
|
57
|
+
const anchor = clamp(state.selectionAnchor, 0, state.text.length), cursor = clamp(state.cursor, 0, state.text.length);
|
|
58
|
+
if (anchor === cursor)
|
|
59
|
+
return null;
|
|
60
|
+
return { start: Math.min(anchor, cursor), end: Math.max(anchor, cursor) };
|
|
61
|
+
}
|
|
62
|
+
export function remapCollapsedPastes(pastes, editStart, removed, inserted) {
|
|
63
|
+
const editEnd = editStart + removed, delta = inserted - removed;
|
|
64
|
+
const out = [];
|
|
65
|
+
for (const p of pastes) {
|
|
66
|
+
if (editEnd <= p.start) {
|
|
67
|
+
out.push({ ...p, start: p.start + delta, end: p.end + delta });
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (editStart >= p.end) {
|
|
71
|
+
out.push({ ...p });
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
export function replaceRange(state, start, end, value) {
|
|
78
|
+
const from = clamp(start, 0, state.text.length), to = Math.max(from, clamp(end, 0, state.text.length));
|
|
79
|
+
if (from === to && value.length === 0)
|
|
80
|
+
return clearTransient(state);
|
|
81
|
+
const editHistory = pushEditorHistory(state.editHistory, snapshot(state));
|
|
82
|
+
return { ...clearTransient(state), text: state.text.slice(0, from) + value + state.text.slice(to), cursor: from + value.length, collapsedPastes: remapCollapsedPastes(state.collapsedPastes, from, to - from, value.length), editHistory };
|
|
83
|
+
}
|
|
84
|
+
export function editInsert(state, value) {
|
|
85
|
+
if (!value)
|
|
86
|
+
return clearPreferred(state);
|
|
87
|
+
const selected = selectionRange(state);
|
|
88
|
+
return selected ? replaceRange(state, selected.start, selected.end, value) : replaceRange(state, state.cursor, state.cursor, value);
|
|
89
|
+
}
|
|
90
|
+
export function moveCursor(state, to, extendSelection = false) {
|
|
91
|
+
const selected = selectionRange(state);
|
|
92
|
+
if (selected && !extendSelection && (to === 'left' || to === 'right'))
|
|
93
|
+
return withCursor(state, to === 'left' ? selected.start : selected.end, false);
|
|
94
|
+
const bounds = lineBounds(state.text, state.cursor);
|
|
95
|
+
const cursor = to === 'left' ? previousGraphemeBoundary(state.text, state.cursor) : to === 'right' ? nextGraphemeBoundary(state.text, state.cursor) : to === 'home' ? bounds.start : bounds.end;
|
|
96
|
+
return withCursor(state, cursor, extendSelection);
|
|
97
|
+
}
|
|
98
|
+
function isWord(ch) { return !!ch && /[\p{L}\p{N}_]/u.test(ch); }
|
|
99
|
+
export function moveWord(state, direction, extendSelection = false) { let c = clamp(state.cursor, 0, state.text.length); if (direction < 0) {
|
|
100
|
+
while (c > 0 && !isWord(state.text[previousGraphemeBoundary(state.text, c)]))
|
|
101
|
+
c = previousGraphemeBoundary(state.text, c);
|
|
102
|
+
while (c > 0 && isWord(state.text[previousGraphemeBoundary(state.text, c)]))
|
|
103
|
+
c = previousGraphemeBoundary(state.text, c);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
while (c < state.text.length && !isWord(state.text[c]))
|
|
107
|
+
c = nextGraphemeBoundary(state.text, c);
|
|
108
|
+
while (c < state.text.length && isWord(state.text[c]))
|
|
109
|
+
c = nextGraphemeBoundary(state.text, c);
|
|
110
|
+
} return withCursor(state, c, extendSelection); }
|
|
111
|
+
function lineBounds(text, cursor) { const c = clamp(cursor, 0, text.length); const start = text.lastIndexOf('\n', Math.max(0, c - 1)) + 1; const next = text.indexOf('\n', c); const end = next < 0 ? text.length : next; return { start, end }; }
|
|
112
|
+
export function moveVertical(state, direction, extendSelection = false) {
|
|
113
|
+
const c = clamp(state.cursor, 0, state.text.length);
|
|
114
|
+
const current = lineBounds(state.text, c);
|
|
115
|
+
const preferred = state.preferredColumn ?? (c - current.start);
|
|
116
|
+
if (direction < 0) {
|
|
117
|
+
if (current.start === 0)
|
|
118
|
+
return extendSelection ? state : withCursor(state, c, false);
|
|
119
|
+
const previousEnd = current.start - 1;
|
|
120
|
+
const previous = lineBounds(state.text, previousEnd);
|
|
121
|
+
const target = graphemeBoundaryAtOrBefore(state.text, previous.start + Math.min(preferred, previous.end - previous.start));
|
|
122
|
+
const moved = withCursor(state, target, extendSelection);
|
|
123
|
+
return { ...moved, preferredColumn: preferred };
|
|
124
|
+
}
|
|
125
|
+
if (current.end === state.text.length)
|
|
126
|
+
return extendSelection ? state : withCursor(state, c, false);
|
|
127
|
+
const nextStart = current.end + 1;
|
|
128
|
+
const next = lineBounds(state.text, nextStart);
|
|
129
|
+
const target = graphemeBoundaryAtOrBefore(state.text, next.start + Math.min(preferred, next.end - next.start));
|
|
130
|
+
const moved = withCursor(state, target, extendSelection);
|
|
131
|
+
return { ...moved, preferredColumn: preferred };
|
|
132
|
+
}
|
|
133
|
+
export function deleteBackward(state) { const selected = selectionRange(state); if (selected)
|
|
134
|
+
return replaceRange(state, selected.start, selected.end, ''); const c = clamp(state.cursor, 0, state.text.length); if (c === 0)
|
|
135
|
+
return clearPreferred(state); return replaceRange(state, previousGraphemeBoundary(state.text, c), c, ''); }
|
|
136
|
+
export function deleteForward(state) { const selected = selectionRange(state); if (selected)
|
|
137
|
+
return replaceRange(state, selected.start, selected.end, ''); const c = clamp(state.cursor, 0, state.text.length); if (c >= state.text.length)
|
|
138
|
+
return clearPreferred(state); return replaceRange(state, c, nextGraphemeBoundary(state.text, c), ''); }
|
|
139
|
+
export function copySelection(state) { const selected = selectionRange(state); return selected ? { ...state, killBuffer: state.text.slice(selected.start, selected.end) } : state; }
|
|
140
|
+
export function cutSelection(state) { const selected = selectionRange(state); if (!selected)
|
|
141
|
+
return state; const killed = state.text.slice(selected.start, selected.end); return { ...replaceRange(state, selected.start, selected.end, ''), killBuffer: killed }; }
|
|
142
|
+
export function killToStart(state) { if (selectionRange(state))
|
|
143
|
+
return cutSelection(state); const c = clamp(state.cursor, 0, state.text.length); const { start } = lineBounds(state.text, c); if (c === start)
|
|
144
|
+
return clearPreferred(state); const killed = state.text.slice(start, c); return { ...replaceRange(state, start, c, ''), killBuffer: killed }; }
|
|
145
|
+
export function killToEnd(state) { if (selectionRange(state))
|
|
146
|
+
return cutSelection(state); const c = clamp(state.cursor, 0, state.text.length); const { end } = lineBounds(state.text, c); if (c >= end)
|
|
147
|
+
return clearPreferred(state); const killed = state.text.slice(c, end); return { ...replaceRange(state, c, end, ''), killBuffer: killed }; }
|
|
148
|
+
export function killWordBackward(state) { if (selectionRange(state))
|
|
149
|
+
return cutSelection(state); const end = clamp(state.cursor, 0, state.text.length); const moved = moveWord(state, -1); if (moved.cursor === end)
|
|
150
|
+
return clearPreferred(state); const killed = state.text.slice(moved.cursor, end); return { ...replaceRange(state, moved.cursor, end, ''), killBuffer: killed }; }
|
|
151
|
+
export function yank(state) { return state.killBuffer ? editInsert(state, state.killBuffer) : clearPreferred(state); }
|
|
152
|
+
export function undoEditor(state) { const step = undoEditorHistory(state.editHistory, snapshot(state)); return step ? restoreSnapshot(state, step.value, step.history) : clearTransient(state); }
|
|
153
|
+
export function redoEditor(state) { const step = redoEditorHistory(state.editHistory, snapshot(state)); return step ? restoreSnapshot(state, step.value, step.history) : clearTransient(state); }
|
|
154
|
+
export function visibleEditorText(state) { const c = clamp(state.cursor, 0, state.text.length); const next = nextGraphemeBoundary(state.text, c); return { before: state.text.slice(0, c), cursor: state.text.slice(c, next) || ' ', after: state.text.slice(next), atEnd: c === state.text.length }; }
|
|
155
|
+
export function insertPaste(state, text) {
|
|
156
|
+
const selected = selectionRange(state);
|
|
157
|
+
const start = selected?.start ?? state.cursor;
|
|
158
|
+
const end = selected?.end ?? state.cursor;
|
|
159
|
+
const next = replaceRange(state, start, end, text);
|
|
160
|
+
const lines = text.split(/\r?\n/u).length;
|
|
161
|
+
return text.length >= 4096 || lines >= 20 ? { ...next, collapsedPastes: [...next.collapsedPastes, { start, end: start + text.length, chars: text.length, lines }] } : next;
|
|
162
|
+
}
|
|
163
|
+
export function composerSegments(state) {
|
|
164
|
+
const out = [];
|
|
165
|
+
const ranges = [...state.collapsedPastes].sort((a, b) => a.start - b.start);
|
|
166
|
+
const selected = selectionRange(state);
|
|
167
|
+
const pushText = (start, end) => {
|
|
168
|
+
if (end < start)
|
|
169
|
+
return;
|
|
170
|
+
if (selected) {
|
|
171
|
+
const selectedStart = Math.max(start, selected.start), selectedEnd = Math.min(end, selected.end);
|
|
172
|
+
if (selectedEnd <= selectedStart) {
|
|
173
|
+
if (end > start)
|
|
174
|
+
out.push({ kind: 'text', text: state.text.slice(start, end) });
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (selectedStart > start)
|
|
178
|
+
out.push({ kind: 'text', text: state.text.slice(start, selectedStart) });
|
|
179
|
+
out.push({ kind: 'text', text: state.text.slice(selectedStart, selectedEnd), selected: true });
|
|
180
|
+
if (selectedEnd < end)
|
|
181
|
+
out.push({ kind: 'text', text: state.text.slice(selectedEnd, end) });
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (state.cursor < start || state.cursor > end) {
|
|
185
|
+
if (end > start)
|
|
186
|
+
out.push({ kind: 'text', text: state.text.slice(start, end) });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (state.cursor > start)
|
|
190
|
+
out.push({ kind: 'text', text: state.text.slice(start, state.cursor) });
|
|
191
|
+
const next = Math.min(end, nextGraphemeBoundary(state.text, state.cursor));
|
|
192
|
+
out.push({ kind: 'cursor', text: state.text.slice(state.cursor, next) || ' ' });
|
|
193
|
+
if (next < end)
|
|
194
|
+
out.push({ kind: 'text', text: state.text.slice(next, end) });
|
|
195
|
+
};
|
|
196
|
+
let pos = 0;
|
|
197
|
+
for (const p of ranges) {
|
|
198
|
+
if (p.start < pos)
|
|
199
|
+
continue;
|
|
200
|
+
pushText(pos, p.start);
|
|
201
|
+
const pasteSelected = Boolean(selected && selected.end > p.start && selected.start < p.end);
|
|
202
|
+
if (!selected && state.cursor >= p.start && state.cursor < p.end)
|
|
203
|
+
pushText(p.start, p.end);
|
|
204
|
+
else
|
|
205
|
+
out.push({ kind: 'paste', text: '[paste: ' + p.lines + ' lines, ' + p.chars + ' chars]', ...(pasteSelected ? { selected: true } : {}) });
|
|
206
|
+
pos = p.end;
|
|
207
|
+
}
|
|
208
|
+
pushText(pos, state.text.length);
|
|
209
|
+
return out;
|
|
210
|
+
}
|