agency-lang 0.23.0 → 0.24.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 -0
- package/dist/lib/agents/agency-agent/agent.js +132 -49
- package/dist/lib/agents/agency-agent/brains/coordinator/coordinator.js +6 -6
- package/dist/lib/agents/agency-agent/brains/coordinator/learn.js +3 -3
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/announce.js +384 -0
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.js +9 -9
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/context.js +533 -0
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.js +2 -2
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.js +4 -4
- package/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.js +2 -2
- package/dist/lib/agents/agency-agent/lib/args.agency +4 -0
- package/dist/lib/agents/agency-agent/lib/args.js +6 -2
- package/dist/lib/agents/agency-agent/lib/capabilitiesUi.js +3 -3
- package/dist/lib/agents/agency-agent/lib/effort.agency +26 -0
- package/dist/lib/agents/agency-agent/lib/effort.js +408 -0
- package/dist/lib/agents/agency-agent/lib/header.js +2 -2
- package/dist/lib/agents/agency-agent/lib/learned.js +4 -4
- package/dist/lib/agents/agency-agent/lib/modelRequest.js +3 -3
- package/dist/lib/agents/agency-agent/lib/policy.js +14 -14
- package/dist/lib/agents/agency-agent/lib/presets.js +7 -7
- package/dist/lib/agents/agency-agent/lib/repl.js +3 -3
- package/dist/lib/agents/agency-agent/lib/resolution.js +2 -2
- package/dist/lib/agents/agency-agent/lib/search.js +3 -3
- package/dist/lib/agents/agency-agent/lib/session.js +3 -3
- package/dist/lib/agents/agency-agent/lib/sessions.js +2 -2
- package/dist/lib/agents/agency-agent/lib/settings.js +12 -12
- package/dist/lib/agents/agency-agent/lib/slashCommands/policy.js +3 -3
- package/dist/lib/agents/agency-agent/lib/toolLimits.js +2 -2
- package/dist/lib/agents/agency-agent/lib/turn.js +2 -2
- package/dist/lib/agents/agency-agent/shared.js +3 -3
- package/dist/lib/agents/gepaReflect.js +316 -0
- package/dist/lib/agents/mutatePrompt.js +301 -0
- package/dist/lib/backends/typescriptBuilder.js +11 -6
- package/dist/lib/cli/mlxChatServer.py +469 -8
- package/dist/lib/cli/mlxServer.d.ts +7 -0
- package/dist/lib/cli/mlxServer.js +10 -1
- package/dist/lib/cli/statelog/spendTypes.d.ts +4 -0
- package/dist/lib/cli/statelog/spendTypes.js +1 -0
- package/dist/lib/config/config.d.ts +12 -0
- package/dist/lib/config/config.js +18 -11
- package/dist/lib/logsViewer/spanText.js +9 -0
- package/dist/lib/logsViewer/summary.js +7 -0
- package/dist/lib/logsViewer/tree.js +1 -0
- package/dist/lib/runtime/agencyLlm.d.ts +5 -0
- package/dist/lib/runtime/agencyLlm.js +4 -0
- package/dist/lib/runtime/asyncContext.d.ts +7 -0
- package/dist/lib/runtime/decision/collector.d.ts +69 -0
- package/dist/lib/runtime/decision/collector.js +251 -0
- package/dist/lib/runtime/decision/dispatch.d.ts +24 -0
- package/dist/lib/runtime/decision/dispatch.js +136 -0
- package/dist/lib/runtime/decision/questions.d.ts +40 -0
- package/dist/lib/runtime/decision/questions.js +163 -0
- package/dist/lib/runtime/deterministicClient.d.ts +15 -2
- package/dist/lib/runtime/deterministicClient.js +80 -0
- package/dist/lib/runtime/index.d.ts +1 -1
- package/dist/lib/runtime/index.js +1 -1
- package/dist/lib/runtime/invocationUsage.d.ts +1 -1
- package/dist/lib/runtime/invocationUsage.js +2 -0
- package/dist/lib/runtime/llmClient.d.ts +14 -0
- package/dist/lib/runtime/llmClient.js +16 -1
- package/dist/lib/runtime/llmConfig.d.ts +8 -0
- package/dist/lib/runtime/llmConfig.js +44 -0
- package/dist/lib/runtime/llmDispatch.d.ts +7 -1
- package/dist/lib/runtime/llmDispatch.js +21 -2
- package/dist/lib/runtime/localDefaults.d.ts +44 -18
- package/dist/lib/runtime/localDefaults.js +111 -33
- package/dist/lib/runtime/policy.js +7 -4
- package/dist/lib/runtime/prompt.d.ts +4 -0
- package/dist/lib/runtime/prompt.js +23 -17
- package/dist/lib/runtime/recordPaidUsage.d.ts +1 -1
- package/dist/lib/runtime/recordPaidUsage.js +2 -2
- package/dist/lib/runtime/resumableScope.js +3 -0
- package/dist/lib/runtime/runBatch.d.ts +11 -0
- package/dist/lib/runtime/runBatch.js +15 -4
- package/dist/lib/runtime/runner.js +44 -0
- package/dist/lib/runtime/state/context.d.ts +1 -1
- package/dist/lib/runtime/state/context.js +3 -2
- package/dist/lib/runtime/utils.d.ts +25 -0
- package/dist/lib/runtime/utils.js +47 -0
- package/dist/lib/statelogClient.d.ts +15 -2
- package/dist/lib/statelogClient.js +11 -0
- package/dist/lib/stdlib/llm.d.ts +14 -1
- package/dist/lib/stdlib/llm.js +25 -4
- package/dist/lib/stdlib/modelCatalog.d.ts +18 -0
- package/dist/lib/stdlib/modelCatalog.js +62 -0
- package/dist/lib/stdlib/thread.d.ts +30 -0
- package/dist/lib/stdlib/thread.js +51 -0
- package/dist/lib/typeChecker/builtins.js +35 -0
- package/package.json +6 -2
- package/stdlib/docs/guide/agency-config-file.md +2 -0
- package/stdlib/docs/guide/custom-providers.md +2 -0
- package/stdlib/docs/guide/decision-models.md +275 -0
- package/stdlib/docs/guide/llm-part-2.md +18 -2
- package/stdlib/docs/guide/llm.md +4 -1
- package/stdlib/docs/guide/message-threads.md +78 -2
- package/stdlib/docs/guide/policies.md +15 -0
- package/stdlib/docs/guide/using-local-models.md +50 -7
- package/stdlib/docs/stdlib/llm.md +29 -14
- package/stdlib/docs/stdlib/thread.md +228 -26
- package/stdlib/llm.agency +9 -1
- package/stdlib/llm.js +3 -3
- package/stdlib/thread.agency +114 -0
- package/stdlib/thread.js +149 -3
|
@@ -10,6 +10,7 @@ import { clearMessages, pushMessage, repl, clearScreen } from "std::ui/cli"
|
|
|
10
10
|
import { brainByName, allBrains } from "./brains/registry.agency"
|
|
11
11
|
import { agentNameFor } from "./lib/agentName.agency"
|
|
12
12
|
import { parseAgentArgs } from "./lib/args.agency"
|
|
13
|
+
import { parseEffort } from "./lib/effort.agency"
|
|
13
14
|
import { mergedPalette } from "./lib/commandPalette.agency"
|
|
14
15
|
import { getHeader } from "./lib/header.agency"
|
|
15
16
|
import { maybeLoadMcp } from "./lib/mcp.agency"
|
|
@@ -159,6 +160,19 @@ node main() {
|
|
|
159
160
|
maxTokens: capsMaxTokens
|
|
160
161
|
})
|
|
161
162
|
}
|
|
163
|
+
// --effort sets the provider's reasoning effort on every call. Without
|
|
164
|
+
// it a reasoning model runs at the provider's default, which is not
|
|
165
|
+
// what a benchmark run under fixed conditions wants.
|
|
166
|
+
const effort = parseEffort(args.flags.effort ?? null)
|
|
167
|
+
if (effort.error != "") {
|
|
168
|
+
print(color.red(effort.error))
|
|
169
|
+
process.exit(1)
|
|
170
|
+
}
|
|
171
|
+
if (effort.level != null) {
|
|
172
|
+
setLlmOptions({
|
|
173
|
+
reasoningEffort: effort.level
|
|
174
|
+
})
|
|
175
|
+
}
|
|
162
176
|
|
|
163
177
|
setAgentCwd(cwd())
|
|
164
178
|
|
|
@@ -10,6 +10,7 @@ import { clearMessages, pushMessage, repl, clearScreen } from "agency-lang/stdli
|
|
|
10
10
|
import { brainByName, allBrains } from "./brains/registry.js";
|
|
11
11
|
import { agentNameFor } from "./lib/agentName.js";
|
|
12
12
|
import { parseAgentArgs } from "./lib/args.js";
|
|
13
|
+
import { parseEffort } from "./lib/effort.js";
|
|
13
14
|
import { mergedPalette } from "./lib/commandPalette.js";
|
|
14
15
|
import { getHeader } from "./lib/header.js";
|
|
15
16
|
import { maybeLoadMcp } from "./lib/mcp.js";
|
|
@@ -186,7 +187,7 @@ function registerTools(tools) {
|
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/agent.agency", "
|
|
190
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/agent.agency", "36859b3fce9a08dda5d9dbb68aeb4e928266f8f5b45fefaba17e89da160b07cf", import.meta.url);
|
|
190
191
|
__registerTool(print);
|
|
191
192
|
__registerTool(printJSON);
|
|
192
193
|
__registerTool(input);
|
|
@@ -239,6 +240,7 @@ __registerTool(brainByName);
|
|
|
239
240
|
__registerTool(allBrains);
|
|
240
241
|
__registerTool(agentNameFor);
|
|
241
242
|
__registerTool(parseAgentArgs);
|
|
243
|
+
__registerTool(parseEffort);
|
|
242
244
|
__registerTool(mergedPalette);
|
|
243
245
|
__registerTool(getHeader);
|
|
244
246
|
__registerTool(maybeLoadMcp);
|
|
@@ -1238,26 +1240,107 @@ graph.node("main", async (__state) => {
|
|
|
1238
1240
|
}
|
|
1239
1241
|
]);
|
|
1240
1242
|
await runner.step(38, async (runner2) => {
|
|
1241
|
-
|
|
1243
|
+
});
|
|
1244
|
+
await runner.step(39, async (runner2) => {
|
|
1245
|
+
__stack.locals.effort = await __call(parseEffort, {
|
|
1246
|
+
type: "positional",
|
|
1247
|
+
args: [__stack.locals.args.flags.effort ?? null]
|
|
1248
|
+
});
|
|
1249
|
+
if (hasInterrupts(__stack.locals.effort)) {
|
|
1250
|
+
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1251
|
+
runner2.halt({
|
|
1252
|
+
...__state,
|
|
1253
|
+
data: __stack.locals.effort
|
|
1254
|
+
});
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
if (isAborted(__stack.locals.effort)) {
|
|
1258
|
+
throw __stack.locals.effort.toError();
|
|
1259
|
+
}
|
|
1260
|
+
});
|
|
1261
|
+
await runner.ifElse(40, [
|
|
1262
|
+
{
|
|
1263
|
+
condition: async () => !__eq(__stack.locals.effort.error, ``),
|
|
1264
|
+
body: async (runner2) => {
|
|
1265
|
+
await runner2.step(0, async (runner3) => {
|
|
1266
|
+
__stack.locals.__hoist_11 = await __callMethod(color, "red", {
|
|
1267
|
+
type: "positional",
|
|
1268
|
+
args: [__stack.locals.effort.error]
|
|
1269
|
+
});
|
|
1270
|
+
});
|
|
1271
|
+
await runner2.step(1, async (runner3) => {
|
|
1272
|
+
const __funcResult = await __call(print, {
|
|
1273
|
+
type: "positional",
|
|
1274
|
+
args: [__stack.locals.__hoist_11]
|
|
1275
|
+
});
|
|
1276
|
+
if (hasInterrupts(__funcResult)) {
|
|
1277
|
+
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1278
|
+
runner3.halt({
|
|
1279
|
+
...__state,
|
|
1280
|
+
data: __funcResult
|
|
1281
|
+
});
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
if (isAborted(__funcResult)) {
|
|
1285
|
+
throw __funcResult.toError();
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1288
|
+
await runner2.step(2, async (runner3) => {
|
|
1289
|
+
await __callMethod(process, "exit", {
|
|
1290
|
+
type: "positional",
|
|
1291
|
+
args: [1]
|
|
1292
|
+
});
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1296
|
+
]);
|
|
1297
|
+
await runner.ifElse(41, [
|
|
1298
|
+
{
|
|
1299
|
+
condition: async () => !__eq(__stack.locals.effort.level, null),
|
|
1300
|
+
body: async (runner2) => {
|
|
1301
|
+
await runner2.step(0, async (runner3) => {
|
|
1302
|
+
const __funcResult = await __call(setLlmOptions, {
|
|
1303
|
+
type: "positional",
|
|
1304
|
+
args: [{
|
|
1305
|
+
"reasoningEffort": __stack.locals.effort.level
|
|
1306
|
+
}]
|
|
1307
|
+
});
|
|
1308
|
+
if (hasInterrupts(__funcResult)) {
|
|
1309
|
+
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1310
|
+
runner3.halt({
|
|
1311
|
+
...__state,
|
|
1312
|
+
data: __funcResult
|
|
1313
|
+
});
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
if (isAborted(__funcResult)) {
|
|
1317
|
+
throw __funcResult.toError();
|
|
1318
|
+
}
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
]);
|
|
1323
|
+
await runner.step(42, async (runner2) => {
|
|
1324
|
+
__stack.locals.__hoist_12 = await __call(cwd, {
|
|
1242
1325
|
type: "positional",
|
|
1243
1326
|
args: []
|
|
1244
1327
|
});
|
|
1245
|
-
if (hasInterrupts(__stack.locals.
|
|
1328
|
+
if (hasInterrupts(__stack.locals.__hoist_12)) {
|
|
1246
1329
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1247
1330
|
runner2.halt({
|
|
1248
1331
|
...__state,
|
|
1249
|
-
data: __stack.locals.
|
|
1332
|
+
data: __stack.locals.__hoist_12
|
|
1250
1333
|
});
|
|
1251
1334
|
return;
|
|
1252
1335
|
}
|
|
1253
|
-
if (isAborted(__stack.locals.
|
|
1254
|
-
throw __stack.locals.
|
|
1336
|
+
if (isAborted(__stack.locals.__hoist_12)) {
|
|
1337
|
+
throw __stack.locals.__hoist_12.toError();
|
|
1255
1338
|
}
|
|
1256
1339
|
});
|
|
1257
|
-
await runner.step(
|
|
1340
|
+
await runner.step(43, async (runner2) => {
|
|
1258
1341
|
const __funcResult = await __call(setAgentCwd, {
|
|
1259
1342
|
type: "positional",
|
|
1260
|
-
args: [__stack.locals.
|
|
1343
|
+
args: [__stack.locals.__hoist_12]
|
|
1261
1344
|
});
|
|
1262
1345
|
if (hasInterrupts(__funcResult)) {
|
|
1263
1346
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1271,12 +1354,12 @@ graph.node("main", async (__state) => {
|
|
|
1271
1354
|
throw __funcResult.toError();
|
|
1272
1355
|
}
|
|
1273
1356
|
});
|
|
1274
|
-
await runner.ifElse(
|
|
1357
|
+
await runner.ifElse(44, [
|
|
1275
1358
|
{
|
|
1276
1359
|
condition: async () => __stack.locals.isOneShot && (__stack.locals.args.flags.continue || !__eq(__stack.locals.args.flags.resume, null)),
|
|
1277
1360
|
body: async (runner2) => {
|
|
1278
1361
|
await runner2.step(0, async (runner3) => {
|
|
1279
|
-
__stack.locals.
|
|
1362
|
+
__stack.locals.__hoist_13 = await __callMethod(color, "red", {
|
|
1280
1363
|
type: "positional",
|
|
1281
1364
|
args: [`--continue and --resume need an interactive session; one-shot runs are not saved.`]
|
|
1282
1365
|
});
|
|
@@ -1284,7 +1367,7 @@ graph.node("main", async (__state) => {
|
|
|
1284
1367
|
await runner2.step(1, async (runner3) => {
|
|
1285
1368
|
const __funcResult = await __call(print, {
|
|
1286
1369
|
type: "positional",
|
|
1287
|
-
args: [__stack.locals.
|
|
1370
|
+
args: [__stack.locals.__hoist_13]
|
|
1288
1371
|
});
|
|
1289
1372
|
if (hasInterrupts(__funcResult)) {
|
|
1290
1373
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1307,9 +1390,9 @@ graph.node("main", async (__state) => {
|
|
|
1307
1390
|
}
|
|
1308
1391
|
}
|
|
1309
1392
|
]);
|
|
1310
|
-
await runner.step(
|
|
1393
|
+
await runner.step(45, async (runner2) => {
|
|
1311
1394
|
});
|
|
1312
|
-
await runner.ifElse(
|
|
1395
|
+
await runner.ifElse(46, [
|
|
1313
1396
|
{
|
|
1314
1397
|
condition: async () => !__stack.locals.isOneShot,
|
|
1315
1398
|
body: async (runner2) => {
|
|
@@ -1331,26 +1414,26 @@ graph.node("main", async (__state) => {
|
|
|
1331
1414
|
}
|
|
1332
1415
|
});
|
|
1333
1416
|
await runner2.step(1, async (runner3) => {
|
|
1334
|
-
__stack.locals.
|
|
1417
|
+
__stack.locals.__hoist_14 = await __call(mergedPalette, {
|
|
1335
1418
|
type: "positional",
|
|
1336
1419
|
args: []
|
|
1337
1420
|
});
|
|
1338
|
-
if (hasInterrupts(__stack.locals.
|
|
1421
|
+
if (hasInterrupts(__stack.locals.__hoist_14)) {
|
|
1339
1422
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1340
1423
|
runner3.halt({
|
|
1341
1424
|
...__state,
|
|
1342
|
-
data: __stack.locals.
|
|
1425
|
+
data: __stack.locals.__hoist_14
|
|
1343
1426
|
});
|
|
1344
1427
|
return;
|
|
1345
1428
|
}
|
|
1346
|
-
if (isAborted(__stack.locals.
|
|
1347
|
-
throw __stack.locals.
|
|
1429
|
+
if (isAborted(__stack.locals.__hoist_14)) {
|
|
1430
|
+
throw __stack.locals.__hoist_14.toError();
|
|
1348
1431
|
}
|
|
1349
1432
|
});
|
|
1350
1433
|
await runner2.step(2, async (runner3) => {
|
|
1351
1434
|
const __funcResult = await __call(setSlashPalette, {
|
|
1352
1435
|
type: "positional",
|
|
1353
|
-
args: [__stack.locals.
|
|
1436
|
+
args: [__stack.locals.__hoist_14]
|
|
1354
1437
|
});
|
|
1355
1438
|
if (hasInterrupts(__funcResult)) {
|
|
1356
1439
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1365,26 +1448,26 @@ graph.node("main", async (__state) => {
|
|
|
1365
1448
|
}
|
|
1366
1449
|
});
|
|
1367
1450
|
await runner2.step(3, async (runner3) => {
|
|
1368
|
-
__stack.locals.
|
|
1451
|
+
__stack.locals.__hoist_15 = await __call(chooseSession, {
|
|
1369
1452
|
type: "positional",
|
|
1370
1453
|
args: [__stack.locals.args.flags.continue, __stack.locals.args.flags.resume ?? null]
|
|
1371
1454
|
});
|
|
1372
|
-
if (hasInterrupts(__stack.locals.
|
|
1455
|
+
if (hasInterrupts(__stack.locals.__hoist_15)) {
|
|
1373
1456
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1374
1457
|
runner3.halt({
|
|
1375
1458
|
...__state,
|
|
1376
|
-
data: __stack.locals.
|
|
1459
|
+
data: __stack.locals.__hoist_15
|
|
1377
1460
|
});
|
|
1378
1461
|
return;
|
|
1379
1462
|
}
|
|
1380
|
-
if (isAborted(__stack.locals.
|
|
1381
|
-
throw __stack.locals.
|
|
1463
|
+
if (isAborted(__stack.locals.__hoist_15)) {
|
|
1464
|
+
throw __stack.locals.__hoist_15.toError();
|
|
1382
1465
|
}
|
|
1383
1466
|
});
|
|
1384
1467
|
await runner2.step(4, async (runner3) => {
|
|
1385
1468
|
const __funcResult = await __call(startSession, {
|
|
1386
1469
|
type: "positional",
|
|
1387
|
-
args: [__stack.locals.
|
|
1470
|
+
args: [__stack.locals.__hoist_15, __stack.locals.brain]
|
|
1388
1471
|
});
|
|
1389
1472
|
if (hasInterrupts(__funcResult)) {
|
|
1390
1473
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1401,7 +1484,7 @@ graph.node("main", async (__state) => {
|
|
|
1401
1484
|
}
|
|
1402
1485
|
}
|
|
1403
1486
|
]);
|
|
1404
|
-
await runner.ifElse(
|
|
1487
|
+
await runner.ifElse(47, [
|
|
1405
1488
|
{
|
|
1406
1489
|
condition: async () => __stack.locals.isOneShot,
|
|
1407
1490
|
body: async (runner2) => {
|
|
@@ -1449,26 +1532,26 @@ graph.node("main", async (__state) => {
|
|
|
1449
1532
|
}
|
|
1450
1533
|
]);
|
|
1451
1534
|
await runner2.step(2, async (runner3) => {
|
|
1452
|
-
__stack.locals.
|
|
1535
|
+
__stack.locals.__hoist_16 = await __call(oneShotAgent, {
|
|
1453
1536
|
type: "positional",
|
|
1454
1537
|
args: [__stack.locals.startAgent, __stack.locals.prompt]
|
|
1455
1538
|
});
|
|
1456
|
-
if (hasInterrupts(__stack.locals.
|
|
1539
|
+
if (hasInterrupts(__stack.locals.__hoist_16)) {
|
|
1457
1540
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1458
1541
|
runner3.halt({
|
|
1459
1542
|
...__state,
|
|
1460
|
-
data: __stack.locals.
|
|
1543
|
+
data: __stack.locals.__hoist_16
|
|
1461
1544
|
});
|
|
1462
1545
|
return;
|
|
1463
1546
|
}
|
|
1464
|
-
if (isAborted(__stack.locals.
|
|
1465
|
-
throw __stack.locals.
|
|
1547
|
+
if (isAborted(__stack.locals.__hoist_16)) {
|
|
1548
|
+
throw __stack.locals.__hoist_16.toError();
|
|
1466
1549
|
}
|
|
1467
1550
|
});
|
|
1468
1551
|
await runner2.step(3, async (runner3) => {
|
|
1469
1552
|
const __funcResult = await __call(print, {
|
|
1470
1553
|
type: "positional",
|
|
1471
|
-
args: [__stack.locals.
|
|
1554
|
+
args: [__stack.locals.__hoist_16]
|
|
1472
1555
|
});
|
|
1473
1556
|
if (hasInterrupts(__funcResult)) {
|
|
1474
1557
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1483,33 +1566,33 @@ graph.node("main", async (__state) => {
|
|
|
1483
1566
|
}
|
|
1484
1567
|
});
|
|
1485
1568
|
await runner2.step(4, async (runner3) => {
|
|
1486
|
-
__stack.locals.
|
|
1569
|
+
__stack.locals.__hoist_17 = await __call(getCost, {
|
|
1487
1570
|
type: "positional",
|
|
1488
1571
|
args: []
|
|
1489
1572
|
});
|
|
1490
|
-
if (hasInterrupts(__stack.locals.
|
|
1573
|
+
if (hasInterrupts(__stack.locals.__hoist_17)) {
|
|
1491
1574
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1492
1575
|
runner3.halt({
|
|
1493
1576
|
...__state,
|
|
1494
|
-
data: __stack.locals.
|
|
1577
|
+
data: __stack.locals.__hoist_17
|
|
1495
1578
|
});
|
|
1496
1579
|
return;
|
|
1497
1580
|
}
|
|
1498
|
-
if (isAborted(__stack.locals.
|
|
1499
|
-
throw __stack.locals.
|
|
1581
|
+
if (isAborted(__stack.locals.__hoist_17)) {
|
|
1582
|
+
throw __stack.locals.__hoist_17.toError();
|
|
1500
1583
|
}
|
|
1501
1584
|
});
|
|
1502
1585
|
await runner2.step(5, async (runner3) => {
|
|
1503
|
-
__stack.locals.
|
|
1586
|
+
__stack.locals.__hoist_18 = await __callMethod(__stack.locals.__hoist_17, "toFixed", {
|
|
1504
1587
|
type: "positional",
|
|
1505
1588
|
args: [4]
|
|
1506
1589
|
});
|
|
1507
1590
|
});
|
|
1508
1591
|
await runner2.step(6, async (runner3) => {
|
|
1509
|
-
__stack.locals.roundedCost = `$${__stack.locals.
|
|
1592
|
+
__stack.locals.roundedCost = `$${__stack.locals.__hoist_18}`;
|
|
1510
1593
|
});
|
|
1511
1594
|
await runner2.step(7, async (runner3) => {
|
|
1512
|
-
__stack.locals.
|
|
1595
|
+
__stack.locals.__hoist_19 = await __callMethod(color, "dim", {
|
|
1513
1596
|
type: "positional",
|
|
1514
1597
|
args: [`
|
|
1515
1598
|
Session cost: ${__stack.locals.roundedCost}`]
|
|
@@ -1518,7 +1601,7 @@ Session cost: ${__stack.locals.roundedCost}`]
|
|
|
1518
1601
|
await runner2.step(8, async (runner3) => {
|
|
1519
1602
|
const __funcResult = await __call(print, {
|
|
1520
1603
|
type: "positional",
|
|
1521
|
-
args: [__stack.locals.
|
|
1604
|
+
args: [__stack.locals.__hoist_19]
|
|
1522
1605
|
});
|
|
1523
1606
|
if (hasInterrupts(__funcResult)) {
|
|
1524
1607
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1570,26 +1653,26 @@ Session cost: ${__stack.locals.roundedCost}`]
|
|
|
1570
1653
|
}
|
|
1571
1654
|
});
|
|
1572
1655
|
await runner2.step(11, async (runner3) => {
|
|
1573
|
-
__stack.locals.
|
|
1656
|
+
__stack.locals.__hoist_20 = await __call(getHeader, {
|
|
1574
1657
|
type: "positional",
|
|
1575
1658
|
args: [__stack.locals.brain.name]
|
|
1576
1659
|
});
|
|
1577
|
-
if (hasInterrupts(__stack.locals.
|
|
1660
|
+
if (hasInterrupts(__stack.locals.__hoist_20)) {
|
|
1578
1661
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
1579
1662
|
runner3.halt({
|
|
1580
1663
|
...__state,
|
|
1581
|
-
data: __stack.locals.
|
|
1664
|
+
data: __stack.locals.__hoist_20
|
|
1582
1665
|
});
|
|
1583
1666
|
return;
|
|
1584
1667
|
}
|
|
1585
|
-
if (isAborted(__stack.locals.
|
|
1586
|
-
throw __stack.locals.
|
|
1668
|
+
if (isAborted(__stack.locals.__hoist_20)) {
|
|
1669
|
+
throw __stack.locals.__hoist_20.toError();
|
|
1587
1670
|
}
|
|
1588
1671
|
});
|
|
1589
1672
|
await runner2.step(12, async (runner3) => {
|
|
1590
1673
|
const __funcResult = await __call(print, {
|
|
1591
1674
|
type: "positional",
|
|
1592
|
-
args: [__stack.locals.
|
|
1675
|
+
args: [__stack.locals.__hoist_20]
|
|
1593
1676
|
});
|
|
1594
1677
|
if (hasInterrupts(__funcResult)) {
|
|
1595
1678
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -1657,7 +1740,7 @@ Session cost: ${__stack.locals.roundedCost}`]
|
|
|
1657
1740
|
});
|
|
1658
1741
|
});
|
|
1659
1742
|
if (runner.halted) return runner.haltResult;
|
|
1660
|
-
await runner.hook(
|
|
1743
|
+
await runner.hook(48, async () => {
|
|
1661
1744
|
await callHook({
|
|
1662
1745
|
name: "onNodeEnd",
|
|
1663
1746
|
data: {
|
|
@@ -1739,7 +1822,7 @@ Agent crashed: ${__error.message}`);
|
|
|
1739
1822
|
}
|
|
1740
1823
|
}
|
|
1741
1824
|
var stdin_default = graph;
|
|
1742
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line":
|
|
1825
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line": 44, "col": 2 }, "2": { "line": 48, "col": 2 }, "3": { "line": 49, "col": 2 }, "4": { "line": 50, "col": 2 }, "5": { "line": 60, "col": 2 }, "6": { "line": 61, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_0": { "4.0": { "line": 51, "col": 4 }, "4.1": { "line": 54, "col": 18 }, "4.2.0": { "line": 54, "col": 4 }, "4.2.1": { "line": 55, "col": 6 }, "4.2.2": { "line": 56, "col": 25 }, "4.2.3.0": { "line": 56, "col": 11 }, "4.2.3.1": { "line": 57, "col": 6 }, "4.2.3": { "line": 56, "col": 11 }, "4.2": { "line": 54, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:main": { "2": { "line": 71, "col": 2 }, "3": { "line": 79, "col": 2 }, "4": { "line": 82, "col": 2 }, "6": { "line": 89, "col": 2 }, "7": { "line": 93, "col": 2 }, "8": { "line": 99, "col": 63 }, "9": { "line": 99, "col": 2 }, "10": { "line": 100, "col": 2 }, "11": { "line": 101, "col": 2 }, "12": { "line": 107, "col": 2 }, "13": { "line": 112, "col": 2 }, "14": { "line": 113, "col": 2 }, "15": { "line": 114, "col": 2 }, "16": { "line": 118, "col": 2 }, "17": { "line": 119, "col": 2 }, "18": { "line": 122, "col": 15 }, "19": { "line": 122, "col": 2 }, "20": { "line": 125, "col": 2 }, "21": { "line": 126, "col": 2 }, "22": { "line": 127, "col": 2 }, "23": { "line": 128, "col": 2 }, "25": { "line": 142, "col": 39 }, "26": { "line": 142, "col": 2 }, "27": { "line": 143, "col": 2 }, "28": { "line": 147, "col": 2 }, "29": { "line": 151, "col": 15 }, "30": { "line": 151, "col": 2 }, "31": { "line": 153, "col": 23 }, "32": { "line": 153, "col": 2 }, "33": { "line": 154, "col": 18 }, "34": { "line": 154, "col": 2 }, "36": { "line": 156, "col": 2 }, "37": { "line": 157, "col": 2 }, "39": { "line": 165, "col": 2 }, "40": { "line": 166, "col": 2 }, "41": { "line": 170, "col": 2 }, "42": { "line": 176, "col": 14 }, "43": { "line": 176, "col": 2 }, "44": { "line": 182, "col": 2 }, "46": { "line": 194, "col": 2 }, "47": { "line": 203, "col": 2 }, "3.0": { "line": 80, "col": 4 }, "4.0": { "line": 83, "col": 4 }, "6.0": { "line": 90, "col": 4 }, "6.1": { "line": 91, "col": 4 }, "11.0": { "line": 102, "col": 22 }, "11.2": { "line": 102, "col": 4 }, "11.3": { "line": 103, "col": 10 }, "11.4": { "line": 103, "col": 4 }, "11.5": { "line": 104, "col": 4 }, "11.6": { "line": 105, "col": 4 }, "23.0": { "line": 129, "col": 4 }, "23.1": { "line": 131, "col": 6 }, "23.2": { "line": 130, "col": 4 }, "23.3": { "line": 135, "col": 4 }, "23.4": { "line": 136, "col": 4 }, "23.5": { "line": 138, "col": 4 }, "37.0": { "line": 158, "col": 4 }, "40.0": { "line": 167, "col": 10 }, "40.1": { "line": 167, "col": 4 }, "40.2": { "line": 168, "col": 4 }, "41.0": { "line": 171, "col": 4 }, "44.0": { "line": 184, "col": 6 }, "44.1": { "line": 183, "col": 4 }, "44.2": { "line": 188, "col": 4 }, "46.0": { "line": 195, "col": 4 }, "46.1": { "line": 196, "col": 20 }, "46.2": { "line": 196, "col": 4 }, "46.3": { "line": 198, "col": 6 }, "46.4": { "line": 197, "col": 4 }, "47.0": { "line": 204, "col": 4 }, "47.1.0": { "line": 206, "col": 6 }, "47.1.1.0": { "line": 208, "col": 8 }, "47.1.1": { "line": 207, "col": 6 }, "47.1.2": { "line": 210, "col": 6 }, "47.1": { "line": 205, "col": 4 }, "47.2": { "line": 212, "col": 10 }, "47.3": { "line": 212, "col": 4 }, "47.5": { "line": 213, "col": 28 }, "47.6": { "line": 213, "col": 4 }, "47.7": { "line": 214, "col": 10 }, "47.8": { "line": 214, "col": 4 }, "47.9": { "line": 216, "col": 4 }, "47.10": { "line": 217, "col": 4 }, "47.11": { "line": 218, "col": 10 }, "47.12": { "line": 218, "col": 4 }, "47.13": { "line": 219, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_1": {}, "dist/lib/agents/agency-agent/agent.agency:__block_2": { "47.13.0": { "line": 220, "col": 6 } } };
|
|
1743
1826
|
export {
|
|
1744
1827
|
__getCheckpoints,
|
|
1745
1828
|
__invokeFunction,
|
|
@@ -185,7 +185,7 @@ function registerTools(tools) {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency", "
|
|
188
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency", "93a22a29ec8339bd249d199e45accbcbaa793c2efb69e791e91e6bb3ae7d1a9f", import.meta.url);
|
|
189
189
|
__registerTool(print);
|
|
190
190
|
__registerTool(printJSON);
|
|
191
191
|
__registerTool(input);
|
|
@@ -292,10 +292,10 @@ async function __initializeStatic(__ctx) {
|
|
|
292
292
|
} finally {
|
|
293
293
|
getRuntimeContext().ctx.popHandler();
|
|
294
294
|
}
|
|
295
|
-
mainAgentTools = __deepFreeze([__readStatic(researchAgent, "researchAgent", "/Users/
|
|
295
|
+
mainAgentTools = __deepFreeze([__readStatic(researchAgent, "researchAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/research.agency"), __readStatic(codeAgent, "codeAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"), __readStatic(reviewAgent, "reviewAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/review.agency"), __readStatic(oracleAgent, "oracleAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/oracle.agency"), __readStatic(explorerAgent, "explorerAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/explorer.agency"), __readStatic(writingAgent, "writingAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/writing.agency"), __readStatic(rewriteAgent, "rewriteAgent", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/rewrite.agency"), __readStatic(generateImageFile, "generateImageFile", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/images.agency"), __readStatic(viewImageFile, "viewImageFile", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/images.agency"), __readStatic(learnSkill, "learnSkill", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/learn.agency"), __readStatic(writeToolFor, "writeToolFor", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/learn.agency"), __readStatic(coordinatorSkills, "coordinatorSkills", "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency"), __readStatic(listPresets, "listPresets", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), __readStatic(savePreset, "savePreset", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), __readStatic(deletePreset, "deletePreset", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), __readStatic(setDefaultPreset, "setDefaultPreset", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/presetTools.agency"), ...await __call(readOnlyFileTools, {
|
|
296
296
|
type: "positional",
|
|
297
297
|
args: []
|
|
298
|
-
}), await __callMethod(__readStatic(edit, "edit", "/Users/
|
|
298
|
+
}), await __callMethod(__readStatic(edit, "edit", "/Users/adityabhargava/agency-lang/packages/agency-lang/stdlib/fs.agency"), "partial", {
|
|
299
299
|
type: "named",
|
|
300
300
|
positionalArgs: [],
|
|
301
301
|
namedArgs: {
|
|
@@ -637,7 +637,7 @@ async function __coordinatorInit_impl(context) {
|
|
|
637
637
|
await runner.step(5, async (runner2) => {
|
|
638
638
|
__stack.locals.__hoist_4 = await __call(checkBundledSkill, {
|
|
639
639
|
type: "positional",
|
|
640
|
-
args: [__readStatic(superpowersSkill, "superpowersSkill", "/Users/
|
|
640
|
+
args: [__readStatic(superpowersSkill, "superpowersSkill", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/brains/coordinator/subagents/code.agency"), `brainstorming`]
|
|
641
641
|
});
|
|
642
642
|
if (hasInterrupts(__stack.locals.__hoist_4)) {
|
|
643
643
|
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
@@ -854,7 +854,7 @@ async function __turnTools_impl(turnStart) {
|
|
|
854
854
|
}
|
|
855
855
|
});
|
|
856
856
|
await runner.step(3, async (runner2) => {
|
|
857
|
-
__stack.locals.__hoist_2 = await __callMethod(__readStatic(elapsedTime, "elapsedTime", "/Users/
|
|
857
|
+
__stack.locals.__hoist_2 = await __callMethod(__readStatic(elapsedTime, "elapsedTime", "/Users/adityabhargava/agency-lang/packages/agency-lang/stdlib/date.agency"), "partial", {
|
|
858
858
|
type: "named",
|
|
859
859
|
positionalArgs: [],
|
|
860
860
|
namedArgs: {
|
|
@@ -864,7 +864,7 @@ async function __turnTools_impl(turnStart) {
|
|
|
864
864
|
});
|
|
865
865
|
await runner.step(4, async (runner2) => {
|
|
866
866
|
__functionCompleted = true;
|
|
867
|
-
runner2.halt([...__readStatic(mainAgentTools, "mainAgentTools", "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency"), ...__stack.locals.__hoist_0, ...__stack.locals.__hoist_1, __readStatic(whatIAmDoing, "whatIAmDoing", "/Users/
|
|
867
|
+
runner2.halt([...__readStatic(mainAgentTools, "mainAgentTools", "dist/lib/agents/agency-agent/brains/coordinator/coordinator.agency"), ...__stack.locals.__hoist_0, ...__stack.locals.__hoist_1, __readStatic(whatIAmDoing, "whatIAmDoing", "/Users/adityabhargava/agency-lang/packages/agency-lang/stdlib/agents/lib/toolkits.agency"), __readStatic(question, "question", "/Users/adityabhargava/agency-lang/packages/agency-lang/stdlib/agent.agency"), __stack.locals.__hoist_2]);
|
|
868
868
|
return;
|
|
869
869
|
});
|
|
870
870
|
});
|
|
@@ -154,7 +154,7 @@ function registerTools(tools) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/learn.agency", "
|
|
157
|
+
__registerModuleFingerprint("dist/lib/agents/agency-agent/brains/coordinator/learn.agency", "bd71c5f741e508e5dc8b9f88ec98b6d30781383d7a53267a1ebcd32bcc3f4b8a", import.meta.url);
|
|
158
158
|
__registerTool(print);
|
|
159
159
|
__registerTool(printJSON);
|
|
160
160
|
__registerTool(input);
|
|
@@ -484,7 +484,7 @@ async function __writeToolFor_impl(name, purpose, request) {
|
|
|
484
484
|
body: async (runner2) => {
|
|
485
485
|
await runner2.step(0, async (runner3) => {
|
|
486
486
|
__functionCompleted = true;
|
|
487
|
-
runner3.halt(`Not saved: the name must be at most ${__stack.locals.cap} characters, because the tool is offered as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/
|
|
487
|
+
runner3.halt(`Not saved: the name must be at most ${__stack.locals.cap} characters, because the tool is offered as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/learned.agency")}${__stack.args.name} and providers cap a tool name at ${__readStatic(MAX_TOOL_NAME_LEN, "MAX_TOOL_NAME_LEN", "/Users/adityabhargava/agency-lang/packages/agency-lang/stdlib/skills.agency")}`);
|
|
488
488
|
return;
|
|
489
489
|
});
|
|
490
490
|
}
|
|
@@ -552,7 +552,7 @@ async function __writeToolFor_impl(name, purpose, request) {
|
|
|
552
552
|
]);
|
|
553
553
|
await runner.step(7, async (runner2) => {
|
|
554
554
|
__functionCompleted = true;
|
|
555
|
-
runner2.halt(`Saved the '${__stack.locals.saved.value.name}' tool to the learned catalog as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/
|
|
555
|
+
runner2.halt(`Saved the '${__stack.locals.saved.value.name}' tool to the learned catalog as ${__readStatic(LEARNED_TOOL_PREFIX, "LEARNED_TOOL_PREFIX", "/Users/adityabhargava/agency-lang/packages/agency-lang/dist/lib/agents/agency-agent/lib/learned.agency")}${__stack.locals.saved.value.name}.`);
|
|
556
556
|
return;
|
|
557
557
|
});
|
|
558
558
|
});
|