docks-kit 0.22.25 → 0.23.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 (77) hide show
  1. package/AGENTS.md +35 -81
  2. package/README.md +31 -58
  3. package/cli/docs/command-guards.md +231 -197
  4. package/cli/docs/flags.md +25 -55
  5. package/cli/docs/install.md +2 -3
  6. package/cli/docs/omp-context.md +5 -5
  7. package/cli/docs/omp-models.md +249 -48
  8. package/cli/docs/overview.md +4 -12
  9. package/cli/docs/platforms.md +2 -2
  10. package/cli/docs/sync-layers.md +10 -57
  11. package/cli/docs/toolchain.md +9 -78
  12. package/cli/src/argv.ts +0 -8
  13. package/cli/src/argvValidate.ts +2 -46
  14. package/cli/src/commands/docs.ts +2 -14
  15. package/cli/src/commands/harnesses.ts +6 -9
  16. package/cli/src/commands/sync.ts +5 -99
  17. package/cli/src/commands/toolchain.ts +4 -12
  18. package/cli/src/engine-native/DESIGN.md +67 -88
  19. package/cli/src/engine-native/deps.ts +6 -86
  20. package/cli/src/engine-native/engineCtx.ts +7 -76
  21. package/cli/src/engine-native/exec.ts +1 -18
  22. package/cli/src/engine-native/harnesses.ts +6 -6
  23. package/cli/src/engine-native/index.ts +4 -6
  24. package/cli/src/engine-native/jq.ts +4 -37
  25. package/cli/src/engine-native/modes.ts +3 -132
  26. package/cli/src/engine-native/ompRemovals.ts +14 -0
  27. package/cli/src/engine-native/os/darwin.ts +0 -4
  28. package/cli/src/engine-native/os/index.ts +1 -2
  29. package/cli/src/engine-native/os/linux.ts +0 -3
  30. package/cli/src/engine-native/os/posix.ts +2 -46
  31. package/cli/src/engine-native/os/types.ts +1 -32
  32. package/cli/src/engine-native/os/windows.ts +0 -49
  33. package/cli/src/engine-native/parseArgs.ts +11 -124
  34. package/cli/src/engine-native/parseHelp.ts +5 -40
  35. package/cli/src/engine-native/scratch.ts +1 -1
  36. package/cli/src/engine-native/services.ts +1 -2
  37. package/cli/src/engine-native/sharedTypes.d.ts +0 -40
  38. package/cli/src/engine-native/skillsSync.ts +1 -1
  39. package/cli/src/engine-native/syncConcurrency.ts +3 -15
  40. package/cli/src/engine-native/syncDispatch.ts +10 -57
  41. package/cli/src/engine-native/toolchain.ts +5 -40
  42. package/cli/src/engine.ts +0 -75
  43. package/cli/src/generated/sotPayload.ts +14 -41
  44. package/cli/src/main.ts +7 -19
  45. package/cli/src/manifests.ts +1 -93
  46. package/cli/src/payload.ts +2 -8
  47. package/cli/tsconfig.json +1 -3
  48. package/package.json +3 -5
  49. package/cli/docs/models.md +0 -58
  50. package/cli/docs/modifiers.md +0 -52
  51. package/cli/docs/plugins.md +0 -70
  52. package/cli/src/commands/model.ts +0 -68
  53. package/cli/src/commands/models.ts +0 -75
  54. package/cli/src/commands/plugins.ts +0 -35
  55. package/cli/src/commands/status.ts +0 -206
  56. package/cli/src/efforts.ts +0 -89
  57. package/cli/src/engine-native/claudeLsp.ts +0 -301
  58. package/cli/src/engine-native/claudeOptionalPlugins.ts +0 -126
  59. package/cli/src/engine-native/claudePluginPasses.ts +0 -426
  60. package/cli/src/engine-native/claudeRemovals.ts +0 -383
  61. package/cli/src/engine-native/claudeRetired.ts +0 -165
  62. package/cli/src/engine-native/claudeRuntime.ts +0 -157
  63. package/cli/src/engine-native/claudeSettings.ts +0 -201
  64. package/cli/src/engine-native/claudeSettingsModifiers.ts +0 -115
  65. package/cli/src/engine-native/claudeSync.ts +0 -312
  66. package/cli/src/engine-native/codexConfig.ts +0 -214
  67. package/cli/src/engine-native/codexHooks.ts +0 -91
  68. package/cli/src/engine-native/codexPaths.ts +0 -14
  69. package/cli/src/engine-native/codexPlugins.ts +0 -315
  70. package/cli/src/engine-native/codexStatus.ts +0 -25
  71. package/cli/src/engine-native/codexSync.ts +0 -314
  72. package/cli/src/engine-native/codexToml.ts +0 -303
  73. package/cli/src/engine-native/liveModels.ts +0 -264
  74. package/cli/src/engine-native/models.ts +0 -101
  75. package/cli/src/engine-native/parseModifiers.ts +0 -225
  76. package/cli/src/engine-native/settings.ts +0 -42
  77. package/cli/src/engine-native/tomlLines.ts +0 -92
