@cleocode/cleo 2026.4.24 → 2026.4.25

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/cli/index.js CHANGED
@@ -106707,6 +106707,40 @@ var init_release_engine = __esm({
106707
106707
  });
106708
106708
 
106709
106709
  // packages/cleo/src/dispatch/engines/system-engine.ts
106710
+ var system_engine_exports = {};
106711
+ __export(system_engine_exports, {
106712
+ backupRestore: () => backupRestore,
106713
+ systemArchiveStats: () => systemArchiveStats,
106714
+ systemAudit: () => systemAudit,
106715
+ systemBackup: () => systemBackup,
106716
+ systemCleanup: () => systemCleanup,
106717
+ systemCompliance: () => systemCompliance,
106718
+ systemContext: () => systemContext,
106719
+ systemDash: () => systemDash,
106720
+ systemDiagnostics: () => systemDiagnostics,
106721
+ systemDoctor: () => systemDoctor,
106722
+ systemFix: () => systemFix,
106723
+ systemHealth: () => systemHealth,
106724
+ systemHelp: () => systemHelp,
106725
+ systemInjectGenerate: () => systemInjectGenerate,
106726
+ systemLabels: () => systemLabels,
106727
+ systemListBackups: () => systemListBackups,
106728
+ systemLog: () => systemLog,
106729
+ systemMetrics: () => systemMetrics,
106730
+ systemMigrate: () => systemMigrate,
106731
+ systemPaths: () => systemPaths,
106732
+ systemRestore: () => systemRestore,
106733
+ systemRoadmap: () => systemRoadmap,
106734
+ systemRuntime: () => systemRuntime,
106735
+ systemSafestop: () => systemSafestop,
106736
+ systemScaffoldHub: () => systemScaffoldHub,
106737
+ systemSequence: () => systemSequence,
106738
+ systemSequenceRepair: () => systemSequenceRepair,
106739
+ systemSmoke: () => systemSmoke,
106740
+ systemStats: () => systemStats,
106741
+ systemSync: () => systemSync,
106742
+ systemUncancel: () => systemUncancel
106743
+ });
106710
106744
  import { existsSync as existsSync126, readdirSync as readdirSync40, readFileSync as readFileSync94 } from "node:fs";
106711
106745
  import { basename as basename18, join as join121 } from "node:path";
106712
106746
  async function systemDash(projectRoot, params) {
@@ -106812,6 +106846,15 @@ async function systemStats(projectRoot, params) {
106812
106846
  return cleoErrorToEngineError(err, "E_NOT_INITIALIZED", "Failed to get stats");
106813
106847
  }
106814
106848
  }
