@cleocode/cleo 2026.3.30 → 2026.3.31
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 +47 -50
- package/dist/cli/index.js.map +3 -3
- package/dist/mcp/index.js +45 -48
- package/dist/mcp/index.js.map +3 -3
- package/package.json +1 -1
- package/server.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -9999,28 +9999,25 @@ async function ensureInjection(projectRoot) {
|
|
|
9999
9999
|
}
|
|
10000
10000
|
const { getInstalledProviders: getInstalledProviders3, inject, injectAll: injectAll2, buildInjectionContent: buildInjectionContent2 } = caamp;
|
|
10001
10001
|
const providers = getInstalledProviders3();
|
|
10002
|
-
if (providers.length === 0) {
|
|
10003
|
-
return {
|
|
10004
|
-
action: "skipped",
|
|
10005
|
-
path: join28(projectRoot, "AGENTS.md"),
|
|
10006
|
-
details: "No AI agent providers detected, skipping injection"
|
|
10007
|
-
};
|
|
10008
|
-
}
|
|
10009
10002
|
const actions = [];
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10021
|
-
|
|
10022
|
-
const
|
|
10023
|
-
|
|
10003
|
+
if (providers.length === 0) {
|
|
10004
|
+
actions.push("No providers detected (AGENTS.md created without provider injection)");
|
|
10005
|
+
} else {
|
|
10006
|
+
for (const provider of providers) {
|
|
10007
|
+
const instructFile = join28(projectRoot, provider.pathProject, provider.instructFile);
|
|
10008
|
+
await stripCLEOBlocks(instructFile);
|
|
10009
|
+
}
|
|
10010
|
+
await stripCLEOBlocks(join28(projectRoot, "AGENTS.md"));
|
|
10011
|
+
const removedStale = await removeStaleAgentInjection(projectRoot);
|
|
10012
|
+
if (removedStale) {
|
|
10013
|
+
actions.push("removed deprecated AGENT-INJECTION.md");
|
|
10014
|
+
}
|
|
10015
|
+
const injectionContent = buildInjectionContent2({ references: ["@AGENTS.md"] });
|
|
10016
|
+
const results = await injectAll2(providers, projectRoot, "project", injectionContent);
|
|
10017
|
+
for (const [filePath, action] of results) {
|
|
10018
|
+
const fileName = basename4(filePath);
|
|
10019
|
+
actions.push(`${fileName} (${action})`);
|
|
10020
|
+
}
|
|
10024
10021
|
}
|
|
10025
10022
|
const agentsMdPath = join28(projectRoot, "AGENTS.md");
|
|
10026
10023
|
const agentsMdLines = ["@~/.cleo/templates/CLEO-INJECTION.md"];
|
|
@@ -12774,6 +12771,14 @@ async function initProject(opts = {}) {
|
|
|
12774
12771
|
} catch (err) {
|
|
12775
12772
|
warnings.push(`Project detection failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
12776
12773
|
}
|
|
12774
|
+
try {
|
|
12775
|
+
const bridgeResult = await writeMemoryBridge(projRoot);
|
|
12776
|
+
if (bridgeResult.written) {
|
|
12777
|
+
created.push("memory-bridge.md");
|
|
12778
|
+
}
|
|
12779
|
+
} catch (err) {
|
|
12780
|
+
warnings.push(`Memory bridge: ${err instanceof Error ? err.message : String(err)}`);
|
|
12781
|
+
}
|
|
12777
12782
|
try {
|
|
12778
12783
|
const injectionResult = await ensureInjection(projRoot);
|
|
12779
12784
|
if (injectionResult.action !== "skipped") {
|
|
@@ -12827,14 +12832,6 @@ async function initProject(opts = {}) {
|
|
|
12827
12832
|
} catch (err) {
|
|
12828
12833
|
warnings.push(`Adapter discovery: ${err instanceof Error ? err.message : String(err)}`);
|
|
12829
12834
|
}
|
|
12830
|
-
try {
|
|
12831
|
-
const bridgeResult = await writeMemoryBridge(projRoot);
|
|
12832
|
-
if (bridgeResult.written) {
|
|
12833
|
-
created.push("memory-bridge.md");
|
|
12834
|
-
}
|
|
12835
|
-
} catch (err) {
|
|
12836
|
-
warnings.push(`Memory bridge: ${err instanceof Error ? err.message : String(err)}`);
|
|
12837
|
-
}
|
|
12838
12835
|
const rootGitignoreResult = await removeCleoFromRootGitignore(projRoot);
|
|
12839
12836
|
if (rootGitignoreResult.removed) {
|
|
12840
12837
|
warnings.push(
|
|
@@ -16895,7 +16892,7 @@ async function loadCompletionEnforcement(cwd) {
|
|
|
16895
16892
|
const lifecycleModeRaw = await getRawConfigValue("lifecycle.mode", cwd);
|
|
16896
16893
|
const acceptanceMode = modeRaw === "off" || modeRaw === "warn" || modeRaw === "block" ? modeRaw : "warn";
|
|
16897
16894
|
const acceptanceRequiredForPriorities = Array.isArray(prioritiesRaw) ? prioritiesRaw.filter((p) => typeof p === "string") : ["critical", "high"];
|
|
16898
|
-
const verificationEnabled = verificationEnabledRaw
|
|
16895
|
+
const verificationEnabled = verificationEnabledRaw === true;
|
|
16899
16896
|
const verificationRequiredGates = Array.isArray(verificationRequiredGatesRaw) ? verificationRequiredGatesRaw.filter((g) => typeof g === "string").filter(isVerificationGate) : DEFAULT_VERIFICATION_REQUIRED_GATES;
|
|
16900
16897
|
const verificationMaxRounds = typeof verificationMaxRoundsRaw === "number" && Number.isInteger(verificationMaxRoundsRaw) ? verificationMaxRoundsRaw : 5;
|
|
16901
16898
|
const lifecycleMode = lifecycleModeRaw === "strict" || lifecycleModeRaw === "warn" || lifecycleModeRaw === "advisory" || lifecycleModeRaw === "none" || lifecycleModeRaw === "off" ? lifecycleModeRaw : "off";
|
|
@@ -27977,6 +27974,7 @@ function injectContext(protocolType, params, projectRoot) {
|
|
|
27977
27974
|
// src/dispatch/engines/session-engine.ts
|
|
27978
27975
|
init_handoff();
|
|
27979
27976
|
init_sessions();
|
|
27977
|
+
init_sessions();
|
|
27980
27978
|
|
|
27981
27979
|
// src/core/sessions/session-id.ts
|
|
27982
27980
|
import { randomBytes as randomBytes7 } from "node:crypto";
|
|
@@ -28125,29 +28123,31 @@ async function sessionStart(projectRoot, params) {
|
|
|
28125
28123
|
try {
|
|
28126
28124
|
let accessor = await getAccessor(projectRoot);
|
|
28127
28125
|
let taskData = await accessor.loadTaskFile();
|
|
28126
|
+
let scope;
|
|
28127
|
+
try {
|
|
28128
|
+
scope = parseScope2(params.scope);
|
|
28129
|
+
} catch (err) {
|
|
28130
|
+
return engineError("E_INVALID_INPUT", err instanceof Error ? err.message : "Invalid scope");
|
|
28131
|
+
}
|
|
28132
|
+
if (scope.type !== "global") {
|
|
28133
|
+
const rootTask = taskData.tasks?.find((t) => t.id === scope.rootTaskId);
|
|
28134
|
+
if (!rootTask) {
|
|
28135
|
+
return engineError("E_NOT_FOUND", `Root task '${scope.rootTaskId}' not found`);
|
|
28136
|
+
}
|
|
28137
|
+
}
|
|
28128
28138
|
const activeSessionId = taskData._meta?.activeSession;
|
|
28129
28139
|
if (activeSessionId) {
|
|
28130
28140
|
await sessionEnd(projectRoot);
|
|
28131
28141
|
accessor = await getAccessor(projectRoot);
|
|
28132
28142
|
taskData = await accessor.loadTaskFile();
|
|
28133
28143
|
}
|
|
28134
|
-
const scopeParts = params.scope.split(":");
|
|
28135
|
-
const scopeType = scopeParts[0] || "task";
|
|
28136
|
-
const rootTaskId = scopeParts[1] || "";
|
|
28137
|
-
if (!rootTaskId) {
|
|
28138
|
-
return engineError("E_INVALID_INPUT", "Scope must include a task ID (e.g., epic:T001)");
|
|
28139
|
-
}
|
|
28140
|
-
const rootTask = taskData.tasks?.find((t) => t.id === rootTaskId);
|
|
28141
|
-
if (!rootTask) {
|
|
28142
|
-
return engineError("E_NOT_FOUND", `Root task '${rootTaskId}' not found`);
|
|
28143
|
-
}
|
|
28144
28144
|
const now2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
28145
28145
|
const sessionId = generateSessionId2();
|
|
28146
28146
|
let previousSessionId = null;
|
|
28147
28147
|
{
|
|
28148
28148
|
const sessions2 = await accessor.loadSessions();
|
|
28149
28149
|
const sameScope = sessions2.filter(
|
|
28150
|
-
(s) => s.status === "ended" && s.endedAt && s.scope?.
|
|
28150
|
+
(s) => s.status === "ended" && s.endedAt && s.scope?.type === scope.type && (scope.type === "global" || s.scope?.rootTaskId === scope.rootTaskId)
|
|
28151
28151
|
).sort(
|
|
28152
28152
|
(a, b) => new Date(b.endedAt).getTime() - new Date(a.endedAt).getTime()
|
|
28153
28153
|
);
|
|
@@ -28156,16 +28156,13 @@ async function sessionStart(projectRoot, params) {
|
|
|
28156
28156
|
}
|
|
28157
28157
|
}
|
|
28158
28158
|
const agentIdentifier = params.agentIdentifier ?? process.env.CLEO_AGENT_ID ?? null;
|
|
28159
|
-
const
|
|
28159
|
+
const rootTaskId = scope.type !== "global" ? scope.rootTaskId : void 0;
|
|
28160
|
+
const startingTaskId = params.startTask || (params.autoStart && rootTaskId ? rootTaskId : null);
|
|
28160
28161
|
const newSession = {
|
|
28161
28162
|
id: sessionId,
|
|
28162
28163
|
status: "active",
|
|
28163
28164
|
name: params.name || `session-${sessionId}`,
|
|
28164
|
-
scope: {
|
|
28165
|
-
type: scopeType,
|
|
28166
|
-
rootTaskId,
|
|
28167
|
-
includeDescendants: true
|
|
28168
|
-
},
|
|
28165
|
+
scope: scope.type === "global" ? { type: "global" } : { type: scope.type, rootTaskId: scope.rootTaskId, includeDescendants: true },
|
|
28169
28166
|
taskWork: {
|
|
28170
28167
|
taskId: startingTaskId,
|
|
28171
28168
|
setAt: now2
|
|
@@ -28196,7 +28193,7 @@ async function sessionStart(projectRoot, params) {
|
|
|
28196
28193
|
const startingTask = params.startTask;
|
|
28197
28194
|
if (startingTask) {
|
|
28198
28195
|
taskData.focus.currentTask = startingTask;
|
|
28199
|
-
} else if (params.autoStart) {
|
|
28196
|
+
} else if (params.autoStart && rootTaskId) {
|
|
28200
28197
|
taskData.focus.currentTask = rootTaskId;
|
|
28201
28198
|
}
|
|
28202
28199
|
if (taskData._meta) {
|
|
@@ -45453,7 +45450,7 @@ import { execFileSync as execFileSync13 } from "node:child_process";
|
|
|
45453
45450
|
// src/config/build-config.ts
|
|
45454
45451
|
var BUILD_CONFIG = {
|
|
45455
45452
|
"name": "@cleocode/cleo",
|
|
45456
|
-
"version": "2026.3.
|
|
45453
|
+
"version": "2026.3.31",
|
|
45457
45454
|
"description": "CLEO V2 - TypeScript task management CLI for AI coding agents",
|
|
45458
45455
|
"repository": {
|
|
45459
45456
|
"owner": "kryptobaseddev",
|
|
@@ -45462,7 +45459,7 @@ var BUILD_CONFIG = {
|
|
|
45462
45459
|
"url": "https://github.com/kryptobaseddev/cleo.git",
|
|
45463
45460
|
"issuesUrl": "https://github.com/kryptobaseddev/cleo/issues"
|
|
45464
45461
|
},
|
|
45465
|
-
"buildDate": "2026-03-
|
|
45462
|
+
"buildDate": "2026-03-16T23:36:19.886Z",
|
|
45466
45463
|
"templates": {
|
|
45467
45464
|
"issueTemplatesDir": "templates/issue-templates"
|
|
45468
45465
|
}
|