agency-lang 0.7.4 → 0.7.6
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 +16 -1
- package/dist/lib/agents/agency-agent/agent.js +32 -15
- package/dist/lib/agents/agency-agent/lib/defaultPolicy.agency +16 -17
- package/dist/lib/agents/agency-agent/lib/defaultPolicy.js +13 -147
- package/dist/lib/runtime/policy.js +17 -5
- package/dist/lib/runtime/policy.test.js +39 -0
- package/dist/lib/stdlib/version.d.ts +1 -1
- package/dist/lib/stdlib/version.js +1 -1
- package/package.json +1 -1
|
@@ -1257,7 +1257,7 @@ node main() {
|
|
|
1257
1257
|
policy: {
|
|
1258
1258
|
type: "string",
|
|
1259
1259
|
optional: true,
|
|
1260
|
-
description: "Approval policy for this run: a built-in name (minimal, recommended, with-writes,
|
|
1260
|
+
description: "Approval policy for this run: a built-in name (minimal, recommended, with-writes, approve-all) or a path to a policy JSON file. with-writes auto-approves file writes and git changes scoped to the current directory and its children; approve-all approves EVERY interrupt with no scoping (sandbox use only). Overrides the saved policy without persisting it. Pass --policy with no value to list the built-in policies."
|
|
1261
1261
|
},
|
|
1262
1262
|
local: {
|
|
1263
1263
|
type: "string",
|
|
@@ -1434,6 +1434,21 @@ node main() {
|
|
|
1434
1434
|
setLlmOptions({ maxToolResultChars: maxResultChars })
|
|
1435
1435
|
}
|
|
1436
1436
|
|
|
1437
|
+
// TEMPORARY: raise the per-turn output cap above smoltalk's 4096 default.
|
|
1438
|
+
// With adaptive thinking on, a hard reasoning turn can spend the entire
|
|
1439
|
+
// 4096-token budget thinking and return an empty reply (no text, no tool
|
|
1440
|
+
// call) — see the empty-output failures on regex-log / protein-assembly.
|
|
1441
|
+
// Capped at 20000: these llm() calls are non-streaming, and the Anthropic
|
|
1442
|
+
// SDK refuses a non-streaming request whose estimated time exceeds 10 min,
|
|
1443
|
+
// which is maxTokens > 21333 (60min * maxTokens / 128000 > 10min). 20000
|
|
1444
|
+
// stays under that and is well within every modern-Claude output cap
|
|
1445
|
+
// (Sonnet 5 = 64K, Opus 4.8 = 128K). Branch-scoped so every subagent
|
|
1446
|
+
// inherits it; per-call `llm(..., { maxTokens })` (e.g. the summarizer's
|
|
1447
|
+
// cap) still wins. Superseded by the declarative capabilities table in
|
|
1448
|
+
// docs/superpowers/specs/2026-07-09-model-capabilities-design.md (§2,
|
|
1449
|
+
// maxTokens applied via setLlmOptions at startup) — remove it then.
|
|
1450
|
+
setLlmOptions({ maxTokens: 20000 })
|
|
1451
|
+
|
|
1437
1452
|
// One-shot autonomy: tell the code subagent there is no human to answer
|
|
1438
1453
|
// questions and no next turn, so it must drive to a finished artifact.
|
|
1439
1454
|
// Set before any dispatch so both the pinned `--agent code` path and the
|
|
@@ -7354,7 +7354,7 @@ graph.node("main", async (__state) => {
|
|
|
7354
7354
|
"policy": {
|
|
7355
7355
|
"type": `string`,
|
|
7356
7356
|
"optional": true,
|
|
7357
|
-
"description": `Approval policy for this run: a built-in name (minimal, recommended, with-writes,
|
|
7357
|
+
"description": `Approval policy for this run: a built-in name (minimal, recommended, with-writes, approve-all) or a path to a policy JSON file. with-writes auto-approves file writes and git changes scoped to the current directory and its children; approve-all approves EVERY interrupt with no scoping (sandbox use only). Overrides the saved policy without persisting it. Pass --policy with no value to list the built-in policies.`
|
|
7358
7358
|
},
|
|
7359
7359
|
"local": {
|
|
7360
7360
|
"type": `string`,
|
|
@@ -7954,6 +7954,23 @@ graph.node("main", async (__state) => {
|
|
|
7954
7954
|
__self.__retryable = false;
|
|
7955
7955
|
});
|
|
7956
7956
|
await runner.step(26, async (runner2) => {
|
|
7957
|
+
__self.__retryable = false;
|
|
7958
|
+
const __funcResult = await __call(setLlmOptions, {
|
|
7959
|
+
type: "positional",
|
|
7960
|
+
args: [{
|
|
7961
|
+
"maxTokens": 2e4
|
|
7962
|
+
}]
|
|
7963
|
+
});
|
|
7964
|
+
if (hasInterrupts(__funcResult)) {
|
|
7965
|
+
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
7966
|
+
runner2.halt({
|
|
7967
|
+
...__state,
|
|
7968
|
+
data: __funcResult
|
|
7969
|
+
});
|
|
7970
|
+
return;
|
|
7971
|
+
}
|
|
7972
|
+
});
|
|
7973
|
+
await runner.step(27, async (runner2) => {
|
|
7957
7974
|
__self.__retryable = false;
|
|
7958
7975
|
const __funcResult = await __call(setCodeOneShot, {
|
|
7959
7976
|
type: "positional",
|
|
@@ -7968,7 +7985,7 @@ graph.node("main", async (__state) => {
|
|
|
7968
7985
|
return;
|
|
7969
7986
|
}
|
|
7970
7987
|
});
|
|
7971
|
-
await runner.ifElse(
|
|
7988
|
+
await runner.ifElse(28, [
|
|
7972
7989
|
{
|
|
7973
7990
|
condition: async () => !__eq(__stack.locals.startAgent, ``) && !await __callMethod(__readStatic(START_AGENTS, "START_AGENTS", "dist/lib/agents/agency-agent/agent.agency"), "includes", {
|
|
7974
7991
|
type: "positional",
|
|
@@ -8004,9 +8021,9 @@ graph.node("main", async (__state) => {
|
|
|
8004
8021
|
}
|
|
8005
8022
|
}
|
|
8006
8023
|
]);
|
|
8007
|
-
await runner.step(
|
|
8024
|
+
await runner.step(29, async (runner2) => {
|
|
8008
8025
|
});
|
|
8009
|
-
await runner.ifElse(
|
|
8026
|
+
await runner.ifElse(30, [
|
|
8010
8027
|
{
|
|
8011
8028
|
condition: async () => __stack.locals.seededInteractive,
|
|
8012
8029
|
body: async (runner2) => {
|
|
@@ -8091,13 +8108,13 @@ graph.node("main", async (__state) => {
|
|
|
8091
8108
|
}
|
|
8092
8109
|
}
|
|
8093
8110
|
]);
|
|
8094
|
-
await runner.step(
|
|
8111
|
+
await runner.step(31, async (runner2) => {
|
|
8095
8112
|
__self.__retryable = false;
|
|
8096
8113
|
});
|
|
8097
|
-
await runner.step(
|
|
8114
|
+
await runner.step(32, async (runner2) => {
|
|
8098
8115
|
__stack.locals.forceOneShot = __stack.locals.args.flags.print || __stack.locals.hasQuery;
|
|
8099
8116
|
});
|
|
8100
|
-
await runner.ifElse(
|
|
8117
|
+
await runner.ifElse(33, [
|
|
8101
8118
|
{
|
|
8102
8119
|
condition: async () => __stack.locals.forceOneShot || !await __call(isTTY, {
|
|
8103
8120
|
type: "positional",
|
|
@@ -8170,9 +8187,9 @@ graph.node("main", async (__state) => {
|
|
|
8170
8187
|
}
|
|
8171
8188
|
}
|
|
8172
8189
|
]);
|
|
8173
|
-
await runner.step(33, async (runner2) => {
|
|
8174
|
-
});
|
|
8175
8190
|
await runner.step(34, async (runner2) => {
|
|
8191
|
+
});
|
|
8192
|
+
await runner.step(35, async (runner2) => {
|
|
8176
8193
|
__self.__retryable = false;
|
|
8177
8194
|
const __funcResult = await __call(setTitle, {
|
|
8178
8195
|
type: "positional",
|
|
@@ -8187,7 +8204,7 @@ graph.node("main", async (__state) => {
|
|
|
8187
8204
|
return;
|
|
8188
8205
|
}
|
|
8189
8206
|
});
|
|
8190
|
-
await runner.step(
|
|
8207
|
+
await runner.step(36, async (runner2) => {
|
|
8191
8208
|
__self.__retryable = false;
|
|
8192
8209
|
const __funcResult = await __call(clearScreen, {
|
|
8193
8210
|
type: "positional",
|
|
@@ -8202,7 +8219,7 @@ graph.node("main", async (__state) => {
|
|
|
8202
8219
|
return;
|
|
8203
8220
|
}
|
|
8204
8221
|
});
|
|
8205
|
-
await runner.step(
|
|
8222
|
+
await runner.step(37, async (runner2) => {
|
|
8206
8223
|
const __funcResult = await __call(printHeader, {
|
|
8207
8224
|
type: "positional",
|
|
8208
8225
|
args: []
|
|
@@ -8216,7 +8233,7 @@ graph.node("main", async (__state) => {
|
|
|
8216
8233
|
return;
|
|
8217
8234
|
}
|
|
8218
8235
|
});
|
|
8219
|
-
await runner.step(
|
|
8236
|
+
await runner.step(38, async (runner2) => {
|
|
8220
8237
|
__stack.locals.handler = await __call(setupSession, {
|
|
8221
8238
|
type: "positional",
|
|
8222
8239
|
args: [true]
|
|
@@ -8230,7 +8247,7 @@ graph.node("main", async (__state) => {
|
|
|
8230
8247
|
return;
|
|
8231
8248
|
}
|
|
8232
8249
|
});
|
|
8233
|
-
await runner.step(
|
|
8250
|
+
await runner.step(39, async (runner2) => {
|
|
8234
8251
|
const __funcResult = await __call(startInteractive, {
|
|
8235
8252
|
type: "positional",
|
|
8236
8253
|
args: [__stack.locals.handler, ``, ``]
|
|
@@ -8246,7 +8263,7 @@ graph.node("main", async (__state) => {
|
|
|
8246
8263
|
});
|
|
8247
8264
|
});
|
|
8248
8265
|
if (runner.halted) return runner.haltResult;
|
|
8249
|
-
await runner.hook(
|
|
8266
|
+
await runner.hook(40, async () => {
|
|
8250
8267
|
await callHook({
|
|
8251
8268
|
name: "onNodeEnd",
|
|
8252
8269
|
data: {
|
|
@@ -8312,7 +8329,7 @@ Agent crashed: ${__error.message}`);
|
|
|
8312
8329
|
}
|
|
8313
8330
|
}
|
|
8314
8331
|
var stdin_default = graph;
|
|
8315
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:__cb_top_0": { "1": { "line": 159, "col": 2 }, "1.0": { "line": 160, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_1": { "1": { "line": 165, "col": 2 }, "1.0.0": { "line": 166, "col": 4 }, "1.0.1": { "line": 167, "col": 6 }, "1.0.2": { "line": 168, "col": 11 }, "1.0.3": { "line": 169, "col": 6 }, "1.0.4": { "line": 171, "col": 6 }, "1.0": { "line": 166, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_2": { "1": { "line": 177, "col": 2 }, "1.0": { "line": 178, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_3": { "1": { "line": 183, "col": 2 }, "1.0": { "line": 184, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_4": { "1": { "line": 224, "col": 2 }, "1.0": { "line": 225, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:_showTraces": { "1": { "line": 155, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:retryReasonLabel": { "1": { "line": 195, "col": 2 }, "2": { "line": 198, "col": 2 }, "3": { "line": 201, "col": 2 }, "4": { "line": 204, "col": 2 }, "5": { "line": 207, "col": 2 }, "6": { "line": 210, "col": 2 }, "7": { "line": 213, "col": 2 }, "1.0": { "line": 196, "col": 4 }, "2.0": { "line": 199, "col": 4 }, "3.0": { "line": 202, "col": 4 }, "4.0": { "line": 205, "col": 4 }, "5.0": { "line": 208, "col": 4 }, "6.0": { "line": 211, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:formatTurnFailure": { "1": { "line": 240, "col": 2 }, "2": { "line": 243, "col": 2 }, "3": { "line": 246, "col": 2 }, "4": { "line": 249, "col": 2 }, "1.0": { "line": 241, "col": 4 }, "2.0": { "line": 244, "col": 4 }, "3.0": { "line": 247, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:renderLLMCallResponse": { "1": { "line": 266, "col": 2 }, "2": { "line": 267, "col": 2 }, "3": { "line": 270, "col": 2 }, "5": { "line": 275, "col": 2 }, "2.0": { "line": 268, "col": 4 }, "3.0.0": { "line": 272, "col": 6 }, "3.0": { "line": 271, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:loadAgentsMd": { "1": { "line": 286, "col": 2 }, "2": { "line": 289, "col": 2 }, "3": { "line": 290, "col": 2 }, "4": { "line": 293, "col": 2 }, "1.0": { "line": 287, "col": 4 }, "2.0": { "line": 289, "col": 2 }, "3.0": { "line": 291, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:builtinPalette": { "1": { "line": 307, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:mergedPalette": { "1": { "line": 324, "col": 2 }, "2": { "line": 325, "col": 2 }, "3": { "line": 332, "col": 2 }, "4": { "line": 333, "col": 2 }, "5": { "line": 336, "col": 2 }, "2.0": { "line": 326, "col": 4 }, "2.1.0": { "line": 328, "col": 6 }, "2.1": { "line": 327, "col": 4 }, "2.2": { "line": 330, "col": 4 }, "4.0": { "line": 334, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:switchModel": { "1": { "line": 363, "col": 2 }, "2": { "line": 364, "col": 2 }, "3": { "line": 367, "col": 2 }, "4": { "line": 371, "col": 2 }, "5": { "line": 372, "col": 2 }, "7": { "line": 382, "col": 2 }, "9": { "line": 390, "col": 2 }, "10": { "line": 391, "col": 2 }, "11": { "line": 392, "col": 2 }, "12": { "line": 401, "col": 2 }, "13": { "line": 402, "col": 2 }, "15": { "line": 410, "col": 2 }, "16": { "line": 411, "col": 2 }, "17": { "line": 412, "col": 2 }, "2.0": { "line": 365, "col": 4 }, "5.0": { "line": 373, "col": 4 }, "5.1": { "line": 376, "col": 4 }, "7.0": { "line": 383, "col": 4 }, "7.1": { "line": 385, "col": 4 }, "13.0": { "line": 403, "col": 4 }, "13.1": { "line": 404, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:reactToSlotChange": { "1": { "line": 424, "col": 2 }, "3": { "line": 435, "col": 2 }, "1.0": { "line": 425, "col": 4 }, "1.1": { "line": 432, "col": 4 }, "1.3": { "line": 433, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:modelChoiceItems": { "1": { "line": 441, "col": 2 }, "2": { "line": 442, "col": 2 }, "4": { "line": 449, "col": 2 }, "2.0": { "line": 443, "col": 4 }, "2.1": { "line": 444, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:parseModelsFilters": { "1": { "line": 456, "col": 2 }, "2": { "line": 457, "col": 2 }, "3": { "line": 460, "col": 2 }, "4": { "line": 461, "col": 2 }, "5": { "line": 464, "col": 2 }, "2.0": { "line": 458, "col": 4 }, "4.0": { "line": 462, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:_runTurn": { "2": { "line": 477, "col": 2 }, "3": { "line": 478, "col": 2 }, "4": { "line": 481, "col": 2 }, "5": { "line": 484, "col": 2 }, "7": { "line": 488, "col": 2 }, "9": { "line": 493, "col": 2 }, "11": { "line": 499, "col": 2 }, "13": { "line": 514, "col": 2 }, "15": { "line": 542, "col": 2 }, "17": { "line": 587, "col": 2 }, "19": { "line": 601, "col": 2 }, "21": { "line": 643, "col": 2 }, "22": { "line": 644, "col": 2 }, "24": { "line": 653, "col": 2 }, "3.0": { "line": 479, "col": 4 }, "4.0": { "line": 482, "col": 4 }, "5.0": { "line": 485, "col": 4 }, "5.1": { "line": 486, "col": 4 }, "7.0": { "line": 489, "col": 4 }, "7.1": { "line": 490, "col": 4 }, "7.2": { "line": 491, "col": 4 }, "9.0": { "line": 494, "col": 4 }, "9.1": { "line": 497, "col": 4 }, "11.0": { "line": 500, "col": 4 }, "11.1": { "line": 501, "col": 4 }, "11.2.0": { "line": 509, "col": 6 }, "11.2.1": { "line": 510, "col": 6 }, "11.2": { "line": 508, "col": 4 }, "11.4": { "line": 512, "col": 4 }, "13.1": { "line": 522, "col": 4 }, "13.2": { "line": 523, "col": 4 }, "13.3": { "line": 524, "col": 4 }, "13.4.0": { "line": 526, "col": 6 }, "13.4.1": { "line": 527, "col": 6 }, "13.4": { "line": 525, "col": 4 }, "13.5": { "line": 529, "col": 4 }, "13.6": { "line": 530, "col": 4 }, "13.7.0": { "line": 532, "col": 6 }, "13.7.1": { "line": 533, "col": 6 }, "13.7.2.0": { "line": 535, "col": 8 }, "13.7.2": { "line": 534, "col": 6 }, "13.7": { "line": 531, "col": 4 }, "13.9": { "line": 540, "col": 4 }, "15.0": { "line": 543, "col": 4 }, "15.1.0": { "line": 545, "col": 6 }, "15.1": { "line": 544, "col": 4 }, "15.2.0": { "line": 548, "col": 6 }, "15.2.1": { "line": 549, "col": 6 }, "15.2.2.0": { "line": 551, "col": 8 }, "15.2.2.1.0": { "line": 553, "col": 10 }, "15.2.2.1": { "line": 552, "col": 8 }, "15.2.2": { "line": 550, "col": 6 }, "15.2.4": { "line": 556, "col": 6 }, "15.2.5": { "line": 557, "col": 6 }, "15.2.6.0": { "line": 565, "col": 8 }, "15.2.6": { "line": 564, "col": 6 }, "15.2.7": { "line": 567, "col": 6 }, "15.2": { "line": 547, "col": 4 }, "15.4": { "line": 569, "col": 4 }, "15.5": { "line": 573, "col": 4 }, "15.6": { "line": 574, "col": 4 }, "15.7.0": { "line": 576, "col": 6 }, "15.7": { "line": 575, "col": 4 }, "15.8": { "line": 578, "col": 4 }, "15.9.0": { "line": 580, "col": 6 }, "15.9.1.0": { "line": 582, "col": 8 }, "15.9.1": { "line": 581, "col": 6 }, "15.9": { "line": 579, "col": 4 }, "15.11": { "line": 585, "col": 4 }, "17.0": { "line": 588, "col": 4 }, "17.1": { "line": 589, "col": 4 }, "17.2.0": { "line": 591, "col": 6 }, "17.2.1": { "line": 592, "col": 6 }, "17.2": { "line": 590, "col": 4 }, "17.4.0": { "line": 595, "col": 6 }, "17.4": { "line": 594, "col": 4 }, "17.6": { "line": 599, "col": 4 }, "19.0.0": { "line": 603, "col": 6 }, "19.0.1": { "line": 608, "col": 6 }, "19.0": { "line": 602, "col": 4 }, "19.2": { "line": 610, "col": 4 }, "19.3.0": { "line": 612, "col": 6 }, "19.3": { "line": 611, "col": 4 }, "19.5": { "line": 617, "col": 4 }, "19.6.0": { "line": 625, "col": 6 }, "19.6": { "line": 624, "col": 4 }, "19.7": { "line": 627, "col": 4 }, "19.8": { "line": 628, "col": 4 }, "19.9": { "line": 629, "col": 4 }, "19.10.0": { "line": 631, "col": 6 }, "19.10": { "line": 630, "col": 4 }, "19.12": { "line": 633, "col": 4 }, "19.13": { "line": 634, "col": 4 }, "22.0": { "line": 644, "col": 2 }, "22.1.0": { "line": 646, "col": 6 }, "22.1.1": { "line": 648, "col": 6 }, "22.1": { "line": 645, "col": 4 }, "22.3": { "line": 650, "col": 9 }, "22.4": { "line": 651, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:resolveEditInputs": { "1": { "line": 839, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_0": { "1.0.0": { "line": 841, "col": 6 }, "1.0": { "line": 840, "col": 4 }, "1.1": { "line": 843, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:generateImageFile": { "2": { "line": 871, "col": 2 }, "3": { "line": 872, "col": 2 }, "4": { "line": 873, "col": 2 }, "6": { "line": 879, "col": 2 }, "7": { "line": 885, "col": 2 }, "9": { "line": 891, "col": 2 }, "10": { "line": 892, "col": 2 }, "4.0": { "line": 874, "col": 4 }, "7.0": { "line": 886, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:mainAgent": { "1": { "line": 905, "col": 2 }, "3": { "line": 919, "col": 2 }, "1.0": { "line": 906, "col": 4 }, "1.1.1": { "line": 911, "col": 6 }, "1.1.2": { "line": 912, "col": 6 }, "1.1": { "line": 907, "col": 4 }, "1.3": { "line": 914, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:agentReplyVia": { "1": { "line": 928, "col": 2 }, "2": { "line": 929, "col": 2 }, "4": { "line": 932, "col": 2 }, "6": { "line": 935, "col": 2 }, "8": { "line": 938, "col": 2 }, "10": { "line": 941, "col": 2 }, "12": { "line": 947, "col": 2 }, "13": { "line": 948, "col": 2 }, "15": { "line": 953, "col": 2 }, "16": { "line": 960, "col": 2 }, "18": { "line": 963, "col": 2 }, "19": { "line": 966, "col": 2 }, "20": { "line": 967, "col": 2 }, "2.0": { "line": 930, "col": 4 }, "4.0": { "line": 933, "col": 4 }, "6.0": { "line": 936, "col": 4 }, "8.0": { "line": 939, "col": 4 }, "10.0": { "line": 942, "col": 4 }, "13.0": { "line": 949, "col": 4 }, "15.1": { "line": 958, "col": 4 }, "16.0": { "line": 961, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_1": { "18.0": { "line": 964, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:agentReply": { "1": { "line": 977, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:roundedCost": { "1": { "line": 981, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:_buildStatus": { "1": { "line": 985, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:sample": { "1": { "line": 993, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:printHeader": { "1": { "line": 997, "col": 2 }, "2": { "line": 998, "col": 2 }, "3": { "line": 1020, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_2": { "2.0": { "line": 1005, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_3": { "2.0.0": { "line": 1006, "col": 6 }, "2.0.1": { "line": 1014, "col": 6 }, "2.0.2": { "line": 1015, "col": 6 } }, "dist/lib/agents/agency-agent/agent.agency:__block_4": { "2.0.0.0": { "line": 1007, "col": 8 }, "2.0.0.1": { "line": 1008, "col": 8 }, "2.0.0.2": { "line": 1009, "col": 8 }, "2.0.0.3": { "line": 1010, "col": 8 }, "2.0.0.4": { "line": 1011, "col": 8 }, "2.0.0.5": { "line": 1012, "col": 8 } }, "dist/lib/agents/agency-agent/agent.agency:__block_5": { "2.0.2.0": { "line": 1016, "col": 8 } }, "dist/lib/agents/agency-agent/agent.agency:printPolicyHelp": { "1": { "line": 1026, "col": 2 }, "2": { "line": 1027, "col": 2 }, "3": { "line": 1030, "col": 2 }, "4": { "line": 1031, "col": 2 }, "5": { "line": 1032, "col": 2 }, "5.0": { "line": 1033, "col": 4 }, "5.1": { "line": 1034, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:givePolicyChoice": { "1": { "line": 1039, "col": 2 }, "2": { "line": 1040, "col": 2 }, "3": { "line": 1041, "col": 2 }, "4": { "line": 1052, "col": 2 }, "5": { "line": 1053, "col": 9 }, "6": { "line": 1053, "col": 2 }, "5.0": { "line": 1054, "col": 17 }, "5.1": { "line": 1054, "col": 17 }, "5.2": { "line": 1055, "col": 21 }, "5.3": { "line": 1055, "col": 21 } }, "dist/lib/agents/agency-agent/agent.agency:setupSession": { "2": { "line": 1071, "col": 2 }, "3": { "line": 1076, "col": 2 }, "4": { "line": 1077, "col": 2 }, "5": { "line": 1083, "col": 2 }, "6": { "line": 1084, "col": 2 }, "7": { "line": 1086, "col": 2 }, "9": { "line": 1134, "col": 2 }, "3.0": { "line": 1076, "col": 2 }, "7.1": { "line": 1091, "col": 4 }, "7.2.1": { "line": 1097, "col": 6 }, "7.2.2": { "line": 1098, "col": 6 }, "7.2.4": { "line": 1103, "col": 6 }, "7.2.5.0": { "line": 1104, "col": 6 }, "7.2.5.1": { "line": 1105, "col": 8 }, "7.2.5.2": { "line": 1110, "col": 8 }, "7.2.5": { "line": 1104, "col": 6 }, "7.2.7": { "line": 1112, "col": 6 }, "7.2": { "line": 1092, "col": 4 }, "7.4": { "line": 1115, "col": 4 }, "7.5.0": { "line": 1116, "col": 4 }, "7.5.1.0.0": { "line": 1119, "col": 10 }, "7.5.1.0.1": { "line": 1120, "col": 10 }, "7.5.1.0.2": { "line": 1122, "col": 10 }, "7.5.1.0": { "line": 1118, "col": 8 }, "7.5.1.2": { "line": 1125, "col": 8 }, "7.5.1.3": { "line": 1126, "col": 8 }, "7.5.1": { "line": 1117, "col": 6 }, "7.5.3": { "line": 1129, "col": 6 }, "7.5": { "line": 1116, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line": 1148, "col": 2 }, "2": { "line": 1149, "col": 2 }, "3": { "line": 1150, "col": 2 }, "4": { "line": 1151, "col": 2 }, "5": { "line": 1164, "col": 2 }, "4.1": { "line": 1155, "col": 4 }, "4.2.0": { "line": 1156, "col": 4 }, "4.2.1": { "line": 1157, "col": 6 }, "4.2.2": { "line": 1158, "col": 11 }, "4.2.3": { "line": 1159, "col": 6 }, "4.2": { "line": 1156, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:_runSeedTurn": { "1": { "line": 1171, "col": 2 }, "2": { "line": 1172, "col": 2 }, "3": { "line": 1173, "col": 2 }, "3.0": { "line": 1173, "col": 2 }, "3.1.0": { "line": 1175, "col": 6 }, "3.1.1": { "line": 1177, "col": 6 }, "3.1": { "line": 1174, "col": 4 }, "3.3": { "line": 1179, "col": 9 }, "3.4": { "line": 1180, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:startInteractive": { "1": { "line": 1191, "col": 2 }, "3": { "line": 1206, "col": 2 }, "1.0.0": { "line": 1193, "col": 6 }, "1.0": { "line": 1192, "col": 4 }, "1.1": { "line": 1195, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:main": { "2": { "line": 1212, "col": 2 }, "3": { "line": 1298, "col": 2 }, "4": { "line": 1301, "col": 2 }, "6": { "line": 1307, "col": 2 }, "7": { "line": 1311, "col": 2 }, "8": { "line": 1318, "col": 2 }, "9": { "line": 1319, "col": 2 }, "10": { "line": 1320, "col": 2 }, "11": { "line": 1321, "col": 2 }, "12": { "line": 1327, "col": 2 }, "14": { "line": 1409, "col": 2 }, "15": { "line": 1410, "col": 2 }, "16": { "line": 1411, "col": 2 }, "17": { "line": 1412, "col": 2 }, "18": { "line": 1416, "col": 2 }, "19": { "line": 1417, "col": 2 }, "20": { "line": 1427, "col": 2 }, "21": { "line": 1428, "col": 2 }, "23": { "line": 1431, "col": 2 }, "24": { "line": 1432, "col": 2 }, "26": { "line": 1440, "col": 2 }, "27": { "line": 1443, "col": 2 }, "29": { "line": 1458, "col": 2 }, "31": { "line": 1477, "col": 2 }, "32": { "line": 1478, "col": 2 }, "34": { "line": 1496, "col": 2 }, "35": { "line": 1497, "col": 2 }, "36": { "line": 1498, "col": 2 }, "37": { "line": 1499, "col": 2 }, "38": { "line": 1500, "col": 2 }, "3.0": { "line": 1299, "col": 4 }, "4.0": { "line": 1302, "col": 4 }, "6.0": { "line": 1308, "col": 4 }, "6.1": { "line": 1309, "col": 4 }, "11.0": { "line": 1322, "col": 4 }, "11.1": { "line": 1325, "col": 4 }, "12.1.0": { "line": 1331, "col": 6 }, "12.1.1": { "line": 1332, "col": 6 }, "12.1": { "line": 1330, "col": 4 }, "12.3.0": { "line": 1335, "col": 6 }, "12.3.1": { "line": 1336, "col": 6 }, "12.3.2": { "line": 1337, "col": 6 }, "12.3": { "line": 1334, "col": 4 }, "12.5": { "line": 1339, "col": 4 }, "12.6.0": { "line": 1341, "col": 6 }, "12.6": { "line": 1340, "col": 4 }, "12.8": { "line": 1346, "col": 4 }, "12.9.0": { "line": 1354, "col": 6 }, "12.9": { "line": 1353, "col": 4 }, "12.10": { "line": 1356, "col": 4 }, "12.11": { "line": 1357, "col": 4 }, "12.12": { "line": 1360, "col": 4 }, "12.13": { "line": 1364, "col": 4 }, "12.15": { "line": 1368, "col": 4 }, "12.16": { "line": 1369, "col": 4 }, "12.17": { "line": 1370, "col": 4 }, "12.18": { "line": 1371, "col": 4 }, "12.19.0.0": { "line": 1374, "col": 8 }, "12.19.0.1": { "line": 1376, "col": 8 }, "12.19.0.2": { "line": 1378, "col": 8 }, "12.19.0.3": { "line": 1380, "col": 8 }, "12.19.0.4": { "line": 1385, "col": 8 }, "12.19.0": { "line": 1373, "col": 6 }, "12.19": { "line": 1372, "col": 4 }, "12.20": { "line": 1388, "col": 4 }, "12.21": { "line": 1389, "col": 4 }, "12.22.0": { "line": 1391, "col": 6 }, "12.22": { "line": 1390, "col": 4 }, "12.23.0": { "line": 1394, "col": 6 }, "12.23": { "line": 1393, "col": 4 }, "12.24": { "line": 1396, "col": 4 }, "12.25": { "line": 1402, "col": 4 }, "12.26": { "line": 1403, "col": 4 }, "21.0": { "line": 1429, "col": 4 }, "24.0": { "line": 1433, "col": 4 }, "27.0": { "line": 1444, "col": 4 }, "27.1": { "line": 1449, "col": 4 }, "29.0": { "line": 1459, "col": 4 }, "29.1": { "line": 1460, "col": 4 }, "29.2": { "line": 1461, "col": 4 }, "29.3": { "line": 1462, "col": 4 }, "29.4": { "line": 1463, "col": 4 }, "29.5": { "line": 1464, "col": 4 }, "32.0": { "line": 1479, "col": 4 }, "32.1.0": { "line": 1481, "col": 6 }, "32.1.1.0": { "line": 1483, "col": 8 }, "32.1.1": { "line": 1482, "col": 6 }, "32.1.2": { "line": 1485, "col": 6 }, "32.1": { "line": 1480, "col": 4 }, "32.2": { "line": 1487, "col": 4 }, "32.3": { "line": 1488, "col": 4 } } };
|
|
8332
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/agent.agency:__cb_top_0": { "1": { "line": 159, "col": 2 }, "1.0": { "line": 160, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_1": { "1": { "line": 165, "col": 2 }, "1.0.0": { "line": 166, "col": 4 }, "1.0.1": { "line": 167, "col": 6 }, "1.0.2": { "line": 168, "col": 11 }, "1.0.3": { "line": 169, "col": 6 }, "1.0.4": { "line": 171, "col": 6 }, "1.0": { "line": 166, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_2": { "1": { "line": 177, "col": 2 }, "1.0": { "line": 178, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_3": { "1": { "line": 183, "col": 2 }, "1.0": { "line": 184, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__cb_top_4": { "1": { "line": 224, "col": 2 }, "1.0": { "line": 225, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:_showTraces": { "1": { "line": 155, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:retryReasonLabel": { "1": { "line": 195, "col": 2 }, "2": { "line": 198, "col": 2 }, "3": { "line": 201, "col": 2 }, "4": { "line": 204, "col": 2 }, "5": { "line": 207, "col": 2 }, "6": { "line": 210, "col": 2 }, "7": { "line": 213, "col": 2 }, "1.0": { "line": 196, "col": 4 }, "2.0": { "line": 199, "col": 4 }, "3.0": { "line": 202, "col": 4 }, "4.0": { "line": 205, "col": 4 }, "5.0": { "line": 208, "col": 4 }, "6.0": { "line": 211, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:formatTurnFailure": { "1": { "line": 240, "col": 2 }, "2": { "line": 243, "col": 2 }, "3": { "line": 246, "col": 2 }, "4": { "line": 249, "col": 2 }, "1.0": { "line": 241, "col": 4 }, "2.0": { "line": 244, "col": 4 }, "3.0": { "line": 247, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:renderLLMCallResponse": { "1": { "line": 266, "col": 2 }, "2": { "line": 267, "col": 2 }, "3": { "line": 270, "col": 2 }, "5": { "line": 275, "col": 2 }, "2.0": { "line": 268, "col": 4 }, "3.0.0": { "line": 272, "col": 6 }, "3.0": { "line": 271, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:loadAgentsMd": { "1": { "line": 286, "col": 2 }, "2": { "line": 289, "col": 2 }, "3": { "line": 290, "col": 2 }, "4": { "line": 293, "col": 2 }, "1.0": { "line": 287, "col": 4 }, "2.0": { "line": 289, "col": 2 }, "3.0": { "line": 291, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:builtinPalette": { "1": { "line": 307, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:mergedPalette": { "1": { "line": 324, "col": 2 }, "2": { "line": 325, "col": 2 }, "3": { "line": 332, "col": 2 }, "4": { "line": 333, "col": 2 }, "5": { "line": 336, "col": 2 }, "2.0": { "line": 326, "col": 4 }, "2.1.0": { "line": 328, "col": 6 }, "2.1": { "line": 327, "col": 4 }, "2.2": { "line": 330, "col": 4 }, "4.0": { "line": 334, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:switchModel": { "1": { "line": 363, "col": 2 }, "2": { "line": 364, "col": 2 }, "3": { "line": 367, "col": 2 }, "4": { "line": 371, "col": 2 }, "5": { "line": 372, "col": 2 }, "7": { "line": 382, "col": 2 }, "9": { "line": 390, "col": 2 }, "10": { "line": 391, "col": 2 }, "11": { "line": 392, "col": 2 }, "12": { "line": 401, "col": 2 }, "13": { "line": 402, "col": 2 }, "15": { "line": 410, "col": 2 }, "16": { "line": 411, "col": 2 }, "17": { "line": 412, "col": 2 }, "2.0": { "line": 365, "col": 4 }, "5.0": { "line": 373, "col": 4 }, "5.1": { "line": 376, "col": 4 }, "7.0": { "line": 383, "col": 4 }, "7.1": { "line": 385, "col": 4 }, "13.0": { "line": 403, "col": 4 }, "13.1": { "line": 404, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:reactToSlotChange": { "1": { "line": 424, "col": 2 }, "3": { "line": 435, "col": 2 }, "1.0": { "line": 425, "col": 4 }, "1.1": { "line": 432, "col": 4 }, "1.3": { "line": 433, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:modelChoiceItems": { "1": { "line": 441, "col": 2 }, "2": { "line": 442, "col": 2 }, "4": { "line": 449, "col": 2 }, "2.0": { "line": 443, "col": 4 }, "2.1": { "line": 444, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:parseModelsFilters": { "1": { "line": 456, "col": 2 }, "2": { "line": 457, "col": 2 }, "3": { "line": 460, "col": 2 }, "4": { "line": 461, "col": 2 }, "5": { "line": 464, "col": 2 }, "2.0": { "line": 458, "col": 4 }, "4.0": { "line": 462, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:_runTurn": { "2": { "line": 477, "col": 2 }, "3": { "line": 478, "col": 2 }, "4": { "line": 481, "col": 2 }, "5": { "line": 484, "col": 2 }, "7": { "line": 488, "col": 2 }, "9": { "line": 493, "col": 2 }, "11": { "line": 499, "col": 2 }, "13": { "line": 514, "col": 2 }, "15": { "line": 542, "col": 2 }, "17": { "line": 587, "col": 2 }, "19": { "line": 601, "col": 2 }, "21": { "line": 643, "col": 2 }, "22": { "line": 644, "col": 2 }, "24": { "line": 653, "col": 2 }, "3.0": { "line": 479, "col": 4 }, "4.0": { "line": 482, "col": 4 }, "5.0": { "line": 485, "col": 4 }, "5.1": { "line": 486, "col": 4 }, "7.0": { "line": 489, "col": 4 }, "7.1": { "line": 490, "col": 4 }, "7.2": { "line": 491, "col": 4 }, "9.0": { "line": 494, "col": 4 }, "9.1": { "line": 497, "col": 4 }, "11.0": { "line": 500, "col": 4 }, "11.1": { "line": 501, "col": 4 }, "11.2.0": { "line": 509, "col": 6 }, "11.2.1": { "line": 510, "col": 6 }, "11.2": { "line": 508, "col": 4 }, "11.4": { "line": 512, "col": 4 }, "13.1": { "line": 522, "col": 4 }, "13.2": { "line": 523, "col": 4 }, "13.3": { "line": 524, "col": 4 }, "13.4.0": { "line": 526, "col": 6 }, "13.4.1": { "line": 527, "col": 6 }, "13.4": { "line": 525, "col": 4 }, "13.5": { "line": 529, "col": 4 }, "13.6": { "line": 530, "col": 4 }, "13.7.0": { "line": 532, "col": 6 }, "13.7.1": { "line": 533, "col": 6 }, "13.7.2.0": { "line": 535, "col": 8 }, "13.7.2": { "line": 534, "col": 6 }, "13.7": { "line": 531, "col": 4 }, "13.9": { "line": 540, "col": 4 }, "15.0": { "line": 543, "col": 4 }, "15.1.0": { "line": 545, "col": 6 }, "15.1": { "line": 544, "col": 4 }, "15.2.0": { "line": 548, "col": 6 }, "15.2.1": { "line": 549, "col": 6 }, "15.2.2.0": { "line": 551, "col": 8 }, "15.2.2.1.0": { "line": 553, "col": 10 }, "15.2.2.1": { "line": 552, "col": 8 }, "15.2.2": { "line": 550, "col": 6 }, "15.2.4": { "line": 556, "col": 6 }, "15.2.5": { "line": 557, "col": 6 }, "15.2.6.0": { "line": 565, "col": 8 }, "15.2.6": { "line": 564, "col": 6 }, "15.2.7": { "line": 567, "col": 6 }, "15.2": { "line": 547, "col": 4 }, "15.4": { "line": 569, "col": 4 }, "15.5": { "line": 573, "col": 4 }, "15.6": { "line": 574, "col": 4 }, "15.7.0": { "line": 576, "col": 6 }, "15.7": { "line": 575, "col": 4 }, "15.8": { "line": 578, "col": 4 }, "15.9.0": { "line": 580, "col": 6 }, "15.9.1.0": { "line": 582, "col": 8 }, "15.9.1": { "line": 581, "col": 6 }, "15.9": { "line": 579, "col": 4 }, "15.11": { "line": 585, "col": 4 }, "17.0": { "line": 588, "col": 4 }, "17.1": { "line": 589, "col": 4 }, "17.2.0": { "line": 591, "col": 6 }, "17.2.1": { "line": 592, "col": 6 }, "17.2": { "line": 590, "col": 4 }, "17.4.0": { "line": 595, "col": 6 }, "17.4": { "line": 594, "col": 4 }, "17.6": { "line": 599, "col": 4 }, "19.0.0": { "line": 603, "col": 6 }, "19.0.1": { "line": 608, "col": 6 }, "19.0": { "line": 602, "col": 4 }, "19.2": { "line": 610, "col": 4 }, "19.3.0": { "line": 612, "col": 6 }, "19.3": { "line": 611, "col": 4 }, "19.5": { "line": 617, "col": 4 }, "19.6.0": { "line": 625, "col": 6 }, "19.6": { "line": 624, "col": 4 }, "19.7": { "line": 627, "col": 4 }, "19.8": { "line": 628, "col": 4 }, "19.9": { "line": 629, "col": 4 }, "19.10.0": { "line": 631, "col": 6 }, "19.10": { "line": 630, "col": 4 }, "19.12": { "line": 633, "col": 4 }, "19.13": { "line": 634, "col": 4 }, "22.0": { "line": 644, "col": 2 }, "22.1.0": { "line": 646, "col": 6 }, "22.1.1": { "line": 648, "col": 6 }, "22.1": { "line": 645, "col": 4 }, "22.3": { "line": 650, "col": 9 }, "22.4": { "line": 651, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:resolveEditInputs": { "1": { "line": 839, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_0": { "1.0.0": { "line": 841, "col": 6 }, "1.0": { "line": 840, "col": 4 }, "1.1": { "line": 843, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:generateImageFile": { "2": { "line": 871, "col": 2 }, "3": { "line": 872, "col": 2 }, "4": { "line": 873, "col": 2 }, "6": { "line": 879, "col": 2 }, "7": { "line": 885, "col": 2 }, "9": { "line": 891, "col": 2 }, "10": { "line": 892, "col": 2 }, "4.0": { "line": 874, "col": 4 }, "7.0": { "line": 886, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:mainAgent": { "1": { "line": 905, "col": 2 }, "3": { "line": 919, "col": 2 }, "1.0": { "line": 906, "col": 4 }, "1.1.1": { "line": 911, "col": 6 }, "1.1.2": { "line": 912, "col": 6 }, "1.1": { "line": 907, "col": 4 }, "1.3": { "line": 914, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:agentReplyVia": { "1": { "line": 928, "col": 2 }, "2": { "line": 929, "col": 2 }, "4": { "line": 932, "col": 2 }, "6": { "line": 935, "col": 2 }, "8": { "line": 938, "col": 2 }, "10": { "line": 941, "col": 2 }, "12": { "line": 947, "col": 2 }, "13": { "line": 948, "col": 2 }, "15": { "line": 953, "col": 2 }, "16": { "line": 960, "col": 2 }, "18": { "line": 963, "col": 2 }, "19": { "line": 966, "col": 2 }, "20": { "line": 967, "col": 2 }, "2.0": { "line": 930, "col": 4 }, "4.0": { "line": 933, "col": 4 }, "6.0": { "line": 936, "col": 4 }, "8.0": { "line": 939, "col": 4 }, "10.0": { "line": 942, "col": 4 }, "13.0": { "line": 949, "col": 4 }, "15.1": { "line": 958, "col": 4 }, "16.0": { "line": 961, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_1": { "18.0": { "line": 964, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:agentReply": { "1": { "line": 977, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:roundedCost": { "1": { "line": 981, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:_buildStatus": { "1": { "line": 985, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:sample": { "1": { "line": 993, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:printHeader": { "1": { "line": 997, "col": 2 }, "2": { "line": 998, "col": 2 }, "3": { "line": 1020, "col": 2 } }, "dist/lib/agents/agency-agent/agent.agency:__block_2": { "2.0": { "line": 1005, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:__block_3": { "2.0.0": { "line": 1006, "col": 6 }, "2.0.1": { "line": 1014, "col": 6 }, "2.0.2": { "line": 1015, "col": 6 } }, "dist/lib/agents/agency-agent/agent.agency:__block_4": { "2.0.0.0": { "line": 1007, "col": 8 }, "2.0.0.1": { "line": 1008, "col": 8 }, "2.0.0.2": { "line": 1009, "col": 8 }, "2.0.0.3": { "line": 1010, "col": 8 }, "2.0.0.4": { "line": 1011, "col": 8 }, "2.0.0.5": { "line": 1012, "col": 8 } }, "dist/lib/agents/agency-agent/agent.agency:__block_5": { "2.0.2.0": { "line": 1016, "col": 8 } }, "dist/lib/agents/agency-agent/agent.agency:printPolicyHelp": { "1": { "line": 1026, "col": 2 }, "2": { "line": 1027, "col": 2 }, "3": { "line": 1030, "col": 2 }, "4": { "line": 1031, "col": 2 }, "5": { "line": 1032, "col": 2 }, "5.0": { "line": 1033, "col": 4 }, "5.1": { "line": 1034, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:givePolicyChoice": { "1": { "line": 1039, "col": 2 }, "2": { "line": 1040, "col": 2 }, "3": { "line": 1041, "col": 2 }, "4": { "line": 1052, "col": 2 }, "5": { "line": 1053, "col": 9 }, "6": { "line": 1053, "col": 2 }, "5.0": { "line": 1054, "col": 17 }, "5.1": { "line": 1054, "col": 17 }, "5.2": { "line": 1055, "col": 21 }, "5.3": { "line": 1055, "col": 21 } }, "dist/lib/agents/agency-agent/agent.agency:setupSession": { "2": { "line": 1071, "col": 2 }, "3": { "line": 1076, "col": 2 }, "4": { "line": 1077, "col": 2 }, "5": { "line": 1083, "col": 2 }, "6": { "line": 1084, "col": 2 }, "7": { "line": 1086, "col": 2 }, "9": { "line": 1134, "col": 2 }, "3.0": { "line": 1076, "col": 2 }, "7.1": { "line": 1091, "col": 4 }, "7.2.1": { "line": 1097, "col": 6 }, "7.2.2": { "line": 1098, "col": 6 }, "7.2.4": { "line": 1103, "col": 6 }, "7.2.5.0": { "line": 1104, "col": 6 }, "7.2.5.1": { "line": 1105, "col": 8 }, "7.2.5.2": { "line": 1110, "col": 8 }, "7.2.5": { "line": 1104, "col": 6 }, "7.2.7": { "line": 1112, "col": 6 }, "7.2": { "line": 1092, "col": 4 }, "7.4": { "line": 1115, "col": 4 }, "7.5.0": { "line": 1116, "col": 4 }, "7.5.1.0.0": { "line": 1119, "col": 10 }, "7.5.1.0.1": { "line": 1120, "col": 10 }, "7.5.1.0.2": { "line": 1122, "col": 10 }, "7.5.1.0": { "line": 1118, "col": 8 }, "7.5.1.2": { "line": 1125, "col": 8 }, "7.5.1.3": { "line": 1126, "col": 8 }, "7.5.1": { "line": 1117, "col": 6 }, "7.5.3": { "line": 1129, "col": 6 }, "7.5": { "line": 1116, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:oneShotAgent": { "1": { "line": 1148, "col": 2 }, "2": { "line": 1149, "col": 2 }, "3": { "line": 1150, "col": 2 }, "4": { "line": 1151, "col": 2 }, "5": { "line": 1164, "col": 2 }, "4.1": { "line": 1155, "col": 4 }, "4.2.0": { "line": 1156, "col": 4 }, "4.2.1": { "line": 1157, "col": 6 }, "4.2.2": { "line": 1158, "col": 11 }, "4.2.3": { "line": 1159, "col": 6 }, "4.2": { "line": 1156, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:_runSeedTurn": { "1": { "line": 1171, "col": 2 }, "2": { "line": 1172, "col": 2 }, "3": { "line": 1173, "col": 2 }, "3.0": { "line": 1173, "col": 2 }, "3.1.0": { "line": 1175, "col": 6 }, "3.1.1": { "line": 1177, "col": 6 }, "3.1": { "line": 1174, "col": 4 }, "3.3": { "line": 1179, "col": 9 }, "3.4": { "line": 1180, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:startInteractive": { "1": { "line": 1191, "col": 2 }, "3": { "line": 1206, "col": 2 }, "1.0.0": { "line": 1193, "col": 6 }, "1.0": { "line": 1192, "col": 4 }, "1.1": { "line": 1195, "col": 4 } }, "dist/lib/agents/agency-agent/agent.agency:main": { "2": { "line": 1212, "col": 2 }, "3": { "line": 1298, "col": 2 }, "4": { "line": 1301, "col": 2 }, "6": { "line": 1307, "col": 2 }, "7": { "line": 1311, "col": 2 }, "8": { "line": 1318, "col": 2 }, "9": { "line": 1319, "col": 2 }, "10": { "line": 1320, "col": 2 }, "11": { "line": 1321, "col": 2 }, "12": { "line": 1327, "col": 2 }, "14": { "line": 1409, "col": 2 }, "15": { "line": 1410, "col": 2 }, "16": { "line": 1411, "col": 2 }, "17": { "line": 1412, "col": 2 }, "18": { "line": 1416, "col": 2 }, "19": { "line": 1417, "col": 2 }, "20": { "line": 1427, "col": 2 }, "21": { "line": 1428, "col": 2 }, "23": { "line": 1431, "col": 2 }, "24": { "line": 1432, "col": 2 }, "26": { "line": 1449, "col": 2 }, "27": { "line": 1455, "col": 2 }, "28": { "line": 1458, "col": 2 }, "30": { "line": 1473, "col": 2 }, "32": { "line": 1492, "col": 2 }, "33": { "line": 1493, "col": 2 }, "35": { "line": 1511, "col": 2 }, "36": { "line": 1512, "col": 2 }, "37": { "line": 1513, "col": 2 }, "38": { "line": 1514, "col": 2 }, "39": { "line": 1515, "col": 2 }, "3.0": { "line": 1299, "col": 4 }, "4.0": { "line": 1302, "col": 4 }, "6.0": { "line": 1308, "col": 4 }, "6.1": { "line": 1309, "col": 4 }, "11.0": { "line": 1322, "col": 4 }, "11.1": { "line": 1325, "col": 4 }, "12.1.0": { "line": 1331, "col": 6 }, "12.1.1": { "line": 1332, "col": 6 }, "12.1": { "line": 1330, "col": 4 }, "12.3.0": { "line": 1335, "col": 6 }, "12.3.1": { "line": 1336, "col": 6 }, "12.3.2": { "line": 1337, "col": 6 }, "12.3": { "line": 1334, "col": 4 }, "12.5": { "line": 1339, "col": 4 }, "12.6.0": { "line": 1341, "col": 6 }, "12.6": { "line": 1340, "col": 4 }, "12.8": { "line": 1346, "col": 4 }, "12.9.0": { "line": 1354, "col": 6 }, "12.9": { "line": 1353, "col": 4 }, "12.10": { "line": 1356, "col": 4 }, "12.11": { "line": 1357, "col": 4 }, "12.12": { "line": 1360, "col": 4 }, "12.13": { "line": 1364, "col": 4 }, "12.15": { "line": 1368, "col": 4 }, "12.16": { "line": 1369, "col": 4 }, "12.17": { "line": 1370, "col": 4 }, "12.18": { "line": 1371, "col": 4 }, "12.19.0.0": { "line": 1374, "col": 8 }, "12.19.0.1": { "line": 1376, "col": 8 }, "12.19.0.2": { "line": 1378, "col": 8 }, "12.19.0.3": { "line": 1380, "col": 8 }, "12.19.0.4": { "line": 1385, "col": 8 }, "12.19.0": { "line": 1373, "col": 6 }, "12.19": { "line": 1372, "col": 4 }, "12.20": { "line": 1388, "col": 4 }, "12.21": { "line": 1389, "col": 4 }, "12.22.0": { "line": 1391, "col": 6 }, "12.22": { "line": 1390, "col": 4 }, "12.23.0": { "line": 1394, "col": 6 }, "12.23": { "line": 1393, "col": 4 }, "12.24": { "line": 1396, "col": 4 }, "12.25": { "line": 1402, "col": 4 }, "12.26": { "line": 1403, "col": 4 }, "21.0": { "line": 1429, "col": 4 }, "24.0": { "line": 1433, "col": 4 }, "28.0": { "line": 1459, "col": 4 }, "28.1": { "line": 1464, "col": 4 }, "30.0": { "line": 1474, "col": 4 }, "30.1": { "line": 1475, "col": 4 }, "30.2": { "line": 1476, "col": 4 }, "30.3": { "line": 1477, "col": 4 }, "30.4": { "line": 1478, "col": 4 }, "30.5": { "line": 1479, "col": 4 }, "33.0": { "line": 1494, "col": 4 }, "33.1.0": { "line": 1496, "col": 6 }, "33.1.1.0": { "line": 1498, "col": 8 }, "33.1.1": { "line": 1497, "col": 6 }, "33.1.2": { "line": 1500, "col": 6 }, "33.1": { "line": 1495, "col": 4 }, "33.2": { "line": 1502, "col": 4 }, "33.3": { "line": 1503, "col": 4 } } };
|
|
8316
8333
|
export {
|
|
8317
8334
|
Session,
|
|
8318
8335
|
__cb_top_0,
|
|
@@ -163,19 +163,18 @@ export def withWritesPolicy(baseDir: string) {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
//
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
//
|
|
170
|
-
//
|
|
171
|
-
//
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
166
|
+
// Approve EVERY interrupt — reads, writes, shell, git, anything, anywhere,
|
|
167
|
+
// with no path scoping. The `"*"` wildcard is a catch-all that `checkPolicy`
|
|
168
|
+
// consults for any effect without a more specific rule (see
|
|
169
|
+
// lib/runtime/policy.ts). This is NOT confined in any way: it will approve
|
|
170
|
+
// writes and shell commands outside the working directory, deletes, network
|
|
171
|
+
// calls — everything. Use it ONLY in a disposable sandbox (e.g. a benchmark
|
|
172
|
+
// container) where the whole environment is throwaway. `std::bash` cannot be
|
|
173
|
+
// meaningfully confined to a directory anyway (a command can `cd` or use
|
|
174
|
+
// absolute paths), so for autonomous sandbox runs a blanket approve-all is
|
|
175
|
+
// both simpler and more honest than a best-effort per-effect scope.
|
|
176
|
+
export static const approveAllPolicy = {
|
|
177
|
+
"*": [{ action: "approve" }]
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
// Built-in policies accepted by the `--policy` flag (anything else is
|
|
@@ -196,8 +195,8 @@ export static const BUILTIN_POLICIES = [
|
|
|
196
195
|
description: "recommended + auto-approve file writes and git changes, scoped to the current directory and its children."
|
|
197
196
|
},
|
|
198
197
|
{
|
|
199
|
-
name: "
|
|
200
|
-
description: "
|
|
198
|
+
name: "approve-all",
|
|
199
|
+
description: "Approve EVERY interrupt — reads, writes, shell, git, anywhere, no scoping. UNSAFE outside a disposable sandbox."
|
|
201
200
|
},
|
|
202
201
|
]
|
|
203
202
|
|
|
@@ -221,8 +220,8 @@ export def builtinPolicy(name: string, baseDir: string) {
|
|
|
221
220
|
if (name == "with-writes") {
|
|
222
221
|
return withWritesPolicy(baseDir)
|
|
223
222
|
}
|
|
224
|
-
if (name == "
|
|
225
|
-
return
|
|
223
|
+
if (name == "approve-all") {
|
|
224
|
+
return approveAllPolicy
|
|
226
225
|
}
|
|
227
226
|
return null
|
|
228
227
|
}
|
|
@@ -164,6 +164,7 @@ let __staticInitPromise = null;
|
|
|
164
164
|
let AGENCY_SAFE_SUBCOMMANDS = __UNINIT_STATIC;
|
|
165
165
|
let minimalAutoApprovePolicy = __UNINIT_STATIC;
|
|
166
166
|
let recommendedAutoApprovePolicy = __UNINIT_STATIC;
|
|
167
|
+
let approveAllPolicy = __UNINIT_STATIC;
|
|
167
168
|
let BUILTIN_POLICIES = __UNINIT_STATIC;
|
|
168
169
|
async function __initializeStatic(__ctx) {
|
|
169
170
|
if (__staticInitPromise) {
|
|
@@ -264,6 +265,11 @@ async function __initializeStatic(__ctx) {
|
|
|
264
265
|
"action": `approve`
|
|
265
266
|
}]
|
|
266
267
|
});
|
|
268
|
+
approveAllPolicy = __deepFreeze({
|
|
269
|
+
"*": [{
|
|
270
|
+
"action": `approve`
|
|
271
|
+
}]
|
|
272
|
+
});
|
|
267
273
|
BUILTIN_POLICIES = __deepFreeze([{
|
|
268
274
|
"name": `recommended`,
|
|
269
275
|
"description": `Auto-approve reads and web/search; prompt for writes, shell, and git changes. (Default.)`
|
|
@@ -274,8 +280,8 @@ async function __initializeStatic(__ctx) {
|
|
|
274
280
|
"name": `with-writes`,
|
|
275
281
|
"description": `recommended + auto-approve file writes and git changes, scoped to the current directory and its children.`
|
|
276
282
|
}, {
|
|
277
|
-
"name": `
|
|
278
|
-
"description": `
|
|
283
|
+
"name": `approve-all`,
|
|
284
|
+
"description": `Approve EVERY interrupt \u2014 reads, writes, shell, git, anywhere, no scoping. UNSAFE outside a disposable sandbox.`
|
|
279
285
|
}]);
|
|
280
286
|
})();
|
|
281
287
|
return __staticInitPromise;
|
|
@@ -285,6 +291,7 @@ function __getStaticVars() {
|
|
|
285
291
|
AGENCY_SAFE_SUBCOMMANDS,
|
|
286
292
|
minimalAutoApprovePolicy,
|
|
287
293
|
recommendedAutoApprovePolicy,
|
|
294
|
+
approveAllPolicy,
|
|
288
295
|
BUILTIN_POLICIES
|
|
289
296
|
};
|
|
290
297
|
}
|
|
@@ -728,144 +735,6 @@ const withWritesPolicy = __AgencyFunction.create({
|
|
|
728
735
|
safe: false,
|
|
729
736
|
exported: true
|
|
730
737
|
}, __toolRegistry);
|
|
731
|
-
async function __withBashPolicy_impl(baseDir) {
|
|
732
|
-
const __setupData = setupFunction();
|
|
733
|
-
const __stack = __setupData.stack;
|
|
734
|
-
const __step = __setupData.step;
|
|
735
|
-
const __self = __setupData.self;
|
|
736
|
-
const __ctx = getRuntimeContext().ctx;
|
|
737
|
-
let __forked;
|
|
738
|
-
let __functionCompleted = false;
|
|
739
|
-
if (!__globals().isInitialized("dist/lib/agents/agency-agent/lib/defaultPolicy.agency")) {
|
|
740
|
-
await __initializeGlobals(__ctx);
|
|
741
|
-
}
|
|
742
|
-
let __funcStartTime = performance.now();
|
|
743
|
-
__stack.args["baseDir"] = baseDir;
|
|
744
|
-
__self.__retryable = __self.__retryable ?? true;
|
|
745
|
-
const runner = new Runner(__ctx, __stack, { state: __stack, moduleId: "dist/lib/agents/agency-agent/lib/defaultPolicy.agency", scopeName: "withBashPolicy", threads: __setupData.threads });
|
|
746
|
-
let __resultCheckpointId = -1;
|
|
747
|
-
if (__ctx._pendingArgOverrides) {
|
|
748
|
-
const __overrides = __ctx._pendingArgOverrides;
|
|
749
|
-
__ctx._pendingArgOverrides = void 0;
|
|
750
|
-
if ("baseDir" in __overrides) {
|
|
751
|
-
baseDir = __overrides["baseDir"];
|
|
752
|
-
__stack.args["baseDir"] = baseDir;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
try {
|
|
756
|
-
await agencyStore.run({
|
|
757
|
-
...getRuntimeContext(),
|
|
758
|
-
ctx: __ctx,
|
|
759
|
-
stack: __setupData.stateStack,
|
|
760
|
-
threads: __setupData.threads
|
|
761
|
-
}, async () => {
|
|
762
|
-
await runner.hook(0, async () => {
|
|
763
|
-
await callHook({
|
|
764
|
-
name: "onFunctionStart",
|
|
765
|
-
data: {
|
|
766
|
-
functionName: "withBashPolicy",
|
|
767
|
-
args: {
|
|
768
|
-
baseDir
|
|
769
|
-
},
|
|
770
|
-
moduleId: "dist/lib/agents/agency-agent/lib/defaultPolicy.agency"
|
|
771
|
-
}
|
|
772
|
-
});
|
|
773
|
-
});
|
|
774
|
-
await runner.step(1, async (runner2) => {
|
|
775
|
-
__stack.locals.scope = await __call(dirScope, {
|
|
776
|
-
type: "positional",
|
|
777
|
-
args: [__stack.args.baseDir]
|
|
778
|
-
});
|
|
779
|
-
if (hasInterrupts(__stack.locals.scope)) {
|
|
780
|
-
await getRuntimeContext().ctx.pendingPromises.awaitAll();
|
|
781
|
-
runner2.halt(__stack.locals.scope);
|
|
782
|
-
return;
|
|
783
|
-
}
|
|
784
|
-
});
|
|
785
|
-
await runner.step(2, async (runner2) => {
|
|
786
|
-
__functionCompleted = true;
|
|
787
|
-
runner2.halt({
|
|
788
|
-
...await __call(withWritesPolicy, {
|
|
789
|
-
type: "positional",
|
|
790
|
-
args: [__stack.args.baseDir]
|
|
791
|
-
}),
|
|
792
|
-
"std::bash": [{
|
|
793
|
-
"match": {
|
|
794
|
-
"cwd": __stack.locals.scope
|
|
795
|
-
},
|
|
796
|
-
"action": `approve`
|
|
797
|
-
}]
|
|
798
|
-
});
|
|
799
|
-
return;
|
|
800
|
-
});
|
|
801
|
-
});
|
|
802
|
-
if (runner.halted) {
|
|
803
|
-
if (isFailure(runner.haltResult)) {
|
|
804
|
-
runner.haltResult.retryable = runner.haltResult.retryable && __self.__retryable;
|
|
805
|
-
}
|
|
806
|
-
return runner.haltResult;
|
|
807
|
-
}
|
|
808
|
-
} catch (__error) {
|
|
809
|
-
if (__error instanceof RestoreSignal) {
|
|
810
|
-
throw __error;
|
|
811
|
-
}
|
|
812
|
-
if (__error instanceof AgencyAbort) {
|
|
813
|
-
throw __error;
|
|
814
|
-
}
|
|
815
|
-
{
|
|
816
|
-
const __errMsg = __error instanceof Error ? __error.message : String(__error);
|
|
817
|
-
const __errStack = __error instanceof Error && __error.stack ? __error.stack : "";
|
|
818
|
-
const __log = __createLogger(__ctx.logLevel);
|
|
819
|
-
__log.error("Function withBashPolicy threw an exception (converted to Failure): " + __errMsg);
|
|
820
|
-
if (__errStack) __log.error(__errStack);
|
|
821
|
-
__ctx.statelogClient?.error?.({
|
|
822
|
-
errorType: "runtimeError",
|
|
823
|
-
message: __errMsg,
|
|
824
|
-
functionName: "withBashPolicy",
|
|
825
|
-
retryable: __self.__retryable
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
return failure(
|
|
829
|
-
__error instanceof Error ? __error.message : String(__error),
|
|
830
|
-
{
|
|
831
|
-
checkpoint: getRuntimeContext().ctx.getResultCheckpoint(),
|
|
832
|
-
retryable: __self.__retryable,
|
|
833
|
-
functionName: "withBashPolicy",
|
|
834
|
-
args: __stack.args
|
|
835
|
-
}
|
|
836
|
-
);
|
|
837
|
-
} finally {
|
|
838
|
-
__stateStack()?.pop();
|
|
839
|
-
if (__functionCompleted) {
|
|
840
|
-
await callHook({
|
|
841
|
-
name: "onFunctionEnd",
|
|
842
|
-
data: {
|
|
843
|
-
functionName: "withBashPolicy",
|
|
844
|
-
timeTaken: performance.now() - __funcStartTime
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
const withBashPolicy = __AgencyFunction.create({
|
|
851
|
-
name: "withBashPolicy",
|
|
852
|
-
module: "dist/lib/agents/agency-agent/lib/defaultPolicy.agency",
|
|
853
|
-
fn: __withBashPolicy_impl,
|
|
854
|
-
params: [{
|
|
855
|
-
name: "baseDir",
|
|
856
|
-
hasDefault: false,
|
|
857
|
-
defaultValue: void 0,
|
|
858
|
-
variadic: false,
|
|
859
|
-
isFunctionTyped: false
|
|
860
|
-
}],
|
|
861
|
-
toolDefinition: {
|
|
862
|
-
name: "withBashPolicy",
|
|
863
|
-
description: "No description provided.",
|
|
864
|
-
schema: z.object({ "baseDir": z.string() })
|
|
865
|
-
},
|
|
866
|
-
safe: false,
|
|
867
|
-
exported: true
|
|
868
|
-
}, __toolRegistry);
|
|
869
738
|
async function __builtinPolicyNames_impl() {
|
|
870
739
|
const __setupData = setupFunction();
|
|
871
740
|
const __stack = __setupData.stack;
|
|
@@ -1081,14 +950,11 @@ async function __builtinPolicy_impl(name, baseDir) {
|
|
|
1081
950
|
]);
|
|
1082
951
|
await runner.ifElse(4, [
|
|
1083
952
|
{
|
|
1084
|
-
condition: async () => __eq(__stack.args.name, `
|
|
953
|
+
condition: async () => __eq(__stack.args.name, `approve-all`),
|
|
1085
954
|
body: async (runner2) => {
|
|
1086
955
|
await runner2.step(0, async (runner3) => {
|
|
1087
956
|
__functionCompleted = true;
|
|
1088
|
-
runner3.halt(
|
|
1089
|
-
type: "positional",
|
|
1090
|
-
args: [__stack.args.baseDir]
|
|
1091
|
-
}));
|
|
957
|
+
runner3.halt(__readStatic(approveAllPolicy, "approveAllPolicy", "dist/lib/agents/agency-agent/lib/defaultPolicy.agency"));
|
|
1092
958
|
return;
|
|
1093
959
|
});
|
|
1094
960
|
}
|
|
@@ -1174,7 +1040,7 @@ const builtinPolicy = __AgencyFunction.create({
|
|
|
1174
1040
|
exported: true
|
|
1175
1041
|
}, __toolRegistry);
|
|
1176
1042
|
var stdin_default = graph;
|
|
1177
|
-
const __sourceMap = { "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:agencyExecApproveRules": { "1": { "line": 20, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:__block_0": { "1.0": { "line": 21, "col": 4 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:dirScope": { "1": { "line": 130, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:withWritesPolicy": { "1": { "line": 141, "col": 2 }, "2": { "line": 142, "col": 2 }, "3": { "line": 143, "col": 2 }, "4": { "line": 144, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:
|
|
1043
|
+
const __sourceMap = { "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:agencyExecApproveRules": { "1": { "line": 20, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:__block_0": { "1.0": { "line": 21, "col": 4 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:dirScope": { "1": { "line": 130, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:withWritesPolicy": { "1": { "line": 141, "col": 2 }, "2": { "line": 142, "col": 2 }, "3": { "line": 143, "col": 2 }, "4": { "line": 144, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:builtinPolicyNames": { "1": { "line": 204, "col": 2 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:__block_1": { "1.0": { "line": 205, "col": 4 } }, "dist/lib/agents/agency-agent/lib/defaultPolicy.agency:builtinPolicy": { "1": { "line": 213, "col": 2 }, "2": { "line": 216, "col": 2 }, "3": { "line": 219, "col": 2 }, "4": { "line": 222, "col": 2 }, "5": { "line": 225, "col": 2 }, "1.0": { "line": 214, "col": 4 }, "2.0": { "line": 217, "col": 4 }, "3.0": { "line": 220, "col": 4 }, "4.0": { "line": 223, "col": 4 } } };
|
|
1178
1044
|
export {
|
|
1179
1045
|
BUILTIN_POLICIES,
|
|
1180
1046
|
__getCheckpoints,
|
|
@@ -1186,6 +1052,7 @@ export {
|
|
|
1186
1052
|
__toolRegistry,
|
|
1187
1053
|
agencyExecApproveRules,
|
|
1188
1054
|
approve,
|
|
1055
|
+
approveAllPolicy,
|
|
1189
1056
|
builtinPolicy,
|
|
1190
1057
|
builtinPolicyNames,
|
|
1191
1058
|
stdin_default as default,
|
|
@@ -1199,6 +1066,5 @@ export {
|
|
|
1199
1066
|
reject,
|
|
1200
1067
|
respondToInterrupts,
|
|
1201
1068
|
rewindFrom,
|
|
1202
|
-
withBashPolicy,
|
|
1203
1069
|
withWritesPolicy
|
|
1204
1070
|
};
|
|
@@ -6,13 +6,25 @@ export const PolicyRuleSchema = z.object({
|
|
|
6
6
|
});
|
|
7
7
|
export const PolicySchema = z.record(z.string(), z.array(PolicyRuleSchema));
|
|
8
8
|
export function checkPolicy(policy, interrupt) {
|
|
9
|
+
// Effect-specific rules take precedence over the wildcard.
|
|
9
10
|
const rules = policy[interrupt.effect];
|
|
10
|
-
if (
|
|
11
|
-
|
|
11
|
+
if (rules) {
|
|
12
|
+
for (const rule of rules) {
|
|
13
|
+
if (matchesRule(rule, interrupt)) {
|
|
14
|
+
return { type: rule.action };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
12
17
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
// Wildcard catch-all: the `"*"` effect key applies to any interrupt whose
|
|
19
|
+
// own effect had no matching rule. This is how an "approve-all" policy
|
|
20
|
+
// covers effects it doesn't enumerate (a plain per-effect map would
|
|
21
|
+
// `propagate` — i.e. prompt — on anything unlisted).
|
|
22
|
+
const wildcard = policy["*"];
|
|
23
|
+
if (wildcard) {
|
|
24
|
+
for (const rule of wildcard) {
|
|
25
|
+
if (matchesRule(rule, interrupt)) {
|
|
26
|
+
return { type: rule.action };
|
|
27
|
+
}
|
|
16
28
|
}
|
|
17
29
|
}
|
|
18
30
|
return { type: "propagate" };
|
|
@@ -111,6 +111,45 @@ describe("checkPolicy", () => {
|
|
|
111
111
|
const result = checkPolicy(policy, { effect: "test::x", message: "", data: {}, origin: "" });
|
|
112
112
|
expect(result).toEqual({ type: "reject" });
|
|
113
113
|
});
|
|
114
|
+
describe('"*" wildcard catch-all', () => {
|
|
115
|
+
it("approve-all: applies to every effect, including unlisted ones", () => {
|
|
116
|
+
const policy = { "*": [{ action: "approve" }] };
|
|
117
|
+
for (const effect of ["std::write", "std::bash", "std::remove", "anything::else"]) {
|
|
118
|
+
expect(checkPolicy(policy, { effect, message: "", data: { dir: "/etc" }, origin: "" }))
|
|
119
|
+
.toEqual({ type: "approve" });
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
it("effect-specific rules take precedence over the wildcard", () => {
|
|
123
|
+
const policy = {
|
|
124
|
+
"std::bash": [{ action: "reject" }],
|
|
125
|
+
"*": [{ action: "approve" }],
|
|
126
|
+
};
|
|
127
|
+
expect(checkPolicy(policy, { effect: "std::bash", message: "", data: {}, origin: "" }))
|
|
128
|
+
.toEqual({ type: "reject" });
|
|
129
|
+
// An effect with no specific rule falls through to the wildcard.
|
|
130
|
+
expect(checkPolicy(policy, { effect: "std::write", message: "", data: {}, origin: "" }))
|
|
131
|
+
.toEqual({ type: "approve" });
|
|
132
|
+
});
|
|
133
|
+
it("falls back to the wildcard when a specific effect's rules all miss", () => {
|
|
134
|
+
const policy = {
|
|
135
|
+
"std::write": [{ match: { dir: "/app/**" }, action: "approve" }],
|
|
136
|
+
"*": [{ action: "reject" }],
|
|
137
|
+
};
|
|
138
|
+
// Inside /app: matched by the specific rule.
|
|
139
|
+
expect(checkPolicy(policy, { effect: "std::write", message: "", data: { dir: "/app/x" }, origin: "" }))
|
|
140
|
+
.toEqual({ type: "approve" });
|
|
141
|
+
// Outside /app: the specific rule misses, so the wildcard rejects.
|
|
142
|
+
expect(checkPolicy(policy, { effect: "std::write", message: "", data: { dir: "/etc/x" }, origin: "" }))
|
|
143
|
+
.toEqual({ type: "reject" });
|
|
144
|
+
});
|
|
145
|
+
it("still propagates when neither the effect nor the wildcard matches", () => {
|
|
146
|
+
const policy = {
|
|
147
|
+
"*": [{ match: { dir: "/app/**" }, action: "approve" }],
|
|
148
|
+
};
|
|
149
|
+
expect(checkPolicy(policy, { effect: "std::write", message: "", data: { dir: "/etc/x" }, origin: "" }))
|
|
150
|
+
.toEqual({ type: "propagate" });
|
|
151
|
+
});
|
|
152
|
+
});
|
|
114
153
|
describe("./ prefix normalization (picomatch workaround)", () => {
|
|
115
154
|
// picomatch.isMatch returns false for patterns starting with `./`
|
|
116
155
|
// when combined with `**` or brace expansions — e.g.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.7.
|
|
1
|
+
export declare const VERSION = "0.7.6";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.7.
|
|
1
|
+
export const VERSION = "0.7.6";
|