@knyazevai/dsh 0.1.4 → 0.1.5

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.
@@ -0,0 +1,128 @@
1
+ import { t as INSTALL_ANCHOR } from "./profile-boot-CuWvAMzG.js";
2
+ import { existsSync } from "node:fs";
3
+ import { DEFAULT_PROFILE_BUNDLES, PROFILE_TEMPLATES, initProfile, readProfileManifest, resolveBundleDir, resolveProfileDir, writeProfileManifest } from "@knyazevai/dsh-app-boot";
4
+ import { join, resolve } from "node:path";
5
+ import { spawnSync } from "node:child_process";
6
+ //#region lib/types/plugin.js
7
+ /**
8
+ * `dsh plugin --profile <name> <args...>` — profile plugin management as a
9
+ * thin pnpm forwarder: initialize the profile on first use, run
10
+ * `pnpm <args...>` in the profile directory, then reconcile the
11
+ * `dsh.profile.bundles` layer list against the installed state (a dependency
12
+ * resolving to a package that declares `dsh.bundle` joins the layer stack; a
13
+ * removed or bundle-less dependency leaves it). Reconciling by installed
14
+ * state, not by dependency diff, means `update` activates a package that
15
+ * gained its `dsh.bundle` declaration in a newer version.
16
+ * @module @knyazevai/dsh/plugin
17
+ */
18
+ const NAME = "dsh";
19
+ /**
20
+ * Whether a resolved dependency exports a profile patch, i.e. is a bundle.
21
+ * @param packageName - the dependency's package name.
22
+ * @param profileDir - the profile directory (resolution anchor).
23
+ * @returns true when the package manifest declares `dsh.bundle`.
24
+ */
25
+ function exportsPatch(packageName, profileDir) {
26
+ let dir;
27
+ try {
28
+ dir = resolveBundleDir(NAME, packageName, INSTALL_ANCHOR, profileDir);
29
+ } catch {
30
+ return false;
31
+ }
32
+ return readProfileManifest(NAME, dir).dsh?.bundle?.patch !== void 0;
33
+ }
34
+ /**
35
+ * Reconcile `dsh.profile.bundles` against the installed state: pnpm has
36
+ * already written the real installed names (so a git/path/tarball/alias spec
37
+ * on the command line reconciles by its true package name) and materialized
38
+ * the packages. A dependency that resolves to a `dsh.bundle`-declaring
39
+ * package joins the layer stack (appended in dependency order); a
40
+ * dependency-listed name that no longer does — removed, or the installed
41
+ * version dropped the declaration — leaves it. In-box bundles from the
42
+ * profile template are not dependencies and are never touched. Warns once
43
+ * per newly-added bundle-less dependency (a plain library is fine; the
44
+ * warning is orientation).
45
+ */
46
+ function reconcilePlugins(before, profileDir) {
47
+ const after = readProfileManifest(NAME, profileDir);
48
+ const beforeDeps = new Set(Object.keys(before.dependencies ?? {}));
49
+ const dependencies = Object.keys(after.dependencies ?? {});
50
+ const plugins = after.dsh?.profile?.bundles ?? [];
51
+ let changed = false;
52
+ for (const packageName of dependencies) {
53
+ const isBundle = exportsPatch(packageName, profileDir);
54
+ if (isBundle && !plugins.includes(packageName)) {
55
+ plugins.push(packageName);
56
+ changed = true;
57
+ } else if (!isBundle && !beforeDeps.has(packageName)) process.stderr.write(`${NAME}: warning: ${packageName} declares no dsh.bundle — installed as a plain dependency, not a profile layer (a later update that gains one activates it automatically)
58
+ `);
59
+ }
60
+ const dependencySet = new Set(dependencies);
61
+ for (const packageName of [...plugins]) {
62
+ const wasDependency = beforeDeps.has(packageName) || dependencySet.has(packageName);
63
+ const stillBundle = dependencySet.has(packageName) && exportsPatch(packageName, profileDir);
64
+ if (wasDependency && !stillBundle) {
65
+ plugins.splice(plugins.indexOf(packageName), 1);
66
+ changed = true;
67
+ }
68
+ }
69
+ if (!changed) return;
70
+ after.dsh = {
71
+ ...after.dsh,
72
+ profile: {
73
+ ...after.dsh?.profile,
74
+ bundles: plugins
75
+ }
76
+ };
77
+ writeProfileManifest(profileDir, after);
78
+ }
79
+ /**
80
+ * Rewrite relative filesystem specs against the user's invoking directory.
81
+ * pnpm runs with cwd = the profile directory, so a bare `.` or `../plugin`
82
+ * (or their `file:`/`link:` forms) would silently resolve inside the profile
83
+ * — `add .` from a plugin checkout would self-link the profile. Absolute
84
+ * specs, registry names, and every other pnpm argument pass through
85
+ * untouched.
86
+ * @param argument - one pnpm argument, verbatim from argv.
87
+ * @param cwd - the directory `dsh` was invoked from.
88
+ * @returns the argument with a relative path spec anchored to `cwd`.
89
+ */
90
+ function anchorPathSpec(argument, cwd) {
91
+ const match = /^(?<prefix>(?:file|link):)?(?<path>\.{1,2}(?:[/\\].*)?)$/.exec(argument);
92
+ if (match?.groups?.path === void 0) return argument;
93
+ return `${match.groups.prefix ?? ""}${resolve(cwd, match.groups.path)}`;
94
+ }
95
+ /**
96
+ * Run one `dsh plugin` invocation: init if needed, forward to pnpm, reconcile.
97
+ * @param profile - the profile name.
98
+ * @param args - pnpm arguments with relative path specs anchored to the invoking directory.
99
+ * @returns the pnpm exit code.
100
+ */
101
+ function runPlugin(profile, args) {
102
+ const dir = resolveProfileDir(profile);
103
+ const isNewProfile = !existsSync(join(dir, "package.json"));
104
+ initProfile(dir, PROFILE_TEMPLATES[profile] ?? DEFAULT_PROFILE_BUNDLES);
105
+ if (isNewProfile) process.stderr.write(`${NAME}: initialized profile ${profile} at ${dir}\n`);
106
+ const before = readProfileManifest(NAME, dir);
107
+ const result = spawnSync("pnpm", args.map((argument) => anchorPathSpec(argument, process.cwd())), {
108
+ cwd: dir,
109
+ stdio: "inherit",
110
+ shell: process.platform === "win32"
111
+ });
112
+ if (result.error !== void 0) {
113
+ if (result.error.code === "ENOENT") {
114
+ process.stderr.write(`${NAME}: pnpm not found on PATH — install pnpm to manage profile plugins\n`);
115
+ return 127;
116
+ }
117
+ throw result.error;
118
+ }
119
+ const exitCode = result.status ?? 1;
120
+ if (exitCode === 0) reconcilePlugins(before, dir);
121
+ else {
122
+ process.stderr.write(`${NAME}: pnpm failed in profile directory ${dir}\n`);
123
+ if (args.some((argument) => /^git\+|^github:|\.git(?:#|$)/.test(argument))) process.stderr.write(`${NAME}: git-hosted plugins build on install via their prepare script, which pnpm blocks until allowed — add the exact key pnpm printed above under allowBuilds in ${join(dir, "pnpm-workspace.yaml")}, then re-run\n`);
124
+ }
125
+ return exitCode;
126
+ }
127
+ //#endregion
128
+ export { runPlugin };
@@ -0,0 +1,2 @@
1
+ import { o as runProfile } from "./profile-boot-CuWvAMzG.js";
2
+ export { runProfile };
@@ -0,0 +1,283 @@
1
+ import { writeFileSync } from "node:fs";
2
+ import { fileURLToPath } from "node:url";
3
+ import { PROFILE_PATCH_FILENAME, boot, composeEntries, healProfilesModuleFallback, installFailLoud, loadOptionalPatches, loadOverlayPatches, loadProfile, watchUserPatches } from "@knyazevai/dsh-app-boot";
4
+ import { join, resolve } from "node:path";
5
+ import { resolveDshHome } from "@knyazevai/dsh-home-paths";
6
+ import { DSH_LAUNCH_ENVIRONMENT_KEY } from "@knyazevai/dsh-launch-environment";
7
+ import { provideCmdline } from "@knyazevai/dsh-cmdline";
8
+ //#region lib/types/process-shutdown.js
9
+ /** Bounded, escalating process shutdown for the long-lived CLI surfaces. */
10
+ /** Maximum grace allowed for the application tree to dispose before process exit. */
11
+ const PROCESS_SHUTDOWN_TIMEOUT_MS = 5e3;
12
+ /**
13
+ * Create one process-exit controller around an application disposer.
14
+ * @param dispose - Whole-application teardown that resolves at quiescence.
15
+ * @param forceExit - Function that exits the process immediately, replaceable by tests.
16
+ * @param complete - Function that records the natural completion code, replaceable by tests.
17
+ * @param timeoutMs - Grace before forced exit, replaceable by tests.
18
+ * @returns A controller whose normal calls coalesce and whose repeated signal call escalates.
19
+ */
20
+ function createProcessShutdown(dispose, forceExit = (code) => {
21
+ process.exit(code);
22
+ }, complete = (code) => {
23
+ process.exitCode = code;
24
+ }, timeoutMs = PROCESS_SHUTDOWN_TIMEOUT_MS) {
25
+ let pending;
26
+ let timeout;
27
+ let completed = false;
28
+ let forceExited = false;
29
+ const clearExitTimeout = () => {
30
+ /* v8 ignore else -- shutdown() arms the timer before any asynchronous exit path can run. */
31
+ if (timeout !== void 0) clearTimeout(timeout);
32
+ };
33
+ const forceExitOnce = (code) => {
34
+ if (forceExited) return;
35
+ forceExited = true;
36
+ clearExitTimeout();
37
+ forceExit(code);
38
+ };
39
+ const completeOnce = (code) => {
40
+ if (completed || forceExited) return;
41
+ completed = true;
42
+ clearExitTimeout();
43
+ complete(code);
44
+ };
45
+ const start = (code, forceAfterDispose) => {
46
+ if (pending !== void 0) return pending;
47
+ timeout = setTimeout(() => {
48
+ forceExitOnce(code);
49
+ }, timeoutMs);
50
+ pending = Promise.resolve().then(dispose).then(() => {
51
+ if (forceAfterDispose) forceExitOnce(code);
52
+ else completeOnce(code);
53
+ }, () => {
54
+ forceExitOnce(code);
55
+ });
56
+ return pending;
57
+ };
58
+ return {
59
+ shutdown(code) {
60
+ return start(code, false);
61
+ },
62
+ interrupt(code) {
63
+ if (pending !== void 0) {
64
+ forceExitOnce(code);
65
+ return;
66
+ }
67
+ start(code, true);
68
+ }
69
+ };
70
+ }
71
+ //#endregion
72
+ //#region lib/types/profile-boot.js
73
+ /**
74
+ * Shared profile boot for every `dsh` surface: resolve the profile, stack its
75
+ * patch layers (bundle layers in `dsh.profile.bundles` order, the profile's
76
+ * own `cordis.patch.yml`, `--patch` overlays, the telemetry switch), mount the
77
+ * tree over the profile's empty root config, keep the profile patch layer
78
+ * live, and wire fail-loud plus bounded shutdown.
79
+ *
80
+ * App flags are not the launcher's business: the invocation's inner arguments
81
+ * are provided to the tree through `ctx.cmdlineArgs`, where any injected app
82
+ * plugin may read the same immutable snapshot.
83
+ * @module @knyazevai/dsh/profile-boot
84
+ */
85
+ /** Shipped agent-preset root: beside this app's own config, in both source and built layouts. */
86
+ const SHIPPED_PRESET_ROOT = fileURLToPath(new URL("../config/agent-presets/", import.meta.url));
87
+ const NAME = "dsh";
88
+ /**
89
+ * The home-level user patch layer (`$DSH_HOME/cordis.patch.yml`), applied
90
+ * over every profile's own layer. Resolved per call, not at module load:
91
+ * `$DSH_HOME` may be set by the test or launcher after import.
92
+ * @returns the absolute patch-file path.
93
+ */
94
+ function homePatchPath() {
95
+ return join(resolveDshHome(), PROFILE_PATCH_FILENAME);
96
+ }
97
+ /** Absolute path of this dsh installation's package.json (both anchors: src/ and lib/ sit one level under apps/cli). */
98
+ const INSTALL_ANCHOR = fileURLToPath(new URL("../package.json", import.meta.url));
99
+ /** The session-telemetry row id the DSH_TELEMETRY_DISABLED switch targets. */
100
+ const TELEMETRY_ROW_ID = "session-telemetry-otel";
101
+ /** The empty root entry list every profile tree patches over. */
102
+ const PROFILE_ROOT_CONFIG = `# dsh profile root — an empty entry list. The tree is composed as patches:
103
+ # each bundle in package.json's dsh.profile.bundles, then cordis.patch.yml, then any
104
+ # --patch overlays. Edit cordis.patch.yml, not this file.
105
+ []
106
+ `;
107
+ /** Root config filename inside a profile directory. */
108
+ const PROFILE_ROOT_FILENAME = "cordis.yml";
109
+ /**
110
+ * Resolve the telemetry opt-out switch into its boot patch. ANY non-empty
111
+ * value (including `'0'`/`'false'`) disables: a privacy switch prefers
112
+ * off-by-mistake over on-by-mistake. A composition without the telemetry row
113
+ * exports nothing, so the switch is then trivially satisfied and no patch is
114
+ * generated — custom profiles need not mount telemetry to run with the
115
+ * switch set.
116
+ * @param disabledEnv - the raw `DSH_TELEMETRY_DISABLED` value (`undefined` when unset).
117
+ * @param hasRow - whether the composition carries the telemetry row.
118
+ * @returns the disable patch, or `undefined` when no hard-disable patch is required.
119
+ */
120
+ function resolveTelemetryPatch(disabledEnv, hasRow) {
121
+ if ((disabledEnv ?? "") === "" || !hasRow) return void 0;
122
+ return {
123
+ id: TELEMETRY_ROW_ID,
124
+ disabled: true
125
+ };
126
+ }
127
+ /**
128
+ * Load a resolved profile for `name`: heal the shared module fallback, then
129
+ * (re)write the empty root config. The root is always rewritten: the whole
130
+ * composition is patch layers, and the vendored Loader's tree write-back (a
131
+ * plugin self-disposing persists the current tree) can bake composed rows
132
+ * into this file — which would duplicate every bundle insert on the next
133
+ * boot. The file exists on disk only because the Loader needs a real include
134
+ * root to anchor `baseUrl` at the profile directory (the config dump anchors
135
+ * on the same file, so both compose over the identical base).
136
+ * @param name - the profile name.
137
+ * @param userLayer - `false` skips parsing `cordis.patch.yml` (the default dump).
138
+ * @returns the loaded profile.
139
+ */
140
+ function prepareProfile(name, userLayer = true) {
141
+ healProfilesModuleFallback(INSTALL_ANCHOR);
142
+ const profile = loadProfile(NAME, name, INSTALL_ANCHOR, void 0, { userLayer });
143
+ writeFileSync(join(profile.dir, PROFILE_ROOT_FILENAME), PROFILE_ROOT_CONFIG);
144
+ return profile;
145
+ }
146
+ /** The full patch stack of one composed profile, in application order. */
147
+ function allPatches(composed) {
148
+ return [
149
+ ...composed.bundlePatches,
150
+ ...composed.profile.patches,
151
+ ...composed.homePatches,
152
+ ...composed.overlays
153
+ ];
154
+ }
155
+ /**
156
+ * Load `name` and compose its effective patch stack: bundle layers in
157
+ * `dsh.profile.bundles` order (the base bundle gates the shell stacks by
158
+ * platform on its own rows), the profile's user layer, the home-level user
159
+ * layer (`$DSH_HOME/cordis.patch.yml` — machine-local preferences that apply
160
+ * to every profile, so it outranks the per-profile layer), `--patch` overlays,
161
+ * then the telemetry switch.
162
+ * @param name - the profile name.
163
+ * @param patchFiles - `--patch` overlay paths, in argv order.
164
+ * @returns the profile, its patch layers, and the composed row index.
165
+ */
166
+ function composeProfile(name, patchFiles) {
167
+ const profile = prepareProfile(name);
168
+ const homePatches = loadOptionalPatches(NAME, homePatchPath()) ?? [];
169
+ const overlays = patchFiles.flatMap((file) => loadOverlayPatches(NAME, resolve(file)));
170
+ const bundlePatches = profile.layers.flatMap((layer) => layer.patches);
171
+ const rows = /* @__PURE__ */ new Map();
172
+ for (const row of composeEntries([
173
+ bundlePatches,
174
+ profile.patches,
175
+ homePatches,
176
+ overlays
177
+ ])) if (typeof row.id === "string") rows.set(row.id, row);
178
+ const composedOverlays = [...overlays];
179
+ if (rows.has("agent-presets")) composedOverlays.push({
180
+ id: "agent-presets",
181
+ config: {
182
+ ...rows.get("agent-presets")?.config ?? {},
183
+ roots: [{
184
+ path: SHIPPED_PRESET_ROOT,
185
+ trust: "system"
186
+ }]
187
+ }
188
+ });
189
+ const telemetryPatch = resolveTelemetryPatch(process.env.DSH_TELEMETRY_DISABLED, rows.has(TELEMETRY_ROW_ID));
190
+ if (telemetryPatch !== void 0) composedOverlays.push(telemetryPatch);
191
+ return {
192
+ profile,
193
+ bundlePatches,
194
+ homePatches,
195
+ overlays: composedOverlays,
196
+ rows
197
+ };
198
+ }
199
+ /**
200
+ * Re-throw a watcher-setup failure unless a shutdown already owns the tree:
201
+ * a signal aborted this invocation, or an app requested exit (`ctx.appExit`
202
+ * from a fast one-shot) and the root's disposal rejected the in-flight setup
203
+ * await. Either way the failure describes a tree that is exiting as asked,
204
+ * not a broken watch.
205
+ * @param ctx - the booted root context.
206
+ * @param signal - this invocation's signal-shutdown fact.
207
+ * @param error - the setup failure.
208
+ */
209
+ function suppressShutdownError(ctx, signal, error) {
210
+ if (signal.aborted) return;
211
+ if (ctx.fiber.state !== 2 || ctx.get("loader") === void 0) return;
212
+ throw error;
213
+ }
214
+ /**
215
+ * Boot one profile invocation end to end and leave process lifetime to the
216
+ * mounted plugins (or to a one-shot runner the composition mounts).
217
+ * @param options - environment snapshot, profile name, overlays, and the booted app's own arguments.
218
+ * @returns the settled root context and the shutdown controller.
219
+ */
220
+ async function runProfile(options) {
221
+ const composed = composeProfile(options.profile, options.patchFiles);
222
+ const app = {};
223
+ const shutdown = createProcessShutdown(async () => {
224
+ await app.current?.fiber.dispose();
225
+ });
226
+ const signalShutdown = new AbortController();
227
+ const interrupt = (code) => {
228
+ signalShutdown.abort();
229
+ shutdown.interrupt(code);
230
+ };
231
+ process.on("SIGTERM", () => {
232
+ interrupt(0);
233
+ });
234
+ process.on("SIGINT", () => {
235
+ interrupt(130);
236
+ });
237
+ installFailLoud(NAME, process, async () => {
238
+ await app.current?.fiber.dispose();
239
+ });
240
+ const rootConfig = join(composed.profile.dir, PROFILE_ROOT_FILENAME);
241
+ const composeLive = () => structuredClone([
242
+ ...composed.bundlePatches,
243
+ ...loadOptionalPatches(NAME, composed.profile.patchPath) ?? [],
244
+ ...loadOptionalPatches(NAME, homePatchPath()) ?? [],
245
+ ...composed.overlays
246
+ ]);
247
+ const ctx = await boot(NAME, rootConfig, structuredClone(allPatches(composed)), (hostCtx) => {
248
+ app.current = hostCtx;
249
+ hostCtx.provide(DSH_LAUNCH_ENVIRONMENT_KEY, options.environment);
250
+ provideCmdline(hostCtx, {
251
+ args: options.args,
252
+ exit: (code) => void shutdown.shutdown(code)
253
+ });
254
+ });
255
+ app.current = ctx;
256
+ if (!signalShutdown.signal.aborted && ctx.fiber.state === 2 && ctx.get("loader") !== void 0) try {
257
+ if (ctx.get("hmr") === void 0) {
258
+ if (ctx.get("timer") === void 0) await ctx.loader.create({ name: "@deepseek-ai/cordis-plugin-timer" });
259
+ await ctx.loader.create({
260
+ name: "@deepseek-ai/cordis-plugin-hmr",
261
+ config: { root: [] }
262
+ });
263
+ }
264
+ await watchUserPatches(ctx, {
265
+ binName: NAME,
266
+ filename: composed.profile.patchPath,
267
+ compose: composeLive
268
+ });
269
+ await watchUserPatches(ctx, {
270
+ binName: NAME,
271
+ filename: homePatchPath(),
272
+ compose: composeLive
273
+ });
274
+ } catch (error) {
275
+ suppressShutdownError(ctx, signalShutdown.signal, error);
276
+ }
277
+ return {
278
+ ctx,
279
+ shutdown
280
+ };
281
+ }
282
+ //#endregion
283
+ export { resolveTelemetryPatch as a, prepareProfile as i, PROFILE_ROOT_FILENAME as n, runProfile as o, homePatchPath as r, INSTALL_ANCHOR as t };
package/package.json CHANGED
@@ -1,43 +1,108 @@
1
1
  {
2
2
  "name": "@knyazevai/dsh",
3
- "version": "0.1.4",
4
- "description": "DeepSeek Harness plugin: Knyazev AI models with thinking and effort",
5
- "type": "module",
6
- "license": "MIT",
3
+ "description": "dsh CLI: profile boot, plugin management, and the browser UI alias",
4
+ "version": "0.1.5",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
7
8
  "repository": {
8
9
  "type": "git",
9
- "url": "https://github.com/knyazev741/knyazevai-dsh.git"
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "apps/cli"
10
12
  },
11
- "homepage": "https://knyazevai.work/docs",
12
- "bugs": {
13
- "url": "https://git.knyazevai.work/knyaz/knyazevai-dsh/issues"
13
+ "type": "module",
14
+ "engines": {
15
+ "node": "^22.19.0 || >=24.0.0"
14
16
  },
15
- "publishConfig": {
16
- "access": "public"
17
+ "bin": {
18
+ "dsh": "bin.mjs"
17
19
  },
18
20
  "files": [
19
- "cordis.patch.yml",
20
- "lib",
21
- "README.md"
21
+ "bin.mjs",
22
+ "lib/*.js",
23
+ "config"
22
24
  ],
23
- "exports": {
24
- ".": "./lib/provider.js",
25
- "./cordis.patch.yml": "./cordis.patch.yml",
26
- "./package.json": "./package.json"
27
- },
28
- "dsh": {
29
- "bundle": {
30
- "patch": "./cordis.patch.yml"
31
- }
32
- },
33
- "scripts": {
34
- "test": "node --test test/*.test.js",
35
- "prepublishOnly": "npm test"
25
+ "license": "MIT",
26
+ "dependencies": {
27
+ "commander": "^15.0.0",
28
+ "js-yaml": "^4.2.0",
29
+ "node-addon-require-builtin": "^0.1.4",
30
+ "@deepseek-ai/cordis-plugin-include": "^1.0.6",
31
+ "@deepseek-ai/cordis-plugin-timer": "^1.1.3",
32
+ "@deepseek-ai/cordis-plugin-hmr": "^1.0.16",
33
+ "@deepseek-ai/cordis-plugin-loader": "^1.0.2",
34
+ "@knyazevai/dsh-app-boot": "^0.1.5",
35
+ "@knyazevai/dsh-agent-tool-presentation": "^0.1.5",
36
+ "@knyazevai/dsh-base": "^0.1.5",
37
+ "@knyazevai/dsh-command-compact": "^0.1.5",
38
+ "@knyazevai/dsh-client-ui-agent-preset": "^0.1.5",
39
+ "@knyazevai/dsh-client-ui-cordis": "^0.1.5",
40
+ "@knyazevai/dsh-compaction-basic": "^0.1.5",
41
+ "@knyazevai/dsh-compaction-tool-result-pruner": "^0.1.5",
42
+ "@knyazevai/dsh-goal": "^0.1.5",
43
+ "@knyazevai/dsh-cmdline": "^0.1.5",
44
+ "@knyazevai/dsh-goal-round-driver": "^0.1.5",
45
+ "@knyazevai/dsh-command-goal": "^0.1.5",
46
+ "@knyazevai/dsh-cordis-client-runner": "^0.1.5",
47
+ "@knyazevai/dsh-launch-environment": "^0.1.5",
48
+ "@knyazevai/dsh-fork-base": "^0.1.5",
49
+ "@knyazevai/dsh-fork-web": "^0.1.5",
50
+ "@knyazevai/dsh-mcp-client": "^0.1.5",
51
+ "@knyazevai/dsh-home-paths": "^0.1.5",
52
+ "@knyazevai/dsh-persona": "^0.1.5",
53
+ "@knyazevai/dsh-plan-mode": "^0.1.5",
54
+ "@knyazevai/dsh-headless": "^0.1.5",
55
+ "@knyazevai/dsh-terminal": "^0.1.5",
56
+ "@knyazevai/dsh-terminal-bash": "^0.1.5",
57
+ "@knyazevai/dsh-fs-local": "^0.1.5",
58
+ "@knyazevai/dsh-pwsh-local": "^0.1.5",
59
+ "@knyazevai/dsh-session-projection": "^0.1.5",
60
+ "@knyazevai/dsh-pwsh-sandbox": "^0.1.5",
61
+ "@knyazevai/dsh-session-reference": "^0.1.5",
62
+ "@knyazevai/dsh-time-context": "^0.1.5",
63
+ "@knyazevai/dsh-skill": "^0.1.5",
64
+ "@knyazevai/dsh-skill-filesystem": "^0.1.5",
65
+ "@knyazevai/dsh-jobs-local": "^0.1.5",
66
+ "@knyazevai/dsh-tmux-context": "^0.1.5",
67
+ "@knyazevai/dsh-tool-ask-user": "^0.1.5",
68
+ "@knyazevai/dsh-tool-bash": "^0.1.5",
69
+ "@knyazevai/dsh-tool-pwsh-persistent": "^0.1.5",
70
+ "@knyazevai/dsh-token-meter": "^0.1.5",
71
+ "@knyazevai/dsh-tool-cordis": "^0.1.5",
72
+ "@knyazevai/dsh-tool-bash-persistent": "^0.1.5",
73
+ "@knyazevai/dsh-tool-fs": "^0.1.5",
74
+ "@knyazevai/dsh-tool-fs-search": "^0.1.5",
75
+ "@knyazevai/dsh-tool-goal": "^0.1.5",
76
+ "@knyazevai/dsh-tool-ralph": "^0.1.5",
77
+ "@knyazevai/dsh-tool-pwsh": "^0.1.5",
78
+ "@knyazevai/dsh-schedule": "^0.1.5",
79
+ "@knyazevai/dsh-tool-str-replace-editor": "^0.1.5",
80
+ "@knyazevai/dsh-tool-subagent": "^0.1.5",
81
+ "@knyazevai/dsh-tool-subagent-control": "^0.1.5",
82
+ "@knyazevai/dsh-tool-jobs": "^0.1.5",
83
+ "@knyazevai/dsh-tool-skill": "^0.1.5",
84
+ "@knyazevai/dsh-tool-todo": "^0.1.5",
85
+ "@knyazevai/dsh-tool-web": "^0.1.5",
86
+ "@knyazevai/dsh-web-app": "^0.1.5",
87
+ "@knyazevai/dsh-workflow-worker-thread": "^0.1.5",
88
+ "@knyazevai/dsh-agent-instructions": "^0.1.5",
89
+ "@knyazevai/dsh-tool-workflow": "^0.1.5",
90
+ "@deepseek-ai/cordis": "^4.0.1"
36
91
  },
37
- "keywords": [
38
- "dsh",
39
- "deepseek-harness",
40
- "knyazevai",
41
- "plugin"
42
- ]
43
- }
92
+ "devDependencies": {
93
+ "@types/js-yaml": "^4.0.9",
94
+ "execa": "^10.0.0",
95
+ "@knyazevai/dsh-agent": "^0.1.5",
96
+ "@knyazevai/dsh-host-frontend-static": "^0.1.5",
97
+ "@knyazevai/dsh-host-apiproxy": "^0.1.5",
98
+ "@knyazevai/dsh-host-webserver": "^0.1.5",
99
+ "@knyazevai/dsh-llm": "^0.1.5",
100
+ "@knyazevai/dsh-llm-mock-server": "^0.1.5",
101
+ "@knyazevai/dsh-session": "^0.1.5",
102
+ "@knyazevai/dsh-loader-smoke": "^0.1.5",
103
+ "@knyazevai/dsh-settings": "^0.1.5",
104
+ "@knyazevai/dsh-system-prompt": "^0.1.5",
105
+ "@knyazevai/dsh-subagent": "^0.1.5",
106
+ "@knyazevai/dsh-tools": "^0.1.5"
107
+ }
108
+ }
package/cordis.patch.yml DELETED
@@ -1,84 +0,0 @@
1
- # Knyazev AI provider for DeepSeek Harness.
2
- # Applied after dsh-base / dsh-web-app. Restates llm-pi-ai config so the
3
- # route exists in the composition base; user settings still merge per provider
4
- # and still own the API key. Do not retarget this row from another bundle.
5
- - id: llm-pi-ai
6
- config:
7
- providers:
8
- knyazev-ai:
9
- displayName: Knyazev AI
10
- apiKeyEnv: KNYAZEV_AI_API_KEY
11
- api: openai-completions
12
- baseURL: https://knyazevai.work/v1
13
- # 20 retries on transient failures, applied to every model of this
14
- # provider. mode: always would retry until success (unbounded); normal
15
- # bounds it to transient codes with a hard cap of 20 attempts.
16
- retryPolicy:
17
- mode: normal
18
- maxRetries: 20
19
- retryableCodes:
20
- - RATE_LIMIT
21
- - SERVER
22
- - TIMEOUT
23
- - TRANSPORT
24
- - EMPTY_RESPONSE
25
- compat:
26
- thinkingFormat: qwen
27
- supportsReasoningEffort: false
28
- reasoning: max
29
- models:
30
- - id: deepseek-v4-flash
31
- name: DeepSeek V4 Flash
32
- contextWindow: 400000
33
- maxTokens: 40000
34
- reasoningEfforts:
35
- off: null
36
- high: high
37
- max: max
38
- - id: kimi-2.6
39
- name: Kimi 2.6
40
- contextWindow: 262144
41
- maxTokens: 40000
42
- reasoningEfforts:
43
- off: null
44
- high: high
45
- max: max
46
- - id: minimax-2.7
47
- name: MiniMax 2.7
48
- contextWindow: 204800
49
- maxTokens: 40000
50
-
51
- # New sessions start on Knyazev Flash. Patch config replaces the whole row,
52
- # so this is the composition default after install. A later picker choice
53
- # still writes settings.yaml and wins over this layer.
54
- - id: agent-default-model
55
- config:
56
- provider: knyazev-ai
57
- model: deepseek-v4-flash
58
-
59
- # Spawned and forked children inherit the same route. Patch config replaces
60
- # the whole row, so the bundle's original fields are restated here.
61
- - id: tool-subagent
62
- config:
63
- provider: spawn
64
- toolName: subagent
65
- backgroundMode: continuable
66
- agentOptions:
67
- provider: knyazev-ai
68
- model: deepseek-v4-flash
69
-
70
- - id: tool-subagent-fork
71
- config:
72
- provider: fork
73
- toolName: subagent_fork
74
- backgroundMode: one-shot
75
- agentOptions:
76
- provider: knyazev-ai
77
- model: deepseek-v4-flash
78
-
79
- # Agent Presets mount compaction in a nested `compaction` group. The deployment
80
- # plugin contributes a complete group replacement to standard, code, and
81
- # cordis at preset-mount time, while minimal intentionally keeps no compaction.
82
- - insert:
83
- - id: knyazev-ai-compaction
84
- name: '@knyazevai/dsh'