docks-kit 0.23.0 → 0.25.0

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 (59) hide show
  1. package/AGENTS.md +22 -138
  2. package/README.md +38 -23
  3. package/cli/docs/command-guards.md +5 -3
  4. package/cli/docs/flags.md +11 -29
  5. package/cli/docs/install.md +5 -4
  6. package/cli/docs/omp-context.md +79 -7
  7. package/cli/docs/omp-models.md +22 -15
  8. package/cli/docs/overview.md +5 -8
  9. package/cli/docs/sync-layers.md +55 -83
  10. package/cli/docs/toolchain.md +7 -8
  11. package/cli/src/argv.ts +0 -4
  12. package/cli/src/argvValidate.ts +2 -9
  13. package/cli/src/commands/docs.ts +2 -2
  14. package/cli/src/commands/omp.ts +1 -1
  15. package/cli/src/commands/scratch.ts +1 -1
  16. package/cli/src/commands/sync.ts +3 -24
  17. package/cli/src/commands/tidy.ts +1 -1
  18. package/cli/src/commands/update.ts +3 -3
  19. package/cli/src/engine-native/DESIGN.md +24 -35
  20. package/cli/src/engine-native/deps.ts +2 -7
  21. package/cli/src/engine-native/engineCtx.ts +3 -31
  22. package/cli/src/engine-native/failures.ts +2 -2
  23. package/cli/src/engine-native/index.ts +2 -2
  24. package/cli/src/engine-native/kitDb.ts +21 -37
  25. package/cli/src/engine-native/ompChild.ts +1 -1
  26. package/cli/src/engine-native/ompFastMode.ts +1 -1
  27. package/cli/src/engine-native/ompKitPlugin.ts +7 -16
  28. package/cli/src/engine-native/ompOverlay.ts +1 -1
  29. package/cli/src/engine-native/ompPlugins.ts +205 -221
  30. package/cli/src/engine-native/ompRemovals.ts +24 -3
  31. package/cli/src/engine-native/ompSession.ts +67 -0
  32. package/cli/src/engine-native/ompSync.ts +6 -15
  33. package/cli/src/engine-native/os/posix.ts +0 -1
  34. package/cli/src/engine-native/os/types.ts +0 -4
  35. package/cli/src/engine-native/os/windows.ts +0 -1
  36. package/cli/src/engine-native/parseArgs.ts +1 -61
  37. package/cli/src/engine-native/parseHelp.ts +1 -6
  38. package/cli/src/engine-native/scratch.ts +1 -1
  39. package/cli/src/engine-native/sharedTypes.d.ts +1 -1
  40. package/cli/src/engine-native/syncConcurrency.ts +3 -3
  41. package/cli/src/engine-native/syncDispatch.ts +26 -92
  42. package/cli/src/engine-native/toolchain.ts +1 -5
  43. package/cli/src/generated/sotPayload.ts +339 -17
  44. package/cli/src/main.ts +3 -7
  45. package/cli/tsconfig.json +1 -0
  46. package/package.json +2 -2
  47. package/cli/src/checklistPrompt.ts +0 -464
  48. package/cli/src/commands/harnesses.ts +0 -77
  49. package/cli/src/commands/skills.ts +0 -40
  50. package/cli/src/engine-native/harnesses.ts +0 -138
  51. package/cli/src/engine-native/ompMarketplace.ts +0 -140
  52. package/cli/src/engine-native/skillsInstall.ts +0 -135
  53. package/cli/src/engine-native/skillsLinks.ts +0 -216
  54. package/cli/src/engine-native/skillsManifest.ts +0 -36
  55. package/cli/src/engine-native/skillsPrune.ts +0 -117
  56. package/cli/src/engine-native/skillsRecords.ts +0 -138
  57. package/cli/src/engine-native/skillsSync.ts +0 -57
  58. package/cli/src/manifests.ts +0 -53
  59. package/cli/src/terminalCells.ts +0 -191
