@tangle-network/agent-runtime 0.104.0 → 0.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +176 -42
  2. package/dist/activation-CRjVfOiy.js +203 -0
  3. package/dist/activation-CRjVfOiy.js.map +1 -0
  4. package/dist/activation-DyWB0K6E.d.ts +98 -0
  5. package/dist/agent.d.ts +216 -234
  6. package/dist/agent.js +615 -547
  7. package/dist/agent.js.map +1 -1
  8. package/dist/analyst-loop-DGdtVENg.js +517 -0
  9. package/dist/analyst-loop-DGdtVENg.js.map +1 -0
  10. package/dist/analyst-loop.d.ts +10 -43
  11. package/dist/analyst-loop.js +2 -11
  12. package/dist/backends-Dy8NujB4.js +713 -0
  13. package/dist/backends-Dy8NujB4.js.map +1 -0
  14. package/dist/candidate-execution/index.d.ts +4 -192
  15. package/dist/candidate-execution/index.js +5 -66
  16. package/dist/candidate-execution-DqMbv1rU.js +488 -0
  17. package/dist/candidate-execution-DqMbv1rU.js.map +1 -0
  18. package/dist/coder-yhVWbdWc.js +40 -0
  19. package/dist/coder-yhVWbdWc.js.map +1 -0
  20. package/dist/conversation-XucG_K3l.js +1265 -0
  21. package/dist/conversation-XucG_K3l.js.map +1 -0
  22. package/dist/conversation.d.ts +2 -804
  23. package/dist/conversation.js +2 -55
  24. package/dist/environment-provider-CfLUmKmf.js +1168 -0
  25. package/dist/environment-provider-CfLUmKmf.js.map +1 -0
  26. package/dist/environment-provider-IUGU3epE.d.ts +964 -0
  27. package/dist/environment-provider.d.ts +2 -78
  28. package/dist/environment-provider.js +2 -18
  29. package/dist/errors-DEAvWQPy.js +111 -0
  30. package/dist/errors-DEAvWQPy.js.map +1 -0
  31. package/dist/improvement-adapter-Cr5TBSji.d.ts +166 -0
  32. package/dist/improvement-cycle-C095kS_g.js +2624 -0
  33. package/dist/improvement-cycle-C095kS_g.js.map +1 -0
  34. package/dist/index-BGdxAwfO.d.ts +838 -0
  35. package/dist/index-C-FYUuFG.d.ts +193 -0
  36. package/dist/index-CbNM40xG.d.ts +140 -0
  37. package/dist/index-DruSKs3Z.d.ts +7224 -0
  38. package/dist/index-Efjb3nrQ.d.ts +671 -0
  39. package/dist/index.d.ts +14 -1134
  40. package/dist/index.js +2134 -1972
  41. package/dist/index.js.map +1 -1
  42. package/dist/intelligence.d.ts +776 -888
  43. package/dist/intelligence.js +1466 -1410
  44. package/dist/intelligence.js.map +1 -1
  45. package/dist/{kb-gate-CwHO0vz6.d.ts → kb-gate-C8z2juK8.d.ts} +33 -31
  46. package/dist/kb-gate-DpaSwXVx.js +80 -0
  47. package/dist/kb-gate-DpaSwXVx.js.map +1 -0
  48. package/dist/knowledge-Ku-mPP4f.js +433 -0
  49. package/dist/knowledge-Ku-mPP4f.js.map +1 -0
  50. package/dist/knowledge.d.ts +2 -150
  51. package/dist/knowledge.js +2 -40
  52. package/dist/local-harness-Dh8PJ0ot.d.ts +455 -0
  53. package/dist/loop-runner-bin-BXsFEUcf.d.ts +162 -0
  54. package/dist/loop-runner-bin-BwjQ1NfH.js +268 -0
  55. package/dist/loop-runner-bin-BwjQ1NfH.js.map +1 -0
  56. package/dist/loop-runner-bin.d.ts +2 -17
  57. package/dist/loop-runner-bin.js +2 -24
  58. package/dist/loops.d.ts +5 -4164
  59. package/dist/loops.js +8 -419
  60. package/dist/mcp/bin.d.ts +1 -1
  61. package/dist/mcp/bin.js +116 -146
  62. package/dist/mcp/bin.js.map +1 -1
  63. package/dist/mcp/index.d.ts +295 -437
  64. package/dist/mcp/index.js +1242 -1177
  65. package/dist/mcp/index.js.map +1 -1
  66. package/dist/mcp/memory-bin.d.ts +1 -1
  67. package/dist/mcp/memory-bin.js +37 -16
  68. package/dist/mcp/memory-bin.js.map +1 -1
  69. package/dist/memory-server-DL6cE2Ag.js +234 -0
  70. package/dist/memory-server-DL6cE2Ag.js.map +1 -0
  71. package/dist/model-resolution-Btd9iIKV.js +98 -0
  72. package/dist/model-resolution-Btd9iIKV.js.map +1 -0
  73. package/dist/openai-tools-B68JaOCx.d.ts +24 -0
  74. package/dist/openai-tools-CKLy1C7M.js +44 -0
  75. package/dist/openai-tools-CKLy1C7M.js.map +1 -0
  76. package/dist/otel-export-D34IQW1C.js +843 -0
  77. package/dist/otel-export-D34IQW1C.js.map +1 -0
  78. package/dist/platform.d.ts +188 -185
  79. package/dist/platform.js +185 -218
  80. package/dist/platform.js.map +1 -1
  81. package/dist/prepare-B53sPV7M.js +4292 -0
  82. package/dist/prepare-B53sPV7M.js.map +1 -0
  83. package/dist/primeintellect/index.d.ts +150 -147
  84. package/dist/primeintellect/index.js +626 -1004
  85. package/dist/primeintellect/index.js.map +1 -1
  86. package/dist/profiles.d.ts +296 -490
  87. package/dist/profiles.js +722 -749
  88. package/dist/profiles.js.map +1 -1
  89. package/dist/protected-model-port-BLPH5VVv.js +722 -0
  90. package/dist/protected-model-port-BLPH5VVv.js.map +1 -0
  91. package/dist/protected-model-port-BP6Z4eau.d.ts +283 -0
  92. package/dist/protected-redaction--F3v1oo8.js +200 -0
  93. package/dist/protected-redaction--F3v1oo8.js.map +1 -0
  94. package/dist/redact-D-u-rrcn.js +82 -0
  95. package/dist/redact-D-u-rrcn.js.map +1 -0
  96. package/dist/redact-kbIOjfjM.d.ts +452 -0
  97. package/dist/researcher-CoVqNhfI.js +433 -0
  98. package/dist/researcher-CoVqNhfI.js.map +1 -0
  99. package/dist/runtime-BG0BziaP.js +5408 -0
  100. package/dist/runtime-BG0BziaP.js.map +1 -0
  101. package/dist/sandbox-events-DeI5xX8P.js +316 -0
  102. package/dist/sandbox-events-DeI5xX8P.js.map +1 -0
  103. package/dist/spawn-journal-CwPvKUTa.js +456 -0
  104. package/dist/spawn-journal-CwPvKUTa.js.map +1 -0
  105. package/dist/structural-rollout-IXUEplky.js +1445 -0
  106. package/dist/structural-rollout-IXUEplky.js.map +1 -0
  107. package/dist/substrate-B0TYNrXn.js +27 -0
  108. package/dist/substrate-B0TYNrXn.js.map +1 -0
  109. package/dist/{substrate-Dyiqmd3o.d.ts → substrate-BcnuSHXm.d.ts} +57 -54
  110. package/dist/supervise-BiRutHS9.js +7321 -0
  111. package/dist/supervise-BiRutHS9.js.map +1 -0
  112. package/dist/supervisor-DTKhF-RV.js +3826 -0
  113. package/dist/supervisor-DTKhF-RV.js.map +1 -0
  114. package/dist/testing.d.ts +4 -3
  115. package/dist/testing.js +2478 -2637
  116. package/dist/testing.js.map +1 -1
  117. package/dist/tool-server-RcWgLIsL.js +141 -0
  118. package/dist/tool-server-RcWgLIsL.js.map +1 -0
  119. package/dist/trace-propagation-CJJC7SVB.js +57 -0
  120. package/dist/trace-propagation-CJJC7SVB.js.map +1 -0
  121. package/dist/types-BaIpb0XT.d.ts +492 -0
  122. package/dist/types-BevOjfTY.d.ts +765 -0
  123. package/dist/types-C9j4qg6l.d.ts +500 -0
  124. package/dist/types-Cja5OTGh.d.ts +190 -0
  125. package/dist/util-MVgdwuIS.js +145 -0
  126. package/dist/util-MVgdwuIS.js.map +1 -0
  127. package/dist/workspace-archive-BosQiotA.js +575 -0
  128. package/dist/workspace-archive-BosQiotA.js.map +1 -0
  129. package/package.json +43 -55
  130. package/skills/build-with-agent-runtime/SKILL.md +16 -9
  131. package/skills/loop-writer/SKILL.md +1 -1
  132. package/dist/activation-Cm-9MMX1.d.ts +0 -69
  133. package/dist/analyst-loop.js.map +0 -1
  134. package/dist/backends-BO4Jqoe2.d.ts +0 -134
  135. package/dist/candidate-execution/index.js.map +0 -1
  136. package/dist/chunk-2KGAN2HM.js +0 -1256
  137. package/dist/chunk-2KGAN2HM.js.map +0 -1
  138. package/dist/chunk-2QJSNOGK.js +0 -48
  139. package/dist/chunk-2QJSNOGK.js.map +0 -1
  140. package/dist/chunk-2UABGGUB.js +0 -474
  141. package/dist/chunk-2UABGGUB.js.map +0 -1
  142. package/dist/chunk-2VZYRB55.js +0 -834
  143. package/dist/chunk-2VZYRB55.js.map +0 -1
  144. package/dist/chunk-2X65HYMI.js +0 -3526
  145. package/dist/chunk-2X65HYMI.js.map +0 -1
  146. package/dist/chunk-3MDZX7YU.js +0 -125
  147. package/dist/chunk-3MDZX7YU.js.map +0 -1
  148. package/dist/chunk-3PPVCS75.js +0 -199
  149. package/dist/chunk-3PPVCS75.js.map +0 -1
  150. package/dist/chunk-5HNDYWUT.js +0 -6424
  151. package/dist/chunk-5HNDYWUT.js.map +0 -1
  152. package/dist/chunk-5IBQAPVB.js +0 -29
  153. package/dist/chunk-5IBQAPVB.js.map +0 -1
  154. package/dist/chunk-5QOB7H74.js +0 -387
  155. package/dist/chunk-5QOB7H74.js.map +0 -1
  156. package/dist/chunk-ATDFUJYI.js +0 -4728
  157. package/dist/chunk-ATDFUJYI.js.map +0 -1
  158. package/dist/chunk-B7K7V22Y.js +0 -699
  159. package/dist/chunk-B7K7V22Y.js.map +0 -1
  160. package/dist/chunk-DPEUKJRO.js +0 -27
  161. package/dist/chunk-DPEUKJRO.js.map +0 -1
  162. package/dist/chunk-FD2MBMOH.js +0 -494
  163. package/dist/chunk-FD2MBMOH.js.map +0 -1
  164. package/dist/chunk-FJI3EXU3.js +0 -2402
  165. package/dist/chunk-FJI3EXU3.js.map +0 -1
  166. package/dist/chunk-HAO4CXHP.js +0 -200
  167. package/dist/chunk-HAO4CXHP.js.map +0 -1
  168. package/dist/chunk-ISPWRSEC.js +0 -408
  169. package/dist/chunk-ISPWRSEC.js.map +0 -1
  170. package/dist/chunk-KRBFHMV6.js +0 -1228
  171. package/dist/chunk-KRBFHMV6.js.map +0 -1
  172. package/dist/chunk-L5DST3QC.js +0 -351
  173. package/dist/chunk-L5DST3QC.js.map +0 -1
  174. package/dist/chunk-M22PL4GH.js +0 -171
  175. package/dist/chunk-M22PL4GH.js.map +0 -1
  176. package/dist/chunk-NURIQBJQ.js +0 -72
  177. package/dist/chunk-NURIQBJQ.js.map +0 -1
  178. package/dist/chunk-PZZKQVQV.js +0 -52
  179. package/dist/chunk-PZZKQVQV.js.map +0 -1
  180. package/dist/chunk-Q2JSAVQ3.js +0 -671
  181. package/dist/chunk-Q2JSAVQ3.js.map +0 -1
  182. package/dist/chunk-SBTWKPVR.js +0 -5576
  183. package/dist/chunk-SBTWKPVR.js.map +0 -1
  184. package/dist/chunk-SGKPNBXE.js +0 -60
  185. package/dist/chunk-SGKPNBXE.js.map +0 -1
  186. package/dist/chunk-SNSMRT6H.js +0 -680
  187. package/dist/chunk-SNSMRT6H.js.map +0 -1
  188. package/dist/chunk-STJEHM5F.js +0 -1338
  189. package/dist/chunk-STJEHM5F.js.map +0 -1
  190. package/dist/chunk-UPWGXKXB.js +0 -254
  191. package/dist/chunk-UPWGXKXB.js.map +0 -1
  192. package/dist/chunk-YEJR7IXO.js +0 -68
  193. package/dist/chunk-YEJR7IXO.js.map +0 -1
  194. package/dist/chunk-ZXICDSAK.js +0 -907
  195. package/dist/chunk-ZXICDSAK.js.map +0 -1
  196. package/dist/completion-gate-Bv47cOnn.d.ts +0 -256
  197. package/dist/conversation.js.map +0 -1
  198. package/dist/coordination-CxtzMxSM.d.ts +0 -2570
  199. package/dist/environment-provider.js.map +0 -1
  200. package/dist/improve--2A0gK1-.d.ts +0 -440
  201. package/dist/improvement-adapter-HAZz-7vK.d.ts +0 -203
  202. package/dist/knowledge.js.map +0 -1
  203. package/dist/local-harness-CtK9dSny.d.ts +0 -175
  204. package/dist/loop-runner-bin-DUOGtvOl.d.ts +0 -207
  205. package/dist/loop-runner-bin.js.map +0 -1
  206. package/dist/loops.js.map +0 -1
  207. package/dist/openai-tools-fnj6SRVg.d.ts +0 -46
  208. package/dist/protected-model-port-DzkUY3HQ.d.ts +0 -271
  209. package/dist/sanitize-DEbPNtyI.d.ts +0 -328
  210. package/dist/structural-rollout-C4mabf87.d.ts +0 -446
  211. package/dist/supervise-7q9F5brx.d.ts +0 -379
  212. package/dist/types-BCoemcXU.d.ts +0 -802
  213. package/dist/types-BwoZWq-i.d.ts +0 -510
  214. package/dist/types-Cbp72qyu.d.ts +0 -491
  215. package/dist/types-CmYCMbFT.d.ts +0 -203
  216. package/dist/types-CvNwMzQt.d.ts +0 -957
  217. package/dist/worktree-fanout-WsOzt8qu.d.ts +0 -999
