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

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 (181) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/README.md +221 -31
  3. package/dist/cli.js +42 -8
  4. package/dist/composio-preset.d.ts +4 -3
  5. package/dist/composio-preset.js +12 -4
  6. package/dist/composio-triggers.d.ts +20 -2
  7. package/dist/composio-triggers.js +183 -17
  8. package/dist/computer-lost.d.ts +11 -0
  9. package/dist/computer-lost.js +19 -0
  10. package/dist/computer-record.d.ts +10 -2
  11. package/dist/computer-record.js +50 -18
  12. package/dist/computer-setting.d.ts +1 -0
  13. package/dist/computer-setting.js +2 -2
  14. package/dist/console/assets/index-BUktRvS-.css +1 -0
  15. package/dist/console/assets/index-nB9kTfIN.js +711 -0
  16. package/dist/console/index.html +2 -2
  17. package/dist/decisions.js +0 -4
  18. package/dist/errors.d.ts +1 -0
  19. package/dist/errors.js +3 -0
  20. package/dist/harness-table.d.ts +51 -3
  21. package/dist/harness-table.js +101 -13
  22. package/dist/harness.d.ts +18 -1
  23. package/dist/harness.js +21 -9
  24. package/dist/host.d.ts +12 -10
  25. package/dist/host.js +18 -16
  26. package/dist/import-sources.js +25 -5
  27. package/dist/import-worker.d.ts +3 -0
  28. package/dist/import-worker.js +7 -5
  29. package/dist/import.d.ts +22 -1
  30. package/dist/import.js +141 -28
  31. package/dist/learn/audit.d.ts +123 -0
  32. package/dist/learn/audit.js +159 -0
  33. package/dist/learn/check.d.ts +3 -0
  34. package/dist/learn/check.js +1 -1
  35. package/dist/learn/compile.d.ts +50 -74
  36. package/dist/learn/compile.js +90 -124
  37. package/dist/learn/delete.d.ts +17 -0
  38. package/dist/learn/delete.js +44 -0
  39. package/dist/learn/folder.d.ts +9 -0
  40. package/dist/learn/folder.js +13 -2
  41. package/dist/learn/promote.d.ts +92 -200
  42. package/dist/learn/promote.js +65 -187
  43. package/dist/learn/replay-calls.d.ts +5 -0
  44. package/dist/learn/replay-calls.js +12 -1
  45. package/dist/learn/secrets.d.ts +8 -0
  46. package/dist/learn/secrets.js +12 -0
  47. package/dist/learn/skills.d.ts +4 -0
  48. package/dist/learn/skills.js +19 -5
  49. package/dist/learn/workflow-nodes.d.ts +23 -3
  50. package/dist/learn/workflow-nodes.js +30 -12
  51. package/dist/learned-nodes.d.ts +9 -34
  52. package/dist/learned-nodes.js +11 -23
  53. package/dist/learned-workflow.d.ts +6 -8
  54. package/dist/learned-workflow.js +18 -57
  55. package/dist/learning-batch.d.ts +13 -5
  56. package/dist/learning-batch.js +34 -8
  57. package/dist/learning-cost.d.ts +111 -4
  58. package/dist/learning-cost.js +120 -3
  59. package/dist/learning-evals.d.ts +2 -0
  60. package/dist/learning-evals.js +4 -3
  61. package/dist/learning-routes.d.ts +8 -0
  62. package/dist/learning-routes.js +18 -1
  63. package/dist/learning-setting.d.ts +16 -1
  64. package/dist/learning-setting.js +34 -2
  65. package/dist/learning.d.ts +1 -1
  66. package/dist/listen-first.d.ts +30 -0
  67. package/dist/listen-first.js +115 -0
  68. package/dist/llms.txt +2 -1
  69. package/dist/mcp-servers-store.d.ts +12 -12
  70. package/dist/model.d.ts +8 -4
  71. package/dist/model.js +16 -8
  72. package/dist/openapi.js +203 -87
  73. package/dist/owner.d.ts +8 -0
  74. package/dist/owner.js +11 -0
  75. package/dist/paid-calls.d.ts +6 -0
  76. package/dist/paid-calls.js +11 -1
  77. package/dist/place.d.ts +8 -3
  78. package/dist/place.js +13 -9
  79. package/dist/provider.js +15 -1
  80. package/dist/run-launch.d.ts +6 -3
  81. package/dist/run-launch.js +2 -0
  82. package/dist/run-learning-served.d.ts +1 -1
  83. package/dist/run-model-key.d.ts +64 -0
  84. package/dist/run-model-key.js +147 -0
  85. package/dist/runner/adapter-loop.d.ts +10 -0
  86. package/dist/runner/adapter-loop.js +26 -4
  87. package/dist/runner/adapter-run-spec.d.ts +6 -3
  88. package/dist/runner/adapter-run-spec.js +83 -25
  89. package/dist/runner/adapters/index.d.ts +4 -2
  90. package/dist/runner/adapters/index.js +13 -4
  91. package/dist/runner/audit.d.ts +68 -0
  92. package/dist/runner/audit.js +349 -0
  93. package/dist/runner/beside.d.ts +2 -1
  94. package/dist/runner/beside.js +6 -3
  95. package/dist/runner/claim-secrets.d.ts +49 -0
  96. package/dist/runner/claim-secrets.js +110 -1
  97. package/dist/runner/cli-run-spec.d.ts +2 -1
  98. package/dist/runner/cli-run-spec.js +44 -15
  99. package/dist/runner/commands.d.ts +3 -6
  100. package/dist/runner/feedback-round.d.ts +3 -2
  101. package/dist/runner/feedback-round.js +8 -7
  102. package/dist/runner/harness-loops.js +31 -23
  103. package/dist/runner/journal-kinds.d.ts +5 -7
  104. package/dist/runner/journal-kinds.js +0 -7
  105. package/dist/runner/learning-dispatch.d.ts +0 -16
  106. package/dist/runner/learning-dispatch.js +4 -47
  107. package/dist/runner/learning-end.d.ts +55 -13
  108. package/dist/runner/learning-end.js +128 -44
  109. package/dist/runner/learning-factory.d.ts +1 -1
  110. package/dist/runner/learning-factory.js +1 -4
  111. package/dist/runner/learning-loop.d.ts +2 -38
  112. package/dist/runner/learning-loop.js +8 -116
  113. package/dist/runner/loop-contract.d.ts +6 -0
  114. package/dist/runner/loop-contract.js +4 -0
  115. package/dist/runner/loop.js +6 -2
  116. package/dist/runner/main.d.ts +1 -0
  117. package/dist/runner/main.js +25 -8
  118. package/dist/runner/memory-claim.d.ts +9 -6
  119. package/dist/runner/memory-claim.js +12 -9
  120. package/dist/runner/promotion.d.ts +55 -54
  121. package/dist/runner/promotion.js +232 -585
  122. package/dist/runner/reflect-hook.d.ts +14 -0
  123. package/dist/runner/reflect-hook.js +28 -3
  124. package/dist/runner/runner.js +57 -4
  125. package/dist/runner/store-secrets.js +9 -5
  126. package/dist/runner/workflow-first.d.ts +6 -5
  127. package/dist/runner/workflow-first.js +17 -12
  128. package/dist/runner/workflow-spec.js +10 -2
  129. package/dist/runs-over-store.d.ts +5 -4
  130. package/dist/runs-over-store.js +13 -3
  131. package/dist/sdk/workflows.d.ts +1 -1
  132. package/dist/server.d.ts +64 -50
  133. package/dist/server.js +516 -134
  134. package/dist/store/index.d.ts +2 -2
  135. package/dist/store/index.js +1 -1
  136. package/dist/store/seal.d.ts +20 -2
  137. package/dist/store/seal.js +24 -8
  138. package/dist/store/sqlite/run-launch.d.ts +4 -1
  139. package/dist/store/sqlite/run-launch.js +12 -0
  140. package/dist/store/sqlite/store.d.ts +3 -2
  141. package/dist/store/sqlite/store.js +119 -16
  142. package/dist/store/store.d.ts +41 -3
  143. package/dist/store-reads/analytics.js +11 -1
  144. package/dist/store-reads/learning.d.ts +57 -7
  145. package/dist/store-reads/learning.js +194 -28
  146. package/dist/store-reads/loop.d.ts +4 -39
  147. package/dist/store-reads/loop.js +10 -79
  148. package/dist/store-reads/stats.js +13 -3
  149. package/dist/store-view.d.ts +5 -1
  150. package/dist/store-view.js +12 -1
  151. package/dist/telemetry.d.ts +59 -0
  152. package/dist/telemetry.js +153 -0
  153. package/dist/tool-keys-store.d.ts +1 -1
  154. package/dist/tool-keys.d.ts +2 -2
  155. package/dist/tool-plane.d.ts +12 -12
  156. package/dist/tools.d.ts +11 -11
  157. package/dist/tools.js +18 -5
  158. package/dist/trigger-adapter.d.ts +3 -0
  159. package/dist/trigger-adapters.d.ts +4 -0
  160. package/dist/trigger-adapters.js +13 -0
  161. package/dist/trigger-composio.d.ts +58 -1
  162. package/dist/trigger-composio.js +160 -6
  163. package/dist/triggers.d.ts +4 -0
  164. package/dist/triggers.js +22 -3
  165. package/dist/validate.d.ts +11 -7
  166. package/dist/validate.js +8 -7
  167. package/dist/workspace/computer-for-claim.d.ts +15 -5
  168. package/dist/workspace/computer-for-claim.js +228 -32
  169. package/dist/workspace/resolve-computer.d.ts +8 -2
  170. package/dist/workspace/resolve-computer.js +1 -1
  171. package/dist/workspace/run-tools.d.ts +1 -1
  172. package/dist/workspace/run-tools.js +14 -3
  173. package/package.json +10 -9
  174. package/dist/console/assets/index-C3gNPz58.css +0 -1
  175. package/dist/console/assets/index-DYJ_wj27.js +0 -711
  176. package/dist/learn/general.d.ts +0 -69
  177. package/dist/learn/general.js +0 -75
  178. package/dist/learn/refit.d.ts +0 -48
  179. package/dist/learn/refit.js +0 -264
  180. package/dist/runner/step-guard.d.ts +0 -62
  181. package/dist/runner/step-guard.js +0 -93
