@detergent-software/atk 9.4.0-dev.2 → 9.4.0-dev.20
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 +154 -0
- package/README.md +2 -2
- package/build/command-manifest.json +5 -5
- package/build/commands/audit.d.ts.map +1 -1
- package/build/commands/audit.js +7 -4
- package/build/commands/audit.js.map +1 -1
- package/build/commands/diff.d.ts.map +1 -1
- package/build/commands/diff.js +10 -10
- package/build/commands/diff.js.map +1 -1
- package/build/commands/info.d.ts.map +1 -1
- package/build/commands/info.js +17 -14
- package/build/commands/info.js.map +1 -1
- package/build/commands/install.d.ts.map +1 -1
- package/build/commands/install.js +279 -81
- package/build/commands/install.js.map +1 -1
- package/build/commands/move.d.ts.map +1 -1
- package/build/commands/move.js +5 -4
- package/build/commands/move.js.map +1 -1
- package/build/commands/outdated.js +1 -1
- package/build/commands/outdated.js.map +1 -1
- package/build/commands/update.d.ts.map +1 -1
- package/build/commands/update.js +14 -7
- package/build/commands/update.js.map +1 -1
- package/build/commands/why.d.ts.map +1 -1
- package/build/commands/why.js +28 -7
- package/build/commands/why.js.map +1 -1
- package/build/components/AssetDetail.d.ts.map +1 -1
- package/build/components/AssetDetail.js +1 -1
- package/build/components/AssetDetail.js.map +1 -1
- package/build/components/DiffView.d.ts +3 -1
- package/build/components/DiffView.d.ts.map +1 -1
- package/build/components/DiffView.js +2 -2
- package/build/components/DiffView.js.map +1 -1
- package/build/components/InstallSummary.d.ts +7 -2
- package/build/components/InstallSummary.d.ts.map +1 -1
- package/build/components/InstallSummary.js +3 -1
- package/build/components/InstallSummary.js.map +1 -1
- package/build/components/PreferredScopeQuestion.d.ts +16 -0
- package/build/components/PreferredScopeQuestion.d.ts.map +1 -0
- package/build/components/PreferredScopeQuestion.js +20 -0
- package/build/components/PreferredScopeQuestion.js.map +1 -0
- package/build/components/PreferredScopeWarning.d.ts +17 -0
- package/build/components/PreferredScopeWarning.d.ts.map +1 -0
- package/build/components/PreferredScopeWarning.js +13 -0
- package/build/components/PreferredScopeWarning.js.map +1 -0
- package/build/components/index.d.ts +2 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +2 -0
- package/build/components/index.js.map +1 -1
- package/build/hooks/useInitState.d.ts +9 -1
- package/build/hooks/useInitState.d.ts.map +1 -1
- package/build/hooks/useInitState.js +32 -6
- package/build/hooks/useInitState.js.map +1 -1
- package/build/hooks/useListActions.d.ts.map +1 -1
- package/build/hooks/useListActions.js +9 -2
- package/build/hooks/useListActions.js.map +1 -1
- package/build/lib/adapter.d.ts +14 -9
- package/build/lib/adapter.d.ts.map +1 -1
- package/build/lib/adapter.js +46 -8
- package/build/lib/adapter.js.map +1 -1
- package/build/lib/asset-tools.d.ts +10 -0
- package/build/lib/asset-tools.d.ts.map +1 -1
- package/build/lib/asset-tools.js +18 -0
- package/build/lib/asset-tools.js.map +1 -1
- package/build/lib/atk-schemas/index.d.ts +1 -1
- package/build/lib/atk-schemas/index.d.ts.map +1 -1
- package/build/lib/atk-schemas/index.js +1 -1
- package/build/lib/atk-schemas/index.js.map +1 -1
- package/build/lib/atk-schemas/manifest.d.ts +14 -0
- package/build/lib/atk-schemas/manifest.d.ts.map +1 -1
- package/build/lib/atk-schemas/manifest.js +3 -0
- package/build/lib/atk-schemas/manifest.js.map +1 -1
- package/build/lib/atk-schemas/registry.d.ts +16 -0
- package/build/lib/atk-schemas/registry.d.ts.map +1 -1
- package/build/lib/atk-schemas/registry.js +2 -1
- package/build/lib/atk-schemas/registry.js.map +1 -1
- package/build/lib/completion/candidates.d.ts.map +1 -1
- package/build/lib/completion/candidates.js +21 -8
- package/build/lib/completion/candidates.js.map +1 -1
- package/build/lib/config-entries.d.ts +3 -3
- package/build/lib/config-entries.d.ts.map +1 -1
- package/build/lib/config-entries.js +16 -6
- package/build/lib/config-entries.js.map +1 -1
- package/build/lib/config-lock.d.ts +2 -1
- package/build/lib/config-lock.d.ts.map +1 -1
- package/build/lib/config-lock.js +10 -2
- package/build/lib/config-lock.js.map +1 -1
- package/build/lib/cross-scope.d.ts +6 -2
- package/build/lib/cross-scope.d.ts.map +1 -1
- package/build/lib/cross-scope.js +20 -13
- package/build/lib/cross-scope.js.map +1 -1
- package/build/lib/diagnostics.d.ts +3 -2
- package/build/lib/diagnostics.d.ts.map +1 -1
- package/build/lib/diagnostics.js +6 -4
- package/build/lib/diagnostics.js.map +1 -1
- package/build/lib/diff-command.d.ts +7 -2
- package/build/lib/diff-command.d.ts.map +1 -1
- package/build/lib/diff-command.js +14 -10
- package/build/lib/diff-command.js.map +1 -1
- package/build/lib/gitignore.d.ts +8 -0
- package/build/lib/gitignore.d.ts.map +1 -1
- package/build/lib/gitignore.js +51 -6
- package/build/lib/gitignore.js.map +1 -1
- package/build/lib/hook-config.d.ts +60 -5
- package/build/lib/hook-config.d.ts.map +1 -1
- package/build/lib/hook-config.js +97 -5
- package/build/lib/hook-config.js.map +1 -1
- package/build/lib/hook-script.d.ts +10 -0
- package/build/lib/hook-script.d.ts.map +1 -1
- package/build/lib/hook-script.js +31 -1
- package/build/lib/hook-script.js.map +1 -1
- package/build/lib/init.d.ts +6 -2
- package/build/lib/init.d.ts.map +1 -1
- package/build/lib/init.js +66 -8
- package/build/lib/init.js.map +1 -1
- package/build/lib/install-targets.d.ts +35 -8
- package/build/lib/install-targets.d.ts.map +1 -1
- package/build/lib/install-targets.js +87 -14
- package/build/lib/install-targets.js.map +1 -1
- package/build/lib/installer.d.ts +19 -3
- package/build/lib/installer.d.ts.map +1 -1
- package/build/lib/installer.js +112 -32
- package/build/lib/installer.js.map +1 -1
- package/build/lib/mover.d.ts +5 -4
- package/build/lib/mover.d.ts.map +1 -1
- package/build/lib/mover.js +23 -27
- package/build/lib/mover.js.map +1 -1
- package/build/lib/multi-tool-install.d.ts +48 -11
- package/build/lib/multi-tool-install.d.ts.map +1 -1
- package/build/lib/multi-tool-install.js +167 -38
- package/build/lib/multi-tool-install.js.map +1 -1
- package/build/lib/named-entry.d.ts +12 -0
- package/build/lib/named-entry.d.ts.map +1 -1
- package/build/lib/named-entry.js +16 -8
- package/build/lib/named-entry.js.map +1 -1
- package/build/lib/preferred-scope.d.ts +38 -0
- package/build/lib/preferred-scope.d.ts.map +1 -0
- package/build/lib/preferred-scope.js +53 -0
- package/build/lib/preferred-scope.js.map +1 -0
- package/build/lib/schemas/adapter.d.ts +24 -0
- package/build/lib/schemas/adapter.d.ts.map +1 -1
- package/build/lib/schemas/adapter.js +18 -4
- package/build/lib/schemas/adapter.js.map +1 -1
- package/build/lib/sync.d.ts +7 -0
- package/build/lib/sync.d.ts.map +1 -1
- package/build/lib/sync.js +41 -3
- package/build/lib/sync.js.map +1 -1
- package/build/lib/touched-paths.d.ts.map +1 -1
- package/build/lib/touched-paths.js +2 -1
- package/build/lib/touched-paths.js.map +1 -1
- package/build/lib/uninstaller.d.ts.map +1 -1
- package/build/lib/uninstaller.js +11 -3
- package/build/lib/uninstaller.js.map +1 -1
- package/build/lib/updater.d.ts +32 -5
- package/build/lib/updater.d.ts.map +1 -1
- package/build/lib/updater.js +129 -14
- package/build/lib/updater.js.map +1 -1
- package/package.json +3 -3
- package/tool-adapters/codex-cli.json +5 -1
- package/tool-adapters/copilot-cli.json +55 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-targets.js","sourceRoot":"","sources":["../../src/lib/install-targets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"install-targets.js","sourceRoot":"","sources":["../../src/lib/install-targets.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,aAAa,GACd,MAAM,eAAe,CAAC;AACv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are function assertInstalledByAnyTool(plan: InstallPlan, toolResults:
|
|
|
140
140
|
results: InstallResult[];
|
|
141
141
|
tool: string;
|
|
142
142
|
}>, scope?: Scope): void;
|
|
143
|
+
/** Why the adapter's tool can't take a hook's entrypoint, as the end of a sentence. */
|
|
144
|
+
export declare function entrypointMisfit(asset: Pick<RegistryAsset, 'name'>, adapter: Adapter, entrypoint: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* The refusal of a hook whose entrypoint the adapter's tool can't take (see {@link takesEntrypoint}):
|
|
147
|
+
* alone, or when no other tool of the install placed it.
|
|
148
|
+
*/
|
|
149
|
+
export declare function entrypointRefusal(asset: Pick<RegistryAsset, 'name' | 'org'>, adapter: Adapter, entrypoint: string, scope?: Scope): InstallerError;
|
|
143
150
|
/**
|
|
144
151
|
* Execute a full install plan — install all assets in order.
|
|
145
152
|
* On partial failure, deletes the files the failing asset wrote where no file was before placing
|
|
@@ -161,8 +168,10 @@ export declare function executeInstallPlan(plan: InstallPlan, options: InstallOp
|
|
|
161
168
|
*
|
|
162
169
|
* `downloaded` is shared by the passes of a multi-tool update or sync, whose plans differ by tool:
|
|
163
170
|
* an entry it holds is not downloaded again, and the entries this call downloads are added to it.
|
|
171
|
+
* With `installedBefore`, a dependency no tool places because it was uninstalled for each of them
|
|
172
|
+
* is not downloaded (see {@link placeableEntries}).
|
|
164
173
|
*/
|
|
165
|
-
export declare function fetchPlanFiles(plan: InstallPlan, adapters: Adapter[], downloaded?: PlanFiles): Promise<PlanFiles>;
|
|
174
|
+
export declare function fetchPlanFiles(plan: InstallPlan, adapters: Adapter[], downloaded?: PlanFiles, installedBefore?: Lockfile): Promise<PlanFiles>;
|
|
166
175
|
/**
|
|
167
176
|
* The message of an install failure for `asset`, for a caller whose own message already names
|
|
168
177
|
* it: a plan that failed at that asset gives just its cause; one that failed at another asset
|
|
@@ -171,9 +180,16 @@ export declare function fetchPlanFiles(plan: InstallPlan, adapters: Adapter[], d
|
|
|
171
180
|
export declare function installFailureMessage(error: unknown, asset: Pick<RegistryAsset, 'name' | 'org' | 'type'>): string;
|
|
172
181
|
/**
|
|
173
182
|
* The entries of `plan` the adapter's tool takes, in plan order: those it has a placement for,
|
|
174
|
-
* less the hooks whose manifest doesn't declare it (see {@link declarationAllows}).
|
|
183
|
+
* less the hooks whose manifest doesn't declare it (see {@link declarationAllows}). With
|
|
184
|
+
* `installedBefore`, also less the `dependency` entries it records as uninstalled for the tool,
|
|
185
|
+
* which `atk sync` would not place there either; a `direct` entry is placed again. (An update
|
|
186
|
+
* carries the asset's own install reason onto its entry, but skips an asset uninstalled for the
|
|
187
|
+
* tool before it plans.) With the plan's downloaded `files`, also less the hooks whose entrypoint
|
|
188
|
+
* the tool can't take (see {@link takesEntrypoint}).
|
|
175
189
|
*/
|
|
176
|
-
export declare function placeableEntries(plan: InstallPlan, adapter: Adapter): InstallPlanEntry[];
|
|
190
|
+
export declare function placeableEntries(plan: InstallPlan, adapter: Adapter, installedBefore?: Lockfile, files?: PlanFiles): InstallPlanEntry[];
|
|
191
|
+
/** The {@link PlanFiles} key of a plan entry: one asset version. */
|
|
192
|
+
export declare function planEntryKey(entry: InstallPlanEntry): string;
|
|
177
193
|
/**
|
|
178
194
|
* Undo the installs of `installed` for the adapter's tool, in reverse order (best-effort): delete
|
|
179
195
|
* their placed files, revert their config entries (deleting a config file they created once it is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/lib/installer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,OAAO,EAAmB,MAAM,sBAAsB,CAAC;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAiC,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":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QAAQ,CAAC,CAqFnB"}
|
package/build/lib/installer.js
CHANGED
|
@@ -2,16 +2,16 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { mkdir, readFile, unlink } from 'node:fs/promises';
|
|
3
3
|
import { dirname, join } from 'node:path';
|
|
4
4
|
import { adapterAsPlaced, checkRealPaths, configDirMove, configEntryPath, getPlacement, isEntrypoint, recordUserConfigDir, resolveInstalledPaths, } from './adapter.js';
|
|
5
|
-
import { carryExclusions, declarationAllows, declaresTool, isExcludedForTool } from './asset-tools.js';
|
|
5
|
+
import { carryExclusions, declarationAllows, declaresTool, isExcludedForTool, isUninstalledForTool, takesEntrypoint, } from './asset-tools.js';
|
|
6
6
|
import { computeConfigEntryChecksum, computeHookGroupChecksum, CONFIG_CHECKSUM_VERSION, hashBytes, verifyChecksum, } from './checksum.js';
|
|
7
7
|
import { getConfigEntriesForTool, getOtherToolsConfigEntries, mergeConfigEntriesForTool, normalizeConfigPath, staleHookCommandEntries, } from './config-entries.js';
|
|
8
8
|
import { normalizeForFormat, parseConfig, readConfigFile, removeEmptiedConfigFile, resolveConfigFormat, writeConfigFile, } from './config-file.js';
|
|
9
9
|
import { configLockPath, withConfigLock } from './config-lock.js';
|
|
10
10
|
import { addToEnabledList, removeFromEnabledList } from './enabled-list.js';
|
|
11
11
|
import { ApiCodeError, errorGuidance, errorMessage } from './errors.js';
|
|
12
|
-
import { ensureGitignoreEntries } from './gitignore.js';
|
|
13
|
-
import {
|
|
14
|
-
import { hookScriptPath, makeExecutable } from './hook-script.js';
|
|
12
|
+
import { ensureGitignoreEntries, removeRetiredGitignoreEntries } from './gitignore.js';
|
|
13
|
+
import { buildHookEntry, hookCommand, hookEventsFor, hookGroupOwnsCommand, isEmptyHookConfig, isNodeHookEntrypoint, leftOutHookEventReason, placementForAsset, placementForEntrypoint, removeHookGroup, } from './hook-config.js';
|
|
14
|
+
import { hookScriptPath, makeExecutable, misplacedHookCopy } from './hook-script.js';
|
|
15
15
|
import { isInstalledForTool } from './installed-for-tool.js';
|
|
16
16
|
import { addAssetToLockfile, findInstalledAsset, readLockfile, removeAssetFromLockfile, writeLockfile, } from './lockfile.js';
|
|
17
17
|
import { formatOrgName } from './org.js';
|
|
@@ -107,6 +107,22 @@ export function assertInstalledByAnyTool(plan, toolResults, scope = 'project') {
|
|
|
107
107
|
hint: NO_PROJECT_PLACEMENT_HINT,
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
+
/** Why the adapter's tool can't take a hook's entrypoint, as the end of a sentence. */
|
|
111
|
+
export function entrypointMisfit(asset, adapter, entrypoint) {
|
|
112
|
+
const path = placementForEntrypoint(adapter.placements.hook, entrypoint).path.replace(/\{name\}/g, asset.name);
|
|
113
|
+
return `${adapter.displayName} reads ${path} as hook config, and the hook's entrypoint ${entrypoint} is not JSON`;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The refusal of a hook whose entrypoint the adapter's tool can't take (see {@link takesEntrypoint}):
|
|
117
|
+
* alone, or when no other tool of the install placed it.
|
|
118
|
+
*/
|
|
119
|
+
export function entrypointRefusal(asset, adapter, entrypoint, scope) {
|
|
120
|
+
const setup = scopedCommand('atk setup', scope);
|
|
121
|
+
return new InstallerError(`Hook "${formatOrgName(asset.org, asset.name)}" is not installed for ${adapter.tool}: ${entrypointMisfit(asset, adapter, entrypoint)}.`, {
|
|
122
|
+
command: setup,
|
|
123
|
+
hint: `Add a tool that runs hook scripts, such as Claude Code, with \`${setup}\`, or install it in a project set up for one.`,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
110
126
|
/**
|
|
111
127
|
* Execute a full install plan — install all assets in order.
|
|
112
128
|
* On partial failure, deletes the files the failing asset wrote where no file was before placing
|
|
@@ -142,9 +158,14 @@ export async function executeInstallPlan(plan, options) {
|
|
|
142
158
|
// placement for an asset type (e.g. Codex CLI has no `rule` placement) skips
|
|
143
159
|
// those entries instead of aborting the whole run for that tool. When the tool
|
|
144
160
|
// supports nothing in the plan, fail loudly so a single-tool install isn't a
|
|
145
|
-
// silent no-op. A hook whose manifest doesn't declare this tool is skipped the same way
|
|
146
|
-
|
|
161
|
+
// silent no-op. A hook whose manifest doesn't declare this tool is skipped the same way, and so
|
|
162
|
+
// is a dependency that was uninstalled for this tool, and, in a multi-tool install, a hook whose
|
|
163
|
+
// entrypoint this tool can't take (alone, the tool refuses it: see installAsset).
|
|
164
|
+
const installedBefore = options.installedBefore ?? options.managedFrom ?? lockfile;
|
|
165
|
+
const skipFiles = options.skipUnsupported ? options.files : undefined;
|
|
166
|
+
const supportedEntries = placeableEntries(plan, options.adapter, installedBefore, skipFiles);
|
|
147
167
|
for (const entry of plan.entries) {
|
|
168
|
+
const entrypoint = skipFiles?.get(planEntryKey(entry))?.entrypoint;
|
|
148
169
|
if (!getPlacement(options.adapter, entry.asset.type)) {
|
|
149
170
|
options.onProgress?.(options.scope === 'user'
|
|
150
171
|
? `Skipping ${entry.asset.name}: ${options.adapter.displayName} has no user-level ${entry.asset.type}`
|
|
@@ -154,8 +175,14 @@ export async function executeInstallPlan(plan, options) {
|
|
|
154
175
|
const tools = entry.versionData.tools.join(', ');
|
|
155
176
|
options.onProgress?.(`Skipping ${entry.asset.name}: the hook is for ${tools} only, not ${options.adapter.tool}`);
|
|
156
177
|
}
|
|
178
|
+
else if (!takesEntrypoint(options.adapter, entry.asset.type, entrypoint)) {
|
|
179
|
+
options.onProgress?.(`Skipping ${entry.asset.name}: ${entrypointMisfit(entry.asset, options.adapter, entrypoint)}`);
|
|
180
|
+
}
|
|
181
|
+
else if (!supportedEntries.includes(entry)) {
|
|
182
|
+
options.onProgress?.(`Skipping ${entry.asset.name}: it was uninstalled for ${options.adapter.tool}`);
|
|
183
|
+
}
|
|
157
184
|
}
|
|
158
|
-
if (
|
|
185
|
+
if (placeableEntries(plan, options.adapter).length === 0 && plan.entries.length > 0 && !options.skipUnsupported) {
|
|
159
186
|
const undeclared = undeclaredHookError(plan, [options.adapter.tool], options.scope);
|
|
160
187
|
if (undeclared)
|
|
161
188
|
throw undeclared;
|
|
@@ -165,7 +192,6 @@ export async function executeInstallPlan(plan, options) {
|
|
|
165
192
|
throw new InstallerError(`Tool "${options.adapter.tool}" does not support asset type "${plan.entries[0].asset.type}"`, { command: 'atk setup', hint: NO_PROJECT_PLACEMENT_HINT });
|
|
166
193
|
}
|
|
167
194
|
// The assets this tool had in place before the plan, by plan entry, which a failure keeps.
|
|
168
|
-
const installedBefore = options.installedBefore ?? options.managedFrom ?? lockfile;
|
|
169
195
|
const inPlace = new Map();
|
|
170
196
|
for (const entry of supportedEntries) {
|
|
171
197
|
const installed = findInstalledAsset(installedBefore, entry.asset.name, entry.asset.type, entry.asset.org);
|
|
@@ -274,6 +300,16 @@ export async function executeInstallPlan(plan, options) {
|
|
|
274
300
|
`placed that this install replaced — ${errorMessage(error)}`);
|
|
275
301
|
}
|
|
276
302
|
}
|
|
303
|
+
// A config file the adapter no longer uses stops being ignored once this plan has moved ATK's
|
|
304
|
+
// entries out of it, and not before.
|
|
305
|
+
if (options.scope !== 'user') {
|
|
306
|
+
try {
|
|
307
|
+
await removeRetiredGitignoreEntries(options.projectDir, options.adapter, lockfile);
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
options.onProgress?.('Warning: Failed to update .gitignore — continuing with install');
|
|
311
|
+
}
|
|
312
|
+
}
|
|
277
313
|
return results;
|
|
278
314
|
}
|
|
279
315
|
/**
|
|
@@ -286,9 +322,11 @@ export async function executeInstallPlan(plan, options) {
|
|
|
286
322
|
*
|
|
287
323
|
* `downloaded` is shared by the passes of a multi-tool update or sync, whose plans differ by tool:
|
|
288
324
|
* an entry it holds is not downloaded again, and the entries this call downloads are added to it.
|
|
325
|
+
* With `installedBefore`, a dependency no tool places because it was uninstalled for each of them
|
|
326
|
+
* is not downloaded (see {@link placeableEntries}).
|
|
289
327
|
*/
|
|
290
|
-
export async function fetchPlanFiles(plan, adapters, downloaded) {
|
|
291
|
-
const placeable = new Set(adapters.flatMap((adapter) => placeableEntries(plan, adapter)));
|
|
328
|
+
export async function fetchPlanFiles(plan, adapters, downloaded, installedBefore) {
|
|
329
|
+
const placeable = new Set(adapters.flatMap((adapter) => placeableEntries(plan, adapter, installedBefore)));
|
|
292
330
|
const ordered = plan.entries.filter((entry) => placeable.has(entry));
|
|
293
331
|
const missing = ordered.filter((entry) => !downloaded?.has(planEntryKey(entry)));
|
|
294
332
|
const limit = createLimiter(FILE_DOWNLOAD_CONCURRENCY);
|
|
@@ -331,10 +369,30 @@ export function installFailureMessage(error, asset) {
|
|
|
331
369
|
}
|
|
332
370
|
/**
|
|
333
371
|
* The entries of `plan` the adapter's tool takes, in plan order: those it has a placement for,
|
|
334
|
-
* less the hooks whose manifest doesn't declare it (see {@link declarationAllows}).
|
|
372
|
+
* less the hooks whose manifest doesn't declare it (see {@link declarationAllows}). With
|
|
373
|
+
* `installedBefore`, also less the `dependency` entries it records as uninstalled for the tool,
|
|
374
|
+
* which `atk sync` would not place there either; a `direct` entry is placed again. (An update
|
|
375
|
+
* carries the asset's own install reason onto its entry, but skips an asset uninstalled for the
|
|
376
|
+
* tool before it plans.) With the plan's downloaded `files`, also less the hooks whose entrypoint
|
|
377
|
+
* the tool can't take (see {@link takesEntrypoint}).
|
|
335
378
|
*/
|
|
336
|
-
export function placeableEntries(plan, adapter) {
|
|
337
|
-
return plan.entries.filter((
|
|
379
|
+
export function placeableEntries(plan, adapter, installedBefore, files) {
|
|
380
|
+
return plan.entries.filter((entry) => {
|
|
381
|
+
const { asset, reason, versionData } = entry;
|
|
382
|
+
if (!getPlacement(adapter, asset.type) || !declarationAllows(asset.type, versionData.tools, adapter.tool)) {
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
if (files && !takesEntrypoint(adapter, asset.type, files.get(planEntryKey(entry))?.entrypoint))
|
|
386
|
+
return false;
|
|
387
|
+
if (reason !== 'dependency' || !installedBefore)
|
|
388
|
+
return true;
|
|
389
|
+
const installed = findInstalledAsset(installedBefore, asset.name, asset.type, asset.org);
|
|
390
|
+
return !installed || !isUninstalledForTool(installed, adapter.tool);
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
/** The {@link PlanFiles} key of a plan entry: one asset version. */
|
|
394
|
+
export function planEntryKey(entry) {
|
|
395
|
+
return `${entry.asset.type}:${entry.asset.org ?? ''}:${entry.asset.name}@${entry.version}`;
|
|
338
396
|
}
|
|
339
397
|
/**
|
|
340
398
|
* Undo the installs of `installed` for the adapter's tool, in reverse order (best-effort): delete
|
|
@@ -735,9 +793,16 @@ async function installAsset(entry, options, managedPaths, managedEntries, owners
|
|
|
735
793
|
assetFiles.some((f) => isNodeHookEntrypoint(f.relativePath))) {
|
|
736
794
|
throw new InstallerError(`Couldn't read the manifest of "${asset.name}"@${entry.version}, which says how the hook runs, so it wasn't installed.`, { hint: 'Run the command again. If it keeps failing, check the asset in the registry.' });
|
|
737
795
|
}
|
|
738
|
-
const placement =
|
|
796
|
+
const placement = placementForAsset(typePlacement, declaredEntrypoint, asset.name);
|
|
739
797
|
// Find the entrypoint file
|
|
740
798
|
const entrypointFile = assetFiles.find((f) => isEntrypoint(f.relativePath, asset.type, declaredEntrypoint));
|
|
799
|
+
// A multi-tool install skips such a hook for the tool (see placeableEntries); any other path
|
|
800
|
+
// stops here, before a script is written under the name of the tool's hook config. Without the
|
|
801
|
+
// manifest, the file the filename fallback takes for the entrypoint decides.
|
|
802
|
+
const placedEntrypoint = declaredEntrypoint ?? entrypointFile?.relativePath;
|
|
803
|
+
if (!takesEntrypoint(adapter, asset.type, placedEntrypoint)) {
|
|
804
|
+
throw entrypointRefusal(asset, adapter, placedEntrypoint, options.scope);
|
|
805
|
+
}
|
|
741
806
|
// Determine merge content for configMerge mode (a keyed merge; a hook merge doesn't use it)
|
|
742
807
|
let mergeContent;
|
|
743
808
|
if (placement.configMerge && !placement.configHookMerge && entrypointFile) {
|
|
@@ -776,9 +841,17 @@ async function installAsset(entry, options, managedPaths, managedEntries, owners
|
|
|
776
841
|
: []),
|
|
777
842
|
...staleConfigEntries(previousEntry, declaredEntrypoint, adapter, placement).map((stale) => configEntryPath(stale, previousEntry, adapter, projectDir)),
|
|
778
843
|
], asset.name, adapter, projectDir);
|
|
844
|
+
// A CLI before ATK-204 wrote a Copilot hook's script under the name of its hook config. That copy
|
|
845
|
+
// is the file this hook's own config is written to now, so it goes once every check has passed;
|
|
846
|
+
// anything else there is left for the check below to refuse. Another tool's pass of this run may
|
|
847
|
+
// have recorded the new version already, so the entry from before the run counts too.
|
|
848
|
+
const before = options.installedBefore ?? options.managedFrom;
|
|
849
|
+
const misplacedCopy = placement.configHookMerge
|
|
850
|
+
? await misplacedHookCopy(typePlacement, asset.name, [previousEntry, before && findInstalledAsset(before, asset.name, asset.type, entry.asset.org)], basePath)
|
|
851
|
+
: undefined;
|
|
779
852
|
// A config file the merge below couldn't read fails the install before any file is placed, so a
|
|
780
853
|
// reinstall's files keep the content its previous entries run.
|
|
781
|
-
if (placement.configFile && placement.configKey && !placement.fileless) {
|
|
854
|
+
if (placement.configFile && placement.configKey && !placement.fileless && !misplacedCopy) {
|
|
782
855
|
await checkConfigReadable(fromRoot(basePath, placement.configFile), configFormat, placement.configHookMerge ? 'the hook' : `"${asset.name}"`);
|
|
783
856
|
}
|
|
784
857
|
// Branch on placement type
|
|
@@ -903,7 +976,13 @@ async function installAsset(entry, options, managedPaths, managedEntries, owners
|
|
|
903
976
|
// config file as valid event arrays (e.g. settings.json hooks.Stop[]), with the
|
|
904
977
|
// command derived from the installed script path.
|
|
905
978
|
const { configFile, configKey } = placement;
|
|
906
|
-
|
|
979
|
+
if (misplacedCopy)
|
|
980
|
+
await unlink(misplacedCopy);
|
|
981
|
+
const { events, leftOut } = hookEventsFor(placement, entry.versionData.hookConfig);
|
|
982
|
+
for (const left of leftOut) {
|
|
983
|
+
onProgress?.(`Warning: ${asset.name}'s ${left.event} hook is not registered for ${adapter.tool}: ${leftOutHookEventReason(left, adapter.displayName)}`);
|
|
984
|
+
}
|
|
985
|
+
const hookEntries = await withConfigLock(lockFile, () => mergeHookConfig(fromRoot(basePath, configFile), configKey, configFormat, placement, events, hookCommand(placement, asset.name), projectDir, onProgress, writeOptions));
|
|
907
986
|
configEntries.push(...hookEntries);
|
|
908
987
|
}
|
|
909
988
|
else if (placement.configFile && placement.configKey) {
|
|
@@ -1112,16 +1191,17 @@ async function mergeFragmentConfig(configFilePath, configKey, format, projectDir
|
|
|
1112
1191
|
* Merge a hook asset's event bindings into a tool config file (e.g. .claude/settings.json).
|
|
1113
1192
|
*
|
|
1114
1193
|
* Claude Code stores hooks as `hooks.<Event>: [ { matcher?, hooks: [{ type:'command', command }] } ]`,
|
|
1115
|
-
* an ARRAY shared by every hook bound to that event. For each
|
|
1116
|
-
*
|
|
1117
|
-
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1194
|
+
* an ARRAY shared by every hook bound to that event. For each of `events` (the `hookConfig` events
|
|
1195
|
+
* the placement registers, by the tool's names: {@link hookEventsFor}), this appends one entry in
|
|
1196
|
+
* the placement's format ({@link buildHookEntry}) whose command runs the installed script. ATK's
|
|
1197
|
+
* entry is identified by that command (no marker is written — the tool validates group shape).
|
|
1198
|
+
* Idempotent: an existing entry owned by this command is dropped before appending, so repeated
|
|
1199
|
+
* install/sync doesn't duplicate. A Copilot CLI hook file gets its `"version": 1` too. Returns one
|
|
1200
|
+
* lockfile config entry per event, checksummed over the ATK-owned entry only.
|
|
1120
1201
|
*/
|
|
1121
|
-
async function mergeHookConfig(configFilePath, configKey, format,
|
|
1122
|
-
const events = hookConfig ? Object.keys(hookConfig) : [];
|
|
1202
|
+
async function mergeHookConfig(configFilePath, configKey, format, placement, events, command, projectDir, onProgress, writeOptions = {}) {
|
|
1123
1203
|
if (events.length === 0) {
|
|
1124
|
-
// No hookConfig (e.g. legacy asset or un-rebuilt registry index) — write nothing.
|
|
1204
|
+
// No hookConfig (e.g. legacy asset or un-rebuilt registry index), or none the tool has — write nothing.
|
|
1125
1205
|
return [];
|
|
1126
1206
|
}
|
|
1127
1207
|
try {
|
|
@@ -1135,13 +1215,16 @@ async function mergeHookConfig(configFilePath, configKey, format, hookConfig, co
|
|
|
1135
1215
|
await mkdir(dir, { recursive: true });
|
|
1136
1216
|
}
|
|
1137
1217
|
}
|
|
1218
|
+
if (placement.configHookFormat === 'copilot' && config['version'] === undefined) {
|
|
1219
|
+
config = { version: 1, ...config };
|
|
1220
|
+
}
|
|
1138
1221
|
if (!config[configKey] || typeof config[configKey] !== 'object' || Array.isArray(config[configKey])) {
|
|
1139
1222
|
config[configKey] = {};
|
|
1140
1223
|
}
|
|
1141
1224
|
const section = config[configKey];
|
|
1142
1225
|
const entries = [];
|
|
1143
|
-
for (const event of events) {
|
|
1144
|
-
const group =
|
|
1226
|
+
for (const { binding, event } of events) {
|
|
1227
|
+
const group = buildHookEntry(placement, command, binding);
|
|
1145
1228
|
const existing = Array.isArray(section[event]) ? section[event] : [];
|
|
1146
1229
|
// Idempotency: remove any prior group this asset owns before re-appending.
|
|
1147
1230
|
const next = existing.filter((g) => !hookGroupOwnsCommand(g, command));
|
|
@@ -1164,10 +1247,6 @@ async function mergeHookConfig(configFilePath, configKey, format, hookConfig, co
|
|
|
1164
1247
|
});
|
|
1165
1248
|
}
|
|
1166
1249
|
}
|
|
1167
|
-
/** The {@link PlanFiles} key of a plan entry: one asset version. */
|
|
1168
|
-
function planEntryKey(entry) {
|
|
1169
|
-
return `${entry.asset.type}:${entry.asset.org ?? ''}:${entry.asset.name}@${entry.version}`;
|
|
1170
|
-
}
|
|
1171
1250
|
/**
|
|
1172
1251
|
* The memory-template block or keyed config entries an asset of `name` and `type` will write: the
|
|
1173
1252
|
* fragment's own entry names for a fragment merge, the asset name for any other keyed merge. A
|
|
@@ -1199,7 +1278,7 @@ function plannedSharedEntries(name, type, placement, basePath, mergeContent) {
|
|
|
1199
1278
|
* replaced: those in a file other than the placement's `configFile`, and a hook's groups that run
|
|
1200
1279
|
* another command than the one just registered ({@link staleHookCommandEntries}). An adapter that
|
|
1201
1280
|
* moved its config file (copilot-cli's mcp-config, from `copilot/mcp-config.json` to
|
|
1202
|
-
* `.vscode/mcp.json`) left them where the tool doesn't read them; a hook placed with project-scope
|
|
1281
|
+
* `.vscode/mcp.json`, then to `.github/mcp.json`) left them where the tool doesn't read them; a hook placed with project-scope
|
|
1203
1282
|
* rules at the user root left a group the tool would run beside the new one. As with an uninstall,
|
|
1204
1283
|
* an entry holding the value of another asset that owns it stays, for that asset's own sync to
|
|
1205
1284
|
* move. A file left empty is deleted. (`atk sync` removes the asset before reinstalling it, so
|
|
@@ -1289,7 +1368,8 @@ async function revertConfigEntry(configFilePath, keyPath, command, format, delet
|
|
|
1289
1368
|
delete config[sectionKey];
|
|
1290
1369
|
}
|
|
1291
1370
|
}
|
|
1292
|
-
|
|
1371
|
+
const empty = command !== undefined ? isEmptyHookConfig(config) : Object.keys(config).length === 0;
|
|
1372
|
+
if (deleteWhenEmpty && empty) {
|
|
1293
1373
|
await removeEmptiedConfigFile(configFilePath, format, writeOptions);
|
|
1294
1374
|
return;
|
|
1295
1375
|
}
|