@kindgi/cli 0.1.10 → 0.2.0-rc.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 (347) hide show
  1. package/README.md +78 -32
  2. package/dist/build/containerfile.d.ts +2 -0
  3. package/dist/build/containerfile.d.ts.map +1 -1
  4. package/dist/build/containerfile.js +14 -3
  5. package/dist/build/containerfile.js.map +1 -1
  6. package/dist/build/defaults.d.ts +2 -0
  7. package/dist/build/defaults.d.ts.map +1 -1
  8. package/dist/build/defaults.js +8 -0
  9. package/dist/build/defaults.js.map +1 -1
  10. package/dist/build/hosted.d.ts +2 -9
  11. package/dist/build/hosted.d.ts.map +1 -1
  12. package/dist/build/hosted.js +4 -2
  13. package/dist/build/hosted.js.map +1 -1
  14. package/dist/build/pack-blocks.d.ts +51 -0
  15. package/dist/build/pack-blocks.d.ts.map +1 -0
  16. package/dist/build/pack-blocks.js +98 -0
  17. package/dist/build/pack-blocks.js.map +1 -0
  18. package/dist/build/runners.d.ts +5 -1
  19. package/dist/build/runners.d.ts.map +1 -1
  20. package/dist/cli.js +4 -0
  21. package/dist/cli.js.map +1 -1
  22. package/dist/commands/adapters.d.ts.map +1 -1
  23. package/dist/commands/adapters.js +12 -6
  24. package/dist/commands/adapters.js.map +1 -1
  25. package/dist/commands/agents.js +8 -8
  26. package/dist/commands/agents.js.map +1 -1
  27. package/dist/commands/auth.d.ts.map +1 -1
  28. package/dist/commands/auth.js +159 -34
  29. package/dist/commands/auth.js.map +1 -1
  30. package/dist/commands/blocks.d.ts.map +1 -1
  31. package/dist/commands/blocks.js +1 -1
  32. package/dist/commands/blocks.js.map +1 -1
  33. package/dist/commands/build.d.ts +17 -6
  34. package/dist/commands/build.d.ts.map +1 -1
  35. package/dist/commands/build.js +136 -89
  36. package/dist/commands/build.js.map +1 -1
  37. package/dist/commands/connection-apps.d.ts +3 -0
  38. package/dist/commands/connection-apps.d.ts.map +1 -0
  39. package/dist/commands/connection-apps.js +239 -0
  40. package/dist/commands/connection-apps.js.map +1 -0
  41. package/dist/commands/connections.d.ts +44 -0
  42. package/dist/commands/connections.d.ts.map +1 -0
  43. package/dist/commands/connections.js +385 -0
  44. package/dist/commands/connections.js.map +1 -0
  45. package/dist/commands/conversations.js +1 -1
  46. package/dist/commands/conversations.js.map +1 -1
  47. package/dist/commands/deploy.d.ts.map +1 -1
  48. package/dist/commands/deploy.js +178 -97
  49. package/dist/commands/deploy.js.map +1 -1
  50. package/dist/commands/dev.d.ts +10 -0
  51. package/dist/commands/dev.d.ts.map +1 -1
  52. package/dist/commands/dev.js +177 -87
  53. package/dist/commands/dev.js.map +1 -1
  54. package/dist/commands/doctor.d.ts.map +1 -1
  55. package/dist/commands/doctor.js +8 -4
  56. package/dist/commands/doctor.js.map +1 -1
  57. package/dist/commands/env-scoped.d.ts.map +1 -1
  58. package/dist/commands/env-scoped.js +37 -22
  59. package/dist/commands/env-scoped.js.map +1 -1
  60. package/dist/commands/env.d.ts.map +1 -1
  61. package/dist/commands/env.js +35 -22
  62. package/dist/commands/env.js.map +1 -1
  63. package/dist/commands/eval-runs.js +6 -6
  64. package/dist/commands/eval-runs.js.map +1 -1
  65. package/dist/commands/eval-suites.js +9 -9
  66. package/dist/commands/eval-suites.js.map +1 -1
  67. package/dist/commands/exports.d.ts.map +1 -1
  68. package/dist/commands/exports.js +35 -9
  69. package/dist/commands/exports.js.map +1 -1
  70. package/dist/commands/feedback.d.ts.map +1 -1
  71. package/dist/commands/feedback.js +4 -3
  72. package/dist/commands/feedback.js.map +1 -1
  73. package/dist/commands/gate-policies.d.ts.map +1 -1
  74. package/dist/commands/gate-policies.js +7 -7
  75. package/dist/commands/gate-policies.js.map +1 -1
  76. package/dist/commands/helpers.d.ts +9 -0
  77. package/dist/commands/helpers.d.ts.map +1 -1
  78. package/dist/commands/helpers.js +20 -0
  79. package/dist/commands/helpers.js.map +1 -1
  80. package/dist/commands/index.d.ts.map +1 -1
  81. package/dist/commands/index.js +8 -0
  82. package/dist/commands/index.js.map +1 -1
  83. package/dist/commands/init.d.ts +1 -1
  84. package/dist/commands/init.d.ts.map +1 -1
  85. package/dist/commands/init.js +57 -45
  86. package/dist/commands/init.js.map +1 -1
  87. package/dist/commands/judge-classes.js +4 -4
  88. package/dist/commands/judge-classes.js.map +1 -1
  89. package/dist/commands/judging-queue.d.ts +3 -0
  90. package/dist/commands/judging-queue.d.ts.map +1 -0
  91. package/dist/commands/judging-queue.js +105 -0
  92. package/dist/commands/judging-queue.js.map +1 -0
  93. package/dist/commands/judging-rules.d.ts +3 -0
  94. package/dist/commands/judging-rules.d.ts.map +1 -0
  95. package/dist/commands/judging-rules.js +351 -0
  96. package/dist/commands/judging-rules.js.map +1 -0
  97. package/dist/commands/judgments.d.ts.map +1 -1
  98. package/dist/commands/judgments.js +78 -36
  99. package/dist/commands/judgments.js.map +1 -1
  100. package/dist/commands/key.d.ts.map +1 -1
  101. package/dist/commands/key.js +107 -9
  102. package/dist/commands/key.js.map +1 -1
  103. package/dist/commands/license.d.ts.map +1 -1
  104. package/dist/commands/license.js +80 -23
  105. package/dist/commands/license.js.map +1 -1
  106. package/dist/commands/mcp.d.ts.map +1 -1
  107. package/dist/commands/mcp.js +4 -4
  108. package/dist/commands/mcp.js.map +1 -1
  109. package/dist/commands/people.js +8 -14
  110. package/dist/commands/people.js.map +1 -1
  111. package/dist/commands/promote.js +1 -1
  112. package/dist/commands/promote.js.map +1 -1
  113. package/dist/commands/proposals.d.ts.map +1 -1
  114. package/dist/commands/proposals.js +83 -30
  115. package/dist/commands/proposals.js.map +1 -1
  116. package/dist/commands/run-waits.d.ts +68 -19
  117. package/dist/commands/run-waits.d.ts.map +1 -1
  118. package/dist/commands/run-waits.js +82 -8
  119. package/dist/commands/run-waits.js.map +1 -1
  120. package/dist/commands/runs.d.ts.map +1 -1
  121. package/dist/commands/runs.js +70 -30
  122. package/dist/commands/runs.js.map +1 -1
  123. package/dist/commands/schedules.d.ts.map +1 -1
  124. package/dist/commands/schedules.js +35 -12
  125. package/dist/commands/schedules.js.map +1 -1
  126. package/dist/commands/secrets-copy.d.ts.map +1 -1
  127. package/dist/commands/secrets-copy.js +20 -12
  128. package/dist/commands/secrets-copy.js.map +1 -1
  129. package/dist/commands/secrets.d.ts.map +1 -1
  130. package/dist/commands/secrets.js +13 -8
  131. package/dist/commands/secrets.js.map +1 -1
  132. package/dist/commands/sign-in.js +2 -2
  133. package/dist/commands/sign-in.js.map +1 -1
  134. package/dist/commands/sites.d.ts.map +1 -1
  135. package/dist/commands/sites.js +13 -6
  136. package/dist/commands/sites.js.map +1 -1
  137. package/dist/commands/skills.d.ts +54 -3
  138. package/dist/commands/skills.d.ts.map +1 -1
  139. package/dist/commands/skills.js +169 -38
  140. package/dist/commands/skills.js.map +1 -1
  141. package/dist/commands/tokens.d.ts.map +1 -1
  142. package/dist/commands/tokens.js +9 -1
  143. package/dist/commands/tokens.js.map +1 -1
  144. package/dist/commands/upgrade.d.ts.map +1 -1
  145. package/dist/commands/upgrade.js +9 -8
  146. package/dist/commands/upgrade.js.map +1 -1
  147. package/dist/commands/webhooks.d.ts.map +1 -1
  148. package/dist/commands/webhooks.js +62 -24
  149. package/dist/commands/webhooks.js.map +1 -1
  150. package/dist/config.d.ts +6 -0
  151. package/dist/config.d.ts.map +1 -1
  152. package/dist/config.js +18 -3
  153. package/dist/config.js.map +1 -1
  154. package/dist/context.d.ts +12 -0
  155. package/dist/context.d.ts.map +1 -1
  156. package/dist/context.js +2 -0
  157. package/dist/context.js.map +1 -1
  158. package/dist/deploy/pack-blocks-gate.d.ts +12 -0
  159. package/dist/deploy/pack-blocks-gate.d.ts.map +1 -0
  160. package/dist/deploy/pack-blocks-gate.js +34 -0
  161. package/dist/deploy/pack-blocks-gate.js.map +1 -0
  162. package/dist/deploy/post.d.ts +9 -0
  163. package/dist/deploy/post.d.ts.map +1 -1
  164. package/dist/deploy/post.js +20 -3
  165. package/dist/deploy/post.js.map +1 -1
  166. package/dist/dev/defaults.d.ts.map +1 -1
  167. package/dist/dev/defaults.js +8 -1
  168. package/dist/dev/defaults.js.map +1 -1
  169. package/dist/dev/dev-only-imports.d.ts +7 -4
  170. package/dist/dev/dev-only-imports.d.ts.map +1 -1
  171. package/dist/dev/dev-only-imports.js +5 -5
  172. package/dist/dev/dev-only-imports.js.map +1 -1
  173. package/dist/dev/log-view.d.ts +4 -4
  174. package/dist/dev/log-view.d.ts.map +1 -1
  175. package/dist/dev/log-view.js +4 -4
  176. package/dist/dev/log-view.js.map +1 -1
  177. package/dist/dev/pack-service.d.ts +7 -1
  178. package/dist/dev/pack-service.d.ts.map +1 -1
  179. package/dist/dev/pack-service.js +36 -3
  180. package/dist/dev/pack-service.js.map +1 -1
  181. package/dist/dev/preview-expiry.d.ts +6 -7
  182. package/dist/dev/preview-expiry.d.ts.map +1 -1
  183. package/dist/dev/preview-expiry.js +7 -8
  184. package/dist/dev/preview-expiry.js.map +1 -1
  185. package/dist/dev/providers.d.ts +2 -1
  186. package/dist/dev/providers.d.ts.map +1 -1
  187. package/dist/dev/providers.js +28 -12
  188. package/dist/dev/providers.js.map +1 -1
  189. package/dist/dev/runners.d.ts +19 -0
  190. package/dist/dev/runners.d.ts.map +1 -1
  191. package/dist/dev/runtime-container.js +2 -3
  192. package/dist/dev/runtime-container.js.map +1 -1
  193. package/dist/dev/runtime-env.d.ts +2 -1
  194. package/dist/dev/runtime-env.d.ts.map +1 -1
  195. package/dist/dev/runtime-env.js +5 -5
  196. package/dist/dev/runtime-env.js.map +1 -1
  197. package/dist/dev/runtime-image.d.ts +14 -4
  198. package/dist/dev/runtime-image.d.ts.map +1 -1
  199. package/dist/dev/runtime-image.js +16 -4
  200. package/dist/dev/runtime-image.js.map +1 -1
  201. package/dist/dev/runtime-registry.d.ts +10 -2
  202. package/dist/dev/runtime-registry.d.ts.map +1 -1
  203. package/dist/dev/runtime-registry.js +30 -6
  204. package/dist/dev/runtime-registry.js.map +1 -1
  205. package/dist/dev/sandbox/index.js +1 -1
  206. package/dist/dev/sandbox/notices.d.ts +2 -0
  207. package/dist/dev/sandbox/notices.d.ts.map +1 -1
  208. package/dist/dev/sandbox/notices.js +5 -2
  209. package/dist/dev/sandbox/notices.js.map +1 -1
  210. package/dist/env/defaults.d.ts.map +1 -1
  211. package/dist/env/defaults.js +3 -1
  212. package/dist/env/defaults.js.map +1 -1
  213. package/dist/env/pack-env-plan.d.ts +4 -0
  214. package/dist/env/pack-env-plan.d.ts.map +1 -1
  215. package/dist/env/pack-env-plan.js +8 -2
  216. package/dist/env/pack-env-plan.js.map +1 -1
  217. package/dist/exports/create.d.ts +2 -0
  218. package/dist/exports/create.d.ts.map +1 -1
  219. package/dist/exports/create.js +10 -2
  220. package/dist/exports/create.js.map +1 -1
  221. package/dist/exports/plan.d.ts.map +1 -1
  222. package/dist/exports/plan.js +20 -0
  223. package/dist/exports/plan.js.map +1 -1
  224. package/dist/feedback/store.d.ts.map +1 -1
  225. package/dist/feedback/store.js +8 -19
  226. package/dist/feedback/store.js.map +1 -1
  227. package/dist/help.d.ts +6 -0
  228. package/dist/help.d.ts.map +1 -1
  229. package/dist/help.js +35 -1
  230. package/dist/help.js.map +1 -1
  231. package/dist/init/agent-access.d.ts +3 -2
  232. package/dist/init/agent-access.d.ts.map +1 -1
  233. package/dist/init/agent-access.js +5 -1
  234. package/dist/init/agent-access.js.map +1 -1
  235. package/dist/init/augment-scaffolder.d.ts +7 -0
  236. package/dist/init/augment-scaffolder.d.ts.map +1 -1
  237. package/dist/init/augment-scaffolder.js +15 -14
  238. package/dist/init/augment-scaffolder.js.map +1 -1
  239. package/dist/init/dependency-specs.d.ts +1 -0
  240. package/dist/init/dependency-specs.d.ts.map +1 -1
  241. package/dist/init/dependency-specs.js +27 -7
  242. package/dist/init/dependency-specs.js.map +1 -1
  243. package/dist/init/java-augment.d.ts +3 -0
  244. package/dist/init/java-augment.d.ts.map +1 -1
  245. package/dist/init/java-augment.js +16 -15
  246. package/dist/init/java-augment.js.map +1 -1
  247. package/dist/init/python-augment.d.ts +3 -0
  248. package/dist/init/python-augment.d.ts.map +1 -1
  249. package/dist/init/python-augment.js +15 -14
  250. package/dist/init/python-augment.js.map +1 -1
  251. package/dist/init/scala-augment.d.ts +8 -1
  252. package/dist/init/scala-augment.d.ts.map +1 -1
  253. package/dist/init/scala-augment.js +32 -17
  254. package/dist/init/scala-augment.js.map +1 -1
  255. package/dist/key/defaults.d.ts.map +1 -1
  256. package/dist/key/defaults.js +6 -1
  257. package/dist/key/defaults.js.map +1 -1
  258. package/dist/key/runners.d.ts +4 -1
  259. package/dist/key/runners.d.ts.map +1 -1
  260. package/dist/license/protocol.d.ts +3 -2
  261. package/dist/license/protocol.d.ts.map +1 -1
  262. package/dist/license/protocol.js +3 -2
  263. package/dist/license/protocol.js.map +1 -1
  264. package/dist/license/renew.d.ts +6 -0
  265. package/dist/license/renew.d.ts.map +1 -1
  266. package/dist/license/renew.js +9 -6
  267. package/dist/license/renew.js.map +1 -1
  268. package/dist/main.d.ts +10 -0
  269. package/dist/main.d.ts.map +1 -1
  270. package/dist/main.js +19 -5
  271. package/dist/main.js.map +1 -1
  272. package/dist/output.d.ts +6 -0
  273. package/dist/output.d.ts.map +1 -1
  274. package/dist/output.js +8 -0
  275. package/dist/output.js.map +1 -1
  276. package/dist/parse.d.ts +1 -1
  277. package/dist/parse.d.ts.map +1 -1
  278. package/dist/parse.js +1 -1
  279. package/dist/parse.js.map +1 -1
  280. package/dist/private-file.d.ts +23 -0
  281. package/dist/private-file.d.ts.map +1 -0
  282. package/dist/private-file.js +65 -0
  283. package/dist/private-file.js.map +1 -0
  284. package/dist/progress-head.d.ts +13 -0
  285. package/dist/progress-head.d.ts.map +1 -0
  286. package/dist/progress-head.js +30 -0
  287. package/dist/progress-head.js.map +1 -0
  288. package/dist/progress-lines.d.ts +29 -0
  289. package/dist/progress-lines.d.ts.map +1 -0
  290. package/dist/progress-lines.js +35 -0
  291. package/dist/progress-lines.js.map +1 -0
  292. package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +6 -6
  293. package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
  294. package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +2 -2
  295. package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +1 -1
  296. package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +3 -3
  297. package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +39 -6
  298. package/dist/sdk-skills/kindgi-fix-corrections/SKILL.md +262 -0
  299. package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +1 -1
  300. package/dist/sdk-skills/kindgi-getting-started/SKILL.md +43 -9
  301. package/dist/sdk-skills/kindgi-java-authoring-agents/SKILL.md +5 -5
  302. package/dist/sdk-skills/kindgi-java-authoring-flows/SKILL.md +1 -1
  303. package/dist/sdk-skills/kindgi-java-authoring-guardrails/SKILL.md +1 -1
  304. package/dist/sdk-skills/kindgi-java-authoring-tools/SKILL.md +91 -9
  305. package/dist/sdk-skills/kindgi-java-getting-started/SKILL.md +38 -9
  306. package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +4 -4
  307. package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +1 -1
  308. package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +1 -1
  309. package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +43 -8
  310. package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +39 -11
  311. package/dist/sdk-skills/kindgi-scala-authoring-agents/SKILL.md +5 -5
  312. package/dist/sdk-skills/kindgi-scala-authoring-flows/SKILL.md +1 -1
  313. package/dist/sdk-skills/kindgi-scala-authoring-guardrails/SKILL.md +1 -1
  314. package/dist/sdk-skills/kindgi-scala-authoring-tools/SKILL.md +82 -7
  315. package/dist/sdk-skills/kindgi-scala-getting-started/SKILL.md +38 -9
  316. package/dist/sdk-skills/kindgi-using/SKILL.md +50 -21
  317. package/dist/templates/drupal/AGENTS.md +2 -1
  318. package/dist/templates/follow-up/.nvmrc +1 -0
  319. package/dist/templates/follow-up/AGENTS.md +83 -0
  320. package/dist/templates/follow-up/README.md.tmpl +111 -0
  321. package/dist/templates/follow-up/agents/follow-up/index.test.ts.tmpl +26 -0
  322. package/dist/templates/follow-up/agents/follow-up/index.ts.tmpl +53 -0
  323. package/dist/templates/follow-up/gitignore +8 -0
  324. package/dist/templates/follow-up/kindgi.config.ts.tmpl +45 -0
  325. package/dist/templates/follow-up/package.json.tmpl +30 -0
  326. package/dist/templates/follow-up/pnpm-workspace.yaml +9 -0
  327. package/dist/templates/follow-up/tools/gmail-send/index.test.ts.tmpl +60 -0
  328. package/dist/templates/follow-up/tools/gmail-send/index.ts.tmpl +14 -0
  329. package/dist/templates/follow-up/tsconfig.json.tmpl +27 -0
  330. package/dist/templates/follow-up/vitest.config.ts.tmpl +14 -0
  331. package/dist/templates/java/AGENTS.md +2 -1
  332. package/dist/templates/minimal/AGENTS.md +2 -1
  333. package/dist/templates/python/AGENTS.md +2 -1
  334. package/dist/templates/sample/AGENTS.md +2 -1
  335. package/dist/templates/scala/AGENTS.md +2 -1
  336. package/dist/templates/woocommerce/AGENTS.md +12 -3
  337. package/dist/templates/woocommerce/README.md.tmpl +29 -5
  338. package/dist/templates/woocommerce/agents/store-agent/index.test.ts.tmpl +38 -7
  339. package/dist/templates/woocommerce/agents/store-agent/index.ts.tmpl +7 -12
  340. package/dist/templates/woocommerce/blocks/store-agent-prompt.json.tmpl +10 -0
  341. package/dist/templates/woocommerce/blocks/store-agent-prompt.liquid.tmpl +7 -0
  342. package/dist/templates/woocommerce/kindgi.config.ts.tmpl +1 -0
  343. package/dist/value-target.d.ts +4 -2
  344. package/dist/value-target.d.ts.map +1 -1
  345. package/dist/value-target.js +8 -5
  346. package/dist/value-target.js.map +1 -1
  347. package/package.json +13 -13