@@ -1,47 +1,25 @@
1
- import { U as UiFinding, a as UiLens } from './substrate-Dyiqmd3o.js';
2
- export { C as CoderTask, b as UI_FINDING_SEVERITIES, c as UI_LENSES, d as UiFindingScreenshot, e as UiFindingSeverity, f as coderTaskToPrompt } from './substrate-Dyiqmd3o.js';
3
- import { AgentProfile, SandboxEvent } from '@tangle-network/sandbox';
4
- import { V as Validator, A as AgentRunSpec, O as OutputAdapter, D as Driver, a as SandboxClient } from './types-BCoemcXU.js';
5
- import { AgentProfile as AgentProfile$1 } from '@tangle-network/agent-interface';
6
- import '@tangle-network/agent-eval';
7
- import './types-BwoZWq-i.js';
8
-
9
- /**
10
- *
11
- * UI-audit issue writer — pure I/O. Takes a workspace dir + `UiFinding[]`
12
- * and emits:
13
- * - `<workspace>/issues/NNN--<lens>--<slug>.md` — one self-contained
14
- * GitHub-issue-ready Markdown per finding, with embedded screenshot
15
- * references.
16
- * - `<workspace>/registry.json` — finding index for dedup and audit
17
- * resume across iterations.
18
- * - `<workspace>/index.md` — human-readable rollup (severity / lens /
19
- * route counts plus a sorted finding list).
20
- *
21
- * The writer is deterministic, idempotent for `appendFindings()`, and
22
- * never invokes an LLM. It assigns the next monotonic id to a finding the
23
- * caller did not pre-id.
24
- *
25
- * @experimental
26
- */
27
-
1
+ import { E as SandboxClient, k as Validator, r as Driver, t as AgentRunSpec, w as OutputAdapter } from "./types-BevOjfTY.js";
2
+ import { a as UiFindingSeverity, c as coderTaskToPrompt, i as UiFindingScreenshot, n as UI_LENSES, o as UiLens, r as UiFinding, s as CoderTask, t as UI_FINDING_SEVERITIES } from "./substrate-BcnuSHXm.js";
3
+ import { AgentProfile } from "@tangle-network/agent-interface";
4
+ import { SandboxEvent } from "@tangle-network/sandbox";
5
+ //#region src/audit/issue-writer.d.ts
28
6
  /** @experimental */