106849
+ async function systemLabels(projectRoot) {
106850
+ try {
106851
+ const accessor = await getAccessor(projectRoot);
106852
+ const result = await getLabels(projectRoot, accessor);
106853
+ return { success: true, data: result };
106854
+ } catch (err) {
106855
+ return cleoErrorToEngineError(err, "E_NOT_INITIALIZED", "Failed to get labels");
106856
+ }
106857
+ }
106815
106858
  async function systemArchiveStats(projectRoot, params) {
106816
106859
  try {
106817
106860
  const accessor = await getAccessor(projectRoot);
@@ -107076,6 +107119,15 @@ async function systemInjectGenerate(projectRoot) {
107076
107119
  return cleoErrorToEngineError(err, "E_GENERAL", "Failed to generate injection");
107077
107120
  }
107078
107121
  }
107122
+ async function systemMetrics(projectRoot, params) {
107123
+ try {
107124
+ const accessor = await getAccessor(projectRoot);
107125
+ const result = await getSystemMetrics(projectRoot, params, accessor);
107126
+ return { success: true, data: result };
107127
+ } catch (err) {
107128
+ return cleoErrorToEngineError(err, "E_GENERAL", "Failed to get metrics");
107129
+ }
107130
+ }
107079
107131
  async function systemHealth(projectRoot, params) {
107080
107132
  try {
107081
107133
  const result = await getSystemHealth(projectRoot, params);
@@ -107084,6 +107136,176 @@ async function systemHealth(projectRoot, params) {
107084
107136
  return cleoErrorToEngineError(err, "E_GENERAL", "Failed to get health");
107085
107137
  }
107086
107138
  }
107139
+ async function systemDiagnostics(projectRoot, params) {
107140
+ try {
107141
+ const result = await getSystemDiagnostics(projectRoot, params);
107142
+ return { success: true, data: result };
107143
+ } catch (err) {
107144
+ return cleoErrorToEngineError(err, "E_GENERAL", "Failed to get diagnostics");
107145
+ }
107146
+ }
107147
+ function systemHelp(_projectRoot, params) {
107148
+ const topic = params?.topic;
107149
+ if (topic) {
107150
+ const topicHelp = HELP_TOPICS[topic];
107151
+ if (topicHelp) {
107152
+ return { success: true, data: topicHelp };
107153
+ }
107154
+ return engineError(
107155
+ "E_NOT_FOUND",
107156
+ `Unknown help topic: ${topic}. Available topics: ${Object.keys(HELP_TOPICS).join(", ")}`
107157
+ );
107158
+ }
107159
+ return {
107160
+ success: true,
107161
+ data: {
107162
+ content: [
107163
+ "CLEO Task Management System",
107164
+ "",
107165
+ "Essential Commands:",
107166
+ ' cleofind "query" - Fuzzy search tasks',
107167
+ " cleoshow T1234 - Full task details",
107168
+ ' cleoadd "Task" - Create task',
107169
+ " cleodone <id> - Complete task",
107170
+ " cleostart <id> - Start working on task",
107171
+ " cleodash - Project overview",
107172
+ " cleosession list - List sessions",
107173
+ "",
107174
+ "Help Topics: session, tasks, focus, labels, compliance"
107175
+ ].join("\n"),
107176
+ relatedCommands: ["cleo find", "cleo show", "cleo add", "cleo done", "cleo dash"]
107177
+ }
107178
+ };
107179
+ }
107180
+ async function systemRoadmap(projectRoot, params) {
107181
+ try {
107182
+ const accessor = await getAccessor(projectRoot);
107183
+ const result = await getRoadmap(
107184
+ {
107185
+ includeHistory: params?.includeHistory,
107186
+ upcomingOnly: params?.upcomingOnly,
107187
+ cwd: projectRoot
107188
+ },
107189
+ accessor
107190
+ );
107191
+ return { success: true, data: result };
107192
+ } catch (err) {
107193
+ return cleoErrorToEngineError(err, "E_NOT_INITIALIZED", "System not initialized");
107194
+ }
107195
+ }
107196
+ function systemCompliance(projectRoot, params) {
107197
+ try {
107198
+ if (params?.subcommand === "trend") {
107199
+ const compliancePath2 = join121(projectRoot, ".cleo", "metrics", "COMPLIANCE.jsonl");
107200
+ let entries2 = [];
107201
+ if (existsSync126(compliancePath2)) {
107202
+ const content = readFileSync94(compliancePath2, "utf-8").trim();
107203
+ if (content) {
107204
+ entries2 = content.split("\n").filter((l) => l.trim()).map((l) => JSON.parse(l));
107205
+ }
107206
+ }
107207
+ if (params.epic) {
107208
+ entries2 = entries2.filter((e) => {
107209
+ const ctx = e._context ?? {};
107210
+ return ctx.epic_id === params.epic || ctx.task_id === params.epic;
107211
+ });
107212
+ }
107213
+ if (params.days) {
107214
+ const cutoff = new Date(Date.now() - params.days * 864e5).toISOString();
107215
+ entries2 = entries2.filter((e) => e.timestamp >= cutoff);
107216
+ }
107217
+ const totalEntries2 = entries2.length;
107218
+ const compliance2 = entries2.map((e) => e.compliance ?? {});
107219
+ const avgPassRate2 = totalEntries2 > 0 ? Math.round(
107220
+ compliance2.reduce((sum, c) => sum + (c.compliance_pass_rate ?? 0), 0) / totalEntries2 * 1e3
107221
+ ) / 1e3 : 0;
107222
+ const avgAdherence2 = totalEntries2 > 0 ? Math.round(
107223
+ compliance2.reduce((sum, c) => sum + (c.rule_adherence_score ?? 0), 0) / totalEntries2 * 1e3
107224
+ ) / 1e3 : 0;
107225
+ const totalViolations2 = compliance2.reduce(
107226
+ (sum, c) => sum + (c.violation_count ?? 0),
107227
+ 0
107228
+ );
107229
+ const byDate = {};
107230
+ for (const e of entries2) {
107231
+ const date6 = e.timestamp.split("T")[0];
107232
+ if (!byDate[date6]) byDate[date6] = [];
107233
+ byDate[date6].push(e);
107234
+ }
107235
+ const dataPoints = Object.entries(byDate).sort(([a], [b2]) => a.localeCompare(b2)).map(([date6, dayEntries]) => {
107236
+ const dayCompliance = dayEntries.map(
107237
+ (de2) => de2.compliance ?? {}
107238
+ );
107239
+ return {
107240
+ date: date6,
107241
+ entries: dayEntries.length,
107242
+ avgPassRate: dayCompliance.reduce((s3, c) => s3 + (c.compliance_pass_rate ?? 0), 0) / dayEntries.length,
107243
+ violations: dayCompliance.reduce((s3, c) => s3 + (c.violation_count ?? 0), 0)
107244
+ };
107245
+ });
107246
+ let trend;
107247
+ if (dataPoints.length >= 2) {
107248
+ const first = dataPoints[0].avgPassRate;
107249
+ const last = dataPoints[dataPoints.length - 1].avgPassRate;
107250
+ trend = last > first ? "improving" : last < first ? "declining" : "stable";
107251
+ } else {
107252
+ trend = "insufficient_data";
107253
+ }
107254
+ return {
107255
+ success: true,
107256
+ data: {
107257
+ totalEntries: totalEntries2,
107258
+ averagePassRate: avgPassRate2,
107259
+ averageAdherence: avgAdherence2,
107260
+ totalViolations: totalViolations2,
107261
+ trend,
107262
+ dataPoints
107263
+ }
107264
+ };
107265
+ }
107266
+ const compliancePath = join121(projectRoot, ".cleo", "metrics", "COMPLIANCE.jsonl");
107267
+ let entries = [];
107268
+ if (existsSync126(compliancePath)) {
107269
+ const content = readFileSync94(compliancePath, "utf-8").trim();
107270
+ if (content) {
107271
+ entries = content.split("\n").filter((l) => l.trim()).map((l) => JSON.parse(l));
107272
+ }
107273
+ }
107274
+ if (params?.epic) {
107275
+ entries = entries.filter((e) => {
107276
+ const ctx = e._context ?? {};
107277
+ return ctx.epic_id === params.epic || ctx.task_id === params.epic;
107278
+ });
107279
+ }
107280
+ if (params?.days) {
107281
+ const cutoff = new Date(Date.now() - params.days * 864e5).toISOString();
107282
+ entries = entries.filter((e) => e.timestamp >= cutoff);
107283
+ }
107284
+ const totalEntries = entries.length;
107285
+ const compliance = entries.map((e) => e.compliance ?? {});
107286
+ const avgPassRate = totalEntries > 0 ? Math.round(
107287
+ compliance.reduce((sum, c) => sum + (c.compliance_pass_rate ?? 0), 0) / totalEntries * 1e3
107288
+ ) / 1e3 : 0;
107289
+ const avgAdherence = totalEntries > 0 ? Math.round(
107290
+ compliance.reduce((sum, c) => sum + (c.rule_adherence_score ?? 0), 0) / totalEntries * 1e3
107291
+ ) / 1e3 : 0;
107292
+ const totalViolations = compliance.reduce(
107293
+ (sum, c) => sum + (c.violation_count ?? 0),
107294
+ 0
107295
+ );
107296
+ return {
107297
+ success: true,
107298
+ data: {
107299
+ totalEntries,
107300
+ averagePassRate: avgPassRate,
107301
+ averageAdherence: avgAdherence,
107302
+ totalViolations
107303
+ }
107304
+ };
107305
+ } catch (err) {
107306
+ return cleoErrorToEngineError(err, "E_GENERAL", "Failed to get roadmap");
107307
+ }
107308
+ }
107087
107309
  async function systemBackup(projectRoot, params) {
107088
107310
  try {
107089
107311
  const result = await createBackup2(projectRoot, params);
@@ -107171,6 +107393,25 @@ async function systemCleanup(projectRoot, params) {
107171
107393
  return cleoErrorToEngineError(err, "E_CLEANUP_FAILED", "Failed to cleanup");
107172
107394
  }
107173
107395
  }
107396
+ async function systemAudit(projectRoot, params) {
107397
+ try {
107398
+ const result = await auditData(projectRoot, params);
107399
+ return { success: true, data: result };
107400
+ } catch (err) {
107401
+ return cleoErrorToEngineError(err, "E_GENERAL", "Failed to audit");
107402
+ }
107403
+ }
107404
+ function systemSync(_projectRoot, params) {
107405
+ return {
107406
+ success: true,
107407
+ data: {
107408
+ direction: params?.direction ?? "up",
107409
+ synced: 0,
107410
+ conflicts: 0,
107411
+ message: "Sync is a no-op in native mode (no external sync targets configured)"
107412
+ }
107413
+ };
107414
+ }
107174
107415
  function systemSafestop(projectRoot, params) {
107175
107416
  try {
107176
107417
  const result = safestop(projectRoot, params);
@@ -107179,6 +107420,14 @@ function systemSafestop(projectRoot, params) {
107179
107420
  return cleoErrorToEngineError(err, "E_GENERAL", "Sync failed");
107180
107421
  }
107181
107422
  }
107423
+ async function systemUncancel(projectRoot, params) {
107424
+ try {
107425
+ const result = await uncancelTask(projectRoot, params);
107426
+ return { success: true, data: result };
107427
+ } catch (err) {
107428
+ return cleoErrorToEngineError(err, "E_UNCANCEL_FAILED", "Failed to uncancel");
107429
+ }
107430
+ }
107182
107431
  async function systemDoctor(projectRoot) {
107183
107432
  const { coreDoctorReport: coreDoctorReport2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
107184
107433
  try {
@@ -107248,6 +107497,23 @@ async function systemScaffoldHub() {
107248
107497
  return cleoErrorToEngineError(err, "E_SCAFFOLD_HUB_FAILED", "Failed to scaffold hub");
107249
107498
  }
107250
107499
  }
107500
+ async function systemSequenceRepair(projectRoot) {
107501
+ try {
107502
+ const repair = await repairSequence(projectRoot);
107503
+ return {
107504
+ success: true,
107505
+ data: {
107506
+ repaired: repair.repaired,
107507
+ message: repair.message,
107508
+ counter: repair.counter,
107509
+ oldCounter: repair.oldCounter,
107510
+ newCounter: repair.newCounter
107511
+ }
107512
+ };
107513
+ } catch (err) {
107514
+ return cleoErrorToEngineError(err, "E_SEQUENCE_REPAIR_FAILED", "Failed to repair sequence");
107515
+ }
107516
+ }
107251
107517
  async function systemSmoke() {
107252
107518
  const { dispatchRaw: dispatchRaw2 } = await Promise.resolve().then(() => (init_cli(), cli_exports));
107253
107519
  const totalStart = Date.now();
@@ -116791,6 +117057,75 @@ function resolveFormat2(opts, defaults) {
116791
117057
  return resolveOutputFormat(input);
116792
117058
  }
116793
117059
 
117060
+ // packages/cleo/src/cli/commands/adapter.ts
117061
+ init_cli();
117062
+ function registerAdapterCommand(program) {
117063
+ const adapterCmd = program.command("adapter").description("Provider adapter management: list, show, detect, health, activate, dispose");
117064
+ adapterCmd.command("list").description("List all discovered provider adapters").action(async () => {
117065
+ await dispatchFromCli(
117066
+ "query",
117067
+ "tools",
117068
+ "adapter.list",
117069
+ {},
117070
+ { command: "adapter", operation: "tools.adapter.list" }
117071
+ );
117072
+ });
117073
+ adapterCmd.command("show <adapter-id>").description("Show details for a specific adapter").action(async (adapterId) => {
117074
+ await dispatchFromCli(
117075
+ "query",
117076
+ "tools",
117077
+ "adapter.show",
117078
+ { id: adapterId },
117079
+ { command: "adapter", operation: "tools.adapter.show" }
117080
+ );
117081
+ });
117082
+ adapterCmd.command("detect").description("Detect active providers in the current environment").action(async () => {
117083
+ await dispatchFromCli(
117084
+ "query",
117085
+ "tools",
117086
+ "adapter.detect",
117087
+ {},
117088
+ { command: "adapter", operation: "tools.adapter.detect" }
117089
+ );
117090
+ });
117091
+ adapterCmd.command("health").description("Show health status for adapters").option("--id <adapter-id>", "Specific adapter ID (omit for all adapters)").action(async (opts) => {
117092
+ await dispatchFromCli(
117093
+ "query",
117094
+ "tools",
117095
+ "adapter.health",
117096
+ { id: opts["id"] },
117097
+ { command: "adapter", operation: "tools.adapter.health" }
117098
+ );
117099
+ });
117100
+ adapterCmd.command("activate <adapter-id>").description("Load and activate a provider adapter").action(async (adapterId) => {
117101
+ await dispatchFromCli(
117102
+ "mutate",
117103
+ "tools",
117104
+ "adapter.activate",
117105
+ { id: adapterId },
117106
+ { command: "adapter", operation: "tools.adapter.activate" }
117107
+ );
117108
+ });
117109
+ adapterCmd.command("dispose").description("Dispose one or all adapters").option("--id <adapter-id>", "Specific adapter ID to dispose (omit to dispose all)").action(async (opts) => {
117110
+ await dispatchFromCli(
117111
+ "mutate",
117112
+ "tools",
117113
+ "adapter.dispose",
117114
+ { id: opts["id"] },
117115
+ { command: "adapter", operation: "tools.adapter.dispose" }
117116
+ );
117117
+ });
117118
+ adapterCmd.action(async () => {
117119
+ await dispatchFromCli(
117120
+ "query",
117121
+ "tools",
117122
+ "adapter.list",
117123
+ {},
117124
+ { command: "adapter", operation: "tools.adapter.list" }
117125
+ );
117126
+ });
117127
+ }
117128
+
116794
117129
  // packages/cleo/src/cli/commands/add.ts
116795
117130
  init_cli();
116796
117131
 
@@ -117226,6 +117561,76 @@ function registerAdminCommand(program) {
117226
117561
  ).action(async () => {
117227
117562
  await dispatchFromCli("mutate", "admin", "scaffold-hub", {}, { command: "admin" });
117228
117563
  });
117564
+ admin.command("cleanup").description("Purge stale CLEO data (backups, logs, archive entries)").requiredOption("--target <target>", "What to clean: backups | logs | archive | sessions").option("--older-than <age>", "Remove entries older than this duration (e.g. 30d, 6m, 1y)").option("--dry-run", "Preview what would be removed without making changes").action(async (opts) => {
117565
+ await dispatchFromCli(
117566
+ "mutate",
117567
+ "admin",
117568
+ "cleanup",
117569
+ {
117570
+ target: opts["target"],
117571
+ olderThan: opts["olderThan"],
117572
+ dryRun: opts["dryRun"] === true
117573
+ },
117574
+ { command: "admin cleanup", operation: "admin.cleanup" }
117575
+ );
117576
+ });
117577
+ const job = admin.command("job").description("Inspect background jobs managed by the job manager");
117578
+ job.command("list", { isDefault: true }).description("List all background jobs (default)").option("--status <status>", "Filter by job status (pending, running, done, failed, cancelled)").option("--limit <n>", "Maximum jobs to return", "20").option("--offset <n>", "Skip N jobs", "0").action(async (opts) => {
117579
+ await dispatchFromCli(
117580
+ "query",
117581
+ "admin",
117582
+ "job",
117583
+ {
117584
+ action: "list",
117585
+ status: opts["status"],
117586
+ limit: opts["limit"] ? Number(opts["limit"]) : 20,
117587
+ offset: opts["offset"] ? Number(opts["offset"]) : 0
117588
+ },
117589
+ { command: "admin job list", operation: "admin.job" }
117590
+ );
117591
+ });
117592
+ job.command("status <jobId>").description("Show status of a specific background job").action(async (jobId) => {
117593
+ await dispatchFromCli(
117594
+ "query",
117595
+ "admin",
117596
+ "job",
117597
+ { action: "status", jobId },
117598
+ { command: "admin job status", operation: "admin.job" }
117599
+ );
117600
+ });
117601
+ job.command("cancel <jobId>").description("Cancel a running background job").action(async (jobId) => {
117602
+ await dispatchFromCli(
117603
+ "mutate",
117604
+ "admin",
117605
+ "job.cancel",
117606
+ { jobId },
117607
+ { command: "admin job cancel", operation: "admin.job.cancel" }
117608
+ );
117609
+ });
117610
+ admin.command("install-global").description("Refresh global CLEO setup (provider files, configs, ~/.agents/AGENTS.md)").action(async () => {
117611
+ await dispatchFromCli(
117612
+ "mutate",
117613
+ "admin",
117614
+ "install.global",
117615
+ {},
117616
+ { command: "admin install-global", operation: "admin.install.global" }
117617
+ );
117618
+ });
117619
+ admin.command("context-inject <protocolType>").description(
117620
+ "Inject protocol content into session context (e.g. cleo-base, ct-orchestrator, ct-cleo)"
117621
+ ).option("--task <id>", "Scope injection to a specific task ID").option("--variant <variant>", "Select a named protocol variant").action(async (protocolType, opts) => {
117622
+ await dispatchFromCli(
117623
+ "mutate",
117624
+ "admin",
117625
+ "context.inject",
117626
+ {
117627
+ protocolType,
117628
+ taskId: opts["task"],
117629
+ variant: opts["variant"]
117630
+ },
117631
+ { command: "admin context-inject", operation: "admin.context.inject" }
117632
+ );
117633
+ });
117229
117634
  }
117230
117635
 
117231
117636
  // packages/cleo/src/cli/commands/adr.ts
@@ -120247,6 +120652,23 @@ function registerBugCommand(program) {
120247
120652
  });
120248
120653
  }
120249
120654
 
120655
+ // packages/cleo/src/cli/commands/cancel.ts
120656
+ init_cli();
120657
+ function registerCancelCommand(program) {
120658
+ program.command("cancel <taskId>").description("Cancel a task (soft terminal state; reversible via restore)").option("--reason <reason>", "Reason for cancellation").action(async (taskId, opts) => {
120659
+ await dispatchFromCli(
120660
+ "mutate",
120661
+ "tasks",
120662
+ "cancel",
120663
+ {
120664
+ taskId,
120665
+ reason: opts["reason"]
120666
+ },
120667
+ { command: "cancel", operation: "tasks.cancel" }
120668
+ );
120669
+ });
120670
+ }
120671
+
120250
120672
  // packages/cleo/src/cli/commands/cant.ts
120251
120673
  init_renderers();
120252
120674
  import { existsSync as existsSync128, mkdirSync as mkdirSync29, readFileSync as readFileSync97, writeFileSync as writeFileSync23 } from "node:fs";
@@ -120445,6 +120867,36 @@ function registerCheckCommand(program) {
120445
120867
  check2.command("task <taskId>").description("Validate a specific task").action(async (taskId) => {
120446
120868
  await dispatchFromCli("query", "check", "task", { taskId }, { command: "check" });
120447
120869
  });
120870
+ check2.command("output <filePath>").description("Validate an agent output file against the manifest schema").option("--task-id <id>", "Task ID the output file belongs to").action(async (filePath, opts) => {
120871
+ await dispatchFromCli(
120872
+ "query",
120873
+ "check",
120874
+ "output",
120875
+ {
120876
+ filePath,
120877
+ taskId: opts["taskId"]
120878
+ },
120879
+ { command: "check", operation: "check.output" }
120880
+ );
120881
+ });
120882
+ check2.command("chain-validate <file>").description("Validate a WarpChain definition from a JSON file").action(async (file2) => {
120883
+ const { readFileSync: readFileSync102 } = await import("node:fs");
120884
+ let chain;
120885
+ try {
120886
+ chain = JSON.parse(readFileSync102(file2, "utf8"));
120887
+ } catch (err) {
120888
+ const message = err instanceof Error ? err.message : String(err);
120889
+ console.error(`Failed to read or parse chain file: ${message}`);
120890
+ process.exit(2);
120891
+ }
120892
+ await dispatchFromCli(
120893
+ "query",
120894
+ "check",
120895
+ "chain.validate",
120896
+ { chain },
120897
+ { command: "check", operation: "check.chain.validate" }
120898
+ );
120899
+ });
120448
120900
  check2.command("protocol <protocolType>").description(
120449
120901
  `Validate any of the 12 RCASD-IVTR+C protocols: ${SUPPORTED_PROTOCOL_TYPES.join(", ")}`
120450
120902
  ).option("--task-id <id>", "Task ID to validate (mode=task, default)").option("--manifest-file <file>", "Manifest file to validate (mode=manifest)").option("--strict", "Exit with error code on violations").option("--voting-matrix-file <file>", "consensus: voting matrix JSON file").option("--epic-id <id>", "decomposition: parent epic ID").option("--sibling-count <n>", "decomposition: actual sibling count", Number).option("--max-siblings <n>", "decomposition: configured max siblings", Number).option("--spec-file <file>", "specification: path to spec markdown").option("--has-code-changes", "research: code changes detected (forbidden)").option("--has-task-tags", "implementation: @task tags present in code").option("--has-contribution-tags", "contribution: @contribution tags present").option("--version <v>", "release: target version (semver/calver)").option("--has-changelog", "release: changelog updated").option(
@@ -120596,6 +121048,34 @@ function registerCheckpointCommand(program) {
120596
121048
  });
120597
121049
  }
120598
121050
 
121051
+ // packages/cleo/src/cli/commands/claim.ts
121052
+ init_cli();
121053
+ function registerClaimCommand(program) {
121054
+ program.command("claim <taskId>").description("Claim a task by assigning it to an agent").option("--agent <agentId>", "Agent ID to assign the task to (required)").action(async (taskId, opts) => {
121055
+ await dispatchFromCli(
121056
+ "mutate",
121057
+ "tasks",
121058
+ "claim",
121059
+ {
121060
+ taskId,
121061
+ agentId: opts["agent"]
121062
+ },
121063
+ { command: "claim", operation: "tasks.claim" }
121064
+ );
121065
+ });
121066
+ }
121067
+ function registerUnclaimCommand(program) {
121068
+ program.command("unclaim <taskId>").description("Unclaim a task by removing its current assignee").action(async (taskId) => {
121069
+ await dispatchFromCli(
121070
+ "mutate",
121071
+ "tasks",
121072
+ "unclaim",
121073
+ { taskId },
121074
+ { command: "unclaim", operation: "tasks.unclaim" }
121075
+ );
121076
+ });
121077
+ }
121078
+
120599
121079
  // packages/cleo/src/cli/commands/commands.ts
120600
121080
  init_cli();
120601
121081
  function registerCommandsCommand(program) {
@@ -120687,6 +121167,21 @@ function registerCompleteCommand(program) {
120687
121167
  });
120688
121168
  }
120689
121169
 
121170
+ // packages/cleo/src/cli/commands/complexity.ts
121171
+ init_cli();
121172
+ function registerComplexityCommand(program) {
121173
+ const complexity = program.command("complexity").description("Task complexity analysis");
121174
+ complexity.command("estimate <taskId>").description("Estimate complexity of a task (small / medium / large)").action(async (taskId) => {
121175
+ await dispatchFromCli(
121176
+ "query",
121177
+ "tasks",
121178
+ "complexity.estimate",
121179
+ { taskId },
121180
+ { command: "complexity", operation: "tasks.complexity.estimate" }
121181
+ );
121182
+ });
121183
+ }
121184
+
120690
121185
  // packages/cleo/src/cli/commands/compliance.ts
120691
121186
  init_cli();
120692
121187
  function registerComplianceCommand(program) {
@@ -120777,6 +121272,34 @@ function registerComplianceCommand(program) {
120777
121272
  { command: "compliance" }
120778
121273
  );
120779
121274
  });
121275
+ compliance.command("record <taskId> <result>").description("Record a compliance check result for a task (pass|fail|warning)").option("--protocol <name>", "Protocol name the check applies to (e.g. implementation)").option(
121276
+ "--violation <spec>",
121277
+ 'Add a violation as "code:severity:message" (repeatable)',
121278
+ (val, prev) => [...prev, val],
121279
+ []
121280
+ ).action(async (taskId, result, opts) => {
121281
+ const rawViolations = opts["violation"];
121282
+ const violations = rawViolations.map((v2) => {
121283
+ const [code, severity, ...rest] = v2.split(":");
121284
+ return {
121285
+ code: code ?? "",
121286
+ severity: severity === "error" || severity === "warning" ? severity : "error",
121287
+ message: rest.join(":")
121288
+ };
121289
+ }).filter((v2) => v2.code);
121290
+ await dispatchFromCli(
121291
+ "mutate",
121292
+ "check",
121293
+ "compliance.record",
121294
+ {
121295
+ taskId,
121296
+ result,
121297
+ protocol: opts["protocol"],
121298
+ violations: violations.length > 0 ? violations : void 0
121299
+ },
121300
+ { command: "compliance", operation: "check.compliance.record" }
121301
+ );
121302
+ });
120780
121303
  }
120781
121304
 
120782
121305
  // packages/cleo/src/cli/commands/config.ts
@@ -121102,19 +121625,15 @@ function registerTreeCommand(program) {
121102
121625
  }
121103
121626
 
121104
121627
  // packages/cleo/src/cli/commands/detect.ts
121105
- init_internal();
121106
- init_renderers();
121628
+ init_cli();
121107
121629
  function registerDetectCommand(program) {
121108
121630
  program.command("detect").description("Re-detect project type and update project-context.json").action(async () => {
121109
- const projectRoot = getProjectRoot();
121110
- const result = await ensureProjectContext(projectRoot, { staleDays: 0 });
121111
- cliOutput(
121112
- {
121113
- action: result.action,
121114
- path: result.path,
121115
- details: result.details
121116
- },
121117
- { command: "detect" }
121631
+ await dispatchFromCli(
121632
+ "mutate",
121633
+ "admin",
121634
+ "detect",
121635
+ {},
121636
+ { command: "detect", operation: "admin.detect" }
121118
121637
  );
121119
121638
  });
121120
121639
  }
@@ -122658,6 +123177,56 @@ function registerLifecycleCommand(program) {
122658
123177
  { command: "lifecycle" }
122659
123178
  );
122660
123179
  });