@@ -0,0 +1,351 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // Copyright (C) 2026 Kindgi Inc.
3
+ import { UsageError } from '../errors.js';
4
+ import { integerFlag, listFlag, projectIdFlag, requiredPositional, runSdk, stringFlag, timeFlag, } from './helpers.js';
5
+ /** The run outcome `--status` matches; a rule takes `completed` only. */
6
+ const RUN_STATUSES = ['completed'];
7
+ const PROJECT_OPTION = {
8
+ project: {
9
+ type: 'string',
10
+ description: "The project the rule is in. Without it, the tenant's Default project.",
11
+ },
12
+ };
13
+ /** The flags that say which runs a rule matches, shared by create, update and preview. */
14
+ const WHEN_OPTIONS = {
15
+ agent: { type: 'string', multiple: true, description: 'Match runs of this agent (repeatable).' },
16
+ flow: { type: 'string', multiple: true, description: 'Match runs of this flow (repeatable).' },
17
+ 'agent-version': {
18
+ type: 'string',
19
+ multiple: true,
20
+ description: "Match runs of this agent version exactly, or `live` for runs that got the agent's live version (repeatable).",
21
+ },
22
+ status: {
23
+ type: 'string',
24
+ multiple: true,
25
+ description: 'Match runs by how they ended. Only `completed` is accepted — a correction needs a completed run, so `failed` and `cancelled` are refused.',
26
+ },
27
+ 'include-dry-runs': {
28
+ type: 'boolean',
29
+ description: 'Also match dry runs; off by default. Replays never match.',
30
+ },
31
+ };
32
+ /** The share `--sample`, a number greater than 0 and at most 1. */
33
+ function sampleFlag(ctx) {
34
+ const raw = stringFlag(ctx, 'sample');
35
+ if (raw === undefined)
36
+ return undefined;
37
+ const n = Number(raw);
38
+ if (!Number.isFinite(n) || n <= 0 || n > 1) {
39
+ throw new UsageError(`--sample must be a share greater than 0 and at most 1, got "${raw}"`);
40
+ }
41
+ return n;
42
+ }
43
+ /** Whether any match flag is given, so an `update` replaces the rule's `when` whole. */
44
+ function hasWhenFlags(ctx) {
45
+ return (listFlag(ctx, 'agent').length > 0 ||
46
+ listFlag(ctx, 'flow').length > 0 ||
47
+ listFlag(ctx, 'agent-version').length > 0 ||
48
+ listFlag(ctx, 'status').length > 0 ||
49
+ ctx.options['include-dry-runs'] === true);
50
+ }
51
+ /** The `when` a rule matches, built from the match flags. Absent fields don't narrow. */
52
+ function whenFromFlags(ctx) {
53
+ const agentIds = listFlag(ctx, 'agent');
54
+ const flowIds = listFlag(ctx, 'flow');
55
+ const versions = listFlag(ctx, 'agent-version');
56
+ const status = listFlag(ctx, 'status');
57
+ for (const s of status) {
58
+ if (!RUN_STATUSES.includes(s)) {
59
+ throw new UsageError(`--status takes only 'completed' (a correction needs a completed run), got "${s}"`);
60
+ }
61
+ }
62
+ return {
63
+ ...(agentIds.length > 0 && { agentIds }),
64
+ ...(flowIds.length > 0 && { flowIds }),
65
+ ...(versions.length > 0 && { versions }),
66
+ ...(status.length > 0 && { status: status }),
67
+ ...(ctx.options['include-dry-runs'] === true && { includeDryRuns: true }),
68
+ };
69
+ }
70
+ const create = {
71
+ kind: 'leaf',
72
+ name: 'create',
73
+ description: 'Create a judging rule: which of the project’s finished runs a person is asked to correct, and how many to queue.',
74
+ usage: 'kindgi judging-rules create --name=<name> [--project=<id>] [--agent=<id>] [--flow=<id>] [--agent-version=<v>] [--status=completed] [--include-dry-runs] [--sample=<0-1>] [--max-open=<n>] [--class=<judge-class-id>] [--disabled] [--queue-last=<n>] [--queue-since=<time>]',
75
+ optionSpec: {
76
+ ...PROJECT_OPTION,
77
+ name: { type: 'string', description: 'A name for the rule. Required.' },
78
+ ...WHEN_OPTIONS,
79
+ sample: {
80
+ type: 'string',
81
+ description: 'The share of matching runs to queue, greater than 0 and at most 1 (default 1). The same runs every time, by run and rule id.',
82
+ },
83
+ 'max-open': {
84
+ type: 'string',
85
+ description: 'Add nothing while this rule has this many open items. Without it, no cap.',
86
+ },
87
+ class: {
88
+ type: 'string',
89
+ description: 'The judge class whose correction closes an item. Without it, any correction closes it.',
90
+ },
91
+ disabled: { type: 'boolean', description: 'Create the rule disabled (it matches nothing).' },
92
+ 'queue-last': {
93
+ type: 'string',
94
+ description: "Also queue the rule's matches among the last N finished runs, right after creating it (1 to 1000).",
95
+ },
96
+ 'queue-since': {
97
+ type: 'string',
98
+ description: 'Also queue the rule’s matches among runs finished at or after this time (an ISO 8601 time with a zone, or a date).',
99
+ },
100
+ },
101
+ run: (ctx) => runSdk(ctx, 'judging-rules create', async () => {
102
+ const name = stringFlag(ctx, 'name');
103
+ if (name === undefined)
104
+ throw new UsageError('--name=<name> is required');
105
+ const projectId = await projectIdFlag(ctx);
106
+ const sample = sampleFlag(ctx);
107
+ const maxOpen = integerFlag(ctx, 'max-open');
108
+ const judgeClassId = stringFlag(ctx, 'class');
109
+ const spec = {
110
+ name,
111
+ when: whenFromFlags(ctx),
112
+ ...(sample !== undefined && { sample }),
113
+ ...(maxOpen !== undefined && { maxOpen }),
114
+ ...(judgeClassId !== undefined && { judgeClassId }),
115
+ ...(ctx.options.disabled === true && { enabled: false }),
116
+ };
117
+ const rule = await ctx.client().projects.judgingRules.create(projectId, spec);
118
+ const last = integerFlag(ctx, 'queue-last');
119
+ const since = timeFlag(ctx, 'queue-since');
120
+ if (last === undefined && since === undefined)
121
+ return rule;
122
+ const queued = await ctx.client().projects.judgingRules.queueRecent(projectId, rule.ruleId, {
123
+ ...(last !== undefined && { last }),
124
+ ...(since !== undefined && { since }),
125
+ });
126
+ return { rule, queued };
127
+ }),
128
+ };
129
+ const list = {
130
+ kind: 'leaf',
131
+ name: 'list',
132
+ description: 'List the project’s live judging rules (their latest versions), oldest first.',
133
+ usage: 'kindgi judging-rules list [--project=<id>] [--limit=<n>] [--cursor=<c>]',
134
+ optionSpec: {
135
+ ...PROJECT_OPTION,
136
+ limit: { type: 'string', description: 'The most rules to return.' },
137
+ cursor: {
138
+ type: 'string',
139
+ description: "Resume after this cursor, from the previous page's `nextCursor`.",
140
+ },
141
+ },
142
+ run: (ctx) => runSdk(ctx, 'judging-rules list', async () => {
143
+ const projectId = await projectIdFlag(ctx);
144
+ const limit = integerFlag(ctx, 'limit');
145
+ const cursor = stringFlag(ctx, 'cursor');
146
+ return await ctx.client().projects.judgingRules.list(projectId, {
147
+ ...(limit !== undefined && { limit }),
148
+ ...(cursor !== undefined && { cursor }),
149
+ });
150
+ }),
151
+ };
152
+ const show = {
153
+ kind: 'leaf',
154
+ name: 'show',
155
+ description: 'Show a judging rule’s latest version.',
156
+ usage: 'kindgi judging-rules show <rule-id> [--project=<id>]',
157
+ optionSpec: { ...PROJECT_OPTION },
158
+ run: (ctx) => runSdk(ctx, 'judging-rules show', async () => {
159
+ const ruleId = requiredPositional(ctx, 0, 'rule-id');
160
+ const projectId = await projectIdFlag(ctx);
161
+ return await ctx.client().projects.judgingRules.get(projectId, ruleId);
162
+ }),
163
+ };
164
+ /** Refuse the `update` flag pairs that contradict each other. */
165
+ function refuseConflictingUpdateFlags(ctx) {
166
+ if (integerFlag(ctx, 'max-open') !== undefined && ctx.options['clear-max-open'] === true) {
167
+ throw new UsageError('Give --max-open or --clear-max-open, not both');
168
+ }
169
+ if (stringFlag(ctx, 'class') !== undefined && ctx.options['clear-class'] === true) {
170
+ throw new UsageError('Give --class or --clear-class, not both');
171
+ }
172
+ if (ctx.options.enable === true && ctx.options.disable === true) {
173
+ throw new UsageError('Give --enable or --disable, not both');
174
+ }
175
+ }
176
+ /** The patch an `update` sends: the given fields replaced, `when` whole. Refuses an empty change. */
177
+ function patchFromFlags(ctx) {
178
+ refuseConflictingUpdateFlags(ctx);
179
+ const name = stringFlag(ctx, 'name');
180
+ const sample = sampleFlag(ctx);
181
+ const maxOpen = integerFlag(ctx, 'max-open');
182
+ const judgeClassId = stringFlag(ctx, 'class');
183
+ const patch = {
184
+ ...(name !== undefined && { name }),
185
+ ...(hasWhenFlags(ctx) && { when: whenFromFlags(ctx) }),
186
+ ...(sample !== undefined && { sample }),
187
+ ...(maxOpen !== undefined && { maxOpen }),
188
+ ...(ctx.options['clear-max-open'] === true && { maxOpen: null }),
189
+ ...(judgeClassId !== undefined && { judgeClassId }),
190
+ ...(ctx.options['clear-class'] === true && { judgeClassId: null }),
191
+ ...(ctx.options.enable === true && { enabled: true }),
192
+ ...(ctx.options.disable === true && { enabled: false }),
193
+ };
194
+ if (Object.keys(patch).length === 0) {
195
+ throw new UsageError('Give at least one change: --name, a match flag, --sample, --max-open/--clear-max-open, --class/--clear-class, or --enable/--disable');
196
+ }
197
+ return patch;
198
+ }
199
+ const update = {
200
+ kind: 'leaf',
201
+ name: 'update',
202
+ description: 'Change a judging rule: a new version with the given fields replaced. The match flags replace the rule’s `when` whole.',
203
+ usage: 'kindgi judging-rules update <rule-id> [--project=<id>] [--name=<name>] [--agent=<id>] [--flow=<id>] [--agent-version=<v>] [--status=completed] [--include-dry-runs] [--sample=<0-1>] [--max-open=<n> | --clear-max-open] [--class=<id> | --clear-class] [--enable | --disable]',
204
+ optionSpec: {
205
+ ...PROJECT_OPTION,
206
+ name: { type: 'string', description: 'A new name for the rule.' },
207
+ ...WHEN_OPTIONS,
208
+ sample: { type: 'string', description: 'A new sample share, greater than 0 and at most 1.' },
209
+ 'max-open': { type: 'string', description: 'A new open-items cap.' },
210
+ 'clear-max-open': { type: 'boolean', description: 'Remove the open-items cap.' },
211
+ class: { type: 'string', description: 'A new judge class whose correction closes an item.' },
212
+ 'clear-class': {
213
+ type: 'boolean',
214
+ description: 'Remove the judge class; any correction closes an item.',
215
+ },
216
+ enable: { type: 'boolean', description: 'Enable the rule.' },
217
+ disable: { type: 'boolean', description: 'Disable the rule.' },
218
+ },
219
+ run: (ctx) => runSdk(ctx, 'judging-rules update', async () => {
220
+ const ruleId = requiredPositional(ctx, 0, 'rule-id');
221
+ const projectId = await projectIdFlag(ctx);
222
+ const patch = patchFromFlags(ctx);
223
+ return await ctx.client().projects.judgingRules.update(projectId, ruleId, patch);
224
+ }),
225
+ };
226
+ const remove = {
227
+ kind: 'leaf',
228
+ name: 'remove',
229
+ description: 'Unregister a judging rule, so it queues nothing more. Its queued items stay.',
230
+ usage: 'kindgi judging-rules remove <rule-id> [--project=<id>]',
231
+ optionSpec: { ...PROJECT_OPTION },
232
+ run: (ctx) => runSdk(ctx, 'judging-rules remove', async () => {
233
+ const ruleId = requiredPositional(ctx, 0, 'rule-id');
234
+ const projectId = await projectIdFlag(ctx);
235
+ return await ctx.client().projects.judgingRules.unregister(projectId, ruleId);
236
+ }),
237
+ };
238
+ const versions = {
239
+ kind: 'leaf',
240
+ name: 'versions',
241
+ description: 'List every version of a judging rule, newest first.',
242
+ usage: 'kindgi judging-rules versions <rule-id> [--project=<id>] [--limit=<n>] [--cursor=<c>]',
243
+ optionSpec: {
244
+ ...PROJECT_OPTION,
245
+ limit: { type: 'string', description: 'The most versions to return.' },
246
+ cursor: {
247
+ type: 'string',
248
+ description: "Resume after this cursor, from the previous page's `nextCursor`.",
249
+ },
250
+ },
251
+ run: (ctx) => runSdk(ctx, 'judging-rules versions', async () => {
252
+ const ruleId = requiredPositional(ctx, 0, 'rule-id');
253
+ const projectId = await projectIdFlag(ctx);
254
+ const limit = integerFlag(ctx, 'limit');
255
+ const cursor = stringFlag(ctx, 'cursor');
256
+ return await ctx.client().projects.judgingRules.versions(projectId, ruleId, {
257
+ ...(limit !== undefined && { limit }),
258
+ ...(cursor !== undefined && { cursor }),
259
+ });
260
+ }),
261
+ };
262
+ const results = {
263
+ kind: 'leaf',
264
+ name: 'results',
265
+ description: 'A judging rule’s results since a time, by the rule’s version and the agent’s, never pooled.',
266
+ usage: 'kindgi judging-rules results <rule-id> [--project=<id>] [--since=<time>]',
267
+ optionSpec: {
268
+ ...PROJECT_OPTION,
269
+ since: {
270
+ type: 'string',
271
+ description: 'Only runs queued (or skipped by the cap) at or after this time (an ISO 8601 time with a zone, or a date).',
272
+ },
273
+ },
274
+ run: (ctx) => runSdk(ctx, 'judging-rules results', async () => {
275
+ const ruleId = requiredPositional(ctx, 0, 'rule-id');
276
+ const projectId = await projectIdFlag(ctx);
277
+ const since = timeFlag(ctx, 'since');
278
+ return await ctx.client().projects.judgingRules.results(projectId, ruleId, since);
279
+ }),
280
+ };
281
+ const preview = {
282
+ kind: 'leaf',
283
+ name: 'preview',
284
+ description: 'What a rule would queue among the project’s recent runs, without queueing anything.',
285
+ usage: 'kindgi judging-rules preview [--project=<id>] [--agent=<id>] [--flow=<id>] [--agent-version=<v>] [--status=completed] [--include-dry-runs] [--sample=<0-1>] [--last=<n>] [--rule=<rule-id>]',
286
+ optionSpec: {
287
+ ...PROJECT_OPTION,
288
+ ...WHEN_OPTIONS,
289
+ sample: {
290
+ type: 'string',
291
+ description: 'The sample share to preview with, greater than 0 and at most 1.',
292
+ },
293
+ last: {
294
+ type: 'string',
295
+ description: 'How many recent runs to look at, 1 to 500 (default 100).',
296
+ },
297
+ rule: {
298
+ type: 'string',
299
+ description: "An existing rule's id: sample as it does, so the count is exactly what it would take.",
300
+ },
301
+ },
302
+ run: (ctx) => runSdk(ctx, 'judging-rules preview', async () => {
303
+ const projectId = await projectIdFlag(ctx);
304
+ const sample = sampleFlag(ctx);
305
+ const last = integerFlag(ctx, 'last');
306
+ const ruleId = stringFlag(ctx, 'rule');
307
+ return await ctx.client().projects.judgingRules.preview(projectId, {
308
+ ...whenFromFlags(ctx),
309
+ ...(sample !== undefined && { sample }),
310
+ ...(last !== undefined && { last }),
311
+ ...(ruleId !== undefined && { ruleId }),
312
+ });
313
+ }),
314
+ };
315
+ const queueRecent = {
316
+ kind: 'leaf',
317
+ name: 'queue-recent',
318
+ description: 'Queue the rule’s matches among recent runs, to catch it up on runs that ended before it was there. The open-items cap is not applied.',
319
+ usage: 'kindgi judging-rules queue-recent <rule-id> [--project=<id>] [--last=<n>] [--since=<time>]',
320
+ optionSpec: {
321
+ ...PROJECT_OPTION,
322
+ last: {
323
+ type: 'string',
324
+ description: "This many of the project's most recent finished runs, 1 to 1000 (newest first).",
325
+ },
326
+ since: {
327
+ type: 'string',
328
+ description: 'Runs finished at or after this time (an ISO 8601 time with a zone, or a date). Give --last and/or --since.',
329
+ },
330
+ },
331
+ run: (ctx) => runSdk(ctx, 'judging-rules queue-recent', async () => {
332
+ const ruleId = requiredPositional(ctx, 0, 'rule-id');
333
+ const projectId = await projectIdFlag(ctx);
334
+ const last = integerFlag(ctx, 'last');
335
+ const since = timeFlag(ctx, 'since');
336
+ if (last === undefined && since === undefined) {
337
+ throw new UsageError('Give --last=<n> and/or --since=<time>');
338
+ }
339
+ return await ctx.client().projects.judgingRules.queueRecent(projectId, ruleId, {
340
+ ...(last !== undefined && { last }),
341
+ ...(since !== undefined && { since }),
342
+ });
343
+ }),
344
+ };
345
+ export const judgingRulesCommand = {
346
+ kind: 'group',
347
+ name: 'judging-rules',
348
+ description: "A project's judging rules — which finished runs a person is asked to correct (create / list / show / update / remove / versions / results / preview / queue-recent).",
349
+ subcommands: [create, list, show, update, remove, versions, results, preview, queueRecent],
350
+ };
351
+ //# sourceMappingURL=judging-rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judging-rules.js","sourceRoot":"","sources":["../../src/commands/judging-rules.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAIjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,WAAW,EACX,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,MAAM,EACN,UAAU,EACV,QAAQ,GACT,MAAM,cAAc,CAAC;AAGtB,yEAAyE;AACzE,MAAM,YAAY,GAAG,CAAC,WAAW,CAAU,CAAC;AAE5C,MAAM,cAAc,GAA8C;IAChE,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,uEAAuE;KACrF;CACF,CAAC;AAEF,0FAA0F;AAC1F,MAAM,YAAY,GAA8C;IAC9D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wCAAwC,EAAE;IAChG,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uCAAuC,EAAE;IAC9F,eAAe,EAAE;QACf,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EACT,8GAA8G;KACjH;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,WAAW,EAC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EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC;CAC3F,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"judgments.d.ts","sourceRoot":"","sources":["../../src/commands/judgments.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAuKvD,eAAO,MAAM,gBAAgB,EAAE,OAK9B,CAAC"}
1
+ {"version":3,"file":"judgments.d.ts","sourceRoot":"","sources":["../../src/commands/judgments.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAuNvD,eAAO,MAAM,gBAAgB,EAAE,OAM9B,CAAC"}
@@ -1,7 +1,8 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  // Copyright (C) 2026 Kindgi Inc.
3
+ import { CORRECTION_ITEM } from '@kindgi/types';
3
4
  import { UsageError } from '../errors.js';
4
- import { integerFlag, requiredPositional, runSdk, stringFlag } from './helpers.js';
5
+ import { integerFlag, readJsonInput, requiredPositional, runSdk, stringFlag } from './helpers.js';
5
6
  const VERDICTS = ['yes', 'no'];
6
7
  /** The string flags given, under their request field names (`{ class: 'judgeClassId' }`). */
7
8
  function givenFlags(ctx, fields) {
@@ -13,58 +14,99 @@ function givenFlags(ctx, fields) {
13
14
  }
14
15
  return out;
15
16
  }
17
+ /** The optional `--correction` flag, parsed from JSON or `@<file>`. */
18
+ async function correctionFlag(ctx) {
19
+ const text = stringFlag(ctx, 'correction');
20
+ return text === undefined ? undefined : (await readJsonInput(text));
21
+ }
22
+ /** The judged item for an ordinary judgment, from `--item`/`--pointer`/`--rank`. */
23
+ function ordinaryItem(ctx) {
24
+ const key = stringFlag(ctx, 'item');
25
+ if (key === undefined)
26
+ throw new UsageError('--item=<key> is required');
27
+ const rank = integerFlag(ctx, 'rank');
28
+ if (rank !== undefined && rank < 0)
29
+ throw new UsageError('--rank must be 0 or more');
30
+ const pointer = ctx.options.pointer;
31
+ return {
32
+ key,
33
+ // An empty pointer is valid: the whole output.
34
+ ...(typeof pointer === 'string' && { pointer }),
35
+ ...(rank !== undefined && { rank }),
36
+ };
37
+ }
38
+ /**
39
+ * The one reserved item a correction rides on — the whole output — so it counts
40
+ * once per run per expert. `--item`, `--pointer` or `--rank`, if given, may only
41
+ * name that whole-output item; `--rank` never applies, so it is refused.
42
+ */
43
+ function correctionItem(ctx) {
44
+ const key = stringFlag(ctx, 'item');
45
+ if (key !== undefined && key !== CORRECTION_ITEM.key) {
46
+ throw new UsageError(`--correction is recorded under --item=${CORRECTION_ITEM.key}; drop --item or set it to that`);
47
+ }
48
+ const pointer = ctx.options.pointer;
49
+ if (typeof pointer === 'string' && pointer !== CORRECTION_ITEM.pointer) {
50
+ throw new UsageError('--correction covers the whole output; drop --pointer');
51
+ }
52
+ if (integerFlag(ctx, 'rank') !== undefined) {
53
+ throw new UsageError('--correction covers the whole output; drop --rank');
54
+ }
55
+ return { key: CORRECTION_ITEM.key, pointer: CORRECTION_ITEM.pointer };
56
+ }
16
57
  const add = {
17
58
  kind: 'leaf',
18
59
  name: 'add',
19
- description: "Judge one item of a finished run's output: yes or no, with an optional reason. Judging the same item again as the same caller replaces the earlier judgment.",
20
- usage: 'kindgi judgments add --run=<run-id> --item=<key> [--pointer=<json-pointer>] [--rank=<n>] (--yes | --no) [--reason=<text>] [--class=<judge-class-id>] [--participant=<id>]',
60
+ description: "Correct one item of a finished run's output: mark the answer right (`--yes`) or wrong (`--no`), with an optional reason. Correcting the same item again as the same caller replaces the earlier correction.",
61
+ usage: 'kindgi judgments add --run=<run-id> --item=<key> [--pointer=<json-pointer>] [--rank=<n>] (--yes | --no) [--reason=<text>] [--correction=<json-or-@file>] [--class=<judge-class-id>] [--participant=<id>]',
21
62
  optionSpec: {
22
- run: { type: 'string', description: 'The run whose output is judged. Required.' },
63
+ run: { type: 'string', description: 'The run whose output is corrected. Required.' },
23
64
  item: {
24
65
  type: 'string',
25
- description: 'Your stable id for the judged item, e.g. a matched case id. Required.',
66
+ description: 'Your stable id for the corrected item, e.g. a matched case id. Required.',
26
67
  },
27
68
  pointer: {
28
69
  type: 'string',
29
- description: "Where the item is in the run's output, as a JSON Pointer such as `/matches/2`. Its value is kept with the judgment.",
70
+ description: "Where the item is in the run's output, as a JSON Pointer such as `/matches/2`. Its value is kept with the correction.",
30
71
  },
31
72
  rank: { type: 'string', description: "The item's position in a ranked list (0 = first)." },
32
- yes: { type: 'boolean', description: 'The verdict is yes. Give `--yes` or `--no`.' },
33
- no: { type: 'boolean', description: 'The verdict is no. Give `--yes` or `--no`.' },
34
- reason: { type: 'string', description: 'Why, recorded with the judgment.' },
73
+ yes: {
74
+ type: 'boolean',
75
+ description: 'Mark the item right (the verdict `yes`). Give `--yes` or `--no`.',
76
+ },
77
+ no: {
78
+ type: 'boolean',
79
+ description: 'Mark the item wrong (the verdict `no`). Give `--yes` or `--no`.',
80
+ },
81
+ reason: { type: 'string', description: 'Why, recorded with the correction.' },
82
+ correction: {
83
+ type: 'string',
84
+ description: 'What the agent should have done, as JSON or `@<file>`: `{ "calls": [{ "tool": "<tool-id>", "args": { … } }], "notCalled": ["<tool-id>"] }`. `args` are the partial top-level fields to compare (those left out are not compared); `notCalled` lists tools that should not have been called at all. Graded on a replay. Recorded against the whole output, so a later correction of the same run by the same caller replaces it; `--item`/`--pointer`/`--rank` aren\'t needed.',
85
+ },
35
86
  class: {
36
87
  type: 'string',
37
- description: 'The judge class id to record the judgment under. Without one, the judgment is unclassified.',
88
+ description: 'The judge class id to record the correction under. Without one, the correction is unclassified.',
38
89
  },
39
90
  participant: {
40
91
  type: 'string',
41
- description: 'Your opaque id for the end user who judged, when you judge on their behalf.',
92
+ description: 'Your opaque id for the end user who corrected, when you correct on their behalf.',
42
93
  },
43
94
  },
44
95
  run: (ctx) => runSdk(ctx, 'judgments add', async () => {
45
96
  const runId = stringFlag(ctx, 'run');
46
97
  if (runId === undefined)
47
98
  throw new UsageError('--run=<run-id> is required');
48
- const key = stringFlag(ctx, 'item');
49
- if (key === undefined)
50
- throw new UsageError('--item=<key> is required');
51
99
  const yes = ctx.options.yes === true;
52
100
  const no = ctx.options.no === true;
53
101
  if (yes === no)
54
102
  throw new UsageError('Give exactly one of --yes or --no');
55
- const rank = integerFlag(ctx, 'rank');
56
- if (rank !== undefined && rank < 0)
57
- throw new UsageError('--rank must be 0 or more');
58
- const pointer = ctx.options.pointer;
103
+ const correction = await correctionFlag(ctx);
104
+ const item = correction === undefined ? ordinaryItem(ctx) : correctionItem(ctx);
59
105
  return await ctx.client().judgments.create({
60
106
  runId,
61
- item: {
62
- key,
63
- // An empty pointer is valid: the whole output.
64
- ...(typeof pointer === 'string' && { pointer }),
65
- ...(rank !== undefined && { rank }),
66
- },
107
+ item,
67
108
  verdict: yes ? 'yes' : 'no',
109
+ ...(correction !== undefined && { correction }),
68
110
  ...givenFlags(ctx, {
69
111
  reason: 'reason',
70
112
  class: 'judgeClassId',
@@ -76,26 +118,26 @@ const add = {
76
118
  const list = {
77
119
  kind: 'leaf',
78
120
  name: 'list',
79
- description: 'List judgments, newest first (replaced and removed ones are left out).',
121
+ description: 'List corrections, newest first (replaced and removed ones are left out).',
80
122
  usage: 'kindgi judgments list [--run=<run-id>] [--agent=<id> [--agent-version=<v>]] [--flow=<id>] [--verdict=yes|no] [--class=<judge-class-id>] [--participant=<id>] [--project=<id>] [--limit=<n>] [--cursor=<c>]',
81
123
  optionSpec: {
82
- run: { type: 'string', description: 'Only judgments of this run.' },
83
- agent: { type: 'string', description: 'Only judgments of runs of this agent.' },
124
+ run: { type: 'string', description: 'Only corrections of this run.' },
125
+ agent: { type: 'string', description: 'Only corrections of runs of this agent.' },
84
126
  'agent-version': {
85
127
  type: 'string',
86
- description: 'Only judgments of runs of this agent version. Needs `--agent`.',
128
+ description: 'Only corrections of runs of this agent version. Needs `--agent`.',
87
129
  },
88
- flow: { type: 'string', description: 'Only judgments of runs of this flow.' },
130
+ flow: { type: 'string', description: 'Only corrections of runs of this flow.' },
89
131
  verdict: { type: 'string', description: 'Only this verdict: `yes` or `no`.' },
90
- class: { type: 'string', description: 'Only judgments under this judge class id.' },
132
+ class: { type: 'string', description: 'Only corrections under this judge class id.' },
91
133
  participant: {
92
134
  type: 'string',
93
- description: "Only judgments made for this end user's opaque id.",
135
+ description: "Only corrections made for this end user's opaque id.",
94
136
  },
95
- project: { type: 'string', description: 'Only judgments in this project.' },
137
+ project: { type: 'string', description: 'Only corrections in this project.' },
96
138
  limit: {
97
139
  type: 'string',
98
- description: 'The most judgments to return (default 25, at most 100).',
140
+ description: 'The most corrections to return (default 25, at most 100).',
99
141
  },
100
142
  cursor: {
101
143
  type: 'string',
@@ -133,7 +175,7 @@ const list = {
133
175
  const show = {
134
176
  kind: 'leaf',
135
177
  name: 'show',
136
- description: "Show a judgment with the stored copies of the run's input and output, and the judged item's value.",
178
+ description: "Show a correction with the stored copies of the run's input and output, and the corrected item's value.",
137
179
  usage: 'kindgi judgments show <judgment-id>',
138
180
  run: (ctx) => runSdk(ctx, 'judgments show', async () => {
139
181
  const id = requiredPositional(ctx, 0, 'judgment-id');
@@ -143,7 +185,7 @@ const show = {
143
185
  const remove = {
144
186
  kind: 'leaf',
145
187
  name: 'remove',
146
- description: 'Remove a judgment.',
188
+ description: 'Remove a correction.',
147
189
  usage: 'kindgi judgments remove <judgment-id>',
148
190
  run: (ctx) => runSdk(ctx, 'judgments remove', async () => {
149
191
  const id = requiredPositional(ctx, 0, 'judgment-id');
@@ -154,7 +196,7 @@ const remove = {
154
196
  export const judgmentsCommand = {
155
197
  kind: 'group',
156
198
  name: 'judgments',
157
- description: "Judge items of a run's output, yes or no (add / list / show / remove).",
199
+ description: "Correct items of a run's output, marking them right or wrong (add / list / show / remove).",
158
200
  subcommands: [add, list, show, remove],
159
201
  };
160
202
  //# sourceMappingURL=judgments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"judgments.js","sourceRoot":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,CAAC,GAAG,EAAE,kBAAkB,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,EAAE,GAAG,kBAAkB,CAAC,GAAG,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACrD,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3C,CAAC,CAAC;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAY;IACvC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,WAAW;IACjB,WAAW,EACT,4FAA4F;IAC9F,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;CACvC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/commands/key.ts"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAE,OAAO,EAA8B,MAAM,YAAY,CAAC;AAydtE,eAAO,MAAM,UAAU,EAAE,OAMxB,CAAC"}
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/commands/key.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,OAAO,EAA8B,MAAM,YAAY,CAAC;AAwlBtE,eAAO,MAAM,UAAU,EAAE,OAMxB,CAAC"}