@@ -1,21 +1,17 @@
1
1
  /**
2
- * EngineNative omp plugin pass: marketplace-plugin install/upgrade, the
3
- * pinned pi-intercom npm plugin, and the link of the kit plugin that
4
- * `ompKitPlugin.ts syncKitPlugin` writes. Split from ompSync.ts; the
2
+ * EngineNative omp plugin pass: the retirement of the docks marketplace
3
+ * plugins, the pinned pi-intercom npm plugin, and the link of the kit plugin
4
+ * that `ompKitPlugin.ts syncKitPlugin` writes. Split from ompSync.ts; the
5
5
  * orchestration still lives there.
6
6
  *
7
- * omp deletes the previous plugin folder on `omp plugin upgrade`, so a running
8
- * omp session loses the plugin agents and skill script paths of that folder.
9
- * For each version change, the pass warns and writes one event file into the
10
- * upgrade log. When the versions cannot be read after the upgrade, each
11
- * upgrade counts as a change to the version `unknown`. A failed log write
12
- * gives a warning, not a sync failure. The kit plugin extension
13
- * `pluginUpgrades.ts` reads that log.
7
+ * The kit plugin now ships the content of the retired `docks@docks` and
8
+ * `plan-lifecycle@docks` marketplace plugins. Each real sync uninstalls their
9
+ * user-scope installs, warns about their project-scope installs, and then
10
+ * removes the `docks` marketplace. A second sync after a successful
11
+ * retirement runs no omp mutation for it.
14
12
  */
15
- import { randomBytes } from "node:crypto";
16
- import { chmodSync, mkdirSync, readdirSync, realpathSync, unlinkSync } from "node:fs";
13
+ import { existsSync, readFileSync, realpathSync, rmSync } from "node:fs";
17
14
 
18
- import { removeStaleTemporaries, replaceFile } from "./atomicWrite";
19
15
  import { p, processFailureSummary } from "./exec";
20
16
  import { recordFailure } from "./failures";
21
17
  import type { Ctx } from "./index";
@@ -26,14 +22,12 @@ import type { OmpPaths } from "./ompPaths";
26
22
  import { kitCacheDir } from "./scratch";
27
23
  import { field } from "./toolchain";
28
24
 
29
- const MARKETPLACE_PLUGIN_IDS = ["docks@docks", "plan-lifecycle@docks"] as const;
30
-
31
- /** The upgrade log keeps this number of the newest event files. */
32
- const UPGRADE_EVENTS_KEPT = 100;
33
- /** An event file name: the `finishedAt` time in milliseconds, a random part, and `.json`. */
34
- const UPGRADE_EVENT_FILE = /^(\d+)-[0-9a-f]+\.json$/;
35
- /** The version of an upgrade event when the inventory read did not give it. */
36
- const UNKNOWN_VERSION = "unknown";
25
+ /** The marketplace plugins whose content the kit plugin now ships. */
26
+ const RETIRED_PLUGIN_IDS = ["docks@docks", "plan-lifecycle@docks"] as const;
27
+ /** The marketplace of the retired plugins. */
28
+ const RETIRED_MARKETPLACE = "docks";
29
+ /** The label of the marketplace in progress, failure, and summary texts. */
30
+ const RETIRED_MARKETPLACE_LABEL = `${RETIRED_MARKETPLACE} marketplace`;
37
31
 
38
32
  // -------------------------------------------------------------- plugins ----
39
33
 
@@ -43,51 +37,38 @@ interface InstalledNpmPlugin {
43
37
  readonly path: string | undefined;
44
38
  }
45
39
 
46
- interface InstalledPlugins {
47
- /** Each user-scope marketplace plugin id, with its version when the row reports one. */
48
- readonly marketplace: Map<string, string | undefined>;
49
- readonly npm: Map<string, InstalledNpmPlugin>;
50
- }
40
+ /** The install scopes of omp marketplace plugins. */
41
+ type MarketplaceScope = "user" | "project";
51
42
 
