effect-agent 0.1.0-beta.11 → 0.1.0-beta.111

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 (553) hide show
  1. package/dist/Agent-1DMSO_Fl.mjs +86 -0
  2. package/dist/Agent-1DMSO_Fl.mjs.map +1 -0
  3. package/dist/Agent-DriBcXBN.d.mts +245 -0
  4. package/dist/AgentError-Bn1ytXRD.d.mts +117 -0
  5. package/dist/AgentPolicy-BqDoSXO6.d.mts +96 -0
  6. package/dist/AgentRuntime-CWkHuzyt.d.mts +346 -0
  7. package/dist/AgentRuntime-DLwPoEVH.mjs +4735 -0
  8. package/dist/AgentRuntime-DLwPoEVH.mjs.map +1 -0
  9. package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
  10. package/dist/ContextCompactor-WwSIG_Z2.d.mts +161 -0
  11. package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
  12. package/dist/DurableAgentRuntime-PyIgNYXF.mjs +6772 -0
  13. package/dist/DurableAgentRuntime-PyIgNYXF.mjs.map +1 -0
  14. package/dist/DurableFailpoint-mx3-nsxU.d.mts +41 -0
  15. package/dist/DurableStep-Cry_iol4.d.mts +103 -0
  16. package/dist/EventSource-BUYLmL77.d.mts +51 -0
  17. package/dist/FailureDiagnostic-BElLOoED.mjs +274 -0
  18. package/dist/FailureDiagnostic-BElLOoED.mjs.map +1 -0
  19. package/dist/FailureDiagnostic-CaAkzGHL.d.mts +223 -0
  20. package/dist/Identifiers-CN2s30fF.d.mts +40 -0
  21. package/dist/InMemory.d.mts +24 -0
  22. package/dist/InMemory.mjs +24 -0
  23. package/dist/InMemory.mjs.map +1 -0
  24. package/dist/MemoryNamespace-BbRW5p71.d.mts +36 -0
  25. package/dist/MemoryReference-B8Q3UJoJ.d.mts +79 -0
  26. package/dist/Messaging-DaZDlBqh.d.mts +1067 -0
  27. package/dist/Messaging-Dkg87ebg.d.mts +221 -0
  28. package/dist/MessagingHost-D89X7ma8.mjs +110 -0
  29. package/dist/MessagingHost-D89X7ma8.mjs.map +1 -0
  30. package/dist/MessagingHost-e1Sbzfao.d.mts +74 -0
  31. package/dist/OperationAuthorizer-TzcQtpX5.d.mts +61 -0
  32. package/dist/Output-CAFJTAbP.d.mts +25 -0
  33. package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
  34. package/dist/PageScreenshot-BpgZKAxl.d.mts +48 -0
  35. package/dist/PreparedInputAdmission-J3YK6LAm.d.mts +42 -0
  36. package/dist/Receipt-BAHyigAF.d.mts +33 -0
  37. package/dist/Records-4qnRmniE.d.mts +4058 -0
  38. package/dist/RunEvent-DIrzkjLr.d.mts +460 -0
  39. package/dist/RunEventSink-D5aVhISG.d.mts +108 -0
  40. package/dist/RunJournal-BXrq0VIK.mjs +931 -0
  41. package/dist/RunJournal-BXrq0VIK.mjs.map +1 -0
  42. package/dist/RunOptions-BoESJrxw.d.mts +935 -0
  43. package/dist/RunPolicyUsage-ClZxyR46.d.mts +21 -0
  44. package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
  45. package/dist/Schedule-C2lH2kxY.d.mts +847 -0
  46. package/dist/Scheduling-DPb2QyAK.mjs +691 -0
  47. package/dist/Scheduling-DPb2QyAK.mjs.map +1 -0
  48. package/dist/Subagent-D9eYdGTl.mjs +1537 -0
  49. package/dist/Subagent-D9eYdGTl.mjs.map +1 -0
  50. package/dist/Subagent-F72tuaxy.d.mts +1360 -0
  51. package/dist/SubagentContract-DdT7Cqe6.d.mts +116 -0
  52. package/dist/SubagentHost-CmiNTOBZ.d.mts +149 -0
  53. package/dist/Subscription-pQUv0QD6.d.mts +945 -0
  54. package/dist/SubscriptionInput-DdJOiNMY.d.mts +41 -0
  55. package/dist/Thread-DOBQ0QUY.d.mts +96 -0
  56. package/dist/ThreadHistory-tS1KwxHR.d.mts +60 -0
  57. package/dist/ToolBroker-DWs4tZra.d.mts +133 -0
  58. package/dist/ToolExposure-9uF_Yo0T.mjs +10 -0
  59. package/dist/ToolExposure-9uF_Yo0T.mjs.map +1 -0
  60. package/dist/ToolExposure-C93U1sPu.mjs +30 -0
  61. package/dist/ToolExposure-C93U1sPu.mjs.map +1 -0
  62. package/dist/ToolExposure-UCN12eCd.d.mts +39 -0
  63. package/dist/ToolExposure-r2eOWk4F.d.mts +46 -0
  64. package/dist/ToolExposure.d.mts +8 -0
  65. package/dist/ToolExposure.mjs +21 -0
  66. package/dist/ToolExposure.mjs.map +1 -0
  67. package/dist/ToolReconciler-BmVRAHKs.d.mts +80 -0
  68. package/dist/ToolResult-BKdqWRff.d.mts +78 -0
  69. package/dist/Usage-Dx0aknfk.d.mts +121 -0
  70. package/dist/WakeScheduler-EjUF-GhC.d.mts +56 -0
  71. package/dist/Worker-Du9dhVnp.d.mts +279 -0
  72. package/dist/Worker-T_3RbaKc.mjs +210 -0
  73. package/dist/Worker-T_3RbaKc.mjs.map +1 -0
  74. package/dist/agent-registration-B5CI-Ygk.mjs +201 -0
  75. package/dist/agent-registration-B5CI-Ygk.mjs.map +1 -0
  76. package/dist/capabilities/Approval.d.mts +114 -0
  77. package/dist/capabilities/Approval.mjs +226 -0
  78. package/dist/capabilities/Approval.mjs.map +1 -0
  79. package/dist/capabilities/Budget.d.mts +112 -0
  80. package/dist/capabilities/Budget.mjs +346 -0
  81. package/dist/capabilities/Budget.mjs.map +1 -0
  82. package/dist/capabilities/CodeMode.d.mts +157 -0
  83. package/dist/capabilities/CodeMode.mjs +522 -0
  84. package/dist/capabilities/CodeMode.mjs.map +1 -0
  85. package/dist/capabilities/Commands.d.mts +55 -0
  86. package/dist/capabilities/Commands.mjs +57 -0
  87. package/dist/capabilities/Commands.mjs.map +1 -0
  88. package/dist/capabilities/ContextTools.d.mts +321 -0
  89. package/dist/capabilities/ContextTools.mjs +126 -0
  90. package/dist/capabilities/ContextTools.mjs.map +1 -0
  91. package/dist/capabilities/Mcp.d.mts +108 -0
  92. package/dist/capabilities/Mcp.mjs +260 -0
  93. package/dist/capabilities/Mcp.mjs.map +1 -0
  94. package/dist/capabilities/McpClient.d.mts +115 -0
  95. package/dist/capabilities/McpClient.mjs +506 -0
  96. package/dist/capabilities/McpClient.mjs.map +1 -0
  97. package/dist/capabilities/MemoryNotes.d.mts +424 -0
  98. package/dist/capabilities/MemoryNotes.mjs +128 -0
  99. package/dist/capabilities/MemoryNotes.mjs.map +1 -0
  100. package/dist/capabilities/Messaging.d.mts +3 -0
  101. package/dist/capabilities/Messaging.mjs +152 -0
  102. package/dist/capabilities/Messaging.mjs.map +1 -0
  103. package/dist/capabilities/ModelContext.d.mts +89 -0
  104. package/dist/capabilities/ModelContext.mjs +168 -0
  105. package/dist/capabilities/ModelContext.mjs.map +1 -0
  106. package/dist/capabilities/Redaction.d.mts +37 -0
  107. package/dist/capabilities/Redaction.mjs +104 -0
  108. package/dist/capabilities/Redaction.mjs.map +1 -0
  109. package/dist/capabilities/Remembering.d.mts +434 -0
  110. package/dist/capabilities/Remembering.mjs +290 -0
  111. package/dist/capabilities/Remembering.mjs.map +1 -0
  112. package/dist/capabilities/RunHooks.d.mts +82 -0
  113. package/dist/capabilities/RunHooks.mjs +144 -0
  114. package/dist/capabilities/RunHooks.mjs.map +1 -0
  115. package/dist/capabilities/SemanticMemory.d.mts +431 -0
  116. package/dist/capabilities/SemanticMemory.mjs +315 -0
  117. package/dist/capabilities/SemanticMemory.mjs.map +1 -0
  118. package/dist/capabilities/Subagent.d.mts +4 -0
  119. package/dist/capabilities/Subagent.mjs +5 -0
  120. package/dist/capabilities/SubagentReservations.d.mts +186 -0
  121. package/dist/capabilities/SubagentReservations.mjs +479 -0
  122. package/dist/capabilities/SubagentReservations.mjs.map +1 -0
  123. package/dist/capabilities/ToolDiscovery.d.mts +124 -0
  124. package/dist/capabilities/ToolDiscovery.mjs +230 -0
  125. package/dist/capabilities/ToolDiscovery.mjs.map +1 -0
  126. package/dist/capabilities/WebCapture.d.mts +163 -0
  127. package/dist/capabilities/WebCapture.mjs +335 -0
  128. package/dist/capabilities/WebCapture.mjs.map +1 -0
  129. package/dist/capabilities/WebSearch.d.mts +71 -0
  130. package/dist/capabilities/WebSearch.mjs +115 -0
  131. package/dist/capabilities/WebSearch.mjs.map +1 -0
  132. package/dist/compaction-C2OTceKw.mjs +505 -0
  133. package/dist/compaction-C2OTceKw.mjs.map +1 -0
  134. package/dist/core/Agent.d.mts +2 -0
  135. package/dist/core/Agent.mjs +2 -0
  136. package/dist/core/AgentError.d.mts +2 -0
  137. package/dist/core/AgentError.mjs +134 -0
  138. package/dist/core/AgentError.mjs.map +1 -0
  139. package/dist/core/AgentPolicy.d.mts +2 -0
  140. package/dist/core/AgentPolicy.mjs +94 -0
  141. package/dist/core/AgentPolicy.mjs.map +1 -0
  142. package/dist/core/AgentUpdates.d.mts +2 -0
  143. package/dist/core/AgentUpdates.mjs +63 -0
  144. package/dist/core/AgentUpdates.mjs.map +1 -0
  145. package/dist/core/FailureDiagnostic.d.mts +2 -0
  146. package/dist/core/FailureDiagnostic.mjs +2 -0
  147. package/dist/core/IdGenerator.d.mts +26 -0
  148. package/dist/core/IdGenerator.mjs +27 -0
  149. package/dist/core/IdGenerator.mjs.map +1 -0
  150. package/dist/core/Identifiers.d.mts +2 -0
  151. package/dist/core/Identifiers.mjs +43 -0
  152. package/dist/core/Identifiers.mjs.map +1 -0
  153. package/dist/core/Memory.d.mts +57 -0
  154. package/dist/core/Memory.mjs +203 -0
  155. package/dist/core/Memory.mjs.map +1 -0
  156. package/dist/core/MemoryNamespace.d.mts +2 -0
  157. package/dist/core/MemoryNamespace.mjs +116 -0
  158. package/dist/core/MemoryNamespace.mjs.map +1 -0
  159. package/dist/core/MemoryReference.d.mts +2 -0
  160. package/dist/core/MemoryReference.mjs +109 -0
  161. package/dist/core/MemoryReference.mjs.map +1 -0
  162. package/dist/core/MemoryRevalidation.d.mts +65 -0
  163. package/dist/core/MemoryRevalidation.mjs +126 -0
  164. package/dist/core/MemoryRevalidation.mjs.map +1 -0
  165. package/dist/core/MemoryStore.d.mts +186 -0
  166. package/dist/core/MemoryStore.mjs +243 -0
  167. package/dist/core/MemoryStore.mjs.map +1 -0
  168. package/dist/core/Receipt.d.mts +2 -0
  169. package/dist/core/Receipt.mjs +36 -0
  170. package/dist/core/Receipt.mjs.map +1 -0
  171. package/dist/core/RememberingStore.d.mts +1562 -0
  172. package/dist/core/RememberingStore.mjs +190 -0
  173. package/dist/core/RememberingStore.mjs.map +1 -0
  174. package/dist/core/RunEvent.d.mts +2 -0
  175. package/dist/core/RunEvent.mjs +337 -0
  176. package/dist/core/RunEvent.mjs.map +1 -0
  177. package/dist/core/RunPolicyUsage.d.mts +2 -0
  178. package/dist/core/RunPolicyUsage.mjs +21 -0
  179. package/dist/core/RunPolicyUsage.mjs.map +1 -0
  180. package/dist/core/SemanticMemoryIndex.d.mts +826 -0
  181. package/dist/core/SemanticMemoryIndex.mjs +185 -0
  182. package/dist/core/SemanticMemoryIndex.mjs.map +1 -0
  183. package/dist/core/SemanticMemoryRevalidation.d.mts +45 -0
  184. package/dist/core/SemanticMemoryRevalidation.mjs +191 -0
  185. package/dist/core/SemanticMemoryRevalidation.mjs.map +1 -0
  186. package/dist/core/SubagentContract.d.mts +2 -0
  187. package/dist/core/SubagentContract.mjs +148 -0
  188. package/dist/core/SubagentContract.mjs.map +1 -0
  189. package/dist/core/Thread.d.mts +2 -0
  190. package/dist/core/Thread.mjs +250 -0
  191. package/dist/core/Thread.mjs.map +1 -0
  192. package/dist/core/ToolResult.d.mts +2 -0
  193. package/dist/core/ToolResult.mjs +156 -0
  194. package/dist/core/ToolResult.mjs.map +1 -0
  195. package/dist/core/Usage.d.mts +2 -0
  196. package/dist/core/Usage.mjs +319 -0
  197. package/dist/core/Usage.mjs.map +1 -0
  198. package/dist/core/Worker.d.mts +3 -0
  199. package/dist/core/Worker.mjs +3 -0
  200. package/dist/durable/ActivityStore.d.mts +116 -0
  201. package/dist/durable/ActivityStore.mjs +131 -0
  202. package/dist/durable/ActivityStore.mjs.map +1 -0
  203. package/dist/durable/Admin.d.mts +2 -0
  204. package/dist/durable/Admin.mjs +330 -0
  205. package/dist/durable/Admin.mjs.map +1 -0
  206. package/dist/durable/AgentRegistration.d.mts +2 -0
  207. package/dist/durable/AgentRegistration.mjs +14 -0
  208. package/dist/durable/AgentRegistration.mjs.map +1 -0
  209. package/dist/durable/Certification.d.mts +110 -0
  210. package/dist/durable/Certification.mjs +159 -0
  211. package/dist/durable/Certification.mjs.map +1 -0
  212. package/dist/durable/CommittedActivity.d.mts +62 -0
  213. package/dist/durable/CommittedActivity.mjs +159 -0
  214. package/dist/durable/CommittedActivity.mjs.map +1 -0
  215. package/dist/durable/Digest.d.mts +2 -0
  216. package/dist/durable/Digest.mjs +50 -0
  217. package/dist/durable/Digest.mjs.map +1 -0
  218. package/dist/durable/DurableAgentRuntime.d.mts +3 -0
  219. package/dist/durable/DurableAgentRuntime.mjs +3 -0
  220. package/dist/durable/DurableFailpoint.d.mts +2 -0
  221. package/dist/durable/DurableFailpoint.mjs +98 -0
  222. package/dist/durable/DurableFailpoint.mjs.map +1 -0
  223. package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
  224. package/dist/durable/DurableFailpointTestControl.mjs +19 -0
  225. package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
  226. package/dist/durable/EventSource.d.mts +2 -0
  227. package/dist/durable/EventSource.mjs +65 -0
  228. package/dist/durable/EventSource.mjs.map +1 -0
  229. package/dist/durable/GitHubWorkflowSource.d.mts +185 -0
  230. package/dist/durable/GitHubWorkflowSource.mjs +209 -0
  231. package/dist/durable/GitHubWorkflowSource.mjs.map +1 -0
  232. package/dist/durable/MessageDelivery.d.mts +876 -0
  233. package/dist/durable/MessageDelivery.mjs +549 -0
  234. package/dist/durable/MessageDelivery.mjs.map +1 -0
  235. package/dist/durable/MessageDeliveryStoreConformance.d.mts +376 -0
  236. package/dist/durable/MessageDeliveryStoreConformance.mjs +270 -0
  237. package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
  238. package/dist/durable/OperationAuthorizer.d.mts +2 -0
  239. package/dist/durable/OperationAuthorizer.mjs +70 -0
  240. package/dist/durable/OperationAuthorizer.mjs.map +1 -0
  241. package/dist/durable/PersistentHistory.d.mts +16 -0
  242. package/dist/durable/PersistentHistory.mjs +125 -0
  243. package/dist/durable/PersistentHistory.mjs.map +1 -0
  244. package/dist/durable/PreparedInputAdmission.d.mts +2 -0
  245. package/dist/durable/PreparedInputAdmission.mjs +38 -0
  246. package/dist/durable/PreparedInputAdmission.mjs.map +1 -0
  247. package/dist/durable/Records.d.mts +2 -0
  248. package/dist/durable/Records.mjs +841 -0
  249. package/dist/durable/Records.mjs.map +1 -0
  250. package/dist/durable/Recovery.d.mts +2 -0
  251. package/dist/durable/Recovery.mjs +739 -0
  252. package/dist/durable/Recovery.mjs.map +1 -0
  253. package/dist/durable/RunJournal.d.mts +2 -0
  254. package/dist/durable/RunJournal.mjs +2 -0
  255. package/dist/durable/Schedule.d.mts +2 -0
  256. package/dist/durable/Schedule.mjs +391 -0
  257. package/dist/durable/Schedule.mjs.map +1 -0
  258. package/dist/durable/ScheduleStoreConformance.d.mts +17 -0
  259. package/dist/durable/ScheduleStoreConformance.mjs +420 -0
  260. package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
  261. package/dist/durable/ScheduleTransition.d.mts +24 -0
  262. package/dist/durable/ScheduleTransition.mjs +180 -0
  263. package/dist/durable/ScheduleTransition.mjs.map +1 -0
  264. package/dist/durable/Scheduling.d.mts +54 -0
  265. package/dist/durable/Scheduling.mjs +2 -0
  266. package/dist/durable/SqlMemoryStore.d.mts +29 -0
  267. package/dist/durable/SqlMemoryStore.mjs +436 -0
  268. package/dist/durable/SqlMemoryStore.mjs.map +1 -0
  269. package/dist/durable/SqlMessageDeliveryStore.d.mts +42 -0
  270. package/dist/durable/SqlMessageDeliveryStore.mjs +173 -0
  271. package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -0
  272. package/dist/durable/SqlStorageV2Upgrade.d.mts +21 -0
  273. package/dist/durable/SqlStorageV2Upgrade.mjs +459 -0
  274. package/dist/durable/SqlStorageV2Upgrade.mjs.map +1 -0
  275. package/dist/durable/SqlSubscriptionStore.d.mts +62 -0
  276. package/dist/durable/SqlSubscriptionStore.mjs +751 -0
  277. package/dist/durable/SqlSubscriptionStore.mjs.map +1 -0
  278. package/dist/durable/SqlThreadNativeReads.d.mts +49 -0
  279. package/dist/durable/SqlThreadNativeReads.mjs +153 -0
  280. package/dist/durable/SqlThreadNativeReads.mjs.map +1 -0
  281. package/dist/durable/SubmissionLedger.d.mts +3 -0
  282. package/dist/durable/SubmissionLedger.mjs +918 -0
  283. package/dist/durable/SubmissionLedger.mjs.map +1 -0
  284. package/dist/durable/SubmissionLedgerConformance.d.mts +29 -0
  285. package/dist/durable/SubmissionLedgerConformance.mjs +1993 -0
  286. package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
  287. package/dist/durable/SubmissionStatus.d.mts +2 -0
  288. package/dist/durable/SubmissionStatus.mjs +18 -0
  289. package/dist/durable/SubmissionStatus.mjs.map +1 -0
  290. package/dist/durable/Subscription.d.mts +2 -0
  291. package/dist/durable/Subscription.mjs +360 -0
  292. package/dist/durable/Subscription.mjs.map +1 -0
  293. package/dist/durable/SubscriptionInput.d.mts +2 -0
  294. package/dist/durable/SubscriptionInput.mjs +52 -0
  295. package/dist/durable/SubscriptionInput.mjs.map +1 -0
  296. package/dist/durable/SubscriptionStoreConformance.d.mts +16 -0
  297. package/dist/durable/SubscriptionStoreConformance.mjs +625 -0
  298. package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
  299. package/dist/durable/SubscriptionTools.d.mts +273 -0
  300. package/dist/durable/SubscriptionTools.mjs +190 -0
  301. package/dist/durable/SubscriptionTools.mjs.map +1 -0
  302. package/dist/durable/SubscriptionTransition.d.mts +21 -0
  303. package/dist/durable/SubscriptionTransition.mjs +148 -0
  304. package/dist/durable/SubscriptionTransition.mjs.map +1 -0
  305. package/dist/durable/Subscriptions.d.mts +73 -0
  306. package/dist/durable/Subscriptions.mjs +627 -0
  307. package/dist/durable/Subscriptions.mjs.map +1 -0
  308. package/dist/durable/ThreadContextHistory.d.mts +32 -0
  309. package/dist/durable/ThreadContextHistory.mjs +152 -0
  310. package/dist/durable/ThreadContextHistory.mjs.map +1 -0
  311. package/dist/durable/ThreadContextHistoryProjection.d.mts +60 -0
  312. package/dist/durable/ThreadContextHistoryProjection.mjs +149 -0
  313. package/dist/durable/ThreadContextHistoryProjection.mjs.map +1 -0
  314. package/dist/durable/ThreadInvariants.d.mts +76 -0
  315. package/dist/durable/ThreadInvariants.mjs +246 -0
  316. package/dist/durable/ThreadInvariants.mjs.map +1 -0
  317. package/dist/durable/ThreadProjection.d.mts +78 -0
  318. package/dist/durable/ThreadProjection.mjs +158 -0
  319. package/dist/durable/ThreadProjection.mjs.map +1 -0
  320. package/dist/durable/ThreadProjectionMaintenance.d.mts +49 -0
  321. package/dist/durable/ThreadProjectionMaintenance.mjs +33 -0
  322. package/dist/durable/ThreadProjectionMaintenance.mjs.map +1 -0
  323. package/dist/durable/ThreadStore.d.mts +2 -0
  324. package/dist/durable/ThreadStore.mjs +336 -0
  325. package/dist/durable/ThreadStore.mjs.map +1 -0
  326. package/dist/durable/ThreadStoreConformance.d.mts +28 -0
  327. package/dist/durable/ThreadStoreConformance.mjs +503 -0
  328. package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
  329. package/dist/durable/ToolReconciler.d.mts +2 -0
  330. package/dist/durable/ToolReconciler.mjs +85 -0
  331. package/dist/durable/ToolReconciler.mjs.map +1 -0
  332. package/dist/durable/WakeScheduler.d.mts +2 -0
  333. package/dist/durable/WakeScheduler.mjs +85 -0
  334. package/dist/durable/WakeScheduler.mjs.map +1 -0
  335. package/dist/durable/WorkerHost.d.mts +129 -0
  336. package/dist/durable/WorkerHost.mjs +77 -0
  337. package/dist/durable/WorkerHost.mjs.map +1 -0
  338. package/dist/engine/AgentRuntime.d.mts +2 -0
  339. package/dist/engine/AgentRuntime.mjs +2 -0
  340. package/dist/engine/Compaction.d.mts +7 -0
  341. package/dist/engine/Compaction.mjs +16 -0
  342. package/dist/engine/Compaction.mjs.map +1 -0
  343. package/dist/engine/ContextCompactor.d.mts +2 -0
  344. package/dist/engine/ContextCompactor.mjs +119 -0
  345. package/dist/engine/ContextCompactor.mjs.map +1 -0
  346. package/dist/engine/ContextHistory.d.mts +65 -0
  347. package/dist/engine/ContextHistory.mjs +76 -0
  348. package/dist/engine/ContextHistory.mjs.map +1 -0
  349. package/dist/engine/ContextWindow.d.mts +2 -0
  350. package/dist/engine/ContextWindow.mjs +59 -0
  351. package/dist/engine/ContextWindow.mjs.map +1 -0
  352. package/dist/engine/DurableStep.d.mts +2 -0
  353. package/dist/engine/DurableStep.mjs +62 -0
  354. package/dist/engine/DurableStep.mjs.map +1 -0
  355. package/dist/engine/MessagingHost.d.mts +2 -0
  356. package/dist/engine/MessagingHost.mjs +2 -0
  357. package/dist/engine/Output.d.mts +2 -0
  358. package/dist/engine/Output.mjs +8 -0
  359. package/dist/engine/Output.mjs.map +1 -0
  360. package/dist/engine/RunEventSink.d.mts +2 -0
  361. package/dist/engine/RunEventSink.mjs +22 -0
  362. package/dist/engine/RunEventSink.mjs.map +1 -0
  363. package/dist/engine/RunOptions.d.mts +2 -0
  364. package/dist/engine/RunOptions.mjs +124 -0
  365. package/dist/engine/RunOptions.mjs.map +1 -0
  366. package/dist/engine/SubagentHost.d.mts +2 -0
  367. package/dist/engine/SubagentHost.mjs +72 -0
  368. package/dist/engine/SubagentHost.mjs.map +1 -0
  369. package/dist/engine/ThreadHistory.d.mts +2 -0
  370. package/dist/engine/ThreadHistory.mjs +67 -0
  371. package/dist/engine/ThreadHistory.mjs.map +1 -0
  372. package/dist/engine/ToolBroker.d.mts +2 -0
  373. package/dist/engine/ToolBroker.mjs +42 -0
  374. package/dist/engine/ToolBroker.mjs.map +1 -0
  375. package/dist/foreign-diagnostic-DBQ1XHKh.mjs +37 -0
  376. package/dist/foreign-diagnostic-DBQ1XHKh.mjs.map +1 -0
  377. package/dist/index.d.mts +91 -6
  378. package/dist/index.mjs +100 -6
  379. package/dist/output-contract-BC7tjlGw.mjs +84 -0
  380. package/dist/output-contract-BC7tjlGw.mjs.map +1 -0
  381. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  382. package/dist/sandbox/CodeExecutor.d.mts +194 -0
  383. package/dist/sandbox/CodeExecutor.mjs +278 -0
  384. package/dist/sandbox/CodeExecutor.mjs.map +1 -0
  385. package/dist/sandbox/InteractiveBrowser.d.mts +257 -0
  386. package/dist/sandbox/InteractiveBrowser.mjs +236 -0
  387. package/dist/sandbox/InteractiveBrowser.mjs.map +1 -0
  388. package/dist/sandbox/PageCapture.d.mts +2 -0
  389. package/dist/sandbox/PageCapture.mjs +450 -0
  390. package/dist/sandbox/PageCapture.mjs.map +1 -0
  391. package/dist/sandbox/PageCrawl.d.mts +88 -0
  392. package/dist/sandbox/PageCrawl.mjs +124 -0
  393. package/dist/sandbox/PageCrawl.mjs.map +1 -0
  394. package/dist/sandbox/PageScreenshot.d.mts +2 -0
  395. package/dist/sandbox/PageScreenshot.mjs +53 -0
  396. package/dist/sandbox/PageScreenshot.mjs.map +1 -0
  397. package/dist/sandbox/ProtectedBrowser.d.mts +273 -0
  398. package/dist/sandbox/ProtectedBrowser.mjs +287 -0
  399. package/dist/sandbox/ProtectedBrowser.mjs.map +1 -0
  400. package/dist/sandbox/Sandbox.d.mts +2 -0
  401. package/dist/sandbox/Sandbox.mjs +208 -0
  402. package/dist/sandbox/Sandbox.mjs.map +1 -0
  403. package/dist/utf8-BYfhEkcj.mjs +11 -0
  404. package/dist/utf8-BYfhEkcj.mjs.map +1 -0
  405. package/dist/utf8-DchGZRBd.mjs +23 -0
  406. package/dist/utf8-DchGZRBd.mjs.map +1 -0
  407. package/package.json +1 -40
  408. package/src/InMemory.ts +19 -0
  409. package/src/ToolExposure.ts +2 -0
  410. package/src/capabilities/Approval.ts +352 -0
  411. package/src/capabilities/Budget.ts +536 -0
  412. package/src/capabilities/CodeMode.ts +1090 -0
  413. package/src/capabilities/Commands.ts +86 -0
  414. package/src/capabilities/ContextTools.ts +184 -0
  415. package/src/capabilities/Mcp.ts +427 -0
  416. package/src/capabilities/McpClient.ts +967 -0
  417. package/src/capabilities/MemoryNotes.ts +174 -0
  418. package/src/capabilities/Messaging.ts +261 -0
  419. package/src/capabilities/ModelContext.ts +354 -0
  420. package/src/capabilities/Redaction.ts +157 -0
  421. package/src/capabilities/Remembering.ts +550 -0
  422. package/src/capabilities/RunHooks.ts +280 -0
  423. package/src/capabilities/SemanticMemory.ts +447 -0
  424. package/src/capabilities/Subagent.ts +2488 -0
  425. package/src/capabilities/SubagentReservations.ts +850 -0
  426. package/src/capabilities/ToolDiscovery.ts +369 -0
  427. package/src/capabilities/WebCapture.ts +722 -0
  428. package/src/capabilities/WebSearch.ts +190 -0
  429. package/src/capabilities/internal/subagent-background.ts +1246 -0
  430. package/src/capabilities/internal/subagent-contract.ts +146 -0
  431. package/src/capabilities/internal/subagent-policy.ts +235 -0
  432. package/src/capabilities/internal/subagent-reporting.ts +261 -0
  433. package/src/capabilities/internal/utf8.ts +10 -0
  434. package/src/core/Agent.ts +595 -0
  435. package/src/core/AgentError.ts +172 -0
  436. package/src/core/AgentPolicy.ts +153 -0
  437. package/src/core/AgentUpdates.ts +100 -0
  438. package/src/core/FailureDiagnostic.ts +343 -0
  439. package/src/core/IdGenerator.ts +39 -0
  440. package/src/core/Identifiers.ts +48 -0
  441. package/src/core/Memory.ts +290 -0
  442. package/src/core/MemoryNamespace.ts +196 -0
  443. package/src/core/MemoryReference.ts +121 -0
  444. package/src/core/MemoryRevalidation.ts +185 -0
  445. package/src/core/MemoryStore.ts +368 -0
  446. package/src/core/Messaging.ts +72 -0
  447. package/src/core/Receipt.ts +42 -0
  448. package/src/core/RememberingStore.ts +300 -0
  449. package/src/core/RunEvent.ts +366 -0
  450. package/src/core/RunPolicyUsage.ts +17 -0
  451. package/src/core/SemanticMemoryIndex.ts +250 -0
  452. package/src/core/SemanticMemoryRevalidation.ts +254 -0
  453. package/src/core/SubagentContract.ts +196 -0
  454. package/src/core/Thread.ts +371 -0
  455. package/src/core/ToolExposure.ts +74 -0
  456. package/src/core/ToolResult.ts +190 -0
  457. package/src/core/Usage.ts +529 -0
  458. package/src/core/Worker.ts +184 -0
  459. package/src/core/internal/agent-updates.ts +34 -0
  460. package/src/core/internal/message-status.ts +60 -0
  461. package/src/core/internal/strict-schema.ts +14 -0
  462. package/src/core/internal/utf8.ts +23 -0
  463. package/src/durable/ActivityStore.ts +160 -0
  464. package/src/durable/Admin.ts +505 -0
  465. package/src/durable/AgentRegistration.ts +14 -0
  466. package/src/durable/Certification.ts +210 -0
  467. package/src/durable/CommittedActivity.ts +296 -0
  468. package/src/durable/Digest.ts +87 -0
  469. package/src/durable/DurableAgentRuntime.ts +10950 -0
  470. package/src/durable/DurableFailpoint.ts +107 -0
  471. package/src/durable/DurableFailpointTestControl.ts +39 -0
  472. package/src/durable/EventSource.ts +172 -0
  473. package/src/durable/GitHubWorkflowSource.ts +447 -0
  474. package/src/durable/MessageDelivery.ts +817 -0
  475. package/src/durable/MessageDeliveryStoreConformance.ts +410 -0
  476. package/src/durable/OperationAuthorizer.ts +85 -0
  477. package/src/durable/PersistentHistory.ts +260 -0
  478. package/src/durable/PreparedInputAdmission.ts +57 -0
  479. package/src/durable/Records.ts +1065 -0
  480. package/src/durable/Recovery.ts +1018 -0
  481. package/src/durable/RunJournal.ts +1631 -0
  482. package/src/durable/Schedule.ts +513 -0
  483. package/src/durable/ScheduleStoreConformance.ts +638 -0
  484. package/src/durable/ScheduleTransition.ts +265 -0
  485. package/src/durable/Scheduling.ts +1077 -0
  486. package/src/durable/SqlMemoryStore.ts +778 -0
  487. package/src/durable/SqlMessageDeliveryStore.ts +321 -0
  488. package/src/durable/SqlStorageV2Upgrade.ts +500 -0
  489. package/src/durable/SqlSubscriptionStore.ts +1440 -0
  490. package/src/durable/SqlThreadNativeReads.ts +256 -0
  491. package/src/durable/SubmissionLedger.ts +1205 -0
  492. package/src/durable/SubmissionLedgerConformance.ts +4590 -0
  493. package/src/durable/SubmissionStatus.ts +14 -0
  494. package/src/durable/Subscription.ts +544 -0
  495. package/src/durable/SubscriptionInput.ts +144 -0
  496. package/src/durable/SubscriptionStoreConformance.ts +945 -0
  497. package/src/durable/SubscriptionTools.ts +327 -0
  498. package/src/durable/SubscriptionTransition.ts +302 -0
  499. package/src/durable/Subscriptions.ts +1210 -0
  500. package/src/durable/ThreadContextHistory.ts +227 -0
  501. package/src/durable/ThreadContextHistoryProjection.ts +216 -0
  502. package/src/durable/ThreadInvariants.ts +507 -0
  503. package/src/durable/ThreadProjection.ts +269 -0
  504. package/src/durable/ThreadProjectionMaintenance.ts +67 -0
  505. package/src/durable/ThreadStore.ts +552 -0
  506. package/src/durable/ThreadStoreConformance.ts +1156 -0
  507. package/src/durable/ToolReconciler.ts +109 -0
  508. package/src/durable/WakeScheduler.ts +134 -0
  509. package/src/durable/WorkerHost.ts +171 -0
  510. package/src/durable/internal/agent-registration.ts +621 -0
  511. package/src/durable/internal/agent-updates.ts +302 -0
  512. package/src/durable/internal/foreign-diagnostic.ts +47 -0
  513. package/src/durable/internal/journal-checkpoint.ts +104 -0
  514. package/src/durable/internal/journal-metadata.ts +117 -0
  515. package/src/durable/internal/message-status.ts +20 -0
  516. package/src/durable/internal/messaging-host.ts +637 -0
  517. package/src/durable/internal/schedule-time.ts +303 -0
  518. package/src/durable/internal/storage-v2-layout.ts +163 -0
  519. package/src/durable/internal/storage-v2.ts +73 -0
  520. package/src/durable/internal/worker-host.ts +2678 -0
  521. package/src/durable/internal/worker-runtime.ts +9 -0
  522. package/src/engine/AgentRuntime.ts +37 -0
  523. package/src/engine/Compaction.ts +11 -0
  524. package/src/engine/ContextCompactor.ts +277 -0
  525. package/src/engine/ContextHistory.ts +73 -0
  526. package/src/engine/ContextWindow.ts +72 -0
  527. package/src/engine/DurableStep.ts +132 -0
  528. package/src/engine/MessagingHost.ts +110 -0
  529. package/src/engine/Output.ts +2 -0
  530. package/src/engine/RunEventSink.ts +132 -0
  531. package/src/engine/RunOptions.ts +1101 -0
  532. package/src/engine/SubagentHost.ts +193 -0
  533. package/src/engine/ThreadHistory.ts +120 -0
  534. package/src/engine/ToolBroker.ts +157 -0
  535. package/src/engine/ToolExposure.ts +48 -0
  536. package/src/engine/internal/agent-runtime.ts +10485 -0
  537. package/src/engine/internal/bounded-value.ts +315 -0
  538. package/src/engine/internal/compaction.ts +678 -0
  539. package/src/engine/internal/error-diagnostic.ts +39 -0
  540. package/src/engine/internal/output-contract.ts +173 -0
  541. package/src/engine/internal/primitive-delta.ts +80 -0
  542. package/src/engine/internal/provider-result-staging.ts +211 -0
  543. package/src/engine/internal/tool-derivative.ts +106 -0
  544. package/src/engine/internal/tool-exposure.ts +224 -0
  545. package/src/engine/internal/tool-telemetry.ts +484 -0
  546. package/src/index.ts +99 -21
  547. package/src/sandbox/CodeExecutor.ts +352 -0
  548. package/src/sandbox/InteractiveBrowser.ts +339 -0
  549. package/src/sandbox/PageCapture.ts +691 -0
  550. package/src/sandbox/PageCrawl.ts +148 -0
  551. package/src/sandbox/PageScreenshot.ts +81 -0
  552. package/src/sandbox/ProtectedBrowser.ts +436 -0
  553. package/src/sandbox/Sandbox.ts +241 -0
