@kvman/kvcoder 0.1.10 → 0.1.12

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 (328) hide show
  1. package/dist/api.d.ts +48 -2
  2. package/dist/api.d.ts.map +1 -1
  3. package/dist/calls/call-name.d.ts +8 -0
  4. package/dist/calls/call-name.d.ts.map +1 -0
  5. package/dist/calls/call-name.js +47 -0
  6. package/dist/calls/call-name.js.map +1 -0
  7. package/dist/calls/line-run.d.ts +1 -4
  8. package/dist/calls/line-run.d.ts.map +1 -1
  9. package/dist/calls/line-run.js +2 -2
  10. package/dist/calls/line-run.js.map +1 -1
  11. package/dist/calls/run-tool.d.ts +1 -6
  12. package/dist/calls/run-tool.d.ts.map +1 -1
  13. package/dist/calls/run-tool.js +5 -6
  14. package/dist/calls/run-tool.js.map +1 -1
  15. package/dist/connector-call.d.ts +3 -3
  16. package/dist/connector-call.d.ts.map +1 -1
  17. package/dist/connector-call.js +5 -3
  18. package/dist/connector-call.js.map +1 -1
  19. package/dist/connectors/artifact.d.ts +2 -1
  20. package/dist/connectors/artifact.d.ts.map +1 -1
  21. package/dist/connectors/artifact.js +1 -1
  22. package/dist/connectors/artifact.js.map +1 -1
  23. package/dist/connectors/background.d.ts.map +1 -1
  24. package/dist/connectors/background.js +17 -7
  25. package/dist/connectors/background.js.map +1 -1
  26. package/dist/connectors/binary.js +2 -2
  27. package/dist/connectors/binary.js.map +1 -1
  28. package/dist/connectors/builtin-connectors.d.ts +62 -2
  29. package/dist/connectors/builtin-connectors.d.ts.map +1 -1
  30. package/dist/connectors/builtin-connectors.js +4 -1
  31. package/dist/connectors/builtin-connectors.js.map +1 -1
  32. package/dist/connectors/connector-command.d.ts +0 -1
  33. package/dist/connectors/connector-command.d.ts.map +1 -1
  34. package/dist/connectors/connector-command.js +1 -1
  35. package/dist/connectors/connector-command.js.map +1 -1
  36. package/dist/connectors/delegate.d.ts +17 -0
  37. package/dist/connectors/delegate.d.ts.map +1 -1
  38. package/dist/connectors/delegate.js +31 -6
  39. package/dist/connectors/delegate.js.map +1 -1
  40. package/dist/connectors/execution-map.d.ts +14 -3
  41. package/dist/connectors/execution-map.d.ts.map +1 -1
  42. package/dist/connectors/execution-map.js +43 -12
  43. package/dist/connectors/execution-map.js.map +1 -1
  44. package/dist/connectors/fs.d.ts +29 -1
  45. package/dist/connectors/fs.d.ts.map +1 -1
  46. package/dist/connectors/fs.js +46 -9
  47. package/dist/connectors/fs.js.map +1 -1
  48. package/dist/connectors/payload-fields.d.ts +3 -0
  49. package/dist/connectors/payload-fields.d.ts.map +1 -1
  50. package/dist/connectors/payload-fields.js +8 -2
  51. package/dist/connectors/payload-fields.js.map +1 -1
  52. package/dist/connectors/shell.js +1 -1
  53. package/dist/connectors/shell.js.map +1 -1
  54. package/dist/connectors/web.d.ts +16 -0
  55. package/dist/connectors/web.d.ts.map +1 -0
  56. package/dist/connectors/web.js +22 -0
  57. package/dist/connectors/web.js.map +1 -0
  58. package/dist/delegate/approved-run.js +2 -2
  59. package/dist/delegate/approved-run.js.map +1 -1
  60. package/dist/delegate/continue-helper.d.ts +18 -0
  61. package/dist/delegate/continue-helper.d.ts.map +1 -0
  62. package/dist/delegate/continue-helper.js +64 -0
  63. package/dist/delegate/continue-helper.js.map +1 -0
  64. package/dist/delegate/permission.d.ts +11 -5
  65. package/dist/delegate/permission.d.ts.map +1 -1
  66. package/dist/delegate/runs.d.ts +9 -11
  67. package/dist/delegate/runs.d.ts.map +1 -1
  68. package/dist/delegate/runs.js +13 -9
  69. package/dist/delegate/runs.js.map +1 -1
  70. package/dist/delegate/workers.d.ts +6 -0
  71. package/dist/delegate/workers.d.ts.map +1 -1
  72. package/dist/files/change-diff.d.ts +17 -0
  73. package/dist/files/change-diff.d.ts.map +1 -0
  74. package/dist/files/change-diff.js +59 -0
  75. package/dist/files/change-diff.js.map +1 -0
  76. package/dist/files/edit-places.d.ts +11 -0
  77. package/dist/files/edit-places.d.ts.map +1 -0
  78. package/dist/files/edit-places.js +105 -0
  79. package/dist/files/edit-places.js.map +1 -0
  80. package/dist/files/edit-text.d.ts +1 -0
  81. package/dist/files/edit-text.d.ts.map +1 -1
  82. package/dist/files/edit-text.js +22 -10
  83. package/dist/files/edit-text.js.map +1 -1
  84. package/dist/files/file-change.d.ts.map +1 -1
  85. package/dist/files/file-change.js +12 -0
  86. package/dist/files/file-change.js.map +1 -1
  87. package/dist/files/find-paths.d.ts +9 -0
  88. package/dist/files/find-paths.d.ts.map +1 -0
  89. package/dist/files/find-paths.js +38 -0
  90. package/dist/files/find-paths.js.map +1 -0
  91. package/dist/files/read-file.d.ts +3 -1
  92. package/dist/files/read-file.d.ts.map +1 -1
  93. package/dist/files/read-file.js +7 -6
  94. package/dist/files/read-file.js.map +1 -1
  95. package/dist/files/read-files.d.ts +11 -0
  96. package/dist/files/read-files.d.ts.map +1 -0
  97. package/dist/files/read-files.js +35 -0
  98. package/dist/files/read-files.js.map +1 -0
  99. package/dist/files/read-text.d.ts +63 -0
  100. package/dist/files/read-text.d.ts.map +1 -0
  101. package/dist/files/read-text.js +67 -0
  102. package/dist/files/read-text.js.map +1 -0
  103. package/dist/files/register-changes.d.ts +3 -0
  104. package/dist/files/register-changes.d.ts.map +1 -0
  105. package/dist/files/register-changes.js +78 -0
  106. package/dist/files/register-changes.js.map +1 -0
  107. package/dist/files/search-text.d.ts +10 -1
  108. package/dist/files/search-text.d.ts.map +1 -1
  109. package/dist/files/search-text.js +32 -57
  110. package/dist/files/search-text.js.map +1 -1
  111. package/dist/files/workspace-files.d.ts +5 -0
  112. package/dist/files/workspace-files.d.ts.map +1 -0
  113. package/dist/files/workspace-files.js +66 -0
  114. package/dist/files/workspace-files.js.map +1 -0
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +6 -0
  117. package/dist/index.js.map +1 -1
  118. package/dist/jobs/helper-progress.d.ts +11 -0
  119. package/dist/jobs/helper-progress.d.ts.map +1 -0
  120. package/dist/jobs/helper-progress.js +38 -0
  121. package/dist/jobs/helper-progress.js.map +1 -0
  122. package/dist/jobs/job-rows.d.ts +3 -1
  123. package/dist/jobs/job-rows.d.ts.map +1 -1
  124. package/dist/jobs/job-rows.js +46 -22
  125. package/dist/jobs/job-rows.js.map +1 -1
  126. package/dist/jobs/process-report.d.ts +1 -1
  127. package/dist/jobs/process-report.d.ts.map +1 -1
  128. package/dist/jobs/process-report.js +11 -6
  129. package/dist/jobs/process-report.js.map +1 -1
  130. package/dist/jobs/process-run.d.ts +2 -5
  131. package/dist/jobs/process-run.d.ts.map +1 -1
  132. package/dist/jobs/process-run.js +6 -5
  133. package/dist/jobs/process-run.js.map +1 -1
  134. package/dist/jobs/register-jobs.js +3 -3
  135. package/dist/jobs/register-jobs.js.map +1 -1
  136. package/dist/maps/map-rules.d.ts +4 -2
  137. package/dist/maps/map-rules.d.ts.map +1 -1
  138. package/dist/maps/map-rules.js +7 -4
  139. package/dist/maps/map-rules.js.map +1 -1
  140. package/dist/maps/map-schema.d.ts +4 -4
  141. package/dist/maps/map-schema.d.ts.map +1 -1
  142. package/dist/maps/map-schema.js +10 -3
  143. package/dist/maps/map-schema.js.map +1 -1
  144. package/dist/prompt/build-prompt.d.ts +4 -0
  145. package/dist/prompt/build-prompt.d.ts.map +1 -1
  146. package/dist/prompt/build-prompt.js +8 -4
  147. package/dist/prompt/build-prompt.js.map +1 -1
  148. package/dist/prompt/person-preferences.d.ts +5 -0
  149. package/dist/prompt/person-preferences.d.ts.map +1 -0
  150. package/dist/prompt/person-preferences.js +14 -0
  151. package/dist/prompt/person-preferences.js.map +1 -0
  152. package/dist/prompt/session-grants.d.ts +7 -3
  153. package/dist/prompt/session-grants.d.ts.map +1 -1
  154. package/dist/prompt/session-grants.js +3 -2
  155. package/dist/prompt/session-grants.js.map +1 -1
  156. package/dist/prompt/session-prompt.d.ts.map +1 -1
  157. package/dist/prompt/session-prompt.js +15 -6
  158. package/dist/prompt/session-prompt.js.map +1 -1
  159. package/dist/prompt/working-method.d.ts +2 -2
  160. package/dist/prompt/working-method.d.ts.map +1 -1
  161. package/dist/prompt/working-method.js +51 -45
  162. package/dist/prompt/working-method.js.map +1 -1
  163. package/dist/register-settings.d.ts +27 -0
  164. package/dist/register-settings.d.ts.map +1 -1
  165. package/dist/register-settings.js +13 -0
  166. package/dist/register-settings.js.map +1 -1
  167. package/dist/schemas/approval-rule.d.ts +9 -0
  168. package/dist/schemas/approval-rule.d.ts.map +1 -0
  169. package/dist/schemas/approval-rule.js +7 -0
  170. package/dist/schemas/approval-rule.js.map +1 -0
  171. package/dist/schemas/check.d.ts +7 -0
  172. package/dist/schemas/check.d.ts.map +1 -0
  173. package/dist/schemas/check.js +9 -0
  174. package/dist/schemas/check.js.map +1 -0
  175. package/dist/schemas/records.d.ts +20 -6
  176. package/dist/schemas/records.d.ts.map +1 -1
  177. package/dist/schemas/records.js +15 -4
  178. package/dist/schemas/records.js.map +1 -1
  179. package/dist/sessions/new-session.d.ts.map +1 -1
  180. package/dist/sessions/new-session.js +8 -3
  181. package/dist/sessions/new-session.js.map +1 -1
  182. package/dist/sessions/register-fork-export.d.ts.map +1 -1
  183. package/dist/sessions/register-fork-export.js +3 -2
  184. package/dist/sessions/register-fork-export.js.map +1 -1
  185. package/dist/sessions/register-sessions.d.ts.map +1 -1
  186. package/dist/sessions/register-sessions.js +21 -10
  187. package/dist/sessions/register-sessions.js.map +1 -1
  188. package/dist/sessions/session-view.d.ts +10 -1
  189. package/dist/sessions/session-view.d.ts.map +1 -1
  190. package/dist/sessions/session-view.js +6 -1
  191. package/dist/sessions/session-view.js.map +1 -1
  192. package/dist/sessions/waiting-on.d.ts +7 -0
  193. package/dist/sessions/waiting-on.d.ts.map +1 -0
  194. package/dist/sessions/waiting-on.js +20 -0
  195. package/dist/sessions/waiting-on.js.map +1 -0
  196. package/dist/store/collections.d.ts +26 -8
  197. package/dist/store/collections.d.ts.map +1 -1
  198. package/dist/store/collections.js +3 -1
  199. package/dist/store/collections.js.map +1 -1
  200. package/dist/thinking-levels.d.ts +6 -0
  201. package/dist/thinking-levels.d.ts.map +1 -0
  202. package/dist/thinking-levels.js +13 -0
  203. package/dist/thinking-levels.js.map +1 -0
  204. package/dist/turns/answer-extras.d.ts +21 -0
  205. package/dist/turns/answer-extras.d.ts.map +1 -0
  206. package/dist/turns/answer-extras.js +43 -0
  207. package/dist/turns/answer-extras.js.map +1 -0
  208. package/dist/turns/answer-fingerprint.d.ts +6 -2
  209. package/dist/turns/answer-fingerprint.d.ts.map +1 -1
  210. package/dist/turns/answer-fingerprint.js +9 -3
  211. package/dist/turns/answer-fingerprint.js.map +1 -1
  212. package/dist/turns/apply-answer.d.ts +2 -1
  213. package/dist/turns/apply-answer.d.ts.map +1 -1
  214. package/dist/turns/apply-answer.js +10 -4
  215. package/dist/turns/apply-answer.js.map +1 -1
  216. package/dist/turns/approval-rules.d.ts +13 -0
  217. package/dist/turns/approval-rules.d.ts.map +1 -0
  218. package/dist/turns/approval-rules.js +65 -0
  219. package/dist/turns/approval-rules.js.map +1 -0
  220. package/dist/turns/cache-retention.d.ts +6 -0
  221. package/dist/turns/cache-retention.d.ts.map +1 -0
  222. package/dist/turns/cache-retention.js +7 -0
  223. package/dist/turns/cache-retention.js.map +1 -0
  224. package/dist/turns/call-results.d.ts +6 -0
  225. package/dist/turns/call-results.d.ts.map +1 -0
  226. package/dist/turns/call-results.js +21 -0
  227. package/dist/turns/call-results.js.map +1 -0
  228. package/dist/turns/check-after-edits.d.ts +8 -0
  229. package/dist/turns/check-after-edits.d.ts.map +1 -0
  230. package/dist/turns/check-after-edits.js +23 -0
  231. package/dist/turns/check-after-edits.js.map +1 -0
  232. package/dist/turns/child-result.d.ts.map +1 -1
  233. package/dist/turns/child-result.js +4 -2
  234. package/dist/turns/child-result.js.map +1 -1
  235. package/dist/turns/clear-results.d.ts +15 -0
  236. package/dist/turns/clear-results.d.ts.map +1 -0
  237. package/dist/turns/clear-results.js +58 -0
  238. package/dist/turns/clear-results.js.map +1 -0
  239. package/dist/turns/cleared-results.d.ts +17 -0
  240. package/dist/turns/cleared-results.d.ts.map +1 -0
  241. package/dist/turns/cleared-results.js +46 -0
  242. package/dist/turns/cleared-results.js.map +1 -0
  243. package/dist/turns/compaction.d.ts.map +1 -1
  244. package/dist/turns/compaction.js +8 -7
  245. package/dist/turns/compaction.js.map +1 -1
  246. package/dist/turns/end-turn-state.d.ts.map +1 -1
  247. package/dist/turns/end-turn-state.js +2 -0
  248. package/dist/turns/end-turn-state.js.map +1 -1
  249. package/dist/turns/ended-calls.d.ts +6 -0
  250. package/dist/turns/ended-calls.d.ts.map +1 -0
  251. package/dist/turns/ended-calls.js +43 -0
  252. package/dist/turns/ended-calls.js.map +1 -0
  253. package/dist/turns/file-results.d.ts +15 -0
  254. package/dist/turns/file-results.d.ts.map +1 -0
  255. package/dist/turns/file-results.js +39 -0
  256. package/dist/turns/file-results.js.map +1 -0
  257. package/dist/turns/lost-reply.js +2 -2
  258. package/dist/turns/lost-reply.js.map +1 -1
  259. package/dist/turns/model-context.d.ts +2 -0
  260. package/dist/turns/model-context.d.ts.map +1 -1
  261. package/dist/turns/model-context.js +41 -3
  262. package/dist/turns/model-context.js.map +1 -1
  263. package/dist/turns/model-info.d.ts +4 -0
  264. package/dist/turns/model-info.d.ts.map +1 -1
  265. package/dist/turns/model-info.js +7 -1
  266. package/dist/turns/model-info.js.map +1 -1
  267. package/dist/turns/model-retry.d.ts.map +1 -1
  268. package/dist/turns/model-retry.js +5 -4
  269. package/dist/turns/model-retry.js.map +1 -1
  270. package/dist/turns/read-again.d.ts +11 -5
  271. package/dist/turns/read-again.d.ts.map +1 -1
  272. package/dist/turns/read-again.js +39 -10
  273. package/dist/turns/read-again.js.map +1 -1
  274. package/dist/turns/register-turns.d.ts.map +1 -1
  275. package/dist/turns/register-turns.js +12 -4
  276. package/dist/turns/register-turns.js.map +1 -1
  277. package/dist/turns/run-calls.d.ts +4 -0
  278. package/dist/turns/run-calls.d.ts.map +1 -1
  279. package/dist/turns/run-calls.js +56 -10
  280. package/dist/turns/run-calls.js.map +1 -1
  281. package/dist/turns/run-command.d.ts.map +1 -1
  282. package/dist/turns/run-command.js +8 -10
  283. package/dist/turns/run-command.js.map +1 -1
  284. package/dist/turns/sent-size.d.ts +6 -2
  285. package/dist/turns/sent-size.d.ts.map +1 -1
  286. package/dist/turns/sent-size.js +8 -4
  287. package/dist/turns/sent-size.js.map +1 -1
  288. package/dist/turns/settle-calls.d.ts +1 -7
  289. package/dist/turns/settle-calls.d.ts.map +1 -1
  290. package/dist/turns/settle-calls.js +2 -19
  291. package/dist/turns/settle-calls.js.map +1 -1
  292. package/dist/turns/step.d.ts.map +1 -1
  293. package/dist/turns/step.js +68 -10
  294. package/dist/turns/step.js.map +1 -1
  295. package/dist/ui/register-ui.js +2 -2
  296. package/dist/ui/register-ui.js.map +1 -1
  297. package/dist/web/components/approval.css +1 -1
  298. package/dist/web/components/approval.js +122 -89
  299. package/dist/web/components/call.css +1 -1
  300. package/dist/web/components/call.js +431 -306
  301. package/dist/web/components/connectors.css +1 -1
  302. package/dist/web/components/connectors.js +553 -521
  303. package/dist/web/components/conversation.css +1 -1
  304. package/dist/web/components/conversation.js +2636 -1520
  305. package/dist/web/components/mcp-sign-in.css +1 -1
  306. package/dist/web/components/model.css +1 -1
  307. package/dist/web/components/model.js +140 -127
  308. package/dist/web/components/preferences.css +2 -0
  309. package/dist/web/components/preferences.js +151 -0
  310. package/dist/web/components/question.css +1 -1
  311. package/dist/web/components/sessions.css +1 -1
  312. package/dist/web/components/sessions.js +44 -21
  313. package/dist/web-fetch/fetch-page.d.ts +28 -0
  314. package/dist/web-fetch/fetch-page.d.ts.map +1 -0
  315. package/dist/web-fetch/fetch-page.js +108 -0
  316. package/dist/web-fetch/fetch-page.js.map +1 -0
  317. package/dist/web-fetch/private-address.d.ts +3 -0
  318. package/dist/web-fetch/private-address.d.ts.map +1 -0
  319. package/dist/web-fetch/private-address.js +69 -0
  320. package/dist/web-fetch/private-address.js.map +1 -0
  321. package/dist/web-fetch/web-hosts.d.ts +7 -0
  322. package/dist/web-fetch/web-hosts.d.ts.map +1 -0
  323. package/dist/web-fetch/web-hosts.js +19 -0
  324. package/dist/web-fetch/web-hosts.js.map +1 -0
  325. package/docs/connectors.md +5 -6
  326. package/locales/ar.json +81 -5
  327. package/locales/en.json +81 -5
  328. package/package.json +152 -6