123180
+ lifecycle.command("history <taskId>").description("Show full lifecycle stage history for a task or epic").action(async (taskId) => {
123181
+ await dispatchFromCli(
123182
+ "query",
123183
+ "pipeline",
123184
+ "stage.history",
123185
+ { taskId },
123186
+ { command: "lifecycle" }
123187
+ );
123188
+ });
123189
+ lifecycle.command("reset <epicId> <stage>").description("Reset a lifecycle stage back to pending").requiredOption("--reason <reason>", "Reason for resetting the stage").action(async (epicId, stage, opts) => {
123190
+ await dispatchFromCli(
123191
+ "mutate",
123192
+ "pipeline",
123193
+ "stage.reset",
123194
+ {
123195
+ taskId: epicId,
123196
+ stage,
123197
+ reason: opts["reason"]
123198
+ },
123199
+ { command: "lifecycle" }
123200
+ );
123201
+ });
123202
+ const gate = lifecycle.command("gate-record").description("Record a gate pass or fail for a lifecycle stage");
123203
+ gate.command("pass <epicId> <gateName>").description("Record a gate as passed for a lifecycle stage").option("--agent <agent>", "Agent that performed the gate check").option("--notes <notes>", "Notes on gate outcome").action(async (epicId, gateName, opts) => {
123204
+ await dispatchFromCli(
123205
+ "mutate",
123206
+ "pipeline",
123207
+ "stage.gate.pass",
123208
+ {
123209
+ taskId: epicId,
123210
+ gateName,
123211
+ agent: opts["agent"],
123212
+ notes: opts["notes"]
123213
+ },
123214
+ { command: "lifecycle" }
123215
+ );
123216
+ });
123217
+ gate.command("fail <epicId> <gateName>").description("Record a gate as failed for a lifecycle stage").option("--reason <reason>", "Reason the gate failed").action(async (epicId, gateName, opts) => {
123218
+ await dispatchFromCli(
123219
+ "mutate",
123220
+ "pipeline",
123221
+ "stage.gate.fail",
123222
+ {
123223
+ taskId: epicId,
123224
+ gateName,
123225
+ reason: opts["reason"]
123226
+ },
123227
+ { command: "lifecycle" }
123228
+ );
123229
+ });
122661
123230
  }
