@parcha/agentrun-serve 0.1.0-beta.44 → 0.1.0-beta.46

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 (350) hide show
  1. package/CHANGELOG.md +148 -5
  2. package/README.md +385 -305
  3. package/dist/acp-package.d.ts +28 -0
  4. package/dist/acp-package.js +23 -0
  5. package/dist/adapter-facts.d.ts +8 -1
  6. package/dist/adapter-facts.js +9 -1
  7. package/dist/adapters.d.ts +5 -0
  8. package/dist/adapters.js +36 -3
  9. package/dist/agent-delete.d.ts +50 -0
  10. package/dist/agent-delete.js +125 -0
  11. package/dist/agents-store.d.ts +9 -3
  12. package/dist/agents-store.js +22 -8
  13. package/dist/agents.d.ts +5 -1
  14. package/dist/agents.js +8 -4
  15. package/dist/api-only.d.ts +8 -3
  16. package/dist/api-only.js +10 -4
  17. package/dist/archil-routes.d.ts +5 -1
  18. package/dist/archil-routes.js +57 -2
  19. package/dist/browser-wait-ended.d.ts +2 -0
  20. package/dist/browser-wait-ended.js +2 -0
  21. package/dist/calendar/ics-faux.d.ts +3 -1
  22. package/dist/calendar/ics-faux.js +12 -2
  23. package/dist/calendar/tools.js +5 -2
  24. package/dist/chatgpt-plan.js +3 -1
  25. package/dist/claude-login.d.ts +135 -0
  26. package/dist/claude-login.js +244 -0
  27. package/dist/cli.js +62 -19
  28. package/dist/composio-preset.js +69 -7
  29. package/dist/composio-triggers.d.ts +14 -0
  30. package/dist/composio-triggers.js +79 -15
  31. package/dist/computer-attach.d.ts +40 -5
  32. package/dist/computer-attach.js +130 -15
  33. package/dist/computer-keys.d.ts +3 -0
  34. package/dist/computer-keys.js +7 -1
  35. package/dist/computer-live.js +3 -2
  36. package/dist/computers.d.ts +21 -10
  37. package/dist/computers.js +39 -28
  38. package/dist/console/assets/index-C2MYaUBa.css +1 -0
  39. package/dist/console/assets/index-CZZeCReB.js +701 -0
  40. package/dist/console/index.html +2 -2
  41. package/dist/decisions.d.ts +1 -1
  42. package/dist/dial-relay.d.ts +29 -0
  43. package/dist/dial-relay.js +94 -0
  44. package/dist/email/tools.js +10 -5
  45. package/dist/env-proxy.d.ts +2 -0
  46. package/dist/env-proxy.js +35 -0
  47. package/dist/errors.d.ts +3 -1
  48. package/dist/errors.js +7 -4
  49. package/dist/faux-computers.d.ts +8 -2
  50. package/dist/faux-computers.js +83 -6
  51. package/dist/harness-archive.d.ts +67 -0
  52. package/dist/harness-archive.js +177 -0
  53. package/dist/harness-goose.d.ts +34 -0
  54. package/dist/harness-goose.js +87 -0
  55. package/dist/harness-install.d.ts +21 -0
  56. package/dist/harness-install.js +24 -11
  57. package/dist/harness-opencode/adapter.js +1 -1
  58. package/dist/harness-table.d.ts +9 -1
  59. package/dist/harness-table.js +20 -3
  60. package/dist/harness.d.ts +1 -2
  61. package/dist/harness.js +3 -4
  62. package/dist/host.js +2 -1
  63. package/dist/import.d.ts +10 -0
  64. package/dist/import.js +28 -8
  65. package/dist/key-check.js +3 -0
  66. package/dist/learn/audit.d.ts +6 -6
  67. package/dist/learn/audit.js +3 -7
  68. package/dist/learn/check.d.ts +23 -89
  69. package/dist/learn/check.js +57 -335
  70. package/dist/learn/commit.d.ts +63 -90
  71. package/dist/learn/commit.js +124 -316
  72. package/dist/learn/compile.d.ts +53 -50
  73. package/dist/learn/compile.js +89 -104
  74. package/dist/learn/corrections.d.ts +13 -0
  75. package/dist/learn/corrections.js +23 -0
  76. package/dist/learn/delete.d.ts +5 -5
  77. package/dist/learn/delete.js +8 -10
  78. package/dist/learn/folder.d.ts +35 -47
  79. package/dist/learn/folder.js +118 -134
  80. package/dist/learn/index.d.ts +3 -5
  81. package/dist/learn/index.js +6 -9
  82. package/dist/learn/learning.sh +45 -15
  83. package/dist/learn/promote.d.ts +23 -5
  84. package/dist/learn/promote.js +40 -2
  85. package/dist/learn/{skills.d.ts → workflow-draft.d.ts} +30 -38
  86. package/dist/learn/{skills.js → workflow-draft.js} +48 -58
  87. package/dist/learn/workflow-nodes.js +1 -1
  88. package/dist/learned-workflow.js +2 -2
  89. package/dist/learning-cost.d.ts +38 -24
  90. package/dist/learning-cost.js +41 -24
  91. package/dist/learning-routes.d.ts +91 -170
  92. package/dist/learning-routes.js +183 -421
  93. package/dist/learning-run.d.ts +19 -40
  94. package/dist/learning-run.js +23 -93
  95. package/dist/learning-setting.d.ts +21 -10
  96. package/dist/learning-setting.js +47 -11
  97. package/dist/learning-words.d.ts +28 -74
  98. package/dist/learning-words.js +64 -162
  99. package/dist/learning.d.ts +61 -392
  100. package/dist/learning.js +101 -651
  101. package/dist/live-reach.d.ts +25 -2
  102. package/dist/live-reach.js +46 -4
  103. package/dist/llms.txt +1 -1
  104. package/dist/local-models.d.ts +3 -11
  105. package/dist/local-models.js +5 -6
  106. package/dist/mcp-servers-store.d.ts +4 -4
  107. package/dist/model-form.js +6 -5
  108. package/dist/model.d.ts +4 -0
  109. package/dist/model.js +26 -9
  110. package/dist/native/binding.js +1 -1
  111. package/dist/native/connection.js +1 -1
  112. package/dist/native/discovery.js +1 -1
  113. package/dist/native/instructions.d.ts +3 -0
  114. package/dist/native/instructions.js +5 -3
  115. package/dist/native/remote-worker-bridge.js +9 -43
  116. package/dist/native/remote.d.ts +8 -15
  117. package/dist/native/remote.js +3 -3
  118. package/dist/native/schema.js +1 -1
  119. package/dist/native/types.d.ts +2 -2
  120. package/dist/openapi.js +273 -319
  121. package/dist/paid-calls.d.ts +8 -0
  122. package/dist/paid-calls.js +20 -0
  123. package/dist/particle-provider.d.ts +11 -0
  124. package/dist/particle-provider.js +135 -0
  125. package/dist/port-models.d.ts +12 -4
  126. package/dist/port-models.js +28 -11
  127. package/dist/print.d.ts +27 -0
  128. package/dist/print.js +21 -0
  129. package/dist/provider.d.ts +7 -0
  130. package/dist/provider.js +15 -1
  131. package/dist/reflect-range.js +2 -3
  132. package/dist/run-launch.d.ts +14 -28
  133. package/dist/run-launch.js +9 -12
  134. package/dist/run-learning-served.d.ts +15 -89
  135. package/dist/run-listing.d.ts +34 -0
  136. package/dist/run-listing.js +128 -0
  137. package/dist/run-model-key.js +1 -1
  138. package/dist/run-timeline-served.js +5 -3
  139. package/dist/run-trace.d.ts +97 -0
  140. package/dist/run-trace.js +253 -0
  141. package/dist/run-view.d.ts +15 -0
  142. package/dist/run-view.js +9 -0
  143. package/dist/runnable.js +2 -1
  144. package/dist/runner/adapter-loop.d.ts +8 -6
  145. package/dist/runner/adapter-loop.js +16 -12
  146. package/dist/runner/adapter-run-spec.d.ts +16 -4
  147. package/dist/runner/adapter-run-spec.js +64 -58
  148. package/dist/runner/adapters/index.js +22 -0
  149. package/dist/runner/adapters/pi.d.ts +4 -12
  150. package/dist/runner/adapters/pi.js +2 -2
  151. package/dist/runner/audit.d.ts +1 -1
  152. package/dist/runner/audit.js +30 -13
  153. package/dist/runner/beside.d.ts +6 -2
  154. package/dist/runner/beside.js +38 -9
  155. package/dist/runner/claim-secrets.d.ts +18 -2
  156. package/dist/runner/claim-secrets.js +42 -18
  157. package/dist/runner/cli-run-spec.js +55 -51
  158. package/dist/runner/conformance/harness.d.ts +6 -0
  159. package/dist/runner/conformance/harness.js +35 -13
  160. package/dist/runner/conformance/subject.d.ts +6 -0
  161. package/dist/runner/dispatch.d.ts +2 -2
  162. package/dist/runner/end-of-run.d.ts +6 -14
  163. package/dist/runner/end-of-run.js +8 -33
  164. package/dist/runner/feedback-round.d.ts +2 -2
  165. package/dist/runner/feedback-round.js +7 -7
  166. package/dist/runner/github-app.js +3 -1
  167. package/dist/runner/harness-loops.d.ts +0 -8
  168. package/dist/runner/harness-loops.js +11 -59
  169. package/dist/runner/held.d.ts +170 -0
  170. package/dist/runner/held.js +57 -0
  171. package/dist/runner/journal-kinds.d.ts +2 -3
  172. package/dist/runner/journal-kinds.js +2 -3
  173. package/dist/runner/learned-first.d.ts +40 -0
  174. package/dist/runner/learned-first.js +32 -0
  175. package/dist/runner/learning-end.d.ts +77 -69
  176. package/dist/runner/learning-end.js +250 -303
  177. package/dist/runner/learning-seed.d.ts +15 -33
  178. package/dist/runner/learning-seed.js +24 -45
  179. package/dist/runner/loop-contract.d.ts +2 -3
  180. package/dist/runner/main.d.ts +17 -9
  181. package/dist/runner/main.js +82 -20
  182. package/dist/runner/mcp-run.d.ts +11 -0
  183. package/dist/runner/mcp-run.js +67 -0
  184. package/dist/runner/memory-claim.d.ts +10 -5
  185. package/dist/runner/memory-claim.js +12 -6
  186. package/dist/runner/model-route.d.ts +7 -4
  187. package/dist/runner/model-route.js +22 -10
  188. package/dist/runner/native-loop.d.ts +0 -7
  189. package/dist/runner/native-loop.js +9 -101
  190. package/dist/runner/promotion.d.ts +12 -8
  191. package/dist/runner/promotion.js +37 -28
  192. package/dist/runner/reflect-hook.d.ts +64 -95
  193. package/dist/runner/reflect-hook.js +112 -225
  194. package/dist/runner/run-channel.d.ts +43 -0
  195. package/dist/runner/run-channel.js +467 -0
  196. package/dist/runner/run-child-host.d.ts +169 -0
  197. package/dist/runner/run-child-host.js +1230 -0
  198. package/dist/runner/run-child.d.ts +1 -0
  199. package/dist/runner/run-child.js +254 -0
  200. package/dist/runner/run-errors.d.ts +2 -0
  201. package/dist/runner/run-errors.js +20 -0
  202. package/dist/runner/runner.js +1 -5
  203. package/dist/runner/sdk-ask.d.ts +78 -0
  204. package/dist/runner/sdk-ask.js +158 -0
  205. package/dist/runner/sdk-loop.d.ts +2 -4
  206. package/dist/runner/sdk-loop.js +29 -49
  207. package/dist/runner/store-secrets.d.ts +5 -3
  208. package/dist/runner/store-secrets.js +5 -1
  209. package/dist/runner/workflow-first.d.ts +5 -0
  210. package/dist/runner/workflow-first.js +4 -0
  211. package/dist/runner/workflow-spec.js +7 -2
  212. package/dist/runs-over-store.d.ts +16 -28
  213. package/dist/runs-over-store.js +31 -38
  214. package/dist/sdk/runs.d.ts +6 -11
  215. package/dist/sdk/runs.js +20 -41
  216. package/dist/sdk/schema.js +3 -4
  217. package/dist/seal-key.d.ts +5 -0
  218. package/dist/seal-key.js +7 -0
  219. package/dist/secrets.d.ts +3 -0
  220. package/dist/secrets.js +16 -3
  221. package/dist/server.d.ts +55 -33
  222. package/dist/server.js +689 -322
  223. package/dist/sign-ins-store.d.ts +8 -0
  224. package/dist/sign-ins-store.js +36 -1
  225. package/dist/skills.js +1 -1
  226. package/dist/store/index.d.ts +2 -2
  227. package/dist/store/index.js +1 -1
  228. package/dist/store/journal/storage.js +3 -0
  229. package/dist/store/postgres/migrations/0017_run_listing.sql +83 -0
  230. package/dist/store/postgres/migrations/0018_trigger_template.sql +6 -0
  231. package/dist/store/postgres/migrations/0019_runner_relays.sql +28 -0
  232. package/dist/store/schema.d.ts +53 -4
  233. package/dist/store/schema.js +137 -6
  234. package/dist/store/sqlite/connection.d.ts +2 -0
  235. package/dist/store/sqlite/connection.js +3 -1
  236. package/dist/store/sqlite/run-patch.d.ts +0 -17
  237. package/dist/store/sqlite/run-patch.js +4 -33
  238. package/dist/store/sqlite/store.js +246 -63
  239. package/dist/store/sqlite/worker.js +25 -0
  240. package/dist/store/store.d.ts +193 -36
  241. package/dist/store/store.js +25 -3
  242. package/dist/store-reads/learning.d.ts +102 -204
  243. package/dist/store-reads/learning.js +159 -321
  244. package/dist/store-reads/loop.d.ts +0 -1
  245. package/dist/store-reads/loop.js +1 -1
  246. package/dist/store-view.d.ts +29 -1
  247. package/dist/store-view.js +97 -31
  248. package/dist/template-eval.d.ts +3 -6
  249. package/dist/template-eval.js +22 -36
  250. package/dist/templates.d.ts +8 -4
  251. package/dist/templates.js +44 -6
  252. package/dist/timeline/index.d.ts +1 -1
  253. package/dist/timeline/index.js +1 -1
  254. package/dist/timeline/timeline.d.ts +5 -1
  255. package/dist/timeline/timeline.js +16 -0
  256. package/dist/tool-gate.d.ts +0 -7
  257. package/dist/tool-gate.js +1 -15
  258. package/dist/tool-keys-store.d.ts +1 -1
  259. package/dist/tool-keys.d.ts +6 -4
  260. package/dist/tool-keys.js +12 -6
  261. package/dist/tools.d.ts +2 -2
  262. package/dist/tools.js +11 -4
  263. package/dist/triggers.d.ts +65 -6
  264. package/dist/triggers.js +125 -19
  265. package/dist/validate.js +1 -1
  266. package/dist/webhooks.d.ts +7 -2
  267. package/dist/webhooks.js +12 -5
  268. package/dist/workspace/agent-computer.d.ts +2 -0
  269. package/dist/workspace/agent-computer.js +2 -0
  270. package/dist/workspace/archil-claim.d.ts +7 -0
  271. package/dist/workspace/archil-claim.js +29 -0
  272. package/dist/workspace/archil.d.ts +9 -1
  273. package/dist/workspace/archil.js +165 -3
  274. package/dist/workspace/attach.d.ts +3 -1
  275. package/dist/workspace/attach.js +2 -0
  276. package/dist/workspace/attached-computers.d.ts +16 -5
  277. package/dist/workspace/attached-computers.js +25 -9
  278. package/dist/workspace/computer-deps.js +1 -1
  279. package/dist/workspace/computer-for-claim.d.ts +7 -3
  280. package/dist/workspace/computer-for-claim.js +119 -22
  281. package/dist/workspace/computer-hold.js +2 -1
  282. package/dist/workspace/computer-kept.d.ts +11 -1
  283. package/dist/workspace/computer-kept.js +24 -3
  284. package/dist/workspace/resolve-computer.d.ts +33 -19
  285. package/dist/workspace/resolve-computer.js +172 -64
  286. package/dist/workspace/revision-skills.d.ts +1 -2
  287. package/dist/workspace/revision-skills.js +3 -4
  288. package/dist/workspace/run-workspace.d.ts +1 -1
  289. package/dist/workspace/run-workspace.js +5 -0
  290. package/dist/workspace/synced-folder.d.ts +85 -0
  291. package/dist/workspace/synced-folder.js +230 -0
  292. package/dist/workspace/workspace.d.ts +4 -0
  293. package/launcher/agentrun-serve +1 -1
  294. package/package.json +10 -10
  295. package/templates/README.md +8 -8
  296. package/templates/inbound-lead/agent.md +5 -4
  297. package/templates/inbound-lead/evals/learned-correction/case.yaml +3 -3
  298. package/templates/inbound-lead/evals/learned-correction/fixtures/corrections.md +1 -0
  299. package/templates/inbound-lead/evals/learned-correction/graders/applies-correction.md +22 -0
  300. package/templates/inbound-lead/evals/learned-correction/graders/learned-origin.md +1 -1
  301. package/templates/inbound-lead/evals/learned-correction/prompt.md +1 -1
  302. package/templates/inbound-lead/lead.schema.json +6 -5
  303. package/templates/inbound-lead/rules/RUBRIC.md +4 -4
  304. package/templates/inbound-lead/skills/lead/SKILL.md +4 -4
  305. package/templates/kyb/agent.md +2 -1
  306. package/templates/market-monitor/evals/learned-preference/case.yaml +4 -4
  307. package/templates/market-monitor/evals/learned-preference/fixtures/corrections.md +1 -0
  308. package/templates/market-monitor/evals/learned-preference/graders/omits-junior-post.md +3 -3
  309. package/templates/market-monitor/evals/learned-preference/prompt.md +1 -1
  310. package/templates/release-notes/evals/learned-style/case.yaml +4 -4
  311. package/templates/release-notes/evals/learned-style/fixtures/corrections.md +1 -0
  312. package/templates/release-notes/evals/learned-style/graders/same-changes.md +2 -2
  313. package/templates/release-notes/evals/learned-style/prompt.md +1 -1
  314. package/dist/console/assets/index-BUktRvS-.css +0 -1
  315. package/dist/console/assets/index-nB9kTfIN.js +0 -711
  316. package/dist/learn/grade.d.ts +0 -138
  317. package/dist/learn/grade.js +0 -682
  318. package/dist/learn/notes.d.ts +0 -81
  319. package/dist/learn/notes.js +0 -178
  320. package/dist/learn/reflect.d.ts +0 -77
  321. package/dist/learn/reflect.js +0 -228
  322. package/dist/learn/relevance.d.ts +0 -24
  323. package/dist/learn/relevance.js +0 -91
  324. package/dist/learn/seed-check.d.ts +0 -74
  325. package/dist/learn/seed-check.js +0 -103
  326. package/dist/learning-batch.d.ts +0 -291
  327. package/dist/learning-batch.js +0 -600
  328. package/dist/learning-evals.d.ts +0 -35
  329. package/dist/learning-evals.js +0 -99
  330. package/dist/native/context.d.ts +0 -6
  331. package/dist/native/context.js +0 -22
  332. package/dist/propose.d.ts +0 -52
  333. package/dist/propose.js +0 -224
  334. package/dist/runner/learning-ask.d.ts +0 -47
  335. package/dist/runner/learning-ask.js +0 -128
  336. package/dist/runner/learning-dispatch.d.ts +0 -45
  337. package/dist/runner/learning-dispatch.js +0 -99
  338. package/dist/runner/learning-factory.d.ts +0 -16
  339. package/dist/runner/learning-factory.js +0 -50
  340. package/dist/runner/learning-loop.d.ts +0 -273
  341. package/dist/runner/learning-loop.js +0 -521
  342. package/dist/usage.d.ts +0 -11
  343. package/dist/usage.js +0 -11
  344. package/templates/inbound-lead/evals/learned-correction/fixtures/learning/MEMORY.md +0 -1
  345. package/templates/inbound-lead/evals/learned-correction/fixtures/learning/no-agencies.md +0 -14
  346. package/templates/inbound-lead/evals/learned-correction/graders/applies-note.md +0 -21
  347. package/templates/market-monitor/evals/learned-preference/fixtures/learning/MEMORY.md +0 -1
  348. package/templates/market-monitor/evals/learned-preference/fixtures/learning/skip-junior-job-posts.md +0 -8
  349. package/templates/release-notes/evals/learned-style/fixtures/learning/MEMORY.md +0 -1
  350. package/templates/release-notes/evals/learned-style/fixtures/learning/say-agent-not-bot.md +0 -13
