@cleocode/core 2026.10.3 → 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.
- package/dist/build-provenance.json +2 -2
- package/dist/cloud/nexus-enrol.d.ts +9 -0
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +45 -2
- package/dist/cloud/nexus-enrol.js.map +1 -1
- package/dist/cloud/nexus-first-run.d.ts +142 -0
- package/dist/cloud/nexus-first-run.d.ts.map +1 -0
- package/dist/cloud/nexus-first-run.js +352 -0
- package/dist/cloud/nexus-first-run.js.map +1 -0
- package/dist/cloud/nexus-project-names.d.ts +173 -0
- package/dist/cloud/nexus-project-names.d.ts.map +1 -0
- package/dist/cloud/nexus-project-names.js +314 -0
- package/dist/cloud/nexus-project-names.js.map +1 -0
- package/dist/cloud/nexus-vault-keys.d.ts +33 -2
- package/dist/cloud/nexus-vault-keys.d.ts.map +1 -1
- package/dist/cloud/nexus-vault-keys.js +132 -12
- package/dist/cloud/nexus-vault-keys.js.map +1 -1
- package/dist/dispatch/contracts/derive-output-contract.d.ts +1 -1
- package/dist/dispatch/contracts/derive-output-contract.d.ts.map +1 -1
- package/dist/dispatch/contracts/derive-output-contract.js +2 -1
- package/dist/dispatch/contracts/derive-output-contract.js.map +1 -1
- package/dist/dispatch/contracts/output-contracts.d.ts +2 -1
- package/dist/dispatch/contracts/output-contracts.d.ts.map +1 -1
- package/dist/dispatch/contracts/output-contracts.js +1 -1
- package/dist/dispatch/contracts/output-contracts.js.map +1 -1
- package/dist/dispatch/mvi-projection.d.ts +1 -1
- package/dist/dispatch/mvi-projection.d.ts.map +1 -1
- package/dist/dispatch/mvi-projection.js +1 -1
- package/dist/dispatch/mvi-projection.js.map +1 -1
- package/dist/docs/export-document.js +24462 -24572
- package/dist/docs/export-document.js.map +3 -3
- package/dist/doctor/db-substrate.d.ts +6 -9
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +10 -14
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/migrations.d.ts +18 -0
- package/dist/doctor/migrations.d.ts.map +1 -1
- package/dist/doctor/migrations.js +54 -2
- package/dist/doctor/migrations.js.map +1 -1
- package/dist/error-catalog.js +1 -1
- package/dist/error-catalog.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +21 -5
- package/dist/init.js.map +1 -1
- package/dist/llm/conversation.d.ts.map +1 -1
- package/dist/llm/conversation.js +15 -4
- package/dist/llm/conversation.js.map +1 -1
- package/dist/llm/plugin-facade.js +277 -376
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/transports/bedrock.d.ts +1 -0
- package/dist/llm/transports/bedrock.d.ts.map +1 -1
- package/dist/llm/transports/bedrock.js +30 -12
- package/dist/llm/transports/bedrock.js.map +1 -1
- package/dist/memory/decision-contradiction.d.ts.map +1 -1
- package/dist/memory/decision-contradiction.js +10 -5
- package/dist/memory/decision-contradiction.js.map +1 -1
- package/dist/memory/dialectic-evaluator.d.ts.map +1 -1
- package/dist/memory/dialectic-evaluator.js +4 -1
- package/dist/memory/dialectic-evaluator.js.map +1 -1
- package/dist/memory/transcript-extractor.d.ts.map +1 -1
- package/dist/memory/transcript-extractor.js +3 -2
- package/dist/memory/transcript-extractor.js.map +1 -1
- package/dist/metrics/token-service.d.ts +16 -0
- package/dist/metrics/token-service.d.ts.map +1 -1
- package/dist/metrics/token-service.js +18 -0
- package/dist/metrics/token-service.js.map +1 -1
- package/dist/nexus/api-contracts.d.ts.map +1 -1
- package/dist/nexus/api-contracts.js +27 -11
- package/dist/nexus/api-contracts.js.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.d.ts +2 -2
- package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.js +3 -3
- package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
- package/dist/nexus/clusters.js +1 -1
- package/dist/nexus/clusters.js.map +1 -1
- package/dist/nexus/diff.d.ts +1 -1
- package/dist/nexus/diff.d.ts.map +1 -1
- package/dist/nexus/diff.js +3 -2
- package/dist/nexus/diff.js.map +1 -1
- package/dist/nexus/flows.js +1 -1
- package/dist/nexus/flows.js.map +1 -1
- package/dist/nexus/identity.d.ts +8 -0
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +17 -1
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/index.d.ts +1 -1
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +2 -2
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/nexus-bridge.d.ts.map +1 -1
- package/dist/nexus/nexus-bridge.js +5 -5
- package/dist/nexus/nexus-bridge.js.map +1 -1
- package/dist/nexus/registry.d.ts +22 -0
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +76 -1
- package/dist/nexus/registry.js.map +1 -1
- package/dist/paths.js +1 -1
- package/dist/paths.js.map +1 -1
- package/dist/project-scope.js +1 -1
- package/dist/project-scope.js.map +1 -1
- package/dist/project-tombstone.js +1 -1
- package/dist/project-tombstone.js.map +1 -1
- package/dist/release/open.d.ts +3 -6
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +59 -23
- package/dist/release/open.js.map +1 -1
- package/dist/release/preflight-skip.d.ts +69 -10
- package/dist/release/preflight-skip.d.ts.map +1 -1
- package/dist/release/preflight-skip.js +195 -47
- package/dist/release/preflight-skip.js.map +1 -1
- package/dist/render/colors.js +1 -19
- package/dist/render/colors.js.map +1 -1
- package/dist/render/tasks/colors.js +1 -1
- package/dist/render/tasks/colors.js.map +1 -1
- package/dist/resources/governor.d.ts +12 -0
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +5 -1
- package/dist/resources/governor.js.map +1 -1
- package/dist/resources/heavy-command-hook-delivery.d.ts +144 -0
- package/dist/resources/heavy-command-hook-delivery.d.ts.map +1 -0
- package/dist/resources/heavy-command-hook-delivery.js +204 -0
- package/dist/resources/heavy-command-hook-delivery.js.map +1 -0
- package/dist/resources/heavy-command.d.ts +69 -0
- package/dist/resources/heavy-command.d.ts.map +1 -1
- package/dist/resources/heavy-command.js +479 -7
- package/dist/resources/heavy-command.js.map +1 -1
- package/dist/resources/run-class.d.ts.map +1 -1
- package/dist/resources/run-class.js +1 -0
- package/dist/resources/run-class.js.map +1 -1
- package/dist/routing/build-command-groups.d.ts +1 -1
- package/dist/routing/build-command-groups.d.ts.map +1 -1
- package/dist/routing/build-command-groups.js +4 -1
- package/dist/routing/build-command-groups.js.map +1 -1
- package/dist/scaffold/ensure-skills.d.ts.map +1 -1
- package/dist/scaffold/ensure-skills.js +58 -2
- package/dist/scaffold/ensure-skills.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +277 -376
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +11 -0
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +6 -1
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/table-classification.d.ts +27 -0
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +32 -0
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/vault-manifest.d.ts +5 -1
- package/dist/store/vault-manifest.d.ts.map +1 -1
- package/dist/store/vault-manifest.js +9 -2
- package/dist/store/vault-manifest.js.map +1 -1
- package/dist/system/health.d.ts +13 -0
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +96 -1
- package/dist/system/health.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +20 -7
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +39 -13
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/affected-template.d.ts +93 -0
- package/dist/tasks/affected-template.d.ts.map +1 -0
- package/dist/tasks/affected-template.js +198 -0
- package/dist/tasks/affected-template.js.map +1 -0
- package/dist/tasks/command-line.d.ts +4 -1
- package/dist/tasks/command-line.d.ts.map +1 -1
- package/dist/tasks/command-line.js +7 -2
- package/dist/tasks/command-line.js.map +1 -1
- package/dist/tasks/done-plan.d.ts.map +1 -1
- package/dist/tasks/done-plan.js +12 -2
- package/dist/tasks/done-plan.js.map +1 -1
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +11 -5
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +185 -11
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/heavy-tool-env.d.ts +385 -18
- package/dist/tasks/heavy-tool-env.d.ts.map +1 -1
- package/dist/tasks/heavy-tool-env.js +719 -40
- package/dist/tasks/heavy-tool-env.js.map +1 -1
- package/dist/tasks/index.d.ts +2 -2
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +1 -1
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/tool-cache-env.d.ts +20 -13
- package/dist/tasks/tool-cache-env.d.ts.map +1 -1
- package/dist/tasks/tool-cache-env.js +27 -48
- package/dist/tasks/tool-cache-env.js.map +1 -1
- package/dist/tasks/tool-cache.d.ts +8 -0
- package/dist/tasks/tool-cache.d.ts.map +1 -1
- package/dist/tasks/tool-cache.js +19 -6
- package/dist/tasks/tool-cache.js.map +1 -1
- package/dist/tasks/tool-semaphore.d.ts +66 -23
- package/dist/tasks/tool-semaphore.d.ts.map +1 -1
- package/dist/tasks/tool-semaphore.js +96 -34
- package/dist/tasks/tool-semaphore.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +37 -4
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +17 -0
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +83 -0
- package/dist/validation/doctor/checks.js.map +1 -1
- package/package.json +13 -13
- package/schemas/project-context.schema.json +5 -1
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The guided first run of `cleo login nexus` (T13102, owner decision
|
|
3
|
+
* 2026-10-02: onboarding = A + B + C' + D, so that `cleo login` is the only
|
|
4
|
+
* setup step in practice). It runs after a successful sign-in and never fails
|
|
5
|
+
* it: every problem becomes a state, a warning and the exact next command.
|
|
6
|
+
*
|
|
7
|
+
* - **Inside a CLEO project this device has not linked**: offer "link and
|
|
8
|
+
* back up now". With consent `yes` (`--yes`) it links the project through
|
|
9
|
+
* {@link linkProjectToNexus} (the same path as `cleo project link`, so the
|
|
10
|
+
* project key created at registration comes with it) and then takes the
|
|
11
|
+
* first encrypted backup through {@link pushNexusVault}. With `prompt` (a
|
|
12
|
+
* terminal) it asks first. With `never` (a non-interactive run: an agent)
|
|
13
|
+
* it never asks and reports the exact next command.
|
|
14
|
+
* - **Inside an unlinked project the cloud already backs up**, from another
|
|
15
|
+
* device, and this copy never synced (a fresh clone on a new machine: the
|
|
16
|
+
* project id is tracked in git): a backup would be refused as behind, so
|
|
17
|
+
* the offer is to restore that backup here ({@link restoreNexusVault}, then
|
|
18
|
+
* the same link), under the same consent rules.
|
|
19
|
+
* - **Inside a project linked and attached from this device**: nothing to do.
|
|
20
|
+
* - **Outside a CLEO project**: list the account's projects by name
|
|
21
|
+
* ({@link listNexusNamedProjects}) with the exact `cleo cloud restore`
|
|
22
|
+
* command for each one this machine can restore.
|
|
23
|
+
* - **A read-only device, or device credentials off**: skipped.
|
|
24
|
+
*
|
|
25
|
+
* Every printed command carries `--api-url` when the origin is not the
|
|
26
|
+
* default. No function here logs, prompts or prints: the caller supplies
|
|
27
|
+
* `confirm` and `onStep`.
|
|
28
|
+
*
|
|
29
|
+
* @task T13102
|
|
30
|
+
* @epic T12322
|
|
31
|
+
*/
|
|
32
|
+
import path from 'node:path';
|
|
33
|
+
import { nexusCloudProjectDetailSchema } from '@cleocode/contracts';
|
|
34
|
+
import { NexusAccountError, resolveNexusApiUrl } from './nexus-auth.js';
|
|
35
|
+
import { connectNexusCloud, currentNexusCloudProject } from './nexus-cloud.js';
|
|
36
|
+
import { isNexusDeviceEnabled } from './nexus-device.js';
|
|
37
|
+
import { linkProjectToNexus, readNexusProjectLink } from './nexus-link.js';
|
|
38
|
+
import { listNexusNamedProjects, nexusApiUrlFlag, shellQuoteWord, } from './nexus-project-names.js';
|
|
39
|
+
import { pushNexusVault, restoreNexusVault, } from './nexus-vault.js';
|
|
40
|
+
import { NexusVaultState } from './nexus-vault-state.js';
|
|
41
|
+
/** The question a terminal is asked before linking and backing up. */
|
|
42
|
+
export const NEXUS_FIRST_RUN_QUESTION = 'This project is not linked to Cleo Nexus. Link it and back it up now (encrypted)?';
|
|
43
|
+
/** The question a terminal is asked before restoring a backup this copy never synced. */
|
|
44
|
+
export const NEXUS_FIRST_RUN_RESTORE_QUESTION = 'Cleo Nexus holds a backup of this project from another device. Restore it here now?';
|
|
45
|
+
/** Warning code: linking the project failed. */
|
|
46
|
+
export const W_NEXUS_FIRST_RUN_LINK = 'W_NEXUS_FIRST_RUN_LINK';
|
|
47
|
+
/** Warning code: the first backup failed. */
|
|
48
|
+
export const W_NEXUS_FIRST_RUN_BACKUP = 'W_NEXUS_FIRST_RUN_BACKUP';
|
|
49
|
+
/** Warning code: restoring the cloud's backup failed. */
|
|
50
|
+
export const W_NEXUS_FIRST_RUN_RESTORE = 'W_NEXUS_FIRST_RUN_RESTORE';
|
|
51
|
+
/** Warning code: the account's projects could not be listed. */
|
|
52
|
+
export const W_NEXUS_FIRST_RUN_PROJECTS = 'W_NEXUS_FIRST_RUN_PROJECTS';
|
|
53
|
+
/** Warning code: a non-fatal problem the link reported. */
|
|
54
|
+
export const W_NEXUS_FIRST_RUN_LINK_NOTE = 'W_NEXUS_FIRST_RUN_LINK_NOTE';
|
|
55
|
+
/**
|
|
56
|
+
* A first-run result with every field at its empty value.
|
|
57
|
+
*
|
|
58
|
+
* @param state - How it ended.
|
|
59
|
+
* @param fields - Fields to set.
|
|
60
|
+
* @returns The result.
|
|
61
|
+
*/
|
|
62
|
+
export function nexusFirstRunResult(state, fields = {}) {
|
|
63
|
+
return {
|
|
64
|
+
state,
|
|
65
|
+
reason: null,
|
|
66
|
+
projectRoot: null,
|
|
67
|
+
link: null,
|
|
68
|
+
offer: null,
|
|
69
|
+
backup: null,
|
|
70
|
+
restore: null,
|
|
71
|
+
projects: [],
|
|
72
|
+
nextCommand: null,
|
|
73
|
+
choices: [],
|
|
74
|
+
warnings: [],
|
|
75
|
+
...fields,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The commands a first run names, with `--api-url` when the origin is not the default.
|
|
80
|
+
*
|
|
81
|
+
* @param apiUrl - API origin.
|
|
82
|
+
* @returns The link-and-back-up, push, pull, list and restore commands.
|
|
83
|
+
*/
|
|
84
|
+
export function nexusFirstRunCommands(apiUrl) {
|
|
85
|
+
const f = nexusApiUrlFlag(apiUrl);
|
|
86
|
+
return {
|
|
87
|
+
linkAndBackUp: `cleo project link${f} && cleo cloud push${f}`,
|
|
88
|
+
linkAndForkPush: `cleo project link${f} && cleo cloud push --force${f}`,
|
|
89
|
+
push: `cleo cloud push${f}`,
|
|
90
|
+
pull: `cleo cloud pull${f}`,
|
|
91
|
+
projects: `cleo cloud projects${f}`,
|
|
92
|
+
restore: (projectId, root) => `cleo cloud restore ${shellQuoteWord(projectId)} --into ${shellQuoteWord(root)}${f}`,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** A failure as one secret-free line: code, message and remedy. */
|
|
96
|
+
function describeFailure(err) {
|
|
97
|
+
if (err instanceof NexusAccountError) {
|
|
98
|
+
return `${err.code}: ${err.message}${err.fix ? `; ${err.fix}` : ''}`;
|
|
99
|
+
}
|
|
100
|
+
return err instanceof Error ? err.message : String(err);
|
|
101
|
+
}
|
|
102
|
+
/** The error's code, when it carries one. */
|
|
103
|
+
function codeOf(err) {
|
|
104
|
+
return err instanceof NexusAccountError ? err.code : null;
|
|
105
|
+
}
|
|
106
|
+
/** The link is attached from this device (or, with no device id known, attached at all). */
|
|
107
|
+
function attachedHere(link, deviceId) {
|
|
108
|
+
if (link === null || !link.replicaId)
|
|
109
|
+
return false;
|
|
110
|
+
return deviceId === null || link.nexusDeviceId === deviceId;
|
|
111
|
+
}
|
|
112
|
+
/** Ask, when asking is allowed; a failed or closed prompt answers no. */
|
|
113
|
+
async function consented(opts, question, defaultYes) {
|
|
114
|
+
if (opts.consent === 'yes')
|
|
115
|
+
return true;
|
|
116
|
+
if (opts.consent !== 'prompt' || !opts.confirm)
|
|
117
|
+
return false;
|
|
118
|
+
try {
|
|
119
|
+
return await opts.confirm(question, defaultYes);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Whether Cleo Nexus holds a backup of the project that this copy never
|
|
127
|
+
* synced: the project is registered with a head snapshot (E14, a `GET`), and
|
|
128
|
+
* the vault state records no sync of its stream from this project root. Any
|
|
129
|
+
* failure answers `false`, so the run falls back to link and back up.
|
|
130
|
+
*
|
|
131
|
+
* @param query - API URL, project root and id, stores and test overrides.
|
|
132
|
+
* @returns `true` when a restore, not a backup, is the right first step.
|
|
133
|
+
*/
|
|
134
|
+
export async function hasUnsyncedNexusBackup(query) {
|
|
135
|
+
try {
|
|
136
|
+
const conn = await connectNexusCloud(query);
|
|
137
|
+
const detail = await conn.find(`/v1/projects/${encodeURIComponent(query.projectId)}`, nexusCloudProjectDetailSchema);
|
|
138
|
+
const stream = detail?.stream ?? null;
|
|
139
|
+
if (stream === null || stream.headCheckpointId === null)
|
|
140
|
+
return false;
|
|
141
|
+
const synced = (query.vaultState ?? new NexusVaultState()).stream(conn.apiUrl, conn.device.userId, stream.streamId, path.resolve(query.projectRoot));
|
|
142
|
+
return !synced?.lastCheckpointId;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/** The link step's options from the vault options. */
|
|
149
|
+
function linkOptions(vault, projectRoot) {
|
|
150
|
+
return {
|
|
151
|
+
apiUrl: vault.apiUrl,
|
|
152
|
+
projectRoot,
|
|
153
|
+
...(vault.store ? { store: vault.store } : {}),
|
|
154
|
+
...(vault.fetch ? { fetch: vault.fetch } : {}),
|
|
155
|
+
...(vault.deviceStore ? { deviceStore: vault.deviceStore } : {}),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/** Link the project (the `cleo project link` path), then push its first backup. */
|
|
159
|
+
async function linkAndBackUp(opts, vault, projectRoot) {
|
|
160
|
+
const commands = nexusFirstRunCommands(vault.apiUrl);
|
|
161
|
+
const base = { projectRoot, offer: 'link-and-backup' };
|
|
162
|
+
opts.onStep?.('link');
|
|
163
|
+
let linked;
|
|
164
|
+
try {
|
|
165
|
+
linked = await (opts.link ?? linkProjectToNexus)(linkOptions(vault, projectRoot));
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
return nexusFirstRunResult('link-failed', {
|
|
169
|
+
...base,
|
|
170
|
+
nextCommand: commands.linkAndBackUp,
|
|
171
|
+
warnings: [{ code: W_NEXUS_FIRST_RUN_LINK, message: describeFailure(err) }],
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const warnings = linked.warnings.map((message) => ({
|
|
175
|
+
code: W_NEXUS_FIRST_RUN_LINK_NOTE,
|
|
176
|
+
message,
|
|
177
|
+
}));
|
|
178
|
+
if (linked.replica === null) {
|
|
179
|
+
// A push needs this copy attached from this device; the link's warning says why it is not.
|
|
180
|
+
return nexusFirstRunResult('backup-failed', {
|
|
181
|
+
...base,
|
|
182
|
+
link: linked.link,
|
|
183
|
+
nextCommand: commands.linkAndBackUp,
|
|
184
|
+
warnings: [
|
|
185
|
+
...warnings,
|
|
186
|
+
{
|
|
187
|
+
code: W_NEXUS_FIRST_RUN_BACKUP,
|
|
188
|
+
message: `not backed up: this copy is not attached from this device${linked.attachError ? ` (${linked.attachError.code}: ${linked.attachError.message})` : ''}`,
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
opts.onStep?.('backup');
|
|
194
|
+
let pushed;
|
|
195
|
+
try {
|
|
196
|
+
pushed = await (opts.push ?? pushNexusVault)({ ...vault, projectRoot, scope: 'project' });
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
return nexusFirstRunResult('backup-failed', {
|
|
200
|
+
...base,
|
|
201
|
+
link: linked.link,
|
|
202
|
+
// Behind: another device pushed since this copy last synced; bring that state here first.
|
|
203
|
+
nextCommand: codeOf(err) === 'E_NEXUS_VAULT_BEHIND' ? commands.pull : commands.push,
|
|
204
|
+
warnings: [...warnings, { code: W_NEXUS_FIRST_RUN_BACKUP, message: describeFailure(err) }],
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return nexusFirstRunResult('backed-up', {
|
|
208
|
+
...base,
|
|
209
|
+
link: linked.link,
|
|
210
|
+
backup: { status: pushed.status, snapshot: pushed.snapshot },
|
|
211
|
+
warnings: [...warnings, ...pushed.warnings],
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/** Restore the cloud's backup into this copy, then link it (the `cleo cloud restore` path). */
|
|
215
|
+
async function restoreHere(opts, vault, projectRoot, projectId) {
|
|
216
|
+
const base = { projectRoot, offer: 'restore' };
|
|
217
|
+
opts.onStep?.('restore');
|
|
218
|
+
let restored;
|
|
219
|
+
try {
|
|
220
|
+
restored = await (opts.restore ?? restoreNexusVault)({
|
|
221
|
+
...vault,
|
|
222
|
+
scope: 'project',
|
|
223
|
+
mode: 'restore',
|
|
224
|
+
projectId,
|
|
225
|
+
into: projectRoot,
|
|
226
|
+
relink: async (root) => {
|
|
227
|
+
try {
|
|
228
|
+
return (await (opts.link ?? linkProjectToNexus)(linkOptions(vault, root))).warnings;
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
return [
|
|
232
|
+
`restored, but linking this copy failed (${describeFailure(err)}); run \`cleo project link\``,
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
const commands = nexusFirstRunCommands(vault.apiUrl);
|
|
240
|
+
const restoreCmd = commands.restore(projectId, projectRoot);
|
|
241
|
+
const warnings = [{ code: W_NEXUS_FIRST_RUN_RESTORE, message: describeFailure(err) }];
|
|
242
|
+
if (codeOf(err) === 'E_NEXUS_VAULT_LOCAL_CHANGES') {
|
|
243
|
+
// This copy has rows it never synced: rerunning the restore refuses the same way, so
|
|
244
|
+
// the user chooses which side wins (review LOW-2).
|
|
245
|
+
return nexusFirstRunResult('restore-failed', {
|
|
246
|
+
...base,
|
|
247
|
+
choices: [
|
|
248
|
+
{
|
|
249
|
+
command: `${restoreCmd} --force`,
|
|
250
|
+
effect: "take the cloud's backup; this copy's rows are replaced after a safety backup",
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
command: commands.linkAndForkPush,
|
|
254
|
+
effect: "keep this copy; it is pushed as a labelled fork over the cloud's newest backup",
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
warnings,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
return nexusFirstRunResult('restore-failed', { ...base, nextCommand: restoreCmd, warnings });
|
|
261
|
+
}
|
|
262
|
+
return nexusFirstRunResult('restored', {
|
|
263
|
+
...base,
|
|
264
|
+
link: readNexusProjectLink(projectRoot, vault.apiUrl),
|
|
265
|
+
restore: {
|
|
266
|
+
status: restored.status,
|
|
267
|
+
snapshot: restored.snapshot,
|
|
268
|
+
tables: restored.tables,
|
|
269
|
+
safetyBackup: restored.safetyBackup,
|
|
270
|
+
},
|
|
271
|
+
warnings: restored.warnings,
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
/** Outside a project: the account's projects by name, with their restore commands. */
|
|
275
|
+
async function listProjectsStep(opts, vault) {
|
|
276
|
+
opts.onStep?.('projects');
|
|
277
|
+
try {
|
|
278
|
+
const listed = await (opts.listProjects ?? listNexusNamedProjects)({
|
|
279
|
+
...vault,
|
|
280
|
+
deviceId: opts.deviceId ?? null,
|
|
281
|
+
});
|
|
282
|
+
const restorable = listed.projects.filter((p) => p.restoreCommand !== null);
|
|
283
|
+
return nexusFirstRunResult('projects', {
|
|
284
|
+
projects: listed.projects,
|
|
285
|
+
nextCommand: restorable.length === 1 ? (restorable[0]?.restoreCommand ?? null) : null,
|
|
286
|
+
warnings: listed.warnings,
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
catch (err) {
|
|
290
|
+
return nexusFirstRunResult('projects', {
|
|
291
|
+
nextCommand: nexusFirstRunCommands(vault.apiUrl).projects,
|
|
292
|
+
warnings: [{ code: W_NEXUS_FIRST_RUN_PROJECTS, message: describeFailure(err) }],
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/** Inside an unlinked project: restore the cloud's backup, or link and back up; asking first. */
|
|
297
|
+
async function offerInProject(opts, vault, project) {
|
|
298
|
+
const projectId = project.link?.remoteProjectId ?? project.projectId;
|
|
299
|
+
const restore = await (opts.cloudBackup ?? hasUnsyncedNexusBackup)({
|
|
300
|
+
...vault,
|
|
301
|
+
projectRoot: project.root,
|
|
302
|
+
projectId,
|
|
303
|
+
});
|
|
304
|
+
const question = restore ? NEXUS_FIRST_RUN_RESTORE_QUESTION : NEXUS_FIRST_RUN_QUESTION;
|
|
305
|
+
// A restore replaces what this copy holds, so an empty answer means no (review LOW-3).
|
|
306
|
+
if (await consented(opts, question, !restore)) {
|
|
307
|
+
return restore
|
|
308
|
+
? restoreHere(opts, vault, project.root, projectId)
|
|
309
|
+
: linkAndBackUp(opts, vault, project.root);
|
|
310
|
+
}
|
|
311
|
+
const commands = nexusFirstRunCommands(vault.apiUrl);
|
|
312
|
+
return nexusFirstRunResult(opts.consent === 'prompt' && opts.confirm ? 'declined' : 'offered', {
|
|
313
|
+
projectRoot: project.root,
|
|
314
|
+
link: project.link,
|
|
315
|
+
offer: restore ? 'restore' : 'link-and-backup',
|
|
316
|
+
nextCommand: restore ? commands.restore(projectId, project.root) : commands.linkAndBackUp,
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* The guided first run after `cleo login nexus` signed in. Never throws for a
|
|
321
|
+
* flow failure: the result's state, warnings and next command describe it.
|
|
322
|
+
*
|
|
323
|
+
* @param opts - Consent, prompt, device id, profile, API URL, stores and test overrides.
|
|
324
|
+
* @returns How it ended.
|
|
325
|
+
* @throws {NexusAccountError} `E_NEXUS_INVALID_API_URL` only (login has already checked it).
|
|
326
|
+
*/
|
|
327
|
+
export async function runNexusFirstRun(opts) {
|
|
328
|
+
if (opts.readOnly === true) {
|
|
329
|
+
return nexusFirstRunResult('skipped', {
|
|
330
|
+
reason: 'this device signed in with the read-only profile, which cannot link or back up',
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
if (!isNexusDeviceEnabled()) {
|
|
334
|
+
return nexusFirstRunResult('skipped', {
|
|
335
|
+
reason: 'device credentials are off (CLEO_NEXUS_DEVICE=0); linking and backups need them',
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
const { consent, confirm, deviceId, readOnly, onStep, link, push, restore, cloudBackup, listProjects, ...rest } = opts;
|
|
339
|
+
const apiUrl = resolveNexusApiUrl(opts.apiUrl);
|
|
340
|
+
const vault = { ...rest, apiUrl };
|
|
341
|
+
const project = currentNexusCloudProject(apiUrl, opts.projectRoot);
|
|
342
|
+
if (project === null)
|
|
343
|
+
return listProjectsStep(opts, vault);
|
|
344
|
+
if (attachedHere(project.link, deviceId ?? null)) {
|
|
345
|
+
return nexusFirstRunResult('already-linked', {
|
|
346
|
+
projectRoot: project.root,
|
|
347
|
+
link: project.link,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
return offerInProject(opts, vault, project);
|
|
351
|
+
}
|
|
352
|
+
//# sourceMappingURL=nexus-first-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nexus-first-run.js","sourceRoot":"","sources":["../../src/cloud/nexus-first-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAU7B,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAyB,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EACL,sBAAsB,EAGtB,eAAe,EACf,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,sEAAsE;AACtE,MAAM,CAAC,MAAM,wBAAwB,GACnC,mFAAmF,CAAC;AAEtF,yFAAyF;AACzF,MAAM,CAAC,MAAM,gCAAgC,GAC3C,qFAAqF,CAAC;AAExF,gDAAgD;AAChD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE/D,6CAA6C;AAC7C,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AAEnE,yDAAyD;AACzD,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC;AAErE,g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EAAE,OAAO,CAAC,IAAI;YACzB,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -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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