@@ -1,6 +1,5 @@
1
1
  import type { Context } from "@earendil-works/chord/context";
2
2
  import type { LearnedWorkflow } from "../learning.js";
3
- import type { GuardRow } from "../learned-nodes.js";
4
3
  import { type RunLaunch } from "../run-launch.js";
5
4
  import { type Store } from "../store/store.js";
6
5
  import { type ReplayCalls, type Skipped } from "../learn/replay-calls.js";
@@ -17,27 +16,24 @@ export declare const REPLAY_DEADLINE_MS: number;
17
16
  export declare const REPLAY_LAUNCH_GRACE_MS: number;
18
17
  export interface PromotionDeps {
19
18
  readonly store: Store;
19
+ /** Why model spend beside the claimed run is skipped (claim-secrets.ts claimSpendOff): a replay check starts runs with
20
+ * no caller's key. Absent: it runs. */
21
+ readonly spendOff?: (what: string) => string | undefined;
20
22
  readonly agentId: string;
21
- /** The run being claimed: never one of its own replay's inputs. Absent: no run is claimed (a person's replay, and its
23
+ /** The run being claimed: never one of its own check's inputs. Absent: no run is claimed (a person's replay, and its
22
24
  * read): no run served first to keep, none whose per_run MCP credentials a replay is handed. */
23
25
  readonly runId?: string;
24
26
  /** The revision the claimed run runs: its replay runs run it too. */
25
27
  readonly revisionId: string;
26
- /** The claimed run's launch: a replay run's is this one with the graded run's input. */
28
+ /** The claimed run's launch: a replay run's is this one with the agent run's input. */
27
29
  readonly launch: RunLaunch;
28
30
  readonly context: Context;
29
31
  readonly log: (line: string) => void;
30
- /** Writes a refit's new workflow text onto the agent's learning folder (a merge as `id`, from the claim's seed); the
31
- * learning commit it landed as, or null when it did not. Absent: no refit is written. */
32
- readonly commit?: (files: {
33
- path: string;
34
- text: string;
35
- }[], reason: string, id: string) => Promise<string | null>;
36
32
  /** The learned workflow `name` as the learning folder held it active at `commit` (a champion's text), or undefined when
37
33
  * it held none by that name. Absent: no champion serves. */
38
34
  readonly champion?: (name: string, commit: string) => Promise<LearnedWorkflow | undefined>;
39
35
  /** The digest of the learned workflow `name` the learning folder's main holds now (the newest revision), or undefined
40
- * when it holds none by that name. Absent: no revision queues behind another's replay. */
36
+ * when it holds none by that name. Absent: every revision is the newest. */
41
37
  readonly newest?: (name: string) => Promise<string | undefined>;
42
38
  /** The learned workflow an earlier claim of this run served first (its WORKFLOW_FIRST entry, answered or handed back:
43
39
  * workflow-first.ts servedOf), or undefined for a run no claim served yet: a run already executing keeps its revision
@@ -54,11 +50,10 @@ export interface PromotionDeps {
54
50
  * they are shortened (decideCheck). */
55
51
  readonly shown: () => Promise<Shown>;
56
52
  }
