agency-lang 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/lib/agents/agency-agent/agent.agency +7 -6
  2. package/dist/lib/agents/agency-agent/agent.js +81 -18
  3. package/dist/lib/agents/agency-agent/brains/brain.js +3 -10
  4. package/dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency +4 -3
  5. package/dist/lib/agents/agency-agent/brains/coordinator/coordinator.js +36 -14
  6. package/dist/lib/agents/agency-agent/brains/coordinator/learn.js +3 -10
  7. package/dist/lib/agents/agency-agent/brains/coordinator/lib/announce.js +4 -10
  8. package/dist/lib/agents/agency-agent/brains/coordinator/lib/budgets.js +3 -10
  9. package/dist/lib/agents/agency-agent/brains/coordinator/lib/bundledSkills.js +3 -10
  10. package/dist/lib/agents/agency-agent/brains/coordinator/presetTools.js +3 -10
  11. package/dist/lib/agents/agency-agent/brains/coordinator/prompts/codeSample.js +7 -11
  12. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/brainstorm.js +3 -10
  13. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.js +3 -10
  14. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/explorer.js +3 -10
  15. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.js +3 -10
  16. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.js +3 -10
  17. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.js +3 -10
  18. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/rewrite.js +3 -10
  19. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/supervisor.js +3 -10
  20. package/dist/lib/agents/agency-agent/brains/coordinator/subagents/writing.js +3 -10
  21. package/dist/lib/agents/agency-agent/brains/registry.js +3 -10
  22. package/dist/lib/agents/agency-agent/brains/simple/simple.js +3 -10
  23. package/dist/lib/agents/agency-agent/images/images.js +3 -10
  24. package/dist/lib/agents/agency-agent/lib/agentName.js +3 -10
  25. package/dist/lib/agents/agency-agent/lib/agentSource.js +3 -10
  26. package/dist/lib/agents/agency-agent/lib/args.js +3 -10
  27. package/dist/lib/agents/agency-agent/lib/attachments.js +3 -10
  28. package/dist/lib/agents/agency-agent/lib/budget.js +4 -10
  29. package/dist/lib/agents/agency-agent/lib/capabilities.js +3 -10
  30. package/dist/lib/agents/agency-agent/lib/capabilitiesUi.js +4 -10
  31. package/dist/lib/agents/agency-agent/lib/commandPalette.js +3 -10
  32. package/dist/lib/agents/agency-agent/lib/config.js +3 -10
  33. package/dist/lib/agents/agency-agent/lib/effort.js +3 -10
  34. package/dist/lib/agents/agency-agent/lib/grounding.js +3 -10
  35. package/dist/lib/agents/agency-agent/lib/header.js +4 -10
  36. package/dist/lib/agents/agency-agent/lib/images.js +3 -10
  37. package/dist/lib/agents/agency-agent/lib/learned.js +3 -10
  38. package/dist/lib/agents/agency-agent/lib/mcp.js +4 -10
  39. package/dist/lib/agents/agency-agent/lib/modelFilters.js +3 -10
  40. package/dist/lib/agents/agency-agent/lib/modelRequest.js +3 -10
  41. package/dist/lib/agents/agency-agent/lib/models.js +3 -10
  42. package/dist/lib/agents/agency-agent/lib/policy.agency +4 -3
  43. package/dist/lib/agents/agency-agent/lib/policy.js +36 -14
  44. package/dist/lib/agents/agency-agent/lib/presetRules.js +3 -10
  45. package/dist/lib/agents/agency-agent/lib/presets.agency +2 -1
  46. package/dist/lib/agents/agency-agent/lib/presets.js +16 -12
  47. package/dist/lib/agents/agency-agent/lib/projectContext.js +3 -10
  48. package/dist/lib/agents/agency-agent/lib/repl.js +4 -10
  49. package/dist/lib/agents/agency-agent/lib/resolution.js +3 -10
  50. package/dist/lib/agents/agency-agent/lib/resume.agency +3 -2
  51. package/dist/lib/agents/agency-agent/lib/resume.js +26 -13
  52. package/dist/lib/agents/agency-agent/lib/search.js +3 -10
  53. package/dist/lib/agents/agency-agent/lib/session.agency +6 -5
  54. package/dist/lib/agents/agency-agent/lib/session.js +56 -16
  55. package/dist/lib/agents/agency-agent/lib/sessionTitle.js +3 -10
  56. package/dist/lib/agents/agency-agent/lib/sessions.js +3 -10
  57. package/dist/lib/agents/agency-agent/lib/settings.js +3 -10
  58. package/dist/lib/agents/agency-agent/lib/slashCommands/policy.js +4 -10
  59. package/dist/lib/agents/agency-agent/lib/slots.js +3 -10
  60. package/dist/lib/agents/agency-agent/lib/toolLimits.js +3 -10
  61. package/dist/lib/agents/agency-agent/lib/trace.js +4 -10
  62. package/dist/lib/agents/agency-agent/lib/transcript.js +4 -10
  63. package/dist/lib/agents/agency-agent/lib/turn.js +4 -10
  64. package/dist/lib/agents/agency-agent/lib/utils/renderLLMCallResponse.js +3 -10
  65. package/dist/lib/agents/agency-agent/lib/utils.js +3 -10
  66. package/dist/lib/agents/agency-agent/shared.agency +4 -3
  67. package/dist/lib/agents/agency-agent/shared.js +35 -14
  68. package/dist/lib/agents/eval/goalJudge.js +6 -11
  69. package/dist/lib/agents/eval/judge.js +6 -11
  70. package/dist/lib/agents/eval/judgePairwise.js +6 -11
  71. package/dist/lib/agents/eval/rubricJudge.js +6 -11
  72. package/dist/lib/agents/optimize/gepaReflect.js +6 -11
  73. package/dist/lib/agents/optimize/mutatePrompt.js +6 -11
  74. package/dist/lib/agents/policy/agent.js +6 -11
  75. package/dist/lib/agents/review/agent.js +7 -11
  76. package/dist/lib/backends/typescriptBuilder.js +18 -13
  77. package/dist/lib/cli/diffusersImageRules.py +869 -11
  78. package/dist/lib/cli/diffusersImageServer.py +276 -22
  79. package/dist/lib/cli/imageTools.py +113 -0
  80. package/dist/lib/cli/imageToolsRules.py +58 -0
  81. package/dist/lib/cli/local.d.ts +6 -3
  82. package/dist/lib/cli/local.js +18 -3
  83. package/dist/lib/cli/localServe.d.ts +83 -19
  84. package/dist/lib/cli/localServe.js +366 -118
  85. package/dist/lib/cli/localServerCommon.py +37 -2
  86. package/dist/lib/cli/mlxServer.js +17 -5
  87. package/dist/lib/cli/remote/commands/call.js +1 -1
  88. package/dist/lib/cli/serve.js +6 -2
  89. package/dist/lib/cli/serveLog.d.ts +7 -1
  90. package/dist/lib/cli/serveLog.js +51 -2
  91. package/dist/lib/cli/statelog/spendTypes.d.ts +8 -8
  92. package/dist/lib/cli/visionRules.py +271 -0
  93. package/dist/lib/cli/visionServer.py +344 -0
  94. package/dist/lib/config/config.d.ts +33 -0
  95. package/dist/lib/config/config.js +23 -3
  96. package/dist/lib/runtime/budgetExit.d.ts +1 -1
  97. package/dist/lib/runtime/budgetExit.js +3 -2
  98. package/dist/lib/runtime/cliEntry.js +3 -1
  99. package/dist/lib/runtime/cliInterruptResolution.js +1 -1
  100. package/dist/lib/runtime/exitProcess.d.ts +15 -0
  101. package/dist/lib/runtime/exitProcess.js +23 -0
  102. package/dist/lib/runtime/index.d.ts +2 -0
  103. package/dist/lib/runtime/index.js +2 -0
  104. package/dist/lib/runtime/interrupts.d.ts +1 -1
  105. package/dist/lib/runtime/interrupts.js +4 -3
  106. package/dist/lib/runtime/node.js +10 -17
  107. package/dist/lib/runtime/policyFlags.d.ts +6 -0
  108. package/dist/lib/runtime/policyFlags.js +8 -0
  109. package/dist/lib/runtime/subprocess-bootstrap.js +16 -12
  110. package/dist/lib/serve/http/adapter.d.ts +1 -1
  111. package/dist/lib/serve/http/adapter.js +3 -0
  112. package/dist/lib/serve/mcp/adapter.d.ts +1 -1
  113. package/dist/lib/serve/mcp/adapter.js +6 -1
  114. package/dist/lib/serve/mcp/httpTransport.d.ts +1 -0
  115. package/dist/lib/serve/mcp/httpTransport.js +3 -0
  116. package/dist/lib/serve/shutdown.d.ts +13 -0
  117. package/dist/lib/serve/shutdown.js +24 -0
  118. package/dist/lib/serve/util.d.ts +9 -1
  119. package/dist/lib/serve/util.js +15 -3
  120. package/dist/lib/statelogClient.d.ts +0 -8
  121. package/dist/lib/statelogClient.js +14 -48
  122. package/dist/lib/statelogSender.d.ts +29 -0
  123. package/dist/lib/statelogSender.js +54 -0
  124. package/dist/lib/stdlib/approvedPath.d.ts +6 -0
  125. package/dist/lib/stdlib/approvedPath.js +28 -10
  126. package/dist/lib/stdlib/args.js +7 -3
  127. package/dist/lib/stdlib/cli.js +3 -1
  128. package/dist/lib/stdlib/image.d.ts +24 -2
  129. package/dist/lib/stdlib/image.js +82 -6
  130. package/dist/lib/stdlib/imageTools.d.ts +25 -0
  131. package/dist/lib/stdlib/imageTools.js +138 -0
  132. package/dist/lib/stdlib/localImageInputs.d.ts +76 -0
  133. package/dist/lib/stdlib/localImageInputs.js +185 -0
  134. package/dist/lib/stdlib/localModelList.d.ts +31 -0
  135. package/dist/lib/stdlib/localModelList.js +190 -0
  136. package/dist/lib/stdlib/localModels.d.ts +49 -35
  137. package/dist/lib/stdlib/localModels.js +224 -190
  138. package/dist/lib/stdlib/localPython.d.ts +17 -0
  139. package/dist/lib/stdlib/localPython.js +34 -0
  140. package/dist/lib/stdlib/mlxImage.d.ts +9 -6
  141. package/dist/lib/stdlib/mlxImage.js +45 -17
  142. package/dist/lib/stdlib/mlxModelRecord.d.ts +5 -0
  143. package/dist/lib/stdlib/mlxModelRecord.js +12 -1
  144. package/dist/lib/stdlib/modelBackend.d.ts +9 -0
  145. package/dist/lib/stdlib/modelBackend.js +51 -1
  146. package/dist/lib/stdlib/modelCatalog.d.ts +13 -5
  147. package/dist/lib/stdlib/modelCatalog.js +170 -48
  148. package/dist/lib/stdlib/modelKind.d.ts +24 -0
  149. package/dist/lib/stdlib/modelKind.js +85 -0
  150. package/dist/lib/stdlib/system.d.ts +1 -1
  151. package/dist/lib/stdlib/system.js +3 -2
  152. package/dist/lib/stdlib/ui-region.js +4 -2
  153. package/dist/lib/stdlib/ui.js +4 -2
  154. package/dist/lib/stdlib/vision.d.ts +18 -0
  155. package/dist/lib/stdlib/vision.js +116 -0
  156. package/dist/lib/stdlib/visionFiles.d.ts +9 -0
  157. package/dist/lib/stdlib/visionFiles.js +20 -0
  158. package/dist/lib/templates/backends/typescriptGenerator/imports.d.ts +1 -1
  159. package/dist/lib/templates/backends/typescriptGenerator/imports.js +1 -1
  160. package/dist/lib/templates/cli/standaloneHttp.d.ts +1 -1
  161. package/dist/lib/templates/cli/standaloneHttp.js +3 -2
  162. package/dist/lib/templates/cli/standaloneMcp.d.ts +1 -1
  163. package/dist/lib/templates/cli/standaloneMcp.js +2 -1
  164. package/dist/lib/templates/cli/standaloneMcpHttp.d.ts +1 -1
  165. package/dist/lib/templates/cli/standaloneMcpHttp.js +3 -2
  166. package/dist/scripts/agency.js +24 -18
  167. package/package.json +1 -1
  168. package/stdlib/agency/eval.js +3 -10
  169. package/stdlib/agency/local.agency +5 -3
  170. package/stdlib/agency/local.js +8 -14
  171. package/stdlib/agency.js +3 -10
  172. package/stdlib/agent.js +3 -10
  173. package/stdlib/agents/agency/coding.js +6 -11
  174. package/stdlib/agents/agency/expert.js +3 -10
  175. package/stdlib/agents/agency/researcher.js +3 -10
  176. package/stdlib/agents/agency/review.js +6 -11
  177. package/stdlib/agents/agency/verifier.js +3 -10
  178. package/stdlib/agents/coding.js +3 -10
  179. package/stdlib/agents/composable/promptRewriter.js +3 -10
  180. package/stdlib/agents/composable/researcher.js +3 -10
  181. package/stdlib/agents/composable/utils.js +3 -10
  182. package/stdlib/agents/data.js +3 -10
  183. package/stdlib/agents/expert.js +3 -10
  184. package/stdlib/agents/explorer.js +3 -10
  185. package/stdlib/agents/lib/expertGuidance.js +3 -10
  186. package/stdlib/agents/lib/feedback.js +3 -10
  187. package/stdlib/agents/lib/search.js +3 -10
  188. package/stdlib/agents/lib/shared.js +3 -10
  189. package/stdlib/agents/lib/toolkits.js +3 -10
  190. package/stdlib/agents/oracle.js +3 -10
  191. package/stdlib/agents/planner.js +3 -10
  192. package/stdlib/agents/researcher.js +6 -11
  193. package/stdlib/agents/review.js +3 -10
  194. package/stdlib/agents/typescript/review.js +6 -11
  195. package/stdlib/agents/verifier.js +3 -10
  196. package/stdlib/agents/writing/review.js +6 -11
  197. package/stdlib/agents/writing/rewrite.js +6 -11
  198. package/stdlib/args.js +3 -10
  199. package/stdlib/array.js +3 -10
  200. package/stdlib/auth/keyring.js +3 -10
  201. package/stdlib/auth/oauth.js +3 -10
  202. package/stdlib/aws/s3.js +3 -10
  203. package/stdlib/calendar.js +3 -10
  204. package/stdlib/capabilities.agency +3 -3
  205. package/stdlib/capabilities.js +6 -13
  206. package/stdlib/clipboard.js +3 -10
  207. package/stdlib/concurrency.js +3 -10
  208. package/stdlib/data/connector.js +3 -10
  209. package/stdlib/data/finance/dbnomics.js +3 -10
  210. package/stdlib/data/finance/edgar.js +3 -10
  211. package/stdlib/data/finance/fred.js +3 -10
  212. package/stdlib/data/news/gdelt.js +3 -10
  213. package/stdlib/data/people/littlesis.js +3 -10
  214. package/stdlib/data/social/bluesky.js +3 -10
  215. package/stdlib/data/tech/hackernews.js +3 -10
  216. package/stdlib/data/tech/yc.js +3 -10
  217. package/stdlib/data/usaspending.js +3 -10
  218. package/stdlib/data/wikidata.js +3 -10
  219. package/stdlib/date.js +3 -10
  220. package/stdlib/docs/cli/local.md +52 -9
  221. package/stdlib/docs/cli/policy.md +4 -0
  222. package/stdlib/docs/guide/agency-config-file.md +2 -0
  223. package/stdlib/docs/guide/image-generation.md +780 -62
  224. package/stdlib/docs/guide/observability.md +54 -1
  225. package/stdlib/docs/guide/policies.md +1 -1
  226. package/stdlib/docs/guide/using-local-models.md +101 -8
  227. package/stdlib/docs/stdlib/agency/local.md +23 -21
  228. package/stdlib/docs/stdlib/capabilities.md +3 -3
  229. package/stdlib/docs/stdlib/image.md +254 -17
  230. package/stdlib/docs/stdlib/system.md +1 -1
  231. package/stdlib/docs/stdlib/vision.md +210 -0
  232. package/stdlib/embedding.js +3 -10
  233. package/stdlib/fs.js +3 -10
  234. package/stdlib/git.js +3 -10
  235. package/stdlib/github.js +3 -10
  236. package/stdlib/http.js +3 -10
  237. package/stdlib/image.agency +237 -13
  238. package/stdlib/image.js +1298 -27
  239. package/stdlib/index.js +3 -10
  240. package/stdlib/llm.js +3 -10
  241. package/stdlib/markdown.js +3 -10
  242. package/stdlib/math.js +3 -10
  243. package/stdlib/mcp.js +3 -10
  244. package/stdlib/memory.js +3 -10
  245. package/stdlib/messaging/email.js +3 -10
  246. package/stdlib/messaging/imessage.js +3 -10
  247. package/stdlib/messaging/sms.js +3 -10
  248. package/stdlib/notes/apple.js +3 -10
  249. package/stdlib/object.js +3 -10
  250. package/stdlib/ocr.js +3 -10
  251. package/stdlib/path.js +3 -10
  252. package/stdlib/policy.js +4 -10
  253. package/stdlib/safeBash/actions.js +3 -10
  254. package/stdlib/safeBash.js +3 -10
  255. package/stdlib/shell.js +3 -10
  256. package/stdlib/skills.js +3 -10
  257. package/stdlib/speech.js +3 -10
  258. package/stdlib/spill.js +3 -10
  259. package/stdlib/statelog.js +3 -10
  260. package/stdlib/strategy.js +3 -10
  261. package/stdlib/supervise.js +3 -10
  262. package/stdlib/syntax.js +3 -10
  263. package/stdlib/system.agency +1 -1
  264. package/stdlib/system.js +4 -11
  265. package/stdlib/tag.js +3 -10
  266. package/stdlib/thread.js +3 -10
  267. package/stdlib/toolbox.js +3 -10
  268. package/stdlib/ui/chart.js +3 -10
  269. package/stdlib/ui/cli.js +3 -10
  270. package/stdlib/ui/layout.js +3 -10
  271. package/stdlib/ui/table.js +3 -10
  272. package/stdlib/ui.js +4 -10
  273. package/stdlib/validation.js +3 -10
  274. package/stdlib/vision.agency +151 -0
  275. package/stdlib/vision.js +1042 -0
  276. package/stdlib/weather.js +3 -10
  277. package/stdlib/web/browser.js +3 -10
  278. package/stdlib/web/search.js +3 -10
  279. package/stdlib/wikipedia.js +3 -10
