bazilion 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cli.js +433 -146
  2. package/dist/cli.js.map +1 -1
  3. package/dist/daemon.js +1382 -232
  4. package/dist/daemon.js.map +1 -1
  5. package/dist/migrations/0001_init.sql +81 -0
  6. package/dist/web/client/assets/AgentTabs-R6gSjIj3.js +1 -0
  7. package/dist/web/client/assets/{ProductionTeamPolicyEditor-B6dbpuYy.js → ProductionTeamPolicyEditor-CSL3W7XM.js} +2 -2
  8. package/dist/web/client/assets/{ProfileCommunicationEditor-Bf8UvmZT.js → ProfileCommunicationEditor-CwU0QkmE.js} +1 -1
  9. package/dist/web/client/assets/{TeamTabs-sQBHChtd.js → TeamTabs-C1Hakkff.js} +1 -1
  10. package/dist/web/client/assets/{TemplatesTabs-DPsuwsWB.js → TemplatesTabs-klEydJ8-.js} +1 -1
  11. package/dist/web/client/assets/{_id-C9rkCclz.js → _id-BOC7ioJu.js} +1 -1
  12. package/dist/web/client/assets/{_id-DYASsGQ8.js → _id-CnVq-rED.js} +1 -1
  13. package/dist/web/client/assets/{_id-DE4IY5bL.js → _id-e4u7dmBb.js} +1 -1
  14. package/dist/web/client/assets/{_id-D65IzC8H.js → _id-wkjjWLz0.js} +1 -1
  15. package/dist/web/client/assets/{activity-C7o6-xHg.js → activity-uqhwzmiy.js} +1 -1
  16. package/dist/web/client/assets/{agents-UroO4d25.js → agents-B2usE-L_.js} +1 -1
  17. package/dist/web/client/assets/{agents-h8yWXQ2H.js → agents-FaQtkAWs.js} +1 -1
  18. package/dist/web/client/assets/{approvals-DKhF0YLC.js → approvals-DqLE6ttw.js} +1 -1
  19. package/dist/web/client/assets/attention-CkGozYnJ.js +1 -0
  20. package/dist/web/client/assets/attention-Gavt2yEp.js +1 -0
  21. package/dist/web/client/assets/chevron-down-CJk0zGNT.js +1 -0
  22. package/dist/web/client/assets/{config-q8JDresK.js → config-xrXoDEWM.js} +1 -1
  23. package/dist/web/client/assets/{context-CBucAoi6.js → context-ZWqx3uiC.js} +1 -1
  24. package/dist/web/client/assets/inbox-BoIvl9ZF.js +1 -0
  25. package/dist/web/client/assets/{index-DUXAevpZ.js → index-nb2MV8X1.js} +3 -3
  26. package/dist/web/client/assets/learning-6_oYn1l7.js +1 -0
  27. package/dist/web/client/assets/{login-CNAV9Wer.js → login-DM1ytxQL.js} +1 -1
  28. package/dist/web/client/assets/{mcp-BKdEFwHO.js → mcp-CetZbyUh.js} +1 -1
  29. package/dist/web/client/assets/{members-BDqZQh26.js → members-DdqWtwZd.js} +1 -1
  30. package/dist/web/client/assets/{memory-DVdEVr6L.js → memory-FNrxFHmC.js} +1 -1
  31. package/dist/web/client/assets/plus-C3GroITC.js +1 -0
  32. package/dist/web/client/assets/{policy-DdDctqvg.js → policy-BKPejYRI.js} +1 -1
  33. package/dist/web/client/assets/{routes-BEfALSZv.js → routes-CH1ZTTo-.js} +1 -1
  34. package/dist/web/client/assets/{services-DZP2ybzb.js → services-zk9SqN06.js} +1 -1
  35. package/dist/web/client/assets/{skills-DoeIjITs.js → skills-tXDpomHW.js} +1 -1
  36. package/dist/web/client/assets/styles-DMltY3su.css +2 -0
  37. package/dist/web/client/assets/{teams-W3j-UoJ9.js → teams-BZYjekBN.js} +1 -1
  38. package/dist/web/client/assets/{teams-DlHRnrQw.js → teams-D1c8zlxs.js} +1 -1
  39. package/dist/web/client/assets/{telegram-2OdeGv4E.js → telegram-DCe1CWMt.js} +1 -1
  40. package/dist/web/client/assets/{tokens-MuBfmgue.js → tokens-DAPjRS0N.js} +1 -1
  41. package/dist/web/client/assets/triggers-D8R-5guA.js +1 -0
  42. package/dist/web/client/assets/{welcome-CvNr5IMi.js → welcome-CuK0shDJ.js} +1 -1
  43. package/dist/web/server/assets/{AgentTabs-DoMDJBXH.js → AgentTabs-aXdsiiMp.js} +5 -0
  44. package/dist/web/server/assets/{_id-Cg7x6q3g.js → _id-BHYLL8M-.js} +2 -2
  45. package/dist/web/server/assets/{_id-DqON-59C.js → _id-FcHdSocl.js} +1 -1
  46. package/dist/web/server/assets/{_tanstack-start-manifest_v-BXauUXg6.js → _tanstack-start-manifest_v-fLsYERQ-.js} +76 -53
  47. package/dist/web/server/assets/attention-BW_6ddkj.js +11 -0
  48. package/dist/web/server/assets/attention-BxkTf337.js +14 -0
  49. package/dist/web/server/assets/attention-CM-Ks1N9.js +19 -0
  50. package/dist/web/server/assets/attention-w21GQIGH.js +264 -0
  51. package/dist/web/server/assets/{inbox-CUIyf9MT.js → inbox-BLUzA5sQ.js} +40 -3
  52. package/dist/web/server/assets/{inbox-B3-TRsNI.js → inbox-CzlKT9Wg.js} +5 -3
  53. package/dist/web/server/assets/{inbox-BardsGyy.js → inbox-ZvDNAjaM.js} +1 -1
  54. package/dist/web/server/assets/learning-8zav4pIT.js +33 -0
  55. package/dist/web/server/assets/learning-B7PBkvER.js +16 -0
  56. package/dist/web/server/assets/learning-Cq7K2heb.js +312 -0
  57. package/dist/web/server/assets/{router-C5_NjTsP.js → router-CQuj7553.js} +80 -47
  58. package/dist/web/server/assets/{triggers-CBl4yMyw.js → triggers-BZPl5CHs.js} +1 -1
  59. package/dist/web/server/assets/{triggers-_3rdhwSN.js → triggers-CSNNzRIi.js} +2 -2
  60. package/dist/web/server/server.js +11 -3
  61. package/dist/worker.js +166 -36
  62. package/dist/worker.js.map +1 -1
  63. package/package.json +3 -3
  64. package/dist/web/client/assets/AgentTabs-B3hq5a3e.js +0 -1
  65. package/dist/web/client/assets/chevron-down-BK6NPMMP.js +0 -1
  66. package/dist/web/client/assets/inbox-BwoRikj1.js +0 -1
  67. package/dist/web/client/assets/plus-b4yFXP0O.js +0 -1
  68. package/dist/web/client/assets/styles-BYM0UGdF.css +0 -2
  69. package/dist/web/client/assets/triggers-CX7RMQFQ.js +0 -1
package/dist/cli.js CHANGED
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import { defineCommand as defineCommand25, runCommand, showUsage } from "citty";
4
+ import { defineCommand as defineCommand26, runCommand, showUsage } from "citty";
5
5
 
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "bazilion",
9
- version: "0.11.0",
9
+ version: "0.12.0",
10
10
  description: "Multi-agent runtime CLI \u2014 spawn LLM agents, manage profiles/teams/skills, and run the local daemon.",
11
11
  license: "MIT",