122662
123231
 
122663
123232
  // packages/cleo/src/cli/commands/list.ts
@@ -122946,15 +123515,149 @@ function registerMemoryBrainCommand(program) {
122946
123515
  { command: "memory", operation: "memory.fetch" }
122947
123516
  );
122948
123517
  });
123518
+ memory.command("decision find [query]").description("Search decisions stored in brain.db").option("--limit <n>", "Maximum results", parseInt).option("--json", "Output as JSON").action(async (query, opts) => {
123519
+ await dispatchFromCli(
123520
+ "query",
123521
+ "memory",
123522
+ "decision.find",
123523
+ {
123524
+ query: query ?? "",
123525
+ limit: opts["limit"]
123526
+ },
123527
+ { command: "memory", operation: "memory.decision.find" }
123528
+ );
123529
+ });
123530
+ memory.command("decision store").description("Store a decision to brain.db").requiredOption("--decision <text>", "The decision that was made").requiredOption("--rationale <text>", "Rationale behind the decision").option("--alternatives <text>", "Alternatives that were considered").option("--linked-task <id>", "Task ID to associate with this decision").option("--json", "Output as JSON").action(async (opts) => {
123531
+ await dispatchFromCli(
123532
+ "mutate",
123533
+ "memory",
123534
+ "decision.store",
123535
+ {
123536
+ decision: opts["decision"],
123537
+ rationale: opts["rationale"],
123538
+ ...opts["alternatives"] !== void 0 && { alternatives: opts["alternatives"] },
123539
+ ...opts["linkedTask"] !== void 0 && { taskId: opts["linkedTask"] }
123540
+ },
123541
+ { command: "memory", operation: "memory.decision.store" }
123542
+ );
123543
+ });
123544
+ memory.command("link <taskId> <entryId>").description("Link a brain entry to a task").option("--json", "Output as JSON").action(async (taskId, entryId, _opts) => {
123545
+ await dispatchFromCli(
123546
+ "mutate",
123547
+ "memory",
123548
+ "link",
123549
+ { taskId, entryId },
123550
+ { command: "memory", operation: "memory.link" }
123551
+ );
123552
+ });
123553
+ memory.command("graph show <nodeId>").description("Get a PageIndex graph node and its edges").option("--json", "Output as JSON").action(async (nodeId, _opts) => {
123554
+ await dispatchFromCli(
123555
+ "query",
123556
+ "memory",
123557
+ "graph.show",
123558
+ { nodeId },
123559
+ { command: "memory", operation: "memory.graph.show" }
123560
+ );
123561
+ });
123562
+ memory.command("graph neighbors <nodeId>").description("Get neighbor nodes from the PageIndex graph").option("--depth <n>", "Traversal depth", parseInt).option("--limit <n>", "Maximum neighbors", parseInt).option("--json", "Output as JSON").action(async (nodeId, opts) => {
123563
+ await dispatchFromCli(
123564
+ "query",
123565
+ "memory",
123566
+ "graph.neighbors",
123567
+ {
123568
+ nodeId,
123569
+ ...opts["depth"] !== void 0 && { depth: opts["depth"] },
123570
+ ...opts["limit"] !== void 0 && { limit: opts["limit"] }
123571
+ },
123572
+ { command: "memory", operation: "memory.graph.neighbors" }
123573
+ );
123574
+ });
123575
+ memory.command("graph add").description("Add a node or edge to the PageIndex graph").option("--node-id <id>", "Node ID to add").option("--label <text>", "Label for the node").option("--from <id>", "Source node ID for an edge").option("--to <id>", "Target node ID for an edge").option("--edge-type <type>", "Edge relationship type").option("--json", "Output as JSON").action(async (opts) => {
123576
+ await dispatchFromCli(
123577
+ "mutate",
123578
+ "memory",
123579
+ "graph.add",
123580
+ {
123581
+ ...opts["nodeId"] !== void 0 && { nodeId: opts["nodeId"] },
123582
+ ...opts["label"] !== void 0 && { label: opts["label"] },
123583
+ ...opts["from"] !== void 0 && { from: opts["from"] },
123584
+ ...opts["to"] !== void 0 && { to: opts["to"] },
123585
+ ...opts["edgeType"] !== void 0 && { edgeType: opts["edgeType"] }
123586
+ },
123587
+ { command: "memory", operation: "memory.graph.add" }
123588
+ );
123589
+ });
123590
+ memory.command("graph remove").description("Remove a node or edge from the PageIndex graph").option("--node-id <id>", "Node ID to remove").option("--from <id>", "Source node ID of the edge to remove").option("--to <id>", "Target node ID of the edge to remove").option("--json", "Output as JSON").action(async (opts) => {
123591
+ await dispatchFromCli(
123592
+ "mutate",
123593
+ "memory",
123594
+ "graph.remove",
123595
+ {
123596
+ ...opts["nodeId"] !== void 0 && { nodeId: opts["nodeId"] },
123597
+ ...opts["from"] !== void 0 && { from: opts["from"] },
123598
+ ...opts["to"] !== void 0 && { to: opts["to"] }
123599
+ },
123600
+ { command: "memory", operation: "memory.graph.remove" }
123601
+ );
123602
+ });
123603
+ memory.command("reason why <taskId>").description("Causal trace through task dependency chains").option("--depth <n>", "Maximum trace depth", parseInt).option("--json", "Output as JSON").action(async (taskId, opts) => {
123604
+ await dispatchFromCli(
123605
+ "query",
123606
+ "memory",
123607
+ "reason.why",
123608
+ {
123609
+ taskId,
123610
+ ...opts["depth"] !== void 0 && { depth: opts["depth"] }
123611
+ },
123612
+ { command: "memory", operation: "memory.reason.why" }
123613
+ );
123614
+ });
123615
+ memory.command("reason similar <entryId>").description("Find semantically similar brain entries").option("--limit <n>", "Maximum results", parseInt).option("--json", "Output as JSON").action(async (entryId, opts) => {
123616
+ await dispatchFromCli(
123617
+ "query",
123618
+ "memory",
123619
+ "reason.similar",
123620
+ {
123621
+ entryId,
123622
+ ...opts["limit"] !== void 0 && { limit: opts["limit"] }
123623
+ },
123624
+ { command: "memory", operation: "memory.reason.similar" }
123625
+ );
123626
+ });
123627
+ memory.command("search hybrid <query>").description("Hybrid search across FTS5, vector, and graph indexes").option("--limit <n>", "Maximum results", parseInt).option("--json", "Output as JSON").action(async (query, opts) => {
123628
+ await dispatchFromCli(
123629
+ "query",
123630
+ "memory",
123631
+ "search.hybrid",
123632
+ {
123633
+ query,
123634
+ ...opts["limit"] !== void 0 && { limit: opts["limit"] }
123635
+ },
123636
+ { command: "memory", operation: "memory.search.hybrid" }
123637
+ );
123638
+ });
122949
123639
  }
