agents 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/abortable-C1SpfVoi.js +21 -0
  2. package/dist/abortable-C1SpfVoi.js.map +1 -0
  3. package/dist/{agent-routing-Bhdbvf7s.d.ts → agent-routing-QDcchcQP.d.ts} +10 -15
  4. package/dist/agent-routing.d.ts +1 -1
  5. package/dist/agent-tool-types.d.ts +1 -1
  6. package/dist/{agent-tools-bJZwBMfq.d.ts → agent-tools-DHL2XI7u.d.ts} +2 -2
  7. package/dist/agent-tools.d.ts +1 -1
  8. package/dist/ai-ahruGw7e.d.ts +239 -0
  9. package/dist/{ai-sdk-OoGkFy3s.js → ai-sdk-Bdsf6mSA.js} +2 -2
  10. package/dist/{ai-sdk-OoGkFy3s.js.map → ai-sdk-Bdsf6mSA.js.map} +1 -1
  11. package/dist/browser/ai.d.ts +8 -227
  12. package/dist/browser/ai.js +259 -1
  13. package/dist/browser/ai.js.map +1 -0
  14. package/dist/browser/index.d.ts +56 -46
  15. package/dist/browser/index.js +4 -361
  16. package/dist/browser/{ai-sdk.d.ts → tools/ai-sdk.d.ts} +7 -7
  17. package/dist/browser/{ai-sdk.js → tools/ai-sdk.js} +5 -4
  18. package/dist/browser/tools/ai-sdk.js.map +1 -0
  19. package/dist/browser/tools/pi.d.ts +111 -0
  20. package/dist/browser/tools/pi.js +119 -0
  21. package/dist/browser/tools/pi.js.map +1 -0
  22. package/dist/browser/{tanstack-ai.d.ts → tools/tanstack-ai.d.ts} +39 -37
  23. package/dist/browser/{tanstack-ai.js → tools/tanstack-ai.js} +73 -59
  24. package/dist/browser/tools/tanstack-ai.js.map +1 -0
  25. package/dist/browser-CEdNlsaD.js +481 -0
  26. package/dist/browser-CEdNlsaD.js.map +1 -0
  27. package/dist/{browser-tmkcAAI3.d.ts → browser-D30VlpcA.d.ts} +63 -37
  28. package/dist/{browser-tool-CBqs6hqa.js → browser-tool-4iomavs_.js} +145 -49
  29. package/dist/browser-tool-4iomavs_.js.map +1 -0
  30. package/dist/{browser-tool-Bn-nzJQI.d.ts → browser-tool-vtrPOV8e.d.ts} +24 -5
  31. package/dist/{capability-B4WbF81e.js → capability-DBAKc6UZ.js} +1 -3
  32. package/dist/capability-DBAKc6UZ.js.map +1 -0
  33. package/dist/{capability-runner-O5VbQzqg.d.ts → capability-runner-BiVUtjqC.d.ts} +1 -7
  34. package/dist/chat/index.d.ts +4 -4
  35. package/dist/chat/index.js +1 -1
  36. package/dist/chat-sdk/index.d.ts +1 -1
  37. package/dist/chat-sdk/index.js +1 -1
  38. package/dist/{client-DS3Dz9l0.d.ts → client-BGIQKJhX.d.ts} +2 -2
  39. package/dist/{client-1tEQ1Oqz.js → client-BnYbNT3z.js} +3 -4
  40. package/dist/client-BnYbNT3z.js.map +1 -0
  41. package/dist/client.d.ts +1 -1
  42. package/dist/{connector-58XDGvc3.js → connector-CtZylXdk.js} +3 -603
  43. package/dist/connector-CtZylXdk.js.map +1 -0
  44. package/dist/{connector-Cl-VqPmA.d.ts → connector-DEXzVoaY.d.ts} +9 -374
  45. package/dist/{conversations-DH0ut_8n.d.ts → conversations-FjHDRZyD.d.ts} +4 -4
  46. package/dist/{current-agent-C07C5o5Y.d.ts → current-agent-CKgT5d1O.d.ts} +3 -5
  47. package/dist/current-agent-DhoDkSnH.js.map +1 -1
  48. package/dist/{durable-object-lifecycle-DRqp475_.d.ts → durable-object-lifecycle-DOI_bzCH.d.ts} +2 -2
  49. package/dist/experimental/channels/index.d.ts +2 -2
  50. package/dist/experimental/channels/index.js +2 -2
  51. package/dist/experimental/channels/web/index.d.ts +2 -2
  52. package/dist/experimental/channels/web/index.js +1 -1
  53. package/dist/{gateway-BDC07gYO.d.ts → gateway-BFO6vRDn.d.ts} +2 -2
  54. package/dist/harness/ai-sdk/index.d.ts +2 -2
  55. package/dist/harness/ai-sdk/index.js +1 -1
  56. package/dist/harness/container/index.d.ts +2 -2
  57. package/dist/harness/container/index.js +3 -3
  58. package/dist/harness/opencode/index.d.ts +1 -1
  59. package/dist/harness/opencode/index.js +2 -2
  60. package/dist/harness/pi/index.d.ts +2 -2
  61. package/dist/harness/pi/index.js +3 -3
  62. package/dist/harness/store/index.d.ts +1 -1
  63. package/dist/harness/store/index.js +1 -1
  64. package/dist/harness/think/index.d.ts +2 -2
  65. package/dist/harness/think/index.js +363 -171
  66. package/dist/harness/think/index.js.map +1 -1
  67. package/dist/{index-D0A5tbWu.d.ts → index-BEL3ZV-s.d.ts} +2 -6
  68. package/dist/{index-Ib_4dwOo.d.ts → index-CBt8oRJt.d.ts} +3 -5
  69. package/dist/index.d.ts +4 -4
  70. package/dist/index.js +2 -2
  71. package/dist/input-schema-BQykTEp_.js +20 -0
  72. package/dist/input-schema-BQykTEp_.js.map +1 -0
  73. package/dist/{input-schema-DNrpTu49.js → input-schema-D2QAtHZH.js} +3 -3
  74. package/dist/input-schema-D2QAtHZH.js.map +1 -0
  75. package/dist/internal_context.d.ts +1 -1
  76. package/dist/lifecycle/index.d.ts +3 -3
  77. package/dist/lifecycle/index.js +2 -2
  78. package/dist/{lifecycle-CFu6OV03.js → lifecycle-DGorpAmA.js} +2 -4
  79. package/dist/lifecycle-DGorpAmA.js.map +1 -0
  80. package/dist/mcp/client/index.d.ts +1 -1
  81. package/dist/mcp/client/index.js +1 -1
  82. package/dist/mcp/index.d.ts +1 -1
  83. package/dist/mcp/index.js +2 -2
  84. package/dist/models/ai-sdk/index.js +1 -1
  85. package/dist/models/opencode/index.js +1 -1
  86. package/dist/models/pi-ai/index.js +1 -1
  87. package/dist/{options-pwTNq9z6.d.ts → options-CiIsJHXR.d.ts} +2 -6
  88. package/dist/queue/index.d.ts +1 -1
  89. package/dist/queue/index.js +1 -1
  90. package/dist/{queue-BB-zfIYF.js → queue-CcIjVYTE.js} +2 -2
  91. package/dist/{queue-BB-zfIYF.js.map → queue-CcIjVYTE.js.map} +1 -1
  92. package/dist/react.d.ts +2 -2
  93. package/dist/routing/index.d.ts +2 -2
  94. package/dist/routing/index.js +1 -1
  95. package/dist/{scheduler-CrFCnv_J.d.ts → scheduler-BCLESHSC.d.ts} +2 -12
  96. package/dist/{scheduler-DZ3xQfeK.js → scheduler-FIHv2-kJ.js} +2 -4
  97. package/dist/scheduler-FIHv2-kJ.js.map +1 -0
  98. package/dist/schedules/index.d.ts +1 -1
  99. package/dist/schedules/index.js +1 -1
  100. package/dist/serializable.d.ts +1 -1
  101. package/dist/session-store-Do4xkDcf.js +606 -0
  102. package/dist/session-store-Do4xkDcf.js.map +1 -0
  103. package/dist/session-store-DoPY12xM.d.ts +383 -0
  104. package/dist/sessions/index.d.ts +1 -1
  105. package/dist/sessions/index.js +1 -1
  106. package/dist/{sessions-B9pNuxdT.js → sessions-_vN5BEZX.js} +2 -2
  107. package/dist/{sessions-B9pNuxdT.js.map → sessions-_vN5BEZX.js.map} +1 -1
  108. package/dist/{src-DgCbZtIR.js → src-CQxJFv4l.js} +8 -8
  109. package/dist/src-CQxJFv4l.js.map +1 -0
  110. package/dist/state/index.d.ts +1 -1
  111. package/dist/state/index.js +1 -3
  112. package/dist/state/index.js.map +1 -1
  113. package/dist/{store-DLeqKuj3.d.ts → store-BKM4Xm9M.d.ts} +23 -1
  114. package/dist/{store-vgcPYo8K.js → store-CslVzfN7.js} +28 -2
  115. package/dist/store-CslVzfN7.js.map +1 -0
  116. package/dist/streams/index.d.ts +1 -1
  117. package/dist/streams/index.js +1 -1
  118. package/dist/{streams-CITClVer.js → streams-lsHMJhRW.js} +2 -2
  119. package/dist/{streams-CITClVer.js.map → streams-lsHMJhRW.js.map} +1 -1
  120. package/dist/{streams-fbG61qM8.d.ts → streams-vrCtbUIn.d.ts} +2 -2
  121. package/dist/sub-routing.d.ts +1 -1
  122. package/dist/tasks/index.d.ts +1 -1
  123. package/dist/tasks/index.js +1 -1
  124. package/dist/{tasks-CkTZNaV1.js → tasks-BN_5AWqI.js} +2 -2
  125. package/dist/{tasks-CkTZNaV1.js.map → tasks-BN_5AWqI.js.map} +1 -1
  126. package/dist/{tasks-PtlB4Uyn.d.ts → tasks-E89KdwkS.d.ts} +2 -2
  127. package/dist/{tool-BPJEbwaX.d.ts → tool-CTp72Jb_.d.ts} +4 -4
  128. package/dist/tool-CxKsvxjm.js +1126 -0
  129. package/dist/tool-CxKsvxjm.js.map +1 -0
  130. package/dist/tool-DoVberpN.d.ts +301 -0
  131. package/dist/{tool-3PA8xjB_.js → tool-cQRkwSZZ.js} +6 -17
  132. package/dist/tool-cQRkwSZZ.js.map +1 -0
  133. package/dist/tool-helpers-O5BDVEAY.js +58 -0
  134. package/dist/tool-helpers-O5BDVEAY.js.map +1 -0
  135. package/dist/voice/index.d.ts +2 -2
  136. package/dist/web/fetch/index.d.ts +89 -0
  137. package/dist/web/fetch/index.js +20 -0
  138. package/dist/web/fetch/index.js.map +1 -0
  139. package/dist/web/fetch/tools/ai-sdk.d.ts +80 -0
  140. package/dist/web/fetch/tools/ai-sdk.js +47 -0
  141. package/dist/web/fetch/tools/ai-sdk.js.map +1 -0
  142. package/dist/web/fetch/tools/pi.d.ts +84 -0
  143. package/dist/web/fetch/tools/pi.js +88 -0
  144. package/dist/web/fetch/tools/pi.js.map +1 -0
  145. package/dist/web/fetch/tools/tanstack-ai.d.ts +78 -0
  146. package/dist/web/fetch/tools/tanstack-ai.js +45 -0
  147. package/dist/web/fetch/tools/tanstack-ai.js.map +1 -0
  148. package/dist/{websearch → web/search}/index.d.ts +1 -1
  149. package/dist/{websearch → web/search}/index.js +1 -1
  150. package/dist/{websearch → web/search}/tools/ai-sdk.d.ts +2 -2
  151. package/dist/{websearch → web/search}/tools/ai-sdk.js +3 -3
  152. package/dist/web/search/tools/ai-sdk.js.map +1 -0
  153. package/dist/{websearch → web/search}/tools/pi.d.ts +3 -3
  154. package/dist/{websearch → web/search}/tools/pi.js +2 -2
  155. package/dist/web/search/tools/pi.js.map +1 -0
  156. package/dist/{websearch → web/search}/tools/tanstack-ai.d.ts +2 -2
  157. package/dist/{websearch → web/search}/tools/tanstack-ai.js +3 -3
  158. package/dist/web/search/tools/tanstack-ai.js.map +1 -0
  159. package/dist/websockets/index.d.ts +2 -2
  160. package/dist/websockets/index.js +1 -1
  161. package/dist/{websockets-CmENGb-Z.js → websockets-C3zy8YR0.js} +3 -5
  162. package/dist/websockets-C3zy8YR0.js.map +1 -0
  163. package/dist/workflow-types.d.ts +1 -1
  164. package/dist/workflows.d.ts +1 -1
  165. package/dist/workflows.js +1 -1
  166. package/docs/browse-the-web.md +26 -1
  167. package/docs/fetch-the-web.md +276 -0
  168. package/docs/harnesses/pi.md +25 -0
  169. package/docs/index.md +99 -76
  170. package/docs/lifecycle.md +2 -3
  171. package/docs/queue.md +2 -3
  172. package/docs/scheduling.md +2 -6
  173. package/docs/search-the-web.md +2 -0
  174. package/package.json +44 -19
  175. package/dist/ai-fm7xx1BK.js +0 -312
  176. package/dist/ai-fm7xx1BK.js.map +0 -1
  177. package/dist/browser/ai-sdk.js.map +0 -1
  178. package/dist/browser/index.js.map +0 -1
  179. package/dist/browser/tanstack-ai.js.map +0 -1
  180. package/dist/browser-tool-CBqs6hqa.js.map +0 -1
  181. package/dist/capability-B4WbF81e.js.map +0 -1
  182. package/dist/client-1tEQ1Oqz.js.map +0 -1
  183. package/dist/connector-58XDGvc3.js.map +0 -1
  184. package/dist/input-schema-DNrpTu49.js.map +0 -1
  185. package/dist/lifecycle-CFu6OV03.js.map +0 -1
  186. package/dist/scheduler-DZ3xQfeK.js.map +0 -1
  187. package/dist/src-DgCbZtIR.js.map +0 -1
  188. package/dist/store-vgcPYo8K.js.map +0 -1
  189. package/dist/tool-3PA8xjB_.js.map +0 -1
  190. package/dist/websearch/tools/ai-sdk.js.map +0 -1
  191. package/dist/websearch/tools/pi.js.map +0 -1
  192. package/dist/websearch/tools/tanstack-ai.js.map +0 -1
  193. package/dist/websockets-CmENGb-Z.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"current-agent-DhoDkSnH.js","names":[],"sources":["../src/lifecycle/current-agent.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type { DurableObject } from \"cloudflare:workers\";\n\nimport type { MemoryLimitContext } from \"./capability-runner\";\nimport type { Lifecycle } from \"./durable-object-lifecycle\";\nimport type { Connection } from \"./types\";\nimport type { LifecycleJobContext, LifecycleJobOutcome } from \"./job-queue\";\n\n/**\n * A Durable Object that has installed the Agents SDK Lifecycle.\n *\n * Pass a more specific Lifecycle Object type to {@link getCurrentAgent} when\n * shared host code needs APIs implemented by a particular object.\n *\n * @experimental The API surface may change before stabilizing.\n */\nexport interface LifecycleObject<\n Env extends object = Cloudflare.Env,\n Props extends object = object\n> extends DurableObject<Env> {\n readonly lifecycle: Lifecycle<Env, Props>;\n onStart?(props?: Props): void | Promise<void>;\n onRequest?(request: Request): Response | Promise<Response>;\n onAlarm?(): void | Promise<void>;\n onJob?(\n context: LifecycleJobContext\n ): LifecycleJobOutcome | void | Promise<LifecycleJobOutcome | void>;\n /**\n * Host domain policy applied when the alarm memory-limit circuit breaker\n * records a strike (#1825), after every capability's `onMemoryLimit` hook.\n *\n * Lifecycle dispatches host hooks structurally through its internal host\n * cast, so TS visibility is the host's to choose: a framework host whose\n * implementation is internal machinery declares the hook `protected` (the\n * pattern — see `AIChatAgent`/`Think`) and keeps the real work in a\n * `private _cf_`-prefixed method, without falling out of this contract at\n * runtime.\n */\n onAlarmMemoryLimit?(context: MemoryLimitContext): void | Promise<void>;\n}\n\n/** Values associated with the currently executing Lifecycle host. */\nexport type AgentContextStore = {\n /** Lifecycle host selected for this invocation. */\n agent: unknown;\n /** WebSocket connection selected for this invocation, when applicable. */\n connection: Connection | undefined;\n /** HTTP request selected for this invocation, when applicable. */\n request: Request | undefined;\n /** Extension-owned value selected for this invocation, when applicable. */\n email: unknown;\n};\n\n/** Values returned by {@link getCurrentAgent}. */\nexport type CurrentAgentContext<\n Host extends DurableObject = LifecycleObject,\n Email = unknown\n> = {\n agent: Host | undefined;\n connection: Connection | undefined;\n request: Request | undefined;\n email: Email | undefined;\n};\n\n/**\n * Shared invocation context for Lifecycle, Agent, AIChatAgent, and Think.\n *\n * @internal Importing or relying on this symbol will break your code in a\n * future release. Use {@link getCurrentAgent} to read the public context.\n */\nexport const __DO_NOT_USE_WILL_BREAK__agentContext =\n new AsyncLocalStorage<AgentContextStore>();\n\n/**\n * Return the current Agent or Lifecycle Object and invocation-specific values.\n *\n * Lifecycle host startup and alarm hooks receive the current object with no\n * request. Request hooks additionally receive the request being handled.\n * Lifecycle-managed WebSocket hooks receive their connection and, during\n * connect, its upgrade request. Agent extensions may also establish context\n * for email, chat turns, callable methods, and detached work. Capability hooks\n * do not run in this ambient context.\n */\nexport function getCurrentAgent<\n Host extends DurableObject = LifecycleObject\n>(): CurrentAgentContext<Host> {\n const store = __DO_NOT_USE_WILL_BREAK__agentContext.getStore();\n if (!store) {\n return {\n agent: undefined,\n connection: undefined,\n request: undefined,\n email: undefined\n };\n }\n\n return {\n agent: store.agent as Host,\n connection: store.connection,\n request: store.request,\n email: store.email\n };\n}\n\ntype LifecycleHostContext<Env extends object, Props extends object> = {\n readonly host: LifecycleObject<Env, Props>;\n readonly connection?: Connection;\n readonly request?: Request;\n};\n\n/** Run one host hook in the context of its Lifecycle Object. */\nexport function runInLifecycleHostContext<\n Env extends object,\n Props extends object,\n T\n>(context: LifecycleHostContext<Env, Props>, operation: () => T): T {\n return __DO_NOT_USE_WILL_BREAK__agentContext.run(\n {\n agent: context.host,\n connection: context.connection,\n request: context.request,\n email: undefined\n },\n operation\n );\n}\n\n/** Run a capability hook without inheriting a current Agent or host context. */\nexport function runWithoutCurrentAgent<T>(operation: () => T): T {\n return __DO_NOT_USE_WILL_BREAK__agentContext.exit(operation);\n}\n"],"mappings":";;;;;;;;AAsEA,MAAa,wCACX,IAAI,kBAAqC;;;;;;;;;;;AAY3C,SAAgB,kBAEe;CAC7B,MAAM,QAAQ,sCAAsC,SAAS;CAC7D,IAAI,CAAC,OACH,OAAO;EACL,OAAO,KAAA;EACP,YAAY,KAAA;EACZ,SAAS,KAAA;EACT,OAAO,KAAA;CACT;CAGF,OAAO;EACL,OAAO,MAAM;EACb,YAAY,MAAM;EAClB,SAAS,MAAM;EACf,OAAO,MAAM;CACf;AACF;;AASA,SAAgB,0BAId,SAA2C,WAAuB;CAClE,OAAO,sCAAsC,IAC3C;EACE,OAAO,QAAQ;EACf,YAAY,QAAQ;EACpB,SAAS,QAAQ;EACjB,OAAO,KAAA;CACT,GACA,SACF;AACF;;AAGA,SAAgB,uBAA0B,WAAuB;CAC/D,OAAO,sCAAsC,KAAK,SAAS;AAC7D"}
