@detergent-software/atk 9.4.0-dev.2 → 9.4.0-dev.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +165 -0
  2. package/README.md +2 -2
  3. package/build/command-manifest.json +5 -5
  4. package/build/commands/audit.d.ts.map +1 -1
  5. package/build/commands/audit.js +7 -4
  6. package/build/commands/audit.js.map +1 -1
  7. package/build/commands/diff.d.ts.map +1 -1
  8. package/build/commands/diff.js +10 -10
  9. package/build/commands/diff.js.map +1 -1
  10. package/build/commands/info.d.ts.map +1 -1
  11. package/build/commands/info.js +17 -14
  12. package/build/commands/info.js.map +1 -1
  13. package/build/commands/install.d.ts.map +1 -1
  14. package/build/commands/install.js +279 -81
  15. package/build/commands/install.js.map +1 -1
  16. package/build/commands/move.d.ts.map +1 -1
  17. package/build/commands/move.js +5 -4
  18. package/build/commands/move.js.map +1 -1
  19. package/build/commands/outdated.js +1 -1
  20. package/build/commands/outdated.js.map +1 -1
  21. package/build/commands/update.d.ts.map +1 -1
  22. package/build/commands/update.js +14 -7
  23. package/build/commands/update.js.map +1 -1
  24. package/build/commands/why.d.ts.map +1 -1
  25. package/build/commands/why.js +28 -7
  26. package/build/commands/why.js.map +1 -1
  27. package/build/components/AssetDetail.d.ts.map +1 -1
  28. package/build/components/AssetDetail.js +1 -1
  29. package/build/components/AssetDetail.js.map +1 -1
  30. package/build/components/DiffView.d.ts +3 -1
  31. package/build/components/DiffView.d.ts.map +1 -1
  32. package/build/components/DiffView.js +2 -2
  33. package/build/components/DiffView.js.map +1 -1
  34. package/build/components/InitSuccess.d.ts.map +1 -1
  35. package/build/components/InitSuccess.js +4 -1
  36. package/build/components/InitSuccess.js.map +1 -1
  37. package/build/components/InstallSummary.d.ts +7 -2
  38. package/build/components/InstallSummary.d.ts.map +1 -1
  39. package/build/components/InstallSummary.js +3 -1
  40. package/build/components/InstallSummary.js.map +1 -1
  41. package/build/components/PreferredScopeQuestion.d.ts +16 -0
  42. package/build/components/PreferredScopeQuestion.d.ts.map +1 -0
  43. package/build/components/PreferredScopeQuestion.js +20 -0
  44. package/build/components/PreferredScopeQuestion.js.map +1 -0
  45. package/build/components/PreferredScopeWarning.d.ts +17 -0
  46. package/build/components/PreferredScopeWarning.d.ts.map +1 -0
  47. package/build/components/PreferredScopeWarning.js +13 -0
  48. package/build/components/PreferredScopeWarning.js.map +1 -0
  49. package/build/components/index.d.ts +2 -0
  50. package/build/components/index.d.ts.map +1 -1
  51. package/build/components/index.js +2 -0
  52. package/build/components/index.js.map +1 -1
  53. package/build/hooks/useInitState.d.ts +9 -1
  54. package/build/hooks/useInitState.d.ts.map +1 -1
  55. package/build/hooks/useInitState.js +43 -6
  56. package/build/hooks/useInitState.js.map +1 -1
  57. package/build/hooks/useListActions.d.ts.map +1 -1
  58. package/build/hooks/useListActions.js +9 -2
  59. package/build/hooks/useListActions.js.map +1 -1
  60. package/build/lib/adapter.d.ts +14 -9
  61. package/build/lib/adapter.d.ts.map +1 -1
  62. package/build/lib/adapter.js +46 -8
  63. package/build/lib/adapter.js.map +1 -1
  64. package/build/lib/asset-tools.d.ts +10 -0
  65. package/build/lib/asset-tools.d.ts.map +1 -1
  66. package/build/lib/asset-tools.js +18 -0
  67. package/build/lib/asset-tools.js.map +1 -1
  68. package/build/lib/atk-schemas/index.d.ts +1 -1
  69. package/build/lib/atk-schemas/index.d.ts.map +1 -1
  70. package/build/lib/atk-schemas/index.js +1 -1
  71. package/build/lib/atk-schemas/index.js.map +1 -1
  72. package/build/lib/atk-schemas/manifest.d.ts +14 -0
  73. package/build/lib/atk-schemas/manifest.d.ts.map +1 -1
  74. package/build/lib/atk-schemas/manifest.js +3 -0
  75. package/build/lib/atk-schemas/manifest.js.map +1 -1
  76. package/build/lib/atk-schemas/registry.d.ts +16 -0
  77. package/build/lib/atk-schemas/registry.d.ts.map +1 -1
  78. package/build/lib/atk-schemas/registry.js +2 -1
  79. package/build/lib/atk-schemas/registry.js.map +1 -1
  80. package/build/lib/completion/candidates.d.ts.map +1 -1
  81. package/build/lib/completion/candidates.js +21 -8
  82. package/build/lib/completion/candidates.js.map +1 -1
  83. package/build/lib/config-entries.d.ts +3 -3
  84. package/build/lib/config-entries.d.ts.map +1 -1
  85. package/build/lib/config-entries.js +16 -6
  86. package/build/lib/config-entries.js.map +1 -1
  87. package/build/lib/config-lock.d.ts +2 -1
  88. package/build/lib/config-lock.d.ts.map +1 -1
  89. package/build/lib/config-lock.js +10 -2
  90. package/build/lib/config-lock.js.map +1 -1
  91. package/build/lib/cross-scope.d.ts +6 -2
  92. package/build/lib/cross-scope.d.ts.map +1 -1
  93. package/build/lib/cross-scope.js +20 -13
  94. package/build/lib/cross-scope.js.map +1 -1
  95. package/build/lib/diagnostics.d.ts +3 -2
  96. package/build/lib/diagnostics.d.ts.map +1 -1
  97. package/build/lib/diagnostics.js +6 -4
  98. package/build/lib/diagnostics.js.map +1 -1
  99. package/build/lib/diff-command.d.ts +7 -2
  100. package/build/lib/diff-command.d.ts.map +1 -1
  101. package/build/lib/diff-command.js +14 -10
  102. package/build/lib/diff-command.js.map +1 -1
  103. package/build/lib/gitignore.d.ts +8 -0
  104. package/build/lib/gitignore.d.ts.map +1 -1
  105. package/build/lib/gitignore.js +51 -6
  106. package/build/lib/gitignore.js.map +1 -1
  107. package/build/lib/hook-config.d.ts +60 -5
  108. package/build/lib/hook-config.d.ts.map +1 -1
  109. package/build/lib/hook-config.js +97 -5
  110. package/build/lib/hook-config.js.map +1 -1
  111. package/build/lib/hook-script.d.ts +10 -0
  112. package/build/lib/hook-script.d.ts.map +1 -1
  113. package/build/lib/hook-script.js +31 -1
  114. package/build/lib/hook-script.js.map +1 -1
  115. package/build/lib/init.d.ts +12 -4
  116. package/build/lib/init.d.ts.map +1 -1
  117. package/build/lib/init.js +78 -16
  118. package/build/lib/init.js.map +1 -1
  119. package/build/lib/install-targets.d.ts +35 -8
  120. package/build/lib/install-targets.d.ts.map +1 -1
  121. package/build/lib/install-targets.js +87 -14
  122. package/build/lib/install-targets.js.map +1 -1
  123. package/build/lib/installer.d.ts +19 -3
  124. package/build/lib/installer.d.ts.map +1 -1
  125. package/build/lib/installer.js +112 -32
  126. package/build/lib/installer.js.map +1 -1
  127. package/build/lib/mover.d.ts +5 -4
  128. package/build/lib/mover.d.ts.map +1 -1
  129. package/build/lib/mover.js +23 -27
  130. package/build/lib/mover.js.map +1 -1
  131. package/build/lib/multi-tool-install.d.ts +48 -11
  132. package/build/lib/multi-tool-install.d.ts.map +1 -1
  133. package/build/lib/multi-tool-install.js +167 -38
  134. package/build/lib/multi-tool-install.js.map +1 -1
  135. package/build/lib/named-entry.d.ts +12 -0
  136. package/build/lib/named-entry.d.ts.map +1 -1
  137. package/build/lib/named-entry.js +16 -8
  138. package/build/lib/named-entry.js.map +1 -1
  139. package/build/lib/preferred-scope.d.ts +38 -0
  140. package/build/lib/preferred-scope.d.ts.map +1 -0
  141. package/build/lib/preferred-scope.js +53 -0
  142. package/build/lib/preferred-scope.js.map +1 -0
  143. package/build/lib/schemas/adapter.d.ts +24 -0
  144. package/build/lib/schemas/adapter.d.ts.map +1 -1
  145. package/build/lib/schemas/adapter.js +18 -4
  146. package/build/lib/schemas/adapter.js.map +1 -1
  147. package/build/lib/sync.d.ts +7 -0
  148. package/build/lib/sync.d.ts.map +1 -1
  149. package/build/lib/sync.js +41 -3
  150. package/build/lib/sync.js.map +1 -1
  151. package/build/lib/touched-paths.d.ts.map +1 -1
  152. package/build/lib/touched-paths.js +2 -1
  153. package/build/lib/touched-paths.js.map +1 -1
  154. package/build/lib/uninstaller.d.ts.map +1 -1
  155. package/build/lib/uninstaller.js +11 -3
  156. package/build/lib/uninstaller.js.map +1 -1
  157. package/build/lib/updater.d.ts +32 -5
  158. package/build/lib/updater.d.ts.map +1 -1
  159. package/build/lib/updater.js +129 -14
  160. package/build/lib/updater.js.map +1 -1
  161. package/package.json +1 -1
  162. package/tool-adapters/codex-cli.json +5 -1
  163. package/tool-adapters/copilot-cli.json +55 -9
