@cleocode/core 2026.3.53 → 2026.3.54

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/paths.d.ts CHANGED
@@ -145,6 +145,17 @@ export declare function getCleoTempDir(): string;
145
145
  * Linux: ~/.config/cleo | macOS: ~/Library/Preferences/cleo | Windows: %APPDATA%\cleo\Config
146
146
  */
147
147
  export declare function getCleoConfigDir(): string;
148
+ /**
149
+ * Get the CLEO templates directory as a tilde-prefixed path for use
150
+ * in `@` references (AGENTS.md, CLAUDE.md, etc.). Cross-platform:
151
+ * replaces the user's home directory with `~` so the reference works
152
+ * when loaded by LLM providers that resolve `~` at runtime.
153
+ *
154
+ * Linux: ~/.local/share/cleo/templates
155
+ * macOS: ~/Library/Application Support/cleo/templates
156
+ * Windows: ~/AppData/Local/cleo/Data/templates (approximate)
157
+ */
158
+ export declare function getCleoTemplatesTildePath(): string;
148
159
  /**
149
160
  * Get the global agents hub directory.
150
161
  * Respects AGENTS_HOME env var, defaults to ~/.agents.
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAIlE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAMvD;AAED;;;;GAIG;AAC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1,6 @@
1
1
  {
2
2
  "name": "@cleocode/core",
3
- "version": "2026.3.53",
3
+ "version": "2026.3.54",
4
4
  "description": "CLEO core business logic kernel — tasks, sessions, memory, orchestration, lifecycle, with bundled SQLite store",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -36,10 +36,10 @@
36
36
  "write-file-atomic": "^6.0.0",
37
37
  "yaml": "^2.8.2",
38
38
  "zod": "^3.25.76",
39
- "@cleocode/adapters": "2026.3.53",
40
- "@cleocode/contracts": "2026.3.53",
41
- "@cleocode/agents": "2026.3.53",
42
- "@cleocode/skills": "2026.3.53"
39
+ "@cleocode/adapters": "2026.3.54",
40
+ "@cleocode/contracts": "2026.3.54",
41
+ "@cleocode/skills": "2026.3.54",
42
+ "@cleocode/agents": "2026.3.54"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=24.0.0"
package/src/bootstrap.ts CHANGED
@@ -15,7 +15,7 @@ import { existsSync, readFileSync } from 'node:fs';
15
15
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
16
16
  import { homedir } from 'node:os';
17
17
  import { join } from 'node:path';
18
- import { getAgentsHome, getCleoTemplatesDir } from './paths.js';
18
+ import { getAgentsHome, getCleoTemplatesDir, getCleoTemplatesTildePath } from './paths.js';
19
19
  import { ensureGlobalHome, getPackageRoot } from './scaffold.js';
20
20
 
21
21
  // ── Types ────────────────────────────────────────────────────────────
@@ -155,8 +155,8 @@ async function injectAgentsHub(ctx: BootstrapContext): Promise<void> {
155
155
  }
156
156
 
157
157
  // CAAMP 1.8.1: inject() is idempotent AND consolidates duplicates
158
- const expectedContent = '@~/.cleo/templates/CLEO-INJECTION.md';
159
- const action = await inject(globalAgentsMd, expectedContent);
158
+ const templateRef = `@${getCleoTemplatesTildePath()}/CLEO-INJECTION.md`;
159
+ const action = await inject(globalAgentsMd, templateRef);
160
160
  ctx.created.push(`~/.agents/AGENTS.md (${action})`);
161
161
  } else {
162
162
  ctx.created.push('~/.agents/AGENTS.md (would create/update CAAMP block)');
package/src/injection.ts CHANGED
@@ -19,7 +19,7 @@ import { existsSync, readFileSync } from 'node:fs';
19
19
  import { mkdir, rm, writeFile } from 'node:fs/promises';
20
20
  import { homedir } from 'node:os';
21
21
  import { basename, join } from 'node:path';
22
- import { getAgentsHome, getCleoHome } from './paths.js';
22
+ import { getAgentsHome, getCleoHome, getCleoTemplatesTildePath } from './paths.js';
23
23
  import { getPackageRoot, stripCLEOBlocks } from './scaffold.js';
24
24
 
25
25
  // ── Types ────────────────────────────────────────────────────────────
@@ -169,7 +169,7 @@ export async function ensureInjection(projectRoot: string): Promise<ScaffoldResu
169
169
  try {
170
170
  const globalAgentsDir = getAgentsHome();
171
171
  const globalAgentsMd = join(globalAgentsDir, 'AGENTS.md');
172
- const globalHubContent = '@~/.cleo/templates/CLEO-INJECTION.md';
172
+ const globalHubContent = `@${getCleoTemplatesTildePath()}/CLEO-INJECTION.md`;
173
173
  await mkdir(globalAgentsDir, { recursive: true });
174
174
  // Direct call — CAAMP 1.8.0 handles idempotency
175
175
  await inject(globalAgentsMd, globalHubContent);
package/src/paths.ts CHANGED
@@ -322,6 +322,25 @@ export function getCleoConfigDir(): string {
322
322
  return getPlatformPaths().config;
323
323
  }
324
324
 
325
+ /**
326
+ * Get the CLEO templates directory as a tilde-prefixed path for use
327
+ * in `@` references (AGENTS.md, CLAUDE.md, etc.). Cross-platform:
328
+ * replaces the user's home directory with `~` so the reference works
329
+ * when loaded by LLM providers that resolve `~` at runtime.
330
+ *
331
+ * Linux: ~/.local/share/cleo/templates
332
+ * macOS: ~/Library/Application Support/cleo/templates
333
+ * Windows: ~/AppData/Local/cleo/Data/templates (approximate)
334
+ */
335
+ export function getCleoTemplatesTildePath(): string {
336
+ const absPath = getCleoTemplatesDir();
337
+ const home = homedir();
338
+ if (absPath.startsWith(home)) {
339
+ return `~${absPath.slice(home.length)}`;
340
+ }
341
+ return absPath;
342
+ }
343
+
325
344
  // ============================================================================
326
345
  // Third-Party Tool Paths (OS-aware)
327
346
  // ============================================================================