1
+ {"version":3,"file":"current-agent-DhoDkSnH.js","names":[],"sources":["../src/lifecycle/current-agent.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type { DurableObject } from \"cloudflare:workers\";\n\nimport type { MemoryLimitContext } from \"./capability-runner\";\nimport type { Lifecycle } from \"./durable-object-lifecycle\";\nimport type { Connection } from \"./types\";\nimport type { LifecycleJobContext, LifecycleJobOutcome } from \"./job-queue\";\n\n/**\n * A Durable Object that has installed the Agents SDK Lifecycle.\n *\n * Pass a more specific Lifecycle Object type to {@link getCurrentAgent} when\n * shared host code needs APIs implemented by a particular object.\n */\nexport interface LifecycleObject<\n Env extends object = Cloudflare.Env,\n Props extends object = object\n> extends DurableObject<Env> {\n readonly lifecycle: Lifecycle<Env, Props>;\n onStart?(props?: Props): void | Promise<void>;\n onRequest?(request: Request): Response | Promise<Response>;\n onAlarm?(): void | Promise<void>;\n onJob?(\n context: LifecycleJobContext\n ): LifecycleJobOutcome | void | Promise<LifecycleJobOutcome | void>;\n /**\n * Host domain policy applied when the alarm memory-limit circuit breaker\n * records a strike (#1825), after every capability's `onMemoryLimit` hook.\n *\n * Lifecycle dispatches host hooks structurally through its internal host\n * cast, so TS visibility is the host's to choose: a framework host whose\n * implementation is internal machinery declares the hook `protected` (the\n * pattern — see `AIChatAgent`/`Think`) and keeps the real work in a\n * `private _cf_`-prefixed method, without falling out of this contract at\n * runtime.\n */\n onAlarmMemoryLimit?(context: MemoryLimitContext): void | Promise<void>;\n}\n\n/** Values associated with the currently executing Lifecycle host. */\nexport type AgentContextStore = {\n /** Lifecycle host selected for this invocation. */\n agent: unknown;\n /** WebSocket connection selected for this invocation, when applicable. */\n connection: Connection | undefined;\n /** HTTP request selected for this invocation, when applicable. */\n request: Request | undefined;\n /** Extension-owned value selected for this invocation, when applicable. */\n email: unknown;\n};\n\n/** Values returned by {@link getCurrentAgent}. */\nexport type CurrentAgentContext<\n Host extends DurableObject = LifecycleObject,\n Email = unknown\n> = {\n agent: Host | undefined;\n connection: Connection | undefined;\n request: Request | undefined;\n email: Email | undefined;\n};\n\n/**\n * Shared invocation context for Lifecycle, Agent, AIChatAgent, and Think.\n *\n * @internal Importing or relying on this symbol will break your code in a\n * future release. Use {@link getCurrentAgent} to read the public context.\n */\nexport const __DO_NOT_USE_WILL_BREAK__agentContext =\n new AsyncLocalStorage<AgentContextStore>();\n\n/**\n * Return the current Agent or Lifecycle Object and invocation-specific values.\n *\n * Lifecycle host startup and alarm hooks receive the current object with no\n * request. Request hooks additionally receive the request being handled.\n * Lifecycle-managed WebSocket hooks receive their connection and, during\n * connect, its upgrade request. Agent extensions may also establish context\n * for email, chat turns, callable methods, and detached work. Capability hooks\n * do not run in this ambient context.\n */\nexport function getCurrentAgent<\n Host extends DurableObject = LifecycleObject\n>(): CurrentAgentContext<Host> {\n const store = __DO_NOT_USE_WILL_BREAK__agentContext.getStore();\n if (!store) {\n return {\n agent: undefined,\n connection: undefined,\n request: undefined,\n email: undefined\n };\n }\n\n return {\n agent: store.agent as Host,\n connection: store.connection,\n request: store.request,\n email: store.email\n };\n}\n\ntype LifecycleHostContext<Env extends object, Props extends object> = {\n readonly host: LifecycleObject<Env, Props>;\n readonly connection?: Connection;\n readonly request?: Request;\n};\n\n/** Run one host hook in the context of its Lifecycle Object. */\nexport function runInLifecycleHostContext<\n Env extends object,\n Props extends object,\n T\n>(context: LifecycleHostContext<Env, Props>, operation: () => T): T {\n return __DO_NOT_USE_WILL_BREAK__agentContext.run(\n {\n agent: context.host,\n connection: context.connection,\n request: context.request,\n email: undefined\n },\n operation\n );\n}\n\n/** Run a capability hook without inheriting a current Agent or host context. */\nexport function runWithoutCurrentAgent<T>(operation: () => T): T {\n return __DO_NOT_USE_WILL_BREAK__agentContext.exit(operation);\n}\n"],"mappings":";;;;;;;;AAoEA,MAAa,wCACX,IAAI,kBAAqC;;;;;;;;;;;AAY3C,SAAgB,kBAEe;CAC7B,MAAM,QAAQ,sCAAsC,SAAS;CAC7D,IAAI,CAAC,OACH,OAAO;EACL,OAAO,KAAA;EACP,YAAY,KAAA;EACZ,SAAS,KAAA;EACT,OAAO,KAAA;CACT;CAGF,OAAO;EACL,OAAO,MAAM;EACb,YAAY,MAAM;EAClB,SAAS,MAAM;EACf,OAAO,MAAM;CACf;AACF;;AASA,SAAgB,0BAId,SAA2C,WAAuB;CAClE,OAAO,sCAAsC,IAC3C;EACE,OAAO,QAAQ;EACf,YAAY,QAAQ;EACpB,SAAS,QAAQ;EACjB,OAAO,KAAA;CACT,GACA,SACF;AACF;;AAGA,SAAgB,uBAA0B,WAAuB;CAC/D,OAAO,sCAAsC,KAAK,SAAS;AAC7D"}
@@ -3,7 +3,7 @@ import {
3
3
  b as LifecycleJobs,
4
4
  i as DurableObjectCapability,
5
5
  u as LifecycleRouteAddress
6
- } from "./capability-runner-O5VbQzqg.js";
6
+ } from "./capability-runner-BiVUtjqC.js";
7
7
  import { DurableObject } from "cloudflare:workers";
