@loopingai/core 0.4.0 → 0.5.1

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 (289) hide show
  1. package/dist/a2a/agent-stub.d.ts +0 -1
  2. package/dist/a2a/agent-stub.js +0 -1
  3. package/dist/a2a/caller.d.ts +0 -1
  4. package/dist/a2a/caller.js +0 -1
  5. package/dist/a2a/card.d.ts +0 -1
  6. package/dist/a2a/card.js +0 -1
  7. package/dist/a2a/context.d.ts +0 -1
  8. package/dist/a2a/context.js +0 -1
  9. package/dist/a2a/executor.d.ts +0 -1
  10. package/dist/a2a/executor.js +0 -1
  11. package/dist/a2a/index.d.ts +0 -1
  12. package/dist/a2a/index.js +0 -1
  13. package/dist/a2a/notify.d.ts +0 -1
  14. package/dist/a2a/notify.js +0 -1
  15. package/dist/a2a/parts.d.ts +0 -1
  16. package/dist/a2a/parts.js +0 -1
  17. package/dist/a2a/push.d.ts +0 -1
  18. package/dist/a2a/push.js +0 -1
  19. package/dist/a2a/task-store.d.ts +0 -1
  20. package/dist/a2a/task-store.js +0 -1
  21. package/dist/a2a/task.d.ts +0 -1
  22. package/dist/a2a/task.js +0 -1
  23. package/dist/a2a/verify.d.ts +0 -1
  24. package/dist/a2a/verify.js +0 -1
  25. package/dist/agent/budget.d.ts +0 -1
  26. package/dist/agent/budget.js +0 -1
  27. package/dist/agent/control.d.ts +0 -1
  28. package/dist/agent/control.js +0 -1
  29. package/dist/agent/final-reply.d.ts +0 -1
  30. package/dist/agent/final-reply.js +0 -1
  31. package/dist/agent/history.d.ts +0 -1
  32. package/dist/agent/history.js +0 -1
  33. package/dist/agent/index.d.ts +0 -1
  34. package/dist/agent/index.js +0 -1
  35. package/dist/agent/inference.d.ts +0 -1
  36. package/dist/agent/inference.js +0 -1
  37. package/dist/agent/model.d.ts +0 -1
  38. package/dist/agent/model.js +0 -1
  39. package/dist/agent/session.d.ts +0 -1
  40. package/dist/agent/session.js +0 -1
  41. package/dist/config.d.ts +0 -1
  42. package/dist/config.js +0 -1
  43. package/dist/contract/index.d.ts +0 -1
  44. package/dist/contract/index.js +0 -1
  45. package/dist/contract/plugin.d.ts +0 -1
  46. package/dist/contract/plugin.js +0 -1
  47. package/dist/contract/recipe.d.ts +14 -3
  48. package/dist/contract/recipe.js +0 -1
  49. package/dist/contract/validation.d.ts +22 -19
  50. package/dist/contract/validation.js +19 -11
  51. package/dist/db/db.d.ts +0 -1
  52. package/dist/db/db.js +0 -1
  53. package/dist/db/index.d.ts +0 -1
  54. package/dist/db/index.js +0 -1
  55. package/dist/db/migrations/index.d.ts +0 -1
  56. package/dist/db/migrations/index.js +0 -1
  57. package/dist/db/models/subtasks.d.ts +0 -1
  58. package/dist/db/models/subtasks.js +0 -1
  59. package/dist/db/models/tasks.d.ts +0 -1
  60. package/dist/db/models/tasks.js +0 -1
  61. package/dist/db/schema.d.ts +0 -1
  62. package/dist/db/schema.js +0 -1
  63. package/dist/env.d.ts +0 -1
  64. package/dist/env.js +0 -1
  65. package/dist/host/agent.d.ts +3 -4
  66. package/dist/host/agent.js +3 -6
  67. package/dist/host/index.d.ts +0 -1
  68. package/dist/host/index.js +0 -1
  69. package/dist/host/plugin-host.d.ts +5 -10
  70. package/dist/host/plugin-host.js +0 -1
  71. package/dist/index.d.ts +0 -1
  72. package/dist/index.js +0 -1
  73. package/dist/platform.d.ts +0 -1
  74. package/dist/platform.js +0 -1
  75. package/dist/round/agent.d.ts +0 -1
  76. package/dist/round/agent.js +0 -1
  77. package/dist/round/index.d.ts +0 -1
  78. package/dist/round/index.js +0 -1
  79. package/dist/round/policy.d.ts +0 -1
  80. package/dist/round/policy.js +0 -1
  81. package/dist/round/subagent.d.ts +0 -1
  82. package/dist/round/subagent.js +0 -3
  83. package/dist/round/turn.d.ts +0 -1
  84. package/dist/round/turn.js +0 -1
  85. package/dist/round/workflow.d.ts +7 -2
  86. package/dist/round/workflow.js +22 -21
  87. package/dist/runtime/index.d.ts +0 -1
  88. package/dist/runtime/index.js +2 -7
  89. package/dist/runtime/tool-families.d.ts +0 -1
  90. package/dist/runtime/tool-families.js +0 -1
  91. package/dist/subagent/fingerprint.d.ts +0 -1
  92. package/dist/subagent/fingerprint.js +7 -3
  93. package/dist/subagent/index.d.ts +0 -1
  94. package/dist/subagent/index.js +0 -1
  95. package/dist/subagent/prompt.d.ts +0 -1
  96. package/dist/subagent/prompt.js +0 -1
  97. package/dist/subagent/run.d.ts +0 -1
  98. package/dist/subagent/run.js +0 -1
  99. package/dist/subagent/workspace.d.ts +0 -1
  100. package/dist/subagent/workspace.js +0 -1
  101. package/dist/subtasks/catalog.d.ts +0 -1
  102. package/dist/subtasks/catalog.js +0 -1
  103. package/dist/subtasks/decomposition.d.ts +0 -1
  104. package/dist/subtasks/decomposition.js +0 -1
  105. package/dist/subtasks/delegate.d.ts +0 -1
  106. package/dist/subtasks/delegate.js +0 -1
  107. package/dist/subtasks/index.d.ts +0 -1
  108. package/dist/subtasks/index.js +0 -1
  109. package/dist/subtasks/scheduler.d.ts +0 -1
  110. package/dist/subtasks/scheduler.js +0 -1
  111. package/dist/subtasks/subtask-types.d.ts +0 -1
  112. package/dist/subtasks/subtask-types.js +0 -1
  113. package/dist/subtasks/types.d.ts +0 -1
  114. package/dist/subtasks/types.js +0 -1
  115. package/dist/testing/auth.d.ts +0 -1
  116. package/dist/testing/auth.js +0 -1
  117. package/dist/testing/do.d.ts +0 -1
  118. package/dist/testing/do.js +0 -1
  119. package/dist/testing/fake-session.d.ts +0 -1
  120. package/dist/testing/fake-session.js +0 -1
  121. package/dist/testing/fixtures.d.ts +0 -1
  122. package/dist/testing/fixtures.js +0 -1
  123. package/dist/testing/harness.d.ts +0 -1
  124. package/dist/testing/harness.js +0 -1
  125. package/dist/testing/index.d.ts +0 -1
  126. package/dist/testing/index.js +0 -1
  127. package/dist/testing/mock-model.d.ts +0 -1
  128. package/dist/testing/mock-model.js +0 -1
  129. package/dist/testing/node.d.ts +0 -1
  130. package/dist/testing/node.js +0 -1
  131. package/dist/testing/vcr-global-setup.d.ts +0 -1
  132. package/dist/testing/vcr-global-setup.js +0 -1
  133. package/dist/testing/vcr-shared.d.ts +0 -1
  134. package/dist/testing/vcr-shared.js +0 -1
  135. package/dist/testing/vcr-spec.d.ts +0 -1
  136. package/dist/testing/vcr-spec.js +0 -1
  137. package/dist/testing/vcr-store.d.ts +0 -1
  138. package/dist/testing/vcr-store.js +0 -1
  139. package/dist/testing/vcr.d.ts +0 -1
  140. package/dist/testing/vcr.js +0 -1
  141. package/dist/worker/define-agent.d.ts +0 -1
  142. package/dist/worker/define-agent.js +0 -1
  143. package/dist/worker/index.d.ts +0 -1
  144. package/dist/worker/index.js +0 -1
  145. package/package.json +2 -2
  146. package/dist/a2a/agent-stub.d.ts.map +0 -1
  147. package/dist/a2a/agent-stub.js.map +0 -1
  148. package/dist/a2a/caller.d.ts.map +0 -1
  149. package/dist/a2a/caller.js.map +0 -1
  150. package/dist/a2a/card.d.ts.map +0 -1
  151. package/dist/a2a/card.js.map +0 -1
  152. package/dist/a2a/context.d.ts.map +0 -1
  153. package/dist/a2a/context.js.map +0 -1
  154. package/dist/a2a/executor.d.ts.map +0 -1
  155. package/dist/a2a/executor.js.map +0 -1
  156. package/dist/a2a/index.d.ts.map +0 -1
  157. package/dist/a2a/index.js.map +0 -1
  158. package/dist/a2a/notify.d.ts.map +0 -1
  159. package/dist/a2a/notify.js.map +0 -1
  160. package/dist/a2a/parts.d.ts.map +0 -1
  161. package/dist/a2a/parts.js.map +0 -1
  162. package/dist/a2a/push.d.ts.map +0 -1
  163. package/dist/a2a/push.js.map +0 -1
  164. package/dist/a2a/task-store.d.ts.map +0 -1
  165. package/dist/a2a/task-store.js.map +0 -1
  166. package/dist/a2a/task.d.ts.map +0 -1
  167. package/dist/a2a/task.js.map +0 -1
  168. package/dist/a2a/verify.d.ts.map +0 -1
  169. package/dist/a2a/verify.js.map +0 -1
  170. package/dist/agent/budget.d.ts.map +0 -1
  171. package/dist/agent/budget.js.map +0 -1
  172. package/dist/agent/control.d.ts.map +0 -1
  173. package/dist/agent/control.js.map +0 -1
  174. package/dist/agent/final-reply.d.ts.map +0 -1
  175. package/dist/agent/final-reply.js.map +0 -1
  176. package/dist/agent/history.d.ts.map +0 -1
  177. package/dist/agent/history.js.map +0 -1
  178. package/dist/agent/index.d.ts.map +0 -1
  179. package/dist/agent/index.js.map +0 -1
  180. package/dist/agent/inference.d.ts.map +0 -1
  181. package/dist/agent/inference.js.map +0 -1
  182. package/dist/agent/model.d.ts.map +0 -1
  183. package/dist/agent/model.js.map +0 -1
  184. package/dist/agent/session.d.ts.map +0 -1
  185. package/dist/agent/session.js.map +0 -1
  186. package/dist/config.d.ts.map +0 -1
  187. package/dist/config.js.map +0 -1
  188. package/dist/contract/index.d.ts.map +0 -1
  189. package/dist/contract/index.js.map +0 -1
  190. package/dist/contract/plugin.d.ts.map +0 -1
  191. package/dist/contract/plugin.js.map +0 -1
  192. package/dist/contract/recipe.d.ts.map +0 -1
  193. package/dist/contract/recipe.js.map +0 -1
  194. package/dist/contract/validation.d.ts.map +0 -1
  195. package/dist/contract/validation.js.map +0 -1
  196. package/dist/db/db.d.ts.map +0 -1
  197. package/dist/db/db.js.map +0 -1
  198. package/dist/db/index.d.ts.map +0 -1
  199. package/dist/db/index.js.map +0 -1
  200. package/dist/db/migrations/index.d.ts.map +0 -1
  201. package/dist/db/migrations/index.js.map +0 -1
  202. package/dist/db/models/subtasks.d.ts.map +0 -1
  203. package/dist/db/models/subtasks.js.map +0 -1
  204. package/dist/db/models/tasks.d.ts.map +0 -1
  205. package/dist/db/models/tasks.js.map +0 -1
  206. package/dist/db/schema.d.ts.map +0 -1
  207. package/dist/db/schema.js.map +0 -1
  208. package/dist/env.d.ts.map +0 -1
  209. package/dist/env.js.map +0 -1
  210. package/dist/host/agent.d.ts.map +0 -1
  211. package/dist/host/agent.js.map +0 -1
  212. package/dist/host/index.d.ts.map +0 -1
  213. package/dist/host/index.js.map +0 -1
  214. package/dist/host/plugin-host.d.ts.map +0 -1
  215. package/dist/host/plugin-host.js.map +0 -1
  216. package/dist/index.d.ts.map +0 -1
  217. package/dist/index.js.map +0 -1
  218. package/dist/platform.d.ts.map +0 -1
  219. package/dist/platform.js.map +0 -1
  220. package/dist/round/agent.d.ts.map +0 -1
  221. package/dist/round/agent.js.map +0 -1
  222. package/dist/round/index.d.ts.map +0 -1
  223. package/dist/round/index.js.map +0 -1
  224. package/dist/round/policy.d.ts.map +0 -1
  225. package/dist/round/policy.js.map +0 -1
  226. package/dist/round/subagent.d.ts.map +0 -1
  227. package/dist/round/subagent.js.map +0 -1
  228. package/dist/round/turn.d.ts.map +0 -1
  229. package/dist/round/turn.js.map +0 -1
  230. package/dist/round/workflow.d.ts.map +0 -1
  231. package/dist/round/workflow.js.map +0 -1
  232. package/dist/runtime/index.d.ts.map +0 -1
  233. package/dist/runtime/index.js.map +0 -1
  234. package/dist/runtime/tool-families.d.ts.map +0 -1
  235. package/dist/runtime/tool-families.js.map +0 -1
  236. package/dist/subagent/fingerprint.d.ts.map +0 -1
  237. package/dist/subagent/fingerprint.js.map +0 -1
  238. package/dist/subagent/index.d.ts.map +0 -1
  239. package/dist/subagent/index.js.map +0 -1
  240. package/dist/subagent/prompt.d.ts.map +0 -1
  241. package/dist/subagent/prompt.js.map +0 -1
  242. package/dist/subagent/run.d.ts.map +0 -1
  243. package/dist/subagent/run.js.map +0 -1
  244. package/dist/subagent/workspace.d.ts.map +0 -1
  245. package/dist/subagent/workspace.js.map +0 -1
  246. package/dist/subtasks/catalog.d.ts.map +0 -1
  247. package/dist/subtasks/catalog.js.map +0 -1
  248. package/dist/subtasks/decomposition.d.ts.map +0 -1
  249. package/dist/subtasks/decomposition.js.map +0 -1
  250. package/dist/subtasks/delegate.d.ts.map +0 -1
  251. package/dist/subtasks/delegate.js.map +0 -1
  252. package/dist/subtasks/index.d.ts.map +0 -1
  253. package/dist/subtasks/index.js.map +0 -1
  254. package/dist/subtasks/scheduler.d.ts.map +0 -1
  255. package/dist/subtasks/scheduler.js.map +0 -1
  256. package/dist/subtasks/subtask-types.d.ts.map +0 -1
  257. package/dist/subtasks/subtask-types.js.map +0 -1
  258. package/dist/subtasks/types.d.ts.map +0 -1
  259. package/dist/subtasks/types.js.map +0 -1
  260. package/dist/testing/auth.d.ts.map +0 -1
  261. package/dist/testing/auth.js.map +0 -1
  262. package/dist/testing/do.d.ts.map +0 -1
  263. package/dist/testing/do.js.map +0 -1
  264. package/dist/testing/fake-session.d.ts.map +0 -1
  265. package/dist/testing/fake-session.js.map +0 -1
  266. package/dist/testing/fixtures.d.ts.map +0 -1
  267. package/dist/testing/fixtures.js.map +0 -1
  268. package/dist/testing/harness.d.ts.map +0 -1
  269. package/dist/testing/harness.js.map +0 -1
  270. package/dist/testing/index.d.ts.map +0 -1
  271. package/dist/testing/index.js.map +0 -1
  272. package/dist/testing/mock-model.d.ts.map +0 -1
  273. package/dist/testing/mock-model.js.map +0 -1
  274. package/dist/testing/node.d.ts.map +0 -1
  275. package/dist/testing/node.js.map +0 -1
  276. package/dist/testing/vcr-global-setup.d.ts.map +0 -1
  277. package/dist/testing/vcr-global-setup.js.map +0 -1
  278. package/dist/testing/vcr-shared.d.ts.map +0 -1
  279. package/dist/testing/vcr-shared.js.map +0 -1
  280. package/dist/testing/vcr-spec.d.ts.map +0 -1
  281. package/dist/testing/vcr-spec.js.map +0 -1
  282. package/dist/testing/vcr-store.d.ts.map +0 -1
  283. package/dist/testing/vcr-store.js.map +0 -1
  284. package/dist/testing/vcr.d.ts.map +0 -1
  285. package/dist/testing/vcr.js.map +0 -1
  286. package/dist/worker/define-agent.d.ts.map +0 -1
  287. package/dist/worker/define-agent.js.map +0 -1
  288. package/dist/worker/index.d.ts.map +0 -1
  289. package/dist/worker/index.js.map +0 -1
