@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.
Files changed (512) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/LICENSE +21 -0
  3. package/README.en.md +129 -0
  4. package/README.md +416 -0
  5. package/dist/agent/subtask.d.ts +21 -0
  6. package/dist/agent/subtask.d.ts.map +1 -0
  7. package/dist/agent/subtask.js +55 -0
  8. package/dist/agent-loop.d.ts +151 -0
  9. package/dist/agent-loop.d.ts.map +1 -0
  10. package/dist/agent-loop.js +1498 -0
  11. package/dist/agents/isolation-policy.d.ts +14 -0
  12. package/dist/agents/isolation-policy.d.ts.map +1 -0
  13. package/dist/agents/isolation-policy.js +52 -0
  14. package/dist/channels/console-channel.d.ts +15 -0
  15. package/dist/channels/console-channel.d.ts.map +1 -0
  16. package/dist/channels/console-channel.js +66 -0
  17. package/dist/channels/registry.d.ts +10 -0
  18. package/dist/channels/registry.d.ts.map +1 -0
  19. package/dist/channels/registry.js +25 -0
  20. package/dist/channels/slack-channel.d.ts +35 -0
  21. package/dist/channels/slack-channel.d.ts.map +1 -0
  22. package/dist/channels/slack-channel.js +232 -0
  23. package/dist/channels/telegram-channel.d.ts +32 -0
  24. package/dist/channels/telegram-channel.d.ts.map +1 -0
  25. package/dist/channels/telegram-channel.js +167 -0
  26. package/dist/channels/types.d.ts +31 -0
  27. package/dist/channels/types.d.ts.map +1 -0
  28. package/dist/channels/types.js +4 -0
  29. package/dist/cli/bootstrap.d.ts +39 -0
  30. package/dist/cli/bootstrap.d.ts.map +1 -0
  31. package/dist/cli/bootstrap.js +138 -0
  32. package/dist/cli/channel-bootstrap.d.ts +23 -0
  33. package/dist/cli/channel-bootstrap.d.ts.map +1 -0
  34. package/dist/cli/channel-bootstrap.js +46 -0
  35. package/dist/cli/daemon-control.d.ts +31 -0
  36. package/dist/cli/daemon-control.d.ts.map +1 -0
  37. package/dist/cli/daemon-control.js +177 -0
  38. package/dist/cli/guidance-panel.d.ts +11 -0
  39. package/dist/cli/guidance-panel.d.ts.map +1 -0
  40. package/dist/cli/guidance-panel.js +16 -0
  41. package/dist/cli/mcp-control.d.ts +7 -0
  42. package/dist/cli/mcp-control.d.ts.map +1 -0
  43. package/dist/cli/mcp-control.js +119 -0
  44. package/dist/cli/mission-views.d.ts +13 -0
  45. package/dist/cli/mission-views.d.ts.map +1 -0
  46. package/dist/cli/mission-views.js +82 -0
  47. package/dist/cli/setup.d.ts +9 -0
  48. package/dist/cli/setup.d.ts.map +1 -0
  49. package/dist/cli/setup.js +140 -0
  50. package/dist/cli/startup-contract.d.ts +23 -0
  51. package/dist/cli/startup-contract.d.ts.map +1 -0
  52. package/dist/cli/startup-contract.js +694 -0
  53. package/dist/commands/agents.d.ts +3 -0
  54. package/dist/commands/agents.d.ts.map +1 -0
  55. package/dist/commands/agents.js +44 -0
  56. package/dist/commands/checkpoint.d.ts +3 -0
  57. package/dist/commands/checkpoint.d.ts.map +1 -0
  58. package/dist/commands/checkpoint.js +52 -0
  59. package/dist/commands/claude-style.d.ts +12 -0
  60. package/dist/commands/claude-style.d.ts.map +1 -0
  61. package/dist/commands/claude-style.js +560 -0
  62. package/dist/commands/clear.d.ts +3 -0
  63. package/dist/commands/clear.d.ts.map +1 -0
  64. package/dist/commands/clear.js +20 -0
  65. package/dist/commands/compact.d.ts +3 -0
  66. package/dist/commands/compact.d.ts.map +1 -0
  67. package/dist/commands/compact.js +23 -0
  68. package/dist/commands/config.d.ts +3 -0
  69. package/dist/commands/config.d.ts.map +1 -0
  70. package/dist/commands/config.js +22 -0
  71. package/dist/commands/connect.d.ts +3 -0
  72. package/dist/commands/connect.d.ts.map +1 -0
  73. package/dist/commands/connect.js +102 -0
  74. package/dist/commands/context.d.ts +3 -0
  75. package/dist/commands/context.d.ts.map +1 -0
  76. package/dist/commands/context.js +13 -0
  77. package/dist/commands/dashboard.d.ts +3 -0
  78. package/dist/commands/dashboard.d.ts.map +1 -0
  79. package/dist/commands/dashboard.js +22 -0
  80. package/dist/commands/detach.d.ts +3 -0
  81. package/dist/commands/detach.d.ts.map +1 -0
  82. package/dist/commands/detach.js +44 -0
  83. package/dist/commands/distill.d.ts +3 -0
  84. package/dist/commands/distill.d.ts.map +1 -0
  85. package/dist/commands/distill.js +23 -0
  86. package/dist/commands/doctor.d.ts +3 -0
  87. package/dist/commands/doctor.d.ts.map +1 -0
  88. package/dist/commands/doctor.js +13 -0
  89. package/dist/commands/dream.d.ts +3 -0
  90. package/dist/commands/dream.d.ts.map +1 -0
  91. package/dist/commands/dream.js +59 -0
  92. package/dist/commands/export.d.ts +3 -0
  93. package/dist/commands/export.d.ts.map +1 -0
  94. package/dist/commands/export.js +18 -0
  95. package/dist/commands/exports.d.ts +3 -0
  96. package/dist/commands/exports.d.ts.map +1 -0
  97. package/dist/commands/exports.js +15 -0
  98. package/dist/commands/goal.d.ts +3 -0
  99. package/dist/commands/goal.d.ts.map +1 -0
  100. package/dist/commands/goal.js +147 -0
  101. package/dist/commands/help.d.ts +4 -0
  102. package/dist/commands/help.d.ts.map +1 -0
  103. package/dist/commands/help.js +75 -0
  104. package/dist/commands/hooks.d.ts +3 -0
  105. package/dist/commands/hooks.d.ts.map +1 -0
  106. package/dist/commands/hooks.js +14 -0
  107. package/dist/commands/index.d.ts +29 -0
  108. package/dist/commands/index.d.ts.map +1 -0
  109. package/dist/commands/index.js +417 -0
  110. package/dist/commands/knowledge.d.ts +8 -0
  111. package/dist/commands/knowledge.d.ts.map +1 -0
  112. package/dist/commands/knowledge.js +191 -0
  113. package/dist/commands/loop.d.ts +3 -0
  114. package/dist/commands/loop.d.ts.map +1 -0
  115. package/dist/commands/loop.js +138 -0
  116. package/dist/commands/mcp.d.ts +3 -0
  117. package/dist/commands/mcp.d.ts.map +1 -0
  118. package/dist/commands/mcp.js +57 -0
  119. package/dist/commands/memory.d.ts +3 -0
  120. package/dist/commands/memory.d.ts.map +1 -0
  121. package/dist/commands/memory.js +215 -0
  122. package/dist/commands/mission.d.ts +3 -0
  123. package/dist/commands/mission.d.ts.map +1 -0
  124. package/dist/commands/mission.js +129 -0
  125. package/dist/commands/permissions.d.ts +3 -0
  126. package/dist/commands/permissions.d.ts.map +1 -0
  127. package/dist/commands/permissions.js +82 -0
  128. package/dist/commands/privacy.d.ts +3 -0
  129. package/dist/commands/privacy.d.ts.map +1 -0
  130. package/dist/commands/privacy.js +13 -0
  131. package/dist/commands/recap.d.ts +3 -0
  132. package/dist/commands/recap.d.ts.map +1 -0
  133. package/dist/commands/recap.js +11 -0
  134. package/dist/commands/repomap.d.ts +3 -0
  135. package/dist/commands/repomap.d.ts.map +1 -0
  136. package/dist/commands/repomap.js +146 -0
  137. package/dist/commands/resume.d.ts +3 -0
  138. package/dist/commands/resume.d.ts.map +1 -0
  139. package/dist/commands/resume.js +42 -0
  140. package/dist/commands/runtime.d.ts +61 -0
  141. package/dist/commands/runtime.d.ts.map +1 -0
  142. package/dist/commands/runtime.js +20 -0
  143. package/dist/commands/sessions.d.ts +3 -0
  144. package/dist/commands/sessions.d.ts.map +1 -0
  145. package/dist/commands/sessions.js +34 -0
  146. package/dist/commands/shortcuts.d.ts +3 -0
  147. package/dist/commands/shortcuts.d.ts.map +1 -0
  148. package/dist/commands/shortcuts.js +12 -0
  149. package/dist/commands/skill.d.ts +3 -0
  150. package/dist/commands/skill.d.ts.map +1 -0
  151. package/dist/commands/skill.js +20 -0
  152. package/dist/commands/status.d.ts +3 -0
  153. package/dist/commands/status.d.ts.map +1 -0
  154. package/dist/commands/status.js +31 -0
  155. package/dist/commands/statusline.d.ts +3 -0
  156. package/dist/commands/statusline.d.ts.map +1 -0
  157. package/dist/commands/statusline.js +40 -0
  158. package/dist/commands/storage.d.ts +3 -0
  159. package/dist/commands/storage.d.ts.map +1 -0
  160. package/dist/commands/storage.js +122 -0
  161. package/dist/commands/tasks.d.ts +3 -0
  162. package/dist/commands/tasks.d.ts.map +1 -0
  163. package/dist/commands/tasks.js +117 -0
  164. package/dist/commands/types.d.ts +14 -0
  165. package/dist/commands/types.d.ts.map +1 -0
  166. package/dist/commands/types.js +1 -0
  167. package/dist/commands/verify.d.ts +3 -0
  168. package/dist/commands/verify.d.ts.map +1 -0
  169. package/dist/commands/verify.js +86 -0
  170. package/dist/config-report.d.ts +35 -0
  171. package/dist/config-report.d.ts.map +1 -0
  172. package/dist/config-report.js +100 -0
  173. package/dist/config.d.ts +217 -0
  174. package/dist/config.d.ts.map +1 -0
  175. package/dist/config.js +690 -0
  176. package/dist/context-compactor.d.ts +27 -0
  177. package/dist/context-compactor.d.ts.map +1 -0
  178. package/dist/context-compactor.js +489 -0
  179. package/dist/context-report.d.ts +35 -0
  180. package/dist/context-report.d.ts.map +1 -0
  181. package/dist/context-report.js +172 -0
  182. package/dist/daemon.d.ts +2 -0
  183. package/dist/daemon.d.ts.map +1 -0
  184. package/dist/daemon.js +316 -0
  185. package/dist/dashboard-server.d.ts +18 -0
  186. package/dist/dashboard-server.d.ts.map +1 -0
  187. package/dist/dashboard-server.js +325 -0
  188. package/dist/discovery-registry.d.ts +28 -0
  189. package/dist/discovery-registry.d.ts.map +1 -0
  190. package/dist/discovery-registry.js +106 -0
  191. package/dist/discovery-types.d.ts +54 -0
  192. package/dist/discovery-types.d.ts.map +1 -0
  193. package/dist/discovery-types.js +5 -0
  194. package/dist/doctor.d.ts +31 -0
  195. package/dist/doctor.d.ts.map +1 -0
  196. package/dist/doctor.js +343 -0
  197. package/dist/eval/runner.d.ts +10 -0
  198. package/dist/eval/runner.d.ts.map +1 -0
  199. package/dist/eval/runner.js +78 -0
  200. package/dist/eval/tasks.d.ts +3 -0
  201. package/dist/eval/tasks.d.ts.map +1 -0
  202. package/dist/eval/tasks.js +179 -0
  203. package/dist/eval/types.d.ts +31 -0
  204. package/dist/eval/types.d.ts.map +1 -0
  205. package/dist/eval/types.js +4 -0
  206. package/dist/git/auto-commit.d.ts +28 -0
  207. package/dist/git/auto-commit.d.ts.map +1 -0
  208. package/dist/git/auto-commit.js +112 -0
  209. package/dist/guard/approval.d.ts +16 -0
  210. package/dist/guard/approval.d.ts.map +1 -0
  211. package/dist/guard/approval.js +68 -0
  212. package/dist/guard/content-filter.d.ts +15 -0
  213. package/dist/guard/content-filter.d.ts.map +1 -0
  214. package/dist/guard/content-filter.js +102 -0
  215. package/dist/guard/permissions.d.ts +17 -0
  216. package/dist/guard/permissions.d.ts.map +1 -0
  217. package/dist/guard/permissions.js +54 -0
  218. package/dist/guard/rate-limit.d.ts +14 -0
  219. package/dist/guard/rate-limit.d.ts.map +1 -0
  220. package/dist/guard/rate-limit.js +47 -0
  221. package/dist/guard.d.ts +21 -0
  222. package/dist/guard.d.ts.map +1 -0
  223. package/dist/guard.js +144 -0
  224. package/dist/help-topics.d.ts +19 -0
  225. package/dist/help-topics.d.ts.map +1 -0
  226. package/dist/help-topics.js +391 -0
  227. package/dist/hooks-report.d.ts +23 -0
  228. package/dist/hooks-report.d.ts.map +1 -0
  229. package/dist/hooks-report.js +44 -0
  230. package/dist/i18n/index.d.ts +5 -0
  231. package/dist/i18n/index.d.ts.map +1 -0
  232. package/dist/i18n/index.js +4 -0
  233. package/dist/i18n/zh-cn.d.ts +180 -0
  234. package/dist/i18n/zh-cn.d.ts.map +1 -0
  235. package/dist/i18n/zh-cn.js +184 -0
  236. package/dist/index.d.ts +3 -0
  237. package/dist/index.d.ts.map +1 -0
  238. package/dist/index.js +1157 -0
  239. package/dist/knowledge-agent.d.ts +47 -0
  240. package/dist/knowledge-agent.d.ts.map +1 -0
  241. package/dist/knowledge-agent.js +320 -0
  242. package/dist/local-status-report.d.ts +23 -0
  243. package/dist/local-status-report.d.ts.map +1 -0
  244. package/dist/local-status-report.js +63 -0
  245. package/dist/local-storage-report.d.ts +32 -0
  246. package/dist/local-storage-report.d.ts.map +1 -0
  247. package/dist/local-storage-report.js +171 -0
  248. package/dist/mcp/bridge.d.ts +11 -0
  249. package/dist/mcp/bridge.d.ts.map +1 -0
  250. package/dist/mcp/bridge.js +37 -0
  251. package/dist/mcp/client.d.ts +26 -0
  252. package/dist/mcp/client.d.ts.map +1 -0
  253. package/dist/mcp/client.js +209 -0
  254. package/dist/mcp/http-transport.d.ts +21 -0
  255. package/dist/mcp/http-transport.d.ts.map +1 -0
  256. package/dist/mcp/http-transport.js +126 -0
  257. package/dist/mcp/presets.d.ts +22 -0
  258. package/dist/mcp/presets.d.ts.map +1 -0
  259. package/dist/mcp/presets.js +80 -0
  260. package/dist/mcp/registry.d.ts +23 -0
  261. package/dist/mcp/registry.d.ts.map +1 -0
  262. package/dist/mcp/registry.js +85 -0
  263. package/dist/mcp/stdio-transport.d.ts +25 -0
  264. package/dist/mcp/stdio-transport.d.ts.map +1 -0
  265. package/dist/mcp/stdio-transport.js +92 -0
  266. package/dist/mcp/store.d.ts +41 -0
  267. package/dist/mcp/store.d.ts.map +1 -0
  268. package/dist/mcp/store.js +100 -0
  269. package/dist/mcp/types.d.ts +40 -0
  270. package/dist/mcp/types.d.ts.map +1 -0
  271. package/dist/mcp/types.js +4 -0
  272. package/dist/mcp-report.d.ts +30 -0
  273. package/dist/mcp-report.d.ts.map +1 -0
  274. package/dist/mcp-report.js +104 -0
  275. package/dist/memory/cognitive-index.d.ts +56 -0
  276. package/dist/memory/cognitive-index.d.ts.map +1 -0
  277. package/dist/memory/cognitive-index.js +265 -0
  278. package/dist/memory/compactor.d.ts +28 -0
  279. package/dist/memory/compactor.d.ts.map +1 -0
  280. package/dist/memory/compactor.js +92 -0
  281. package/dist/memory/consolidation.d.ts +13 -0
  282. package/dist/memory/consolidation.d.ts.map +1 -0
  283. package/dist/memory/consolidation.js +77 -0
  284. package/dist/memory/embedding.d.ts +15 -0
  285. package/dist/memory/embedding.d.ts.map +1 -0
  286. package/dist/memory/embedding.js +59 -0
  287. package/dist/memory/memory-llm-dream.d.ts +3 -0
  288. package/dist/memory/memory-llm-dream.d.ts.map +1 -0
  289. package/dist/memory/memory-llm-dream.js +59 -0
  290. package/dist/memory/projection-worker.d.ts +30 -0
  291. package/dist/memory/projection-worker.d.ts.map +1 -0
  292. package/dist/memory/projection-worker.js +92 -0
  293. package/dist/memory/semantic-index.d.ts +18 -0
  294. package/dist/memory/semantic-index.d.ts.map +1 -0
  295. package/dist/memory/semantic-index.js +86 -0
  296. package/dist/memory/wal.d.ts +33 -0
  297. package/dist/memory/wal.d.ts.map +1 -0
  298. package/dist/memory/wal.js +131 -0
  299. package/dist/memory-report.d.ts +120 -0
  300. package/dist/memory-report.d.ts.map +1 -0
  301. package/dist/memory-report.js +726 -0
  302. package/dist/memory.d.ts +149 -0
  303. package/dist/memory.d.ts.map +1 -0
  304. package/dist/memory.js +632 -0
  305. package/dist/metrics/agent-telemetry.d.ts +14 -0
  306. package/dist/metrics/agent-telemetry.d.ts.map +1 -0
  307. package/dist/metrics/agent-telemetry.js +44 -0
  308. package/dist/metrics/collector.d.ts +17 -0
  309. package/dist/metrics/collector.d.ts.map +1 -0
  310. package/dist/metrics/collector.js +137 -0
  311. package/dist/metrics/types.d.ts +14 -0
  312. package/dist/metrics/types.d.ts.map +1 -0
  313. package/dist/metrics/types.js +4 -0
  314. package/dist/mission/manager.d.ts +28 -0
  315. package/dist/mission/manager.d.ts.map +1 -0
  316. package/dist/mission/manager.js +208 -0
  317. package/dist/mission/types.d.ts +37 -0
  318. package/dist/mission/types.d.ts.map +1 -0
  319. package/dist/mission/types.js +5 -0
  320. package/dist/onboarding/tutorial.d.ts +33 -0
  321. package/dist/onboarding/tutorial.d.ts.map +1 -0
  322. package/dist/onboarding/tutorial.js +96 -0
  323. package/dist/output-style.d.ts +14 -0
  324. package/dist/output-style.d.ts.map +1 -0
  325. package/dist/output-style.js +29 -0
  326. package/dist/package-version.d.ts +12 -0
  327. package/dist/package-version.d.ts.map +1 -0
  328. package/dist/package-version.js +42 -0
  329. package/dist/permissions-report.d.ts +42 -0
  330. package/dist/permissions-report.d.ts.map +1 -0
  331. package/dist/permissions-report.js +120 -0
  332. package/dist/pipeline/consistency-checker.d.ts +8 -0
  333. package/dist/pipeline/consistency-checker.d.ts.map +1 -0
  334. package/dist/pipeline/consistency-checker.js +40 -0
  335. package/dist/pipeline/example-generator.d.ts +4 -0
  336. package/dist/pipeline/example-generator.d.ts.map +1 -0
  337. package/dist/pipeline/example-generator.js +64 -0
  338. package/dist/pipeline/hooks.d.ts +68 -0
  339. package/dist/pipeline/hooks.d.ts.map +1 -0
  340. package/dist/pipeline/hooks.js +377 -0
  341. package/dist/pipeline/sections.d.ts +41 -0
  342. package/dist/pipeline/sections.d.ts.map +1 -0
  343. package/dist/pipeline/sections.js +244 -0
  344. package/dist/pipeline/verification.d.ts +12 -0
  345. package/dist/pipeline/verification.d.ts.map +1 -0
  346. package/dist/pipeline/verification.js +138 -0
  347. package/dist/privacy-report.d.ts +24 -0
  348. package/dist/privacy-report.d.ts.map +1 -0
  349. package/dist/privacy-report.js +78 -0
  350. package/dist/providers/presets.d.ts +25 -0
  351. package/dist/providers/presets.d.ts.map +1 -0
  352. package/dist/providers/presets.js +205 -0
  353. package/dist/recap.d.ts +38 -0
  354. package/dist/recap.d.ts.map +1 -0
  355. package/dist/recap.js +154 -0
  356. package/dist/repl.d.ts +41 -0
  357. package/dist/repl.d.ts.map +1 -0
  358. package/dist/repl.js +396 -0
  359. package/dist/runtime-paths.d.ts +32 -0
  360. package/dist/runtime-paths.d.ts.map +1 -0
  361. package/dist/runtime-paths.js +134 -0
  362. package/dist/sdk.d.ts +12 -0
  363. package/dist/sdk.d.ts.map +1 -0
  364. package/dist/sdk.js +18 -0
  365. package/dist/session/daemon-session-api.d.ts +22 -0
  366. package/dist/session/daemon-session-api.d.ts.map +1 -0
  367. package/dist/session/daemon-session-api.js +48 -0
  368. package/dist/session/durable-session-supervisor.d.ts +24 -0
  369. package/dist/session/durable-session-supervisor.d.ts.map +1 -0
  370. package/dist/session/durable-session-supervisor.js +195 -0
  371. package/dist/session/goal-controller.d.ts +43 -0
  372. package/dist/session/goal-controller.d.ts.map +1 -0
  373. package/dist/session/goal-controller.js +77 -0
  374. package/dist/session/goal-evaluator.d.ts +29 -0
  375. package/dist/session/goal-evaluator.d.ts.map +1 -0
  376. package/dist/session/goal-evaluator.js +100 -0
  377. package/dist/session/loop-prompt.d.ts +14 -0
  378. package/dist/session/loop-prompt.d.ts.map +1 -0
  379. package/dist/session/loop-prompt.js +49 -0
  380. package/dist/session/session-goal-manager.d.ts +51 -0
  381. package/dist/session/session-goal-manager.d.ts.map +1 -0
  382. package/dist/session/session-goal-manager.js +118 -0
  383. package/dist/session/session-registry.d.ts +40 -0
  384. package/dist/session/session-registry.d.ts.map +1 -0
  385. package/dist/session/session-registry.js +124 -0
  386. package/dist/session/session-scheduler.d.ts +59 -0
  387. package/dist/session/session-scheduler.d.ts.map +1 -0
  388. package/dist/session/session-scheduler.js +170 -0
  389. package/dist/session-checkpoint-report.d.ts +22 -0
  390. package/dist/session-checkpoint-report.d.ts.map +1 -0
  391. package/dist/session-checkpoint-report.js +99 -0
  392. package/dist/session-export-index.d.ts +23 -0
  393. package/dist/session-export-index.d.ts.map +1 -0
  394. package/dist/session-export-index.js +96 -0
  395. package/dist/session-export.d.ts +28 -0
  396. package/dist/session-export.d.ts.map +1 -0
  397. package/dist/session-export.js +99 -0
  398. package/dist/session-goal-report.d.ts +37 -0
  399. package/dist/session-goal-report.d.ts.map +1 -0
  400. package/dist/session-goal-report.js +219 -0
  401. package/dist/session-list-report.d.ts +16 -0
  402. package/dist/session-list-report.d.ts.map +1 -0
  403. package/dist/session-list-report.js +60 -0
  404. package/dist/session-task-report.d.ts +23 -0
  405. package/dist/session-task-report.d.ts.map +1 -0
  406. package/dist/session-task-report.js +183 -0
  407. package/dist/shortcuts.d.ts +2 -0
  408. package/dist/shortcuts.d.ts.map +1 -0
  409. package/dist/shortcuts.js +32 -0
  410. package/dist/skills/registry.d.ts +8 -0
  411. package/dist/skills/registry.d.ts.map +1 -0
  412. package/dist/skills/registry.js +119 -0
  413. package/dist/skills/types.d.ts +7 -0
  414. package/dist/skills/types.d.ts.map +1 -0
  415. package/dist/skills/types.js +4 -0
  416. package/dist/statusline.d.ts +37 -0
  417. package/dist/statusline.d.ts.map +1 -0
  418. package/dist/statusline.js +207 -0
  419. package/dist/tools/bash.d.ts +10 -0
  420. package/dist/tools/bash.d.ts.map +1 -0
  421. package/dist/tools/bash.js +278 -0
  422. package/dist/tools/browser-fetch.d.ts +7 -0
  423. package/dist/tools/browser-fetch.d.ts.map +1 -0
  424. package/dist/tools/browser-fetch.js +133 -0
  425. package/dist/tools/error-utils.d.ts +9 -0
  426. package/dist/tools/error-utils.d.ts.map +1 -0
  427. package/dist/tools/error-utils.js +35 -0
  428. package/dist/tools/index.d.ts +27 -0
  429. package/dist/tools/index.d.ts.map +1 -0
  430. package/dist/tools/index.js +86 -0
  431. package/dist/tools/patch.d.ts +22 -0
  432. package/dist/tools/patch.d.ts.map +1 -0
  433. package/dist/tools/patch.js +458 -0
  434. package/dist/tools/planner.d.ts +7 -0
  435. package/dist/tools/planner.d.ts.map +1 -0
  436. package/dist/tools/planner.js +148 -0
  437. package/dist/tools/read.d.ts +8 -0
  438. package/dist/tools/read.d.ts.map +1 -0
  439. package/dist/tools/read.js +114 -0
  440. package/dist/tools/search.d.ts +11 -0
  441. package/dist/tools/search.d.ts.map +1 -0
  442. package/dist/tools/search.js +636 -0
  443. package/dist/tools/skill.d.ts +8 -0
  444. package/dist/tools/skill.d.ts.map +1 -0
  445. package/dist/tools/skill.js +181 -0
  446. package/dist/tools/subtask.d.ts +9 -0
  447. package/dist/tools/subtask.d.ts.map +1 -0
  448. package/dist/tools/subtask.js +120 -0
  449. package/dist/tools/todo.d.ts +8 -0
  450. package/dist/tools/todo.d.ts.map +1 -0
  451. package/dist/tools/todo.js +170 -0
  452. package/dist/tools/url-fetch.d.ts +11 -0
  453. package/dist/tools/url-fetch.d.ts.map +1 -0
  454. package/dist/tools/url-fetch.js +208 -0
  455. package/dist/tools/vision-analyze.d.ts +9 -0
  456. package/dist/tools/vision-analyze.d.ts.map +1 -0
  457. package/dist/tools/vision-analyze.js +179 -0
  458. package/dist/tools/write.d.ts +7 -0
  459. package/dist/tools/write.d.ts.map +1 -0
  460. package/dist/tools/write.js +128 -0
  461. package/dist/tui/chrome.d.ts +7 -0
  462. package/dist/tui/chrome.d.ts.map +1 -0
  463. package/dist/tui/chrome.js +22 -0
  464. package/dist/tui/input-buffer.d.ts +37 -0
  465. package/dist/tui/input-buffer.d.ts.map +1 -0
  466. package/dist/tui/input-buffer.js +228 -0
  467. package/dist/tui/input-history.d.ts +11 -0
  468. package/dist/tui/input-history.d.ts.map +1 -0
  469. package/dist/tui/input-history.js +69 -0
  470. package/dist/tui/input-queue.d.ts +27 -0
  471. package/dist/tui/input-queue.d.ts.map +1 -0
  472. package/dist/tui/input-queue.js +85 -0
  473. package/dist/tui/markdown.d.ts +10 -0
  474. package/dist/tui/markdown.d.ts.map +1 -0
  475. package/dist/tui/markdown.js +396 -0
  476. package/dist/tui/progress.d.ts +3 -0
  477. package/dist/tui/progress.d.ts.map +1 -0
  478. package/dist/tui/progress.js +13 -0
  479. package/dist/tui/shell.d.ts +67 -0
  480. package/dist/tui/shell.d.ts.map +1 -0
  481. package/dist/tui/shell.js +271 -0
  482. package/dist/tui/streaming-repl.d.ts +39 -0
  483. package/dist/tui/streaming-repl.d.ts.map +1 -0
  484. package/dist/tui/streaming-repl.js +460 -0
  485. package/dist/tui/streaming-tui.d.ts +174 -0
  486. package/dist/tui/streaming-tui.d.ts.map +1 -0
  487. package/dist/tui/streaming-tui.js +1049 -0
  488. package/dist/types.d.ts +221 -0
  489. package/dist/types.d.ts.map +1 -0
  490. package/dist/types.js +37 -0
  491. package/dist/utils/symbol-extractor.d.ts +8 -0
  492. package/dist/utils/symbol-extractor.d.ts.map +1 -0
  493. package/dist/utils/symbol-extractor.js +190 -0
  494. package/dist/workflow-runtime.d.ts +45 -0
  495. package/dist/workflow-runtime.d.ts.map +1 -0
  496. package/dist/workflow-runtime.js +146 -0
  497. package/dist/workflow-types.d.ts +73 -0
  498. package/dist/workflow-types.d.ts.map +1 -0
  499. package/dist/workflow-types.js +34 -0
  500. package/docs/docker.md +66 -0
  501. package/docs/install.md +159 -0
  502. package/docs/sdk.md +67 -0
  503. package/docs/skills.md +51 -0
  504. package/package.json +102 -0
  505. package/scripts/bootstrap.mjs +63 -0
  506. package/scripts/check_image.ps1 +18 -0
  507. package/scripts/clean-dist.mjs +18 -0
  508. package/scripts/copy_image.ps1 +5 -0
  509. package/scripts/eval-smoke.mjs +17 -0
  510. package/skills/examples/repo-triage/SKILL.md +50 -0
  511. package/skills/qling.md +42 -0
  512. 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"}