@@ -1,37 +1,17 @@
1
1
  /**
2
2
  * EngineNative flag layer: target selection and the argv dispatch loop.
3
- * Modifier/effort mapping lives in parseModifiers.ts; help text and the
4
- * early-exit error live in parseHelp.ts (re-exported here so existing
5
- * `from "./parseArgs"` imports keep working).
3
+ * Help text and the early-exit error live in parseHelp.ts (re-exported here
4
+ * so existing `from "./parseArgs"` imports keep working).
6
5
  */
7
6
  import type { Ctx } from "./index";
8
- import { LEGACY_SELECTION, readHarnessSelection, type Harness } from "./harnesses";
9
- import { advisorCatalog, advisorFlagGrammar, effortCatalog, effortFlagGrammar } from "../efforts";
10
- import { printModels } from "./models";
11
- import { curatedCatalog } from "./liveModels";
12
- import { ExitError, printCatalog, printUsage } from "./parseHelp";
13
- import {
14
- KNOWN_CLAUDE_OPTIN_PLUGINS,
15
- addClaudePlugin,
16
- isScalarModifierFlag,
17
- markModifier,
18
- parseCompactWindow,
19
- setModifier,
20
- } from "./parseModifiers";
7
+ import { DEFAULT_SELECTION, readHarnessSelection, type Harness } from "./harnesses";
8
+ import { ExitError, printUsage } from "./parseHelp";
21
9
 
22
10
  export { ExitError } from "./parseHelp";
23
- export {
24
- KNOWN_CLAUDE_OPTIN_PLUGINS,
25
- parseClaudePlugin,
26
- parseCompactWindow,
27
- validateModifierFlags,
28
- } from "./parseModifiers";
29
11
 
30
- type TargetFlag = "syncClaude" | "syncCodex" | "syncAgents" | "syncOmp";
12
+ type TargetFlag = "syncAgents" | "syncOmp";
31
13
 
32
14
  const TARGET_FLAGS = {
33
- claude: "syncClaude",
34
- codex: "syncCodex",
35
15
  agents: "syncAgents",
36
16
  omp: "syncOmp",
37
17
  } satisfies Record<Harness, TargetFlag>;