@@ -58,4 +58,3 @@ export interface TaskListPage {
58
58
  * what makes a task unreachable from any other caller by construction.
59
59
  */
60
60
  export type AgentResolver = (identity: GatewayIdentity) => TaskAgent;
61
- //# sourceMappingURL=agent-stub.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=agent-stub.js.map
@@ -21,4 +21,3 @@ import type { GatewayIdentity } from "./verify.js";
21
21
  * wants to name it.
22
22
  */
23
23
  export declare function callerContext(identity: GatewayIdentity): string;
24
- //# sourceMappingURL=caller.d.ts.map
@@ -31,4 +31,3 @@ export function callerContext(identity) {
31
31
  }
32
32
  return lines.join("\n");
33
33
  }
34
- //# sourceMappingURL=caller.js.map
@@ -156,4 +156,3 @@ export declare function publicCardJwks(privateJwk: JWK & {
156
156
  }): {
157
157
  keys: JWK[];
158
158
  };
159
- //# sourceMappingURL=card.d.ts.map
package/dist/a2a/card.js CHANGED
@@ -159,4 +159,3 @@ export function publicCardJwks(privateJwk) {
159
159
  void _d;
160
160
  return { keys: [{ ...pub, use: "sig", alg: A2A_JWS_ALG }] };
161
161
  }
