@kvman/kvcoder 0.1.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 (409) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/api.d.ts +386 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +2 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/artifacts/artifact-format.d.ts +9 -0
  8. package/dist/artifacts/artifact-format.d.ts.map +1 -0
  9. package/dist/artifacts/artifact-format.js +32 -0
  10. package/dist/artifacts/artifact-format.js.map +1 -0
  11. package/dist/artifacts/artifact-records.d.ts +12 -0
  12. package/dist/artifacts/artifact-records.d.ts.map +1 -0
  13. package/dist/artifacts/artifact-records.js +17 -0
  14. package/dist/artifacts/artifact-records.js.map +1 -0
  15. package/dist/artifacts/register-artifacts.d.ts +3 -0
  16. package/dist/artifacts/register-artifacts.d.ts.map +1 -0
  17. package/dist/artifacts/register-artifacts.js +37 -0
  18. package/dist/artifacts/register-artifacts.js.map +1 -0
  19. package/dist/calls/binary-checks.d.ts +8 -0
  20. package/dist/calls/binary-checks.d.ts.map +1 -0
  21. package/dist/calls/binary-checks.js +12 -0
  22. package/dist/calls/binary-checks.js.map +1 -0
  23. package/dist/calls/connector-help.d.ts +3 -0
  24. package/dist/calls/connector-help.d.ts.map +1 -0
  25. package/dist/calls/connector-help.js +73 -0
  26. package/dist/calls/connector-help.js.map +1 -0
  27. package/dist/calls/help-text.d.ts +19 -0
  28. package/dist/calls/help-text.d.ts.map +1 -0
  29. package/dist/calls/help-text.js +22 -0
  30. package/dist/calls/help-text.js.map +1 -0
  31. package/dist/calls/line-run.d.ts +33 -0
  32. package/dist/calls/line-run.d.ts.map +1 -0
  33. package/dist/calls/line-run.js +56 -0
  34. package/dist/calls/line-run.js.map +1 -0
  35. package/dist/calls/run-shell.d.ts +12 -0
  36. package/dist/calls/run-shell.d.ts.map +1 -0
  37. package/dist/calls/run-shell.js +88 -0
  38. package/dist/calls/run-shell.js.map +1 -0
  39. package/dist/calls/run-tool.d.ts +49 -0
  40. package/dist/calls/run-tool.d.ts.map +1 -0
  41. package/dist/calls/run-tool.js +66 -0
  42. package/dist/calls/run-tool.js.map +1 -0
  43. package/dist/calls/shell-command.d.ts +25 -0
  44. package/dist/calls/shell-command.d.ts.map +1 -0
  45. package/dist/calls/shell-command.js +31 -0
  46. package/dist/calls/shell-command.js.map +1 -0
  47. package/dist/calls/shell-program.d.ts +5 -0
  48. package/dist/calls/shell-program.d.ts.map +1 -0
  49. package/dist/calls/shell-program.js +8 -0
  50. package/dist/calls/shell-program.js.map +1 -0
  51. package/dist/connector-call.d.ts +66 -0
  52. package/dist/connector-call.d.ts.map +1 -0
  53. package/dist/connector-call.js +133 -0
  54. package/dist/connector-call.js.map +1 -0
  55. package/dist/connectors/artifact.d.ts +51 -0
  56. package/dist/connectors/artifact.d.ts.map +1 -0
  57. package/dist/connectors/artifact.js +101 -0
  58. package/dist/connectors/artifact.js.map +1 -0
  59. package/dist/connectors/ask.d.ts +58 -0
  60. package/dist/connectors/ask.d.ts.map +1 -0
  61. package/dist/connectors/ask.js +85 -0
  62. package/dist/connectors/ask.js.map +1 -0
  63. package/dist/connectors/background.d.ts +29 -0
  64. package/dist/connectors/background.d.ts.map +1 -0
  65. package/dist/connectors/background.js +56 -0
  66. package/dist/connectors/background.js.map +1 -0
  67. package/dist/connectors/binary.d.ts +5 -0
  68. package/dist/connectors/binary.d.ts.map +1 -0
  69. package/dist/connectors/binary.js +27 -0
  70. package/dist/connectors/binary.js.map +1 -0
  71. package/dist/connectors/builtin-connectors.d.ts +217 -0
  72. package/dist/connectors/builtin-connectors.d.ts.map +1 -0
  73. package/dist/connectors/builtin-connectors.js +49 -0
  74. package/dist/connectors/builtin-connectors.js.map +1 -0
  75. package/dist/connectors/connector-command.d.ts +26 -0
  76. package/dist/connectors/connector-command.d.ts.map +1 -0
  77. package/dist/connectors/connector-command.js +17 -0
  78. package/dist/connectors/connector-command.js.map +1 -0
  79. package/dist/connectors/delegate.d.ts +32 -0
  80. package/dist/connectors/delegate.d.ts.map +1 -0
  81. package/dist/connectors/delegate.js +82 -0
  82. package/dist/connectors/delegate.js.map +1 -0
  83. package/dist/connectors/fs.d.ts +60 -0
  84. package/dist/connectors/fs.d.ts.map +1 -0
  85. package/dist/connectors/fs.js +132 -0
  86. package/dist/connectors/fs.js.map +1 -0
  87. package/dist/connectors/mcp.d.ts +37 -0
  88. package/dist/connectors/mcp.d.ts.map +1 -0
  89. package/dist/connectors/mcp.js +69 -0
  90. package/dist/connectors/mcp.js.map +1 -0
  91. package/dist/connectors/payload-fields.d.ts +9 -0
  92. package/dist/connectors/payload-fields.d.ts.map +1 -0
  93. package/dist/connectors/payload-fields.js +13 -0
  94. package/dist/connectors/payload-fields.js.map +1 -0
  95. package/dist/connectors/shell.d.ts +19 -0
  96. package/dist/connectors/shell.d.ts.map +1 -0
  97. package/dist/connectors/shell.js +22 -0
  98. package/dist/connectors/shell.js.map +1 -0
  99. package/dist/delay.d.ts +3 -0
  100. package/dist/delay.d.ts.map +1 -0
  101. package/dist/delay.js +11 -0
  102. package/dist/delay.js.map +1 -0
  103. package/dist/delegate/approved-run.d.ts +13 -0
  104. package/dist/delegate/approved-run.d.ts.map +1 -0
  105. package/dist/delegate/approved-run.js +54 -0
  106. package/dist/delegate/approved-run.js.map +1 -0
  107. package/dist/delegate/programs.d.ts +32 -0
  108. package/dist/delegate/programs.d.ts.map +1 -0
  109. package/dist/delegate/programs.js +67 -0
  110. package/dist/delegate/programs.js.map +1 -0
  111. package/dist/delegate/register-worker-run.d.ts +9 -0
  112. package/dist/delegate/register-worker-run.d.ts.map +1 -0
  113. package/dist/delegate/register-worker-run.js +70 -0
  114. package/dist/delegate/register-worker-run.js.map +1 -0
  115. package/dist/delegate/run-program.d.ts +9 -0
  116. package/dist/delegate/run-program.d.ts.map +1 -0
  117. package/dist/delegate/run-program.js +59 -0
  118. package/dist/delegate/run-program.js.map +1 -0
  119. package/dist/delegate/runs.d.ts +27 -0
  120. package/dist/delegate/runs.d.ts.map +1 -0
  121. package/dist/delegate/runs.js +68 -0
  122. package/dist/delegate/runs.js.map +1 -0
  123. package/dist/delegate/workers.d.ts +266 -0
  124. package/dist/delegate/workers.d.ts.map +1 -0
  125. package/dist/delegate/workers.js +80 -0
  126. package/dist/delegate/workers.js.map +1 -0
  127. package/dist/docs.d.ts +14 -0
  128. package/dist/docs.d.ts.map +1 -0
  129. package/dist/docs.js +59 -0
  130. package/dist/docs.js.map +1 -0
  131. package/dist/files/edit-text.d.ts +13 -0
  132. package/dist/files/edit-text.d.ts.map +1 -0
  133. package/dist/files/edit-text.js +46 -0
  134. package/dist/files/edit-text.js.map +1 -0
  135. package/dist/files/file-queue.d.ts +3 -0
  136. package/dist/files/file-queue.d.ts.map +1 -0
  137. package/dist/files/file-queue.js +17 -0
  138. package/dist/files/file-queue.js.map +1 -0
  139. package/dist/files/list-entries.d.ts +14 -0
  140. package/dist/files/list-entries.d.ts.map +1 -0
  141. package/dist/files/list-entries.js +40 -0
  142. package/dist/files/list-entries.js.map +1 -0
  143. package/dist/files/read-file.d.ts +17 -0
  144. package/dist/files/read-file.d.ts.map +1 -0
  145. package/dist/files/read-file.js +53 -0
  146. package/dist/files/read-file.js.map +1 -0
  147. package/dist/files/search-text.d.ts +14 -0
  148. package/dist/files/search-text.d.ts.map +1 -0
  149. package/dist/files/search-text.js +62 -0
  150. package/dist/files/search-text.js.map +1 -0
  151. package/dist/files/workspace-path.d.ts +5 -0
  152. package/dist/files/workspace-path.d.ts.map +1 -0
  153. package/dist/files/workspace-path.js +37 -0
  154. package/dist/files/workspace-path.js.map +1 -0
  155. package/dist/index.d.ts +6 -0
  156. package/dist/index.d.ts.map +1 -0
  157. package/dist/index.js +68 -0
  158. package/dist/index.js.map +1 -0
  159. package/dist/jobs/job-rows.d.ts +24 -0
  160. package/dist/jobs/job-rows.d.ts.map +1 -0
  161. package/dist/jobs/job-rows.js +74 -0
  162. package/dist/jobs/job-rows.js.map +1 -0
  163. package/dist/jobs/process-handlers.d.ts +8 -0
  164. package/dist/jobs/process-handlers.d.ts.map +1 -0
  165. package/dist/jobs/process-handlers.js +43 -0
  166. package/dist/jobs/process-handlers.js.map +1 -0
  167. package/dist/jobs/process-records.d.ts +15 -0
  168. package/dist/jobs/process-records.d.ts.map +1 -0
  169. package/dist/jobs/process-records.js +30 -0
  170. package/dist/jobs/process-records.js.map +1 -0
  171. package/dist/jobs/process-report.d.ts +8 -0
  172. package/dist/jobs/process-report.d.ts.map +1 -0
  173. package/dist/jobs/process-report.js +44 -0
  174. package/dist/jobs/process-report.js.map +1 -0
  175. package/dist/jobs/process-run.d.ts +26 -0
  176. package/dist/jobs/process-run.d.ts.map +1 -0
  177. package/dist/jobs/process-run.js +70 -0
  178. package/dist/jobs/process-run.js.map +1 -0
  179. package/dist/jobs/process-text.d.ts +5 -0
  180. package/dist/jobs/process-text.d.ts.map +1 -0
  181. package/dist/jobs/process-text.js +11 -0
  182. package/dist/jobs/process-text.js.map +1 -0
  183. package/dist/jobs/register-jobs.d.ts +3 -0
  184. package/dist/jobs/register-jobs.d.ts.map +1 -0
  185. package/dist/jobs/register-jobs.js +61 -0
  186. package/dist/jobs/register-jobs.js.map +1 -0
  187. package/dist/mcp/command-transport.d.ts +17 -0
  188. package/dist/mcp/command-transport.d.ts.map +1 -0
  189. package/dist/mcp/command-transport.js +60 -0
  190. package/dist/mcp/command-transport.js.map +1 -0
  191. package/dist/mcp/connect.d.ts +12 -0
  192. package/dist/mcp/connect.d.ts.map +1 -0
  193. package/dist/mcp/connect.js +54 -0
  194. package/dist/mcp/connect.js.map +1 -0
  195. package/dist/mcp/oauth-provider.d.ts +25 -0
  196. package/dist/mcp/oauth-provider.d.ts.map +1 -0
  197. package/dist/mcp/oauth-provider.js +59 -0
  198. package/dist/mcp/oauth-provider.js.map +1 -0
  199. package/dist/mcp/register-mcp.d.ts +3 -0
  200. package/dist/mcp/register-mcp.d.ts.map +1 -0
  201. package/dist/mcp/register-mcp.js +61 -0
  202. package/dist/mcp/register-mcp.js.map +1 -0
  203. package/dist/mcp/secrets.d.ts +7 -0
  204. package/dist/mcp/secrets.d.ts.map +1 -0
  205. package/dist/mcp/secrets.js +20 -0
  206. package/dist/mcp/secrets.js.map +1 -0
  207. package/dist/mcp/servers.d.ts +33 -0
  208. package/dist/mcp/servers.d.ts.map +1 -0
  209. package/dist/mcp/servers.js +31 -0
  210. package/dist/mcp/servers.js.map +1 -0
  211. package/dist/mcp/sign-in-record.d.ts +10 -0
  212. package/dist/mcp/sign-in-record.d.ts.map +1 -0
  213. package/dist/mcp/sign-in-record.js +4 -0
  214. package/dist/mcp/sign-in-record.js.map +1 -0
  215. package/dist/mcp/sign-in.d.ts +12 -0
  216. package/dist/mcp/sign-in.d.ts.map +1 -0
  217. package/dist/mcp/sign-in.js +75 -0
  218. package/dist/mcp/sign-in.js.map +1 -0
  219. package/dist/mcp/tools.d.ts +19 -0
  220. package/dist/mcp/tools.d.ts.map +1 -0
  221. package/dist/mcp/tools.js +31 -0
  222. package/dist/mcp/tools.js.map +1 -0
  223. package/dist/messages/attachments.d.ts +8 -0
  224. package/dist/messages/attachments.d.ts.map +1 -0
  225. package/dist/messages/attachments.js +48 -0
  226. package/dist/messages/attachments.js.map +1 -0
  227. package/dist/messages/receive-message.d.ts +15 -0
  228. package/dist/messages/receive-message.d.ts.map +1 -0
  229. package/dist/messages/receive-message.js +60 -0
  230. package/dist/messages/receive-message.js.map +1 -0
  231. package/dist/messages/register-messages.d.ts +3 -0
  232. package/dist/messages/register-messages.d.ts.map +1 -0
  233. package/dist/messages/register-messages.js +63 -0
  234. package/dist/messages/register-messages.js.map +1 -0
  235. package/dist/problems.d.ts +8 -0
  236. package/dist/problems.d.ts.map +1 -0
  237. package/dist/problems.js +14 -0
  238. package/dist/problems.js.map +1 -0
  239. package/dist/prompt/build-prompt.d.ts +29 -0
  240. package/dist/prompt/build-prompt.d.ts.map +1 -0
  241. package/dist/prompt/build-prompt.js +60 -0
  242. package/dist/prompt/build-prompt.js.map +1 -0
  243. package/dist/prompt/register-prompt.d.ts +3 -0
  244. package/dist/prompt/register-prompt.d.ts.map +1 -0
  245. package/dist/prompt/register-prompt.js +29 -0
  246. package/dist/prompt/register-prompt.js.map +1 -0
  247. package/dist/prompt/session-prompt.d.ts +24 -0
  248. package/dist/prompt/session-prompt.d.ts.map +1 -0
  249. package/dist/prompt/session-prompt.js +50 -0
  250. package/dist/prompt/session-prompt.js.map +1 -0
  251. package/dist/prompt/working-method.d.ts +7 -0
  252. package/dist/prompt/working-method.d.ts.map +1 -0
  253. package/dist/prompt/working-method.js +51 -0
  254. package/dist/prompt/working-method.js.map +1 -0
  255. package/dist/register-settings.d.ts +142 -0
  256. package/dist/register-settings.d.ts.map +1 -0
  257. package/dist/register-settings.js +51 -0
  258. package/dist/register-settings.js.map +1 -0
  259. package/dist/registry/loaded.d.ts +32 -0
  260. package/dist/registry/loaded.d.ts.map +1 -0
  261. package/dist/registry/loaded.js +41 -0
  262. package/dist/registry/loaded.js.map +1 -0
  263. package/dist/registry/register-connectors.d.ts +32 -0
  264. package/dist/registry/register-connectors.d.ts.map +1 -0
  265. package/dist/registry/register-connectors.js +126 -0
  266. package/dist/registry/register-connectors.js.map +1 -0
  267. package/dist/registry/register-sections.d.ts +18 -0
  268. package/dist/registry/register-sections.d.ts.map +1 -0
  269. package/dist/registry/register-sections.js +99 -0
  270. package/dist/registry/register-sections.js.map +1 -0
  271. package/dist/registry/session-points.d.ts +11 -0
  272. package/dist/registry/session-points.d.ts.map +1 -0
  273. package/dist/registry/session-points.js +89 -0
  274. package/dist/registry/session-points.js.map +1 -0
  275. package/dist/result-text.d.ts +11 -0
  276. package/dist/result-text.d.ts.map +1 -0
  277. package/dist/result-text.js +21 -0
  278. package/dist/result-text.js.map +1 -0
  279. package/dist/schemas/records.d.ts +357 -0
  280. package/dist/schemas/records.d.ts.map +1 -0
  281. package/dist/schemas/records.js +159 -0
  282. package/dist/schemas/records.js.map +1 -0
  283. package/dist/schemas/registry.d.ts +160 -0
  284. package/dist/schemas/registry.d.ts.map +1 -0
  285. package/dist/schemas/registry.js +37 -0
  286. package/dist/schemas/registry.js.map +1 -0
  287. package/dist/sessions/new-session.d.ts +6 -0
  288. package/dist/sessions/new-session.d.ts.map +1 -0
  289. package/dist/sessions/new-session.js +52 -0
  290. package/dist/sessions/new-session.js.map +1 -0
  291. package/dist/sessions/register-fork-export.d.ts +5 -0
  292. package/dist/sessions/register-fork-export.d.ts.map +1 -0
  293. package/dist/sessions/register-fork-export.js +62 -0
  294. package/dist/sessions/register-fork-export.js.map +1 -0
  295. package/dist/sessions/register-lifecycle.d.ts +3 -0
  296. package/dist/sessions/register-lifecycle.d.ts.map +1 -0
  297. package/dist/sessions/register-lifecycle.js +59 -0
  298. package/dist/sessions/register-lifecycle.js.map +1 -0
  299. package/dist/sessions/register-sessions.d.ts +3 -0
  300. package/dist/sessions/register-sessions.d.ts.map +1 -0
  301. package/dist/sessions/register-sessions.js +93 -0
  302. package/dist/sessions/register-sessions.js.map +1 -0
  303. package/dist/sessions/session-lookup.d.ts +10 -0
  304. package/dist/sessions/session-lookup.d.ts.map +1 -0
  305. package/dist/sessions/session-lookup.js +25 -0
  306. package/dist/sessions/session-lookup.js.map +1 -0
  307. package/dist/sessions/session-view.d.ts +118 -0
  308. package/dist/sessions/session-view.d.ts.map +1 -0
  309. package/dist/sessions/session-view.js +105 -0
  310. package/dist/sessions/session-view.js.map +1 -0
  311. package/dist/store/collections.d.ts +471 -0
  312. package/dist/store/collections.d.ts.map +1 -0
  313. package/dist/store/collections.js +46 -0
  314. package/dist/store/collections.js.map +1 -0
  315. package/dist/turns/background.d.ts +6 -0
  316. package/dist/turns/background.d.ts.map +1 -0
  317. package/dist/turns/background.js +27 -0
  318. package/dist/turns/background.js.map +1 -0
  319. package/dist/turns/cancel-turn.d.ts +3 -0
  320. package/dist/turns/cancel-turn.d.ts.map +1 -0
  321. package/dist/turns/cancel-turn.js +31 -0
  322. package/dist/turns/cancel-turn.js.map +1 -0
  323. package/dist/turns/compaction.d.ts +12 -0
  324. package/dist/turns/compaction.d.ts.map +1 -0
  325. package/dist/turns/compaction.js +55 -0
  326. package/dist/turns/compaction.js.map +1 -0
  327. package/dist/turns/end-turn.d.ts +15 -0
  328. package/dist/turns/end-turn.d.ts.map +1 -0
  329. package/dist/turns/end-turn.js +67 -0
  330. package/dist/turns/end-turn.js.map +1 -0
  331. package/dist/turns/history.d.ts +28 -0
  332. package/dist/turns/history.d.ts.map +1 -0
  333. package/dist/turns/history.js +47 -0
  334. package/dist/turns/history.js.map +1 -0
  335. package/dist/turns/lost-reply.d.ts +31 -0
  336. package/dist/turns/lost-reply.d.ts.map +1 -0
  337. package/dist/turns/lost-reply.js +43 -0
  338. package/dist/turns/lost-reply.js.map +1 -0
  339. package/dist/turns/message-blocks.d.ts +9 -0
  340. package/dist/turns/message-blocks.d.ts.map +1 -0
  341. package/dist/turns/message-blocks.js +25 -0
  342. package/dist/turns/message-blocks.js.map +1 -0
  343. package/dist/turns/model-context.d.ts +81 -0
  344. package/dist/turns/model-context.d.ts.map +1 -0
  345. package/dist/turns/model-context.js +46 -0
  346. package/dist/turns/model-context.js.map +1 -0
  347. package/dist/turns/model-info.d.ts +7 -0
  348. package/dist/turns/model-info.d.ts.map +1 -0
  349. package/dist/turns/model-info.js +10 -0
  350. package/dist/turns/model-info.js.map +1 -0
  351. package/dist/turns/model-retry.d.ts +3 -0
  352. package/dist/turns/model-retry.d.ts.map +1 -0
  353. package/dist/turns/model-retry.js +23 -0
  354. package/dist/turns/model-retry.js.map +1 -0
  355. package/dist/turns/register-interruptions.d.ts +3 -0
  356. package/dist/turns/register-interruptions.d.ts.map +1 -0
  357. package/dist/turns/register-interruptions.js +31 -0
  358. package/dist/turns/register-interruptions.js.map +1 -0
  359. package/dist/turns/register-turns.d.ts +3 -0
  360. package/dist/turns/register-turns.d.ts.map +1 -0
  361. package/dist/turns/register-turns.js +66 -0
  362. package/dist/turns/register-turns.js.map +1 -0
  363. package/dist/turns/resolve.d.ts +7 -0
  364. package/dist/turns/resolve.d.ts.map +1 -0
  365. package/dist/turns/resolve.js +29 -0
  366. package/dist/turns/resolve.js.map +1 -0
  367. package/dist/turns/run-calls.d.ts +34 -0
  368. package/dist/turns/run-calls.d.ts.map +1 -0
  369. package/dist/turns/run-calls.js +99 -0
  370. package/dist/turns/run-calls.js.map +1 -0
  371. package/dist/turns/run-command.d.ts +26 -0
  372. package/dist/turns/run-command.d.ts.map +1 -0
  373. package/dist/turns/run-command.js +118 -0
  374. package/dist/turns/run-command.js.map +1 -0
  375. package/dist/turns/settle-calls.d.ts +17 -0
  376. package/dist/turns/settle-calls.d.ts.map +1 -0
  377. package/dist/turns/settle-calls.js +98 -0
  378. package/dist/turns/settle-calls.js.map +1 -0
  379. package/dist/turns/start-turn.d.ts +87 -0
  380. package/dist/turns/start-turn.d.ts.map +1 -0
  381. package/dist/turns/start-turn.js +40 -0
  382. package/dist/turns/start-turn.js.map +1 -0
  383. package/dist/turns/step.d.ts +8 -0
  384. package/dist/turns/step.d.ts.map +1 -0
  385. package/dist/turns/step.js +168 -0
  386. package/dist/turns/step.js.map +1 -0
  387. package/dist/ui/register-ui.d.ts +3 -0
  388. package/dist/ui/register-ui.d.ts.map +1 -0
  389. package/dist/ui/register-ui.js +75 -0
  390. package/dist/ui/register-ui.js.map +1 -0
  391. package/dist/web/components/call.css +2 -0
  392. package/dist/web/components/call.js +386 -0
  393. package/dist/web/components/connectors.css +2 -0
  394. package/dist/web/components/connectors.js +2403 -0
  395. package/dist/web/components/conversation.css +2 -0
  396. package/dist/web/components/conversation.js +4319 -0
  397. package/dist/web/components/mcp-sign-in.css +2 -0
  398. package/dist/web/components/mcp-sign-in.js +265 -0
  399. package/dist/web/components/model.css +2 -0
  400. package/dist/web/components/model.js +545 -0
  401. package/dist/web/components/question.css +2 -0
  402. package/dist/web/components/question.js +321 -0
  403. package/dist/web/components/sessions.css +2 -0
  404. package/dist/web/components/sessions.js +264 -0
  405. package/docs/connectors.md +86 -0
  406. package/docs/sections.md +27 -0
  407. package/locales/ar.json +418 -0
  408. package/locales/en.json +418 -0
  409. package/package.json +70 -0
