@andorra-labs/code 0.1.17 → 0.1.19

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 (313) hide show
  1. package/dist/src/account-jev-savings.d.ts +4 -0
  2. package/dist/src/account-jev-savings.js +92 -0
  3. package/dist/src/acp-agent.js +2 -2
  4. package/dist/src/agent-execution.js +441 -53
  5. package/dist/src/agent-mcp.js +7 -1
  6. package/dist/src/agent-modifiers.js +5 -7
  7. package/dist/src/analytics.d.ts +19 -1
  8. package/dist/src/analytics.js +9 -1
  9. package/dist/src/andorra/entry.js +15 -6
  10. package/dist/src/andorra/errors.js +3 -0
  11. package/dist/src/andorra/hosted.d.ts +8 -0
  12. package/dist/src/andorra/hosted.js +22 -3
  13. package/dist/src/andorra/streams.d.ts +49 -0
  14. package/dist/src/andorra/streams.js +98 -0
  15. package/dist/src/antigravity-acp.d.ts +28 -0
  16. package/dist/src/antigravity-acp.js +150 -0
  17. package/dist/src/antigravity-terminal.d.ts +2 -0
  18. package/dist/src/antigravity-terminal.js +214 -0
  19. package/dist/src/app-server/adaptive-routing-settings.d.ts +37 -0
  20. package/dist/src/app-server/adaptive-routing-settings.js +69 -0
  21. package/dist/src/app-server/artifact.d.ts +14 -0
  22. package/dist/src/app-server/artifact.js +46 -0
  23. package/dist/src/app-server/legal-protocol.d.ts +33 -0
  24. package/dist/src/app-server/legal-protocol.js +16 -0
  25. package/dist/src/app-server/protocol.d.ts +34 -3
  26. package/dist/src/app-server/protocol.js +3 -1
  27. package/dist/src/app-server/telemetry-protocol.d.ts +53 -0
  28. package/dist/src/app-server/telemetry-protocol.js +2 -0
  29. package/dist/src/app-server/telemetry.d.ts +38 -0
  30. package/dist/src/app-server/telemetry.js +163 -0
  31. package/dist/src/app-server/workspace.d.ts +21 -0
  32. package/dist/src/app-server/workspace.js +192 -10
  33. package/dist/src/app-server.d.ts +82 -26
  34. package/dist/src/app-server.js +1573 -417
  35. package/dist/src/attachments.d.ts +10 -0
  36. package/dist/src/attachments.js +102 -7
  37. package/dist/src/auth/AuthManager.d.ts +11 -2
  38. package/dist/src/auth/AuthManager.js +56 -13
  39. package/dist/src/auth/index.d.ts +5 -1
  40. package/dist/src/auth/index.js +8 -1
  41. package/dist/src/auth/lifecycle.d.ts +13 -0
  42. package/dist/src/auth/lifecycle.js +109 -0
  43. package/dist/src/auth/store.d.ts +1 -0
  44. package/dist/src/auth/store.js +12 -0
  45. package/dist/src/auth/types.d.ts +12 -0
  46. package/dist/src/automation-runner.js +2 -0
  47. package/dist/src/automation-service.js +7 -2
  48. package/dist/src/automation-tool.js +2 -1
  49. package/dist/src/benchmark-scores.d.ts +88 -0
  50. package/dist/src/benchmark-scores.js +302 -0
  51. package/dist/src/bridge/command.js +16 -1
  52. package/dist/src/bridge/control.d.ts +3 -1
  53. package/dist/src/bridge/control.js +9 -3
  54. package/dist/src/bridge/engines.d.ts +2 -0
  55. package/dist/src/bridge/engines.js +9 -0
  56. package/dist/src/bridge/github.d.ts +108 -0
  57. package/dist/src/bridge/github.js +378 -0
  58. package/dist/src/bridge/host-ops.d.ts +3 -3
  59. package/dist/src/bridge/host-ops.js +14 -2
  60. package/dist/src/bridge/host.d.ts +2 -0
  61. package/dist/src/bridge/host.js +70 -16
  62. package/dist/src/bridge/protocol.d.ts +1 -0
  63. package/dist/src/bridge/protocol.js +1 -0
  64. package/dist/src/browser-panel-tool.d.ts +12 -0
  65. package/dist/src/browser-panel-tool.js +30 -3
  66. package/dist/src/browser-runner.js +53 -62
  67. package/dist/src/browser-server.js +10 -4
  68. package/dist/src/browser-session.d.ts +14 -0
  69. package/dist/src/browser-session.js +57 -12
  70. package/dist/src/browser-view.d.ts +40 -1
  71. package/dist/src/browser-view.js +163 -9
  72. package/dist/src/browser-window-style.d.ts +27 -0
  73. package/dist/src/browser-window-style.js +244 -0
  74. package/dist/src/bug-report-attachments.d.ts +48 -0
  75. package/dist/src/bug-report-attachments.js +327 -0
  76. package/dist/src/bug-report.d.ts +23 -3
  77. package/dist/src/bug-report.js +72 -9
  78. package/dist/src/claude-provider.d.ts +1 -0
  79. package/dist/src/claude-provider.js +77 -36
  80. package/dist/src/cli.d.ts +1 -3
  81. package/dist/src/cli.js +245 -62
  82. package/dist/src/codex-provider.d.ts +1 -0
  83. package/dist/src/codex-provider.js +44 -8
  84. package/dist/src/coding-tools.d.ts +1 -0
  85. package/dist/src/coding-tools.js +28 -7
  86. package/dist/src/command-screens.d.ts +1 -1
  87. package/dist/src/command-screens.js +2 -2
  88. package/dist/src/commands.d.ts +9 -2
  89. package/dist/src/commands.js +69 -64
  90. package/dist/src/completion.js +13 -7
  91. package/dist/src/config.d.ts +14 -3
  92. package/dist/src/config.js +57 -17
  93. package/dist/src/context-budget.d.ts +11 -2
  94. package/dist/src/context-budget.js +38 -4
  95. package/dist/src/context-compaction.d.ts +10 -8
  96. package/dist/src/context-compaction.js +23 -24
  97. package/dist/src/deadline.js +1 -1
  98. package/dist/src/decision/DecisionEngine.d.ts +2 -0
  99. package/dist/src/decision/DecisionManager.d.ts +16 -0
  100. package/dist/src/decision/DecisionManager.js +75 -2
  101. package/dist/src/decision/applyTaskKind.d.ts +8 -0
  102. package/dist/src/decision/applyTaskKind.js +53 -0
  103. package/dist/src/decision/applyToolMenu.js +6 -2
  104. package/dist/src/decision/hostedPolicy.js +6 -3
  105. package/dist/src/decision/optimizationPolicy.d.ts +10 -0
  106. package/dist/src/decision/optimizationPolicy.js +23 -3
  107. package/dist/src/decision/providers/AndorraDecisionProvider.d.ts +4 -1
  108. package/dist/src/decision/providers/AndorraDecisionProvider.js +29 -7
  109. package/dist/src/decision/providers/index.js +1 -1
  110. package/dist/src/decision/taskKind.d.ts +52 -0
  111. package/dist/src/decision/taskKind.js +76 -0
  112. package/dist/src/decision/toolFamilies.js +1 -1
  113. package/dist/src/decision/types.d.ts +3 -1
  114. package/dist/src/default-graph.js +1 -1
  115. package/dist/src/efficiency.d.ts +80 -1
  116. package/dist/src/efficiency.js +119 -4
  117. package/dist/src/effort-routing.d.ts +27 -0
  118. package/dist/src/effort-routing.js +34 -0
  119. package/dist/src/evidence.d.ts +110 -0
  120. package/dist/src/evidence.js +195 -0
  121. package/dist/src/extensions.d.ts +2 -0
  122. package/dist/src/extensions.js +30 -20
  123. package/dist/src/github-app/agent-writes.d.ts +1 -1
  124. package/dist/src/github-app/agent-writes.js +1 -1
  125. package/dist/src/github-app/client.d.ts +19 -0
  126. package/dist/src/github-app/client.js +21 -1
  127. package/dist/src/github-app/event-source.d.ts +0 -5
  128. package/dist/src/github-app/event-source.js +1 -31
  129. package/dist/src/github-app/metrics.d.ts +2 -5
  130. package/dist/src/github-app/metrics.js +2 -14
  131. package/dist/src/github-app/review-loop.d.ts +5 -5
  132. package/dist/src/github-app/review-loop.js +1 -1
  133. package/dist/src/github-app/review-node.d.ts +2 -2
  134. package/dist/src/github-app/triggers.d.ts +3 -3
  135. package/dist/src/github-names.d.ts +7 -0
  136. package/dist/src/github-names.js +7 -0
  137. package/dist/src/glob-search.d.ts +1 -0
  138. package/dist/src/glob-search.js +3 -0
  139. package/dist/src/google-provider.d.ts +5 -28
  140. package/dist/src/google-provider.js +6 -141
  141. package/dist/src/graph-editor-session.d.ts +1 -0
  142. package/dist/src/graph-editor-session.js +2 -0
  143. package/dist/src/graph-health.js +3 -1
  144. package/dist/src/graph-preview.d.ts +2 -0
  145. package/dist/src/graph-preview.js +1 -0
  146. package/dist/src/graph-runner.js +20 -14
  147. package/dist/src/graph-selection.d.ts +3 -1
  148. package/dist/src/graph-selection.js +2 -2
  149. package/dist/src/graph-server.d.ts +8 -1
  150. package/dist/src/graph-server.js +49 -12
  151. package/dist/src/graph-sync.d.ts +2 -1
  152. package/dist/src/graph-sync.js +13 -0
  153. package/dist/src/graph-ui/app.js +49 -8
  154. package/dist/src/graph-ui/index.html +1 -1
  155. package/dist/src/graphs.d.ts +23 -1
  156. package/dist/src/graphs.js +58 -7
  157. package/dist/src/grok-provider.js +17 -14
  158. package/dist/src/hardened-runtime.js +39 -25
  159. package/dist/src/jev-savings.d.ts +4 -0
  160. package/dist/src/jev-savings.js +13 -0
  161. package/dist/src/legal/client.d.ts +25 -0
  162. package/dist/src/legal/client.js +47 -0
  163. package/dist/src/legal/command.d.ts +13 -0
  164. package/dist/src/legal/command.js +98 -0
  165. package/dist/src/legal/documents.d.ts +2 -0
  166. package/dist/src/legal/documents.js +14 -0
  167. package/dist/src/legal/gate.d.ts +13 -0
  168. package/dist/src/legal/gate.js +96 -0
  169. package/dist/src/legal/manifest.d.ts +21 -0
  170. package/dist/src/legal/manifest.js +23 -0
  171. package/dist/src/legal/receipt.d.ts +13 -0
  172. package/dist/src/legal/receipt.js +137 -0
  173. package/dist/src/legal/release.d.ts +27 -0
  174. package/dist/src/legal/release.js +28 -0
  175. package/dist/src/managed-sign-in.d.ts +0 -1
  176. package/dist/src/managed-sign-in.js +0 -13
  177. package/dist/src/membership.d.ts +27 -1
  178. package/dist/src/membership.js +139 -7
  179. package/dist/src/model-health-cache.js +1 -1
  180. package/dist/src/model-metadata.js +3 -7
  181. package/dist/src/model-override.d.ts +2 -1
  182. package/dist/src/model-override.js +9 -0
  183. package/dist/src/model-pool.d.ts +99 -0
  184. package/dist/src/model-pool.js +136 -0
  185. package/dist/src/model-relay/local.js +5 -0
  186. package/dist/src/model-relay/remote.d.ts +2 -0
  187. package/dist/src/model-relay/remote.js +4 -0
  188. package/dist/src/model-tiers.d.ts +16 -1
  189. package/dist/src/model-tiers.js +31 -7
  190. package/dist/src/opencode-cli-provider.js +59 -56
  191. package/dist/src/opencode-provider.js +16 -13
  192. package/dist/src/permissions.d.ts +5 -0
  193. package/dist/src/permissions.js +7 -0
  194. package/dist/src/plan-pass.js +2 -1
  195. package/dist/src/pool-scores.d.ts +45 -0
  196. package/dist/src/pool-scores.js +40 -0
  197. package/dist/src/provider-connection.js +3 -17
  198. package/dist/src/provider-engine.d.ts +13 -1
  199. package/dist/src/provider-engine.js +116 -12
  200. package/dist/src/provider-request-error.d.ts +8 -0
  201. package/dist/src/provider-request-error.js +12 -0
  202. package/dist/src/provider-settings.d.ts +1 -1
  203. package/dist/src/provider-settings.js +36 -18
  204. package/dist/src/provider-turn-deadline.d.ts +39 -0
  205. package/dist/src/provider-turn-deadline.js +139 -0
  206. package/dist/src/providers.d.ts +8 -9
  207. package/dist/src/providers.js +211 -150
  208. package/dist/src/pull-request-merge.d.ts +1 -8
  209. package/dist/src/pull-request-merge.js +0 -4
  210. package/dist/src/pull-requests.d.ts +83 -57
  211. package/dist/src/pull-requests.js +266 -225
  212. package/dist/src/qa/runtime/ProcessManager.d.ts +5 -1
  213. package/dist/src/qa/runtime/ProcessManager.js +9 -3
  214. package/dist/src/react-runtime.js +245 -71
  215. package/dist/src/reasoning-probe-cloud.d.ts +10 -0
  216. package/dist/src/reasoning-probe-cloud.js +209 -0
  217. package/dist/src/remote/engine-pool.d.ts +3 -0
  218. package/dist/src/remote/engine-pool.js +88 -21
  219. package/dist/src/remote/recovery.d.ts +6 -0
  220. package/dist/src/remote/recovery.js +37 -0
  221. package/dist/src/run-records.d.ts +13 -3
  222. package/dist/src/run-records.js +59 -34
  223. package/dist/src/runtime.d.ts +47 -2
  224. package/dist/src/runtime.js +33 -7
  225. package/dist/src/session-summary.d.ts +8 -0
  226. package/dist/src/session-summary.js +34 -0
  227. package/dist/src/sessions.d.ts +32 -0
  228. package/dist/src/sessions.js +65 -3
  229. package/dist/src/shell.js +6 -0
  230. package/dist/src/side-panel.js +36 -2
  231. package/dist/src/sign-in-detection.d.ts +1 -1
  232. package/dist/src/sign-in-detection.js +4 -10
  233. package/dist/src/sign-in-offer.js +1 -1
  234. package/dist/src/skill-commands.js +1 -1
  235. package/dist/src/skills/bundled/bug-report/SKILL.md +51 -7
  236. package/dist/src/skills/bundled/graph-manager/SKILL.md +2 -2
  237. package/dist/src/skills/bundled/graph-manager/patterns.md +13 -19
  238. package/dist/src/skills/bundled/provenance.json +3 -3
  239. package/dist/src/subagent-run.js +50 -50
  240. package/dist/src/subscription-usage.d.ts +50 -0
  241. package/dist/src/subscription-usage.js +92 -0
  242. package/dist/src/task-checkout.d.ts +157 -0
  243. package/dist/src/task-checkout.js +628 -0
  244. package/dist/src/telemetry/access.d.ts +18 -0
  245. package/dist/src/telemetry/access.js +43 -0
  246. package/dist/src/telemetry/aggregate.d.ts +18 -2
  247. package/dist/src/telemetry/aggregate.js +22 -9
  248. package/dist/src/telemetry/capture-core.d.ts +33 -14
  249. package/dist/src/telemetry/capture-core.js +124 -25
  250. package/dist/src/telemetry/capture.d.ts +3 -2
  251. package/dist/src/telemetry/capture.js +21 -1
  252. package/dist/src/telemetry/decision-capture.js +4 -0
  253. package/dist/src/telemetry/emitter.d.ts +6 -7
  254. package/dist/src/telemetry/emitter.js +124 -29
  255. package/dist/src/telemetry/gate.d.ts +41 -2
  256. package/dist/src/telemetry/gate.js +89 -4
  257. package/dist/src/telemetry/home.d.ts +1 -0
  258. package/dist/src/telemetry/home.js +20 -0
  259. package/dist/src/telemetry/identity.d.ts +6 -3
  260. package/dist/src/telemetry/identity.js +19 -6
  261. package/dist/src/telemetry/lifecycle.d.ts +8 -0
  262. package/dist/src/telemetry/lifecycle.js +76 -0
  263. package/dist/src/telemetry/outbox.d.ts +13 -8
  264. package/dist/src/telemetry/outbox.js +68 -12
  265. package/dist/src/telemetry/permission-command.d.ts +38 -0
  266. package/dist/src/telemetry/permission-command.js +208 -0
  267. package/dist/src/telemetry/permission.d.ts +168 -0
  268. package/dist/src/telemetry/permission.js +662 -0
  269. package/dist/src/telemetry/record-installation.d.ts +1 -0
  270. package/dist/src/telemetry/record-installation.js +9 -0
  271. package/dist/src/telemetry/region-data.d.ts +12 -0
  272. package/dist/src/telemetry/region-data.js +1314 -0
  273. package/dist/src/telemetry/region.d.ts +34 -0
  274. package/dist/src/telemetry/region.js +87 -0
  275. package/dist/src/telemetry/run-privacy.d.ts +11 -0
  276. package/dist/src/telemetry/run-privacy.js +165 -0
  277. package/dist/src/telemetry/schema.d.ts +27 -6
  278. package/dist/src/telemetry/schema.js +109 -14
  279. package/dist/src/telemetry/state.d.ts +11 -7
  280. package/dist/src/telemetry/state.js +39 -6
  281. package/dist/src/telemetry/surface.d.ts +20 -3
  282. package/dist/src/telemetry/surface.js +71 -15
  283. package/dist/src/telemetry/uploader.d.ts +6 -11
  284. package/dist/src/telemetry/uploader.js +72 -46
  285. package/dist/src/telemetry/uploads.d.ts +5 -1
  286. package/dist/src/telemetry/uploads.js +25 -6
  287. package/dist/src/telemetry/version.d.ts +5 -0
  288. package/dist/src/telemetry/version.js +34 -0
  289. package/dist/src/telemetry/workspace.d.ts +4 -1
  290. package/dist/src/telemetry/workspace.js +18 -3
  291. package/dist/src/terminal-ui.d.ts +3 -0
  292. package/dist/src/terminal-ui.js +48 -6
  293. package/dist/src/test-edit-guard.d.ts +30 -0
  294. package/dist/src/test-edit-guard.js +167 -2
  295. package/dist/src/thinking-level-detect.d.ts +13 -0
  296. package/dist/src/thinking-level-detect.js +52 -0
  297. package/dist/src/thinking-levels.d.ts +30 -0
  298. package/dist/src/thinking-levels.js +131 -0
  299. package/dist/src/timers.d.ts +3 -0
  300. package/dist/src/todos.d.ts +2 -1
  301. package/dist/src/todos.js +24 -4
  302. package/dist/src/tool-argument-coercion.d.ts +7 -0
  303. package/dist/src/tool-argument-coercion.js +49 -0
  304. package/dist/src/tool-catalog.d.ts +2 -2
  305. package/dist/src/tool-catalog.js +1 -1
  306. package/dist/src/tools.js +67 -22
  307. package/dist/src/transcript.js +3 -2
  308. package/dist/src/types.d.ts +48 -1
  309. package/dist/src/update.js +4 -0
  310. package/dist/src/usage-analytics.d.ts +7 -0
  311. package/dist/src/usage-analytics.js +85 -13
  312. package/dist/telemetry-consent-v1 +1 -0
  313. package/package.json +97 -96