162
- //# sourceMappingURL=card.js.map
@@ -17,4 +17,3 @@ import type { GatewayIdentity } from "./verify.js";
17
17
  export declare function buildCallContext(request: Request, identity: GatewayIdentity, tenant: string): ServerCallContext;
18
18
  /** Echo back the extensions the handler actually activated (spec §14.2.2). */
19
19
  export declare function extensionHeaders(context: ServerCallContext): HeadersInit;
20
- //# sourceMappingURL=context.d.ts.map
@@ -59,4 +59,3 @@ export function extensionHeaders(context) {
59
59
  return {};
60
60
  return { [HTTP_EXTENSION_HEADER]: Extensions.toServiceParameter(activated) };
61
61
  }
62
- //# sourceMappingURL=context.js.map
@@ -82,4 +82,3 @@ export declare class A2AExecutor implements AgentExecutor {
82
82
  */
83
83
  cancelTask: (taskId: string, eventBus: ExecutionEventBus) => Promise<void>;
84
84
  }
85
- //# sourceMappingURL=executor.d.ts.map
@@ -104,4 +104,3 @@ export class A2AExecutor {
104
104
  eventBus.finished();
105
105
  };
106
106
  }
107
- //# sourceMappingURL=executor.js.map
@@ -30,4 +30,3 @@ export { buildCallContext, extensionHeaders } from "./context.js";
30
30
  export { DurableTaskStore } from "./task-store.js";