@@ -9,8 +9,9 @@ const leadOnly = new Set(['ask', 'delegate', 'execution-map']);
9
9
  /** The existing connector scope predicate, shared by prompt and execution (ADR0044). */
10
10
  function allowedNames(session, connectors, disabled) {
11
11
  const names = [...builtinConnectors, ...connectors.map(connector => connector.name)].filter(name => !disabled.has(name));
12
+ // A chat set to "Decide for me" asks the person nothing (ADR 0092, 2).
12
13
  if (session.parentId === null)
13
- return new Set(names);
14
+ return new Set(session.decides ? names.filter(name => name !== 'ask') : names);
14
15
  // A helper hands work to no one, asks the person nothing (ADR 0063, 2), and keeps no map: the lead's is the chat's (ADR 0064, 1).
15
16
  return new Set(names.filter(name => !leadOnly.has(name) && (session.connectors === null || session.connectors.includes(name))));
16
17
  }
@@ -38,7 +39,7 @@ export function grantsInTx(store, session, prepared) {
38
39
  ...builtinConnectors.filter(name => allowed.has(name) && present[name] !== false),
39
40
  ...connectors.filter(connector => allowed.has(connector.name) && (connector.kind === 'commands' || passed.has(connector.name))).map(connector => connector.name),
40
41
  ];
