docks-kit 0.20.6 → 0.20.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +19 -17
- package/README.md +17 -6
- package/cli/docs/command-guards.md +275 -0
- package/cli/docs/install.md +23 -12
- package/cli/docs/models.md +3 -2
- package/cli/docs/modifiers.md +4 -3
- package/cli/docs/omp-context.md +9 -2
- package/cli/docs/omp-models.md +43 -19
- package/cli/docs/plugins.md +12 -7
- package/cli/docs/sync-layers.md +28 -9
- package/cli/docs/toolchain.md +7 -4
- package/cli/src/argv.ts +2 -0
- package/cli/src/argvSurface.ts +23 -0
- package/cli/src/argvValidate.ts +3 -3
- package/cli/src/commands/docs.ts +6 -1
- package/cli/src/commands/harnesses.ts +15 -4
- package/cli/src/commands/omp.ts +92 -41
- package/cli/src/commands/status.ts +15 -0
- package/cli/src/commands/sync.ts +6 -6
- package/cli/src/commands/toolchain.ts +8 -2
- package/cli/src/commands/update.ts +51 -10
- package/cli/src/engine-native/DESIGN.md +56 -35
- package/cli/src/engine-native/atomicWrite.ts +64 -0
- package/cli/src/engine-native/claudeLsp.ts +9 -2
- package/cli/src/engine-native/claudeOptionalPlugins.ts +19 -6
- package/cli/src/engine-native/claudePluginPasses.ts +77 -21
- package/cli/src/engine-native/claudeRemovals.ts +245 -57
- package/cli/src/engine-native/claudeRetired.ts +1 -1
- package/cli/src/engine-native/claudeSettings.ts +46 -19
- package/cli/src/engine-native/claudeSettingsModifiers.ts +3 -3
- package/cli/src/engine-native/claudeSync.ts +18 -16
- package/cli/src/engine-native/codexConfig.ts +72 -12
- package/cli/src/engine-native/codexHooks.ts +3 -3
- package/cli/src/engine-native/codexPaths.ts +14 -0
- package/cli/src/engine-native/codexPlugins.ts +48 -23
- package/cli/src/engine-native/codexStatus.ts +2 -1
- package/cli/src/engine-native/codexSync.ts +33 -7
- package/cli/src/engine-native/codexToml.ts +161 -35
- package/cli/src/engine-native/deps.ts +4 -9
- package/cli/src/engine-native/engineCtx.ts +42 -14
- package/cli/src/engine-native/exec.ts +28 -1
- package/cli/src/engine-native/harnesses.ts +32 -8
- package/cli/src/engine-native/index.ts +6 -1
- package/cli/src/engine-native/kitDb.ts +12 -6
- package/cli/src/engine-native/liveModels.ts +2 -1
- package/cli/src/engine-native/models.ts +6 -3
- package/cli/src/engine-native/modes.ts +15 -10
- package/cli/src/engine-native/ompFileDeploy.ts +3 -4
- package/cli/src/engine-native/ompMarketplace.ts +9 -7
- package/cli/src/engine-native/ompOverlay.ts +37 -13
- package/cli/src/engine-native/ompPaths.ts +20 -9
- package/cli/src/engine-native/ompPlugins.ts +16 -15
- package/cli/src/engine-native/ompRemovals.ts +125 -30
- package/cli/src/engine-native/ompSync.ts +11 -6
- package/cli/src/engine-native/ompYaml.ts +96 -6
- package/cli/src/engine-native/os/darwin.ts +2 -0
- package/cli/src/engine-native/os/linux.ts +1 -0
- package/cli/src/engine-native/os/posix.ts +17 -5
- package/cli/src/engine-native/os/types.ts +2 -2
- package/cli/src/engine-native/os/windows.ts +24 -16
- package/cli/src/engine-native/skillsInstall.ts +10 -5
- package/cli/src/engine-native/skillsLinks.ts +14 -1
- package/cli/src/engine-native/skillsManifest.ts +20 -0
- package/cli/src/engine-native/skillsPrune.ts +33 -26
- package/cli/src/engine-native/skillsSync.ts +6 -3
- package/cli/src/engine-native/syncDispatch.ts +32 -18
- package/cli/src/engine.ts +29 -3
- package/cli/src/generated/sotPayload.ts +14 -14
- package/cli/src/main.ts +10 -3
- package/cli/src/manifests.ts +29 -11
- package/docks-kit +6 -3
- package/docks-kit.ps1 +22 -11
- package/package.json +1 -1
package/cli/src/engine.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { CliError } from "effect/unstable/cli";
|
|
|
2
2
|
import { Console, Effect } from "effect";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
import { runEngineNative } from "./engine-native";
|
|
5
|
+
import { ENV_GLOBAL_KEYS } from "./engine-native/engineCtx";
|
|
5
6
|
import { ExitError } from "./engine-native/parseArgs";
|
|
6
7
|
import { makeEngineServices } from "./engine-native/services";
|
|
7
8
|
import { targetForHost } from "./engine-native/os/targets";
|
|
@@ -57,7 +58,7 @@ export const engine = (args: ReadonlyArray<string>) =>
|
|
|
57
58
|
const deps = yield* DependencyManagerService;
|
|
58
59
|
const platform = yield* PlatformService;
|
|
59
60
|
const code = yield* Effect.tryPromise({
|
|
60
|
-
try: () => runEngineNative(args, { logger, deps, platform }),
|
|
61
|
+
try: () => runEngineNative(args, { logger, deps, platform }, { envGlobals: false }),
|
|
61
62
|
catch: (error) =>
|
|
62
63
|
new CliError.UserError({
|
|
63
64
|
cause: error,
|
|
@@ -69,6 +70,27 @@ export const engine = (args: ReadonlyArray<string>) =>
|
|
|
69
70
|
}
|
|
70
71
|
});
|
|
71
72
|
|
|
73
|
+
// The capture child must not inherit the env globals or a caller's channel
|
|
74
|
+
// selection in any spelling.
|
|
75
|
+
const CAPTURE_DROPPED_KEYS: ReadonlyArray<string> = [...ENV_GLOBAL_KEYS, "DOCKS_KIT_ENGINE"];
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Build the capture child environment. Windows environment names are
|
|
79
|
+
* case-insensitive, so a key such as `claude_compact_window` also matches
|
|
80
|
+
* there. POSIX names stay case-sensitive.
|
|
81
|
+
*/
|
|
82
|
+
const captureChildEnv = (): NodeJS.ProcessEnv => {
|
|
83
|
+
const foldCase = process.platform === "win32";
|
|
84
|
+
const env: NodeJS.ProcessEnv = {};
|
|
85
|
+
for (const [name, value] of Object.entries(process.env)) {
|
|
86
|
+
if (value === undefined) continue;
|
|
87
|
+
if (CAPTURE_DROPPED_KEYS.includes(foldCase ? name.toUpperCase() : name)) continue;
|
|
88
|
+
env[name] = value;
|
|
89
|
+
}
|
|
90
|
+
env["DOCKS_KIT_ENGINE"] = "native-capture";
|
|
91
|
+
return env;
|
|
92
|
+
};
|
|
93
|
+
|
|
72
94
|
/** Run the engine capturing stdout (engine logs/warns go to stderr and pass through). */
|
|
73
95
|
export const engineCapture = (args: ReadonlyArray<string>) =>
|
|
74
96
|
Effect.gen(function* () {
|
|
@@ -76,14 +98,18 @@ export const engineCapture = (args: ReadonlyArray<string>) =>
|
|
|
76
98
|
if (bashEngineRequested()) {
|
|
77
99
|
return yield* bail(bashRemovedMessage, 2);
|
|
78
100
|
}
|
|
101
|
+
// The child runs the native-capture channel, which ignores env globals even
|
|
102
|
+
// when Bun reloads them from a project `.env`. The child environment also
|
|
103
|
+
// omits them, so a captured public command behaves like an in-process one.
|
|
104
|
+
const childEnv = captureChildEnv();
|
|
79
105
|
const res = yield* Effect.sync(() =>
|
|
80
|
-
// Child process (
|
|
106
|
+
// Child process (capture channel): runEngineNative writes straight to
|
|
81
107
|
// process.stdout, so in-process capture is not possible.
|
|
82
108
|
spawnSync(
|
|
83
109
|
process.execPath,
|
|
84
110
|
compiled ? [...args] : [`${kitHome()}/cli/src/main.ts`, ...args],
|
|
85
111
|
{
|
|
86
|
-
env:
|
|
112
|
+
env: childEnv,
|
|
87
113
|
encoding: "utf8",
|
|
88
114
|
stdio: ["ignore", "pipe", "inherit"],
|
|
89
115
|
},
|