31
31
  export { A2AExecutor, workflowIdForMessage, ignoreAlreadyExists, type AcceptedTurn, type ExecutorConfig, type TurnStarter } from "./executor.js";
32
32
  export type { AgentResolver, TaskAgent, TaskListPage, TaskListQuery } from "./agent-stub.js";
33
- //# sourceMappingURL=index.d.ts.map
package/dist/a2a/index.js CHANGED
@@ -29,4 +29,3 @@ export { textPart, partsText, textOf, agentTextMessage, inboundText, InboundPart
29
29
  export { buildCallContext, extensionHeaders } from "./context.js";
30
30
  export { DurableTaskStore } from "./task-store.js";
31
31
  export { A2AExecutor, workflowIdForMessage, ignoreAlreadyExists } from "./executor.js";
32
- //# sourceMappingURL=index.js.map
@@ -103,4 +103,3 @@ export declare function signCallbackJwt(privateJwk: JWK & {
103
103
  * workflow's `notify` step) can decide whether a non-2xx warrants a retry.
104
104
  */
105
105
  export declare function postNotification(url: string, token: string, jwt: string, task: Task): Promise<Response>;
106
- //# sourceMappingURL=notify.d.ts.map
@@ -177,4 +177,3 @@ export async function postNotification(url, token, jwt, task) {
177
177
  body
178
178
  });
179
179
  }
180
- //# sourceMappingURL=notify.js.map
@@ -43,4 +43,3 @@ export declare function agentTextMessage(input: {
43
43
  contextId: string;
44
44
  taskId: string;
45
45
  }): PlainMessage;
46
- //# sourceMappingURL=parts.d.ts.map
package/dist/a2a/parts.js CHANGED
@@ -92,4 +92,3 @@ export function agentTextMessage(input) {
92
92
  referenceTaskIds: []
93
93
  };
94
94
  }
95
- //# sourceMappingURL=parts.js.map
@@ -68,4 +68,3 @@ export interface PushChannel {
68
68
  * one card and the gateway pins one key for every agent on it.
69
69
  */
70
70
  export declare function createPushChannel(signingKey: string, push: TurnPushContext): PushChannel;
71
- //# sourceMappingURL=push.d.ts.map
package/dist/a2a/push.js CHANGED
@@ -51,4 +51,3 @@ export function createPushChannel(signingKey, push) {
51
51
  }
52
52
  };
53
53
  }
54
- //# sourceMappingURL=push.js.map
@@ -42,4 +42,3 @@ export declare class DurableTaskStore implements TaskStore {
42
42
  */
43
43
  list(params: ListTasksRequest): Promise<ListTasksResponse>;
44
44
  }
45
- //# sourceMappingURL=task-store.d.ts.map
@@ -97,4 +97,3 @@ function parseTimestamp(iso) {
97
97
  const ms = Date.parse(iso);
98
98
  return Number.isNaN(ms) ? undefined : ms;
99
99
  }
100
- //# sourceMappingURL=task-store.js.map
@@ -83,4 +83,3 @@ export interface PlainTask {
83
83
  */
84
84
  export declare function taskStateLabel(state: TaskState): string;
85
85
  export {};
86
- //# sourceMappingURL=task.d.ts.map
package/dist/a2a/task.js CHANGED
@@ -13,4 +13,3 @@ export function taskStateLabel(state) {
13
13
  .toLowerCase()
14
14
  .replace(/_/g, "-");
15
15
  }
16
- //# sourceMappingURL=task.js.map
@@ -74,4 +74,3 @@ export declare function verifyGatewayToken(token: string, opts: VerifyOptions):
74
74
  identity: GatewayIdentity;
75
75
  tenant: string;
76
76
  }>;
