@cleocode/brain 2026.9.20 → 2026.9.22
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/src/cleo-home.d.ts
CHANGED
|
@@ -23,9 +23,10 @@ export { getCleoHome };
|
|
|
23
23
|
* Returns the project's `.cleo/` directory.
|
|
24
24
|
*
|
|
25
25
|
* Resolution order:
|
|
26
|
-
* 1. {@link resolveProjectByCwd} — reads
|
|
27
|
-
*
|
|
28
|
-
* {@link resolveCanonicalCleoDir}
|
|
26
|
+
* 1. {@link resolveProjectByCwd} — reads the declared `projectId`
|
|
27
|
+
* (`.cleo/project-id`, then `project-info.json`) and the checkout root. The
|
|
28
|
+
* registry path from {@link resolveCanonicalCleoDir} is used only when it
|
|
29
|
+
* names this same checkout (T12470); otherwise `<projectRoot>/.cleo`.
|
|
29
30
|
* 2. Fallback: `CLEO_ROOT` env var or `process.cwd()` + `'.cleo'` for
|
|
30
31
|
* non-project contexts (e.g., before `cleo init`).
|
|
31
32
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleo-home.d.ts","sourceRoot":"","sources":["../../src/cleo-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,
|
|
1
|
+
{"version":3,"file":"cleo-home.d.ts","sourceRoot":"","sources":["../../src/cleo-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAEL,WAAW,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAkB1C;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,qEAAqE;AACrE,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,qEAAqE;AACrE,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,kEAAkE;AAClE,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,0DAA0D;AAC1D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
package/dist/src/cleo-home.js
CHANGED
|
@@ -19,15 +19,16 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { existsSync } from 'node:fs';
|
|
21
21
|
import { join } from 'node:path';
|
|
22
|
-
import { getCleoHome, resolveCanonicalCleoDir, resolveProjectByCwd } from '@cleocode/paths';
|
|
22
|
+
import { canonicalizePath, getCleoHome, resolveCanonicalCleoDir, resolveProjectByCwd, } from '@cleocode/paths';
|
|
23
23
|
export { getCleoHome };
|
|
24
24
|
/**
|
|
25
25
|
* Returns the project's `.cleo/` directory.
|
|
26
26
|
*
|
|
27
27
|
* Resolution order:
|
|
28
|
-
* 1. {@link resolveProjectByCwd} — reads
|
|
29
|
-
*
|
|
30
|
-
* {@link resolveCanonicalCleoDir}
|
|
28
|
+
* 1. {@link resolveProjectByCwd} — reads the declared `projectId`
|
|
29
|
+
* (`.cleo/project-id`, then `project-info.json`) and the checkout root. The
|
|
30
|
+
* registry path from {@link resolveCanonicalCleoDir} is used only when it
|
|
31
|
+
* names this same checkout (T12470); otherwise `<projectRoot>/.cleo`.
|
|
31
32
|
* 2. Fallback: `CLEO_ROOT` env var or `process.cwd()` + `'.cleo'` for
|
|
32
33
|
* non-project contexts (e.g., before `cleo init`).
|
|
33
34
|
*
|
|
@@ -36,11 +37,17 @@ export { getCleoHome };
|
|
|
36
37
|
export function getCleoProjectDir() {
|
|
37
38
|
const project = resolveProjectByCwd();
|
|
38
39
|
if (project !== null) {
|
|
40
|
+
const local = join(project.projectRoot, '.cleo');
|
|
41
|
+
// T12470: the registry names ONE checkout per project id — whichever was
|
|
42
|
+
// confirmed last. Two clones of one project share the id, so the registry
|
|
43
|
+
// answer is used only when it agrees with the checkout the caller is in;
|
|
44
|
+
// otherwise clone A would read clone B's `.cleo/`. Mirrors the
|
|
45
|
+
// path-agrees check in core's getCleoDirAbsolute.
|
|
39
46
|
const canonical = resolveCanonicalCleoDir(project.projectId);
|
|
40
|
-
if (canonical !== null)
|
|
47
|
+
if (canonical !== null && canonicalizePath(canonical) === canonicalizePath(local)) {
|
|
41
48
|
return canonical;
|
|
42
|
-
|
|
43
|
-
return
|
|
49
|
+
}
|
|
50
|
+
return local;
|
|
44
51
|
}
|
|
45
52
|
// Fallback for non-project contexts (pre-init, CLEO_ROOT override).
|
|
46
53
|
const root = process.env['CLEO_ROOT'] ?? process.cwd();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleo-home.js","sourceRoot":"","sources":["../../src/cleo-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"cleo-home.js","sourceRoot":"","sources":["../../src/cleo-home.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACjD,yEAAyE;QACzE,0EAA0E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