@cleocode/cleo 2026.5.93 → 2026.5.95
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 +655 -890
- package/dist/cli/index.js.map +3 -3
- package/package.json +11 -11
package/dist/cli/index.js
CHANGED
|
@@ -1577,6 +1577,13 @@ var init_changesets = __esm({
|
|
|
1577
1577
|
}
|
|
1578
1578
|
});
|
|
1579
1579
|
|
|
1580
|
+
// packages/contracts/src/cli-category.ts
|
|
1581
|
+
var init_cli_category = __esm({
|
|
1582
|
+
"packages/contracts/src/cli-category.ts"() {
|
|
1583
|
+
"use strict";
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
|
|
1580
1587
|
// packages/contracts/src/credentials.ts
|
|
1581
1588
|
var init_credentials = __esm({
|
|
1582
1589
|
"packages/contracts/src/credentials.ts"() {
|
|
@@ -2969,7 +2976,7 @@ var init_peer = __esm({
|
|
|
2969
2976
|
|
|
2970
2977
|
// packages/contracts/src/release/evidence-atoms.ts
|
|
2971
2978
|
import { z as z5 } from "zod";
|
|
2972
|
-
var parsedPrEvidenceAtomSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
|
|
2979
|
+
var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
|
|
2973
2980
|
var init_evidence_atoms = __esm({
|
|
2974
2981
|
"packages/contracts/src/release/evidence-atoms.ts"() {
|
|
2975
2982
|
"use strict";
|
|
@@ -2977,6 +2984,10 @@ var init_evidence_atoms = __esm({
|
|
|
2977
2984
|
kind: z5.literal("pr"),
|
|
2978
2985
|
prNumber: z5.number().int().positive()
|
|
2979
2986
|
});
|
|
2987
|
+
prEvidenceStateModifierSchema = z5.object({
|
|
2988
|
+
kind: z5.literal("state"),
|
|
2989
|
+
value: z5.literal("MERGED")
|
|
2990
|
+
});
|
|
2980
2991
|
ghPrViewSchema = z5.object({
|
|
2981
2992
|
state: z5.enum(["OPEN", "CLOSED", "MERGED"]),
|
|
2982
2993
|
mergedAt: z5.string().nullable(),
|
|
@@ -3374,6 +3385,7 @@ var init_src2 = __esm({
|
|
|
3374
3385
|
init_attachment_schema();
|
|
3375
3386
|
init_branch_lock();
|
|
3376
3387
|
init_changesets();
|
|
3388
|
+
init_cli_category();
|
|
3377
3389
|
init_credentials();
|
|
3378
3390
|
init_docs_taxonomy();
|
|
3379
3391
|
init_engine_result();
|
|
@@ -3516,6 +3528,86 @@ var init_colors = __esm({
|
|
|
3516
3528
|
});
|
|
3517
3529
|
|
|
3518
3530
|
// packages/cleo/src/cli/renderers/format-helpers.ts
|
|
3531
|
+
function terminalWidth() {
|
|
3532
|
+
const cols = process.stdout.columns ?? 100;
|
|
3533
|
+
return Math.max(40, cols);
|
|
3534
|
+
}
|
|
3535
|
+
function visibleLength(s) {
|
|
3536
|
+
return s.replace(ANSI_REGEX, "").length;
|
|
3537
|
+
}
|
|
3538
|
+
function padVisible(s, width) {
|
|
3539
|
+
const visible = visibleLength(s);
|
|
3540
|
+
if (visible >= width) return s;
|
|
3541
|
+
return s + " ".repeat(width - visible);
|
|
3542
|
+
}
|
|
3543
|
+
function truncateVisible(s, max) {
|
|
3544
|
+
if (max <= 0) return "";
|
|
3545
|
+
if (visibleLength(s) <= max) return s;
|
|
3546
|
+
const ellipsis = "\u2026";
|
|
3547
|
+
const target = max - 1;
|
|
3548
|
+
let out = "";
|
|
3549
|
+
let visible = 0;
|
|
3550
|
+
let i = 0;
|
|
3551
|
+
while (i < s.length && visible < target) {
|
|
3552
|
+
const ch = s[i];
|
|
3553
|
+
if (ch === "\x1B" && s[i + 1] === "[") {
|
|
3554
|
+
const end = s.indexOf("m", i + 2);
|
|
3555
|
+
if (end === -1) break;
|
|
3556
|
+
out += s.slice(i, end + 1);
|
|
3557
|
+
i = end + 1;
|
|
3558
|
+
continue;
|
|
3559
|
+
}
|
|
3560
|
+
out += ch;
|
|
3561
|
+
visible++;
|
|
3562
|
+
i++;
|
|
3563
|
+
}
|
|
3564
|
+
return `${out}${ellipsis}`;
|
|
3565
|
+
}
|
|
3566
|
+
function dataTable(rows, columns, opts = {}) {
|
|
3567
|
+
if (rows.length === 0 || columns.length === 0) return "";
|
|
3568
|
+
const indent = opts.indent ?? 2;
|
|
3569
|
+
const sep2 = opts.separator ?? " ";
|
|
3570
|
+
const totalWidth = opts.totalWidth ?? terminalWidth();
|
|
3571
|
+
const showHeader = opts.showHeader !== false;
|
|
3572
|
+
const cells = rows.map((row, i) => columns.map((col) => col.get(row, i)));
|
|
3573
|
+
const natWidths = columns.map((col, c) => {
|
|
3574
|
+
const headerW = visibleLength(col.header);
|
|
3575
|
+
const cellW = Math.max(...cells.map((r) => visibleLength(r[c] ?? "")));
|
|
3576
|
+
return Math.max(headerW, cellW);
|
|
3577
|
+
});
|
|
3578
|
+
const capped = natWidths.map((w, c) => {
|
|
3579
|
+
const cap = columns[c]?.maxWidth ?? Number.MAX_SAFE_INTEGER;
|
|
3580
|
+
const min = columns[c]?.minWidth ?? 0;
|
|
3581
|
+
return Math.max(min, Math.min(w, cap));
|
|
3582
|
+
});
|
|
3583
|
+
const sepW = sep2.length * (columns.length - 1) + indent;
|
|
3584
|
+
let totalUsed = capped.reduce((a, b) => a + b, 0) + sepW;
|
|
3585
|
+
const widths = [...capped];
|
|
3586
|
+
while (totalUsed > totalWidth) {
|
|
3587
|
+
let widest = 0;
|
|
3588
|
+
for (let c = 1; c < widths.length; c++) {
|
|
3589
|
+
if ((widths[c] ?? 0) > (widths[widest] ?? 0)) widest = c;
|
|
3590
|
+
}
|
|
3591
|
+
const wCur = widths[widest] ?? 0;
|
|
3592
|
+
const minAllowed = columns[widest]?.minWidth ?? 6;
|
|
3593
|
+
if (wCur <= minAllowed) break;
|
|
3594
|
+
widths[widest] = wCur - 1;
|
|
3595
|
+
totalUsed--;
|
|
3596
|
+
}
|
|
3597
|
+
const pad = " ".repeat(indent);
|
|
3598
|
+
const lines = [];
|
|
3599
|
+
if (showHeader) {
|
|
3600
|
+
const header = columns.map(
|
|
3601
|
+
(c, i) => `${BOLD}${padVisible(truncateVisible(c.header, widths[i] ?? 0), widths[i] ?? 0)}${NC}`
|
|
3602
|
+
).join(sep2);
|
|
3603
|
+
lines.push(`${pad}${header}`);
|
|
3604
|
+
}
|
|
3605
|
+
for (const row of cells) {
|
|
3606
|
+
const formatted = row.map((cell, i) => padVisible(truncateVisible(cell ?? "", widths[i] ?? 0), widths[i] ?? 0)).join(sep2);
|
|
3607
|
+
lines.push(`${pad}${formatted}`);
|
|
3608
|
+
}
|
|
3609
|
+
return lines.join("\n");
|
|
3610
|
+
}
|
|
3519
3611
|
function pagerFooter(input2) {
|
|
3520
3612
|
const { shown, page } = input2;
|
|
3521
3613
|
const total = page?.total ?? input2.total ?? shown;
|
|
@@ -3557,10 +3649,12 @@ function metaFooter(meta) {
|
|
|
3557
3649
|
if (chips.length > 0) lines.push(`${DIM}[${chips.join(" \xB7 ")}]${NC}`);
|
|
3558
3650
|
return lines.join("\n");
|
|
3559
3651
|
}
|
|
3652
|
+
var ANSI_REGEX;
|
|
3560
3653
|
var init_format_helpers = __esm({
|
|
3561
3654
|
"packages/cleo/src/cli/renderers/format-helpers.ts"() {
|
|
3562
3655
|
"use strict";
|
|
3563
3656
|
init_colors();
|
|
3657
|
+
ANSI_REGEX = /\x1b\[[0-9;]*m/g;
|
|
3564
3658
|
}
|
|
3565
3659
|
});
|
|
3566
3660
|
|
|
@@ -8023,6 +8117,36 @@ var init_registry = __esm({
|
|
|
8023
8117
|
}
|
|
8024
8118
|
]
|
|
8025
8119
|
},
|
|
8120
|
+
{
|
|
8121
|
+
gateway: "mutate",
|
|
8122
|
+
domain: "tasks",
|
|
8123
|
+
operation: "add-batch",
|
|
8124
|
+
description: "tasks.add-batch (mutate) \u2014 bulk-create N tasks atomically in a single transaction (epic decomposition: 1 call instead of N)",
|
|
8125
|
+
tier: 0,
|
|
8126
|
+
idempotent: false,
|
|
8127
|
+
sessionRequired: false,
|
|
8128
|
+
requiredParams: ["tasks"],
|
|
8129
|
+
params: [
|
|
8130
|
+
{
|
|
8131
|
+
name: "tasks",
|
|
8132
|
+
type: "array",
|
|
8133
|
+
required: true,
|
|
8134
|
+
description: "Array of task specs to insert atomically (each must have a title)"
|
|
8135
|
+
},
|
|
8136
|
+
{
|
|
8137
|
+
name: "defaultParent",
|
|
8138
|
+
type: "string",
|
|
8139
|
+
required: false,
|
|
8140
|
+
description: "Optional default parent task ID applied when a task spec omits parent"
|
|
8141
|
+
},
|
|
8142
|
+
{
|
|
8143
|
+
name: "dryRun",
|
|
8144
|
+
type: "boolean",
|
|
8145
|
+
required: false,
|
|
8146
|
+
description: "Validate and predict IDs without writing to the database"
|
|
8147
|
+
}
|
|
8148
|
+
]
|
|
8149
|
+
},
|
|
8026
8150
|
{
|
|
8027
8151
|
gateway: "mutate",
|
|
8028
8152
|
domain: "tasks",
|
|
@@ -8067,7 +8191,9 @@ var init_registry = __esm({
|
|
|
8067
8191
|
operation: "cancel",
|
|
8068
8192
|
description: "tasks.cancel (mutate) \u2014 cancel task (soft terminal state; reversible via tasks.restore)",
|
|
8069
8193
|
tier: 1,
|
|
8070
|
-
|
|
8194
|
+
// T9838: re-cancel returns `alreadyCancelled: true` instead of failing,
|
|
8195
|
+
// so the operation is idempotent at the registry level.
|
|
8196
|
+
idempotent: true,
|
|
8071
8197
|
sessionRequired: false,
|
|
8072
8198
|
requiredParams: ["taskId"],
|
|
8073
8199
|
params: [
|
|
@@ -8077,6 +8203,15 @@ var init_registry = __esm({
|
|
|
8077
8203
|
required: true,
|
|
8078
8204
|
description: "taskId parameter",
|
|
8079
8205
|
cli: { positional: true }
|
|
8206
|
+
},
|
|
8207
|
+
{
|
|
8208
|
+
// T9838: reason was implicitly accepted by the dispatch handler but
|
|
8209
|
+
// missing from the registry schema, so dispatch tooling treated it
|
|
8210
|
+
// as an unknown param.
|
|
8211
|
+
name: "reason",
|
|
8212
|
+
type: "string",
|
|
8213
|
+
required: false,
|
|
8214
|
+
description: "Optional human-readable cancellation reason stored on the task"
|
|
8080
8215
|
}
|
|
8081
8216
|
]
|
|
8082
8217
|
},
|
|
@@ -9682,24 +9817,6 @@ var init_registry = __esm({
|
|
|
9682
9817
|
requiredParams: [],
|
|
9683
9818
|
params: []
|
|
9684
9819
|
},
|
|
9685
|
-
{
|
|
9686
|
-
gateway: "query",
|
|
9687
|
-
domain: "pipeline",
|
|
9688
|
-
operation: "release.changelog.since",
|
|
9689
|
-
description: "Generate CHANGELOG from git log since a given tag \u2014 parses T\\d+ task/epic IDs and groups by epic (T820 RELEASE-02)",
|
|
9690
|
-
tier: 1,
|
|
9691
|
-
idempotent: true,
|
|
9692
|
-
sessionRequired: false,
|
|
9693
|
-
requiredParams: ["sinceTag"],
|
|
9694
|
-
params: [
|
|
9695
|
-
{
|
|
9696
|
-
name: "sinceTag",
|
|
9697
|
-
type: "string",
|
|
9698
|
-
required: true,
|
|
9699
|
-
description: "sinceTag parameter"
|
|
9700
|
-
}
|
|
9701
|
-
]
|
|
9702
|
-
},
|
|
9703
9820
|
{
|
|
9704
9821
|
gateway: "query",
|
|
9705
9822
|
domain: "pipeline",
|
|
@@ -13857,8 +13974,6 @@ __export(engine_exports, {
|
|
|
13857
13974
|
queryHookProviders: () => queryHookProviders,
|
|
13858
13975
|
readManifestEntries: () => readManifestEntries,
|
|
13859
13976
|
releaseCancel: () => releaseCancel,
|
|
13860
|
-
releaseChangelog: () => releaseChangelog,
|
|
13861
|
-
releaseChangelogSince: () => releaseChangelogSince,
|
|
13862
13977
|
releaseCommit: () => releaseCommit,
|
|
13863
13978
|
releaseGateCheck: () => releaseGateCheck,
|
|
13864
13979
|
releaseGatesRun: () => releaseGatesRun,
|
|
@@ -13951,6 +14066,7 @@ __export(engine_exports, {
|
|
|
13951
14066
|
taskUnclaim: () => taskUnclaim,
|
|
13952
14067
|
taskUpdate: () => taskUpdate,
|
|
13953
14068
|
taskWorkHistory: () => taskWorkHistory,
|
|
14069
|
+
tasksAddBatchOp: () => tasksAddBatchOp,
|
|
13954
14070
|
validateBatchValidate: () => coreBatchValidate,
|
|
13955
14071
|
validateCoherenceCheck: () => coreCoherenceCheck,
|
|
13956
14072
|
validateComplianceRecord: () => coreComplianceRecord,
|
|
@@ -14083,8 +14199,6 @@ import {
|
|
|
14083
14199
|
queryHookProviders,
|
|
14084
14200
|
readManifestEntries,
|
|
14085
14201
|
releaseCancel,
|
|
14086
|
-
releaseChangelog,
|
|
14087
|
-
releaseChangelogSince,
|
|
14088
14202
|
releaseCommit,
|
|
14089
14203
|
releaseGateCheck,
|
|
14090
14204
|
releaseGatesRun,
|
|
@@ -14172,6 +14286,7 @@ import {
|
|
|
14172
14286
|
taskSyncLinks,
|
|
14173
14287
|
taskSyncLinksRemove,
|
|
14174
14288
|
taskSyncReconcile,
|
|
14289
|
+
tasksAddBatchOp,
|
|
14175
14290
|
taskTree,
|
|
14176
14291
|
taskUnarchive,
|
|
14177
14292
|
taskUnclaim,
|
|
@@ -26137,8 +26252,8 @@ async function loadPlaybookByName(name) {
|
|
|
26137
26252
|
return null;
|
|
26138
26253
|
}
|
|
26139
26254
|
try {
|
|
26140
|
-
const { getProjectRoot:
|
|
26141
|
-
const projectRoot = __playbookRuntimeOverrides.projectRoot ??
|
|
26255
|
+
const { getProjectRoot: getProjectRoot43 } = await import("@cleocode/core/internal");
|
|
26256
|
+
const projectRoot = __playbookRuntimeOverrides.projectRoot ?? getProjectRoot43();
|
|
26142
26257
|
const resolved = resolvePlaybook(name, {
|
|
26143
26258
|
projectRoot,
|
|
26144
26259
|
globalPlaybooksDir: __playbookRuntimeOverrides.globalPlaybooksDir,
|
|
@@ -26182,8 +26297,8 @@ async function acquireDb() {
|
|
|
26182
26297
|
async function buildDefaultDispatcher() {
|
|
26183
26298
|
if (__playbookRuntimeOverrides.dispatcher) return __playbookRuntimeOverrides.dispatcher;
|
|
26184
26299
|
const { orchestrateSpawnExecute: orchestrateSpawnExecute2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
26185
|
-
const { getProjectRoot:
|
|
26186
|
-
const projectRoot =
|
|
26300
|
+
const { getProjectRoot: getProjectRoot43 } = await import("@cleocode/core/internal");
|
|
26301
|
+
const projectRoot = getProjectRoot43();
|
|
26187
26302
|
return {
|
|
26188
26303
|
async dispatch(input2) {
|
|
26189
26304
|
try {
|
|
@@ -26373,8 +26488,8 @@ var init_playbook2 = __esm({
|
|
|
26373
26488
|
projectRoot = __playbookRuntimeOverrides.projectRoot;
|
|
26374
26489
|
} else {
|
|
26375
26490
|
try {
|
|
26376
|
-
const { getProjectRoot:
|
|
26377
|
-
projectRoot =
|
|
26491
|
+
const { getProjectRoot: getProjectRoot43 } = await import("@cleocode/core/internal");
|
|
26492
|
+
projectRoot = getProjectRoot43();
|
|
26378
26493
|
} catch {
|
|
26379
26494
|
projectRoot = void 0;
|
|
26380
26495
|
}
|
|
@@ -26438,14 +26553,14 @@ var init_playbook2 = __esm({
|
|
|
26438
26553
|
const dispatcher = await buildDefaultDispatcher();
|
|
26439
26554
|
let result;
|
|
26440
26555
|
try {
|
|
26441
|
-
const { getProjectRoot:
|
|
26556
|
+
const { getProjectRoot: getProjectRoot43 } = await import("@cleocode/core/internal");
|
|
26442
26557
|
const opts = {
|
|
26443
26558
|
db,
|
|
26444
26559
|
playbook: parsed.definition,
|
|
26445
26560
|
playbookHash: parsed.sourceHash,
|
|
26446
26561
|
initialContext,
|
|
26447
26562
|
dispatcher,
|
|
26448
|
-
projectRoot:
|
|
26563
|
+
projectRoot: getProjectRoot43()
|
|
26449
26564
|
};
|
|
26450
26565
|
if (__playbookRuntimeOverrides.approvalSecret !== void 0) {
|
|
26451
26566
|
opts.approvalSecret = __playbookRuntimeOverrides.approvalSecret;
|
|
@@ -26648,7 +26763,8 @@ async function orchestrateNextOp(params) {
|
|
|
26648
26763
|
}
|
|
26649
26764
|
async function orchestrateReadyOp(params) {
|
|
26650
26765
|
return orchestrateReady(params.epicId, getProjectRoot10(), {
|
|
26651
|
-
ignoreDepsValidate: params.ignoreDepsValidate
|
|
26766
|
+
ignoreDepsValidate: params.ignoreDepsValidate,
|
|
26767
|
+
via: params.via
|
|
26652
26768
|
});
|
|
26653
26769
|
}
|
|
26654
26770
|
async function orchestrateAnalyzeOp(params) {
|
|
@@ -26694,7 +26810,7 @@ async function orchestrateContextOp(params) {
|
|
|
26694
26810
|
return orchestrateContext(params.epicId, getProjectRoot10());
|
|
26695
26811
|
}
|
|
26696
26812
|
async function orchestrateWavesOp(params) {
|
|
26697
|
-
return orchestrateWaves(params.epicId, getProjectRoot10());
|
|
26813
|
+
return orchestrateWaves(params.epicId, getProjectRoot10(), { via: params.via });
|
|
26698
26814
|
}
|
|
26699
26815
|
async function orchestratePlanOp(params) {
|
|
26700
26816
|
return orchestratePlan({
|
|
@@ -26807,7 +26923,7 @@ async function orchestrateRejectOp(params) {
|
|
|
26807
26923
|
async function orchestrateClassify(request, context, projectRoot) {
|
|
26808
26924
|
try {
|
|
26809
26925
|
const { getCleoCantWorkflowsDir } = await import("@cleocode/core/internal");
|
|
26810
|
-
const { readFileSync:
|
|
26926
|
+
const { readFileSync: readFileSync19, readdirSync: readdirSync4, existsSync: existsSync18 } = await import("node:fs");
|
|
26811
26927
|
const { join: join35 } = await import("node:path");
|
|
26812
26928
|
const workflowsDir = getCleoCantWorkflowsDir();
|
|
26813
26929
|
const combined = `${request} ${context ?? ""}`.toLowerCase();
|
|
@@ -26816,7 +26932,7 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
26816
26932
|
const files = readdirSync4(workflowsDir).filter((f) => f.endsWith(".cant"));
|
|
26817
26933
|
for (const file of files) {
|
|
26818
26934
|
try {
|
|
26819
|
-
const src =
|
|
26935
|
+
const src = readFileSync19(join35(workflowsDir, file), "utf-8");
|
|
26820
26936
|
const teamMatch = /^team\s+(\S+):/m.exec(src);
|
|
26821
26937
|
if (!teamMatch) continue;
|
|
26822
26938
|
const teamName = teamMatch[1];
|
|
@@ -26836,7 +26952,7 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
26836
26952
|
const files = readdirSync4(localCantDir).filter((f) => f.endsWith(".cant"));
|
|
26837
26953
|
for (const file of files) {
|
|
26838
26954
|
try {
|
|
26839
|
-
const src =
|
|
26955
|
+
const src = readFileSync19(join35(localCantDir, file), "utf-8");
|
|
26840
26956
|
const teamMatch = /^team\s+(\S+):/m.exec(src);
|
|
26841
26957
|
if (!teamMatch) continue;
|
|
26842
26958
|
const teamName = teamMatch[1];
|
|
@@ -27354,9 +27470,12 @@ var init_orchestrate2 = __esm({
|
|
|
27354
27470
|
"epicId is required",
|
|
27355
27471
|
startTime
|
|
27356
27472
|
);
|
|
27473
|
+
const viaRaw = params.via;
|
|
27474
|
+
const via = viaRaw === "parent" || viaRaw === "saga" || viaRaw === "both" ? viaRaw : void 0;
|
|
27357
27475
|
const p = {
|
|
27358
27476
|
epicId: params.epicId,
|
|
27359
|
-
ignoreDepsValidate: params.ignoreDepsValidate
|
|
27477
|
+
ignoreDepsValidate: params.ignoreDepsValidate,
|
|
27478
|
+
...via !== void 0 && { via }
|
|
27360
27479
|
};
|
|
27361
27480
|
return wrapResult(await coreOps2.ready(p), "query", "orchestrate", operation, startTime);
|
|
27362
27481
|
}
|
|
@@ -27430,7 +27549,12 @@ var init_orchestrate2 = __esm({
|
|
|
27430
27549
|
"epicId is required",
|
|
27431
27550
|
startTime
|
|
27432
27551
|
);
|
|
27433
|
-
const
|
|
27552
|
+
const wavesViaRaw = params.via;
|
|
27553
|
+
const wavesVia = wavesViaRaw === "parent" || wavesViaRaw === "saga" || wavesViaRaw === "both" ? wavesViaRaw : void 0;
|
|
27554
|
+
const p = {
|
|
27555
|
+
epicId: params.epicId,
|
|
27556
|
+
...wavesVia !== void 0 && { via: wavesVia }
|
|
27557
|
+
};
|
|
27434
27558
|
return wrapResult(await coreOps2.waves(p), "query", "orchestrate", operation, startTime);
|
|
27435
27559
|
}
|
|
27436
27560
|
case "plan": {
|
|
@@ -28035,9 +28159,6 @@ async function releaseChannelShowOp(_params) {
|
|
|
28035
28159
|
data: { branch: currentBranch, channel: resolvedChannel, distTag, description }
|
|
28036
28160
|
};
|
|
28037
28161
|
}
|
|
28038
|
-
async function releaseChangelogSinceOp(params) {
|
|
28039
|
-
return releaseChangelogSince(params.sinceTag, getProjectRoot11());
|
|
28040
|
-
}
|
|
28041
28162
|
async function releasePrStatusOp(params) {
|
|
28042
28163
|
return releasePrStatus(params.version, getProjectRoot11());
|
|
28043
28164
|
}
|
|
@@ -28196,7 +28317,6 @@ var init_pipeline3 = __esm({
|
|
|
28196
28317
|
"release.list": releaseListOp,
|
|
28197
28318
|
"release.show": releaseShowOp,
|
|
28198
28319
|
"release.channel.show": releaseChannelShowOp,
|
|
28199
|
-
"release.changelog.since": releaseChangelogSinceOp,
|
|
28200
28320
|
"release.pr-status": releasePrStatusOp,
|
|
28201
28321
|
"release.cancel": releaseCancelOp,
|
|
28202
28322
|
"release.rollback": releaseRollbackOp,
|
|
@@ -28332,15 +28452,6 @@ var init_pipeline3 = __esm({
|
|
|
28332
28452
|
},
|
|
28333
28453
|
// Always succeeds (git branch detection falls back to 'unknown') — no error path.
|
|
28334
28454
|
"release.channel.show": async (_params) => lafsSuccess((await coreOps3["release.channel.show"](_params)).data, "release.channel.show"),
|
|
28335
|
-
"release.changelog.since": async (params) => {
|
|
28336
|
-
if (!params.sinceTag) {
|
|
28337
|
-
return lafsError("E_INVALID_INPUT", "sinceTag is required", "release.changelog.since");
|
|
28338
|
-
}
|
|
28339
|
-
return wrapCoreResult(
|
|
28340
|
-
await coreOps3["release.changelog.since"](params),
|
|
28341
|
-
"release.changelog.since"
|
|
28342
|
-
);
|
|
28343
|
-
},
|
|
28344
28455
|
// -------------------------------------------------------------------------
|
|
28345
28456
|
// Release mutations
|
|
28346
28457
|
//
|
|
@@ -28515,7 +28626,6 @@ var init_pipeline3 = __esm({
|
|
|
28515
28626
|
"release.list",
|
|
28516
28627
|
"release.show",
|
|
28517
28628
|
"release.channel.show",
|
|
28518
|
-
"release.changelog.since",
|
|
28519
28629
|
"release.pr-status",
|
|
28520
28630
|
"phase.show",
|
|
28521
28631
|
"phase.list",
|
|
@@ -28630,7 +28740,6 @@ var init_pipeline3 = __esm({
|
|
|
28630
28740
|
"release.list",
|
|
28631
28741
|
"release.show",
|
|
28632
28742
|
"release.channel.show",
|
|
28633
|
-
"release.changelog.since",
|
|
28634
28743
|
"phase.show",
|
|
28635
28744
|
"phase.list",
|
|
28636
28745
|
"chain.show",
|
|
@@ -28931,9 +29040,13 @@ var init_release2 = __esm({
|
|
|
28931
29040
|
);
|
|
28932
29041
|
}
|
|
28933
29042
|
// release.plan — SPEC-T9345 §4.2 (T9525): build canonical Release Plan envelope
|
|
29043
|
+
// T9838: --saga and --no-changelog flags forwarded; epicId no longer
|
|
29044
|
+
// required at the dispatch layer — the core verb validates that
|
|
29045
|
+
// (epicId XOR sagaId) is set.
|
|
28934
29046
|
case "plan": {
|
|
28935
29047
|
const version = typeof params?.version === "string" ? params.version : void 0;
|
|
28936
29048
|
const epicId = typeof params?.epicId === "string" ? params.epicId : void 0;
|
|
29049
|
+
const sagaId = typeof params?.sagaId === "string" ? params.sagaId : void 0;
|
|
28937
29050
|
if (!version) {
|
|
28938
29051
|
return errorResult(
|
|
28939
29052
|
"mutate",
|
|
@@ -28944,23 +29057,25 @@ var init_release2 = __esm({
|
|
|
28944
29057
|
startTime
|
|
28945
29058
|
);
|
|
28946
29059
|
}
|
|
28947
|
-
if (!epicId) {
|
|
29060
|
+
if (!epicId && !sagaId) {
|
|
28948
29061
|
return errorResult(
|
|
28949
29062
|
"mutate",
|
|
28950
29063
|
"release",
|
|
28951
29064
|
operation,
|
|
28952
29065
|
"E_INVALID_INPUT",
|
|
28953
|
-
"
|
|
29066
|
+
"--saga or --epic is required",
|
|
28954
29067
|
startTime
|
|
28955
29068
|
);
|
|
28956
29069
|
}
|
|
28957
29070
|
const typed = {
|
|
28958
29071
|
version,
|
|
28959
|
-
epicId,
|
|
29072
|
+
...epicId ? { epicId } : {},
|
|
29073
|
+
...sagaId ? { sagaId } : {},
|
|
28960
29074
|
scheme: typeof params?.scheme === "string" ? params.scheme : void 0,
|
|
28961
29075
|
channel: typeof params?.channel === "string" ? params.channel : void 0,
|
|
28962
29076
|
hotfix: typeof params?.hotfix === "boolean" ? params.hotfix : false,
|
|
28963
29077
|
dryRun: typeof params?.dryRun === "boolean" ? params.dryRun : false,
|
|
29078
|
+
writeChangelog: typeof params?.writeChangelog === "boolean" ? params.writeChangelog : true,
|
|
28964
29079
|
projectRoot: getProjectRoot13()
|
|
28965
29080
|
};
|
|
28966
29081
|
return wrapResult(await releasePlan(typed), "mutate", "release", operation, startTime);
|
|
@@ -30284,6 +30399,17 @@ var init_tasks3 = __esm({
|
|
|
30284
30399
|
// -------------------------------------------------------------------------
|
|
30285
30400
|
// Mutate ops
|
|
30286
30401
|
// -------------------------------------------------------------------------
|
|
30402
|
+
"add-batch": async (params) => {
|
|
30403
|
+
const projectRoot = getProjectRoot17();
|
|
30404
|
+
return wrapCoreResult(
|
|
30405
|
+
await tasksAddBatchOp(projectRoot, {
|
|
30406
|
+
tasks: params.tasks ?? [],
|
|
30407
|
+
defaultParent: typeof params.defaultParent === "string" ? params.defaultParent : void 0,
|
|
30408
|
+
dryRun: typeof params.dryRun === "boolean" ? params.dryRun : void 0
|
|
30409
|
+
}),
|
|
30410
|
+
"add-batch"
|
|
30411
|
+
);
|
|
30412
|
+
},
|
|
30287
30413
|
add: async (params) => {
|
|
30288
30414
|
const projectRoot = getProjectRoot17();
|
|
30289
30415
|
return wrapCoreResult(
|
|
@@ -30524,6 +30650,7 @@ var init_tasks3 = __esm({
|
|
|
30524
30650
|
]);
|
|
30525
30651
|
MUTATE_OPS10 = /* @__PURE__ */ new Set([
|
|
30526
30652
|
"add",
|
|
30653
|
+
"add-batch",
|
|
30527
30654
|
"update",
|
|
30528
30655
|
"complete",
|
|
30529
30656
|
"cancel",
|
|
@@ -32118,11 +32245,11 @@ var init_security = __esm({
|
|
|
32118
32245
|
});
|
|
32119
32246
|
|
|
32120
32247
|
// packages/cleo/src/dispatch/middleware/sanitizer.ts
|
|
32121
|
-
function createSanitizer(
|
|
32248
|
+
function createSanitizer(getProjectRoot43) {
|
|
32122
32249
|
return async (req, next) => {
|
|
32123
32250
|
if (req.params) {
|
|
32124
32251
|
try {
|
|
32125
|
-
const root =
|
|
32252
|
+
const root = getProjectRoot43 ? getProjectRoot43() : void 0;
|
|
32126
32253
|
req.params = sanitizeParams(req.params, root, {
|
|
32127
32254
|
domain: req.domain,
|
|
32128
32255
|
operation: req.operation
|
|
@@ -32669,7 +32796,10 @@ var init_add_batch = __esm({
|
|
|
32669
32796
|
init_cli();
|
|
32670
32797
|
init_renderers();
|
|
32671
32798
|
addBatchCommand = defineCommand({
|
|
32672
|
-
meta: {
|
|
32799
|
+
meta: {
|
|
32800
|
+
name: "add-batch",
|
|
32801
|
+
description: "Create multiple tasks in a single atomic transaction from a JSON file"
|
|
32802
|
+
},
|
|
32673
32803
|
args: {
|
|
32674
32804
|
file: {
|
|
32675
32805
|
type: "string",
|
|
@@ -32691,21 +32821,16 @@ var init_add_batch = __esm({
|
|
|
32691
32821
|
let raw;
|
|
32692
32822
|
if (!filePath || filePath === "-") {
|
|
32693
32823
|
const chunks = [];
|
|
32694
|
-
for await (const chunk of process.stdin)
|
|
32695
|
-
chunks.push(chunk);
|
|
32696
|
-
}
|
|
32824
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
32697
32825
|
raw = Buffer.concat(chunks).toString("utf-8");
|
|
32698
32826
|
if (!raw.trim()) {
|
|
32699
32827
|
cliError(
|
|
32700
32828
|
"No input provided. Pass --file <path> or pipe JSON to stdin.",
|
|
32701
32829
|
"E_VALIDATION",
|
|
32702
|
-
{
|
|
32703
|
-
name: "E_VALIDATION",
|
|
32704
|
-
fix: "cleo add-batch --file tasks.json"
|
|
32705
|
-
},
|
|
32830
|
+
{ name: "E_VALIDATION", fix: "cleo add-batch --file tasks.json" },
|
|
32706
32831
|
{ operation: "tasks.add-batch" }
|
|
32707
32832
|
);
|
|
32708
|
-
process.
|
|
32833
|
+
process.exitCode = 2;
|
|
32709
32834
|
return;
|
|
32710
32835
|
}
|
|
32711
32836
|
} else {
|
|
@@ -32713,13 +32838,10 @@ var init_add_batch = __esm({
|
|
|
32713
32838
|
cliError(
|
|
32714
32839
|
`File not found: ${filePath}`,
|
|
32715
32840
|
"E_NOT_FOUND",
|
|
32716
|
-
{
|
|
32717
|
-
name: "E_NOT_FOUND",
|
|
32718
|
-
fix: `Verify the file path exists: ${filePath}`
|
|
32719
|
-
},
|
|
32841
|
+
{ name: "E_NOT_FOUND", fix: `Verify the file path exists: ${filePath}` },
|
|
32720
32842
|
{ operation: "tasks.add-batch" }
|
|
32721
32843
|
);
|
|
32722
|
-
process.
|
|
32844
|
+
process.exitCode = 2;
|
|
32723
32845
|
return;
|
|
32724
32846
|
}
|
|
32725
32847
|
raw = readFileSync8(filePath, "utf-8");
|
|
@@ -32732,79 +32854,41 @@ var init_add_batch = __esm({
|
|
|
32732
32854
|
cliError(
|
|
32733
32855
|
"Invalid JSON input. Expected an array of task objects.",
|
|
32734
32856
|
"E_VALIDATION",
|
|
32735
|
-
{
|
|
32736
|
-
name: "E_VALIDATION",
|
|
32737
|
-
fix: "Ensure the input is a valid JSON array of task objects"
|
|
32738
|
-
},
|
|
32857
|
+
{ name: "E_VALIDATION", fix: "Ensure the input is a valid JSON array of task objects" },
|
|
32739
32858
|
{ operation: "tasks.add-batch" }
|
|
32740
32859
|
);
|
|
32741
|
-
process.
|
|
32860
|
+
process.exitCode = 2;
|
|
32742
32861
|
return;
|
|
32743
32862
|
}
|
|
32744
32863
|
if (tasks.length === 0) {
|
|
32745
32864
|
cliError(
|
|
32746
32865
|
"No tasks in input.",
|
|
32747
32866
|
"E_VALIDATION",
|
|
32867
|
+
{ name: "E_VALIDATION", fix: "Provide at least one task object in the JSON array" },
|
|
32868
|
+
{ operation: "tasks.add-batch" }
|
|
32869
|
+
);
|
|
32870
|
+
process.exitCode = 2;
|
|
32871
|
+
return;
|
|
32872
|
+
}
|
|
32873
|
+
const response = await dispatchRaw("mutate", "tasks", "add-batch", {
|
|
32874
|
+
tasks,
|
|
32875
|
+
...defaultParent && { defaultParent },
|
|
32876
|
+
...dryRun && { dryRun: true }
|
|
32877
|
+
});
|
|
32878
|
+
if (!response.success) {
|
|
32879
|
+
cliError(
|
|
32880
|
+
response.error?.message ?? "Batch creation failed",
|
|
32881
|
+
response.error?.code ?? "E_BATCH_FAILED",
|
|
32748
32882
|
{
|
|
32749
|
-
name: "
|
|
32750
|
-
fix:
|
|
32883
|
+
name: response.error?.code ?? "E_BATCH_FAILED",
|
|
32884
|
+
fix: response.error?.fix ?? "Check task specs and try again"
|
|
32751
32885
|
},
|
|
32752
32886
|
{ operation: "tasks.add-batch" }
|
|
32753
32887
|
);
|
|
32754
|
-
process.
|
|
32888
|
+
process.exitCode = 1;
|
|
32755
32889
|
return;
|
|
32756
32890
|
}
|
|
32757
|
-
|
|
32758
|
-
let failed = 0;
|
|
32759
|
-
for (const task of tasks) {
|
|
32760
|
-
const params = {
|
|
32761
|
-
title: task.title,
|
|
32762
|
-
...task.description && { description: task.description },
|
|
32763
|
-
parent: task.parent ?? defaultParent,
|
|
32764
|
-
...task.type && { type: task.type },
|
|
32765
|
-
...task.priority && { priority: task.priority },
|
|
32766
|
-
...task.size && { size: task.size },
|
|
32767
|
-
...task.acceptance?.length && { acceptance: task.acceptance },
|
|
32768
|
-
...task.depends?.length && { depends: task.depends },
|
|
32769
|
-
...task.labels?.length && { labels: task.labels },
|
|
32770
|
-
...task.phase && { phase: task.phase },
|
|
32771
|
-
...task.notes && { notes: task.notes },
|
|
32772
|
-
...task.files?.length && { files: task.files },
|
|
32773
|
-
...dryRun && { dryRun: true }
|
|
32774
|
-
};
|
|
32775
|
-
const response = await dispatchRaw("mutate", "tasks", "add", params);
|
|
32776
|
-
if (response.success) {
|
|
32777
|
-
const data = response.data;
|
|
32778
|
-
const taskData = data?.task;
|
|
32779
|
-
results.push({ title: task.title, id: taskData?.id });
|
|
32780
|
-
} else {
|
|
32781
|
-
failed++;
|
|
32782
|
-
results.push({
|
|
32783
|
-
title: task.title,
|
|
32784
|
-
error: response.error?.message ?? "Unknown error"
|
|
32785
|
-
});
|
|
32786
|
-
}
|
|
32787
|
-
}
|
|
32788
|
-
const output2 = {
|
|
32789
|
-
total: tasks.length,
|
|
32790
|
-
created: tasks.length - failed,
|
|
32791
|
-
failed,
|
|
32792
|
-
dryRun: dryRun ?? false,
|
|
32793
|
-
results
|
|
32794
|
-
};
|
|
32795
|
-
if (failed > 0) {
|
|
32796
|
-
cliOutput(output2, {
|
|
32797
|
-
command: "add-batch",
|
|
32798
|
-
message: `${failed} of ${tasks.length} tasks failed`,
|
|
32799
|
-
operation: "tasks.add-batch"
|
|
32800
|
-
});
|
|
32801
|
-
process.exit(1);
|
|
32802
|
-
} else {
|
|
32803
|
-
cliOutput(output2, {
|
|
32804
|
-
command: "add-batch",
|
|
32805
|
-
operation: "tasks.add-batch"
|
|
32806
|
-
});
|
|
32807
|
-
}
|
|
32891
|
+
cliOutput(response.data, { command: "add-batch", operation: "tasks.add-batch" });
|
|
32808
32892
|
}
|
|
32809
32893
|
});
|
|
32810
32894
|
}
|
|
@@ -32830,7 +32914,8 @@ var init_add = __esm({
|
|
|
32830
32914
|
addCommand = defineCommand({
|
|
32831
32915
|
meta: {
|
|
32832
32916
|
name: "add",
|
|
32833
|
-
description:
|
|
32917
|
+
description: `Create a new task (requires active session)
|
|
32918
|
+
For 2+ tasks at once: cleo add-batch --file tasks.json (single transaction, atomic rollback)`
|
|
32834
32919
|
},
|
|
32835
32920
|
args: {
|
|
32836
32921
|
title: {
|
|
@@ -32882,7 +32967,7 @@ var init_add = __esm({
|
|
|
32882
32967
|
labels: {
|
|
32883
32968
|
type: "string",
|
|
32884
32969
|
alias: "l",
|
|
32885
|
-
description:
|
|
32970
|
+
description: 'Comma-separated labels (lowercase alphanumeric + hyphens + periods only, e.g. "track-b,wave.1") (gh-392)'
|
|
32886
32971
|
},
|
|
32887
32972
|
files: {
|
|
32888
32973
|
type: "string",
|
|
@@ -34079,13 +34164,13 @@ var init_agent = __esm({
|
|
|
34079
34164
|
transportConfig: {},
|
|
34080
34165
|
isActive: true
|
|
34081
34166
|
});
|
|
34082
|
-
const { existsSync: existsSync18, mkdirSync:
|
|
34167
|
+
const { existsSync: existsSync18, mkdirSync: mkdirSync6, writeFileSync: writeFileSync6 } = await import("node:fs");
|
|
34083
34168
|
const { join: join35 } = await import("node:path");
|
|
34084
34169
|
const cantDir = join35(CLEO_DIR_NAME, AGENTS_SUBDIR);
|
|
34085
34170
|
const cantPath = join35(cantDir, `${agentId}.cant`);
|
|
34086
34171
|
let cantScaffolded = false;
|
|
34087
34172
|
if (!existsSync18(cantPath)) {
|
|
34088
|
-
|
|
34173
|
+
mkdirSync6(cantDir, { recursive: true });
|
|
34089
34174
|
const role = classification ?? "specialist";
|
|
34090
34175
|
const cantContent = `---
|
|
34091
34176
|
kind: agent
|
|
@@ -34135,7 +34220,7 @@ agent ${agentId}:
|
|
|
34135
34220
|
enforcement:
|
|
34136
34221
|
1: TODO \u2014 what does this agent push back on?
|
|
34137
34222
|
`;
|
|
34138
|
-
|
|
34223
|
+
writeFileSync6(cantPath, cantContent, "utf-8");
|
|
34139
34224
|
cantScaffolded = true;
|
|
34140
34225
|
}
|
|
34141
34226
|
cliOutput(
|
|
@@ -34265,7 +34350,7 @@ agent ${agentId}:
|
|
|
34265
34350
|
const { AgentRegistryAccessor } = await import("@cleocode/core/agents");
|
|
34266
34351
|
const { getDb: getDb3 } = await import("@cleocode/core/internal");
|
|
34267
34352
|
const { createRuntime } = await import("@cleocode/runtime");
|
|
34268
|
-
const { existsSync: existsSync18, readFileSync:
|
|
34353
|
+
const { existsSync: existsSync18, readFileSync: readFileSync19 } = await import("node:fs");
|
|
34269
34354
|
const { join: join35 } = await import("node:path");
|
|
34270
34355
|
await getDb3();
|
|
34271
34356
|
const registry = new AgentRegistryAccessor(getProjectRoot23());
|
|
@@ -34288,7 +34373,7 @@ agent ${agentId}:
|
|
|
34288
34373
|
let cantValidation = null;
|
|
34289
34374
|
const cantPath = args.cant ?? join35(CLEO_DIR_NAME, AGENTS_SUBDIR, `${args.agentId}.cant`);
|
|
34290
34375
|
if (existsSync18(cantPath)) {
|
|
34291
|
-
profile =
|
|
34376
|
+
profile = readFileSync19(cantPath, "utf-8");
|
|
34292
34377
|
try {
|
|
34293
34378
|
const cantModule = await import("@cleocode/cant");
|
|
34294
34379
|
const validate = "validate" in cantModule ? cantModule.validate : null;
|
|
@@ -35699,7 +35784,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
35699
35784
|
async run({ args }) {
|
|
35700
35785
|
let tempDir = null;
|
|
35701
35786
|
try {
|
|
35702
|
-
const { existsSync: existsSync18, mkdirSync:
|
|
35787
|
+
const { existsSync: existsSync18, mkdirSync: mkdirSync6, statSync, readdirSync: readdirSync4, copyFileSync } = await import("node:fs");
|
|
35703
35788
|
const { join: join35, basename, resolve: resolve9, extname } = await import("node:path");
|
|
35704
35789
|
const { tmpdir: tmpdir2 } = await import("node:os");
|
|
35705
35790
|
const resolvedPath = resolve9(args.path);
|
|
@@ -35723,11 +35808,11 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
35723
35808
|
if (stat3.isFile() && ext === ".cant") {
|
|
35724
35809
|
cantPath = resolvedPath;
|
|
35725
35810
|
} else if (stat3.isFile() && ext === ".cantz") {
|
|
35726
|
-
const { execFileSync:
|
|
35811
|
+
const { execFileSync: execFileSync4 } = await import("node:child_process");
|
|
35727
35812
|
tempDir = join35(tmpdir2(), `cleo-agent-install-${Date.now()}`);
|
|
35728
|
-
|
|
35813
|
+
mkdirSync6(tempDir, { recursive: true });
|
|
35729
35814
|
try {
|
|
35730
|
-
|
|
35815
|
+
execFileSync4("unzip", ["-o", "-q", resolvedPath, "-d", tempDir], {
|
|
35731
35816
|
encoding: "utf-8",
|
|
35732
35817
|
timeout: 3e4
|
|
35733
35818
|
});
|
|
@@ -35798,7 +35883,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
35798
35883
|
return;
|
|
35799
35884
|
}
|
|
35800
35885
|
tempDir = join35(tmpdir2(), `cleo-agent-install-${Date.now()}`);
|
|
35801
|
-
|
|
35886
|
+
mkdirSync6(tempDir, { recursive: true });
|
|
35802
35887
|
cantPath = join35(tempDir, `${agentName}.cant`);
|
|
35803
35888
|
copyFileSync(personaPath, cantPath);
|
|
35804
35889
|
} else {
|
|
@@ -35919,8 +36004,8 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
35919
36004
|
async run({ args }) {
|
|
35920
36005
|
try {
|
|
35921
36006
|
const { existsSync: existsSync18, statSync } = await import("node:fs");
|
|
35922
|
-
const { resolve: resolve9, basename, dirname:
|
|
35923
|
-
const { execFileSync:
|
|
36007
|
+
const { resolve: resolve9, basename, dirname: dirname12 } = await import("node:path");
|
|
36008
|
+
const { execFileSync: execFileSync4 } = await import("node:child_process");
|
|
35924
36009
|
const resolvedDir = resolve9(args.dir);
|
|
35925
36010
|
if (!existsSync18(resolvedDir) || !statSync(resolvedDir).isDirectory()) {
|
|
35926
36011
|
cliOutput(
|
|
@@ -35955,9 +36040,9 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
35955
36040
|
const agentName = basename(resolvedDir);
|
|
35956
36041
|
const archiveName = `${agentName}.cantz`;
|
|
35957
36042
|
const archivePath = resolve9(archiveName);
|
|
35958
|
-
const parentDir =
|
|
36043
|
+
const parentDir = dirname12(resolvedDir);
|
|
35959
36044
|
try {
|
|
35960
|
-
|
|
36045
|
+
execFileSync4("zip", ["-r", archivePath, agentName], {
|
|
35961
36046
|
cwd: parentDir,
|
|
35962
36047
|
encoding: "utf-8",
|
|
35963
36048
|
timeout: 3e4
|
|
@@ -36054,7 +36139,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
36054
36139
|
},
|
|
36055
36140
|
async run({ args }) {
|
|
36056
36141
|
try {
|
|
36057
|
-
const { existsSync: existsSync18, mkdirSync:
|
|
36142
|
+
const { existsSync: existsSync18, mkdirSync: mkdirSync6, writeFileSync: writeFileSync6 } = await import("node:fs");
|
|
36058
36143
|
const { join: join35 } = await import("node:path");
|
|
36059
36144
|
const { homedir: homedir8 } = await import("node:os");
|
|
36060
36145
|
const name = args.name;
|
|
@@ -36136,7 +36221,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
36136
36221
|
process.exitCode = 6;
|
|
36137
36222
|
return;
|
|
36138
36223
|
}
|
|
36139
|
-
|
|
36224
|
+
mkdirSync6(agentDir, { recursive: true });
|
|
36140
36225
|
const personaContent = generatePersonaCant({
|
|
36141
36226
|
name,
|
|
36142
36227
|
role,
|
|
@@ -36145,9 +36230,9 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
36145
36230
|
domain,
|
|
36146
36231
|
parent
|
|
36147
36232
|
});
|
|
36148
|
-
|
|
36233
|
+
writeFileSync6(join35(agentDir, "persona.cant"), personaContent, "utf-8");
|
|
36149
36234
|
const manifest = generateManifest({ name, role, tier, domain });
|
|
36150
|
-
|
|
36235
|
+
writeFileSync6(
|
|
36151
36236
|
join35(agentDir, "manifest.json"),
|
|
36152
36237
|
`${JSON.stringify(manifest, null, 2)}
|
|
36153
36238
|
`,
|
|
@@ -36159,14 +36244,14 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
36159
36244
|
];
|
|
36160
36245
|
if (team) {
|
|
36161
36246
|
const teamConfigContent = generateTeamConfig(name, role, team);
|
|
36162
|
-
|
|
36247
|
+
writeFileSync6(join35(agentDir, "team-config.cant"), teamConfigContent, "utf-8");
|
|
36163
36248
|
createdFiles.push(join35(agentDir, "team-config.cant"));
|
|
36164
36249
|
}
|
|
36165
36250
|
if (seedBrain) {
|
|
36166
36251
|
const expertiseDir = join35(agentDir, "expertise");
|
|
36167
|
-
|
|
36252
|
+
mkdirSync6(expertiseDir, { recursive: true });
|
|
36168
36253
|
const seedContent = generateMentalModelSeed(name, role, domain);
|
|
36169
|
-
|
|
36254
|
+
writeFileSync6(join35(expertiseDir, "mental-model-seed.md"), seedContent, "utf-8");
|
|
36170
36255
|
createdFiles.push(join35(expertiseDir, "mental-model-seed.md"));
|
|
36171
36256
|
try {
|
|
36172
36257
|
const { execFile: execFile2 } = await import("node:child_process");
|
|
@@ -36266,7 +36351,7 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
36266
36351
|
},
|
|
36267
36352
|
async run({ args }) {
|
|
36268
36353
|
try {
|
|
36269
|
-
const { existsSync: existsSync18, readFileSync:
|
|
36354
|
+
const { existsSync: existsSync18, readFileSync: readFileSync19, mkdirSync: mkdirSync6 } = await import("node:fs");
|
|
36270
36355
|
const { resolve: resolve9, join: join35 } = await import("node:path");
|
|
36271
36356
|
const specPath = resolve9(args.spec);
|
|
36272
36357
|
if (!existsSync18(specPath)) {
|
|
@@ -36274,10 +36359,10 @@ Task ${args.taskId} reassigned to you by ${active.agentId}. Run: cleo show ${arg
|
|
|
36274
36359
|
process.exitCode = 4;
|
|
36275
36360
|
return;
|
|
36276
36361
|
}
|
|
36277
|
-
const specContent =
|
|
36362
|
+
const specContent = readFileSync19(specPath, "utf-8");
|
|
36278
36363
|
const projectRoot = getProjectRoot23();
|
|
36279
36364
|
const outputDir = args["output-dir"] ? resolve9(args["output-dir"]) : join35(projectRoot, ".cleo", "cant", "agents");
|
|
36280
|
-
|
|
36365
|
+
mkdirSync6(outputDir, { recursive: true });
|
|
36281
36366
|
if (args["dry-run"]) {
|
|
36282
36367
|
cliOutput(
|
|
36283
36368
|
{
|
|
@@ -37894,9 +37979,9 @@ var init_backup = __esm({
|
|
|
37894
37979
|
async run({ args }) {
|
|
37895
37980
|
const scope = args.scope;
|
|
37896
37981
|
const { packBundle } = await import("@cleocode/core/store/backup-pack.js");
|
|
37897
|
-
const { getProjectRoot:
|
|
37982
|
+
const { getProjectRoot: getProjectRoot43 } = await import("@cleocode/core");
|
|
37898
37983
|
const includesProject = scope === "project" || scope === "all";
|
|
37899
|
-
const projectRoot = includesProject ?
|
|
37984
|
+
const projectRoot = includesProject ? getProjectRoot43() : void 0;
|
|
37900
37985
|
let passphrase;
|
|
37901
37986
|
if (args.encrypt === true) {
|
|
37902
37987
|
passphrase = process.env["CLEO_BACKUP_PASSPHRASE"];
|
|
@@ -37972,12 +38057,12 @@ var init_backup = __esm({
|
|
|
37972
38057
|
},
|
|
37973
38058
|
async run({ args }) {
|
|
37974
38059
|
const bundlePath = args.bundle;
|
|
37975
|
-
const { getProjectRoot:
|
|
38060
|
+
const { getProjectRoot: getProjectRoot43, getCleoHome: getCleoHome6, getCleoVersion } = await import("@cleocode/core");
|
|
37976
38061
|
const { BundleError, cleanupStaging, unpackBundle } = await import("@cleocode/core/store/backup-unpack.js");
|
|
37977
38062
|
const { regenerateConfigJson, regenerateProjectContextJson, regenerateProjectInfoJson } = await import("@cleocode/core/store/regenerators.js");
|
|
37978
38063
|
const { regenerateAndCompare } = await import("@cleocode/core/store/restore-json-merge.js");
|
|
37979
38064
|
const { buildConflictReport, writeConflictReport } = await import("@cleocode/core/store/restore-conflict-report.js");
|
|
37980
|
-
const projectRoot =
|
|
38065
|
+
const projectRoot = getProjectRoot43();
|
|
37981
38066
|
if (args.force !== true) {
|
|
37982
38067
|
const existing = checkForExistingData(projectRoot, getCleoHome6());
|
|
37983
38068
|
if (existing.length > 0) {
|
|
@@ -39280,6 +39365,8 @@ var changeset_exports = {};
|
|
|
39280
39365
|
__export(changeset_exports, {
|
|
39281
39366
|
changesetCommand: () => changesetCommand
|
|
39282
39367
|
});
|
|
39368
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
39369
|
+
import { join as join14 } from "node:path";
|
|
39283
39370
|
import { changesets, getProjectRoot as getProjectRoot27 } from "@cleocode/core";
|
|
39284
39371
|
function isValidKind(raw) {
|
|
39285
39372
|
return typeof raw === "string" && CHANGESET_KINDS.includes(raw);
|
|
@@ -39300,12 +39387,13 @@ function parsePrsFlag(raw) {
|
|
|
39300
39387
|
}
|
|
39301
39388
|
return numbers.length > 0 ? numbers : void 0;
|
|
39302
39389
|
}
|
|
39303
|
-
var addCommand4, changesetCommand;
|
|
39390
|
+
var addCommand4, listCommand6, changesetCommand;
|
|
39304
39391
|
var init_changeset = __esm({
|
|
39305
39392
|
"packages/cleo/src/cli/commands/changeset.ts"() {
|
|
39306
39393
|
"use strict";
|
|
39307
39394
|
init_src2();
|
|
39308
39395
|
init_dist();
|
|
39396
|
+
init_format_helpers();
|
|
39309
39397
|
init_renderers();
|
|
39310
39398
|
addCommand4 = defineCommand({
|
|
39311
39399
|
meta: {
|
|
@@ -39394,13 +39482,66 @@ var init_changeset = __esm({
|
|
|
39394
39482
|
cliOutput(result, { command: "changeset add", operation: "changeset.add" });
|
|
39395
39483
|
}
|
|
39396
39484
|
});
|
|
39485
|
+
listCommand6 = defineCommand({
|
|
39486
|
+
meta: {
|
|
39487
|
+
name: "list",
|
|
39488
|
+
description: "List every changeset entry under .changeset/*.md using the same parser the release-plan aggregator consumes. JSON envelope by default, aligned table on --human."
|
|
39489
|
+
},
|
|
39490
|
+
args: {},
|
|
39491
|
+
async run() {
|
|
39492
|
+
const projectRoot = getProjectRoot27();
|
|
39493
|
+
const dir = join14(projectRoot, ".changeset");
|
|
39494
|
+
if (!existsSync11(dir)) {
|
|
39495
|
+
const empty = { entries: [], count: 0, dir, note: "no .changeset/ dir" };
|
|
39496
|
+
if (isHumanOutput()) {
|
|
39497
|
+
humanLine("No changeset entries found (.changeset/ directory absent).");
|
|
39498
|
+
}
|
|
39499
|
+
cliOutput(empty, { command: "changeset list", operation: "changeset.list" });
|
|
39500
|
+
return;
|
|
39501
|
+
}
|
|
39502
|
+
let entries;
|
|
39503
|
+
try {
|
|
39504
|
+
entries = changesets.parseChangesetDir(dir);
|
|
39505
|
+
} catch (err) {
|
|
39506
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
39507
|
+
cliError(`Failed to parse .changeset directory: ${msg}`, 6 /* VALIDATION_ERROR */, {
|
|
39508
|
+
name: "E_VALIDATION",
|
|
39509
|
+
fix: "run `node scripts/lint-changesets.mjs` to surface every offending entry"
|
|
39510
|
+
});
|
|
39511
|
+
process.exit(6 /* VALIDATION_ERROR */);
|
|
39512
|
+
}
|
|
39513
|
+
if (isHumanOutput()) {
|
|
39514
|
+
if (entries.length === 0) {
|
|
39515
|
+
humanLine("No changeset entries found (.changeset/ has no *.md files).");
|
|
39516
|
+
} else {
|
|
39517
|
+
const rendered = dataTable(entries, [
|
|
39518
|
+
{ header: "SLUG", get: (e) => e.id, maxWidth: 40 },
|
|
39519
|
+
{ header: "KIND", get: (e) => e.kind, maxWidth: 10 },
|
|
39520
|
+
{ header: "TASKS", get: (e) => e.tasks.join(","), maxWidth: 22 },
|
|
39521
|
+
{
|
|
39522
|
+
header: "PR",
|
|
39523
|
+
get: (e) => e.prs && e.prs.length > 0 ? `#${e.prs.join(",#")}` : "-",
|
|
39524
|
+
maxWidth: 10
|
|
39525
|
+
},
|
|
39526
|
+
{ header: "SUMMARY", get: (e) => e.summary }
|
|
39527
|
+
]);
|
|
39528
|
+
humanLine(rendered);
|
|
39529
|
+
}
|
|
39530
|
+
}
|
|
39531
|
+
cliOutput(
|
|
39532
|
+
{ entries, count: entries.length, dir },
|
|
39533
|
+
{ command: "changeset list", operation: "changeset.list" }
|
|
39534
|
+
);
|
|
39535
|
+
}
|
|
39536
|
+
});
|
|
39397
39537
|
changesetCommand = defineCommand({
|
|
39398
39538
|
meta: {
|
|
39399
39539
|
name: "changeset",
|
|
39400
|
-
description: "Author task-anchored changeset entries
|
|
39540
|
+
description: "Author + list task-anchored changeset entries \u2014 dual-writes go to .changeset/*.md AND the docs SSoT blob store (Saga T9782)."
|
|
39401
39541
|
},
|
|
39402
39542
|
subCommands: {
|
|
39403
|
-
add: addCommand4
|
|
39543
|
+
add: addCommand4,
|
|
39544
|
+
list: listCommand6
|
|
39404
39545
|
},
|
|
39405
39546
|
async run({ cmd, rawArgs }) {
|
|
39406
39547
|
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
@@ -39520,10 +39661,10 @@ var init_check2 = __esm({
|
|
|
39520
39661
|
}
|
|
39521
39662
|
},
|
|
39522
39663
|
async run({ args }) {
|
|
39523
|
-
const { readFileSync:
|
|
39664
|
+
const { readFileSync: readFileSync19 } = await import("node:fs");
|
|
39524
39665
|
let chain;
|
|
39525
39666
|
try {
|
|
39526
|
-
chain = JSON.parse(
|
|
39667
|
+
chain = JSON.parse(readFileSync19(args.file, "utf8"));
|
|
39527
39668
|
} catch (err) {
|
|
39528
39669
|
const message = err instanceof Error ? err.message : String(err);
|
|
39529
39670
|
cliError(`Failed to read or parse chain file: ${message}`, 2, {
|
|
@@ -40795,7 +40936,7 @@ __export(config_exports, {
|
|
|
40795
40936
|
configCommand: () => configCommand
|
|
40796
40937
|
});
|
|
40797
40938
|
import { CleoError as CleoError2, formatError as formatError4, loadConfig as loadConfig2 } from "@cleocode/core";
|
|
40798
|
-
var PRESET_DESCRIPTIONS, getCommand2, setCommand, setPresetCommand, presetsCommand,
|
|
40939
|
+
var PRESET_DESCRIPTIONS, getCommand2, setCommand, setPresetCommand, presetsCommand, listCommand7, configCommand;
|
|
40799
40940
|
var init_config2 = __esm({
|
|
40800
40941
|
"packages/cleo/src/cli/commands/config.ts"() {
|
|
40801
40942
|
"use strict";
|
|
@@ -40887,7 +41028,7 @@ var init_config2 = __esm({
|
|
|
40887
41028
|
await dispatchFromCli("query", "admin", "config.presets", {}, { command: "config" });
|
|
40888
41029
|
}
|
|
40889
41030
|
});
|
|
40890
|
-
|
|
41031
|
+
listCommand7 = defineCommand({
|
|
40891
41032
|
meta: { name: "list", description: "Show all resolved configuration" },
|
|
40892
41033
|
async run() {
|
|
40893
41034
|
try {
|
|
@@ -40909,7 +41050,7 @@ var init_config2 = __esm({
|
|
|
40909
41050
|
set: setCommand,
|
|
40910
41051
|
"set-preset": setPresetCommand,
|
|
40911
41052
|
presets: presetsCommand,
|
|
40912
|
-
list:
|
|
41053
|
+
list: listCommand7
|
|
40913
41054
|
},
|
|
40914
41055
|
async run({ cmd, rawArgs }) {
|
|
40915
41056
|
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
@@ -41235,7 +41376,7 @@ var curator_exports = {};
|
|
|
41235
41376
|
__export(curator_exports, {
|
|
41236
41377
|
curatorCommand: () => curatorCommand
|
|
41237
41378
|
});
|
|
41238
|
-
import { join as
|
|
41379
|
+
import { join as join15 } from "node:path";
|
|
41239
41380
|
import { getCleoHome } from "@cleocode/paths";
|
|
41240
41381
|
async function loadCurator() {
|
|
41241
41382
|
return import("@cleocode/core/sentient/curator.js");
|
|
@@ -41265,7 +41406,7 @@ var init_curator = __esm({
|
|
|
41265
41406
|
try {
|
|
41266
41407
|
const { runCuratorTick } = await loadCurator();
|
|
41267
41408
|
const { readCuratorConfig } = await loadDaemon();
|
|
41268
|
-
const configPath =
|
|
41409
|
+
const configPath = join15(getCleoHome(), "config.json");
|
|
41269
41410
|
const cfg = await readCuratorConfig(configPath);
|
|
41270
41411
|
const result = await runCuratorTick({
|
|
41271
41412
|
dryRun: args["dry-run"] === true,
|
|
@@ -41306,7 +41447,7 @@ var init_curator = __esm({
|
|
|
41306
41447
|
async run() {
|
|
41307
41448
|
try {
|
|
41308
41449
|
const { readCuratorConfig, curatorCronExpression } = await loadDaemon();
|
|
41309
|
-
const configPath =
|
|
41450
|
+
const configPath = join15(getCleoHome(), "config.json");
|
|
41310
41451
|
const cfg = await readCuratorConfig(configPath);
|
|
41311
41452
|
cliOutput(
|
|
41312
41453
|
{
|
|
@@ -41380,8 +41521,8 @@ var daemon_exports = {};
|
|
|
41380
41521
|
__export(daemon_exports, {
|
|
41381
41522
|
daemonCommand: () => daemonCommand
|
|
41382
41523
|
});
|
|
41383
|
-
import { existsSync as
|
|
41384
|
-
import { join as
|
|
41524
|
+
import { existsSync as existsSync12 } from "node:fs";
|
|
41525
|
+
import { join as join16 } from "node:path";
|
|
41385
41526
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
41386
41527
|
import { getGCDaemonStatus, spawnGCDaemon, stopGCDaemon } from "@cleocode/core/gc/daemon.js";
|
|
41387
41528
|
import {
|
|
@@ -41447,9 +41588,9 @@ async function showDaemonStatus(cleoDir, projectRoot) {
|
|
|
41447
41588
|
}
|
|
41448
41589
|
function resolveDaemonInstallerScript() {
|
|
41449
41590
|
const filePath = fileURLToPath4(import.meta.url);
|
|
41450
|
-
const candidate1 =
|
|
41451
|
-
if (
|
|
41452
|
-
const candidate2 =
|
|
41591
|
+
const candidate1 = join16(filePath, "..", "..", "..", "scripts", "install-daemon-service.mjs");
|
|
41592
|
+
if (existsSync12(candidate1)) return candidate1;
|
|
41593
|
+
const candidate2 = join16(
|
|
41453
41594
|
filePath,
|
|
41454
41595
|
"..",
|
|
41455
41596
|
"..",
|
|
@@ -41521,13 +41662,13 @@ var init_daemon = __esm({
|
|
|
41521
41662
|
{
|
|
41522
41663
|
pid,
|
|
41523
41664
|
cleoDir,
|
|
41524
|
-
logs:
|
|
41665
|
+
logs: join16(cleoDir, "logs", "gc.log"),
|
|
41525
41666
|
message: `GC daemon started (PID ${pid})`
|
|
41526
41667
|
},
|
|
41527
41668
|
{
|
|
41528
41669
|
command: "daemon",
|
|
41529
41670
|
operation: "daemon.start",
|
|
41530
|
-
message: `GC daemon started (PID ${pid}) \u2014 Logs: ${
|
|
41671
|
+
message: `GC daemon started (PID ${pid}) \u2014 Logs: ${join16(cleoDir, "logs", "gc.log")}`
|
|
41531
41672
|
}
|
|
41532
41673
|
);
|
|
41533
41674
|
} catch (err) {
|
|
@@ -42156,12 +42297,12 @@ var detect_drift_exports = {};
|
|
|
42156
42297
|
__export(detect_drift_exports, {
|
|
42157
42298
|
detectDriftCommand: () => detectDriftCommand
|
|
42158
42299
|
});
|
|
42159
|
-
import { existsSync as
|
|
42160
|
-
import { dirname as dirname6, join as
|
|
42300
|
+
import { existsSync as existsSync13, readdirSync, readFileSync as readFileSync13 } from "node:fs";
|
|
42301
|
+
import { dirname as dirname6, join as join17 } from "node:path";
|
|
42161
42302
|
function findProjectRoot() {
|
|
42162
42303
|
let currentDir = process.cwd();
|
|
42163
42304
|
while (currentDir !== "/") {
|
|
42164
|
-
if (
|
|
42305
|
+
if (existsSync13(join17(currentDir, "package.json"))) {
|
|
42165
42306
|
return currentDir;
|
|
42166
42307
|
}
|
|
42167
42308
|
const parent = dirname6(currentDir);
|
|
@@ -42185,8 +42326,8 @@ var init_detect_drift = __esm({
|
|
|
42185
42326
|
},
|
|
42186
42327
|
async run() {
|
|
42187
42328
|
const projectRoot = findProjectRoot();
|
|
42188
|
-
const isCleoRepo =
|
|
42189
|
-
const cleoSrcRoot = isCleoRepo ?
|
|
42329
|
+
const isCleoRepo = existsSync13(join17(projectRoot, "packages", "cleo", "src"));
|
|
42330
|
+
const cleoSrcRoot = isCleoRepo ? join17(projectRoot, "packages", "cleo", "src") : join17(projectRoot, "src");
|
|
42190
42331
|
const safeRead = (filePath) => {
|
|
42191
42332
|
try {
|
|
42192
42333
|
return readFileSync13(filePath, "utf-8");
|
|
@@ -42200,8 +42341,8 @@ var init_detect_drift = __esm({
|
|
|
42200
42341
|
checks: [],
|
|
42201
42342
|
recommendations: []
|
|
42202
42343
|
};
|
|
42203
|
-
const injPath =
|
|
42204
|
-
if (
|
|
42344
|
+
const injPath = join17(projectRoot, CLEO_DIR_NAME, TEMPLATES_SUBDIR, CLEO_INJECTION_MD);
|
|
42345
|
+
if (existsSync13(injPath)) {
|
|
42205
42346
|
const content = safeRead(injPath);
|
|
42206
42347
|
userResult.checks.push({
|
|
42207
42348
|
name: "Agent injection",
|
|
@@ -42252,10 +42393,10 @@ var init_detect_drift = __esm({
|
|
|
42252
42393
|
}
|
|
42253
42394
|
};
|
|
42254
42395
|
try {
|
|
42255
|
-
const specPath =
|
|
42256
|
-
const registryPath =
|
|
42257
|
-
const dispatchDomainsDir =
|
|
42258
|
-
if (!
|
|
42396
|
+
const specPath = join17(projectRoot, "docs", "specs", "CLEO-OPERATION-CONSTITUTION.md");
|
|
42397
|
+
const registryPath = join17(cleoSrcRoot, "dispatch", "registry.ts");
|
|
42398
|
+
const dispatchDomainsDir = join17(cleoSrcRoot, "dispatch", "domains");
|
|
42399
|
+
if (!existsSync13(specPath)) {
|
|
42259
42400
|
addCheck("Gateway-to-spec sync", "fail", "CLEO-OPERATION-CONSTITUTION.md missing", [
|
|
42260
42401
|
{
|
|
42261
42402
|
severity: "error",
|
|
@@ -42265,7 +42406,7 @@ var init_detect_drift = __esm({
|
|
|
42265
42406
|
recommendation: "Create docs/specs/CLEO-OPERATION-CONSTITUTION.md with canonical operation definitions"
|
|
42266
42407
|
}
|
|
42267
42408
|
]);
|
|
42268
|
-
} else if (!
|
|
42409
|
+
} else if (!existsSync13(registryPath) || !existsSync13(dispatchDomainsDir)) {
|
|
42269
42410
|
addCheck("Gateway-to-spec sync", "fail", "Dispatch registry or domains missing", [
|
|
42270
42411
|
{
|
|
42271
42412
|
severity: "error",
|
|
@@ -42323,9 +42464,9 @@ var init_detect_drift = __esm({
|
|
|
42323
42464
|
]);
|
|
42324
42465
|
}
|
|
42325
42466
|
try {
|
|
42326
|
-
const cliDir =
|
|
42327
|
-
const coreDir = isCleoRepo ?
|
|
42328
|
-
if (!
|
|
42467
|
+
const cliDir = join17(cleoSrcRoot, "cli", "commands");
|
|
42468
|
+
const coreDir = isCleoRepo ? join17(projectRoot, "packages", "core", "src") : join17(projectRoot, "src", "core");
|
|
42469
|
+
if (!existsSync13(cliDir)) {
|
|
42329
42470
|
addCheck("CLI-to-core sync", "fail", "CLI commands directory missing", [
|
|
42330
42471
|
{
|
|
42331
42472
|
severity: "error",
|
|
@@ -42334,7 +42475,7 @@ var init_detect_drift = __esm({
|
|
|
42334
42475
|
recommendation: "Verify TypeScript source structure is intact"
|
|
42335
42476
|
}
|
|
42336
42477
|
]);
|
|
42337
|
-
} else if (!
|
|
42478
|
+
} else if (!existsSync13(coreDir)) {
|
|
42338
42479
|
addCheck("CLI-to-core sync", "fail", "Core directory missing", [
|
|
42339
42480
|
{
|
|
42340
42481
|
severity: "error",
|
|
@@ -42351,8 +42492,8 @@ var init_detect_drift = __esm({
|
|
|
42351
42492
|
addCheck("CLI-to-core sync", "fail", `Error: ${getErrorMessage(e)}`);
|
|
42352
42493
|
}
|
|
42353
42494
|
try {
|
|
42354
|
-
const domainsDir =
|
|
42355
|
-
if (!
|
|
42495
|
+
const domainsDir = join17(cleoSrcRoot, "dispatch", "domains");
|
|
42496
|
+
if (!existsSync13(domainsDir)) {
|
|
42356
42497
|
addCheck("Domain handler coverage", "fail", "Dispatch domains directory missing", [
|
|
42357
42498
|
{
|
|
42358
42499
|
severity: "error",
|
|
@@ -42369,8 +42510,8 @@ var init_detect_drift = __esm({
|
|
|
42369
42510
|
addCheck("Domain handler coverage", "fail", `Error: ${getErrorMessage(e)}`);
|
|
42370
42511
|
}
|
|
42371
42512
|
try {
|
|
42372
|
-
const matrixPath =
|
|
42373
|
-
if (!
|
|
42513
|
+
const matrixPath = join17(cleoSrcRoot, "dispatch", "lib", "capability-matrix.ts");
|
|
42514
|
+
if (!existsSync13(matrixPath)) {
|
|
42374
42515
|
addCheck("Capability matrix", "fail", "Capability matrix missing", [
|
|
42375
42516
|
{
|
|
42376
42517
|
severity: "error",
|
|
@@ -42386,8 +42527,8 @@ var init_detect_drift = __esm({
|
|
|
42386
42527
|
addCheck("Capability matrix", "fail", `Error: ${getErrorMessage(e)}`);
|
|
42387
42528
|
}
|
|
42388
42529
|
try {
|
|
42389
|
-
const schemaPath =
|
|
42390
|
-
if (!
|
|
42530
|
+
const schemaPath = join17(projectRoot, "src", "store", "schema.ts");
|
|
42531
|
+
if (!existsSync13(schemaPath)) {
|
|
42391
42532
|
addCheck("Schema validation", "fail", "Schema definition missing", [
|
|
42392
42533
|
{
|
|
42393
42534
|
severity: "error",
|
|
@@ -42421,10 +42562,10 @@ var init_detect_drift = __esm({
|
|
|
42421
42562
|
addCheck("Schema validation", "fail", `Error: ${getErrorMessage(e)}`);
|
|
42422
42563
|
}
|
|
42423
42564
|
try {
|
|
42424
|
-
const visionPath =
|
|
42425
|
-
const specPath =
|
|
42565
|
+
const visionPath = join17(projectRoot, "docs", "concepts", "CLEO-VISION.md");
|
|
42566
|
+
const specPath = join17(projectRoot, "docs", "specs", "CLEO-PORTABLE-PROJECT-BRAIN-SPEC.md");
|
|
42426
42567
|
const issues = [];
|
|
42427
|
-
if (!
|
|
42568
|
+
if (!existsSync13(visionPath)) {
|
|
42428
42569
|
issues.push({
|
|
42429
42570
|
severity: "error",
|
|
42430
42571
|
category: "vision",
|
|
@@ -42433,7 +42574,7 @@ var init_detect_drift = __esm({
|
|
|
42433
42574
|
recommendation: "Create docs/concepts/CLEO-VISION.md with project vision"
|
|
42434
42575
|
});
|
|
42435
42576
|
}
|
|
42436
|
-
if (!
|
|
42577
|
+
if (!existsSync13(specPath)) {
|
|
42437
42578
|
issues.push({
|
|
42438
42579
|
severity: "error",
|
|
42439
42580
|
category: "spec",
|
|
@@ -42477,8 +42618,8 @@ var init_detect_drift = __esm({
|
|
|
42477
42618
|
addCheck("Canonical identity", "fail", `Error: ${getErrorMessage(e)}`);
|
|
42478
42619
|
}
|
|
42479
42620
|
try {
|
|
42480
|
-
const injectionPath =
|
|
42481
|
-
if (!
|
|
42621
|
+
const injectionPath = join17(projectRoot, CLEO_DIR_NAME, TEMPLATES_SUBDIR, CLEO_INJECTION_MD);
|
|
42622
|
+
if (!existsSync13(injectionPath)) {
|
|
42482
42623
|
addCheck("Agent injection", "fail", "Agent injection template missing", [
|
|
42483
42624
|
{
|
|
42484
42625
|
severity: "error",
|
|
@@ -42507,8 +42648,8 @@ var init_detect_drift = __esm({
|
|
|
42507
42648
|
addCheck("Agent injection", "fail", `Error: ${getErrorMessage(e)}`);
|
|
42508
42649
|
}
|
|
42509
42650
|
try {
|
|
42510
|
-
const exitCodesPath =
|
|
42511
|
-
if (!
|
|
42651
|
+
const exitCodesPath = join17(cleoSrcRoot, "dispatch", "lib", "exit-codes.ts");
|
|
42652
|
+
if (!existsSync13(exitCodesPath)) {
|
|
42512
42653
|
addCheck("Exit codes", "fail", "Exit codes definition missing", [
|
|
42513
42654
|
{
|
|
42514
42655
|
severity: "error",
|
|
@@ -42678,10 +42819,10 @@ var init_diagnostics2 = __esm({
|
|
|
42678
42819
|
|
|
42679
42820
|
// packages/cleo/src/viewer/pidfile.ts
|
|
42680
42821
|
import { mkdir, readFile as readFile2, unlink, writeFile } from "node:fs/promises";
|
|
42681
|
-
import { dirname as dirname7, join as
|
|
42822
|
+
import { dirname as dirname7, join as join18 } from "node:path";
|
|
42682
42823
|
import { getCleoHome as getCleoHome2 } from "@cleocode/core/internal";
|
|
42683
42824
|
function viewerPidFilePath() {
|
|
42684
|
-
return
|
|
42825
|
+
return join18(getCleoHome2(), "viewer.pid");
|
|
42685
42826
|
}
|
|
42686
42827
|
async function writeViewerPidFile(record) {
|
|
42687
42828
|
const path6 = viewerPidFilePath();
|
|
@@ -42781,7 +42922,7 @@ var init_port_allocator = __esm({
|
|
|
42781
42922
|
// packages/cleo/src/viewer/server.ts
|
|
42782
42923
|
import { createReadStream } from "node:fs";
|
|
42783
42924
|
import { stat } from "node:fs/promises";
|
|
42784
|
-
import { dirname as dirname8, join as
|
|
42925
|
+
import { dirname as dirname8, join as join19, normalize, resolve as resolve5 } from "node:path";
|
|
42785
42926
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
42786
42927
|
import {
|
|
42787
42928
|
createAttachmentStore as createAttachmentStore2,
|
|
@@ -42820,7 +42961,7 @@ function inferTitle(markdown, fallback) {
|
|
|
42820
42961
|
}
|
|
42821
42962
|
async function serveStatic(res, assetsDir, relPath) {
|
|
42822
42963
|
const safeRel = normalize(relPath).replace(/^[\\/]+/, "");
|
|
42823
|
-
const absPath =
|
|
42964
|
+
const absPath = join19(assetsDir, safeRel);
|
|
42824
42965
|
const resolvedAssets = resolve5(assetsDir) + "/";
|
|
42825
42966
|
const resolvedAbs = resolve5(absPath);
|
|
42826
42967
|
if (`${resolvedAbs}/`.indexOf(resolvedAssets) !== 0 && resolvedAbs !== resolve5(assetsDir)) {
|
|
@@ -43021,12 +43162,12 @@ var init_server = __esm({
|
|
|
43021
43162
|
// packages/cleo/src/cli/commands/docs-viewer.ts
|
|
43022
43163
|
import { spawn } from "node:child_process";
|
|
43023
43164
|
import { open as fsOpen } from "node:fs/promises";
|
|
43024
|
-
import { join as
|
|
43165
|
+
import { join as join20 } from "node:path";
|
|
43025
43166
|
import { fileURLToPath as fileURLToPath6 } from "node:url";
|
|
43026
43167
|
import { getCleoHome as getCleoHome3, getProjectRoot as getProjectRoot29 } from "@cleocode/core";
|
|
43027
43168
|
function getCleoBinPath() {
|
|
43028
43169
|
const thisFile = fileURLToPath6(import.meta.url);
|
|
43029
|
-
return
|
|
43170
|
+
return join20(thisFile, "..", "..", "index.js");
|
|
43030
43171
|
}
|
|
43031
43172
|
async function waitForExit(pid, timeoutMs, intervalMs = 100) {
|
|
43032
43173
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -43055,7 +43196,7 @@ function openInBrowser(url) {
|
|
|
43055
43196
|
}
|
|
43056
43197
|
}
|
|
43057
43198
|
async function spawnDetachedServer(opts) {
|
|
43058
|
-
const logFile =
|
|
43199
|
+
const logFile = join20(getCleoHome3(), "viewer.log");
|
|
43059
43200
|
const handle = await fsOpen(logFile, "a").catch(() => null);
|
|
43060
43201
|
const stdio = handle ? ["ignore", handle.fd, handle.fd] : ["ignore", "ignore", "ignore"];
|
|
43061
43202
|
const args = [
|
|
@@ -43502,7 +43643,7 @@ __export(docs_exports, {
|
|
|
43502
43643
|
docsCommand: () => docsCommand
|
|
43503
43644
|
});
|
|
43504
43645
|
import { appendFile, mkdir as mkdir2, readdir, readFile as readFile3, writeFile as writeFile2 } from "node:fs/promises";
|
|
43505
|
-
import { dirname as dirname9, isAbsolute as isAbsolute2, join as
|
|
43646
|
+
import { dirname as dirname9, isAbsolute as isAbsolute2, join as join21, resolve as resolve6 } from "node:path";
|
|
43506
43647
|
import {
|
|
43507
43648
|
buildDocsGraph,
|
|
43508
43649
|
CleoError as CleoError3,
|
|
@@ -43526,7 +43667,7 @@ import {
|
|
|
43526
43667
|
syncFromGit
|
|
43527
43668
|
} from "@cleocode/core/internal";
|
|
43528
43669
|
async function getScriptNames(projectRoot) {
|
|
43529
|
-
const scriptsDir =
|
|
43670
|
+
const scriptsDir = join21(projectRoot, "scripts");
|
|
43530
43671
|
try {
|
|
43531
43672
|
const files = await readdir(scriptsDir);
|
|
43532
43673
|
return files.filter((f) => f.endsWith(".sh")).map((f) => f.replace(".sh", "")).sort();
|
|
@@ -43535,7 +43676,7 @@ async function getScriptNames(projectRoot) {
|
|
|
43535
43676
|
}
|
|
43536
43677
|
}
|
|
43537
43678
|
async function getIndexedCommands(projectRoot) {
|
|
43538
|
-
const indexPath =
|
|
43679
|
+
const indexPath = join21(projectRoot, "docs", "commands", "COMMANDS-INDEX.json");
|
|
43539
43680
|
const index = await readJson(indexPath);
|
|
43540
43681
|
if (!index) return [];
|
|
43541
43682
|
return index.commands.map((c) => c.name).sort();
|
|
@@ -43568,7 +43709,7 @@ async function runGapCheck(_projectRoot, filterId) {
|
|
|
43568
43709
|
const reviewFiles = files.filter((f) => f.endsWith(".md"));
|
|
43569
43710
|
for (const file of reviewFiles) {
|
|
43570
43711
|
if (filterId && !file.includes(filterId)) continue;
|
|
43571
|
-
const filePath =
|
|
43712
|
+
const filePath = join21(reviewDir, file);
|
|
43572
43713
|
const content = await readFile3(filePath, "utf-8");
|
|
43573
43714
|
const taskMatch = file.match(/^(T\d+)/);
|
|
43574
43715
|
const taskId = taskMatch ? taskMatch[1] : "UNKNOWN";
|
|
@@ -43612,7 +43753,7 @@ function loadCliRegistry(projectRoot) {
|
|
|
43612
43753
|
throw err;
|
|
43613
43754
|
}
|
|
43614
43755
|
}
|
|
43615
|
-
var addCommand5,
|
|
43756
|
+
var addCommand5, listCommand8, fetchCommand, removeCommand2, generateCommand, exportCommand4, searchCommand, mergeCommand, graphCommand, rankCommand, versionsCommand, publishCommand2, publishPrCommand, syncCommand3, statusCommand7, gapCheckCommand, importCommand2, schemaCommand, listTypesCommand, docsCommand;
|
|
43616
43757
|
var init_docs3 = __esm({
|
|
43617
43758
|
"packages/cleo/src/cli/commands/docs.ts"() {
|
|
43618
43759
|
"use strict";
|
|
@@ -43691,7 +43832,7 @@ var init_docs3 = __esm({
|
|
|
43691
43832
|
);
|
|
43692
43833
|
}
|
|
43693
43834
|
});
|
|
43694
|
-
|
|
43835
|
+
listCommand8 = defineCommand({
|
|
43695
43836
|
meta: {
|
|
43696
43837
|
name: "list",
|
|
43697
43838
|
description: "List attachments. With no scope flag, defaults to project scope and surfaces a hint to narrow with --task, --session, or --observation. --type filters across any scope (T9637/T9638). --limit <N> (default 50) and --orderBy <newest|sha|slug> (default newest) control the browsing window (T9792)."
|
|
@@ -44507,9 +44648,9 @@ var init_docs3 = __esm({
|
|
|
44507
44648
|
})}
|
|
44508
44649
|
`;
|
|
44509
44650
|
try {
|
|
44510
|
-
await mkdir2(
|
|
44651
|
+
await mkdir2(join21(projectRoot, ".cleo", "audit"), { recursive: true });
|
|
44511
44652
|
await appendFile(
|
|
44512
|
-
|
|
44653
|
+
join21(projectRoot, ".cleo", "audit", "import-force-bypass.jsonl"),
|
|
44513
44654
|
auditLine,
|
|
44514
44655
|
"utf-8"
|
|
44515
44656
|
);
|
|
@@ -44659,7 +44800,7 @@ var init_docs3 = __esm({
|
|
|
44659
44800
|
},
|
|
44660
44801
|
subCommands: {
|
|
44661
44802
|
add: addCommand5,
|
|
44662
|
-
list:
|
|
44803
|
+
list: listCommand8,
|
|
44663
44804
|
fetch: fetchCommand,
|
|
44664
44805
|
remove: removeCommand2,
|
|
44665
44806
|
generate: generateCommand,
|
|
@@ -44963,8 +45104,8 @@ __export(migrate_agents_v2_exports, {
|
|
|
44963
45104
|
walkAgentsDir: () => walkAgentsDir
|
|
44964
45105
|
});
|
|
44965
45106
|
import { createHash as createHash2 } from "node:crypto";
|
|
44966
|
-
import { appendFileSync as appendFileSync2, existsSync as
|
|
44967
|
-
import { join as
|
|
45107
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync14, mkdirSync as mkdirSync3, readdirSync as readdirSync2, readFileSync as readFileSync14 } from "node:fs";
|
|
45108
|
+
import { join as join22 } from "node:path";
|
|
44968
45109
|
import { getProjectRoot as getProjectRoot31, installAgentFromCant } from "@cleocode/core/internal";
|
|
44969
45110
|
import { openCleoDb } from "@cleocode/core/store/open-cleo-db";
|
|
44970
45111
|
function sha256Hex(bytes) {
|
|
@@ -44984,15 +45125,15 @@ function extractAgentName(source) {
|
|
|
44984
45125
|
return headerMatch[1] ?? null;
|
|
44985
45126
|
}
|
|
44986
45127
|
function appendAuditLog(projectRoot, entry) {
|
|
44987
|
-
const auditPath =
|
|
44988
|
-
const auditDir =
|
|
44989
|
-
if (!
|
|
45128
|
+
const auditPath = join22(projectRoot, AUDIT_LOG_RELATIVE);
|
|
45129
|
+
const auditDir = join22(auditPath, "..");
|
|
45130
|
+
if (!existsSync14(auditDir)) {
|
|
44990
45131
|
mkdirSync3(auditDir, { recursive: true });
|
|
44991
45132
|
}
|
|
44992
45133
|
appendFileSync2(auditPath, JSON.stringify(entry) + "\n", "utf8");
|
|
44993
45134
|
}
|
|
44994
45135
|
function walkAgentsDir(db, scanDir, projectRoot, summary, verbose) {
|
|
44995
|
-
if (!
|
|
45136
|
+
if (!existsSync14(scanDir)) return;
|
|
44996
45137
|
let files;
|
|
44997
45138
|
try {
|
|
44998
45139
|
files = readdirSync2(scanDir).filter((f) => f.endsWith(".cant"));
|
|
@@ -45003,7 +45144,7 @@ function walkAgentsDir(db, scanDir, projectRoot, summary, verbose) {
|
|
|
45003
45144
|
return;
|
|
45004
45145
|
}
|
|
45005
45146
|
for (const filename of files) {
|
|
45006
|
-
const cantPath =
|
|
45147
|
+
const cantPath = join22(scanDir, filename);
|
|
45007
45148
|
const relPath = cantPath.replace(`${projectRoot}/`, "");
|
|
45008
45149
|
let sourceBytes;
|
|
45009
45150
|
let sourceText;
|
|
@@ -45100,9 +45241,9 @@ async function runMigrateAgentsV2(projectRoot, verbose = true) {
|
|
|
45100
45241
|
const { db: _sdDb } = await openCleoDb("signaldock");
|
|
45101
45242
|
const db = _sdDb;
|
|
45102
45243
|
try {
|
|
45103
|
-
const canonicalDir =
|
|
45244
|
+
const canonicalDir = join22(projectRoot, ".cleo", "cant", "agents");
|
|
45104
45245
|
walkAgentsDir(db, canonicalDir, projectRoot, summary, verbose);
|
|
45105
|
-
const legacyDir =
|
|
45246
|
+
const legacyDir = join22(projectRoot, ".cleo", "agents");
|
|
45106
45247
|
walkAgentsDir(db, legacyDir, projectRoot, summary, verbose);
|
|
45107
45248
|
} finally {
|
|
45108
45249
|
db.close();
|
|
@@ -45110,8 +45251,8 @@ async function runMigrateAgentsV2(projectRoot, verbose = true) {
|
|
|
45110
45251
|
return summary;
|
|
45111
45252
|
}
|
|
45112
45253
|
function readMigrationConflicts(projectRoot) {
|
|
45113
|
-
const auditPath =
|
|
45114
|
-
if (!
|
|
45254
|
+
const auditPath = join22(projectRoot, AUDIT_LOG_RELATIVE);
|
|
45255
|
+
if (!existsSync14(auditPath)) return [];
|
|
45115
45256
|
let raw;
|
|
45116
45257
|
try {
|
|
45117
45258
|
raw = readFileSync14(auditPath, "utf8");
|
|
@@ -45195,7 +45336,7 @@ __export(doctor_exports, {
|
|
|
45195
45336
|
doctorCommand: () => doctorCommand2
|
|
45196
45337
|
});
|
|
45197
45338
|
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
45198
|
-
import { join as
|
|
45339
|
+
import { join as join23 } from "node:path";
|
|
45199
45340
|
import { getProjectRoot as getProjectRoot32 } from "@cleocode/core";
|
|
45200
45341
|
import {
|
|
45201
45342
|
quarantineRogueCleoDir,
|
|
@@ -45234,8 +45375,8 @@ async function scanTestFixturesInProd(projectRoot) {
|
|
|
45234
45375
|
}
|
|
45235
45376
|
async function quarantineTestFixtures(projectRoot, matches) {
|
|
45236
45377
|
if (matches.length === 0) return 0;
|
|
45237
|
-
const cleoDir =
|
|
45238
|
-
const quarantineDir =
|
|
45378
|
+
const cleoDir = join23(projectRoot, ".cleo");
|
|
45379
|
+
const quarantineDir = join23(
|
|
45239
45380
|
cleoDir,
|
|
45240
45381
|
"quarantine",
|
|
45241
45382
|
`fixture-scan-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}`
|
|
@@ -45243,7 +45384,7 @@ async function quarantineTestFixtures(projectRoot, matches) {
|
|
|
45243
45384
|
mkdirSync4(quarantineDir, { recursive: true });
|
|
45244
45385
|
const manifest = matches.map((m) => ({ ...m, quarantinedAt: (/* @__PURE__ */ new Date()).toISOString() }));
|
|
45245
45386
|
writeFileSync4(
|
|
45246
|
-
|
|
45387
|
+
join23(quarantineDir, "manifest.jsonl"),
|
|
45247
45388
|
manifest.map((m) => JSON.stringify(m)).join("\n") + "\n"
|
|
45248
45389
|
);
|
|
45249
45390
|
const { getNativeDb } = await import("@cleocode/core/store/sqlite.js");
|
|
@@ -45666,8 +45807,8 @@ var init_doctor = __esm({
|
|
|
45666
45807
|
);
|
|
45667
45808
|
return;
|
|
45668
45809
|
}
|
|
45669
|
-
const archiveDir =
|
|
45670
|
-
const auditLogPath =
|
|
45810
|
+
const archiveDir = join23(projectRoot, ".cleo", "backups");
|
|
45811
|
+
const auditLogPath = join23(projectRoot, ".cleo", "audit", "worktree-prune.jsonl");
|
|
45671
45812
|
const result = await pruneWorktreeOrphans(orphans, {
|
|
45672
45813
|
archiveDir,
|
|
45673
45814
|
auditLogPath,
|
|
@@ -45769,7 +45910,7 @@ __export(event_exports, {
|
|
|
45769
45910
|
orchestratorCommand: () => orchestratorCommand
|
|
45770
45911
|
});
|
|
45771
45912
|
import { readdir as readdir2 } from "node:fs/promises";
|
|
45772
|
-
import { join as
|
|
45913
|
+
import { join as join24 } from "node:path";
|
|
45773
45914
|
import { cwd as processCwd } from "node:process";
|
|
45774
45915
|
import { appendEvent } from "@cleocode/core/events/event-bus.js";
|
|
45775
45916
|
function resolveProjectRoot3(arg) {
|
|
@@ -45892,7 +46033,7 @@ var init_event = __esm({
|
|
|
45892
46033
|
const agentIdFilter = args.agent;
|
|
45893
46034
|
const showAll = args.all === true;
|
|
45894
46035
|
const lines = parseInt(args.lines ?? "20", 10);
|
|
45895
|
-
const eventsDir =
|
|
46036
|
+
const eventsDir = join24(projectRoot, ".cleo", "agent-events");
|
|
45896
46037
|
try {
|
|
45897
46038
|
let files = [];
|
|
45898
46039
|
try {
|
|
@@ -45929,8 +46070,8 @@ var init_event = __esm({
|
|
|
45929
46070
|
}
|
|
45930
46071
|
for (const file of filesToTail) {
|
|
45931
46072
|
const agentId = file.replace(".jsonl", "");
|
|
45932
|
-
const { readFileSync:
|
|
45933
|
-
const content =
|
|
46073
|
+
const { readFileSync: readFileSync19 } = await import("node:fs");
|
|
46074
|
+
const content = readFileSync19(join24(eventsDir, file), "utf-8");
|
|
45934
46075
|
const eventLines = content.trim().split("\n").filter(Boolean);
|
|
45935
46076
|
const tail = eventLines.slice(-lines);
|
|
45936
46077
|
if (jsonMode) {
|
|
@@ -46000,7 +46141,7 @@ var init_event = __esm({
|
|
|
46000
46141
|
const epicFilter = args.epic;
|
|
46001
46142
|
const follow = args.follow === true;
|
|
46002
46143
|
const lines = parseInt(args.lines ?? "50", 10);
|
|
46003
|
-
const eventsDir =
|
|
46144
|
+
const eventsDir = join24(projectRoot, ".cleo", "agent-events");
|
|
46004
46145
|
let files = [];
|
|
46005
46146
|
try {
|
|
46006
46147
|
const entries = await readdir2(eventsDir);
|
|
@@ -46025,8 +46166,8 @@ var init_event = __esm({
|
|
|
46025
46166
|
const printAgentLog = async (file) => {
|
|
46026
46167
|
const agentId = file.replace(".jsonl", "");
|
|
46027
46168
|
try {
|
|
46028
|
-
const { readFileSync:
|
|
46029
|
-
const content =
|
|
46169
|
+
const { readFileSync: readFileSync19 } = await import("node:fs");
|
|
46170
|
+
const content = readFileSync19(join24(eventsDir, file), "utf-8");
|
|
46030
46171
|
const eventLines = content.trim().split("\n").filter(Boolean);
|
|
46031
46172
|
const tail = eventLines.slice(-lines);
|
|
46032
46173
|
if (jsonMode) {
|
|
@@ -46319,7 +46460,7 @@ __export(federation_exports, {
|
|
|
46319
46460
|
federationCommand: () => federationCommand
|
|
46320
46461
|
});
|
|
46321
46462
|
import { skills } from "@cleocode/core";
|
|
46322
|
-
var addFederationPeer, listFederationPeers, removeFederationPeer, addCommand6, removeCommand3,
|
|
46463
|
+
var addFederationPeer, listFederationPeers, removeFederationPeer, addCommand6, removeCommand3, listCommand9, federationCommand;
|
|
46323
46464
|
var init_federation = __esm({
|
|
46324
46465
|
"packages/cleo/src/cli/commands/federation.ts"() {
|
|
46325
46466
|
"use strict";
|
|
@@ -46386,7 +46527,7 @@ var init_federation = __esm({
|
|
|
46386
46527
|
}
|
|
46387
46528
|
}
|
|
46388
46529
|
});
|
|
46389
|
-
|
|
46530
|
+
listCommand9 = defineCommand({
|
|
46390
46531
|
meta: {
|
|
46391
46532
|
name: "list",
|
|
46392
46533
|
description: "List all federation peers in ~/.cleo/federation.json"
|
|
@@ -46429,7 +46570,7 @@ var init_federation = __esm({
|
|
|
46429
46570
|
subCommands: {
|
|
46430
46571
|
add: addCommand6,
|
|
46431
46572
|
remove: removeCommand3,
|
|
46432
|
-
list:
|
|
46573
|
+
list: listCommand9
|
|
46433
46574
|
},
|
|
46434
46575
|
run({ rawArgs }) {
|
|
46435
46576
|
const sub = rawArgs?.find((a) => !a.startsWith("-"));
|
|
@@ -46529,7 +46670,7 @@ __export(gc_exports, {
|
|
|
46529
46670
|
gcCommand: () => gcCommand
|
|
46530
46671
|
});
|
|
46531
46672
|
import { homedir as homedir4, tmpdir } from "node:os";
|
|
46532
|
-
import { join as
|
|
46673
|
+
import { join as join25 } from "node:path";
|
|
46533
46674
|
import { pruneOrphanTempDirs, pruneOrphanWorktrees } from "@cleocode/core/gc/cleanup.js";
|
|
46534
46675
|
import { runGC } from "@cleocode/core/gc/runner.js";
|
|
46535
46676
|
import { readGCState } from "@cleocode/core/gc/state.js";
|
|
@@ -46612,7 +46753,7 @@ var init_gc = __esm({
|
|
|
46612
46753
|
},
|
|
46613
46754
|
async run({ args }) {
|
|
46614
46755
|
const cleoDir = resolveLegacyCleoDir3(args["cleo-dir"]);
|
|
46615
|
-
const statePath =
|
|
46756
|
+
const statePath = join25(cleoDir, "gc-state.json");
|
|
46616
46757
|
try {
|
|
46617
46758
|
const state = await readGCState(statePath);
|
|
46618
46759
|
const diskStr = state.lastDiskUsedPct !== null ? `${state.lastDiskUsedPct.toFixed(1)}%` : "unknown";
|
|
@@ -46665,8 +46806,8 @@ var init_gc = __esm({
|
|
|
46665
46806
|
}
|
|
46666
46807
|
},
|
|
46667
46808
|
async run({ args }) {
|
|
46668
|
-
const xdgData = process.env["XDG_DATA_HOME"] ??
|
|
46669
|
-
const worktreesRoot = args["worktrees-root"] ??
|
|
46809
|
+
const xdgData = process.env["XDG_DATA_HOME"] ?? join25(homedir4(), ".local", "share");
|
|
46810
|
+
const worktreesRoot = args["worktrees-root"] ?? join25(xdgData, "cleo", "worktrees");
|
|
46670
46811
|
const projectHash = args["project-hash"];
|
|
46671
46812
|
const dryRun = args["dry-run"];
|
|
46672
46813
|
const preserveRaw = args["preserve-tasks"];
|
|
@@ -46770,263 +46911,6 @@ var init_gc = __esm({
|
|
|
46770
46911
|
}
|
|
46771
46912
|
});
|
|
46772
46913
|
|
|
46773
|
-
// packages/cleo/src/cli/commands/generate-changelog.ts
|
|
46774
|
-
var generate_changelog_exports = {};
|
|
46775
|
-
__export(generate_changelog_exports, {
|
|
46776
|
-
generateChangelogCommand: () => generateChangelogCommand
|
|
46777
|
-
});
|
|
46778
|
-
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
46779
|
-
import { existsSync as existsSync14, mkdirSync as mkdirSync5, readFileSync as readFileSync15, writeFileSync as writeFileSync5 } from "node:fs";
|
|
46780
|
-
import { dirname as dirname10, join as join25 } from "node:path";
|
|
46781
|
-
import { CleoError as CleoError4, getConfigPath, getProjectRoot as getProjectRoot33, pushWarning as pushWarning2 } from "@cleocode/core";
|
|
46782
|
-
function getChangelogSource(cwd) {
|
|
46783
|
-
const configPath = getConfigPath(cwd);
|
|
46784
|
-
try {
|
|
46785
|
-
const config = JSON.parse(readFileSync15(configPath, "utf-8"));
|
|
46786
|
-
return config?.release?.changelog?.source ?? "CHANGELOG.md";
|
|
46787
|
-
} catch {
|
|
46788
|
-
return "CHANGELOG.md";
|
|
46789
|
-
}
|
|
46790
|
-
}
|
|
46791
|
-
function getEnabledPlatforms(cwd) {
|
|
46792
|
-
const configPath = getConfigPath(cwd);
|
|
46793
|
-
try {
|
|
46794
|
-
const config = JSON.parse(readFileSync15(configPath, "utf-8"));
|
|
46795
|
-
const outputs = config?.release?.changelog?.outputs ?? [];
|
|
46796
|
-
return outputs.filter((o) => o.enabled);
|
|
46797
|
-
} catch {
|
|
46798
|
-
return [];
|
|
46799
|
-
}
|
|
46800
|
-
}
|
|
46801
|
-
function getDefaultOutputPath(platform) {
|
|
46802
|
-
switch (platform) {
|
|
46803
|
-
case "mintlify":
|
|
46804
|
-
return "docs/changelog/overview.mdx";
|
|
46805
|
-
case "docusaurus":
|
|
46806
|
-
return "docs/changelog.md";
|
|
46807
|
-
default:
|
|
46808
|
-
return "CHANGELOG.md";
|
|
46809
|
-
}
|
|
46810
|
-
}
|
|
46811
|
-
function getGitHubRepoSlug(cwd) {
|
|
46812
|
-
const projectRoot = getProjectRoot33(cwd);
|
|
46813
|
-
try {
|
|
46814
|
-
const remoteUrl = execFileSync2("git", ["remote", "get-url", "origin"], {
|
|
46815
|
-
cwd: projectRoot,
|
|
46816
|
-
encoding: "utf-8",
|
|
46817
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
46818
|
-
}).trim();
|
|
46819
|
-
return remoteUrl.replace(/.*github\.com[:/]/, "").replace(/\.git$/, "");
|
|
46820
|
-
} catch {
|
|
46821
|
-
return "";
|
|
46822
|
-
}
|
|
46823
|
-
}
|
|
46824
|
-
function generateForPlatform(platform, sourceContent, repoSlug, limit) {
|
|
46825
|
-
switch (platform) {
|
|
46826
|
-
case "mintlify":
|
|
46827
|
-
return generateMintlify(sourceContent, repoSlug, limit);
|
|
46828
|
-
case "docusaurus":
|
|
46829
|
-
return generateDocusaurus(sourceContent, limit);
|
|
46830
|
-
default:
|
|
46831
|
-
return sourceContent;
|
|
46832
|
-
}
|
|
46833
|
-
}
|
|
46834
|
-
function generateMintlify(source, repoSlug, limit) {
|
|
46835
|
-
const lines = [];
|
|
46836
|
-
lines.push("---");
|
|
46837
|
-
lines.push('title: "Changelog"');
|
|
46838
|
-
lines.push('description: "CLEO release history and product updates"');
|
|
46839
|
-
lines.push('icon: "clock-rotate-left"');
|
|
46840
|
-
lines.push("rss: true");
|
|
46841
|
-
lines.push("---");
|
|
46842
|
-
lines.push("");
|
|
46843
|
-
lines.push("# Changelog");
|
|
46844
|
-
lines.push("");
|
|
46845
|
-
const sourceLines = source.split("\n");
|
|
46846
|
-
const blocks = [];
|
|
46847
|
-
let currentBlock = null;
|
|
46848
|
-
for (let i = 0; i < sourceLines.length; i++) {
|
|
46849
|
-
const line = sourceLines[i];
|
|
46850
|
-
const vMatch = line.match(/^## \[v?(\d+\.\d+\.\d+)\] - (\d{4}-\d{2}-\d{2})/);
|
|
46851
|
-
if (vMatch) {
|
|
46852
|
-
if (currentBlock) {
|
|
46853
|
-
blocks.push({
|
|
46854
|
-
version: currentBlock.version,
|
|
46855
|
-
date: currentBlock.date,
|
|
46856
|
-
content: sourceLines.slice(currentBlock.startLine + 1, i).join("\n").trim()
|
|
46857
|
-
});
|
|
46858
|
-
}
|
|
46859
|
-
currentBlock = { version: vMatch[1], date: vMatch[2], startLine: i };
|
|
46860
|
-
}
|
|
46861
|
-
}
|
|
46862
|
-
if (currentBlock) {
|
|
46863
|
-
blocks.push({
|
|
46864
|
-
version: currentBlock.version,
|
|
46865
|
-
date: currentBlock.date,
|
|
46866
|
-
content: sourceLines.slice(currentBlock.startLine + 1).join("\n").trim()
|
|
46867
|
-
});
|
|
46868
|
-
}
|
|
46869
|
-
for (const block of blocks.slice(0, limit)) {
|
|
46870
|
-
lines.push(`## v${block.version} - ${block.date}`);
|
|
46871
|
-
lines.push("");
|
|
46872
|
-
lines.push(block.content);
|
|
46873
|
-
lines.push("");
|
|
46874
|
-
if (repoSlug) {
|
|
46875
|
-
lines.push(
|
|
46876
|
-
`[View full release notes](https://github.com/${repoSlug}/releases/tag/v${block.version})`
|
|
46877
|
-
);
|
|
46878
|
-
lines.push("");
|
|
46879
|
-
}
|
|
46880
|
-
}
|
|
46881
|
-
return lines.join("\n");
|
|
46882
|
-
}
|
|
46883
|
-
function generateDocusaurus(source, limit) {
|
|
46884
|
-
const lines = [];
|
|
46885
|
-
lines.push("---");
|
|
46886
|
-
lines.push("id: changelog");
|
|
46887
|
-
lines.push("title: Changelog");
|
|
46888
|
-
lines.push("sidebar_label: Changelog");
|
|
46889
|
-
lines.push("---");
|
|
46890
|
-
lines.push("");
|
|
46891
|
-
lines.push("# Changelog");
|
|
46892
|
-
lines.push("");
|
|
46893
|
-
const sourceLines = source.split("\n");
|
|
46894
|
-
let versionCount = 0;
|
|
46895
|
-
let inUnreleased = false;
|
|
46896
|
-
for (const line of sourceLines) {
|
|
46897
|
-
if (/^## \[Unreleased\]/.test(line)) {
|
|
46898
|
-
inUnreleased = true;
|
|
46899
|
-
continue;
|
|
46900
|
-
}
|
|
46901
|
-
if (/^## \[v?\d+\.\d+\.\d+\]/.test(line)) {
|
|
46902
|
-
inUnreleased = false;
|
|
46903
|
-
versionCount++;
|
|
46904
|
-
if (versionCount > limit) break;
|
|
46905
|
-
}
|
|
46906
|
-
if (!inUnreleased && versionCount > 0) {
|
|
46907
|
-
lines.push(line);
|
|
46908
|
-
}
|
|
46909
|
-
}
|
|
46910
|
-
return lines.join("\n");
|
|
46911
|
-
}
|
|
46912
|
-
var generateChangelogCommand;
|
|
46913
|
-
var init_generate_changelog = __esm({
|
|
46914
|
-
"packages/cleo/src/cli/commands/generate-changelog.ts"() {
|
|
46915
|
-
"use strict";
|
|
46916
|
-
init_src2();
|
|
46917
|
-
init_dist();
|
|
46918
|
-
init_renderers();
|
|
46919
|
-
generateChangelogCommand = defineCommand({
|
|
46920
|
-
meta: {
|
|
46921
|
-
name: "generate-changelog",
|
|
46922
|
-
description: "Generate platform-specific changelog from CHANGELOG.md"
|
|
46923
|
-
},
|
|
46924
|
-
args: {
|
|
46925
|
-
platform: {
|
|
46926
|
-
type: "string",
|
|
46927
|
-
description: "Target platform (mintlify, docusaurus, plain, github)"
|
|
46928
|
-
},
|
|
46929
|
-
limit: {
|
|
46930
|
-
type: "string",
|
|
46931
|
-
description: "Max versions to include",
|
|
46932
|
-
default: "15"
|
|
46933
|
-
},
|
|
46934
|
-
"dry-run": {
|
|
46935
|
-
type: "boolean",
|
|
46936
|
-
description: "Show what would be generated without writing"
|
|
46937
|
-
}
|
|
46938
|
-
},
|
|
46939
|
-
async run({ args }) {
|
|
46940
|
-
try {
|
|
46941
|
-
pushWarning2({
|
|
46942
|
-
code: "W_DEPRECATED_COMMAND",
|
|
46943
|
-
message: "`cleo generate-changelog` is deprecated. Use `cleo changeset add` (T9793) + the aggregator (T9759 composer) instead.",
|
|
46944
|
-
severity: "warn",
|
|
46945
|
-
deprecated: "cleo generate-changelog",
|
|
46946
|
-
replacement: "cleo changeset add",
|
|
46947
|
-
removeBy: "v2026.6.0",
|
|
46948
|
-
context: {
|
|
46949
|
-
registryId: "generate-changelog-renderer",
|
|
46950
|
-
task: "T9795",
|
|
46951
|
-
saga: "T9787"
|
|
46952
|
-
}
|
|
46953
|
-
});
|
|
46954
|
-
const limit = Number(args.limit ?? 15);
|
|
46955
|
-
const targetPlatform = args.platform;
|
|
46956
|
-
const dryRun = args["dry-run"] === true;
|
|
46957
|
-
const sourceFile = getChangelogSource();
|
|
46958
|
-
const sourcePath = join25(getProjectRoot33(), sourceFile);
|
|
46959
|
-
if (!existsSync14(sourcePath)) {
|
|
46960
|
-
throw new CleoError4(4 /* NOT_FOUND */, `Changelog source not found: ${sourcePath}`);
|
|
46961
|
-
}
|
|
46962
|
-
const sourceContent = readFileSync15(sourcePath, "utf-8");
|
|
46963
|
-
const repoSlug = getGitHubRepoSlug();
|
|
46964
|
-
const results = [];
|
|
46965
|
-
if (targetPlatform) {
|
|
46966
|
-
const platforms = getEnabledPlatforms();
|
|
46967
|
-
const platformConfig = platforms.find((p) => p.platform === targetPlatform);
|
|
46968
|
-
const outputPath = platformConfig?.path ?? getDefaultOutputPath(targetPlatform);
|
|
46969
|
-
const content = generateForPlatform(targetPlatform, sourceContent, repoSlug, limit);
|
|
46970
|
-
if (!dryRun) {
|
|
46971
|
-
const fullPath = join25(getProjectRoot33(), outputPath);
|
|
46972
|
-
mkdirSync5(dirname10(fullPath), { recursive: true });
|
|
46973
|
-
writeFileSync5(fullPath, content, "utf-8");
|
|
46974
|
-
}
|
|
46975
|
-
results.push({ platform: targetPlatform, path: outputPath, written: !dryRun });
|
|
46976
|
-
} else {
|
|
46977
|
-
const platforms = getEnabledPlatforms();
|
|
46978
|
-
if (platforms.length === 0) {
|
|
46979
|
-
throw new CleoError4(
|
|
46980
|
-
8 /* CONFIG_ERROR */,
|
|
46981
|
-
"No changelog output platforms configured. Configure in .cleo/config.json under release.changelog.outputs"
|
|
46982
|
-
);
|
|
46983
|
-
}
|
|
46984
|
-
for (const platformConfig of platforms) {
|
|
46985
|
-
const content = generateForPlatform(
|
|
46986
|
-
platformConfig.platform,
|
|
46987
|
-
sourceContent,
|
|
46988
|
-
repoSlug,
|
|
46989
|
-
limit
|
|
46990
|
-
);
|
|
46991
|
-
if (!dryRun) {
|
|
46992
|
-
const fullPath = join25(getProjectRoot33(), platformConfig.path);
|
|
46993
|
-
mkdirSync5(dirname10(fullPath), { recursive: true });
|
|
46994
|
-
writeFileSync5(fullPath, content, "utf-8");
|
|
46995
|
-
}
|
|
46996
|
-
results.push({
|
|
46997
|
-
platform: platformConfig.platform,
|
|
46998
|
-
path: platformConfig.path,
|
|
46999
|
-
written: !dryRun
|
|
47000
|
-
});
|
|
47001
|
-
}
|
|
47002
|
-
}
|
|
47003
|
-
cliOutput(
|
|
47004
|
-
{
|
|
47005
|
-
dryRun,
|
|
47006
|
-
source: sourceFile,
|
|
47007
|
-
repoSlug: repoSlug || null,
|
|
47008
|
-
generated: results
|
|
47009
|
-
},
|
|
47010
|
-
{ command: "generate-changelog" }
|
|
47011
|
-
);
|
|
47012
|
-
} catch (err) {
|
|
47013
|
-
if (err instanceof CleoError4) {
|
|
47014
|
-
cliError(`generate-changelog failed: ${err.message}`, err.code, {
|
|
47015
|
-
name: "E_GENERATE_CHANGELOG_FAILED"
|
|
47016
|
-
});
|
|
47017
|
-
process.exit(err.code);
|
|
47018
|
-
}
|
|
47019
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
47020
|
-
cliError(`generate-changelog failed: ${message}`, 1 /* GENERAL_ERROR */, {
|
|
47021
|
-
name: "E_GENERATE_CHANGELOG_FAILED"
|
|
47022
|
-
});
|
|
47023
|
-
process.exit(1 /* GENERAL_ERROR */);
|
|
47024
|
-
}
|
|
47025
|
-
}
|
|
47026
|
-
});
|
|
47027
|
-
}
|
|
47028
|
-
});
|
|
47029
|
-
|
|
47030
46914
|
// packages/cleo/src/cli/commands/grade.ts
|
|
47031
46915
|
var grade_exports = {};
|
|
47032
46916
|
__export(grade_exports, {
|
|
@@ -48135,11 +48019,11 @@ __export(init_exports, {
|
|
|
48135
48019
|
getWorkflowTemplatesDir: () => getWorkflowTemplatesDir,
|
|
48136
48020
|
initCommand: () => initCommand2
|
|
48137
48021
|
});
|
|
48138
|
-
import { existsSync as existsSync15, readFileSync as
|
|
48139
|
-
import { dirname as
|
|
48022
|
+
import { existsSync as existsSync15, readFileSync as readFileSync15 } from "node:fs";
|
|
48023
|
+
import { dirname as dirname10, join as join26, resolve as resolve7 } from "node:path";
|
|
48140
48024
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
48141
48025
|
import {
|
|
48142
|
-
CleoError as
|
|
48026
|
+
CleoError as CleoError4,
|
|
48143
48027
|
formatError as formatError5,
|
|
48144
48028
|
initProject as initProject2,
|
|
48145
48029
|
scaffoldWorkflows
|
|
@@ -48152,7 +48036,7 @@ function getGitignoreTemplate() {
|
|
|
48152
48036
|
const monorepoTemplatePath = join26(packageRoot, "..", "..", "templates", "cleo-gitignore");
|
|
48153
48037
|
const templatePath = existsSync15(localTemplatePath) ? localTemplatePath : monorepoTemplatePath;
|
|
48154
48038
|
if (existsSync15(templatePath)) {
|
|
48155
|
-
return
|
|
48039
|
+
return readFileSync15(templatePath, "utf-8");
|
|
48156
48040
|
}
|
|
48157
48041
|
} catch {
|
|
48158
48042
|
}
|
|
@@ -48160,7 +48044,7 @@ function getGitignoreTemplate() {
|
|
|
48160
48044
|
}
|
|
48161
48045
|
function getWorkflowTemplatesDir() {
|
|
48162
48046
|
const thisFile = fileURLToPath7(import.meta.url);
|
|
48163
|
-
const packageRoot = resolve7(
|
|
48047
|
+
const packageRoot = resolve7(dirname10(thisFile), "..", "..", "..", "..");
|
|
48164
48048
|
return join26(packageRoot, "templates", "workflows");
|
|
48165
48049
|
}
|
|
48166
48050
|
var initCommand2;
|
|
@@ -48260,7 +48144,7 @@ var init_init = __esm({
|
|
|
48260
48144
|
{ command: "init" }
|
|
48261
48145
|
);
|
|
48262
48146
|
} catch (err) {
|
|
48263
|
-
if (err instanceof
|
|
48147
|
+
if (err instanceof CleoError4) {
|
|
48264
48148
|
cliError(formatError5(err), err.code, { name: "E_INTERNAL" });
|
|
48265
48149
|
process.exit(err.code);
|
|
48266
48150
|
}
|
|
@@ -48580,7 +48464,7 @@ var issue_exports = {};
|
|
|
48580
48464
|
__export(issue_exports, {
|
|
48581
48465
|
issueCommand: () => issueCommand
|
|
48582
48466
|
});
|
|
48583
|
-
import { execFileSync as
|
|
48467
|
+
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
48584
48468
|
import { addIssue, BUILD_CONFIG } from "@cleocode/core/internal";
|
|
48585
48469
|
async function handleIssueType(issueType, opts) {
|
|
48586
48470
|
let result;
|
|
@@ -48603,7 +48487,7 @@ async function handleIssueType(issueType, opts) {
|
|
|
48603
48487
|
if (opts["open"] && typeof result.url === "string" && result.url.startsWith("https://")) {
|
|
48604
48488
|
const issueNumber = result.url.match(/(\d+)$/)?.[1] ?? "unknown";
|
|
48605
48489
|
try {
|
|
48606
|
-
|
|
48490
|
+
execFileSync2("gh", ["issue", "view", issueNumber, "--repo", CLEO_REPO, "--web"], {
|
|
48607
48491
|
stdio: ["pipe", "pipe", "pipe"]
|
|
48608
48492
|
});
|
|
48609
48493
|
} catch {
|
|
@@ -48716,13 +48600,13 @@ var labels_exports = {};
|
|
|
48716
48600
|
__export(labels_exports, {
|
|
48717
48601
|
labelsCommand: () => labelsCommand
|
|
48718
48602
|
});
|
|
48719
|
-
var
|
|
48603
|
+
var listCommand10, showCommand5, statsCommand2, labelsCommand;
|
|
48720
48604
|
var init_labels = __esm({
|
|
48721
48605
|
"packages/cleo/src/cli/commands/labels.ts"() {
|
|
48722
48606
|
"use strict";
|
|
48723
48607
|
init_dist();
|
|
48724
48608
|
init_cli();
|
|
48725
|
-
|
|
48609
|
+
listCommand10 = defineCommand({
|
|
48726
48610
|
meta: { name: "list", description: "List all labels with task counts (default)" },
|
|
48727
48611
|
async run() {
|
|
48728
48612
|
await dispatchFromCli("query", "tasks", "label.list", {}, { command: "labels" });
|
|
@@ -48749,7 +48633,7 @@ var init_labels = __esm({
|
|
|
48749
48633
|
description: "List all labels with counts or show tasks with specific label"
|
|
48750
48634
|
},
|
|
48751
48635
|
subCommands: {
|
|
48752
|
-
list:
|
|
48636
|
+
list: listCommand10,
|
|
48753
48637
|
show: showCommand5,
|
|
48754
48638
|
stats: statsCommand2
|
|
48755
48639
|
},
|
|
@@ -49015,10 +48899,10 @@ var init_lifecycle2 = __esm({
|
|
|
49015
48899
|
// packages/cleo/src/cli/commands/list.ts
|
|
49016
48900
|
var list_exports = {};
|
|
49017
48901
|
__export(list_exports, {
|
|
49018
|
-
listCommand: () =>
|
|
48902
|
+
listCommand: () => listCommand11
|
|
49019
48903
|
});
|
|
49020
48904
|
import { createPage as createPage2 } from "@cleocode/core";
|
|
49021
|
-
var listArgs,
|
|
48905
|
+
var listArgs, listCommand11;
|
|
49022
48906
|
var init_list2 = __esm({
|
|
49023
48907
|
"packages/cleo/src/cli/commands/list.ts"() {
|
|
49024
48908
|
"use strict";
|
|
@@ -49034,7 +48918,7 @@ var init_list2 = __esm({
|
|
|
49034
48918
|
description: "Alias for --parent (legacy parentId compatibility)"
|
|
49035
48919
|
}
|
|
49036
48920
|
};
|
|
49037
|
-
|
|
48921
|
+
listCommand11 = defineCommand({
|
|
49038
48922
|
meta: { name: "list", description: "List tasks with optional filters" },
|
|
49039
48923
|
args: listArgs,
|
|
49040
48924
|
async run({ args }) {
|
|
@@ -49076,7 +48960,7 @@ var llm_cost_exports = {};
|
|
|
49076
48960
|
__export(llm_cost_exports, {
|
|
49077
48961
|
costCommand: () => costCommand
|
|
49078
48962
|
});
|
|
49079
|
-
import { getProjectRoot as
|
|
48963
|
+
import { getProjectRoot as getProjectRoot33 } from "@cleocode/core/internal";
|
|
49080
48964
|
import { computeCost } from "@cleocode/core/llm/usage-pricing";
|
|
49081
48965
|
function resolveSessionId(raw) {
|
|
49082
48966
|
if (raw === "current") {
|
|
@@ -49149,7 +49033,7 @@ var init_llm_cost = __esm({
|
|
|
49149
49033
|
process.exit(6);
|
|
49150
49034
|
}
|
|
49151
49035
|
const sessionId = resolveSessionId(rawSessionId);
|
|
49152
|
-
const projectRoot =
|
|
49036
|
+
const projectRoot = getProjectRoot33(process.cwd());
|
|
49153
49037
|
let breakdown;
|
|
49154
49038
|
try {
|
|
49155
49039
|
breakdown = await loadSessionCostBreakdown(projectRoot, sessionId);
|
|
@@ -49790,7 +49674,7 @@ var llm_exports = {};
|
|
|
49790
49674
|
__export(llm_exports, {
|
|
49791
49675
|
llmCommand: () => llmCommand
|
|
49792
49676
|
});
|
|
49793
|
-
import { pushWarning as
|
|
49677
|
+
import { pushWarning as pushWarning2 } from "@cleocode/core";
|
|
49794
49678
|
async function getListProviders() {
|
|
49795
49679
|
const { listProviders } = await import(
|
|
49796
49680
|
/* webpackIgnore: true */
|
|
@@ -49824,7 +49708,7 @@ function makeLlmSubcommand(opts) {
|
|
|
49824
49708
|
}
|
|
49825
49709
|
});
|
|
49826
49710
|
}
|
|
49827
|
-
var API_KEY_FLAG_DEPRECATION, addCommand7,
|
|
49711
|
+
var API_KEY_FLAG_DEPRECATION, addCommand7, listCommand12, removeCommand4, useCommand, profileCommand, testCommand, whoamiCommand, listProvidersCommand, contextEnginesListCommand, contextEnginesCommand, loginCommand, refreshCatalogCommand, llmCommand;
|
|
49828
49712
|
var init_llm3 = __esm({
|
|
49829
49713
|
"packages/cleo/src/cli/commands/llm.ts"() {
|
|
49830
49714
|
"use strict";
|
|
@@ -49921,7 +49805,7 @@ var init_llm3 = __esm({
|
|
|
49921
49805
|
apiKey = envValue;
|
|
49922
49806
|
source = "env";
|
|
49923
49807
|
} else if (typeof a["api-key"] === "string" && a["api-key"]) {
|
|
49924
|
-
|
|
49808
|
+
pushWarning2({
|
|
49925
49809
|
code: "W_DEPRECATED_FLAG",
|
|
49926
49810
|
message: API_KEY_FLAG_DEPRECATION,
|
|
49927
49811
|
deprecated: "--api-key=<value>",
|
|
@@ -49957,7 +49841,7 @@ var init_llm3 = __esm({
|
|
|
49957
49841
|
});
|
|
49958
49842
|
}
|
|
49959
49843
|
});
|
|
49960
|
-
|
|
49844
|
+
listCommand12 = makeLlmSubcommand({
|
|
49961
49845
|
name: "list",
|
|
49962
49846
|
description: "List redacted credentials from the multi-credential pool (tokens shown as last 4 chars only).",
|
|
49963
49847
|
args: {
|
|
@@ -50252,7 +50136,7 @@ var init_llm3 = __esm({
|
|
|
50252
50136
|
add: addCommand7,
|
|
50253
50137
|
"context-engines": contextEnginesCommand,
|
|
50254
50138
|
cost: costCommand,
|
|
50255
|
-
list:
|
|
50139
|
+
list: listCommand12,
|
|
50256
50140
|
login: loginCommand,
|
|
50257
50141
|
remove: removeCommand4,
|
|
50258
50142
|
stream: streamCommand,
|
|
@@ -50350,7 +50234,7 @@ async function readStdin() {
|
|
|
50350
50234
|
process.stdin.on("error", reject);
|
|
50351
50235
|
});
|
|
50352
50236
|
}
|
|
50353
|
-
var showCommand7,
|
|
50237
|
+
var showCommand7, listCommand13, findCommand4, statsCommand3, appendCommand, archiveCommand2, manifestCommand;
|
|
50354
50238
|
var init_manifest = __esm({
|
|
50355
50239
|
"packages/cleo/src/cli/commands/manifest.ts"() {
|
|
50356
50240
|
"use strict";
|
|
@@ -50380,7 +50264,7 @@ var init_manifest = __esm({
|
|
|
50380
50264
|
);
|
|
50381
50265
|
}
|
|
50382
50266
|
});
|
|
50383
|
-
|
|
50267
|
+
listCommand13 = defineCommand({
|
|
50384
50268
|
meta: {
|
|
50385
50269
|
name: "list",
|
|
50386
50270
|
description: "List manifest entries with optional filters"
|
|
@@ -50644,7 +50528,7 @@ var init_manifest = __esm({
|
|
|
50644
50528
|
},
|
|
50645
50529
|
subCommands: {
|
|
50646
50530
|
show: showCommand7,
|
|
50647
|
-
list:
|
|
50531
|
+
list: listCommand13,
|
|
50648
50532
|
find: findCommand4,
|
|
50649
50533
|
stats: statsCommand3,
|
|
50650
50534
|
append: appendCommand,
|
|
@@ -50697,10 +50581,10 @@ __export(memory_exports, {
|
|
|
50697
50581
|
memoryCommand: () => memoryCommand
|
|
50698
50582
|
});
|
|
50699
50583
|
import { createHash as createHash3 } from "node:crypto";
|
|
50700
|
-
import { existsSync as existsSync16, mkdirSync as
|
|
50584
|
+
import { existsSync as existsSync16, mkdirSync as mkdirSync5, readdirSync as readdirSync3, readFileSync as readFileSync16, writeFileSync as writeFileSync5 } from "node:fs";
|
|
50701
50585
|
import { homedir as homedir5 } from "node:os";
|
|
50702
50586
|
import { join as join27 } from "node:path";
|
|
50703
|
-
import { getProjectRoot as
|
|
50587
|
+
import { getProjectRoot as getProjectRoot34 } from "@cleocode/core";
|
|
50704
50588
|
import {
|
|
50705
50589
|
getBrainDb as getBrainDb2,
|
|
50706
50590
|
getDreamStatus,
|
|
@@ -50743,7 +50627,7 @@ ${body}`).digest("hex").slice(0, 16);
|
|
|
50743
50627
|
function loadImportHashes(stateFile) {
|
|
50744
50628
|
try {
|
|
50745
50629
|
if (!existsSync16(stateFile)) return /* @__PURE__ */ new Set();
|
|
50746
|
-
const raw =
|
|
50630
|
+
const raw = readFileSync16(stateFile, "utf-8");
|
|
50747
50631
|
const parsed = JSON.parse(raw);
|
|
50748
50632
|
return new Set(parsed.hashes);
|
|
50749
50633
|
} catch {
|
|
@@ -50752,8 +50636,8 @@ function loadImportHashes(stateFile) {
|
|
|
50752
50636
|
}
|
|
50753
50637
|
function saveImportHashes(stateFile, hashes) {
|
|
50754
50638
|
const dir = stateFile.slice(0, stateFile.lastIndexOf("/"));
|
|
50755
|
-
if (!existsSync16(dir))
|
|
50756
|
-
|
|
50639
|
+
if (!existsSync16(dir)) mkdirSync5(dir, { recursive: true });
|
|
50640
|
+
writeFileSync5(stateFile, JSON.stringify({ hashes: [...hashes] }, null, 2), "utf-8");
|
|
50757
50641
|
}
|
|
50758
50642
|
function makeMemorySubcommand(opts) {
|
|
50759
50643
|
const mergedArgs = {
|
|
@@ -51667,7 +51551,7 @@ var init_memory3 = __esm({
|
|
|
51667
51551
|
},
|
|
51668
51552
|
args: {},
|
|
51669
51553
|
async run() {
|
|
51670
|
-
const root =
|
|
51554
|
+
const root = getProjectRoot34();
|
|
51671
51555
|
try {
|
|
51672
51556
|
const result = await runConsolidation(root);
|
|
51673
51557
|
cliOutput(result, { command: "memory-consolidate", operation: "memory.consolidate" });
|
|
@@ -51691,7 +51575,7 @@ var init_memory3 = __esm({
|
|
|
51691
51575
|
}
|
|
51692
51576
|
},
|
|
51693
51577
|
async run({ args }) {
|
|
51694
|
-
const root =
|
|
51578
|
+
const root = getProjectRoot34();
|
|
51695
51579
|
if (args.status) {
|
|
51696
51580
|
try {
|
|
51697
51581
|
const status = await getDreamStatus(root);
|
|
@@ -51728,7 +51612,7 @@ var init_memory3 = __esm({
|
|
|
51728
51612
|
}
|
|
51729
51613
|
},
|
|
51730
51614
|
async run({ args }) {
|
|
51731
|
-
const root =
|
|
51615
|
+
const root = getProjectRoot34();
|
|
51732
51616
|
try {
|
|
51733
51617
|
const { runObserver, runReflector } = await import("@cleocode/core/memory");
|
|
51734
51618
|
const observerResult = await runObserver(root, args.session, {
|
|
@@ -51768,7 +51652,7 @@ var init_memory3 = __esm({
|
|
|
51768
51652
|
}
|
|
51769
51653
|
},
|
|
51770
51654
|
async run({ args }) {
|
|
51771
|
-
const root =
|
|
51655
|
+
const root = getProjectRoot34();
|
|
51772
51656
|
try {
|
|
51773
51657
|
await getBrainDb2(root);
|
|
51774
51658
|
const { totalDuplicateRows, groups } = await scanDuplicateEntries();
|
|
@@ -51814,7 +51698,7 @@ var init_memory3 = __esm({
|
|
|
51814
51698
|
async run({ args }) {
|
|
51815
51699
|
const sourceDir = args.from ?? join27(homedir5(), ".claude", "projects", "-mnt-projects-cleocode", "memory");
|
|
51816
51700
|
const isDryRun = !!args["dry-run"];
|
|
51817
|
-
const projectRoot =
|
|
51701
|
+
const projectRoot = getProjectRoot34();
|
|
51818
51702
|
const stateFile = join27(projectRoot, CLEO_DIR_NAME, MIGRATE_MEMORY_HASHES_JSON);
|
|
51819
51703
|
if (!existsSync16(sourceDir)) {
|
|
51820
51704
|
cliError(`Source directory not found: ${sourceDir}`, "E_NOT_FOUND", { name: "E_NOT_FOUND" });
|
|
@@ -51830,7 +51714,7 @@ var init_memory3 = __esm({
|
|
|
51830
51714
|
for (const filePath of files) {
|
|
51831
51715
|
const fileName = filePath.split("/").pop() ?? filePath;
|
|
51832
51716
|
try {
|
|
51833
|
-
const raw =
|
|
51717
|
+
const raw = readFileSync16(filePath, "utf-8");
|
|
51834
51718
|
if (!raw.trim()) {
|
|
51835
51719
|
stats.skipped++;
|
|
51836
51720
|
skippedEntries.push({ file: fileName, reason: "empty file" });
|
|
@@ -52027,7 +51911,7 @@ var init_memory3 = __esm({
|
|
|
52027
51911
|
},
|
|
52028
51912
|
args: {},
|
|
52029
51913
|
async run() {
|
|
52030
|
-
const root =
|
|
51914
|
+
const root = getProjectRoot34();
|
|
52031
51915
|
try {
|
|
52032
51916
|
await getBrainDb2(root);
|
|
52033
51917
|
const result = await getTierStats(root);
|
|
@@ -52070,7 +51954,7 @@ var init_memory3 = __esm({
|
|
|
52070
51954
|
}
|
|
52071
51955
|
},
|
|
52072
51956
|
async run({ args }) {
|
|
52073
|
-
const root =
|
|
51957
|
+
const root = getProjectRoot34();
|
|
52074
51958
|
const targetTier = args.to;
|
|
52075
51959
|
const reason = args.reason;
|
|
52076
51960
|
const validTiers = ["medium", "long"];
|
|
@@ -52136,7 +52020,7 @@ var init_memory3 = __esm({
|
|
|
52136
52020
|
}
|
|
52137
52021
|
},
|
|
52138
52022
|
async run({ args }) {
|
|
52139
|
-
const root =
|
|
52023
|
+
const root = getProjectRoot34();
|
|
52140
52024
|
const targetTier = args.to;
|
|
52141
52025
|
const reason = args.reason;
|
|
52142
52026
|
const validTiers = ["short", "medium"];
|
|
@@ -52604,7 +52488,7 @@ var migrate_claude_mem_exports = {};
|
|
|
52604
52488
|
__export(migrate_claude_mem_exports, {
|
|
52605
52489
|
migrateClaudeMemCommand: () => migrateClaudeMemCommand
|
|
52606
52490
|
});
|
|
52607
|
-
import { getProjectRoot as
|
|
52491
|
+
import { getProjectRoot as getProjectRoot35, migrateClaudeMem } from "@cleocode/core/internal";
|
|
52608
52492
|
import { ingestLooseAgentOutputs, ingestRcasdDirectories } from "@cleocode/core/memory";
|
|
52609
52493
|
import { getDb as getDb2 } from "@cleocode/core/store/sqlite";
|
|
52610
52494
|
var storageCommand, claudeMemCommand, manifestIngestCommand, migrateClaudeMemCommand;
|
|
@@ -52667,7 +52551,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
52667
52551
|
}
|
|
52668
52552
|
},
|
|
52669
52553
|
async run({ args }) {
|
|
52670
|
-
const root =
|
|
52554
|
+
const root = getProjectRoot35();
|
|
52671
52555
|
try {
|
|
52672
52556
|
const result = await migrateClaudeMem(root, {
|
|
52673
52557
|
sourcePath: args.source,
|
|
@@ -52716,7 +52600,7 @@ var init_migrate_claude_mem = __esm({
|
|
|
52716
52600
|
}
|
|
52717
52601
|
},
|
|
52718
52602
|
async run({ args }) {
|
|
52719
|
-
const projectRoot =
|
|
52603
|
+
const projectRoot = getProjectRoot35();
|
|
52720
52604
|
try {
|
|
52721
52605
|
const db = await getDb2(projectRoot);
|
|
52722
52606
|
const rcasdFlag = Boolean(args.rcasd);
|
|
@@ -52820,7 +52704,7 @@ __export(nexus_exports, {
|
|
|
52820
52704
|
import { appendFile as appendFile2, mkdir as mkdir3 } from "node:fs/promises";
|
|
52821
52705
|
import { homedir as homedir6 } from "node:os";
|
|
52822
52706
|
import path4 from "node:path";
|
|
52823
|
-
import { getProjectRoot as
|
|
52707
|
+
import { getProjectRoot as getProjectRoot36 } from "@cleocode/core";
|
|
52824
52708
|
import { generateGexf, getSymbolImpact } from "@cleocode/core/nexus";
|
|
52825
52709
|
async function appendDeprecationTelemetry(op, replacement) {
|
|
52826
52710
|
try {
|
|
@@ -52837,7 +52721,7 @@ function applyJsonFlag2(jsonFlag) {
|
|
|
52837
52721
|
setFormatContext({ format: "json", source: "flag", quiet: false });
|
|
52838
52722
|
}
|
|
52839
52723
|
}
|
|
52840
|
-
var initCommand3, registerCommand2, unregisterCommand,
|
|
52724
|
+
var initCommand3, registerCommand2, unregisterCommand, listCommand14, statusCommand10, showCommand8, resolveCommand2, discoverCommand2, augmentCommand2, setupCommand, searchCommand3, depsCommand3, criticalPathCommand2, blockingCommand, orphansCommand2, syncCommand5, reconcileCommand2, graphCommand3, shareStatusCommand, transferPreviewCommand, transferCommand, permissionSetCommand, permissionCommand, shareExportCommand, shareImportCommand, shareCommand, clustersCommand2, flowsCommand2, contextCommand4, impactCommand3, analyzeCommand3, projectsListCommand, projectsRegisterCommand, projectsRemoveCommand, projectsScanCommand, projectsCleanCommand, projectsCommand, refreshBridgeCommand, exportCommand6, diffCommand2, queryCommand2, routeMapCommand2, shapeCheckCommand2, fullContextCommand, taskFootprintCommand, brainAnchorsCommand, whyCommand, impactFullCommand2, conduitScanCommand, taskSymbolsCommand, searchCodeCommand2, contractsSyncCommand, contractsShowCommand, contractsLinkTasksCommand, contractsCommand, groupCommand, wikiCommand2, hotPathsCommand2, hotNodesCommand2, coldSymbolsCommand2, sigilSyncCommand, sigilListCommand, sigilCommand, topEntriesCommand, nexusCommand;
|
|
52841
52725
|
var init_nexus4 = __esm({
|
|
52842
52726
|
"packages/cleo/src/cli/commands/nexus.ts"() {
|
|
52843
52727
|
"use strict";
|
|
@@ -52903,7 +52787,7 @@ var init_nexus4 = __esm({
|
|
|
52903
52787
|
);
|
|
52904
52788
|
}
|
|
52905
52789
|
});
|
|
52906
|
-
|
|
52790
|
+
listCommand14 = defineCommand({
|
|
52907
52791
|
meta: { name: "list", description: "List all registered projects" },
|
|
52908
52792
|
async run() {
|
|
52909
52793
|
await dispatchFromCli("query", "nexus", "list", {}, { command: "nexus" });
|
|
@@ -52932,7 +52816,7 @@ var init_nexus4 = __esm({
|
|
|
52932
52816
|
async run({ args }) {
|
|
52933
52817
|
applyJsonFlag2(args.json);
|
|
52934
52818
|
const projectIdOverride = args["project-id"];
|
|
52935
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
52819
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
52936
52820
|
const startTime = Date.now();
|
|
52937
52821
|
try {
|
|
52938
52822
|
const [{ getNexusDb, nexusSchema }, { getIndexStats }] = await Promise.all([
|
|
@@ -53447,7 +53331,7 @@ var init_nexus4 = __esm({
|
|
|
53447
53331
|
applyJsonFlag2(args.json);
|
|
53448
53332
|
const startTime = Date.now();
|
|
53449
53333
|
const projectIdOverride = args["project-id"];
|
|
53450
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
53334
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
53451
53335
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
53452
53336
|
const response = await dispatchRaw("query", "nexus", "clusters", { projectId, repoPath });
|
|
53453
53337
|
const durationMs = Date.now() - startTime;
|
|
@@ -53491,7 +53375,7 @@ var init_nexus4 = __esm({
|
|
|
53491
53375
|
applyJsonFlag2(args.json);
|
|
53492
53376
|
const startTime = Date.now();
|
|
53493
53377
|
const projectIdOverride = args["project-id"];
|
|
53494
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
53378
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
53495
53379
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
53496
53380
|
const response = await dispatchRaw("query", "nexus", "flows", { projectId, repoPath });
|
|
53497
53381
|
const durationMs = Date.now() - startTime;
|
|
@@ -53534,7 +53418,7 @@ var init_nexus4 = __esm({
|
|
|
53534
53418
|
void appendDeprecationTelemetry("nexus.context", "cleo graph context");
|
|
53535
53419
|
const startTime = Date.now();
|
|
53536
53420
|
const projectIdOverride = args["project-id"];
|
|
53537
|
-
const repoPath =
|
|
53421
|
+
const repoPath = getProjectRoot36();
|
|
53538
53422
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
53539
53423
|
const limit = parseInt(args.limit, 10);
|
|
53540
53424
|
const symbolName = args.symbol;
|
|
@@ -53597,7 +53481,7 @@ var init_nexus4 = __esm({
|
|
|
53597
53481
|
const startTime = Date.now();
|
|
53598
53482
|
const whyFlag = !!args.why;
|
|
53599
53483
|
const projectIdOverride = args["project-id"];
|
|
53600
|
-
const repoPath =
|
|
53484
|
+
const repoPath = getProjectRoot36();
|
|
53601
53485
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
53602
53486
|
const maxDepth = Math.min(parseInt(args.depth, 10), 5);
|
|
53603
53487
|
const symbolName = args.symbol;
|
|
@@ -53669,7 +53553,7 @@ var init_nexus4 = __esm({
|
|
|
53669
53553
|
const projectIdOverride = args["project-id"];
|
|
53670
53554
|
const isIncremental = !!args.incremental;
|
|
53671
53555
|
const ctx = getFormatContext();
|
|
53672
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
53556
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
53673
53557
|
humanInfo(`[nexus] Analyzing: ${repoPath}${isIncremental ? " (incremental)" : ""}`);
|
|
53674
53558
|
try {
|
|
53675
53559
|
const [{ getNexusDb, nexusSchema }, { runPipeline }, { eq: eq2 }] = await Promise.all([
|
|
@@ -53821,7 +53705,7 @@ var init_nexus4 = __esm({
|
|
|
53821
53705
|
async run({ args }) {
|
|
53822
53706
|
applyJsonFlag2(args.json);
|
|
53823
53707
|
const startTime = Date.now();
|
|
53824
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
53708
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
53825
53709
|
const name = args.name;
|
|
53826
53710
|
const response = await dispatchRaw("mutate", "nexus", "projects.register", {
|
|
53827
53711
|
path: repoPath,
|
|
@@ -54179,7 +54063,7 @@ var init_nexus4 = __esm({
|
|
|
54179
54063
|
applyJsonFlag2(args.json);
|
|
54180
54064
|
const startTime = Date.now();
|
|
54181
54065
|
const projectIdOverride = args["project-id"];
|
|
54182
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
54066
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
54183
54067
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
54184
54068
|
const response = await dispatchRaw("mutate", "nexus", "refresh-bridge", {
|
|
54185
54069
|
repoPath,
|
|
@@ -54280,8 +54164,8 @@ var init_nexus4 = __esm({
|
|
|
54280
54164
|
return;
|
|
54281
54165
|
}
|
|
54282
54166
|
if (outputFile) {
|
|
54283
|
-
const { writeFileSync:
|
|
54284
|
-
|
|
54167
|
+
const { writeFileSync: writeFileSync6 } = await import("node:fs");
|
|
54168
|
+
writeFileSync6(outputFile, output2, "utf-8");
|
|
54285
54169
|
const durationMs = Date.now() - startTime;
|
|
54286
54170
|
cliOutput(
|
|
54287
54171
|
{ outputFile, nodeCount: nodes.length, edgeCount: relations.length },
|
|
@@ -54328,7 +54212,7 @@ var init_nexus4 = __esm({
|
|
|
54328
54212
|
async run({ args }) {
|
|
54329
54213
|
applyJsonFlag2(args.json);
|
|
54330
54214
|
const startTime = Date.now();
|
|
54331
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
54215
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
54332
54216
|
const projectIdOverride = args["project-id"];
|
|
54333
54217
|
const beforeRef = args.before ?? "HEAD~1";
|
|
54334
54218
|
const afterRef = args.after ?? "HEAD";
|
|
@@ -54446,7 +54330,7 @@ var init_nexus4 = __esm({
|
|
|
54446
54330
|
applyJsonFlag2(args.json);
|
|
54447
54331
|
const startTime = Date.now();
|
|
54448
54332
|
const projectIdOverride = args["project-id"];
|
|
54449
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
54333
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
54450
54334
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
54451
54335
|
const response = await dispatchRaw("query", "nexus", "route-map", { projectId });
|
|
54452
54336
|
const durationMs = Date.now() - startTime;
|
|
@@ -54502,7 +54386,7 @@ var init_nexus4 = __esm({
|
|
|
54502
54386
|
const startTime = Date.now();
|
|
54503
54387
|
const routeSymbol = args.routeSymbol;
|
|
54504
54388
|
const projectIdOverride = args["project-id"];
|
|
54505
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
54389
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
54506
54390
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
54507
54391
|
const response = await dispatchRaw("query", "nexus", "shape-check", { routeSymbol, projectId });
|
|
54508
54392
|
const durationMs = Date.now() - startTime;
|
|
@@ -54892,7 +54776,7 @@ var init_nexus4 = __esm({
|
|
|
54892
54776
|
async run({ args }) {
|
|
54893
54777
|
applyJsonFlag2(args.json);
|
|
54894
54778
|
const startTime = Date.now();
|
|
54895
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
54779
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
54896
54780
|
const projectIdOverride = args["project-id"];
|
|
54897
54781
|
const projectId = projectIdOverride ?? Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
54898
54782
|
const response = await dispatchRaw("mutate", "nexus", "contracts-sync", {
|
|
@@ -54996,7 +54880,7 @@ var init_nexus4 = __esm({
|
|
|
54996
54880
|
async run({ args }) {
|
|
54997
54881
|
applyJsonFlag2(args.json);
|
|
54998
54882
|
const startTime = Date.now();
|
|
54999
|
-
const repoPath = args.path ? path4.resolve(args.path) :
|
|
54883
|
+
const repoPath = args.path ? path4.resolve(args.path) : getProjectRoot36();
|
|
55000
54884
|
const projectId = Buffer.from(repoPath).toString("base64url").slice(0, 32);
|
|
55001
54885
|
const response = await dispatchRaw("mutate", "nexus", "contracts-link-tasks", {
|
|
55002
54886
|
projectId,
|
|
@@ -55072,7 +54956,7 @@ var init_nexus4 = __esm({
|
|
|
55072
54956
|
async run({ args }) {
|
|
55073
54957
|
applyJsonFlag2(args.json);
|
|
55074
54958
|
const startTime = Date.now();
|
|
55075
|
-
const outputDir = args.output ?? path4.join(
|
|
54959
|
+
const outputDir = args.output ?? path4.join(getProjectRoot36(), ".cleo", "wiki");
|
|
55076
54960
|
const communityFilter = args.community ?? void 0;
|
|
55077
54961
|
const isIncremental = !!args.incremental;
|
|
55078
54962
|
let loomProvider = null;
|
|
@@ -55096,11 +54980,11 @@ var init_nexus4 = __esm({
|
|
|
55096
54980
|
}
|
|
55097
54981
|
try {
|
|
55098
54982
|
const { generateNexusWikiIndex } = await import("@cleocode/core/nexus/wiki-index.js");
|
|
55099
|
-
const result = await generateNexusWikiIndex(outputDir,
|
|
54983
|
+
const result = await generateNexusWikiIndex(outputDir, getProjectRoot36(), {
|
|
55100
54984
|
communityFilter,
|
|
55101
54985
|
incremental: isIncremental,
|
|
55102
54986
|
loomProvider,
|
|
55103
|
-
projectRoot:
|
|
54987
|
+
projectRoot: getProjectRoot36()
|
|
55104
54988
|
});
|
|
55105
54989
|
const durationMs = Date.now() - startTime;
|
|
55106
54990
|
if (!result.success) {
|
|
@@ -55337,7 +55221,7 @@ var init_nexus4 = __esm({
|
|
|
55337
55221
|
init: initCommand3,
|
|
55338
55222
|
register: registerCommand2,
|
|
55339
55223
|
unregister: unregisterCommand,
|
|
55340
|
-
list:
|
|
55224
|
+
list: listCommand14,
|
|
55341
55225
|
status: statusCommand10,
|
|
55342
55226
|
show: showCommand8,
|
|
55343
55227
|
resolve: resolveCommand2,
|
|
@@ -55576,7 +55460,10 @@ var init_orchestrate3 = __esm({
|
|
|
55576
55460
|
}
|
|
55577
55461
|
});
|
|
55578
55462
|
readyCommand = defineCommand({
|
|
55579
|
-
meta: {
|
|
55463
|
+
meta: {
|
|
55464
|
+
name: "ready",
|
|
55465
|
+
description: "Get parallel-safe ready tasks. When the epic is a Saga (label='saga', ADR-073), traverses task_relations.type='groups' instead of parentId."
|
|
55466
|
+
},
|
|
55580
55467
|
args: {
|
|
55581
55468
|
epicId: {
|
|
55582
55469
|
type: "positional",
|
|
@@ -55586,6 +55473,10 @@ var init_orchestrate3 = __esm({
|
|
|
55586
55473
|
"ignore-deps-validate": {
|
|
55587
55474
|
type: "boolean",
|
|
55588
55475
|
description: "Skip dep-graph validation and proceed even if issues exist (audit-logged bypass). CLI-only \u2014 sentient mode does not support this flag."
|
|
55476
|
+
},
|
|
55477
|
+
via: {
|
|
55478
|
+
type: "string",
|
|
55479
|
+
description: "Traversal mode (gh-390/ADR-073): 'parent' walks parentId only, 'saga' walks task_relations.type='groups' only, 'both' (default) auto-detects saga-labeled epics."
|
|
55589
55480
|
}
|
|
55590
55481
|
},
|
|
55591
55482
|
async run({ args }) {
|
|
@@ -55595,7 +55486,8 @@ var init_orchestrate3 = __esm({
|
|
|
55595
55486
|
"ready",
|
|
55596
55487
|
{
|
|
55597
55488
|
epicId: args.epicId,
|
|
55598
|
-
ignoreDepsValidate: args["ignore-deps-validate"] === true
|
|
55489
|
+
ignoreDepsValidate: args["ignore-deps-validate"] === true,
|
|
55490
|
+
...args.via !== void 0 && { via: args.via }
|
|
55599
55491
|
},
|
|
55600
55492
|
{ command: "orchestrate" }
|
|
55601
55493
|
);
|
|
@@ -55621,12 +55513,19 @@ var init_orchestrate3 = __esm({
|
|
|
55621
55513
|
}
|
|
55622
55514
|
});
|
|
55623
55515
|
wavesCommand2 = defineCommand({
|
|
55624
|
-
meta: {
|
|
55516
|
+
meta: {
|
|
55517
|
+
name: "waves",
|
|
55518
|
+
description: "Compute dependency waves for an epic. When the epic is a Saga (label='saga', ADR-073), per-member wave plans are merged by index (wave N across all members \u2192 one unified wave N)."
|
|
55519
|
+
},
|
|
55625
55520
|
args: {
|
|
55626
55521
|
epicId: {
|
|
55627
55522
|
type: "positional",
|
|
55628
55523
|
description: "Epic ID to compute waves for",
|
|
55629
55524
|
required: true
|
|
55525
|
+
},
|
|
55526
|
+
via: {
|
|
55527
|
+
type: "string",
|
|
55528
|
+
description: "Traversal mode (gh-390/ADR-073): 'parent' walks parentId only, 'saga' walks task_relations.type='groups' only, 'both' (default) auto-detects saga-labeled epics."
|
|
55630
55529
|
}
|
|
55631
55530
|
},
|
|
55632
55531
|
async run({ args }) {
|
|
@@ -55634,7 +55533,10 @@ var init_orchestrate3 = __esm({
|
|
|
55634
55533
|
"query",
|
|
55635
55534
|
"orchestrate",
|
|
55636
55535
|
"waves",
|
|
55637
|
-
{
|
|
55536
|
+
{
|
|
55537
|
+
epicId: args.epicId,
|
|
55538
|
+
...args.via !== void 0 && { via: args.via }
|
|
55539
|
+
},
|
|
55638
55540
|
{ command: "orchestrate" }
|
|
55639
55541
|
);
|
|
55640
55542
|
}
|
|
@@ -56320,7 +56222,7 @@ __export(otel_exports, {
|
|
|
56320
56222
|
otelCommand: () => otelCommand
|
|
56321
56223
|
});
|
|
56322
56224
|
import {
|
|
56323
|
-
CleoError as
|
|
56225
|
+
CleoError as CleoError5,
|
|
56324
56226
|
clearOtelData,
|
|
56325
56227
|
formatError as formatError6,
|
|
56326
56228
|
getOtelSessions,
|
|
@@ -56342,7 +56244,7 @@ var init_otel = __esm({
|
|
|
56342
56244
|
const result = await getOtelStatus();
|
|
56343
56245
|
cliOutput(result, { command: "otel" });
|
|
56344
56246
|
} catch (err) {
|
|
56345
|
-
if (err instanceof
|
|
56247
|
+
if (err instanceof CleoError5) {
|
|
56346
56248
|
cliError(formatError6(err), err.code, { name: "E_INTERNAL" });
|
|
56347
56249
|
process.exit(err.code);
|
|
56348
56250
|
}
|
|
@@ -56357,7 +56259,7 @@ var init_otel = __esm({
|
|
|
56357
56259
|
const result = await getOtelSummary();
|
|
56358
56260
|
cliOutput(result, { command: "otel" });
|
|
56359
56261
|
} catch (err) {
|
|
56360
|
-
if (err instanceof
|
|
56262
|
+
if (err instanceof CleoError5) {
|
|
56361
56263
|
cliError(formatError6(err), err.code, { name: "E_INTERNAL" });
|
|
56362
56264
|
process.exit(err.code);
|
|
56363
56265
|
}
|
|
@@ -56385,7 +56287,7 @@ var init_otel = __esm({
|
|
|
56385
56287
|
});
|
|
56386
56288
|
cliOutput(result, { command: "otel" });
|
|
56387
56289
|
} catch (err) {
|
|
56388
|
-
if (err instanceof
|
|
56290
|
+
if (err instanceof CleoError5) {
|
|
56389
56291
|
cliError(formatError6(err), err.code, { name: "E_INTERNAL" });
|
|
56390
56292
|
process.exit(err.code);
|
|
56391
56293
|
}
|
|
@@ -56413,7 +56315,7 @@ var init_otel = __esm({
|
|
|
56413
56315
|
});
|
|
56414
56316
|
cliOutput(result, { command: "otel" });
|
|
56415
56317
|
} catch (err) {
|
|
56416
|
-
if (err instanceof
|
|
56318
|
+
if (err instanceof CleoError5) {
|
|
56417
56319
|
cliError(formatError6(err), err.code, { name: "E_INTERNAL" });
|
|
56418
56320
|
process.exit(err.code);
|
|
56419
56321
|
}
|
|
@@ -56441,7 +56343,7 @@ var init_otel = __esm({
|
|
|
56441
56343
|
});
|
|
56442
56344
|
cliOutput(result, { command: "otel" });
|
|
56443
56345
|
} catch (err) {
|
|
56444
|
-
if (err instanceof
|
|
56346
|
+
if (err instanceof CleoError5) {
|
|
56445
56347
|
cliError(formatError6(err), err.code, { name: "E_INTERNAL" });
|
|
56446
56348
|
process.exit(err.code);
|
|
56447
56349
|
}
|
|
@@ -56456,7 +56358,7 @@ var init_otel = __esm({
|
|
|
56456
56358
|
const result = await clearOtelData();
|
|
56457
56359
|
cliOutput(result, { command: "otel" });
|
|
56458
56360
|
} catch (err) {
|
|
56459
|
-
if (err instanceof
|
|
56361
|
+
if (err instanceof CleoError5) {
|
|
56460
56362
|
cliError(formatError6(err), err.code, { name: "E_INTERNAL" });
|
|
56461
56363
|
process.exit(err.code);
|
|
56462
56364
|
}
|
|
@@ -56491,7 +56393,7 @@ var phase_exports = {};
|
|
|
56491
56393
|
__export(phase_exports, {
|
|
56492
56394
|
phaseCommand: () => phaseCommand
|
|
56493
56395
|
});
|
|
56494
|
-
var showCommand9,
|
|
56396
|
+
var showCommand9, listCommand15, setCommand2, startCommand6, completeCommand3, advanceCommand2, renameCommand, deleteCommand2, phaseCommand;
|
|
56495
56397
|
var init_phase = __esm({
|
|
56496
56398
|
"packages/cleo/src/cli/commands/phase.ts"() {
|
|
56497
56399
|
"use strict";
|
|
@@ -56511,7 +56413,7 @@ var init_phase = __esm({
|
|
|
56511
56413
|
await dispatchFromCli("query", "pipeline", "phase.show", params, { command: "phase" });
|
|
56512
56414
|
}
|
|
56513
56415
|
});
|
|
56514
|
-
|
|
56416
|
+
listCommand15 = defineCommand({
|
|
56515
56417
|
meta: { name: "list", description: "List all phases with status" },
|
|
56516
56418
|
async run() {
|
|
56517
56419
|
await dispatchFromCli("query", "pipeline", "phase.list", {}, { command: "phase" });
|
|
@@ -56669,7 +56571,7 @@ var init_phase = __esm({
|
|
|
56669
56571
|
meta: { name: "phase", description: "Project-level phase lifecycle management" },
|
|
56670
56572
|
subCommands: {
|
|
56671
56573
|
show: showCommand9,
|
|
56672
|
-
list:
|
|
56574
|
+
list: listCommand15,
|
|
56673
56575
|
set: setCommand2,
|
|
56674
56576
|
start: startCommand6,
|
|
56675
56577
|
complete: completeCommand3,
|
|
@@ -56775,7 +56677,7 @@ var playbook_exports = {};
|
|
|
56775
56677
|
__export(playbook_exports, {
|
|
56776
56678
|
playbookCommand: () => playbookCommand
|
|
56777
56679
|
});
|
|
56778
|
-
var runCommand4, statusCommand13, resumeCommand, createCommand2,
|
|
56680
|
+
var runCommand4, statusCommand13, resumeCommand, createCommand2, listCommand16, validateCommand7, playbookCommand;
|
|
56779
56681
|
var init_playbook3 = __esm({
|
|
56780
56682
|
"packages/cleo/src/cli/commands/playbook.ts"() {
|
|
56781
56683
|
"use strict";
|
|
@@ -56896,7 +56798,7 @@ var init_playbook3 = __esm({
|
|
|
56896
56798
|
);
|
|
56897
56799
|
}
|
|
56898
56800
|
});
|
|
56899
|
-
|
|
56801
|
+
listCommand16 = defineCommand({
|
|
56900
56802
|
meta: {
|
|
56901
56803
|
name: "list",
|
|
56902
56804
|
description: "List playbook runs (optionally filter by status: active|completed|pending|failed|cancelled)"
|
|
@@ -56966,7 +56868,7 @@ var init_playbook3 = __esm({
|
|
|
56966
56868
|
run: runCommand4,
|
|
56967
56869
|
status: statusCommand13,
|
|
56968
56870
|
resume: resumeCommand,
|
|
56969
|
-
list:
|
|
56871
|
+
list: listCommand16,
|
|
56970
56872
|
create: createCommand2,
|
|
56971
56873
|
validate: validateCommand7
|
|
56972
56874
|
},
|
|
@@ -57125,14 +57027,14 @@ var provider_exports = {};
|
|
|
57125
57027
|
__export(provider_exports, {
|
|
57126
57028
|
providerCommand: () => providerCommand
|
|
57127
57029
|
});
|
|
57128
|
-
var
|
|
57030
|
+
var listCommand17, detectCommand3, injectStatusCommand, supportsCommand, hooksCommand, injectCommand2, providerCommand;
|
|
57129
57031
|
var init_provider = __esm({
|
|
57130
57032
|
"packages/cleo/src/cli/commands/provider.ts"() {
|
|
57131
57033
|
"use strict";
|
|
57132
57034
|
init_dist();
|
|
57133
57035
|
init_cli();
|
|
57134
57036
|
init_subcommand_guard();
|
|
57135
|
-
|
|
57037
|
+
listCommand17 = defineCommand({
|
|
57136
57038
|
meta: { name: "list", description: "List all registered CAAMP providers" },
|
|
57137
57039
|
args: {
|
|
57138
57040
|
limit: {
|
|
@@ -57290,7 +57192,7 @@ var init_provider = __esm({
|
|
|
57290
57192
|
description: "CAAMP provider registry: list, detect, supports, hooks, inject"
|
|
57291
57193
|
},
|
|
57292
57194
|
subCommands: {
|
|
57293
|
-
list:
|
|
57195
|
+
list: listCommand17,
|
|
57294
57196
|
detect: detectCommand3,
|
|
57295
57197
|
"inject-status": injectStatusCommand,
|
|
57296
57198
|
supports: supportsCommand,
|
|
@@ -57498,7 +57400,7 @@ var refresh_memory_exports = {};
|
|
|
57498
57400
|
__export(refresh_memory_exports, {
|
|
57499
57401
|
refreshMemoryCommand: () => refreshMemoryCommand
|
|
57500
57402
|
});
|
|
57501
|
-
import { getProjectRoot as
|
|
57403
|
+
import { getProjectRoot as getProjectRoot37 } from "@cleocode/core";
|
|
57502
57404
|
var refreshMemoryCommand;
|
|
57503
57405
|
var init_refresh_memory = __esm({
|
|
57504
57406
|
"packages/cleo/src/cli/commands/refresh-memory.ts"() {
|
|
@@ -57511,7 +57413,7 @@ var init_refresh_memory = __esm({
|
|
|
57511
57413
|
description: "Regenerate .cleo/memory-bridge.md from brain.db"
|
|
57512
57414
|
},
|
|
57513
57415
|
async run() {
|
|
57514
|
-
const projectDir =
|
|
57416
|
+
const projectDir = getProjectRoot37();
|
|
57515
57417
|
const { writeMemoryBridge } = await import("@cleocode/core/internal");
|
|
57516
57418
|
const result = await writeMemoryBridge(projectDir);
|
|
57517
57419
|
if (result.written) {
|
|
@@ -57529,7 +57431,7 @@ var relates_exports = {};
|
|
|
57529
57431
|
__export(relates_exports, {
|
|
57530
57432
|
relatesCommand: () => relatesCommand
|
|
57531
57433
|
});
|
|
57532
|
-
var suggestCommand2, addCommand8, discoverCommand3, removeCommand5,
|
|
57434
|
+
var suggestCommand2, addCommand8, discoverCommand3, removeCommand5, listCommand18, relatesCommand;
|
|
57533
57435
|
var init_relates = __esm({
|
|
57534
57436
|
"packages/cleo/src/cli/commands/relates.ts"() {
|
|
57535
57437
|
"use strict";
|
|
@@ -57647,7 +57549,7 @@ var init_relates = __esm({
|
|
|
57647
57549
|
);
|
|
57648
57550
|
}
|
|
57649
57551
|
});
|
|
57650
|
-
|
|
57552
|
+
listCommand18 = defineCommand({
|
|
57651
57553
|
meta: { name: "list", description: "Show existing relates entries for a task" },
|
|
57652
57554
|
args: {
|
|
57653
57555
|
taskId: {
|
|
@@ -57676,7 +57578,7 @@ var init_relates = __esm({
|
|
|
57676
57578
|
add: addCommand8,
|
|
57677
57579
|
remove: removeCommand5,
|
|
57678
57580
|
discover: discoverCommand3,
|
|
57679
|
-
list:
|
|
57581
|
+
list: listCommand18
|
|
57680
57582
|
},
|
|
57681
57583
|
async run({ cmd, rawArgs }) {
|
|
57682
57584
|
const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
|
|
@@ -57693,8 +57595,8 @@ __export(release_exports, {
|
|
|
57693
57595
|
SHIP_DEPRECATION_NOTICE: () => SHIP_DEPRECATION_NOTICE,
|
|
57694
57596
|
releaseCommand: () => releaseCommand
|
|
57695
57597
|
});
|
|
57696
|
-
import { pushWarning as
|
|
57697
|
-
var SHIP_DEPRECATION_NOTICE, shipCommand,
|
|
57598
|
+
import { pushWarning as pushWarning3, release as release2 } from "@cleocode/core";
|
|
57599
|
+
var SHIP_DEPRECATION_NOTICE, shipCommand, listCommand19, showCommand10, cancelCommand2, rollbackCommand, rollbackFullCommand, prStatusCommand, channelCommand, planCommand3, openCommand2, reconcileCommand4, releaseCommand;
|
|
57698
57600
|
var init_release3 = __esm({
|
|
57699
57601
|
"packages/cleo/src/cli/commands/release.ts"() {
|
|
57700
57602
|
"use strict";
|
|
@@ -57724,7 +57626,7 @@ var init_release3 = __esm({
|
|
|
57724
57626
|
}
|
|
57725
57627
|
},
|
|
57726
57628
|
async run({ args }) {
|
|
57727
|
-
|
|
57629
|
+
pushWarning3({
|
|
57728
57630
|
code: "W_DEPRECATED_COMMAND",
|
|
57729
57631
|
message: SHIP_DEPRECATION_NOTICE,
|
|
57730
57632
|
deprecated: "cleo release ship",
|
|
@@ -57755,7 +57657,7 @@ var init_release3 = __esm({
|
|
|
57755
57657
|
);
|
|
57756
57658
|
}
|
|
57757
57659
|
});
|
|
57758
|
-
|
|
57660
|
+
listCommand19 = defineCommand({
|
|
57759
57661
|
meta: { name: "list", description: "List all releases" },
|
|
57760
57662
|
async run() {
|
|
57761
57663
|
await dispatchFromCli("query", "pipeline", "release.list", {}, { command: "release" });
|
|
@@ -57802,57 +57704,6 @@ var init_release3 = __esm({
|
|
|
57802
57704
|
);
|
|
57803
57705
|
}
|
|
57804
57706
|
});
|
|
57805
|
-
changelogCommand = defineCommand({
|
|
57806
|
-
meta: {
|
|
57807
|
-
name: "changelog",
|
|
57808
|
-
description: "Generate CHANGELOG from git log since a given tag, with task/epic grouping"
|
|
57809
|
-
},
|
|
57810
|
-
args: {
|
|
57811
|
-
sinceTag: {
|
|
57812
|
-
type: "positional",
|
|
57813
|
-
description: "Git tag or ref to generate changelog from (e.g. v2026.4.75)",
|
|
57814
|
-
required: false
|
|
57815
|
-
},
|
|
57816
|
-
since: {
|
|
57817
|
-
type: "string",
|
|
57818
|
-
description: "Git tag or ref to generate changelog from (e.g. v2026.4.75). Alias for the positional argument.",
|
|
57819
|
-
required: false
|
|
57820
|
-
}
|
|
57821
|
-
},
|
|
57822
|
-
async run({ args }) {
|
|
57823
|
-
pushWarning4({
|
|
57824
|
-
code: "W_DEPRECATED_COMMAND",
|
|
57825
|
-
message: "`cleo release changelog <tag>` is deprecated. Use `cleo release plan <version> --epic <id>` (T9525) plus the T9759 LLM composer.",
|
|
57826
|
-
severity: "warn",
|
|
57827
|
-
deprecated: "cleo release changelog",
|
|
57828
|
-
replacement: "cleo release plan",
|
|
57829
|
-
removeBy: "v2026.6.0",
|
|
57830
|
-
context: {
|
|
57831
|
-
registryId: "cleo-release-changelog-verb-git-log",
|
|
57832
|
-
task: "T9795",
|
|
57833
|
-
saga: "T9787"
|
|
57834
|
-
}
|
|
57835
|
-
});
|
|
57836
|
-
const sinceTag = typeof args["sinceTag"] === "string" && args["sinceTag"].length > 0 ? args["sinceTag"] : typeof args["since"] === "string" && args["since"].length > 0 ? args["since"] : void 0;
|
|
57837
|
-
if (sinceTag === void 0) {
|
|
57838
|
-
cliError(
|
|
57839
|
-
"Missing required argument: <sinceTag> (or --since)",
|
|
57840
|
-
2,
|
|
57841
|
-
{ name: "E_MISSING_ARGUMENT", fix: "Run: cleo release changelog <tag>" },
|
|
57842
|
-
{ operation: "release.changelog.since" }
|
|
57843
|
-
);
|
|
57844
|
-
process.exit(2);
|
|
57845
|
-
return;
|
|
57846
|
-
}
|
|
57847
|
-
await dispatchFromCli(
|
|
57848
|
-
"query",
|
|
57849
|
-
"pipeline",
|
|
57850
|
-
"release.changelog.since",
|
|
57851
|
-
{ sinceTag },
|
|
57852
|
-
{ command: "release" }
|
|
57853
|
-
);
|
|
57854
|
-
}
|
|
57855
|
-
});
|
|
57856
57707
|
rollbackCommand = defineCommand({
|
|
57857
57708
|
meta: {
|
|
57858
57709
|
name: "rollback",
|
|
@@ -57960,8 +57811,13 @@ var init_release3 = __esm({
|
|
|
57960
57811
|
},
|
|
57961
57812
|
epic: {
|
|
57962
57813
|
type: "string",
|
|
57963
|
-
description: "Epic task ID
|
|
57964
|
-
required:
|
|
57814
|
+
description: "Epic task ID \u2014 children (or leaf Epic itself per ADR-073) are candidates",
|
|
57815
|
+
required: false
|
|
57816
|
+
},
|
|
57817
|
+
saga: {
|
|
57818
|
+
type: "string",
|
|
57819
|
+
description: "Saga task ID \u2014 walks task_relations type=groups to aggregate member Epics (ADR-073). Mutually exclusive with --epic. (T9838)",
|
|
57820
|
+
required: false
|
|
57965
57821
|
},
|
|
57966
57822
|
scheme: {
|
|
57967
57823
|
type: "string",
|
|
@@ -57978,6 +57834,10 @@ var init_release3 = __esm({
|
|
|
57978
57834
|
"dry-run": {
|
|
57979
57835
|
type: "boolean",
|
|
57980
57836
|
description: "Compute plan + envelope without writing the plan file or DB row"
|
|
57837
|
+
},
|
|
57838
|
+
"no-changelog": {
|
|
57839
|
+
type: "boolean",
|
|
57840
|
+
description: "Skip CHANGELOG.md auto-write (default: write/replace the ## [<version>] section). (T9838)"
|
|
57981
57841
|
}
|
|
57982
57842
|
},
|
|
57983
57843
|
async run({ args }) {
|
|
@@ -57988,10 +57848,12 @@ var init_release3 = __esm({
|
|
|
57988
57848
|
{
|
|
57989
57849
|
version: args.version,
|
|
57990
57850
|
epicId: args.epic,
|
|
57851
|
+
sagaId: args.saga,
|
|
57991
57852
|
scheme: args.scheme,
|
|
57992
57853
|
channel: args.channel,
|
|
57993
57854
|
hotfix: args.hotfix === true,
|
|
57994
|
-
dryRun: args["dry-run"] === true
|
|
57855
|
+
dryRun: args["dry-run"] === true,
|
|
57856
|
+
writeChangelog: args["no-changelog"] !== true
|
|
57995
57857
|
},
|
|
57996
57858
|
{ command: "release" }
|
|
57997
57859
|
);
|
|
@@ -58092,10 +57954,9 @@ var init_release3 = __esm({
|
|
|
58092
57954
|
reconcile: reconcileCommand4,
|
|
58093
57955
|
rollback: rollbackCommand,
|
|
58094
57956
|
// Read-only helpers — not deprecated.
|
|
58095
|
-
list:
|
|
57957
|
+
list: listCommand19,
|
|
58096
57958
|
show: showCommand10,
|
|
58097
57959
|
cancel: cancelCommand2,
|
|
58098
|
-
changelog: changelogCommand,
|
|
58099
57960
|
"pr-status": prStatusCommand,
|
|
58100
57961
|
channel: channelCommand,
|
|
58101
57962
|
"rollback-full": rollbackFullCommand,
|
|
@@ -58121,7 +57982,7 @@ __export(remote_exports, {
|
|
|
58121
57982
|
});
|
|
58122
57983
|
import {
|
|
58123
57984
|
addRemote,
|
|
58124
|
-
CleoError as
|
|
57985
|
+
CleoError as CleoError6,
|
|
58125
57986
|
getRemoteSyncStatus as getRemoteGitStatus,
|
|
58126
57987
|
listRemotes,
|
|
58127
57988
|
pull,
|
|
@@ -58159,7 +58020,7 @@ var init_remote = __esm({
|
|
|
58159
58020
|
{ command: "remote", message: `Remote '${name}' added: ${args.url}` }
|
|
58160
58021
|
);
|
|
58161
58022
|
} catch (err) {
|
|
58162
|
-
if (err instanceof
|
|
58023
|
+
if (err instanceof CleoError6) {
|
|
58163
58024
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
58164
58025
|
process.exit(err.code);
|
|
58165
58026
|
}
|
|
@@ -58188,7 +58049,7 @@ var init_remote = __esm({
|
|
|
58188
58049
|
{ command: "remote", message: `Remote '${args.name}' removed` }
|
|
58189
58050
|
);
|
|
58190
58051
|
} catch (err) {
|
|
58191
|
-
if (err instanceof
|
|
58052
|
+
if (err instanceof CleoError6) {
|
|
58192
58053
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
58193
58054
|
process.exit(err.code);
|
|
58194
58055
|
}
|
|
@@ -58213,7 +58074,7 @@ var init_remote = __esm({
|
|
|
58213
58074
|
}
|
|
58214
58075
|
);
|
|
58215
58076
|
} catch (err) {
|
|
58216
|
-
if (err instanceof
|
|
58077
|
+
if (err instanceof CleoError6) {
|
|
58217
58078
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
58218
58079
|
process.exit(err.code);
|
|
58219
58080
|
}
|
|
@@ -58253,7 +58114,7 @@ var init_remote = __esm({
|
|
|
58253
58114
|
}
|
|
58254
58115
|
cliOutput({ ...status }, { command: "remote", message });
|
|
58255
58116
|
} catch (err) {
|
|
58256
|
-
if (err instanceof
|
|
58117
|
+
if (err instanceof CleoError6) {
|
|
58257
58118
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
58258
58119
|
process.exit(err.code);
|
|
58259
58120
|
}
|
|
@@ -58317,7 +58178,7 @@ var init_remote = __esm({
|
|
|
58317
58178
|
{ command: "push", message: result.message }
|
|
58318
58179
|
);
|
|
58319
58180
|
} catch (err) {
|
|
58320
|
-
if (err instanceof
|
|
58181
|
+
if (err instanceof CleoError6) {
|
|
58321
58182
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
58322
58183
|
process.exit(err.code);
|
|
58323
58184
|
}
|
|
@@ -58360,7 +58221,7 @@ var init_remote = __esm({
|
|
|
58360
58221
|
{ command: "pull", message: result.message }
|
|
58361
58222
|
);
|
|
58362
58223
|
} catch (err) {
|
|
58363
|
-
if (err instanceof
|
|
58224
|
+
if (err instanceof CleoError6) {
|
|
58364
58225
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
58365
58226
|
process.exit(err.code);
|
|
58366
58227
|
}
|
|
@@ -58485,7 +58346,7 @@ var req_exports = {};
|
|
|
58485
58346
|
__export(req_exports, {
|
|
58486
58347
|
reqCommand: () => reqCommand
|
|
58487
58348
|
});
|
|
58488
|
-
var addCommand9,
|
|
58349
|
+
var addCommand9, listCommand20, migrateCommand, reqCommand;
|
|
58489
58350
|
var init_req = __esm({
|
|
58490
58351
|
"packages/cleo/src/cli/commands/req.ts"() {
|
|
58491
58352
|
"use strict";
|
|
@@ -58527,7 +58388,7 @@ var init_req = __esm({
|
|
|
58527
58388
|
await dispatchFromCli("mutate", "tasks", "req.add", { taskId, gate }, { command: "req add" });
|
|
58528
58389
|
}
|
|
58529
58390
|
});
|
|
58530
|
-
|
|
58391
|
+
listCommand20 = defineCommand({
|
|
58531
58392
|
meta: { name: "list", description: "List all REQ-ID-addressed acceptance gates on a task" },
|
|
58532
58393
|
args: {
|
|
58533
58394
|
"task-id": {
|
|
@@ -58570,10 +58431,13 @@ var init_req = __esm({
|
|
|
58570
58431
|
}
|
|
58571
58432
|
});
|
|
58572
58433
|
reqCommand = defineCommand({
|
|
58573
|
-
meta: {
|
|
58434
|
+
meta: {
|
|
58435
|
+
name: "req",
|
|
58436
|
+
description: "Manage REQ-ID-addressable acceptance gates on tasks (in-task gates only). For cross-task dependency edges, use `cleo update <id> --add-depends <ids>` or `cleo update <id> --add-relates <id>:blocks` (gh-394)."
|
|
58437
|
+
},
|
|
58574
58438
|
subCommands: {
|
|
58575
58439
|
add: addCommand9,
|
|
58576
|
-
list:
|
|
58440
|
+
list: listCommand20,
|
|
58577
58441
|
migrate: migrateCommand
|
|
58578
58442
|
},
|
|
58579
58443
|
async run({ cmd, rawArgs }) {
|
|
@@ -58593,7 +58457,7 @@ __export(research_exports, {
|
|
|
58593
58457
|
function generateResearchId() {
|
|
58594
58458
|
return `res_${Date.now()}`;
|
|
58595
58459
|
}
|
|
58596
|
-
var addCommand10, showCommand11,
|
|
58460
|
+
var addCommand10, showCommand11, listCommand21, pendingCommand2, linkCommand2, updateCommand, statsCommand5, linksCommand, archiveCommand3, manifestCommand2, researchCommand;
|
|
58597
58461
|
var init_research2 = __esm({
|
|
58598
58462
|
"packages/cleo/src/cli/commands/research.ts"() {
|
|
58599
58463
|
"use strict";
|
|
@@ -58675,7 +58539,7 @@ var init_research2 = __esm({
|
|
|
58675
58539
|
);
|
|
58676
58540
|
}
|
|
58677
58541
|
});
|
|
58678
|
-
|
|
58542
|
+
listCommand21 = defineCommand({
|
|
58679
58543
|
meta: { name: "list", description: "List research entries" },
|
|
58680
58544
|
args: {
|
|
58681
58545
|
task: {
|
|
@@ -58911,7 +58775,7 @@ var init_research2 = __esm({
|
|
|
58911
58775
|
subCommands: {
|
|
58912
58776
|
add: addCommand10,
|
|
58913
58777
|
show: showCommand11,
|
|
58914
|
-
list:
|
|
58778
|
+
list: listCommand21,
|
|
58915
58779
|
pending: pendingCommand2,
|
|
58916
58780
|
link: linkCommand2,
|
|
58917
58781
|
update: updateCommand,
|
|
@@ -58937,7 +58801,7 @@ __export(restore_exports, {
|
|
|
58937
58801
|
});
|
|
58938
58802
|
import fs3 from "node:fs";
|
|
58939
58803
|
import path5 from "node:path";
|
|
58940
|
-
import { CleoError as
|
|
58804
|
+
import { CleoError as CleoError7, getProjectRoot as getProjectRoot38, getTaskAccessor as getTaskAccessor3 } from "@cleocode/core";
|
|
58941
58805
|
function parseMarkdownValue(raw) {
|
|
58942
58806
|
const trimmed = raw.trim();
|
|
58943
58807
|
if (trimmed === "_(not present)_" || trimmed === "") return void 0;
|
|
@@ -59057,7 +58921,7 @@ var init_restore = __esm({
|
|
|
59057
58921
|
description: "Apply manually-resolved conflicts from .cleo/restore-conflicts.md"
|
|
59058
58922
|
},
|
|
59059
58923
|
async run() {
|
|
59060
|
-
const projectRoot =
|
|
58924
|
+
const projectRoot = getProjectRoot38();
|
|
59061
58925
|
const reportPath = path5.join(projectRoot, CLEO_DIR_NAME, RESTORE_CONFLICTS_MD);
|
|
59062
58926
|
if (!fs3.existsSync(reportPath)) {
|
|
59063
58927
|
humanLine("No pending restore conflicts. Nothing to finalize.");
|
|
@@ -59160,7 +59024,7 @@ var init_restore = __esm({
|
|
|
59160
59024
|
});
|
|
59161
59025
|
if (!response.success) {
|
|
59162
59026
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
59163
|
-
throw new
|
|
59027
|
+
throw new CleoError7(code, response.error?.message ?? "Backup restore failed");
|
|
59164
59028
|
}
|
|
59165
59029
|
const data = response.data;
|
|
59166
59030
|
if (args["dry-run"]) {
|
|
@@ -59189,7 +59053,7 @@ var init_restore = __esm({
|
|
|
59189
59053
|
{ command: "restore", operation: "admin.backup.restore" }
|
|
59190
59054
|
);
|
|
59191
59055
|
} catch (err) {
|
|
59192
|
-
if (err instanceof
|
|
59056
|
+
if (err instanceof CleoError7) {
|
|
59193
59057
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
59194
59058
|
process.exit(err.code);
|
|
59195
59059
|
}
|
|
@@ -59233,7 +59097,7 @@ var init_restore = __esm({
|
|
|
59233
59097
|
const taskId = args.taskId;
|
|
59234
59098
|
const idPattern = /^T\d{3,}$/;
|
|
59235
59099
|
if (!idPattern.test(taskId)) {
|
|
59236
|
-
throw new
|
|
59100
|
+
throw new CleoError7(2 /* INVALID_INPUT */, `Invalid task ID: ${taskId}`);
|
|
59237
59101
|
}
|
|
59238
59102
|
const accessor = await getTaskAccessor3();
|
|
59239
59103
|
const activeTask = await accessor.loadSingleTask(taskId);
|
|
@@ -59260,7 +59124,7 @@ var init_restore = __esm({
|
|
|
59260
59124
|
const response = await dispatchRaw("mutate", "tasks", "restore", { taskId });
|
|
59261
59125
|
if (!response.success) {
|
|
59262
59126
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
59263
|
-
throw new
|
|
59127
|
+
throw new CleoError7(code, response.error?.message ?? "Task restore failed");
|
|
59264
59128
|
}
|
|
59265
59129
|
const resultData = response.data;
|
|
59266
59130
|
cliOutput(
|
|
@@ -59302,7 +59166,7 @@ var init_restore = __esm({
|
|
|
59302
59166
|
});
|
|
59303
59167
|
if (!response.success) {
|
|
59304
59168
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
59305
|
-
throw new
|
|
59169
|
+
throw new CleoError7(code, response.error?.message ?? "Task restore failed");
|
|
59306
59170
|
}
|
|
59307
59171
|
const resultData = response.data;
|
|
59308
59172
|
cliOutput(
|
|
@@ -59317,7 +59181,7 @@ var init_restore = __esm({
|
|
|
59317
59181
|
);
|
|
59318
59182
|
return;
|
|
59319
59183
|
} else {
|
|
59320
|
-
throw new
|
|
59184
|
+
throw new CleoError7(
|
|
59321
59185
|
6 /* VALIDATION_ERROR */,
|
|
59322
59186
|
`Task ${taskId} is already active with status: ${activeTask.status}`
|
|
59323
59187
|
);
|
|
@@ -59349,7 +59213,7 @@ var init_restore = __esm({
|
|
|
59349
59213
|
}
|
|
59350
59214
|
}
|
|
59351
59215
|
}
|
|
59352
|
-
throw new
|
|
59216
|
+
throw new CleoError7(
|
|
59353
59217
|
4 /* NOT_FOUND */,
|
|
59354
59218
|
`Task ${taskId} not found in active tasks or archive`,
|
|
59355
59219
|
{
|
|
@@ -59367,7 +59231,7 @@ var init_restore = __esm({
|
|
|
59367
59231
|
});
|
|
59368
59232
|
if (!response.success) {
|
|
59369
59233
|
const code = ExitCode[response.error?.code] ?? 1 /* GENERAL_ERROR */;
|
|
59370
|
-
throw new
|
|
59234
|
+
throw new CleoError7(code, response.error?.message ?? "Task unarchive failed");
|
|
59371
59235
|
}
|
|
59372
59236
|
const resultData = response.data;
|
|
59373
59237
|
cliOutput(
|
|
@@ -59381,7 +59245,7 @@ var init_restore = __esm({
|
|
|
59381
59245
|
{ command: "restore", operation: "tasks.restore" }
|
|
59382
59246
|
);
|
|
59383
59247
|
} catch {
|
|
59384
|
-
throw new
|
|
59248
|
+
throw new CleoError7(
|
|
59385
59249
|
4 /* NOT_FOUND */,
|
|
59386
59250
|
`Task ${taskId} not found in active tasks or archive`,
|
|
59387
59251
|
{
|
|
@@ -59390,7 +59254,7 @@ var init_restore = __esm({
|
|
|
59390
59254
|
);
|
|
59391
59255
|
}
|
|
59392
59256
|
} catch (err) {
|
|
59393
|
-
if (err instanceof
|
|
59257
|
+
if (err instanceof CleoError7) {
|
|
59394
59258
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
59395
59259
|
process.exit(err.code);
|
|
59396
59260
|
}
|
|
@@ -59754,7 +59618,8 @@ var saga_exports = {};
|
|
|
59754
59618
|
__export(saga_exports, {
|
|
59755
59619
|
sagaCommand: () => sagaCommand
|
|
59756
59620
|
});
|
|
59757
|
-
|
|
59621
|
+
import { parseAcceptanceCriteria } from "@cleocode/core";
|
|
59622
|
+
var createCommand3, addCommand11, listCommand22, membersCommand, rollupCommand2, sagaCommand;
|
|
59758
59623
|
var init_saga = __esm({
|
|
59759
59624
|
"packages/cleo/src/cli/commands/saga.ts"() {
|
|
59760
59625
|
"use strict";
|
|
@@ -59791,7 +59656,9 @@ var init_saga = __esm({
|
|
|
59791
59656
|
{
|
|
59792
59657
|
title: args.title,
|
|
59793
59658
|
description: args.description,
|
|
59794
|
-
|
|
59659
|
+
// T9839/gh-409: route through bracket+quote-aware parser so criteria
|
|
59660
|
+
// containing `ENUM (a|b|c)` or quoted unions aren't shredded.
|
|
59661
|
+
acceptance: args.acceptance ? parseAcceptanceCriteria(args.acceptance) : void 0
|
|
59795
59662
|
},
|
|
59796
59663
|
{ command: "saga", operation: "tasks.saga.create" }
|
|
59797
59664
|
);
|
|
@@ -59824,7 +59691,7 @@ var init_saga = __esm({
|
|
|
59824
59691
|
);
|
|
59825
59692
|
}
|
|
59826
59693
|
});
|
|
59827
|
-
|
|
59694
|
+
listCommand22 = defineCommand({
|
|
59828
59695
|
meta: {
|
|
59829
59696
|
name: "list",
|
|
59830
59697
|
description: "List all Sagas (labeled top-level Epics)"
|
|
@@ -59883,7 +59750,7 @@ var init_saga = __esm({
|
|
|
59883
59750
|
subCommands: {
|
|
59884
59751
|
create: createCommand3,
|
|
59885
59752
|
add: addCommand11,
|
|
59886
|
-
list:
|
|
59753
|
+
list: listCommand22,
|
|
59887
59754
|
members: membersCommand,
|
|
59888
59755
|
rollup: rollupCommand2
|
|
59889
59756
|
},
|
|
@@ -60000,7 +59867,7 @@ import * as readline2 from "node:readline";
|
|
|
60000
59867
|
import { promisify } from "node:util";
|
|
60001
59868
|
import {
|
|
60002
59869
|
BUILD_CONFIG as BUILD_CONFIG2,
|
|
60003
|
-
CleoError as
|
|
59870
|
+
CleoError as CleoError8,
|
|
60004
59871
|
checkAllRegisteredProjects as checkAllRegisteredProjects2,
|
|
60005
59872
|
checkStorageMigration,
|
|
60006
59873
|
getCleoHome as getCleoHome4,
|
|
@@ -60335,7 +60202,7 @@ var init_self_update = __esm({
|
|
|
60335
60202
|
const currentVersion = isDev ? await getCurrentVersion() : await getNpmInstalledVersion() ?? await getCurrentVersion();
|
|
60336
60203
|
const rawChannel = args.channel?.toLowerCase();
|
|
60337
60204
|
if (rawChannel && rawChannel !== "stable" && rawChannel !== "beta") {
|
|
60338
|
-
throw new
|
|
60205
|
+
throw new CleoError8(
|
|
60339
60206
|
6 /* VALIDATION_ERROR */,
|
|
60340
60207
|
`Invalid --channel '${rawChannel}'. Expected stable|beta`
|
|
60341
60208
|
);
|
|
@@ -60377,7 +60244,7 @@ var init_self_update = __esm({
|
|
|
60377
60244
|
progress.step(2, "Querying npm registry");
|
|
60378
60245
|
const latest2 = await getDistTagVersion(requestedChannel === "beta" ? "beta" : "latest");
|
|
60379
60246
|
if (!latest2) {
|
|
60380
|
-
throw new
|
|
60247
|
+
throw new CleoError8(
|
|
60381
60248
|
5 /* DEPENDENCY_ERROR */,
|
|
60382
60249
|
"Failed to check latest version from GitHub"
|
|
60383
60250
|
);
|
|
@@ -60407,7 +60274,7 @@ var init_self_update = __esm({
|
|
|
60407
60274
|
progress.step(2, "Querying npm registry");
|
|
60408
60275
|
const latest = args.version ?? await getDistTagVersion(requestedChannel === "beta" ? "beta" : "latest");
|
|
60409
60276
|
if (!latest) {
|
|
60410
|
-
throw new
|
|
60277
|
+
throw new CleoError8(
|
|
60411
60278
|
5 /* DEPENDENCY_ERROR */,
|
|
60412
60279
|
"Failed to check latest version from GitHub"
|
|
60413
60280
|
);
|
|
@@ -60452,7 +60319,7 @@ var init_self_update = __esm({
|
|
|
60452
60319
|
});
|
|
60453
60320
|
progress.complete(`Updated to ${latest}`);
|
|
60454
60321
|
} catch (err) {
|
|
60455
|
-
if (err instanceof
|
|
60322
|
+
if (err instanceof CleoError8) {
|
|
60456
60323
|
progress.error(err.message);
|
|
60457
60324
|
cliError(
|
|
60458
60325
|
err.message,
|
|
@@ -61460,7 +61327,7 @@ var sequence_exports = {};
|
|
|
61460
61327
|
__export(sequence_exports, {
|
|
61461
61328
|
sequenceCommand: () => sequenceCommand
|
|
61462
61329
|
});
|
|
61463
|
-
import { getProjectRoot as
|
|
61330
|
+
import { getProjectRoot as getProjectRoot39 } from "@cleocode/core/internal";
|
|
61464
61331
|
var showCommand12, checkCommand6, repairCommand, sequenceCommand;
|
|
61465
61332
|
var init_sequence = __esm({
|
|
61466
61333
|
"packages/cleo/src/cli/commands/sequence.ts"() {
|
|
@@ -61496,7 +61363,7 @@ var init_sequence = __esm({
|
|
|
61496
61363
|
meta: { name: "repair", description: "Reset counter to max + 1 if behind" },
|
|
61497
61364
|
async run() {
|
|
61498
61365
|
const { repairSequence } = await import("@cleocode/core/internal");
|
|
61499
|
-
const projectRoot =
|
|
61366
|
+
const projectRoot = getProjectRoot39();
|
|
61500
61367
|
const repair = await repairSequence(projectRoot);
|
|
61501
61368
|
const result = {
|
|
61502
61369
|
repaired: repair.repaired,
|
|
@@ -61585,7 +61452,7 @@ async function promptOwnerAuthPassword(sessionName) {
|
|
|
61585
61452
|
const token = deriveOwnerAuthToken(sessionName, password);
|
|
61586
61453
|
return token;
|
|
61587
61454
|
}
|
|
61588
|
-
var startCommand7, endCommand, handoffCommand2, statusCommand14, resumeCommand2, findCommand6,
|
|
61455
|
+
var startCommand7, endCommand, handoffCommand2, statusCommand14, resumeCommand2, findCommand6, listCommand23, gcCommand2, showCommand13, driftCommand, contextDriftCommand, suspendCommand, recordAssumptionCommand, recordDecisionCommand, decisionLogCommand, lintCommand, sessionCommand;
|
|
61589
61456
|
var init_session4 = __esm({
|
|
61590
61457
|
"packages/cleo/src/cli/commands/session.ts"() {
|
|
61591
61458
|
"use strict";
|
|
@@ -61851,7 +61718,7 @@ var init_session4 = __esm({
|
|
|
61851
61718
|
);
|
|
61852
61719
|
}
|
|
61853
61720
|
});
|
|
61854
|
-
|
|
61721
|
+
listCommand23 = defineCommand({
|
|
61855
61722
|
meta: { name: "list", description: "List sessions" },
|
|
61856
61723
|
args: {
|
|
61857
61724
|
status: {
|
|
@@ -61939,8 +61806,8 @@ var init_session4 = __esm({
|
|
|
61939
61806
|
"audit-scope": { type: "string", description: "Audit log scope (global|local)" }
|
|
61940
61807
|
},
|
|
61941
61808
|
async run({ args }) {
|
|
61942
|
-
const { detectSessionDrift, getProjectRoot:
|
|
61943
|
-
const projectRoot = await
|
|
61809
|
+
const { detectSessionDrift, getProjectRoot: getProjectRoot43 } = await import("@cleocode/core");
|
|
61810
|
+
const projectRoot = await getProjectRoot43();
|
|
61944
61811
|
const scope = args["audit-scope"] === "local" ? "local" : "global";
|
|
61945
61812
|
const report = await detectSessionDrift({ projectRoot, auditScope: scope });
|
|
61946
61813
|
cliOutput(report, { command: "session drift", operation: "session.drift" });
|
|
@@ -62138,7 +62005,7 @@ var init_session4 = __esm({
|
|
|
62138
62005
|
status: statusCommand14,
|
|
62139
62006
|
resume: resumeCommand2,
|
|
62140
62007
|
find: findCommand6,
|
|
62141
|
-
list:
|
|
62008
|
+
list: listCommand23,
|
|
62142
62009
|
gc: gcCommand2,
|
|
62143
62010
|
show: showCommand13,
|
|
62144
62011
|
"context-drift": contextDriftCommand,
|
|
@@ -62862,7 +62729,7 @@ function buildSkillsDoctorAdoptAdapters() {
|
|
|
62862
62729
|
}
|
|
62863
62730
|
};
|
|
62864
62731
|
}
|
|
62865
|
-
var
|
|
62732
|
+
var listCommand24, searchCommand4, findCommand7, validateCommand8, infoCommand, installCommand3, uninstallCommand2, enableCommand2, disableCommand2, refreshCommand, dispatchCommand, catalogCommand, precedenceCommand, depsCommand4, doctorBridgeCommand, doctorAdoptOrphansCommand, statsCommand6, importHermesCommand, migrateCommand2, pruneTelemetryCommand, spawnProvidersCommand, doctorDiagnoseCommand, doctorCommand4, proposePatchCommand, skillsCommand2;
|
|
62866
62733
|
var init_skills2 = __esm({
|
|
62867
62734
|
"packages/cleo/src/cli/commands/skills.ts"() {
|
|
62868
62735
|
"use strict";
|
|
@@ -62870,7 +62737,7 @@ var init_skills2 = __esm({
|
|
|
62870
62737
|
init_cli();
|
|
62871
62738
|
init_subcommand_guard();
|
|
62872
62739
|
init_renderers();
|
|
62873
|
-
|
|
62740
|
+
listCommand24 = defineCommand({
|
|
62874
62741
|
meta: { name: "list", description: "List installed skills" },
|
|
62875
62742
|
args: {
|
|
62876
62743
|
global: {
|
|
@@ -63603,7 +63470,7 @@ var init_skills2 = __esm({
|
|
|
63603
63470
|
skillsCommand2 = defineCommand({
|
|
63604
63471
|
meta: { name: "skills", description: "Skill management: list, search, validate, info, install" },
|
|
63605
63472
|
subCommands: {
|
|
63606
|
-
list:
|
|
63473
|
+
list: listCommand24,
|
|
63607
63474
|
search: searchCommand4,
|
|
63608
63475
|
find: findCommand7,
|
|
63609
63476
|
validate: validateCommand8,
|
|
@@ -63981,8 +63848,8 @@ var sticky_exports = {};
|
|
|
63981
63848
|
__export(sticky_exports, {
|
|
63982
63849
|
stickyCommand: () => stickyCommand
|
|
63983
63850
|
});
|
|
63984
|
-
import { CleoError as
|
|
63985
|
-
var addCommand12,
|
|
63851
|
+
import { CleoError as CleoError9 } from "@cleocode/core";
|
|
63852
|
+
var addCommand12, listCommand25, showCommand15, convertCommand, archiveCommand4, purgeCommand2, stickyCommand;
|
|
63986
63853
|
var init_sticky3 = __esm({
|
|
63987
63854
|
"packages/cleo/src/cli/commands/sticky.ts"() {
|
|
63988
63855
|
"use strict";
|
|
@@ -64030,7 +63897,7 @@ var init_sticky3 = __esm({
|
|
|
64030
63897
|
{ command: "sticky", operation: "sticky.add" }
|
|
64031
63898
|
);
|
|
64032
63899
|
} catch (err) {
|
|
64033
|
-
if (err instanceof
|
|
63900
|
+
if (err instanceof CleoError9) {
|
|
64034
63901
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
64035
63902
|
process.exit(err.code);
|
|
64036
63903
|
}
|
|
@@ -64038,7 +63905,7 @@ var init_sticky3 = __esm({
|
|
|
64038
63905
|
}
|
|
64039
63906
|
}
|
|
64040
63907
|
});
|
|
64041
|
-
|
|
63908
|
+
listCommand25 = defineCommand({
|
|
64042
63909
|
meta: { name: "list", description: "List active sticky notes" },
|
|
64043
63910
|
args: {
|
|
64044
63911
|
tag: {
|
|
@@ -64085,7 +63952,7 @@ var init_sticky3 = __esm({
|
|
|
64085
63952
|
}
|
|
64086
63953
|
cliOutput(data, { command: "sticky list", operation: "sticky.list", page: response.page });
|
|
64087
63954
|
} catch (err) {
|
|
64088
|
-
if (err instanceof
|
|
63955
|
+
if (err instanceof CleoError9) {
|
|
64089
63956
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
64090
63957
|
process.exit(err.code);
|
|
64091
63958
|
}
|
|
@@ -64126,7 +63993,7 @@ var init_sticky3 = __esm({
|
|
|
64126
63993
|
}
|
|
64127
63994
|
cliOutput({ sticky: data }, { command: "sticky show", operation: "sticky.show" });
|
|
64128
63995
|
} catch (err) {
|
|
64129
|
-
if (err instanceof
|
|
63996
|
+
if (err instanceof CleoError9) {
|
|
64130
63997
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
64131
63998
|
process.exit(err.code);
|
|
64132
63999
|
}
|
|
@@ -64204,7 +64071,7 @@ var init_sticky3 = __esm({
|
|
|
64204
64071
|
operation: "sticky.convert"
|
|
64205
64072
|
});
|
|
64206
64073
|
} catch (err) {
|
|
64207
|
-
if (err instanceof
|
|
64074
|
+
if (err instanceof CleoError9) {
|
|
64208
64075
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
64209
64076
|
process.exit(err.code);
|
|
64210
64077
|
}
|
|
@@ -64231,7 +64098,7 @@ var init_sticky3 = __esm({
|
|
|
64231
64098
|
{ command: "sticky archive", operation: "sticky.archive" }
|
|
64232
64099
|
);
|
|
64233
64100
|
} catch (err) {
|
|
64234
|
-
if (err instanceof
|
|
64101
|
+
if (err instanceof CleoError9) {
|
|
64235
64102
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
64236
64103
|
process.exit(err.code);
|
|
64237
64104
|
}
|
|
@@ -64258,7 +64125,7 @@ var init_sticky3 = __esm({
|
|
|
64258
64125
|
{ command: "sticky purge", operation: "sticky.purge" }
|
|
64259
64126
|
);
|
|
64260
64127
|
} catch (err) {
|
|
64261
|
-
if (err instanceof
|
|
64128
|
+
if (err instanceof CleoError9) {
|
|
64262
64129
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
64263
64130
|
process.exit(err.code);
|
|
64264
64131
|
}
|
|
@@ -64274,8 +64141,8 @@ var init_sticky3 = __esm({
|
|
|
64274
64141
|
subCommands: {
|
|
64275
64142
|
add: addCommand12,
|
|
64276
64143
|
jot: addCommand12,
|
|
64277
|
-
list:
|
|
64278
|
-
ls:
|
|
64144
|
+
list: listCommand25,
|
|
64145
|
+
ls: listCommand25,
|
|
64279
64146
|
show: showCommand15,
|
|
64280
64147
|
convert: convertCommand,
|
|
64281
64148
|
archive: archiveCommand4,
|
|
@@ -64403,10 +64270,10 @@ var init_sync = __esm({
|
|
|
64403
64270
|
}
|
|
64404
64271
|
},
|
|
64405
64272
|
async run({ args }) {
|
|
64406
|
-
const { readFileSync:
|
|
64273
|
+
const { readFileSync: readFileSync19 } = await import("node:fs");
|
|
64407
64274
|
let externalTasks;
|
|
64408
64275
|
try {
|
|
64409
|
-
externalTasks = JSON.parse(
|
|
64276
|
+
externalTasks = JSON.parse(readFileSync19(args.file, "utf8"));
|
|
64410
64277
|
} catch (err) {
|
|
64411
64278
|
const message = err instanceof Error ? err.message : String(err);
|
|
64412
64279
|
cliError(`Failed to read or parse external tasks file: ${message}`, 2, {
|
|
@@ -64792,15 +64659,15 @@ var token_exports = {};
|
|
|
64792
64659
|
__export(token_exports, {
|
|
64793
64660
|
tokenCommand: () => tokenCommand
|
|
64794
64661
|
});
|
|
64795
|
-
import { readFileSync as
|
|
64796
|
-
import { getProjectRoot as
|
|
64662
|
+
import { readFileSync as readFileSync17 } from "node:fs";
|
|
64663
|
+
import { getProjectRoot as getProjectRoot40, measureTokenExchange, recordTokenExchange as recordTokenExchange2 } from "@cleocode/core/internal";
|
|
64797
64664
|
function readPayload(args, textKey, fileKey) {
|
|
64798
64665
|
const text = args[textKey];
|
|
64799
64666
|
const file = args[fileKey];
|
|
64800
|
-
if (file) return
|
|
64667
|
+
if (file) return readFileSync17(file, "utf-8");
|
|
64801
64668
|
return text;
|
|
64802
64669
|
}
|
|
64803
|
-
var filterArgs, summaryCommand3,
|
|
64670
|
+
var filterArgs, summaryCommand3, listCommand26, showCommand16, deleteCommand3, clearCommand2, estimateCommand, tokenCommand;
|
|
64804
64671
|
var init_token = __esm({
|
|
64805
64672
|
"packages/cleo/src/cli/commands/token.ts"() {
|
|
64806
64673
|
"use strict";
|
|
@@ -64836,7 +64703,7 @@ var init_token = __esm({
|
|
|
64836
64703
|
);
|
|
64837
64704
|
}
|
|
64838
64705
|
});
|
|
64839
|
-
|
|
64706
|
+
listCommand26 = defineCommand({
|
|
64840
64707
|
meta: { name: "list", description: "List recorded token telemetry" },
|
|
64841
64708
|
args: {
|
|
64842
64709
|
...filterArgs,
|
|
@@ -64957,7 +64824,7 @@ var init_token = __esm({
|
|
|
64957
64824
|
domain: args.domain,
|
|
64958
64825
|
operation: args.operation
|
|
64959
64826
|
};
|
|
64960
|
-
const result = args.record ? await recordTokenExchange2(
|
|
64827
|
+
const result = args.record ? await recordTokenExchange2(getProjectRoot40(), input2) : await measureTokenExchange(input2);
|
|
64961
64828
|
cliOutput(result, {
|
|
64962
64829
|
command: "token",
|
|
64963
64830
|
operation: args.record ? "admin.token.record" : "token.estimate"
|
|
@@ -64971,7 +64838,7 @@ var init_token = __esm({
|
|
|
64971
64838
|
},
|
|
64972
64839
|
subCommands: {
|
|
64973
64840
|
summary: summaryCommand3,
|
|
64974
|
-
list:
|
|
64841
|
+
list: listCommand26,
|
|
64975
64842
|
show: showCommand16,
|
|
64976
64843
|
delete: deleteCommand3,
|
|
64977
64844
|
clear: clearCommand2,
|
|
@@ -64993,7 +64860,7 @@ __export(transcript_exports, {
|
|
|
64993
64860
|
});
|
|
64994
64861
|
import { homedir as homedir7 } from "node:os";
|
|
64995
64862
|
import { join as join31 } from "node:path";
|
|
64996
|
-
import { getProjectRoot as
|
|
64863
|
+
import { getProjectRoot as getProjectRoot41 } from "@cleocode/core";
|
|
64997
64864
|
import {
|
|
64998
64865
|
parseDurationMs,
|
|
64999
64866
|
pruneTranscripts,
|
|
@@ -65023,7 +64890,7 @@ var init_transcript = __esm({
|
|
|
65023
64890
|
async run({ args }) {
|
|
65024
64891
|
if (args.pending) {
|
|
65025
64892
|
try {
|
|
65026
|
-
const projectRoot =
|
|
64893
|
+
const projectRoot = getProjectRoot41();
|
|
65027
64894
|
const { scanPendingTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
65028
64895
|
const pending = await scanPendingTranscripts(projectRoot);
|
|
65029
64896
|
cliOutput(
|
|
@@ -65120,7 +64987,7 @@ var init_transcript = __esm({
|
|
|
65120
64987
|
async run({ args }) {
|
|
65121
64988
|
const tier = args.tier ?? "warm";
|
|
65122
64989
|
const dryRun = args["dry-run"] ?? false;
|
|
65123
|
-
const projectRoot =
|
|
64990
|
+
const projectRoot = getProjectRoot41();
|
|
65124
64991
|
try {
|
|
65125
64992
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
65126
64993
|
const { findSessionTranscriptPath, listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -65232,7 +65099,7 @@ var init_transcript = __esm({
|
|
|
65232
65099
|
const dryRun = args["dry-run"] ?? false;
|
|
65233
65100
|
const olderThanHours = args["older-than-hours"] ? Number.parseInt(args["older-than-hours"], 10) : 24;
|
|
65234
65101
|
const limit = args.limit ? Number.parseInt(args.limit, 10) : void 0;
|
|
65235
|
-
const projectRoot =
|
|
65102
|
+
const projectRoot = getProjectRoot41();
|
|
65236
65103
|
try {
|
|
65237
65104
|
const { extractTranscript } = await import("@cleocode/core/memory/transcript-extractor.js");
|
|
65238
65105
|
const { listAllTranscripts } = await import("@cleocode/core/memory/transcript-scanner.js");
|
|
@@ -65411,7 +65278,7 @@ var update_exports = {};
|
|
|
65411
65278
|
__export(update_exports, {
|
|
65412
65279
|
updateCommand: () => updateCommand2
|
|
65413
65280
|
});
|
|
65414
|
-
import { appendSignedSeverityAttestation as appendSignedSeverityAttestation2 } from "@cleocode/core";
|
|
65281
|
+
import { appendSignedSeverityAttestation as appendSignedSeverityAttestation2, parseAcceptanceCriteria as parseAcceptanceCriteria2 } from "@cleocode/core";
|
|
65415
65282
|
var updateCommand2;
|
|
65416
65283
|
var init_update = __esm({
|
|
65417
65284
|
"packages/cleo/src/cli/commands/update.ts"() {
|
|
@@ -65420,7 +65287,10 @@ var init_update = __esm({
|
|
|
65420
65287
|
init_cli();
|
|
65421
65288
|
init_renderers();
|
|
65422
65289
|
updateCommand2 = defineCommand({
|
|
65423
|
-
meta: {
|
|
65290
|
+
meta: {
|
|
65291
|
+
name: "update",
|
|
65292
|
+
description: "Update a task. Safe under concurrent invocation \u2014 retries on SQLITE_BUSY up to 4 attempts (gh#391)."
|
|
65293
|
+
},
|
|
65424
65294
|
args: {
|
|
65425
65295
|
taskId: {
|
|
65426
65296
|
type: "positional",
|
|
@@ -65462,12 +65332,12 @@ var init_update = __esm({
|
|
|
65462
65332
|
},
|
|
65463
65333
|
labels: {
|
|
65464
65334
|
type: "string",
|
|
65465
|
-
description:
|
|
65335
|
+
description: 'Set labels (comma-separated; lowercase alphanumeric + hyphens + periods only, e.g. "track-b,wave.1") (gh-392)',
|
|
65466
65336
|
alias: "l"
|
|
65467
65337
|
},
|
|
65468
65338
|
"add-labels": {
|
|
65469
65339
|
type: "string",
|
|
65470
|
-
description:
|
|
65340
|
+
description: 'Add labels (comma-separated; lowercase alphanumeric + hyphens + periods only, e.g. "track-b,wave.1") (gh-392)'
|
|
65471
65341
|
},
|
|
65472
65342
|
"remove-labels": {
|
|
65473
65343
|
type: "string",
|
|
@@ -65589,20 +65459,30 @@ var init_update = __esm({
|
|
|
65589
65459
|
*/
|
|
65590
65460
|
"depends-waiver": {
|
|
65591
65461
|
type: "string",
|
|
65592
|
-
description:
|
|
65462
|
+
description: 'Justification (string) to waive the "--depends required for critical priority" check. Only consulted when the task is being promoted to --priority critical AND no existing or new --depends are declared. Stored verbatim in task metadata as audit trail; ignored for non-critical updates. (gh-405 / T1856)'
|
|
65593
65463
|
},
|
|
65594
65464
|
/**
|
|
65595
65465
|
* Related tasks — semantic relationships (non-dependency).
|
|
65596
|
-
*
|
|
65597
|
-
*
|
|
65466
|
+
*
|
|
65467
|
+
* Direction convention (gh-403):
|
|
65468
|
+
* `cleo update <fromId> --add-relates <toId>:<type>`
|
|
65469
|
+
* creates a directed edge FROM `<fromId>` TO `<toId>` with the given type.
|
|
65470
|
+
* Example: `cleo update T127 --add-relates T123:blocks` means
|
|
65471
|
+
* "T127 blocks T123" (the task being updated is the source).
|
|
65472
|
+
*
|
|
65473
|
+
* For dependency edges (T127 must complete before T128 can start), prefer
|
|
65474
|
+
* `--add-depends T128` on T127 — `depends` is the canonical dep primitive
|
|
65475
|
+
* and is what `cleo orchestrate ready`/`waves` walks. `--add-relates` is for
|
|
65476
|
+
* semantic relationships (blocks/supersedes/groups/related) that don't
|
|
65477
|
+
* affect wave-order scheduling.
|
|
65598
65478
|
*/
|
|
65599
65479
|
relates: {
|
|
65600
65480
|
type: "string",
|
|
65601
|
-
description: 'Set related tasks (comma-separated, optional type suffix: "T001:blocks,T002")'
|
|
65481
|
+
description: 'Set related tasks (comma-separated, optional type suffix: "T001:blocks,T002"). Direction: <current task> \u2192 <relate>. For dep edges, prefer --add-depends. (gh-403)'
|
|
65602
65482
|
},
|
|
65603
65483
|
"add-relates": {
|
|
65604
65484
|
type: "string",
|
|
65605
|
-
description:
|
|
65485
|
+
description: 'Add related tasks without overwriting (comma-separated, optional type suffix: "T001:blocks"). Direction: <current task> \u2192 <relate>. For dep edges, prefer --add-depends. (gh-403)'
|
|
65606
65486
|
},
|
|
65607
65487
|
"remove-relates": {
|
|
65608
65488
|
type: "string",
|
|
@@ -65649,8 +65529,7 @@ var init_update = __esm({
|
|
|
65649
65529
|
}
|
|
65650
65530
|
if (args.notes !== void 0) params["notes"] = args.notes;
|
|
65651
65531
|
if (args.note !== void 0) params["notes"] = params["notes"] ?? args.note;
|
|
65652
|
-
if (args.acceptance)
|
|
65653
|
-
params["acceptance"] = args.acceptance.split("|").map((s) => s.trim()).filter(Boolean);
|
|
65532
|
+
if (args.acceptance) params["acceptance"] = parseAcceptanceCriteria2(args.acceptance);
|
|
65654
65533
|
if (args.files) params["files"] = args.files.split(",").map((s) => s.trim());
|
|
65655
65534
|
if (args["add-files"])
|
|
65656
65535
|
params["addFiles"] = args["add-files"].split(",").map((s) => s.trim());
|
|
@@ -65717,7 +65596,7 @@ __export(upgrade_exports, {
|
|
|
65717
65596
|
upgradeCommand: () => upgradeCommand
|
|
65718
65597
|
});
|
|
65719
65598
|
import { resolve as resolve8 } from "node:path";
|
|
65720
|
-
import { CleoError as
|
|
65599
|
+
import { CleoError as CleoError10, diagnoseUpgrade, runUpgrade as runUpgrade2, upgradeWorkflows as upgradeWorkflows2 } from "@cleocode/core/internal";
|
|
65721
65600
|
var workflowsSubcommand, upgradeCommand;
|
|
65722
65601
|
var init_upgrade2 = __esm({
|
|
65723
65602
|
"packages/cleo/src/cli/commands/upgrade.ts"() {
|
|
@@ -65784,7 +65663,7 @@ var init_upgrade2 = __esm({
|
|
|
65784
65663
|
process.exit(1);
|
|
65785
65664
|
}
|
|
65786
65665
|
} catch (err) {
|
|
65787
|
-
if (err instanceof
|
|
65666
|
+
if (err instanceof CleoError10) {
|
|
65788
65667
|
cliError(err.message, err.code, { name: "CleoError", fix: err.fix });
|
|
65789
65668
|
process.exit(err.code);
|
|
65790
65669
|
}
|
|
@@ -65910,7 +65789,7 @@ var init_upgrade2 = __esm({
|
|
|
65910
65789
|
}
|
|
65911
65790
|
progress.complete(isDryRun ? "Preview complete" : "Upgrade complete");
|
|
65912
65791
|
} catch (err) {
|
|
65913
|
-
if (err instanceof
|
|
65792
|
+
if (err instanceof CleoError10) {
|
|
65914
65793
|
progress.error(err.message);
|
|
65915
65794
|
cliError(
|
|
65916
65795
|
err.message,
|
|
@@ -66015,10 +65894,10 @@ var web_exports = {};
|
|
|
66015
65894
|
__export(web_exports, {
|
|
66016
65895
|
webCommand: () => webCommand
|
|
66017
65896
|
});
|
|
66018
|
-
import { execFileSync as
|
|
65897
|
+
import { execFileSync as execFileSync3, spawn as spawn3 } from "node:child_process";
|
|
66019
65898
|
import { mkdir as mkdir4, open, readFile as readFile6, rm, stat as stat2, writeFile as writeFile3 } from "node:fs/promises";
|
|
66020
65899
|
import { join as join32 } from "node:path";
|
|
66021
|
-
import { CleoError as
|
|
65900
|
+
import { CleoError as CleoError11, formatError as formatError7, getCleoHome as getCleoHome5 } from "@cleocode/core";
|
|
66022
65901
|
function getWebPaths() {
|
|
66023
65902
|
const cleoHome = getCleoHome5();
|
|
66024
65903
|
return {
|
|
@@ -66061,7 +65940,7 @@ async function startWebServer(port, host) {
|
|
|
66061
65940
|
const { pidFile, configFile, logFile, logDir } = getWebPaths();
|
|
66062
65941
|
const status = await getStatus();
|
|
66063
65942
|
if (status.running) {
|
|
66064
|
-
throw new
|
|
65943
|
+
throw new CleoError11(1 /* GENERAL_ERROR */, `Server already running (PID: ${status.pid})`);
|
|
66065
65944
|
}
|
|
66066
65945
|
const projectRoot = process.env["CLEO_ROOT"] ?? process.cwd();
|
|
66067
65946
|
const studioDir = process.env["CLEO_STUDIO_DIR"] ?? join32(projectRoot, "packages", "studio", "build");
|
|
@@ -66079,12 +65958,12 @@ async function startWebServer(port, host) {
|
|
|
66079
65958
|
await stat2(webIndexPath);
|
|
66080
65959
|
} catch {
|
|
66081
65960
|
try {
|
|
66082
|
-
|
|
65961
|
+
execFileSync3("pnpm", ["--filter", "@cleocode/studio", "run", "build"], {
|
|
66083
65962
|
cwd: projectRoot,
|
|
66084
65963
|
stdio: "ignore"
|
|
66085
65964
|
});
|
|
66086
65965
|
} catch {
|
|
66087
|
-
throw new
|
|
65966
|
+
throw new CleoError11(
|
|
66088
65967
|
1 /* GENERAL_ERROR */,
|
|
66089
65968
|
`Studio build failed. Run: pnpm --filter @cleocode/studio run build
|
|
66090
65969
|
Logs: ${logFile}`
|
|
@@ -66130,7 +66009,7 @@ Logs: ${logFile}`
|
|
|
66130
66009
|
} catch {
|
|
66131
66010
|
}
|
|
66132
66011
|
await rm(pidFile, { force: true });
|
|
66133
|
-
throw new
|
|
66012
|
+
throw new CleoError11(1 /* GENERAL_ERROR */, "Server failed to start within 15 seconds");
|
|
66134
66013
|
}
|
|
66135
66014
|
cliOutput(
|
|
66136
66015
|
{
|
|
@@ -66170,7 +66049,7 @@ var init_web = __esm({
|
|
|
66170
66049
|
try {
|
|
66171
66050
|
await startWebServer(Number.parseInt(args.port, 10), args.host);
|
|
66172
66051
|
} catch (err) {
|
|
66173
|
-
if (err instanceof
|
|
66052
|
+
if (err instanceof CleoError11) {
|
|
66174
66053
|
console.error(formatError7(err));
|
|
66175
66054
|
process.exit(err.code);
|
|
66176
66055
|
}
|
|
@@ -66214,7 +66093,7 @@ var init_web = __esm({
|
|
|
66214
66093
|
await rm(pidFile, { force: true });
|
|
66215
66094
|
cliOutput({ stopped: true }, { command: "web", message: "CLEO Web UI stopped" });
|
|
66216
66095
|
} catch (err) {
|
|
66217
|
-
if (err instanceof
|
|
66096
|
+
if (err instanceof CleoError11) {
|
|
66218
66097
|
console.error(formatError7(err));
|
|
66219
66098
|
process.exit(err.code);
|
|
66220
66099
|
}
|
|
@@ -66267,7 +66146,7 @@ var init_web = __esm({
|
|
|
66267
66146
|
}
|
|
66268
66147
|
await startWebServer(Number.parseInt(args.port, 10), args.host);
|
|
66269
66148
|
} catch (err) {
|
|
66270
|
-
if (err instanceof
|
|
66149
|
+
if (err instanceof CleoError11) {
|
|
66271
66150
|
console.error(formatError7(err));
|
|
66272
66151
|
process.exit(err.code);
|
|
66273
66152
|
}
|
|
@@ -66282,7 +66161,7 @@ var init_web = __esm({
|
|
|
66282
66161
|
const status = await getStatus();
|
|
66283
66162
|
cliOutput(status, { command: "web" });
|
|
66284
66163
|
} catch (err) {
|
|
66285
|
-
if (err instanceof
|
|
66164
|
+
if (err instanceof CleoError11) {
|
|
66286
66165
|
console.error(formatError7(err));
|
|
66287
66166
|
process.exit(err.code);
|
|
66288
66167
|
}
|
|
@@ -66296,7 +66175,7 @@ var init_web = __esm({
|
|
|
66296
66175
|
try {
|
|
66297
66176
|
const status = await getStatus();
|
|
66298
66177
|
if (!status.running || !status.url) {
|
|
66299
|
-
throw new
|
|
66178
|
+
throw new CleoError11(
|
|
66300
66179
|
1 /* GENERAL_ERROR */,
|
|
66301
66180
|
"Web server is not running. Start with: cleo web start"
|
|
66302
66181
|
);
|
|
@@ -66315,7 +66194,7 @@ var init_web = __esm({
|
|
|
66315
66194
|
}
|
|
66316
66195
|
cliOutput({ url }, { command: "web", message: `Open browser to: ${url}` });
|
|
66317
66196
|
} catch (err) {
|
|
66318
|
-
if (err instanceof
|
|
66197
|
+
if (err instanceof CleoError11) {
|
|
66319
66198
|
console.error(formatError7(err));
|
|
66320
66199
|
process.exit(err.code);
|
|
66321
66200
|
}
|
|
@@ -66347,7 +66226,7 @@ __export(worktree_exports, {
|
|
|
66347
66226
|
worktreeCommand: () => worktreeCommand
|
|
66348
66227
|
});
|
|
66349
66228
|
import readline4 from "node:readline";
|
|
66350
|
-
import { getProjectRoot as
|
|
66229
|
+
import { getProjectRoot as getProjectRoot42, listWorktrees as listWorktrees2 } from "@cleocode/core/internal";
|
|
66351
66230
|
async function promptYesNo2(question) {
|
|
66352
66231
|
return new Promise((resolve9) => {
|
|
66353
66232
|
const rl = readline4.createInterface({ input: process.stdin, output: process.stdout });
|
|
@@ -66368,7 +66247,7 @@ function renderOrphanPreamble(wt) {
|
|
|
66368
66247
|
""
|
|
66369
66248
|
].join("\n");
|
|
66370
66249
|
}
|
|
66371
|
-
var VALID_STATUS_VALUES,
|
|
66250
|
+
var VALID_STATUS_VALUES, listCommand27, pruneCommand3, forceUnlockCommand, worktreeCommand;
|
|
66372
66251
|
var init_worktree3 = __esm({
|
|
66373
66252
|
"packages/cleo/src/cli/commands/worktree.ts"() {
|
|
66374
66253
|
"use strict";
|
|
@@ -66376,7 +66255,7 @@ var init_worktree3 = __esm({
|
|
|
66376
66255
|
init_cli();
|
|
66377
66256
|
init_renderers();
|
|
66378
66257
|
VALID_STATUS_VALUES = ["active", "stale", "merged", "orphan", "locked"];
|
|
66379
|
-
|
|
66258
|
+
listCommand27 = defineCommand({
|
|
66380
66259
|
meta: {
|
|
66381
66260
|
name: "list",
|
|
66382
66261
|
description: "List worktrees attached to this project with status classification (active|stale|merged|orphan|locked)."
|
|
@@ -66446,7 +66325,7 @@ var init_worktree3 = __esm({
|
|
|
66446
66325
|
const yes = args["yes"] === true;
|
|
66447
66326
|
const staleDaysRaw = typeof args["days"] === "string" ? args["days"] : void 0;
|
|
66448
66327
|
const staleDays = staleDaysRaw !== void 0 ? Number.parseInt(staleDaysRaw, 10) : void 0;
|
|
66449
|
-
const projectRoot =
|
|
66328
|
+
const projectRoot = getProjectRoot42();
|
|
66450
66329
|
const listResult = await listWorktrees2({
|
|
66451
66330
|
projectRoot,
|
|
66452
66331
|
...staleDays !== void 0 && !Number.isNaN(staleDays) ? { staleDays } : {}
|
|
@@ -66559,7 +66438,7 @@ var init_worktree3 = __esm({
|
|
|
66559
66438
|
description: "Inspect and manage CLEO-attached git worktrees. See `cleo worktree <subcommand> --help` for details."
|
|
66560
66439
|
},
|
|
66561
66440
|
subCommands: {
|
|
66562
|
-
list:
|
|
66441
|
+
list: listCommand27,
|
|
66563
66442
|
prune: pruneCommand3,
|
|
66564
66443
|
"force-unlock": forceUnlockCommand
|
|
66565
66444
|
},
|
|
@@ -66580,8 +66459,8 @@ var init_worktree3 = __esm({
|
|
|
66580
66459
|
init_dist();
|
|
66581
66460
|
init_field_context();
|
|
66582
66461
|
init_format_context();
|
|
66583
|
-
import { readFileSync as
|
|
66584
|
-
import { dirname as
|
|
66462
|
+
import { readFileSync as readFileSync18 } from "node:fs";
|
|
66463
|
+
import { dirname as dirname11, join as join34 } from "node:path";
|
|
66585
66464
|
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
66586
66465
|
|
|
66587
66466
|
// packages/cleo/src/cli/generated/command-manifest.ts
|
|
@@ -66595,13 +66474,13 @@ var COMMAND_MANIFEST = [
|
|
|
66595
66474
|
{
|
|
66596
66475
|
exportName: "addBatchCommand",
|
|
66597
66476
|
name: "add-batch",
|
|
66598
|
-
description: "Create multiple tasks
|
|
66477
|
+
description: "Create multiple tasks in a single atomic transaction from a JSON file",
|
|
66599
66478
|
load: async () => (await Promise.resolve().then(() => (init_add_batch(), add_batch_exports))).addBatchCommand
|
|
66600
66479
|
},
|
|
66601
66480
|
{
|
|
66602
66481
|
exportName: "addCommand",
|
|
66603
66482
|
name: "add",
|
|
66604
|
-
description: "Create a new task (requires active session)",
|
|
66483
|
+
description: "Create a new task (requires active session)\nFor 2+ tasks at once: cleo add-batch --file tasks.json (single transaction, atomic rollback)",
|
|
66605
66484
|
load: async () => (await Promise.resolve().then(() => (init_add(), add_exports))).addCommand
|
|
66606
66485
|
},
|
|
66607
66486
|
{
|
|
@@ -66721,7 +66600,7 @@ var COMMAND_MANIFEST = [
|
|
|
66721
66600
|
{
|
|
66722
66601
|
exportName: "changesetCommand",
|
|
66723
66602
|
name: "changeset",
|
|
66724
|
-
description: "Author task-anchored changeset entries
|
|
66603
|
+
description: "Author + list task-anchored changeset entries \u2014 dual-writes go to ",
|
|
66725
66604
|
load: async () => (await Promise.resolve().then(() => (init_changeset(), changeset_exports))).changesetCommand
|
|
66726
66605
|
},
|
|
66727
66606
|
{
|
|
@@ -66940,12 +66819,6 @@ var COMMAND_MANIFEST = [
|
|
|
66940
66819
|
description: "Transcript garbage collection: manual trigger and status",
|
|
66941
66820
|
load: async () => (await Promise.resolve().then(() => (init_gc(), gc_exports))).gcCommand
|
|
66942
66821
|
},
|
|
66943
|
-
{
|
|
66944
|
-
exportName: "generateChangelogCommand",
|
|
66945
|
-
name: "generate-changelog",
|
|
66946
|
-
description: "Generate platform-specific changelog from CHANGELOG.md",
|
|
66947
|
-
load: async () => (await Promise.resolve().then(() => (init_generate_changelog(), generate_changelog_exports))).generateChangelogCommand
|
|
66948
|
-
},
|
|
66949
66822
|
{
|
|
66950
66823
|
exportName: "gradeCommand",
|
|
66951
66824
|
name: "grade",
|
|
@@ -67412,6 +67285,7 @@ var COMMAND_MANIFEST = [
|
|
|
67412
67285
|
|
|
67413
67286
|
// packages/cleo/src/cli/help-renderer.ts
|
|
67414
67287
|
init_dist();
|
|
67288
|
+
import { buildCommandGroups } from "@cleocode/core/internal";
|
|
67415
67289
|
var noColor2 = (() => {
|
|
67416
67290
|
const env = globalThis.process?.env ?? {};
|
|
67417
67291
|
return env.NO_COLOR === "1" || env.TERM === "dumb" || env.TEST || env.CI;
|
|
@@ -67424,116 +67298,6 @@ var underline2 = ansi2(4, 24);
|
|
|
67424
67298
|
var IMPLICIT_ALIASES = {
|
|
67425
67299
|
tags: "labels"
|
|
67426
67300
|
};
|
|
67427
|
-
var COMMAND_GROUPS = [
|
|
67428
|
-
{
|
|
67429
|
-
name: "Task Management",
|
|
67430
|
-
commands: [
|
|
67431
|
-
"add",
|
|
67432
|
-
"show",
|
|
67433
|
-
"find",
|
|
67434
|
-
"list",
|
|
67435
|
-
"update",
|
|
67436
|
-
"complete",
|
|
67437
|
-
"delete",
|
|
67438
|
-
"start",
|
|
67439
|
-
"stop",
|
|
67440
|
-
"current",
|
|
67441
|
-
"next",
|
|
67442
|
-
"exists"
|
|
67443
|
-
]
|
|
67444
|
-
},
|
|
67445
|
-
{
|
|
67446
|
-
name: "Task Organization",
|
|
67447
|
-
commands: [
|
|
67448
|
-
"archive",
|
|
67449
|
-
"labels",
|
|
67450
|
-
"promote",
|
|
67451
|
-
"relates",
|
|
67452
|
-
"reorder",
|
|
67453
|
-
"reparent",
|
|
67454
|
-
"deps",
|
|
67455
|
-
"tree",
|
|
67456
|
-
"blockers"
|
|
67457
|
-
]
|
|
67458
|
-
},
|
|
67459
|
-
{
|
|
67460
|
-
name: "Sessions & Planning",
|
|
67461
|
-
commands: ["session", "briefing", "dash", "plan", "safestop", "context"]
|
|
67462
|
-
},
|
|
67463
|
-
{
|
|
67464
|
-
name: "Phases & Lifecycle",
|
|
67465
|
-
commands: ["phase", "lifecycle", "release", "roadmap"]
|
|
67466
|
-
},
|
|
67467
|
-
{
|
|
67468
|
-
name: "Memory & Notes",
|
|
67469
|
-
commands: ["memory", "brain", "refresh-memory", "sticky", "reason"]
|
|
67470
|
-
},
|
|
67471
|
-
{
|
|
67472
|
-
name: "Analysis & Stats",
|
|
67473
|
-
commands: ["analyze", "stats", "history", "archive-stats"]
|
|
67474
|
-
},
|
|
67475
|
-
{
|
|
67476
|
-
name: "Validation & Compliance",
|
|
67477
|
-
commands: [
|
|
67478
|
-
"check",
|
|
67479
|
-
"verify",
|
|
67480
|
-
"testing",
|
|
67481
|
-
"compliance",
|
|
67482
|
-
"consensus",
|
|
67483
|
-
"contribution",
|
|
67484
|
-
"decomposition",
|
|
67485
|
-
"backfill"
|
|
67486
|
-
]
|
|
67487
|
-
},
|
|
67488
|
-
{
|
|
67489
|
-
name: "Code & Documentation",
|
|
67490
|
-
commands: ["code", "docs", "detect-drift", "map"]
|
|
67491
|
-
},
|
|
67492
|
-
{
|
|
67493
|
-
name: "Research & Orchestration",
|
|
67494
|
-
commands: ["research", "orchestrate", "conduit"]
|
|
67495
|
-
},
|
|
67496
|
-
{
|
|
67497
|
-
name: "Import / Export",
|
|
67498
|
-
commands: ["export", "import", "export-tasks", "import-tasks", "snapshot", "inject"]
|
|
67499
|
-
},
|
|
67500
|
-
{
|
|
67501
|
-
name: "Collaboration",
|
|
67502
|
-
commands: ["nexus", "remote", "push", "pull", "checkpoint"]
|
|
67503
|
-
},
|
|
67504
|
-
{
|
|
67505
|
-
name: "Agents",
|
|
67506
|
-
commands: ["agent", "grade"]
|
|
67507
|
-
},
|
|
67508
|
-
{
|
|
67509
|
-
name: "System & Admin",
|
|
67510
|
-
commands: [
|
|
67511
|
-
"version",
|
|
67512
|
-
"init",
|
|
67513
|
-
"config",
|
|
67514
|
-
"admin",
|
|
67515
|
-
"doctor",
|
|
67516
|
-
"upgrade",
|
|
67517
|
-
"self-update",
|
|
67518
|
-
"ops",
|
|
67519
|
-
"schema",
|
|
67520
|
-
"log",
|
|
67521
|
-
"sequence",
|
|
67522
|
-
"adr",
|
|
67523
|
-
"cant",
|
|
67524
|
-
"token",
|
|
67525
|
-
"otel",
|
|
67526
|
-
"migrate",
|
|
67527
|
-
"detect",
|
|
67528
|
-
"generate-changelog",
|
|
67529
|
-
"issue",
|
|
67530
|
-
"skills",
|
|
67531
|
-
"web",
|
|
67532
|
-
"backup",
|
|
67533
|
-
"restore"
|
|
67534
|
-
]
|
|
67535
|
-
}
|
|
67536
|
-
];
|
|
67537
67301
|
function resolveMeta(cmd) {
|
|
67538
67302
|
if (typeof cmd.meta === "function") {
|
|
67539
67303
|
const result = cmd.meta();
|
|
@@ -67580,8 +67344,9 @@ function renderGroupedHelp(version, subCommands2, aliasMap) {
|
|
|
67580
67344
|
existing.push(alias2);
|
|
67581
67345
|
cmdAliases.set(primary, existing);
|
|
67582
67346
|
}
|
|
67347
|
+
const commandGroups = buildCommandGroups(new Set(descMap.keys()));
|
|
67583
67348
|
let maxCmdWidth = 0;
|
|
67584
|
-
const allGroupedCmds =
|
|
67349
|
+
const allGroupedCmds = commandGroups.flatMap((g) => g.commands);
|
|
67585
67350
|
const allCmds = [.../* @__PURE__ */ new Set([...allGroupedCmds, ...descMap.keys()])];
|
|
67586
67351
|
for (const cmd of allCmds) {
|
|
67587
67352
|
if (!descMap.has(cmd) || aliasMap.has(cmd)) continue;
|
|
@@ -67595,7 +67360,7 @@ function renderGroupedHelp(version, subCommands2, aliasMap) {
|
|
|
67595
67360
|
lines.push(`${underline2(bold2("USAGE"))} ${cyan2("cleo <command> [OPTIONS]")}`);
|
|
67596
67361
|
lines.push("");
|
|
67597
67362
|
const rendered = /* @__PURE__ */ new Set();
|
|
67598
|
-
for (const group of
|
|
67363
|
+
for (const group of commandGroups) {
|
|
67599
67364
|
const groupLines = [];
|
|
67600
67365
|
for (const cmd of group.commands) {
|
|
67601
67366
|
if (!descMap.has(cmd)) continue;
|
|
@@ -67833,8 +67598,8 @@ Or via NodeSource: https://github.com/nodesource/distributions
|
|
|
67833
67598
|
}
|
|
67834
67599
|
}
|
|
67835
67600
|
function getPackageVersion() {
|
|
67836
|
-
const pkgPath = join34(
|
|
67837
|
-
const pkg = JSON.parse(
|
|
67601
|
+
const pkgPath = join34(dirname11(fileURLToPath8(import.meta.url)), "../../package.json");
|
|
67602
|
+
const pkg = JSON.parse(readFileSync18(pkgPath, "utf-8"));
|
|
67838
67603
|
return pkg.version;
|
|
67839
67604
|
}
|
|
67840
67605
|
var CLI_VERSION = getPackageVersion();
|
|
@@ -67986,7 +67751,7 @@ async function runStartupMaintenance() {
|
|
|
67986
67751
|
detectAndRemoveStrayProjectNexus,
|
|
67987
67752
|
getGlobalSalt,
|
|
67988
67753
|
getLogger: getLogger20,
|
|
67989
|
-
getProjectRoot:
|
|
67754
|
+
getProjectRoot: getProjectRoot43,
|
|
67990
67755
|
isCleanupMarkerSet,
|
|
67991
67756
|
migrateSignaldockToConduit,
|
|
67992
67757
|
needsSignaldockToConduitMigration,
|
|
@@ -67995,7 +67760,7 @@ async function runStartupMaintenance() {
|
|
|
67995
67760
|
} = await import("@cleocode/core/internal");
|
|
67996
67761
|
let projectRootForCleanup = "";
|
|
67997
67762
|
try {
|
|
67998
|
-
projectRootForCleanup =
|
|
67763
|
+
projectRootForCleanup = getProjectRoot43();
|
|
67999
67764
|
} catch {
|
|
68000
67765
|
}
|
|
68001
67766
|
if (!isCleanupMarkerSet(CLI_VERSION, projectRootForCleanup)) {
|
|
@@ -68015,7 +67780,7 @@ async function runStartupMaintenance() {
|
|
|
68015
67780
|
const isInitInvocation = process.argv.slice(2).some((a) => a === "init");
|
|
68016
67781
|
if (!isInitInvocation) {
|
|
68017
67782
|
try {
|
|
68018
|
-
const _projectRootForMigration =
|
|
67783
|
+
const _projectRootForMigration = getProjectRoot43();
|
|
68019
67784
|
if (needsSignaldockToConduitMigration(_projectRootForMigration)) {
|
|
68020
67785
|
const migrationResult = migrateSignaldockToConduit(_projectRootForMigration);
|
|
68021
67786
|
if (migrationResult.status === "failed") {
|