@inflexa-ai/harness 0.1.1 → 0.3.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 (330) hide show
  1. package/README.md +48 -0
  2. package/dist/agents/conversation-agent.d.ts +15 -11
  3. package/dist/agents/conversation-agent.js +31 -34
  4. package/dist/agents/report-builder.js +2 -1
  5. package/dist/agents/sandbox/bulk-transcriptomics-agent.js +1 -1
  6. package/dist/agents/sandbox/cheminformatics-agent.js +1 -19
  7. package/dist/agents/sandbox/chromatin-agent.js +1 -10
  8. package/dist/agents/sandbox/dna-methylation-agent.js +1 -10
  9. package/dist/agents/sandbox/drug-repurposing-agent.js +4 -14
  10. package/dist/agents/sandbox/enrichment-agent.js +1 -10
  11. package/dist/agents/sandbox/ephemeral-executor.js +1 -10
  12. package/dist/agents/sandbox/genomic-variant-agent.js +1 -3
  13. package/dist/agents/sandbox/immune-profiling-agent.js +1 -13
  14. package/dist/agents/sandbox/metabolomics-agent.js +1 -1
  15. package/dist/agents/sandbox/microbiome-agent.js +1 -1
  16. package/dist/agents/sandbox/multi-omics-integration-agent.js +1 -12
  17. package/dist/agents/sandbox/multimodal-sc-agent.js +1 -1
  18. package/dist/agents/sandbox/network-agent.js +1 -10
  19. package/dist/agents/sandbox/pkpd-clinical-response-agent.js +2 -8
  20. package/dist/agents/sandbox/proteomics-agent.js +1 -1
  21. package/dist/agents/sandbox/scientific-executor.js +1 -10
  22. package/dist/agents/sandbox/shared.d.ts +20 -6
  23. package/dist/agents/sandbox/shared.js +50 -39
  24. package/dist/agents/sandbox/single-cell-agent.js +1 -1
  25. package/dist/agents/sandbox/spatial-omics-agent.js +1 -1
  26. package/dist/agents/sandbox/statistical-modeling-agent.js +1 -1
  27. package/dist/agents/sandbox/translational-safety-agent.js +3 -9
  28. package/dist/agents/sandbox/types.d.ts +1 -1
  29. package/dist/agents/system-prompt.d.ts +37 -11
  30. package/dist/agents/system-prompt.js +35 -12
  31. package/dist/app/chat-turn.d.ts +3 -0
  32. package/dist/app/chat-turn.js +3 -1
  33. package/dist/app/data-profile-orientation.d.ts +34 -0
  34. package/dist/app/data-profile-orientation.js +117 -0
  35. package/dist/app/synthesize-run.d.ts +3 -0
  36. package/dist/app/synthesize-run.js +3 -1
  37. package/dist/contracts/schemas/chat-parts.d.ts +9 -9
  38. package/dist/execution/artifact-metadata.d.ts +3 -0
  39. package/dist/execution/artifact-metadata.js +10 -3
  40. package/dist/execution/artifact-registration.d.ts +2 -1
  41. package/dist/execution/artifact-registration.js +8 -2
  42. package/dist/execution/ephemeral-runner.d.ts +16 -0
  43. package/dist/execution/ephemeral-runner.js +31 -5
  44. package/dist/execution/post-step-pipeline.d.ts +3 -0
  45. package/dist/execution/post-step-pipeline.js +24 -4
  46. package/dist/execution/reconcile-manifest.d.ts +7 -0
  47. package/dist/execution/reconcile-manifest.js +19 -5
  48. package/dist/execution/report-runner.d.ts +3 -0
  49. package/dist/execution/report-runner.js +4 -4
  50. package/dist/execution/run-synthesis.js +20 -19
  51. package/dist/execution/step-summary.d.ts +3 -0
  52. package/dist/execution/step-summary.js +6 -3
  53. package/dist/index.d.ts +9 -2
  54. package/dist/index.js +24 -5
  55. package/dist/lib/chrome.d.ts +4 -1
  56. package/dist/lib/chrome.js +10 -7
  57. package/dist/lib/console-logger.d.ts +19 -0
  58. package/dist/lib/console-logger.js +62 -0
  59. package/dist/lib/logger.d.ts +88 -0
  60. package/dist/lib/logger.js +37 -0
  61. package/dist/lib/otel.d.ts +2 -1
  62. package/dist/lib/otel.js +8 -3
  63. package/dist/loop/__fixtures__/scripted-provider.d.ts +2 -2
  64. package/dist/loop/__fixtures__/scripted-provider.js +2 -1
  65. package/dist/loop/metrics.d.ts +33 -1
  66. package/dist/loop/metrics.js +56 -2
  67. package/dist/loop/run-agent.d.ts +13 -1
  68. package/dist/loop/run-agent.js +19 -4
  69. package/dist/memory/card-builders.d.ts +8 -1
  70. package/dist/memory/card-builders.js +20 -3
  71. package/dist/memory/reconstruct-cards.js +4 -3
  72. package/dist/memory/thread-history.d.ts +27 -2
  73. package/dist/memory/thread-history.js +45 -5
  74. package/dist/memory/working-memory.d.ts +93 -10
  75. package/dist/memory/working-memory.js +220 -84
  76. package/dist/prompts/SOUL.d.ts +22 -9
  77. package/dist/prompts/SOUL.js +56 -37
  78. package/dist/prompts/analogical-reasoner.d.ts +1 -1
  79. package/dist/prompts/analogical-reasoner.js +2 -2
  80. package/dist/prompts/briefing.d.ts +100 -0
  81. package/dist/prompts/briefing.js +166 -0
  82. package/dist/prompts/conversation.d.ts +1 -1
  83. package/dist/prompts/conversation.js +94 -440
  84. package/dist/prompts/literature-reviewer.d.ts +1 -1
  85. package/dist/prompts/literature-reviewer.js +10 -10
  86. package/dist/prompts/planner.js +28 -59
  87. package/dist/prompts/report-builder.d.ts +1 -1
  88. package/dist/prompts/report-builder.js +71 -24
  89. package/dist/prompts/sandbox/bulk-transcriptomics-agent.d.ts +1 -1
  90. package/dist/prompts/sandbox/bulk-transcriptomics-agent.js +2 -7
  91. package/dist/prompts/sandbox/cheminformatics-agent.d.ts +1 -1
  92. package/dist/prompts/sandbox/cheminformatics-agent.js +11 -15
  93. package/dist/prompts/sandbox/chromatin-agent.d.ts +1 -1
  94. package/dist/prompts/sandbox/chromatin-agent.js +3 -7
  95. package/dist/prompts/sandbox/data-profiler.d.ts +1 -1
  96. package/dist/prompts/sandbox/data-profiler.js +13 -8
  97. package/dist/prompts/sandbox/dna-methylation-agent.d.ts +1 -1
  98. package/dist/prompts/sandbox/dna-methylation-agent.js +2 -7
  99. package/dist/prompts/sandbox/drug-repurposing-agent.d.ts +1 -1
  100. package/dist/prompts/sandbox/drug-repurposing-agent.js +15 -16
  101. package/dist/prompts/sandbox/enrichment-agent.d.ts +1 -1
  102. package/dist/prompts/sandbox/enrichment-agent.js +2 -9
  103. package/dist/prompts/sandbox/genomic-variant-agent.d.ts +1 -1
  104. package/dist/prompts/sandbox/genomic-variant-agent.js +2 -6
  105. package/dist/prompts/sandbox/immune-profiling-agent.d.ts +1 -1
  106. package/dist/prompts/sandbox/immune-profiling-agent.js +3 -8
  107. package/dist/prompts/sandbox/metabolomics-agent.d.ts +1 -1
  108. package/dist/prompts/sandbox/metabolomics-agent.js +1 -7
  109. package/dist/prompts/sandbox/microbiome-agent.d.ts +1 -1
  110. package/dist/prompts/sandbox/microbiome-agent.js +2 -7
  111. package/dist/prompts/sandbox/multi-omics-integration-agent.d.ts +1 -1
  112. package/dist/prompts/sandbox/multi-omics-integration-agent.js +2 -8
  113. package/dist/prompts/sandbox/multimodal-sc-agent.d.ts +1 -1
  114. package/dist/prompts/sandbox/multimodal-sc-agent.js +2 -7
  115. package/dist/prompts/sandbox/network-agent.d.ts +1 -1
  116. package/dist/prompts/sandbox/network-agent.js +2 -7
  117. package/dist/prompts/sandbox/proteomics-agent.d.ts +1 -1
  118. package/dist/prompts/sandbox/proteomics-agent.js +2 -9
  119. package/dist/prompts/sandbox/single-cell-agent.d.ts +1 -1
  120. package/dist/prompts/sandbox/single-cell-agent.js +2 -9
  121. package/dist/prompts/sandbox/spatial-omics-agent.d.ts +1 -1
  122. package/dist/prompts/sandbox/spatial-omics-agent.js +3 -6
  123. package/dist/prompts/sandbox/statistical-modeling-agent.d.ts +1 -1
  124. package/dist/prompts/sandbox/statistical-modeling-agent.js +2 -7
  125. package/dist/prompts/sandbox/translational-safety-agent.d.ts +1 -1
  126. package/dist/prompts/sandbox/translational-safety-agent.js +13 -14
  127. package/dist/prompts/sandbox-standards.d.ts +22 -14
  128. package/dist/prompts/sandbox-standards.js +91 -71
  129. package/dist/prompts/synthesis-agent.d.ts +1 -1
  130. package/dist/prompts/synthesis-agent.js +33 -131
  131. package/dist/provenance/collector.js +1 -1
  132. package/dist/providers/ai-sdk.js +31 -4
  133. package/dist/providers/prompt-cache.d.ts +74 -0
  134. package/dist/providers/prompt-cache.js +77 -0
  135. package/dist/providers/types.d.ts +33 -0
  136. package/dist/reference-data/catalog.d.ts +131 -0
  137. package/dist/reference-data/catalog.js +348 -0
  138. package/dist/reference-data/receipt.d.ts +41 -0
  139. package/dist/reference-data/receipt.js +40 -0
  140. package/dist/runtime/boot.d.ts +2 -2
  141. package/dist/runtime/boot.js +1 -1
  142. package/dist/runtime/connection-budget.d.ts +2 -2
  143. package/dist/runtime/connection-budget.js +5 -3
  144. package/dist/runtime/dbos.d.ts +7 -7
  145. package/dist/runtime/dbos.js +14 -11
  146. package/dist/runtime/shutdown.d.ts +2 -2
  147. package/dist/runtime/shutdown.js +4 -3
  148. package/dist/sandbox/create-sandbox.d.ts +2 -2
  149. package/dist/sandbox/docker-client.d.ts +2 -2
  150. package/dist/sandbox/docker-client.js +4 -1
  151. package/dist/sandbox/k8s-client.d.ts +3 -0
  152. package/dist/sandbox/k8s-client.js +5 -4
  153. package/dist/sandbox/notification-sweep.d.ts +3 -3
  154. package/dist/sandbox/notification-sweep.js +4 -2
  155. package/dist/sandbox/reaper.d.ts +3 -3
  156. package/dist/sandbox/reaper.js +7 -4
  157. package/dist/sandbox/watchdog.d.ts +3 -3
  158. package/dist/sandbox/watchdog.js +8 -2
  159. package/dist/schemas/data-profile-schemas.js +5 -3
  160. package/dist/schemas/plan-schemas.d.ts +21 -21
  161. package/dist/schemas/plan-schemas.js +9 -3
  162. package/dist/schemas/run-synthesis.d.ts +8 -4
  163. package/dist/schemas/run-synthesis.js +92 -56
  164. package/dist/schemas/validate-plan.js +1 -1
  165. package/dist/schemas/workflow-state.d.ts +7 -1
  166. package/dist/schemas/workflow-state.js +33 -19
  167. package/dist/state/artifacts.d.ts +13 -0
  168. package/dist/state/artifacts.js +27 -0
  169. package/dist/state/data-profile.d.ts +64 -5
  170. package/dist/state/index.d.ts +3 -3
  171. package/dist/state/index.js +1 -1
  172. package/dist/state/init.d.ts +2 -1
  173. package/dist/state/init.js +5 -6
  174. package/dist/tasks/data-profile.d.ts +25 -2
  175. package/dist/tasks/data-profile.js +95 -39
  176. package/dist/tools/bio/chembl.d.ts +38 -0
  177. package/dist/tools/bio/chembl.js +138 -0
  178. package/dist/tools/bio/comptox.d.ts +50 -0
  179. package/dist/tools/bio/comptox.js +149 -0
  180. package/dist/tools/bio/get-impc-ko-profile.js +9 -6
  181. package/dist/tools/bio/index.d.ts +5 -17
  182. package/dist/tools/bio/index.js +5 -17
  183. package/dist/tools/bio/keys.d.ts +14 -9
  184. package/dist/tools/bio/keys.js +16 -16
  185. package/dist/tools/bio/opentargets.d.ts +38 -0
  186. package/dist/tools/bio/opentargets.js +89 -0
  187. package/dist/tools/bio/pubchem.d.ts +29 -0
  188. package/dist/tools/bio/pubchem.js +92 -0
  189. package/dist/tools/bio/pubmed.d.ts +51 -0
  190. package/dist/tools/bio/pubmed.js +100 -0
  191. package/dist/tools/bio/search-bgee-expression.js +12 -6
  192. package/dist/tools/bio/search-clinical-trials.js +16 -5
  193. package/dist/tools/bio/search-dgidb.d.ts +11 -1
  194. package/dist/tools/bio/search-dgidb.js +92 -78
  195. package/dist/tools/bio/search-faers.js +8 -4
  196. package/dist/tools/bio/search-geo-datasets.js +20 -6
  197. package/dist/tools/bio/search-gwas-catalog.d.ts +1 -1
  198. package/dist/tools/bio/search-pharmgkb.js +10 -4
  199. package/dist/tools/display/index.d.ts +1 -0
  200. package/dist/tools/display/index.js +1 -0
  201. package/dist/tools/display/normalize-echart-spec.d.ts +61 -0
  202. package/dist/tools/display/normalize-echart-spec.js +211 -0
  203. package/dist/tools/display/show-user.d.ts +6 -1
  204. package/dist/tools/display/show-user.js +25 -12
  205. package/dist/tools/execute-plan.js +5 -2
  206. package/dist/tools/iterate-report.d.ts +171 -118
  207. package/dist/tools/iterate-report.js +336 -96
  208. package/dist/tools/lib/chembl-client.d.ts +12 -0
  209. package/dist/tools/lib/chembl-client.js +127 -0
  210. package/dist/tools/lib/ctx-ops.d.ts +224 -0
  211. package/dist/tools/lib/ctx-ops.js +450 -0
  212. package/dist/tools/lib/iuphar-client.js +10 -1
  213. package/dist/tools/lib/openfda-client.js +11 -3
  214. package/dist/tools/lib/pathway-client.js +10 -4
  215. package/dist/tools/lib/pubchem-ops.d.ts +74 -0
  216. package/dist/tools/lib/pubchem-ops.js +224 -0
  217. package/dist/tools/memory/update-working-memory.d.ts +45 -7
  218. package/dist/tools/memory/update-working-memory.js +111 -41
  219. package/dist/tools/report/index.d.ts +3 -2
  220. package/dist/tools/report/index.js +3 -2
  221. package/dist/tools/research/generate-analogy-report.js +25 -12
  222. package/dist/tools/research/generate-plan.d.ts +12 -5
  223. package/dist/tools/research/generate-plan.js +168 -37
  224. package/dist/tools/research/index.d.ts +1 -0
  225. package/dist/tools/research/index.js +1 -0
  226. package/dist/tools/research/inspect-data-profile.d.ts +85 -0
  227. package/dist/tools/research/inspect-data-profile.js +161 -0
  228. package/dist/tools/research/literature-reviewer.d.ts +3 -0
  229. package/dist/tools/research/literature-reviewer.js +5 -6
  230. package/dist/tools/sandbox/list-available-packages.d.ts +79 -5
  231. package/dist/tools/sandbox/list-available-packages.js +152 -10
  232. package/dist/tools/sandbox/list-available-refs.d.ts +141 -5
  233. package/dist/tools/sandbox/list-available-refs.js +647 -134
  234. package/dist/tools/sandbox/report-blocker.d.ts +39 -9
  235. package/dist/tools/sandbox/report-blocker.js +43 -20
  236. package/dist/tools/workspace/execute-command.d.ts +3 -0
  237. package/dist/tools/workspace/execute-command.js +3 -1
  238. package/dist/tools/workspace/read-file.js +4 -5
  239. package/dist/tools/workspace/run-exec.d.ts +4 -4
  240. package/dist/tools/workspace/run-exec.js +4 -4
  241. package/dist/tools/workspace/show-file.js +10 -6
  242. package/dist/tools/workspace/show-plan.js +12 -6
  243. package/dist/tools/workspace/workspace-search.d.ts +1 -1
  244. package/dist/tools/workspace/workspace-search.js +11 -5
  245. package/dist/workflows/execute-analysis.d.ts +46 -4
  246. package/dist/workflows/execute-analysis.js +118 -13
  247. package/dist/workflows/execute-target-assessment.d.ts +3 -0
  248. package/dist/workflows/execute-target-assessment.js +19 -15
  249. package/dist/workflows/sandbox-step.d.ts +9 -0
  250. package/dist/workflows/sandbox-step.js +39 -17
  251. package/dist/workflows/target-assessment/lib/citation-validator.js +2 -2
  252. package/dist/workflows/target-assessment/lib/clinical-consequence-annotator.js +2 -1
  253. package/dist/workflows/target-assessment/lib/llm-step.d.ts +3 -0
  254. package/dist/workflows/target-assessment/lib/llm-step.js +3 -1
  255. package/dist/workflows/target-assessment/lib/structured-llm.d.ts +3 -0
  256. package/dist/workflows/target-assessment/lib/structured-llm.js +1 -0
  257. package/dist/workflows/target-assessment/phase5-persist.d.ts +3 -0
  258. package/dist/workflows/target-assessment/phase5-persist.js +8 -3
  259. package/dist/workflows/target-assessment/progress.d.ts +2 -1
  260. package/dist/workflows/target-assessment/progress.js +4 -3
  261. package/dist/workspace/filesystem.js +163 -74
  262. package/dist/workspace/paths.d.ts +2 -2
  263. package/dist/workspace/paths.js +2 -2
  264. package/package.json +95 -96
  265. package/dist/execution/filesystem-artifact-registry.d.ts +0 -57
  266. package/dist/execution/filesystem-artifact-registry.js +0 -92
  267. package/dist/lib/identifiers.d.ts +0 -8
  268. package/dist/lib/identifiers.js +0 -10
  269. package/dist/lib/mime-detect.d.ts +0 -17
  270. package/dist/lib/mime-detect.js +0 -29
  271. package/dist/lib/streamed-download.d.ts +0 -28
  272. package/dist/lib/streamed-download.js +0 -111
  273. package/dist/lib/trace-context.d.ts +0 -11
  274. package/dist/lib/trace-context.js +0 -49
  275. package/dist/providers/llm-capabilities.d.ts +0 -33
  276. package/dist/providers/llm-capabilities.js +0 -58
  277. package/dist/schemas/render-step-prompt.d.ts +0 -32
  278. package/dist/schemas/render-step-prompt.js +0 -76
  279. package/dist/tools/bio/find-approval-precedent.d.ts +0 -32
  280. package/dist/tools/bio/find-approval-precedent.js +0 -72
  281. package/dist/tools/bio/get-article-details.d.ts +0 -11
  282. package/dist/tools/bio/get-article-details.js +0 -20
  283. package/dist/tools/bio/get-article-full-text.d.ts +0 -19
  284. package/dist/tools/bio/get-article-full-text.js +0 -32
  285. package/dist/tools/bio/get-bioactivity.d.ts +0 -11
  286. package/dist/tools/bio/get-bioactivity.js +0 -23
  287. package/dist/tools/bio/get-drug-info.d.ts +0 -9
  288. package/dist/tools/bio/get-drug-info.js +0 -22
  289. package/dist/tools/bio/get-mechanism.d.ts +0 -8
  290. package/dist/tools/bio/get-mechanism.js +0 -18
  291. package/dist/tools/bio/get-pubchem-assays.d.ts +0 -22
  292. package/dist/tools/bio/get-pubchem-assays.js +0 -107
  293. package/dist/tools/bio/get-pubchem-cross-refs.d.ts +0 -15
  294. package/dist/tools/bio/get-pubchem-cross-refs.js +0 -68
  295. package/dist/tools/bio/get-target-safety.d.ts +0 -18
  296. package/dist/tools/bio/get-target-safety.js +0 -26
  297. package/dist/tools/bio/search-compounds.d.ts +0 -22
  298. package/dist/tools/bio/search-compounds.js +0 -160
  299. package/dist/tools/bio/search-ctx-chemical.d.ts +0 -50
  300. package/dist/tools/bio/search-ctx-chemical.js +0 -130
  301. package/dist/tools/bio/search-ctx-exposure.d.ts +0 -55
  302. package/dist/tools/bio/search-ctx-exposure.js +0 -176
  303. package/dist/tools/bio/search-ctx-hazard.d.ts +0 -111
  304. package/dist/tools/bio/search-ctx-hazard.js +0 -178
  305. package/dist/tools/bio/search-opentargets.d.ts +0 -11
  306. package/dist/tools/bio/search-opentargets.js +0 -25
  307. package/dist/tools/bio/search-pubchem-compound.d.ts +0 -26
  308. package/dist/tools/bio/search-pubchem-compound.js +0 -110
  309. package/dist/tools/bio/search-pubmed.d.ts +0 -17
  310. package/dist/tools/bio/search-pubmed.js +0 -31
  311. package/dist/tools/bio/search-targets.d.ts +0 -9
  312. package/dist/tools/bio/search-targets.js +0 -20
  313. package/dist/tools/bio/search-toxcast.d.ts +0 -36
  314. package/dist/tools/bio/search-toxcast.js +0 -141
  315. package/dist/workflows/register-workflows.d.ts +0 -51
  316. package/dist/workflows/register-workflows.js +0 -48
  317. package/dist/workflows/resume-execute-analysis.d.ts +0 -70
  318. package/dist/workflows/resume-execute-analysis.js +0 -80
  319. package/dist/workflows/target-assessment/correction-loop.d.ts +0 -45
  320. package/dist/workflows/target-assessment/correction-loop.js +0 -62
  321. package/dist/workflows/target-assessment/steps/phase0-resolve.d.ts +0 -71
  322. package/dist/workflows/target-assessment/steps/phase0-resolve.js +0 -21
  323. package/dist/workflows/target-assessment/steps/phase1-aggregate.d.ts +0 -1018
  324. package/dist/workflows/target-assessment/steps/phase1-aggregate.js +0 -25
  325. package/dist/workspace/mount-strategy.d.ts +0 -50
  326. package/dist/workspace/mount-strategy.js +0 -67
  327. package/dist/workspace/provenance-collector.d.ts +0 -34
  328. package/dist/workspace/provenance-collector.js +0 -16
  329. package/dist/workspace/workspace-paths.d.ts +0 -26
  330. package/dist/workspace/workspace-paths.js +0 -31