29
7
  interface AuditRegistry {
30
- schemaVersion: 1;
31
- findings: UiFinding[];
32
- /** Route → URL + captures sidecar; preserved across runs. */
33
- routes: Record<string, {
34
- url?: string;
35
- captures: AuditRegistryCapture[];
36
- }>;
8
+ schemaVersion: 1;
9
+ findings: UiFinding[];
10
+ /** Route → URL + captures sidecar; preserved across runs. */
11
+ routes: Record<string, {
12
+ url?: string;
13
+ captures: AuditRegistryCapture[];
14
+ }>;
37
15
  }
38
16
  /** @experimental */
39
17
  interface AuditRegistryCapture {
40
- file: string;
41
- viewport?: string;
42
- fullPage?: boolean;
43
- elementSelector?: string;
44
- capturedAt: string;
18
+ file: string;
19
+ viewport?: string;
20
+ fullPage?: boolean;
21
+ elementSelector?: string;
22
+ capturedAt: string;
45
23
  }
46
24
  /** Create the `issues/`, `screenshots/`, and `registry.json` scaffold in a new audit workspace. @experimental */
47
25
  declare function initAuditWorkspace(workspaceDir: string): Promise<void>;
@@ -49,10 +27,10 @@ declare function initAuditWorkspace(workspaceDir: string): Promise<void>;
49
27
  declare function readAuditRegistry(workspaceDir: string): Promise<AuditRegistry>;
50
28
  /** @experimental */
51
29
  interface AppendFindingsResult {
52
- /** Findings with id + createdAt assigned, in input order. */
53
- written: UiFinding[];
54
- /** Workspace-relative path to each issue Markdown file, in input order. */
55
- files: string[];
30
+ /** Findings with id + createdAt assigned, in input order. */
31
+ written: UiFinding[];
32
+ /** Workspace-relative path to each issue Markdown file, in input order. */
33
+ files: string[];
56
34
  }
57
35
  /**
58
36
  * Append findings to a workspace, writing one Markdown file per finding
@@ -68,9 +46,9 @@ interface AppendFindingsResult {
68
46
  declare function appendFindings(workspaceDir: string, findings: readonly UiFinding[]): Promise<AppendFindingsResult>;
69
47
  /** @experimental */
70
48
  interface RegisterCapturesOptions {
71
- route: string;
72
- url?: string;
73
- captures: readonly AuditRegistryCapture[];
49
+ route: string;
50
+ url?: string;
51
+ captures: readonly AuditRegistryCapture[];
74
52
  }
75
53
  /**
76
54
  * Record screenshots taken for a route in the registry, without filing a
@@ -82,11 +60,11 @@ interface RegisterCapturesOptions {
82
60
  declare function registerCaptures(workspaceDir: string, options: RegisterCapturesOptions): Promise<void>;
83
61
  /** @experimental */
84
62
  interface AuditIndex {
85
- /** Total findings in the workspace. */
86
- total: number;
87
- bySeverity: Record<UiFinding['severity'], number>;
88
- byLens: Partial<Record<UiLens, number>>;
89
- byRoute: Record<string, number>;
63
+ /** Total findings in the workspace. */
64
+ total: number;
65
+ bySeverity: Record<UiFinding['severity'], number>;
66
+ byLens: Partial<Record<UiLens, number>>;
67
+ byRoute: Record<string, number>;
90
68
  }
91
69
  /** Compute finding counts by severity, lens, and route from an `AuditRegistry`. @experimental */
92
70
  declare function summarizeRegistry(reg: AuditRegistry): AuditIndex;
@@ -96,50 +74,26 @@ declare function summarizeRegistry(reg: AuditRegistry): AuditIndex;
96
74
  * @experimental
97
75
  */
98
76
  declare function writeAuditIndex(workspaceDir: string): Promise<string>;
99
-
100
- /**
101
- * Opinionated preset for source-grounded research
102
- * tasks. The agent is told to:
103
- * - bound its work to a single `knowledgeNamespace`
104
- * - emit `items[]` carrying provenance + confidence
105
- * - emit `citations[]` linking quotes back to source urls
106
- * - emit `proposedWrites[]` — never call materialize itself
107
- * - describe `gaps` it could not answer
108
- *
109
- * The profile is stateless and agent-agnostic. `harness` selects the
110
- * sandbox-SDK backend. For heterogeneous fanout, use
111
- * `multiHarnessResearcherFanout`.
112
- *
113
- * Propose-don't-apply: the profile NEVER writes to the knowledge base.
114
- * It produces `proposedWrites: KnowledgeUpdate[]` in the output. The
115
- * caller (gtm-agent, journey-eval, user) decides whether to feed those
116
- * updates through `applyKnowledgeWriteBlocks` / a KbStore put.
117
- *
118
- * Namespace isolation: every `KnowledgeItem` + `KnowledgeUpdate` in the
119
- * output carries `namespace`. The validator hard-fails when any item
120
- * touches a namespace other than `task.knowledgeNamespace`.
121
- *
122
- * @experimental
123
- */
124
-
77
+ //#endregion
78
+ //#region src/profiles/researcher.d.ts
125
79
  /** Source families a researcher profile may prefer for a task. @experimental */
