@cleocode/core 2026.4.39 → 2026.4.41
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/index.js +54 -47
- package/dist/index.js.map +2 -2
- package/dist/init.d.ts +15 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +73 -51
- package/dist/init.js.map +1 -1
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/internal.js.map +1 -1
- package/dist/memory/brain-lifecycle.js +11 -0
- package/dist/memory/brain-lifecycle.js.map +1 -1
- package/dist/memory/temporal-supersession.js +0 -3
- package/dist/memory/temporal-supersession.js.map +1 -1
- package/dist/tasks/complete.js +20 -0
- package/dist/tasks/complete.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +224 -1
- package/dist/upgrade.js.map +1 -1
- package/package.json +8 -8
- package/src/init.ts +90 -59
- package/src/internal.ts +7 -0
- package/src/memory/__tests__/{graph-memory-bridge.test.ts → graph-memory-bridge-integration.test.ts} +20 -1
- package/src/memory/__tests__/observer-reflector.test.ts +10 -5
- package/src/memory/__tests__/sleep-consolidation.test.ts +5 -1
- package/src/upgrade.ts +223 -1
package/dist/index.js
CHANGED
|
@@ -54188,6 +54188,7 @@ var init_discovery2 = __esm({
|
|
|
54188
54188
|
// packages/core/src/init.ts
|
|
54189
54189
|
var init_exports = {};
|
|
54190
54190
|
__export(init_exports, {
|
|
54191
|
+
deployStarterBundle: () => deployStarterBundle,
|
|
54191
54192
|
ensureInitialized: () => ensureInitialized,
|
|
54192
54193
|
getVersion: () => getVersion2,
|
|
54193
54194
|
initAgentDefinition: () => initAgentDefinition,
|
|
@@ -54673,53 +54674,7 @@ async function initProject(opts = {}) {
|
|
|
54673
54674
|
);
|
|
54674
54675
|
}
|
|
54675
54676
|
try {
|
|
54676
|
-
|
|
54677
|
-
const cantAgentsDir = join104(cantDir, "agents");
|
|
54678
|
-
const hasCantFiles = existsSync105(cantDir) && readdirSync35(cantDir, { recursive: true }).some(
|
|
54679
|
-
(f) => typeof f === "string" && f.endsWith(".cant")
|
|
54680
|
-
);
|
|
54681
|
-
if (!hasCantFiles) {
|
|
54682
|
-
let starterBundleSrc = null;
|
|
54683
|
-
try {
|
|
54684
|
-
const { createRequire: createRequire10 } = await import("node:module");
|
|
54685
|
-
const req = createRequire10(import.meta.url);
|
|
54686
|
-
const cleoOsPkgMain = req.resolve("@cleocode/cleo-os/package.json");
|
|
54687
|
-
const cleoOsPkgRoot = dirname22(cleoOsPkgMain);
|
|
54688
|
-
const candidate = join104(cleoOsPkgRoot, "starter-bundle");
|
|
54689
|
-
if (existsSync105(candidate)) {
|
|
54690
|
-
starterBundleSrc = candidate;
|
|
54691
|
-
}
|
|
54692
|
-
} catch {
|
|
54693
|
-
}
|
|
54694
|
-
if (!starterBundleSrc) {
|
|
54695
|
-
const packageRoot = getPackageRoot();
|
|
54696
|
-
const fallbacks = [
|
|
54697
|
-
join104(packageRoot, "..", "cleo-os", "starter-bundle"),
|
|
54698
|
-
join104(packageRoot, "..", "..", "packages", "cleo-os", "starter-bundle")
|
|
54699
|
-
];
|
|
54700
|
-
starterBundleSrc = fallbacks.find((p) => existsSync105(p)) ?? null;
|
|
54701
|
-
}
|
|
54702
|
-
if (starterBundleSrc) {
|
|
54703
|
-
await mkdir16(cantDir, { recursive: true });
|
|
54704
|
-
await mkdir16(cantAgentsDir, { recursive: true });
|
|
54705
|
-
const teamSrc = join104(starterBundleSrc, "team.cant");
|
|
54706
|
-
const teamDst = join104(cantDir, "team.cant");
|
|
54707
|
-
if (existsSync105(teamSrc) && !existsSync105(teamDst)) {
|
|
54708
|
-
await copyFile4(teamSrc, teamDst);
|
|
54709
|
-
}
|
|
54710
|
-
const agentsSrc = join104(starterBundleSrc, "agents");
|
|
54711
|
-
if (existsSync105(agentsSrc)) {
|
|
54712
|
-
const agentFiles = readdirSync35(agentsSrc).filter((f) => f.endsWith(".cant"));
|
|
54713
|
-
for (const agentFile of agentFiles) {
|
|
54714
|
-
const dst = join104(cantAgentsDir, agentFile);
|
|
54715
|
-
if (!existsSync105(dst)) {
|
|
54716
|
-
await copyFile4(join104(agentsSrc, agentFile), dst);
|
|
54717
|
-
}
|
|
54718
|
-
}
|
|
54719
|
-
}
|
|
54720
|
-
created.push("starter-bundle: team + agent .cant files deployed to .cleo/cant/");
|
|
54721
|
-
}
|
|
54722
|
-
}
|
|
54677
|
+
await deployStarterBundle(cleoDir, created, warnings);
|
|
54723
54678
|
} catch (err) {
|
|
54724
54679
|
warnings.push(`Starter bundle deploy: ${err instanceof Error ? err.message : String(err)}`);
|
|
54725
54680
|
}
|
|
@@ -54847,6 +54802,58 @@ async function getVersion2(projectRoot) {
|
|
|
54847
54802
|
}
|
|
54848
54803
|
return { version: "0.0.0" };
|
|
54849
54804
|
}
|
|
54805
|
+
async function deployStarterBundle(cleoDir, created, warnings) {
|
|
54806
|
+
const cantDir = join104(cleoDir, "cant");
|
|
54807
|
+
const cantAgentsDir = join104(cantDir, "agents");
|
|
54808
|
+
const hasCantFiles = existsSync105(cantDir) && readdirSync35(cantDir, { recursive: true }).some(
|
|
54809
|
+
(f) => typeof f === "string" && f.endsWith(".cant")
|
|
54810
|
+
);
|
|
54811
|
+
if (hasCantFiles) return;
|
|
54812
|
+
let starterBundleSrc = null;
|
|
54813
|
+
try {
|
|
54814
|
+
const { createRequire: createRequire10 } = await import("node:module");
|
|
54815
|
+
const req = createRequire10(import.meta.url);
|
|
54816
|
+
const cleoOsPkgMain = req.resolve("@cleocode/cleo-os/package.json");
|
|
54817
|
+
const cleoOsPkgRoot = dirname22(cleoOsPkgMain);
|
|
54818
|
+
const candidate = join104(cleoOsPkgRoot, "starter-bundle");
|
|
54819
|
+
if (existsSync105(candidate)) {
|
|
54820
|
+
starterBundleSrc = candidate;
|
|
54821
|
+
}
|
|
54822
|
+
} catch {
|
|
54823
|
+
}
|
|
54824
|
+
if (!starterBundleSrc) {
|
|
54825
|
+
const packageRoot = getPackageRoot();
|
|
54826
|
+
const fallbacks = [
|
|
54827
|
+
join104(packageRoot, "..", "cleo-os", "starter-bundle"),
|
|
54828
|
+
join104(packageRoot, "..", "..", "packages", "cleo-os", "starter-bundle")
|
|
54829
|
+
];
|
|
54830
|
+
starterBundleSrc = fallbacks.find((p) => existsSync105(p)) ?? null;
|
|
54831
|
+
}
|
|
54832
|
+
if (!starterBundleSrc) {
|
|
54833
|
+
warnings.push(
|
|
54834
|
+
"Starter bundle not found \u2014 .cleo/cant/ will remain empty. Run cleo init in a project with @cleocode/cleo-os installed."
|
|
54835
|
+
);
|
|
54836
|
+
return;
|
|
54837
|
+
}
|
|
54838
|
+
await mkdir16(cantDir, { recursive: true });
|
|
54839
|
+
await mkdir16(cantAgentsDir, { recursive: true });
|
|
54840
|
+
const teamSrc = join104(starterBundleSrc, "team.cant");
|
|
54841
|
+
const teamDst = join104(cantDir, "team.cant");
|
|
54842
|
+
if (existsSync105(teamSrc) && !existsSync105(teamDst)) {
|
|
54843
|
+
await copyFile4(teamSrc, teamDst);
|
|
54844
|
+
}
|
|
54845
|
+
const agentsSrc = join104(starterBundleSrc, "agents");
|
|
54846
|
+
if (existsSync105(agentsSrc)) {
|
|
54847
|
+
const agentFiles = readdirSync35(agentsSrc).filter((f) => f.endsWith(".cant"));
|
|
54848
|
+
for (const agentFile of agentFiles) {
|
|
54849
|
+
const dst = join104(cantAgentsDir, agentFile);
|
|
54850
|
+
if (!existsSync105(dst)) {
|
|
54851
|
+
await copyFile4(join104(agentsSrc, agentFile), dst);
|
|
54852
|
+
}
|
|
54853
|
+
}
|
|
54854
|
+
}
|
|
54855
|
+
created.push("starter-bundle: team + agent .cant files deployed to .cleo/cant/");
|
|
54856
|
+
}
|
|
54850
54857
|
var DIR_SYMLINK_TYPE2;
|
|
54851
54858
|
var init_init = __esm({
|
|
54852
54859
|
"packages/core/src/init.ts"() {
|