77
- //# sourceMappingURL=verify.d.ts.map
@@ -137,4 +137,3 @@ export async function verifyGatewayToken(token, opts) {
137
137
  throw new GatewayAuthError(err.message);
138
138
  }
139
139
  }
140
- //# sourceMappingURL=verify.js.map
@@ -44,4 +44,3 @@ export declare const newTurnBudget: (allowance: number) => TurnBudget;
44
44
  * attempt as the only one that can ever begin overdrawn.
45
45
  */
46
46
  export declare const stepAllowance: (maxTurns: number, spent: number) => number;
47
- //# sourceMappingURL=budget.d.ts.map
@@ -40,4 +40,3 @@ export const newTurnBudget = (allowance) => ({
40
40
  * attempt as the only one that can ever begin overdrawn.
41
41
  */
42
42
  export const stepAllowance = (maxTurns, spent) => Math.max(1, maxTurns - spent);
43
- //# sourceMappingURL=budget.js.map
@@ -107,4 +107,3 @@ export declare function controlTools(opts: {
107
107
  }): ControlTool[];
108
108
  /** The tools as the SDK takes them, in declaration order. */
109
109
  export declare function controlToolSet(tools: ControlTool[]): ToolSet;
110
- //# sourceMappingURL=control.d.ts.map
@@ -112,4 +112,3 @@ function issues(error) {
112
112
  export function controlToolSet(tools) {
113
113
  return Object.fromEntries(tools.map((c) => [c.name, c.tool]));
114
114
  }
115
- //# sourceMappingURL=control.js.map
@@ -46,4 +46,3 @@ export declare const finalReplyInputSchema: z.ZodObject<{
46
46
  export declare const finalReplyTool: import("ai").Tool<{
47
47
  text: string;
48
48
  }, never, import("@ai-sdk/provider-utils").Context>;
49
- //# sourceMappingURL=final-reply.d.ts.map
@@ -49,4 +49,3 @@ export const finalReplyTool = tool({
49
49
  description: "Answer the user and end this round. Use this whenever the request is yours to answer — anything about this conversation, your own history, memory, or tools, and anything you can settle with the tools available to you here, including work that has already come back to you.",
50
50
  inputSchema: finalReplyInputSchema
51
51
  });
52
- //# sourceMappingURL=final-reply.js.map
@@ -95,4 +95,3 @@ export declare function sessionMessage(role: "user" | "assistant", text: string)
95
95
  export declare function sessionText(m: SessionMessage): string;
96
96
  /** Convert stored history to AI-SDK model messages (user/assistant text only). */
97
97
  export declare function toModelMessages(history: SessionMessage[]): ModelMessage[];
98
- //# sourceMappingURL=history.d.ts.map
@@ -131,4 +131,3 @@ export function toModelMessages(history) {
131
131
  content: sessionText(m)
132
132
  }));
133
133
  }
134
- //# sourceMappingURL=history.js.map
@@ -25,4 +25,3 @@ export { deterministicSessionMessage, finalReplyMessageId, parseRoundAckMessageI
25
25
  export { buildIntermediateContentHandler, isTransientAiError, type OnContent } from "./inference.js";
26
26
  export { ControlCallError, controlTools, controlToolSet, type ControlTool, type TurnDecision } from "./control.js";
27
27
  export { FINAL_REPLY_TOOL_NAME, finalReplyInputSchema, finalReplyTool } from "./final-reply.js";
28
- //# sourceMappingURL=index.d.ts.map
@@ -25,4 +25,3 @@ export { deterministicSessionMessage, finalReplyMessageId, parseRoundAckMessageI
25
25
  export { buildIntermediateContentHandler, isTransientAiError } from "./inference.js";
26
26
  export { ControlCallError, controlTools, controlToolSet } from "./control.js";
27
27
  export { FINAL_REPLY_TOOL_NAME, finalReplyInputSchema, finalReplyTool } from "./final-reply.js";
28
- //# sourceMappingURL=index.js.map
@@ -49,4 +49,3 @@ export declare function isTransientAiError(err: unknown): boolean;
49
49
  * steps are skipped. Default `[]` (the subagent loop has no control tools).
50
50
  */
51
51
  export declare function buildIntermediateContentHandler(onContent: OnContent, terminalToolNames?: string[]): (step: StepResult<ToolSet>) => Promise<void>;
52
- //# sourceMappingURL=inference.d.ts.map
@@ -76,4 +76,3 @@ export function buildIntermediateContentHandler(onContent, terminalToolNames = [
76
76
  await onContent(content, i);
77
77
  };
78
78
  }
79
- //# sourceMappingURL=inference.js.map
@@ -65,4 +65,3 @@ export interface ModelRuntimeDeps {
65
65
  * protects a consumer who builds their runtime early.
66
66
  */
67
67
  export declare function createModelRuntime(deps: ModelRuntimeDeps): ModelRuntime;
68
- //# sourceMappingURL=model.d.ts.map
@@ -46,4 +46,3 @@ export function createModelRuntime(deps) {
46
46
  }
47
47
  };
48
48
  }
49
- //# sourceMappingURL=model.js.map
@@ -99,4 +99,3 @@ export declare function notifyingCompaction(base: CompactFn, onMessagesDisplaced
99
99
  */
100
100
  export declare function buildAgentSession(agent: SessionHost, model: LanguageModel, opts: AgentSessionOptions): Session;
101
101
  export {};
102
- //# sourceMappingURL=session.d.ts.map
@@ -80,4 +80,3 @@ export function buildAgentSession(agent, model, opts) {
80
80
  .onCompaction(compact)
81
81
  .compactAfter(opts.compactAfterTokens);
82
82
  }
83
- //# sourceMappingURL=session.js.map
package/dist/config.d.ts CHANGED
@@ -181,4 +181,3 @@ export declare class ConfigError extends Error {
181
181
  * reads the same object.
182
182
  */
183
183
  export declare function resolveConfig(overrides: CoreConfigOverrides): CoreConfig;
184
- //# sourceMappingURL=config.d.ts.map
package/dist/config.js CHANGED
@@ -108,4 +108,3 @@ export function resolveConfig(overrides) {
108
108
  }
109
109
  return config;
110
110
  }
111
- //# sourceMappingURL=config.js.map
@@ -7,4 +7,3 @@
7
7
  export { PLUGIN_CONTRACT_VERSION, definePlugin, type AgentPlugin, type EmitProgress, type EnrichResultContext, type MainAgentToolContext, type PluginRequirements, type RecipeToolSet, type ResolveRuntimeContext, type ToolFamilyBuilder, type ToolFamilyContext, type TurnGateContext } from "./plugin.js";
8
8
  export type { DelegationNames, RecipeLimits, ResolvedRecipe, SubtaskParams, SubtaskParamsSchema, SubtaskParamsShape, SubtaskTypeSpec, ValidatedRecipe } from "./recipe.js";
9
9
  export { RecipeValidationError, resolveLimits, validateRecipe, type RecipePolicy } from "./validation.js";
10
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@
6
6
  */
7
7
  export { PLUGIN_CONTRACT_VERSION, definePlugin } from "./plugin.js";
8
8
  export { RecipeValidationError, resolveLimits, validateRecipe } from "./validation.js";
9
- //# sourceMappingURL=index.js.map
@@ -262,4 +262,3 @@ export interface AgentPlugin<TRuntime = SubtaskRuntime> {
262
262
  export declare function definePlugin<TRuntime = SubtaskRuntime>(plugin: Omit<AgentPlugin<TRuntime>, "contractVersion"> & {
263
263
  contractVersion?: number;
264
264
  }): AgentPlugin<TRuntime>;
265
- //# sourceMappingURL=plugin.d.ts.map
@@ -36,4 +36,3 @@ export function definePlugin(plugin) {
36
36
  contractVersion: plugin.contractVersion ?? PLUGIN_CONTRACT_VERSION
37
37
  };
38
38
  }
39
- //# sourceMappingURL=plugin.js.map
@@ -76,8 +76,6 @@ export type RecipeLimits = AgentLimits;
76
76
  export interface ResolvedRecipe {
77
77
  key: string;
78
78
  version: number;
79
- primaryModelId: string;
80
- fallbackModelId: string;
81
79
  /** Required, never defaulted — see `validateRecipe`. */
82
80
  soul: string;
83
81
  toolFamilies: string[];
@@ -104,6 +102,20 @@ export interface ResolvedRecipe {
104
102
  */
105
103
  export interface ValidatedRecipe extends ResolvedRecipe {
106
104
  limits: RecipeLimits;
105
+ /**
106
+ * The pair this recipe will actually run on — **the host's, always**.
107
+ *
108
+ * These exist only here, never on {@link ResolvedRecipe}, and that asymmetry
109
+ * is the design: a recipe cannot state a model, so the only way to hold one is
110
+ * to have been through {@link validateRecipe}, which copies the host's. Recipe
111
+ * data has no path to influence them.
112
+ *
113
+ * Guaranteed non-empty and guaranteed distinct, because `resolveConfig`
114
+ * refuses a config that is either — so the fallback is always a genuinely
115
+ * different model from the primary, which is the entire point of having one.
116
+ */
117
+ primaryModelId: string;
118
+ fallbackModelId: string;
107
119
  }
108
120
  /**
109
121
  * One entry in the closed set of Subtask types the main agent may delegate,
@@ -167,4 +179,3 @@ export interface SubtaskTypeSpec {
167
179
  /** The execution configuration this type runs under. */
168
180
  recipe: ResolvedRecipe;
169
181
  }
170
- //# sourceMappingURL=recipe.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=recipe.js.map
@@ -4,12 +4,12 @@ import type { ResolvedRecipe, ValidatedRecipe } from "./recipe.js";
4
4
  * The capability boundary every recipe passes through, whatever declared it.
5
5
  *
6
6
  * This module imports no domain. It owns only what code must be able to say
7
- * about *any* recipe: which models and tool families it may select, and how a
8
- * malformed one is made safe or refused. A domain cannot widen its
9
- * *capabilities* by declaring them, because the allowlists do not come from the
10
- * declaration — they come from {@link RecipePolicy}, which the host builds from
11
- * its resolved config and its installed plugins. Its budget is the deliberate
12
- * exception; see {@link resolveLimits}.
7
+ * about *any* recipe: which tool families it may select, which models it runs
8
+ * on, and how a malformed one is made safe or refused. A domain cannot widen
9
+ * its *capabilities* by declaring them the legal tool families come from
10
+ * {@link RecipePolicy}, which the host builds from its installed plugins, and
11
+ * the model pair comes from the host's config with no declaration involved at
12
+ * all. Its budget is the deliberate exception; see {@link resolveLimits}.
13
13
  *
14
14
  * In the predecessor repo the two allowlists were module constants, and one of
15
15
  * them hardcoded a domain key (`"arc-game"`) inside otherwise generic code. That
@@ -18,15 +18,19 @@ import type { ResolvedRecipe, ValidatedRecipe } from "./recipe.js";
18
18
  */
19
19
  export interface RecipePolicy {
20
20
  /**
21
- * Model ids a recipe may select normally the two configured chat models, the
22
- * only ones proven with this tool-loop pipeline. Extend deliberately, one
23
- * validated model at a time.
21
+ * The pair every recipe runs on: the host agent's own, copied verbatim onto
22
+ * each {@link ValidatedRecipe}.
23
+ *
24
+ * There is no allowlist any more, because there is nothing to check against
25
+ * it — a recipe cannot state a model. `modelAllowlist` existed to police
26
+ * recipe-stated preferences, and it could only ever contain these same two
27
+ * ids, so the "preference" it policed could never reach a third model. It
28
+ * could only swap the primary for the fallback, which is not a capability
29
+ * anyone wants and which broke the pair's distinctness.
24
30
  */
25
- modelAllowlist: ReadonlySet<string>;
26
- /** Substituted when a recipe names a primary model outside the allowlist. */
27
- defaultPrimaryModelId: string;
28
- /** Substituted when a recipe names a fallback model outside the allowlist. */
29
- defaultFallbackModelId: string;
31
+ primaryModelId: string;
32
+ /** See {@link primaryModelId}. Guaranteed distinct from it by `resolveConfig`. */
33
+ fallbackModelId: string;
30
34
  /**
31
35
  * Tool-family keys the runtime recognizes — derived from the installed
32
36
  * plugins, never hardcoded.
@@ -69,12 +73,12 @@ export declare class RecipeValidationError extends Error {
69
73
  }
70
74
  /**
71
75
  * Code-owned defensive validation of an already-resolved recipe. Returns a
72
- * normalized copy (never mutates the input): a model id outside the policy's
73
- * allowlist is substituted with the default for its slot — independently per
74
- * slot — and unknown tool families are dropped (deduped, order-preserving).
76
+ * normalized copy (never mutates the input): the host's model pair is stamped
77
+ * on, and unknown tool families are dropped (deduped, order-preserving).
75
78
  * Applied by the parent when it resolves a recipe and re-applied by the subagent
76
79
  * on its inbound request, so recipe data can never select arbitrary models or
77
- * tools.
80
+ * tools — models because there is no field to select one with, tools because
81
+ * the legal set comes from the installed plugins rather than the declaration.
78
82
  *
79
83
  * The split between what is normalized and what is refused follows one rule:
80
84
  * **the host declares a baseline ⇒ merge; it does not ⇒ require.** `limits`
@@ -85,4 +89,3 @@ export declare class RecipeValidationError extends Error {
85
89
  * house default can guess. Both fail the recipe outright.
86
90
  */
87
91
  export declare function validateRecipe(recipe: ResolvedRecipe, policy: RecipePolicy): ValidatedRecipe;
88
- //# sourceMappingURL=validation.d.ts.map
@@ -34,12 +34,12 @@ export class RecipeValidationError extends Error {
34
34
  }
35
35
  /**
36
36
  * Code-owned defensive validation of an already-resolved recipe. Returns a
37
- * normalized copy (never mutates the input): a model id outside the policy's
38
- * allowlist is substituted with the default for its slot — independently per
39
- * slot — and unknown tool families are dropped (deduped, order-preserving).
37
+ * normalized copy (never mutates the input): the host's model pair is stamped
38
+ * on, and unknown tool families are dropped (deduped, order-preserving).
40
39
  * Applied by the parent when it resolves a recipe and re-applied by the subagent
41
40
  * on its inbound request, so recipe data can never select arbitrary models or
42
- * tools.
41
+ * tools — models because there is no field to select one with, tools because
42
+ * the legal set comes from the installed plugins rather than the declaration.
43
43
  *
44
44
  * The split between what is normalized and what is refused follows one rule:
45
45
  * **the host declares a baseline ⇒ merge; it does not ⇒ require.** `limits`
@@ -63,14 +63,22 @@ export function validateRecipe(recipe, policy) {
63
63
  const toolFamilies = [...new Set(recipe.toolFamilies)].filter((family) => policy.knownToolFamilies.has(family));
64
64
  return {
65
65
  ...recipe,
66
- primaryModelId: policy.modelAllowlist.has(recipe.primaryModelId)
67
- ? recipe.primaryModelId
68
- : policy.defaultPrimaryModelId,
69
- fallbackModelId: policy.modelAllowlist.has(recipe.fallbackModelId)
70
- ? recipe.fallbackModelId
71
- : policy.defaultFallbackModelId,
66
+ // The host's pair, copied. Not selected, not substituted, not merged —
67
+ // there is nothing on a `ResolvedRecipe` to select *from*.
68
+ //
69
+ // This used to substitute a recipe's stated preference against
70
+ // an allowlist, per slot and independently. That produced a real defect:
71
+ // a recipe preferring the host's *fallback* as its primary, and stating no
72
+ // fallback of its own, resolved to the same id in both slots — so the
73
+ // fallback retried the model that had just failed, defeating the distinct-
74
+ // pair invariant `resolveConfig` enforces one layer up.
75
+ //
76
+ // Copying wholesale makes that unrepresentable: the pair here is exactly the
77
+ // pair the agent configured, which `resolveConfig` has already guaranteed is
78
+ // non-empty and distinct.
79
+ primaryModelId: policy.primaryModelId,
80
+ fallbackModelId: policy.fallbackModelId,
72
81
  toolFamilies,
73
82
  limits: resolveLimits(recipe.limits, policy.baselineLimits)
74
83
  };
75
84
  }
76
- //# sourceMappingURL=validation.js.map
package/dist/db/db.d.ts CHANGED
@@ -146,4 +146,3 @@ export declare class AgentDB {
146
146
  */
147
147
  private applyStores;
148
148
  }
149
- //# sourceMappingURL=db.d.ts.map
package/dist/db/db.js CHANGED
@@ -88,4 +88,3 @@ export class AgentDB {
88
88
  }
89
89
  }
90
90
  }
91
- //# sourceMappingURL=db.js.map
@@ -6,4 +6,3 @@ export { AgentDB, PLUGIN_MIGRATIONS_TABLE, type AgentDBOptions, type DB, type Pl
6
6
  export { notifyTasks, subtasks } from "./schema.js";
7
7
  export { makeTasks, stateOf, type TaskListQuery } from "./models/tasks.js";
8
8
  export { makeSubtasks, type SubtaskModelOptions } from "./models/subtasks.js";
9
- //# sourceMappingURL=index.d.ts.map
package/dist/db/index.js CHANGED
@@ -6,4 +6,3 @@ export { AgentDB, PLUGIN_MIGRATIONS_TABLE } from "./db.js";
6
6
  export { notifyTasks, subtasks } from "./schema.js";
7
7
  export { makeTasks, stateOf } from "./models/tasks.js";
8
8
  export { makeSubtasks } from "./models/subtasks.js";
9
- //# sourceMappingURL=index.js.map
@@ -18,4 +18,3 @@ import type { migrate } from "drizzle-orm/durable-sqlite/migrator";
18
18
  type MigrationConfig = Parameters<typeof migrate>[1];
19
19
  declare const dbMigrations: MigrationConfig;
20
20
  export default dbMigrations;
21
- //# sourceMappingURL=index.d.ts.map
@@ -51,4 +51,3 @@ CREATE INDEX \`idx_subtasks_created_at\` ON \`subtasks\` (\`created_at\`);`
51
51
  }
52
52
  };
53
53
  export default dbMigrations;
54
- //# sourceMappingURL=index.js.map
@@ -99,4 +99,3 @@ export declare function makeSubtasks(db: DB, opts: SubtaskModelOptions): {
99
99
  /** Delete Subtasks older than 30 days (called by the weekly maintenance cron). */
100
100
  cleanup(): void;
101
101
  };
102
- //# sourceMappingURL=subtasks.d.ts.map
@@ -282,4 +282,3 @@ export function makeSubtasks(db, opts) {
282
282
  }
283
283
  };
