@cleocode/core 2026.10.2 → 2026.10.4

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.
Files changed (228) hide show
  1. package/dist/build-provenance.json +2 -2
  2. package/dist/cloud/http.d.ts +2 -0
  3. package/dist/cloud/http.d.ts.map +1 -1
  4. package/dist/cloud/http.js +3 -0
  5. package/dist/cloud/http.js.map +1 -1
  6. package/dist/cloud/manifest-check.d.ts.map +1 -1
  7. package/dist/cloud/manifest-check.js +13 -0
  8. package/dist/cloud/manifest-check.js.map +1 -1
  9. package/dist/cloud/nexus-enrol.d.ts +9 -0
  10. package/dist/cloud/nexus-enrol.d.ts.map +1 -1
  11. package/dist/cloud/nexus-enrol.js +45 -2
  12. package/dist/cloud/nexus-enrol.js.map +1 -1
  13. package/dist/cloud/nexus-first-run.d.ts +142 -0
  14. package/dist/cloud/nexus-first-run.d.ts.map +1 -0
  15. package/dist/cloud/nexus-first-run.js +352 -0
  16. package/dist/cloud/nexus-first-run.js.map +1 -0
  17. package/dist/cloud/nexus-project-names.d.ts +173 -0
  18. package/dist/cloud/nexus-project-names.d.ts.map +1 -0
  19. package/dist/cloud/nexus-project-names.js +314 -0
  20. package/dist/cloud/nexus-project-names.js.map +1 -0
  21. package/dist/cloud/nexus-vault-keys.d.ts +35 -3
  22. package/dist/cloud/nexus-vault-keys.d.ts.map +1 -1
  23. package/dist/cloud/nexus-vault-keys.js +212 -22
  24. package/dist/cloud/nexus-vault-keys.js.map +1 -1
  25. package/dist/cloud/nexus-vault.d.ts.map +1 -1
  26. package/dist/cloud/nexus-vault.js +14 -2
  27. package/dist/cloud/nexus-vault.js.map +1 -1
  28. package/dist/dispatch/contracts/derive-output-contract.d.ts +1 -1
  29. package/dist/dispatch/contracts/derive-output-contract.d.ts.map +1 -1
  30. package/dist/dispatch/contracts/derive-output-contract.js +2 -1
  31. package/dist/dispatch/contracts/derive-output-contract.js.map +1 -1
  32. package/dist/dispatch/contracts/output-contracts.d.ts +2 -1
  33. package/dist/dispatch/contracts/output-contracts.d.ts.map +1 -1
  34. package/dist/dispatch/contracts/output-contracts.js +1 -1
  35. package/dist/dispatch/contracts/output-contracts.js.map +1 -1
  36. package/dist/dispatch/mvi-projection.d.ts +1 -1
  37. package/dist/dispatch/mvi-projection.d.ts.map +1 -1
  38. package/dist/dispatch/mvi-projection.js +1 -1
  39. package/dist/dispatch/mvi-projection.js.map +1 -1
  40. package/dist/docs/export-document.js +24462 -24572
  41. package/dist/docs/export-document.js.map +3 -3
  42. package/dist/doctor/db-substrate.d.ts +6 -9
  43. package/dist/doctor/db-substrate.d.ts.map +1 -1
  44. package/dist/doctor/db-substrate.js +10 -14
  45. package/dist/doctor/db-substrate.js.map +1 -1
  46. package/dist/doctor/migrations.d.ts +18 -0
  47. package/dist/doctor/migrations.d.ts.map +1 -1
  48. package/dist/doctor/migrations.js +54 -2
  49. package/dist/doctor/migrations.js.map +1 -1
  50. package/dist/error-catalog.js +1 -1
  51. package/dist/error-catalog.js.map +1 -1
  52. package/dist/errors.d.ts +1 -1
  53. package/dist/errors.d.ts.map +1 -1
  54. package/dist/errors.js +1 -1
  55. package/dist/errors.js.map +1 -1
  56. package/dist/init.d.ts.map +1 -1
  57. package/dist/init.js +21 -5
  58. package/dist/init.js.map +1 -1
  59. package/dist/llm/conversation.d.ts.map +1 -1
  60. package/dist/llm/conversation.js +15 -4
  61. package/dist/llm/conversation.js.map +1 -1
  62. package/dist/llm/plugin-facade.js +277 -376
  63. package/dist/llm/plugin-facade.js.map +3 -3
  64. package/dist/llm/transports/bedrock.d.ts +1 -0
  65. package/dist/llm/transports/bedrock.d.ts.map +1 -1
  66. package/dist/llm/transports/bedrock.js +30 -12
  67. package/dist/llm/transports/bedrock.js.map +1 -1
  68. package/dist/memory/decision-contradiction.d.ts.map +1 -1
  69. package/dist/memory/decision-contradiction.js +10 -5
  70. package/dist/memory/decision-contradiction.js.map +1 -1
  71. package/dist/memory/dialectic-evaluator.d.ts.map +1 -1
  72. package/dist/memory/dialectic-evaluator.js +4 -1
  73. package/dist/memory/dialectic-evaluator.js.map +1 -1
  74. package/dist/memory/transcript-extractor.d.ts.map +1 -1
  75. package/dist/memory/transcript-extractor.js +3 -2
  76. package/dist/memory/transcript-extractor.js.map +1 -1
  77. package/dist/metrics/token-service.d.ts +16 -0
  78. package/dist/metrics/token-service.d.ts.map +1 -1
  79. package/dist/metrics/token-service.js +18 -0
  80. package/dist/metrics/token-service.js.map +1 -1
  81. package/dist/nexus/api-contracts.d.ts.map +1 -1
  82. package/dist/nexus/api-contracts.js +27 -11
  83. package/dist/nexus/api-contracts.js.map +1 -1
  84. package/dist/nexus/api-extractors/http-extractor.d.ts +2 -2
  85. package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
  86. package/dist/nexus/api-extractors/http-extractor.js +3 -3
  87. package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
  88. package/dist/nexus/clusters.js +1 -1
  89. package/dist/nexus/clusters.js.map +1 -1
  90. package/dist/nexus/diff.d.ts +1 -1
  91. package/dist/nexus/diff.d.ts.map +1 -1
  92. package/dist/nexus/diff.js +3 -2
  93. package/dist/nexus/diff.js.map +1 -1
  94. package/dist/nexus/flows.js +1 -1
  95. package/dist/nexus/flows.js.map +1 -1
  96. package/dist/nexus/identity.d.ts +8 -0
  97. package/dist/nexus/identity.d.ts.map +1 -1
  98. package/dist/nexus/identity.js +17 -1
  99. package/dist/nexus/identity.js.map +1 -1
  100. package/dist/nexus/index.d.ts +1 -1
  101. package/dist/nexus/index.d.ts.map +1 -1
  102. package/dist/nexus/index.js +2 -2
  103. package/dist/nexus/index.js.map +1 -1
  104. package/dist/nexus/nexus-bridge.d.ts.map +1 -1
  105. package/dist/nexus/nexus-bridge.js +5 -5
  106. package/dist/nexus/nexus-bridge.js.map +1 -1
  107. package/dist/nexus/registry.d.ts +22 -0
  108. package/dist/nexus/registry.d.ts.map +1 -1
  109. package/dist/nexus/registry.js +76 -1
  110. package/dist/nexus/registry.js.map +1 -1
  111. package/dist/paths.js +1 -1
  112. package/dist/paths.js.map +1 -1
  113. package/dist/project-scope.js +1 -1
  114. package/dist/project-scope.js.map +1 -1
  115. package/dist/project-tombstone.js +1 -1
  116. package/dist/project-tombstone.js.map +1 -1
  117. package/dist/release/open.d.ts +3 -6
  118. package/dist/release/open.d.ts.map +1 -1
  119. package/dist/release/open.js +59 -23
  120. package/dist/release/open.js.map +1 -1
  121. package/dist/release/preflight-skip.d.ts +69 -10
  122. package/dist/release/preflight-skip.d.ts.map +1 -1
  123. package/dist/release/preflight-skip.js +195 -47
  124. package/dist/release/preflight-skip.js.map +1 -1
  125. package/dist/render/colors.js +1 -19
  126. package/dist/render/colors.js.map +1 -1
  127. package/dist/render/tasks/colors.js +1 -1
  128. package/dist/render/tasks/colors.js.map +1 -1
  129. package/dist/resources/governor.d.ts +12 -0
  130. package/dist/resources/governor.d.ts.map +1 -1
  131. package/dist/resources/governor.js +5 -1
  132. package/dist/resources/governor.js.map +1 -1
  133. package/dist/resources/heavy-command-hook-delivery.d.ts +144 -0
  134. package/dist/resources/heavy-command-hook-delivery.d.ts.map +1 -0
  135. package/dist/resources/heavy-command-hook-delivery.js +204 -0
  136. package/dist/resources/heavy-command-hook-delivery.js.map +1 -0
  137. package/dist/resources/heavy-command.d.ts +69 -0
  138. package/dist/resources/heavy-command.d.ts.map +1 -1
  139. package/dist/resources/heavy-command.js +479 -7
  140. package/dist/resources/heavy-command.js.map +1 -1
  141. package/dist/resources/run-class.d.ts.map +1 -1
  142. package/dist/resources/run-class.js +1 -0
  143. package/dist/resources/run-class.js.map +1 -1
  144. package/dist/routing/build-command-groups.d.ts +1 -1
  145. package/dist/routing/build-command-groups.d.ts.map +1 -1
  146. package/dist/routing/build-command-groups.js +4 -1
  147. package/dist/routing/build-command-groups.js.map +1 -1
  148. package/dist/scaffold/ensure-skills.d.ts.map +1 -1
  149. package/dist/scaffold/ensure-skills.js +58 -2
  150. package/dist/scaffold/ensure-skills.js.map +1 -1
  151. package/dist/selfimprove/fix-gen.js +277 -376
  152. package/dist/selfimprove/fix-gen.js.map +3 -3
  153. package/dist/sessions/briefing.d.ts.map +1 -1
  154. package/dist/sessions/briefing.js +11 -0
  155. package/dist/sessions/briefing.js.map +1 -1
  156. package/dist/store/dual-scope-db.d.ts.map +1 -1
  157. package/dist/store/dual-scope-db.js +6 -1
  158. package/dist/store/dual-scope-db.js.map +1 -1
  159. package/dist/store/portable-bundle-scan.d.ts +22 -0
  160. package/dist/store/portable-bundle-scan.d.ts.map +1 -1
  161. package/dist/store/portable-bundle-scan.js +97 -25
  162. package/dist/store/portable-bundle-scan.js.map +1 -1
  163. package/dist/store/portable-bundle.d.ts +7 -0
  164. package/dist/store/portable-bundle.d.ts.map +1 -1
  165. package/dist/store/portable-bundle.js +10 -1
  166. package/dist/store/portable-bundle.js.map +1 -1
  167. package/dist/store/table-classification.d.ts +27 -0
  168. package/dist/store/table-classification.d.ts.map +1 -1
  169. package/dist/store/table-classification.js +32 -0
  170. package/dist/store/table-classification.js.map +1 -1
  171. package/dist/store/vault-manifest.d.ts +5 -1
  172. package/dist/store/vault-manifest.d.ts.map +1 -1
  173. package/dist/store/vault-manifest.js +9 -2
  174. package/dist/store/vault-manifest.js.map +1 -1
  175. package/dist/system/health.d.ts +13 -0
  176. package/dist/system/health.d.ts.map +1 -1
  177. package/dist/system/health.js +96 -1
  178. package/dist/system/health.js.map +1 -1
  179. package/dist/tasks/affected-packages.d.ts +20 -7
  180. package/dist/tasks/affected-packages.d.ts.map +1 -1
  181. package/dist/tasks/affected-packages.js +39 -13
  182. package/dist/tasks/affected-packages.js.map +1 -1
  183. package/dist/tasks/affected-template.d.ts +93 -0
  184. package/dist/tasks/affected-template.d.ts.map +1 -0
  185. package/dist/tasks/affected-template.js +198 -0
  186. package/dist/tasks/affected-template.js.map +1 -0
  187. package/dist/tasks/command-line.d.ts +4 -1
  188. package/dist/tasks/command-line.d.ts.map +1 -1
  189. package/dist/tasks/command-line.js +7 -2
  190. package/dist/tasks/command-line.js.map +1 -1
  191. package/dist/tasks/done-plan.d.ts.map +1 -1
  192. package/dist/tasks/done-plan.js +12 -2
  193. package/dist/tasks/done-plan.js.map +1 -1
  194. package/dist/tasks/duplicate-detector.d.ts.map +1 -1
  195. package/dist/tasks/duplicate-detector.js +11 -5
  196. package/dist/tasks/duplicate-detector.js.map +1 -1
  197. package/dist/tasks/evidence.d.ts.map +1 -1
  198. package/dist/tasks/evidence.js +185 -11
  199. package/dist/tasks/evidence.js.map +1 -1
  200. package/dist/tasks/heavy-tool-env.d.ts +385 -18
  201. package/dist/tasks/heavy-tool-env.d.ts.map +1 -1
  202. package/dist/tasks/heavy-tool-env.js +719 -40
  203. package/dist/tasks/heavy-tool-env.js.map +1 -1
  204. package/dist/tasks/index.d.ts +2 -2
  205. package/dist/tasks/index.d.ts.map +1 -1
  206. package/dist/tasks/index.js +1 -1
  207. package/dist/tasks/index.js.map +1 -1
  208. package/dist/tasks/tool-cache-env.d.ts +20 -13
  209. package/dist/tasks/tool-cache-env.d.ts.map +1 -1
  210. package/dist/tasks/tool-cache-env.js +27 -48
  211. package/dist/tasks/tool-cache-env.js.map +1 -1
  212. package/dist/tasks/tool-cache.d.ts +8 -0
  213. package/dist/tasks/tool-cache.d.ts.map +1 -1
  214. package/dist/tasks/tool-cache.js +19 -6
  215. package/dist/tasks/tool-cache.js.map +1 -1
  216. package/dist/tasks/tool-semaphore.d.ts +66 -23
  217. package/dist/tasks/tool-semaphore.d.ts.map +1 -1
  218. package/dist/tasks/tool-semaphore.js +96 -34
  219. package/dist/tasks/tool-semaphore.js.map +1 -1
  220. package/dist/upgrade.d.ts.map +1 -1
  221. package/dist/upgrade.js +37 -4
  222. package/dist/upgrade.js.map +1 -1
  223. package/dist/validation/doctor/checks.d.ts +17 -0
  224. package/dist/validation/doctor/checks.d.ts.map +1 -1
  225. package/dist/validation/doctor/checks.js +83 -0
  226. package/dist/validation/doctor/checks.js.map +1 -1
  227. package/package.json +13 -13
  228. package/schemas/project-context.schema.json +5 -1
