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.
- package/AGENTS.md +35 -81
- package/README.md +31 -58
- package/cli/docs/command-guards.md +231 -197
- package/cli/docs/flags.md +25 -55
- package/cli/docs/install.md +2 -3
- package/cli/docs/omp-context.md +5 -5
- package/cli/docs/omp-models.md +249 -48
- package/cli/docs/overview.md +4 -12
- package/cli/docs/platforms.md +2 -2
- package/cli/docs/sync-layers.md +10 -57
- package/cli/docs/toolchain.md +9 -78
- package/cli/src/argv.ts +0 -8
- package/cli/src/argvValidate.ts +2 -46
- package/cli/src/commands/docs.ts +2 -14
- package/cli/src/commands/harnesses.ts +6 -9
- package/cli/src/commands/sync.ts +5 -99
- package/cli/src/commands/toolchain.ts +4 -12
- package/cli/src/engine-native/DESIGN.md +67 -88
- package/cli/src/engine-native/deps.ts +6 -86
- package/cli/src/engine-native/engineCtx.ts +7 -76
- package/cli/src/engine-native/exec.ts +1 -18
- package/cli/src/engine-native/harnesses.ts +6 -6
- package/cli/src/engine-native/index.ts +4 -6
- package/cli/src/engine-native/jq.ts +4 -37
- package/cli/src/engine-native/modes.ts +3 -132
- package/cli/src/engine-native/ompRemovals.ts +14 -0
- package/cli/src/engine-native/os/darwin.ts +0 -4
- package/cli/src/engine-native/os/index.ts +1 -2
- package/cli/src/engine-native/os/linux.ts +0 -3
- package/cli/src/engine-native/os/posix.ts +2 -46
- package/cli/src/engine-native/os/types.ts +1 -32
- package/cli/src/engine-native/os/windows.ts +0 -49
- package/cli/src/engine-native/parseArgs.ts +11 -124
- package/cli/src/engine-native/parseHelp.ts +5 -40
- package/cli/src/engine-native/scratch.ts +1 -1
- package/cli/src/engine-native/services.ts +1 -2
- package/cli/src/engine-native/sharedTypes.d.ts +0 -40
- package/cli/src/engine-native/skillsSync.ts +1 -1
- package/cli/src/engine-native/syncConcurrency.ts +3 -15
- package/cli/src/engine-native/syncDispatch.ts +10 -57
- package/cli/src/engine-native/toolchain.ts +5 -40
- package/cli/src/engine.ts +0 -75
- package/cli/src/generated/sotPayload.ts +14 -41
- package/cli/src/main.ts +7 -19
- package/cli/src/manifests.ts +1 -93
- package/cli/src/payload.ts +2 -8
- package/cli/tsconfig.json +1 -3
- package/package.json +3 -5
- package/cli/docs/models.md +0 -58
- package/cli/docs/modifiers.md +0 -52
- package/cli/docs/plugins.md +0 -70
- package/cli/src/commands/model.ts +0 -68
- package/cli/src/commands/models.ts +0 -75
- package/cli/src/commands/plugins.ts +0 -35
- package/cli/src/commands/status.ts +0 -206
- package/cli/src/efforts.ts +0 -89
- package/cli/src/engine-native/claudeLsp.ts +0 -301
- package/cli/src/engine-native/claudeOptionalPlugins.ts +0 -126
- package/cli/src/engine-native/claudePluginPasses.ts +0 -426
- package/cli/src/engine-native/claudeRemovals.ts +0 -383
- package/cli/src/engine-native/claudeRetired.ts +0 -165
- package/cli/src/engine-native/claudeRuntime.ts +0 -157
- package/cli/src/engine-native/claudeSettings.ts +0 -201
- package/cli/src/engine-native/claudeSettingsModifiers.ts +0 -115
- package/cli/src/engine-native/claudeSync.ts +0 -312
- package/cli/src/engine-native/codexConfig.ts +0 -214
- package/cli/src/engine-native/codexHooks.ts +0 -91
- package/cli/src/engine-native/codexPaths.ts +0 -14
- package/cli/src/engine-native/codexPlugins.ts +0 -315
- package/cli/src/engine-native/codexStatus.ts +0 -25
- package/cli/src/engine-native/codexSync.ts +0 -314
- package/cli/src/engine-native/codexToml.ts +0 -303
- package/cli/src/engine-native/liveModels.ts +0 -264
- package/cli/src/engine-native/models.ts +0 -101
- package/cli/src/engine-native/parseModifiers.ts +0 -225
- package/cli/src/engine-native/settings.ts +0 -42
- package/cli/src/engine-native/tomlLines.ts +0 -92
package/cli/src/engine.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { CliError } from "effect/cli";
|
|
2
2
|
import { Console, Effect } from "effect";
|
|
3
|
-
import { spawnSync } from "node:child_process";
|
|
4
3
|
import { runEngineNative } from "./engine-native";
|
|
5
|
-
import { ENV_GLOBAL_KEYS } from "./engine-native/engineCtx";
|
|
6
|
-
import { ExitError } from "./engine-native/parseArgs";
|
|
7
|
-
import { makeEngineServices } from "./engine-native/services";
|
|
8
4
|
import { targetForHost } from "./engine-native/os/targets";
|
|
9
|
-
import { kitHome } from "./kitHome";
|
|
10
5
|
import { DependencyManagerService, LoggerService, PlatformService } from "./services";
|
|
11
6
|
|
|
12
7
|
/**
|
|
@@ -32,17 +27,6 @@ const requireSupportedHost = () => {
|
|
|
32
27
|
// executable can be compiled, so absence means false.
|
|
33
28
|
export const compiled: boolean = typeof Bun !== "undefined" && Bun.isStandaloneExecutable === true;
|
|
34
29
|
|
|
35
|
-
export class EngineCaptureError extends ExitError {
|
|
36
|
-
constructor(
|
|
37
|
-
readonly diagnostic: string,
|
|
38
|
-
code: number,
|
|
39
|
-
) {
|
|
40
|
-
super(code);
|
|
41
|
-
this.name = "EngineCaptureError";
|
|
42
|
-
this.message = diagnostic;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
30
|
const failureMessage = (error: unknown): string => {
|
|
47
31
|
if (error instanceof Error && error.message !== "") return error.message;
|
|
48
32
|
return typeof error === "string" && error !== "" ? error : "unknown error";
|
|
@@ -70,65 +54,6 @@ export const engine = (args: ReadonlyArray<string>) =>
|
|
|
70
54
|
}
|
|
71
55
|
});
|
|
72
56
|
|
|
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
|
-
|
|
94
|
-
/** Run the engine capturing stdout (engine logs/warns go to stderr and pass through). */
|
|
95
|
-
export const engineCapture = (args: ReadonlyArray<string>) =>
|
|
96
|
-
Effect.gen(function* () {
|
|
97
|
-
yield* requireSupportedHost();
|
|
98
|
-
if (bashEngineRequested()) {
|
|
99
|
-
return yield* bail(bashRemovedMessage, 2);
|
|
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();
|
|
105
|
-
const res = yield* Effect.sync(() =>
|
|
106
|
-
// Child process (capture channel): runEngineNative writes straight to
|
|
107
|
-
// process.stdout, so in-process capture is not possible.
|
|
108
|
-
spawnSync(
|
|
109
|
-
process.execPath,
|
|
110
|
-
compiled ? [...args] : [`${kitHome()}/cli/src/main.ts`, ...args],
|
|
111
|
-
{
|
|
112
|
-
env: childEnv,
|
|
113
|
-
encoding: "utf8",
|
|
114
|
-
stdio: ["ignore", "pipe", "inherit"],
|
|
115
|
-
},
|
|
116
|
-
),
|
|
117
|
-
);
|
|
118
|
-
if (res.error !== undefined || res.status !== 0) {
|
|
119
|
-
const reasons = new Array<string>();
|
|
120
|
-
if (typeof res.status === "number") reasons.push(`exit ${res.status}`);
|
|
121
|
-
if (res.signal !== null) reasons.push(`signal ${res.signal}`);
|
|
122
|
-
if (res.error !== undefined) reasons.push(`spawn error: ${res.error.message}`);
|
|
123
|
-
if (reasons.length === 0) reasons.push("no child status");
|
|
124
|
-
const diagnostic = `engine capture failed for '${args.join(" ") || "default"}': ${reasons.join("; ")}`;
|
|
125
|
-
makeEngineServices().logger.err(diagnostic);
|
|
126
|
-
const code = typeof res.status === "number" && res.status !== 0 ? res.status : 1;
|
|
127
|
-
return yield* Effect.fail(new EngineCaptureError(diagnostic, code));
|
|
128
|
-
}
|
|
129
|
-
return res.stdout ?? "";
|
|
130
|
-
});
|
|
131
|
-
|
|
132
57
|
/** Print a message to stderr and exit — for CLI-side validation failures. */
|
|
133
58
|
export const bail = (message: string, code = 2) =>
|
|
134
59
|
Console.error(message).pipe(Effect.andThen(Effect.sync(() => process.exit(code))));
|