docks-kit 0.22.28 → 0.24.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 (93) hide show
  1. package/AGENTS.md +42 -89
  2. package/README.md +35 -72
  3. package/cli/docs/command-guards.md +233 -197
  4. package/cli/docs/flags.md +17 -65
  5. package/cli/docs/install.md +2 -3
  6. package/cli/docs/omp-context.md +79 -7
  7. package/cli/docs/omp-models.md +27 -12
  8. package/cli/docs/overview.md +7 -18
  9. package/cli/docs/platforms.md +2 -2
  10. package/cli/docs/sync-layers.md +14 -60
  11. package/cli/docs/toolchain.md +12 -81
  12. package/cli/src/argv.ts +0 -12
  13. package/cli/src/argvValidate.ts +3 -54
  14. package/cli/src/commands/docs.ts +3 -15
  15. package/cli/src/commands/omp.ts +1 -1
  16. package/cli/src/commands/scratch.ts +1 -1
  17. package/cli/src/commands/sync.ts +5 -120
  18. package/cli/src/commands/tidy.ts +1 -1
  19. package/cli/src/commands/toolchain.ts +4 -12
  20. package/cli/src/engine-native/DESIGN.md +69 -100
  21. package/cli/src/engine-native/deps.ts +7 -92
  22. package/cli/src/engine-native/engineCtx.ts +9 -103
  23. package/cli/src/engine-native/exec.ts +1 -18
  24. package/cli/src/engine-native/index.ts +6 -8
  25. package/cli/src/engine-native/jq.ts +4 -37
  26. package/cli/src/engine-native/kitDb.ts +21 -37
  27. package/cli/src/engine-native/modes.ts +3 -132
  28. package/cli/src/engine-native/ompFastMode.ts +1 -1
  29. package/cli/src/engine-native/ompOverlay.ts +1 -1
  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 +1 -1
  33. package/cli/src/engine-native/os/darwin.ts +0 -4
  34. package/cli/src/engine-native/os/index.ts +1 -2
  35. package/cli/src/engine-native/os/linux.ts +0 -3
  36. package/cli/src/engine-native/os/posix.ts +2 -47
  37. package/cli/src/engine-native/os/types.ts +1 -36
  38. package/cli/src/engine-native/os/windows.ts +0 -50
  39. package/cli/src/engine-native/parseArgs.ts +7 -180
  40. package/cli/src/engine-native/parseHelp.ts +4 -44
  41. package/cli/src/engine-native/scratch.ts +1 -1
  42. package/cli/src/engine-native/services.ts +1 -2
  43. package/cli/src/engine-native/sharedTypes.d.ts +1 -41
  44. package/cli/src/engine-native/syncConcurrency.ts +3 -15
  45. package/cli/src/engine-native/syncDispatch.ts +30 -143
  46. package/cli/src/engine-native/toolchain.ts +6 -45
  47. package/cli/src/engine.ts +0 -75
  48. package/cli/src/generated/sotPayload.ts +14 -43
  49. package/cli/src/main.ts +8 -24
  50. package/cli/src/payload.ts +2 -8
  51. package/cli/tsconfig.json +1 -3
  52. package/package.json +3 -5
  53. package/cli/docs/models.md +0 -58
  54. package/cli/docs/modifiers.md +0 -52
  55. package/cli/docs/plugins.md +0 -70
  56. package/cli/src/checklistPrompt.ts +0 -464
  57. package/cli/src/commands/harnesses.ts +0 -80
  58. package/cli/src/commands/model.ts +0 -68
  59. package/cli/src/commands/models.ts +0 -75
  60. package/cli/src/commands/plugins.ts +0 -35
  61. package/cli/src/commands/skills.ts +0 -40
  62. package/cli/src/commands/status.ts +0 -206
  63. package/cli/src/efforts.ts +0 -89
  64. package/cli/src/engine-native/claudeLsp.ts +0 -301
  65. package/cli/src/engine-native/claudeOptionalPlugins.ts +0 -126
  66. package/cli/src/engine-native/claudePluginPasses.ts +0 -426
  67. package/cli/src/engine-native/claudeRemovals.ts +0 -383
  68. package/cli/src/engine-native/claudeRetired.ts +0 -165
  69. package/cli/src/engine-native/claudeRuntime.ts +0 -157
  70. package/cli/src/engine-native/claudeSettings.ts +0 -201
  71. package/cli/src/engine-native/claudeSettingsModifiers.ts +0 -115
  72. package/cli/src/engine-native/claudeSync.ts +0 -312
  73. package/cli/src/engine-native/codexConfig.ts +0 -214
  74. package/cli/src/engine-native/codexHooks.ts +0 -91
  75. package/cli/src/engine-native/codexPaths.ts +0 -14
  76. package/cli/src/engine-native/codexPlugins.ts +0 -315
  77. package/cli/src/engine-native/codexStatus.ts +0 -25
  78. package/cli/src/engine-native/codexSync.ts +0 -314
  79. package/cli/src/engine-native/codexToml.ts +0 -303
  80. package/cli/src/engine-native/harnesses.ts +0 -138
  81. package/cli/src/engine-native/liveModels.ts +0 -264
  82. package/cli/src/engine-native/models.ts +0 -101
  83. package/cli/src/engine-native/parseModifiers.ts +0 -225
  84. package/cli/src/engine-native/settings.ts +0 -42
  85. package/cli/src/engine-native/skillsInstall.ts +0 -135
  86. package/cli/src/engine-native/skillsLinks.ts +0 -216
  87. package/cli/src/engine-native/skillsManifest.ts +0 -36
  88. package/cli/src/engine-native/skillsPrune.ts +0 -117
  89. package/cli/src/engine-native/skillsRecords.ts +0 -138
  90. package/cli/src/engine-native/skillsSync.ts +0 -57
  91. package/cli/src/engine-native/tomlLines.ts +0 -92
  92. package/cli/src/manifests.ts +0 -145
  93. package/cli/src/terminalCells.ts +0 -191
