@lotagate/cli 0.1.24 → 0.1.26
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 +75 -7
- package/SECURITY.md +2 -0
- package/bin/lotagate.mjs +50 -8
- package/dist/application/agent/agent-constants.d.ts +6 -0
- package/dist/application/agent/agent-constants.js +1 -0
- package/dist/application/agent/agent-history.d.ts +3 -0
- package/dist/application/agent/agent-history.js +5 -0
- package/dist/application/agent/agent-input-context.d.ts +12 -0
- package/dist/application/agent/agent-input-context.js +5 -0
- package/dist/application/agent/agent-limit.d.ts +3 -0
- package/dist/application/agent/agent-limit.js +1 -0
- package/dist/application/agent/agent-run-tracker.d.ts +30 -0
- package/dist/application/agent/agent-run-tracker.js +1 -0
- package/dist/application/agent/agent-runtime-context.d.ts +22 -0
- package/dist/application/agent/agent-runtime-context.js +1 -0
- package/dist/application/agent/agent-session-store-registry.d.ts +16 -0
- package/dist/application/agent/agent-session-store-registry.js +1 -0
- package/dist/application/agent/agent-session-store.d.ts +23 -0
- package/dist/application/agent/agent-session-store.js +6 -0
- package/dist/application/agent/capability-profile.d.ts +17 -0
- package/dist/application/agent/capability-profile.js +0 -0
- package/dist/application/agent/cli-agent-execution-service.d.ts +120 -0
- package/dist/application/agent/cli-agent-execution-service.js +1 -0
- package/dist/application/agent/cli-agent-preparation-cache.d.ts +39 -0
- package/dist/application/agent/cli-agent-preparation-cache.js +1 -0
- package/dist/application/agent/cli-agent-run-request.d.ts +12 -0
- package/dist/application/agent/cli-agent-run-request.js +0 -0
- package/dist/application/agent/context-compaction-persistence.d.ts +8 -0
- package/dist/application/agent/context-compaction-persistence.js +1 -0
- package/dist/application/agent/context-compaction.d.ts +22 -0
- package/dist/application/agent/context-compaction.js +8 -0
- package/dist/application/agent/context-token-cache.d.ts +21 -0
- package/dist/application/agent/context-token-cache.js +4 -0
- package/dist/application/agent/context-usage-service.d.ts +52 -0
- package/dist/application/agent/context-usage-service.js +1 -0
- package/dist/application/agent/continuation-checkpoint.d.ts +15 -0
- package/dist/application/agent/continuation-checkpoint.js +2 -0
- package/dist/application/agent/interactive-agent-guidance.d.ts +5 -0
- package/dist/application/agent/interactive-agent-guidance.js +2 -0
- package/dist/application/agent/prompt-data-safety.d.ts +14 -0
- package/dist/application/agent/prompt-data-safety.js +4 -0
- package/dist/application/agent/scoped-tool-executor.d.ts +13 -0
- package/dist/application/agent/scoped-tool-executor.js +1 -0
- package/dist/application/agent/tool-catalog.d.ts +14 -0
- package/dist/application/agent/tool-catalog.js +1 -0
- package/dist/application/agent/tool-display.d.ts +7 -0
- package/dist/application/agent/tool-display.js +1 -0
- package/dist/application/agent/tool-hook-lifecycle.d.ts +19 -0
- package/dist/application/agent/tool-hook-lifecycle.js +1 -0
- package/dist/application/auth/authentication-service.d.ts +20 -0
- package/dist/application/auth/authentication-service.js +1 -0
- package/dist/application/chat/chat-service.d.ts +12 -0
- package/dist/application/chat/chat-service.js +1 -0
- package/dist/application/chat/pending-attachment-store.d.ts +15 -0
- package/dist/application/chat/pending-attachment-store.js +1 -0
- package/dist/application/commands/application-command-executor.d.ts +23 -0
- package/dist/application/commands/application-command-executor.js +3 -0
- package/dist/application/commands/cli-args.d.ts +6 -0
- package/dist/application/commands/cli-args.js +1 -0
- package/dist/application/commands/cli-command-services.d.ts +17 -0
- package/dist/application/commands/cli-command-services.js +33 -0
- package/dist/application/commands/command-cancellation.d.ts +6 -0
- package/dist/application/commands/command-cancellation.js +1 -0
- package/dist/application/commands/command-catalog.d.ts +6 -0
- package/dist/application/commands/command-catalog.js +1 -0
- package/dist/application/commands/command-contract.d.ts +60 -0
- package/dist/application/commands/command-contract.js +0 -0
- package/dist/application/commands/command-hints.d.ts +9 -0
- package/dist/application/commands/command-hints.js +1 -0
- package/dist/application/commands/command-output.d.ts +4 -0
- package/dist/application/commands/command-output.js +0 -0
- package/dist/application/commands/command-parser.d.ts +10 -0
- package/dist/application/commands/command-parser.js +1 -0
- package/dist/application/commands/command-presentation.d.ts +7 -0
- package/dist/application/commands/command-presentation.js +3 -0
- package/dist/application/commands/command-registry.d.ts +11 -0
- package/dist/application/commands/command-registry.js +1 -0
- package/dist/application/commands/command-runtime.d.ts +2 -0
- package/dist/application/commands/command-runtime.js +1 -0
- package/dist/application/commands/goal-command-handlers.d.ts +3 -0
- package/dist/application/commands/goal-command-handlers.js +7 -0
- package/dist/application/commands/media-command-handlers.d.ts +9 -0
- package/dist/application/commands/media-command-handlers.js +9 -0
- package/dist/application/commands/media-command-output.d.ts +11 -0
- package/dist/application/commands/media-command-output.js +1 -0
- package/dist/application/commands/memory-command-handler.d.ts +29 -0
- package/dist/application/commands/memory-command-handler.js +12 -0
- package/dist/application/commands/runtime-command-handlers.d.ts +7 -0
- package/dist/application/commands/runtime-command-handlers.js +14 -0
- package/dist/application/commands/stream-output.d.ts +4 -0
- package/dist/application/commands/stream-output.js +1 -0
- package/dist/application/commands/utility-commands.d.ts +6 -0
- package/dist/application/commands/utility-commands.js +10 -0
- package/dist/application/config/execution-config.d.ts +4 -0
- package/dist/application/config/execution-config.js +1 -0
- package/dist/application/extensions/extension-list-contract.d.ts +18 -0
- package/dist/application/extensions/extension-list-contract.js +0 -0
- package/dist/application/extensions/extension-list-formatters.d.ts +38 -0
- package/dist/application/extensions/extension-list-formatters.js +1 -0
- package/dist/application/extensions/extension-list-output.d.ts +3 -0
- package/dist/application/extensions/extension-list-output.js +3 -0
- package/dist/application/extensions/plugin-contribution-registry.d.ts +31 -0
- package/dist/application/extensions/plugin-contribution-registry.js +1 -0
- package/dist/application/extensions/plugin-detail-contract.d.ts +25 -0
- package/dist/application/extensions/plugin-detail-contract.js +0 -0
- package/dist/application/extensions/plugin-detail-service.d.ts +3 -0
- package/dist/application/extensions/plugin-detail-service.js +1 -0
- package/dist/application/extensions/skill-scope-store.d.ts +23 -0
- package/dist/application/extensions/skill-scope-store.js +1 -0
- package/dist/application/formatting/compact-number.d.ts +2 -0
- package/dist/application/formatting/compact-number.js +1 -0
- package/dist/application/formatting/compact-table.d.ts +22 -0
- package/dist/application/formatting/compact-table.js +2 -0
- package/dist/application/intent/completion-gate.d.ts +3 -0
- package/dist/application/intent/completion-gate.js +1 -0
- package/dist/application/intent/evidence-ledger.d.ts +22 -0
- package/dist/application/intent/evidence-ledger.js +1 -0
- package/dist/application/intent/evidence-recording-tool-executor.d.ts +16 -0
- package/dist/application/intent/evidence-recording-tool-executor.js +1 -0
- package/dist/application/intent/intent-compiler.d.ts +11 -0
- package/dist/application/intent/intent-compiler.js +2 -0
- package/dist/application/intent/intent-execution-gate.d.ts +11 -0
- package/dist/application/intent/intent-execution-gate.js +1 -0
- package/dist/application/intent/intent-host-context.d.ts +6 -0
- package/dist/application/intent/intent-host-context.js +1 -0
- package/dist/application/intent/intent-run-controller.d.ts +56 -0
- package/dist/application/intent/intent-run-controller.js +3 -0
- package/dist/application/intent/project-policy.d.ts +16 -0
- package/dist/application/intent/project-policy.js +1 -0
- package/dist/application/media/video-operation-poller.d.ts +5 -0
- package/dist/application/media/video-operation-poller.js +1 -0
- package/dist/application/memory/memory-capture-policy.d.ts +10 -0
- package/dist/application/memory/memory-capture-policy.js +1 -0
- package/dist/application/memory/memory-consolidation-service.d.ts +12 -0
- package/dist/application/memory/memory-consolidation-service.js +1 -0
- package/dist/application/memory/memory-context-assembler.d.ts +24 -0
- package/dist/application/memory/memory-context-assembler.js +1 -0
- package/dist/application/memory/memory-extractor.d.ts +21 -0
- package/dist/application/memory/memory-extractor.js +2 -0
- package/dist/application/memory/memory-service.d.ts +34 -0
- package/dist/application/memory/memory-service.js +1 -0
- package/dist/application/model/cached-model-catalog.d.ts +19 -0
- package/dist/application/model/cached-model-catalog.js +1 -0
- package/dist/application/model/initial-model-selection.d.ts +10 -0
- package/dist/application/model/initial-model-selection.js +1 -0
- package/dist/application/model/model-catalog-service.d.ts +6 -0
- package/dist/application/model/model-catalog-service.js +1 -0
- package/dist/application/model/model-context-window.d.ts +3 -0
- package/dist/application/model/model-context-window.js +1 -0
- package/dist/application/model/model-response-retry.d.ts +15 -0
- package/dist/application/model/model-response-retry.js +1 -0
- package/dist/application/orchestration/abortable-wait.d.ts +2 -0
- package/dist/application/orchestration/abortable-wait.js +1 -0
- package/dist/application/orchestration/cli-subagent-service.d.ts +77 -0
- package/dist/application/orchestration/cli-subagent-service.js +13 -0
- package/dist/application/orchestration/cli-turn-event-projector.d.ts +15 -0
- package/dist/application/orchestration/cli-turn-event-projector.js +1 -0
- package/dist/application/orchestration/cli-turn-events.d.ts +76 -0
- package/dist/application/orchestration/cli-turn-events.js +1 -0
- package/dist/application/orchestration/cli-turn-persistence.d.ts +6 -0
- package/dist/application/orchestration/cli-turn-persistence.js +1 -0
- package/dist/application/orchestration/goal-evaluator.d.ts +18 -0
- package/dist/application/orchestration/goal-evaluator.js +3 -0
- package/dist/application/orchestration/goal-input.d.ts +3 -0
- package/dist/application/orchestration/goal-input.js +1 -0
- package/dist/application/orchestration/goal-output.d.ts +2 -0
- package/dist/application/orchestration/goal-output.js +2 -0
- package/dist/application/orchestration/goal-runner.d.ts +22 -0
- package/dist/application/orchestration/goal-runner.js +10 -0
- package/dist/application/orchestration/goal-usage.d.ts +9 -0
- package/dist/application/orchestration/goal-usage.js +1 -0
- package/dist/application/orchestration/headless-agent-turn.d.ts +36 -0
- package/dist/application/orchestration/headless-agent-turn.js +4 -0
- package/dist/application/orchestration/orchestration-constants.d.ts +3 -0
- package/dist/application/orchestration/orchestration-constants.js +1 -0
- package/dist/application/orchestration/subagent-coordinator.d.ts +41 -0
- package/dist/application/orchestration/subagent-coordinator.js +1 -0
- package/dist/application/orchestration/subagent-handoff.d.ts +3 -0
- package/dist/application/orchestration/subagent-handoff.js +3 -0
- package/dist/application/orchestration/subagent-tool-executor.d.ts +12 -0
- package/dist/application/orchestration/subagent-tool-executor.js +1 -0
- package/dist/application/orchestration/task-graph.d.ts +13 -0
- package/dist/application/orchestration/task-graph.js +1 -0
- package/dist/application/orchestration/task-scheduler.d.ts +18 -0
- package/dist/application/orchestration/task-scheduler.js +1 -0
- package/dist/application/project/project-trust-service.d.ts +13 -0
- package/dist/application/project/project-trust-service.js +1 -0
- package/dist/application/project-intelligence/project-intelligence-constants.d.ts +56 -0
- package/dist/application/project-intelligence/project-intelligence-constants.js +1 -0
- package/dist/application/project-intelligence/project-intelligence-service.d.ts +14 -0
- package/dist/application/project-intelligence/project-intelligence-service.js +1 -0
- package/dist/application/protocol/browser-host-tool-executor.d.ts +51 -0
- package/dist/application/protocol/browser-host-tool-executor.js +2 -0
- package/dist/application/protocol/computer-host-tool-executor.d.ts +45 -0
- package/dist/application/protocol/computer-host-tool-executor.js +2 -0
- package/dist/application/protocol/desktop-agent-command.d.ts +9 -0
- package/dist/application/protocol/desktop-agent-command.js +3 -0
- package/dist/application/protocol/desktop-agent-contracts.d.ts +34 -0
- package/dist/application/protocol/desktop-agent-contracts.js +1 -0
- package/dist/application/protocol/desktop-agent-helpers.d.ts +5 -0
- package/dist/application/protocol/desktop-agent-helpers.js +1 -0
- package/dist/application/protocol/desktop-agent-request-parser.d.ts +211 -0
- package/dist/application/protocol/desktop-agent-request-parser.js +1 -0
- package/dist/application/protocol/desktop-approval-broker.d.ts +26 -0
- package/dist/application/protocol/desktop-approval-broker.js +1 -0
- package/dist/application/protocol/desktop-attachment-store.d.ts +33 -0
- package/dist/application/protocol/desktop-attachment-store.js +1 -0
- package/dist/application/protocol/desktop-command-catalog.d.ts +2 -0
- package/dist/application/protocol/desktop-command-catalog.js +1 -0
- package/dist/application/protocol/desktop-command-contract.d.ts +26 -0
- package/dist/application/protocol/desktop-command-contract.js +1 -0
- package/dist/application/protocol/desktop-command-executor.d.ts +17 -0
- package/dist/application/protocol/desktop-command-executor.js +1 -0
- package/dist/application/protocol/desktop-command-output.d.ts +15 -0
- package/dist/application/protocol/desktop-command-output.js +1 -0
- package/dist/application/protocol/desktop-execution-policy.d.ts +19 -0
- package/dist/application/protocol/desktop-execution-policy.js +1 -0
- package/dist/application/protocol/desktop-extension-request-handler.d.ts +14 -0
- package/dist/application/protocol/desktop-extension-request-handler.js +1 -0
- package/dist/application/protocol/desktop-extension-service.d.ts +44 -0
- package/dist/application/protocol/desktop-extension-service.js +3 -0
- package/dist/application/protocol/desktop-host-bridge.d.ts +33 -0
- package/dist/application/protocol/desktop-host-bridge.js +1 -0
- package/dist/application/protocol/desktop-host-capabilities.d.ts +12 -0
- package/dist/application/protocol/desktop-host-capabilities.js +1 -0
- package/dist/application/protocol/desktop-host-tool-executor.d.ts +76 -0
- package/dist/application/protocol/desktop-host-tool-executor.js +2 -0
- package/dist/application/protocol/desktop-intent-event-writer.d.ts +20 -0
- package/dist/application/protocol/desktop-intent-event-writer.js +1 -0
- package/dist/application/protocol/desktop-mcp-events.d.ts +10 -0
- package/dist/application/protocol/desktop-mcp-events.js +1 -0
- package/dist/application/protocol/desktop-orchestration-events.d.ts +2 -0
- package/dist/application/protocol/desktop-orchestration-events.js +2 -0
- package/dist/application/protocol/desktop-protocol-helpers.d.ts +13 -0
- package/dist/application/protocol/desktop-protocol-helpers.js +1 -0
- package/dist/application/protocol/json-line-writer.d.ts +31 -0
- package/dist/application/protocol/json-line-writer.js +2 -0
- package/dist/application/protocol/jsonl-agent-command.d.ts +3 -0
- package/dist/application/protocol/jsonl-agent-command.js +3 -0
- package/dist/application/protocol/jsonl-protocol.d.ts +82 -0
- package/dist/application/protocol/jsonl-protocol.js +2 -0
- package/dist/application/protocol/tool-image-content.d.ts +4 -0
- package/dist/application/protocol/tool-image-content.js +1 -0
- package/dist/application/security/delegated-worker-policy.d.ts +3 -0
- package/dist/application/security/delegated-worker-policy.js +1 -0
- package/dist/application/security/desktop-tool-scope-policy.d.ts +4 -0
- package/dist/application/security/desktop-tool-scope-policy.js +1 -0
- package/dist/application/security/tool-action-risk-analyzer.d.ts +13 -0
- package/dist/application/security/tool-action-risk-analyzer.js +1 -0
- package/dist/application/security/tool-approval-service.d.ts +43 -0
- package/dist/application/security/tool-approval-service.js +1 -0
- package/dist/application/security/tool-policy-registry.d.ts +20 -0
- package/dist/application/security/tool-policy-registry.js +1 -0
- package/dist/application/security/tool-risk-classifier.d.ts +19 -0
- package/dist/application/security/tool-risk-classifier.js +1 -0
- package/dist/application/security/workspace-permission-policy.d.ts +10 -0
- package/dist/application/security/workspace-permission-policy.js +1 -0
- package/dist/application/session/project-session-access.d.ts +8 -0
- package/dist/application/session/project-session-access.js +1 -0
- package/dist/application/session/session-compaction-service.d.ts +10 -0
- package/dist/application/session/session-compaction-service.js +1 -0
- package/dist/application/session/session-turn-lifecycle.d.ts +5 -0
- package/dist/application/session/session-turn-lifecycle.js +1 -0
- package/dist/application/workspace/session-execution-workspace.d.ts +59 -0
- package/dist/application/workspace/session-execution-workspace.js +3 -0
- package/dist/application/workspace/workspace-constants.d.ts +17 -0
- package/dist/application/workspace/workspace-constants.js +1 -0
- package/dist/application/workspace/workspace-file-index.d.ts +14 -0
- package/dist/application/workspace/workspace-file-index.js +1 -0
- package/dist/application/workspace/workspace-file-reference-resolver.d.ts +20 -0
- package/dist/application/workspace/workspace-file-reference-resolver.js +17 -0
- package/dist/application/workspace/workspace-instruction-loader.d.ts +8 -0
- package/dist/application/workspace/workspace-instruction-loader.js +1 -0
- package/dist/bootstrap/composition-root.d.ts +7 -0
- package/dist/bootstrap/composition-root.js +1 -0
- package/dist/bootstrap/global-cli-options.d.ts +6 -0
- package/dist/bootstrap/global-cli-options.js +1 -0
- package/dist/bootstrap/native-devtools-stub.d.ts +10 -0
- package/dist/bootstrap/native-devtools-stub.js +1 -0
- package/dist/bootstrap/native-entry.d.ts +1 -0
- package/dist/bootstrap/native-entry.js +2 -0
- package/dist/bootstrap/native-tiktoken.d.ts +4 -0
- package/dist/bootstrap/native-tiktoken.js +1 -0
- package/dist/bootstrap/runtime-factory.d.ts +46 -0
- package/dist/bootstrap/runtime-factory.js +1 -0
- package/dist/bootstrap/shutdown-manager.d.ts +11 -0
- package/dist/bootstrap/shutdown-manager.js +1 -0
- package/dist/bootstrap/startup-sequence.d.ts +5 -0
- package/dist/bootstrap/startup-sequence.js +1 -0
- package/dist/domain/auth/auth-profile.d.ts +14 -0
- package/dist/domain/auth/auth-profile.js +1 -0
- package/dist/domain/config/config-schema.d.ts +24 -0
- package/dist/domain/config/config-schema.js +1 -0
- package/dist/domain/errors/cli-command-hint.d.ts +5 -0
- package/dist/domain/errors/cli-command-hint.js +0 -0
- package/dist/domain/errors/cli-error.d.ts +35 -0
- package/dist/domain/errors/cli-error.js +1 -0
- package/dist/domain/errors/error-codes.d.ts +51 -0
- package/dist/domain/errors/error-codes.js +1 -0
- package/dist/domain/extensions/extension-constants.d.ts +1 -0
- package/dist/domain/extensions/extension-constants.js +1 -0
- package/dist/domain/extensions/extension-scope.d.ts +3 -0
- package/dist/domain/extensions/extension-scope.js +1 -0
- package/dist/domain/extensions/extension-state.d.ts +5 -0
- package/dist/domain/extensions/extension-state.js +1 -0
- package/dist/domain/extensions/hook-manifest.d.ts +13 -0
- package/dist/domain/extensions/hook-manifest.js +1 -0
- package/dist/domain/extensions/host-tool-plugin-ids.d.ts +5 -0
- package/dist/domain/extensions/host-tool-plugin-ids.js +1 -0
- package/dist/domain/extensions/mcp-config.d.ts +35 -0
- package/dist/domain/extensions/mcp-config.js +1 -0
- package/dist/domain/extensions/plugin-agent-manifest.d.ts +8 -0
- package/dist/domain/extensions/plugin-agent-manifest.js +1 -0
- package/dist/domain/extensions/plugin-manifest.d.ts +23 -0
- package/dist/domain/extensions/plugin-manifest.js +1 -0
- package/dist/domain/extensions/skill-manifest.d.ts +10 -0
- package/dist/domain/extensions/skill-manifest.js +3 -0
- package/dist/domain/extensions/yaml-subset.d.ts +9 -0
- package/dist/domain/extensions/yaml-subset.js +2 -0
- package/dist/domain/filesystem/file-change-diff.d.ts +21 -0
- package/dist/domain/filesystem/file-change-diff.js +3 -0
- package/dist/domain/intent/intent-contract.d.ts +33 -0
- package/dist/domain/intent/intent-contract.js +1 -0
- package/dist/domain/media/gateway-media-contract.d.ts +23 -0
- package/dist/domain/media/gateway-media-contract.js +1 -0
- package/dist/domain/media/media-constants.d.ts +3 -0
- package/dist/domain/media/media-constants.js +1 -0
- package/dist/domain/media/media-contract.d.ts +28 -0
- package/dist/domain/media/media-contract.js +0 -0
- package/dist/domain/media/media-execution-policy.d.ts +9 -0
- package/dist/domain/media/media-execution-policy.js +1 -0
- package/dist/domain/memory/memory-constants.d.ts +3 -0
- package/dist/domain/memory/memory-constants.js +1 -0
- package/dist/domain/memory/memory-kinds.d.ts +15 -0
- package/dist/domain/memory/memory-kinds.js +1 -0
- package/dist/domain/memory/memory-retrieval-policy.d.ts +3 -0
- package/dist/domain/memory/memory-retrieval-policy.js +1 -0
- package/dist/domain/memory/memory-search.d.ts +33 -0
- package/dist/domain/memory/memory-search.js +2 -0
- package/dist/domain/memory/memory.d.ts +48 -0
- package/dist/domain/memory/memory.js +1 -0
- package/dist/domain/orchestration/goal.d.ts +57 -0
- package/dist/domain/orchestration/goal.js +1 -0
- package/dist/domain/orchestration/subagent-identity.d.ts +2 -0
- package/dist/domain/orchestration/subagent-identity.js +1 -0
- package/dist/domain/orchestration/subagent.d.ts +33 -0
- package/dist/domain/orchestration/subagent.js +0 -0
- package/dist/domain/orchestration/work-plan.d.ts +15 -0
- package/dist/domain/orchestration/work-plan.js +0 -0
- package/dist/domain/project/project-identity.d.ts +6 -0
- package/dist/domain/project/project-identity.js +1 -0
- package/dist/domain/runtime/assistant-delta-normalizer.d.ts +11 -0
- package/dist/domain/runtime/assistant-delta-normalizer.js +1 -0
- package/dist/domain/runtime/assistant-stream-text.d.ts +11 -0
- package/dist/domain/runtime/assistant-stream-text.js +1 -0
- package/dist/domain/runtime/gateway-request-budget.d.ts +19 -0
- package/dist/domain/runtime/gateway-request-budget.js +1 -0
- package/dist/domain/runtime/resource-limits.d.ts +92 -0
- package/dist/domain/runtime/resource-limits.js +1 -0
- package/dist/domain/session/attachment.d.ts +15 -0
- package/dist/domain/session/attachment.js +0 -0
- package/dist/domain/session/session-schema.d.ts +6 -0
- package/dist/domain/session/session-schema.js +1 -0
- package/dist/domain/session/session.d.ts +27 -0
- package/dist/domain/session/session.js +0 -0
- package/dist/domain/settings/settings-document.d.ts +8 -0
- package/dist/domain/settings/settings-document.js +1 -0
- package/dist/domain/validation/record-schema.d.ts +4 -0
- package/dist/domain/validation/record-schema.js +1 -0
- package/dist/domain/workspace/workspace-settings.d.ts +14 -0
- package/dist/domain/workspace/workspace-settings.js +1 -0
- package/dist/infrastructure/agent-sdk/agent-instance-factory.d.ts +22 -0
- package/dist/infrastructure/agent-sdk/agent-instance-factory.js +1 -0
- package/dist/infrastructure/agent-sdk/model-response-metrics.d.ts +7 -0
- package/dist/infrastructure/agent-sdk/model-response-metrics.js +1 -0
- package/dist/infrastructure/agent-sdk/model-tool-name-mapper.d.ts +13 -0
- package/dist/infrastructure/agent-sdk/model-tool-name-mapper.js +1 -0
- package/dist/infrastructure/agent-sdk/sdk-constants.d.ts +2 -0
- package/dist/infrastructure/agent-sdk/sdk-constants.js +1 -0
- package/dist/infrastructure/agent-sdk/tool-calling-completion-client.d.ts +4 -0
- package/dist/infrastructure/agent-sdk/tool-calling-completion-client.js +1 -0
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.d.ts +11 -0
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.js +1 -0
- package/dist/infrastructure/cache/cache-policy.d.ts +9 -0
- package/dist/infrastructure/cache/cache-policy.js +1 -0
- package/dist/infrastructure/cache/file-cache-store.d.ts +25 -0
- package/dist/infrastructure/cache/file-cache-store.js +2 -0
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.d.ts +11 -0
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.js +1 -0
- package/dist/infrastructure/clipboard/clipboard-constants.d.ts +1 -0
- package/dist/infrastructure/clipboard/clipboard-constants.js +1 -0
- package/dist/infrastructure/clipboard/clipboard-policy.d.ts +8 -0
- package/dist/infrastructure/clipboard/clipboard-policy.js +1 -0
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.d.ts +10 -0
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.js +1 -0
- package/dist/infrastructure/clipboard/image-normalizer.d.ts +12 -0
- package/dist/infrastructure/clipboard/image-normalizer.js +1 -0
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.d.ts +7 -0
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.js +1 -0
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.d.ts +7 -0
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.js +1 -0
- package/dist/infrastructure/config/config-loader.d.ts +19 -0
- package/dist/infrastructure/config/config-loader.js +2 -0
- package/dist/infrastructure/config/environment-values.d.ts +2 -0
- package/dist/infrastructure/config/environment-values.js +1 -0
- package/dist/infrastructure/credentials/composite-credential-store.d.ts +11 -0
- package/dist/infrastructure/credentials/composite-credential-store.js +1 -0
- package/dist/infrastructure/credentials/encrypted-file-credential-store.d.ts +17 -0
- package/dist/infrastructure/credentials/encrypted-file-credential-store.js +3 -0
- package/dist/infrastructure/credentials/environment-credential-store.d.ts +11 -0
- package/dist/infrastructure/credentials/environment-credential-store.js +1 -0
- package/dist/infrastructure/credentials/secret-input.d.ts +7 -0
- package/dist/infrastructure/credentials/secret-input.js +3 -0
- package/dist/infrastructure/extensions/composite-mcp-config-store.d.ts +9 -0
- package/dist/infrastructure/extensions/composite-mcp-config-store.js +1 -0
- package/dist/infrastructure/extensions/extension-directory-reader.d.ts +2 -0
- package/dist/infrastructure/extensions/extension-directory-reader.js +1 -0
- package/dist/infrastructure/extensions/extension-integrity.d.ts +7 -0
- package/dist/infrastructure/extensions/extension-integrity.js +1 -0
- package/dist/infrastructure/extensions/extension-source-resolver.d.ts +6 -0
- package/dist/infrastructure/extensions/extension-source-resolver.js +1 -0
- package/dist/infrastructure/extensions/extensions-constants.d.ts +6 -0
- package/dist/infrastructure/extensions/extensions-constants.js +1 -0
- package/dist/infrastructure/extensions/file-mcp-config-store.d.ts +15 -0
- package/dist/infrastructure/extensions/file-mcp-config-store.js +2 -0
- package/dist/infrastructure/extensions/hook-runtime.d.ts +18 -0
- package/dist/infrastructure/extensions/hook-runtime.js +1 -0
- package/dist/infrastructure/extensions/mcp-runtime.d.ts +58 -0
- package/dist/infrastructure/extensions/mcp-runtime.js +1 -0
- package/dist/infrastructure/extensions/plugin-agent-discovery.d.ts +4 -0
- package/dist/infrastructure/extensions/plugin-agent-discovery.js +1 -0
- package/dist/infrastructure/extensions/plugin-discovery.d.ts +5 -0
- package/dist/infrastructure/extensions/plugin-discovery.js +1 -0
- package/dist/infrastructure/extensions/plugin-manager.d.ts +23 -0
- package/dist/infrastructure/extensions/plugin-manager.js +2 -0
- package/dist/infrastructure/extensions/skill-discovery.d.ts +4 -0
- package/dist/infrastructure/extensions/skill-discovery.js +1 -0
- package/dist/infrastructure/extensions/skill-installer.d.ts +9 -0
- package/dist/infrastructure/extensions/skill-installer.js +1 -0
- package/dist/infrastructure/extensions/skill-manager.d.ts +22 -0
- package/dist/infrastructure/extensions/skill-manager.js +2 -0
- package/dist/infrastructure/extensions/skill-roots.d.ts +19 -0
- package/dist/infrastructure/extensions/skill-roots.js +1 -0
- package/dist/infrastructure/extensions/skill-tool-executor.d.ts +20 -0
- package/dist/infrastructure/extensions/skill-tool-executor.js +2 -0
- package/dist/infrastructure/filesystem/atomic-file-store.d.ts +28 -0
- package/dist/infrastructure/filesystem/atomic-file-store.js +1 -0
- package/dist/infrastructure/filesystem/bounded-file-reader.d.ts +6 -0
- package/dist/infrastructure/filesystem/bounded-file-reader.js +1 -0
- package/dist/infrastructure/filesystem/bounded-json-reader.d.ts +1 -0
- package/dist/infrastructure/filesystem/bounded-json-reader.js +1 -0
- package/dist/infrastructure/filesystem/filesystem-constants.d.ts +8 -0
- package/dist/infrastructure/filesystem/filesystem-constants.js +1 -0
- package/dist/infrastructure/filesystem/fs-errors.d.ts +2 -0
- package/dist/infrastructure/filesystem/fs-errors.js +1 -0
- package/dist/infrastructure/filesystem/gateway-media-input-reader.d.ts +12 -0
- package/dist/infrastructure/filesystem/gateway-media-input-reader.js +1 -0
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.d.ts +25 -0
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.js +3 -0
- package/dist/infrastructure/filesystem/path-resolver.d.ts +20 -0
- package/dist/infrastructure/filesystem/path-resolver.js +1 -0
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.d.ts +13 -0
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.js +1 -0
- package/dist/infrastructure/logging/daily-rotating-file-writer.d.ts +26 -0
- package/dist/infrastructure/logging/daily-rotating-file-writer.js +2 -0
- package/dist/infrastructure/logging/log-redactor.d.ts +2 -0
- package/dist/infrastructure/logging/log-redactor.js +1 -0
- package/dist/infrastructure/logging/logging-constants.d.ts +3 -0
- package/dist/infrastructure/logging/logging-constants.js +1 -0
- package/dist/infrastructure/logging/logging-policy.d.ts +6 -0
- package/dist/infrastructure/logging/logging-policy.js +1 -0
- package/dist/infrastructure/logging/structured-logger.d.ts +24 -0
- package/dist/infrastructure/logging/structured-logger.js +4 -0
- package/dist/infrastructure/memory/file-memory-store.d.ts +37 -0
- package/dist/infrastructure/memory/file-memory-store.js +11 -0
- package/dist/infrastructure/network/safe-media-downloader.d.ts +23 -0
- package/dist/infrastructure/network/safe-media-downloader.js +1 -0
- package/dist/infrastructure/observability/tool-execution-logger.d.ts +11 -0
- package/dist/infrastructure/observability/tool-execution-logger.js +1 -0
- package/dist/infrastructure/platform/host-platform.d.ts +16 -0
- package/dist/infrastructure/platform/host-platform.js +1 -0
- package/dist/infrastructure/platform/host-process.d.ts +31 -0
- package/dist/infrastructure/platform/host-process.js +1 -0
- package/dist/infrastructure/platform/platform-constants.d.ts +4 -0
- package/dist/infrastructure/platform/platform-constants.js +1 -0
- package/dist/infrastructure/platform/platform-paths.d.ts +25 -0
- package/dist/infrastructure/platform/platform-paths.js +1 -0
- package/dist/infrastructure/platform/process-identity.d.ts +8 -0
- package/dist/infrastructure/platform/process-identity.js +1 -0
- package/dist/infrastructure/platform/process-termination.d.ts +4 -0
- package/dist/infrastructure/platform/process-termination.js +1 -0
- package/dist/infrastructure/platform/read-only-executable.d.ts +4 -0
- package/dist/infrastructure/platform/read-only-executable.js +1 -0
- package/dist/infrastructure/project/file-project-trust-store.d.ts +12 -0
- package/dist/infrastructure/project/file-project-trust-store.js +2 -0
- package/dist/infrastructure/sdk/chat-completion-adapter.d.ts +8 -0
- package/dist/infrastructure/sdk/chat-completion-adapter.js +1 -0
- package/dist/infrastructure/sdk/lotagate-client-factory.d.ts +3 -0
- package/dist/infrastructure/sdk/lotagate-client-factory.js +1 -0
- package/dist/infrastructure/sdk/model-catalog-adapter.d.ts +19 -0
- package/dist/infrastructure/sdk/model-catalog-adapter.js +1 -0
- package/dist/infrastructure/sdk/sdk-media-gateway-client.d.ts +24 -0
- package/dist/infrastructure/sdk/sdk-media-gateway-client.js +1 -0
- package/dist/infrastructure/sessions/file-goal-store.d.ts +21 -0
- package/dist/infrastructure/sessions/file-goal-store.js +1 -0
- package/dist/infrastructure/sessions/file-session-store.d.ts +50 -0
- package/dist/infrastructure/sessions/file-session-store.js +4 -0
- package/dist/infrastructure/sessions/project-session-paths.d.ts +17 -0
- package/dist/infrastructure/sessions/project-session-paths.js +1 -0
- package/dist/infrastructure/sessions/session-constants.d.ts +3 -0
- package/dist/infrastructure/sessions/session-constants.js +1 -0
- package/dist/infrastructure/sessions/session-index.d.ts +16 -0
- package/dist/infrastructure/sessions/session-index.js +3 -0
- package/dist/infrastructure/sessions/session-journal-health.d.ts +7 -0
- package/dist/infrastructure/sessions/session-journal-health.js +1 -0
- package/dist/infrastructure/sessions/session-journal.d.ts +22 -0
- package/dist/infrastructure/sessions/session-journal.js +6 -0
- package/dist/infrastructure/sessions/subagent-journal-store.d.ts +28 -0
- package/dist/infrastructure/sessions/subagent-journal-store.js +2 -0
- package/dist/infrastructure/shell/shell-tool-executor.d.ts +21 -0
- package/dist/infrastructure/shell/shell-tool-executor.js +2 -0
- package/dist/infrastructure/tokens/tiktoken-token-estimator.d.ts +18 -0
- package/dist/infrastructure/tokens/tiktoken-token-estimator.js +1 -0
- package/dist/infrastructure/tokens/token-constants.d.ts +1 -0
- package/dist/infrastructure/tokens/token-constants.js +1 -0
- package/dist/infrastructure/workspace/workspace-settings-store.d.ts +10 -0
- package/dist/infrastructure/workspace/workspace-settings-store.js +4 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +3 -0
- package/dist/ports/cache-store.d.ts +10 -0
- package/dist/ports/cache-store.js +0 -0
- package/dist/ports/chat-model.d.ts +30 -0
- package/dist/ports/chat-model.js +0 -0
- package/dist/ports/clipboard-adapter.d.ts +7 -0
- package/dist/ports/clipboard-adapter.js +0 -0
- package/dist/ports/clipboard-text-adapter.d.ts +3 -0
- package/dist/ports/clipboard-text-adapter.js +0 -0
- package/dist/ports/credential-store.d.ts +7 -0
- package/dist/ports/credential-store.js +0 -0
- package/dist/ports/goal-store.d.ts +12 -0
- package/dist/ports/goal-store.js +0 -0
- package/dist/ports/logger.d.ts +8 -0
- package/dist/ports/logger.js +0 -0
- package/dist/ports/media-gateway-client.d.ts +60 -0
- package/dist/ports/media-gateway-client.js +0 -0
- package/dist/ports/memory-store.d.ts +26 -0
- package/dist/ports/memory-store.js +0 -0
- package/dist/ports/model-completion-client.d.ts +8 -0
- package/dist/ports/model-completion-client.js +0 -0
- package/dist/ports/model-diagnostics.d.ts +17 -0
- package/dist/ports/model-diagnostics.js +0 -0
- package/dist/ports/project-trust-store.d.ts +12 -0
- package/dist/ports/project-trust-store.js +0 -0
- package/dist/ports/session-store.d.ts +59 -0
- package/dist/ports/session-store.js +0 -0
- package/dist/ports/subagent-lifecycle.d.ts +31 -0
- package/dist/ports/subagent-lifecycle.js +0 -0
- package/dist/ports/tool-activity.d.ts +13 -0
- package/dist/ports/tool-activity.js +0 -0
- package/dist/presentation/themes/theme.d.ts +19 -0
- package/dist/presentation/themes/theme.js +1 -0
- package/dist/presentation/tui/agent-initialization-renderer.d.ts +4 -0
- package/dist/presentation/tui/agent-initialization-renderer.js +1 -0
- package/dist/presentation/tui/context-display.d.ts +21 -0
- package/dist/presentation/tui/context-display.js +2 -0
- package/dist/presentation/tui/formatters.d.ts +6 -0
- package/dist/presentation/tui/formatters.js +1 -0
- package/dist/presentation/tui/ink/choice-window.d.ts +5 -0
- package/dist/presentation/tui/ink/choice-window.js +1 -0
- package/dist/presentation/tui/ink/components/activity-animation.d.ts +3 -0
- package/dist/presentation/tui/ink/components/activity-animation.js +1 -0
- package/dist/presentation/tui/ink/components/activity-entry.d.ts +6 -0
- package/dist/presentation/tui/ink/components/activity-entry.js +1 -0
- package/dist/presentation/tui/ink/components/activity-status.d.ts +10 -0
- package/dist/presentation/tui/ink/components/activity-status.js +1 -0
- package/dist/presentation/tui/ink/components/choice-modal.d.ts +11 -0
- package/dist/presentation/tui/ink/components/choice-modal.js +1 -0
- package/dist/presentation/tui/ink/components/composer.d.ts +40 -0
- package/dist/presentation/tui/ink/components/composer.js +8 -0
- package/dist/presentation/tui/ink/components/file-diff.d.ts +6 -0
- package/dist/presentation/tui/ink/components/file-diff.js +1 -0
- package/dist/presentation/tui/ink/components/modal.d.ts +8 -0
- package/dist/presentation/tui/ink/components/modal.js +2 -0
- package/dist/presentation/tui/ink/components/shimmer-text.d.ts +8 -0
- package/dist/presentation/tui/ink/components/shimmer-text.js +1 -0
- package/dist/presentation/tui/ink/components/subagent-activity.d.ts +11 -0
- package/dist/presentation/tui/ink/components/subagent-activity.js +1 -0
- package/dist/presentation/tui/ink/components/transcript.d.ts +40 -0
- package/dist/presentation/tui/ink/components/transcript.js +5 -0
- package/dist/presentation/tui/ink/components/welcome-panel.d.ts +6 -0
- package/dist/presentation/tui/ink/components/welcome-panel.js +1 -0
- package/dist/presentation/tui/ink/lotagate-tui.d.ts +6 -0
- package/dist/presentation/tui/ink/lotagate-tui.js +2 -0
- package/dist/presentation/tui/ink/markdown-inline-renderer.d.ts +4 -0
- package/dist/presentation/tui/ink/markdown-inline-renderer.js +1 -0
- package/dist/presentation/tui/ink/markdown-inline.d.ts +13 -0
- package/dist/presentation/tui/ink/markdown-inline.js +1 -0
- package/dist/presentation/tui/ink/markdown-message.d.ts +6 -0
- package/dist/presentation/tui/ink/markdown-message.js +2 -0
- package/dist/presentation/tui/ink/markdown-table.d.ts +16 -0
- package/dist/presentation/tui/ink/markdown-table.js +1 -0
- package/dist/presentation/tui/ink/tui-bridge.d.ts +193 -0
- package/dist/presentation/tui/ink/tui-bridge.js +1 -0
- package/dist/presentation/tui/terminal-capabilities.d.ts +15 -0
- package/dist/presentation/tui/terminal-capabilities.js +1 -0
- package/dist/presentation/tui/terminal-mouse.d.ts +5 -0
- package/dist/presentation/tui/terminal-mouse.js +1 -0
- package/dist/presentation/tui/terminal-screen.d.ts +10 -0
- package/dist/presentation/tui/terminal-screen.js +1 -0
- package/dist/presentation/tui/tui-agent-event-runner.d.ts +29 -0
- package/dist/presentation/tui/tui-agent-event-runner.js +1 -0
- package/dist/presentation/tui/tui-agent-turn-controller.d.ts +45 -0
- package/dist/presentation/tui/tui-agent-turn-controller.js +1 -0
- package/dist/presentation/tui/tui-application-contract.d.ts +11 -0
- package/dist/presentation/tui/tui-application-contract.js +1 -0
- package/dist/presentation/tui/tui-application.d.ts +61 -0
- package/dist/presentation/tui/tui-application.js +3 -0
- package/dist/presentation/tui/tui-clipboard-paste-handlers.d.ts +11 -0
- package/dist/presentation/tui/tui-clipboard-paste-handlers.js +1 -0
- package/dist/presentation/tui/tui-command-context.d.ts +3 -0
- package/dist/presentation/tui/tui-command-context.js +0 -0
- package/dist/presentation/tui/tui-command-executor.d.ts +38 -0
- package/dist/presentation/tui/tui-command-executor.js +4 -0
- package/dist/presentation/tui/tui-command-host-factory.d.ts +40 -0
- package/dist/presentation/tui/tui-command-host-factory.js +1 -0
- package/dist/presentation/tui/tui-context-compaction.d.ts +8 -0
- package/dist/presentation/tui/tui-context-compaction.js +1 -0
- package/dist/presentation/tui/tui-context-service.d.ts +2 -0
- package/dist/presentation/tui/tui-context-service.js +1 -0
- package/dist/presentation/tui/tui-extension-loader.d.ts +21 -0
- package/dist/presentation/tui/tui-extension-loader.js +1 -0
- package/dist/presentation/tui/tui-file-suggestions.d.ts +3 -0
- package/dist/presentation/tui/tui-file-suggestions.js +1 -0
- package/dist/presentation/tui/tui-goal-controller.d.ts +14 -0
- package/dist/presentation/tui/tui-goal-controller.js +1 -0
- package/dist/presentation/tui/tui-initial-model.d.ts +3 -0
- package/dist/presentation/tui/tui-initial-model.js +1 -0
- package/dist/presentation/tui/tui-lifecycle-actions.d.ts +13 -0
- package/dist/presentation/tui/tui-lifecycle-actions.js +1 -0
- package/dist/presentation/tui/tui-manual-compaction.d.ts +18 -0
- package/dist/presentation/tui/tui-manual-compaction.js +1 -0
- package/dist/presentation/tui/tui-media-model-selection.d.ts +12 -0
- package/dist/presentation/tui/tui-media-model-selection.js +1 -0
- package/dist/presentation/tui/tui-prompt-dispatcher.d.ts +16 -0
- package/dist/presentation/tui/tui-prompt-dispatcher.js +1 -0
- package/dist/presentation/tui/tui-skill-controller.d.ts +11 -0
- package/dist/presentation/tui/tui-skill-controller.js +3 -0
- package/dist/presentation/tui/tui-tool-approval.d.ts +22 -0
- package/dist/presentation/tui/tui-tool-approval.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/native-targets.mjs +1 -1
- package/package.json +13 -12
- package/scripts/install-native.mjs +5 -13
- package/skills/architecture-review/SKILL.md +41 -14
- package/skills/code-review/SKILL.md +41 -12
- package/skills/debugging/SKILL.md +49 -12
- package/skills/documentation/SKILL.md +43 -9
- package/skills/feature-implementation/SKILL.md +58 -19
- package/bin/lotagate.exe +0 -1
- package/skills/api-contract-review/SKILL.md +0 -17
- package/skills/database-review/SKILL.md +0 -17
- package/skills/dependency-review/SKILL.md +0 -16
- package/skills/frontend-review/SKILL.md +0 -18
- package/skills/incident-response/SKILL.md +0 -18
- package/skills/performance-review/SKILL.md +0 -17
- package/skills/refactor/SKILL.md +0 -23
- package/skills/release-readiness/SKILL.md +0 -16
- package/skills/security-review/SKILL.md +0 -16
- package/skills/test-plan/SKILL.md +0 -22
- package/skills/verify/SKILL.md +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=["direct","tui"],r=["direct"],a=["tui"],s={name:"scope",valueName:"<user|project>",description:"Extension scope",allowedValues:["user","project"],requiredOn:r},u=[{name:"token-budget",valueName:"<n>",description:"Maximum token budget"},{name:"max-turns",valueName:"<n>",description:"Maximum goal turns"},{name:"max-duration-ms",valueName:"<n>",description:"Maximum goal duration"}],o={name:"model",valueName:"<model-id>",description:"Use this model for this request only"},i=[{name:"out",valueName:"<filename>",description:"Output filename without extension"},{name:"out-dir",valueName:"<directory>",description:"Local output directory, inside or outside the workspace"},{name:"force",description:"Allow --out to replace an existing generated file"}],n=[o,{name:"n",valueName:"<count>",description:"Number of images"},{name:"size",valueName:"<size>",description:"Requested image size"},{name:"quality",valueName:"<low|medium|high|auto>",description:"Image quality",allowedValues:["low","medium","high","auto"]},{name:"background",valueName:"<transparent|opaque|auto>",description:"Image background",allowedValues:["transparent","opaque","auto"]},{name:"output-format",valueName:"<png|jpeg|webp>",description:"Image output format",allowedValues:["png","jpeg","webp"]},{name:"output-compression",valueName:"<0-100>",description:"Image output compression"},{name:"moderation",valueName:"<mode>",description:"Image moderation mode"},{name:"user",valueName:"<id>",description:"End-user identifier"},...i],m={name:"kind",valueName:"<kind>",description:"Memory kind"};function d(t){return t}const c=[{id:"help",path:["help"],surfaces:e,summary:"Show available commands",executor:"help"},{id:"version",path:["version"],surfaces:e,summary:"Show the CLI version",executor:"version"},{id:"config.get.default",path:["config"],handlerPath:["get"],surfaces:e,summary:"Read effective configuration",arguments:[{name:"key",required:!1}],executor:"config",defaultAction:!0,hiddenFromHelp:!0},{id:"config.get",path:["config","get"],handlerPath:["get"],surfaces:e,summary:"Read effective configuration",arguments:[{name:"key",required:!1}],executor:"config"},{id:"config.set",path:["config","set"],handlerPath:["set"],surfaces:e,summary:"Update global configuration",arguments:[{name:"key",required:!0},{name:"value",required:!0}],executor:"config"},{id:"config.path",path:["config","path"],handlerPath:["path"],surfaces:e,summary:"Show configuration paths",executor:"config"},{id:"auth.status.default",path:["auth"],handlerPath:["status"],surfaces:e,summary:"Show authentication status",executor:"auth",defaultAction:!0,hiddenFromHelp:!0},{id:"auth.login.direct",path:["auth","login"],handlerPath:["login"],surfaces:r,summary:"Save an API-key profile",options:[{name:"profile",valueName:"<name>",description:"Profile name"},{name:"base-url",valueName:"<url>",description:"Provider base URL"}],executor:"auth",desktop:{exposed:!0}},{id:"auth.login.tui",path:["auth","login"],handlerPath:["login"],surfaces:a,summary:"Save an API-key profile",options:[{name:"profile",valueName:"<name>",description:"Profile name"},{name:"base-url",valueName:"<url>",description:"Provider base URL"}],executor:"tui-auth-login"},{id:"auth.logout",path:["auth","logout"],handlerPath:["logout"],surfaces:e,summary:"Remove an API-key profile",arguments:[{name:"profile",required:!1}],executor:"auth"},{id:"auth.list",path:["auth","list"],handlerPath:["list"],surfaces:e,summary:"List authentication profiles",executor:"auth"},{id:"auth.status",path:["auth","status"],handlerPath:["status"],surfaces:e,summary:"Show authentication status",executor:"auth"},{id:"auth.use",path:["auth","use"],handlerPath:["use"],surfaces:e,summary:"Select an authentication profile",arguments:[{name:"profile",required:!0}],executor:"auth"},{id:"model.current.direct",path:["model"],handlerPath:["current"],surfaces:r,summary:"Show the selected model",executor:"model",defaultAction:!0,hiddenFromHelp:!0},{id:"model.select.tui",path:["model"],surfaces:a,summary:"Select a model",executor:"tui-model-select",defaultAction:!0,hiddenFromHelp:!0},{id:"model.current",path:["model","current"],handlerPath:["current"],surfaces:e,summary:"Show the selected model",executor:"model"},{id:"model.use",path:["model","use"],handlerPath:["use"],surfaces:e,summary:"Select a model",arguments:[{name:"model",required:!0}],executor:"model"},{id:"model.list",path:["model","list"],handlerPath:["list"],surfaces:e,summary:"Fetch the model catalog",executor:"model"},{id:"model.refresh",path:["model","refresh"],handlerPath:["refresh"],surfaces:e,summary:"Refresh the model catalog",executor:"model"},{id:"model.doctor",path:["model","doctor"],handlerPath:["doctor"],surfaces:e,summary:"Inspect model configuration",executor:"model"},{id:"effort.current.direct",path:["effort"],handlerPath:["current"],surfaces:r,summary:"Show the selected reasoning effort",executor:"effort",defaultAction:!0,hiddenFromHelp:!0},{id:"effort.select.tui",path:["effort"],surfaces:a,summary:"Select a reasoning effort",executor:"tui-effort-select",defaultAction:!0,hiddenFromHelp:!0},{id:"effort.current",path:["effort","current"],handlerPath:["current"],surfaces:e,summary:"Show the selected reasoning effort",executor:"effort"},{id:"effort.use",path:["effort","use"],handlerPath:["use"],surfaces:e,summary:"Select a reasoning effort",arguments:[{name:"effort",required:!0}],executor:"effort"},{id:"trust.status.default",path:["trust"],handlerPath:["status"],surfaces:e,summary:"Show current project trust",executor:"trust",defaultAction:!0,hiddenFromHelp:!0},{id:"trust.status",path:["trust","status"],handlerPath:["status"],surfaces:e,summary:"Show current project trust",executor:"trust"},{id:"trust.list",path:["trust","list"],handlerPath:["list"],surfaces:e,summary:"List trusted projects",executor:"trust"},{id:"trust.grant",path:["trust","grant"],handlerPath:["grant"],surfaces:e,summary:"Trust the current project",executor:"trust"},{id:"trust.revoke",path:["trust","revoke"],handlerPath:["revoke"],surfaces:e,summary:"Revoke current project trust",executor:"trust"},{id:"inspect",path:["inspect"],surfaces:e,summary:"Inspect current project identity",executor:"inspect"},{id:"hook.list.default",path:["hook"],handlerPath:["list"],surfaces:e,summary:"List project and plugin hooks",executor:"hook",defaultAction:!0,hiddenFromHelp:!0},{id:"hook.list",path:["hook","list"],handlerPath:["list"],surfaces:e,summary:"List project and plugin hooks",executor:"hook"},{id:"mcp.list.default",path:["mcp"],surfaces:e,summary:"List configured MCP servers",executor:"mcp",defaultAction:!0,hiddenFromHelp:!0},{id:"mcp.list",path:["mcp","list"],handlerPath:["list"],surfaces:e,summary:"List configured MCP servers",executor:"mcp"},{id:"mcp.get",path:["mcp","get"],handlerPath:["get"],surfaces:e,summary:"Inspect an MCP server",arguments:[{name:"name",required:!0}],options:[s],executor:"mcp"},{id:"mcp.add",path:["mcp","add"],handlerPath:["add"],surfaces:e,summary:"Add an MCP server",arguments:[{name:"name",required:!0}],options:[{name:"type",valueName:"<stdio|http|sse>",description:"MCP transport type (defaults to stdio)",allowedValues:["stdio","http","sse"]},{name:"command",valueName:"<command>",description:"stdio command",requiredWhen:{option:"type",values:["stdio"],absent:!0}},{name:"url",valueName:"<url>",description:"HTTP or SSE URL",requiredWhen:{option:"type",values:["http","sse"]}},{name:"args",valueName:"<a,b>",description:"Comma-separated stdio arguments"},s],executor:"mcp",desktop:{mutationKey:"mcp"}},{id:"mcp.reload",path:["mcp","reload"],handlerPath:["reload"],surfaces:e,summary:"Reconnect configured MCP servers",executor:"mcp",desktop:{mutationKey:"mcp"}},{id:"mcp.doctor",path:["mcp","doctor"],handlerPath:["doctor"],surfaces:e,summary:"Validate MCP servers",executor:"mcp"},...["enable","disable","remove"].map(t=>({id:`mcp.${t}`,path:["mcp",t],handlerPath:[t],surfaces:e,summary:`${t[0].toUpperCase()}${t.slice(1)} an MCP server`,arguments:[{name:"name",required:!0}],options:[s],executor:"mcp",desktop:{mutationKey:"mcp"}})),{id:"plugin.list.default",path:["plugin"],surfaces:e,summary:"List installed plugins",executor:"plugin",defaultAction:!0,hiddenFromHelp:!0},{id:"plugin.list",path:["plugin","list"],handlerPath:["list"],surfaces:e,summary:"List installed plugins",executor:"plugin"},{id:"plugin.info",path:["plugin","info"],handlerPath:["info"],surfaces:e,summary:"Inspect a plugin and its contributions",executor:"plugin",arguments:[{name:"name",required:!0}],options:[s]},{id:"plugin.install",path:["plugin","install"],handlerPath:["install"],surfaces:e,summary:"Install a plugin or standalone skill",arguments:[{name:"source",required:!0}],options:[s,{name:"sha256",valueName:"<hex>",description:"Expected archive checksum"},{name:"signature",valueName:"<base64>",description:"Archive signature"},{name:"public-key",valueName:"<pem>",description:"Signature public key"}],executor:"plugin",desktop:{mutationKey:"extensions"}},...["enable","disable","uninstall"].map(t=>({id:`plugin.${t}`,path:["plugin",t],handlerPath:[t],surfaces:e,summary:`${t[0].toUpperCase()}${t.slice(1)} a plugin`,arguments:[{name:"name",required:!0}],options:[s],executor:"plugin",desktop:{mutationKey:"extensions"}})),{id:"skill.list.default",path:["skill"],surfaces:e,summary:"List available skills",executor:"skill",defaultAction:!0,hiddenFromHelp:!0},{id:"skill.list",path:["skill","list"],handlerPath:["list"],surfaces:e,summary:"List available skills",executor:"skill"},...["info","enable","disable","remove"].map(t=>({id:`skill.${t}`,path:["skill",t],handlerPath:[t],surfaces:e,summary:`${t[0].toUpperCase()}${t.slice(1)} a skill`,arguments:[{name:"name",required:!0}],options:[s],executor:"skill",...t==="info"?{}:{desktop:{mutationKey:"extensions"}}})),{id:"skill.run.direct",path:["skill","run"],handlerPath:["run"],surfaces:r,summary:"Print an enabled skill prompt",arguments:[{name:"name",required:!0}],options:[s],executor:"skill"},{id:"skill.run.tui",path:["skill","run"],surfaces:a,summary:"Run an enabled skill",arguments:[{name:"name",required:!0},{name:"arguments",required:!1,variadic:!0}],options:[s],executor:"tui-skill-run"},{id:"session.list.default",path:["session"],surfaces:e,summary:"List durable sessions",executor:"session",defaultAction:!0,hiddenFromHelp:!0},{id:"session.list",path:["session","list"],handlerPath:["list"],surfaces:e,summary:"List durable sessions",executor:"session"},{id:"session.show",path:["session","show"],handlerPath:["show"],surfaces:e,summary:"Show a session transcript",arguments:[{name:"id",required:!0}],executor:"session"},{id:"session.import",path:["session","import"],handlerPath:["import"],surfaces:e,summary:"Import a session bundle",options:[{name:"file",valueName:"<path>",description:"Session bundle path",required:!0}],executor:"session"},{id:"session.resume.direct",path:["session","resume"],handlerPath:["resume"],surfaces:r,summary:"Inspect or resume a session",arguments:[{name:"id",required:!0}],options:[{name:"interactive",description:"Open the session in the TUI"}],executor:"session"},{id:"session.resume.tui",path:["session","resume"],surfaces:a,summary:"Resume a session in this TUI",arguments:[{name:"id",required:!0}],executor:"tui-session-resume"},{id:"session.fork",path:["session","fork"],handlerPath:["fork"],surfaces:e,summary:"Fork a session",arguments:[{name:"id",required:!0}],executor:"session"},{id:"session.compact.direct",path:["session","compact"],handlerPath:["compact"],surfaces:r,summary:"Compact a session",arguments:[{name:"id",required:!0}],executor:"session"},{id:"session.compact.tui",path:["session","compact"],surfaces:a,summary:"Compact the active session",executor:"tui-session-compact"},{id:"session.export",path:["session","export"],handlerPath:["export"],surfaces:e,summary:"Export a session bundle",arguments:[{name:"id",required:!0}],options:[{name:"out",valueName:"<path>",description:"Output path"}],executor:"session"},...["recover","repair","delete"].map(t=>({id:`session.${t}`,path:["session",t],handlerPath:[t],surfaces:e,summary:`${t[0].toUpperCase()}${t.slice(1)} a session`,arguments:[{name:"id",required:!0}],executor:"session",...t==="delete"?{desktop:{mutationKey:"session"}}:{}})),{id:"session.rename",path:["session","rename"],surfaces:a,summary:"Rename the active session",arguments:[{name:"name",required:!0,variadic:!0}],executor:"tui-session-rename"},{id:"memory.list.default",path:["memory"],handlerPath:["list"],surfaces:e,summary:"List project memories",options:[m,{name:"state",valueName:"<active|superseded|expired>",description:"Memory lifecycle state",allowedValues:["active","superseded","expired"]}],executor:"memory",defaultAction:!0,hiddenFromHelp:!0},{id:"memory.list",path:["memory","list"],handlerPath:["list"],surfaces:e,summary:"List project memories",options:[m,{name:"state",valueName:"<active|superseded|expired>",description:"Memory lifecycle state",allowedValues:["active","superseded","expired"]}],executor:"memory"},{id:"memory.show",path:["memory","show"],handlerPath:["show"],surfaces:e,summary:"Show a project memory",arguments:[{name:"id",required:!0}],executor:"memory"},{id:"memory.forget",path:["memory","forget"],handlerPath:["forget"],surfaces:e,summary:"Forget a project memory",arguments:[{name:"id",required:!0}],executor:"memory"},{id:"memory.clear",path:["memory","clear"],handlerPath:["clear"],surfaces:e,summary:"Clear project memory",executor:"memory"},{id:"memory.export",path:["memory","export"],handlerPath:["export"],surfaces:e,summary:"Export project memory",options:[{name:"out",valueName:"<path>",description:"Output bundle path"}],executor:"memory"},{id:"memory.import",path:["memory","import"],handlerPath:["import"],surfaces:e,summary:"Validate or import a project memory bundle",options:[{name:"file",valueName:"<path>",description:"Memory bundle path",required:!0},{name:"apply",description:"Apply the validated import"}],executor:"memory"},{id:"goal.status.direct",path:["goal","status"],handlerPath:["status"],surfaces:r,summary:"Show a session goal",arguments:[{name:"id",required:!0}],options:[{name:"json",description:"Use JSON output"}],executor:"goal"},{id:"goal.set",path:["goal","set"],handlerPath:["set"],surfaces:r,summary:"Set a session goal",arguments:[{name:"id",required:!0},{name:"objective",required:!0,variadic:!0}],options:[...u,{name:"json",description:"Use JSON output"}],executor:"goal"},{id:"goal.pause.direct",path:["goal","pause"],handlerPath:["pause"],surfaces:r,summary:"Pause a session goal",arguments:[{name:"id",required:!0}],options:[{name:"json",description:"Use JSON output"}],executor:"goal"},{id:"goal.resume.direct",path:["goal","resume"],handlerPath:["resume"],surfaces:r,summary:"Resume a session goal",arguments:[{name:"id",required:!0}],options:[...u,{name:"json",description:"Use JSON output"}],executor:"goal"},{id:"goal.clear.direct",path:["goal","clear"],handlerPath:["clear"],surfaces:r,summary:"Clear a session goal",arguments:[{name:"id",required:!0}],executor:"goal"},{id:"goal.run",path:["goal","run"],handlerPath:["run"],surfaces:r,summary:"Run a durable multi-turn goal",arguments:[{name:"objective",required:!0,variadic:!0}],options:u,executor:"goal"},...["status","pause","resume","clear"].map(t=>({id:`goal.${t}.tui`,path:["goal",t],surfaces:a,summary:`${t[0].toUpperCase()}${t.slice(1)} the active goal`,executor:"tui-goal"})),{id:"goal.start.tui",path:["goal"],surfaces:a,summary:"Start a goal for the active session",arguments:[{name:"objective",required:!0,variadic:!0}],options:u,executor:"tui-goal",defaultAction:!0,hiddenFromHelp:!0},{id:"doctor",path:["doctor"],surfaces:e,summary:"Run local diagnostics",executor:"doctor"},{id:"chat.direct",path:["chat"],surfaces:r,summary:"Stream a chat completion",arguments:[{name:"prompt",required:!1,variadic:!0}],executor:"chat"},{id:"chat.tui",path:["chat"],surfaces:a,summary:"Send an interactive chat prompt",arguments:[{name:"prompt",required:!0,variadic:!0}],executor:"tui-prompt"},{id:"image.generate",path:["image"],surfaces:e,summary:"Generate image artifacts",arguments:[{name:"prompt",required:!0,variadic:!0}],options:n,executor:"media"},{id:"image.edit",path:["image","edit"],handlerPath:["edit"],surfaces:e,summary:"Edit image artifacts",arguments:[{name:"prompt",required:!0,variadic:!0}],options:[...n,{name:"image",valueName:"<path[,path]>",description:"Source local image files",required:!0},{name:"mask",valueName:"<path>",description:"Optional local mask image"},{name:"input-fidelity",valueName:"<low|high>",description:"Input image fidelity",allowedValues:["low","high"]}],executor:"media"},{id:"audio.speech",path:["audio","speech"],handlerPath:["speech"],surfaces:e,summary:"Generate speech audio",arguments:[{name:"input",required:!0,variadic:!0}],options:[o,{name:"voice",valueName:"<voice>",description:"Voice identifier",required:!0},{name:"instructions",valueName:"<text>",description:"Voice instructions"},{name:"response-format",valueName:"<mp3|opus|aac|flac|wav|pcm>",description:"Audio output format",allowedValues:["mp3","opus","aac","flac","wav","pcm"]},{name:"stream-format",valueName:"<audio|sse>",description:"Speech response transport format",allowedValues:["audio","sse"]},{name:"speed",valueName:"<number>",description:"Speech speed"},...i],executor:"media"},{id:"audio.transcribe",path:["audio","transcribe"],handlerPath:["transcribe"],surfaces:e,summary:"Transcribe an audio file",options:[o,{name:"file",valueName:"<path>",description:"Local audio file",required:!0},{name:"language",valueName:"<code>",description:"Input language code"},{name:"prompt",valueName:"<text>",description:"Transcript prompt"},{name:"response-format",valueName:"<json|text|srt|verbose_json|vtt|diarized_json>",description:"Transcript format",allowedValues:["json","text","srt","verbose_json","vtt","diarized_json"]},{name:"temperature",valueName:"<number>",description:"Sampling temperature"},{name:"timestamp-granularities",valueName:"<word,segment>",description:"Timestamp granularities"},{name:"include",valueName:"<value[,value]>",description:"Provider response fields"},...i],executor:"media"},{id:"audio.translate",path:["audio","translate"],handlerPath:["translate"],surfaces:e,summary:"Translate an audio file",options:[o,{name:"file",valueName:"<path>",description:"Local audio file",required:!0},{name:"prompt",valueName:"<text>",description:"Translation prompt"},{name:"response-format",valueName:"<json|text|srt|verbose_json|vtt>",description:"Translation format",allowedValues:["json","text","srt","verbose_json","vtt"]},{name:"temperature",valueName:"<number>",description:"Sampling temperature"},...i],executor:"media"},{id:"video.generate",path:["video"],surfaces:e,summary:"Create and retrieve a video artifact",arguments:[{name:"prompt",required:!0,variadic:!0}],options:[o,{name:"parameters",valueName:"<json>",description:"Provider video parameter object"},{name:"no-wait",description:"Return the operation id without waiting"},...i],executor:"media"},{id:"video.status",path:["video","status"],handlerPath:["status"],surfaces:e,summary:"Show a video operation status",arguments:[{name:"operation-id",required:!0}],executor:"media"},{id:"video.download",path:["video","download"],handlerPath:["download"],surfaces:e,summary:"Download a completed video artifact",arguments:[{name:"operation-id",required:!0}],options:i,executor:"media"},{id:"exec.direct",path:["exec"],surfaces:r,summary:"Run a headless agent prompt",arguments:[{name:"prompt",required:!0,variadic:!0}],options:[{name:"image",valueName:"<path[,path]>",description:"Image attachments"},{name:"json",description:"Use JSON events"},{name:"jsonl",description:"Use JSONL events"}],executor:"exec",desktop:{exposed:!1}},{id:"exec.tui",path:["exec"],surfaces:a,summary:"Run an interactive agent prompt",arguments:[{name:"prompt",required:!0,variadic:!0}],executor:"tui-prompt"},{id:"agent.stdio",path:["agent","stdio"],handlerPath:["stdio"],surfaces:r,summary:"Run the JSONL agent protocol",executor:"agent",desktop:{exposed:!1}},{id:"agent.desktop",path:["agent","desktop"],handlerPath:["desktop"],surfaces:r,summary:"Run the desktop application protocol",executor:"agent",desktop:{exposed:!1}},{id:"agent.info",path:["agent"],surfaces:a,summary:"Explain the direct JSONL agent protocol",executor:"tui-agent-info"},...["bash","zsh","powershell"].map(t=>({id:`completions.${t}`,path:["completions",t],handlerPath:[t],surfaces:e,summary:`Print ${t} completion definitions`,executor:"completions",desktop:{exposed:!1}})),{id:"completions.default",path:["completions"],surfaces:e,summary:"Print PowerShell completion definitions",executor:"completions",defaultAction:!0,hiddenFromHelp:!0,desktop:{exposed:!1}},{id:"update.check.default",path:["update"],handlerPath:["check"],surfaces:e,summary:"Check update policy",executor:"update",defaultAction:!0,hiddenFromHelp:!0},{id:"update.check",path:["update","check"],handlerPath:["check"],surfaces:e,summary:"Check update policy",executor:"update"},{id:"tui.clear",path:["clear"],surfaces:a,summary:"Clear the current transcript view",executor:"tui-clear"},{id:"tui.stop",path:["stop"],surfaces:a,summary:"Stop the active response",executor:"tui-stop"},{id:"tui.context",path:["context"],surfaces:a,summary:"Show context usage and session composition",executor:"tui-context"},{id:"tui.details",path:["details"],surfaces:a,summary:"Toggle tool execution details",executor:"tui-details"},{id:"tui.exit",path:["exit"],surfaces:a,summary:"Exit the interactive session",executor:"tui-exit"},{id:"attachments.list.default",path:["attachments"],surfaces:a,summary:"List pending attachments",executor:"tui-attachments",defaultAction:!0,hiddenFromHelp:!0},{id:"attachments.list",path:["attachments","list"],surfaces:a,summary:"List pending attachments",executor:"tui-attachments"},{id:"attachments.paste",path:["attachments","paste"],surfaces:a,summary:"Add an image from the clipboard",executor:"tui-attachments"},{id:"attachments.remove",path:["attachments","remove"],surfaces:a,summary:"Remove a pending attachment",arguments:[{name:"id",required:!0}],executor:"tui-attachments"}];export{c as COMMAND_ACTIONS};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export type CommandSurface = 'direct' | 'tui';
|
|
2
|
+
export type CommandExecutorId = 'help' | 'version' | 'config' | 'auth' | 'tui-auth-login' | 'trust' | 'inspect' | 'hook' | 'model' | 'tui-model-select' | 'effort' | 'tui-effort-select' | 'mcp' | 'plugin' | 'skill' | 'tui-skill-run' | 'session' | 'tui-session-resume' | 'tui-session-compact' | 'tui-session-rename' | 'goal' | 'memory' | 'tui-goal' | 'doctor' | 'chat' | 'exec' | 'media' | 'tui-prompt' | 'agent' | 'tui-agent-info' | 'completions' | 'update' | 'tui-clear' | 'tui-stop' | 'tui-context' | 'tui-details' | 'tui-attachments' | 'tui-exit';
|
|
3
|
+
export interface CommandArgumentSpec {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly required: boolean;
|
|
6
|
+
readonly variadic?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CommandOptionRequirement {
|
|
9
|
+
readonly option: string;
|
|
10
|
+
readonly values?: readonly string[];
|
|
11
|
+
readonly absent?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface CommandOptionSpec {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly valueName?: string;
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly required?: boolean;
|
|
18
|
+
readonly requiredOn?: readonly CommandSurface[];
|
|
19
|
+
readonly requiredWhen?: CommandOptionRequirement;
|
|
20
|
+
readonly allowedValues?: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
export interface CommandActionSpec {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
/** Tokens used to select this action on a supported surface. */
|
|
25
|
+
readonly path: readonly string[];
|
|
26
|
+
/** Tokens the existing application handler expects before parsed arguments. */
|
|
27
|
+
readonly handlerPath?: readonly string[];
|
|
28
|
+
readonly surfaces: readonly CommandSurface[];
|
|
29
|
+
readonly summary: string;
|
|
30
|
+
readonly arguments?: readonly CommandArgumentSpec[];
|
|
31
|
+
readonly options?: readonly CommandOptionSpec[];
|
|
32
|
+
readonly executor: CommandExecutorId;
|
|
33
|
+
/**
|
|
34
|
+
* Optional exposure policy for the Desktop JSONL protocol. Direct and TUI
|
|
35
|
+
* users continue to resolve commands from `surfaces`; this metadata only
|
|
36
|
+
* controls whether a command is safe and meaningful for a non-terminal
|
|
37
|
+
* Desktop client.
|
|
38
|
+
*/
|
|
39
|
+
readonly desktop?: {
|
|
40
|
+
readonly exposed?: boolean;
|
|
41
|
+
/** Resource domain that must not mutate concurrently with turns/commands. */
|
|
42
|
+
readonly mutationKey?: string;
|
|
43
|
+
};
|
|
44
|
+
/** Default action for a command group, such as `mcp` → `mcp list`. */
|
|
45
|
+
readonly defaultAction?: boolean;
|
|
46
|
+
/** Default routes are executable but excluded from command lists. */
|
|
47
|
+
readonly hiddenFromHelp?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface CommandInvocation {
|
|
50
|
+
readonly surface: CommandSurface;
|
|
51
|
+
readonly action: CommandActionSpec;
|
|
52
|
+
readonly positionals: readonly string[];
|
|
53
|
+
readonly options: ReadonlyMap<string, string | boolean>;
|
|
54
|
+
readonly handlerPositionals: readonly string[];
|
|
55
|
+
}
|
|
56
|
+
export interface CommandSuggestion {
|
|
57
|
+
readonly value: string;
|
|
58
|
+
readonly label: string;
|
|
59
|
+
readonly description: string;
|
|
60
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CliError } from '../../domain/errors/cli-error.js';
|
|
2
|
+
import type { CliCommandHint } from '../../domain/errors/cli-command-hint.js';
|
|
3
|
+
export type CommandSurface = 'tui' | 'direct';
|
|
4
|
+
export declare function commandHint(actionId: string, tuiActionId?: string): CliCommandHint;
|
|
5
|
+
export declare const AUTH_LOGIN_HINT: CliCommandHint;
|
|
6
|
+
export declare const MODEL_SELECT_HINT: CliCommandHint;
|
|
7
|
+
export declare const TRUST_GRANT_HINT: CliCommandHint;
|
|
8
|
+
export declare function formatCommandHint(hint: CliCommandHint, surface: CommandSurface): string;
|
|
9
|
+
export declare function formatCliErrorMessage(error: CliError, surface: CommandSurface): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{formatCommandUsage as r}from"./command-presentation.js";import{COMMAND_REGISTRY as i}from"./command-runtime.js";function e(t,n){return n===void 0?{actionId:t}:{actionId:t,tuiActionId:n}}const d=e("auth.login.direct","auth.login.tui"),s=e("model.use"),c=e("trust.grant");function m(t,n){const o=i.get(n==="tui"?t.tuiActionId??t.actionId:t.actionId);return o===void 0?"Try the relevant command from the command help.":`Try \`${r(o,n)}\`.`}function f(t,n){return t.hint===void 0?t.userMessage:`${t.userMessage} ${m(t.hint,n)}`}export{d as AUTH_LOGIN_HINT,s as MODEL_SELECT_HINT,c as TRUST_GRANT_HINT,e as commandHint,f as formatCliErrorMessage,m as formatCommandHint};
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandInvocation, CommandSurface } from './command-contract.js';
|
|
2
|
+
import type { CommandRegistry } from './command-registry.js';
|
|
3
|
+
export declare function tokenizeCommandInput(value: string): readonly string[];
|
|
4
|
+
export declare function parseCommandInvocation(tokens: readonly string[], surface: CommandSurface, registry: CommandRegistry): CommandInvocation;
|
|
5
|
+
/**
|
|
6
|
+
* Validates an already selected action. Protocol callers use this when the
|
|
7
|
+
* action id and parsed values are transported separately from the command
|
|
8
|
+
* text, while direct and TUI callers continue to use token parsing above.
|
|
9
|
+
*/
|
|
10
|
+
export declare function parseCommandInvocationForAction(actionId: string, positionals: readonly string[], options: ReadonlyMap<string, string | boolean>, surface: CommandSurface, registry: CommandRegistry): CommandInvocation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as g}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as v}from"../../domain/errors/error-codes.js";function x(n){const o=[];let e="",i,t=!1;for(const r of n.trim()){if(t){e+=r,t=!1;continue}if(r==="\\"){i!==void 0?t=!0:e+=r;continue}if(i!==void 0){r===i?i=void 0:e+=r;continue}if(r==='"'||r==="'"){i=r;continue}if(/\s/u.test(r)){e.length>0&&(o.push(e),e="");continue}e+=r}return t&&(e+="\\"),e.length>0&&o.push(e),o}function A(n,o,e){const i=e.resolve(n,o),t=n.slice(i.path.length),{positionals:r,options:u}=$(t,i);return w(i,r,u,o)}function y(n,o,e,i,t){const r=t.get(n);if(r===void 0)throw f(`Unknown command action: ${n}.`);if(!r.surfaces.includes(i))throw f(`Command action ${n} is not available on the ${i} surface.`);return w(r,o,e,i)}function w(n,o,e,i){return q(n,o),M(n,e,i),{surface:i,action:n,positionals:o,options:e,handlerPositionals:[...n.handlerPath??n.path.slice(1),...o]}}function $(n,o){const e=[],i=new Map,t=new Map((o.options??[]).map(u=>[u.name,u]));let r=!0;for(let u=0;u<n.length;u+=1){const a=n[u];if(r&&a==="--"){r=!1;continue}if(!r||!a.startsWith("--")||a.length===2){e.push(a);continue}const c=a.indexOf("="),s=a.slice(2,c<0?void 0:c),p=t.get(s);if(p===void 0)throw f(`Unsupported option --${s} for ${o.path.join(" ")}.`);if(i.has(s))throw f(`Option --${s} was provided more than once.`);const d=c<0?void 0:a.slice(c+1);if(p.valueName===void 0){if(d!==void 0&&d!=="true")throw f(`Option --${s} does not accept a value.`);i.set(s,d===void 0?!0:d);continue}const l=n[u+1],h=d??(l===void 0||l==="--"||l.startsWith("--")?void 0:l);if(h===void 0||h.trim().length===0)throw m(`Missing value for --${s}.`);d===void 0&&(u+=1),i.set(s,h)}return{positionals:e,options:i}}function q(n,o){const e=n.arguments??[],i=e.filter(r=>r.required).length;if(o.length<i){const r=e[o.length];throw m(`Missing required argument: ${r?.name??"value"}.`)}if(!(e.at(-1)?.variadic===!0)&&o.length>e.length)throw f(`Too many arguments for ${n.path.join(" ")}.`)}function M(n,o,e){const i=new Map((n.options??[]).map(t=>[t.name,t]));for(const t of o.keys())if(!i.has(t))throw f(`Unsupported option --${t} for ${n.path.join(" ")}.`);for(const t of n.options??[]){const r=t.required===!0||t.requiredOn?.includes(e)===!0,u=t.requiredWhen===void 0?!1:C(t.requiredWhen,o);if((r||u)&&!o.has(t.name))throw m(`Missing required option --${t.name}.`);const a=o.get(t.name);if(t.allowedValues!==void 0&&typeof a=="string"&&!t.allowedValues.includes(a))throw f(`Invalid value for --${t.name}. Expected one of: ${t.allowedValues.join(", ")}.`)}}function C(n,o){const e=o.get(n.option),i=n.absent===!0&&e===void 0,t=n.values===void 0?e!==void 0:typeof e=="string"&&n.values.includes(e);return i||t}function m(n){return new g(v.MISSING_ARGUMENT,n,{category:"arguments",userMessage:n})}function f(n){return new g(v.INVALID_ARGUMENT,n,{category:"arguments",userMessage:n})}export{A as parseCommandInvocation,y as parseCommandInvocationForAction,x as tokenizeCommandInput};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandActionSpec, CommandSuggestion, CommandSurface } from './command-contract.js';
|
|
2
|
+
import type { CommandRegistry } from './command-registry.js';
|
|
3
|
+
export declare function formatCommandReference(action: CommandActionSpec, surface: CommandSurface): string;
|
|
4
|
+
export declare function formatCommandUsage(action: CommandActionSpec, surface: CommandSurface): string;
|
|
5
|
+
export declare function formatCommandInvocation(action: CommandActionSpec, surface: CommandSurface, positionals?: readonly string[], options?: ReadonlyMap<string, string | boolean>): string;
|
|
6
|
+
export declare function formatCommandHelp(registry: CommandRegistry, surface: CommandSurface): string;
|
|
7
|
+
export declare function commandSuggestions(input: string, registry: CommandRegistry, surface: CommandSurface): readonly CommandSuggestion[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{tokenizeCommandInput as A}from"./command-parser.js";function p(n,t){return`${t==="direct"?"lotagate ":"/"}${n.path.join(" ")}`}function L(n,t){const e=w(n),a=(n.options??[]).map(s=>{const o=s.valueName===void 0?`--${s.name}`:`--${s.name} ${s.valueName}`;return b(s,t)?o:`[${o}]`});return[p(n,t),...e,...a].join(" ")}function R(n,t,e=[],a=new Map){const s=[...a.entries()].flatMap(([o,r])=>r===!0?[`--${o}`]:[`--${o}`,r]);return[p(n,t),...e,...s].join(" ")}function W(n,t){const e=n.list(t).map(o=>({usage:L(o,t),summary:o.summary})),a=Math.max(...e.map(o=>o.usage.length),0);return`${t==="direct"?"LotaGate CLI commands:":"Interactive commands:"}
|
|
2
|
+
${e.map(o=>` ${o.usage.padEnd(a)} ${o.summary}`).join(`
|
|
3
|
+
`)}`}function q(n,t,e){const a=e==="tui"?"/":"",s=e==="tui"?n.trimStart().slice(1):n.trimStart(),o=/\s$/u.test(s),r=A(s);if(r.length===0)return S(a,t,e,"");if(r.length===1&&!o)return S(a,t,e,r[0]);const m=r[0].toLowerCase(),u=t.actionsForRoot(m,e),c=u.filter(d=>!d.hiddenFromHelp);if(u.length===0)return[];const i=o?"":r[1]??"";if(r.length<=2){const d=v(u),h=r.length===2&&c.some(f=>f.path.length===2&&f.path[1]===r[1]?.toLowerCase()),x=!o&&r.length===2&&c.some(f=>f.path.length===2&&f.path[1].startsWith(i.toLowerCase()));if(r.length===1||o&&r.length===1||h||x){if(!h)return g(a,m,i,t,e)}else return d!==void 0?C(n,d,e,r):g(a,m,i,t,e)}const l=j(r,t,e);return l===void 0?g(a,m,i,t,e):!o&&r.length===l.path.length?[$(l,e)]:C(n,l,e,r)}function S(n,t,e,a){const s=new Map;for(const o of t.list(e))s.has(o.path[0])||s.set(o.path[0],o);return[...s.entries()].filter(([o])=>o.startsWith(a.toLowerCase())).map(([o,r])=>({value:`${n}${o}`,label:`${n}${o}`,description:r.summary}))}function g(n,t,e,a,s){const o=new Map,r=a.actionsForRoot(t,s);for(const u of r){if(u.hiddenFromHelp||u.path.length<2)continue;const c=u.path[1];!c.startsWith(e.toLowerCase())||o.has(c)||o.set(c,u)}const m=v(r);return[...m===void 0||!(m.arguments?.some(u=>u.required)??!1)?[]:[$(m,s,n)],...[...o.values()].map(u=>$(u,s,n))]}function v(n){return n.find(t=>t.defaultAction===!0&&t.path.length===1)??n.find(t=>t.path.length===1&&!t.hiddenFromHelp)}function C(n,t,e,a){const s=e==="tui"?"/":"",o=new Set(a.filter(i=>i.startsWith("--")).map(i=>i.slice(2).split("=")[0])),r=e==="tui"?n.trimStart().slice(1):n.trimStart(),m=/\s$/u.test(r),u=m?"":a.at(-1)??"";if(!u.startsWith("--"))return[];const c=m?r.trimEnd():r.slice(0,Math.max(0,r.lastIndexOf(" "))).trimEnd();return(t.options??[]).filter(i=>!o.has(i.name)&&`--${i.name}`.startsWith(u)).map(i=>{const l=`--${i.name}`,d=`${s}${c}${c.length===0?"":" "}${l}`,h=i.valueName===void 0?l:`${l} ${i.valueName}`;return{value:d,label:b(i,e)?h:`[${h}]`,description:i.description}})}function j(n,t,e){try{return t.resolve(n,e)}catch{return}}function $(n,t,e){const a=e===void 0?p(n,t):`${e}${n.path.join(" ")}`,s=k(n,t);return{value:a,label:s,description:n.summary}}function k(n,t){return[p(n,t),...w(n)].join(" ")}function w(n){return(n.arguments??[]).map(t=>{const e=t.variadic?`${t.name}...`:t.name;return t.required?`<${e}>`:`[${e}]`})}function b(n,t){return n.required===!0||n.requiredOn?.includes(t)===!0}export{q as commandSuggestions,W as formatCommandHelp,R as formatCommandInvocation,p as formatCommandReference,L as formatCommandUsage};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandActionSpec, CommandSurface } from './command-contract.js';
|
|
2
|
+
export declare class CommandRegistry {
|
|
3
|
+
private readonly actions;
|
|
4
|
+
private readonly byId;
|
|
5
|
+
constructor(actions: readonly CommandActionSpec[]);
|
|
6
|
+
get(id: string): CommandActionSpec | undefined;
|
|
7
|
+
list(surface: CommandSurface, includeHidden?: boolean): readonly CommandActionSpec[];
|
|
8
|
+
actionsForRoot(root: string, surface: CommandSurface): readonly CommandActionSpec[];
|
|
9
|
+
resolve(tokens: readonly string[], surface: CommandSurface): CommandActionSpec;
|
|
10
|
+
private assertNoSurfaceCollisions;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as d}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as h}from"../../domain/errors/error-codes.js";class p{actions;byId=new Map;constructor(o){this.actions=o;for(const t of o){if(t.path.length===0)throw new Error(`Command action ${t.id} has no path.`);if(this.byId.has(t.id))throw new Error(`Command action ${t.id} is already registered.`);this.byId.set(t.id,t)}for(const t of["direct","tui"])this.assertNoSurfaceCollisions(t)}get(o){return this.byId.get(o)}list(o,t=!1){return this.actions.filter(n=>n.surfaces.includes(o)&&(t||!n.hiddenFromHelp)).sort(f)}actionsForRoot(o,t){const n=o.toLowerCase();return this.actions.filter(r=>r.surfaces.includes(t)&&r.path[0]===n)}resolve(o,t){const n=o[0]?.toLowerCase();if(n===void 0)throw s("A command is required.");const a=this.actionsForRoot(n,t).filter(i=>l(i.path,o)).sort((i,c)=>c.path.length-i.path.length)[0];if(a!==void 0)return a;throw this.actionsForRoot(n,t).length===0?s(`Unknown command: ${n}.`):s(`Unsupported ${n} command.`)}assertNoSurfaceCollisions(o){const t=new Set;for(const n of this.actions.filter(r=>r.surfaces.includes(o))){const r=n.path.join(" ");if(t.has(r))throw new Error(`Command path collision on ${o}: ${r}.`);t.add(r)}}}function l(e,o){return o.length<e.length?!1:e.every((t,n)=>o[n]?.toLowerCase()===t)}function f(e,o){return e.path.join(" ").localeCompare(o.path.join(" "))}function s(e){return new d(h.INVALID_ARGUMENT,e,{category:"arguments",userMessage:e})}export{p as CommandRegistry};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{COMMAND_ACTIONS as o}from"./command-catalog.js";import{CommandRegistry as m}from"./command-registry.js";const C=new m(o);export{C as COMMAND_REGISTRY};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Writable } from 'node:stream';
|
|
2
|
+
import type { CliRuntime } from '../../bootstrap/runtime-factory.js';
|
|
3
|
+
export declare function runGoalCommand(positionals: readonly string[], flags: ReadonlyMap<string, string | boolean>, runtime: CliRuntime, cwd: string, stdout: Writable, signal?: AbortSignal): Promise<number>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{isFlagEnabled as G,requirePositional as v}from"./cli-args.js";import{ProjectSessionAccess as D}from"../session/project-session-access.js";import{AuthenticationService as L}from"../auth/authentication-service.js";import{loadExecutionConfig as P}from"../config/execution-config.js";import{createLotaGateClient as x}from"../../infrastructure/sdk/lotagate-client-factory.js";import{runHeadlessAgentTurn as F}from"../orchestration/headless-agent-turn.js";import{runGoalLoop as q}from"../orchestration/goal-runner.js";import{CliAgentSessionStore as $}from"../agent/agent-session-store.js";import{formatGoalStatus as k}from"../orchestration/goal-output.js";import{parseGoalInput as B}from"../orchestration/goal-input.js";import{CliError as p}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as g}from"../../domain/errors/error-codes.js";import{MODEL_SELECT_HINT as H,TRUST_GRANT_HINT as J}from"./command-hints.js";import{createTurnId as K,recordTurnCompletion as Q,recordTurnFailure as W,recordTurnStart as z}from"../session/session-turn-lifecycle.js";import{createCommandAbortController as V,throwIfCommandAborted as O}from"./command-cancellation.js";async function fe(r,t,e,u,s,c){const i=r[0]??"status";if(i==="run")return M(r.slice(1).join(" ").trim(),t,e,u,s,void 0,c);O(c);const l=v(r,1,"session id"),d=await e.projectTrust.inspect(u);if(await new D(e.sessionStore).require(l,d.fingerprint),i==="status")return N(s,await e.goalStore.get(l),G(t,"json"));if(i==="set"){const n=v([r.slice(2).join(" ")],0,"goal objective"),w=await e.goalStore.replace(l,U(n,t));return N(s,w,G(t,"json"))}if(i==="pause"){const n=await e.goalStore.pause(l);return N(s,n,G(t,"json"))}if(i==="resume"){const n=await e.goalStore.get(l);if(n===void 0)throw new p(g.GOAL_NOT_FOUND,"Goal not found.",{category:"goal",userMessage:"Goal was not found."});return M(n.objective,t,e,u,s,l,c)}if(i==="clear")return await e.goalStore.clear(l),s.write(`Goal cleared.
|
|
2
|
+
`),0;throw new Error(`Unsupported goal action: ${i}`)}async function M(r,t,e,u,s,c,i){if(O(i),r.length===0)throw new p(g.MISSING_ARGUMENT,"Missing goal objective.",{category:"arguments",userMessage:"A goal objective is required."});const l=U(r,t),d=await e.projectTrust.inspect(u);if(!await e.projectTrust.isTrusted(d))throw new p(g.PROJECT_TRUST_REQUIRED,"Project trust is required for goals.",{category:"project",userMessage:"Project is not trusted.",hint:J});const n=await P(e,u);if(n.config.model===null)throw new p(g.MODEL_NOT_FOUND,"No model is selected.",{category:"model",userMessage:"No model is selected.",hint:H});const w=n.config.model,T=n.config.profile??L.defaultProfileName(),y=await e.auth.requireCredential(T),a=c===void 0?await e.sessionStore.create({projectFingerprint:d.fingerprint,cwd:d.canonicalPath,model:n.config.model,profile:T,status:"active"}):await e.sessionStore.get(c);if(a===void 0)throw new p(g.SESSION_NOT_FOUND,"Goal session not found.",{category:"session",userMessage:"Goal session was not found."});c===void 0?await e.goalStore.create(a.id,l):await e.goalStore.resume(a.id);const I=x(y.profile,y.apiKey),R=new $,h=V(i),E=h.controller,j=()=>E.abort(new Error("Goal interrupted by user."));process.once("SIGINT",j);try{const f=await q({runtime:e,sessionId:a.id,objective:r,model:w,client:I,signal:E.signal,runTurn:async(C,m,A)=>{const S=K();await z(e.sessionStore,a.id,S,C);try{const o=await e.goalStore.get(a.id),_=await F({runtime:e,cwd:u,model:w,profileName:T,client:I,prompt:C,output:s,sessionId:a.id,agentSessionStore:R,signal:A,turnId:S,...o===void 0?{}:{goal:{objective:o.objective,status:o.status,turns:o.turns,evaluatorRuns:o.evaluatorRuns,tokensUsed:o.usage.totalTokens,...o.tokenBudget===void 0?{}:{tokenBudget:o.tokenBudget},...o.maxTurns===void 0?{}:{maxTurns:o.maxTurns},...o.maxDurationMs===void 0?{}:{maxDurationMs:o.maxDurationMs},...o.lastError===void 0?{}:{lastError:o.lastError},...o.lastEvaluation===void 0?{}:{lastEvaluation:o.lastEvaluation.reason}}},onUsage:m.onUsage,onSubagentUsage:m.onUsage,onSnapshot:m.onSnapshot});return s.write(`
|
|
3
|
+
`),await Q(e.sessionStore,a.id,S,_),_}catch(o){throw m.onError(o),await W(e.sessionStore,a.id,S,o,E.signal.aborted),o}}});await e.sessionStore.updateStatus(a.id,f?.status==="completed"?"completed":f?.status==="paused"?"active":"failed"),s.write(`Goal session: ${a.id}
|
|
4
|
+
`);const b=f?.status==="paused"&&f.lastError?.startsWith("Goal paused by safety limit:")===!0;return f?.status==="completed"||b?0:1}finally{process.off("SIGINT",j),h.dispose()}}function U(r,t){return B(r,t)}function N(r,t,e){return e?(r.write(`${JSON.stringify(t??null)}
|
|
5
|
+
`),t===void 0?1:0):t===void 0?(r.write(`No active goal.
|
|
6
|
+
`),1):(r.write(`${k(t)}
|
|
7
|
+
`),0)}export{fe as runGoalCommand};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CliRuntime } from '../../bootstrap/runtime-factory.js';
|
|
2
|
+
import type { CommandInvocation } from './command-contract.js';
|
|
3
|
+
import type { CommandOutput } from './command-output.js';
|
|
4
|
+
export interface CommandActivityObserver {
|
|
5
|
+
start(key: string, label: string): {
|
|
6
|
+
complete(isError: boolean): void;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function runMediaCommand(invocation: CommandInvocation, runtime: CliRuntime, cwd: string, output: CommandOutput, activity?: CommandActivityObserver, suppliedSignal?: AbortSignal): Promise<number>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{AuthenticationService as P}from"../auth/authentication-service.js";import{loadExecutionConfig as R}from"../config/execution-config.js";import{waitForVideoOperation as U}from"../media/video-operation-poller.js";import{loadModelCatalog as J}from"../model/model-catalog-service.js";import{CliError as $}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as F}from"../../domain/errors/error-codes.js";import{SDK_BINARY_MEDIA_RESPONSE_BYTES as v,validateMediaCommandOptions as K}from"../../domain/media/gateway-media-contract.js";import{resolveMediaExecutionPolicy as Y}from"../../domain/media/media-execution-policy.js";import{readGatewayAudioInput as H,readGatewayImageEditInput as W}from"../../infrastructure/filesystem/gateway-media-input-reader.js";import{WorkspaceMediaArtifactStore as Z}from"../../infrastructure/filesystem/workspace-media-artifact-store.js";import{normalizeImage as k}from"../../infrastructure/clipboard/image-normalizer.js";import{downloadPublicMedia as Q}from"../../infrastructure/network/safe-media-downloader.js";import{createLotaGateClient as X}from"../../infrastructure/sdk/lotagate-client-factory.js";import{SdkMediaGatewayClient as ee}from"../../infrastructure/sdk/sdk-media-gateway-client.js";import{MODEL_SELECT_HINT as _}from"./command-hints.js";import{writeMediaCommandResult as E}from"./media-command-output.js";import{writeStreamChunk as te}from"./stream-output.js";import{getStringFlag as s,isFlagEnabled as D,requirePositional as G,requireStringFlag as O}from"./cli-args.js";async function De(e,t,o,r,i,a){K(e.action.id,e.positionals,e.options);const n=a===void 0?new AbortController:void 0,p=a??n.signal,u=()=>n?.abort(new Error("Media command interrupted."));n!==void 0&&process.once("SIGINT",u);try{t.logger.info("Media command started.",{action:e.action.id});const d=await oe(e,t,o,r,i,p);return t.logger.info("Media command completed.",{action:e.action.id,exitCode:d}),d}catch(d){const m=d instanceof $?{code:d.code,category:d.category,correlationId:d.correlationId}:{};throw t.logger.error("Media command failed.",{action:e.action.id,...m}),d}finally{n!==void 0&&process.off("SIGINT",u)}}async function oe(e,t,o,r,i,a){const n=e.action.id;n!=="video.status"&&await t.projectTrust.requireTrusted(await t.projectTrust.inspect(o));const p=await R(t,o),u=p.config.profile??P.defaultProfileName(),d=await t.auth.requireCredential(u),m=new ee(X(d.profile,d.apiKey)),f=new Z(o,t.logger),c=Y();if(n==="video.status")return ue(G(e.positionals,0,"operation id"),m,t.logger,r,i,a);if(n==="video.download")return me(G(e.positionals,0,"operation id"),e.options,m,f,t.logger,r,i,a);const w=await ne(e.options,p.config.model,t,o);if(n==="image.generate")return re(e.positionals,e.options,w,m,f,c.downloadTimeoutMs,r,i,a);if(n==="image.edit")return ie(e.positionals,e.options,w,m,f,o,c.downloadTimeoutMs,r,i,a);if(n==="audio.speech")return ae(e.positionals,e.options,w,m,f,r,i,a);if(n==="audio.transcribe"||n==="audio.translate")return de(n,e.options,w,m,f,o,r,i,a);if(n==="video.generate")return se(e.positionals,e.options,w,m,f,c,t,r,i,a);throw new Error(`Unsupported media command: ${n}`)}async function ne(e,t,o,r){const i=s(e,"model")??t;if(i==null)throw new $(F.MODEL_NOT_FOUND,"No model is selected.",{category:"model",userMessage:"No model is selected.",hint:_});if(!(await J(o,r)).data.some(n=>n.id===i))throw new $(F.MODEL_NOT_FOUND,`Model is not available: ${i}`,{category:"model",userMessage:`Model is not available: ${i}.`,hint:_});return i}async function re(e,t,o,r,i,a,n,p,u){const d=N(e,"image"),m=await l(p,"image.generate","image generation",()=>r.generateImage({model:o,prompt:d,...j(t)},{signal:u})),c=(await l(p,"image.store","image download and save",()=>q(m,M("image",d,B(t),t),i,a,u))).map(w=>w.path);return E(n,{kind:"media",mediaType:"image",artifacts:c.map(w=>({path:w}))},I("Generated image",c)),0}async function ie(e,t,o,r,i,a,n,p,u,d){const m=N(e,"image edit"),f=await W(O(t,"image"),s(t,"mask"),a),c=await l(u,"image.edit","image edit",()=>r.editImage({model:o,prompt:m,images:[...f.images],...f.mask===void 0?{}:{mask:f.mask},...j(t),...s(t,"input-fidelity")===void 0?{}:{inputFidelity:s(t,"input-fidelity")}},{signal:d})),y=(await l(u,"image.store","image download and save",()=>q(c,M("image",m,B(t),t),i,n,d))).map(g=>g.path);return E(p,{kind:"media",mediaType:"image",artifacts:y.map(g=>({path:g}))},I("Generated image",y)),0}async function ae(e,t,o,r,i,a,n,p){const u=N(e,"speech"),d=s(t,"response-format"),m=s(t,"stream-format"),f={model:o,input:u,voice:O(t,"voice"),...s(t,"instructions")===void 0?{}:{instructions:s(t,"instructions")},...d===void 0?{}:{responseFormat:d},...S(t,"speed")===void 0?{}:{speed:S(t,"speed")},...m===void 0?{}:{streamFormat:m}};if(m==="sse")return await l(n,"audio.speech","speech streaming",async()=>{for await(const h of r.createSpeechStream({...f,streamFormat:"sse"},{signal:p}))await te(a,`${JSON.stringify(h)}
|
|
2
|
+
`)}),0;const c=await l(n,"audio.speech","speech generation",()=>r.createSpeech({...f,streamFormat:"audio"},{signal:p}));C(c.bytes);const w=d??A(c.contentType,"mp3"),g=(await l(n,"audio.store","speech save",()=>i.writeMany(M("speech",u,w,t),[c.bytes]))).map(h=>h.path);return E(a,{kind:"media",mediaType:"audio",artifacts:g.map(h=>({path:h}))},I("Generated speech",g)),0}async function de(e,t,o,r,i,a,n,p,u){const d=await H(O(t,"file"),a),m=s(t,"response-format")??"json",f={model:o,file:d.bytes,filename:d.filename,responseFormat:m,...s(t,"prompt")===void 0?{}:{prompt:s(t,"prompt")},...S(t,"temperature")===void 0?{}:{temperature:S(t,"temperature")},...e==="audio.transcribe"&&s(t,"language")!==void 0?{language:s(t,"language")}:{},...e==="audio.transcribe"?L(t,"timestamp-granularities",["word","segment"]):{},...e==="audio.transcribe"?L(t,"include"):{}},c=await l(p,e,e==="audio.transcribe"?"audio transcription":"audio translation",()=>e==="audio.transcribe"?r.transcribe(f,{signal:u}):r.translate(f,{signal:u})),w=e==="audio.transcribe"?"transcription":"translation",y=await l(p,`${e}.store`,`${w} save`,()=>i.writeMany(M(w,d.sourceName,le(m),t),[Buffer.from(c,"utf8")]));return ge(m)?n.write(`${c}
|
|
3
|
+
Saved ${w}: ${y[0].path}
|
|
4
|
+
`):n.write(I(`${ye(w)} result`,y.map(g=>g.path))),0}async function se(e,t,o,r,i,a,n,p,u,d){const m=N(e,"video"),f=fe(s(t,"parameters")),c=await l(u,"video.create","video generation request",()=>r.createVideo({model:o,prompt:m,...f===void 0?{}:{parameters:f}},{signal:d}));if(c.errorMessage!==void 0)throw V(c);if(n.logger.info("Video generation accepted.",{operationId:c.id,model:o}),p.write(`Video operation: ${c.id}
|
|
5
|
+
`),D(t,"no-wait"))return 0;const w=c.done?c:await l(u,`video.wait:${c.id}`,"video generation",()=>U(r,c.id,a,d));if(w.errorMessage!==void 0)throw V(w);const y=await l(u,`video.download:${c.id}`,"video download",()=>r.downloadVideo(c.id,{signal:d}));C(y.bytes);const g=await l(u,`video.store:${c.id}`,"video save",()=>i.writeMany(M("video",m,A(y.contentType,"mp4"),t),[y.bytes]));n.logger.info("Video artifact stored.",{operationId:c.id,artifactCount:g.length,artifactBytes:z(g)});const h=g.map(x=>x.path);return E(p,{kind:"media",mediaType:"video",artifacts:h.map(x=>({path:x}))},I("Generated video",h)),0}async function ue(e,t,o,r,i,a){const n=await l(i,`video.status:${e}`,"video status",()=>t.getVideoOperation(e,{signal:a}),p=>p.errorMessage!==void 0);if(o.info("Video status retrieved.",{operationId:n.id,status:n.errorMessage===void 0?n.done?"completed":"pending":"failed"}),n.errorMessage!==void 0)throw V(n);return r.write(`Video operation ${n.id}: ${n.done?"COMPLETED":"PENDING"}
|
|
6
|
+
`),0}async function me(e,t,o,r,i,a,n,p){const u=await l(n,`video.download:${e}`,"video download",()=>o.downloadVideo(e,{signal:p}));C(u.bytes);const d=await l(n,`video.store:${e}`,"video save",()=>r.writeMany(M("video",e,A(u.contentType,"mp4"),t),[u.bytes]));i.info("Video artifact downloaded.",{operationId:e,artifactCount:d.length,artifactBytes:z(d)});const m=d.map(f=>f.path);return E(a,{kind:"media",mediaType:"video",artifacts:m.map(f=>({path:f}))},I("Downloaded video",m)),0}function j(e){const t=s(e,"quality"),o=s(e,"background"),r=s(e,"output-format");return{...T(e,"n")===void 0?{}:{n:T(e,"n")},...s(e,"size")===void 0?{}:{size:s(e,"size")},...t===void 0?{}:{quality:t},...o===void 0?{}:{background:o},...r===void 0?{}:{outputFormat:r},...T(e,"output-compression")===void 0?{}:{outputCompression:T(e,"output-compression")},...s(e,"moderation")===void 0?{}:{moderation:s(e,"moderation")},...s(e,"user")===void 0?{}:{user:s(e,"user")}}}function M(e,t,o,r){const i=s(r,"out"),a=s(r,"out-dir");return{kind:e,source:t,extension:o,...i===void 0?{}:{out:i},...a===void 0?{}:{outDir:a},force:D(r,"force")}}async function q(e,t,o,r,i){const a=[];let n=t.extension;for(const p of e){const u=p.base64===void 0?await pe(p.url,r,i):ce(p.base64);a.push(u.bytes),n=we(u.mimeType,n)}return o.writeMany({...t,extension:n},a)}function ce(e){if(!/^[A-Za-z0-9+/]*={0,2}$/u.test(e)||e.length%4!==0)throw b("The provider returned invalid Base64 image data.");const t=Buffer.from(e,"base64");return C(t),k(t,void 0,v)}async function pe(e,t,o){const r=await Q(e,{maxBytes:v,timeoutMs:t,signal:o}),i=k(r.bytes,r.contentType,v);if(!["image/png","image/jpeg","image/webp"].includes(i.mimeType))throw b(`Unsupported generated image format: ${i.mimeType}.`);return i}function N(e,t){const o=e.join(" ").trim();if(o.length===0)throw b(`A prompt is required for ${t}.`);return o}function T(e,t){const o=s(e,t);if(o!==void 0){if(!/^\d+$/u.test(o)||!Number.isSafeInteger(Number(o)))throw b(`--${t} must be an integer.`);return Number(o)}}function S(e,t){const o=s(e,t);if(o===void 0)return;const r=Number(o);if(!Number.isFinite(r))throw b(`--${t} must be a finite number.`);return r}function L(e,t,o){const r=s(e,t);if(r===void 0)return{};const i=r.split(",").map(a=>a.trim()).filter(Boolean);if(i.length===0||o!==void 0&&i.some(a=>!o.includes(a)))throw b(`--${t} contains an unsupported value.`);return t==="timestamp-granularities"?{timestampGranularities:i}:{include:i}}function fe(e){if(e!==void 0)try{const t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))throw new Error;return t}catch{throw b("--parameters must be a JSON object.")}}function B(e){return s(e,"output-format")??"png"}function we(e,t){return e==="image/jpeg"?"jpeg":e==="image/webp"?"webp":e==="image/png"?"png":t}function A(e,t){const o=e?.toLowerCase();return o==="audio/mpeg"?"mp3":o==="audio/ogg"?"opus":o==="audio/aac"?"aac":o==="audio/flac"?"flac":o==="audio/wav"||o==="audio/x-wav"?"wav":o==="video/webm"?"webm":o==="video/quicktime"?"mov":o==="video/mp4"?"mp4":t}function le(e){return e==="text"?"txt":e==="verbose_json"||e==="diarized_json"?"json":e}function ge(e){return e==="text"||e==="srt"||e==="vtt"}function C(e){if(e.byteLength===0||e.byteLength>v)throw b("Generated media exceeds the supported binary output limit.")}function I(e,t){return`${e}${t.length===1?"":"s"} saved:
|
|
7
|
+
${t.map(o=>` ${o}`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
`}function ye(e){return`${e[0]?.toUpperCase()??""}${e.slice(1)}`}function z(e){return e.reduce((t,o)=>t+o.bytes,0)}function b(e){return new $(F.INVALID_ARGUMENT,e,{category:"media",userMessage:e})}function V(e){return new $("MEDIA_VIDEO_FAILED",`Video operation failed: ${e.id}`,{category:"media",userMessage:e.errorMessage??`Video operation failed: ${e.id}`})}async function l(e,t,o,r,i=()=>!1){const a=e?.start(t,o);try{const n=await r();return a?.complete(i(n)),n}catch(n){throw a?.complete(!0),n}}export{De as runMediaCommand};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CommandOutput } from './command-output.js';
|
|
2
|
+
export type MediaArtifactType = 'image' | 'audio' | 'video';
|
|
3
|
+
export interface MediaCommandResult {
|
|
4
|
+
readonly kind: 'media';
|
|
5
|
+
readonly mediaType: MediaArtifactType;
|
|
6
|
+
readonly artifacts: readonly {
|
|
7
|
+
readonly path: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
/** Keeps normal CLI output text while exposing media metadata to Desktop protocol callers. */
|
|
11
|
+
export declare function writeMediaCommandResult(output: CommandOutput, result: MediaCommandResult, fallbackText: string): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(e,i,r){if(e.writeStructured===void 0){e.write(r);return}e.writeStructured(i,r)}export{t as writeMediaCommandResult};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CliRuntime } from '../../bootstrap/runtime-factory.js';
|
|
2
|
+
import type { MemoryBundle, MemoryRecord } from '../../domain/memory/memory.js';
|
|
3
|
+
import type { CommandOutput } from './command-output.js';
|
|
4
|
+
export type MemoryCommandPayload = {
|
|
5
|
+
readonly kind: 'memory.list';
|
|
6
|
+
readonly items: readonly MemoryRecord[];
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'memory.show';
|
|
9
|
+
readonly item: MemoryRecord;
|
|
10
|
+
} | {
|
|
11
|
+
readonly kind: 'memory.forget';
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly forgotten: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: 'memory.clear';
|
|
16
|
+
readonly cleared: number;
|
|
17
|
+
} | {
|
|
18
|
+
readonly kind: 'memory.export';
|
|
19
|
+
readonly bundle: MemoryBundle;
|
|
20
|
+
readonly outputPath?: string;
|
|
21
|
+
} | {
|
|
22
|
+
readonly kind: 'memory.import.preview';
|
|
23
|
+
readonly records: number;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'memory.import';
|
|
26
|
+
readonly imported: number;
|
|
27
|
+
readonly skipped: number;
|
|
28
|
+
};
|
|
29
|
+
export declare function runMemoryCommand(positionals: readonly string[], flags: ReadonlyMap<string, string | boolean>, runtime: CliRuntime, cwd: string, output: CommandOutput): Promise<number>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{isMemoryState as l}from"../../domain/memory/memory.js";import{isMemoryKind as p,MEMORY_KINDS as f}from"../../domain/memory/memory-kinds.js";import{CliError as s}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../../domain/errors/error-codes.js";import{assertExternalWriteTarget as $,resolveExternalOutputPath as w,resolveExternalPath as M}from"../../infrastructure/filesystem/path-resolver.js";import{atomicWriteFile as h}from"../../infrastructure/filesystem/atomic-file-store.js";import{readJsonFileBounded as g}from"../../infrastructure/filesystem/bounded-json-reader.js";import{RESOURCE_LIMITS as k}from"../../domain/runtime/resource-limits.js";import{formatCompactTable as v}from"../formatting/compact-table.js";import{getStringFlag as u,isFlagEnabled as R,requirePositional as c,requireStringFlag as E}from"./cli-args.js";async function V(e,r,t,n,a){const i=e[0]??"list";if(i==="list")return I(await t.memory.list(n,T(r)),a);if(i==="forget"){const o=c(e,1,"memory id"),y=await t.memory.forget(n,o);return m(a,{kind:"memory.forget",id:o,forgotten:y},y?`Forgot memory: ${o}
|
|
2
|
+
`:`Memory not found: ${o}
|
|
3
|
+
`)}if(i==="show")return N(await O(t,n,c(e,1,"memory id")),a);if(i==="clear"){const o=await t.memory.clear(n);return m(a,{kind:"memory.clear",cleared:o},`Cleared ${o} memor${o===1?"y":"ies"}.
|
|
4
|
+
`)}if(i==="export")return S(t,n,r,a);if(i==="import")return x(t,n,r,a);throw new s(d.INVALID_ARGUMENT,`Unsupported memory action: ${i}`,{category:"memory",userMessage:`Unsupported memory action: ${i}`})}async function S(e,r,t,n){const a=await e.memory.export(r),i=u(t,"out");if(i===void 0)return m(n,{kind:"memory.export",bundle:a},`${JSON.stringify(a,null,2)}
|
|
5
|
+
`);const o=await w(i,{cwd:r});return await $(o),await h(o,`${JSON.stringify(a,null,2)}
|
|
6
|
+
`),m(n,{kind:"memory.export",bundle:a,outputPath:o},`Exported ${a.records.length} memories: ${o}
|
|
7
|
+
`)}async function x(e,r,t,n){const a=await M(E(t,"file"),{cwd:r}),i=await e.memory.previewImport(await g(a,k.memoryBundleBytes));if(!R(t,"apply"))return m(n,{kind:"memory.import.preview",records:i.records.length},`Validated ${i.records.length} memories. Re-run with --apply to import.
|
|
8
|
+
`);const o=await e.memory.import(r,i);return m(n,{kind:"memory.import",...o},`Imported ${o.imported} memories; skipped ${o.skipped}.
|
|
9
|
+
`)}function I(e,r){const t=`${v(e.map(n=>({name:n.statement,status:n.kind.toUpperCase(),detail:`${n.id} \xB7 ${n.state} \xB7 ${n.lastRetrievedAt??"never retrieved"}`})),{columns:[{key:"name",header:"Memory",minWidth:4,maxWidth:28},{key:"status",header:"Type",minWidth:4,maxWidth:16},{key:"detail",header:"Details",minWidth:12}],empty:"No memories found."})}
|
|
10
|
+
`;return m(r,{kind:"memory.list",items:e},t)}function N(e,r){const t=[`Memory ${e.id}`,`Type: ${e.kind}`,`Statement: ${e.statement}`,`State: ${e.state}`,`Source: ${e.source}`,`Topics: ${e.topics.length===0?"none":e.topics.join(", ")}`,...e.rationale===void 0?[]:[`Rationale: ${e.rationale}`],`Evidence: ${e.evidenceRefs.length===0?"none":e.evidenceRefs.join(", ")}`,`Retrievals: ${e.retrievalCount}${e.lastRetrievedAt===void 0?"":` \xB7 last retrieved ${e.lastRetrievedAt}`}`].join(`
|
|
11
|
+
`).concat(`
|
|
12
|
+
`);return m(r,{kind:"memory.show",item:e},t)}function m(e,r,t){return e.writeStructured!==void 0?e.writeStructured(r,t):e.write(t),0}async function O(e,r,t){const n=await e.memory.get(r,t);if(n!==void 0)return n;throw new s(d.MEMORY_NOT_FOUND,`Memory not found: ${t}`,{category:"memory",userMessage:`Memory not found: ${t}`})}function T(e){const r=A(e),t=C(e);return{...r===void 0?{}:{kind:r},...t===void 0?{}:{state:t}}}function A(e){const r=u(e,"kind");if(r!==void 0){if(p(r))return r;throw new s(d.INVALID_ARGUMENT,`Memory kind must be one of: ${f.join(", ")}.`,{category:"memory",userMessage:`Memory kind must be one of: ${f.join(", ")}.`})}}function C(e){const r=u(e,"state");if(r!==void 0){if(l(r))return r;throw new s(d.INVALID_ARGUMENT,"Invalid memory state.",{category:"memory",userMessage:"Memory state must be active, superseded, or expired."})}}export{V as runMemoryCommand};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CommandOutput } from './command-output.js';
|
|
2
|
+
import type { createCompositionRoot } from '../../bootstrap/composition-root.js';
|
|
3
|
+
type CliRuntime = ReturnType<typeof createCompositionRoot>;
|
|
4
|
+
export declare function runSessionCommand(positionals: readonly string[], flags: ReadonlyMap<string, string | boolean>, runtime: CliRuntime, cwd: string, stdout: CommandOutput, resumeInteractive?: (sessionId: string) => Promise<number>, signal?: AbortSignal): Promise<number>;
|
|
5
|
+
export declare function runChatCommand(positionals: readonly string[], runtime: CliRuntime, cwd: string, stdout: CommandOutput, parentSignal?: AbortSignal): Promise<number>;
|
|
6
|
+
export declare function runExecCommand(positionals: readonly string[], flags: ReadonlyMap<string, string | boolean>, runtime: CliRuntime, cwd: string, stdout: CommandOutput, parentSignal?: AbortSignal): Promise<number>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{Writable as k}from"node:stream";import{AuthenticationService as M}from"../auth/authentication-service.js";import{ChatService as G}from"../chat/chat-service.js";import{createLotaGateClient as _}from"../../infrastructure/sdk/lotagate-client-factory.js";import{SdkChatCompletionAdapter as F}from"../../infrastructure/sdk/chat-completion-adapter.js";import{CliError as u}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as w}from"../../domain/errors/error-codes.js";import{MODEL_SELECT_HINT as $}from"./command-hints.js";import{createImageAttachment as P,DEFAULT_MAX_IMAGE_BYTES as D,normalizeImage as q}from"../../infrastructure/clipboard/image-normalizer.js";import{readJsonFileBounded as B}from"../../infrastructure/filesystem/bounded-json-reader.js";import{readFileBounded as J}from"../../infrastructure/filesystem/bounded-file-reader.js";import{RESOURCE_LIMITS as T}from"../../domain/runtime/resource-limits.js";import{ProjectSessionAccess as U}from"../session/project-session-access.js";import{compactStoredSession as j}from"../session/session-compaction-service.js";import{requirePositional as z,getFlag as v,isFlagEnabled as N,requireStringFlag as H}from"./cli-args.js";import{resolveExternalPath as W,resolveWorkspacePath as x}from"../../infrastructure/filesystem/path-resolver.js";import{atomicWriteFile as K}from"../../infrastructure/filesystem/atomic-file-store.js";import{loadExecutionConfig as R}from"../config/execution-config.js";import{runHeadlessAgentTurn as V}from"../orchestration/headless-agent-turn.js";import{writeStreamChunk as E}from"./stream-output.js";import{formatCompactTable as X}from"../formatting/compact-table.js";import{createCommandAbortController as L,throwIfCommandAborted as C}from"./command-cancellation.js";async function Se(g,s,o,a,r,d,m){C(m);const i=g[0]??"list",l=await o.projectTrust.inspect(a);if(i==="list"){const t=await o.sessionStore.list(l.fingerprint);return r.write(`${X(t.map(n=>({name:n.name??n.id,status:n.status.toUpperCase(),detail:`${n.id} \xB7 ${n.model??"no model"} \xB7 ${n.updatedAt}`})),{empty:"No sessions found."})}
|
|
2
|
+
`),0}if(i==="import"){const t=H(s,"file"),n=await x(t,{cwd:a,workspaceRoot:a}),f=await B(n,T.sessionBundleBytes),c=await o.sessionStore.import(f,l.fingerprint,a);return r.write(`${JSON.stringify(c,null,2)}
|
|
3
|
+
`),0}const e=z(g,1,"session id"),p=await new U(o.sessionStore).require(e,l.fingerprint);if(i==="show")return r.write(`${JSON.stringify({metadata:p,transcript:await o.sessionStore.readTranscript(e)},null,2)}
|
|
4
|
+
`),0;if(i==="resume"){if(N(s,"interactive")){if(!(r instanceof k))throw new Error("Interactive session resume requires a terminal output stream.");if(d===void 0)throw new Error("Interactive session resume is unavailable in this command host.");return d(e)}return r.write(`${JSON.stringify({metadata:p,transcript:await o.sessionStore.readTranscript(e),resumable:p.status!=="active"},null,2)}
|
|
5
|
+
`),0}if(i==="fork"){const t=await o.sessionStore.fork(e);return r.write(`${JSON.stringify(t,null,2)}
|
|
6
|
+
`),0}if(i==="compact"){if(g.length>2)throw new u(w.INVALID_ARGUMENT,"Compaction does not accept a summary.",{category:"session",userMessage:"The compact command does not accept a summary. It summarizes the session automatically."});const t=await j(o,a,e);return r.write(`${t.compacted?`Compacted session: ${e}`:`No conversation to compact: ${e}`}
|
|
7
|
+
`),0}if(i==="export"){const t=await o.sessionStore.export(e),n=v(s,"out"),f=`${JSON.stringify(t,null,2)}
|
|
8
|
+
`;if(typeof n=="string"&&n.trim().length>0){const c=await x(n,{cwd:a,workspaceRoot:a},!0);await K(c,f),r.write(`Exported session: ${c}
|
|
9
|
+
`)}else r.write(f);return 0}if(i==="recover")return r.write(`${JSON.stringify({sessionId:e,recovered:await o.sessionStore.recoverStaleLock(e)})}
|
|
10
|
+
`),0;if(i==="repair")return r.write(`${JSON.stringify(await o.sessionStore.repair(e))}
|
|
11
|
+
`),0;if(i==="delete"){await o.executionWorkspaces?.remove(e);const t=await o.sessionStore.delete(e);return r.write(`${t?`Deleted session: ${e}`:`Session not found: ${e}`}
|
|
12
|
+
`),t?0:1}throw new Error(`Unsupported session action: ${i}`)}async function Te(g,s,o,a,r){C(r);const d=g.join(" ").trim();if(d.length===0)return a.write('Interactive prompt editor requires a terminal. Run `lotagate` in a terminal or use `lotagate chat "prompt"` for streaming.\n'),0;const m=await R(s,o);if(m.config.model===null)throw new u(w.MODEL_NOT_FOUND,"No model is selected.",{category:"model",userMessage:"No model is selected.",hint:$});const i=m.config.profile??M.defaultProfileName(),l=await s.auth.requireCredential(i),e=_(l.profile,l.apiKey),p=L(r),t=p.controller,n=()=>t.abort();process.once("SIGINT",n);try{const f=new G(new F(e));for await(const c of f.stream(m.config.model,d,{reasoningEffort:m.config.effort,signal:t.signal}))c.type==="delta"&&await E(a,c.content);return await E(a,`
|
|
13
|
+
`),0}finally{process.off("SIGINT",n),p.dispose()}}async function Ne(g,s,o,a,r,d){C(d);const m=g.join(" ").trim();if(m.length===0)throw new u(w.MISSING_ARGUMENT,"Missing prompt.",{category:"arguments",userMessage:"A prompt is required for exec."});const i=await R(o,a);if(i.config.model===null)throw new u(w.MODEL_NOT_FOUND,"No model is selected.",{category:"model",userMessage:"No model is selected.",hint:$});const l=i.config.profile??M.defaultProfileName(),e=await o.auth.requireCredential(l),p=v(s,"image"),t=[];let n=0;if(typeof p=="string")for(const[h,O]of p.split(",").map(y=>y.trim()).filter(Boolean).entries()){if(t.length>=T.pendingAttachments)throw new u(w.ATTACHMENT_TOO_LARGE,"Too many images were supplied.",{category:"attachment",userMessage:"Too many images were supplied. Reduce the image list and retry."});const y=await W(O,{cwd:a}),b=await J(y,D);if(b.truncated)throw new u(w.ATTACHMENT_TOO_LARGE,"Image exceeds the supported size.",{category:"attachment",userMessage:"An image exceeds the supported size limit."});const S=q(b.bytes);if(n+=S.bytes.byteLength,n>T.pendingAttachmentTotalBytes)throw new u(w.ATTACHMENT_TOO_LARGE,"Image attachment total exceeds the supported limit.",{category:"attachment",userMessage:"The combined image size is too large. Reduce the image list and retry."});t.push({attachment:P(S,"file",`image-${h+1}`,O),bytes:S.bytes})}const f=N(s,"json")||N(s,"jsonl"),c=L(d),I=c.controller,A=()=>I.abort();process.once("SIGINT",A);try{const h=_(e.profile,e.apiKey);return await V({runtime:o,cwd:a,model:i.config.model,profileName:l,reasoningEffort:i.config.effort,client:h,prompt:m,...t.length===0?{}:{attachments:t},output:r,json:f,signal:I.signal}),f||await E(r,`
|
|
14
|
+
`),0}finally{process.off("SIGINT",A),c.dispose()}}export{Te as runChatCommand,Ne as runExecCommand,Se as runSessionCommand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{once as e}from"node:events";async function a(n,r){n.write(r)!==!1||!i(n)||await e(n,"drain")}function i(n){return typeof n.once=="function"}export{a as writeStreamChunk};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CliRuntime } from '../../bootstrap/runtime-factory.js';
|
|
2
|
+
import type { CommandOutput } from './command-output.js';
|
|
3
|
+
export declare function runDoctorCommand(runtime: CliRuntime, cwd: string, stdout: CommandOutput): Promise<number>;
|
|
4
|
+
export declare function runInspectCommand(runtime: CliRuntime, cwd: string, stdout: CommandOutput): Promise<number>;
|
|
5
|
+
export declare function runCompletionsCommand(positionals: readonly string[], stdout: CommandOutput): Promise<number>;
|
|
6
|
+
export declare function runUpdateCommand(positionals: readonly string[], runtime: CliRuntime, cwd: string, stdout: CommandOutput): Promise<number>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{CLI_ERROR_CODES as m}from"../../domain/errors/error-codes.js";import{CliError as u}from"../../domain/errors/cli-error.js";import{CLI_VERSION as p}from"../../version.js";import f from"node:path";import{AuthenticationService as g}from"../auth/authentication-service.js";import{loadExecutionConfig as d}from"../config/execution-config.js";import{formatCompactTable as h}from"../formatting/compact-table.js";import{COMMAND_REGISTRY as w}from"./command-runtime.js";async function E(t,o,n){const r=await d(t,o),a=await t.projectTrust.inspect(o),e=r.config.profile??g.defaultProfileName(),c=await t.credentialStore.get(e),l=[{name:"node",ok:Number(process.versions.node.split(".")[0])>=22,detail:process.version},{name:"cwd",ok:f.isAbsolute(o),detail:o},{name:"config",ok:!0,detail:`${r.sources.length} file(s) loaded`},{name:"auth",ok:c!==void 0,detail:c===void 0?`profile ${e} is not configured`:`profile ${e} configured`},{name:"project-trust",ok:await t.projectTrust.isTrusted(a),detail:a.canonicalPath}],s=l.every(i=>i.ok);return n.write(`Doctor \xB7 ${s?"OK":"FAIL"}
|
|
2
|
+
${h(l.map(i=>({name:i.name,status:i.ok?"OK":"FAIL",detail:i.detail})))}
|
|
3
|
+
`),s?0:1}async function b(t,o,n){return n.write(`${JSON.stringify(await t.projectTrust.inspect(o),null,2)}
|
|
4
|
+
`),0}async function v(t,o){const n=t[0]??"powershell",r=C(),a=r.join(" "),e=r.map(s=>`"${s}"`).join(","),l={bash:`_lotagate_complete() { COMPREPLY=( $(compgen -W "${a}" -- "\${COMP_WORDS[COMP_CWORD]}") ); }; complete -F _lotagate_complete lotagate
|
|
5
|
+
`,zsh:`#compdef lotagate
|
|
6
|
+
_arguments "1:command:(${a})"
|
|
7
|
+
`,powershell:`Register-ArgumentCompleter -CommandName lotagate -ScriptBlock { param($wordToComplete) ${e} | Where-Object { $_ -like "$wordToComplete*" } }
|
|
8
|
+
`}[n];if(l===void 0)throw new u(m.INVALID_ARGUMENT,`Unsupported shell: ${n}`,{category:"arguments",userMessage:"Unsupported shell. Choose bash, zsh, or powershell."});return o.write(l),0}function C(){return[...new Set(w.list("direct").map(t=>t.path[0]))]}async function I(t,o,n,r){if((t[0]??"check")!=="check")throw new u(m.INVALID_ARGUMENT,"Unsupported update action.",{category:"update",userMessage:"Only `lotagate update check` is supported."});const a=await d(o,n),e=process.env.LOTAGATE_NPM_REGISTRY?.trim()||"https://registry.npmjs.org",c=new AbortController,l=setTimeout(()=>c.abort(),3e3);try{const s=await fetch(`${e.replace(/\/$/u,"")}/@lotagate%2fcli/latest`,{signal:c.signal,headers:{accept:"application/json"}});if(!s.ok)throw new Error(`Registry returned HTTP ${s.status}.`);const i=await s.json();if(typeof i.version!="string"||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u.test(i.version))throw new Error("Registry response did not contain a valid version.");r.write(`${JSON.stringify({currentVersion:p,latestVersion:i.version,channel:a.config.updateChannel,updateAvailable:y(i.version,p)>0,installation:"manual"},null,2)}
|
|
9
|
+
`)}catch(s){r.write(`${JSON.stringify({currentVersion:p,channel:a.config.updateChannel,checked:!1,reason:s instanceof Error?s.message:"Unable to query the registry.",installation:"manual"},null,2)}
|
|
10
|
+
`)}finally{clearTimeout(l)}return 0}function y(t,o){const n=e=>(e.split("-")[0]??"").split(".").map(c=>Number(c)),r=n(t),a=n(o);for(let e=0;e<3;e+=1)if((r[e]??0)!==(a[e]??0))return(r[e]??0)-(a[e]??0);return 0}export{v as runCompletionsCommand,E as runDoctorCommand,b as runInspectCommand,I as runUpdateCommand};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { createCompositionRoot } from '../../bootstrap/composition-root.js';
|
|
2
|
+
import type { ConfigLoadResult } from '../../infrastructure/config/config-loader.js';
|
|
3
|
+
/** Loads project configuration only after the project trust boundary is known. */
|
|
4
|
+
export declare function loadExecutionConfig(runtime: ReturnType<typeof createCompositionRoot>, cwd: string): Promise<ConfigLoadResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function n(t,o){const c=await t.projectTrust.inspect(o),e=await t.projectTrust.isTrusted(c);return t.configLoader.load(o,{includeProject:e})}export{n as loadExecutionConfig};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ExtensionScope } from '../../domain/extensions/extension-scope.js';
|
|
2
|
+
export type ExtensionListKind = 'hook' | 'skill' | 'plugin' | 'mcp';
|
|
3
|
+
export type ExtensionListScope = ExtensionScope | 'plugin' | 'builtin';
|
|
4
|
+
export interface ExtensionListItem {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly displayName?: string;
|
|
7
|
+
readonly status: string;
|
|
8
|
+
readonly detail: string;
|
|
9
|
+
readonly description?: string;
|
|
10
|
+
readonly version?: string;
|
|
11
|
+
readonly scope?: ExtensionListScope;
|
|
12
|
+
readonly pluginName?: string;
|
|
13
|
+
readonly sourceName?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ExtensionListResult {
|
|
16
|
+
readonly kind: ExtensionListKind;
|
|
17
|
+
readonly items: readonly ExtensionListItem[];
|
|
18
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HookDefinition } from '../../domain/extensions/hook-manifest.js';
|
|
2
|
+
import type { CliMcpConfig, CliMcpServerConfig } from '../../domain/extensions/mcp-config.js';
|
|
3
|
+
import type { InstalledPlugin } from '../../infrastructure/extensions/plugin-manager.js';
|
|
4
|
+
import type { ScopedSkill } from '../../infrastructure/extensions/skill-manager.js';
|
|
5
|
+
import type { ExtensionScope } from '../../domain/extensions/extension-scope.js';
|
|
6
|
+
import type { ExtensionListScope } from './extension-list-contract.js';
|
|
7
|
+
import type { ExtensionListResult } from './extension-list-contract.js';
|
|
8
|
+
export declare function formatMcpList(entries: readonly {
|
|
9
|
+
scope: ExtensionListScope;
|
|
10
|
+
config: CliMcpConfig;
|
|
11
|
+
pluginName?: string;
|
|
12
|
+
sourceNames?: Readonly<Record<string, string>>;
|
|
13
|
+
pluginNames?: Readonly<Record<string, string>>;
|
|
14
|
+
}[]): string;
|
|
15
|
+
export declare function createMcpListResult(entries: readonly {
|
|
16
|
+
scope: ExtensionListScope;
|
|
17
|
+
config: CliMcpConfig;
|
|
18
|
+
pluginName?: string;
|
|
19
|
+
sourceNames?: Readonly<Record<string, string>>;
|
|
20
|
+
pluginNames?: Readonly<Record<string, string>>;
|
|
21
|
+
}[]): ExtensionListResult;
|
|
22
|
+
export declare function formatExtensionList(result: ExtensionListResult): string;
|
|
23
|
+
export declare function formatMcpDetails(name: string, scope: ExtensionScope, entry: {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
config: CliMcpServerConfig;
|
|
26
|
+
} | undefined): string;
|
|
27
|
+
export declare function formatPluginList(entries: readonly {
|
|
28
|
+
scope: ExtensionScope;
|
|
29
|
+
plugins: readonly InstalledPlugin[];
|
|
30
|
+
}[]): string;
|
|
31
|
+
export declare function createPluginListResult(entries: readonly {
|
|
32
|
+
scope: ExtensionScope;
|
|
33
|
+
plugins: readonly InstalledPlugin[];
|
|
34
|
+
}[]): ExtensionListResult;
|
|
35
|
+
export declare function formatSkillList(skills: readonly ScopedSkill[]): string;
|
|
36
|
+
export declare function createSkillListResult(skills: readonly ScopedSkill[]): ExtensionListResult;
|
|
37
|
+
export declare function formatHookList(hooks: readonly HookDefinition[]): string;
|
|
38
|
+
export declare function createHookListResult(hooks: readonly HookDefinition[]): ExtensionListResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{formatCompactTable as m}from"../formatting/compact-table.js";const E=240,N=280;function S(e){return u(D(e))}function D(e){return{kind:"mcp",items:e.flatMap(({scope:n,config:a,pluginName:i,sourceNames:o,pluginNames:c})=>Object.entries(a).map(([d,L])=>({name:d,scope:n,entry:L,pluginName:c?.[d]??i,sourceName:o?.[d]}))).sort((n,a)=>n.name.localeCompare(a.name)||n.scope.localeCompare(a.scope)).map(({name:n,scope:a,entry:i,pluginName:o,sourceName:c})=>({name:n,status:i.enabled?"ENABLED":"DISABLED",detail:`${a} \xB7 ${A(i.config)}`,scope:a,...o===void 0?{}:{pluginName:o},...c===void 0?{}:{sourceName:c}}))}}function u(e){return e.kind==="mcp"?m(e.items,{empty:"No MCP servers configured."}):e.kind==="plugin"?m(e.items,{empty:"No plugins installed."}):e.kind==="skill"?m(e.items,{empty:"No skills available.",maxWidth:N}):m(e.items,{empty:"No hooks are loaded. Hooks require a trusted project."})}function T(e,t,n){if(n===void 0)return`MCP server not found: ${e}.`;const a=n.config.type==="stdio"?{type:p(n.config),command:r(n.config.command),args:n.config.args?.map(r)??[],credentials:f(n.config)}:{type:p(n.config),url:l(n.config.url),credentials:f(n.config)};return JSON.stringify({name:e,scope:t,enabled:n.enabled,...a})}function $(e){return u(g(e))}function g(e){return{kind:"plugin",items:e.flatMap(({scope:n,plugins:a})=>a.map(i=>({scope:n,plugin:i}))).sort((n,a)=>n.plugin.manifest.name.localeCompare(a.plugin.manifest.name)||n.scope.localeCompare(a.scope)).map(({scope:n,plugin:a})=>({name:a.manifest.name,...a.manifest.displayName===void 0?{}:{displayName:a.manifest.displayName},status:a.enabled?"ENABLED":"DISABLED",detail:`${n} \xB7 v${a.manifest.version}`,version:a.manifest.version,...a.manifest.description===void 0?{}:{description:a.manifest.description},scope:n}))}}function R(e){return u(y(e))}function y(e){return{kind:"skill",items:[...e].sort((t,n)=>t.skillKey.localeCompare(n.skillKey)).map(t=>({name:t.skillKey,status:t.enabled?"ENABLED":"DISABLED",detail:`${t.scope} \xB7 ${s(r(t.description),E)}`,scope:t.scope,...t.pluginName===void 0?{}:{pluginName:t.pluginName,sourceName:t.name}}))}}function x(e){return u(C(e))}function C(e){return{kind:"hook",items:[...e].sort((t,n)=>t.id.localeCompare(n.id)).map(t=>({name:t.id,status:t.event,detail:`${s(r([t.command,...t.args].join(" ")),160)} \xB7 ${t.timeoutMs}ms`,...t.scope===void 0?{}:{scope:t.scope},...t.pluginName===void 0?{}:{pluginName:t.pluginName,sourceName:t.sourceName}}))}}function A(e){return e.type==="stdio"?s(r([e.command,...e.args??[]].join(" ")),160):`${e.type} \xB7 ${l(e.url)}`}function p(e){return e.type}function f(e){return e.type==="stdio"?e.env!==void 0&&Object.keys(e.env).length>0:e.auth!==void 0||e.headers!==void 0&&Object.keys(e.headers).length>0||/(?:key|token|secret|password|auth)=/iu.test(e.url)}function l(e){try{const t=new URL(e);for(const n of t.searchParams.keys())/(key|token|secret|password|auth)/iu.test(n)&&t.searchParams.set(n,"[REDACTED]");return s(t.toString(),180)}catch{return s(r(e),180)}}function r(e){return e.replace(/Bearer\s+[^\s]+/giu,"Bearer [REDACTED]").replace(/sk-[A-Za-z0-9_-]{8,}/gu,"[REDACTED]").replace(/(api[_-]?key|password|secret|token)\s*[:=]\s*[^\s,]+/giu,"$1=[REDACTED]")}function s(e,t){return e.length<=t?e:`${e.slice(0,t-3)}...`}export{C as createHookListResult,D as createMcpListResult,g as createPluginListResult,y as createSkillListResult,u as formatExtensionList,x as formatHookList,T as formatMcpDetails,S as formatMcpList,$ as formatPluginList,R as formatSkillList};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type CliMcpConfig } from '../../domain/extensions/mcp-config.js';
|
|
2
|
+
import { type PluginManifest } from '../../domain/extensions/plugin-manifest.js';
|
|
3
|
+
import type { PluginSkillRoot } from '../../infrastructure/extensions/skill-roots.js';
|
|
4
|
+
import type { PluginAgentDefinition } from '../../domain/extensions/plugin-agent-manifest.js';
|
|
5
|
+
export interface PluginContributions {
|
|
6
|
+
plugins: readonly PluginManifest[];
|
|
7
|
+
skillRoots: readonly PluginSkillRoot[];
|
|
8
|
+
mcpConfig: CliMcpConfig;
|
|
9
|
+
mcpContributions: readonly PluginMcpContribution[];
|
|
10
|
+
agents: readonly PluginAgentContribution[];
|
|
11
|
+
}
|
|
12
|
+
export interface PluginAgentContribution {
|
|
13
|
+
readonly pluginName: string;
|
|
14
|
+
readonly definition: PluginAgentDefinition;
|
|
15
|
+
}
|
|
16
|
+
export interface PluginMcpContribution {
|
|
17
|
+
readonly pluginName: string;
|
|
18
|
+
readonly sourceName: string;
|
|
19
|
+
readonly qualifiedName: string;
|
|
20
|
+
}
|
|
21
|
+
/** Resolves only enabled, trusted declarative plugin contributions. */
|
|
22
|
+
export declare class PluginContributionRegistry {
|
|
23
|
+
private readonly globalConfigDirectory;
|
|
24
|
+
constructor(globalConfigDirectory: string);
|
|
25
|
+
resolve(cwd: string, trustedProject: boolean): Promise<PluginContributions>;
|
|
26
|
+
}
|
|
27
|
+
export declare function loadPluginMcpConfig(plugins: readonly PluginManifest[]): Promise<{
|
|
28
|
+
config: CliMcpConfig;
|
|
29
|
+
contributions: readonly PluginMcpContribution[];
|
|
30
|
+
}>;
|
|
31
|
+
export declare function mergeMcpConfigContributions(...configs: readonly CliMcpConfig[]): CliMcpConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import a from"node:path";import h from"node:fs/promises";import{createHash as y}from"node:crypto";import{mergeMcpConfigs as w,validateMcpConfig as M}from"../../domain/extensions/mcp-config.js";import{CliError as p}from"../../domain/errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../../domain/errors/error-codes.js";import{PLUGIN_LAYOUT as m}from"../../domain/extensions/plugin-manifest.js";import{PluginManager as C}from"../../infrastructure/extensions/plugin-manager.js";import{readJsonFileBounded as P}from"../../infrastructure/filesystem/bounded-json-reader.js";import{RESOURCE_LIMITS as b}from"../../domain/runtime/resource-limits.js";import{isFileNotFound as _}from"../../infrastructure/filesystem/fs-errors.js";import{PluginAgentDiscovery as $}from"../../infrastructure/extensions/plugin-agent-discovery.js";class G{globalConfigDirectory;constructor(e){this.globalConfigDirectory=e}async resolve(e,i){if(!i)return{plugins:[],skillRoots:[],mcpConfig:{},mcpContributions:[],agents:[]};const s=a.join(this.globalConfigDirectory,"plugins"),f=a.join(e,".lotagate","plugins"),n=I([...await new C(f).list(),...await new C(s).list()]).filter(t=>t.enabled).map(t=>t.manifest),r=await j(n),g=(await Promise.all(n.map(async t=>(await new $().discover(a.join(t.directory,m.agentsDirectory))).map(l=>({pluginName:t.name,definition:l}))))).flat();return{plugins:n,skillRoots:n.map(t=>({root:a.join(t.directory,m.skillsDirectory),pluginName:t.name})),mcpConfig:r.config,mcpContributions:r.contributions,agents:g}}}function I(o){const e=new Set;return o.filter(i=>e.has(i.manifest.name)?!1:(e.add(i.manifest.name),!0))}async function j(o){const e={},i=[];for(const s of o){const f=a.join(s.directory,m.mcpDirectory);let c;try{c=(await h.readdir(f,{withFileTypes:!0})).filter(n=>n.isFile()&&n.name.endsWith(".json")).map(n=>a.join(f,n.name)).sort()}catch(n){if(_(n))continue;throw n}for(const n of c){const r=a.basename(n,".json");if(!/^[a-z0-9][a-z0-9-]{0,63}$/u.test(r))throw u(r);const t=M({[r]:await P(n,b.mcpConfigBytes)})[r];if(t===void 0)throw u(r);const l=v(s.name,r);if(e[l]!==void 0)throw u(l);e[l]=t,i.push({pluginName:s.name,sourceName:r,qualifiedName:l})}}return{config:e,contributions:i}}function v(o,e){const i=o.replace(/^@/u,"").replace("/","_"),s=`plugin_${i}_${e}`;if(s.length<=64)return s;const c=`_${y("sha256").update(`${o}\0${e}`).digest("hex").slice(0,12)}_${e.slice(0,8)}`,n=Math.max(1,57-c.length);return`plugin_${i.slice(0,n)}${c}`}function U(...o){try{return w(...o)}catch(e){if(e instanceof p&&e.code===d.MCP_CONFIG_INVALID){const i=e.message.replace(/^Invalid MCP configuration: /u,"");throw u(i.replace(/\.$/u,"").replace(/^MCP server is defined more than once: /u,""))}throw e}}function u(o){return new p(d.MCP_CONFIG_INVALID,`Multiple MCP contributions define server: ${o}`,{category:"extension",userMessage:`MCP server \`${o}\` is defined more than once. Rename or remove one contribution.`})}export{G as PluginContributionRegistry,j as loadPluginMcpConfig,U as mergeMcpConfigContributions};
|