@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/cli/index.js
CHANGED
|
@@ -64333,7 +64333,14 @@ async function initAgentDefinition(created, warnings) {
|
|
|
64333
64333
|
try {
|
|
64334
64334
|
try {
|
|
64335
64335
|
const stat3 = await lstat(globalAgentsDir);
|
|
64336
|
-
if (stat3.isSymbolicLink()
|
|
64336
|
+
if (stat3.isSymbolicLink()) {
|
|
64337
|
+
const { readlink } = await import("node:fs/promises");
|
|
64338
|
+
const currentTarget = await readlink(globalAgentsDir);
|
|
64339
|
+
if (currentTarget === agentSourceDir) {
|
|
64340
|
+
return;
|
|
64341
|
+
}
|
|
64342
|
+
await unlink4(globalAgentsDir);
|
|
64343
|
+
} else if (stat3.isDirectory()) {
|
|
64337
64344
|
return;
|
|
64338
64345
|
}
|
|
64339
64346
|
} catch {
|
|
@@ -65462,6 +65469,7 @@ __export(src_exports, {
|
|
|
65462
65469
|
});
|
|
65463
65470
|
var init_src2 = __esm({
|
|
65464
65471
|
"packages/core/src/index.ts"() {
|
|
65472
|
+
"use strict";
|
|
65465
65473
|
init_src();
|
|
65466
65474
|
init_adapters();
|
|
65467
65475
|
init_admin();
|
|
@@ -65559,6 +65567,11 @@ async function bootstrapGlobalCleo(options) {
|
|
|
65559
65567
|
warnings: [],
|
|
65560
65568
|
isDryRun: options?.dryRun ?? false
|
|
65561
65569
|
};
|
|
65570
|
+
try {
|
|
65571
|
+
const { ensureGlobalHome: ensureGlobalHome2 } = await Promise.resolve().then(() => (init_scaffold(), scaffold_exports));
|
|
65572
|
+
await ensureGlobalHome2();
|
|
65573
|
+
} catch {
|
|
65574
|
+
}
|
|
65562
65575
|
await ensureGlobalTemplatesBootstrap(ctx, options?.packageRoot);
|
|
65563
65576
|
await injectAgentsHub(ctx);
|
|
65564
65577
|
await installMcpToProviders(ctx);
|
|
@@ -65614,13 +65627,9 @@ async function injectAgentsHub(ctx) {
|
|
|
65614
65627
|
await mkdir17(globalAgentsDir, { recursive: true });
|
|
65615
65628
|
if (existsSync103(globalAgentsMd)) {
|
|
65616
65629
|
const content = await readFile19(globalAgentsMd, "utf8");
|
|
65617
|
-
const stripped = content.replace(
|
|
65618
|
-
|
|
65619
|
-
|
|
65620
|
-
);
|
|
65621
|
-
if (stripped !== content) {
|
|
65622
|
-
await writeFile12(globalAgentsMd, stripped, "utf8");
|
|
65623
|
-
}
|
|
65630
|
+
const stripped = content.replace(/\n?<!-- CLEO:START[^>]*-->[\s\S]*?<!-- CLEO:END -->\n?/g, "").replace(/\n?<!-- CAAMP:START -->[\s\S]*?<!-- CAAMP:END -->\n?/g, "").trim();
|
|
65631
|
+
await writeFile12(globalAgentsMd, stripped ? `${stripped}
|
|
65632
|
+
` : "", "utf8");
|
|
65624
65633
|
}
|
|
65625
65634
|
const expectedContent = "@~/.cleo/templates/CLEO-INJECTION.md";
|
|
65626
65635
|
const action = await inject2(globalAgentsMd, expectedContent);
|