agency-lang 0.13.2 → 0.13.4

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 (260) hide show
  1. package/dist/lib/agents/agency-agent/agent.js +10 -10
  2. package/dist/lib/agents/agency-agent/images/images.js +3 -3
  3. package/dist/lib/agents/agency-agent/lib/args.agency +12 -0
  4. package/dist/lib/agents/agency-agent/lib/args.js +15 -3
  5. package/dist/lib/agents/agency-agent/lib/attachments.js +3 -3
  6. package/dist/lib/agents/agency-agent/lib/budget.js +3 -3
  7. package/dist/lib/agents/agency-agent/lib/capabilities.js +3 -3
  8. package/dist/lib/agents/agency-agent/lib/capabilitiesUi.js +3 -3
  9. package/dist/lib/agents/agency-agent/lib/commandPalette.js +3 -3
  10. package/dist/lib/agents/agency-agent/lib/config.js +3 -3
  11. package/dist/lib/agents/agency-agent/lib/coordinator.js +3 -3
  12. package/dist/lib/agents/agency-agent/lib/header.js +3 -3
  13. package/dist/lib/agents/agency-agent/lib/images.js +3 -3
  14. package/dist/lib/agents/agency-agent/lib/mcp.js +3 -3
  15. package/dist/lib/agents/agency-agent/lib/modelFilters.js +3 -3
  16. package/dist/lib/agents/agency-agent/lib/models.js +3 -3
  17. package/dist/lib/agents/agency-agent/lib/policy.js +3 -3
  18. package/dist/lib/agents/agency-agent/lib/repl.js +3 -3
  19. package/dist/lib/agents/agency-agent/lib/resolution.js +3 -3
  20. package/dist/lib/agents/agency-agent/lib/search.js +3 -3
  21. package/dist/lib/agents/agency-agent/lib/session.js +3 -3
  22. package/dist/lib/agents/agency-agent/lib/settings.js +3 -3
  23. package/dist/lib/agents/agency-agent/lib/slots.js +3 -3
  24. package/dist/lib/agents/agency-agent/lib/trace.js +3 -3
  25. package/dist/lib/agents/agency-agent/lib/utils/renderLLMCallResponse.js +3 -3
  26. package/dist/lib/agents/agency-agent/lib/utils.js +3 -3
  27. package/dist/lib/agents/agency-agent/prompts/codeSample.js +38 -22
  28. package/dist/lib/agents/agency-agent/shared.js +3 -3
  29. package/dist/lib/agents/agency-agent/subagents/brainstorm.js +3 -3
  30. package/dist/lib/agents/agency-agent/subagents/code.js +3 -3
  31. package/dist/lib/agents/agency-agent/subagents/explorer.js +3 -3
  32. package/dist/lib/agents/agency-agent/subagents/oracle.js +3 -3
  33. package/dist/lib/agents/agency-agent/subagents/research.js +3 -3
  34. package/dist/lib/agents/agency-agent/subagents/review.js +3 -3
  35. package/dist/lib/agents/agency-agent/subagents/supervisor.js +3 -3
  36. package/dist/lib/agents/agency-agent/tests/agentDir.js +10 -6
  37. package/dist/lib/agents/agency-agent/tests/agentTurn.js +206 -90
  38. package/dist/lib/agents/agency-agent/tests/attachments.js +178 -78
  39. package/dist/lib/agents/agency-agent/tests/attachmentsTurn.js +31 -15
  40. package/dist/lib/agents/agency-agent/tests/brainstorm.js +38 -18
  41. package/dist/lib/agents/agency-agent/tests/capabilities.js +115 -51
  42. package/dist/lib/agents/agency-agent/tests/execPolicy.js +38 -18
  43. package/dist/lib/agents/agency-agent/tests/gitPolicy.js +24 -12
  44. package/dist/lib/agents/agency-agent/tests/imageTool.js +52 -24
  45. package/dist/lib/agents/agency-agent/tests/mcpGating.js +24 -12
  46. package/dist/lib/agents/agency-agent/tests/memoryWiring.js +52 -24
  47. package/dist/lib/agents/agency-agent/tests/modelFilters.js +38 -18
  48. package/dist/lib/agents/agency-agent/tests/models.js +136 -60
  49. package/dist/lib/agents/agency-agent/tests/oneShotRounds.js +31 -15
  50. package/dist/lib/agents/agency-agent/tests/resolution.js +80 -36
  51. package/dist/lib/agents/agency-agent/tests/search.js +101 -45
  52. package/dist/lib/agents/agency-agent/tests/settings.js +87 -39
  53. package/dist/lib/agents/agency-agent/tests/slots.js +38 -18
  54. package/dist/lib/agents/agency-agent/tests/supervisor.js +108 -48
  55. package/dist/lib/agents/agency-agent/tests/toolWiring.js +45 -21
  56. package/dist/lib/agents/agency-agent/tests/turnFailure.js +45 -21
  57. package/dist/lib/agents/eval/goalJudge.js +11 -11
  58. package/dist/lib/agents/eval/judge.js +10 -6
  59. package/dist/lib/agents/eval/judgePairwise.js +10 -6
  60. package/dist/lib/agents/optimize/gepaReflect.js +10 -6
  61. package/dist/lib/agents/optimize/mutatePrompt.js +10 -6
  62. package/dist/lib/agents/policy/agent.js +10 -10
  63. package/dist/lib/agents/review/agent.js +17 -13
  64. package/dist/lib/backends/agencyGenerator.d.ts +2 -0
  65. package/dist/lib/backends/agencyGenerator.js +7 -1
  66. package/dist/lib/backends/typescriptBuilder/nodeWrapperParams.js +5 -2
  67. package/dist/lib/backends/typescriptBuilder.js +21 -13
  68. package/dist/lib/cli/agent.d.ts +2 -4
  69. package/dist/lib/cli/agent.js +4 -2
  70. package/dist/lib/cli/commandLine.d.ts +19 -0
  71. package/dist/lib/cli/commandLine.js +19 -0
  72. package/dist/lib/cli/commands.d.ts +3 -2
  73. package/dist/lib/cli/commands.js +3 -2
  74. package/dist/lib/cli/doc.d.ts +24 -0
  75. package/dist/lib/cli/doc.js +262 -53
  76. package/dist/lib/cli/docLedger.d.ts +149 -0
  77. package/dist/lib/cli/docLedger.js +378 -0
  78. package/dist/lib/cli/eval/labelCommand.d.ts +1 -1
  79. package/dist/lib/cli/eval/labelCommand.js +1 -1
  80. package/dist/lib/cli/help.js +2 -2
  81. package/dist/lib/cli/modelFlag.d.ts +16 -0
  82. package/dist/lib/cli/modelFlag.js +61 -0
  83. package/dist/lib/cli/remote/commands/spend.d.ts +8 -0
  84. package/dist/lib/cli/remote/commands/spend.js +51 -0
  85. package/dist/lib/cli/remote/commands/spendWindow.d.ts +10 -0
  86. package/dist/lib/cli/remote/commands/spendWindow.js +80 -0
  87. package/dist/lib/cli/remote/render.d.ts +7 -0
  88. package/dist/lib/cli/remote/render.js +229 -0
  89. package/dist/lib/cli/runBundledAgent.d.ts +40 -27
  90. package/dist/lib/cli/runBundledAgent.js +153 -95
  91. package/dist/lib/cli/stageConfiguredAgent.d.ts +32 -0
  92. package/dist/lib/cli/stageConfiguredAgent.js +102 -0
  93. package/dist/lib/cli/statelog/accountClient.d.ts +2 -0
  94. package/dist/lib/cli/statelog/accountClient.js +35 -11
  95. package/dist/lib/cli/statelog/projectClient.d.ts +2 -0
  96. package/dist/lib/cli/statelog/projectClient.js +31 -8
  97. package/dist/lib/cli/statelog/spendTypes.d.ts +206 -0
  98. package/dist/lib/cli/statelog/spendTypes.js +109 -0
  99. package/dist/lib/compiler/buildManifest.d.ts +23 -1
  100. package/dist/lib/compiler/buildManifest.js +46 -9
  101. package/dist/lib/compiler/buildSession.d.ts +2 -1
  102. package/dist/lib/compiler/buildSession.js +20 -11
  103. package/dist/lib/compiler/compileClosure.d.ts +3 -1
  104. package/dist/lib/compiler/compileClosure.js +11 -2
  105. package/dist/lib/compiler/depFingerprint.d.ts +30 -0
  106. package/dist/lib/compiler/depFingerprint.js +83 -0
  107. package/dist/lib/compiler/manifestTracker.d.ts +6 -3
  108. package/dist/lib/compiler/manifestTracker.js +11 -5
  109. package/dist/lib/config.d.ts +15 -0
  110. package/dist/lib/config.js +18 -0
  111. package/dist/lib/eval/grading/graders/builtinGraders.js +1 -14
  112. package/dist/lib/levenshtein.d.ts +2 -0
  113. package/dist/lib/levenshtein.js +14 -0
  114. package/dist/lib/runtime/cost.d.ts +5 -5
  115. package/dist/lib/runtime/cost.js +12 -9
  116. package/dist/lib/runtime/costTelemetry.d.ts +23 -29
  117. package/dist/lib/runtime/costTelemetry.js +53 -19
  118. package/dist/lib/runtime/deterministicClient.js +6 -1
  119. package/dist/lib/runtime/index.d.ts +1 -0
  120. package/dist/lib/runtime/interrupts.d.ts +2 -0
  121. package/dist/lib/runtime/interrupts.js +9 -1
  122. package/dist/lib/runtime/invocationOptions.d.ts +75 -0
  123. package/dist/lib/runtime/invocationOptions.js +92 -0
  124. package/dist/lib/runtime/invocationUsage.d.ts +88 -43
  125. package/dist/lib/runtime/invocationUsage.js +332 -80
  126. package/dist/lib/runtime/ipc.d.ts +13 -7
  127. package/dist/lib/runtime/ipc.js +24 -18
  128. package/dist/lib/runtime/memory/manager.js +83 -41
  129. package/dist/lib/runtime/modelIdentity.d.ts +1 -0
  130. package/dist/lib/runtime/modelIdentity.js +10 -0
  131. package/dist/lib/runtime/node.d.ts +3 -0
  132. package/dist/lib/runtime/node.js +22 -10
  133. package/dist/lib/runtime/prompt.js +5 -4
  134. package/dist/lib/runtime/recordPaidUsage.d.ts +28 -37
  135. package/dist/lib/runtime/recordPaidUsage.js +68 -49
  136. package/dist/lib/runtime/rewind.js +1 -1
  137. package/dist/lib/runtime/servedInvocationLifecycle.js +5 -1
  138. package/dist/lib/runtime/state/context.d.ts +11 -1
  139. package/dist/lib/runtime/state/context.js +38 -8
  140. package/dist/lib/serve/createServeHandler.d.ts +2 -1
  141. package/dist/lib/serve/createServeHandler.js +7 -1
  142. package/dist/lib/serve/discovery.js +2 -2
  143. package/dist/lib/serve/http/adapter.d.ts +7 -2
  144. package/dist/lib/serve/http/adapter.js +18 -12
  145. package/dist/lib/serve/public.d.ts +1 -0
  146. package/dist/lib/serve/testOutcome.d.ts +4 -4
  147. package/dist/lib/serve/testOutcome.js +11 -5
  148. package/dist/lib/serve/types.d.ts +3 -2
  149. package/dist/lib/stdlib/image.js +37 -20
  150. package/dist/lib/templates/backends/typescriptGenerator/imports.d.ts +1 -1
  151. package/dist/lib/templates/backends/typescriptGenerator/imports.js +5 -4
  152. package/dist/lib/vendor/commander/LICENSE +22 -0
  153. package/dist/lib/vendor/commander/MODIFICATIONS.md +41 -0
  154. package/dist/lib/vendor/commander/argument.js +147 -0
  155. package/dist/lib/vendor/commander/command.js +3434 -0
  156. package/dist/lib/vendor/commander/error.js +36 -0
  157. package/dist/lib/vendor/commander/help.js +731 -0
  158. package/dist/lib/vendor/commander/index.d.ts +1139 -0
  159. package/dist/lib/vendor/commander/index.js +21 -0
  160. package/dist/lib/vendor/commander/option.js +377 -0
  161. package/dist/lib/vendor/commander/suggestSimilar.js +99 -0
  162. package/dist/scripts/agency.d.ts +3 -2
  163. package/dist/scripts/agency.js +99 -115
  164. package/dist/scripts/generateDiagnosticsDocs.js +2 -2
  165. package/package.json +4 -2
  166. package/stdlib/agency/eval.js +3 -3
  167. package/stdlib/agency/local.js +3 -3
  168. package/stdlib/agency.js +3 -3
  169. package/stdlib/agent.js +3 -3
  170. package/stdlib/agents/agency/coding.js +3 -3
  171. package/stdlib/agents/agency/expert.js +3 -3
  172. package/stdlib/agents/agency/researcher.js +3 -3
  173. package/stdlib/agents/agency/review.js +3 -3
  174. package/stdlib/agents/agency/verifier.js +3 -3
  175. package/stdlib/agents/coding.js +3 -3
  176. package/stdlib/agents/composable/promptRewriter.js +3 -3
  177. package/stdlib/agents/composable/researcher.js +3 -3
  178. package/stdlib/agents/composable/utils.js +3 -3
  179. package/stdlib/agents/data.js +3 -3
  180. package/stdlib/agents/expert.js +3 -3
  181. package/stdlib/agents/explorer.js +3 -3
  182. package/stdlib/agents/lib/expertGuidance.js +3 -3
  183. package/stdlib/agents/lib/feedback.js +3 -3
  184. package/stdlib/agents/lib/search.js +3 -3
  185. package/stdlib/agents/lib/shared.js +3 -3
  186. package/stdlib/agents/lib/toolkits.js +3 -3
  187. package/stdlib/agents/oracle.js +3 -3
  188. package/stdlib/agents/planner.js +3 -3
  189. package/stdlib/agents/researcher.js +3 -3
  190. package/stdlib/agents/review.js +3 -3
  191. package/stdlib/agents/verifier.js +3 -3
  192. package/stdlib/args.agency +25 -0
  193. package/stdlib/args.js +4 -4
  194. package/stdlib/array.js +3 -3
  195. package/stdlib/auth/keyring.js +3 -3
  196. package/stdlib/auth/oauth.js +3 -3
  197. package/stdlib/calendar.js +3 -3
  198. package/stdlib/capabilities.js +3 -3
  199. package/stdlib/clipboard.js +3 -3
  200. package/stdlib/concurrency.js +3 -3
  201. package/stdlib/data/finance/dbnomics.js +3 -3
  202. package/stdlib/data/finance/edgar.js +3 -3
  203. package/stdlib/data/finance/fred.js +3 -3
  204. package/stdlib/data/finance/gdelt.js +3 -3
  205. package/stdlib/data/people/littlesis.js +3 -3
  206. package/stdlib/data/tech/hackernews.js +3 -3
  207. package/stdlib/data/tech/yc.js +3 -3
  208. package/stdlib/data/usaspending.js +3 -3
  209. package/stdlib/data/wikidata.js +3 -3
  210. package/stdlib/date.js +3 -3
  211. package/stdlib/docs/cli/run.md +126 -19
  212. package/stdlib/docs/cli/trace-and-bundle.md +1 -1
  213. package/stdlib/docs/guide/guards.md +1 -1
  214. package/stdlib/docs/guide/policies.md +3 -3
  215. package/stdlib/docs/stdlib/args.md +30 -5
  216. package/stdlib/fs.js +3 -3
  217. package/stdlib/git.js +3 -3
  218. package/stdlib/http.js +3 -3
  219. package/stdlib/image.js +3 -3
  220. package/stdlib/index.js +3 -3
  221. package/stdlib/llm.js +3 -3
  222. package/stdlib/markdown.js +3 -3
  223. package/stdlib/math.js +3 -3
  224. package/stdlib/mcp.js +3 -3
  225. package/stdlib/memory.js +3 -3
  226. package/stdlib/messaging/email.js +3 -3
  227. package/stdlib/messaging/imessage.js +3 -3
  228. package/stdlib/messaging/sms.js +3 -3
  229. package/stdlib/notes/apple.js +3 -3
  230. package/stdlib/object.js +3 -3
  231. package/stdlib/path.js +3 -3
  232. package/stdlib/policy.js +3 -3
  233. package/stdlib/safeBash/actions.js +3 -3
  234. package/stdlib/safeBash.js +3 -3
  235. package/stdlib/shell.js +3 -3
  236. package/stdlib/skills.js +3 -3
  237. package/stdlib/speech.js +3 -3
  238. package/stdlib/statelog.js +3 -3
  239. package/stdlib/strategy.js +3 -3
  240. package/stdlib/supervise.js +3 -3
  241. package/stdlib/syntax.js +3 -3
  242. package/stdlib/system.js +3 -3
  243. package/stdlib/tag.js +3 -3
  244. package/stdlib/thread.js +3 -3
  245. package/stdlib/ui/chart.js +3 -3
  246. package/stdlib/ui/cli.js +3 -3
  247. package/stdlib/ui/layout.js +3 -3
  248. package/stdlib/ui/table.js +3 -3
  249. package/stdlib/ui.js +3 -3
  250. package/stdlib/validation.js +3 -3
  251. package/stdlib/weather.js +3 -3
  252. package/stdlib/web/browser.js +3 -3
  253. package/stdlib/web/search.js +3 -3
  254. package/stdlib/wikipedia.js +3 -3
  255. package/dist/lib/backends/typescriptBuilder/directRunArgsCheck.d.ts +0 -11
  256. package/dist/lib/backends/typescriptBuilder/directRunArgsCheck.js +0 -19
  257. package/dist/lib/templates/backends/typescriptGenerator/directRunArgsCheck.d.ts +0 -7
  258. package/dist/lib/templates/backends/typescriptGenerator/directRunArgsCheck.js +0 -13
  259. package/dist/scripts/stdlib-stamp.d.ts +0 -1
  260. package/dist/scripts/stdlib-stamp.js +0 -31