57
- /** The claim's promotion ports: `folder`, the agent's learning folder where the run's place keeps it, a refit's revision
58
- * written on it as a merge from the claim's seed (a workflow.json changed on main since is a conflict, never written over),
59
- * and a champion read from it at its record's commit, cut of the server's secrets (`shown`) as the claim's lay is; and
60
- * the workflow an earlier claim of this run served (`kept`, from its journal: none on a first claim). */
61
- export declare function claimPromotion(deps: Omit<PromotionDeps, "commit" | "champion" | "kept"> & {
53
+ /** The claim's promotion ports: `folder`, the agent's learning folder where the run's place keeps it, a champion read
54
+ * from it at its record's commit, cut of the server's secrets (`shown`) as the claim's lay is; and the workflow an earlier
55
+ * claim of this run served (`kept`, from its journal: none on a first claim). */
56
+ export declare function claimPromotion(deps: Omit<PromotionDeps, "champion" | "kept"> & {
62
57
  readonly folder: () => LearningFolder;
63
58
  }): PromotionDeps;
64
59
  /** A replay run's claim (launch.replay) of run `runId`, once its first choice is made: refused (ClaimRefused: the run ends
@@ -68,26 +63,26 @@ export declare function claimPromotion(deps: Omit<PromotionDeps, "commit" | "cha
68
63
  * replay's leftover once its revision replays again; one whose workflow is not laid at its digest (the seed could not be
69
64
  * read, the folder moved on) never falls to the agent's path. Any other run: nothing to check. */
70
65
  export declare function replayClaimed(store: Pick<Store, "settings">, agentId: string, runId: string, launch: RunLaunch, choice: FirstChoice): Promise<void>;
71
- /** The workflows a replay run's claim lays (`laid`, the seed lay's): the one it replays record-only (learn/promote.ts
72
- * recordOnly: every guard at the least threshold the DSL takes, so each step's p is read and none hands back on it), or none by that name when
73
- * the laid one is not the digest it replays (the replay then fails, never scoring another revision). Any other run's,
74
- * as laid. */
66
+ /** The workflows a replay run's claim lays (`laid`, the seed lay's): the one it replays, or none by that name when the
67
+ * laid one is not the digest it replays (the replay then fails, never scoring another revision). Any other run's, as laid. */
75
68
  export declare function replayLaid(launch: RunLaunch, laid: readonly LearnedWorkflow[]): LearnedWorkflow[];
76
69
  /** The learned workflows a run's learned_workflow tool runs, once its first choice is made: what serves, never a
77
70
  * revision its promotion has not promoted. The one its first choice served or the money rule stopped (laidFor: its
78
71
  * champion in place of the laid revision) as chosen; any other the records name, its champion (championOf: the laid
79
72
  * text when that is the champion, else its text at its record's commit), and none while nothing of it serves (none
80
- * promoted yet, or the champion held): a revision replaying, queued, held or never decided is never handed to the
81
- * agent to run in its place. One the records never named (no run's input fit it, so no claim asked) runs as laid. A
82
- * replay run's as laid (replayLaid). The records unread: only the chosen one, as the gate leaves a run to its agent. */
73
+ * promoted yet, or the champion held): a revision replaying, held or never decided is never handed to the agent to run
74
+ * in its place. One the records never named (no run's input fit it, so no claim asked) runs as laid. A replay run's as
75
+ * laid (replayLaid). The records unread: only the chosen one, as the gate leaves a run to its agent. */
83
76
  export declare function toolFlowsFor(deps: Pick<PromotionDeps, "store" | "agentId" | "champion" | "log">, launch: RunLaunch, laid: readonly LearnedWorkflow[], choice: FirstChoice): Promise<LearnedWorkflow[]>;
84
77
  /** The gate workflowFirstOf asks (its `promoted`), at every run's claim, a queued run's included: the workflow that serves
85
78
  * this run first. A run already executing keeps the revision an earlier claim of it served (keptFor). Else the laid
86
- * revision (`workflow` at `digest`, the folder's revision as the run's seed holds it) has its promotion moved on (decide:
87
- * a replay started, queued or settled, a dry-run promote), and then servingNow alone says who serves: the champion
88
- * (championOf), the laid text when it is the champion, its own text read from its record's commit when not; undefined
89
- * when none serves (the agent takes the run). A digest's own record never says it serves. */
79
+ * revision (`workflow` at `digest`, the folder's revision as the run's seed holds it) has its check moved on (decide:
80
+ * started, or settled once its runs ended), and then servingNow alone says who serves: the champion (championOf), the
81
+ * laid text when it is the champion, its own text read from its record's commit when not; undefined when none serves
82
+ * (the agent takes the run). A digest's own record never says it serves. */
90
83
  export declare const promotionGate: (deps: PromotionDeps) => Promoted;
84
+ /** The words a hold of a serving revision this release's workflow DSL refuses starts with (holdRefused). */
85
+ export declare const DSL_REFUSES = "this release's workflow DSL refuses it";
91
86
  /** The words a stopped check's record starts with when it had nothing to check its draft on. */
92
87
  export declare const NOTHING_TO_CHECK = "nothing to check it on";
93
88
  /** One input a check ran its draft on: the agent's run (`of`) and its input, the agent's recorded answer, and what the
@@ -100,23 +95,31 @@ type CheckRow = {
100
95
  readonly agent: string | null;
101
96
  readonly outcome: ReplayOutcome;
102
97
  readonly answer: string | null;
103
- readonly guards: readonly GuardRow[];
104
98
  readonly escalated?: string;
105
99
  readonly skipped?: Skipped;
106
100
  readonly unstarted?: true;
107
101
  };
108
102
  /** Decides a check on its rows: each input it ran on (a skipped write is none) agreed when the draft answered it alone
109
- * with the agent's recorded answer (learn/promote.ts sameAnswer), alone when it answered it with no escalate, no failed
110
- * step, and no guard or recorded escalate that hands it back at the workflow's serving `thresholds` (handsBackAt). Promoted (source check) when it clears the bar (checkPasses); else held with the inputs it did not
111
- * agree on, which the agent's next run's compile turn reads as data (its one recompile); a recompile's check that holds
112
- * it too stops: nothing compiles again. No grade, refit, queue or second replay. Kept only while `still` holds of the
113
- * digest's record (the one write: of two claims at once, one decides). */
103
+ * with the agent's recorded answer (learn/promote.ts sameAnswer), alone when it answered it with no escalate and no
104
+ * failed step. Promoted when it clears the bar (checkPasses); else held with the inputs it did not agree on, which the
105
+ * agent's next run's compile turn reads as data (its one recompile); a recompile's check that holds it too stops:
106
+ * nothing compiles again. No grade, refit, queue or second replay. Kept only while `still` holds of the digest's record
107
+ * (the one write: of two claims at once, one decides). */
114
108
  export declare function decideCheck(deps: PromotionDeps, name: string, digest: string, bar: CheckBar, read: {
115
109
  rows: readonly CheckRow[];
116
110
  cost: number | null;
117
111
  outcomes: ReplayOutcomes;
118
112
  unstarted: number;
119
- }, thresholds: ReadonlyMap<string, number>, still: (was: PromotionRecord | undefined) => boolean, extra: Partial<PromotionRecord>): Promise<import("../learn/promote.js").Recorded>;
113
+ }, still: (was: PromotionRecord | undefined) => boolean, extra: Partial<PromotionRecord>): Promise<import("../learn/promote.js").Recorded>;
114
+ /** A run's final answer row, its text whole (its last final answer row that is not its end-of-run turn's), or null: none,
115
+ * or its record could not be read. `turn`: the row of that id instead (the answer an audit is of, runner/audit.ts), so an
116
+ * answer a follow-up gave since is never read for it. */
117
+ export declare function answerRowOf(store: PromotionDeps["store"], runId: string, context: Context, turn?: string): Promise<{
118
+ id: string;
119
+ text: string;
120
+ } | null>;
121
+ /** A run's final answer, whole (answerRowOf's text; `turn`: that row's), or null. */
122
+ export declare const answerOf: (store: PromotionDeps["store"], runId: string, context: Context, turn?: string) => Promise<string | null>;
120
123
  /** Why a replay a person asked for (askReplay) or read (replayView) was refused: `missing`, no such workflow, revision or
121
124
  * replay of the agent (404); `conflict`, the revision cannot replay now (409), in words that say why. */