8
8
 
9
9
  //#region src/lifecycle/durable-object-lifecycle.d.ts
@@ -162,4 +162,4 @@ declare class Lifecycle<
162
162
  }
163
163
  //#endregion
164
164
  export { LifecycleOptions as n, LifecycleRouteEnvelope as r, Lifecycle as t };
165
- //# sourceMappingURL=durable-object-lifecycle-DRqp475_.d.ts.map
165
+ //# sourceMappingURL=durable-object-lifecycle-DOI_bzCH.d.ts.map
@@ -91,13 +91,13 @@ import {
91
91
  s as ForHarnessOptions,
92
92
  t as ChannelState,
93
93
  u as ResponseReadOptions
94
- } from "../../conversations-DH0ut_8n.js";
94
+ } from "../../conversations-FjHDRZyD.js";
95
95
  import {
96
96
  i as GatewayAgent,
97
97
  n as ChannelGatewayOptions,
98
98
  r as ChannelRouteEvent,
99
99
  t as ChannelGateway
100
- } from "../../gateway-BDC07gYO.js";
100
+ } from "../../gateway-BFO6vRDn.js";
101
101
 
102
102
  //#region src/experimental/channels/apply-chunks.d.ts
103
103
  /** Apply a response's chunks to the message it builds or extends. */
