@cleocode/cleo 2026.3.63 → 2026.3.65

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 (87) hide show
  1. package/dist/cli/commands/add.d.ts.map +1 -1
  2. package/dist/cli/commands/add.js +5 -2
  3. package/dist/cli/commands/add.js.map +1 -1
  4. package/dist/cli/commands/agents.d.ts +31 -0
  5. package/dist/cli/commands/agents.d.ts.map +1 -0
  6. package/dist/cli/commands/agents.js +104 -0
  7. package/dist/cli/commands/agents.js.map +1 -0
  8. package/dist/cli/commands/backfill.d.ts +32 -0
  9. package/dist/cli/commands/backfill.d.ts.map +1 -0
  10. package/dist/cli/commands/backfill.js +101 -0
  11. package/dist/cli/commands/backfill.js.map +1 -0
  12. package/dist/cli/commands/backup.js +1 -1
  13. package/dist/cli/commands/backup.js.map +1 -1
  14. package/dist/cli/commands/config.d.ts +1 -0
  15. package/dist/cli/commands/config.d.ts.map +1 -1
  16. package/dist/cli/commands/config.js +26 -0
  17. package/dist/cli/commands/config.js.map +1 -1
  18. package/dist/cli/commands/context.js +1 -1
  19. package/dist/cli/commands/context.js.map +1 -1
  20. package/dist/cli/commands/deps.d.ts +15 -0
  21. package/dist/cli/commands/deps.d.ts.map +1 -1
  22. package/dist/cli/commands/deps.js +28 -3
  23. package/dist/cli/commands/deps.js.map +1 -1
  24. package/dist/cli/commands/detect-drift.d.ts.map +1 -1
  25. package/dist/cli/commands/detect-drift.js +4 -3
  26. package/dist/cli/commands/detect-drift.js.map +1 -1
  27. package/dist/cli/commands/exists.d.ts +15 -0
  28. package/dist/cli/commands/exists.d.ts.map +1 -1
  29. package/dist/cli/commands/exists.js +33 -15
  30. package/dist/cli/commands/exists.js.map +1 -1
  31. package/dist/cli/commands/issue.d.ts +3 -0
  32. package/dist/cli/commands/issue.d.ts.map +1 -1
  33. package/dist/cli/commands/issue.js +23 -21
  34. package/dist/cli/commands/issue.js.map +1 -1
  35. package/dist/cli/commands/labels.js +1 -1
  36. package/dist/cli/commands/labels.js.map +1 -1
  37. package/dist/cli/commands/phases.js +1 -1
  38. package/dist/cli/commands/phases.js.map +1 -1
  39. package/dist/cli/commands/reason.d.ts +35 -0
  40. package/dist/cli/commands/reason.d.ts.map +1 -0
  41. package/dist/cli/commands/reason.js +104 -0
  42. package/dist/cli/commands/reason.js.map +1 -0
  43. package/dist/cli/commands/session.d.ts.map +1 -1
  44. package/dist/cli/commands/session.js +15 -0
  45. package/dist/cli/commands/session.js.map +1 -1
  46. package/dist/cli/commands/stats.d.ts.map +1 -1
  47. package/dist/cli/commands/stats.js +13 -1
  48. package/dist/cli/commands/stats.js.map +1 -1
  49. package/dist/cli/commands/update.d.ts.map +1 -1
  50. package/dist/cli/commands/update.js +8 -2
  51. package/dist/cli/commands/update.js.map +1 -1
  52. package/dist/cli/index.js +48 -9
  53. package/dist/cli/index.js.map +3 -3
  54. package/dist/dispatch/domains/admin.d.ts.map +1 -1
  55. package/dist/dispatch/domains/admin.js +25 -1
  56. package/dist/dispatch/domains/admin.js.map +1 -1
  57. package/dist/dispatch/domains/check.d.ts.map +1 -1
  58. package/dist/dispatch/domains/check.js +15 -1
  59. package/dist/dispatch/domains/check.js.map +1 -1
  60. package/dist/dispatch/domains/tasks.d.ts.map +1 -1
  61. package/dist/dispatch/domains/tasks.js +17 -1
  62. package/dist/dispatch/domains/tasks.js.map +1 -1
  63. package/dist/dispatch/engines/config-engine.d.ts +11 -0
  64. package/dist/dispatch/engines/config-engine.d.ts.map +1 -1
  65. package/dist/dispatch/engines/config-engine.js +26 -1
  66. package/dist/dispatch/engines/config-engine.js.map +1 -1
  67. package/dist/dispatch/engines/session-engine.d.ts.map +1 -1
  68. package/dist/dispatch/engines/session-engine.js +9 -5
  69. package/dist/dispatch/engines/session-engine.js.map +1 -1
  70. package/dist/dispatch/engines/system-engine.d.ts +6 -1
  71. package/dist/dispatch/engines/system-engine.d.ts.map +1 -1
  72. package/dist/dispatch/engines/system-engine.js +14 -1
  73. package/dist/dispatch/engines/system-engine.js.map +1 -1
  74. package/dist/dispatch/engines/task-engine.d.ts +19 -1
  75. package/dist/dispatch/engines/task-engine.d.ts.map +1 -1
  76. package/dist/dispatch/engines/task-engine.js +31 -2
  77. package/dist/dispatch/engines/task-engine.js.map +1 -1
  78. package/dist/dispatch/lib/engine.d.ts +3 -3
  79. package/dist/dispatch/lib/engine.d.ts.map +1 -1
  80. package/dist/dispatch/lib/engine.js +3 -3
  81. package/dist/dispatch/lib/engine.js.map +1 -1
  82. package/dist/dispatch/registry.d.ts.map +1 -1
  83. package/dist/dispatch/registry.js +81 -0
  84. package/dist/dispatch/registry.js.map +1 -1
  85. package/dist/mcp/index.js +13 -4
  86. package/dist/mcp/index.js.map +2 -2
  87. package/package.json +3 -3
