@lotagate/cli 0.1.22 → 0.1.23
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/package.json +7 -7
- package/scripts/install-native.mjs +11 -11
- package/dist/application/agent/agent-history.d.ts +0 -3
- package/dist/application/agent/agent-history.js +0 -81
- package/dist/application/agent/agent-input-context.d.ts +0 -9
- package/dist/application/agent/agent-input-context.js +0 -12
- package/dist/application/agent/agent-limit.d.ts +0 -3
- package/dist/application/agent/agent-limit.js +0 -12
- package/dist/application/agent/agent-run-tracker.d.ts +0 -30
- package/dist/application/agent/agent-run-tracker.js +0 -68
- package/dist/application/agent/agent-session-store.d.ts +0 -19
- package/dist/application/agent/agent-session-store.js +0 -74
- package/dist/application/agent/capability-profile.d.ts +0 -37
- package/dist/application/agent/capability-profile.js +0 -13
- package/dist/application/agent/cli-agent-execution-service.d.ts +0 -81
- package/dist/application/agent/cli-agent-execution-service.js +0 -279
- package/dist/application/agent/context-compaction-persistence.d.ts +0 -8
- package/dist/application/agent/context-compaction-persistence.js +0 -27
- package/dist/application/agent/context-compaction.d.ts +0 -20
- package/dist/application/agent/context-compaction.js +0 -114
- package/dist/application/agent/prompt-data-safety.d.ts +0 -14
- package/dist/application/agent/prompt-data-safety.js +0 -38
- package/dist/application/agent/safe-system-prompt.d.ts +0 -3
- package/dist/application/agent/safe-system-prompt.js +0 -19
- package/dist/application/agent/scoped-tool-executor.d.ts +0 -13
- package/dist/application/agent/scoped-tool-executor.js +0 -32
- package/dist/application/agent/system-prompt-builder.d.ts +0 -14
- package/dist/application/agent/system-prompt-builder.js +0 -199
- package/dist/application/agent/tool-catalog.d.ts +0 -14
- package/dist/application/agent/tool-catalog.js +0 -30
- package/dist/application/agent/tool-display.d.ts +0 -6
- package/dist/application/agent/tool-display.js +0 -59
- package/dist/application/agent/tool-hook-lifecycle.d.ts +0 -19
- package/dist/application/agent/tool-hook-lifecycle.js +0 -85
- package/dist/application/auth/authentication-service.d.ts +0 -20
- package/dist/application/auth/authentication-service.js +0 -44
- package/dist/application/chat/chat-service.d.ts +0 -12
- package/dist/application/chat/chat-service.js +0 -19
- package/dist/application/chat/pending-attachment-store.d.ts +0 -12
- package/dist/application/chat/pending-attachment-store.js +0 -28
- package/dist/application/commands/application-command-executor.d.ts +0 -20
- package/dist/application/commands/application-command-executor.js +0 -66
- package/dist/application/commands/cli-args.d.ts +0 -6
- package/dist/application/commands/cli-args.js +0 -43
- package/dist/application/commands/cli-command-services.d.ts +0 -16
- package/dist/application/commands/cli-command-services.js +0 -405
- package/dist/application/commands/command-catalog.d.ts +0 -6
- package/dist/application/commands/command-catalog.js +0 -159
- package/dist/application/commands/command-contract.d.ts +0 -58
- package/dist/application/commands/command-contract.js +0 -1
- package/dist/application/commands/command-hints.d.ts +0 -9
- package/dist/application/commands/command-hints.js +0 -17
- package/dist/application/commands/command-output.d.ts +0 -4
- package/dist/application/commands/command-output.js +0 -1
- package/dist/application/commands/command-parser.d.ts +0 -10
- package/dist/application/commands/command-parser.js +0 -155
- package/dist/application/commands/command-presentation.d.ts +0 -7
- package/dist/application/commands/command-presentation.js +0 -131
- package/dist/application/commands/command-registry.d.ts +0 -11
- package/dist/application/commands/command-registry.js +0 -64
- package/dist/application/commands/command-runtime.d.ts +0 -2
- package/dist/application/commands/command-runtime.js +0 -3
- package/dist/application/commands/goal-command-handlers.d.ts +0 -3
- package/dist/application/commands/goal-command-handlers.js +0 -120
- package/dist/application/commands/media-command-handlers.d.ts +0 -9
- package/dist/application/commands/media-command-handlers.js +0 -307
- package/dist/application/commands/media-command-output.d.ts +0 -11
- package/dist/application/commands/media-command-output.js +0 -8
- package/dist/application/commands/runtime-command-handlers.d.ts +0 -7
- package/dist/application/commands/runtime-command-handlers.js +0 -177
- package/dist/application/commands/stream-output.d.ts +0 -4
- package/dist/application/commands/stream-output.js +0 -10
- package/dist/application/commands/utility-commands.d.ts +0 -6
- package/dist/application/commands/utility-commands.js +0 -81
- package/dist/application/config/execution-config.d.ts +0 -4
- package/dist/application/config/execution-config.js +0 -6
- package/dist/application/extensions/extension-list-contract.d.ts +0 -13
- package/dist/application/extensions/extension-list-contract.js +0 -1
- package/dist/application/extensions/extension-list-formatters.d.ts +0 -31
- package/dist/application/extensions/extension-list-formatters.js +0 -98
- package/dist/application/extensions/extension-list-output.d.ts +0 -3
- package/dist/application/extensions/extension-list-output.js +0 -7
- package/dist/application/extensions/plugin-contribution-registry.d.ts +0 -15
- package/dist/application/extensions/plugin-contribution-registry.js +0 -80
- package/dist/application/extensions/skill-scope-store.d.ts +0 -23
- package/dist/application/extensions/skill-scope-store.js +0 -33
- package/dist/application/formatting/compact-number.d.ts +0 -2
- package/dist/application/formatting/compact-number.js +0 -18
- package/dist/application/formatting/compact-table.d.ts +0 -22
- package/dist/application/formatting/compact-table.js +0 -49
- package/dist/application/media/video-operation-poller.d.ts +0 -5
- package/dist/application/media/video-operation-poller.js +0 -42
- package/dist/application/model/cached-model-catalog.d.ts +0 -13
- package/dist/application/model/cached-model-catalog.js +0 -31
- package/dist/application/model/initial-model-selection.d.ts +0 -10
- package/dist/application/model/initial-model-selection.js +0 -11
- package/dist/application/model/model-catalog-service.d.ts +0 -6
- package/dist/application/model/model-catalog-service.js +0 -13
- package/dist/application/model/model-context-window.d.ts +0 -3
- package/dist/application/model/model-context-window.js +0 -23
- package/dist/application/orchestration/cli-subagent-service.d.ts +0 -70
- package/dist/application/orchestration/cli-subagent-service.js +0 -328
- package/dist/application/orchestration/cli-turn-event-projector.d.ts +0 -12
- package/dist/application/orchestration/cli-turn-event-projector.js +0 -81
- package/dist/application/orchestration/cli-turn-events.d.ts +0 -76
- package/dist/application/orchestration/cli-turn-events.js +0 -39
- package/dist/application/orchestration/cli-turn-persistence.d.ts +0 -6
- package/dist/application/orchestration/cli-turn-persistence.js +0 -14
- package/dist/application/orchestration/goal-evaluator.d.ts +0 -18
- package/dist/application/orchestration/goal-evaluator.js +0 -88
- package/dist/application/orchestration/goal-input.d.ts +0 -3
- package/dist/application/orchestration/goal-input.js +0 -19
- package/dist/application/orchestration/goal-output.d.ts +0 -2
- package/dist/application/orchestration/goal-output.js +0 -11
- package/dist/application/orchestration/goal-runner.d.ts +0 -22
- package/dist/application/orchestration/goal-runner.js +0 -153
- package/dist/application/orchestration/goal-usage.d.ts +0 -9
- package/dist/application/orchestration/goal-usage.js +0 -19
- package/dist/application/orchestration/headless-agent-turn.d.ts +0 -32
- package/dist/application/orchestration/headless-agent-turn.js +0 -82
- package/dist/application/orchestration/plan-generator.d.ts +0 -7
- package/dist/application/orchestration/plan-generator.js +0 -34
- package/dist/application/orchestration/subagent-coordinator.d.ts +0 -33
- package/dist/application/orchestration/subagent-coordinator.js +0 -28
- package/dist/application/orchestration/subagent-handoff.d.ts +0 -2
- package/dist/application/orchestration/subagent-handoff.js +0 -68
- package/dist/application/orchestration/subagent-tool-executor.d.ts +0 -12
- package/dist/application/orchestration/subagent-tool-executor.js +0 -93
- package/dist/application/orchestration/task-assessment.d.ts +0 -4
- package/dist/application/orchestration/task-assessment.js +0 -35
- package/dist/application/orchestration/task-graph.d.ts +0 -13
- package/dist/application/orchestration/task-graph.js +0 -56
- package/dist/application/orchestration/task-scheduler.d.ts +0 -18
- package/dist/application/orchestration/task-scheduler.js +0 -88
- package/dist/application/project/project-trust-service.d.ts +0 -13
- package/dist/application/project/project-trust-service.js +0 -74
- package/dist/application/protocol/browser-host-tool-executor.d.ts +0 -41
- package/dist/application/protocol/browser-host-tool-executor.js +0 -88
- package/dist/application/protocol/desktop-agent-command.d.ts +0 -9
- package/dist/application/protocol/desktop-agent-command.js +0 -663
- package/dist/application/protocol/desktop-attachment-store.d.ts +0 -16
- package/dist/application/protocol/desktop-attachment-store.js +0 -82
- package/dist/application/protocol/desktop-command-catalog.d.ts +0 -2
- package/dist/application/protocol/desktop-command-catalog.js +0 -19
- package/dist/application/protocol/desktop-command-contract.d.ts +0 -22
- package/dist/application/protocol/desktop-command-contract.js +0 -3
- package/dist/application/protocol/desktop-command-executor.d.ts +0 -16
- package/dist/application/protocol/desktop-command-executor.js +0 -47
- package/dist/application/protocol/desktop-command-output.d.ts +0 -15
- package/dist/application/protocol/desktop-command-output.js +0 -24
- package/dist/application/protocol/desktop-execution-policy.d.ts +0 -17
- package/dist/application/protocol/desktop-execution-policy.js +0 -49
- package/dist/application/protocol/desktop-host-tool-executor.d.ts +0 -57
- package/dist/application/protocol/desktop-host-tool-executor.js +0 -53
- package/dist/application/protocol/desktop-orchestration-events.d.ts +0 -5
- package/dist/application/protocol/desktop-orchestration-events.js +0 -37
- package/dist/application/protocol/json-line-writer.d.ts +0 -9
- package/dist/application/protocol/json-line-writer.js +0 -19
- package/dist/application/protocol/jsonl-agent-command.d.ts +0 -3
- package/dist/application/protocol/jsonl-agent-command.js +0 -97
- package/dist/application/protocol/jsonl-protocol.d.ts +0 -52
- package/dist/application/protocol/jsonl-protocol.js +0 -170
- package/dist/application/security/desktop-tool-scope-policy.d.ts +0 -3
- package/dist/application/security/desktop-tool-scope-policy.js +0 -52
- package/dist/application/security/tool-action-risk-analyzer.d.ts +0 -13
- package/dist/application/security/tool-action-risk-analyzer.js +0 -64
- package/dist/application/security/tool-approval-service.d.ts +0 -35
- package/dist/application/security/tool-approval-service.js +0 -97
- package/dist/application/security/tool-risk-classifier.d.ts +0 -11
- package/dist/application/security/tool-risk-classifier.js +0 -65
- package/dist/application/security/workspace-permission-policy.d.ts +0 -10
- package/dist/application/security/workspace-permission-policy.js +0 -50
- package/dist/application/session/project-session-access.d.ts +0 -8
- package/dist/application/session/project-session-access.js +0 -19
- package/dist/application/session/session-compaction-service.d.ts +0 -10
- package/dist/application/session/session-compaction-service.js +0 -43
- package/dist/application/session/session-turn-lifecycle.d.ts +0 -5
- package/dist/application/session/session-turn-lifecycle.js +0 -31
- package/dist/application/workspace/workspace-file-index.d.ts +0 -15
- package/dist/application/workspace/workspace-file-index.js +0 -60
- package/dist/application/workspace/workspace-file-reference-resolver.d.ts +0 -14
- package/dist/application/workspace/workspace-file-reference-resolver.js +0 -123
- package/dist/application/workspace/workspace-instruction-loader.d.ts +0 -8
- package/dist/application/workspace/workspace-instruction-loader.js +0 -55
- package/dist/bootstrap/composition-root.d.ts +0 -6
- package/dist/bootstrap/composition-root.js +0 -4
- package/dist/bootstrap/global-cli-options.d.ts +0 -6
- package/dist/bootstrap/global-cli-options.js +0 -29
- package/dist/bootstrap/native-devtools-stub.d.ts +0 -10
- package/dist/bootstrap/native-devtools-stub.js +0 -10
- package/dist/bootstrap/native-entry.d.ts +0 -1
- package/dist/bootstrap/native-entry.js +0 -6
- package/dist/bootstrap/native-tiktoken.d.ts +0 -4
- package/dist/bootstrap/native-tiktoken.js +0 -5
- package/dist/bootstrap/runtime-factory.d.ts +0 -35
- package/dist/bootstrap/runtime-factory.js +0 -44
- package/dist/bootstrap/shutdown-manager.d.ts +0 -10
- package/dist/bootstrap/shutdown-manager.js +0 -14
- package/dist/bootstrap/startup-sequence.d.ts +0 -5
- package/dist/bootstrap/startup-sequence.js +0 -10
- package/dist/domain/auth/auth-profile.d.ts +0 -14
- package/dist/domain/auth/auth-profile.js +0 -39
- package/dist/domain/config/config-schema.d.ts +0 -17
- package/dist/domain/config/config-schema.js +0 -105
- package/dist/domain/errors/cli-command-hint.d.ts +0 -5
- package/dist/domain/errors/cli-command-hint.js +0 -1
- package/dist/domain/errors/cli-error.d.ts +0 -35
- package/dist/domain/errors/cli-error.js +0 -129
- package/dist/domain/errors/error-codes.d.ts +0 -46
- package/dist/domain/errors/error-codes.js +0 -45
- package/dist/domain/extensions/extension-scope.d.ts +0 -3
- package/dist/domain/extensions/extension-scope.js +0 -23
- package/dist/domain/extensions/extension-state.d.ts +0 -5
- package/dist/domain/extensions/extension-state.js +0 -11
- package/dist/domain/extensions/hook-manifest.d.ts +0 -10
- package/dist/domain/extensions/hook-manifest.js +0 -23
- package/dist/domain/extensions/mcp-config.d.ts +0 -18
- package/dist/domain/extensions/mcp-config.js +0 -111
- package/dist/domain/extensions/plugin-manifest.d.ts +0 -11
- package/dist/domain/extensions/plugin-manifest.js +0 -43
- package/dist/domain/extensions/skill-manifest.d.ts +0 -10
- package/dist/domain/extensions/skill-manifest.js +0 -51
- package/dist/domain/filesystem/file-change-diff.d.ts +0 -21
- package/dist/domain/filesystem/file-change-diff.js +0 -60
- package/dist/domain/media/gateway-media-contract.d.ts +0 -23
- package/dist/domain/media/gateway-media-contract.js +0 -163
- package/dist/domain/media/media-contract.d.ts +0 -28
- package/dist/domain/media/media-contract.js +0 -1
- package/dist/domain/media/media-execution-policy.d.ts +0 -9
- package/dist/domain/media/media-execution-policy.js +0 -31
- package/dist/domain/orchestration/goal.d.ts +0 -58
- package/dist/domain/orchestration/goal.js +0 -113
- package/dist/domain/orchestration/subagent-identity.d.ts +0 -2
- package/dist/domain/orchestration/subagent-identity.js +0 -8
- package/dist/domain/orchestration/subagent.d.ts +0 -33
- package/dist/domain/orchestration/subagent.js +0 -1
- package/dist/domain/orchestration/task.d.ts +0 -31
- package/dist/domain/orchestration/task.js +0 -1
- package/dist/domain/project/project-identity.d.ts +0 -6
- package/dist/domain/project/project-identity.js +0 -4
- package/dist/domain/runtime/assistant-delta-normalizer.d.ts +0 -11
- package/dist/domain/runtime/assistant-delta-normalizer.js +0 -19
- package/dist/domain/runtime/resource-limits.d.ts +0 -60
- package/dist/domain/runtime/resource-limits.js +0 -60
- package/dist/domain/session/attachment.d.ts +0 -13
- package/dist/domain/session/attachment.js +0 -1
- package/dist/domain/session/session-schema.d.ts +0 -6
- package/dist/domain/session/session-schema.js +0 -28
- package/dist/domain/session/session.d.ts +0 -27
- package/dist/domain/session/session.js +0 -1
- package/dist/domain/settings/settings-document.d.ts +0 -8
- package/dist/domain/settings/settings-document.js +0 -36
- package/dist/domain/validation/record-schema.d.ts +0 -4
- package/dist/domain/validation/record-schema.js +0 -9
- package/dist/domain/workspace/workspace-settings.d.ts +0 -12
- package/dist/domain/workspace/workspace-settings.js +0 -44
- package/dist/infrastructure/agent-sdk/agent-instance-factory.d.ts +0 -22
- package/dist/infrastructure/agent-sdk/agent-instance-factory.js +0 -31
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.d.ts +0 -11
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.js +0 -447
- package/dist/infrastructure/cache/cache-policy.d.ts +0 -7
- package/dist/infrastructure/cache/cache-policy.js +0 -18
- package/dist/infrastructure/cache/file-cache-store.d.ts +0 -17
- package/dist/infrastructure/cache/file-cache-store.js +0 -121
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.d.ts +0 -11
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.js +0 -98
- package/dist/infrastructure/clipboard/clipboard-policy.d.ts +0 -8
- package/dist/infrastructure/clipboard/clipboard-policy.js +0 -19
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.d.ts +0 -10
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.js +0 -94
- package/dist/infrastructure/clipboard/image-normalizer.d.ts +0 -12
- package/dist/infrastructure/clipboard/image-normalizer.js +0 -78
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.d.ts +0 -7
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.js +0 -66
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.d.ts +0 -7
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.js +0 -70
- package/dist/infrastructure/config/config-loader.d.ts +0 -19
- package/dist/infrastructure/config/config-loader.js +0 -76
- package/dist/infrastructure/config/environment-values.d.ts +0 -2
- package/dist/infrastructure/config/environment-values.js +0 -7
- package/dist/infrastructure/credentials/composite-credential-store.d.ts +0 -11
- package/dist/infrastructure/credentials/composite-credential-store.js +0 -32
- package/dist/infrastructure/credentials/encrypted-file-credential-store.d.ts +0 -17
- package/dist/infrastructure/credentials/encrypted-file-credential-store.js +0 -181
- package/dist/infrastructure/credentials/environment-credential-store.d.ts +0 -11
- package/dist/infrastructure/credentials/environment-credential-store.js +0 -37
- package/dist/infrastructure/credentials/secret-input.d.ts +0 -7
- package/dist/infrastructure/credentials/secret-input.js +0 -44
- package/dist/infrastructure/extensions/composite-mcp-config-store.d.ts +0 -9
- package/dist/infrastructure/extensions/composite-mcp-config-store.js +0 -10
- package/dist/infrastructure/extensions/extension-directory-reader.d.ts +0 -2
- package/dist/infrastructure/extensions/extension-directory-reader.js +0 -15
- package/dist/infrastructure/extensions/extension-source-resolver.d.ts +0 -6
- package/dist/infrastructure/extensions/extension-source-resolver.js +0 -126
- package/dist/infrastructure/extensions/file-mcp-config-store.d.ts +0 -15
- package/dist/infrastructure/extensions/file-mcp-config-store.js +0 -66
- package/dist/infrastructure/extensions/hook-runtime.d.ts +0 -18
- package/dist/infrastructure/extensions/hook-runtime.js +0 -66
- package/dist/infrastructure/extensions/mcp-runtime.d.ts +0 -12
- package/dist/infrastructure/extensions/mcp-runtime.js +0 -52
- package/dist/infrastructure/extensions/plugin-discovery.d.ts +0 -5
- package/dist/infrastructure/extensions/plugin-discovery.js +0 -52
- package/dist/infrastructure/extensions/plugin-manager.d.ts +0 -26
- package/dist/infrastructure/extensions/plugin-manager.js +0 -139
- package/dist/infrastructure/extensions/skill-discovery.d.ts +0 -4
- package/dist/infrastructure/extensions/skill-discovery.js +0 -29
- package/dist/infrastructure/extensions/skill-installer.d.ts +0 -8
- package/dist/infrastructure/extensions/skill-installer.js +0 -88
- package/dist/infrastructure/extensions/skill-manager.d.ts +0 -22
- package/dist/infrastructure/extensions/skill-manager.js +0 -67
- package/dist/infrastructure/extensions/skill-roots.d.ts +0 -19
- package/dist/infrastructure/extensions/skill-roots.js +0 -25
- package/dist/infrastructure/extensions/skill-tool-executor.d.ts +0 -18
- package/dist/infrastructure/extensions/skill-tool-executor.js +0 -53
- package/dist/infrastructure/filesystem/atomic-file-store.d.ts +0 -12
- package/dist/infrastructure/filesystem/atomic-file-store.js +0 -106
- package/dist/infrastructure/filesystem/bounded-file-reader.d.ts +0 -6
- package/dist/infrastructure/filesystem/bounded-file-reader.js +0 -24
- package/dist/infrastructure/filesystem/bounded-json-reader.d.ts +0 -1
- package/dist/infrastructure/filesystem/bounded-json-reader.js +0 -7
- package/dist/infrastructure/filesystem/fs-errors.d.ts +0 -2
- package/dist/infrastructure/filesystem/fs-errors.js +0 -6
- package/dist/infrastructure/filesystem/gateway-media-input-reader.d.ts +0 -12
- package/dist/infrastructure/filesystem/gateway-media-input-reader.js +0 -49
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.d.ts +0 -21
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.js +0 -176
- package/dist/infrastructure/filesystem/path-resolver.d.ts +0 -20
- package/dist/infrastructure/filesystem/path-resolver.js +0 -119
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.d.ts +0 -13
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.js +0 -152
- package/dist/infrastructure/logging/daily-rotating-file-writer.d.ts +0 -20
- package/dist/infrastructure/logging/daily-rotating-file-writer.js +0 -75
- package/dist/infrastructure/logging/log-redactor.d.ts +0 -2
- package/dist/infrastructure/logging/log-redactor.js +0 -26
- package/dist/infrastructure/logging/logging-policy.d.ts +0 -6
- package/dist/infrastructure/logging/logging-policy.js +0 -6
- package/dist/infrastructure/logging/structured-logger.d.ts +0 -24
- package/dist/infrastructure/logging/structured-logger.js +0 -40
- package/dist/infrastructure/network/safe-media-downloader.d.ts +0 -23
- package/dist/infrastructure/network/safe-media-downloader.js +0 -239
- package/dist/infrastructure/platform/host-platform.d.ts +0 -14
- package/dist/infrastructure/platform/host-platform.js +0 -23
- package/dist/infrastructure/platform/host-process.d.ts +0 -17
- package/dist/infrastructure/platform/host-process.js +0 -116
- package/dist/infrastructure/platform/platform-paths.d.ts +0 -25
- package/dist/infrastructure/platform/platform-paths.js +0 -33
- package/dist/infrastructure/project/file-project-trust-store.d.ts +0 -12
- package/dist/infrastructure/project/file-project-trust-store.js +0 -59
- package/dist/infrastructure/sdk/chat-completion-adapter.d.ts +0 -8
- package/dist/infrastructure/sdk/chat-completion-adapter.js +0 -115
- package/dist/infrastructure/sdk/lotagate-client-factory.d.ts +0 -3
- package/dist/infrastructure/sdk/lotagate-client-factory.js +0 -8
- package/dist/infrastructure/sdk/model-catalog-adapter.d.ts +0 -19
- package/dist/infrastructure/sdk/model-catalog-adapter.js +0 -28
- package/dist/infrastructure/sdk/sdk-media-gateway-client.d.ts +0 -20
- package/dist/infrastructure/sdk/sdk-media-gateway-client.js +0 -97
- package/dist/infrastructure/sessions/file-goal-store.d.ts +0 -21
- package/dist/infrastructure/sessions/file-goal-store.js +0 -160
- package/dist/infrastructure/sessions/file-session-store.d.ts +0 -48
- package/dist/infrastructure/sessions/file-session-store.js +0 -525
- package/dist/infrastructure/sessions/project-session-paths.d.ts +0 -17
- package/dist/infrastructure/sessions/project-session-paths.js +0 -41
- package/dist/infrastructure/sessions/session-index.d.ts +0 -16
- package/dist/infrastructure/sessions/session-index.js +0 -84
- package/dist/infrastructure/sessions/session-journal.d.ts +0 -22
- package/dist/infrastructure/sessions/session-journal.js +0 -137
- package/dist/infrastructure/sessions/subagent-journal-store.d.ts +0 -28
- package/dist/infrastructure/sessions/subagent-journal-store.js +0 -30
- package/dist/infrastructure/shell/shell-tool-executor.d.ts +0 -17
- package/dist/infrastructure/shell/shell-tool-executor.js +0 -115
- package/dist/infrastructure/tokens/tiktoken-token-estimator.d.ts +0 -18
- package/dist/infrastructure/tokens/tiktoken-token-estimator.js +0 -48
- package/dist/infrastructure/workspace/workspace-settings-store.d.ts +0 -9
- package/dist/infrastructure/workspace/workspace-settings-store.js +0 -75
- package/dist/main.d.ts +0 -7
- package/dist/main.js +0 -66
- package/dist/ports/cache-store.d.ts +0 -10
- package/dist/ports/cache-store.js +0 -1
- package/dist/ports/chat-model.d.ts +0 -30
- package/dist/ports/chat-model.js +0 -1
- package/dist/ports/clipboard-adapter.d.ts +0 -7
- package/dist/ports/clipboard-adapter.js +0 -1
- package/dist/ports/clipboard-text-adapter.d.ts +0 -3
- package/dist/ports/clipboard-text-adapter.js +0 -1
- package/dist/ports/credential-store.d.ts +0 -7
- package/dist/ports/credential-store.js +0 -1
- package/dist/ports/goal-store.d.ts +0 -12
- package/dist/ports/goal-store.js +0 -1
- package/dist/ports/logger.d.ts +0 -8
- package/dist/ports/logger.js +0 -1
- package/dist/ports/media-gateway-client.d.ts +0 -54
- package/dist/ports/media-gateway-client.js +0 -1
- package/dist/ports/model-diagnostics.d.ts +0 -17
- package/dist/ports/model-diagnostics.js +0 -1
- package/dist/ports/project-trust-store.d.ts +0 -12
- package/dist/ports/project-trust-store.js +0 -1
- package/dist/ports/session-store.d.ts +0 -58
- package/dist/ports/session-store.js +0 -1
- package/dist/ports/subagent-lifecycle.d.ts +0 -31
- package/dist/ports/subagent-lifecycle.js +0 -1
- package/dist/ports/tool-activity.d.ts +0 -13
- package/dist/ports/tool-activity.js +0 -1
- package/dist/presentation/themes/theme.d.ts +0 -19
- package/dist/presentation/themes/theme.js +0 -8
- package/dist/presentation/tui/agent-initialization-renderer.d.ts +0 -4
- package/dist/presentation/tui/agent-initialization-renderer.js +0 -37
- package/dist/presentation/tui/context-display.d.ts +0 -21
- package/dist/presentation/tui/context-display.js +0 -33
- package/dist/presentation/tui/formatters.d.ts +0 -6
- package/dist/presentation/tui/formatters.js +0 -60
- package/dist/presentation/tui/ink/choice-window.d.ts +0 -5
- package/dist/presentation/tui/ink/choice-window.js +0 -5
- package/dist/presentation/tui/ink/components/activity-entry.d.ts +0 -6
- package/dist/presentation/tui/ink/components/activity-entry.js +0 -16
- package/dist/presentation/tui/ink/components/activity-status.d.ts +0 -10
- package/dist/presentation/tui/ink/components/activity-status.js +0 -21
- package/dist/presentation/tui/ink/components/choice-modal.d.ts +0 -11
- package/dist/presentation/tui/ink/components/choice-modal.js +0 -29
- package/dist/presentation/tui/ink/components/composer.d.ts +0 -40
- package/dist/presentation/tui/ink/components/composer.js +0 -271
- package/dist/presentation/tui/ink/components/file-diff.d.ts +0 -6
- package/dist/presentation/tui/ink/components/file-diff.js +0 -34
- package/dist/presentation/tui/ink/components/modal.d.ts +0 -8
- package/dist/presentation/tui/ink/components/modal.js +0 -110
- package/dist/presentation/tui/ink/components/shimmer-text.d.ts +0 -6
- package/dist/presentation/tui/ink/components/shimmer-text.js +0 -9
- package/dist/presentation/tui/ink/components/subagent-activity.d.ts +0 -11
- package/dist/presentation/tui/ink/components/subagent-activity.js +0 -61
- package/dist/presentation/tui/ink/components/transcript.d.ts +0 -39
- package/dist/presentation/tui/ink/components/transcript.js +0 -121
- package/dist/presentation/tui/ink/components/welcome-panel.d.ts +0 -6
- package/dist/presentation/tui/ink/components/welcome-panel.js +0 -20
- package/dist/presentation/tui/ink/lotagate-tui.d.ts +0 -6
- package/dist/presentation/tui/ink/lotagate-tui.js +0 -136
- package/dist/presentation/tui/ink/markdown-inline-renderer.d.ts +0 -4
- package/dist/presentation/tui/ink/markdown-inline-renderer.js +0 -20
- package/dist/presentation/tui/ink/markdown-inline.d.ts +0 -13
- package/dist/presentation/tui/ink/markdown-inline.js +0 -91
- package/dist/presentation/tui/ink/markdown-message.d.ts +0 -6
- package/dist/presentation/tui/ink/markdown-message.js +0 -66
- package/dist/presentation/tui/ink/markdown-table.d.ts +0 -16
- package/dist/presentation/tui/ink/markdown-table.js +0 -77
- package/dist/presentation/tui/ink/tui-bridge.d.ts +0 -195
- package/dist/presentation/tui/ink/tui-bridge.js +0 -289
- package/dist/presentation/tui/terminal-capabilities.d.ts +0 -15
- package/dist/presentation/tui/terminal-capabilities.js +0 -7
- package/dist/presentation/tui/terminal-mouse.d.ts +0 -5
- package/dist/presentation/tui/terminal-mouse.js +0 -19
- package/dist/presentation/tui/terminal-screen.d.ts +0 -10
- package/dist/presentation/tui/terminal-screen.js +0 -23
- package/dist/presentation/tui/tui-agent-event-runner.d.ts +0 -24
- package/dist/presentation/tui/tui-agent-event-runner.js +0 -69
- package/dist/presentation/tui/tui-application-contract.d.ts +0 -10
- package/dist/presentation/tui/tui-application-contract.js +0 -8
- package/dist/presentation/tui/tui-application.d.ts +0 -62
- package/dist/presentation/tui/tui-application.js +0 -675
- package/dist/presentation/tui/tui-attachment-input.d.ts +0 -2
- package/dist/presentation/tui/tui-attachment-input.js +0 -5
- package/dist/presentation/tui/tui-clipboard-paste-handlers.d.ts +0 -11
- package/dist/presentation/tui/tui-clipboard-paste-handlers.js +0 -25
- package/dist/presentation/tui/tui-command-context.d.ts +0 -3
- package/dist/presentation/tui/tui-command-context.js +0 -1
- package/dist/presentation/tui/tui-command-executor.d.ts +0 -38
- package/dist/presentation/tui/tui-command-executor.js +0 -214
- package/dist/presentation/tui/tui-command-host-factory.d.ts +0 -40
- package/dist/presentation/tui/tui-command-host-factory.js +0 -23
- package/dist/presentation/tui/tui-context-compaction.d.ts +0 -5
- package/dist/presentation/tui/tui-context-compaction.js +0 -22
- package/dist/presentation/tui/tui-context-service.d.ts +0 -34
- package/dist/presentation/tui/tui-context-service.js +0 -126
- package/dist/presentation/tui/tui-file-suggestions.d.ts +0 -3
- package/dist/presentation/tui/tui-file-suggestions.js +0 -8
- package/dist/presentation/tui/tui-goal-controller.d.ts +0 -14
- package/dist/presentation/tui/tui-goal-controller.js +0 -52
- package/dist/presentation/tui/tui-initial-model.d.ts +0 -3
- package/dist/presentation/tui/tui-initial-model.js +0 -28
- package/dist/presentation/tui/tui-lifecycle-actions.d.ts +0 -13
- package/dist/presentation/tui/tui-lifecycle-actions.js +0 -45
- package/dist/presentation/tui/tui-manual-compaction.d.ts +0 -18
- package/dist/presentation/tui/tui-manual-compaction.js +0 -31
- package/dist/presentation/tui/tui-media-model-selection.d.ts +0 -12
- package/dist/presentation/tui/tui-media-model-selection.js +0 -38
- package/dist/presentation/tui/tui-prompt-dispatcher.d.ts +0 -16
- package/dist/presentation/tui/tui-prompt-dispatcher.js +0 -38
- package/dist/presentation/tui/tui-skill-controller.d.ts +0 -11
- package/dist/presentation/tui/tui-skill-controller.js +0 -13
- package/dist/presentation/tui/tui-tool-approval.d.ts +0 -22
- package/dist/presentation/tui/tui-tool-approval.js +0 -73
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AuthenticationService } from '../../application/auth/authentication-service.js';
|
|
2
|
-
import { loadExecutionConfig } from '../../application/config/execution-config.js';
|
|
3
|
-
import { createLotaGateClient } from '../../infrastructure/sdk/lotagate-client-factory.js';
|
|
4
|
-
import { RESOURCE_LIMITS } from '../../domain/runtime/resource-limits.js';
|
|
5
|
-
import { runGoalLoop } from '../../application/orchestration/goal-runner.js';
|
|
6
|
-
import { formatCommandHint, MODEL_SELECT_HINT, TRUST_GRANT_HINT } from '../../application/commands/command-hints.js';
|
|
7
|
-
export async function runTuiGoal(options, objective, limits = {}) {
|
|
8
|
-
await runGoalLoopForTui(options, objective, true, limits);
|
|
9
|
-
}
|
|
10
|
-
export async function resumeTuiGoal(options) {
|
|
11
|
-
if (options.sessionId === undefined) {
|
|
12
|
-
options.write('No active session.');
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const state = await options.runtime.goalStore.get(options.sessionId);
|
|
16
|
-
if (state === undefined) {
|
|
17
|
-
options.write('No active goal.');
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
await runGoalLoopForTui(options, state.objective, false);
|
|
21
|
-
}
|
|
22
|
-
async function runGoalLoopForTui(options, objective, replace, limits = {}) {
|
|
23
|
-
if (options.sessionId === undefined) {
|
|
24
|
-
options.write('No active session.');
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const identity = await options.runtime.projectTrust.inspect(options.cwd);
|
|
28
|
-
if (!await options.runtime.projectTrust.isTrusted(identity)) {
|
|
29
|
-
options.write(`Project is not trusted. ${formatCommandHint(TRUST_GRANT_HINT, 'tui')}`);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const loaded = await loadExecutionConfig(options.runtime, options.cwd);
|
|
33
|
-
const model = options.model ?? loaded.config.model;
|
|
34
|
-
if (model === null) {
|
|
35
|
-
options.write(`No model is selected. ${formatCommandHint(MODEL_SELECT_HINT, 'tui')}`);
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const profile = options.profile ?? loaded.config.profile ?? AuthenticationService.defaultProfileName();
|
|
39
|
-
const credential = await options.runtime.auth.requireCredential(profile);
|
|
40
|
-
const goal = replace
|
|
41
|
-
? await options.runtime.goalStore.replace(options.sessionId, { objective, maxTurns: RESOURCE_LIMITS.goalDefaultMaxTurns, maxDurationMs: RESOURCE_LIMITS.goalDefaultMaxDurationMs, ...limits })
|
|
42
|
-
: await resumeGoal(options.sessionId, options.runtime);
|
|
43
|
-
const client = createLotaGateClient(credential.profile, credential.apiKey);
|
|
44
|
-
await runGoalLoop({
|
|
45
|
-
runtime: options.runtime, sessionId: options.sessionId, objective: goal.objective, model, client,
|
|
46
|
-
runTurn: (prompt, callbacks) => options.runPrompt(prompt, callbacks),
|
|
47
|
-
onMessage: options.write,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async function resumeGoal(sessionId, runtime) {
|
|
51
|
-
return runtime.goalStore.resume(sessionId);
|
|
52
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { AuthenticationService } from '../../application/auth/authentication-service.js';
|
|
2
|
-
import { CachedModelCatalog, modelCatalogCacheKey } from '../../application/model/cached-model-catalog.js';
|
|
3
|
-
import { ModelCatalogAdapter } from '../../infrastructure/sdk/model-catalog-adapter.js';
|
|
4
|
-
import { createLotaGateClient } from '../../infrastructure/sdk/lotagate-client-factory.js';
|
|
5
|
-
import { selectInitialModel } from '../../application/model/initial-model-selection.js';
|
|
6
|
-
export async function resolveInitialModel(runtime, cwd, config) {
|
|
7
|
-
if (config.model !== null && config.model.trim().length > 0)
|
|
8
|
-
return config.model;
|
|
9
|
-
const profileName = config.profile ?? AuthenticationService.defaultProfileName();
|
|
10
|
-
let credential;
|
|
11
|
-
try {
|
|
12
|
-
credential = await runtime.credentialStore.get(profileName);
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
runtime.logger.warn('Unable to load credentials while selecting the initial model.', { reason: error instanceof Error ? error.message : String(error) });
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
if (credential === undefined)
|
|
19
|
-
return null;
|
|
20
|
-
try {
|
|
21
|
-
const catalog = new CachedModelCatalog(new ModelCatalogAdapter(createLotaGateClient(credential.profile, credential.apiKey)), runtime.cache, modelCatalogCacheKey(credential.profile.name, credential.profile.baseUrl), runtime.cachePolicy.modelCatalogTtlMs);
|
|
22
|
-
return await selectInitialModel(config.model, { list: () => catalog.listModels() }, (model) => runtime.configLoader.setGlobal('model', model));
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
runtime.logger.warn('Unable to select the first model from the catalog.', { reason: error instanceof Error ? error.message : String(error) });
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { HookDefinition, HookEvent } from '../../domain/extensions/hook-manifest.js';
|
|
2
|
-
import type { HookRuntime } from '../../infrastructure/extensions/hook-runtime.js';
|
|
3
|
-
import type { InkTuiBridge } from './ink/tui-bridge.js';
|
|
4
|
-
export interface TuiInterruptState {
|
|
5
|
-
lastInterruptAt: number;
|
|
6
|
-
exitArmedUntil: number;
|
|
7
|
-
printResumeCommandOnExit: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function handleTuiInterrupt(state: TuiInterruptState, activeAbortController: AbortController | undefined, renderer: InkTuiBridge): TuiInterruptState;
|
|
10
|
-
export declare function cancelTuiResponse(activeAbortController: AbortController | undefined, renderer: InkTuiBridge): void;
|
|
11
|
-
export declare function runTuiHookEvent(hookRuntime: HookRuntime | undefined, hooks: readonly HookDefinition[], event: HookEvent, cwd: string, sessionId: string): Promise<void>;
|
|
12
|
-
export declare function isAbortError(error: unknown): boolean;
|
|
13
|
-
export declare function throwIfAborted(signal: AbortSignal): void;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export function handleTuiInterrupt(state, activeAbortController, renderer) {
|
|
2
|
-
const now = Date.now();
|
|
3
|
-
if (now - state.lastInterruptAt < 75)
|
|
4
|
-
return state;
|
|
5
|
-
if (activeAbortController !== undefined && !activeAbortController.signal.aborted) {
|
|
6
|
-
activeAbortController.abort();
|
|
7
|
-
renderer.cancelled();
|
|
8
|
-
renderer.notice('Interrupted. Press Ctrl+C again within 2 seconds to exit.');
|
|
9
|
-
return { ...state, lastInterruptAt: now, exitArmedUntil: now + 2000 };
|
|
10
|
-
}
|
|
11
|
-
if (now <= state.exitArmedUntil) {
|
|
12
|
-
renderer.requestExit();
|
|
13
|
-
return { ...state, lastInterruptAt: now, printResumeCommandOnExit: true };
|
|
14
|
-
}
|
|
15
|
-
renderer.notice('Press Ctrl+C again within 2 seconds to exit.');
|
|
16
|
-
return { ...state, lastInterruptAt: now, exitArmedUntil: now + 2000 };
|
|
17
|
-
}
|
|
18
|
-
export function cancelTuiResponse(activeAbortController, renderer) {
|
|
19
|
-
if (activeAbortController === undefined)
|
|
20
|
-
return;
|
|
21
|
-
activeAbortController.abort();
|
|
22
|
-
renderer.cancelled();
|
|
23
|
-
renderer.notice('Stopping response…');
|
|
24
|
-
}
|
|
25
|
-
export async function runTuiHookEvent(hookRuntime, hooks, event, cwd, sessionId) {
|
|
26
|
-
if (hookRuntime === undefined || hooks.length === 0)
|
|
27
|
-
return;
|
|
28
|
-
await hookRuntime.runEvent(hooks, event, { sessionId, runId: `hook-${Date.now()}`, iteration: 0, cwd, workspaceRoot: cwd, maxResultBytes: 256 * 1024 });
|
|
29
|
-
}
|
|
30
|
-
export function isAbortError(error) {
|
|
31
|
-
if (!(error instanceof Error))
|
|
32
|
-
return false;
|
|
33
|
-
if (error.name === 'AbortError' || error.message.toLowerCase().includes('aborted'))
|
|
34
|
-
return true;
|
|
35
|
-
return error.cause !== undefined && isAbortError(error.cause);
|
|
36
|
-
}
|
|
37
|
-
export function throwIfAborted(signal) {
|
|
38
|
-
if (!signal.aborted)
|
|
39
|
-
return;
|
|
40
|
-
if (signal.reason instanceof Error && signal.reason.name === 'AbortError')
|
|
41
|
-
throw signal.reason;
|
|
42
|
-
const error = new Error(signal.reason instanceof Error && signal.reason.message.length > 0 ? signal.reason.message : 'The operation was aborted.');
|
|
43
|
-
error.name = 'AbortError';
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CliRuntime } from '../../bootstrap/runtime-factory.js';
|
|
2
|
-
import type { SessionMetadata } from '../../domain/session/session.js';
|
|
3
|
-
import type { CliAgentSessionStore } from '../../application/agent/agent-session-store.js';
|
|
4
|
-
import type { TuiContextService } from './tui-context-service.js';
|
|
5
|
-
import type { InkTuiBridge } from './ink/tui-bridge.js';
|
|
6
|
-
export interface TuiManualCompactionOptions {
|
|
7
|
-
runtime: CliRuntime;
|
|
8
|
-
cwd: string;
|
|
9
|
-
session: SessionMetadata | undefined;
|
|
10
|
-
activeModel: string | null;
|
|
11
|
-
activeProfile: string | null;
|
|
12
|
-
activeResponse: boolean;
|
|
13
|
-
renderer: InkTuiBridge;
|
|
14
|
-
contextService: TuiContextService;
|
|
15
|
-
agentSessionStore: CliAgentSessionStore;
|
|
16
|
-
refreshContextUsage: () => Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
export declare function compactManualTuiSession(options: TuiManualCompactionOptions): Promise<void>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AuthenticationService } from '../../application/auth/authentication-service.js';
|
|
2
|
-
import { loadExecutionConfig } from '../../application/config/execution-config.js';
|
|
3
|
-
import { createLotaGateClient } from '../../infrastructure/sdk/lotagate-client-factory.js';
|
|
4
|
-
import { CliError } from '../../domain/errors/cli-error.js';
|
|
5
|
-
import { CLI_ERROR_CODES } from '../../domain/errors/error-codes.js';
|
|
6
|
-
import { MODEL_SELECT_HINT } from '../../application/commands/command-hints.js';
|
|
7
|
-
import { compactTuiSession } from './tui-context-compaction.js';
|
|
8
|
-
export async function compactManualTuiSession(options) {
|
|
9
|
-
if (options.activeResponse)
|
|
10
|
-
throw new Error('Stop the active response before compacting the session.');
|
|
11
|
-
if (options.session === undefined) {
|
|
12
|
-
options.renderer.notice('No active session.');
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
const loaded = await loadExecutionConfig(options.runtime, options.cwd);
|
|
16
|
-
const model = options.session.model ?? options.activeModel ?? loaded.config.model;
|
|
17
|
-
if (model === null)
|
|
18
|
-
throw new CliError(CLI_ERROR_CODES.MODEL_NOT_FOUND, 'No model is selected.', { category: 'model', userMessage: 'No model is selected.', hint: MODEL_SELECT_HINT });
|
|
19
|
-
const profile = options.session.profile ?? options.activeProfile ?? loaded.config.profile ?? AuthenticationService.defaultProfileName();
|
|
20
|
-
const credential = await options.runtime.auth.requireCredential(profile);
|
|
21
|
-
const contextWindow = await options.contextService.getModelContextWindow(model, profile);
|
|
22
|
-
options.renderer.activity('Compacting context manually…', 0);
|
|
23
|
-
try {
|
|
24
|
-
const compacted = await compactTuiSession(options.runtime, options.agentSessionStore, options.session.id, createLotaGateClient(credential.profile, credential.apiKey), model, contextWindow, (error) => options.runtime.logger.warn('Context summarization failed; using fallback summary.', { reason: error instanceof Error ? error.message : String(error) }));
|
|
25
|
-
options.renderer.transcriptNotice(compacted ? 'Context compacted manually.' : 'No conversation to compact.');
|
|
26
|
-
await options.refreshContextUsage();
|
|
27
|
-
}
|
|
28
|
-
finally {
|
|
29
|
-
options.renderer.clearActivity();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { CommandInvocation } from '../../application/commands/command-contract.js';
|
|
2
|
-
import type { TuiChoice } from './ink/tui-bridge.js';
|
|
3
|
-
import type { loadModelCatalog } from '../../application/model/model-catalog-service.js';
|
|
4
|
-
export type MediaModelCategory = 'image' | 'speech' | 'transcription' | 'translation' | 'video';
|
|
5
|
-
type ModelCatalog = Awaited<ReturnType<typeof loadModelCatalog>>;
|
|
6
|
-
export interface TuiMediaModelSelectionDependencies {
|
|
7
|
-
readonly loadModels: () => Promise<ModelCatalog>;
|
|
8
|
-
readonly selectModel: (title: string, choices: readonly TuiChoice[]) => Promise<string | undefined>;
|
|
9
|
-
}
|
|
10
|
-
/** Adds a request-only media model selection without changing persisted configuration. */
|
|
11
|
-
export declare function prepareTuiMediaInvocation(invocation: CommandInvocation, dependencies: TuiMediaModelSelectionDependencies): Promise<CommandInvocation | undefined>;
|
|
12
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { CliError } from '../../domain/errors/cli-error.js';
|
|
2
|
-
import { CLI_ERROR_CODES } from '../../domain/errors/error-codes.js';
|
|
3
|
-
const MEDIA_MODEL_CATEGORY_BY_ACTION = {
|
|
4
|
-
'image.generate': 'image',
|
|
5
|
-
'image.edit': 'image',
|
|
6
|
-
'audio.speech': 'speech',
|
|
7
|
-
'audio.transcribe': 'transcription',
|
|
8
|
-
'audio.translate': 'translation',
|
|
9
|
-
'video.generate': 'video',
|
|
10
|
-
};
|
|
11
|
-
/** Adds a request-only media model selection without changing persisted configuration. */
|
|
12
|
-
export async function prepareTuiMediaInvocation(invocation, dependencies) {
|
|
13
|
-
const category = MEDIA_MODEL_CATEGORY_BY_ACTION[invocation.action.id];
|
|
14
|
-
if (category === undefined || invocation.options.has('model'))
|
|
15
|
-
return invocation;
|
|
16
|
-
const catalog = await dependencies.loadModels();
|
|
17
|
-
const candidates = catalog.data.filter((model) => model['model_category'] === category);
|
|
18
|
-
if (candidates.length === 0) {
|
|
19
|
-
throw new CliError(CLI_ERROR_CODES.MODEL_NOT_FOUND, `No ${category} models are available.`, {
|
|
20
|
-
category: 'model',
|
|
21
|
-
userMessage: `No ${category} models are available for this command.`,
|
|
22
|
-
details: { category },
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
const selected = await dependencies.selectModel(`Select ${category} model`, candidates.map((model) => ({ value: model.id, label: model.id })));
|
|
26
|
-
if (selected === undefined)
|
|
27
|
-
return undefined;
|
|
28
|
-
const selectedModel = candidates.find((model) => model.id === selected);
|
|
29
|
-
if (selectedModel === undefined) {
|
|
30
|
-
throw new CliError(CLI_ERROR_CODES.MODEL_NOT_FOUND, 'The selected media model is no longer available.', {
|
|
31
|
-
category: 'model',
|
|
32
|
-
userMessage: 'The selected media model is no longer available. Refresh the model list and try again.',
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const options = new Map(invocation.options);
|
|
36
|
-
options.set('model', selectedModel.id);
|
|
37
|
-
return { ...invocation, options };
|
|
38
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Logger } from '../../ports/logger.js';
|
|
2
|
-
import type { AttachmentPayload } from '../../domain/session/attachment.js';
|
|
3
|
-
import type { PendingAttachmentStore } from '../../application/chat/pending-attachment-store.js';
|
|
4
|
-
import type { InkTuiBridge } from './ink/tui-bridge.js';
|
|
5
|
-
import type { TuiCommandContext } from './tui-command-context.js';
|
|
6
|
-
import type { TuiCommandHost } from './tui-command-executor.js';
|
|
7
|
-
export interface TuiPromptDispatcherOptions {
|
|
8
|
-
renderer: InkTuiBridge;
|
|
9
|
-
logger: Logger;
|
|
10
|
-
commandHost: TuiCommandHost;
|
|
11
|
-
pendingAttachments: PendingAttachmentStore;
|
|
12
|
-
commandContext: () => TuiCommandContext;
|
|
13
|
-
sendPrompt: (input: string, attachments: readonly AttachmentPayload[]) => Promise<unknown>;
|
|
14
|
-
resetActiveAbortController: () => void;
|
|
15
|
-
}
|
|
16
|
-
export declare function dispatchTuiPrompt(input: string, options: TuiPromptDispatcherOptions): Promise<boolean>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { asCliError } from '../../domain/errors/cli-error.js';
|
|
2
|
-
import { parseCommandInvocation, tokenizeCommandInput } from '../../application/commands/command-parser.js';
|
|
3
|
-
import { COMMAND_REGISTRY } from '../../application/commands/command-runtime.js';
|
|
4
|
-
import { formatCliErrorMessage } from '../../application/commands/command-hints.js';
|
|
5
|
-
import { executeTuiCommand } from './tui-command-executor.js';
|
|
6
|
-
export async function dispatchTuiPrompt(input, options) {
|
|
7
|
-
if (input.trimStart().startsWith('/'))
|
|
8
|
-
return dispatchSlashCommand(input, options);
|
|
9
|
-
options.logger.info('Interactive prompt started.', { promptLength: input.length, attachmentCount: options.pendingAttachments.size });
|
|
10
|
-
try {
|
|
11
|
-
await options.sendPrompt(input, options.pendingAttachments.list());
|
|
12
|
-
options.logger.info('Interactive prompt completed.', { promptLength: input.length });
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
options.resetActiveAbortController();
|
|
16
|
-
options.renderer.failed();
|
|
17
|
-
const cliError = asCliError(error);
|
|
18
|
-
options.logger.error('Prompt execution failed.', { code: cliError.code, category: cliError.category, ...(cliError.details ?? {}) });
|
|
19
|
-
options.renderer.error(formatCliErrorMessage(cliError, 'tui'));
|
|
20
|
-
}
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
async function dispatchSlashCommand(input, options) {
|
|
24
|
-
options.renderer.command(input);
|
|
25
|
-
try {
|
|
26
|
-
const invocation = parseCommandInvocation(tokenizeCommandInput(input.trimStart().slice(1)), 'tui', COMMAND_REGISTRY);
|
|
27
|
-
options.logger.info('Slash command started.', { command: invocation.action.id });
|
|
28
|
-
const exit = await executeTuiCommand(invocation, options.commandHost, options.commandContext());
|
|
29
|
-
options.logger.info('Slash command completed.', { command: invocation.action.id, exit });
|
|
30
|
-
return exit;
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
const cliError = asCliError(error);
|
|
34
|
-
options.logger.error('Slash command failed.', { code: cliError.code, category: cliError.category });
|
|
35
|
-
options.renderer.error(formatCliErrorMessage(cliError, 'tui'));
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { SkillManifest } from '../../domain/extensions/skill-manifest.js';
|
|
2
|
-
import type { ExtensionScope } from '../../domain/extensions/extension-scope.js';
|
|
3
|
-
import type { TuiCommandContext } from './tui-command-context.js';
|
|
4
|
-
import { type ScopedSkill } from '../../infrastructure/extensions/skill-manager.js';
|
|
5
|
-
import type { SkillRootScope } from '../../infrastructure/extensions/skill-roots.js';
|
|
6
|
-
export interface TuiSkillControllerOptions {
|
|
7
|
-
globalConfigDir: string;
|
|
8
|
-
skillRootScopes: readonly SkillRootScope[];
|
|
9
|
-
runPrompt: (prompt: string, skill?: SkillManifest) => Promise<string>;
|
|
10
|
-
}
|
|
11
|
-
export declare function runTuiSkill(options: TuiSkillControllerOptions, name: string, args: readonly string[], context: TuiCommandContext, scope?: ExtensionScope, availableSkills?: readonly ScopedSkill[]): Promise<void>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { SkillManager } from '../../infrastructure/extensions/skill-manager.js';
|
|
3
|
-
export async function runTuiSkill(options, name, args, context, scope, availableSkills) {
|
|
4
|
-
const skills = availableSkills ?? await new SkillManager(path.join(options.globalConfigDir, 'skills-state.json')).listScoped(options.skillRootScopes, { includeShadowed: true });
|
|
5
|
-
const skill = skills.find((item) => (item.skillKey === name || item.name === name) && (scope === undefined || item.scope === scope));
|
|
6
|
-
if (skill === undefined || !skill.enabled || !skill.userInvocable) {
|
|
7
|
-
context.write(`Skill unavailable: ${name}`);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const requestedScope = args.join(' ').trim();
|
|
11
|
-
const prompt = requestedScope.length === 0 ? skill.body : `${skill.body}\n\nRequested scope: ${requestedScope}`;
|
|
12
|
-
await options.runPrompt(prompt, skill);
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { CliRuntime } from '../../bootstrap/runtime-factory.js';
|
|
2
|
-
import type { ToolApprovalRequest } from '@lotagate/agent-sdk';
|
|
3
|
-
import { ToolApprovalService, type CliApprovalMode, type ToolApprovalDecision } from '../../application/security/tool-approval-service.js';
|
|
4
|
-
import type { SkillScopeStore } from '../../application/extensions/skill-scope-store.js';
|
|
5
|
-
import type { WorkspacePermissionPolicy } from '../../domain/workspace/workspace-settings.js';
|
|
6
|
-
import type { InkTuiBridge } from './ink/tui-bridge.js';
|
|
7
|
-
export interface TuiToolApprovalHost {
|
|
8
|
-
readonly renderer: InkTuiBridge;
|
|
9
|
-
readonly runtime: CliRuntime;
|
|
10
|
-
getSessionId(): string | undefined;
|
|
11
|
-
getActiveSignal(): AbortSignal | undefined;
|
|
12
|
-
}
|
|
13
|
-
/** Owns the TUI adapter around the application-layer approval service. */
|
|
14
|
-
export declare class TuiToolApprovalCoordinator {
|
|
15
|
-
private readonly host;
|
|
16
|
-
constructor(host: TuiToolApprovalHost);
|
|
17
|
-
ask(request: ToolApprovalRequest): Promise<boolean>;
|
|
18
|
-
create(mode: CliApprovalMode, trustedProject: boolean, workspaceRoot: string, skillScopes?: SkillScopeStore, workspacePermissions?: WorkspacePermissionPolicy): ToolApprovalService;
|
|
19
|
-
remember(workspaceRoot: string, request: ToolApprovalRequest): Promise<void>;
|
|
20
|
-
audit(decision: ToolApprovalDecision): Promise<void>;
|
|
21
|
-
rememberFailure(error: unknown): void;
|
|
22
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ToolApprovalService } from '../../application/security/tool-approval-service.js';
|
|
2
|
-
import { permissionRuleForRequest } from '../../application/security/workspace-permission-policy.js';
|
|
3
|
-
import { formatShellCommandForDisplay, formatToolActivityName } from '../../application/agent/tool-display.js';
|
|
4
|
-
/** Owns the TUI adapter around the application-layer approval service. */
|
|
5
|
-
export class TuiToolApprovalCoordinator {
|
|
6
|
-
host;
|
|
7
|
-
constructor(host) {
|
|
8
|
-
this.host = host;
|
|
9
|
-
}
|
|
10
|
-
async ask(request) {
|
|
11
|
-
this.host.renderer.status('Waiting for approval');
|
|
12
|
-
try {
|
|
13
|
-
return await this.host.renderer.confirmTool(request.toolName, describeToolApproval(request));
|
|
14
|
-
}
|
|
15
|
-
finally {
|
|
16
|
-
const signal = this.host.getActiveSignal();
|
|
17
|
-
if (signal !== undefined && !signal.aborted)
|
|
18
|
-
this.host.renderer.status('Thinking');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
create(mode, trustedProject, workspaceRoot, skillScopes, workspacePermissions) {
|
|
22
|
-
return new ToolApprovalService({
|
|
23
|
-
mode,
|
|
24
|
-
trustedProject,
|
|
25
|
-
...(skillScopes === undefined ? {} : { skillScopes }),
|
|
26
|
-
...(workspacePermissions === undefined ? {} : { workspacePermissions }),
|
|
27
|
-
prompt: (request) => this.ask(request),
|
|
28
|
-
...(trustedProject ? { rememberApproval: (request) => this.remember(workspaceRoot, request) } : {}),
|
|
29
|
-
...(trustedProject ? { onRememberApprovalFailure: (_request, error) => this.rememberFailure(error) } : {}),
|
|
30
|
-
audit: (decision) => this.audit(decision),
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async remember(workspaceRoot, request) {
|
|
34
|
-
await this.host.runtime.workspaceSettings.rememberAllow(workspaceRoot, permissionRuleForRequest(request.toolName, request.input));
|
|
35
|
-
}
|
|
36
|
-
async audit(decision) {
|
|
37
|
-
this.host.runtime.logger.info('Tool authorization decision.', {
|
|
38
|
-
toolName: decision.toolName,
|
|
39
|
-
decision: decision.decision,
|
|
40
|
-
reason: decision.reason,
|
|
41
|
-
...(decision.source === undefined ? {} : { source: decision.source }),
|
|
42
|
-
...(decision.skillName === undefined ? {} : { skillName: decision.skillName }),
|
|
43
|
-
});
|
|
44
|
-
const sessionId = this.host.getSessionId();
|
|
45
|
-
if (sessionId === undefined)
|
|
46
|
-
return;
|
|
47
|
-
await this.host.runtime.sessionStore.appendEvent({
|
|
48
|
-
type: 'tool.approval',
|
|
49
|
-
timestamp: new Date().toISOString(),
|
|
50
|
-
sessionId,
|
|
51
|
-
data: { toolName: decision.toolName, ...(decision.source === undefined ? {} : { source: decision.source }), ...(decision.skillName === undefined ? {} : { skillName: decision.skillName }), decision: decision.decision, reason: decision.reason },
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
rememberFailure(error) {
|
|
55
|
-
this.host.runtime.logger.warn('Unable to persist tool approval.', { reason: error instanceof Error ? error.message : String(error) });
|
|
56
|
-
this.host.renderer.notice('Approval accepted for this action, but could not be remembered.');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function describeToolApproval(request) {
|
|
60
|
-
if (request.toolName === 'filesystem.write')
|
|
61
|
-
return `Write workspace file: ${safeApprovalValue(request.input['path'])}`;
|
|
62
|
-
if (request.toolName === 'shell.exec') {
|
|
63
|
-
const command = typeof request.input['command'] === 'string' ? request.input['command'] : '';
|
|
64
|
-
const args = Array.isArray(request.input['args']) ? request.input['args'].filter((value) => typeof value === 'string') : [];
|
|
65
|
-
return truncateApprovalDetail(`Run command: ${formatShellCommandForDisplay(command, args, 240)}`);
|
|
66
|
-
}
|
|
67
|
-
return `This ${formatToolActivityName(request.toolName)} operation may change workspace or external state.`;
|
|
68
|
-
}
|
|
69
|
-
function safeApprovalValue(value) {
|
|
70
|
-
const text = typeof value === 'string' ? value : String(value ?? '');
|
|
71
|
-
return truncateApprovalDetail(text.replace(/Bearer\s+[^\s]+/giu, 'Bearer [REDACTED]').replace(/sk-[A-Za-z0-9_-]{8,}/gu, '[REDACTED]'));
|
|
72
|
-
}
|
|
73
|
-
function truncateApprovalDetail(value) { return value.length <= 240 ? value : `${value.slice(0, 237)}...`; }
|
package/dist/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.1.22";
|
package/dist/version.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.1.22';
|