122950
123640
 
122951
123641
  // packages/cleo/src/cli/commands/migrate-claude-mem.ts
122952
123642
  init_internal();
123643
+ init_cli();
122953
123644
  function registerMigrateClaudeMemCommand(program) {
122954
123645
  let migrateCmd = program.commands.find((c) => c.name() === "migrate");
122955
123646
  if (!migrateCmd) {
122956
123647
  migrateCmd = program.command("migrate").description("Data migration utilities");
122957
123648
  }
123649
+ migrateCmd.command("storage").description("Run CLEO internal storage and schema migrations").option("--target <version>", "Target schema version to migrate to").option("--dry-run", "Preview migration steps without making changes").action(async (opts) => {
123650
+ await dispatchFromCli(
123651
+ "mutate",
123652
+ "admin",
123653
+ "migrate",
123654
+ {
123655
+ target: opts["target"],
123656
+ dryRun: opts["dryRun"] === true
123657
+ },
123658
+ { command: "migrate storage", operation: "admin.migrate" }
123659
+ );
123660
+ });
122958
123661
  migrateCmd.command("claude-mem").description("Import observations from claude-mem into brain.db").option("--dry-run", "Show what would be imported without making changes").option("--source <path>", "Path to claude-mem.db (default: ~/.claude-mem/claude-mem.db)").option("--project <name>", "Project tag for imported entries").option("--batch-size <n>", "Rows per transaction batch (default: 100)", parseInt).action(async (opts) => {
122959
123662
  const root = getProjectRoot();
122960
123663
  try {
@@ -123032,13 +123735,24 @@ function registerNexusCommand(program) {
123032
123735
  nexus.command("status").description("Show NEXUS registry status").action(async () => {
123033
123736
  await dispatchFromCli("query", "nexus", "status", {}, { command: "nexus" });
123034
123737
  });
123035
- nexus.command("show <taskId>").alias("query").description("Show a task across projects (project:T### or T###)").action(async (taskId) => {
123738
+ nexus.command("show <name>").description("Show details for a registered project by name").action(async (name2) => {
123739
+ await dispatchFromCli(
123740
+ "query",
123741
+ "nexus",
123742
+ "show",
123743
+ {
123744
+ name: name2
123745
+ },
123746
+ { command: "nexus" }
123747
+ );
123748
+ });
123749
+ nexus.command("resolve <taskRef>").alias("query").description("Resolve a task reference across projects (project:T### or T###)").action(async (taskRef) => {
123036
123750
  await dispatchFromCli(
123037
123751
  "query",
123038
123752
  "nexus",
123039
123753
  "resolve",
123040
123754
  {
123041
- query: taskId
123755
+ query: taskRef
123042
123756
  },
123043
123757
  { command: "nexus" }
123044
123758
  );
@@ -123126,6 +123840,80 @@ function registerNexusCommand(program) {
123126
123840
  { command: "nexus" }
123127
123841
  );
123128
123842
  });
123843
+ nexus.command("graph").description("Show full dependency graph across all registered projects").action(async () => {
123844
+ await dispatchFromCli("query", "nexus", "graph", {}, { command: "nexus" });
123845
+ });
123846
+ nexus.command("share-status").description("Show multi-contributor sharing status for the current project").action(async () => {
123847
+ await dispatchFromCli("query", "nexus", "share.status", {}, { command: "nexus" });
123848
+ });
123849
+ nexus.command("transfer-preview <taskIds...>").description("Preview a task transfer between projects (dry-run, no changes made)").requiredOption("--from <project>", "Source project name").requiredOption("--to <project>", "Target project name").option("--mode <mode>", "Transfer mode: copy|move", "copy").option("--scope <scope>", "Transfer scope: single|subtree", "subtree").action(async (taskIds, opts) => {
123850
+ await dispatchFromCli(
123851
+ "query",
123852
+ "nexus",
123853
+ "transfer.preview",
123854
+ {
123855
+ taskIds,
123856
+ sourceProject: opts["from"],
123857
+ targetProject: opts["to"],
123858
+ mode: opts["mode"],
123859
+ scope: opts["scope"]
123860
+ },
123861
+ { command: "nexus" }
123862
+ );
123863
+ });
123864
+ nexus.command("transfer <taskIds...>").description("Transfer tasks from one project to another").requiredOption("--from <project>", "Source project name").requiredOption("--to <project>", "Target project name").option("--mode <mode>", "Transfer mode: copy|move", "copy").option("--scope <scope>", "Transfer scope: single|subtree", "subtree").option("--on-conflict <strategy>", "Conflict strategy: rename|skip|duplicate|fail", "rename").option("--transfer-brain", "Also transfer associated brain memory entries", false).action(async (taskIds, opts) => {
123865
+ await dispatchFromCli(
123866
+ "mutate",
123867
+ "nexus",
123868
+ "transfer",
123869
+ {
123870
+ taskIds,
123871
+ sourceProject: opts["from"],
123872
+ targetProject: opts["to"],
123873
+ mode: opts["mode"],
123874
+ scope: opts["scope"],
123875
+ onConflict: opts["onConflict"],
123876
+ transferBrain: opts["transferBrain"]
123877
+ },
123878
+ { command: "nexus" }
123879
+ );
123880
+ });
123881
+ const permission = nexus.command("permission").description("Manage permissions for registered projects");
123882
+ permission.command("set <name> <level>").description("Set permission level for a registered project (read|write|execute)").action(async (name2, level) => {
123883
+ await dispatchFromCli(
123884
+ "mutate",
123885
+ "nexus",
123886
+ "permission.set",
123887
+ {
123888
+ name: name2,
123889
+ level
123890
+ },
123891
+ { command: "nexus" }
123892
+ );
123893
+ });
123894
+ const share = nexus.command("share").description("Multi-contributor sharing operations");
123895
+ share.command("export").description("Export a snapshot of current project state for sharing").option("--output <path>", "Output file path (default: auto-generated in current directory)").action(async (opts) => {
123896
+ await dispatchFromCli(
123897
+ "mutate",
123898
+ "nexus",
123899
+ "share.snapshot.export",
123900
+ {
123901
+ outputPath: opts["output"]
123902
+ },
123903
+ { command: "nexus" }
123904
+ );
123905
+ });
123906
+ share.command("import <file>").description("Import a shared project snapshot").action(async (file2) => {
123907
+ await dispatchFromCli(
123908
+ "mutate",
123909
+ "nexus",
123910
+ "share.snapshot.import",
123911
+ {
123912
+ inputPath: file2
123913
+ },
123914
+ { command: "nexus" }
123915
+ );
123916
+ });
123129
123917
  }
123130
123918
 
123131
123919
  // packages/cleo/src/cli/commands/observe.ts
@@ -123172,12 +123960,23 @@ function registerOrchestrateCommand(program) {
123172
123960
  { command: "orchestrate" }
123173
123961
  );
123174
123962
  });
123175
- orch.command("analyze <epicId>").description("Analyze epic dependency structure").action(async (epicId) => {
123963
+ orch.command("status").description("Get orchestration status for an epic or overall project").option("--epic <epicId>", "Epic ID to scope status to").action(async (opts) => {
123964
+ await dispatchFromCli(
123965
+ "query",
123966
+ "orchestrate",
123967
+ "status",
123968
+ { epicId: opts["epic"] },
123969
+ { command: "orchestrate" }
123970
+ );
123971
+ });
123972
+ orch.command("analyze <epicId>").description("Analyze epic dependency structure").option("--mode <mode>", "Analysis mode: critical-path or parallel-safety").option("--tasks <ids>", "Comma-separated task IDs for parallel-safety mode").action(async (epicId, opts) => {
123973
+ const mode = opts["mode"];
123974
+ const taskIds = typeof opts["tasks"] === "string" ? opts["tasks"].split(",").map((s3) => s3.trim()) : void 0;
123176
123975
  await dispatchFromCli(
123177
123976
  "query",
123178
123977
  "orchestrate",
123179
123978
  "analyze",
123180
- { epicId },
123979
+ { epicId, mode, taskIds },
123181
123980
  { command: "orchestrate" }
123182
123981
  );
123183
123982
  });
@@ -123193,12 +123992,21 @@ function registerOrchestrateCommand(program) {
123193
123992
  orch.command("next <epicId>").description("Get next task to spawn").action(async (epicId) => {
123194
123993
  await dispatchFromCli("query", "orchestrate", "next", { epicId }, { command: "orchestrate" });
123195
123994
  });
123196
- orch.command("spawn <taskId>").description("Prepare spawn context for a subagent").action(async (taskId) => {
123995
+ orch.command("waves <epicId>").description("Compute dependency waves for an epic").action(async (epicId) => {
123996
+ await dispatchFromCli(
123997
+ "query",
123998
+ "orchestrate",
123999
+ "waves",
124000
+ { epicId },
124001
+ { command: "orchestrate" }
124002
+ );
124003
+ });
124004
+ orch.command("spawn <taskId>").description("Prepare spawn context for a subagent").option("--protocol <type>", "Protocol type override").option("--tier <tier>", "Protocol tier (0, 1, or 2)", parseInt).action(async (taskId, opts) => {
123197
124005
  await dispatchFromCli(
123198
124006
  "mutate",
123199
124007
  "orchestrate",
123200
124008
  "spawn",
123201
- { taskId },
124009
+ { taskId, protocolType: opts["protocol"], tier: opts["tier"] },
123202
124010
  { command: "orchestrate" }
123203
124011
  );
123204
124012
  });
@@ -123224,6 +124032,53 @@ function registerOrchestrateCommand(program) {
123224
124032
  { command: "orchestrate" }
123225
124033
  );
123226
124034
  });
124035
+ orch.command("parallel <action> <epicId>").description("Manage parallel wave execution (action: start | end)").option("--wave <number>", "Wave number", parseInt).action(async (action, epicId, opts) => {
124036
+ await dispatchFromCli(
124037
+ "mutate",
124038
+ "orchestrate",
124039
+ "parallel",
124040
+ { action, epicId, wave: opts["wave"] },
124041
+ { command: "orchestrate" }
124042
+ );
124043
+ });
124044
+ const tessera = orch.command("tessera").description("Tessera template operations for multi-agent orchestration");
124045
+ tessera.command("list").description("List available tessera templates").option("--id <templateId>", "Show details for a specific template").option("--limit <n>", "Max results to return", parseInt).option("--offset <n>", "Results offset for pagination", parseInt).action(async (opts) => {
124046
+ await dispatchFromCli(
124047
+ "query",
124048
+ "orchestrate",
124049
+ "tessera.list",
124050
+ { id: opts["id"], limit: opts["limit"], offset: opts["offset"] },
124051
+ { command: "orchestrate" }
124052
+ );
124053
+ });
124054
+ tessera.command("instantiate <templateId> <epicId>").description("Instantiate a tessera template for an epic").option("--var <pairs...>", "Key=value variable overrides").action(async (templateId, epicId, opts) => {
124055
+ const variables = {};
124056
+ const pairs = opts["var"];
124057
+ if (Array.isArray(pairs)) {
124058
+ for (const pair of pairs) {
124059
+ const eqIdx = pair.indexOf("=");
124060
+ if (eqIdx > 0) {
124061
+ variables[pair.slice(0, eqIdx)] = pair.slice(eqIdx + 1);
124062
+ }
124063
+ }
124064
+ }
124065
+ await dispatchFromCli(
124066
+ "mutate",
124067
+ "orchestrate",
124068
+ "tessera.instantiate",
124069
+ { templateId, epicId, variables },
124070
+ { command: "orchestrate" }
124071
+ );
124072
+ });
124073
+ orch.command("unblock").description("Analyze dependency graph for unblocking opportunities").action(async () => {
124074
+ await dispatchFromCli(
124075
+ "query",
124076
+ "orchestrate",
124077
+ "unblock.opportunities",
124078
+ {},
124079
+ { command: "orchestrate" }
124080
+ );
124081
+ });
123227
124082
  }
123228
124083
 
123229
124084
  // packages/cleo/src/cli/commands/otel.ts
@@ -123443,6 +124298,85 @@ function registerPromoteCommand(program) {
123443
124298
  });
123444
124299
  }
123445
124300
 
124301
+ // packages/cleo/src/cli/commands/provider.ts
124302
+ init_cli();
124303
+ function registerProviderCommand(program) {
124304
+ const providerCmd = program.command("provider").description("CAAMP provider registry: list, detect, supports, hooks, inject");
124305
+ providerCmd.command("list").description("List all registered CAAMP providers").option("--limit <n>", "Maximum providers to return").option("--offset <n>", "Offset for pagination").action(async (opts) => {
124306
+ await dispatchFromCli(
124307
+ "query",
124308
+ "tools",
124309
+ "provider.list",
124310
+ {
124311
+ limit: opts["limit"] ? Number(opts["limit"]) : void 0,
124312
+ offset: opts["offset"] ? Number(opts["offset"]) : void 0
124313
+ },
124314
+ { command: "provider", operation: "tools.provider.list" }
124315
+ );
124316
+ });
124317
+ providerCmd.command("detect").description("Detect which provider is active in the current environment").action(async () => {
124318
+ await dispatchFromCli(
124319
+ "query",
124320
+ "tools",
124321
+ "provider.detect",
124322
+ {},
124323
+ { command: "provider", operation: "tools.provider.detect" }
124324
+ );
124325
+ });
124326
+ providerCmd.command("inject-status").description("Show provider injection status for project or global scope").option("--scope <scope>", "Scope: project or global (default: project)").option("--content <content>", "Content string to check against").action(async (opts) => {
124327
+ await dispatchFromCli(
124328
+ "query",
124329
+ "tools",
124330
+ "provider.inject.status",
124331
+ {
124332
+ scope: opts["scope"] ?? "project",
124333
+ content: opts["content"]
124334
+ },
124335
+ { command: "provider", operation: "tools.provider.inject.status" }
124336
+ );
124337
+ });
124338
+ providerCmd.command("supports <provider-id> <capability>").description("Check if a provider supports a capability (e.g., spawn.supportsSubagents)").action(async (providerId, capability) => {
124339
+ await dispatchFromCli(
124340
+ "query",
124341
+ "tools",
124342
+ "provider.supports",
124343
+ { providerId, capability },
124344
+ { command: "provider", operation: "tools.provider.supports" }
124345
+ );
124346
+ });
124347
+ providerCmd.command("hooks <event>").description("List providers that support a specific hook event (e.g., onSessionStart)").action(async (event) => {
124348
+ await dispatchFromCli(
124349
+ "query",
124350
+ "tools",
124351
+ "provider.hooks",
124352
+ { event },
124353
+ { command: "provider", operation: "tools.provider.hooks" }
124354
+ );
124355
+ });
124356
+ providerCmd.command("inject").description("Inject provider references into AGENTS.md (project or global scope)").option("--scope <scope>", "Scope: project or global (default: project)").option("--references <refs...>", "Provider reference IDs to inject").option("--content <content>", "Content string to inject directly").action(async (opts) => {
124357
+ await dispatchFromCli(
124358
+ "mutate",
124359
+ "tools",
124360
+ "provider.inject",
124361
+ {
124362
+ scope: opts["scope"] ?? "project",
124363
+ references: opts["references"],
124364
+ content: opts["content"]
124365
+ },
124366
+ { command: "provider", operation: "tools.provider.inject" }
124367
+ );
124368
+ });
124369
+ providerCmd.action(async () => {
124370
+ await dispatchFromCli(
124371
+ "query",
124372
+ "tools",
124373
+ "provider.list",
124374
+ {},
124375
+ { command: "provider", operation: "tools.provider.list" }
124376
+ );
124377
+ });
124378
+ }
124379
+
123446
124380
  // packages/cleo/src/cli/commands/reason.ts
123447
124381
  init_cli();
123448
124382
  function registerReasonCommand(program) {
@@ -123619,6 +124553,27 @@ function registerReleaseCommand(program) {
123619
124553
  { command: "release" }
123620
124554
  );
123621
124555
  });
124556
+ release2.command("rollback <version>").description("Roll back a shipped release (marks it as rolled-back in CLEO records)").option("--reason <reason>", "Reason for rollback").action(async (version2, opts) => {
124557
+ await dispatchFromCli(
124558
+ "mutate",
124559
+ "pipeline",
124560
+ "release.rollback",
124561
+ {
124562
+ version: version2,
124563
+ reason: opts["reason"]
124564
+ },
124565
+ { command: "release" }
124566
+ );
124567
+ });
124568
+ release2.command("channel").description("Show the current release channel based on git branch (latest/beta/alpha)").action(async () => {
124569
+ await dispatchFromCli(
124570
+ "query",
124571
+ "pipeline",
124572
+ "release.channel.show",
124573
+ {},
124574
+ { command: "release" }
124575
+ );
124576
+ });
123622
124577
  }
123623
124578
 
123624
124579
  // packages/cleo/src/cli/commands/remote.ts
@@ -124834,7 +125789,9 @@ async function runPostUpdateDiagnostics(opts) {
124834
125789
  }
124835
125790
 
124836
125791
  // packages/cleo/src/cli/commands/sequence.ts
125792
+ init_internal();
124837
125793
  init_cli();
125794
+ init_renderers();
124838
125795
  function registerSequenceCommand(program) {
124839
125796
  const sequence = program.command("sequence").description("Inspect and manage task ID sequence (show/check/repair)");
124840
125797
  sequence.command("show").description("Display current sequence state").action(async () => {
@@ -124856,13 +125813,10 @@ function registerSequenceCommand(program) {
124856
125813
  );
124857
125814
  });
124858
125815
  sequence.command("repair").description("Reset counter to max + 1 if behind").action(async () => {
124859
- await dispatchFromCli(
124860
- "mutate",
124861
- "admin",
124862
- "config.set",
124863
- { key: "sequence", value: "repair" },
124864
- { command: "sequence" }
124865
- );
125816
+ const { systemSequenceRepair: systemSequenceRepair2 } = await Promise.resolve().then(() => (init_system_engine(), system_engine_exports));
125817
+ const projectRoot = getProjectRoot();
125818
+ const result = await systemSequenceRepair2(projectRoot);
125819
+ cliOutput(result, { command: "sequence", operation: "admin.sequence.repair" });
124866
125820
  });
124867
125821
  }
124868
125822
 
@@ -125003,6 +125957,55 @@ function registerSessionCommand(program) {
125003
125957
  { command: "session", operation: "session.gc" }
125004
125958
  );
125005
125959
  });