@@ -157,9 +157,9 @@ function pass() {
157
157
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
158
158
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
159
159
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
160
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
161
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
162
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
160
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
161
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
162
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
163
163
  const __setDebugger = (dbg) => {
164
164
  __globalCtx.debuggerState = dbg;
165
165
  };
@@ -1582,22 +1582,22 @@ Session cost: ${__stack.locals.roundedCost}`]
1582
1582
  };
1583
1583
  }
1584
1584
  });
1585
- async function main({ messages, callbacks } = {}) {
1585
+ async function main({ messages: __invocationMessages, callbacks: __invocationCallbacks, config: __invocationConfig, traceId: __invocationTraceId } = {}) {
1586
1586
  return runNode({
1587
1587
  ctx: __globalCtx,
1588
1588
  nodeName: "main",
1589
1589
  data: {},
1590
- messages,
1591
- callbacks,
1590
+ messages: __invocationMessages,
1591
+ callbacks: __invocationCallbacks,
1592
+ invocation: {
1593
+ config: __invocationConfig,
1594
+ traceId: __invocationTraceId
1595
+ },
1592
1596
  initializeGlobals: __initializeGlobals
1593
1597
  });
1594
1598
  }
1595
1599
  const __mainNodeParams = [];
1596
1600
  if (__process.argv[1] === fileURLToPath(import.meta.url)) {
1597
- if (__process.argv.length > 2) {
1598
- console.error(`main() takes 0 argument(s) but got ${__process.argv.length - 2}; extra: ${__process.argv.slice(2).join(" ")}`);
1599
- __process.exit(1);
1600
- }
1601
1601
  try {
1602
1602
  const initialState = {
1603
1603
  messages: new ThreadStore(),
@@ -88,9 +88,9 @@ function pass() {
88
88
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
89
89
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
90
90
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
91
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
92
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
93
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
91
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
92
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
93
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
94
94
  const __setDebugger = (dbg) => {
95
95
  __globalCtx.debuggerState = dbg;
96
96
  };
@@ -54,6 +54,10 @@ export def parseAgentArgs() {
54
54
  type: "string",
55
55
  description: "Directory to use instead of ~/.agency-agent for settings, policy, and history (equivalent to the AGENCY_AGENT_HOME env var; the flag wins when both are set)"
56
56
  },
57
+ config: {
58
+ type: "string",
59
+ description: "Path to an agency.json config file for this agent run (the agent is recompiled with it)"
60
+ },
57
61
  local: {
58
62
  type: "string",
59
63
  optional: true,
@@ -74,6 +78,14 @@ export def parseAgentArgs() {
74
78
  optional: true,
75
79
  description: "Append structured statelog events (one JSON object per line) for debugging. Bare --log writes ./log.jsonl; --log <path> writes that file; --log stdout streams events to standard out."
76
80
  },
81
+ "max-cost": {
82
+ type: "string",
83
+ description: "Abort if the agent's LLM spend exceeds this many dollars (0 = local models only; negative = no limit)"
84
+ },
85
+ "max-time": {
86
+ type: "string",
87
+ description: "Abort if the agent's working time exceeds this duration (e.g. 30m or 2d); waiting on a human is not counted; zero/negative = no limit"
88
+ },
77
89
  "max-tool-call-rounds": {
78
90
  type: "number",
79
91
  description: "Max LLM tool-call rounds before a tool loop halts (default 10 interactive, 50 in one-shot/-p mode)"
@@ -104,9 +104,9 @@ function pass() {
104
104
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
105
105
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
106
106
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
107
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
108
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
109
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
107
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
108
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
109
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
110
110
  const __setDebugger = (dbg) => {
111
111
  __globalCtx.debuggerState = dbg;
112
112
  };
@@ -297,6 +297,10 @@ async function __parseAgentArgs_impl() {
297
297
  "type": `string`,
298
298
  "description": `Directory to use instead of ~/.agency-agent for settings, policy, and history (equivalent to the AGENCY_AGENT_HOME env var; the flag wins when both are set)`
299
299
  },
300
+ "config": {
301
+ "type": `string`,
302
+ "description": `Path to an agency.json config file for this agent run (the agent is recompiled with it)`
303
+ },
300
304
  "local": {
301
305
  "type": `string`,
302
306
  "optional": true,
@@ -317,6 +321,14 @@ async function __parseAgentArgs_impl() {
317
321
  "optional": true,
318
322
  "description": `Append structured statelog events (one JSON object per line) for debugging. Bare --log writes ./log.jsonl; --log <path> writes that file; --log stdout streams events to standard out.`
319
323
  },
324
+ "max-cost": {
325
+ "type": `string`,
326
+ "description": `Abort if the agent's LLM spend exceeds this many dollars (0 = local models only; negative = no limit)`
327
+ },
328
+ "max-time": {
329
+ "type": `string`,
330
+ "description": `Abort if the agent's working time exceeds this duration (e.g. 30m or 2d); waiting on a human is not counted; zero/negative = no limit`
331
+ },
320
332
  "max-tool-call-rounds": {
321
333
  "type": `number`,
322
334
  "description": `Max LLM tool-call rounds before a tool loop halts (default 10 interactive, 50 in one-shot/-p mode)`
@@ -118,9 +118,9 @@ function pass() {
118
118
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
119
119
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
120
120
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
121
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
122
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
123
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
121
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
122
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
123
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
124
124
  const __setDebugger = (dbg) => {
125
125
  __globalCtx.debuggerState = dbg;
126
126
  };
@@ -112,9 +112,9 @@ function pass() {
112
112
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
113
113
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
114
114
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
115
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
116
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
117
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
115
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
116
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
117
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
118
118
  const __setDebugger = (dbg) => {
119
119
  __globalCtx.debuggerState = dbg;
120
120
  };
@@ -109,9 +109,9 @@ function pass() {
109
109
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
110
110
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
111
111
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
112
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
113
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
114
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
112
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
113
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
114
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
115
115
  const __setDebugger = (dbg) => {
116
116
  __globalCtx.debuggerState = dbg;
117
117
  };
@@ -112,9 +112,9 @@ function pass() {
112
112
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
113
113
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
114
114
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
115
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
116
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
117
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
115
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
116
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
117
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
118
118
  const __setDebugger = (dbg) => {
119
119
  __globalCtx.debuggerState = dbg;
120
120
  };
@@ -110,9 +110,9 @@ function pass() {
110
110
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
111
111
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
112
112
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
113
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
114
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
115
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
113
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
114
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
115
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
116
116
  const __setDebugger = (dbg) => {
117
117
  __globalCtx.debuggerState = dbg;
118
118
  };
@@ -110,9 +110,9 @@ function pass() {
110
110
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
111
111
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
112
112
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
113
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
114
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
115
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
113
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
114
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
115
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
116
116
  const __setDebugger = (dbg) => {
117
117
  __globalCtx.debuggerState = dbg;
118
118
  };
@@ -156,9 +156,9 @@ function pass() {
156
156
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
157
157
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
158
158
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
159
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
160
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
161
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
159
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
160
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
161
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
162
162
  const __setDebugger = (dbg) => {
163
163
  __globalCtx.debuggerState = dbg;
164
164
  };
@@ -111,9 +111,9 @@ function pass() {
111
111
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
112
112
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
113
113
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
114
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
115
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
116
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
114
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
115
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
116
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
117
117
  const __setDebugger = (dbg) => {
118
118
  __globalCtx.debuggerState = dbg;
119
119
  };
@@ -109,9 +109,9 @@ function pass() {
109
109
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
110
110
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
111
111
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
112
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
113
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
114
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
112
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
113
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
114
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
115
115
  const __setDebugger = (dbg) => {
116
116
  __globalCtx.debuggerState = dbg;
117
117
  };
@@ -110,9 +110,9 @@ function pass() {
110
110
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
111
111
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
112
112
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
113
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
114
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
115
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
113
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
114
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
115
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
116
116
  const __setDebugger = (dbg) => {
117
117
  __globalCtx.debuggerState = dbg;
118
118
  };
@@ -103,9 +103,9 @@ function pass() {
103
103
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
104
104
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
105
105
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
106
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
107
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
108
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
106
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
107
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
108
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
109
109
  const __setDebugger = (dbg) => {
110
110
  __globalCtx.debuggerState = dbg;
111
111
  };
@@ -114,9 +114,9 @@ function pass() {
114
114
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
115
115
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
116
116
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
117
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
118
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
119
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
117
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
118
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
119
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
120
120
  const __setDebugger = (dbg) => {
121
121
  __globalCtx.debuggerState = dbg;
122
122
  };
@@ -111,9 +111,9 @@ function pass() {
111
111
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
112
112
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
113
113
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
114
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
115
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
116
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
114
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
115
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
116
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
117
117
  const __setDebugger = (dbg) => {
118
118
  __globalCtx.debuggerState = dbg;
119
119
  };
@@ -151,9 +151,9 @@ function pass() {
151
151
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
152
152
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
153
153
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
154
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
155
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
156
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
154
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
155
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
156
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
157
157
  const __setDebugger = (dbg) => {
158
158
  __globalCtx.debuggerState = dbg;
159
159
  };
@@ -111,9 +111,9 @@ function pass() {
111
111
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
112
112
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
113
113
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
114
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
115
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
116
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
114
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
115
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
116
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
117
117
  const __setDebugger = (dbg) => {
118
118
  __globalCtx.debuggerState = dbg;
119
119
  };
@@ -114,9 +114,9 @@ function pass() {
114
114
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
115
115
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
116
116
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
117
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
118
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
119
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
117
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
118
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
119
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
120
120
  const __setDebugger = (dbg) => {
121
121
  __globalCtx.debuggerState = dbg;
122
122
  };
@@ -119,9 +119,9 @@ function pass() {
119
119
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
120
120
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
121
121
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
122
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
123
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
124
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
122
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
123
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
124
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
125
125
  const __setDebugger = (dbg) => {
126
126
  __globalCtx.debuggerState = dbg;
127
127
  };
@@ -115,9 +115,9 @@ function pass() {
115
115
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
116
116
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
117
117
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
118
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
119
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
120
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
118
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
119
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
120
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
121
121
  const __setDebugger = (dbg) => {
122
122
  __globalCtx.debuggerState = dbg;
123
123
  };
@@ -109,9 +109,9 @@ function pass() {
109
109
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
110
110
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
111
111
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
112
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
113
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
114
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
112
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
113
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
114
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
115
115
  const __setDebugger = (dbg) => {
116
116
  __globalCtx.debuggerState = dbg;
117
117
  };
@@ -114,9 +114,9 @@ function pass() {
114
114
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
115
115
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
116
116
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
117
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
118
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
119
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
117
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
118
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
119
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
120
120
  const __setDebugger = (dbg) => {
121
121
  __globalCtx.debuggerState = dbg;
122
122
  };
@@ -104,9 +104,9 @@ function pass() {
104
104
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
105
105
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
106
106
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
107
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
108
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
109
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
107
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
108
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
109
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
110
110
  const __setDebugger = (dbg) => {
111
111
  __globalCtx.debuggerState = dbg;
112
112
  };
@@ -107,9 +107,9 @@ function pass() {
107
107
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
108
108
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
109
109
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
110
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
111
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
112
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
110
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
111
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
112
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
113
113
  const __setDebugger = (dbg) => {
114
114
  __globalCtx.debuggerState = dbg;
115
115
  };
@@ -105,9 +105,9 @@ function pass() {
105
105
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
106
106
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
107
107
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
108
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
109
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
110
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
108
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
109
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
110
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
111
111
  const __setDebugger = (dbg) => {
112
112
  __globalCtx.debuggerState = dbg;
113
113
  };
@@ -710,68 +710,84 @@ graph.node("createMeals", async (__state) => {
710
710
  });
711
711
  graph.conditionalEdge("main", ["categorize"]);
712
712
  graph.conditionalEdge("categorize", ["scrapeRecipe", "createIngredients", "createMeals"]);
713
- async function main({ messages, callbacks } = {}) {
713
+ async function main({ messages: __invocationMessages, callbacks: __invocationCallbacks, config: __invocationConfig, traceId: __invocationTraceId } = {}) {
714
714
  return runNode({
715
715
  ctx: __globalCtx,
716
716
  nodeName: "main",
717
717
  data: {},
718
- messages,
719
- callbacks,
718
+ messages: __invocationMessages,
719
+ callbacks: __invocationCallbacks,
720
+ invocation: {
721
+ config: __invocationConfig,
722
+ traceId: __invocationTraceId
723
+ },
720
724
  initializeGlobals: __initializeGlobals
721
725
  });
722
726
  }
723
727
  const __mainNodeParams = [];
724
- async function categorize(userMsg, { messages, callbacks } = {}) {
728
+ async function categorize(userMsg, { messages: __invocationMessages, callbacks: __invocationCallbacks, config: __invocationConfig, traceId: __invocationTraceId } = {}) {
725
729
  return runNode({
726
730
  ctx: __globalCtx,
727
731
  nodeName: "categorize",
728
732
  data: {
729
733
  userMsg
730
734
  },
731
- messages,
732
- callbacks,
735
+ messages: __invocationMessages,
736
+ callbacks: __invocationCallbacks,
737
+ invocation: {
738
+ config: __invocationConfig,
739
+ traceId: __invocationTraceId
740
+ },
733
741
  initializeGlobals: __initializeGlobals
734
742
  });
735
743
  }
736
744
  const __categorizeNodeParams = ["userMsg"];
737
- async function scrapeRecipe({ messages, callbacks } = {}) {
745
+ async function scrapeRecipe({ messages: __invocationMessages, callbacks: __invocationCallbacks, config: __invocationConfig, traceId: __invocationTraceId } = {}) {
738
746
  return runNode({
739
747
  ctx: __globalCtx,
740
748
  nodeName: "scrapeRecipe",
741
749
  data: {},
742
- messages,
743
- callbacks,
750
+ messages: __invocationMessages,
751
+ callbacks: __invocationCallbacks,
752
+ invocation: {
753
+ config: __invocationConfig,
754
+ traceId: __invocationTraceId
755
+ },
744
756
  initializeGlobals: __initializeGlobals
745
757
  });
746
758
  }
747
759
  const __scrapeRecipeNodeParams = [];
748
- async function createIngredients({ messages, callbacks } = {}) {
760
+ async function createIngredients({ messages: __invocationMessages, callbacks: __invocationCallbacks, config: __invocationConfig, traceId: __invocationTraceId } = {}) {
749
761
  return runNode({
750
762
  ctx: __globalCtx,
751
763
  nodeName: "createIngredients",
752
764
  data: {},
753
- messages,
754
- callbacks,
765
+ messages: __invocationMessages,
766
+ callbacks: __invocationCallbacks,
767
+ invocation: {
768
+ config: __invocationConfig,
769
+ traceId: __invocationTraceId
770
+ },
755
771
  initializeGlobals: __initializeGlobals
756
772
  });
757
773
  }
758
774
  const __createIngredientsNodeParams = [];
759
- async function createMeals({ messages, callbacks } = {}) {
775
+ async function createMeals({ messages: __invocationMessages, callbacks: __invocationCallbacks, config: __invocationConfig, traceId: __invocationTraceId } = {}) {
760
776
  return runNode({
761
777
  ctx: __globalCtx,
762
778
  nodeName: "createMeals",
763
779
  data: {},
764
- messages,
765
- callbacks,
780
+ messages: __invocationMessages,
781
+ callbacks: __invocationCallbacks,
782
+ invocation: {
783
+ config: __invocationConfig,
784
+ traceId: __invocationTraceId
785
+ },
766
786
  initializeGlobals: __initializeGlobals
767
787
  });
768
788
  }
769
789
  const __createMealsNodeParams = [];
770
790
  if (__process.argv[1] === fileURLToPath(import.meta.url)) {
771
- if (__process.argv.length > 2) {
772
- console.error(`main() takes 0 argument(s) but got ${__process.argv.length - 2}; extra: ${__process.argv.slice(2).join(" ")}`);
773
- __process.exit(1);
774
- }
775
791
  try {
776
792
  const initialState = {
777
793
  messages: new ThreadStore(),
@@ -122,9 +122,9 @@ function pass() {
122
122
  const respondToInterrupts = (interrupts, responses, opts) => _respondToInterrupts({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
123
123
  const rewindFrom = (checkpoint2, overrides, opts) => _rewindFrom({ ctx: __globalCtx, checkpoint: checkpoint2, overrides, metadata: opts?.metadata });
124
124
  const __invokeFunction = (fn, namedArgs) => _runExportedFunction({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
125
- const __invokeFunctionForServe = (fn, namedArgs) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, initializeGlobals: __initializeGlobals });
126
- const __invokeNodeForServe = (nodeName, data) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, initializeGlobals: __initializeGlobals });
127
- const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata });
125
+ const __invokeFunctionForServe = (fn, namedArgs, invocation) => _runExportedFunctionForServe({ ctx: __globalCtx, fn, namedArgs, invocation, initializeGlobals: __initializeGlobals });
126
+ const __invokeNodeForServe = (nodeName, data, invocation) => _runNodeForServe({ ctx: __globalCtx, nodeName, data, invocation, initializeGlobals: __initializeGlobals });
127
+ const __respondToInterruptsForServe = (interrupts, responses, opts) => _respondToInterruptsForServe({ ctx: __globalCtx, interrupts, responses, overrides: opts?.overrides, metadata: opts?.metadata, invocation: opts?.invocation });
128
128
  const __setDebugger = (dbg) => {
129
129
  __globalCtx.debuggerState = dbg;
130
130
  };