@fishwithcat/dsh 0.0.0-stage → 0.2.2-alpha.2

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,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 @deepseek-ai/dsh/profile-boot
11
+ */
12
+ import { type Context } from '@deepseek-ai/cordis';
13
+ import { type ProfileContext, type Profile } from '@deepseek-ai/dsh-app-boot';
14
+ import { type LaunchEnvironmentSnapshot } from '@deepseek-ai/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 '@deepseek-ai/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,6 +1,179 @@
1
1
  {
2
2
  "name": "@fishwithcat/dsh",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "dsh CLI: profile launch, plugin management, and configuration inspection",
4
+ "version": "0.2.2-alpha.2",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/FishwithCat/deepseek-harness-tui",
11
+ "directory": "apps/cli"
12
+ },
13
+ "type": "module",
14
+ "files": [
15
+ "lib/*.js",
16
+ "lib/types/*.d.ts"
17
+ ],
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@deepseek-ai/cordis": "~4.0.6-alpha.1",
21
+ "@deepseek-ai/dsh-hmr": "0.2.2-alpha.2",
22
+ "@deepseek-ai/cordis-plugin-include": "~1.0.11-alpha.1",
23
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.7-alpha.1",
24
+ "@deepseek-ai/cordis-plugin-timer": "~1.1.8-alpha.1",
25
+ "@deepseek-ai/dsh-acp-app": "0.2.2-alpha.2",
26
+ "@deepseek-ai/dsh-agent-instructions": "0.2.2-alpha.2",
27
+ "@deepseek-ai/dsh-agent-tool-presentation": "0.2.2-alpha.2",
28
+ "@deepseek-ai/dsh-app-boot": "0.2.2-alpha.2",
29
+ "@deepseek-ai/dsh-base": "0.2.2-alpha.2",
30
+ "@deepseek-ai/dsh-client-ui-agent-preset": "0.2.2-alpha.2",
31
+ "@deepseek-ai/dsh-client-ui-cordis": "0.2.2-alpha.2",
32
+ "@deepseek-ai/dsh-cmdline": "0.2.2-alpha.2",
33
+ "@deepseek-ai/dsh-command-compact": "0.2.2-alpha.2",
34
+ "@deepseek-ai/dsh-command-goal": "0.2.2-alpha.2",
35
+ "@deepseek-ai/dsh-compaction-basic": "npm:@fishwithcat/dsh-compaction-basic@0.2.2-alpha.2",
36
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.2-alpha.2",
37
+ "@deepseek-ai/dsh-cordis-client-runner": "0.2.2-alpha.2",
38
+ "@deepseek-ai/dsh-experimental-agent-team-profile": "0.2.2-alpha.2",
39
+ "@deepseek-ai/dsh-experimental-inspector-profile": "0.2.2-alpha.2",
40
+ "@deepseek-ai/dsh-fs-local": "0.2.2-alpha.2",
41
+ "@deepseek-ai/dsh-goal": "0.2.2-alpha.2",
42
+ "@deepseek-ai/dsh-goal-round-driver": "0.2.2-alpha.2",
43
+ "@deepseek-ai/dsh-headless": "0.2.2-alpha.2",
44
+ "@deepseek-ai/dsh-home-paths": "0.2.2-alpha.2",
45
+ "@deepseek-ai/dsh-jobs-local": "0.2.2-alpha.2",
46
+ "@deepseek-ai/dsh-launch-environment": "0.2.2-alpha.2",
47
+ "@deepseek-ai/dsh-mcp-client": "0.2.2-alpha.2",
48
+ "@deepseek-ai/dsh-official-bundles": "0.2.2-alpha.2",
49
+ "@deepseek-ai/dsh-persona": "0.2.2-alpha.2",
50
+ "@deepseek-ai/dsh-plan-mode": "0.2.2-alpha.2",
51
+ "@deepseek-ai/dsh-pwsh-local": "0.2.2-alpha.2",
52
+ "@deepseek-ai/dsh-pwsh-sandbox": "0.2.2-alpha.2",
53
+ "@deepseek-ai/dsh-schedule": "0.2.2-alpha.2",
54
+ "@deepseek-ai/dsh-sdk-app": "0.2.2-alpha.2",
55
+ "@deepseek-ai/dsh-sdk-minimal": "0.2.2-alpha.2",
56
+ "@deepseek-ai/dsh-session-projection": "0.2.2-alpha.2",
57
+ "@deepseek-ai/dsh-session-reference": "0.2.2-alpha.2",
58
+ "@deepseek-ai/dsh-skill": "0.2.2-alpha.2",
59
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.2-alpha.2",
60
+ "@deepseek-ai/dsh-skill-office": "0.2.2-alpha.2",
61
+ "@deepseek-ai/dsh-tool-workspace-dependencies": "0.2.2-alpha.2",
62
+ "@deepseek-ai/dsh-terminal": "0.2.2-alpha.2",
63
+ "@deepseek-ai/dsh-terminal-bash": "0.2.2-alpha.2",
64
+ "@deepseek-ai/dsh-time-context": "0.2.2-alpha.2",
65
+ "@deepseek-ai/dsh-tmux-context": "0.2.2-alpha.2",
66
+ "@deepseek-ai/dsh-token-meter": "0.2.2-alpha.2",
67
+ "@deepseek-ai/dsh-tool-ask-user": "npm:@fishwithcat/dsh-tool-ask-user@0.2.2-alpha.2",
68
+ "@deepseek-ai/dsh-tool-bash": "0.2.2-alpha.2",
69
+ "@deepseek-ai/dsh-tool-bash-persistent": "0.2.2-alpha.2",
70
+ "@deepseek-ai/dsh-tool-cordis": "0.2.2-alpha.2",
71
+ "@deepseek-ai/dsh-tool-present": "0.2.2-alpha.2",
72
+ "@deepseek-ai/dsh-tool-fs": "0.2.2-alpha.2",
73
+ "@deepseek-ai/dsh-tool-fs-search": "0.2.2-alpha.2",
74
+ "@deepseek-ai/dsh-tool-goal": "0.2.2-alpha.2",
75
+ "@deepseek-ai/dsh-tool-jobs": "0.2.2-alpha.2",
76
+ "@deepseek-ai/dsh-tool-pwsh": "0.2.2-alpha.2",
77
+ "@deepseek-ai/dsh-tool-pwsh-persistent": "0.2.2-alpha.2",
78
+ "@deepseek-ai/dsh-tool-schedule": "0.2.2-alpha.2",
79
+ "@deepseek-ai/dsh-tool-skill": "0.2.2-alpha.2",
80
+ "@deepseek-ai/dsh-tool-str-replace-editor": "0.2.2-alpha.2",
81
+ "@deepseek-ai/dsh-tool-subagent": "0.2.2-alpha.2",
82
+ "@deepseek-ai/dsh-tool-subagent-control": "0.2.2-alpha.2",
83
+ "@deepseek-ai/dsh-tool-todo": "npm:@fishwithcat/dsh-tool-todo@0.2.2-alpha.2",
84
+ "@deepseek-ai/dsh-tool-web": "0.2.2-alpha.2",
85
+ "@deepseek-ai/dsh-tool-workflow": "0.2.2-alpha.2",
86
+ "@deepseek-ai/dsh-tui-app": "npm:@fishwithcat/dsh-tui-app@0.2.2-alpha.2",
87
+ "@deepseek-ai/dsh-web-app": "0.2.2-alpha.2",
88
+ "@deepseek-ai/dsh-workflow-ptc": "0.2.2-alpha.2",
89
+ "@deepseek-ai/schemastery": "~3.18.6-alpha.1",
90
+ "commander": "^15.0.0",
91
+ "js-yaml": "^4.3.2",
92
+ "node-addon-require-builtin": "^0.1.9",
93
+ "@deepseek-ai/dsh-http-proxy": "0.2.2-alpha.2",
94
+ "@deepseek-ai/dsh-mcp-resources": "0.2.2-alpha.2",
95
+ "@deepseek-ai/dsh-plugin-manager": "0.2.2-alpha.2",
96
+ "@deepseek-ai/dsh-atomic-write": "0.2.2-alpha.2",
97
+ "@deepseek-ai/dsh-agent-preset": "0.2.2-alpha.2",
98
+ "@deepseek-ai/dsh-experimental-voice-input-bundle": "0.2.2-alpha.2",
99
+ "@deepseek-ai/dsh-experimental-auto-review": "0.2.2-alpha.2",
100
+ "@deepseek-ai/dsh-experimental-cot-translation-bundle": "0.2.2-alpha.2",
101
+ "@deepseek-ai/dsh-experimental-badge-skill-bundle": "0.2.2-alpha.2",
102
+ "@deepseek-ai/dsh-experimental-ralph-bundle": "0.2.2-alpha.2",
103
+ "@deepseek-ai/dsh-experimental-session-titles-bundle": "0.2.2-alpha.2",
104
+ "@deepseek-ai/dsh-experimental-terminal-bundle": "0.2.2-alpha.2",
105
+ "@deepseek-ai/dsh-experimental-liveshare": "0.2.2-alpha.2",
106
+ "@deepseek-ai/dsh-experimental-session-search": "0.2.2-alpha.2",
107
+ "@deepseek-ai/dsh-experimental-tool-worktree": "0.2.2-alpha.2",
108
+ "@deepseek-ai/dsh-experimental-plugin-market-bundle": "0.2.2-alpha.2",
109
+ "@deepseek-ai/dsh-personalized-recommendations": "0.2.2-alpha.2",
110
+ "@deepseek-ai/dsh-experimental-forge-bundle": "0.2.2-alpha.2"
111
+ },
112
+ "devDependencies": {
113
+ "@deepseek-ai/dsh-skill-badge": "0.2.2-alpha.2",
114
+ "@deepseek-ai/dsh-webhook-github": "0.2.2-alpha.2",
115
+ "@deepseek-ai/dsh-webhook": "0.2.2-alpha.2",
116
+ "@deepseek-ai/dsh-tool-ralph": "0.2.2-alpha.2",
117
+ "@deepseek-ai/dsh-hooks-codex": "0.2.2-alpha.2",
118
+ "@deepseek-ai/dsh-hooks-claude-code": "0.2.2-alpha.2",
119
+ "@agentclientprotocol/sdk": "1.4.0",
120
+ "@deepseek-ai/dsh-acp": "0.2.2-alpha.2",
121
+ "@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
122
+ "@deepseek-ai/dsh-agent-loop": "0.2.2-alpha.2",
123
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-alpha.2",
124
+ "@deepseek-ai/dsh-attachment-local": "0.2.2-alpha.2",
125
+ "@deepseek-ai/dsh-bash-local": "0.2.2-alpha.2",
126
+ "@deepseek-ai/dsh-credentials-local": "0.2.2-alpha.2",
127
+ "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.2-alpha.2",
128
+ "@deepseek-ai/dsh-experimental-agent-team": "0.2.2-alpha.2",
129
+ "@deepseek-ai/dsh-experimental-ptc-runtime-python": "0.2.2-alpha.2",
130
+ "@deepseek-ai/dsh-experimental-tool-agent-team": "0.2.2-alpha.2",
131
+ "@deepseek-ai/dsh-fs-observation-policy": "0.2.2-alpha.2",
132
+ "@deepseek-ai/dsh-fs-sandbox": "0.2.2-alpha.2",
133
+ "@deepseek-ai/dsh-host-frontend-static": "0.2.2-alpha.2",
134
+ "@deepseek-ai/dsh-host-webserver": "0.2.2-alpha.2",
135
+ "@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
136
+ "@deepseek-ai/dsh-llm-deepseek": "0.2.2-alpha.2",
137
+ "@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.2-alpha.2",
138
+ "@deepseek-ai/dsh-llm-deepseek-account": "0.2.2-alpha.2",
139
+ "@deepseek-ai/dsh-llm-mock-server": "0.2.2-alpha.2",
140
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.2-alpha.2",
141
+ "@deepseek-ai/dsh-llm-replay": "0.2.2-alpha.2",
142
+ "@deepseek-ai/dsh-loader-smoke": "0.2.2-alpha.2",
143
+ "@deepseek-ai/dsh-plugin-package-inventory-deepseek": "0.2.2-alpha.2",
144
+ "@deepseek-ai/dsh-sandbox-local": "0.2.2-alpha.2",
145
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.2-alpha.2",
146
+ "@deepseek-ai/dsh-sdk-client": "0.2.2-alpha.2",
147
+ "@deepseek-ai/dsh-session": "0.2.2-alpha.2",
148
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.2.2-alpha.2",
149
+ "@deepseek-ai/dsh-session-log-deepseek": "0.2.2-alpha.2",
150
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.2-alpha.2",
151
+ "@deepseek-ai/dsh-session-query": "0.2.2-alpha.2",
152
+ "@deepseek-ai/dsh-shell-env": "0.2.2-alpha.2",
153
+ "@deepseek-ai/dsh-settings": "0.2.2-alpha.2",
154
+ "@deepseek-ai/dsh-subagent": "0.2.2-alpha.2",
155
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.2.2-alpha.2",
156
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.2-alpha.2",
157
+ "@deepseek-ai/dsh-subprocess-local": "0.2.2-alpha.2",
158
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.2",
159
+ "@deepseek-ai/dsh-tool-testkit": "0.2.2-alpha.2",
160
+ "@deepseek-ai/dsh-tools": "0.2.2-alpha.2",
161
+ "@deepseek-ai/dsh-user-approval": "0.2.2-alpha.2",
162
+ "@types/js-yaml": "^4.0.9",
163
+ "@types/ws": "8.18.1",
164
+ "ajv": "^8.20.0",
165
+ "execa": "^10.0.1",
166
+ "ws": "8.21.3"
167
+ },
168
+ "exports": {
169
+ "./profile-boot": {
170
+ "types": "./lib/types/profile-boot.d.ts",
171
+ "default": "./lib/profile-boot.js"
172
+ },
173
+ "./lib/*": "./lib/*",
174
+ "./package.json": "./package.json"
175
+ },
176
+ "engines": {
177
+ "node": ">=24.9.0"
178
+ }
179
+ }