@@ -1,8 +1,8 @@
1
1
  import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../../classPrivateFieldGet2-DZBYAB34.js";
2
2
  import { t as _classPrivateMethodInitSpec } from "../../classPrivateMethodInitSpec-qMjJ6sHQ.js";
3
- import { t as LifecycleCapability } from "../../capability-B4WbF81e.js";
3
+ import { t as LifecycleCapability } from "../../capability-DBAKc6UZ.js";
4
4
  import { t as TextSegmentJoiner } from "../../text-segment-joiner-BtAFQSA_.js";
5
- import { n as Streams } from "../../streams-CITClVer.js";
5
+ import { n as Streams } from "../../streams-lsHMJhRW.js";
6
6
  import { t as applyChunks } from "../../apply-chunks-1FheRb9W.js";
7
7
  import { a as toParticipant, i as participantRoute, o as unsupported } from "../../internal-kmw70xwR.js";
8
8
  import { t as WEB_IDENTITY_HEADER } from "../../protocol-y2sSY584.js";
@@ -14,12 +14,12 @@ import {
14
14
  r as ConversationOperation,
15
15
  y as TurnStatus
16
16
  } from "../../../protocol-CukuI73M.js";
17
- import { i as WebSockets } from "../../../index-Ib_4dwOo.js";
17
+ import { i as WebSockets } from "../../../index-CBt8oRJt.js";
18
18
  import {
19
19
  a as ConversationChannel,
20
20
  o as ConversationUpdate,
21
21
  r as ChannelsHost
22
- } from "../../../conversations-DH0ut_8n.js";
22
+ } from "../../../conversations-FjHDRZyD.js";
23
23
 