126
80
  type ResearchSource = 'web' | 'corpus' | 'twitter' | 'github' | 'docs';
127
81
  /** Task contract for a source-grounded research agent. @experimental */
128
82
  interface ResearchTask {
129
- /** The research question to answer. */
130
- question: string;
131
- /** Bound: e.g. "audience for cpg-founder ICP". */
132
- scope?: string;
133
- /** Multi-tenant scope (customer-id, workspace-id). Validator enforces. */
134
- knowledgeNamespace: string;
135
- sources?: ResearchSource[];
136
- recencyWindow?: {
137
- since?: Date;
138
- until?: Date;
139
- };
140
- maxItems?: number;
141
- /** Per-item minimum confidence in [0, 1]. Validator scores recall vs this. */
142
- minConfidence?: number;
83
+ /** The research question to answer. */
84
+ question: string;
85
+ /** Bound: e.g. "audience for cpg-founder ICP". */
86
+ scope?: string;
87
+ /** Multi-tenant scope (customer-id, workspace-id). Validator enforces. */
88
+ knowledgeNamespace: string;
89
+ sources?: ResearchSource[];
90
+ recencyWindow?: {
91
+ since?: Date;
92
+ until?: Date;
93
+ };
94
+ maxItems?: number;
95
+ /** Per-item minimum confidence in [0, 1]. Validator scores recall vs this. */
96
+ minConfidence?: number;
143
97
  }
144
98
  /**
145
99
  * Knowledge item emitted by the researcher.
@@ -150,28 +104,28 @@ interface ResearchTask {
150
104
  * @experimental
151
105
  */
152
106
  interface KnowledgeItem {
107
+ id: string;
108
+ /** Multi-tenant scope. MUST equal `task.knowledgeNamespace`. */
109
+ namespace: string;
110
+ /** The factual claim, in the researcher's words. */
111
+ claim: string;
112
+ /** Provenance — at least one entry required. */
113
+ evidence: Array<{
114
+ source: string;
115
+ quote?: string;
116
+ url?: string;
117
+ capturedAt: number;
118
+ }>;
119
+ /** Researcher's self-reported confidence in [0, 1]. */
120
+ confidence: number;
121
+ /** Prior item ids this supersedes (chain). */
122
+ supersedes?: string[];
123
+ /** Set if the agent is retracting an earlier item. Unix ms. */
124
+ retractedAt?: number;
125
+ authoredBy: {
126
+ kind: 'human' | 'agent';
153
127
  id: string;
154
- /** Multi-tenant scope. MUST equal `task.knowledgeNamespace`. */
155
- namespace: string;
156
- /** The factual claim, in the researcher's words. */
157
- claim: string;
158
- /** Provenance — at least one entry required. */
159
- evidence: Array<{
160
- source: string;
161
- quote?: string;
162
- url?: string;
163
- capturedAt: number;
164
- }>;
165
- /** Researcher's self-reported confidence in [0, 1]. */
166
- confidence: number;
167
- /** Prior item ids this supersedes (chain). */
168
- supersedes?: string[];
169
- /** Set if the agent is retracting an earlier item. Unix ms. */
170
- retractedAt?: number;
171
- authoredBy: {
172
- kind: 'human' | 'agent';
173
- id: string;
174
- };
128
+ };
175
129
  }
176
130
  /**
177
131
  * A proposed write to the knowledge base. The profile does NOT apply
@@ -180,19 +134,19 @@ interface KnowledgeItem {
180
134
  * @experimental
181
135
  */
182
136
  type KnowledgeUpdate = {
183
- kind: 'insert';
184
- namespace: string;
185
- item: KnowledgeItem;
137
+ kind: 'insert';
138
+ namespace: string;
139
+ item: KnowledgeItem;
186
140
  } | {
187
- kind: 'supersede';
188
- namespace: string;
189
- previousId: string;
190
- item: KnowledgeItem;
141
+ kind: 'supersede';
142
+ namespace: string;
143
+ previousId: string;
144
+ item: KnowledgeItem;
191
145
  } | {
192
- kind: 'retract';
193
- namespace: string;
194
- itemId: string;
195
- reason: string;
146
+ kind: 'retract';
147
+ namespace: string;
148
+ itemId: string;
149
+ reason: string;
196
150
  };
197
151
  /**
198
152
  * Researcher output. Required fields are typed; optional fields preserve
@@ -202,54 +156,54 @@ type KnowledgeUpdate = {
202
156
  * @experimental
203
157
  */
204
158
  interface ResearchOutput {
205
- items: KnowledgeItem[];
206
- citations: Array<{
207
- url: string;
208
- quote: string;
209
- confidence: number;
210
- }>;
211
- proposedWrites: KnowledgeUpdate[];
212
- gaps?: string[];
213
- notes?: string;
214
- /** Anything the agent emitted beyond the typed fields. */
215
- raw?: unknown;
159
+ items: KnowledgeItem[];
160
+ citations: Array<{
161
+ url: string;
162
+ quote: string;
163
+ confidence: number;
164
+ }>;
165
+ proposedWrites: KnowledgeUpdate[];
166
+ gaps?: string[];
167
+ notes?: string;
168
+ /** Anything the agent emitted beyond the typed fields. */
169
+ raw?: unknown;
216
170
  }
217
171
  /** Options for the source-grounded researcher profile preset. @experimental */
218
172
  interface ResearcherProfileOptions {
219
- /** Sandbox-SDK backend.type. Default `'opencode/zai-coding-plan/glm-5.1'`. */
220
- harness?: string;
221
- /** Default model id passed in `AgentProfile.model.default`. */
222
- model?: string;
223
- /** Custom system prompt replacement. Default = built-in researcher preset. */
224
- systemPrompt?: string;
225
- /** Stable name for `AgentRunSpec.name`. Default = `researcher-${harness}`. */
226
- name?: string;
227
- /**
228
- * Default 0.7. Minimum (citations with quote) / items ratio for `valid=true`.
229
- * Below this floor, citation_density scores < 1 and the item set is gated.
230
- */
231
- citationDensityMin?: number;
173
+ /** Sandbox-SDK backend.type. Default `'opencode/zai-coding-plan/glm-5.1'`. */
174
+ harness?: string;
175
+ /** Default model id passed in `AgentProfile.model.default`. */
176
+ model?: string;
177
+ /** Custom system prompt replacement. Default = built-in researcher preset. */
178
+ systemPrompt?: string;
179
+ /** Stable name for `AgentRunSpec.name`. Default = `researcher-${harness}`. */
180
+ name?: string;
181
+ /**
182
+ * Default 0.7. Minimum (citations with quote) / items ratio for `valid=true`.
183
+ * Below this floor, citation_density scores < 1 and the item set is gated.
184
+ */
185
+ citationDensityMin?: number;
232
186
  }
233
187
  /** Build a source-grounded researcher profile with output parsing and validation. @experimental */
234
188
  declare function researcherProfile(options?: ResearcherProfileOptions & {
235
- task?: ResearchTask;
189
+ task?: ResearchTask;
236
190
  }): {
237
- profile: AgentProfile;
238
- taskToPrompt: (task: ResearchTask) => string;
239
- output: OutputAdapter<ResearchOutput>;
240
- validator: Validator<ResearchOutput>;
241
- agentRunSpec: AgentRunSpec<ResearchTask>;
191
+ profile: AgentProfile;
192
+ taskToPrompt: (task: ResearchTask) => string;
193
+ output: OutputAdapter<ResearchOutput>;
194
+ validator: Validator<ResearchOutput>;
195
+ agentRunSpec: AgentRunSpec<ResearchTask>;
242
196
  };
