@cleocode/cleo 2026.6.8 → 2026.6.10
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 +260 -171
- package/dist/cli/index.js.map +3 -3
- package/package.json +12 -12
package/dist/cli/index.js
CHANGED
|
@@ -18965,6 +18965,7 @@ Recovery command: cleo docs update {slug} --file <your-file>`;
|
|
|
18965
18965
|
refCount: doc.refCount,
|
|
18966
18966
|
...doc.slug ? { slug: doc.slug } : {},
|
|
18967
18967
|
...doc.kind ? { type: doc.kind } : {},
|
|
18968
|
+
...doc.displayNumber !== null ? { displayNumber: doc.displayNumber } : {},
|
|
18968
18969
|
ownerId: doc.ownerId,
|
|
18969
18970
|
ownerType: doc.ownerType
|
|
18970
18971
|
}));
|
|
@@ -19013,7 +19014,8 @@ Recovery command: cleo docs update {slug} --file <your-file>`;
|
|
|
19013
19014
|
// Surface the real attachment ref_count (T11572) — see project-scope note.
|
|
19014
19015
|
refCount: doc.refCount,
|
|
19015
19016
|
...doc.slug ? { slug: doc.slug } : {},
|
|
19016
|
-
...doc.kind ? { type: doc.kind } : {}
|
|
19017
|
+
...doc.kind ? { type: doc.kind } : {},
|
|
19018
|
+
...doc.displayNumber !== null ? { displayNumber: doc.displayNumber } : {}
|
|
19017
19019
|
}));
|
|
19018
19020
|
projectedOwner.sort(
|
|
19019
19021
|
(a, b) => comparator(
|
|
@@ -19216,7 +19218,8 @@ Recovery command: cleo docs update {slug} --file <your-file>`;
|
|
|
19216
19218
|
createdAt: doc.createdAt,
|
|
19217
19219
|
refCount: 0,
|
|
19218
19220
|
...doc.slug ? { slug: doc.slug } : {},
|
|
19219
|
-
...doc.kind ? { type: doc.kind } : {}
|
|
19221
|
+
...doc.kind ? { type: doc.kind } : {},
|
|
19222
|
+
...doc.displayNumber !== null ? { displayNumber: doc.displayNumber } : {}
|
|
19220
19223
|
},
|
|
19221
19224
|
path: storagePath,
|
|
19222
19225
|
sizeBytes: contentBytes.length,
|
|
@@ -28407,8 +28410,8 @@ async function loadPlaybookByName(name) {
|
|
|
28407
28410
|
return null;
|
|
28408
28411
|
}
|
|
28409
28412
|
try {
|
|
28410
|
-
const { getProjectRoot:
|
|
28411
|
-
const projectRoot = __playbookRuntimeOverrides.projectRoot ??
|
|
28413
|
+
const { getProjectRoot: getProjectRoot60 } = await import("@cleocode/core/internal");
|
|
28414
|
+
const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot60();
|
|
28412
28415
|
const resolved = resolvePlaybook(name, {
|
|
28413
28416
|
projectRoot,
|
|
28414
28417
|
globalPlaybooksDir: __playbookRuntimeOverrides.globalPlaybooksDir,
|
|
@@ -28452,8 +28455,8 @@ async function acquireDb() {
|
|
|
28452
28455
|
async function buildDefaultDispatcher() {
|
|
28453
28456
|
if (__playbookRuntimeOverrides.dispatcher) return __playbookRuntimeOverrides.dispatcher;
|
|
28454
28457
|
const { orchestrateSpawnExecute: orchestrateSpawnExecute2 } = await import("@cleocode/runtime/gateway");
|
|
28455
|
-
const { getProjectRoot:
|
|
28456
|
-
const projectRoot =
|
|
28458
|
+
const { getProjectRoot: getProjectRoot60, createToolGuard, runSkillNodeOrSpawn } = await import("@cleocode/core/internal");
|
|
28459
|
+
const projectRoot = getProjectRoot60();
|
|
28457
28460
|
const tools = createToolGuard({ allowedRoots: [projectRoot] });
|
|
28458
28461
|
const spawn5 = async (input2) => {
|
|
28459
28462
|
const result = await orchestrateSpawnExecute2(
|
|
@@ -28650,8 +28653,8 @@ var init_playbook2 = __esm({
|
|
|
28650
28653
|
projectRoot = __playbookRuntimeOverrides.projectRoot;
|
|
28651
28654
|
} else {
|
|
28652
28655
|
try {
|
|
28653
|
-
const { getProjectRoot:
|
|
28654
|
-
projectRoot =
|
|
28656
|
+
const { getProjectRoot: getProjectRoot60 } = await import("@cleocode/core/internal");
|
|
28657
|
+
projectRoot = getProjectRoot60();
|
|
28655
28658
|
} catch {
|
|
28656
28659
|
projectRoot = void 0;
|
|
28657
28660
|
}
|
|
@@ -28715,14 +28718,14 @@ var init_playbook2 = __esm({
|
|
|
28715
28718
|
const dispatcher = await buildDefaultDispatcher();
|
|
28716
28719
|
let result;
|
|
28717
28720
|
try {
|
|
28718
|
-
const { getProjectRoot:
|
|
28721
|
+
const { getProjectRoot: getProjectRoot60 } = await import("@cleocode/core/internal");
|
|
28719
28722
|
const opts = {
|
|
28720
28723
|
db,
|
|
28721
28724
|
playbook: parsed.definition,
|
|
28722
28725
|
playbookHash: parsed.sourceHash,
|
|
28723
28726
|
initialContext,
|
|
28724
28727
|
dispatcher,
|
|
28725
|
-
projectRoot:
|
|
28728
|
+
projectRoot: getProjectRoot60()
|
|
28726
28729
|
};
|
|
28727
28730
|
if (__playbookRuntimeOverrides.approvalSecret !== void 0) {
|
|
28728
28731
|
opts.approvalSecret = __playbookRuntimeOverrides.approvalSecret;
|
|
@@ -35432,11 +35435,11 @@ var init_security = __esm({
|
|
|
35432
35435
|
});
|
|
35433
35436
|
|
|
35434
35437
|
// packages/cleo/src/dispatch/middleware/sanitizer.ts
|
|
35435
|
-
function createSanitizer(
|
|
35438
|
+
function createSanitizer(getProjectRoot60) {
|
|
35436
35439
|
return async (req, next) => {
|
|
35437
35440
|
if (req.params) {
|
|
35438
35441
|
try {
|
|
35439
|
-
const root =
|
|
35442
|
+
const root = getProjectRoot60 ? getProjectRoot60() : void 0;
|
|
35440
35443
|
req.params = sanitizeParams(req.params, root, {
|
|
35441
35444
|
domain: req.domain,
|
|
35442
35445
|
operation: req.operation
|
|
@@ -41267,9 +41270,9 @@ var init_backup = __esm({
|
|
|
41267
41270
|
async run({ args }) {
|
|
41268
41271
|
const scope = args.scope;
|
|
41269
41272
|
const { packBundle } = await import("@cleocode/core/store/backup-pack.js");
|
|
41270
|
-
const { getProjectRoot:
|
|
41273
|
+
const { getProjectRoot: getProjectRoot60 } = await import("@cleocode/core");
|
|
41271
41274
|
const includesProject = scope === "project" || scope === "all";
|
|
41272
|
-
const projectRoot = includesProject ?
|
|
41275
|
+
const projectRoot = includesProject ? getProjectRoot60() : void 0;
|
|
41273
41276
|
let passphrase;
|
|
41274
41277
|
if (args.encrypt === true) {
|
|
41275
41278
|
passphrase = process.env["CLEO_BACKUP_PASSPHRASE"];
|
|
@@ -41345,12 +41348,12 @@ var init_backup = __esm({
|
|
|
41345
41348
|
},
|
|
41346
41349
|
async run({ args }) {
|
|
41347
41350
|
const bundlePath = args.bundle;
|
|
41348
|
-
const { getProjectRoot:
|
|
41351
|
+
const { getProjectRoot: getProjectRoot60, getCleoHome: getCleoHome6, getCleoVersion } = await import("@cleocode/core");
|
|
41349
41352
|
const { BundleError, cleanupStaging, unpackBundle } = await import("@cleocode/core/store/backup-unpack.js");
|
|
41350
41353
|
const { regenerateConfigJson, regenerateProjectContextJson, regenerateProjectInfoJson } = await import("@cleocode/core/store/regenerators.js");
|
|
41351
41354
|
const { regenerateAndCompare } = await import("@cleocode/core/store/restore-json-merge.js");
|
|
41352
41355
|
const { buildConflictReport, writeConflictReport } = await import("@cleocode/core/store/restore-conflict-report.js");
|
|
41353
|
-
const projectRoot =
|
|
41356
|
+
const projectRoot = getProjectRoot60();
|
|
41354
41357
|
if (args.force !== true) {
|
|
41355
41358
|
const existing = checkForExistingData(projectRoot, getCleoHome6());
|
|
41356
41359
|
if (existing.length > 0) {
|
|
@@ -47446,6 +47449,89 @@ var init_graph2 = __esm({
|
|
|
47446
47449
|
}
|
|
47447
47450
|
});
|
|
47448
47451
|
|
|
47452
|
+
// packages/cleo/src/cli/commands/docs/set-alias.ts
|
|
47453
|
+
import { CleoError as CleoError4, getProjectRoot as getProjectRoot37, setDisplayAlias } from "@cleocode/core/internal";
|
|
47454
|
+
var setAliasCommand;
|
|
47455
|
+
var init_set_alias = __esm({
|
|
47456
|
+
"packages/cleo/src/cli/commands/docs/set-alias.ts"() {
|
|
47457
|
+
"use strict";
|
|
47458
|
+
init_src2();
|
|
47459
|
+
init_define_cli_command();
|
|
47460
|
+
init_renderers();
|
|
47461
|
+
setAliasCommand = defineCommand({
|
|
47462
|
+
meta: {
|
|
47463
|
+
name: "set-alias",
|
|
47464
|
+
description: "Assign an explicit display-alias number to a doc, decoupled from its slug (e.g. `cleo docs set-alias adr-051-override-patterns 091`). The number must be unique among type=adr docs. Pass --clear to remove an existing alias (revert to the slug-derived number)."
|
|
47465
|
+
},
|
|
47466
|
+
args: {
|
|
47467
|
+
slug: {
|
|
47468
|
+
type: "positional",
|
|
47469
|
+
description: "Canonical doc slug to alias (e.g. adr-051-override-patterns). Required.",
|
|
47470
|
+
required: true
|
|
47471
|
+
},
|
|
47472
|
+
number: {
|
|
47473
|
+
type: "positional",
|
|
47474
|
+
description: "The display-alias number to assign (positive integer). Omit with --clear.",
|
|
47475
|
+
required: false
|
|
47476
|
+
},
|
|
47477
|
+
clear: {
|
|
47478
|
+
type: "boolean",
|
|
47479
|
+
description: "Clear any existing alias instead of setting one (revert to slug-derived)."
|
|
47480
|
+
}
|
|
47481
|
+
},
|
|
47482
|
+
async run({ args }) {
|
|
47483
|
+
const slug = String(args.slug);
|
|
47484
|
+
const clear = Boolean(args.clear);
|
|
47485
|
+
let displayAlias;
|
|
47486
|
+
if (clear) {
|
|
47487
|
+
displayAlias = null;
|
|
47488
|
+
} else {
|
|
47489
|
+
const raw = args.number;
|
|
47490
|
+
if (raw === void 0 || raw === null || String(raw).trim() === "") {
|
|
47491
|
+
cliError(
|
|
47492
|
+
"a positive integer <number> is required (or pass --clear to remove the alias)",
|
|
47493
|
+
6 /* VALIDATION_ERROR */,
|
|
47494
|
+
{ name: "E_VALIDATION" }
|
|
47495
|
+
);
|
|
47496
|
+
process.exit(6 /* VALIDATION_ERROR */);
|
|
47497
|
+
return;
|
|
47498
|
+
}
|
|
47499
|
+
const parsed = Number.parseInt(String(raw), 10);
|
|
47500
|
+
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
47501
|
+
cliError(
|
|
47502
|
+
`<number> must be a positive integer (got '${String(raw)}')`,
|
|
47503
|
+
6 /* VALIDATION_ERROR */,
|
|
47504
|
+
{ name: "E_VALIDATION" }
|
|
47505
|
+
);
|
|
47506
|
+
process.exit(6 /* VALIDATION_ERROR */);
|
|
47507
|
+
return;
|
|
47508
|
+
}
|
|
47509
|
+
displayAlias = parsed;
|
|
47510
|
+
}
|
|
47511
|
+
try {
|
|
47512
|
+
const result = await setDisplayAlias(getProjectRoot37(), { slug, displayAlias });
|
|
47513
|
+
cliOutput(result, { command: "docs set-alias", operation: "docs.set-alias" });
|
|
47514
|
+
} catch (err) {
|
|
47515
|
+
if (err instanceof CleoError4) {
|
|
47516
|
+
cliError(err.message, err.code, {
|
|
47517
|
+
name: typeof err.details?.["code"] === "string" ? err.details["code"] : "E_DOCS_SET_ALIAS",
|
|
47518
|
+
...err.fix ? { fix: err.fix } : {},
|
|
47519
|
+
...err.details ? { details: err.details } : {}
|
|
47520
|
+
});
|
|
47521
|
+
process.exit(err.code);
|
|
47522
|
+
return;
|
|
47523
|
+
}
|
|
47524
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
47525
|
+
cliError(`docs set-alias failed: ${message}`, 1 /* GENERAL_ERROR */, {
|
|
47526
|
+
name: "E_DOCS_SET_ALIAS_FAILED"
|
|
47527
|
+
});
|
|
47528
|
+
process.exit(1 /* GENERAL_ERROR */);
|
|
47529
|
+
}
|
|
47530
|
+
}
|
|
47531
|
+
});
|
|
47532
|
+
}
|
|
47533
|
+
});
|
|
47534
|
+
|
|
47449
47535
|
// packages/cleo/src/viewer/pidfile.ts
|
|
47450
47536
|
import { mkdir, readFile as readFile3, unlink, writeFile } from "node:fs/promises";
|
|
47451
47537
|
import { dirname as dirname6, join as join18 } from "node:path";
|
|
@@ -47555,7 +47641,7 @@ import { dirname as dirname7, join as join19, normalize, resolve as resolve4 } f
|
|
|
47555
47641
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
47556
47642
|
import {
|
|
47557
47643
|
createAttachmentStore as createAttachmentStore4,
|
|
47558
|
-
getProjectRoot as
|
|
47644
|
+
getProjectRoot as getProjectRoot38,
|
|
47559
47645
|
searchAllProjectDocs as searchAllProjectDocs2
|
|
47560
47646
|
} from "@cleocode/core/internal";
|
|
47561
47647
|
function getViewerAssetsDir() {
|
|
@@ -47615,7 +47701,7 @@ async function serveStatic(res, assetsDir, relPath) {
|
|
|
47615
47701
|
}
|
|
47616
47702
|
}
|
|
47617
47703
|
function buildViewerHandler(opts = {}) {
|
|
47618
|
-
const projectRoot = opts.projectRoot ??
|
|
47704
|
+
const projectRoot = opts.projectRoot ?? getProjectRoot38();
|
|
47619
47705
|
const assetsDir = getViewerAssetsDir();
|
|
47620
47706
|
const store = createAttachmentStore4();
|
|
47621
47707
|
return async (req, res) => {
|
|
@@ -48243,14 +48329,14 @@ import { dirname as dirname8, isAbsolute as isAbsolute2, join as join21, resolve
|
|
|
48243
48329
|
import { pushWarning as pushWarning3 } from "@cleocode/core";
|
|
48244
48330
|
import { createDocsReadModel as createDocsReadModel2 } from "@cleocode/core/docs/docs-read-model";
|
|
48245
48331
|
import {
|
|
48246
|
-
CleoError as
|
|
48332
|
+
CleoError as CleoError5,
|
|
48247
48333
|
CounterMismatchError,
|
|
48248
48334
|
checkSlugSimilarity,
|
|
48249
48335
|
DEFAULT_SIMILARITY_MODE,
|
|
48250
48336
|
DEFAULT_SIMILARITY_THRESHOLD,
|
|
48251
48337
|
detectStrayCleoDb as detectStrayCleoDb2,
|
|
48252
48338
|
getAgentOutputsAbsolute,
|
|
48253
|
-
getProjectRoot as
|
|
48339
|
+
getProjectRoot as getProjectRoot39,
|
|
48254
48340
|
readJson,
|
|
48255
48341
|
resolveWorktreeFilePath,
|
|
48256
48342
|
resolveWorktreeRouting as resolveWorktreeRouting4
|
|
@@ -48405,6 +48491,7 @@ var init_docs3 = __esm({
|
|
|
48405
48491
|
init_renderers();
|
|
48406
48492
|
init_audit3();
|
|
48407
48493
|
init_graph2();
|
|
48494
|
+
init_set_alias();
|
|
48408
48495
|
init_docs_viewer();
|
|
48409
48496
|
docsOutputFlagHelp = " --json Emit the canonical LAFS JSON envelope (also accepted as a global flag)\n --output <mode> Re-render the result as envelope|id|table|count|silent (also accepted as a global flag)";
|
|
48410
48497
|
docsOutputArgs = {
|
|
@@ -48548,7 +48635,7 @@ var init_docs3 = __esm({
|
|
|
48548
48635
|
resolvedFile = resolveWorktreeFilePath(String(fileArg), routing);
|
|
48549
48636
|
}
|
|
48550
48637
|
if (args.slug && args.type) {
|
|
48551
|
-
const projectRoot = await
|
|
48638
|
+
const projectRoot = await getProjectRoot39();
|
|
48552
48639
|
let warnThreshold = DEFAULT_SIMILARITY_THRESHOLD;
|
|
48553
48640
|
let mode = DEFAULT_SIMILARITY_MODE;
|
|
48554
48641
|
try {
|
|
@@ -48965,7 +49052,7 @@ var init_docs3 = __esm({
|
|
|
48965
49052
|
const taskId = String(args.task);
|
|
48966
49053
|
const includeAttachments = args["include-attachments"] !== false;
|
|
48967
49054
|
const includeMemoryRefs = args["include-memory-refs"] === true;
|
|
48968
|
-
const projectRoot =
|
|
49055
|
+
const projectRoot = getProjectRoot39();
|
|
48969
49056
|
try {
|
|
48970
49057
|
const result = await dispatchDocsRaw("query", "llm-output", {
|
|
48971
49058
|
mode: "task-export",
|
|
@@ -49036,7 +49123,7 @@ var init_docs3 = __esm({
|
|
|
49036
49123
|
},
|
|
49037
49124
|
async run({ args }) {
|
|
49038
49125
|
const forId = String(args.for);
|
|
49039
|
-
const projectRoot =
|
|
49126
|
+
const projectRoot = getProjectRoot39();
|
|
49040
49127
|
try {
|
|
49041
49128
|
const result = await dispatchDocsRaw("query", "llm-output", {
|
|
49042
49129
|
for: forId,
|
|
@@ -49113,7 +49200,7 @@ var init_docs3 = __esm({
|
|
|
49113
49200
|
},
|
|
49114
49201
|
async run({ args }) {
|
|
49115
49202
|
const forId = String(args.for);
|
|
49116
|
-
const projectRoot =
|
|
49203
|
+
const projectRoot = getProjectRoot39();
|
|
49117
49204
|
try {
|
|
49118
49205
|
const result = await dispatchDocsRaw("query", "llm-output", {
|
|
49119
49206
|
for: forId,
|
|
@@ -49339,7 +49426,7 @@ var init_docs3 = __esm({
|
|
|
49339
49426
|
}
|
|
49340
49427
|
},
|
|
49341
49428
|
async run({ args }) {
|
|
49342
|
-
const projectRoot =
|
|
49429
|
+
const projectRoot = getProjectRoot39();
|
|
49343
49430
|
const rawStrategy = args.strategy ?? "three-way";
|
|
49344
49431
|
const strategy = rawStrategy === "cherry-pick" || rawStrategy === "multi-diff" ? rawStrategy : "three-way";
|
|
49345
49432
|
try {
|
|
@@ -49919,7 +50006,7 @@ var init_docs3 = __esm({
|
|
|
49919
50006
|
});
|
|
49920
50007
|
if (args.strict && anyDrift) process.exit(2);
|
|
49921
50008
|
} catch (err) {
|
|
49922
|
-
if (err instanceof
|
|
50009
|
+
if (err instanceof CleoError5) {
|
|
49923
50010
|
cliError(err.message, err.code, { name: "E_DOCS_CHECK_FAILED" });
|
|
49924
50011
|
process.exit(err.code);
|
|
49925
50012
|
}
|
|
@@ -50005,7 +50092,7 @@ var init_docs3 = __esm({
|
|
|
50005
50092
|
process.exit(result.status === "error" ? 2 : 1);
|
|
50006
50093
|
}
|
|
50007
50094
|
} catch (err) {
|
|
50008
|
-
if (err instanceof
|
|
50095
|
+
if (err instanceof CleoError5) {
|
|
50009
50096
|
cliError(err.message, err.code, { name: "E_DOCS_SYNC_FAILED" });
|
|
50010
50097
|
process.exit(err.code);
|
|
50011
50098
|
}
|
|
@@ -50072,7 +50159,7 @@ var init_docs3 = __esm({
|
|
|
50072
50159
|
);
|
|
50073
50160
|
}
|
|
50074
50161
|
} catch (err) {
|
|
50075
|
-
if (err instanceof
|
|
50162
|
+
if (err instanceof CleoError5) {
|
|
50076
50163
|
cliError(err.message, err.code, { name: "E_DOCS_GAP_CHECK_FAILED" });
|
|
50077
50164
|
process.exit(err.code);
|
|
50078
50165
|
}
|
|
@@ -50109,7 +50196,7 @@ var init_docs3 = __esm({
|
|
|
50109
50196
|
}
|
|
50110
50197
|
},
|
|
50111
50198
|
async run({ args }) {
|
|
50112
|
-
const projectRoot =
|
|
50199
|
+
const projectRoot = getProjectRoot39();
|
|
50113
50200
|
const dirArg = String(args.dir);
|
|
50114
50201
|
const scanRoot = isAbsolute2(dirArg) ? dirArg : resolve5(projectRoot, dirArg);
|
|
50115
50202
|
const dryRun = args["dry-run"] === true;
|
|
@@ -50171,7 +50258,7 @@ var init_docs3 = __esm({
|
|
|
50171
50258
|
}
|
|
50172
50259
|
},
|
|
50173
50260
|
async run({ args }) {
|
|
50174
|
-
const projectRoot =
|
|
50261
|
+
const projectRoot = getProjectRoot39();
|
|
50175
50262
|
const { registry, configError } = loadCliRegistry(projectRoot);
|
|
50176
50263
|
const kinds = registry.list().map(toWireKind);
|
|
50177
50264
|
const extensionsCount = kinds.filter((k) => k.isExtension).length;
|
|
@@ -50226,7 +50313,7 @@ var init_docs3 = __esm({
|
|
|
50226
50313
|
deprecated: "docs list-types",
|
|
50227
50314
|
replacement: "docs schema"
|
|
50228
50315
|
});
|
|
50229
|
-
const projectRoot =
|
|
50316
|
+
const projectRoot = getProjectRoot39();
|
|
50230
50317
|
const { registry, configError } = loadCliRegistry(projectRoot);
|
|
50231
50318
|
const kinds = registry.list().map(toWireKind);
|
|
50232
50319
|
const extensionsCount = kinds.filter((k) => k.isExtension).length;
|
|
@@ -50287,6 +50374,8 @@ var init_docs3 = __esm({
|
|
|
50287
50374
|
merge: mergeCommand,
|
|
50288
50375
|
// T10164 — DocProvenanceResponse-typed graph (`--root <slug>|<taskId>`).
|
|
50289
50376
|
graph: graphCommand,
|
|
50377
|
+
// T11875 — display-alias assignment (`set-alias <slug> <number>`), decoupled from slug.
|
|
50378
|
+
"set-alias": setAliasCommand,
|
|
50290
50379
|
// Legacy aliases (use `query` for new work — retained for backward compatibility)
|
|
50291
50380
|
search: searchCommand,
|
|
50292
50381
|
find: findCommand3,
|
|
@@ -50320,7 +50409,7 @@ var doctor_db_substrate_exports = {};
|
|
|
50320
50409
|
__export(doctor_db_substrate_exports, {
|
|
50321
50410
|
doctorDbSubstrateCommand: () => doctorDbSubstrateCommand
|
|
50322
50411
|
});
|
|
50323
|
-
import { getProjectRoot as
|
|
50412
|
+
import { getProjectRoot as getProjectRoot40, pushWarning as pushWarning4 } from "@cleocode/core";
|
|
50324
50413
|
import { surveyDbSubstrate, surveyFleetDbSubstrate } from "@cleocode/core/doctor/db-substrate.js";
|
|
50325
50414
|
function pushSubstrateWarnings(result) {
|
|
50326
50415
|
for (const warning of result.warnings) {
|
|
@@ -50453,7 +50542,7 @@ var init_doctor_db_substrate = __esm({
|
|
|
50453
50542
|
const result = isFleet ? surveyFleetDbSubstrate(
|
|
50454
50543
|
typeof args["fleet-root"] === "string" && args["fleet-root"].length > 0 ? args["fleet-root"] : DEFAULT_FLEET_ROOT,
|
|
50455
50544
|
options
|
|
50456
|
-
) : surveyDbSubstrate(
|
|
50545
|
+
) : surveyDbSubstrate(getProjectRoot40(), options);
|
|
50457
50546
|
pushSubstrateWarnings(result);
|
|
50458
50547
|
pushPerDbWarnings(result);
|
|
50459
50548
|
cliOutput(result, {
|
|
@@ -50625,7 +50714,7 @@ var doctor_legacy_backups_exports = {};
|
|
|
50625
50714
|
__export(doctor_legacy_backups_exports, {
|
|
50626
50715
|
doctorLegacyBackupsCommand: () => doctorLegacyBackupsCommand
|
|
50627
50716
|
});
|
|
50628
|
-
import { getProjectRoot as
|
|
50717
|
+
import { getProjectRoot as getProjectRoot41 } from "@cleocode/core";
|
|
50629
50718
|
import { pruneLegacyBackups, scanLegacyBackups } from "@cleocode/core/doctor/legacy-backups.js";
|
|
50630
50719
|
function parsePositiveInt(raw, fallback) {
|
|
50631
50720
|
if (raw === void 0 || raw === null) return fallback;
|
|
@@ -50669,7 +50758,7 @@ var init_doctor_legacy_backups = __esm({
|
|
|
50669
50758
|
async run({ args }) {
|
|
50670
50759
|
const softRetentionDays = parsePositiveInt(args["soft-retention-days"], 30);
|
|
50671
50760
|
const hardRetentionDays = parsePositiveInt(args["hard-retention-days"], 90);
|
|
50672
|
-
const projectRoot =
|
|
50761
|
+
const projectRoot = getProjectRoot41();
|
|
50673
50762
|
let result;
|
|
50674
50763
|
if (args.prune === true) {
|
|
50675
50764
|
const dryRun = args["dry-run"] !== false;
|
|
@@ -51107,7 +51196,7 @@ var doctor_repair_exports = {};
|
|
|
51107
51196
|
__export(doctor_repair_exports, {
|
|
51108
51197
|
doctorRepairCommand: () => doctorRepairCommand
|
|
51109
51198
|
});
|
|
51110
|
-
import { getLogger as getLogger20, getProjectRoot as
|
|
51199
|
+
import { getLogger as getLogger20, getProjectRoot as getProjectRoot42 } from "@cleocode/core";
|
|
51111
51200
|
import { repairMalformedDbs } from "@cleocode/core/store/repair-malformed-dbs.js";
|
|
51112
51201
|
var doctorRepairCommand;
|
|
51113
51202
|
var init_doctor_repair = __esm({
|
|
@@ -51151,7 +51240,7 @@ var init_doctor_repair = __esm({
|
|
|
51151
51240
|
return;
|
|
51152
51241
|
}
|
|
51153
51242
|
const result = repairMalformedDbs({
|
|
51154
|
-
projectRoot:
|
|
51243
|
+
projectRoot: getProjectRoot42(),
|
|
51155
51244
|
roles: roleArg.length > 0 ? [roleArg] : void 0,
|
|
51156
51245
|
dryRun,
|
|
51157
51246
|
logger: getLogger20("doctor-repair")
|
|
@@ -51311,7 +51400,7 @@ import { join as join23 } from "node:path";
|
|
|
51311
51400
|
import {
|
|
51312
51401
|
ensureGlobalAgentRegistryDb,
|
|
51313
51402
|
getGlobalAgentRegistryNativeDb,
|
|
51314
|
-
getProjectRoot as
|
|
51403
|
+
getProjectRoot as getProjectRoot43,
|
|
51315
51404
|
installAgentFromCant
|
|
51316
51405
|
} from "@cleocode/core/internal";
|
|
51317
51406
|
function sha256Hex(bytes) {
|
|
@@ -51499,7 +51588,7 @@ var init_migrate_agents_v2 = __esm({
|
|
|
51499
51588
|
}
|
|
51500
51589
|
},
|
|
51501
51590
|
async run({ args }) {
|
|
51502
|
-
const projectRoot =
|
|
51591
|
+
const projectRoot = getProjectRoot43();
|
|
51503
51592
|
const verbose = args.quiet !== true;
|
|
51504
51593
|
if (verbose) {
|
|
51505
51594
|
humanInfo("Scanning .cleo/cant/agents/ and .cleo/agents/ for unregistered agents...");
|
|
@@ -51543,7 +51632,7 @@ __export(doctor_exports, {
|
|
|
51543
51632
|
});
|
|
51544
51633
|
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
51545
51634
|
import { join as join24 } from "node:path";
|
|
51546
|
-
import { getProjectRoot as
|
|
51635
|
+
import { getProjectRoot as getProjectRoot44, pushWarning as pushWarning5 } from "@cleocode/core";
|
|
51547
51636
|
import { renderInvariantAuditLines } from "@cleocode/core/doctor/invariant-audit-render.js";
|
|
51548
51637
|
import {
|
|
51549
51638
|
quarantineRogueCleoDir,
|
|
@@ -51891,7 +51980,7 @@ var init_doctor = __esm({
|
|
|
51891
51980
|
const { join: pathJoin } = await import("node:path");
|
|
51892
51981
|
const { existsSync: existsSync22 } = await import("node:fs");
|
|
51893
51982
|
const { detectAndHealCoreWorktreeLeak } = await import("@cleocode/worktree");
|
|
51894
|
-
const projectRoot =
|
|
51983
|
+
const projectRoot = getProjectRoot44();
|
|
51895
51984
|
let gitRoot = projectRoot;
|
|
51896
51985
|
try {
|
|
51897
51986
|
gitRoot = execFile2("git", ["rev-parse", "--show-toplevel"], {
|
|
@@ -51943,7 +52032,7 @@ var init_doctor = __esm({
|
|
|
51943
52032
|
}
|
|
51944
52033
|
if (args.brain) {
|
|
51945
52034
|
const { computeBrainHealthDashboard } = await import("@cleocode/core/memory/brain-health-dashboard.js");
|
|
51946
|
-
const projectRoot =
|
|
52035
|
+
const projectRoot = getProjectRoot44();
|
|
51947
52036
|
const dashboard = await computeBrainHealthDashboard(projectRoot);
|
|
51948
52037
|
cliOutput(dashboard, { command: "doctor", operation: "doctor.brain" });
|
|
51949
52038
|
if (dashboard.hasP0Failure) {
|
|
@@ -51952,7 +52041,7 @@ var init_doctor = __esm({
|
|
|
51952
52041
|
return;
|
|
51953
52042
|
}
|
|
51954
52043
|
if (args["scan-test-fixtures-in-prod"]) {
|
|
51955
|
-
const projectRoot =
|
|
52044
|
+
const projectRoot = getProjectRoot44();
|
|
51956
52045
|
const matches = await scanTestFixturesInProd(projectRoot);
|
|
51957
52046
|
const dryRun = args["dry-run"] !== false && args.quarantine !== true;
|
|
51958
52047
|
const quarantined = !dryRun && matches.length > 0 ? await quarantineTestFixtures(projectRoot, matches) : void 0;
|
|
@@ -52040,7 +52129,7 @@ var init_doctor = __esm({
|
|
|
52040
52129
|
progress.complete("Comprehensive diagnostics complete");
|
|
52041
52130
|
} else if (args["scan-rogue-cleo-dirs"]) {
|
|
52042
52131
|
progress.step(0, "Scanning for rogue .cleo/ directories");
|
|
52043
|
-
const projectRoot =
|
|
52132
|
+
const projectRoot = getProjectRoot44();
|
|
52044
52133
|
const reports = scanRogueCleoDirs(projectRoot);
|
|
52045
52134
|
progress.complete(
|
|
52046
52135
|
`Found ${reports.length} rogue .cleo/ director${reports.length === 1 ? "y" : "ies"}`
|
|
@@ -52049,7 +52138,7 @@ var init_doctor = __esm({
|
|
|
52049
52138
|
} else if (args["quarantine-rogue-cleo-dirs"]) {
|
|
52050
52139
|
const isDryRun = args["dry-run"] === true;
|
|
52051
52140
|
progress.step(0, `${isDryRun ? "[DRY RUN] " : ""}Scanning for rogue .cleo/ directories`);
|
|
52052
|
-
const projectRoot =
|
|
52141
|
+
const projectRoot = getProjectRoot44();
|
|
52053
52142
|
const reports = scanRogueCleoDirs(projectRoot);
|
|
52054
52143
|
if (reports.length === 0) {
|
|
52055
52144
|
progress.complete("No rogue .cleo/ directories found \u2014 nothing to quarantine");
|
|
@@ -52103,7 +52192,7 @@ var init_doctor = __esm({
|
|
|
52103
52192
|
const { detectAndRemoveLegacyGlobalFiles, detectAndRemoveStrayProjectNexus } = await import("@cleocode/core/store/cleanup-legacy.js");
|
|
52104
52193
|
const { getCleoHome: getCleoHome6 } = await import("@cleocode/core");
|
|
52105
52194
|
const cleoHome = getCleoHome6();
|
|
52106
|
-
const projectRoot =
|
|
52195
|
+
const projectRoot = getProjectRoot44();
|
|
52107
52196
|
const legacyResult = detectAndRemoveLegacyGlobalFiles(cleoHome);
|
|
52108
52197
|
const strayResult = detectAndRemoveStrayProjectNexus(projectRoot);
|
|
52109
52198
|
const isDryRun = args["dry-run"] === true;
|
|
@@ -52136,7 +52225,7 @@ var init_doctor = __esm({
|
|
|
52136
52225
|
} else if (args["audit-worktree-orphans"]) {
|
|
52137
52226
|
progress.step(0, "Comprehensive worktree anomaly audit (T9808 / council D009)");
|
|
52138
52227
|
const { auditWorktreeOrphansComprehensive, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
|
|
52139
|
-
const projectRoot =
|
|
52228
|
+
const projectRoot = getProjectRoot44();
|
|
52140
52229
|
const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
|
|
52141
52230
|
const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
|
|
52142
52231
|
const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
|
|
@@ -52193,7 +52282,7 @@ var init_doctor = __esm({
|
|
|
52193
52282
|
`${isDryRun ? "[DRY RUN] " : ""}Scanning + pruning worktree-orphan .cleo/ directories`
|
|
52194
52283
|
);
|
|
52195
52284
|
const { pruneWorktreeOrphans, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
|
|
52196
|
-
const projectRoot =
|
|
52285
|
+
const projectRoot = getProjectRoot44();
|
|
52197
52286
|
const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
|
|
52198
52287
|
const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
|
|
52199
52288
|
const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
|
|
@@ -52272,7 +52361,7 @@ var init_doctor = __esm({
|
|
|
52272
52361
|
`${isDryRun ? "[DRY RUN] " : ""}Migrating .cleo/worktree-include \u2192 .worktreeinclude`
|
|
52273
52362
|
);
|
|
52274
52363
|
const { migrateWorktreeIncludeFile } = await import("@cleocode/core");
|
|
52275
|
-
const projectRoot =
|
|
52364
|
+
const projectRoot = getProjectRoot44();
|
|
52276
52365
|
const result = await migrateWorktreeIncludeFile(projectRoot, { dryRun: isDryRun });
|
|
52277
52366
|
progress.complete(`Migration ${result.action}`);
|
|
52278
52367
|
cliOutput(result, { command: "doctor", operation: "doctor.migrate-worktree-include" });
|
|
@@ -52291,7 +52380,7 @@ var init_doctor = __esm({
|
|
|
52291
52380
|
const stepLabel = isFocusedAlias ? "Auditing Saga hierarchy for ADR-073 invariants" : "Walking central INVARIANTS_REGISTRY";
|
|
52292
52381
|
progress.step(0, stepLabel);
|
|
52293
52382
|
const { auditInvariantRegistry } = await import("@cleocode/core/doctor/invariant-audit.js");
|
|
52294
|
-
const projectRoot =
|
|
52383
|
+
const projectRoot = getProjectRoot44();
|
|
52295
52384
|
const result = await auditInvariantRegistry(projectRoot, { adrFilter });
|
|
52296
52385
|
const operation = isFocusedAlias ? "doctor.audit-sagas" : "doctor.audit-invariants";
|
|
52297
52386
|
const summary = `Invariant audit complete \u2014 ${result.totalCount} entries walked, ${result.errorCount} error / ${result.warningCount} warning / ${result.infoCount} info violation(s), ${result.notApplicableCount} not-applicable, ${result.documentedCount} documented`;
|
|
@@ -52313,7 +52402,7 @@ var init_doctor = __esm({
|
|
|
52313
52402
|
{ command: "doctor", operation: "admin.health" }
|
|
52314
52403
|
);
|
|
52315
52404
|
try {
|
|
52316
|
-
const projectRoot =
|
|
52405
|
+
const projectRoot = getProjectRoot44();
|
|
52317
52406
|
const conflicts = readMigrationConflicts(projectRoot);
|
|
52318
52407
|
if (conflicts.length > 0) {
|
|
52319
52408
|
progress.complete(
|
|
@@ -52344,7 +52433,7 @@ var init_doctor = __esm({
|
|
|
52344
52433
|
progress.complete("Health check complete");
|
|
52345
52434
|
}
|
|
52346
52435
|
try {
|
|
52347
|
-
const projectRoot =
|
|
52436
|
+
const projectRoot = getProjectRoot44();
|
|
52348
52437
|
const { auditSagaHierarchy } = await import("@cleocode/core/doctor/saga-audit.js");
|
|
52349
52438
|
const sagaAudit = await auditSagaHierarchy(projectRoot);
|
|
52350
52439
|
if (sagaAudit.sagas.length === 0) {
|
|
@@ -53930,7 +54019,7 @@ var go_exports = {};
|
|
|
53930
54019
|
__export(go_exports, {
|
|
53931
54020
|
goCommand: () => goCommand
|
|
53932
54021
|
});
|
|
53933
|
-
import { getProjectRoot as
|
|
54022
|
+
import { getProjectRoot as getProjectRoot45, go } from "@cleocode/core";
|
|
53934
54023
|
var goCommand;
|
|
53935
54024
|
var init_go = __esm({
|
|
53936
54025
|
"packages/cleo/src/cli/commands/go.ts"() {
|
|
@@ -53955,7 +54044,7 @@ var init_go = __esm({
|
|
|
53955
54044
|
}
|
|
53956
54045
|
},
|
|
53957
54046
|
async run({ args }) {
|
|
53958
|
-
const projectRoot =
|
|
54047
|
+
const projectRoot = getProjectRoot45();
|
|
53959
54048
|
const result = await go.cleoGo({
|
|
53960
54049
|
sagaId: typeof args.saga === "string" && args.saga.length > 0 ? args.saga : void 0,
|
|
53961
54050
|
headless: args.headless === true,
|
|
@@ -53972,7 +54061,7 @@ var goal_exports = {};
|
|
|
53972
54061
|
__export(goal_exports, {
|
|
53973
54062
|
goalCommand: () => goalCommand
|
|
53974
54063
|
});
|
|
53975
|
-
import { getProjectRoot as
|
|
54064
|
+
import { getProjectRoot as getProjectRoot46, goal } from "@cleocode/core";
|
|
53976
54065
|
function resolveGoalKind(task) {
|
|
53977
54066
|
if (typeof task === "string" && task.length > 0) {
|
|
53978
54067
|
if (!isValidGoalTargetTaskId(task)) {
|
|
@@ -54019,7 +54108,7 @@ var init_goal2 = __esm({
|
|
|
54019
54108
|
}
|
|
54020
54109
|
const record = await goal.createGoal(
|
|
54021
54110
|
{ goalKind: kindResult.kind, intent, turnBudget: resolveTurnBudget(args.turns) },
|
|
54022
|
-
|
|
54111
|
+
getProjectRoot46()
|
|
54023
54112
|
);
|
|
54024
54113
|
cliOutput(record, { command: "goal set", operation: "goal.set" });
|
|
54025
54114
|
}
|
|
@@ -54030,7 +54119,7 @@ var init_goal2 = __esm({
|
|
|
54030
54119
|
description: "Show the current agent's active goal (per-agent scoped)."
|
|
54031
54120
|
},
|
|
54032
54121
|
async run() {
|
|
54033
|
-
const record = await goal.getActiveGoal(
|
|
54122
|
+
const record = await goal.getActiveGoal(getProjectRoot46());
|
|
54034
54123
|
cliOutput(record ?? { active: null }, { command: "goal status", operation: "goal.status" });
|
|
54035
54124
|
}
|
|
54036
54125
|
});
|
|
@@ -54052,7 +54141,7 @@ var init_goal2 = __esm({
|
|
|
54052
54141
|
});
|
|
54053
54142
|
return;
|
|
54054
54143
|
}
|
|
54055
|
-
const cwd =
|
|
54144
|
+
const cwd = getProjectRoot46();
|
|
54056
54145
|
const parent = await goal.getActiveGoal(cwd);
|
|
54057
54146
|
if (!parent) {
|
|
54058
54147
|
cliError(
|
|
@@ -54100,7 +54189,7 @@ var init_goal2 = __esm({
|
|
|
54100
54189
|
});
|
|
54101
54190
|
return;
|
|
54102
54191
|
}
|
|
54103
|
-
const cwd =
|
|
54192
|
+
const cwd = getProjectRoot46();
|
|
54104
54193
|
const result = await goal.advanceGoalWithPersist(goalId, { cwd });
|
|
54105
54194
|
if (!result) {
|
|
54106
54195
|
cliError(`Goal '${goalId}' not found.`, 4 /* NOT_FOUND */, { name: "E_NOT_FOUND" });
|
|
@@ -54125,7 +54214,7 @@ var init_goal2 = __esm({
|
|
|
54125
54214
|
});
|
|
54126
54215
|
return;
|
|
54127
54216
|
}
|
|
54128
|
-
const cwd =
|
|
54217
|
+
const cwd = getProjectRoot46();
|
|
54129
54218
|
const active = await goal.getActiveGoal(cwd);
|
|
54130
54219
|
if (!active) {
|
|
54131
54220
|
cliError(
|
|
@@ -55114,7 +55203,7 @@ var hygiene_exports = {};
|
|
|
55114
55203
|
__export(hygiene_exports, {
|
|
55115
55204
|
hygieneCommand: () => hygieneCommand
|
|
55116
55205
|
});
|
|
55117
|
-
import { getProjectRoot as
|
|
55206
|
+
import { getProjectRoot as getProjectRoot47 } from "@cleocode/core";
|
|
55118
55207
|
import { runSpawnReadinessHygieneCli } from "@cleocode/core/hygiene/validate-spawn-readiness.js";
|
|
55119
55208
|
var hygieneCommand;
|
|
55120
55209
|
var init_hygiene = __esm({
|
|
@@ -55143,7 +55232,7 @@ var init_hygiene = __esm({
|
|
|
55143
55232
|
}
|
|
55144
55233
|
},
|
|
55145
55234
|
async run({ args }) {
|
|
55146
|
-
const projectRoot = args["project-root"] ||
|
|
55235
|
+
const projectRoot = args["project-root"] || getProjectRoot47() || process.cwd();
|
|
55147
55236
|
const worktreePath = args["worktree-path"];
|
|
55148
55237
|
await runSpawnReadinessHygieneCli(projectRoot, worktreePath);
|
|
55149
55238
|
}
|
|
@@ -55318,7 +55407,7 @@ import { existsSync as existsSync16, readFileSync as readFileSync14 } from "node
|
|
|
55318
55407
|
import { join as join27 } from "node:path";
|
|
55319
55408
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
55320
55409
|
import {
|
|
55321
|
-
CleoError as
|
|
55410
|
+
CleoError as CleoError6,
|
|
55322
55411
|
getWorkflowTemplatesDir as getCoreWorkflowTemplatesDir,
|
|
55323
55412
|
initProject as initProject2,
|
|
55324
55413
|
pushWarning as pushWarning6,
|
|
@@ -55458,7 +55547,7 @@ var init_init = __esm({
|
|
|
55458
55547
|
{ command: "init" }
|
|
55459
55548
|
);
|
|
55460
55549
|
} catch (err) {
|
|
55461
|
-
if (err instanceof
|
|
55550
|
+
if (err instanceof CleoError6) {
|
|
55462
55551
|
cliError(`init failed: ${err.message}`, err.code, { name: "E_INTERNAL" });
|
|
55463
55552
|
process.exit(err.code);
|
|
55464
55553
|
}
|
|
@@ -56306,7 +56395,7 @@ var llm_cost_exports = {};
|
|
|
56306
56395
|
__export(llm_cost_exports, {
|
|
56307
56396
|
costCommand: () => costCommand
|
|
56308
56397
|
});
|
|
56309
|
-
import { getProjectRoot as
|
|
56398
|
+
import { getProjectRoot as getProjectRoot48 } from "@cleocode/core/internal";
|
|
56310
56399
|
import { computeCost } from "@cleocode/core/llm/usage-pricing";
|
|
56311
56400
|
function resolveSessionId(raw) {
|
|
56312
56401
|
if (raw === "current") {
|
|
@@ -56379,7 +56468,7 @@ var init_llm_cost = __esm({
|
|
|
56379
56468
|
process.exit(6);
|
|
56380
56469
|
}
|
|
56381
56470
|
const sessionId = resolveSessionId(rawSessionId);
|
|
56382
|
-
const projectRoot =
|
|
56471
|
+
const projectRoot = getProjectRoot48(process.cwd());
|
|
56383
56472
|
let breakdown;
|
|
56384
56473
|
try {
|
|
56385
56474
|
breakdown = await loadSessionCostBreakdown(projectRoot, sessionId);
|
|
@@ -57953,7 +58042,7 @@ var memory_exports = {};
|
|
|
57953
58042
|
__export(memory_exports, {
|
|
57954
58043
|
memoryCommand: () => memoryCommand
|
|
57955
58044
|
});
|
|
57956
|
-
import { getProjectRoot as
|
|
58045
|
+
import { getProjectRoot as getProjectRoot49 } from "@cleocode/core";
|
|
57957
58046
|
import {
|
|
57958
58047
|
getBrainDb as getBrainDb2,
|
|
57959
58048
|
getDreamStatus,
|
|
@@ -58886,7 +58975,7 @@ var init_memory3 = __esm({
|
|
|
58886
58975
|
},
|
|
58887
58976
|
args: {},
|
|
58888
58977
|
async run() {
|
|
58889
|
-
const root =
|
|
58978
|
+
const root = getProjectRoot49();
|
|
58890
58979
|
try {
|
|
58891
58980
|
const result = await runConsolidation(root);
|
|
58892
58981
|
cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
|
|
@@ -58910,7 +58999,7 @@ var init_memory3 = __esm({
|
|
|
58910
58999
|
}
|
|
58911
59000
|
},
|
|
58912
59001
|
async run({ args }) {
|
|
58913
|
-
const root =
|
|
59002
|
+
const root = getProjectRoot49();
|
|
58914
59003
|
if (args.status) {
|
|
58915
59004
|
try {
|
|
58916
59005
|
const status = await getDreamStatus(root);
|
|
@@ -58947,7 +59036,7 @@ var init_memory3 = __esm({
|
|
|
58947
59036
|
}
|
|
58948
59037
|
},
|
|
58949
59038
|
async run({ args }) {
|
|
58950
|
-
const root =
|
|
59039
|
+
const root = getProjectRoot49();
|
|
58951
59040
|
try {
|
|
58952
59041
|
const { runObserver, runReflector } = await import("@cleocode/core/memory");
|
|
58953
59042
|
const observerResult = await runObserver(root, args.session, {
|
|
@@ -58987,7 +59076,7 @@ var init_memory3 = __esm({
|
|
|
58987
59076
|
}
|
|
58988
59077
|
},
|
|
58989
59078
|
async run({ args }) {
|
|
58990
|
-
const root =
|
|
59079
|
+
const root = getProjectRoot49();
|
|
58991
59080
|
try {
|
|
58992
59081
|
await getBrainDb2(root);
|
|
58993
59082
|
const { totalDuplicateRows, groups } = await scanDuplicateEntries();
|
|
@@ -59033,7 +59122,7 @@ var init_memory3 = __esm({
|
|
|
59033
59122
|
async run({ args }) {
|
|
59034
59123
|
const sourceDir = args.from;
|
|
59035
59124
|
const isDryRun = !!args["dry-run"];
|
|
59036
|
-
const projectRoot =
|
|
59125
|
+
const projectRoot = getProjectRoot49();
|
|
59037
59126
|
try {
|
|
59038
59127
|
const result = await importMemoryFiles({
|
|
59039
59128
|
sourceDir,
|
|
@@ -59184,7 +59273,7 @@ var init_memory3 = __esm({
|
|
|
59184
59273
|
},
|
|
59185
59274
|
args: {},
|
|
59186
59275
|
async run() {
|
|
59187
|
-
const root =
|
|
59276
|
+
const root = getProjectRoot49();
|
|
59188
59277
|
try {
|
|
59189
59278
|
await getBrainDb2(root);
|
|
59190
59279
|
const result = await getTierStats(root);
|
|
@@ -59227,7 +59316,7 @@ var init_memory3 = __esm({
|
|
|
59227
59316
|
}
|
|
59228
59317
|
},
|
|
59229
59318
|
async run({ args }) {
|
|
59230
|
-
const root =
|
|
59319
|
+
const root = getProjectRoot49();
|
|
59231
59320
|
const targetTier = args.to;
|
|
59232
59321
|
const reason = args.reason;
|
|
59233
59322
|
const validTiers = ["medium", "long"];
|
|
@@ -59293,7 +59382,7 @@ var init_memory3 = __esm({
|
|
|
59293
59382
|
}
|
|
59294
59383
|
},
|
|
59295
59384
|
async run({ args }) {
|
|
59296
|
-
const root =
|
|
59385
|
+
const root = getProjectRoot49();
|
|
59297
59386
|
const targetTier = args.to;
|
|
59298
59387
|
const reason = args.reason;
|
|
59299
59388
|
const validTiers = ["short", "medium"];
|
|
@@ -59756,7 +59845,7 @@ var migrate_claude_mem_exports = {};
|
|
|
59756
59845
|
__export(migrate_claude_mem_exports, {
|
|
59757
59846
|
migrateClaudeMemCommand: () => migrateClaudeMemCommand
|
|
59758
59847
|
});
|
|
59759
|
-
import { getProjectRoot as
|
|
59848
|
+
import { getProjectRoot as getProjectRoot50, migrateClaudeMem } from "@cleocode/core/internal";
|
|
59760
59849
|
import { ingestLooseAgentOutputs, ingestRcasdDirectories } from "@cleocode/core/memory";
|
|
59761
59850
|
import { getDb as getDb2 } from "@cleocode/core/store/sqlite";
|
|
59762
59851
|
var storageCommand, claudeMemCommand, manifestIngestCommand, migrateClaudeMemCommand;
|
|
@@ -59819,7 +59908,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
59819
59908
|
}
|
|
59820
59909
|
},
|
|
59821
59910
|
async run({ args }) {
|
|
59822
|
-
const root =
|
|
59911
|
+
const root = getProjectRoot50();
|
|
59823
59912
|
try {
|
|
59824
59913
|
const result = await migrateClaudeMem(root, {
|
|
59825
59914
|
sourcePath: args.source,
|
|
@@ -59868,7 +59957,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
59868
59957
|
}
|
|
59869
59958
|
},
|
|
59870
59959
|
async run({ args }) {
|
|
59871
|
-
const projectRoot =
|
|
59960
|
+
const projectRoot = getProjectRoot50();
|
|
59872
59961
|
try {
|
|
59873
59962
|
const db = await getDb2(projectRoot);
|
|
59874
59963
|
const rcasdFlag = Boolean(args.rcasd);
|
|
@@ -59986,7 +60075,7 @@ __export(nexus_exports, {
|
|
|
59986
60075
|
import { appendFile as appendFile2, mkdir as mkdir4 } from "node:fs/promises";
|
|
59987
60076
|
import { homedir as homedir5 } from "node:os";
|
|
59988
60077
|
import path4 from "node:path";
|
|
59989
|
-
import { getProjectRoot as
|
|
60078
|
+
import { getProjectRoot as getProjectRoot51 } from "@cleocode/core";
|
|
59990
60079
|
import { getSymbolImpact } from "@cleocode/core/nexus";
|
|
59991
60080
|
import { runNexusAnalysis } from "@cleocode/core/nexus/analyze-orchestrator.js";
|
|
59992
60081
|
import { exportNexusGraph } from "@cleocode/core/nexus/export.js";
|
|
@@ -60101,7 +60190,7 @@ var init_nexus3 = __esm({
|
|
|
60101
60190
|
async run({ args }) {
|
|
60102
60191
|
applyJsonFlag2(args.json);
|
|
60103
60192
|
const projectIdOverride = args["project-id"];
|
|
60104
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60193
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
60105
60194
|
const startTime = Date.now();
|
|
60106
60195
|
try {
|
|
60107
60196
|
const [{ getNexusDb, nexusSchema }, { getIndexStats }] = await Promise.all([
|
|
@@ -60616,7 +60705,7 @@ var init_nexus3 = __esm({
|
|
|
60616
60705
|
applyJsonFlag2(args.json);
|
|
60617
60706
|
const startTime = Date.now();
|
|
60618
60707
|
const projectIdOverride = args["project-id"];
|
|
60619
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60708
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
60620
60709
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60621
60710
|
const response = await dispatchRaw("query", "nexus", "clusters", { projectId, repoPath });
|
|
60622
60711
|
const durationMs = Date.now() - startTime;
|
|
@@ -60660,7 +60749,7 @@ var init_nexus3 = __esm({
|
|
|
60660
60749
|
applyJsonFlag2(args.json);
|
|
60661
60750
|
const startTime = Date.now();
|
|
60662
60751
|
const projectIdOverride = args["project-id"];
|
|
60663
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60752
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
60664
60753
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60665
60754
|
const response = await dispatchRaw("query", "nexus", "flows", { projectId, repoPath });
|
|
60666
60755
|
const durationMs = Date.now() - startTime;
|
|
@@ -60703,7 +60792,7 @@ var init_nexus3 = __esm({
|
|
|
60703
60792
|
void appendDeprecationTelemetry("nexus.context", "cleo graph context");
|
|
60704
60793
|
const startTime = Date.now();
|
|
60705
60794
|
const projectIdOverride = args["project-id"];
|
|
60706
|
-
const repoPath =
|
|
60795
|
+
const repoPath = getProjectRoot51();
|
|
60707
60796
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60708
60797
|
const limit = parseInt(args.limit, 10);
|
|
60709
60798
|
const symbolName = args.symbol;
|
|
@@ -60766,7 +60855,7 @@ var init_nexus3 = __esm({
|
|
|
60766
60855
|
const startTime = Date.now();
|
|
60767
60856
|
const whyFlag = !!args.why;
|
|
60768
60857
|
const projectIdOverride = args["project-id"];
|
|
60769
|
-
const repoPath =
|
|
60858
|
+
const repoPath = getProjectRoot51();
|
|
60770
60859
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60771
60860
|
const maxDepth = Math.min(parseInt(args.depth, 10), 5);
|
|
60772
60861
|
const symbolName = args.symbol;
|
|
@@ -60838,7 +60927,7 @@ var init_nexus3 = __esm({
|
|
|
60838
60927
|
const projectIdOverride = args["project-id"];
|
|
60839
60928
|
const isIncremental = !!args.incremental;
|
|
60840
60929
|
const ctx = getFormatContext();
|
|
60841
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60930
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
60842
60931
|
humanInfo(`[nexus] Analyzing: ${repoPath}${isIncremental ? " (incremental)" : ""}`);
|
|
60843
60932
|
if (!isIncremental) humanInfo("[nexus] Clearing existing index for project...");
|
|
60844
60933
|
try {
|
|
@@ -60941,7 +61030,7 @@ var init_nexus3 = __esm({
|
|
|
60941
61030
|
async run({ args }) {
|
|
60942
61031
|
applyJsonFlag2(args.json);
|
|
60943
61032
|
const startTime = Date.now();
|
|
60944
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61033
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
60945
61034
|
const name = args.name;
|
|
60946
61035
|
const response = await dispatchRaw("mutate", "nexus", "projects.register", {
|
|
60947
61036
|
path: repoPath,
|
|
@@ -61299,7 +61388,7 @@ var init_nexus3 = __esm({
|
|
|
61299
61388
|
applyJsonFlag2(args.json);
|
|
61300
61389
|
const startTime = Date.now();
|
|
61301
61390
|
const projectIdOverride = args["project-id"];
|
|
61302
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61391
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
61303
61392
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
61304
61393
|
const response = await dispatchRaw("mutate", "nexus", "refresh-bridge", {
|
|
61305
61394
|
repoPath,
|
|
@@ -61405,7 +61494,7 @@ var init_nexus3 = __esm({
|
|
|
61405
61494
|
async run({ args }) {
|
|
61406
61495
|
applyJsonFlag2(args.json);
|
|
61407
61496
|
const startTime = Date.now();
|
|
61408
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61497
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
61409
61498
|
const projectIdOverride = args["project-id"];
|
|
61410
61499
|
const beforeRef = args.before ?? "HEAD~1";
|
|
61411
61500
|
const afterRef = args.after ?? "HEAD";
|
|
@@ -61523,7 +61612,7 @@ var init_nexus3 = __esm({
|
|
|
61523
61612
|
applyJsonFlag2(args.json);
|
|
61524
61613
|
const startTime = Date.now();
|
|
61525
61614
|
const projectIdOverride = args["project-id"];
|
|
61526
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61615
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
61527
61616
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
61528
61617
|
const response = await dispatchRaw("query", "nexus", "route-map", { projectId });
|
|
61529
61618
|
const durationMs = Date.now() - startTime;
|
|
@@ -61579,7 +61668,7 @@ var init_nexus3 = __esm({
|
|
|
61579
61668
|
const startTime = Date.now();
|
|
61580
61669
|
const routeSymbol = args.routeSymbol;
|
|
61581
61670
|
const projectIdOverride = args["project-id"];
|
|
61582
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61671
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
61583
61672
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
61584
61673
|
const response = await dispatchRaw("query", "nexus", "shape-check", { routeSymbol, projectId });
|
|
61585
61674
|
const durationMs = Date.now() - startTime;
|
|
@@ -61969,7 +62058,7 @@ var init_nexus3 = __esm({
|
|
|
61969
62058
|
async run({ args }) {
|
|
61970
62059
|
applyJsonFlag2(args.json);
|
|
61971
62060
|
const startTime = Date.now();
|
|
61972
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
62061
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
61973
62062
|
const projectIdOverride = args["project-id"];
|
|
61974
62063
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
61975
62064
|
const response = await dispatchRaw("mutate", "nexus", "contracts-sync", {
|
|
@@ -62073,7 +62162,7 @@ var init_nexus3 = __esm({
|
|
|
62073
62162
|
async run({ args }) {
|
|
62074
62163
|
applyJsonFlag2(args.json);
|
|
62075
62164
|
const startTime = Date.now();
|
|
62076
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
62165
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot51();
|
|
62077
62166
|
const projectId = Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
62078
62167
|
const response = await dispatchRaw("mutate", "nexus", "contracts-link-tasks", {
|
|
62079
62168
|
projectId,
|
|
@@ -62154,7 +62243,7 @@ var init_nexus3 = __esm({
|
|
|
62154
62243
|
const isIncremental = !!args.incremental;
|
|
62155
62244
|
try {
|
|
62156
62245
|
const result = await runNexusWiki({
|
|
62157
|
-
projectRoot:
|
|
62246
|
+
projectRoot: getProjectRoot51(),
|
|
62158
62247
|
outputDir,
|
|
62159
62248
|
communityFilter,
|
|
62160
62249
|
incremental: isIncremental
|
|
@@ -62504,7 +62593,7 @@ __export(orchestrate_exports, {
|
|
|
62504
62593
|
});
|
|
62505
62594
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
62506
62595
|
import { orchestration } from "@cleocode/core";
|
|
62507
|
-
import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as
|
|
62596
|
+
import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as getProjectRoot52 } from "@cleocode/core/internal";
|
|
62508
62597
|
function formatRollupTable(rollup) {
|
|
62509
62598
|
const waves = "waves" in rollup ? rollup.waves : [rollup];
|
|
62510
62599
|
const lines = [];
|
|
@@ -62647,7 +62736,7 @@ var init_orchestrate3 = __esm({
|
|
|
62647
62736
|
},
|
|
62648
62737
|
async run({ args }) {
|
|
62649
62738
|
const rateWindowHours = args.window !== void 0 ? Number.parseFloat(String(args.window)) : void 0;
|
|
62650
|
-
const metrics = await orchestration.collectOrchestrateDashboard(
|
|
62739
|
+
const metrics = await orchestration.collectOrchestrateDashboard(getProjectRoot52(), {
|
|
62651
62740
|
...rateWindowHours !== void 0 && Number.isFinite(rateWindowHours) && rateWindowHours > 0 ? { rateWindowHours } : {}
|
|
62652
62741
|
});
|
|
62653
62742
|
cliOutput(metrics, {
|
|
@@ -63499,7 +63588,7 @@ __export(otel_exports, {
|
|
|
63499
63588
|
otelCommand: () => otelCommand
|
|
63500
63589
|
});
|
|
63501
63590
|
import {
|
|
63502
|
-
CleoError as
|
|
63591
|
+
CleoError as CleoError7,
|
|
63503
63592
|
clearOtelData,
|
|
63504
63593
|
formatError as formatError4,
|
|
63505
63594
|
getOtelSessions,
|
|
@@ -63521,7 +63610,7 @@ var init_otel = __esm({
|
|
|
63521
63610
|
const result = await getOtelStatus();
|
|
63522
63611
|
cliOutput(result, { command: "otel" });
|
|
63523
63612
|
} catch (err) {
|
|
63524
|
-
if (err instanceof
|
|
63613
|
+
if (err instanceof CleoError7) {
|
|
63525
63614
|
cliError(formatError4(err), err.code, { name: "E_INTERNAL" });
|
|
63526
63615
|
process.exit(err.code);
|
|
63527
63616
|
}
|
|
@@ -63536,7 +63625,7 @@ var init_otel = __esm({
|
|
|
63536
63625
|
const result = await getOtelSummary();
|
|
63537
63626
|
cliOutput(result, { command: "otel" });
|
|
63538
63627
|
} catch (err) {
|
|
63539
|
-
if (err instanceof
|
|
63628
|
+
if (err instanceof CleoError7) {
|
|
63540
63629
|
cliError(formatError4(err), err.code, { name: "E_INTERNAL" });
|
|
63541
63630
|
process.exit(err.code);
|
|
63542
63631
|
}
|
|
@@ -63564,7 +63653,7 @@ var init_otel = __esm({
|
|
|
63564
63653
|
});
|
|
63565
63654
|
cliOutput(result, { command: "otel" });
|
|
63566
63655
|
} catch (err) {
|
|
63567
|
-
if (err instanceof
|
|
63656
|
+
if (err instanceof CleoError7) {
|
|
63568
63657
|
cliError(formatError4(err), err.code, { name: "E_INTERNAL" });
|
|
63569
63658
|
process.exit(err.code);
|
|
63570
63659
|
}
|
|
@@ -63592,7 +63681,7 @@ var init_otel = __esm({
|
|
|
63592
63681
|
});
|
|
63593
63682
|
cliOutput(result, { command: "otel" });
|
|
63594
63683
|
} catch (err) {
|
|
63595
|
-
if (err instanceof
|
|
63684
|
+
if (err instanceof CleoError7) {
|
|
63596
63685
|
cliError(formatError4(err), err.code, { name: "E_INTERNAL" });
|
|
63597
63686
|
process.exit(err.code);
|
|
63598
63687
|
}
|
|
@@ -63620,7 +63709,7 @@ var init_otel = __esm({
|
|
|
63620
63709
|
});
|
|
63621
63710
|
cliOutput(result, { command: "otel" });
|
|
63622
63711
|
} catch (err) {
|
|
63623
|
-
if (err instanceof
|
|
63712
|
+
if (err instanceof CleoError7) {
|
|
63624
63713
|
cliError(formatError4(err), err.code, { name: "E_INTERNAL" });
|
|
63625
63714
|
process.exit(err.code);
|
|
63626
63715
|
}
|
|
@@ -63635,7 +63724,7 @@ var init_otel = __esm({
|
|
|
63635
63724
|
const result = await clearOtelData();
|
|
63636
63725
|
cliOutput(result, { command: "otel" });
|
|
63637
63726
|
} catch (err) {
|
|
63638
|
-
if (err instanceof
|
|
63727
|
+
if (err instanceof CleoError7) {
|
|
63639
63728
|
cliError(formatError4(err), err.code, { name: "E_INTERNAL" });
|
|
63640
63729
|
process.exit(err.code);
|
|
63641
63730
|
}
|
|
@@ -64852,7 +64941,7 @@ var refresh_memory_exports = {};
|
|
|
64852
64941
|
__export(refresh_memory_exports, {
|
|
64853
64942
|
refreshMemoryCommand: () => refreshMemoryCommand
|
|
64854
64943
|
});
|
|
64855
|
-
import { getProjectRoot as
|
|
64944
|
+
import { getProjectRoot as getProjectRoot53 } from "@cleocode/core";
|
|
64856
64945
|
var refreshMemoryCommand;
|
|
64857
64946
|
var init_refresh_memory = __esm({
|
|
64858
64947
|
"packages/cleo/src/cli/commands/refresh-memory.ts"() {
|
|
@@ -64865,7 +64954,7 @@ var init_refresh_memory = __esm({
|
|
|
64865
64954
|
description: "Regenerate .cleo/memory-bridge.md from brain.db"
|
|
64866
64955
|
},
|
|
64867
64956
|
async run() {
|
|
64868
|
-
const projectDir =
|
|
64957
|
+
const projectDir = getProjectRoot53();
|
|
64869
64958
|
const { writeMemoryBridge } = await import("@cleocode/core/internal");
|
|
64870
64959
|
const result = await writeMemoryBridge(projectDir);
|
|
64871
64960
|
if (result.written) {
|
|
@@ -65571,7 +65660,7 @@ __export(remote_exports, {
|
|
|
65571
65660
|
});
|
|
65572
65661
|
import {
|
|
65573
65662
|
addRemote,
|
|
65574
|
-
CleoError as
|
|
65663
|
+
CleoError as CleoError8,
|
|
65575
65664
|
getRemoteSyncStatus as getRemoteGitStatus,
|
|
65576
65665
|
listRemotes,
|
|
65577
65666
|
pull,
|
|
@@ -65609,7 +65698,7 @@ var init_remote = __esm({
|
|
|
65609
65698
|
{ command: "remote", message: `Remote '${name}' added: ${args.url}` }
|
|
65610
65699
|
);
|
|
65611
65700
|
} catch (err) {
|
|
65612
|
-
if (err instanceof
|
|
65701
|
+
if (err instanceof CleoError8) {
|
|
65613
65702
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65614
65703
|
process.exit(err.code);
|
|
65615
65704
|
}
|
|
@@ -65638,7 +65727,7 @@ var init_remote = __esm({
|
|
|
65638
65727
|
{ command: "remote", message: `Remote '${args.name}' removed` }
|
|
65639
65728
|
);
|
|
65640
65729
|
} catch (err) {
|
|
65641
|
-
if (err instanceof
|
|
65730
|
+
if (err instanceof CleoError8) {
|
|
65642
65731
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65643
65732
|
process.exit(err.code);
|
|
65644
65733
|
}
|
|
@@ -65663,7 +65752,7 @@ var init_remote = __esm({
|
|
|
65663
65752
|
}
|
|
65664
65753
|
);
|
|
65665
65754
|
} catch (err) {
|
|
65666
|
-
if (err instanceof
|
|
65755
|
+
if (err instanceof CleoError8) {
|
|
65667
65756
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65668
65757
|
process.exit(err.code);
|
|
65669
65758
|
}
|
|
@@ -65703,7 +65792,7 @@ var init_remote = __esm({
|
|
|
65703
65792
|
}
|
|
65704
65793
|
cliOutput({ ...status }, { command: "remote", message });
|
|
65705
65794
|
} catch (err) {
|
|
65706
|
-
if (err instanceof
|
|
65795
|
+
if (err instanceof CleoError8) {
|
|
65707
65796
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65708
65797
|
process.exit(err.code);
|
|
65709
65798
|
}
|
|
@@ -65767,7 +65856,7 @@ var init_remote = __esm({
|
|
|
65767
65856
|
{ command: "push", message: result.message }
|
|
65768
65857
|
);
|
|
65769
65858
|
} catch (err) {
|
|
65770
|
-
if (err instanceof
|
|
65859
|
+
if (err instanceof CleoError8) {
|
|
65771
65860
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65772
65861
|
process.exit(err.code);
|
|
65773
65862
|
}
|
|
@@ -65810,7 +65899,7 @@ var init_remote = __esm({
|
|
|
65810
65899
|
{ command: "pull", message: result.message }
|
|
65811
65900
|
);
|
|
65812
65901
|
} catch (err) {
|
|
65813
|
-
if (err instanceof
|
|
65902
|
+
if (err instanceof CleoError8) {
|
|
65814
65903
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65815
65904
|
process.exit(err.code);
|
|
65816
65905
|
}
|
|
@@ -66391,8 +66480,8 @@ __export(restore_exports, {
|
|
|
66391
66480
|
import fs3 from "node:fs";
|
|
66392
66481
|
import path5 from "node:path";
|
|
66393
66482
|
import {
|
|
66394
|
-
CleoError as
|
|
66395
|
-
getProjectRoot as
|
|
66483
|
+
CleoError as CleoError9,
|
|
66484
|
+
getProjectRoot as getProjectRoot54,
|
|
66396
66485
|
getTaskAccessor as getTaskAccessor3,
|
|
66397
66486
|
parseConflictReport,
|
|
66398
66487
|
setAtPath
|
|
@@ -66413,7 +66502,7 @@ var init_restore = __esm({
|
|
|
66413
66502
|
description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
|
|
66414
66503
|
},
|
|
66415
66504
|
async run() {
|
|
66416
|
-
const projectRoot =
|
|
66505
|
+
const projectRoot = getProjectRoot54();
|
|
66417
66506
|
const reportPath = path5.join(projectRoot, CLEO_DIR_NAME3, RESTORE_CONFLICTS_MD);
|
|
66418
66507
|
if (!fs3.existsSync(reportPath)) {
|
|
66419
66508
|
humanLine("No pending restore conflicts. Nothing to finalize.");
|
|
@@ -66516,7 +66605,7 @@ var init_restore = __esm({
|
|
|
66516
66605
|
});
|
|
66517
66606
|
if (!response.success) {
|
|
66518
66607
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
66519
|
-
throw new
|
|
66608
|
+
throw new CleoError9(code, response.error?.message ?? "Backup restore failed");
|
|
66520
66609
|
}
|
|
66521
66610
|
const data = response.data;
|
|
66522
66611
|
if (args["dry-run"]) {
|
|
@@ -66545,7 +66634,7 @@ var init_restore = __esm({
|
|
|
66545
66634
|
{ command: "restore", operation: "admin.backup.restore" }
|
|
66546
66635
|
);
|
|
66547
66636
|
} catch (err) {
|
|
66548
|
-
if (err instanceof
|
|
66637
|
+
if (err instanceof CleoError9) {
|
|
66549
66638
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
66550
66639
|
process.exit(err.code);
|
|
66551
66640
|
}
|
|
@@ -66589,7 +66678,7 @@ var init_restore = __esm({
|
|
|
66589
66678
|
const taskId = args.taskId;
|
|
66590
66679
|
const idPattern = /^T\d{3,}$/;
|
|
66591
66680
|
if (!idPattern.test(taskId)) {
|
|
66592
|
-
throw new
|
|
66681
|
+
throw new CleoError9(2 /* INVALID_INPUT */, `Invalid task ID: ${taskId}`);
|
|
66593
66682
|
}
|
|
66594
66683
|
const accessor = await getTaskAccessor3();
|
|
66595
66684
|
const activeTask = await accessor.loadSingleTask(taskId);
|
|
@@ -66616,7 +66705,7 @@ var init_restore = __esm({
|
|
|
66616
66705
|
const response = await dispatchRaw("mutate", "tasks", "restore", { taskId });
|
|
66617
66706
|
if (!response.success) {
|
|
66618
66707
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
66619
|
-
throw new
|
|
66708
|
+
throw new CleoError9(code, response.error?.message ?? "Task restore failed");
|
|
66620
66709
|
}
|
|
66621
66710
|
const resultData = response.data;
|
|
66622
66711
|
cliOutput(
|
|
@@ -66658,7 +66747,7 @@ var init_restore = __esm({
|
|
|
66658
66747
|
});
|
|
66659
66748
|
if (!response.success) {
|
|
66660
66749
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
66661
|
-
throw new
|
|
66750
|
+
throw new CleoError9(code, response.error?.message ?? "Task restore failed");
|
|
66662
66751
|
}
|
|
66663
66752
|
const resultData = response.data;
|
|
66664
66753
|
cliOutput(
|
|
@@ -66673,7 +66762,7 @@ var init_restore = __esm({
|
|
|
66673
66762
|
);
|
|
66674
66763
|
return;
|
|
66675
66764
|
} else {
|
|
66676
|
-
throw new
|
|
66765
|
+
throw new CleoError9(
|
|
66677
66766
|
6 /* VALIDATION_ERROR */,
|
|
66678
66767
|
`Task ${taskId} is already active with status: ${activeTask.status}`
|
|
66679
66768
|
);
|
|
@@ -66705,7 +66794,7 @@ var init_restore = __esm({
|
|
|
66705
66794
|
}
|
|
66706
66795
|
}
|
|
66707
66796
|
}
|
|
66708
|
-
throw new
|
|
66797
|
+
throw new CleoError9(
|
|
66709
66798
|
4 /* NOT_FOUND */,
|
|
66710
66799
|
`Task ${taskId} not found in active tasks or archive`,
|
|
66711
66800
|
{
|
|
@@ -66723,7 +66812,7 @@ var init_restore = __esm({
|
|
|
66723
66812
|
});
|
|
66724
66813
|
if (!response.success) {
|
|
66725
66814
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
66726
|
-
throw new
|
|
66815
|
+
throw new CleoError9(code, response.error?.message ?? "Task unarchive failed");
|
|
66727
66816
|
}
|
|
66728
66817
|
const resultData = response.data;
|
|
66729
66818
|
cliOutput(
|
|
@@ -66737,7 +66826,7 @@ var init_restore = __esm({
|
|
|
66737
66826
|
{ command: "restore", operation: "tasks.restore" }
|
|
66738
66827
|
);
|
|
66739
66828
|
} catch {
|
|
66740
|
-
throw new
|
|
66829
|
+
throw new CleoError9(
|
|
66741
66830
|
4 /* NOT_FOUND */,
|
|
66742
66831
|
`Task ${taskId} not found in active tasks or archive`,
|
|
66743
66832
|
{
|
|
@@ -66746,7 +66835,7 @@ var init_restore = __esm({
|
|
|
66746
66835
|
);
|
|
66747
66836
|
}
|
|
66748
66837
|
} catch (err) {
|
|
66749
|
-
if (err instanceof
|
|
66838
|
+
if (err instanceof CleoError9) {
|
|
66750
66839
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
66751
66840
|
process.exit(err.code);
|
|
66752
66841
|
}
|
|
@@ -67335,8 +67424,8 @@ var init_saga = __esm({
|
|
|
67335
67424
|
}
|
|
67336
67425
|
},
|
|
67337
67426
|
async run({ args }) {
|
|
67338
|
-
const { sagas: sagas2, getProjectRoot:
|
|
67339
|
-
const projectRoot =
|
|
67427
|
+
const { sagas: sagas2, getProjectRoot: getProjectRoot60 } = await import("@cleocode/core");
|
|
67428
|
+
const projectRoot = getProjectRoot60();
|
|
67340
67429
|
const sagaId = typeof args.sagaId === "string" && args.sagaId.length > 0 ? args.sagaId : void 0;
|
|
67341
67430
|
const result = await sagas2.sagaNext(projectRoot, { sagaId });
|
|
67342
67431
|
cliOutput(result.success ? result.data : result, { command: "saga", operation: "saga.next" });
|
|
@@ -67535,7 +67624,7 @@ import * as readline2 from "node:readline";
|
|
|
67535
67624
|
import { promisify } from "node:util";
|
|
67536
67625
|
import {
|
|
67537
67626
|
BUILD_CONFIG as BUILD_CONFIG3,
|
|
67538
|
-
CleoError as
|
|
67627
|
+
CleoError as CleoError10,
|
|
67539
67628
|
checkAllRegisteredProjects as checkAllRegisteredProjects2,
|
|
67540
67629
|
checkStorageMigration,
|
|
67541
67630
|
getCleoHome as getCleoHome4,
|
|
@@ -67870,7 +67959,7 @@ var init_self_update = __esm({
|
|
|
67870
67959
|
const currentVersion = isDev ? await getCurrentVersion() : await getNpmInstalledVersion() ?? await getCurrentVersion();
|
|
67871
67960
|
const rawChannel = args.channel?.toLowerCase();
|
|
67872
67961
|
if (rawChannel && rawChannel !== "stable" && rawChannel !== "beta") {
|
|
67873
|
-
throw new
|
|
67962
|
+
throw new CleoError10(
|
|
67874
67963
|
6 /* VALIDATION_ERROR */,
|
|
67875
67964
|
`Invalid --channel '${rawChannel}'. Expected stable|beta`
|
|
67876
67965
|
);
|
|
@@ -67912,7 +68001,7 @@ var init_self_update = __esm({
|
|
|
67912
68001
|
progress.step(2, "Querying npm registry");
|
|
67913
68002
|
const latest2 = await getDistTagVersion(requestedChannel === "beta" ? "beta" : "latest");
|
|
67914
68003
|
if (!latest2) {
|
|
67915
|
-
throw new
|
|
68004
|
+
throw new CleoError10(
|
|
67916
68005
|
5 /* DEPENDENCY_ERROR */,
|
|
67917
68006
|
"Failed to check latest version from GitHub"
|
|
67918
68007
|
);
|
|
@@ -67942,7 +68031,7 @@ var init_self_update = __esm({
|
|
|
67942
68031
|
progress.step(2, "Querying npm registry");
|
|
67943
68032
|
const latest = args.version ?? await getDistTagVersion(requestedChannel === "beta" ? "beta" : "latest");
|
|
67944
68033
|
if (!latest) {
|
|
67945
|
-
throw new
|
|
68034
|
+
throw new CleoError10(
|
|
67946
68035
|
5 /* DEPENDENCY_ERROR */,
|
|
67947
68036
|
"Failed to check latest version from GitHub"
|
|
67948
68037
|
);
|
|
@@ -67987,7 +68076,7 @@ var init_self_update = __esm({
|
|
|
67987
68076
|
});
|
|
67988
68077
|
progress.complete(`Updated to ${latest}`);
|
|
67989
68078
|
} catch (err) {
|
|
67990
|
-
if (err instanceof
|
|
68079
|
+
if (err instanceof CleoError10) {
|
|
67991
68080
|
progress.error(err.message);
|
|
67992
68081
|
cliError(
|
|
67993
68082
|
err.message,
|
|
@@ -69078,7 +69167,7 @@ var sequence_exports = {};
|
|
|
69078
69167
|
__export(sequence_exports, {
|
|
69079
69168
|
sequenceCommand: () => sequenceCommand
|
|
69080
69169
|
});
|
|
69081
|
-
import { getProjectRoot as
|
|
69170
|
+
import { getProjectRoot as getProjectRoot55 } from "@cleocode/core/internal";
|
|
69082
69171
|
var showCommand13, checkCommand7, repairCommand2, sequenceCommand;
|
|
69083
69172
|
var init_sequence = __esm({
|
|
69084
69173
|
"packages/cleo/src/cli/commands/sequence.ts"() {
|
|
@@ -69114,7 +69203,7 @@ var init_sequence = __esm({
|
|
|
69114
69203
|
meta: { name: "repair", description: "Reset counter to max + 1 if behind" },
|
|
69115
69204
|
async run() {
|
|
69116
69205
|
const { repairSequence } = await import("@cleocode/core/internal");
|
|
69117
|
-
const projectRoot =
|
|
69206
|
+
const projectRoot = getProjectRoot55();
|
|
69118
69207
|
const repair = await repairSequence(projectRoot);
|
|
69119
69208
|
const result = {
|
|
69120
69209
|
repaired: repair.repaired,
|
|
@@ -69569,8 +69658,8 @@ var init_session4 = __esm({
|
|
|
69569
69658
|
"audit-scope": { type: "string", description: "Audit log scope (global|local)" }
|
|
69570
69659
|
},
|
|
69571
69660
|
async run({ args }) {
|
|
69572
|
-
const { detectSessionDrift, getProjectRoot:
|
|
69573
|
-
const projectRoot = await
|
|
69661
|
+
const { detectSessionDrift, getProjectRoot: getProjectRoot60 } = await import("@cleocode/core");
|
|
69662
|
+
const projectRoot = await getProjectRoot60();
|
|
69574
69663
|
const scope = args["audit-scope"] === "local" ? "local" : "global";
|
|
69575
69664
|
const report = await detectSessionDrift({ projectRoot, auditScope: scope });
|
|
69576
69665
|
cliOutput(report, { command: "session drift", operation: "session.drift" });
|
|
@@ -71543,7 +71632,7 @@ var sticky_exports = {};
|
|
|
71543
71632
|
__export(sticky_exports, {
|
|
71544
71633
|
stickyCommand: () => stickyCommand
|
|
71545
71634
|
});
|
|
71546
|
-
import { CleoError as
|
|
71635
|
+
import { CleoError as CleoError11 } from "@cleocode/core";
|
|
71547
71636
|
var addCommand13, listCommand25, showCommand16, convertCommand, archiveCommand4, purgeCommand2, stickyCommand;
|
|
71548
71637
|
var init_sticky3 = __esm({
|
|
71549
71638
|
"packages/cleo/src/cli/commands/sticky.ts"() {
|
|
@@ -71592,7 +71681,7 @@ var init_sticky3 = __esm({
|
|
|
71592
71681
|
{ command: "sticky", operation: "sticky.add" }
|
|
71593
71682
|
);
|
|
71594
71683
|
} catch (err) {
|
|
71595
|
-
if (err instanceof
|
|
71684
|
+
if (err instanceof CleoError11) {
|
|
71596
71685
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
71597
71686
|
process.exit(err.code);
|
|
71598
71687
|
}
|
|
@@ -71647,7 +71736,7 @@ var init_sticky3 = __esm({
|
|
|
71647
71736
|
}
|
|
71648
71737
|
cliOutput(data, { command: "sticky list", operation: "sticky.list", page: response.page });
|
|
71649
71738
|
} catch (err) {
|
|
71650
|
-
if (err instanceof
|
|
71739
|
+
if (err instanceof CleoError11) {
|
|
71651
71740
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
71652
71741
|
process.exit(err.code);
|
|
71653
71742
|
}
|
|
@@ -71688,7 +71777,7 @@ var init_sticky3 = __esm({
|
|
|
71688
71777
|
}
|
|
71689
71778
|
cliOutput({ sticky: data }, { command: "sticky show", operation: "sticky.show" });
|
|
71690
71779
|
} catch (err) {
|
|
71691
|
-
if (err instanceof
|
|
71780
|
+
if (err instanceof CleoError11) {
|
|
71692
71781
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
71693
71782
|
process.exit(err.code);
|
|
71694
71783
|
}
|
|
@@ -71766,7 +71855,7 @@ var init_sticky3 = __esm({
|
|
|
71766
71855
|
operation: "sticky.convert"
|
|
71767
71856
|
});
|
|
71768
71857
|
} catch (err) {
|
|
71769
|
-
if (err instanceof
|
|
71858
|
+
if (err instanceof CleoError11) {
|
|
71770
71859
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
71771
71860
|
process.exit(err.code);
|
|
71772
71861
|
}
|
|
@@ -71793,7 +71882,7 @@ var init_sticky3 = __esm({
|
|
|
71793
71882
|
{ command: "sticky archive", operation: "sticky.archive" }
|
|
71794
71883
|
);
|
|
71795
71884
|
} catch (err) {
|
|
71796
|
-
if (err instanceof
|
|
71885
|
+
if (err instanceof CleoError11) {
|
|
71797
71886
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
71798
71887
|
process.exit(err.code);
|
|
71799
71888
|
}
|
|
@@ -71820,7 +71909,7 @@ var init_sticky3 = __esm({
|
|
|
71820
71909
|
{ command: "sticky purge", operation: "sticky.purge" }
|
|
71821
71910
|
);
|
|
71822
71911
|
} catch (err) {
|
|
71823
|
-
if (err instanceof
|
|
71912
|
+
if (err instanceof CleoError11) {
|
|
71824
71913
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
71825
71914
|
process.exit(err.code);
|
|
71826
71915
|
}
|
|
@@ -72267,13 +72356,13 @@ var init_telemetry2 = __esm({
|
|
|
72267
72356
|
// packages/cleo/src/cli/commands/templates/lib.ts
|
|
72268
72357
|
import { readFileSync as readFileSync15 } from "node:fs";
|
|
72269
72358
|
import { isAbsolute as isAbsolute3, resolve as resolve8 } from "node:path";
|
|
72270
|
-
import { getProjectRoot as
|
|
72359
|
+
import { getProjectRoot as getProjectRoot56 } from "@cleocode/core";
|
|
72271
72360
|
import { resolveSourcePathAbsolute } from "@cleocode/core/templates/registry";
|
|
72272
72361
|
function resolveProjectRoot6(raw) {
|
|
72273
72362
|
if (typeof raw === "string" && raw.length > 0) {
|
|
72274
72363
|
return isAbsolute3(raw) ? raw : resolve8(process.cwd(), raw);
|
|
72275
72364
|
}
|
|
72276
|
-
return
|
|
72365
|
+
return getProjectRoot56();
|
|
72277
72366
|
}
|
|
72278
72367
|
function readTemplateSource(entry) {
|
|
72279
72368
|
const sourceAbsolute = resolveSourcePathAbsolute(entry);
|
|
@@ -73057,7 +73146,7 @@ __export(token_exports, {
|
|
|
73057
73146
|
tokenCommand: () => tokenCommand
|
|
73058
73147
|
});
|
|
73059
73148
|
import { readFileSync as readFileSync19 } from "node:fs";
|
|
73060
|
-
import { getProjectRoot as
|
|
73149
|
+
import { getProjectRoot as getProjectRoot57, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
|
|
73061
73150
|
function readPayload(args, textKey, fileKey) {
|
|
73062
73151
|
const text = args[textKey];
|
|
73063
73152
|
const file = args[fileKey];
|
|
@@ -73221,7 +73310,7 @@ var init_token = __esm({
|
|
|
73221
73310
|
domain: args.domain,
|
|
73222
73311
|
operation: args.operation
|
|
73223
73312
|
};
|
|
73224
|
-
const result = args.record ? await recordTokenExchange2(
|
|
73313
|
+
const result = args.record ? await recordTokenExchange2(getProjectRoot57(), input2) : await measureTokenExchange(input2);
|
|
73225
73314
|
cliOutput(result, {
|
|
73226
73315
|
command: "token",
|
|
73227
73316
|
operation: args.record ? "admin.token.record" : "token.estimate"
|
|
@@ -73257,7 +73346,7 @@ __export(transcript_exports, {
|
|
|
73257
73346
|
});
|
|
73258
73347
|
import { homedir as homedir6 } from "node:os";
|
|
73259
73348
|
import { join as join34 } from "node:path";
|
|
73260
|
-
import { getProjectRoot as
|
|
73349
|
+
import { getProjectRoot as getProjectRoot58 } from "@cleocode/core";
|
|
73261
73350
|
import {
|
|
73262
73351
|
parseDurationMs,
|
|
73263
73352
|
pruneTranscripts,
|
|
@@ -73287,7 +73376,7 @@ var init_transcript = __esm({
|
|
|
73287
73376
|
async run({ args }) {
|
|
73288
73377
|
if (args.pending) {
|
|
73289
73378
|
try {
|
|
73290
|
-
const projectRoot =
|
|
73379
|
+
const projectRoot = getProjectRoot58();
|
|
73291
73380
|
const { scanPendingTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
73292
73381
|
const pending = await scanPendingTranscripts(projectRoot);
|
|
73293
73382
|
cliOutput(
|
|
@@ -73384,7 +73473,7 @@ var init_transcript = __esm({
|
|
|
73384
73473
|
async run({ args }) {
|
|
73385
73474
|
const tier = args.tier ?? "warm";
|
|
73386
73475
|
const dryRun = args["dry-run"] ?? false;
|
|
73387
|
-
const projectRoot =
|
|
73476
|
+
const projectRoot = getProjectRoot58();
|
|
73388
73477
|
try {
|
|
73389
73478
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
73390
73479
|
const { findSessionTranscriptPath, listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -73496,7 +73585,7 @@ var init_transcript = __esm({
|
|
|
73496
73585
|
const dryRun = args["dry-run"] ?? false;
|
|
73497
73586
|
const olderThanHours = args["older-than-hours"] ? Number.parseInt(args["older-than-hours"], 10) : 24;
|
|
73498
73587
|
const limit = args.limit ? Number.parseInt(args.limit, 10) : void 0;
|
|
73499
|
-
const projectRoot =
|
|
73588
|
+
const projectRoot = getProjectRoot58();
|
|
73500
73589
|
try {
|
|
73501
73590
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
73502
73591
|
const { listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -74150,7 +74239,7 @@ __export(upgrade_exports, {
|
|
|
74150
74239
|
upgradeCommand: () => upgradeCommand
|
|
74151
74240
|
});
|
|
74152
74241
|
import { resolve as resolve9 } from "node:path";
|
|
74153
|
-
import { CleoError as
|
|
74242
|
+
import { CleoError as CleoError12, diagnoseUpgrade, runUpgrade as runUpgrade2, upgradeWorkflows as upgradeWorkflows2 } from "@cleocode/core/internal";
|
|
74154
74243
|
var workflowsSubcommand, upgradeCommand;
|
|
74155
74244
|
var init_upgrade3 = __esm({
|
|
74156
74245
|
"packages/cleo/src/cli/commands/upgrade.ts"() {
|
|
@@ -74217,7 +74306,7 @@ var init_upgrade3 = __esm({
|
|
|
74217
74306
|
process.exit(1);
|
|
74218
74307
|
}
|
|
74219
74308
|
} catch (err) {
|
|
74220
|
-
if (err instanceof
|
|
74309
|
+
if (err instanceof CleoError12) {
|
|
74221
74310
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
74222
74311
|
process.exit(err.code);
|
|
74223
74312
|
}
|
|
@@ -74343,7 +74432,7 @@ var init_upgrade3 = __esm({
|
|
|
74343
74432
|
}
|
|
74344
74433
|
progress.complete(isDryRun ? "Preview complete" : "Upgrade complete");
|
|
74345
74434
|
} catch (err) {
|
|
74346
|
-
if (err instanceof
|
|
74435
|
+
if (err instanceof CleoError12) {
|
|
74347
74436
|
progress.error(err.message);
|
|
74348
74437
|
cliError(
|
|
74349
74438
|
err.message,
|
|
@@ -74653,7 +74742,7 @@ __export(web_exports, {
|
|
|
74653
74742
|
});
|
|
74654
74743
|
import { spawn as spawn4 } from "node:child_process";
|
|
74655
74744
|
import { rm as rm2 } from "node:fs/promises";
|
|
74656
|
-
import { CleoError as
|
|
74745
|
+
import { CleoError as CleoError13, formatError as formatError5 } from "@cleocode/core";
|
|
74657
74746
|
var startCommand9, stopCommand6, restartCommand, statusCommand18, openCommand3, webCommand;
|
|
74658
74747
|
var init_web = __esm({
|
|
74659
74748
|
"packages/cleo/src/cli/commands/web.ts"() {
|
|
@@ -74694,7 +74783,7 @@ var init_web = __esm({
|
|
|
74694
74783
|
{ command: "web", message: `CLEO Web UI running on port ${ctx.port}` }
|
|
74695
74784
|
);
|
|
74696
74785
|
} catch (err) {
|
|
74697
|
-
if (err instanceof
|
|
74786
|
+
if (err instanceof CleoError13) {
|
|
74698
74787
|
console.error(formatError5(err));
|
|
74699
74788
|
process.exit(err.code);
|
|
74700
74789
|
}
|
|
@@ -74726,7 +74815,7 @@ var init_web = __esm({
|
|
|
74726
74815
|
});
|
|
74727
74816
|
cliOutput({ stopped: true }, { command: "web", message: "CLEO Web UI stopped" });
|
|
74728
74817
|
} catch (err) {
|
|
74729
|
-
if (err instanceof
|
|
74818
|
+
if (err instanceof CleoError13) {
|
|
74730
74819
|
console.error(formatError5(err));
|
|
74731
74820
|
process.exit(err.code);
|
|
74732
74821
|
}
|
|
@@ -74780,7 +74869,7 @@ var init_web = __esm({
|
|
|
74780
74869
|
{ command: "web", message: `CLEO Web UI running on port ${ctx.port}` }
|
|
74781
74870
|
);
|
|
74782
74871
|
} catch (err) {
|
|
74783
|
-
if (err instanceof
|
|
74872
|
+
if (err instanceof CleoError13) {
|
|
74784
74873
|
console.error(formatError5(err));
|
|
74785
74874
|
process.exit(err.code);
|
|
74786
74875
|
}
|
|
@@ -74795,7 +74884,7 @@ var init_web = __esm({
|
|
|
74795
74884
|
const status = await getWebStatus();
|
|
74796
74885
|
cliOutput(status, { command: "web" });
|
|
74797
74886
|
} catch (err) {
|
|
74798
|
-
if (err instanceof
|
|
74887
|
+
if (err instanceof CleoError13) {
|
|
74799
74888
|
console.error(formatError5(err));
|
|
74800
74889
|
process.exit(err.code);
|
|
74801
74890
|
}
|
|
@@ -74809,7 +74898,7 @@ var init_web = __esm({
|
|
|
74809
74898
|
try {
|
|
74810
74899
|
const status = await getWebStatus();
|
|
74811
74900
|
if (!status.running || !status.url) {
|
|
74812
|
-
throw new
|
|
74901
|
+
throw new CleoError13(
|
|
74813
74902
|
1 /* GENERAL_ERROR */,
|
|
74814
74903
|
"Web server is not running. Start with: cleo web start"
|
|
74815
74904
|
);
|
|
@@ -74828,7 +74917,7 @@ var init_web = __esm({
|
|
|
74828
74917
|
}
|
|
74829
74918
|
cliOutput({ url }, { command: "web", message: `Open browser to: ${url}` });
|
|
74830
74919
|
} catch (err) {
|
|
74831
|
-
if (err instanceof
|
|
74920
|
+
if (err instanceof CleoError13) {
|
|
74832
74921
|
console.error(formatError5(err));
|
|
74833
74922
|
process.exit(err.code);
|
|
74834
74923
|
}
|
|
@@ -74971,9 +75060,9 @@ var init_workgraph2 = __esm({
|
|
|
74971
75060
|
},
|
|
74972
75061
|
async run({ args }) {
|
|
74973
75062
|
const { generatePlanningDoc } = await import("@cleocode/core/workgraph");
|
|
74974
|
-
const { getProjectRoot:
|
|
75063
|
+
const { getProjectRoot: getProjectRoot60 } = await import("@cleocode/core");
|
|
74975
75064
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
74976
|
-
const projectRoot =
|
|
75065
|
+
const projectRoot = getProjectRoot60();
|
|
74977
75066
|
const audience = String(args.audience) === "agent" ? "agent" : "maintainer";
|
|
74978
75067
|
const result = await generatePlanningDoc(projectRoot, {
|
|
74979
75068
|
sagaId: String(args.sagaId),
|
|
@@ -74990,9 +75079,9 @@ var init_workgraph2 = __esm({
|
|
|
74990
75079
|
async run() {
|
|
74991
75080
|
const { validateWorkGraphStructure } = await import("@cleocode/core/workgraph");
|
|
74992
75081
|
const { taskList: taskList2 } = await import("@cleocode/core/internal");
|
|
74993
|
-
const { getProjectRoot:
|
|
75082
|
+
const { getProjectRoot: getProjectRoot60 } = await import("@cleocode/core");
|
|
74994
75083
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
74995
|
-
const projectRoot =
|
|
75084
|
+
const projectRoot = getProjectRoot60();
|
|
74996
75085
|
const listResult = await taskList2(projectRoot, { limit: 5e3 });
|
|
74997
75086
|
const tasks = listResult.success ? listResult.data?.tasks ?? [] : [];
|
|
74998
75087
|
const nodes = tasks.map((t) => ({
|
|
@@ -75011,9 +75100,9 @@ var init_workgraph2 = __esm({
|
|
|
75011
75100
|
description: "One-shot saga-to-saga workgraph dashboard (tracking checklist)"
|
|
75012
75101
|
},
|
|
75013
75102
|
async run() {
|
|
75014
|
-
const { sagas: sagas2, getProjectRoot:
|
|
75103
|
+
const { sagas: sagas2, getProjectRoot: getProjectRoot60 } = await import("@cleocode/core");
|
|
75015
75104
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
75016
|
-
const projectRoot =
|
|
75105
|
+
const projectRoot = getProjectRoot60();
|
|
75017
75106
|
const listResult = await sagas2.sagaList(projectRoot);
|
|
75018
75107
|
if (!listResult.success) {
|
|
75019
75108
|
cliOutput2(listResult, { command: "workgraph", operation: "workgraph.status" });
|
|
@@ -75079,7 +75168,7 @@ __export(worktree_exports, {
|
|
|
75079
75168
|
worktreeCommand: () => worktreeCommand
|
|
75080
75169
|
});
|
|
75081
75170
|
import readline4 from "node:readline";
|
|
75082
|
-
import { getProjectRoot as
|
|
75171
|
+
import { getProjectRoot as getProjectRoot59, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
|
|
75083
75172
|
async function promptYesNo2(question) {
|
|
75084
75173
|
return new Promise((resolve11) => {
|
|
75085
75174
|
const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -75184,7 +75273,7 @@ var init_worktree3 = __esm({
|
|
|
75184
75273
|
const staleDays = staleDaysRaw !== void 0 ? Number.parseInt(staleDaysRaw, 10) : void 0;
|
|
75185
75274
|
const idleDaysRaw = typeof args["idle-days"] === "string" ? args["idle-days"] : void 0;
|
|
75186
75275
|
const idleDays = idleDaysRaw !== void 0 ? Number.parseInt(idleDaysRaw, 10) : void 0;
|
|
75187
|
-
const projectRoot =
|
|
75276
|
+
const projectRoot = getProjectRoot59();
|
|
75188
75277
|
const listResult = await listWorktrees2({
|
|
75189
75278
|
projectRoot,
|
|
75190
75279
|
...staleDays !== void 0 && !Number.isNaN(staleDays) ? { staleDays } : {}
|
|
@@ -76840,7 +76929,7 @@ async function runStartupMaintenance() {
|
|
|
76840
76929
|
detectAndRemoveStrayProjectNexus,
|
|
76841
76930
|
getGlobalSalt,
|
|
76842
76931
|
getLogger: getLogger21,
|
|
76843
|
-
getProjectRoot:
|
|
76932
|
+
getProjectRoot: getProjectRoot60,
|
|
76844
76933
|
isCleanupMarkerSet,
|
|
76845
76934
|
migrateSignaldockToConduit,
|
|
76846
76935
|
needsSignaldockToConduitMigration,
|
|
@@ -76849,7 +76938,7 @@ async function runStartupMaintenance() {
|
|
|
76849
76938
|
} = await import("@cleocode/core/internal");
|
|
76850
76939
|
let projectRootForCleanup = "";
|
|
76851
76940
|
try {
|
|
76852
|
-
projectRootForCleanup =
|
|
76941
|
+
projectRootForCleanup = getProjectRoot60();
|
|
76853
76942
|
} catch {
|
|
76854
76943
|
}
|
|
76855
76944
|
if (!isCleanupMarkerSet(CLI_VERSION, projectRootForCleanup)) {
|
|
@@ -76869,7 +76958,7 @@ async function runStartupMaintenance() {
|
|
|
76869
76958
|
const isInitInvocation = process.argv.slice(2).some((a) => a === "init");
|
|
76870
76959
|
if (!isInitInvocation) {
|
|
76871
76960
|
try {
|
|
76872
|
-
const _projectRootForMigration =
|
|
76961
|
+
const _projectRootForMigration = getProjectRoot60();
|
|
76873
76962
|
if (needsSignaldockToConduitMigration(_projectRootForMigration)) {
|
|
76874
76963
|
const migrationResult = await migrateSignaldockToConduit(_projectRootForMigration);
|
|
76875
76964
|
if (migrationResult.status === "failed") {
|