@cleocode/cleo 2026.4.25 → 2026.4.26
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 +306 -94
- package/dist/cli/index.js.map +4 -4
- package/package.json +7 -7
package/dist/cli/index.js
CHANGED
|
@@ -38789,10 +38789,10 @@ async function readProjectMeta(projectPath) {
|
|
|
38789
38789
|
}
|
|
38790
38790
|
async function readProjectId(projectPath) {
|
|
38791
38791
|
try {
|
|
38792
|
-
const { readFileSync:
|
|
38792
|
+
const { readFileSync: readFileSync103, existsSync: existsSync131 } = await import("node:fs");
|
|
38793
38793
|
const infoPath = join64(projectPath, ".cleo", "project-info.json");
|
|
38794
38794
|
if (!existsSync131(infoPath)) return "";
|
|
38795
|
-
const data = JSON.parse(
|
|
38795
|
+
const data = JSON.parse(readFileSync103(infoPath, "utf-8"));
|
|
38796
38796
|
return typeof data.projectId === "string" ? data.projectId : "";
|
|
38797
38797
|
} catch {
|
|
38798
38798
|
return "";
|
|
@@ -75190,6 +75190,7 @@ var init_cleo = __esm({
|
|
|
75190
75190
|
// packages/core/src/index.ts
|
|
75191
75191
|
var init_src2 = __esm({
|
|
75192
75192
|
"packages/core/src/index.ts"() {
|
|
75193
|
+
"use strict";
|
|
75193
75194
|
init_src();
|
|
75194
75195
|
init_adapters();
|
|
75195
75196
|
init_admin();
|
|
@@ -102133,6 +102134,30 @@ var init_registry5 = __esm({
|
|
|
102133
102134
|
sessionRequired: false,
|
|
102134
102135
|
requiredParams: []
|
|
102135
102136
|
},
|
|
102137
|
+
{
|
|
102138
|
+
gateway: "query",
|
|
102139
|
+
domain: "admin",
|
|
102140
|
+
operation: "roadmap",
|
|
102141
|
+
description: "admin.roadmap (query) \u2014 project roadmap from task provenance, epics grouped by status with progress",
|
|
102142
|
+
tier: 1,
|
|
102143
|
+
idempotent: true,
|
|
102144
|
+
sessionRequired: false,
|
|
102145
|
+
requiredParams: [],
|
|
102146
|
+
params: [
|
|
102147
|
+
{
|
|
102148
|
+
name: "includeHistory",
|
|
102149
|
+
type: "boolean",
|
|
102150
|
+
required: false,
|
|
102151
|
+
description: "Include release history from CHANGELOG.md"
|
|
102152
|
+
},
|
|
102153
|
+
{
|
|
102154
|
+
name: "upcomingOnly",
|
|
102155
|
+
type: "boolean",
|
|
102156
|
+
required: false,
|
|
102157
|
+
description: "Only show pending/upcoming epics (exclude completed)"
|
|
102158
|
+
}
|
|
102159
|
+
]
|
|
102160
|
+
},
|
|
102136
102161
|
{
|
|
102137
102162
|
gateway: "query",
|
|
102138
102163
|
domain: "admin",
|
|
@@ -109397,6 +109422,13 @@ var init_admin2 = __esm({
|
|
|
109397
109422
|
});
|
|
109398
109423
|
return wrapResult(result, "query", "admin", operation, startTime);
|
|
109399
109424
|
}
|
|
109425
|
+
case "roadmap": {
|
|
109426
|
+
const result = await systemRoadmap(projectRoot, {
|
|
109427
|
+
includeHistory: params?.includeHistory,
|
|
109428
|
+
upcomingOnly: params?.upcomingOnly
|
|
109429
|
+
});
|
|
109430
|
+
return wrapResult(result, "query", "admin", operation, startTime);
|
|
109431
|
+
}
|
|
109400
109432
|
case "smoke": {
|
|
109401
109433
|
const result = await systemSmoke();
|
|
109402
109434
|
return wrapResult(result, "query", "admin", operation, startTime);
|
|
@@ -109897,6 +109929,7 @@ var init_admin2 = __esm({
|
|
|
109897
109929
|
"backup",
|
|
109898
109930
|
"export",
|
|
109899
109931
|
"map",
|
|
109932
|
+
"roadmap",
|
|
109900
109933
|
"smoke",
|
|
109901
109934
|
"hooks.matrix"
|
|
109902
109935
|
],
|
|
@@ -111707,7 +111740,7 @@ var init_nexus2 = __esm({
|
|
|
111707
111740
|
async function orchestrateClassify(request, context, projectRoot) {
|
|
111708
111741
|
try {
|
|
111709
111742
|
const { getCleoCantWorkflowsDir: getCleoCantWorkflowsDir2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
|
|
111710
|
-
const { readFileSync:
|
|
111743
|
+
const { readFileSync: readFileSync103, readdirSync: readdirSync42, existsSync: existsSync131 } = await import("node:fs");
|
|
111711
111744
|
const { join: join131 } = await import("node:path");
|
|
111712
111745
|
const workflowsDir = getCleoCantWorkflowsDir2();
|
|
111713
111746
|
const combined = `${request} ${context ?? ""}`.toLowerCase();
|
|
@@ -111716,7 +111749,7 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
111716
111749
|
const files = readdirSync42(workflowsDir).filter((f2) => f2.endsWith(".cant"));
|
|
111717
111750
|
for (const file2 of files) {
|
|
111718
111751
|
try {
|
|
111719
|
-
const src =
|
|
111752
|
+
const src = readFileSync103(join131(workflowsDir, file2), "utf-8");
|
|
111720
111753
|
const teamMatch = /^team\s+(\S+):/m.exec(src);
|
|
111721
111754
|
if (!teamMatch) continue;
|
|
111722
111755
|
const teamName = teamMatch[1];
|
|
@@ -111736,7 +111769,7 @@ async function orchestrateClassify(request, context, projectRoot) {
|
|
|
111736
111769
|
const files = readdirSync42(localCantDir).filter((f2) => f2.endsWith(".cant"));
|
|
111737
111770
|
for (const file2 of files) {
|
|
111738
111771
|
try {
|
|
111739
|
-
const src =
|
|
111772
|
+
const src = readFileSync103(join131(localCantDir, file2), "utf-8");
|
|
111740
111773
|
const teamMatch = /^team\s+(\S+):/m.exec(src);
|
|
111741
111774
|
if (!teamMatch) continue;
|
|
111742
111775
|
const teamName = teamMatch[1];
|
|
@@ -116276,7 +116309,7 @@ var init_cli = __esm({
|
|
|
116276
116309
|
|
|
116277
116310
|
// packages/cleo/src/cli/index.ts
|
|
116278
116311
|
init_internal();
|
|
116279
|
-
import { readFileSync as
|
|
116312
|
+
import { readFileSync as readFileSync102 } from "node:fs";
|
|
116280
116313
|
import { dirname as dirname28, join as join130 } from "node:path";
|
|
116281
116314
|
import { fileURLToPath as fileURLToPath5 } from "node:url";
|
|
116282
116315
|
|
|
@@ -117619,6 +117652,13 @@ function registerAdminCommand(program) {
|
|
|
117619
117652
|
admin.command("context-inject <protocolType>").description(
|
|
117620
117653
|
"Inject protocol content into session context (e.g. cleo-base, ct-orchestrator, ct-cleo)"
|
|
117621
117654
|
).option("--task <id>", "Scope injection to a specific task ID").option("--variant <variant>", "Select a named protocol variant").action(async (protocolType, opts) => {
|
|
117655
|
+
if (!protocolType || typeof protocolType !== "string" || protocolType.trim() === "") {
|
|
117656
|
+
console.error("Error: missing required argument <protocolType>");
|
|
117657
|
+
console.error(
|
|
117658
|
+
"Usage: cleo admin context-inject <protocolType> [--task <id>] [--variant <variant>]"
|
|
117659
|
+
);
|
|
117660
|
+
process.exit(1);
|
|
117661
|
+
}
|
|
117622
117662
|
await dispatchFromCli(
|
|
117623
117663
|
"mutate",
|
|
117624
117664
|
"admin",
|
|
@@ -117873,7 +117913,7 @@ agent ${agentId}:
|
|
|
117873
117913
|
try {
|
|
117874
117914
|
const { AgentRegistryAccessor: AgentRegistryAccessor2, getDb: getDb4 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
|
|
117875
117915
|
const { createRuntime } = await import("@cleocode/runtime");
|
|
117876
|
-
const { existsSync: existsSync131, readFileSync:
|
|
117916
|
+
const { existsSync: existsSync131, readFileSync: readFileSync103 } = await import("node:fs");
|
|
117877
117917
|
const { join: join131 } = await import("node:path");
|
|
117878
117918
|
await getDb4();
|
|
117879
117919
|
const registry2 = new AgentRegistryAccessor2(process.cwd());
|
|
@@ -117896,7 +117936,7 @@ agent ${agentId}:
|
|
|
117896
117936
|
let cantValidation = null;
|
|
117897
117937
|
const cantPath = opts["cant"] ?? join131(".cleo", "agents", `${agentId}.cant`);
|
|
117898
117938
|
if (existsSync131(cantPath)) {
|
|
117899
|
-
profile =
|
|
117939
|
+
profile = readFileSync103(cantPath, "utf-8");
|
|
117900
117940
|
try {
|
|
117901
117941
|
const cantModule = await import("@cleocode/cant");
|
|
117902
117942
|
const validate = "validate" in cantModule ? cantModule.validate : null;
|
|
@@ -118936,7 +118976,7 @@ Task ${taskId} reassigned to you by ${active.agentId}. Run: cleo show ${taskId}
|
|
|
118936
118976
|
});
|
|
118937
118977
|
agent.command("install <path>").description("Install an agent from a .cantz archive or agent directory").option("--global", "Install to global tier (~/.local/share/cleo/cant/agents/)").action(async (sourcePath, opts) => {
|
|
118938
118978
|
try {
|
|
118939
|
-
const { existsSync: existsSync131, mkdirSync: mkdirSync31, cpSync, readFileSync:
|
|
118979
|
+
const { existsSync: existsSync131, mkdirSync: mkdirSync31, cpSync, readFileSync: readFileSync103, rmSync: rmSync3, statSync: statSync22 } = await import("node:fs");
|
|
118940
118980
|
const { join: join131, basename: basename19, resolve: resolve16 } = await import("node:path");
|
|
118941
118981
|
const { homedir: homedir7 } = await import("node:os");
|
|
118942
118982
|
const { tmpdir: tmpdir3 } = await import("node:os");
|
|
@@ -119055,7 +119095,7 @@ Task ${taskId} reassigned to you by ${active.agentId}. Run: cleo show ${taskId}
|
|
|
119055
119095
|
}
|
|
119056
119096
|
let registered = false;
|
|
119057
119097
|
try {
|
|
119058
|
-
const persona =
|
|
119098
|
+
const persona = readFileSync103(join131(targetDir, "persona.cant"), "utf-8");
|
|
119059
119099
|
const descMatch = persona.match(/description:\s*"([^"]+)"/);
|
|
119060
119100
|
const displayName = descMatch?.[1] ?? agentName;
|
|
119061
119101
|
const { AgentRegistryAccessor: AgentRegistryAccessor2, getDb: getDb4 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
|
|
@@ -120840,6 +120880,47 @@ async function loadMigrateEngine() {
|
|
|
120840
120880
|
throw new Error("Cannot load CANT migration engine. Ensure @cleocode/cant is installed.");
|
|
120841
120881
|
}
|
|
120842
120882
|
|
|
120883
|
+
// packages/cleo/src/cli/commands/chain.ts
|
|
120884
|
+
init_cli();
|
|
120885
|
+
import { readFileSync as readFileSync98 } from "node:fs";
|
|
120886
|
+
function registerChainCommand(program) {
|
|
120887
|
+
const chain = program.command("chain").description("WarpChain pipeline management (tier-2 orchestrator)");
|
|
120888
|
+
chain.command("show <chainId>").description("Show details for a WarpChain definition").action(async (chainId) => {
|
|
120889
|
+
await dispatchFromCli("query", "pipeline", "chain.show", { chainId }, { command: "chain" });
|
|
120890
|
+
});
|
|
120891
|
+
chain.command("list").description("List all WarpChain definitions").action(async () => {
|
|
120892
|
+
await dispatchFromCli("query", "pipeline", "chain.list", {}, { command: "chain" });
|
|
120893
|
+
});
|
|
120894
|
+
chain.command("add <file>").description("Add a new WarpChain definition from a JSON file").action(async (file2) => {
|
|
120895
|
+
const chainJson = JSON.parse(readFileSync98(file2, "utf-8"));
|
|
120896
|
+
await dispatchFromCli(
|
|
120897
|
+
"mutate",
|
|
120898
|
+
"pipeline",
|
|
120899
|
+
"chain.add",
|
|
120900
|
+
{ chain: chainJson },
|
|
120901
|
+
{ command: "chain" }
|
|
120902
|
+
);
|
|
120903
|
+
});
|
|
120904
|
+
chain.command("instantiate <chainId> <epicId>").description("Instantiate a WarpChain for an epic").action(async (chainId, epicId) => {
|
|
120905
|
+
await dispatchFromCli(
|
|
120906
|
+
"mutate",
|
|
120907
|
+
"pipeline",
|
|
120908
|
+
"chain.instantiate",
|
|
120909
|
+
{ chainId, epicId },
|
|
120910
|
+
{ command: "chain" }
|
|
120911
|
+
);
|
|
120912
|
+
});
|
|
120913
|
+
chain.command("advance <instanceId> <nextStage>").description("Advance a WarpChain instance to the next stage").action(async (instanceId, nextStage) => {
|
|
120914
|
+
await dispatchFromCli(
|
|
120915
|
+
"mutate",
|
|
120916
|
+
"pipeline",
|
|
120917
|
+
"chain.advance",
|
|
120918
|
+
{ instanceId, nextStage },
|
|
120919
|
+
{ command: "chain" }
|
|
120920
|
+
);
|
|
120921
|
+
});
|
|
120922
|
+
}
|
|
120923
|
+
|
|
120843
120924
|
// packages/cleo/src/cli/commands/check.ts
|
|
120844
120925
|
init_cli();
|
|
120845
120926
|
var SUPPORTED_PROTOCOL_TYPES = [
|
|
@@ -120880,10 +120961,10 @@ function registerCheckCommand(program) {
|
|
|
120880
120961
|
);
|
|
120881
120962
|
});
|
|
120882
120963
|
check2.command("chain-validate <file>").description("Validate a WarpChain definition from a JSON file").action(async (file2) => {
|
|
120883
|
-
const { readFileSync:
|
|
120964
|
+
const { readFileSync: readFileSync103 } = await import("node:fs");
|
|
120884
120965
|
let chain;
|
|
120885
120966
|
try {
|
|
120886
|
-
chain = JSON.parse(
|
|
120967
|
+
chain = JSON.parse(readFileSync103(file2, "utf8"));
|
|
120887
120968
|
} catch (err) {
|
|
120888
120969
|
const message = err instanceof Error ? err.message : String(err);
|
|
120889
120970
|
console.error(`Failed to read or parse chain file: ${message}`);
|
|
@@ -121057,7 +121138,7 @@ function registerClaimCommand(program) {
|
|
|
121057
121138
|
"tasks",
|
|
121058
121139
|
"claim",
|
|
121059
121140
|
{
|
|
121060
|
-
taskId,
|
|
121141
|
+
id: taskId,
|
|
121061
121142
|
agentId: opts["agent"]
|
|
121062
121143
|
},
|
|
121063
121144
|
{ command: "claim", operation: "tasks.claim" }
|
|
@@ -121070,7 +121151,7 @@ function registerUnclaimCommand(program) {
|
|
|
121070
121151
|
"mutate",
|
|
121071
121152
|
"tasks",
|
|
121072
121153
|
"unclaim",
|
|
121073
|
-
{ taskId },
|
|
121154
|
+
{ id: taskId },
|
|
121074
121155
|
{ command: "unclaim", operation: "tasks.unclaim" }
|
|
121075
121156
|
);
|
|
121076
121157
|
});
|
|
@@ -121571,7 +121652,7 @@ function registerDepsCommand(program) {
|
|
|
121571
121652
|
{
|
|
121572
121653
|
epicId
|
|
121573
121654
|
},
|
|
121574
|
-
{ command: "deps", operation: "
|
|
121655
|
+
{ command: "deps", operation: "orchestrate.waves" }
|
|
121575
121656
|
);
|
|
121576
121657
|
});
|
|
121577
121658
|
deps.command("critical-path <taskId>").description("Find longest dependency chain from task").action(async (taskId) => {
|
|
@@ -121641,7 +121722,7 @@ function registerDetectCommand(program) {
|
|
|
121641
121722
|
// packages/cleo/src/cli/commands/detect-drift.ts
|
|
121642
121723
|
init_src();
|
|
121643
121724
|
init_renderers();
|
|
121644
|
-
import { existsSync as existsSync129, readdirSync as readdirSync41, readFileSync as
|
|
121725
|
+
import { existsSync as existsSync129, readdirSync as readdirSync41, readFileSync as readFileSync99 } from "node:fs";
|
|
121645
121726
|
import { dirname as dirname26, join as join125 } from "node:path";
|
|
121646
121727
|
function findProjectRoot() {
|
|
121647
121728
|
let currentDir = process.cwd();
|
|
@@ -121661,7 +121742,7 @@ function registerDetectDriftCommand(program) {
|
|
|
121661
121742
|
const isCleoRepo = existsSync129(join125(projectRoot, "src", "cli", "commands")) || existsSync129(join125(projectRoot, "packages", "cleo", "src"));
|
|
121662
121743
|
const safeRead = (filePath) => {
|
|
121663
121744
|
try {
|
|
121664
|
-
return
|
|
121745
|
+
return readFileSync99(filePath, "utf-8");
|
|
121665
121746
|
} catch {
|
|
121666
121747
|
return "";
|
|
121667
121748
|
}
|
|
@@ -122396,27 +122477,6 @@ function registerDoctorCommand(program) {
|
|
|
122396
122477
|
});
|
|
122397
122478
|
}
|
|
122398
122479
|
|
|
122399
|
-
// packages/cleo/src/cli/commands/env.ts
|
|
122400
|
-
init_internal();
|
|
122401
|
-
init_renderers();
|
|
122402
|
-
async function getEnvStatus() {
|
|
122403
|
-
return getRuntimeDiagnostics({ detailed: false });
|
|
122404
|
-
}
|
|
122405
|
-
async function getEnvInfo() {
|
|
122406
|
-
return getRuntimeDiagnostics({ detailed: true });
|
|
122407
|
-
}
|
|
122408
|
-
function registerEnvCommand(program) {
|
|
122409
|
-
const env = program.command("env").description("Environment and mode inspection");
|
|
122410
|
-
env.command("status", { isDefault: true }).description("Show current environment mode and runtime info").action(async () => {
|
|
122411
|
-
const result = await getEnvStatus();
|
|
122412
|
-
cliOutput(result, { command: "env" });
|
|
122413
|
-
});
|
|
122414
|
-
env.command("info").description("Show detailed environment info including binary paths and compilation status").action(async () => {
|
|
122415
|
-
const result = await getEnvInfo();
|
|
122416
|
-
cliOutput(result, { command: "env" });
|
|
122417
|
-
});
|
|
122418
|
-
}
|
|
122419
|
-
|
|
122420
122480
|
// packages/cleo/src/cli/commands/exists.ts
|
|
122421
122481
|
init_src();
|
|
122422
122482
|
init_internal();
|
|
@@ -122641,12 +122701,12 @@ init_src();
|
|
|
122641
122701
|
init_src2();
|
|
122642
122702
|
init_renderers();
|
|
122643
122703
|
import { execFileSync as execFileSync16 } from "node:child_process";
|
|
122644
|
-
import { existsSync as existsSync130, mkdirSync as mkdirSync30, readFileSync as
|
|
122704
|
+
import { existsSync as existsSync130, mkdirSync as mkdirSync30, readFileSync as readFileSync100, writeFileSync as writeFileSync24 } from "node:fs";
|
|
122645
122705
|
import { dirname as dirname27, join as join127 } from "node:path";
|
|
122646
122706
|
function getChangelogSource(cwd) {
|
|
122647
122707
|
const configPath = getConfigPath(cwd);
|
|
122648
122708
|
try {
|
|
122649
|
-
const config2 = JSON.parse(
|
|
122709
|
+
const config2 = JSON.parse(readFileSync100(configPath, "utf-8"));
|
|
122650
122710
|
return config2?.release?.changelog?.source ?? "CHANGELOG.md";
|
|
122651
122711
|
} catch {
|
|
122652
122712
|
return "CHANGELOG.md";
|
|
@@ -122655,7 +122715,7 @@ function getChangelogSource(cwd) {
|
|
|
122655
122715
|
function getEnabledPlatforms(cwd) {
|
|
122656
122716
|
const configPath = getConfigPath(cwd);
|
|
122657
122717
|
try {
|
|
122658
|
-
const config2 = JSON.parse(
|
|
122718
|
+
const config2 = JSON.parse(readFileSync100(configPath, "utf-8"));
|
|
122659
122719
|
const outputs = config2?.release?.changelog?.outputs ?? [];
|
|
122660
122720
|
return outputs.filter((o) => o.enabled);
|
|
122661
122721
|
} catch {
|
|
@@ -122784,7 +122844,7 @@ function registerGenerateChangelogCommand(program) {
|
|
|
122784
122844
|
if (!existsSync130(sourcePath)) {
|
|
122785
122845
|
throw new CleoError(4 /* NOT_FOUND */, `Changelog source not found: ${sourcePath}`);
|
|
122786
122846
|
}
|
|
122787
|
-
const sourceContent =
|
|
122847
|
+
const sourceContent = readFileSync100(sourcePath, "utf-8");
|
|
122788
122848
|
const repoSlug = getGitHubRepoSlug();
|
|
122789
122849
|
const results = [];
|
|
122790
122850
|
if (targetPlatform) {
|
|
@@ -123476,9 +123536,20 @@ function registerMemoryBrainCommand(program) {
|
|
|
123476
123536
|
}
|
|
123477
123537
|
cliOutput(result, { command: "memory", operation: "memory.stats" });
|
|
123478
123538
|
});
|
|
123479
|
-
memory.command("observe <text>").description(
|
|
123539
|
+
memory.command("observe <text>").description(
|
|
123540
|
+
"Save an observation to brain.db \u2014 captures facts, decisions, and discoveries for cross-session memory"
|
|
123541
|
+
).option(
|
|
123542
|
+
"--title <title>",
|
|
123543
|
+
"Short title for the observation (defaults to first 120 chars of text)"
|
|
123544
|
+
).option(
|
|
123545
|
+
"--type <type>",
|
|
123546
|
+
"Category: discovery (found something new), decision (choice made), bugfix (bug found/fixed), refactor (code restructured), feature (feature added), change (general change), pattern (recurring pattern), session_summary (end-of-session recap)"
|
|
123547
|
+
).option(
|
|
123480
123548
|
"--agent <name>",
|
|
123481
|
-
"
|
|
123549
|
+
"Name of the agent producing this observation (enables per-agent memory retrieval)"
|
|
123550
|
+
).option(
|
|
123551
|
+
"--source-type <sourceType>",
|
|
123552
|
+
"How this observation was captured: manual (typed by human/agent), auto (lifecycle hook), transcript (extracted from session)"
|
|
123482
123553
|
).action(async (text3, opts) => {
|
|
123483
123554
|
await dispatchFromCli(
|
|
123484
123555
|
"mutate",
|
|
@@ -123487,7 +123558,9 @@ function registerMemoryBrainCommand(program) {
|
|
|
123487
123558
|
{
|
|
123488
123559
|
text: text3,
|
|
123489
123560
|
title: opts["title"],
|
|
123490
|
-
...opts["agent"] !== void 0 && { agent: opts["agent"] }
|
|
123561
|
+
...opts["agent"] !== void 0 && { agent: opts["agent"] },
|
|
123562
|
+
...opts["type"] !== void 0 && { type: opts["type"] },
|
|
123563
|
+
sourceType: opts["sourceType"] ?? "manual"
|
|
123491
123564
|
},
|
|
123492
123565
|
{ command: "memory", operation: "memory.observe" }
|
|
123493
123566
|
);
|
|
@@ -123515,7 +123588,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123515
123588
|
{ command: "memory", operation: "memory.fetch" }
|
|
123516
123589
|
);
|
|
123517
123590
|
});
|
|
123518
|
-
memory.command("decision
|
|
123591
|
+
memory.command("decision-find [query]").description("Search decisions stored in brain.db").option("--limit <n>", "Maximum results", parseInt).option("--json", "Output as JSON").action(async (query, opts) => {
|
|
123519
123592
|
await dispatchFromCli(
|
|
123520
123593
|
"query",
|
|
123521
123594
|
"memory",
|
|
@@ -123527,7 +123600,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123527
123600
|
{ command: "memory", operation: "memory.decision.find" }
|
|
123528
123601
|
);
|
|
123529
123602
|
});
|
|
123530
|
-
memory.command("decision
|
|
123603
|
+
memory.command("decision-store").description("Store a decision to brain.db").requiredOption("--decision <text>", "The decision that was made").requiredOption("--rationale <text>", "Rationale behind the decision").option("--alternatives <text>", "Alternatives that were considered").option("--linked-task <id>", "Task ID to associate with this decision").option("--json", "Output as JSON").action(async (opts) => {
|
|
123531
123604
|
await dispatchFromCli(
|
|
123532
123605
|
"mutate",
|
|
123533
123606
|
"memory",
|
|
@@ -123550,7 +123623,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123550
123623
|
{ command: "memory", operation: "memory.link" }
|
|
123551
123624
|
);
|
|
123552
123625
|
});
|
|
123553
|
-
memory.command("graph
|
|
123626
|
+
memory.command("graph-show <nodeId>").description("Get a PageIndex graph node and its edges").option("--json", "Output as JSON").action(async (nodeId, _opts) => {
|
|
123554
123627
|
await dispatchFromCli(
|
|
123555
123628
|
"query",
|
|
123556
123629
|
"memory",
|
|
@@ -123559,7 +123632,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123559
123632
|
{ command: "memory", operation: "memory.graph.show" }
|
|
123560
123633
|
);
|
|
123561
123634
|
});
|
|
123562
|
-
memory.command("graph
|
|
123635
|
+
memory.command("graph-neighbors <nodeId>").description("Get neighbor nodes from the PageIndex graph").option("--depth <n>", "Traversal depth", parseInt).option("--limit <n>", "Maximum neighbors", parseInt).option("--json", "Output as JSON").action(async (nodeId, opts) => {
|
|
123563
123636
|
await dispatchFromCli(
|
|
123564
123637
|
"query",
|
|
123565
123638
|
"memory",
|
|
@@ -123572,7 +123645,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123572
123645
|
{ command: "memory", operation: "memory.graph.neighbors" }
|
|
123573
123646
|
);
|
|
123574
123647
|
});
|
|
123575
|
-
memory.command("graph
|
|
123648
|
+
memory.command("graph-add").description("Add a node or edge to the PageIndex graph").option("--node-id <id>", "Node ID to add").option("--label <text>", "Label for the node").option("--from <id>", "Source node ID for an edge").option("--to <id>", "Target node ID for an edge").option("--edge-type <type>", "Edge relationship type").option("--json", "Output as JSON").action(async (opts) => {
|
|
123576
123649
|
await dispatchFromCli(
|
|
123577
123650
|
"mutate",
|
|
123578
123651
|
"memory",
|
|
@@ -123587,7 +123660,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123587
123660
|
{ command: "memory", operation: "memory.graph.add" }
|
|
123588
123661
|
);
|
|
123589
123662
|
});
|
|
123590
|
-
memory.command("graph
|
|
123663
|
+
memory.command("graph-remove").description("Remove a node or edge from the PageIndex graph").option("--node-id <id>", "Node ID to remove").option("--from <id>", "Source node ID of the edge to remove").option("--to <id>", "Target node ID of the edge to remove").option("--json", "Output as JSON").action(async (opts) => {
|
|
123591
123664
|
await dispatchFromCli(
|
|
123592
123665
|
"mutate",
|
|
123593
123666
|
"memory",
|
|
@@ -123600,7 +123673,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123600
123673
|
{ command: "memory", operation: "memory.graph.remove" }
|
|
123601
123674
|
);
|
|
123602
123675
|
});
|
|
123603
|
-
memory.command("reason
|
|
123676
|
+
memory.command("reason-why <taskId>").description("Causal trace through task dependency chains").option("--depth <n>", "Maximum trace depth", parseInt).option("--json", "Output as JSON").action(async (taskId, opts) => {
|
|
123604
123677
|
await dispatchFromCli(
|
|
123605
123678
|
"query",
|
|
123606
123679
|
"memory",
|
|
@@ -123612,7 +123685,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123612
123685
|
{ command: "memory", operation: "memory.reason.why" }
|
|
123613
123686
|
);
|
|
123614
123687
|
});
|
|
123615
|
-
memory.command("reason
|
|
123688
|
+
memory.command("reason-similar <entryId>").description("Find semantically similar brain entries").option("--limit <n>", "Maximum results", parseInt).option("--json", "Output as JSON").action(async (entryId, opts) => {
|
|
123616
123689
|
await dispatchFromCli(
|
|
123617
123690
|
"query",
|
|
123618
123691
|
"memory",
|
|
@@ -123624,7 +123697,7 @@ function registerMemoryBrainCommand(program) {
|
|
|
123624
123697
|
{ command: "memory", operation: "memory.reason.similar" }
|
|
123625
123698
|
);
|
|
123626
123699
|
});
|
|
123627
|
-
memory.command("search
|
|
123700
|
+
memory.command("search-hybrid <query>").description("Hybrid search across FTS5, vector, and graph indexes").option("--limit <n>", "Maximum results", parseInt).option("--json", "Output as JSON").action(async (query, opts) => {
|
|
123628
123701
|
await dispatchFromCli(
|
|
123629
123702
|
"query",
|
|
123630
123703
|
"memory",
|
|
@@ -123919,23 +123992,37 @@ function registerNexusCommand(program) {
|
|
|
123919
123992
|
// packages/cleo/src/cli/commands/observe.ts
|
|
123920
123993
|
init_cli();
|
|
123921
123994
|
function registerObserveCommand(program) {
|
|
123922
|
-
program.command("observe <text>").description(
|
|
123995
|
+
program.command("observe <text>").description(
|
|
123996
|
+
"Save an observation to brain.db \u2014 captures facts, decisions, and discoveries for cross-session memory"
|
|
123997
|
+
).option(
|
|
123998
|
+
"-t, --title <title>",
|
|
123999
|
+
"Short title for the observation (defaults to first 120 chars of text)"
|
|
124000
|
+
).option(
|
|
123923
124001
|
"--type <type>",
|
|
123924
|
-
"
|
|
123925
|
-
).
|
|
123926
|
-
|
|
123927
|
-
|
|
123928
|
-
|
|
123929
|
-
|
|
123930
|
-
|
|
123931
|
-
|
|
123932
|
-
|
|
123933
|
-
|
|
123934
|
-
|
|
123935
|
-
|
|
123936
|
-
|
|
123937
|
-
|
|
123938
|
-
|
|
124002
|
+
"Category: discovery (found something new), decision (choice made), bugfix (bug found/fixed), refactor (code restructured), feature (feature added), change (general change), pattern (recurring pattern), session_summary (end-of-session recap)"
|
|
124003
|
+
).option(
|
|
124004
|
+
"--agent <name>",
|
|
124005
|
+
"Name of the agent producing this observation (enables per-agent memory retrieval)"
|
|
124006
|
+
).option(
|
|
124007
|
+
"--source-type <sourceType>",
|
|
124008
|
+
"How this observation was captured: manual (typed by human/agent), auto (lifecycle hook), transcript (extracted from session)"
|
|
124009
|
+
).action(
|
|
124010
|
+
async (text3, opts) => {
|
|
124011
|
+
await dispatchFromCli(
|
|
124012
|
+
"mutate",
|
|
124013
|
+
"memory",
|
|
124014
|
+
"observe",
|
|
124015
|
+
{
|
|
124016
|
+
text: text3,
|
|
124017
|
+
title: opts.title,
|
|
124018
|
+
...opts.type !== void 0 && { type: opts.type },
|
|
124019
|
+
...opts.agent !== void 0 && { agent: opts.agent },
|
|
124020
|
+
sourceType: opts.sourceType ?? "manual"
|
|
124021
|
+
},
|
|
124022
|
+
{ command: "observe", operation: "memory.observe" }
|
|
124023
|
+
);
|
|
124024
|
+
}
|
|
124025
|
+
);
|
|
123939
124026
|
}
|
|
123940
124027
|
|
|
123941
124028
|
// packages/cleo/src/cli/commands/ops.ts
|
|
@@ -124079,6 +124166,110 @@ function registerOrchestrateCommand(program) {
|
|
|
124079
124166
|
{ command: "orchestrate" }
|
|
124080
124167
|
);
|
|
124081
124168
|
});
|
|
124169
|
+
orch.command("bootstrap").description("Load brain state for agent bootstrapping").option("--epic <epicId>", "Epic ID to scope bootstrap context to").action(async (opts) => {
|
|
124170
|
+
await dispatchFromCli(
|
|
124171
|
+
"query",
|
|
124172
|
+
"orchestrate",
|
|
124173
|
+
"bootstrap",
|
|
124174
|
+
{ epicId: opts["epic"] },
|
|
124175
|
+
{ command: "orchestrate" }
|
|
124176
|
+
);
|
|
124177
|
+
});
|
|
124178
|
+
orch.command("classify <request>").description("Classify a request using CANT prompt-based team routing").action(async (request) => {
|
|
124179
|
+
await dispatchFromCli(
|
|
124180
|
+
"query",
|
|
124181
|
+
"orchestrate",
|
|
124182
|
+
"classify",
|
|
124183
|
+
{ request },
|
|
124184
|
+
{ command: "orchestrate" }
|
|
124185
|
+
);
|
|
124186
|
+
});
|
|
124187
|
+
orch.command("fanout-status").description("Get fanout status for an epic").option("--epic <epicId>", "Epic ID to scope fanout status to").action(async (opts) => {
|
|
124188
|
+
await dispatchFromCli(
|
|
124189
|
+
"query",
|
|
124190
|
+
"orchestrate",
|
|
124191
|
+
"fanout.status",
|
|
124192
|
+
{ epicId: opts["epic"] },
|
|
124193
|
+
{ command: "orchestrate" }
|
|
124194
|
+
);
|
|
124195
|
+
});
|
|
124196
|
+
orch.command("handoff <taskId>").description("Perform session handoff and spawn successor for a task").requiredOption("--protocol <type>", "Protocol type for handoff").action(async (taskId, opts) => {
|
|
124197
|
+
await dispatchFromCli(
|
|
124198
|
+
"mutate",
|
|
124199
|
+
"orchestrate",
|
|
124200
|
+
"handoff",
|
|
124201
|
+
{ taskId, protocolType: opts["protocol"] },
|
|
124202
|
+
{ command: "orchestrate" }
|
|
124203
|
+
);
|
|
124204
|
+
});
|
|
124205
|
+
orch.command("spawn-execute <taskId>").description("Execute spawn for a task via the adapter registry").action(async (taskId) => {
|
|
124206
|
+
await dispatchFromCli(
|
|
124207
|
+
"mutate",
|
|
124208
|
+
"orchestrate",
|
|
124209
|
+
"spawn.execute",
|
|
124210
|
+
{ taskId },
|
|
124211
|
+
{ command: "orchestrate" }
|
|
124212
|
+
);
|
|
124213
|
+
});
|
|
124214
|
+
orch.command("fanout <epicId>").description("Fan out tasks for an epic using parallel spawn").option("--tasks <ids>", "Comma-separated task IDs to fan out").action(async (epicId, opts) => {
|
|
124215
|
+
const taskIds = typeof opts["tasks"] === "string" ? opts["tasks"].split(",").map((s3) => s3.trim()) : void 0;
|
|
124216
|
+
await dispatchFromCli(
|
|
124217
|
+
"mutate",
|
|
124218
|
+
"orchestrate",
|
|
124219
|
+
"fanout",
|
|
124220
|
+
{ epicId, taskIds },
|
|
124221
|
+
{ command: "orchestrate" }
|
|
124222
|
+
);
|
|
124223
|
+
});
|
|
124224
|
+
orch.command("conduit-status").description("Get conduit messaging status").action(async () => {
|
|
124225
|
+
await dispatchFromCli(
|
|
124226
|
+
"query",
|
|
124227
|
+
"orchestrate",
|
|
124228
|
+
"conduit.status",
|
|
124229
|
+
{},
|
|
124230
|
+
{ command: "orchestrate" }
|
|
124231
|
+
);
|
|
124232
|
+
});
|
|
124233
|
+
orch.command("conduit-peek").description("Peek at queued conduit messages").option("--limit <n>", "Maximum number of messages to return", parseInt).action(async (opts) => {
|
|
124234
|
+
await dispatchFromCli(
|
|
124235
|
+
"query",
|
|
124236
|
+
"orchestrate",
|
|
124237
|
+
"conduit.peek",
|
|
124238
|
+
{ limit: opts["limit"] },
|
|
124239
|
+
{ command: "orchestrate" }
|
|
124240
|
+
);
|
|
124241
|
+
});
|
|
124242
|
+
orch.command("conduit-start").description("Start the conduit message loop").option("--poll-interval <ms>", "Polling interval in milliseconds", parseInt).action(async (opts) => {
|
|
124243
|
+
await dispatchFromCli(
|
|
124244
|
+
"mutate",
|
|
124245
|
+
"orchestrate",
|
|
124246
|
+
"conduit.start",
|
|
124247
|
+
{ pollInterval: opts["pollInterval"] },
|
|
124248
|
+
{ command: "orchestrate" }
|
|
124249
|
+
);
|
|
124250
|
+
});
|
|
124251
|
+
orch.command("conduit-stop").description("Stop the conduit message loop").action(async () => {
|
|
124252
|
+
await dispatchFromCli(
|
|
124253
|
+
"mutate",
|
|
124254
|
+
"orchestrate",
|
|
124255
|
+
"conduit.stop",
|
|
124256
|
+
{},
|
|
124257
|
+
{ command: "orchestrate" }
|
|
124258
|
+
);
|
|
124259
|
+
});
|
|
124260
|
+
orch.command("conduit-send <content>").description("Send a message via conduit to an agent or conversation").option("--to <agentId>", "Target agent ID").option("--conversation <id>", "Conversation ID to send into").action(async (content, opts) => {
|
|
124261
|
+
await dispatchFromCli(
|
|
124262
|
+
"mutate",
|
|
124263
|
+
"orchestrate",
|
|
124264
|
+
"conduit.send",
|
|
124265
|
+
{
|
|
124266
|
+
content,
|
|
124267
|
+
agentId: opts["to"],
|
|
124268
|
+
conversationId: opts["conversation"]
|
|
124269
|
+
},
|
|
124270
|
+
{ command: "orchestrate" }
|
|
124271
|
+
);
|
|
124272
|
+
});
|
|
124082
124273
|
}
|
|
124083
124274
|
|
|
124084
124275
|
// packages/cleo/src/cli/commands/otel.ts
|
|
@@ -125322,17 +125513,18 @@ function registerRestoreCommand(program) {
|
|
|
125322
125513
|
// packages/cleo/src/cli/commands/roadmap.ts
|
|
125323
125514
|
init_cli();
|
|
125324
125515
|
function registerRoadmapCommand(program) {
|
|
125325
|
-
program.command("roadmap").description(
|
|
125516
|
+
program.command("roadmap").description(
|
|
125517
|
+
"Generate project roadmap from task provenance \u2014 epics grouped by status with progress"
|
|
125518
|
+
).option("--include-history", "Include release history from CHANGELOG.md").option("--upcoming-only", "Only show pending/upcoming epics (exclude completed)").action(async (opts) => {
|
|
125326
125519
|
await dispatchFromCli(
|
|
125327
125520
|
"query",
|
|
125328
125521
|
"admin",
|
|
125329
|
-
"
|
|
125522
|
+
"roadmap",
|
|
125330
125523
|
{
|
|
125331
|
-
type: "roadmap",
|
|
125332
125524
|
includeHistory: opts["includeHistory"],
|
|
125333
125525
|
upcomingOnly: opts["upcomingOnly"]
|
|
125334
125526
|
},
|
|
125335
|
-
{ command: "roadmap" }
|
|
125527
|
+
{ command: "roadmap", operation: "admin.roadmap" }
|
|
125336
125528
|
);
|
|
125337
125529
|
});
|
|
125338
125530
|
}
|
|
@@ -126057,7 +126249,7 @@ function registerShowCommand(program) {
|
|
|
126057
126249
|
// packages/cleo/src/cli/commands/skills.ts
|
|
126058
126250
|
init_cli();
|
|
126059
126251
|
function registerSkillsCommand(program) {
|
|
126060
|
-
const skillsCmd = program.command("skills").description("Skill management: list,
|
|
126252
|
+
const skillsCmd = program.command("skills").description("Skill management: list, search, validate, info, install");
|
|
126061
126253
|
skillsCmd.command("list").description("List installed skills").option("--global", "Use global skills directory").action(async (opts) => {
|
|
126062
126254
|
await dispatchFromCli(
|
|
126063
126255
|
"query",
|
|
@@ -126081,17 +126273,6 @@ function registerSkillsCommand(program) {
|
|
|
126081
126273
|
{ command: "skills", operation: "tools.skill.find" }
|
|
126082
126274
|
);
|
|
126083
126275
|
});
|
|
126084
|
-
skillsCmd.command("discover").description("Scan and discover available skills").action(async () => {
|
|
126085
|
-
await dispatchFromCli(
|
|
126086
|
-
"query",
|
|
126087
|
-
"tools",
|
|
126088
|
-
"skill.list",
|
|
126089
|
-
{
|
|
126090
|
-
scope: "project"
|
|
126091
|
-
},
|
|
126092
|
-
{ command: "skills", operation: "tools.skill.list" }
|
|
126093
|
-
);
|
|
126094
|
-
});
|
|
126095
126276
|
skillsCmd.command("validate <skill-name>").description("Validate skill against protocol").action(async (skillName) => {
|
|
126096
126277
|
await dispatchFromCli(
|
|
126097
126278
|
"query",
|
|
@@ -126577,6 +126758,36 @@ function registerSyncCommand(program) {
|
|
|
126577
126758
|
{ command: "sync", operation: "tasks.sync.links" }
|
|
126578
126759
|
);
|
|
126579
126760
|
});
|
|
126761
|
+
sync.command("reconcile <file>").description("Reconcile external tasks from a JSON file against CLEO tasks").requiredOption("--provider <providerId>", "Provider ID (e.g. linear, jira, github)").option(
|
|
126762
|
+
"--conflict-policy <policy>",
|
|
126763
|
+
"How to resolve conflicts: keep-cleo, keep-external, or newest (default: keep-cleo)",
|
|
126764
|
+
"keep-cleo"
|
|
126765
|
+
).action(async (file2, opts) => {
|
|
126766
|
+
const { readFileSync: readFileSync103 } = await import("node:fs");
|
|
126767
|
+
let externalTasks;
|
|
126768
|
+
try {
|
|
126769
|
+
externalTasks = JSON.parse(readFileSync103(file2, "utf8"));
|
|
126770
|
+
} catch (err) {
|
|
126771
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
126772
|
+
console.error(`Failed to read or parse external tasks file: ${message}`);
|
|
126773
|
+
process.exit(2);
|
|
126774
|
+
}
|
|
126775
|
+
if (!Array.isArray(externalTasks)) {
|
|
126776
|
+
console.error("External tasks file must contain a JSON array");
|
|
126777
|
+
process.exit(2);
|
|
126778
|
+
}
|
|
126779
|
+
await dispatchFromCli(
|
|
126780
|
+
"mutate",
|
|
126781
|
+
"tasks",
|
|
126782
|
+
"sync.reconcile",
|
|
126783
|
+
{
|
|
126784
|
+
providerId: opts["provider"],
|
|
126785
|
+
externalTasks,
|
|
126786
|
+
conflictPolicy: opts["conflictPolicy"]
|
|
126787
|
+
},
|
|
126788
|
+
{ command: "sync", operation: "tasks.sync.reconcile" }
|
|
126789
|
+
);
|
|
126790
|
+
});
|
|
126580
126791
|
}
|
|
126581
126792
|
|
|
126582
126793
|
// packages/cleo/src/cli/commands/testing.ts
|
|
@@ -126587,13 +126798,14 @@ function registerTestingCommand(program) {
|
|
|
126587
126798
|
await dispatchFromCli(
|
|
126588
126799
|
"query",
|
|
126589
126800
|
"check",
|
|
126590
|
-
"
|
|
126801
|
+
"protocol",
|
|
126591
126802
|
{
|
|
126803
|
+
protocolType: "testing",
|
|
126804
|
+
mode: "task",
|
|
126592
126805
|
taskId,
|
|
126593
|
-
strict: !!opts["strict"]
|
|
126594
|
-
type: "testing"
|
|
126806
|
+
strict: !!opts["strict"]
|
|
126595
126807
|
},
|
|
126596
|
-
{ command: "testing", operation: "check.
|
|
126808
|
+
{ command: "testing", operation: "check.protocol" }
|
|
126597
126809
|
);
|
|
126598
126810
|
});
|
|
126599
126811
|
testingCmd.command("check <manifestFile>").description("Validate testing protocol from a manifest file").option("--strict", "Exit with error code on violations").action(async (manifestFile, opts) => {
|
|
@@ -126650,11 +126862,11 @@ function registerTestingCommand(program) {
|
|
|
126650
126862
|
init_internal();
|
|
126651
126863
|
init_cli();
|
|
126652
126864
|
init_renderers();
|
|
126653
|
-
import { readFileSync as
|
|
126865
|
+
import { readFileSync as readFileSync101 } from "node:fs";
|
|
126654
126866
|
function readPayload(opts, textKey, fileKey) {
|
|
126655
126867
|
const text3 = opts[textKey];
|
|
126656
126868
|
const file2 = opts[fileKey];
|
|
126657
|
-
if (file2) return
|
|
126869
|
+
if (file2) return readFileSync101(file2, "utf-8");
|
|
126658
126870
|
return text3;
|
|
126659
126871
|
}
|
|
126660
126872
|
function registerTokenCommand(program) {
|
|
@@ -127240,7 +127452,7 @@ var codeCommand = defineCommand({
|
|
|
127240
127452
|
// packages/cleo/src/cli/index.ts
|
|
127241
127453
|
function getPackageVersion() {
|
|
127242
127454
|
const pkgPath = join130(dirname28(fileURLToPath5(import.meta.url)), "../../package.json");
|
|
127243
|
-
const pkg = JSON.parse(
|
|
127455
|
+
const pkg = JSON.parse(readFileSync102(pkgPath, "utf-8"));
|
|
127244
127456
|
return pkg.version;
|
|
127245
127457
|
}
|
|
127246
127458
|
var CLI_VERSION = getPackageVersion();
|
|
@@ -127266,9 +127478,9 @@ registerDepsCommand(rootShim);
|
|
|
127266
127478
|
registerTreeCommand(rootShim);
|
|
127267
127479
|
registerResearchCommand(rootShim);
|
|
127268
127480
|
registerOrchestrateCommand(rootShim);
|
|
127481
|
+
registerChainCommand(rootShim);
|
|
127269
127482
|
registerLifecycleCommand(rootShim);
|
|
127270
127483
|
registerReleaseCommand(rootShim);
|
|
127271
|
-
registerEnvCommand(rootShim);
|
|
127272
127484
|
registerCheckpointCommand(rootShim);
|
|
127273
127485
|
registerCommandsCommand(rootShim);
|
|
127274
127486
|
registerDocsCommand(rootShim);
|