@cleocode/cleo 2026.3.48 → 2026.3.50
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/bin/postinstall.js +34 -32
- package/dist/cli/index.js +16 -8
- package/dist/cli/index.js.map +2 -2
- package/dist/mcp/index.js +16 -8
- package/dist/mcp/index.js.map +2 -2
- 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,10 @@ async function bootstrapGlobalCleo(options) {
|
|
|
65309
65317
|
warnings: [],
|
|
65310
65318
|
isDryRun: options?.dryRun ?? false
|
|
65311
65319
|
};
|
|
65320
|
+
try {
|
|
65321
|
+
await ensureGlobalHome();
|
|
65322
|
+
} catch {
|
|
65323
|
+
}
|
|
65312
65324
|
await ensureGlobalTemplatesBootstrap(ctx, options?.packageRoot);
|
|
65313
65325
|
await injectAgentsHub(ctx);
|
|
65314
65326
|
await installMcpToProviders(ctx);
|
|
@@ -65364,13 +65376,9 @@ async function injectAgentsHub(ctx) {
|
|
|
65364
65376
|
await mkdir17(globalAgentsDir, { recursive: true });
|
|
65365
65377
|
if (existsSync103(globalAgentsMd)) {
|
|
65366
65378
|
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
|
-
}
|
|
65379
|
+
const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "").replace(/\n?<!-- CAAMP:START -->[\s\S]*?<!-- CAAMP:END -->\n?/g, "").trim();
|
|
65380
|
+
await writeFile12(globalAgentsMd, stripped ? `${stripped}
|
|
65381
|
+
` : "", "utf8");
|
|
65374
65382
|
}
|
|
65375
65383
|
const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
|
|
65376
65384
|
const action = await inject2(globalAgentsMd, expectedContent);
|