@@ -1,6 +1,8 @@
1
1
  export interface ModelTierTarget {
2
2
  provider: string;
3
3
  model?: string;
4
+ /** The thinking level the tier runs at. Without one it is chosen from the model's `scores`, when its levels are scored. */
5
+ effort?: PoolEffort;
4
6
  }
5
7
  export interface ModelPricing {
6
8
  inputPerMillionUsd: number;
@@ -16,6 +18,61 @@ export interface AdaptiveRoutingConfig {
16
18
  };
17
19
  maxEscalations?: number;
18
20
  pricing?: Record<string, ModelPricing>;
21
+ /** `tiers` (the default) routes by the three tiers; `pool` routes by scored pairs and subscription usage. */
22
+ strategy?: 'tiers' | 'pool';
23
+ /** Pool only. `shadow` records the decision and changes nothing; `enforce` (the default) applies it. */
24
+ mode?: 'shadow' | 'enforce';
25
+ pool?: PoolEntry[];
26
+ /** Pool only. The score a pair must reach for each task class, replacing the defaults. */
27
+ classScores?: Partial<Record<PoolClass, number>>;
28
+ quota?: PoolQuotaConfig;
29
+ /**
30
+ * Subagents that would inherit the parent's model get their own routing decision, under either strategy and also when
31
+ * the run's own model was chosen. A model a graph names for a subagent or its node is kept.
32
+ */
33
+ subagents?: boolean;
34
+ /**
35
+ * Pool only. `listed` (the default) routes among the `pool` pairs. `all` also routes among every model of every
36
+ * configured provider that has an entry in `scores`, at each thinking level scored for it.
37
+ */
38
+ candidates?: 'listed' | 'all';
39
+ /** Scores by `provider/model`, written by the refresh action or by hand. */
40
+ scores?: Record<string, ModelScore>;
41
+ /** When the refresh action last wrote `scores` (ISO 8601). */
42
+ scoresUpdatedAt?: string;
43
+ }
44
+ export declare const POOL_CLASSES: readonly ["routine", "quick", "standard", "deep", "escalated"];
45
+ export type PoolClass = typeof POOL_CLASSES[number];
46
+ export declare const DEFAULT_POOL_CLASS_SCORES: Readonly<Record<PoolClass, number>>;
47
+ export declare const POOL_EFFORTS: readonly ["none", "minimal", "low", "medium", "high", "xhigh", "max"];
48
+ export type PoolEffort = typeof POOL_EFFORTS[number];
49
+ /** The most `scores` entries a configuration may hold. */
50
+ export declare const MAX_POOL_SCORES = 512;
51
+ /** One pair the pool router may select. The score and the cost are the user's own figures; the runtime rates no model. */
52
+ export interface PoolEntry {
53
+ provider: string;
54
+ model?: string;
55
+ /** The thinking level the pair runs at; without one the pair runs at the provider's saved level. */
56
+ effort?: typeof POOL_EFFORTS[number];
57
+ /** 0 to 100, compared with the class scores. */
58
+ quality: number;
59
+ /** Relative cost per task, in any one unit across the pool. Without one, a higher score is taken to cost more. */
60
+ cost?: number;
61
+ }
62
+ export interface PoolQuotaConfig {
63
+ /** A subscription with this share or less of any usage window left is not selected. Default 5. */
64
+ reservePercent?: number;
65
+ /** Pairs whose cost is within this share of the cheapest count as equal. Default 10. */
66
+ nearTiePercent?: number;
67
+ }
68
+ /** A score from 0 to 100, compared with the class scores, and an optional relative cost per task. */
69
+ export interface PairScore {
70
+ quality: number;
71
+ cost?: number;
72
+ }
73
+ /** One model's score: at the provider's saved thinking level, and at each level scored on its own under `efforts`. */
74
+ export interface ModelScore extends PairScore {
75
+ efforts?: Partial<Record<PoolEffort, PairScore>>;
19
76
  }