125960
+ session.command("show <sessionId>").description("Show full details for a session (absorbs debrief.show via --include debrief)").option("--include <include>", "Include extra data (debrief)").action(async (sessionId, opts) => {
125961
+ await dispatchFromCli(
125962
+ "query",
125963
+ "session",
125964
+ "show",
125965
+ {
125966
+ sessionId,
125967
+ include: opts["include"]
125968
+ },
125969
+ { command: "session", operation: "session.show" }
125970
+ );
125971
+ });
125972
+ session.command("context-drift").description("Detect context drift in the current or specified session").option("--session-id <sessionId>", "Session ID to check (defaults to active session)").action(async (opts) => {
125973
+ await dispatchFromCli(
125974
+ "query",
125975
+ "session",
125976
+ "context.drift",
125977
+ {
125978
+ sessionId: opts["sessionId"]
125979
+ },
125980
+ { command: "session", operation: "session.context.drift" }
125981
+ );
125982
+ });
125983
+ session.command("suspend <sessionId>").description("Suspend an active session (pause without ending)").option("--reason <reason>", "Reason for suspension").action(async (sessionId, opts) => {
125984
+ await dispatchFromCli(
125985
+ "mutate",
125986
+ "session",
125987
+ "suspend",
125988
+ {
125989
+ sessionId,
125990
+ reason: opts["reason"]
125991
+ },
125992
+ { command: "session", operation: "session.suspend" }
125993
+ );
125994
+ });
125995
+ session.command("record-assumption").description("Record an assumption made during the current session").requiredOption("--assumption <assumption>", "Assumption text").requiredOption("--confidence <confidence>", "Confidence level (high|medium|low)").option("--session-id <sessionId>", "Session ID (defaults to active session)").option("--task-id <taskId>", "Task ID the assumption relates to").action(async (opts) => {
125996
+ await dispatchFromCli(
125997
+ "mutate",
125998
+ "session",
125999
+ "record.assumption",
126000
+ {
126001
+ sessionId: opts["sessionId"],
126002
+ taskId: opts["taskId"],
126003
+ assumption: opts["assumption"],
126004
+ confidence: opts["confidence"]
126005
+ },
126006
+ { command: "session", operation: "session.record.assumption" }
126007
+ );
126008
+ });
125006
126009
  session.command("record-decision").description("Record a decision made during the current session").requiredOption("--session-id <sessionId>", "Session ID").requiredOption("--task-id <taskId>", "Task ID the decision relates to").requiredOption("--decision <decision>", "Decision text").requiredOption("--rationale <rationale>", "Rationale for the decision").option("--alternatives <alternatives>", "Alternatives considered").action(async (opts) => {
125007
126010
  await dispatchFromCli(
125008
126011
  "mutate",
@@ -125168,6 +126171,63 @@ function registerSkillsCommand(program) {
125168
126171
  }
125169
126172
  );
125170
126173
  });