@@ -42,18 +22,9 @@ const TARGET_FLAGS = {
42
22
  * text, so the two paths cannot drift.
43
23
  */
44
24
  export const LEGACY_FLAG_HINTS = {
45
- "--claude": "--claude was renamed: pass the target as a word, e.g. 'sync claude'",
46
- "--codex": "--codex was renamed: pass the target as a word, e.g. 'sync codex'",
47
25
  "--agents": "--agents was renamed: pass the target as a word, e.g. 'sync agents'",
48
26
  "--omp": "--omp was renamed: pass the target as a word, e.g. 'sync omp'",
49
- "--force": "--force was renamed to --reconcile",
50
- "--remove-plugins":
51
- "--remove-plugins was renamed to --prune (it also removes marketplaces + kit-managed skills)",
52
- "--680k": "--680k was renamed to --claude-compact-window=680k",
53
- "--permissive": "--permissive was renamed to --claude-permissive",
54
- "--supabase": "--supabase was renamed to --claude-plugin=supabase",
55
- "--n8n": "--n8n was renamed to --claude-plugin=n8n",
56
- "--skip-rtk": "--skip-rtk was renamed to --skip-bubblewrap",
27
+ "--remove-plugins": "--remove-plugins was renamed to --prune",
57
28
  } as const satisfies Record<string, string>;
58
29
 
59
30
  type LegacyFlag = keyof typeof LEGACY_FLAG_HINTS;
@@ -68,8 +39,6 @@ function selectTarget(ctx: Ctx, target: Harness): void {
68
39
  }
69
40
 
70
41
  function applySelection(ctx: Ctx, selection: ReadonlyArray<Harness>): void {
71
- ctx.syncClaude = selection.includes("claude");
72
- ctx.syncCodex = selection.includes("codex");
73
42
  ctx.syncAgents = selection.includes("agents");
74
43
  ctx.syncOmp = selection.includes("omp");
75
44
  }
@@ -78,25 +47,17 @@ function applyDefaultSelection(ctx: Ctx): void {
78
47
  if (ctx.targetFilterSet) return;
79
48
 
80
49
  const storedSelection = readHarnessSelection(ctx.home);
81
- applySelection(ctx, storedSelection ?? LEGACY_SELECTION);
50
+ applySelection(ctx, storedSelection ?? DEFAULT_SELECTION);
82
51
  if (storedSelection !== undefined || !ctx.interactive) return;
83
52
 
84
- ctx.services.logger.echo("No harness selection stored; syncing claude, codex, agents");
53
+ ctx.services.logger.echo(`No harness selection stored; syncing ${DEFAULT_SELECTION.join(", ")}`);
85
54
  ctx.services.logger.echo("Choose harnesses with: docks-kit harnesses");
86
55
  }
87
56
 
88
57
  export function parseArgs(ctx: Ctx, args: ReadonlyArray<string>): void {
89
58
  const { err } = ctx.services.logger;
90
- for (let index = 0; index < args.length; index += 1) {
91
- const arg = args[index] ?? "";
92
- if (isScalarModifierFlag(arg) && args[index + 1] === "") {
93
- setModifier(ctx, arg, "");
94
- index += 1;
95
- continue;
96
- }
59
+ for (const arg of args) {
97
60
  switch (arg) {
98
- case "claude":
99
- case "codex":
100
61
  case "agents":
101
62
  case "omp":
102
63
  selectTarget(ctx, arg);
@@ -104,101 +65,27 @@ export function parseArgs(ctx: Ctx, args: ReadonlyArray<string>): void {
104
65
  case "--dry-run":
105
66
  ctx.dryRun = true;
106
67
  continue;
107
- case "--skip-bubblewrap":
108
- ctx.skipBubblewrap = true;
109
- continue;
110
68
  case "--skip-plugin-refresh":
111
69
  ctx.skipPluginRefresh = true;
112
70
  continue;
113
- case "--reconcile":
114
- ctx.reconcile = true;
115
- continue;
116
71
  case "--prune":
117
72
  ctx.prune = true;
118
73
  continue;
119
74
  case "--verbose":
120
75
  ctx.verbose = true;
121
76
  continue;
122
- case "--claude-model":
123
- printModels(ctx, curatedCatalog("claude"));
124
- err("--claude-model requires a value: --claude-model=<model>");
125
- throw new ExitError(2);
126
- case "--codex-model":
127
- printModels(ctx, curatedCatalog("codex"));
128
- err("--codex-model requires a value: --codex-model=<model>");
129
- throw new ExitError(2);
130
- case "--claude-effort":
131
- printCatalog(ctx, effortCatalog("claude"));
132
- err(`--claude-effort requires a value: ${effortFlagGrammar("claude")}`);
133
- throw new ExitError(2);
134
- case "--codex-effort":
135
- printCatalog(ctx, effortCatalog("codex"));
136
- err(`--codex-effort requires a value: ${effortFlagGrammar("codex")}`);
137
- throw new ExitError(2);
138
- case "--claude-advisor":
139
- printCatalog(ctx, advisorCatalog());
140
- err(`--claude-advisor requires a value: ${advisorFlagGrammar()}`);
141
- throw new ExitError(2);
142
- case "--claude-compact-window":
143
- err(
144
- "--claude-compact-window requires a value: --claude-compact-window=<tokens> (e.g. 680k)",
145
- );
146
- throw new ExitError(2);
147
- case "--claude-permissive":
148
- ctx.claudePermissive = true;
149
- markModifier(ctx, "--claude-permissive");
150
- continue;
151
- case "--claude-plugin":
152
- err(
153
- `--claude-plugin requires a value: --claude-plugin=<${KNOWN_CLAUDE_OPTIN_PLUGINS.join("|")}>`,
154
- );
155
- throw new ExitError(2);
156
- case "--claude":
157
- case "--codex":
158
77
  case "--agents":
159
78
  case "--omp":
160
- case "--force":
161
79
  case "--remove-plugins":
162
- case "--680k":
163
- case "--permissive":
164
- case "--supabase":
165
- case "--n8n":
166
- case "--skip-rtk":
167
80
  err(LEGACY_FLAG_HINTS[arg]);
168
81
  throw new ExitError(2);
169
82
  case "-h":
170
83
  case "--help":
171
- printUsage(ctx, KNOWN_CLAUDE_OPTIN_PLUGINS);
84
+ printUsage(ctx);
172
85
  throw new ExitError(0);
173
86
  default:
174
- break;
175
- }
176
- if (arg.startsWith("--claude-model=")) {
177
- setModifier(ctx, "--claude-model", arg.slice("--claude-model=".length));
178
- } else if (arg.startsWith("--codex-model=")) {
179
- setModifier(ctx, "--codex-model", arg.slice("--codex-model=".length));
180
- } else if (arg.startsWith("--claude-effort=")) {
181
- setModifier(ctx, "--claude-effort", arg.slice("--claude-effort=".length));
182
- } else if (arg.startsWith("--codex-effort=")) {
183
- setModifier(ctx, "--codex-effort", arg.slice("--codex-effort=".length));
184
- } else if (arg.startsWith("--claude-advisor=")) {
185
- setModifier(ctx, "--claude-advisor", arg.slice("--claude-advisor=".length));
186
- } else if (arg.startsWith("--claude-compact-window=")) {
187
- const parsed = parseCompactWindow(arg.slice("--claude-compact-window=".length));
188
- if (parsed === undefined) {
189
- err("--claude-compact-window expects a token count (e.g. 680000 or 680k)");
87
+ err(`Unknown arg: ${arg}`);
190
88
  throw new ExitError(2);
191
- }
192
- ctx.claudeCompactWindow = parsed;
193
- markModifier(ctx, "--claude-compact-window");
194
- } else if (arg.startsWith("--claude-plugin=")) {
195
- addClaudePlugin(ctx, arg.slice("--claude-plugin=".length));
196
- } else if (arg.startsWith("--claude-permissive=")) {
197
- err("--claude-permissive does not take a value");
198
- throw new ExitError(2);
199
- } else {
200
- err(`Unknown arg: ${arg}`);
201
- throw new ExitError(2);
202
89
  }
203
90
  }
204
91
 
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Help text and the early-exit signal for the EngineNative flag layer.
3
- * Kept dependency-free (besides injected ctx) so modifier mapping and the
4
- * dispatch loop can both share it without import cycles.
3
+ * Kept dependency-free (besides injected ctx) so the dispatch loop and its
4
+ * callers can share it without import cycles.
5
5
  */
6
6
 
7
7
  import type { Ctx } from "./index";
8
- import { advisorFlagGrammar, effortFlagGrammar } from "../efforts";
9
8
 
10
9
  export class ExitError extends Error {
11
10
  constructor(readonly code: number) {
@@ -13,54 +12,20 @@ export class ExitError extends Error {
13
12
  }
14
13
  }
15
14
 
16
- export function printCatalog(ctx: Ctx, catalog: string): void {
17
- for (const line of catalog.split("\n")) ctx.services.logger.echo(line);
18
- }
19
-
20
- export function printUsage(ctx: Ctx, knownPlugins: ReadonlyArray<string>): void {
15
+ export function printUsage(ctx: Ctx): void {
21
16
  const { echo } = ctx.services.logger;
22
17
  const argv0 = "docks-kit sync";
23
- echo(`Usage: ${argv0} [claude] [codex] [agents] [omp] [flags]`);
18
+ echo(`Usage: ${argv0} [agents] [omp] [flags]`);
24
19
  echo("");
25
20
  echo("Targets (positional; default: this machine's harness selection)");
26
- echo(" claude sync the Claude Code SoT");
27
- echo(" codex sync the Codex SoT");
28
21
  echo(" agents sync universal agent skills");
29
22
  echo(" omp sync the Oh My Pi SoT");
30
23
  echo("");
31
24
  echo("Global flags");
32
25
  echo(" --dry-run preview without applying");
33
- echo(
34
- " --reconcile reconcile kit-owned settings with SoT (SoT keys win; user-only keys preserved; permissions arrays replaced)",
35
- );
36
- echo(
37
- " --prune uninstall kit-managed installs not in SoT (plugins, marketplaces, skills in SoT/.agents/skills.txt)",
38
- );
39
- echo(" --skip-bubblewrap skip optional bubblewrap bootstrap (Codex Linux sandbox)");
26
+ echo(" --prune remove kit-managed universal skills not in SoT/.agents/skills.txt");
40
27
  echo(" --skip-plugin-refresh install missing plugins but skip refresh-only updates");
41
28
  echo(
42
29
  " --verbose also print no-op confirmations (already in sync, up to date, left as-is)",
43
30
  );
44
- echo("");
45
- echo(
46
- "Deploy-time modifiers (deployed config only; SoT untouched; a later flag-less sync reverts)",
47
- );
48
- echo(
49
- " --claude-model=<m> set deployed ~/.claude/settings.json model (aliases: best|opus|fable|sonnet|haiku, full claude-* IDs, or 'default' to unset)",
50
- );
51
- echo(` ${effortFlagGrammar("claude").padEnd(39)} set deployed effortLevel`);
52
- echo(` ${advisorFlagGrammar().padEnd(39)} set deployed advisor state`);
53
- echo(
54
- " --claude-compact-window=<n> set deployed autocompact window in tokens (e.g. 680000 or 680k) for disposable sessions",
55
- );
56
- echo(
57
- " --claude-permissive empty permissions.ask/deny in deployed settings (sandboxes/containers; unattended commits + pushes)",
58
- );
59
- echo(" --codex-model=<m> set deployed ~/.codex/config.toml model (e.g. gpt-5.5)");
60
- echo(` ${effortFlagGrammar("codex").padEnd(39)} set deployed model_reasoning_effort`);
61
- echo("");
62
- echo("Sticky opt-ins (installed + enabled until --prune)");
63
- echo(
64
- ` --claude-plugin=<name> opt an optional plugin into this machine (known: ${knownPlugins.join(", ")}; repeatable)`,
65
- );
66
31
  }
@@ -35,7 +35,7 @@ export function syncLockPath(home: string): string {
35
35
  }
36
36
 
37
37
  /**
38
- * The `kitLock.ts` lock inside a Codex, agents, or omp folder that a sync
38
+ * The `kitLock.ts` lock inside an agents or omp folder that a sync
39
39
  * writes. Syncs of different homes that share the folder all take it.
40
40
  */
41
41
  export function folderSyncLockPath(folder: string): string {
@@ -2,8 +2,7 @@
2
2
  * Shared service factory — the single construction point for the engine's
3
3
  * injectable capabilities (Output Policy in DESIGN.md). The Effect rim wraps
4
4
  * these in Layers (cli/src/services.ts); the harness-private native-raw entry
5
- * and engineCapture's parent-side warn call it directly, so every execution
6
- * path shares one implementation.
5
+ * calls it directly, so every execution path shares one implementation.
7
6
  */
8
7
  import {
9
8
  DEPENDENCIES,
@@ -4,40 +4,10 @@
4
4
  * structurally identical anonymous types. Types only — no runtime code.
5
5
  */
6
6
  import type { Json } from "./jq";
7
- import type { ModifierFlag } from "./engineCtx";
8
7
 
9
8
  /** Manifest-record object: the `{ [key]: Json }` shape redeclared across manifest readers. */
10
9
  export type JsonObject = { [key: string]: Json };
11
10
 
12
- export type CatalogTool = "claude" | "codex" | "omp";
13
- export type CatalogSource = "anthropic-api" | "codex-cache" | "omp-cli" | "curated";
14
-
15
- export interface ResolvedCatalog {
16
- readonly tool: CatalogTool;
17
- readonly source: CatalogSource;
18
- readonly verified: string;
19
- readonly fetchedAt?: string;
20
- readonly fallbackReason?: string;
21
- readonly models: ReadonlyArray<{
22
- readonly id: string;
23
- readonly kind: "alias" | "id";
24
- readonly note?: string;
25
- }>;
26
- }
27
-
28
- /**
29
- * Shared core of per-tool settings-edit descriptors (Claude JSON modifiers,
30
- * Codex TOML passes). Each tool narrows `key` to its own vocabulary and keeps
31
- * tool-only fields (such as Claude's dry-run preview) on its local extension.
32
- */
33
- export interface SettingEdit<TKey extends string> {
34
- readonly tag: string;
35
- readonly key: TKey;
36
- readonly value: string | undefined;
37
- readonly changed: string;
38
- readonly unchanged: string;
39
- }
40
-
41
11
  /**
42
12
  * omp session model (moved from harnesses.ts, which re-exports it so existing
43
13
  * import paths keep working).
@@ -49,15 +19,5 @@ export interface OmpSessionModel {
49
19
  readonly thinking?: string;
50
20
  }
51
21
 
52
- /**
53
- * Scalar modifier flags: the ModifierFlag subset taking a value through
54
- * setModifier. Derived by exclusion so a new ModifierFlag forces an explicit
55
- * scalar/non-scalar decision here.
56
- */
57
- export type ScalarModifierFlag = Exclude<
58
- ModifierFlag,
59
- "--claude-compact-window" | "--claude-permissive" | "--claude-plugin"
60
- >;
61
-
62
22
  /** Injected HTTP client: the subset of fetch the network lookups call. */
63
23
  export type FetchLike = (url: string, init?: RequestInit) => Promise<Response>;
@@ -52,6 +52,6 @@ export function skillsSummary(ctx: Ctx, state: SkillsState): void {
52
52
 
53
53
  export function skillsNextSteps(ctx: Ctx): Array<string> {
54
54
  return ctx.verbose || ctx.nextStepTriggers.skillsRestart
55
- ? ["Restart Claude Code (and Codex) to discover newly installed universal skills."]
55
+ ? ["Restart Claude Code to discover newly installed universal skills."]
56
56
  : [];
57
57
  }
@@ -1,9 +1,8 @@
1
1
  /**
2
- * EngineNative sync scheduling: bounded-concurrency runner plus the
3
- * manifest-driven serialization rule. Split from index.ts, which re-exports
4
- * the public surface so existing import paths keep working.
2
+ * EngineNative sync scheduling: the bounded-concurrency runner. Split from
3
+ * index.ts, which re-exports the public surface so existing import paths keep
4
+ * working.
5
5
  */
6
- import { normalizeManifest } from "./skillsManifest";
7
6
 
8
7
  export type SyncConcurrency = 1 | 2 | 3;
9
8
  export type SyncTask<T> = () => Promise<T>;
@@ -42,14 +41,3 @@ export async function runBounded<T>(
42
41
  }
43
42
  return results;
44
43
  }
45
-
46
- export function syncConcurrencyForManifest(
47
- configured: SyncConcurrency,
48
- manifest: string,
49
- claudeSelected: boolean,
50
- skillsSelected: boolean,
51
- ): SyncConcurrency {
52
- if (!claudeSelected || !skillsSelected || normalizeManifest(manifest).length === 0)
53
- return configured;
54
- return 1;
55
- }
@@ -1,17 +1,12 @@
1
1
  /**
2
2
  * EngineNative pipeline dispatch: select the requested harness pipelines,
3
3
  * run them under the concurrency cap, then print the summary and advice.
4
- * Split from index.ts; the `sync`/`model`/`toolchain` entry routing still
5
- * lives there.
4
+ * Split from index.ts; the `sync`/`toolchain` entry routing still lives
5
+ * there.
6
6
  */
7
7
  import { existsSync, mkdirSync, realpathSync } from "node:fs";
8
8
  import { basename, dirname, join, resolve } from "node:path";
9
9
 
10
- import { payloadText } from "../payload";
11
- import { claudeNextSteps, claudeSummary, claudeSync, type ClaudeRuntimeState } from "./claudeSync";
12
- import { preflightClaudeSettings } from "./claudeSettings";
13
- import { codexHome } from "./codexPaths";
14
- import { codexNextSteps, codexSummary, codexSync } from "./codexSync";
15
10
  import type { Ctx } from "./index";
16
11
  import { compareCodepoints } from "./jq";
17
12
  import { acquireKitLock, releaseKitLock, type KitLock } from "./kitLock";
@@ -24,16 +19,11 @@ import {
24
19
  type OmpWriteFolders,
25
20
  } from "./ompSync";
26
21
  import { skillsNextSteps, skillsSummary, skillsSync, type SkillsState } from "./skillsSync";
27
- import { ExitError, parseArgs, validateModifierFlags } from "./parseArgs";
22
+ import { ExitError, parseArgs } from "./parseArgs";
28
23
  import { folderSyncLockPath, syncLockPath } from "./scratch";
29
- import {
30
- runBounded,
31
- syncConcurrencyForManifest,
32
- type SyncConcurrency,
33
- type SyncTask,
34
- } from "./syncConcurrency";
24
+ import { runBounded, type SyncConcurrency, type SyncTask } from "./syncConcurrency";
35
25
 
36
- /** The default time that a sync or a model write waits for another sync to release the sync lock. */
26
+ /** The default time that a sync waits for another sync to release the sync lock. */
37
27
  export const SYNC_LOCK_WAIT_MS = 120_000;
38
28
  const SYNC_LOCK_WAIT_ERROR = "DOCKS_KIT_SYNC_LOCK_WAIT_MS must be a non-negative safe integer";
39
29
 
@@ -107,7 +97,7 @@ async function withKitLocks(
107
97
  * `UNLOCKED_TOKENS`, or `ctx.dryRun` is true. `makeCtx` sets `ctx.dryRun`
108
98
  * from the `DRY_RUN` env global only on the channel that reads env globals.
109
99
  */
110
- export async function withSyncLock(
100
+ async function withSyncLock(
111
101
  ctx: Ctx,
112
102
  args: ReadonlyArray<string>,
113
103
  body: () => Promise<number>,
@@ -143,12 +133,12 @@ export function folderLockPaths(folders: ReadonlyArray<string>): Array<string> {
143
133
 
144
134
  /**
145
135
  * Run `body` under the folder lock of each folder in `folders`. Take it after
146
- * the sync lock. Syncs of different homes can share a Codex, agents, or omp
136
+ * the sync lock. Syncs of different homes can share an agents or omp
147
137
  * folder, and their home locks differ. A missing folder is created under the
148
138
  * locks of its ancestors in the set. A dry run takes no folder lock and
149
139
  * creates nothing.
150
140
  */
151
- export async function withFolderLocks(
141
+ async function withFolderLocks(
152
142
  ctx: Ctx,
153
143
  folders: ReadonlyArray<string>,
154
144
  body: () => Promise<number>,
@@ -186,7 +176,6 @@ export async function engineSync(ctx: Ctx, args: ReadonlyArray<string>): Promise
186
176
  async function runSync(ctx: Ctx, args: ReadonlyArray<string>): Promise<number> {
187
177
  const { err } = ctx.services.logger;
188
178
  parseArgs(ctx, args);
189
- await validateModifierFlags(ctx);
190
179
  const configuredConcurrency = process.env["DOCKS_KIT_SYNC_CONCURRENCY"];
191
180
  if (configuredConcurrency === undefined || configuredConcurrency === "") {
192
181
  ctx.syncConcurrency = 3;
@@ -208,7 +197,6 @@ async function runSync(ctx: Ctx, args: ReadonlyArray<string>): Promise<number> {
208
197
  // data root that appears after the locks cannot move them.
209
198
  const omp = ctx.syncOmp ? ompWriteFolders(ctx) : undefined;
210
199
  const folders = [
211
- ...(ctx.syncCodex ? [codexHome(ctx.home)] : []),
212
200
  ...(ctx.syncAgents ? [resolve(ctx.agentsDir)] : []),
213
201
  ...(omp === undefined ? [] : [omp.paths.agentDir, omp.intercomDir, omp.paths.dataRoot]),
214
202
  ];
@@ -218,12 +206,8 @@ async function runSync(ctx: Ctx, args: ReadonlyArray<string>): Promise<number> {
218
206
  /** Run the selected pipelines. `omp` holds the omp folders when omp is selected. */
219
207
  async function runPipelines(ctx: Ctx, omp: OmpWriteFolders | undefined): Promise<number> {
220
208
  const { acquireTerminal, echo } = ctx.services.logger;
221
- // An abort-class check runs before any pipeline starts, so the abort stops the whole sync.
222
- preflightClaudeSettings(ctx);
223
209
 
224
210
  type PipelineResult =
225
- | { readonly kind: "claude"; readonly runtime: ClaudeRuntimeState }
226
- | { readonly kind: "codex" }
227
211
  | { readonly kind: "skills"; readonly state: SkillsState }
228
212
  | { readonly kind: "omp"; readonly state: OmpState };
229
213
  interface SelectedPipeline {
@@ -232,21 +216,6 @@ async function runPipelines(ctx: Ctx, omp: OmpWriteFolders | undefined): Promise
232
216
  }
233
217
 
234
218
  const selected: Array<SelectedPipeline> = [];
235
- if (ctx.syncClaude) {
236
- selected.push({
237
- name: "Claude",
238
- run: async () => ({ kind: "claude", runtime: await claudeSync(ctx) }),
239
- });
240
- }
241
- if (ctx.syncCodex) {
242
- selected.push({
243
- name: "Codex",
244
- run: async () => {
245
- await codexSync(ctx);
246
- return { kind: "codex" };
247
- },
248
- });
249
- }
250
219
  if (ctx.syncAgents) {
251
220
  selected.push({
252
221
  name: "skills",
@@ -260,14 +229,6 @@ async function runPipelines(ctx: Ctx, omp: OmpWriteFolders | undefined): Promise
260
229
  });
261
230
  }
262
231
 
263
- // A populated skills manifest deploys with `-a claude-code codex`, and symlink healing also writes into Claude's tree.
264
- ctx.syncConcurrency = syncConcurrencyForManifest(
265
- ctx.syncConcurrency,
266
- payloadText("SoT/.agents/skills.txt"),
267
- ctx.syncClaude,
268
- ctx.syncAgents,
269
- );
270
-
271
232
  const remaining = new Set(selected.map(({ name }) => name));
272
233
  const lease = acquireTerminal(`Syncing ${[...remaining].join(", ")}...`);
273
234
  ctx.terminalLease = lease;
@@ -293,28 +254,20 @@ async function runPipelines(ctx: Ctx, omp: OmpWriteFolders | undefined): Promise
293
254
  throw error;
294
255
  }
295
256
 
296
- const claudeRan = ctx.syncClaude;
297
- const codexRan = ctx.syncCodex;
298
- let claudeRuntime: ClaudeRuntimeState | undefined;
299
257
  let skillsState: SkillsState | undefined;
300
258
  let ompState: OmpState | undefined;
301
259
  for (const result of results) {
302
- if (result.kind === "claude") claudeRuntime = result.runtime;
303
- else if (result.kind === "skills") skillsState = result.state;
304
- else if (result.kind === "omp") ompState = result.state;
260
+ if (result.kind === "skills") skillsState = result.state;
261
+ else ompState = result.state;
305
262
  }
306
263
 
307
264
  echo("");
308
265
  echo("--- Sync complete ---");
309
266
  echo(`Repo: ${ctx.repoDir}`);
310
- if (claudeRuntime !== undefined) claudeSummary(ctx, claudeRuntime);
311
- if (codexRan) codexSummary(ctx);
312
267
  if (skillsState !== undefined) skillsSummary(ctx, skillsState);
313
268
  if (ompState !== undefined) ompSummary(ctx, ompState);
314
269
 
315
270
  const advice = [
316
- ...(claudeRan ? claudeNextSteps(ctx) : []),
317
- ...(codexRan ? codexNextSteps(ctx) : []),
318
271
  ...(skillsState !== undefined ? skillsNextSteps(ctx) : []),
319
272
  ...(ompState !== undefined ? ompNextSteps(ctx) : []),
320
273
  ];
@@ -38,8 +38,8 @@ export function isNewer(a: string, b: string): boolean {
38
38
 
39
39
  /**
40
40
  * A readable installed version strictly older than the manifest floor. The
41
- * doctor row and the LSP install gate must agree on that judgement, so both
42
- * ask here rather than re-deriving it.
41
+ * doctor row and `toolchain ensure` must agree on that judgement, so both ask
42
+ * here rather than re-deriving it.
43
43
  */
44
44
  export function belowFloor(installed: string, floor: string): boolean {
45
45
  return installed !== "" && floor !== "" && isNewer(floor, installed);
@@ -57,10 +57,6 @@ function firstLineField(out: string, index: number): string {
57
57
  export async function installedVersion(ctx: Ctx, tool: ToolId): Promise<string> {
58
58
  const version = () => ctx.services.deps.version(tool);
59
59
  switch (tool) {
60
- case "claude":
61
- return firstLineField(await version(), 0);
62
- case "codex":
63
- return firstLineField(await version(), -1);
64
60
  case "git":
65
61
  return firstLineField(await version(), 2);
66
62
  case "node":
@@ -68,22 +64,11 @@ export async function installedVersion(ctx: Ctx, tool: ToolId): Promise<string>
68
64
  case "jq":
69
65
  return (await version()).replace(/^jq-/, "");
70
66
  case "curl":
71
- case "tsc":
72
- // `rust-analyzer --version` prints "rust-analyzer <version>", where the
73
- // version tail also carries a commit and a date in parentheses.
74
- case "rust-analyzer":
75
67
  return firstLineField(await version(), 1);
76
68
  case "bun":
77
69
  case "omp":
78
70
  case "npm":
79
71
  return await version();
80
- case "bwrap":
81
- return firstLineField(await version(), 1);
82
- case "ffplay":
83
- return firstLineField(await version(), 2).replace(/-.*$/, "");
84
- case "intelephense":
85
- case "typescript-language-server":
86
- return (await version()).trim();
87
72
  default:
88
73
  return "";
89
74
  }
@@ -152,9 +137,8 @@ function upstreamSpec(tool: string): JsonObject | undefined {
152
137
  }
153
138
 
154
139
  function upstreamLabel(spec: JsonObject): string {
155
- const { npm, github, line } = spec;
156
- if (typeof npm === "string")
157
- return typeof line === "string" ? `npm ${npm} (${line}.x)` : `npm ${npm}`;
140
+ const { npm, github } = spec;
141
+ if (typeof npm === "string") return `npm ${npm}`;
158
142
  return typeof github === "string" ? `github ${github}` : "-";
159
143
  }
160
144
 
@@ -176,26 +160,7 @@ async function lookupUpstream(
176
160
  fetchImpl: FetchLike,
177
161
  env: NodeJS.ProcessEnv,
178
162
  ): Promise<UpstreamResult> {
179
- const { npm, line, github, tagPrefix } = spec;
180
- if (typeof npm === "string" && typeof line === "string") {
181
- // The registry rejects ranges, so read the packument and pick the newest release on the line.
182
- const result = await fetchJson(fetchImpl, `https://registry.npmjs.org/${npm}`, {
183
- Accept: "application/vnd.npm.install-v1+json",
184
- });
185
- if (!result.ok) return result;
186
- const versions = result.body["versions"];
187
- if (versions === undefined || !isObject(versions))
188
- return { ok: false, reason: "invalid response" };
189
- if (!/^\d+$/.test(line)) return { ok: false, reason: `invalid line ${line}` };
190
- const pattern = new RegExp(`^${line}\\.\\d+\\.\\d+$`);
191
- let newest = "";
192
- for (const version of Object.keys(versions)) {
193
- if (pattern.test(version) && (newest === "" || isNewer(version, newest))) newest = version;
194
- }
195
- return newest === ""
196
- ? { ok: false, reason: `no ${line}.x release` }
197
- : { ok: true, version: newest };
198
- }
163
+ const { npm, github, tagPrefix } = spec;
199
164
  if (typeof npm === "string") {
200
165
  const result = await fetchJson(fetchImpl, `https://registry.npmjs.org/${npm}/latest`, {
201
166
  Accept: "application/json",