@cleocode/cleo 2026.5.132 → 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 +694 -137
- package/dist/cli/index.js.map +3 -3
- package/package.json +13 -13
- package/scripts/install-daemon-service.mjs +59 -12
package/dist/cli/index.js
CHANGED
|
@@ -27495,6 +27495,70 @@ function iterationCapFor(node, runtimeDefault) {
|
|
|
27495
27495
|
if (typeof cap === "number" && Number.isFinite(cap) && cap >= 0) return cap;
|
|
27496
27496
|
return runtimeDefault;
|
|
27497
27497
|
}
|
|
27498
|
+
function validateDecompositionTaskTree(nodeId, taskTree2) {
|
|
27499
|
+
if (!Array.isArray(taskTree2)) {
|
|
27500
|
+
return `ensures.schema[task_tree] on ${nodeId}: task_tree must be a non-empty array, got ${typeof taskTree2}`;
|
|
27501
|
+
}
|
|
27502
|
+
if (taskTree2.length === 0) {
|
|
27503
|
+
return `ensures.schema[task_tree] on ${nodeId}: task_tree is an empty array \u2014 decomposition produced no tasks`;
|
|
27504
|
+
}
|
|
27505
|
+
const knownIds = /* @__PURE__ */ new Set();
|
|
27506
|
+
for (const entry of taskTree2) {
|
|
27507
|
+
if (typeof entry.id === "string") {
|
|
27508
|
+
knownIds.add(entry.id);
|
|
27509
|
+
}
|
|
27510
|
+
}
|
|
27511
|
+
for (let i = 0; i < taskTree2.length; i++) {
|
|
27512
|
+
const entry = taskTree2[i];
|
|
27513
|
+
if (typeof entry !== "object" || entry === null) {
|
|
27514
|
+
return `ensures.schema[task_tree] on ${nodeId}: entry[${i}] must be an object, got ${entry === null ? "null" : typeof entry}`;
|
|
27515
|
+
}
|
|
27516
|
+
if (typeof entry.title !== "string" || entry.title.trim().length === 0) {
|
|
27517
|
+
return `ensures.schema[task_tree] on ${nodeId}: entry[${i}].title must be a non-empty string`;
|
|
27518
|
+
}
|
|
27519
|
+
if (!Array.isArray(entry.acceptance) || entry.acceptance.length === 0) {
|
|
27520
|
+
return `ensures.schema[task_tree] on ${nodeId}: entry[${i}] ("${entry.title}") must have a non-empty acceptance array`;
|
|
27521
|
+
}
|
|
27522
|
+
const hasValidAc = entry.acceptance.some(
|
|
27523
|
+
(ac) => typeof ac === "string" && ac.trim().length > 0
|
|
27524
|
+
);
|
|
27525
|
+
if (!hasValidAc) {
|
|
27526
|
+
return `ensures.schema[task_tree] on ${nodeId}: entry[${i}] ("${entry.title}") acceptance array contains no non-empty strings`;
|
|
27527
|
+
}
|
|
27528
|
+
if (Array.isArray(entry.depends) && knownIds.size > 0) {
|
|
27529
|
+
for (const depId of entry.depends) {
|
|
27530
|
+
if (typeof depId === "string" && /^T\d{3,}$/.test(depId) && !knownIds.has(depId)) {
|
|
27531
|
+
}
|
|
27532
|
+
}
|
|
27533
|
+
}
|
|
27534
|
+
}
|
|
27535
|
+
return null;
|
|
27536
|
+
}
|
|
27537
|
+
function validateIvtrEvidenceOutput(nodeId, evidence) {
|
|
27538
|
+
if (evidence === null || evidence === void 0) {
|
|
27539
|
+
return `ensures.schema[evidence] on ${nodeId}: evidence must be present (non-null, non-undefined)`;
|
|
27540
|
+
}
|
|
27541
|
+
if (typeof evidence === "string") {
|
|
27542
|
+
if (evidence.trim().length === 0) {
|
|
27543
|
+
return `ensures.schema[evidence] on ${nodeId}: evidence string must not be empty`;
|
|
27544
|
+
}
|
|
27545
|
+
return null;
|
|
27546
|
+
}
|
|
27547
|
+
if (Array.isArray(evidence)) {
|
|
27548
|
+
if (evidence.length === 0) {
|
|
27549
|
+
return `ensures.schema[evidence] on ${nodeId}: evidence array must not be empty`;
|
|
27550
|
+
}
|
|
27551
|
+
return null;
|
|
27552
|
+
}
|
|
27553
|
+
if (typeof evidence === "object") {
|
|
27554
|
+
const keys = Object.keys(evidence);
|
|
27555
|
+
if (keys.length === 0) {
|
|
27556
|
+
return `ensures.schema[evidence] on ${nodeId}: evidence object must have at least one key (got {})`;
|
|
27557
|
+
}
|
|
27558
|
+
return null;
|
|
27559
|
+
}
|
|
27560
|
+
return `ensures.schema[evidence] on ${nodeId}: evidence must be a string, array, or object (got ${typeof evidence})`;
|
|
27561
|
+
}
|
|
27498
27562
|
async function runFromNode(args) {
|
|
27499
27563
|
const {
|
|
27500
27564
|
db,
|
|
@@ -27593,6 +27657,39 @@ async function runFromNode(args) {
|
|
|
27593
27657
|
}
|
|
27594
27658
|
}
|
|
27595
27659
|
}
|
|
27660
|
+
if (node.ensures?.schema) {
|
|
27661
|
+
let schemaViolation = null;
|
|
27662
|
+
if (node.ensures.schema === "task_tree") {
|
|
27663
|
+
schemaViolation = validateDecompositionTaskTree(node.id, context["task_tree"]);
|
|
27664
|
+
} else if (node.ensures.schema === "evidence") {
|
|
27665
|
+
schemaViolation = validateIvtrEvidenceOutput(node.id, context["evidence"]);
|
|
27666
|
+
}
|
|
27667
|
+
if (schemaViolation !== null) {
|
|
27668
|
+
auditContractViolation(
|
|
27669
|
+
args.projectRoot,
|
|
27670
|
+
run.runId,
|
|
27671
|
+
node.id,
|
|
27672
|
+
"ensures",
|
|
27673
|
+
node.ensures.schema,
|
|
27674
|
+
playbook.name
|
|
27675
|
+
);
|
|
27676
|
+
const handled = handleContractErrorHandler(
|
|
27677
|
+
playbook,
|
|
27678
|
+
"contract_violation",
|
|
27679
|
+
schemaViolation
|
|
27680
|
+
);
|
|
27681
|
+
if (handled === "abort") {
|
|
27682
|
+
failedNodeId = node.id;
|
|
27683
|
+
lastError = schemaViolation;
|
|
27684
|
+
} else {
|
|
27685
|
+
context["__ensuresSchemaViolation"] = schemaViolation;
|
|
27686
|
+
if (handled === "hitl_escalate") {
|
|
27687
|
+
exceededNodeId = node.id;
|
|
27688
|
+
}
|
|
27689
|
+
}
|
|
27690
|
+
}
|
|
27691
|
+
}
|
|
27692
|
+
if (failedNodeId !== void 0) break;
|
|
27596
27693
|
const nextId = resolveNextNodeId(node.id, edgeIndex);
|
|
27597
27694
|
if (nextId !== null) {
|
|
27598
27695
|
const edge = resolveEdge(node.id, nextId, playbook.edges);
|
|
@@ -27908,6 +28005,8 @@ __export(src_exports, {
|
|
|
27908
28005
|
resumePlaybook: () => resumePlaybook,
|
|
27909
28006
|
updatePlaybookApproval: () => updatePlaybookApproval,
|
|
27910
28007
|
updatePlaybookRun: () => updatePlaybookRun,
|
|
28008
|
+
validateDecompositionTaskTree: () => validateDecompositionTaskTree,
|
|
28009
|
+
validateIvtrEvidenceOutput: () => validateIvtrEvidenceOutput,
|
|
27911
28010
|
validatePlaybookCompliance: () => validatePlaybookCompliance
|
|
27912
28011
|
});
|
|
27913
28012
|
var PLAYBOOKS_PACKAGE_VERSION;
|
|
@@ -27974,8 +28073,8 @@ async function loadPlaybookByName(name) {
|
|
|
27974
28073
|
return null;
|
|
27975
28074
|
}
|
|
27976
28075
|
try {
|
|
27977
|
-
const { getProjectRoot:
|
|
27978
|
-
const projectRoot = __playbookRuntimeOverrides.projectRoot ??
|
|
28076
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core/internal");
|
|
28077
|
+
const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot58();
|
|
27979
28078
|
const resolved = resolvePlaybook(name, {
|
|
27980
28079
|
projectRoot,
|
|
27981
28080
|
globalPlaybooksDir: __playbookRuntimeOverrides.globalPlaybooksDir,
|
|
@@ -28019,8 +28118,8 @@ async function acquireDb() {
|
|
|
28019
28118
|
async function buildDefaultDispatcher() {
|
|
28020
28119
|
if (__playbookRuntimeOverrides.dispatcher) return __playbookRuntimeOverrides.dispatcher;
|
|
28021
28120
|
const { orchestrateSpawnExecute: orchestrateSpawnExecute2 } = await import("@cleocode/runtime/gateway");
|
|
28022
|
-
const { getProjectRoot:
|
|
28023
|
-
const projectRoot =
|
|
28121
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core/internal");
|
|
28122
|
+
const projectRoot = getProjectRoot58();
|
|
28024
28123
|
return {
|
|
28025
28124
|
async dispatch(input2) {
|
|
28026
28125
|
try {
|
|
@@ -28210,8 +28309,8 @@ var init_playbook2 = __esm({
|
|
|
28210
28309
|
projectRoot = __playbookRuntimeOverrides.projectRoot;
|
|
28211
28310
|
} else {
|
|
28212
28311
|
try {
|
|
28213
|
-
const { getProjectRoot:
|
|
28214
|
-
projectRoot =
|
|
28312
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core/internal");
|
|
28313
|
+
projectRoot = getProjectRoot58();
|
|
28215
28314
|
} catch {
|
|
28216
28315
|
projectRoot = void 0;
|
|
28217
28316
|
}
|
|
@@ -28275,14 +28374,14 @@ var init_playbook2 = __esm({
|
|
|
28275
28374
|
const dispatcher = await buildDefaultDispatcher();
|
|
28276
28375
|
let result;
|
|
28277
28376
|
try {
|
|
28278
|
-
const { getProjectRoot:
|
|
28377
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core/internal");
|
|
28279
28378
|
const opts = {
|
|
28280
28379
|
db,
|
|
28281
28380
|
playbook: parsed.definition,
|
|
28282
28381
|
playbookHash: parsed.sourceHash,
|
|
28283
28382
|
initialContext,
|
|
28284
28383
|
dispatcher,
|
|
28285
|
-
projectRoot:
|
|
28384
|
+
projectRoot: getProjectRoot58()
|
|
28286
28385
|
};
|
|
28287
28386
|
if (__playbookRuntimeOverrides.approvalSecret !== void 0) {
|
|
28288
28387
|
opts.approvalSecret = __playbookRuntimeOverrides.approvalSecret;
|
|
@@ -28523,7 +28622,7 @@ async function orchestrateAnalyzeOp(params) {
|
|
|
28523
28622
|
return orchestrateAnalyze(params.epicId, getProjectRoot11(), params.mode);
|
|
28524
28623
|
}
|
|
28525
28624
|
async function orchestrateClassifyOp(params) {
|
|
28526
|
-
return orchestrateClassify(params.request, params.context, getProjectRoot11());
|
|
28625
|
+
return orchestrateClassify(params.request, params.context, getProjectRoot11(), params.taskId);
|
|
28527
28626
|
}
|
|
28528
28627
|
function orchestrateFanoutStatusOp(params) {
|
|
28529
28628
|
const entry = fanoutManifestStore.get(params.manifestEntryId);
|
|
@@ -28672,7 +28771,69 @@ async function orchestrateApproveOp(params) {
|
|
|
28672
28771
|
async function orchestrateRejectOp(params) {
|
|
28673
28772
|
return Promise.resolve({ success: true, data: params });
|
|
28674
28773
|
}
|
|
28675
|
-
async function orchestrateClassify(request, context, projectRoot) {
|
|
28774
|
+
async function orchestrateClassify(request, context, projectRoot, taskId) {
|
|
28775
|
+
if (taskId) {
|
|
28776
|
+
try {
|
|
28777
|
+
const { getDb: getDb3 } = await import("@cleocode/core/internal");
|
|
28778
|
+
const { tasks } = await import("@cleocode/core/store/tasks-schema");
|
|
28779
|
+
const { eq: eq2 } = await import("drizzle-orm");
|
|
28780
|
+
const { classifyTask: classifyTask2 } = await import("@cleocode/core");
|
|
28781
|
+
const db = await getDb3(projectRoot);
|
|
28782
|
+
const row = await db.select().from(tasks).where(eq2(tasks.id, taskId)).get();
|
|
28783
|
+
if (!row) {
|
|
28784
|
+
return {
|
|
28785
|
+
success: false,
|
|
28786
|
+
error: {
|
|
28787
|
+
code: "E_NOT_FOUND",
|
|
28788
|
+
message: `Task ${taskId} not found`
|
|
28789
|
+
}
|
|
28790
|
+
};
|
|
28791
|
+
}
|
|
28792
|
+
const task = {
|
|
28793
|
+
id: row.id,
|
|
28794
|
+
title: row.title,
|
|
28795
|
+
description: row.description ?? "",
|
|
28796
|
+
status: row.status,
|
|
28797
|
+
priority: row.priority ?? "medium",
|
|
28798
|
+
type: row.type ?? void 0,
|
|
28799
|
+
kind: row.kind ?? void 0,
|
|
28800
|
+
size: row.size ?? void 0,
|
|
28801
|
+
labels: (() => {
|
|
28802
|
+
try {
|
|
28803
|
+
const parsed = JSON.parse(row.labelsJson ?? "[]");
|
|
28804
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
28805
|
+
} catch {
|
|
28806
|
+
return [];
|
|
28807
|
+
}
|
|
28808
|
+
})(),
|
|
28809
|
+
createdAt: row.createdAt
|
|
28810
|
+
};
|
|
28811
|
+
const result = classifyTask2(task);
|
|
28812
|
+
return {
|
|
28813
|
+
success: true,
|
|
28814
|
+
data: {
|
|
28815
|
+
team: result.agentId,
|
|
28816
|
+
lead: result.role === "lead" ? result.agentId : null,
|
|
28817
|
+
protocol: result.role,
|
|
28818
|
+
stage: null,
|
|
28819
|
+
confidence: result.confidence,
|
|
28820
|
+
reasoning: result.warning ? `${result.reason} | warning: ${result.warning}` : result.reason
|
|
28821
|
+
}
|
|
28822
|
+
};
|
|
28823
|
+
} catch (error) {
|
|
28824
|
+
getLogger8("domain:orchestrate").error(
|
|
28825
|
+
{ operation: "classify", taskId, err: error },
|
|
28826
|
+
error instanceof Error ? error.message : String(error)
|
|
28827
|
+
);
|
|
28828
|
+
return {
|
|
28829
|
+
success: false,
|
|
28830
|
+
error: {
|
|
28831
|
+
code: "E_CLASSIFY_FAILED",
|
|
28832
|
+
message: error instanceof Error ? error.message : String(error)
|
|
28833
|
+
}
|
|
28834
|
+
};
|
|
28835
|
+
}
|
|
28836
|
+
}
|
|
28676
28837
|
try {
|
|
28677
28838
|
const { getCleoCantWorkflowsDir } = await import("@cleocode/core/internal");
|
|
28678
28839
|
const { readFileSync: readFileSync22, readdirSync: readdirSync3, existsSync: existsSync21 } = await import("node:fs");
|
|
@@ -28734,6 +28895,9 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
28734
28895
|
}
|
|
28735
28896
|
matches.sort((a, b) => b.score - a.score);
|
|
28736
28897
|
const best = matches[0];
|
|
28898
|
+
const allHintWords = best.consultWhen.toLowerCase().split(/\s+/).filter(Boolean);
|
|
28899
|
+
const normalised = allHintWords.length > 0 ? Math.min(best.score / allHintWords.length, 1) : 0;
|
|
28900
|
+
const confidence = best.score > 0 ? Math.max(normalised, 0.5) : 0.1;
|
|
28737
28901
|
return {
|
|
28738
28902
|
success: true,
|
|
28739
28903
|
data: {
|
|
@@ -28741,7 +28905,7 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
28741
28905
|
lead: null,
|
|
28742
28906
|
protocol: "base-subagent",
|
|
28743
28907
|
stage: best.stages[0] ?? null,
|
|
28744
|
-
confidence
|
|
28908
|
+
confidence,
|
|
28745
28909
|
reasoning: best.score > 0 ? `Matched team '${best.team}' via consult-when hint: "${best.consultWhen}"` : `No strong match found; defaulting to first registered team '${best.team}'`
|
|
28746
28910
|
}
|
|
28747
28911
|
};
|
|
@@ -34920,11 +35084,11 @@ var init_security = __esm({
|
|
|
34920
35084
|
});
|
|
34921
35085
|
|
|
34922
35086
|
// packages/cleo/src/dispatch/middleware/sanitizer.ts
|
|
34923
|
-
function createSanitizer(
|
|
35087
|
+
function createSanitizer(getProjectRoot58) {
|
|
34924
35088
|
return async (req, next) => {
|
|
34925
35089
|
if (req.params) {
|
|
34926
35090
|
try {
|
|
34927
|
-
const root =
|
|
35091
|
+
const root = getProjectRoot58 ? getProjectRoot58() : void 0;
|
|
34928
35092
|
req.params = sanitizeParams(req.params, root, {
|
|
34929
35093
|
domain: req.domain,
|
|
34930
35094
|
operation: req.operation
|
|
@@ -39408,8 +39572,8 @@ var init_consent = __esm({
|
|
|
39408
39572
|
const a = args;
|
|
39409
39573
|
const enableClaudeCode = a["enable-claude-code"] === true;
|
|
39410
39574
|
const disableClaudeCode = a["disable-claude-code"] === true;
|
|
39411
|
-
const
|
|
39412
|
-
if (!enableClaudeCode && !disableClaudeCode && !
|
|
39575
|
+
const showStatus2 = a["status"] === true;
|
|
39576
|
+
if (!enableClaudeCode && !disableClaudeCode && !showStatus2) {
|
|
39413
39577
|
cliError("Specify one of --enable-claude-code, --disable-claude-code, or --status.", 6, {
|
|
39414
39578
|
name: "E_INVALID_INPUT",
|
|
39415
39579
|
fix: "Run `cleo auth consent --status` to see current consent state."
|
|
@@ -39435,7 +39599,7 @@ var init_consent = __esm({
|
|
|
39435
39599
|
const CONSENT_KEY = "auth.claudeCodeConsentGiven";
|
|
39436
39600
|
const SOURCE_ID = "claude-code";
|
|
39437
39601
|
const PROVIDER = "anthropic";
|
|
39438
|
-
if (
|
|
39602
|
+
if (showStatus2) {
|
|
39439
39603
|
const resolved = await getConfigValue3(CONSENT_KEY);
|
|
39440
39604
|
const consentEnabled = resolved.value === true;
|
|
39441
39605
|
const suppressed = isSuppressed(PROVIDER, SOURCE_ID);
|
|
@@ -40725,9 +40889,9 @@ var init_backup = __esm({
|
|
|
40725
40889
|
async run({ args }) {
|
|
40726
40890
|
const scope = args.scope;
|
|
40727
40891
|
const { packBundle } = await import("@cleocode/core/store/backup-pack.js");
|
|
40728
|
-
const { getProjectRoot:
|
|
40892
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core");
|
|
40729
40893
|
const includesProject = scope === "project" || scope === "all";
|
|
40730
|
-
const projectRoot = includesProject ?
|
|
40894
|
+
const projectRoot = includesProject ? getProjectRoot58() : void 0;
|
|
40731
40895
|
let passphrase;
|
|
40732
40896
|
if (args.encrypt === true) {
|
|
40733
40897
|
passphrase = process.env["CLEO_BACKUP_PASSPHRASE"];
|
|
@@ -40803,12 +40967,12 @@ var init_backup = __esm({
|
|
|
40803
40967
|
},
|
|
40804
40968
|
async run({ args }) {
|
|
40805
40969
|
const bundlePath = args.bundle;
|
|
40806
|
-
const { getProjectRoot:
|
|
40970
|
+
const { getProjectRoot: getProjectRoot58, getCleoHome: getCleoHome6, getCleoVersion } = await import("@cleocode/core");
|
|
40807
40971
|
const { BundleError, cleanupStaging, unpackBundle } = await import("@cleocode/core/store/backup-unpack.js");
|
|
40808
40972
|
const { regenerateConfigJson, regenerateProjectContextJson, regenerateProjectInfoJson } = await import("@cleocode/core/store/regenerators.js");
|
|
40809
40973
|
const { regenerateAndCompare } = await import("@cleocode/core/store/restore-json-merge.js");
|
|
40810
40974
|
const { buildConflictReport, writeConflictReport } = await import("@cleocode/core/store/restore-conflict-report.js");
|
|
40811
|
-
const projectRoot =
|
|
40975
|
+
const projectRoot = getProjectRoot58();
|
|
40812
40976
|
if (args.force !== true) {
|
|
40813
40977
|
const existing = checkForExistingData(projectRoot, getCleoHome6());
|
|
40814
40978
|
if (existing.length > 0) {
|
|
@@ -43107,6 +43271,108 @@ var init_claim = __esm({
|
|
|
43107
43271
|
}
|
|
43108
43272
|
});
|
|
43109
43273
|
|
|
43274
|
+
// packages/cleo/src/cli/commands/classify.ts
|
|
43275
|
+
var classify_exports = {};
|
|
43276
|
+
__export(classify_exports, {
|
|
43277
|
+
classifyCommand: () => classifyCommand
|
|
43278
|
+
});
|
|
43279
|
+
import { classifyReadiness, classifyTask, getProjectRoot as getProjectRoot31 } from "@cleocode/core";
|
|
43280
|
+
var classifyCommand;
|
|
43281
|
+
var init_classify = __esm({
|
|
43282
|
+
"packages/cleo/src/cli/commands/classify.ts"() {
|
|
43283
|
+
"use strict";
|
|
43284
|
+
init_define_cli_command();
|
|
43285
|
+
init_renderers();
|
|
43286
|
+
classifyCommand = defineCommand({
|
|
43287
|
+
meta: {
|
|
43288
|
+
name: "classify",
|
|
43289
|
+
description: "Classify a task: readiness verdict (proceed|grill) + persona routing (agent, confidence)"
|
|
43290
|
+
},
|
|
43291
|
+
args: {
|
|
43292
|
+
taskId: {
|
|
43293
|
+
type: "positional",
|
|
43294
|
+
description: "Task ID to classify (e.g. T1234)",
|
|
43295
|
+
required: true
|
|
43296
|
+
}
|
|
43297
|
+
},
|
|
43298
|
+
async run({ args }) {
|
|
43299
|
+
const taskId = args.taskId;
|
|
43300
|
+
const projectRoot = getProjectRoot31();
|
|
43301
|
+
const { getDb: getDb3 } = await import("@cleocode/core/store/sqlite.js");
|
|
43302
|
+
const { tasks } = await import("@cleocode/core/store/tasks-schema");
|
|
43303
|
+
const { eq: eq2 } = await import("drizzle-orm");
|
|
43304
|
+
const db = await getDb3(projectRoot);
|
|
43305
|
+
const row = await db.select().from(tasks).where(eq2(tasks.id, taskId)).get();
|
|
43306
|
+
if (!row) {
|
|
43307
|
+
cliOutput(
|
|
43308
|
+
{
|
|
43309
|
+
success: false,
|
|
43310
|
+
error: { code: "E_NOT_FOUND", message: `Task ${taskId} not found` }
|
|
43311
|
+
},
|
|
43312
|
+
{ command: "classify", operation: "classify.show" }
|
|
43313
|
+
);
|
|
43314
|
+
return;
|
|
43315
|
+
}
|
|
43316
|
+
const labels = (() => {
|
|
43317
|
+
try {
|
|
43318
|
+
const parsed = JSON.parse(row.labelsJson ?? "[]");
|
|
43319
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
43320
|
+
} catch {
|
|
43321
|
+
return [];
|
|
43322
|
+
}
|
|
43323
|
+
})();
|
|
43324
|
+
const acceptance = (() => {
|
|
43325
|
+
try {
|
|
43326
|
+
const parsed = JSON.parse(row.acceptanceJson ?? "[]");
|
|
43327
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
43328
|
+
} catch {
|
|
43329
|
+
return [];
|
|
43330
|
+
}
|
|
43331
|
+
})();
|
|
43332
|
+
const task = {
|
|
43333
|
+
id: row.id,
|
|
43334
|
+
title: row.title,
|
|
43335
|
+
description: row.description ?? "",
|
|
43336
|
+
status: row.status,
|
|
43337
|
+
priority: row.priority ?? "medium",
|
|
43338
|
+
type: row.type ?? void 0,
|
|
43339
|
+
kind: row.kind ?? void 0,
|
|
43340
|
+
size: row.size ?? void 0,
|
|
43341
|
+
pipelineStage: row.pipelineStage ?? void 0,
|
|
43342
|
+
blockedBy: row.blockedBy ?? void 0,
|
|
43343
|
+
phase: row.phase ?? void 0,
|
|
43344
|
+
scope: row.scope ?? void 0,
|
|
43345
|
+
labels,
|
|
43346
|
+
acceptance,
|
|
43347
|
+
createdAt: row.createdAt
|
|
43348
|
+
};
|
|
43349
|
+
const readiness = classifyReadiness(task);
|
|
43350
|
+
const routing = classifyTask(task);
|
|
43351
|
+
cliOutput(
|
|
43352
|
+
{
|
|
43353
|
+
taskId: row.id,
|
|
43354
|
+
title: row.title,
|
|
43355
|
+
readiness: {
|
|
43356
|
+
verdict: readiness.verdict,
|
|
43357
|
+
reason: readiness.reason,
|
|
43358
|
+
triggers: readiness.triggers
|
|
43359
|
+
},
|
|
43360
|
+
routing: {
|
|
43361
|
+
agentId: routing.agentId,
|
|
43362
|
+
role: routing.role,
|
|
43363
|
+
confidence: routing.confidence,
|
|
43364
|
+
reason: routing.reason,
|
|
43365
|
+
usedFallback: routing.usedFallback,
|
|
43366
|
+
warning: routing.warning
|
|
43367
|
+
}
|
|
43368
|
+
},
|
|
43369
|
+
{ command: "classify", operation: "classify.show" }
|
|
43370
|
+
);
|
|
43371
|
+
}
|
|
43372
|
+
});
|
|
43373
|
+
}
|
|
43374
|
+
});
|
|
43375
|
+
|
|
43110
43376
|
// packages/cleo/src/cli/commands/code.ts
|
|
43111
43377
|
var code_exports = {};
|
|
43112
43378
|
__export(code_exports, {
|
|
@@ -43939,7 +44205,7 @@ var init_conduit3 = __esm({
|
|
|
43939
44205
|
});
|
|
43940
44206
|
|
|
43941
44207
|
// packages/cleo/src/cli/commands/config/drift-check.ts
|
|
43942
|
-
import { getProjectRoot as
|
|
44208
|
+
import { getProjectRoot as getProjectRoot32 } from "@cleocode/core";
|
|
43943
44209
|
import { checkDrift } from "@cleocode/core/config/registry";
|
|
43944
44210
|
function parseDriftScope(raw) {
|
|
43945
44211
|
const value = raw ?? "project";
|
|
@@ -43984,7 +44250,7 @@ var init_drift_check = __esm({
|
|
|
43984
44250
|
}
|
|
43985
44251
|
let driftResult;
|
|
43986
44252
|
try {
|
|
43987
|
-
const projectRoot =
|
|
44253
|
+
const projectRoot = getProjectRoot32();
|
|
43988
44254
|
driftResult = await checkDrift(scope, projectRoot);
|
|
43989
44255
|
} catch (err) {
|
|
43990
44256
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -44012,7 +44278,7 @@ var init_drift_check = __esm({
|
|
|
44012
44278
|
});
|
|
44013
44279
|
|
|
44014
44280
|
// packages/cleo/src/cli/commands/config/get.ts
|
|
44015
|
-
import { getProjectRoot as
|
|
44281
|
+
import { getProjectRoot as getProjectRoot33 } from "@cleocode/core";
|
|
44016
44282
|
import { getConfigValue } from "@cleocode/core/config/registry";
|
|
44017
44283
|
function parseResolveScope(raw) {
|
|
44018
44284
|
const value = raw ?? "merged";
|
|
@@ -44070,7 +44336,7 @@ var init_get = __esm({
|
|
|
44070
44336
|
}
|
|
44071
44337
|
let value;
|
|
44072
44338
|
try {
|
|
44073
|
-
const projectRoot =
|
|
44339
|
+
const projectRoot = getProjectRoot33();
|
|
44074
44340
|
value = await getConfigValue(key, { scope, projectRoot });
|
|
44075
44341
|
} catch (err) {
|
|
44076
44342
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -44099,7 +44365,7 @@ var init_get = __esm({
|
|
|
44099
44365
|
});
|
|
44100
44366
|
|
|
44101
44367
|
// packages/cleo/src/cli/commands/config/set.ts
|
|
44102
|
-
import { getProjectRoot as
|
|
44368
|
+
import { getProjectRoot as getProjectRoot34, parseConfigValue, setConfigValue } from "@cleocode/core";
|
|
44103
44369
|
import { validateConfig as validateConfig2 } from "@cleocode/core/config/registry";
|
|
44104
44370
|
function parseWriteScope(raw) {
|
|
44105
44371
|
const value = raw ?? "project";
|
|
@@ -44209,7 +44475,7 @@ var init_set = __esm({
|
|
|
44209
44475
|
let written;
|
|
44210
44476
|
let validate;
|
|
44211
44477
|
try {
|
|
44212
|
-
const projectRoot =
|
|
44478
|
+
const projectRoot = getProjectRoot34();
|
|
44213
44479
|
written = await setConfigValue(key, coerced, projectRoot, {
|
|
44214
44480
|
global: scope === "global"
|
|
44215
44481
|
});
|
|
@@ -44241,7 +44507,7 @@ var init_set = __esm({
|
|
|
44241
44507
|
});
|
|
44242
44508
|
|
|
44243
44509
|
// packages/cleo/src/cli/commands/config/show.ts
|
|
44244
|
-
import { getProjectRoot as
|
|
44510
|
+
import { getProjectRoot as getProjectRoot35 } from "@cleocode/core";
|
|
44245
44511
|
import {
|
|
44246
44512
|
resolveCleoConfig
|
|
44247
44513
|
} from "@cleocode/core/config/registry";
|
|
@@ -44287,7 +44553,7 @@ var init_show = __esm({
|
|
|
44287
44553
|
return;
|
|
44288
44554
|
}
|
|
44289
44555
|
try {
|
|
44290
|
-
const projectRoot =
|
|
44556
|
+
const projectRoot = getProjectRoot35();
|
|
44291
44557
|
const config = await resolveCleoConfig({ scope, projectRoot });
|
|
44292
44558
|
const result = { scope, config };
|
|
44293
44559
|
cliOutput(result, {
|
|
@@ -44307,7 +44573,7 @@ var init_show = __esm({
|
|
|
44307
44573
|
});
|
|
44308
44574
|
|
|
44309
44575
|
// packages/cleo/src/cli/commands/config/validate.ts
|
|
44310
|
-
import { getProjectRoot as
|
|
44576
|
+
import { getProjectRoot as getProjectRoot36 } from "@cleocode/core";
|
|
44311
44577
|
import { validateConfig as validateConfig3 } from "@cleocode/core/config/registry";
|
|
44312
44578
|
function parseValidateScope(raw) {
|
|
44313
44579
|
const value = raw ?? "project";
|
|
@@ -44352,7 +44618,7 @@ var init_validate2 = __esm({
|
|
|
44352
44618
|
}
|
|
44353
44619
|
let validate;
|
|
44354
44620
|
try {
|
|
44355
|
-
const projectRoot =
|
|
44621
|
+
const projectRoot = getProjectRoot36();
|
|
44356
44622
|
validate = await validateConfig3(scope, projectRoot);
|
|
44357
44623
|
} catch (err) {
|
|
44358
44624
|
const message = err instanceof Error ? err.message : String(err);
|
|
@@ -45169,22 +45435,40 @@ var init_daemon2 = __esm({
|
|
|
45169
45435
|
description: "Register the CLEO daemon as a user-level system service (systemd / launchd)"
|
|
45170
45436
|
},
|
|
45171
45437
|
args: {
|
|
45438
|
+
saga: {
|
|
45439
|
+
type: "string",
|
|
45440
|
+
description: "Scope the daemon to tasks within a Saga (sets CLEO_SENTIENT_SAGA in service env)",
|
|
45441
|
+
required: false
|
|
45442
|
+
},
|
|
45443
|
+
epic: {
|
|
45444
|
+
type: "string",
|
|
45445
|
+
description: "Scope the daemon to tasks directly under an Epic (sets CLEO_SENTIENT_EPIC in service env)",
|
|
45446
|
+
required: false
|
|
45447
|
+
},
|
|
45172
45448
|
json: {
|
|
45173
45449
|
type: "boolean",
|
|
45174
45450
|
description: "Output result as JSON"
|
|
45175
45451
|
}
|
|
45176
45452
|
},
|
|
45177
|
-
async run({ args
|
|
45453
|
+
async run({ args }) {
|
|
45178
45454
|
try {
|
|
45179
45455
|
const scriptPath = resolveDaemonInstallerScript();
|
|
45180
45456
|
const { installDaemonService } = await import(scriptPath);
|
|
45181
|
-
|
|
45457
|
+
const scopeSagaId = typeof args.saga === "string" && args.saga.length > 0 ? args.saga : void 0;
|
|
45458
|
+
const scopeEpicId = typeof args.epic === "string" && args.epic.length > 0 ? args.epic : void 0;
|
|
45459
|
+
await installDaemonService({ scopeSagaId, scopeEpicId });
|
|
45460
|
+
const scopeNote = scopeEpicId !== void 0 ? ` (scoped to epic ${scopeEpicId})` : scopeSagaId !== void 0 ? ` (scoped to saga ${scopeSagaId})` : "";
|
|
45182
45461
|
cliOutput(
|
|
45183
|
-
{
|
|
45462
|
+
{
|
|
45463
|
+
platform: process.platform,
|
|
45464
|
+
scopeSagaId,
|
|
45465
|
+
scopeEpicId,
|
|
45466
|
+
message: `Daemon service installation complete${scopeNote}.`
|
|
45467
|
+
},
|
|
45184
45468
|
{
|
|
45185
45469
|
command: "daemon",
|
|
45186
45470
|
operation: "daemon.install",
|
|
45187
|
-
message:
|
|
45471
|
+
message: `CLEO: Daemon service installation complete${scopeNote}.`
|
|
45188
45472
|
}
|
|
45189
45473
|
);
|
|
45190
45474
|
} catch (err) {
|
|
@@ -46875,7 +47159,7 @@ import { dirname as dirname7, join as join19, normalize, resolve as resolve4 } f
|
|
|
46875
47159
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
46876
47160
|
import {
|
|
46877
47161
|
createAttachmentStore as createAttachmentStore4,
|
|
46878
|
-
getProjectRoot as
|
|
47162
|
+
getProjectRoot as getProjectRoot37,
|
|
46879
47163
|
searchAllProjectDocs as searchAllProjectDocs2
|
|
46880
47164
|
} from "@cleocode/core/internal";
|
|
46881
47165
|
function getViewerAssetsDir() {
|
|
@@ -46935,7 +47219,7 @@ async function serveStatic(res, assetsDir, relPath) {
|
|
|
46935
47219
|
}
|
|
46936
47220
|
}
|
|
46937
47221
|
function buildViewerHandler(opts = {}) {
|
|
46938
|
-
const projectRoot = opts.projectRoot ??
|
|
47222
|
+
const projectRoot = opts.projectRoot ?? getProjectRoot37();
|
|
46939
47223
|
const assetsDir = getViewerAssetsDir();
|
|
46940
47224
|
const store = createAttachmentStore4();
|
|
46941
47225
|
return async (req, res) => {
|
|
@@ -47569,7 +47853,7 @@ import {
|
|
|
47569
47853
|
DEFAULT_SIMILARITY_THRESHOLD,
|
|
47570
47854
|
detectStrayCleoDb as detectStrayCleoDb2,
|
|
47571
47855
|
getAgentOutputsAbsolute,
|
|
47572
|
-
getProjectRoot as
|
|
47856
|
+
getProjectRoot as getProjectRoot38,
|
|
47573
47857
|
readJson,
|
|
47574
47858
|
resolveWorktreeFilePath,
|
|
47575
47859
|
resolveWorktreeRouting as resolveWorktreeRouting4
|
|
@@ -47841,7 +48125,7 @@ var init_docs3 = __esm({
|
|
|
47841
48125
|
resolvedFile = resolveWorktreeFilePath(String(fileArg), routing);
|
|
47842
48126
|
}
|
|
47843
48127
|
if (args.slug && args.type) {
|
|
47844
|
-
const projectRoot = await
|
|
48128
|
+
const projectRoot = await getProjectRoot38();
|
|
47845
48129
|
let warnThreshold = DEFAULT_SIMILARITY_THRESHOLD;
|
|
47846
48130
|
let mode = DEFAULT_SIMILARITY_MODE;
|
|
47847
48131
|
try {
|
|
@@ -48221,7 +48505,7 @@ var init_docs3 = __esm({
|
|
|
48221
48505
|
const taskId = String(args.task);
|
|
48222
48506
|
const includeAttachments = args["include-attachments"] !== false;
|
|
48223
48507
|
const includeMemoryRefs = args["include-memory-refs"] === true;
|
|
48224
|
-
const projectRoot =
|
|
48508
|
+
const projectRoot = getProjectRoot38();
|
|
48225
48509
|
try {
|
|
48226
48510
|
const result = await dispatchDocsRaw("query", "llm-output", {
|
|
48227
48511
|
mode: "task-export",
|
|
@@ -48292,7 +48576,7 @@ var init_docs3 = __esm({
|
|
|
48292
48576
|
},
|
|
48293
48577
|
async run({ args }) {
|
|
48294
48578
|
const forId = String(args.for);
|
|
48295
|
-
const projectRoot =
|
|
48579
|
+
const projectRoot = getProjectRoot38();
|
|
48296
48580
|
try {
|
|
48297
48581
|
const result = await dispatchDocsRaw("query", "llm-output", {
|
|
48298
48582
|
for: forId,
|
|
@@ -48369,7 +48653,7 @@ var init_docs3 = __esm({
|
|
|
48369
48653
|
},
|
|
48370
48654
|
async run({ args }) {
|
|
48371
48655
|
const forId = String(args.for);
|
|
48372
|
-
const projectRoot =
|
|
48656
|
+
const projectRoot = getProjectRoot38();
|
|
48373
48657
|
try {
|
|
48374
48658
|
const result = await dispatchDocsRaw("query", "llm-output", {
|
|
48375
48659
|
for: forId,
|
|
@@ -48595,7 +48879,7 @@ var init_docs3 = __esm({
|
|
|
48595
48879
|
}
|
|
48596
48880
|
},
|
|
48597
48881
|
async run({ args }) {
|
|
48598
|
-
const projectRoot =
|
|
48882
|
+
const projectRoot = getProjectRoot38();
|
|
48599
48883
|
const rawStrategy = args.strategy ?? "three-way";
|
|
48600
48884
|
const strategy = rawStrategy === "cherry-pick" || rawStrategy === "multi-diff" ? rawStrategy : "three-way";
|
|
48601
48885
|
try {
|
|
@@ -49365,7 +49649,7 @@ var init_docs3 = __esm({
|
|
|
49365
49649
|
}
|
|
49366
49650
|
},
|
|
49367
49651
|
async run({ args }) {
|
|
49368
|
-
const projectRoot =
|
|
49652
|
+
const projectRoot = getProjectRoot38();
|
|
49369
49653
|
const dirArg = String(args.dir);
|
|
49370
49654
|
const scanRoot = isAbsolute2(dirArg) ? dirArg : resolve5(projectRoot, dirArg);
|
|
49371
49655
|
const dryRun = args["dry-run"] === true;
|
|
@@ -49427,7 +49711,7 @@ var init_docs3 = __esm({
|
|
|
49427
49711
|
}
|
|
49428
49712
|
},
|
|
49429
49713
|
async run({ args }) {
|
|
49430
|
-
const projectRoot =
|
|
49714
|
+
const projectRoot = getProjectRoot38();
|
|
49431
49715
|
const { registry, configError } = loadCliRegistry(projectRoot);
|
|
49432
49716
|
const kinds = registry.list().map(toWireKind);
|
|
49433
49717
|
const extensionsCount = kinds.filter((k) => k.isExtension).length;
|
|
@@ -49482,7 +49766,7 @@ var init_docs3 = __esm({
|
|
|
49482
49766
|
deprecated: "docs list-types",
|
|
49483
49767
|
replacement: "docs schema"
|
|
49484
49768
|
});
|
|
49485
|
-
const projectRoot =
|
|
49769
|
+
const projectRoot = getProjectRoot38();
|
|
49486
49770
|
const { registry, configError } = loadCliRegistry(projectRoot);
|
|
49487
49771
|
const kinds = registry.list().map(toWireKind);
|
|
49488
49772
|
const extensionsCount = kinds.filter((k) => k.isExtension).length;
|
|
@@ -49576,7 +49860,7 @@ var doctor_db_substrate_exports = {};
|
|
|
49576
49860
|
__export(doctor_db_substrate_exports, {
|
|
49577
49861
|
doctorDbSubstrateCommand: () => doctorDbSubstrateCommand
|
|
49578
49862
|
});
|
|
49579
|
-
import { getProjectRoot as
|
|
49863
|
+
import { getProjectRoot as getProjectRoot39, pushWarning as pushWarning4 } from "@cleocode/core";
|
|
49580
49864
|
import { surveyDbSubstrate, surveyFleetDbSubstrate } from "@cleocode/core/doctor/db-substrate.js";
|
|
49581
49865
|
function pushSubstrateWarnings(result) {
|
|
49582
49866
|
for (const warning of result.warnings) {
|
|
@@ -49709,7 +49993,7 @@ var init_doctor_db_substrate = __esm({
|
|
|
49709
49993
|
const result = isFleet ? surveyFleetDbSubstrate(
|
|
49710
49994
|
typeof args["fleet-root"] === "string" && args["fleet-root"].length > 0 ? args["fleet-root"] : DEFAULT_FLEET_ROOT,
|
|
49711
49995
|
options
|
|
49712
|
-
) : surveyDbSubstrate(
|
|
49996
|
+
) : surveyDbSubstrate(getProjectRoot39(), options);
|
|
49713
49997
|
pushSubstrateWarnings(result);
|
|
49714
49998
|
pushPerDbWarnings(result);
|
|
49715
49999
|
cliOutput(result, {
|
|
@@ -49729,7 +50013,7 @@ var doctor_legacy_backups_exports = {};
|
|
|
49729
50013
|
__export(doctor_legacy_backups_exports, {
|
|
49730
50014
|
doctorLegacyBackupsCommand: () => doctorLegacyBackupsCommand
|
|
49731
50015
|
});
|
|
49732
|
-
import { getProjectRoot as
|
|
50016
|
+
import { getProjectRoot as getProjectRoot40 } from "@cleocode/core";
|
|
49733
50017
|
import { pruneLegacyBackups, scanLegacyBackups } from "@cleocode/core/doctor/legacy-backups.js";
|
|
49734
50018
|
function parsePositiveInt(raw, fallback) {
|
|
49735
50019
|
if (raw === void 0 || raw === null) return fallback;
|
|
@@ -49773,7 +50057,7 @@ var init_doctor_legacy_backups = __esm({
|
|
|
49773
50057
|
async run({ args }) {
|
|
49774
50058
|
const softRetentionDays = parsePositiveInt(args["soft-retention-days"], 30);
|
|
49775
50059
|
const hardRetentionDays = parsePositiveInt(args["hard-retention-days"], 90);
|
|
49776
|
-
const projectRoot =
|
|
50060
|
+
const projectRoot = getProjectRoot40();
|
|
49777
50061
|
let result;
|
|
49778
50062
|
if (args.prune === true) {
|
|
49779
50063
|
const dryRun = args["dry-run"] !== false;
|
|
@@ -50340,7 +50624,7 @@ __export(migrate_agents_v2_exports, {
|
|
|
50340
50624
|
import { createHash as createHash2 } from "node:crypto";
|
|
50341
50625
|
import { appendFileSync as appendFileSync2, existsSync as existsSync14, mkdirSync as mkdirSync3, readdirSync as readdirSync2, readFileSync as readFileSync13 } from "node:fs";
|
|
50342
50626
|
import { join as join23 } from "node:path";
|
|
50343
|
-
import { getProjectRoot as
|
|
50627
|
+
import { getProjectRoot as getProjectRoot41, installAgentFromCant } from "@cleocode/core/internal";
|
|
50344
50628
|
import { openCleoDb as openCleoDb2 } from "@cleocode/core/store/open-cleo-db";
|
|
50345
50629
|
function sha256Hex(bytes) {
|
|
50346
50630
|
return createHash2("sha256").update(bytes).digest("hex");
|
|
@@ -50527,7 +50811,7 @@ var init_migrate_agents_v2 = __esm({
|
|
|
50527
50811
|
}
|
|
50528
50812
|
},
|
|
50529
50813
|
async run({ args }) {
|
|
50530
|
-
const projectRoot =
|
|
50814
|
+
const projectRoot = getProjectRoot41();
|
|
50531
50815
|
const verbose = args.quiet !== true;
|
|
50532
50816
|
if (verbose) {
|
|
50533
50817
|
humanInfo("Scanning .cleo/cant/agents/ and .cleo/agents/ for unregistered agents...");
|
|
@@ -50571,7 +50855,7 @@ __export(doctor_exports, {
|
|
|
50571
50855
|
});
|
|
50572
50856
|
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
50573
50857
|
import { join as join24 } from "node:path";
|
|
50574
|
-
import { getProjectRoot as
|
|
50858
|
+
import { getProjectRoot as getProjectRoot42, pushWarning as pushWarning5 } from "@cleocode/core";
|
|
50575
50859
|
import { renderInvariantAuditLines } from "@cleocode/core/doctor/invariant-audit-render.js";
|
|
50576
50860
|
import {
|
|
50577
50861
|
quarantineRogueCleoDir,
|
|
@@ -50910,7 +51194,7 @@ var init_doctor = __esm({
|
|
|
50910
51194
|
const { join: pathJoin } = await import("node:path");
|
|
50911
51195
|
const { existsSync: existsSync21 } = await import("node:fs");
|
|
50912
51196
|
const { detectAndHealCoreWorktreeLeak } = await import("@cleocode/worktree");
|
|
50913
|
-
const projectRoot =
|
|
51197
|
+
const projectRoot = getProjectRoot42();
|
|
50914
51198
|
let gitRoot = projectRoot;
|
|
50915
51199
|
try {
|
|
50916
51200
|
gitRoot = execFile2("git", ["rev-parse", "--show-toplevel"], {
|
|
@@ -50962,7 +51246,7 @@ var init_doctor = __esm({
|
|
|
50962
51246
|
}
|
|
50963
51247
|
if (args.brain) {
|
|
50964
51248
|
const { computeBrainHealthDashboard } = await import("@cleocode/core/memory/brain-health-dashboard.js");
|
|
50965
|
-
const projectRoot =
|
|
51249
|
+
const projectRoot = getProjectRoot42();
|
|
50966
51250
|
const dashboard = await computeBrainHealthDashboard(projectRoot);
|
|
50967
51251
|
cliOutput(dashboard, { command: "doctor", operation: "doctor.brain" });
|
|
50968
51252
|
if (dashboard.hasP0Failure) {
|
|
@@ -50971,7 +51255,7 @@ var init_doctor = __esm({
|
|
|
50971
51255
|
return;
|
|
50972
51256
|
}
|
|
50973
51257
|
if (args["scan-test-fixtures-in-prod"]) {
|
|
50974
|
-
const projectRoot =
|
|
51258
|
+
const projectRoot = getProjectRoot42();
|
|
50975
51259
|
const matches = await scanTestFixturesInProd(projectRoot);
|
|
50976
51260
|
const dryRun = args["dry-run"] !== false && args.quarantine !== true;
|
|
50977
51261
|
const quarantined = !dryRun && matches.length > 0 ? await quarantineTestFixtures(projectRoot, matches) : void 0;
|
|
@@ -51059,7 +51343,7 @@ var init_doctor = __esm({
|
|
|
51059
51343
|
progress.complete("Comprehensive diagnostics complete");
|
|
51060
51344
|
} else if (args["scan-rogue-cleo-dirs"]) {
|
|
51061
51345
|
progress.step(0, "Scanning for rogue .cleo/ directories");
|
|
51062
|
-
const projectRoot =
|
|
51346
|
+
const projectRoot = getProjectRoot42();
|
|
51063
51347
|
const reports = scanRogueCleoDirs(projectRoot);
|
|
51064
51348
|
progress.complete(
|
|
51065
51349
|
`Found ${reports.length} rogue .cleo/ director${reports.length === 1 ? "y" : "ies"}`
|
|
@@ -51068,7 +51352,7 @@ var init_doctor = __esm({
|
|
|
51068
51352
|
} else if (args["quarantine-rogue-cleo-dirs"]) {
|
|
51069
51353
|
const isDryRun = args["dry-run"] === true;
|
|
51070
51354
|
progress.step(0, `${isDryRun ? "[DRY RUN] " : ""}Scanning for rogue .cleo/ directories`);
|
|
51071
|
-
const projectRoot =
|
|
51355
|
+
const projectRoot = getProjectRoot42();
|
|
51072
51356
|
const reports = scanRogueCleoDirs(projectRoot);
|
|
51073
51357
|
if (reports.length === 0) {
|
|
51074
51358
|
progress.complete("No rogue .cleo/ directories found \u2014 nothing to quarantine");
|
|
@@ -51122,7 +51406,7 @@ var init_doctor = __esm({
|
|
|
51122
51406
|
const { detectAndRemoveLegacyGlobalFiles, detectAndRemoveStrayProjectNexus } = await import("@cleocode/core/store/cleanup-legacy.js");
|
|
51123
51407
|
const { getCleoHome: getCleoHome6 } = await import("@cleocode/core");
|
|
51124
51408
|
const cleoHome = getCleoHome6();
|
|
51125
|
-
const projectRoot =
|
|
51409
|
+
const projectRoot = getProjectRoot42();
|
|
51126
51410
|
const legacyResult = detectAndRemoveLegacyGlobalFiles(cleoHome);
|
|
51127
51411
|
const strayResult = detectAndRemoveStrayProjectNexus(projectRoot);
|
|
51128
51412
|
const isDryRun = args["dry-run"] === true;
|
|
@@ -51155,7 +51439,7 @@ var init_doctor = __esm({
|
|
|
51155
51439
|
} else if (args["audit-worktree-orphans"]) {
|
|
51156
51440
|
progress.step(0, "Comprehensive worktree anomaly audit (T9808 / council D009)");
|
|
51157
51441
|
const { auditWorktreeOrphansComprehensive, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
|
|
51158
|
-
const projectRoot =
|
|
51442
|
+
const projectRoot = getProjectRoot42();
|
|
51159
51443
|
const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
|
|
51160
51444
|
const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
|
|
51161
51445
|
const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
|
|
@@ -51212,7 +51496,7 @@ var init_doctor = __esm({
|
|
|
51212
51496
|
`${isDryRun ? "[DRY RUN] " : ""}Scanning + pruning worktree-orphan .cleo/ directories`
|
|
51213
51497
|
);
|
|
51214
51498
|
const { pruneWorktreeOrphans, scanWorktreeOrphansBudgeted } = await import("@cleocode/core/doctor/worktree-orphans.js");
|
|
51215
|
-
const projectRoot =
|
|
51499
|
+
const projectRoot = getProjectRoot42();
|
|
51216
51500
|
const timeoutSecs = args["timeout"] !== void 0 ? Number.parseInt(String(args["timeout"]), 10) : 30;
|
|
51217
51501
|
const timeoutMs = Number.isFinite(timeoutSecs) && timeoutSecs > 0 ? timeoutSecs * 1e3 : 3e4;
|
|
51218
51502
|
const maxEntriesPerLevel = args["max-entries-per-level"] !== void 0 ? Number.parseInt(String(args["max-entries-per-level"]), 10) : 500;
|
|
@@ -51291,7 +51575,7 @@ var init_doctor = __esm({
|
|
|
51291
51575
|
`${isDryRun ? "[DRY RUN] " : ""}Migrating .cleo/worktree-include \u2192 .worktreeinclude`
|
|
51292
51576
|
);
|
|
51293
51577
|
const { migrateWorktreeIncludeFile } = await import("@cleocode/core");
|
|
51294
|
-
const projectRoot =
|
|
51578
|
+
const projectRoot = getProjectRoot42();
|
|
51295
51579
|
const result = await migrateWorktreeIncludeFile(projectRoot, { dryRun: isDryRun });
|
|
51296
51580
|
progress.complete(`Migration ${result.action}`);
|
|
51297
51581
|
cliOutput(result, { command: "doctor", operation: "doctor.migrate-worktree-include" });
|
|
@@ -51310,7 +51594,7 @@ var init_doctor = __esm({
|
|
|
51310
51594
|
const stepLabel = isFocusedAlias ? "Auditing Saga hierarchy for ADR-073 invariants" : "Walking central INVARIANTS_REGISTRY";
|
|
51311
51595
|
progress.step(0, stepLabel);
|
|
51312
51596
|
const { auditInvariantRegistry } = await import("@cleocode/core/doctor/invariant-audit.js");
|
|
51313
|
-
const projectRoot =
|
|
51597
|
+
const projectRoot = getProjectRoot42();
|
|
51314
51598
|
const result = await auditInvariantRegistry(projectRoot, { adrFilter });
|
|
51315
51599
|
const operation = isFocusedAlias ? "doctor.audit-sagas" : "doctor.audit-invariants";
|
|
51316
51600
|
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`;
|
|
@@ -51332,7 +51616,7 @@ var init_doctor = __esm({
|
|
|
51332
51616
|
{ command: "doctor", operation: "admin.health" }
|
|
51333
51617
|
);
|
|
51334
51618
|
try {
|
|
51335
|
-
const projectRoot =
|
|
51619
|
+
const projectRoot = getProjectRoot42();
|
|
51336
51620
|
const conflicts = readMigrationConflicts(projectRoot);
|
|
51337
51621
|
if (conflicts.length > 0) {
|
|
51338
51622
|
progress.complete(
|
|
@@ -51363,7 +51647,7 @@ var init_doctor = __esm({
|
|
|
51363
51647
|
progress.complete("Health check complete");
|
|
51364
51648
|
}
|
|
51365
51649
|
try {
|
|
51366
|
-
const projectRoot =
|
|
51650
|
+
const projectRoot = getProjectRoot42();
|
|
51367
51651
|
const { auditSagaHierarchy } = await import("@cleocode/core/doctor/saga-audit.js");
|
|
51368
51652
|
const sagaAudit = await auditSagaHierarchy(projectRoot);
|
|
51369
51653
|
if (sagaAudit.sagas.length === 0) {
|
|
@@ -51823,6 +52107,267 @@ var init_exists = __esm({
|
|
|
51823
52107
|
}
|
|
51824
52108
|
});
|
|
51825
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
|
+
|
|
51826
52371
|
// packages/cleo/src/cli/commands/export-tasks.ts
|
|
51827
52372
|
var export_tasks_exports = {};
|
|
51828
52373
|
__export(export_tasks_exports, {
|
|
@@ -52536,7 +53081,7 @@ var go_exports = {};
|
|
|
52536
53081
|
__export(go_exports, {
|
|
52537
53082
|
goCommand: () => goCommand
|
|
52538
53083
|
});
|
|
52539
|
-
import { getProjectRoot as
|
|
53084
|
+
import { getProjectRoot as getProjectRoot43, go } from "@cleocode/core";
|
|
52540
53085
|
var goCommand;
|
|
52541
53086
|
var init_go = __esm({
|
|
52542
53087
|
"packages/cleo/src/cli/commands/go.ts"() {
|
|
@@ -52561,7 +53106,7 @@ var init_go = __esm({
|
|
|
52561
53106
|
}
|
|
52562
53107
|
},
|
|
52563
53108
|
async run({ args }) {
|
|
52564
|
-
const projectRoot =
|
|
53109
|
+
const projectRoot = getProjectRoot43();
|
|
52565
53110
|
const result = await go.cleoGo({
|
|
52566
53111
|
sagaId: typeof args.saga === "string" && args.saga.length > 0 ? args.saga : void 0,
|
|
52567
53112
|
headless: args.headless === true,
|
|
@@ -52578,7 +53123,7 @@ var goal_exports = {};
|
|
|
52578
53123
|
__export(goal_exports, {
|
|
52579
53124
|
goalCommand: () => goalCommand
|
|
52580
53125
|
});
|
|
52581
|
-
import { getProjectRoot as
|
|
53126
|
+
import { getProjectRoot as getProjectRoot44, goal } from "@cleocode/core";
|
|
52582
53127
|
function resolveGoalKind(task) {
|
|
52583
53128
|
if (typeof task === "string" && task.length > 0) {
|
|
52584
53129
|
if (!isValidGoalTargetTaskId(task)) {
|
|
@@ -52625,7 +53170,7 @@ var init_goal2 = __esm({
|
|
|
52625
53170
|
}
|
|
52626
53171
|
const record = await goal.createGoal(
|
|
52627
53172
|
{ goalKind: kindResult.kind, intent, turnBudget: resolveTurnBudget(args.turns) },
|
|
52628
|
-
|
|
53173
|
+
getProjectRoot44()
|
|
52629
53174
|
);
|
|
52630
53175
|
cliOutput(record, { command: "goal set", operation: "goal.set" });
|
|
52631
53176
|
}
|
|
@@ -52636,7 +53181,7 @@ var init_goal2 = __esm({
|
|
|
52636
53181
|
description: "Show the current agent's active goal (per-agent scoped)."
|
|
52637
53182
|
},
|
|
52638
53183
|
async run() {
|
|
52639
|
-
const record = await goal.getActiveGoal(
|
|
53184
|
+
const record = await goal.getActiveGoal(getProjectRoot44());
|
|
52640
53185
|
cliOutput(record ?? { active: null }, { command: "goal status", operation: "goal.status" });
|
|
52641
53186
|
}
|
|
52642
53187
|
});
|
|
@@ -52658,7 +53203,7 @@ var init_goal2 = __esm({
|
|
|
52658
53203
|
});
|
|
52659
53204
|
return;
|
|
52660
53205
|
}
|
|
52661
|
-
const cwd =
|
|
53206
|
+
const cwd = getProjectRoot44();
|
|
52662
53207
|
const parent = await goal.getActiveGoal(cwd);
|
|
52663
53208
|
if (!parent) {
|
|
52664
53209
|
cliError(
|
|
@@ -52706,7 +53251,7 @@ var init_goal2 = __esm({
|
|
|
52706
53251
|
});
|
|
52707
53252
|
return;
|
|
52708
53253
|
}
|
|
52709
|
-
const cwd =
|
|
53254
|
+
const cwd = getProjectRoot44();
|
|
52710
53255
|
const result = await goal.advanceGoalWithPersist(goalId, { cwd });
|
|
52711
53256
|
if (!result) {
|
|
52712
53257
|
cliError(`Goal '${goalId}' not found.`, 4 /* NOT_FOUND */, { name: "E_NOT_FOUND" });
|
|
@@ -52731,7 +53276,7 @@ var init_goal2 = __esm({
|
|
|
52731
53276
|
});
|
|
52732
53277
|
return;
|
|
52733
53278
|
}
|
|
52734
|
-
const cwd =
|
|
53279
|
+
const cwd = getProjectRoot44();
|
|
52735
53280
|
const active = await goal.getActiveGoal(cwd);
|
|
52736
53281
|
if (!active) {
|
|
52737
53282
|
cliError(
|
|
@@ -53720,7 +54265,7 @@ var hygiene_exports = {};
|
|
|
53720
54265
|
__export(hygiene_exports, {
|
|
53721
54266
|
hygieneCommand: () => hygieneCommand
|
|
53722
54267
|
});
|
|
53723
|
-
import { getProjectRoot as
|
|
54268
|
+
import { getProjectRoot as getProjectRoot45 } from "@cleocode/core";
|
|
53724
54269
|
import { runSpawnReadinessHygieneCli } from "@cleocode/core/hygiene/validate-spawn-readiness.js";
|
|
53725
54270
|
var hygieneCommand;
|
|
53726
54271
|
var init_hygiene = __esm({
|
|
@@ -53749,7 +54294,7 @@ var init_hygiene = __esm({
|
|
|
53749
54294
|
}
|
|
53750
54295
|
},
|
|
53751
54296
|
async run({ args }) {
|
|
53752
|
-
const projectRoot = args["project-root"] ||
|
|
54297
|
+
const projectRoot = args["project-root"] || getProjectRoot45() || process.cwd();
|
|
53753
54298
|
const worktreePath = args["worktree-path"];
|
|
53754
54299
|
await runSpawnReadinessHygieneCli(projectRoot, worktreePath);
|
|
53755
54300
|
}
|
|
@@ -54911,7 +55456,7 @@ var llm_cost_exports = {};
|
|
|
54911
55456
|
__export(llm_cost_exports, {
|
|
54912
55457
|
costCommand: () => costCommand
|
|
54913
55458
|
});
|
|
54914
|
-
import { getProjectRoot as
|
|
55459
|
+
import { getProjectRoot as getProjectRoot46 } from "@cleocode/core/internal";
|
|
54915
55460
|
import { computeCost } from "@cleocode/core/llm/usage-pricing";
|
|
54916
55461
|
function resolveSessionId(raw) {
|
|
54917
55462
|
if (raw === "current") {
|
|
@@ -54984,7 +55529,7 @@ var init_llm_cost = __esm({
|
|
|
54984
55529
|
process.exit(6);
|
|
54985
55530
|
}
|
|
54986
55531
|
const sessionId = resolveSessionId(rawSessionId);
|
|
54987
|
-
const projectRoot =
|
|
55532
|
+
const projectRoot = getProjectRoot46(process.cwd());
|
|
54988
55533
|
let breakdown;
|
|
54989
55534
|
try {
|
|
54990
55535
|
breakdown = await loadSessionCostBreakdown(projectRoot, sessionId);
|
|
@@ -56531,7 +57076,7 @@ var memory_exports = {};
|
|
|
56531
57076
|
__export(memory_exports, {
|
|
56532
57077
|
memoryCommand: () => memoryCommand
|
|
56533
57078
|
});
|
|
56534
|
-
import { getProjectRoot as
|
|
57079
|
+
import { getProjectRoot as getProjectRoot47 } from "@cleocode/core";
|
|
56535
57080
|
import {
|
|
56536
57081
|
getBrainDb as getBrainDb2,
|
|
56537
57082
|
getDreamStatus,
|
|
@@ -57464,7 +58009,7 @@ var init_memory3 = __esm({
|
|
|
57464
58009
|
},
|
|
57465
58010
|
args: {},
|
|
57466
58011
|
async run() {
|
|
57467
|
-
const root =
|
|
58012
|
+
const root = getProjectRoot47();
|
|
57468
58013
|
try {
|
|
57469
58014
|
const result = await runConsolidation(root);
|
|
57470
58015
|
cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
|
|
@@ -57488,7 +58033,7 @@ var init_memory3 = __esm({
|
|
|
57488
58033
|
}
|
|
57489
58034
|
},
|
|
57490
58035
|
async run({ args }) {
|
|
57491
|
-
const root =
|
|
58036
|
+
const root = getProjectRoot47();
|
|
57492
58037
|
if (args.status) {
|
|
57493
58038
|
try {
|
|
57494
58039
|
const status = await getDreamStatus(root);
|
|
@@ -57525,7 +58070,7 @@ var init_memory3 = __esm({
|
|
|
57525
58070
|
}
|
|
57526
58071
|
},
|
|
57527
58072
|
async run({ args }) {
|
|
57528
|
-
const root =
|
|
58073
|
+
const root = getProjectRoot47();
|
|
57529
58074
|
try {
|
|
57530
58075
|
const { runObserver, runReflector } = await import("@cleocode/core/memory");
|
|
57531
58076
|
const observerResult = await runObserver(root, args.session, {
|
|
@@ -57565,7 +58110,7 @@ var init_memory3 = __esm({
|
|
|
57565
58110
|
}
|
|
57566
58111
|
},
|
|
57567
58112
|
async run({ args }) {
|
|
57568
|
-
const root =
|
|
58113
|
+
const root = getProjectRoot47();
|
|
57569
58114
|
try {
|
|
57570
58115
|
await getBrainDb2(root);
|
|
57571
58116
|
const { totalDuplicateRows, groups } = await scanDuplicateEntries();
|
|
@@ -57611,7 +58156,7 @@ var init_memory3 = __esm({
|
|
|
57611
58156
|
async run({ args }) {
|
|
57612
58157
|
const sourceDir = args.from;
|
|
57613
58158
|
const isDryRun = !!args["dry-run"];
|
|
57614
|
-
const projectRoot =
|
|
58159
|
+
const projectRoot = getProjectRoot47();
|
|
57615
58160
|
try {
|
|
57616
58161
|
const result = await importMemoryFiles({
|
|
57617
58162
|
sourceDir,
|
|
@@ -57762,7 +58307,7 @@ var init_memory3 = __esm({
|
|
|
57762
58307
|
},
|
|
57763
58308
|
args: {},
|
|
57764
58309
|
async run() {
|
|
57765
|
-
const root =
|
|
58310
|
+
const root = getProjectRoot47();
|
|
57766
58311
|
try {
|
|
57767
58312
|
await getBrainDb2(root);
|
|
57768
58313
|
const result = await getTierStats(root);
|
|
@@ -57805,7 +58350,7 @@ var init_memory3 = __esm({
|
|
|
57805
58350
|
}
|
|
57806
58351
|
},
|
|
57807
58352
|
async run({ args }) {
|
|
57808
|
-
const root =
|
|
58353
|
+
const root = getProjectRoot47();
|
|
57809
58354
|
const targetTier = args.to;
|
|
57810
58355
|
const reason = args.reason;
|
|
57811
58356
|
const validTiers = ["medium", "long"];
|
|
@@ -57871,7 +58416,7 @@ var init_memory3 = __esm({
|
|
|
57871
58416
|
}
|
|
57872
58417
|
},
|
|
57873
58418
|
async run({ args }) {
|
|
57874
|
-
const root =
|
|
58419
|
+
const root = getProjectRoot47();
|
|
57875
58420
|
const targetTier = args.to;
|
|
57876
58421
|
const reason = args.reason;
|
|
57877
58422
|
const validTiers = ["short", "medium"];
|
|
@@ -58334,7 +58879,7 @@ var migrate_claude_mem_exports = {};
|
|
|
58334
58879
|
__export(migrate_claude_mem_exports, {
|
|
58335
58880
|
migrateClaudeMemCommand: () => migrateClaudeMemCommand
|
|
58336
58881
|
});
|
|
58337
|
-
import { getProjectRoot as
|
|
58882
|
+
import { getProjectRoot as getProjectRoot48, migrateClaudeMem } from "@cleocode/core/internal";
|
|
58338
58883
|
import { ingestLooseAgentOutputs, ingestRcasdDirectories } from "@cleocode/core/memory";
|
|
58339
58884
|
import { getDb as getDb2 } from "@cleocode/core/store/sqlite";
|
|
58340
58885
|
var storageCommand, claudeMemCommand, manifestIngestCommand, migrateClaudeMemCommand;
|
|
@@ -58397,7 +58942,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
58397
58942
|
}
|
|
58398
58943
|
},
|
|
58399
58944
|
async run({ args }) {
|
|
58400
|
-
const root =
|
|
58945
|
+
const root = getProjectRoot48();
|
|
58401
58946
|
try {
|
|
58402
58947
|
const result = await migrateClaudeMem(root, {
|
|
58403
58948
|
sourcePath: args.source,
|
|
@@ -58446,7 +58991,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
58446
58991
|
}
|
|
58447
58992
|
},
|
|
58448
58993
|
async run({ args }) {
|
|
58449
|
-
const projectRoot =
|
|
58994
|
+
const projectRoot = getProjectRoot48();
|
|
58450
58995
|
try {
|
|
58451
58996
|
const db = await getDb2(projectRoot);
|
|
58452
58997
|
const rcasdFlag = Boolean(args.rcasd);
|
|
@@ -58564,7 +59109,7 @@ __export(nexus_exports, {
|
|
|
58564
59109
|
import { appendFile as appendFile2, mkdir as mkdir4 } from "node:fs/promises";
|
|
58565
59110
|
import { homedir as homedir5 } from "node:os";
|
|
58566
59111
|
import path4 from "node:path";
|
|
58567
|
-
import { getProjectRoot as
|
|
59112
|
+
import { getProjectRoot as getProjectRoot49 } from "@cleocode/core";
|
|
58568
59113
|
import { getSymbolImpact } from "@cleocode/core/nexus";
|
|
58569
59114
|
import { runNexusAnalysis } from "@cleocode/core/nexus/analyze-orchestrator.js";
|
|
58570
59115
|
import { exportNexusGraph } from "@cleocode/core/nexus/export.js";
|
|
@@ -58679,7 +59224,7 @@ var init_nexus3 = __esm({
|
|
|
58679
59224
|
async run({ args }) {
|
|
58680
59225
|
applyJsonFlag2(args.json);
|
|
58681
59226
|
const projectIdOverride = args["project-id"];
|
|
58682
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
59227
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
58683
59228
|
const startTime = Date.now();
|
|
58684
59229
|
try {
|
|
58685
59230
|
const [{ getNexusDb, nexusSchema }, { getIndexStats }] = await Promise.all([
|
|
@@ -59194,7 +59739,7 @@ var init_nexus3 = __esm({
|
|
|
59194
59739
|
applyJsonFlag2(args.json);
|
|
59195
59740
|
const startTime = Date.now();
|
|
59196
59741
|
const projectIdOverride = args["project-id"];
|
|
59197
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
59742
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
59198
59743
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
59199
59744
|
const response = await dispatchRaw("query", "nexus", "clusters", { projectId, repoPath });
|
|
59200
59745
|
const durationMs = Date.now() - startTime;
|
|
@@ -59238,7 +59783,7 @@ var init_nexus3 = __esm({
|
|
|
59238
59783
|
applyJsonFlag2(args.json);
|
|
59239
59784
|
const startTime = Date.now();
|
|
59240
59785
|
const projectIdOverride = args["project-id"];
|
|
59241
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
59786
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
59242
59787
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
59243
59788
|
const response = await dispatchRaw("query", "nexus", "flows", { projectId, repoPath });
|
|
59244
59789
|
const durationMs = Date.now() - startTime;
|
|
@@ -59281,7 +59826,7 @@ var init_nexus3 = __esm({
|
|
|
59281
59826
|
void appendDeprecationTelemetry("nexus.context", "cleo graph context");
|
|
59282
59827
|
const startTime = Date.now();
|
|
59283
59828
|
const projectIdOverride = args["project-id"];
|
|
59284
|
-
const repoPath =
|
|
59829
|
+
const repoPath = getProjectRoot49();
|
|
59285
59830
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
59286
59831
|
const limit = parseInt(args.limit, 10);
|
|
59287
59832
|
const symbolName = args.symbol;
|
|
@@ -59344,7 +59889,7 @@ var init_nexus3 = __esm({
|
|
|
59344
59889
|
const startTime = Date.now();
|
|
59345
59890
|
const whyFlag = !!args.why;
|
|
59346
59891
|
const projectIdOverride = args["project-id"];
|
|
59347
|
-
const repoPath =
|
|
59892
|
+
const repoPath = getProjectRoot49();
|
|
59348
59893
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
59349
59894
|
const maxDepth = Math.min(parseInt(args.depth, 10), 5);
|
|
59350
59895
|
const symbolName = args.symbol;
|
|
@@ -59416,7 +59961,7 @@ var init_nexus3 = __esm({
|
|
|
59416
59961
|
const projectIdOverride = args["project-id"];
|
|
59417
59962
|
const isIncremental = !!args.incremental;
|
|
59418
59963
|
const ctx = getFormatContext();
|
|
59419
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
59964
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
59420
59965
|
humanInfo(`[nexus] Analyzing: ${repoPath}${isIncremental ? " (incremental)" : ""}`);
|
|
59421
59966
|
if (!isIncremental) humanInfo("[nexus] Clearing existing index for project...");
|
|
59422
59967
|
try {
|
|
@@ -59519,7 +60064,7 @@ var init_nexus3 = __esm({
|
|
|
59519
60064
|
async run({ args }) {
|
|
59520
60065
|
applyJsonFlag2(args.json);
|
|
59521
60066
|
const startTime = Date.now();
|
|
59522
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60067
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
59523
60068
|
const name = args.name;
|
|
59524
60069
|
const response = await dispatchRaw("mutate", "nexus", "projects.register", {
|
|
59525
60070
|
path: repoPath,
|
|
@@ -59877,7 +60422,7 @@ var init_nexus3 = __esm({
|
|
|
59877
60422
|
applyJsonFlag2(args.json);
|
|
59878
60423
|
const startTime = Date.now();
|
|
59879
60424
|
const projectIdOverride = args["project-id"];
|
|
59880
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60425
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
59881
60426
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
59882
60427
|
const response = await dispatchRaw("mutate", "nexus", "refresh-bridge", {
|
|
59883
60428
|
repoPath,
|
|
@@ -59983,7 +60528,7 @@ var init_nexus3 = __esm({
|
|
|
59983
60528
|
async run({ args }) {
|
|
59984
60529
|
applyJsonFlag2(args.json);
|
|
59985
60530
|
const startTime = Date.now();
|
|
59986
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60531
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
59987
60532
|
const projectIdOverride = args["project-id"];
|
|
59988
60533
|
const beforeRef = args.before ?? "HEAD~1";
|
|
59989
60534
|
const afterRef = args.after ?? "HEAD";
|
|
@@ -60101,7 +60646,7 @@ var init_nexus3 = __esm({
|
|
|
60101
60646
|
applyJsonFlag2(args.json);
|
|
60102
60647
|
const startTime = Date.now();
|
|
60103
60648
|
const projectIdOverride = args["project-id"];
|
|
60104
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60649
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
60105
60650
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60106
60651
|
const response = await dispatchRaw("query", "nexus", "route-map", { projectId });
|
|
60107
60652
|
const durationMs = Date.now() - startTime;
|
|
@@ -60157,7 +60702,7 @@ var init_nexus3 = __esm({
|
|
|
60157
60702
|
const startTime = Date.now();
|
|
60158
60703
|
const routeSymbol = args.routeSymbol;
|
|
60159
60704
|
const projectIdOverride = args["project-id"];
|
|
60160
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
60705
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
60161
60706
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60162
60707
|
const response = await dispatchRaw("query", "nexus", "shape-check", { routeSymbol, projectId });
|
|
60163
60708
|
const durationMs = Date.now() - startTime;
|
|
@@ -60547,7 +61092,7 @@ var init_nexus3 = __esm({
|
|
|
60547
61092
|
async run({ args }) {
|
|
60548
61093
|
applyJsonFlag2(args.json);
|
|
60549
61094
|
const startTime = Date.now();
|
|
60550
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61095
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
60551
61096
|
const projectIdOverride = args["project-id"];
|
|
60552
61097
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60553
61098
|
const response = await dispatchRaw("mutate", "nexus", "contracts-sync", {
|
|
@@ -60651,7 +61196,7 @@ var init_nexus3 = __esm({
|
|
|
60651
61196
|
async run({ args }) {
|
|
60652
61197
|
applyJsonFlag2(args.json);
|
|
60653
61198
|
const startTime = Date.now();
|
|
60654
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
61199
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot49();
|
|
60655
61200
|
const projectId = Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
60656
61201
|
const response = await dispatchRaw("mutate", "nexus", "contracts-link-tasks", {
|
|
60657
61202
|
projectId,
|
|
@@ -60732,7 +61277,7 @@ var init_nexus3 = __esm({
|
|
|
60732
61277
|
const isIncremental = !!args.incremental;
|
|
60733
61278
|
try {
|
|
60734
61279
|
const result = await runNexusWiki({
|
|
60735
|
-
projectRoot:
|
|
61280
|
+
projectRoot: getProjectRoot49(),
|
|
60736
61281
|
outputDir,
|
|
60737
61282
|
communityFilter,
|
|
60738
61283
|
incremental: isIncremental
|
|
@@ -61082,7 +61627,7 @@ __export(orchestrate_exports, {
|
|
|
61082
61627
|
});
|
|
61083
61628
|
import { execFileSync as execFileSync3 } from "node:child_process";
|
|
61084
61629
|
import { orchestration } from "@cleocode/core";
|
|
61085
|
-
import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as
|
|
61630
|
+
import { BUILD_CONFIG as BUILD_CONFIG2, getProjectRoot as getProjectRoot50 } from "@cleocode/core/internal";
|
|
61086
61631
|
function formatRollupTable(rollup) {
|
|
61087
61632
|
const waves = "waves" in rollup ? rollup.waves : [rollup];
|
|
61088
61633
|
const lines = [];
|
|
@@ -61117,7 +61662,7 @@ function formatRollupTable(rollup) {
|
|
|
61117
61662
|
}
|
|
61118
61663
|
return lines.join("\n");
|
|
61119
61664
|
}
|
|
61120
|
-
var rollupCommand, startCommand5, statusCommand12, dashboardCommand, analyzeCommand4, readyCommand, reportCommand, nextCommand2, wavesCommand2, planCommand, spawnCommand2, validateCommand6, contextCommand5, ivtrCommand, parallelCommand, tesseraListCommand, tesseraInstantiateCommand, tesseraCommand, unblockCommand, bootstrapCommand,
|
|
61665
|
+
var rollupCommand, startCommand5, statusCommand12, dashboardCommand, analyzeCommand4, readyCommand, reportCommand, nextCommand2, wavesCommand2, planCommand, spawnCommand2, validateCommand6, contextCommand5, ivtrCommand, parallelCommand, tesseraListCommand, tesseraInstantiateCommand, tesseraCommand, unblockCommand, bootstrapCommand, classifyCommand2, fanoutStatusCommand, handoffCommand, spawnExecuteCommand, fanoutCommand, pruneCommand, worktreeCompleteCommand, conduitStatusCommand, conduitPeekCommand, conduitStartCommand, conduitStopCommand, approveCommand, rejectCommand, pendingCommand, conduitSendCommand, orchestrateCommand;
|
|
61121
61666
|
var init_orchestrate3 = __esm({
|
|
61122
61667
|
"packages/cleo/src/cli/commands/orchestrate.ts"() {
|
|
61123
61668
|
"use strict";
|
|
@@ -61225,7 +61770,7 @@ var init_orchestrate3 = __esm({
|
|
|
61225
61770
|
},
|
|
61226
61771
|
async run({ args }) {
|
|
61227
61772
|
const rateWindowHours = args.window !== void 0 ? Number.parseFloat(String(args.window)) : void 0;
|
|
61228
|
-
const metrics = await orchestration.collectOrchestrateDashboard(
|
|
61773
|
+
const metrics = await orchestration.collectOrchestrateDashboard(getProjectRoot50(), {
|
|
61229
61774
|
...rateWindowHours !== void 0 && Number.isFinite(rateWindowHours) && rateWindowHours > 0 ? { rateWindowHours } : {}
|
|
61230
61775
|
});
|
|
61231
61776
|
cliOutput(metrics, {
|
|
@@ -61706,7 +62251,7 @@ var init_orchestrate3 = __esm({
|
|
|
61706
62251
|
);
|
|
61707
62252
|
}
|
|
61708
62253
|
});
|
|
61709
|
-
|
|
62254
|
+
classifyCommand2 = defineCommand({
|
|
61710
62255
|
meta: {
|
|
61711
62256
|
name: "classify",
|
|
61712
62257
|
description: "Classify a request using CANT prompt-based team routing"
|
|
@@ -62045,7 +62590,7 @@ var init_orchestrate3 = __esm({
|
|
|
62045
62590
|
tessera: tesseraCommand,
|
|
62046
62591
|
unblock: unblockCommand,
|
|
62047
62592
|
bootstrap: bootstrapCommand,
|
|
62048
|
-
classify:
|
|
62593
|
+
classify: classifyCommand2,
|
|
62049
62594
|
"fanout-status": fanoutStatusCommand,
|
|
62050
62595
|
handoff: handoffCommand,
|
|
62051
62596
|
"spawn-execute": spawnExecuteCommand,
|
|
@@ -63430,7 +63975,7 @@ var refresh_memory_exports = {};
|
|
|
63430
63975
|
__export(refresh_memory_exports, {
|
|
63431
63976
|
refreshMemoryCommand: () => refreshMemoryCommand
|
|
63432
63977
|
});
|
|
63433
|
-
import { getProjectRoot as
|
|
63978
|
+
import { getProjectRoot as getProjectRoot51 } from "@cleocode/core";
|
|
63434
63979
|
var refreshMemoryCommand;
|
|
63435
63980
|
var init_refresh_memory = __esm({
|
|
63436
63981
|
"packages/cleo/src/cli/commands/refresh-memory.ts"() {
|
|
@@ -63443,7 +63988,7 @@ var init_refresh_memory = __esm({
|
|
|
63443
63988
|
description: "Regenerate .cleo/memory-bridge.md from brain.db"
|
|
63444
63989
|
},
|
|
63445
63990
|
async run() {
|
|
63446
|
-
const projectDir =
|
|
63991
|
+
const projectDir = getProjectRoot51();
|
|
63447
63992
|
const { writeMemoryBridge } = await import("@cleocode/core/internal");
|
|
63448
63993
|
const result = await writeMemoryBridge(projectDir);
|
|
63449
63994
|
if (result.written) {
|
|
@@ -64970,7 +65515,7 @@ import fs3 from "node:fs";
|
|
|
64970
65515
|
import path5 from "node:path";
|
|
64971
65516
|
import {
|
|
64972
65517
|
CleoError as CleoError8,
|
|
64973
|
-
getProjectRoot as
|
|
65518
|
+
getProjectRoot as getProjectRoot52,
|
|
64974
65519
|
getTaskAccessor as getTaskAccessor3,
|
|
64975
65520
|
parseConflictReport,
|
|
64976
65521
|
setAtPath
|
|
@@ -64991,7 +65536,7 @@ var init_restore = __esm({
|
|
|
64991
65536
|
description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
|
|
64992
65537
|
},
|
|
64993
65538
|
async run() {
|
|
64994
|
-
const projectRoot =
|
|
65539
|
+
const projectRoot = getProjectRoot52();
|
|
64995
65540
|
const reportPath = path5.join(projectRoot, CLEO_DIR_NAME3, RESTORE_CONFLICTS_MD);
|
|
64996
65541
|
if (!fs3.existsSync(reportPath)) {
|
|
64997
65542
|
humanLine("No pending restore conflicts. Nothing to finalize.");
|
|
@@ -65913,8 +66458,8 @@ var init_saga = __esm({
|
|
|
65913
66458
|
}
|
|
65914
66459
|
},
|
|
65915
66460
|
async run({ args }) {
|
|
65916
|
-
const { sagas: sagas2, getProjectRoot:
|
|
65917
|
-
const projectRoot =
|
|
66461
|
+
const { sagas: sagas2, getProjectRoot: getProjectRoot58 } = await import("@cleocode/core");
|
|
66462
|
+
const projectRoot = getProjectRoot58();
|
|
65918
66463
|
const sagaId = typeof args.sagaId === "string" && args.sagaId.length > 0 ? args.sagaId : void 0;
|
|
65919
66464
|
const result = await sagas2.sagaNext(projectRoot, { sagaId });
|
|
65920
66465
|
cliOutput(result.success ? result.data : result, { command: "saga", operation: "saga.next" });
|
|
@@ -67656,7 +68201,7 @@ var sequence_exports = {};
|
|
|
67656
68201
|
__export(sequence_exports, {
|
|
67657
68202
|
sequenceCommand: () => sequenceCommand
|
|
67658
68203
|
});
|
|
67659
|
-
import { getProjectRoot as
|
|
68204
|
+
import { getProjectRoot as getProjectRoot53 } from "@cleocode/core/internal";
|
|
67660
68205
|
var showCommand13, checkCommand7, repairCommand2, sequenceCommand;
|
|
67661
68206
|
var init_sequence = __esm({
|
|
67662
68207
|
"packages/cleo/src/cli/commands/sequence.ts"() {
|
|
@@ -67692,7 +68237,7 @@ var init_sequence = __esm({
|
|
|
67692
68237
|
meta: { name: "repair", description: "Reset counter to max + 1 if behind" },
|
|
67693
68238
|
async run() {
|
|
67694
68239
|
const { repairSequence } = await import("@cleocode/core/internal");
|
|
67695
|
-
const projectRoot =
|
|
68240
|
+
const projectRoot = getProjectRoot53();
|
|
67696
68241
|
const repair = await repairSequence(projectRoot);
|
|
67697
68242
|
const result = {
|
|
67698
68243
|
repaired: repair.repaired,
|
|
@@ -68147,8 +68692,8 @@ var init_session4 = __esm({
|
|
|
68147
68692
|
"audit-scope": { type: "string", description: "Audit log scope (global|local)" }
|
|
68148
68693
|
},
|
|
68149
68694
|
async run({ args }) {
|
|
68150
|
-
const { detectSessionDrift, getProjectRoot:
|
|
68151
|
-
const projectRoot = await
|
|
68695
|
+
const { detectSessionDrift, getProjectRoot: getProjectRoot58 } = await import("@cleocode/core");
|
|
68696
|
+
const projectRoot = await getProjectRoot58();
|
|
68152
68697
|
const scope = args["audit-scope"] === "local" ? "local" : "global";
|
|
68153
68698
|
const report = await detectSessionDrift({ projectRoot, auditScope: scope });
|
|
68154
68699
|
cliOutput(report, { command: "session drift", operation: "session.drift" });
|
|
@@ -70845,13 +71390,13 @@ var init_telemetry2 = __esm({
|
|
|
70845
71390
|
// packages/cleo/src/cli/commands/templates/lib.ts
|
|
70846
71391
|
import { readFileSync as readFileSync15 } from "node:fs";
|
|
70847
71392
|
import { isAbsolute as isAbsolute3, resolve as resolve8 } from "node:path";
|
|
70848
|
-
import { getProjectRoot as
|
|
71393
|
+
import { getProjectRoot as getProjectRoot54 } from "@cleocode/core";
|
|
70849
71394
|
import { resolveSourcePathAbsolute } from "@cleocode/core/templates/registry";
|
|
70850
71395
|
function resolveProjectRoot6(raw) {
|
|
70851
71396
|
if (typeof raw === "string" && raw.length > 0) {
|
|
70852
71397
|
return isAbsolute3(raw) ? raw : resolve8(process.cwd(), raw);
|
|
70853
71398
|
}
|
|
70854
|
-
return
|
|
71399
|
+
return getProjectRoot54();
|
|
70855
71400
|
}
|
|
70856
71401
|
function readTemplateSource(entry) {
|
|
70857
71402
|
const sourceAbsolute = resolveSourcePathAbsolute(entry);
|
|
@@ -71635,7 +72180,7 @@ __export(token_exports, {
|
|
|
71635
72180
|
tokenCommand: () => tokenCommand
|
|
71636
72181
|
});
|
|
71637
72182
|
import { readFileSync as readFileSync19 } from "node:fs";
|
|
71638
|
-
import { getProjectRoot as
|
|
72183
|
+
import { getProjectRoot as getProjectRoot55, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
|
|
71639
72184
|
function readPayload(args, textKey, fileKey) {
|
|
71640
72185
|
const text = args[textKey];
|
|
71641
72186
|
const file = args[fileKey];
|
|
@@ -71799,7 +72344,7 @@ var init_token = __esm({
|
|
|
71799
72344
|
domain: args.domain,
|
|
71800
72345
|
operation: args.operation
|
|
71801
72346
|
};
|
|
71802
|
-
const result = args.record ? await recordTokenExchange2(
|
|
72347
|
+
const result = args.record ? await recordTokenExchange2(getProjectRoot55(), input2) : await measureTokenExchange(input2);
|
|
71803
72348
|
cliOutput(result, {
|
|
71804
72349
|
command: "token",
|
|
71805
72350
|
operation: args.record ? "admin.token.record" : "token.estimate"
|
|
@@ -71835,7 +72380,7 @@ __export(transcript_exports, {
|
|
|
71835
72380
|
});
|
|
71836
72381
|
import { homedir as homedir6 } from "node:os";
|
|
71837
72382
|
import { join as join34 } from "node:path";
|
|
71838
|
-
import { getProjectRoot as
|
|
72383
|
+
import { getProjectRoot as getProjectRoot56 } from "@cleocode/core";
|
|
71839
72384
|
import {
|
|
71840
72385
|
parseDurationMs,
|
|
71841
72386
|
pruneTranscripts,
|
|
@@ -71865,7 +72410,7 @@ var init_transcript = __esm({
|
|
|
71865
72410
|
async run({ args }) {
|
|
71866
72411
|
if (args.pending) {
|
|
71867
72412
|
try {
|
|
71868
|
-
const projectRoot =
|
|
72413
|
+
const projectRoot = getProjectRoot56();
|
|
71869
72414
|
const { scanPendingTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
71870
72415
|
const pending = await scanPendingTranscripts(projectRoot);
|
|
71871
72416
|
cliOutput(
|
|
@@ -71962,7 +72507,7 @@ var init_transcript = __esm({
|
|
|
71962
72507
|
async run({ args }) {
|
|
71963
72508
|
const tier = args.tier ?? "warm";
|
|
71964
72509
|
const dryRun = args["dry-run"] ?? false;
|
|
71965
|
-
const projectRoot =
|
|
72510
|
+
const projectRoot = getProjectRoot56();
|
|
71966
72511
|
try {
|
|
71967
72512
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
71968
72513
|
const { findSessionTranscriptPath, listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -72074,7 +72619,7 @@ var init_transcript = __esm({
|
|
|
72074
72619
|
const dryRun = args["dry-run"] ?? false;
|
|
72075
72620
|
const olderThanHours = args["older-than-hours"] ? Number.parseInt(args["older-than-hours"], 10) : 24;
|
|
72076
72621
|
const limit = args.limit ? Number.parseInt(args.limit, 10) : void 0;
|
|
72077
|
-
const projectRoot =
|
|
72622
|
+
const projectRoot = getProjectRoot56();
|
|
72078
72623
|
try {
|
|
72079
72624
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
72080
72625
|
const { listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -73548,9 +74093,9 @@ var init_workgraph2 = __esm({
|
|
|
73548
74093
|
},
|
|
73549
74094
|
async run({ args }) {
|
|
73550
74095
|
const { generatePlanningDoc } = await import("@cleocode/core/workgraph");
|
|
73551
|
-
const { getProjectRoot:
|
|
74096
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core");
|
|
73552
74097
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
73553
|
-
const projectRoot =
|
|
74098
|
+
const projectRoot = getProjectRoot58();
|
|
73554
74099
|
const audience = String(args.audience) === "agent" ? "agent" : "maintainer";
|
|
73555
74100
|
const result = await generatePlanningDoc(projectRoot, {
|
|
73556
74101
|
sagaId: String(args.sagaId),
|
|
@@ -73567,9 +74112,9 @@ var init_workgraph2 = __esm({
|
|
|
73567
74112
|
async run() {
|
|
73568
74113
|
const { validateWorkGraphStructure } = await import("@cleocode/core/workgraph");
|
|
73569
74114
|
const { taskList: taskList2 } = await import("@cleocode/core/internal");
|
|
73570
|
-
const { getProjectRoot:
|
|
74115
|
+
const { getProjectRoot: getProjectRoot58 } = await import("@cleocode/core");
|
|
73571
74116
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
73572
|
-
const projectRoot =
|
|
74117
|
+
const projectRoot = getProjectRoot58();
|
|
73573
74118
|
const listResult = await taskList2(projectRoot, { limit: 5e3 });
|
|
73574
74119
|
const tasks = listResult.success ? listResult.data?.tasks ?? [] : [];
|
|
73575
74120
|
const nodes = tasks.map((t) => ({
|
|
@@ -73588,9 +74133,9 @@ var init_workgraph2 = __esm({
|
|
|
73588
74133
|
description: "One-shot saga-to-saga workgraph dashboard (tracking checklist)"
|
|
73589
74134
|
},
|
|
73590
74135
|
async run() {
|
|
73591
|
-
const { sagas: sagas2, getProjectRoot:
|
|
74136
|
+
const { sagas: sagas2, getProjectRoot: getProjectRoot58 } = await import("@cleocode/core");
|
|
73592
74137
|
const { cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
|
|
73593
|
-
const projectRoot =
|
|
74138
|
+
const projectRoot = getProjectRoot58();
|
|
73594
74139
|
const listResult = await sagas2.sagaList(projectRoot);
|
|
73595
74140
|
if (!listResult.success) {
|
|
73596
74141
|
cliOutput2(listResult, { command: "workgraph", operation: "workgraph.status" });
|
|
@@ -73656,7 +74201,7 @@ __export(worktree_exports, {
|
|
|
73656
74201
|
worktreeCommand: () => worktreeCommand
|
|
73657
74202
|
});
|
|
73658
74203
|
import readline4 from "node:readline";
|
|
73659
|
-
import { getProjectRoot as
|
|
74204
|
+
import { getProjectRoot as getProjectRoot57, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
|
|
73660
74205
|
async function promptYesNo2(question) {
|
|
73661
74206
|
return new Promise((resolve11) => {
|
|
73662
74207
|
const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -73761,7 +74306,7 @@ var init_worktree3 = __esm({
|
|
|
73761
74306
|
const staleDays = staleDaysRaw !== void 0 ? Number.parseInt(staleDaysRaw, 10) : void 0;
|
|
73762
74307
|
const idleDaysRaw = typeof args["idle-days"] === "string" ? args["idle-days"] : void 0;
|
|
73763
74308
|
const idleDays = idleDaysRaw !== void 0 ? Number.parseInt(idleDaysRaw, 10) : void 0;
|
|
73764
|
-
const projectRoot =
|
|
74309
|
+
const projectRoot = getProjectRoot57();
|
|
73765
74310
|
const listResult = await listWorktrees2({
|
|
73766
74311
|
projectRoot,
|
|
73767
74312
|
...staleDays !== void 0 && !Number.isNaN(staleDays) ? { staleDays } : {}
|
|
@@ -74183,6 +74728,12 @@ var COMMAND_MANIFEST = [
|
|
|
74183
74728
|
description: "Unclaim a task by removing its current assignee",
|
|
74184
74729
|
load: async () => (await Promise.resolve().then(() => (init_claim(), claim_exports))).unclaimCommand
|
|
74185
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
|
+
},
|
|
74186
74737
|
{
|
|
74187
74738
|
exportName: "codeCommand",
|
|
74188
74739
|
name: "code",
|
|
@@ -74369,6 +74920,12 @@ var COMMAND_MANIFEST = [
|
|
|
74369
74920
|
description: "Check if a task ID exists (exit 0=exists, 4=not found)",
|
|
74370
74921
|
load: async () => (await Promise.resolve().then(() => (init_exists(), exists_exports))).existsCommand
|
|
74371
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
|
+
},
|
|
74372
74929
|
{
|
|
74373
74930
|
exportName: "exportTasksCommand",
|
|
74374
74931
|
name: "export-tasks",
|
|
@@ -75359,7 +75916,7 @@ async function runStartupMaintenance() {
|
|
|
75359
75916
|
detectAndRemoveStrayProjectNexus,
|
|
75360
75917
|
getGlobalSalt,
|
|
75361
75918
|
getLogger: getLogger20,
|
|
75362
|
-
getProjectRoot:
|
|
75919
|
+
getProjectRoot: getProjectRoot58,
|
|
75363
75920
|
isCleanupMarkerSet,
|
|
75364
75921
|
migrateSignaldockToConduit,
|
|
75365
75922
|
needsSignaldockToConduitMigration,
|
|
@@ -75368,7 +75925,7 @@ async function runStartupMaintenance() {
|
|
|
75368
75925
|
} = await import("@cleocode/core/internal");
|
|
75369
75926
|
let projectRootForCleanup = "";
|
|
75370
75927
|
try {
|
|
75371
|
-
projectRootForCleanup =
|
|
75928
|
+
projectRootForCleanup = getProjectRoot58();
|
|
75372
75929
|
} catch {
|
|
75373
75930
|
}
|
|
75374
75931
|
if (!isCleanupMarkerSet(CLI_VERSION, projectRootForCleanup)) {
|
|
@@ -75388,7 +75945,7 @@ async function runStartupMaintenance() {
|
|
|
75388
75945
|
const isInitInvocation = process.argv.slice(2).some((a) => a === "init");
|
|
75389
75946
|
if (!isInitInvocation) {
|
|
75390
75947
|
try {
|
|
75391
|
-
const _projectRootForMigration =
|
|
75948
|
+
const _projectRootForMigration = getProjectRoot58();
|
|
75392
75949
|
if (needsSignaldockToConduitMigration(_projectRootForMigration)) {
|
|
75393
75950
|
const migrationResult = migrateSignaldockToConduit(_projectRootForMigration);
|
|
75394
75951
|
if (migrationResult.status === "failed") {
|