122
125
  export declare class ReplayRefused extends Error {
@@ -125,7 +128,7 @@ export declare class ReplayRefused extends Error {
125
128
  }
126
129
  /** What a person's replay reads and writes through (POST and GET .../revisions/{digest}/replays): the claim's ports, with
127
130
  * no claimed run. `launchOf`: a run's launch of the agent on `input` as its start makes one now, and the revision it runs
128
- * on: a replay run's is this one with its graded run's input (startReplay), at the revision's learning commit. */
131
+ * on: a replay run's is this one with its agent run's input (startReplay), at the revision's learning commit. */
129
132
  export interface ReplayAsk {
130
133
  readonly store: Store;
131
134
  readonly agentId: string;
@@ -139,26 +142,24 @@ export interface ReplayAsk {
139
142
  }>;
140
143
  readonly now?: () => number;
141
144
  }
142
- /** A replay of `name` at `digest` a person asked for: the claim path's replay (reserve, startReplay), on `inputs`: `held`,
143
- * the graded runs its last replay or hold was decided on (else, with none, the agent's newest REPLAY_INPUTS), or a number,
144
- * the agent's newest that many (each a graded input the workflow fits); with either, the served runs graded wrong it was
145
- * held on (heldOn), which it promotes only once it answered on: the claim's picker (inputsFor). Its runs end as a claim's
146
- * do, and it is decided by the claim path's settle: at a claim that lays the revision, or at its read (replayView).
147
- * Refused (ReplayRefused): no such workflow or revision; one replaying already, or another revision of it replaying (one
148
- * at a time, never queued by a person: a queued revision is one a run's claim found newest); a promoted one (it serves already); fewer than REPLAY_MIN graded inputs it fits (a replay on fewer could
149
- * only hold it: settle scores none of it), refused before anything is reserved; an agent that does not learn here. The
150
- * replay's id and its inputs. */
145
+ /** A check of `name` at `digest` a person asked for: the claim path's check (reserve, startReplay), on `inputs`: `held`,
146
+ * the agent runs its last check ran on (else, with none, the agent's last compile_after completed runs), or a number,
147
+ * the agent's newest that many (each a completed run of its own the workflow fits). Its runs end as a claim's do, and it
148
+ * is decided by settleCheck: at a claim that lays the revision, or at its read (replayView). Refused (ReplayRefused): no
149
+ * such workflow or revision; one replaying already, or another revision of it replaying (one at a time); a promoted one
150
+ * (it serves already); no input it fits (nothing is reserved); an agent that does not learn here. The replay's id and
151
+ * its inputs. */
151
152
  export declare function askReplay(ask: ReplayAsk, name: string, digest: string, inputs: "held" | number): Promise<{
152
153
  replay: string;
153
154
  inputs: number;
154
155
  }>;
155
156
  /** A replay as its read answers it (GET .../replays/{replay_id}). `status`: `running` while its record says replaying,
156
157
  * `done` once promoted or held, `failed` when none of its runs started by its deadline (nothing was replayed; held, its
157
- * `reason` says so). A replay is never cancelled for a newer revision: that one queues behind it. `outcomes`: what its own runs did (outcomesOf), so far
158
- * while it runs, and once decided as its record kept them, whatever the agent's grades kept now; never the thresholds'
159
- * reading (a run answered under its guard's threshold stays answered: `score` hands it back). `score` and `cost_usd`
160
- * the decided record's, else the runs ended so far at the revision's serving thresholds, and null while a run's cost
161
- * is unknown (replayCost). */
158
+ * `reason` says so). `outcomes`: what its own runs did (outcomesOf), so far while it runs, and once decided as its
159
+ * record kept them. `score`: the decided check's numbers in the replay's shape with the agent's own answers as the label
160
+ * (`agree` the inputs the draft answered alone as the agent did, `agent_acc` 1, `wf_acc` those plus the ones handed back,
161
+ * a hand-back being the agent's answer, over the inputs it ran on), zero while it runs. `cost_usd` the decided record's,
162
+ * else the runs ended so far, and null while a run's cost is unknown (replayCost). */
162
163
  type ReplayView = {
163
164
  readonly replay: string;
164
165
  readonly workflow: string;
@@ -171,14 +172,14 @@ type ReplayView = {
171
172
  readonly decided?: "promote" | "hold";
172
173
  readonly reason?: string;
173
174
  };
174
- /** Reads replay `id` of `name` at `digest`, settling it first as a claim of its revision would (the claim path's settle)
175
- * once its runs ended or its deadline passed: it writes only the decision. A read never starts a run: a replay whose
176
- * launch was interrupted (reserved runs never created) reads running until its deadline, then is decided held, read as
177
- * failed, its reason saying none of its runs started and to start it again with POST. So a replay of a revision no claim
178
- * lays (an older, held one) is decided too, and never running forever. Once decided, it reads only its record. Refused
175
+ /** Reads replay `id` of `name` at `digest`, settling it first as a claim of its revision would (settleCheck) once its runs
176
+ * ended or its deadline passed: it writes only the decision. A read never starts a run: a replay whose launch was
177
+ * interrupted (reserved runs never created) reads running until its deadline, then is decided held, read as failed, its
178
+ * reason saying none of its runs started and to start it again with POST. So a replay of a revision no claim lays (an
179
+ * older, held one) is decided too, and never running forever. Once decided, it reads only its record. Refused
179
180
  * (missing) when the agent has no such replay. */
180
181
  export declare function replayView(ask: ReplayAsk, name: string, digest: string, id: string): Promise<ReplayView>;
181
- /** A replay run's call nodes (launch.replay; learn/replay-calls.ts): the graded run's recorded calls, read from its journal
182
+ /** A replay run's call nodes (launch.replay; learn/replay-calls.ts): the agent run's recorded calls, read from its journal
182
183
  * (a CLI's record shaped as pi's), and each tool classed by the claim's MCP pin (`runId`'s, its servers' annotations as
183
184
  * they listed them) or the built-in list. Undefined for any other run. A recording that cannot be read is an empty one:
184
185
  * every write is then skipped, never run. */