package/README.md CHANGED
@@ -37,6 +37,9 @@ import {
37
37
  createNoopArtifactRegistry, // ArtifactRegistry seam
38
38
  UnavailablePreviewPublisher, // PreviewPublisher seam
39
39
  createDbosRunLauncher, // shared RunLauncher
40
+ createConsoleLogger, // Logger — writes to console
41
+ createNoopLogger, // Logger — discards (the fallback when none is wired)
42
+ defaultErrorFields, // the shipped `Logger.errorFields` mapping
40
43
  defineTool,
41
44
  runAgent,
42
45
  makeLocalAuth,
@@ -45,6 +48,51 @@ import {
45
48
 
46
49
  `assembleCoreRuntime` is the single composition point: it registers the durable workflows and builds the conversation agent over them. The harness declares **five capability seams** an embedder wires — `RunAuthorizer`, `ResolveBilling`, `ArtifactRegistry`, `RunCharge`, `PreviewPublisher` — plus the **shared `RunLauncher`** (one host-neutral realization, `createDbosRunLauncher`). Local, dependency-free realizations of all five ship from the barrel; an embedder constructs them (or its own) and passes them in. The harness only ever sees the interface.
47
50
 
51
+ ## Logging
52
+
53
+ The harness names no logging library. It logs through a `Logger` you supply, so the destination, format, and verbosity stay yours:
54
+
55
+ ```ts
56
+ export interface Logger {
57
+ debug(msg: string, fields?: LogFields): void;
58
+ info(msg: string, fields?: LogFields): void;
59
+ warn(msg: string, fields?: LogFields): void;
60
+ error(msg: string, fields?: LogFields): void;
61
+ with(fields: LogFields): Logger; // bind context onto every record (slog's `With`)
62
+ named(name: string): Logger; // bind a namespace, rendered as a `[a.b]` message prefix
63
+ errorFields(err: unknown): LogFields; // normalize a thrown value; `defaultErrorFields` is the shipped mapping
64
+ }
65
+ ```
66
+
67
+ Pass `createConsoleLogger()` if you have no logging infrastructure. Wire nothing and the harness falls back to `createNoopLogger()` — it never falls back to `console`, because a host whose UI owns stdout (an alternate-screen TUI, say) discards console output, and a diagnostic written to a discarded stream is worse than no diagnostic at all.
68
+
69
+ `errorFields` is on the interface, not a helper we own, so your realization can defer to your sink's native error handling rather than a shape we imposed.
70
+
71
+ **Migrating from a version that took a `pino.Logger`** — `bootHarness` and the deps bags now take this interface. pino is object-first where this is message-first, so pass an adapter:
72
+
73
+ ```ts
74
+ import type { LogFields, Logger } from "@inflexa-ai/harness";
75
+ import type pino from "pino";
76
+
77
+ function pinoAsHarnessLogger(p: pino.Logger, names: readonly string[] = []): Logger {
78
+ const prefixed = (msg: string): string => (names.length > 0 ? `[${names.join(".")}] ${msg}` : msg);
79
+ const emit =
80
+ (level: "debug" | "info" | "warn" | "error") =>
81
+ (msg: string, fields?: LogFields): void => {
82
+ p[level](fields ?? {}, prefixed(msg));
83
+ };
84
+ return {
85
+ debug: emit("debug"),
86
+ info: emit("info"),
87
+ warn: emit("warn"),
88
+ error: emit("error"),
89
+ with: (fields) => pinoAsHarnessLogger(p.child(fields), names),
90
+ named: (name) => pinoAsHarnessLogger(p, [...names, name]),
91
+ errorFields: (err) => ({ err }), // let pino's own `err` serializer render it
92
+ };
93
+ }
94
+ ```
95
+
48
96
  ## How it executes
49
97
 
50
98
  Chat is a plain in-process turn (`prepareChatTurn` → `runAgent` → `appendTurn`); the harness ships no HTTP layer, so the host owns the route. Compute-heavy work runs as **durable workflows** — `executeAnalysis` starts a child workflow per plan step once its dependencies have completed, and each step drives a sandbox agent inside a container. The same `runAgent` primitive runs in both modes; durability and the event sink are injected, so the loop body is identical.
@@ -17,13 +17,14 @@
17
17
  * `inspectRun` on a later turn). `run_ephemeral`
18
18
  * is wired here too — it mints a run authorization, starts the turn-scoped DBOS
19
19
  * `ephemeral` workflow, and awaits the result inline; chat disconnect cancels
20
- * the workflow and it is never recovered. `iterateReport` is wired here too — in-process Nunjucks
21
- * rendering driven by the in-process `report-builder` agent (no sandbox);
22
- * the 4 custom report tools (`build_report`, `submit_report`,
23
- * `preview_snapshot`, `mint_preview_url`) plus the version-fs write tools
24
- * (`write_file`, `edit_file`, `read_file`, `mkdir` from `createVersionFsTools`)
25
- * are constructed inside the runner so they share closure-captured outcome
26
- * state + preview-dir paths.
20
+ * the workflow and it is never recovered. Report authoring is wired here as the
21
+ * pair `plan_report` (returns the report-brief schema + authoring rules
22
+ * just-in-time as its result) + `submit_report` (validates the composed brief
23
+ * and drives in-process Nunjucks rendering via the `report-builder` agent, no
24
+ * sandbox). The 4 custom tools the builder itself drives (`build_report`, its
25
+ * own terminal `submit_report`, `preview_snapshot`, `mint_preview_url`) are
26
+ * constructed inside the runner so they share closure-captured outcome state +
27
+ * preview-dir paths.
27
28
  * The workspace read surface (`read_file`, `grep`, `workspace_search`) is
28
29
  * wired here over the `WorkspaceFilesystem` seam.
29
30
  */
@@ -38,12 +39,15 @@ import type { ResolveWorkspaceRoot } from "../workspace/paths.js";
38
39
  import { type BioToolKeys } from "../tools/bio/keys.js";
39
40
  import type { RunAuthorizer } from "../execution/run-authorizer.js";
40
41
  import type { RunLauncher } from "../execution/run-launcher.js";
41
- import { type IterateReportDeps } from "../tools/iterate-report.js";
42
+ import { type SubmitReportDeps } from "../tools/iterate-report.js";
42
43
  import type { EphemeralWorkflowInput, EphemeralResult } from "../execution/ephemeral-runner.js";
44
+ import type { Logger } from "../lib/logger.js";
43
45
  /** Canonical agent id — the single source of truth. */
44
46
  export declare const CONVERSATION_AGENT_ID: "conversation-agent";
45
47
  /** The shared dependencies the composition root explodes apart. */
46
48
  export interface ConversationAgentDeps {
49
+ /** Operational logging seam; omitted falls back to no-op. */
50
+ readonly logger?: Logger;
47
51
  /** The LLM seam every loop-driving tool runs its sub-agent on. */
48
52
  readonly provider: ChatProvider;
49
53
  /** Postgres pool — plan persistence, run inspection, workspace index, working memory. */
@@ -80,14 +84,14 @@ export interface ConversationAgentDeps {
80
84
  */
81
85
  readonly runLauncher: RunLauncher;
82
86
  /**
83
- * Preview-publishing seam factory for `iterate_report` — injected, not
87
+ * Preview-publishing seam factory for `submit_report` — injected, not
84
88
  * constructed here. The managed root closes its platform deps over this; the
85
89
  * OSS root returns the "unavailable" publisher.
86
90
  */
87
- readonly createPreviewPublisher: IterateReportDeps["createPreviewPublisher"];
91
+ readonly createPreviewPublisher: SubmitReportDeps["createPreviewPublisher"];
88
92
  /** API keys for the external bio/chem data sources. */
89
93
  readonly bioKeys: BioToolKeys;
90
- /** Root templates dir for in-process report rendering (`iterateReport`). */
94
+ /** Root templates dir for in-process report rendering (`submit_report`). */
91
95
  readonly templatesDir: string;
92
96
  /** Skills root; the in-process report-builder gets `report-html` skill tools. */
93
97
  readonly skillsDir: string;
@@ -17,13 +17,14 @@
17
17
  * `inspectRun` on a later turn). `run_ephemeral`
18
18
  * is wired here too — it mints a run authorization, starts the turn-scoped DBOS
19
19
  * `ephemeral` workflow, and awaits the result inline; chat disconnect cancels
20
- * the workflow and it is never recovered. `iterateReport` is wired here too — in-process Nunjucks
21
- * rendering driven by the in-process `report-builder` agent (no sandbox);
22
- * the 4 custom report tools (`build_report`, `submit_report`,
23
- * `preview_snapshot`, `mint_preview_url`) plus the version-fs write tools
24
- * (`write_file`, `edit_file`, `read_file`, `mkdir` from `createVersionFsTools`)
25
- * are constructed inside the runner so they share closure-captured outcome
26
- * state + preview-dir paths.
20
+ * the workflow and it is never recovered. Report authoring is wired here as the
21
+ * pair `plan_report` (returns the report-brief schema + authoring rules
22
+ * just-in-time as its result) + `submit_report` (validates the composed brief
23
+ * and drives in-process Nunjucks rendering via the `report-builder` agent, no
24
+ * sandbox). The 4 custom tools the builder itself drives (`build_report`, its
25
+ * own terminal `submit_report`, `preview_snapshot`, `mint_preview_url`) are
26
+ * constructed inside the runner so they share closure-captured outcome state +
27
+ * preview-dir paths.
27
28
  * The workspace read surface (`read_file`, `grep`, `workspace_search`) is
28
29
  * wired here over the `WorkspaceFilesystem` seam.
29
30
  */
@@ -31,16 +32,16 @@ import { createWorkingMemory } from "../memory/working-memory.js";
31
32
  import { conversationPrompt } from "../prompts/conversation.js";
32
33
  import { composeSystemPrompt } from "./system-prompt.js";
33
34
  // Bio-lookup leaf tools (pure — no dependencies).
34
- import { searchGeneTool, searchPathwayTool, lookupGoTermTool, searchInteractionsTool, searchCompoundsTool, getBioactivityTool, searchTargetsTool, getMechanismTool, getDrugInfoTool, searchPubchemCompoundTool, getPubchemCrossRefsTool, getPubchemAssaysTool, searchOpenTargetsTool, getTargetSafetyTool, searchPharmgkbTool, searchFaersTool, searchClinicalTrialsTool, searchGeoDatasetsTool, searchDgidbTool, searchBgeeExpressionTool, getImpcKoProfileTool, checkSafetyPanelTool, } from "../tools/bio/index.js";
35
+ import { searchGeneTool, searchPathwayTool, lookupGoTermTool, searchInteractionsTool, chemblTool, pubchemTool, openTargetsTool, searchPharmgkbTool, searchFaersTool, searchClinicalTrialsTool, searchGeoDatasetsTool, createSearchDgidbTool, searchBgeeExpressionTool, getImpcKoProfileTool, checkSafetyPanelTool, } from "../tools/bio/index.js";
35
36
  import { createNcbiTools, createChemDbTools } from "../tools/bio/keys.js";
36
37
  // Dependency-bearing tool factories.
37
- import { createGeneratePlanTool, createLiteratureReviewerTool, createInspectRunTool, createGenerateAnalogyReportTool } from "../tools/research/index.js";
38
+ import { createGeneratePlanTool, createLiteratureReviewerTool, createInspectRunTool, createInspectDataProfileTool, createGenerateAnalogyReportTool, } from "../tools/research/index.js";
38
39
  import { createFileStatTool, createGrepTool, createListFilesTool, createReadFileTool, createShowPlanTool, createWorkspaceSearchTool, showFileTool, } from "../tools/workspace/index.js";
39
40
  import { showUserTool } from "../tools/display/index.js";
40
41
  import { createUpdateWorkingMemoryTool } from "../tools/memory/index.js";
41
42
  import { createExecutePlanTool } from "../tools/execute-plan.js";
42
43
  import { createRunEphemeralTool } from "../tools/run-ephemeral.js";
43
- import { createIterateReportTool } from "../tools/iterate-report.js";
44
+ import { planReportTool, createReportSubmitTool } from "../tools/iterate-report.js";
44
45
  /** Canonical agent id — the single source of truth. */
45
46
  export const CONVERSATION_AGENT_ID = "conversation-agent";
46
47
  /** Runaway guard — heavy tool-driving turns need generous headroom. */
@@ -57,39 +58,30 @@ export function createConversationAgent(deps) {
57
58
  searchPathwayTool,
58
59
  lookupGoTermTool,
59
60
  searchInteractionsTool,
60
- ncbi.searchPubMed,
61
- ncbi.getArticleDetails,
62
- ncbi.getArticleFullText,
63
- // ChEMBL.
64
- searchCompoundsTool,
65
- getBioactivityTool,
66
- searchTargetsTool,
67
- getMechanismTool,
68
- getDrugInfoTool,
69
- // PubChem.
70
- searchPubchemCompoundTool,
71
- getPubchemCrossRefsTool,
72
- getPubchemAssaysTool,
61
+ // Literature (search / details / fulltext behind one action).
62
+ ncbi.pubmed,
63
+ // ChEMBL (compounds / drug / mechanism / bioactivity / targets behind one action).
64
+ chemblTool,
65
+ // PubChem (compound / crossrefs / assays behind one action).
66
+ pubchemTool,
73
67
  // Translational medicine.
74
- searchOpenTargetsTool,
75
- getTargetSafetyTool,
68
+ openTargetsTool,
76
69
  searchPharmgkbTool,
77
70
  searchFaersTool,
78
71
  searchClinicalTrialsTool,
79
72
  searchGeoDatasetsTool,
80
- searchDgidbTool,
73
+ createSearchDgidbTool({ ...(deps.logger ? { logger: deps.logger } : {}) }),
81
74
  // Preclinical.
82
75
  searchBgeeExpressionTool,
83
76
  getImpcKoProfileTool,
84
77
  // Off-target liability.
85
78
  checkSafetyPanelTool,
86
- // EPA CompTox.
87
- chemDb.searchToxcast,
88
- chemDb.searchCtxHazard,
89
- chemDb.searchCtxChemical,
90
- chemDb.searchCtxExposure,
79
+ // EPA CompTox (toxcast / hazard / chemical / exposure behind one dataset).
80
+ chemDb.comptox,
91
81
  // Execution.
92
82
  createInspectRunTool(pool),
83
+ // The dataset's own record. No file backs it — the DB row is the only copy.
84
+ createInspectDataProfileTool(pool),
93
85
  createGeneratePlanTool({ provider, pool, model, resourcePolicy }),
94
86
  createExecutePlanTool({
95
87
  pool,
@@ -103,7 +95,12 @@ export function createConversationAgent(deps) {
103
95
  runAuthorizer,
104
96
  runLauncher,
105
97
  }),
106
- createIterateReportTool({
98
+ // Report authoring: the always-on `plan_report` trigger delivers the
99
+ // heavy brief schema + rules just-in-time as its result; `submit_report`
100
+ // takes the composed brief as `unknown` and validates it in-execute, so
101
+ // the ~12k schema never rides the always-on tool surface.
102
+ planReportTool,
103
+ createReportSubmitTool({
107
104
  provider,
108
105
  pool,
109
106
  resolveWorkspaceRoot,
@@ -128,11 +125,11 @@ export function createConversationAgent(deps) {
128
125
  createFileStatTool(workspaceFs),
129
126
  createGrepTool(workspaceFs),
130
127
  // Working memory.
131
- createUpdateWorkingMemoryTool(workingMemory),
128
+ createUpdateWorkingMemoryTool(workingMemory, pool),
132
129
  ];
133
130
  return {
134
131
  id: CONVERSATION_AGENT_ID,
135
- systemPrompt: composeSystemPrompt(conversationPrompt),
132
+ systemPrompt: composeSystemPrompt(conversationPrompt, { identity: true, conversational: true }),
136
133
  model,
137
134
  tools,
138
135
  maxIterations: CONVERSATION_MAX_ITERATIONS,
@@ -17,13 +17,14 @@
17
17
  * `AgentDefinition`.
18
18
  */
19
19
  import { reportBuilderPrompt } from "../prompts/report-builder.js";
20
+ import { composeSystemPrompt } from "./system-prompt.js";
20
21
  export const REPORT_BUILDER_AGENT_ID = "report-builder";
21
22
  /** Runaway guard — Jinja recovery may take several build/edit cycles. */
22
23
  const REPORT_BUILDER_MAX_ITERATIONS = 75;
23
24
  export function createReportBuilderAgent(deps) {
24
25
  return {
25
26
  id: REPORT_BUILDER_AGENT_ID,
26
- systemPrompt: reportBuilderPrompt,
27
+ systemPrompt: composeSystemPrompt(reportBuilderPrompt),
27
28
  model: deps.model,
28
29
  tools: deps.tools,
29
30
  maxIterations: REPORT_BUILDER_MAX_ITERATIONS,
@@ -15,7 +15,7 @@ export const meta = {
15
15
  ],
16
16
  suitableFor: ["bulk-rna-seq", "microarray"],
17
17
  skills: ["bulk-transcriptomics", "shared/omics-general"],
18
- tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText", "searchGeoDatasets"],
18
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGeoDatasets"],
19
19
  };
20
20
  export function createBulkTranscriptomicsAgent(deps) {
21
21
  return createSandboxAgent(deps, meta, bulkTranscriptomicsAgentPrompt);
@@ -37,25 +37,7 @@ export const meta = {
37
37
  "perturbation-signatures",
38
38
  ],
39
39
  skills: ["cheminformatics", "shared/omics-general"],
40
- tools: [
41
- ...BASE_SANDBOX_TOOLS,
42
- "searchPubMed",
43
- "getArticleDetails",
44
- "getArticleFullText",
45
- "searchGene",
46
- "searchPathway",
47
- "lookupGoTerm",
48
- "searchInteractions",
49
- "searchCompounds",
50
- "getBioactivity",
51
- "searchTargets",
52
- "getMechanism",
53
- "getDrugInfo",
54
- "searchDgidb",
55
- "searchPubchemCompound",
56
- "getPubchemCrossRefs",
57
- "getPubchemAssays",
58
- ],
40
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions", "chembl", "searchDgidb", "pubchem"],
59
41
  };
60
42
  export function createCheminformaticsAgent(deps) {
61
43
  return createSandboxAgent(deps, meta, cheminformaticsAgentPrompt);
@@ -8,16 +8,7 @@ export const meta = {
8
8
  capabilities: ["peak calling", "differential binding", "differential accessibility", "motif analysis", "footprinting", "signal visualization"],
9
9
  suitableFor: ["atac-seq", "chip-seq", "cut-and-tag", "cut-and-run", "scatac-seq"],
10
10
  skills: ["chromatin-regulation", "shared/omics-general"],
11
- tools: [
12
- ...BASE_SANDBOX_TOOLS,
13
- "searchPubMed",
14
- "getArticleDetails",
15
- "getArticleFullText",
16
- "searchGene",
17
- "searchPathway",
18
- "lookupGoTerm",
19
- "searchInteractions",
20
- ],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions"],
21
12
  };
22
13
  export function createChromatinAgent(deps) {
23
14
  return createSandboxAgent(deps, meta, chromatinAgentPrompt);
@@ -8,16 +8,7 @@ export const meta = {
8
8
  capabilities: ["methylation array analysis", "bisulfite-seq analysis", "DMP detection", "DMR detection", "methylation clocks", "cell type deconvolution"],
9
9
  suitableFor: ["methylation-array", "wgbs", "rrbs", "epic", "450k"],
10
10
  skills: ["dna-methylation", "shared/omics-general"],
11
- tools: [
12
- ...BASE_SANDBOX_TOOLS,
13
- "searchPubMed",
14
- "getArticleDetails",
15
- "getArticleFullText",
16
- "searchGene",
17
- "searchPathway",
18
- "lookupGoTerm",
19
- "searchInteractions",
20
- ],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions"],
21
12
  };
22
13
  export function createDnaMethylationAgent(deps) {
23
14
  return createSandboxAgent(deps, meta, dnaMethylationAgentPrompt);
@@ -20,20 +20,13 @@ export const meta = {
20
20
  tools: [
21
21
  ...BASE_SANDBOX_TOOLS,
22
22
  "checkSafetyPanel",
23
- "searchPubMed",
24
- "getArticleDetails",
25
- "getArticleFullText",
23
+ "pubmed",
26
24
  "searchGene",
27
25
  "searchPathway",
28
26
  "lookupGoTerm",
29
27
  "searchInteractions",
30
- "searchCompounds",
31
- "getBioactivity",
32
- "searchTargets",
33
- "getMechanism",
34
- "getDrugInfo",
35
- "searchOpenTargets",
36
- "getTargetSafety",
28
+ "chembl",
29
+ "opentargets",
37
30
  "searchClinicalTrials",
38
31
  "searchFaers",
39
32
  "searchGwasCatalog",
@@ -43,10 +36,7 @@ export const meta = {
43
36
  "searchDgidb",
44
37
  "searchBgeeExpression",
45
38
  "getImpcKoProfile",
46
- "searchToxcast",
47
- "searchCtxHazard",
48
- "searchCtxChemical",
49
- "searchCtxExposure",
39
+ "comptox",
50
40
  ],
51
41
  };
52
42
  export function createDrugRepurposingAgent(deps) {
@@ -8,16 +8,7 @@ export const meta = {
8
8
  capabilities: ["pathway enrichment", "gene set enrichment", "GO analysis", "functional annotation"],
9
9
  suitableFor: ["gene-lists", "ranked-lists", "score-matrices", "general-omics"],
10
10
  skills: ["enrichment", "shared/omics-general"],
11
- tools: [
12
- ...BASE_SANDBOX_TOOLS,
13
- "searchPubMed",
14
- "getArticleDetails",
15
- "getArticleFullText",
16
- "searchGene",
17
- "searchPathway",
18
- "lookupGoTerm",
19
- "searchInteractions",
20
- ],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions"],
21
12
  };
22
13
  export function createEnrichmentAgent(deps) {
23
14
  return createSandboxAgent(deps, meta, enrichmentAgentPrompt);
@@ -9,16 +9,7 @@ export const meta = {
9
9
  capabilities: ["data inspection", "quick statistics", "data transformation", "table preview"],
10
10
  suitableFor: ["bulk-rna-seq", "single-cell", "proteomics", "metabolomics", "genomics", "transcriptomics", "general-omics"],
11
11
  skills: ["shared/omics-general"],
12
- tools: [
13
- ...BASE_SANDBOX_TOOLS,
14
- "searchPubMed",
15
- "getArticleDetails",
16
- "getArticleFullText",
17
- "searchGene",
18
- "searchPathway",
19
- "lookupGoTerm",
20
- "searchInteractions",
21
- ],
12
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions"],
22
13
  plannable: false,
23
14
  };
24
15
  export function createEphemeralExecutorAgent(deps) {
@@ -10,9 +10,7 @@ export const meta = {
10
10
  skills: ["genomic-variants", "shared/omics-general"],
11
11
  tools: [
12
12
  ...BASE_SANDBOX_TOOLS,
13
- "searchPubMed",
14
- "getArticleDetails",
15
- "getArticleFullText",
13
+ "pubmed",
16
14
  "searchGene",
17
15
  "searchPathway",
18
16
  "lookupGoTerm",
@@ -24,19 +24,7 @@ export const meta = {
24
24
  "immune-cell-composition",
25
25
  ],
26
26
  skills: ["immune-profiling", "shared/omics-general"],
27
- tools: [
28
- ...BASE_SANDBOX_TOOLS,
29
- "searchPubMed",
30
- "getArticleDetails",
31
- "getArticleFullText",
32
- "searchGene",
33
- "searchPathway",
34
- "lookupGoTerm",
35
- "searchInteractions",
36
- "searchGeoDatasets",
37
- "searchOpenTargets",
38
- "getTargetSafety",
39
- ],
27
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions", "searchGeoDatasets", "opentargets"],
40
28
  };
41
29
  export function createImmuneProfilingAgent(deps) {
42
30
  return createSandboxAgent(deps, meta, immuneProfilingAgentPrompt);
@@ -8,7 +8,7 @@ export const meta = {
8
8
  capabilities: ["peak detection", "feature alignment", "metabolite annotation", "normalization", "statistical analysis", "pathway mapping"],
9
9
  suitableFor: ["untargeted-metabolomics", "targeted-metabolomics", "lipidomics"],
10
10
  skills: ["metabolomics", "shared/omics-general"],
11
- tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText"],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed"],
12
12
  };
13
13
  export function createMetabolomicsAgent(deps) {
14
14
  return createSandboxAgent(deps, meta, metabolomicsAgentPrompt);
@@ -8,7 +8,7 @@ export const meta = {
8
8
  capabilities: ["diversity analysis", "differential abundance", "taxonomic profiling", "functional profiling", "compositional analysis"],
9
9
  suitableFor: ["16s-amplicon", "its-amplicon", "shotgun-metagenomics", "functional-profiling"],
10
10
  skills: ["microbiome", "shared/omics-general"],
11
- tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText"],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed"],
12
12
  };
13
13
  export function createMicrobiomeAgent(deps) {
14
14
  return createSandboxAgent(deps, meta, microbiomeAgentPrompt);
@@ -15,18 +15,7 @@ export const meta = {
15
15
  ],
16
16
  suitableFor: ["multi-omics", "cross-modality-integration"],
17
17
  skills: ["multi-omics-integration", "shared/omics-general"],
18
- tools: [
19
- ...BASE_SANDBOX_TOOLS,
20
- "searchPubMed",
21
- "getArticleDetails",
22
- "getArticleFullText",
23
- "searchGene",
24
- "searchPathway",
25
- "lookupGoTerm",
26
- "searchInteractions",
27
- "searchBgeeExpression",
28
- "getImpcKoProfile",
29
- ],
18
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions", "searchBgeeExpression", "getImpcKoProfile"],
30
19
  };
31
20
  export function createMultiOmicsIntegrationAgent(deps) {
32
21
  return createSandboxAgent(deps, meta, multiOmicsIntegrationAgentPrompt);
@@ -8,7 +8,7 @@ export const meta = {
8
8
  capabilities: ["multimodal integration", "joint embedding", "cross-modality analysis", "protein quantification", "chromatin accessibility"],
9
9
  suitableFor: ["cite-seq", "multiome", "tea-seq", "dogma-seq"],
10
10
  skills: ["multimodal-single-cell", "shared/omics-general"],
11
- tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText"],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed"],
12
12
  };
13
13
  export function createMultimodalScAgent(deps) {
14
14
  return createSandboxAgent(deps, meta, multimodalScAgentPrompt);
@@ -8,16 +8,7 @@ export const meta = {
8
8
  capabilities: ["network analysis", "co-expression networks", "regulatory analysis", "module detection", "TF activity inference"],
9
9
  suitableFor: ["expression-matrices", "correlation-matrices", "general-omics"],
10
10
  skills: ["network-regulatory", "shared/omics-general"],
11
- tools: [
12
- ...BASE_SANDBOX_TOOLS,
13
- "searchPubMed",
14
- "getArticleDetails",
15
- "getArticleFullText",
16
- "searchGene",
17
- "searchPathway",
18
- "lookupGoTerm",
19
- "searchInteractions",
20
- ],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions"],
21
12
  defaultMaxSteps: 35,
22
13
  };
23
14
  export function createNetworkAgent(deps) {
@@ -34,9 +34,7 @@ export const meta = {
34
34
  skills: ["pkpd-clinical-response", "statistical-modeling", "shared/omics-general"],
35
35
  tools: [
36
36
  ...BASE_SANDBOX_TOOLS,
37
- "searchPubMed",
38
- "getArticleDetails",
39
- "getArticleFullText",
37
+ "pubmed",
40
38
  "searchGene",
41
39
  "searchPathway",
42
40
  "lookupGoTerm",
@@ -44,11 +42,7 @@ export const meta = {
44
42
  "searchClinicalTrials",
45
43
  "searchFaers",
46
44
  "searchPharmgkb",
47
- "searchCompounds",
48
- "getBioactivity",
49
- "searchTargets",
50
- "getMechanism",
51
- "getDrugInfo",
45
+ "chembl",
52
46
  "searchDgidb",
53
47
  "searchBgeeExpression",
54
48
  "getImpcKoProfile",
@@ -8,7 +8,7 @@ export const meta = {
8
8
  capabilities: ["protein quantification", "differential abundance", "imputation", "normalization", "PTM analysis", "phosphoproteomics"],
9
9
  suitableFor: ["dda-proteomics", "dia-proteomics", "tmt-proteomics", "olink", "somascan"],
10
10
  skills: ["proteomics", "shared/omics-general"],
11
- tools: [...BASE_SANDBOX_TOOLS, "searchPubMed", "getArticleDetails", "getArticleFullText"],
11
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed"],
12
12
  };
13
13
  export function createProteomicsAgent(deps) {
14
14
  return createSandboxAgent(deps, meta, proteomicsAgentPrompt);
@@ -39,16 +39,7 @@ export const meta = {
39
39
  "drug-repurposing",
40
40
  "shared/omics-general",
41
41
  ],
42
- tools: [
43
- ...BASE_SANDBOX_TOOLS,
44
- "searchPubMed",
45
- "getArticleDetails",
46
- "getArticleFullText",
47
- "searchGene",
48
- "searchPathway",
49
- "lookupGoTerm",
50
- "searchInteractions",
51
- ],
42
+ tools: [...BASE_SANDBOX_TOOLS, "pubmed", "searchGene", "searchPathway", "lookupGoTerm", "searchInteractions"],
52
43
  plannable: false,
53
44
  };
54
45
  export function createScientificExecutorAgent(deps) {
@@ -8,8 +8,8 @@
8
8
  * the workspace mutate trio (`execute_command`, `write_file`, `edit_file`)
9
9
  * bound to the shared `SandboxClient` and the step's `allowedWritePrefix`,
10
10
  * the workspace read tools (`read_file`, `grep`) over the shared
11
- * `WorkspaceFilesystem`, and the bio/literature/context7/run-inspection
12
- * tools its `meta.tools` allowlist names.
11
+ * `WorkspaceFilesystem`, `inspect_data_profile` over the shared `Pool`, and the
12
+ * bio/literature/context7/run-inspection tools its `meta.tools` allowlist names.
13
13
  *
14
14
  * Tool resolution is a single registry lookup — every name in `meta.tools`
15
15
  * must map to a concrete `Tool`; unknown names throw at composition time
@@ -25,6 +25,7 @@ import type { ProvenanceCollector as LineageCollector } from "../../provenance/c
25
25
  import { type BioToolKeys } from "../../tools/bio/keys.js";
26
26
  import { type BlockerHolder } from "../../tools/sandbox/report-blocker.js";
27
27
  import type { AgentMeta, SandboxToolName } from "./types.js";
28
+ import type { Logger } from "../../lib/logger.js";
28
29
  /**
29
30
  * Tools every sandbox agent receives — sandbox-environment introspection,
30
31
  * library docs, and run inspection. Spread into each agent's
@@ -50,6 +51,8 @@ export interface SandboxStepCoords {
50
51
  }
51
52
  /** The shared dependency graph every sandbox agent draws from. */
52
53
  export interface SandboxAgentDeps {
54
+ /** Operational logging seam; omitted falls back to no-op. */
55
+ readonly logger?: Logger;
53
56
  readonly provider: ChatProvider;
54
57
  readonly pool: Pool;
55
58
  readonly sandboxClient: SandboxClient;
@@ -92,9 +95,20 @@ export interface SandboxAgentPromptOptions {
92
95
  }
93
96
  /**
94
97
  * Build one sandbox `AgentDefinition`. The system prompt is composed once
95
- * (SOUL kernel + agent body + sandbox standards) — no processors, no
96
- * conversational layer (sandbox agents are not user-facing). Tools are
97
- * resolved against the closed allowlist; the workspace surface is always
98
- * wired regardless of meta.
98
+ * (SOUL execution core + agent body + sandbox standards) — no processors, and
99
+ * neither human-facing SOUL layer: a sandbox agent is headless, so the identity
100
+ * and conversational layers are dead weight in its context while every hard
101
+ * guardrail it does need rides in the execution core. Tools are resolved
102
+ * against the closed allowlist; the workspace surface is always wired
103
+ * regardless of meta.
104
+ *
105
+ * The composed `systemPrompt` is a **pure function of the agent type** — nothing
106
+ * from `deps.step` reaches it, so two steps of one run, and two runs of one
107
+ * analysis, send a byte-identical ~20k-char prefix that the provider's prompt
108
+ * cache can actually reuse. Keep it that way: a single interpolated id or path
109
+ * makes every step's prefix unique again, and each step pays a full cache write
110
+ * and reads nothing back. Per-step values belong in the step's briefing (its
111
+ * first user message — see `prompts/briefing.ts`), which names the working
112
+ * directory, the analysis root, the dataset, and what each dependency produced.
99
113
  */
100
114
  export declare function createSandboxAgent(deps: SandboxAgentDeps, meta: AgentMeta, body: string, opts?: SandboxAgentPromptOptions): AgentDefinition;