284
284
  }
285
- //# sourceMappingURL=subtasks.js.map
@@ -103,4 +103,3 @@ export declare function makeTasks(db: DB): {
103
103
  /** Delete all tasks older than 30 days (called by the maintenance cron). */
104
104
  cleanup(): void;
105
105
  };
106
- //# sourceMappingURL=tasks.d.ts.map
@@ -239,4 +239,3 @@ function project(task, query) {
239
239
  : history.slice(Math.max(0, history.length - query.historyLength))
240
240
  };
241
241
  }
242
- //# sourceMappingURL=tasks.js.map
@@ -485,4 +485,3 @@ export declare const subtasks: import("drizzle-orm/sqlite-core").SQLiteTableWith
485
485
  };
486
486
  dialect: "sqlite";
487
487
  }>;
488
- //# sourceMappingURL=schema.d.ts.map
package/dist/db/schema.js CHANGED
@@ -88,4 +88,3 @@ export const subtasks = sqliteTable("subtasks", {
88
88
  index("idx_subtasks_status").on(table.status),
89
89
  index("idx_subtasks_created_at").on(table.createdAt)
90
90
  ]);
91
- //# sourceMappingURL=schema.js.map
package/dist/env.d.ts CHANGED
@@ -51,4 +51,3 @@ export type CoreEnv = AiEnv & A2ASecretsEnv;
51
51
  * rather than as an empty allowlist that rejects every caller identically.