@@ -5,10 +5,8 @@
5
5
  */
6
6
 
7
7
  export type PlatformName = "linux" | "darwin" | "windows" | "unknown";
8
- /** Directory-link mechanisms, tried in order before the copy fallback. */
9
- export type DirectoryLinkKind = "symlink" | "junction";
10
8
  /** Tools whose install command differs per host OS. */
11
- export type HintedTool = "git" | "jq" | "curl" | "ffplay" | "claude" | "codex";
9
+ export type HintedTool = "git" | "jq" | "curl";
12
10
 
13
11
  /** A command plus argv, already shaped for how this host must invoke it. */
14
12
  export interface Invocation {
@@ -18,29 +16,6 @@ export interface Invocation {
18
16
  readonly windowsVerbatimArguments?: boolean;
19
17
  }
20
18
 
21
- /** How this host persists a user-level environment variable. */
22
- export type EnvironmentSetting =
23
- | {
24
- readonly kind: "profile";
25
- /** Home-relative files scanned for an existing setting. */
26
- readonly candidates: ReadonlyArray<string>;
27
- /** Home-relative file that receives the write for this shell; `exists` tests a home-relative file. */
28
- readonly target: (shell: string | undefined, exists: (file: string) => boolean) => string;
29
- /** Line appended to the target file. */
30
- readonly line: string;
31
- }
32
- | {
33
- readonly kind: "command";
34
- /** Exits zero when the variable is already persisted. */
35
- readonly probe: Invocation;
36
- /** Persists the variable. */
37
- readonly apply: Invocation;
38
- /** Where the value lands, named for the log line. */
39
- readonly location: string;
40
- /** Manual recovery when `apply` fails. */
41
- readonly manualHint: string;
42
- };
43
-
44
19
  /** The two steps that fetch and run a pinned Bun installer. */
45
20
  export interface BunInstaller {
46
21
  readonly scriptPath: string;
@@ -52,10 +27,6 @@ export interface HostOs {
52
27
  readonly id: PlatformName;
53
28
  /** `SoT/toolchain.json` `os` field this host matches; "" matches every row. */
54
29
  readonly toolchainOs: string;
55
- /** Bubblewrap is the Linux-only Codex sandbox runtime. */
56
- readonly supportsBubblewrap: boolean;
57
- /** Directory-link mechanisms tried in order before `skillsLinks.ts linkOrCopy` copies. */
58
- readonly directoryLinkKinds: ReadonlyArray<DirectoryLinkKind>;
59
30
  /** One-line install command for a tool whose package differs per OS. */
60
31
  readonly installHint: (tool: HintedTool) => string;
61
32
  /** Filename suffixes tried in order when resolving a bare tool name on PATH. */
@@ -66,10 +37,4 @@ export interface HostOs {
66
37
  readonly bunExecutableName: string;
67
38
  /** Download-then-run installer for a pinned Bun version placed in `directory`. */
68
39
  readonly bunInstaller: (pin: string, directory: string) => BunInstaller;
69
- /** How this host persists a user-level environment variable. */
70
- readonly environmentSetting: (name: string, value: string) => EnvironmentSetting;
71
- /** Claude `statusLine.command` for a resolved bun executable and script. */
72
- readonly statusLineCommand: (bun: string, script: string) => string;
73
- /** Reshape the SoT `PostToolUseFailure` command for this host's shell. */
74
- readonly failureHookCommand: (command: string) => string;
75
40
  }
@@ -2,15 +2,6 @@ import { win32 } from "node:path";
2
2
  import { p } from "../exec";
3
3
  import type { HostOs } from "./types";
4
4
 
5
- function powershellLiteral(value: string): string {
6
- return `'${value.replace(/['\u2018\u2019\u201A\u201B]/g, "$&$&")}'`;
7
- }
8
-
9
- function encodedPowerShellCommand(script: string): string {
10
- const encoded = Buffer.from(script, "utf16le").toString("base64");
11
- return `powershell.exe -NoProfile -NonInteractive -EncodedCommand ${encoded}`;
12
- }
13
-
14
5
  /**
15
6
  * Windows shim encoding handles three hazards: Windows argv parsing, cmd
16
7
  * metacharacter parsing, and percent/newline values that cmd cannot escape.
@@ -101,8 +92,6 @@ function commandShimInvocation(executablePath: string, args: ReadonlyArray<strin
101
92
  export const windows: HostOs = {
102
93
  id: "windows",
103
94
  toolchainOs: "windows",
104
- supportsBubblewrap: false,
105
- directoryLinkKinds: ["symlink", "junction"],
106
95
  executableSuffixes: [".exe", ".cmd", ".bat", ""],
107
96
  invoke: (executablePath, args) =>
108
97
  /\.(?:cmd|bat)$/i.test(executablePath)
@@ -132,39 +121,6 @@ export const windows: HostOs = {
132
121
  },
133
122
  };
134
123
  },
135
- environmentSetting: (name, value) => ({
136
- kind: "command",
137
- probe: {
138
- command: "reg",
139
- args: ["query", "HKCU\\Environment", "/v", name],
140
- },
141
- apply: {
142
- command: "setx",
143
- args: [name, value],
144
- },
145
- location: "user environment",
146
- manualHint: "set it manually in System Properties > Environment Variables",
147
- }),
148
- statusLineCommand: (bun, script) => {
149
- const bunLiteral = powershellLiteral(bun);
150
- const scriptLiteral = powershellLiteral(script);
151
- // Module auto-loading reports "Preparing modules for first use" as a
152
- // progress record, which a redirected host serializes to stderr as CLIXML.
153
- // Claude runs this command every turn, and the records recur across runs, so
154
- // silencing progress inside the stored command keeps its streams clean.
155
- return encodedPowerShellCommand(
156
- `$ProgressPreference = 'SilentlyContinue'; if ((Test-Path -LiteralPath ${bunLiteral} -PathType Leaf) -and (Test-Path -LiteralPath ${scriptLiteral} -PathType Leaf)) { & ${bunLiteral} ${scriptLiteral} }`,
157
- );
158
- },
159
- failureHookCommand: (command) => {
160
- const prefix = "echo '";
161
- if (!command.startsWith(prefix) || !command.endsWith("'")) return command;
162
- const quotedPayload = command.slice(prefix.length, -1);
163
- const posixApostrophe = `'"'"'`;
164
- if (quotedPayload.replaceAll(posixApostrophe, "").includes("'")) return command;
165
- const payload = quotedPayload.replaceAll(posixApostrophe, "'");
166
- return encodedPowerShellCommand(`Write-Output ${powershellLiteral(payload)}`);
167
- },
168
124
  installHint: (tool) => {
169
125
  switch (tool) {
170
126
  case "git":
@@ -173,12 +129,6 @@ export const windows: HostOs = {
173
129
  return "winget install --id jqlang.jq -e";
174
130
  case "curl":
175
131
  return "winget install --id cURL.cURL -e";
176
- case "ffplay":
177
- return "winget install --id Gyan.FFmpeg -e";
178
- case "claude":
179
- return "$tmp = Join-Path $env:TEMP 'claude-install.ps1'; curl.exe -fsSL https://claude.ai/install.ps1 -o $tmp; if ($LASTEXITCODE -eq 0) { powershell.exe -NoProfile -ExecutionPolicy Bypass -File $tmp }";
180
- case "codex":
181
- return "$tmp = Join-Path $env:TEMP 'codex-install.ps1'; curl.exe -fsSL https://chatgpt.com/codex/install.ps1 -o $tmp; if ($LASTEXITCODE -eq 0) { $env:CODEX_NON_INTERACTIVE = '1'; powershell.exe -NoProfile -ExecutionPolicy Bypass -File $tmp }";
182
132
  }
183
133
  },
184
134
  };
@@ -1,206 +1,33 @@
1
1
  /**
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).
2
+ * EngineNative flag layer: the argv dispatch loop of `docks-kit sync`.
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 { ExitError, printUsage } from "./parseHelp";
21
8
 
22
9
  export { ExitError } from "./parseHelp";
23
- export {
24
- KNOWN_CLAUDE_OPTIN_PLUGINS,
25
- parseClaudePlugin,
26
- parseCompactWindow,
27
- validateModifierFlags,
28
- } from "./parseModifiers";
29
-
30
- type TargetFlag = "syncClaude" | "syncCodex" | "syncAgents" | "syncOmp";
31
-
32
- const TARGET_FLAGS = {
33
- claude: "syncClaude",
34
- codex: "syncCodex",
35
- agents: "syncAgents",
36
- omp: "syncOmp",
37
- } satisfies Record<Harness, TargetFlag>;
38
-
39
- /**
40
- * The rename hint for each retired sync flag. The engine prints it here, and
41
- * the public CLI layer (`argvValidate.ts`) rejects the same flag with the same
42
- * text, so the two paths cannot drift.
43
- */
44
- 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
- "--agents": "--agents was renamed: pass the target as a word, e.g. 'sync agents'",
48
- "--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",
57
- } as const satisfies Record<string, string>;
58
-
59
- type LegacyFlag = keyof typeof LEGACY_FLAG_HINTS;
60
-
61
- /** Own-key check, so a word such as `constructor` never reads an Object prototype member. */
62
- export const isLegacyFlag = (flag: string): flag is LegacyFlag =>
63
- Object.hasOwn(LEGACY_FLAG_HINTS, flag);
64
-
65
- function selectTarget(ctx: Ctx, target: Harness): void {
66
- ctx[TARGET_FLAGS[target]] = true;
67
- ctx.targetFilterSet = true;
68
- }
69
-
70
- function applySelection(ctx: Ctx, selection: ReadonlyArray<Harness>): void {
71
- ctx.syncClaude = selection.includes("claude");
72
- ctx.syncCodex = selection.includes("codex");
73
- ctx.syncAgents = selection.includes("agents");
74
- ctx.syncOmp = selection.includes("omp");
75
- }
76
-
77
- function applyDefaultSelection(ctx: Ctx): void {
78
- if (ctx.targetFilterSet) return;
79
-
80
- const storedSelection = readHarnessSelection(ctx.home);
81
- applySelection(ctx, storedSelection ?? LEGACY_SELECTION);
82
- if (storedSelection !== undefined || !ctx.interactive) return;
83
-
84
- ctx.services.logger.echo("No harness selection stored; syncing claude, codex, agents");
85
- ctx.services.logger.echo("Choose harnesses with: docks-kit harnesses");
86
- }
87
10
 
88
11
  export function parseArgs(ctx: Ctx, args: ReadonlyArray<string>): void {
89
12
  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
- }
13
+ for (const arg of args) {
97
14
  switch (arg) {
98
- case "claude":
99
- case "codex":
100
- case "agents":
101
- case "omp":
102
- selectTarget(ctx, arg);
103
- continue;
104
15
  case "--dry-run":
105
16
  ctx.dryRun = true;
106
17
  continue;
107
- case "--skip-bubblewrap":
108
- ctx.skipBubblewrap = true;
109
- continue;
110
18
  case "--skip-plugin-refresh":
111
19
  ctx.skipPluginRefresh = true;
112
20
  continue;
113
- case "--reconcile":
114
- ctx.reconcile = true;
115
- continue;
116
- case "--prune":
117
- ctx.prune = true;
118
- continue;
119
21
  case "--verbose":
120
22
  ctx.verbose = true;
121
23
  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
- case "--agents":
159
- case "--omp":
160
- case "--force":
161
- case "--remove-plugins":
162
- case "--680k":
163
- case "--permissive":
164
- case "--supabase":
165
- case "--n8n":
166
- case "--skip-rtk":
167
- err(LEGACY_FLAG_HINTS[arg]);
168
- throw new ExitError(2);
169
24
  case "-h":
170
25
  case "--help":
171
- printUsage(ctx, KNOWN_CLAUDE_OPTIN_PLUGINS);
26
+ printUsage(ctx);
172
27
  throw new ExitError(0);
173
28
  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)");
29
+ err(`Unknown arg: ${arg}`);
190
30
  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
31
  }
203
32
  }
204
-
205
- applyDefaultSelection(ctx);
206
33
  }
@@ -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,15 @@ 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]`);
24
- echo("");
25
- 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
- echo(" agents sync universal agent skills");
29
- echo(" omp sync the Oh My Pi SoT");
18
+ echo(`Usage: ${argv0} [flags]`);
30
19
  echo("");
31
20
  echo("Global flags");
32
21
  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)");
40
22
  echo(" --skip-plugin-refresh install missing plugins but skip refresh-only updates");
41
23
  echo(
42
24
  " --verbose also print no-op confirmations (already in sync, up to date, left as-is)",
43
25
  );
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
26
  }
@@ -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 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,42 +4,12 @@
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
- * omp session model (moved from harnesses.ts, which re-exports it so existing
12
+ * omp session model (moved from ompSession.ts, which re-exports it so existing
43
13
  * import paths keep working).
44
14
  */
45
15
  export interface OmpSessionModel {
@@ -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>;
@@ -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 bounded-concurrency runner, which tidy and the tidy report use
3
+ * for their parallel probes. index.ts re-exports it so existing import paths
4
+ * keep 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
- }