20
77
  export interface ToolMenuRoutingConfig {
21
78
  mode?: 'off' | 'shadow' | 'lean';
@@ -23,12 +80,17 @@ export interface ToolMenuRoutingConfig {
23
80
  minSavingsChars?: number;
24
81
  pinnedTools?: string[];
25
82
  }
83
+ /** off: no call. shadow: classify and record, change nothing. on: note the first message and check the finish. Unset: on for a Paid account, off otherwise. */
84
+ export interface TaskKindRoutingConfig {
85
+ mode?: 'off' | 'shadow' | 'on';
86
+ }
26
87
  export interface EfficiencyConfig {
27
88
  deterministicContinuations?: boolean;
28
89
  jevFactInterpretation?: boolean;
29
90
  jevPreflight?: boolean;
30
91
  projectSkillDiscovery?: boolean;
31
92
  toolMenuRouting?: ToolMenuRoutingConfig;
93
+ taskKindRouting?: TaskKindRoutingConfig;
32
94
  preparedContinuations?: boolean;
33
95
  postflightOnlyWithCandidates?: boolean;
34
96
  toolResultFiltering?: boolean;
@@ -57,6 +119,23 @@ export interface ResolvedEfficiency {
57
119
  };
58
120
  }
59
121
  export declare function resolveEfficiency(config: EfficiencyConfig | undefined): ResolvedEfficiency;
60
- export declare const EFFICIENCY_REASONS: readonly ["deterministic_continuation", "jev_selected", "no_candidates", "no_actionable_decision", "stale_task", "stale_permissions", "catalog_mismatch", "blocked", "denied", "invalid_arguments", "automatic_limit", "batch_failed", "batch_succeeded", "filtered", "below_threshold", "unknown_format", "protected_tool", "error_output", "expanded", "expansion_rejected", "empty_workspace", "index_unavailable", "memory_unavailable", "selected", "duplicate", "changed", "fallback", "economy", "balanced", "premium", "baseline", "pinned", "unconfigured", "low_confidence", "risk", "escalated", "escalation_limit", "omitted", "restored", "historical", "explicit"];
122
+ export declare const EFFICIENCY_REASONS: readonly ["deterministic_continuation", "jev_selected", "no_candidates", "no_actionable_decision", "stale_task", "stale_permissions", "catalog_mismatch", "blocked", "denied", "invalid_arguments", "automatic_limit", "batch_failed", "batch_succeeded", "filtered", "below_threshold", "unknown_format", "protected_tool", "error_output", "expanded", "expansion_rejected", "empty_workspace", "index_unavailable", "memory_unavailable", "selected", "duplicate", "changed", "fallback", "economy", "balanced", "premium", "baseline", "pinned", "unconfigured", "low_confidence", "risk", "escalated", "escalation_limit", "omitted", "restored", "historical", "explicit", "routine", "quick", "standard", "deep", "no_candidate", "quota_reserve"];
61
123
  export type EfficiencyReason = typeof EFFICIENCY_REASONS[number];
124
+ /** The key of a model in `adaptiveRouting.scores`. A provider id holds no slash, so the first one divides the two. */
125
+ export declare const poolScoreKey: (provider: string, model: string) => string;
126
+ /**
127
+ * The pairs pool routing chooses among. With `candidates: listed` they are the `pool` as written. With `all`, every
128
+ * model of every configured provider that has a score is added: one pair per scored thinking level the model takes
129
+ * (`levels`, when given, names the levels it takes), or one pair at the provider's saved level when none is scored.
130
+ * A model the `pool` names keeps the pairs written for it. `unscored` counts the configured models left out for want
131
+ * of a score.
132
+ */
133
+ export declare function poolEntries(routing: Pick<AdaptiveRoutingConfig, 'pool' | 'candidates' | 'scores'>, configured: readonly {
134
+ id: string;
135
+ model?: string;
136
+ models?: readonly string[];
137
+ }[], levels?: (provider: string, model: string) => readonly string[] | undefined): {
138
+ entries: PoolEntry[];
139
+ unscored: number;
140
+ };
62
141
  export {};
@@ -1,3 +1,8 @@
1
+ export const POOL_CLASSES = ['routine', 'quick', 'standard', 'deep', 'escalated'];
2
+ export const DEFAULT_POOL_CLASS_SCORES = { routine: 29, quick: 38, standard: 50, deep: 55, escalated: 60 };
3
+ export const POOL_EFFORTS = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
4
+ /** The most `scores` entries a configuration may hold. */
5
+ export const MAX_POOL_SCORES = 512;
1
6
  export const EFFICIENCY_FEATURES = ['preparedContinuations', 'postflightOnlyWithCandidates', 'toolResultFiltering', 'contextSelection', 'catalogSelection'];
2
7
  export const DEFAULT_TOOL_RESULT_FILTER_THRESHOLD = 6000;
3
8
  const TIERS = ['economy', 'balanced', 'premium'];
@@ -6,18 +11,20 @@ const record = (value) => !!value && typeof value === 'object' && !Array.isArray
6
11
  const identifier = (value, max) => typeof value === 'string' && value.trim().length > 0 && value.length <= max && !/[\r\n]/.test(value);
7
12
  const price = (value) => typeof value === 'number' && Number.isFinite(value) && value >= 0;
8
13
  function validateTarget(value, label) {
9
- if (!record(value) || Object.keys(value).some(key => !['provider', 'model'].includes(key)))
14
+ if (!record(value) || Object.keys(value).some(key => !['provider', 'model', 'effort'].includes(key)))
10
15
  throw new Error(`Invalid efficiency.adaptiveRouting.tiers.${label}`);
11
16
  if (!/^[\w-]+$/.test(String(value.provider ?? '')))
12
17
  throw new Error(`efficiency.adaptiveRouting.tiers.${label}.provider must name a configured provider id`);
13
18
  if (value.model !== undefined && !identifier(value.model, 500))
14
19
  throw new Error(`Invalid efficiency.adaptiveRouting.tiers.${label}.model`);
20
+ if (value.effort !== undefined && !POOL_EFFORTS.includes(value.effort))
21
+ throw new Error(`efficiency.adaptiveRouting.tiers.${label}.effort must be one of ${POOL_EFFORTS.join(', ')}`);
15
22
  }
16
23
  export function validateEfficiencyConfig(value) {
17
24
  if (!record(value))
18
25
  throw new Error('Invalid efficiency configuration');
19
26
  const independent = ['deterministicContinuations', 'jevFactInterpretation', 'jevPreflight', 'projectSkillDiscovery'];
20
- const allowed = [...EFFICIENCY_FEATURES, ...independent, 'toolResultFilterThresholdChars', 'adaptiveRouting', 'toolMenuRouting'];
27
+ const allowed = [...EFFICIENCY_FEATURES, ...independent, 'toolResultFilterThresholdChars', 'adaptiveRouting', 'toolMenuRouting', 'taskKindRouting'];
21
28
  for (const [key, entry] of Object.entries(value)) {
22
29
  if (!allowed.includes(key))
23
30
  throw new Error(`Unsupported efficiency configuration field: ${key}`);
@@ -27,6 +34,10 @@ export function validateEfficiencyConfig(value) {
27
34
  const threshold = value.toolResultFilterThresholdChars;
28
35
  if (threshold !== undefined && (!Number.isSafeInteger(threshold) || threshold < 1000 || threshold > 1_000_000))
29
36
  throw new Error('efficiency.toolResultFilterThresholdChars must be an integer from 1000 to 1000000');
37
+ const kind = value.taskKindRouting;
38
+ if (kind !== undefined && (!record(kind) || Object.keys(kind).some(key => key !== 'mode')
39
+ || (kind.mode !== undefined && (typeof kind.mode !== 'string' || !['off', 'shadow', 'on'].includes(kind.mode)))))
40
+ throw new Error('Invalid efficiency.taskKindRouting');
30
41
  const menu = value.toolMenuRouting;
31
42
  if (menu !== undefined) {
32
43
  if (!record(menu) || Object.keys(menu).some(key => !['mode', 'topK', 'minSavingsChars', 'pinnedTools'].includes(key)))
@@ -43,8 +54,66 @@ export function validateEfficiencyConfig(value) {
43
54
  const routing = value.adaptiveRouting;
44
55
  if (routing === undefined)
45
56
  return;
46
- if (!record(routing) || Object.keys(routing).some(key => !['enabled', 'tiers', 'maxEscalations', 'pricing'].includes(key)))
57
+ if (!record(routing) || Object.keys(routing).some(key => !['enabled', 'tiers', 'maxEscalations', 'pricing', 'strategy', 'mode', 'pool', 'classScores', 'quota', 'subagents', 'candidates', 'scores', 'scoresUpdatedAt'].includes(key)))
47
58
  throw new Error('Invalid efficiency.adaptiveRouting');
59
+ const percent = (entry, max = 100) => typeof entry === 'number' && Number.isFinite(entry) && entry >= 0 && entry <= max;
60
+ if (routing.strategy !== undefined && (typeof routing.strategy !== 'string' || !['tiers', 'pool'].includes(routing.strategy)))
61
+ throw new Error('efficiency.adaptiveRouting.strategy must be tiers or pool');
62
+ if (routing.mode !== undefined && (typeof routing.mode !== 'string' || !['shadow', 'enforce'].includes(routing.mode)))
63
+ throw new Error('efficiency.adaptiveRouting.mode must be shadow or enforce');
64
+ if (routing.subagents !== undefined && typeof routing.subagents !== 'boolean')
65
+ throw new Error('efficiency.adaptiveRouting.subagents must be a boolean');
66
+ if (routing.pool !== undefined) {
67
+ if (!Array.isArray(routing.pool) || routing.pool.length > 64)
68
+ throw new Error('efficiency.adaptiveRouting.pool must be a list of at most 64 pairs');
69
+ routing.pool.forEach((entry, index) => {
70
+ const label = `efficiency.adaptiveRouting.pool[${index}]`;
71
+ if (!record(entry) || Object.keys(entry).some(key => !['provider', 'model', 'effort', 'quality', 'cost'].includes(key)))
72
+ throw new Error(`Invalid ${label}`);
73
+ if (!/^[\w-]+$/.test(String(entry.provider ?? '')))
74
+ throw new Error(`${label}.provider must name a configured provider id`);
75
+ if (entry.model !== undefined && !identifier(entry.model, 500))
76
+ throw new Error(`Invalid ${label}.model`);
77
+ if (entry.effort !== undefined && !POOL_EFFORTS.includes(entry.effort))
78
+ throw new Error(`${label}.effort must be one of ${POOL_EFFORTS.join(', ')}`);
79
+ if (!percent(entry.quality))
80
+ throw new Error(`${label}.quality must be a number from 0 to 100`);
81
+ if (entry.cost !== undefined && !price(entry.cost))
82
+ throw new Error(`${label}.cost must be a number of 0 or more`);
83
+ });
84
+ }
85
+ if (routing.candidates !== undefined && (typeof routing.candidates !== 'string' || !['listed', 'all'].includes(routing.candidates)))
86
+ throw new Error('efficiency.adaptiveRouting.candidates must be listed or all');
87
+ if (routing.scoresUpdatedAt !== undefined && (typeof routing.scoresUpdatedAt !== 'string' || Number.isNaN(Date.parse(routing.scoresUpdatedAt))))
88
+ throw new Error('efficiency.adaptiveRouting.scoresUpdatedAt must be a date');
89
+ if (routing.scores !== undefined) {
90
+ if (!record(routing.scores) || Object.keys(routing.scores).length > MAX_POOL_SCORES)
91
+ throw new Error(`efficiency.adaptiveRouting.scores must hold at most ${MAX_POOL_SCORES} models`);
92
+ const pair = (entry, extra = []) => record(entry) && Object.keys(entry).every(key => ['quality', 'cost', ...extra].includes(key))
93
+ && percent(entry.quality) && (entry.cost === undefined || price(entry.cost));
94
+ for (const [key, entry] of Object.entries(routing.scores)) {
95
+ const label = `efficiency.adaptiveRouting.scores["${key}"]`;
96
+ if (!identifier(key, 600) || !/^[\w-]+\/.+$/.test(key))
97
+ throw new Error('efficiency.adaptiveRouting.scores must be keyed provider/model');
98
+ if (!pair(entry, ['efforts']))
99
+ throw new Error(`${label} needs a quality from 0 to 100 and an optional cost of 0 or more`);
100
+ if (entry.efforts !== undefined && (!record(entry.efforts) || Object.entries(entry.efforts).some(([effort, score]) => !POOL_EFFORTS.includes(effort) || !pair(score)))) {
101
+ throw new Error(`${label}.efforts accepts ${POOL_EFFORTS.join(', ')}, each with a quality from 0 to 100 and an optional cost`);
102
+ }
103
+ }
104
+ }
105
+ if (routing.classScores !== undefined) {
106
+ if (!record(routing.classScores) || Object.entries(routing.classScores).some(([key, entry]) => !POOL_CLASSES.includes(key) || !percent(entry)))
107
+ throw new Error(`efficiency.adaptiveRouting.classScores accepts ${POOL_CLASSES.join(', ')} with scores from 0 to 100`);
108
+ }
109
+ if (routing.quota !== undefined) {
110
+ if (!record(routing.quota) || Object.keys(routing.quota).some(key => !['reservePercent', 'nearTiePercent'].includes(key)))
111
+ throw new Error('Invalid efficiency.adaptiveRouting.quota');
112
+ if (routing.quota.reservePercent !== undefined && !percent(routing.quota.reservePercent, 50))
113
+ throw new Error('efficiency.adaptiveRouting.quota.reservePercent must be a number from 0 to 50');
114
+ if (routing.quota.nearTiePercent !== undefined && !percent(routing.quota.nearTiePercent))
115
+ throw new Error('efficiency.adaptiveRouting.quota.nearTiePercent must be a number from 0 to 100');
116
+ }
48
117
  if (routing.enabled !== undefined && typeof routing.enabled !== 'boolean')
49
118
  throw new Error('efficiency.adaptiveRouting.enabled must be a boolean');
50
119
  if (routing.maxEscalations !== undefined && (!Number.isSafeInteger(routing.maxEscalations) || routing.maxEscalations < 0 || routing.maxEscalations > 3))
@@ -64,7 +133,12 @@ export function validateEfficiencyConfig(value) {
64
133
  throw new Error(`Invalid efficiency.adaptiveRouting.pricing entry: ${key}`);
65
134
  }
66
135
  }
67
- if (routing.enabled === true && !(record(routing.tiers) && Object.keys(routing.tiers).length))
136
+ if (routing.enabled === true && routing.strategy === 'pool') {
137
+ // With `candidates: all` the pairs come from `scores`, which the refresh action fills in.
138
+ if (routing.candidates !== 'all' && !(Array.isArray(routing.pool) && routing.pool.length))
139
+ throw new Error('efficiency.adaptiveRouting.enabled with strategy pool requires at least one pool pair, or candidates set to all');
140
+ }
141
+ else if (routing.enabled === true && !(record(routing.tiers) && Object.keys(routing.tiers).length))
68
142
  throw new Error('efficiency.adaptiveRouting.enabled requires at least one tier');
69
143
  }
70
144
  export function resolveEfficiency(config) {
@@ -85,4 +159,45 @@ export const EFFICIENCY_REASONS = [
85
159
  'empty_workspace', 'index_unavailable', 'memory_unavailable', 'selected', 'duplicate', 'changed', 'fallback',
86
160
  'economy', 'balanced', 'premium', 'baseline', 'pinned', 'unconfigured', 'low_confidence', 'risk', 'escalated', 'escalation_limit',
87
161
  'omitted', 'restored', 'historical', 'explicit',
162
+ 'routine', 'quick', 'standard', 'deep', 'no_candidate', 'quota_reserve',
88
163
  ];
164
+ /** The key of a model in `adaptiveRouting.scores`. A provider id holds no slash, so the first one divides the two. */
165
+ export const poolScoreKey = (provider, model) => `${provider}/${model}`;
166
+ /**
167
+ * The pairs pool routing chooses among. With `candidates: listed` they are the `pool` as written. With `all`, every
168
+ * model of every configured provider that has a score is added: one pair per scored thinking level the model takes
169
+ * (`levels`, when given, names the levels it takes), or one pair at the provider's saved level when none is scored.
170
+ * A model the `pool` names keeps the pairs written for it. `unscored` counts the configured models left out for want
171
+ * of a score.
172
+ */
173
+ export function poolEntries(routing, configured, levels) {
174
+ const own = routing.pool ?? [];
175
+ const entries = [...own];
176
+ if (routing.candidates !== 'all')
177
+ return { entries, unscored: 0 };
178
+ let unscored = 0;
179
+ for (const provider of configured) {
180
+ const listed = new Set(own.filter(entry => entry.provider === provider.id).map(entry => entry.model ?? provider.model));
181
+ for (const model of new Set([provider.model, ...(provider.models ?? [])])) {
182
+ if (!model || listed.has(model))
183
+ continue;
184
+ const key = poolScoreKey(provider.id, model);
185
+ const score = routing.scores && Object.hasOwn(routing.scores, key) ? routing.scores[key] : undefined;
186
+ if (!score) {
187
+ unscored++;
188
+ continue;
189
+ }
190
+ const taken = levels?.(provider.id, model);
191
+ const scored = POOL_EFFORTS.filter(effort => score.efforts?.[effort] !== undefined && (taken === undefined || taken.includes(effort)));
192
+ if (!scored.length) {
193
+ entries.push({ provider: provider.id, model, quality: score.quality, ...(score.cost === undefined ? {} : { cost: score.cost }) });
194
+ continue;
195
+ }
196
+ for (const effort of scored) {
197
+ const pair = score.efforts[effort];
198
+ entries.push({ provider: provider.id, model, effort, quality: pair.quality, ...(pair.cost === undefined ? {} : { cost: pair.cost }) });
199
+ }
200
+ }
201
+ }
202
+ return { entries, unscored };
203
+ }
@@ -0,0 +1,27 @@
1
+ import type { DecisionBatch } from './decision/types.js';
2
+ import type { ReasoningEffort } from './providers.js';
3
+ export interface EffortDecisionInput {
4
+ task: string;
5
+ /** The model's enabled levels, lowest first. A level that is not here is never returned. */
6
+ levels: readonly ReasoningEffort[];
7
+ hints?: DecisionBatch;
8
+ /** The level the node would run at without Auto. */
9
+ fallback?: ReasoningEffort;
10
+ /** The level of the attempt that just failed, and why it failed. */
11
+ previous?: {
12
+ level: ReasoningEffort;
13
+ reason?: string;
14
+ };
15
+ }
16
+ export interface EffortDecision {
17
+ level?: ReasoningEffort;
18
+ evidence: 'hint' | 'lexical' | 'none' | 'escalation' | 'fixed';
19
+ }
20
+ /** A failed attempt moves up a level only when the failure suggests the model needed to think harder. */
21
+ export declare const EFFORT_ESCALATION_REASONS: ReadonlySet<string>;
22
+ /**
23
+ * The thinking level for one start of a node on Auto. Risk takes the highest enabled level, a confident complexity
24
+ * score is spread evenly across the enabled levels, and an obviously mechanical short task takes the lowest. With no
25
+ * decisive signal the node keeps the level it would have had, moved onto an enabled one.
26
+ */
27
+ export declare function decideEffort(input: EffortDecisionInput): EffortDecision;
@@ -0,0 +1,34 @@
1
+ import { DecisionPolicy } from './decision/DecisionPolicy.js';
2
+ import { MECHANICAL_MAX_CHARS, MECHANICAL_WORDS, RISK_WORDS } from './model-tiers.js';
3
+ import { nearestEnabled } from './thinking-levels.js';
4
+ /** A failed attempt moves up a level only when the failure suggests the model needed to think harder. */
5
+ export const EFFORT_ESCALATION_REASONS = new Set(['repeatedToolFailure', 'maxIterations']);
6
+ /**
7
+ * The thinking level for one start of a node on Auto. Risk takes the highest enabled level, a confident complexity
8
+ * score is spread evenly across the enabled levels, and an obviously mechanical short task takes the lowest. With no
9
+ * decisive signal the node keeps the level it would have had, moved onto an enabled one.
10
+ */
11
+ export function decideEffort(input) {
12
+ const { levels } = input;
13
+ if (levels.length === 0)
14
+ return { evidence: 'none' };
15
+ if (input.previous) {
16
+ const at = levels.indexOf(nearestEnabled(levels, input.previous.level));
17
+ const up = input.previous.reason !== undefined && EFFORT_ESCALATION_REASONS.has(input.previous.reason) && at < levels.length - 1;
18
+ return { level: levels[up ? at + 1 : at], evidence: up ? 'escalation' : 'none' };
19
+ }
20
+ if (levels.length === 1)
21
+ return { level: levels[0], evidence: 'none' };
22
+ const highest = levels[levels.length - 1];
23
+ const hints = input.hints;
24
+ if (hints && (DecisionPolicy.boolean(hints, 'security_sensitive') === true || DecisionPolicy.boolean(hints, 'architecture_affecting') === true))
25
+ return { level: highest, evidence: 'hint' };
26
+ if (RISK_WORDS.test(input.task))
27
+ return { level: highest, evidence: 'lexical' };
28
+ const complexity = hints ? DecisionPolicy.score(hints, 'task_complexity') : undefined;
29
+ if (complexity !== undefined)
30
+ return { level: levels[Math.min(levels.length - 1, Math.max(0, Math.floor(complexity * levels.length)))], evidence: 'hint' };
31
+ if (input.task.length <= MECHANICAL_MAX_CHARS && MECHANICAL_WORDS.test(input.task))
32
+ return { level: levels[0], evidence: 'lexical' };
33
+ return { level: input.fallback === undefined ? undefined : nearestEnabled(levels, input.fallback), evidence: 'none' };
34
+ }
@@ -0,0 +1,110 @@
1
+ /** What the agent lists in complete_agent's `outcomes`. */
2
+ export interface RequestedOutcome {
3
+ /** The outcome in plain language: "The SDK handles the API's final page". */
4
+ outcome: string;
5
+ status: 'passed' | 'failed' | 'not_checked';
6
+ /** The exact command that shows it, as it was run. */
7
+ command?: string;
8
+ /** The agent's own reading of the result. */
9
+ reading?: string;
10
+ /** For a not-checked outcome: why, and how a person can check it. */
11
+ why?: string;
12
+ how?: string;
13
+ }
14
+ /** The runtime's record of one command an agent ran. */
15
+ export interface CommandObservation {
16
+ id: string;
17
+ command: string;
18
+ directory: string;
19
+ startedAt: string;
20
+ endedAt?: string;
21
+ exitCode?: number;
22
+ /** The last 4 KB of what it printed. */
23
+ output?: string;
24
+ /**
25
+ * What it ran against, read just before it started: the commit, and the uncommitted files at that moment.
26
+ * `inputsUnknown`: Git could not list them (it timed out, say), so the revision is labelled as incomplete.
27
+ */
28
+ revision?: {
29
+ commit?: string;
30
+ dirty: string[];
31
+ dirtyCount: number;
32
+ inputsUnknown?: true;
33
+ };
34
+ }
35
+ export type EvidenceState = 'passed' | 'failed' | 'unchecked' | 'reported';
36
+ /** One row of a turn's evidence. Runtime facts and the agent's reading are kept apart. */
37
+ export interface EvidenceItem {
38
+ criterion: string;
39
+ state: EvidenceState;
40
+ /** The result in a few words: from the run for an observed row. */
41
+ result: string;
42
+ observation?: CommandObservation;
43
+ /** The agent's reading, labelled as such. */
44
+ agent?: string;
45
+ why?: string;
46
+ how?: string;
47
+ /** A neutral freshness note: the result stands, but what it covered may have changed. */
48
+ stale?: string;
49
+ }
50
+ export declare const MAX_OUTCOMES = 20;
51
+ /** Commands are kept, and compared, up to this length. */
52
+ export declare const COMMAND_LIMIT = 8000;
53
+ export declare const OUTPUT_TAIL_BYTES = 4096;
54
+ export declare const OUTCOMES_DESCRIPTION = "Optional. When the task asked for results that can be checked, list each requested outcome: outcome (plain language), status (passed, failed or not_checked), command (the exact command you ran that shows it, copied as you ran it), reading (your short reading of its result), and for not_checked: why, and how a person can check it. The runtime links each command to its own record of the run; an outcome with no recorded command shows as unverified.";
55
+ /** The JSON schema of `outcomes` in complete_agent. */
56
+ export declare const OUTCOMES_SCHEMA: {
57
+ readonly type: "array";
58
+ readonly maxItems: 20;
59
+ readonly description: "Optional. When the task asked for results that can be checked, list each requested outcome: outcome (plain language), status (passed, failed or not_checked), command (the exact command you ran that shows it, copied as you ran it), reading (your short reading of its result), and for not_checked: why, and how a person can check it. The runtime links each command to its own record of the run; an outcome with no recorded command shows as unverified.";
60
+ readonly items: {
61
+ readonly type: "object";
62
+ readonly properties: {
63
+ readonly outcome: {
64
+ readonly type: "string";
65
+ };
66
+ readonly status: {
67
+ readonly type: "string";
68
+ readonly enum: readonly ["passed", "failed", "not_checked"];
69
+ };
70
+ readonly command: {
71
+ readonly type: "string";
72
+ };
73
+ readonly reading: {
74
+ readonly type: "string";
75
+ };
76
+ readonly why: {
77
+ readonly type: "string";
78
+ };
79
+ readonly how: {
80
+ readonly type: "string";
81
+ };
82
+ };
83
+ readonly required: readonly ["outcome", "status"];
84
+ readonly additionalProperties: false;
85
+ };
86
+ };
87
+ /** The outcomes an agent sent, kept leniently: a malformed entry is dropped with a note, never a failed completion. */
88
+ export declare function parseOutcomes(value: unknown, notes?: string[]): RequestedOutcome[] | undefined;
89
+ /**
90
+ * Each outcome against what ran: the newest recorded run of its exact command decides passed or failed by its exit
91
+ * code, whatever the agent claimed; an outcome whose command never ran is agent-reported; a not-checked one says why.
92
+ * `edits` are the times files were edited by the agent; a run followed by an edit, or by a run that saw other files,
93
+ * keeps its result with "Edited since".
94
+ */
95
+ export declare function resolveEvidence(outcomes: readonly RequestedOutcome[], observations: readonly CommandObservation[], edits?: readonly string[], finalRevisions?: ReadonlyMap<string, CommandObservation['revision']>): EvidenceItem[];
96
+ /**
97
+ * What the ledger names about a turn (E7): each outcome it did not verify, said as it stands — not checked, only
98
+ * agent-reported, failed, or passed before later edits.
99
+ */
100
+ export declare function unverified(items: readonly EvidenceItem[] | undefined): string[];
101
+ /**
102
+ * The commit and uncommitted files of `directory`'s repository right now; undefined outside Git. Git runs as the
103
+ * app's other reads of a workspace do: found outside the workspace, with fsmonitor, hooks and the repository's
104
+ * filter drivers off, so reading the revision never runs anything the workspace configured.
105
+ */
106
+ export declare function readRevision(directory: string, signal?: AbortSignal): Promise<CommandObservation['revision']>;
107
+ /** A command or its output as kept: terminal escapes stripped and known secret shapes redacted. */
108
+ export declare function cleanRecorded(text: string): string;
109
+ /** The last 4 KB of a command's output, cut at a line where it can be. */
110
+ export declare function outputTail(output: string): string;