@cleocode/cleo 2026.5.133 → 2026.5.134
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 +276 -9
- package/dist/cli/index.js.map +3 -3
- package/package.json +13 -13
package/dist/cli/index.js
CHANGED
|
@@ -39572,8 +39572,8 @@ var init_consent = __esm({
|
|
|
39572
39572
|
const a = args;
|
|
39573
39573
|
const enableClaudeCode = a["enable-claude-code"] === true;
|
|
39574
39574
|
const disableClaudeCode = a["disable-claude-code"] === true;
|
|
39575
|
-
const
|
|
39576
|
-
if (!enableClaudeCode && !disableClaudeCode && !
|
|
39575
|
+
const showStatus2 = a["status"] === true;
|
|
39576
|
+
if (!enableClaudeCode && !disableClaudeCode && !showStatus2) {
|
|
39577
39577
|
cliError("Specify one of --enable-claude-code, --disable-claude-code, or --status.", 6, {
|
|
39578
39578
|
name: "E_INVALID_INPUT",
|
|
39579
39579
|
fix: "Run `cleo auth consent --status` to see current consent state."
|
|
@@ -39599,7 +39599,7 @@ var init_consent = __esm({
|
|
|
39599
39599
|
const CONSENT_KEY = "auth.claudeCodeConsentGiven";
|
|
39600
39600
|
const SOURCE_ID = "claude-code";
|
|
39601
39601
|
const PROVIDER = "anthropic";
|
|
39602
|
-
if (
|
|
39602
|
+
if (showStatus2) {
|
|
39603
39603
|
const resolved = await getConfigValue3(CONSENT_KEY);
|
|
39604
39604
|
const consentEnabled = resolved.value === true;
|
|
39605
39605
|
const suppressed = isSuppressed(PROVIDER, SOURCE_ID);
|
|
@@ -52107,6 +52107,267 @@ var init_exists = __esm({
|
|
|
52107
52107
|
}
|
|
52108
52108
|
});
|
|
52109
52109
|
|
|
52110
|
+
// packages/cleo/src/cli/commands/exodus.ts
|
|
52111
|
+
var exodus_exports = {};
|
|
52112
|
+
__export(exodus_exports, {
|
|
52113
|
+
exodusCommand: () => exodusCommand
|
|
52114
|
+
});
|
|
52115
|
+
import { resolveDualScopeDbPath } from "@cleocode/core/store/dual-scope-db.js";
|
|
52116
|
+
import {
|
|
52117
|
+
buildExodusPlan,
|
|
52118
|
+
runExodusMigrate,
|
|
52119
|
+
runExodusStatus,
|
|
52120
|
+
runExodusVerify,
|
|
52121
|
+
sourcesPresent
|
|
52122
|
+
} from "@cleocode/core/store/exodus/index.js";
|
|
52123
|
+
function fmtBytes2(n) {
|
|
52124
|
+
if (n < 1024) return `${n} B`;
|
|
52125
|
+
if (n < 1024 * 1024) return `${(n / 1024).toFixed(1)} KB`;
|
|
52126
|
+
return `${(n / 1024 / 1024).toFixed(1)} MB`;
|
|
52127
|
+
}
|
|
52128
|
+
function showStatus() {
|
|
52129
|
+
const result = runExodusStatus(process.cwd());
|
|
52130
|
+
humanInfo("Exodus status:");
|
|
52131
|
+
humanInfo(` Staging dir present: ${result.hasStaging ? result.stagingDir ?? "yes" : "none"}`);
|
|
52132
|
+
humanInfo(` Project cleo.db: ${result.projectDbExists ? "present" : "not yet created"}`);
|
|
52133
|
+
humanInfo(` Global cleo.db: ${result.globalDbExists ? "present" : "not yet created"}`);
|
|
52134
|
+
humanInfo("");
|
|
52135
|
+
humanInfo(" Source DBs:");
|
|
52136
|
+
for (const s of result.sources) {
|
|
52137
|
+
const size = s.exists ? `${(s.bytes / 1024).toFixed(1)} KB` : "-";
|
|
52138
|
+
humanInfo(` ${s.exists ? "\u2713" : "\u2717"} ${s.name.padEnd(22)} ${size.padStart(10)} ${s.path}`);
|
|
52139
|
+
}
|
|
52140
|
+
if (result.journal) {
|
|
52141
|
+
const done = result.journal.tables.filter((t) => t.status === "done").length;
|
|
52142
|
+
const total = result.journal.tables.length;
|
|
52143
|
+
humanInfo("");
|
|
52144
|
+
humanInfo(` Journal: ${done}/${total} tables done, started ${result.journal.startedAt}`);
|
|
52145
|
+
}
|
|
52146
|
+
cliOutput(result, { command: "exodus status" });
|
|
52147
|
+
}
|
|
52148
|
+
var migrateSubCommand, verifySubCommand, statusSubCommand, exodusCommand;
|
|
52149
|
+
var init_exodus = __esm({
|
|
52150
|
+
"packages/cleo/src/cli/commands/exodus.ts"() {
|
|
52151
|
+
"use strict";
|
|
52152
|
+
init_src2();
|
|
52153
|
+
init_define_cli_command();
|
|
52154
|
+
init_subcommand_guard();
|
|
52155
|
+
init_renderers();
|
|
52156
|
+
migrateSubCommand = defineCommand({
|
|
52157
|
+
meta: {
|
|
52158
|
+
name: "migrate",
|
|
52159
|
+
description: "Migrate legacy multi-DB fleet into consolidated dual-scope cleo.db"
|
|
52160
|
+
},
|
|
52161
|
+
args: {
|
|
52162
|
+
"dry-run": {
|
|
52163
|
+
type: "boolean",
|
|
52164
|
+
description: "Preview migration plan without writing anything",
|
|
52165
|
+
default: false
|
|
52166
|
+
},
|
|
52167
|
+
"force-cross-version": {
|
|
52168
|
+
type: "boolean",
|
|
52169
|
+
description: "Skip schema-version guard (AC9 \u2014 use with care)",
|
|
52170
|
+
default: false
|
|
52171
|
+
}
|
|
52172
|
+
},
|
|
52173
|
+
async run({ args }) {
|
|
52174
|
+
const dryRun = args["dry-run"] === true;
|
|
52175
|
+
const forceCrossVersion = args["force-cross-version"] === true;
|
|
52176
|
+
const plan = buildExodusPlan(process.cwd());
|
|
52177
|
+
humanInfo(`Exodus migration plan:`);
|
|
52178
|
+
humanInfo(
|
|
52179
|
+
` Source DBs (${plan.sources.length} total, ${fmtBytes2(plan.totalSourceBytes)} combined):`
|
|
52180
|
+
);
|
|
52181
|
+
for (const s of plan.sources) {
|
|
52182
|
+
humanInfo(` [${s.targetScope.padEnd(7)}] ${s.name.padEnd(20)} ${s.path}`);
|
|
52183
|
+
}
|
|
52184
|
+
humanInfo(` Target project cleo.db: ${plan.projectDbPath}`);
|
|
52185
|
+
humanInfo(` Target global cleo.db: ${plan.globalDbPath}`);
|
|
52186
|
+
humanInfo(` Available disk: ${fmtBytes2(plan.availableBytes)}`);
|
|
52187
|
+
humanInfo(` Required (3\xD7): ${fmtBytes2(3 * plan.totalSourceBytes)}`);
|
|
52188
|
+
humanInfo(` Disk pre-flight: ${plan.diskPreflight ? "PASS" : "FAIL"}`);
|
|
52189
|
+
if (plan.resumeFromStaging) {
|
|
52190
|
+
humanInfo(` Resuming from existing staging: ${plan.stagingDir}`);
|
|
52191
|
+
}
|
|
52192
|
+
if (dryRun) {
|
|
52193
|
+
cliOutput(
|
|
52194
|
+
{
|
|
52195
|
+
kind: "generic",
|
|
52196
|
+
dryRun: true,
|
|
52197
|
+
plan: {
|
|
52198
|
+
sources: plan.sources.map((s) => ({
|
|
52199
|
+
name: s.name,
|
|
52200
|
+
path: s.path,
|
|
52201
|
+
targetScope: s.targetScope
|
|
52202
|
+
})),
|
|
52203
|
+
totalSourceBytes: plan.totalSourceBytes,
|
|
52204
|
+
availableBytes: plan.availableBytes,
|
|
52205
|
+
diskPreflight: plan.diskPreflight,
|
|
52206
|
+
stagingDir: plan.stagingDir,
|
|
52207
|
+
resumeFromStaging: plan.resumeFromStaging,
|
|
52208
|
+
projectDbPath: plan.projectDbPath,
|
|
52209
|
+
globalDbPath: plan.globalDbPath
|
|
52210
|
+
}
|
|
52211
|
+
},
|
|
52212
|
+
{ command: "exodus migrate" }
|
|
52213
|
+
);
|
|
52214
|
+
return;
|
|
52215
|
+
}
|
|
52216
|
+
if (!sourcesPresent(plan.sources)) {
|
|
52217
|
+
cliError(
|
|
52218
|
+
"No legacy source DBs found. Nothing to migrate.",
|
|
52219
|
+
4 /* NOT_FOUND */,
|
|
52220
|
+
{ name: "E_NO_SOURCES" },
|
|
52221
|
+
{ operation: "exodus.migrate" }
|
|
52222
|
+
);
|
|
52223
|
+
process.exitCode = 4 /* NOT_FOUND */;
|
|
52224
|
+
return;
|
|
52225
|
+
}
|
|
52226
|
+
if (!plan.diskPreflight) {
|
|
52227
|
+
cliError(
|
|
52228
|
+
`Insufficient disk space for exodus. Need \u22653\xD7 source size (${fmtBytes2(plan.totalSourceBytes)}), have ${fmtBytes2(plan.availableBytes)}.`,
|
|
52229
|
+
6 /* VALIDATION_ERROR */,
|
|
52230
|
+
{ name: "E_DISK_PREFLIGHT_FAIL" },
|
|
52231
|
+
{ operation: "exodus.migrate" }
|
|
52232
|
+
);
|
|
52233
|
+
process.exitCode = 6 /* VALIDATION_ERROR */;
|
|
52234
|
+
return;
|
|
52235
|
+
}
|
|
52236
|
+
humanInfo("Starting migration\u2026");
|
|
52237
|
+
const result = await runExodusMigrate(plan, forceCrossVersion, (msg) => humanInfo(` ${msg}`));
|
|
52238
|
+
if (!result.ok) {
|
|
52239
|
+
cliError(
|
|
52240
|
+
result.error ?? "Migration failed",
|
|
52241
|
+
1 /* GENERAL_ERROR */,
|
|
52242
|
+
{ name: "E_EXODUS_MIGRATE_FAILED" },
|
|
52243
|
+
{ operation: "exodus.migrate" }
|
|
52244
|
+
);
|
|
52245
|
+
process.exitCode = 1 /* GENERAL_ERROR */;
|
|
52246
|
+
return;
|
|
52247
|
+
}
|
|
52248
|
+
const copied = result.tables.filter((t) => !t.skipped).reduce((n, t) => n + t.rowsCopied, 0);
|
|
52249
|
+
const skipped = result.tables.filter((t) => t.skipped).length;
|
|
52250
|
+
cliOutput(
|
|
52251
|
+
{
|
|
52252
|
+
kind: "generic",
|
|
52253
|
+
ok: true,
|
|
52254
|
+
summary: {
|
|
52255
|
+
tablesProcessed: result.tables.length,
|
|
52256
|
+
rowsCopied: copied,
|
|
52257
|
+
tablesSkipped: skipped,
|
|
52258
|
+
stagingDir: result.stagingDir,
|
|
52259
|
+
backupCount: result.backupPaths.length
|
|
52260
|
+
},
|
|
52261
|
+
tables: result.tables
|
|
52262
|
+
},
|
|
52263
|
+
{
|
|
52264
|
+
command: "exodus migrate",
|
|
52265
|
+
message: `Migration complete. ${result.tables.length} tables processed, ${copied} rows copied.`
|
|
52266
|
+
}
|
|
52267
|
+
);
|
|
52268
|
+
}
|
|
52269
|
+
});
|
|
52270
|
+
verifySubCommand = defineCommand({
|
|
52271
|
+
meta: {
|
|
52272
|
+
name: "verify",
|
|
52273
|
+
description: "Verify row-level equivalence between legacy DBs and consolidated cleo.db"
|
|
52274
|
+
},
|
|
52275
|
+
args: {
|
|
52276
|
+
"show-passing": {
|
|
52277
|
+
type: "boolean",
|
|
52278
|
+
description: "Include passing tables in human output (default: failures only)",
|
|
52279
|
+
default: false
|
|
52280
|
+
}
|
|
52281
|
+
},
|
|
52282
|
+
run({ args }) {
|
|
52283
|
+
const showPassing = args["show-passing"] === true;
|
|
52284
|
+
const plan = buildExodusPlan(process.cwd());
|
|
52285
|
+
const projectDbPath = resolveDualScopeDbPath("project", process.cwd());
|
|
52286
|
+
const globalDbPath = resolveDualScopeDbPath("global");
|
|
52287
|
+
humanInfo("Running equivalence verification\u2026");
|
|
52288
|
+
const result = runExodusVerify(
|
|
52289
|
+
plan.sources,
|
|
52290
|
+
projectDbPath,
|
|
52291
|
+
globalDbPath,
|
|
52292
|
+
(msg) => humanInfo(` ${msg}`)
|
|
52293
|
+
);
|
|
52294
|
+
if (!result.ok && result.error) {
|
|
52295
|
+
cliError(
|
|
52296
|
+
result.error,
|
|
52297
|
+
1 /* GENERAL_ERROR */,
|
|
52298
|
+
{ name: "E_EXODUS_VERIFY_FAILED" },
|
|
52299
|
+
{ operation: "exodus.verify" }
|
|
52300
|
+
);
|
|
52301
|
+
process.exitCode = 1 /* GENERAL_ERROR */;
|
|
52302
|
+
return;
|
|
52303
|
+
}
|
|
52304
|
+
const failures = result.tables.filter((t) => !t.countMatch || !t.hashMatch);
|
|
52305
|
+
const passing = result.tables.filter((t) => t.countMatch && t.hashMatch);
|
|
52306
|
+
if (failures.length > 0) {
|
|
52307
|
+
humanInfo(`
|
|
52308
|
+
Failed tables (${failures.length}):`);
|
|
52309
|
+
for (const t of failures) {
|
|
52310
|
+
humanInfo(
|
|
52311
|
+
` FAIL [${t.scope}] ${t.tableName}: source=${t.sourceCount}, target=${t.targetCount}, hashMatch=${t.hashMatch}`
|
|
52312
|
+
);
|
|
52313
|
+
}
|
|
52314
|
+
}
|
|
52315
|
+
if (showPassing && passing.length > 0) {
|
|
52316
|
+
humanInfo(`
|
|
52317
|
+
Passing tables (${passing.length}):`);
|
|
52318
|
+
for (const t of passing) {
|
|
52319
|
+
humanInfo(` OK [${t.scope}] ${t.tableName}: ${t.sourceCount} rows`);
|
|
52320
|
+
}
|
|
52321
|
+
}
|
|
52322
|
+
cliOutput(
|
|
52323
|
+
{
|
|
52324
|
+
kind: "generic",
|
|
52325
|
+
ok: result.ok,
|
|
52326
|
+
summary: {
|
|
52327
|
+
totalTables: result.tables.length,
|
|
52328
|
+
passing: passing.length,
|
|
52329
|
+
failing: failures.length
|
|
52330
|
+
},
|
|
52331
|
+
failures,
|
|
52332
|
+
...showPassing ? { passing } : {}
|
|
52333
|
+
},
|
|
52334
|
+
{
|
|
52335
|
+
command: "exodus verify",
|
|
52336
|
+
message: result.ok ? `All ${passing.length} tables verified \u2014 equivalence confirmed.` : `${failures.length} table(s) failed equivalence check.`
|
|
52337
|
+
}
|
|
52338
|
+
);
|
|
52339
|
+
if (!result.ok) {
|
|
52340
|
+
process.exitCode = 1 /* GENERAL_ERROR */;
|
|
52341
|
+
}
|
|
52342
|
+
}
|
|
52343
|
+
});
|
|
52344
|
+
statusSubCommand = defineCommand({
|
|
52345
|
+
meta: {
|
|
52346
|
+
name: "status",
|
|
52347
|
+
description: "Show exodus migration status (staging, source DBs, target DBs)"
|
|
52348
|
+
},
|
|
52349
|
+
run() {
|
|
52350
|
+
showStatus();
|
|
52351
|
+
}
|
|
52352
|
+
});
|
|
52353
|
+
exodusCommand = defineCommand({
|
|
52354
|
+
meta: {
|
|
52355
|
+
name: "exodus",
|
|
52356
|
+
description: "[TRANSITIONAL] Migrate legacy multi-DB fleet to consolidated dual-scope cleo.db (SG-DB-SUBSTRATE-V2)"
|
|
52357
|
+
},
|
|
52358
|
+
subCommands: {
|
|
52359
|
+
migrate: migrateSubCommand,
|
|
52360
|
+
verify: verifySubCommand,
|
|
52361
|
+
status: statusSubCommand
|
|
52362
|
+
},
|
|
52363
|
+
async run({ cmd, rawArgs }) {
|
|
52364
|
+
if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
|
|
52365
|
+
showStatus();
|
|
52366
|
+
}
|
|
52367
|
+
});
|
|
52368
|
+
}
|
|
52369
|
+
});
|
|
52370
|
+
|
|
52110
52371
|
// packages/cleo/src/cli/commands/export-tasks.ts
|
|
52111
52372
|
var export_tasks_exports = {};
|
|
52112
52373
|
__export(export_tasks_exports, {
|
|
@@ -74461,18 +74722,18 @@ var COMMAND_MANIFEST = [
|
|
|
74461
74722
|
description: "Claim a task by assigning it to an agent",
|
|
74462
74723
|
load: async () => (await Promise.resolve().then(() => (init_claim(), claim_exports))).claimCommand
|
|
74463
74724
|
},
|
|
74464
|
-
{
|
|
74465
|
-
exportName: "classifyCommand",
|
|
74466
|
-
name: "classify",
|
|
74467
|
-
description: "Classify a task: readiness verdict (proceed|grill) + persona routing (agent, confidence)",
|
|
74468
|
-
load: async () => (await Promise.resolve().then(() => (init_classify(), classify_exports))).classifyCommand
|
|
74469
|
-
},
|
|
74470
74725
|
{
|
|
74471
74726
|
exportName: "unclaimCommand",
|
|
74472
74727
|
name: "unclaim",
|
|
74473
74728
|
description: "Unclaim a task by removing its current assignee",
|
|
74474
74729
|
load: async () => (await Promise.resolve().then(() => (init_claim(), claim_exports))).unclaimCommand
|
|
74475
74730
|
},
|
|
74731
|
+
{
|
|
74732
|
+
exportName: "classifyCommand",
|
|
74733
|
+
name: "classify",
|
|
74734
|
+
description: "Classify a task: readiness verdict (proceed|grill) + persona routing (agent, confidence)",
|
|
74735
|
+
load: async () => (await Promise.resolve().then(() => (init_classify(), classify_exports))).classifyCommand
|
|
74736
|
+
},
|
|
74476
74737
|
{
|
|
74477
74738
|
exportName: "codeCommand",
|
|
74478
74739
|
name: "code",
|
|
@@ -74659,6 +74920,12 @@ var COMMAND_MANIFEST = [
|
|
|
74659
74920
|
description: "Check if a task ID exists (exit 0=exists, 4=not found)",
|
|
74660
74921
|
load: async () => (await Promise.resolve().then(() => (init_exists(), exists_exports))).existsCommand
|
|
74661
74922
|
},
|
|
74923
|
+
{
|
|
74924
|
+
exportName: "exodusCommand",
|
|
74925
|
+
name: "exodus",
|
|
74926
|
+
description: "[TRANSITIONAL] Migrate legacy multi-DB fleet to consolidated dual-scope cleo.db (SG-DB-SUBSTRATE-V2)",
|
|
74927
|
+
load: async () => (await Promise.resolve().then(() => (init_exodus(), exodus_exports))).exodusCommand
|
|
74928
|
+
},
|
|
74662
74929
|
{
|
|
74663
74930
|
exportName: "exportTasksCommand",
|
|
74664
74931
|
name: "export-tasks",
|