@lotagate/cli 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -3
- package/SECURITY.md +2 -0
- package/dist/application/agent/agent-history.d.ts +3 -0
- package/dist/application/agent/agent-history.js +5 -0
- package/dist/application/agent/agent-input-context.d.ts +12 -0
- package/dist/application/agent/agent-input-context.js +5 -0
- package/dist/application/agent/agent-limit.d.ts +3 -0
- package/dist/application/agent/agent-limit.js +1 -0
- package/dist/application/agent/agent-run-tracker.d.ts +30 -0
- package/dist/application/agent/agent-run-tracker.js +1 -0
- package/dist/application/agent/agent-runtime-context.d.ts +22 -0
- package/dist/application/agent/agent-runtime-context.js +1 -0
- package/dist/application/agent/agent-session-store.d.ts +19 -0
- package/dist/application/agent/agent-session-store.js +6 -0
- package/dist/application/agent/capability-profile.d.ts +55 -0
- package/dist/application/agent/capability-profile.js +1 -0
- package/dist/application/agent/cli-agent-execution-service.d.ts +110 -0
- package/dist/application/agent/cli-agent-execution-service.js +1 -0
- package/dist/application/agent/cli-agent-run-request.d.ts +12 -0
- package/dist/application/agent/cli-agent-run-request.js +0 -0
- package/dist/application/agent/context-compaction-persistence.d.ts +8 -0
- package/dist/application/agent/context-compaction-persistence.js +1 -0
- package/dist/application/agent/context-compaction.d.ts +21 -0
- package/dist/application/agent/context-compaction.js +7 -0
- package/dist/application/agent/interactive-agent-guidance.d.ts +5 -0
- package/dist/application/agent/interactive-agent-guidance.js +2 -0
- package/dist/application/agent/prompt-data-safety.d.ts +14 -0
- package/dist/application/agent/prompt-data-safety.js +4 -0
- package/dist/application/agent/scoped-tool-executor.d.ts +13 -0
- package/dist/application/agent/scoped-tool-executor.js +1 -0
- package/dist/application/agent/tool-catalog.d.ts +14 -0
- package/dist/application/agent/tool-catalog.js +1 -0
- package/dist/application/agent/tool-display.d.ts +7 -0
- package/dist/application/agent/tool-display.js +1 -0
- package/dist/application/agent/tool-hook-lifecycle.d.ts +19 -0
- package/dist/application/agent/tool-hook-lifecycle.js +1 -0
- package/dist/application/auth/authentication-service.d.ts +20 -0
- package/dist/application/auth/authentication-service.js +1 -0
- package/dist/application/chat/chat-service.d.ts +12 -0
- package/dist/application/chat/chat-service.js +1 -0
- package/dist/application/chat/pending-attachment-store.d.ts +12 -0
- package/dist/application/chat/pending-attachment-store.js +1 -0
- package/dist/application/commands/application-command-executor.d.ts +23 -0
- package/dist/application/commands/application-command-executor.js +3 -0
- package/dist/application/commands/cli-args.d.ts +6 -0
- package/dist/application/commands/cli-args.js +1 -0
- package/dist/application/commands/cli-command-services.d.ts +17 -0
- package/dist/application/commands/cli-command-services.js +33 -0
- package/dist/application/commands/command-cancellation.d.ts +6 -0
- package/dist/application/commands/command-cancellation.js +1 -0
- package/dist/application/commands/command-catalog.d.ts +6 -0
- package/dist/application/commands/command-catalog.js +1 -0
- package/dist/application/commands/command-contract.d.ts +60 -0
- package/dist/application/commands/command-contract.js +0 -0
- package/dist/application/commands/command-hints.d.ts +9 -0
- package/dist/application/commands/command-hints.js +1 -0
- package/dist/application/commands/command-output.d.ts +4 -0
- package/dist/application/commands/command-output.js +0 -0
- package/dist/application/commands/command-parser.d.ts +10 -0
- package/dist/application/commands/command-parser.js +1 -0
- package/dist/application/commands/command-presentation.d.ts +7 -0
- package/dist/application/commands/command-presentation.js +3 -0
- package/dist/application/commands/command-registry.d.ts +11 -0
- package/dist/application/commands/command-registry.js +1 -0
- package/dist/application/commands/command-runtime.d.ts +2 -0
- package/dist/application/commands/command-runtime.js +1 -0
- package/dist/application/commands/goal-command-handlers.d.ts +3 -0
- package/dist/application/commands/goal-command-handlers.js +7 -0
- package/dist/application/commands/media-command-handlers.d.ts +9 -0
- package/dist/application/commands/media-command-handlers.js +8 -0
- package/dist/application/commands/media-command-output.d.ts +11 -0
- package/dist/application/commands/media-command-output.js +1 -0
- package/dist/application/commands/memory-command-handler.d.ts +29 -0
- package/dist/application/commands/memory-command-handler.js +12 -0
- package/dist/application/commands/runtime-command-handlers.d.ts +7 -0
- package/dist/application/commands/runtime-command-handlers.js +14 -0
- package/dist/application/commands/stream-output.d.ts +4 -0
- package/dist/application/commands/stream-output.js +1 -0
- package/dist/application/commands/utility-commands.d.ts +6 -0
- package/dist/application/commands/utility-commands.js +10 -0
- package/dist/application/config/execution-config.d.ts +4 -0
- package/dist/application/config/execution-config.js +1 -0
- package/dist/application/extensions/extension-list-contract.d.ts +18 -0
- package/dist/application/extensions/extension-list-contract.js +0 -0
- package/dist/application/extensions/extension-list-formatters.d.ts +38 -0
- package/dist/application/extensions/extension-list-formatters.js +1 -0
- package/dist/application/extensions/extension-list-output.d.ts +3 -0
- package/dist/application/extensions/extension-list-output.js +3 -0
- package/dist/application/extensions/plugin-contribution-registry.d.ts +31 -0
- package/dist/application/extensions/plugin-contribution-registry.js +1 -0
- package/dist/application/extensions/plugin-detail-contract.d.ts +25 -0
- package/dist/application/extensions/plugin-detail-contract.js +0 -0
- package/dist/application/extensions/plugin-detail-service.d.ts +3 -0
- package/dist/application/extensions/plugin-detail-service.js +1 -0
- package/dist/application/extensions/skill-scope-store.d.ts +23 -0
- package/dist/application/extensions/skill-scope-store.js +1 -0
- package/dist/application/formatting/compact-number.d.ts +2 -0
- package/dist/application/formatting/compact-number.js +1 -0
- package/dist/application/formatting/compact-table.d.ts +22 -0
- package/dist/application/formatting/compact-table.js +2 -0
- package/dist/application/intent/completion-gate.d.ts +6 -0
- package/dist/application/intent/completion-gate.js +1 -0
- package/dist/application/intent/evidence-ledger.d.ts +21 -0
- package/dist/application/intent/evidence-ledger.js +1 -0
- package/dist/application/intent/evidence-recording-tool-executor.d.ts +16 -0
- package/dist/application/intent/evidence-recording-tool-executor.js +1 -0
- package/dist/application/intent/intent-compiler.d.ts +11 -0
- package/dist/application/intent/intent-compiler.js +2 -0
- package/dist/application/intent/intent-execution-gate.d.ts +11 -0
- package/dist/application/intent/intent-execution-gate.js +1 -0
- package/dist/application/intent/intent-host-context.d.ts +6 -0
- package/dist/application/intent/intent-host-context.js +1 -0
- package/dist/application/intent/intent-run-controller.d.ts +56 -0
- package/dist/application/intent/intent-run-controller.js +3 -0
- package/dist/application/intent/project-policy.d.ts +16 -0
- package/dist/application/intent/project-policy.js +1 -0
- package/dist/application/media/video-operation-poller.d.ts +5 -0
- package/dist/application/media/video-operation-poller.js +1 -0
- package/dist/application/memory/memory-capture-policy.d.ts +10 -0
- package/dist/application/memory/memory-capture-policy.js +1 -0
- package/dist/application/memory/memory-consolidation-service.d.ts +12 -0
- package/dist/application/memory/memory-consolidation-service.js +1 -0
- package/dist/application/memory/memory-context-assembler.d.ts +24 -0
- package/dist/application/memory/memory-context-assembler.js +1 -0
- package/dist/application/memory/memory-extractor.d.ts +21 -0
- package/dist/application/memory/memory-extractor.js +2 -0
- package/dist/application/memory/memory-service.d.ts +34 -0
- package/dist/application/memory/memory-service.js +1 -0
- package/dist/application/model/cached-model-catalog.d.ts +13 -0
- package/dist/application/model/cached-model-catalog.js +1 -0
- package/dist/application/model/initial-model-selection.d.ts +10 -0
- package/dist/application/model/initial-model-selection.js +1 -0
- package/dist/application/model/model-catalog-service.d.ts +6 -0
- package/dist/application/model/model-catalog-service.js +1 -0
- package/dist/application/model/model-context-window.d.ts +3 -0
- package/dist/application/model/model-context-window.js +1 -0
- package/dist/application/model/model-response-retry.d.ts +9 -0
- package/dist/application/model/model-response-retry.js +1 -0
- package/dist/application/orchestration/abortable-wait.d.ts +2 -0
- package/dist/application/orchestration/abortable-wait.js +1 -0
- package/dist/application/orchestration/cli-subagent-service.d.ts +73 -0
- package/dist/application/orchestration/cli-subagent-service.js +13 -0
- package/dist/application/orchestration/cli-turn-event-projector.d.ts +15 -0
- package/dist/application/orchestration/cli-turn-event-projector.js +1 -0
- package/dist/application/orchestration/cli-turn-events.d.ts +83 -0
- package/dist/application/orchestration/cli-turn-events.js +1 -0
- package/dist/application/orchestration/cli-turn-persistence.d.ts +6 -0
- package/dist/application/orchestration/cli-turn-persistence.js +1 -0
- package/dist/application/orchestration/goal-evaluator.d.ts +18 -0
- package/dist/application/orchestration/goal-evaluator.js +3 -0
- package/dist/application/orchestration/goal-input.d.ts +3 -0
- package/dist/application/orchestration/goal-input.js +1 -0
- package/dist/application/orchestration/goal-output.d.ts +2 -0
- package/dist/application/orchestration/goal-output.js +2 -0
- package/dist/application/orchestration/goal-runner.d.ts +22 -0
- package/dist/application/orchestration/goal-runner.js +10 -0
- package/dist/application/orchestration/goal-usage.d.ts +9 -0
- package/dist/application/orchestration/goal-usage.js +1 -0
- package/dist/application/orchestration/headless-agent-turn.d.ts +35 -0
- package/dist/application/orchestration/headless-agent-turn.js +4 -0
- package/dist/application/orchestration/subagent-coordinator.d.ts +41 -0
- package/dist/application/orchestration/subagent-coordinator.js +1 -0
- package/dist/application/orchestration/subagent-handoff.d.ts +3 -0
- package/dist/application/orchestration/subagent-handoff.js +3 -0
- package/dist/application/orchestration/subagent-tool-executor.d.ts +12 -0
- package/dist/application/orchestration/subagent-tool-executor.js +1 -0
- package/dist/application/orchestration/task-graph.d.ts +13 -0
- package/dist/application/orchestration/task-graph.js +1 -0
- package/dist/application/orchestration/task-scheduler.d.ts +18 -0
- package/dist/application/orchestration/task-scheduler.js +1 -0
- package/dist/application/project/project-trust-service.d.ts +13 -0
- package/dist/application/project/project-trust-service.js +1 -0
- package/dist/application/project-intelligence/project-intelligence-service.d.ts +14 -0
- package/dist/application/project-intelligence/project-intelligence-service.js +1 -0
- package/dist/application/protocol/browser-host-tool-executor.d.ts +41 -0
- package/dist/application/protocol/browser-host-tool-executor.js +2 -0
- package/dist/application/protocol/computer-host-tool-executor.d.ts +42 -0
- package/dist/application/protocol/computer-host-tool-executor.js +2 -0
- package/dist/application/protocol/desktop-agent-command.d.ts +9 -0
- package/dist/application/protocol/desktop-agent-command.js +3 -0
- package/dist/application/protocol/desktop-agent-request-parser.d.ts +186 -0
- package/dist/application/protocol/desktop-agent-request-parser.js +1 -0
- package/dist/application/protocol/desktop-approval-broker.d.ts +16 -0
- package/dist/application/protocol/desktop-approval-broker.js +1 -0
- package/dist/application/protocol/desktop-attachment-store.d.ts +16 -0
- package/dist/application/protocol/desktop-attachment-store.js +1 -0
- package/dist/application/protocol/desktop-command-catalog.d.ts +2 -0
- package/dist/application/protocol/desktop-command-catalog.js +1 -0
- package/dist/application/protocol/desktop-command-contract.d.ts +26 -0
- package/dist/application/protocol/desktop-command-contract.js +1 -0
- package/dist/application/protocol/desktop-command-executor.d.ts +17 -0
- package/dist/application/protocol/desktop-command-executor.js +1 -0
- package/dist/application/protocol/desktop-command-output.d.ts +15 -0
- package/dist/application/protocol/desktop-command-output.js +1 -0
- package/dist/application/protocol/desktop-execution-policy.d.ts +17 -0
- package/dist/application/protocol/desktop-execution-policy.js +1 -0
- package/dist/application/protocol/desktop-extension-request-handler.d.ts +14 -0
- package/dist/application/protocol/desktop-extension-request-handler.js +1 -0
- package/dist/application/protocol/desktop-extension-service.d.ts +44 -0
- package/dist/application/protocol/desktop-extension-service.js +3 -0
- package/dist/application/protocol/desktop-host-tool-executor.d.ts +63 -0
- package/dist/application/protocol/desktop-host-tool-executor.js +2 -0
- package/dist/application/protocol/desktop-intent-event-writer.d.ts +20 -0
- package/dist/application/protocol/desktop-intent-event-writer.js +1 -0
- package/dist/application/protocol/desktop-mcp-events.d.ts +10 -0
- package/dist/application/protocol/desktop-mcp-events.js +1 -0
- package/dist/application/protocol/desktop-orchestration-events.d.ts +2 -0
- package/dist/application/protocol/desktop-orchestration-events.js +2 -0
- package/dist/application/protocol/desktop-protocol-helpers.d.ts +13 -0
- package/dist/application/protocol/desktop-protocol-helpers.js +1 -0
- package/dist/application/protocol/document-host-tool-definitions.d.ts +4 -0
- package/dist/application/protocol/document-host-tool-definitions.js +1 -0
- package/dist/application/protocol/document-host-tool-executor.d.ts +49 -0
- package/dist/application/protocol/document-host-tool-executor.js +2 -0
- package/dist/application/protocol/json-line-writer.d.ts +9 -0
- package/dist/application/protocol/json-line-writer.js +2 -0
- package/dist/application/protocol/jsonl-agent-command.d.ts +3 -0
- package/dist/application/protocol/jsonl-agent-command.js +3 -0
- package/dist/application/protocol/jsonl-protocol.d.ts +82 -0
- package/dist/application/protocol/jsonl-protocol.js +2 -0
- package/dist/application/protocol/tool-image-content.d.ts +4 -0
- package/dist/application/protocol/tool-image-content.js +1 -0
- package/dist/application/security/delegated-worker-policy.d.ts +3 -0
- package/dist/application/security/delegated-worker-policy.js +1 -0
- package/dist/application/security/desktop-tool-scope-policy.d.ts +4 -0
- package/dist/application/security/desktop-tool-scope-policy.js +1 -0
- package/dist/application/security/tool-action-risk-analyzer.d.ts +13 -0
- package/dist/application/security/tool-action-risk-analyzer.js +1 -0
- package/dist/application/security/tool-approval-service.d.ts +37 -0
- package/dist/application/security/tool-approval-service.js +1 -0
- package/dist/application/security/tool-risk-classifier.d.ts +18 -0
- package/dist/application/security/tool-risk-classifier.js +1 -0
- package/dist/application/security/workspace-permission-policy.d.ts +10 -0
- package/dist/application/security/workspace-permission-policy.js +1 -0
- package/dist/application/session/project-session-access.d.ts +8 -0
- package/dist/application/session/project-session-access.js +1 -0
- package/dist/application/session/session-compaction-service.d.ts +10 -0
- package/dist/application/session/session-compaction-service.js +1 -0
- package/dist/application/session/session-turn-lifecycle.d.ts +5 -0
- package/dist/application/session/session-turn-lifecycle.js +1 -0
- package/dist/application/workspace/session-execution-workspace.d.ts +59 -0
- package/dist/application/workspace/session-execution-workspace.js +3 -0
- package/dist/application/workspace/workspace-file-index.d.ts +15 -0
- package/dist/application/workspace/workspace-file-index.js +1 -0
- package/dist/application/workspace/workspace-file-reference-resolver.d.ts +20 -0
- package/dist/application/workspace/workspace-file-reference-resolver.js +17 -0
- package/dist/application/workspace/workspace-instruction-loader.d.ts +8 -0
- package/dist/application/workspace/workspace-instruction-loader.js +1 -0
- package/dist/bootstrap/composition-root.d.ts +6 -0
- package/dist/bootstrap/composition-root.js +1 -0
- package/dist/bootstrap/global-cli-options.d.ts +6 -0
- package/dist/bootstrap/global-cli-options.js +1 -0
- package/dist/bootstrap/native-devtools-stub.d.ts +10 -0
- package/dist/bootstrap/native-devtools-stub.js +1 -0
- package/dist/bootstrap/native-entry.d.ts +1 -0
- package/dist/bootstrap/native-entry.js +2 -0
- package/dist/bootstrap/native-tiktoken.d.ts +4 -0
- package/dist/bootstrap/native-tiktoken.js +1 -0
- package/dist/bootstrap/runtime-factory.d.ts +41 -0
- package/dist/bootstrap/runtime-factory.js +1 -0
- package/dist/bootstrap/shutdown-manager.d.ts +11 -0
- package/dist/bootstrap/shutdown-manager.js +1 -0
- package/dist/bootstrap/startup-sequence.d.ts +5 -0
- package/dist/bootstrap/startup-sequence.js +1 -0
- package/dist/domain/auth/auth-profile.d.ts +14 -0
- package/dist/domain/auth/auth-profile.js +1 -0
- package/dist/domain/config/config-schema.d.ts +24 -0
- package/dist/domain/config/config-schema.js +1 -0
- package/dist/domain/errors/cli-command-hint.d.ts +5 -0
- package/dist/domain/errors/cli-command-hint.js +0 -0
- package/dist/domain/errors/cli-error.d.ts +35 -0
- package/dist/domain/errors/cli-error.js +1 -0
- package/dist/domain/errors/error-codes.d.ts +51 -0
- package/dist/domain/errors/error-codes.js +1 -0
- package/dist/domain/extensions/extension-scope.d.ts +3 -0
- package/dist/domain/extensions/extension-scope.js +1 -0
- package/dist/domain/extensions/extension-state.d.ts +5 -0
- package/dist/domain/extensions/extension-state.js +1 -0
- package/dist/domain/extensions/hook-manifest.d.ts +13 -0
- package/dist/domain/extensions/hook-manifest.js +1 -0
- package/dist/domain/extensions/host-tool-plugin-ids.d.ts +9 -0
- package/dist/domain/extensions/host-tool-plugin-ids.js +1 -0
- package/dist/domain/extensions/mcp-config.d.ts +35 -0
- package/dist/domain/extensions/mcp-config.js +1 -0
- package/dist/domain/extensions/plugin-agent-manifest.d.ts +8 -0
- package/dist/domain/extensions/plugin-agent-manifest.js +1 -0
- package/dist/domain/extensions/plugin-manifest.d.ts +23 -0
- package/dist/domain/extensions/plugin-manifest.js +1 -0
- package/dist/domain/extensions/skill-manifest.d.ts +10 -0
- package/dist/domain/extensions/skill-manifest.js +3 -0
- package/dist/domain/extensions/yaml-subset.d.ts +9 -0
- package/dist/domain/extensions/yaml-subset.js +2 -0
- package/dist/domain/filesystem/file-change-diff.d.ts +21 -0
- package/dist/domain/filesystem/file-change-diff.js +3 -0
- package/dist/domain/intent/intent-contract.d.ts +41 -0
- package/dist/domain/intent/intent-contract.js +1 -0
- package/dist/domain/media/gateway-media-contract.d.ts +23 -0
- package/dist/domain/media/gateway-media-contract.js +1 -0
- package/dist/domain/media/media-contract.d.ts +28 -0
- package/dist/domain/media/media-contract.js +0 -0
- package/dist/domain/media/media-execution-policy.d.ts +9 -0
- package/dist/domain/media/media-execution-policy.js +1 -0
- package/dist/domain/memory/memory-kinds.d.ts +15 -0
- package/dist/domain/memory/memory-kinds.js +1 -0
- package/dist/domain/memory/memory-retrieval-policy.d.ts +3 -0
- package/dist/domain/memory/memory-retrieval-policy.js +1 -0
- package/dist/domain/memory/memory-search.d.ts +33 -0
- package/dist/domain/memory/memory-search.js +2 -0
- package/dist/domain/memory/memory.d.ts +48 -0
- package/dist/domain/memory/memory.js +1 -0
- package/dist/domain/orchestration/goal.d.ts +58 -0
- package/dist/domain/orchestration/goal.js +1 -0
- package/dist/domain/orchestration/subagent-identity.d.ts +2 -0
- package/dist/domain/orchestration/subagent-identity.js +1 -0
- package/dist/domain/orchestration/subagent.d.ts +33 -0
- package/dist/domain/orchestration/subagent.js +0 -0
- package/dist/domain/orchestration/work-plan.d.ts +77 -0
- package/dist/domain/orchestration/work-plan.js +1 -0
- package/dist/domain/project/project-identity.d.ts +6 -0
- package/dist/domain/project/project-identity.js +1 -0
- package/dist/domain/runtime/assistant-delta-normalizer.d.ts +11 -0
- package/dist/domain/runtime/assistant-delta-normalizer.js +1 -0
- package/dist/domain/runtime/resource-limits.d.ts +75 -0
- package/dist/domain/runtime/resource-limits.js +1 -0
- package/dist/domain/session/attachment.d.ts +13 -0
- package/dist/domain/session/attachment.js +0 -0
- package/dist/domain/session/session-schema.d.ts +6 -0
- package/dist/domain/session/session-schema.js +1 -0
- package/dist/domain/session/session.d.ts +27 -0
- package/dist/domain/session/session.js +0 -0
- package/dist/domain/settings/settings-document.d.ts +8 -0
- package/dist/domain/settings/settings-document.js +1 -0
- package/dist/domain/validation/record-schema.d.ts +4 -0
- package/dist/domain/validation/record-schema.js +1 -0
- package/dist/domain/workspace/workspace-settings.d.ts +12 -0
- package/dist/domain/workspace/workspace-settings.js +1 -0
- package/dist/infrastructure/agent-sdk/agent-instance-factory.d.ts +22 -0
- package/dist/infrastructure/agent-sdk/agent-instance-factory.js +1 -0
- package/dist/infrastructure/agent-sdk/model-tool-name-mapper.d.ts +13 -0
- package/dist/infrastructure/agent-sdk/model-tool-name-mapper.js +1 -0
- package/dist/infrastructure/agent-sdk/tool-calling-completion-client.d.ts +4 -0
- package/dist/infrastructure/agent-sdk/tool-calling-completion-client.js +1 -0
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.d.ts +11 -0
- package/dist/infrastructure/agent-sdk/tool-calling-model-client.js +1 -0
- package/dist/infrastructure/cache/cache-policy.d.ts +7 -0
- package/dist/infrastructure/cache/cache-policy.js +1 -0
- package/dist/infrastructure/cache/file-cache-store.d.ts +17 -0
- package/dist/infrastructure/cache/file-cache-store.js +2 -0
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.d.ts +11 -0
- package/dist/infrastructure/clipboard/clipboard-adapter-factory.js +1 -0
- package/dist/infrastructure/clipboard/clipboard-policy.d.ts +8 -0
- package/dist/infrastructure/clipboard/clipboard-policy.js +1 -0
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.d.ts +10 -0
- package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.js +1 -0
- package/dist/infrastructure/clipboard/image-normalizer.d.ts +12 -0
- package/dist/infrastructure/clipboard/image-normalizer.js +1 -0
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.d.ts +7 -0
- package/dist/infrastructure/clipboard/windows-clipboard-adapter.js +1 -0
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.d.ts +7 -0
- package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.js +1 -0
- package/dist/infrastructure/config/config-loader.d.ts +19 -0
- package/dist/infrastructure/config/config-loader.js +2 -0
- package/dist/infrastructure/config/environment-values.d.ts +2 -0
- package/dist/infrastructure/config/environment-values.js +1 -0
- package/dist/infrastructure/credentials/composite-credential-store.d.ts +11 -0
- package/dist/infrastructure/credentials/composite-credential-store.js +1 -0
- package/dist/infrastructure/credentials/encrypted-file-credential-store.d.ts +17 -0
- package/dist/infrastructure/credentials/encrypted-file-credential-store.js +3 -0
- package/dist/infrastructure/credentials/environment-credential-store.d.ts +11 -0
- package/dist/infrastructure/credentials/environment-credential-store.js +1 -0
- package/dist/infrastructure/credentials/secret-input.d.ts +7 -0
- package/dist/infrastructure/credentials/secret-input.js +3 -0
- package/dist/infrastructure/extensions/composite-mcp-config-store.d.ts +9 -0
- package/dist/infrastructure/extensions/composite-mcp-config-store.js +1 -0
- package/dist/infrastructure/extensions/extension-directory-reader.d.ts +2 -0
- package/dist/infrastructure/extensions/extension-directory-reader.js +1 -0
- package/dist/infrastructure/extensions/extension-integrity.d.ts +7 -0
- package/dist/infrastructure/extensions/extension-integrity.js +1 -0
- package/dist/infrastructure/extensions/extension-source-resolver.d.ts +6 -0
- package/dist/infrastructure/extensions/extension-source-resolver.js +1 -0
- package/dist/infrastructure/extensions/file-mcp-config-store.d.ts +15 -0
- package/dist/infrastructure/extensions/file-mcp-config-store.js +2 -0
- package/dist/infrastructure/extensions/hook-runtime.d.ts +18 -0
- package/dist/infrastructure/extensions/hook-runtime.js +1 -0
- package/dist/infrastructure/extensions/mcp-runtime.d.ts +51 -0
- package/dist/infrastructure/extensions/mcp-runtime.js +1 -0
- package/dist/infrastructure/extensions/plugin-agent-discovery.d.ts +4 -0
- package/dist/infrastructure/extensions/plugin-agent-discovery.js +1 -0
- package/dist/infrastructure/extensions/plugin-discovery.d.ts +5 -0
- package/dist/infrastructure/extensions/plugin-discovery.js +1 -0
- package/dist/infrastructure/extensions/plugin-manager.d.ts +23 -0
- package/dist/infrastructure/extensions/plugin-manager.js +2 -0
- package/dist/infrastructure/extensions/skill-discovery.d.ts +4 -0
- package/dist/infrastructure/extensions/skill-discovery.js +1 -0
- package/dist/infrastructure/extensions/skill-installer.d.ts +9 -0
- package/dist/infrastructure/extensions/skill-installer.js +1 -0
- package/dist/infrastructure/extensions/skill-manager.d.ts +22 -0
- package/dist/infrastructure/extensions/skill-manager.js +2 -0
- package/dist/infrastructure/extensions/skill-roots.d.ts +19 -0
- package/dist/infrastructure/extensions/skill-roots.js +1 -0
- package/dist/infrastructure/extensions/skill-tool-executor.d.ts +18 -0
- package/dist/infrastructure/extensions/skill-tool-executor.js +2 -0
- package/dist/infrastructure/filesystem/atomic-file-store.d.ts +17 -0
- package/dist/infrastructure/filesystem/atomic-file-store.js +1 -0
- package/dist/infrastructure/filesystem/bounded-file-reader.d.ts +6 -0
- package/dist/infrastructure/filesystem/bounded-file-reader.js +1 -0
- package/dist/infrastructure/filesystem/bounded-json-reader.d.ts +1 -0
- package/dist/infrastructure/filesystem/bounded-json-reader.js +1 -0
- package/dist/infrastructure/filesystem/fs-errors.d.ts +2 -0
- package/dist/infrastructure/filesystem/fs-errors.js +1 -0
- package/dist/infrastructure/filesystem/gateway-media-input-reader.d.ts +12 -0
- package/dist/infrastructure/filesystem/gateway-media-input-reader.js +1 -0
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.d.ts +22 -0
- package/dist/infrastructure/filesystem/local-filesystem-tool-executor.js +3 -0
- package/dist/infrastructure/filesystem/path-resolver.d.ts +20 -0
- package/dist/infrastructure/filesystem/path-resolver.js +1 -0
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.d.ts +13 -0
- package/dist/infrastructure/filesystem/workspace-media-artifact-store.js +1 -0
- package/dist/infrastructure/logging/daily-rotating-file-writer.d.ts +26 -0
- package/dist/infrastructure/logging/daily-rotating-file-writer.js +2 -0
- package/dist/infrastructure/logging/log-redactor.d.ts +2 -0
- package/dist/infrastructure/logging/log-redactor.js +1 -0
- package/dist/infrastructure/logging/logging-policy.d.ts +6 -0
- package/dist/infrastructure/logging/logging-policy.js +1 -0
- package/dist/infrastructure/logging/structured-logger.d.ts +24 -0
- package/dist/infrastructure/logging/structured-logger.js +4 -0
- package/dist/infrastructure/memory/file-memory-store.d.ts +37 -0
- package/dist/infrastructure/memory/file-memory-store.js +11 -0
- package/dist/infrastructure/network/safe-media-downloader.d.ts +23 -0
- package/dist/infrastructure/network/safe-media-downloader.js +1 -0
- package/dist/infrastructure/platform/host-platform.d.ts +14 -0
- package/dist/infrastructure/platform/host-platform.js +1 -0
- package/dist/infrastructure/platform/host-process.d.ts +29 -0
- package/dist/infrastructure/platform/host-process.js +1 -0
- package/dist/infrastructure/platform/platform-paths.d.ts +25 -0
- package/dist/infrastructure/platform/platform-paths.js +1 -0
- package/dist/infrastructure/platform/process-termination.d.ts +4 -0
- package/dist/infrastructure/platform/process-termination.js +1 -0
- package/dist/infrastructure/platform/read-only-executable.d.ts +3 -0
- package/dist/infrastructure/platform/read-only-executable.js +1 -0
- package/dist/infrastructure/project/file-project-trust-store.d.ts +12 -0
- package/dist/infrastructure/project/file-project-trust-store.js +2 -0
- package/dist/infrastructure/sdk/chat-completion-adapter.d.ts +8 -0
- package/dist/infrastructure/sdk/chat-completion-adapter.js +1 -0
- package/dist/infrastructure/sdk/lotagate-client-factory.d.ts +3 -0
- package/dist/infrastructure/sdk/lotagate-client-factory.js +1 -0
- package/dist/infrastructure/sdk/model-catalog-adapter.d.ts +19 -0
- package/dist/infrastructure/sdk/model-catalog-adapter.js +1 -0
- package/dist/infrastructure/sdk/sdk-media-gateway-client.d.ts +20 -0
- package/dist/infrastructure/sdk/sdk-media-gateway-client.js +1 -0
- package/dist/infrastructure/sessions/file-goal-store.d.ts +21 -0
- package/dist/infrastructure/sessions/file-goal-store.js +1 -0
- package/dist/infrastructure/sessions/file-session-store.d.ts +47 -0
- package/dist/infrastructure/sessions/file-session-store.js +4 -0
- package/dist/infrastructure/sessions/project-session-paths.d.ts +17 -0
- package/dist/infrastructure/sessions/project-session-paths.js +1 -0
- package/dist/infrastructure/sessions/session-index.d.ts +16 -0
- package/dist/infrastructure/sessions/session-index.js +3 -0
- package/dist/infrastructure/sessions/session-journal.d.ts +22 -0
- package/dist/infrastructure/sessions/session-journal.js +6 -0
- package/dist/infrastructure/sessions/subagent-journal-store.d.ts +28 -0
- package/dist/infrastructure/sessions/subagent-journal-store.js +2 -0
- package/dist/infrastructure/shell/shell-tool-executor.d.ts +17 -0
- package/dist/infrastructure/shell/shell-tool-executor.js +2 -0
- package/dist/infrastructure/tokens/tiktoken-token-estimator.d.ts +18 -0
- package/dist/infrastructure/tokens/tiktoken-token-estimator.js +1 -0
- package/dist/infrastructure/workspace/workspace-settings-store.d.ts +9 -0
- package/dist/infrastructure/workspace/workspace-settings-store.js +4 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.js +3 -0
- package/dist/ports/cache-store.d.ts +10 -0
- package/dist/ports/cache-store.js +0 -0
- package/dist/ports/chat-model.d.ts +30 -0
- package/dist/ports/chat-model.js +0 -0
- package/dist/ports/clipboard-adapter.d.ts +7 -0
- package/dist/ports/clipboard-adapter.js +0 -0
- package/dist/ports/clipboard-text-adapter.d.ts +3 -0
- package/dist/ports/clipboard-text-adapter.js +0 -0
- package/dist/ports/credential-store.d.ts +7 -0
- package/dist/ports/credential-store.js +0 -0
- package/dist/ports/goal-store.d.ts +12 -0
- package/dist/ports/goal-store.js +0 -0
- package/dist/ports/logger.d.ts +8 -0
- package/dist/ports/logger.js +0 -0
- package/dist/ports/media-gateway-client.d.ts +54 -0
- package/dist/ports/media-gateway-client.js +0 -0
- package/dist/ports/memory-store.d.ts +26 -0
- package/dist/ports/memory-store.js +0 -0
- package/dist/ports/model-completion-client.d.ts +8 -0
- package/dist/ports/model-completion-client.js +0 -0
- package/dist/ports/model-diagnostics.d.ts +17 -0
- package/dist/ports/model-diagnostics.js +0 -0
- package/dist/ports/project-trust-store.d.ts +12 -0
- package/dist/ports/project-trust-store.js +0 -0
- package/dist/ports/session-store.d.ts +58 -0
- package/dist/ports/session-store.js +0 -0
- package/dist/ports/subagent-lifecycle.d.ts +31 -0
- package/dist/ports/subagent-lifecycle.js +0 -0
- package/dist/ports/tool-activity.d.ts +13 -0
- package/dist/ports/tool-activity.js +0 -0
- package/dist/presentation/themes/theme.d.ts +19 -0
- package/dist/presentation/themes/theme.js +1 -0
- package/dist/presentation/tui/agent-initialization-renderer.d.ts +4 -0
- package/dist/presentation/tui/agent-initialization-renderer.js +1 -0
- package/dist/presentation/tui/context-display.d.ts +21 -0
- package/dist/presentation/tui/context-display.js +2 -0
- package/dist/presentation/tui/formatters.d.ts +6 -0
- package/dist/presentation/tui/formatters.js +1 -0
- package/dist/presentation/tui/ink/choice-window.d.ts +5 -0
- package/dist/presentation/tui/ink/choice-window.js +1 -0
- package/dist/presentation/tui/ink/components/activity-animation.d.ts +3 -0
- package/dist/presentation/tui/ink/components/activity-animation.js +1 -0
- package/dist/presentation/tui/ink/components/activity-entry.d.ts +6 -0
- package/dist/presentation/tui/ink/components/activity-entry.js +1 -0
- package/dist/presentation/tui/ink/components/activity-status.d.ts +10 -0
- package/dist/presentation/tui/ink/components/activity-status.js +1 -0
- package/dist/presentation/tui/ink/components/choice-modal.d.ts +11 -0
- package/dist/presentation/tui/ink/components/choice-modal.js +1 -0
- package/dist/presentation/tui/ink/components/composer.d.ts +40 -0
- package/dist/presentation/tui/ink/components/composer.js +8 -0
- package/dist/presentation/tui/ink/components/file-diff.d.ts +6 -0
- package/dist/presentation/tui/ink/components/file-diff.js +1 -0
- package/dist/presentation/tui/ink/components/modal.d.ts +8 -0
- package/dist/presentation/tui/ink/components/modal.js +2 -0
- package/dist/presentation/tui/ink/components/shimmer-text.d.ts +8 -0
- package/dist/presentation/tui/ink/components/shimmer-text.js +1 -0
- package/dist/presentation/tui/ink/components/subagent-activity.d.ts +11 -0
- package/dist/presentation/tui/ink/components/subagent-activity.js +1 -0
- package/dist/presentation/tui/ink/components/transcript.d.ts +39 -0
- package/dist/presentation/tui/ink/components/transcript.js +5 -0
- package/dist/presentation/tui/ink/components/welcome-panel.d.ts +6 -0
- package/dist/presentation/tui/ink/components/welcome-panel.js +1 -0
- package/dist/presentation/tui/ink/lotagate-tui.d.ts +6 -0
- package/dist/presentation/tui/ink/lotagate-tui.js +2 -0
- package/dist/presentation/tui/ink/markdown-inline-renderer.d.ts +4 -0
- package/dist/presentation/tui/ink/markdown-inline-renderer.js +1 -0
- package/dist/presentation/tui/ink/markdown-inline.d.ts +13 -0
- package/dist/presentation/tui/ink/markdown-inline.js +1 -0
- package/dist/presentation/tui/ink/markdown-message.d.ts +6 -0
- package/dist/presentation/tui/ink/markdown-message.js +2 -0
- package/dist/presentation/tui/ink/markdown-table.d.ts +16 -0
- package/dist/presentation/tui/ink/markdown-table.js +1 -0
- package/dist/presentation/tui/ink/tui-bridge.d.ts +193 -0
- package/dist/presentation/tui/ink/tui-bridge.js +1 -0
- package/dist/presentation/tui/terminal-capabilities.d.ts +15 -0
- package/dist/presentation/tui/terminal-capabilities.js +1 -0
- package/dist/presentation/tui/terminal-mouse.d.ts +5 -0
- package/dist/presentation/tui/terminal-mouse.js +1 -0
- package/dist/presentation/tui/terminal-screen.d.ts +10 -0
- package/dist/presentation/tui/terminal-screen.js +1 -0
- package/dist/presentation/tui/tui-agent-event-runner.d.ts +29 -0
- package/dist/presentation/tui/tui-agent-event-runner.js +1 -0
- package/dist/presentation/tui/tui-application-contract.d.ts +10 -0
- package/dist/presentation/tui/tui-application-contract.js +1 -0
- package/dist/presentation/tui/tui-application.d.ts +64 -0
- package/dist/presentation/tui/tui-application.js +3 -0
- package/dist/presentation/tui/tui-clipboard-paste-handlers.d.ts +11 -0
- package/dist/presentation/tui/tui-clipboard-paste-handlers.js +1 -0
- package/dist/presentation/tui/tui-command-context.d.ts +3 -0
- package/dist/presentation/tui/tui-command-context.js +0 -0
- package/dist/presentation/tui/tui-command-executor.d.ts +38 -0
- package/dist/presentation/tui/tui-command-executor.js +4 -0
- package/dist/presentation/tui/tui-command-host-factory.d.ts +40 -0
- package/dist/presentation/tui/tui-command-host-factory.js +1 -0
- package/dist/presentation/tui/tui-context-compaction.d.ts +5 -0
- package/dist/presentation/tui/tui-context-compaction.js +1 -0
- package/dist/presentation/tui/tui-context-service.d.ts +34 -0
- package/dist/presentation/tui/tui-context-service.js +2 -0
- package/dist/presentation/tui/tui-extension-loader.d.ts +21 -0
- package/dist/presentation/tui/tui-extension-loader.js +1 -0
- package/dist/presentation/tui/tui-file-suggestions.d.ts +3 -0
- package/dist/presentation/tui/tui-file-suggestions.js +1 -0
- package/dist/presentation/tui/tui-goal-controller.d.ts +14 -0
- package/dist/presentation/tui/tui-goal-controller.js +1 -0
- package/dist/presentation/tui/tui-initial-model.d.ts +3 -0
- package/dist/presentation/tui/tui-initial-model.js +1 -0
- package/dist/presentation/tui/tui-lifecycle-actions.d.ts +13 -0
- package/dist/presentation/tui/tui-lifecycle-actions.js +1 -0
- package/dist/presentation/tui/tui-manual-compaction.d.ts +18 -0
- package/dist/presentation/tui/tui-manual-compaction.js +1 -0
- package/dist/presentation/tui/tui-media-model-selection.d.ts +12 -0
- package/dist/presentation/tui/tui-media-model-selection.js +1 -0
- package/dist/presentation/tui/tui-prompt-dispatcher.d.ts +16 -0
- package/dist/presentation/tui/tui-prompt-dispatcher.js +1 -0
- package/dist/presentation/tui/tui-skill-controller.d.ts +11 -0
- package/dist/presentation/tui/tui-skill-controller.js +3 -0
- package/dist/presentation/tui/tui-tool-approval.d.ts +22 -0
- package/dist/presentation/tui/tui-tool-approval.js +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +1 -0
- package/package.json +12 -10
- package/skills/architecture-review/SKILL.md +41 -14
- package/skills/code-review/SKILL.md +41 -12
- package/skills/debugging/SKILL.md +49 -12
- package/skills/documentation/SKILL.md +43 -9
- package/skills/feature-implementation/SKILL.md +58 -19
- package/skills/api-contract-review/SKILL.md +0 -17
- package/skills/database-review/SKILL.md +0 -17
- package/skills/dependency-review/SKILL.md +0 -16
- package/skills/frontend-review/SKILL.md +0 -18
- package/skills/incident-response/SKILL.md +0 -18
- package/skills/performance-review/SKILL.md +0 -17
- package/skills/refactor/SKILL.md +0 -23
- package/skills/release-readiness/SKILL.md +0 -16
- package/skills/security-review/SKILL.md +0 -16
- package/skills/test-plan/SKILL.md +0 -22
- package/skills/verify/SKILL.md +0 -13
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Attachment } from '../domain/session/attachment.js';
|
|
2
|
+
import type { SessionEvent, SessionMetadata, TranscriptEntry } from '../domain/session/session.js';
|
|
3
|
+
export interface SessionBundle {
|
|
4
|
+
metadata: SessionMetadata;
|
|
5
|
+
events: readonly SessionEvent[];
|
|
6
|
+
transcript: readonly TranscriptEntry[];
|
|
7
|
+
attachments: readonly {
|
|
8
|
+
attachment: Attachment;
|
|
9
|
+
dataBase64: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export interface SessionRepairResult {
|
|
13
|
+
eventsRemoved: number;
|
|
14
|
+
transcriptRemoved: number;
|
|
15
|
+
}
|
|
16
|
+
export interface AppendEventOptions {
|
|
17
|
+
/** The caller already owns the session lock for an atomic read/modify/write operation. */
|
|
18
|
+
locked?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface CompactSessionOptions {
|
|
21
|
+
turnId?: string;
|
|
22
|
+
}
|
|
23
|
+
/** A consistent transcript/event view derived from one journal snapshot. */
|
|
24
|
+
export interface SessionHistory {
|
|
25
|
+
events: readonly SessionEvent[];
|
|
26
|
+
transcript: readonly TranscriptEntry[];
|
|
27
|
+
}
|
|
28
|
+
/** Ordered durable records to append under one session lock. */
|
|
29
|
+
export type SessionJournalAppend = {
|
|
30
|
+
kind: 'event';
|
|
31
|
+
event: SessionEvent;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'transcript';
|
|
34
|
+
entry: TranscriptEntry;
|
|
35
|
+
};
|
|
36
|
+
export interface SessionStore {
|
|
37
|
+
create(input: Omit<SessionMetadata, 'id' | 'createdAt' | 'updatedAt'>): Promise<SessionMetadata>;
|
|
38
|
+
get(sessionId: string): Promise<SessionMetadata | undefined>;
|
|
39
|
+
list(projectFingerprint?: string): Promise<readonly SessionMetadata[]>;
|
|
40
|
+
updateStatus(sessionId: string, status: SessionMetadata['status']): Promise<SessionMetadata>;
|
|
41
|
+
rename(sessionId: string, name: string): Promise<SessionMetadata>;
|
|
42
|
+
appendEvent(event: SessionEvent, options?: AppendEventOptions): Promise<void>;
|
|
43
|
+
appendTranscript(sessionId: string, entry: TranscriptEntry): Promise<void>;
|
|
44
|
+
appendJournal(sessionId: string, records: readonly SessionJournalAppend[]): Promise<void>;
|
|
45
|
+
readEvents(sessionId: string): Promise<readonly SessionEvent[]>;
|
|
46
|
+
readTranscript(sessionId: string): Promise<readonly TranscriptEntry[]>;
|
|
47
|
+
readHistory(sessionId: string): Promise<SessionHistory>;
|
|
48
|
+
delete(sessionId: string): Promise<boolean>;
|
|
49
|
+
fork(sessionId: string, overrides?: Partial<Pick<SessionMetadata, 'model' | 'profile'>>): Promise<SessionMetadata>;
|
|
50
|
+
compact(sessionId: string, summary: string, options?: CompactSessionOptions): Promise<void>;
|
|
51
|
+
export(sessionId: string): Promise<SessionBundle>;
|
|
52
|
+
import(bundle: SessionBundle, projectFingerprint: string, cwd: string): Promise<SessionMetadata>;
|
|
53
|
+
saveAttachment(sessionId: string, attachment: Attachment, bytes: Uint8Array): Promise<Attachment>;
|
|
54
|
+
readAttachment(sessionId: string, attachmentId: string): Promise<Uint8Array | undefined>;
|
|
55
|
+
recoverStaleLock(sessionId: string): Promise<boolean>;
|
|
56
|
+
repair(sessionId: string): Promise<SessionRepairResult>;
|
|
57
|
+
withLock<T>(sessionId: string, action: () => Promise<T>): Promise<T>;
|
|
58
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { SubagentHandoff, SubagentMode, SubagentStatus } from '../domain/orchestration/subagent.js';
|
|
2
|
+
export type SubagentLifecycleEventType = 'created' | 'started' | 'activity' | 'completed' | 'completed_with_warning' | 'failed' | 'cancelled';
|
|
3
|
+
export type SubagentActionKind = 'filesystem' | 'shell' | 'mcp' | 'approval';
|
|
4
|
+
/** A redacted, presentation-safe description of the child's current operation. */
|
|
5
|
+
export interface SubagentLastAction {
|
|
6
|
+
readonly kind: SubagentActionKind;
|
|
7
|
+
readonly label: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* CLI-owned lifecycle signal for presenting delegated work without coupling
|
|
11
|
+
* orchestration to a specific user interface.
|
|
12
|
+
*/
|
|
13
|
+
export interface SubagentLifecycleEvent {
|
|
14
|
+
readonly type: SubagentLifecycleEventType;
|
|
15
|
+
readonly sessionId: string;
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly displayName: string;
|
|
18
|
+
readonly task: string;
|
|
19
|
+
readonly mode: SubagentMode;
|
|
20
|
+
readonly model: string;
|
|
21
|
+
readonly status: SubagentStatus;
|
|
22
|
+
readonly background: boolean;
|
|
23
|
+
readonly timestamp: number;
|
|
24
|
+
readonly durationMs?: number;
|
|
25
|
+
readonly summary?: string;
|
|
26
|
+
readonly lastAction?: SubagentLastAction;
|
|
27
|
+
readonly handoff?: SubagentHandoff;
|
|
28
|
+
}
|
|
29
|
+
export interface SubagentLifecycleObserver {
|
|
30
|
+
onSubagentLifecycle(event: SubagentLifecycleEvent): void | Promise<void>;
|
|
31
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ToolActivityStart {
|
|
2
|
+
key: string;
|
|
3
|
+
toolName: string;
|
|
4
|
+
source?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ToolActivityHandle {
|
|
8
|
+
complete(isError: boolean, metadata?: Readonly<Record<string, unknown>>): void;
|
|
9
|
+
}
|
|
10
|
+
/** Observes tool execution without making UI concerns part of tool executors. */
|
|
11
|
+
export interface ToolActivityObserver {
|
|
12
|
+
start(activity: ToolActivityStart): ToolActivityHandle | undefined;
|
|
13
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CliTheme {
|
|
2
|
+
background: string;
|
|
3
|
+
surface: string;
|
|
4
|
+
surfaceRaised: string;
|
|
5
|
+
text: string;
|
|
6
|
+
muted: string;
|
|
7
|
+
accent: string;
|
|
8
|
+
border: string;
|
|
9
|
+
selection: string;
|
|
10
|
+
warning: string;
|
|
11
|
+
user: string;
|
|
12
|
+
error: string;
|
|
13
|
+
success: string;
|
|
14
|
+
diffAdded: string;
|
|
15
|
+
diffRemoved: string;
|
|
16
|
+
code: string;
|
|
17
|
+
link: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const DARK_THEME: CliTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={background:"#10151c",surface:"#171e27",surfaceRaised:"#202a36",text:"#e6edf3",accent:"#5ba7d8",border:"#3b424b",selection:"#2a3a4d",warning:"#d6b574",user:"#1b2b3d",error:"#e06c75",success:"#86c991",diffAdded:"#173323",diffRemoved:"#3a2028",code:"#d6b574",link:"#75b7e7",muted:"#8b949e"};export{e as DARK_THEME};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentEvent } from '@lotagate/agent-sdk';
|
|
2
|
+
import type { InkTuiBridge } from './ink/tui-bridge.js';
|
|
3
|
+
/** Reports only actionable MCP initialization failures; routine connects stay out of the transcript. */
|
|
4
|
+
export declare function renderAgentInitialization(renderer: InkTuiBridge, events: readonly AgentEvent[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function c(t,s){const r=new Map;for(const e of s)if(e.type==="mcp.server.status"){const o=i(r,e.summary.serverId);o.status=e.summary.status,e.summary.protocolVersion!==void 0&&(o.protocolVersion=e.summary.protocolVersion)}else e.type==="mcp.tool.discovered"?i(r,e.tool.serverId).discovered+=1:e.type==="mcp.tool.catalog.updated"&&e.error!==void 0&&(i(r,e.serverId).discoveryError=e.error.message);for(const[e,o]of r){if(o.discoveryError===void 0&&(o.status===void 0||o.status==="connected"))continue;const n=[o.status==="connected"?void 0:o.status,...o.protocolVersion===void 0?[]:[`protocol ${o.protocolVersion}`],...o.discovered===0?[]:[`${o.discovered} tool${o.discovered===1?"":"s"} discovered`],...o.discoveryError===void 0?[]:[`tool discovery failed \xB7 ${o.discoveryError}`]].filter(d=>d!==void 0);t.initializationNotice(`mcp:${e}`,`MCP ${e}: ${n.join(" \xB7 ")||"initialized"}`)}}function i(t,s){const r=t.get(s);if(r!==void 0)return r;const e={discovered:0};return t.set(s,e),e}export{c as renderAgentInitialization};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TuiContextSnapshot {
|
|
2
|
+
model: string | null;
|
|
3
|
+
contextWindow?: number;
|
|
4
|
+
usedTokens: number;
|
|
5
|
+
systemPromptTokens: number;
|
|
6
|
+
conversationTokens: number;
|
|
7
|
+
inputTokens?: number;
|
|
8
|
+
outputTokens?: number;
|
|
9
|
+
otherTokens?: number;
|
|
10
|
+
transcriptEntries: number;
|
|
11
|
+
userMessages: number;
|
|
12
|
+
assistantMessages: number;
|
|
13
|
+
toolCalls: number;
|
|
14
|
+
compactions: number;
|
|
15
|
+
pendingAttachments: number;
|
|
16
|
+
toolNames: readonly string[];
|
|
17
|
+
mcpServers: number;
|
|
18
|
+
memoryFiles: number;
|
|
19
|
+
}
|
|
20
|
+
/** Renders durable and estimated context information as a human-readable TUI report. */
|
|
21
|
+
export declare function formatContextSnapshot(snapshot: TuiContextSnapshot): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{formatCompactNumber as t}from"./formatters.js";function d(e){const o=e.contextWindow===void 0?"?":t(e.contextWindow),n=e.contextWindow===void 0?void 0:Math.max(0,e.contextWindow-e.usedTokens),i=e.contextWindow===void 0||e.contextWindow<=0?"?":`${Math.round(e.usedTokens/e.contextWindow*100)}%`;return["Context Usage",`Model ${e.model??"not selected"}`,`Context ${t(e.usedTokens)}/${o} tokens (${i})`,`System ${t(e.systemPromptTokens)} tokens`,`Conversation ${t(e.conversationTokens)} tokens`,...e.inputTokens===void 0?[]:[` Input ${t(e.inputTokens)} tokens`],...e.outputTokens===void 0?[]:[` Output ${t(e.outputTokens)} tokens`],...e.otherTokens===void 0?[]:[` Other ${t(e.otherTokens)} tokens`],`Free space ${n===void 0?"?":t(n)} tokens`,"",`Local tools ${e.toolNames.length}`,`MCP servers ${e.mcpServers}`,"MCP tools discovered when an agent run initializes the servers",`Memory files ${e.memoryFiles}`,`Messages ${e.transcriptEntries} (${e.userMessages} user \xB7 ${e.assistantMessages} assistant)`,`Tool calls ${e.toolCalls}`,`Compactions ${e.compactions}`,`Attachments ${e.pendingAttachments}`,"","Token counts are estimated from persisted conversation context and the current system guidance; provider usage may differ."].join(`
|
|
2
|
+
`)}export{d as formatContextSnapshot};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { formatCompactNumber } from '../../application/formatting/compact-number.js';
|
|
2
|
+
/** Estimates terminal column width without relying on a transitive dependency. */
|
|
3
|
+
export declare function terminalTextWidth(value: string): number;
|
|
4
|
+
export declare function wrapTerminalText(value: string, width: number): string[];
|
|
5
|
+
export declare function truncateTerminalText(value: string, width: number, suffix?: string): string;
|
|
6
|
+
export declare function formatContextUsage(usedTokens: number, contextWindow?: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{formatCompactNumber as n}from"../../application/formatting/compact-number.js";import{formatCompactNumber as g}from"../../application/formatting/compact-number.js";function m(r){let t=0;for(const x of r){const f=x.codePointAt(0)??0;h(f)||(t+=p(f)?2:1)}return t}function u(r,t){if(r.length===0)return[""];const x=[];let f="";for(const a of Array.from(r)){const e=`${f}${a}`;f.length>0&&m(e)>Math.max(1,t)?(x.push(f),f=a):f=e}return f.length>0&&x.push(f),x}function i(r,t,x="\u2026"){const f=Math.max(0,Math.floor(t));if(m(r)<=f)return r;if(f===0)return"";const a=m(x);return a>=f?Array.from(x).slice(0,f).join(""):`${u(r,f-a)[0]??""}${x}`}function l(r,t){return t===void 0?`${n(r)}/?`:`${n(r)}/${n(t)}`}function h(r){return r>=768&&r<=879||r===8205||r>=65024&&r<=65039}function p(r){return r>=4352&&(r<=4447||r===9001||r===9002||r>=11904&&r<=42191||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65135||r>=65280&&r<=65376||r>=65504&&r<=65510||r>=127744&&r<=129791)}export{g as formatCompactNumber,l as formatContextUsage,m as terminalTextWidth,i as truncateTerminalText,u as wrapTerminalText};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function h(n,e,o){const t=Math.max(1,o),a=Math.max(0,Math.min(e-Math.floor(t/2),Math.max(0,n.length-t)));return{start:a,entries:n.slice(a,a+t)}}export{h as choiceWindow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const I=120,t=["\u25D0","\u25D3","\u25D1","\u25D2"];function e(n){return t[n%t.length]??t[0]}export{I as ACTIVITY_ANIMATION_INTERVAL_MS,t as ACTIVITY_SPINNER_FRAMES,e as activitySpinnerFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as m,jsx as d}from"react/jsx-runtime";import{Box as $,Text as l,useAnimation as A,useStdout as g}from"ink";import{DARK_THEME as n}from"../../../themes/theme.js";import{terminalTextWidth as i,truncateTerminalText as h}from"../../formatters.js";import{ShimmerText as M}from"./shimmer-text.js";import{ACTIVITY_ANIMATION_INTERVAL_MS as _,activitySpinnerFrame as b}from"./activity-animation.js";function L({activity:e,showDetails:u=!1}){const{stdout:f}=g(),o=e.state==="pending",t=e.state==="running",a=A({interval:_,isActive:t}),p=t?Math.max(e.elapsedMs??0,Date.now()-e.startedAt):e.elapsedMs??0,r=o?"\u25CC":t?b(a.frame):e.state==="failed"?"!":"\u2713",c=`${o?"Run":t?"Running":e.state==="failed"?"Command failed":"Ran"} ${e.label.replace(/\s+/gu," ").trim()}`,s=` \xB7 ${I(p)}${u&&e.toolName!==void 0?` \xB7 ${e.toolName}${e.kind===void 0?"":` \xB7 ${e.kind}`}`:""}`,x=Math.max(1,(f.columns??80)-2-i(`${r} `)-i(s)),T=h(c,x,"....");return m($,{marginBottom:1,children:[m(l,{color:e.state==="failed"?n.error:t||o?n.warning:n.muted,children:[r," "]}),d(M,{value:T,active:t,frame:a.frame,color:t?n.warning:n.text}),d(l,{color:n.muted,children:s})]})}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}export{L as ActivityEntry};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { ChatUsage } from '../../../../ports/chat-model.js';
|
|
3
|
+
export interface ActivityStatusProps {
|
|
4
|
+
status: string;
|
|
5
|
+
activityStartedAt?: number;
|
|
6
|
+
elapsedMs?: number;
|
|
7
|
+
usage?: ChatUsage;
|
|
8
|
+
paused?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function ActivityStatus({ status, activityStartedAt, elapsedMs, usage, paused }: ActivityStatusProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as i,jsx as x}from"react/jsx-runtime";import{Box as T,Text as l,useAnimation as h}from"ink";import{DARK_THEME as t}from"../../../themes/theme.js";import{ShimmerText as A}from"./shimmer-text.js";import{ACTIVITY_ANIMATION_INTERVAL_MS as v,activitySpinnerFrame as _}from"./activity-animation.js";function $({status:o,activityStartedAt:c,elapsedMs:a,usage:n,paused:m=!1}){const e=o!=="Done"&&o!=="Cancelled"&&o!=="Failed",s=h({interval:v,isActive:e&&!m}),p=e&&c!==void 0?Math.max(a??0,Date.now()-c):a??0,r=[j(p)],f=n?.completionTokens??n?.totalTokens;f!==void 0&&r.push(`${n?.estimated===!0?"~":""}${f} output tokens`),e&&r.push("Esc cancel");const u=e?_(s.frame):"\u25CF",d=o==="Failed"?t.error:e?t.warning:t.success;return i(T,{marginBottom:1,children:[i(l,{color:d,children:[u," "]}),x(A,{value:o,active:e&&!m,frame:s.frame}),i(l,{color:t.muted,children:[" ",r.join(" \xB7 ")]})]})}function j(o){return o<1e3?`${o}ms`:`${(o/1e3).toFixed(1)}s`}export{$ as ActivityStatus};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { InkTuiBridge, TuiChoice } from '../tui-bridge.js';
|
|
3
|
+
export interface ChoiceModalProps {
|
|
4
|
+
bridge: InkTuiBridge;
|
|
5
|
+
title: string;
|
|
6
|
+
choices: readonly TuiChoice[];
|
|
7
|
+
currentValue?: string;
|
|
8
|
+
detail?: string;
|
|
9
|
+
borderColor?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function ChoiceModal({ bridge, title, choices, currentValue, detail, borderColor }: ChoiceModalProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a,jsxs as s}from"react/jsx-runtime";import{useState as M}from"react";import{Box as v,Text as r,useInput as A}from"ink";import{DARK_THEME as t}from"../../../themes/theme.js";import{choiceWindow as C}from"../choice-window.js";function b({bridge:i,title:x,choices:l,currentValue:p,detail:u,borderColor:w=t.accent}){const h=l.findIndex(e=>e.value===p),[c,m]=M(Math.max(0,h)),f=C(l,c,8);return A((e,n)=>{n.upArrow?m(o=>Math.max(0,o-1)):n.downArrow?m(o=>Math.min(Math.max(0,l.length-1),o+1)):n.return?i.resolveActiveModal(l[c]?.value):e.toLowerCase()==="y"&&l.some(o=>o.value==="allow")?i.resolveActiveModal("allow"):e.toLowerCase()==="n"&&l.some(o=>o.value==="deny")?i.resolveActiveModal("deny"):(n.escape||e==="q")&&i.resolveActiveModal(void 0)}),s(v,{borderStyle:"double",borderColor:w,flexDirection:"column",marginTop:1,paddingX:1,children:[a(r,{bold:!0,color:t.text,children:"Action required"}),a(r,{color:t.text,children:x}),u!==void 0&&a(r,{color:t.muted,children:u}),f.entries.map((e,n)=>{const o=f.start+n===c,d=o?{backgroundColor:t.selection}:{};return s(v,{width:"100%",alignSelf:"stretch",flexDirection:"row",...d,children:[a(r,{color:o?t.accent:t.muted,...d,children:"\u203A "}),a(r,{color:t.text,...d,children:e.label}),e.description!==void 0&&s(r,{color:t.muted,...d,children:[" ",e.description]})]},e.value)}),a(r,{color:t.muted,children:"\u2191\u2193 navigate \xB7 Enter select \xB7 Esc cancel"})]})}export{b as ChoiceModal};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { Attachment } from '../../../../domain/session/attachment.js';
|
|
3
|
+
import type { InkTuiBridge, TuiChoice } from '../tui-bridge.js';
|
|
4
|
+
export interface ComposerCursorPosition {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
interface ComposerInputLayout {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
width: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function calculateComposerCursorPosition({ layout, value, cursor, terminalRows }: {
|
|
14
|
+
layout: ComposerInputLayout;
|
|
15
|
+
value: string;
|
|
16
|
+
cursor: number;
|
|
17
|
+
terminalRows?: number;
|
|
18
|
+
}): ComposerCursorPosition | undefined;
|
|
19
|
+
export declare function Composer({ bridge, enabled, activeRun, visible, clearBlockedUntil, footerNotice, contextUsage, attachments, fileChoices, onLayoutRowsChange }: {
|
|
20
|
+
bridge: InkTuiBridge;
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
activeRun: boolean;
|
|
23
|
+
visible?: boolean;
|
|
24
|
+
clearBlockedUntil?: number;
|
|
25
|
+
footerNotice?: string;
|
|
26
|
+
contextUsage?: {
|
|
27
|
+
usedTokens: number;
|
|
28
|
+
contextWindow?: number;
|
|
29
|
+
};
|
|
30
|
+
attachments: readonly Attachment[];
|
|
31
|
+
fileChoices: readonly TuiChoice[];
|
|
32
|
+
onLayoutRowsChange?: (rows: number) => void;
|
|
33
|
+
}): JSX.Element | null;
|
|
34
|
+
export interface AtFileReference {
|
|
35
|
+
start: number;
|
|
36
|
+
query: string;
|
|
37
|
+
}
|
|
38
|
+
/** Returns the active unquoted @workspace-file token immediately before the cursor. */
|
|
39
|
+
export declare function atFileReference(value: string, cursor: number): AtFileReference | undefined;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{jsx as s,jsxs as R}from"react/jsx-runtime";import{useEffect as le,useLayoutEffect as U,useRef as S,useState as P}from"react";import{Box as g,Text as d,measureElement as de,useCursor as ae,useInput as fe,usePaste as me,useStdout as he}from"ink";import{formatContextUsage as pe,terminalTextWidth as H}from"../../formatters.js";import{DARK_THEME as r}from"../../../themes/theme.js";import{AttachmentChip as Ce}from"./transcript.js";import{isMouseSequence as ge}from"../../terminal-mouse.js";import{commandSuggestions as we}from"../../../../application/commands/command-presentation.js";import{parseCommandInvocation as xe,tokenizeCommandInput as Me}from"../../../../application/commands/command-parser.js";import{COMMAND_REGISTRY as k}from"../../../../application/commands/command-runtime.js";const q=4;function Ae({layout:o,value:c,cursor:i,terminalRows:u}){const a=c.slice(0,i).split(`
|
|
2
|
+
`),f=Math.max(1,o.width-(q+2)),w=a.slice(0,-1).reduce((W,l)=>W+Math.max(1,Math.ceil(H(l)/f)),0),p=H(a.at(-1)??""),E=o.y+1+w+Math.floor(p/f);if(!(u!==void 0&&(E<0||E>=u)))return{x:o.x+q+p%f,y:E}}function _e({bridge:o,enabled:c,activeRun:i,visible:u=!0,clearBlockedUntil:a,footerNotice:f,contextUsage:w,attachments:p,fileChoices:E,onLayoutRowsChange:W}){const[l,ee]=P(""),[N,L]=P(0),[$,x]=P(0),[_,F]=P(),m=S(void 0),D=S(!1),M=S(""),C=S(0),X=S(void 0),O=S(null),[A,V]=P({left:0,top:0,width:0,hasMeasured:!1}),{setCursorPosition:te}=ae(),{stdout:G}=he(),b=l.startsWith("/")&&!l.includes(`
|
|
3
|
+
`)&&X.current!==l?we(l,k,"tui").slice(0,8):[],I=Se(l,N),Z=I===void 0?[]:E.filter(e=>e.value.slice(1).toLowerCase().includes(I.query.toLowerCase())).slice(0,8),h=b.length>0?b:Z,j=()=>{D.current=!1,F(void 0),m.current!==void 0&&clearTimeout(m.current),m.current=void 0},T=(e,t)=>{M.current=e,C.current=t,ee(e),L(t)},v=()=>{X.current=void 0},K=e=>{T(e.value,e.value.length),X.current=e.value,x(0)},B=e=>{const t=e.replace(/\r\n?/gu,`
|
|
4
|
+
`);if(t.length===0)return;j(),v();const n=M.current,z=C.current;T(`${n.slice(0,z)}${t}${n.slice(z)}`,z+t.length)},Y=e=>{if(I===void 0)return;v();const t=M.current;T(`${t.slice(0,I.start)}${e.value} ${t.slice(C.current)}`,I.start+e.value.length+1),x(0)},ne=()=>{const e=C.current;if(e===0)return;j(),v();const t=M.current;T(`${t.slice(0,e-1)}${t.slice(e)}`,e-1)},y=()=>{const e=M.current.trim();e.length>0&&(j(),v(),T("",0),x(0),o.submit(e))},re=()=>{j(),T("",0),x(0),o.clearAttachments()},oe=()=>{D.current=!0,F("Press Esc again to clear text and references."),m.current!==void 0&&clearTimeout(m.current),m.current=setTimeout(()=>{D.current=!1,F(void 0),m.current=void 0},1500)};fe((e,t)=>{if(c&&!ge(e)){if(t.escape||e==="\x1B"){if(i||a!==void 0&&a>Date.now()||l.length===0&&p.length===0)return;D.current?re():oe();return}if(t.meta&&e.toLowerCase()==="v"){o.pasteImage().catch(()=>{});return}if(t.ctrl&&e.toLowerCase()==="v"){o.pasteText().then(n=>{n!==void 0&&B(n)}).catch(()=>{});return}if(t.return&&t.shift){B(`
|
|
5
|
+
`);return}if(t.return){const n=h[$];if(b.length>0&&n!==void 0&&n.value!==l){K(n);return}if(Te(l)){y();return}n!==void 0&&Z.length>0?Y(n):y();return}if(t.tab&&h[$]!==void 0){const n=h[$];n!==void 0&&(b.length>0?K(n):Y(n));return}if(t.upArrow&&h.length>0){x(n=>Math.max(0,n-1));return}if(t.downArrow&&h.length>0){x(n=>Math.min(h.length-1,n+1));return}if(t.leftArrow){v();const n=Math.max(0,C.current-1);C.current=n,L(n);return}if(t.rightArrow){v();const n=Math.min(M.current.length,C.current+1);C.current=n,L(n);return}if(t.backspace||t.delete){ne();return}!t.ctrl&&!t.meta&&e.length>0&&B(e)}},{isActive:c}),me(e=>{c&&B(e)},{isActive:c}),le(()=>()=>{m.current!==void 0&&clearTimeout(m.current)},[]);const J=l.split(`
|
|
6
|
+
`),ie=A.hasMeasured?A.width:Math.max(40,G.columns??80),se=Math.max(1,ie-(q+2)),ue=J.reduce((e,t)=>e+Math.max(1,Math.ceil(H(t)/se)),0),Q=ve({attachmentCount:p.length,inputRows:ue,hasClearHint:_!==void 0,hasFooterNotice:f!==void 0,choiceCount:h.length});U(()=>{W?.(Q+1)},[Q,W]),U(()=>{const e=O.current;if(e===null){V(n=>n.hasMeasured?{left:0,top:0,width:0,hasMeasured:!1}:n);return}const t=de(e);V(n=>n.left===t.x&&n.top===t.y&&n.width===t.width&&n.hasMeasured?n:{left:t.x,top:t.y,width:t.width,hasMeasured:!0})});const ce=c&&u&&A.hasMeasured?Ae({layout:{x:A.left,y:A.top,width:A.width},value:l,cursor:N,terminalRows:G.rows}):void 0;return te(ce),u?R(g,{width:"100%",flexDirection:"column",marginTop:1,children:[p.map(e=>s(Ce,{attachment:e},e.id)),s(g,{ref:O,width:"100%",borderStyle:"round",borderColor:c?r.accent:r.border,flexDirection:"column",paddingX:1,children:R(g,{children:[s(d,{color:r.accent,children:"\u203A "}),s(d,{wrap:"wrap",color:l.length===0?r.muted:r.text,children:l.length===0?"Ask LotaGate to work on this project\u2026":Re(J.join(`
|
|
7
|
+
`))})]})}),R(g,{paddingX:1,justifyContent:"space-between",children:[s(d,{color:r.muted,dimColor:!0,children:"Enter send \xB7 Shift+Enter newline \xB7 / commands \xB7 @ files \xB7 Ctrl+V text \xB7 Alt+V image"}),w!==void 0&&s(d,{color:r.muted,dimColor:!0,children:pe(w.usedTokens,w.contextWindow)})]}),_!==void 0&&s(g,{paddingX:1,children:s(d,{color:r.muted,dimColor:!0,children:_})}),f!==void 0&&s(g,{paddingX:1,children:s(d,{color:r.muted,dimColor:!0,children:f})}),h.length>0&&s(g,{borderStyle:"round",borderColor:r.border,flexDirection:"column",paddingX:1,children:h.map((e,t)=>R(g,{...t===$?{backgroundColor:r.selection}:{},children:[s(d,{color:t===$?r.accent:r.muted,children:"\u203A "}),R(d,{color:e.kind==="directory"?r.warning:r.text,children:[e.kind==="directory"?"\u25B8 ":"",e.label]}),R(d,{color:r.muted,children:[" ",e.description]})]},e.value))})]}):null}function Te(o){if(!o.startsWith("/")||o.includes(`
|
|
8
|
+
`))return!1;try{return xe(Me(o.trimStart().slice(1)),"tui",k),!0}catch{return!1}}function ve({attachmentCount:o,inputRows:c,hasClearHint:i,hasFooterNotice:u,choiceCount:a}){const f=o*2,w=Math.max(1,c)+2,p=a>0?a+2:0;return f+w+1+(i?1:0)+(u?1:0)+p}function Re(o){return o.split(/(@[^\s@]+|https?:\/\/[^\s]+|\/[A-Za-z][\w-]*)/gu).filter(i=>i.length>0).map((i,u)=>i.startsWith("@")?s(d,{color:r.accent,children:i},u):/^https?:\/\//u.test(i)?s(d,{color:r.link,underline:!0,children:i},u):/^\/[A-Za-z][\w-]*$/u.test(i)?s(d,{color:r.accent,children:i},u):s(d,{children:i},u))}function Se(o,c){const i=o.slice(0,c),u=/(?:^|\s)@([^\s@]*)$/u.exec(i);if(u===null)return;const a=u[1]??"";return{start:c-a.length-1,query:a}}export{_e as Composer,Se as atFileReference,Ae as calculateComposerCursorPosition};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { FileChangeDiff } from '../../../../domain/filesystem/file-change-diff.js';
|
|
3
|
+
export declare function FileDiff({ change }: {
|
|
4
|
+
change: FileChangeDiff;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
export declare function fileDiffRowCount(change: FileChangeDiff, columns: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as d,jsxs as c,Fragment as w}from"react/jsx-runtime";import{Box as u,Text as e,useStdout as D}from"ink";import{DARK_THEME as o}from"../../../themes/theme.js";import{truncateTerminalText as L,wrapTerminalText as x}from"../../formatters.js";function j({change:t}){const{stdout:n}=D(),l=Math.max(20,(n.columns??80)-4),r=p(t.lines);return c(u,{flexDirection:"column",marginBottom:1,borderStyle:"round",borderColor:o.border,paddingX:1,children:[c(e,{color:o.text,children:[d(e,{color:o.accent,children:"\u25A3"})," ",d(e,{bold:!0,children:"Updated"})," ",d(e,{color:o.muted,children:L(t.path,Math.max(1,l-30))})," ",d(e,{color:o.muted,children:" \xB7 "}),c(e,{color:o.success,children:["+",t.additions]}),d(e,{color:o.muted,children:" "}),c(e,{color:o.error,children:["-",t.deletions]})]}),d(e,{color:o.muted,children:" Workspace change"}),d(u,{flexDirection:"column",marginTop:1,children:t.lines.map((i,a)=>d(M,{line:i,lineNumberWidth:r,textWidth:Math.max(1,l-(r*2+8))},`${a}-${i.kind}`))}),t.truncated&&d(e,{color:o.muted,children:" \u2026 diff truncated for display"})]})}function A(t,n){const l=Math.max(20,n-4),r=p(t.lines),i=Math.max(1,l-(r*2+8));return t.lines.reduce((m,s)=>m+x(s.text.length===0?" ":s.text,i).length,0)+3+(t.truncated?1:0)}function M({line:t,lineNumberWidth:n,textWidth:l}){const r=t.kind==="addition",i=t.kind==="deletion",a=r?o.success:i?o.error:o.text,m=r?o.diffAdded:i?o.diffRemoved:void 0,s=t.kind==="addition"?"+":t.kind==="deletion"?"-":" ",g=t.oldLine===void 0?" ".repeat(n):String(t.oldLine).padStart(n," "),b=t.newLine===void 0?" ".repeat(n):String(t.newLine).padStart(n," "),k=x(t.text.length===0?" ":t.text,l);return d(u,{flexDirection:"column",backgroundColor:m,paddingX:1,children:k.map((h,f)=>c(u,{flexDirection:"row",children:[f===0?c(w,{children:[c(e,{color:o.muted,children:[g," ",b," "]}),c(e,{color:a,bold:r||i,children:[s," "]})]}):c(e,{color:o.muted,children:[" ".repeat(n*2+3)," "]}),d(e,{color:a,bold:f===0&&(r||i),children:h})]},`${f}-${h}`))})}function p(t){const n=t.reduce((l,r)=>Math.max(l,r.oldLine??0,r.newLine??0),0);return Math.max(2,String(n).length)}export{j as FileDiff,A as fileDiffRowCount};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { InkTuiBridge, TuiModal } from '../tui-bridge.js';
|
|
3
|
+
export declare function Modal({ bridge, modal, onLayoutRowsChange }: {
|
|
4
|
+
bridge: InkTuiBridge;
|
|
5
|
+
modal?: TuiModal;
|
|
6
|
+
onLayoutRowsChange?: (rows: number) => void;
|
|
7
|
+
}): JSX.Element | null;
|
|
8
|
+
export declare function estimateModalRows(modal: TuiModal): number;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as n,jsxs as s}from"react/jsx-runtime";import{useLayoutEffect as g,useRef as b,useState as v}from"react";import{Box as d,Text as o,useBoxMetrics as x,useInput as h,usePaste as w}from"ink";import{DARK_THEME as l}from"../../../themes/theme.js";import{ChoiceModal as m}from"./choice-modal.js";function V({bridge:t,modal:e,onLayoutRowsChange:r}){const c=b(null),i=x(c);if(g(()=>{i.hasMeasured&&r?.(i.height)},[i.height,i.hasMeasured,r]),e===void 0)return null;const a=e.kind==="choice"?n(m,{bridge:t,title:e.title,choices:e.choices,...e.currentValue===void 0?{}:{currentValue:e.currentValue},...e.detail===void 0?{}:{detail:e.detail}}):e.kind==="secret"?n(k,{bridge:t,label:e.label}):e.kind==="approval"?n(A,{bridge:t,toolName:e.toolName,...e.detail===void 0?{}:{detail:e.detail}}):e.kind==="subagent"?n(M,{bridge:t,subagent:e.subagent}):n(D,{bridge:t});return n(d,{ref:c,width:"100%",flexDirection:"column",children:a})}function F(t){return t.kind==="choice"?Math.min(8,t.choices.length)+(t.detail===void 0?5:6):t.kind==="approval"?8+(t.detail===void 0?0:1):t.kind==="secret"?6:t.kind==="subagent"?10:(t.kind==="trust",6)}function D({bridge:t}){return n($,{title:"Trust this workspace?",detail:"Local tools, MCP, and extensions remain disabled until you grant trust.",onDecision:c=>t.resolveActiveModal(c)})}function p({children:t,title:e="Action required"}){return s(d,{borderStyle:"double",borderColor:l.accent,flexDirection:"column",marginTop:1,paddingX:1,children:[n(o,{bold:!0,color:l.text,children:e}),t]})}function M({bridge:t,subagent:e}){h((c,i)=>{(i.return||i.escape||c==="\x1B"||c.toLowerCase()==="q")&&t.closeSubagentDetails()});const r=e.handoff;return s(p,{title:`Subagent handoff \xB7 ${e.displayName}`,children:[n(o,{color:l.text,children:e.task}),s(o,{color:l.muted,children:[e.mode," \xB7 ",e.status," \xB7 ",e.model]}),r===void 0?n(o,{color:l.muted,children:"Handoff is available when this subagent completes."}):s(d,{flexDirection:"column",children:[n(u,{label:"Summary",values:[r.summary]}),n(u,{label:"Files inspected",values:r.filesInspected}),n(u,{label:"Files changed",values:r.filesChanged}),n(u,{label:"Commands run",values:r.commandsRun}),n(u,{label:"Verification",values:r.verification}),n(u,{label:"Warnings",values:r.warnings})]}),n(o,{color:l.accent,children:"Enter / Esc / Q close"})]})}function u({label:t,values:e}){return s(d,{flexDirection:"column",marginTop:1,children:[n(o,{bold:!0,color:l.accent,children:t}),n(o,{color:l.muted,wrap:"wrap",children:e.length===0?"None":e.map(r=>`\u2022 ${E(r)}`).join(`
|
|
2
|
+
`)})]})}function E(t){const e=t.replace(/Bearer\s+[^\s]+/giu,"Bearer [REDACTED]").replace(/sk-[A-Za-z0-9_-]{8,}/gu,"[REDACTED]");return e.length<=500?e:`${e.slice(0,497)}...`}function $({title:t,detail:e,onDecision:r}){return h((c,i)=>{i.return||c.toLowerCase()==="y"?r(!0):(i.escape||c.toLowerCase()==="n")&&r(!1)}),s(p,{children:[n(o,{color:l.text,children:t}),n(o,{color:l.muted,children:e}),n(o,{color:l.accent,children:"Enter / Y approve \xB7 Esc / N cancel"})]})}function A({bridge:t,toolName:e,detail:r}){return n(m,{bridge:t,title:`Approval \xB7 ${C(e)}`,choices:[{value:"allow",label:"Allow",description:"Run this tool action"},{value:"deny",label:"Deny",description:"Block this tool action"}],...r===void 0?{}:{detail:T(r)},borderColor:l.warning})}function C(t){return t==="shell.exec"?"Shell command":t==="filesystem.write"?"File write":"Tool action"}function T(t){const e=t.trim();return e.startsWith("Write workspace file: ")?`write ${e.slice(22)}`:e.startsWith("Run command: ")?`run ${e.slice(13)}`:e.startsWith("This ")?e.replace(/^This /u,"").replace(/ operation may change workspace or external state\.$/u,""):e}function k({bridge:t,label:e}){const[r,c]=v("");return h((i,a)=>{a.return?t.resolveActiveModal(r.trim()||void 0):a.escape?t.resolveActiveModal(void 0):a.backspace||a.delete?c(f=>f.slice(0,-1)):!a.ctrl&&!a.meta&&i.length>0&&c(f=>`${f}${i}`)}),w(i=>c(a=>`${a}${i.replace(/[\r\n]/gu,"")}`)),s(p,{children:[n(o,{color:l.text,children:e}),n(o,{color:l.accent,children:`> ${"\u2022".repeat(r.length)}\u258C`}),n(o,{color:l.muted,children:"Enter save \xB7 Esc cancel"})]})}export{V as Modal,F as estimateModalRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{Text as e}from"ink";import{DARK_THEME as h}from"../../../themes/theme.js";function c({value:t,active:i,frame:p,color:r=h.muted,highlightColor:f=h.text}){if(!i||t.length===0)return m(e,{color:i?r:h.text,children:t});const n=p%[...t].length;return m(e,{color:r,children:[...t].map((l,o)=>m(e,{color:o===n?f:r,bold:o===n,children:l},`${o}-${l}`))})}export{c as ShimmerText};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { TuiSubagent } from '../tui-bridge.js';
|
|
3
|
+
export declare function SubagentCreatedEntry({ subagent }: {
|
|
4
|
+
subagent: TuiSubagent;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
export declare function visibleSubagents(subagents: readonly TuiSubagent[]): readonly TuiSubagent[];
|
|
7
|
+
export declare function SubagentActivity({ subagents, selectedId, paused }: {
|
|
8
|
+
subagents: readonly TuiSubagent[];
|
|
9
|
+
selectedId?: string;
|
|
10
|
+
paused?: boolean;
|
|
11
|
+
}): JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as c,jsxs as o}from"react/jsx-runtime";import{Box as a,Text as t,useAnimation as s}from"ink";import{DARK_THEME as e}from"../../../themes/theme.js";const f=5;function y({subagent:r}){return o(a,{flexDirection:"column",marginBottom:1,children:[o(t,{color:e.accent,children:["\u25CC ",c(t,{bold:!0,children:"Created agent"})," ",o(t,{color:e.muted,children:["\xB7 ",p(r)]})]}),o(t,{color:e.muted,children:[" ",r.mode,r.background?" \xB7 background":""]})]})}function x(r){return r.filter(h).sort(g).slice(0,f)}function D({subagents:r,selectedId:n,paused:l=!1}){const i=r.filter(h),{frame:d}=s({interval:250,isActive:i.length>0&&!l}),m=x(r);return m.length===0?null:o(a,{borderStyle:"round",borderColor:e.border,flexDirection:"column",marginBottom:1,paddingX:1,children:[o(t,{color:e.text,children:[c(t,{bold:!0,children:"Subagents"}),c(t,{color:e.muted,children:i.length===0?"":` \xB7 ${i.length} working`})]}),m.map(u=>c(A,{subagent:u,selected:u.id===n,frame:d},u.id)),i.length>f&&o(t,{color:e.muted,children:[" and ",i.length-f," other subagents working"]}),c(t,{color:e.muted,dimColor:!0,children:"Ctrl+J/K select \xB7 Ctrl+O handoff"})]})}function A({subagent:r,selected:n,frame:l}){const i=C(r.status),d=r.status==="running"||r.status==="queued"?Date.now()-r.createdAt:r.durationMs??r.updatedAt-r.createdAt;return o(a,{backgroundColor:n?e.selection:void 0,flexDirection:"column",marginTop:1,paddingX:n?1:0,children:[o(t,{color:i,children:[_(r.status,l)," ",c(t,{bold:!0,children:p(r)})]}),o(t,{color:e.muted,children:[" ",r.mode," \xB7 ",r.status," \xB7 ",B(d)]}),r.lastAction!==void 0&&o(t,{color:e.muted,wrap:"truncate",children:[" ",r.lastAction.label]})]})}function h(r){return r.status==="queued"||r.status==="running"}function g(r,n){return n.updatedAt-r.updatedAt}function p(r){return`${r.displayName} \xB7 ${w(r.task)}`}function w(r){const n=r.replace(/\s+/gu," ").trim();return n.length<=56?n:`${n.slice(0,53)}...`}function C(r){return r==="completed"?e.success:r==="completed_with_warning"?e.warning:r==="failed"||r==="cancelled"?e.error:r==="queued"?e.muted:e.warning}function _(r,n){return r==="completed"?"\u2713":r==="completed_with_warning"?"\u26A0":r==="failed"||r==="cancelled"?"!":r==="queued"?"\u25CC":["\u25D0","\u25D3","\u25D1","\u25D2"][n%4]??"\u25D0"}function B(r){return r<1e3?`${Math.max(0,r)}ms`:`${(r/1e3).toFixed(1)}s`}export{D as SubagentActivity,y as SubagentCreatedEntry,x as visibleSubagents};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
import type { Attachment } from '../../../../domain/session/attachment.js';
|
|
3
|
+
import type { TuiMessage } from '../tui-bridge.js';
|
|
4
|
+
import type { TuiWelcome } from '../tui-bridge.js';
|
|
5
|
+
import { type ActivityStatusProps } from './activity-status.js';
|
|
6
|
+
export interface TuiStatusEntry {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: 'status';
|
|
9
|
+
content: '';
|
|
10
|
+
status: ActivityStatusProps;
|
|
11
|
+
}
|
|
12
|
+
export interface TuiWelcomeEntry {
|
|
13
|
+
id: string;
|
|
14
|
+
kind: 'welcome';
|
|
15
|
+
content: '';
|
|
16
|
+
welcome: TuiWelcome;
|
|
17
|
+
visible?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type TuiTranscriptEntry = TuiMessage | TuiStatusEntry | TuiWelcomeEntry;
|
|
20
|
+
export interface TranscriptProps {
|
|
21
|
+
messages: readonly TuiTranscriptEntry[];
|
|
22
|
+
showActionDetails?: boolean;
|
|
23
|
+
fill?: boolean;
|
|
24
|
+
height?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function Transcript({ messages, showActionDetails, fill, height }: TranscriptProps): JSX.Element;
|
|
27
|
+
export interface TranscriptViewport {
|
|
28
|
+
messages: readonly TuiTranscriptEntry[];
|
|
29
|
+
firstMessage: number;
|
|
30
|
+
lastMessage: number;
|
|
31
|
+
}
|
|
32
|
+
/** Returns a stable message window, measured from the newest transcript entry. */
|
|
33
|
+
export declare function transcriptViewport(messages: readonly TuiTranscriptEntry[], offset: number, maximumMessages: number): TranscriptViewport;
|
|
34
|
+
/** Returns a viewport measured in terminal rows so wrapped messages scroll predictably. */
|
|
35
|
+
export declare function transcriptViewportByRows(messages: readonly TuiTranscriptEntry[], offsetRows: number, maximumRows: number, columns: number): TranscriptViewport;
|
|
36
|
+
export declare function transcriptTotalRows(messages: readonly TuiTranscriptEntry[], columns: number): number;
|
|
37
|
+
export declare function AttachmentChip({ attachment }: {
|
|
38
|
+
attachment: Attachment;
|
|
39
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Box as f,Text as m}from"ink";import{DARK_THEME as x}from"../../../themes/theme.js";import{MarkdownMessage as y}from"../markdown-message.js";import{FileDiff as O,fileDiffRowCount as _}from"./file-diff.js";import{terminalTextWidth as D,wrapTerminalText as W}from"../../formatters.js";import{ActivityEntry as G}from"./activity-entry.js";import{SubagentCreatedEntry as I}from"./subagent-activity.js";import{ActivityStatus as F}from"./activity-status.js";import{WelcomePanel as L,WELCOME_PANEL_ROWS as S}from"./welcome-panel.js";function tt({messages:t,showActionDetails:r=!1,fill:i=!1,height:o}){return e(f,{flexDirection:"column",...i?{flexGrow:1,overflow:"hidden"}:{},...o===void 0?{}:{height:o},children:t.map(n=>e(z,{message:n,showActionDetails:r},n.id))})}function nt(t,r,i){const o=Math.max(0,Math.min(r,Math.max(0,t.length-i))),n=t.length-o,c=Math.max(0,n-i);return{messages:t.slice(c,n),firstMessage:c+1,lastMessage:n}}function rt(t,r,i,o){const n=t.map(a=>T(a,o)),c=[],l=n.reduce((a,h)=>a+h,0),d=Math.max(1,Math.floor(i)),M=Math.max(0,Math.min(Math.floor(r),Math.max(0,l-d))),p=l-M,E=Math.max(0,p-d);let k=0,u=t.length,b=0;for(let a=0;a<t.length;a+=1){const h=k;c[a]=h;const w=n[a]??1;k+=w,k>E&&h<p&&(u=Math.min(u,a),b=a+1)}return u===t.length?{messages:[],firstMessage:0,lastMessage:0}:{messages:t.slice(u,b).flatMap((a,h)=>{const w=u+h,v=c[w]??0,j=v+(n[w]??1),C=Math.max(E,v),R=Math.min(p,j);return R<=C?[]:[P(a,C-v,R-C,o)]}),firstMessage:u+1,lastMessage:b}}function it(t,r){return t.reduce((i,o)=>i+T(o,r),0)}function T(t,r){if(t.kind==="welcome")return S;if(t.kind==="status")return 2;const i=Math.max(1,r-4),o=t.content.split(`
|
|
2
|
+
`).reduce((d,M)=>d+Math.max(1,Math.ceil(D(M)/i)),0),n=(t.attachments?.length??0)*2,c=t.fileChange===void 0?0:_(t.fileChange,r),l=t.subagent===void 0?0:2;return Math.max(1,o+n+c+l+1)}function P(t,r,i,o){if(t.kind==="welcome")return r<=0&&i>=S?t:{...t,visible:!1};if(t.kind==="status"||!V(t)||r<=0&&i>=T(t,o))return t;const n=Math.max(1,o-4),c=t.content.split(`
|
|
3
|
+
`).reduce((M,p)=>M+Math.max(1,Math.ceil(D(p)/n)),0),l=Math.max(0,r),d=Math.min(c,l+Math.max(0,i));return d<=l?{...t,content:A(t.content,Math.max(0,c-1),1,n)}:{...t,content:A(t.content,l,d-l,n)}}function V(t){return t.kind==="assistant"||t.kind==="user"||t.kind==="notice"||t.kind==="error"||t.kind==="command"}function A(t,r,i,o){const n=[];for(const c of t.split(`
|
|
4
|
+
`)){const l=W(c,o);n.push(...l)}return n.slice(r,r+i).join(`
|
|
5
|
+
`)}function z({message:t,showActionDetails:r}){if(t.kind==="welcome")return t.visible===!1?null:e(L,{welcome:t.welcome});if(t.kind==="status")return e(F,{...t.status});if(t.kind==="assistant")return s(f,{flexDirection:"row",alignItems:"flex-start",marginBottom:1,children:[e(B,{}),e(f,{flexGrow:1,children:e(y,{content:t.content||" "})})]});if(t.kind==="diff"&&t.fileChange!==void 0)return e(O,{change:t.fileChange});if(t.kind==="activity"&&t.activity!==void 0)return e(G,{activity:t.activity,showDetails:r});if(t.kind==="subagent"&&t.subagent!==void 0)return e(I,{subagent:t.subagent});if(t.kind==="user")return s(f,{backgroundColor:x.user,flexDirection:"column",marginBottom:1,children:[s(f,{flexDirection:"row",alignItems:"flex-start",children:[e(B,{}),e(f,{flexGrow:1,children:e(y,{content:t.content})})]}),t.attachments?.map(n=>e(H,{attachment:n},n.id))]});const i=t.kind==="error"?x.error:t.kind==="command"?x.accent:x.muted,o=t.kind==="error"?"!":t.kind==="command"?"\u203A":"\xB7";return s(f,{marginBottom:1,children:[s(m,{color:i,children:[o," "]}),e(m,{color:i,wrap:"wrap",children:t.content})]})}function B(){return e(m,{color:x.text,children:"\u25CF "})}function H({attachment:t}){return e(f,{marginTop:1,children:s(m,{color:x.muted,children:["\u25A3 ",t.name]})})}export{H as AttachmentChip,tt as Transcript,it as transcriptTotalRows,nt as transcriptViewport,rt as transcriptViewportByRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as o,jsx as c}from"react/jsx-runtime";import{Box as d,Text as e}from"ink";import{DARK_THEME as r}from"../../../themes/theme.js";import{COMMAND_REGISTRY as s}from"../../../../application/commands/command-runtime.js";import{formatCommandReference as m}from"../../../../application/commands/command-presentation.js";const u=i("help"),h=i("model.current"),w=10;function C({welcome:t}){const n=t.model??"Select a model to begin",l=t.trusted?"Trusted workspace":"Restricted workspace",a=t.trusted?r.success:r.warning;return o(d,{borderStyle:"round",borderColor:r.accent,flexDirection:"row",marginBottom:1,paddingX:1,paddingY:1,children:[o(d,{flexDirection:"column",width:"38%",children:[o(e,{color:r.accent,children:["LotaGate CLI v",t.version]}),c(e,{bold:!0,color:r.text,children:"Welcome back!"}),c(e,{color:r.muted,wrap:"truncate",children:n}),o(e,{color:a,children:["\u25CF ",l]}),c(e,{color:r.muted,wrap:"truncate",children:t.cwd})]}),o(d,{borderLeft:!0,borderColor:r.border,flexDirection:"column",paddingLeft:1,width:"62%",children:[c(e,{bold:!0,color:r.accent,children:"Tips for getting started"}),o(e,{color:r.muted,wrap:"truncate",children:[u," Browse interactive commands"]}),o(e,{color:r.muted,wrap:"truncate",children:[h," Show the active model"]}),c(d,{marginTop:1,children:c(e,{bold:!0,color:r.accent,children:"Recent activity"})}),c(e,{color:r.muted,children:"No recent activity"})]})]})}function i(t){const n=s.get(t);if(n===void 0)throw new Error(`Missing command contract: ${t}`);return m(n,"tui")}export{w as WELCOME_PANEL_ROWS,C as WelcomePanel};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as f,Fragment as X,jsxs as z}from"react/jsx-runtime";import{useCallback as T,useEffect as J,useState as p,useSyncExternalStore as K}from"react";import{Box as P,useInput as Q,useStdout as Y}from"ink";import{Transcript as Z,transcriptTotalRows as $,transcriptViewportByRows as y}from"./components/transcript.js";import{Composer as k}from"./components/composer.js";import{estimateModalRows as ee,Modal as D}from"./components/modal.js";import{SubagentActivity as ne,visibleSubagents as te}from"./components/subagent-activity.js";import{parseMouseWheel as oe}from"../terminal-mouse.js";const O=3;function ge({bridge:n}){const e=K(o=>n.subscribe(o),()=>n.snapshot(),()=>n.snapshot()),{stdout:i}=Y(),[l,u]=p(0),[r,g]=p(),[B,I]=p(),[R,j]=p(),m=e.modal,a=se(m)?m:void 0,M=e.runActive&&e.modal===void 0,_=i.rows??24,x=6+e.pendingAttachments.length*2,b=B??x,N=a===void 0?0:R?.modal===a?R.rows:ee(a),E=ie(e,re(e.subagents),b,N),S=Math.max(40,i.columns??80),v=ae(e),C=$(v,S),F=Math.max(0,_-E),W=b>x?0:1,d=Math.max(W,F),w=Math.max(0,C-d),q=y(v,l,Math.max(1,d),S),A=d>0&&C>=d,c=te(e.subagents),G=T(o=>{I(t=>t===o?t:o)},[]),H=T(o=>{a!==void 0&&j(t=>t?.modal===a&&t.rows===o?t:{modal:a,rows:o})},[a]);return J(()=>{r!==void 0&&c.some(o=>o.id===r)||g(c[0]?.id)},[c,r]),Q((o,t)=>{const L=e.modal===void 0?de(o,t,e.runActive):void 0;if(t.ctrl&&o.toLowerCase()==="c")n.interrupt();else if((t.escape||o==="\x1B")&&M)n.cancel();else if(L!==void 0){if(c.length===0)return;const h=c.findIndex(V=>V.id===r),s=c[(h+L+c.length)%c.length];g(s?.id)}else if(e.modal===void 0&&t.ctrl&&o.toLowerCase()==="o"&&r!==void 0)n.openSubagentDetails(r);else{const h=oe(o);h==="up"?u(s=>Math.min(w,s+3)):h==="down"?u(s=>Math.max(0,s-3)):t.pageUp||t.home?u(t.home?w:s=>Math.min(w,s+d)):U(o,t,"up")?u(s=>Math.min(w,s+O)):t.pageDown||t.end?u(t.end?0:s=>Math.max(0,s-d)):U(o,t,"down")&&u(s=>Math.max(0,s-O))}}),f(P,{flexDirection:"column",paddingX:1,...i.rows===void 0?{}:{height:i.rows,overflow:"hidden"},children:m!==void 0&&a===void 0?f(D,{bridge:n,modal:m}):z(X,{children:[d>0&&f(Z,{messages:q.messages,showActionDetails:e.actionDetails,fill:A,...A?{height:d}:{}}),f(ne,{subagents:e.subagents,paused:!1,...r===void 0?{}:{selectedId:r}}),f(k,{bridge:n,enabled:e.ready&&!e.runActive&&a===void 0,activeRun:M,onLayoutRowsChange:G,...e.clearBlockedUntil===void 0?{}:{clearBlockedUntil:e.clearBlockedUntil},...e.footerNotice===void 0?{}:{footerNotice:e.footerNotice},...e.contextUsage===void 0?{}:{contextUsage:e.contextUsage},attachments:e.pendingAttachments,fileChoices:e.fileSuggestions}),a!==void 0&&f(D,{bridge:n,modal:a,onLayoutRowsChange:H})]})})}function se(n){return n?.kind==="choice"||n?.kind==="approval"}function ie(n,e,i,l){return(e===0?0:4+e*4)+Math.max(i,6+n.pendingAttachments.length*2)+l}function ae(n){const e=n.welcome===void 0?[]:[{id:"tui-welcome",kind:"welcome",content:"",welcome:n.welcome}];return n.status===void 0?[...e,...n.messages]:[...e,...n.messages,{id:"tui-live-turn-status",kind:"status",content:"",status:{status:n.status,...n.activityStartedAt===void 0?{}:{activityStartedAt:n.activityStartedAt},...n.elapsedMs===void 0?{}:{elapsedMs:n.elapsedMs},...n.usage===void 0?{}:{usage:n.usage},paused:n.modal!==void 0}}]}function re(n){return n.filter(e=>e.status==="queued"||e.status==="running").length}function U(n,e,i){return e.ctrl&&(i==="up"?e.upArrow:e.downArrow)?!0:n===(i==="up"?"\x1B[1;5A":"\x1B[1;5B")}function de(n,e,i){const l=n.toLowerCase();if(e.ctrl&&l==="j")return 1;if(e.ctrl&&l==="k")return-1;if(i){if(n===`
|
|
2
|
+
`)return 1;if(n==="\v")return-1}}export{ge as LotaGateTui};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i,Fragment as d}from"react/jsx-runtime";import{Text as e}from"ink";import{DARK_THEME as n}from"../../themes/theme.js";import{tokenizeMarkdownInline as a}from"./markdown-inline.js";function h({value:r}){return i(d,{children:a(r).map((l,u)=>i(t,{token:l},u))})}function t({token:r}){return r.kind==="link"?i(e,{color:n.link,underline:!0,children:r.label}):r.kind==="code"?i(e,{color:n.code,backgroundColor:n.surfaceRaised,children:r.value}):r.kind==="bold"?i(e,{bold:!0,children:r.value}):r.kind==="italic"?i(e,{italic:!0,children:r.value}):r.kind==="strike"?i(e,{strikethrough:!0,children:r.value}):i(e,{children:r.value})}export{h as MarkdownInline};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MarkdownInlineToken = {
|
|
2
|
+
kind: 'text';
|
|
3
|
+
value: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'code' | 'bold' | 'italic' | 'strike';
|
|
6
|
+
value: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'link';
|
|
9
|
+
label: string;
|
|
10
|
+
href: string;
|
|
11
|
+
};
|
|
12
|
+
/** Tokenizes the safe Markdown subset rendered by the terminal UI. */
|
|
13
|
+
export declare function tokenizeMarkdownInline(value: string): readonly MarkdownInlineToken[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const d=/(`[^\n`]+`|\*\*[^*\n]+\*\*|__[^_\n]+__|~~[^~\n]+~~|\*[^*\n]+\*|_[^_\n]+_)/gu;function u(n){const e=[];let t=0,i=0;for(;t<n.length;){const s=k(n,t);if(s!==void 0){f(e,n,i,t),e.push({kind:"link",label:s.label,href:s.href}),t=s.end,i=t;continue}d.lastIndex=0;const r=d.exec(n.slice(t));if(r?.index===0){const c=r[0]??"";f(e,n,i,t),e.push(h(c)),t+=c.length,i=t;continue}t+=1}return f(e,n,i,n.length),e}function h(n){return n.startsWith("`")?{kind:"code",value:n.slice(1,-1)}:n.startsWith("**")||n.startsWith("__")?{kind:"bold",value:n.slice(2,-2)}:n.startsWith("~~")?{kind:"strike",value:n.slice(2,-2)}:n.startsWith("*")||n.startsWith("_")?{kind:"italic",value:n.slice(1,-1)}:{kind:"text",value:n}}function k(n,e){if(n[e]!=="[")return;const t=o(n,"]",e+1);if(t===-1||n[t+1]!=="(")return;const i=t+2;if(n[i]==="<"){const r=o(n,">",i+1);return r===-1||n[r+1]!==")"?void 0:{label:n.slice(e+1,t),href:n.slice(i+1,r),end:r+2}}let s=1;for(let r=i;r<n.length;r+=1){const c=n[r]??"";if(c==="\\"){r+=1;continue}if(/\s/u.test(c))return;if(c==="("){s+=1;continue}if(c===")"&&(s-=1,s===0))return{label:n.slice(e+1,t),href:n.slice(i,r),end:r+1}}}function o(n,e,t){for(let i=t;i<n.length;i+=1){if(n[i]==="\\"){i+=1;continue}if(n[i]===e)return i}return-1}function f(n,e,t,i){i>t&&n.push({kind:"text",value:e.slice(t,i)})}export{u as tokenizeMarkdownInline};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as e,jsxs as p}from"react/jsx-runtime";import{Box as h,Text as c}from"ink";import{DARK_THEME as s}from"../../themes/theme.js";import{MarkdownInline as a}from"./markdown-inline-renderer.js";import{MarkdownTable as m,parseMarkdownTable as x}from"./markdown-table.js";function L({content:t}){let r=!1;const i=t.split(`
|
|
2
|
+
`),o=[];for(let n=0;n<i.length;n+=1){const u=i[n]??"";if(u.startsWith("```")){r=!r,o.push(e(c,{color:s.muted,children:u.length>3?`\xB7 ${u.slice(3).trim()}`:""},n));continue}if(r){o.push(e(c,{color:s.code,wrap:"wrap",children:u},n));continue}const d=x(i,n);if(d!==void 0){o.push(e(m,{table:d.table},n)),n=d.nextLine-1;continue}const f=/^(#{1,6})\s+(.+)$/u.exec(u);if(f!==null){o.push(e(c,{bold:!0,color:s.accent,wrap:"wrap",children:e(a,{value:f[2]??""})},n));continue}const w=k(u);if(w!==void 0){o.push(e(M,{item:w},n));continue}const l=/^(\s*)(>+)\s?(.*)$/u.exec(u);if(l!==null){o.push(p(c,{color:s.muted,wrap:"wrap",children:[l[1],"\u2502 ".repeat(l[2]?.length??1),e(a,{value:l[3]??""})]},n));continue}if(/^([-*_])(?:\s*\1){2,}\s*$/u.test(u)){o.push(e(c,{color:s.muted,children:"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"},n));continue}o.push(e(c,{wrap:"wrap",children:e(a,{value:u})},n))}return e(h,{flexDirection:"column",children:o})}function k(t){const r=/^(\s*)([-*+]|\d+[.)])\s+(?:(\[(?: |x|X)\])\s+)?(.+)$/u.exec(t);if(r===null)return;const i=r[3];return{indent:r[1]??"",marker:r[2]??"\u2022",content:r[4]??"",...i===void 0?{}:{checked:i.toLowerCase()==="[x]"}}}function M({item:t}){const r=t.checked===void 0?/^\d/u.test(t.marker)?t.marker:"\u2022":t.checked?"\u2611":"\u2610";return p(h,{flexDirection:"row",children:[p(c,{color:s.accent,children:[t.indent,r," "]}),e(h,{flexGrow:1,children:e(c,{wrap:"wrap",children:e(a,{value:t.content})})})]})}export{L as MarkdownMessage};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
2
|
+
export type MarkdownTableAlignment = 'left' | 'center' | 'right';
|
|
3
|
+
export interface MarkdownTableData {
|
|
4
|
+
headers: readonly string[];
|
|
5
|
+
rows: readonly (readonly string[])[];
|
|
6
|
+
alignments: readonly MarkdownTableAlignment[];
|
|
7
|
+
}
|
|
8
|
+
export interface MarkdownTableMatch {
|
|
9
|
+
table: MarkdownTableData;
|
|
10
|
+
nextLine: number;
|
|
11
|
+
}
|
|
12
|
+
/** Detects a pipe table beginning at the supplied Markdown line. */
|
|
13
|
+
export declare function parseMarkdownTable(lines: readonly string[], startLine: number): MarkdownTableMatch | undefined;
|
|
14
|
+
export declare function MarkdownTable({ table }: {
|
|
15
|
+
table: MarkdownTableData;
|
|
16
|
+
}): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as a,jsx as s}from"react/jsx-runtime";import{Box as u,Text as h}from"ink";import{DARK_THEME as m}from"../../themes/theme.js";import{terminalTextWidth as w}from"../formatters.js";import{MarkdownInline as M}from"./markdown-inline-renderer.js";import{tokenizeMarkdownInline as j}from"./markdown-inline.js";function z(e,t){const r=p(e[t]??""),n=p(e[t+1]??"");if(r.length<2||n.length<2||n.some(f=>!W(f)))return;const o=Math.max(r.length,n.length),l=g(r,o),i=D(n,o),c=[];let d=t+2;for(;d<e.length;){const f=p(e[d]??"");if(f.length<2)break;c.push(g(f,o)),d+=1}return{table:{headers:l,rows:c,alignments:i},nextLine:d}}function v({table:e}){const t=e.headers.map((r,n)=>Math.max(w(T(r)),...e.rows.map(o=>w(T(o[n]??"")))));return a(u,{flexDirection:"column",children:[x(e.headers,t,e.alignments,!0),k(t),e.rows.map((r,n)=>x(r,t,e.alignments,!1,n))]})}function x(e,t,r,n,o=0){return a(u,{flexDirection:"row",children:[s(h,{color:m.muted,children:"\u2502"}),e.map((l,i)=>a(u,{flexDirection:"row",children:[s(u,{width:(t[i]??0)+2,paddingX:1,justifyContent:r[i]==="right"?"flex-end":r[i]==="center"?"center":"flex-start",children:s(h,{bold:n,wrap:"truncate",children:s(M,{value:l})})}),s(h,{color:m.muted,children:"\u2502"})]},i))]},o)}function k(e){return a(u,{flexDirection:"row",children:[s(h,{color:m.muted,children:"\u251C"}),e.map((t,r)=>a(h,{color:m.muted,children:["\u2500".repeat(t+2),r===e.length-1?"\u2524":"\u253C"]},r))]})}function p(e){const t=e.trim();if(!t.includes("|"))return[];const r=t.startsWith("|")?t.slice(1):t,n=r.endsWith("|")&&!r.endsWith("\\|")?r.slice(0,-1):r,o=[];let l="",i=!1;for(const c of n){if(c==="|"&&!i){o.push(l.trim()),l="";continue}if(c==="\\"&&!i){i=!0,l+=c;continue}i=!1,l+=c}return o.push(l.trim()),o}function W(e){return/^:?-{1,}:?$/u.test(e)}function g(e,t){return Array.from({length:t},(r,n)=>e[n]??"")}function D(e,t){return Array.from({length:t},(r,n)=>{const o=e[n]??"",l=o.startsWith(":"),i=o.endsWith(":");return l&&i?"center":i?"right":"left"})}function T(e){return j(e).map(t=>t.kind==="link"?t.label:t.value).join("")}export{v as MarkdownTable,z as parseMarkdownTable};
|