126174
+ skillsCmd.command("dispatch <skill-name>").description("Resolve dispatch path for a skill").action(async (skillName) => {
126175
+ await dispatchFromCli(
126176
+ "query",
126177
+ "tools",
126178
+ "skill.dispatch",
126179
+ { name: skillName },
126180
+ { command: "skills", operation: "tools.skill.dispatch" }
126181
+ );
126182
+ });
126183
+ skillsCmd.command("catalog").description("Browse CAAMP skill catalog (protocols, profiles, resources, info)").option("--type <type>", "Catalog type: protocols, profiles, resources, info (default: info)").option("--limit <n>", "Maximum items to return").option("--offset <n>", "Offset for pagination").action(async (opts) => {
126184
+ await dispatchFromCli(
126185
+ "query",
126186
+ "tools",
126187
+ "skill.catalog",
126188
+ {
126189
+ type: opts["type"] ?? "info",
126190
+ limit: opts["limit"] ? Number(opts["limit"]) : void 0,
126191
+ offset: opts["offset"] ? Number(opts["offset"]) : void 0
126192
+ },
126193
+ { command: "skills", operation: "tools.skill.catalog" }
126194
+ );
126195
+ });
126196
+ skillsCmd.command("precedence").description("Show or resolve skill provider precedence").option("--resolve <provider-id>", "Resolve precedence for a specific provider").option("--scope <scope>", "Scope: global or project (default: global)").action(async (opts) => {
126197
+ const providerId = opts["resolve"];
126198
+ await dispatchFromCli(
126199
+ "query",
126200
+ "tools",
126201
+ "skill.precedence",
126202
+ {
126203
+ action: providerId ? "resolve" : "show",
126204
+ providerId,
126205
+ scope: opts["scope"] ?? "global"
126206
+ },
126207
+ { command: "skills", operation: "tools.skill.precedence" }
126208
+ );
126209
+ });
126210
+ skillsCmd.command("deps <skill-name>").description("Show skill dependency tree").action(async (skillName) => {
126211
+ await dispatchFromCli(
126212
+ "query",
126213
+ "tools",
126214
+ "skill.dependencies",
126215
+ { name: skillName },
126216
+ { command: "skills", operation: "tools.skill.dependencies" }
126217
+ );
126218
+ });
126219
+ skillsCmd.command("spawn-providers").description("List providers capable of spawning subagents").option(
126220
+ "--capability <cap>",
126221
+ "Filter by capability: supportsSubagents, supportsProgrammaticSpawn, supportsInterAgentComms, supportsParallelSpawn"
126222
+ ).action(async (opts) => {
126223
+ await dispatchFromCli(
126224
+ "query",
126225
+ "tools",
126226
+ "skill.spawn.providers",
126227
+ { capability: opts["capability"] },
126228
+ { command: "skills", operation: "tools.skill.spawn.providers" }
126229
+ );
126230
+ });
125171
126231
  skillsCmd.action(async () => {
125172
126232
  await dispatchFromCli(
125173
126233
  "query",
@@ -125482,6 +126542,43 @@ function registerStopCommand(program) {
125482
126542
  });
125483
126543
  }
125484
126544
 
126545
+ // packages/cleo/src/cli/commands/sync.ts
126546
+ init_cli();
126547
+ function registerSyncCommand(program) {
126548
+ const sync = program.command("sync").description("External task synchronisation management");
126549
+ const links = sync.command("links").description("List external task links");
126550
+ links.command("list").description("List external task links (filter by provider or task)").option("--provider <providerId>", "Filter links by provider (e.g. linear, jira, github)").option("--task <taskId>", "Filter links by CLEO task ID").action(async (opts) => {
126551
+ await dispatchFromCli(
126552
+ "query",
126553
+ "tasks",
126554
+ "sync.links",
126555
+ {
126556
+ providerId: opts["provider"],
126557
+ taskId: opts["task"]
126558
+ },
126559
+ { command: "sync", operation: "tasks.sync.links" }
126560
+ );
126561
+ });
126562
+ links.command("remove <providerId>").description("Remove all external task links for a provider").action(async (providerId) => {
126563
+ await dispatchFromCli(
126564
+ "mutate",
126565
+ "tasks",
126566
+ "sync.links.remove",
126567
+ { providerId },
126568
+ { command: "sync", operation: "tasks.sync.links.remove" }
126569
+ );
126570
+ });
126571
+ links.action(async () => {
126572
+ await dispatchFromCli(
126573
+ "query",
126574
+ "tasks",
126575
+ "sync.links",
126576
+ {},
126577
+ { command: "sync", operation: "tasks.sync.links" }
126578
+ );
126579
+ });
126580
+ }
126581
+
125485
126582
  // packages/cleo/src/cli/commands/testing.ts
125486
126583
  init_cli();
125487
126584
  function registerTestingCommand(program) {
@@ -126185,8 +127282,15 @@ registerArchiveStatsCommand(rootShim);
126185
127282
  registerGenerateChangelogCommand(rootShim);
126186
127283
  registerIssueCommand(rootShim);
126187
127284
  registerSkillsCommand(rootShim);
127285
+ registerProviderCommand(rootShim);
127286
+ registerAdapterCommand(rootShim);
126188
127287
  registerExistsCommand(rootShim);
126189
127288
  registerBugCommand(rootShim);
127289
+ registerCancelCommand(rootShim);
127290
+ registerClaimCommand(rootShim);
127291
+ registerUnclaimCommand(rootShim);
127292
+ registerComplexityCommand(rootShim);
127293
+ registerSyncCommand(rootShim);
126190
127294
  registerAnalyzeCommand(rootShim);
126191
127295
  registerMapCommand(rootShim);
126192
127296
  registerBackupCommand(rootShim);