12
12
  repository: {
@@ -373,12 +373,12 @@ var listCmd = defineCommand({
373
373
  async run({ args }) {
374
374
  const client = createClient2();
375
375
  const q = args.all ? "?includeArchived=true" : "";
376
- const list4 = await client.get(`/api/agents${q}`);
377
- if (list4.length === 0) {
376
+ const list5 = await client.get(`/api/agents${q}`);
377
+ if (list5.length === 0) {
378
378
  console.log("(no agents)");
379
379
  return;
380
380
  }
381
- const rows = list4.map(
381
+ const rows = list5.map(
382
382
  (a) => args.long ? [a.id, a.status, a.name, a.profileId] : (
383
383
  // Short UUID prefix — all CLI commands accept 4+ char prefixes now.
384
384
  [a.id.slice(0, 8), a.status, a.name]
@@ -985,6 +985,159 @@ var cancelCmd = defineCommand({
985
985
  console.log(`cancelled active turn for ${args.id}`);
986
986
  }
987
987
  });
988
+ var reviewConfigCmd = defineCommand({
989
+ meta: { name: "review-config", description: "Inspect or configure reviewed learning" },
990
+ args: {
991
+ id: { type: "positional", required: true, description: "Agent id or prefix" },
992
+ enable: { type: "boolean", description: "Enable periodic reviews" },
993
+ disable: { type: "boolean", description: "Disable periodic reviews" },
994
+ every: { type: "string", description: "Successful user turns between reviews (1-100)" },
995
+ model: { type: "string", description: "Review model, or 'agent' to use the Agent model" },
996
+ reasoning: { type: "string", description: "Review reasoning level" }
997
+ },
998
+ async run({ args }) {
999
+ if (args.enable && args.disable) throw new Error("choose either --enable or --disable");
1000
+ const client = createClient2();
1001
+ const body = {};
1002
+ if (args.enable || args.disable) body.enabled = Boolean(args.enable);
1003
+ if (args.every !== void 0) {
1004
+ const value = Number(args.every);
1005
+ if (!Number.isInteger(value) || value < 1 || value > 100) {
1006
+ throw new Error("--every must be an integer from 1 to 100");
1007
+ }
1008
+ body.everyNTurns = value;
1009
+ }
1010
+ if (args.model !== void 0) body.model = args.model === "agent" ? null : args.model;
1011
+ if (args.reasoning !== void 0) {
1012
+ body.reasoningLevel = args.reasoning;
1013
+ }
1014
+ const hasChanges = Object.keys(body).length > 0;
1015
+ const config = hasChanges ? await client.patch(`/api/agents/${args.id}/review-config`, body) : await client.get(`/api/agents/${args.id}/review-config`);
1016
+ console.log(`review: ${config.enabled ? "enabled" : "disabled"}`);
1017
+ console.log(`cadence: every ${config.everyNTurns} successful user turns`);
1018
+ console.log(`model: ${config.model ?? "agent model"}`);
1019
+ console.log(`reasoning: ${config.reasoningLevel}`);
1020
+ console.log(`turns since last review: ${config.turnsSinceLast}`);
1021
+ }
1022
+ });
1023
+ var reviewCmd = defineCommand({
1024
+ meta: { name: "review", description: "Enqueue a reviewed-learning pass" },
1025
+ args: { id: { type: "positional", required: true, description: "Agent id or prefix" } },
1026
+ async run({ args }) {
1027
+ const response = await createClient2().post(
1028
+ `/api/agents/${args.id}/reviews`
1029
+ );
1030
+ console.log(`review ${response.review.id} ${response.review.status}`);
1031
+ }
1032
+ });
1033
+ var reviewsCmd = defineCommand({
1034
+ meta: { name: "reviews", description: "List reviewed-learning history" },
1035
+ args: {
1036
+ id: { type: "positional", required: true, description: "Agent id or prefix" },
1037
+ status: { type: "string", description: "pending|running|retrying|completed|failed|cancelled" }
1038
+ },
1039
+ async run({ args }) {
1040
+ const response = await createClient2().get(
1041
+ `/api/agents/${args.id}/reviews`
1042
+ );
1043
+ const reviews = args.status ? response.reviews.filter((review) => review.status === args.status) : response.reviews;
1044
+ if (reviews.length === 0) return console.log("(no reviews)");
1045
+ for (const line of columnize(
1046
+ reviews.map((review) => [
1047
+ review.id,
1048
+ review.status,
1049
+ review.trigger,
1050
+ `${review.proposalCount} proposal(s)`,
1051
+ new Date(review.createdAt).toISOString()
1052
+ ])
1053
+ )) {
1054
+ console.log(line);
1055
+ }
1056
+ }
1057
+ });
1058
+ var lessonsCmd = defineCommand({
1059
+ meta: { name: "lessons", description: "List reviewed lesson proposals" },
1060
+ args: {
1061
+ id: { type: "positional", required: true, description: "Agent id or prefix" },
1062
+ status: { type: "string", description: "pending|approved|rejected|revoked" }
1063
+ },
1064
+ async run({ args }) {
1065
+ const status = args.status;
1066
+ const query = status ? `?status=${encodeURIComponent(status)}` : "";
1067
+ const response = await createClient2().get(
1068
+ `/api/agents/${args.id}/lesson-proposals${query}`
1069
+ );
1070
+ if (response.proposals.length === 0) return console.log("(no lesson proposals)");
1071
+ for (const line of columnize(
1072
+ response.proposals.map((proposal) => [
1073
+ proposal.id,
1074
+ proposal.status,
1075
+ proposal.scope,
1076
+ proposal.text
1077
+ ])
1078
+ )) {
1079
+ console.log(line);
1080
+ }
1081
+ }
1082
+ });
1083
+ async function locateProposal(id) {
1084
+ const client = createClient2();
1085
+ const agents = await client.get("/api/agents?includeArchived=true");
1086
+ for (const agent of agents) {
1087
+ const response = await client.get(
1088
+ `/api/agents/${agent.id}/lesson-proposals`
1089
+ );
1090
+ const proposal = response.proposals.find((item) => item.id === id || item.id.startsWith(id));
1091
+ if (proposal) return { agent, proposal };
1092
+ }
1093
+ throw new Error(`lesson proposal not found: ${id}`);
1094
+ }
1095
+ function lessonDecisionCmd(decision2) {
1096
+ return defineCommand({
1097
+ meta: { name: decision2, description: `${decision2} a reviewed lesson proposal` },
1098
+ args: {
1099
+ id: { type: "positional", required: true, description: "Proposal id or prefix" },
1100
+ yes: { type: "boolean", description: `Confirm ${decision2}` }
1101
+ },
1102
+ async run({ args }) {
1103
+ if (!args.yes) throw new Error(`${decision2} requires --yes`);
1104
+ const { agent, proposal } = await locateProposal(args.id);
1105
+ const response = await createClient2().post(
1106
+ `/api/agents/${agent.id}/lesson-proposals/${proposal.id}/${decision2}`,
1107
+ { version: proposal.version }
1108
+ );
1109
+ console.log(`${response.proposal.status} ${response.proposal.id}`);
1110
+ }
1111
+ });
1112
+ }
1113
+ var lessonEditCmd = defineCommand({
1114
+ meta: { name: "edit", description: "Edit a pending reviewed lesson proposal" },
1115
+ args: {
1116
+ id: { type: "positional", required: true, description: "Proposal id or prefix" },
1117
+ text: { type: "string", description: "Replacement lesson text" },
1118
+ scope: { type: "string", description: "private|shared" }
1119
+ },
1120
+ async run({ args }) {
1121
+ if (args.text === void 0 && args.scope === void 0) {
1122
+ throw new Error("lesson edit requires --text or --scope");
1123
+ }
1124
+ const { agent, proposal } = await locateProposal(args.id);
1125
+ const response = await createClient2().patch(
1126
+ `/api/agents/${agent.id}/lesson-proposals/${proposal.id}`,
1127
+ { version: proposal.version, text: args.text, scope: args.scope }
1128
+ );
1129
+ console.log(`updated ${response.proposal.id} v${response.proposal.version}`);
1130
+ }
1131
+ });
1132
+ var lessonCmd = defineCommand({
1133
+ meta: { name: "lesson", description: "Edit or decide a reviewed lesson proposal" },
1134
+ subCommands: {
1135
+ edit: lessonEditCmd,
1136
+ approve: lessonDecisionCmd("approve"),
1137
+ reject: lessonDecisionCmd("reject"),
1138
+ revoke: lessonDecisionCmd("revoke")
1139
+ }
1140
+ });
988
1141
  var agentCommand = defineCommand({
989
1142
  meta: { name: "agent", description: "Manage agent instances" },
990
1143
  subCommands: {
@@ -1001,6 +1154,11 @@ var agentCommand = defineCommand({
1001
1154
  "chat-context": chatContextCmd,
1002
1155
  "chat-compact": chatCompactCmd,
1003
1156
  cancel: cancelCmd,
1157
+ "review-config": reviewConfigCmd,
1158
+ review: reviewCmd,
1159
+ reviews: reviewsCmd,
1160
+ lessons: lessonsCmd,
1161
+ lesson: lessonCmd,
1004
1162
  skill: skillCmd,
1005
1163
  move: moveCmd,
1006
1164
  "session-head": sessionHeadCmd
@@ -1094,15 +1252,101 @@ var approvalCommand = defineCommand2({
1094
1252
  }
1095
1253
  });
1096
1254
 
1255
+ // src/commands/attention.ts
1256
+ import { defineCommand as defineCommand3 } from "citty";
1257
+ var list2 = defineCommand3({
1258
+ meta: { name: "list", description: "List operator attention items" },
1259
+ args: {
1260
+ state: { type: "string", default: "open" },
1261
+ kind: { type: "string" },
1262
+ json: { type: "boolean" }
1263
+ },
1264
+ async run({ args }) {
1265
+ const query = new URLSearchParams({ state: args.state, limit: "200" });
1266
+ if (args.kind) query.set("kind", args.kind);
1267
+ const body = await createClient2().get(`/api/attention?${query}`);
1268
+ if (args.json) return console.log(JSON.stringify(body, null, 2));
1269
+ if (!body.items.length) console.log("(nothing needs attention)");
1270
+ else
1271
+ for (const line of columnize([
1272
+ ["severity", "kind", "context", "when", "key"],
1273
+ ...body.items.map((item) => [
1274
+ item.severity,
1275
+ item.kind,
1276
+ context(item),
1277
+ new Date(item.occurredAt).toISOString(),
1278
+ item.key
1279
+ ])
1280
+ ]))
1281
+ console.log(line);
1282
+ for (const source of body.degraded)
1283
+ console.error(`warning: ${source.kind} unavailable: ${source.error}`);
1284
+ }
1285
+ });
1286
+ var summary = defineCommand3({
1287
+ meta: { name: "summary", description: "Summarize open attention items" },
1288
+ args: { json: { type: "boolean" } },
1289
+ async run({ args }) {
1290
+ const body = await createClient2().get("/api/attention/summary");
1291
+ if (args.json) console.log(JSON.stringify(body, null, 2));
1292
+ else
1293
+ console.log(
1294
+ `${body.openTotal} open \xB7 ${body.bySeverity.action_required} action required \xB7 ${body.bySeverity.error} errors \xB7 ${body.bySeverity.warning} warnings`
1295
+ );
1296
+ }
1297
+ });
1298
+ function mutation(name) {
1299
+ return defineCommand3({
1300
+ meta: { name, description: `${name} one informational attention item` },
1301
+ args: {
1302
+ key: { type: "positional", required: true },
1303
+ yes: { type: "boolean", description: "Required confirmation" },
1304
+ json: { type: "boolean" }
1305
+ },
1306
+ async run({ args }) {
1307
+ if (!args.yes) throw new Error(`refusing mutation: pass --yes to ${name}`);
1308
+ const path = `/api/attention/${encodeURIComponent(args.key)}/${name === "acknowledge" ? "acknowledge" : "acknowledgement"}`;
1309
+ const body = name === "acknowledge" ? await createClient2().post(path) : await createClient2().del(path);
1310
+ if (args.json) console.log(JSON.stringify(body, null, 2));
1311
+ else console.log(`${body.item.key}: ${body.item.acknowledgedAt ? "acknowledged" : "open"}`);
1312
+ }
1313
+ });
1314
+ }
1315
+ var acknowledgeAll = defineCommand3({
1316
+ meta: { name: "acknowledge-all", description: "Acknowledge all open informational items" },
1317
+ args: { yes: { type: "boolean" }, json: { type: "boolean" } },
1318
+ async run({ args }) {
1319
+ if (!args.yes) throw new Error("refusing mutation: pass --yes to acknowledge-all");
1320
+ const body = await createClient2().post(
1321
+ "/api/attention/acknowledge-all"
1322
+ );
1323
+ if (args.json) console.log(JSON.stringify(body, null, 2));
1324
+ else console.log(`acknowledged ${body.acknowledged} informational item(s)`);
1325
+ }
1326
+ });
1327
+ function context(item) {
1328
+ return [item.agentName, item.teamName].filter(Boolean).join(" / ") || "system";
1329
+ }
1330
+ var attentionCommand = defineCommand3({
1331
+ meta: { name: "attention", description: "Inspect the operator attention center" },
1332
+ subCommands: {
1333
+ list: list2,
1334
+ summary,
1335
+ acknowledge: mutation("acknowledge"),
1336
+ unacknowledge: mutation("unacknowledge"),
1337
+ "acknowledge-all": acknowledgeAll
1338
+ }
1339
+ });
1340
+
1097
1341
  // src/commands/auth.ts
1098
1342
  import { loginOpenAICodex } from "@earendil-works/pi-ai/oauth";
1099
- import { defineCommand as defineCommand3 } from "citty";
1343
+ import { defineCommand as defineCommand4 } from "citty";
1100
1344
  function formatExpiry(ms) {
1101
1345
  if (!ms) return "(unknown)";
1102
1346
  const d = new Date(ms);
1103
1347
  return d.toISOString().replace(/\.\d+Z$/, "Z");
1104
1348
  }
1105
- var openaiLoginCmd = defineCommand3({
1349
+ var openaiLoginCmd = defineCommand4({
1106
1350
  meta: {
1107
1351
  name: "login",
1108
1352
  description: "Connect your ChatGPT account via OAuth (browser sign-in)"
@@ -1144,7 +1388,7 @@ var openaiLoginCmd = defineCommand3({
1144
1388
  console.log(" bazilion provider models-set openai-codex gpt-5.3-codex-spark");
1145
1389
  }
1146
1390
  });
1147
- var openaiLogoutCmd = defineCommand3({
1391
+ var openaiLogoutCmd = defineCommand4({
1148
1392
  meta: {
1149
1393
  name: "logout",
1150
1394
  description: "Forget the stored ChatGPT OAuth credentials"
@@ -1155,7 +1399,7 @@ var openaiLogoutCmd = defineCommand3({
1155
1399
  console.log("disconnected ChatGPT OAuth credentials");
1156
1400
  }
1157
1401
  });
1158
- var openaiStatusCmd = defineCommand3({
1402
+ var openaiStatusCmd = defineCommand4({
1159
1403
  meta: {
1160
1404
  name: "status",
1161
1405
  description: "Show ChatGPT OAuth connection status"
@@ -1172,7 +1416,7 @@ var openaiStatusCmd = defineCommand3({
1172
1416
  console.log(`access token expires: ${formatExpiry(status.expiresAt)}`);
1173
1417
  }
1174
1418
  });
1175
- var openaiCmd = defineCommand3({
1419
+ var openaiCmd = defineCommand4({
1176
1420
  meta: {
1177
1421
  name: "openai",
1178
1422
  description: "Manage ChatGPT (OAuth) authentication"
@@ -1183,7 +1427,7 @@ var openaiCmd = defineCommand3({
1183
1427
  status: openaiStatusCmd
1184
1428
  }
1185
1429
  });
1186
- var authCommand = defineCommand3({
1430
+ var authCommand = defineCommand4({
1187
1431
  meta: {
1188
1432
  name: "auth",
1189
1433
  description: "OAuth-based provider authentication (ChatGPT account, etc.)"
@@ -1216,22 +1460,30 @@ import { basename as basename3, dirname as dirname2, isAbsolute, parse, posix, r
1216
1460
  import { DatabaseSync } from "node:sqlite";
1217
1461
  import { Readable } from "stream";
1218
1462
  import { pipeline } from "stream/promises";
1219
- import { defineCommand as defineCommand4 } from "citty";
1220
- import { extract, list as list2 } from "tar";
1463
+ import { defineCommand as defineCommand5 } from "citty";
1464
+ import { extract, list as list3 } from "tar";
1221
1465
 
1222
1466
  // src/backup-schema.ts
1223
1467
  import { createHash } from "crypto";
1224
1468
  var CANONICAL_MIGRATION = "0001_init";
1225
- var CANONICAL_SCHEMA_HASH = "f2da105d21bdea7bedff3ba601243c22d0a7b2d023b954c714940642152b227f";
1469
+ var CANONICAL_SCHEMA_HASH = "7c0867f97bd6a7d9c8a89f43f6ae7e5259c3976d40cd81a2061c43c30b7590a1";
1226
1470
  var CANONICAL_OBJECTS = [
1227
1471
  ["index", "agent_triggers_agent"],
1228
1472
  ["index", "agent_triggers_enabled"],
1473
+ ["index", "agent_loop_break_events_agent_time"],
1474
+ ["index", "agent_loop_break_events_team_time"],
1475
+ ["index", "agent_lesson_proposals_agent_status_time"],
1476
+ ["index", "agent_lesson_proposals_review"],
1477
+ ["index", "agent_reviews_agent_time"],
1478
+ ["index", "agent_reviews_claimable"],
1479
+ ["index", "agent_reviews_one_open_per_agent"],
1229
1480
  ["index", "communication_approval_events_attempt"],
1230
1481
  ["index", "communication_approvals_queue"],
1231
1482
  ["index", "communication_approvals_teams"],
1232
1483
  ["index", "idx_agents_telegram_topic_id"],
1233
1484
  ["index", "idx_provider_models_provider"],
1234
1485
  ["index", "messages_policy_delivery_queue"],
1486
+ ["index", "messages_causal_chain"],
1235
1487
  ["index", "messages_to_unread"],
1236
1488
  ["index", "team_policy_baseline_owner"],
1237
1489
  ["index", "team_policy_blocks_team_time"],
@@ -1240,8 +1492,12 @@ var CANONICAL_OBJECTS = [
1240
1492
  ["index", "trigger_dispatches_trigger_time"],
1241
1493
  ["index", "web_tokens_active"],
1242
1494
  ["table", "agent_skills"],
1495
+ ["table", "agent_loop_break_events"],
1496
+ ["table", "agent_lesson_proposals"],
1497
+ ["table", "agent_reviews"],
1243
1498
  ["table", "agent_triggers"],
1244
1499
  ["table", "agents"],
1500
+ ["table", "attention_acknowledgements"],
1245
1501
  ["table", "communication_approval_events"],
1246
1502
  ["table", "communication_approval_message_grants"],
1247
1503
  ["table", "communication_approvals"],
@@ -1623,7 +1879,7 @@ async function acquireHomeRestoreLock(home) {
1623
1879
  }
1624
1880
 
1625
1881
  // src/commands/backup.ts
1626
- var createCmd = defineCommand4({
1882
+ var createCmd = defineCommand5({
1627
1883
  meta: { name: "create", description: "Download a tar.gz backup of ~/.bazilion from the server" },
1628
1884
  args: {
1629
1885
  output: {
@@ -1777,7 +2033,7 @@ function validateArchiveSymbolicLink(path, rawTarget) {
1777
2033
  }
1778
2034
  async function validateArchive(file) {
1779
2035
  const entries = [];
1780
- await list2({
2036
+ await list3({
1781
2037
  file,
1782
2038
  strict: true,
1783
2039
  onentry(entry2) {
@@ -2112,7 +2368,7 @@ function fsyncDirectory(path) {
2112
2368
  if (fd !== null) closeSync2(fd);
2113
2369
  }
2114
2370
  }
2115
- var restoreCmd = defineCommand4({
2371
+ var restoreCmd = defineCommand5({
2116
2372
  meta: {
2117
2373
  name: "restore",
2118
2374
  description: "Extract a backup tar.gz into ~/.bazilion (offline; server must be stopped)"
@@ -2219,7 +2475,7 @@ var restoreCmd = defineCommand4({
2219
2475
  console.log("start the server with: bazilion serve (migrations apply automatically)");
2220
2476
  }
2221
2477
  });
2222
- var backupCommand = defineCommand4({
2478
+ var backupCommand = defineCommand5({
2223
2479
  meta: { name: "backup", description: "Create or restore a ~/.bazilion tar.gz backup" },
2224
2480
  subCommands: {
2225
2481
  create: createCmd,
@@ -2233,7 +2489,7 @@ var backupCommand = defineCommand4({
2233
2489
  });
2234
2490
 
2235
2491
  // src/commands/completion.ts
2236
- import { defineCommand as defineCommand5 } from "citty";
2492
+ import { defineCommand as defineCommand6 } from "citty";
2237
2493
  async function walk(cmd, path, out) {
2238
2494
  const subsRaw = cmd.subCommands ?? {};
2239
2495
  const subNames = Object.keys(subsRaw);
@@ -2338,7 +2594,7 @@ function fishScript(flat) {
2338
2594
  `;
2339
2595
  }
2340
2596
  function completionCommand(main2) {
2341
- return defineCommand5({
2597
+ return defineCommand6({
2342
2598
  meta: {
2343
2599
  name: "completion",
2344
2600
  description: "Print a shell completion script (bash, zsh, or fish)"
@@ -2363,13 +2619,13 @@ function completionCommand(main2) {
2363
2619
  }
2364
2620
 
2365
2621
  // src/commands/config.ts
2366
- import { defineCommand as defineCommand6 } from "citty";
2622
+ import { defineCommand as defineCommand7 } from "citty";
2367
2623
  function displayValue(f) {
2368
2624
  if (!f.set) return "(unset)";
2369
2625
  if (f.kind === "secret") return f.preview ?? "(set)";
2370
2626
  return f.value ?? "(set)";
2371
2627
  }
2372
- var listCmd2 = defineCommand6({
2628
+ var listCmd2 = defineCommand7({
2373
2629
  meta: {
2374
2630
  name: "list",
2375
2631
  description: "List every configurable field (credentials + URLs) across all services"
@@ -2392,7 +2648,7 @@ var listCmd2 = defineCommand6({
2392
2648
  for (const line of columnize(rows)) console.log(line);
2393
2649
  }
2394
2650
  });
2395
- var setCmd = defineCommand6({
2651
+ var setCmd = defineCommand7({
2396
2652
  meta: {
2397
2653
  name: "set",
2398
2654
  description: "Set a configurable field (auto-routes to secrets or plaintext store)"
@@ -2419,7 +2675,7 @@ var setCmd = defineCommand6({
2419
2675
  console.log(`${state.envVar} (${state.kind}): ${displayValue(state)}`);
2420
2676
  }
2421
2677
  });
2422
- var rmCmd = defineCommand6({
2678
+ var rmCmd = defineCommand7({
2423
2679
  meta: { name: "rm", description: "Remove a configurable field value" },
2424
2680
  args: {
2425
2681
  envVar: { type: "positional", required: true, description: "Env var name to clear" }
@@ -2430,7 +2686,7 @@ var rmCmd = defineCommand6({
2430
2686
  console.log(`removed ${args.envVar}`);
2431
2687
  }
2432
2688
  });
2433
- var configCommand = defineCommand6({
2689
+ var configCommand = defineCommand7({
2434
2690
  meta: {
2435
2691
  name: "config",
2436
2692
  description: "Manage service configuration \u2014 credentials (encrypted) and URLs/IDs (plaintext), unified under one CLI"
@@ -2447,7 +2703,7 @@ import { spawn } from "child_process";
2447
2703
  import { existsSync as existsSync3 } from "fs";
2448
2704
  import { connect } from "net";
2449
2705
  import { join as join3 } from "path";
2450
- import { defineCommand as defineCommand7 } from "citty";
2706
+ import { defineCommand as defineCommand8 } from "citty";
2451
2707
  var bundledDaemonEntry = join3(import.meta.dirname, "daemon.js");
2452
2708
  var sourceDaemonEntry = join3(import.meta.dirname, "..", "..", "..", "daemon", "src", "index.ts");
2453
2709
  var daemonEntry = existsSync3(bundledDaemonEntry) ? bundledDaemonEntry : sourceDaemonEntry;
@@ -2541,7 +2797,7 @@ function spawnProcess(label, entry2, env) {
2541
2797
  stdio: "inherit"
2542
2798
  });
2543
2799
  }
2544
- var dashboardCommand = defineCommand7({
2800
+ var dashboardCommand = defineCommand8({
2545
2801
  meta: {
2546
2802
  name: "dashboard",
2547
2803
  description: "Start the bazilion daemon and bundled web UI"
@@ -2660,8 +2916,8 @@ var dashboardCommand = defineCommand7({
2660
2916
  });
2661
2917
 
2662
2918
  // src/commands/doctor.ts
2663
- import { defineCommand as defineCommand8 } from "citty";
2664
- var doctorCommand = defineCommand8({
2919
+ import { defineCommand as defineCommand9 } from "citty";
2920
+ var doctorCommand = defineCommand9({
2665
2921
  meta: { name: "doctor", description: "Diagnose your bazilion install" },
2666
2922
  async run() {
2667
2923
  const client = createClient2();
@@ -2803,7 +3059,7 @@ var doctorCommand = defineCommand8({
2803
3059
  });
2804
3060
 
2805
3061
  // src/commands/inbox.ts
2806
- import { defineCommand as defineCommand9 } from "citty";
3062
+ import { defineCommand as defineCommand10 } from "citty";
2807
3063
  function decodeText(payload) {
2808
3064
  try {
2809
3065
  const obj = JSON.parse(payload);
@@ -2819,7 +3075,7 @@ function messageRow(m) {
2819
3075
  const preview = text2.length > 60 ? `${text2.slice(0, 60)}\u2026` : text2;
2820
3076
  return [m.id, state, when, `from:${m.fromAgentId.slice(0, 8)}`, `"${preview}"`];
2821
3077
  }
2822
- var listCmd3 = defineCommand9({
3078
+ var listCmd3 = defineCommand10({
2823
3079
  meta: { name: "list", description: "List messages in an agent inbox" },
2824
3080
  args: {
2825
3081
  agent: { type: "positional", required: true, description: "Recipient agent id" },
@@ -2838,7 +3094,7 @@ var listCmd3 = defineCommand9({
2838
3094
  for (const line of columnize(messages.map(messageRow))) console.log(line);
2839
3095
  }
2840
3096
  });
2841
- var showCmd2 = defineCommand9({
3097
+ var showCmd2 = defineCommand10({
2842
3098
  meta: { name: "show", description: "Show a single message in full" },
2843
3099
  args: {
2844
3100
  id: { type: "positional", required: true, description: "Message id" }
@@ -2858,7 +3114,7 @@ var showCmd2 = defineCommand9({
2858
3114
  console.log(decodeText(m.payload));
2859
3115
  }
2860
3116
  });
2861
- var readCmd = defineCommand9({
3117
+ var readCmd = defineCommand10({
2862
3118
  meta: { name: "read", description: "Mark a message as read" },
2863
3119
  args: {
2864
3120
  id: { type: "positional", required: true, description: "Message id" }
@@ -2869,18 +3125,47 @@ var readCmd = defineCommand9({
2869
3125
  console.log(`marked read: ${args.id}`);
2870
3126
  }
2871
3127
  });
2872
- var inboxCommand = defineCommand9({
3128
+ var loopBreaksCmd = defineCommand10({
3129
+ meta: { name: "loop-breaks", description: "List stopped agent-message chains" },
3130
+ args: {
3131
+ agent: { type: "positional", required: true, description: "Agent id" },
3132
+ limit: { type: "string", description: "Maximum events to show (default 25)" }
3133
+ },
3134
+ async run({ args }) {
3135
+ const client = createClient2();
3136
+ const limit = args.limit ? `?limit=${encodeURIComponent(args.limit)}` : "";
3137
+ const { events } = await client.get(
3138
+ `/api/agents/${args.agent}/loop-breaks${limit}`
3139
+ );
3140
+ if (events.length === 0) {
3141
+ console.log("(no agent-message chains stopped)");
3142
+ return;
3143
+ }
3144
+ for (const line of columnize(
3145
+ events.map((event) => [
3146
+ new Date(event.createdAt).toISOString(),
3147
+ `chain:${event.causalChainId.slice(0, 8)}`,
3148
+ `${event.fromAgentId.slice(0, 8)}\u2192${event.toAgentId.slice(0, 8)}`,
3149
+ `hop:${event.attemptedHop}/${event.maxHops}`,
3150
+ event.reason
3151
+ ])
3152
+ ))
3153
+ console.log(line);
3154
+ }
3155
+ });
3156
+ var inboxCommand = defineCommand10({
2873
3157
  meta: { name: "inbox", description: "Inspect agent inboxes" },
2874
3158
  subCommands: {
2875
3159
  list: listCmd3,
2876
3160
  show: showCmd2,
2877
- read: readCmd
3161
+ read: readCmd,
3162
+ "loop-breaks": loopBreaksCmd
2878
3163
  }
2879
3164
  });
2880
3165
 
2881
3166
  // src/commands/login.ts
2882
3167
  import { existsSync as existsSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "fs";
2883
- import { defineCommand as defineCommand10 } from "citty";
3168
+ import { defineCommand as defineCommand11 } from "citty";
2884
3169
  function normalizeServer(raw) {
2885
3170
  let url;
2886
3171
  try {
@@ -2900,7 +3185,7 @@ async function verifyToken(server, token) {
2900
3185
  if (res.status === 401) throw new Error("server rejected token (401)");
2901
3186
  if (!res.ok) throw new Error(`server returned ${res.status} from /api/health`);
2902
3187
  }
2903
- var loginCommand = defineCommand10({
3188
+ var loginCommand = defineCommand11({
2904
3189
  meta: {
2905
3190
  name: "login",
2906
3191
  description: "Save a remote bazilion server + token pair to auth.json"
@@ -2948,7 +3233,7 @@ var loginCommand = defineCommand10({
2948
3233
  });
2949
3234
 
2950
3235
  // src/commands/mcp.ts
2951
- import { defineCommand as defineCommand11 } from "citty";
3236
+ import { defineCommand as defineCommand12 } from "citty";
2952
3237
  function serverRow(s) {
2953
3238
  const where = s.transport === "stdio" ? `${s.command} ${s.args.join(" ")}`.trim() : s.url ?? "";
2954
3239
  return [
@@ -2960,7 +3245,7 @@ function serverRow(s) {
2960
3245
  where
2961
3246
  ];
2962
3247
  }
2963
- var addCmd = defineCommand11({
3248
+ var addCmd = defineCommand12({
2964
3249
  meta: { name: "add", description: "Register an MCP server" },
2965
3250
  args: {
2966
3251
  name: { type: "positional", required: true, description: "Unique name ([a-zA-Z0-9_])" },
@@ -2987,7 +3272,7 @@ var addCmd = defineCommand11({
2987
3272
  console.log(`${server.id} ${server.name} ${server.transport}`);
2988
3273
  }
2989
3274
  });
2990
- var listCmd4 = defineCommand11({
3275
+ var listCmd4 = defineCommand12({
2991
3276
  meta: { name: "list", description: "List MCP servers" },
2992
3277
  async run() {
2993
3278
  const client = createClient2();
@@ -2999,7 +3284,7 @@ var listCmd4 = defineCommand11({
2999
3284
  for (const line of columnize(servers.map(serverRow))) console.log(line);
3000
3285
  }
3001
3286
  });
3002
- var showCmd3 = defineCommand11({
3287
+ var showCmd3 = defineCommand12({
3003
3288
  meta: { name: "show", description: "Show one MCP server" },
3004
3289
  args: { id: { type: "positional", required: true } },
3005
3290
  async run({ args }) {
@@ -3008,7 +3293,7 @@ var showCmd3 = defineCommand11({
3008
3293
  console.log(JSON.stringify(server, null, 2));
3009
3294
  }
3010
3295
  });
3011
- var rmCmd2 = defineCommand11({
3296
+ var rmCmd2 = defineCommand12({
3012
3297
  meta: { name: "rm", description: "Delete an MCP server" },
3013
3298
  args: { id: { type: "positional", required: true } },
3014
3299
  async run({ args }) {
@@ -3017,7 +3302,7 @@ var rmCmd2 = defineCommand11({
3017
3302
  console.log(`removed MCP server ${args.id}`);
3018
3303
  }
3019
3304
  });
3020
- var enableCmd = defineCommand11({
3305
+ var enableCmd = defineCommand12({
3021
3306
  meta: { name: "enable", description: "Enable an MCP server" },
3022
3307
  args: { id: { type: "positional", required: true } },
3023
3308
  async run({ args }) {
@@ -3026,7 +3311,7 @@ var enableCmd = defineCommand11({
3026
3311
  console.log(`enabled MCP server ${args.id}`);
3027
3312
  }
3028
3313
  });
3029
- var disableCmd = defineCommand11({
3314
+ var disableCmd = defineCommand12({
3030
3315
  meta: { name: "disable", description: "Disable an MCP server" },
3031
3316
  args: { id: { type: "positional", required: true } },
3032
3317
  async run({ args }) {
@@ -3035,7 +3320,7 @@ var disableCmd = defineCommand11({
3035
3320
  console.log(`disabled MCP server ${args.id}`);
3036
3321
  }
3037
3322
  });
3038
- var testCmd = defineCommand11({
3323
+ var testCmd = defineCommand12({
3039
3324
  meta: { name: "test", description: "Connect to a server and list its tools" },
3040
3325
  args: { id: { type: "positional", required: true } },
3041
3326
  async run({ args }) {
@@ -3053,7 +3338,7 @@ var testCmd = defineCommand11({
3053
3338
  for (const t of tools) console.log(` ${t.name} ${t.description}`);
3054
3339
  }
3055
3340
  });
3056
- var mcpCommand = defineCommand11({
3341
+ var mcpCommand = defineCommand12({
3057
3342
  meta: { name: "mcp", description: "Manage MCP servers" },
3058
3343
  subCommands: {
3059
3344
  add: addCmd,
@@ -3067,11 +3352,11 @@ var mcpCommand = defineCommand11({
3067
3352
  });
3068
3353
 
3069
3354
  // src/commands/memory.ts
3070
- import { defineCommand as defineCommand12 } from "citty";
3355
+ import { defineCommand as defineCommand13 } from "citty";
3071
3356
  function encodeKey(key) {
3072
3357
  return key.split("/").map(encodeURIComponent).join("/");
3073
3358
  }
3074
- var writeCmd = defineCommand12({
3359
+ var writeCmd = defineCommand13({
3075
3360
  meta: { name: "write", description: "Write an entry into a team's shared memory" },
3076
3361
  args: {
3077
3362
  team: { type: "positional", required: true, description: "Team slug" },
@@ -3087,7 +3372,7 @@ var writeCmd = defineCommand12({
3087
3372
  console.log(`wrote ${entry2.key} (${entry2.content.length} bytes)`);
3088
3373
  }
3089
3374
  });
3090
- var readCmd2 = defineCommand12({
3375
+ var readCmd2 = defineCommand13({
3091
3376
  meta: { name: "read", description: "Read an entry from a team's shared memory" },
3092
3377
  args: {
3093
3378
  team: { type: "positional", required: true, description: "Team slug" },
@@ -3101,7 +3386,7 @@ var readCmd2 = defineCommand12({
3101
3386
  console.log(entry2.content);
3102
3387
  }
3103
3388
  });
3104
- var searchCmd = defineCommand12({
3389
+ var searchCmd = defineCommand13({
3105
3390
  meta: { name: "search", description: "Search a team's shared memory" },
3106
3391
  args: {
3107
3392
  team: { type: "positional", required: true, description: "Team slug" },
@@ -3122,7 +3407,7 @@ var searchCmd = defineCommand12({
3122
3407
  }
3123
3408
  }
3124
3409
  });
3125
- var listCmd5 = defineCommand12({
3410
+ var listCmd5 = defineCommand13({
3126
3411
  meta: { name: "list", description: "List all entries in a team's shared memory" },
3127
3412
  args: {
3128
3413
  team: { type: "positional", required: true, description: "Team slug" }
@@ -3139,7 +3424,7 @@ var listCmd5 = defineCommand12({
3139
3424
  }
3140
3425
  }
3141
3426
  });
3142
- var rmCmd3 = defineCommand12({
3427
+ var rmCmd3 = defineCommand13({
3143
3428
  meta: { name: "rm", description: "Remove an entry from a team's shared memory" },
3144
3429
  args: {
3145
3430
  team: { type: "positional", required: true, description: "Team slug" },
@@ -3151,7 +3436,7 @@ var rmCmd3 = defineCommand12({
3151
3436
  console.log(`removed ${args.key}`);
3152
3437
  }
3153
3438
  });
3154
- var memoryCommand = defineCommand12({
3439
+ var memoryCommand = defineCommand13({
3155
3440
  meta: {
3156
3441
  name: "memory",
3157
3442
  description: "Manage a team's shared memory (BM25-indexed markdown notes)"
@@ -3183,7 +3468,7 @@ var PROFILE_FILES = [
3183
3468
  ];
3184
3469
 
3185
3470
  // src/commands/profile.ts
3186
- import { defineCommand as defineCommand13 } from "citty";
3471
+ import { defineCommand as defineCommand14 } from "citty";
3187
3472
  function splitCsv(v) {
3188
3473
  if (!v) return void 0;
3189
3474
  const out = v.split(",").map((s) => s.trim()).filter(Boolean);
@@ -3194,7 +3479,7 @@ function parseSkillsMode(v) {
3194
3479
  if (v === "all" || v === "selected") return v;
3195
3480
  throw new Error(`--skills-mode must be 'all' or 'selected', got '${v}'`);
3196
3481
  }
3197
- var createCmd2 = defineCommand13({
3482
+ var createCmd2 = defineCommand14({
3198
3483
  meta: { name: "create", description: "Create a new profile" },
3199
3484
  args: {
3200
3485
  id: { type: "positional", required: true, description: "Profile slug" },
@@ -3257,20 +3542,20 @@ var createCmd2 = defineCommand13({
3257
3542
  console.log(`created profile ${profile.id} at ${profile.dir}`);
3258
3543
  }
3259
3544
  });
3260
- var listCmd6 = defineCommand13({
3545
+ var listCmd6 = defineCommand14({
3261
3546
  meta: { name: "list", description: "List profiles" },
3262
3547
  async run() {
3263
3548
  const client = createClient2();
3264
- const list4 = await client.get("/api/profiles");
3265
- if (list4.length === 0) {
3549
+ const list5 = await client.get("/api/profiles");
3550
+ if (list5.length === 0) {
3266
3551
  console.log("(no profiles)");
3267
3552
  return;
3268
3553
  }
3269
- const rows = list4.map((p) => [p.id, p.defaultModel, p.name]);
3554
+ const rows = list5.map((p) => [p.id, p.defaultModel, p.name]);
3270
3555
  for (const line of columnize(rows)) console.log(line);
3271
3556
  }
3272
3557
  });
3273
- var showCmd4 = defineCommand13({
3558
+ var showCmd4 = defineCommand14({
3274
3559
  meta: { name: "show", description: "Show profile details" },
3275
3560
  args: {
3276
3561
  id: { type: "positional", required: true }
@@ -3295,7 +3580,7 @@ var showCmd4 = defineCommand13({
3295
3580
  }
3296
3581
  }
3297
3582
  });
3298
- var editCmd2 = defineCommand13({
3583
+ var editCmd2 = defineCommand14({
3299
3584
  meta: { name: "edit", description: "Open a profile file in $EDITOR" },
3300
3585
  args: {
3301
3586
  id: { type: "positional", required: true },
@@ -3340,7 +3625,7 @@ var editCmd2 = defineCommand13({
3340
3625
  }
3341
3626
  }
3342
3627
  });
3343
- var updateCmd = defineCommand13({
3628
+ var updateCmd = defineCommand14({
3344
3629
  meta: {
3345
3630
  name: "update",
3346
3631
  description: "Update profile settings (name, model, skills-mode, skills)"
@@ -3374,7 +3659,7 @@ var updateCmd = defineCommand13({
3374
3659
  console.log(`updated profile ${profile.id}`);
3375
3660
  }
3376
3661
  });
3377
- var deleteCmd2 = defineCommand13({
3662
+ var deleteCmd2 = defineCommand14({
3378
3663
  meta: { name: "delete", description: "Permanently delete a profile and its files" },
3379
3664
  args: {
3380
3665
  id: { type: "positional", required: true }
@@ -3385,7 +3670,7 @@ var deleteCmd2 = defineCommand13({
3385
3670
  console.log(`deleted profile ${args.id}`);
3386
3671
  }
3387
3672
  });
3388
- var profileCommand = defineCommand13({
3673
+ var profileCommand = defineCommand14({
3389
3674
  meta: { name: "profile", description: "Manage profiles" },
3390
3675
  subCommands: {
3391
3676
  create: createCmd2,
@@ -3398,8 +3683,8 @@ var profileCommand = defineCommand13({
3398
3683
  });
3399
3684
 
3400
3685
  // src/commands/provider.ts
3401
- import { defineCommand as defineCommand14 } from "citty";
3402
- var listCmd7 = defineCommand14({
3686
+ import { defineCommand as defineCommand15 } from "citty";
3687
+ var listCmd7 = defineCommand15({
3403
3688
  meta: {
3404
3689
  name: "list",
3405
3690
  description: "List all providers with enabled/disabled state and curated model counts"
@@ -3425,7 +3710,7 @@ var listCmd7 = defineCommand14({
3425
3710
  for (const line of columnize(rows)) console.log(line);
3426
3711
  }
3427
3712
  });
3428
- var modelsCmd = defineCommand14({
3713
+ var modelsCmd = defineCommand15({
3429
3714
  meta: {
3430
3715
  name: "models",
3431
3716
  description: "Show curated + catalog + live models for one provider"
@@ -3457,7 +3742,7 @@ var modelsCmd = defineCommand14({
3457
3742
  }
3458
3743
  }
3459
3744
  });
3460
- var modelsSetCmd = defineCommand14({
3745
+ var modelsSetCmd = defineCommand15({
3461
3746
  meta: {
3462
3747
  name: "models-set",
3463
3748
  description: "Replace the curated model list for a provider (comma-separated)"
@@ -3482,7 +3767,7 @@ var modelsSetCmd = defineCommand14({
3482
3767
  for (const m of saved.models) console.log(` ${m}`);
3483
3768
  }
3484
3769
  });
3485
- var enableCmd2 = defineCommand14({
3770
+ var enableCmd2 = defineCommand15({
3486
3771
  meta: { name: "enable", description: "Toggle a provider on so agents can use it" },
3487
3772
  args: {
3488
3773
  name: { type: "positional", required: true, description: "Provider id (e.g. anthropic)" }
@@ -3496,7 +3781,7 @@ var enableCmd2 = defineCommand14({
3496
3781
  console.log(`${res.name}: enabled`);
3497
3782
  }
3498
3783
  });
3499
- var disableCmd2 = defineCommand14({
3784
+ var disableCmd2 = defineCommand15({
3500
3785
  meta: {
3501
3786
  name: "disable",
3502
3787
  description: "Toggle a provider off \u2014 agents will refuse its model strings"
@@ -3513,7 +3798,7 @@ var disableCmd2 = defineCommand14({
3513
3798
  console.log(`${res.name}: disabled`);
3514
3799
  }
3515
3800
  });
3516
- var testCmd2 = defineCommand14({
3801
+ var testCmd2 = defineCommand15({
3517
3802
  meta: { name: "test", description: "Send a single chat to a model and print the reply" },
3518
3803
  args: {
3519
3804
  model: {
@@ -3534,7 +3819,7 @@ var testCmd2 = defineCommand14({
3534
3819
  }
3535
3820
  }
3536
3821
  });
3537
- var providerCommand = defineCommand14({
3822
+ var providerCommand = defineCommand15({
3538
3823
  meta: { name: "provider", description: "Manage and test LLM providers" },
3539
3824
  subCommands: {
3540
3825
  list: listCmd7,
@@ -3547,8 +3832,8 @@ var providerCommand = defineCommand14({
3547
3832
  });
3548
3833
 
3549
3834
  // src/commands/send.ts
3550
- import { defineCommand as defineCommand15 } from "citty";
3551
- var sendCommand = defineCommand15({
3835
+ import { defineCommand as defineCommand16 } from "citty";
3836
+ var sendCommand = defineCommand16({
3552
3837
  meta: {
3553
3838
  name: "send",
3554
3839
  description: "Send a message from one agent to another"
@@ -3582,11 +3867,11 @@ var sendCommand = defineCommand15({
3582
3867
  import { spawn as spawn3 } from "child_process";
3583
3868
  import { existsSync as existsSync5 } from "fs";
3584
3869
  import { join as join5 } from "path";
3585
- import { defineCommand as defineCommand16 } from "citty";
3870
+ import { defineCommand as defineCommand17 } from "citty";
3586
3871
  var bundledDaemonEntry2 = join5(import.meta.dirname, "daemon.js");
3587
3872
  var sourceDaemonEntry2 = join5(import.meta.dirname, "..", "..", "..", "daemon", "src", "index.ts");
3588
3873
  var daemonEntry2 = existsSync5(bundledDaemonEntry2) ? bundledDaemonEntry2 : sourceDaemonEntry2;
3589
- var serveCommand = defineCommand16({
3874
+ var serveCommand = defineCommand17({
3590
3875
  meta: {
3591
3876
  name: "serve",
3592
3877
  description: "Start the bazilion daemon (HTTP API)"
@@ -3655,14 +3940,14 @@ var serveCommand = defineCommand16({
3655
3940
  // src/commands/skill.ts
3656
3941
  import { existsSync as existsSync6, readFileSync as readFileSync7, statSync } from "fs";
3657
3942
  import { basename as basename4, resolve as resolve3 } from "path";
3658
- import { defineCommand as defineCommand17 } from "citty";
3943
+ import { defineCommand as defineCommand18 } from "citty";
3659
3944
  function printFindings(findings, prefix = " ") {
3660
3945
  for (const f of findings) {
3661
3946
  const line = f.line ? ` line ${f.line}` : "";
3662
3947
  console.log(`${prefix}${f.severity}: ${f.code}${line} - ${f.message}`);
3663
3948
  }
3664
3949
  }
3665
- var listCmd8 = defineCommand17({
3950
+ var listCmd8 = defineCommand18({
3666
3951
  meta: { name: "list", description: "List installed skills (or those attached to an agent)" },
3667
3952
  args: {
3668
3953
  agent: { type: "string", description: "Filter to skills attached to this agent" }
@@ -3703,7 +3988,7 @@ var listCmd8 = defineCommand17({
3703
3988
  }
3704
3989
  }
3705
3990
  });
3706
- var importCmd = defineCommand17({
3991
+ var importCmd = defineCommand18({
3707
3992
  meta: {
3708
3993
  name: "import",
3709
3994
  description: "Import skills from openclaw, a directory, or a local .zip archive"
@@ -3772,7 +4057,7 @@ var importCmd = defineCommand17({
3772
4057
  }
3773
4058
  }
3774
4059
  });
3775
- var rmCmd4 = defineCommand17({
4060
+ var rmCmd4 = defineCommand18({
3776
4061
  meta: { name: "rm", description: "Remove an installed skill" },
3777
4062
  args: {
3778
4063
  name: { type: "positional", required: true }
@@ -3783,7 +4068,7 @@ var rmCmd4 = defineCommand17({
3783
4068
  console.log(`removed skill ${args.name}`);
3784
4069
  }
3785
4070
  });
3786
- var skillCommand = defineCommand17({
4071
+ var skillCommand = defineCommand18({
3787
4072
  meta: { name: "skill", description: "Manage the skill library" },
3788
4073
  subCommands: {
3789
4074
  list: listCmd8,
@@ -3795,11 +4080,11 @@ var skillCommand = defineCommand17({
3795
4080
  // src/commands/team.ts
3796
4081
  import { readFileSync as readFileSync9 } from "fs";
3797
4082
  import { stdin as stdin2 } from "process";
3798
- import { defineCommand as defineCommand19 } from "citty";
4083
+ import { defineCommand as defineCommand20 } from "citty";
3799
4084
 
3800
4085
  // src/commands/team-policy.ts
3801
4086
  import { readFileSync as readFileSync8 } from "fs";
3802
- import { defineCommand as defineCommand18 } from "citty";
4087
+ import { defineCommand as defineCommand19 } from "citty";
3803
4088
 
3804
4089
  // src/team-interchange.ts
3805
4090
  var TEAM_POLICY_INTERCHANGE_VERSION = 1;
@@ -4047,7 +4332,7 @@ function printPolicy(detail) {
4047
4332
  console.log(line);
4048
4333
  }
4049
4334
  }
4050
- var show2 = defineCommand18({
4335
+ var show2 = defineCommand19({
4051
4336
  meta: { name: "show", description: "Show the one effective live policy for a Team" },
4052
4337
  args: {
4053
4338
  team: { type: "positional", required: true },
@@ -4061,7 +4346,7 @@ var show2 = defineCommand18({
4061
4346
  else printPolicy(detail);
4062
4347
  }
4063
4348
  });
4064
- var exportCommand = defineCommand18({
4349
+ var exportCommand = defineCommand19({
4065
4350
  meta: { name: "export", description: "Export a revisioned Team policy document" },
4066
4351
  args: { team: { type: "positional", required: true } },
4067
4352
  async run({ args }) {
@@ -4085,7 +4370,7 @@ function printEdgeDiff(current, edges) {
4085
4370
  for (const value of diff2.added) console.log(` + ${value}`);
4086
4371
  for (const value of diff2.removed) console.log(` - ${value}`);
4087
4372
  }
4088
- var importCommand = defineCommand18({
4373
+ var importCommand = defineCommand19({
4089
4374
  meta: {
4090
4375
  name: "import",
4091
4376
  description: "Validate, diff, and explicitly replace a Team policy"
@@ -4140,7 +4425,7 @@ var importCommand = defineCommand18({
4140
4425
  console.log(`updated Team ${args.team} policy to revision ${updated.teamPolicy.revision}`);
4141
4426
  }
4142
4427
  });
4143
- var diff = defineCommand18({
4428
+ var diff = defineCommand19({
4144
4429
  meta: { name: "diff", description: "Compare live policy with its retained baseline source" },
4145
4430
  args: {
4146
4431
  team: { type: "positional", required: true },
@@ -4164,7 +4449,7 @@ var diff = defineCommand18({
4164
4449
  );
4165
4450
  }
4166
4451
  });
4167
- var evaluate = defineCommand18({
4452
+ var evaluate = defineCommand19({
4168
4453
  meta: {
4169
4454
  name: "evaluate",
4170
4455
  description: "Evaluate a communication path without sending or recording a block"
@@ -4195,7 +4480,7 @@ var evaluate = defineCommand18({
4195
4480
  );
4196
4481
  }
4197
4482
  });
4198
- var blocks = defineCommand18({
4483
+ var blocks = defineCommand19({
4199
4484
  meta: { name: "blocks", description: "List paginated durable communication denials" },
4200
4485
  args: {
4201
4486
  team: { type: "positional", required: true },
@@ -4244,7 +4529,7 @@ var blocks = defineCommand18({
4244
4529
  if (page.nextCursor) console.log(`next cursor: ${page.nextCursor}`);
4245
4530
  }
4246
4531
  });
4247
- var teamPolicyCommand = defineCommand18({
4532
+ var teamPolicyCommand = defineCommand19({
4248
4533
  meta: { name: "policy", description: "Inspect and manage the Team-owned live policy" },
4249
4534
  subCommands: {
4250
4535
  show: show2,
@@ -4257,7 +4542,7 @@ var teamPolicyCommand = defineCommand18({
4257
4542
  });
4258
4543
 
4259
4544
  // src/commands/team.ts
4260
- var addCmd2 = defineCommand19({
4545
+ var addCmd2 = defineCommand20({
4261
4546
  meta: {
4262
4547
  name: "add",
4263
4548
  description: "Register a team at ~/.bazilion/teams/<slug>/ (use --link to point at an existing tree)"
@@ -4281,20 +4566,20 @@ var addCmd2 = defineCommand19({
4281
4566
  console.log(`registered team ${g.id} at ${g.path}`);
4282
4567
  }
4283
4568
  });
4284
- var listCmd9 = defineCommand19({
4569
+ var listCmd9 = defineCommand20({
4285
4570
  meta: { name: "list", description: "List teams" },
4286
4571
  async run() {
4287
4572
  const client = createClient2();
4288
- const list4 = await client.get("/api/teams");
4289
- if (list4.length === 0) {
4573
+ const list5 = await client.get("/api/teams");
4574
+ if (list5.length === 0) {
4290
4575
  console.log("(no teams)");
4291
4576
  return;
4292
4577
  }
4293
- const rows = list4.map((g) => [g.id, g.path]);
4578
+ const rows = list5.map((g) => [g.id, g.path]);
4294
4579
  for (const line of columnize(rows)) console.log(line);
4295
4580
  }
4296
4581
  });
4297
- var rmCmd5 = defineCommand19({
4582
+ var rmCmd5 = defineCommand20({
4298
4583
  meta: { name: "rm", description: "Remove a team registration" },
4299
4584
  args: {
4300
4585
  id: { type: "positional", required: true }
@@ -4315,7 +4600,7 @@ async function readStdin() {
4315
4600
  for await (const chunk of stdin2) chunks.push(chunk);
4316
4601
  return Buffer.concat(chunks).toString("utf8");
4317
4602
  }
4318
- var userMdShowCmd = defineCommand19({
4603
+ var userMdShowCmd = defineCommand20({
4319
4604
  meta: { name: "show", description: "Print the team's USER.md" },
4320
4605
  args: { id: { type: "positional", required: true } },
4321
4606
  async run({ args }) {
@@ -4325,7 +4610,7 @@ var userMdShowCmd = defineCommand19({
4325
4610
  if (g.userMd && !g.userMd.endsWith("\n")) process.stdout.write("\n");
4326
4611
  }
4327
4612
  });
4328
- var userMdSetCmd = defineCommand19({
4613
+ var userMdSetCmd = defineCommand20({
4329
4614
  meta: {
4330
4615
  name: "set",
4331
4616
  description: "Replace the team's USER.md (from --file, --from-stdin, or inline text)"
@@ -4351,7 +4636,7 @@ var userMdSetCmd = defineCommand19({
4351
4636
  console.log(`updated USER.md for team ${args.id} (${content.length} bytes)`);
4352
4637
  }
4353
4638
  });
4354
- var userMdClearCmd = defineCommand19({
4639
+ var userMdClearCmd = defineCommand20({
4355
4640
  meta: { name: "clear", description: "Clear the team's USER.md to empty" },
4356
4641
  args: { id: { type: "positional", required: true } },
4357
4642
  async run({ args }) {
@@ -4361,7 +4646,7 @@ var userMdClearCmd = defineCommand19({
4361
4646
  console.log(`cleared USER.md for team ${args.id}`);
4362
4647
  }
4363
4648
  });
4364
- var userMdCmd = defineCommand19({
4649
+ var userMdCmd = defineCommand20({
4365
4650
  meta: { name: "user-md", description: "View or edit a team's USER.md" },
4366
4651
  subCommands: {
4367
4652
  show: userMdShowCmd,
@@ -4369,7 +4654,7 @@ var userMdCmd = defineCommand19({
4369
4654
  clear: userMdClearCmd
4370
4655
  }
4371
4656
  });
4372
- var topicFormatShowCmd = defineCommand19({
4657
+ var topicFormatShowCmd = defineCommand20({
4373
4658
  meta: { name: "show", description: "Print the team's Telegram topic-name template" },
4374
4659
  args: { id: { type: "positional", required: true } },
4375
4660
  async run({ args }) {
@@ -4378,7 +4663,7 @@ var topicFormatShowCmd = defineCommand19({
4378
4663
  console.log(g.telegramTopicNameFormat ?? "(default naming)");
4379
4664
  }
4380
4665
  });
4381
- var topicFormatSetCmd = defineCommand19({
4666
+ var topicFormatSetCmd = defineCommand20({
4382
4667
  meta: {
4383
4668
  name: "set",
4384
4669
  description: "Set the topic-name template. Tokens: {agent.name} {team.name} {team.slug} (must include {agent.name})"
@@ -4398,7 +4683,7 @@ var topicFormatSetCmd = defineCommand19({
4398
4683
  console.log(`set topic-name template for team ${args.id}: ${g.telegramTopicNameFormat}`);
4399
4684
  }
4400
4685
  });
4401
- var topicFormatClearCmd = defineCommand19({
4686
+ var topicFormatClearCmd = defineCommand20({
4402
4687
  meta: { name: "clear", description: "Clear the template (revert to built-in naming)" },
4403
4688
  args: { id: { type: "positional", required: true } },
4404
4689
  async run({ args }) {
@@ -4408,7 +4693,7 @@ var topicFormatClearCmd = defineCommand19({
4408
4693
  console.log(`cleared topic-name template for team ${args.id}`);
4409
4694
  }
4410
4695
  });
4411
- var topicFormatCmd = defineCommand19({
4696
+ var topicFormatCmd = defineCommand20({
4412
4697
  meta: {
4413
4698
  name: "topic-format",
4414
4699
  description: "View or edit a team's Telegram forum-topic name template"
@@ -4419,7 +4704,7 @@ var topicFormatCmd = defineCommand19({
4419
4704
  clear: topicFormatClearCmd
4420
4705
  }
4421
4706
  });
4422
- var teamCommand = defineCommand19({
4707
+ var teamCommand = defineCommand20({
4423
4708
  meta: { name: "team", description: "Manage teams (collaboration contexts)" },
4424
4709
  subCommands: {
4425
4710
  add: addCmd2,
@@ -4433,7 +4718,7 @@ var teamCommand = defineCommand19({
4433
4718
 
4434
4719
  // src/commands/team-template.ts
4435
4720
  import { readFileSync as readFileSync10 } from "fs";
4436
- import { defineCommand as defineCommand20 } from "citty";
4721
+ import { defineCommand as defineCommand21 } from "citty";
4437
4722
  function jsonFile(path) {
4438
4723
  try {
4439
4724
  return JSON.parse(readFileSync10(path, "utf8"));
@@ -4461,7 +4746,7 @@ function printTeam(detail) {
4461
4746
  console.log(line);
4462
4747
  }
4463
4748
  }
4464
- var list3 = defineCommand20({
4749
+ var list4 = defineCommand21({
4465
4750
  meta: { name: "list", description: "List canonical Team templates" },
4466
4751
  args: { json: { type: "boolean", description: "Emit stable JSON" } },
4467
4752
  async run({ args }) {
@@ -4475,7 +4760,7 @@ var list3 = defineCommand20({
4475
4760
  console.log(line);
4476
4761
  }
4477
4762
  });
4478
- var show3 = defineCommand20({
4763
+ var show3 = defineCommand21({
4479
4764
  meta: { name: "show", description: "Show a canonical Team template" },
4480
4765
  args: {
4481
4766
  id: { type: "positional", required: true },
@@ -4489,7 +4774,7 @@ var show3 = defineCommand20({
4489
4774
  else printTeam(detail);
4490
4775
  }
4491
4776
  });
4492
- var exportCommand2 = defineCommand20({
4777
+ var exportCommand2 = defineCommand21({
4493
4778
  meta: {
4494
4779
  name: "export",
4495
4780
  description: "Export a portable versioned Team-template document to stdout"
@@ -4529,7 +4814,7 @@ function printImportDiff(current, document) {
4529
4814
  for (const value of diff2.added) console.log(` + ${value}`);
4530
4815
  for (const value of diff2.removed) console.log(` - ${value}`);
4531
4816
  }
4532
- var importCommand2 = defineCommand20({
4817
+ var importCommand2 = defineCommand21({
4533
4818
  meta: {
4534
4819
  name: "import",
4535
4820
  description: "Validate, diff, and explicitly apply a portable Team-template document"
@@ -4610,17 +4895,17 @@ var importCommand2 = defineCommand20({
4610
4895
  );
4611
4896
  }
4612
4897
  });
4613
- var teamTemplateCommand = defineCommand20({
4898
+ var teamTemplateCommand = defineCommand21({
4614
4899
  meta: {
4615
4900
  name: "team-template",
4616
4901
  description: "Inspect and exchange canonical Team templates"
4617
4902
  },
4618
- subCommands: { list: list3, show: show3, export: exportCommand2, import: importCommand2 }
4903
+ subCommands: { list: list4, show: show3, export: exportCommand2, import: importCommand2 }
4619
4904
  });
4620
4905
 
4621
4906
  // src/commands/telegram.ts
4622
- import { defineCommand as defineCommand21 } from "citty";
4623
- var setCmd2 = defineCommand21({
4907
+ import { defineCommand as defineCommand22 } from "citty";
4908
+ var setCmd2 = defineCommand22({
4624
4909
  meta: {
4625
4910
  name: "set",
4626
4911
  description: "Save bot token + supergroup chat ID (paired write)"
@@ -4638,7 +4923,7 @@ var setCmd2 = defineCommand21({
4638
4923
  console.log(`saved \xB7 token ${state.botTokenPreview} \xB7 chat ${state.chatId}`);
4639
4924
  }
4640
4925
  });
4641
- var clearCmd = defineCommand21({
4926
+ var clearCmd = defineCommand22({
4642
4927
  meta: {
4643
4928
  name: "clear",
4644
4929
  description: "Remove stored bot token + chat ID"
@@ -4649,7 +4934,7 @@ var clearCmd = defineCommand21({
4649
4934
  console.log("cleared");
4650
4935
  }
4651
4936
  });
4652
- var showCmd5 = defineCommand21({
4937
+ var showCmd5 = defineCommand22({
4653
4938
  meta: {
4654
4939
  name: "show",
4655
4940
  description: "Show what credentials are stored (token is masked)"
@@ -4670,7 +4955,7 @@ var showCmd5 = defineCommand21({
4670
4955
  }
4671
4956
  }
4672
4957
  });
4673
- var reconnectCmd = defineCommand21({
4958
+ var reconnectCmd = defineCommand22({
4674
4959
  meta: {
4675
4960
  name: "reconnect",
4676
4961
  description: "Apply a pending supergroup chat-id migration + re-activate the bot"
@@ -4681,7 +4966,7 @@ var reconnectCmd = defineCommand21({
4681
4966
  console.log(`reconnected \xB7 chat ${state.chatId}`);
4682
4967
  }
4683
4968
  });
4684
- var configCmd = defineCommand21({
4969
+ var configCmd = defineCommand22({
4685
4970
  meta: {
4686
4971
  name: "config",
4687
4972
  description: "Manage Telegram credentials (bot token + chat ID)"
@@ -4692,7 +4977,7 @@ var configCmd = defineCommand21({
4692
4977
  show: showCmd5
4693
4978
  }
4694
4979
  });
4695
- var healthCmd = defineCommand21({
4980
+ var healthCmd = defineCommand22({
4696
4981
  meta: {
4697
4982
  name: "health",
4698
4983
  description: "Run the four-step preflight against the Telegram Bot API"
@@ -4726,7 +5011,7 @@ var healthCmd = defineCommand21({
4726
5011
  if (!allOk) process.exitCode = 1;
4727
5012
  }
4728
5013
  });
4729
- var botStatusCmd = defineCommand21({
5014
+ var botStatusCmd = defineCommand22({
4730
5015
  meta: {
4731
5016
  name: "status",
4732
5017
  description: "Show polling state of the live bot"
@@ -4751,7 +5036,7 @@ var botStatusCmd = defineCommand21({
4751
5036
  if (!p.running) process.exitCode = 1;
4752
5037
  }
4753
5038
  });
4754
- var botRestartCmd = defineCommand21({
5039
+ var botRestartCmd = defineCommand22({
4755
5040
  meta: {
4756
5041
  name: "restart",
4757
5042
  description: "Force-restart the bot (tears down + brings up from current creds)"
@@ -4762,7 +5047,7 @@ var botRestartCmd = defineCommand21({
4762
5047
  console.log("restart requested");
4763
5048
  }
4764
5049
  });
4765
- var botCmd = defineCommand21({
5050
+ var botCmd = defineCommand22({
4766
5051
  meta: {
4767
5052
  name: "bot",
4768
5053
  description: "Inspect / control the live polling bot"
@@ -4772,7 +5057,7 @@ var botCmd = defineCommand21({
4772
5057
  restart: botRestartCmd
4773
5058
  }
4774
5059
  });
4775
- var bindCmd = defineCommand21({
5060
+ var bindCmd = defineCommand22({
4776
5061
  meta: {
4777
5062
  name: "bind",
4778
5063
  description: "Create a Telegram topic for an agent (manual fallback for /talk)"
@@ -4790,7 +5075,7 @@ var bindCmd = defineCommand21({
4790
5075
  console.log(` ${result.deepLink}`);
4791
5076
  }
4792
5077
  });
4793
- var unbindCmd = defineCommand21({
5078
+ var unbindCmd = defineCommand22({
4794
5079
  meta: {
4795
5080
  name: "unbind",
4796
5081
  description: "Clear an agent's Telegram topic binding (topic stays in Telegram as orphan)"
@@ -4804,7 +5089,7 @@ var unbindCmd = defineCommand21({
4804
5089
  console.log(`unbound agent ${args.agent}`);
4805
5090
  }
4806
5091
  });
4807
- var listBindingsCmd = defineCommand21({
5092
+ var listBindingsCmd = defineCommand22({
4808
5093
  meta: {
4809
5094
  name: "list",
4810
5095
  description: "List agents and their Telegram topic bindings"
@@ -4832,7 +5117,7 @@ var listBindingsCmd = defineCommand21({
4832
5117
  }
4833
5118
  }
4834
5119
  });
4835
- var allowCmd = defineCommand21({
5120
+ var allowCmd = defineCommand22({
4836
5121
  meta: { name: "allow", description: "Add a Telegram user id to the allowlist" },
4837
5122
  args: {
4838
5123
  userId: { type: "positional", required: true, description: "Numeric Telegram user id" },
@@ -4849,7 +5134,7 @@ var allowCmd = defineCommand21({
4849
5134
  console.log(`allowed ${u.userId} (${u.role})`);
4850
5135
  }
4851
5136
  });
4852
- var denyCmd = defineCommand21({
5137
+ var denyCmd = defineCommand22({
4853
5138
  meta: { name: "deny", description: "Remove a Telegram user id from the allowlist" },
4854
5139
  args: { userId: { type: "positional", required: true } },
4855
5140
  async run({ args }) {
@@ -4858,7 +5143,7 @@ var denyCmd = defineCommand21({
4858
5143
  console.log(`removed ${args.userId}`);
4859
5144
  }
4860
5145
  });
4861
- var allowedCmd = defineCommand21({
5146
+ var allowedCmd = defineCommand22({
4862
5147
  meta: { name: "allowed", description: "List allowlisted Telegram users" },
4863
5148
  async run() {
4864
5149
  const client = createClient2();
@@ -4873,7 +5158,7 @@ var allowedCmd = defineCommand21({
4873
5158
  }
4874
5159
  }
4875
5160
  });
4876
- var telegramCommand = defineCommand21({
5161
+ var telegramCommand = defineCommand22({
4877
5162
  meta: {
4878
5163
  name: "telegram",
4879
5164
  description: "Telegram integration: credentials, health, bot lifecycle, bindings, access"
@@ -4894,7 +5179,7 @@ var telegramCommand = defineCommand21({
4894
5179
 
4895
5180
  // src/commands/token.ts
4896
5181
  import { networkInterfaces } from "os";
4897
- import { defineCommand as defineCommand22 } from "citty";
5182
+ import { defineCommand as defineCommand23 } from "citty";
4898
5183
  import qrcode from "qrcode-terminal";
4899
5184
  function tokenRow(t) {
4900
5185
  const last = t.lastUsedAt ? new Date(t.lastUsedAt).toISOString() : "(never)";
@@ -4928,7 +5213,7 @@ function resolveQrServer(override) {
4928
5213
  if (detected.warning) console.warn(`\u26A0 ${detected.warning}`);
4929
5214
  return detected.origin;
4930
5215
  }
4931
- var createCmd3 = defineCommand22({
5216
+ var createCmd3 = defineCommand23({
4932
5217
  meta: { name: "create", description: "Mint a new web token (shown once)" },
4933
5218
  args: {
4934
5219
  label: { type: "positional", required: true, description: "Human-readable label" },
@@ -4959,7 +5244,7 @@ var createCmd3 = defineCommand22({
4959
5244
  qrcode.generate(pairUrl, { small: true }, (qr) => console.log(qr));
4960
5245
  }
4961
5246
  });
4962
- var listCmd10 = defineCommand22({
5247
+ var listCmd10 = defineCommand23({
4963
5248
  meta: { name: "list", description: "List web tokens" },
4964
5249
  args: {
4965
5250
  all: { type: "boolean", description: "Include revoked tokens" }
@@ -4975,7 +5260,7 @@ var listCmd10 = defineCommand22({
4975
5260
  for (const line of columnize(tokens.map(tokenRow))) console.log(line);
4976
5261
  }
4977
5262
  });
4978
- var showLocalCmd = defineCommand22({
5263
+ var showLocalCmd = defineCommand23({
4979
5264
  meta: {
4980
5265
  name: "show-local",
4981
5266
  description: "Print the bootstrap web token stored in ~/.bazilion/auth.json"
@@ -4985,7 +5270,7 @@ var showLocalCmd = defineCommand22({
4985
5270
  console.log(readAuthFile(paths.authFile).token);
4986
5271
  }
4987
5272
  });
4988
- var revokeCmd = defineCommand22({
5273
+ var revokeCmd = defineCommand23({
4989
5274
  meta: { name: "revoke", description: "Revoke a web token" },
4990
5275
  args: {
4991
5276
  id: { type: "positional", required: true }
@@ -4996,7 +5281,7 @@ var revokeCmd = defineCommand22({
4996
5281
  console.log(`revoked token ${args.id}`);
4997
5282
  }
4998
5283
  });
4999
- var tokenCommand = defineCommand22({
5284
+ var tokenCommand = defineCommand23({
5000
5285
  meta: { name: "token", description: "Manage web tokens for API/CLI clients" },
5001
5286
  subCommands: {
5002
5287
  create: createCmd3,
@@ -5007,8 +5292,8 @@ var tokenCommand = defineCommand22({
5007
5292
  });
5008
5293
 
5009
5294
  // src/commands/trigger.ts
5010
- import { defineCommand as defineCommand23 } from "citty";
5011
- var addCmd3 = defineCommand23({
5295
+ import { defineCommand as defineCommand24 } from "citty";
5296
+ var addCmd3 = defineCommand24({
5012
5297
  meta: { name: "add", description: "Add an interval / cron trigger to an agent" },
5013
5298
  args: {
5014
5299
  agent: { type: "positional", required: true },
@@ -5056,7 +5341,7 @@ function triggerRow(t) {
5056
5341
  const msgPreview = t.message.length > 60 ? `${t.message.slice(0, 60)}\u2026` : t.message;
5057
5342
  return [t.id, state, spec, `last: ${last}`, `"${msgPreview}"`];
5058
5343
  }
5059
- var listCmd11 = defineCommand23({
5344
+ var listCmd11 = defineCommand24({
5060
5345
  meta: { name: "list", description: "List triggers for an agent" },
5061
5346
  args: {
5062
5347
  agent: { type: "positional", required: true }
@@ -5073,7 +5358,7 @@ var listCmd11 = defineCommand23({
5073
5358
  for (const line of columnize(triggers.map(triggerRow))) console.log(line);
5074
5359
  }
5075
5360
  });
5076
- var rmCmd6 = defineCommand23({
5361
+ var rmCmd6 = defineCommand24({
5077
5362
  meta: { name: "rm", description: "Delete a trigger" },
5078
5363
  args: {
5079
5364
  id: { type: "positional", required: true }
@@ -5084,7 +5369,7 @@ var rmCmd6 = defineCommand23({
5084
5369
  console.log(`removed trigger ${args.id}`);
5085
5370
  }
5086
5371
  });
5087
- var enableCmd3 = defineCommand23({
5372
+ var enableCmd3 = defineCommand24({
5088
5373
  meta: { name: "enable", description: "Enable a trigger" },
5089
5374
  args: {
5090
5375
  id: { type: "positional", required: true }
@@ -5096,7 +5381,7 @@ var enableCmd3 = defineCommand23({
5096
5381
  console.log(`enabled trigger ${args.id}`);
5097
5382
  }
5098
5383
  });
5099
- var disableCmd3 = defineCommand23({
5384
+ var disableCmd3 = defineCommand24({
5100
5385
  meta: { name: "disable", description: "Disable a trigger" },
5101
5386
  args: {
5102
5387
  id: { type: "positional", required: true }
@@ -5108,7 +5393,7 @@ var disableCmd3 = defineCommand23({
5108
5393
  console.log(`disabled trigger ${args.id}`);
5109
5394
  }
5110
5395
  });
5111
- var historyCmd = defineCommand23({
5396
+ var historyCmd = defineCommand24({
5112
5397
  meta: { name: "history", description: "Show recent dispatches for a trigger" },
5113
5398
  args: {
5114
5399
  id: { type: "positional", required: true },
@@ -5136,7 +5421,7 @@ var historyCmd = defineCommand23({
5136
5421
  for (const line of columnize(rows)) console.log(line);
5137
5422
  }
5138
5423
  });
5139
- var triggerCommand = defineCommand23({
5424
+ var triggerCommand = defineCommand24({
5140
5425
  meta: { name: "trigger", description: "Manage scheduled agent triggers" },
5141
5426
  subCommands: {
5142
5427
  add: addCmd3,
@@ -5151,7 +5436,7 @@ var triggerCommand = defineCommand23({
5151
5436
  // src/commands/uninstall.ts
5152
5437
  import { existsSync as existsSync7, readdirSync as readdirSync2, rmSync as rmSync4 } from "fs";
5153
5438
  import { join as join6 } from "path";
5154
- import { defineCommand as defineCommand24 } from "citty";
5439
+ import { defineCommand as defineCommand25 } from "citty";
5155
5440
  function makeLineReader() {
5156
5441
  let buffer = "";
5157
5442
  let ended = false;
@@ -5199,7 +5484,7 @@ function removePath(p) {
5199
5484
  rmSync4(p, { recursive: true, force: true });
5200
5485
  return true;
5201
5486
  }
5202
- var uninstallCommand = defineCommand24({
5487
+ var uninstallCommand = defineCommand25({
5203
5488
  meta: {
5204
5489
  name: "uninstall",
5205
5490
  description: "Wipe bazilion state from ~/.bazilion (or BAZILION_HOME)"
@@ -5270,7 +5555,7 @@ var uninstallCommand = defineCommand24({
5270
5555
 
5271
5556
  // src/index.ts
5272
5557
  var VERSION = package_default.version;
5273
- var main = defineCommand25({
5558
+ var main = defineCommand26({
5274
5559
  meta: {
5275
5560
  name: "bazilion",
5276
5561
  version: VERSION,
@@ -5283,6 +5568,7 @@ var main = defineCommand25({
5283
5568
  "team-template": teamTemplateCommand,
5284
5569
  agent: agentCommand,
5285
5570
  approval: approvalCommand,
5571
+ attention: attentionCommand,
5286
5572
  skill: skillCommand,
5287
5573
  memory: memoryCommand,
5288
5574
  mcp: mcpCommand,
@@ -5378,6 +5664,7 @@ function printTopLevelHelp() {
5378
5664
  title: "agents",
5379
5665
  items: [
5380
5666
  ["approval", "Review and decide communication approval attempts"],
5667
+ ["attention", "See everything that needs operator attention"],
5381
5668
  ["agent", "Spawn, list, chat, archive agents"],
5382
5669
  ["memory", "Read/write a team's shared memory"],
5383
5670
  ["send", "Send a message from one agent to another"],