@cleocode/paths 2026.9.23 → 2026.9.25
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/cleo-paths.d.ts +37 -7
- package/dist/cleo-paths.d.ts.map +1 -1
- package/dist/cleo-paths.js +53 -7
- package/dist/cleo-paths.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/portable-project-id.d.ts +170 -14
- package/dist/portable-project-id.d.ts.map +1 -1
- package/dist/portable-project-id.js +216 -17
- package/dist/portable-project-id.js.map +1 -1
- package/package.json +1 -1
package/dist/cleo-paths.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @task T1883
|
|
10
10
|
*/
|
|
11
11
|
import { type PlatformPaths, type SystemInfo } from './platform-paths.js';
|
|
12
|
+
import { type TrackedIdentityFile } from './portable-project-id.js';
|
|
12
13
|
/**
|
|
13
14
|
* Get OS-appropriate paths for CLEO's global directories.
|
|
14
15
|
*
|
|
@@ -61,6 +62,23 @@ export declare function getCleoStateDir(): string;
|
|
|
61
62
|
* @task T12506
|
|
62
63
|
*/
|
|
63
64
|
export declare function resolveStableDeviceIdPath(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Path of this device's sync replica registry —
|
|
67
|
+
* `<cleoStateDir>/sync/replicas-<deviceId>.json`.
|
|
68
|
+
*
|
|
69
|
+
* The registry is machine-local device state and never synced (journal spec
|
|
70
|
+
* N6). It lives in the state dir, not in a store and not beside synced data,
|
|
71
|
+
* and its name carries the device id, so a copy of the state dir that lands
|
|
72
|
+
* on another device is not read there.
|
|
73
|
+
*
|
|
74
|
+
* @param deviceId - The stable device id (`getStableDeviceId()`).
|
|
75
|
+
* @returns Absolute path of the registry file. Not created.
|
|
76
|
+
* @throws {Error} When `deviceId` is not a plain identifier.
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
* @task T12342
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveSyncReplicaRegistryPath(deviceId: string): string;
|
|
64
82
|
/**
|
|
65
83
|
* Get a cached system information snapshot scoped to CLEO.
|
|
66
84
|
*
|
|
@@ -151,9 +169,10 @@ export declare function resolveLegacyCleoDir(override?: string): string;
|
|
|
151
169
|
*/
|
|
152
170
|
export interface ResolvedProject {
|
|
153
171
|
/**
|
|
154
|
-
* The project's portable identity (ADR-094, T12470): the tracked
|
|
155
|
-
* `.cleo/project
|
|
156
|
-
* `.cleo/project-info.json`. Never
|
|
172
|
+
* The project's portable identity (ADR-094, T12470, T12716): the tracked
|
|
173
|
+
* `.cleo/project.json` id (or the legacy `.cleo/project-id`) when valid,
|
|
174
|
+
* otherwise the `projectId` cached in `.cleo/project-info.json`. Never
|
|
175
|
+
* derived from the path. Treat it as an
|
|
157
176
|
* opaque string — ids of every historical shape (UUID, 12-hex, legacy) occur.
|
|
158
177
|
*/
|
|
159
178
|
projectId: string;
|
|
@@ -177,17 +196,28 @@ export interface ResolvedProject {
|
|
|
177
196
|
export interface DeclaredProjectIdentity {
|
|
178
197
|
/** The opaque project id. */
|
|
179
198
|
readonly projectId: string;
|
|
180
|
-
/**
|
|
199
|
+
/**
|
|
200
|
+
* `tracked` = `.cleo/project.json` or the legacy `.cleo/project-id`;
|
|
201
|
+
* `project-info` = the device-local cache in `.cleo/project-info.json`.
|
|
202
|
+
*/
|
|
181
203
|
readonly source: 'tracked' | 'project-info';
|
|
204
|
+
/** Which tracked file supplied the id, when `source` is `tracked` (T12716). */
|
|
205
|
+
readonly trackedFile?: TrackedIdentityFile;
|
|
206
|
+
/** The committed display name, when `.cleo/project.json` declares one (T12716). */
|
|
207
|
+
readonly name?: string;
|
|
182
208
|
/** The `projectId` recorded in `project-info.json`, when that file has one. */
|
|
183
209
|
readonly infoProjectId?: string;
|
|
184
210
|
}
|
|
185
211
|
/**
|
|
186
|
-
* Read the identity a project root DECLARES, in precedence order (T12470
|
|
212
|
+
* Read the identity a project root DECLARES, in precedence order (T12470,
|
|
213
|
+
* T12716):
|
|
187
214
|
*
|
|
188
|
-
* 1. the tracked, write-once `.cleo/project
|
|
189
|
-
*
|
|
215
|
+
* 1. the tracked, write-once id: `.cleo/project.json`, else the legacy
|
|
216
|
+
* `.cleo/project-id` ({@link readPortableProjectId}, ADR-094);
|
|
217
|
+
* 2. the `projectId` cached in `.cleo/project-info.json`.
|
|
190
218
|
*
|
|
219
|
+
* The tracked id always wins; a disagreeing cache is reported by
|
|
220
|
+
* `cleo doctor project-identity` and re-keyed only by its `--resolve`.
|
|
191
221
|
* A malformed tracked file is skipped here (it is reported by
|
|
192
222
|
* `cleo doctor project-identity`) and never replaced by a derived value.
|
|
193
223
|
* Nothing about the path — its spelling, realpath, git root or remote — takes
|
package/dist/cleo-paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleo-paths.d.ts","sourceRoot":"","sources":["../src/cleo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cleo-paths.d.ts","sourceRoot":"","sources":["../src/cleo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAyB,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAwB3F;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,aAAa,CAEpD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAOxC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;;;;;;;;;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EAAE,MAAM,GAAG,MAAM,CASlD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWjE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAiC,CAAC;AAEhG;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,4BAA4B;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,KAAK,EAAE,QAAQ,CAAC,mBAAmB,CAAC,GACnC,MAAM,EAAE,CAKV;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CA+BxE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgFxE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
|
package/dist/cleo-paths.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { execFileSync } from 'node:child_process';
|
|
12
12
|
import { createHash } from 'node:crypto';
|
|
13
|
-
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
13
|
+
import { existsSync, readFileSync, realpathSync, statSync } from 'node:fs';
|
|
14
14
|
import { createRequire } from 'node:module';
|
|
15
15
|
import { homedir } from 'node:os';
|
|
16
16
|
import { dirname, join, resolve } from 'node:path';
|
|
@@ -96,6 +96,28 @@ export function getCleoStateDir() {
|
|
|
96
96
|
export function resolveStableDeviceIdPath() {
|
|
97
97
|
return join(getCleoHome(), 'device-id');
|
|
98
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Path of this device's sync replica registry —
|
|
101
|
+
* `<cleoStateDir>/sync/replicas-<deviceId>.json`.
|
|
102
|
+
*
|
|
103
|
+
* The registry is machine-local device state and never synced (journal spec
|
|
104
|
+
* N6). It lives in the state dir, not in a store and not beside synced data,
|
|
105
|
+
* and its name carries the device id, so a copy of the state dir that lands
|
|
106
|
+
* on another device is not read there.
|
|
107
|
+
*
|
|
108
|
+
* @param deviceId - The stable device id (`getStableDeviceId()`).
|
|
109
|
+
* @returns Absolute path of the registry file. Not created.
|
|
110
|
+
* @throws {Error} When `deviceId` is not a plain identifier.
|
|
111
|
+
*
|
|
112
|
+
* @public
|
|
113
|
+
* @task T12342
|
|
114
|
+
*/
|
|
115
|
+
export function resolveSyncReplicaRegistryPath(deviceId) {
|
|
116
|
+
if (!/^[A-Za-z0-9_-]{1,64}$/.test(deviceId)) {
|
|
117
|
+
throw new Error(`invalid device id for the sync replica registry: ${deviceId}`);
|
|
118
|
+
}
|
|
119
|
+
return join(getCleoStateDir(), 'sync', `replicas-${deviceId}.json`);
|
|
120
|
+
}
|
|
99
121
|
/**
|
|
100
122
|
* Get a cached system information snapshot scoped to CLEO.
|
|
101
123
|
*
|
|
@@ -221,11 +243,15 @@ function _readProjectInfoId(projectRoot) {
|
|
|
221
243
|
}
|
|
222
244
|
}
|
|
223
245
|
/**
|
|
224
|
-
* Read the identity a project root DECLARES, in precedence order (T12470
|
|
246
|
+
* Read the identity a project root DECLARES, in precedence order (T12470,
|
|
247
|
+
* T12716):
|
|
225
248
|
*
|
|
226
|
-
* 1. the tracked, write-once `.cleo/project
|
|
227
|
-
*
|
|
249
|
+
* 1. the tracked, write-once id: `.cleo/project.json`, else the legacy
|
|
250
|
+
* `.cleo/project-id` ({@link readPortableProjectId}, ADR-094);
|
|
251
|
+
* 2. the `projectId` cached in `.cleo/project-info.json`.
|
|
228
252
|
*
|
|
253
|
+
* The tracked id always wins; a disagreeing cache is reported by
|
|
254
|
+
* `cleo doctor project-identity` and re-keyed only by its `--resolve`.
|
|
229
255
|
* A malformed tracked file is skipped here (it is reported by
|
|
230
256
|
* `cleo doctor project-identity`) and never replaced by a derived value.
|
|
231
257
|
* Nothing about the path — its spelling, realpath, git root or remote — takes
|
|
@@ -249,6 +275,8 @@ export function readDeclaredProjectIdentity(projectRoot) {
|
|
|
249
275
|
return {
|
|
250
276
|
projectId: tracked.projectId,
|
|
251
277
|
source: 'tracked',
|
|
278
|
+
...(tracked.file !== undefined && { trackedFile: tracked.file }),
|
|
279
|
+
...(tracked.name !== undefined && { name: tracked.name }),
|
|
252
280
|
...(infoProjectId !== undefined && { infoProjectId }),
|
|
253
281
|
};
|
|
254
282
|
}
|
|
@@ -257,6 +285,19 @@ export function readDeclaredProjectIdentity(projectRoot) {
|
|
|
257
285
|
}
|
|
258
286
|
return null;
|
|
259
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Whether `<dir>/.git` is a DIRECTORY (a git toplevel). A linked worktree's
|
|
290
|
+
* `.git` is a gitlink FILE: a tracked-only `.cleo/` there is not a project
|
|
291
|
+
* root, matching core's `validateProjectRoot` (T12716 review finding 8).
|
|
292
|
+
*/
|
|
293
|
+
function _isGitDirectory(dir) {
|
|
294
|
+
try {
|
|
295
|
+
return statSync(join(dir, '.git')).isDirectory();
|
|
296
|
+
}
|
|
297
|
+
catch {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
260
301
|
// ---------------------------------------------------------------------------
|
|
261
302
|
// Path fingerprint (alias key only — never an identity, T12470)
|
|
262
303
|
// ---------------------------------------------------------------------------
|
|
@@ -298,6 +339,10 @@ function _findGitRemoteUrlSync(fromPath) {
|
|
|
298
339
|
/**
|
|
299
340
|
* Read the project name from `.cleo/project-info.json` (if present).
|
|
300
341
|
* Non-fatal on any I/O or parse error.
|
|
342
|
+
*
|
|
343
|
+
* Deliberately NOT the display name (`.cleo/project.json`, T12716): this value
|
|
344
|
+
* is an input to the path fingerprint, a legacy alias KEY that must keep
|
|
345
|
+
* matching the keys older builds recorded. A rename never changes it.
|
|
301
346
|
*/
|
|
302
347
|
function _readProjectInfoName(repoRoot) {
|
|
303
348
|
try {
|
|
@@ -451,11 +496,12 @@ export function resolveProjectByCwd(cwd) {
|
|
|
451
496
|
while (true) {
|
|
452
497
|
if (existsSync(join(current, '.cleo'))) {
|
|
453
498
|
const declared = readDeclaredProjectIdentity(current);
|
|
454
|
-
// A `.cleo/` holding ONLY a committed
|
|
455
|
-
// is a project root only at a
|
|
499
|
+
// A `.cleo/` holding ONLY a committed identity (project.json or the
|
|
500
|
+
// legacy project-id; no project-info.json) is a project root only at a
|
|
501
|
+
// git toplevel — a real `.git/` directory, never a worktree's gitlink. Otherwise a monorepo
|
|
456
502
|
// subdirectory that carries a committed id would shadow its parent.
|
|
457
503
|
const trackedOnly = declared?.source === 'tracked' && declared.infoProjectId === undefined;
|
|
458
|
-
if (declared !== null && (!trackedOnly ||
|
|
504
|
+
if (declared !== null && (!trackedOnly || _isGitDirectory(current))) {
|
|
459
505
|
return {
|
|
460
506
|
projectId: declared.projectId,
|
|
461
507
|
projectRoot: canonicalizePath(current),
|
package/dist/cleo-paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleo-paths.js","sourceRoot":"","sources":["../src/cleo-paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;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UAAU,EAAE,CAAC;AAC5B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,21 +15,23 @@
|
|
|
15
15
|
* {@link resolveWorktreeRootForHash}, {@link resolveTaskWorktreePath},
|
|
16
16
|
* {@link getCleoWorktreesRoot}, {@link resolveWorktreeIndexPath}
|
|
17
17
|
* - {@link getCleoStateDir} — CLEO state dir (XDG state on Linux, `<cleoHome>/state` elsewhere)
|
|
18
|
+
* - {@link resolveSyncReplicaRegistryPath} — this device's sync replica registry (state dir, never synced)
|
|
18
19
|
* - {@link expandTildePath} — `~` expansion via `os.homedir()`
|
|
19
20
|
* - {@link isAbsolutePath} — cross-platform abs-path check
|
|
20
21
|
* - Executable search: {@link findOnPath}, {@link prependPathEntry},
|
|
21
22
|
* {@link splitPathEnv} (PATH delimiter + PATHEXT aware, T12605)
|
|
22
|
-
* - Portable identity: {@link readPortableProjectId} (tracked `.cleo/project
|
|
23
|
+
* - Portable identity: {@link readPortableProjectId} (tracked `.cleo/project.json`, then the
|
|
24
|
+
* legacy `.cleo/project-id`; T12325 · T12716) and {@link readProjectManifest}
|
|
23
25
|
*
|
|
24
26
|
* @packageDocumentation
|
|
25
27
|
* @task T1883
|
|
26
28
|
* @task T11008
|
|
27
29
|
*/
|
|
28
30
|
export { isAbsolutePath } from './abs-path.js';
|
|
29
|
-
export { _resetCleoPlatformPathsCache, canonicalizePath, computeCanonicalProjectId, computePathFingerprintId, type DeclaredProjectIdentity, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoStateDir, getCleoSystemInfo, getCleoTemplatesTildePath, legacyAliasClaimants, legacyProjectId, type RecordedProjectPath, type ResolvedProject, readDeclaredProjectIdentity, resolveCanonicalCleoDir, resolveLegacyCleoDir, resolveProjectByCwd, resolveStableDeviceIdPath, } from './cleo-paths.js';
|
|
31
|
+
export { _resetCleoPlatformPathsCache, canonicalizePath, computeCanonicalProjectId, computePathFingerprintId, type DeclaredProjectIdentity, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoStateDir, getCleoSystemInfo, getCleoTemplatesTildePath, legacyAliasClaimants, legacyProjectId, type RecordedProjectPath, type ResolvedProject, readDeclaredProjectIdentity, resolveCanonicalCleoDir, resolveLegacyCleoDir, resolveProjectByCwd, resolveStableDeviceIdPath, resolveSyncReplicaRegistryPath, } from './cleo-paths.js';
|
|
30
32
|
export { type ExecPathOptions, executableNames, findOnPath, pathDelimiterFor, pathEnvKey, prependPathEntry, quoteCmdArg, resolveSpawnInvocation, type ShellInvocation, type SpawnInvocation, shellInvocation, splitPathEnv, } from './exec-path.js';
|
|
31
33
|
export { type EnforceOptions, enforceNodeVersion, evaluateNodeVersion, FALLBACK_MIN_NODE, getRequiredNodeVersion, type NodeManager, type NodeVersionVerdict, parseSemver, type Semver, type UpgradeHint, } from './node-version-gate.js';
|
|
32
34
|
export { createPlatformPathsResolver, expandTildePath, type PlatformPaths, type PlatformPathsResolver, type SystemInfo, } from './platform-paths.js';
|
|
33
|
-
export { formatPortableProjectId, isValidPortableProjectId, PORTABLE_PROJECT_ID_FILE, type PortableProjectIdRead, parsePortableProjectId, portableProjectIdPath, readPortableProjectId, } from './portable-project-id.js';
|
|
35
|
+
export { formatPortableProjectId, formatProjectManifest, isValidPortableProjectId, isValidProjectDisplayName, PORTABLE_PROJECT_ID_FILE, type PortableProjectIdRead, PROJECT_DISPLAY_NAME_MAX, PROJECT_MANIFEST_FILE, PROJECT_MANIFEST_SCHEMA_VERSION, type ProjectManifest, type ProjectManifestRead, parsePortableProjectId, parseProjectManifest, portableProjectIdPath, projectManifestPath, readPortableProjectId, readProjectIdFile, readProjectManifest, type TrackedIdentityFile, } from './portable-project-id.js';
|
|
34
36
|
export { computeProjectHash, getCleoWorktreesRoot, resolveTaskWorktreePath, resolveWorktreeIndexPath, resolveWorktreeRootForHash, resolveWorktreeTaskLockPath, } from './worktree-paths.js';
|
|
35
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,uBAAuB,EAC5B,8BAA8B,EAC9B,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,eAAe,EACpB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,eAAe,EACf,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,cAAc,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,WAAW,EACX,KAAK,MAAM,EACX,KAAK,WAAW,GACjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,+BAA+B,EAC/B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,21 +15,23 @@
|
|
|
15
15
|
* {@link resolveWorktreeRootForHash}, {@link resolveTaskWorktreePath},
|
|
16
16
|
* {@link getCleoWorktreesRoot}, {@link resolveWorktreeIndexPath}
|
|
17
17
|
* - {@link getCleoStateDir} — CLEO state dir (XDG state on Linux, `<cleoHome>/state` elsewhere)
|
|
18
|
+
* - {@link resolveSyncReplicaRegistryPath} — this device's sync replica registry (state dir, never synced)
|
|
18
19
|
* - {@link expandTildePath} — `~` expansion via `os.homedir()`
|
|
19
20
|
* - {@link isAbsolutePath} — cross-platform abs-path check
|
|
20
21
|
* - Executable search: {@link findOnPath}, {@link prependPathEntry},
|
|
21
22
|
* {@link splitPathEnv} (PATH delimiter + PATHEXT aware, T12605)
|
|
22
|
-
* - Portable identity: {@link readPortableProjectId} (tracked `.cleo/project
|
|
23
|
+
* - Portable identity: {@link readPortableProjectId} (tracked `.cleo/project.json`, then the
|
|
24
|
+
* legacy `.cleo/project-id`; T12325 · T12716) and {@link readProjectManifest}
|
|
23
25
|
*
|
|
24
26
|
* @packageDocumentation
|
|
25
27
|
* @task T1883
|
|
26
28
|
* @task T11008
|
|
27
29
|
*/
|
|
28
30
|
export { isAbsolutePath } from './abs-path.js';
|
|
29
|
-
export { _resetCleoPlatformPathsCache, canonicalizePath, computeCanonicalProjectId, computePathFingerprintId, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoStateDir, getCleoSystemInfo, getCleoTemplatesTildePath, legacyAliasClaimants, legacyProjectId, readDeclaredProjectIdentity, resolveCanonicalCleoDir, resolveLegacyCleoDir, resolveProjectByCwd, resolveStableDeviceIdPath, } from './cleo-paths.js';
|
|
31
|
+
export { _resetCleoPlatformPathsCache, canonicalizePath, computeCanonicalProjectId, computePathFingerprintId, getCanonicalTemplatesTildePath, getCleoHome, getCleoPlatformPaths, getCleoStateDir, getCleoSystemInfo, getCleoTemplatesTildePath, legacyAliasClaimants, legacyProjectId, readDeclaredProjectIdentity, resolveCanonicalCleoDir, resolveLegacyCleoDir, resolveProjectByCwd, resolveStableDeviceIdPath, resolveSyncReplicaRegistryPath, } from './cleo-paths.js';
|
|
30
32
|
export { executableNames, findOnPath, pathDelimiterFor, pathEnvKey, prependPathEntry, quoteCmdArg, resolveSpawnInvocation, shellInvocation, splitPathEnv, } from './exec-path.js';
|
|
31
33
|
export { enforceNodeVersion, evaluateNodeVersion, FALLBACK_MIN_NODE, getRequiredNodeVersion, parseSemver, } from './node-version-gate.js';
|
|
32
34
|
export { createPlatformPathsResolver, expandTildePath, } from './platform-paths.js';
|
|
33
|
-
export { formatPortableProjectId, isValidPortableProjectId, PORTABLE_PROJECT_ID_FILE, parsePortableProjectId, portableProjectIdPath, readPortableProjectId, } from './portable-project-id.js';
|
|
35
|
+
export { formatPortableProjectId, formatProjectManifest, isValidPortableProjectId, isValidProjectDisplayName, PORTABLE_PROJECT_ID_FILE, PROJECT_DISPLAY_NAME_MAX, PROJECT_MANIFEST_FILE, PROJECT_MANIFEST_SCHEMA_VERSION, parsePortableProjectId, parseProjectManifest, portableProjectIdPath, projectManifestPath, readPortableProjectId, readProjectIdFile, readProjectManifest, } from './portable-project-id.js';
|
|
34
36
|
export { computeProjectHash, getCleoWorktreesRoot, resolveTaskWorktreePath, resolveWorktreeIndexPath, resolveWorktreeRootForHash, resolveWorktreeTaskLockPath, } from './worktree-paths.js';
|
|
35
37
|
//# 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
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,wBAAwB,EAExB,8BAA8B,EAC9B,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EAGf,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,8BAA8B,GAC/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,sBAAsB,EAGtB,eAAe,EACf,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EAGtB,WAAW,GAGZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,EAC3B,eAAe,GAIhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EAExB,wBAAwB,EACxB,qBAAqB,EACrB,+BAA+B,EAG/B,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,23 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The tracked, write-once portable project identity
|
|
2
|
+
* The tracked, write-once portable project identity.
|
|
3
3
|
*
|
|
4
4
|
* Every other project identifier CLEO computes hashes the absolute path, and
|
|
5
5
|
* the random `projectId` in `.cleo/project-info.json` is gitignored (ADR-013
|
|
6
|
-
* §9), so a fresh clone used to mint a brand-new identity at `cleo init`.
|
|
7
|
-
*
|
|
8
|
-
* once, commits nothing else beside it, and never rewrites it. Because nothing
|
|
9
|
-
* ever writes it a second time, git has nothing to overwrite — the geometry
|
|
10
|
-
* that made ADR-013 untrack the mutable state files does not apply
|
|
11
|
-
* (ADR-094, T12325).
|
|
6
|
+
* §9), so a fresh clone used to mint a brand-new identity at `cleo init`. The
|
|
7
|
+
* tracked identity travels with the repository instead. Two files carry it:
|
|
12
8
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* - `.cleo/project.json` — canonical since T12716: `{schemaVersion, id, name}`.
|
|
10
|
+
* The id is write-once; the name is the project's committed display name and
|
|
11
|
+
* changes only through `cleo project rename`.
|
|
12
|
+
* - `.cleo/project-id` — the ADR-094 id-only file (T12325). Kept as a legacy
|
|
13
|
+
* mirror so builds that know only this file keep resolving the same id.
|
|
14
|
+
*
|
|
15
|
+
* {@link readPortableProjectId} is the ONE resolver over both: `project.json`
|
|
16
|
+
* wins, `project-id` is the fallback. Because nothing rewrites the id, git has
|
|
17
|
+
* nothing to overwrite — the geometry that made ADR-013 untrack the mutable
|
|
18
|
+
* state files does not apply (ADR-094, T12325; ADR-096, T12716).
|
|
19
|
+
*
|
|
20
|
+
* This module only READS. Writing (create-only), renaming and migration live
|
|
21
|
+
* in `@cleocode/core` (`scaffold/project-identity.ts`, `project-manifest.ts`,
|
|
22
|
+
* `doctor/project-identity.ts`).
|
|
15
23
|
*
|
|
16
24
|
* @packageDocumentation
|
|
17
25
|
* @task T12325
|
|
26
|
+
* @task T12716
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Basename of the legacy id-only identity file inside a project's `.cleo/`
|
|
30
|
+
* (ADR-094). Superseded by {@link PROJECT_MANIFEST_FILE}; still read as a
|
|
31
|
+
* fallback and kept as a mirror for older builds (T12716).
|
|
18
32
|
*/
|
|
19
|
-
/** Basename of the tracked portable identity file inside a project's `.cleo/`. */
|
|
20
33
|
export declare const PORTABLE_PROJECT_ID_FILE = "project-id";
|
|
34
|
+
/** Basename of the canonical tracked identity manifest inside `.cleo/` (T12716). */
|
|
35
|
+
export declare const PROJECT_MANIFEST_FILE = "project.json";
|
|
36
|
+
/** The only `schemaVersion` of `.cleo/project.json` this build understands. */
|
|
37
|
+
export declare const PROJECT_MANIFEST_SCHEMA_VERSION = 1;
|
|
38
|
+
/**
|
|
39
|
+
* Longest accepted display name. Matches the Cleo Nexus project-label limit so
|
|
40
|
+
* a declared name can always be sent as a label unchanged.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PROJECT_DISPLAY_NAME_MAX = 120;
|
|
21
43
|
/**
|
|
22
44
|
* Outcome of reading `.cleo/project-id`.
|
|
23
45
|
*
|
|
@@ -31,6 +53,42 @@ export type PortableProjectIdRead = {
|
|
|
31
53
|
} | {
|
|
32
54
|
readonly status: 'valid';
|
|
33
55
|
readonly projectId: string;
|
|
56
|
+
/** File that supplied the id; set by the file readers, not by the parser. */
|
|
57
|
+
readonly file?: TrackedIdentityFile;
|
|
58
|
+
/** Declared display name; only `project.json` carries one. */
|
|
59
|
+
readonly name?: string;
|
|
60
|
+
} | {
|
|
61
|
+
readonly status: 'invalid';
|
|
62
|
+
readonly reason: string;
|
|
63
|
+
/** File that is unusable; set by the file readers, not by the parser. */
|
|
64
|
+
readonly file?: TrackedIdentityFile;
|
|
65
|
+
};
|
|
66
|
+
/** A tracked identity file: the canonical manifest or the legacy id-only file. */
|
|
67
|
+
export type TrackedIdentityFile = typeof PROJECT_MANIFEST_FILE | typeof PORTABLE_PROJECT_ID_FILE;
|
|
68
|
+
/**
|
|
69
|
+
* The committed project manifest, `.cleo/project.json` (T12716).
|
|
70
|
+
*
|
|
71
|
+
* @public
|
|
72
|
+
*/
|
|
73
|
+
export interface ProjectManifest {
|
|
74
|
+
/** Manifest format version; always {@link PROJECT_MANIFEST_SCHEMA_VERSION}. */
|
|
75
|
+
readonly schemaVersion: typeof PROJECT_MANIFEST_SCHEMA_VERSION;
|
|
76
|
+
/** Write-once portable project id. */
|
|
77
|
+
readonly id: string;
|
|
78
|
+
/** Display name; renamed only through `cleo project rename`. */
|
|
79
|
+
readonly name: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Outcome of reading `.cleo/project.json`. As with the id file, `invalid` is a
|
|
83
|
+
* diagnostic to report, never a reason to mint or regenerate.
|
|
84
|
+
*
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
export type ProjectManifestRead = {
|
|
88
|
+
readonly status: 'absent';
|
|
89
|
+
} | {
|
|
90
|
+
readonly status: 'valid';
|
|
91
|
+
readonly manifest: ProjectManifest;
|
|
34
92
|
} | {
|
|
35
93
|
readonly status: 'invalid';
|
|
36
94
|
readonly reason: string;
|
|
@@ -85,16 +143,114 @@ export declare function formatPortableProjectId(projectId: string): string;
|
|
|
85
143
|
*/
|
|
86
144
|
export declare function parsePortableProjectId(content: string): PortableProjectIdRead;
|
|
87
145
|
/**
|
|
88
|
-
* Read the
|
|
146
|
+
* Read ONLY the legacy `.cleo/project-id` file, synchronously.
|
|
147
|
+
*
|
|
148
|
+
* Callers that need the project's id use {@link readPortableProjectId}, which
|
|
149
|
+
* prefers `project.json`. This is for code that manages the legacy file
|
|
150
|
+
* itself (the doctor, the mirror writer, identity retirement).
|
|
151
|
+
*
|
|
152
|
+
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
153
|
+
* @returns `absent`, `valid` with the id, or `invalid` with a reason.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* readProjectIdFile('/repo'); // { status: 'valid', projectId: 'c78d09c3a8ee', file: 'project-id' }
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* @public
|
|
161
|
+
* @task T12716
|
|
162
|
+
*/
|
|
163
|
+
export declare function readProjectIdFile(projectRoot: string): PortableProjectIdRead;
|
|
164
|
+
/**
|
|
165
|
+
* Whether a string is an acceptable display name: 1-{@link PROJECT_DISPLAY_NAME_MAX}
|
|
166
|
+
* characters after trimming, no path separator, no leading `~`, no control
|
|
167
|
+
* character. A name is a label, never a path.
|
|
168
|
+
*
|
|
169
|
+
* @param name - Candidate name.
|
|
170
|
+
* @returns `true` when the name is acceptable as-is (already trimmed).
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* isValidProjectDisplayName('cleocode'); // true
|
|
175
|
+
* isValidProjectDisplayName('../x'); // false
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @public
|
|
179
|
+
* @task T12716
|
|
180
|
+
*/
|
|
181
|
+
export declare function isValidProjectDisplayName(name: string): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Absolute path of the canonical identity manifest for a project root.
|
|
184
|
+
*
|
|
185
|
+
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
186
|
+
* @returns `<projectRoot>/.cleo/project.json`.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
* @task T12716
|
|
190
|
+
*/
|
|
191
|
+
export declare function projectManifestPath(projectRoot: string): string;
|
|
192
|
+
/**
|
|
193
|
+
* Render the exact bytes CLEO writes for a manifest: stable key order, two-space
|
|
194
|
+
* indent, trailing newline, so a rename diff touches one line.
|
|
195
|
+
*
|
|
196
|
+
* @param manifest - A manifest with a valid id and name.
|
|
197
|
+
* @returns The file body.
|
|
198
|
+
*
|
|
199
|
+
* @public
|
|
200
|
+
* @task T12716
|
|
201
|
+
*/
|
|
202
|
+
export declare function formatProjectManifest(manifest: ProjectManifest): string;
|
|
203
|
+
/**
|
|
204
|
+
* Parse the body of `.cleo/project.json`.
|
|
205
|
+
*
|
|
206
|
+
* Strict on the three fields: `schemaVersion` must be
|
|
207
|
+
* {@link PROJECT_MANIFEST_SCHEMA_VERSION} (a newer format is `invalid`, so an
|
|
208
|
+
* old build never guesses at it), `id` must pass
|
|
209
|
+
* {@link isValidPortableProjectId}, and `name` must pass
|
|
210
|
+
* {@link isValidProjectDisplayName}. Unknown extra keys are ignored.
|
|
211
|
+
*
|
|
212
|
+
* @param content - Raw file content.
|
|
213
|
+
* @returns `valid` with the manifest, or `invalid` with a reason.
|
|
214
|
+
*
|
|
215
|
+
* @public
|
|
216
|
+
* @task T12716
|
|
217
|
+
*/
|
|
218
|
+
export declare function parseProjectManifest(content: string): ProjectManifestRead;
|
|
219
|
+
/**
|
|
220
|
+
* Read `.cleo/project.json`, synchronously.
|
|
221
|
+
*
|
|
222
|
+
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
223
|
+
* @returns `absent`, `valid` with the manifest, or `invalid` with a reason.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```ts
|
|
227
|
+
* const read = readProjectManifest('/repo');
|
|
228
|
+
* if (read.status === 'valid') console.log(read.manifest.name);
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* @public
|
|
232
|
+
* @task T12716
|
|
233
|
+
*/
|
|
234
|
+
export declare function readProjectManifest(projectRoot: string): ProjectManifestRead;
|
|
235
|
+
/**
|
|
236
|
+
* Read the tracked portable identity of a project, synchronously — the ONE
|
|
237
|
+
* resolver over the tracked files (T12716).
|
|
238
|
+
*
|
|
239
|
+
* Precedence: `.cleo/project.json`, then the legacy `.cleo/project-id`. A
|
|
240
|
+
* malformed `project.json` is `invalid` and does NOT fall through to
|
|
241
|
+
* `project-id`: a broken canonical file is restored from version control,
|
|
242
|
+
* never papered over. When both files are valid and disagree, `project.json`
|
|
243
|
+
* wins here and `cleo doctor project-identity` reports the mirror conflict.
|
|
89
244
|
*
|
|
90
245
|
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
91
|
-
* @returns `absent` when
|
|
92
|
-
*
|
|
246
|
+
* @returns `absent` when neither file exists, `valid` with the id (and the
|
|
247
|
+
* `file` it came from, plus the `name` when `project.json` supplied it), or
|
|
248
|
+
* `invalid` with a reason and the unusable `file`.
|
|
93
249
|
*
|
|
94
250
|
* @example
|
|
95
251
|
* ```ts
|
|
96
252
|
* const read = readPortableProjectId('/repo');
|
|
97
|
-
* if (read.status === 'valid') console.log(read.projectId);
|
|
253
|
+
* if (read.status === 'valid') console.log(read.projectId, read.file);
|
|
98
254
|
* ```
|
|
99
255
|
*
|
|
100
256
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portable-project-id.d.ts","sourceRoot":"","sources":["../src/portable-project-id.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"portable-project-id.d.ts","sourceRoot":"","sources":["../src/portable-project-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,eAAe,CAAC;AAErD,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,iBAAiB,CAAC;AAEpD,+EAA+E;AAC/E,eAAO,MAAM,+BAA+B,IAAI,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAS5C;;;;;;;GAOG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,GAC7B;IACE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB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;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAI5E;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAQ/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAOvE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAgCzE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB,CAI5E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAchF"}
|
|
@@ -1,25 +1,47 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The tracked, write-once portable project identity
|
|
2
|
+
* The tracked, write-once portable project identity.
|
|
3
3
|
*
|
|
4
4
|
* Every other project identifier CLEO computes hashes the absolute path, and
|
|
5
5
|
* the random `projectId` in `.cleo/project-info.json` is gitignored (ADR-013
|
|
6
|
-
* §9), so a fresh clone used to mint a brand-new identity at `cleo init`.
|
|
7
|
-
*
|
|
8
|
-
* once, commits nothing else beside it, and never rewrites it. Because nothing
|
|
9
|
-
* ever writes it a second time, git has nothing to overwrite — the geometry
|
|
10
|
-
* that made ADR-013 untrack the mutable state files does not apply
|
|
11
|
-
* (ADR-094, T12325).
|
|
6
|
+
* §9), so a fresh clone used to mint a brand-new identity at `cleo init`. The
|
|
7
|
+
* tracked identity travels with the repository instead. Two files carry it:
|
|
12
8
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* - `.cleo/project.json` — canonical since T12716: `{schemaVersion, id, name}`.
|
|
10
|
+
* The id is write-once; the name is the project's committed display name and
|
|
11
|
+
* changes only through `cleo project rename`.
|
|
12
|
+
* - `.cleo/project-id` — the ADR-094 id-only file (T12325). Kept as a legacy
|
|
13
|
+
* mirror so builds that know only this file keep resolving the same id.
|
|
14
|
+
*
|
|
15
|
+
* {@link readPortableProjectId} is the ONE resolver over both: `project.json`
|
|
16
|
+
* wins, `project-id` is the fallback. Because nothing rewrites the id, git has
|
|
17
|
+
* nothing to overwrite — the geometry that made ADR-013 untrack the mutable
|
|
18
|
+
* state files does not apply (ADR-094, T12325; ADR-096, T12716).
|
|
19
|
+
*
|
|
20
|
+
* This module only READS. Writing (create-only), renaming and migration live
|
|
21
|
+
* in `@cleocode/core` (`scaffold/project-identity.ts`, `project-manifest.ts`,
|
|
22
|
+
* `doctor/project-identity.ts`).
|
|
15
23
|
*
|
|
16
24
|
* @packageDocumentation
|
|
17
25
|
* @task T12325
|
|
26
|
+
* @task T12716
|
|
18
27
|
*/
|
|
19
28
|
import { readFileSync } from 'node:fs';
|
|
20
29
|
import { join } from 'node:path';
|
|
21
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Basename of the legacy id-only identity file inside a project's `.cleo/`
|
|
32
|
+
* (ADR-094). Superseded by {@link PROJECT_MANIFEST_FILE}; still read as a
|
|
33
|
+
* fallback and kept as a mirror for older builds (T12716).
|
|
34
|
+
*/
|
|
22
35
|
export const PORTABLE_PROJECT_ID_FILE = 'project-id';
|
|
36
|
+
/** Basename of the canonical tracked identity manifest inside `.cleo/` (T12716). */
|
|
37
|
+
export const PROJECT_MANIFEST_FILE = 'project.json';
|
|
38
|
+
/** The only `schemaVersion` of `.cleo/project.json` this build understands. */
|
|
39
|
+
export const PROJECT_MANIFEST_SCHEMA_VERSION = 1;
|
|
40
|
+
/**
|
|
41
|
+
* Longest accepted display name. Matches the Cleo Nexus project-label limit so
|
|
42
|
+
* a declared name can always be sent as a label unchanged.
|
|
43
|
+
*/
|
|
44
|
+
export const PROJECT_DISPLAY_NAME_MAX = 120;
|
|
23
45
|
/**
|
|
24
46
|
* Accepted identity shape: every id CLEO has ever minted (UUIDv4, 12-hex,
|
|
25
47
|
* the 29-char legacy form) fits, and nothing that could smuggle a path
|
|
@@ -68,6 +90,7 @@ export function portableProjectIdPath(projectRoot) {
|
|
|
68
90
|
*/
|
|
69
91
|
export function formatPortableProjectId(projectId) {
|
|
70
92
|
return ('# CLEO portable project identity (write-once; ADR-094, T12325).\n' +
|
|
93
|
+
'# Legacy mirror of the id in .cleo/project.json (T12716) for older CLEO builds.\n' +
|
|
71
94
|
'# Commit this file. Never edit or regenerate it: every checkout, clone and\n' +
|
|
72
95
|
'# device of this project resolves to the id below.\n' +
|
|
73
96
|
`${projectId}\n`);
|
|
@@ -101,24 +124,195 @@ export function parsePortableProjectId(content) {
|
|
|
101
124
|
return { status: 'valid', projectId };
|
|
102
125
|
}
|
|
103
126
|
/**
|
|
104
|
-
* Read the
|
|
127
|
+
* Read ONLY the legacy `.cleo/project-id` file, synchronously.
|
|
128
|
+
*
|
|
129
|
+
* Callers that need the project's id use {@link readPortableProjectId}, which
|
|
130
|
+
* prefers `project.json`. This is for code that manages the legacy file
|
|
131
|
+
* itself (the doctor, the mirror writer, identity retirement).
|
|
105
132
|
*
|
|
106
133
|
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
107
|
-
* @returns `absent
|
|
108
|
-
*
|
|
134
|
+
* @returns `absent`, `valid` with the id, or `invalid` with a reason.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* readProjectIdFile('/repo'); // { status: 'valid', projectId: 'c78d09c3a8ee', file: 'project-id' }
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* @public
|
|
142
|
+
* @task T12716
|
|
143
|
+
*/
|
|
144
|
+
export function readProjectIdFile(projectRoot) {
|
|
145
|
+
const content = readTextFile(portableProjectIdPath(projectRoot));
|
|
146
|
+
if (content.status !== 'read')
|
|
147
|
+
return withFile(content, PORTABLE_PROJECT_ID_FILE);
|
|
148
|
+
return withFile(parsePortableProjectId(content.content), PORTABLE_PROJECT_ID_FILE);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Whether a string is an acceptable display name: 1-{@link PROJECT_DISPLAY_NAME_MAX}
|
|
152
|
+
* characters after trimming, no path separator, no leading `~`, no control
|
|
153
|
+
* character. A name is a label, never a path.
|
|
154
|
+
*
|
|
155
|
+
* @param name - Candidate name.
|
|
156
|
+
* @returns `true` when the name is acceptable as-is (already trimmed).
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* isValidProjectDisplayName('cleocode'); // true
|
|
161
|
+
* isValidProjectDisplayName('../x'); // false
|
|
162
|
+
* ```
|
|
163
|
+
*
|
|
164
|
+
* @public
|
|
165
|
+
* @task T12716
|
|
166
|
+
*/
|
|
167
|
+
export function isValidProjectDisplayName(name) {
|
|
168
|
+
return (name.length > 0 &&
|
|
169
|
+
name === name.trim() &&
|
|
170
|
+
name.length <= PROJECT_DISPLAY_NAME_MAX &&
|
|
171
|
+
!name.startsWith('~') &&
|
|
172
|
+
!/[/\\\u0000-\u001f\u007f]/.test(name));
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Absolute path of the canonical identity manifest for a project root.
|
|
176
|
+
*
|
|
177
|
+
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
178
|
+
* @returns `<projectRoot>/.cleo/project.json`.
|
|
179
|
+
*
|
|
180
|
+
* @public
|
|
181
|
+
* @task T12716
|
|
182
|
+
*/
|
|
183
|
+
export function projectManifestPath(projectRoot) {
|
|
184
|
+
return join(projectRoot, '.cleo', PROJECT_MANIFEST_FILE);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Render the exact bytes CLEO writes for a manifest: stable key order, two-space
|
|
188
|
+
* indent, trailing newline, so a rename diff touches one line.
|
|
189
|
+
*
|
|
190
|
+
* @param manifest - A manifest with a valid id and name.
|
|
191
|
+
* @returns The file body.
|
|
192
|
+
*
|
|
193
|
+
* @public
|
|
194
|
+
* @task T12716
|
|
195
|
+
*/
|
|
196
|
+
export function formatProjectManifest(manifest) {
|
|
197
|
+
const ordered = {
|
|
198
|
+
schemaVersion: manifest.schemaVersion,
|
|
199
|
+
id: manifest.id,
|
|
200
|
+
name: manifest.name,
|
|
201
|
+
};
|
|
202
|
+
return `${JSON.stringify(ordered, null, 2)}\n`;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Parse the body of `.cleo/project.json`.
|
|
206
|
+
*
|
|
207
|
+
* Strict on the three fields: `schemaVersion` must be
|
|
208
|
+
* {@link PROJECT_MANIFEST_SCHEMA_VERSION} (a newer format is `invalid`, so an
|
|
209
|
+
* old build never guesses at it), `id` must pass
|
|
210
|
+
* {@link isValidPortableProjectId}, and `name` must pass
|
|
211
|
+
* {@link isValidProjectDisplayName}. Unknown extra keys are ignored.
|
|
212
|
+
*
|
|
213
|
+
* @param content - Raw file content.
|
|
214
|
+
* @returns `valid` with the manifest, or `invalid` with a reason.
|
|
215
|
+
*
|
|
216
|
+
* @public
|
|
217
|
+
* @task T12716
|
|
218
|
+
*/
|
|
219
|
+
export function parseProjectManifest(content) {
|
|
220
|
+
let data;
|
|
221
|
+
try {
|
|
222
|
+
data = JSON.parse(content);
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
return {
|
|
226
|
+
status: 'invalid',
|
|
227
|
+
reason: `not JSON: ${error instanceof Error ? error.message : String(error)}`,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (data === null || typeof data !== 'object' || Array.isArray(data)) {
|
|
231
|
+
return { status: 'invalid', reason: 'expected a JSON object' };
|
|
232
|
+
}
|
|
233
|
+
const record = data;
|
|
234
|
+
if (record['schemaVersion'] !== PROJECT_MANIFEST_SCHEMA_VERSION) {
|
|
235
|
+
return {
|
|
236
|
+
status: 'invalid',
|
|
237
|
+
reason: `unsupported schemaVersion ${JSON.stringify(record['schemaVersion'])} (this build reads ${PROJECT_MANIFEST_SCHEMA_VERSION})`,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
const id = record['id'];
|
|
241
|
+
if (typeof id !== 'string' || !isValidPortableProjectId(id)) {
|
|
242
|
+
return { status: 'invalid', reason: `malformed id ${JSON.stringify(id)?.slice(0, 64)}` };
|
|
243
|
+
}
|
|
244
|
+
const name = record['name'];
|
|
245
|
+
if (typeof name !== 'string' || !isValidProjectDisplayName(name)) {
|
|
246
|
+
return { status: 'invalid', reason: `malformed name ${JSON.stringify(name)?.slice(0, 64)}` };
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
status: 'valid',
|
|
250
|
+
manifest: { schemaVersion: PROJECT_MANIFEST_SCHEMA_VERSION, id, name },
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Read `.cleo/project.json`, synchronously.
|
|
255
|
+
*
|
|
256
|
+
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
257
|
+
* @returns `absent`, `valid` with the manifest, or `invalid` with a reason.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts
|
|
261
|
+
* const read = readProjectManifest('/repo');
|
|
262
|
+
* if (read.status === 'valid') console.log(read.manifest.name);
|
|
263
|
+
* ```
|
|
264
|
+
*
|
|
265
|
+
* @public
|
|
266
|
+
* @task T12716
|
|
267
|
+
*/
|
|
268
|
+
export function readProjectManifest(projectRoot) {
|
|
269
|
+
const content = readTextFile(projectManifestPath(projectRoot));
|
|
270
|
+
if (content.status !== 'read')
|
|
271
|
+
return content;
|
|
272
|
+
return parseProjectManifest(content.content);
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Read the tracked portable identity of a project, synchronously — the ONE
|
|
276
|
+
* resolver over the tracked files (T12716).
|
|
277
|
+
*
|
|
278
|
+
* Precedence: `.cleo/project.json`, then the legacy `.cleo/project-id`. A
|
|
279
|
+
* malformed `project.json` is `invalid` and does NOT fall through to
|
|
280
|
+
* `project-id`: a broken canonical file is restored from version control,
|
|
281
|
+
* never papered over. When both files are valid and disagree, `project.json`
|
|
282
|
+
* wins here and `cleo doctor project-identity` reports the mirror conflict.
|
|
283
|
+
*
|
|
284
|
+
* @param projectRoot - Absolute project root (the directory containing `.cleo/`).
|
|
285
|
+
* @returns `absent` when neither file exists, `valid` with the id (and the
|
|
286
|
+
* `file` it came from, plus the `name` when `project.json` supplied it), or
|
|
287
|
+
* `invalid` with a reason and the unusable `file`.
|
|
109
288
|
*
|
|
110
289
|
* @example
|
|
111
290
|
* ```ts
|
|
112
291
|
* const read = readPortableProjectId('/repo');
|
|
113
|
-
* if (read.status === 'valid') console.log(read.projectId);
|
|
292
|
+
* if (read.status === 'valid') console.log(read.projectId, read.file);
|
|
114
293
|
* ```
|
|
115
294
|
*
|
|
116
295
|
* @public
|
|
117
296
|
*/
|
|
118
297
|
export function readPortableProjectId(projectRoot) {
|
|
119
|
-
|
|
298
|
+
const manifest = readProjectManifest(projectRoot);
|
|
299
|
+
if (manifest.status === 'valid') {
|
|
300
|
+
return {
|
|
301
|
+
status: 'valid',
|
|
302
|
+
projectId: manifest.manifest.id,
|
|
303
|
+
file: PROJECT_MANIFEST_FILE,
|
|
304
|
+
name: manifest.manifest.name,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
if (manifest.status === 'invalid') {
|
|
308
|
+
return { status: 'invalid', reason: manifest.reason, file: PROJECT_MANIFEST_FILE };
|
|
309
|
+
}
|
|
310
|
+
return readProjectIdFile(projectRoot);
|
|
311
|
+
}
|
|
312
|
+
/** Read a small text file; `absent` on ENOENT, `invalid` on any other error. */
|
|
313
|
+
function readTextFile(path) {
|
|
120
314
|
try {
|
|
121
|
-
content
|
|
315
|
+
return { status: 'read', content: readFileSync(path, 'utf-8') };
|
|
122
316
|
}
|
|
123
317
|
catch (error) {
|
|
124
318
|
if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
|
|
@@ -129,6 +323,11 @@ export function readPortableProjectId(projectRoot) {
|
|
|
129
323
|
reason: `unreadable: ${error instanceof Error ? error.message : String(error)}`,
|
|
130
324
|
};
|
|
131
325
|
}
|
|
132
|
-
|
|
326
|
+
}
|
|
327
|
+
/** Tag a read outcome with the file it came from (absent stays untagged). */
|
|
328
|
+
function withFile(read, file) {
|
|
329
|
+
if (read.status === 'absent')
|
|
330
|
+
return read;
|
|
331
|
+
return { ...read, file };
|
|
133
332
|
}
|
|
134
333
|
//# sourceMappingURL=portable-project-id.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portable-project-id.js","sourceRoot":"","sources":["../src/portable-project-id.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"portable-project-id.js","sourceRoot":"","sources":["../src/portable-project-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAErD,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEpD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAE5C;;;;GAIG;AACH,MAAM,2BAA2B,GAAG,oCAAoC,CAAC;AAuDzE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAiB;IACxD,OAAO,2BAA2B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,C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C;QACf,IAAI,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAC9B,CAAC;QACD,OAAO;YACL,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,eAAe,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;SAChF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,SAAS,QAAQ,CACf,IAA2D,EAC3D,IAAyB;IAEzB,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/paths",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.25",
|
|
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.",
|