@cleocode/cleo 2026.3.61 → 2026.3.62

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/mcp/index.js CHANGED
@@ -13259,7 +13259,7 @@ async function showSequence(cwd) {
13259
13259
  counter: seq.counter,
13260
13260
  lastId: seq.lastId,
13261
13261
  checksum: seq.checksum,
13262
- nextId: `T${seq.counter + 1}`
13262
+ nextId: `T${String(seq.counter + 1).padStart(3, "0")}`
13263
13263
  };
13264
13264
  }
13265
13265
  async function loadAllTasks(cwd, accessor) {
@@ -41812,6 +41812,58 @@ async function addTask(options, cwd, accessor) {
41812
41812
  if (duplicate) {
41813
41813
  return { task: duplicate, duplicate: true };
41814
41814
  }
41815
+ if (options.dryRun) {
41816
+ const previewNow = (/* @__PURE__ */ new Date()).toISOString();
41817
+ let previewParentForStage = null;
41818
+ if (parentId) {
41819
+ const previewParentTask = await dataAccessor.loadSingleTask(parentId);
41820
+ previewParentForStage = previewParentTask ? { pipelineStage: previewParentTask.pipelineStage, type: previewParentTask.type } : null;
41821
+ }
41822
+ const previewPipelineStage = resolveDefaultPipelineStage({
41823
+ explicitStage: options.pipelineStage,
41824
+ taskType: taskType ?? null,
41825
+ parentTask: previewParentForStage
41826
+ });
41827
+ const previewPosition = options.position !== void 0 ? options.position : await dataAccessor.getNextPosition(parentId);
41828
+ const previewTask = {
41829
+ id: "T???",
41830
+ title: options.title,
41831
+ description: options.description,
41832
+ status,
41833
+ priority,
41834
+ type: taskType,
41835
+ parentId: parentId || null,
41836
+ position: previewPosition,
41837
+ positionVersion: 0,
41838
+ size,
41839
+ pipelineStage: previewPipelineStage,
41840
+ createdAt: previewNow,
41841
+ updatedAt: previewNow
41842
+ };
41843
+ if (phase) previewTask.phase = phase;
41844
+ if (options.labels?.length) previewTask.labels = options.labels.map((l) => l.trim());
41845
+ if (options.files?.length) previewTask.files = options.files.map((f) => f.trim());
41846
+ if (options.acceptance?.length)
41847
+ previewTask.acceptance = options.acceptance.map((a) => a.trim());
41848
+ if (options.depends?.length) previewTask.depends = options.depends.map((d) => d.trim());
41849
+ if (options.notes) {
41850
+ const previewNote = `${(/* @__PURE__ */ new Date()).toISOString().replace("T", " ").replace(/\.\d+Z$/, " UTC")}: ${options.notes}`;
41851
+ previewTask.notes = [previewNote];
41852
+ }
41853
+ if (status === "blocked" && options.description) {
41854
+ previewTask.blockedBy = options.description;
41855
+ }
41856
+ if (status === "done") {
41857
+ previewTask.completedAt = previewNow;
41858
+ }
41859
+ if (taskType !== "epic") {
41860
+ const verificationEnabledRaw = await getRawConfigValue("verification.enabled", cwd);
41861
+ if (verificationEnabledRaw === true) {
41862
+ previewTask.verification = buildDefaultVerification(previewNow);
41863
+ }
41864
+ }
41865
+ return { task: previewTask, dryRun: true };
41866
+ }
41815
41867
  const taskId = await allocateNextTaskId(cwd);
41816
41868
  const now2 = (/* @__PURE__ */ new Date()).toISOString();
41817
41869
  let resolvedParentForStage = null;
@@ -41881,9 +41933,6 @@ async function addTask(options, cwd, accessor) {
41881
41933
  task.verification = buildDefaultVerification(now2);
41882
41934
  }
41883
41935
  }
41884
- if (options.dryRun) {
41885
- return { task, dryRun: true };
41886
- }
41887
41936
  await dataAccessor.transaction(async (tx) => {
41888
41937
  if (options.position !== void 0) {
41889
41938
  await dataAccessor.shiftPositions(parentId, options.position, 1);
@@ -47795,8 +47844,9 @@ var init_observability = __esm({
47795
47844
  });
47796
47845
 
47797
47846
  // packages/core/src/phases/deps.ts
47798
- async function loadAllTasks3(_cwd, accessor) {
47799
- const { tasks: tasks2 } = await accessor.queryTasks({});
47847
+ async function loadAllTasks3(cwd, accessor) {
47848
+ const acc = accessor ?? await getAccessor(cwd);
47849
+ const { tasks: tasks2 } = await acc.queryTasks({});
47800
47850
  return tasks2;
47801
47851
  }
47802
47852
  function buildGraph(tasks2) {
@@ -47872,11 +47922,45 @@ async function getExecutionWaves(epicId, cwd, accessor) {
47872
47922
  }
47873
47923
  return waves;
47874
47924
  }
47925
+ async function getCriticalPath2(taskId, cwd, accessor) {
47926
+ const allTasks = await loadAllTasks3(cwd, accessor);
47927
+ const task = allTasks.find((t) => t.id === taskId);
47928
+ if (!task) {
47929
+ throw new CleoError(4 /* NOT_FOUND */, `Task not found: ${taskId}`);
47930
+ }
47931
+ const graph = buildGraph(allTasks);
47932
+ const taskMap = new Map(allTasks.map((t) => [t.id, t]));
47933
+ function findLongestPath(id, visited) {
47934
+ if (visited.has(id)) return [];
47935
+ visited.add(id);
47936
+ const node = graph.get(id);
47937
+ if (!node || node.dependents.length === 0) {
47938
+ return [id];
47939
+ }
47940
+ let longest = [];
47941
+ for (const depId of node.dependents) {
47942
+ const path3 = findLongestPath(depId, new Set(visited));
47943
+ if (path3.length > longest.length) {
47944
+ longest = path3;
47945
+ }
47946
+ }
47947
+ return [id, ...longest];
47948
+ }
47949
+ const path2 = findLongestPath(taskId, /* @__PURE__ */ new Set());
47950
+ return {
47951
+ path: path2.map((id) => {
47952
+ const t = taskMap.get(id);
47953
+ return t ? { id: t.id, title: t.title, status: t.status } : { id, title: "Unknown", status: "unknown" };
47954
+ }),
47955
+ length: path2.length
47956
+ };
47957
+ }
47875
47958
  var init_deps2 = __esm({
47876
47959
  "packages/core/src/phases/deps.ts"() {
47877
47960
  "use strict";
47878
47961
  init_src();
47879
47962
  init_errors3();
47963
+ init_data_accessor();
47880
47964
  }
47881
47965
  });
47882
47966
 
@@ -52678,6 +52762,13 @@ var init_capability_matrix = __esm({
52678
52762
  mode: "native",
52679
52763
  preferredChannel: "either"
52680
52764
  },
52765
+ {
52766
+ domain: "admin",
52767
+ operation: "backup",
52768
+ gateway: "query",
52769
+ mode: "native",
52770
+ preferredChannel: "either"
52771
+ },
52681
52772
  {
52682
52773
  domain: "admin",
52683
52774
  operation: "backup",
@@ -57927,7 +58018,7 @@ async function getProjectStats(opts, accessor) {
57927
58018
  dbAnd(dbEq(tasksTable.status, "archived"), dbEq(tasksTable.archiveReason, "completed"))
57928
58019
  ).get();
57929
58020
  archivedCompleted = archivedDoneRow?.c ?? 0;
57930
- totalCompleted = (statusMap["done"] ?? 0) + archivedCompleted;
58021
+ totalCompleted = entries.filter(isComplete).length;
57931
58022
  } catch {
57932
58023
  totalCreated = entries.filter(isCreate).length;
57933
58024
  totalCompleted = entries.filter(isComplete).length;
@@ -58933,7 +59024,7 @@ var init_audit2 = __esm({
58933
59024
  });
58934
59025
 
58935
59026
  // packages/core/src/system/backup.ts
58936
- import { existsSync as existsSync82, mkdirSync as mkdirSync18, readFileSync as readFileSync59, writeFileSync as writeFileSync11 } from "node:fs";
59027
+ import { existsSync as existsSync82, mkdirSync as mkdirSync18, readdirSync as readdirSync27, readFileSync as readFileSync59, writeFileSync as writeFileSync11 } from "node:fs";
58937
59028
  import { join as join84 } from "node:path";
58938
59029
  function createBackup2(projectRoot, opts) {
58939
59030
  const cleoDir = join84(projectRoot, ".cleo");
@@ -58979,6 +59070,36 @@ function createBackup2(projectRoot, opts) {
58979
59070
  }
58980
59071
  return { backupId, path: backupDir, timestamp: timestamp2, type: btype, files: backedUp };
58981
59072
  }
59073
+ function listSystemBackups(projectRoot) {
59074
+ const cleoDir = join84(projectRoot, ".cleo");
59075
+ const backupTypes = ["snapshot", "safety", "migration"];
59076
+ const entries = [];
59077
+ for (const btype of backupTypes) {
59078
+ const backupDir = join84(cleoDir, "backups", btype);
59079
+ if (!existsSync82(backupDir)) continue;
59080
+ try {
59081
+ const files = readdirSync27(backupDir).filter((f) => f.endsWith(".meta.json"));
59082
+ for (const metaFile of files) {
59083
+ try {
59084
+ const raw = readFileSync59(join84(backupDir, metaFile), "utf-8");
59085
+ const meta = JSON.parse(raw);
59086
+ if (meta.backupId && meta.timestamp) {
59087
+ entries.push({
59088
+ backupId: meta.backupId,
59089
+ type: meta.type ?? btype,
59090
+ timestamp: meta.timestamp,
59091
+ note: meta.note,
59092
+ files: meta.files ?? []
59093
+ });
59094
+ }
59095
+ } catch {
59096
+ }
59097
+ }
59098
+ } catch {
59099
+ }
59100
+ }
59101
+ return entries.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
59102
+ }
58982
59103
  function restoreBackup(projectRoot, params) {
58983
59104
  if (!params.backupId) {
58984
59105
  throw new CleoError(2 /* INVALID_INPUT */, "backupId is required");
@@ -59103,7 +59224,7 @@ var init_audit_prune = __esm({
59103
59224
  });
59104
59225
 
59105
59226
  // packages/core/src/system/cleanup.ts
59106
- import { existsSync as existsSync83, readdirSync as readdirSync27, readFileSync as readFileSync60, unlinkSync as unlinkSync5, writeFileSync as writeFileSync12 } from "node:fs";
59227
+ import { existsSync as existsSync83, readdirSync as readdirSync28, readFileSync as readFileSync60, unlinkSync as unlinkSync5, writeFileSync as writeFileSync12 } from "node:fs";
59107
59228
  import { join as join86 } from "node:path";
59108
59229
  async function cleanupSystem(projectRoot, params) {
59109
59230
  if (!params.target) {
@@ -59151,10 +59272,10 @@ async function cleanupSystem(projectRoot, params) {
59151
59272
  case "backups": {
59152
59273
  const backupBaseDir = join86(cleoDir, "backups");
59153
59274
  if (existsSync83(backupBaseDir)) {
59154
- for (const typeDir of readdirSync27(backupBaseDir)) {
59275
+ for (const typeDir of readdirSync28(backupBaseDir)) {
59155
59276
  const fullDir = join86(backupBaseDir, typeDir);
59156
59277
  try {
59157
- for (const file2 of readdirSync27(fullDir)) {
59278
+ for (const file2 of readdirSync28(fullDir)) {
59158
59279
  if (file2.endsWith(".meta.json")) {
59159
59280
  const metaFilePath = join86(fullDir, file2);
59160
59281
  try {
@@ -59163,7 +59284,7 @@ async function cleanupSystem(projectRoot, params) {
59163
59284
  items.push(file2.replace(".meta.json", ""));
59164
59285
  if (!dryRun) {
59165
59286
  unlinkSync5(metaFilePath);
59166
- for (const bf of readdirSync27(fullDir)) {
59287
+ for (const bf of readdirSync28(fullDir)) {
59167
59288
  if (bf.includes(meta.backupId)) {
59168
59289
  try {
59169
59290
  unlinkSync5(join86(fullDir, bf));
@@ -59193,7 +59314,7 @@ async function cleanupSystem(projectRoot, params) {
59193
59314
  }
59194
59315
  const auditPattern = /^audit-log-.*\.json$/;
59195
59316
  if (existsSync83(cleoDir)) {
59196
- for (const file2 of readdirSync27(cleoDir)) {
59317
+ for (const file2 of readdirSync28(cleoDir)) {
59197
59318
  if (auditPattern.test(file2)) {
59198
59319
  items.push(file2);
59199
59320
  if (!dryRun) {
@@ -59353,7 +59474,7 @@ import { randomBytes as randomBytes12 } from "node:crypto";
59353
59474
  import {
59354
59475
  existsSync as existsSync85,
59355
59476
  mkdirSync as mkdirSync20,
59356
- readdirSync as readdirSync28,
59477
+ readdirSync as readdirSync29,
59357
59478
  readFileSync as readFileSync61,
59358
59479
  renameSync as renameSync6,
59359
59480
  unlinkSync as unlinkSync6,
@@ -62392,7 +62513,7 @@ var init_tasks2 = __esm({
62392
62513
  });
62393
62514
 
62394
62515
  // packages/core/src/templates/parser.ts
62395
- import { existsSync as existsSync93, readdirSync as readdirSync29, readFileSync as readFileSync67 } from "fs";
62516
+ import { existsSync as existsSync93, readdirSync as readdirSync30, readFileSync as readFileSync67 } from "fs";
62396
62517
  import { join as join96 } from "path";
62397
62518
  import { parse as parseYaml } from "yaml";
62398
62519
  function deriveSubcommand(filename) {
@@ -62466,7 +62587,7 @@ function parseIssueTemplates2(projectRoot) {
62466
62587
  }
62467
62588
  let files;
62468
62589
  try {
62469
- files = readdirSync29(templateDir).filter((f) => /\.ya?ml$/i.test(f) && f !== "config.yml");
62590
+ files = readdirSync30(templateDir).filter((f) => /\.ya?ml$/i.test(f) && f !== "config.yml");
62470
62591
  } catch (error40) {
62471
62592
  return {
62472
62593
  success: false,
@@ -62879,7 +63000,7 @@ var init_changelog = __esm({
62879
63000
  });
62880
63001
 
62881
63002
  // packages/core/src/ui/command-registry.ts
62882
- import { existsSync as existsSync96, readdirSync as readdirSync30, readFileSync as readFileSync70 } from "node:fs";
63003
+ import { existsSync as existsSync96, readdirSync as readdirSync31, readFileSync as readFileSync70 } from "node:fs";
62883
63004
  import { basename as basename16, join as join98 } from "node:path";
62884
63005
  function parseCommandHeader(scriptPath) {
62885
63006
  if (!existsSync96(scriptPath)) return null;
@@ -62962,7 +63083,7 @@ function parseCommandHeader(scriptPath) {
62962
63083
  function scanAllCommands(scriptsDir) {
62963
63084
  const registry2 = /* @__PURE__ */ new Map();
62964
63085
  if (!existsSync96(scriptsDir)) return registry2;
62965
- for (const file2 of readdirSync30(scriptsDir)) {
63086
+ for (const file2 of readdirSync31(scriptsDir)) {
62966
63087
  if (!file2.endsWith(".sh") && !file2.endsWith(".ts")) continue;
62967
63088
  const meta = parseCommandHeader(join98(scriptsDir, file2));
62968
63089
  if (meta) {
@@ -63890,12 +64011,12 @@ var init_compliance2 = __esm({
63890
64011
  });
63891
64012
 
63892
64013
  // packages/core/src/validation/docs-sync.ts
63893
- import { existsSync as existsSync97, readdirSync as readdirSync31, readFileSync as readFileSync71 } from "node:fs";
64014
+ import { existsSync as existsSync97, readdirSync as readdirSync32, readFileSync as readFileSync71 } from "node:fs";
63894
64015
  import { join as join99 } from "node:path";
63895
64016
  function getScriptCommands(scriptsDir) {
63896
64017
  if (!existsSync97(scriptsDir)) return [];
63897
64018
  try {
63898
- return readdirSync31(scriptsDir).filter((f) => f.endsWith(".sh")).map((f) => f.replace(/\.sh$/, "")).sort();
64019
+ return readdirSync32(scriptsDir).filter((f) => f.endsWith(".sh")).map((f) => f.replace(/\.sh$/, "")).sort();
63899
64020
  } catch {
63900
64021
  return [];
63901
64022
  }
@@ -65317,12 +65438,12 @@ var init_manifest = __esm({
65317
65438
  });
65318
65439
 
65319
65440
  // packages/core/src/validation/protocol-common.ts
65320
- import { existsSync as existsSync100, readdirSync as readdirSync32, readFileSync as readFileSync73 } from "node:fs";
65441
+ import { existsSync as existsSync100, readdirSync as readdirSync33, readFileSync as readFileSync73 } from "node:fs";
65321
65442
  function checkOutputFileExists(taskId, expectedDir, pattern) {
65322
65443
  if (!existsSync100(expectedDir)) return false;
65323
65444
  const filePattern = pattern ?? `${taskId}`;
65324
65445
  try {
65325
- const files = readdirSync32(expectedDir);
65446
+ const files = readdirSync33(expectedDir);
65326
65447
  return files.some((f) => f.includes(filePattern) && f.endsWith(".md"));
65327
65448
  } catch {
65328
65449
  return false;
@@ -66301,7 +66422,7 @@ __export(init_exports, {
66301
66422
  isAutoInitEnabled: () => isAutoInitEnabled,
66302
66423
  updateDocs: () => updateDocs
66303
66424
  });
66304
- import { existsSync as existsSync101, readdirSync as readdirSync33, readFileSync as readFileSync74 } from "node:fs";
66425
+ import { existsSync as existsSync101, readdirSync as readdirSync34, readFileSync as readFileSync74 } from "node:fs";
66305
66426
  import { copyFile as copyFile3, lstat, mkdir as mkdir16, readFile as readFile17, symlink, unlink as unlink4, writeFile as writeFile11 } from "node:fs/promises";
66306
66427
  import { platform as platform4 } from "node:os";
66307
66428
  import { basename as basename17, dirname as dirname19, join as join101 } from "node:path";
@@ -66351,7 +66472,7 @@ async function initAgentDefinition(created, warnings) {
66351
66472
  } catch (_err) {
66352
66473
  try {
66353
66474
  await mkdir16(globalAgentsDir, { recursive: true });
66354
- const files = readdirSync33(agentSourceDir);
66475
+ const files = readdirSync34(agentSourceDir);
66355
66476
  for (const file2 of files) {
66356
66477
  await copyFile3(join101(agentSourceDir, file2), join101(globalAgentsDir, file2));
66357
66478
  }
@@ -66500,7 +66621,7 @@ async function installGitHubTemplates(projectRoot, created, skipped) {
66500
66621
  await mkdir16(issueTemplateDir, { recursive: true });
66501
66622
  const issueSrcDir = join101(templateSrcDir, "ISSUE_TEMPLATE");
66502
66623
  if (existsSync101(issueSrcDir)) {
66503
- const issueFiles = readdirSync33(issueSrcDir);
66624
+ const issueFiles = readdirSync34(issueSrcDir);
66504
66625
  for (const file2 of issueFiles) {
66505
66626
  const dest = join101(issueTemplateDir, file2);
66506
66627
  if (existsSync101(dest)) {
@@ -71306,7 +71427,7 @@ var init_model_provider_registry = __esm({
71306
71427
 
71307
71428
  // packages/core/src/metrics/token-service.ts
71308
71429
  import { createHash as createHash13, randomUUID as randomUUID8 } from "node:crypto";
71309
- import { existsSync as existsSync107, readdirSync as readdirSync34, readFileSync as readFileSync79 } from "node:fs";
71430
+ import { existsSync as existsSync107, readdirSync as readdirSync35, readFileSync as readFileSync79 } from "node:fs";
71310
71431
  import { join as join106 } from "node:path";
71311
71432
  function normalizeProvider(provider, model, runtimeProvider) {
71312
71433
  const value = (provider ?? "").trim().toLowerCase();
@@ -71391,7 +71512,7 @@ function getOtelDir2() {
71391
71512
  function readOtelJsonl(dir) {
71392
71513
  if (!existsSync107(dir)) return [];
71393
71514
  const entries = [];
71394
- for (const file2 of readdirSync34(dir)) {
71515
+ for (const file2 of readdirSync35(dir)) {
71395
71516
  if (!file2.endsWith(".json") && !file2.endsWith(".jsonl")) continue;
71396
71517
  const filePath = join106(dir, file2);
71397
71518
  const raw = readFileSync79(filePath, "utf-8").trim();
@@ -71783,7 +71904,7 @@ var init_parallel = __esm({
71783
71904
  });
71784
71905
 
71785
71906
  // packages/core/src/orchestration/skill-ops.ts
71786
- import { existsSync as existsSync108, readdirSync as readdirSync35, readFileSync as readFileSync80 } from "node:fs";
71907
+ import { existsSync as existsSync108, readdirSync as readdirSync36, readFileSync as readFileSync80 } from "node:fs";
71787
71908
  import { join as join107 } from "node:path";
71788
71909
  import { getCanonicalSkillsDir as getCanonicalSkillsDir3 } from "@cleocode/caamp";
71789
71910
  function getSkillContent(skillName, projectRoot) {
@@ -71808,7 +71929,7 @@ function getSkillContent(skillName, projectRoot) {
71808
71929
  let references = [];
71809
71930
  if (existsSync108(refsDir)) {
71810
71931
  try {
71811
- references = readdirSync35(refsDir).filter((f) => f.endsWith(".md") || f.endsWith(".txt")).map((f) => ({
71932
+ references = readdirSync36(refsDir).filter((f) => f.endsWith(".md") || f.endsWith(".txt")).map((f) => ({
71812
71933
  name: f,
71813
71934
  path: join107(skillDir, "references", f)
71814
71935
  }));
@@ -74522,7 +74643,7 @@ import {
74522
74643
  copyFileSync as copyFileSync7,
74523
74644
  existsSync as existsSync111,
74524
74645
  mkdirSync as mkdirSync23,
74525
- readdirSync as readdirSync36,
74646
+ readdirSync as readdirSync37,
74526
74647
  readFileSync as readFileSync83,
74527
74648
  writeFileSync as writeFileSync20
74528
74649
  } from "node:fs";
@@ -74735,7 +74856,7 @@ async function runUpgrade(options = {}) {
74735
74856
  const dbPath2 = join109(cleoDir2, "tasks.db");
74736
74857
  const safetyDir = join109(cleoDir2, "backups", "safety");
74737
74858
  if (existsSync111(safetyDir)) {
74738
- const backups = readdirSync36(safetyDir).filter((f) => f.startsWith("tasks.db.pre-migration.")).sort().reverse();
74859
+ const backups = readdirSync37(safetyDir).filter((f) => f.startsWith("tasks.db.pre-migration.")).sort().reverse();
74739
74860
  if (backups.length > 0 && !existsSync111(dbPath2)) {
74740
74861
  copyFileSync7(join109(safetyDir, backups[0]), dbPath2);
74741
74862
  }
@@ -77662,7 +77783,7 @@ var init_bootstrap2 = __esm({
77662
77783
  });
77663
77784
 
77664
77785
  // packages/core/src/orchestration/critical-path.ts
77665
- async function getCriticalPath2(cwd, accessor) {
77786
+ async function getCriticalPath3(cwd, accessor) {
77666
77787
  const acc = accessor ?? await getAccessor(cwd);
77667
77788
  const { tasks: tasks2 } = await acc.queryTasks({});
77668
77789
  if (tasks2.length === 0) {
@@ -78283,6 +78404,7 @@ __export(internal_exports, {
78283
78404
  deletePhase: () => deletePhase,
78284
78405
  deleteTask: () => deleteTask,
78285
78406
  deleteTokenUsage: () => deleteTokenUsage,
78407
+ depsCriticalPath: () => getCriticalPath2,
78286
78408
  deregisterAgent: () => deregisterAgent,
78287
78409
  describeChannel: () => describeChannel,
78288
78410
  detectCrashedAgents: () => detectCrashedAgents,
@@ -78424,6 +78546,7 @@ __export(internal_exports, {
78424
78546
  getSystemInfo: () => getSystemInfo2,
78425
78547
  getSystemMetrics: () => getSystemMetrics,
78426
78548
  getSystemMigrationStatus: () => getMigrationStatus2,
78549
+ getTask: () => getTask,
78427
78550
  getTaskHistory: () => getTaskHistory,
78428
78551
  getTaskPath: () => getTaskPath,
78429
78552
  getTemplateForSubcommand: () => getTemplateForSubcommand2,
@@ -78499,6 +78622,7 @@ __export(internal_exports, {
78499
78622
  listSessions: () => listSessions,
78500
78623
  listStickies: () => listStickies,
78501
78624
  listStrictnessPresets: () => listStrictnessPresets,
78625
+ listSystemBackups: () => listSystemBackups,
78502
78626
  listTasks: () => listTasks,
78503
78627
  listTesseraTemplates: () => listTesseraTemplates,
78504
78628
  listTokenUsage: () => listTokenUsage,
@@ -78559,7 +78683,7 @@ __export(internal_exports, {
78559
78683
  ops: () => operations_exports,
78560
78684
  orchestration: () => orchestration_exports,
78561
78685
  orchestrationAnalyzeDependencies: () => analyzeDependencies,
78562
- orchestrationGetCriticalPath: () => getCriticalPath2,
78686
+ orchestrationGetCriticalPath: () => getCriticalPath3,
78563
78687
  orchestrationGetNextTask: () => getNextTask,
78564
78688
  orchestrationGetReadyTasks: () => getReadyTasks2,
78565
78689
  orphanDetection: () => orphanDetection,
@@ -78793,6 +78917,7 @@ var init_internal = __esm({
78793
78917
  init_waves();
78794
78918
  init_otel();
78795
78919
  init_paths();
78920
+ init_deps2();
78796
78921
  init_phases();
78797
78922
  init_pipeline2();
78798
78923
  init_platform();
@@ -84515,6 +84640,16 @@ var OPERATIONS = [
84515
84640
  }
84516
84641
  ]
84517
84642
  },
84643
+ {
84644
+ gateway: "query",
84645
+ domain: "admin",
84646
+ operation: "backup",
84647
+ description: "admin.backup (query) \u2014 list available backups (read-only)",
84648
+ tier: 1,
84649
+ idempotent: true,
84650
+ sessionRequired: false,
84651
+ requiredParams: []
84652
+ },
84518
84653
  {
84519
84654
  gateway: "mutate",
84520
84655
  domain: "admin",
@@ -86568,7 +86703,7 @@ async function orchestrateCriticalPath(projectRoot) {
86568
86703
  try {
86569
86704
  const root = projectRoot || resolveProjectRoot();
86570
86705
  const accessor = await getAccessor(root);
86571
- const result = await getCriticalPath2(root, accessor);
86706
+ const result = await getCriticalPath3(root, accessor);
86572
86707
  return { success: true, data: result };
86573
86708
  } catch (err) {
86574
86709
  return engineError("E_GENERAL", err.message);
@@ -87324,7 +87459,7 @@ async function releaseShip(params, projectRoot) {
87324
87459
  // packages/cleo/src/dispatch/engines/system-engine.ts
87325
87460
  init_internal();
87326
87461
  init_error();
87327
- import { existsSync as existsSync119, readdirSync as readdirSync37, readFileSync as readFileSync93 } from "node:fs";
87462
+ import { existsSync as existsSync119, readdirSync as readdirSync38, readFileSync as readFileSync93 } from "node:fs";
87328
87463
  import { basename as basename18, join as join112 } from "node:path";
87329
87464
  var HELP_TOPICS = {
87330
87465
  session: {
@@ -87631,7 +87766,7 @@ function systemContext(projectRoot, params) {
87631
87766
  const sessions2 = [];
87632
87767
  const statesDir = join112(cleoDir, "context-states");
87633
87768
  if (existsSync119(statesDir)) {
87634
- for (const file2 of readdirSync37(statesDir)) {
87769
+ for (const file2 of readdirSync38(statesDir)) {
87635
87770
  if (file2.startsWith("context-state-") && file2.endsWith(".json")) {
87636
87771
  try {
87637
87772
  const state = JSON.parse(readFileSync93(join112(statesDir, file2), "utf-8"));
@@ -87768,6 +87903,14 @@ function systemBackup(projectRoot, params) {
87768
87903
  return engineError("E_GENERAL", err.message);
87769
87904
  }
87770
87905
  }
87906
+ function systemListBackups(projectRoot) {
87907
+ try {
87908
+ const result = listSystemBackups(projectRoot);
87909
+ return { success: true, data: result };
87910
+ } catch (err) {
87911
+ return engineError("E_GENERAL", err.message);
87912
+ }
87913
+ }
87771
87914
  function systemRestore(projectRoot, params) {
87772
87915
  try {
87773
87916
  const result = restoreBackup(projectRoot, params);
@@ -89334,6 +89477,16 @@ var AdminHandler = class {
89334
89477
  data: result
89335
89478
  };
89336
89479
  }
89480
+ case "backup": {
89481
+ const result = systemListBackups(projectRoot);
89482
+ return wrapResult(
89483
+ { success: true, data: { backups: result, count: result.length } },
89484
+ "query",
89485
+ "admin",
89486
+ operation,
89487
+ startTime
89488
+ );
89489
+ }
89337
89490
  case "map": {
89338
89491
  const { mapCodebase: mapCodebase3 } = await Promise.resolve().then(() => (init_codebase_map_engine(), codebase_map_engine_exports));
89339
89492
  const result = await mapCodebase3(projectRoot, {
@@ -89823,6 +89976,7 @@ var AdminHandler = class {
89823
89976
  "token",
89824
89977
  "adr.show",
89825
89978
  "adr.find",
89979
+ "backup",
89826
89980
  "export",
89827
89981
  "map"
89828
89982
  ],