24
24
  //#region src/experimental/channels/web/channel.d.ts
25
25
  type WebChannelOptions = {
@@ -1,6 +1,6 @@
1
1
  import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../../../classPrivateFieldGet2-DZBYAB34.js";
2
2
  import { t as _classPrivateMethodInitSpec } from "../../../classPrivateMethodInitSpec-qMjJ6sHQ.js";
3
- import { a as getConnectionFlag, l as registerInternalConnectionKeys, t as WebSockets, u as setConnectionFlag } from "../../../websockets-CmENGb-Z.js";
3
+ import { a as getConnectionFlag, l as registerInternalConnectionKeys, t as WebSockets, u as setConnectionFlag } from "../../../websockets-C3zy8YR0.js";
4
4
  import { i as participantRoute } from "../../../internal-kmw70xwR.js";
5
5
  import { n as parseClientFrame, t as WEB_IDENTITY_HEADER } from "../../../protocol-y2sSY584.js";
6
6
  //#region src/experimental/channels/web/channel.ts
@@ -14,7 +14,7 @@ import {
14
14
  p as Participant,
15
15
  s as GatewayOrigin
16
16
  } from "./protocol-CukuI73M.js";
17
- import { c as GatewayEvent } from "./conversations-DH0ut_8n.js";
17
+ import { c as GatewayEvent } from "./conversations-FjHDRZyD.js";
18
18
 
19
19
  //#region src/experimental/channels/gateway.d.ts
20
20
  type ChannelRouteEvent = {
@@ -97,4 +97,4 @@ export {
97
97
  ChannelRouteEvent as r,
98
98
  ChannelGateway as t
99
99
  };
100
- //# sourceMappingURL=gateway-BDC07gYO.d.ts.map
100
+ //# sourceMappingURL=gateway-BFO6vRDn.d.ts.map
@@ -2,7 +2,7 @@ import {
2
2
  _ as LifecycleJobContext,
3
3
  s as LifecycleCapability,
4
4
  v as LifecycleJobOutcome
5
- } from "../../capability-runner-O5VbQzqg.js";
5
+ } from "../../capability-runner-BiVUtjqC.js";
6
6
  import {
7
7
  o as ChannelMessage,
8
8
  p as DeliveryResult
@@ -19,7 +19,7 @@ import {
19
19
  i as HarnessSession,
20
20
  t as AgentHarness
21
21
  } from "../../harness-B6B9S3rb.js";
22
- import { t as ChannelGateway } from "../../gateway-BDC07gYO.js";
22
+ import { t as ChannelGateway } from "../../gateway-BFO6vRDn.js";
23
23
  import {
24
24
  LanguageModel,
25
25
  StopCondition,
@@ -1,6 +1,6 @@
1
1
  import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../../classPrivateFieldGet2-DZBYAB34.js";
2
2
  import { t as _classPrivateMethodInitSpec } from "../../classPrivateMethodInitSpec-qMjJ6sHQ.js";
3
- import { t as LifecycleCapability } from "../../capability-B4WbF81e.js";
3
+ import { t as LifecycleCapability } from "../../capability-DBAKc6UZ.js";
4
4
  import { a as toTranscriptMessage, i as toResponseChunks, n as awaitsInput, o as toUIMessage, r as toResponseChunk, s as toUIMessageChunk, t as answerToolCall } from "../../turns-DCV3ycDl.js";
5
5
  import { convertToModelMessages, jsonSchema, stepCountIs, streamText, toUIMessageStream, tool } from "ai";
6
6
  //#region src/harness/ai-sdk/harness.ts
@@ -3,7 +3,7 @@ import {
3
3
  n as CapabilityStartContext,
4
4
  s as LifecycleCapability,
5
5
  v as LifecycleJobOutcome
6
- } from "../../capability-runner-O5VbQzqg.js";
6
+ } from "../../capability-runner-BiVUtjqC.js";
7
7
  import {
8
8
  d as ContainerInputPart,
9
9
  f as ContainerMessage,
@@ -14,7 +14,7 @@ import {
14
14
  u as ContainerInput,
15
15
  x as JsonValue
16
16
  } from "../../protocol-BEgrJYC5.js";
17
- import { r as JsonValue$1, t as HarnessStore } from "../../store-DLeqKuj3.js";
17
+ import { r as JsonValue$1, t as HarnessStore } from "../../store-BKM4Xm9M.js";
18
18
  import { WorkerEntrypoint } from "cloudflare:workers";
19
19
 
20
20
  //#region src/harness/container/egress.d.ts
@@ -1,8 +1,8 @@
1
1
  import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../../classPrivateFieldGet2-DZBYAB34.js";
2
2
  import { t as _classPrivateMethodInitSpec } from "../../classPrivateMethodInitSpec-qMjJ6sHQ.js";
3
- import { t as LifecycleCapability } from "../../capability-B4WbF81e.js";
4
- import "../../lifecycle-CFu6OV03.js";
5
- import { n as openHarnessStore } from "../../store-vgcPYo8K.js";
3
+ import { t as LifecycleCapability } from "../../capability-DBAKc6UZ.js";
4
+ import "../../lifecycle-DGorpAmA.js";
5
+ import { n as openHarnessStore } from "../../store-CslVzfN7.js";
6
6
  import { d as parseDaemonMessage, i as CONTAINER_HEALTH_PATH, l as chunkEntries, o as CONTAINER_SESSION_PATH, r as CONTAINER_ENV, s as CONTAINER_TOKEN_HEADER } from "../../protocol-cOklVBBD.js";
7
7
  import { WorkerEntrypoint } from "cloudflare:workers";
8
8
  //#region src/harness/container/link.ts
@@ -3,7 +3,7 @@ import {
3
3
  n as CapabilityStartContext,
4
4
  s as LifecycleCapability,
5
5
  v as LifecycleJobOutcome
6
- } from "../../capability-runner-O5VbQzqg.js";
6
+ } from "../../capability-runner-BiVUtjqC.js";
7
7
  import { OpenCodeWorkerd } from "@opencode/sdk/workerd";
8
8
 
9
9
  //#region src/harness/opencode/types.d.ts
@@ -1,7 +1,7 @@
1
1
  import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../../classPrivateFieldGet2-DZBYAB34.js";
2
2
  import { t as _classPrivateMethodInitSpec } from "../../classPrivateMethodInitSpec-qMjJ6sHQ.js";
3
- import { t as LifecycleCapability } from "../../capability-B4WbF81e.js";
4
- import "../../lifecycle-CFu6OV03.js";
3
+ import { t as LifecycleCapability } from "../../capability-DBAKc6UZ.js";
4
+ import "../../lifecycle-DGorpAmA.js";
5
5
  //#region src/harness/table-prefix.ts
6
6
  /**
7
7
  * A view of `storage` whose SQL is rewritten into `prefix`'s namespace.
@@ -3,8 +3,9 @@ import {
3
3
  n as CapabilityStartContext,
4
4
  s as LifecycleCapability,
5
5
  v as LifecycleJobOutcome
6
- } from "../../capability-runner-O5VbQzqg.js";
6
+ } from "../../capability-runner-BiVUtjqC.js";
7
7
  import { T as SkillSource } from "../../index-kbSUIer3.js";
8
+ import { Api, Model, ModelThinkingLevel } from "@earendil-works/pi-ai";
8
9
  import {
9
10
  AgentChange,
10
11
  AgentEventStream,
@@ -16,7 +17,6 @@ import {
16
17
  UserInput
17
18
  } from "@earendil-works/pi-durable";
18
19
  import { SqliteStorage } from "@earendil-works/pi-durable/storage/sqlite";
19
- import { Api, Model, ModelThinkingLevel } from "@earendil-works/pi-ai";
20
20
 
21
21
  //#region src/harness/pi/context.d.ts
22
22
  /**
@@ -1,10 +1,10 @@
1
1
  import { i as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _assertClassBrand, t as _classPrivateFieldGet2 } from "../../classPrivateFieldGet2-DZBYAB34.js";
2
2
  import { t as _classPrivateMethodInitSpec } from "../../classPrivateMethodInitSpec-qMjJ6sHQ.js";
3
- import { t as LifecycleCapability } from "../../capability-B4WbF81e.js";
4
- import "../../lifecycle-CFu6OV03.js";
3
+ import { t as LifecycleCapability } from "../../capability-DBAKc6UZ.js";
4
+ import "../../lifecycle-DGorpAmA.js";
5
+ import { Type } from "@earendil-works/pi-ai";
5
6
  import { LiveDoc, ROOT_CONVERSATION_ID, watchEvents } from "@earendil-works/pi-durable";
6
7
  import { SQLITE_MIGRATIONS, SqliteStorage } from "@earendil-works/pi-durable/storage/sqlite";
7
- import { Type } from "@earendil-works/pi-ai";
8
8
  //#region src/harness/pi/context.ts
9
9
  /** chord's `BACKGROUND_CONTEXT`: no values, never cancelled. */
10
10
  const BACKGROUND_CONTEXT = Object.freeze({
@@ -9,7 +9,7 @@ import {
9
9
  s as OperationRecord,
10
10
  t as HarnessStore,
11
11
  u as openHarnessStore
12
- } from "../../store-DLeqKuj3.js";
12
+ } from "../../store-BKM4Xm9M.js";
13
13
  export {
14
14
  HarnessStore,
15
15
  type HarnessStoreOptions,
@@ -1,2 +1,2 @@
1
- import { n as openHarnessStore, t as HarnessStore } from "../../store-vgcPYo8K.js";
1
+ import { n as openHarnessStore, t as HarnessStore } from "../../store-CslVzfN7.js";
2
2
  export { HarnessStore, openHarnessStore };
@@ -5,10 +5,10 @@ import {
5
5
  t as CapabilityRequestContext,
6
6
  v as LifecycleJobOutcome,
7
7
  x as Connection
8
- } from "../../capability-runner-O5VbQzqg.js";
8
+ } from "../../capability-runner-BiVUtjqC.js";
9
9
  import { n as ClientToolSchema } from "../../client-tools-aIBO0Fk7.js";
10
10
  import { o as SearchResult } from "../../types-B7LojTe4.js";
11
- import { n as WebSocketHandlers } from "../../options-pwTNq9z6.js";
11
+ import { n as WebSocketHandlers } from "../../options-CiIsJHXR.js";
12
12
  import {
13
13
  a as HarnessSessions,
14
14
  c as OperationStatus,