@detergent-software/atk 8.7.0-dev.5 → 8.7.0-dev.6
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/CHANGELOG.md +10 -0
- package/build/commands/index.d.ts.map +1 -1
- package/build/commands/index.js +1 -0
- package/build/commands/index.js.map +1 -1
- package/build/commands/move.d.ts +28 -0
- package/build/commands/move.d.ts.map +1 -0
- package/build/commands/move.js +180 -0
- package/build/commands/move.js.map +1 -0
- package/build/lib/mover.d.ts +103 -0
- package/build/lib/mover.d.ts.map +1 -0
- package/build/lib/mover.js +375 -0
- package/build/lib/mover.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [8.7.0-dev.6](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv8.7.0-dev.5&targetVersion=GTv8.7.0-dev.6) (2026-10-15)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* **cli:** move an install between the project and user scope (ATK-334) ([62ca125](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/62ca125c40e3170176039335179defc48a64352a))
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **cli:** plan the move under its locks and roll back per tool (ATK-334) ([e815fa9](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/commit/e815fa9e61f27bac0cc25d4bcdca6d59f8e0f1e2))
|
|
10
|
+
|
|
1
11
|
## [8.7.0-dev.5](https://emergentcode.visualstudio.com/Emergent%20Software/_git/Emergent.AgenticToolkit/branchCompare?baseVersion=GTv8.7.0-dev.4&targetVersion=GTv8.7.0-dev.5) (2026-10-15)
|
|
2
12
|
|
|
3
13
|
### Bug Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,8DAAyD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/commands/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,8DAAyD,CAAC;AA2ClF,MAAM,CAAC,OAAO,UAAU,KAAK,4CAiB5B"}
|
package/build/commands/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const commands = [
|
|
|
18
18
|
['list', 'List installed assets'],
|
|
19
19
|
['login', 'Sign in with your Emergent (Microsoft Entra) account'],
|
|
20
20
|
['logout', 'Sign out of your Emergent account'],
|
|
21
|
+
['move', 'Move an installed asset between the project and the user scope'],
|
|
21
22
|
['outdated', 'Show available updates for installed assets'],
|
|
22
23
|
['pin', 'Pin an installed asset at its installed version'],
|
|
23
24
|
['promote', 'Promote an org-scoped asset or bundle to the global namespace'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/commands/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAG,sDAAsD,CAAC;AAElF,MAAM,QAAQ,GAAG;IACf,CAAC,OAAO,EAAE,gDAAgD,CAAC;IAC3D,CAAC,QAAQ,EAAE,yCAAyC,CAAC;IACrD,CAAC,OAAO,EAAE,2BAA2B,CAAC;IACtC,CAAC,UAAU,EAAE,mDAAmD,CAAC;IACjE,CAAC,QAAQ,EAAE,+CAA+C,CAAC;IAC3D,CAAC,WAAW,EAAE,gFAAgF,CAAC;IAC/F,CAAC,MAAM,EAAE,mDAAmD,CAAC;IAC7D,CAAC,QAAQ,EAAE,8CAA8C,CAAC;IAC1D,CAAC,OAAO,EAAE,sEAAsE,CAAC;IACjF,CAAC,QAAQ,EAAE,0EAA0E,CAAC;IACtF,CAAC,MAAM,EAAE,uCAAuC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AAI,IAAC,QAAQ,gCAAiB,EAC9B,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAC9B,MAAC,IAAI,eACF,IAAI,EACL,KAAC,IAAI,IAAC,IAAI,kBAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,GAAQ,OAAE,IAAI,KAFxC,IAAI,CAGR,CACR,CAAC,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const description = "Move an installed asset between the project and the user scope";
|
|
3
|
+
export declare const options: z.ZodObject<{
|
|
4
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
5
|
+
force: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
projectRoot: z.ZodOptional<z.ZodString>;
|
|
8
|
+
to: z.ZodEnum<{
|
|
9
|
+
project: "project";
|
|
10
|
+
user: "user";
|
|
11
|
+
}>;
|
|
12
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
13
|
+
skill: "skill";
|
|
14
|
+
agent: "agent";
|
|
15
|
+
rule: "rule";
|
|
16
|
+
hook: "hook";
|
|
17
|
+
"memory-template": "memory-template";
|
|
18
|
+
"mcp-config": "mcp-config";
|
|
19
|
+
}>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const args: z.ZodTuple<[z.ZodString], null>;
|
|
22
|
+
type Props = {
|
|
23
|
+
args: z.infer<typeof args>;
|
|
24
|
+
options: z.infer<typeof options>;
|
|
25
|
+
};
|
|
26
|
+
export default function Move({ args: [rawName], options: { dryRun, force, json, projectRoot, to, type } }: Props): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=move.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.d.ts","sourceRoot":"","sources":["../../src/commands/move.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,WAAW,mEAAmE,CAAC;AAE5F,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;iBAgDlB,CAAC;AAEH,eAAO,MAAM,IAAI,iCAAmF,CAAC;AAIrG,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,2CA6I/G"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { option } from 'pastel';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { ErrorView, Spinner } from '../components/index.js';
|
|
6
|
+
import { useCommand } from '../hooks/useCommand.js';
|
|
7
|
+
import { errorMessage } from '../lib/errors.js';
|
|
8
|
+
import { executeMove, finishMoveCommand, planMove } from '../lib/mover.js';
|
|
9
|
+
import { formatOrgName, parseOrgFromName } from '../lib/org.js';
|
|
10
|
+
import { renderJson, useNonInteractive } from '../lib/output.js';
|
|
11
|
+
import { fetchRegistry } from '../lib/registry.js';
|
|
12
|
+
import { AssetType } from '../lib/schemas/index.js';
|
|
13
|
+
import { scopeLabel } from '../lib/scope.js';
|
|
14
|
+
export const description = 'Move an installed asset between the project and the user scope';
|
|
15
|
+
export const options = z.object({
|
|
16
|
+
dryRun: z
|
|
17
|
+
.boolean()
|
|
18
|
+
.default(false)
|
|
19
|
+
.describe(option({
|
|
20
|
+
description: 'Show what would be installed and removed without making changes',
|
|
21
|
+
})),
|
|
22
|
+
force: z
|
|
23
|
+
.boolean()
|
|
24
|
+
.default(false)
|
|
25
|
+
.describe(option({
|
|
26
|
+
alias: 'f',
|
|
27
|
+
description: "Move a frozen asset with local edits (they are lost), and overwrite files at the target that ATK didn't install",
|
|
28
|
+
})),
|
|
29
|
+
json: z
|
|
30
|
+
.boolean()
|
|
31
|
+
.default(false)
|
|
32
|
+
.describe(option({
|
|
33
|
+
alias: 'j',
|
|
34
|
+
description: 'Output raw JSON (for scripting and CI)',
|
|
35
|
+
})),
|
|
36
|
+
projectRoot: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe(option({
|
|
40
|
+
alias: 'P',
|
|
41
|
+
description: 'The project side of the move (default: the project at the current directory)',
|
|
42
|
+
})),
|
|
43
|
+
to: z.enum(['project', 'user']).describe(option({
|
|
44
|
+
description: 'The scope to move the asset to: user (the user root, ~ by default) or project',
|
|
45
|
+
})),
|
|
46
|
+
type: AssetType.optional().describe(option({
|
|
47
|
+
alias: 't',
|
|
48
|
+
description: 'Asset type, when the name is installed as more than one type',
|
|
49
|
+
})),
|
|
50
|
+
});
|
|
51
|
+
export const args = z.tuple([z.string().describe('Asset name to move (supports @org/name syntax)')]);
|
|
52
|
+
export default function Move({ args: [rawName], options: { dryRun, force, json, projectRoot, to, type } }) {
|
|
53
|
+
const { name, org } = parseOrgFromName(rawName);
|
|
54
|
+
const { json: effectiveJson } = useNonInteractive(json);
|
|
55
|
+
const state = useCommand(async (progress) => {
|
|
56
|
+
progress('Fetching registry...');
|
|
57
|
+
const registry = await fetchRegistry({ force: true });
|
|
58
|
+
progress('Planning the move...');
|
|
59
|
+
const request = { force, name, org, projectRoot, to, type };
|
|
60
|
+
if (dryRun)
|
|
61
|
+
return { outcome: 'dry-run', plan: await planMove(request, registry, progress) };
|
|
62
|
+
const result = await executeMove(request, registry, progress);
|
|
63
|
+
if (result.outcome === 'source-uninstall-failed')
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
return result;
|
|
66
|
+
}, [rawName, dryRun, force, projectRoot, to, type]);
|
|
67
|
+
if (state.status === 'loading') {
|
|
68
|
+
return _jsx(Spinner, { message: state.message });
|
|
69
|
+
}
|
|
70
|
+
if (state.status === 'error') {
|
|
71
|
+
if (effectiveJson) {
|
|
72
|
+
return renderJson({
|
|
73
|
+
...(state.code ? { code: state.code } : {}),
|
|
74
|
+
...(state.command ? { command: state.command } : {}),
|
|
75
|
+
...(state.hint ? { hint: state.hint } : {}),
|
|
76
|
+
message: state.message,
|
|
77
|
+
outcome: 'error',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return _jsx(ErrorView, { command: state.command, hint: state.hint, message: state.message });
|
|
81
|
+
}
|
|
82
|
+
const { data } = state;
|
|
83
|
+
const { plan } = data;
|
|
84
|
+
const from = scopeLabel(plan.from);
|
|
85
|
+
const target = scopeLabel(plan.to);
|
|
86
|
+
if (data.outcome === 'source-uninstall-failed') {
|
|
87
|
+
const message = `Installed ${formatOrgName(plan.asset.org, plan.asset.name)} in ${target}, but removing it from ${from} failed: ${errorMessage(data.error)}`;
|
|
88
|
+
const command = finishMoveCommand(plan);
|
|
89
|
+
const hint = `Both scopes have it installed now. Run the command to finish the move, or atk sync in ${from} to restore its files.`;
|
|
90
|
+
if (effectiveJson) {
|
|
91
|
+
return renderJson({
|
|
92
|
+
...moveFields(plan),
|
|
93
|
+
command,
|
|
94
|
+
hint,
|
|
95
|
+
installed: installedFields(data.toolResults),
|
|
96
|
+
message,
|
|
97
|
+
outcome: data.outcome,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return _jsx(ErrorView, { command: command, hint: hint, message: message });
|
|
101
|
+
}
|
|
102
|
+
if (data.outcome === 'dry-run') {
|
|
103
|
+
if (effectiveJson) {
|
|
104
|
+
return renderJson({
|
|
105
|
+
...moveFields(plan),
|
|
106
|
+
install: plan.install.entries.map((e) => ({
|
|
107
|
+
name: e.asset.name,
|
|
108
|
+
...(e.asset.org ? { org: e.asset.org } : {}),
|
|
109
|
+
reason: e.reason,
|
|
110
|
+
type: e.asset.type,
|
|
111
|
+
version: e.version,
|
|
112
|
+
})),
|
|
113
|
+
outcome: data.outcome,
|
|
114
|
+
uninstall: [plan.asset, ...plan.dependencies.moving].map(assetFields),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsx(Text, { color: 'yellow', children: "~ Dry run \u2014 no changes will be made" }), _jsxs(Text, { children: ["Would move ", _jsx(Text, { bold: true, children: formatOrgName(plan.asset.org, plan.asset.name) }), " v", plan.asset.version, " from", ' ', from, " to ", target, ":"] }), _jsx(Text, { children: " " }), _jsxs(Text, { dimColor: true, children: ["Install in ", target, " (", plan.targetTools.map((t) => t.tool).join(', '), "):"] }), plan.install.entries.length === 0 && _jsxs(Text, { dimColor: true, children: [' ', "nothing (already installed)"] }), plan.install.entries.map((e) => (_jsxs(Text, { children: [' ', "+ ", formatOrgName(e.asset.org, e.asset.name), _jsxs(Text, { dimColor: true, children: [' ', "(", e.asset.type, ") v", e.version, e.reason === 'dependency' ? ' (dependency)' : ''] })] }, `${e.asset.type}:${e.asset.org ?? ''}:${e.asset.name}`))), _jsx(Text, { children: " " }), _jsxs(Text, { dimColor: true, children: ["Remove from ", from, ":"] }), [plan.asset, ...plan.dependencies.moving].map((a) => (_jsx(AssetLine, { asset: a, mark: '\u2715' }, `${a.type}:${a.org ?? ''}:${a.name}`))), _jsx(Kept, { from: from, plan: plan })] }));
|
|
118
|
+
}
|
|
119
|
+
if (effectiveJson) {
|
|
120
|
+
return renderJson({
|
|
121
|
+
...moveFields(plan),
|
|
122
|
+
installed: installedFields(data.toolResults),
|
|
123
|
+
outcome: data.outcome,
|
|
124
|
+
removed: data.removed.map((r) => ({
|
|
125
|
+
name: r.name,
|
|
126
|
+
...(r.org ? { org: r.org } : {}),
|
|
127
|
+
reason: r.reason,
|
|
128
|
+
type: r.type,
|
|
129
|
+
version: r.version,
|
|
130
|
+
})),
|
|
131
|
+
...(data.warnings.length > 0 ? { warnings: data.warnings } : {}),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { color: 'green', children: ["Moved ", _jsx(Text, { bold: true, children: formatOrgName(plan.asset.org, plan.asset.name) }), " v", plan.asset.version, " from ", from, " to", ' ', target, plan.asset.pinnedVersion ? _jsx(Text, { dimColor: true, children: " (pinned)" }) : null, plan.frozen ? _jsx(Text, { dimColor: true, children: " (frozen)" }) : null] }), plan.dependencies.moving.map((a) => (_jsx(AssetLine, { asset: a, mark: '\u2192' }, `${a.type}:${a.org ?? ''}:${a.name}`))), _jsx(Kept, { from: from, plan: plan }), data.warnings.map((warning) => (_jsxs(Text, { color: 'yellow', children: ["! ", warning] }, warning)))] }));
|
|
135
|
+
}
|
|
136
|
+
function assetFields(asset) {
|
|
137
|
+
return {
|
|
138
|
+
installReason: asset.installReason ?? 'direct',
|
|
139
|
+
name: asset.name,
|
|
140
|
+
...(asset.org ? { org: asset.org } : {}),
|
|
141
|
+
...(asset.pinnedVersion ? { pinnedVersion: asset.pinnedVersion } : {}),
|
|
142
|
+
type: asset.type,
|
|
143
|
+
version: asset.version,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function AssetLine({ asset, mark }) {
|
|
147
|
+
return (_jsxs(Text, { children: [' ', mark, " ", formatOrgName(asset.org, asset.name), _jsxs(Text, { dimColor: true, children: [' ', "(", asset.type, ") v", asset.version, (asset.installReason ?? 'direct') === 'dependency' ? ' (dependency)' : ''] })] }));
|
|
148
|
+
}
|
|
149
|
+
function installedFields(toolResults) {
|
|
150
|
+
return toolResults.map(({ results, tool }) => ({
|
|
151
|
+
assets: results.map((r) => ({
|
|
152
|
+
name: r.name,
|
|
153
|
+
...(r.org ? { org: r.org } : {}),
|
|
154
|
+
reason: r.installReason,
|
|
155
|
+
type: r.type,
|
|
156
|
+
version: r.version,
|
|
157
|
+
})),
|
|
158
|
+
tool,
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
/** The asset's dependencies that stay in the source because other assets there need them. */
|
|
162
|
+
function Kept({ from, plan }) {
|
|
163
|
+
if (plan.dependencies.staying.length === 0)
|
|
164
|
+
return null;
|
|
165
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsxs(Text, { dimColor: true, children: ["Kept in ", from, " (other assets there need them):"] }), plan.dependencies.staying.map((a) => (_jsx(AssetLine, { asset: a, mark: '=' }, `${a.type}:${a.org ?? ''}:${a.name}`)))] }));
|
|
166
|
+
}
|
|
167
|
+
/** The fields every `--json` outcome of a planned move carries: the asset and both scopes. */
|
|
168
|
+
function moveFields(plan) {
|
|
169
|
+
return {
|
|
170
|
+
asset: assetFields(plan.asset),
|
|
171
|
+
dependencies: {
|
|
172
|
+
moving: plan.dependencies.moving.map(assetFields),
|
|
173
|
+
staying: plan.dependencies.staying.map(assetFields),
|
|
174
|
+
},
|
|
175
|
+
from: { root: plan.from.root, scope: plan.from.scope, tools: plan.sourceTools.map((t) => t.tool) },
|
|
176
|
+
frozen: plan.frozen,
|
|
177
|
+
to: { root: plan.to.root, scope: plan.to.scope, tools: plan.targetTools.map((t) => t.tool) },
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=move.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move.js","sourceRoot":"","sources":["../../src/commands/move.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,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,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;SACpD;QACD,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;QAClG,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;KAC7F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { InstallPlan } from './resolver.js';
|
|
2
|
+
import type { AssetType, Registry } from './schemas/index.js';
|
|
3
|
+
import type { InstalledAsset, Lockfile } from './schemas/lockfile.js';
|
|
4
|
+
import { GuidedError } from './errors.js';
|
|
5
|
+
import { type ToolInstallResult } from './multi-tool-install.js';
|
|
6
|
+
import { type ResolvedScope, type Scope } from './scope.js';
|
|
7
|
+
import { resolveTools } from './tool-resolver.js';
|
|
8
|
+
import { type UninstallPlan, type UninstallResult } from './uninstaller.js';
|
|
9
|
+
/** A move worked out before anything is written: both halves, and the scopes they run in. */
|
|
10
|
+
export interface MovePlan {
|
|
11
|
+
/** The asset's lockfile entry in the source scope. */
|
|
12
|
+
asset: InstalledAsset;
|
|
13
|
+
/**
|
|
14
|
+
* The asset's dependencies the source has: `moving` leave it with the asset (nothing else
|
|
15
|
+
* there needs them), `staying` stay because other source assets need them.
|
|
16
|
+
*/
|
|
17
|
+
dependencies: {
|
|
18
|
+
moving: InstalledAsset[];
|
|
19
|
+
staying: InstalledAsset[];
|
|
20
|
+
};
|
|
21
|
+
from: ResolvedScope;
|
|
22
|
+
/** The asset is frozen in the source, so it is frozen at the target too. */
|
|
23
|
+
frozen: boolean;
|
|
24
|
+
/** What the target installs: `requested` less the dependencies it already has in place. */
|
|
25
|
+
install: InstallPlan;
|
|
26
|
+
/**
|
|
27
|
+
* The plan the target install runs, which trims it the same way under the lockfile lock: the
|
|
28
|
+
* asset at its source version (unless the target has that version in place), and its dependencies.
|
|
29
|
+
*/
|
|
30
|
+
requested: InstallPlan;
|
|
31
|
+
sourceTools: ScopeTools;
|
|
32
|
+
targetTools: ScopeTools;
|
|
33
|
+
to: ResolvedScope;
|
|
34
|
+
/** What the source uninstalls: the asset and its `moving` dependencies. */
|
|
35
|
+
uninstall: UninstallPlan;
|
|
36
|
+
}
|
|
37
|
+
/** What `atk move` asks for: an installed asset of one scope, and the scope to move it to. */
|
|
38
|
+
export interface MoveRequest {
|
|
39
|
+
/**
|
|
40
|
+
* Move a frozen asset with local edits (the edits are lost), and let the target install
|
|
41
|
+
* overwrite files ATK didn't install, as `install --force` does.
|
|
42
|
+
*/
|
|
43
|
+
force?: boolean;
|
|
44
|
+
name: string;
|
|
45
|
+
/** The org of an `@org/name` spec. */
|
|
46
|
+
org?: string;
|
|
47
|
+
/** The project side of the move (`-P`); the marker walk from cwd otherwise. */
|
|
48
|
+
projectRoot?: string;
|
|
49
|
+
to: Scope;
|
|
50
|
+
type?: AssetType;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* How a move that got past its target install ended. A `moved` move's `warnings` are follow-ups
|
|
54
|
+
* that failed after the source uninstall (dropping the source's freeze record).
|
|
55
|
+
*/
|
|
56
|
+
export type MoveResult = {
|
|
57
|
+
error: unknown;
|
|
58
|
+
outcome: 'source-uninstall-failed';
|
|
59
|
+
toolResults: ToolInstallResult[];
|
|
60
|
+
} | {
|
|
61
|
+
outcome: 'moved';
|
|
62
|
+
removed: UninstallResult[];
|
|
63
|
+
toolResults: ToolInstallResult[];
|
|
64
|
+
warnings: string[];
|
|
65
|
+
};
|
|
66
|
+
type ScopeTools = Awaited<ReturnType<typeof resolveTools>>;
|
|
67
|
+
/** Thrown when a move is refused before anything is written. */
|
|
68
|
+
export declare class MoveError extends GuidedError {
|
|
69
|
+
name: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* `plan` with each dependency the source has installed at the source's version, so a dependency
|
|
73
|
+
* that moves keeps its lockfile entry. Only when the registry still has that version, it declares
|
|
74
|
+
* the same dependencies as the version the resolver picked (so the rest of the plan still fits
|
|
75
|
+
* it), and every dependent in the plan accepts it. The others stay as the resolver picked them.
|
|
76
|
+
*/
|
|
77
|
+
export declare function atSourceVersions(plan: InstallPlan, source: Lockfile): InstallPlan;
|
|
78
|
+
/**
|
|
79
|
+
* Plan and run a move. Both lockfiles stay locked throughout, the user root's first, so two moves
|
|
80
|
+
* in opposite directions take them in the same order, and the plan ({@link planMove}) is worked out
|
|
81
|
+
* under them. The target install runs first and rolls itself back when it fails, so the source is
|
|
82
|
+
* untouched; so is it when giving the new target entries the source's pin, install reason, bundle
|
|
83
|
+
* and freeze fails, which rolls the target back too. Then the source uninstalls the asset and its
|
|
84
|
+
* moving dependencies (a failure there is `source-uninstall-failed`, with both scopes installed),
|
|
85
|
+
* and drops its freeze record.
|
|
86
|
+
*/
|
|
87
|
+
export declare function executeMove(request: MoveRequest, registry: Registry, onProgress?: (message: string) => void): Promise<MoveResult & {
|
|
88
|
+
plan: MovePlan;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* The command that finishes a move whose source half failed: the uninstall in the source scope.
|
|
92
|
+
*/
|
|
93
|
+
export declare function finishMoveCommand({ asset, from }: Pick<MovePlan, 'asset' | 'from'>): string;
|
|
94
|
+
/**
|
|
95
|
+
* Work out a move without writing anything. The target scope is `to`, the source the other one;
|
|
96
|
+
* `-P` (or the marker walk) gives the project side. Refused here: a project root that is the user
|
|
97
|
+
* root, an asset the source doesn't have (or a bundle), one other source assets depend on, one the
|
|
98
|
+
* target has at another version, and a frozen one with local edits unless `force`. A target that
|
|
99
|
+
* already has the asset in place at the same version keeps its copy.
|
|
100
|
+
*/
|
|
101
|
+
export declare function planMove(request: MoveRequest, registry: Registry, onProgress?: (message: string) => void): Promise<MovePlan>;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=mover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mover.d.ts","sourceRoot":"","sources":["../../src/lib/mover.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOtE,OAAO,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAC;AAcxD,OAAO,EAA8B,KAAK,iBAAiB,EAA2B,MAAM,yBAAyB,CAAC;AAKtH,OAAO,EAAmB,KAAK,aAAa,EAAiC,KAAK,KAAK,EAAc,MAAM,YAAY,CAAC;AACxH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAiC,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE3G,6FAA6F;AAC7F,MAAM,WAAW,QAAQ;IACvB,sDAAsD;IACtD,KAAK,EAAE,cAAc,CAAC;IACtB;;;OAGG;IACH,YAAY,EAAE;QAAE,MAAM,EAAE,cAAc,EAAE,CAAC;QAAC,OAAO,EAAE,cAAc,EAAE,CAAA;KAAE,CAAC;IACtE,IAAI,EAAE,aAAa,CAAC;IACpB,4EAA4E;IAC5E,MAAM,EAAE,OAAO,CAAC;IAChB,2FAA2F;IAC3F,OAAO,EAAE,WAAW,CAAC;IACrB;;;OAGG;IACH,SAAS,E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CAAE,CAAC,CAS1C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG,MAAM,CAI3F;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,QAAQ,EAClB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACrC,OAAO,CAAC,QAAQ,CAAC,CAsEnB"}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { satisfies } from 'semver';
|
|
3
|
+
import { resolveInstalledPaths } from './adapter.js';
|
|
4
|
+
import { supportsType } from './asset-tools.js';
|
|
5
|
+
import { verifyChecksums, verifyConfigEntries } from './checksum.js';
|
|
6
|
+
import { getConfigEntriesForTool } from './config-entries.js';
|
|
7
|
+
import { freezeAssetInConfig } from './config.js';
|
|
8
|
+
import { errorMessage, GuidedError } from './errors.js';
|
|
9
|
+
import { isInstalledForTool } from './installed-for-tool.js';
|
|
10
|
+
import { rollBackInstalledAssets } from './installer.js';
|
|
11
|
+
import { addAssetToLockfile, findDependencyAsset, findInstalledAsset, findInstalledAssetWithFallback, identityKey, readLockfile, withLockfileErrorHandling, writeLockfile, } from './lockfile.js';
|
|
12
|
+
import { executeInstallPlanForTools, withoutKeptDependencies } from './multi-tool-install.js';
|
|
13
|
+
import { formatOrgName } from './org.js';
|
|
14
|
+
import { isLatestAlias } from './registry.js';
|
|
15
|
+
import { resolveInstallPlan } from './resolver.js';
|
|
16
|
+
import {} from './schemas/config.js';
|
|
17
|
+
import { loadScopeConfig, resolveScope, saveScopeConfig, scopeLabel } from './scope.js';
|
|
18
|
+
import { resolveTools } from './tool-resolver.js';
|
|
19
|
+
import { planUninstall, uninstallAsset } from './uninstaller.js';
|
|
20
|
+
/** Thrown when a move is refused before anything is written. */
|
|
21
|
+
export class MoveError extends GuidedError {
|
|
22
|
+
name = 'MoveError';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `plan` with each dependency the source has installed at the source's version, so a dependency
|
|
26
|
+
* that moves keeps its lockfile entry. Only when the registry still has that version, it declares
|
|
27
|
+
* the same dependencies as the version the resolver picked (so the rest of the plan still fits
|
|
28
|
+
* it), and every dependent in the plan accepts it. The others stay as the resolver picked them.
|
|
29
|
+
*/
|
|
30
|
+
export function atSourceVersions(plan, source) {
|
|
31
|
+
const rangesFor = (name, type) => plan.entries.flatMap(({ versionData }) => (versionData.dependencies ?? [])
|
|
32
|
+
.filter((d) => d.name === name && d.type === type && d.version && !isLatestAlias(d.version))
|
|
33
|
+
.map((d) => d.version));
|
|
34
|
+
const entries = plan.entries.map((entry) => {
|
|
35
|
+
if (entry.reason !== 'dependency')
|
|
36
|
+
return entry;
|
|
37
|
+
const installed = findInstalledAsset(source, entry.asset.name, entry.asset.type, entry.asset.org);
|
|
38
|
+
if (!installed || installed.version === entry.version)
|
|
39
|
+
return entry;
|
|
40
|
+
const versionData = entry.asset.versions[installed.version];
|
|
41
|
+
if (!versionData || dependencyKey(versionData) !== dependencyKey(entry.versionData))
|
|
42
|
+
return entry;
|
|
43
|
+
const accepted = rangesFor(entry.asset.name, entry.asset.type).every((range) => satisfies(installed.version, range));
|
|
44
|
+
return accepted ? { ...entry, version: installed.version, versionData } : entry;
|
|
45
|
+
});
|
|
46
|
+
return { entries, totalCount: entries.length };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Plan and run a move. Both lockfiles stay locked throughout, the user root's first, so two moves
|
|
50
|
+
* in opposite directions take them in the same order, and the plan ({@link planMove}) is worked out
|
|
51
|
+
* under them. The target install runs first and rolls itself back when it fails, so the source is
|
|
52
|
+
* untouched; so is it when giving the new target entries the source's pin, install reason, bundle
|
|
53
|
+
* and freeze fails, which rolls the target back too. Then the source uninstalls the asset and its
|
|
54
|
+
* moving dependencies (a failure there is `source-uninstall-failed`, with both scopes installed),
|
|
55
|
+
* and drops its freeze record.
|
|
56
|
+
*/
|
|
57
|
+
export async function executeMove(request, registry, onProgress) {
|
|
58
|
+
const { project, user } = await moveScopes(request);
|
|
59
|
+
return await withLockfileErrorHandling(user.root, () => withLockfileErrorHandling(project.root, async () => {
|
|
60
|
+
const plan = await planMove(request, registry, onProgress);
|
|
61
|
+
return { ...(await runMove(plan, request.force, onProgress)), plan };
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The command that finishes a move whose source half failed: the uninstall in the source scope.
|
|
66
|
+
*/
|
|
67
|
+
export function finishMoveCommand({ asset, from }) {
|
|
68
|
+
const spec = formatOrgName(asset.org, asset.name);
|
|
69
|
+
const where = from.scope === 'user' ? '--user' : `--project-root "${from.root}"`;
|
|
70
|
+
return `atk uninstall ${spec} --type ${asset.type} ${where} --yes`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Work out a move without writing anything. The target scope is `to`, the source the other one;
|
|
74
|
+
* `-P` (or the marker walk) gives the project side. Refused here: a project root that is the user
|
|
75
|
+
* root, an asset the source doesn't have (or a bundle), one other source assets depend on, one the
|
|
76
|
+
* target has at another version, and a frozen one with local edits unless `force`. A target that
|
|
77
|
+
* already has the asset in place at the same version keeps its copy.
|
|
78
|
+
*/
|
|
79
|
+
export async function planMove(request, registry, onProgress) {
|
|
80
|
+
const { project, user } = await moveScopes(request);
|
|
81
|
+
const [from, to] = request.to === 'user' ? [project, user] : [user, project];
|
|
82
|
+
const [sourceTools, targetTools, source, target] = await Promise.all([
|
|
83
|
+
resolveTools(undefined, from.root),
|
|
84
|
+
resolveTools(undefined, to.root),
|
|
85
|
+
readLockfile(from.root),
|
|
86
|
+
readLockfile(to.root),
|
|
87
|
+
]);
|
|
88
|
+
const asset = findSourceAsset(source, request, from);
|
|
89
|
+
const displayName = formatOrgName(asset.org, asset.name);
|
|
90
|
+
const uninstall = planUninstall(source, asset.name, asset.org, asset.type);
|
|
91
|
+
if (uninstall.dependents.length > 0) {
|
|
92
|
+
const dependents = uninstall.dependents.map((d) => formatOrgName(d.org, d.name)).join(', ');
|
|
93
|
+
throw new MoveError(`"${displayName}" is needed by ${dependents} in ${scopeLabel(from)}, so it can't leave it.`, {
|
|
94
|
+
hint: `Move ${dependents} instead, or install ${displayName} in ${scopeLabel(to)} as well.`,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const atTarget = findInstalledAsset(target, asset.name, asset.type, asset.org);
|
|
98
|
+
if (atTarget && atTarget.version !== asset.version) {
|
|
99
|
+
throw new MoveError(`"${displayName}" is already installed in ${scopeLabel(to)} at v${atTarget.version}, not v${asset.version}.`, { hint: `Uninstall or update it in ${scopeLabel(to)} first, so the move doesn't change its version there.` });
|
|
100
|
+
}
|
|
101
|
+
const frozen = isFrozen(await loadScopeConfig(from.root), asset);
|
|
102
|
+
if (frozen && !request.force && (await hasLocalEdits(asset, sourceTools, from.root))) {
|
|
103
|
+
throw new MoveError(`"${displayName}" is frozen and has local edits in ${scopeLabel(from)}; moving it installs the registry's v${asset.version} and loses them.`, { hint: 'Run it again with --force to move it anyway.' });
|
|
104
|
+
}
|
|
105
|
+
const resolved = atSourceVersions(resolveInstallPlan(registry, asset.name, asset.type, asset.version, asset.org), source);
|
|
106
|
+
const inPlace = atTarget !== undefined &&
|
|
107
|
+
targetTools
|
|
108
|
+
.filter(({ adapter }) => supportsType(adapter, asset.type))
|
|
109
|
+
.every(({ adapter }) => isInstalledForTool(atTarget, adapter, to.root));
|
|
110
|
+
const requested = inPlace ? withoutEntry(resolved, asset) : resolved;
|
|
111
|
+
const install = withoutKeptDependencies(requested, target, targetTools, {
|
|
112
|
+
onProgress,
|
|
113
|
+
projectDir: to.root,
|
|
114
|
+
scope: to.scope,
|
|
115
|
+
});
|
|
116
|
+
const moving = uninstall.orphanedDependencies;
|
|
117
|
+
const movingKeys = new Set(moving.map(identityKey));
|
|
118
|
+
const staying = dependencyClosure(source, asset).filter((d) => !movingKeys.has(identityKey(d)));
|
|
119
|
+
return {
|
|
120
|
+
asset,
|
|
121
|
+
dependencies: { moving, staying },
|
|
122
|
+
from,
|
|
123
|
+
frozen,
|
|
124
|
+
install,
|
|
125
|
+
requested,
|
|
126
|
+
sourceTools,
|
|
127
|
+
targetTools,
|
|
128
|
+
to,
|
|
129
|
+
uninstall,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Give the target's entries what the source's had. A moved asset (the asset and its moving
|
|
134
|
+
* dependencies) the target didn't have gets its install reason, its bundle and, at the same
|
|
135
|
+
* version, its pin; one it had gets a pin it lacks, and a direct install reason when either was
|
|
136
|
+
* direct. A staying dependency the target newly got its own copy of gets its pin. Then freeze the
|
|
137
|
+
* asset when it was frozen: the last step, so a failure before it leaves nothing frozen.
|
|
138
|
+
*/
|
|
139
|
+
async function carryOver(plan, targetBefore) {
|
|
140
|
+
const { to } = plan;
|
|
141
|
+
let lockfile = await readLockfile(to.root);
|
|
142
|
+
const pinOf = (source, placed) => source.pinnedVersion && source.version === placed.version ? { pinnedVersion: source.pinnedVersion } : {};
|
|
143
|
+
for (const moved of [plan.asset, ...plan.dependencies.moving]) {
|
|
144
|
+
const placed = findInstalledAsset(lockfile, moved.name, moved.type, moved.org);
|
|
145
|
+
if (!placed)
|
|
146
|
+
continue;
|
|
147
|
+
const had = findInstalledAsset(targetBefore, moved.name, moved.type, moved.org);
|
|
148
|
+
const direct = (moved.installReason ?? 'direct') === 'direct';
|
|
149
|
+
const entry = had
|
|
150
|
+
? {
|
|
151
|
+
...placed,
|
|
152
|
+
installReason: direct || (had.installReason ?? 'direct') === 'direct' ? 'direct' : 'dependency',
|
|
153
|
+
...(placed.pinnedVersion ? {} : pinOf(moved, placed)),
|
|
154
|
+
}
|
|
155
|
+
: {
|
|
156
|
+
...placed,
|
|
157
|
+
...(moved.bundleOrigin ? { bundleOrigin: moved.bundleOrigin } : {}),
|
|
158
|
+
installReason: direct ? 'direct' : 'dependency',
|
|
159
|
+
...pinOf(moved, placed),
|
|
160
|
+
};
|
|
161
|
+
lockfile = addAssetToLockfile(lockfile, entry);
|
|
162
|
+
}
|
|
163
|
+
for (const staying of plan.dependencies.staying) {
|
|
164
|
+
const placed = findInstalledAsset(lockfile, staying.name, staying.type, staying.org);
|
|
165
|
+
if (!placed || findInstalledAsset(targetBefore, staying.name, staying.type, staying.org))
|
|
166
|
+
continue;
|
|
167
|
+
lockfile = addAssetToLockfile(lockfile, { ...placed, ...pinOf(staying, placed) });
|
|
168
|
+
}
|
|
169
|
+
await writeLockfile(to.root, lockfile);
|
|
170
|
+
if (plan.frozen)
|
|
171
|
+
await freezeAssetInConfig(to.root, plan.asset.name, plan.asset.type, plan.asset.org);
|
|
172
|
+
}
|
|
173
|
+
/** The installed assets `asset` depends on in `lockfile`, directly or through others. */
|
|
174
|
+
function dependencyClosure(lockfile, asset) {
|
|
175
|
+
const found = new Map();
|
|
176
|
+
const queue = [asset];
|
|
177
|
+
while (queue.length > 0) {
|
|
178
|
+
const current = queue.shift();
|
|
179
|
+
for (const dependency of current.dependencies ?? []) {
|
|
180
|
+
const installed = findDependencyAsset(lockfile, dependency, current.org);
|
|
181
|
+
if (!installed || found.has(identityKey(installed)) || identityKey(installed) === identityKey(asset))
|
|
182
|
+
continue;
|
|
183
|
+
found.set(identityKey(installed), installed);
|
|
184
|
+
queue.push(installed);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return [...found.values()];
|
|
188
|
+
}
|
|
189
|
+
/** A version's dependency declarations, as one comparable string. */
|
|
190
|
+
function dependencyKey({ dependencies = [], }) {
|
|
191
|
+
return dependencies
|
|
192
|
+
.map((d) => `${d.type}:${d.name}@${d.version ?? ''}`)
|
|
193
|
+
.sort()
|
|
194
|
+
.join(',');
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The source's entry for the requested asset: the org's (the spec's, else the lockfile's), else
|
|
198
|
+
* the global one, as `uninstall` finds it. A name of several types needs `--type`, and a bundle
|
|
199
|
+
* is refused, since a move takes one asset.
|
|
200
|
+
*/
|
|
201
|
+
function findSourceAsset(source, request, from) {
|
|
202
|
+
const org = request.org ?? source.org;
|
|
203
|
+
const installed = findInstalledAssetWithFallback(source, request.name, request.type, org);
|
|
204
|
+
const spec = formatOrgName(request.org, request.name);
|
|
205
|
+
if (!installed) {
|
|
206
|
+
if ((source.assets ?? []).some((a) => a.bundleOrigin?.name === request.name)) {
|
|
207
|
+
throw new MoveError(`"${spec}" is a bundle; atk move moves one asset at a time.`, {
|
|
208
|
+
hint: 'Move each of its assets, or install the bundle in the other scope and uninstall it here.',
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
throw new MoveError(`"${spec}" is not installed in ${scopeLabel(from)}.`);
|
|
212
|
+
}
|
|
213
|
+
if (!request.type) {
|
|
214
|
+
const types = (source.assets ?? [])
|
|
215
|
+
.filter((a) => a.name === installed.name && a.org === installed.org)
|
|
216
|
+
.map((a) => a.type)
|
|
217
|
+
.sort();
|
|
218
|
+
if (types.length > 1) {
|
|
219
|
+
throw new MoveError(`"${spec}" is installed as more than one type (${types.join(', ')}). Name the one to move with --type.`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return installed;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Whether any of the asset's files, or the config entries it registered, differs from what its
|
|
226
|
+
* lockfile entry recorded, for any tool that has it in place.
|
|
227
|
+
*/
|
|
228
|
+
async function hasLocalEdits(asset, tools, root) {
|
|
229
|
+
for (const { adapter } of tools) {
|
|
230
|
+
if (!isInstalledForTool(asset, adapter, root))
|
|
231
|
+
continue;
|
|
232
|
+
const files = resolveInstalledPaths(asset, adapter, root).files.map((f) => ({
|
|
233
|
+
checksum: f.checksum,
|
|
234
|
+
path: join(root, f.installedPath),
|
|
235
|
+
}));
|
|
236
|
+
if ((await verifyChecksums(files)).some((f) => !f.actual.startsWith('FILE_NOT_FOUND')))
|
|
237
|
+
return true;
|
|
238
|
+
const entries = getConfigEntriesForTool(asset, adapter);
|
|
239
|
+
if ((await verifyConfigEntries(entries, root)).some((f) => f.reason === 'CONFIG_CHECKSUM_MISMATCH'))
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
/** Whether `config` freezes exactly this asset: its org too, so a global asset isn't an org's. */
|
|
245
|
+
function isFrozen(config, asset) {
|
|
246
|
+
return (config?.frozenAssets ?? []).some((entry) => sameIdentity(entry, asset));
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* The two scopes of a move: the project (`-P`, or the marker walk) and the user root. A project
|
|
250
|
+
* root that is the user root leaves no other scope to move to.
|
|
251
|
+
*/
|
|
252
|
+
async function moveScopes(request) {
|
|
253
|
+
const project = await resolveScope({ projectRoot: request.projectRoot });
|
|
254
|
+
if (project.scope === 'user') {
|
|
255
|
+
throw new MoveError(`The project root is the user root (${project.root}), so there is no other scope to move to.`, {
|
|
256
|
+
hint: 'Run atk move from a project, or name one with -P <dir>.',
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
return { project, user: await resolveScope({ user: true }) };
|
|
260
|
+
}
|
|
261
|
+
/** The plan entry an install result is for. */
|
|
262
|
+
function planEntryOf(plan, result) {
|
|
263
|
+
return plan.entries.find(({ asset }) => asset.name === result.name && asset.type === result.type && asset.org === result.org);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Undo a target install whose follow-up failed, as a failed multi-tool install does: for each
|
|
267
|
+
* tool, the assets its pass added leave the target, and the ones it already had in place get their
|
|
268
|
+
* entries from before back. A pass that moved an asset it had in place to another version stays,
|
|
269
|
+
* since that version may need what the pass added. Best-effort.
|
|
270
|
+
*/
|
|
271
|
+
async function rollBackTarget(plan, toolResults, targetBefore, onProgress) {
|
|
272
|
+
const { to } = plan;
|
|
273
|
+
try {
|
|
274
|
+
let lockfile = await readLockfile(to.root);
|
|
275
|
+
const restore = new Map();
|
|
276
|
+
for (let i = toolResults.length - 1; i >= 0; i--) {
|
|
277
|
+
const { adapter, tool } = plan.targetTools[i];
|
|
278
|
+
const placed = toolResults[i].results.flatMap((result) => {
|
|
279
|
+
const entry = planEntryOf(plan.requested, result);
|
|
280
|
+
if (!entry)
|
|
281
|
+
return [];
|
|
282
|
+
const before = findInstalledAsset(targetBefore, entry.asset.name, entry.asset.type, entry.asset.org);
|
|
283
|
+
const inPlace = before && isInstalledForTool(before, adapter, to.root) ? before : undefined;
|
|
284
|
+
return [{ asset: entry.asset, inPlace, result }];
|
|
285
|
+
});
|
|
286
|
+
if (placed.some(({ inPlace, result }) => inPlace && inPlace.version !== result.version)) {
|
|
287
|
+
onProgress?.(`Keeping the install for ${tool}: it moved an installed asset to another version.`);
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
const added = placed.filter(({ inPlace }) => !inPlace);
|
|
291
|
+
if (added.length > 0) {
|
|
292
|
+
lockfile = await rollBackInstalledAssets(added, targetBefore, lockfile, {
|
|
293
|
+
adapter,
|
|
294
|
+
onProgress,
|
|
295
|
+
projectDir: to.root,
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
for (const { inPlace } of placed)
|
|
299
|
+
if (inPlace)
|
|
300
|
+
restore.set(identityKey(inPlace), inPlace);
|
|
301
|
+
}
|
|
302
|
+
for (const before of restore.values())
|
|
303
|
+
lockfile = addAssetToLockfile(lockfile, before);
|
|
304
|
+
await writeLockfile(to.root, lockfile);
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
onProgress?.(`Warning: Failed to roll back ${scopeLabel(to)} — ${errorMessage(error)}`);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/** Run a move planned under both lockfile locks (see {@link executeMove}). */
|
|
311
|
+
async function runMove(plan, force, onProgress) {
|
|
312
|
+
const { asset, from, to } = plan;
|
|
313
|
+
const targetBefore = await readLockfile(to.root);
|
|
314
|
+
const toolResults = await executeInstallPlanForTools(plan.requested, plan.targetTools, {
|
|
315
|
+
force,
|
|
316
|
+
onProgress,
|
|
317
|
+
onTool: (tool) => onProgress?.(`Installing in ${scopeLabel(to)} for ${tool}...`),
|
|
318
|
+
projectDir: to.root,
|
|
319
|
+
scope: to.scope,
|
|
320
|
+
});
|
|
321
|
+
try {
|
|
322
|
+
await carryOver(plan, targetBefore);
|
|
323
|
+
}
|
|
324
|
+
catch (error) {
|
|
325
|
+
await rollBackTarget(plan, toolResults, targetBefore, onProgress);
|
|
326
|
+
throw error;
|
|
327
|
+
}
|
|
328
|
+
let removed;
|
|
329
|
+
try {
|
|
330
|
+
onProgress?.(`Removing from ${scopeLabel(from)}...`);
|
|
331
|
+
const lockfile = await readLockfile(from.root);
|
|
332
|
+
const [first, ...others] = plan.sourceTools;
|
|
333
|
+
removed = await uninstallAsset(asset.name, {
|
|
334
|
+
adapter: first.adapter,
|
|
335
|
+
additionalAdapters: others.map((t) => t.adapter),
|
|
336
|
+
lockfile,
|
|
337
|
+
onProgress,
|
|
338
|
+
org: asset.org,
|
|
339
|
+
plan: planUninstall(lockfile, asset.name, asset.org, asset.type),
|
|
340
|
+
projectDir: from.root,
|
|
341
|
+
scope: from.scope,
|
|
342
|
+
type: asset.type,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
return { error, outcome: 'source-uninstall-failed', toolResults };
|
|
347
|
+
}
|
|
348
|
+
const warnings = [];
|
|
349
|
+
if (plan.frozen) {
|
|
350
|
+
try {
|
|
351
|
+
await thaw(from.root, asset);
|
|
352
|
+
}
|
|
353
|
+
catch (error) {
|
|
354
|
+
warnings.push(`Failed to remove the freeze record from ${scopeLabel(from)}: ${errorMessage(error)}`);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return { outcome: 'moved', removed, toolResults, warnings };
|
|
358
|
+
}
|
|
359
|
+
function sameIdentity(a, b) {
|
|
360
|
+
return a.name === b.name && a.type === b.type && a.org === b.org;
|
|
361
|
+
}
|
|
362
|
+
/** Remove exactly this asset's freeze record from the config of the scope at `root`. */
|
|
363
|
+
async function thaw(root, asset) {
|
|
364
|
+
const config = await loadScopeConfig(root);
|
|
365
|
+
if (!config || !isFrozen(config, asset))
|
|
366
|
+
return;
|
|
367
|
+
const frozenAssets = (config.frozenAssets ?? []).filter((entry) => !sameIdentity(entry, asset));
|
|
368
|
+
await saveScopeConfig(root, { ...config, frozenAssets });
|
|
369
|
+
}
|
|
370
|
+
/** `plan` without the entry of `asset`. */
|
|
371
|
+
function withoutEntry(plan, asset) {
|
|
372
|
+
const entries = plan.entries.filter((entry) => !sameIdentity(entry.asset, asset));
|
|
373
|
+
return { entries, totalCount: entries.length };
|
|
374
|
+
}
|
|
375
|
+
//# sourceMappingURL=mover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mover.js","sourceRoot":"","sources":["../../src/lib/mover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAMnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAsB,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAElB,mBAAmB,EACnB,kBAAkB,EAClB,8BAA8B,EAC9B,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,aAAa,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