243
197
  /** @experimental */
244
198
  interface MultiHarnessResearcherFanoutOptions {
245
- /** Backend.type identifiers, one per parallel agent. */
246
- harnesses?: string[];
247
- /** Optional per-harness model override. Indexed parallel to `harnesses`. */
248
- models?: (string | undefined)[];
249
- /** Default citation density floor for the shared validator. */
250
- citationDensityMin?: number;
251
- /** Optional task — narrows the validator's namespace check. */
252
- task?: ResearchTask;
199
+ /** Backend.type identifiers, one per parallel agent. */
200
+ harnesses?: string[];
201
+ /** Optional per-harness model override. Indexed parallel to `harnesses`. */
202
+ models?: (string | undefined)[];
203
+ /** Default citation density floor for the shared validator. */
204
+ citationDensityMin?: number;
205
+ /** Optional task — narrows the validator's namespace check. */
206
+ task?: ResearchTask;
253
207
  }
254
208
  /**
255
209
  * Build a fanout topology over multiple harnesses. The kernel round-robins
@@ -259,10 +213,10 @@ interface MultiHarnessResearcherFanoutOptions {
259
213
  * @experimental
260
214
  */
261
215
  declare function multiHarnessResearcherFanout(options?: MultiHarnessResearcherFanoutOptions): {
262
- agentRuns: AgentRunSpec<ResearchTask>[];
263
- output: OutputAdapter<ResearchOutput>;
264
- validator: Validator<ResearchOutput>;
265
- driver: Driver<ResearchTask, ResearchOutput, 'done'>;
216
+ agentRuns: AgentRunSpec<ResearchTask>[];
217
+ output: OutputAdapter<ResearchOutput>;
218
+ validator: Validator<ResearchOutput>;
219
+ driver: Driver<ResearchTask, ResearchOutput, 'done'>;
266
220
  };
267
221
  /**
268
222
  * Build a validator that closes over a specific `ResearchTask`'s constraints.
@@ -284,49 +238,37 @@ declare function multiHarnessResearcherFanout(options?: MultiHarnessResearcherFa
284
238
  * @experimental
285
239
  */
286
240
  declare function createResearcherValidator(task: ResearchTask, config?: {
287
- citationDensityMin?: number;
288
- namespaceCheck?: boolean;
241
+ citationDensityMin?: number;
242
+ namespaceCheck?: boolean;
289
243
  }): Validator<ResearchOutput>;
290
-
291
- /**
292
- *
293
- * UI auditor task + output shapes — what one iteration of the audit loop
294
- * does and what it returns.
295
- *
296
- * An iteration is one (lens × route × viewport) audit pass. The driver
297
- * decides which iterations to plan (lens-cycling, route-cycling,
298
- * refine-on-low-yield, etc.); the iteration itself captures screenshots
299
- * and asks a vision judge to identify findings under that lens.
300
- *
301
- * @experimental
302
- */
303
-
244
+ //#endregion
245
+ //#region src/profiles/ui-auditor/task.d.ts
304
246
  /** @experimental */
305
247
  interface UiAuditViewport {
306
- width: number;
307
- height: number;
248
+ width: number;
249
+ height: number;
308
250
  }
309
251
  /** @experimental */
310
252
  interface UiAuditCaptureRequest {
311
- /**
312
- * Logical route name (e.g. `home`, `checkout-step-2`). Used in screenshot
313
- * filenames and finding metadata.
314
- */
315
- route: string;
316
- /** Fully qualified URL the iteration audits. */
317
- url: string;
318
- /** Default `{ width: 1280, height: 800 }`. */
319
- viewport?: UiAuditViewport;
320
- /** Default `false`. */
321
- fullPage?: boolean;
322
- /** CSS selector to wait for before capturing. */
323
- waitFor?: string;
324
- /** Extra milliseconds to wait after navigation settles. Default `500`. */
325
- waitMs?: number;
326
- /** Optional CSS selector — capture only the matched element. */
327
- elementSelector?: string;
328
- /** Optional human-readable label appended to the screenshot filename. */
329
- label?: string;
253
+ /**
254
+ * Logical route name (e.g. `home`, `checkout-step-2`). Used in screenshot
255
+ * filenames and finding metadata.
256
+ */
257
+ route: string;
258
+ /** Fully qualified URL the iteration audits. */
259
+ url: string;
260
+ /** Default `{ width: 1280, height: 800 }`. */
261
+ viewport?: UiAuditViewport;
262
+ /** Default `false`. */
263
+ fullPage?: boolean;
264
+ /** CSS selector to wait for before capturing. */
265
+ waitFor?: string;
266
+ /** Extra milliseconds to wait after navigation settles. Default `500`. */
267
+ waitMs?: number;
268
+ /** Optional CSS selector — capture only the matched element. */
269
+ elementSelector?: string;
270
+ /** Optional human-readable label appended to the screenshot filename. */
271
+ label?: string;
330
272
  }
331
273
  /**
332
274
  * One iteration's task: audit a single (lens × route) pair, capturing the
@@ -339,34 +281,34 @@ interface UiAuditCaptureRequest {
339
281
  * @experimental
340
282
  */
341
283
  interface UiAuditTask {
342
- /** The audit lens that scopes which findings are valid this iteration. */
343
- lens: UiLens;
344
- /** Required captures. Order is preserved; index 0 is the primary frame. */
345
- captures: readonly UiAuditCaptureRequest[];
346
- /**
347
- * Free-form context the consumer wants the judge to know about (product
348
- * name, target audience, copy tone). Surfaced as a prompt prelude.
349
- */
350
- productContext?: string;
351
- /**
352
- * IDs of findings already on file across earlier iterations. The judge
353
- * uses these to mark cross-references via `similarTo` instead of filing
354
- * pile-on duplicates.
355
- */
356
- knownFindingIds?: readonly number[];
284
+ /** The audit lens that scopes which findings are valid this iteration. */
285
+ lens: UiLens;
286
+ /** Required captures. Order is preserved; index 0 is the primary frame. */
287
+ captures: readonly UiAuditCaptureRequest[];
288
+ /**
289
+ * Free-form context the consumer wants the judge to know about (product
290
+ * name, target audience, copy tone). Surfaced as a prompt prelude.
291
+ */
292
+ productContext?: string;
293
+ /**
294
+ * IDs of findings already on file across earlier iterations. The judge
295
+ * uses these to mark cross-references via `similarTo` instead of filing
296
+ * pile-on duplicates.
297
+ */
298
+ knownFindingIds?: readonly number[];
357
299
  }
358
300
  /** @experimental */
359
301
  interface UiAuditCapture {
360
- /** Workspace-relative path to the screenshot file. */
361
- path: string;
362
- viewport: string;
363
- fullPage: boolean;
364
- elementSelector?: string;
365
- label?: string;
366
- route: string;
367
- url: string;
368
- /** Wall-clock when the capture completed. */
369
- capturedAt: string;
302
+ /** Workspace-relative path to the screenshot file. */
303
+ path: string;
304
+ viewport: string;
305
+ fullPage: boolean;
306
+ elementSelector?: string;
307
+ label?: string;
308
+ route: string;
309
+ url: string;
310
+ /** Wall-clock when the capture completed. */
311
+ capturedAt: string;
370
312
  }
371
313
  /**
372
314
  * Output of one iteration. `findings` is the headline payload; `captures`
@@ -376,194 +318,131 @@ interface UiAuditCapture {
376
318
  * @experimental
377
319
  */
