@cleocode/cleo 2026.4.39 → 2026.4.40

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 CHANGED
@@ -85616,6 +85616,7 @@ var init_error_registry = __esm({
85616
85616
  // packages/core/src/init.ts
85617
85617
  var init_exports = {};
85618
85618
  __export(init_exports, {
85619
+ deployStarterBundle: () => deployStarterBundle,
85619
85620
  ensureInitialized: () => ensureInitialized,
85620
85621
  getVersion: () => getVersion2,
85621
85622
  initAgentDefinition: () => initAgentDefinition,
@@ -86101,53 +86102,7 @@ async function initProject(opts = {}) {
86101
86102
  );
86102
86103
  }
86103
86104
  try {
86104
- const cantDir = join106(cleoDir, "cant");
86105
- const cantAgentsDir = join106(cantDir, "agents");
86106
- const hasCantFiles = existsSync107(cantDir) && readdirSync36(cantDir, { recursive: true }).some(
86107
- (f2) => typeof f2 === "string" && f2.endsWith(".cant")
86108
- );
86109
- if (!hasCantFiles) {
86110
- let starterBundleSrc = null;
86111
- try {
86112
- const { createRequire: createRequire19 } = await import("node:module");
86113
- const req = createRequire19(import.meta.url);
86114
- const cleoOsPkgMain = req.resolve("@cleocode/cleo-os/package.json");
86115
- const cleoOsPkgRoot = dirname22(cleoOsPkgMain);
86116
- const candidate = join106(cleoOsPkgRoot, "starter-bundle");
86117
- if (existsSync107(candidate)) {
86118
- starterBundleSrc = candidate;
86119
- }
86120
- } catch {
86121
- }
86122
- if (!starterBundleSrc) {
86123
- const packageRoot = getPackageRoot();
86124
- const fallbacks = [
86125
- join106(packageRoot, "..", "cleo-os", "starter-bundle"),
86126
- join106(packageRoot, "..", "..", "packages", "cleo-os", "starter-bundle")
86127
- ];
86128
- starterBundleSrc = fallbacks.find((p2) => existsSync107(p2)) ?? null;
86129
- }
86130
- if (starterBundleSrc) {
86131
- await mkdir16(cantDir, { recursive: true });
86132
- await mkdir16(cantAgentsDir, { recursive: true });
86133
- const teamSrc = join106(starterBundleSrc, "team.cant");
86134
- const teamDst = join106(cantDir, "team.cant");
86135
- if (existsSync107(teamSrc) && !existsSync107(teamDst)) {
86136
- await copyFile4(teamSrc, teamDst);
86137
- }
86138
- const agentsSrc = join106(starterBundleSrc, "agents");
86139
- if (existsSync107(agentsSrc)) {
86140
- const agentFiles = readdirSync36(agentsSrc).filter((f2) => f2.endsWith(".cant"));
86141
- for (const agentFile of agentFiles) {
86142
- const dst = join106(cantAgentsDir, agentFile);
86143
- if (!existsSync107(dst)) {
86144
- await copyFile4(join106(agentsSrc, agentFile), dst);
86145
- }
86146
- }
86147
- }
86148
- created.push("starter-bundle: team + agent .cant files deployed to .cleo/cant/");
86149
- }
86150
- }
86105
+ await deployStarterBundle(cleoDir, created, warnings);
86151
86106
  } catch (err) {
86152
86107
  warnings.push(`Starter bundle deploy: ${err instanceof Error ? err.message : String(err)}`);
86153
86108
  }
@@ -86275,6 +86230,58 @@ async function getVersion2(projectRoot) {
86275
86230
  }
86276
86231
  return { version: "0.0.0" };
86277
86232
  }
86233
+ async function deployStarterBundle(cleoDir, created, warnings) {
86234
+ const cantDir = join106(cleoDir, "cant");
86235
+ const cantAgentsDir = join106(cantDir, "agents");
86236
+ const hasCantFiles = existsSync107(cantDir) && readdirSync36(cantDir, { recursive: true }).some(
86237
+ (f2) => typeof f2 === "string" && f2.endsWith(".cant")
86238
+ );
86239
+ if (hasCantFiles) return;
86240
+ let starterBundleSrc = null;
86241
+ try {
86242
+ const { createRequire: createRequire19 } = await import("node:module");
86243
+ const req = createRequire19(import.meta.url);
86244
+ const cleoOsPkgMain = req.resolve("@cleocode/cleo-os/package.json");
86245
+ const cleoOsPkgRoot = dirname22(cleoOsPkgMain);
86246
+ const candidate = join106(cleoOsPkgRoot, "starter-bundle");
86247
+ if (existsSync107(candidate)) {
86248
+ starterBundleSrc = candidate;
86249
+ }
86250
+ } catch {
86251
+ }
86252
+ if (!starterBundleSrc) {
86253
+ const packageRoot = getPackageRoot();
86254
+ const fallbacks = [
86255
+ join106(packageRoot, "..", "cleo-os", "starter-bundle"),
86256
+ join106(packageRoot, "..", "..", "packages", "cleo-os", "starter-bundle")
86257
+ ];
86258
+ starterBundleSrc = fallbacks.find((p2) => existsSync107(p2)) ?? null;
86259
+ }
86260
+ if (!starterBundleSrc) {
86261
+ warnings.push(
86262
+ "Starter bundle not found \u2014 .cleo/cant/ will remain empty. Run cleo init in a project with @cleocode/cleo-os installed."
86263
+ );
86264
+ return;
86265
+ }
86266
+ await mkdir16(cantDir, { recursive: true });
86267
+ await mkdir16(cantAgentsDir, { recursive: true });
86268
+ const teamSrc = join106(starterBundleSrc, "team.cant");
86269
+ const teamDst = join106(cantDir, "team.cant");
86270
+ if (existsSync107(teamSrc) && !existsSync107(teamDst)) {
86271
+ await copyFile4(teamSrc, teamDst);
86272
+ }
86273
+ const agentsSrc = join106(starterBundleSrc, "agents");
86274
+ if (existsSync107(agentsSrc)) {
86275
+ const agentFiles = readdirSync36(agentsSrc).filter((f2) => f2.endsWith(".cant"));
86276
+ for (const agentFile of agentFiles) {
86277
+ const dst = join106(cantAgentsDir, agentFile);
86278
+ if (!existsSync107(dst)) {
86279
+ await copyFile4(join106(agentsSrc, agentFile), dst);
86280
+ }
86281
+ }
86282
+ }
86283
+ created.push("starter-bundle: team + agent .cant files deployed to .cleo/cant/");
86284
+ }
86278
86285
  var DIR_SYMLINK_TYPE2;
86279
86286
  var init_init = __esm({
86280
86287
  "packages/core/src/init.ts"() {
@@ -100163,6 +100170,27 @@ async function runUpgrade(options = {}) {
100163
100170
  }
100164
100171
  } catch {
100165
100172
  }
100173
+ try {
100174
+ const { deployStarterBundle: deployStarterBundle2 } = await Promise.resolve().then(() => (init_init(), init_exports));
100175
+ const cantCreated = [];
100176
+ const cantWarnings = [];
100177
+ await deployStarterBundle2(cleoDir, cantCreated, cantWarnings);
100178
+ if (cantCreated.length > 0) {
100179
+ actions.push({
100180
+ action: "cant_starter_bundle",
100181
+ status: "applied",
100182
+ details: cantCreated.join(", ")
100183
+ });
100184
+ }
100185
+ for (const w2 of cantWarnings) {
100186
+ actions.push({
100187
+ action: "cant_starter_bundle",
100188
+ status: "skipped",
100189
+ details: w2
100190
+ });
100191
+ }
100192
+ } catch {
100193
+ }
100166
100194
  try {
100167
100195
  const skillsCreated = [];
100168
100196
  const skillsWarnings = [];
@@ -112118,6 +112146,7 @@ __export(internal_exports, {
112118
112146
  attachAgentToProject: () => attachAgentToProject2,
112119
112147
  auditData: () => auditData,
112120
112148
  auditLog: () => auditLog,
112149
+ autoLinkMemories: () => autoLinkMemories,
112121
112150
  autoRecordDispatchTokenUsage: () => autoRecordDispatchTokenUsage,
112122
112151
  backfillBrainGraph: () => backfillBrainGraph,
112123
112152
  backfillTasks: () => backfillTasks,
@@ -112531,12 +112560,14 @@ __export(internal_exports, {
112531
112560
  lifecycleStageNameSchema: () => lifecycleStageNameSchema,
112532
112561
  lifecycleStageStatusSchema: () => lifecycleStageStatusSchema,
112533
112562
  lifecycleTransitionTypeSchema: () => lifecycleTransitionTypeSchema,
112563
+ linkMemoryToCode: () => linkMemoryToCode,
112534
112564
  listAdrs: () => listAdrs,
112535
112565
  listAgentInstances: () => listAgentInstances,
112536
112566
  listAgentsForProject: () => listAgentsForProject,
112537
112567
  listBackups: () => listBackups,
112538
112568
  listBrainBackups: () => listBrainBackups,
112539
112569
  listChains: () => listChains,
112570
+ listCodeLinks: () => listCodeLinks,
112540
112571
  listEpicsWithLifecycle: () => listEpicsWithLifecycle,
112541
112572
  listGlobalSaltBackups: () => listGlobalSaltBackups,
112542
112573
  listGlobalSqliteBackups: () => listGlobalSqliteBackups,
@@ -112660,6 +112691,8 @@ __export(internal_exports, {
112660
112691
  pushRelease: () => pushRelease,
112661
112692
  pushWarning: () => pushWarning,
112662
112693
  queryAudit: () => queryAudit,
112694
+ queryCodeForMemory: () => queryCodeForMemory,
112695
+ queryMemoriesForCode: () => queryMemoriesForCode,
112663
112696
  readGrades: () => readGrades,
112664
112697
  readJson: () => readJson,
112665
112698
  readManifestEntries: () => readManifestEntries2,
@@ -113017,6 +113050,7 @@ var init_internal = __esm({
113017
113050
  init_init();
113018
113051
  init_auto_extract();
113019
113052
  init_brain_embedding();
113053
+ init_graph_memory_bridge();
113020
113054
  init_llm_extraction();
113021
113055
  init_memory_bridge();
113022
113056
  init_session_memory();
@@ -124647,26 +124681,58 @@ var init_memory2 = __esm({
124647
124681
  }
124648
124682
  case "code.links": {
124649
124683
  const { listCodeLinks: listCodeLinks2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
124650
- const result = await listCodeLinks2(projectRoot);
124651
- return wrapResult(result, "query", "memory", operation, startTime);
124684
+ const links = await listCodeLinks2(projectRoot);
124685
+ return wrapResult(
124686
+ { success: true, data: links },
124687
+ "query",
124688
+ "memory",
124689
+ operation,
124690
+ startTime
124691
+ );
124652
124692
  }
124653
124693
  case "code.memories-for-code": {
124654
124694
  const symbol2 = params?.symbol;
124655
124695
  if (!symbol2) {
124656
- return errorResult("query", "memory", operation, "E_INVALID_INPUT", "symbol is required", startTime);
124696
+ return errorResult(
124697
+ "query",
124698
+ "memory",
124699
+ operation,
124700
+ "E_INVALID_INPUT",
124701
+ "symbol is required",
124702
+ startTime
124703
+ );
124657
124704
  }
124658
124705
  const { queryMemoriesForCode: queryMemoriesForCode2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
124659
124706
  const result = await queryMemoriesForCode2(projectRoot, symbol2);
124660
- return wrapResult({ success: true, data: result }, "query", "memory", operation, startTime);
124707
+ return wrapResult(
124708
+ { success: true, data: result },
124709
+ "query",
124710
+ "memory",
124711
+ operation,
124712
+ startTime
124713
+ );
124661
124714
  }
124662
124715
  case "code.for-memory": {
124663
124716
  const memoryId = params?.memoryId;
124664
124717
  if (!memoryId) {
124665
- return errorResult("query", "memory", operation, "E_INVALID_INPUT", "memoryId is required", startTime);
124718
+ return errorResult(
124719
+ "query",
124720
+ "memory",
124721
+ operation,
124722
+ "E_INVALID_INPUT",
124723
+ "memoryId is required",
124724
+ startTime
124725
+ );
124666
124726
  }
124667
124727
  const { queryCodeForMemory: queryCodeForMemory2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
124668
124728
  const result = await queryCodeForMemory2(projectRoot, memoryId);
124669
- return wrapResult({ success: true, data: result }, "query", "memory", operation, startTime);
124729
+ return wrapResult(
124730
+ { success: true, data: result },
124731
+ "query",
124732
+ "memory",
124733
+ operation,
124734
+ startTime
124735
+ );
124670
124736
  }
124671
124737
  default:
124672
124738
  return unsupportedOp("query", "memory", operation, startTime);
@@ -124842,16 +124908,35 @@ var init_memory2 = __esm({
124842
124908
  const memoryId = params?.memoryId;
124843
124909
  const codeSymbol = params?.codeSymbol;
124844
124910
  if (!memoryId || !codeSymbol) {
124845
- return errorResult("mutate", "memory", operation, "E_INVALID_INPUT", "memoryId and codeSymbol are required", startTime);
124911
+ return errorResult(
124912
+ "mutate",
124913
+ "memory",
124914
+ operation,
124915
+ "E_INVALID_INPUT",
124916
+ "memoryId and codeSymbol are required",
124917
+ startTime
124918
+ );
124846
124919
  }
124847
124920
  const { linkMemoryToCode: linkMemoryToCode2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
124848
124921
  const linked = await linkMemoryToCode2(projectRoot, memoryId, codeSymbol);
124849
- return wrapResult({ success: true, data: { linked } }, "mutate", "memory", operation, startTime);
124922
+ return wrapResult(
124923
+ { success: true, data: { linked } },
124924
+ "mutate",
124925
+ "memory",
124926
+ operation,
124927
+ startTime
124928
+ );
124850
124929
  }
124851
124930
  case "code.auto-link": {
124852
124931
  const { autoLinkMemories: autoLinkMemories2 } = await Promise.resolve().then(() => (init_internal(), internal_exports));
124853
124932
  const result = await autoLinkMemories2(projectRoot);
124854
- return wrapResult({ success: true, data: result }, "mutate", "memory", operation, startTime);
124933
+ return wrapResult(
124934
+ { success: true, data: result },
124935
+ "mutate",
124936
+ "memory",
124937
+ operation,
124938
+ startTime
124939
+ );
124855
124940
  }
124856
124941
  default:
124857
124942
  return unsupportedOp("mutate", "memory", operation, startTime);