@@ -1,9 +1,18 @@
1
- import { placesAsset } from './asset-tools.js';
1
+ import { placesAsset, takesEntrypoint } from './asset-tools.js';
2
2
  import { isInstalledForTool } from './installed-for-tool.js';
3
- import { findInstalledAsset, identityKey, readLockfile, upgradeToDirectInstall, writeLockfile } from './lockfile.js';
3
+ import { findInstalledAsset, identityKey, pinAssetVersion, readLockfile, upgradeToDirectInstall, writeLockfile, } from './lockfile.js';
4
4
  import { executeInstallPlanForTools } from './multi-tool-install.js';
5
5
  import { findAsset, findBundleMember, isLatestAlias } from './registry.js';
6
6
  import { resolveTargetsInstallPlan } from './resolver.js';
7
+ /**
8
+ * What `--pin` does with a bundle in place: `pinned` when it pins any of its members, else
9
+ * `already-pinned`; none when no member is in place.
10
+ */
11
+ export function bundleInPlacePin(installed) {
12
+ if (installed.length === 0)
13
+ return undefined;
14
+ return installed.some((member) => inPlacePin(member) === 'pinned') ? 'pinned' : 'already-pinned';
15
+ }
7
16
  /**
8
17
  * The members of the bundle that one of `tools` places, as the registry has them. A member none of
9
18
  * them places is left out, since this run can't adopt it, and so is a ref the registry can't find,
@@ -18,17 +27,27 @@ export function bundleMembers(registry, bundle, tools) {
18
27
  return [{ name, ...(org ? { org } : {}), type }];
19
28
  });
20
29
  }
30
+ /** What `--pin` does with an asset in place: pin it at its version, unless it is pinned there already. */
31
+ export function inPlacePin(installed) {
32
+ return installed.pinnedVersion === installed.version ? 'already-pinned' : 'pinned';
33
+ }
21
34
  /**
22
35
  * Install what {@link planTargetsInstall} planned: one install across tools when the plan has
23
- * entries, with its rollback, then the upgrades to direct. They come after the install, so a failed
24
- * one leaves even the install reasons as they were.
36
+ * entries, with its rollback, then the upgrades to direct and the pins, in one write. They come
37
+ * after the install, so a failed one leaves even the install reasons and pins as they were.
25
38
  */
