@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,46 @@
|
|
|
1
|
+
import type { Writable } from 'node:stream';
|
|
2
|
+
import { ConfigLoader } from '../infrastructure/config/config-loader.js';
|
|
3
|
+
import { type PlatformPaths } from '../infrastructure/platform/platform-paths.js';
|
|
4
|
+
import type { Logger } from '../ports/logger.js';
|
|
5
|
+
import type { CredentialStore } from '../ports/credential-store.js';
|
|
6
|
+
import { AuthenticationService } from '../application/auth/authentication-service.js';
|
|
7
|
+
import { ProjectTrustService } from '../application/project/project-trust-service.js';
|
|
8
|
+
import type { ProjectTrustStore } from '../ports/project-trust-store.js';
|
|
9
|
+
import { type ShutdownManager } from './shutdown-manager.js';
|
|
10
|
+
import type { SessionStore } from '../ports/session-store.js';
|
|
11
|
+
import { WorkspaceSettingsStore } from '../infrastructure/workspace/workspace-settings-store.js';
|
|
12
|
+
import type { CacheStore } from '../ports/cache-store.js';
|
|
13
|
+
import { type CachePolicy } from '../infrastructure/cache/cache-policy.js';
|
|
14
|
+
import type { GoalStore } from '../ports/goal-store.js';
|
|
15
|
+
import { type HostPlatformContext } from '../infrastructure/platform/host-platform.js';
|
|
16
|
+
import { McpRuntime } from '../infrastructure/extensions/mcp-runtime.js';
|
|
17
|
+
import { MemoryService } from '../application/memory/memory-service.js';
|
|
18
|
+
import { SessionExecutionWorkspaceService } from '../application/workspace/session-execution-workspace.js';
|
|
19
|
+
import { ModelCatalogInFlightRegistry } from '../application/model/cached-model-catalog.js';
|
|
20
|
+
import { CliAgentPreparationCache } from '../application/agent/cli-agent-preparation-cache.js';
|
|
21
|
+
export interface CliRuntime {
|
|
22
|
+
readonly platform: HostPlatformContext;
|
|
23
|
+
readonly paths: PlatformPaths;
|
|
24
|
+
readonly logger: Logger;
|
|
25
|
+
readonly configLoader: ConfigLoader;
|
|
26
|
+
readonly credentialStore: CredentialStore;
|
|
27
|
+
readonly auth: AuthenticationService;
|
|
28
|
+
readonly projectTrustStore: ProjectTrustStore;
|
|
29
|
+
readonly projectTrust: ProjectTrustService;
|
|
30
|
+
readonly sessionStore: SessionStore;
|
|
31
|
+
readonly goalStore: GoalStore;
|
|
32
|
+
readonly workspaceSettings: WorkspaceSettingsStore;
|
|
33
|
+
readonly cache: CacheStore;
|
|
34
|
+
readonly cachePolicy: CachePolicy;
|
|
35
|
+
readonly mcpRuntime: McpRuntime;
|
|
36
|
+
readonly memory: MemoryService;
|
|
37
|
+
readonly executionWorkspaces: SessionExecutionWorkspaceService;
|
|
38
|
+
readonly modelCatalogInFlight: ModelCatalogInFlightRegistry;
|
|
39
|
+
readonly agentPreparation?: CliAgentPreparationCache;
|
|
40
|
+
readonly shutdown: ShutdownManager;
|
|
41
|
+
}
|
|
42
|
+
export interface RuntimeFactoryOptions {
|
|
43
|
+
stderr?: Writable;
|
|
44
|
+
interactive?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function createCliRuntime(options?: RuntimeFactoryOptions): CliRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ConfigLoader as M}from"../infrastructure/config/config-loader.js";import{StructuredLogger as R}from"../infrastructure/logging/structured-logger.js";import{resolvePlatformPaths as D}from"../infrastructure/platform/platform-paths.js";import{AuthenticationService as L}from"../application/auth/authentication-service.js";import{CompositeCredentialStore as j}from"../infrastructure/credentials/composite-credential-store.js";import{EncryptedFileCredentialStore as k}from"../infrastructure/credentials/encrypted-file-credential-store.js";import{EnvironmentCredentialStore as T}from"../infrastructure/credentials/environment-credential-store.js";import{FileProjectTrustStore as W}from"../infrastructure/project/file-project-trust-store.js";import{ProjectTrustService as x}from"../application/project/project-trust-service.js";import{DefaultShutdownManager as E}from"./shutdown-manager.js";import{FileSessionStore as A}from"../infrastructure/sessions/file-session-store.js";import{WorkspaceSettingsStore as I}from"../infrastructure/workspace/workspace-settings-store.js";import{FileCacheStore as b}from"../infrastructure/cache/file-cache-store.js";import{resolveCachePolicy as G}from"../infrastructure/cache/cache-policy.js";import{DailyRotatingFileWriter as H}from"../infrastructure/logging/daily-rotating-file-writer.js";import{resolveLoggingPolicy as q}from"../infrastructure/logging/logging-policy.js";import{FileGoalStore as z}from"../infrastructure/sessions/file-goal-store.js";import{detectHostPlatform as B}from"../infrastructure/platform/host-platform.js";import{McpRuntime as J,resolveMcpRuntimePolicy as K}from"../infrastructure/extensions/mcp-runtime.js";import{FileMemoryStore as N}from"../infrastructure/memory/file-memory-store.js";import{MemoryService as O}from"../application/memory/memory-service.js";import{SessionExecutionWorkspaceService as Q}from"../application/workspace/session-execution-workspace.js";import{ModelCatalogInFlightRegistry as U}from"../application/model/cached-model-catalog.js";import{CliAgentPreparationCache as V}from"../application/agent/cli-agent-preparation-cache.js";function ve(i={}){const t=B(),e=D(process.env,t),n=new E,c=G(),g=new b(e.cacheDir,c),m=q();let o;try{o=new H(e.logsDir,m)}catch{}const d=i.interactive?o===void 0?"warn":"none":"warn",r=new R({output:i.stderr??process.stderr,level:m.level,consoleLevel:d,...o===void 0?{}:{file:o}}),s=new J(void 0,K(),r);o!==void 0&&n.register(()=>o?.close()),n.register(()=>s.close());const u=new M(r,e),l=new k(e),a=new j([new T,l],l),w=new L(a),p=new W(e),S=new x(p),f=new A(e),h=new z(f),v=new I,C=new O(new N(e,r),void 0,r),y=new Q(e.globalConfigDir,t),P=new U,F=new V;return{platform:t,paths:e,logger:r,configLoader:u,credentialStore:a,auth:w,projectTrustStore:p,projectTrust:S,sessionStore:f,goalStore:h,workspaceSettings:v,cache:g,cachePolicy:c,mcpRuntime:s,memory:C,executionWorkspaces:y,modelCatalogInFlight:P,agentPreparation:F,shutdown:n}}export{ve as createCliRuntime};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ShutdownManager {
|
|
2
|
+
register(handler: () => void | Promise<void>): void;
|
|
3
|
+
shutdown(): Promise<void>;
|
|
4
|
+
}
|
|
5
|
+
export declare class DefaultShutdownManager implements ShutdownManager {
|
|
6
|
+
private readonly handlers;
|
|
7
|
+
private shutdownPromise;
|
|
8
|
+
register(handler: () => void | Promise<void>): void;
|
|
9
|
+
shutdown(): Promise<void>;
|
|
10
|
+
private runShutdown;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class n{handlers=[];shutdownPromise;register(r){this.handlers.push(r)}async shutdown(){return this.shutdownPromise!==void 0?this.shutdownPromise:(this.shutdownPromise=this.runShutdown(),this.shutdownPromise)}async runShutdown(){const r=[];for(const s of[...this.handlers].reverse())try{await s()}catch(e){r.push(e)}if(r.length>0)throw new AggregateError(r,"One or more shutdown handlers failed.")}}export{n as DefaultShutdownManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"node:path";import{parseGlobalCliOptions as e}from"./global-cli-options.js";function n(t,o=process.cwd()){const s=e(t);return{cwd:r.resolve(s.cwd??o),isInteractive:process.stdin.isTTY===!0&&process.stdout.isTTY===!0}}export{n as resolveStartupContext};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AuthProfile {
|
|
2
|
+
name: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
credentialRef: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
}
|
|
8
|
+
export interface StoredCredential {
|
|
9
|
+
profile: AuthProfile;
|
|
10
|
+
apiKey: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function validateProfileName(name: string): string;
|
|
13
|
+
export declare function validateBaseUrl(value: string): string;
|
|
14
|
+
export declare function validateApiKey(apiKey: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as t}from"../errors/cli-error.js";import{CLI_ERROR_CODES as a}from"../errors/error-codes.js";const s=/^[a-z][a-z0-9_-]{0,31}$/;function l(r){const e=r.trim().toLowerCase();if(!s.test(e))throw new t(a.AUTH_PROFILE_NOT_FOUND,`Invalid profile name: ${r}`,{category:"auth",userMessage:"Profile names may contain lowercase letters, digits, hyphens, or underscores; maximum 32 characters."});return e}function c(r){let e;try{e=new URL(r)}catch(o){throw new t(a.AUTH_BASE_URL_INVALID,"Base URL is invalid.",{category:"auth",userMessage:"Invalid base URL.",cause:o})}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new t(a.AUTH_BASE_URL_INVALID,"Base URL must use HTTP or HTTPS.",{category:"auth",userMessage:"Base URL must use HTTP or HTTPS."});return r.replace(/\/+$/,"")}function u(r){const e=r.trim();if(e.length<8||e.length>4096||/[\r\n]/.test(e))throw new t(a.AUTH_API_KEY_INVALID,"API key has an invalid shape.",{category:"auth",userMessage:"API key is invalid or contains a newline."});return e}export{u as validateApiKey,c as validateBaseUrl,l as validateProfileName};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const REASONING_EFFORTS: readonly ["low", "medium", "high"];
|
|
2
|
+
export type ReasoningEffort = typeof REASONING_EFFORTS[number];
|
|
3
|
+
export declare const DEFAULT_REASONING_EFFORT: ReasoningEffort;
|
|
4
|
+
export declare const CONFIG_SCHEMA_VERSION = 1;
|
|
5
|
+
export interface CliConfig {
|
|
6
|
+
schemaVersion: 1;
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
model: string | null;
|
|
9
|
+
effort: ReasoningEffort;
|
|
10
|
+
profile: string | null;
|
|
11
|
+
theme: 'dark' | 'light' | 'auto';
|
|
12
|
+
approvalMode: 'ask' | 'auto' | 'deny';
|
|
13
|
+
sandboxMode: 'workspace' | 'disabled';
|
|
14
|
+
telemetry: 'off' | 'opt-in';
|
|
15
|
+
updateChannel: 'stable' | 'preview';
|
|
16
|
+
memoryContext: 'enabled' | 'disabled';
|
|
17
|
+
memorySemanticSearch: 'enabled' | 'disabled';
|
|
18
|
+
memoryEmbeddingModel: string | null;
|
|
19
|
+
}
|
|
20
|
+
export type ConfigurableKey = Exclude<keyof CliConfig, 'schemaVersion'>;
|
|
21
|
+
export declare const CONFIGURABLE_KEYS: readonly ConfigurableKey[];
|
|
22
|
+
export declare const DEFAULT_CONFIG: CliConfig;
|
|
23
|
+
export declare function validateConfig(value: unknown): Partial<CliConfig>;
|
|
24
|
+
export declare function mergeConfig(...layers: readonly Partial<CliConfig>[]): CliConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as d}from"../errors/cli-error.js";import{CLI_ERROR_CODES as i}from"../errors/error-codes.js";import{findUnexpectedRecordKey as M,isRecord as S}from"../validation/record-schema.js";const E=["low","medium","high"],N="medium",a=1,_=["baseUrl","model","effort","profile","theme","approvalMode","sandboxMode","telemetry","updateChannel","memoryContext","memorySemanticSearch","memoryEmbeddingModel"],x=["schemaVersion",..._],O={schemaVersion:a,baseUrl:"https://api.lotagate.com",model:null,effort:N,profile:null,theme:"dark",approvalMode:"ask",sandboxMode:"workspace",telemetry:"off",updateChannel:"stable",memoryContext:"enabled",memorySemanticSearch:"disabled",memoryEmbeddingModel:null};function f(e,n){if(typeof e!="string"||e.trim().length===0)throw new d(i.CONFIG_SCHEMA_INVALID,`Invalid config field: ${n}`,{category:"config",userMessage:`Invalid configuration: field \`${n}\` must be a non-empty string.`})}function w(e){if(!S(e))throw new d(i.CONFIG_SCHEMA_INVALID,"Config must be a JSON object.",{category:"config",userMessage:"Configuration file must contain a JSON object."});const n=M(e,x);if(n!==void 0)throw b(`Unsupported configuration field: \`${n}\`.`);if(e.schemaVersion!==void 0&&e.schemaVersion!==a)throw new d(i.CONFIG_SCHEMA_INVALID,"Unsupported config schema version.",{category:"config",userMessage:`Unsupported configuration schema version: ${String(e.schemaVersion)}.`});const o=e.baseUrl;if(o!==void 0){f(o,"baseUrl");try{new URL(o)}catch(I){throw new d(i.CONFIG_SCHEMA_INVALID,"baseUrl must be a valid URL.",{category:"config",userMessage:"baseUrl must be a valid URL.",cause:I})}}const t=e.model,c=r(e.effort,"effort",E),s=e.profile;if(t!=null&&f(t,"model"),s!=null&&f(s,"profile"),typeof t=="string"&&t.length>256)throw new d(i.CONFIG_SCHEMA_INVALID,"Model id is too long.",{category:"config",userMessage:"Model id must not exceed 256 characters."});const l=r(e.theme,"theme",["dark","light","auto"]),u=r(e.approvalMode,"approvalMode",["ask","auto","deny"]),p=r(e.sandboxMode,"sandboxMode",["workspace","disabled"]),g=r(e.telemetry,"telemetry",["off","opt-in"]),h=r(e.updateChannel,"updateChannel",["stable","preview"]),y=r(e.memoryContext,"memoryContext",["enabled","disabled"]),C=r(e.memorySemanticSearch,"memorySemanticSearch",["enabled","disabled"]),m=e.memoryEmbeddingModel;return m!=null&&f(m,"memoryEmbeddingModel"),{...e.schemaVersion===void 0?{}:{schemaVersion:a},...o===void 0?{}:{baseUrl:o},...t===void 0?{}:{model:t},...c===void 0?{}:{effort:c},...s===void 0?{}:{profile:s},...l===void 0?{}:{theme:l},...u===void 0?{}:{approvalMode:u},...p===void 0?{}:{sandboxMode:p},...g===void 0?{}:{telemetry:g},...h===void 0?{}:{updateChannel:h},...y===void 0?{}:{memoryContext:y},...C===void 0?{}:{memorySemanticSearch:C},...m===void 0?{}:{memoryEmbeddingModel:m}}}function F(...e){const n=e.reduce((o,t)=>({...o,...t}),{});return{...O,...w(n),schemaVersion:a}}function r(e,n,o){if(e!==void 0){if(typeof e!="string"||!o.includes(e))throw b(`Invalid configuration: value for \`${n}\` is not supported.`);return e}}function b(e){return new d(i.CONFIG_SCHEMA_INVALID,e,{category:"config",userMessage:e})}export{_ as CONFIGURABLE_KEYS,a as CONFIG_SCHEMA_VERSION,O as DEFAULT_CONFIG,N as DEFAULT_REASONING_EFFORT,E as REASONING_EFFORTS,F as mergeConfig,w as validateConfig};
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CliErrorCode } from './error-codes.js';
|
|
2
|
+
import type { CliCommandHint } from './cli-command-hint.js';
|
|
3
|
+
export interface CliErrorOptions {
|
|
4
|
+
category: string;
|
|
5
|
+
userMessage?: string;
|
|
6
|
+
retryable?: boolean;
|
|
7
|
+
exitCode?: number;
|
|
8
|
+
correlationId?: string;
|
|
9
|
+
details?: Record<string, unknown>;
|
|
10
|
+
hint?: CliCommandHint;
|
|
11
|
+
cause?: unknown;
|
|
12
|
+
}
|
|
13
|
+
export interface CliErrorShape {
|
|
14
|
+
code: CliErrorCode | string;
|
|
15
|
+
category: string;
|
|
16
|
+
message: string;
|
|
17
|
+
userMessage: string;
|
|
18
|
+
retryable: boolean;
|
|
19
|
+
exitCode: number;
|
|
20
|
+
correlationId?: string;
|
|
21
|
+
details?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export declare class CliError extends Error {
|
|
24
|
+
readonly code: CliErrorCode | string;
|
|
25
|
+
readonly category: string;
|
|
26
|
+
readonly userMessage: string;
|
|
27
|
+
readonly retryable: boolean;
|
|
28
|
+
readonly exitCode: number;
|
|
29
|
+
readonly correlationId: string | undefined;
|
|
30
|
+
readonly details: Record<string, unknown> | undefined;
|
|
31
|
+
readonly hint: CliCommandHint | undefined;
|
|
32
|
+
constructor(code: CliErrorCode | string, message: string, options: CliErrorOptions);
|
|
33
|
+
toJSON(): CliErrorShape;
|
|
34
|
+
}
|
|
35
|
+
export declare function asCliError(error: unknown): CliError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CLI_ERROR_CODES as r}from"./error-codes.js";class i extends Error{code;category;userMessage;retryable;exitCode;correlationId;details;hint;constructor(t,a,s){super(a,{cause:s.cause}),this.name="CliError",this.code=t,this.category=s.category,this.userMessage=s.userMessage??a,this.retryable=s.retryable??!1,this.exitCode=s.exitCode??1,this.correlationId=s.correlationId,this.details=s.details,this.hint=s.hint}toJSON(){return{code:this.code,category:this.category,message:this.message,userMessage:this.userMessage,retryable:this.retryable,exitCode:this.exitCode,...this.correlationId!==void 0?{correlationId:this.correlationId}:{},...this.details!==void 0?{details:this.details}:{}}}}function h(e){if(e instanceof i)return e;const t=c(e),a=u(e);if(t==="REQUEST_ABORTED"||d(e))return new i(r.INTERRUPTED,n(e),{category:"agent",userMessage:"The request was interrupted.",retryable:!0,...a,cause:e});if(t==="REQUEST_TIMEOUT"||t==="NETWORK_ERROR")return new i(r.MEDIA_REQUEST_FAILED,n(e),{category:"media",userMessage:"The media request could not be completed. Retry the request; if it persists, check the selected model, credentials, and network connection.",retryable:!0,...a,cause:e});if(t==="REQUEST_PAYLOAD_TOO_LARGE"){const s=a.details?.kind==="json-body",o=E(a.details?.maxBytes);return new i(r.INVALID_ARGUMENT,n(e),{category:"media",userMessage:s?`The serialized Gateway request exceeds ${o}. Remove some attachments or reduce the prompt/context.`:"The media request exceeds a Gateway file or aggregate size limit. Review the command options and input file size.",...a,cause:e})}return t==="REQUEST_VALIDATION_ERROR"?new i(r.INVALID_ARGUMENT,n(e),{category:"media",userMessage:"The media request does not satisfy a gateway validation limit. Review the command options and input file size.",...a,cause:e}):t==="RESPONSE_TOO_LARGE"?new i(r.MEDIA_RESPONSE_TOO_LARGE,n(e),{category:"media",userMessage:"The generated media exceeds the supported download size.",retryable:!1,...a,cause:e}):t==="TOOL_ARGUMENTS_INVALID"?new i(r.TOOL_ARGUMENT_INVALID,n(e),{category:"tool",userMessage:"The selected model returned malformed tool arguments. Retry the request or choose a model with reliable tool-calling support.",retryable:!0,cause:e}):t==="TOOL_DENIED"||t==="TOOL_APPROVAL_REQUIRED"?new i(r.TOOL_DENIED,n(e),{category:"tool",userMessage:"The tool action was denied by the active workspace policy. Use interactive approval or configure an explicit workspace permission.",retryable:!1,...a,cause:e}):t==="TOOL_EXECUTION_FAILED"||t==="MCP_OPERATION_FAILED"||t==="MCP_DISCONNECTED"?new i(r.TOOL_EXECUTION_FAILED,n(e),{category:"tool",userMessage:"The selected tool could not complete. Retry the request; if it persists, check the tool or MCP server connection.",retryable:!0,...a,cause:e}):t==="TOOL_NOT_FOUND"?new i(r.MODEL_STREAM_FAILED,n(e),{category:"model",userMessage:"The selected model requested a tool that is unavailable in this CLI session. Retry the request or choose another model.",retryable:!0,cause:e}):t==="AGENT_LIMIT_EXCEEDED"?new i(r.AGENT_STUCK,n(e),{category:"agent",userMessage:"The agent reached a safety limit before completing. Narrow the task and try again.",retryable:!0,cause:e}):t==="MODEL_RESPONSE_INVALID"||t==="RESPONSE_PARSE_ERROR"||f(e)?new i(r.MODEL_STREAM_FAILED,n(e),{category:"model",userMessage:"The model provider could not complete the request. Retry; if it persists, check the selected model, credentials, and base URL.",retryable:!0,cause:e}):new i(r.INTERNAL_ERROR,e instanceof Error?e.message:String(e),{category:"general",userMessage:"An internal error occurred.",hint:{actionId:"doctor"},cause:e})}function c(e){if(typeof e!="object"||e===null)return;const t=e;return typeof t.code=="string"?t.code:typeof t.errorCode=="string"?t.errorCode:void 0}function d(e){let t=e;for(let a=0;a<5&&t!==void 0&&t!==null;a+=1){if(typeof t!="object")return!1;const s=t;if(s.name==="AbortError"||s.code==="ABORT_ERR"||typeof s.message=="string"&&/\b(aborted|cancelled|canceled)\b/iu.test(s.message))return!0;t=s.cause}return!1}function u(e){if(typeof e!="object"||e===null)return{};const t=e;return{...typeof t.correlationId=="string"?{correlationId:t.correlationId}:{},...l(t.details)?{details:t.details}:{}}}function l(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function E(e){if(typeof e!="number"||!Number.isFinite(e)||e<=0)return"the configured size limit";const t=e/1e6;return Number.isInteger(t)?`${t} MB`:`${e} bytes`}function f(e){return n(e)==="Upstream AI provider request failed."}function n(e){return e instanceof Error?e.message:String(e)}export{i as CliError,h as asCliError};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const CLI_ERROR_CODES: {
|
|
2
|
+
readonly INVALID_ARGUMENT: "CLI_INVALID_ARGUMENT";
|
|
3
|
+
readonly MISSING_ARGUMENT: "CLI_MISSING_ARGUMENT";
|
|
4
|
+
readonly INTERRUPTED: "CLI_INTERRUPTED";
|
|
5
|
+
readonly INTERNAL_ERROR: "CLI_INTERNAL_ERROR";
|
|
6
|
+
readonly CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND";
|
|
7
|
+
readonly CONFIG_INVALID_JSON: "CONFIG_INVALID_JSON";
|
|
8
|
+
readonly CONFIG_SCHEMA_INVALID: "CONFIG_SCHEMA_INVALID";
|
|
9
|
+
readonly CONFIG_LOCKED: "CONFIG_LOCKED";
|
|
10
|
+
readonly PROJECT_PATH_INVALID: "PROJECT_PATH_INVALID";
|
|
11
|
+
readonly AUTH_API_KEY_INVALID: "AUTH_API_KEY_INVALID";
|
|
12
|
+
readonly AUTH_PROFILE_NOT_FOUND: "AUTH_PROFILE_NOT_FOUND";
|
|
13
|
+
readonly AUTH_CREDENTIAL_STORE_UNAVAILABLE: "AUTH_CREDENTIAL_STORE_UNAVAILABLE";
|
|
14
|
+
readonly AUTH_BASE_URL_INVALID: "AUTH_BASE_URL_INVALID";
|
|
15
|
+
readonly PROJECT_TRUST_REQUIRED: "PROJECT_TRUST_REQUIRED";
|
|
16
|
+
readonly MODEL_NOT_FOUND: "MODEL_NOT_FOUND";
|
|
17
|
+
readonly MODEL_STREAM_FAILED: "MODEL_STREAM_FAILED";
|
|
18
|
+
readonly MODEL_EMPTY_RESPONSE: "MODEL_EMPTY_RESPONSE";
|
|
19
|
+
readonly MODEL_PROTOCOL_EMPTY_RESPONSE: "MODEL_PROTOCOL_EMPTY_RESPONSE";
|
|
20
|
+
readonly MEDIA_REQUEST_FAILED: "MEDIA_REQUEST_FAILED";
|
|
21
|
+
readonly MEDIA_RESPONSE_TOO_LARGE: "MEDIA_RESPONSE_TOO_LARGE";
|
|
22
|
+
readonly MODEL_EMPTY_FINAL: "MODEL_EMPTY_FINAL";
|
|
23
|
+
readonly AGENT_STUCK: "AGENT_STUCK";
|
|
24
|
+
readonly ATTACHMENT_CLIPBOARD_UNAVAILABLE: "ATTACHMENT_CLIPBOARD_UNAVAILABLE";
|
|
25
|
+
readonly ATTACHMENT_FORMAT_UNSUPPORTED: "ATTACHMENT_FORMAT_UNSUPPORTED";
|
|
26
|
+
readonly ATTACHMENT_TOO_LARGE: "ATTACHMENT_TOO_LARGE";
|
|
27
|
+
readonly ATTACHMENT_INVALID_IMAGE: "ATTACHMENT_INVALID_IMAGE";
|
|
28
|
+
readonly TOOL_ARGUMENT_INVALID: "TOOL_ARGUMENT_INVALID";
|
|
29
|
+
readonly TOOL_DENIED: "CLI_TOOL_DENIED";
|
|
30
|
+
readonly TOOL_EXECUTION_FAILED: "CLI_TOOL_EXECUTION_FAILED";
|
|
31
|
+
readonly PROJECT_SYMLINK_ESCAPE: "PROJECT_SYMLINK_ESCAPE";
|
|
32
|
+
readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
|
|
33
|
+
readonly SESSION_LOCKED: "SESSION_LOCKED";
|
|
34
|
+
readonly SESSION_CORRUPTED: "SESSION_CORRUPTED";
|
|
35
|
+
readonly TASK_DEPENDENCY_CYCLE: "TASK_DEPENDENCY_CYCLE";
|
|
36
|
+
readonly TASK_SCHEDULER_OVERLOADED: "TASK_SCHEDULER_OVERLOADED";
|
|
37
|
+
readonly TASK_PLAN_APPROVAL_REQUIRED: "TASK_PLAN_APPROVAL_REQUIRED";
|
|
38
|
+
readonly PLUGIN_MANIFEST_INVALID: "PLUGIN_MANIFEST_INVALID";
|
|
39
|
+
readonly PLUGIN_NOT_FOUND: "PLUGIN_NOT_FOUND";
|
|
40
|
+
readonly SKILL_FRONTMATTER_INVALID: "SKILL_FRONTMATTER_INVALID";
|
|
41
|
+
readonly SKILL_NOT_FOUND: "SKILL_NOT_FOUND";
|
|
42
|
+
readonly MCP_CONFIG_INVALID: "MCP_CONFIG_INVALID";
|
|
43
|
+
readonly MCP_SERVER_NOT_FOUND: "MCP_SERVER_NOT_FOUND";
|
|
44
|
+
readonly GOAL_NOT_FOUND: "GOAL_NOT_FOUND";
|
|
45
|
+
readonly GOAL_INVALID_STATE: "GOAL_INVALID_STATE";
|
|
46
|
+
readonly GOAL_LIMIT_REACHED: "GOAL_LIMIT_REACHED";
|
|
47
|
+
readonly MEMORY_NOT_FOUND: "MEMORY_NOT_FOUND";
|
|
48
|
+
readonly MEMORY_INVALID: "MEMORY_INVALID";
|
|
49
|
+
readonly MEMORY_LIMIT_REACHED: "MEMORY_LIMIT_REACHED";
|
|
50
|
+
};
|
|
51
|
+
export type CliErrorCode = (typeof CLI_ERROR_CODES)[keyof typeof CLI_ERROR_CODES];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _={INVALID_ARGUMENT:"CLI_INVALID_ARGUMENT",MISSING_ARGUMENT:"CLI_MISSING_ARGUMENT",INTERRUPTED:"CLI_INTERRUPTED",INTERNAL_ERROR:"CLI_INTERNAL_ERROR",CONFIG_NOT_FOUND:"CONFIG_NOT_FOUND",CONFIG_INVALID_JSON:"CONFIG_INVALID_JSON",CONFIG_SCHEMA_INVALID:"CONFIG_SCHEMA_INVALID",CONFIG_LOCKED:"CONFIG_LOCKED",PROJECT_PATH_INVALID:"PROJECT_PATH_INVALID",AUTH_API_KEY_INVALID:"AUTH_API_KEY_INVALID",AUTH_PROFILE_NOT_FOUND:"AUTH_PROFILE_NOT_FOUND",AUTH_CREDENTIAL_STORE_UNAVAILABLE:"AUTH_CREDENTIAL_STORE_UNAVAILABLE",AUTH_BASE_URL_INVALID:"AUTH_BASE_URL_INVALID",PROJECT_TRUST_REQUIRED:"PROJECT_TRUST_REQUIRED",MODEL_NOT_FOUND:"MODEL_NOT_FOUND",MODEL_STREAM_FAILED:"MODEL_STREAM_FAILED",MODEL_EMPTY_RESPONSE:"MODEL_EMPTY_RESPONSE",MODEL_PROTOCOL_EMPTY_RESPONSE:"MODEL_PROTOCOL_EMPTY_RESPONSE",MEDIA_REQUEST_FAILED:"MEDIA_REQUEST_FAILED",MEDIA_RESPONSE_TOO_LARGE:"MEDIA_RESPONSE_TOO_LARGE",MODEL_EMPTY_FINAL:"MODEL_EMPTY_FINAL",AGENT_STUCK:"AGENT_STUCK",ATTACHMENT_CLIPBOARD_UNAVAILABLE:"ATTACHMENT_CLIPBOARD_UNAVAILABLE",ATTACHMENT_FORMAT_UNSUPPORTED:"ATTACHMENT_FORMAT_UNSUPPORTED",ATTACHMENT_TOO_LARGE:"ATTACHMENT_TOO_LARGE",ATTACHMENT_INVALID_IMAGE:"ATTACHMENT_INVALID_IMAGE",TOOL_ARGUMENT_INVALID:"TOOL_ARGUMENT_INVALID",TOOL_DENIED:"CLI_TOOL_DENIED",TOOL_EXECUTION_FAILED:"CLI_TOOL_EXECUTION_FAILED",PROJECT_SYMLINK_ESCAPE:"PROJECT_SYMLINK_ESCAPE",SESSION_NOT_FOUND:"SESSION_NOT_FOUND",SESSION_LOCKED:"SESSION_LOCKED",SESSION_CORRUPTED:"SESSION_CORRUPTED",TASK_DEPENDENCY_CYCLE:"TASK_DEPENDENCY_CYCLE",TASK_SCHEDULER_OVERLOADED:"TASK_SCHEDULER_OVERLOADED",TASK_PLAN_APPROVAL_REQUIRED:"TASK_PLAN_APPROVAL_REQUIRED",PLUGIN_MANIFEST_INVALID:"PLUGIN_MANIFEST_INVALID",PLUGIN_NOT_FOUND:"PLUGIN_NOT_FOUND",SKILL_FRONTMATTER_INVALID:"SKILL_FRONTMATTER_INVALID",SKILL_NOT_FOUND:"SKILL_NOT_FOUND",MCP_CONFIG_INVALID:"MCP_CONFIG_INVALID",MCP_SERVER_NOT_FOUND:"MCP_SERVER_NOT_FOUND",GOAL_NOT_FOUND:"GOAL_NOT_FOUND",GOAL_INVALID_STATE:"GOAL_INVALID_STATE",GOAL_LIMIT_REACHED:"GOAL_LIMIT_REACHED",MEMORY_NOT_FOUND:"MEMORY_NOT_FOUND",MEMORY_INVALID:"MEMORY_INVALID",MEMORY_LIMIT_REACHED:"MEMORY_LIMIT_REACHED"};export{_ as CLI_ERROR_CODES};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MAX_PLUGIN_DISPLAY_NAME_LENGTH = 128;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _=128;export{_ as MAX_PLUGIN_DISPLAY_NAME_LENGTH};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as o}from"../errors/cli-error.js";import{CLI_ERROR_CODES as s}from"../errors/error-codes.js";function n(e){if(e!==void 0){if(typeof e!="string"||e!=="user"&&e!=="project")throw new o(s.INVALID_ARGUMENT,"Extension scope must be user or project.",{category:"arguments",userMessage:"Invalid scope. Use --scope user or --scope project."});return e}}function c(e){const r=n(e);if(r===void 0)throw new o(s.MISSING_ARGUMENT,"Extension scope is required for non-interactive commands.",{category:"arguments",userMessage:"Choose a scope interactively or pass --scope user|project."});return r}export{n as parseExtensionScope,c as requireExtensionScope};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error("Extension state must be an object.");const n={};for(const[r,e]of Object.entries(t)){if(typeof e!="object"||e===null||Array.isArray(e)||typeof e.enabled!="boolean")throw new Error(`Invalid extension state entry: ${r}.`);n[r]={enabled:e.enabled}}return n}export{o as parseExtensionState};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type HookEvent = 'session.start' | 'prompt.before' | 'tool.before' | 'tool.after' | 'response.after' | 'session.end';
|
|
2
|
+
export interface HookDefinition {
|
|
3
|
+
id: string;
|
|
4
|
+
event: HookEvent;
|
|
5
|
+
command: string;
|
|
6
|
+
args: readonly string[];
|
|
7
|
+
timeoutMs: number;
|
|
8
|
+
directory: string;
|
|
9
|
+
scope?: 'project' | 'plugin';
|
|
10
|
+
pluginName?: string;
|
|
11
|
+
sourceName?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function parseHookDefinition(value: unknown, directory: string, id: string): HookDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as a}from"../errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../errors/error-codes.js";function k(o,f,u){if(typeof o!="object"||o===null)throw e("Hook must be a JSON object.");const n=o,i=n.event,r=n.command,s=n.args,m=n.timeoutMs;if(!p(i))throw e("Hook event is not supported.");if(typeof r!="string"||r.trim().length===0||/[\r\n]/u.test(r))throw e("Hook command is invalid.");if(s!==void 0&&(!Array.isArray(s)||s.some(c=>typeof c!="string")))throw e("Hook args must be strings.");const t=m===void 0?1e4:m;if(typeof t!="number"||!Number.isInteger(t)||t<100||t>12e4)throw e("Hook timeout must be between 100 and 120000 milliseconds.");return{id:u,event:i,command:r,args:s??[],timeoutMs:t,directory:f}}function p(o){return typeof o=="string"&&["session.start","prompt.before","tool.before","tool.after","response.after","session.end"].includes(o)}function e(o){return new a(d.PLUGIN_MANIFEST_INVALID,o,{category:"extension",userMessage:`Invalid hook: ${o}`})}export{k as parseHookDefinition};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={browser:"browser-use",computer:"computer-use"};export{e as HOST_TOOL_PLUGIN_IDS};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { McpServerConfig } from '@lotagate/agent-sdk';
|
|
2
|
+
/** Persistable subset of the public Agent SDK MCP contract. */
|
|
3
|
+
export interface McpSecretReference {
|
|
4
|
+
type: 'env';
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export type CliSecretValue = string | McpSecretReference;
|
|
8
|
+
export type CliMcpServerConfig = (Omit<Extract<McpServerConfig, {
|
|
9
|
+
type: 'stdio';
|
|
10
|
+
}>, 'env'> & {
|
|
11
|
+
env?: Readonly<Record<string, CliSecretValue>>;
|
|
12
|
+
}) | (Omit<Extract<McpServerConfig, {
|
|
13
|
+
type: 'http' | 'sse';
|
|
14
|
+
}>, 'headers' | 'auth'> & {
|
|
15
|
+
headers?: Readonly<Record<string, CliSecretValue>>;
|
|
16
|
+
auth?: {
|
|
17
|
+
type: 'bearer';
|
|
18
|
+
token: McpSecretReference;
|
|
19
|
+
};
|
|
20
|
+
});
|
|
21
|
+
export interface CliMcpServerEntry {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
config: CliMcpServerConfig;
|
|
24
|
+
}
|
|
25
|
+
export type CliMcpConfig = Record<string, CliMcpServerEntry>;
|
|
26
|
+
export declare function mergeMcpConfigs(...configs: readonly CliMcpConfig[]): CliMcpConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Combines ordered configuration layers where a later, more specific layer
|
|
29
|
+
* overrides an earlier one. Runtime callers pass user scope before project
|
|
30
|
+
* scope so a trusted project can intentionally override a global server with
|
|
31
|
+
* the same name.
|
|
32
|
+
*/
|
|
33
|
+
export declare function mergeMcpConfigsWithOverride(...configs: readonly CliMcpConfig[]): CliMcpConfig;
|
|
34
|
+
export declare function validateMcpName(name: string): string;
|
|
35
|
+
export declare function validateMcpConfig(value: unknown): CliMcpConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as d}from"../errors/cli-error.js";import{CLI_ERROR_CODES as m}from"../errors/error-codes.js";function C(...t){const e={};for(const o of t)for(const[r,i]of Object.entries(o)){if(e[r]!==void 0)throw n(`MCP server is defined more than once: ${r}.`);e[r]=i}return e}function M(...t){const e={};for(const o of t)Object.assign(e,o);return e}function g(t){const e=t.trim().toLowerCase();if(!/^[a-z][a-z0-9_-]{0,63}$/.test(e))throw n("MCP server name must be lowercase and <= 64 characters.");return e}function A(t){if(typeof t!="object"||t===null||Array.isArray(t))throw n("MCP config must be an object.");const e={};for(const[o,r]of Object.entries(t)){const i=g(o);if(typeof r!="object"||r===null||Array.isArray(r))throw n(`Invalid MCP entry: ${i}.`);const s=r;if(typeof s.enabled!="boolean"||typeof s.config!="object"||s.config===null)throw n(`Invalid MCP entry: ${i}.`);e[i]={enabled:s.enabled,config:h(s.config)}}return e}function h(t){const e=t,o=e.type;if(o==="stdio"){if(typeof e.command!="string"||e.command.trim().length===0||/[\r\n]/.test(e.command))throw n("stdio MCP command is invalid.");if(e.args!==void 0&&(!Array.isArray(e.args)||e.args.some(r=>typeof r!="string")))throw n("stdio MCP args must be strings.");return{type:o,command:e.command,...e.args===void 0?{}:{args:e.args},...e.env===void 0?{}:{env:a(e.env,"stdio env")},...e.cwd===void 0?{}:{cwd:y(e.cwd,"stdio cwd")},...e.maxBufferSize===void 0?{}:{maxBufferSize:p(e.maxBufferSize,"stdio maxBufferSize")}}}if(o==="http"||o==="sse"){if(typeof e.url!="string")throw n("HTTP MCP URL is required.");try{const r=new URL(e.url);if(!["http:","https:"].includes(r.protocol)||r.username.length>0||r.password.length>0||[...r.searchParams.keys()].some(u))throw new Error("credentials")}catch(r){throw n("HTTP MCP URL must use HTTP or HTTPS and must not contain credentials.",r)}return{type:o,url:e.url,...e.headers===void 0?{}:{headers:a(e.headers,"HTTP headers")},...e.auth===void 0?{}:{auth:b(e.auth)}}}throw n("MCP type must be stdio, http or sse.")}function y(t,e){if(typeof t!="string"||t.length===0)throw n(`${e} must be a non-empty string.`);return t}function p(t,e){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw n(`${e} must be a positive integer.`);return t}function b(t){if(typeof t!="object"||t===null||Array.isArray(t))throw n("HTTP auth must be a bearer token configuration.");const e=t;if(e.type!=="bearer")throw n("HTTP auth must be a bearer token configuration.");return{type:"bearer",token:f(e.token,"HTTP bearer token")}}function a(t,e){if(typeof t!="object"||t===null||Array.isArray(t))throw n(`${e} must be an object of string values or environment references.`);const o={};for(const[r,i]of Object.entries(t)){if(r.length===0||/[\r\n]/u.test(r))throw n(`${e} must contain valid string key/value pairs.`);o[r]=c(i)?f(i,`${e} secret reference`):u(r)?(()=>{throw n(`${e} value for ${r} must use an environment reference.`)})():w(i,`${e} value`)}return o}function f(t,e){if(!c(t)||!/^[A-Za-z_][A-Za-z0-9_]{0,127}$/u.test(t.name))throw n(`${e} must reference an environment variable name.`);return{type:"env",name:t.name}}function w(t,e){if(typeof t!="string"||/[\r\n]/u.test(t))throw n(`${e} must be a string without line breaks.`);return t}function c(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&t.type==="env"&&typeof t.name=="string"}function u(t){return/(?:api[-_]?key|authorization|auth[-_]?token|cookie|credential|key|password|secret|token)/iu.test(t)}function n(t,e){return new d(m.MCP_CONFIG_INVALID,t,{category:"mcp",userMessage:`Invalid MCP configuration: ${t}`,cause:e})}export{C as mergeMcpConfigs,M as mergeMcpConfigsWithOverride,A as validateMcpConfig,g as validateMcpName};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface PluginAgentDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
instructions: string;
|
|
5
|
+
allowedTools: readonly string[];
|
|
6
|
+
directory: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function parsePluginAgentDocument(raw: string, directory: string): PluginAgentDefinition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as c}from"../errors/cli-error.js";import{CLI_ERROR_CODES as p}from"../errors/error-codes.js";import{findUnexpectedRecordKey as l}from"../validation/record-schema.js";import{parseYamlList as u,parseYamlMapping as d}from"./yaml-subset.js";function A(n,a){const e=d(n,t),s=l(e,["name","description","instructions","allowed-tools"]);if(s!==void 0)throw t(`Unsupported agent field: \`${s}\`.`);const o=e.name,i=e.description,r=e.instructions;if(typeof o!="string"||!/^[a-z0-9][a-z0-9-]{0,63}$/u.test(o))throw t("Agent name must use lowercase kebab-case.");if(typeof i!="string"||i.trim().length===0)throw t("Agent requires a description.");if(typeof r!="string"||r.trim().length===0)throw t("Agent requires instructions.");return{name:o,description:i,instructions:r,allowedTools:u(e["allowed-tools"]),directory:a}}function t(n){return new c(p.PLUGIN_MANIFEST_INVALID,n,{category:"extension",userMessage:`Invalid plugin agent: ${n}`})}export{A as parsePluginAgentDocument};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface PluginManifest {
|
|
2
|
+
name: string;
|
|
3
|
+
displayName?: string;
|
|
4
|
+
version: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
author?: string;
|
|
7
|
+
license?: string;
|
|
8
|
+
homepage?: string;
|
|
9
|
+
repository?: string;
|
|
10
|
+
keywords?: readonly string[];
|
|
11
|
+
directory: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const PLUGIN_LAYOUT: {
|
|
14
|
+
readonly markerDirectory: ".lotagate-plugin";
|
|
15
|
+
readonly manifestFile: "plugin.json";
|
|
16
|
+
readonly skillsDirectory: "skills";
|
|
17
|
+
readonly agentsDirectory: "agents";
|
|
18
|
+
readonly hooksDirectory: "hooks";
|
|
19
|
+
readonly mcpDirectory: "mcp";
|
|
20
|
+
readonly readmeFile: "README.md";
|
|
21
|
+
readonly licenseFile: "LICENSE";
|
|
22
|
+
};
|
|
23
|
+
export declare function parsePluginManifest(value: unknown, directory: string): PluginManifest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as g}from"../errors/cli-error.js";import{CLI_ERROR_CODES as h}from"../errors/error-codes.js";import{findUnexpectedRecordKey as N,isRecord as w}from"../validation/record-schema.js";import{MAX_PLUGIN_DISPLAY_NAME_LENGTH as y}from"./extension-constants.js";const v={markerDirectory:".lotagate-plugin",manifestFile:"plugin.json",skillsDirectory:"skills",agentsDirectory:"agents",hooksDirectory:"hooks",mcpDirectory:"mcp",readmeFile:"README.md",licenseFile:"LICENSE"};function L(n,t){if(!w(n))throw i("Manifest must be a JSON object.");const e=n,r=N(e,["name","displayName","version","description","author","license","homepage","repository","keywords"]);if(r!==void 0)throw i(`Unsupported manifest field: \`${r}\`.`);const s=e.name,d=A(e),a=e.version,f=o(e,"description"),u=o(e,"author"),c=o(e,"license"),m=o(e,"homepage"),l=o(e,"repository"),p=k(e,"keywords");if(typeof s!="string"||!/^[a-z0-9][a-z0-9-]{0,63}$/.test(s))throw i("Plugin name must use lowercase kebab-case.");if(typeof a!="string"||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(a))throw i("Plugin version must be semver-like.");return{name:s,...d===void 0?{}:{displayName:d},version:a,...f===void 0?{}:{description:f},...u===void 0?{}:{author:u},...c===void 0?{}:{license:c},...m===void 0?{}:{homepage:m},...l===void 0?{}:{repository:l},...p===void 0?{}:{keywords:p},directory:t}}function A(n){const t=n.displayName;if(t===void 0)return;if(typeof t!="string")throw i("Manifest field `displayName` must be a string.");const e=t.trim();if(e.length===0||e.length>y||M(e))throw i(`Manifest field \`displayName\` must be a non-empty string of at most ${y} characters.`);return e}function M(n){return[...n].some(t=>{const e=t.codePointAt(0)??0;return e<32||e===127})}function o(n,t){const e=n[t];if(e!==void 0){if(typeof e!="string")throw i(`Manifest field \`${t}\` must be a string.`);return e}}function k(n,t){const e=n[t];if(e!==void 0){if(!Array.isArray(e)||e.some(r=>typeof r!="string"||r.trim().length===0))throw i(`Manifest field \`${t}\` must be an array of non-empty strings.`);return e.map(r=>r.trim())}}function i(n){return new g(h.PLUGIN_MANIFEST_INVALID,n,{category:"extension",userMessage:`Invalid plugin: ${n}`})}export{v as PLUGIN_LAYOUT,L as parsePluginManifest};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SkillManifest {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
userInvocable: boolean;
|
|
5
|
+
modelInvocable: boolean;
|
|
6
|
+
allowedTools: readonly string[];
|
|
7
|
+
directory: string;
|
|
8
|
+
body: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseSkillDocument(raw: string, directory: string): SkillManifest;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{CliError as f}from"../errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../errors/error-codes.js";import{parseYamlList as p,parseYamlMapping as u}from"./yaml-subset.js";function b(t,m){const n=t.replace(/^\uFEFF/,"");if(!n.startsWith(`---
|
|
2
|
+
`)&&!n.startsWith(`---\r
|
|
3
|
+
`))throw e("Skill must start with YAML frontmatter.");const r=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);if(r===null)throw e("Skill frontmatter is not closed.");const l=r[1],a=r[2];if(l===void 0||a===void 0)throw e("Skill document is incomplete.");const o=u(l,e),i=o.name,s=o.description;if(typeof i!="string"||typeof s!="string"||s.trim().length===0)throw e("Skill requires name and description.");if(!/^[a-z0-9][a-z0-9-]{0,63}$/.test(i))throw e("Skill name must be lowercase kebab-case.");return{name:i,description:s,userInvocable:!c(o["user-invocable"]),modelInvocable:!c(o["model-invocable"]),allowedTools:p(o["allowed-tools"]),directory:m,body:a.trim()}}function c(t){return typeof t=="string"&&t.toLowerCase()==="false"}function e(t){return new f(d.SKILL_FRONTMATTER_INVALID,t,{category:"extension",userMessage:`Invalid skill: ${t}`})}export{b as parseSkillDocument};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CliError } from '../errors/cli-error.js';
|
|
2
|
+
export type YamlValue = string | readonly string[];
|
|
3
|
+
/**
|
|
4
|
+
* Parses the deliberately small YAML mapping subset used by extension metadata.
|
|
5
|
+
* It supports scalars, folded/literal blocks and string lists without executing
|
|
6
|
+
* YAML tags or constructing arbitrary objects.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseYamlMapping(raw: string, invalid?: (message: string) => CliError): Record<string, YamlValue>;
|
|
9
|
+
export declare function parseYamlList(value: YamlValue | undefined): readonly string[];
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{CliError as f}from"../errors/cli-error.js";import{CLI_ERROR_CODES as p}from"../errors/error-codes.js";function w(t,i=g){const n=t.split(/\r?\n/),o={};for(let e=0;e<n.length;e+=1){const l=n[e]??"";if(l.trim().length===0||l.trimStart().startsWith("#"))continue;const u=l.match(/^([A-Za-z][A-Za-z0-9_-]*):(?:[ \t]*(.*))?$/u);if(u===null)throw i(`Invalid YAML metadata line: ${l}`);const a=u[1]?.toLowerCase(),s=u[2]??"";if(a===void 0)throw i("YAML metadata key is invalid.");if(s===">"||s==="|"){const r=[];for(;e+1<n.length&&h(n[e+1]??"");)r.push(d(n[++e]??""));o[a]=s===">"?r.join(" ").replace(/\s+/gu," ").trim():r.join(`
|
|
2
|
+
`).trimEnd();continue}if(s.trim().length===0&&e+1<n.length&&m(n[e+1]??"")){const r=[];for(;e+1<n.length&&m(n[e+1]??"");)r.push(c(n[++e].trim().slice(2).trim()));o[a]=r;continue}o[a]=c(s.trim())}return o}function A(t){if(t===void 0)return[];if(typeof t!="string")return t;const i=t.trim().replace(/^\[|\]$/g,"").trim();return i.length===0?[]:(i.includes(",")?i.split(","):i.split(/\s+/u)).map(c).map(n=>n.trim()).filter(Boolean)}function h(t){return/^\s+/.test(t)||t.trim().length===0}function m(t){return/^\s+-\s+/.test(t)}function d(t){return t.trim().length===0?"":t.replace(/^\s{2}/u,"")}function c(t){return t.replace(/^(['"])([\s\S]*)\1$/u,"$2")}function g(t){return new f(p.SKILL_FRONTMATTER_INVALID,t,{category:"extension",userMessage:`Invalid extension metadata: ${t}`})}export{A as parseYamlList,w as parseYamlMapping};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type FileDiffLineKind = 'context' | 'addition' | 'deletion';
|
|
2
|
+
export interface FileDiffLine {
|
|
3
|
+
readonly kind: FileDiffLineKind;
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly oldLine?: number;
|
|
6
|
+
readonly newLine?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface FileChangeDiff {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly lines: readonly FileDiffLine[];
|
|
11
|
+
readonly additions: number;
|
|
12
|
+
readonly deletions: number;
|
|
13
|
+
readonly truncated: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface FileDiffOptions {
|
|
16
|
+
maxLines?: number;
|
|
17
|
+
maxInputLines?: number;
|
|
18
|
+
truncated?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Creates a bounded, deterministic line diff suitable for terminal rendering. */
|
|
21
|
+
export declare function createFileChangeDiff(path: string, before: string, after: string, options?: FileDiffOptions): FileChangeDiff;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
function w(i,o,s,n={}){const e=n.maxInputLines??400,x=n.maxLines??240,f=L(o),m=L(s),I=f.length>e||m.length>e,d=f.slice(0,e),r=m.slice(0,e),p=b(d,r),c=[];let h=1,u=1,t=0,l=0;for(;t<d.length||l<r.length;)t<d.length&&l<r.length&&d[t]===r[l]?(c.push({kind:"context",text:d[t]??"",oldLine:h,newLine:u}),t+=1,l+=1,h+=1,u+=1):l<r.length&&(t===d.length||(p[t+1]?.[l]??0)<(p[t]?.[l+1]??0))?(c.push({kind:"addition",text:r[l]??"",newLine:u}),l+=1,u+=1):(c.push({kind:"deletion",text:d[t]??"",oldLine:h}),t+=1,h+=1);const k=n.truncated===!0||I||c.length>x,a=c.slice(0,x);return{path:i,lines:a,additions:a.filter(g=>g.kind==="addition").length,deletions:a.filter(g=>g.kind==="deletion").length,truncated:k}}function L(i){return i.length===0?[]:i.replace(/\r\n/gu,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`)}function b(i,o){const s=Array.from({length:i.length+1},()=>Array(o.length+1).fill(0));for(let n=i.length-1;n>=0;n-=1)for(let e=o.length-1;e>=0;e-=1)s[n][e]=i[n]===o[e]?(s[n+1]?.[e+1]??0)+1:Math.max(s[n+1]?.[e]??0,s[n]?.[e+1]??0);return s}export{w as createFileChangeDiff};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const INTENT_KINDS: readonly ["answer", "research", "change", "automation"];
|
|
2
|
+
export type IntentKind = typeof INTENT_KINDS[number];
|
|
3
|
+
export interface IntentStep {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly acceptanceCriteria: readonly string[];
|
|
7
|
+
readonly requiresVerification: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IntentContract {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly kind: IntentKind;
|
|
12
|
+
readonly objective: string;
|
|
13
|
+
readonly steps: readonly IntentStep[];
|
|
14
|
+
readonly createdAt: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IntentCompilationInput {
|
|
17
|
+
readonly kind: IntentKind;
|
|
18
|
+
readonly objective: string;
|
|
19
|
+
readonly steps: readonly Omit<IntentStep, 'id'>[];
|
|
20
|
+
}
|
|
21
|
+
export interface CompletionAssessment {
|
|
22
|
+
readonly decision: 'complete' | 'continue';
|
|
23
|
+
readonly missing: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The host, not the model, owns the minimum verification policy for work
|
|
27
|
+
* that can change state or execute an operational workflow.
|
|
28
|
+
*/
|
|
29
|
+
export declare function requiresHostVerification(kind: IntentKind): boolean;
|
|
30
|
+
export declare function createIntentContract(input: IntentCompilationInput, timestamp?: string): IntentContract;
|
|
31
|
+
export declare function normalizeIntentCompilation(value: unknown): IntentCompilationInput;
|
|
32
|
+
export declare function fallbackIntent(prompt: string): IntentContract;
|
|
33
|
+
export declare function isIntentKind(value: unknown): value is IntentKind;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import p from"node:crypto";import{CliError as f}from"../errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../errors/error-codes.js";import{findUnexpectedRecordKey as s,isRecord as a}from"../validation/record-schema.js";const u=["answer","research","change","automation"];function l(t){return t==="change"||t==="automation"}function h(t,n=new Date().toISOString()){const e=m(t),i=l(e.kind);return{id:p.randomUUID(),kind:e.kind,objective:e.objective,steps:e.steps.map((o,c)=>({...o,requiresVerification:i||o.requiresVerification,id:`step-${c+1}`})),createdAt:n}}function m(t){if(!a(t))throw r("Intent compilation must be an object.");const n=s(t,["kind","objective","steps"]);if(n!==void 0)throw r(`Unsupported intent field: ${n}.`);const e=t.kind,i=t.objective,o=t.steps;if(!g(e))throw r("Intent kind is invalid.");if(typeof i!="string"||i.trim().length===0||i.length>16384)throw r("Intent objective is invalid.");if(!Array.isArray(o)||o.length===0||o.length>10)throw r("Intent requires between one and ten steps.");return{kind:e,objective:i.trim(),steps:o.map(I)}}function j(t){const n=t.trim();if(n.length===0)throw r("Intent objective is required.");return h({kind:"change",objective:n,steps:[{title:"Handle and verify the requested outcome",acceptanceCriteria:[n],requiresVerification:!0}]})}function g(t){return typeof t=="string"&&u.includes(t)}function I(t){if(!a(t))throw r("Intent step is invalid.");const n=s(t,["title","acceptanceCriteria","requiresVerification"]);if(n!==void 0)throw r(`Unsupported intent step field: ${n}.`);const e=t.title,i=t.acceptanceCriteria,o=t.requiresVerification;if(typeof e!="string"||e.trim().length===0||e.length>2048)throw r("Intent step title is invalid.");if(!Array.isArray(i)||i.length===0||i.length>16||i.some(c=>typeof c!="string"||c.trim().length===0||c.length>2048))throw r("Intent acceptance criteria are invalid.");if(typeof o!="boolean")throw r("Intent verification requirement is invalid.");return{title:e.trim(),acceptanceCriteria:i.map(c=>String(c).trim()),requiresVerification:o}}function r(t){return new f(d.INVALID_ARGUMENT,t,{category:"intent",userMessage:t})}export{u as INTENT_KINDS,h as createIntentContract,j as fallbackIntent,g as isIntentKind,m as normalizeIntentCompilation,l as requiresHostVerification};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Mirrors the gateway's public media validation contract. The gateway remains authoritative. */
|
|
2
|
+
export declare const GATEWAY_MEDIA_LIMITS: {
|
|
3
|
+
readonly imagePromptCharacters: 32000;
|
|
4
|
+
readonly imageCount: 16;
|
|
5
|
+
readonly imageEditFileBytes: number;
|
|
6
|
+
readonly imageEditMaskBytes: number;
|
|
7
|
+
readonly imageEditTotalBytes: number;
|
|
8
|
+
readonly audioUploadBytes: number;
|
|
9
|
+
readonly speechInputCharacters: 4096;
|
|
10
|
+
readonly speechInstructionsCharacters: 4096;
|
|
11
|
+
readonly speechVoiceCharacters: 64;
|
|
12
|
+
readonly audioPromptCharacters: 4096;
|
|
13
|
+
readonly transcriptionLanguageCharacters: 10;
|
|
14
|
+
};
|
|
15
|
+
/** The installed SDK buffers binary media responses to this exact upper bound. */
|
|
16
|
+
export declare const SDK_BINARY_MEDIA_RESPONSE_BYTES: number;
|
|
17
|
+
type Flags = ReadonlyMap<string, string | boolean>;
|
|
18
|
+
export declare function validateMediaCommandOptions(action: string, positionals: readonly string[], flags: Flags): void;
|
|
19
|
+
export declare function validateImageEditInputCount(paths: readonly string[]): void;
|
|
20
|
+
export declare function validateUploadSize(bytes: number, maximum: number, label: string): void;
|
|
21
|
+
export declare function validateImageEditTotalSize(bytes: number): void;
|
|
22
|
+
export declare function formatByteLimit(bytes: number): string;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CliError as I}from"../errors/cli-error.js";import{CLI_ERROR_CODES as l}from"../errors/error-codes.js";const p=1e3,s=1e6,u={imagePromptCharacters:32e3,imageCount:16,imageEditFileBytes:47*s,imageEditMaskBytes:4*s,imageEditTotalBytes:128*s,audioUploadBytes:50*s,speechInputCharacters:4096,speechInstructionsCharacters:4096,speechVoiceCharacters:64,audioPromptCharacters:4096,transcriptionLanguageCharacters:10},M=50*1024*1024;function O(e,t,i){v(i),(e==="image.generate"||e==="image.edit")&&C(t,i),e==="image.edit"&&E(i),e==="audio.speech"&&_(t,i),e==="audio.transcribe"&&h(i,!0),e==="audio.translate"&&h(i,!1),e==="video.generate"&&$(i)}function T(e){if(e.length===0)throw n("`--image` requires at least one workspace image path.");if(e.length>u.imageCount)throw n(`Image edits support at most ${u.imageCount} input images.`)}function A(e,t,i){if(!(e>0&&e<=t))throw n(`${i} must be between 1 byte and ${f(t)}.`)}function q(e){if(!(e<=u.imageEditTotalBytes))throw n(`Image edit uploads must not exceed ${f(u.imageEditTotalBytes)} in total.`)}function f(e){return e>=s?`${e/s} MB`:e>=p?`${e/p} KB`:`${e} bytes`}function v(e){const t=r(e,"out");if(c(e,"force")&&t===void 0)throw n("`--force` is only valid with `--out`.")}function C(e,t){d(w(e,"image"),u.imagePromptCharacters,"Image prompt");const i=g(t,"n");if(i!==void 0&&(i<1||i>u.imageCount))throw n(`--n must be an integer between 1 and ${u.imageCount}.`);if(i!==void 0&&i>1&&r(t,"out")!==void 0)throw n("--out can only be used when exactly one image artifact is requested. Use --out-dir instead.");const o=r(t,"size");if(o!==void 0&&o!=="auto"&&!/^\d{2,4}x\d{2,4}$/u.test(o))throw n("--size must be `auto` or WIDTHxHEIGHT.");o!==void 0&&o!=="auto"&&S(o);const a=r(t,"output-format"),m=g(t,"output-compression");if(m!==void 0&&(m<0||m>100))throw n("--output-compression must be an integer between 0 and 100.");if(m!==void 0&&a!=="jpeg"&&a!=="webp")throw n("--output-compression requires --output-format jpeg or webp.");d(r(t,"moderation"),64,"Moderation value"),d(r(t,"user"),255,"User value")}function E(e){if(r(e,"image")===void 0)throw n("Missing required option --image.")}function _(e,t){d(w(e,"speech"),u.speechInputCharacters,"Speech input"),d(x(t,"voice"),u.speechVoiceCharacters,"Voice"),d(r(t,"instructions"),u.speechInstructionsCharacters,"Speech instructions");const i=r(t,"stream-format");if(i!==void 0&&i!=="audio"&&i!=="sse")throw n("--stream-format must be either `audio` or `sse`.");if(i==="sse"&&(r(t,"out")!==void 0||r(t,"out-dir")!==void 0||c(t,"force")))throw n("--stream-format sse cannot be combined with output file options.");const o=b(t,"speed");if(o!==void 0&&(o<.25||o>4))throw n("--speed must be between 0.25 and 4.")}function h(e,t){d(r(e,"prompt"),u.audioPromptCharacters,"Audio prompt");const i=b(e,"temperature");if(i!==void 0&&(i<0||i>1))throw n("--temperature must be between 0 and 1.");if(t&&(d(r(e,"language"),u.transcriptionLanguageCharacters,"Language code"),r(e,"timestamp-granularities")!==void 0&&r(e,"response-format")!=="verbose_json"))throw n("--timestamp-granularities requires --response-format verbose_json.")}function $(e){if(c(e,"no-wait")&&(r(e,"out")!==void 0||r(e,"out-dir")!==void 0||c(e,"force")))throw n("--no-wait cannot be combined with output options. Use video download after the operation completes.")}function S(e){const[t,i]=e.split("x"),o=Number(t),a=Number(i);if(!Number.isSafeInteger(o)||!Number.isSafeInteger(a)||o<1||a<1||o>4096||a>4096||Math.max(o,a)/Math.min(o,a)>3||o%16!==0||a%16!==0)throw n("--size must use positive dimensions up to 4096px, a maximum 3:1 aspect ratio, and multiples of 16.")}function w(e,t){const i=e.join(" ").trim();if(i.length===0)throw n(`A prompt is required for ${t}.`);return i}function x(e,t){const i=r(e,t);if(i===void 0)throw n(`Missing required option --${t}.`);return i}function d(e,t,i){if(e!==void 0&&e.length>t)throw n(`${i} must not exceed ${t} characters.`)}function g(e,t){const i=r(e,t);if(i!==void 0){if(!/^\d+$/u.test(i)||!Number.isSafeInteger(Number(i)))throw n(`--${t} must be an integer.`);return Number(i)}}function b(e,t){const i=r(e,t);if(i===void 0)return;const o=Number(i);if(!Number.isFinite(o))throw n(`--${t} must be a finite number.`);return o}function r(e,t){const i=e.get(t);return typeof i=="string"&&i.trim().length>0?i.trim():void 0}function c(e,t){return e.get(t)===!0||e.get(t)==="true"}function n(e){return new I(l.INVALID_ARGUMENT,e,{category:"media",userMessage:e})}export{u as GATEWAY_MEDIA_LIMITS,M as SDK_BINARY_MEDIA_RESPONSE_BYTES,f as formatByteLimit,T as validateImageEditInputCount,q as validateImageEditTotalSize,O as validateMediaCommandOptions,A as validateUploadSize};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _=5e3,E=12e5,T=6e4;export{T as DEFAULT_MEDIA_DOWNLOAD_TIMEOUT_MS,_ as DEFAULT_VIDEO_POLL_INTERVAL_MS,E as DEFAULT_VIDEO_WAIT_TIMEOUT_MS};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type MediaArtifactKind = 'image' | 'speech' | 'transcription' | 'translation' | 'video';
|
|
2
|
+
export interface MediaBinary {
|
|
3
|
+
readonly bytes: Uint8Array;
|
|
4
|
+
readonly contentType?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GeneratedImage {
|
|
7
|
+
readonly base64?: string;
|
|
8
|
+
readonly url?: string;
|
|
9
|
+
readonly revisedPrompt?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface VideoOperation {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly done: boolean;
|
|
14
|
+
readonly errorMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MediaArtifactRequest {
|
|
17
|
+
readonly kind: MediaArtifactKind;
|
|
18
|
+
readonly source: string;
|
|
19
|
+
readonly extension: string;
|
|
20
|
+
/** Filename stem without extension; the artifact store appends extension. */
|
|
21
|
+
readonly out?: string;
|
|
22
|
+
readonly outDir?: string;
|
|
23
|
+
readonly force: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface StoredMediaArtifact {
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly bytes: number;
|
|
28
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface MediaExecutionPolicy {
|
|
2
|
+
readonly videoPollIntervalMs: number;
|
|
3
|
+
readonly videoWaitTimeoutMs: number;
|
|
4
|
+
readonly downloadTimeoutMs: number;
|
|
5
|
+
}
|
|
6
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
7
|
+
/** CLI-owned local resource policy. It does not alter gateway or SDK contracts. */
|
|
8
|
+
export declare function resolveMediaExecutionPolicy(environment?: Environment): MediaExecutionPolicy;
|
|
9
|
+
export {};
|