@@ -0,0 +1,173 @@
1
+ /**
2
+ * The account's Cleo Nexus projects by name (T13102): the list the guided
3
+ * first run of `cleo login nexus` shows on a machine with no linked project,
4
+ * and the name resolution behind `cleo cloud restore <name>`.
5
+ *
6
+ * - A project's display name is its plaintext label, else its id. Its
7
+ * `encryptedName` is NOT opened by default: the format is not specified yet
8
+ * (cleo-nexus T098: cipher, AAD with the key version, re-encryption on
9
+ * rotation), and nothing in CLEO writes it. A caller may pass `openName`
10
+ * (the seam the spec's reader will fill); a name that does not open falls
11
+ * back to the label with one warning and never fails the list.
12
+ * - Names are matched exactly first, then case-insensitively, against the
13
+ * display name, the label and the id. One match restores; several are
14
+ * refused with the candidates listed (`E_NEXUS_PROJECT_AMBIGUOUS`); none is
15
+ * `E_NEXUS_PROJECT_NOT_FOUND`. A UUID is taken as an id without listing.
16
+ * - Names and organization names from the server are shown with control,
17
+ * zero-width, separator and bidi characters removed; a listed id that is
18
+ * not a CLEO `ProjectId` is left out; commands quote every word for a POSIX
19
+ * shell, and the machine-read restore command names the immutable id.
20
+ *
21
+ * Every request is a `GET`. No function here logs, and no result or error
22
+ * carries a key or a token.
23
+ *
24
+ * @task T13102
25
+ * @epic T12322
26
+ */
27
+ import type { CloudWarning, NexusNamedProject } from '@cleocode/contracts';
28
+ import { NexusAccountError } from './nexus-auth.js';
29
+ import { type NexusCloudProjectsOptions } from './nexus-cloud.js';
30
+ /** Warning code: some project names are encrypted and could not be opened on this device. */
31
+ export declare const W_NEXUS_PROJECT_NAME_LOCKED = "W_NEXUS_PROJECT_NAME_LOCKED";
32
+ /** Warning code: the server listed a project whose id is not a CLEO project id; it was left out. */
33
+ export declare const W_NEXUS_PROJECT_ID_INVALID = "W_NEXUS_PROJECT_ID_INVALID";
34
+ /** Opens one project's `encryptedName`; throws when it cannot. */
35
+ export type NexusProjectNameOpener = (projectId: string, encryptedName: string) => Promise<string>;
36
+ /** Options of {@link listNexusNamedProjects} and {@link resolveNexusProjectRef}. */
37
+ export interface NexusNamedProjectsOptions extends NexusCloudProjectsOptions {
38
+ /** This machine's device id, to mark projects already here; `null`/absent marks none. */
39
+ deviceId?: string | null;
40
+ /**
41
+ * Opener of `encryptedName`. None by default: the format is not specified yet
42
+ * (cleo-nexus T098), so names show as their label or id until it is.
43
+ */
44
+ openName?: NexusProjectNameOpener;
45
+ }
46
+ /** The account's projects with display names. */
47
+ export interface NexusNamedProjectsResult {
48
+ /** API origin asked. */
49
+ apiUrl: string;
50
+ /** Every visible project, newest first. */
51
+ projects: NexusNamedProject[];
52
+ /** The list stopped short (a server ceiling or the page budget): a project may be missing. */
53
+ incomplete: boolean;
54
+ /** Non-fatal problems. */
55
+ warnings: CloudWarning[];
56
+ }
57
+ /** What a project reference resolved to. */
58
+ export interface NexusProjectRef {
59
+ /** The server's project id. */
60
+ projectId: string;
61
+ /** The display name it matched, or `null` when it was taken as an id. */
62
+ name: string | null;
63
+ /** `id`: the reference was the project id; `name`: a name or label. */
64
+ matchedBy: 'id' | 'name';
65
+ }
66
+ /** The candidates an ambiguous or missing reference reports (the envelope's `error.details`). */
67
+ export interface NexusProjectRefDetails {
68
+ /** The reference given. */
69
+ ref: string;
70
+ /** The projects it matched, each with a by-id restore command. */
71
+ candidates: NexusNamedProject[];
72
+ }
73
+ /**
74
+ * A reference that matched several projects or none. `publicDetails` is
75
+ * secret-free and the CLI forwards it as the envelope's `error.details`.
76
+ */
77
+ export declare class NexusProjectRefError extends NexusAccountError {
78
+ /** The reference and its candidates. */
79
+ readonly publicDetails: NexusProjectRefDetails;
80
+ /**
81
+ * @param code - `E_NEXUS_PROJECT_AMBIGUOUS` or `E_NEXUS_PROJECT_NOT_FOUND`.
82
+ * @param message - Human message.
83
+ * @param fix - Remedy.
84
+ * @param publicDetails - The reference and its candidates.
85
+ */
86
+ constructor(code: 'E_NEXUS_PROJECT_AMBIGUOUS' | 'E_NEXUS_PROJECT_NOT_FOUND', message: string, fix: string, publicDetails: NexusProjectRefDetails);
87
+ }
88
+ /**
89
+ * A server-held name made safe to print: control and bidi-override characters removed.
90
+ *
91
+ * @param raw - Name as the server or the decryption gave it.
92
+ * @returns The cleaned name, or `null` when nothing printable is left.
93
+ */
94
+ export declare function safeNexusProjectName(raw: string | null | undefined): string | null;
95
+ /**
96
+ * Quote a word for a POSIX shell (single quotes; `'` becomes `'\''`).
97
+ *
98
+ * @param word - The word.
99
+ * @returns It unchanged when it needs no quoting, else single-quoted.
100
+ */
101
+ export declare function shellQuoteWord(word: string): string;
102
+ /**
103
+ * The projects a reference names: exact matches on the id, display name or
104
+ * label first; when there are none, case-insensitive matches on the names.
105
+ *
106
+ * @param projects - The account's projects.
107
+ * @param ref - A project name, label or id.
108
+ * @returns Every match (one: resolved; several: ambiguous; none: not found).
109
+ */
110
+ export declare function matchNexusProjects(projects: readonly NexusNamedProject[], ref: string): NexusNamedProject[];
111
+ /**
112
+ * ` --api-url <origin>` when the origin is not the one a bare `cleo` command
113
+ * would use (`$CLEO_NEXUS_API_URL`, else the default), so a printed command
114
+ * reaches the same server.
115
+ *
116
+ * @param apiUrl - API origin.
117
+ * @returns The flag with a leading space, or `''`.
118
+ */
119
+ export declare function nexusApiUrlFlag(apiUrl: string): string;
120
+ /**
121
+ * The exact `cleo cloud restore` command for a project, by its id: the id
122
+ * never changes, while a name can be renamed or matched by a newer project
123
+ * between printing and running (review LOW-4). For agents and scripts.
124
+ *
125
+ * @param project - The project (its id is a validated `ProjectId`).
126
+ * @param apiUrl - API origin (added as `--api-url` when not the default).
127
+ * @returns The command.
128
+ */
129
+ export declare function nexusRestoreCommand(project: NexusNamedProject, apiUrl: string): string;
130
+ /**
131
+ * The same restore by name, for a person to type: only when the name resolves
132
+ * to this project alone and cannot be read as a flag or an id; else `null`.
133
+ *
134
+ * @param project - The project.
135
+ * @param all - Every project of the account, for the uniqueness check.
136
+ * @param apiUrl - API origin (added as `--api-url` when not the default).
137
+ * @returns The command, or `null`.
138
+ */
139
+ export declare function nexusRestoreByNameCommand(project: NexusNamedProject, all: readonly NexusNamedProject[], apiUrl: string): string | null;
140
+ /**
141
+ * `GET /v1/projects` (E13, every page) with display names and, for each
142
+ * project this machine can restore, the exact restore commands.
143
+ *
144
+ * @param opts - Device id, name opener, API URL, stores and test overrides.
145
+ * @returns The named projects, whether the list is complete, and warnings.
146
+ * @throws {NexusAccountError} When the list itself cannot be read.
147
+ */
148
+ export declare function listNexusNamedProjects(opts?: NexusNamedProjectsOptions): Promise<NexusNamedProjectsResult>;
149
+ /**
150
+ * Resolve a project name, label or id to the server's project id, for
151
+ * `cleo cloud restore <name>`. A UUID is taken as the id without a request.
152
+ *
153
+ * @param ref - What the user typed.
154
+ * @param opts - Name opener, API URL, stores and test overrides.
155
+ * @returns The project id and how it matched.
156
+ * @throws {NexusProjectRefError} `E_NEXUS_PROJECT_AMBIGUOUS` (the candidates
157
+ * are listed) or `E_NEXUS_PROJECT_NOT_FOUND`.
158
+ * @throws {NexusAccountError} When the project list cannot be read.
159
+ */
160
+ export declare function resolveNexusProjectRef(ref: string, opts?: NexusNamedProjectsOptions): Promise<NexusProjectRef>;
161
+ /**
162
+ * Refuse to restore a project into a directory nested inside another CLEO
163
+ * project (review LOW-5): `cleo cloud restore <name>` without `--into`
164
+ * restores into the current directory, and from a subdirectory of a project
165
+ * that would create a second project inside the first. The directory itself
166
+ * may be a project root (the restore checks it holds the same project); the
167
+ * home directory never counts as an enclosing project.
168
+ *
169
+ * @param into - The restore target; defaults to the current directory.
170
+ * @throws {NexusAccountError} `E_NEXUS_VAULT_TARGET_OCCUPIED` naming the enclosing project.
171
+ */
172
+ export declare function assertNexusRestoreTarget(into?: string): void;
173
+ //# sourceMappingURL=nexus-project-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nexus-project-names.d.ts","sourceRoot":"","sources":["../../src/cloud/nexus-project-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,OAAO,KAAK,EACV,YAAY,EAEZ,i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/**
2
+ * The account's Cleo Nexus projects by name (T13102): the list the guided
3
+ * first run of `cleo login nexus` shows on a machine with no linked project,
4
+ * and the name resolution behind `cleo cloud restore <name>`.
5
+ *
6
+ * - A project's display name is its plaintext label, else its id. Its
7
+ * `encryptedName` is NOT opened by default: the format is not specified yet
8
+ * (cleo-nexus T098: cipher, AAD with the key version, re-encryption on
9
+ * rotation), and nothing in CLEO writes it. A caller may pass `openName`
10
+ * (the seam the spec's reader will fill); a name that does not open falls
11
+ * back to the label with one warning and never fails the list.
12
+ * - Names are matched exactly first, then case-insensitively, against the
13
+ * display name, the label and the id. One match restores; several are
14
+ * refused with the candidates listed (`E_NEXUS_PROJECT_AMBIGUOUS`); none is
15
+ * `E_NEXUS_PROJECT_NOT_FOUND`. A UUID is taken as an id without listing.
16
+ * - Names and organization names from the server are shown with control,
17
+ * zero-width, separator and bidi characters removed; a listed id that is
18
+ * not a CLEO `ProjectId` is left out; commands quote every word for a POSIX
19
+ * shell, and the machine-read restore command names the immutable id.
20
+ *
21
+ * Every request is a `GET`. No function here logs, and no result or error
22
+ * carries a key or a token.
23
+ *
24
+ * @task T13102
25
+ * @epic T12322
26
+ */
27
+ import os from 'node:os';
28
+ import path from 'node:path';
29
+ import { ProjectId } from '@cleocode/contracts/cloud';
30
+ import { readDeclaredProjectIdentity } from '@cleocode/paths';
31
+ import { NexusAccountError, resolveNexusApiUrl } from './nexus-auth.js';
32
+ import { listNexusCloudProjects } from './nexus-cloud.js';
33
+ /** Warning code: some project names are encrypted and could not be opened on this device. */
34
+ export const W_NEXUS_PROJECT_NAME_LOCKED = 'W_NEXUS_PROJECT_NAME_LOCKED';
35
+ /** Warning code: the server listed a project whose id is not a CLEO project id; it was left out. */
36
+ export const W_NEXUS_PROJECT_ID_INVALID = 'W_NEXUS_PROJECT_ID_INVALID';
37
+ /** A UUID project id: taken as an id without listing. */
38
+ const UUID_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
39
+ /** A legacy 12-hex project id (`ProjectId`): an id when no name matches it. */
40
+ const LEGACY_ID = /^[0-9a-f]{12}$/;
41
+ /**
42
+ * Never echoed from a server-held name: C0/C1 controls, the Arabic letter
43
+ * mark, zero-width characters, line/paragraph separators, bidirectional
44
+ * embeddings, overrides and isolates, and the byte-order mark.
45
+ */
46
+ const UNSAFE_NAME_CHARS = /[\u0000-\u001f\u007f-\u009f\u061c\u200b-\u200f\u2028-\u202e\u2066-\u2069\ufeff]/g;
47
+ /** A word a POSIX shell takes literally without quotes. */
48
+ const SHELL_SAFE = /^[A-Za-z0-9._@%+=:,/-]+$/;
49
+ /**
50
+ * A reference that matched several projects or none. `publicDetails` is
51
+ * secret-free and the CLI forwards it as the envelope's `error.details`.
52
+ */
53
+ export class NexusProjectRefError extends NexusAccountError {
54
+ /** The reference and its candidates. */
55
+ publicDetails;
56
+ /**
57
+ * @param code - `E_NEXUS_PROJECT_AMBIGUOUS` or `E_NEXUS_PROJECT_NOT_FOUND`.
58
+ * @param message - Human message.
59
+ * @param fix - Remedy.
60
+ * @param publicDetails - The reference and its candidates.
61
+ */
62
+ constructor(code, message, fix, publicDetails) {
63
+ super(code, message, fix);
64
+ this.publicDetails = publicDetails;
65
+ }
66
+ }
67
+ /**
68
+ * A server-held name made safe to print: control and bidi-override characters removed.
69
+ *
70
+ * @param raw - Name as the server or the decryption gave it.
71
+ * @returns The cleaned name, or `null` when nothing printable is left.
72
+ */
73
+ export function safeNexusProjectName(raw) {
74
+ const clean = (raw ?? '').replace(UNSAFE_NAME_CHARS, '').trim();
75
+ return clean === '' ? null : clean;
76
+ }
77
+ /**
78
+ * Quote a word for a POSIX shell (single quotes; `'` becomes `'\''`).
79
+ *
80
+ * @param word - The word.
81
+ * @returns It unchanged when it needs no quoting, else single-quoted.
82
+ */
83
+ export function shellQuoteWord(word) {
84
+ return SHELL_SAFE.test(word) ? word : `'${word.replace(/'/g, `'\\''`)}'`;
85
+ }
86
+ /** Open every `encryptedName` with `opener`, if any; failures become one warning, never an error. */
87
+ async function openNames(items, opener, warnings) {
88
+ const opened = new Map();
89
+ if (opener === undefined)
90
+ return opened;
91
+ let failed = 0;
92
+ let firstReason = '';
93
+ for (const item of items) {
94
+ if (!item.encryptedName)
95
+ continue;
96
+ try {
97
+ opened.set(item.projectId, await opener(item.projectId, item.encryptedName));
98
+ }
99
+ catch (err) {
100
+ failed += 1;
101
+ if (firstReason === '')
102
+ firstReason = err instanceof Error ? err.message : String(err);
103
+ }
104
+ }
105
+ if (failed > 0) {
106
+ warnings.push({
107
+ code: W_NEXUS_PROJECT_NAME_LOCKED,
108
+ message: `${failed} project name(s) are encrypted and could not be opened on this device (${firstReason}); showing the label or id instead`,
109
+ });
110
+ }
111
+ return opened;
112
+ }
113
+ /** One list item as a named project, without its restore command yet. */
114
+ function namedProject(item, decrypted, deviceId) {
115
+ const fromName = safeNexusProjectName(decrypted);
116
+ const label = safeNexusProjectName(item.label);
117
+ const [name, nameSource] = fromName
118
+ ? [fromName, 'encrypted-name']
119
+ : label
120
+ ? [label, 'label']
121
+ : [item.projectId, 'id'];
122
+ return {
123
+ projectId: item.projectId,
124
+ name,
125
+ nameSource,
126
+ label,
127
+ organizationName: safeNexusProjectName(item.organizationName),
128
+ lastSyncAt: item.lastSyncAt ?? null,
129
+ hasBackup: item.headCheckpointId === undefined ? null : item.headCheckpointId !== null,
130
+ onThisDevice: deviceId !== null && item.replicas.some((r) => r.deviceId === deviceId),
131
+ restoreCommand: null,
132
+ restoreByNameCommand: null,
133
+ };
134
+ }
135
+ /**
136
+ * The projects a reference names: exact matches on the id, display name or
137
+ * label first; when there are none, case-insensitive matches on the names.
138
+ *
139
+ * @param projects - The account's projects.
140
+ * @param ref - A project name, label or id.
141
+ * @returns Every match (one: resolved; several: ambiguous; none: not found).
142
+ */
143
+ export function matchNexusProjects(projects, ref) {
144
+ const want = ref.trim();
145
+ if (want === '')
146
+ return [];
147
+ const names = (p) => [p.name, p.label].filter((n) => n !== null);
148
+ const exact = projects.filter((p) => p.projectId === want || names(p).includes(want));
149
+ if (exact.length > 0)
150
+ return exact;
151
+ const folded = want.toLowerCase();
152
+ return projects.filter((p) => names(p).some((n) => n.toLowerCase() === folded));
153
+ }
154
+ /**
155
+ * ` --api-url <origin>` when the origin is not the one a bare `cleo` command
156
+ * would use (`$CLEO_NEXUS_API_URL`, else the default), so a printed command
157
+ * reaches the same server.
158
+ *
159
+ * @param apiUrl - API origin.
160
+ * @returns The flag with a leading space, or `''`.
161
+ */
162
+ export function nexusApiUrlFlag(apiUrl) {
163
+ let fallback;
164
+ try {
165
+ fallback = resolveNexusApiUrl();
166
+ }
167
+ catch {
168
+ fallback = null;
169
+ }
170
+ return apiUrl === fallback ? '' : ` --api-url ${shellQuoteWord(apiUrl)}`;
171
+ }
172
+ /**
173
+ * The exact `cleo cloud restore` command for a project, by its id: the id
174
+ * never changes, while a name can be renamed or matched by a newer project
175
+ * between printing and running (review LOW-4). For agents and scripts.
176
+ *
177
+ * @param project - The project (its id is a validated `ProjectId`).
178
+ * @param apiUrl - API origin (added as `--api-url` when not the default).
179
+ * @returns The command.
180
+ */
181
+ export function nexusRestoreCommand(project, apiUrl) {
182
+ return `cleo cloud restore ${shellQuoteWord(project.projectId)}${nexusApiUrlFlag(apiUrl)}`;
183
+ }
184
+ /**
185
+ * The same restore by name, for a person to type: only when the name resolves
186
+ * to this project alone and cannot be read as a flag or an id; else `null`.
187
+ *
188
+ * @param project - The project.
189
+ * @param all - Every project of the account, for the uniqueness check.
190
+ * @param apiUrl - API origin (added as `--api-url` when not the default).
191
+ * @returns The command, or `null`.
192
+ */
193
+ export function nexusRestoreByNameCommand(project, all, apiUrl) {
194
+ const matches = matchNexusProjects(all, project.name);
195
+ const byName = project.nameSource !== 'id' &&
196
+ !project.name.startsWith('-') &&
197
+ !UUID_ID.test(project.name) &&
198
+ matches.length === 1 &&
199
+ matches[0]?.projectId === project.projectId;
200
+ return byName
201
+ ? `cleo cloud restore ${shellQuoteWord(project.name)}${nexusApiUrlFlag(apiUrl)}`
202
+ : null;
203
+ }
204
+ /**
205
+ * The list items whose id is a CLEO project id (a UUID or a legacy 12-hex
206
+ * id); any other id is left out with a warning, so a hostile or broken
207
+ * server cannot put arbitrary text into a printed command (review MED-1).
208
+ */
209
+ function validItems(items, warnings) {
210
+ const valid = items.filter((item) => ProjectId.safeParse(item.projectId).success);
211
+ if (valid.length < items.length) {
212
+ warnings.push({
213
+ code: W_NEXUS_PROJECT_ID_INVALID,
214
+ message: `left out ${items.length - valid.length} project(s) whose id the server sent is not a CLEO project id`,
215
+ });
216
+ }
217
+ return valid;
218
+ }
219
+ /**
220
+ * `GET /v1/projects` (E13, every page) with display names and, for each
221
+ * project this machine can restore, the exact restore commands.
222
+ *
223
+ * @param opts - Device id, name opener, API URL, stores and test overrides.
224
+ * @returns The named projects, whether the list is complete, and warnings.
225
+ * @throws {NexusAccountError} When the list itself cannot be read.
226
+ */
227
+ export async function listNexusNamedProjects(opts = {}) {
228
+ const { deviceId, openName, ...vault } = opts;
229
+ const list = await listNexusCloudProjects(vault);
230
+ const warnings = [...list.warnings];
231
+ const items = validItems(list.projects, warnings);
232
+ const opened = await openNames(items, openName, warnings);
233
+ const named = items.map((item) => namedProject(item, opened.get(item.projectId) ?? null, deviceId ?? null));
234
+ const projects = named.map((p) => {
235
+ const restorable = p.hasBackup !== false && !p.onThisDevice;
236
+ return {
237
+ ...p,
238
+ restoreCommand: restorable ? nexusRestoreCommand(p, list.apiUrl) : null,
239
+ restoreByNameCommand: restorable ? nexusRestoreByNameCommand(p, named, list.apiUrl) : null,
240
+ };
241
+ });
242
+ return {
243
+ apiUrl: list.apiUrl,
244
+ projects,
245
+ incomplete: list.paging.pageLimitReached || list.paging.projectsTruncated,
246
+ warnings,
247
+ };
248
+ }
249
+ /** One candidate line: name, id, organization and last sync. */
250
+ function candidateLine(p) {
251
+ const org = p.organizationName ? `, ${p.organizationName}` : '';
252
+ const sync = p.lastSyncAt ? `, last sync ${p.lastSyncAt}` : '';
253
+ return `${p.name} (${p.projectId}${org}${sync})`;
254
+ }
255
+ /**
256
+ * Resolve a project name, label or id to the server's project id, for
257
+ * `cleo cloud restore <name>`. A UUID is taken as the id without a request.
258
+ *
259
+ * @param ref - What the user typed.
260
+ * @param opts - Name opener, API URL, stores and test overrides.
261
+ * @returns The project id and how it matched.
262
+ * @throws {NexusProjectRefError} `E_NEXUS_PROJECT_AMBIGUOUS` (the candidates
263
+ * are listed) or `E_NEXUS_PROJECT_NOT_FOUND`.
264
+ * @throws {NexusAccountError} When the project list cannot be read.
265
+ */
266
+ export async function resolveNexusProjectRef(ref, opts = {}) {
267
+ const want = ref.trim();
268
+ if (UUID_ID.test(want))
269
+ return { projectId: want.toLowerCase(), name: null, matchedBy: 'id' };
270
+ const listed = await listNexusNamedProjects({ ...opts, deviceId: null });
271
+ const matches = matchNexusProjects(listed.projects, want);
272
+ const only = matches.length === 1 ? matches[0] : undefined;
273
+ if (only) {
274
+ return only.projectId === want
275
+ ? { projectId: only.projectId, name: null, matchedBy: 'id' }
276
+ : { projectId: only.projectId, name: only.name, matchedBy: 'name' };
277
+ }
278
+ if (matches.length > 1) {
279
+ const candidates = matches.map((p) => ({
280
+ ...p,
281
+ restoreCommand: nexusRestoreCommand(p, listed.apiUrl),
282
+ }));
283
+ throw new NexusProjectRefError('E_NEXUS_PROJECT_AMBIGUOUS', `"${safeNexusProjectName(want) ?? want}" matches ${matches.length} projects: ${matches.map(candidateLine).join('; ')}`, `restore one by its id: ${candidates.map((c) => c.restoreCommand).join(' | ')}`, { ref: want, candidates });
284
+ }
285
+ if (LEGACY_ID.test(want))
286
+ return { projectId: want, name: null, matchedBy: 'id' };
287
+ throw new NexusProjectRefError('E_NEXUS_PROJECT_NOT_FOUND', `no project of this account at ${listed.apiUrl} is named "${safeNexusProjectName(want) ?? want}"${listed.incomplete ? ' (the project list was cut short, so it may exist; use its id)' : ''}`, 'run `cleo cloud projects` to list the projects, then pass a name or id from it', { ref: want, candidates: [] });
288
+ }
289
+ /**
290
+ * Refuse to restore a project into a directory nested inside another CLEO
291
+ * project (review LOW-5): `cleo cloud restore <name>` without `--into`
292
+ * restores into the current directory, and from a subdirectory of a project
293
+ * that would create a second project inside the first. The directory itself
294
+ * may be a project root (the restore checks it holds the same project); the
295
+ * home directory never counts as an enclosing project.
296
+ *
297
+ * @param into - The restore target; defaults to the current directory.
298
+ * @throws {NexusAccountError} `E_NEXUS_VAULT_TARGET_OCCUPIED` naming the enclosing project.
299
+ */
300
+ export function assertNexusRestoreTarget(into) {
301
+ const target = path.resolve(into ?? process.cwd()); // CWD-OK: restore target directory, not a project root lookup
302
+ const home = path.resolve(os.homedir());
303
+ let dir = path.dirname(target);
304
+ for (;;) {
305
+ if (dir !== home && readDeclaredProjectIdentity(dir)) {
306
+ throw new NexusAccountError('E_NEXUS_VAULT_TARGET_OCCUPIED', `${target} is inside the CLEO project at ${dir}; restoring here would nest a second project in it`, `run it in ${dir} (or pass --into ${shellQuoteWord(dir)}) to restore that project there, or pass --into an empty directory outside it`);
307
+ }
308
+ const parent = path.dirname(dir);
309
+ if (parent === dir)
310
+ return;
311
+ dir = parent;
312
+ }
313
+ }
314
+ //# sourceMappingURL=nexus-project-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nexus-project-names.js","sourceRoot":"","sources":["../../src/cloud/nexus-project-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAkC,MAAM,kBAAkB,CAAC;AAE1F,6FAA6F;AAC7F,MAAM,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,CAAC;QACJ,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO;QAC3B,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -13,6 +13,9 @@
13
13
  * 2. No escrow and no account keys: this is the account's first vault use.
14
14
  * The client mints MK and escrows it (`PUT`, insert-only). A concurrent
15
15
  * first device loses the insert with 409 and reads the winner's key.
16
+ * Since T13100 `cleo login nexus` runs steps 1 to 4 right after enrolment
17
+ * ({@link provisionNexusAccount}); `cleo cloud push` still does them for a
18
+ * device that logged in before that.
16
19
  * 3. The device certifies itself under MK (a self-grant, `PUT
17
20
  * /v1/devices/:id/key`), so other devices can verify its snapshots.
18
21
  * 4. Signer trust comes from `certifiedSigners` over `GET /v1/devices/trust`,
@@ -33,15 +36,16 @@
33
36
  * No function here logs a key, and no error carries one.
34
37
  *
35
38
  * @task T12336
39
+ * @task T13100
36
40
  * @epic T12322
37
41
  */
38
- import type { CloudWarning } from '@cleocode/contracts';
42
+ import type { CloudWarning, NexusAccountSetup } from '@cleocode/contracts';
39
43
  import { type KeyPair } from './crypto.js';
40
44
  import { type FetchLike, Http, type ResponseSchema } from './http.js';
41
45
  import { type TrustedSigners } from './keys.js';
42
46
  import { resolveNexusApiUrl } from './nexus-auth.js';
43
47
  import { type NexusCloudOptions } from './nexus-cloud.js';
44
- import type { SealedNexusDevice } from './nexus-device.js';
48
+ import { type SealedNexusDevice } from './nexus-device.js';
45
49
  import { NexusVaultState } from './nexus-vault-state.js';
46
50
  /** Timeout of a snapshot blob upload or download. */
47
51
  export declare const NEXUS_VAULT_BLOB_TIMEOUT_MS: number;
@@ -101,11 +105,39 @@ export interface NexusAccountKey {
101
105
  * `E_NEXUS_VAULT_EMPTY`.
102
106
  * @returns The key, its version and the trusted signers.
103
107
  * @throws {NexusAccountError} `E_NEXUS_VAULT_KEY_UNAVAILABLE` when the key
104
- * cannot be obtained or verified; a mapped API error otherwise.
108
+ * cannot be obtained or verified; `E_NEXUS_VAULT_UNSUPPORTED` when the server
109
+ * has no key escrow route; a mapped API error otherwise.
105
110
  */
106
111
  export declare function unlockNexusAccountKey(conn: NexusVaultConnection, opts?: {
107
112
  readOnly?: boolean;
108
113
  }): Promise<NexusAccountKey>;
114
+ /** Options of {@link provisionNexusAccount}. */
115
+ export interface ProvisionNexusAccountOptions extends NexusVaultOptions {
116
+ /**
117
+ * The device entry to act as. `cleo login nexus` passes the entry it just
118
+ * stored, so the setup runs on that new device credential (the escrow routes
119
+ * accept only device credentials). Default: the stored credential, as
120
+ * {@link connectNexusVault} finds it.
121
+ */
122
+ device?: SealedNexusDevice;
123
+ }
124
+ /**
125
+ * Make the account ready for encrypted backups on this device (onboarding A,
126
+ * T13100): read the escrowed account master key, or mint and escrow it when
127
+ * the account has none (a 409 means another device won: its key is read,
128
+ * never re-minted), then certify this device under it and record the signer
129
+ * trust state in {@link NexusVaultState}. It is {@link unlockNexusAccountKey}
130
+ * with a report, so a later `cleo cloud push` finds everything in place and
131
+ * mints nothing; it is idempotent.
132
+ *
133
+ * It never throws: a server without key escrow answers `unsupported`, any
134
+ * other failure answers `failed` with the step and the remedy. No key is in
135
+ * the result, and a failure message is redacted of the device credential.
136
+ *
137
+ * @param opts - API URL, stores, the device to act as, and test overrides.
138
+ * @returns What the setup did.
139
+ */
140
+ export declare function provisionNexusAccount(opts?: ProvisionNexusAccountOptions): Promise<NexusAccountSetup>;
109
141
  /**
110
142
  * The data key of a project stream: unwrap the newest wrapped key, or mint
111
143
  * and store one when the project has none yet (its first push).
@@ -1 +1 @@
1
- {"version":3,"file":"nexus-vault-keys.d.ts","sourceRoot":"","sources":["../../src/cloud/nexus-vault-keys.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASxD,O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