agency-lang 0.24.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.
- package/dist/lib/agents/agency-agent/agent.agency +14 -9
- package/dist/lib/agents/agency-agent/agent.js +122 -54
- package/dist/lib/agents/agency-agent/brains/brain.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency +4 -3
- package/dist/lib/agents/agency-agent/brains/coordinator/coordinator.js +41 -19
- package/dist/lib/agents/agency-agent/brains/coordinator/learn.js +5 -12
- package/dist/lib/agents/agency-agent/brains/coordinator/lib/announce.js +4 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/lib/budgets.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/lib/bundledSkills.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/presetTools.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/prompts/codeSample.js +7 -11
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/brainstorm.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.js +11 -18
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/explorer.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency +0 -1
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.js +5 -13
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.js +6 -13
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.js +4 -11
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/rewrite.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/supervisor.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/writing.js +3 -10
- package/dist/lib/agents/agency-agent/brains/registry.js +3 -10
- package/dist/lib/agents/agency-agent/brains/simple/simple.js +3 -10
- package/dist/lib/agents/agency-agent/images/images.js +3 -10
- package/dist/lib/agents/agency-agent/lib/agentName.js +3 -10
- package/dist/lib/agents/agency-agent/lib/agentSource.js +3 -10
- package/dist/lib/agents/agency-agent/lib/args.js +3 -10
- package/dist/lib/agents/agency-agent/lib/attachments.js +3 -10
- package/dist/lib/agents/agency-agent/lib/budget.js +4 -10
- package/dist/lib/agents/agency-agent/lib/capabilities.js +3 -10
- package/dist/lib/agents/agency-agent/lib/capabilitiesUi.js +6 -12
- package/dist/lib/agents/agency-agent/lib/commandPalette.js +3 -10
- package/dist/lib/agents/agency-agent/lib/config.js +3 -10
- package/dist/lib/agents/agency-agent/lib/effort.js +3 -10
- package/dist/lib/agents/agency-agent/lib/grounding.js +3 -10
- package/dist/lib/agents/agency-agent/lib/header.agency +2 -0
- package/dist/lib/agents/agency-agent/lib/header.js +15 -12
- package/dist/lib/agents/agency-agent/lib/images.js +3 -10
- package/dist/lib/agents/agency-agent/lib/learned.js +6 -13
- package/dist/lib/agents/agency-agent/lib/mcp.js +4 -10
- package/dist/lib/agents/agency-agent/lib/modelFilters.js +3 -10
- package/dist/lib/agents/agency-agent/lib/modelRequest.js +5 -12
- package/dist/lib/agents/agency-agent/lib/models.js +3 -10
- package/dist/lib/agents/agency-agent/{brains/coordinator/subagents/announce.js → lib/outputCap.js} +142 -91
- package/dist/lib/agents/agency-agent/lib/policy.agency +4 -3
- package/dist/lib/agents/agency-agent/lib/policy.js +49 -27
- package/dist/lib/agents/agency-agent/lib/presetRules.js +3 -10
- package/dist/lib/agents/agency-agent/lib/presets.agency +2 -1
- package/dist/lib/agents/agency-agent/lib/presets.js +22 -18
- package/dist/lib/agents/agency-agent/lib/projectContext.js +3 -10
- package/dist/lib/agents/agency-agent/lib/repl.js +6 -12
- package/dist/lib/agents/agency-agent/lib/resolution.js +4 -11
- package/dist/lib/agents/agency-agent/lib/resume.agency +3 -2
- package/dist/lib/agents/agency-agent/lib/resume.js +26 -13
- package/dist/lib/agents/agency-agent/lib/search.js +5 -12
- package/dist/lib/agents/agency-agent/lib/session.agency +6 -5
- package/dist/lib/agents/agency-agent/lib/session.js +58 -18
- package/dist/lib/agents/agency-agent/lib/sessionTitle.js +3 -10
- package/dist/lib/agents/agency-agent/lib/sessions.js +4 -11
- package/dist/lib/agents/agency-agent/lib/settings.js +14 -21
- package/dist/lib/agents/agency-agent/lib/slashCommands/policy.js +6 -12
- package/dist/lib/agents/agency-agent/lib/slots.js +3 -10
- package/dist/lib/agents/agency-agent/lib/toolLimits.js +4 -11
- package/dist/lib/agents/agency-agent/lib/trace.js +4 -10
- package/dist/lib/agents/agency-agent/lib/transcript.js +4 -10
- package/dist/lib/agents/agency-agent/lib/turn.js +5 -11
- package/dist/lib/agents/agency-agent/lib/utils/renderLLMCallResponse.js +3 -10
- package/dist/lib/agents/agency-agent/lib/utils.js +3 -10
- package/dist/lib/agents/agency-agent/shared.agency +4 -3
- package/dist/lib/agents/agency-agent/shared.js +37 -16
- package/dist/lib/agents/eval/goalJudge.js +6 -11
- package/dist/lib/agents/eval/judge.js +6 -11
- package/dist/lib/agents/eval/judgePairwise.js +6 -11
- package/dist/lib/agents/eval/rubricJudge.js +6 -11
- package/dist/lib/agents/optimize/gepaReflect.js +6 -11
- package/dist/lib/agents/optimize/mutatePrompt.js +6 -11
- package/dist/lib/agents/policy/agent.js +6 -11
- package/dist/lib/agents/review/agent.js +7 -11
- package/dist/lib/backends/typescriptBuilder.js +18 -13
- package/dist/lib/cli/diffusersImageRules.py +1168 -0
- package/dist/lib/cli/diffusersImageServer.py +522 -0
- package/dist/lib/cli/imageTools.py +113 -0
- package/dist/lib/cli/imageToolsRules.py +58 -0
- package/dist/lib/cli/local.d.ts +6 -3
- package/dist/lib/cli/local.js +27 -9
- package/dist/lib/cli/localFlag.js +6 -2
- package/dist/lib/cli/localServe.d.ts +107 -20
- package/dist/lib/cli/localServe.js +445 -123
- package/dist/lib/cli/localServerCommon.py +62 -0
- package/dist/lib/cli/mlxServer.js +21 -7
- package/dist/lib/cli/mlxSpeechServer.py +1 -21
- package/dist/lib/cli/remote/commands/call.js +1 -1
- package/dist/lib/cli/serve.js +6 -2
- package/dist/lib/cli/serveLog.d.ts +26 -3
- package/dist/lib/cli/serveLog.js +74 -5
- package/dist/lib/cli/statelog/spendTypes.d.ts +8 -8
- package/dist/lib/cli/testReport.d.ts +3 -3
- package/dist/lib/cli/visionRules.py +271 -0
- package/dist/lib/cli/visionServer.py +344 -0
- package/dist/lib/config/config.d.ts +39 -2
- package/dist/lib/config/config.js +24 -4
- package/dist/lib/runtime/asyncContext.d.ts +9 -0
- package/dist/lib/runtime/budgetExit.d.ts +1 -1
- package/dist/lib/runtime/budgetExit.js +3 -2
- package/dist/lib/runtime/cliEntry.js +3 -1
- package/dist/lib/runtime/cliInterruptResolution.js +1 -1
- package/dist/lib/runtime/exitProcess.d.ts +15 -0
- package/dist/lib/runtime/exitProcess.js +23 -0
- package/dist/lib/runtime/handoff.d.ts +168 -6
- package/dist/lib/runtime/handoff.js +277 -13
- package/dist/lib/runtime/index.d.ts +2 -0
- package/dist/lib/runtime/index.js +2 -0
- package/dist/lib/runtime/interrupts.d.ts +1 -1
- package/dist/lib/runtime/interrupts.js +4 -3
- package/dist/lib/runtime/node.js +10 -17
- package/dist/lib/runtime/policyFlags.d.ts +6 -0
- package/dist/lib/runtime/policyFlags.js +8 -0
- package/dist/lib/runtime/prompt.d.ts +2 -66
- package/dist/lib/runtime/prompt.js +466 -571
- package/dist/lib/runtime/providerModules.js +3 -0
- package/dist/lib/runtime/replyAttachments.d.ts +3 -0
- package/dist/lib/runtime/replyAttachments.js +3 -1
- package/dist/lib/runtime/resumableScope.js +1 -0
- package/dist/lib/runtime/runBatch.js +1 -0
- package/dist/lib/runtime/runner.js +1 -0
- package/dist/lib/runtime/state/stateStack.d.ts +22 -0
- package/dist/lib/runtime/state/stateStack.js +31 -0
- package/dist/lib/runtime/subprocess-bootstrap.js +16 -12
- package/dist/lib/runtime/toolInvocation.d.ts +109 -0
- package/dist/lib/runtime/toolInvocation.js +181 -0
- package/dist/lib/runtime/toolLoopGuards.d.ts +43 -1
- package/dist/lib/runtime/toolLoopGuards.js +77 -4
- package/dist/lib/runtime/turnBoundary.d.ts +8 -0
- package/dist/lib/runtime/turnBoundary.js +19 -0
- package/dist/lib/serve/http/adapter.d.ts +1 -1
- package/dist/lib/serve/http/adapter.js +3 -0
- package/dist/lib/serve/mcp/adapter.d.ts +1 -1
- package/dist/lib/serve/mcp/adapter.js +6 -1
- package/dist/lib/serve/mcp/httpTransport.d.ts +1 -0
- package/dist/lib/serve/mcp/httpTransport.js +3 -0
- package/dist/lib/serve/shutdown.d.ts +13 -0
- package/dist/lib/serve/shutdown.js +24 -0
- package/dist/lib/serve/util.d.ts +9 -1
- package/dist/lib/serve/util.js +15 -3
- package/dist/lib/statelogClient.d.ts +1 -9
- package/dist/lib/statelogClient.js +14 -48
- package/dist/lib/statelogSender.d.ts +29 -0
- package/dist/lib/statelogSender.js +54 -0
- package/dist/lib/stdlib/approvedPath.d.ts +6 -0
- package/dist/lib/stdlib/approvedPath.js +28 -10
- package/dist/lib/stdlib/args.js +7 -3
- package/dist/lib/stdlib/cli.js +3 -1
- package/dist/lib/stdlib/diffusersFiles.d.ts +19 -0
- package/dist/lib/stdlib/diffusersFiles.js +52 -0
- package/dist/lib/stdlib/hubClient.d.ts +4 -0
- package/dist/lib/stdlib/hubClient.js +22 -0
- package/dist/lib/stdlib/image.d.ts +26 -1
- package/dist/lib/stdlib/image.js +192 -28
- package/dist/lib/stdlib/imageTools.d.ts +25 -0
- package/dist/lib/stdlib/imageTools.js +138 -0
- package/dist/lib/stdlib/localImageInputs.d.ts +76 -0
- package/dist/lib/stdlib/localImageInputs.js +185 -0
- package/dist/lib/stdlib/localModelList.d.ts +31 -0
- package/dist/lib/stdlib/localModelList.js +190 -0
- package/dist/lib/stdlib/localModels.d.ts +67 -52
- package/dist/lib/stdlib/localModels.js +323 -248
- package/dist/lib/stdlib/localPython.d.ts +17 -0
- package/dist/lib/stdlib/localPython.js +34 -0
- package/dist/lib/stdlib/mlxImage.d.ts +24 -0
- package/dist/lib/stdlib/mlxImage.js +164 -0
- package/dist/lib/stdlib/mlxModelRecord.d.ts +11 -1
- package/dist/lib/stdlib/mlxModelRecord.js +21 -3
- package/dist/lib/stdlib/mlxServerModels.d.ts +4 -0
- package/dist/lib/stdlib/mlxServerModels.js +6 -0
- package/dist/lib/stdlib/modelBackend.d.ts +37 -2
- package/dist/lib/stdlib/modelBackend.js +149 -21
- package/dist/lib/stdlib/modelCatalog.d.ts +16 -7
- package/dist/lib/stdlib/modelCatalog.js +191 -46
- package/dist/lib/stdlib/modelKind.d.ts +24 -0
- package/dist/lib/stdlib/modelKind.js +85 -0
- package/dist/lib/stdlib/speech.js +5 -7
- package/dist/lib/stdlib/system.d.ts +1 -1
- package/dist/lib/stdlib/system.js +3 -2
- package/dist/lib/stdlib/thread.d.ts +10 -1
- package/dist/lib/stdlib/thread.js +34 -0
- package/dist/lib/stdlib/ui-region.js +4 -2
- package/dist/lib/stdlib/ui.js +4 -2
- package/dist/lib/stdlib/vision.d.ts +18 -0
- package/dist/lib/stdlib/vision.js +116 -0
- package/dist/lib/stdlib/visionFiles.d.ts +9 -0
- package/dist/lib/stdlib/visionFiles.js +20 -0
- package/dist/lib/templates/backends/typescriptGenerator/imports.d.ts +1 -1
- package/dist/lib/templates/backends/typescriptGenerator/imports.js +1 -1
- package/dist/lib/templates/cli/standaloneHttp.d.ts +1 -1
- package/dist/lib/templates/cli/standaloneHttp.js +3 -2
- package/dist/lib/templates/cli/standaloneMcp.d.ts +1 -1
- package/dist/lib/templates/cli/standaloneMcp.js +2 -1
- package/dist/lib/templates/cli/standaloneMcpHttp.d.ts +1 -1
- package/dist/lib/templates/cli/standaloneMcpHttp.js +3 -2
- package/dist/scripts/agency.js +27 -20
- package/package.json +1 -1
- package/stdlib/agency/eval.js +3 -10
- package/stdlib/agency/local.agency +5 -3
- package/stdlib/agency/local.js +8 -14
- package/stdlib/agency.js +3 -10
- package/stdlib/agent.js +3 -10
- package/stdlib/agents/agency/coding.js +6 -11
- package/stdlib/agents/agency/expert.js +3 -10
- package/stdlib/agents/agency/researcher.js +3 -10
- package/stdlib/agents/agency/review.js +6 -11
- package/stdlib/agents/agency/verifier.js +3 -10
- package/stdlib/agents/coding.js +3 -10
- package/stdlib/agents/composable/promptRewriter.js +3 -10
- package/stdlib/agents/composable/researcher.js +3 -10
- package/stdlib/agents/composable/utils.js +3 -10
- package/stdlib/agents/data.js +3 -10
- package/stdlib/agents/expert.js +3 -10
- package/stdlib/agents/explorer.js +3 -10
- package/stdlib/agents/lib/expertGuidance.js +3 -10
- package/stdlib/agents/lib/feedback.js +3 -10
- package/stdlib/agents/lib/search.js +3 -10
- package/stdlib/agents/lib/shared.js +3 -10
- package/stdlib/agents/lib/toolkits.js +3 -10
- package/stdlib/agents/oracle.js +3 -10
- package/stdlib/agents/planner.js +3 -10
- package/stdlib/agents/researcher.js +6 -11
- package/stdlib/agents/review.js +3 -10
- package/stdlib/agents/typescript/review.js +6 -11
- package/stdlib/agents/verifier.js +3 -10
- package/stdlib/agents/writing/review.js +6 -11
- package/stdlib/agents/writing/rewrite.js +6 -11
- package/stdlib/args.js +3 -10
- package/stdlib/array.js +3 -10
- package/stdlib/auth/keyring.js +3 -10
- package/stdlib/auth/oauth.js +3 -10
- package/stdlib/aws/s3.js +3 -10
- package/stdlib/calendar.js +3 -10
- package/stdlib/capabilities.agency +3 -3
- package/stdlib/capabilities.js +6 -13
- package/stdlib/clipboard.js +3 -10
- package/stdlib/concurrency.js +3 -10
- package/stdlib/data/connector.js +3 -10
- package/stdlib/data/finance/dbnomics.js +3 -10
- package/stdlib/data/finance/edgar.js +3 -10
- package/stdlib/data/finance/fred.js +3 -10
- package/stdlib/data/news/gdelt.js +3 -10
- package/stdlib/data/people/littlesis.js +3 -10
- package/stdlib/data/social/bluesky.js +3 -10
- package/stdlib/data/tech/hackernews.js +3 -10
- package/stdlib/data/tech/yc.js +3 -10
- package/stdlib/data/usaspending.js +3 -10
- package/stdlib/data/wikidata.js +3 -10
- package/stdlib/date.js +3 -10
- package/stdlib/docs/cli/local.md +67 -9
- package/stdlib/docs/cli/policy.md +4 -0
- package/stdlib/docs/guide/agency-config-file.md +2 -0
- package/stdlib/docs/guide/functions.md +71 -0
- package/stdlib/docs/guide/image-generation.md +780 -62
- package/stdlib/docs/guide/observability.md +54 -1
- package/stdlib/docs/guide/policies.md +1 -1
- package/stdlib/docs/guide/using-local-models.md +131 -4
- package/stdlib/docs/stdlib/agency/local.md +23 -21
- package/stdlib/docs/stdlib/capabilities.md +3 -3
- package/stdlib/docs/stdlib/image.md +311 -10
- package/stdlib/docs/stdlib/system.md +1 -1
- package/stdlib/docs/stdlib/thread.md +82 -36
- package/stdlib/docs/stdlib/vision.md +210 -0
- package/stdlib/embedding.js +3 -10
- package/stdlib/fs.js +3 -10
- package/stdlib/git.js +3 -10
- package/stdlib/github.js +3 -10
- package/stdlib/http.js +3 -10
- package/stdlib/image.agency +282 -9
- package/stdlib/image.js +1508 -14
- package/stdlib/index.js +3 -10
- package/stdlib/llm.js +3 -10
- package/stdlib/markdown.js +3 -10
- package/stdlib/math.js +3 -10
- package/stdlib/mcp.js +3 -10
- package/stdlib/memory.js +3 -10
- package/stdlib/messaging/email.js +3 -10
- package/stdlib/messaging/imessage.js +3 -10
- package/stdlib/messaging/sms.js +3 -10
- package/stdlib/notes/apple.js +3 -10
- package/stdlib/object.js +3 -10
- package/stdlib/ocr.js +3 -10
- package/stdlib/path.js +3 -10
- package/stdlib/policy.js +4 -10
- package/stdlib/safeBash/actions.js +3 -10
- package/stdlib/safeBash.js +3 -10
- package/stdlib/shell.js +3 -10
- package/stdlib/skills.js +3 -10
- package/stdlib/speech.js +3 -10
- package/stdlib/spill.js +3 -10
- package/stdlib/statelog.js +3 -10
- package/stdlib/strategy.js +3 -10
- package/stdlib/supervise.js +3 -10
- package/stdlib/syntax.js +3 -10
- package/stdlib/system.agency +1 -1
- package/stdlib/system.js +4 -11
- package/stdlib/tag.js +3 -10
- package/stdlib/thread.agency +30 -0
- package/stdlib/thread.js +267 -12
- package/stdlib/toolbox.js +3 -10
- package/stdlib/ui/chart.js +3 -10
- package/stdlib/ui/cli.js +3 -10
- package/stdlib/ui/layout.js +3 -10
- package/stdlib/ui/table.js +3 -10
- package/stdlib/ui.js +4 -10
- package/stdlib/validation.js +3 -10
- package/stdlib/vision.agency +151 -0
- package/stdlib/vision.js +1042 -0
- package/stdlib/weather.js +3 -10
- package/stdlib/web/browser.js +3 -10
- package/stdlib/web/search.js +3 -10
- package/stdlib/wikipedia.js +3 -10
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/context.js +0 -533
- package/dist/lib/agents/gepaReflect.js +0 -316
- package/dist/lib/agents/mutatePrompt.js +0 -301
|
@@ -1,6 +1,8 @@
|
|
|
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"
|
|
5
|
+
import { disableMemory } from "std::memory"
|
|
4
6
|
import { evalOutput, evalValue, setAgentName } from "std::statelog"
|
|
5
7
|
import { cwd, env, isTTY, readStdin, setTitle } from "std::system"
|
|
6
8
|
import { getCost } from "std::thread"
|
|
@@ -18,7 +20,7 @@ import { printPolicyHelp } from "./lib/policy.agency"
|
|
|
18
20
|
import { activePreset, startPreset } from "./lib/presets.agency"
|
|
19
21
|
import { installSessionHooks, startInteractive } from "./lib/repl.agency"
|
|
20
22
|
import { chooseSession, startSession } from "./lib/resume.agency"
|
|
21
|
-
import { pickModelsForAgent
|
|
23
|
+
import { pickModelsForAgent } from "./lib/session.agency"
|
|
22
24
|
import { loadSettings } from "./lib/settings.agency"
|
|
23
25
|
import { applyToolLimits, limitFlagsFromArgs, setStartupLimitFlags } from "./lib/toolLimits.agency"
|
|
24
26
|
import { setDebug, setVerbose, setInteractive } from "./lib/trace.agency"
|
|
@@ -89,7 +91,7 @@ node main() {
|
|
|
89
91
|
// silently doing nothing.
|
|
90
92
|
if (args.flags.policy == "") {
|
|
91
93
|
printPolicyHelp()
|
|
92
|
-
|
|
94
|
+
_exit(0)
|
|
93
95
|
}
|
|
94
96
|
setPolicyArg(
|
|
95
97
|
args.flags.policy ?? "",
|
|
@@ -102,7 +104,7 @@ node main() {
|
|
|
102
104
|
if (brain == null) {
|
|
103
105
|
const names = map(allBrains(), \entry -> entry.name).join(", ")
|
|
104
106
|
print(color.red("Unknown --brain value: ${brainName}. Valid: ${names}"))
|
|
105
|
-
|
|
107
|
+
_exit(1)
|
|
106
108
|
return
|
|
107
109
|
}
|
|
108
110
|
setBrain(brain)
|
|
@@ -133,7 +135,7 @@ node main() {
|
|
|
133
135
|
"Unknown --agent value: ${requestedStartTarget}. Valid for the ${brain.name} brain: ${validTargets}",
|
|
134
136
|
),
|
|
135
137
|
)
|
|
136
|
-
|
|
138
|
+
_exit(1)
|
|
137
139
|
return
|
|
138
140
|
} else {
|
|
139
141
|
startAgent = resolvedStartTarget
|
|
@@ -143,9 +145,12 @@ node main() {
|
|
|
143
145
|
startPreset(args.flags.preset ?? "", loadSettings())
|
|
144
146
|
pickModelsForAgent(args)
|
|
145
147
|
|
|
146
|
-
//
|
|
148
|
+
// Memory stays off for the agent. After every model reply it ran a fact
|
|
149
|
+
// extraction and a summary on another model, and the tool calls waited
|
|
150
|
+
// for both, often a minute or more per round. The research memory also
|
|
151
|
+
// compacted the coordinator's own thread during a handoff. Must run
|
|
147
152
|
// before any handler/REPL is installed.
|
|
148
|
-
|
|
153
|
+
disableMemory() with approve
|
|
149
154
|
|
|
150
155
|
// Connect configured MCP servers and hand their (policy-gated) tools to the
|
|
151
156
|
// coordinator. Must run before the first turn (mcpTools ordering contract).
|
|
@@ -166,7 +171,7 @@ node main() {
|
|
|
166
171
|
const effort = parseEffort(args.flags.effort ?? null)
|
|
167
172
|
if (effort.error != "") {
|
|
168
173
|
print(color.red(effort.error))
|
|
169
|
-
|
|
174
|
+
_exit(1)
|
|
170
175
|
}
|
|
171
176
|
if (effort.level != null) {
|
|
172
177
|
setLlmOptions({
|
|
@@ -186,7 +191,7 @@ node main() {
|
|
|
186
191
|
"--continue and --resume need an interactive session; one-shot runs are not saved.",
|
|
187
192
|
),
|
|
188
193
|
)
|
|
189
|
-
|
|
194
|
+
_exit(1)
|
|
190
195
|
}
|
|
191
196
|
// Everything above is process-level: model resolution feeds the memory
|
|
192
197
|
// layer, and memory, MCP, and the settings reads behind them must run
|
|
@@ -206,7 +211,7 @@ node main() {
|
|
|
206
211
|
if (!hasQuery) {
|
|
207
212
|
const fromStdin = readStdin()
|
|
208
213
|
if (fromStdin == null || fromStdin == "") {
|
|
209
|
-
|
|
214
|
+
_exit(0)
|
|
210
215
|
}
|
|
211
216
|
prompt = fromStdin
|
|
212
217
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
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";
|
|
6
|
+
import { disableMemory } from "agency-lang/stdlib/memory.js";
|
|
5
7
|
import { evalOutput, evalValue, setAgentName } from "agency-lang/stdlib/statelog.js";
|
|
6
8
|
import { cwd, env, isTTY, readStdin, setTitle } from "agency-lang/stdlib/system.js";
|
|
7
9
|
import { getCost } from "agency-lang/stdlib/thread.js";
|
|
@@ -18,7 +20,7 @@ import { printPolicyHelp } from "./lib/policy.js";
|
|
|
18
20
|
import { activePreset, startPreset } from "./lib/presets.js";
|
|
19
21
|
import { installSessionHooks, startInteractive } from "./lib/repl.js";
|
|
20
22
|
import { chooseSession, startSession } from "./lib/resume.js";
|
|
21
|
-
import { pickModelsForAgent
|
|
23
|
+
import { pickModelsForAgent } from "./lib/session.js";
|
|
22
24
|
import { loadSettings } from "./lib/settings.js";
|
|
23
25
|
import { applyToolLimits, limitFlagsFromArgs, setStartupLimitFlags } from "./lib/toolLimits.js";
|
|
24
26
|
import { setDebug, setVerbose, setInteractive } from "./lib/trace.js";
|
|
@@ -29,7 +31,7 @@ import { fileURLToPath } from "url";
|
|
|
29
31
|
import __process from "process";
|
|
30
32
|
import { readFileSync } from "fs";
|
|
31
33
|
import { z } from "agency-lang/zod";
|
|
32
|
-
import { color
|
|
34
|
+
import { color } from "agency-lang";
|
|
33
35
|
import path from "path";
|
|
34
36
|
import {
|
|
35
37
|
RuntimeContext,
|
|
@@ -49,6 +51,7 @@ import {
|
|
|
49
51
|
hasInterrupts,
|
|
50
52
|
resolveCliInterrupts,
|
|
51
53
|
reportBudgetExceededAndExit,
|
|
54
|
+
flushPendingStatelogPosts,
|
|
52
55
|
isDebugger,
|
|
53
56
|
isPaused,
|
|
54
57
|
respondToInterrupts as _respondToInterrupts,
|
|
@@ -91,9 +94,9 @@ const __dirname = path.dirname(__filename);
|
|
|
91
94
|
const __cwd = __process.cwd();
|
|
92
95
|
const __globalCtx = new RuntimeContext({
|
|
93
96
|
statelogConfig: {
|
|
94
|
-
host: "
|
|
97
|
+
host: "",
|
|
95
98
|
apiKey: __process.env["STATELOG_API_KEY"] || "",
|
|
96
|
-
projectId: "
|
|
99
|
+
projectId: "",
|
|
97
100
|
debugMode: false,
|
|
98
101
|
observability: true,
|
|
99
102
|
logFile: "log.jsonl"
|
|
@@ -114,12 +117,6 @@ const __globalCtx = new RuntimeContext({
|
|
|
114
117
|
},
|
|
115
118
|
model: "gpt-5-mini",
|
|
116
119
|
logLevel: "warn",
|
|
117
|
-
statelog: {
|
|
118
|
-
host: "https://statelog.adit.io",
|
|
119
|
-
projectId: "smoltalk",
|
|
120
|
-
apiKey: __process.env["STATELOG_SMOLTALK_API_KEY"] || "",
|
|
121
|
-
traceId: nanoid()
|
|
122
|
-
},
|
|
123
120
|
provider: "openai-responses"
|
|
124
121
|
},
|
|
125
122
|
dirname: __dirname,
|
|
@@ -187,7 +184,7 @@ function registerTools(tools) {
|
|
|
187
184
|
}
|
|
188
185
|
}
|
|
189
186
|
}
|
|
190
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/agent.agency", "
|
|
187
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/agent.agency", "281945ec35127b0906a07f4e38a657f9d38e173d2c915d6f40bae750354d654f", import.meta.url);
|
|
191
188
|
__registerTool(print);
|
|
192
189
|
__registerTool(printJSON);
|
|
193
190
|
__registerTool(input);
|
|
@@ -222,6 +219,7 @@ __registerTool(applyAgentCwd);
|
|
|
222
219
|
__registerTool(parseArgs);
|
|
223
220
|
__registerTool(map);
|
|
224
221
|
__registerTool(setLlmOptions);
|
|
222
|
+
__registerTool(disableMemory);
|
|
225
223
|
__registerTool(evalOutput);
|
|
226
224
|
__registerTool(evalValue);
|
|
227
225
|
__registerTool(setAgentName);
|
|
@@ -252,7 +250,6 @@ __registerTool(startInteractive);
|
|
|
252
250
|
__registerTool(chooseSession);
|
|
253
251
|
__registerTool(startSession);
|
|
254
252
|
__registerTool(pickModelsForAgent);
|
|
255
|
-
__registerTool(maybeEnableMemory);
|
|
256
253
|
__registerTool(loadSettings);
|
|
257
254
|
__registerTool(applyToolLimits);
|
|
258
255
|
__registerTool(limitFlagsFromArgs);
|
|
@@ -683,10 +680,21 @@ graph.node("main", async (__state) => {
|
|
|
683
680
|
}
|
|
684
681
|
});
|
|
685
682
|
await runner2.step(1, async (runner3) => {
|
|
686
|
-
await
|
|
683
|
+
const __funcResult = await __call(_exit, {
|
|
687
684
|
type: "positional",
|
|
688
685
|
args: [0]
|
|
689
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
|
+
}
|
|
690
698
|
});
|
|
691
699
|
}
|
|
692
700
|
}
|
|
@@ -855,10 +863,21 @@ graph.node("main", async (__state) => {
|
|
|
855
863
|
}
|
|
856
864
|
});
|
|
857
865
|
await runner2.step(5, async (runner3) => {
|
|
858
|
-
await
|
|
866
|
+
const __funcResult = await __call(_exit, {
|
|
859
867
|
type: "positional",
|
|
860
868
|
args: [1]
|
|
861
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
|
+
}
|
|
862
881
|
});
|
|
863
882
|
await runner2.step(6, async (runner3) => {
|
|
864
883
|
runner3.halt({
|
|
@@ -1002,10 +1021,21 @@ graph.node("main", async (__state) => {
|
|
|
1002
1021
|
}
|
|
1003
1022
|
});
|
|
1004
1023
|
await runner2.step(3, async (runner3) => {
|
|
1005
|
-
await
|
|
1024
|
+
const __funcResult = await __call(_exit, {
|
|
1006
1025
|
type: "positional",
|
|
1007
1026
|
args: [1]
|
|
1008
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
|
+
}
|
|
1009
1039
|
});
|
|
1010
1040
|
await runner2.step(4, async (runner3) => {
|
|
1011
1041
|
runner3.halt({
|
|
@@ -1074,24 +1104,28 @@ graph.node("main", async (__state) => {
|
|
|
1074
1104
|
throw __funcResult.toError();
|
|
1075
1105
|
}
|
|
1076
1106
|
});
|
|
1077
|
-
await runner.
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
if (hasInterrupts(__funcResult)) {
|
|
1083
|
-
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1084
|
-
runner2.halt({
|
|
1085
|
-
...__state,
|
|
1086
|
-
data: __funcResult
|
|
1107
|
+
await runner.handle(28, async (__data) => approve(), async (runner2) => {
|
|
1108
|
+
await runner2.step(0, async (runner3) => {
|
|
1109
|
+
const __funcResult = await __call(disableMemory, {
|
|
1110
|
+
type: "positional",
|
|
1111
|
+
args: []
|
|
1087
1112
|
});
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1113
|
+
if (hasInterrupts(__funcResult)) {
|
|
1114
|
+
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1115
|
+
runner3.halt({
|
|
1116
|
+
...__state,
|
|
1117
|
+
data: __funcResult
|
|
1118
|
+
});
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
if (isAborted(__funcResult)) {
|
|
1122
|
+
throw __funcResult.toError();
|
|
1123
|
+
}
|
|
1124
|
+
});
|
|
1093
1125
|
});
|
|
1094
1126
|
await runner.step(29, async (runner2) => {
|
|
1127
|
+
});
|
|
1128
|
+
await runner.step(30, async (runner2) => {
|
|
1095
1129
|
__stack.locals.__hoist_7 = await __call(loadSettings, {
|
|
1096
1130
|
type: "positional",
|
|
1097
1131
|
args: []
|
|
@@ -1108,7 +1142,7 @@ graph.node("main", async (__state) => {
|
|
|
1108
1142
|
throw __stack.locals.__hoist_7.toError();
|
|
1109
1143
|
}
|
|
1110
1144
|
});
|
|
1111
|
-
await runner.step(
|
|
1145
|
+
await runner.step(31, async (runner2) => {
|
|
1112
1146
|
const __funcResult = await __call(maybeLoadMcp, {
|
|
1113
1147
|
type: "positional",
|
|
1114
1148
|
args: [__stack.locals.__hoist_7]
|
|
@@ -1125,7 +1159,7 @@ graph.node("main", async (__state) => {
|
|
|
1125
1159
|
throw __funcResult.toError();
|
|
1126
1160
|
}
|
|
1127
1161
|
});
|
|
1128
|
-
await runner.step(
|
|
1162
|
+
await runner.step(32, async (runner2) => {
|
|
1129
1163
|
__stack.locals.__hoist_8 = await __call(limitFlagsFromArgs, {
|
|
1130
1164
|
type: "positional",
|
|
1131
1165
|
args: [__stack.locals.args]
|
|
@@ -1142,7 +1176,7 @@ graph.node("main", async (__state) => {
|
|
|
1142
1176
|
throw __stack.locals.__hoist_8.toError();
|
|
1143
1177
|
}
|
|
1144
1178
|
});
|
|
1145
|
-
await runner.step(
|
|
1179
|
+
await runner.step(33, async (runner2) => {
|
|
1146
1180
|
const __funcResult = await __call(setStartupLimitFlags, {
|
|
1147
1181
|
type: "positional",
|
|
1148
1182
|
args: [__stack.locals.__hoist_8]
|
|
@@ -1159,7 +1193,7 @@ graph.node("main", async (__state) => {
|
|
|
1159
1193
|
throw __funcResult.toError();
|
|
1160
1194
|
}
|
|
1161
1195
|
});
|
|
1162
|
-
await runner.step(
|
|
1196
|
+
await runner.step(34, async (runner2) => {
|
|
1163
1197
|
__stack.locals.__hoist_9 = await __call(activePreset, {
|
|
1164
1198
|
type: "positional",
|
|
1165
1199
|
args: []
|
|
@@ -1176,7 +1210,7 @@ graph.node("main", async (__state) => {
|
|
|
1176
1210
|
throw __stack.locals.__hoist_9.toError();
|
|
1177
1211
|
}
|
|
1178
1212
|
});
|
|
1179
|
-
await runner.step(
|
|
1213
|
+
await runner.step(35, async (runner2) => {
|
|
1180
1214
|
const __funcResult = await __call(applyToolLimits, {
|
|
1181
1215
|
type: "positional",
|
|
1182
1216
|
args: [__stack.locals.__hoist_9, __stack.locals.isOneShot]
|
|
@@ -1193,7 +1227,7 @@ graph.node("main", async (__state) => {
|
|
|
1193
1227
|
throw __funcResult.toError();
|
|
1194
1228
|
}
|
|
1195
1229
|
});
|
|
1196
|
-
await runner.step(
|
|
1230
|
+
await runner.step(36, async (runner2) => {
|
|
1197
1231
|
__stack.locals.__hoist_10 = await __call(getCapabilities, {
|
|
1198
1232
|
type: "positional",
|
|
1199
1233
|
args: []
|
|
@@ -1210,10 +1244,10 @@ graph.node("main", async (__state) => {
|
|
|
1210
1244
|
throw __stack.locals.__hoist_10.toError();
|
|
1211
1245
|
}
|
|
1212
1246
|
});
|
|
1213
|
-
await runner.step(
|
|
1247
|
+
await runner.step(37, async (runner2) => {
|
|
1214
1248
|
__stack.locals.capsMaxTokens = __stack.locals.__hoist_10.maxTokens;
|
|
1215
1249
|
});
|
|
1216
|
-
await runner.ifElse(
|
|
1250
|
+
await runner.ifElse(38, [
|
|
1217
1251
|
{
|
|
1218
1252
|
condition: async () => !__eq(__stack.locals.capsMaxTokens, null),
|
|
1219
1253
|
body: async (runner2) => {
|
|
@@ -1239,9 +1273,9 @@ graph.node("main", async (__state) => {
|
|
|
1239
1273
|
}
|
|
1240
1274
|
}
|
|
1241
1275
|
]);
|
|
1242
|
-
await runner.step(38, async (runner2) => {
|
|
1243
|
-
});
|
|
1244
1276
|
await runner.step(39, async (runner2) => {
|
|
1277
|
+
});
|
|
1278
|
+
await runner.step(40, async (runner2) => {
|
|
1245
1279
|
__stack.locals.effort = await __call(parseEffort, {
|
|
1246
1280
|
type: "positional",
|
|
1247
1281
|
args: [__stack.locals.args.flags.effort ?? null]
|
|
@@ -1258,7 +1292,7 @@ graph.node("main", async (__state) => {
|
|
|
1258
1292
|
throw __stack.locals.effort.toError();
|
|
1259
1293
|
}
|
|
1260
1294
|
});
|
|
1261
|
-
await runner.ifElse(
|
|
1295
|
+
await runner.ifElse(41, [
|
|
1262
1296
|
{
|
|
1263
1297
|
condition: async () => !__eq(__stack.locals.effort.error, ``),
|
|
1264
1298
|
body: async (runner2) => {
|
|
@@ -1286,15 +1320,26 @@ graph.node("main", async (__state) => {
|
|
|
1286
1320
|
}
|
|
1287
1321
|
});
|
|
1288
1322
|
await runner2.step(2, async (runner3) => {
|
|
1289
|
-
await
|
|
1323
|
+
const __funcResult = await __call(_exit, {
|
|
1290
1324
|
type: "positional",
|
|
1291
1325
|
args: [1]
|
|
1292
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
|
+
}
|
|
1293
1338
|
});
|
|
1294
1339
|
}
|
|
1295
1340
|
}
|
|
1296
1341
|
]);
|
|
1297
|
-
await runner.ifElse(
|
|
1342
|
+
await runner.ifElse(42, [
|
|
1298
1343
|
{
|
|
1299
1344
|
condition: async () => !__eq(__stack.locals.effort.level, null),
|
|
1300
1345
|
body: async (runner2) => {
|
|
@@ -1320,7 +1365,7 @@ graph.node("main", async (__state) => {
|
|
|
1320
1365
|
}
|
|
1321
1366
|
}
|
|
1322
1367
|
]);
|
|
1323
|
-
await runner.step(
|
|
1368
|
+
await runner.step(43, async (runner2) => {
|
|
1324
1369
|
__stack.locals.__hoist_12 = await __call(cwd, {
|
|
1325
1370
|
type: "positional",
|
|
1326
1371
|
args: []
|
|
@@ -1337,7 +1382,7 @@ graph.node("main", async (__state) => {
|
|
|
1337
1382
|
throw __stack.locals.__hoist_12.toError();
|
|
1338
1383
|
}
|
|
1339
1384
|
});
|
|
1340
|
-
await runner.step(
|
|
1385
|
+
await runner.step(44, async (runner2) => {
|
|
1341
1386
|
const __funcResult = await __call(setAgentCwd, {
|
|
1342
1387
|
type: "positional",
|
|
1343
1388
|
args: [__stack.locals.__hoist_12]
|
|
@@ -1354,7 +1399,7 @@ graph.node("main", async (__state) => {
|
|
|
1354
1399
|
throw __funcResult.toError();
|
|
1355
1400
|
}
|
|
1356
1401
|
});
|
|
1357
|
-
await runner.ifElse(
|
|
1402
|
+
await runner.ifElse(45, [
|
|
1358
1403
|
{
|
|
1359
1404
|
condition: async () => __stack.locals.isOneShot && (__stack.locals.args.flags.continue || !__eq(__stack.locals.args.flags.resume, null)),
|
|
1360
1405
|
body: async (runner2) => {
|
|
@@ -1382,17 +1427,28 @@ graph.node("main", async (__state) => {
|
|
|
1382
1427
|
}
|
|
1383
1428
|
});
|
|
1384
1429
|
await runner2.step(2, async (runner3) => {
|
|
1385
|
-
await
|
|
1430
|
+
const __funcResult = await __call(_exit, {
|
|
1386
1431
|
type: "positional",
|
|
1387
1432
|
args: [1]
|
|
1388
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
|
+
}
|
|
1389
1445
|
});
|
|
1390
1446
|
}
|
|
1391
1447
|
}
|
|
1392
1448
|
]);
|
|
1393
|
-
await runner.step(
|
|
1449
|
+
await runner.step(46, async (runner2) => {
|
|
1394
1450
|
});
|
|
1395
|
-
await runner.ifElse(
|
|
1451
|
+
await runner.ifElse(47, [
|
|
1396
1452
|
{
|
|
1397
1453
|
condition: async () => !__stack.locals.isOneShot,
|
|
1398
1454
|
body: async (runner2) => {
|
|
@@ -1484,7 +1540,7 @@ graph.node("main", async (__state) => {
|
|
|
1484
1540
|
}
|
|
1485
1541
|
}
|
|
1486
1542
|
]);
|
|
1487
|
-
await runner.ifElse(
|
|
1543
|
+
await runner.ifElse(48, [
|
|
1488
1544
|
{
|
|
1489
1545
|
condition: async () => __stack.locals.isOneShot,
|
|
1490
1546
|
body: async (runner2) => {
|
|
@@ -1517,10 +1573,21 @@ graph.node("main", async (__state) => {
|
|
|
1517
1573
|
condition: async () => __eq(__stack.locals.fromStdin, null) || __eq(__stack.locals.fromStdin, ``),
|
|
1518
1574
|
body: async (runner4) => {
|
|
1519
1575
|
await runner4.step(0, async (runner5) => {
|
|
1520
|
-
await
|
|
1576
|
+
const __funcResult = await __call(_exit, {
|
|
1521
1577
|
type: "positional",
|
|
1522
1578
|
args: [0]
|
|
1523
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
|
+
}
|
|
1524
1591
|
});
|
|
1525
1592
|
}
|
|
1526
1593
|
}
|
|
@@ -1740,7 +1807,7 @@ Session cost: ${__stack.locals.roundedCost}`]
|
|
|
1740
1807
|
});
|
|
1741
1808
|
});
|
|
1742
1809
|
if (runner.halted) return runner.haltResult;
|
|
1743
|
-
await runner.hook(
|
|
1810
|
+
await runner.hook(49, async () => {
|
|
1744
1811
|
await callHook({
|
|
1745
1812
|
name: "onNodeEnd",
|
|
1746
1813
|
data: {
|
|
@@ -1815,14 +1882,15 @@ if (__process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
|
1815
1882
|
});
|
|
1816
1883
|
await resolveCliInterrupts(__result, respondToInterrupts);
|
|
1817
1884
|
} catch (__error) {
|
|
1818
|
-
reportBudgetExceededAndExit(__error);
|
|
1885
|
+
await reportBudgetExceededAndExit(__error);
|
|
1819
1886
|
console.error(`
|
|
1820
1887
|
Agent crashed: ${__error.message}`);
|
|
1888
|
+
await flushPendingStatelogPosts();
|
|
1821
1889
|
throw __error;
|
|
1822
1890
|
}
|
|
1823
1891
|
}
|
|
1824
1892
|
var stdin_default = graph;
|
|
1825
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line":
|
|
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 } } };
|
|
1826
1894
|
export {
|
|
1827
1895
|
__getCheckpoints,
|
|
1828
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: "
|
|
40
|
+
host: "",
|
|
42
41
|
apiKey: __process.env["STATELOG_API_KEY"] || "",
|
|
43
|
-
projectId: "
|
|
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", "
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
101
|
+
_exit(1)
|
|
101
102
|
}
|
|
102
103
|
exitIfBroken(checkBundledSkill(superpowersSkill, "brainstorming"))
|
|
103
104
|
exitIfBroken(checkBundledSkill(coordinatorSkills, "presets"))
|