26
- export async function installPlannedTargets({ plan, upgrades }, tools, options) {
39
+ export async function installPlannedTargets({ pins, plan, upgrades }, tools, options) {
27
40
  const toolResults = plan.entries.length > 0 ? await executeInstallPlanForTools(plan, tools, options) : [];
28
- if (upgrades.length > 0) {
41
+ if (upgrades.length > 0 || pins.length > 0) {
29
42
  let lockfile = await readLockfile(options.projectDir);
30
43
  for (const { name, org, type } of upgrades)
31
44
  lockfile = upgradeToDirectInstall(lockfile, name, type, org);
45
+ // At the version the lockfile has now: the install may have moved a pinned name as another's dependency.
46
+ for (const { name, org, type } of pins) {
47
+ const current = findInstalledAsset(lockfile, name, type, org);
48
+ if (current)
49
+ lockfile = pinAssetVersion(lockfile, name, current.version, type, org);
50
+ }
32
51
  await writeLockfile(options.projectDir, lockfile);
33
52
  }
34
53
  return toolResults;
@@ -55,22 +74,55 @@ export function isBundleInPlace(registry, bundle, lockfile, { members, projectDi
55
74
  if (requiredBundleVersion && !isFromBundleVersion(installed, bundle, requiredBundleVersion)) {
56
75
  return false;
57
76
  }
77
+ // Nor does one that can't take its entrypoint (a hook script where it reads hook config).
78
+ if (!takesEntrypoint(toolAdapter, installed.type, installed.entrypoint))
79
+ return true;
58
80
  return isInstalledForTool(installed, toolAdapter, projectDir);
59
81
  }));
60
82
  }
83
+ /** The bundle's members the lockfile has, in the bundle's order. */
84
+ export function membersInPlace(lockfile, members) {
85
+ return members.flatMap((member) => {
86
+ const installed = findInstalledAsset(lockfile, member.name, member.type, member.org);
87
+ return installed ? [installed] : [];
88
+ });
89
+ }
90
+ /**
91
+ * Pin a bundle's members in place at their versions, as a fresh install with `--pin` pins them. A
92
+ * member installed only as a dependency is made direct first, since only a direct install takes a pin.
93
+ */
94
+ export function pinMembersInPlace(lockfile, installed) {
95
+ let updated = lockfile;
96
+ for (const member of installed) {
97
+ if (inPlacePin(member) === 'already-pinned')
98
+ continue;
99
+ const { name, org, type, version } = member;
100
+ if ((member.installReason ?? 'direct') === 'dependency')
101
+ updated = upgradeToDirectInstall(updated, name, type, org);
102
+ updated = pinAssetVersion(updated, name, version, type, org);
103
+ }
104
+ return updated;
105
+ }
61
106
  /**
62
107
  * The targets resolved together (shared dependencies once, one version per asset) into one plan,
63
108
  * as `atk install a b my-bundle` and `atk browse`'s marked rows install them. A target every
64
109
  * targeted tool already has in place is left out of the plan, as it is for one name: an asset (at
65
110
  * the requested version, when one is), or a bundle checked whole. An asset in place only as a
66
- * dependency comes back in `upgrades`. Bundle members get the bundle's origin unless they are
67
- * named themselves ({@link resolveTargetsInstallPlan}).
111
+ * dependency comes back in `upgrades`, and with `pin`, one in place not pinned at its version in
112
+ * `pins`, as do the members of a bundle in place. Bundle members get the bundle's origin unless
113
+ * they are named themselves ({@link resolveTargetsInstallPlan}).
68
114
  */
69
- export function planTargetsInstall(registry, targets, lockfile, tools, { force, projectDir }) {
115
+ export function planTargetsInstall(registry, targets, lockfile, tools, { force, pin = false, projectDir }) {
70
116
  const inPlace = [];
71
117
  const bundlesInPlace = [];
118
+ const pins = [];
72
119
  const upgrades = [];
73
120
  const toInstall = [];
121
+ // A member of a bundle in place can be named too, or be another bundle's member: each is pinned once.
122
+ const addOnce = (list, asset) => {
123
+ if (!list.some((a) => identityKey(a) === identityKey(asset)))
124
+ list.push(asset);
125
+ };
74
126
  for (const request of targets) {
75
127
  if (request.kind === 'bundle') {
76
128
  const { bundle, version } = request;
@@ -81,18 +133,35 @@ export function planTargetsInstall(registry, targets, lockfile, tools, { force,
81
133
  toInstall.push(request);
82
134
  }
83
135
  else {
84
- bundlesInPlace.push(request);
136
+ if (!pin) {
137
+ bundlesInPlace.push(request);
138
+ continue;
139
+ }
140
+ // As a fresh install with --pin pins its members, made direct; one pinned at its version stays as it is.
141
+ const installed = membersInPlace(lockfile, members);
142
+ for (const member of installed) {
143
+ if (inPlacePin(member) === 'already-pinned')
144
+ continue;
145
+ if ((member.installReason ?? 'direct') === 'dependency')
146
+ addOnce(upgrades, member);
147
+ addOnce(pins, member);
148
+ }
149
+ const bundlePin = bundleInPlacePin(installed);
150
+ bundlesInPlace.push({ ...request, ...(bundlePin ? { pin: bundlePin } : {}) });
85
151
  }
86
152
  continue;
87
153
  }
88
154
  const match = findAsset(registry, request.name, request.type, request.version, request.org);
89
155
  const existing = match ? findInstalledAsset(lockfile, request.name, match.asset.type, match.asset.org) : undefined;
90
- const supportingTools = existing && match ? tools.filter((t) => placesAsset(t.adapter, existing.type, match.versionData.tools)) : [];
156
+ const supportingTools = existing && match
157
+ ? tools.filter((t) => placesAsset(t.adapter, existing.type, match.versionData.tools) &&
158
+ takesEntrypoint(t.adapter, existing.type, existing.entrypoint))
159
+ : [];
91
160
  const isInPlace = !force &&
92
161
  existing !== undefined &&
93
162
  supportingTools.length > 0 &&
94
163
  supportingTools.every((t) => isInstalledForTool(existing, t.adapter, projectDir)) &&
95
- (!request.version || request.version === existing.version);
164
+ (!request.version || match?.version === existing.version);
96
165
  if (!isInPlace) {
97
166
  toInstall.push(request);
98
167
  continue;
@@ -101,11 +170,15 @@ export function planTargetsInstall(registry, targets, lockfile, tools, { force,
101
170
  continue;
102
171
  const dependency = (existing.installReason ?? 'direct') === 'dependency';
103
172
  if (dependency)
104
- upgrades.push(existing);
173
+ addOnce(upgrades, existing);
174
+ const pinField = pin ? { pin: inPlacePin(existing) } : {};
175
+ if (pinField.pin === 'pinned')
176
+ addOnce(pins, existing);
105
177
  inPlace.push({
106
178
  name: existing.name,
107
179
  ...(existing.org ? { org: existing.org } : {}),
108
180
  outcome: dependency ? 'upgraded-to-direct' : 'already-installed',
181
+ ...pinField,
109
182
  type: existing.type,
110
183
  version: existing.version,
111
184
  });
@@ -136,7 +209,7 @@ export function planTargetsInstall(registry, targets, lockfile, tools, { force,
136
209
  type: entry.asset.type,
137
210
  version: entry.version,
138
211
  }));
139
- return { assets: [...installed, ...inPlace], bundlesInPlace, plan, toInstall, upgrades };
212
+ return { assets: [...installed, ...inPlace], bundlesInPlace, pins, plan, toInstall, upgrades };
140
213
  }
141
214
  /** Whether a lockfile asset was installed as part of this bundle (name, org) at this version. */
142
215
  function isFromBundleVersion(installed, bundle, version) {
@@ -1 +1 @@
1
- {"version":3,"file":"install-targets.js","sourceRoot":"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AC,CAAC;SACvF,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;QACtB,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,OAAO,EAAE,WAAoB;QAC7B,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,CAAC,CAAC,CAAC;IACN,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;AACjG,CAAC;AAED,iGAAiG;AACjG,SAAS,mBAAmB,CAAC,SAAyB,EAAE,MAAsB,EAAE,OAAe;IAC7F,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,CAAC;IACtC,OAAO,MAAM,EAAE,IAAI,KAAK,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG,KAAK,MAAM,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC;AACjG,CAAC"}
@@ -140,6 +140,13 @@ export declare 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;AAsClG,OAAO,EAAE,YAAY,EAA+B,MAAM,aAAa,CAAC;AAYxE,OAAO,EAEL,KAAK,aAAa,EAKnB,MAAM,eAAe,CAAC;AAMvB,OAAO,EAAE,KAAK,KAAK,EAAiB,MAAM,YAAY,CAAC;AAIvD,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/D,iGAAiG;IACjG,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,qCAAqC;IACrC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,8CAA8C;IAC9C,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;;;;GAYG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,OAAO,EAAE,EACnB,UAAU,CAAC,EAAE,SAAS,EACtB,eAAe,CAAC,EAAE,QAAQ,GACzB,OAAO,CAAC,SAAS,CAAC,CA4BpB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,GAAG,MAAM,CAOjH;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,OAAO,EAChB,eAAe,CAAC,EAAE,QAAQ,EAC1B,KAAK,CAAC,EAAE,SAAS,GAChB,gBAAgB,EAAE,CAWpB;AAED,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAE5D;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC,EAChG,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,YAAY,GAAG,YAAY,CAAC,GACrE,OAAO,CAAC,QAAQ,CAAC,CAqFnB"}
@@ -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 { buildHookGroup, hookCommand, hookGroupOwnsCommand, isNodeHookEntrypoint, placementForEntrypoint, removeHookGroup, } from './hook-config.js';
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
- const supportedEntries = placeableEntries(plan, options.adapter);
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 (supportedEntries.length === 0 && plan.entries.length > 0 && !options.skipUnsupported) {
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(({ asset, versionData }) => getPlacement(adapter, asset.type) && declarationAllows(asset.type, versionData.tools, adapter.tool));
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 = placementForEntrypoint(typePlacement, declaredEntrypoint);
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
- const hookEntries = await withConfigLock(lockFile, () => mergeHookConfig(fromRoot(basePath, configFile), configKey, configFormat, entry.versionData.hookConfig, hookCommand(placement, asset.name), projectDir, onProgress, writeOptions));
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 event in `hookConfig`, this appends
1116
- * one matcher-group whose command is the installed script path. ATK's group is identified by that
1117
- * command (no marker is written — the tool validates group shape). Idempotent: an existing group
1118
- * owned by this command is dropped before appending, so repeated install/sync doesn't duplicate.
1119
- * Returns one lockfile config entry per event, checksummed over the ATK-owned group only.
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, hookConfig, command, projectDir, onProgress, writeOptions = {}) {
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 = buildHookGroup(command, hookConfig[event]);
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
- if (deleteWhenEmpty && Object.keys(config).length === 0) {
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
  }