52
52
  */
53
53
  export declare function parseGatewayOrigins(raw: string): string[];
54
- //# sourceMappingURL=env.d.ts.map
package/dist/env.js CHANGED
@@ -45,4 +45,3 @@ export function parseGatewayOrigins(raw) {
45
45
  throw new Error("GATEWAY_ORIGINS is empty");
46
46
  return parsed;
47
47
  }
48
- //# sourceMappingURL=env.js.map
@@ -108,9 +108,9 @@ export declare abstract class LoopingAgent<TEnv extends Cloudflare.Env & AiEnv &
108
108
  * runtime exists.
109
109
  *
110
110
  * Deliberately not `this.config` — that would be a cycle. `resolveConfig` is
111
- * cheap and pure and fills in core's defaults, so this is the same result the
112
- * runtime lands on; that matters because a recipe's models are checked against
113
- * `policy.modelAllowlist`, which is built from these very values.
111
+ * cheap and pure and fills in core's baseline, so this is the same result the
112
+ * runtime lands on; that matters because every recipe runs on exactly this
113
+ * pair — `RecipePolicy` carries it and `validateRecipe` stamps it on.
114
114
  */
115
115
  private resolvedModelIds;
116
116
  onStart(): Promise<void>;
@@ -214,4 +214,3 @@ export declare abstract class LoopingAgent<TEnv extends Cloudflare.Env & AiEnv &
214
214
  */