@@ -1,36 +1,34 @@
1
- import { type ItemStatus, type Learning, type NoteUsed, type Shown } from "../learning.js";
1
+ import { type ItemStatus, type Learning, type Shown } from "../learning.js";
2
2
  import { type RunLaunch } from "../run-launch.js";
3
3
  import { type Impact, type ImpactLearning } from "../learning-run.js";
4
4
  import { amortize, type Bill, type CostReplay, type CostRun, type CostSummary, type RunPath, runCostOf } from "../learning-cost.js";
5
5
  import { type PastRun, workflowCostsOf } from "../runner/workflow-first.js";
6
6
  import { type Reflect } from "../reflect-range.js";
7
- import type { NoteRuns } from "../learning.js";
8
7
  import type { EntryLike, TimelineEvent } from "../timeline/index.js";
9
8
  import type { AnalyticsFilter } from "./analytics.js";
10
- import { type KeptProposal } from "../runner/learning-loop.js";
11
9
  import { type PromotionRecord } from "../learn/promote.js";
12
10
  import type { LearningProposal, Store } from "../store/store.js";
13
11
  /** A run's learning end: the Learning fields its end sets. */
14
- export type RunLearningEnd = Pick<Learning, "state" | "reason" | "detail" | "at" | "problems" | "verdict" | "graded" | "merged" | "cost_usd" | "tokens" | "learned" | "pending" | "skills" | "workflows" | "lost" | "answered_at" | "job_cost_usd" | "look_back_usd" | "compiled" | "draft_errors">;
15
- /** The kept row as the end-of-run hook writes it (runner/reflect-hook.ts): proposed with the proposal, or dropped, with
16
- * when the job answered, its cost and what looking back cost once the run looked back. */
12
+ export type RunLearningEnd = Learning;
13
+ /** The kept row as the end-of-run hook writes it (runner/reflect-hook.ts), read as untrusted. */
17
14
  type KeptRow = {
18
- readonly state?: string;
19
- readonly reason?: string;
20
- readonly detail?: string;
15
+ readonly state?: unknown;
16
+ readonly reason?: unknown;
17
+ readonly detail?: unknown;
21
18
  readonly problems?: Learning["problems"];
22
- readonly left?: Learning["problems"];
23
- readonly proposal?: KeptProposal;
19
+ readonly merged?: unknown;
20
+ readonly workflows?: Learning["workflows"];
21
+ readonly corrections?: unknown;
22
+ readonly compiled?: unknown;
23
+ readonly draft_errors?: unknown;
24
24
  readonly answered_at?: unknown;
25
25
  readonly job_cost_usd?: unknown;
26
26
  readonly look_back_usd?: unknown;
27
- /** What of its look-back its compile turn spent, when it asked one. */
28
- readonly compile_usd?: unknown;
29
27
  };
