@lotagate/cli 0.1.21 → 0.1.22
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/dist/application/agent/agent-history.d.ts +3 -0
- package/dist/application/agent/agent-history.js +81 -0
- package/dist/application/agent/agent-input-context.d.ts +9 -0
- package/dist/application/agent/agent-input-context.js +12 -0
- package/dist/application/agent/agent-limit.d.ts +3 -0
- package/dist/application/agent/agent-limit.js +12 -0
- package/dist/application/agent/agent-run-tracker.d.ts +30 -0
- package/dist/application/agent/agent-run-tracker.js +68 -0
- package/dist/application/agent/agent-session-store.d.ts +19 -0
- package/dist/application/agent/agent-session-store.js +74 -0
- package/dist/application/agent/capability-profile.d.ts +37 -0
- package/dist/application/agent/capability-profile.js +13 -0
- package/dist/application/agent/cli-agent-execution-service.d.ts +81 -0
- package/dist/application/agent/cli-agent-execution-service.js +279 -0
- package/dist/application/agent/context-compaction-persistence.d.ts +8 -0
- package/dist/application/agent/context-compaction-persistence.js +27 -0
- package/dist/application/agent/context-compaction.d.ts +20 -0
- package/dist/application/agent/context-compaction.js +114 -0
- package/dist/application/agent/prompt-data-safety.d.ts +14 -0
- package/dist/application/agent/prompt-data-safety.js +38 -0
- package/dist/application/agent/safe-system-prompt.d.ts +3 -0
- package/dist/application/agent/safe-system-prompt.js +19 -0
- package/dist/application/agent/scoped-tool-executor.d.ts +13 -0
- package/dist/application/agent/scoped-tool-executor.js +32 -0
- package/dist/application/agent/system-prompt-builder.d.ts +14 -0
- package/dist/application/agent/system-prompt-builder.js +199 -0
- package/dist/application/agent/tool-catalog.d.ts +14 -0
- package/dist/application/agent/tool-catalog.js +30 -0
- package/dist/application/agent/tool-display.d.ts +6 -0
- package/dist/application/agent/tool-display.js +59 -0
- package/dist/application/agent/tool-hook-lifecycle.d.ts +19 -0
- package/dist/application/agent/tool-hook-lifecycle.js +85 -0
- package/dist/application/auth/authentication-service.d.ts +20 -0
- package/dist/application/auth/authentication-service.js +44 -0
- package/dist/application/chat/chat-service.d.ts +12 -0
- package/dist/application/chat/chat-service.js +19 -0
- package/dist/application/chat/pending-attachment-store.d.ts +12 -0
- package/dist/application/chat/pending-attachment-store.js +28 -0
- package/dist/application/commands/application-command-executor.d.ts +20 -0
- package/dist/application/commands/application-command-executor.js +66 -0
- package/dist/application/commands/cli-args.d.ts +6 -0
- package/dist/application/commands/cli-args.js +43 -0
- package/dist/application/commands/cli-command-services.d.ts +16 -0
- package/dist/application/commands/cli-command-services.js +405 -0
- package/dist/application/commands/command-catalog.d.ts +6 -0
- package/dist/application/commands/command-catalog.js +159 -0
- package/dist/application/commands/command-contract.d.ts +58 -0
- package/dist/application/commands/command-contract.js +1 -0
- package/dist/application/commands/command-hints.d.ts +9 -0
- package/dist/application/commands/command-hints.js +17 -0
- package/dist/application/commands/command-output.d.ts +4 -0
- package/dist/application/commands/command-output.js +1 -0
- package/dist/application/commands/command-parser.d.ts +10 -0
- package/dist/application/commands/command-parser.js +155 -0
- package/dist/application/commands/command-presentation.d.ts +7 -0
- package/dist/application/commands/command-presentation.js +131 -0
- package/dist/application/commands/command-registry.d.ts +11 -0
- package/dist/application/commands/command-registry.js +64 -0
- package/dist/application/commands/command-runtime.d.ts +2 -0
- package/dist/application/commands/command-runtime.js +3 -0
- package/dist/application/commands/goal-command-handlers.d.ts +3 -0
- package/dist/application/commands/goal-command-handlers.js +120 -0
- package/dist/application/commands/media-command-handlers.d.ts +9 -0
- package/dist/application/commands/media-command-handlers.js +307 -0
- package/dist/application/commands/media-command-output.d.ts +11 -0
- package/dist/application/commands/media-command-output.js +8 -0
- package/dist/application/commands/runtime-command-handlers.d.ts +7 -0
- package/dist/application/commands/runtime-command-handlers.js +177 -0
- package/dist/application/commands/stream-output.d.ts +4 -0
- package/dist/application/commands/stream-output.js +10 -0
- package/dist/application/commands/utility-commands.d.ts +6 -0
- package/dist/application/commands/utility-commands.js +81 -0
- package/dist/application/config/execution-config.d.ts +4 -0
- package/dist/application/config/execution-config.js +6 -0
- package/dist/application/extensions/extension-list-contract.d.ts +13 -0
- package/dist/application/extensions/extension-list-contract.js +1 -0
- package/dist/application/extensions/extension-list-formatters.d.ts +31 -0
- package/dist/application/extensions/extension-list-formatters.js +98 -0
- package/dist/application/extensions/extension-list-output.d.ts +3 -0
- package/dist/application/extensions/extension-list-output.js +7 -0
- package/dist/application/extensions/plugin-contribution-registry.d.ts +15 -0
- package/dist/application/extensions/plugin-contribution-registry.js +80 -0
- package/dist/application/extensions/skill-scope-store.d.ts +23 -0
- package/dist/application/extensions/skill-scope-store.js +33 -0
- package/dist/application/formatting/compact-number.d.ts +2 -0
- package/dist/application/formatting/compact-number.js +18 -0
- package/dist/application/formatting/compact-table.d.ts +22 -0
- package/dist/application/formatting/compact-table.js +49 -0
- package/dist/application/media/video-operation-poller.d.ts +5 -0
- package/dist/application/media/video-operation-poller.js +42 -0
- package/dist/application/model/cached-model-catalog.d.ts +13 -0
- package/dist/application/model/cached-model-catalog.js +31 -0
- package/dist/application/model/initial-model-selection.d.ts +10 -0
- package/dist/application/model/initial-model-selection.js +11 -0
- package/dist/application/model/model-catalog-service.d.ts +6 -0
- package/dist/application/model/model-catalog-service.js +13 -0
- package/dist/application/model/model-context-window.d.ts +3 -0
- package/dist/application/model/model-context-window.js +23 -0
- package/dist/application/orchestration/cli-subagent-service.d.ts +70 -0
- package/dist/application/orchestration/cli-subagent-service.js +328 -0
- package/dist/application/orchestration/cli-turn-event-projector.d.ts +12 -0
- package/dist/application/orchestration/cli-turn-event-projector.js +81 -0
- package/dist/application/orchestration/cli-turn-events.d.ts +76 -0
- package/dist/application/orchestration/cli-turn-events.js +39 -0
- package/dist/application/orchestration/cli-turn-persistence.d.ts +6 -0
- package/dist/application/orchestration/cli-turn-persistence.js +14 -0
- package/dist/application/orchestration/goal-evaluator.d.ts +18 -0
- package/dist/application/orchestration/goal-evaluator.js +88 -0
- package/dist/application/orchestration/goal-input.d.ts +3 -0
- package/dist/application/orchestration/goal-input.js +19 -0
- package/dist/application/orchestration/goal-output.d.ts +2 -0
- package/dist/application/orchestration/goal-output.js +11 -0
- package/dist/application/orchestration/goal-runner.d.ts +22 -0
- package/dist/application/orchestration/goal-runner.js +153 -0
- package/dist/application/orchestration/goal-usage.d.ts +9 -0
- package/dist/application/orchestration/goal-usage.js +19 -0
- package/dist/application/orchestration/headless-agent-turn.d.ts +32 -0
- package/dist/application/orchestration/headless-agent-turn.js +82 -0
- package/dist/application/orchestration/plan-generator.d.ts +7 -0
- package/dist/application/orchestration/plan-generator.js +34 -0
- package/dist/application/orchestration/subagent-coordinator.d.ts +33 -0
- package/dist/application/orchestration/subagent-coordinator.js +28 -0
- package/dist/application/orchestration/subagent-handoff.d.ts +2 -0
- package/dist/application/orchestration/subagent-handoff.js +68 -0
- package/dist/application/orchestration/subagent-tool-executor.d.ts +12 -0
- package/dist/application/orchestration/subagent-tool-executor.js +93 -0
- package/dist/application/orchestration/task-assessment.d.ts +4 -0
- package/dist/application/orchestration/task-assessment.js +35 -0
- package/dist/application/orchestration/task-graph.d.ts +13 -0
- package/dist/application/orchestration/task-graph.js +56 -0
- package/dist/application/orchestration/task-scheduler.d.ts +18 -0
- package/dist/application/orchestration/task-scheduler.js +88 -0
- package/dist/application/project/project-trust-service.d.ts +13 -0
- package/dist/application/project/project-trust-service.js +74 -0
- package/dist/application/protocol/browser-host-tool-executor.d.ts +41 -0
- package/dist/application/protocol/browser-host-tool-executor.js +88 -0
- package/dist/application/protocol/desktop-agent-command.d.ts +9 -0
- package/dist/application/protocol/desktop-agent-command.js +663 -0
- package/dist/application/protocol/desktop-attachment-store.d.ts +16 -0
- package/dist/application/protocol/desktop-attachment-store.js +82 -0
- package/dist/application/protocol/desktop-command-catalog.d.ts +2 -0
- package/dist/application/protocol/desktop-command-catalog.js +19 -0
- package/dist/application/protocol/desktop-command-contract.d.ts +22 -0
- package/dist/application/protocol/desktop-command-contract.js +3 -0
- package/dist/application/protocol/desktop-command-executor.d.ts +16 -0
- package/dist/application/protocol/desktop-command-executor.js +47 -0
- package/dist/application/protocol/desktop-command-output.d.ts +15 -0
- package/dist/application/protocol/desktop-command-output.js +24 -0
- package/dist/application/protocol/desktop-execution-policy.d.ts +17 -0
- package/dist/application/protocol/desktop-execution-policy.js +49 -0
- package/dist/application/protocol/desktop-host-tool-executor.d.ts +57 -0
- package/dist/application/protocol/desktop-host-tool-executor.js +53 -0
- package/dist/application/protocol/desktop-orchestration-events.d.ts +5 -0
- package/dist/application/protocol/desktop-orchestration-events.js +37 -0
- package/dist/application/protocol/json-line-writer.d.ts +9 -0
- package/dist/application/protocol/json-line-writer.js +19 -0
- package/dist/application/protocol/jsonl-agent-command.d.ts +3 -0
- package/dist/application/protocol/jsonl-agent-command.js +97 -0
- package/dist/application/protocol/jsonl-protocol.d.ts +52 -0
- package/dist/application/protocol/jsonl-protocol.js +170 -0
- package/dist/application/security/desktop-tool-scope-policy.d.ts +3 -0
- package/dist/application/security/desktop-tool-scope-policy.js +52 -0
- package/dist/application/security/tool-action-risk-analyzer.d.ts +13 -0
- package/dist/application/security/tool-action-risk-analyzer.js +64 -0
- package/dist/application/security/tool-approval-service.d.ts +35 -0
- package/dist/application/security/tool-approval-service.js +97 -0
- package/dist/application/security/tool-risk-classifier.d.ts +11 -0
- package/dist/application/security/tool-risk-classifier.js +65 -0
- package/dist/application/security/workspace-permission-policy.d.ts +10 -0
- package/dist/application/security/workspace-permission-policy.js +50 -0
- package/dist/application/session/project-session-access.d.ts +8 -0
- package/dist/application/session/project-session-access.js +19 -0
- package/dist/application/session/session-compaction-service.d.ts +10 -0
- package/dist/application/session/session-compaction-service.js +43 -0
- package/dist/application/session/session-turn-lifecycle.d.ts +5 -0
- package/dist/application/session/session-turn-lifecycle.js +31 -0
- package/dist/application/workspace/workspace-file-index.d.ts +15 -0
- package/dist/application/workspace/workspace-file-index.js +60 -0
- package/dist/application/workspace/workspace-file-reference-resolver.d.ts +14 -0
- package/dist/application/workspace/workspace-file-reference-resolver.js +123 -0
- package/dist/application/workspace/workspace-instruction-loader.d.ts +8 -0
- package/dist/application/workspace/workspace-instruction-loader.js +55 -0
- package/dist/bootstrap/composition-root.d.ts +6 -0
- package/dist/bootstrap/composition-root.js +4 -0
- package/dist/bootstrap/global-cli-options.d.ts +6 -0
- package/dist/bootstrap/global-cli-options.js +29 -0
- package/dist/bootstrap/native-devtools-stub.d.ts +10 -0
- package/dist/bootstrap/native-devtools-stub.js +10 -0
- package/dist/bootstrap/native-entry.d.ts +1 -0
- package/dist/bootstrap/native-entry.js +6 -0
- package/dist/bootstrap/native-tiktoken.d.ts +4 -0
- package/dist/bootstrap/native-tiktoken.js +5 -0
- package/dist/bootstrap/runtime-factory.d.ts +35 -0
- package/dist/bootstrap/runtime-factory.js +44 -0
- package/dist/bootstrap/shutdown-manager.d.ts +10 -0
- package/dist/bootstrap/shutdown-manager.js +14 -0
- package/dist/bootstrap/startup-sequence.d.ts +5 -0
- package/dist/bootstrap/startup-sequence.js +10 -0
- package/dist/domain/auth/auth-profile.d.ts +14 -0
- package/dist/domain/auth/auth-profile.js +39 -0
- package/dist/domain/config/config-schema.d.ts +17 -0
- package/dist/domain/config/config-schema.js +105 -0
- package/dist/domain/errors/cli-command-hint.d.ts +5 -0
- package/dist/domain/errors/cli-command-hint.js +1 -0
- package/dist/domain/errors/cli-error.d.ts +35 -0
- package/dist/domain/errors/cli-error.js +129 -0
- package/dist/domain/errors/error-codes.d.ts +46 -0
- package/dist/domain/errors/error-codes.js +45 -0
- package/dist/domain/extensions/extension-scope.d.ts +3 -0
- package/dist/domain/extensions/extension-scope.js +23 -0
- package/dist/domain/extensions/extension-state.d.ts +5 -0
- package/dist/domain/extensions/extension-state.js +11 -0
- package/dist/domain/extensions/hook-manifest.d.ts +10 -0
- package/dist/domain/extensions/hook-manifest.js +23 -0
- package/dist/domain/extensions/mcp-config.d.ts +18 -0
- package/dist/domain/extensions/mcp-config.js +111 -0
- package/dist/domain/extensions/plugin-manifest.d.ts +11 -0
- package/dist/domain/extensions/plugin-manifest.js +43 -0
- package/dist/domain/extensions/skill-manifest.d.ts +10 -0
- package/dist/domain/extensions/skill-manifest.js +51 -0
- package/dist/domain/filesystem/file-change-diff.d.ts +21 -0
- package/dist/domain/filesystem/file-change-diff.js +60 -0
- package/dist/domain/media/gateway-media-contract.d.ts +23 -0
- package/dist/domain/media/gateway-media-contract.js +163 -0
- package/dist/domain/media/media-contract.d.ts +28 -0
- package/dist/domain/media/media-contract.js +1 -0
- package/dist/domain/media/media-execution-policy.d.ts +9 -0
- package/dist/domain/media/media-execution-policy.js +31 -0
- package/dist/domain/orchestration/goal.d.ts +58 -0
- package/dist/domain/orchestration/goal.js +113 -0
- package/dist/domain/orchestration/subagent-identity.d.ts +2 -0
- package/dist/domain/orchestration/subagent-identity.js +8 -0
- package/dist/domain/orchestration/subagent.d.ts +33 -0
- package/dist/domain/orchestration/subagent.js +1 -0
- package/dist/domain/orchestration/task.d.ts +31 -0
- package/dist/domain/orchestration/task.js +1 -0
- package/dist/domain/project/project-identity.d.ts +6 -0
- package/dist/domain/project/project-identity.js +4 -0
- package/dist/domain/runtime/assistant-delta-normalizer.d.ts +11 -0
- package/dist/domain/runtime/assistant-delta-normalizer.js +19 -0
- package/dist/domain/runtime/resource-limits.d.ts +60 -0
- package/dist/domain/runtime/resource-limits.js +60 -0
- package/dist/domain/session/attachment.d.ts +13 -0
- package/dist/domain/session/attachment.js +1 -0
- package/dist/domain/session/session-schema.d.ts +6 -0
- package/dist/domain/session/session-schema.js +28 -0
- package/dist/domain/session/session.d.ts +27 -0
- package/dist/domain/session/session.js +1 -0
- package/dist/domain/settings/settings-document.d.ts +8 -0
- package/dist/domain/settings/settings-document.js +36 -0
- package/dist/domain/validation/record-schema.d.ts +4 -0
- package/dist/domain/validation/record-schema.js +9 -0
- package/dist/domain/workspace/workspace-settings.d.ts +12 -0
- package/dist/domain/workspace/workspace-settings.js +44 -0
- package/dist/infrastructure/agent-sdk/agent-instance-factory.d.ts +22 -0
- package/dist/infrastructure/agent-sdk/agent-instance-factory.js +31 -0
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.d.ts +11 -0
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.js +447 -0
- package/dist/infrastructure/cache/cache-policy.d.ts +7 -0
- package/dist/infrastructure/cache/cache-policy.js +18 -0
- package/dist/infrastructure/cache/file-cache-store.d.ts +17 -0
- package/dist/infrastructure/cache/file-cache-store.js +121 -0
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.d.ts +11 -0
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.js +98 -0
- package/dist/infrastructure/clipboard/clipboard-policy.d.ts +8 -0
- package/dist/infrastructure/clipboard/clipboard-policy.js +19 -0
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.d.ts +10 -0
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.js +94 -0
- package/dist/infrastructure/clipboard/image-normalizer.d.ts +12 -0
- package/dist/infrastructure/clipboard/image-normalizer.js +78 -0
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.d.ts +7 -0
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.js +66 -0
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.d.ts +7 -0
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.js +70 -0
- package/dist/infrastructure/config/config-loader.d.ts +19 -0
- package/dist/infrastructure/config/config-loader.js +76 -0
- package/dist/infrastructure/config/environment-values.d.ts +2 -0
- package/dist/infrastructure/config/environment-values.js +7 -0
- package/dist/infrastructure/credentials/composite-credential-store.d.ts +11 -0
- package/dist/infrastructure/credentials/composite-credential-store.js +32 -0
- package/dist/infrastructure/credentials/encrypted-file-credential-store.d.ts +17 -0
- package/dist/infrastructure/credentials/encrypted-file-credential-store.js +181 -0
- package/dist/infrastructure/credentials/environment-credential-store.d.ts +11 -0
- package/dist/infrastructure/credentials/environment-credential-store.js +37 -0
- package/dist/infrastructure/credentials/secret-input.d.ts +7 -0
- package/dist/infrastructure/credentials/secret-input.js +44 -0
- package/dist/infrastructure/extensions/composite-mcp-config-store.d.ts +9 -0
- package/dist/infrastructure/extensions/composite-mcp-config-store.js +10 -0
- package/dist/infrastructure/extensions/extension-directory-reader.d.ts +2 -0
- package/dist/infrastructure/extensions/extension-directory-reader.js +15 -0
- package/dist/infrastructure/extensions/extension-source-resolver.d.ts +6 -0
- package/dist/infrastructure/extensions/extension-source-resolver.js +126 -0
- package/dist/infrastructure/extensions/file-mcp-config-store.d.ts +15 -0
- package/dist/infrastructure/extensions/file-mcp-config-store.js +66 -0
- package/dist/infrastructure/extensions/hook-runtime.d.ts +18 -0
- package/dist/infrastructure/extensions/hook-runtime.js +66 -0
- package/dist/infrastructure/extensions/mcp-runtime.d.ts +12 -0
- package/dist/infrastructure/extensions/mcp-runtime.js +52 -0
- package/dist/infrastructure/extensions/plugin-discovery.d.ts +5 -0
- package/dist/infrastructure/extensions/plugin-discovery.js +52 -0
- package/dist/infrastructure/extensions/plugin-manager.d.ts +26 -0
- package/dist/infrastructure/extensions/plugin-manager.js +139 -0
- package/dist/infrastructure/extensions/skill-discovery.d.ts +4 -0
- package/dist/infrastructure/extensions/skill-discovery.js +29 -0
- package/dist/infrastructure/extensions/skill-installer.d.ts +8 -0
- package/dist/infrastructure/extensions/skill-installer.js +88 -0
- package/dist/infrastructure/extensions/skill-manager.d.ts +22 -0
- package/dist/infrastructure/extensions/skill-manager.js +67 -0
- package/dist/infrastructure/extensions/skill-roots.d.ts +19 -0
- package/dist/infrastructure/extensions/skill-roots.js +25 -0
- package/dist/infrastructure/extensions/skill-tool-executor.d.ts +18 -0
- package/dist/infrastructure/extensions/skill-tool-executor.js +53 -0
- package/dist/infrastructure/filesystem/atomic-file-store.d.ts +12 -0
- package/dist/infrastructure/filesystem/atomic-file-store.js +106 -0
- package/dist/infrastructure/filesystem/bounded-file-reader.d.ts +6 -0
- package/dist/infrastructure/filesystem/bounded-file-reader.js +24 -0
- package/dist/infrastructure/filesystem/bounded-json-reader.d.ts +1 -0
- package/dist/infrastructure/filesystem/bounded-json-reader.js +7 -0
- package/dist/infrastructure/filesystem/fs-errors.d.ts +2 -0
- package/dist/infrastructure/filesystem/fs-errors.js +6 -0
- package/dist/infrastructure/filesystem/gateway-media-input-reader.d.ts +12 -0
- package/dist/infrastructure/filesystem/gateway-media-input-reader.js +49 -0
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.d.ts +21 -0
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.js +176 -0
- package/dist/infrastructure/filesystem/path-resolver.d.ts +20 -0
- package/dist/infrastructure/filesystem/path-resolver.js +119 -0
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.d.ts +13 -0
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.js +152 -0
- package/dist/infrastructure/logging/daily-rotating-file-writer.d.ts +20 -0
- package/dist/infrastructure/logging/daily-rotating-file-writer.js +75 -0
- package/dist/infrastructure/logging/log-redactor.d.ts +2 -0
- package/dist/infrastructure/logging/log-redactor.js +26 -0
- package/dist/infrastructure/logging/logging-policy.d.ts +6 -0
- package/dist/infrastructure/logging/logging-policy.js +6 -0
- package/dist/infrastructure/logging/structured-logger.d.ts +24 -0
- package/dist/infrastructure/logging/structured-logger.js +40 -0
- package/dist/infrastructure/network/safe-media-downloader.d.ts +23 -0
- package/dist/infrastructure/network/safe-media-downloader.js +239 -0
- package/dist/infrastructure/platform/host-platform.d.ts +14 -0
- package/dist/infrastructure/platform/host-platform.js +23 -0
- package/dist/infrastructure/platform/host-process.d.ts +17 -0
- package/dist/infrastructure/platform/host-process.js +116 -0
- package/dist/infrastructure/platform/platform-paths.d.ts +25 -0
- package/dist/infrastructure/platform/platform-paths.js +33 -0
- package/dist/infrastructure/project/file-project-trust-store.d.ts +12 -0
- package/dist/infrastructure/project/file-project-trust-store.js +59 -0
- package/dist/infrastructure/sdk/chat-completion-adapter.d.ts +8 -0
- package/dist/infrastructure/sdk/chat-completion-adapter.js +115 -0
- package/dist/infrastructure/sdk/lotagate-client-factory.d.ts +3 -0
- package/dist/infrastructure/sdk/lotagate-client-factory.js +8 -0
- package/dist/infrastructure/sdk/model-catalog-adapter.d.ts +19 -0
- package/dist/infrastructure/sdk/model-catalog-adapter.js +28 -0
- package/dist/infrastructure/sdk/sdk-media-gateway-client.d.ts +20 -0
- package/dist/infrastructure/sdk/sdk-media-gateway-client.js +97 -0
- package/dist/infrastructure/sessions/file-goal-store.d.ts +21 -0
- package/dist/infrastructure/sessions/file-goal-store.js +160 -0
- package/dist/infrastructure/sessions/file-session-store.d.ts +48 -0
- package/dist/infrastructure/sessions/file-session-store.js +525 -0
- package/dist/infrastructure/sessions/project-session-paths.d.ts +17 -0
- package/dist/infrastructure/sessions/project-session-paths.js +41 -0
- package/dist/infrastructure/sessions/session-index.d.ts +16 -0
- package/dist/infrastructure/sessions/session-index.js +84 -0
- package/dist/infrastructure/sessions/session-journal.d.ts +22 -0
- package/dist/infrastructure/sessions/session-journal.js +137 -0
- package/dist/infrastructure/sessions/subagent-journal-store.d.ts +28 -0
- package/dist/infrastructure/sessions/subagent-journal-store.js +30 -0
- package/dist/infrastructure/shell/shell-tool-executor.d.ts +17 -0
- package/dist/infrastructure/shell/shell-tool-executor.js +115 -0
- package/dist/infrastructure/tokens/tiktoken-token-estimator.d.ts +18 -0
- package/dist/infrastructure/tokens/tiktoken-token-estimator.js +48 -0
- package/dist/infrastructure/workspace/workspace-settings-store.d.ts +9 -0
- package/dist/infrastructure/workspace/workspace-settings-store.js +75 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +66 -0
- package/dist/ports/cache-store.d.ts +10 -0
- package/dist/ports/cache-store.js +1 -0
- package/dist/ports/chat-model.d.ts +30 -0
- package/dist/ports/chat-model.js +1 -0
- package/dist/ports/clipboard-adapter.d.ts +7 -0
- package/dist/ports/clipboard-adapter.js +1 -0
- package/dist/ports/clipboard-text-adapter.d.ts +3 -0
- package/dist/ports/clipboard-text-adapter.js +1 -0
- package/dist/ports/credential-store.d.ts +7 -0
- package/dist/ports/credential-store.js +1 -0
- package/dist/ports/goal-store.d.ts +12 -0
- package/dist/ports/goal-store.js +1 -0
- package/dist/ports/logger.d.ts +8 -0
- package/dist/ports/logger.js +1 -0
- package/dist/ports/media-gateway-client.d.ts +54 -0
- package/dist/ports/media-gateway-client.js +1 -0
- package/dist/ports/model-diagnostics.d.ts +17 -0
- package/dist/ports/model-diagnostics.js +1 -0
- package/dist/ports/project-trust-store.d.ts +12 -0
- package/dist/ports/project-trust-store.js +1 -0
- package/dist/ports/session-store.d.ts +58 -0
- package/dist/ports/session-store.js +1 -0
- package/dist/ports/subagent-lifecycle.d.ts +31 -0
- package/dist/ports/subagent-lifecycle.js +1 -0
- package/dist/ports/tool-activity.d.ts +13 -0
- package/dist/ports/tool-activity.js +1 -0
- package/dist/presentation/themes/theme.d.ts +19 -0
- package/dist/presentation/themes/theme.js +8 -0
- package/dist/presentation/tui/agent-initialization-renderer.d.ts +4 -0
- package/dist/presentation/tui/agent-initialization-renderer.js +37 -0
- package/dist/presentation/tui/context-display.d.ts +21 -0
- package/dist/presentation/tui/context-display.js +33 -0
- package/dist/presentation/tui/formatters.d.ts +6 -0
- package/dist/presentation/tui/formatters.js +60 -0
- package/dist/presentation/tui/ink/choice-window.d.ts +5 -0
- package/dist/presentation/tui/ink/choice-window.js +5 -0
- package/dist/presentation/tui/ink/components/activity-entry.d.ts +6 -0
- package/dist/presentation/tui/ink/components/activity-entry.js +16 -0
- package/dist/presentation/tui/ink/components/activity-status.d.ts +10 -0
- package/dist/presentation/tui/ink/components/activity-status.js +21 -0
- package/dist/presentation/tui/ink/components/choice-modal.d.ts +11 -0
- package/dist/presentation/tui/ink/components/choice-modal.js +29 -0
- package/dist/presentation/tui/ink/components/composer.d.ts +40 -0
- package/dist/presentation/tui/ink/components/composer.js +271 -0
- package/dist/presentation/tui/ink/components/file-diff.d.ts +6 -0
- package/dist/presentation/tui/ink/components/file-diff.js +34 -0
- package/dist/presentation/tui/ink/components/modal.d.ts +8 -0
- package/dist/presentation/tui/ink/components/modal.js +110 -0
- package/dist/presentation/tui/ink/components/shimmer-text.d.ts +6 -0
- package/dist/presentation/tui/ink/components/shimmer-text.js +9 -0
- package/dist/presentation/tui/ink/components/subagent-activity.d.ts +11 -0
- package/dist/presentation/tui/ink/components/subagent-activity.js +61 -0
- package/dist/presentation/tui/ink/components/transcript.d.ts +39 -0
- package/dist/presentation/tui/ink/components/transcript.js +121 -0
- package/dist/presentation/tui/ink/components/welcome-panel.d.ts +6 -0
- package/dist/presentation/tui/ink/components/welcome-panel.js +20 -0
- package/dist/presentation/tui/ink/lotagate-tui.d.ts +6 -0
- package/dist/presentation/tui/ink/lotagate-tui.js +136 -0
- package/dist/presentation/tui/ink/markdown-inline-renderer.d.ts +4 -0
- package/dist/presentation/tui/ink/markdown-inline-renderer.js +20 -0
- package/dist/presentation/tui/ink/markdown-inline.d.ts +13 -0
- package/dist/presentation/tui/ink/markdown-inline.js +91 -0
- package/dist/presentation/tui/ink/markdown-message.d.ts +6 -0
- package/dist/presentation/tui/ink/markdown-message.js +66 -0
- package/dist/presentation/tui/ink/markdown-table.d.ts +16 -0
- package/dist/presentation/tui/ink/markdown-table.js +77 -0
- package/dist/presentation/tui/ink/tui-bridge.d.ts +195 -0
- package/dist/presentation/tui/ink/tui-bridge.js +289 -0
- package/dist/presentation/tui/terminal-capabilities.d.ts +15 -0
- package/dist/presentation/tui/terminal-capabilities.js +7 -0
- package/dist/presentation/tui/terminal-mouse.d.ts +5 -0
- package/dist/presentation/tui/terminal-mouse.js +19 -0
- package/dist/presentation/tui/terminal-screen.d.ts +10 -0
- package/dist/presentation/tui/terminal-screen.js +23 -0
- package/dist/presentation/tui/tui-agent-event-runner.d.ts +24 -0
- package/dist/presentation/tui/tui-agent-event-runner.js +69 -0
- package/dist/presentation/tui/tui-application-contract.d.ts +10 -0
- package/dist/presentation/tui/tui-application-contract.js +8 -0
- package/dist/presentation/tui/tui-application.d.ts +62 -0
- package/dist/presentation/tui/tui-application.js +675 -0
- package/dist/presentation/tui/tui-attachment-input.d.ts +2 -0
- package/dist/presentation/tui/tui-attachment-input.js +5 -0
- package/dist/presentation/tui/tui-clipboard-paste-handlers.d.ts +11 -0
- package/dist/presentation/tui/tui-clipboard-paste-handlers.js +25 -0
- package/dist/presentation/tui/tui-command-context.d.ts +3 -0
- package/dist/presentation/tui/tui-command-context.js +1 -0
- package/dist/presentation/tui/tui-command-executor.d.ts +38 -0
- package/dist/presentation/tui/tui-command-executor.js +214 -0
- package/dist/presentation/tui/tui-command-host-factory.d.ts +40 -0
- package/dist/presentation/tui/tui-command-host-factory.js +23 -0
- package/dist/presentation/tui/tui-context-compaction.d.ts +5 -0
- package/dist/presentation/tui/tui-context-compaction.js +22 -0
- package/dist/presentation/tui/tui-context-service.d.ts +34 -0
- package/dist/presentation/tui/tui-context-service.js +126 -0
- package/dist/presentation/tui/tui-file-suggestions.d.ts +3 -0
- package/dist/presentation/tui/tui-file-suggestions.js +8 -0
- package/dist/presentation/tui/tui-goal-controller.d.ts +14 -0
- package/dist/presentation/tui/tui-goal-controller.js +52 -0
- package/dist/presentation/tui/tui-initial-model.d.ts +3 -0
- package/dist/presentation/tui/tui-initial-model.js +28 -0
- package/dist/presentation/tui/tui-lifecycle-actions.d.ts +13 -0
- package/dist/presentation/tui/tui-lifecycle-actions.js +45 -0
- package/dist/presentation/tui/tui-manual-compaction.d.ts +18 -0
- package/dist/presentation/tui/tui-manual-compaction.js +31 -0
- package/dist/presentation/tui/tui-media-model-selection.d.ts +12 -0
- package/dist/presentation/tui/tui-media-model-selection.js +38 -0
- package/dist/presentation/tui/tui-prompt-dispatcher.d.ts +16 -0
- package/dist/presentation/tui/tui-prompt-dispatcher.js +38 -0
- package/dist/presentation/tui/tui-skill-controller.d.ts +11 -0
- package/dist/presentation/tui/tui-skill-controller.js +13 -0
- package/dist/presentation/tui/tui-tool-approval.d.ts +22 -0
- package/dist/presentation/tui/tui-tool-approval.js +73 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +8 -7
- package/scripts/install-native.mjs +11 -11
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { prepareCliAgent } from '../agent/cli-agent-execution-service.js';
|
|
2
|
+
import { AgentRunTracker } from '../agent/agent-run-tracker.js';
|
|
3
|
+
import { CliError } from '../../domain/errors/cli-error.js';
|
|
4
|
+
import { CLI_ERROR_CODES } from '../../domain/errors/error-codes.js';
|
|
5
|
+
import { writeStreamChunk } from '../commands/stream-output.js';
|
|
6
|
+
import { CliTurnEventProjector } from './cli-turn-event-projector.js';
|
|
7
|
+
import { persistCliTurnEvent } from './cli-turn-persistence.js';
|
|
8
|
+
import { agentLimitNotice, classifyAgentLimit } from '../agent/agent-limit.js';
|
|
9
|
+
export async function runHeadlessAgentTurn(options) {
|
|
10
|
+
const tracker = new AgentRunTracker();
|
|
11
|
+
const prepared = await prepareCliAgent({
|
|
12
|
+
runtime: options.runtime, cwd: options.cwd, model: options.model, client: options.client, profile: 'headless-safe', approvalMode: 'auto',
|
|
13
|
+
...(options.goal === undefined ? {} : { goal: options.goal }),
|
|
14
|
+
...(options.agentSessionStore === undefined ? {} : { agentSessionStore: options.agentSessionStore }),
|
|
15
|
+
onModelComplete: (summary) => { if (summary.usage !== undefined)
|
|
16
|
+
options.onUsage?.({ usage: summary.usage, modelCalls: 1 }); },
|
|
17
|
+
...(options.onSubagentUsage === undefined ? {} : { onSubagentModelComplete: (summary) => { if (summary.usage !== undefined)
|
|
18
|
+
options.onSubagentUsage?.({ usage: summary.usage, modelCalls: 1 }); } }),
|
|
19
|
+
});
|
|
20
|
+
const response = [];
|
|
21
|
+
let limitReason;
|
|
22
|
+
const projector = new CliTurnEventProjector();
|
|
23
|
+
try {
|
|
24
|
+
const inputContext = await prepared.buildInput(options.prompt);
|
|
25
|
+
if (options.agentSessionStore !== undefined && options.sessionId !== undefined) {
|
|
26
|
+
const history = await options.runtime.sessionStore.readHistory(options.sessionId);
|
|
27
|
+
options.agentSessionStore.hydrate(options.sessionId, prepared.system, history.transcript, history.events, inputContext.input);
|
|
28
|
+
}
|
|
29
|
+
for await (const event of prepared.run({ input: inputContext.input, model: options.model, ...(options.signal === undefined ? {} : { signal: options.signal }), ...(options.sessionId === undefined ? {} : { sessionId: options.sessionId }) })) {
|
|
30
|
+
tracker.observe(event);
|
|
31
|
+
for (const projected of projector.observe(event)) {
|
|
32
|
+
if (options.sessionId !== undefined) {
|
|
33
|
+
try {
|
|
34
|
+
await persistCliTurnEvent(options.runtime.sessionStore, options.sessionId, projected, { ...(options.turnId === undefined ? {} : { turnId: options.turnId }) });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
options.runtime.logger.warn('Unable to persist agent lifecycle event.', { eventType: projected.type, reason: error instanceof Error ? error.message : String(error) });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (projected.type === 'assistant.delta')
|
|
41
|
+
response.push(projected.content);
|
|
42
|
+
}
|
|
43
|
+
if (options.output !== undefined && options.json)
|
|
44
|
+
await writeStreamChunk(options.output, `${JSON.stringify(event)}\n`);
|
|
45
|
+
else if (options.output !== undefined && event.type === 'model.delta')
|
|
46
|
+
await writeStreamChunk(options.output, event.content);
|
|
47
|
+
else if (options.output !== undefined && event.type === 'session.completed' && response.length === 0) {
|
|
48
|
+
response.push(event.content);
|
|
49
|
+
await writeStreamChunk(options.output, event.content);
|
|
50
|
+
}
|
|
51
|
+
if (event.type === 'session.failed') {
|
|
52
|
+
limitReason = classifyAgentLimit(event.error);
|
|
53
|
+
if (limitReason === undefined)
|
|
54
|
+
throw event.error;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (limitReason !== undefined) {
|
|
59
|
+
const notice = agentLimitNotice(limitReason);
|
|
60
|
+
response.push(response.length === 0 ? notice : `\n\n${notice}`);
|
|
61
|
+
if (options.output !== undefined && !options.json)
|
|
62
|
+
await writeStreamChunk(options.output, response.at(-1));
|
|
63
|
+
if (options.sessionId !== undefined)
|
|
64
|
+
options.agentSessionStore?.delete(options.sessionId);
|
|
65
|
+
}
|
|
66
|
+
if (response.join('').trim().length === 0) {
|
|
67
|
+
const snapshot = tracker.snapshot();
|
|
68
|
+
const code = snapshot.toolCalls > 0 ? CLI_ERROR_CODES.MODEL_EMPTY_FINAL : CLI_ERROR_CODES.MODEL_PROTOCOL_EMPTY_RESPONSE;
|
|
69
|
+
throw new CliError(code, 'Agent completed without a final text response.', { category: 'model', userMessage: 'The model completed without a final text response.', retryable: true });
|
|
70
|
+
}
|
|
71
|
+
return response.join('');
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
options.onSnapshot?.(tracker.snapshot());
|
|
75
|
+
try {
|
|
76
|
+
await prepared.close();
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
options.runtime.logger.warn('Agent cleanup failed after a completed turn.', { reason: error instanceof Error ? error.message : String(error) });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutionPlan } from '../../domain/orchestration/task.js';
|
|
2
|
+
import { TaskAssessmentService } from './task-assessment.js';
|
|
3
|
+
export declare class PlanGenerator {
|
|
4
|
+
private readonly assessment;
|
|
5
|
+
constructor(assessment?: TaskAssessmentService);
|
|
6
|
+
generate(goal: string, requiresApproval?: boolean): ExecutionPlan;
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { TaskAssessmentService } from './task-assessment.js';
|
|
3
|
+
export class PlanGenerator {
|
|
4
|
+
assessment;
|
|
5
|
+
constructor(assessment = new TaskAssessmentService()) {
|
|
6
|
+
this.assessment = assessment;
|
|
7
|
+
}
|
|
8
|
+
generate(goal, requiresApproval = true) {
|
|
9
|
+
const assessment = this.assessment.assess(goal);
|
|
10
|
+
const tasks = assessment.requiresPlan ? createTaskPlan(goal, assessment) : [task('execute', assessment.complexity === 'moderate' ? 'Execute the requested work' : 'Answer the request', goal)];
|
|
11
|
+
return { id: crypto.randomUUID(), goal, tasks, requiresApproval: requiresApproval && assessment.requiresPlan, maxConcurrency: assessment.complexity === 'complex' ? 2 : 1 };
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function createTaskPlan(goal, assessment) {
|
|
15
|
+
const intents = new Set(assessment.intents);
|
|
16
|
+
const tasks = [];
|
|
17
|
+
if (intents.has('change')) {
|
|
18
|
+
tasks.push(task('inspect', 'Inspect the relevant context', 'Inspect only the files, contracts, and constraints needed for this change.'));
|
|
19
|
+
tasks.push(task('implement', 'Apply the requested change', goal, ['inspect']));
|
|
20
|
+
if (intents.has('verify') || intents.has('change'))
|
|
21
|
+
tasks.push(task('verify', 'Verify the change', 'Run the focused checks required for the requested change.', ['implement']));
|
|
22
|
+
return tasks;
|
|
23
|
+
}
|
|
24
|
+
if (intents.has('inspect'))
|
|
25
|
+
tasks.push(task('inspect', 'Inspect the requested context', 'Read or list only the requested files and folders.', []));
|
|
26
|
+
if (intents.has('verify'))
|
|
27
|
+
tasks.push(task('verify', 'Run the requested checks', goal, tasks.length === 0 ? [] : [tasks[tasks.length - 1].id]));
|
|
28
|
+
if (intents.has('answer'))
|
|
29
|
+
tasks.push(task('answer', 'Summarize the result', 'Answer from the inspected evidence without making changes.', tasks.length === 0 ? [] : [tasks[tasks.length - 1].id]));
|
|
30
|
+
return tasks.length === 0 ? [task('answer', 'Answer the request', goal)] : tasks;
|
|
31
|
+
}
|
|
32
|
+
function task(id, title, description, dependencies = []) {
|
|
33
|
+
return { id, title, description, dependencies, status: 'queued' };
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AgentTask, ExecutionPlan, SchedulerLimits } from '../../domain/orchestration/task.js';
|
|
2
|
+
import type { SubagentLimitReason } from '../../domain/orchestration/subagent.js';
|
|
3
|
+
import { TaskScheduler } from './task-scheduler.js';
|
|
4
|
+
export interface SubagentOutput {
|
|
5
|
+
content: string;
|
|
6
|
+
tokens?: number;
|
|
7
|
+
tokensEstimated?: boolean;
|
|
8
|
+
toolsUsed?: readonly string[];
|
|
9
|
+
limitReason?: SubagentLimitReason;
|
|
10
|
+
}
|
|
11
|
+
export interface SubagentInstance {
|
|
12
|
+
run(task: AgentTask, signal: AbortSignal): Promise<SubagentOutput>;
|
|
13
|
+
close?(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export interface SubagentFactory {
|
|
16
|
+
create(task: AgentTask): Promise<SubagentInstance>;
|
|
17
|
+
}
|
|
18
|
+
export interface SubagentRunResult {
|
|
19
|
+
task: AgentTask;
|
|
20
|
+
output: SubagentOutput;
|
|
21
|
+
}
|
|
22
|
+
export interface SubagentCoordinatorOptions {
|
|
23
|
+
approvePlan?: (plan: ExecutionPlan) => boolean | Promise<boolean>;
|
|
24
|
+
onTaskEvent?: (event: {
|
|
25
|
+
type: 'started' | 'completed' | 'failed';
|
|
26
|
+
task: AgentTask;
|
|
27
|
+
}) => void | Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export declare class SubagentCoordinator {
|
|
30
|
+
private readonly scheduler;
|
|
31
|
+
constructor(scheduler?: TaskScheduler);
|
|
32
|
+
run(plan: ExecutionPlan, factory: SubagentFactory, limits: SchedulerLimits, signal?: AbortSignal, options?: SubagentCoordinatorOptions): Promise<readonly SubagentRunResult[]>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CliError } from '../../domain/errors/cli-error.js';
|
|
2
|
+
import { CLI_ERROR_CODES } from '../../domain/errors/error-codes.js';
|
|
3
|
+
import { TaskGraph } from './task-graph.js';
|
|
4
|
+
import { TaskScheduler } from './task-scheduler.js';
|
|
5
|
+
export class SubagentCoordinator {
|
|
6
|
+
scheduler;
|
|
7
|
+
constructor(scheduler = new TaskScheduler()) {
|
|
8
|
+
this.scheduler = scheduler;
|
|
9
|
+
}
|
|
10
|
+
async run(plan, factory, limits, signal, options = {}) {
|
|
11
|
+
if (plan.requiresApproval && !(await options.approvePlan?.(plan))) {
|
|
12
|
+
throw new CliError(CLI_ERROR_CODES.TASK_PLAN_APPROVAL_REQUIRED, 'Plan approval was not granted.', { category: 'orchestration', userMessage: 'Plan approval is required before execution.' });
|
|
13
|
+
}
|
|
14
|
+
const graph = new TaskGraph(plan.tasks);
|
|
15
|
+
const instances = new Map();
|
|
16
|
+
try {
|
|
17
|
+
const results = await this.scheduler.run(graph, async (task, taskSignal) => {
|
|
18
|
+
const instance = await factory.create(task);
|
|
19
|
+
instances.set(task.id, instance);
|
|
20
|
+
return instance.run(task, taskSignal);
|
|
21
|
+
}, { ...limits, maxConcurrency: Math.min(limits.maxConcurrency, plan.maxConcurrency) }, { ...(signal === undefined ? {} : { signal }), estimateTokens: (output) => output.tokens ?? 0, ...(options.onTaskEvent === undefined ? {} : { onTaskEvent: options.onTaskEvent }) });
|
|
22
|
+
return results.map(({ task, value: output }) => ({ task, output }));
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
await Promise.allSettled([...instances.values()].map((instance) => instance.close?.()));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { RESOURCE_LIMITS } from '../../domain/runtime/resource-limits.js';
|
|
2
|
+
const MAX_HANDOFF_ITEMS = 32;
|
|
3
|
+
const MAX_ITEM_BYTES = 1_024;
|
|
4
|
+
export function parseSubagentHandoff(output) {
|
|
5
|
+
const bounded = boundText(output, RESOURCE_LIMITS.subagentSummaryBytes);
|
|
6
|
+
const parsed = parseJsonObject(bounded);
|
|
7
|
+
if (parsed === undefined) {
|
|
8
|
+
return {
|
|
9
|
+
summary: bounded || 'The subagent completed without a text summary.',
|
|
10
|
+
filesInspected: [],
|
|
11
|
+
filesChanged: [],
|
|
12
|
+
commandsRun: [],
|
|
13
|
+
verification: [],
|
|
14
|
+
warnings: ['The child returned an unstructured summary; verify the result directly.'],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
summary: boundedString(parsed['summary']) ?? 'The subagent completed without a text summary.',
|
|
19
|
+
filesInspected: boundedList(parsed['filesInspected']),
|
|
20
|
+
filesChanged: boundedList(parsed['filesChanged']),
|
|
21
|
+
commandsRun: boundedList(parsed['commandsRun']),
|
|
22
|
+
verification: boundedList(parsed['verification']),
|
|
23
|
+
warnings: boundedList(parsed['warnings']),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function parseJsonObject(value) {
|
|
27
|
+
const candidates = [value.trim(), extractJsonBlock(value)];
|
|
28
|
+
for (const candidate of candidates) {
|
|
29
|
+
if (candidate === undefined || candidate.length === 0)
|
|
30
|
+
continue;
|
|
31
|
+
try {
|
|
32
|
+
const parsed = JSON.parse(candidate);
|
|
33
|
+
if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed))
|
|
34
|
+
return parsed;
|
|
35
|
+
}
|
|
36
|
+
catch { /* The child may have returned normal prose; the caller receives a warning. */ }
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
function extractJsonBlock(value) {
|
|
41
|
+
const start = value.indexOf('{');
|
|
42
|
+
const end = value.lastIndexOf('}');
|
|
43
|
+
return start >= 0 && end > start ? value.slice(start, end + 1) : undefined;
|
|
44
|
+
}
|
|
45
|
+
function boundedList(value) {
|
|
46
|
+
if (!Array.isArray(value))
|
|
47
|
+
return [];
|
|
48
|
+
return value
|
|
49
|
+
.filter((item) => typeof item === 'string')
|
|
50
|
+
.map((item) => boundedString(item))
|
|
51
|
+
.filter((item) => item !== undefined)
|
|
52
|
+
.slice(0, MAX_HANDOFF_ITEMS);
|
|
53
|
+
}
|
|
54
|
+
function boundedString(value) {
|
|
55
|
+
if (typeof value !== 'string')
|
|
56
|
+
return undefined;
|
|
57
|
+
const trimmed = value.trim();
|
|
58
|
+
if (trimmed.length === 0)
|
|
59
|
+
return undefined;
|
|
60
|
+
return Buffer.byteLength(trimmed, 'utf8') <= MAX_ITEM_BYTES
|
|
61
|
+
? trimmed
|
|
62
|
+
: `${Buffer.from(trimmed, 'utf8').subarray(0, MAX_ITEM_BYTES - 3).toString('utf8')}...`;
|
|
63
|
+
}
|
|
64
|
+
function boundText(value, maxBytes) {
|
|
65
|
+
const trimmed = value.trim();
|
|
66
|
+
const bytes = Buffer.from(trimmed, 'utf8');
|
|
67
|
+
return bytes.byteLength <= maxBytes ? trimmed : `${bytes.subarray(0, maxBytes - 16).toString('utf8')}\n[truncated]`;
|
|
68
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@lotagate/sdk';
|
|
2
|
+
import type { ToolExecutionContext, ToolExecutor, ToolInfo, ToolResult } from '@lotagate/agent-sdk';
|
|
3
|
+
import type { CliSubagentService } from './cli-subagent-service.js';
|
|
4
|
+
/** Exposes the same orchestration capability definitions to runtime and context accounting. */
|
|
5
|
+
export declare function subagentToolDefinitions(): readonly ToolDefinition[];
|
|
6
|
+
export declare class SubagentToolExecutor implements ToolExecutor {
|
|
7
|
+
private readonly service;
|
|
8
|
+
constructor(service: CliSubagentService);
|
|
9
|
+
listTools(): readonly ToolDefinition[];
|
|
10
|
+
getToolInfo(toolName: string): ToolInfo | undefined;
|
|
11
|
+
execute(toolName: string, input: Record<string, unknown>, context: ToolExecutionContext): Promise<ToolResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const TOOLS = [
|
|
2
|
+
{
|
|
3
|
+
type: 'function',
|
|
4
|
+
function: {
|
|
5
|
+
name: 'agent.spawn',
|
|
6
|
+
description: 'Delegate one bounded side task. Research mode is read-only by default; worker mode requires an explicitly requested independent implementation task. Use background true for bounded parallel work and agent.wait for its result.',
|
|
7
|
+
parameters: {
|
|
8
|
+
type: 'object',
|
|
9
|
+
properties: {
|
|
10
|
+
task: { type: 'string', description: 'A single, specific task for the child agent.' },
|
|
11
|
+
context: { type: 'string', description: 'Optional bounded parent-provided evidence needed to complete the task. Do not include secrets.' },
|
|
12
|
+
model: { type: 'string', description: 'Optional model id from the allowlist; omit to inherit the parent model.' },
|
|
13
|
+
mode: { type: 'string', enum: ['research', 'worker'], description: 'research (default) or worker for an explicitly requested implementation task.' },
|
|
14
|
+
background: { type: 'boolean', description: 'Run without blocking the current turn. Call agent.wait with the returned id when needed.' },
|
|
15
|
+
writeScope: { type: 'array', items: { type: 'string' }, description: 'Required for worker mode: workspace-relative files or directories the child may write.' },
|
|
16
|
+
},
|
|
17
|
+
required: ['task'],
|
|
18
|
+
additionalProperties: false,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
idTool('agent.wait', 'Wait for a background subagent owned by this session and return its structured handoff.'),
|
|
23
|
+
idTool('agent.cancel', 'Cancel a running background subagent owned by this session.'),
|
|
24
|
+
];
|
|
25
|
+
/** Exposes the same orchestration capability definitions to runtime and context accounting. */
|
|
26
|
+
export function subagentToolDefinitions() { return TOOLS; }
|
|
27
|
+
export class SubagentToolExecutor {
|
|
28
|
+
service;
|
|
29
|
+
constructor(service) {
|
|
30
|
+
this.service = service;
|
|
31
|
+
}
|
|
32
|
+
listTools() { return subagentToolDefinitions(); }
|
|
33
|
+
getToolInfo(toolName) {
|
|
34
|
+
if (!TOOLS.some((tool) => getToolName(tool) === toolName))
|
|
35
|
+
return undefined;
|
|
36
|
+
return { toolName, source: 'custom', executorId: 'cli-subagent', metadata: { category: 'orchestration' } };
|
|
37
|
+
}
|
|
38
|
+
async execute(toolName, input, context) {
|
|
39
|
+
try {
|
|
40
|
+
const result = toolName === 'agent.spawn'
|
|
41
|
+
? await this.service.spawn(parseSpawnRequest(input), context)
|
|
42
|
+
: toolName === 'agent.wait'
|
|
43
|
+
? await this.service.wait(requireId(input), context)
|
|
44
|
+
: toolName === 'agent.cancel'
|
|
45
|
+
? await this.service.cancel(requireId(input), context)
|
|
46
|
+
: undefined;
|
|
47
|
+
if (result === undefined)
|
|
48
|
+
return { content: `Unknown orchestration tool: ${toolName}`, isError: true };
|
|
49
|
+
return { content: JSON.stringify(result), isError: result.status === 'failed' || result.status === 'cancelled' };
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return { content: error instanceof Error ? error.message : String(error), isError: true };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function parseSpawnRequest(input) {
|
|
57
|
+
if (typeof input['task'] !== 'string')
|
|
58
|
+
throw new Error('agent.spawn requires a task string.');
|
|
59
|
+
const mode = input['mode'];
|
|
60
|
+
if (mode !== undefined && mode !== 'research' && mode !== 'worker')
|
|
61
|
+
throw new Error('agent.spawn mode must be research or worker.');
|
|
62
|
+
const context = input['context'];
|
|
63
|
+
if (context !== undefined && typeof context !== 'string')
|
|
64
|
+
throw new Error('agent.spawn context must be a string.');
|
|
65
|
+
const model = input['model'];
|
|
66
|
+
if (model !== undefined && typeof model !== 'string')
|
|
67
|
+
throw new Error('agent.spawn model must be a string.');
|
|
68
|
+
const background = input['background'];
|
|
69
|
+
if (background !== undefined && typeof background !== 'boolean')
|
|
70
|
+
throw new Error('agent.spawn background must be a boolean.');
|
|
71
|
+
const writeScope = input['writeScope'];
|
|
72
|
+
if (writeScope !== undefined && (!Array.isArray(writeScope) || writeScope.some((item) => typeof item !== 'string')))
|
|
73
|
+
throw new Error('agent.spawn writeScope must be an array of strings.');
|
|
74
|
+
return {
|
|
75
|
+
task: input['task'],
|
|
76
|
+
...(context === undefined ? {} : { context }),
|
|
77
|
+
...(model === undefined ? {} : { model }),
|
|
78
|
+
...(mode === undefined ? {} : { mode }),
|
|
79
|
+
...(background === undefined ? {} : { background }),
|
|
80
|
+
...(writeScope === undefined ? {} : { writeScope }),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function requireId(input) {
|
|
84
|
+
if (typeof input['id'] !== 'string' || input['id'].trim().length === 0)
|
|
85
|
+
throw new Error('The subagent id is required.');
|
|
86
|
+
return input['id'].trim();
|
|
87
|
+
}
|
|
88
|
+
function idTool(name, description) {
|
|
89
|
+
return { type: 'function', function: { name, description, parameters: { type: 'object', properties: { id: { type: 'string', description: 'Subagent id returned by agent.spawn.' } }, required: ['id'], additionalProperties: false } } };
|
|
90
|
+
}
|
|
91
|
+
function getToolName(definition) {
|
|
92
|
+
return 'function' in definition ? definition.function.name : undefined;
|
|
93
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class TaskAssessmentService {
|
|
2
|
+
assess(prompt) {
|
|
3
|
+
const normalized = prompt.trim();
|
|
4
|
+
const reasons = [];
|
|
5
|
+
let score = 0;
|
|
6
|
+
if (normalized.length > 240) {
|
|
7
|
+
score += 1;
|
|
8
|
+
reasons.push('long prompt');
|
|
9
|
+
}
|
|
10
|
+
if (/(and then|sau đó|then|multiple|nhiều|từng bước|plan|kế hoạch|refactor|implement|triển khai)/iu.test(normalized)) {
|
|
11
|
+
score += 2;
|
|
12
|
+
reasons.push('multiple steps or implementation work');
|
|
13
|
+
}
|
|
14
|
+
if (/@[\w./-]+|\b(files?|folders?|repo|repository|codebase|tests?)\b/iu.test(normalized)) {
|
|
15
|
+
score += 1;
|
|
16
|
+
reasons.push('workspace or multiple resource references');
|
|
17
|
+
}
|
|
18
|
+
const intents = classifyIntents(normalized);
|
|
19
|
+
const complexity = score >= 3 ? 'complex' : score >= 1 ? 'moderate' : 'simple';
|
|
20
|
+
const requiresPlan = complexity === 'complex' || intents.length > 1;
|
|
21
|
+
return { complexity, requiresPlan, estimatedTasks: requiresPlan ? Math.max(2, intents.length) : 1, reasons, intents };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function classifyIntents(prompt) {
|
|
25
|
+
const intents = [];
|
|
26
|
+
if (/\b(fix|change|edit|update|implement|add|remove|create|refactor|modify|write|sửa|thêm|xóa|tạo|cập nhật|triển khai)\b/iu.test(prompt))
|
|
27
|
+
intents.push('change');
|
|
28
|
+
if (/\b(inspect|check|read|list|review|audit|analy[sz]e|examine|kiểm tra|đọc|liệt kê|xem|rà soát|phân tích)\b|@[\w./-]+/iu.test(prompt))
|
|
29
|
+
intents.push('inspect');
|
|
30
|
+
if (/\b(tests?|verify|validate|lint|typecheck|build|kiểm thử|xác minh|kiểm chứng)\b/iu.test(prompt))
|
|
31
|
+
intents.push('verify');
|
|
32
|
+
if (intents.length === 0 || (intents.includes('inspect') && !intents.includes('change') && !intents.includes('verify')))
|
|
33
|
+
intents.push('answer');
|
|
34
|
+
return intents;
|
|
35
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentTask, TaskStatus } from '../../domain/orchestration/task.js';
|
|
2
|
+
export declare class TaskGraph {
|
|
3
|
+
private readonly tasks;
|
|
4
|
+
constructor(tasks: readonly AgentTask[]);
|
|
5
|
+
list(): readonly AgentTask[];
|
|
6
|
+
get(taskId: string): AgentTask | undefined;
|
|
7
|
+
setStatus(taskId: string, status: TaskStatus): AgentTask;
|
|
8
|
+
ready(): readonly AgentTask[];
|
|
9
|
+
hasPending(): boolean;
|
|
10
|
+
private validateDependencies;
|
|
11
|
+
private assertAcyclic;
|
|
12
|
+
private require;
|
|
13
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CliError } from '../../domain/errors/cli-error.js';
|
|
2
|
+
import { CLI_ERROR_CODES } from '../../domain/errors/error-codes.js';
|
|
3
|
+
export class TaskGraph {
|
|
4
|
+
tasks = new Map();
|
|
5
|
+
constructor(tasks) {
|
|
6
|
+
for (const task of tasks) {
|
|
7
|
+
if (this.tasks.has(task.id))
|
|
8
|
+
throw new CliError(CLI_ERROR_CODES.TASK_DEPENDENCY_CYCLE, `Duplicate task id: ${task.id}`, { category: 'orchestration', userMessage: 'The plan contains a duplicate task id.' });
|
|
9
|
+
this.tasks.set(task.id, { ...task, dependencies: [...task.dependencies] });
|
|
10
|
+
}
|
|
11
|
+
this.validateDependencies();
|
|
12
|
+
this.assertAcyclic();
|
|
13
|
+
}
|
|
14
|
+
list() { return [...this.tasks.values()]; }
|
|
15
|
+
get(taskId) { return this.tasks.get(taskId); }
|
|
16
|
+
setStatus(taskId, status) {
|
|
17
|
+
const task = this.require(taskId);
|
|
18
|
+
const updated = { ...task, status };
|
|
19
|
+
this.tasks.set(taskId, updated);
|
|
20
|
+
return updated;
|
|
21
|
+
}
|
|
22
|
+
ready() {
|
|
23
|
+
return this.list().filter((task) => task.status === 'queued' && task.dependencies.every((dependency) => this.tasks.get(dependency)?.status === 'completed'));
|
|
24
|
+
}
|
|
25
|
+
hasPending() { return this.list().some((task) => task.status === 'queued' || task.status === 'running'); }
|
|
26
|
+
validateDependencies() {
|
|
27
|
+
for (const task of this.tasks.values())
|
|
28
|
+
for (const dependency of task.dependencies)
|
|
29
|
+
if (!this.tasks.has(dependency)) {
|
|
30
|
+
throw new CliError(CLI_ERROR_CODES.TASK_DEPENDENCY_CYCLE, `Missing task dependency: ${dependency}`, { category: 'orchestration', userMessage: `The plan references a missing dependency: ${dependency}.` });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
assertAcyclic() {
|
|
34
|
+
const visiting = new Set();
|
|
35
|
+
const visited = new Set();
|
|
36
|
+
const visit = (taskId) => {
|
|
37
|
+
if (visiting.has(taskId))
|
|
38
|
+
throw new CliError(CLI_ERROR_CODES.TASK_DEPENDENCY_CYCLE, 'Task dependency cycle detected.', { category: 'orchestration', userMessage: 'The plan contains a task dependency cycle.' });
|
|
39
|
+
if (visited.has(taskId))
|
|
40
|
+
return;
|
|
41
|
+
visiting.add(taskId);
|
|
42
|
+
for (const dependency of this.require(taskId).dependencies)
|
|
43
|
+
visit(dependency);
|
|
44
|
+
visiting.delete(taskId);
|
|
45
|
+
visited.add(taskId);
|
|
46
|
+
};
|
|
47
|
+
for (const taskId of this.tasks.keys())
|
|
48
|
+
visit(taskId);
|
|
49
|
+
}
|
|
50
|
+
require(taskId) {
|
|
51
|
+
const task = this.tasks.get(taskId);
|
|
52
|
+
if (task === undefined)
|
|
53
|
+
throw new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, `Task not found: ${taskId}`, { category: 'orchestration', userMessage: `Task not found: ${taskId}.` });
|
|
54
|
+
return task;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AgentTask, SchedulerLimits } from '../../domain/orchestration/task.js';
|
|
2
|
+
import type { TaskGraph } from './task-graph.js';
|
|
3
|
+
export interface TaskExecutionResult<T> {
|
|
4
|
+
task: AgentTask;
|
|
5
|
+
value: T;
|
|
6
|
+
tokens?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface TaskSchedulerOptions<T> {
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
estimateTokens?: (value: T) => number;
|
|
11
|
+
onTaskEvent?: (event: {
|
|
12
|
+
type: 'started' | 'completed' | 'failed';
|
|
13
|
+
task: AgentTask;
|
|
14
|
+
}) => void | Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare class TaskScheduler {
|
|
17
|
+
run<T>(graph: TaskGraph, execute: (task: AgentTask, signal: AbortSignal) => Promise<T>, limits: SchedulerLimits, options?: TaskSchedulerOptions<T>): Promise<readonly TaskExecutionResult<T>[]>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { CliError } from '../../domain/errors/cli-error.js';
|
|
2
|
+
import { CLI_ERROR_CODES } from '../../domain/errors/error-codes.js';
|
|
3
|
+
export class TaskScheduler {
|
|
4
|
+
async run(graph, execute, limits, options = {}) {
|
|
5
|
+
if (!Number.isInteger(limits.maxConcurrency) || limits.maxConcurrency < 1 || limits.maxConcurrency > 32 || limits.maxTasks < 1 || limits.maxDurationMs < 1) {
|
|
6
|
+
throw new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, 'Scheduler limits are invalid.', { category: 'orchestration', userMessage: 'Scheduler limits are invalid.' });
|
|
7
|
+
}
|
|
8
|
+
if (graph.list().length > limits.maxTasks)
|
|
9
|
+
throw new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, 'Plan exceeds the task limit.', { category: 'orchestration', userMessage: 'The plan exceeds the task limit.' });
|
|
10
|
+
const results = [];
|
|
11
|
+
const active = new Map();
|
|
12
|
+
const startedAt = Date.now();
|
|
13
|
+
const controller = new AbortController();
|
|
14
|
+
const forwardAbort = () => controller.abort(options.signal?.reason);
|
|
15
|
+
if (options.signal?.aborted)
|
|
16
|
+
forwardAbort();
|
|
17
|
+
else
|
|
18
|
+
options.signal?.addEventListener('abort', forwardAbort, { once: true });
|
|
19
|
+
const deadline = setTimeout(() => controller.abort(new Error('Task plan duration limit exceeded.')), limits.maxDurationMs);
|
|
20
|
+
let usedTokens = 0;
|
|
21
|
+
try {
|
|
22
|
+
while (graph.hasPending()) {
|
|
23
|
+
if (controller.signal.aborted)
|
|
24
|
+
throw isDeadlineAbort(controller.signal)
|
|
25
|
+
? durationLimitError()
|
|
26
|
+
: interrupted();
|
|
27
|
+
if (Date.now() - startedAt > limits.maxDurationMs) {
|
|
28
|
+
controller.abort();
|
|
29
|
+
throw new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, 'Plan exceeded its duration limit.', { category: 'orchestration', userMessage: 'The plan exceeded its maximum duration.' });
|
|
30
|
+
}
|
|
31
|
+
for (const task of graph.ready()) {
|
|
32
|
+
if (active.size >= limits.maxConcurrency)
|
|
33
|
+
break;
|
|
34
|
+
graph.setStatus(task.id, 'running');
|
|
35
|
+
await options.onTaskEvent?.({ type: 'started', task });
|
|
36
|
+
const operation = execute(task, controller.signal).then(async (value) => {
|
|
37
|
+
graph.setStatus(task.id, 'completed');
|
|
38
|
+
const tokens = options.estimateTokens?.(value);
|
|
39
|
+
if (tokens !== undefined)
|
|
40
|
+
usedTokens += Math.max(0, tokens);
|
|
41
|
+
if (limits.maxTokens !== undefined && usedTokens > limits.maxTokens)
|
|
42
|
+
throw new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, 'Plan exceeded its token budget.', { category: 'orchestration', userMessage: 'The plan exceeded its token budget.' });
|
|
43
|
+
results.push({ task: graph.get(task.id) ?? task, value, ...(tokens === undefined ? {} : { tokens }) });
|
|
44
|
+
await options.onTaskEvent?.({ type: 'completed', task: graph.get(task.id) ?? task });
|
|
45
|
+
}).catch(async (error) => {
|
|
46
|
+
graph.setStatus(task.id, 'failed');
|
|
47
|
+
await options.onTaskEvent?.({ type: 'failed', task: graph.get(task.id) ?? task });
|
|
48
|
+
throw error;
|
|
49
|
+
}).finally(() => { active.delete(task.id); });
|
|
50
|
+
active.set(task.id, operation);
|
|
51
|
+
}
|
|
52
|
+
if (active.size === 0) {
|
|
53
|
+
if (graph.hasPending())
|
|
54
|
+
throw new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, 'No runnable task remains.', { category: 'orchestration', userMessage: 'No runnable task remains; check dependencies or task failures.' });
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
await Promise.race(active.values());
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
// Abort cooperative siblings before observing their cleanup. This avoids
|
|
62
|
+
// unnecessary tool calls or provider usage after the plan has failed.
|
|
63
|
+
controller.abort(error);
|
|
64
|
+
await Promise.allSettled(active.values());
|
|
65
|
+
if (isDeadlineAbort(controller.signal))
|
|
66
|
+
throw durationLimitError();
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return results;
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
controller.abort();
|
|
74
|
+
clearTimeout(deadline);
|
|
75
|
+
await Promise.allSettled(active.values());
|
|
76
|
+
options.signal?.removeEventListener('abort', forwardAbort);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function isDeadlineAbort(signal) {
|
|
81
|
+
return signal.reason instanceof Error && signal.reason.message === 'Task plan duration limit exceeded.';
|
|
82
|
+
}
|
|
83
|
+
function durationLimitError() {
|
|
84
|
+
return new CliError(CLI_ERROR_CODES.TASK_SCHEDULER_OVERLOADED, 'Plan exceeded its duration limit.', { category: 'orchestration', userMessage: 'The plan exceeded its maximum duration.' });
|
|
85
|
+
}
|
|
86
|
+
function interrupted() {
|
|
87
|
+
return new CliError(CLI_ERROR_CODES.INTERRUPTED, 'Task plan was cancelled.', { category: 'orchestration', userMessage: 'Task plan execution was cancelled.' });
|
|
88
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ProjectIdentity } from '../../domain/project/project-identity.js';
|
|
2
|
+
import type { ProjectTrustStore, TrustedProject } from '../../ports/project-trust-store.js';
|
|
3
|
+
export declare class ProjectTrustService {
|
|
4
|
+
private readonly store;
|
|
5
|
+
constructor(store: ProjectTrustStore);
|
|
6
|
+
inspect(inputPath: string): Promise<ProjectIdentity>;
|
|
7
|
+
isTrusted(identity: ProjectIdentity): Promise<boolean>;
|
|
8
|
+
grant(identity: ProjectIdentity): Promise<TrustedProject>;
|
|
9
|
+
revoke(identity: ProjectIdentity): Promise<boolean>;
|
|
10
|
+
requireTrusted(identity: ProjectIdentity): Promise<void>;
|
|
11
|
+
list(): Promise<readonly TrustedProject[]>;
|
|
12
|
+
private canonicalize;
|
|
13
|
+
}
|