@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,56 @@
1
+ import { z } from '@kvman/sdk';
2
+ import { cancelJob, jobDetail, jobRows } from "../jobs/job-rows.js";
3
+ import { callInput } from "./connector-command.js";
4
+ // The `background` connector (plan 08 §8.5, ADR 0011, 6): what this chat started with `background: true`, a process or
5
+ // a subagent, listed, read, or stopped by the id the starting call returned. The agent sees no kernel job.
6
+ /** What the prompt's index says the connector is for. */
7
+ export const backgroundDescription = 'Follow up on what you started with background set to true: a server or other long-running shell line, or a background subagent. Use it to see its status or output, or to stop it.';
8
+ const started = z.strictObject({ id: z.string().min(1).describe('The id that the call which started the work returned.') });
9
+ const payloads = { list: z.strictObject({}), output: started, stop: started };
10
+ export const backgroundCommands = {
11
+ list: { registration: 'kvcoder.background.list', description: "Lists this chat's newest 50 background runs, newest first.", payload: payloads.list, asks: false },
12
+ output: { registration: 'kvcoder.background.output.get', description: "Gives one background run's status, and its output (a process's last 100 lines, a subagent's answer, or what a program worker's run returned).", payload: payloads.output, asks: false },
13
+ stop: { registration: 'kvcoder.background.stop', description: "Stops a background process or a program worker's run, or cancels a background subagent.", payload: payloads.stop, asks: false },
14
+ };
15
+ const rowSchema = z.object({
16
+ id: z.string(),
17
+ kind: z.enum(['process', 'subagent', 'worker']),
18
+ call: z.string(),
19
+ status: z.string(),
20
+ startedAt: z.string(),
21
+ endedAt: z.string().exactOptional(),
22
+ exitCode: z.number().int().exactOptional(),
23
+ });
24
+ const forAgent = (row) => ({ id: row.id, kind: row.kind, call: row.call, status: row.status, startedAt: row.startedAt, ...(row.endedAt === undefined ? {} : { endedAt: row.endedAt }), ...(row.exitCode === undefined ? {} : { exitCode: row.exitCode }) });
25
+ async function startedBy(ctx, sessionId, id) {
26
+ const found = await jobDetail(ctx, sessionId, id);
27
+ if (found === undefined)
28
+ throw ctx.problem('kvcoder/JOB_NOT_FOUND', { sessionId, id });
29
+ return found;
30
+ }
31
+ const commands = backgroundCommands;
32
+ export function registerBackgroundConnector(ctx) {
33
+ ctx.registerQuery('kvcoder.background.list', {
34
+ description: commands.list.description,
35
+ input: callInput(payloads.list),
36
+ output: z.array(rowSchema),
37
+ handle: async ({ sessionId }) => (await jobRows(ctx, sessionId)).map(forAgent),
38
+ });
39
+ ctx.registerQuery('kvcoder.background.output.get', {
40
+ description: commands.output.description,
41
+ input: callInput(payloads.output),
42
+ output: rowSchema.extend({ output: z.json().exactOptional(), problem: z.json().exactOptional() }),
43
+ handle: async ({ sessionId, payload }) => {
44
+ const found = await startedBy(ctx, sessionId, payload.id);
45
+ return { ...forAgent(found.row), ...found.detail };
46
+ },
47
+ });
48
+ ctx.registerCommand('kvcoder.background.stop', {
49
+ description: commands.stop.description,
50
+ input: callInput(payloads.stop),
51
+ output: z.object({ stopped: z.boolean() }),
52
+ retries: 0,
53
+ handle: async ({ sessionId, payload }) => ({ stopped: await cancelJob(ctx, sessionId, (await startedBy(ctx, sessionId, payload.id)).row, 'agent') }),
54
+ });
55
+ }
56
+ //# sourceMappingURL=background.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background.js","sourceRoot":"","sources":["../../src/connectors/background.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAe,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,SAAS,EAAyB,MAAM,wBAAwB,CAAC;AAE1E,uHAAuH;AACvH,2GAA2G;AAE3G,yDAAyD;AACzD,MAAM,CAAC,MAAM,qBAAqB,GAAG,oLAAoL,CAAC;AAE1N,MAAM,OAAO,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,C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+ export declare const binaryExec: ConnectorCommand;
4
+ export declare function registerBinaryConnector(ctx: Ctx): void;
5
+ //# sourceMappingURL=binary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../src/connectors/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAIzC,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAS1F,eAAO,MAAM,UAAU,EAAE,gBAAqN,CAAC;AAE/O,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAatD"}
@@ -0,0 +1,27 @@
1
+ import { z } from '@kvman/sdk';
2
+ import { lineRunOptions, lineRunSchema, runLine } from "../calls/line-run.js";
3
+ import { notFound } from "../problems.js";
4
+ import { activeConnectors } from "../registry/register-connectors.js";
5
+ import { lineCallInput, lineResult } from "./connector-command.js";
6
+ import { background, risky, timeoutMs } from "./payload-fields.js";
7
+ // A binary connector (plan 08 §8.4, ADR 0011, 5): a program on the system, registered by an extension or named in
8
+ // `kvcoder.connectors`. Every one has the same command besides `help`: `exec` runs `<name> <args>` in the real shell,
9
+ // with the approval, timeout, and background rules of `shell exec`.
10
+ const execPayload = z.strictObject({ args: z.string().describe("The program's arguments, as you would type them after its name.").exactOptional(), background, timeoutMs, risky });
11
+ export const binaryExec = { registration: 'kvcoder.binary.run', description: 'Runs the program with the given arguments in the real shell, in the workspace folder.', payload: execPayload, asks: true, result: lineResult };
12
+ export function registerBinaryConnector(ctx) {
13
+ ctx.registerCommand('kvcoder.binary.run', {
14
+ description: binaryExec.description,
15
+ input: lineCallInput(execPayload).extend({ connector: z.string().describe('The binary connector whose program runs.') }),
16
+ output: lineRunSchema,
17
+ ...lineRunOptions,
18
+ handle: async ({ sessionId, description, connector, payload }) => {
19
+ const binary = (await activeConnectors(ctx)).find((candidate) => candidate.name === connector && candidate.kind === 'binary');
20
+ if (binary === undefined)
21
+ throw notFound(`There is no binary connector ${connector}.`, { connector });
22
+ const args = payload.args?.trim() ?? '';
23
+ return runLine(ctx, { sessionId, description }, args === '' ? connector : `${connector} ${args}`, payload);
24
+ },
25
+ });
26
+ }
27
+ //# sourceMappingURL=binary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary.js","sourceRoot":"","sources":["../../src/connectors/binary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAyB,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEnE,kHAAkH;AAClH,sHAAsH;AACtH,oEAAoE;AAEpE,MAAM,WAAW,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AAEnL,MAAM,CAAC,MAAM,UAAU,GAAqB,EAAE,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,uFAAuF,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AAE/O,MAAM,UAAU,uBAAuB,CAAC,GAAQ;IAC9C,GAAG,CAAC,eAAe,CAAC,oBAAoB,EAAE;QACxC,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,KAAK,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC,EAAE,CAAC;QACxH,MAAM,EAAE,aAAa;QACrB,GAAG,cAAc;QACjB,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE;YAC/D,MAAM,MAAM,GAAG,CAAC,MAAM,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;YAC9H,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,QAAQ,CAAC,gCAAgC,SAAS,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YACtG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YACxC,OAAO,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAC7G,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,217 @@
1
+ import { type BuiltinConnector } from '../connector-call.ts';
2
+ import { type ConnectorCommand } from './connector-command.ts';
3
+ export declare const builtinCommands: {
4
+ shell: {
5
+ exec: {
6
+ registration: string;
7
+ description: string;
8
+ payload: import("zod").ZodObject<{
9
+ line: import("zod").ZodString;
10
+ background: import("zod").ZodExactOptional<import("zod").ZodBoolean>;
11
+ timeoutMs: import("zod").ZodExactOptional<import("zod").ZodNumber>;
12
+ risky: import("zod").ZodBoolean;
13
+ }, import("zod/v4/core").$strict>;
14
+ asks: true;
15
+ result: string;
16
+ };
17
+ };
18
+ fs: {
19
+ read: {
20
+ registration: string;
21
+ description: string;
22
+ payload: import("zod").ZodObject<{
23
+ path: import("zod").ZodString;
24
+ fromLine: import("zod").ZodExactOptional<import("zod").ZodNumber>;
25
+ lines: import("zod").ZodExactOptional<import("zod").ZodNumber>;
26
+ }, import("zod/v4/core").$strict>;
27
+ asks: false;
28
+ bounded: true;
29
+ };
30
+ list: {
31
+ registration: string;
32
+ description: string;
33
+ payload: import("zod").ZodObject<{
34
+ path: import("zod").ZodExactOptional<import("zod").ZodString>;
35
+ }, import("zod/v4/core").$strict>;
36
+ asks: false;
37
+ bounded: true;
38
+ };
39
+ search: {
40
+ registration: string;
41
+ description: string;
42
+ payload: import("zod").ZodObject<{
43
+ pattern: import("zod").ZodString;
44
+ path: import("zod").ZodExactOptional<import("zod").ZodString>;
45
+ }, import("zod/v4/core").$strict>;
46
+ asks: false;
47
+ bounded: true;
48
+ };
49
+ write: {
50
+ registration: string;
51
+ description: string;
52
+ payload: import("zod").ZodObject<{
53
+ path: import("zod").ZodString;
54
+ content: import("zod").ZodString;
55
+ risky: import("zod").ZodBoolean;
56
+ }, import("zod/v4/core").$strict>;
57
+ asks: true;
58
+ };
59
+ edit: {
60
+ registration: string;
61
+ description: string;
62
+ payload: import("zod").ZodObject<{
63
+ path: import("zod").ZodString;
64
+ edits: import("zod").ZodArray<import("zod").ZodObject<{
65
+ oldText: import("zod").ZodString;
66
+ newText: import("zod").ZodString;
67
+ }, import("zod/v4/core").$strict>>;
68
+ risky: import("zod").ZodBoolean;
69
+ }, import("zod/v4/core").$strict>;
70
+ asks: true;
71
+ };
72
+ };
73
+ artifact: {
74
+ write: {
75
+ registration: string;
76
+ description: string;
77
+ payload: import("zod").ZodObject<{
78
+ id: import("zod").ZodString;
79
+ title: import("zod").ZodString;
80
+ format: import("zod").ZodExactOptional<import("zod").ZodEnum<{
81
+ markdown: "markdown";
82
+ html: "html";
83
+ url: "url";
84
+ }>>;
85
+ content: import("zod").ZodString;
86
+ }, import("zod/v4/core").$strict>;
87
+ asks: false;
88
+ notes: string;
89
+ };
90
+ edit: {
91
+ registration: string;
92
+ description: string;
93
+ payload: import("zod").ZodObject<{
94
+ id: import("zod").ZodString;
95
+ edits: import("zod").ZodArray<import("zod").ZodObject<{
96
+ oldText: import("zod").ZodString;
97
+ newText: import("zod").ZodString;
98
+ }, import("zod/v4/core").$strict>>;
99
+ }, import("zod/v4/core").$strict>;
100
+ asks: false;
101
+ };
102
+ get: {
103
+ registration: string;
104
+ description: string;
105
+ payload: import("zod").ZodObject<{
106
+ id: import("zod").ZodString;
107
+ }, import("zod/v4/core").$strict>;
108
+ asks: false;
109
+ };
110
+ };
111
+ background: {
112
+ list: {
113
+ registration: string;
114
+ description: string;
115
+ payload: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
116
+ asks: false;
117
+ };
118
+ output: {
119
+ registration: string;
120
+ description: string;
121
+ payload: import("zod").ZodObject<{
122
+ id: import("zod").ZodString;
123
+ }, import("zod/v4/core").$strict>;
124
+ asks: false;
125
+ };
126
+ stop: {
127
+ registration: string;
128
+ description: string;
129
+ payload: import("zod").ZodObject<{
130
+ id: import("zod").ZodString;
131
+ }, import("zod/v4/core").$strict>;
132
+ asks: false;
133
+ };
134
+ };
135
+ ask: {
136
+ text: {
137
+ registration: string;
138
+ description: string;
139
+ payload: import("zod").ZodObject<{
140
+ prompt: import("zod").ZodString;
141
+ placeholder: import("zod").ZodExactOptional<import("zod").ZodString>;
142
+ }, import("zod/v4/core").$strict>;
143
+ asks: false;
144
+ result: string;
145
+ };
146
+ choice: {
147
+ registration: string;
148
+ description: string;
149
+ payload: import("zod").ZodObject<{
150
+ prompt: import("zod").ZodString;
151
+ multiple: import("zod").ZodBoolean;
152
+ options: import("zod").ZodArray<import("zod").ZodObject<{
153
+ id: import("zod").ZodString;
154
+ label: import("zod").ZodString;
155
+ description: import("zod").ZodExactOptional<import("zod").ZodString>;
156
+ }, import("zod/v4/core").$strict>>;
157
+ other: import("zod").ZodExactOptional<import("zod").ZodBoolean>;
158
+ }, import("zod/v4/core").$strict>;
159
+ asks: false;
160
+ result: string;
161
+ };
162
+ confirm: {
163
+ registration: string;
164
+ description: string;
165
+ payload: import("zod").ZodObject<{
166
+ prompt: import("zod").ZodString;
167
+ danger: import("zod").ZodExactOptional<import("zod").ZodBoolean>;
168
+ }, import("zod/v4/core").$strict>;
169
+ asks: false;
170
+ result: string;
171
+ };
172
+ };
173
+ delegate: {
174
+ run: {
175
+ registration: string;
176
+ description: string;
177
+ payload: import("zod").ZodObject<{
178
+ worker: import("zod").ZodString;
179
+ task: import("zod").ZodString;
180
+ background: import("zod").ZodExactOptional<import("zod").ZodBoolean>;
181
+ }, import("zod/v4/core").$strict>;
182
+ asks: false;
183
+ result: string;
184
+ };
185
+ };
186
+ mcp: {
187
+ tools: {
188
+ registration: string;
189
+ description: string;
190
+ payload: import("zod").ZodObject<{
191
+ server: import("zod").ZodString;
192
+ tool: import("zod").ZodExactOptional<import("zod").ZodString>;
193
+ }, import("zod/v4/core").$strict>;
194
+ asks: false;
195
+ };
196
+ call: {
197
+ registration: string;
198
+ description: string;
199
+ payload: import("zod").ZodObject<{
200
+ server: import("zod").ZodString;
201
+ tool: import("zod").ZodString;
202
+ arguments: import("zod").ZodExactOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodJSONSchema>>;
203
+ timeoutMs: import("zod").ZodExactOptional<import("zod").ZodNumber>;
204
+ risky: import("zod").ZodBoolean;
205
+ }, import("zod/v4/core").$strict>;
206
+ asks: true;
207
+ result: string;
208
+ };
209
+ };
210
+ };
211
+ /** A built-in connector's commands by name, in the order `help` lists them. */
212
+ export declare function commandsOf(connector: BuiltinConnector): Readonly<Record<string, ConnectorCommand>>;
213
+ /** What the prompt's connector index and `help` say each built-in connector is for; `shell` names the shell this run uses. */
214
+ export declare function builtinDescriptions(shell: 'bash' | 'powershell'): Record<BuiltinConnector, string>;
215
+ /** Each built-in connector's command payloads' signatures, one per command, in `commandsOf`'s order. */
216
+ export declare const builtinSignatures: Record<BuiltinConnector, readonly string[]>;
217
+ //# sourceMappingURL=builtin-connectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtin-connectors.d.ts","sourceRoot":"","sources":["../../src/connectors/builtin-connectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAI/E,OAAO,EAAqB,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AASlF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQ0C,CAAC;AAEvE,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,SAAS,EAAE,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAElG;AAED,8HAA8H;AAC9H,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAElG;AAYD,wGAAwG;AACxG,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAQzE,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { payloadSignature } from "../connector-call.js";
2
+ import { artifactCommands, artifactDescription } from "./artifact.js";
3
+ import { askCommands, askDescription } from "./ask.js";
4
+ import { backgroundCommands, backgroundDescription } from "./background.js";
5
+ import { payloadJsonSchema } from "./connector-command.js";
6
+ import { delegateCommands, delegateDescription } from "./delegate.js";
7
+ import { fsCommands, fsDescription } from "./fs.js";
8
+ import { mcpCommands, mcpDescription } from "./mcp.js";
9
+ import { shellCommands, shellDescription } from "./shell.js";
10
+ // kvcoder's own connectors together (plan 08 §8.3 and §8.5): each lives in its own file, with its description, its
11
+ // payloads, its commands, and the jobs behind them.
12
+ export const builtinCommands = {
13
+ shell: shellCommands,
14
+ fs: fsCommands,
15
+ artifact: artifactCommands,
16
+ background: backgroundCommands,
17
+ ask: askCommands,
18
+ delegate: delegateCommands,
19
+ mcp: mcpCommands,
20
+ };
21
+ /** A built-in connector's commands by name, in the order `help` lists them. */
22
+ export function commandsOf(connector) {
23
+ return builtinCommands[connector];
24
+ }
25
+ /** What the prompt's connector index and `help` say each built-in connector is for; `shell` names the shell this run uses. */
26
+ export function builtinDescriptions(shell) {
27
+ return { shell: shellDescription(shell), fs: fsDescription, artifact: artifactDescription, background: backgroundDescription, ask: askDescription, delegate: delegateDescription, mcp: mcpDescription };
28
+ }
29
+ // Each built-in payload is an object, so a missing signature is a programming error, not a case the prompt may fall
30
+ // back from; computed once per worker, not at every prompt build. In the order of `commandsOf`, like the prompt's lines.
31
+ function signaturesOf(connector) {
32
+ return Object.values(commandsOf(connector)).map((command) => {
33
+ const signature = payloadSignature(payloadJsonSchema(command.payload));
34
+ if (signature === undefined)
35
+ throw new Error(`The payload of a ${connector} command has no signature.`);
36
+ return signature;
37
+ });
38
+ }
39
+ /** Each built-in connector's command payloads' signatures, one per command, in `commandsOf`'s order. */
40
+ export const builtinSignatures = {
41
+ shell: signaturesOf('shell'),
42
+ fs: signaturesOf('fs'),
43
+ artifact: signaturesOf('artifact'),
44
+ background: signaturesOf('background'),
45
+ ask: signaturesOf('ask'),
46
+ delegate: signaturesOf('delegate'),
47
+ mcp: signaturesOf('mcp'),
48
+ };
49
+ //# sourceMappingURL=builtin-connectors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtin-connectors.js","sourceRoot":"","sources":["../../src/connectors/builtin-connectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAyB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE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AC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC1D,MAAM,SAAS,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACvE,IAAI,SAAS,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,SAAS,4BAA4B,CAAC,CAAC;QACxG,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,wGAAwG;AACxG,MAAM,CAAC,MAAM,iBAAiB,GAAgD;IAC5E,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC;IAC5B,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC;IACtB,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC;IAClC,UAAU,EAAE,YAAY,CAAC,YAAY,CAAC;IACtC,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;IACxB,QAAQ,EAAE,YAAY,CAAC,UAAU,CAAC;IAClC,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC;CACzB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { z, type Json } from '@kvman/sdk';
2
+ export type ConnectorCommand = {
3
+ registration: string;
4
+ description: string;
5
+ payload: z.ZodType;
6
+ asks: boolean;
7
+ result?: string;
8
+ notes?: string;
9
+ bounded?: true;
10
+ };
11
+ /** What `shell exec` and a binary's `exec` return. */
12
+ export declare const lineResult = "the combined output, then [exit code N].";
13
+ /** A payload schema as JSON Schema, the way the kernel shows an input (plan 02 §2.12). */
14
+ export declare function payloadJsonSchema(payload: z.ZodType): Json;
15
+ /** A built-in command's job input: the chat it runs for, and the payload. */
16
+ export declare function callInput<Payload extends z.ZodType>(payload: Payload): z.ZodObject<{
17
+ sessionId: z.ZodString;
18
+ payload: Payload;
19
+ }, z.core.$strict>;
20
+ /** The same for a command that runs in the real shell: with the call's description, which names a background run. */
21
+ export declare function lineCallInput<Payload extends z.ZodType>(payload: Payload): z.ZodObject<{
22
+ sessionId: z.ZodString;
23
+ description: z.ZodString;
24
+ payload: Payload;
25
+ }, z.core.$strict>;
26
+ //# sourceMappingURL=connector-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-command.d.ts","sourceRoot":"","sources":["../../src/connectors/connector-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAO1C,MAAM,MAAM,gBAAgB,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjK,sDAAsD;AACtD,eAAO,MAAM,UAAU,6CAA6C,CAAC;AAErE,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAE1D;AAID,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO;;;mBAEpE;AAED,qHAAqH;AACrH,wBAAgB,aAAa,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO;;;;mBAExE"}
@@ -0,0 +1,17 @@
1
+ import { z } from '@kvman/sdk';
2
+ /** What `shell exec` and a binary's `exec` return. */
3
+ export const lineResult = 'the combined output, then [exit code N].';
4
+ /** A payload schema as JSON Schema, the way the kernel shows an input (plan 02 §2.12). */
5
+ export function payloadJsonSchema(payload) {
6
+ return z.json().parse(z.toJSONSchema(payload, { io: 'input', unrepresentable: 'any' }));
7
+ }
8
+ const sessionId = z.string().describe('The chat the call belongs to.');
9
+ /** A built-in command's job input: the chat it runs for, and the payload. */
10
+ export function callInput(payload) {
11
+ return z.strictObject({ sessionId, payload: payload.describe("The command's payload.") });
12
+ }
13
+ /** The same for a command that runs in the real shell: with the call's description, which names a background run. */
14
+ export function lineCallInput(payload) {
15
+ return z.strictObject({ sessionId, description: z.string().describe("The call's description, for the person."), payload: payload.describe("The command's payload.") });
16
+ }
17
+ //# sourceMappingURL=connector-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-command.js","sourceRoot":"","sources":["../../src/connectors/connector-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAa,MAAM,YAAY,CAAC;AAS1C,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG,0CAA0C,CAAC;AAErE,0FAA0F;AAC1F,MAAM,UAAU,iBAAiB,CAAC,OAAkB;IAClD,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC,CAAC;AAEvE,6EAA6E;AAC7E,MAAM,UAAU,SAAS,CAA4B,OAAgB;IACnE,OAAO,CAAC,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC;AAED,qHAAqH;AACrH,MAAM,UAAU,aAAa,CAA4B,OAAgB;IACvE,OAAO,CAAC,CAAC,YAAY,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;AACzK,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { z, type Ctx, type Stored } from '@kvman/sdk';
2
+ import { type SubagentWorker, type Worker } from '../delegate/workers.ts';
3
+ import type { SessionDoc } from '../schemas/records.ts';
4
+ /** What the prompt's index says the connector is for; the session's entry adds its workers. */
5
+ export declare const delegateDescription = "Hand a self-contained task to a worker: a helper agent that works on it alone and returns its answer. Use it for a specialist view or to do a separate part in parallel, or with background set to true while you go on.";
6
+ /** The connector's description with the available workers, as the prompt's index shows it (ADR 0021, 1). */
7
+ export declare function delegateIndexDescription(workers: readonly Worker[]): string;
8
+ export declare const delegateRunSchema: z.ZodObject<{
9
+ worker: z.ZodString;
10
+ task: z.ZodString;
11
+ background: z.ZodExactOptional<z.ZodBoolean>;
12
+ }, z.core.$strict>;
13
+ export declare const delegateCommands: {
14
+ run: {
15
+ registration: string;
16
+ description: string;
17
+ payload: z.ZodObject<{
18
+ worker: z.ZodString;
19
+ task: z.ZodString;
20
+ background: z.ZodExactOptional<z.ZodBoolean>;
21
+ }, z.core.$strict>;
22
+ asks: false;
23
+ result: string;
24
+ };
25
+ };
26
+ export type DelegateRun = z.output<typeof delegateRunSchema>;
27
+ export declare function registerDelegateConnector(ctx: Ctx): void;
28
+ /** Creates the worker's child session, with the task as its first message. */
29
+ export declare function createChild(ctx: Ctx, parent: Stored<SessionDoc>, worker: SubagentWorker, task: string): Promise<string>;
30
+ /** Starts the child's turn and tells the parent's stream, so the conversation can stream the child (ADR 0009, 99). */
31
+ export declare function startChild(ctx: Ctx, childId: string): Promise<void>;
32
+ //# sourceMappingURL=delegate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../src/connectors/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAE3F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAYxD,+FAA+F;AAC/F,eAAO,MAAM,mBAAmB,6NAC4L,CAAC;AAE7N,4GAA4G;AAC5G,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE3E;AAED,eAAO,MAAM,iBAAiB;;;;kBAI5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;CAEe,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAYxD;AAED,8EAA8E;AAC9E,wBAAsB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4B7H;AAED,sHAAsH;AACtH,wBAAsB,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASzE"}
@@ -0,0 +1,82 @@
1
+ import { z } from '@kvman/sdk';
2
+ import { availableWorker } from "../delegate/workers.js";
3
+ import { firePoint } from "../registry/session-points.js";
4
+ import { now } from "../sessions/session-lookup.js";
5
+ import { records, txRecords } from "../store/collections.js";
6
+ import { appendMessage, noUsage, userContent } from "../turns/history.js";
7
+ import { beginTurn, openTurn } from "../turns/start-turn.js";
8
+ import { callInput } from "./connector-command.js";
9
+ // The `delegate` connector (plan 08 §8.5, ADR 0021): a task handed to a worker. A subagent worker runs it in a hidden
10
+ // child session that starts from the task alone, with the worker's instructions, connectors, model, and thinking; a
11
+ // child never has `delegate` and always has `ask`. A program worker's run is in `src/delegate/`. The check validates the payload and the worker as a kernel job, and the
12
+ // step then starts the child (ADR 0011, 9).
13
+ /** What the prompt's index says the connector is for; the session's entry adds its workers. */
14
+ export const delegateDescription = 'Hand a self-contained task to a worker: a helper agent that works on it alone and returns its answer. Use it for a specialist view or to do a separate part in parallel, or with background set to true while you go on.';
15
+ /** The connector's description with the available workers, as the prompt's index shows it (ADR 0021, 1). */
16
+ export function delegateIndexDescription(workers) {
17
+ return `${delegateDescription} Workers: ${workers.map((worker) => `${worker.name} (${worker.description.replace(/[.\s]+$/, '')})`).join(', ')}.`;
18
+ }
19
+ export const delegateRunSchema = z.strictObject({
20
+ worker: z.string().min(1).describe('The worker to hand the task to, by a name the system prompt lists.'),
21
+ task: z.string().min(1).describe("The worker's whole brief: the goal, the facts it needs, its limits, and what to return."),
22
+ background: z.boolean().describe('true lets you go on at once; the answer arrives later as a message.').exactOptional(),
23
+ });
24
+ export const delegateCommands = {
25
+ run: { registration: 'kvcoder.delegate.check', description: 'Runs a worker on a task; several runs in one reply run in parallel.', payload: delegateRunSchema, asks: false, result: "the worker's final answer, or started <id> with background." },
26
+ };
27
+ export function registerDelegateConnector(ctx) {
28
+ ctx.registerCommand('kvcoder.delegate.check', {
29
+ description: delegateCommands.run.description,
30
+ input: callInput(delegateRunSchema),
31
+ output: z.object({}),
32
+ retries: 0,
33
+ handle: async ({ sessionId, payload }) => {
34
+ const session = await records(ctx.store).sessions.get(sessionId);
35
+ await availableWorker(ctx, session?.checks ?? null, payload.worker);
36
+ return {};
37
+ },
38
+ });
39
+ }
40
+ /** Creates the worker's child session, with the task as its first message. */
41
+ export async function createChild(ctx, parent, worker, task) {
42
+ const childId = await ctx.store.transaction((tx) => {
43
+ const store = txRecords(tx);
44
+ const stamp = now();
45
+ const child = store.sessions.insert({
46
+ title: task.slice(0, 60),
47
+ autoTitle: false,
48
+ status: 'idle',
49
+ parentId: parent.id,
50
+ worker: { name: worker.name, instructions: worker.instructions },
51
+ model: worker.model ?? parent.model,
52
+ thinking: worker.thinking ?? parent.thinking,
53
+ stepJobId: null,
54
+ turnId: null,
55
+ endedTurns: 0,
56
+ nextSeq: 0,
57
+ usage: noUsage(),
58
+ durationMs: 0,
59
+ checks: null,
60
+ connectors: worker.connectors,
61
+ createdAt: stamp,
62
+ updatedAt: stamp,
63
+ });
64
+ appendMessage(store, child, { kind: 'user', content: userContent(task), source: { kind: 'subagent', sessionId: parent.id } });
65
+ return child.id;
66
+ });
67
+ await firePoint(ctx, 'kvcoder.session.created', { sessionId: childId, parentId: parent.id });
68
+ return childId;
69
+ }
70
+ /** Starts the child's turn and tells the parent's stream, so the conversation can stream the child (ADR 0009, 99). */
71
+ export async function startChild(ctx, childId) {
72
+ const turnId = await ctx.store.transaction((tx) => {
73
+ const store = txRecords(tx);
74
+ const child = store.sessions.get(childId);
75
+ return child === undefined || child.status !== 'idle' ? undefined : openTurn(store, child);
76
+ });
77
+ if (turnId === undefined)
78
+ return;
79
+ const jobId = await beginTurn(ctx, childId, turnId, false);
80
+ ctx.job.progress({ type: 'subagent', sessionId: childId, jobId });
81
+ }
82
+ //# sourceMappingURL=delegate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../src/connectors/delegate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAyB,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,eAAe,EAAoC,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAyB,MAAM,wBAAwB,CAAC;AAE1E,sHAAsH;AACtH,oHAAoH;AACpH,yKAAyK;AAC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EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { z, type Ctx } from '@kvman/sdk';
2
+ /** What the prompt's index says the connector is for. */
3
+ export declare const fsDescription = "Read, list, search, create, and change files in the workspace folder. Use it instead of cat, ls, grep, or shell redirection: read a file before you edit it, write for a new file or a full rewrite, one file per call, and edit for exact text replacements in an existing file.";
4
+ export declare const fsCommands: {
5
+ read: {
6
+ registration: string;
7
+ description: string;
8
+ payload: z.ZodObject<{
9
+ path: z.ZodString;
10
+ fromLine: z.ZodExactOptional<z.ZodNumber>;
11
+ lines: z.ZodExactOptional<z.ZodNumber>;
12
+ }, z.core.$strict>;
13
+ asks: false;
14
+ bounded: true;
15
+ };
16
+ list: {
17
+ registration: string;
18
+ description: string;
19
+ payload: z.ZodObject<{
20
+ path: z.ZodExactOptional<z.ZodString>;
21
+ }, z.core.$strict>;
22
+ asks: false;
23
+ bounded: true;
24
+ };
25
+ search: {
26
+ registration: string;
27
+ description: string;
28
+ payload: z.ZodObject<{
29
+ pattern: z.ZodString;
30
+ path: z.ZodExactOptional<z.ZodString>;
31
+ }, z.core.$strict>;
32
+ asks: false;
33
+ bounded: true;
34
+ };
35
+ write: {
36
+ registration: string;
37
+ description: string;
38
+ payload: z.ZodObject<{
39
+ path: z.ZodString;
40
+ content: z.ZodString;
41
+ risky: z.ZodBoolean;
42
+ }, z.core.$strict>;
43
+ asks: true;
44
+ };
45
+ edit: {
46
+ registration: string;
47
+ description: string;
48
+ payload: z.ZodObject<{
49
+ path: z.ZodString;
50
+ edits: z.ZodArray<z.ZodObject<{
51
+ oldText: z.ZodString;
52
+ newText: z.ZodString;
53
+ }, z.core.$strict>>;
54
+ risky: z.ZodBoolean;
55
+ }, z.core.$strict>;
56
+ asks: true;
57
+ };
58
+ };
59
+ export declare function registerFsConnector(ctx: Ctx): void;
60
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/connectors/fs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAczC,yDAAyD;AACzD,eAAO,MAAM,aAAa,sRAC2P,CAAC;AAmBtR,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMqB,CAAC;AA6D7C,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAmClD"}