378
320
  interface UiAuditOutput {
379
- lens: UiLens;
380
- findings: UiFinding[];
381
- captures: UiAuditCapture[];
382
- /** Optional judge commentary (debug / triage aid). */
383
- notes?: string;
321
+ lens: UiLens;
322
+ findings: UiFinding[];
323
+ captures: UiAuditCapture[];
324
+ /** Optional judge commentary (debug / triage aid). */
325
+ notes?: string;
384
326
  }
385
-
386
- /**
387
- *
388
- * UI judge seam — consumer-supplied vision LLM hook the in-process
389
- * auditor client invokes to identify findings from captured screenshots.
390
- *
391
- * The seam stays model-agnostic so consumers can plug in OpenAI vision,
392
- * Anthropic vision, gemini, a local model, or a deterministic stub for
393
- * tests. The auditor handles browser capture + Markdown emission; the
394
- * judge owns the perception + judgment.
395
- *
396
- * Implementor contract:
397
- * - Treat `lens` as authoritative — only emit findings that belong to
398
- * that lens. Findings with `lens !== input.lens` will fail the
399
- * iteration validator.
400
- * - Reference screenshots via the `path` strings provided in
401
- * `input.captures`. Inventing a path will cause the validator to
402
- * reject the iteration.
403
- * - Be conservative — a finding the judge cannot actually see in the
404
- * screenshots is a hallucination and pollutes the audit.
405
- * - Treat any exception thrown by the judge as the iteration's failure —
406
- * do not swallow LLM errors. Per agent-runtime's fail-loud doctrine,
407
- * surfacing the error to the kernel beats producing a silent zero.
408
- *
409
- * @experimental
410
- */
411
-
327
+ //#endregion
328
+ //#region src/profiles/ui-auditor/judge.d.ts
412
329
  /** @experimental */
413
330
  interface UiJudgeTokenUsage {
414
- input: number;
415
- output: number;
331
+ input: number;
332
+ output: number;
416
333
  }
417
334
  /** @experimental */
418
335
  interface UiJudgeInput {
419
- lens: UiLens;
420
- captures: readonly UiAuditCapture[];
421
- /** Free-form product context the consumer wants the judge to know. */
422
- productContext?: string;
423
- /** Findings already on file across earlier iterations — for similarTo linkage. */
424
- knownFindingIds?: readonly number[];
425
- /** The full prompt the loop kernel synthesized for this iteration. */
426
- promptText: string;
427
- /** Cooperative cancellation. */
428
- signal: AbortSignal;
336
+ lens: UiLens;
337
+ captures: readonly UiAuditCapture[];
338
+ /** Free-form product context the consumer wants the judge to know. */
339
+ productContext?: string;
340
+ /** Findings already on file across earlier iterations — for similarTo linkage. */
341
+ knownFindingIds?: readonly number[];
342
+ /** The full prompt the loop kernel synthesized for this iteration. */
343
+ promptText: string;
344
+ /** Cooperative cancellation. */
345
+ signal: AbortSignal;
429
346
  }
430
347
  /** @experimental */
431
348
  interface UiJudgeOutput {
432
- findings: UiFinding[];
433
- /** Optional triage commentary. */
434
- notes?: string;
435
- /** Optional usage; folded into the kernel cost ledger when present. */
436
- tokenUsage?: UiJudgeTokenUsage;
437
- /** Optional total cost in USD. */
438
- costUsd?: number;
349
+ findings: UiFinding[];
350
+ /** Optional triage commentary. */
351
+ notes?: string;
352
+ /** Optional usage; folded into the kernel cost ledger when present. */
353
+ tokenUsage?: UiJudgeTokenUsage;
354
+ /** Optional total cost in USD. */
355
+ costUsd?: number;
439
356
  }
440
357
  /** @experimental */
441
358
  type UiJudge = (input: UiJudgeInput) => Promise<UiJudgeOutput>;
442
-
443
- /**
444
- *
445
- * `createInProcessUiAuditClient` — a `SandboxClient` that drives a
446
- * Playwright browser in-process and delegates finding identification to a
447
- * consumer-supplied {@link UiJudge}.
448
- *
449
- * Why this exists: `runAgentRounds` is built around a sandbox-SDK seam — each
450
- * iteration is `client.create() → box.streamPrompt() → box.delete()`.
451
- * For UI audit, spinning up a real container running a coding harness
452
- * per iteration is overkill: the work is one browser capture + one
453
- * vision LLM call. This client satisfies the kernel contract while
454
- * doing the audit in-process; no container, no sandbox-SDK backend.
455
- *
456
- * The client owns ONE browser for its lifetime and creates a fresh
457
- * context per iteration (isolated cookies/storage). Playwright is
458
- * dynamically imported so consumers who use a different `SandboxClient`
459
- * — e.g. a fleet executor that drives Playwright remotely — do not pay
460
- * the peer dep cost.
461
- *
462
- * Concurrency: each iteration's prompt carries a self-describing task
463
- * envelope (see `prompt.ts`), so concurrent fanout iterations do not race
464
- * over per-client side state.
465
- *
466
- * @experimental
467
- */
468
-
359
+ //#endregion
360
+ //#region src/profiles/ui-auditor/in-process-client.d.ts
469
361
  /** @experimental */
470
362
  interface InProcessUiAuditClientOptions {
471
- /**
472
- * Absolute path under which screenshots are written. Each capture lands
473
- * at `<workspaceDir>/screenshots/<filename>`; finding screenshot paths
474
- * are workspace-relative (`screenshots/<filename>`).
475
- */
476
- workspaceDir: string;
477
- /** The vision judge that turns captures into findings. */
478
- judge: UiJudge;
479
- /**
480
- * Navigation policy.
481
- *
482
- * `'strict'` (default) waits for `networkidle` and fails the iteration
483
- * if the page does not settle. `'spa'` waits for `domcontentloaded` —
484
- * use for single-page apps that hold open long-poll/websocket
485
- * connections and never settle.
486
- */
487
- navPolicy?: 'strict' | 'spa';
488
- /**
489
- * Browser launch override. Default: chromium headless via Playwright.
490
- * Consumers pass a custom factory to target a remote browser, a
491
- * different channel, or a fleet adapter.
492
- */
493
- launchBrowser?: () => Promise<BrowserHandle>;
363
+ /**
364
+ * Absolute path under which screenshots are written. Each capture lands
365
+ * at `<workspaceDir>/screenshots/<filename>`; finding screenshot paths
366
+ * are workspace-relative (`screenshots/<filename>`).
367
+ */
368
+ workspaceDir: string;
369
+ /** The vision judge that turns captures into findings. */
370
+ judge: UiJudge;
371
+ /**
372
+ * Navigation policy.
373
+ *
374
+ * `'strict'` (default) waits for `networkidle` and fails the iteration
375
+ * if the page does not settle. `'spa'` waits for `domcontentloaded` —
376
+ * use for single-page apps that hold open long-poll/websocket
377
+ * connections and never settle.
378
+ */
379
+ navPolicy?: 'strict' | 'spa';
380
+ /**
381
+ * Browser launch override. Default: chromium headless via Playwright.
382
+ * Consumers pass a custom factory to target a remote browser, a
383
+ * different channel, or a fleet adapter.
384
+ */
385
+ launchBrowser?: () => Promise<BrowserHandle>;
494
386
  }
495
387
  /** @experimental */
