@knyazevai/dsh 0.1.5 → 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.
Files changed (32) hide show
  1. package/README.i18n.yaml +21 -5
  2. package/README.md +26 -9
  3. package/README.zh.md +25 -10
  4. package/lib/bin.js +175 -73
  5. package/lib/dump-config-Cxlnwi7L.js +2 -0
  6. package/lib/{dump-config-DyK_R56g.js → dump-config-DC1v_CSl.js} +18 -6
  7. package/lib/dump-config-schema-CzGcS3DG.js +41 -0
  8. package/lib/plugin-CjFov5EZ.js +101 -0
  9. package/lib/profile-boot-B44a52oE.js +329 -0
  10. package/lib/profile-boot.js +2 -0
  11. package/lib/types/args.d.ts +65 -0
  12. package/lib/types/bin.d.ts +18 -0
  13. package/lib/types/dump-config-schema.d.ts +17 -0
  14. package/lib/types/dump-config.d.ts +27 -0
  15. package/lib/types/plugin.d.ts +9 -0
  16. package/lib/types/process-shutdown.d.ts +20 -0
  17. package/lib/types/profile-boot.d.ts +97 -0
  18. package/lib/types/startup-diagnostics.d.ts +19 -0
  19. package/package.json +155 -83
  20. package/config/agent-presets/code/agent.cordis.yml +0 -263
  21. package/config/agent-presets/code/preset.yml +0 -3
  22. package/config/agent-presets/cordis/agent.cordis.yml +0 -263
  23. package/config/agent-presets/cordis/preset.yml +0 -3
  24. package/config/agent-presets/cordis/skills/cordis-plugin-development/SKILL.md +0 -420
  25. package/config/agent-presets/cordis/skills/editing-cordis-compositions/SKILL.md +0 -165
  26. package/config/agent-presets/minimal/agent.cordis.yml +0 -88
  27. package/config/agent-presets/minimal/preset.yml +0 -3
  28. package/config/agent-presets/standard/agent.cordis.yml +0 -252
  29. package/config/agent-presets/standard/preset.yml +0 -3
  30. package/lib/plugin-b-wPL_wv.js +0 -128
  31. package/lib/profile-boot-ClKqtiSq.js +0 -2
  32. package/lib/profile-boot-CuWvAMzG.js +0 -283
@@ -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,7 +1,7 @@
1
1
  {
2
2
  "name": "@knyazevai/dsh",
3
- "description": "dsh CLI: profile boot, plugin management, and the browser UI alias",
4
- "version": "0.1.5",
3
+ "description": "dsh CLI: profile launch, plugin management, and configuration inspection",
4
+ "version": "0.2.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -11,98 +11,170 @@
11
11
  "directory": "apps/cli"
12
12
  },
13
13
  "type": "module",
14
- "engines": {
15
- "node": "^22.19.0 || >=24.0.0"
16
- },
17
14
  "bin": {
18
15
  "dsh": "bin.mjs"
19
16
  },
20
17
  "files": [
21
- "bin.mjs",
22
18
  "lib/*.js",
23
- "config"
19
+ "lib/types/*.d.ts",
20
+ "bin.mjs"
24
21
  ],
25
22
  "license": "MIT",
26
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",
27
92
  "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"
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"
91
113
  },
92
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",
93
163
  "@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"
164
+ "@types/ws": "8.18.1",
165
+ "ajv": "^8.20.0",
166
+ "execa": "^10.0.1",
167
+ "ws": "8.21.3"
168
+ },
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"
176
+ },
177
+ "engines": {
178
+ "node": "^22.19.0 || >=24.0.0"
107
179
  }
108
180
  }