30
- /** What a kept row says of a run that looked back (learning-run.ts closeLearning's fields): none for one that did not. */
28
+ /** What a kept row says of a run that looked back (its compile turn's figures): none for one that did not. */
31
29
  declare function answeredOf(row: KeptRow): Pick<Learning, "answered_at" | "job_cost_usd" | "look_back_usd">;
32
- /** The reads of a run's records a learning read makes: its launch, a round of its kept learning, a run's row (its
33
- * learning run's). The store's own reads, one a run, or an agent's read at once (agentRecordsOf). */
30
+ /** The reads of a run's records a learning read makes: its launch, a round of its kept learning, a run's row. The
31
+ * store's own reads, one a run, or an agent's read at once (agentRecordsOf). */
34
32
  export type RunRecords = {
35
33
  /** `learningStart`: a run's learning start read from the agent's one narrow read (agentRecordsOf), when it was; absent, the run's launch is read. */
36
34
  readonly runs: Pick<Store["runs"], "launch" | "get"> & {
@@ -38,17 +36,17 @@ export type RunRecords = {
38
36
  };
39
37
  readonly learning: Pick<Store["learning"], "proposal">;
40
38
  };
41
- /** Agent `agentId`'s runs' records read at once, whatever their number: its runs' launches (Store.runs.launches) and every
42
- * round its runs' learning kept with the learning runs they name (Store.learning.kept), two reads beside `listed` (its
43
- * runs, as runs.list read them). Each answers as the store's per-run read does: a run of `listed` with no launch row is
44
- * StoreLaunchMissing, one that kept no learning has no round. A run not of `listed` is read from the store, but for an
45
- * audit's shadow run: `listed` is every run of the agent, its shadows among them. */
39
+ /** Agent `agentId`'s runs' records read at once, whatever their number: its runs' launches (Store.runs.learningStarts)
40
+ * and every round its runs' learning kept (Store.learning.kept), two reads beside `listed` (its runs, as runs.list read
41
+ * them). Each answers as the store's per-run read does: a run of `listed` with no launch row is StoreLaunchMissing, one
42
+ * that kept no learning has no round. A run not of `listed` is read from the store, but for an audit's shadow run:
43
+ * `listed` is every run of the agent, its shadows among them. */
46
44
  export declare function agentRecordsOf(store: Store, agentId: string, listed: readonly RunRecord[]): Promise<RunRecords>;
47
- /** Run `runId`'s learning end (its newest round's, or round `round`'s); null when the run kept no learning. Proposed while its learning run has not ended. `records`: where its rows are read (the store's per-run reads by default). */
48
- export declare function runLearningEnd(store: Store, runId: string, round?: number, records?: RunRecords): Promise<RunLearningEnd | null>;
45
+ /** Run `runId`'s learning end (its newest round's, or round `round`'s); null when the run kept no learning. `records`:
46
+ * where its rows are read (the store's per-run reads by default). */
47
+ export declare function runLearningEnd(store: Pick<RunRecords, "learning">, runId: string, round?: number, records?: Pick<RunRecords, "learning">): Promise<RunLearningEnd | null>;
49
48
  /** How the runs that tried to learn fared (GET /stats's `learning`): `runs` with a learning end, `merged`, `dropped` by
50
- * reason, and `in_progress` (proposed, its learning run not ended). The shape today's counts give (learning-run.ts
51
- * learningStats). */
49
+ * reason, and `in_progress` (any other state). */
52
50
  export type LearningCounts = {
53
51
  runs: number;
54
52
  merged: number;
@@ -58,13 +56,12 @@ export type LearningCounts = {
58
56
  /** GET /stats's learning counts from the one store, over the runs `filter` picks as the analytics pick them (not archived,
59
57
  * their own or their agent's; started in [from, to); of `agent`): an agentic run with a learning end counts, its end
60
58
  * read as the run's view reads it (runLearningEnd). A workflow's run, and one with no learning, is not counted; nor is
61
- * one whose reason this server does not give (an older server's). An imported run keeps no learning in the store. Each
62
- * agent's runs' records are read at once (agentRecordsOf; `records`, already read for `filter.agent`), never a read a run. */
59
+ * one whose reason this server does not give. An imported run keeps no learning in the store. Each agent's runs'
60
+ * records are read at once (agentRecordsOf; `records`, already read for `filter.agent`), never a read a run. */
63
61
  export declare function learningCountsOverStore(store: Store, filter: AnalyticsFilter, records?: RunRecords): Promise<LearningCounts>;
64
62
  /** What learning spent outside any run (GET /usage's `learning` meter) in [from, to) (ms), one entry per run whose
65
- * learning ended then, as the learning ledger's lines gave it: its agent, when its learning ended, and what its grade
66
- * cost: 0 for a run never graded, null when the grade's spend is unknown (a grade that failed), never $0 then. One read
67
- * of the store (Learning.spend), whatever the number of runs. */
63
+ * learning ended then: its agent, when its learning ended, and what it spent outside the run. One read of the store
64
+ * (Learning.spend), whatever the number of runs. */
68
65
  export declare function learningSpendOverStore(store: Store, window: {
69
66
  from: number;
70
67
  to: number;
@@ -73,32 +70,28 @@ export declare function learningSpendOverStore(store: Store, window: {
73
70
  at: string;
74
71
  cost: number | null;
75
72
  }[]>;
76
- /** An agent's learning counts as its learning view gives them (GET /agents/{id}/learning, learning-run.ts ofAgent's
77
- * counts): how its runs that tried to learn fared, less `runs`, from the one store. Its notes' runs and its impact are
78
- * agentLearningOverStore's. */
73
+ /** An agent's learning counts as its learning view gives them (GET /agents/{id}/learning): how its runs that tried to
74
+ * learn fared, less `runs`, from the one store. */
79
75
  export declare function agentLearningCountsOverStore(store: Store, agentId: string, records?: RunRecords): Promise<Omit<LearningCounts, "runs">>;
80
- /** Agent `agentId`'s learning view from the one store (GET /agents/{id}/learning, learning-run.ts ofAgent): its counts
81
- * (agentLearningCountsOverStore), each note's runs given it and that read it (noteRuns over notesOf), and what learning
82
- * changed (learningImpact), never a run's files. Each run's part is read from its launch (the notes it was given,
83
- * learningStartOf), its journal once final (the notes its job read, notesReadOf) and its learning end (when its job
84
- * answered and what it and looking back cost, its grade's cost). `seed_notes`, the notes a run started from, is its
85
- * launch's seedNotes: every note in its seed, before the budget picked the given ones (main's seed_notes). Its runs'
86
- * launches and learning are read at once (agentRecordsOf), and a settled run's journal once a server (settledCache):
87
- * a read a run only the first time it is seen. */
76
+ /** Agent `agentId`'s learning view from the one store (GET /agents/{id}/learning): its counts (agentLearningCountsOverStore)
77
+ * and what learning changed (learningImpact), never a run's files. Each run's part is read from its launch (the
78
+ * corrections and workflows it started from), its journal (the workflows its claims laid) and its learning end (when its
79
+ * job answered and what it and looking back cost). Its runs' launches and learning are read at once (agentRecordsOf),
80
+ * and a settled run's journal once a server (settledCache). */
88
81
  export declare function agentLearningOverStore(store: Store, agentId: string): Promise<{
89
82
  counts: Omit<LearningCounts, "runs">;
90
83
  impact: Impact;
91
- notes: NoteRuns;
92
84
  }>;
93
85
  /** Agent `agentId`'s cost per run from the one store (GET /agents/{id}/learning/cost, learning-cost.ts): each of its
94
- * agentic runs that ended (ended, stopped or failed), oldest first, numbered from 1, with its own cost and what learning
95
- * added for it (runCostOf over its row's cost and its learning's spend, learningSpendOf), the path it took and the learned workflow it ran
96
- * (its run record's, pathOfRow), and the learned revision it started from (its launch's seed); and what the series shows
97
- * (costSummary). A run still at work, an imported or archived one and a workflow revision's run are left out; a learning
98
- * run (a run's grade and merge) is no run of the list (the store lists none: NOT_A_LEARNING_RUN), and its cost is its
99
- * run's learning. A run that learns whose record names no path (its end's patch was late or failed, or no runner wrote
100
- * its end) is left out too and counted (`unknown_path_runs`): its path and cost are not known, never `agent` at $0.
101
- * `limit`: the latest runs shown, each keeping its number; the summary is over every run. */
86
+ * agentic runs that ended (ended, stopped or failed), oldest first, each run that does a job numbered from 1 (a replay
87
+ * none: the bill's numbering), with its own cost and what learning added for it (runCostOf over its row's cost and its
88
+ * learning's spend, learningSpendOf), the path it took and the learned workflow it ran (its run record's, pathOfRow), the
89
+ * revision of that workflow (metrics.workflow_digest) and whether an audit's shadow ran for it; and what
90
+ * the series shows (costSummary). A run still at work, an imported or archived one and a workflow revision's run are left
91
+ * out. A run that learns whose record names no path (its end's patch was late or failed, or no runner wrote its end) is
92
+ * left out too and counted (`unknown_path_runs`): its path and cost are not known, never `agent` at $0. `limit`: the
93
+ * latest runs shown, each keeping its number; the summary is over every run; `bill` is the owner's bill over all of
94
+ * them (billOf, with the revision ledger: agentLedgerOf). */
102
95
  export declare function agentCostOverStore(store: Store, agentId: string, limit?: number): Promise<{
103
96
  runs: CostRun[];
104
97
  summary: CostSummary;
@@ -109,10 +102,11 @@ export declare function agentCostOverStore(store: Store, agentId: string, limit?
109
102
  bill: Bill;
110
103
  }>;
111
104
  type LedgerRow = Pick<RunRecord, "id" | "metrics" | "startedAt" | "costUsd" | "costAtMostUsd">;
112
- /** A compile turn a run's look-back asked (runner/reflect-hook.ts), as its kept round says it: the revision it drafted
113
- * (`digest`, null when every draft failed its checks or the cap stopped the turn, so it drafted none; `workflow` null for
114
- * the latter, which kept no draft's name) and what its turn spent (`usd`, the round's `compile_usd`: null when unknown;
115
- * 0 for a round that kept no split, whose look-back holds its compile turn). */
105
+ /** A compile turn a run's end-of-run step asked (runner/reflect-hook.ts), as its kept round says it: the revision it
106
+ * drafted (`digest`, null when every draft failed its checks, or the turn was stopped or capped before a draft was kept,
107
+ * so it drafted none; `workflow` null for the latter, which kept no draft's name) and what its turn spent (`usd`, the
108
+ * round's `look_back_usd`: the step's only model turn is its compile turn, so that one figure is the compile's; null when
109
+ * unknown). */
116
110
  export type CompileSpend = {
117
111
  readonly workflow: string | null;
118
112
  readonly digest: string | null;
@@ -131,12 +125,12 @@ export declare function revisionLedgerOf(records: readonly PromotionRecord[], ro
131
125
  /** Run `runId`'s path and its costs as GET /runs/{id} shows them (A8): `path` its record's (metrics.path, RUN_PATHS:
132
126
  * `agent` for a run that does not learn; null while it has not ended, for a workflow revision's run, and for a run that
133
127
  * learns whose end named none); `usd` its own spend, the job's (runCostOf's `cost_usd`: its row's cost, `rowUsd` when
134
- * given, less its look-back and compile turns; null while unknown); `learning_usd` what learning spent for it: its
135
- * look-back less its compile turns, its grades, its audit shadow's cost, and its share of its revision's compile and
136
- * check (revisionLedgerOf); `all_in_usd` the two. A replay or a shadow run carries none: its spend is on the runs it
137
- * serves, so its `learning_usd` and `all_in_usd` are 0, and the sum of every run's `all_in_usd` and the bill's
138
- * `unattributed_usd` is the booked total. While the run is at work `usd` is `rowUsd` and the rest null; null while
139
- * unknown (its shadow still at work, a grade's, a compile's or a check's cost unknown), never $0. Undefined for an
128
+ * given, less its compile turns; null while unknown); `learning_usd` what learning spent for it: its follow-up rounds'
129
+ * turns (learningSpendOf less its compile turns, each its revision's), its audit shadow's cost, and its share of its
130
+ * revision's compile and check (revisionLedgerOf); `all_in_usd` the two. A replay or a shadow run carries none: its
131
+ * spend is on the runs it serves, so its `learning_usd` and `all_in_usd` are 0, and the sum of every run's `all_in_usd`
132
+ * and the bill's `unattributed_usd` is the booked total. While the run is at work `usd` is `rowUsd` and the rest null;
133
+ * null while unknown (its shadow still at work, a compile's or a check's cost unknown), never $0. Undefined for an
140
134
  * unknown run. */
141
135
  export declare function runAllInOverStore(store: Store, runId: string, rowUsd?: number | null): Promise<{
142
136
  path: RunPath | null;
@@ -151,25 +145,19 @@ export declare function runAllInOverStore(store: Store, runId: string, rowUsd?:
151
145
  * on no input (a dry run). */
152
146
  export declare function servingReplayOf(records: readonly PromotionRecord[], runs: readonly CostRun[]): CostReplay | null;
153
147
  /** What run `runId`'s learning spent, as its cost per run counts it, over every round a follow-up opened (roundsOf): what
154
- * it kept as it answered (`looked`: answeredOf), and its grades' spend (`grade`): each round's learning run's cost once
155
- * that run ended, stopped or failed (runner/learning-loop.ts keeps the grade's spend there, a paid grade a person stopped
156
- * included; null when one is unknown), 0 while it runs or when the round queued none. A run a follow-up opened again
157
- * (roundsSpendOf's figures): its job is what it had cost when its first round answered, and everything after (each
158
- * later round's follow-up turn and every round's look-back: feedback the run was given is learning, never the job) is
159
- * its look-back here, `rowUsd` (the run's row cost) less that job (roundsLooked). */
160
- export declare function learningSpendOf(store: RunRecords, runId: string, rowUsd: number | null): Promise<{
161
- looked: ReturnType<typeof answeredOf> | null;
162
- grade: number | null;
163
- }>;
148
+ * it kept as it answered (answeredOf). A run a follow-up opened again (roundsSpendOf's figures): its job is what it had
149
+ * cost when its first round answered, and everything after (each later round's follow-up turn and every round's
150
+ * look-back: feedback the run was given is learning, never the job) is its look-back here, `rowUsd` (the run's row cost)
151
+ * less that job (roundsLooked). */
152
+ export declare function learningSpendOf(store: RunRecords, runId: string, rowUsd: number | null): Promise<ReturnType<typeof answeredOf> | null>;
164
153
  /** Every round run `runId` kept (one a follow-up opened again is a round past its first), oldest first: none when it kept
165
154
  * no learning. The store's proposal(runId) is the newest round alone; a read of what the run's learning did or spent
166
155
  * reads them all. */
167
156
  export declare function roundsOf(store: Pick<RunRecords, "learning">, runId: string): Promise<LearningProposal[]>;
168
157
  type RunRecord = NonNullable<Awaited<ReturnType<Store["runs"]["get"]>>>;
169
- /** A run's own cost and what learning added for it (runCostOf): its row's cost, every round of its learning (a run a
170
- * follow-up opened again, a review's or a person's, learned in rounds: every round's look-back and grade, roundsSpendOf,
171
- * never the newest round's alone), else its one round's (learningSpendOf). `total_usd` is the run's all-in cost, the one
172
- * the cost page shows and the money rule reads (pastRunsOverStore); null when any part is unknown. */
158
+ /** A run's own cost and what learning added for it (runCostOf): its row's cost, every round of its learning
159
+ * (learningSpendOf) and its audit's shadow run (shadowSpendOf). `total_usd` is the run's all-in cost, the one the cost page shows and the money rule reads
160
+ * (pastRunsOverStore); null when any part is unknown. */
173
161
  export declare function allInOf(store: RunRecords, run: RunRecord): Promise<ReturnType<typeof runCostOf>>;
174
162
  /** What run `runId`'s audit shadow run (runner/audit.ts) adds to its all-in cost: `open` while it is queued or running
175
163
  * (its cost not known yet: `usd` null, never $0), else its cost once it ended, stopped or failed (null: unknown); 0 when
@@ -180,14 +168,19 @@ export declare function shadowSpendOf(store: {
180
168
  open: boolean;
181
169
  usd: number | null;
182
170
  }>;
183
- /** One run of the cost series, as number `n` of it: its figures (allInOf) and its path (agentCostOverStore's loop body,
184
- * and a learning batch's row once the run's learning has settled). */
185
- export declare function costRunOf(store: RunRecords, run: RunRecord, n: number): Promise<CostRun>;
171
+ /** One run of the cost series, as number `n` of it (null for a replay): its figures (allInOf), its path, the workflow
172
+ * revision that ran it and whether an audit's shadow ran for it (agentCostOverStore's loop body); `took_over` is the
173
+ * series' (tookOverOf). */
174
+ export declare function costRunOf(store: RunRecords, run: RunRecord, n: number | null): Promise<Omit<CostRun, "took_over">>;
186
175
  /** The runs the money rule reads for agent `agentId` (runner/workflow-first.ts costLineOf), one set for the run's launch
187
176
  * and the cost page: of its newest PAST_RUNS runs, each that ended (ended, stopped or failed), is neither imported nor
188
177
  * archived nor a workflow revision's run, with its all-in cost (allInOf). `known`: all-in costs already read, by run id
189
178
  * (the cost page's series), read again for no run; `records`, where any other's rows are read (the store's by default). */
190
179
  export declare function pastRunsOverStore(store: Store, agentId: string, known?: ReadonlyMap<string, number | null>, records?: RunRecords): Promise<PastRun[]>;
180
+ /** The money rule's decision for agent `agentId` (runner/workflow-first.ts costStopOf) over the runs a run's launch reads
181
+ * (pastRunsOverStore), as the launch reads them: runs that can't be read now stop nothing (workflowFirstOf serves). What
182
+ * the promotions read and the learning view fold into each workflow's state (learn/promote.ts servingStateOf). */
183
+ export declare const costStopOverStore: (store: Store, agentId: string) => Promise<import("../learn/promote.js").CostStop>;
191
184
  /** The path run `runId` took and the learned workflow it ran, the one classifier its run record keeps (metrics.path,
192
185
  * metrics.workflow, metrics.workflow_digest: workflow-first.ts pathMetrics, written at the run's end) and its cost per run
193
186
  * reads (pathOfRow). A run its learned workflow served first (its WORKFLOW_FIRST entry, servedOf): `workflow` when it
@@ -202,23 +195,19 @@ export declare function runPathOverStore(store: Store, runId: string, started: R
202
195
  digest?: string;
203
196
  promotion?: number;
204
197
  }>;
205
- /** What a run's claim laid of its learning seed: the learned skills and workflows it was given, by name. */
198
+ /** What a run's claim laid of its learning seed: the learned workflows it was given, by name. */
206
199
  type Laid = {
207
- readonly skills: readonly string[];
208
200
  readonly workflows: readonly string[];
209
201
  };
210
- /** What every claim of a run laid, from its learningLaid entries, each name once: a resumed claim finds an earlier
211
- * claim's skill folders there already and lays none of them again, though the run still has them. None laid when it has
212
- * no entry. */
202
+ /** What every claim of a run laid, from its learningLaid entries, each name once. None laid when it has no entry. */
213
203
  export declare function laidOf(entries: readonly Pick<EntryLike, "kind" | "data">[]): Laid;
214
204
  /** What every round of a run that a follow-up opened again spent (undefined for a run with one round): when its first
215
- * round's job answered and what the job cost to then, the look-backs of every round added up, and every round's grade. A
216
- * figure that is unknown in any round is unknown (null). */
205
+ * round's job answered and what the job cost to then, and the look-backs of every round added up. A figure that is
206
+ * unknown in any round is unknown (null). */
217
207
  type RoundsSpend = {
218
208
  answered_at: string;
219
209
  job_cost_usd: number | null;
220
210
  look_back_usd: number | null;
221
- grade_usd: number | null;
222
211
  };
223
212
  /** What a run with rounds (`rounds`) kept as it answered, as its cost per run and its impact both read it: its job is
224
213
  * what it had cost when its first round answered; everything its row (`rowUsd`) spent after that (each later round's
@@ -226,35 +215,15 @@ type RoundsSpend = {
226
215
  * unknown when the row's cost is and the job's is known (the request no one priced came after the job answered: a later
227
216
  * round stopped mid-request keeps no figures, so the rounds' sum would read short as if settled); the rounds'
228
217
  * look-backs added up when the job's cost is unknown. */
229
- export declare function roundsLooked(rounds: RoundsSpend, rowUsd: number | null): {
230
- answered_at: string;
231
- job_cost_usd: number | null;
232
- look_back_usd: number | null;
233
- };
218
+ export declare function roundsLooked(rounds: RoundsSpend, rowUsd: number | null): RoundsSpend;
234
219
  export declare function roundsSpendOf(store: RunRecords, runId: string): Promise<RoundsSpend | undefined>;
235
- /** What a run's learning end tells its impact, as ofAgent's learningOf read a held run: how it ended and when, the notes
236
- * it started from; when its job answered and its costs once it looked back (a look-back of 0 for an ended one that did
237
- * not); its grade's cost once it ended (0 when nothing was graded). */
220
+ /** What a run's learning end tells its impact: how it ended and when, the corrections and workflows it started from, when
221
+ * its job answered and its costs once it looked back (a look-back of 0 for an ended one that did not). */
238
222
  export declare function impactLearningOf(end: RunLearningEnd, started: RunLaunch["learning"], laid: Laid | undefined, rounds?: RoundsSpend, rowUsd?: number | null): ImpactLearning;
239
- /** A run's learning end with the notes its start gave it (`given`, when it started from a seed) and those its job read
240
- * (`read`, only when it read one): what a run view and GET /runs/{id}/learning show beside the end. */
241
- export type RunLearning = RunLearningEnd & {
242
- readonly given?: NoteUsed[];
243
- readonly read?: NoteUsed[];
244
- };
245
- /** The notes a run's job read (learning-run.ts noteRead's rule, over the runner's journal rows): its own successful
246
- * `read` calls on a file of its copy of the folder, the end-of-run turn's (`reflect`) left out, keyed on the notes it was
247
- * `given` and named as given. A file it was not given (MEMORY.md, one it wrote, one not in its seed) is not one of them. */
248
- export declare function notesReadOf(given: readonly NoteUsed[] | undefined, reflect: Pick<Reflect, "after" | "until"> | undefined, rows: readonly TimelineEvent[]): NoteUsed[];
249
- /** What a run's job did with the learned skills and workflows its launch offered it (GET /runs/{id}/learning `used`:
250
- * its `skills` and `workflows`, apart from the skills and workflows it learned): each skill, and whether the job read its SKILL.md (a read of `.agents/skills/<name>/SKILL.md`, or a
251
- * harness's own skill tool on it); each learned workflow the job called, by the call's `name` (callArgsOf), how
252
- * many calls and how many failed. The end-of-run turn's rows are left out, as notesRead leaves them. */
223
+ /** What a run's job did with the learned workflows its launch offered it (GET /runs/{id}/learning `used`): each learned
224
+ * workflow the job called, by the call's `name` (callArgsOf), how many calls and how many failed. The end-of-run turn's
225
+ * rows are left out. */
253
226
  export type LearnedUse = {
254
- readonly skills: readonly {
255
- readonly name: string;
256
- readonly read: boolean;
257
- }[];
258
227
  readonly workflows: readonly {
259
228
  readonly name: string;
260
229
  readonly calls: number;
@@ -263,53 +232,33 @@ export type LearnedUse = {
263
232
  };
264
233
  /** Each tool call of a run's journal, by its call's id: its tool and the arguments it was called with, as recorded (pi's
265
234
  * call in its assistant entry, a CLI harness's in its record's call start). A timeline row's input preview is cut and
266
- * for some tools absent, so what a call read or ran is read from these. */
235
+ * for some tools absent, so what a call ran is read from these. */
267
236
  export declare function callArgsOf(entries: readonly EntryLike[]): Map<string, {
268
237
  tool: string;
269
238
  args: Record<string, unknown>;
270
239
  }>;
271
- /** The skills a run's job loaded with a harness's own Skill tool (claude-agent's): a native call, which the CLI's session
272
- * records as a kernel step of its own (`kernel.start` named `tool.Skill`, keyed `tool:<call id>`, then its `kernel.end`)
273
- * and never as a host tool's call record, so no timeline row or callArgsOf entry has it. Each by the name the model
274
- * gave (`agentrun:<name>` or the bare one), only when its step completed, and only outside every end-of-run turn (a
275
- * reopened run's follow-up's loads are the job's). */
276
- export declare function nativeSkillLoads(entries: readonly EntryLike[]): string[];
277
- /** `laid`: what the run's claims laid (laidOf): a skill its launch offered but no claim laid (over the budget, or a name
278
- * the revision's own skill holds, whose copy is the one installed) is not the run's learned skill, whatever it read.
279
- * `loads`: the skills its job loaded with a harness's own Skill tool (nativeSkillLoads), each a read of its SKILL.md. */
280
- export declare function learnedUseOf(started: RunLaunch["learning"], reflect: Pick<Reflect, "after" | "until"> | undefined, rows: readonly TimelineEvent[], args?: ReadonlyMap<string, {
240
+ /** The learned workflows a run's job called (LearnedUse), over its timeline rows less the end-of-run turn's (`reflect`). */
241
+ export declare function learnedUseOf(reflect: Pick<Reflect, "after" | "until"> | undefined, rows: readonly TimelineEvent[], args?: ReadonlyMap<string, {
281
242
  tool: string;
282
243
  args: Record<string, unknown>;
283
- }>, laid?: Pick<Laid, "skills">, loads?: readonly string[]): LearnedUse;
284
- /** `end` with its run's given notes (from its launch's learning start) and the notes its job read. */
285
- export declare function withNotes(end: RunLearningEnd, started: RunLaunch["learning"], read: readonly NoteUsed[]): RunLearning;
244
+ }>): LearnedUse;
286
245
  /** The learning of a run that only uses what its agent learned (`learning: "use"`): seeded while it runs, as a run that
287
246
  * learns is; dropped `use` once it ended, since it is never asked what to keep. */
288
247
  export declare function usedOnly(started: NonNullable<RunLaunch["learning"]>, terminal: boolean, at: string): RunLearningEnd;
289
248
  /** GET /runs/{id}/learning from the one store, in the shape the route gives (learning-routes.ts runLearningBody): the
290
- * run's learning end (runLearningEnd), the notes it was given and the seed it started from as its launch records them,
291
- * what it held for its owner's OK as it stands on its agent's folder's main (`statuses`, learning-routes.ts statusesOf,
292
- * read only when it held something; none: as the merge wrote it), settled once the run is final. Null when the run kept
293
- * no learning. */
249
+ * run's learning end (runLearningEnd) and the seed it started from as its launch records it, what it held for its
250
+ * owner's OK as it stands on its agent's folder's main (`statuses`, learning-routes.ts statusesOf, read only when it held
251
+ * something; none: as the merge wrote it), settled once the run is final. Null when the run kept no learning. */
294
252
  export declare function runLearningOverStore(store: Store, runId: string, shown: Shown, secrets: readonly string[], statuses?: (agentId: string) => Promise<ReadonlyMap<string, ItemStatus> | undefined>): Promise<{
253
+ run: string;
254
+ state: "dropped" | "merged" | "seeded" | "reflecting";
255
+ reason: "cancelled" | "use" | "empty" | "crashed" | "reflect_failed" | "no_budget" | "checker" | "unknown_cost" | "seed_failed" | null;
256
+ detail: string | null;
257
+ at: string;
258
+ workflows: import("../learning.js").LearnedFile[];
259
+ corrections: number;
295
260
  seed: string | null;
296
261
  merged: string | null;
297
- pending: {
298
- file: string;
299
- name: string;
300
- }[];
301
- verdict: {
302
- merge: boolean;
303
- reason: string;
304
- items: {
305
- why: string;
306
- question?: string | undefined;
307
- origin?: "run" | "you" | undefined;
308
- pending?: boolean | undefined;
309
- file: string;
310
- keep: boolean;
311
- }[];
312
- } | null;
313
262
  problems: {
314
263
  detail: string;
315
264
  path?: string | undefined;
@@ -317,7 +266,6 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
317
266
  }[];
318
267
  compiled: {
319
268
  workflow: string;
320
- from_notes: string[];
321
269
  attempts: {
322
270
  ok: boolean;
323
271
  errors: string[];
@@ -326,33 +274,13 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
326
274
  promoted: boolean | null;
327
275
  } | null;
328
276
  draft_errors: string[];
329
- cost_usd: {
330
- grade: number | null;
331
- };
332
- tokens: {
333
- grade: import("../learning.js").Tokens | null;
334
- };
335
277
  used: {
336
- skills: {
337
- name: string;
338
- read: boolean;
339
- }[];
340
278
  workflows: {
341
279
  name: string;
342
280
  calls: number;
343
281
  failed: number;
344
282
  }[];
345
283
  };
346
- given?: NoteUsed[];
347
- read?: NoteUsed[];
348
- learned?: import("../learning.js").NoteLearned[];
349
- skills?: import("../learning.js").LearnedFile[];
350
- workflows?: import("../learning.js").LearnedFile[];
351
- run: string;
352
- state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
353
- reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
354
- detail: string | null;
355
- at: string;
356
284
  } | {
357
285
  graded: {
358
286
  workflow: string | null;
@@ -361,28 +289,19 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
361
289
  graded_at: string;
362
290
  path: "agent" | "workflow" | "replay" | "handed_back" | "audit";
363
291
  workflow_digest: string | null;
364
- feedback: "look_back" | null;
292
+ feedback: "correction" | null;
365
293
  run_id: string;
366
294
  correct: boolean;
367
295
  };
296
+ run: string;
297
+ state: "dropped" | "merged" | "seeded" | "reflecting";
298
+ reason: "cancelled" | "use" | "empty" | "crashed" | "reflect_failed" | "no_budget" | "checker" | "unknown_cost" | "seed_failed" | null;
299
+ detail: string | null;
300
+ at: string;
301
+ workflows: import("../learning.js").LearnedFile[];
302
+ corrections: number;
368
303
  seed: string | null;
369
304
  merged: string | null;
370
- pending: {
371
- file: string;
372
- name: string;
373
- }[];
374
- verdict: {
375
- merge: boolean;
376
- reason: string;
377
- items: {
378
- why: string;
379
- question?: string | undefined;
380
- origin?: "run" | "you" | undefined;
381
- pending?: boolean | undefined;
382
- file: string;
383
- keep: boolean;
384
- }[];
385
- } | null;
386
305
  problems: {
387
306
  detail: string;
388
307
  path?: string | undefined;
@@ -390,7 +309,6 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
390
309
  }[];
391
310
  compiled: {
392
311
  workflow: string;
393
- from_notes: string[];
394
312
  attempts: {
395
313
  ok: boolean;
396
314
  errors: string[];
@@ -399,32 +317,12 @@ export declare function runLearningOverStore(store: Store, runId: string, shown:
399
317
  promoted: boolean | null;
400
318
  } | null;
401
319
  draft_errors: string[];
402
- cost_usd: {
403
- grade: number | null;
404
- };
405
- tokens: {
406
- grade: import("../learning.js").Tokens | null;
407
- };
408
320
  used: {
409
- skills: {
410
- name: string;
411
- read: boolean;
412
- }[];
413
321
  workflows: {
414
322
  name: string;
415
323
  calls: number;
416
324
  failed: number;
417
325
  }[];
418
326
  };
419
- given?: NoteUsed[];
420
- read?: NoteUsed[];
421
- learned?: import("../learning.js").NoteLearned[];
422
- skills?: import("../learning.js").LearnedFile[];
423
- workflows?: import("../learning.js").LearnedFile[];
424
- run: string;
425
- state: "dropped" | "proposed" | "merged" | "seeded" | "reflecting";
426
- reason: "cancelled" | "use" | "empty" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
427
- detail: string | null;
428
- at: string;
429
327
  } | null>;
430
328
  export {};