@cleocode/paths 2026.5.81 → 2026.5.83

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.
@@ -83,6 +83,34 @@ export declare function getCleoTemplatesTildePath(): string;
83
83
  * @public
84
84
  */
85
85
  export declare function getCanonicalTemplatesTildePath(): string;
86
+ /**
87
+ * Resolve the legacy `~/.cleo` directory, with optional explicit override.
88
+ *
89
+ * On a fully-bootstrapped install `~/.cleo` is a symlink to {@link getCleoHome}
90
+ * (see `ensureCleoSymlink` in `@cleocode/core/bootstrap`), so writes through
91
+ * this path land in the canonical OS-appropriate location. The override
92
+ * argument takes precedence and is the standard wiring for CLI commands that
93
+ * accept a `--cleo-dir` flag (`cleo daemon`, `cleo gc`, …).
94
+ *
95
+ * This helper centralizes the `args['--cleo-dir'] ?? join(homedir(), '.cleo')`
96
+ * pattern that was previously duplicated across the CLI surface. Prefer
97
+ * {@link getCleoHome} when you need the canonical (post-XDG) data directory
98
+ * and there is no legacy-path or `--cleo-dir` override semantic.
99
+ *
100
+ * @param override - Explicit override (typically the `--cleo-dir` CLI arg)
101
+ * @returns Absolute path to the resolved `.cleo` directory
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * // CLI handler
106
+ * const cleoDir = resolveLegacyCleoDir(args['cleo-dir'] as string | undefined);
107
+ * // Bootstrap migration probe
108
+ * const legacyPath = resolveLegacyCleoDir();
109
+ * ```
110
+ *
111
+ * @public
112
+ */
113
+ export declare function resolveLegacyCleoDir(override?: string): string;
86
114
  /**
87
115
  * Invalidate the cached CLEO system info snapshot. Use in tests after
88
116
  * 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,CAelD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAMvD;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,CAelD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,8BAA8B,IAAI,MAAM,CAMvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
@@ -113,6 +113,38 @@ export function getCanonicalTemplatesTildePath() {
113
113
  // that CLEO_HOME overrides in test environments do NOT pollute shared files.
114
114
  return '~/.cleo/templates';
115
115
  }
116
+ /**
117
+ * Resolve the legacy `~/.cleo` directory, with optional explicit override.
118
+ *
119
+ * On a fully-bootstrapped install `~/.cleo` is a symlink to {@link getCleoHome}
120
+ * (see `ensureCleoSymlink` in `@cleocode/core/bootstrap`), so writes through
121
+ * this path land in the canonical OS-appropriate location. The override
122
+ * argument takes precedence and is the standard wiring for CLI commands that
123
+ * accept a `--cleo-dir` flag (`cleo daemon`, `cleo gc`, …).
124
+ *
125
+ * This helper centralizes the `args['--cleo-dir'] ?? join(homedir(), '.cleo')`
126
+ * pattern that was previously duplicated across the CLI surface. Prefer
127
+ * {@link getCleoHome} when you need the canonical (post-XDG) data directory
128
+ * and there is no legacy-path or `--cleo-dir` override semantic.
129
+ *
130
+ * @param override - Explicit override (typically the `--cleo-dir` CLI arg)
131
+ * @returns Absolute path to the resolved `.cleo` directory
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * // CLI handler
136
+ * const cleoDir = resolveLegacyCleoDir(args['cleo-dir'] as string | undefined);
137
+ * // Bootstrap migration probe
138
+ * const legacyPath = resolveLegacyCleoDir();
139
+ * ```
140
+ *
141
+ * @public
142
+ */
143
+ export function resolveLegacyCleoDir(override) {
144
+ if (override)
145
+ return override;
146
+ return join(homedir(), '.cleo');
147
+ }
116
148
  /**
117
149
  * Invalidate the cached CLEO system info snapshot. Use in tests after
118
150
  * 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,EAAE,kBAAkB,CAAC,CAAC;AAE1F;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB;IAClC,OAAO,YAAY,CAAC,gB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O,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;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAiB;IACpD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AAClC,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, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, } from './cleo-paths.js';
22
+ export { _resetCleoPlatformPathsCache, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, resolveLegacyCleoDir, } 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,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"}
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,EACzB,oBAAoB,GACrB,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, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, } from './cleo-paths.js';
22
+ export { _resetCleoPlatformPathsCache, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoSystemInfo, getCleoTemplatesTildePath, resolveLegacyCleoDir, } 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,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"}
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,EACzB,oBAAoB,GACrB,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.81",
3
+ "version": "2026.5.83",
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.",