@cleocode/paths 2026.5.28 → 2026.5.33

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.
@@ -56,6 +56,33 @@ export declare function getCleoSystemInfo(): SystemInfo;
56
56
  * @public
57
57
  */
58
58
  export declare function getCleoTemplatesTildePath(): string;
59
+ /**
60
+ * Get the CLEO templates directory as a stable tilde-prefixed path for use in
61
+ * `@`-references written into shared files (e.g. `~/.agents/AGENTS.md`).
62
+ *
63
+ * Unlike {@link getCleoTemplatesTildePath}, this function is **immune to
64
+ * `CLEO_HOME` overrides**. It derives the reference from `homedir()` alone
65
+ * via the canonical `~/.cleo` symlink path, which is always stable regardless
66
+ * of the current `CLEO_HOME` env var value.
67
+ *
68
+ * This is the correct function to use when writing a template reference into
69
+ * a file that persists across sessions (e.g. the global `~/.agents/AGENTS.md`
70
+ * hub). Using {@link getCleoTemplatesTildePath} there causes test environments
71
+ * — which override `CLEO_HOME` to a temp directory — to write stale temp-path
72
+ * blocks into the real AGENTS.md on every test run (T9020 / T1929).
73
+ *
74
+ * @returns `"~/.cleo/templates"` on all platforms — resolves via the `~/.cleo`
75
+ * symlink to the OS-appropriate canonical data directory at runtime.
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * const ref = `@${getCanonicalTemplatesTildePath()}/CLEO-INJECTION.md`;
80
+ * // "@~/.cleo/templates/CLEO-INJECTION.md"
81
+ * ```
82
+ *
83
+ * @public
84
+ */
85
+ export declare function getCanonicalTemplatesTildePath(): string;
59
86
  /**
60
87
  * Invalidate the cached CLEO system info snapshot. Use in tests after
61
88
  * mutating `CLEO_HOME` or related env vars.
@@ -1 +1 @@
1
- {"version":3,"file":"cleo-paths.d.ts","sourceRoot":"","sources":["../src/cleo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAE9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAQlD;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
1
+ {"version":3,"file":"cleo-paths.d.ts","sourceRoot":"","sources":["../src/cleo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,IAAI,UAAU,CAE9C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAQlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAMvD;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
@@ -74,6 +74,39 @@ export function getCleoTemplatesTildePath() {
74
74
  }
75
75
  return absPath;
76
76
  }
77
+ /**
78
+ * Get the CLEO templates directory as a stable tilde-prefixed path for use in
79
+ * `@`-references written into shared files (e.g. `~/.agents/AGENTS.md`).
80
+ *
81
+ * Unlike {@link getCleoTemplatesTildePath}, this function is **immune to
82
+ * `CLEO_HOME` overrides**. It derives the reference from `homedir()` alone
83
+ * via the canonical `~/.cleo` symlink path, which is always stable regardless
84
+ * of the current `CLEO_HOME` env var value.
85
+ *
86
+ * This is the correct function to use when writing a template reference into
87
+ * a file that persists across sessions (e.g. the global `~/.agents/AGENTS.md`
88
+ * hub). Using {@link getCleoTemplatesTildePath} there causes test environments
89
+ * — which override `CLEO_HOME` to a temp directory — to write stale temp-path
90
+ * blocks into the real AGENTS.md on every test run (T9020 / T1929).
91
+ *
92
+ * @returns `"~/.cleo/templates"` on all platforms — resolves via the `~/.cleo`
93
+ * symlink to the OS-appropriate canonical data directory at runtime.
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const ref = `@${getCanonicalTemplatesTildePath()}/CLEO-INJECTION.md`;
98
+ * // "@~/.cleo/templates/CLEO-INJECTION.md"
99
+ * ```
100
+ *
101
+ * @public
102
+ */
103
+ export function getCanonicalTemplatesTildePath() {
104
+ // Always return the stable ~/.cleo symlink path. This symlink is created by
105
+ // bootstrapGlobalCleo() and always points to the OS-appropriate canonical data
106
+ // directory (e.g. ~/.local/share/cleo on Linux). Using this path here ensures
107
+ // that CLEO_HOME overrides in test environments do NOT pollute shared files.
108
+ return '~/.cleo/templates';
109
+ }
77
110
  /**
78
111
  * Invalidate the cached CLEO system info snapshot. Use in tests after
79
112
  * mutating `CLEO_HOME` or related env vars.
@@ -1 +1 @@
1
- {"version":3,"file":"cleo-paths.js","sourceRoot":"","sources":["../src/cleo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,2BAA2B,GAG5B,MAAM,qBAAqB,CAAC;AAE7B,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC,MAAM,YAAY,GAAG,2BAA2B,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAEtE;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,YAAY,CAAC,gBAAgB,EAAE,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,YAAY,CAAC,gBAAgB,EAAE,C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;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,YAAY,CAAC,aAAa,EAAE,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAChE,OAAO,IAAI,QAAQ,EAAE,CAAC;IACxB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,UAAU,8BAA8B;IAC5C,4EAA4E;IAC5E,+EAA+E;IAC/E,8EAA8E;IAC9E,6EAA6E;IAC7E,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,4BAA4B;IAC1C,YAAY,CAAC,UAAU,EAAE,CAAC;AAC5B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@
19
19
  * @task T1883
20
20
  */
21
21
  export { isAbsolutePath } from './abs-path.js';
22
- export { _resetCleoPlatformPathsCache, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, } from './cleo-paths.js';
22
+ export { _resetCleoPlatformPathsCache, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, } from './cleo-paths.js';
23
23
  export { createPlatformPathsResolver, type PlatformPaths, type PlatformPathsResolver, type SystemInfo, } from './platform-paths.js';
24
24
  export { computeProjectHash, getCleoWorktreesRoot, resolveTaskWorktreePath, resolveWorktreeRootForHash, } from './worktree-paths.js';
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@
19
19
  * @task T1883
20
20
  */
21
21
  export { isAbsolutePath } from './abs-path.js';
22
- export { _resetCleoPlatformPathsCache, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, } from './cleo-paths.js';
22
+ export { _resetCleoPlatformPathsCache, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, } from './cleo-paths.js';
23
23
  export { createPlatformPathsResolver, } from './platform-paths.js';
24
24
  export { computeProjectHash, getCleoWorktreesRoot, resolveTaskWorktreePath, resolveWorktreeRootForHash, } from './worktree-paths.js';
25
25
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,GAI5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,8BAA8B,EAC9B,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,GAI5B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/paths",
3
- "version": "2026.5.28",
3
+ "version": "2026.5.33",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "CLEO XDG/env-paths SSoT — createPlatformPathsResolver factory, cleo-bound platform paths, project hash + worktree root primitives, isAbsolutePath. Zero-dep leaf package consumed by core, worktree, brain, adapters, and caamp.",