package/dist/cli/index.js CHANGED
@@ -15411,6 +15411,9 @@ function createPage(input) {
15411
15411
  };
15412
15412
  }
15413
15413
  function paginate(items, limit, offset) {
15414
+ if (!items || items.length === 0) {
15415
+ return { items: [], page: { mode: "none" } };
15416
+ }
15414
15417
  const total = items.length;
15415
15418
  if (limit === void 0 && offset === void 0) {
15416
15419
  return { items, page: { mode: "none" } };
@@ -80504,7 +80507,7 @@ var init_hooks_engine = __esm({
80504
80507
  // packages/cleo/src/cli/index.ts
80505
80508
  import { readFileSync as readFileSync98 } from "node:fs";
80506
80509
  import { dirname as dirname24, join as join119 } from "node:path";
80507
- import { fileURLToPath as fileURLToPath6 } from "node:url";
80510
+ import { fileURLToPath as fileURLToPath5 } from "node:url";
80508
80511
 
80509
80512
  // node_modules/.pnpm/citty@0.2.1/node_modules/citty/dist/_chunks/libs/scule.mjs
80510
80513
  var NUMBER_CHAR_RE = /\d/;
@@ -87880,8 +87883,12 @@ var AdminHandler = class {
87880
87883
  }
87881
87884
  case "backup": {
87882
87885
  const result = systemListBackups(projectRoot);
87886
+ if (!result.success || !result.data) {
87887
+ return wrapResult(result, "query", "admin", operation, startTime);
87888
+ }
87889
+ const backups = result.data;
87883
87890
  return wrapResult(
87884
- { success: true, data: { backups: result, count: result.length } },
87891
+ { success: true, data: { backups, count: backups.length } },
87885
87892
  "query",
87886
87893
  "admin",
87887
87894
  operation,
@@ -90704,16 +90711,18 @@ var PipelineHandler = class {
90704
90711
  return wrapResult(result, "query", "pipeline", "phase.list", startTime);
90705
90712
  }
90706
90713
  const listData = result.data;
90714
+ const phases = listData.phases ?? [];
90715
+ const total = listData.summary?.total ?? phases.length;
90707
90716
  const { limit, offset } = getListParams(params);
90708
- const page = paginate(listData.phases, limit, offset);
90717
+ const page = paginate(phases, limit, offset);
90709
90718
  return {
90710
90719
  _meta: dispatchMeta("query", "pipeline", "phase.list", startTime),
90711
90720
  success: true,
90712
90721
  data: {
90713
90722
  ...listData,
90714
90723
  phases: page.items,
90715
- total: listData.summary.total,
90716
- filtered: listData.summary.total
90724
+ total,
90725
+ filtered: total
90717
90726
  },
90718
90727
  page: page.page
90719
90728
  };
@@ -94581,10 +94590,8 @@ init_src();
94581
94590
  init_renderers();
94582
94591
  import { existsSync as existsSync121, readdirSync as readdirSync39, readFileSync as readFileSync95 } from "node:fs";
94583
94592
  import { dirname as dirname22, join as join114 } from "node:path";
94584
- import { fileURLToPath as fileURLToPath5 } from "node:url";
94585
94593
  function findProjectRoot() {
94586
- const currentFile = fileURLToPath5(import.meta.url);
94587
- let currentDir = dirname22(currentFile);
94594
+ let currentDir = process.cwd();
94588
94595
  while (currentDir !== "/") {
94589
94596
  if (existsSync121(join114(currentDir, "package.json"))) {
94590
94597
  return currentDir;
@@ -94598,6 +94605,38 @@ function findProjectRoot() {
94598
94605
  function registerDetectDriftCommand(program) {
94599
94606
  program.command("detect-drift").description("Detect documentation drift against TypeScript source of truth").action(async () => {
94600
94607
  const projectRoot = findProjectRoot();
94608
+ const isCleoRepo = existsSync121(join114(projectRoot, "src", "cli", "commands")) || existsSync121(join114(projectRoot, "packages", "cleo", "src"));
94609
+ if (!isCleoRepo) {
94610
+ const userResult = {
94611
+ summary: { totalChecks: 1, passed: 0, warnings: 0, errors: 0, exitCode: 0 },
94612
+ checks: [],
94613
+ recommendations: []
94614
+ };
94615
+ const injPath = join114(projectRoot, ".cleo", "templates", "CLEO-INJECTION.md");
94616
+ if (existsSync121(injPath)) {
94617
+ const content = safeRead(injPath);
94618
+ userResult.checks.push({
94619
+ name: "Agent injection",
94620
+ status: content.length > 100 ? "pass" : "warn",
94621
+ message: content.length > 100 ? "Agent injection template exists" : "Template appears incomplete",
94622
+ issues: []
94623
+ });
94624
+ userResult.summary.passed = content.length > 100 ? 1 : 0;
94625
+ userResult.summary.warnings = content.length > 100 ? 0 : 1;
94626
+ } else {
94627
+ userResult.checks.push({
94628
+ name: "Agent injection",
94629
+ status: "warn",
94630
+ message: "No injection template found \u2014 run `cleo init` to create one",
94631
+ issues: []
94632
+ });
94633
+ userResult.summary.warnings = 1;
94634
+ }
94635
+ userResult.summary.exitCode = userResult.summary.errors > 0 ? 2 : userResult.summary.warnings > 0 ? 1 : 0;
94636
+ userResult.recommendations.push("detect-drift source checks only apply to the CLEO monorepo. Run from the cleo source tree for full analysis.");
94637
+ cliOutput(userResult, { command: "detect-drift" });
94638
+ process.exit(userResult.summary.exitCode);
94639
+ }
94601
94640
  const result = {
94602
94641
  summary: {
94603
94642
  totalChecks: 0,
@@ -98986,7 +99025,7 @@ function registerWebCommand(program) {
98986
99025
 
98987
99026
  // packages/cleo/src/cli/index.ts
98988
99027
  function getPackageVersion() {
98989
- const pkgPath = join119(dirname24(fileURLToPath6(import.meta.url)), "../../package.json");
99028
+ const pkgPath = join119(dirname24(fileURLToPath5(import.meta.url)), "../../package.json");
98990
99029
  const pkg = JSON.parse(readFileSync98(pkgPath, "utf-8"));
98991
99030
  return pkg.version;
98992
99031
  }