@@ -0,0 +1,1360 @@
1
+ import { d as ToolCallId, r as DelegationId, t as AgentId, u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
2
+ import { c as SubagentExecutionFailureClassification, d as SubagentReservationAmounts, l as SubagentGrant, o as SubagentDelegationCaps, s as SubagentExecutionFailure } from "./SubagentContract-DdT7Cqe6.mjs";
3
+ import { SubagentBudgetExhausted, SubagentReservations } from "./capabilities/SubagentReservations.mjs";
4
+ import { a as Receipt, n as JoinedToHost, t as IdempotencyKey } from "./Receipt-BAHyigAF.mjs";
5
+ import { s as RunTotals } from "./Usage-Dx0aknfk.mjs";
6
+ import { t as ThreadHistory } from "./ThreadHistory-tS1KwxHR.mjs";
7
+ import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
8
+ import { E as RunDispositionDeclaration, _ as InstructionSource, c as Definition, m as InputPromptSource, r as AnyDefinition, y as ModelServices } from "./Agent-DriBcXBN.mjs";
9
+ import { a as WorkerError, c as WorkerRef, l as WorkerReport, n as WorkerBudgetScope, r as WorkerCompletion } from "./Worker-Du9dhVnp.mjs";
10
+ import { V as RunSubagentDigests, x as RunContextPreparation } from "./RunOptions-BoESJrxw.mjs";
11
+ import { c as MessageRef, l as MessageStatus } from "./Messaging-Dkg87ebg.mjs";
12
+ import { i as SubagentHost, u as WorkerReporting } from "./SubagentHost-CmiNTOBZ.mjs";
13
+ import { S as ToolCallWaiting, _ as SubagentDurability, b as SubagentDurabilityError, c as AgentSpawner, h as SpawnRunOptions, l as AgentSpawnerParent, o as AgentRuntimeFailure, p as RuntimeBinding, s as AgentRuntimeRequirements } from "./AgentRuntime-CWkHuzyt.mjs";
14
+ import { t as RunEventSink } from "./RunEventSink-D5aVhISG.mjs";
15
+ import { Tool, Toolkit } from "effect/unstable/ai";
16
+ import { Crypto, Duration, Effect, Layer, Schema, Scope, Stream } from "effect";
17
+ //#region src/capabilities/internal/subagent-contract.d.ts
18
+ declare const SubagentPolicyFields: Schema.Struct<{
19
+ /** Total invocation slots, including reserved descendants, available through this delegation budget. */
20
+ readonly maxChildren: Schema.Int;
21
+ /** Concurrently executing children per parent Run. */
22
+ readonly maxConcurrency: Schema.Int;
23
+ /** Invocation slots held for the entire descendant subtree; omitted reserves zero. */
24
+ readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
25
+ /** Model turns reserved for each child invocation. */
26
+ readonly maxTurns: Schema.Int;
27
+ /** Tool Calls reserved for each child invocation. */
28
+ readonly maxToolCalls: Schema.Int;
29
+ /** Wall-clock duration reserved for each child invocation. */
30
+ readonly maxDuration: Schema.refine<Duration.Duration, Schema.Duration>;
31
+ readonly maxInputTokens: Schema.optionalKey<Schema.Int>;
32
+ readonly maxOutputTokens: Schema.optionalKey<Schema.Int>;
33
+ readonly maxCostMicrousd: Schema.optionalKey<Schema.Natural>;
34
+ readonly maxResultBytes: Schema.optionalKey<Schema.Int>;
35
+ }>;
36
+ type SubagentPolicyFields = typeof SubagentPolicyFields.Type;
37
+ /** Inputs normalized and validated by `SubagentPolicy.make`. */
38
+ type SubagentPolicyInput = Readonly<Omit<SubagentPolicyFields, "maxDuration"> & {
39
+ /** Finite, positive wall-clock duration accepted in any Effect Duration input form. */
40
+ readonly maxDuration: Duration.Input;
41
+ }>;
42
+ declare const SubagentPolicy_base: Schema.Class<SubagentPolicy, Schema.Struct<{
43
+ /** Total invocation slots, including reserved descendants, available through this delegation budget. */
44
+ readonly maxChildren: Schema.Int;
45
+ /** Concurrently executing children per parent Run. */
46
+ readonly maxConcurrency: Schema.Int;
47
+ /** Invocation slots held for the entire descendant subtree; omitted reserves zero. */
48
+ readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
49
+ /** Model turns reserved for each child invocation. */
50
+ readonly maxTurns: Schema.Int;
51
+ /** Tool Calls reserved for each child invocation. */
52
+ readonly maxToolCalls: Schema.Int;
53
+ /** Wall-clock duration reserved for each child invocation. */
54
+ readonly maxDuration: Schema.refine<Duration.Duration, Schema.Duration>;
55
+ readonly maxInputTokens: Schema.optionalKey<Schema.Int>;
56
+ readonly maxOutputTokens: Schema.optionalKey<Schema.Int>;
57
+ readonly maxCostMicrousd: Schema.optionalKey<Schema.Natural>;
58
+ readonly maxResultBytes: Schema.optionalKey<Schema.Int>;
59
+ }>, {}>;
60
+ /**
61
+ * Finite delegation bounds declared by one Subagent capability.
62
+ * Structural limits are hard limits; token
63
+ * and cost caps are optional and enforced only as honestly as provider
64
+ * reporting allows.
65
+ */
66
+ declare class SubagentPolicy extends SubagentPolicy_base {
67
+ /** Normalize and validate finite delegation bounds, throwing on invalid input. */
68
+ static make(input: SubagentPolicyInput): SubagentPolicy;
69
+ }
70
+ declare const SubagentPrestartDenied_base: Schema.Class<SubagentPrestartDenied, Schema.TaggedStruct<"SubagentPrestartDenied", {
71
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
72
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
73
+ readonly reason: Schema.Literals<readonly ["nested-delegation", "grant-violation", "budget-conflict"]>;
74
+ readonly message: Schema.String;
75
+ }>, import("effect/Cause").YieldableError>;
76
+ /**
77
+ * Delegation preflight denied before any child started.
78
+ * No reservation, identity, or event exists for the
79
+ * denied invocation; retry requires a new authorized parent Tool Call.
80
+ */
81
+ declare class SubagentPrestartDenied extends SubagentPrestartDenied_base {}
82
+ declare const SubagentProjectionFailure_base: Schema.Class<SubagentProjectionFailure, Schema.TaggedStruct<"SubagentProjectionFailure", {
83
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
84
+ readonly stage: Schema.Literals<readonly ["input", "result"]>;
85
+ readonly message: Schema.String;
86
+ /** Original validation error; detailed diagnostics are never part of the safe message. */
87
+ readonly cause: Schema.optionalKey<Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>>;
88
+ readonly stack: Schema.optionalKey<Schema.String>;
89
+ }>, import("effect/Cause").YieldableError>;
90
+ /**
91
+ * Input or result projection failed its Schema or bounds.
92
+ * Fail closed: the message is a fixed description and
93
+ * never carries the raw child value.
94
+ */
95
+ declare class SubagentProjectionFailure extends SubagentProjectionFailure_base {}
96
+ /**
97
+ * Derive the parent-Run delegation caps registered with
98
+ * `SubagentReservations` from one delegation policy: the per-invocation
99
+ * bounds scaled by `maxChildren` plus the invocation and concurrency limits.
100
+ */
101
+ declare const delegationCapsFromPolicy: (policy: SubagentPolicy) => SubagentDelegationCaps;
102
+ /** Derive the all-or-nothing per-invocation reservation from one delegation policy. */
103
+ declare const delegationAllocationFromPolicy: (policy: SubagentPolicy) => SubagentReservationAmounts;
104
+ //#endregion
105
+ //#region src/capabilities/internal/subagent-background.d.ts
106
+ type Declaration<Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project> = Pick<SubagentDefineOptions<Input, Output, unknown, Record<string, Tool.Any>, Parameters, Success, Failure, Prepare, Project>, "parameters" | "success" | "failure" | "prepareInput" | "projectResult" | "policy" | "toolCallAllowance" | "needsApproval"> & {
107
+ readonly name: Name;
108
+ readonly delegationId: WorkerRef["delegationId"];
109
+ readonly target: AnyDefinition & {
110
+ readonly input: Input;
111
+ readonly output: Output;
112
+ };
113
+ readonly grant: SubagentGrant;
114
+ };
115
+ type WorkerDeclaration<Name extends string> = {
116
+ readonly name: Name;
117
+ readonly delegationId: WorkerRef["delegationId"];
118
+ readonly target: Pick<AnyDefinition, "id">;
119
+ };
120
+ /** Portable identity checked against this declaration; possession grants no authority. */
121
+ declare const Worker: <const Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.brand<Schema.Struct<{
122
+ readonly schemaVersion: Schema.Literal<1>;
123
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
124
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
125
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
126
+ }>, `@effect-agent/Worker/${Name}`>;
127
+ type Worker<Name extends string> = ReturnType<typeof Worker<Name>>["Type"];
128
+ /** One exact Receipt, including private canonical failure evidence for programmatic callers. */
129
+ declare const WorkerObservation: <Success extends Schema.Top>(success: Success) => Schema.Union<readonly [Schema.Struct<{
130
+ readonly _tag: Schema.Literal<"Pending">;
131
+ readonly receipt: typeof Receipt;
132
+ }>, Schema.Struct<{
133
+ readonly _tag: Schema.Literal<"Settled">;
134
+ readonly receipt: typeof Receipt;
135
+ readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
136
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
137
+ readonly outcome: Schema.Literal<"completed">;
138
+ readonly result: Success;
139
+ }>, Schema.Struct<{
140
+ readonly _tag: Schema.Literal<"Settled">;
141
+ readonly receipt: typeof Receipt;
142
+ readonly runId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">>;
143
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
144
+ readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
145
+ readonly failure: typeof SubagentExecutionFailure;
146
+ readonly diagnostic: Schema.optionalKey<Schema.declareConstructor<{
147
+ readonly errorTag: string;
148
+ readonly message: string;
149
+ readonly diagnostic?: Diagnostic | undefined;
150
+ readonly context?: {
151
+ readonly agentId?: string | undefined;
152
+ readonly threadId?: string | undefined;
153
+ readonly runId?: string | undefined;
154
+ readonly submissionId?: string | undefined;
155
+ readonly attemptId?: string | undefined;
156
+ readonly turnId?: string | undefined;
157
+ readonly toolCallId?: string | undefined;
158
+ readonly toolName?: string | undefined;
159
+ readonly callId?: string | undefined;
160
+ readonly check?: string | undefined;
161
+ readonly operation?: string | undefined;
162
+ } | undefined;
163
+ }, {
164
+ readonly errorTag: string;
165
+ readonly message: string;
166
+ readonly diagnostic?: Diagnostic | undefined;
167
+ readonly context?: {
168
+ readonly agentId?: string | undefined;
169
+ readonly threadId?: string | undefined;
170
+ readonly runId?: string | undefined;
171
+ readonly submissionId?: string | undefined;
172
+ readonly attemptId?: string | undefined;
173
+ readonly turnId?: string | undefined;
174
+ readonly toolCallId?: string | undefined;
175
+ readonly toolName?: string | undefined;
176
+ readonly callId?: string | undefined;
177
+ readonly check?: string | undefined;
178
+ readonly operation?: string | undefined;
179
+ } | undefined;
180
+ }, readonly [Schema.Struct<{
181
+ readonly errorTag: Schema.NonEmptyString;
182
+ readonly message: Schema.String;
183
+ readonly diagnostic: Schema.optionalKey<Schema.Codec<Diagnostic, Diagnostic, never, never>>;
184
+ readonly context: Schema.optionalKey<Schema.declareConstructor<{
185
+ readonly agentId?: string | undefined;
186
+ readonly threadId?: string | undefined;
187
+ readonly runId?: string | undefined;
188
+ readonly submissionId?: string | undefined;
189
+ readonly attemptId?: string | undefined;
190
+ readonly turnId?: string | undefined;
191
+ readonly toolCallId?: string | undefined;
192
+ readonly toolName?: string | undefined;
193
+ readonly callId?: string | undefined;
194
+ readonly check?: string | undefined;
195
+ readonly operation?: string | undefined;
196
+ }, {
197
+ readonly agentId?: string | undefined;
198
+ readonly threadId?: string | undefined;
199
+ readonly runId?: string | undefined;
200
+ readonly submissionId?: string | undefined;
201
+ readonly attemptId?: string | undefined;
202
+ readonly turnId?: string | undefined;
203
+ readonly toolCallId?: string | undefined;
204
+ readonly toolName?: string | undefined;
205
+ readonly callId?: string | undefined;
206
+ readonly check?: string | undefined;
207
+ readonly operation?: string | undefined;
208
+ }, readonly [Schema.Struct<{
209
+ readonly agentId: Schema.optionalKey<Schema.String>;
210
+ readonly threadId: Schema.optionalKey<Schema.String>;
211
+ readonly runId: Schema.optionalKey<Schema.String>;
212
+ readonly submissionId: Schema.optionalKey<Schema.String>;
213
+ readonly attemptId: Schema.optionalKey<Schema.String>;
214
+ readonly turnId: Schema.optionalKey<Schema.String>;
215
+ readonly toolCallId: Schema.optionalKey<Schema.String>;
216
+ readonly toolName: Schema.optionalKey<Schema.String>;
217
+ readonly callId: Schema.optionalKey<Schema.String>;
218
+ readonly check: Schema.optionalKey<Schema.String>;
219
+ readonly operation: Schema.optionalKey<Schema.String>;
220
+ }>], {
221
+ readonly agentId?: string | undefined;
222
+ readonly threadId?: string | undefined;
223
+ readonly runId?: string | undefined;
224
+ readonly submissionId?: string | undefined;
225
+ readonly attemptId?: string | undefined;
226
+ readonly turnId?: string | undefined;
227
+ readonly toolCallId?: string | undefined;
228
+ readonly toolName?: string | undefined;
229
+ readonly callId?: string | undefined;
230
+ readonly check?: string | undefined;
231
+ readonly operation?: string | undefined;
232
+ }>>;
233
+ }>], {
234
+ readonly errorTag: string;
235
+ readonly message: string;
236
+ readonly diagnostic?: Diagnostic | undefined;
237
+ readonly context?: {
238
+ readonly agentId?: string | undefined;
239
+ readonly threadId?: string | undefined;
240
+ readonly runId?: string | undefined;
241
+ readonly submissionId?: string | undefined;
242
+ readonly attemptId?: string | undefined;
243
+ readonly turnId?: string | undefined;
244
+ readonly toolCallId?: string | undefined;
245
+ readonly toolName?: string | undefined;
246
+ readonly callId?: string | undefined;
247
+ readonly check?: string | undefined;
248
+ readonly operation?: string | undefined;
249
+ } | undefined;
250
+ }>>;
251
+ }>]>;
252
+ type WorkerObservation<Success extends Schema.Top> = ReturnType<typeof WorkerObservation<Success>>["Type"];
253
+ declare const operations: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>) => {
254
+ start: (parameters: Parameters["Type"], options: {
255
+ readonly idempotencyKey: IdempotencyKey;
256
+ readonly budgetScope?: WorkerBudgetScope;
257
+ }) => Effect.Effect<{
258
+ worker: {
259
+ readonly schemaVersion: 1;
260
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
261
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
262
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
263
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>;
264
+ delivery: {
265
+ readonly message: {
266
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
267
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
268
+ };
269
+ readonly status: "pending";
270
+ readonly receipt: null;
271
+ readonly settlement: null;
272
+ readonly reason: string | null;
273
+ } | {
274
+ readonly message: {
275
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
276
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
277
+ };
278
+ readonly status: "accepted";
279
+ readonly receipt: Receipt;
280
+ readonly settlement: null;
281
+ readonly reason: string | null;
282
+ } | {
283
+ readonly message: {
284
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
285
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
286
+ };
287
+ readonly status: "processed";
288
+ readonly receipt: Receipt;
289
+ readonly settlement: {
290
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
291
+ readonly outcome: "aborted" | "completed" | "failed";
292
+ };
293
+ readonly reason: null;
294
+ } | {
295
+ readonly message: {
296
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
297
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
298
+ };
299
+ readonly status: "refused";
300
+ readonly receipt: null;
301
+ readonly settlement: null;
302
+ readonly reason: string;
303
+ } | {
304
+ readonly message: {
305
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
306
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
307
+ };
308
+ readonly status: "parked";
309
+ readonly receipt: Receipt | null;
310
+ readonly settlement: null;
311
+ readonly reason: string;
312
+ };
313
+ }, SubagentPrestartDenied | SubagentProjectionFailure | WorkerError | Failure["Type"], Prepare | SubagentHost | Parameters["EncodingServices"] | (Schema.Top & Input)["EncodingServices"]>;
314
+ followUp: (worker: {
315
+ readonly schemaVersion: 1;
316
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
317
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
318
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
319
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>, parameters: Parameters["Type"], options: {
320
+ readonly idempotencyKey: IdempotencyKey;
321
+ }) => Effect.Effect<{
322
+ readonly message: {
323
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
324
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
325
+ };
326
+ readonly status: "pending";
327
+ readonly receipt: null;
328
+ readonly settlement: null;
329
+ readonly reason: string | null;
330
+ } | {
331
+ readonly message: {
332
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
333
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
334
+ };
335
+ readonly status: "accepted";
336
+ readonly receipt: Receipt;
337
+ readonly settlement: null;
338
+ readonly reason: string | null;
339
+ } | {
340
+ readonly message: {
341
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
342
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
343
+ };
344
+ readonly status: "processed";
345
+ readonly receipt: Receipt;
346
+ readonly settlement: {
347
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
348
+ readonly outcome: "aborted" | "completed" | "failed";
349
+ };
350
+ readonly reason: null;
351
+ } | {
352
+ readonly message: {
353
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
354
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
355
+ };
356
+ readonly status: "refused";
357
+ readonly receipt: null;
358
+ readonly settlement: null;
359
+ readonly reason: string;
360
+ } | {
361
+ readonly message: {
362
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
363
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
364
+ };
365
+ readonly status: "parked";
366
+ readonly receipt: Receipt | null;
367
+ readonly settlement: null;
368
+ readonly reason: string;
369
+ }, SubagentProjectionFailure | WorkerError | Failure["Type"], Prepare | SubagentHost | Parameters["EncodingServices"] | (Schema.Top & Input)["EncodingServices"]>;
370
+ inspectMessage: (worker: {
371
+ readonly schemaVersion: 1;
372
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
373
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
374
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
375
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>, message: {
376
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
377
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
378
+ }) => Effect.Effect<{
379
+ readonly message: {
380
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
381
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
382
+ };
383
+ readonly status: "pending";
384
+ readonly receipt: null;
385
+ readonly settlement: null;
386
+ readonly reason: string | null;
387
+ } | {
388
+ readonly message: {
389
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
390
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
391
+ };
392
+ readonly status: "accepted";
393
+ readonly receipt: Receipt;
394
+ readonly settlement: null;
395
+ readonly reason: string | null;
396
+ } | {
397
+ readonly message: {
398
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
399
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
400
+ };
401
+ readonly status: "processed";
402
+ readonly receipt: Receipt;
403
+ readonly settlement: {
404
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
405
+ readonly outcome: "aborted" | "completed" | "failed";
406
+ };
407
+ readonly reason: null;
408
+ } | {
409
+ readonly message: {
410
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
411
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
412
+ };
413
+ readonly status: "refused";
414
+ readonly receipt: null;
415
+ readonly settlement: null;
416
+ readonly reason: string;
417
+ } | {
418
+ readonly message: {
419
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
420
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
421
+ };
422
+ readonly status: "parked";
423
+ readonly receipt: Receipt | null;
424
+ readonly settlement: null;
425
+ readonly reason: string;
426
+ }, WorkerError, SubagentHost>;
427
+ observe: (operation: "await" | "inspect", worker: {
428
+ readonly schemaVersion: 1;
429
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
430
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
431
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
432
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>, receipt: Receipt) => Effect.Effect<{
433
+ readonly _tag: "Pending";
434
+ readonly receipt: Receipt;
435
+ } | {
436
+ readonly _tag: "Settled";
437
+ readonly receipt: Receipt;
438
+ readonly runId?: (string & import("effect/Brand").Brand<"@effect-agent/core/RunId">) | undefined;
439
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
440
+ readonly outcome: "aborted" | "failed";
441
+ readonly failure: SubagentExecutionFailure;
442
+ readonly diagnostic?: {
443
+ readonly errorTag: string;
444
+ readonly message: string;
445
+ readonly diagnostic?: Diagnostic | undefined;
446
+ readonly context?: {
447
+ readonly agentId?: string | undefined;
448
+ readonly threadId?: string | undefined;
449
+ readonly runId?: string | undefined;
450
+ readonly submissionId?: string | undefined;
451
+ readonly attemptId?: string | undefined;
452
+ readonly turnId?: string | undefined;
453
+ readonly toolCallId?: string | undefined;
454
+ readonly toolName?: string | undefined;
455
+ readonly callId?: string | undefined;
456
+ readonly check?: string | undefined;
457
+ readonly operation?: string | undefined;
458
+ } | undefined;
459
+ } | undefined;
460
+ } | Schema.Struct.View<{
461
+ readonly _tag: Schema.Literal<"Settled">;
462
+ readonly receipt: typeof Receipt;
463
+ readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
464
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
465
+ readonly outcome: Schema.Literal<"completed">;
466
+ readonly result: Success;
467
+ }, "Type", Success extends {
468
+ readonly "~type.optionality": "optional";
469
+ } ? "result" : never, Success extends {
470
+ readonly "~type.mutability": "mutable";
471
+ } ? "result" : never>, SubagentProjectionFailure | WorkerError | Failure["Type"], Project | SubagentHost | Output["DecodingServices"] | Parameters["DecodingServices"] | Success["EncodingServices"]>;
472
+ list: (options?: {
473
+ readonly limit?: number;
474
+ readonly after?: ThreadId;
475
+ } | undefined) => Effect.Effect<{
476
+ items: {
477
+ state: "active" | "idle" | "starting";
478
+ worker: {
479
+ readonly schemaVersion: 1;
480
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
481
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
482
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
483
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>;
484
+ latestReceipt: Receipt | null;
485
+ }[];
486
+ next: (string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">) | null;
487
+ }, WorkerError, SubagentHost>;
488
+ cancel: (worker: {
489
+ readonly schemaVersion: 1;
490
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
491
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
492
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
493
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>, receipt: Receipt) => Effect.Effect<void, JoinedToHost | WorkerError, SubagentHost>;
494
+ };
495
+ /** Retain a first worker input. The same explicit key reuses its durable delivery identity. */
496
+ declare const start: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, parameters: Parameters["Type"], options: {
497
+ readonly idempotencyKey: IdempotencyKey;
498
+ readonly budgetScope?: WorkerBudgetScope;
499
+ }) => Effect.Effect<{
500
+ worker: {
501
+ readonly schemaVersion: 1;
502
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
503
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
504
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
505
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>;
506
+ delivery: {
507
+ readonly message: {
508
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
509
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
510
+ };
511
+ readonly status: "pending";
512
+ readonly receipt: null;
513
+ readonly settlement: null;
514
+ readonly reason: string | null;
515
+ } | {
516
+ readonly message: {
517
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
518
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
519
+ };
520
+ readonly status: "accepted";
521
+ readonly receipt: Receipt;
522
+ readonly settlement: null;
523
+ readonly reason: string | null;
524
+ } | {
525
+ readonly message: {
526
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
527
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
528
+ };
529
+ readonly status: "processed";
530
+ readonly receipt: Receipt;
531
+ readonly settlement: {
532
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
533
+ readonly outcome: "aborted" | "completed" | "failed";
534
+ };
535
+ readonly reason: null;
536
+ } | {
537
+ readonly message: {
538
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
539
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
540
+ };
541
+ readonly status: "refused";
542
+ readonly receipt: null;
543
+ readonly settlement: null;
544
+ readonly reason: string;
545
+ } | {
546
+ readonly message: {
547
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
548
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
549
+ };
550
+ readonly status: "parked";
551
+ readonly receipt: Receipt | null;
552
+ readonly settlement: null;
553
+ readonly reason: string;
554
+ };
555
+ }, SubagentPrestartDenied | SubagentProjectionFailure | WorkerError | Failure["Type"], Prepare | SubagentHost | Parameters["EncodingServices"] | (Schema.Top & Input)["EncodingServices"]>;
556
+ /** Retain typed follow-up parameters for the same worker Thread; inspect its MessageRef for delivery. */
557
+ declare const followUp: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, worker: Worker<Name>, parameters: Parameters["Type"], options: {
558
+ readonly idempotencyKey: IdempotencyKey;
559
+ }) => Effect.Effect<{
560
+ readonly message: {
561
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
562
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
563
+ };
564
+ readonly status: "pending";
565
+ readonly receipt: null;
566
+ readonly settlement: null;
567
+ readonly reason: string | null;
568
+ } | {
569
+ readonly message: {
570
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
571
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
572
+ };
573
+ readonly status: "accepted";
574
+ readonly receipt: Receipt;
575
+ readonly settlement: null;
576
+ readonly reason: string | null;
577
+ } | {
578
+ readonly message: {
579
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
580
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
581
+ };
582
+ readonly status: "processed";
583
+ readonly receipt: Receipt;
584
+ readonly settlement: {
585
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
586
+ readonly outcome: "aborted" | "completed" | "failed";
587
+ };
588
+ readonly reason: null;
589
+ } | {
590
+ readonly message: {
591
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
592
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
593
+ };
594
+ readonly status: "refused";
595
+ readonly receipt: null;
596
+ readonly settlement: null;
597
+ readonly reason: string;
598
+ } | {
599
+ readonly message: {
600
+ readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
601
+ readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
602
+ };
603
+ readonly status: "parked";
604
+ readonly receipt: Receipt | null;
605
+ readonly settlement: null;
606
+ readonly reason: string;
607
+ }, SubagentProjectionFailure | WorkerError | Failure["Type"], Prepare | SubagentHost | Parameters["EncodingServices"] | (Schema.Top & Input)["EncodingServices"]>;
608
+ /** Inspect a continuing worker with the same summary contract returned by list. */
609
+ declare const summary: <const Name extends string>(declaration: WorkerDeclaration<Name> & {
610
+ readonly target: AnyDefinition;
611
+ }, worker: Worker<Name>) => Effect.Effect<{
612
+ latestReceipt: Receipt | null;
613
+ state: "active" | "idle" | "starting";
614
+ worker: {
615
+ readonly schemaVersion: 1;
616
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
617
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
618
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
619
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>;
620
+ }, WorkerError, SubagentHost>;
621
+ /** Inspect a worker summary, retained MessageRef, or the result of one exact accepted Receipt. */
622
+ declare function inspect<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, worker: Worker<Name>): ReturnType<typeof summary<Name>>;
623
+ declare function inspect<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, worker: Worker<Name>, receipt: Receipt): ReturnType<ReturnType<typeof operations<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>>["observe"]>;
624
+ declare function inspect<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, worker: Worker<Name>, message: MessageRef): Effect.Effect<MessageStatus, WorkerError, SubagentHost>;
625
+ /** Read an authorized finite history snapshot; pass the last emitted sequence to resume. */
626
+ declare const observe: <const Name extends string>(declaration: WorkerDeclaration<Name> & {
627
+ readonly target: AnyDefinition;
628
+ }, worker: Worker<Name>, options?: {
629
+ readonly after?: number;
630
+ }) => Stream.Stream<{
631
+ readonly sequence: number;
632
+ readonly recordId: string;
633
+ readonly record: Schema.Json;
634
+ }, WorkerError, SubagentHost>;
635
+ /** Wait for the exact Receipt. Interrupting this Effect never cancels accepted work. */
636
+ declare const awaitWorker: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, worker: Worker<Name>, receipt: Receipt) => Effect.Effect<{
637
+ readonly _tag: "Pending";
638
+ readonly receipt: Receipt;
639
+ } | {
640
+ readonly _tag: "Settled";
641
+ readonly receipt: Receipt;
642
+ readonly runId?: (string & import("effect/Brand").Brand<"@effect-agent/core/RunId">) | undefined;
643
+ readonly settlementId: string & import("effect/Brand").Brand<"@effect-agent/core/SettlementId">;
644
+ readonly outcome: "aborted" | "failed";
645
+ readonly failure: SubagentExecutionFailure;
646
+ readonly diagnostic?: {
647
+ readonly errorTag: string;
648
+ readonly message: string;
649
+ readonly diagnostic?: Diagnostic | undefined;
650
+ readonly context?: {
651
+ readonly agentId?: string | undefined;
652
+ readonly threadId?: string | undefined;
653
+ readonly runId?: string | undefined;
654
+ readonly submissionId?: string | undefined;
655
+ readonly attemptId?: string | undefined;
656
+ readonly turnId?: string | undefined;
657
+ readonly toolCallId?: string | undefined;
658
+ readonly toolName?: string | undefined;
659
+ readonly callId?: string | undefined;
660
+ readonly check?: string | undefined;
661
+ readonly operation?: string | undefined;
662
+ } | undefined;
663
+ } | undefined;
664
+ } | Schema.Struct.View<{
665
+ readonly _tag: Schema.Literal<"Settled">;
666
+ readonly receipt: typeof Receipt;
667
+ readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
668
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
669
+ readonly outcome: Schema.Literal<"completed">;
670
+ readonly result: Success;
671
+ }, "Type", Success extends {
672
+ readonly "~type.optionality": "optional";
673
+ } ? "result" : never, Success extends {
674
+ readonly "~type.mutability": "mutable";
675
+ } ? "result" : never>, SubagentProjectionFailure | WorkerError | Failure["Type"], Project | SubagentHost | Output["DecodingServices"] | Parameters["DecodingServices"] | Success["EncodingServices"]>;
676
+ /** List only workers visible through the caller-bound host facet. */
677
+ declare const list: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, options?: {
678
+ readonly limit?: number;
679
+ readonly after?: ThreadId;
680
+ }) => Effect.Effect<{
681
+ items: {
682
+ state: "active" | "idle" | "starting";
683
+ worker: {
684
+ readonly schemaVersion: 1;
685
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
686
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
687
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
688
+ } & import("effect/Types").UnionToIntersection<`@effect-agent/Worker/${Name}` extends (infer T) ? T extends `@effect-agent/Worker/${Name}` ? T extends (infer U extends string) ? import("effect/Brand").Brand<U> : never : never : never>;
689
+ latestReceipt: Receipt | null;
690
+ }[];
691
+ next: (string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">) | null;
692
+ }, WorkerError, SubagentHost>;
693
+ /** Request cancellation of exactly one Receipt; JoinedToHost remains a typed conflict. */
694
+ declare const cancel: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, worker: Worker<Name>, receipt: Receipt) => Effect.Effect<void, JoinedToHost | WorkerError, SubagentHost>;
695
+ /** Opt in to each model-facing operation. Waiting remains programmatic only. */
696
+ interface BackgroundOptions {
697
+ /** Deliver a standard completion, or use an optional application input mapper. */
698
+ readonly reportToParent?: true | WorkerReporting<unknown, unknown>;
699
+ readonly start?: true;
700
+ readonly followUp?: true;
701
+ readonly inspect?: true;
702
+ readonly summary?: true;
703
+ readonly list?: true;
704
+ readonly cancel?: true;
705
+ /** Author-owned funding request for starts; every native admission separately authorizes it. */
706
+ readonly budgetScope?: WorkerBudgetScope;
707
+ }
708
+ type Operation = Exclude<keyof BackgroundOptions, "budgetScope" | "reportToParent">;
709
+ type Suffix = {
710
+ start: "start";
711
+ followUp: "follow_up";
712
+ inspect: "inspect";
713
+ summary: "summary";
714
+ list: "list";
715
+ cancel: "cancel";
716
+ };
717
+ declare const ReceiptParameters: <Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.Struct<{
718
+ readonly worker: Schema.brand<Schema.Struct<{
719
+ readonly schemaVersion: Schema.Literal<1>;
720
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
721
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
722
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
723
+ }>, `@effect-agent/Worker/${Name}`>;
724
+ readonly receipt: typeof Receipt;
725
+ }>;
726
+ declare const InspectParameters: <Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.Struct<{
727
+ readonly worker: Schema.brand<Schema.Struct<{
728
+ readonly schemaVersion: Schema.Literal<1>;
729
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
730
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
731
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
732
+ }>, `@effect-agent/Worker/${Name}`>;
733
+ readonly message: Schema.optionalKey<Schema.Struct<{
734
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
735
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
736
+ }>>;
737
+ readonly receipt: Schema.optionalKey<typeof Receipt>;
738
+ }>;
739
+ declare const Inspection: <Success extends Schema.Top>(success: Success) => Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
740
+ readonly message: Schema.Struct<{
741
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
742
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
743
+ }>;
744
+ readonly status: Schema.Literal<"pending">;
745
+ readonly receipt: Schema.Null;
746
+ readonly settlement: Schema.Null;
747
+ readonly reason: Schema.NullOr<Schema.NonEmptyString>;
748
+ }>, Schema.Struct<{
749
+ readonly message: Schema.Struct<{
750
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
751
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
752
+ }>;
753
+ readonly status: Schema.Literal<"accepted">;
754
+ readonly receipt: typeof Receipt;
755
+ readonly settlement: Schema.Null;
756
+ readonly reason: Schema.NullOr<Schema.NonEmptyString>;
757
+ }>, Schema.Struct<{
758
+ readonly message: Schema.Struct<{
759
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
760
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
761
+ }>;
762
+ readonly status: Schema.Literal<"processed">;
763
+ readonly receipt: typeof Receipt;
764
+ readonly settlement: Schema.Struct<{
765
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
766
+ readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
767
+ }>;
768
+ readonly reason: Schema.Null;
769
+ }>, Schema.Struct<{
770
+ readonly message: Schema.Struct<{
771
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
772
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
773
+ }>;
774
+ readonly status: Schema.Literal<"refused">;
775
+ readonly receipt: Schema.Null;
776
+ readonly settlement: Schema.Null;
777
+ readonly reason: Schema.NonEmptyString;
778
+ }>, Schema.Struct<{
779
+ readonly message: Schema.Struct<{
780
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
781
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
782
+ }>;
783
+ readonly status: Schema.Literal<"parked">;
784
+ readonly receipt: Schema.NullOr<typeof Receipt>;
785
+ readonly settlement: Schema.Null;
786
+ readonly reason: Schema.NonEmptyString;
787
+ }>]>, Schema.Union<readonly [Schema.Struct<{
788
+ readonly _tag: Schema.Literal<"Pending">;
789
+ readonly receipt: typeof Receipt;
790
+ }>, Schema.Struct<{
791
+ readonly _tag: Schema.Literal<"Settled">;
792
+ readonly receipt: typeof Receipt;
793
+ readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
794
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
795
+ readonly outcome: Schema.Literal<"completed">;
796
+ readonly result: Success;
797
+ }>, Schema.Struct<{
798
+ readonly _tag: Schema.Literal<"Settled">;
799
+ readonly receipt: typeof Receipt;
800
+ readonly runId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">>;
801
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
802
+ readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
803
+ readonly failure: typeof SubagentExecutionFailure;
804
+ }>]>]>;
805
+ declare const WorkerParameters: <Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.Struct<{
806
+ readonly worker: Schema.brand<Schema.Struct<{
807
+ readonly schemaVersion: Schema.Literal<1>;
808
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
809
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
810
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
811
+ }>, `@effect-agent/Worker/${Name}`>;
812
+ }>;
813
+ declare const Summary: <Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.Struct<{
814
+ readonly worker: Schema.brand<Schema.Struct<{
815
+ readonly schemaVersion: Schema.Literal<1>;
816
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
817
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
818
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
819
+ }>, `@effect-agent/Worker/${Name}`>;
820
+ readonly latestReceipt: Schema.NullOr<typeof Receipt>;
821
+ readonly state: Schema.Literals<readonly ["starting", "active", "idle"]>;
822
+ }>;
823
+ declare const FollowUpParameters: <Name extends string, Parameters extends Schema.Top>(declaration: WorkerDeclaration<Name>, parameters: Parameters) => Schema.Struct<{
824
+ readonly worker: Schema.brand<Schema.Struct<{
825
+ readonly schemaVersion: Schema.Literal<1>;
826
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
827
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
828
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
829
+ }>, `@effect-agent/Worker/${Name}`>;
830
+ readonly parameters: Parameters;
831
+ }>;
832
+ declare const ListParameters: Schema.Struct<{
833
+ readonly limit: Schema.optionalKey<Schema.Int>;
834
+ readonly after: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">>;
835
+ }>;
836
+ declare const Started: <Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.Struct<{
837
+ readonly worker: Schema.brand<Schema.Struct<{
838
+ readonly schemaVersion: Schema.Literal<1>;
839
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
840
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
841
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
842
+ }>, `@effect-agent/Worker/${Name}`>;
843
+ readonly delivery: Schema.Union<readonly [Schema.Struct<{
844
+ readonly message: Schema.Struct<{
845
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
846
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
847
+ }>;
848
+ readonly status: Schema.Literal<"pending">;
849
+ readonly receipt: Schema.Null;
850
+ readonly settlement: Schema.Null;
851
+ readonly reason: Schema.NullOr<Schema.NonEmptyString>;
852
+ }>, Schema.Struct<{
853
+ readonly message: Schema.Struct<{
854
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
855
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
856
+ }>;
857
+ readonly status: Schema.Literal<"accepted">;
858
+ readonly receipt: typeof Receipt;
859
+ readonly settlement: Schema.Null;
860
+ readonly reason: Schema.NullOr<Schema.NonEmptyString>;
861
+ }>, Schema.Struct<{
862
+ readonly message: Schema.Struct<{
863
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
864
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
865
+ }>;
866
+ readonly status: Schema.Literal<"processed">;
867
+ readonly receipt: typeof Receipt;
868
+ readonly settlement: Schema.Struct<{
869
+ readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
870
+ readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
871
+ }>;
872
+ readonly reason: Schema.Null;
873
+ }>, Schema.Struct<{
874
+ readonly message: Schema.Struct<{
875
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
876
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
877
+ }>;
878
+ readonly status: Schema.Literal<"refused">;
879
+ readonly receipt: Schema.Null;
880
+ readonly settlement: Schema.Null;
881
+ readonly reason: Schema.NonEmptyString;
882
+ }>, Schema.Struct<{
883
+ readonly message: Schema.Struct<{
884
+ readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
885
+ readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
886
+ }>;
887
+ readonly status: Schema.Literal<"parked">;
888
+ readonly receipt: Schema.NullOr<typeof Receipt>;
889
+ readonly settlement: Schema.Null;
890
+ readonly reason: Schema.NonEmptyString;
891
+ }>]>;
892
+ }>;
893
+ declare const Page: <Name extends string>(declaration: WorkerDeclaration<Name>) => Schema.Struct<{
894
+ readonly items: Schema.$Array<Schema.Struct<{
895
+ readonly worker: Schema.brand<Schema.Struct<{
896
+ readonly schemaVersion: Schema.Literal<1>;
897
+ readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
898
+ readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
899
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
900
+ }>, `@effect-agent/Worker/${Name}`>;
901
+ readonly latestReceipt: Schema.NullOr<typeof Receipt>;
902
+ readonly state: Schema.Literals<readonly ["starting", "active", "idle"]>;
903
+ }>>;
904
+ readonly next: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">>;
905
+ }>;
906
+ declare const preparationFailure: <Failure extends Schema.Top>(failure: Failure) => Schema.Union<readonly [Failure, typeof SubagentProjectionFailure, typeof WorkerError]>;
907
+ declare const startFailure: <Failure extends Schema.Top>(failure: Failure) => Schema.Union<readonly [Failure, typeof SubagentProjectionFailure, typeof SubagentPrestartDenied, typeof WorkerError]>;
908
+ declare const cancelFailure: Schema.Union<readonly [typeof WorkerError, typeof JoinedToHost]>;
909
+ type ToolSchemas<Name extends string, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top> = {
910
+ start: {
911
+ parameters: Parameters;
912
+ success: ReturnType<typeof Started<Name>>;
913
+ failure: ReturnType<typeof startFailure<Failure>>;
914
+ };
915
+ followUp: {
916
+ parameters: ReturnType<typeof FollowUpParameters<Name, Parameters>>;
917
+ success: typeof MessageStatus;
918
+ failure: ReturnType<typeof preparationFailure<Failure>>;
919
+ };
920
+ inspect: {
921
+ parameters: ReturnType<typeof InspectParameters<Name>>;
922
+ success: ReturnType<typeof Inspection<Success>>;
923
+ failure: ReturnType<typeof preparationFailure<Failure>>;
924
+ };
925
+ summary: {
926
+ parameters: ReturnType<typeof WorkerParameters<Name>>;
927
+ success: ReturnType<typeof Summary<Name>>;
928
+ failure: typeof WorkerError;
929
+ };
930
+ list: {
931
+ parameters: typeof ListParameters;
932
+ success: ReturnType<typeof Page<Name>>;
933
+ failure: typeof WorkerError;
934
+ };
935
+ cancel: {
936
+ parameters: ReturnType<typeof ReceiptParameters<Name>>;
937
+ success: typeof Schema.Void;
938
+ failure: typeof cancelFailure;
939
+ };
940
+ };
941
+ type BackgroundToolMap<Name extends string, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top> = {
942
+ start: Tool.Tool<`${Name}_start`, ToolSchemas<Name, Parameters, Success, Failure>["start"] & {
943
+ readonly failureMode: "error";
944
+ }, SubagentHost | Crypto.Crypto>;
945
+ followUp: Tool.Tool<`${Name}_follow_up`, ToolSchemas<Name, Parameters, Success, Failure>["followUp"] & {
946
+ readonly failureMode: "error";
947
+ }, SubagentHost | Crypto.Crypto>;
948
+ inspect: Tool.Tool<`${Name}_inspect`, ToolSchemas<Name, Parameters, Success, Failure>["inspect"] & {
949
+ readonly failureMode: "error";
950
+ }, SubagentHost>;
951
+ summary: Tool.Tool<`${Name}_summary`, ToolSchemas<Name, Parameters, Success, Failure>["summary"] & {
952
+ readonly failureMode: "error";
953
+ }, SubagentHost>;
954
+ list: Tool.Tool<`${Name}_list`, ToolSchemas<Name, Parameters, Success, Failure>["list"] & {
955
+ readonly failureMode: "error";
956
+ }, SubagentHost>;
957
+ cancel: Tool.Tool<`${Name}_cancel`, ToolSchemas<Name, Parameters, Success, Failure>["cancel"] & {
958
+ readonly failureMode: "error";
959
+ }, SubagentHost>;
960
+ };
961
+ /**
962
+ * Native Tool names and schemas expose statically guaranteed selections. The handler Layer also
963
+ * requires services for operations whose conditional flags may enable them at runtime.
964
+ */
965
+ type BackgroundTools<Name extends string, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Selected extends BackgroundOptions> = { readonly [Op in Operation as Selected[Op] extends true ? `${Name}_${Suffix[Op]}` : never]: BackgroundToolMap<Name, Parameters, Success, Failure>[Op]; };
966
+ /**
967
+ * Derive optional native AI Tools and their handler Layer from one immutable declaration.
968
+ * Projection services are captured by the Layer; the host and stable-key Crypto service remain
969
+ * invocation dependencies. The attached `.tool` and its suspension behavior are unchanged.
970
+ */
971
+ declare const background$1: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project, const Selected extends BackgroundOptions>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, selected: Selected) => Readonly<{
972
+ tools: BackgroundTools<Name, Parameters, Success, Failure, Selected>;
973
+ toolkit: Toolkit.Toolkit<BackgroundTools<Name, Parameters, Success, Failure, Selected>>;
974
+ layer: Layer.Layer<Tool.HandlersFor<BackgroundTools<Name, Parameters, Success, Failure, Selected>>, never, (Selected["reportToParent"] extends (infer T) ? T extends Selected["reportToParent"] ? T extends true ? Exclude<Project, Scope.Scope> | Exclude<Output["DecodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope> | Exclude<Success["EncodingServices"], Scope.Scope> : T extends WorkerReporting<infer _E, infer R> ? Exclude<R, Scope.Scope> : never : never : never) | (Selected["followUp"] extends (infer T_1) ? T_1 extends Selected["followUp"] ? T_1 extends true ? Prepare | Input["EncodingServices"] | Parameters["EncodingServices"] : never : never : never) | (Selected["inspect"] extends (infer T_2) ? T_2 extends Selected["inspect"] ? T_2 extends true ? Project | Output["DecodingServices"] | Parameters["DecodingServices"] | Success["EncodingServices"] : never : never : never) | (Selected["start"] extends (infer T_3) ? T_3 extends Selected["start"] ? T_3 extends true ? Prepare | Input["EncodingServices"] | Parameters["EncodingServices"] : never : never : never)>;
975
+ }>;
976
+ //#endregion
977
+ //#region src/capabilities/internal/subagent-reporting.d.ts
978
+ /**
979
+ * Define an optional application-specific conversion for `background({ reportToParent: report })`.
980
+ * Existing Agent Registration `reporting` arrays remain supported. The input Schema must be the coordinator Definition's exact input Schema.
981
+ * Preparation is bounded by the durable host; a retained prepared envelope is never reprojected
982
+ * during delivery retries. The callback should be deterministic and have no external side effects.
983
+ */
984
+ declare const reporting: <const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project, CoordinatorInput extends Schema.Top, ReportFailure extends Schema.Top = typeof Schema.Never, ReportRequirements = never>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, options: {
985
+ readonly input: CoordinatorInput;
986
+ readonly failure?: ReportFailure;
987
+ readonly prepare: (report: WorkerReport<Success>) => Effect.Effect<CoordinatorInput["Type"], ReportFailure["Type"], ReportRequirements>;
988
+ }) => WorkerReporting<Failure["Type"] | ReportFailure["Type"], Parameters["DecodingServices"] | Output["DecodingServices"] | Success["EncodingServices"] | CoordinatorInput["EncodingServices"] | Project | ReportRequirements>;
989
+ /**
990
+ * Adapt a report expressed in a receiving worker declaration's Parameters to its Agent input.
991
+ * Use this on that worker's registration when it can itself launch reporting workers. This
992
+ * explicit conversion preserves custom Parameters and charges the next input to its ancestor.
993
+ */
994
+ declare const reportingToWorker: <E, R, const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project>(report: WorkerReporting<E, R>, destination: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>) => WorkerReporting<E | Failure["Type"], R | Prepare | Parameters["DecodingServices"] | Input["EncodingServices"]>;
995
+ declare namespace Subagent_d_exports {
996
+ export { BackgroundOptions, BackgroundTools, SubagentChildRunFailure, SubagentContainedFailure, SubagentDeclarationOptions, SubagentDefineOptions, SubagentDelegation, SubagentDurableAccounting, SubagentDurableOptions, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentFailureMode, SubagentGrant, SubagentLayerRequirements, SubagentPolicy, SubagentPolicyInput, SubagentPrepareContext, SubagentPrestartDenied, SubagentProjectionFailure, SubagentResult, SubagentResultContext, SubagentReturnModeFailure, SubagentRuntimeOptions, SubagentTool, SubagentToolFailure, SubagentTools, Worker, WorkerCompletion, WorkerObservation, WorkerReport, awaitWorker as await, background, cancel, define, delegationAllocationFromPolicy, delegationCapsFromPolicy, followUp, inspect, layer, list, make, observe, reporting, reportingToWorker, start };
997
+ }
998
+ /**
999
+ * Bounded parent metadata visible to `prepareInput`.
1000
+ * It never contains the parent transcript, prompt, or a root runtime Context.
1001
+ */
1002
+ type SubagentPrepareContext = {
1003
+ readonly delegationId: DelegationId;
1004
+ } & ({
1005
+ readonly source: "tool";
1006
+ readonly toolCallId: ToolCallId;
1007
+ readonly parent: AgentSpawnerParent;
1008
+ } | {
1009
+ readonly source: "programmatic";
1010
+ readonly parent: Pick<AgentSpawnerParent, "agentId" | "threadId">;
1011
+ });
1012
+ /**
1013
+ * Bounded framework context handed to `projectResult` (SUB-034).
1014
+ * `budgetExhausted` is true exactly when the child settled through the
1015
+ * final-answer exhaustion resolution (RUN-018) — on the ephemeral path from
1016
+ * the child result's `finishReason`, on the durable path from the child
1017
+ * Settlement's honest marker — so the projection can surface a
1018
+ * budget-truncated partial to the orchestrator.
1019
+ */
1020
+ interface SubagentResultContext {
1021
+ readonly budgetExhausted: boolean;
1022
+ /** Own and disjoint attached-descendant usage; absent only for legacy/custom hosts. */
1023
+ readonly usage?: RunTotals;
1024
+ readonly delegatedUsage?: RunTotals;
1025
+ }
1026
+ /** Default delegation result, preserving partial-output information. */
1027
+ declare const SubagentResult: <Output extends Schema.Top>(output: Output) => Schema.Struct<{
1028
+ readonly output: Output;
1029
+ readonly budgetExhausted: Schema.Boolean;
1030
+ }>;
1031
+ type SubagentResult<Output extends Schema.Top> = ReturnType<typeof SubagentResult<Output>>;
1032
+ /**
1033
+ * The delegation Tool failure Schema: the author's declared failure plus the
1034
+ * framework's preflight/budget/projection/durable-execution failure family.
1035
+ * With the default `failureMode: "error"`, exactly
1036
+ * this union (plus Effect AI's own error) can enter the parent handler `E`.
1037
+ *
1038
+ * The engine-owned `ToolCallWaiting` suspension signal and the typed
1039
+ * `SubagentDurabilityError` are members so the durable branch's waiting
1040
+ * signal and coordinator-seam failures travel typed through
1041
+ * `failureMode: "error"` (S2 plan §2); neither ever reaches an ephemeral
1042
+ * caller, and a waiting signal is not a Tool failure — the batch executor
1043
+ * keeps the raising call open and suspends the Run.
1044
+ */
1045
+ type SubagentToolFailure<Failure extends Schema.Top> = Schema.Union<readonly [Failure, typeof SubagentPrestartDenied, typeof SubagentBudgetExhausted, typeof SubagentProjectionFailure, typeof SubagentExecutionFailure, typeof ToolCallWaiting, typeof SubagentDurabilityError]>;
1046
+ /**
1047
+ * Resolution for expected delegation failures (SUB-033, ADR-0019 S2).
1048
+ * `"error"` (the default) keeps today's semantics: every expected failure
1049
+ * travels the Effect error channel and fails the parent Tool batch (D-008).
1050
+ * `"return"` contains them: the declared child failure and the framework
1051
+ * failure family become model-visible result data instead of parent-fatal
1052
+ * errors, so one dead child cannot detonate the whole parent Run.
1053
+ *
1054
+ * Effect AI's native `failureMode: "return"` is deliberately NOT used: its
1055
+ * `Stream.catch` converts every handler failure into a result, which would
1056
+ * encode the engine-owned `ToolCallWaiting` suspension signal as data and
1057
+ * silently orphan a durable child. Containment therefore lives in the
1058
+ * delegation handler — the underlying Tool keeps Effect AI
1059
+ * `failureMode: "error"`, the Tool success Schema widens to a union of the
1060
+ * declared success and the contained failure family, and exactly
1061
+ * `ToolCallWaiting` and `SubagentDurabilityError` stay in the error channel,
1062
+ * preserving durable suspension semantics by construction.
1063
+ */
1064
+ type SubagentFailureMode = "error" | "return";
1065
+ /**
1066
+ * The failure family that becomes model-visible result data under
1067
+ * `failureMode: "return"`: the author-declared failure plus every expected
1068
+ * framework delegation failure. The engine-signal members are excluded by
1069
+ * construction.
1070
+ */
1071
+ type SubagentContainedFailure<Failure extends Schema.Top> = Schema.Union<readonly [Failure, typeof SubagentPrestartDenied, typeof SubagentBudgetExhausted, typeof SubagentProjectionFailure, typeof SubagentExecutionFailure]>;
1072
+ /**
1073
+ * The only failures a `"return"`-mode delegation Tool can raise: the
1074
+ * engine-owned waiting signal (consumed by the batch executor, never a Tool
1075
+ * failure) and the durable coordinator-seam error. Neither ever reaches an
1076
+ * ephemeral caller.
1077
+ */
1078
+ type SubagentReturnModeFailure = Schema.Union<readonly [typeof ToolCallWaiting, typeof SubagentDurabilityError]>;
1079
+ /**
1080
+ * The native Effect AI Tool created by `Subagent.make` (SUB-001, SUB-003).
1081
+ * Its per-call dependencies are exactly the engine-provided `AgentSpawner`,
1082
+ * `RunEventSink`, and `SubagentDurability`; every child
1083
+ * requirement except the inherited Thread history policy is a construction requirement
1084
+ * of `Subagent.layer`. The engine excludes its own per-batch services from the runtime's
1085
+ * public requirements. Runtime IDs use the overridable default reference.
1086
+ */
1087
+ type SubagentTool<Name extends string, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Mode extends SubagentFailureMode = "error"> = Mode extends "return" ? Tool.Tool<Name, {
1088
+ readonly parameters: Parameters;
1089
+ readonly success: Schema.Union<readonly [Success, SubagentContainedFailure<Failure>]>;
1090
+ readonly failure: SubagentReturnModeFailure;
1091
+ readonly failureMode: "error";
1092
+ }, AgentSpawner | RunEventSink | SubagentDurability> : Tool.Tool<Name, {
1093
+ readonly parameters: Parameters;
1094
+ readonly success: Success;
1095
+ readonly failure: SubagentToolFailure<Failure>;
1096
+ readonly failureMode: "error";
1097
+ }, AgentSpawner | RunEventSink | SubagentDurability>;
1098
+ /** Singleton Tool record provided by one `Subagent.layer`. */
1099
+ type SubagentTools<Name extends string, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Mode extends SubagentFailureMode = "error"> = { readonly [Key in Name]: SubagentTool<Name, Parameters, Success, Failure, Mode>; };
1100
+ /** Explicit options accepted by `Subagent.make`. */
1101
+ interface SubagentDefineOptions<TargetInput extends Schema.Top, TargetOutput extends Schema.Top, TargetInstructions, TargetTools extends Record<string, Tool.Any>, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, PrepareRequirements = never, ProjectRequirements = never, Mode extends SubagentFailureMode = "error"> {
1102
+ /**
1103
+ * Expected-failure resolution (SUB-033): `"error"` (default) fails the
1104
+ * parent Tool batch; `"return"` contains the declared failure and the
1105
+ * framework failure family as model-visible result data while
1106
+ * `ToolCallWaiting`/`SubagentDurabilityError` stay in the error channel.
1107
+ */
1108
+ readonly failureMode?: Mode;
1109
+ /** Model-visible description of the delegated capability. */
1110
+ readonly description?: string | undefined;
1111
+ /** The model-agnostic child Agent Definition this delegation targets (SUB-002). */
1112
+ readonly target: Definition<TargetInput, TargetOutput, TargetInstructions, Toolkit.Toolkit<TargetTools>, RunDispositionDeclaration<TargetOutput["Type"], Schema.Top> | undefined, unknown, Schema.Top | undefined>;
1113
+ /** Schema for the model-decoded delegation parameters. */
1114
+ readonly parameters: Parameters;
1115
+ /** Schema for the bounded parent Tool result. */
1116
+ readonly success: Success;
1117
+ /** Schema for the author-declared delegation failure data. */
1118
+ readonly failure: Failure;
1119
+ /**
1120
+ * Effectful, typed projection from decoded parameters and bounded parent
1121
+ * metadata to the child Agent input. It never
1122
+ * receives the parent transcript or a root Context; its expected failures
1123
+ * are already the declared Tool failure.
1124
+ */
1125
+ readonly prepareInput: (parameters: Parameters["Type"], context: SubagentPrepareContext) => Effect.Effect<TargetInput["Type"], Failure["Type"] | SubagentProjectionFailure, PrepareRequirements>;
1126
+ /**
1127
+ * Bounded result projection from the Schema-decoded child output, result
1128
+ * context, and original Schema-decoded Tool parameters to the declared Tool
1129
+ * success value. This is the explicit
1130
+ * declassification boundary for child output: the parameters let it bind
1131
+ * echoed identity and scope to the exact request without prompt parsing.
1132
+ * The context carries the
1133
+ * framework's honest exhaustion marker (SUB-034): when `budgetExhausted` is
1134
+ * true the child settled through the final-answer resolution (RUN-018) and
1135
+ * its output is a budget-truncated partial — surface it in the declared
1136
+ * success Schema so the orchestrator can decide to re-delegate with a
1137
+ * raised `toolCallAllowance`.
1138
+ */
1139
+ readonly projectResult: (output: TargetOutput["Type"], context: SubagentResultContext, parameters: Parameters["Type"]) => Effect.Effect<Success["Type"], Failure["Type"] | SubagentProjectionFailure, ProjectRequirements>;
1140
+ /**
1141
+ * Per-invocation child Tool Call allowance (SUB-034): a tightening-only
1142
+ * bound below the child Definition's own `maxToolCalls`, additionally
1143
+ * clamped to this delegation's `SubagentPolicy.maxToolCalls` (the
1144
+ * per-invocation reservation slice). `fromParameters` lets the orchestrator
1145
+ * model grant a larger allowance through an author-owned parameter field —
1146
+ * the budget-extension flow is a fresh re-delegation with a raised
1147
+ * allowance, never a mid-flight top-up. Durable establishment records the
1148
+ * effective allowance before child admission and restores it on every Attempt.
1149
+ */
1150
+ readonly toolCallAllowance?: {
1151
+ /** Applied when `fromParameters` is absent or yields nothing. */
1152
+ readonly default: number;
1153
+ /** Extract the model-granted allowance from the decoded parameters. */
1154
+ readonly fromParameters?: (parameters: Parameters["Type"]) => number | undefined;
1155
+ } | undefined;
1156
+ /** Per-child ceilings. When omitted, reserve from the parent policy's shared delegation pool. */
1157
+ readonly policy?: SubagentPolicy | undefined;
1158
+ /**
1159
+ * Authority ceiling for the child. Defaults to
1160
+ * exactly the target's declared Tool names at depth ceiling one. The engine
1161
+ * exposes only permitted Tools; nested launches also require depth and lifetime authority.
1162
+ */
1163
+ readonly grant?: SubagentGrant | undefined;
1164
+ /**
1165
+ * Native Effect AI approval metadata for establishment only (SUB-026):
1166
+ * parent approval never authorizes child actions, siblings, or retries.
1167
+ */
1168
+ readonly needsApproval?: Tool.NeedsApproval<Parameters> | undefined;
1169
+ }
1170
+ /**
1171
+ * An immutable Subagent capability: one target Agent Definition exposed to
1172
+ * a parent as one Effect AI Tool with explicit projections, policy, and
1173
+ * authority ceiling. It owns no acquired resources and
1174
+ * is not executable until `Subagent.layer` supplies the child's model Layer.
1175
+ */
1176
+ interface SubagentDelegation<Name extends string, TargetInput extends Schema.Top, TargetOutput extends Schema.Top, TargetInstructions, TargetTools extends Record<string, Tool.Any>, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, PrepareRequirements = never, ProjectRequirements = never, Mode extends SubagentFailureMode = "error"> extends SubagentDefineOptions<TargetInput, TargetOutput, TargetInstructions, TargetTools, Parameters, Success, Failure, PrepareRequirements, ProjectRequirements, Mode> {
1177
+ readonly name: Name;
1178
+ /** Stable delegation identity; S1 derives it from the unique Tool name. */
1179
+ readonly delegationId: DelegationId;
1180
+ readonly grant: SubagentGrant;
1181
+ /** The resolved expected-failure resolution (SUB-033); never absent after `make`. */
1182
+ readonly failureMode: Mode;
1183
+ /**
1184
+ * The canonical contained-failure family for this delegation (SUB-033):
1185
+ * the declared failure plus the framework members. Consumers that classify
1186
+ * returned failure data (for example a coverage gate) MUST decode through
1187
+ * this value rather than reconstructing the union, so a framework change
1188
+ * to the contained family can never diverge from their decoder.
1189
+ */
1190
+ readonly containedFailure: SubagentContainedFailure<Failure>;
1191
+ /** The real Effect AI Tool to include in the parent Toolkit (SUB-001). */
1192
+ readonly tool: SubagentTool<Name, Parameters, Success, Failure, Mode>;
1193
+ }
1194
+ /** Pure Subagent authoring surface. */
1195
+ /** Optional authoring fields; schemas default to the child's input and result envelope. */
1196
+ type SubagentDeclarationOptions<Input extends Schema.Top, Output extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project, Mode extends SubagentFailureMode> = Omit<SubagentDefineOptions<Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project, Mode>, "parameters" | "success" | "failure" | "prepareInput" | "projectResult"> & {
1197
+ readonly parameters?: Parameters;
1198
+ readonly success?: Success;
1199
+ readonly failure?: Failure;
1200
+ readonly prepareInput?: SubagentDefineOptions<Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project, Mode>["prepareInput"];
1201
+ readonly projectResult?: SubagentDefineOptions<Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project, Mode>["projectResult"];
1202
+ };
1203
+ /**
1204
+ * Expose one child Agent as an attached Effect AI Tool. The nonempty application
1205
+ * name is preserved as both Tool name and delegation identity; no prefix is required.
1206
+ * Parameters and result projections default to the child's input and result envelope.
1207
+ * Throws when the name is empty. Nested Tool visibility follows the effective inherited grant.
1208
+ */
1209
+ declare function make<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, Parameters extends Schema.Top = Input, Success extends Schema.Top = SubagentResult<Output>, Failure extends Schema.Top = typeof Schema.Never, Prepare = never, Project = never, Target extends Definition<Input, Output, Instructions, Toolkit.Toolkit<Tools>, RunDispositionDeclaration<Output["Type"], Schema.Top> | undefined, unknown, Schema.Top | undefined> = Definition<Input, Output, Instructions, Toolkit.Toolkit<Tools>, RunDispositionDeclaration<Output["Type"], Schema.Top> | undefined, unknown, Schema.Top | undefined>>(name: Name, options: SubagentDeclarationOptions<Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project, "return"> & {
1210
+ readonly failureMode: "return";
1211
+ readonly target: Target;
1212
+ }): SubagentDelegation<Name, Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project, "return"> & {
1213
+ readonly target: Target;
1214
+ };
1215
+ declare function make<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, Parameters extends Schema.Top = Input, Success extends Schema.Top = SubagentResult<Output>, Failure extends Schema.Top = typeof Schema.Never, Prepare = never, Project = never, Target extends Definition<Input, Output, Instructions, Toolkit.Toolkit<Tools>, RunDispositionDeclaration<Output["Type"], Schema.Top> | undefined, unknown, Schema.Top | undefined> = Definition<Input, Output, Instructions, Toolkit.Toolkit<Tools>, RunDispositionDeclaration<Output["Type"], Schema.Top> | undefined, unknown, Schema.Top | undefined>>(name: Name, options: SubagentDeclarationOptions<Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project, "error"> & {
1216
+ readonly target: Target;
1217
+ }): SubagentDelegation<Name, Input, Output, Instructions, Tools, Parameters, Success, Failure, Prepare, Project> & {
1218
+ readonly target: Target;
1219
+ };
1220
+ /** @deprecated Use `Subagent.make`. */
1221
+ declare const define: typeof make;
1222
+ type InstructionResultOf<Instructions, Input> = Instructions extends ((input: Input) => infer Result) ? Result : Instructions;
1223
+ type InstructionErrorOf<Instructions, Input> = InstructionResultOf<Instructions, Input> extends Effect.Effect<infer _Success, infer Error, infer _Requirements> ? Error : never;
1224
+ type InstructionRequirementsOf<Instructions, Input> = InstructionResultOf<Instructions, Input> extends Effect.Effect<infer _Success, infer _Error, infer Requirements> ? Requirements : never;
1225
+ /**
1226
+ * Every expected child Run failure the delegation's total mapping must cover:
1227
+ * the child's inferred Agent failures plus
1228
+ * the interpreter's policy, protocol, and approval failures. Interruption and
1229
+ * defects are not members; they retain their distinct semantics.
1230
+ */
1231
+ type SubagentChildRunFailure<TargetInput extends Schema.Top, TargetOutput extends Schema.Top, TargetInstructions, TargetTools extends Record<string, Tool.Any>, Provider, ModelProvides, ModelRequires, InstructionError = InstructionErrorOf<TargetInstructions, TargetInput["Type"]>, InstructionRequirements = InstructionRequirementsOf<TargetInstructions, TargetInput["Type"]>, InputPromptValue extends InputPromptSource<TargetInput["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined, RunDispositionValue extends RunDispositionDeclaration<TargetOutput["Type"], Schema.Top> | undefined = undefined> = AgentRuntimeFailure<RuntimeBinding<TargetInput, TargetOutput, TargetInstructions, TargetTools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, never, InstructionError>;
1232
+ /**
1233
+ * Construction requirements of one `Subagent.layer`: the child
1234
+ * Binding's full runtime requirements (Model Layer requirements, child Tool
1235
+ * handlers and their services, Schema services), both projection
1236
+ * requirements, and the parent-owned reservation service. Nothing here leaks
1237
+ * into the per-call Tool handler requirements. ThreadHistory and RunContextPreparation belong
1238
+ * to the parent Run's AgentSpawner and are inherited at invocation rather than captured here.
1239
+ */
1240
+ type SubagentLayerRequirements<TargetInput extends Schema.Top, TargetOutput extends Schema.Top, TargetInstructions, TargetTools extends Record<string, Tool.Any>, Provider, ModelProvides, ModelRequires, PrepareRequirements, ProjectRequirements, HookRequirements = never, InstructionError = InstructionErrorOf<TargetInstructions, TargetInput["Type"]>, InstructionRequirements = InstructionRequirementsOf<TargetInstructions, TargetInput["Type"]>, InputPromptValue extends InputPromptSource<TargetInput["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined, RunDispositionValue extends RunDispositionDeclaration<TargetOutput["Type"], Schema.Top> | undefined = undefined> = Exclude<AgentRuntimeRequirements<RuntimeBinding<TargetInput, TargetOutput, TargetInstructions, TargetTools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, HookRequirements, InstructionRequirements>, ThreadHistory | RunContextPreparation> | TargetInput["EncodingServices"] | PrepareRequirements | ProjectRequirements | SubagentReservations;
1241
+ /**
1242
+ * Optional construction-fixed digest override for durable delegation.
1243
+ * The coordinator normally resolves the exact target Definition through its
1244
+ * existing host registration. An override must agree with that registration.
1245
+ */
1246
+ interface SubagentDurableOptions {
1247
+ /**
1248
+ * Exact digests from the target's host registration. Fixed once at handler
1249
+ * Layer construction and checked against that registration at establishment.
1250
+ * Recovery uses the canonical request's recorded digests, never current code.
1251
+ */
1252
+ readonly targetDigests: RunSubagentDigests;
1253
+ }
1254
+ declare const SubagentDurableAccounting_base: Schema.Class<SubagentDurableAccounting, Schema.Struct<{
1255
+ /** The per-invocation allocation reserved at establishment. */
1256
+ readonly allocation: typeof SubagentReservationAmounts;
1257
+ /** Final consumed decision per dimension. */
1258
+ readonly consumed: typeof SubagentReservationAmounts;
1259
+ /** Amounts returned to the parent: `allocation - consumed` per dimension. */
1260
+ readonly released: typeof SubagentReservationAmounts;
1261
+ /** How the decision was computed; the handler only ever reports conservatively. */
1262
+ readonly basis: Schema.Literals<readonly ["reserved-conservative"]>;
1263
+ }>, {}>;
1264
+ /**
1265
+ * The conservative final accounting summary the durable delegation handler
1266
+ * attaches to every settlement join. The handler has no live child usage stream at durable join
1267
+ * time, so every dimension conservatively consumes its full reservation and
1268
+ * releases nothing — unreported usage never creates budget. The coordinator
1269
+ * owns the canonical accounting decision on `SubagentJoined` and may replace
1270
+ * structural dimensions from canonical child evidence; this value is opaque
1271
+ * encoded policy math to the engine and to storage adapters (D8).
1272
+ */
1273
+ declare class SubagentDurableAccounting extends SubagentDurableAccounting_base {}
1274
+ /** Options accepted by `Subagent.layer`. */
1275
+ interface SubagentRuntimeOptions<Failure extends Schema.Top, ChildFailure, HookRequirements = never> {
1276
+ /**
1277
+ * Optional exact digest override. Without it, the durable coordinator resolves
1278
+ * the target Definition from its existing host registrations.
1279
+ */
1280
+ readonly durable?: SubagentDurableOptions | undefined;
1281
+ /**
1282
+ * Total mapping from every expected child Run failure to the declared Tool
1283
+ * failure (SUB-028). The parameter type is the child Binding's complete
1284
+ * expected failure union, so a mapping that covers only part of it is a
1285
+ * compile error. Interruption stays interruption and defects stay defects;
1286
+ * neither reaches this mapping.
1287
+ * When omitted, failures become bounded `SubagentExecutionFailure` values.
1288
+ */
1289
+ readonly mapChildFailure?: ((failure: ChildFailure) => Failure["Type"]) | undefined;
1290
+ /**
1291
+ * Override the parent-Run delegation caps registered with
1292
+ * `SubagentReservations`. An explicit policy uses `delegationCapsFromPolicy(policy)`;
1293
+ * an omitted policy uses one pool sized from the parent policy.
1294
+ * Supply shared caps explicitly when one parent Run uses several delegation
1295
+ * Tools, because re-registering different caps denies start fail-closed.
1296
+ */
1297
+ readonly parentCaps?: SubagentDelegationCaps | undefined;
1298
+ /**
1299
+ * Seed child Run options (approval, context, input hooks) so child actions
1300
+ * follow their own ordinary approval and policy (SUB-026). Hook failures
1301
+ * must be handled inside the hook (`never` in `E`); a supplied budget hook
1302
+ * is composed after the reservation's own usage observation.
1303
+ */
1304
+ readonly child?: SpawnRunOptions<never, HookRequirements> | undefined;
1305
+ }
1306
+ /**
1307
+ * Build the Toolkit handler Layer using the provided model requirement, or pass
1308
+ * a native model / explicit child Binding as an override. Without an override,
1309
+ * provide the model with Layer.provide; the handler captures it at construction.
1310
+ * AutoModel resolves each new child's own Thread ID and projected first task.
1311
+ * Share its selection store across parent Runs and child handler Layers.
1312
+ *
1313
+ * Construction requirements carry the child Binding's full runtime needs and
1314
+ * both projections; they are captured once via `Effect.context` so the
1315
+ * per-call handler requirements stay exactly the Tool's declared engine
1316
+ * dependencies. The handler dispatches on the engine-provided per-batch
1317
+ * `SubagentDurability` service mode:
1318
+ *
1319
+ * - **ephemeral** (the explicit engine default when no durable coordinator
1320
+ * supplied `RunOptions.subagent`): the S1 path unchanged — preflight, an
1321
+ * in-process scoped child Run (SUB-011/012), stable lifecycle events,
1322
+ * total-mapped expected child failures, and Scope-finalizer reservation
1323
+ * settlement on every exit path.
1324
+ * - **durable** (S2): the same fail-closed preflight and input projection,
1325
+ * then idempotent establishment through the coordinator (spec §12 steps
1326
+ * 2-9) with construction-fixed child Binding digests, encoded grant, and
1327
+ * encoded allocation; the engine-owned waiting signal while the attached
1328
+ * child is nonterminal; and, on re-entry with a settled child, output
1329
+ * decoding, `projectResult`, and ONE atomic settlement join carrying the
1330
+ * conservative accounting summary. Failed children join as the bounded
1331
+ * `SubagentExecutionFailure`; no in-process child fiber ever starts.
1332
+ */
1333
+ declare function layer<Name extends string, TargetInput extends Schema.Top, TargetOutput extends Schema.Top, TargetInstructions, TargetTools extends Record<string, Tool.Any>, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, PrepareRequirements, ProjectRequirements, HookRequirements = never, Mode extends SubagentFailureMode = "error", InstructionError = InstructionErrorOf<TargetInstructions, TargetInput["Type"]>, InstructionRequirements = InstructionRequirementsOf<TargetInstructions, TargetInput["Type"]>, InputPromptValue extends InputPromptSource<TargetInput["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined, RunDispositionValue extends RunDispositionDeclaration<TargetOutput["Type"], Schema.Top> | undefined = undefined>(delegation: SubagentDelegation<Name, TargetInput, TargetOutput, TargetInstructions, TargetTools, Parameters, Success, Failure, PrepareRequirements, ProjectRequirements, Mode> & {
1334
+ readonly target: {
1335
+ readonly instructions: InstructionSource<TargetInput["Type"], NoInfer<InstructionError>, NoInfer<InstructionRequirements>>;
1336
+ readonly inputPrompt?: InputPromptValue | undefined;
1337
+ readonly updates?: UpdatesSchema | undefined;
1338
+ readonly runDisposition?: RunDispositionValue | undefined;
1339
+ };
1340
+ }, modelOrBinding?: undefined, options?: SubagentRuntimeOptions<Failure, SubagentChildRunFailure<TargetInput, TargetOutput, TargetInstructions, TargetTools, never, never, ModelServices, InstructionError, InstructionRequirements, InputPromptValue, UpdatesSchema, RunDispositionValue>, HookRequirements>): Layer.Layer<Tool.HandlersFor<SubagentTools<Name, Parameters, Success, Failure, Mode>>, never, SubagentLayerRequirements<TargetInput, TargetOutput, TargetInstructions, TargetTools, never, never, ModelServices, PrepareRequirements, ProjectRequirements, HookRequirements, InstructionError, InstructionRequirements, InputPromptValue, UpdatesSchema, RunDispositionValue>>;
1341
+ declare function layer<Name extends string, TargetInput extends Schema.Top, TargetOutput extends Schema.Top, TargetInstructions, TargetTools extends Record<string, Tool.Any>, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, PrepareRequirements, ProjectRequirements, Provider, ModelProvides, ModelRequires, HookRequirements = never, Mode extends SubagentFailureMode = "error", InstructionError = InstructionErrorOf<TargetInstructions, TargetInput["Type"]>, InstructionRequirements = InstructionRequirementsOf<TargetInstructions, TargetInput["Type"]>, InputPromptValue extends InputPromptSource<TargetInput["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined, RunDispositionValue extends RunDispositionDeclaration<TargetOutput["Type"], Schema.Top> | undefined = undefined>(delegation: SubagentDelegation<Name, TargetInput, TargetOutput, TargetInstructions, TargetTools, Parameters, Success, Failure, PrepareRequirements, ProjectRequirements, Mode> & {
1342
+ readonly target: {
1343
+ readonly instructions: InstructionSource<TargetInput["Type"], NoInfer<InstructionError>, NoInfer<InstructionRequirements>>;
1344
+ readonly inputPrompt?: InputPromptValue | undefined;
1345
+ readonly updates?: UpdatesSchema | undefined;
1346
+ readonly runDisposition?: RunDispositionValue | undefined;
1347
+ };
1348
+ }, modelOrBinding: RuntimeBinding<TargetInput, TargetOutput, TargetInstructions, TargetTools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema> | RuntimeBinding<TargetInput, TargetOutput, TargetInstructions, TargetTools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>["model"], options?: SubagentRuntimeOptions<Failure, SubagentChildRunFailure<TargetInput, TargetOutput, TargetInstructions, TargetTools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, InputPromptValue, UpdatesSchema, RunDispositionValue>, HookRequirements>): Layer.Layer<Tool.HandlersFor<SubagentTools<Name, Parameters, Success, Failure, Mode>>, never, SubagentLayerRequirements<TargetInput, TargetOutput, TargetInstructions, TargetTools, Provider, ModelProvides, ModelRequires, PrepareRequirements, ProjectRequirements, HookRequirements, InstructionError, InstructionRequirements, InputPromptValue, UpdatesSchema, RunDispositionValue>>;
1349
+ /**
1350
+ * Derive selected background Tools directly from a child Agent, using its ID as the delegation
1351
+ * name and its input/output Schemas as the default contract. Pass an explicit Subagent.make
1352
+ * declaration to customize the name, projections, grants, or policy bounds.
1353
+ */
1354
+ declare function background<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, const Selected extends BackgroundOptions>(target: Definition<Input, Output, Instructions, Toolkit.Toolkit<Tools>, RunDispositionDeclaration<Output["Type"], Schema.Top> | undefined, unknown, Schema.Top | undefined> & {
1355
+ readonly id: AgentId & Name;
1356
+ }, selected: Selected): ReturnType<typeof background$1<Name, Input, Output, Input, SubagentResult<Output>, typeof Schema.Never, never, never, Selected>>;
1357
+ declare function background<const Name extends string, Input extends Schema.Top, Output extends Schema.Top, Parameters extends Schema.Top, Success extends Schema.Top, Failure extends Schema.Top, Prepare, Project, const Selected extends BackgroundOptions>(declaration: Declaration<Name, Input, Output, Parameters, Success, Failure, Prepare, Project>, selected: Selected): ReturnType<typeof background$1<Name, Input, Output, Parameters, Success, Failure, Prepare, Project, Selected>>;
1358
+ //#endregion
1359
+ export { cancel as A, delegationAllocationFromPolicy as B, reporting as C, Worker as D, BackgroundTools as E, start as F, SubagentPolicy as I, SubagentPolicyInput as L, inspect as M, list as N, WorkerObservation as O, observe as P, SubagentPrestartDenied as R, make as S, BackgroundOptions as T, delegationCapsFromPolicy as V, SubagentTools as _, SubagentDelegation as a, define as b, SubagentFailureMode as c, SubagentResult as d, SubagentResultContext as f, SubagentToolFailure as g, SubagentTool as h, SubagentDefineOptions as i, followUp as j, awaitWorker as k, SubagentLayerRequirements as l, SubagentRuntimeOptions as m, SubagentContainedFailure as n, SubagentDurableAccounting as o, SubagentReturnModeFailure as p, SubagentDeclarationOptions as r, SubagentDurableOptions as s, SubagentChildRunFailure as t, SubagentPrepareContext as u, Subagent_d_exports as v, reportingToWorker as w, layer as x, background as y, SubagentProjectionFailure as z };
1360
+ //# sourceMappingURL=Subagent-F72tuaxy.d.mts.map