@@ -0,0 +1,4319 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, inject as u, nextTick as d, normalizeClass as f, onBeforeUnmount as p, onMounted as m, onUnmounted as h, openBlock as g, reactive as _, ref as v, renderList as y, renderSlot as b, resolveDynamicComponent as x, shallowReactive as S, shallowRef as C, toDisplayString as w, useTemplateRef as T, vModelText as E, watch as D, withCtx as O, withDirectives as k, withKeys as A, withModifiers as j } from "vue";
2
+ //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/defaultAttributes.mjs
3
+ var M = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: 24,
6
+ height: 24,
7
+ viewBox: "0 0 24 24",
8
+ fill: "none",
9
+ stroke: "currentColor",
10
+ "stroke-width": 2,
11
+ "stroke-linecap": "round",
12
+ "stroke-linejoin": "round"
13
+ }, N = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim();
14
+ //#endregion
15
+ //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/buildLucideIconNode.mjs
16
+ function P(e) {
17
+ return e != null;
18
+ }
19
+ function F(e, t = {}) {
20
+ let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? M.width, a = e.size ?? e.height ?? M.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? N(...c) : N("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? M["stroke-width"]) * Number(e.size ?? e.width ?? M.width) / Number(t.size ?? t.width ?? M.width) : t.strokeWidth ?? M["stroke-width"];
21
+ return [
22
+ "svg",
23
+ {
24
+ ...Object.entries(M).reduce((e, [t, n]) => (e[r(t)] = n, e), {}),
25
+ ..."color" in t && t.color && { [r("stroke")]: t.color },
26
+ ..."size" in t && P(t.size) && {
27
+ [r("width")]: t.size,
28
+ [r("height")]: t.size
29
+ },
30
+ ..."width" in t && P(t.width) && { [r("width")]: t.width },
31
+ ..."height" in t && P(t.height) && { [r("height")]: t.height },
32
+ [r("stroke-width")]: u,
33
+ ...l && { [r("class")]: l },
34
+ [r("viewBox")]: `0 0 ${i} ${a}`,
35
+ ...t.hasA11yProp === !1 ? { [r("aria-hidden")]: "true" } : {},
36
+ ..."attributes" in t && t.attributes
37
+ },
38
+ e.node.map((e) => {
39
+ let [n, i, a] = e, o = t.nonScalingStroke ? {
40
+ [r("vector-effect")]: "non-scaling-stroke",
41
+ ...i
42
+ } : i;
43
+ return a ? [
44
+ n,
45
+ o,
46
+ a
47
+ ] : [n, o];
48
+ })
49
+ ];
50
+ }
51
+ //#endregion
52
+ //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/hasA11yProp.mjs
53
+ var I = (e) => {
54
+ for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
55
+ return !1;
56
+ }, L = (e) => e === "", R = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ee = /* @__PURE__ */ Symbol("lucide-icons");
57
+ function te() {
58
+ return u(ee, {});
59
+ }
60
+ //#endregion
61
+ //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
62
+ var ne = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
63
+ name: e && R(e),
64
+ node: t ?? n ?? [],
65
+ size: 24,
66
+ aliases: []
67
+ }, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
68
+ let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = te(), C = L(i) || L(a) || i === !0 || a === !0 || b === !0, w = L(o) || L(s) || o === !0 || s === !0 || x === !0;
69
+ delete h.class;
70
+ let T = g.default?.(), [, E, D = []] = F(r, {
71
+ color: m ?? v,
72
+ width: f ?? d ?? _,
73
+ height: p ?? d ?? _,
74
+ strokeWidth: c ?? u ?? y,
75
+ absoluteStrokeWidth: C,
76
+ nonScalingStroke: w,
77
+ className: S,
78
+ hasA11yProp: T != null && T.length > 0 || I(h),
79
+ attributes: h
80
+ });
81
+ return l("svg", E, [...D.map(([e, t]) => l(e, t)), ...T ?? []]);
82
+ };
83
+ //#endregion
84
+ //#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
85
+ function z(e, t = []) {
86
+ let n = typeof e == "string" ? {
87
+ name: e,
88
+ node: t
89
+ } : e;
90
+ return (e, { slots: t }) => l(ne, {
91
+ ...e,
92
+ icon: n
93
+ }, t.default ? { default: t.default } : void 0);
94
+ }
95
+ var re = z({
96
+ name: "arrow-down",
97
+ size: 24,
98
+ node: [["path", {
99
+ d: "M12 5v14",
100
+ key: "s699le"
101
+ }], ["path", {
102
+ d: "m19 12-7 7-7-7",
103
+ key: "1idqje"
104
+ }]]
105
+ }), ie = z({
106
+ name: "arrow-left",
107
+ size: 24,
108
+ node: [["path", {
109
+ d: "m12 19-7-7 7-7",
110
+ key: "1l729n"
111
+ }], ["path", {
112
+ d: "M19 12H5",
113
+ key: "x3x0zl"
114
+ }]]
115
+ }), ae = z({
116
+ name: "arrow-up",
117
+ size: 24,
118
+ node: [["path", {
119
+ d: "m5 12 7-7 7 7",
120
+ key: "hav0vg"
121
+ }], ["path", {
122
+ d: "M12 19V5",
123
+ key: "x0mq9r"
124
+ }]]
125
+ }), oe = z({
126
+ name: "bell-ring",
127
+ size: 24,
128
+ node: [
129
+ ["path", {
130
+ d: "M10.268 21a2 2 0 0 0 3.464 0",
131
+ key: "vwvbt9"
132
+ }],
133
+ ["path", {
134
+ d: "M22 8c0-2.3-.8-4.3-2-6",
135
+ key: "5bb3ad"
136
+ }],
137
+ ["path", {
138
+ d: "M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",
139
+ key: "11g9vi"
140
+ }],
141
+ ["path", {
142
+ d: "M4 2C2.8 3.7 2 5.7 2 8",
143
+ key: "tap9e0"
144
+ }]
145
+ ]
146
+ }), se = z({
147
+ name: "bot",
148
+ size: 24,
149
+ node: [
150
+ ["path", {
151
+ d: "M12 8V4H8",
152
+ key: "hb8ula"
153
+ }],
154
+ ["rect", {
155
+ width: "16",
156
+ height: "12",
157
+ x: "4",
158
+ y: "8",
159
+ rx: "2",
160
+ key: "enze0r"
161
+ }],
162
+ ["path", {
163
+ d: "M2 14h2",
164
+ key: "vft8re"
165
+ }],
166
+ ["path", {
167
+ d: "M20 14h2",
168
+ key: "4cs60a"
169
+ }],
170
+ ["path", {
171
+ d: "M15 13v2",
172
+ key: "1xurst"
173
+ }],
174
+ ["path", {
175
+ d: "M9 13v2",
176
+ key: "rq6x2g"
177
+ }]
178
+ ]
179
+ }), ce = z({
180
+ name: "check",
181
+ size: 24,
182
+ node: [["path", {
183
+ d: "M20 6 9 17l-5-5",
184
+ key: "1gmf2c"
185
+ }]]
186
+ }), B = z({
187
+ name: "chevron-down",
188
+ size: 24,
189
+ node: [["path", {
190
+ d: "m6 9 6 6 6-6",
191
+ key: "qrunsl"
192
+ }]]
193
+ }), le = z({
194
+ name: "chevron-right",
195
+ size: 24,
196
+ node: [["path", {
197
+ d: "m9 18 6-6-6-6",
198
+ key: "mthhwq"
199
+ }]]
200
+ }), ue = z({
201
+ name: "circle-check",
202
+ size: 24,
203
+ node: [["circle", {
204
+ cx: "12",
205
+ cy: "12",
206
+ r: "10",
207
+ key: "1mglay"
208
+ }], ["path", {
209
+ d: "m16 9-5.5 5.5L8 12",
210
+ key: "xofnsj"
211
+ }]],
212
+ aliases: ["check-circle-2"]
213
+ }), de = z({
214
+ name: "circle-question-mark",
215
+ size: 24,
216
+ node: [
217
+ ["circle", {
218
+ cx: "12",
219
+ cy: "12",
220
+ r: "10",
221
+ key: "1mglay"
222
+ }],
223
+ ["path", {
224
+ d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",
225
+ key: "1u773s"
226
+ }],
227
+ ["path", {
228
+ d: "M12 17h.01",
229
+ key: "p32p05"
230
+ }]
231
+ ],
232
+ aliases: ["help-circle", "circle-help"]
233
+ }), fe = z({
234
+ name: "code",
235
+ size: 24,
236
+ node: [["path", {
237
+ d: "m16 18 6-6-6-6",
238
+ key: "eg8j8"
239
+ }], ["path", {
240
+ d: "m8 6-6 6 6 6",
241
+ key: "ppft3o"
242
+ }]]
243
+ }), pe = z({
244
+ name: "copy",
245
+ size: 24,
246
+ node: [["rect", {
247
+ width: "14",
248
+ height: "14",
249
+ x: "8",
250
+ y: "8",
251
+ rx: "2",
252
+ ry: "2",
253
+ key: "17jyea"
254
+ }], ["path", {
255
+ d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
256
+ key: "zix9uf"
257
+ }]]
258
+ }), me = z({
259
+ name: "ellipsis",
260
+ size: 24,
261
+ node: [
262
+ ["circle", {
263
+ cx: "12",
264
+ cy: "12",
265
+ r: "1",
266
+ key: "41hilf"
267
+ }],
268
+ ["circle", {
269
+ cx: "19",
270
+ cy: "12",
271
+ r: "1",
272
+ key: "1wjl8i"
273
+ }],
274
+ ["circle", {
275
+ cx: "5",
276
+ cy: "12",
277
+ r: "1",
278
+ key: "1pcz8c"
279
+ }]
280
+ ],
281
+ aliases: ["more-horizontal"]
282
+ }), he = z({
283
+ name: "external-link",
284
+ size: 24,
285
+ node: [
286
+ ["path", {
287
+ d: "M15 3h6v6",
288
+ key: "1q9fwt"
289
+ }],
290
+ ["path", {
291
+ d: "M10 14 21 3",
292
+ key: "gplh6r"
293
+ }],
294
+ ["path", {
295
+ d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
296
+ key: "a6xqqp"
297
+ }]
298
+ ]
299
+ }), ge = z({
300
+ name: "eye",
301
+ size: 24,
302
+ node: [["path", {
303
+ d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
304
+ key: "1nclc0"
305
+ }], ["circle", {
306
+ cx: "12",
307
+ cy: "12",
308
+ r: "3",
309
+ key: "1v7zrd"
310
+ }]]
311
+ }), _e = z({
312
+ name: "info",
313
+ size: 24,
314
+ node: [
315
+ ["circle", {
316
+ cx: "12",
317
+ cy: "12",
318
+ r: "10",
319
+ key: "1mglay"
320
+ }],
321
+ ["path", {
322
+ d: "M12 16v-4",
323
+ key: "1dtifu"
324
+ }],
325
+ ["path", {
326
+ d: "M12 8h.01",
327
+ key: "e9boi3"
328
+ }]
329
+ ]
330
+ }), ve = z({
331
+ name: "notebook-text",
332
+ size: 24,
333
+ node: [
334
+ ["path", {
335
+ d: "M2 6h4",
336
+ key: "aawbzj"
337
+ }],
338
+ ["path", {
339
+ d: "M2 10h4",
340
+ key: "l0bgd4"
341
+ }],
342
+ ["path", {
343
+ d: "M2 14h4",
344
+ key: "1gsvsf"
345
+ }],
346
+ ["path", {
347
+ d: "M2 18h4",
348
+ key: "1bu2t1"
349
+ }],
350
+ ["rect", {
351
+ width: "16",
352
+ height: "20",
353
+ x: "4",
354
+ y: "2",
355
+ rx: "2",
356
+ key: "1nb95v"
357
+ }],
358
+ ["path", {
359
+ d: "M9.5 8h5",
360
+ key: "11mslq"
361
+ }],
362
+ ["path", {
363
+ d: "M9.5 12H16",
364
+ key: "ktog6x"
365
+ }],
366
+ ["path", {
367
+ d: "M9.5 16H14",
368
+ key: "p1seyn"
369
+ }]
370
+ ]
371
+ }), ye = z({
372
+ name: "panel-right",
373
+ size: 24,
374
+ node: [["rect", {
375
+ width: "18",
376
+ height: "18",
377
+ x: "3",
378
+ y: "3",
379
+ rx: "2",
380
+ key: "afitv7"
381
+ }], ["path", {
382
+ d: "M15 3v18",
383
+ key: "14nvp0"
384
+ }]]
385
+ }), be = z({
386
+ name: "paperclip",
387
+ size: 24,
388
+ node: [["path", {
389
+ d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
390
+ key: "1miecu"
391
+ }]]
392
+ }), xe = z({
393
+ name: "rotate-cw",
394
+ size: 24,
395
+ node: [["path", {
396
+ d: "M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",
397
+ key: "1p45f6"
398
+ }], ["path", {
399
+ d: "M21 3v5h-5",
400
+ key: "1q7to0"
401
+ }]]
402
+ }), Se = z({
403
+ name: "scroll-text",
404
+ size: 24,
405
+ node: [
406
+ ["path", {
407
+ d: "M15 12h-5",
408
+ key: "r7krc0"
409
+ }],
410
+ ["path", {
411
+ d: "M15 8h-5",
412
+ key: "1khuty"
413
+ }],
414
+ ["path", {
415
+ d: "M19 17V5a2 2 0 0 0-2-2H4",
416
+ key: "zz82l3"
417
+ }],
418
+ ["path", {
419
+ d: "M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",
420
+ key: "1ph1d7"
421
+ }]
422
+ ]
423
+ }), Ce = z({
424
+ name: "search",
425
+ size: 24,
426
+ node: [["path", {
427
+ d: "m21 21-4.34-4.34",
428
+ key: "14j7rj"
429
+ }], ["circle", {
430
+ cx: "11",
431
+ cy: "11",
432
+ r: "8",
433
+ key: "4ej97u"
434
+ }]]
435
+ }), we = z({
436
+ name: "shield-alert",
437
+ size: 24,
438
+ node: [
439
+ ["path", {
440
+ d: "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",
441
+ key: "oel41y"
442
+ }],
443
+ ["path", {
444
+ d: "M12 8v4",
445
+ key: "1got3b"
446
+ }],
447
+ ["path", {
448
+ d: "M12 16h.01",
449
+ key: "1drbdi"
450
+ }]
451
+ ]
452
+ }), Te = z({
453
+ name: "square",
454
+ size: 24,
455
+ node: [["rect", {
456
+ width: "18",
457
+ height: "18",
458
+ x: "3",
459
+ y: "3",
460
+ rx: "2",
461
+ key: "afitv7"
462
+ }]]
463
+ }), Ee = z({
464
+ name: "x",
465
+ size: 24,
466
+ node: [["path", {
467
+ d: "M18 6 6 18",
468
+ key: "1bl5f8"
469
+ }], ["path", {
470
+ d: "m6 6 12 12",
471
+ key: "d8bk6v"
472
+ }]]
473
+ }), V = "<meta http-equiv=\"Content-Security-Policy\" content=\"default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src data:; font-src data:; media-src data:; form-action 'none'; base-uri 'none'\">", De = /^\s*<!doctype[^>]*>/i;
474
+ function Oe(e) {
475
+ let t = De.exec(e)?.[0];
476
+ return t === void 0 ? V + e : t + V + e.slice(t.length);
477
+ }
478
+ var ke = (e) => e.replaceAll("&", "&amp;").replaceAll("\"", "&quot;"), Ae = "html,body{margin:0;block-size:100%}iframe{display:block;border:0;inline-size:100%;block-size:100%}";
479
+ function je(e) {
480
+ return `<!doctype html>${V}<style>${Ae}</style><iframe sandbox="allow-scripts" referrerpolicy="no-referrer" srcdoc="${ke(Oe(e))}"></iframe>`;
481
+ }
482
+ //#endregion
483
+ //#region web/src/ArtifactFrame.vue?vue&type=script&setup=true&lang.ts
484
+ var Me = /*@__PURE__*/ c({
485
+ __name: "ArtifactFrame",
486
+ props: {
487
+ label: {
488
+ type: String,
489
+ required: !0
490
+ },
491
+ content: {
492
+ type: String,
493
+ required: !0
494
+ }
495
+ },
496
+ setup(e, { expose: n }) {
497
+ n();
498
+ let r = e, i = {
499
+ props: r,
500
+ srcdoc: t(() => je(r.content))
501
+ };
502
+ return Object.defineProperty(i, "__isScriptSetup", {
503
+ enumerable: !1,
504
+ value: !0
505
+ }), i;
506
+ }
507
+ }), H = (e, t) => {
508
+ let n = e.__vccOpts || e;
509
+ for (let [e, r] of t) n[e] = r;
510
+ return n;
511
+ }, Ne = ["title", "srcdoc"];
512
+ function Pe(e, t, n, r, a, o) {
513
+ return g(), i("iframe", {
514
+ class: "kvc-artifact-frame",
515
+ sandbox: "allow-scripts",
516
+ referrerpolicy: "no-referrer",
517
+ title: r.props.label,
518
+ srcdoc: r.srcdoc,
519
+ "data-test": "artifact-frame"
520
+ }, null, 8, Ne);
521
+ }
522
+ var Fe = /*#__PURE__*/ H(Me, [["render", Pe], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ArtifactFrame.vue"]]), Ie = /* @__PURE__ */ new Set(["localhost", "127.0.0.1"]), Le = {
523
+ "http:": "80",
524
+ "https:": "443"
525
+ }, Re = (e) => e.port === "" ? Le[e.protocol] ?? "" : e.port;
526
+ function ze(e, t) {
527
+ let n = e.trim();
528
+ if (n === "" || /\s/.test(n) || !URL.canParse(n)) return;
529
+ let r = new URL(n);
530
+ if ((r.protocol === "http:" || r.protocol === "https:") && Ie.has(r.hostname) && r.username === "" && r.password === "") return Re(r) === Re(t) ? void 0 : r.href;
531
+ }
532
+ //#endregion
533
+ //#region web/src/kvman.ts
534
+ function U() {
535
+ let e = u("kvman");
536
+ if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
537
+ return e;
538
+ }
539
+ var W = () => document.documentElement.lang === "" ? void 0 : document.documentElement.lang;
540
+ function G(e) {
541
+ return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
542
+ }
543
+ function Be(e, t) {
544
+ return t === "" ? e("kvcoder.ui.newChat") : t;
545
+ }
546
+ function Ve(e) {
547
+ let t = e.indexOf("/");
548
+ return t < 0 ? `kernel.errors.${e}` : `${e.slice(0, t)}.errors.${e.slice(t + 1)}`;
549
+ }
550
+ function He(e) {
551
+ if (!(e instanceof Error) || !("problem" in e)) return;
552
+ let t = e.problem;
553
+ if (typeof t == "object" && t && "code" in t && typeof t.code == "string") return {
554
+ code: t.code,
555
+ params: Ue("params" in t ? t.params : void 0)
556
+ };
557
+ }
558
+ function Ue(e) {
559
+ return Object.fromEntries(Object.entries(G(e)).map(([e, t]) => [e, typeof t == "string" ? t : JSON.stringify(t)]));
560
+ }
561
+ var We = 200, Ge = /^(\d{3}:)?\s*\{.*?"message"\s*:\s*"((?:[^"\\]|\\.)*)"/s;
562
+ function Ke(e) {
563
+ let t = Ge.exec(e);
564
+ return t?.[2] === void 0 ? e : `${t[1] === void 0 ? "" : `${t[1]} `}${t[2].replaceAll("\\\"", "\"")}`;
565
+ }
566
+ function qe(e) {
567
+ let { reason: t } = G(e);
568
+ if (typeof t != "string" || t.trim() === "") return;
569
+ let n = Ke(t);
570
+ return n.length > We ? `${n.slice(0, We)}…` : n;
571
+ }
572
+ function K(e, t) {
573
+ let n = He(t);
574
+ e.toast(n === void 0 ? "kvcoder.ui.failed" : Ve(n.code), n?.params ?? {}, "error");
575
+ }
576
+ var Je = /* @__PURE__ */ new Set([
577
+ "Arab",
578
+ "Hebr",
579
+ "Thaa",
580
+ "Syrc",
581
+ "Nkoo",
582
+ "Adlm"
583
+ ]);
584
+ function Ye(e) {
585
+ let t = e === void 0 ? void 0 : new Intl.Locale(e).maximize().script;
586
+ return t !== void 0 && Je.has(t);
587
+ }
588
+ var Xe = (e, t) => Ye(t) ? `\u2066${e}\u2069` : e, Ze = (e) => Ye(W()) ? `\u2068${e}\u2069` : e;
589
+ function Qe(e) {
590
+ let t = W(), n = {
591
+ style: "currency",
592
+ currency: "USD"
593
+ };
594
+ return Xe(e === 0 || e >= .01 ? new Intl.NumberFormat(t, n).format(e) : new Intl.NumberFormat(t, e < 1e-4 ? {
595
+ ...n,
596
+ maximumSignificantDigits: 1
597
+ } : {
598
+ ...n,
599
+ minimumFractionDigits: 4
600
+ }).format(e), t);
601
+ }
602
+ function $e(e, t, n) {
603
+ let r = new Intl.NumberFormat(W(), {
604
+ notation: "compact",
605
+ maximumFractionDigits: 1
606
+ }).format(t.input + t.output), i = Qe(t.cost), a = Math.round(n / 1e3);
607
+ return e("kvcoder.ui.totals", {
608
+ time: a < 60 ? e("kvcoder.ui.seconds", { count: a }) : e("kvcoder.ui.minutes", { count: Math.round(a / 60) }),
609
+ tokens: r,
610
+ cost: i
611
+ });
612
+ }
613
+ //#endregion
614
+ //#region web/src/ArtifactUrlFrame.vue?vue&type=script&setup=true&lang.ts
615
+ var et = /*@__PURE__*/ c({
616
+ __name: "ArtifactUrlFrame",
617
+ props: {
618
+ label: {
619
+ type: String,
620
+ required: !0
621
+ },
622
+ content: {
623
+ type: String,
624
+ required: !0
625
+ }
626
+ },
627
+ setup(e, { expose: n }) {
628
+ n();
629
+ let r = e, i = {
630
+ props: r,
631
+ kvman: U(),
632
+ address: t(() => ze(r.content, window.location))
633
+ };
634
+ return Object.defineProperty(i, "__isScriptSetup", {
635
+ enumerable: !1,
636
+ value: !0
637
+ }), i;
638
+ }
639
+ }), tt = ["title", "src"], nt = {
640
+ key: 1,
641
+ class: "kvc-muted",
642
+ role: "alert",
643
+ "data-test": "artifact-url-refused"
644
+ };
645
+ function rt(e, t, n, r, a, o) {
646
+ return r.address === void 0 ? (g(), i("p", nt, w(r.kvman.t("kvcoder.ui.artifacts.urlRefused")), 1)) : (g(), i("iframe", {
647
+ key: 0,
648
+ class: "kvc-artifact-frame",
649
+ sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-modals allow-downloads",
650
+ referrerpolicy: "no-referrer",
651
+ title: r.props.label,
652
+ src: r.address,
653
+ "data-test": "artifact-url-frame"
654
+ }, null, 8, tt));
655
+ }
656
+ var it = /*#__PURE__*/ H(et, [["render", rt], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ArtifactUrlFrame.vue"]]), at = /*@__PURE__*/ c({
657
+ __name: "ArtifactPanel",
658
+ props: {
659
+ list: {
660
+ type: Array,
661
+ required: !0
662
+ },
663
+ shown: {
664
+ type: null,
665
+ required: !0
666
+ },
667
+ content: {
668
+ type: null,
669
+ required: !0
670
+ }
671
+ },
672
+ emits: ["select", "close"],
673
+ setup(e, { expose: n, emit: r }) {
674
+ n();
675
+ let i = e, a = r, o = U(), s = t(() => i.list.find((e) => e.id === i.shown)), c = t(() => i.content?.id === i.shown ? i.content : void 0), l = t(() => c.value?.title ?? s.value?.title ?? ""), u = t(() => c.value?.version ?? s.value?.version ?? 1), d = t(() => c.value?.format ?? s.value?.format ?? "markdown"), f = t(() => c.value?.content ?? ""), p = t(() => o.t("kvcoder.ui.artifacts.frameLabel", { title: l.value })), m = v("preview");
676
+ D(() => i.shown, () => m.value = "preview");
677
+ async function h() {
678
+ try {
679
+ await navigator.clipboard.writeText(f.value), o.toast("kvcoder.ui.copied", {}, "success");
680
+ } catch (e) {
681
+ K(o, e);
682
+ }
683
+ }
684
+ let g = {
685
+ props: i,
686
+ emit: a,
687
+ kvman: o,
688
+ summary: s,
689
+ current: c,
690
+ title: l,
691
+ version: u,
692
+ format: d,
693
+ body: f,
694
+ frameLabel: p,
695
+ mode: m,
696
+ copy: h,
697
+ openable: t(() => d.value === "url" ? ze(f.value, window.location) : void 0),
698
+ markdownView: t(() => ({
699
+ type: "markdown",
700
+ text: "kvcoder.markdown",
701
+ params: { text: f.value }
702
+ })),
703
+ get Code() {
704
+ return fe;
705
+ },
706
+ get Copy() {
707
+ return pe;
708
+ },
709
+ get ExternalLink() {
710
+ return he;
711
+ },
712
+ get Eye() {
713
+ return ge;
714
+ },
715
+ get X() {
716
+ return Ee;
717
+ },
718
+ ArtifactFrame: Fe,
719
+ ArtifactUrlFrame: it
720
+ };
721
+ return Object.defineProperty(g, "__isScriptSetup", {
722
+ enumerable: !1,
723
+ value: !0
724
+ }), g;
725
+ }
726
+ }), ot = ["aria-label"], st = { class: "kvc-artifact-head" }, ct = { class: "kvc-artifact-name" }, lt = {
727
+ key: 0,
728
+ role: "tablist",
729
+ class: "kvc-artifact-tabs"
730
+ }, ut = [
731
+ "aria-selected",
732
+ "data-test",
733
+ "onClick"
734
+ ], dt = {
735
+ key: 1,
736
+ class: "kvc-artifact-title kvc-oneline",
737
+ "data-test": "artifact-title"
738
+ }, ft = {
739
+ class: "kvc-muted",
740
+ "data-test": "artifact-meta"
741
+ }, pt = { "data-test": "artifact-format" }, mt = { "data-test": "artifact-version" }, ht = { class: "kvc-artifact-actions" }, gt = ["aria-label"], _t = [
742
+ "aria-pressed",
743
+ "aria-label",
744
+ "title"
745
+ ], vt = { class: "kvc-tab-text" }, yt = [
746
+ "aria-pressed",
747
+ "aria-label",
748
+ "title"
749
+ ], bt = { class: "kvc-tab-text" }, xt = [
750
+ "href",
751
+ "aria-label",
752
+ "title"
753
+ ], St = [
754
+ "disabled",
755
+ "aria-label",
756
+ "title"
757
+ ], Ct = ["aria-label", "title"], wt = {
758
+ class: "kvc-artifact-body",
759
+ "data-test": "artifact-body"
760
+ }, Tt = {
761
+ key: 0,
762
+ class: "kvc-artifact-source",
763
+ dir: "ltr",
764
+ "data-test": "artifact-source"
765
+ };
766
+ function Et(t, c, l, u, d, f) {
767
+ return g(), i("aside", {
768
+ class: "kvc-artifact-panel",
769
+ "data-test": "artifact-panel",
770
+ "aria-label": u.kvman.t("kvcoder.ui.artifacts.title")
771
+ }, [a("div", st, [a("div", ct, [u.props.list.length > 1 ? (g(), i("div", lt, [(g(!0), i(e, null, y(u.props.list, (e) => (g(), i("button", {
772
+ key: e.id,
773
+ type: "button",
774
+ role: "tab",
775
+ class: "kvc-tab",
776
+ "aria-selected": e.id === u.props.shown,
777
+ "data-test": `artifact-tab-${e.id}`,
778
+ onClick: (t) => u.emit("select", e.id)
779
+ }, w(e.title), 9, ut))), 128))])) : (g(), i("span", dt, w(u.title), 1)), a("span", ft, [
780
+ a("span", pt, w(u.kvman.t(`kvcoder.ui.artifacts.format.${u.format}`)), 1),
781
+ c[3] ||= o(" · ", -1),
782
+ a("span", mt, w(u.kvman.t("kvcoder.ui.artifacts.version", { version: u.version })), 1)
783
+ ])]), a("div", ht, [
784
+ a("div", {
785
+ class: "kvc-tabs",
786
+ role: "group",
787
+ "aria-label": u.kvman.t("kvcoder.ui.artifacts.view")
788
+ }, [a("button", {
789
+ type: "button",
790
+ class: "kvc-tab",
791
+ "aria-pressed": u.mode === "preview",
792
+ "aria-label": u.kvman.t("kvcoder.ui.artifacts.preview"),
793
+ title: u.kvman.t("kvcoder.ui.artifacts.preview"),
794
+ "data-test": "artifact-view-preview",
795
+ onClick: c[0] ||= (e) => u.mode = "preview"
796
+ }, [s(u.Eye, {
797
+ size: 16,
798
+ class: "kvc-tab-icon",
799
+ "aria-hidden": "true"
800
+ }), a("span", vt, w(u.kvman.t("kvcoder.ui.artifacts.preview")), 1)], 8, _t), a("button", {
801
+ type: "button",
802
+ class: "kvc-tab",
803
+ "aria-pressed": u.mode === "source",
804
+ "aria-label": u.kvman.t("kvcoder.ui.artifacts.source"),
805
+ title: u.kvman.t("kvcoder.ui.artifacts.source"),
806
+ "data-test": "artifact-view-source",
807
+ onClick: c[1] ||= (e) => u.mode = "source"
808
+ }, [s(u.Code, {
809
+ size: 16,
810
+ class: "kvc-tab-icon",
811
+ "aria-hidden": "true"
812
+ }), a("span", bt, w(u.kvman.t("kvcoder.ui.artifacts.source")), 1)], 8, yt)], 8, gt),
813
+ u.openable === void 0 ? r("v-if", !0) : (g(), i("a", {
814
+ key: 0,
815
+ href: u.openable,
816
+ target: "_blank",
817
+ rel: "noopener noreferrer",
818
+ class: "kvc-button kvc-icon-button",
819
+ "aria-label": u.kvman.t("kvcoder.ui.artifacts.openUrl"),
820
+ title: u.kvman.t("kvcoder.ui.artifacts.openUrl"),
821
+ "data-test": "artifact-open-url"
822
+ }, [s(u.ExternalLink, {
823
+ size: 16,
824
+ "aria-hidden": "true"
825
+ })], 8, xt)),
826
+ a("button", {
827
+ type: "button",
828
+ class: "kvc-button kvc-icon-button",
829
+ disabled: u.current === void 0,
830
+ "aria-label": u.kvman.t("kvcoder.ui.copy"),
831
+ title: u.kvman.t("kvcoder.ui.copy"),
832
+ "data-test": "artifact-copy",
833
+ onClick: u.copy
834
+ }, [s(u.Copy, {
835
+ size: 16,
836
+ "aria-hidden": "true"
837
+ })], 8, St),
838
+ a("button", {
839
+ type: "button",
840
+ class: "kvc-button kvc-icon-button",
841
+ "aria-label": u.kvman.t("kvcoder.ui.artifacts.close"),
842
+ title: u.kvman.t("kvcoder.ui.artifacts.close"),
843
+ "data-test": "artifact-close",
844
+ onClick: c[2] ||= (e) => u.emit("close")
845
+ }, [s(u.X, {
846
+ size: 16,
847
+ "aria-hidden": "true"
848
+ })], 8, Ct)
849
+ ])]), a("div", wt, [u.mode === "source" && u.current !== void 0 ? (g(), i("pre", Tt, w(u.body), 1)) : u.format === "markdown" && u.current !== void 0 ? (g(), n(x(u.kvman.View), {
850
+ key: 1,
851
+ view: u.markdownView
852
+ }, null, 8, ["view"])) : u.format === "html" && u.current !== void 0 ? (g(), n(u.ArtifactFrame, {
853
+ key: 2,
854
+ label: u.frameLabel,
855
+ content: u.body
856
+ }, null, 8, ["label", "content"])) : u.format === "url" && u.current !== void 0 ? (g(), n(u.ArtifactUrlFrame, {
857
+ key: 3,
858
+ label: u.frameLabel,
859
+ content: u.body
860
+ }, null, 8, ["label", "content"])) : r("v-if", !0)])], 8, ot);
861
+ }
862
+ var Dt = /*#__PURE__*/ H(at, [["render", Et], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ArtifactPanel.vue"]]), Ot = [
863
+ { name: "compact" },
864
+ { name: "export" },
865
+ { name: "fork" },
866
+ { name: "new" },
867
+ { name: "prompt" },
868
+ {
869
+ name: "rename",
870
+ argument: !0
871
+ }
872
+ ];
873
+ function kt(e) {
874
+ let t = /^\/(\S*)(\s+(.*))?$/.exec(e);
875
+ if (!(t === null || e.includes("\n"))) return {
876
+ word: t[1] ?? "",
877
+ argument: (t[3] ?? "").trim(),
878
+ named: t[2] !== void 0
879
+ };
880
+ }
881
+ function At(e) {
882
+ return Ot.filter((t) => e.named ? t.name === e.word : t.name.startsWith(e.word));
883
+ }
884
+ //#endregion
885
+ //#region web/src/MessageComposer.vue?vue&type=script&setup=true&lang.ts
886
+ var jt = /*@__PURE__*/ c({
887
+ __name: "MessageComposer",
888
+ props: {
889
+ running: {
890
+ type: Boolean,
891
+ required: !0
892
+ },
893
+ placeholder: {
894
+ type: String,
895
+ required: !0
896
+ },
897
+ blocked: {
898
+ type: Boolean,
899
+ required: !1,
900
+ skipCheck: !0
901
+ },
902
+ commands: {
903
+ type: null,
904
+ required: !1
905
+ }
906
+ },
907
+ emits: [
908
+ "send",
909
+ "stop",
910
+ "command"
911
+ ],
912
+ setup(e, { expose: n, emit: r }) {
913
+ n();
914
+ let i = e, a = r, o = U(), s = v(""), c = v([]), l = v(null), u = v(!1), d = v(0), f = v(!1), p = t(() => i.commands === void 0 ? void 0 : kt(s.value)), m = t(() => i.commands === "wait"), h = t(() => p.value === void 0 ? [] : At(p.value));
915
+ D(s, () => {
916
+ d.value = 0, f.value = !1;
917
+ });
918
+ async function g(e) {
919
+ u.value = !0;
920
+ try {
921
+ for (let t of e) {
922
+ let e = new URLSearchParams({
923
+ name: t.name,
924
+ workspaceId: o.workspace.value.id
925
+ }), n = await (await fetch(`/api/files?${e.toString()}`, {
926
+ method: "POST",
927
+ headers: { "content-type": t.type || "application/octet-stream" },
928
+ body: t
929
+ })).json(), r = typeof n == "object" && n && "file" in n && typeof n.file == "object" && n.file !== null && "id" in n.file ? String(n.file.id) : void 0;
930
+ r === void 0 ? o.toast("kvcoder.ui.uploadFailed", { name: t.name }, "error") : c.value = [...c.value, {
931
+ id: r,
932
+ name: t.name
933
+ }];
934
+ }
935
+ } finally {
936
+ u.value = !1;
937
+ }
938
+ }
939
+ async function _(e) {
940
+ let t = e.target;
941
+ t instanceof HTMLInputElement && t.files !== null && (await g([...t.files]), t.value = "");
942
+ }
943
+ function y(e) {
944
+ let t = [...e.clipboardData?.files ?? []];
945
+ t.length !== 0 && (e.preventDefault(), g(t));
946
+ }
947
+ function b() {
948
+ let e = h.value[d.value], t = p.value?.argument ?? "";
949
+ m.value || i.blocked === !0 || e === void 0 || "argument" in e && t === "" || (a("command", e.name, t), s.value = "");
950
+ }
951
+ function x() {
952
+ if (p.value !== void 0) return b();
953
+ let e = s.value.trim();
954
+ e === "" || u.value || i.blocked === !0 || (a("send", {
955
+ text: e,
956
+ fileIds: c.value.map((e) => e.id)
957
+ }), s.value = "", c.value = []);
958
+ }
959
+ function S(e) {
960
+ !m.value && h.value.length > 0 && (d.value = (d.value + e + h.value.length) % h.value.length);
961
+ }
962
+ function C(e) {
963
+ if (p.value === void 0) return !1;
964
+ let t = h.value[d.value];
965
+ if (e.key === "Escape") f.value = !0;
966
+ else if (e.key === "ArrowDown") S(1);
967
+ else if (e.key === "ArrowUp") S(-1);
968
+ else if (e.key === "Tab" && t !== void 0 && !m.value) s.value = `/${t.name} `;
969
+ else return !1;
970
+ return !0;
971
+ }
972
+ function w(e) {
973
+ if (C(e)) return e.preventDefault();
974
+ e.key !== "Enter" || e.shiftKey || e.isComposing || (e.preventDefault(), x());
975
+ }
976
+ let T = {
977
+ props: i,
978
+ emit: a,
979
+ kvman: o,
980
+ text: s,
981
+ files: c,
982
+ picker: l,
983
+ uploading: u,
984
+ highlight: d,
985
+ hidden: f,
986
+ typed: p,
987
+ waiting: m,
988
+ found: h,
989
+ attach: g,
990
+ chosen: _,
991
+ pasted: y,
992
+ runCommand: b,
993
+ send: x,
994
+ move: S,
995
+ commandKey: C,
996
+ onKey: w,
997
+ get ArrowUp() {
998
+ return ae;
999
+ },
1000
+ get Paperclip() {
1001
+ return be;
1002
+ },
1003
+ get Square() {
1004
+ return Te;
1005
+ },
1006
+ get X() {
1007
+ return Ee;
1008
+ }
1009
+ };
1010
+ return Object.defineProperty(T, "__isScriptSetup", {
1011
+ enumerable: !1,
1012
+ value: !0
1013
+ }), T;
1014
+ }
1015
+ }), Mt = { class: "kvc-composer" }, Nt = { class: "kvc-box" }, Pt = ["aria-label"], Ft = {
1016
+ key: 0,
1017
+ class: "kvc-muted kvc-none",
1018
+ "data-test": "slash-wait"
1019
+ }, It = [
1020
+ "aria-disabled",
1021
+ "aria-selected",
1022
+ "data-active",
1023
+ "data-test",
1024
+ "onMousemove",
1025
+ "onClick"
1026
+ ], Lt = { class: "kvc-slash-name" }, Rt = {
1027
+ class: "kvc-mono",
1028
+ dir: "ltr"
1029
+ }, zt = { class: "kvc-muted" }, Bt = {
1030
+ key: 1,
1031
+ class: "kvc-muted kvc-none",
1032
+ "data-test": "slash-none"
1033
+ }, Vt = {
1034
+ key: 1,
1035
+ style: {
1036
+ display: "flex",
1037
+ gap: "6px",
1038
+ "flex-wrap": "wrap"
1039
+ }
1040
+ }, Ht = ["aria-label", "onClick"], Ut = ["placeholder", "aria-label"], Wt = { class: "kvc-composer-row" }, Gt = [
1041
+ "aria-label",
1042
+ "title",
1043
+ "disabled"
1044
+ ], Kt = { class: "kvc-muted kvc-composer-hint" }, qt = ["aria-label", "disabled"];
1045
+ function Jt(t, n, c, l, u, d) {
1046
+ return g(), i("div", Mt, [a("div", Nt, [
1047
+ l.typed !== void 0 && !l.hidden ? (g(), i("div", {
1048
+ key: 0,
1049
+ class: "kvc-slash",
1050
+ role: "listbox",
1051
+ "aria-label": l.kvman.t("kvcoder.ui.slash.title"),
1052
+ "data-test": "slash-list"
1053
+ }, [
1054
+ l.waiting ? (g(), i("p", Ft, w(l.kvman.t("kvcoder.ui.slash.wait")), 1)) : r("v-if", !0),
1055
+ (g(!0), i(e, null, y(l.found, (t, n) => (g(), i("div", {
1056
+ key: t.name,
1057
+ class: "kvc-slash-row",
1058
+ role: "option",
1059
+ "aria-disabled": l.waiting,
1060
+ "aria-selected": !l.waiting && n === l.highlight,
1061
+ "data-active": !l.waiting && n === l.highlight,
1062
+ "data-test": `slash-${t.name}`,
1063
+ onMousemove: (e) => l.highlight = n,
1064
+ onClick: (e) => {
1065
+ l.highlight = n, l.runCommand();
1066
+ }
1067
+ }, [a("span", Lt, [a("span", Rt, [o("/" + w(t.name), 1), "argument" in t ? (g(), i(e, { key: 0 }, [o(" <" + w(l.kvman.t(`kvcoder.ui.slash.${t.name}.argument`)) + ">", 1)], 64)) : r("v-if", !0)])]), a("span", zt, w(l.kvman.t(`kvcoder.ui.slash.${t.name}`)), 1)], 40, It))), 128)),
1068
+ l.found.length === 0 ? (g(), i("p", Bt, w(l.kvman.t("kvcoder.ui.slash.none")), 1)) : r("v-if", !0)
1069
+ ], 8, Pt)) : r("v-if", !0),
1070
+ l.files.length > 0 ? (g(), i("div", Vt, [(g(!0), i(e, null, y(l.files, (e) => (g(), i("span", {
1071
+ key: e.id,
1072
+ class: "kvc-chip",
1073
+ "data-test": "attachment"
1074
+ }, [o(w(e.name), 1), a("button", {
1075
+ type: "button",
1076
+ class: "kvc-ghost kvc-button",
1077
+ style: {
1078
+ "min-block-size": "20px",
1079
+ padding: "0"
1080
+ },
1081
+ "aria-label": l.kvman.t("kvcoder.ui.removeAttachment"),
1082
+ onClick: (t) => l.files = l.files.filter((t) => t.id !== e.id)
1083
+ }, [s(l.X, { size: 12 })], 8, Ht)]))), 128))])) : r("v-if", !0),
1084
+ k(a("textarea", {
1085
+ "onUpdate:modelValue": n[0] ||= (e) => l.text = e,
1086
+ placeholder: l.props.placeholder,
1087
+ "aria-label": l.props.placeholder,
1088
+ rows: "2",
1089
+ "data-test": "composer-text",
1090
+ onKeydown: l.onKey,
1091
+ onPaste: l.pasted
1092
+ }, null, 40, Ut), [[E, l.text]]),
1093
+ a("div", Wt, [
1094
+ a("input", {
1095
+ ref: "picker",
1096
+ type: "file",
1097
+ multiple: "",
1098
+ hidden: "",
1099
+ "data-test": "composer-files",
1100
+ onChange: l.chosen
1101
+ }, null, 544),
1102
+ a("button", {
1103
+ type: "button",
1104
+ class: "kvc-button",
1105
+ "aria-label": l.kvman.t("kvcoder.ui.attach"),
1106
+ title: l.kvman.t("kvcoder.ui.attach"),
1107
+ disabled: l.uploading,
1108
+ onClick: n[1] ||= (e) => l.picker?.click()
1109
+ }, [s(l.Paperclip, { size: 16 })], 8, Gt),
1110
+ b(t.$slots, "controls"),
1111
+ a("span", Kt, w(l.kvman.t("kvcoder.ui.enterSends")), 1),
1112
+ l.props.running ? (g(), i("button", {
1113
+ key: 0,
1114
+ type: "button",
1115
+ class: "kvc-button",
1116
+ "data-test": "stop",
1117
+ onClick: n[2] ||= (e) => l.emit("stop")
1118
+ }, [s(l.Square, { size: 14 }), o(w(l.kvman.t("kvcoder.ui.stop")), 1)])) : r("v-if", !0),
1119
+ a("button", {
1120
+ type: "button",
1121
+ class: "kvc-button kvc-primary",
1122
+ "aria-label": l.kvman.t("kvcoder.ui.send"),
1123
+ disabled: l.text.trim() === "" || l.uploading || l.props.blocked === !0,
1124
+ "data-test": "send",
1125
+ onClick: l.send
1126
+ }, [s(l.ArrowUp, { size: 16 })], 8, qt)
1127
+ ])
1128
+ ])]);
1129
+ }
1130
+ var Yt = /*#__PURE__*/ H(jt, [["render", Jt], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/MessageComposer.vue"]]);
1131
+ //#endregion
1132
+ //#region web/src/model-groups.ts
1133
+ function Xt(e, t, n) {
1134
+ let r = new Map(e.map((e) => [e.id, e.title])), i = new Set(e.filter((e) => e.status !== "needsKey").map((e) => e.id)), a = t.filter((e) => i.has(e.provider) || e.id === n), o = /* @__PURE__ */ new Map();
1135
+ for (let e of a) {
1136
+ let t = o.get(e.provider) ?? {
1137
+ provider: e.provider,
1138
+ title: r.get(e.provider) ?? e.provider,
1139
+ models: []
1140
+ };
1141
+ t.models.push({
1142
+ id: e.id,
1143
+ name: e.name
1144
+ }), o.set(e.provider, t);
1145
+ }
1146
+ return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
1147
+ }
1148
+ function Zt(e, t) {
1149
+ let n = t.toLowerCase().split(/\s+/).filter((e) => e !== ""), r = (e) => n.every((t) => `${e.name} ${e.id}`.toLowerCase().includes(t)), i = e.map((e) => ({
1150
+ ...e,
1151
+ models: e.models.filter(r)
1152
+ })).filter((e) => e.models.length > 0);
1153
+ return {
1154
+ groups: i,
1155
+ shown: i.reduce((e, t) => e + t.models.length, 0),
1156
+ total: e.reduce((e, t) => e + t.models.length, 0)
1157
+ };
1158
+ }
1159
+ var q = [
1160
+ "off",
1161
+ "minimal",
1162
+ "low",
1163
+ "medium",
1164
+ "high"
1165
+ ], J = 24, Qt = /*@__PURE__*/ c({
1166
+ __name: "ModelPicker",
1167
+ props: {
1168
+ groups: {
1169
+ type: Array,
1170
+ required: !0
1171
+ },
1172
+ current: {
1173
+ type: [String, null],
1174
+ required: !0
1175
+ },
1176
+ empty: {
1177
+ type: null,
1178
+ required: !1
1179
+ },
1180
+ none: {
1181
+ type: null,
1182
+ required: !1
1183
+ },
1184
+ disabled: {
1185
+ type: Boolean,
1186
+ required: !1
1187
+ }
1188
+ },
1189
+ emits: ["pick", "none"],
1190
+ setup(e, { expose: n, emit: r }) {
1191
+ n();
1192
+ let i = e, a = r, o = U(), s = v(!1), c = v(""), l = v(0), u = T("trigger"), f = T("search"), m = T("panel"), h = t(() => Zt(i.groups, c.value)), g = t(() => h.value.groups.flatMap((e) => e.models)), _ = t(() => i.groups.flatMap((e) => e.models).find((e) => e.id === i.current)?.name ?? i.current ?? i.empty ?? ""), y = t(() => i.none !== void 0 && c.value.trim() === ""), b = t(() => +!!y.value), x = t(() => g.value.length + b.value), S = (e) => {
1193
+ let t = g.value.findIndex((t) => t.id === e);
1194
+ return t < 0 ? -1 : t + b.value;
1195
+ };
1196
+ function C() {
1197
+ s.value = !1, u.value?.focus();
1198
+ }
1199
+ async function w() {
1200
+ c.value = "", l.value = Math.max(S(i.current ?? ""), 0), E = 0, s.value = !0, await d(), k(), f.value?.focus(), j();
1201
+ }
1202
+ let E = 0, O = 0;
1203
+ function k() {
1204
+ let e = m.value, t = u.value?.closest(".kvc-conversation")?.getBoundingClientRect();
1205
+ if (e === null || t === void 0) return;
1206
+ let n = e.getBoundingClientRect(), r = t.left + J - (n.left - E), i = t.right - J - (n.right - E), a = r > 0 ? r : i < 0 ? i : 0;
1207
+ a !== E && (E = a, e.style.translate = `${a}px 0`);
1208
+ }
1209
+ function A() {
1210
+ k(), O = requestAnimationFrame(A);
1211
+ }
1212
+ function j() {
1213
+ m.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
1214
+ }
1215
+ async function M(e) {
1216
+ x.value !== 0 && (l.value = (l.value + e + x.value) % x.value, await d(), j());
1217
+ }
1218
+ function N(e) {
1219
+ e !== void 0 && (a("pick", e), C());
1220
+ }
1221
+ function P() {
1222
+ a("none"), C();
1223
+ }
1224
+ function F() {
1225
+ y.value && l.value === 0 ? P() : N(g.value[l.value - b.value]?.id);
1226
+ }
1227
+ function I(e) {
1228
+ e.target instanceof Node && !u.value?.parentElement?.contains(e.target) && (s.value = !1);
1229
+ }
1230
+ D(c, () => l.value = 0), D(s, (e) => {
1231
+ e ? (document.addEventListener("pointerdown", I), O = requestAnimationFrame(A)) : (document.removeEventListener("pointerdown", I), cancelAnimationFrame(O));
1232
+ }), p(() => {
1233
+ document.removeEventListener("pointerdown", I), cancelAnimationFrame(O);
1234
+ });
1235
+ let L = {
1236
+ props: i,
1237
+ emit: a,
1238
+ kvman: o,
1239
+ open: s,
1240
+ query: c,
1241
+ highlight: l,
1242
+ trigger: u,
1243
+ search: f,
1244
+ panel: m,
1245
+ gutterPx: J,
1246
+ found: h,
1247
+ models: g,
1248
+ label: _,
1249
+ offersNone: y,
1250
+ first: b,
1251
+ count: x,
1252
+ indexOf: S,
1253
+ close: C,
1254
+ show: w,
1255
+ get shift() {
1256
+ return E;
1257
+ },
1258
+ set shift(e) {
1259
+ E = e;
1260
+ },
1261
+ get frame() {
1262
+ return O;
1263
+ },
1264
+ set frame(e) {
1265
+ O = e;
1266
+ },
1267
+ keepInside: k,
1268
+ follow: A,
1269
+ scrollToHighlight: j,
1270
+ move: M,
1271
+ pick: N,
1272
+ pickNone: P,
1273
+ pickHighlighted: F,
1274
+ outside: I,
1275
+ get Check() {
1276
+ return ce;
1277
+ },
1278
+ get ChevronDown() {
1279
+ return B;
1280
+ },
1281
+ get Search() {
1282
+ return Ce;
1283
+ }
1284
+ };
1285
+ return Object.defineProperty(L, "__isScriptSetup", {
1286
+ enumerable: !1,
1287
+ value: !0
1288
+ }), L;
1289
+ }
1290
+ }), $t = { class: "kvc-picker" }, en = [
1291
+ "aria-expanded",
1292
+ "aria-label",
1293
+ "disabled"
1294
+ ], tn = { class: "kvc-picker-label" }, nn = ["onKeydown"], rn = { class: "kvc-search" }, an = [
1295
+ "placeholder",
1296
+ "aria-label",
1297
+ "onKeydown"
1298
+ ], on = ["aria-label"], sn = ["aria-selected", "data-active"], cn = { class: "kvc-model-name" }, ln = {
1299
+ class: "kvc-group",
1300
+ role: "presentation",
1301
+ "data-test": "model-group"
1302
+ }, un = [
1303
+ "aria-selected",
1304
+ "data-active",
1305
+ "data-test",
1306
+ "onClick",
1307
+ "onMousemove"
1308
+ ], dn = { class: "kvc-model-name" }, fn = {
1309
+ key: 1,
1310
+ class: "kvc-muted kvc-none",
1311
+ "data-test": "model-none"
1312
+ }, pn = {
1313
+ class: "kvc-muted kvc-count",
1314
+ "data-test": "model-count"
1315
+ };
1316
+ function mn(t, o, c, l, u, d) {
1317
+ return g(), i("div", $t, [a("button", {
1318
+ ref: "trigger",
1319
+ type: "button",
1320
+ class: "kvc-button",
1321
+ "aria-haspopup": "listbox",
1322
+ "aria-expanded": l.open,
1323
+ "aria-label": `${l.kvman.t("kvcoder.ui.model")}: ${l.label}`,
1324
+ disabled: l.props.disabled,
1325
+ "data-test": "model-picker",
1326
+ onClick: o[0] ||= (e) => l.open ? l.close() : l.show()
1327
+ }, [a("span", tn, w(l.label), 1), s(l.ChevronDown, {
1328
+ size: 16,
1329
+ "aria-hidden": "true"
1330
+ })], 8, en), l.open ? (g(), i("div", {
1331
+ key: 0,
1332
+ ref: "panel",
1333
+ class: "kvc-popover",
1334
+ "data-test": "model-popover",
1335
+ onKeydown: A(j(l.close, ["stop"]), ["esc"])
1336
+ }, [
1337
+ a("label", rn, [s(l.Search, {
1338
+ size: 16,
1339
+ "aria-hidden": "true"
1340
+ }), k(a("input", {
1341
+ ref: "search",
1342
+ "onUpdate:modelValue": o[1] ||= (e) => l.query = e,
1343
+ type: "search",
1344
+ role: "combobox",
1345
+ "aria-expanded": "true",
1346
+ "aria-controls": "kvc-models",
1347
+ placeholder: l.kvman.t("kvcoder.ui.searchModels"),
1348
+ "aria-label": l.kvman.t("kvcoder.ui.searchModels"),
1349
+ "data-test": "model-search",
1350
+ onKeydown: [
1351
+ o[2] ||= A(j((e) => l.move(1), ["prevent"]), ["down"]),
1352
+ o[3] ||= A(j((e) => l.move(-1), ["prevent"]), ["up"]),
1353
+ A(j(l.pickHighlighted, ["prevent"]), ["enter"])
1354
+ ]
1355
+ }, null, 40, an), [[E, l.query]])]),
1356
+ a("div", {
1357
+ id: "kvc-models",
1358
+ class: "kvc-options",
1359
+ role: "listbox",
1360
+ "aria-label": l.kvman.t("kvcoder.ui.model")
1361
+ }, [
1362
+ l.offersNone ? (g(), i("div", {
1363
+ key: 0,
1364
+ class: "kvc-model",
1365
+ role: "option",
1366
+ "aria-selected": l.props.current === null,
1367
+ "data-active": l.highlight === 0,
1368
+ "data-test": "model-none-entry",
1369
+ onClick: l.pickNone,
1370
+ onMousemove: o[4] ||= (e) => l.highlight = 0
1371
+ }, [a("span", cn, w(l.props.none), 1), l.props.current === null ? (g(), n(l.Check, {
1372
+ key: 0,
1373
+ size: 16,
1374
+ "aria-hidden": "true"
1375
+ })) : r("v-if", !0)], 40, sn)) : r("v-if", !0),
1376
+ (g(!0), i(e, null, y(l.found.groups, (t) => (g(), i(e, { key: t.provider }, [a("div", ln, w(t.title), 1), (g(!0), i(e, null, y(t.models, (e) => (g(), i("div", {
1377
+ key: e.id,
1378
+ class: "kvc-model",
1379
+ role: "option",
1380
+ "aria-selected": e.id === l.props.current,
1381
+ "data-active": l.indexOf(e.id) === l.highlight,
1382
+ "data-test": `model-${e.id}`,
1383
+ onClick: (t) => l.pick(e.id),
1384
+ onMousemove: (t) => l.highlight = l.indexOf(e.id)
1385
+ }, [a("span", dn, w(e.name), 1), e.id === l.props.current ? (g(), n(l.Check, {
1386
+ key: 0,
1387
+ size: 16,
1388
+ "aria-hidden": "true"
1389
+ })) : r("v-if", !0)], 40, un))), 128))], 64))), 128)),
1390
+ l.found.shown === 0 ? (g(), i("p", fn, w(l.kvman.t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
1391
+ ], 8, on),
1392
+ a("p", pn, w(l.kvman.t("kvcoder.ui.modelsCount", {
1393
+ shown: l.found.shown,
1394
+ total: l.found.total
1395
+ })), 1)
1396
+ ], 40, nn)) : r("v-if", !0)]);
1397
+ }
1398
+ var hn = /*#__PURE__*/ H(Qt, [["render", mn], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ModelPicker.vue"]]), gn = /*@__PURE__*/ c({
1399
+ __name: "ModelControls",
1400
+ props: {
1401
+ groups: {
1402
+ type: Array,
1403
+ required: !0
1404
+ },
1405
+ model: {
1406
+ type: [String, null],
1407
+ required: !0
1408
+ },
1409
+ thinking: {
1410
+ type: null,
1411
+ required: !0
1412
+ },
1413
+ empty: {
1414
+ type: null,
1415
+ required: !1
1416
+ }
1417
+ },
1418
+ emits: ["model", "thinking"],
1419
+ setup(e, { expose: t, emit: n }) {
1420
+ t();
1421
+ let r = {
1422
+ props: e,
1423
+ emit: n,
1424
+ kvman: U(),
1425
+ chosen: (e) => q.find((t) => e.target instanceof HTMLSelectElement && t === e.target.value) ?? "medium",
1426
+ get thinkingLevels() {
1427
+ return q;
1428
+ },
1429
+ ModelPicker: hn
1430
+ };
1431
+ return Object.defineProperty(r, "__isScriptSetup", {
1432
+ enumerable: !1,
1433
+ value: !0
1434
+ }), r;
1435
+ }
1436
+ }), _n = ["value", "aria-label"], vn = ["value"];
1437
+ function yn(t, n, r, o, c, l) {
1438
+ return g(), i(e, null, [s(o.ModelPicker, {
1439
+ groups: o.props.groups,
1440
+ current: o.props.model,
1441
+ empty: o.props.empty,
1442
+ onPick: n[0] ||= (e) => o.emit("model", e)
1443
+ }, null, 8, [
1444
+ "groups",
1445
+ "current",
1446
+ "empty"
1447
+ ]), a("select", {
1448
+ value: o.props.thinking,
1449
+ class: "kvc-button",
1450
+ "aria-label": o.kvman.t("kvcoder.ui.thinking"),
1451
+ "data-test": "thinking-picker",
1452
+ onChange: n[1] ||= (e) => o.emit("thinking", o.chosen(e))
1453
+ }, [(g(!0), i(e, null, y(o.thinkingLevels, (e) => (g(), i("option", {
1454
+ key: e,
1455
+ value: e
1456
+ }, w(o.kvman.t(`kvcoder.ui.thinkingLevels.${e}`)), 9, vn))), 128))], 40, _n)], 64);
1457
+ }
1458
+ var bn = /*#__PURE__*/ H(gn, [["render", yn], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ModelControls.vue"]]);
1459
+ //#endregion
1460
+ //#region web/src/remember-model.ts
1461
+ async function Y(e, t) {
1462
+ try {
1463
+ await e.exec("kernel.settings.set", {
1464
+ key: "kvai.defaultModel",
1465
+ value: t,
1466
+ scope: "global"
1467
+ }), e.refresh();
1468
+ } catch (t) {
1469
+ K(e, t);
1470
+ }
1471
+ }
1472
+ //#endregion
1473
+ //#region web/src/use-chat-model.ts
1474
+ function xn(e, t) {
1475
+ let n = e.find((e) => e.key === t)?.value;
1476
+ return typeof n == "string" && n !== "" ? n : null;
1477
+ }
1478
+ function Sn(e) {
1479
+ let t = e.find((e) => e.key === "kvcoder.thinking")?.value;
1480
+ return q.find((e) => e === t) ?? "medium";
1481
+ }
1482
+ function Cn(e, n) {
1483
+ let r = v([]), i = v([]), a = v(null), o = v(null), s = v("medium"), c = v(null), l = v(!1), u = v(!1);
1484
+ m(async () => {
1485
+ try {
1486
+ let [t, n, o] = await Promise.all([
1487
+ e.exec("kernel.settings.list", {}),
1488
+ e.exec("kvai.provider.list", {}),
1489
+ e.exec("kvai.model.list", {})
1490
+ ]);
1491
+ a.value = xn(t, "kvcoder.model") ?? xn(t, "kvai.defaultModel"), s.value = Sn(t), r.value = n, i.value = o;
1492
+ } catch (e) {
1493
+ u.value = !0, n(e);
1494
+ } finally {
1495
+ l.value = !0;
1496
+ }
1497
+ });
1498
+ let d = t(() => o.value ?? a.value), f = t(() => c.value ?? s.value), p = t(() => Xt(r.value, i.value, d.value)), h = t(() => r.value.find((e) => e.id === i.value.find((e) => e.id === d.value)?.provider));
1499
+ return {
1500
+ current: d,
1501
+ thinking: f,
1502
+ groups: p,
1503
+ provider: h,
1504
+ state: t(() => l.value ? u.value ? "ready" : d.value === null ? "noModel" : h.value?.status === "needsKey" ? "needsKey" : "ready" : "loading"),
1505
+ changes: () => ({
1506
+ ...o.value === null ? {} : { model: o.value },
1507
+ ...c.value === null ? {} : { thinking: c.value }
1508
+ }),
1509
+ pickModel: (e) => void (o.value = e),
1510
+ pickThinking: (e) => void (c.value = e)
1511
+ };
1512
+ }
1513
+ //#endregion
1514
+ //#region web/src/ChatStart.vue?vue&type=script&setup=true&lang.ts
1515
+ var wn = /*@__PURE__*/ c({
1516
+ __name: "ChatStart",
1517
+ setup(e, { expose: t }) {
1518
+ t();
1519
+ let n = U(), r = Cn(n, (e) => K(n, e));
1520
+ async function i(e) {
1521
+ r.pickModel(e), await Y(n, e);
1522
+ }
1523
+ async function a(e) {
1524
+ try {
1525
+ let { id: t } = await n.exec("kvcoder.session.create", {}), i = r.changes();
1526
+ Object.keys(i).length > 0 && await n.exec("kvcoder.session.configure", {
1527
+ sessionId: t,
1528
+ ...i
1529
+ }), await n.exec("kvcoder.message.send", {
1530
+ sessionId: t,
1531
+ text: e.text,
1532
+ ...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
1533
+ }), n.navigate("kvcoder.session", { sessionId: t });
1534
+ } catch (e) {
1535
+ K(n, e);
1536
+ }
1537
+ }
1538
+ let o = {
1539
+ kvman: n,
1540
+ chat: r,
1541
+ pickModel: i,
1542
+ send: a,
1543
+ MessageComposer: Yt,
1544
+ ModelControls: bn
1545
+ };
1546
+ return Object.defineProperty(o, "__isScriptSetup", {
1547
+ enumerable: !1,
1548
+ value: !0
1549
+ }), o;
1550
+ }
1551
+ }), Tn = {
1552
+ class: "kvc-start",
1553
+ "data-test": "chat-start"
1554
+ }, En = {
1555
+ key: 0,
1556
+ class: "kvc-muted kvc-start-note",
1557
+ role: "status",
1558
+ "data-test": "key-needed"
1559
+ }, Dn = {
1560
+ key: 1,
1561
+ class: "kvc-muted kvc-start-note",
1562
+ role: "status",
1563
+ "data-test": "choose-model"
1564
+ }, On = {
1565
+ key: 2,
1566
+ class: "kvc-muted kvc-start-note"
1567
+ };
1568
+ function kn(t, n, r, c, l, u) {
1569
+ return g(), i(e, null, [a("div", Tn, [a("h1", null, w(c.kvman.t("kvcoder.ui.startHeading", { workspace: c.kvman.workspace.value.name })), 1), c.chat.state.value === "needsKey" && c.chat.provider.value ? (g(), i("p", En, [o(w(c.kvman.t("kvcoder.ui.keyNeeded", { provider: c.chat.provider.value.title })) + " ", 1), a("button", {
1570
+ type: "button",
1571
+ class: "kvc-link-button",
1572
+ "data-test": "add-key",
1573
+ onClick: n[0] ||= (e) => c.kvman.navigate("kvai.provider", { providerId: c.chat.provider.value.id })
1574
+ }, w(c.kvman.t("kvcoder.ui.addKey")), 1)])) : c.chat.state.value === "noModel" ? (g(), i("p", Dn, w(c.kvman.t("kvcoder.ui.chooseModelHint")), 1)) : (g(), i("p", On, w(c.kvman.t("kvcoder.ui.startHint")), 1))]), s(c.MessageComposer, {
1575
+ running: !1,
1576
+ placeholder: c.kvman.t("kvcoder.ui.startPlaceholder"),
1577
+ blocked: c.chat.state.value !== "ready",
1578
+ commands: "wait",
1579
+ onSend: c.send
1580
+ }, {
1581
+ controls: O(() => [s(c.ModelControls, {
1582
+ groups: c.chat.groups.value,
1583
+ model: c.chat.current.value,
1584
+ thinking: c.chat.thinking.value,
1585
+ empty: c.chat.state.value === "loading" ? "" : c.kvman.t("kvcoder.ui.chooseModel"),
1586
+ onModel: c.pickModel,
1587
+ onThinking: c.chat.pickThinking
1588
+ }, null, 8, [
1589
+ "groups",
1590
+ "model",
1591
+ "thinking",
1592
+ "empty",
1593
+ "onThinking"
1594
+ ])]),
1595
+ _: 1
1596
+ }, 8, ["placeholder", "blocked"])], 64);
1597
+ }
1598
+ var An = /*#__PURE__*/ H(wn, [["render", kn], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ChatStart.vue"]]);
1599
+ //#endregion
1600
+ //#region web/src/use-now.ts
1601
+ function jn() {
1602
+ let e = v(Date.now()), t;
1603
+ return m(() => t = setInterval(() => e.value = Date.now(), 1e3)), p(() => clearInterval(t)), e;
1604
+ }
1605
+ //#endregion
1606
+ //#region web/src/CommandProgress.vue?vue&type=script&setup=true&lang.ts
1607
+ var Mn = /*@__PURE__*/ c({
1608
+ __name: "CommandProgress",
1609
+ props: { working: {
1610
+ type: Object,
1611
+ required: !0
1612
+ } },
1613
+ setup(e, { expose: n }) {
1614
+ n();
1615
+ let r = e, i = U(), a = jn(), o = {
1616
+ props: r,
1617
+ kvman: i,
1618
+ now: a,
1619
+ seconds: t(() => Math.max(0, Math.floor((a.value - r.working.startedAt) / 1e3)))
1620
+ };
1621
+ return Object.defineProperty(o, "__isScriptSetup", {
1622
+ enumerable: !1,
1623
+ value: !0
1624
+ }), o;
1625
+ }
1626
+ }), Nn = ["data-command"], Pn = { class: "kvc-activity-text" }, Fn = {
1627
+ style: { "font-weight": "500" },
1628
+ "data-test": "command-title"
1629
+ }, In = {
1630
+ class: "kvc-muted",
1631
+ "data-test": "command-seconds"
1632
+ };
1633
+ function Ln(e, t, n, r, o, s) {
1634
+ return g(), i("div", {
1635
+ class: "kvc-activity",
1636
+ role: "status",
1637
+ "aria-live": "polite",
1638
+ "data-command": r.props.working.name,
1639
+ "data-test": "command-progress"
1640
+ }, [
1641
+ t[0] ||= a("span", {
1642
+ class: "kvc-spin",
1643
+ "aria-hidden": "true"
1644
+ }, null, -1),
1645
+ a("span", Pn, [a("span", Fn, w(r.kvman.t(`kvcoder.ui.working.${r.props.working.name}`)), 1)]),
1646
+ a("span", In, w(r.kvman.t("kvcoder.ui.seconds", { count: r.seconds })), 1)
1647
+ ], 8, Nn);
1648
+ }
1649
+ var Rn = /*#__PURE__*/ H(Mn, [["render", Ln], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/CommandProgress.vue"]]), zn = 5;
1650
+ function Bn(e, t) {
1651
+ let n = Math.max(0, Math.floor(t / 1e3));
1652
+ return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.jobs.minutes", {
1653
+ minutes: Math.floor(n / 60),
1654
+ seconds: n % 60
1655
+ });
1656
+ }
1657
+ function Vn(e, n, r) {
1658
+ let i = v([]), a = v({}), o = v(/* @__PURE__ */ new Set()), s = v(Date.now()), c = t(() => i.value.filter((e) => e.status === "running")), l = 0, u;
1659
+ async function d() {
1660
+ for (let t of Object.keys(a.value)) {
1661
+ let r = await e.exec("kvcoder.job.get", {
1662
+ sessionId: n(),
1663
+ id: t
1664
+ });
1665
+ a.value = {
1666
+ ...a.value,
1667
+ [t]: typeof r.output == "string" ? r.output : ""
1668
+ };
1669
+ }
1670
+ }
1671
+ async function f() {
1672
+ try {
1673
+ i.value = await e.exec("kvcoder.job.list", { sessionId: n() }), await d();
1674
+ } catch (t) {
1675
+ K(e, t);
1676
+ }
1677
+ }
1678
+ async function m(e) {
1679
+ if (a.value[e] !== void 0) {
1680
+ a.value = Object.fromEntries(Object.entries(a.value).filter(([t]) => t !== e));
1681
+ return;
1682
+ }
1683
+ a.value = {
1684
+ ...a.value,
1685
+ [e]: ""
1686
+ }, await f();
1687
+ }
1688
+ async function h(t) {
1689
+ o.value = /* @__PURE__ */ new Set([...o.value, t]);
1690
+ try {
1691
+ await e.exec("kvcoder.job.cancel", {
1692
+ sessionId: n(),
1693
+ id: t
1694
+ });
1695
+ } catch (t) {
1696
+ K(e, t);
1697
+ }
1698
+ o.value = new Set([...o.value].filter((e) => e !== t)), await f();
1699
+ }
1700
+ return D(() => c.value.length > 0 || r.value, (e) => {
1701
+ clearInterval(u), u = void 0, e && (u = setInterval(() => {
1702
+ s.value = Date.now(), l += 1, l % zn === 0 && f();
1703
+ }, 1e3));
1704
+ }, { immediate: !0 }), p(() => clearInterval(u)), {
1705
+ jobs: i,
1706
+ running: c,
1707
+ logs: a,
1708
+ stopping: o,
1709
+ now: s,
1710
+ load: f,
1711
+ toggleLogs: m,
1712
+ stop: h
1713
+ };
1714
+ }
1715
+ //#endregion
1716
+ //#region web/src/JobItem.vue?vue&type=script&setup=true&lang.ts
1717
+ var Hn = /*@__PURE__*/ c({
1718
+ __name: "JobItem",
1719
+ props: {
1720
+ job: {
1721
+ type: Object,
1722
+ required: !0
1723
+ },
1724
+ now: {
1725
+ type: Number,
1726
+ required: !0
1727
+ },
1728
+ logs: {
1729
+ type: null,
1730
+ required: !1
1731
+ },
1732
+ stopping: {
1733
+ type: Boolean,
1734
+ required: !0
1735
+ }
1736
+ },
1737
+ emits: ["stop", "logs"],
1738
+ setup(e, { expose: t, emit: n }) {
1739
+ t();
1740
+ let r = {
1741
+ props: e,
1742
+ emit: n,
1743
+ kvman: U(),
1744
+ get elapsed() {
1745
+ return Bn;
1746
+ }
1747
+ };
1748
+ return Object.defineProperty(r, "__isScriptSetup", {
1749
+ enumerable: !1,
1750
+ value: !0
1751
+ }), r;
1752
+ }
1753
+ }), Un = ["data-test", "data-status"], Wn = { class: "kvc-job-head" }, Gn = {
1754
+ class: "kvc-job-title kvc-oneline",
1755
+ "data-test": "job-title"
1756
+ }, Kn = {
1757
+ key: 0,
1758
+ class: "kvc-muted",
1759
+ "data-test": "job-time"
1760
+ }, qn = {
1761
+ key: 1,
1762
+ class: "kvc-chip",
1763
+ "data-test": "job-status"
1764
+ }, Jn = {
1765
+ key: 0,
1766
+ class: "kvc-job-links"
1767
+ }, Yn = ["href"], Xn = { class: "kvc-actions" }, Zn = ["aria-expanded", "data-test"], Qn = ["disabled", "data-test"], $n = {
1768
+ key: 1,
1769
+ class: "kvc-output",
1770
+ "data-test": "job-output"
1771
+ };
1772
+ function er(t, n, s, c, l, u) {
1773
+ return g(), i("div", {
1774
+ class: "kvc-job",
1775
+ "data-test": `job-${c.props.job.id}`,
1776
+ "data-status": c.props.job.status
1777
+ }, [
1778
+ a("div", Wn, [a("span", Gn, w(c.props.job.title), 1), c.props.job.status === "running" ? (g(), i("span", Kn, w(c.elapsed(c.kvman.t, c.props.now - Date.parse(c.props.job.startedAt))), 1)) : (g(), i("span", qn, [o(w(c.kvman.t(`kvcoder.ui.jobs.status.${c.props.job.status}`)), 1), c.props.job.exitCode !== void 0 && c.props.job.exitCode !== 0 ? (g(), i(e, { key: 0 }, [o(" · " + w(c.kvman.t("kvcoder.ui.exitCode", { code: c.props.job.exitCode })), 1)], 64)) : r("v-if", !0)]))]),
1779
+ c.props.job.links.length > 0 ? (g(), i("div", Jn, [(g(!0), i(e, null, y(c.props.job.links, (e) => (g(), i("a", {
1780
+ key: e,
1781
+ href: e,
1782
+ target: "_blank",
1783
+ rel: "noopener noreferrer",
1784
+ class: "kvc-link kvc-mono",
1785
+ "data-test": "job-link"
1786
+ }, w(e), 9, Yn))), 128))])) : r("v-if", !0),
1787
+ a("div", Xn, [a("button", {
1788
+ type: "button",
1789
+ class: "kvc-button",
1790
+ "aria-expanded": c.props.logs !== void 0,
1791
+ "data-test": `job-logs-${c.props.job.id}`,
1792
+ onClick: n[0] ||= (e) => c.emit("logs")
1793
+ }, w(c.kvman.t("kvcoder.ui.jobs.logs")), 9, Zn), c.props.job.status === "running" ? (g(), i("button", {
1794
+ key: 0,
1795
+ type: "button",
1796
+ class: "kvc-button kvc-primary",
1797
+ disabled: c.props.stopping,
1798
+ "data-test": `job-stop-${c.props.job.id}`,
1799
+ onClick: n[1] ||= (e) => c.emit("stop")
1800
+ }, w(c.kvman.t("kvcoder.ui.jobs.stop")), 9, Qn)) : r("v-if", !0)]),
1801
+ c.props.logs === void 0 ? r("v-if", !0) : (g(), i("pre", $n, w(c.props.logs === "" ? c.kvman.t("kvcoder.ui.jobs.noOutput") : c.props.logs), 1))
1802
+ ], 8, Un);
1803
+ }
1804
+ var tr = /*#__PURE__*/ H(Hn, [["render", er], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/JobItem.vue"]]), nr = /*@__PURE__*/ c({
1805
+ __name: "JobsChip",
1806
+ props: {
1807
+ sessionId: {
1808
+ type: String,
1809
+ required: !0
1810
+ },
1811
+ stamp: {
1812
+ type: String,
1813
+ required: !0
1814
+ }
1815
+ },
1816
+ setup(e, { expose: t }) {
1817
+ t();
1818
+ let n = e, r = U(), i = v(!1), a = T("trigger"), { jobs: o, running: s, logs: c, stopping: l, now: u, load: d, toggleLogs: f, stop: h } = Vn(r, () => n.sessionId, i);
1819
+ function g() {
1820
+ i.value = !1, a.value?.focus();
1821
+ }
1822
+ function _(e) {
1823
+ e.target instanceof Node && !a.value?.parentElement?.contains(e.target) && (i.value = !1);
1824
+ }
1825
+ m(d), D(() => [n.sessionId, n.stamp], d), D(i, (e) => e ? document.addEventListener("pointerdown", _) : document.removeEventListener("pointerdown", _)), p(() => document.removeEventListener("pointerdown", _));
1826
+ let y = {
1827
+ props: n,
1828
+ kvman: r,
1829
+ open: i,
1830
+ trigger: a,
1831
+ jobs: o,
1832
+ running: s,
1833
+ logs: c,
1834
+ stopping: l,
1835
+ now: u,
1836
+ load: d,
1837
+ toggleLogs: f,
1838
+ stop: h,
1839
+ close: g,
1840
+ outside: _,
1841
+ get ChevronDown() {
1842
+ return B;
1843
+ },
1844
+ JobItem: tr
1845
+ };
1846
+ return Object.defineProperty(y, "__isScriptSetup", {
1847
+ enumerable: !1,
1848
+ value: !0
1849
+ }), y;
1850
+ }
1851
+ }), rr = {
1852
+ key: 0,
1853
+ class: "kvc-jobs",
1854
+ "data-test": "jobs"
1855
+ }, ir = ["aria-expanded"], ar = ["aria-label", "onKeydown"];
1856
+ function or(t, c, l, u, d, f) {
1857
+ return u.running.length > 0 || u.open ? (g(), i("div", rr, [a("button", {
1858
+ ref: "trigger",
1859
+ type: "button",
1860
+ class: "kvc-button",
1861
+ "aria-haspopup": "dialog",
1862
+ "aria-expanded": u.open,
1863
+ "data-test": "jobs-chip",
1864
+ onClick: c[0] ||= (e) => u.open ? u.close() : u.open = !0
1865
+ }, [
1866
+ c[1] ||= a("span", {
1867
+ class: "kvc-dot",
1868
+ "aria-hidden": "true"
1869
+ }, null, -1),
1870
+ o(w(u.kvman.t("kvcoder.ui.jobs.running", { count: u.running.length })), 1),
1871
+ s(u.ChevronDown, {
1872
+ size: 16,
1873
+ "aria-hidden": "true"
1874
+ })
1875
+ ], 8, ir), u.open ? (g(), i("div", {
1876
+ key: 0,
1877
+ class: "kvc-popover kvc-jobs-panel",
1878
+ role: "dialog",
1879
+ "aria-label": u.kvman.t("kvcoder.ui.jobs.title"),
1880
+ "data-test": "jobs-popover",
1881
+ onKeydown: A(j(u.close, ["stop"]), ["esc"])
1882
+ }, [(g(!0), i(e, null, y(u.jobs, (e) => (g(), n(u.JobItem, {
1883
+ key: e.id,
1884
+ job: e,
1885
+ now: u.now,
1886
+ logs: u.logs[e.id],
1887
+ stopping: u.stopping.has(e.id),
1888
+ onStop: (t) => u.stop(e.id),
1889
+ onLogs: (t) => u.toggleLogs(e.id)
1890
+ }, null, 8, [
1891
+ "job",
1892
+ "now",
1893
+ "logs",
1894
+ "stopping",
1895
+ "onStop",
1896
+ "onLogs"
1897
+ ]))), 128))], 40, ar)) : r("v-if", !0)])) : r("v-if", !0);
1898
+ }
1899
+ var sr = /*#__PURE__*/ H(nr, [["render", or], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/JobsChip.vue"]]);
1900
+ //#endregion
1901
+ //#region web/src/use-dismiss.ts
1902
+ function cr(e, t, n) {
1903
+ let r = (e) => {
1904
+ e.target instanceof Node && t()?.contains(e.target) !== !0 && n();
1905
+ }, i = (e) => {
1906
+ e.key === "Escape" && n();
1907
+ }, a = () => {
1908
+ document.removeEventListener("pointerdown", r), document.removeEventListener("keydown", i);
1909
+ };
1910
+ D(e, (e) => {
1911
+ a(), e && (document.addEventListener("pointerdown", r), document.addEventListener("keydown", i));
1912
+ }), p(a);
1913
+ }
1914
+ //#endregion
1915
+ //#region web/src/ConversationHeader.vue?vue&type=script&setup=true&lang.ts
1916
+ var lr = /*@__PURE__*/ c({
1917
+ __name: "ConversationHeader",
1918
+ props: {
1919
+ session: {
1920
+ type: null,
1921
+ required: !0
1922
+ },
1923
+ tab: {
1924
+ type: String,
1925
+ required: !0
1926
+ },
1927
+ turns: {
1928
+ type: Number,
1929
+ required: !0
1930
+ },
1931
+ runningSince: {
1932
+ type: null,
1933
+ required: !1,
1934
+ default: void 0
1935
+ },
1936
+ artifacts: {
1937
+ type: Number,
1938
+ required: !1,
1939
+ default: 0
1940
+ },
1941
+ artifactsOpen: {
1942
+ type: Boolean,
1943
+ required: !1,
1944
+ default: !1
1945
+ },
1946
+ working: {
1947
+ type: Boolean,
1948
+ required: !1,
1949
+ default: !1
1950
+ }
1951
+ },
1952
+ emits: [
1953
+ "tab",
1954
+ "action",
1955
+ "toggleArtifacts"
1956
+ ],
1957
+ setup(e, { expose: n, emit: r }) {
1958
+ n();
1959
+ let i = e, a = r, o = U(), s = v(!1), c = v(null), l = v(!1), u = T("more"), d = jn(), f = t(() => i.runningSince === void 0 ? 0 : Math.max(0, d.value - Date.parse(i.runningSince))), p = t(() => `${o.t("kvcoder.ui.turns", { count: i.turns })} · ${$e(o.t, i.session.usage, i.session.durationMs + f.value)}`), m = t(() => o.t("kvcoder.ui.artifacts.toggle", { count: i.artifacts }));
1960
+ function h() {
1961
+ s.value = !1, l.value = !1;
1962
+ }
1963
+ cr(() => s.value || l.value, () => u.value, h);
1964
+ function g(e) {
1965
+ h(), e();
1966
+ }
1967
+ function _() {
1968
+ let e = c.value ?? "";
1969
+ c.value = null, a("action", "rename", e);
1970
+ }
1971
+ let y = {
1972
+ props: i,
1973
+ emit: a,
1974
+ kvman: o,
1975
+ menu: s,
1976
+ renaming: c,
1977
+ confirming: l,
1978
+ more: u,
1979
+ now: d,
1980
+ runningMs: f,
1981
+ summary: p,
1982
+ artifactsLabel: m,
1983
+ closeMenus: h,
1984
+ pick: g,
1985
+ rename: _,
1986
+ get Ellipsis() {
1987
+ return me;
1988
+ },
1989
+ get PanelRight() {
1990
+ return ye;
1991
+ },
1992
+ get titleText() {
1993
+ return Be;
1994
+ },
1995
+ JobsChip: sr
1996
+ };
1997
+ return Object.defineProperty(y, "__isScriptSetup", {
1998
+ enumerable: !1,
1999
+ value: !0
2000
+ }), y;
2001
+ }
2002
+ }), ur = { class: "kvc-header" }, dr = { class: "kvc-title" }, fr = ["aria-label"], pr = {
2003
+ key: 1,
2004
+ "data-test": "session-title"
2005
+ }, mr = {
2006
+ class: "kvc-muted",
2007
+ "data-test": "session-totals"
2008
+ }, hr = [
2009
+ "aria-pressed",
2010
+ "aria-label",
2011
+ "title"
2012
+ ], gr = {
2013
+ ref: "more",
2014
+ style: { position: "relative" }
2015
+ }, _r = ["aria-label", "aria-expanded"], vr = {
2016
+ key: 0,
2017
+ class: "kvc-menu",
2018
+ role: "menu",
2019
+ "data-test": "chat-menu-items"
2020
+ }, yr = ["disabled"], br = ["disabled"], xr = ["disabled"], Sr = ["disabled"], Cr = ["aria-label"], wr = { style: { padding: "6px" } }, Tr = { class: "kvc-actions" };
2021
+ function Er(e, t, n, c, l, u) {
2022
+ return g(), i("header", ur, [
2023
+ a("div", dr, [c.renaming === null ? (g(), i("strong", pr, w(c.titleText(c.kvman.t, c.props.session.title)), 1)) : (g(), i("form", {
2024
+ key: 0,
2025
+ onSubmit: j(c.rename, ["prevent"])
2026
+ }, [k(a("input", {
2027
+ "onUpdate:modelValue": t[0] ||= (e) => c.renaming = e,
2028
+ class: "kvc-field",
2029
+ "aria-label": c.kvman.t("kvcoder.ui.rename"),
2030
+ "data-test": "rename-input",
2031
+ onBlur: c.rename
2032
+ }, null, 40, fr), [[E, c.renaming]])], 32)), a("span", mr, w(c.summary), 1)]),
2033
+ s(c.JobsChip, {
2034
+ "session-id": c.props.session.id,
2035
+ stamp: c.props.session.updatedAt
2036
+ }, null, 8, ["session-id", "stamp"]),
2037
+ c.props.artifacts > 0 ? (g(), i("button", {
2038
+ key: 0,
2039
+ type: "button",
2040
+ class: "kvc-button",
2041
+ "aria-pressed": c.props.artifactsOpen,
2042
+ "aria-label": c.artifactsLabel,
2043
+ title: c.artifactsLabel,
2044
+ "data-test": "artifacts-toggle",
2045
+ onClick: t[1] ||= (e) => c.emit("toggleArtifacts")
2046
+ }, [s(c.PanelRight, {
2047
+ size: 16,
2048
+ "aria-hidden": "true"
2049
+ }), o(w(c.props.artifacts), 1)], 8, hr)) : r("v-if", !0),
2050
+ a("div", gr, [
2051
+ a("button", {
2052
+ type: "button",
2053
+ class: "kvc-button kvc-ghost",
2054
+ "aria-label": c.kvman.t("kvcoder.ui.menu"),
2055
+ "aria-expanded": c.menu,
2056
+ "data-test": "chat-menu",
2057
+ onClick: t[2] ||= (e) => {
2058
+ c.menu = !c.menu, c.confirming = !1;
2059
+ }
2060
+ }, [s(c.Ellipsis, { size: 18 })], 8, _r),
2061
+ c.menu ? (g(), i("div", vr, [
2062
+ a("button", {
2063
+ type: "button",
2064
+ role: "menuitem",
2065
+ class: "kvc-button kvc-ghost",
2066
+ "data-test": "menu-rename",
2067
+ disabled: c.props.working,
2068
+ onClick: t[3] ||= (e) => c.pick(() => c.renaming = c.props.session.title)
2069
+ }, w(c.kvman.t("kvcoder.ui.rename")), 9, yr),
2070
+ a("button", {
2071
+ type: "button",
2072
+ role: "menuitem",
2073
+ class: "kvc-button kvc-ghost",
2074
+ "data-test": "menu-fork",
2075
+ disabled: c.props.working,
2076
+ onClick: t[4] ||= (e) => c.pick(() => c.emit("action", "fork", ""))
2077
+ }, w(c.kvman.t("kvcoder.ui.fork")), 9, br),
2078
+ a("button", {
2079
+ type: "button",
2080
+ role: "menuitem",
2081
+ class: "kvc-button kvc-ghost",
2082
+ "data-test": "menu-export",
2083
+ disabled: c.props.working,
2084
+ onClick: t[5] ||= (e) => c.pick(() => c.emit("action", "export", ""))
2085
+ }, w(c.kvman.t("kvcoder.ui.export")), 9, xr),
2086
+ a("button", {
2087
+ type: "button",
2088
+ role: "menuitem",
2089
+ class: "kvc-button kvc-ghost",
2090
+ "data-test": "menu-compact",
2091
+ disabled: c.props.working,
2092
+ onClick: t[6] ||= (e) => c.pick(() => c.emit("action", "compact", ""))
2093
+ }, w(c.kvman.t("kvcoder.ui.compact")), 9, Sr),
2094
+ a("button", {
2095
+ type: "button",
2096
+ role: "menuitem",
2097
+ class: "kvc-button kvc-ghost",
2098
+ "data-test": "menu-prompt",
2099
+ onClick: t[7] ||= (e) => c.pick(() => c.emit("tab", c.props.tab === "prompt" ? "chat" : "prompt"))
2100
+ }, w(c.kvman.t(c.props.tab === "prompt" ? "kvcoder.ui.showChat" : "kvcoder.ui.showPrompt")), 1),
2101
+ a("button", {
2102
+ type: "button",
2103
+ role: "menuitem",
2104
+ class: "kvc-button kvc-ghost kvc-danger",
2105
+ "data-test": "menu-delete",
2106
+ onClick: t[8] ||= (e) => {
2107
+ c.menu = !1, c.confirming = !0;
2108
+ }
2109
+ }, w(c.kvman.t("kvcoder.ui.delete")), 1)
2110
+ ])) : r("v-if", !0),
2111
+ c.confirming ? (g(), i("div", {
2112
+ key: 1,
2113
+ class: "kvc-menu",
2114
+ role: "alertdialog",
2115
+ "aria-label": c.kvman.t("kvcoder.ui.deleteConfirm"),
2116
+ "data-test": "delete-confirm"
2117
+ }, [a("span", wr, w(c.kvman.t("kvcoder.ui.deleteConfirm")), 1), a("div", Tr, [a("button", {
2118
+ type: "button",
2119
+ class: "kvc-button",
2120
+ onClick: t[9] ||= (e) => c.confirming = !1
2121
+ }, w(c.kvman.t("kvcoder.ui.cancel")), 1), a("button", {
2122
+ type: "button",
2123
+ class: "kvc-button kvc-primary",
2124
+ "data-test": "confirm-delete",
2125
+ onClick: t[10] ||= (e) => c.pick(() => c.emit("action", "delete", ""))
2126
+ }, w(c.kvman.t("kvcoder.ui.delete")), 1)])], 8, Cr)) : r("v-if", !0)
2127
+ ], 512)
2128
+ ]);
2129
+ }
2130
+ var Dr = /*#__PURE__*/ H(lr, [["render", Er], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ConversationHeader.vue"]]), Or = 200, kr = [
2131
+ "text",
2132
+ "choice",
2133
+ "confirm"
2134
+ ];
2135
+ function Ar(e) {
2136
+ return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
2137
+ }
2138
+ var X = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
2139
+ function jr(e, t) {
2140
+ let n = X(t.args);
2141
+ return X(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
2142
+ }
2143
+ function Mr(e) {
2144
+ let t = X(e.title) ?? X(e.description), n = X(e.command);
2145
+ return {
2146
+ ...t === void 0 ? {} : { description: t },
2147
+ ...n === void 0 ? {} : { line: n },
2148
+ ...e.mode === "async" ? { background: !0 } : {}
2149
+ };
2150
+ }
2151
+ function Z(e) {
2152
+ let t = X(e.connector), n = X(e.command);
2153
+ if (t === void 0) return Mr(e);
2154
+ let r = X(e.description), i = Ar(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = n === "exec" ? { line: jr(t, i) } : Object.keys(i).length === 0 ? {} : { payload: JSON.stringify(i, null, 2) }, o = t === "ask" ? kr.find((e) => e === n) : void 0;
2155
+ return {
2156
+ ...r === void 0 ? {} : { description: r },
2157
+ ...n === void 0 ? {} : { label: `${t} · ${n}` },
2158
+ ...a,
2159
+ ...i.background === !0 ? { background: !0 } : {},
2160
+ ...o === void 0 ? {} : { ask: {
2161
+ kind: o,
2162
+ question: i
2163
+ } }
2164
+ };
2165
+ }
2166
+ function Nr(e) {
2167
+ let t = e.replace(/\s+/g, " ");
2168
+ return t.length > Or ? `${t.slice(0, Or)}…` : t;
2169
+ }
2170
+ //#endregion
2171
+ //#region web/src/live-step.ts
2172
+ var Q = () => ({
2173
+ text: "",
2174
+ thinking: "",
2175
+ summarizing: !1,
2176
+ calls: [],
2177
+ retry: null,
2178
+ startedAt: Date.now()
2179
+ });
2180
+ function Pr(e) {
2181
+ return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
2182
+ }
2183
+ function Fr(e) {
2184
+ let t = e.calls.at(-1);
2185
+ return t === void 0 ? e.text === "" ? e.thinking === "" ? e.retry === null ? "waiting" : "retrying" : "thinking" : "writing" : t.complete ? "running" : "preparing";
2186
+ }
2187
+ function Ir(e, t, n) {
2188
+ let r = Pr(t.arguments);
2189
+ (r === void 0 || e.calls.length === 0) && e.calls.push({
2190
+ name: n,
2191
+ complete: !1
2192
+ });
2193
+ let i = e.calls.at(-1);
2194
+ if (r === void 0 || i === void 0) return;
2195
+ let a = Z(r);
2196
+ a.description !== void 0 && (i.description = a.description), a.label !== void 0 && (i.label = a.label), i.complete = "payload" in r;
2197
+ }
2198
+ function Lr(e, t) {
2199
+ if (t.type !== "progress") return { kind: "none" };
2200
+ let n = Pr(t.data);
2201
+ return n === void 0 ? { kind: "none" } : t.source === "@kvman/kvai" && !e.summarizing ? (e.retry = null, e.calls.some((e) => e.carried === !0) && (e.calls = []), n.type === "text" && typeof n.delta == "string" && (e.text += n.delta), n.type === "thinking" && typeof n.delta == "string" && (e.thinking += n.delta), n.type === "toolcall" && typeof n.name == "string" && Ir(e, n, n.name), { kind: "none" }) : t.source === "@kvman/kvcoder" ? (n.type === "compaction" && (e.summarizing = n.state === "started"), n.type === "retry" && typeof n.attempt == "number" && typeof n.of == "number" && (e.retry = {
2202
+ attempt: n.attempt,
2203
+ of: n.of
2204
+ }), n.type === "follow" && typeof n.jobId == "string" ? {
2205
+ kind: "follow",
2206
+ jobId: n.jobId
2207
+ } : n.type === "subagent" && typeof n.sessionId == "string" && typeof n.jobId == "string" ? {
2208
+ kind: "subagent",
2209
+ sessionId: n.sessionId,
2210
+ jobId: n.jobId
2211
+ } : n.type === "component" ? { kind: "question" } : { kind: "none" }) : { kind: "none" };
2212
+ }
2213
+ //#endregion
2214
+ //#region web/src/ActivityLine.vue?vue&type=script&setup=true&lang.ts
2215
+ var Rr = /*@__PURE__*/ c({
2216
+ __name: "ActivityLine",
2217
+ props: { live: {
2218
+ type: Object,
2219
+ required: !0
2220
+ } },
2221
+ setup(e, { expose: n }) {
2222
+ n();
2223
+ let r = e, i = U(), a = jn(), o = {
2224
+ props: r,
2225
+ kvman: i,
2226
+ now: a,
2227
+ phase: t(() => Fr(r.live)),
2228
+ seconds: t(() => Math.max(0, Math.floor((a.value - r.live.startedAt) / 1e3)))
2229
+ };
2230
+ return Object.defineProperty(o, "__isScriptSetup", {
2231
+ enumerable: !1,
2232
+ value: !0
2233
+ }), o;
2234
+ }
2235
+ }), zr = ["data-phase"], Br = { class: "kvc-activity-text" }, Vr = {
2236
+ style: { "font-weight": "600" },
2237
+ "data-test": "activity-title"
2238
+ }, Hr = {
2239
+ key: 0,
2240
+ class: "kvc-muted",
2241
+ dir: "ltr",
2242
+ "data-test": "activity-label"
2243
+ }, Ur = {
2244
+ key: 1,
2245
+ style: { "font-weight": "500" },
2246
+ "data-test": "activity-title"
2247
+ }, Wr = {
2248
+ key: 0,
2249
+ class: "kvc-muted",
2250
+ "data-test": "activity-phase"
2251
+ }, Gr = {
2252
+ class: "kvc-muted",
2253
+ "data-test": "activity-seconds"
2254
+ };
2255
+ function Kr(t, n, o, s, c, l) {
2256
+ return g(), i("div", {
2257
+ class: "kvc-activity",
2258
+ role: "status",
2259
+ "aria-live": "polite",
2260
+ "data-phase": s.phase,
2261
+ "data-test": "activity"
2262
+ }, [
2263
+ n[0] ||= a("span", {
2264
+ class: "kvc-spin",
2265
+ "aria-hidden": "true"
2266
+ }, null, -1),
2267
+ a("span", Br, [s.props.live.calls.length > 0 ? (g(!0), i(e, { key: 0 }, y(s.props.live.calls, (e, t) => (g(), i("span", {
2268
+ key: t,
2269
+ class: "kvc-activity-call",
2270
+ "data-test": "activity-call"
2271
+ }, [a("span", Vr, w(e.description ?? s.kvman.t("kvcoder.ui.activity.preparing")), 1), e.label ? (g(), i("span", Hr, w(e.label), 1)) : r("v-if", !0)]))), 128)) : (g(), i("span", Ur, w(s.kvman.t(`kvcoder.ui.activity.${s.phase}`, s.props.live.retry ?? {})), 1))]),
2272
+ s.props.live.calls.length > 0 ? (g(), i("span", Wr, w(s.kvman.t(`kvcoder.ui.activity.${s.phase}`)), 1)) : r("v-if", !0),
2273
+ a("span", Gr, w(s.kvman.t("kvcoder.ui.seconds", { count: s.seconds })), 1)
2274
+ ], 8, zr);
2275
+ }
2276
+ var qr = /*#__PURE__*/ H(Rr, [["render", Kr], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ActivityLine.vue"]]);
2277
+ //#endregion
2278
+ //#region web/src/message-parts.ts
2279
+ function $(e) {
2280
+ return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
2281
+ }
2282
+ function Jr(e) {
2283
+ return Array.isArray(e) ? e.flatMap((e) => {
2284
+ let t = $(e);
2285
+ return t === void 0 ? [] : [t];
2286
+ }) : [];
2287
+ }
2288
+ function Yr(e) {
2289
+ return typeof e == "string" ? e : Jr(e).flatMap((e) => e.type === "text" && typeof e.text == "string" ? [e.text] : []).join("\n");
2290
+ }
2291
+ function Xr(e) {
2292
+ return Jr(e.content.content).flatMap((e) => e.type === "thinking" && typeof e.thinking == "string" ? [e.thinking] : []).join("\n");
2293
+ }
2294
+ function Zr(e) {
2295
+ let t = /* @__PURE__ */ new Map();
2296
+ for (let n of e) {
2297
+ if (n.kind !== "assistant") continue;
2298
+ let e = typeof n.durationMs == "number" ? { writtenMs: n.durationMs } : {};
2299
+ for (let r of Jr(n.content.content)) {
2300
+ let n = $(r.arguments);
2301
+ r.type === "toolCall" && typeof r.id == "string" && n !== void 0 && t.set(r.id, {
2302
+ ...Z(n),
2303
+ ...e
2304
+ });
2305
+ }
2306
+ }
2307
+ return t;
2308
+ }
2309
+ function Qr(e, t) {
2310
+ let { description: n, connector: r, command: i } = e;
2311
+ return typeof r == "string" ? {
2312
+ ...t,
2313
+ ...typeof n == "string" ? { description: n } : {},
2314
+ ...typeof i == "string" ? { label: `${r} · ${i}` } : {},
2315
+ ...e.background === !0 ? { background: !0 } : {}
2316
+ } : {
2317
+ ...t,
2318
+ ...Z(e)
2319
+ };
2320
+ }
2321
+ function $r(e, t) {
2322
+ let n = $(e.content.details), r = Yr(e.content.content), i = /\n?\[exit code (\d+)\]$/.exec(r), a = t.get(String(e.content.toolCallId)), o = typeof n?.exitCode == "number" ? n.exitCode : i === null ? void 0 : Number(i[1]);
2323
+ return {
2324
+ ...n === void 0 ? a : Qr(n, a),
2325
+ output: typeof n?.output == "string" ? n.output : r.replace(/\n?\[exit code \d+\]$/, ""),
2326
+ failed: e.content.isError === !0 || o !== void 0 && o !== 0,
2327
+ ...typeof n?.durationMs == "number" ? { durationMs: n.durationMs } : {}
2328
+ };
2329
+ }
2330
+ var ei = "dismissed by the user";
2331
+ function ti(e) {
2332
+ if (e === ei) return { dismissed: !0 };
2333
+ try {
2334
+ return $(JSON.parse(e));
2335
+ } catch {
2336
+ return;
2337
+ }
2338
+ }
2339
+ function ni(e, t) {
2340
+ if (e.kind !== "toolResult" || e.content.isError === !0) return;
2341
+ let n = t.get(String(e.content.toolCallId))?.ask;
2342
+ if (n === void 0) return;
2343
+ let r = ti(Yr(e.content.content));
2344
+ return r === void 0 ? void 0 : {
2345
+ ...n,
2346
+ answer: r
2347
+ };
2348
+ }
2349
+ function ri(e) {
2350
+ return e.kind === "user" && e.source?.kind === "extension" && e.source.name === "@kvman/kvcoder";
2351
+ }
2352
+ function ii(e) {
2353
+ return e.kind === "user" && (e.source?.kind === "job" || e.source?.kind === "subagent");
2354
+ }
2355
+ function ai(e) {
2356
+ if (e.kind !== "toolResult") return;
2357
+ let t = $(e.content.details);
2358
+ if (t === void 0) return;
2359
+ let n = $(t.artifact);
2360
+ if (n === void 0) return;
2361
+ let { id: r, title: i, format: a, version: o } = n;
2362
+ if (typeof r == "string" && typeof i == "string" && typeof o == "number" && (a === "markdown" || a === "html" || a === "url")) return {
2363
+ id: r,
2364
+ title: i,
2365
+ format: a,
2366
+ version: o
2367
+ };
2368
+ }
2369
+ //#endregion
2370
+ //#region web/src/question-options.ts
2371
+ function oi(e) {
2372
+ return (Array.isArray(e.options) ? e.options : []).map((e) => {
2373
+ let t = G(e);
2374
+ return {
2375
+ id: String(t.id),
2376
+ label: String(t.label),
2377
+ ...typeof t.description == "string" ? { description: t.description } : {}
2378
+ };
2379
+ });
2380
+ }
2381
+ //#endregion
2382
+ //#region web/src/AnsweredCard.vue?vue&type=script&setup=true&lang.ts
2383
+ var si = /*@__PURE__*/ c({
2384
+ __name: "AnsweredCard",
2385
+ props: { answered: {
2386
+ type: Object,
2387
+ required: !0
2388
+ } },
2389
+ setup(e, { expose: n }) {
2390
+ n();
2391
+ let r = e, i = U(), a = t(() => String(r.answered.question.prompt ?? "")), o = t(() => r.answered.answer.dismissed === !0), s = t(() => Array.isArray(r.answered.answer.selected) ? r.answered.answer.selected : []), c = {
2392
+ props: r,
2393
+ kvman: i,
2394
+ prompt: a,
2395
+ skipped: o,
2396
+ selected: s,
2397
+ options: t(() => oi(r.answered.question).map((e) => ({
2398
+ ...e,
2399
+ chosen: s.value.includes(e.id)
2400
+ }))),
2401
+ other: t(() => typeof r.answered.answer.other == "string" ? r.answered.answer.other : ""),
2402
+ text: t(() => typeof r.answered.answer.text == "string" ? r.answered.answer.text : ""),
2403
+ get Check() {
2404
+ return ce;
2405
+ },
2406
+ get CircleCheck() {
2407
+ return ue;
2408
+ }
2409
+ };
2410
+ return Object.defineProperty(c, "__isScriptSetup", {
2411
+ enumerable: !1,
2412
+ value: !0
2413
+ }), c;
2414
+ }
2415
+ }), ci = ["aria-label"], li = {
2416
+ class: "kvc-card-row",
2417
+ style: { "font-weight": "600" }
2418
+ }, ui = {
2419
+ dir: "auto",
2420
+ "data-test": "answered-prompt"
2421
+ }, di = { class: "kvc-card-body" }, fi = {
2422
+ key: 0,
2423
+ class: "kvc-muted",
2424
+ "data-test": "answered-skipped"
2425
+ }, pi = ["data-chosen", "data-test"], mi = {
2426
+ key: 1,
2427
+ class: "kvc-answered-gap",
2428
+ "aria-hidden": "true"
2429
+ }, hi = { style: {
2430
+ display: "flex",
2431
+ "flex-direction": "column"
2432
+ } }, gi = { dir: "auto" }, _i = {
2433
+ key: 0,
2434
+ class: "kvc-muted",
2435
+ dir: "auto"
2436
+ }, vi = {
2437
+ key: 2,
2438
+ class: "kvc-sr"
2439
+ }, yi = {
2440
+ key: 0,
2441
+ class: "kvc-answered-option",
2442
+ "data-chosen": "true",
2443
+ "data-test": "answered-other"
2444
+ }, bi = { style: {
2445
+ display: "flex",
2446
+ "flex-direction": "column"
2447
+ } }, xi = { class: "kvc-muted" }, Si = {
2448
+ dir: "auto",
2449
+ style: { "white-space": "pre-wrap" }
2450
+ }, Ci = {
2451
+ key: 2,
2452
+ class: "kvc-chip",
2453
+ style: { "align-self": "flex-start" },
2454
+ "data-test": "answered-confirmed"
2455
+ }, wi = {
2456
+ key: 3,
2457
+ dir: "auto",
2458
+ style: { "white-space": "pre-wrap" },
2459
+ "data-test": "answered-text"
2460
+ };
2461
+ function Ti(t, o, c, l, u, d) {
2462
+ return g(), i("section", {
2463
+ class: "kvc-card",
2464
+ "data-test": "answered-card",
2465
+ "aria-label": l.prompt
2466
+ }, [a("div", li, [s(l.CircleCheck, {
2467
+ size: 18,
2468
+ "aria-hidden": "true",
2469
+ class: "kvc-ok"
2470
+ }), a("span", ui, w(l.prompt), 1)]), a("div", di, [l.skipped ? (g(), i("span", fi, w(l.kvman.t("kvcoder.ui.skipped")), 1)) : l.props.answered.kind === "choice" ? (g(), i(e, { key: 1 }, [(g(!0), i(e, null, y(l.options, (e) => (g(), i("div", {
2471
+ key: e.id,
2472
+ class: "kvc-answered-option",
2473
+ "data-chosen": e.chosen,
2474
+ "data-test": `answered-option-${e.id}`
2475
+ }, [
2476
+ e.chosen ? (g(), n(l.Check, {
2477
+ key: 0,
2478
+ size: 16,
2479
+ "aria-hidden": "true",
2480
+ class: "kvc-ok"
2481
+ })) : (g(), i("span", mi)),
2482
+ a("span", hi, [a("span", gi, w(e.label), 1), e.description ? (g(), i("span", _i, w(e.description), 1)) : r("v-if", !0)]),
2483
+ e.chosen ? (g(), i("span", vi, w(l.kvman.t("kvcoder.ui.chosen")), 1)) : r("v-if", !0)
2484
+ ], 8, pi))), 128)), l.other === "" ? r("v-if", !0) : (g(), i("div", yi, [s(l.Check, {
2485
+ size: 16,
2486
+ "aria-hidden": "true",
2487
+ class: "kvc-ok"
2488
+ }), a("span", bi, [a("span", xi, w(l.kvman.t("kvcoder.ui.other")), 1), a("span", Si, w(l.other), 1)])]))], 64)) : l.props.answered.kind === "confirm" ? (g(), i("span", Ci, w(l.kvman.t(l.props.answered.answer.confirmed === !0 ? "kvcoder.ui.yes" : "kvcoder.ui.no")), 1)) : (g(), i("span", wi, w(l.text), 1))])], 8, ci);
2489
+ }
2490
+ var Ei = /*#__PURE__*/ H(si, [["render", Ti], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/AnsweredCard.vue"]]), Di = /*@__PURE__*/ c({
2491
+ __name: "ArtifactCard",
2492
+ props: {
2493
+ id: {
2494
+ type: String,
2495
+ required: !0
2496
+ },
2497
+ title: {
2498
+ type: String,
2499
+ required: !0
2500
+ },
2501
+ format: {
2502
+ type: String,
2503
+ required: !0
2504
+ },
2505
+ version: {
2506
+ type: Number,
2507
+ required: !0
2508
+ }
2509
+ },
2510
+ emits: ["open"],
2511
+ setup(e, { expose: t, emit: n }) {
2512
+ t();
2513
+ let r = {
2514
+ props: e,
2515
+ emit: n,
2516
+ kvman: U(),
2517
+ get PanelRight() {
2518
+ return ye;
2519
+ }
2520
+ };
2521
+ return Object.defineProperty(r, "__isScriptSetup", {
2522
+ enumerable: !1,
2523
+ value: !0
2524
+ }), r;
2525
+ }
2526
+ }), Oi = {
2527
+ class: "kvc-card kvc-card-row",
2528
+ "data-test": "artifact-card"
2529
+ }, ki = {
2530
+ style: {
2531
+ flex: "1 1 auto",
2532
+ "min-inline-size": "0",
2533
+ overflow: "hidden",
2534
+ "text-overflow": "ellipsis",
2535
+ "white-space": "nowrap"
2536
+ },
2537
+ "data-test": "artifact-card-title"
2538
+ }, Ai = {
2539
+ class: "kvc-chip",
2540
+ "data-test": "artifact-card-format"
2541
+ }, ji = {
2542
+ class: "kvc-muted",
2543
+ "data-test": "artifact-card-version"
2544
+ };
2545
+ function Mi(e, t, n, r, o, c) {
2546
+ return g(), i("div", Oi, [
2547
+ s(r.PanelRight, {
2548
+ size: 16,
2549
+ "aria-hidden": "true"
2550
+ }),
2551
+ a("span", ki, w(r.props.title), 1),
2552
+ a("span", Ai, w(r.kvman.t(`kvcoder.ui.artifacts.format.${r.props.format}`)), 1),
2553
+ a("span", ji, w(r.kvman.t("kvcoder.ui.artifacts.version", { version: r.props.version })), 1),
2554
+ a("button", {
2555
+ type: "button",
2556
+ class: "kvc-button",
2557
+ "data-test": "artifact-open",
2558
+ onClick: t[0] ||= (e) => r.emit("open", r.props.id)
2559
+ }, w(r.kvman.t("kvcoder.ui.artifacts.open")), 1)
2560
+ ]);
2561
+ }
2562
+ var Ni = /*#__PURE__*/ H(Di, [["render", Mi], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ArtifactCard.vue"]]);
2563
+ //#endregion
2564
+ //#region web/src/durations.ts
2565
+ function Pi(e, t) {
2566
+ if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
2567
+ if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
2568
+ let n = Math.round(t / 1e3);
2569
+ return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.minutesSeconds", {
2570
+ minutes: Math.floor(n / 60),
2571
+ seconds: n % 60
2572
+ });
2573
+ }
2574
+ //#endregion
2575
+ //#region web/src/output-links.ts
2576
+ var Fi = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, Ii = /[.,;:!?]+$/;
2577
+ function Li(e) {
2578
+ let t = [], n = 0;
2579
+ for (let r of e.matchAll(Fi)) {
2580
+ let i = r[0].replace(Ii, "");
2581
+ r.index > n && t.push({
2582
+ kind: "text",
2583
+ text: e.slice(n, r.index)
2584
+ }), t.push({
2585
+ kind: "link",
2586
+ href: i
2587
+ }), n = r.index + i.length;
2588
+ }
2589
+ return n < e.length && t.push({
2590
+ kind: "text",
2591
+ text: e.slice(n)
2592
+ }), t;
2593
+ }
2594
+ //#endregion
2595
+ //#region web/src/CallCard.vue?vue&type=script&setup=true&lang.ts
2596
+ var Ri = /*@__PURE__*/ c({
2597
+ __name: "CallCard",
2598
+ props: {
2599
+ description: {
2600
+ type: null,
2601
+ required: !1
2602
+ },
2603
+ label: {
2604
+ type: null,
2605
+ required: !1
2606
+ },
2607
+ line: {
2608
+ type: null,
2609
+ required: !1
2610
+ },
2611
+ payload: {
2612
+ type: null,
2613
+ required: !1
2614
+ },
2615
+ failed: {
2616
+ type: Boolean,
2617
+ required: !1,
2618
+ skipCheck: !0
2619
+ },
2620
+ durationMs: {
2621
+ type: null,
2622
+ required: !1
2623
+ },
2624
+ writtenMs: {
2625
+ type: null,
2626
+ required: !1
2627
+ },
2628
+ output: {
2629
+ type: null,
2630
+ required: !1
2631
+ },
2632
+ running: {
2633
+ type: Boolean,
2634
+ required: !1,
2635
+ skipCheck: !0
2636
+ },
2637
+ background: {
2638
+ type: Boolean,
2639
+ required: !1,
2640
+ skipCheck: !0
2641
+ }
2642
+ },
2643
+ setup(e, { expose: n }) {
2644
+ n();
2645
+ let r = e, i = U(), a = {
2646
+ props: r,
2647
+ kvman: i,
2648
+ open: v(!1),
2649
+ parts: t(() => Li(r.output ?? "")),
2650
+ time: t(() => r.durationMs === void 0 ? "" : Pi(i.t, (r.writtenMs ?? 0) + r.durationMs)),
2651
+ timeParts: t(() => {
2652
+ if (r.durationMs === void 0) return "";
2653
+ let e = Pi(i.t, r.durationMs);
2654
+ return r.writtenMs === void 0 ? i.t("kvcoder.ui.callRan", { ran: e }) : i.t("kvcoder.ui.callParts", {
2655
+ written: Pi(i.t, r.writtenMs),
2656
+ ran: e
2657
+ });
2658
+ }),
2659
+ detail: t(() => r.line ?? r.payload),
2660
+ get ChevronDown() {
2661
+ return B;
2662
+ },
2663
+ get ChevronRight() {
2664
+ return le;
2665
+ },
2666
+ get shortLine() {
2667
+ return Nr;
2668
+ }
2669
+ };
2670
+ return Object.defineProperty(a, "__isScriptSetup", {
2671
+ enumerable: !1,
2672
+ value: !0
2673
+ }), a;
2674
+ }
2675
+ }), zi = ["aria-expanded", "disabled"], Bi = ["aria-label"], Vi = { class: "kvc-lines" }, Hi = {
2676
+ key: 0,
2677
+ style: { "font-weight": "600" },
2678
+ "data-test": "call-description"
2679
+ }, Ui = {
2680
+ key: 1,
2681
+ class: "kvc-oneline",
2682
+ "data-test": "call-line"
2683
+ }, Wi = { class: "kvc-mono" }, Gi = {
2684
+ key: 2,
2685
+ class: "kvc-muted",
2686
+ dir: "ltr",
2687
+ style: { "align-self": "flex-start" },
2688
+ "data-test": "call-label"
2689
+ }, Ki = {
2690
+ key: 2,
2691
+ class: "kvc-chip",
2692
+ "data-test": "call-background"
2693
+ }, qi = {
2694
+ key: 3,
2695
+ class: "kvc-chip kvc-danger",
2696
+ "data-test": "call-failed"
2697
+ }, Ji = {
2698
+ class: "kvc-muted",
2699
+ "data-test": "call-time"
2700
+ }, Yi = {
2701
+ key: 0,
2702
+ class: "kvc-muted kvc-call-parts",
2703
+ "data-test": "call-parts"
2704
+ }, Xi = ["aria-label"], Zi = ["aria-label"], Qi = ["href"];
2705
+ function $i(t, s, c, l, u, d) {
2706
+ return g(), i("div", {
2707
+ class: f(["kvc-card", { "kvc-failed": l.props.failed }]),
2708
+ "data-test": "call-card"
2709
+ }, [a("button", {
2710
+ type: "button",
2711
+ class: "kvc-card-row kvc-ghost kvc-button",
2712
+ style: {
2713
+ "inline-size": "100%",
2714
+ "border-radius": "0"
2715
+ },
2716
+ "aria-expanded": l.open,
2717
+ disabled: l.props.output === void 0,
2718
+ onClick: s[0] ||= (e) => l.open = !l.open
2719
+ }, [
2720
+ l.props.running ? (g(), i("span", {
2721
+ key: 0,
2722
+ class: "kvc-spin",
2723
+ "aria-label": l.kvman.t("kvcoder.ui.running")
2724
+ }, null, 8, Bi)) : (g(), n(x(l.open ? l.ChevronDown : l.ChevronRight), {
2725
+ key: 1,
2726
+ size: 16,
2727
+ "aria-hidden": "true"
2728
+ })),
2729
+ a("span", Vi, [l.props.description ? (g(), i("span", Hi, w(l.props.description), 1)) : l.props.line ? (g(), i("span", Ui, [a("span", Wi, w(l.shortLine(l.props.line)), 1)])) : r("v-if", !0), l.props.label ? (g(), i("span", Gi, w(l.props.label), 1)) : r("v-if", !0)]),
2730
+ l.props.background ? (g(), i("span", Ki, w(l.kvman.t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
2731
+ l.props.failed ? (g(), i("span", qi, w(l.kvman.t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
2732
+ a("span", Ji, w(l.time), 1)
2733
+ ], 8, zi), l.open && l.props.output !== void 0 ? (g(), i(e, { key: 0 }, [
2734
+ l.timeParts === "" ? r("v-if", !0) : (g(), i("p", Yi, w(l.timeParts), 1)),
2735
+ l.detail === void 0 ? r("v-if", !0) : (g(), i("pre", {
2736
+ key: 1,
2737
+ class: "kvc-output kvc-mono",
2738
+ dir: "ltr",
2739
+ "aria-label": l.kvman.t("kvcoder.ui.command"),
2740
+ "data-test": "call-payload"
2741
+ }, w(l.detail), 9, Xi)),
2742
+ l.props.output === "" ? r("v-if", !0) : (g(), i("pre", {
2743
+ key: 2,
2744
+ class: "kvc-output",
2745
+ dir: "auto",
2746
+ "aria-label": l.kvman.t("kvcoder.ui.output"),
2747
+ "data-test": "call-output"
2748
+ }, [(g(!0), i(e, null, y(l.parts, (t, n) => (g(), i(e, { key: n }, [t.kind === "link" ? (g(), i("a", {
2749
+ key: 0,
2750
+ href: t.href,
2751
+ target: "_blank",
2752
+ rel: "noopener noreferrer",
2753
+ class: "kvc-link"
2754
+ }, w(t.href), 9, Qi)) : (g(), i(e, { key: 1 }, [o(w(t.text), 1)], 64))], 64))), 128))], 8, Zi))
2755
+ ], 64)) : r("v-if", !0)], 2);
2756
+ }
2757
+ var ea = /*#__PURE__*/ H(Ri, [["render", $i], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/CallCard.vue"]]), ta = /*@__PURE__*/ c({
2758
+ __name: "MessageItem",
2759
+ props: {
2760
+ message: {
2761
+ type: null,
2762
+ required: !0
2763
+ },
2764
+ calls: {
2765
+ type: Map,
2766
+ required: !0
2767
+ }
2768
+ },
2769
+ emits: ["openArtifact"],
2770
+ setup(e, { expose: n, emit: r }) {
2771
+ n();
2772
+ let i = e, a = r, o = U(), s = {
2773
+ props: i,
2774
+ emit: a,
2775
+ kvman: o,
2776
+ text: t(() => Yr(i.message.content.content)),
2777
+ thinking: t(() => Xr(i.message)),
2778
+ card: t(() => $r(i.message, i.calls)),
2779
+ artifact: t(() => ai(i.message)),
2780
+ answered: t(() => ni(i.message, i.calls)),
2781
+ notice: t(() => {
2782
+ let e = G(i.message.content.params), t = typeof e.code == "string" ? e.code : void 0, n = Object.fromEntries(Object.entries(Ue(e.details)).map(([e, t]) => [e, Ze(t)])), r = t === void 0 ? {} : { error: o.t(Ve(t), n) }, a = qe(e.details), s = String(i.message.content.code);
2783
+ return o.t(`kvcoder.notices.${a === void 0 || s !== "STEP_FAILED" ? s : "STEP_FAILED_REASON"}`, {
2784
+ ...e,
2785
+ ...r,
2786
+ ...a === void 0 ? {} : { reason: Ze(a) }
2787
+ });
2788
+ }),
2789
+ note: t(() => {
2790
+ let e = i.message.content.params;
2791
+ return o.t(String(i.message.content.key), typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {});
2792
+ }),
2793
+ imageUrl: (e) => `/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(o.workspace.value.id)}`,
2794
+ markdown: (e) => ({
2795
+ type: "markdown",
2796
+ text: "kvcoder.markdown",
2797
+ params: { text: e }
2798
+ }),
2799
+ get BellRing() {
2800
+ return oe;
2801
+ },
2802
+ get Info() {
2803
+ return _e;
2804
+ },
2805
+ get NotebookText() {
2806
+ return ve;
2807
+ },
2808
+ get ScrollText() {
2809
+ return Se;
2810
+ },
2811
+ get isBackground() {
2812
+ return ii;
2813
+ },
2814
+ get isKvcoderHint() {
2815
+ return ri;
2816
+ },
2817
+ AnsweredCard: Ei,
2818
+ ArtifactCard: Ni,
2819
+ CallCard: ea
2820
+ };
2821
+ return Object.defineProperty(s, "__isScriptSetup", {
2822
+ enumerable: !1,
2823
+ value: !0
2824
+ }), s;
2825
+ }
2826
+ }), na = {
2827
+ key: 0,
2828
+ class: "kvc-card",
2829
+ "data-test": "background-result"
2830
+ }, ra = { class: "kvc-card-row" }, ia = { class: "kvc-output" }, aa = {
2831
+ key: 1,
2832
+ class: "kvc-card",
2833
+ "data-test": "kvcoder-hint"
2834
+ }, oa = { class: "kvc-card-row" }, sa = { class: "kvc-card-body kvc-muted" }, ca = {
2835
+ key: 0,
2836
+ style: {
2837
+ display: "flex",
2838
+ gap: "6px",
2839
+ "margin-block-start": "6px"
2840
+ }
2841
+ }, la = ["src", "alt"], ua = {
2842
+ key: 1,
2843
+ class: "kvc-muted",
2844
+ style: { display: "block" },
2845
+ "data-test": "queued"
2846
+ }, da = {
2847
+ key: 3,
2848
+ class: "kvc-answer",
2849
+ "data-test": "assistant-message"
2850
+ }, fa = {
2851
+ key: 0,
2852
+ "data-test": "thinking"
2853
+ }, pa = { class: "kvc-muted" }, ma = {
2854
+ class: "kvc-muted",
2855
+ style: { "white-space": "pre-wrap" }
2856
+ }, ha = {
2857
+ key: 7,
2858
+ class: "kvc-notice",
2859
+ "data-test": "notice"
2860
+ }, ga = {
2861
+ key: 8,
2862
+ class: "kvc-card kvc-card-row",
2863
+ role: "note",
2864
+ "data-test": "note"
2865
+ }, _a = {
2866
+ key: 9,
2867
+ class: "kvc-card",
2868
+ "data-test": "summary"
2869
+ }, va = { class: "kvc-card-row" }, ya = { class: "kvc-card-body" };
2870
+ function ba(t, c, l, u, d, p) {
2871
+ return u.isBackground(u.props.message) ? (g(), i("div", na, [a("details", null, [a("summary", ra, [s(u.BellRing, {
2872
+ size: 16,
2873
+ "aria-hidden": "true"
2874
+ }), o(w(u.kvman.t(u.props.message.source?.kind === "subagent" ? "kvcoder.ui.helperFinished" : "kvcoder.ui.backgroundFinished")), 1)]), a("pre", ia, w(u.text), 1)])])) : u.isKvcoderHint(u.props.message) ? (g(), i("div", aa, [a("details", null, [a("summary", oa, [s(u.Info, {
2875
+ size: 16,
2876
+ "aria-hidden": "true"
2877
+ }), o(w(u.kvman.t("kvcoder.ui.toModel")), 1)]), a("div", sa, w(u.text), 1)])])) : u.props.message.kind === "user" ? (g(), i("div", {
2878
+ key: 2,
2879
+ dir: "auto",
2880
+ class: f(["kvc-user", { "kvc-queued": u.props.message.queued }]),
2881
+ "data-test": "user-message"
2882
+ }, [
2883
+ a("span", null, w(u.text), 1),
2884
+ u.props.message.fileIds ? (g(), i("span", ca, [(g(!0), i(e, null, y(u.props.message.fileIds, (e) => (g(), i("img", {
2885
+ key: e,
2886
+ src: u.imageUrl(e),
2887
+ alt: u.kvman.t("kvcoder.ui.attachment"),
2888
+ style: {
2889
+ "block-size": "48px",
2890
+ "border-radius": "6px"
2891
+ }
2892
+ }, null, 8, la))), 128))])) : r("v-if", !0),
2893
+ u.props.message.queued ? (g(), i("span", ua, w(u.kvman.t("kvcoder.ui.queued")), 1)) : r("v-if", !0)
2894
+ ], 2)) : u.props.message.kind === "assistant" && (u.thinking !== "" || u.text !== "") ? (g(), i("div", da, [u.thinking === "" ? r("v-if", !0) : (g(), i("details", fa, [a("summary", pa, w(u.kvman.t("kvcoder.ui.thought")), 1), a("p", ma, w(u.thinking), 1)])), u.text === "" ? r("v-if", !0) : (g(), n(x(u.kvman.View), {
2895
+ key: 1,
2896
+ view: u.markdown(u.text)
2897
+ }, null, 8, ["view"]))])) : u.props.message.kind === "toolResult" && u.artifact !== void 0 ? (g(), n(u.ArtifactCard, {
2898
+ key: 4,
2899
+ id: u.artifact.id,
2900
+ title: u.artifact.title,
2901
+ format: u.artifact.format,
2902
+ version: u.artifact.version,
2903
+ onOpen: c[0] ||= (e) => u.emit("openArtifact", e)
2904
+ }, null, 8, [
2905
+ "id",
2906
+ "title",
2907
+ "format",
2908
+ "version"
2909
+ ])) : u.answered === void 0 ? u.props.message.kind === "toolResult" ? (g(), n(u.CallCard, {
2910
+ key: 6,
2911
+ description: u.card.description,
2912
+ label: u.card.label,
2913
+ line: u.card.line,
2914
+ payload: u.card.payload,
2915
+ failed: u.card.failed,
2916
+ "duration-ms": u.card.durationMs,
2917
+ "written-ms": u.card.writtenMs,
2918
+ output: u.card.output,
2919
+ background: u.card.background
2920
+ }, null, 8, [
2921
+ "description",
2922
+ "label",
2923
+ "line",
2924
+ "payload",
2925
+ "failed",
2926
+ "duration-ms",
2927
+ "written-ms",
2928
+ "output",
2929
+ "background"
2930
+ ])) : u.props.message.kind === "notice" ? (g(), i("div", ha, w(u.notice), 1)) : u.props.message.kind === "note" ? (g(), i("div", ga, [s(u.NotebookText, {
2931
+ size: 18,
2932
+ "aria-hidden": "true"
2933
+ }), o(w(u.note), 1)])) : u.props.message.kind === "summary" ? (g(), i("details", _a, [a("summary", va, [s(u.ScrollText, {
2934
+ size: 16,
2935
+ "aria-hidden": "true"
2936
+ }), o(w(u.kvman.t("kvcoder.ui.summarized")), 1)]), a("div", ya, [(g(), n(x(u.kvman.View), { view: u.markdown(String(u.props.message.content.text ?? "")) }, null, 8, ["view"]))])])) : r("v-if", !0) : (g(), n(u.AnsweredCard, {
2937
+ key: 5,
2938
+ answered: u.answered
2939
+ }, null, 8, ["answered"]));
2940
+ }
2941
+ var xa = /*#__PURE__*/ H(ta, [["render", ba], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/MessageItem.vue"]]), Sa = /*@__PURE__*/ c({
2942
+ __name: "ApprovalsCard",
2943
+ props: { approvals: {
2944
+ type: Array,
2945
+ required: !0
2946
+ } },
2947
+ emits: ["decide"],
2948
+ setup(e, { expose: t, emit: n }) {
2949
+ t();
2950
+ let r = e, i = n, a = {
2951
+ props: r,
2952
+ emit: i,
2953
+ kvman: U(),
2954
+ decide: (e, t) => i("decide", {
2955
+ approvals: [...e],
2956
+ confirmed: t
2957
+ }),
2958
+ get ShieldAlert() {
2959
+ return we;
2960
+ }
2961
+ };
2962
+ return Object.defineProperty(a, "__isScriptSetup", {
2963
+ enumerable: !1,
2964
+ value: !0
2965
+ }), a;
2966
+ }
2967
+ }), Ca = {
2968
+ class: "kvc-card kvc-ask",
2969
+ "data-test": "approvals-card"
2970
+ }, wa = {
2971
+ class: "kvc-card-row",
2972
+ style: { "font-weight": "600" }
2973
+ }, Ta = ["data-test"], Ea = { style: {
2974
+ display: "flex",
2975
+ "flex-direction": "column",
2976
+ flex: "1 1 auto",
2977
+ gap: "2px",
2978
+ "min-inline-size": "0"
2979
+ } }, Da = {
2980
+ key: 0,
2981
+ style: { "font-weight": "600" },
2982
+ "data-test": "call-description"
2983
+ }, Oa = {
2984
+ key: 1,
2985
+ class: "kvc-muted",
2986
+ dir: "ltr",
2987
+ style: { "align-self": "flex-start" },
2988
+ "data-test": "call-label"
2989
+ }, ka = {
2990
+ key: 2,
2991
+ dir: "ltr",
2992
+ style: { "align-self": "flex-start" },
2993
+ "data-test": "call-subject"
2994
+ }, Aa = {
2995
+ key: 3,
2996
+ class: "kvc-chip",
2997
+ style: { "align-self": "flex-start" },
2998
+ "data-test": "call-background"
2999
+ }, ja = ["onClick"], Ma = ["onClick"], Na = {
3000
+ key: 0,
3001
+ class: "kvc-card-row kvc-actions",
3002
+ style: { "border-block-start": "1px solid var(--kv-color-border)" }
3003
+ };
3004
+ function Pa(t, n, c, l, u, d) {
3005
+ return g(), i("section", Ca, [
3006
+ a("div", wa, [s(l.ShieldAlert, {
3007
+ size: 18,
3008
+ "aria-hidden": "true"
3009
+ }), o(w(l.kvman.t("kvcoder.ui.allowCommands", { count: l.props.approvals.length })), 1)]),
3010
+ (g(!0), i(e, null, y(l.props.approvals, (e) => (g(), i("div", {
3011
+ key: e.questionId,
3012
+ class: "kvc-card-row",
3013
+ style: { "border-block-start": "1px solid var(--kv-color-border)" },
3014
+ "data-test": `approval-${e.questionId}`
3015
+ }, [
3016
+ a("span", Ea, [
3017
+ e.description ? (g(), i("span", Da, w(e.description), 1)) : r("v-if", !0),
3018
+ e.label ? (g(), i("span", Oa, w(e.label), 1)) : r("v-if", !0),
3019
+ e.subject ? (g(), i("span", ka, [a("span", { class: f(["kvc-mono", { "kvc-muted": e.description }]) }, w(e.subject), 3)])) : r("v-if", !0),
3020
+ e.background ? (g(), i("span", Aa, w(l.kvman.t("kvcoder.ui.jobs.inBackground")), 1)) : r("v-if", !0)
3021
+ ]),
3022
+ a("button", {
3023
+ type: "button",
3024
+ class: "kvc-button",
3025
+ "data-test": "deny",
3026
+ onClick: (t) => l.decide([e], !1)
3027
+ }, w(l.kvman.t("kvcoder.ui.deny")), 9, ja),
3028
+ a("button", {
3029
+ type: "button",
3030
+ class: "kvc-button kvc-primary",
3031
+ "data-test": "allow",
3032
+ onClick: (t) => l.decide([e], !0)
3033
+ }, w(l.kvman.t("kvcoder.ui.allow")), 9, Ma)
3034
+ ], 8, Ta))), 128)),
3035
+ l.props.approvals.length > 1 ? (g(), i("div", Na, [a("button", {
3036
+ type: "button",
3037
+ class: "kvc-button",
3038
+ "data-test": "deny-all",
3039
+ onClick: n[0] ||= (e) => l.decide(l.props.approvals, !1)
3040
+ }, w(l.kvman.t("kvcoder.ui.denyAll")), 1), a("button", {
3041
+ type: "button",
3042
+ class: "kvc-button kvc-primary",
3043
+ "data-test": "allow-all",
3044
+ onClick: n[1] ||= (e) => l.decide(l.props.approvals, !0)
3045
+ }, w(l.kvman.t("kvcoder.ui.allowAll")), 1)])) : r("v-if", !0)
3046
+ ]);
3047
+ }
3048
+ var Fa = /*#__PURE__*/ H(Sa, [["render", Pa], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ApprovalsCard.vue"]]), Ia = /*@__PURE__*/ c({
3049
+ __name: "QuestionCard",
3050
+ props: {
3051
+ questionId: {
3052
+ type: String,
3053
+ required: !0
3054
+ },
3055
+ question: {
3056
+ type: Object,
3057
+ required: !0
3058
+ }
3059
+ },
3060
+ emits: ["answer"],
3061
+ setup(e, { expose: n, emit: r }) {
3062
+ n();
3063
+ let i = e, a = r, o = U(), s = t(() => String(i.question.kind ?? "text")), c = t(() => String(i.question.prompt ?? "")), l = t(() => oi(i.question)), u = t(() => i.question.multiple === !0), d = t(() => i.question.other === !0), f = v(""), p = v([]), m = v("");
3064
+ function h(e) {
3065
+ a("answer", {
3066
+ questionId: i.questionId,
3067
+ answer: e
3068
+ });
3069
+ }
3070
+ function g(e) {
3071
+ p.value = u.value ? p.value.includes(e) ? p.value.filter((t) => t !== e) : [...p.value, e] : [e], u.value || (m.value = "");
3072
+ }
3073
+ function _() {
3074
+ let e = m.value.trim();
3075
+ h({
3076
+ selected: e !== "" && !u.value ? [] : p.value,
3077
+ ...e === "" ? {} : { other: e }
3078
+ });
3079
+ }
3080
+ let y = {
3081
+ props: i,
3082
+ emit: a,
3083
+ kvman: o,
3084
+ kind: s,
3085
+ prompt: c,
3086
+ options: l,
3087
+ multiple: u,
3088
+ offersOther: d,
3089
+ text: f,
3090
+ selected: p,
3091
+ other: m,
3092
+ send: h,
3093
+ choose: g,
3094
+ answerChoice: _,
3095
+ get CircleHelp() {
3096
+ return de;
3097
+ }
3098
+ };
3099
+ return Object.defineProperty(y, "__isScriptSetup", {
3100
+ enumerable: !1,
3101
+ value: !0
3102
+ }), y;
3103
+ }
3104
+ }), La = ["aria-label"], Ra = {
3105
+ class: "kvc-card-row",
3106
+ style: { "font-weight": "600" }
3107
+ }, za = { dir: "auto" }, Ba = { class: "kvc-card-body" }, Va = ["placeholder", "aria-label"], Ha = { class: "kvc-actions" }, Ua = ["data-test"], Wa = [
3108
+ "type",
3109
+ "checked",
3110
+ "name",
3111
+ "onChange"
3112
+ ], Ga = { style: {
3113
+ display: "flex",
3114
+ "flex-direction": "column"
3115
+ } }, Ka = { style: { "font-weight": "500" } }, qa = {
3116
+ key: 0,
3117
+ class: "kvc-muted"
3118
+ }, Ja = ["placeholder", "aria-label"], Ya = { class: "kvc-actions" }, Xa = ["disabled"], Za = {
3119
+ key: 2,
3120
+ class: "kvc-actions"
3121
+ };
3122
+ function Qa(t, n, o, c, l, u) {
3123
+ return g(), i("section", {
3124
+ class: "kvc-card kvc-ask",
3125
+ "data-test": "question-card",
3126
+ "aria-label": c.prompt
3127
+ }, [a("div", Ra, [s(c.CircleHelp, {
3128
+ size: 18,
3129
+ "aria-hidden": "true"
3130
+ }), a("span", za, w(c.prompt), 1)]), a("div", Ba, [c.kind === "text" ? (g(), i(e, { key: 0 }, [k(a("input", {
3131
+ "onUpdate:modelValue": n[0] ||= (e) => c.text = e,
3132
+ class: "kvc-field",
3133
+ dir: "auto",
3134
+ placeholder: String(c.props.question.placeholder ?? ""),
3135
+ "aria-label": c.prompt,
3136
+ "data-test": "answer-text",
3137
+ onKeydown: n[1] ||= A(j((e) => c.send({ text: c.text }), ["prevent"]), ["enter"])
3138
+ }, null, 40, Va), [[E, c.text]]), a("div", Ha, [a("button", {
3139
+ type: "button",
3140
+ class: "kvc-button",
3141
+ "data-test": "skip",
3142
+ onClick: n[2] ||= (e) => c.send({ dismissed: !0 })
3143
+ }, w(c.kvman.t("kvcoder.ui.skip")), 1), a("button", {
3144
+ type: "button",
3145
+ class: "kvc-button kvc-primary",
3146
+ "data-test": "answer",
3147
+ onClick: n[3] ||= (e) => c.send({ text: c.text })
3148
+ }, w(c.kvman.t("kvcoder.ui.answer")), 1)])], 64)) : c.kind === "choice" ? (g(), i(e, { key: 1 }, [
3149
+ (g(!0), i(e, null, y(c.options, (e) => (g(), i("label", {
3150
+ key: e.id,
3151
+ class: "kvc-option",
3152
+ "data-test": `option-${e.id}`
3153
+ }, [a("input", {
3154
+ type: c.multiple ? "checkbox" : "radio",
3155
+ checked: c.selected.includes(e.id),
3156
+ name: c.props.questionId,
3157
+ onChange: (t) => c.choose(e.id)
3158
+ }, null, 40, Wa), a("span", Ga, [a("span", Ka, w(e.label), 1), e.description ? (g(), i("span", qa, w(e.description), 1)) : r("v-if", !0)])], 8, Ua))), 128)),
3159
+ c.offersOther ? k((g(), i("input", {
3160
+ key: 0,
3161
+ "onUpdate:modelValue": n[4] ||= (e) => c.other = e,
3162
+ class: "kvc-field",
3163
+ placeholder: c.kvman.t("kvcoder.ui.other"),
3164
+ "aria-label": c.kvman.t("kvcoder.ui.other"),
3165
+ "data-test": "answer-other"
3166
+ }, null, 8, Ja)), [[E, c.other]]) : r("v-if", !0),
3167
+ a("div", Ya, [a("button", {
3168
+ type: "button",
3169
+ class: "kvc-button",
3170
+ "data-test": "skip",
3171
+ onClick: n[5] ||= (e) => c.send({ dismissed: !0 })
3172
+ }, w(c.kvman.t("kvcoder.ui.skip")), 1), a("button", {
3173
+ type: "button",
3174
+ class: "kvc-button kvc-primary",
3175
+ disabled: c.selected.length === 0 && c.other.trim() === "",
3176
+ "data-test": "answer",
3177
+ onClick: c.answerChoice
3178
+ }, w(c.kvman.t("kvcoder.ui.answer")), 9, Xa)])
3179
+ ], 64)) : (g(), i("div", Za, [a("button", {
3180
+ type: "button",
3181
+ class: "kvc-button",
3182
+ "data-test": "answer-no",
3183
+ onClick: n[6] ||= (e) => c.send({ confirmed: !1 })
3184
+ }, w(c.kvman.t("kvcoder.ui.no")), 1), a("button", {
3185
+ type: "button",
3186
+ class: f(["kvc-button kvc-primary", { "kvc-danger": c.props.question.danger === !0 }]),
3187
+ "data-test": "answer-yes",
3188
+ onClick: n[7] ||= (e) => c.send({ confirmed: !0 })
3189
+ }, w(c.kvman.t("kvcoder.ui.yes")), 3)]))])], 8, La);
3190
+ }
3191
+ var $a = /*#__PURE__*/ H(Ia, [["render", Qa], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/QuestionCard.vue"]]), eo = /*@__PURE__*/ c({
3192
+ __name: "PendingCards",
3193
+ props: {
3194
+ pending: {
3195
+ type: null,
3196
+ required: !0
3197
+ },
3198
+ hidden: {
3199
+ type: null,
3200
+ required: !1
3201
+ }
3202
+ },
3203
+ emits: ["answer", "decide"],
3204
+ setup(e, { expose: n, emit: r }) {
3205
+ n();
3206
+ let i = e, a = r, o = (e) => e.questionId !== null && i.hidden?.has(String(e.questionId)) !== !0, s = t(() => i.pending.filter((e) => e.kind === "question" && o(e)).map((e) => ({
3207
+ questionId: String(e.questionId),
3208
+ question: G(e.question)
3209
+ })));
3210
+ function c(e) {
3211
+ let t = Z(e), n = G(e.payload);
3212
+ return t.line === void 0 ? typeof n.path == "string" ? n.path : t.payload === void 0 ? void 0 : Nr(t.payload) : t.line;
3213
+ }
3214
+ let l = {
3215
+ props: i,
3216
+ emit: a,
3217
+ open: o,
3218
+ questions: s,
3219
+ subjectOf: c,
3220
+ approvals: t(() => i.pending.filter((e) => e.kind === "approval" && o(e)).map((e) => {
3221
+ let t = G(e.question), n = Z(t), r = c(t);
3222
+ return {
3223
+ questionId: String(e.questionId),
3224
+ ...n.description === void 0 ? {} : { description: n.description },
3225
+ ...n.label === void 0 ? {} : { label: n.label },
3226
+ ...r === void 0 ? {} : { subject: r },
3227
+ ...n.background === !0 ? { background: !0 } : {}
3228
+ };
3229
+ })),
3230
+ ApprovalsCard: Fa,
3231
+ QuestionCard: $a
3232
+ };
3233
+ return Object.defineProperty(l, "__isScriptSetup", {
3234
+ enumerable: !1,
3235
+ value: !0
3236
+ }), l;
3237
+ }
3238
+ });
3239
+ //#endregion
3240
+ //#region web/src/PendingCards.vue
3241
+ function to(t, a, o, s, c, l) {
3242
+ return g(), i(e, null, [(g(!0), i(e, null, y(s.questions, (e) => (g(), n(s.QuestionCard, {
3243
+ key: e.questionId,
3244
+ "question-id": e.questionId,
3245
+ question: e.question,
3246
+ onAnswer: a[0] ||= (e) => s.emit("answer", e)
3247
+ }, null, 8, ["question-id", "question"]))), 128)), s.approvals.length > 0 ? (g(), n(s.ApprovalsCard, {
3248
+ key: 0,
3249
+ approvals: s.approvals,
3250
+ onDecide: a[1] ||= (e) => s.emit("decide", e)
3251
+ }, null, 8, ["approvals"])) : r("v-if", !0)], 64);
3252
+ }
3253
+ var no = /*#__PURE__*/ H(eo, [["render", to], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/PendingCards.vue"]]);
3254
+ //#endregion
3255
+ //#region web/src/use-model-groups.ts
3256
+ function ro(e, t, n) {
3257
+ let r = v([]);
3258
+ return m(async () => {
3259
+ try {
3260
+ let [n, i] = await Promise.all([e.exec("kvai.provider.list", {}), e.exec("kvai.model.list", {})]);
3261
+ r.value = Xt(n, i, t());
3262
+ } catch (e) {
3263
+ n(e);
3264
+ }
3265
+ }), r;
3266
+ }
3267
+ //#endregion
3268
+ //#region web/src/RecoveryActions.vue?vue&type=script&setup=true&lang.ts
3269
+ var io = /*@__PURE__*/ c({
3270
+ __name: "RecoveryActions",
3271
+ props: { sessionId: {
3272
+ type: String,
3273
+ required: !0
3274
+ } },
3275
+ emits: ["sent"],
3276
+ setup(e, { expose: t, emit: n }) {
3277
+ t();
3278
+ let r = e, i = n, a = U(), o = ro(a, () => null, (e) => K(a, e));
3279
+ async function s() {
3280
+ await a.exec("kvcoder.message.send", {
3281
+ sessionId: r.sessionId,
3282
+ text: a.t("kvcoder.ui.continueText")
3283
+ }), i("sent");
3284
+ }
3285
+ async function c(e) {
3286
+ try {
3287
+ await e();
3288
+ } catch (e) {
3289
+ K(a, e);
3290
+ }
3291
+ }
3292
+ let l = {
3293
+ props: r,
3294
+ emit: i,
3295
+ kvman: a,
3296
+ groups: o,
3297
+ resume: s,
3298
+ run: c,
3299
+ retry: () => c(s),
3300
+ choose: (e) => c(async () => {
3301
+ await a.exec("kvcoder.session.configure", {
3302
+ sessionId: r.sessionId,
3303
+ model: e
3304
+ }), await Y(a, e), await s();
3305
+ }),
3306
+ get RotateCw() {
3307
+ return xe;
3308
+ },
3309
+ ModelPicker: hn
3310
+ };
3311
+ return Object.defineProperty(l, "__isScriptSetup", {
3312
+ enumerable: !1,
3313
+ value: !0
3314
+ }), l;
3315
+ }
3316
+ }), ao = {
3317
+ class: "kvc-recovery",
3318
+ "data-test": "recovery"
3319
+ }, oo = { class: "kvc-recovery-picker" };
3320
+ function so(e, t, n, r, c, l) {
3321
+ return g(), i("div", ao, [a("button", {
3322
+ type: "button",
3323
+ class: "kvc-button",
3324
+ "data-test": "retry",
3325
+ onClick: r.retry
3326
+ }, [s(r.RotateCw, {
3327
+ size: 14,
3328
+ "aria-hidden": "true"
3329
+ }), o(w(r.kvman.t("kvcoder.ui.retry")), 1)]), a("div", oo, [s(r.ModelPicker, {
3330
+ groups: r.groups,
3331
+ current: null,
3332
+ empty: r.kvman.t("kvcoder.ui.chooseAnotherModel"),
3333
+ onPick: r.choose
3334
+ }, null, 8, ["groups", "empty"])])]);
3335
+ }
3336
+ var co = /*#__PURE__*/ H(io, [["render", so], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/RecoveryActions.vue"]]), lo = /*@__PURE__*/ c({
3337
+ __name: "PromptTab",
3338
+ props: { sessionId: {
3339
+ type: String,
3340
+ required: !0
3341
+ } },
3342
+ emits: ["back"],
3343
+ setup(e, { expose: t, emit: n }) {
3344
+ t();
3345
+ let r = e, i = n, a = U(), o = v(null);
3346
+ D(() => r.sessionId, async (e) => {
3347
+ try {
3348
+ o.value = await a.exec("kvcoder.prompt.get", { sessionId: e });
3349
+ } catch (e) {
3350
+ K(a, e);
3351
+ }
3352
+ }, { immediate: !0 });
3353
+ async function s() {
3354
+ o.value !== null && (await navigator.clipboard.writeText(o.value.prompt), a.toast("kvcoder.ui.copied", {}, "success"));
3355
+ }
3356
+ let c = {
3357
+ props: r,
3358
+ emit: i,
3359
+ kvman: a,
3360
+ prompt: o,
3361
+ copy: s,
3362
+ get ArrowLeft() {
3363
+ return ie;
3364
+ },
3365
+ get Copy() {
3366
+ return pe;
3367
+ }
3368
+ };
3369
+ return Object.defineProperty(c, "__isScriptSetup", {
3370
+ enumerable: !1,
3371
+ value: !0
3372
+ }), c;
3373
+ }
3374
+ }), uo = {
3375
+ class: "kvc-column",
3376
+ "data-test": "prompt-tab"
3377
+ }, fo = { style: {
3378
+ display: "flex",
3379
+ "align-items": "center",
3380
+ gap: "10px"
3381
+ } }, po = { style: { flex: "1 1 auto" } }, mo = {
3382
+ key: 0,
3383
+ style: {
3384
+ margin: "0",
3385
+ "padding-inline-start": "20px"
3386
+ }
3387
+ }, ho = {
3388
+ key: 0,
3389
+ class: "kvc-chip kvc-warn"
3390
+ }, go = {
3391
+ key: 1,
3392
+ class: "kvc-prompt",
3393
+ "data-test": "prompt-text"
3394
+ };
3395
+ function _o(t, n, c, l, u, d) {
3396
+ return g(), i("div", uo, [
3397
+ a("div", fo, [
3398
+ a("button", {
3399
+ type: "button",
3400
+ class: "kvc-button",
3401
+ "data-test": "prompt-back",
3402
+ onClick: n[0] ||= (e) => l.emit("back")
3403
+ }, [s(l.ArrowLeft, {
3404
+ size: 16,
3405
+ class: "kvc-flip",
3406
+ "aria-hidden": "true"
3407
+ }), o(w(l.kvman.t("kvcoder.ui.showChat")), 1)]),
3408
+ a("strong", po, w(l.kvman.t("kvcoder.ui.promptTitle")), 1),
3409
+ a("button", {
3410
+ type: "button",
3411
+ class: "kvc-button",
3412
+ "data-test": "copy-prompt",
3413
+ onClick: l.copy
3414
+ }, [s(l.Copy, { size: 16 }), o(w(l.kvman.t("kvcoder.ui.copy")), 1)])
3415
+ ]),
3416
+ l.prompt ? (g(), i("ul", mo, [(g(!0), i(e, null, y(l.prompt.sections, (e) => (g(), i("li", {
3417
+ key: `${e.owner}/${e.id}`,
3418
+ class: "kvc-muted",
3419
+ "data-test": "prompt-section"
3420
+ }, [o(w(l.kvman.t("kvcoder.ui.section", {
3421
+ title: e.title,
3422
+ owner: e.owner,
3423
+ reach: l.kvman.t(`kvcoder.ui.reach.${e.reach}`),
3424
+ size: e.size
3425
+ })) + " ", 1), e.included ? r("v-if", !0) : (g(), i("span", ho, w(l.kvman.t("kvcoder.ui.leftOut")), 1))]))), 128))])) : r("v-if", !0),
3426
+ l.prompt ? (g(), i("pre", go, w(l.prompt.prompt), 1)) : r("v-if", !0)
3427
+ ]);
3428
+ }
3429
+ var vo = /*#__PURE__*/ H(lo, [["render", _o], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/PromptTab.vue"]]);
3430
+ //#endregion
3431
+ //#region web/src/use-session-actions.ts
3432
+ function yo(e, t, n) {
3433
+ let r = C();
3434
+ async function i(t) {
3435
+ try {
3436
+ await t(), await n();
3437
+ } catch (t) {
3438
+ K(e, t);
3439
+ }
3440
+ }
3441
+ async function a(e, t) {
3442
+ if (r.value === void 0) {
3443
+ r.value = {
3444
+ name: e,
3445
+ startedAt: Date.now()
3446
+ };
3447
+ try {
3448
+ await i(t);
3449
+ } finally {
3450
+ r.value = void 0;
3451
+ }
3452
+ }
3453
+ }
3454
+ async function o() {
3455
+ let n;
3456
+ return await a("compact", async () => void (n = (await e.exec("kvcoder.session.compact", { sessionId: t() })).summarized)), n;
3457
+ }
3458
+ return {
3459
+ working: r,
3460
+ compact: o,
3461
+ configure: (n) => i(async () => {
3462
+ await e.exec("kvcoder.session.configure", {
3463
+ sessionId: t(),
3464
+ ...n
3465
+ }), n.model !== void 0 && await Y(e, n.model);
3466
+ }),
3467
+ rename: (n) => a("rename", async () => {
3468
+ n.trim() !== "" && await e.exec("kvcoder.session.rename", {
3469
+ sessionId: t(),
3470
+ title: n.trim()
3471
+ });
3472
+ }),
3473
+ fork: () => a("fork", async () => e.navigate("kvcoder.session", { sessionId: (await e.exec("kvcoder.session.fork", { sessionId: t() })).id })),
3474
+ exportFile: () => a("export", async () => {
3475
+ let { fileId: n } = await e.exec("kvcoder.session.export", { sessionId: t() });
3476
+ window.location.assign(`/api/files/${encodeURIComponent(n)}?workspaceId=${encodeURIComponent(e.workspace.value.id)}`);
3477
+ }),
3478
+ remove: () => i(async () => {
3479
+ await e.exec("kvcoder.session.delete", { sessionId: t() }), e.navigate("kvcoder.chat");
3480
+ })
3481
+ };
3482
+ }
3483
+ //#endregion
3484
+ //#region web/src/SessionModel.vue?vue&type=script&setup=true&lang.ts
3485
+ var bo = /*@__PURE__*/ c({
3486
+ __name: "SessionModel",
3487
+ props: { session: {
3488
+ type: null,
3489
+ required: !0
3490
+ } },
3491
+ emits: ["changed"],
3492
+ setup(e, { expose: t, emit: n }) {
3493
+ t();
3494
+ let r = e, i = n, a = U(), o = {
3495
+ props: r,
3496
+ emit: i,
3497
+ kvman: a,
3498
+ groups: ro(a, () => r.session.model, (e) => K(a, e)),
3499
+ actions: yo(a, () => r.session.id, () => i("changed")),
3500
+ ModelControls: bn
3501
+ };
3502
+ return Object.defineProperty(o, "__isScriptSetup", {
3503
+ enumerable: !1,
3504
+ value: !0
3505
+ }), o;
3506
+ }
3507
+ });
3508
+ //#endregion
3509
+ //#region web/src/SessionModel.vue
3510
+ function xo(e, t, r, i, a, o) {
3511
+ return g(), n(i.ModelControls, {
3512
+ groups: i.groups,
3513
+ model: i.props.session.model ?? null,
3514
+ thinking: i.props.session.thinking,
3515
+ onModel: t[0] ||= (e) => i.actions.configure({ model: e }),
3516
+ onThinking: t[1] ||= (e) => i.actions.configure({ thinking: e })
3517
+ }, null, 8, [
3518
+ "groups",
3519
+ "model",
3520
+ "thinking"
3521
+ ]);
3522
+ }
3523
+ var So = /*#__PURE__*/ H(bo, [["render", xo], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/SessionModel.vue"]]), Co = /*@__PURE__*/ c({
3524
+ __name: "SubagentCard",
3525
+ props: {
3526
+ child: {
3527
+ type: Object,
3528
+ required: !0
3529
+ },
3530
+ hidden: {
3531
+ type: null,
3532
+ required: !1
3533
+ }
3534
+ },
3535
+ emits: ["answer", "decide"],
3536
+ setup(e, { expose: n, emit: r }) {
3537
+ n();
3538
+ let i = e, a = r, o = U(), s = {
3539
+ props: i,
3540
+ emit: a,
3541
+ kvman: o,
3542
+ status: t(() => o.t(`kvcoder.ui.status.${i.child.session.status}`)),
3543
+ get Bot() {
3544
+ return se;
3545
+ },
3546
+ get titleText() {
3547
+ return Be;
3548
+ },
3549
+ PendingCards: no
3550
+ };
3551
+ return Object.defineProperty(s, "__isScriptSetup", {
3552
+ enumerable: !1,
3553
+ value: !0
3554
+ }), s;
3555
+ }
3556
+ }), wo = ["aria-label"], To = { class: "kvc-card-row" }, Eo = {
3557
+ key: 0,
3558
+ class: "kvc-chip kvc-mono",
3559
+ "data-test": "subagent-worker"
3560
+ }, Do = { style: {
3561
+ flex: "1 1 auto",
3562
+ "font-weight": "500"
3563
+ } }, Oo = {
3564
+ key: 1,
3565
+ class: "kvc-spin"
3566
+ }, ko = {
3567
+ key: 0,
3568
+ class: "kvc-card-body"
3569
+ }, Ao = {
3570
+ key: 0,
3571
+ class: "kvc-muted",
3572
+ style: {
3573
+ margin: "0",
3574
+ "white-space": "pre-wrap"
3575
+ }
3576
+ };
3577
+ function jo(e, t, n, o, c, l) {
3578
+ return g(), i("section", {
3579
+ class: "kvc-card",
3580
+ "data-test": "subagent-card",
3581
+ "aria-label": o.titleText(o.kvman.t, o.props.child.session.title)
3582
+ }, [a("div", To, [
3583
+ s(o.Bot, {
3584
+ size: 18,
3585
+ "aria-hidden": "true"
3586
+ }),
3587
+ o.props.child.session.worker === void 0 ? r("v-if", !0) : (g(), i("span", Eo, w(o.props.child.session.worker), 1)),
3588
+ a("span", Do, w(o.titleText(o.kvman.t, o.props.child.session.title)), 1),
3589
+ o.props.child.session.status === "running" ? (g(), i("span", Oo)) : r("v-if", !0),
3590
+ a("span", { class: f(["kvc-chip", { "kvc-warn": o.props.child.session.status === "waiting" }]) }, w(o.status), 3)
3591
+ ]), o.props.child.live.text !== "" || (o.props.child.turn?.pending.length ?? 0) > 0 ? (g(), i("div", ko, [o.props.child.live.text === "" ? r("v-if", !0) : (g(), i("p", Ao, w(o.props.child.live.text), 1)), s(o.PendingCards, {
3592
+ pending: o.props.child.turn?.pending ?? [],
3593
+ hidden: o.props.hidden,
3594
+ onAnswer: t[0] ||= (e) => o.emit("answer", e),
3595
+ onDecide: t[1] ||= (e) => o.emit("decide", e)
3596
+ }, null, 8, ["pending", "hidden"])])) : r("v-if", !0)], 8, wo);
3597
+ }
3598
+ var Mo = /*#__PURE__*/ H(Co, [["render", jo], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/SubagentCard.vue"]]), No = /*@__PURE__*/ c({
3599
+ __name: "WorkerCard",
3600
+ props: {
3601
+ sessionId: {
3602
+ type: String,
3603
+ required: !0
3604
+ },
3605
+ runId: {
3606
+ type: String,
3607
+ required: !0
3608
+ }
3609
+ },
3610
+ setup(e, { expose: t }) {
3611
+ t();
3612
+ let n = e, r = U(), i = v(), a = v(Date.now()), o = v(!1), s;
3613
+ m(async () => {
3614
+ s = setInterval(() => a.value = Date.now(), 1e3);
3615
+ try {
3616
+ i.value = await r.exec("kvcoder.job.get", {
3617
+ sessionId: n.sessionId,
3618
+ id: n.runId
3619
+ });
3620
+ } catch (e) {
3621
+ K(r, e);
3622
+ }
3623
+ }), p(() => clearInterval(s));
3624
+ async function c() {
3625
+ o.value = !0;
3626
+ try {
3627
+ await r.exec("kvcoder.job.cancel", {
3628
+ sessionId: n.sessionId,
3629
+ id: n.runId
3630
+ });
3631
+ } catch (e) {
3632
+ K(r, e);
3633
+ }
3634
+ o.value = !1;
3635
+ }
3636
+ let l = {
3637
+ props: n,
3638
+ kvman: r,
3639
+ run: i,
3640
+ now: a,
3641
+ stopping: o,
3642
+ get timer() {
3643
+ return s;
3644
+ },
3645
+ set timer(e) {
3646
+ s = e;
3647
+ },
3648
+ stop: c,
3649
+ get Bot() {
3650
+ return se;
3651
+ },
3652
+ get elapsed() {
3653
+ return Bn;
3654
+ }
3655
+ };
3656
+ return Object.defineProperty(l, "__isScriptSetup", {
3657
+ enumerable: !1,
3658
+ value: !0
3659
+ }), l;
3660
+ }
3661
+ }), Po = ["aria-label"], Fo = { class: "kvc-card-row" }, Io = {
3662
+ class: "kvc-chip kvc-mono",
3663
+ "data-test": "worker-card-name"
3664
+ }, Lo = {
3665
+ style: {
3666
+ flex: "1 1 auto",
3667
+ "font-weight": "500"
3668
+ },
3669
+ dir: "auto",
3670
+ "data-test": "worker-card-call"
3671
+ }, Ro = {
3672
+ class: "kvc-chip",
3673
+ "data-test": "worker-card-time"
3674
+ }, zo = ["disabled"];
3675
+ function Bo(e, t, n, o, c, l) {
3676
+ return o.run === void 0 ? r("v-if", !0) : (g(), i("section", {
3677
+ key: 0,
3678
+ class: "kvc-card",
3679
+ "data-test": "worker-card",
3680
+ "aria-label": o.run.title
3681
+ }, [a("div", Fo, [
3682
+ s(o.Bot, {
3683
+ size: 18,
3684
+ "aria-hidden": "true"
3685
+ }),
3686
+ a("span", Io, w(o.run.title), 1),
3687
+ a("span", Lo, w(o.run.call), 1),
3688
+ t[0] ||= a("span", { class: "kvc-spin" }, null, -1),
3689
+ a("span", Ro, w(o.kvman.t("kvcoder.ui.jobs.status.running")) + " · " + w(o.elapsed(o.kvman.t, o.now - Date.parse(o.run.startedAt))), 1),
3690
+ a("button", {
3691
+ type: "button",
3692
+ class: "kvc-button",
3693
+ disabled: o.stopping,
3694
+ "data-test": "worker-card-stop",
3695
+ onClick: o.stop
3696
+ }, w(o.kvman.t("kvcoder.ui.jobs.stop")), 9, zo)
3697
+ ])], 8, Po));
3698
+ }
3699
+ var Vo = /*#__PURE__*/ H(No, [["render", Bo], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/WorkerCard.vue"]]), Ho = (e) => {
3700
+ let t = e.description ?? e.subject;
3701
+ return {
3702
+ name: "run",
3703
+ ...t === void 0 ? {} : { description: t },
3704
+ ...e.label === void 0 ? {} : { label: e.label },
3705
+ complete: !0
3706
+ };
3707
+ };
3708
+ function Uo(e, t) {
3709
+ let n = v(/* @__PURE__ */ new Set()), r = /* @__PURE__ */ new Map();
3710
+ function i(e) {
3711
+ for (let { questionId: t } of e) n.value.delete(t), r.delete(t);
3712
+ }
3713
+ async function a(a) {
3714
+ for (let { questionId: e } of a) n.value.add(e);
3715
+ let o = null;
3716
+ for (let [t, n] of a.entries()) try {
3717
+ o = (await e.exec("kvcoder.question.answer", n)).jobId ?? o;
3718
+ } catch (n) {
3719
+ if (He(n)?.code === "kvcoder/QUESTION_NOT_FOUND") continue;
3720
+ i(a.slice(t)), K(e, n);
3721
+ return;
3722
+ }
3723
+ let s = o === null ? [] : [...r.values()];
3724
+ o !== null && r.clear(), await t(s).catch((t) => K(e, t));
3725
+ }
3726
+ return {
3727
+ hidden: n,
3728
+ answer: (e) => a([e]),
3729
+ decide: ({ approvals: e, confirmed: t }) => {
3730
+ if (t) for (let t of e) r.set(t.questionId, Ho(t));
3731
+ return a(e.map((e) => ({
3732
+ questionId: e.questionId,
3733
+ answer: { confirmed: t }
3734
+ })));
3735
+ }
3736
+ };
3737
+ }
3738
+ //#endregion
3739
+ //#region web/src/use-artifacts.ts
3740
+ function Wo(e, t, n, r) {
3741
+ let i = v([]), a = v(void 0), o = v(void 0), s = v(!1), c = /* @__PURE__ */ new Set(), l, u = !1, d = 0, f = !1;
3742
+ function h(e) {
3743
+ l = e, u = !1, c.clear(), i.value = [], a.value = void 0, o.value = void 0, s.value = !1;
3744
+ }
3745
+ async function g(n, s) {
3746
+ let c = i.value.find((e) => e.id === s);
3747
+ if (c === void 0) return;
3748
+ let l = o.value;
3749
+ if (l === void 0 || l.id !== s || l.version !== c.version || l.updatedAt !== c.updatedAt) try {
3750
+ let r = await e.exec("kvcoder.artifact.get", {
3751
+ sessionId: n,
3752
+ id: s
3753
+ });
3754
+ if (f || t() !== n || a.value !== s) return;
3755
+ o.value = r;
3756
+ } catch (e) {
3757
+ f || r(e);
3758
+ }
3759
+ }
3760
+ async function _() {
3761
+ let n = t();
3762
+ if (n === void 0) {
3763
+ l !== void 0 && h(void 0);
3764
+ return;
3765
+ }
3766
+ l !== n && h(n);
3767
+ let p = d += 1, m;
3768
+ try {
3769
+ m = await e.exec("kvcoder.artifact.list", { sessionId: n });
3770
+ } catch (e) {
3771
+ !f && p === d && r(e);
3772
+ return;
3773
+ }
3774
+ if (f || p !== d || t() !== n || l !== n) return;
3775
+ if (i.value = m, !u) {
3776
+ u = !0;
3777
+ for (let e of m) c.add(e.id);
3778
+ if (m.length === 0) {
3779
+ a.value = void 0, o.value = void 0, s.value = !1;
3780
+ return;
3781
+ }
3782
+ let e = m[0];
3783
+ e !== void 0 && (a.value === void 0 || m.every((e) => e.id !== a.value)) && (a.value = e.id);
3784
+ let t = a.value;
3785
+ t !== void 0 && await g(n, t);
3786
+ return;
3787
+ }
3788
+ let _ = m.filter((e) => !c.has(e.id));
3789
+ for (let e of _) c.add(e.id);
3790
+ if (_.length > 0) {
3791
+ let e = [..._].sort((e, t) => e.updatedAt < t.updatedAt ? 1 : e.updatedAt > t.updatedAt ? -1 : 0)[0];
3792
+ e !== void 0 && (a.value = e.id, s.value = !0, await g(n, e.id));
3793
+ return;
3794
+ }
3795
+ let v = a.value;
3796
+ if (v !== void 0 && m.every((e) => e.id !== v)) {
3797
+ let e = m[0];
3798
+ if (e === void 0) {
3799
+ a.value = void 0, o.value = void 0, s.value = !1;
3800
+ return;
3801
+ }
3802
+ a.value = e.id;
3803
+ }
3804
+ let y = a.value;
3805
+ y !== void 0 && await g(n, y);
3806
+ }
3807
+ function y(e) {
3808
+ if (i.value.every((t) => t.id !== e)) return;
3809
+ a.value = e;
3810
+ let n = t();
3811
+ n !== void 0 && g(n, e);
3812
+ }
3813
+ function b(e) {
3814
+ if (i.value.every((t) => t.id !== e)) return;
3815
+ a.value = e, s.value = !0;
3816
+ let n = t();
3817
+ n !== void 0 && g(n, e);
3818
+ }
3819
+ function x() {
3820
+ if (s.value) {
3821
+ s.value = !1;
3822
+ return;
3823
+ }
3824
+ if (i.value.length === 0) return;
3825
+ let e = a.value;
3826
+ if (e === void 0 || i.value.every((t) => t.id !== e)) {
3827
+ let e = i.value[0];
3828
+ if (e === void 0) return;
3829
+ a.value = e.id;
3830
+ }
3831
+ s.value = !0;
3832
+ let n = t(), r = a.value;
3833
+ n !== void 0 && r !== void 0 && g(n, r);
3834
+ }
3835
+ function S() {
3836
+ s.value = !1;
3837
+ }
3838
+ return m(_), D([t, n], _), p(() => {
3839
+ f = !0;
3840
+ }), {
3841
+ list: i,
3842
+ shown: a,
3843
+ content: o,
3844
+ open: s,
3845
+ select: y,
3846
+ openArtifact: b,
3847
+ toggle: x,
3848
+ close: S
3849
+ };
3850
+ }
3851
+ //#endregion
3852
+ //#region web/src/use-conversation.ts
3853
+ var Go = 5e3;
3854
+ function Ko(e, t, n) {
3855
+ let r = C(null), i = C([]), a = C(0), o = C([]), s = C(!1), c = _(Q()), l = S(/* @__PURE__ */ new Map()), u = /* @__PURE__ */ new Set(), d = !1;
3856
+ async function f(t) {
3857
+ let n = (t?.pending ?? []).flatMap((e) => e.childSessionId === null ? [] : [e.childSessionId]);
3858
+ for (let e of [...l.keys()]) n.includes(e) || l.delete(e);
3859
+ for (let t of n) {
3860
+ let [n, [r]] = await Promise.all([e.exec("kvcoder.session.get", { sessionId: t }), e.exec("kvcoder.turn.list", {
3861
+ sessionId: t,
3862
+ limit: 1
3863
+ })]);
3864
+ l.set(t, {
3865
+ session: n,
3866
+ turn: r,
3867
+ live: l.get(t)?.live ?? _(Q())
3868
+ });
3869
+ }
3870
+ }
3871
+ async function p() {
3872
+ let n = t();
3873
+ if (n === void 0) return;
3874
+ let [s, c, l] = await Promise.all([
3875
+ e.exec("kvcoder.session.get", { sessionId: n }),
3876
+ e.exec("kvcoder.message.list", {
3877
+ sessionId: n,
3878
+ limit: 200
3879
+ }),
3880
+ e.exec("kvcoder.turn.list", {
3881
+ sessionId: n,
3882
+ limit: 50
3883
+ })
3884
+ ]);
3885
+ r.value !== null && r.value.status !== s.status && e.refresh(), r.value = s, i.value = c.messages, a.value = c.omitted, o.value = l, await f(s.status === "waiting" ? l[0] : void 0);
3886
+ }
3887
+ async function m(t, r, i, a = []) {
3888
+ let o = t, s = a;
3889
+ for (; o !== void 0 && !d && !u.has(o);) {
3890
+ u.add(o), Object.assign(r, Q()), r.calls = s.map((e) => ({
3891
+ ...e,
3892
+ complete: !0,
3893
+ carried: !0
3894
+ })), s = [], e.follow(o).catch(n);
3895
+ let t;
3896
+ for await (let i of e.stream(o)) {
3897
+ let e = Lr(r, i);
3898
+ e.kind === "follow" && (t = e.jobId), e.kind === "subagent" && v(e.sessionId, e.jobId).catch(n), e.kind === "question" && p().catch(n);
3899
+ }
3900
+ u.delete(o);
3901
+ let a = await i();
3902
+ o = t ?? (a === o ? void 0 : a);
3903
+ }
3904
+ Object.assign(r, Q());
3905
+ }
3906
+ async function g(e, t = []) {
3907
+ s.value = !0;
3908
+ try {
3909
+ await m(e, c, async () => (await p(), r.value?.status === "running" ? r.value.stepJobId : void 0), t);
3910
+ } finally {
3911
+ s.value = u.size > 0;
3912
+ }
3913
+ }
3914
+ async function v(t, n) {
3915
+ await p();
3916
+ let r = l.get(t);
3917
+ r !== void 0 && (await m(n, r.live, async () => {
3918
+ let n = await e.exec("kvcoder.session.get", { sessionId: t });
3919
+ return n.status === "running" ? n.stepJobId : void 0;
3920
+ }), await y());
3921
+ }
3922
+ async function y(e = []) {
3923
+ await p();
3924
+ let t = r.value;
3925
+ t?.status === "running" && t.stepJobId !== void 0 && g(t.stepJobId, e).catch(n);
3926
+ for (let [e, t] of l) t.session.status === "running" && t.session.stepJobId !== void 0 && v(e, t.session.stepJobId).catch(n);
3927
+ }
3928
+ let b = setInterval(() => {
3929
+ u.size === 0 && t() !== void 0 && y().catch(n);
3930
+ }, Go);
3931
+ return h(() => {
3932
+ d = !0, clearInterval(b);
3933
+ }), D([t, () => e.workspace.value.id], () => y().catch(n), { immediate: !0 }), {
3934
+ session: r,
3935
+ messages: i,
3936
+ omitted: a,
3937
+ turns: o,
3938
+ live: c,
3939
+ streaming: s,
3940
+ children: l,
3941
+ refresh: y,
3942
+ stream: g
3943
+ };
3944
+ }
3945
+ //#endregion
3946
+ //#region web/src/use-follow-latest.ts
3947
+ var qo = 80;
3948
+ function Jo(e, t, n) {
3949
+ let r = v(!1);
3950
+ function i() {
3951
+ e.value !== null && (e.value.scrollTop = e.value.scrollHeight);
3952
+ }
3953
+ function a() {
3954
+ let t = e.value;
3955
+ t !== null && (r.value = t.scrollHeight - t.clientHeight - t.scrollTop > qo);
3956
+ }
3957
+ function o() {
3958
+ r.value = !1, i();
3959
+ }
3960
+ return D(t, async () => {
3961
+ r.value || (await d(), i());
3962
+ }), D(n, async () => {
3963
+ r.value = !1, await d(), i();
3964
+ }), {
3965
+ away: r,
3966
+ onScroll: a,
3967
+ resume: o
3968
+ };
3969
+ }
3970
+ //#endregion
3971
+ //#region web/src/use-workspace-session.ts
3972
+ function Yo(e, n, r) {
3973
+ let i = C(e.workspace.value.id);
3974
+ async function a(t) {
3975
+ let n;
3976
+ try {
3977
+ n = (await e.exec("kvcoder.session.list", { limit: 1 }))[0]?.id;
3978
+ } catch (n) {
3979
+ e.workspace.value.id === t && r(n);
3980
+ }
3981
+ e.workspace.value.id === t && (n === void 0 ? e.navigate("kvcoder.chat") : e.navigate("kvcoder.session", { sessionId: n }));
3982
+ }
3983
+ return D(n, () => {
3984
+ i.value = e.workspace.value.id;
3985
+ }), D(() => e.workspace.value.id, (e) => {
3986
+ n() === void 0 ? i.value = e : a(e);
3987
+ }), t(() => i.value === e.workspace.value.id ? n() : void 0);
3988
+ }
3989
+ //#endregion
3990
+ //#region web/src/ConversationView.vue?vue&type=script&setup=true&lang.ts
3991
+ var Xo = /*@__PURE__*/ c({
3992
+ __name: "ConversationView",
3993
+ props: { sessionId: {
3994
+ type: null,
3995
+ required: !1
3996
+ } },
3997
+ setup(e, { expose: n }) {
3998
+ n();
3999
+ let r = e, i = U(), a = Yo(i, () => r.sessionId, (e) => K(i, e)), o = v("chat"), s = Ko(i, () => a.value, (e) => K(i, e)), { session: c, messages: l, omitted: u, turns: d, live: f, children: p } = s, m = Wo(i, () => a.value, () => c.value?.updatedAt, (e) => K(i, e)), h = t(() => m.open.value && m.shown.value !== void 0), g = t(() => Zr(l.value)), _ = /* @__PURE__ */ new Set([
4000
+ "STEP_FAILED",
4001
+ "REPLY_LOST",
4002
+ "INTERRUPTED"
4003
+ ]), y = t(() => c.value?.status === "running"), b = t(() => y.value && d.value[0]?.outcome === void 0 ? d.value[0]?.startedAt : void 0), x = t(() => c.value?.status === "waiting" ? d.value[0]?.pending ?? [] : []), S = t(() => {
4004
+ let e = /* @__PURE__ */ new Map();
4005
+ for (let t of l.value) t.kind === "assistant" && t.turnId !== void 0 && e.set(t.turnId, t.id);
4006
+ let t = /* @__PURE__ */ new Map();
4007
+ for (let n of d.value) {
4008
+ let r = e.get(n.id);
4009
+ r !== void 0 && n.outcome !== void 0 && t.set(r, $e(i.t, n.usage, n.durationMs));
4010
+ }
4011
+ return t;
4012
+ });
4013
+ async function C(e) {
4014
+ if (a.value !== void 0) try {
4015
+ await i.exec("kvcoder.message.send", {
4016
+ sessionId: a.value,
4017
+ text: e.text,
4018
+ ...e.fileIds.length > 0 ? { fileIds: e.fileIds } : {}
4019
+ }), M.resume(), await s.refresh();
4020
+ } catch (e) {
4021
+ K(i, e);
4022
+ }
4023
+ }
4024
+ async function w() {
4025
+ if (a.value !== void 0) try {
4026
+ await i.exec("kvcoder.turn.cancel", { sessionId: a.value }), await s.refresh();
4027
+ } catch (e) {
4028
+ K(i, e);
4029
+ }
4030
+ }
4031
+ let E = Uo(i, (e) => s.refresh(e)), D = t(() => x.value.flatMap((e) => e.kind === "worker" && e.runId !== void 0 ? [e.runId] : [])), O = t(() => x.value.filter((e) => e.questionId === null || !E.hidden.value.has(String(e.questionId)))), k = t(() => {
4032
+ let e = l.value.at(-1);
4033
+ return c.value?.status === "idle" && e?.kind === "notice" && _.has(String(e.content.code));
4034
+ }), A = yo(i, () => a.value ?? "", () => s.refresh()), j = T("list"), M = Jo(j, () => [
4035
+ l.value,
4036
+ f.text,
4037
+ f.thinking,
4038
+ f.calls.length,
4039
+ f.summarizing,
4040
+ y.value,
4041
+ x.value,
4042
+ p.size,
4043
+ E.hidden.value,
4044
+ A.working.value
4045
+ ], () => a.value);
4046
+ async function N() {
4047
+ if (a.value !== void 0) try {
4048
+ let { fileId: e } = await i.exec("kvcoder.session.export", { sessionId: a.value });
4049
+ window.location.assign(`/api/files/${encodeURIComponent(e)}?workspaceId=${encodeURIComponent(i.workspace.value.id)}`);
4050
+ } catch (e) {
4051
+ K(i, e);
4052
+ }
4053
+ }
4054
+ let P = () => l.value.at(-1)?.kind === "notice" && l.value.at(-1)?.content.code === "SUMMARY_FAILED";
4055
+ async function F() {
4056
+ return (await i.exec("kernel.settings.list", {})).find((e) => e.key === "kvcoder.compactKeep")?.value ?? null;
4057
+ }
4058
+ async function I() {
4059
+ let e = await A.compact();
4060
+ e === !0 ? i.toast("kvcoder.ui.summarized", {}, "success") : e === !1 && !P() && i.toast("kvcoder.ui.nothingToSummarize", { count: await F() });
4061
+ }
4062
+ function L(e, t) {
4063
+ if (e === "new") return i.navigate("kvcoder.chat");
4064
+ if (e === "prompt") return void (o.value = o.value === "prompt" ? "chat" : "prompt");
4065
+ if (e === "delete") return void A.remove();
4066
+ A.working.value === void 0 && (o.value = "chat", e === "rename" ? A.rename(t) : e === "compact" ? I() : e === "export" ? A.exportFile() : A.fork());
4067
+ }
4068
+ let R = {
4069
+ props: r,
4070
+ kvman: i,
4071
+ sessionId: a,
4072
+ tab: o,
4073
+ conversation: s,
4074
+ session: c,
4075
+ messages: l,
4076
+ omitted: u,
4077
+ turns: d,
4078
+ live: f,
4079
+ children: p,
4080
+ artifacts: m,
4081
+ panelShown: h,
4082
+ calls: g,
4083
+ recoverableNotices: _,
4084
+ running: y,
4085
+ runningSince: b,
4086
+ pending: x,
4087
+ turnTotals: S,
4088
+ send: C,
4089
+ stop: w,
4090
+ answers: E,
4091
+ runs: D,
4092
+ waitingOnYou: O,
4093
+ recoverable: k,
4094
+ actions: A,
4095
+ list: j,
4096
+ follow: M,
4097
+ exportEarlier: N,
4098
+ summaryFailed: P,
4099
+ keptMessages: F,
4100
+ summarize: I,
4101
+ command: L,
4102
+ key: (e) => e.id,
4103
+ get ArrowDown() {
4104
+ return re;
4105
+ },
4106
+ ArtifactPanel: Dt,
4107
+ MessageComposer: Yt,
4108
+ ChatStart: An,
4109
+ CommandProgress: Rn,
4110
+ ConversationHeader: Dr,
4111
+ ActivityLine: qr,
4112
+ MessageItem: xa,
4113
+ PendingCards: no,
4114
+ RecoveryActions: co,
4115
+ PromptTab: vo,
4116
+ SessionModel: So,
4117
+ SubagentCard: Mo,
4118
+ WorkerCard: Vo
4119
+ };
4120
+ return Object.defineProperty(R, "__isScriptSetup", {
4121
+ enumerable: !1,
4122
+ value: !0
4123
+ }), R;
4124
+ }
4125
+ }), Zo = { class: "kvc-workspace" }, Qo = { class: "kvc-stage" }, $o = {
4126
+ class: "kvc-conversation",
4127
+ "data-test": "conversation"
4128
+ }, es = { class: "kvc-scrollport" }, ts = {
4129
+ key: 1,
4130
+ class: "kvc-column"
4131
+ }, ns = {
4132
+ key: 0,
4133
+ class: "kvc-muted",
4134
+ "data-test": "turn-totals"
4135
+ }, rs = {
4136
+ key: 2,
4137
+ class: "kvc-notice",
4138
+ "data-test": "summarizing"
4139
+ }, is = {
4140
+ key: 3,
4141
+ class: "kvc-answer",
4142
+ "data-test": "live-answer"
4143
+ }, as = ["open"], os = { class: "kvc-muted" }, ss = {
4144
+ class: "kvc-muted",
4145
+ style: { "white-space": "pre-wrap" }
4146
+ }, cs = {
4147
+ key: 6,
4148
+ class: "kvc-muted",
4149
+ style: {
4150
+ "text-align": "center",
4151
+ margin: "0"
4152
+ }
4153
+ };
4154
+ function ls(t, c, l, u, d, f) {
4155
+ return g(), i("div", Zo, [u.session && u.sessionId !== void 0 ? (g(), n(u.ConversationHeader, {
4156
+ key: 0,
4157
+ session: u.session,
4158
+ tab: u.tab,
4159
+ turns: u.turns.length,
4160
+ "running-since": u.runningSince,
4161
+ artifacts: u.artifacts.list.value.length,
4162
+ "artifacts-open": u.artifacts.open.value,
4163
+ working: u.actions.working.value !== void 0,
4164
+ onTab: c[0] ||= (e) => u.tab = e,
4165
+ onAction: u.command,
4166
+ onToggleArtifacts: c[1] ||= (e) => u.artifacts.toggle()
4167
+ }, null, 8, [
4168
+ "session",
4169
+ "tab",
4170
+ "turns",
4171
+ "running-since",
4172
+ "artifacts",
4173
+ "artifacts-open",
4174
+ "working"
4175
+ ])) : r("v-if", !0), a("div", Qo, [a("section", $o, [u.props.sessionId === void 0 ? (g(), n(u.ChatStart, { key: 0 })) : u.session && u.sessionId !== void 0 ? (g(), i(e, { key: 1 }, [a("div", es, [a("div", {
4176
+ ref: "list",
4177
+ class: "kvc-scroll",
4178
+ onScroll: c[5] ||= (...e) => u.follow.onScroll && u.follow.onScroll(...e)
4179
+ }, [u.tab === "prompt" ? (g(), n(u.PromptTab, {
4180
+ key: 0,
4181
+ "session-id": u.session.id,
4182
+ onBack: c[2] ||= (e) => u.tab = "chat"
4183
+ }, null, 8, ["session-id"])) : (g(), i("div", ts, [
4184
+ u.omitted > 0 ? (g(), i("button", {
4185
+ key: 0,
4186
+ type: "button",
4187
+ class: "kvc-button",
4188
+ style: { "align-self": "center" },
4189
+ "data-test": "earlier",
4190
+ onClick: u.exportEarlier
4191
+ }, w(u.kvman.t("kvcoder.ui.earlierMessages", { count: u.omitted })), 1)) : r("v-if", !0),
4192
+ (g(!0), i(e, null, y(u.messages, (t) => (g(), i(e, { key: u.key(t) }, [s(u.MessageItem, {
4193
+ message: t,
4194
+ calls: u.calls,
4195
+ onOpenArtifact: c[3] ||= (e) => u.artifacts.openArtifact(e)
4196
+ }, null, 8, ["message", "calls"]), u.turnTotals.has(t.id) ? (g(), i("span", ns, w(u.turnTotals.get(t.id)), 1)) : r("v-if", !0)], 64))), 128)),
4197
+ u.recoverable ? (g(), n(u.RecoveryActions, {
4198
+ key: 1,
4199
+ "session-id": u.session.id,
4200
+ onSent: c[4] ||= (e) => {
4201
+ u.follow.resume(), u.conversation.refresh();
4202
+ }
4203
+ }, null, 8, ["session-id"])) : r("v-if", !0),
4204
+ u.live.summarizing ? (g(), i("div", rs, w(u.kvman.t("kvcoder.ui.summarizing")), 1)) : r("v-if", !0),
4205
+ u.running && (u.live.text !== "" || u.live.thinking !== "") ? (g(), i("div", is, [u.live.thinking === "" ? r("v-if", !0) : (g(), i("details", {
4206
+ key: 0,
4207
+ open: u.live.text === "" && u.live.calls.length === 0,
4208
+ "data-test": "live-thinking"
4209
+ }, [a("summary", os, w(u.kvman.t("kvcoder.ui.thinkingNow")), 1), a("p", ss, w(u.live.thinking), 1)], 8, as)), u.live.text === "" ? r("v-if", !0) : (g(), n(x(u.kvman.View), {
4210
+ key: 1,
4211
+ view: {
4212
+ type: "markdown",
4213
+ text: "kvcoder.markdown",
4214
+ params: { text: u.live.text }
4215
+ }
4216
+ }, null, 8, ["view"]))])) : r("v-if", !0),
4217
+ u.running ? (g(), n(u.ActivityLine, {
4218
+ key: 4,
4219
+ live: u.live
4220
+ }, null, 8, ["live"])) : r("v-if", !0),
4221
+ u.actions.working.value ? (g(), n(u.CommandProgress, {
4222
+ key: 5,
4223
+ working: u.actions.working.value
4224
+ }, null, 8, ["working"])) : r("v-if", !0),
4225
+ (g(!0), i(e, null, y(u.children, ([e, t]) => (g(), n(u.SubagentCard, {
4226
+ key: e,
4227
+ child: t,
4228
+ hidden: u.answers.hidden.value,
4229
+ onAnswer: u.answers.answer,
4230
+ onDecide: u.answers.decide
4231
+ }, null, 8, [
4232
+ "child",
4233
+ "hidden",
4234
+ "onAnswer",
4235
+ "onDecide"
4236
+ ]))), 128)),
4237
+ (g(!0), i(e, null, y(u.runs, (e) => (g(), n(u.WorkerCard, {
4238
+ key: e,
4239
+ "session-id": u.session.id,
4240
+ "run-id": e
4241
+ }, null, 8, ["session-id", "run-id"]))), 128)),
4242
+ s(u.PendingCards, {
4243
+ pending: u.pending,
4244
+ hidden: u.answers.hidden.value,
4245
+ onAnswer: u.answers.answer,
4246
+ onDecide: u.answers.decide
4247
+ }, null, 8, [
4248
+ "pending",
4249
+ "hidden",
4250
+ "onAnswer",
4251
+ "onDecide"
4252
+ ]),
4253
+ u.waitingOnYou.some((e) => e.kind !== "subagent" && e.kind !== "worker") ? (g(), i("p", cs, w(u.kvman.t("kvcoder.ui.messageDismisses")), 1)) : r("v-if", !0)
4254
+ ]))], 544), u.follow.away.value ? (g(), i("button", {
4255
+ key: 0,
4256
+ type: "button",
4257
+ class: "kvc-button kvc-jump",
4258
+ "data-test": "jump-to-latest",
4259
+ onClick: c[6] ||= (...e) => u.follow.resume && u.follow.resume(...e)
4260
+ }, [s(u.ArrowDown, {
4261
+ size: 16,
4262
+ "aria-hidden": "true"
4263
+ }), o(w(u.kvman.t("kvcoder.ui.jumpToLatest")), 1)])) : r("v-if", !0)]), s(u.MessageComposer, {
4264
+ running: u.running,
4265
+ placeholder: u.kvman.t("kvcoder.ui.placeholder"),
4266
+ blocked: u.actions.working.value !== void 0,
4267
+ commands: "run",
4268
+ onSend: u.send,
4269
+ onStop: u.stop,
4270
+ onCommand: u.command
4271
+ }, {
4272
+ controls: O(() => [s(u.SessionModel, {
4273
+ session: u.session,
4274
+ onChanged: c[7] ||= (e) => u.conversation.refresh()
4275
+ }, null, 8, ["session"])]),
4276
+ _: 1
4277
+ }, 8, [
4278
+ "running",
4279
+ "placeholder",
4280
+ "blocked"
4281
+ ])], 64)) : r("v-if", !0)]), u.panelShown ? (g(), n(u.ArtifactPanel, {
4282
+ key: 0,
4283
+ list: u.artifacts.list.value,
4284
+ shown: u.artifacts.shown.value,
4285
+ content: u.artifacts.content.value,
4286
+ onSelect: c[8] ||= (e) => u.artifacts.select(e),
4287
+ onClose: c[9] ||= (e) => u.artifacts.close()
4288
+ }, null, 8, [
4289
+ "list",
4290
+ "shown",
4291
+ "content"
4292
+ ])) : r("v-if", !0)])]);
4293
+ }
4294
+ var us = /*#__PURE__*/ H(Xo, [["render", ls], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/ConversationView.vue"]]), ds = /*@__PURE__*/ c({
4295
+ __name: "conversation",
4296
+ props: { sessionId: {
4297
+ type: String,
4298
+ required: !1
4299
+ } },
4300
+ setup(e, { expose: t }) {
4301
+ t();
4302
+ let n = {
4303
+ props: e,
4304
+ ConversationView: us
4305
+ };
4306
+ return Object.defineProperty(n, "__isScriptSetup", {
4307
+ enumerable: !1,
4308
+ value: !0
4309
+ }), n;
4310
+ }
4311
+ });
4312
+ //#endregion
4313
+ //#region web/components/conversation.vue
4314
+ function fs(e, t, r, i, a, o) {
4315
+ return g(), n(i.ConversationView, { "session-id": i.props.sessionId }, null, 8, ["session-id"]);
4316
+ }
4317
+ var ps = /*#__PURE__*/ H(ds, [["render", fs], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/components/conversation.vue"]]);
4318
+ //#endregion
4319
+ export { ps as default };