215
215
  protected onTaskCanceled(_taskId: string): Promise<void>;
216
216
  }
217
- //# sourceMappingURL=agent.d.ts.map
@@ -120,8 +120,6 @@ export class LoopingAgent extends Agent {
120
120
  storage: this.ctx.storage,
121
121
  // A thunk, not a value — see `identityKey`.
122
122
  callerKey: () => this.requireIdentityKey(),
123
- primaryModelId: model.chatModelId,
124
- fallbackModelId: model.fallbackChatModelId,
125
123
  aiGatewayId: model.aiGatewayId
126
124
  };
127
125
  }
@@ -130,9 +128,9 @@ export class LoopingAgent extends Agent {
130
128
  * runtime exists.
131
129
  *
132
130
  * Deliberately not `this.config` — that would be a cycle. `resolveConfig` is
133
- * cheap and pure and fills in core's defaults, so this is the same result the
134
- * runtime lands on; that matters because a recipe's models are checked against
135
- * `policy.modelAllowlist`, which is built from these very values.
131
+ * cheap and pure and fills in core's baseline, so this is the same result the
132
+ * runtime lands on; that matters because every recipe runs on exactly this
133
+ * pair — `RecipePolicy` carries it and `validateRecipe` stamps it on.
136
134
  */
137
135
  resolvedModelIds() {
138
136
  return resolveConfig(this.agentConfig()).model;
@@ -303,4 +301,3 @@ export class LoopingAgent extends Agent {
303
301
  */
304
302
  async onTaskCanceled(_taskId) { }
305
303
  }
306
- //# sourceMappingURL=agent.js.map
@@ -18,4 +18,3 @@
18
18
  */
19
19
  export { LoopingAgent } from "./agent.js";
20
20
  export type { PluginHost } from "./plugin-host.js";
21
- //# sourceMappingURL=index.d.ts.map
@@ -17,4 +17,3 @@
17
17
  * round loop, which is opt-in and takes its prompt copy from the agent.
18
18
  */
19
19
  export { LoopingAgent } from "./agent.js";
20
- //# sourceMappingURL=index.js.map