@qlingzzy/qling 1.0.0
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/CHANGELOG.md +122 -0
- package/LICENSE +21 -0
- package/README.en.md +129 -0
- package/README.md +416 -0
- package/dist/agent/subtask.d.ts +21 -0
- package/dist/agent/subtask.d.ts.map +1 -0
- package/dist/agent/subtask.js +55 -0
- package/dist/agent-loop.d.ts +151 -0
- package/dist/agent-loop.d.ts.map +1 -0
- package/dist/agent-loop.js +1498 -0
- package/dist/agents/isolation-policy.d.ts +14 -0
- package/dist/agents/isolation-policy.d.ts.map +1 -0
- package/dist/agents/isolation-policy.js +52 -0
- package/dist/channels/console-channel.d.ts +15 -0
- package/dist/channels/console-channel.d.ts.map +1 -0
- package/dist/channels/console-channel.js +66 -0
- package/dist/channels/registry.d.ts +10 -0
- package/dist/channels/registry.d.ts.map +1 -0
- package/dist/channels/registry.js +25 -0
- package/dist/channels/slack-channel.d.ts +35 -0
- package/dist/channels/slack-channel.d.ts.map +1 -0
- package/dist/channels/slack-channel.js +232 -0
- package/dist/channels/telegram-channel.d.ts +32 -0
- package/dist/channels/telegram-channel.d.ts.map +1 -0
- package/dist/channels/telegram-channel.js +167 -0
- package/dist/channels/types.d.ts +31 -0
- package/dist/channels/types.d.ts.map +1 -0
- package/dist/channels/types.js +4 -0
- package/dist/cli/bootstrap.d.ts +39 -0
- package/dist/cli/bootstrap.d.ts.map +1 -0
- package/dist/cli/bootstrap.js +138 -0
- package/dist/cli/channel-bootstrap.d.ts +23 -0
- package/dist/cli/channel-bootstrap.d.ts.map +1 -0
- package/dist/cli/channel-bootstrap.js +46 -0
- package/dist/cli/daemon-control.d.ts +31 -0
- package/dist/cli/daemon-control.d.ts.map +1 -0
- package/dist/cli/daemon-control.js +177 -0
- package/dist/cli/guidance-panel.d.ts +11 -0
- package/dist/cli/guidance-panel.d.ts.map +1 -0
- package/dist/cli/guidance-panel.js +16 -0
- package/dist/cli/mcp-control.d.ts +7 -0
- package/dist/cli/mcp-control.d.ts.map +1 -0
- package/dist/cli/mcp-control.js +119 -0
- package/dist/cli/mission-views.d.ts +13 -0
- package/dist/cli/mission-views.d.ts.map +1 -0
- package/dist/cli/mission-views.js +82 -0
- package/dist/cli/setup.d.ts +9 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +140 -0
- package/dist/cli/startup-contract.d.ts +23 -0
- package/dist/cli/startup-contract.d.ts.map +1 -0
- package/dist/cli/startup-contract.js +694 -0
- package/dist/commands/agents.d.ts +3 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +44 -0
- package/dist/commands/checkpoint.d.ts +3 -0
- package/dist/commands/checkpoint.d.ts.map +1 -0
- package/dist/commands/checkpoint.js +52 -0
- package/dist/commands/claude-style.d.ts +12 -0
- package/dist/commands/claude-style.d.ts.map +1 -0
- package/dist/commands/claude-style.js +560 -0
- package/dist/commands/clear.d.ts +3 -0
- package/dist/commands/clear.d.ts.map +1 -0
- package/dist/commands/clear.js +20 -0
- package/dist/commands/compact.d.ts +3 -0
- package/dist/commands/compact.d.ts.map +1 -0
- package/dist/commands/compact.js +23 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +22 -0
- package/dist/commands/connect.d.ts +3 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +102 -0
- package/dist/commands/context.d.ts +3 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +13 -0
- package/dist/commands/dashboard.d.ts +3 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +22 -0
- package/dist/commands/detach.d.ts +3 -0
- package/dist/commands/detach.d.ts.map +1 -0
- package/dist/commands/detach.js +44 -0
- package/dist/commands/distill.d.ts +3 -0
- package/dist/commands/distill.d.ts.map +1 -0
- package/dist/commands/distill.js +23 -0
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +13 -0
- package/dist/commands/dream.d.ts +3 -0
- package/dist/commands/dream.d.ts.map +1 -0
- package/dist/commands/dream.js +59 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +18 -0
- package/dist/commands/exports.d.ts +3 -0
- package/dist/commands/exports.d.ts.map +1 -0
- package/dist/commands/exports.js +15 -0
- package/dist/commands/goal.d.ts +3 -0
- package/dist/commands/goal.d.ts.map +1 -0
- package/dist/commands/goal.js +147 -0
- package/dist/commands/help.d.ts +4 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +75 -0
- package/dist/commands/hooks.d.ts +3 -0
- package/dist/commands/hooks.d.ts.map +1 -0
- package/dist/commands/hooks.js +14 -0
- package/dist/commands/index.d.ts +29 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +417 -0
- package/dist/commands/knowledge.d.ts +8 -0
- package/dist/commands/knowledge.d.ts.map +1 -0
- package/dist/commands/knowledge.js +191 -0
- package/dist/commands/loop.d.ts +3 -0
- package/dist/commands/loop.d.ts.map +1 -0
- package/dist/commands/loop.js +138 -0
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +57 -0
- package/dist/commands/memory.d.ts +3 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +215 -0
- package/dist/commands/mission.d.ts +3 -0
- package/dist/commands/mission.d.ts.map +1 -0
- package/dist/commands/mission.js +129 -0
- package/dist/commands/permissions.d.ts +3 -0
- package/dist/commands/permissions.d.ts.map +1 -0
- package/dist/commands/permissions.js +82 -0
- package/dist/commands/privacy.d.ts +3 -0
- package/dist/commands/privacy.d.ts.map +1 -0
- package/dist/commands/privacy.js +13 -0
- package/dist/commands/recap.d.ts +3 -0
- package/dist/commands/recap.d.ts.map +1 -0
- package/dist/commands/recap.js +11 -0
- package/dist/commands/repomap.d.ts +3 -0
- package/dist/commands/repomap.d.ts.map +1 -0
- package/dist/commands/repomap.js +146 -0
- package/dist/commands/resume.d.ts +3 -0
- package/dist/commands/resume.d.ts.map +1 -0
- package/dist/commands/resume.js +42 -0
- package/dist/commands/runtime.d.ts +61 -0
- package/dist/commands/runtime.d.ts.map +1 -0
- package/dist/commands/runtime.js +20 -0
- package/dist/commands/sessions.d.ts +3 -0
- package/dist/commands/sessions.d.ts.map +1 -0
- package/dist/commands/sessions.js +34 -0
- package/dist/commands/shortcuts.d.ts +3 -0
- package/dist/commands/shortcuts.d.ts.map +1 -0
- package/dist/commands/shortcuts.js +12 -0
- package/dist/commands/skill.d.ts +3 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +20 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +31 -0
- package/dist/commands/statusline.d.ts +3 -0
- package/dist/commands/statusline.d.ts.map +1 -0
- package/dist/commands/statusline.js +40 -0
- package/dist/commands/storage.d.ts +3 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +122 -0
- package/dist/commands/tasks.d.ts +3 -0
- package/dist/commands/tasks.d.ts.map +1 -0
- package/dist/commands/tasks.js +117 -0
- package/dist/commands/types.d.ts +14 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +1 -0
- package/dist/commands/verify.d.ts +3 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +86 -0
- package/dist/config-report.d.ts +35 -0
- package/dist/config-report.d.ts.map +1 -0
- package/dist/config-report.js +100 -0
- package/dist/config.d.ts +217 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +690 -0
- package/dist/context-compactor.d.ts +27 -0
- package/dist/context-compactor.d.ts.map +1 -0
- package/dist/context-compactor.js +489 -0
- package/dist/context-report.d.ts +35 -0
- package/dist/context-report.d.ts.map +1 -0
- package/dist/context-report.js +172 -0
- package/dist/daemon.d.ts +2 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +316 -0
- package/dist/dashboard-server.d.ts +18 -0
- package/dist/dashboard-server.d.ts.map +1 -0
- package/dist/dashboard-server.js +325 -0
- package/dist/discovery-registry.d.ts +28 -0
- package/dist/discovery-registry.d.ts.map +1 -0
- package/dist/discovery-registry.js +106 -0
- package/dist/discovery-types.d.ts +54 -0
- package/dist/discovery-types.d.ts.map +1 -0
- package/dist/discovery-types.js +5 -0
- package/dist/doctor.d.ts +31 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +343 -0
- package/dist/eval/runner.d.ts +10 -0
- package/dist/eval/runner.d.ts.map +1 -0
- package/dist/eval/runner.js +78 -0
- package/dist/eval/tasks.d.ts +3 -0
- package/dist/eval/tasks.d.ts.map +1 -0
- package/dist/eval/tasks.js +179 -0
- package/dist/eval/types.d.ts +31 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +4 -0
- package/dist/git/auto-commit.d.ts +28 -0
- package/dist/git/auto-commit.d.ts.map +1 -0
- package/dist/git/auto-commit.js +112 -0
- package/dist/guard/approval.d.ts +16 -0
- package/dist/guard/approval.d.ts.map +1 -0
- package/dist/guard/approval.js +68 -0
- package/dist/guard/content-filter.d.ts +15 -0
- package/dist/guard/content-filter.d.ts.map +1 -0
- package/dist/guard/content-filter.js +102 -0
- package/dist/guard/permissions.d.ts +17 -0
- package/dist/guard/permissions.d.ts.map +1 -0
- package/dist/guard/permissions.js +54 -0
- package/dist/guard/rate-limit.d.ts +14 -0
- package/dist/guard/rate-limit.d.ts.map +1 -0
- package/dist/guard/rate-limit.js +47 -0
- package/dist/guard.d.ts +21 -0
- package/dist/guard.d.ts.map +1 -0
- package/dist/guard.js +144 -0
- package/dist/help-topics.d.ts +19 -0
- package/dist/help-topics.d.ts.map +1 -0
- package/dist/help-topics.js +391 -0
- package/dist/hooks-report.d.ts +23 -0
- package/dist/hooks-report.d.ts.map +1 -0
- package/dist/hooks-report.js +44 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +4 -0
- package/dist/i18n/zh-cn.d.ts +180 -0
- package/dist/i18n/zh-cn.d.ts.map +1 -0
- package/dist/i18n/zh-cn.js +184 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1157 -0
- package/dist/knowledge-agent.d.ts +47 -0
- package/dist/knowledge-agent.d.ts.map +1 -0
- package/dist/knowledge-agent.js +320 -0
- package/dist/local-status-report.d.ts +23 -0
- package/dist/local-status-report.d.ts.map +1 -0
- package/dist/local-status-report.js +63 -0
- package/dist/local-storage-report.d.ts +32 -0
- package/dist/local-storage-report.d.ts.map +1 -0
- package/dist/local-storage-report.js +171 -0
- package/dist/mcp/bridge.d.ts +11 -0
- package/dist/mcp/bridge.d.ts.map +1 -0
- package/dist/mcp/bridge.js +37 -0
- package/dist/mcp/client.d.ts +26 -0
- package/dist/mcp/client.d.ts.map +1 -0
- package/dist/mcp/client.js +209 -0
- package/dist/mcp/http-transport.d.ts +21 -0
- package/dist/mcp/http-transport.d.ts.map +1 -0
- package/dist/mcp/http-transport.js +126 -0
- package/dist/mcp/presets.d.ts +22 -0
- package/dist/mcp/presets.d.ts.map +1 -0
- package/dist/mcp/presets.js +80 -0
- package/dist/mcp/registry.d.ts +23 -0
- package/dist/mcp/registry.d.ts.map +1 -0
- package/dist/mcp/registry.js +85 -0
- package/dist/mcp/stdio-transport.d.ts +25 -0
- package/dist/mcp/stdio-transport.d.ts.map +1 -0
- package/dist/mcp/stdio-transport.js +92 -0
- package/dist/mcp/store.d.ts +41 -0
- package/dist/mcp/store.d.ts.map +1 -0
- package/dist/mcp/store.js +100 -0
- package/dist/mcp/types.d.ts +40 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +4 -0
- package/dist/mcp-report.d.ts +30 -0
- package/dist/mcp-report.d.ts.map +1 -0
- package/dist/mcp-report.js +104 -0
- package/dist/memory/cognitive-index.d.ts +56 -0
- package/dist/memory/cognitive-index.d.ts.map +1 -0
- package/dist/memory/cognitive-index.js +265 -0
- package/dist/memory/compactor.d.ts +28 -0
- package/dist/memory/compactor.d.ts.map +1 -0
- package/dist/memory/compactor.js +92 -0
- package/dist/memory/consolidation.d.ts +13 -0
- package/dist/memory/consolidation.d.ts.map +1 -0
- package/dist/memory/consolidation.js +77 -0
- package/dist/memory/embedding.d.ts +15 -0
- package/dist/memory/embedding.d.ts.map +1 -0
- package/dist/memory/embedding.js +59 -0
- package/dist/memory/memory-llm-dream.d.ts +3 -0
- package/dist/memory/memory-llm-dream.d.ts.map +1 -0
- package/dist/memory/memory-llm-dream.js +59 -0
- package/dist/memory/projection-worker.d.ts +30 -0
- package/dist/memory/projection-worker.d.ts.map +1 -0
- package/dist/memory/projection-worker.js +92 -0
- package/dist/memory/semantic-index.d.ts +18 -0
- package/dist/memory/semantic-index.d.ts.map +1 -0
- package/dist/memory/semantic-index.js +86 -0
- package/dist/memory/wal.d.ts +33 -0
- package/dist/memory/wal.d.ts.map +1 -0
- package/dist/memory/wal.js +131 -0
- package/dist/memory-report.d.ts +120 -0
- package/dist/memory-report.d.ts.map +1 -0
- package/dist/memory-report.js +726 -0
- package/dist/memory.d.ts +149 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/memory.js +632 -0
- package/dist/metrics/agent-telemetry.d.ts +14 -0
- package/dist/metrics/agent-telemetry.d.ts.map +1 -0
- package/dist/metrics/agent-telemetry.js +44 -0
- package/dist/metrics/collector.d.ts +17 -0
- package/dist/metrics/collector.d.ts.map +1 -0
- package/dist/metrics/collector.js +137 -0
- package/dist/metrics/types.d.ts +14 -0
- package/dist/metrics/types.d.ts.map +1 -0
- package/dist/metrics/types.js +4 -0
- package/dist/mission/manager.d.ts +28 -0
- package/dist/mission/manager.d.ts.map +1 -0
- package/dist/mission/manager.js +208 -0
- package/dist/mission/types.d.ts +37 -0
- package/dist/mission/types.d.ts.map +1 -0
- package/dist/mission/types.js +5 -0
- package/dist/onboarding/tutorial.d.ts +33 -0
- package/dist/onboarding/tutorial.d.ts.map +1 -0
- package/dist/onboarding/tutorial.js +96 -0
- package/dist/output-style.d.ts +14 -0
- package/dist/output-style.d.ts.map +1 -0
- package/dist/output-style.js +29 -0
- package/dist/package-version.d.ts +12 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +42 -0
- package/dist/permissions-report.d.ts +42 -0
- package/dist/permissions-report.d.ts.map +1 -0
- package/dist/permissions-report.js +120 -0
- package/dist/pipeline/consistency-checker.d.ts +8 -0
- package/dist/pipeline/consistency-checker.d.ts.map +1 -0
- package/dist/pipeline/consistency-checker.js +40 -0
- package/dist/pipeline/example-generator.d.ts +4 -0
- package/dist/pipeline/example-generator.d.ts.map +1 -0
- package/dist/pipeline/example-generator.js +64 -0
- package/dist/pipeline/hooks.d.ts +68 -0
- package/dist/pipeline/hooks.d.ts.map +1 -0
- package/dist/pipeline/hooks.js +377 -0
- package/dist/pipeline/sections.d.ts +41 -0
- package/dist/pipeline/sections.d.ts.map +1 -0
- package/dist/pipeline/sections.js +244 -0
- package/dist/pipeline/verification.d.ts +12 -0
- package/dist/pipeline/verification.d.ts.map +1 -0
- package/dist/pipeline/verification.js +138 -0
- package/dist/privacy-report.d.ts +24 -0
- package/dist/privacy-report.d.ts.map +1 -0
- package/dist/privacy-report.js +78 -0
- package/dist/providers/presets.d.ts +25 -0
- package/dist/providers/presets.d.ts.map +1 -0
- package/dist/providers/presets.js +205 -0
- package/dist/recap.d.ts +38 -0
- package/dist/recap.d.ts.map +1 -0
- package/dist/recap.js +154 -0
- package/dist/repl.d.ts +41 -0
- package/dist/repl.d.ts.map +1 -0
- package/dist/repl.js +396 -0
- package/dist/runtime-paths.d.ts +32 -0
- package/dist/runtime-paths.d.ts.map +1 -0
- package/dist/runtime-paths.js +134 -0
- package/dist/sdk.d.ts +12 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +18 -0
- package/dist/session/daemon-session-api.d.ts +22 -0
- package/dist/session/daemon-session-api.d.ts.map +1 -0
- package/dist/session/daemon-session-api.js +48 -0
- package/dist/session/durable-session-supervisor.d.ts +24 -0
- package/dist/session/durable-session-supervisor.d.ts.map +1 -0
- package/dist/session/durable-session-supervisor.js +195 -0
- package/dist/session/goal-controller.d.ts +43 -0
- package/dist/session/goal-controller.d.ts.map +1 -0
- package/dist/session/goal-controller.js +77 -0
- package/dist/session/goal-evaluator.d.ts +29 -0
- package/dist/session/goal-evaluator.d.ts.map +1 -0
- package/dist/session/goal-evaluator.js +100 -0
- package/dist/session/loop-prompt.d.ts +14 -0
- package/dist/session/loop-prompt.d.ts.map +1 -0
- package/dist/session/loop-prompt.js +49 -0
- package/dist/session/session-goal-manager.d.ts +51 -0
- package/dist/session/session-goal-manager.d.ts.map +1 -0
- package/dist/session/session-goal-manager.js +118 -0
- package/dist/session/session-registry.d.ts +40 -0
- package/dist/session/session-registry.d.ts.map +1 -0
- package/dist/session/session-registry.js +124 -0
- package/dist/session/session-scheduler.d.ts +59 -0
- package/dist/session/session-scheduler.d.ts.map +1 -0
- package/dist/session/session-scheduler.js +170 -0
- package/dist/session-checkpoint-report.d.ts +22 -0
- package/dist/session-checkpoint-report.d.ts.map +1 -0
- package/dist/session-checkpoint-report.js +99 -0
- package/dist/session-export-index.d.ts +23 -0
- package/dist/session-export-index.d.ts.map +1 -0
- package/dist/session-export-index.js +96 -0
- package/dist/session-export.d.ts +28 -0
- package/dist/session-export.d.ts.map +1 -0
- package/dist/session-export.js +99 -0
- package/dist/session-goal-report.d.ts +37 -0
- package/dist/session-goal-report.d.ts.map +1 -0
- package/dist/session-goal-report.js +219 -0
- package/dist/session-list-report.d.ts +16 -0
- package/dist/session-list-report.d.ts.map +1 -0
- package/dist/session-list-report.js +60 -0
- package/dist/session-task-report.d.ts +23 -0
- package/dist/session-task-report.d.ts.map +1 -0
- package/dist/session-task-report.js +183 -0
- package/dist/shortcuts.d.ts +2 -0
- package/dist/shortcuts.d.ts.map +1 -0
- package/dist/shortcuts.js +32 -0
- package/dist/skills/registry.d.ts +8 -0
- package/dist/skills/registry.d.ts.map +1 -0
- package/dist/skills/registry.js +119 -0
- package/dist/skills/types.d.ts +7 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +4 -0
- package/dist/statusline.d.ts +37 -0
- package/dist/statusline.d.ts.map +1 -0
- package/dist/statusline.js +207 -0
- package/dist/tools/bash.d.ts +10 -0
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +278 -0
- package/dist/tools/browser-fetch.d.ts +7 -0
- package/dist/tools/browser-fetch.d.ts.map +1 -0
- package/dist/tools/browser-fetch.js +133 -0
- package/dist/tools/error-utils.d.ts +9 -0
- package/dist/tools/error-utils.d.ts.map +1 -0
- package/dist/tools/error-utils.js +35 -0
- package/dist/tools/index.d.ts +27 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +86 -0
- package/dist/tools/patch.d.ts +22 -0
- package/dist/tools/patch.d.ts.map +1 -0
- package/dist/tools/patch.js +458 -0
- package/dist/tools/planner.d.ts +7 -0
- package/dist/tools/planner.d.ts.map +1 -0
- package/dist/tools/planner.js +148 -0
- package/dist/tools/read.d.ts +8 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +114 -0
- package/dist/tools/search.d.ts +11 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +636 -0
- package/dist/tools/skill.d.ts +8 -0
- package/dist/tools/skill.d.ts.map +1 -0
- package/dist/tools/skill.js +181 -0
- package/dist/tools/subtask.d.ts +9 -0
- package/dist/tools/subtask.d.ts.map +1 -0
- package/dist/tools/subtask.js +120 -0
- package/dist/tools/todo.d.ts +8 -0
- package/dist/tools/todo.d.ts.map +1 -0
- package/dist/tools/todo.js +170 -0
- package/dist/tools/url-fetch.d.ts +11 -0
- package/dist/tools/url-fetch.d.ts.map +1 -0
- package/dist/tools/url-fetch.js +208 -0
- package/dist/tools/vision-analyze.d.ts +9 -0
- package/dist/tools/vision-analyze.d.ts.map +1 -0
- package/dist/tools/vision-analyze.js +179 -0
- package/dist/tools/write.d.ts +7 -0
- package/dist/tools/write.d.ts.map +1 -0
- package/dist/tools/write.js +128 -0
- package/dist/tui/chrome.d.ts +7 -0
- package/dist/tui/chrome.d.ts.map +1 -0
- package/dist/tui/chrome.js +22 -0
- package/dist/tui/input-buffer.d.ts +37 -0
- package/dist/tui/input-buffer.d.ts.map +1 -0
- package/dist/tui/input-buffer.js +228 -0
- package/dist/tui/input-history.d.ts +11 -0
- package/dist/tui/input-history.d.ts.map +1 -0
- package/dist/tui/input-history.js +69 -0
- package/dist/tui/input-queue.d.ts +27 -0
- package/dist/tui/input-queue.d.ts.map +1 -0
- package/dist/tui/input-queue.js +85 -0
- package/dist/tui/markdown.d.ts +10 -0
- package/dist/tui/markdown.d.ts.map +1 -0
- package/dist/tui/markdown.js +396 -0
- package/dist/tui/progress.d.ts +3 -0
- package/dist/tui/progress.d.ts.map +1 -0
- package/dist/tui/progress.js +13 -0
- package/dist/tui/shell.d.ts +67 -0
- package/dist/tui/shell.d.ts.map +1 -0
- package/dist/tui/shell.js +271 -0
- package/dist/tui/streaming-repl.d.ts +39 -0
- package/dist/tui/streaming-repl.d.ts.map +1 -0
- package/dist/tui/streaming-repl.js +460 -0
- package/dist/tui/streaming-tui.d.ts +174 -0
- package/dist/tui/streaming-tui.d.ts.map +1 -0
- package/dist/tui/streaming-tui.js +1049 -0
- package/dist/types.d.ts +221 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +37 -0
- package/dist/utils/symbol-extractor.d.ts +8 -0
- package/dist/utils/symbol-extractor.d.ts.map +1 -0
- package/dist/utils/symbol-extractor.js +190 -0
- package/dist/workflow-runtime.d.ts +45 -0
- package/dist/workflow-runtime.d.ts.map +1 -0
- package/dist/workflow-runtime.js +146 -0
- package/dist/workflow-types.d.ts +73 -0
- package/dist/workflow-types.d.ts.map +1 -0
- package/dist/workflow-types.js +34 -0
- package/docs/docker.md +66 -0
- package/docs/install.md +159 -0
- package/docs/sdk.md +67 -0
- package/docs/skills.md +51 -0
- package/package.json +102 -0
- package/scripts/bootstrap.mjs +63 -0
- package/scripts/check_image.ps1 +18 -0
- package/scripts/clean-dist.mjs +18 -0
- package/scripts/copy_image.ps1 +5 -0
- package/scripts/eval-smoke.mjs +17 -0
- package/skills/examples/repo-triage/SKILL.md +50 -0
- package/skills/qling.md +42 -0
- package/skills/templates/SKILL.md +37 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
export class InputBuffer {
|
|
2
|
+
value = "";
|
|
3
|
+
cursorPos = 0;
|
|
4
|
+
history = [];
|
|
5
|
+
historyIdx = -1;
|
|
6
|
+
historyDraft = null;
|
|
7
|
+
historyDraftCursorPos = 0;
|
|
8
|
+
constructor(initialHistory = []) {
|
|
9
|
+
this.setHistory(initialHistory);
|
|
10
|
+
}
|
|
11
|
+
setHistory(entries) {
|
|
12
|
+
this.history = entries.filter((entry) => typeof entry === "string" && entry.trim()).map((entry) => entry.trim());
|
|
13
|
+
this.historyIdx = this.history.length;
|
|
14
|
+
this.clearHistoryDraft();
|
|
15
|
+
}
|
|
16
|
+
getHistory() {
|
|
17
|
+
return [...this.history];
|
|
18
|
+
}
|
|
19
|
+
insertChar(ch) {
|
|
20
|
+
this.value = this.value.slice(0, this.cursorPos) + ch + this.value.slice(this.cursorPos);
|
|
21
|
+
this.cursorPos += ch.length;
|
|
22
|
+
}
|
|
23
|
+
insertNewline() {
|
|
24
|
+
this.insertChar("\n");
|
|
25
|
+
}
|
|
26
|
+
backspace() {
|
|
27
|
+
if (this.cursorPos <= 0)
|
|
28
|
+
return;
|
|
29
|
+
this.value = this.value.slice(0, this.cursorPos - 1) + this.value.slice(this.cursorPos);
|
|
30
|
+
this.cursorPos--;
|
|
31
|
+
}
|
|
32
|
+
moveLeft() {
|
|
33
|
+
if (this.cursorPos > 0) {
|
|
34
|
+
this.cursorPos--;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
moveRight() {
|
|
38
|
+
if (this.cursorPos < this.value.length) {
|
|
39
|
+
this.cursorPos++;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
moveWordLeft() {
|
|
43
|
+
if (this.cursorPos <= 0)
|
|
44
|
+
return;
|
|
45
|
+
let nextPos = this.cursorPos;
|
|
46
|
+
while (nextPos > 0 && /\s/.test(this.value[nextPos - 1] ?? "")) {
|
|
47
|
+
nextPos--;
|
|
48
|
+
}
|
|
49
|
+
while (nextPos > 0 && !/\s/.test(this.value[nextPos - 1] ?? "")) {
|
|
50
|
+
nextPos--;
|
|
51
|
+
}
|
|
52
|
+
this.cursorPos = nextPos;
|
|
53
|
+
}
|
|
54
|
+
moveWordRight() {
|
|
55
|
+
if (this.cursorPos >= this.value.length)
|
|
56
|
+
return;
|
|
57
|
+
let nextPos = this.cursorPos;
|
|
58
|
+
while (nextPos < this.value.length && !/\s/.test(this.value[nextPos] ?? "")) {
|
|
59
|
+
nextPos++;
|
|
60
|
+
}
|
|
61
|
+
while (nextPos < this.value.length && /\s/.test(this.value[nextPos] ?? "")) {
|
|
62
|
+
nextPos++;
|
|
63
|
+
}
|
|
64
|
+
this.cursorPos = nextPos;
|
|
65
|
+
}
|
|
66
|
+
moveLineUp() {
|
|
67
|
+
const position = this.getLinePosition();
|
|
68
|
+
if (position.lineIndex <= 0)
|
|
69
|
+
return;
|
|
70
|
+
const targetLine = position.lines[position.lineIndex - 1] ?? "";
|
|
71
|
+
const targetColumn = Math.min(position.column, targetLine.length);
|
|
72
|
+
this.cursorPos = position.lineStartOffsets[position.lineIndex - 1] + targetColumn;
|
|
73
|
+
}
|
|
74
|
+
moveLineDown() {
|
|
75
|
+
const position = this.getLinePosition();
|
|
76
|
+
if (position.lineIndex >= position.lines.length - 1)
|
|
77
|
+
return;
|
|
78
|
+
const targetLine = position.lines[position.lineIndex + 1] ?? "";
|
|
79
|
+
const targetColumn = Math.min(position.column, targetLine.length);
|
|
80
|
+
this.cursorPos = position.lineStartOffsets[position.lineIndex + 1] + targetColumn;
|
|
81
|
+
}
|
|
82
|
+
moveStart() {
|
|
83
|
+
this.cursorPos = 0;
|
|
84
|
+
}
|
|
85
|
+
moveEnd() {
|
|
86
|
+
this.cursorPos = this.value.length;
|
|
87
|
+
}
|
|
88
|
+
deleteBeforeCursor() {
|
|
89
|
+
if (this.cursorPos <= 0)
|
|
90
|
+
return;
|
|
91
|
+
this.value = this.value.slice(this.cursorPos);
|
|
92
|
+
this.cursorPos = 0;
|
|
93
|
+
}
|
|
94
|
+
deleteAfterCursor() {
|
|
95
|
+
if (this.cursorPos >= this.value.length)
|
|
96
|
+
return;
|
|
97
|
+
this.value = this.value.slice(0, this.cursorPos);
|
|
98
|
+
}
|
|
99
|
+
deleteAfterCursorChar() {
|
|
100
|
+
if (this.cursorPos >= this.value.length)
|
|
101
|
+
return;
|
|
102
|
+
this.value = this.value.slice(0, this.cursorPos) + this.value.slice(this.cursorPos + 1);
|
|
103
|
+
}
|
|
104
|
+
deleteWordBeforeCursor() {
|
|
105
|
+
if (this.cursorPos <= 0)
|
|
106
|
+
return;
|
|
107
|
+
let start = this.cursorPos;
|
|
108
|
+
while (start > 0 && /\s/.test(this.value[start - 1] ?? "")) {
|
|
109
|
+
start--;
|
|
110
|
+
}
|
|
111
|
+
while (start > 0 && !/\s/.test(this.value[start - 1] ?? "")) {
|
|
112
|
+
start--;
|
|
113
|
+
}
|
|
114
|
+
this.value = this.value.slice(0, start) + this.value.slice(this.cursorPos);
|
|
115
|
+
this.cursorPos = start;
|
|
116
|
+
}
|
|
117
|
+
deleteWordAfterCursor() {
|
|
118
|
+
if (this.cursorPos >= this.value.length)
|
|
119
|
+
return;
|
|
120
|
+
let start = this.cursorPos;
|
|
121
|
+
while (start < this.value.length && /\s/.test(this.value[start] ?? "")) {
|
|
122
|
+
start++;
|
|
123
|
+
}
|
|
124
|
+
let end = start;
|
|
125
|
+
while (end < this.value.length && /\s/.test(this.value[end] ?? "")) {
|
|
126
|
+
end++;
|
|
127
|
+
}
|
|
128
|
+
while (end < this.value.length && !/\s/.test(this.value[end] ?? "")) {
|
|
129
|
+
end++;
|
|
130
|
+
}
|
|
131
|
+
this.value = this.value.slice(0, start) + this.value.slice(end);
|
|
132
|
+
}
|
|
133
|
+
historyUp() {
|
|
134
|
+
if (this.historyIdx > 0) {
|
|
135
|
+
this.saveHistoryDraft();
|
|
136
|
+
this.historyIdx--;
|
|
137
|
+
this.value = this.history[this.historyIdx] ?? "";
|
|
138
|
+
this.cursorPos = this.value.length;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
historyDown() {
|
|
142
|
+
if (this.historyIdx < this.history.length - 1) {
|
|
143
|
+
this.historyIdx++;
|
|
144
|
+
this.value = this.history[this.historyIdx] ?? "";
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
this.historyIdx = this.history.length;
|
|
148
|
+
this.restoreHistoryDraft();
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.cursorPos = this.value.length;
|
|
152
|
+
}
|
|
153
|
+
searchHistory() {
|
|
154
|
+
const query = this.value.trim();
|
|
155
|
+
if (!query) {
|
|
156
|
+
const before = this.value;
|
|
157
|
+
const beforeIdx = this.historyIdx;
|
|
158
|
+
this.historyUp();
|
|
159
|
+
return this.value !== before || this.historyIdx !== beforeIdx;
|
|
160
|
+
}
|
|
161
|
+
for (let i = this.history.length - 1; i >= 0; i--) {
|
|
162
|
+
const entry = this.history[i] ?? "";
|
|
163
|
+
if (entry.includes(query)) {
|
|
164
|
+
this.saveHistoryDraft();
|
|
165
|
+
this.historyIdx = i;
|
|
166
|
+
this.value = entry;
|
|
167
|
+
this.cursorPos = entry.length;
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
clear() {
|
|
174
|
+
this.value = "";
|
|
175
|
+
this.cursorPos = 0;
|
|
176
|
+
this.historyIdx = this.history.length;
|
|
177
|
+
this.clearHistoryDraft();
|
|
178
|
+
}
|
|
179
|
+
submit() {
|
|
180
|
+
const cmd = this.value.trim();
|
|
181
|
+
if (!cmd)
|
|
182
|
+
return null;
|
|
183
|
+
this.history = [...this.history.filter((entry) => entry !== cmd), cmd];
|
|
184
|
+
this.historyIdx = this.history.length;
|
|
185
|
+
this.clear();
|
|
186
|
+
return cmd;
|
|
187
|
+
}
|
|
188
|
+
saveHistoryDraft() {
|
|
189
|
+
if (this.historyIdx !== this.history.length || this.historyDraft !== null)
|
|
190
|
+
return;
|
|
191
|
+
this.historyDraft = this.value;
|
|
192
|
+
this.historyDraftCursorPos = this.cursorPos;
|
|
193
|
+
}
|
|
194
|
+
restoreHistoryDraft() {
|
|
195
|
+
this.value = this.historyDraft ?? "";
|
|
196
|
+
this.cursorPos = this.historyDraft === null ? this.value.length : this.historyDraftCursorPos;
|
|
197
|
+
this.clearHistoryDraft();
|
|
198
|
+
}
|
|
199
|
+
clearHistoryDraft() {
|
|
200
|
+
this.historyDraft = null;
|
|
201
|
+
this.historyDraftCursorPos = 0;
|
|
202
|
+
}
|
|
203
|
+
getLinePosition() {
|
|
204
|
+
const lines = this.value.split("\n");
|
|
205
|
+
const lineStartOffsets = [];
|
|
206
|
+
let offset = 0;
|
|
207
|
+
for (const line of lines) {
|
|
208
|
+
lineStartOffsets.push(offset);
|
|
209
|
+
offset += line.length + 1;
|
|
210
|
+
}
|
|
211
|
+
let lineIndex = 0;
|
|
212
|
+
for (let i = 0; i < lineStartOffsets.length; i++) {
|
|
213
|
+
const start = lineStartOffsets[i];
|
|
214
|
+
const line = lines[i] ?? "";
|
|
215
|
+
const end = start + line.length;
|
|
216
|
+
if (this.cursorPos <= end || i === lineStartOffsets.length - 1) {
|
|
217
|
+
lineIndex = i;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
lines,
|
|
223
|
+
lineStartOffsets,
|
|
224
|
+
lineIndex,
|
|
225
|
+
column: this.cursorPos - lineStartOffsets[lineIndex],
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface InputHistoryOptions {
|
|
2
|
+
stateDir: string;
|
|
3
|
+
maxEntries?: number;
|
|
4
|
+
maxEntryChars?: number;
|
|
5
|
+
env?: NodeJS.ProcessEnv | Record<string, string | undefined>;
|
|
6
|
+
}
|
|
7
|
+
export declare function resolveInputHistoryPath(stateDir: string): string;
|
|
8
|
+
export declare function shouldPersistInputHistory(input: string, maxEntryChars?: number): boolean;
|
|
9
|
+
export declare function loadInputHistory(options: InputHistoryOptions): Promise<string[]>;
|
|
10
|
+
export declare function appendInputHistory(input: string, options: InputHistoryOptions): Promise<string[]>;
|
|
11
|
+
//# sourceMappingURL=input-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-history.d.ts","sourceRoot":"","sources":["../../src/tui/input-history.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9D;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE;AAUD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,aAAa,SAA0B,GAAG,OAAO,CAKzG;AAiBD,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAUtF;AAED,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBvG"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
2
|
+
import { dirname, join } from "path";
|
|
3
|
+
const DEFAULT_MAX_ENTRIES = 200;
|
|
4
|
+
const DEFAULT_MAX_ENTRY_CHARS = 8000;
|
|
5
|
+
const SENSITIVE_INPUT_PATTERN = /\b(api[_-]?key|token|password|passwd|secret|authorization|bearer)\b|sk-[A-Za-z0-9_-]{8,}/i;
|
|
6
|
+
export function resolveInputHistoryPath(stateDir) {
|
|
7
|
+
return join(stateDir, "input-history.json");
|
|
8
|
+
}
|
|
9
|
+
function isHistoryEnabled(env = process.env) {
|
|
10
|
+
return String(env.QLING_TUI_HISTORY_ENABLED ?? "true").toLowerCase() !== "false";
|
|
11
|
+
}
|
|
12
|
+
function resolveLimit(value, fallback) {
|
|
13
|
+
return Number.isFinite(value) && Number(value) > 0 ? Math.floor(Number(value)) : fallback;
|
|
14
|
+
}
|
|
15
|
+
export function shouldPersistInputHistory(input, maxEntryChars = DEFAULT_MAX_ENTRY_CHARS) {
|
|
16
|
+
const value = input.trim();
|
|
17
|
+
if (!value)
|
|
18
|
+
return false;
|
|
19
|
+
if (value.length > maxEntryChars)
|
|
20
|
+
return false;
|
|
21
|
+
return !SENSITIVE_INPUT_PATTERN.test(value);
|
|
22
|
+
}
|
|
23
|
+
function normalizeHistory(entries, options) {
|
|
24
|
+
const maxEntries = resolveLimit(options.maxEntries, DEFAULT_MAX_ENTRIES);
|
|
25
|
+
const maxEntryChars = resolveLimit(options.maxEntryChars, DEFAULT_MAX_ENTRY_CHARS);
|
|
26
|
+
let deduped = [];
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
if (typeof entry !== "string")
|
|
29
|
+
continue;
|
|
30
|
+
const value = entry.trim();
|
|
31
|
+
if (!shouldPersistInputHistory(value, maxEntryChars))
|
|
32
|
+
continue;
|
|
33
|
+
deduped = [...deduped.filter((item) => item !== value), value];
|
|
34
|
+
}
|
|
35
|
+
return deduped.slice(-maxEntries);
|
|
36
|
+
}
|
|
37
|
+
export async function loadInputHistory(options) {
|
|
38
|
+
if (!isHistoryEnabled(options.env))
|
|
39
|
+
return [];
|
|
40
|
+
try {
|
|
41
|
+
const raw = await readFile(resolveInputHistoryPath(options.stateDir), "utf8");
|
|
42
|
+
const parsed = JSON.parse(raw);
|
|
43
|
+
if (!Array.isArray(parsed))
|
|
44
|
+
return [];
|
|
45
|
+
return normalizeHistory(parsed, options);
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export async function appendInputHistory(input, options) {
|
|
52
|
+
if (!isHistoryEnabled(options.env))
|
|
53
|
+
return [];
|
|
54
|
+
const maxEntryChars = resolveLimit(options.maxEntryChars, DEFAULT_MAX_ENTRY_CHARS);
|
|
55
|
+
const value = input.trim();
|
|
56
|
+
const current = await loadInputHistory(options);
|
|
57
|
+
if (!shouldPersistInputHistory(value, maxEntryChars))
|
|
58
|
+
return current;
|
|
59
|
+
const next = normalizeHistory([...current, value], options);
|
|
60
|
+
const file = resolveInputHistoryPath(options.stateDir);
|
|
61
|
+
try {
|
|
62
|
+
await mkdir(dirname(file), { recursive: true });
|
|
63
|
+
await writeFile(file, `${JSON.stringify(next, null, 2)}\n`, "utf8");
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return current;
|
|
67
|
+
}
|
|
68
|
+
return next;
|
|
69
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface SerialInputQueueOptions {
|
|
2
|
+
onError?: (error: unknown, input: string) => void | Promise<void>;
|
|
3
|
+
onQueued?: (event: {
|
|
4
|
+
pendingCount: number;
|
|
5
|
+
}) => void;
|
|
6
|
+
onRejected?: (event: {
|
|
7
|
+
pendingCount: number;
|
|
8
|
+
maxPending: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
maxPending?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class SerialInputQueue {
|
|
13
|
+
private readonly onError?;
|
|
14
|
+
private readonly onQueued?;
|
|
15
|
+
private readonly onRejected?;
|
|
16
|
+
private readonly maxPending;
|
|
17
|
+
private readonly queue;
|
|
18
|
+
private draining;
|
|
19
|
+
constructor(options?: SerialInputQueueOptions);
|
|
20
|
+
get pendingCount(): number;
|
|
21
|
+
get isProcessing(): boolean;
|
|
22
|
+
get maxPendingCount(): number;
|
|
23
|
+
clearPending(): number;
|
|
24
|
+
enqueue(input: string, handler: (input: string) => Promise<void>): Promise<boolean>;
|
|
25
|
+
private drain;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=input-queue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-queue.d.ts","sourceRoot":"","sources":["../../src/tui/input-queue.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACrD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAQD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAA0D;IACnF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAA4C;IACtE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAgE;IAC5F,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAC3C,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,GAAE,uBAA4B;IASjD,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,YAAY,IAAI,OAAO,CAE1B;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,YAAY,IAAI,MAAM;IAQtB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;YAwBrE,KAAK;CAuBpB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export class SerialInputQueue {
|
|
2
|
+
onError;
|
|
3
|
+
onQueued;
|
|
4
|
+
onRejected;
|
|
5
|
+
maxPending;
|
|
6
|
+
queue = [];
|
|
7
|
+
draining = false;
|
|
8
|
+
constructor(options = {}) {
|
|
9
|
+
this.onError = options.onError;
|
|
10
|
+
this.onQueued = options.onQueued;
|
|
11
|
+
this.onRejected = options.onRejected;
|
|
12
|
+
this.maxPending = Number.isFinite(options.maxPending) && Number(options.maxPending) >= 0
|
|
13
|
+
? Math.floor(Number(options.maxPending))
|
|
14
|
+
: Number.POSITIVE_INFINITY;
|
|
15
|
+
}
|
|
16
|
+
get pendingCount() {
|
|
17
|
+
return this.queue.length;
|
|
18
|
+
}
|
|
19
|
+
get isProcessing() {
|
|
20
|
+
return this.draining;
|
|
21
|
+
}
|
|
22
|
+
get maxPendingCount() {
|
|
23
|
+
return this.maxPending;
|
|
24
|
+
}
|
|
25
|
+
clearPending() {
|
|
26
|
+
const pending = this.queue.splice(0);
|
|
27
|
+
for (const item of pending) {
|
|
28
|
+
item.resolve(false);
|
|
29
|
+
}
|
|
30
|
+
return pending.length;
|
|
31
|
+
}
|
|
32
|
+
enqueue(input, handler) {
|
|
33
|
+
const wasBusy = this.draining || this.queue.length > 0;
|
|
34
|
+
if (wasBusy && this.queue.length >= this.maxPending) {
|
|
35
|
+
try {
|
|
36
|
+
this.onRejected?.({ pendingCount: this.queue.length, maxPending: this.maxPending });
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Backpressure visibility must not affect the active queue.
|
|
40
|
+
}
|
|
41
|
+
return Promise.resolve(false);
|
|
42
|
+
}
|
|
43
|
+
return new Promise((resolve) => {
|
|
44
|
+
this.queue.push({ input, handler, resolve });
|
|
45
|
+
if (wasBusy) {
|
|
46
|
+
try {
|
|
47
|
+
this.onQueued?.({ pendingCount: this.queue.length });
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// Queue visibility must not affect input delivery.
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
void this.drain();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
async drain() {
|
|
57
|
+
if (this.draining)
|
|
58
|
+
return;
|
|
59
|
+
this.draining = true;
|
|
60
|
+
try {
|
|
61
|
+
while (this.queue.length > 0) {
|
|
62
|
+
const item = this.queue.shift();
|
|
63
|
+
if (!item)
|
|
64
|
+
continue;
|
|
65
|
+
try {
|
|
66
|
+
await item.handler(item.input);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
try {
|
|
70
|
+
await this.onError?.(error, item.input);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Error reporting must not wedge the input queue.
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
item.resolve(true);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
this.draining = false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface ParsedTable {
|
|
2
|
+
headers: string[];
|
|
3
|
+
rows: string[][];
|
|
4
|
+
}
|
|
5
|
+
export declare function parseMarkdownTable(lines: string[]): ParsedTable | null;
|
|
6
|
+
export declare function renderTable(table: ParsedTable, width: number): string[];
|
|
7
|
+
export declare function formatMarkdownForTerminal(text: string, options: {
|
|
8
|
+
width: number;
|
|
9
|
+
}): string[];
|
|
10
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/tui/markdown.ts"],"names":[],"mappings":"AAqCA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;CAClB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,IAAI,CA8DtE;AAuDD,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAqGvE;AAaD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,EAAE,CAmK5F"}
|