496
388
  interface BrowserHandle {
497
- newContext(options?: {
498
- viewport?: {
499
- width: number;
500
- height: number;
501
- };
502
- }): Promise<BrowserContextHandle>;
503
- close(): Promise<void>;
389
+ newContext(options?: {
390
+ viewport?: {
391
+ width: number;
392
+ height: number;
393
+ };
394
+ }): Promise<BrowserContextHandle>;
395
+ close(): Promise<void>;
504
396
  }
505
397
  /** @experimental */
506
398
  interface BrowserContextHandle {
507
- newPage(): Promise<PageHandle>;
508
- close(): Promise<void>;
399
+ newPage(): Promise<PageHandle>;
400
+ close(): Promise<void>;
509
401
  }
510
402
  /** @experimental */
511
403
  interface PageHandle {
512
- setViewportSize(size: {
513
- width: number;
514
- height: number;
515
- }): Promise<void>;
516
- goto(url: string, options?: {
517
- waitUntil?: string;
518
- timeout?: number;
519
- }): Promise<unknown>;
520
- waitForSelector(selector: string, options?: {
521
- timeout?: number;
522
- }): Promise<unknown>;
523
- waitForTimeout(ms: number): Promise<void>;
524
- screenshot(options: {
404
+ setViewportSize(size: {
405
+ width: number;
406
+ height: number;
407
+ }): Promise<void>;
408
+ goto(url: string, options?: {
409
+ waitUntil?: string;
410
+ timeout?: number;
411
+ }): Promise<unknown>;
412
+ waitForSelector(selector: string, options?: {
413
+ timeout?: number;
414
+ }): Promise<unknown>;
415
+ waitForTimeout(ms: number): Promise<void>;
416
+ screenshot(options: {
417
+ path: string;
418
+ fullPage?: boolean;
419
+ }): Promise<void>;
420
+ locator(selector: string): {
421
+ first(): {
422
+ screenshot(options: {
525
423
  path: string;
526
- fullPage?: boolean;
527
- }): Promise<void>;
528
- locator(selector: string): {
529
- first(): {
530
- screenshot(options: {
531
- path: string;
532
- }): Promise<void>;
533
- };
424
+ }): Promise<void>;
534
425
  };
426
+ };
535
427
  }
536
428
  /** Create a `SandboxClient` that drives a local Playwright browser for in-process UI audits. @experimental */
537
429
  declare function createInProcessUiAuditClient(options: InProcessUiAuditClientOptions): SandboxClient & {
538
- /**
539
- * Close the underlying browser. Idempotent.
540
- *
541
- * Contract: callers MUST ensure no iterations are in flight when this is
542
- * called. The kernel respects this — `runAgentRounds` awaits every iteration
543
- * before returning, so `await runAgentRounds(...); await client.close()` is the
544
- * intended pattern (see `examples/ui-audit`). If `close()` is invoked
545
- * concurrently with a running iteration, the browser teardown will race
546
- * against in-flight page operations; the iteration will surface an
547
- * AggregateError carrying both the iteration error and the close error,
548
- * but no work is lost silently.
549
- */
550
- close(): Promise<void>;
430
+ /**
431
+ * Close the underlying browser. Idempotent.
432
+ *
433
+ * Contract: callers MUST ensure no iterations are in flight when this is
434
+ * called. The kernel respects this — `runAgentRounds` awaits every iteration
435
+ * before returning, so `await runAgentRounds(...); await client.close()` is the
436
+ * intended pattern (see `examples/ui-audit`). If `close()` is invoked
437
+ * concurrently with a running iteration, the browser teardown will race
438
+ * against in-flight page operations; the iteration will surface an
439
+ * AggregateError carrying both the iteration error and the close error,
440
+ * but no work is lost silently.
441
+ */
442
+ close(): Promise<void>;
551
443
  };
552
-
553
- /**
554
- *
555
- * Per-lens guidance the auditor inlines into its system prompt for an
556
- * iteration. Each entry is a self-contained brief — the same content the
557
- * standalone ui-issue-finder skill ships, embedded as a string constant so
558
- * agent-runtime carries no runtime dep on that external workspace.
559
- *
560
- * Briefs are deliberately concrete: they enumerate the SIGNALS to look for
561
- * and the cross-lens distinctions to respect, so the judge files fewer
562
- * pile-on findings under generic labels.
563
- *
564
- * @experimental
565
- */
566
-
444
+ //#endregion
445
+ //#region src/profiles/ui-auditor/lens-prompts.d.ts
567
446
  /** Cross-lens rules injected into every UI audit iteration: finding quality standards and scope limits. @experimental */
568
447
  declare const SHARED_AUDITOR_RULES: string;
569
448
  /** Per-lens auditor briefs: concrete signals to look for and cross-lens distinctions to respect. @experimental */
@@ -574,57 +453,29 @@ declare const LENS_BRIEFS: Record<UiLens, string>;
574
453
  * @experimental
575
454
  */
576
455
  declare function buildAuditorSystemPrompt(lens: UiLens): string;
577
-
578
- /**
579
- *
580
- * Sandbox-event stream → UiAuditOutput decoder. The custom auditor
581
- * `SandboxClient` emits events of the form:
582
- *
583
- * { type: 'audit.capture', data: UiAuditCapture }
584
- * { type: 'audit.finding', data: UiFinding }
585
- * { type: 'audit.notes', data: { notes: string } }
586
- * { type: 'audit.lens', data: { lens: UiLens } }
587
- * { type: 'done', data: { tokenUsage: { ... }, totalCostUsd?: number } }
588
- *
589
- * Other event types are tolerated and ignored. The adapter is pure: it
590
- * folds an already-collected event array into a UiAuditOutput.
591
- *
592
- * @experimental
593
- */
594
-
456
+ //#endregion
457
+ //#region src/profiles/ui-auditor/output-adapter.d.ts
595
458
  /** Parse raw `SandboxEvent` emissions from an audit iteration into structured `UiAuditOutput`. @experimental */
596
459
  declare function parseAuditorEvents(events: SandboxEvent[]): UiAuditOutput;
597
-
598
- /**
599
- *
600
- * `uiAuditorProfile` — preset for vision-driven UI audit iterations.
601
- *
602
- * A `runAgentRounds` bundle: it returns the `AgentRunSpec`, output adapter, validator, and prompt
603
- * formatter the loop kernel needs. The agent's "harness" is not a sandbox-SDK code-runner — it's a
604
- * vision-capable judge driving a browser. The loop kernel still iterates
605
- * `client.create() → box.streamPrompt() → box.delete()`; the client/box pair are provided by
606
- * `createInProcessUiAuditClient` (in `./in-process-client.ts`) or a consumer-supplied `SandboxClient`.
607
- *
608
- * @experimental
609
- */
610
-
460
+ //#endregion
461
+ //#region src/profiles/ui-auditor/profile.d.ts
611
462
  /** @experimental */
612
463
  interface UiAuditorProfileOptions {
613
- /**
614
- * Stable name surfaced in trace events. Defaults to `ui-auditor`.
615
- */
616
- name?: string;
617
- /**
618
- * Optional model identifier passed in `AgentProfile.model.default`.
619
- * The consumer's `SandboxClient` chooses how to interpret it.
620
- */
621
- model?: string;
622
- /**
623
- * Task bound to the validator. Without it the validator uses the lens
624
- * embedded in the iteration output as its expectation — fine for one-off
625
- * use; less strict than passing the task explicitly.
626
- */
627
- task?: UiAuditTask;
464
+ /**
465
+ * Stable name surfaced in trace events. Defaults to `ui-auditor`.
466
+ */
467
+ name?: string;
468
+ /**
469
+ * Optional model identifier passed in `AgentProfile.model.default`.
470
+ * The consumer's `SandboxClient` chooses how to interpret it.
471
+ */
472
+ model?: string;
473
+ /**
474
+ * Task bound to the validator. Without it the validator uses the lens
475
+ * embedded in the iteration output as its expectation — fine for one-off
476
+ * use; less strict than passing the task explicitly.
477
+ */
478
+ task?: UiAuditTask;
628
479
  }
629
480
  /**
630
481
  * Preset `runAgentRounds` bundle for vision-driven UI audits: returns the `AgentRunSpec`, output adapter, validator, and prompt formatter the loop kernel needs.
@@ -632,32 +483,14 @@ interface UiAuditorProfileOptions {
632
483
  * @experimental
633
484
  */
634
485
  declare function uiAuditorProfile(options?: UiAuditorProfileOptions): {
635
- profile: AgentProfile$1;
636
- taskToPrompt: (task: UiAuditTask) => string;
637
- output: OutputAdapter<UiAuditOutput>;
638
- validator: Validator<UiAuditOutput>;
639
- agentRunSpec: AgentRunSpec<UiAuditTask>;
486
+ profile: AgentProfile;
487
+ taskToPrompt: (task: UiAuditTask) => string;
488
+ output: OutputAdapter<UiAuditOutput>;
489
+ validator: Validator<UiAuditOutput>;
490
+ agentRunSpec: AgentRunSpec<UiAuditTask>;
640
491
  };
641
-
642
- /**
643
- *
644
- * Prompt formatter for the auditor profile. `formatAuditorPrompt` produces
645
- * the user message handed to the iteration — describes the captures to be
646
- * taken and the lens to apply. The system prompt comes from
647
- * `buildAuditorSystemPrompt(lens)` (lens-prompts.ts).
648
- *
649
- * The formatter prepends a machine-readable envelope (`<<UI_AUDIT_TASK>>`
650
- * … `<<UI_AUDIT_TASK_END>>`) carrying a JSON-serialised task. The
651
- * in-process auditor client recovers the task from this envelope so the
652
- * iteration is self-describing — robust to concurrent fanout, where any
653
- * per-client side state (e.g. a "current task" register) would race.
654
- *
655
- * The formatter is pure and deterministic — re-run on the same task
656
- * produces the same prompt. Tests and trace replays rely on this.
657
- *
658
- * @experimental
659
- */
660
-
492
+ //#endregion
493
+ //#region src/profiles/ui-auditor/prompt.d.ts
661
494
  /** Wrap a `UiAuditTask` in a machine-readable envelope so iterations are self-describing. @experimental */
662
495
  declare function encodeAuditTaskEnvelope(task: UiAuditTask): string;
663
496
  /**
@@ -670,37 +503,10 @@ declare function encodeAuditTaskEnvelope(task: UiAuditTask): string;
670
503
  declare function decodeAuditTaskEnvelope(prompt: string): UiAuditTask | undefined;
671
504
  /** Produce the user message for one audit iteration: lens, captures to take, and the task envelope. @experimental */
672
505
  declare function formatAuditorPrompt(task: UiAuditTask): string;
673
-
674
- /**
675
- *
676
- * Auditor validator — scores a single iteration's findings for actionability
677
- * and gates the iteration result. The kernel uses `valid` + `score` for
678
- * winner selection across fanned-out iterations and to detect a degenerate
679
- * iteration (lens-violating findings, no screenshot evidence, no findings
680
- * at all on a route where we expected some).
681
- *
682
- * Hard fails (`valid = false`):
683
- * - A finding is filed under a lens that does not match the iteration's
684
- * lens. The whole iteration is bad — the judge isn't following the
685
- * lens discipline and the resulting Markdown would mislead reviewers.
686
- * - A finding has no screenshot reference.
687
- * - A finding's screenshot references a path that wasn't captured in
688
- * this iteration.
689
- *
690
- * Score (0..1, max two decimals stable):
691
- * - 0.4 * specificityRatio — proportion of findings with a selector
692
- * - 0.4 * evidenceRatio — proportion of findings whose screenshots resolve to captures
693
- * - 0.2 * (1 - genericTitleRatio) — proportion of findings whose titles
694
- * are concrete (not "improve UX", "fix layout", etc.)
695
- *
696
- * An iteration with zero findings scores 0.5 by convention — neither a
697
- * confident pass nor a hard failure (the judge might just have nothing to
698
- * say on this lens). The driver decides what to do with it.
699
- *
700
- * @experimental
701
- */
702
-
506
+ //#endregion
507
+ //#region src/profiles/ui-auditor/validator.d.ts
703
508
  /** Build a `Validator` that rejects off-lens findings and findings missing screenshot evidence. @experimental */
704
509
  declare function createUiAuditorValidator(task: UiAuditTask): Validator<UiAuditOutput>;
705
-
706
- export { type AppendFindingsResult, type AuditIndex, type AuditRegistry, type AuditRegistryCapture, type BrowserContextHandle, type BrowserHandle, type InProcessUiAuditClientOptions, type KnowledgeItem, type KnowledgeUpdate, LENS_BRIEFS, type MultiHarnessResearcherFanoutOptions, type PageHandle, type RegisterCapturesOptions, type ResearchOutput, type ResearchSource, type ResearchTask, type ResearcherProfileOptions, SHARED_AUDITOR_RULES, type UiAuditCapture, type UiAuditCaptureRequest, type UiAuditOutput, type UiAuditTask, type UiAuditViewport, type UiAuditorProfileOptions, UiFinding, type UiJudge, type UiJudgeInput, type UiJudgeOutput, type UiJudgeTokenUsage, UiLens, appendFindings, buildAuditorSystemPrompt, createInProcessUiAuditClient, createResearcherValidator, createUiAuditorValidator, decodeAuditTaskEnvelope, encodeAuditTaskEnvelope, formatAuditorPrompt, initAuditWorkspace, multiHarnessResearcherFanout, parseAuditorEvents, readAuditRegistry, registerCaptures, researcherProfile, summarizeRegistry, uiAuditorProfile, writeAuditIndex };
510
+ //#endregion
511
+ export { type AppendFindingsResult, type AuditIndex, type AuditRegistry, type AuditRegistryCapture, type BrowserContextHandle, type BrowserHandle, type CoderTask, type InProcessUiAuditClientOptions, type KnowledgeItem, type KnowledgeUpdate, LENS_BRIEFS, type MultiHarnessResearcherFanoutOptions, type PageHandle, type RegisterCapturesOptions, type ResearchOutput, type ResearchSource, type ResearchTask, type ResearcherProfileOptions, SHARED_AUDITOR_RULES, UI_FINDING_SEVERITIES, UI_LENSES, type UiAuditCapture, type UiAuditCaptureRequest, type UiAuditOutput, type UiAuditTask, type UiAuditViewport, type UiAuditorProfileOptions, type UiFinding, type UiFindingScreenshot, type UiFindingSeverity, type UiJudge, type UiJudgeInput, type UiJudgeOutput, type UiJudgeTokenUsage, type UiLens, appendFindings, buildAuditorSystemPrompt, coderTaskToPrompt, createInProcessUiAuditClient, createResearcherValidator, createUiAuditorValidator, decodeAuditTaskEnvelope, encodeAuditTaskEnvelope, formatAuditorPrompt, initAuditWorkspace, multiHarnessResearcherFanout, parseAuditorEvents, readAuditRegistry, registerCaptures, researcherProfile, summarizeRegistry, uiAuditorProfile, writeAuditIndex };
512
+ //# sourceMappingURL=profiles.d.ts.map