@@ -1,263 +0,0 @@
1
- # The `code` agent preset: the standard coding agent, presented as Code Mode.
2
- #
3
- # Everything in `standard` is here unchanged. What is added is the `tool-presentation`
4
- # row: instead of one tool call per action, the model writes a TypeScript
5
- # program against a generated SDK and `run_code` executes it, so a sequence
6
- # that would be five round trips becomes one.
7
- #
8
- # The registry itself stays on the host plane — the agent loop's scheduler and
9
- # the API proxy's presenters are its consumers — so what this preset owns is
10
- # the PRESENTATION of that registry for this agent alone. Native sessions run
11
- # beside this one in the same process, each seeing its own catalog.
12
- #
13
- # This file is an AGENT-PLANE composition. It is mounted under one agent's
14
- # scope context, so every tool and prompt section it registers belongs to that
15
- # session alone. The host composition (`base.cordis.yml` + `web.cordis.yml`)
16
- # keeps everything a preset must not own: the registries themselves, the
17
- # sandbox and approval stack, persistence, and the model route.
18
- #
19
- # A service row here MUST sit inside a group carrying an `isolate` realm.
20
- # Without one it publishes into the root realm, where it is process-global
21
- # rather than per-session and the second session mounting this preset collides
22
- # with the first; `dsh-agent-presets` rejects that at mount. `true` means an
23
- # entry-local realm — one private instance per mounted session, which is the
24
- # default this deployment wants. A shared label would instead pool one instance
25
- # across every session naming it.
26
-
27
- # ── identity ────────────────────────────────────────────────────────────────
28
-
29
- # The preset's own persona, shadowing the deployment default for this agent.
30
- # `{{model}}` and `{{cwd}}` resolve from the agent's own route and workspace.
31
- - id: persona
32
- name: '@knyazevai/dsh-persona'
33
- config:
34
- text: >-
35
- You are a coding agent powered by the {{model}} model. Your working directory is {{cwd}}.
36
-
37
- - id: agent-instructions
38
- name: '@knyazevai/dsh-agent-instructions'
39
- config:
40
- maxBytes: 65536
41
-
42
- # ── shell ───────────────────────────────────────────────────────────────────
43
-
44
- # `shell-env` stays in the HOST composition: `apps/cli/src/web.ts` injects it to
45
- # publish `DSH_WEB_URL`/`DSH_WEB_MODE`, and a host row that injects a service is
46
- # the criterion for host-plane ownership — injection resolves before any session
47
- # exists, so there is no agent to key by. Behind a preset realm those variables
48
- # never reached the model's shell at all. Both shell tools consume the host
49
- # registry from here; their executors (`bash-sandbox`/`pwsh-sandbox`) are
50
- # host-plane too.
51
- - id: tool-bash
52
- name: '@knyazevai/dsh-tool-bash'
53
- disabled: !!js process.platform === 'win32'
54
-
55
- - id: tool-pwsh
56
- name: '@knyazevai/dsh-tool-pwsh'
57
- disabled: !!js process.platform !== 'win32'
58
-
59
- # ── filesystem ──────────────────────────────────────────────────────────────
60
-
61
- # Both register into the host `tools` registry and provide nothing, so
62
- # they need no realm. The `fs` service and its policy stay in the host.
63
- - id: tool-fs
64
- name: '@knyazevai/dsh-tool-fs'
65
-
66
- - id: tool-fs-search
67
- name: '@knyazevai/dsh-tool-fs-search'
68
- config:
69
- sampleOverCapGlobResults: false
70
-
71
- # ── background jobs ────────────────────────────────────────────────────────
72
-
73
- # Only the model-facing controls. The task REGISTRY stays on the host plane:
74
- # its producers sit outside any realm this file could put it in — `tool-bash`
75
- # above resolves it with `ctx.get`, and an entry-local realm here is invisible
76
- # to every sibling row, so `run_in_background` would answer "background jobs
77
- # unavailable" while these controls sat in the catalog. The registry is keyed by
78
- # owning agent anyway, so one host instance serves every session. What a preset
79
- # chooses is whether its agent can collect and stop background work at all.
80
- - id: tool-jobs
81
- name: '@knyazevai/dsh-tool-jobs'
82
-
83
- # ── skills ──────────────────────────────────────────────────────────────────
84
-
85
- # The skill REGISTRY lives in the host composition and is layered per scope:
86
- # these rows register into THIS preset's layer of it, so they need no realm.
87
- # `skill-filesystem` contributes local-root discovery for agents on this preset, and
88
- # `tool-skill` gives them the catalog and loader; the merged catalog also
89
- # carries whatever the deployment registered globally (repository plugins).
90
- - id: skill-filesystem
91
- name: '@knyazevai/dsh-skill-filesystem'
92
-
93
- - id: tool-skill
94
- name: '@knyazevai/dsh-tool-skill'
95
-
96
- # ── goals ───────────────────────────────────────────────────────────────────
97
-
98
- # Only the model-facing tool. The goal SERVICE, its session driver, and the
99
- # `/goal` command stay on the host plane: the Gateway serves the goal domain as
100
- # Remote endpoints whose receiver comes from a generated descriptor, so it
101
- # resolves `goals` on the host and an entry-local realm here would hide it. The
102
- # registry is keyed by session anyway, so one host instance serves every
103
- # session. What a preset chooses is whether its agent can call the goal tool.
104
- - id: tool-goal
105
- name: '@knyazevai/dsh-tool-goal'
106
-
107
- # ── plan mode ───────────────────────────────────────────────────────────────
108
-
109
- # Plan state is per-agent by nature, so an entry-local realm is not a
110
- # workaround here — it is the correct lifetime.
111
- - id: planning
112
- name: cordis:group
113
- group: true
114
- isolate:
115
- planMode: true
116
- config:
117
- - id: plan-mode
118
- name: '@knyazevai/dsh-plan-mode'
119
- config:
120
- section: |
121
- You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
122
-
123
- Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
124
-
125
- The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
126
-
127
- Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
128
-
129
- Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
130
-
131
- When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
132
-
133
- # ── compaction ──────────────────────────────────────────────────────────────
134
-
135
- # `compaction-basic` reads `toolResultPrune` through `ctx.get`, so the pruner must
136
- # share this realm rather than sit outside it.
137
- #
138
- # `tokenMeter` is deliberately NOT in this realm: the meter stays on the HOST
139
- # plane, and the rows here resolve that one instance. It takes no configuration,
140
- # keys every fold by Session, and owns the context-meter projection units the
141
- # browser reads for every session — behind a realm those units would come and go
142
- # with whichever presets happen to be mounted. What a preset chooses is whether
143
- # its agent compacts at all, which is `compaction-basic` below.
144
- - id: compaction
145
- name: cordis:group
146
- group: true
147
- isolate:
148
- compaction: true
149
- toolResultPruner: true
150
- config:
151
- - id: compaction-basic
152
- name: '@knyazevai/dsh-compaction-basic'
153
-
154
- - id: command-compact
155
- name: '@knyazevai/dsh-command-compact'
156
-
157
- - id: tool-result-pruner
158
- name: '@knyazevai/dsh-compaction-tool-result-pruner'
159
- config:
160
- thresholdChars: 8192
161
- headChars: 4096
162
- tailChars: 1024
163
-
164
- # ── delegation and workflows ────────────────────────────────────────────────
165
-
166
- # The `subagents` registry and its spawn/fork backends live in the HOST
167
- # composition: the registry is a process singleton whose cross-session queries
168
- # the api-proxy serves to the browser, and a provider name may only be
169
- # registered once. This preset contributes the delegation TOOLS, which resolve
170
- # that host registry.
171
- #
172
- # `workflows` is different — nothing outside an agent reads it — so every row
173
- # that reaches it shares one entry-local realm here, and a consumer left
174
- # outside would resolve a host registry this preset does not populate.
175
- - id: delegation
176
- name: cordis:group
177
- group: true
178
- isolate:
179
- workflowEngine: true
180
- config:
181
- - id: tool-subagent-control
182
- name: '@knyazevai/dsh-tool-subagent-control'
183
-
184
- - id: tool-subagent-list-agents
185
- name: '@knyazevai/dsh-tool-subagent-control/list-agents'
186
-
187
- - id: tool-subagent
188
- name: '@knyazevai/dsh-tool-subagent'
189
- config:
190
- provider: spawn
191
- toolName: subagent
192
- backgroundMode: continuable
193
-
194
- - id: tool-subagent-fork
195
- name: '@knyazevai/dsh-tool-subagent'
196
- config:
197
- provider: fork
198
- toolName: subagent_fork
199
- backgroundMode: continuable
200
-
201
- # Production dsh does not install these optional providers. Install the
202
- # matching Bundle in this Profile and restart the Host, then copy this
203
- # preset and remove `disabled` from the matching tool row. Host availability
204
- # alone grants no tool.
205
- - id: tool-subagent-codex
206
- name: '@knyazevai/dsh-tool-subagent'
207
- disabled: true
208
- config:
209
- provider: codex
210
- toolName: subagent_codex
211
- backgroundMode: one-shot
212
- maxDepth: provider-managed
213
-
214
- - id: tool-subagent-claude-code
215
- name: '@knyazevai/dsh-tool-subagent'
216
- disabled: true
217
- config:
218
- provider: claude-code
219
- toolName: subagent_claude_code
220
- backgroundMode: one-shot
221
- maxDepth: provider-managed
222
-
223
- - id: workflow-worker-thread
224
- name: '@knyazevai/dsh-workflow-worker-thread'
225
- config:
226
- provider: spawn
227
-
228
- - id: tool-workflow
229
- name: '@knyazevai/dsh-tool-workflow'
230
-
231
- - id: tool-ralph
232
- name: '@knyazevai/dsh-tool-ralph'
233
- config:
234
- subagentProvider: spawn
235
- maxRounds: 64
236
-
237
- # ── remaining model-facing rows ─────────────────────────────────────────────
238
-
239
- - id: tool-ask-user
240
- name: '@knyazevai/dsh-tool-ask-user'
241
-
242
- - id: tool-todo
243
- name: '@knyazevai/dsh-tool-todo'
244
- config:
245
- allowParallelInProgress: true
246
-
247
- # The `web` service and its search provider stay in the host composition; only
248
- # the model-facing tool is per-session.
249
- - id: tool-web
250
- name: '@knyazevai/dsh-tool-web'
251
- config:
252
- fetch: false
253
- searchTimeoutMs: 60000
254
-
255
- # ── presentation ────────────────────────────────────────────────────────────
256
-
257
- # Code Mode for this agent alone. The row waits for the host's `codeRuntime`
258
- # rather than assuming it: a deployment that composes no TypeScript runtime
259
- # fails this preset at mount, naming this id, instead of at the first request.
260
- - id: tool-presentation
261
- name: '@knyazevai/dsh-agent-tool-presentation'
262
- config:
263
- mode: code
@@ -1,3 +0,0 @@
1
- name: PTC 模式
2
- description: 具备标准模式的全部能力,并通过 Code Mode SDK 呈现工具,让模型用一个 TypeScript 程序组合多步操作。
3
- order: 2