@renxqoo/renx-code 0.0.3 → 0.0.5
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 +58 -223
- package/bin/renx.cjs +50 -0
- package/package.json +12 -111
- package/src/App.tsx +297 -0
- package/src/agent/runtime/event-format.ts +258 -0
- package/src/agent/runtime/model-types.ts +13 -0
- package/src/agent/runtime/runtime.context-usage.test.ts +192 -0
- package/src/agent/runtime/runtime.error-handling.test.ts +235 -0
- package/src/agent/runtime/runtime.simple.test.ts +16 -0
- package/src/agent/runtime/runtime.test.ts +296 -0
- package/src/agent/runtime/runtime.ts +875 -0
- package/src/agent/runtime/runtime.usage-forwarding.test.ts +228 -0
- package/src/agent/runtime/source-modules.test.ts +38 -0
- package/src/agent/runtime/source-modules.ts +370 -0
- package/src/agent/runtime/tool-call-buffer.test.ts +65 -0
- package/src/agent/runtime/tool-call-buffer.ts +60 -0
- package/src/agent/runtime/tool-confirmation.test.ts +56 -0
- package/src/agent/runtime/tool-confirmation.ts +15 -0
- package/src/agent/runtime/types.ts +99 -0
- package/src/commands/slash-commands.test.ts +216 -0
- package/src/commands/slash-commands.ts +64 -0
- package/src/components/chat/assistant-reply.test.tsx +47 -0
- package/src/components/chat/assistant-reply.tsx +136 -0
- package/src/components/chat/assistant-segment.test.ts +99 -0
- package/src/components/chat/assistant-segment.tsx +125 -0
- package/src/components/chat/assistant-tool-group.tsx +900 -0
- package/src/components/chat/code-block.test.tsx +206 -0
- package/src/components/chat/code-block.tsx +313 -0
- package/src/components/chat/prompt-card.tsx +81 -0
- package/src/components/chat/segment-groups.test.ts +52 -0
- package/src/components/chat/segment-groups.ts +106 -0
- package/src/components/chat/turn-item.tsx +39 -0
- package/src/components/conversation-panel.tsx +43 -0
- package/src/components/file-mention-menu.tsx +77 -0
- package/src/components/file-picker-dialog.tsx +206 -0
- package/src/components/footer-hints.tsx +75 -0
- package/src/components/model-picker-dialog.tsx +248 -0
- package/src/components/prompt.tsx +233 -0
- package/src/components/slash-command-menu.tsx +65 -0
- package/src/components/tool-confirm-dialog-content.test.ts +103 -0
- package/src/components/tool-confirm-dialog-content.ts +186 -0
- package/src/components/tool-confirm-dialog.tsx +187 -0
- package/src/components/tool-display-config.ts +119 -0
- package/src/context-usage-regressions.test.ts +26 -0
- package/src/files/attachment-capabilities.test.ts +30 -0
- package/src/files/attachment-capabilities.ts +50 -0
- package/src/files/attachment-content.ts +153 -0
- package/src/files/file-mention-query.test.ts +34 -0
- package/src/files/file-mention-query.ts +32 -0
- package/src/files/prompt-display.ts +13 -0
- package/src/files/types.ts +5 -0
- package/src/files/workspace-files.ts +63 -0
- package/src/hooks/agent-event-handlers.test.ts +207 -0
- package/src/hooks/agent-event-handlers.ts +196 -0
- package/src/hooks/chat-local-replies.fixed.test.ts +119 -0
- package/src/hooks/chat-local-replies.test.ts +153 -0
- package/src/hooks/chat-local-replies.ts +63 -0
- package/src/hooks/turn-updater.test.ts +70 -0
- package/src/hooks/turn-updater.ts +166 -0
- package/src/hooks/use-agent-chat.context.test.ts +10 -0
- package/src/hooks/use-agent-chat.status.test.ts +14 -0
- package/src/hooks/use-agent-chat.test.ts +80 -0
- package/src/hooks/use-agent-chat.ts +621 -0
- package/src/hooks/use-file-mention-menu.ts +196 -0
- package/src/hooks/use-file-picker.ts +185 -0
- package/src/hooks/use-model-picker.ts +196 -0
- package/src/hooks/use-slash-command-menu.ts +154 -0
- package/src/index.tsx +55 -0
- package/src/runtime/clipboard.test.ts +43 -0
- package/src/runtime/clipboard.ts +89 -0
- package/src/runtime/exit.test.ts +177 -0
- package/src/runtime/exit.ts +98 -0
- package/src/runtime/runtime-support.test.ts +31 -0
- package/src/runtime/terminal-theme.test.ts +55 -0
- package/src/runtime/terminal-theme.ts +196 -0
- package/src/types/chat.ts +32 -0
- package/src/types/message-content.ts +48 -0
- package/src/ui/open-code-theme.ts +176 -0
- package/src/ui/opencode-markdown.ts +211 -0
- package/src/ui/theme.simple.test.ts +52 -0
- package/src/ui/theme.test.ts +151 -0
- package/src/ui/theme.ts +152 -0
- package/src/utils/time.test.ts +144 -0
- package/src/utils/time.ts +7 -0
- package/tsconfig.json +30 -0
- package/vendor/agent-root/src/agent/ENTERPRISE_ACCEPTANCE_CHECKLIST.md +95 -0
- package/vendor/agent-root/src/agent/ENTERPRISE_REALTIME.html +1345 -0
- package/vendor/agent-root/src/agent/ENTERPRISE_REALTIME.md +1353 -0
- package/vendor/agent-root/src/agent/ERROR_CONTRACT.md +60 -0
- package/vendor/agent-root/src/agent/TEST_COVERAGE_ANALYSIS.md +278 -0
- package/vendor/agent-root/src/agent/__test__/error-contract.test.ts +72 -0
- package/vendor/agent-root/src/agent/__test__/types.test.ts +137 -0
- package/vendor/agent-root/src/agent/agent/__test__/abort-runtime.test.ts +83 -0
- package/vendor/agent-root/src/agent/agent/__test__/callback-safety.test.ts +34 -0
- package/vendor/agent-root/src/agent/agent/__test__/compaction.test.ts +323 -0
- package/vendor/agent-root/src/agent/agent/__test__/concurrency.test.ts +290 -0
- package/vendor/agent-root/src/agent/agent/__test__/error-normalizer.test.ts +377 -0
- package/vendor/agent-root/src/agent/agent/__test__/error.test.ts +212 -0
- package/vendor/agent-root/src/agent/agent/__test__/fault-injection.test.ts +295 -0
- package/vendor/agent-root/src/agent/agent/__test__/index.test.ts +3607 -0
- package/vendor/agent-root/src/agent/agent/__test__/logger.test.ts +35 -0
- package/vendor/agent-root/src/agent/agent/__test__/message-utils.test.ts +517 -0
- package/vendor/agent-root/src/agent/agent/__test__/telemetry.test.ts +97 -0
- package/vendor/agent-root/src/agent/agent/__test__/timeout-budget.test.ts +479 -0
- package/vendor/agent-root/src/agent/agent/__test__/tool-call-merge.test.ts +80 -0
- package/vendor/agent-root/src/agent/agent/__test__/tool-execution-ledger.test.ts +76 -0
- package/vendor/agent-root/src/agent/agent/__test__/write-buffer.test.ts +173 -0
- package/vendor/agent-root/src/agent/agent/__test__/write-file-session.test.ts +109 -0
- package/vendor/agent-root/src/agent/agent/abort-runtime.ts +71 -0
- package/vendor/agent-root/src/agent/agent/callback-safety.ts +33 -0
- package/vendor/agent-root/src/agent/agent/compaction.ts +291 -0
- package/vendor/agent-root/src/agent/agent/concurrency.ts +103 -0
- package/vendor/agent-root/src/agent/agent/error-normalizer.ts +190 -0
- package/vendor/agent-root/src/agent/agent/error.ts +198 -0
- package/vendor/agent-root/src/agent/agent/index.ts +1772 -0
- package/vendor/agent-root/src/agent/agent/logger.ts +65 -0
- package/vendor/agent-root/src/agent/agent/message-utils.ts +101 -0
- package/vendor/agent-root/src/agent/agent/stream-events.ts +61 -0
- package/vendor/agent-root/src/agent/agent/telemetry.ts +123 -0
- package/vendor/agent-root/src/agent/agent/timeout-budget.ts +227 -0
- package/vendor/agent-root/src/agent/agent/tool-call-merge.ts +111 -0
- package/vendor/agent-root/src/agent/agent/tool-execution-ledger.ts +164 -0
- package/vendor/agent-root/src/agent/agent/write-buffer.ts +188 -0
- package/vendor/agent-root/src/agent/agent/write-file-session.ts +238 -0
- package/vendor/agent-root/src/agent/app/__test__/agent-app-service.test.ts +1053 -0
- package/vendor/agent-root/src/agent/app/__test__/minimal-agent-application.test.ts +158 -0
- package/vendor/agent-root/src/agent/app/__test__/sqlite-agent-app-store.test.ts +437 -0
- package/vendor/agent-root/src/agent/app/agent-app-service.ts +748 -0
- package/vendor/agent-root/src/agent/app/contracts.ts +109 -0
- package/vendor/agent-root/src/agent/app/index.ts +5 -0
- package/vendor/agent-root/src/agent/app/minimal-agent-application.ts +151 -0
- package/vendor/agent-root/src/agent/app/ports.ts +72 -0
- package/vendor/agent-root/src/agent/app/sqlite-agent-app-store.ts +1182 -0
- package/vendor/agent-root/src/agent/app/sqlite-client.ts +177 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/00-README.md +36 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/01-scope-and-goals.md +33 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/02-architecture-overview.md +40 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/03-domain-model-and-contracts.md +91 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/04-ports-and-interfaces.md +116 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/05-run-orchestration-and-state-machine.md +52 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/06-cli-commands-and-ux.md +53 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/07-storage-design-local.md +52 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/08-error-and-observability.md +40 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/09-security-and-policy-boundary.md +19 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/10-test-plan-and-acceptance.md +28 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/11-implementation-phases.md +26 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/12-open-questions-and-risks.md +30 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/13-sqlite-schema-fields-and-rationale.md +567 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/14-project-flow-mermaid.md +583 -0
- package/vendor/agent-root/src/agent/docs/cli-app-layer/15-openclaw-style-project-blueprint.md +972 -0
- package/vendor/agent-root/src/agent/error-contract.ts +154 -0
- package/{dist/agent/prompts/system.js → vendor/agent-root/src/agent/prompts/system.ts} +47 -23
- package/vendor/agent-root/src/agent/prompts/system1.ts +208 -0
- package/vendor/agent-root/src/agent/storage/__test__/file-history-store.test.ts +98 -0
- package/vendor/agent-root/src/agent/storage/file-history-store.ts +313 -0
- package/vendor/agent-root/src/agent/storage/file-storage-config.ts +94 -0
- package/vendor/agent-root/src/agent/storage/file-system.ts +31 -0
- package/vendor/agent-root/src/agent/storage/file-write-service.ts +21 -0
- package/vendor/agent-root/src/agent/tool/__test__/base-tool.test.ts +413 -0
- package/vendor/agent-root/src/agent/tool/__test__/bash-policy.test.ts +356 -0
- package/vendor/agent-root/src/agent/tool/__test__/bash.mocked-coverage.test.ts +375 -0
- package/vendor/agent-root/src/agent/tool/__test__/bash.test.ts +372 -0
- package/vendor/agent-root/src/agent/tool/__test__/error.test.ts +108 -0
- package/vendor/agent-root/src/agent/tool/__test__/file-edit-tool.test.ts +258 -0
- package/vendor/agent-root/src/agent/tool/__test__/file-history-tools.test.ts +121 -0
- package/vendor/agent-root/src/agent/tool/__test__/file-read-tool.test.ts +210 -0
- package/vendor/agent-root/src/agent/tool/__test__/glob.test.ts +139 -0
- package/vendor/agent-root/src/agent/tool/__test__/grep.mocked-coverage.test.ts +456 -0
- package/vendor/agent-root/src/agent/tool/__test__/grep.test.ts +192 -0
- package/vendor/agent-root/src/agent/tool/__test__/lsp.test.ts +300 -0
- package/vendor/agent-root/src/agent/tool/__test__/outside-workspace-confirmation.test.ts +214 -0
- package/vendor/agent-root/src/agent/tool/__test__/path-security.test.ts +336 -0
- package/vendor/agent-root/src/agent/tool/__test__/skill-loader.test.ts +494 -0
- package/vendor/agent-root/src/agent/tool/__test__/skill-parser.test.ts +543 -0
- package/vendor/agent-root/src/agent/tool/__test__/skill-tool.test.ts +172 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-concurrency-and-version.test.ts +116 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-create-get-list-update.test.ts +267 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-create.test.ts +519 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-errors.test.ts +225 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-output-blocking.test.ts +223 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-output.test.ts +184 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-parent-abort.test.ts +287 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-real-runner-adapter.test.ts +190 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-run-lifecycle.test.ts +352 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-store-runner-branches.test.ts +395 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-store.test.ts +391 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-subagent-config-integration.test.ts +176 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-subagent-config.test.ts +68 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-tools-core-edges.test.ts +630 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-tools-runtime-edges.test.ts +732 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-types.test.ts +494 -0
- package/vendor/agent-root/src/agent/tool/__test__/task-utils-branches.test.ts +175 -0
- package/vendor/agent-root/src/agent/tool/__test__/tool-manager.test.ts +505 -0
- package/vendor/agent-root/src/agent/tool/__test__/types.test.ts +55 -0
- package/vendor/agent-root/src/agent/tool/__test__/web-fetch.test.ts +244 -0
- package/vendor/agent-root/src/agent/tool/__test__/web-search.test.ts +290 -0
- package/vendor/agent-root/src/agent/tool/__test__/write-file.test.ts +368 -0
- package/vendor/agent-root/src/agent/tool/base-tool.ts +345 -0
- package/vendor/agent-root/src/agent/tool/bash-policy.ts +636 -0
- package/vendor/agent-root/src/agent/tool/bash.ts +688 -0
- package/vendor/agent-root/src/agent/tool/error.ts +131 -0
- package/vendor/agent-root/src/agent/tool/file-edit-tool.ts +264 -0
- package/vendor/agent-root/src/agent/tool/file-history-list.ts +103 -0
- package/vendor/agent-root/src/agent/tool/file-history-restore.ts +149 -0
- package/vendor/agent-root/src/agent/tool/file-read-tool.ts +211 -0
- package/vendor/agent-root/src/agent/tool/glob.ts +171 -0
- package/vendor/agent-root/src/agent/tool/grep.ts +496 -0
- package/vendor/agent-root/src/agent/tool/lsp.ts +481 -0
- package/vendor/agent-root/src/agent/tool/path-security.ts +117 -0
- package/vendor/agent-root/src/agent/tool/search/common.ts +153 -0
- package/vendor/agent-root/src/agent/tool/skill/index.ts +13 -0
- package/vendor/agent-root/src/agent/tool/skill/loader.ts +229 -0
- package/vendor/agent-root/src/agent/tool/skill/parser.ts +124 -0
- package/vendor/agent-root/src/agent/tool/skill/types.ts +27 -0
- package/vendor/agent-root/src/agent/tool/skill-tool.ts +143 -0
- package/vendor/agent-root/src/agent/tool/task-create.ts +186 -0
- package/vendor/agent-root/src/agent/tool/task-errors.ts +42 -0
- package/vendor/agent-root/src/agent/tool/task-get.ts +116 -0
- package/vendor/agent-root/src/agent/tool/task-graph.ts +78 -0
- package/vendor/agent-root/src/agent/tool/task-list.ts +141 -0
- package/vendor/agent-root/src/agent/tool/task-mock-runner-adapter.ts +232 -0
- package/vendor/agent-root/src/agent/tool/task-output.ts +223 -0
- package/vendor/agent-root/src/agent/tool/task-parent-abort.ts +115 -0
- package/vendor/agent-root/src/agent/tool/task-real-runner-adapter.ts +336 -0
- package/vendor/agent-root/src/agent/tool/task-runner-adapter.ts +55 -0
- package/vendor/agent-root/src/agent/tool/task-stop.ts +187 -0
- package/vendor/agent-root/src/agent/tool/task-store.ts +217 -0
- package/vendor/agent-root/src/agent/tool/task-subagent-config.ts +149 -0
- package/vendor/agent-root/src/agent/tool/task-types.ts +264 -0
- package/vendor/agent-root/src/agent/tool/task-update.ts +315 -0
- package/vendor/agent-root/src/agent/tool/task.ts +209 -0
- package/vendor/agent-root/src/agent/tool/tool-manager.ts +362 -0
- package/vendor/agent-root/src/agent/tool/tool-prompts.ts +242 -0
- package/vendor/agent-root/src/agent/tool/types.ts +116 -0
- package/vendor/agent-root/src/agent/tool/web-fetch.ts +227 -0
- package/vendor/agent-root/src/agent/tool/web-search.ts +208 -0
- package/vendor/agent-root/src/agent/tool/write-file.ts +497 -0
- package/vendor/agent-root/src/agent/types.ts +232 -0
- package/vendor/agent-root/src/agent/utils/__tests__/index.test.ts +18 -0
- package/vendor/agent-root/src/agent/utils/__tests__/message-utils.test.ts +610 -0
- package/vendor/agent-root/src/agent/utils/__tests__/message.test.ts +223 -0
- package/vendor/agent-root/src/agent/utils/__tests__/token.test.ts +42 -0
- package/vendor/agent-root/src/agent/utils/index.ts +16 -0
- package/vendor/agent-root/src/agent/utils/message.ts +171 -0
- package/vendor/agent-root/src/agent/utils/token.ts +28 -0
- package/vendor/agent-root/src/config/__tests__/load-config-to-env.test.ts +129 -0
- package/vendor/agent-root/src/config/__tests__/loader.test.ts +247 -0
- package/vendor/agent-root/src/config/__tests__/runtime.test.ts +88 -0
- package/vendor/agent-root/src/config/index.ts +54 -0
- package/vendor/agent-root/src/config/loader.ts +431 -0
- package/vendor/agent-root/src/config/paths.ts +30 -0
- package/vendor/agent-root/src/config/runtime.ts +163 -0
- package/vendor/agent-root/src/config/types.ts +70 -0
- package/vendor/agent-root/src/logger/index.ts +57 -0
- package/vendor/agent-root/src/logger/logger.ts +819 -0
- package/vendor/agent-root/src/logger/types.ts +150 -0
- package/vendor/agent-root/src/providers/__tests__/errors.test.ts +441 -0
- package/vendor/agent-root/src/providers/__tests__/index.test.ts +16 -0
- package/vendor/agent-root/src/providers/__tests__/openai-compatible.options.test.ts +318 -0
- package/vendor/agent-root/src/providers/__tests__/openai-compatible.test.ts +600 -0
- package/vendor/agent-root/src/providers/__tests__/registry.test.ts +449 -0
- package/vendor/agent-root/src/providers/__tests__/responses-adapter.test.ts +298 -0
- package/vendor/agent-root/src/providers/adapters/__tests__/anthropic.test.ts +354 -0
- package/vendor/agent-root/src/providers/adapters/__tests__/kimi.test.ts +58 -0
- package/vendor/agent-root/src/providers/adapters/__tests__/standard.test.ts +261 -0
- package/vendor/agent-root/src/providers/adapters/anthropic.ts +572 -0
- package/vendor/agent-root/src/providers/adapters/base.ts +131 -0
- package/vendor/agent-root/src/providers/adapters/kimi.ts +48 -0
- package/vendor/agent-root/src/providers/adapters/responses.ts +732 -0
- package/vendor/agent-root/src/providers/adapters/standard.ts +120 -0
- package/vendor/agent-root/src/providers/http/__tests__/client.timeout.test.ts +313 -0
- package/vendor/agent-root/src/providers/http/client.ts +289 -0
- package/vendor/agent-root/src/providers/http/stream-parser.ts +109 -0
- package/vendor/agent-root/src/providers/index.ts +76 -0
- package/vendor/agent-root/src/providers/kimi-headers.ts +177 -0
- package/vendor/agent-root/src/providers/openai-compatible.ts +387 -0
- package/vendor/agent-root/src/providers/registry/model-config.ts +230 -0
- package/vendor/agent-root/src/providers/registry/provider-factory.ts +123 -0
- package/vendor/agent-root/src/providers/registry.ts +135 -0
- package/vendor/agent-root/src/providers/types/api.ts +284 -0
- package/vendor/agent-root/src/providers/types/config.ts +58 -0
- package/vendor/agent-root/src/providers/types/errors.ts +323 -0
- package/vendor/agent-root/src/providers/types/index.ts +72 -0
- package/vendor/agent-root/src/providers/types/provider.ts +45 -0
- package/vendor/agent-root/src/providers/types/registry.ts +88 -0
- package/LICENSE +0 -21
- package/dist/App.d.ts +0 -2
- package/dist/App.d.ts.map +0 -1
- package/dist/App.js +0 -170
- package/dist/App.js.map +0 -1
- package/dist/agent/prompts/system.d.ts +0 -24
- package/dist/agent/prompts/system.d.ts.map +0 -1
- package/dist/agent/prompts/system.js.map +0 -1
- package/dist/agent/runtime/event-format.d.ts +0 -17
- package/dist/agent/runtime/event-format.d.ts.map +0 -1
- package/dist/agent/runtime/event-format.js +0 -194
- package/dist/agent/runtime/event-format.js.map +0 -1
- package/dist/agent/runtime/model-types.d.ts +0 -13
- package/dist/agent/runtime/model-types.d.ts.map +0 -1
- package/dist/agent/runtime/model-types.js +0 -1
- package/dist/agent/runtime/model-types.js.map +0 -1
- package/dist/agent/runtime/runtime.d.ts +0 -16
- package/dist/agent/runtime/runtime.d.ts.map +0 -1
- package/dist/agent/runtime/runtime.js +0 -691
- package/dist/agent/runtime/runtime.js.map +0 -1
- package/dist/agent/runtime/source-modules.d.ts +0 -176
- package/dist/agent/runtime/source-modules.d.ts.map +0 -1
- package/dist/agent/runtime/source-modules.js +0 -110
- package/dist/agent/runtime/source-modules.js.map +0 -1
- package/dist/agent/runtime/tool-call-buffer.d.ts +0 -12
- package/dist/agent/runtime/tool-call-buffer.d.ts.map +0 -1
- package/dist/agent/runtime/tool-call-buffer.js +0 -48
- package/dist/agent/runtime/tool-call-buffer.js.map +0 -1
- package/dist/agent/runtime/tool-confirmation.d.ts +0 -3
- package/dist/agent/runtime/tool-confirmation.d.ts.map +0 -1
- package/dist/agent/runtime/tool-confirmation.js +0 -9
- package/dist/agent/runtime/tool-confirmation.js.map +0 -1
- package/dist/agent/runtime/types.d.ts +0 -86
- package/dist/agent/runtime/types.d.ts.map +0 -1
- package/dist/agent/runtime/types.js +0 -1
- package/dist/agent/runtime/types.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -12
- package/dist/cli.js.map +0 -1
- package/dist/commands/slash-commands.d.ts +0 -11
- package/dist/commands/slash-commands.d.ts.map +0 -1
- package/dist/commands/slash-commands.js +0 -48
- package/dist/commands/slash-commands.js.map +0 -1
- package/dist/components/chat/assistant-reply.d.ts +0 -13
- package/dist/components/chat/assistant-reply.d.ts.map +0 -1
- package/dist/components/chat/assistant-reply.js +0 -78
- package/dist/components/chat/assistant-reply.js.map +0 -1
- package/dist/components/chat/assistant-segment.d.ts +0 -8
- package/dist/components/chat/assistant-segment.d.ts.map +0 -1
- package/dist/components/chat/assistant-segment.js +0 -54
- package/dist/components/chat/assistant-segment.js.map +0 -1
- package/dist/components/chat/assistant-tool-group.d.ts +0 -7
- package/dist/components/chat/assistant-tool-group.d.ts.map +0 -1
- package/dist/components/chat/assistant-tool-group.js +0 -695
- package/dist/components/chat/assistant-tool-group.js.map +0 -1
- package/dist/components/chat/code-block.d.ts +0 -16
- package/dist/components/chat/code-block.d.ts.map +0 -1
- package/dist/components/chat/code-block.js +0 -194
- package/dist/components/chat/code-block.js.map +0 -1
- package/dist/components/chat/prompt-card.d.ts +0 -9
- package/dist/components/chat/prompt-card.d.ts.map +0 -1
- package/dist/components/chat/prompt-card.js +0 -18
- package/dist/components/chat/prompt-card.js.map +0 -1
- package/dist/components/chat/segment-groups.d.ts +0 -24
- package/dist/components/chat/segment-groups.d.ts.map +0 -1
- package/dist/components/chat/segment-groups.js +0 -69
- package/dist/components/chat/segment-groups.js.map +0 -1
- package/dist/components/chat/turn-item.d.ts +0 -9
- package/dist/components/chat/turn-item.d.ts.map +0 -1
- package/dist/components/chat/turn-item.js +0 -11
- package/dist/components/chat/turn-item.js.map +0 -1
- package/dist/components/conversation-panel.d.ts +0 -8
- package/dist/components/conversation-panel.d.ts.map +0 -1
- package/dist/components/conversation-panel.js +0 -8
- package/dist/components/conversation-panel.js.map +0 -1
- package/dist/components/file-mention-menu.d.ts +0 -11
- package/dist/components/file-mention-menu.d.ts.map +0 -1
- package/dist/components/file-mention-menu.js +0 -15
- package/dist/components/file-mention-menu.js.map +0 -1
- package/dist/components/file-picker-dialog.d.ts +0 -21
- package/dist/components/file-picker-dialog.d.ts.map +0 -1
- package/dist/components/file-picker-dialog.js +0 -48
- package/dist/components/file-picker-dialog.js.map +0 -1
- package/dist/components/footer-hints.d.ts +0 -7
- package/dist/components/footer-hints.d.ts.map +0 -1
- package/dist/components/footer-hints.js +0 -29
- package/dist/components/footer-hints.js.map +0 -1
- package/dist/components/model-picker-dialog.d.ts +0 -20
- package/dist/components/model-picker-dialog.d.ts.map +0 -1
- package/dist/components/model-picker-dialog.js +0 -72
- package/dist/components/model-picker-dialog.js.map +0 -1
- package/dist/components/prompt.d.ts +0 -18
- package/dist/components/prompt.d.ts.map +0 -1
- package/dist/components/prompt.js +0 -96
- package/dist/components/prompt.js.map +0 -1
- package/dist/components/slash-command-menu.d.ts +0 -9
- package/dist/components/slash-command-menu.d.ts.map +0 -1
- package/dist/components/slash-command-menu.js +0 -20
- package/dist/components/slash-command-menu.js.map +0 -1
- package/dist/components/tool-confirm-dialog-content.d.ts +0 -15
- package/dist/components/tool-confirm-dialog-content.d.ts.map +0 -1
- package/dist/components/tool-confirm-dialog-content.js +0 -143
- package/dist/components/tool-confirm-dialog-content.js.map +0 -1
- package/dist/components/tool-confirm-dialog.d.ts +0 -12
- package/dist/components/tool-confirm-dialog.d.ts.map +0 -1
- package/dist/components/tool-confirm-dialog.js +0 -21
- package/dist/components/tool-confirm-dialog.js.map +0 -1
- package/dist/components/tool-display-config.d.ts +0 -11
- package/dist/components/tool-display-config.d.ts.map +0 -1
- package/dist/components/tool-display-config.js +0 -94
- package/dist/components/tool-display-config.js.map +0 -1
- package/dist/config/paths.d.ts +0 -7
- package/dist/config/paths.d.ts.map +0 -1
- package/dist/config/paths.js +0 -24
- package/dist/config/paths.js.map +0 -1
- package/dist/files/attachment-capabilities.d.ts +0 -19
- package/dist/files/attachment-capabilities.d.ts.map +0 -1
- package/dist/files/attachment-capabilities.js +0 -26
- package/dist/files/attachment-capabilities.js.map +0 -1
- package/dist/files/attachment-content.d.ts +0 -5
- package/dist/files/attachment-content.d.ts.map +0 -1
- package/dist/files/attachment-content.js +0 -117
- package/dist/files/attachment-content.js.map +0 -1
- package/dist/files/file-mention-query.d.ts +0 -9
- package/dist/files/file-mention-query.d.ts.map +0 -1
- package/dist/files/file-mention-query.js +0 -23
- package/dist/files/file-mention-query.js.map +0 -1
- package/dist/files/prompt-display.d.ts +0 -3
- package/dist/files/prompt-display.d.ts.map +0 -1
- package/dist/files/prompt-display.js +0 -11
- package/dist/files/prompt-display.js.map +0 -1
- package/dist/files/types.d.ts +0 -6
- package/dist/files/types.d.ts.map +0 -1
- package/dist/files/types.js +0 -1
- package/dist/files/types.js.map +0 -1
- package/dist/files/workspace-files.d.ts +0 -3
- package/dist/files/workspace-files.d.ts.map +0 -1
- package/dist/files/workspace-files.js +0 -48
- package/dist/files/workspace-files.js.map +0 -1
- package/dist/hooks/agent-event-handlers.d.ts +0 -11
- package/dist/hooks/agent-event-handlers.d.ts.map +0 -1
- package/dist/hooks/agent-event-handlers.js +0 -137
- package/dist/hooks/agent-event-handlers.js.map +0 -1
- package/dist/hooks/chat-local-replies.d.ts +0 -9
- package/dist/hooks/chat-local-replies.d.ts.map +0 -1
- package/dist/hooks/chat-local-replies.js +0 -54
- package/dist/hooks/chat-local-replies.js.map +0 -1
- package/dist/hooks/turn-updater.d.ts +0 -9
- package/dist/hooks/turn-updater.d.ts.map +0 -1
- package/dist/hooks/turn-updater.js +0 -103
- package/dist/hooks/turn-updater.js.map +0 -1
- package/dist/hooks/use-agent-chat.d.ts +0 -29
- package/dist/hooks/use-agent-chat.d.ts.map +0 -1
- package/dist/hooks/use-agent-chat.js +0 -455
- package/dist/hooks/use-agent-chat.js.map +0 -1
- package/dist/hooks/use-file-mention-menu.d.ts +0 -22
- package/dist/hooks/use-file-mention-menu.d.ts.map +0 -1
- package/dist/hooks/use-file-mention-menu.js +0 -137
- package/dist/hooks/use-file-mention-menu.js.map +0 -1
- package/dist/hooks/use-file-picker.d.ts +0 -21
- package/dist/hooks/use-file-picker.d.ts.map +0 -1
- package/dist/hooks/use-file-picker.js +0 -145
- package/dist/hooks/use-file-picker.js.map +0 -1
- package/dist/hooks/use-model-picker.d.ts +0 -23
- package/dist/hooks/use-model-picker.d.ts.map +0 -1
- package/dist/hooks/use-model-picker.js +0 -151
- package/dist/hooks/use-model-picker.js.map +0 -1
- package/dist/hooks/use-slash-command-menu.d.ts +0 -19
- package/dist/hooks/use-slash-command-menu.d.ts.map +0 -1
- package/dist/hooks/use-slash-command-menu.js +0 -101
- package/dist/hooks/use-slash-command-menu.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -6
- package/dist/index.js.map +0 -1
- package/dist/run-cli-app.d.ts +0 -2
- package/dist/run-cli-app.d.ts.map +0 -1
- package/dist/run-cli-app.js +0 -41
- package/dist/run-cli-app.js.map +0 -1
- package/dist/runtime/clipboard.d.ts +0 -10
- package/dist/runtime/clipboard.d.ts.map +0 -1
- package/dist/runtime/clipboard.js +0 -64
- package/dist/runtime/clipboard.js.map +0 -1
- package/dist/runtime/exit.d.ts +0 -7
- package/dist/runtime/exit.d.ts.map +0 -1
- package/dist/runtime/exit.js +0 -85
- package/dist/runtime/exit.js.map +0 -1
- package/dist/runtime/runtime-support.d.ts +0 -4
- package/dist/runtime/runtime-support.d.ts.map +0 -1
- package/dist/runtime/runtime-support.js +0 -19
- package/dist/runtime/runtime-support.js.map +0 -1
- package/dist/runtime/terminal-theme.d.ts +0 -25
- package/dist/runtime/terminal-theme.d.ts.map +0 -1
- package/dist/runtime/terminal-theme.js +0 -148
- package/dist/runtime/terminal-theme.js.map +0 -1
- package/dist/types/chat.d.ts +0 -29
- package/dist/types/chat.d.ts.map +0 -1
- package/dist/types/chat.js +0 -1
- package/dist/types/chat.js.map +0 -1
- package/dist/types/message-content.d.ts +0 -38
- package/dist/types/message-content.d.ts.map +0 -1
- package/dist/types/message-content.js +0 -1
- package/dist/types/message-content.js.map +0 -1
- package/dist/ui/open-code-theme.d.ts +0 -58
- package/dist/ui/open-code-theme.d.ts.map +0 -1
- package/dist/ui/open-code-theme.js +0 -113
- package/dist/ui/open-code-theme.js.map +0 -1
- package/dist/ui/opencode-markdown.d.ts +0 -7
- package/dist/ui/opencode-markdown.d.ts.map +0 -1
- package/dist/ui/opencode-markdown.js +0 -169
- package/dist/ui/opencode-markdown.js.map +0 -1
- package/dist/ui/theme.d.ts +0 -68
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -80
- package/dist/ui/theme.js.map +0 -1
- package/dist/utils/time.d.ts +0 -2
- package/dist/utils/time.d.ts.map +0 -1
- package/dist/utils/time.js +0 -7
- package/dist/utils/time.js.map +0 -1
package/dist/App.js
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
|
|
2
|
-
import { TextAttributes } from '@opentui/core';
|
|
3
|
-
import { useKeyboard, useRenderer, useTerminalDimensions } from '@opentui/react';
|
|
4
|
-
import { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import { resolveSlashCommand } from './commands/slash-commands.js';
|
|
6
|
-
import { ConversationPanel } from './components/conversation-panel.js';
|
|
7
|
-
import { FilePickerDialog } from './components/file-picker-dialog.js';
|
|
8
|
-
import { ModelPickerDialog } from './components/model-picker-dialog.js';
|
|
9
|
-
import { Prompt } from './components/prompt.js';
|
|
10
|
-
import { ToolConfirmDialog } from './components/tool-confirm-dialog.js';
|
|
11
|
-
import { isMediaSelection } from './files/attachment-capabilities.js';
|
|
12
|
-
import { useAgentChat } from './hooks/use-agent-chat.js';
|
|
13
|
-
import { useFilePicker } from './hooks/use-file-picker.js';
|
|
14
|
-
import { useModelPicker } from './hooks/use-model-picker.js';
|
|
15
|
-
import { requestExit } from './runtime/exit.js';
|
|
16
|
-
import { copyTextToClipboard } from './runtime/clipboard.js';
|
|
17
|
-
import { uiTheme } from './ui/theme.js';
|
|
18
|
-
const appendFileTokens = (currentValue, files) => {
|
|
19
|
-
if (files.length === 0) {
|
|
20
|
-
return currentValue;
|
|
21
|
-
}
|
|
22
|
-
const existingTokens = new Set(currentValue.match(/@\/\S+/g) ?? []);
|
|
23
|
-
const newTokens = files
|
|
24
|
-
.filter(file => !isMediaSelection(file))
|
|
25
|
-
.map(file => `@/${file.relativePath}`)
|
|
26
|
-
.filter(token => !existingTokens.has(token));
|
|
27
|
-
if (newTokens.length === 0) {
|
|
28
|
-
return currentValue;
|
|
29
|
-
}
|
|
30
|
-
const trimmed = currentValue.trimEnd();
|
|
31
|
-
const separator = trimmed.length > 0 ? ' ' : '';
|
|
32
|
-
return `${trimmed}${separator}${newTokens.join(' ')} `;
|
|
33
|
-
};
|
|
34
|
-
export const App = () => {
|
|
35
|
-
const { turns, inputValue, isThinking, modelLabel, contextUsagePercent, pendingToolConfirm, setInputValue, selectedFiles, setSelectedFiles, appendSelectedFiles, submitInput, stopActiveReply, clearInput, resetConversation, setModelLabelDisplay, setToolConfirmSelection, submitToolConfirmSelection, rejectPendingToolConfirm, } = useAgentChat();
|
|
36
|
-
const [slashMenuVisible, setSlashMenuVisible] = useState(false);
|
|
37
|
-
const modelPicker = useModelPicker({
|
|
38
|
-
onModelChanged: setModelLabelDisplay,
|
|
39
|
-
});
|
|
40
|
-
const filePicker = useFilePicker();
|
|
41
|
-
const dimensions = useTerminalDimensions();
|
|
42
|
-
const renderer = useRenderer();
|
|
43
|
-
const [copyToastVisible, setCopyToastVisible] = useState(false);
|
|
44
|
-
const selectionCopyTimeoutRef = useRef(null);
|
|
45
|
-
const copyToastTimeoutRef = useRef(null);
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
const handleSelection = (selection) => {
|
|
48
|
-
const selectedText = selection.getSelectedText();
|
|
49
|
-
if (!selectedText) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (selectionCopyTimeoutRef.current) {
|
|
53
|
-
clearTimeout(selectionCopyTimeoutRef.current);
|
|
54
|
-
}
|
|
55
|
-
selectionCopyTimeoutRef.current = setTimeout(() => {
|
|
56
|
-
void copyTextToClipboard(selectedText, renderer).then(success => {
|
|
57
|
-
if (!success) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
setCopyToastVisible(true);
|
|
61
|
-
if (copyToastTimeoutRef.current) {
|
|
62
|
-
clearTimeout(copyToastTimeoutRef.current);
|
|
63
|
-
}
|
|
64
|
-
copyToastTimeoutRef.current = setTimeout(() => {
|
|
65
|
-
setCopyToastVisible(false);
|
|
66
|
-
copyToastTimeoutRef.current = null;
|
|
67
|
-
}, 1500);
|
|
68
|
-
});
|
|
69
|
-
selectionCopyTimeoutRef.current = null;
|
|
70
|
-
}, 80);
|
|
71
|
-
};
|
|
72
|
-
renderer.on('selection', handleSelection);
|
|
73
|
-
return () => {
|
|
74
|
-
renderer.off('selection', handleSelection);
|
|
75
|
-
if (selectionCopyTimeoutRef.current) {
|
|
76
|
-
clearTimeout(selectionCopyTimeoutRef.current);
|
|
77
|
-
selectionCopyTimeoutRef.current = null;
|
|
78
|
-
}
|
|
79
|
-
if (copyToastTimeoutRef.current) {
|
|
80
|
-
clearTimeout(copyToastTimeoutRef.current);
|
|
81
|
-
copyToastTimeoutRef.current = null;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}, [renderer]);
|
|
85
|
-
const submitWithCommands = () => {
|
|
86
|
-
const command = resolveSlashCommand(inputValue);
|
|
87
|
-
if (command?.action === 'models') {
|
|
88
|
-
setInputValue('');
|
|
89
|
-
modelPicker.open();
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (command?.action === 'files') {
|
|
93
|
-
setInputValue('');
|
|
94
|
-
filePicker.open(selectedFiles);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
submitInput();
|
|
98
|
-
};
|
|
99
|
-
const handleSlashCommandSelect = (command) => {
|
|
100
|
-
if (command.action === 'models') {
|
|
101
|
-
setInputValue('');
|
|
102
|
-
modelPicker.open();
|
|
103
|
-
return true;
|
|
104
|
-
}
|
|
105
|
-
if (command.action === 'files') {
|
|
106
|
-
setInputValue('');
|
|
107
|
-
filePicker.open(selectedFiles);
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
111
|
-
};
|
|
112
|
-
useKeyboard(key => {
|
|
113
|
-
if (key.ctrl && key.name === 'c') {
|
|
114
|
-
requestExit(0);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (modelPicker.visible) {
|
|
118
|
-
if (key.name === 'escape') {
|
|
119
|
-
modelPicker.close();
|
|
120
|
-
}
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
if (filePicker.visible) {
|
|
124
|
-
if (key.name === 'escape') {
|
|
125
|
-
filePicker.close();
|
|
126
|
-
}
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (pendingToolConfirm) {
|
|
130
|
-
if (key.name === 'left' || key.name === 'h') {
|
|
131
|
-
setToolConfirmSelection('approve');
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
if (key.name === 'right' || key.name === 'l') {
|
|
135
|
-
setToolConfirmSelection('deny');
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
if (key.name === 'return' || key.name === 'enter') {
|
|
139
|
-
submitToolConfirmSelection();
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (key.name === 'escape') {
|
|
143
|
-
rejectPendingToolConfirm();
|
|
144
|
-
}
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (key.ctrl && key.name === 'l') {
|
|
148
|
-
resetConversation();
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
if (key.name === 'escape') {
|
|
152
|
-
if (slashMenuVisible) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (isThinking) {
|
|
156
|
-
stopActiveReply();
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
clearInput();
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
return (_jsxs("box", { width: dimensions.width, height: dimensions.height, flexDirection: "column", backgroundColor: uiTheme.bg, paddingTop: uiTheme.layout.appPaddingTop, paddingBottom: uiTheme.layout.appPaddingBottom, paddingLeft: uiTheme.layout.appPaddingX, paddingRight: uiTheme.layout.appPaddingX, children: [_jsx(ConversationPanel, { turns: turns, isThinking: isThinking }), _jsx(Prompt, { isThinking: isThinking, disabled: modelPicker.visible || filePicker.visible || Boolean(pendingToolConfirm), modelLabel: modelLabel, contextUsagePercent: contextUsagePercent, value: inputValue, selectedFiles: selectedFiles, onAddSelectedFiles: appendSelectedFiles, onValueChange: setInputValue, onSlashCommandSelect: handleSlashCommandSelect, onSlashMenuVisibilityChange: setSlashMenuVisible, onSubmit: submitWithCommands }), _jsx(ToolConfirmDialog, { visible: Boolean(pendingToolConfirm), viewportWidth: dimensions.width, viewportHeight: dimensions.height, request: pendingToolConfirm }), _jsx(FilePickerDialog, { visible: filePicker.visible, viewportWidth: dimensions.width, viewportHeight: dimensions.height, loading: filePicker.loading, error: filePicker.error, search: filePicker.search, options: filePicker.options, selectedIndex: filePicker.selectedIndex, selectedPaths: filePicker.selectedPaths, onSearchChange: filePicker.setSearch, onSelectIndex: filePicker.setSelectedIndex, onToggleSelected: filePicker.toggleSelectedIndex, onConfirm: () => {
|
|
163
|
-
const confirmedFiles = filePicker.confirmSelected();
|
|
164
|
-
setSelectedFiles(confirmedFiles);
|
|
165
|
-
setInputValue(appendFileTokens(inputValue, confirmedFiles));
|
|
166
|
-
}, onListKeyDown: filePicker.handleListKeyDown }), _jsx(ModelPickerDialog, { visible: modelPicker.visible, viewportWidth: dimensions.width, viewportHeight: dimensions.height, loading: modelPicker.loading, switching: modelPicker.switching, error: modelPicker.error, search: modelPicker.search, options: modelPicker.options, selectedIndex: modelPicker.selectedIndex, onSearchChange: modelPicker.setSearch, onSelectIndex: modelPicker.setSelectedIndex, onConfirm: () => {
|
|
167
|
-
void modelPicker.confirmSelected();
|
|
168
|
-
}, onListKeyDown: modelPicker.handleListKeyDown }), copyToastVisible ? (_jsxs("box", { position: "absolute", right: 2, top: 1, zIndex: 20, flexDirection: "row", gap: 1, borderColor: uiTheme.divider, borderStyle: "rounded", paddingX: 1, paddingY: 0, children: [_jsx("text", { fg: uiTheme.accent, attributes: TextAttributes.BOLD, children: "\u2713" }), _jsx("text", { fg: uiTheme.text, attributes: TextAttributes.BOLD, children: "Copied" })] })) : null] }));
|
|
169
|
-
};
|
|
170
|
-
//# sourceMappingURL=App.js.map
|
package/dist/App.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAkB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAA+B,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MA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ACP,eAAM,EAAE,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,cAAc,CAAC,IAAI,uBAEhD,IACH,CACP,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* System prompt builder.
|
|
3
|
-
* Combines kimi-cli prompt structure with coding-agent constraints.
|
|
4
|
-
*/
|
|
5
|
-
type SystemPromptOptions = {
|
|
6
|
-
/** Working directory */
|
|
7
|
-
directory: string;
|
|
8
|
-
/** Response language */
|
|
9
|
-
language?: string;
|
|
10
|
-
/** Current datetime */
|
|
11
|
-
currentDateTime?: string;
|
|
12
|
-
/** Sandbox mode */
|
|
13
|
-
sandboxMode?: string;
|
|
14
|
-
/** Network policy */
|
|
15
|
-
networkPolicy?: string;
|
|
16
|
-
/** Runtime tool names */
|
|
17
|
-
runtimeToolNames?: string[];
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Build the complete system prompt.
|
|
21
|
-
*/
|
|
22
|
-
export declare function buildSystemPrompt({ directory, currentDateTime, sandboxMode, networkPolicy, runtimeToolNames, }: SystemPromptOptions): string;
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=system.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../src/agent/prompts/system.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAkMH,KAAK,mBAAmB,GAAG;IACzB,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yBAAyB;IACzB,gBAAgB,CAAC,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,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9E,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,mBAAmB,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,qBAAqB,aAAa,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,oBAAoB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,QAAQ;KACT,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEb,OAAO,GAAG,QAAQ;UACV,qBAAqB,EAAE;UACvB,eAAe;MACnB,CAAC;AACP,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { AgentLoopEvent, AgentStepEvent, AgentStopEvent, AgentToolConfirmEvent, AgentToolResultEvent, AgentToolStreamEvent, AgentToolUseEvent } from './types.js';
|
|
2
|
-
export declare const formatToolConfirmEvent: (event: AgentToolConfirmEvent) => string;
|
|
3
|
-
export declare const formatToolUseEvent: (event: AgentToolUseEvent) => string;
|
|
4
|
-
export declare const formatToolUseEventCode: (event: AgentToolUseEvent) => string;
|
|
5
|
-
export declare const formatToolResultEvent: (event: AgentToolResultEvent) => string;
|
|
6
|
-
export declare const formatToolResultEventCode: (event: AgentToolResultEvent, opts?: {
|
|
7
|
-
suppressOutput?: boolean;
|
|
8
|
-
}) => string;
|
|
9
|
-
export declare const formatStepEvent: (event: AgentStepEvent) => string;
|
|
10
|
-
export declare const formatLoopEvent: (event: AgentLoopEvent) => string;
|
|
11
|
-
export declare const formatStopEvent: (event: AgentStopEvent) => string;
|
|
12
|
-
export declare const formatToolStreamEvent: (event: AgentToolStreamEvent) => {
|
|
13
|
-
note?: string;
|
|
14
|
-
codeChunk?: string;
|
|
15
|
-
segmentKey?: string;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=event-format.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-format.d.ts","sourceRoot":"","sources":["../../../src/agent/runtime/event-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAyLjB,eAAO,MAAM,sBAAsB,GAAI,OAAO,qBAAqB,KAAG,MAIrE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,iBAAiB,KAAG,MAE7D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,OAAO,iBAAiB,KAAG,MAEjE,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,oBAAoB,KAAG,MAEnE,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,OAAO,oBAAoB,EAC3B,OAAO;IAAE,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,KAClC,MAEF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,cAAc,KAAG,MAGvD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,cAAc,KAAG,MAEvD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,cAAc,KAAG,MAKvD,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,OAAO,oBAAoB,KAC1B;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAqB1D,CAAC"}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
const MAX_TOOL_TEXT = 12000;
|
|
2
|
-
const stringify = (value) => {
|
|
3
|
-
if (value === undefined) {
|
|
4
|
-
return '';
|
|
5
|
-
}
|
|
6
|
-
if (typeof value === 'string') {
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
return JSON.stringify(value);
|
|
11
|
-
}
|
|
12
|
-
catch {
|
|
13
|
-
return String(value);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const stringifyPretty = (value) => {
|
|
17
|
-
if (typeof value === 'string') {
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
try {
|
|
21
|
-
return JSON.stringify(value, null, 2);
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
return String(value);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const limitText = (value) => {
|
|
28
|
-
if (value.length <= MAX_TOOL_TEXT) {
|
|
29
|
-
return value;
|
|
30
|
-
}
|
|
31
|
-
return `${value.slice(0, MAX_TOOL_TEXT)}\n... (truncated)`;
|
|
32
|
-
};
|
|
33
|
-
const hasNonEmptyText = (value) => {
|
|
34
|
-
return typeof value === 'string' && value.length > 0;
|
|
35
|
-
};
|
|
36
|
-
const asObject = (value) => {
|
|
37
|
-
if (!value || typeof value !== 'object') {
|
|
38
|
-
return {};
|
|
39
|
-
}
|
|
40
|
-
return value;
|
|
41
|
-
};
|
|
42
|
-
const toToolCall = (value) => {
|
|
43
|
-
const objectValue = asObject(value);
|
|
44
|
-
const functionValue = asObject(objectValue.function);
|
|
45
|
-
return {
|
|
46
|
-
id: typeof objectValue.id === 'string' ? objectValue.id : undefined,
|
|
47
|
-
function: {
|
|
48
|
-
name: typeof functionValue.name === 'string' ? functionValue.name : undefined,
|
|
49
|
-
arguments: typeof functionValue.arguments === 'string' ? functionValue.arguments : undefined,
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
const parseToolArguments = (raw) => {
|
|
54
|
-
if (!raw) {
|
|
55
|
-
return {};
|
|
56
|
-
}
|
|
57
|
-
try {
|
|
58
|
-
const parsed = JSON.parse(raw);
|
|
59
|
-
return asObject(parsed);
|
|
60
|
-
}
|
|
61
|
-
catch {
|
|
62
|
-
return { raw };
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const pickString = (value) => {
|
|
66
|
-
return typeof value === 'string' ? value : undefined;
|
|
67
|
-
};
|
|
68
|
-
const formatToolUseAsCode = (toolCall) => {
|
|
69
|
-
const toolName = toolCall.function?.name ?? 'tool';
|
|
70
|
-
const callId = toolCall.id ?? 'unknown';
|
|
71
|
-
const args = parseToolArguments(toolCall.function?.arguments);
|
|
72
|
-
if (toolName === 'bash') {
|
|
73
|
-
const command = pickString(args.command) ?? '';
|
|
74
|
-
const timeout = args.timeout;
|
|
75
|
-
const lines = [`# Tool: bash (${callId})`, `$ ${command}`];
|
|
76
|
-
if (typeof timeout === 'number') {
|
|
77
|
-
lines.push(`# timeout: ${timeout}ms`);
|
|
78
|
-
}
|
|
79
|
-
return lines.join('\n');
|
|
80
|
-
}
|
|
81
|
-
if (toolName.startsWith('file_')) {
|
|
82
|
-
const path = pickString(args.path);
|
|
83
|
-
const action = pickString(args.action);
|
|
84
|
-
const lines = [`# Tool: ${toolName} (${callId})`];
|
|
85
|
-
if (action) {
|
|
86
|
-
lines.push(`# action: ${action}`);
|
|
87
|
-
}
|
|
88
|
-
if (path) {
|
|
89
|
-
lines.push(`# path: ${path}`);
|
|
90
|
-
}
|
|
91
|
-
const rest = { ...args };
|
|
92
|
-
delete rest.action;
|
|
93
|
-
delete rest.path;
|
|
94
|
-
if (Object.keys(rest).length > 0) {
|
|
95
|
-
lines.push(stringifyPretty(rest));
|
|
96
|
-
}
|
|
97
|
-
return lines.join('\n');
|
|
98
|
-
}
|
|
99
|
-
return [`# Tool: ${toolName} (${callId})`, stringifyPretty(args)].join('\n');
|
|
100
|
-
};
|
|
101
|
-
const omitOutputField = (value) => {
|
|
102
|
-
const cloned = { ...value };
|
|
103
|
-
delete cloned.output;
|
|
104
|
-
delete cloned.summary;
|
|
105
|
-
return cloned;
|
|
106
|
-
};
|
|
107
|
-
const formatToolResultAsCode = (event, opts) => {
|
|
108
|
-
const toolCall = toToolCall(event.toolCall);
|
|
109
|
-
const toolName = toolCall.function?.name ?? 'tool';
|
|
110
|
-
const callId = toolCall.id ?? 'unknown';
|
|
111
|
-
const result = asObject(event.result);
|
|
112
|
-
const data = asObject(result.data);
|
|
113
|
-
const lines = [`# Result: ${toolName} (${callId}) ${result.success ? 'success' : 'error'}`];
|
|
114
|
-
if (result.error) {
|
|
115
|
-
lines.push(result.error);
|
|
116
|
-
}
|
|
117
|
-
const summary = pickString(data.summary);
|
|
118
|
-
const output = pickString(data.output);
|
|
119
|
-
if (!opts?.suppressOutput && hasNonEmptyText(output)) {
|
|
120
|
-
lines.push(output);
|
|
121
|
-
return limitText(lines.join('\n'));
|
|
122
|
-
}
|
|
123
|
-
if (summary) {
|
|
124
|
-
lines.push(summary);
|
|
125
|
-
}
|
|
126
|
-
if (output === '') {
|
|
127
|
-
if (!summary) {
|
|
128
|
-
lines.push('no output');
|
|
129
|
-
}
|
|
130
|
-
return limitText(lines.join('\n'));
|
|
131
|
-
}
|
|
132
|
-
const normalizedData = opts?.suppressOutput ? omitOutputField(data) : data;
|
|
133
|
-
if (Object.keys(normalizedData).length > 0) {
|
|
134
|
-
lines.push(stringifyPretty(normalizedData));
|
|
135
|
-
return limitText(lines.join('\n'));
|
|
136
|
-
}
|
|
137
|
-
if (opts?.suppressOutput && hasNonEmptyText(output)) {
|
|
138
|
-
return limitText(lines.join('\n'));
|
|
139
|
-
}
|
|
140
|
-
const raw = stringifyPretty(event.result);
|
|
141
|
-
if (raw) {
|
|
142
|
-
lines.push(raw);
|
|
143
|
-
}
|
|
144
|
-
return limitText(lines.join('\n'));
|
|
145
|
-
};
|
|
146
|
-
export const formatToolConfirmEvent = (event) => {
|
|
147
|
-
const reason = event.reason ? ` reason=${event.reason}` : '';
|
|
148
|
-
const args = stringify(event.args);
|
|
149
|
-
return `[tool-confirm:${event.toolName}:${event.toolCallId}]${reason} args=${args}`;
|
|
150
|
-
};
|
|
151
|
-
export const formatToolUseEvent = (event) => {
|
|
152
|
-
return `[tool-use] ${stringify(event)}`;
|
|
153
|
-
};
|
|
154
|
-
export const formatToolUseEventCode = (event) => {
|
|
155
|
-
return formatToolUseAsCode(toToolCall(event));
|
|
156
|
-
};
|
|
157
|
-
export const formatToolResultEvent = (event) => {
|
|
158
|
-
return `[tool-result] ${stringify(event)}`;
|
|
159
|
-
};
|
|
160
|
-
export const formatToolResultEventCode = (event, opts) => {
|
|
161
|
-
return formatToolResultAsCode(event, opts);
|
|
162
|
-
};
|
|
163
|
-
export const formatStepEvent = (event) => {
|
|
164
|
-
const finish = event.finishReason ?? 'unknown';
|
|
165
|
-
return `[step] index=${event.stepIndex} finishReason=${finish} toolCalls=${event.toolCallsCount}`;
|
|
166
|
-
};
|
|
167
|
-
export const formatLoopEvent = (event) => {
|
|
168
|
-
return `[loop] index=${event.loopIndex} steps=${event.steps}`;
|
|
169
|
-
};
|
|
170
|
-
export const formatStopEvent = (event) => {
|
|
171
|
-
if (event.message) {
|
|
172
|
-
return `[stop] reason=${event.reason} message=${event.message}`;
|
|
173
|
-
}
|
|
174
|
-
return `[stop] reason=${event.reason}`;
|
|
175
|
-
};
|
|
176
|
-
export const formatToolStreamEvent = (event) => {
|
|
177
|
-
const prefix = `[tool:${event.toolName}:${event.toolCallId}:${event.type}#${event.sequence}]`;
|
|
178
|
-
if (event.type === 'stdout' || event.type === 'stderr') {
|
|
179
|
-
const channel = event.type === 'stderr' ? 'stderr' : 'stdout';
|
|
180
|
-
const chunk = event.content ?? '';
|
|
181
|
-
return {
|
|
182
|
-
codeChunk: chunk.endsWith('\n') ? chunk : `${chunk}\n`,
|
|
183
|
-
segmentKey: `${event.toolCallId}:${channel}`,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
if (event.content) {
|
|
187
|
-
return { note: `${prefix} ${event.content}` };
|
|
188
|
-
}
|
|
189
|
-
if (event.data !== undefined) {
|
|
190
|
-
return { note: `${prefix} ${stringify(event.data)}` };
|
|
191
|
-
}
|
|
192
|
-
return { note: prefix };
|
|
193
|
-
};
|
|
194
|
-
//# sourceMappingURL=event-format.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event-format.js","sourceRoot":"","sources":["../../../src/agent/runtime/event-format.ts"],"names":[],"mappings":"AAUA,MAAM,aAAa,GAAG,KAAK,CAAC;AAE5B,MAAM,SAAS,GAAG,CAAC,KAAc,EAAU,EAAE;IAC3C,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAc,EAAU,EAAE;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1C,IAAI,KAAK,CAAC,MAAM,IAAI,aAAa,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,mBAAmB,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAc,EAAmB,EAAE;IAC1D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OAAO,IAAI,EAAE,CAAC;QAClC,OAAO;YACL,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI;YACtD,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,IAAI,OAAO,EAAE;SAC7C,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACxD,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type AgentModelOption = {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
provider: string;
|
|
5
|
-
apiKeyEnv: string;
|
|
6
|
-
configured: boolean;
|
|
7
|
-
current: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type AgentModelSwitchResult = {
|
|
10
|
-
modelId: string;
|
|
11
|
-
modelLabel: string;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=model-types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-types.d.ts","sourceRoot":"","sources":["../../../src/agent/runtime/model-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=model-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-types.js","sourceRoot":"","sources":["../../../src/agent/runtime/model-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { AgentEventHandlers, AgentRunResult } from './types.js';
|
|
2
|
-
import type { AgentModelOption, AgentModelSwitchResult } from './model-types.js';
|
|
3
|
-
import type { AttachmentModelCapabilities } from '../../files/attachment-capabilities.js';
|
|
4
|
-
import type { MessageContent } from '../../types/message-content.js';
|
|
5
|
-
type RunAgentPromptOptions = {
|
|
6
|
-
abortSignal?: AbortSignal;
|
|
7
|
-
};
|
|
8
|
-
export declare const runAgentPrompt: (prompt: MessageContent, handlers: AgentEventHandlers, options?: RunAgentPromptOptions) => Promise<AgentRunResult>;
|
|
9
|
-
export declare const getAgentModelLabel: () => Promise<string>;
|
|
10
|
-
export declare const getAgentModelAttachmentCapabilities: () => Promise<AttachmentModelCapabilities>;
|
|
11
|
-
export declare const getAgentModelId: () => Promise<string>;
|
|
12
|
-
export declare const listAgentModels: () => Promise<AgentModelOption[]>;
|
|
13
|
-
export declare const switchAgentModel: (modelId: string) => Promise<AgentModelSwitchResult>;
|
|
14
|
-
export declare const disposeAgentRuntime: () => Promise<void>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/agent/runtime/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,kBAAkB,EAElB,cAAc,EASf,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAmB9E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAEvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAkBlE,KAAK,qBAAqB,GAAG;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAghBF,eAAO,MAAM,cAAc,GACzB,QAAQ,cAAc,EACtB,UAAU,kBAAkB,EAC5B,UAAS,qBAA0B,KAClC,OAAO,CAAC,cAAc,CAwNxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAa,OAAO,CAAC,MAAM,CAGzD,CAAC;AAEF,eAAO,MAAM,mCAAmC,QACpC,OAAO,CAAC,2BAA2B,CAK5C,CAAC;AAEJ,eAAO,MAAM,eAAe,QAAa,OAAO,CAAC,MAAM,CAStD,CAAC;AAEF,eAAO,MAAM,eAAe,QAAa,OAAO,CAAC,gBAAgB,EAAE,CAyBlE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,sBAAsB,CAkBtF,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAa,OAAO,CAAC,IAAI,CAGxD,CAAC"}
|