@cleocode/cleo 2026.3.48 → 2026.3.49
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 +17 -8
- package/dist/cli/index.js.map +3 -3
- package/dist/mcp/index.js +17 -8
- package/dist/mcp/index.js.map +3 -3
- package/package.json +3 -3
package/dist/mcp/index.js
CHANGED
|
@@ -64305,7 +64305,14 @@ async function initAgentDefinition(created, warnings) {
|
|
|
64305
64305
|
try {
|
|
64306
64306
|
try {
|
|
64307
64307
|
const stat2 = await lstat(globalAgentsDir);
|
|
64308
|
-
if (stat2.isSymbolicLink()
|
|
64308
|
+
if (stat2.isSymbolicLink()) {
|
|
64309
|
+
const { readlink } = await import("node:fs/promises");
|
|
64310
|
+
const currentTarget = await readlink(globalAgentsDir);
|
|
64311
|
+
if (currentTarget === agentSourceDir) {
|
|
64312
|
+
return;
|
|
64313
|
+
}
|
|
64314
|
+
await unlink4(globalAgentsDir);
|
|
64315
|
+
} else if (stat2.isDirectory()) {
|
|
64309
64316
|
return;
|
|
64310
64317
|
}
|
|
64311
64318
|
} catch {
|
|
@@ -65212,6 +65219,7 @@ var init_cleo = __esm({
|
|
|
65212
65219
|
// packages/core/src/index.ts
|
|
65213
65220
|
var init_src2 = __esm({
|
|
65214
65221
|
"packages/core/src/index.ts"() {
|
|
65222
|
+
"use strict";
|
|
65215
65223
|
init_src();
|
|
65216
65224
|
init_adapters();
|
|
65217
65225
|
init_admin();
|
|
@@ -65309,6 +65317,11 @@ async function bootstrapGlobalCleo(options) {
|
|
|
65309
65317
|
warnings: [],
|
|
65310
65318
|
isDryRun: options?.dryRun ?? false
|
|
65311
65319
|
};
|
|
65320
|
+
try {
|
|
65321
|
+
const { ensureGlobalHome: ensureGlobalHome2 } = await Promise.resolve().then(() => (init_scaffold(), scaffold_exports));
|
|
65322
|
+
await ensureGlobalHome2();
|
|
65323
|
+
} catch {
|
|
65324
|
+
}
|
|
65312
65325
|
await ensureGlobalTemplatesBootstrap(ctx, options?.packageRoot);
|
|
65313
65326
|
await injectAgentsHub(ctx);
|
|
65314
65327
|
await installMcpToProviders(ctx);
|
|
@@ -65364,13 +65377,9 @@ async function injectAgentsHub(ctx) {
|
|
|
65364
65377
|
await mkdir17(globalAgentsDir, { recursive: true });
|
|
65365
65378
|
if (existsSync103(globalAgentsMd)) {
|
|
65366
65379
|
const content = await readFile19(globalAgentsMd, "utf8");
|
|
65367
|
-
const stripped = content.replace(
|
|
65368
|
-
|
|
65369
|
-
|
|
65370
|
-
);
|
|
65371
|
-
if (stripped !== content) {
|
|
65372
|
-
await writeFile12(globalAgentsMd, stripped, "utf8");
|
|
65373
|
-
}
|
|
65380
|
+
const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "").replace(/\n?<!-- CAAMP:START -->[\s\S]*?<!-- CAAMP:END -->\n?/g, "").trim();
|
|
65381
|
+
await writeFile12(globalAgentsMd, stripped ? `${stripped}
|
|
65382
|
+
` : "", "utf8");
|
|
65374
65383
|
}
|
|
65375
65384
|
const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
|
|
65376
65385
|
const action = await inject2(globalAgentsMd, expectedContent);
|