@cleocode/cleo 2026.4.16 → 2026.4.18
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 +301 -24
- package/dist/cli/index.js.map +4 -4
- package/package.json +7 -7
package/dist/cli/index.js
CHANGED
|
@@ -75307,6 +75307,7 @@ __export(src_exports, {
|
|
|
75307
75307
|
});
|
|
75308
75308
|
var init_src2 = __esm({
|
|
75309
75309
|
"packages/core/src/index.ts"() {
|
|
75310
|
+
"use strict";
|
|
75310
75311
|
init_src();
|
|
75311
75312
|
init_adapters();
|
|
75312
75313
|
init_admin();
|
|
@@ -100331,7 +100332,7 @@ var init_normalizer = __esm({
|
|
|
100331
100332
|
});
|
|
100332
100333
|
|
|
100333
100334
|
// packages/cleo/src/cli/renderers/colors.ts
|
|
100334
|
-
function
|
|
100335
|
+
function ansi2(code) {
|
|
100335
100336
|
return colorsEnabled ? code : "";
|
|
100336
100337
|
}
|
|
100337
100338
|
function statusSymbol(status) {
|
|
@@ -100424,15 +100425,15 @@ var init_colors = __esm({
|
|
|
100424
100425
|
if (lang === "C" || lang === "POSIX") return false;
|
|
100425
100426
|
return lang.includes("UTF") || process.platform === "darwin";
|
|
100426
100427
|
})();
|
|
100427
|
-
BOLD =
|
|
100428
|
-
DIM =
|
|
100429
|
-
NC =
|
|
100430
|
-
RED =
|
|
100431
|
-
GREEN =
|
|
100432
|
-
YELLOW =
|
|
100433
|
-
BLUE =
|
|
100434
|
-
MAGENTA =
|
|
100435
|
-
CYAN =
|
|
100428
|
+
BOLD = ansi2("\x1B[1m");
|
|
100429
|
+
DIM = ansi2("\x1B[2m");
|
|
100430
|
+
NC = ansi2("\x1B[0m");
|
|
100431
|
+
RED = ansi2("\x1B[0;31m");
|
|
100432
|
+
GREEN = ansi2("\x1B[0;32m");
|
|
100433
|
+
YELLOW = ansi2("\x1B[1;33m");
|
|
100434
|
+
BLUE = ansi2("\x1B[0;34m");
|
|
100435
|
+
MAGENTA = ansi2("\x1B[0;35m");
|
|
100436
|
+
CYAN = ansi2("\x1B[0;36m");
|
|
100436
100437
|
BOX = unicodeEnabled ? {
|
|
100437
100438
|
tl: "\u256D",
|
|
100438
100439
|
tr: "\u256E",
|
|
@@ -111598,8 +111599,29 @@ async function orchestrateFanout(items, projectRoot) {
|
|
|
111598
111599
|
try {
|
|
111599
111600
|
const settled = await Promise.allSettled(
|
|
111600
111601
|
items.map(async (item) => {
|
|
111601
|
-
|
|
111602
|
-
|
|
111602
|
+
const spawnResult = await orchestrateSpawnExecute(
|
|
111603
|
+
item.taskId,
|
|
111604
|
+
/* adapterId */
|
|
111605
|
+
void 0,
|
|
111606
|
+
/* protocolType */
|
|
111607
|
+
void 0,
|
|
111608
|
+
projectRoot,
|
|
111609
|
+
/* tier */
|
|
111610
|
+
void 0
|
|
111611
|
+
);
|
|
111612
|
+
if (!spawnResult.success) {
|
|
111613
|
+
return {
|
|
111614
|
+
taskId: item.taskId,
|
|
111615
|
+
status: "failed",
|
|
111616
|
+
error: spawnResult.error?.message ?? `Spawn failed for task ${item.taskId}`
|
|
111617
|
+
};
|
|
111618
|
+
}
|
|
111619
|
+
const data = spawnResult.data;
|
|
111620
|
+
return {
|
|
111621
|
+
taskId: item.taskId,
|
|
111622
|
+
status: "spawned",
|
|
111623
|
+
instanceId: typeof data?.instanceId === "string" ? data.instanceId : void 0
|
|
111624
|
+
};
|
|
111603
111625
|
})
|
|
111604
111626
|
);
|
|
111605
111627
|
const results = settled.map((outcome, i) => {
|
|
@@ -111612,15 +111634,18 @@ async function orchestrateFanout(items, projectRoot) {
|
|
|
111612
111634
|
error: outcome.reason instanceof Error ? outcome.reason.message : String(outcome.reason)
|
|
111613
111635
|
};
|
|
111614
111636
|
});
|
|
111637
|
+
fanoutManifestStore.set(manifestEntryId, {
|
|
111638
|
+
results,
|
|
111639
|
+
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
111640
|
+
});
|
|
111615
111641
|
return {
|
|
111616
111642
|
success: true,
|
|
111617
111643
|
data: {
|
|
111618
111644
|
manifestEntryId,
|
|
111619
111645
|
results,
|
|
111620
111646
|
total: items.length,
|
|
111621
|
-
|
|
111622
|
-
failed: results.filter((r) => r.status === "failed").length
|
|
111623
|
-
note: "fanout spawn execution is a W7b stub \u2014 real Pi adapter wiring lands with runtime enforcement"
|
|
111647
|
+
spawned: results.filter((r) => r.status === "spawned").length,
|
|
111648
|
+
failed: results.filter((r) => r.status === "failed").length
|
|
111624
111649
|
}
|
|
111625
111650
|
};
|
|
111626
111651
|
} catch (error48) {
|
|
@@ -111714,7 +111739,7 @@ async function orchestrateAnalyzeParallelSafety(taskIds, projectRoot) {
|
|
|
111714
111739
|
};
|
|
111715
111740
|
}
|
|
111716
111741
|
}
|
|
111717
|
-
var OrchestrateHandler;
|
|
111742
|
+
var OrchestrateHandler, fanoutManifestStore;
|
|
111718
111743
|
var init_orchestrate2 = __esm({
|
|
111719
111744
|
"packages/cleo/src/dispatch/domains/orchestrate.ts"() {
|
|
111720
111745
|
"use strict";
|
|
@@ -111806,16 +111831,34 @@ var init_orchestrate2 = __esm({
|
|
|
111806
111831
|
startTime
|
|
111807
111832
|
);
|
|
111808
111833
|
}
|
|
111834
|
+
const entry = fanoutManifestStore.get(manifestEntryId);
|
|
111835
|
+
if (!entry) {
|
|
111836
|
+
return {
|
|
111837
|
+
meta: dispatchMeta("query", "orchestrate", operation, startTime),
|
|
111838
|
+
success: true,
|
|
111839
|
+
data: {
|
|
111840
|
+
manifestEntryId,
|
|
111841
|
+
pending: [],
|
|
111842
|
+
running: [],
|
|
111843
|
+
complete: [],
|
|
111844
|
+
failed: [],
|
|
111845
|
+
found: false
|
|
111846
|
+
}
|
|
111847
|
+
};
|
|
111848
|
+
}
|
|
111849
|
+
const spawned = entry.results.filter((r) => r.status === "spawned").map((r) => r.taskId);
|
|
111850
|
+
const failed = entry.results.filter((r) => r.status === "failed").map((r) => r.taskId);
|
|
111809
111851
|
return {
|
|
111810
111852
|
meta: dispatchMeta("query", "orchestrate", operation, startTime),
|
|
111811
111853
|
success: true,
|
|
111812
111854
|
data: {
|
|
111813
111855
|
manifestEntryId,
|
|
111814
111856
|
pending: [],
|
|
111815
|
-
running:
|
|
111857
|
+
running: spawned,
|
|
111816
111858
|
complete: [],
|
|
111817
|
-
failed
|
|
111818
|
-
|
|
111859
|
+
failed,
|
|
111860
|
+
found: true,
|
|
111861
|
+
completedAt: entry.completedAt
|
|
111819
111862
|
}
|
|
111820
111863
|
};
|
|
111821
111864
|
}
|
|
@@ -112180,6 +112223,7 @@ var init_orchestrate2 = __esm({
|
|
|
112180
112223
|
};
|
|
112181
112224
|
}
|
|
112182
112225
|
};
|
|
112226
|
+
fanoutManifestStore = /* @__PURE__ */ new Map();
|
|
112183
112227
|
}
|
|
112184
112228
|
});
|
|
112185
112229
|
|
|
@@ -116097,11 +116141,11 @@ var CLIError = class extends Error {
|
|
|
116097
116141
|
function parseRawArgs(args = [], opts = {}) {
|
|
116098
116142
|
const booleans = new Set(opts.boolean || []);
|
|
116099
116143
|
const strings = new Set(opts.string || []);
|
|
116100
|
-
const
|
|
116144
|
+
const aliasMap2 = opts.alias || {};
|
|
116101
116145
|
const defaults = opts.default || {};
|
|
116102
116146
|
const aliasToMain = /* @__PURE__ */ new Map();
|
|
116103
116147
|
const mainToAliases = /* @__PURE__ */ new Map();
|
|
116104
|
-
for (const [key, value] of Object.entries(
|
|
116148
|
+
for (const [key, value] of Object.entries(aliasMap2)) {
|
|
116105
116149
|
const targets = value;
|
|
116106
116150
|
for (const target of targets) {
|
|
116107
116151
|
aliasToMain.set(key, target);
|
|
@@ -116122,8 +116166,8 @@ function parseRawArgs(args = [], opts = {}) {
|
|
|
116122
116166
|
const allOptions = /* @__PURE__ */ new Set([
|
|
116123
116167
|
...booleans,
|
|
116124
116168
|
...strings,
|
|
116125
|
-
...Object.keys(
|
|
116126
|
-
...Object.values(
|
|
116169
|
+
...Object.keys(aliasMap2),
|
|
116170
|
+
...Object.values(aliasMap2).flat(),
|
|
116127
116171
|
...Object.keys(defaults)
|
|
116128
116172
|
]);
|
|
116129
116173
|
for (const name2 of allOptions) if (!options[name2]) options[name2] = {
|
|
@@ -116539,6 +116583,237 @@ function camelToKebab2(str) {
|
|
|
116539
116583
|
init_field_context();
|
|
116540
116584
|
init_format_context();
|
|
116541
116585
|
|
|
116586
|
+
// packages/cleo/src/cli/help-renderer.ts
|
|
116587
|
+
var noColor2 = (() => {
|
|
116588
|
+
const env = globalThis.process?.env ?? {};
|
|
116589
|
+
return env.NO_COLOR === "1" || env.TERM === "dumb" || env.TEST || env.CI;
|
|
116590
|
+
})();
|
|
116591
|
+
var ansi = (code, reset = 39) => (t) => noColor2 ? t : `\x1B[${code}m${t}\x1B[${reset}m`;
|
|
116592
|
+
var bold2 = ansi(1, 22);
|
|
116593
|
+
var cyan2 = ansi(36);
|
|
116594
|
+
var gray2 = ansi(90);
|
|
116595
|
+
var underline2 = ansi(4, 24);
|
|
116596
|
+
var IMPLICIT_ALIASES = {
|
|
116597
|
+
tags: "labels"
|
|
116598
|
+
};
|
|
116599
|
+
var NATIVE_COMMAND_DESCS = {
|
|
116600
|
+
version: "Display CLEO version",
|
|
116601
|
+
code: "Code analysis via tree-sitter AST"
|
|
116602
|
+
};
|
|
116603
|
+
var COMMAND_GROUPS = [
|
|
116604
|
+
{
|
|
116605
|
+
name: "Task Management",
|
|
116606
|
+
commands: [
|
|
116607
|
+
"add",
|
|
116608
|
+
"show",
|
|
116609
|
+
"find",
|
|
116610
|
+
"list",
|
|
116611
|
+
"update",
|
|
116612
|
+
"complete",
|
|
116613
|
+
"delete",
|
|
116614
|
+
"start",
|
|
116615
|
+
"stop",
|
|
116616
|
+
"current",
|
|
116617
|
+
"next",
|
|
116618
|
+
"exists",
|
|
116619
|
+
"bug"
|
|
116620
|
+
]
|
|
116621
|
+
},
|
|
116622
|
+
{
|
|
116623
|
+
name: "Task Organization",
|
|
116624
|
+
commands: [
|
|
116625
|
+
"archive",
|
|
116626
|
+
"labels",
|
|
116627
|
+
"promote",
|
|
116628
|
+
"relates",
|
|
116629
|
+
"reorder",
|
|
116630
|
+
"reparent",
|
|
116631
|
+
"deps",
|
|
116632
|
+
"tree",
|
|
116633
|
+
"blockers"
|
|
116634
|
+
]
|
|
116635
|
+
},
|
|
116636
|
+
{
|
|
116637
|
+
name: "Sessions & Planning",
|
|
116638
|
+
commands: ["session", "briefing", "dash", "plan", "safestop", "context"]
|
|
116639
|
+
},
|
|
116640
|
+
{
|
|
116641
|
+
name: "Phases & Lifecycle",
|
|
116642
|
+
commands: ["phase", "phases", "lifecycle", "release", "roadmap"]
|
|
116643
|
+
},
|
|
116644
|
+
{
|
|
116645
|
+
name: "Memory & Notes",
|
|
116646
|
+
commands: ["memory", "brain", "observe", "refresh-memory", "sticky", "reason"]
|
|
116647
|
+
},
|
|
116648
|
+
{
|
|
116649
|
+
name: "Analysis & Stats",
|
|
116650
|
+
commands: ["analyze", "stats", "history", "archive-stats"]
|
|
116651
|
+
},
|
|
116652
|
+
{
|
|
116653
|
+
name: "Validation & Compliance",
|
|
116654
|
+
commands: [
|
|
116655
|
+
"check",
|
|
116656
|
+
"validate",
|
|
116657
|
+
"verify",
|
|
116658
|
+
"testing",
|
|
116659
|
+
"compliance",
|
|
116660
|
+
"implementation",
|
|
116661
|
+
"specification",
|
|
116662
|
+
"consensus",
|
|
116663
|
+
"contribution",
|
|
116664
|
+
"decomposition",
|
|
116665
|
+
"backfill"
|
|
116666
|
+
]
|
|
116667
|
+
},
|
|
116668
|
+
{
|
|
116669
|
+
name: "Code & Documentation",
|
|
116670
|
+
commands: ["code", "docs", "detect-drift", "map"]
|
|
116671
|
+
},
|
|
116672
|
+
{
|
|
116673
|
+
name: "Research & Orchestration",
|
|
116674
|
+
commands: ["research", "orchestrate"]
|
|
116675
|
+
},
|
|
116676
|
+
{
|
|
116677
|
+
name: "Import / Export",
|
|
116678
|
+
commands: ["export", "import", "export-tasks", "import-tasks", "snapshot", "inject"]
|
|
116679
|
+
},
|
|
116680
|
+
{
|
|
116681
|
+
name: "Collaboration",
|
|
116682
|
+
commands: ["nexus", "remote", "push", "pull", "checkpoint"]
|
|
116683
|
+
},
|
|
116684
|
+
{
|
|
116685
|
+
name: "Agents",
|
|
116686
|
+
commands: ["agent", "grade"]
|
|
116687
|
+
},
|
|
116688
|
+
{
|
|
116689
|
+
name: "System & Admin",
|
|
116690
|
+
commands: [
|
|
116691
|
+
"version",
|
|
116692
|
+
"init",
|
|
116693
|
+
"config",
|
|
116694
|
+
"env",
|
|
116695
|
+
"admin",
|
|
116696
|
+
"doctor",
|
|
116697
|
+
"upgrade",
|
|
116698
|
+
"self-update",
|
|
116699
|
+
"commands",
|
|
116700
|
+
"ops",
|
|
116701
|
+
"schema",
|
|
116702
|
+
"log",
|
|
116703
|
+
"sequence",
|
|
116704
|
+
"adr",
|
|
116705
|
+
"cant",
|
|
116706
|
+
"token",
|
|
116707
|
+
"otel",
|
|
116708
|
+
"migrate",
|
|
116709
|
+
"detect",
|
|
116710
|
+
"generate-changelog",
|
|
116711
|
+
"issue",
|
|
116712
|
+
"skills",
|
|
116713
|
+
"web",
|
|
116714
|
+
"backup",
|
|
116715
|
+
"restore"
|
|
116716
|
+
]
|
|
116717
|
+
}
|
|
116718
|
+
];
|
|
116719
|
+
function buildAliasMap(shims) {
|
|
116720
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
116721
|
+
for (const shim of shims) {
|
|
116722
|
+
for (const alias of shim._aliases) {
|
|
116723
|
+
map2.set(alias, shim._name);
|
|
116724
|
+
}
|
|
116725
|
+
}
|
|
116726
|
+
for (const [alias, primary] of Object.entries(IMPLICIT_ALIASES)) {
|
|
116727
|
+
map2.set(alias, primary);
|
|
116728
|
+
}
|
|
116729
|
+
return map2;
|
|
116730
|
+
}
|
|
116731
|
+
function getShortDescription(desc7) {
|
|
116732
|
+
if (!desc7) return "";
|
|
116733
|
+
const match = desc7.match(/^Description:\s*(.+)/);
|
|
116734
|
+
if (match) return match[1].trim();
|
|
116735
|
+
const firstLine = desc7.split("\n").find((l) => l.trim().length > 0);
|
|
116736
|
+
return firstLine?.trim() ?? desc7.trim();
|
|
116737
|
+
}
|
|
116738
|
+
function renderGroupedHelp(version2, shims, aliasMap2) {
|
|
116739
|
+
const descMap = /* @__PURE__ */ new Map();
|
|
116740
|
+
for (const shim of shims) {
|
|
116741
|
+
descMap.set(shim._name, getShortDescription(shim._description));
|
|
116742
|
+
}
|
|
116743
|
+
for (const [name2, desc7] of Object.entries(NATIVE_COMMAND_DESCS)) {
|
|
116744
|
+
if (!descMap.has(name2)) {
|
|
116745
|
+
descMap.set(name2, desc7);
|
|
116746
|
+
}
|
|
116747
|
+
}
|
|
116748
|
+
const cmdAliases = /* @__PURE__ */ new Map();
|
|
116749
|
+
for (const [alias, primary] of aliasMap2) {
|
|
116750
|
+
const existing = cmdAliases.get(primary) ?? [];
|
|
116751
|
+
existing.push(alias);
|
|
116752
|
+
cmdAliases.set(primary, existing);
|
|
116753
|
+
}
|
|
116754
|
+
let maxCmdWidth = 0;
|
|
116755
|
+
const allGroupedCmds = COMMAND_GROUPS.flatMap((g2) => g2.commands);
|
|
116756
|
+
const allCmds = [.../* @__PURE__ */ new Set([...allGroupedCmds, ...shims.map((s3) => s3._name), "version"])];
|
|
116757
|
+
for (const cmd of allCmds) {
|
|
116758
|
+
if (!descMap.has(cmd) || aliasMap2.has(cmd)) continue;
|
|
116759
|
+
const aliases = cmdAliases.get(cmd);
|
|
116760
|
+
const display = aliases && aliases.length > 0 ? `${cmd} (${aliases.join(", ")})` : cmd;
|
|
116761
|
+
if (display.length > maxCmdWidth) maxCmdWidth = display.length;
|
|
116762
|
+
}
|
|
116763
|
+
const lines = [];
|
|
116764
|
+
lines.push(gray2(`CLEO V2 - Task management for AI coding agents (cleo v${version2})`));
|
|
116765
|
+
lines.push("");
|
|
116766
|
+
lines.push(`${underline2(bold2("USAGE"))} ${cyan2("cleo <command> [OPTIONS]")}`);
|
|
116767
|
+
lines.push("");
|
|
116768
|
+
const rendered = /* @__PURE__ */ new Set();
|
|
116769
|
+
for (const group of COMMAND_GROUPS) {
|
|
116770
|
+
const groupLines = [];
|
|
116771
|
+
for (const cmd of group.commands) {
|
|
116772
|
+
if (!descMap.has(cmd)) continue;
|
|
116773
|
+
rendered.add(cmd);
|
|
116774
|
+
const aliases = cmdAliases.get(cmd);
|
|
116775
|
+
const display = aliases && aliases.length > 0 ? `${cmd} (${aliases.join(", ")})` : cmd;
|
|
116776
|
+
const desc7 = descMap.get(cmd) ?? "";
|
|
116777
|
+
groupLines.push(` ${cyan2(display.padEnd(maxCmdWidth + 2))}${desc7}`);
|
|
116778
|
+
}
|
|
116779
|
+
if (groupLines.length > 0) {
|
|
116780
|
+
lines.push(underline2(bold2(group.name.toUpperCase())));
|
|
116781
|
+
lines.push(...groupLines);
|
|
116782
|
+
lines.push("");
|
|
116783
|
+
}
|
|
116784
|
+
}
|
|
116785
|
+
const ungrouped = [];
|
|
116786
|
+
for (const shim of shims) {
|
|
116787
|
+
if (!rendered.has(shim._name) && !aliasMap2.has(shim._name)) {
|
|
116788
|
+
ungrouped.push(shim._name);
|
|
116789
|
+
}
|
|
116790
|
+
}
|
|
116791
|
+
if (ungrouped.length > 0) {
|
|
116792
|
+
lines.push(underline2(bold2("OTHER")));
|
|
116793
|
+
for (const cmd of ungrouped) {
|
|
116794
|
+
const aliases = cmdAliases.get(cmd);
|
|
116795
|
+
const display = aliases && aliases.length > 0 ? `${cmd} (${aliases.join(", ")})` : cmd;
|
|
116796
|
+
const desc7 = descMap.get(cmd) ?? "";
|
|
116797
|
+
lines.push(` ${cyan2(display.padEnd(maxCmdWidth + 2))}${desc7}`);
|
|
116798
|
+
}
|
|
116799
|
+
lines.push("");
|
|
116800
|
+
}
|
|
116801
|
+
lines.push(`Use ${cyan2("cleo <command> --help")} for more information about a command.`);
|
|
116802
|
+
return lines.join("\n");
|
|
116803
|
+
}
|
|
116804
|
+
function createCustomShowUsage(version2, shims, aliasMap2) {
|
|
116805
|
+
return async (cmd, parent) => {
|
|
116806
|
+
if (!parent) {
|
|
116807
|
+
const meta3 = await (typeof cmd.meta === "function" ? cmd.meta() : cmd.meta);
|
|
116808
|
+
if (meta3?.name === "cleo") {
|
|
116809
|
+
console.log(renderGroupedHelp(version2, shims, aliasMap2) + "\n");
|
|
116810
|
+
return;
|
|
116811
|
+
}
|
|
116812
|
+
}
|
|
116813
|
+
await showUsage(cmd, parent);
|
|
116814
|
+
};
|
|
116815
|
+
}
|
|
116816
|
+
|
|
116542
116817
|
// packages/cleo/src/cli/middleware/output-format.ts
|
|
116543
116818
|
import { resolveOutputFormat } from "@cleocode/lafs";
|
|
116544
116819
|
function resolveFormat2(opts, defaults) {
|
|
@@ -125287,5 +125562,7 @@ var main = defineCommand({
|
|
|
125287
125562
|
},
|
|
125288
125563
|
subCommands
|
|
125289
125564
|
});
|
|
125290
|
-
|
|
125565
|
+
var aliasMap = buildAliasMap(rootShim._subcommands);
|
|
125566
|
+
var customShowUsage = createCustomShowUsage(CLI_VERSION, rootShim._subcommands, aliasMap);
|
|
125567
|
+
runMain(main, { showUsage: customShowUsage });
|
|
125291
125568
|
//# sourceMappingURL=index.js.map
|