41
- return { session, connectors, disabled, names, workers, servers };
42
+ return { session, connectors, disabled, names, workers, servers, webHosts: root.webHosts };
42
43
  }
43
44
  export async function sessionGrants(ctx, sessionId) {
44
45
  const prepared = await prepareGrants(ctx);
@@ -1 +1 @@
1
- {"version":3,"file":"session-grants.js","sourceRoot":"","sources":["../../src/prompt/session-grants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAA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AC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,kHAAkH;AAClH,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CA2C/F"}
@@ -4,6 +4,7 @@ import { shellFor } from "../calls/shell-program.js";
4
4
  import { builtinConnectors } from "../connector-call.js";
5
5
  import { delegateIndexDescription } from "../connectors/delegate.js";
6
6
  import { mcpIndexDescription } from "../connectors/mcp.js";
7
+ import { preferencesSection } from "./person-preferences.js";
7
8
  import { projectRules } from "./project-rules.js";
8
9
  import { helperAllows } from "../turns/helper-calls.js";
9
10
  import { readOnlyAllows } from "../turns/read-only.js";
@@ -14,9 +15,16 @@ import { buildPrompt } from "./build-prompt.js";
14
15
  import { sessionGrants } from "./session-grants.js";
15
16
  /** Prompt-time listing shares the execution predicate but never serves as later execution authority (ADR0044). */
16
17
  export async function sessionTools(ctx, session) {
17
- const rules = projectRules(ctx.job.workspace.path);
18
- const shell = await shellFor(ctx);
19
- const grants = await sessionGrants(ctx, session.id);
18
+ // The settings and files the prompt needs are read together: each read waits on the kernel, so one after another
19
+ // they add up (the person's preferences among them, ADR 0092, 3).
20
+ const [rules, preferences, shell, profile, language, grants] = await Promise.all([
21
+ projectRules(ctx.job.workspace.path),
22
+ preferencesSection(ctx),
23
+ shellFor(ctx),
24
+ agentProfile(ctx),
25
+ ctx.settings.get('kernel.language'),
26
+ sessionGrants(ctx, session.id),
27
+ ]);
20
28
  if (grants === undefined)
21
29
  throw invalid('The session ancestry is no longer available.');
22
30
  const { connectors, disabled, names, workers, servers } = grants;
@@ -38,13 +46,14 @@ export async function sessionTools(ctx, session) {
38
46
  const listed = [...builtins.filter(connector => connector.commands.length > 0), ...registered.filter(connector => connector.commands.length > 0)];
39
47
  const built = buildPrompt({
40
48
  role: current.parentId === null ? 'lead' : 'worker',
41
- profile: await agentProfile(ctx),
49
+ profile,
42
50
  workspacePath: ctx.job.workspace.path,
43
51
  platform: process.platform,
44
52
  shell: shell.kind,
45
- language: z.string().parse(await ctx.settings.get('kernel.language')),
46
- sections: [...(await sectionsFor(ctx, current.id)), ...(await rules)],
53
+ language: z.string().parse(language),
54
+ sections: [...preferences, ...(await sectionsFor(ctx, current.id)), ...rules],
47
55
  ...(current.worker === null ? {} : { worker: current.worker }),
56
+ decides: current.decides,
48
57
  connectors: listed,
49
58
  });
50
59
  for (const section of built.left)
@@ -1 +1 @@
1
- {"version":3,"file":"session-prompt.js","sourceRoot":"","sources":["../../src/prompt/session-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAyB,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAEzG,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,WAAW,EAAoB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAgBpD,kHAAkH;AAClH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAQ,EAAE,OAA2B;IACtE,MAAM,KAAK,GAAG,YAA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CAAC;QACxB,IAAI,EAAE,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;QACnD,OAAO;QACP,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI;QACrC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;QACpC,QAAQ,EAAE,CAAC,GAAG,WAAW,EAAE,GAAG,CAAC,MAAM,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC;QAC7E,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QAC9D,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,MAAM;KACnB,CAAC,CAAC;IACH,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,IAAI;QAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,4DAA4D,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACvJ,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;AACxD,CAAC"}
@@ -4,6 +4,6 @@ export type Role = 'lead' | 'worker';
4
4
  export type Method = 'engineering' | 'general';
5
5
  /** The first line of the prompt: who the agent is, and where it works; a product's profile names who the agent is instead (ADR 0082, 11). */
6
6
  export declare function identityLine(role: Role, place: string, identity?: string): string;
7
- /** The "How you work" block of a role, for the profile's method. */
8
- export declare function workingMethod(role: Role, method?: Method): string;
7
+ /** The "How you work" block of a role, for the profile's method; a lead set to "Decide for me" decides where it would ask. */
8
+ export declare function workingMethod(role: Role, method?: Method, decides?: boolean): string;
9
9
  //# sourceMappingURL=working-method.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"working-method.d.ts","sourceRoot":"","sources":["../../src/prompt/working-method.ts"],"names":[],"mappings":"AAGA,wFAAwF;AACxF,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErC,mHAAmH;AACnH,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;AAkE/C,6IAA6I;AAC7I,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAE,MAAsB,GAAG,MAAM,CAGhF"}
1
+ {"version":3,"file":"working-method.d.ts","sourceRoot":"","sources":["../../src/prompt/working-method.ts"],"names":[],"mappings":"AAIA,wFAAwF;AACxF,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErC,mHAAmH;AACnH,MAAM,MAAM,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;AAkF/C,6IAA6I;AAC7I,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAIjF;AAED,8HAA8H;AAC9H,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAE,MAAsB,EAAE,OAAO,UAAQ,GAAG,MAAM,CAGjG"}
@@ -1,50 +1,56 @@
1
- // How the agent works (plan 08 §8.2; ADR 0022, 2 to 4; ADR 0065; ADR 0072; ADR 0074; ADR 0075; ADR 0078; ADR 0081): the lead of a chat sizes up each task and chooses its path from the
2
- // named parts; a worker does the one task it was given and answers the lead alone (ADR 0063). Both end with the call-or-final-answer rule.
1
+ // How the agent works (plan 08 §8.2; ADR 0022, 2 to 4; ADR 0065; ADR 0072; ADR 0074; ADR 0075; ADR 0078; ADR 0081; ADR 0089): the lead of a chat sizes up each task and chooses its path from the
2
+ // named parts; a worker does the one task it was given and answers the lead alone (ADR 0063). Both start with working in few steps, and the lead with
3
+ // talking as it works (ADR 0097, 1); both end with keeping going to the end (ADR 0092, 1) and the call-or-final-answer rule. "Decide for me" asks nothing (ADR 0097, 7).
3
4
  const evidence = 'Decide from evidence: every decision and every claim rests on something you read, ran, or were told. When you report a result, say what you checked and what you didn\'t.';
4
5
  const simplest = "Use the simplest practical way that follows the project's conventions and sound engineering practice, and don't add what wasn't asked: no extra feature, file, option, or document.";
5
- const together = 'In one reply, reads and searches run at the same time, and calls that change something (shell lines, writes, edits) run one after another in the order you give them. So put independent calls (reads, searches, separate files, separate workers) in one reply, and a call that needs another call\'s result in a later reply: several new files are several `fs write` calls in one reply, not one reply each.';
6
+ const together = "Work in few steps. Each reply is a step, and every step sends the whole conversation again, so make in one reply every call you can make now: reads and searches run at the same time, and calls that change something (shell lines, writes, edits) run one after another in the order you give them. Read a few files with one `fs read-files`, put independent calls (searches, separate files, separate workers) in the same reply, and leave for a later reply only a call that needs another call's result. Several new files are several `fs write` calls in one reply, not one reply each.";
6
7
  const context = "Spend context with care: every result stays in the conversation and is read again at every step. Search before you read, read only the part of a long file you need, and don't read again a file you already hold: after `fs edit` the result shows the new lines. When you need a background run's result before you can go on, call `background wait` once; don't ask for its output again and again, and a run that ends tells you in a message.";
7
8
  const artifacts = 'Show the person anything long to read or see (a report, a design, an HTML page) in an artifact, not in a reply.';
8
9
  const asking = 'To put a question to the person (a choice, a yes or no, a free answer), call `ask`.';
9
10
  const checked = "Before you say that something runs or works, check it the way the person would: run it, request its address, or run its test; if you couldn't, say what is unchecked. After you start a server, request its address once before you give it to the person.";
10
- const short = "Talk to the person clearly and briefly. Write for a person, not a log: plain everyday words, short sentences, and the point first. Say only what they need: what you did, what it showed, and what is left or needs their decision. Leave out your inner steps, connector and command names, payloads, ids, and long output unless they ask; name a file or a technical term only when it helps them, and explain the term in a few words. Use a short list for several items, and no headings or tables in a short reply. Keep replies short: say what you did and what is left.";
11
- const callOrFinalAnswer = 'Say what you are about to do in the same reply as the call that does it, and never make a call that does nothing, such as `true`, just to keep going. A reply with no tool call is your final answer and ends the turn: when work remains, your reply must contain the call that does the next piece. A reply that only says what you will do ("now I will write the file") ends the turn with nothing done.';
12
- const leadMethod = [
13
- 'How you work. You are the one who decides: connectors and workers are how you act, and the result is yours. No path is fixed: you choose it for each task from what the task is, and you change it when what you find changes it.',
14
- 'Size up the task first. Read the request and look at what it touches, then judge four things: how clear it is (can you say what done looks like?), how much it changes (one place, or several parts that depend on each other), what could go wrong and how hard that is to take back, and whether the person will look at the result (a screen, a page, a report). From that, choose the lightest path that delivers the task well. A question needs an answer from what you read, and no change. A small, clear change needs doing and checking, and nothing more. An unclear request needs its questions answered before any work. Work in several parts, or work that is hard to take back, needs an execution map the person agreed to. Separate parts may need workers, and a result the person looks at needs showing. A task that turns out larger than it looked gets its map then, and one that turns out simple drops what it does not need.',
15
- 'These are the parts of a path. Use only the ones your path has.',
16
- "Understand. Before you decide anything, find out what the person is trying to achieve, as far as the task needs. Read everything they sent, attached images and files too, then look at what exists: the files, config, tests, and data the request touches, the project's rules, and what already does part of it, so you build on it and not beside it. Work out what the person needs, not only what they typed: answer for yourself what outcome they want and what they will do with it; what done looks like to them, as examples they would check (an exact name, a screen, an output); what the work changes or must keep working (other callers, stored data, settings, users); whether they asked for a goal or for a particular means (a format, a library, a design), and whether that means serves the goal; what they didn't say that changes the result (who uses it, how much data or load, which platforms and languages, privacy and security, and how good is good enough); and which of your connectors and workers help, and what is missing. Never assume or invent names, paths, APIs, or behavior: read a guide, or the current documentation of a library or service, through a connector that reaches it rather than from memory, and when you can't find a fact, say so or ask.",
17
- "Clarify. Sort what looking left open. A fact that looking would answer: look, don't ask. An ordinary detail that is easy to change: decide it yourself, and say what you chose. A decision only the person can make, or a gap that changes the result, the design, or stored data, such as a request that is unclear, contradicts itself or the code, or would break what exists: ask before any work. When the means they asked for works against their goal, or a clearly better way exists, say so and offer both before you build theirs. Ask in one round when you can, after you looked and before you plan: put each question in its own `ask` call, with all the calls in one reply, and use `ask choice` whenever you offer options, your recommended one first and each option saying what it leads to.",
18
- "Plan. Only after you understood the request, looked at what exists, and have your answers, and before you change anything, plan with `execution-map set`: never in your first reply, because a map made before you looked is a guess. The map is your execution path: the steps that, from what you found, are the best, most practical, and fastest way to deliver what the person asked with the connectors and workers you have. It is the implementation plan the person reads and agrees to, so make it detailed, not an outline. Give the goal, the outcome the person wants in their own terms, then the steps, each with a title, a description, what it comes after, what it uses, and how you will check it. A step is one stage of the path: what gets done, who does it, and how it is checked. It may cover the few files that change together, but it is always concrete, something you can name before you start it, never a phase such as implement or a whole feature. Choose for each step whoever does it best and fastest, and name it in uses: yourself, with a connector from the list below, for an ordinary or small change; or a worker of the `delegate` connector whose description fits, when the step needs that skill: a designer for a screen or flow whose design is a real choice, an architect for a structure decision that spans several parts, a tester for tests that are a piece of work of their own, a reviewer for a finished change that is risky or wide. A step's description says what it changes and how, naming the files or parts and the approach, in words the person understands without reading the code; its check is the exact command you will run or the thing you will look at. Shape the map from how the work will really run. Your own steps are one line: each comes after the one before it, in the order you will do them. A branch means delegation: steps side by side on the map run at the same time, each done by a worker. So draw a branch only for a piece of work you hand to a worker: it needs nothing from the other branches, it touches files or parts no other branch touches, it is large enough to be worth a worker that starts with none of this conversation, and its step names that worker in uses. Give the branches that start together the same `after`, or none, and don't split small independent changes into branches: do them in your own line. Where branches meet, add the step that joins them, such as wiring the parts together or the check that needs all of them, after every branch it needs. Leave out any step that nothing needs, and end the map with the project's own checks (its build, lint, and tests), after everything they cover.",
19
- 'Confirm the plan. The person agrees to the map before you work on it. Once an `execution-map set` that made the map or changed its steps succeeded, and before you start any step, call `ask choice` with other set to true. Its question first says in a few lines what you understood: the goal, what done looks like, what stays as it is, and the choices you made for the person; then it asks whether to start, with the option that starts first and an option that changes the plan, so the person can write what to change. When they ask for changes, set the map again with them and ask again; start only after they chose to start. A change of status with `execution-map update` needs no confirmation.',
20
- "Execute. With a map, the map is how you work, and the person follows the work on it, so it must always say where you are. Every map call returns the steps that are ready: take those, and never work on a step the map does not have. Mark a step doing before your first call on it, in the same reply as that call, and when several are ready, mark each one you start. When several steps are ready together they are branches: mark each doing and start them all in one reply, one `delegate run` each, so they run at the same time. Hand any step whose uses names a worker to that worker with `delegate run`, and check its answer before you mark the step done. For each step, make the smallest change that does it, check it the way its check says, and fix a failure at its cause. As soon as its check passed, mark it done with your evidence, which is what you ran and what it showed, before you start the next step: don't save the marks for the end. A step is not done because you wrote it. Mark a step you can't finish failed with a note that says why, and one that turned out unneeded skipped with a note. When the plan itself changes (a step is missing, one is no longer needed, or the order was wrong), set the map again before you go on: a step whose id stays keeps how far it got. With no map, make the smallest change that does the task, check it, and fix a failure at its cause.",
21
- 'Stay on the task. Do what was asked and nothing else. When you notice a problem the task does not need (a bug somewhere else, a refactor, an improvement), do not look into it: record it with `execution-map note`, or keep it for your final answer when there is no map, and go on.',
22
- "Delegate. A step goes to a worker of the `delegate` connector when the worker does it better or faster than you would: a specialist whose skill the step needs, separate work that runs beside yours, or a fresh review of a change you finished; its entry lists the workers and what each is for. Don't delegate what a few calls of your own would do, and ask for one review of a piece of work, not several. Several `delegate run` calls in one reply run in parallel. Brief the worker with the goal, the facts it needs, its limits, and what to return. A worker sees none of this conversation and reads again every file it needs, so put the paths, the lines that matter, and what you already found in the brief. Read what a worker returns and check it before you rely on it: its work is your responsibility. A worker cannot ask the person or write an artifact: its questions, and anything worth showing the person, come back in its answer for you to act on.",
23
- 'Show what the person will look at. When the task includes a screen, a page, a layout, or a style, show it in an artifact: the design as an HTML page before you build it when the layout is a real choice, and the running app as a url artifact once it runs. Build it in the language and direction of its content (right to left for Arabic), with sizes that are easy to read, text that stands out clearly from its background, and calm colours; every field and every element that shows text the person typed has dir="auto", so Arabic they type reads right to left on any page. Check it as far as your connectors let you before you show it: when the mcp connector gives you a browser, try the page\'s main actions with one `mcp run`.',
24
- "Finish. The work is done when it is ready for production: it does what was asked, it handles the errors and edge cases that will happen, it follows the project's conventions, its checks and tests pass, and nothing unfinished or temporary is left behind. Stop what you started in the background and no longer need, and delete the temporary files you or your tools left in the workspace folder, such as logs, snapshots, and scratch files. Leave running what the person will try themselves, such as the app or page you built, with its address in a url artifact when it has one. When you found how this project is built, tested, or run and its AGENTS.md does not say it, add a short Commands section to AGENTS.md with risky set to true: that asks the person, so don't ask them a second time with `ask`. Your final answer, in plain words and as short as the facts allow, says what was done, what you checked and what it showed, what is unchecked, what still runs in the background, and what you noted for later.",
25
- evidence,
26
- simplest,
27
- together,
28
- context,
29
- artifacts,
30
- asking,
31
- checked,
32
- short,
33
- callOrFinalAnswer,
34
- ].join('\n');
11
+ const narrate = "Talk to the person as you work, the way a colleague thinks aloud. Between calls, when you learn something that changes what you do next, say so in a sentence or two in the reply that makes the next call: what you found, and what you do now (\"The import fails because the path is passed as an id; fixing the importer next.\"). Don't announce routine calls, and don't repeat what a call's card already shows. Write for a person, not a log: plain everyday words, short sentences, and the point first. Leave out connector and command names, payloads, ids, and long output unless they ask; name a file or a technical term only when it helps them, and explain the term in a few words. Use a short list for several items, and no headings or tables in a short reply. Your final answer says what you did and what is left. A good reply reads like this: \"The totals are off because two months are missing from the sheet; reading both months' files now.\" with, in that same reply, one `fs read-files` call for the two files.";
12
+ // A task given as a list runs to its end, not in batches the person must push along (ADR 0092, 1).
13
+ const keepGoing = 'Keep going until the work is done. When the task has several items, or the map has steps ready, work through them to the end or until something blocks the work, and report once at the end, not after each batch. Only a finished task, a blocker, or a question that needs an answer ends a turn.';
14
+ const callOrFinalAnswer = 'A reply with no tool call is your final answer and ends the turn: when work remains, your reply must contain the call that does the next piece. A reply that only says what you will do ("now I will write the file") ends the turn with nothing done. Never make a call that does nothing, such as `true`, just to keep going.';
15
+ const clarifyAsking = "Clarify. Sort what looking left open. A fact that looking would answer: look, don't ask. An ordinary detail that is easy to change: decide it yourself, and say what you chose. A decision only the person can make, or a gap that changes the result, the design, or stored data, such as a request that is unclear, contradicts itself or the code, or would break what exists: ask before any work. When the means they asked for works against their goal, or a clearly better way exists, say so and offer both before you build theirs. Ask in one round when you can, after you looked and before you plan: put every question in the same reply, one `ask` call each, never one question per reply, and use `ask choice` whenever you offer options, your recommended one first and each option saying what it leads to.";
16
+ const clarifyDeciding = "Clarify. Sort what looking left open. A fact that looking would answer: look, don't guess. Anything else, decide yourself, since the person asked you to decide: choose what you would recommend, and say in a line what you chose and why. When the means they asked for works against their goal, or a clearly better way exists, say so in a line and take the way you would recommend.";
17
+ const plan = "Plan. Only when your path needs a map, and only after you understood the request, looked at what exists, and have your answers, and before you change anything: never in your first reply, because a map made before you looked is a guess. The map is the implementation plan the person reads and agrees to, so make it detailed, not an outline; the `execution-map` entry below says how to set it, detail its steps, and keep it true. Choose for each step whoever does it best and fastest: yourself, with a connector, for an ordinary or small change, or a worker of the `delegate` connector whose description fits when the step needs that skill.";
18
+ const confirmAsking = 'Confirm the plan. The person agrees to the map before you work on it. Once the first map of the request, or a map you set again with a change to what the person gets (the goal, what done looks like, what stays as it is, stored data, or what could go wrong), has details on every step (its undetailed list is empty), and before you start any step, call `ask choice` with other set to true. Its question first says in a few lines what you understood: the goal, what done looks like, what stays as it is, and the choices you made for the person; then it asks whether to start, with the option that starts first and an option that changes the plan, so the person can write what to change. When they ask for changes, set the map again with them, detail what changed, and ask again; start only after they chose to start. A change inside the plan, such as who does a step, the order, a step split or retried, or a worker reassigned, needs no confirmation: set the map and say what changed in one line. Never ask the person to confirm a choice they have just made. A change of status with `execution-map update` needs no confirmation.';
19
+ const confirmDeciding = 'Confirm the plan. Once every step of the map has details, say in a few lines what you understood (the goal, what done looks like, what stays as it is, and the choices you made for the person) and start: the person asked you to decide, so don\'t wait for an answer.';
20
+ const execute = "Execute. With a map, work through it as its entry says, so it always shows where you are: take the steps it returns as ready, mark each doing in the reply that makes its first call, hand a step whose uses names a worker to that worker with `delegate run` and check its answer, and mark the step done with your evidence as soon as its check passed. For each step, or with no map for all of what was asked, make the smallest change that does it, check it, and fix a failure at its cause. A step is not done because you wrote it.";
21
+ const leadMethodOf = (decides) => {
22
+ const clarify = decides ? clarifyDeciding : clarifyAsking;
23
+ const confirm = decides ? confirmDeciding : confirmAsking;
24
+ return [
25
+ 'How you work. You are the one who decides: connectors and workers are how you act, and the result is yours. No path is fixed: you choose it for each task from what the task is, and you change it when what you find changes it.',
26
+ together,
27
+ narrate,
28
+ 'Size up the task first. Read the request and look at what it touches, then judge four things: how clear it is (can you say what done looks like?), how much it changes (one place, or several parts that depend on each other), what could go wrong and how hard that is to take back, and whether the person will look at the result (a screen, a page, a report). From that, choose the lightest path that delivers the task well. A question needs an answer from what you read, and no change. A small, clear change needs doing and checking, and nothing more. An unclear request needs its questions answered before any work. Work that changes several parts that depend on each other, or that is hard to take back, needs an execution map the person agreed to; other work, even of a few steps, needs no map: do it, and say where you are as you go. Separate parts may need workers, and a result the person looks at needs showing. A task that turns out larger than it looked gets its map then, and one that turns out simple drops what it does not need.',
29
+ 'These are the parts of a path. Use only the ones your path has.',
30
+ "Understand. Before you decide anything, find out what the person is trying to achieve, as far as the task needs. Read everything they sent, attached images and files too, then look at what exists: the files, config, tests, and data the request touches, the project's rules, and what already does part of it, so you build on it and not beside it. Work out what the person needs, not only what they typed: answer for yourself what outcome they want and what they will do with it; what done looks like to them, as examples they would check (an exact name, a screen, an output); what the work changes or must keep working (other callers, stored data, settings, users); whether they asked for a goal or for a particular means (a format, a library, a design), and whether that means serves the goal; what they didn't say that changes the result (who uses it, how much data or load, which platforms and languages, privacy and security, and how good is good enough); and which of your connectors and workers help, and what is missing. Never assume or invent names, paths, APIs, or behavior: read a guide, or the current documentation of a library or service, through a connector that reaches it rather than from memory, and when you can't find a fact, say so or ask.",
31
+ clarify,
32
+ plan,
33
+ confirm,
34
+ execute,
35
+ 'Stay on the task. Do what was asked and nothing else. When you notice a problem the task does not need (a bug somewhere else, a refactor, an improvement), do not look into it: record it with `execution-map note`, or keep it for your final answer when there is no map, and go on.',
36
+ "Delegate. A step goes to a worker of the `delegate` connector when the worker does it better or faster than you would: a specialist whose skill the step needs, separate work that runs beside yours, or a fresh review of a change you finished; its entry lists the workers and what each is for. Don't delegate what a few calls of your own would do, and ask for one review of a piece of work, not several. Several `delegate run` calls in one reply run in parallel. Brief the worker with the goal, the facts it needs, its limits, and what to return. A worker sees none of this conversation and reads again every file it needs, so put in the brief the paths, the exact lines it needs quoted when they are short, and what you already found, so it doesn't read again what you hold. Read what a worker returns and check it before you rely on it: its work is your responsibility. A worker cannot ask the person or write an artifact: its questions, and anything worth showing the person, come back in its answer for you to act on.",
37
+ 'Show what the person will look at. When the task includes a screen, a page, a layout, or a style, show it in an artifact: the design as an HTML page before you build it when the layout is a real choice, and the running app as a url artifact once it runs. Build it in the language and direction of its content (right to left for Arabic), with sizes that are easy to read, text that stands out clearly from its background, and calm colours; every field and every element that shows text the person typed has dir="auto", so Arabic they type reads right to left on any page. Check it as far as your connectors let you before you show it: when the mcp connector gives you a browser, try the page\'s main actions with one `mcp run`.',
38
+ "Finish. The work is done when it is ready for production: it does what was asked, it handles the errors and edge cases that will happen, it follows the project's conventions, its checks and tests pass, and nothing unfinished or temporary is left behind. Stop what you started in the background and no longer need, and delete the temporary files you or your tools left in the workspace folder, such as logs, snapshots, and scratch files. Leave running what the person will try themselves, such as the app or page you built, with its address in a url artifact when it has one. When you found how this project is built, tested, or run and its AGENTS.md does not say it, add a short Commands section to AGENTS.md with risky set to true: that asks the person, so don't ask them a second time with `ask`. Your final answer, in plain words and as short as the facts allow, says what was done, what you checked and what it showed, what is unchecked, what still runs in the background, and what you noted for later.",
39
+ evidence,
40
+ simplest,
41
+ context,
42
+ artifacts,
43
+ ...(decides ? [] : [asking]),
44
+ checked,
45
+ keepGoing,
46
+ callOrFinalAnswer,
47
+ ].join('\n');
48
+ };
35
49
  const generalSimplest = "Use the simplest way that does what was asked, and don't add what wasn't asked.";
36
- const generalLeadMethod = [
37
- "How you work. Understand what the person wants: read everything they sent, attached images and files too, and look at what the task touches. When something only they can decide is unclear, ask it in one round with `ask`: one question per call, all the calls in one reply, and `ask choice` whenever you offer options, your recommended one first. Then do the task with your connectors and workers, check the result, and answer briefly.",
38
- evidence,
39
- generalSimplest,
40
- together,
41
- context,
42
- artifacts,
43
- asking,
44
- checked,
45
- short,
46
- callOrFinalAnswer,
47
- ].join('\n');
50
+ const generalUnderstand = "How you work. Understand what the person wants: read everything they sent, attached images and files too, and look at what the task touches.";
51
+ const generalAsking = "When something only they can decide is unclear, ask it in one round with `ask`: one question per call, all the calls in the same reply and never one question per reply, and `ask choice` whenever you offer options, your recommended one first. Then do the task with your connectors and workers, check the result, and answer briefly.";
52
+ const generalDeciding = 'When something only they could decide is unclear, decide it yourself, the choice you would recommend, and say in a line what you chose. Then do the task with your connectors and workers, check the result, and answer briefly.';
53
+ const generalLeadMethodOf = (decides) => [`${generalUnderstand} ${decides ? generalDeciding : generalAsking}`, together, narrate, evidence, generalSimplest, context, artifacts, ...(decides ? [] : [asking]), checked, keepGoing, callOrFinalAnswer].join('\n');
48
54
  const workerStart = [
49
55
  "How you work. Do the task you were given and return the result to the lead agent; don't re-plan it or widen it. You don't talk to the person: the lead does. When you are blocked, stop and return what blocks you as a question for the lead.",
50
56
  "1. Understand. Read the task, then the files, config, and tests it touches. Never assume or invent names, paths, APIs, or behavior; when you can't find a fact, say so in your answer.",
@@ -52,7 +58,7 @@ const workerStart = [
52
58
  const engineeringDoIt = "2. Do it. Make the smallest change that does the task, check it with the project's own check or tests, and fix a failure at its cause. Write each file in its own call, with `fs write`.";
53
59
  const generalDoIt = '2. Do it. Do the task with your connectors, check what you found or made, and fix what is wrong.';
54
60
  const workerReturn = '3. Return. Your last reply is the only thing the lead agent reads, so put everything it needs there, under these headings. Result: what you did or found. Evidence: what you ran or read that shows it, with paths and lines. Files changed: each path and what changed, or none. Unchecked: what you could not verify or left undone. Questions: what the lead must decide or ask the person, or none. Keep it as short as the facts allow.';
55
- const workerMethodOf = (doIt, simplestRule) => [...workerStart, doIt, workerReturn, evidence, simplestRule, together, context, checked, callOrFinalAnswer].join('\n');
61
+ const workerMethodOf = (doIt, simplestRule) => [workerStart[0], together, workerStart[1], doIt, workerReturn, evidence, simplestRule, context, checked, keepGoing, callOrFinalAnswer].join('\n');
56
62
  const workerMethod = workerMethodOf(engineeringDoIt, simplest);
57
63
  const generalWorkerMethod = workerMethodOf(generalDoIt, generalSimplest);
58
64
  /** The first line of the prompt: who the agent is, and where it works; a product's profile names who the agent is instead (ADR 0082, 11). */
@@ -63,10 +69,10 @@ export function identityLine(role, place, identity) {
63
69
  return `You are kvman Coder, the lead engineer on this work: a software engineer with long, deep experience who owns the outcome. You understand the request, decide, plan, and execute it, ${place}.`;
64
70
  return `You are kvman Coder, working on one task that the lead agent gave you, ${place}: a software engineer with long, deep experience.`;
65
71
  }
66
- /** The "How you work" block of a role, for the profile's method. */
67
- export function workingMethod(role, method = 'engineering') {
72
+ /** The "How you work" block of a role, for the profile's method; a lead set to "Decide for me" decides where it would ask. */
73
+ export function workingMethod(role, method = 'engineering', decides = false) {
68
74
  if (method === 'engineering')
69
- return role === 'lead' ? leadMethod : workerMethod;
70
- return role === 'lead' ? generalLeadMethod : generalWorkerMethod;
75
+ return role === 'lead' ? leadMethodOf(decides) : workerMethod;
76
+ return role === 'lead' ? generalLeadMethodOf(decides) : generalWorkerMethod;
71
77
  }
72
78
  //# sourceMappingURL=working-method.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"working-method.js","sourceRoot":"","sources":["../../src/prompt/working-method.ts"],"names":[],"mappings":"AAAA,wLAAwL;AACxL,2IAA2I;AAQ3I,MAAM,QAAQ,GAAG,2KAA2K,CAAC;AAC7L,MAAM,QAAQ,GAAG,qLAAqL,CAAC;AACvM,MAAM,QAAQ,GAAG,kZAAkZ,CAAC;AAC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E,OAAO,uLAAuL,KAAK,GAAG,CAAC;IAC5N,OAAO,0EAA0E,KAAK,mDAAmD,CAAC;AAC5I,CAAC;AAED,8HAA8H;AAC9H,MAAM,UAAU,aAAa,CAAC,IAAU,EAAE,SAAiB,aAAa,EAAE,OAAO,GAAG,KAAK;IACvF,IAAI,MAAM,KAAK,aAAa;QAAE,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAC5F,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAC9E,CAAC"}
@@ -7,6 +7,8 @@ export declare const settingSchemas: {
7
7
  low: "low";
8
8
  medium: "medium";
9
9
  high: "high";
10
+ xhigh: "xhigh";
11
+ max: "max";
10
12
  }>;
11
13
  maxSteps: z.ZodNullable<z.ZodNumber>;
12
14
  approval: z.ZodEnum<{
@@ -14,6 +16,18 @@ export declare const settingSchemas: {
14
16
  never: "never";
15
17
  auto: "auto";
16
18
  }>;
19
+ allowed: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
20
+ kind: z.ZodLiteral<"line">;
21
+ prefix: z.ZodString;
22
+ }, z.core.$strict>, z.ZodObject<{
23
+ kind: z.ZodLiteral<"files">;
24
+ }, z.core.$strict>], "kind">>;
25
+ check: z.ZodNullable<z.ZodObject<{
26
+ line: z.ZodString;
27
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
28
+ }, z.core.$strict>>;
29
+ fallbackModel: z.ZodNullable<z.ZodString>;
30
+ preferences: z.ZodString;
17
31
  shellPath: z.ZodNullable<z.ZodString>;
18
32
  compactAt: z.ZodNumber;
19
33
  compactKeep: z.ZodNumber;
@@ -50,6 +64,8 @@ export declare const settingSchemas: {
50
64
  low: "low";
51
65
  medium: "medium";
52
66
  high: "high";
67
+ xhigh: "xhigh";
68
+ max: "max";
53
69
  }>>;
54
70
  name: z.ZodString;
55
71
  description: z.ZodString;
@@ -141,6 +157,17 @@ export declare function disabledConnectors(ctx: Ctx): Promise<Set<string>>;
141
157
  export declare function readSettings(ctx: Ctx): Promise<{
142
158
  maxSteps: number | null;
143
159
  approval: "ask" | "never" | "auto";
160
+ allowed: ({
161
+ kind: "line";
162
+ prefix: string;
163
+ } | {
164
+ kind: "files";
165
+ })[];
166
+ check: {
167
+ line: string;
168
+ timeoutMs: number;
169
+ } | null;
170
+ fallbackModel: string | null;
144
171
  shellPath: string | null;
145
172
  compactAt: number;
146
173
  compactKeep: number;
@@ -1 +1 @@
1
- {"version":3,"file":"register-settings.d.ts","sourceRoot":"","sources":["../src/register-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAezC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAc1B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAe/C;AAED,kFAAkF;AAClF,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAA;CAAE,CAAC,CAG9G;AAED,oJAAoJ;AACpJ,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAIvE;AAED,yCAAyC;AACzC,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG;;;;;;;;;;;;;;;GAU1C;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"register-settings.d.ts","sourceRoot":"","sources":["../src/register-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAiBzC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkB1B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAmB/C;AAED,kFAAkF;AAClF,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAA;CAAE,CAAC,CAG9G;AAED,oJAAoJ;AACpJ,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAIvE;AAED,yCAAyC;AACzC,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GAa1C;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC"}
@@ -3,6 +3,8 @@ import { shippedWorkers, workersSchema } from "./delegate/workers.js";
3
3
  import { mcpServersSchema } from "./mcp/servers.js";
4
4
  import { thinkingSchema } from "./schemas/records.js";
5
5
  import { binaryConnectorSchema, wordSchema } from "./schemas/registry.js";
6
+ import { approvalRuleSchema } from "./schemas/approval-rule.js";
7
+ import { checkSchema } from "./schemas/check.js";
6
8
  /** A preset's agent profile (ADR 0082, 11): who the agent is, how it works, and the Chat page's words, as translation keys. */
7
9
  const profileSchema = z.strictObject({
8
10
  identity: z.string().min(1).max(4000).exactOptional(),
@@ -16,6 +18,10 @@ export const settingSchemas = {
16
18
  thinking: thinkingSchema,
17
19
  maxSteps: z.number().int().positive().nullable(),
18
20
  approval: z.enum(['ask', 'auto', 'never']),
21
+ allowed: z.array(approvalRuleSchema).max(200),
22
+ check: checkSchema,
23
+ fallbackModel: z.string().min(1).nullable(),
24
+ preferences: z.string().refine((text) => Buffer.byteLength(text, 'utf8') <= 16_384, 'The preferences hold at most 16 KB.'),
19
25
  shellPath: z.string().min(1).nullable(),
20
26
  compactAt: z.number().gt(0).max(1),
21
27
  compactKeep: z.number().int().min(1).max(100),
@@ -32,6 +38,10 @@ export function registerSettings(ctx) {
32
38
  ctx.registerSetting('kvcoder.thinking', { description: 'How hard the model thinks in a new session.', schema: settingSchemas.thinking, default: 'medium' });
33
39
  ctx.registerSetting('kvcoder.maxSteps', { description: 'The most steps a turn takes before it stops; null sets no limit.', schema: settingSchemas.maxSteps, default: null });
34
40
  ctx.registerSetting('kvcoder.approval', { description: 'When a call asks the person first: only the ones the model marks risky (auto), every one that can ask (ask), or none at all (never).', schema: settingSchemas.approval, default: 'auto' });
41
+ ctx.registerSetting('kvcoder.approval.allowed', { description: 'The approval rules: a line whose every command starts with one of these prefixes, or a file change, runs without asking.', schema: settingSchemas.allowed, default: [] });
42
+ ctx.registerSetting('kvcoder.preferences', { description: "The person's standing preferences, sent in every chat's prompt.", schema: settingSchemas.preferences, default: '' });
43
+ ctx.registerSetting('kvcoder.check', { description: 'A line run after a reply that changed files, such as the project\'s type check; its exit code and output end the change\'s result.', schema: settingSchemas.check, default: null });
44
+ ctx.registerSetting('kvcoder.fallbackModel', { description: 'The model a chat moves to when its model reaches a usage limit, or a rate limit after all tries; null for none.', schema: settingSchemas.fallbackModel, default: null });
35
45
  ctx.registerSetting('kvcoder.shell.path', { description: 'The shell program to run; null finds bash, or pwsh then powershell.exe on Windows.', schema: settingSchemas.shellPath, default: null });
36
46
  ctx.registerSetting('kvcoder.compactAt', { description: "The share of the model's context window above which older messages are summarized.", schema: settingSchemas.compactAt, default: 0.6 });
37
47
  ctx.registerSetting('kvcoder.compactKeep', { description: 'How many of the newest messages stay whole when older messages are summarized.', schema: settingSchemas.compactKeep, default: 10 });
@@ -60,6 +70,9 @@ export async function readSettings(ctx) {
60
70
  return {
61
71
  maxSteps: await read('kvcoder.maxSteps', settingSchemas.maxSteps),
62
72
  approval: await read('kvcoder.approval', settingSchemas.approval),
73
+ allowed: await read('kvcoder.approval.allowed', settingSchemas.allowed),
74
+ check: await read('kvcoder.check', settingSchemas.check),
75
+ fallbackModel: await read('kvcoder.fallbackModel', settingSchemas.fallbackModel),
63
76
  shellPath: await read('kvcoder.shell.path', settingSchemas.shellPath),
64
77
  compactAt: await read('kvcoder.compactAt', settingSchemas.compactAt),
65
78
  compactKeep: await read('kvcoder.compactKeep', settingSchemas.compactKeep),
@@ -1 +1 @@
1
- {"version":3,"file":"register-settings.js","sourceRoot":"","sources":["../src/register-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAE1E,+HAA+H;AAC/H,MAAM,aAAa,GAAG,CAAC,CAAC,YAAY,CAAC;IACnC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE;IACrD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC,aAAa,EAAE;IAC1D,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,G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IAAI,CAAC,0BAA0B,EAAE,cAAc,CAAC,OAAO,CAAC;QACvE,KAAK,EAAE,MAAM,IAAI,CAAC,eAAe,EAAE,cAAc,CAAC,KAAK,CAAC;QACxD,aAAa,EAAE,MAAM,IAAI,CAAC,uBAAuB,EAAE,cAAc,CAAC,aAAa,CAAC;QAChF,SAAS,EAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,SAAS,CAAC;QACrE,SAAS,EAAE,MAAM,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,SAAS,CAAC;QACpE,WAAW,EAAE,MAAM,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,WAAW,CAAC;QAC1E,UAAU,EAAE,MAAM,IAAI,CAAC,oBAAoB,EAAE,cAAc,CAAC,UAAU,CAAC;KACxE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { z } from '@kvman/sdk';
2
+ export declare const approvalRuleSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ kind: z.ZodLiteral<"line">;
4
+ prefix: z.ZodString;
5
+ }, z.core.$strict>, z.ZodObject<{
6
+ kind: z.ZodLiteral<"files">;
7
+ }, z.core.$strict>], "kind">;
8
+ export type ApprovalRule = z.output<typeof approvalRuleSchema>;
9
+ //# sourceMappingURL=approval-rule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-rule.d.ts","sourceRoot":"","sources":["../../src/schemas/approval-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAI/B,eAAO,MAAM,kBAAkB;;;;;4BAG7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { z } from '@kvman/sdk';
2
+ // One of the person's approval rules (plan 08 §8.3, ADR 0091, 1): the start of a line, or file changes.
3
+ export const approvalRuleSchema = z.discriminatedUnion('kind', [
4
+ z.strictObject({ kind: z.literal('line'), prefix: z.string().trim().min(1).max(200).describe('The start of a line that runs without asking, as `pnpm exec`.') }),
5
+ z.strictObject({ kind: z.literal('files') }),
6
+ ]);
7
+ //# sourceMappingURL=approval-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-rule.js","sourceRoot":"","sources":["../../src/schemas/approval-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,wGAAwG;AAExG,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7D,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,+DAA+D,CAAC,EAAE,CAAC;IAChK,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;CAC7C,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { z } from '@kvman/sdk';
2
+ export declare const checkSchema: z.ZodNullable<z.ZodObject<{
3
+ line: z.ZodString;
4
+ timeoutMs: z.ZodDefault<z.ZodNumber>;
5
+ }, z.core.$strict>>;
6
+ export type Check = z.output<typeof checkSchema>;
7
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/schemas/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAI/B,eAAO,MAAM,WAAW;;;mBAKX,CAAC;AAEd,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { z } from '@kvman/sdk';
2
+ // The person's check after file changes (plan 08 §8.3, ADR 0094, 3): a line, and how long it may run.
3
+ export const checkSchema = z
4
+ .strictObject({
5
+ line: z.string().trim().min(1).max(2000).describe('The line to run, as the project checks itself, such as pnpm typecheck.'),
6
+ timeoutMs: z.number().int().min(1000).max(600_000).default(60_000).describe('How long the check may run, in milliseconds.'),
7
+ })
8
+ .nullable();
9
+ //# sourceMappingURL=check.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/schemas/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,sGAAsG;AAEtG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC;KACzB,YAAY,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,wEAAwE,CAAC;IAC3H,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CAC5H,CAAC;KACD,QAAQ,EAAE,CAAC"}