52
- /** The fields of an install or upgrade that the sync summary line needs. */
53
- interface VersionedOperation {
43
+ interface InstalledMarketplacePlugin {
44
+ /** The composite id `<plugin>@<marketplace>`. */
54
45
  readonly id: string;
55
- /**
56
- * Whether the inventory listed the plugin before the operation, or
57
- * undefined when that inventory could not be read.
58
- */
59
- readonly present: boolean | undefined;
60
- readonly before: string | undefined;
46
+ readonly scope: MarketplaceScope;
61
47
  }
62
48
 
63
- /** One successful plugin operation, named in the sync summary line. */
64
- type PluginOperation =
65
- | (VersionedOperation & {
66
- readonly kind: "marketplace";
67
- /** The time in milliseconds just after the omp command returned. */
68
- readonly finishedAt: number;
69
- })
70
- | (VersionedOperation & { readonly kind: "npm" })
71
- | { readonly kind: "link"; readonly id: string };
72
-
73
- /** One marketplace plugin upgrade that changed the installed version or can have changed it. */
74
- interface PluginUpgrade {
75
- readonly id: string;
76
- readonly before: string;
77
- readonly after: string;
78
- readonly finishedAt: number;
49
+ interface InstalledPlugins {
50
+ /** One row for each scope that holds a marketplace plugin. */
51
+ readonly marketplace: ReadonlyArray<InstalledMarketplacePlugin>;
52
+ readonly npm: Map<string, InstalledNpmPlugin>;
79
53
  }
80
54
 
81
- /** The version of the first entry that reports one; a marketplace row has no top-level version. */
82
- function marketplaceEntryVersion(entries: unknown): string | undefined {
83
- if (!Array.isArray(entries)) return undefined;
84
- for (const entry of entries) {
85
- if (isObject(entry) && typeof entry["version"] === "string") return entry["version"];
86
- }
87
- return undefined;
88
- }
55
+ /** One successful plugin operation, named in the sync summary line. */
56
+ type PluginOperation =
57
+ | {
58
+ readonly kind: "npm";
59
+ readonly id: string;
60
+ /**
61
+ * Whether the inventory listed the plugin before the operation, or
62
+ * undefined when that inventory could not be read.
63
+ */
64
+ readonly present: boolean | undefined;
65
+ readonly before: string | undefined;
66
+ }
67
+ | { readonly kind: "link"; readonly id: string }
68
+ | { readonly kind: "uninstall"; readonly id: string }
69
+ | { readonly kind: "marketplaceRemove" };
89
70
 
90
- async function installedPluginIdsFromCli(paths: OmpPaths): Promise<InstalledPlugins | undefined> {
71
+ async function installedPluginsFromCli(paths: OmpPaths): Promise<InstalledPlugins | undefined> {
91
72
  const result = await spawnOmp(paths, ["plugin", "list", "--json"], ["ignore", "pipe", "ignore"]);
92
73
  if (result.error !== undefined || result.exitCode !== 0) return undefined;
93
74
 
@@ -102,15 +83,15 @@ async function installedPluginIdsFromCli(paths: OmpPaths): Promise<InstalledPlug
102
83
  }
103
84
 
104
85
  // `omp plugin list --json` reports marketplace rows as
105
- // `{ id: "<plugin>@<marketplace>", scope, entries: [...] }` - the composite id
106
- // is already the token `omp plugin install/upgrade` takes. omp emits one row
107
- // per scope holding the plugin, so a match found only in a `project` row
108
- // means the user scope is empty and `upgrade --scope user` would fail; only a
109
- // `user` row counts as installed for this pipeline.
110
- const marketplace = new Map<string, string | undefined>();
86
+ // `{ id: "<plugin>@<marketplace>", scope, entries: [...] }`. The composite
87
+ // id is the token that `omp plugin uninstall` takes. omp emits one row for
88
+ // each scope that holds the plugin.
89
+ const marketplace: Array<InstalledMarketplacePlugin> = [];
111
90
  for (const row of value["marketplace"]) {
112
- if (!isObject(row) || typeof row["id"] !== "string" || row["scope"] !== "user") continue;
113
- marketplace.set(row["id"], marketplaceEntryVersion(row["entries"]));
91
+ if (!isObject(row) || typeof row["id"] !== "string") continue;
92
+ const scope = row["scope"];
93
+ if (scope !== "user" && scope !== "project") continue;
94
+ marketplace.push({ id: row["id"], scope });
114
95
  }
115
96
 
116
97
  const npm = new Map<string, InstalledNpmPlugin>();
@@ -124,23 +105,29 @@ async function installedPluginIdsFromCli(paths: OmpPaths): Promise<InstalledPlug
124
105
  }
125
106
 
126
107
  /**
127
- * Names one operation with its version change. `after` is the inventory read
108
+ * Names one operation. For an npm operation, `after` is the inventory read
128
109
  * after all operations; when it does not give a version, only the id remains.
129
110
  */
130
111
  function describeOperation(
131
112
  operation: PluginOperation,
132
113
  after: InstalledPlugins | undefined,
133
114
  ): string {
134
- if (operation.kind === "link") return `${operation.id} linked`;
135
- const version =
136
- operation.kind === "marketplace"
137
- ? after?.marketplace.get(operation.id)
138
- : after?.npm.get(operation.id)?.version;
139
- if (version === undefined) return operation.id;
140
- if (operation.present === false) return `${operation.id} ${version} (new)`;
141
- if (operation.before === undefined) return `${operation.id} ${version}`;
142
- if (operation.before === version) return `${operation.id} ${version} (current)`;
143
- return `${operation.id} ${operation.before} -> ${version}`;
115
+ switch (operation.kind) {
116
+ case "link":
117
+ return `${operation.id} linked`;
118
+ case "uninstall":
119
+ return `${operation.id} uninstalled`;
120
+ case "marketplaceRemove":
121
+ return `${RETIRED_MARKETPLACE_LABEL} removed`;
122
+ case "npm": {
123
+ const version = after?.npm.get(operation.id)?.version;
124
+ if (version === undefined) return operation.id;
125
+ if (operation.present === false) return `${operation.id} ${version} (new)`;
126
+ if (operation.before === undefined) return `${operation.id} ${version}`;
127
+ if (operation.before === version) return `${operation.id} ${version} (current)`;
128
+ return `${operation.id} ${operation.before} -> ${version}`;
129
+ }
130
+ }
144
131
  }
145
132
 
146
133
  async function runPluginCommand(
@@ -170,103 +157,134 @@ function realPath(path: string): string | undefined {
170
157
  }
171
158
  }
172
159
 
160
+ // ----------------------------------------------------------- retirement ----
161
+
173
162
  /**
174
- * The marketplace upgrades that changed the version or can have changed it.
175
- * `after` is the inventory read after all operations. When that read failed,
176
- * each upgrade of a present plugin counts as a change to `unknown`.
163
+ * What a registry file says about the `docks` marketplace. `unreadable` names a
164
+ * file that exists but cannot be read or parsed: it can still hold the entry.
177
165
  */
178
- function versionChanges(
179
- operations: ReadonlyArray<PluginOperation>,
180
- after: InstalledPlugins | undefined,
181
- ): Array<PluginUpgrade> {
182
- const upgrades: Array<PluginUpgrade> = [];
183
- for (const operation of operations) {
184
- // Only `omp plugin upgrade` removes a folder, and only a present plugin gets that command.
185
- if (operation.kind !== "marketplace" || operation.present !== true) continue;
186
- const { id, before, finishedAt } = operation;
187
- if (after === undefined) {
188
- upgrades.push({ id, before: before ?? UNKNOWN_VERSION, after: UNKNOWN_VERSION, finishedAt });
189
- continue;
190
- }
191
- const version = after.marketplace.get(id);
192
- if (before === undefined || version === undefined || version === before) continue;
193
- upgrades.push({ id, before, after: version, finishedAt });
166
+ type RegistryState =
167
+ | { readonly kind: "listed" | "absent" }
168
+ | { readonly kind: "unreadable"; readonly file: string };
169
+
170
+ function registryState(registryFile: string): RegistryState | { readonly kind: "missing" } {
171
+ let registryText: string;
172
+ try {
173
+ registryText = readFileSync(registryFile, "utf8");
174
+ } catch (error) {
175
+ // Only a missing path is no registry; a denied or failed read can hide the entry.
176
+ const code = typeof error === "object" && error !== null && "code" in error ? error.code : "";
177
+ if (code === "ENOENT" || code === "ENOTDIR") return { kind: "missing" };
178
+ return { kind: "unreadable", file: registryFile };
194
179
  }
195
- return upgrades;
180
+ const registry = parseJson(registryText);
181
+ if (registry === undefined) return { kind: "unreadable", file: registryFile };
182
+ if (isObject(registry) && Object.hasOwn(registry, RETIRED_MARKETPLACE)) return { kind: "listed" };
183
+
184
+ const entries = Array.isArray(registry)
185
+ ? registry
186
+ : isObject(registry) && Array.isArray(registry["marketplaces"])
187
+ ? registry["marketplaces"]
188
+ : [];
189
+ return entries.some((entry) => isObject(entry) && entry["name"] === RETIRED_MARKETPLACE)
190
+ ? { kind: "listed" }
191
+ : { kind: "absent" };
196
192
  }
197
193
 
198
194
  /**
199
- * Removes the oldest event files beyond the newest UPGRADE_EVENTS_KEPT, and
200
- * the temporary files that killed event writes left.
195
+ * Whether omp knows the `docks` marketplace. omp reads the active registry
196
+ * `<data root>/marketplaces.json`. Upstream `getMarketplacesRegistryPath`
197
+ * copies a legacy `<config root>/marketplaces.json` forward only when it
198
+ * resolves an XDG data root that has no active registry yet. So a legacy
199
+ * entry counts only when no active registry exists; beside an active
200
+ * registry it is stale.
201
201
  */
202
- function pruneUpgradeLog(dir: string): void {
203
- removeStaleTemporaries(
204
- dir,
205
- (target) => target.kind === "name" && UPGRADE_EVENT_FILE.test(target.name),
206
- );
207
- const events = readdirSync(dir).flatMap((name) => {
208
- const match = UPGRADE_EVENT_FILE.exec(name);
209
- return match === null ? [] : [{ name, finishedAt: Number(match[1]) }];
210
- });
211
- events.sort((a, b) => a.finishedAt - b.finishedAt || (a.name < b.name ? -1 : 1));
212
- for (const event of events.slice(0, Math.max(0, events.length - UPGRADE_EVENTS_KEPT))) {
213
- try {
214
- unlinkSync(p(dir, event.name));
215
- } catch (error) {
216
- // A concurrent sync removed the same file first.
217
- const code = typeof error === "object" && error !== null && "code" in error ? error.code : "";
218
- if (code !== "ENOENT") throw error;
219
- }
220
- }
202
+ function docksRegistryState(paths: OmpPaths): RegistryState {
203
+ const active = registryState(p(paths.dataRoot, "marketplaces.json"));
204
+ if (active.kind !== "missing") return active;
205
+ if (paths.dataRoot === paths.configRoot) return { kind: "absent" };
206
+ const legacy = registryState(p(paths.configRoot, "marketplaces.json"));
207
+ return legacy.kind === "missing" ? { kind: "absent" } : legacy;
208
+ }
209
+
210
+ /** The warning for a registry that can hold the `docks` entry but cannot be read. */
211
+ function unreadableRegistryWarning(file: string): string {
212
+ return `omp marketplace registry ${file} cannot be read or parsed — the docks marketplace is not removed; repair the file, then run docks-kit sync again`;
221
213
  }
222
214
 
223
215
  /**
224
- * Writes one new event file for each upgrade, then prunes the log. A writer
225
- * creates only its own files, so concurrent syncs keep the events of each other.
226
- * Returns a warning when a step fails. It does not throw, because the
227
- * upgrades are already done and the sync must still give its upgrade advice.
216
+ * Removes the folder of the retired plugin upgrade log, which only the
217
+ * marketplace plugin upgrades wrote. The kit owns the folder.
228
218
  */
229
- function recordUpgrades(home: string, upgrades: ReadonlyArray<PluginUpgrade>): string | undefined {
230
- // The kit plugin extension `pluginUpgrades.ts` reads the same folder.
231
- const dir = p(kitCacheDir(home), "omp-plugin-upgrades");
219
+ function removeUpgradeLog(ctx: Ctx): void {
220
+ const dir = p(kitCacheDir(ctx.home), "omp-plugin-upgrades");
221
+ if (!existsSync(dir)) return;
232
222
  try {
233
- mkdirSync(dir, { recursive: true, mode: 0o700 });
234
- chmodSync(dir, 0o700);
235
- for (const upgrade of upgrades) {
236
- const event = {
237
- version: 1,
238
- id: upgrade.id,
239
- before: upgrade.before,
240
- after: upgrade.after,
241
- finishedAt: new Date(upgrade.finishedAt).toISOString(),
242
- };
243
- const name = `${upgrade.finishedAt}-${randomBytes(8).toString("hex")}.json`;
244
- // replaceFile writes a temporary name in the same folder and renames it into place.
245
- replaceFile(p(dir, name), `${JSON.stringify(event)}\n`, { mode: 0o600 });
246
- }
223
+ rmSync(dir, { recursive: true, force: true });
224
+ ctx.services.logger.verbose(`removed the retired omp plugin upgrade log ${dir}`);
247
225
  } catch (error) {
248
226
  const detail = error instanceof Error ? error.message : String(error);
249
- return `omp plugin upgrade log not written: ${detail} — running omp sessions get no reminder for these upgrades; give each of them the advice above`;
227
+ ctx.services.logger.warn(`retired omp plugin upgrade log not removed: ${detail}`);
250
228
  }
251
- try {
252
- pruneUpgradeLog(dir);
253
- } catch (error) {
254
- // The events are written, so the sessions still get their reminders.
255
- const detail = error instanceof Error ? error.message : String(error);
256
- return `omp plugin upgrade log not pruned: ${detail} — it can keep more than ${UPGRADE_EVENTS_KEPT} event files`;
229
+ }
230
+
231
+ /**
232
+ * Uninstalls each user-scope install of a retired plugin and warns about each
233
+ * project-scope install, which belongs to that project. Then removes the
234
+ * `docks` marketplace when no uninstall failed and omp knows the marketplace.
235
+ * Returns the successful operations.
236
+ */
237
+ async function retireMarketplacePlugins(
238
+ ctx: Ctx,
239
+ paths: OmpPaths,
240
+ installed: InstalledPlugins,
241
+ ): Promise<Array<PluginOperation>> {
242
+ const { warn } = ctx.services.logger;
243
+ const operations: Array<PluginOperation> = [];
244
+ let uninstallFailed = false;
245
+
246
+ for (const pluginId of RETIRED_PLUGIN_IDS) {
247
+ const rows = installed.marketplace.filter((row) => row.id === pluginId);
248
+ if (rows.some((row) => row.scope === "project")) {
249
+ warn(
250
+ `omp plugin ${pluginId} is installed at project scope and docks-kit no longer ships it; run from that project: omp plugin uninstall --scope project ${pluginId}`,
251
+ );
252
+ }
253
+ if (!rows.some((row) => row.scope === "user")) continue;
254
+
255
+ const args = ["plugin", "uninstall", "--scope", "user", pluginId];
256
+ if (await runPluginCommand(ctx, paths, pluginId, args)) {
257
+ operations.push({ kind: "uninstall", id: pluginId });
258
+ } else {
259
+ uninstallFailed = true;
260
+ }
257
261
  }
258
- return undefined;
262
+
263
+ // A failed uninstall keeps the marketplace, so the manual command still resolves the id.
264
+ if (uninstallFailed) return operations;
265
+ const registry = docksRegistryState(paths);
266
+ if (registry.kind === "unreadable") {
267
+ warn(unreadableRegistryWarning(registry.file));
268
+ } else if (registry.kind === "listed") {
269
+ const args = ["plugin", "marketplace", "remove", RETIRED_MARKETPLACE];
270
+ if (await runPluginCommand(ctx, paths, RETIRED_MARKETPLACE_LABEL, args)) {
271
+ operations.push({ kind: "marketplaceRemove" });
272
+ }
273
+ }
274
+ return operations;
259
275
  }
260
276
 
261
277
  /** Run the plugin pass. `paths` are the omp paths that the sync locked. */
262
278
  export async function syncPlugins(ctx: Ctx, paths: OmpPaths): Promise<number> {
263
279
  const { change, clearProgress, echo, progress, verbose, warn } = ctx.services.logger;
264
280
 
281
+ if (!ctx.dryRun) removeUpgradeLog(ctx);
282
+
265
283
  if (ctx.services.deps.probe("omp").state === "missing") {
266
284
  ctx.services.deps.warnMissing(
267
285
  "omp",
268
286
  ctx.services.logger,
269
- "deployed omp config only — marketplace and plugin passes skipped; re-run sync after installing",
287
+ "deployed omp config only — plugin pass skipped; re-run sync after installing",
270
288
  );
271
289
  return 0;
272
290
  }
@@ -274,15 +292,23 @@ export async function syncPlugins(ctx: Ctx, paths: OmpPaths): Promise<number> {
274
292
  ctx.services.deps.warnMissing(
275
293
  "git",
276
294
  ctx.services.logger,
277
- "plugin marketplaces are git repos — omp plugin refresh skipped; re-run sync after installing",
295
+ "omp plugin pass skipped; re-run sync after installing",
278
296
  );
279
297
  return 0;
280
298
  }
281
299
 
300
+ const piIntercomPin = field("pi-intercom", "verified");
301
+
282
302
  if (ctx.dryRun) {
283
- const piIntercomPin = field("pi-intercom", "verified");
284
- for (const pluginId of MARKETPLACE_PLUGIN_IDS) {
285
- echo(`[dry-run] omp plugin install --scope user ${pluginId}`);
303
+ // A dry run reads no inventory, so it previews the uninstall of each retired id.
304
+ for (const pluginId of RETIRED_PLUGIN_IDS) {
305
+ echo(`[dry-run] omp plugin uninstall --scope user ${pluginId}`);
306
+ }
307
+ const registry = docksRegistryState(paths);
308
+ if (registry.kind === "unreadable") {
309
+ warn(unreadableRegistryWarning(registry.file));
310
+ } else if (registry.kind === "listed") {
311
+ echo(`[dry-run] omp plugin marketplace remove ${RETIRED_MARKETPLACE}`);
286
312
  }
287
313
  if (piIntercomPin === "") {
288
314
  warn(
@@ -295,47 +321,24 @@ export async function syncPlugins(ctx: Ctx, paths: OmpPaths): Promise<number> {
295
321
  return 0;
296
322
  }
297
323
 
298
- const piIntercomPin = field("pi-intercom", "verified");
299
-
300
324
  progress("Checking installed omp plugins...");
301
- const installed = await installedPluginIdsFromCli(paths);
325
+ const installed = await installedPluginsFromCli(paths);
302
326
  clearProgress();
327
+
328
+ const operations: Array<PluginOperation> = [];
303
329
  if (installed === undefined) {
304
- warn("omp plugin inventory unavailable — falling back to the full refresh path");
330
+ warn(
331
+ "omp plugin inventory unavailable — retirement of the docks marketplace plugins skipped until the next sync; pi-intercom and the kit plugin take the full refresh path",
332
+ );
333
+ } else {
334
+ operations.push(...(await retireMarketplacePlugins(ctx, paths, installed)));
305
335
  }
306
336
 
307
337
  let pluginsInstalled =
308
338
  installed === undefined
309
339
  ? 0
310
- : MARKETPLACE_PLUGIN_IDS.filter((pluginId) => installed.marketplace.has(pluginId)).length +
311
- (piIntercomPin !== "" && installed.npm.has("pi-intercom") ? 1 : 0) +
340
+ : (piIntercomPin !== "" && installed.npm.has("pi-intercom") ? 1 : 0) +
312
341
  (installed.npm.has(KIT_PLUGIN_NAME) ? 1 : 0);
313
- const operations: Array<PluginOperation> = [];
314
-
315
- for (const pluginId of MARKETPLACE_PLUGIN_IDS) {
316
- const present = installed?.marketplace.has(pluginId) === true;
317
- if (present && ctx.skipPluginRefresh === true) {
318
- verbose(`omp plugin ${pluginId} already installed; refresh-only update skipped`);
319
- continue;
320
- }
321
-
322
- const args = present
323
- ? ["plugin", "upgrade", "--scope", "user", pluginId]
324
- : ["plugin", "install", "--scope", "user", pluginId];
325
- const succeeded = await runPluginCommand(ctx, paths, pluginId, args);
326
- // The operation boundary: an omp process that started later loaded the new folder.
327
- const finishedAt = Date.now();
328
- if (succeeded) {
329
- operations.push({
330
- kind: "marketplace",
331
- id: pluginId,
332
- present: installed === undefined ? undefined : present,
333
- before: installed?.marketplace.get(pluginId),
334
- finishedAt,
335
- });
336
- if (!present) pluginsInstalled++;
337
- }
338
- }
339
342
 
340
343
  if (piIntercomPin === "") {
341
344
  warn("pi-intercom install skipped because SoT/toolchain.json has no verified pi-intercom pin");
@@ -374,44 +377,25 @@ export async function syncPlugins(ctx: Ctx, paths: OmpPaths): Promise<number> {
374
377
  if (installed?.npm.has(KIT_PLUGIN_NAME) !== true) pluginsInstalled++;
375
378
  }
376
379
 
377
- if (operations.length > 0) {
378
- // A second inventory read gives the versions that the operations left.
380
+ if (operations.length === 0) {
381
+ verbose("omp plugins already in sync");
382
+ return pluginsInstalled;
383
+ }
384
+
385
+ // Only an npm operation names a version, so only then a second inventory
386
+ // read gives the versions that the operations left.
387
+ let after: InstalledPlugins | undefined;
388
+ if (operations.some((operation) => operation.kind === "npm")) {
379
389
  progress("Reading omp plugin versions...");
380
- const after = await installedPluginIdsFromCli(paths);
390
+ after = await installedPluginsFromCli(paths);
381
391
  clearProgress();
382
- const items = operations.map((operation) => describeOperation(operation, after));
383
- change(`omp plugins synced: ${items.join(", ")}`);
384
- const upgrades = versionChanges(operations, after);
385
- // /reload-plugins repairs the plugin agents and skills of a running session
386
- // after a version-changing upgrade. The upgrade warning and next step name
387
- // the cases that still need a restart: hooks, extension modules, and
388
- // non-MCP tools. Each other operation (an install, a reinstall at the same
389
- // version, an npm install, or a link) still needs a restart.
390
- const upgradedIds = new Set(upgrades.map((upgrade) => upgrade.id));
391
- if (
392
- operations.some(
393
- (operation) => operation.kind !== "marketplace" || !upgradedIds.has(operation.id),
394
- )
395
- ) {
396
- ctx.nextStepTriggers.ompRestart = true;
397
- }
398
- if (after === undefined && upgrades.length > 0) {
399
- warn(
400
- "omp plugin versions could not be read after the upgrade — each upgraded plugin counts as changed",
401
- );
402
- }
403
- for (const upgrade of upgrades) {
404
- warn(
405
- `omp plugin ${upgrade.id} ${upgrade.before} -> ${upgrade.after}: running omp sessions lose its plugin agents until they run /reload-plugins and read its skills again through skill:// (restart omp instead when the plugin ships hooks, extension modules, or non-MCP tools).`,
406
- );
407
- }
408
- if (upgrades.length > 0) {
409
- ctx.nextStepTriggers.ompPluginUpgraded = true;
410
- const logFailure = recordUpgrades(ctx.home, upgrades);
411
- if (logFailure !== undefined) warn(logFailure);
412
- }
413
- } else {
414
- verbose("omp plugins already in sync");
392
+ }
393
+ const items = operations.map((operation) => describeOperation(operation, after));
394
+ change(`omp plugins synced: ${items.join(", ")}`);
395
+ // An install, a link, or an uninstall changes the plugins that omp loads.
396
+ // A marketplace removal alone changes no loaded plugin.
397
+ if (operations.some((operation) => operation.kind !== "marketplaceRemove")) {
398
+ ctx.nextStepTriggers.ompRestart = true;
415
399
  }
416
400
  return pluginsInstalled;
417
401
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * EngineNative `sync omp` retired-entry pruning. `ompYaml.ts mergeOmpConfig` and
2
+ * EngineNative sync retired-entry pruning. `ompYaml.ts mergeOmpConfig` and
3
3
  * `mergeOmpModels` are additive: their `mergeMappings, deployed-key retention
4
4
  * loop` returns every deployed key absent from the SoT to the merged result,
5
5
  * and `mergeBashPatterns` keeps a deployed rule the SoT stops shipping as a user
@@ -40,6 +40,9 @@ type RetiredValue = string | number | boolean | ReadonlyArray<string>;
40
40
  * same value.
41
41
  * - `compaction.thresholdTokens: 231200`: an old fixed compaction trigger.
42
42
  * Pruning it restores omp's reserve-based default `-1`.
43
+ * - The 18 entries from `task.maxConcurrency` to `github.enabled`: overrides
44
+ * that the owner returned to the omp 19.0.0 defaults. Pruning one restores
45
+ * the omp default, for example `task.maxEffort` `max` instead of `xhigh`.
43
46
  */
44
47
  export const OMP_RETIRED_VALUES: ReadonlyArray<readonly [string, RetiredValue]> = [
45
48
  ["symbolPreset", "unicode"],
@@ -85,6 +88,24 @@ export const OMP_RETIRED_VALUES: ReadonlyArray<readonly [string, RetiredValue]>
85
88
  ["textVerbosity", "low"],
86
89
  ["codexResets.autoRedeem", "no"],
87
90
  ["tools.approvalMode", "yolo"],
91
+ ["task.maxConcurrency", 16],
92
+ ["task.maxEffort", "xhigh"],
93
+ ["task.maxRuntimeMs", 3600000],
94
+ ["task.agentIdleTtlMs", 120000],
95
+ ["task.enableLsp", true],
96
+ ["task.eager", "always"],
97
+ ["task.showResolvedModelBadge", true],
98
+ ["find.enabled", true],
99
+ ["providers.webSearchTimeoutSeconds", 30],
100
+ ["browser.idleCloseSec", 600],
101
+ ["steeringMode", "all"],
102
+ ["doubleEscapeAction", "tree"],
103
+ ["features.unexpectedStopDetection", "smart"],
104
+ ["compaction.idleEnabled", true],
105
+ ["compaction.handoffSaveToDisk", true],
106
+ ["commands.enableOpencodeProject", false],
107
+ ["statusLine.compactThinkingLevel", false],
108
+ ["github.enabled", true],
88
109
  ];
89
110
 
90
111
  /**
@@ -260,8 +281,8 @@ function indexOfKey(mapping: YAMLMap, key: string): number {
260
281
  /**
261
282
  * Deletes `segments` when `matches` accepts the leaf value, then removes every
262
283
  * ancestor mapping the deletion left empty. An ancestor holding another key
263
- * survives, so `statusLine` keeps `compactThinkingLevel` while `tui` disappears
264
- * once both of its keys are gone.
284
+ * survives, so `task` keeps its reviewer overrides while `tui` disappears once
285
+ * both of its keys are gone.
265
286
  */
266
287
  function deletePath(
267
288
  root: YAMLMap,