@@ -1,3 +1,4 @@
1
+ import { _exit } from "agency-lang/stdlib-lib/system.js"
1
2
  import { parseArgs } from "std::args"
2
3
  import { map } from "std::array"
3
4
  import { setLlmOptions } from "std::llm"
@@ -90,7 +91,7 @@ node main() {
90
91
  // silently doing nothing.
91
92
  if (args.flags.policy == "") {
92
93
  printPolicyHelp()
93
- process.exit(0)
94
+ _exit(0)
94
95
  }
95
96
  setPolicyArg(
96
97
  args.flags.policy ?? "",
@@ -103,7 +104,7 @@ node main() {
103
104
  if (brain == null) {
104
105
  const names = map(allBrains(), \entry -> entry.name).join(", ")
105
106
  print(color.red("Unknown --brain value: ${brainName}. Valid: ${names}"))
106
- process.exit(1)
107
+ _exit(1)
107
108
  return
108
109
  }
109
110
  setBrain(brain)
@@ -134,7 +135,7 @@ node main() {
134
135
  "Unknown --agent value: ${requestedStartTarget}. Valid for the ${brain.name} brain: ${validTargets}",
135
136
  ),
136
137
  )
137
- process.exit(1)
138
+ _exit(1)
138
139
  return
139
140
  } else {
140
141
  startAgent = resolvedStartTarget
@@ -170,7 +171,7 @@ node main() {
170
171
  const effort = parseEffort(args.flags.effort ?? null)
171
172
  if (effort.error != "") {
172
173
  print(color.red(effort.error))
173
- process.exit(1)
174
+ _exit(1)
174
175
  }
175
176
  if (effort.level != null) {
176
177
  setLlmOptions({
@@ -190,7 +191,7 @@ node main() {
190
191
  "--continue and --resume need an interactive session; one-shot runs are not saved.",
191
192
  ),
192
193
  )
193
- process.exit(1)
194
+ _exit(1)
194
195
  }
195
196
  // Everything above is process-level: model resolution feeds the memory
196
197
  // layer, and memory, MCP, and the settings reads behind them must run
@@ -210,7 +211,7 @@ node main() {
210
211
  if (!hasQuery) {
211
212
  const fromStdin = readStdin()
212
213
  if (fromStdin == null || fromStdin == "") {
213
- process.exit(0)
214
+ _exit(0)
214
215
  }
215
216
  prompt = fromStdin
216
217
  }
@@ -1,4 +1,5 @@
1
1
  import { print, printJSON, input, sleep, saveDraft, _guard, _pairsOf, read, write, writeBinary, readBinary, range, callback, mapWithIndex, filter, exclude, find, findIndex, reduce, flatMap, every, some, count, sortBy, unique, groupBy, flatten, setAgentCwd, getAgentCwd, applyAgentCwd } from "agency-lang/stdlib/index.js";
2
+ import { _exit } from "agency-lang/stdlib-lib/system.js";
2
3
  import { parseArgs } from "agency-lang/stdlib/args.js";
3
4
  import { map } from "agency-lang/stdlib/array.js";
4
5
  import { setLlmOptions } from "agency-lang/stdlib/llm.js";
@@ -30,7 +31,7 @@ import { fileURLToPath } from "url";
30
31
  import __process from "process";
31
32
  import { readFileSync } from "fs";
32
33
  import { z } from "agency-lang/zod";
33
- import { color, nanoid } from "agency-lang";
34
+ import { color } from "agency-lang";
34
35
  import path from "path";
35
36
  import {
36
37
  RuntimeContext,
@@ -50,6 +51,7 @@ import {
50
51
  hasInterrupts,
51
52
  resolveCliInterrupts,
52
53
  reportBudgetExceededAndExit,
54
+ flushPendingStatelogPosts,
53
55
  isDebugger,
54
56
  isPaused,
55
57
  respondToInterrupts as _respondToInterrupts,
@@ -92,9 +94,9 @@ const __dirname = path.dirname(__filename);
92
94
  const __cwd = __process.cwd();
93
95
  const __globalCtx = new RuntimeContext({
94
96
  statelogConfig: {
95
- host: "https://statelog.adit.io",
97
+ host: "",
96
98
  apiKey: __process.env["STATELOG_API_KEY"] || "",
97
- projectId: "agency-lang",
99
+ projectId: "",
98
100
  debugMode: false,
99
101
  observability: true,
100
102
  logFile: "log.jsonl"
@@ -115,12 +117,6 @@ const __globalCtx = new RuntimeContext({
115
117
  },
116
118
  model: "gpt-5-mini",
117
119
  logLevel: "warn",
118
- statelog: {
119
- host: "https://statelog.adit.io",
120
- projectId: "smoltalk",
121
- apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
122
- traceId: nanoid()
123
- },
124
120
  provider: "openai-responses"
125
121
  },
126
122
  dirname: __dirname,
@@ -188,7 +184,7 @@ function registerTools(tools) {
188
184
  }
189
185
  }
190
186
  }
191
- __registerModuleFingerprint("dist/lib/agents/agency-agent/agent.agency", "e48a3277f98122b209a01450ad0676793069221bdefa929ef923a85730f32ef7", import.meta.url);
187
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/agent.agency", "281945ec35127b0906a07f4e38a657f9d38e173d2c915d6f40bae750354d654f", import.meta.url);
192
188
  __registerTool(print);
193
189
  __registerTool(printJSON);
194
190
  __registerTool(input);
@@ -684,10 +680,21 @@ graph.node("main", async (__state) => {
684
680
  }
685
681
  });
686
682
  await runner2.step(1, async (runner3) => {
687
- await __callMethod(process, "exit", {
683
+ const __funcResult = await __call(_exit, {
688
684
  type: "positional",
689
685
  args: [0]
690
686
  });
687
+ if (hasInterrupts(__funcResult)) {
688
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
689
+ runner3.halt({
690
+ ...__state,
691
+ data: __funcResult
692
+ });
693
+ return;
694
+ }
695
+ if (isAborted(__funcResult)) {
696
+ throw __funcResult.toError();
697
+ }
691
698
  });
692
699
  }
693
700
  }
@@ -856,10 +863,21 @@ graph.node("main", async (__state) => {
856
863
  }
857
864
  });
858
865
  await runner2.step(5, async (runner3) => {
859
- await __callMethod(process, "exit", {
866
+ const __funcResult = await __call(_exit, {
860
867
  type: "positional",
861
868
  args: [1]
862
869
  });
870
+ if (hasInterrupts(__funcResult)) {
871
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
872
+ runner3.halt({
873
+ ...__state,
874
+ data: __funcResult
875
+ });
876
+ return;
877
+ }
878
+ if (isAborted(__funcResult)) {
879
+ throw __funcResult.toError();
880
+ }
863
881
  });
864
882
  await runner2.step(6, async (runner3) => {
865
883
  runner3.halt({
@@ -1003,10 +1021,21 @@ graph.node("main", async (__state) => {
1003
1021
  }
1004
1022
  });
1005
1023
  await runner2.step(3, async (runner3) => {
1006
- await __callMethod(process, "exit", {
1024
+ const __funcResult = await __call(_exit, {
1007
1025
  type: "positional",
1008
1026
  args: [1]
1009
1027
  });
1028
+ if (hasInterrupts(__funcResult)) {
1029
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
1030
+ runner3.halt({
1031
+ ...__state,
1032
+ data: __funcResult
1033
+ });
1034
+ return;
1035
+ }
1036
+ if (isAborted(__funcResult)) {
1037
+ throw __funcResult.toError();
1038
+ }
1010
1039
  });
1011
1040
  await runner2.step(4, async (runner3) => {
1012
1041
  runner3.halt({
@@ -1291,10 +1320,21 @@ graph.node("main", async (__state) => {
1291
1320
  }
1292
1321
  });
1293
1322
  await runner2.step(2, async (runner3) => {
1294
- await __callMethod(process, "exit", {
1323
+ const __funcResult = await __call(_exit, {
1295
1324
  type: "positional",
1296
1325
  args: [1]
1297
1326
  });
1327
+ if (hasInterrupts(__funcResult)) {
1328
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
1329
+ runner3.halt({
1330
+ ...__state,
1331
+ data: __funcResult
1332
+ });
1333
+ return;
1334
+ }
1335
+ if (isAborted(__funcResult)) {
1336
+ throw __funcResult.toError();
1337
+ }
1298
1338
  });
1299
1339
  }
1300
1340
  }
@@ -1387,10 +1427,21 @@ graph.node("main", async (__state) => {
1387
1427
  }
1388
1428
  });
1389
1429
  await runner2.step(2, async (runner3) => {
1390
- await __callMethod(process, "exit", {
1430
+ const __funcResult = await __call(_exit, {
1391
1431
  type: "positional",
1392
1432
  args: [1]
1393
1433
  });
1434
+ if (hasInterrupts(__funcResult)) {
1435
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
1436
+ runner3.halt({
1437
+ ...__state,
1438
+ data: __funcResult
1439
+ });
1440
+ return;
1441
+ }
1442
+ if (isAborted(__funcResult)) {
1443
+ throw __funcResult.toError();
1444
+ }
1394
1445
  });
1395
1446
  }
1396
1447
  }
@@ -1522,10 +1573,21 @@ graph.node("main", async (__state) => {
1522
1573
  condition: async () => __eq(__stack.locals.fromStdin, null) || __eq(__stack.locals.fromStdin, ``),
1523
1574
  body: async (runner4) => {
1524
1575
  await runner4.step(0, async (runner5) => {
1525
- await __callMethod(process, "exit", {
1576
+ const __funcResult = await __call(_exit, {
1526
1577
  type: "positional",
1527
1578
  args: [0]
1528
1579
  });
1580
+ if (hasInterrupts(__funcResult)) {
1581
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
1582
+ runner5.halt({
1583
+ ...__state,
1584
+ data: __funcResult
1585
+ });
1586
+ return;
1587
+ }
1588
+ if (isAborted(__funcResult)) {
1589
+ throw __funcResult.toError();
1590
+ }
1529
1591
  });
1530
1592
  }
1531
1593
  }
@@ -1820,14 +1882,15 @@ if (__process.argv[1] === fileURLToPath(import.meta.url)) {
1820
1882
  });
1821
1883
  await resolveCliInterrupts(__result, respondToInterrupts);
1822
1884
  } catch (__error) {
1823
- reportBudgetExceededAndExit(__error);
1885
+ await reportBudgetExceededAndExit(__error);
1824
1886
  console.error(`
1825
1887
  Agent crashed: ${__error.message}`);
1888
+ await flushPendingStatelogPosts();
1826
1889
  throw __error;
1827
1890
  }
1828
1891
  }
1829
1892
  var stdin_default = graph;
1830
- const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line": 45, "col": 2 }, "2": { "line": 49, "col": 2 }, "3": { "line": 50, "col": 2 }, "4": { "line": 51, "col": 2 }, "5": { "line": 61, "col": 2 }, "6": { "line": 62, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_0": { "4.0": { "line": 52, "col": 4 }, "4.1": { "line": 55, "col": 18 }, "4.2.0": { "line": 55, "col": 4 }, "4.2.1": { "line": 56, "col": 6 }, "4.2.2": { "line": 57, "col": 25 }, "4.2.3.0": { "line": 57, "col": 11 }, "4.2.3.1": { "line": 58, "col": 6 }, "4.2.3": { "line": 57, "col": 11 }, "4.2": { "line": 55, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:main": { "2": { "line": 72, "col": 2 }, "3": { "line": 80, "col": 2 }, "4": { "line": 83, "col": 2 }, "6": { "line": 90, "col": 2 }, "7": { "line": 94, "col": 2 }, "8": { "line": 100, "col": 63 }, "9": { "line": 100, "col": 2 }, "10": { "line": 101, "col": 2 }, "11": { "line": 102, "col": 2 }, "12": { "line": 108, "col": 2 }, "13": { "line": 113, "col": 2 }, "14": { "line": 114, "col": 2 }, "15": { "line": 115, "col": 2 }, "16": { "line": 119, "col": 2 }, "17": { "line": 120, "col": 2 }, "18": { "line": 123, "col": 15 }, "19": { "line": 123, "col": 2 }, "20": { "line": 126, "col": 2 }, "21": { "line": 127, "col": 2 }, "22": { "line": 128, "col": 2 }, "23": { "line": 129, "col": 2 }, "25": { "line": 143, "col": 39 }, "26": { "line": 143, "col": 2 }, "27": { "line": 144, "col": 2 }, "28": { "line": 151, "col": 2 }, "30": { "line": 155, "col": 15 }, "31": { "line": 155, "col": 2 }, "32": { "line": 157, "col": 23 }, "33": { "line": 157, "col": 2 }, "34": { "line": 158, "col": 18 }, "35": { "line": 158, "col": 2 }, "37": { "line": 160, "col": 2 }, "38": { "line": 161, "col": 2 }, "40": { "line": 169, "col": 2 }, "41": { "line": 170, "col": 2 }, "42": { "line": 174, "col": 2 }, "43": { "line": 180, "col": 14 }, "44": { "line": 180, "col": 2 }, "45": { "line": 186, "col": 2 }, "47": { "line": 198, "col": 2 }, "48": { "line": 207, "col": 2 }, "3.0": { "line": 81, "col": 4 }, "4.0": { "line": 84, "col": 4 }, "6.0": { "line": 91, "col": 4 }, "6.1": { "line": 92, "col": 4 }, "11.0": { "line": 103, "col": 22 }, "11.2": { "line": 103, "col": 4 }, "11.3": { "line": 104, "col": 10 }, "11.4": { "line": 104, "col": 4 }, "11.5": { "line": 105, "col": 4 }, "11.6": { "line": 106, "col": 4 }, "23.0": { "line": 130, "col": 4 }, "23.1": { "line": 132, "col": 6 }, "23.2": { "line": 131, "col": 4 }, "23.3": { "line": 136, "col": 4 }, "23.4": { "line": 137, "col": 4 }, "23.5": { "line": 139, "col": 4 }, "38.0": { "line": 162, "col": 4 }, "41.0": { "line": 171, "col": 10 }, "41.1": { "line": 171, "col": 4 }, "41.2": { "line": 172, "col": 4 }, "42.0": { "line": 175, "col": 4 }, "45.0": { "line": 188, "col": 6 }, "45.1": { "line": 187, "col": 4 }, "45.2": { "line": 192, "col": 4 }, "47.0": { "line": 199, "col": 4 }, "47.1": { "line": 200, "col": 20 }, "47.2": { "line": 200, "col": 4 }, "47.3": { "line": 202, "col": 6 }, "47.4": { "line": 201, "col": 4 }, "48.0": { "line": 208, "col": 4 }, "48.1.0": { "line": 210, "col": 6 }, "48.1.1.0": { "line": 212, "col": 8 }, "48.1.1": { "line": 211, "col": 6 }, "48.1.2": { "line": 214, "col": 6 }, "48.1": { "line": 209, "col": 4 }, "48.2": { "line": 216, "col": 10 }, "48.3": { "line": 216, "col": 4 }, "48.5": { "line": 217, "col": 28 }, "48.6": { "line": 217, "col": 4 }, "48.7": { "line": 218, "col": 10 }, "48.8": { "line": 218, "col": 4 }, "48.9": { "line": 220, "col": 4 }, "48.10": { "line": 221, "col": 4 }, "48.11": { "line": 222, "col": 10 }, "48.12": { "line": 222, "col": 4 }, "48.13": { "line": 223, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_1": {}, "dist/lib/agents/agency-agent/agent.agency:__block_2": { "48.13.0": { "line": 224, "col": 6 } } };
1893
+ const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line": 46, "col": 2 }, "2": { "line": 50, "col": 2 }, "3": { "line": 51, "col": 2 }, "4": { "line": 52, "col": 2 }, "5": { "line": 62, "col": 2 }, "6": { "line": 63, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_0": { "4.0": { "line": 53, "col": 4 }, "4.1": { "line": 56, "col": 18 }, "4.2.0": { "line": 56, "col": 4 }, "4.2.1": { "line": 57, "col": 6 }, "4.2.2": { "line": 58, "col": 25 }, "4.2.3.0": { "line": 58, "col": 11 }, "4.2.3.1": { "line": 59, "col": 6 }, "4.2.3": { "line": 58, "col": 11 }, "4.2": { "line": 56, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:main": { "2": { "line": 73, "col": 2 }, "3": { "line": 81, "col": 2 }, "4": { "line": 84, "col": 2 }, "6": { "line": 91, "col": 2 }, "7": { "line": 95, "col": 2 }, "8": { "line": 101, "col": 63 }, "9": { "line": 101, "col": 2 }, "10": { "line": 102, "col": 2 }, "11": { "line": 103, "col": 2 }, "12": { "line": 109, "col": 2 }, "13": { "line": 114, "col": 2 }, "14": { "line": 115, "col": 2 }, "15": { "line": 116, "col": 2 }, "16": { "line": 120, "col": 2 }, "17": { "line": 121, "col": 2 }, "18": { "line": 124, "col": 15 }, "19": { "line": 124, "col": 2 }, "20": { "line": 127, "col": 2 }, "21": { "line": 128, "col": 2 }, "22": { "line": 129, "col": 2 }, "23": { "line": 130, "col": 2 }, "25": { "line": 144, "col": 39 }, "26": { "line": 144, "col": 2 }, "27": { "line": 145, "col": 2 }, "28": { "line": 152, "col": 2 }, "30": { "line": 156, "col": 15 }, "31": { "line": 156, "col": 2 }, "32": { "line": 158, "col": 23 }, "33": { "line": 158, "col": 2 }, "34": { "line": 159, "col": 18 }, "35": { "line": 159, "col": 2 }, "37": { "line": 161, "col": 2 }, "38": { "line": 162, "col": 2 }, "40": { "line": 170, "col": 2 }, "41": { "line": 171, "col": 2 }, "42": { "line": 175, "col": 2 }, "43": { "line": 181, "col": 14 }, "44": { "line": 181, "col": 2 }, "45": { "line": 187, "col": 2 }, "47": { "line": 199, "col": 2 }, "48": { "line": 208, "col": 2 }, "3.0": { "line": 82, "col": 4 }, "4.0": { "line": 85, "col": 4 }, "6.0": { "line": 92, "col": 4 }, "6.1": { "line": 93, "col": 4 }, "11.0": { "line": 104, "col": 22 }, "11.2": { "line": 104, "col": 4 }, "11.3": { "line": 105, "col": 10 }, "11.4": { "line": 105, "col": 4 }, "11.5": { "line": 106, "col": 4 }, "11.6": { "line": 107, "col": 4 }, "23.0": { "line": 131, "col": 4 }, "23.1": { "line": 133, "col": 6 }, "23.2": { "line": 132, "col": 4 }, "23.3": { "line": 137, "col": 4 }, "23.4": { "line": 138, "col": 4 }, "23.5": { "line": 140, "col": 4 }, "38.0": { "line": 163, "col": 4 }, "41.0": { "line": 172, "col": 10 }, "41.1": { "line": 172, "col": 4 }, "41.2": { "line": 173, "col": 4 }, "42.0": { "line": 176, "col": 4 }, "45.0": { "line": 189, "col": 6 }, "45.1": { "line": 188, "col": 4 }, "45.2": { "line": 193, "col": 4 }, "47.0": { "line": 200, "col": 4 }, "47.1": { "line": 201, "col": 20 }, "47.2": { "line": 201, "col": 4 }, "47.3": { "line": 203, "col": 6 }, "47.4": { "line": 202, "col": 4 }, "48.0": { "line": 209, "col": 4 }, "48.1.0": { "line": 211, "col": 6 }, "48.1.1.0": { "line": 213, "col": 8 }, "48.1.1": { "line": 212, "col": 6 }, "48.1.2": { "line": 215, "col": 6 }, "48.1": { "line": 210, "col": 4 }, "48.2": { "line": 217, "col": 10 }, "48.3": { "line": 217, "col": 4 }, "48.5": { "line": 218, "col": 28 }, "48.6": { "line": 218, "col": 4 }, "48.7": { "line": 219, "col": 10 }, "48.8": { "line": 219, "col": 4 }, "48.9": { "line": 221, "col": 4 }, "48.10": { "line": 222, "col": 4 }, "48.11": { "line": 223, "col": 10 }, "48.12": { "line": 223, "col": 4 }, "48.13": { "line": 224, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_1": {}, "dist/lib/agents/agency-agent/agent.agency:__block_2": { "48.13.0": { "line": 225, "col": 6 } } };
1831
1894
  export {
1832
1895
  __getCheckpoints,
1833
1896
  __invokeFunction,
@@ -4,7 +4,6 @@ import { fileURLToPath } from "url";
4
4
  import __process from "process";
5
5
  import { readFileSync } from "fs";
6
6
  import { z } from "agency-lang/zod";
7
- import { nanoid } from "agency-lang";
8
7
  import path from "path";
9
8
  import {
10
9
  RuntimeContext,
@@ -38,9 +37,9 @@ const __dirname = path.dirname(__filename);
38
37
  const __cwd = __process.cwd();
39
38
  const __globalCtx = new RuntimeContext({
40
39
  statelogConfig: {
41
- host: "https://statelog.adit.io",
40
+ host: "",
42
41
  apiKey: __process.env["STATELOG_API_KEY"] || "",
43
- projectId: "agency-lang",
42
+ projectId: "",
44
43
  debugMode: false,
45
44
  observability: true,
46
45
  logFile: "log.jsonl"
@@ -61,12 +60,6 @@ const __globalCtx = new RuntimeContext({
61
60
  },
62
61
  model: "gpt-5-mini",
63
62
  logLevel: "warn",
64
- statelog: {
65
- host: "https://statelog.adit.io",
66
- projectId: "smoltalk",
67
- apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
68
- traceId: nanoid()
69
- },
70
63
  provider: "openai-responses"
71
64
  },
72
65
  dirname: __dirname,
@@ -134,7 +127,7 @@ function registerTools(tools) {
134
127
  }
135
128
  }
136
129
  }
137
- __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/brain.agency", "93a5849e53c1d4a0b51490cdd82e65eb99d6de0b1ea8579aa7520c79ccb1619d", import.meta.url);
130
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/brain.agency", "f850503efd59330865cd732ce0432b920066dfb9efe146d616d8e4ee95e3fbc2", import.meta.url);
138
131
  __registerTool(print);
139
132
  __registerTool(printJSON);
140
133
  __registerTool(input);
@@ -4,6 +4,7 @@
4
4
  and lib/) owns the CLI, the REPL, the policy handler, and the per-turn
5
5
  guard; this module only answers turns.
6
6
  */
7
+ import { _exit } from "agency-lang/stdlib-lib/system.js"
7
8
  import { question } from "std::agent"
8
9
  import { readOnlyFileTools, whatIAmDoing } from "std::agents/lib/toolkits"
9
10
  import { now, elapsedTime } from "std::date"
@@ -80,7 +81,7 @@ def exitIfBroken(checked: Result<boolean>) {
80
81
  match(checked) {
81
82
  failure(reason) => {
82
83
  print(color.red("Agent setup failed: ${reason}"))
83
- process.exit(1)
84
+ _exit(1)
84
85
  }
85
86
  _ => null
86
87
  }
@@ -91,13 +92,13 @@ def coordinatorInit(context: BrainContext) {
91
92
  print(
92
93
  color.red("Failed to read prompts/main-large.md: ${MAIN_PROMPT_LARGE.error}"),
93
94
  )
94
- process.exit(1)
95
+ _exit(1)
95
96
  }
96
97
  if (isFailure(MAIN_PROMPT_SMALL)) {
97
98
  print(
98
99
  color.red("Failed to read prompts/main-small.md: ${MAIN_PROMPT_SMALL.error}"),
99
100
  )
100
- process.exit(1)
101
+ _exit(1)
101
102
  }
102
103
  exitIfBroken(checkBundledSkill(superpowersSkill, "brainstorming"))
103
104
  exitIfBroken(checkBundledSkill(coordinatorSkills, "presets"))
@@ -1,4 +1,5 @@
1
1
  import { print, printJSON, input, sleep, saveDraft, _guard, _pairsOf, read, write, writeBinary, readBinary, range, callback, map, mapWithIndex, filter, exclude, find, findIndex, reduce, flatMap, every, some, count, sortBy, unique, groupBy, flatten, setAgentCwd, getAgentCwd, applyAgentCwd } from "agency-lang/stdlib/index.js";
2
+ import { _exit } from "agency-lang/stdlib-lib/system.js";
2
3
  import { question } from "agency-lang/stdlib/agent.js";
3
4
  import { readOnlyFileTools, whatIAmDoing } from "agency-lang/stdlib/agents/lib/toolkits.js";
4
5
  import { now, elapsedTime } from "agency-lang/stdlib/date.js";
@@ -25,7 +26,7 @@ import { fileURLToPath } from "url";
25
26
  import __process from "process";
26
27
  import { readFileSync } from "fs";
27
28
  import { z } from "agency-lang/zod";
28
- import { color, nanoid } from "agency-lang";
29
+ import { color } from "agency-lang";
29
30
  import path from "path";
30
31
  import {
31
32
  RuntimeContext,
@@ -89,9 +90,9 @@ const __dirname = path.dirname(__filename);
89
90
  const __cwd = __process.cwd();
90
91
  const __globalCtx = new RuntimeContext({
91
92
  statelogConfig: {
92
- host: "https://statelog.adit.io",
93
+ host: "",
93
94
  apiKey: __process.env["STATELOG_API_KEY"] || "",
94
- projectId: "agency-lang",
95
+ projectId: "",
95
96
  debugMode: false,
96
97
  observability: true,
97
98
  logFile: "log.jsonl"
@@ -112,12 +113,6 @@ const __globalCtx = new RuntimeContext({
112
113
  },
113
114
  model: "gpt-5-mini",
114
115
  logLevel: "warn",
115
- statelog: {
116
- host: "https://statelog.adit.io",
117
- projectId: "smoltalk",
118
- apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
119
- traceId: nanoid()
120
- },
121
116
  provider: "openai-responses"
122
117
  },
123
118
  dirname: __dirname,
@@ -185,7 +180,7 @@ function registerTools(tools) {
185
180
  }
186
181
  }
187
182
  }
188
- __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency", "637cbc310ff860e34bf311e1ea3d6b81eeea5234db92e0dbd3f114ce77a97de6", import.meta.url);
183
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency", "ec89d4fb1d13e15744ab11e0b181a3ba16b0be2190d3b4ae6ed670bfbe5d1bc2", import.meta.url);
189
184
  __registerTool(print);
190
185
  __registerTool(printJSON);
191
186
  __registerTool(input);
@@ -418,10 +413,19 @@ async function __exitIfBroken_impl(checked) {
418
413
  }
419
414
  });
420
415
  await runner2.step(3, async (runner3) => {
421
- await __callMethod(process, "exit", {
416
+ const __funcResult = await __call(_exit, {
422
417
  type: "positional",
423
418
  args: [1]
424
419
  });
420
+ if (hasInterrupts(__funcResult)) {
421
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
422
+ runner3.halt(__funcResult);
423
+ return;
424
+ }
425
+ if (isAborted(__funcResult)) {
426
+ runner3.halt(__funcResult.carryThrough(__stack, "exitIfBroken"));
427
+ return;
428
+ }
425
429
  });
426
430
  }
427
431
  },
@@ -580,10 +584,19 @@ async function __coordinatorInit_impl(context) {
580
584
  }
581
585
  });
582
586
  await runner2.step(2, async (runner3) => {
583
- await __callMethod(process, "exit", {
587
+ const __funcResult = await __call(_exit, {
584
588
  type: "positional",
585
589
  args: [1]
586
590
  });
591
+ if (hasInterrupts(__funcResult)) {
592
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
593
+ runner3.halt(__funcResult);
594
+ return;
595
+ }
596
+ if (isAborted(__funcResult)) {
597
+ runner3.halt(__funcResult.carryThrough(__stack, "coordinatorInit"));
598
+ return;
599
+ }
587
600
  });
588
601
  }
589
602
  }
@@ -626,10 +639,19 @@ async function __coordinatorInit_impl(context) {
626
639
  }
627
640
  });
628
641
  await runner2.step(2, async (runner3) => {
629
- await __callMethod(process, "exit", {
642
+ const __funcResult = await __call(_exit, {
630
643
  type: "positional",
631
644
  args: [1]
632
645
  });
646
+ if (hasInterrupts(__funcResult)) {
647
+ await getRuntimeContext().ctx.pendingPromises.awaitAll();
648
+ runner3.halt(__funcResult);
649
+ return;
650
+ }
651
+ if (isAborted(__funcResult)) {
652
+ runner3.halt(__funcResult.carryThrough(__stack, "coordinatorInit"));
653
+ return;
654
+ }
633
655
  });
634
656
  }
635
657
  }
@@ -2484,7 +2506,7 @@ const coordinatorBrain = __AgencyFunction.create({
2484
2506
  exported: true
2485
2507
  }, __toolRegistry);
2486
2508
  var stdin_default = graph;
2487
- const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:exitIfBroken": { "1": { "line": 79, "col": 2 }, "2": { "line": 80, "col": 4 }, "3": { "line": 79, "col": 2 }, "3.0": { "line": 79, "col": 2 }, "3.1": { "line": 81, "col": 12 }, "3.2": { "line": 81, "col": 6 }, "3.3": { "line": 82, "col": 6 }, "3.4": { "line": 84, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorInit": { "1": { "line": 89, "col": 6 }, "2": { "line": 89, "col": 2 }, "3": { "line": 95, "col": 6 }, "4": { "line": 95, "col": 2 }, "5": { "line": 101, "col": 15 }, "6": { "line": 101, "col": 2 }, "7": { "line": 102, "col": 15 }, "8": { "line": 102, "col": 2 }, "9": { "line": 103, "col": 2 }, "10": { "line": 104, "col": 2 }, "11": { "line": 107, "col": 2 }, "2.0": { "line": 91, "col": 6 }, "2.1": { "line": 90, "col": 4 }, "2.2": { "line": 93, "col": 4 }, "4.0": { "line": 97, "col": 6 }, "4.1": { "line": 96, "col": 4 }, "4.2": { "line": 99, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:turnTools": { "1": { "line": 116, "col": 7 }, "2": { "line": 117, "col": 7 }, "3": { "line": 120, "col": 4 }, "4": { "line": 114, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:mainAgent": { "2": { "line": 128, "col": 2 }, "3": { "line": 129, "col": 2 }, "4": { "line": 155, "col": 2 }, "3.0": { "line": 130, "col": 4 }, "3.1.1": { "line": 132, "col": 6 }, "3.1.2": { "line": 133, "col": 24 }, "3.1.3": { "line": 133, "col": 6 }, "3.1.4": { "line": 137, "col": 6 }, "3.1.5": { "line": 138, "col": 6 }, "3.1": { "line": 131, "col": 4 }, "3.3": { "line": 146, "col": 13 }, "3.4": { "line": 144, "col": 4 }, "3.5": { "line": 148, "col": 4 }, "3.6.0": { "line": 150, "col": 6 }, "3.6.1": { "line": 151, "col": 6 }, "3.6": { "line": 149, "col": 4 }, "3.7": { "line": 153, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:promptText": { "1": { "line": 161, "col": 9 }, "2": { "line": 161, "col": 9 }, "3": { "line": 161, "col": 2 }, "2.0": { "line": 161, "col": 9 }, "2.1": { "line": 162, "col": 20 }, "2.2": { "line": 162, "col": 20 }, "2.3": { "line": 161, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:replyText": { "1": { "line": 169, "col": 6 }, "2": { "line": 169, "col": 2 }, "3": { "line": 172, "col": 2 }, "2.0": { "line": 170, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:researchTurn": { "1": { "line": 176, "col": 37 }, "2": { "line": 176, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:oracleTurn": { "1": { "line": 184, "col": 2 }, "2": { "line": 185, "col": 2 }, "3": { "line": 188, "col": 2 }, "2.0": { "line": 186, "col": 36 }, "2.1": { "line": 186, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:explorerTurn": { "1": { "line": 192, "col": 2 }, "2": { "line": 193, "col": 2 }, "3": { "line": 196, "col": 2 }, "2.0": { "line": 194, "col": 38 }, "2.1": { "line": 194, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorRunTurn": { "1": { "line": 203, "col": 9 }, "2": { "line": 203, "col": 2 }, "1.0": { "line": 204, "col": 24 }, "1.1": { "line": 204, "col": 14 }, "1.2": { "line": 204, "col": 14 }, "1.3": { "line": 205, "col": 31 }, "1.4": { "line": 205, "col": 18 }, "1.5": { "line": 205, "col": 18 }, "1.6": { "line": 206, "col": 27 }, "1.7": { "line": 206, "col": 16 }, "1.8": { "line": 206, "col": 16 }, "1.9": { "line": 207, "col": 31 }, "1.10": { "line": 207, "col": 18 }, "1.11": { "line": 207, "col": 18 }, "1.12": { "line": 208, "col": 28 }, "1.13": { "line": 208, "col": 16 }, "1.14": { "line": 208, "col": 16 }, "1.15": { "line": 209, "col": 30 }, "1.16": { "line": 209, "col": 17 }, "1.17": { "line": 209, "col": 17 }, "1.18": { "line": 210, "col": 30 }, "1.19": { "line": 210, "col": 17 }, "1.20": { "line": 210, "col": 17 }, "1.21": { "line": 211, "col": 9 }, "1.22": { "line": 211, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorBrain": { "1": { "line": 216, "col": 2 } } };
2509
+ const __sourceMap = { "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:exitIfBroken": { "1": { "line": 80, "col": 2 }, "2": { "line": 81, "col": 4 }, "3": { "line": 80, "col": 2 }, "3.0": { "line": 80, "col": 2 }, "3.1": { "line": 82, "col": 12 }, "3.2": { "line": 82, "col": 6 }, "3.3": { "line": 83, "col": 6 }, "3.4": { "line": 85, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorInit": { "1": { "line": 90, "col": 6 }, "2": { "line": 90, "col": 2 }, "3": { "line": 96, "col": 6 }, "4": { "line": 96, "col": 2 }, "5": { "line": 102, "col": 15 }, "6": { "line": 102, "col": 2 }, "7": { "line": 103, "col": 15 }, "8": { "line": 103, "col": 2 }, "9": { "line": 104, "col": 2 }, "10": { "line": 105, "col": 2 }, "11": { "line": 108, "col": 2 }, "2.0": { "line": 92, "col": 6 }, "2.1": { "line": 91, "col": 4 }, "2.2": { "line": 94, "col": 4 }, "4.0": { "line": 98, "col": 6 }, "4.1": { "line": 97, "col": 4 }, "4.2": { "line": 100, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:turnTools": { "1": { "line": 117, "col": 7 }, "2": { "line": 118, "col": 7 }, "3": { "line": 121, "col": 4 }, "4": { "line": 115, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:mainAgent": { "2": { "line": 129, "col": 2 }, "3": { "line": 130, "col": 2 }, "4": { "line": 156, "col": 2 }, "3.0": { "line": 131, "col": 4 }, "3.1.1": { "line": 133, "col": 6 }, "3.1.2": { "line": 134, "col": 24 }, "3.1.3": { "line": 134, "col": 6 }, "3.1.4": { "line": 138, "col": 6 }, "3.1.5": { "line": 139, "col": 6 }, "3.1": { "line": 132, "col": 4 }, "3.3": { "line": 147, "col": 13 }, "3.4": { "line": 145, "col": 4 }, "3.5": { "line": 149, "col": 4 }, "3.6.0": { "line": 151, "col": 6 }, "3.6.1": { "line": 152, "col": 6 }, "3.6": { "line": 150, "col": 4 }, "3.7": { "line": 154, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:promptText": { "1": { "line": 162, "col": 9 }, "2": { "line": 162, "col": 9 }, "3": { "line": 162, "col": 2 }, "2.0": { "line": 162, "col": 9 }, "2.1": { "line": 163, "col": 20 }, "2.2": { "line": 163, "col": 20 }, "2.3": { "line": 162, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:replyText": { "1": { "line": 170, "col": 6 }, "2": { "line": 170, "col": 2 }, "3": { "line": 173, "col": 2 }, "2.0": { "line": 171, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:researchTurn": { "1": { "line": 177, "col": 37 }, "2": { "line": 177, "col": 2 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:oracleTurn": { "1": { "line": 185, "col": 2 }, "2": { "line": 186, "col": 2 }, "3": { "line": 189, "col": 2 }, "2.0": { "line": 187, "col": 36 }, "2.1": { "line": 187, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:explorerTurn": { "1": { "line": 193, "col": 2 }, "2": { "line": 194, "col": 2 }, "3": { "line": 197, "col": 2 }, "2.0": { "line": 195, "col": 38 }, "2.1": { "line": 195, "col": 4 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorRunTurn": { "1": { "line": 204, "col": 9 }, "2": { "line": 204, "col": 2 }, "1.0": { "line": 205, "col": 24 }, "1.1": { "line": 205, "col": 14 }, "1.2": { "line": 205, "col": 14 }, "1.3": { "line": 206, "col": 31 }, "1.4": { "line": 206, "col": 18 }, "1.5": { "line": 206, "col": 18 }, "1.6": { "line": 207, "col": 27 }, "1.7": { "line": 207, "col": 16 }, "1.8": { "line": 207, "col": 16 }, "1.9": { "line": 208, "col": 31 }, "1.10": { "line": 208, "col": 18 }, "1.11": { "line": 208, "col": 18 }, "1.12": { "line": 209, "col": 28 }, "1.13": { "line": 209, "col": 16 }, "1.14": { "line": 209, "col": 16 }, "1.15": { "line": 210, "col": 30 }, "1.16": { "line": 210, "col": 17 }, "1.17": { "line": 210, "col": 17 }, "1.18": { "line": 211, "col": 30 }, "1.19": { "line": 211, "col": 17 }, "1.20": { "line": 211, "col": 17 }, "1.21": { "line": 212, "col": 9 }, "1.22": { "line": 212, "col": 9 } }, "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency:coordinatorBrain": { "1": { "line": 217, "col": 2 } } };
2488
2510
  export {
2489
2511
  __getCheckpoints,
2490
2512
  __invokeFunction,
@@ -6,7 +6,6 @@ import { fileURLToPath } from "url";
6
6
  import __process from "process";
7
7
  import { readFileSync } from "fs";
8
8
  import { z } from "agency-lang/zod";
9
- import { nanoid } from "agency-lang";
10
9
  import path from "path";
11
10
  import {
12
11
  RuntimeContext,
@@ -58,9 +57,9 @@ const __dirname = path.dirname(__filename);
58
57
  const __cwd = __process.cwd();
59
58
  const __globalCtx = new RuntimeContext({
60
59
  statelogConfig: {
61
- host: "https://statelog.adit.io",
60
+ host: "",
62
61
  apiKey: __process.env["STATELOG_API_KEY"] || "",
63
- projectId: "agency-lang",
62
+ projectId: "",
64
63
  debugMode: false,
65
64
  observability: true,
66
65
  logFile: "log.jsonl"
@@ -81,12 +80,6 @@ const __globalCtx = new RuntimeContext({
81
80
  },
82
81
  model: "gpt-5-mini",
83
82
  logLevel: "warn",
84
- statelog: {
85
- host: "https://statelog.adit.io",
86
- projectId: "smoltalk",
87
- apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
88
- traceId: nanoid()
89
- },
90
83
  provider: "openai-responses"
91
84
  },
92
85
  dirname: __dirname,
@@ -154,7 +147,7 @@ function registerTools(tools) {
154
147
  }
155
148
  }
156
149
  }
157
- __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/learn.agency", "fc4168c2349369ee75d89a4b09c4d06e321b25f1a4f0ebb9a3f57443c0ce713d", import.meta.url);
150
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/learn.agency", "956b96a64247e6ff163e4d72789eccca665f55014e5433800968226bee6350c5", import.meta.url);
158
151
  __registerTool(print);
159
152
  __registerTool(printJSON);
160
153
  __registerTool(input);
@@ -3,7 +3,7 @@ import { fileURLToPath } from "url";
3
3
  import __process from "process";
4
4
  import { readFileSync } from "fs";
5
5
  import { z } from "agency-lang/zod";
6
- import { color, nanoid } from "agency-lang";
6
+ import { color } from "agency-lang";
7
7
  import path from "path";
8
8
  import {
9
9
  RuntimeContext,
@@ -56,9 +56,9 @@ const __dirname = path.dirname(__filename);
56
56
  const __cwd = __process.cwd();
57
57
  const __globalCtx = new RuntimeContext({
58
58
  statelogConfig: {
59
- host: "https://statelog.adit.io",
59
+ host: "",
60
60
  apiKey: __process.env["STATELOG_API_KEY"] || "",
61
- projectId: "agency-lang",
61
+ projectId: "",
62
62
  debugMode: false,
63
63
  observability: true,
64
64
  logFile: "log.jsonl"
@@ -79,12 +79,6 @@ const __globalCtx = new RuntimeContext({
79
79
  },
80
80
  model: "gpt-5-mini",
81
81
  logLevel: "warn",
82
- statelog: {
83
- host: "https://statelog.adit.io",
84
- projectId: "smoltalk",
85
- apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
86
- traceId: nanoid()
87
- },
88
82
  provider: "openai-responses"
89
83
  },
90
84
  dirname: __dirname,
@@ -152,7 +146,7 @@ function registerTools(tools) {
152
146
  }
153
147
  }
154
148
  }
155
- __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/lib/announce.agency", "45ead7baa72e6119d56338642a70383c73e8c59adf3ed806111bc3b10feb0355", import.meta.url);
149
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/lib/announce.agency", "cd6a72485d86c98033ad66ef56a70f1b49148fca422a9bd227d6820995c04a51", import.meta.url);
156
150
  __registerTool(print);
157
151
  __registerTool(printJSON);
158
152
  __registerTool(input);
@@ -4,7 +4,6 @@ import { fileURLToPath } from "url";
4
4
  import __process from "process";
5
5
  import { readFileSync } from "fs";
6
6
  import { z } from "agency-lang/zod";
7
- import { nanoid } from "agency-lang";
8
7
  import path from "path";
9
8
  import {
10
9
  RuntimeContext,
@@ -58,9 +57,9 @@ const __dirname = path.dirname(__filename);
58
57
  const __cwd = __process.cwd();
59
58
  const __globalCtx = new RuntimeContext({
60
59
  statelogConfig: {
61
- host: "https://statelog.adit.io",
60
+ host: "",
62
61
  apiKey: __process.env["STATELOG_API_KEY"] || "",
63
- projectId: "agency-lang",
62
+ projectId: "",
64
63
  debugMode: false,
65
64
  observability: true,
66
65
  logFile: "log.jsonl"
@@ -81,12 +80,6 @@ const __globalCtx = new RuntimeContext({
81
80
  },
82
81
  model: "gpt-5-mini",
83
82
  logLevel: "warn",
84
- statelog: {
85
- host: "https://statelog.adit.io",
86
- projectId: "smoltalk",
87
- apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
88
- traceId: nanoid()
89
- },
90
83
  provider: "openai-responses"
91
84
  },
92
85
  dirname: __dirname,
@@ -154,7 +147,7 @@ function registerTools(tools) {
154
147
  }
155
148
  }
156
149
  }
157
- __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/lib/budgets.agency", "dd27d4e36a454596242dd97ab056d4a68f8556df4bbb7b565f8cc96e952fecee", import.meta.url);
150
+ __registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/lib/budgets.agency", "6c6292ef20aa720caa71d9be82fb61cc1c65dba9c3d8b572a737fa3ceac33597", import.meta.url);
158
151
  __registerTool(print);
159
152
  __registerTool(printJSON);
160
153
  __registerTool(input);