@cleocode/cleo 2026.3.62 → 2026.3.64
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/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +5 -2
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/agents.d.ts +31 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +104 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/backfill.d.ts +32 -0
- package/dist/cli/commands/backfill.d.ts.map +1 -0
- package/dist/cli/commands/backfill.js +101 -0
- package/dist/cli/commands/backfill.js.map +1 -0
- package/dist/cli/commands/backup.js +1 -1
- package/dist/cli/commands/backup.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -0
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +26 -0
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +1 -1
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/deps.d.ts +15 -0
- package/dist/cli/commands/deps.d.ts.map +1 -1
- package/dist/cli/commands/deps.js +28 -3
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/detect-drift.d.ts.map +1 -1
- package/dist/cli/commands/detect-drift.js +4 -3
- package/dist/cli/commands/detect-drift.js.map +1 -1
- package/dist/cli/commands/exists.d.ts +15 -0
- package/dist/cli/commands/exists.d.ts.map +1 -1
- package/dist/cli/commands/exists.js +33 -15
- package/dist/cli/commands/exists.js.map +1 -1
- package/dist/cli/commands/issue.d.ts +3 -0
- package/dist/cli/commands/issue.d.ts.map +1 -1
- package/dist/cli/commands/issue.js +23 -21
- package/dist/cli/commands/issue.js.map +1 -1
- package/dist/cli/commands/labels.js +1 -1
- package/dist/cli/commands/labels.js.map +1 -1
- package/dist/cli/commands/phases.js +1 -1
- package/dist/cli/commands/phases.js.map +1 -1
- package/dist/cli/commands/reason.d.ts +35 -0
- package/dist/cli/commands/reason.d.ts.map +1 -0
- package/dist/cli/commands/reason.js +104 -0
- package/dist/cli/commands/reason.js.map +1 -0
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +15 -0
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/stats.d.ts.map +1 -1
- package/dist/cli/commands/stats.js +13 -1
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +8 -2
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +91 -38
- package/dist/cli/index.js.map +3 -3
- package/dist/dispatch/domains/admin.d.ts.map +1 -1
- package/dist/dispatch/domains/admin.js +25 -1
- package/dist/dispatch/domains/admin.js.map +1 -1
- package/dist/dispatch/domains/check.d.ts.map +1 -1
- package/dist/dispatch/domains/check.js +15 -1
- package/dist/dispatch/domains/check.js.map +1 -1
- package/dist/dispatch/domains/tasks.d.ts.map +1 -1
- package/dist/dispatch/domains/tasks.js +17 -1
- package/dist/dispatch/domains/tasks.js.map +1 -1
- package/dist/dispatch/engines/config-engine.d.ts +11 -0
- package/dist/dispatch/engines/config-engine.d.ts.map +1 -1
- package/dist/dispatch/engines/config-engine.js +26 -1
- package/dist/dispatch/engines/config-engine.js.map +1 -1
- package/dist/dispatch/engines/session-engine.d.ts.map +1 -1
- package/dist/dispatch/engines/session-engine.js +9 -5
- package/dist/dispatch/engines/session-engine.js.map +1 -1
- package/dist/dispatch/engines/system-engine.d.ts +6 -1
- package/dist/dispatch/engines/system-engine.d.ts.map +1 -1
- package/dist/dispatch/engines/system-engine.js +14 -1
- package/dist/dispatch/engines/system-engine.js.map +1 -1
- package/dist/dispatch/engines/task-engine.d.ts +19 -1
- package/dist/dispatch/engines/task-engine.d.ts.map +1 -1
- package/dist/dispatch/engines/task-engine.js +31 -2
- package/dist/dispatch/engines/task-engine.js.map +1 -1
- package/dist/dispatch/lib/engine.d.ts +3 -3
- package/dist/dispatch/lib/engine.d.ts.map +1 -1
- package/dist/dispatch/lib/engine.js +3 -3
- package/dist/dispatch/lib/engine.js.map +1 -1
- package/dist/dispatch/registry.d.ts.map +1 -1
- package/dist/dispatch/registry.js +81 -0
- package/dist/dispatch/registry.js.map +1 -1
- package/dist/mcp/index.js +37 -4
- package/dist/mcp/index.js.map +3 -3
- package/package.json +3 -3
package/dist/cli/index.js
CHANGED
|
@@ -10670,6 +10670,25 @@ function runBrainMigrations(nativeDb, db) {
|
|
|
10670
10670
|
);
|
|
10671
10671
|
}
|
|
10672
10672
|
}
|
|
10673
|
+
if (tableExists(nativeDb, "__drizzle_migrations") && tableExists(nativeDb, "brain_decisions")) {
|
|
10674
|
+
const localMigrations = readMigrationFiles({ migrationsFolder });
|
|
10675
|
+
const localHashes = new Set(localMigrations.map((m) => m.hash));
|
|
10676
|
+
const dbEntries = nativeDb.prepare('SELECT hash FROM "__drizzle_migrations"').all();
|
|
10677
|
+
const hasOrphanedEntries = dbEntries.some((e) => !localHashes.has(e.hash));
|
|
10678
|
+
if (hasOrphanedEntries) {
|
|
10679
|
+
const log11 = getLogger("brain");
|
|
10680
|
+
log11.warn(
|
|
10681
|
+
{ orphaned: dbEntries.filter((e) => !localHashes.has(e.hash)).length },
|
|
10682
|
+
"Detected stale migration journal entries from a previous CLEO version. Reconciling brain.db."
|
|
10683
|
+
);
|
|
10684
|
+
nativeDb.exec('DELETE FROM "__drizzle_migrations"');
|
|
10685
|
+
for (const m of localMigrations) {
|
|
10686
|
+
nativeDb.exec(
|
|
10687
|
+
`INSERT INTO "__drizzle_migrations" ("hash", "created_at") VALUES ('${m.hash}', ${m.folderMillis})`
|
|
10688
|
+
);
|
|
10689
|
+
}
|
|
10690
|
+
}
|
|
10691
|
+
}
|
|
10673
10692
|
const MAX_RETRIES = 5;
|
|
10674
10693
|
const BASE_DELAY_MS = 100;
|
|
10675
10694
|
const MAX_DELAY_MS = 2e3;
|
|
@@ -10777,6 +10796,7 @@ var init_brain_sqlite = __esm({
|
|
|
10777
10796
|
init_migrator();
|
|
10778
10797
|
init_node_sqlite();
|
|
10779
10798
|
init_migrator2();
|
|
10799
|
+
init_logger();
|
|
10780
10800
|
init_paths();
|
|
10781
10801
|
init_brain_schema();
|
|
10782
10802
|
init_sqlite2();
|
|
@@ -15391,6 +15411,9 @@ function createPage(input) {
|
|
|
15391
15411
|
};
|
|
15392
15412
|
}
|
|
15393
15413
|
function paginate(items, limit, offset) {
|
|
15414
|
+
if (!items || items.length === 0) {
|
|
15415
|
+
return { items: [], page: { mode: "none" } };
|
|
15416
|
+
}
|
|
15394
15417
|
const total = items.length;
|
|
15395
15418
|
if (limit === void 0 && offset === void 0) {
|
|
15396
15419
|
return { items, page: { mode: "none" } };
|
|
@@ -80484,7 +80507,7 @@ var init_hooks_engine = __esm({
|
|
|
80484
80507
|
// packages/cleo/src/cli/index.ts
|
|
80485
80508
|
import { readFileSync as readFileSync98 } from "node:fs";
|
|
80486
80509
|
import { dirname as dirname24, join as join119 } from "node:path";
|
|
80487
|
-
import { fileURLToPath as
|
|
80510
|
+
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
80488
80511
|
|
|
80489
80512
|
// node_modules/.pnpm/citty@0.2.1/node_modules/citty/dist/_chunks/libs/scule.mjs
|
|
80490
80513
|
var NUMBER_CHAR_RE = /\d/;
|
|
@@ -86561,14 +86584,19 @@ async function taskCreate(projectRoot, params) {
|
|
|
86561
86584
|
size: params.size,
|
|
86562
86585
|
acceptance: params.acceptance,
|
|
86563
86586
|
notes: params.notes,
|
|
86564
|
-
files: params.files
|
|
86587
|
+
files: params.files,
|
|
86588
|
+
dryRun: params.dryRun
|
|
86565
86589
|
},
|
|
86566
86590
|
projectRoot,
|
|
86567
86591
|
accessor
|
|
86568
86592
|
);
|
|
86569
86593
|
return {
|
|
86570
86594
|
success: true,
|
|
86571
|
-
data: {
|
|
86595
|
+
data: {
|
|
86596
|
+
task: taskToRecord(result.task),
|
|
86597
|
+
duplicate: result.duplicate ?? false,
|
|
86598
|
+
dryRun: params.dryRun
|
|
86599
|
+
}
|
|
86572
86600
|
};
|
|
86573
86601
|
} catch (err) {
|
|
86574
86602
|
const cleoErr = err;
|
|
@@ -87855,8 +87883,12 @@ var AdminHandler = class {
|
|
|
87855
87883
|
}
|
|
87856
87884
|
case "backup": {
|
|
87857
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;
|
|
87858
87890
|
return wrapResult(
|
|
87859
|
-
{ success: true, data: { backups
|
|
87891
|
+
{ success: true, data: { backups, count: backups.length } },
|
|
87860
87892
|
"query",
|
|
87861
87893
|
"admin",
|
|
87862
87894
|
operation,
|
|
@@ -91805,7 +91837,8 @@ var TasksHandler = class {
|
|
|
91805
91837
|
phase: params?.phase,
|
|
91806
91838
|
size: params?.size,
|
|
91807
91839
|
notes: params?.notes,
|
|
91808
|
-
files: params?.files
|
|
91840
|
+
files: params?.files,
|
|
91841
|
+
dryRun: params?.dryRun
|
|
91809
91842
|
});
|
|
91810
91843
|
return wrapResult(result, "mutate", "tasks", operation, startTime);
|
|
91811
91844
|
}
|
|
@@ -94555,10 +94588,8 @@ init_src();
|
|
|
94555
94588
|
init_renderers();
|
|
94556
94589
|
import { existsSync as existsSync121, readdirSync as readdirSync39, readFileSync as readFileSync95 } from "node:fs";
|
|
94557
94590
|
import { dirname as dirname22, join as join114 } from "node:path";
|
|
94558
|
-
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
94559
94591
|
function findProjectRoot() {
|
|
94560
|
-
|
|
94561
|
-
let currentDir = dirname22(currentFile);
|
|
94592
|
+
let currentDir = process.cwd();
|
|
94562
94593
|
while (currentDir !== "/") {
|
|
94563
94594
|
if (existsSync121(join114(currentDir, "package.json"))) {
|
|
94564
94595
|
return currentDir;
|
|
@@ -97930,6 +97961,20 @@ function registerSessionCommand(program) {
|
|
|
97930
97961
|
{ command: "session", operation: "session.resume" }
|
|
97931
97962
|
);
|
|
97932
97963
|
});
|
|
97964
|
+
session.command("find").description("Find sessions (lightweight discovery \u2014 minimal fields, low context cost)").option("--status <status>", "Filter by status (active|ended|orphaned)").option("--scope <scope>", 'Filter by scope (e.g. "epic:T001" or "global")').option("--query <query>", "Fuzzy match on session name or ID").option("--limit <n>", "Max results", parseInt).action(async (opts) => {
|
|
97965
|
+
await dispatchFromCli(
|
|
97966
|
+
"query",
|
|
97967
|
+
"session",
|
|
97968
|
+
"find",
|
|
97969
|
+
{
|
|
97970
|
+
status: opts["status"],
|
|
97971
|
+
scope: opts["scope"],
|
|
97972
|
+
query: opts["query"],
|
|
97973
|
+
limit: opts["limit"]
|
|
97974
|
+
},
|
|
97975
|
+
{ command: "session", operation: "session.find" }
|
|
97976
|
+
);
|
|
97977
|
+
});
|
|
97933
97978
|
session.command("list").description("List sessions").option("--status <status>", "Filter by status (active|ended|orphaned)").option("--limit <n>", "Max results", parseInt).option("--offset <n>", "Skip first n results", parseInt).action(async (opts) => {
|
|
97934
97979
|
await dispatchFromCli(
|
|
97935
97980
|
"query",
|
|
@@ -98946,7 +98991,7 @@ function registerWebCommand(program) {
|
|
|
98946
98991
|
|
|
98947
98992
|
// packages/cleo/src/cli/index.ts
|
|
98948
98993
|
function getPackageVersion() {
|
|
98949
|
-
const pkgPath = join119(dirname24(
|
|
98994
|
+
const pkgPath = join119(dirname24(fileURLToPath5(import.meta.url)), "../../package.json");
|
|
98950
98995
|
const pkg = JSON.parse(readFileSync98(pkgPath, "utf-8"));
|
|
98951
98996
|
return pkg.version;
|
|
98952
98997
|
}
|
|
@@ -99072,41 +99117,49 @@ function shimToCitty(shim) {
|
|
|
99072
99117
|
subCommands2[alias] = shimToCitty(sub);
|
|
99073
99118
|
}
|
|
99074
99119
|
}
|
|
99120
|
+
const hasSubCommands = Object.keys(subCommands2).length > 0;
|
|
99121
|
+
const subCommandNames = new Set(
|
|
99122
|
+
shim._subcommands.flatMap((s) => [s._name, ...s._aliases].filter(Boolean))
|
|
99123
|
+
);
|
|
99124
|
+
const runFn = async (context) => {
|
|
99125
|
+
const { args } = context;
|
|
99126
|
+
if (hasSubCommands && context.rawArgs.some((a) => subCommandNames.has(a))) {
|
|
99127
|
+
return;
|
|
99128
|
+
}
|
|
99129
|
+
if (shim._action) {
|
|
99130
|
+
const positionalValues = [];
|
|
99131
|
+
for (const arg of shim._args) {
|
|
99132
|
+
positionalValues.push(args[arg.name]);
|
|
99133
|
+
}
|
|
99134
|
+
const opts = {};
|
|
99135
|
+
for (const opt of shim._options) {
|
|
99136
|
+
const val = args[opt.longName];
|
|
99137
|
+
if (val !== void 0 && val !== false) {
|
|
99138
|
+
if (opt.parseFn && typeof val === "string") {
|
|
99139
|
+
opts[opt.longName] = opt.parseFn(val);
|
|
99140
|
+
} else {
|
|
99141
|
+
opts[opt.longName] = val;
|
|
99142
|
+
}
|
|
99143
|
+
}
|
|
99144
|
+
}
|
|
99145
|
+
await shim._action(...positionalValues, opts, shim);
|
|
99146
|
+
} else if (shim._subcommands.length > 0) {
|
|
99147
|
+
const defaultSub = shim._subcommands.find((s) => s._isDefault);
|
|
99148
|
+
if (defaultSub?._action) {
|
|
99149
|
+
await defaultSub._action({}, defaultSub);
|
|
99150
|
+
} else {
|
|
99151
|
+
await showUsage(context.cmd);
|
|
99152
|
+
}
|
|
99153
|
+
}
|
|
99154
|
+
};
|
|
99075
99155
|
const cittyDef = defineCommand({
|
|
99076
99156
|
meta: {
|
|
99077
99157
|
name: shim._name,
|
|
99078
99158
|
description: shim._description
|
|
99079
99159
|
},
|
|
99080
99160
|
args: cittyArgs,
|
|
99081
|
-
...
|
|
99082
|
-
|
|
99083
|
-
const { args } = context;
|
|
99084
|
-
if (shim._action) {
|
|
99085
|
-
const positionalValues = [];
|
|
99086
|
-
for (const arg of shim._args) {
|
|
99087
|
-
positionalValues.push(args[arg.name]);
|
|
99088
|
-
}
|
|
99089
|
-
const opts = {};
|
|
99090
|
-
for (const opt of shim._options) {
|
|
99091
|
-
const val = args[opt.longName];
|
|
99092
|
-
if (val !== void 0 && val !== false) {
|
|
99093
|
-
if (opt.parseFn && typeof val === "string") {
|
|
99094
|
-
opts[opt.longName] = opt.parseFn(val);
|
|
99095
|
-
} else {
|
|
99096
|
-
opts[opt.longName] = val;
|
|
99097
|
-
}
|
|
99098
|
-
}
|
|
99099
|
-
}
|
|
99100
|
-
await shim._action(...positionalValues, opts, shim);
|
|
99101
|
-
} else if (shim._subcommands.length > 0) {
|
|
99102
|
-
const defaultSub = shim._subcommands.find((s) => s._isDefault);
|
|
99103
|
-
if (defaultSub?._action) {
|
|
99104
|
-
await defaultSub._action({}, defaultSub);
|
|
99105
|
-
} else {
|
|
99106
|
-
await showUsage(context.cmd);
|
|
99107
|
-
}
|
|
99108
|
-
}
|
|
99109
|
-
}
|
|
99161
|
+
...hasSubCommands ? { subCommands: subCommands2 } : {},
|
|
99162
|
+
run: runFn
|
|
99110
99163
|
});
|
|
99111
99164
|
return cittyDef;
|
|
99112
99165
|
}
|