@knyazevai/dsh 0.1.4 → 0.2.1
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/LICENSE +1 -1
- package/README.i18n.yaml +22 -0
- package/README.md +40 -89
- package/README.zh.md +64 -0
- package/bin.mjs +25 -0
- package/lib/bin.js +260 -0
- package/lib/dump-config-Cxlnwi7L.js +2 -0
- package/lib/dump-config-DC1v_CSl.js +64 -0
- package/lib/dump-config-schema-CzGcS3DG.js +41 -0
- package/lib/plugin-CjFov5EZ.js +101 -0
- package/lib/profile-boot-B44a52oE.js +329 -0
- package/lib/profile-boot.js +2 -0
- package/lib/types/args.d.ts +65 -0
- package/lib/types/bin.d.ts +18 -0
- package/lib/types/dump-config-schema.d.ts +17 -0
- package/lib/types/dump-config.d.ts +27 -0
- package/lib/types/plugin.d.ts +9 -0
- package/lib/types/process-shutdown.d.ts +20 -0
- package/lib/types/profile-boot.d.ts +97 -0
- package/lib/types/startup-diagnostics.d.ts +19 -0
- package/package.json +169 -32
- package/cordis.patch.yml +0 -84
- package/lib/provider.js +0 -123
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared profile boot for every `dsh` surface: resolve the profile, stack its
|
|
3
|
+
* patch layers (bundle layers in `dsh.profile.bundles` order, the profile's
|
|
4
|
+
* own `cordis.patch.yml`, `--patch` overlays, the telemetry switch), mount the
|
|
5
|
+
* tree over the profile's empty root config, and wire fail-loud plus bounded shutdown.
|
|
6
|
+
*
|
|
7
|
+
* App flags are not the launcher's business: the invocation's inner arguments
|
|
8
|
+
* are provided to the tree through `ctx.cmdlineArgs`, where any injected app
|
|
9
|
+
* plugin may read the same immutable snapshot.
|
|
10
|
+
* @module @knyazevai/dsh/profile-boot
|
|
11
|
+
*/
|
|
12
|
+
import { type Context } from '@deepseek-ai/cordis';
|
|
13
|
+
import { type ProfileContext, type Profile } from '@knyazevai/dsh-app-boot';
|
|
14
|
+
import { type LaunchEnvironmentSnapshot } from '@knyazevai/dsh-launch-environment';
|
|
15
|
+
import { type ProcessShutdown } from './process-shutdown.ts';
|
|
16
|
+
/**
|
|
17
|
+
* The home-level user patch layer (`$DSH_HOME/cordis.patch.yml`), applied
|
|
18
|
+
* over every profile's own layer. Resolved per call, not at module load:
|
|
19
|
+
* `$DSH_HOME` may be set by the test or launcher after import.
|
|
20
|
+
* @returns the absolute patch-file path.
|
|
21
|
+
*/
|
|
22
|
+
export declare function homePatchPath(): string;
|
|
23
|
+
/** Absolute path of this dsh installation's package.json (both anchors: src/ and lib/ sit one level under apps/cli). */
|
|
24
|
+
export declare const INSTALL_ANCHOR: string;
|
|
25
|
+
/** Root config filename inside a profile directory. */
|
|
26
|
+
export declare const PROFILE_ROOT_FILENAME = "cordis.yml";
|
|
27
|
+
/**
|
|
28
|
+
* Replace the named custom profile with a fresh copy of one shipped template.
|
|
29
|
+
* This copies only the template's bundle list; local state from the
|
|
30
|
+
* same-named shipped profile is not read, and no inheritance metadata is
|
|
31
|
+
* persisted. The new profile is assembled in a `.<name>.staging-*` directory
|
|
32
|
+
* under the profiles directory and moved into place; only then is any previous
|
|
33
|
+
* target directory, including its dependencies and user patch, deleted. A
|
|
34
|
+
* failed move restores the previous directory; when restoring also fails, it
|
|
35
|
+
* stays in the staging directory. Shipped profile names, compared without
|
|
36
|
+
* case, are reserved. Concurrent replacements leave one complete copy; each
|
|
37
|
+
* one either succeeds or reports the concurrent recreation.
|
|
38
|
+
* @param name - the profile name to create or replace.
|
|
39
|
+
* @param fromDefaultProfile - shipped profile template to copy.
|
|
40
|
+
* @param home - Harness home containing the profile directory.
|
|
41
|
+
* @throws when the template is unknown, the target name is shipped, another process recreates the target
|
|
42
|
+
* between the two renames, or a file-system operation fails; a restore failure is an `AggregateError`
|
|
43
|
+
* that names the staging path holding the previous profile.
|
|
44
|
+
*/
|
|
45
|
+
export declare function initializeProfileFromDefault(name: string, fromDefaultProfile: string, home?: string): void;
|
|
46
|
+
/**
|
|
47
|
+
* Load a resolved profile for `name` and (re)write the empty root config. The
|
|
48
|
+
* root is always rewritten: the whole composition is patch layers, and the
|
|
49
|
+
* vendored Loader's tree write-back (a plugin self-disposing persists the
|
|
50
|
+
* current tree) can bake composed rows into this file — which would duplicate
|
|
51
|
+
* every bundle insert on the next boot. The file exists on disk only because
|
|
52
|
+
* the Loader needs a real include root to anchor `baseUrl` at the profile
|
|
53
|
+
* directory (the config dump anchors on the same file, so both compose over
|
|
54
|
+
* the identical base).
|
|
55
|
+
* @param name - the profile name.
|
|
56
|
+
* @param userLayer - `false` skips parsing `cordis.patch.yml` (the default dump).
|
|
57
|
+
* @param fromDefaultProfile - shipped template that replaces the profile before loading it.
|
|
58
|
+
* @returns the loaded profile.
|
|
59
|
+
* @throws when explicit initialization names an unknown template or a shipped target.
|
|
60
|
+
*/
|
|
61
|
+
export declare function prepareProfile(name: string, userLayer?: boolean, fromDefaultProfile?: string): Profile;
|
|
62
|
+
/** An application-owned profile and its independent installation fallback. */
|
|
63
|
+
export interface ResolvedProfileRuntime {
|
|
64
|
+
/** Profile already loaded from the application's own directory. */
|
|
65
|
+
profile: Profile;
|
|
66
|
+
/** Absolute package.json path of the application's dsh installation. */
|
|
67
|
+
installAnchor: string;
|
|
68
|
+
}
|
|
69
|
+
/** Options for {@link runProfile}. */
|
|
70
|
+
export interface RunProfileOptions {
|
|
71
|
+
/** This run's frozen environment snapshot, provided before any entry mounts. */
|
|
72
|
+
environment: LaunchEnvironmentSnapshot;
|
|
73
|
+
/** The profile name to boot. */
|
|
74
|
+
profile: string;
|
|
75
|
+
/** Loaded application profile; bypasses named profile initialization when supplied. */
|
|
76
|
+
resolvedProfile?: ResolvedProfileRuntime | undefined;
|
|
77
|
+
/** Shipped template that replaces the named profile before boot. */
|
|
78
|
+
fromDefaultProfile?: string | undefined;
|
|
79
|
+
/** `--patch` overlay paths, in argv order. */
|
|
80
|
+
patchFiles: readonly string[];
|
|
81
|
+
/** The invocation's inner arguments, handed to the tree through `ctx.cmdlineArgs`. */
|
|
82
|
+
args: readonly string[];
|
|
83
|
+
/** Application-owned package runtime, scoped to plugin package operations. */
|
|
84
|
+
packageManager?: ProfileContext['packageManager'];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Boot one profile invocation end to end and leave process lifetime to the
|
|
88
|
+
* mounted plugins (or to a one-shot runner the composition mounts).
|
|
89
|
+
* @param options - environment snapshot, profile name, overlays, and the booted app's own arguments.
|
|
90
|
+
* @returns the settled root context and the shutdown controller.
|
|
91
|
+
* @throws after disposing startup resources; cleanup failures retain the original error.
|
|
92
|
+
*/
|
|
93
|
+
export declare function runProfile(options: RunProfileOptions): Promise<{
|
|
94
|
+
ctx: Context;
|
|
95
|
+
shutdown: ProcessShutdown;
|
|
96
|
+
}>;
|
|
97
|
+
//# sourceMappingURL=profile-boot.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Save original startup diagnostics while keeping the terminal report concise. */
|
|
2
|
+
import type { StartupError } from '@knyazevai/dsh-app-boot';
|
|
3
|
+
/** Launcher-owned context; no environment values or plugin configurations are collected. */
|
|
4
|
+
interface StartupDiagnosticContext {
|
|
5
|
+
home: string;
|
|
6
|
+
version: string;
|
|
7
|
+
profile: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Print the startup summary and save a private, uniquely named report under DSH_HOME/logs.
|
|
11
|
+
* Failed writes print the complete report to stderr instead of claiming a saved path.
|
|
12
|
+
* @param error - startup audit failure retaining plugin metadata and original errors.
|
|
13
|
+
* @param context - resolved Harness home, application version, and selected profile.
|
|
14
|
+
* @param write - terminal output sink; awaited before returning, defaults to stderr.
|
|
15
|
+
* @returns after saving or printing the report and completing terminal writes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function reportStartupFailure(error: StartupError, context: StartupDiagnosticContext, write?: (text: string) => void | Promise<void>): Promise<void>;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=startup-diagnostics.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,43 +1,180 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knyazevai/dsh",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"description": "dsh CLI: profile launch, plugin management, and configuration inspection",
|
|
4
|
+
"version": "0.2.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/
|
|
10
|
-
|
|
11
|
-
"homepage": "https://knyazevai.work/docs",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://git.knyazevai.work/knyaz/knyazevai-dsh/issues"
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "apps/cli"
|
|
14
12
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
13
|
+
"type": "module",
|
|
14
|
+
"bin": {
|
|
15
|
+
"dsh": "bin.mjs"
|
|
17
16
|
},
|
|
18
17
|
"files": [
|
|
19
|
-
"
|
|
20
|
-
"lib",
|
|
21
|
-
"
|
|
18
|
+
"lib/*.js",
|
|
19
|
+
"lib/types/*.d.ts",
|
|
20
|
+
"bin.mjs"
|
|
22
21
|
],
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
25
|
+
"@knyazevai/dsh-hmr": "0.2.1",
|
|
26
|
+
"@deepseek-ai/cordis-plugin-include": "~1.0.10",
|
|
27
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6",
|
|
28
|
+
"@deepseek-ai/cordis-plugin-timer": "~1.1.7",
|
|
29
|
+
"@knyazevai/dsh-acp-app": "0.2.1",
|
|
30
|
+
"@knyazevai/dsh-agent-instructions": "0.2.1",
|
|
31
|
+
"@knyazevai/dsh-agent-tool-presentation": "0.2.1",
|
|
32
|
+
"@knyazevai/dsh-app-boot": "0.2.1",
|
|
33
|
+
"@knyazevai/dsh-base": "0.2.1",
|
|
34
|
+
"@knyazevai/dsh-client-ui-agent-preset": "0.2.1",
|
|
35
|
+
"@knyazevai/dsh-client-ui-cordis": "0.2.1",
|
|
36
|
+
"@knyazevai/dsh-cmdline": "0.2.1",
|
|
37
|
+
"@knyazevai/dsh-command-compact": "0.2.1",
|
|
38
|
+
"@knyazevai/dsh-command-goal": "0.2.1",
|
|
39
|
+
"@knyazevai/dsh-compaction-basic": "0.2.1",
|
|
40
|
+
"@knyazevai/dsh-compaction-tool-result-pruner": "0.2.1",
|
|
41
|
+
"@knyazevai/dsh-cordis-client-runner": "0.2.1",
|
|
42
|
+
"@knyazevai/dsh-experimental-agent-team-profile": "0.2.1",
|
|
43
|
+
"@knyazevai/dsh-experimental-inspector-profile": "0.2.1",
|
|
44
|
+
"@knyazevai/dsh-fs-local": "0.2.1",
|
|
45
|
+
"@knyazevai/dsh-goal": "0.2.1",
|
|
46
|
+
"@knyazevai/dsh-goal-round-driver": "0.2.1",
|
|
47
|
+
"@knyazevai/dsh-headless": "0.2.1",
|
|
48
|
+
"@knyazevai/dsh-home-paths": "0.2.1",
|
|
49
|
+
"@knyazevai/dsh-jobs-local": "0.2.1",
|
|
50
|
+
"@knyazevai/dsh-launch-environment": "0.2.1",
|
|
51
|
+
"@knyazevai/dsh-mcp-client": "0.2.1",
|
|
52
|
+
"@knyazevai/dsh-persona": "0.2.1",
|
|
53
|
+
"@knyazevai/dsh-plan-mode": "0.2.1",
|
|
54
|
+
"@knyazevai/dsh-pwsh-local": "0.2.1",
|
|
55
|
+
"@knyazevai/dsh-pwsh-sandbox": "0.2.1",
|
|
56
|
+
"@knyazevai/dsh-schedule": "0.2.1",
|
|
57
|
+
"@knyazevai/dsh-sdk-app": "0.2.1",
|
|
58
|
+
"@knyazevai/dsh-sdk-minimal": "0.2.1",
|
|
59
|
+
"@knyazevai/dsh-session-projection": "0.2.1",
|
|
60
|
+
"@knyazevai/dsh-session-reference": "0.2.1",
|
|
61
|
+
"@knyazevai/dsh-skill": "0.2.1",
|
|
62
|
+
"@knyazevai/dsh-skill-filesystem": "0.2.1",
|
|
63
|
+
"@knyazevai/dsh-skill-office": "0.2.1",
|
|
64
|
+
"@knyazevai/dsh-tool-workspace-dependencies": "0.2.1",
|
|
65
|
+
"@knyazevai/dsh-terminal": "0.2.1",
|
|
66
|
+
"@knyazevai/dsh-terminal-bash": "0.2.1",
|
|
67
|
+
"@knyazevai/dsh-time-context": "0.2.1",
|
|
68
|
+
"@knyazevai/dsh-tmux-context": "0.2.1",
|
|
69
|
+
"@knyazevai/dsh-token-meter": "0.2.1",
|
|
70
|
+
"@knyazevai/dsh-tool-ask-user": "0.2.1",
|
|
71
|
+
"@knyazevai/dsh-tool-bash": "0.2.1",
|
|
72
|
+
"@knyazevai/dsh-tool-bash-persistent": "0.2.1",
|
|
73
|
+
"@knyazevai/dsh-tool-cordis": "0.2.1",
|
|
74
|
+
"@knyazevai/dsh-tool-present": "0.2.1",
|
|
75
|
+
"@knyazevai/dsh-tool-fs": "0.2.1",
|
|
76
|
+
"@knyazevai/dsh-tool-fs-search": "0.2.1",
|
|
77
|
+
"@knyazevai/dsh-tool-goal": "0.2.1",
|
|
78
|
+
"@knyazevai/dsh-tool-jobs": "0.2.1",
|
|
79
|
+
"@knyazevai/dsh-tool-pwsh": "0.2.1",
|
|
80
|
+
"@knyazevai/dsh-tool-pwsh-persistent": "0.2.1",
|
|
81
|
+
"@knyazevai/dsh-tool-schedule": "0.2.1",
|
|
82
|
+
"@knyazevai/dsh-tool-skill": "0.2.1",
|
|
83
|
+
"@knyazevai/dsh-tool-str-replace-editor": "0.2.1",
|
|
84
|
+
"@knyazevai/dsh-tool-subagent": "0.2.1",
|
|
85
|
+
"@knyazevai/dsh-tool-subagent-control": "0.2.1",
|
|
86
|
+
"@knyazevai/dsh-tool-todo": "0.2.1",
|
|
87
|
+
"@knyazevai/dsh-tool-web": "0.2.1",
|
|
88
|
+
"@knyazevai/dsh-tool-workflow": "0.2.1",
|
|
89
|
+
"@knyazevai/dsh-web-app": "0.2.1",
|
|
90
|
+
"@knyazevai/dsh-workflow-ptc": "0.2.1",
|
|
91
|
+
"@deepseek-ai/schemastery": "~3.18.5",
|
|
92
|
+
"commander": "^15.0.0",
|
|
93
|
+
"js-yaml": "^4.3.2",
|
|
94
|
+
"node-addon-require-builtin": "^0.1.9",
|
|
95
|
+
"@knyazevai/dsh-http-proxy": "0.2.1",
|
|
96
|
+
"@knyazevai/dsh-mcp-resources": "0.2.1",
|
|
97
|
+
"@knyazevai/dsh-plugin-manager": "0.2.1",
|
|
98
|
+
"@knyazevai/dsh-atomic-write": "0.2.1",
|
|
99
|
+
"@knyazevai/dsh-agent-preset": "0.2.1",
|
|
100
|
+
"@knyazevai/dsh-experimental-voice-input-bundle": "0.2.1",
|
|
101
|
+
"@knyazevai/dsh-experimental-auto-review": "0.2.1",
|
|
102
|
+
"@knyazevai/dsh-wake-scheduler": "0.2.1",
|
|
103
|
+
"@knyazevai/dsh-fork-base": "0.2.1",
|
|
104
|
+
"@knyazevai/dsh-fork-web": "0.2.1",
|
|
105
|
+
"@knyazevai/dsh-experimental-cot-translation-bundle": "0.2.1",
|
|
106
|
+
"@knyazevai/dsh-experimental-badge-skill-bundle": "0.2.1",
|
|
107
|
+
"@knyazevai/dsh-experimental-ralph-bundle": "0.2.1",
|
|
108
|
+
"@knyazevai/dsh-experimental-session-titles-bundle": "0.2.1",
|
|
109
|
+
"@knyazevai/dsh-experimental-terminal-bundle": "0.2.1",
|
|
110
|
+
"@knyazevai/dsh-experimental-session-search": "0.2.1",
|
|
111
|
+
"@knyazevai/dsh-experimental-tool-worktree": "0.2.1",
|
|
112
|
+
"@knyazevai/dsh-experimental-plugin-market-bundle": "0.2.1"
|
|
27
113
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
114
|
+
"devDependencies": {
|
|
115
|
+
"@knyazevai/dsh-skill-badge": "0.2.1",
|
|
116
|
+
"@knyazevai/dsh-webhook-github": "0.2.1",
|
|
117
|
+
"@knyazevai/dsh-webhook": "0.2.1",
|
|
118
|
+
"@knyazevai/dsh-tool-ralph": "0.2.1",
|
|
119
|
+
"@knyazevai/dsh-hooks-codex": "0.2.1",
|
|
120
|
+
"@knyazevai/dsh-hooks-claude-code": "0.2.1",
|
|
121
|
+
"@agentclientprotocol/sdk": "1.4.0",
|
|
122
|
+
"@knyazevai/dsh-acp": "0.2.1",
|
|
123
|
+
"@knyazevai/dsh-agent": "0.2.1",
|
|
124
|
+
"@knyazevai/dsh-agent-loop": "0.2.1",
|
|
125
|
+
"@knyazevai/dsh-agent-loop-testkit": "0.2.1",
|
|
126
|
+
"@knyazevai/dsh-attachment-local": "0.2.1",
|
|
127
|
+
"@knyazevai/dsh-bash-local": "0.2.1",
|
|
128
|
+
"@knyazevai/dsh-credentials-local": "0.2.1",
|
|
129
|
+
"@knyazevai/dsh-deepseek-llm-api-extensions": "0.2.1",
|
|
130
|
+
"@knyazevai/dsh-experimental-agent-team": "0.2.1",
|
|
131
|
+
"@knyazevai/dsh-experimental-ptc-runtime-python": "0.2.1",
|
|
132
|
+
"@knyazevai/dsh-experimental-tool-agent-team": "0.2.1",
|
|
133
|
+
"@knyazevai/dsh-fs-observation-policy": "0.2.1",
|
|
134
|
+
"@knyazevai/dsh-fs-sandbox": "0.2.1",
|
|
135
|
+
"@knyazevai/dsh-host-frontend-static": "0.2.1",
|
|
136
|
+
"@knyazevai/dsh-host-webserver": "0.2.1",
|
|
137
|
+
"@knyazevai/dsh-llm": "0.2.1",
|
|
138
|
+
"@knyazevai/dsh-llm-deepseek": "0.2.1",
|
|
139
|
+
"@knyazevai/dsh-llm-deepseek-api-key": "0.2.1",
|
|
140
|
+
"@knyazevai/dsh-llm-deepseek-account": "0.2.1",
|
|
141
|
+
"@knyazevai/dsh-llm-mock-server": "0.2.1",
|
|
142
|
+
"@knyazevai/dsh-llm-pi-ai": "0.2.1",
|
|
143
|
+
"@knyazevai/dsh-llm-replay": "0.2.1",
|
|
144
|
+
"@knyazevai/dsh-loader-smoke": "0.2.1",
|
|
145
|
+
"@knyazevai/dsh-plugin-package-inventory-deepseek": "0.2.1",
|
|
146
|
+
"@knyazevai/dsh-sandbox-local": "0.2.1",
|
|
147
|
+
"@knyazevai/dsh-sandbox-policy": "0.2.1",
|
|
148
|
+
"@knyazevai/dsh-sdk-client": "0.2.1",
|
|
149
|
+
"@knyazevai/dsh-session": "0.2.1",
|
|
150
|
+
"@knyazevai/dsh-session-checkpoint-policy": "0.2.1",
|
|
151
|
+
"@knyazevai/dsh-session-log-deepseek": "0.2.1",
|
|
152
|
+
"@knyazevai/dsh-session-persistence-jsonl": "0.2.1",
|
|
153
|
+
"@knyazevai/dsh-session-query": "0.2.1",
|
|
154
|
+
"@knyazevai/dsh-shell-env": "0.2.1",
|
|
155
|
+
"@knyazevai/dsh-settings": "0.2.1",
|
|
156
|
+
"@knyazevai/dsh-subagent": "0.2.1",
|
|
157
|
+
"@knyazevai/dsh-subagent-fork-in-process": "0.2.1",
|
|
158
|
+
"@knyazevai/dsh-subagent-spawn-in-process": "0.2.1",
|
|
159
|
+
"@knyazevai/dsh-subprocess-local": "0.2.1",
|
|
160
|
+
"@knyazevai/dsh-system-prompt": "0.2.1",
|
|
161
|
+
"@knyazevai/dsh-tools": "0.2.1",
|
|
162
|
+
"@knyazevai/dsh-user-approval": "0.2.1",
|
|
163
|
+
"@types/js-yaml": "^4.0.9",
|
|
164
|
+
"@types/ws": "8.18.1",
|
|
165
|
+
"ajv": "^8.20.0",
|
|
166
|
+
"execa": "^10.0.1",
|
|
167
|
+
"ws": "8.21.3"
|
|
32
168
|
},
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
169
|
+
"exports": {
|
|
170
|
+
"./profile-boot": {
|
|
171
|
+
"types": "./lib/types/profile-boot.d.ts",
|
|
172
|
+
"default": "./lib/profile-boot.js"
|
|
173
|
+
},
|
|
174
|
+
"./lib/*": "./lib/*",
|
|
175
|
+
"./package.json": "./package.json"
|
|
36
176
|
},
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"plugin"
|
|
42
|
-
]
|
|
43
|
-
}
|
|
177
|
+
"engines": {
|
|
178
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
179
|
+
}
|
|
180
|
+
}
|
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'
|
package/lib/provider.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/** Catalog the DSH bundle patch must keep in sync with cordis.patch.yml. */
|
|
2
|
-
|
|
3
|
-
export const PROVIDER_ID = "knyazev-ai";
|
|
4
|
-
export const API_KEY_ENV = "KNYAZEV_AI_API_KEY";
|
|
5
|
-
export const BASE_URL = "https://knyazevai.work/v1";
|
|
6
|
-
export const DEFAULT_MODEL_ID = "deepseek-v4-flash";
|
|
7
|
-
export const DEFAULT_REASONING = "max";
|
|
8
|
-
|
|
9
|
-
/** Cordis plugin name for the per-agent-preset compaction overlay. */
|
|
10
|
-
export const name = "knyazev-ai-compaction";
|
|
11
|
-
|
|
12
|
-
/** No required services: headless profiles do not compose Agent Presets. */
|
|
13
|
-
export const inject = [];
|
|
14
|
-
|
|
15
|
-
const AGENT_PRESET_PATCH_CONTRIBUTOR = Symbol.for("dsh.agent-presets.patch-contributor");
|
|
16
|
-
|
|
17
|
-
const COMPACTION_PATCH = {
|
|
18
|
-
id: "compaction",
|
|
19
|
-
config: [
|
|
20
|
-
{
|
|
21
|
-
id: "compaction-basic",
|
|
22
|
-
name: "@deepseek-ai/dsh-compaction-basic",
|
|
23
|
-
config: {
|
|
24
|
-
maxSummarizationInputTokens: 0,
|
|
25
|
-
compactionRetries: 2,
|
|
26
|
-
maxOverflowRetries: 2,
|
|
27
|
-
modelPolicies: [
|
|
28
|
-
{
|
|
29
|
-
provider: "knyazev-ai",
|
|
30
|
-
model: "deepseek-v4-flash",
|
|
31
|
-
thresholdRatio: 0.5,
|
|
32
|
-
maxSummarizationInputTokens: 131072,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
provider: "knyazev-ai",
|
|
36
|
-
model: "kimi-2.6",
|
|
37
|
-
maxSummarizationInputTokens: 131072,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
provider: "knyazev-ai",
|
|
41
|
-
model: "minimax-2.7",
|
|
42
|
-
maxSummarizationInputTokens: 131072,
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
id: "command-compact",
|
|
49
|
-
name: "@deepseek-ai/dsh-command-compact",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: "tool-result-pruner",
|
|
53
|
-
name: "@deepseek-ai/dsh-compaction-tool-result-pruner",
|
|
54
|
-
config: {
|
|
55
|
-
thresholdChars: 8192,
|
|
56
|
-
headChars: 4096,
|
|
57
|
-
tailChars: 1024,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const COMPACTION_PRESET_IDS = ["standard", "code", "cordis"];
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Contribute the compaction group to the shipped presets that own it.
|
|
67
|
-
*
|
|
68
|
-
* The contributor face is optional so the provider remains loadable on older
|
|
69
|
-
* Harness builds; those builds simply retain their stored preset composition.
|
|
70
|
-
*/
|
|
71
|
-
export function apply(ctx) {
|
|
72
|
-
ctx.inject(["agentPresets"], (childCtx) => {
|
|
73
|
-
const agentPresets = typeof childCtx.get === "function" ? childCtx.get("agentPresets") : childCtx.agentPresets;
|
|
74
|
-
const contributor = agentPresets?.[AGENT_PRESET_PATCH_CONTRIBUTOR];
|
|
75
|
-
if (contributor === undefined || typeof contributor.register !== "function") return;
|
|
76
|
-
|
|
77
|
-
for (const presetId of COMPACTION_PRESET_IDS) {
|
|
78
|
-
contributor.register({ presetId, patches: [COMPACTION_PATCH] });
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export const REASONING_EFFORTS = Object.freeze({
|
|
84
|
-
off: null,
|
|
85
|
-
high: "high",
|
|
86
|
-
max: "max",
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
export const MODELS = Object.freeze([
|
|
90
|
-
Object.freeze({
|
|
91
|
-
id: "deepseek-v4-flash",
|
|
92
|
-
name: "DeepSeek V4 Flash",
|
|
93
|
-
contextWindow: 400000,
|
|
94
|
-
maxTokens: 40000,
|
|
95
|
-
reasoningEfforts: REASONING_EFFORTS,
|
|
96
|
-
}),
|
|
97
|
-
Object.freeze({
|
|
98
|
-
id: "kimi-2.6",
|
|
99
|
-
name: "Kimi 2.6",
|
|
100
|
-
contextWindow: 262144,
|
|
101
|
-
maxTokens: 40000,
|
|
102
|
-
reasoningEfforts: REASONING_EFFORTS,
|
|
103
|
-
}),
|
|
104
|
-
Object.freeze({
|
|
105
|
-
id: "minimax-2.7",
|
|
106
|
-
name: "MiniMax 2.7",
|
|
107
|
-
contextWindow: 204800,
|
|
108
|
-
maxTokens: 40000,
|
|
109
|
-
}),
|
|
110
|
-
]);
|
|
111
|
-
|
|
112
|
-
export const PROVIDER = Object.freeze({
|
|
113
|
-
displayName: "Knyazev AI",
|
|
114
|
-
apiKeyEnv: API_KEY_ENV,
|
|
115
|
-
api: "openai-completions",
|
|
116
|
-
baseURL: BASE_URL,
|
|
117
|
-
compat: Object.freeze({
|
|
118
|
-
thinkingFormat: "qwen",
|
|
119
|
-
supportsReasoningEffort: false,
|
|
120
|
-
}),
|
|
121
|
-
reasoning: DEFAULT_REASONING,
|
|
122
|
-
models: MODELS,
|
|
123
|
-
});
|