@deepseek-ai/dsh-shell-env 0.0.1-rc.3

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 ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, DeepSeek
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/shell/shell-env/README.md
5
+ README.md: b056289bd58e960e9fd36ee84ed20579e7bde42e
6
+ README.zh.md: 3ced6d63525db8a15f9202311c9ca9e32335cab8
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # @deepseek-ai/dsh-shell-env
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ The tool-independent shell environment plugin: owns the `ctx.shellEnv` registry of trusted, per-execution `DSH_*` variables that the model-facing shell tools (`dsh-tool-bash`, `dsh-tool-pwsh`) collect into every shell call's environment. Built-in shell facts (`DSH_HOME`, `DSH_SHELL=1`, `DSH_SESSION_ID`) are owned by the registry itself; other plugins register additional enumerable facts with effect-scoped disposal, and duplicate ownership or undeclared runtime keys fail loudly.
6
+
7
+ The package root exports the Cordis plugin contract (`name`, `inject`, `Config`, `apply`) plus the `ShellEnvRegistry` service class and its contributor types; consumers use `ctx.shellEnv` after loading this plugin.
8
+
9
+ ## Config
10
+
11
+ ```yaml
12
+ - id: shell-env
13
+ name: '@deepseek-ai/dsh-shell-env'
14
+ config:
15
+ dshHome: C:\Users\me\.dsh # default: $DSH_HOME, then ~/.dsh
16
+ ```
17
+
18
+ ## Managed environment
19
+
20
+ Every foreground and background model shell call receives a newly collected trusted `DSH_*` environment. `DSH_HOME` is the absolute Harness home resolved by [`@deepseek-ai/dsh-home-paths`](../../util/home-paths/README.md) (`dshHome` config, then ambient `$DSH_HOME`, then `~/.dsh`) and `DSH_SHELL=1` identifies the managed child. Agent calls additionally receive `DSH_SESSION_ID=agent.session.header.id`; when the active persistence seam locates a JSONL artifact they also receive `DSH_SESSION_JSONL=<absolute target path>`. The JSONL path is a location hint: it may not exist before the first flush or contain the current buffered turn, and it is not an authorization credential.
21
+
22
+ `ctx.shellEnv` owns collection. Other plugins can register an effect-scoped contributor with a stable name, declared keys/descriptions, and `resolve(execution: ToolExecution)`; duplicate ownership and undeclared runtime keys fail loudly, while `list()` enumerates declarations without executing providers. Harness built-ins reserve `DSH_HOME`, `DSH_SHELL`, and `DSH_SESSION_ID`; this plugin's persistence translator owns `DSH_SESSION_JSONL` by reading the backend-neutral `sessionPersistence.locate()` seam.
23
+
24
+ ```ts
25
+ import type { Context } from '@deepseek-ai/cordis'
26
+ import type {} from '@deepseek-ai/dsh-shell-env'
27
+
28
+ export const inject = ['shellEnv']
29
+
30
+ export function apply(ctx: Context): void {
31
+ ctx.shellEnv.register({
32
+ name: 'deployment-region',
33
+ variables: { DSH_DEPLOYMENT_REGION: { description: 'Current deployment region.' } },
34
+ resolve: execution => execution.agent === undefined ? {} : { DSH_DEPLOYMENT_REGION: 'cn-north' },
35
+ })
36
+ }
37
+ ```
38
+
39
+ The overlay is computed from the current `ToolExecution` and passed through the dedicated `ShellExecRequest.dshEnv` channel. The local executors remove all inherited `DSH_*` before merging that snapshot, so nested harnesses and concurrent parent/child agents cannot leak stale identities. `process.env` is never modified. The shell tools' descriptions teach the generic `$DSH_*` convention rather than naming persistence-specific variables or adding a permanent system-prompt section.
40
+
41
+ ## Model Experience
42
+
43
+ Indirectly, through the shell tools (`dsh-tool-bash`, `dsh-tool-pwsh`), which collect this registry's managed `DSH_*` snapshot into every shell-tool call.
44
+
45
+ #### KV Cache effect
46
+
47
+ No direct invalidation; the named consumers own any request-prefix changes.
48
+
49
+ ## Known Limitations and Deferred Work
50
+
51
+ - **`list()` enumerates contributor-declared variables only** — registry-owned built-ins (`DSH_HOME`, `DSH_SHELL`, `DSH_SESSION_ID`) are not included, so diagnostics, prompt, or UI code must not treat `list()` as an exhaustive environment catalog.
package/README.zh.md ADDED
@@ -0,0 +1,51 @@
1
+ # @deepseek-ai/dsh-shell-env
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 工具无关的 shell 环境插件:拥有 `ctx.shellEnv` 注册表,管理受信任的、每次执行收集的 `DSH_*` 变量,供模型可见的 shell 工具(`dsh-tool-bash`、`dsh-tool-pwsh`)收集进每次 shell 调用的环境。内置 shell 事实(`DSH_HOME`、`DSH_SHELL=1`、`DSH_SESSION_ID`)归注册表自身所有;其他插件可以注册额外的可枚举事实,注册随插件纤维(fiber)释放,重复所有权或未声明的运行时键会响亮失败。
6
+
7
+ 包根导出 Cordis 插件约定(`name`、`inject`、`Config`、`apply`)以及 `ShellEnvRegistry` 服务类及其 contributor 类型;消费方在加载本插件后使用 `ctx.shellEnv`。
8
+
9
+ ## Config
10
+
11
+ ```yaml
12
+ - id: shell-env
13
+ name: '@deepseek-ai/dsh-shell-env'
14
+ config:
15
+ dshHome: C:\Users\me\.dsh # default: $DSH_HOME, then ~/.dsh
16
+ ```
17
+
18
+ ## Managed environment
19
+
20
+ 每次前台与后台模型 shell 调用都会收到一份新收集的受信任 `DSH_*` 环境。`DSH_HOME` 是由 [`@deepseek-ai/dsh-home-paths`](../../util/home-paths/README.md) 解析的 Harness 主目录绝对路径(`dshHome` 配置,然后环境变量 `$DSH_HOME`,然后 `~/.dsh`),`DSH_SHELL=1` 标识受管理的子进程。带 agent(智能体)的调用额外收到 `DSH_SESSION_ID=agent.session.header.id`;当活动的持久化 seam 定位到 JSONL 工件时,它们还会收到 `DSH_SESSION_JSONL=<绝对目标路径>`。JSONL 路径只是位置提示:首次 flush 之前它可能不存在,也不一定包含当前缓冲中的轮次,并且它不是授权凭据。
21
+
22
+ `ctx.shellEnv` 负责收集。其他插件可以注册一个受 effect 作用域约束的 contributor,带有稳定名称、已声明的键/描述以及 `resolve(execution: ToolExecution)`;重复所有权与未声明的运行时键会响亮失败,而 `list()` 只枚举声明、不执行 provider。Harness 内置键保留 `DSH_HOME`、`DSH_SHELL` 与 `DSH_SESSION_ID`;本插件的持久化翻译器通过读取与后端无关的 `sessionPersistence.locate()` seam 拥有 `DSH_SESSION_JSONL`。
23
+
24
+ ```ts
25
+ import type { Context } from '@deepseek-ai/cordis'
26
+ import type {} from '@deepseek-ai/dsh-shell-env'
27
+
28
+ export const inject = ['shellEnv']
29
+
30
+ export function apply(ctx: Context): void {
31
+ ctx.shellEnv.register({
32
+ name: 'deployment-region',
33
+ variables: { DSH_DEPLOYMENT_REGION: { description: 'Current deployment region.' } },
34
+ resolve: execution => execution.agent === undefined ? {} : { DSH_DEPLOYMENT_REGION: 'cn-north' },
35
+ })
36
+ }
37
+ ```
38
+
39
+ 覆盖层根据当前 `ToolExecution` 计算,并通过专用的 `ShellExecRequest.dshEnv` 通道传递。本地执行器在合并该快照前移除所有继承的 `DSH_*`,因此嵌套 harness 与并发的父子 agent 无法泄漏陈旧身份。`process.env` 永不被修改。shell 工具的描述只教授通用的 `$DSH_*` 约定,而不是点名持久化相关的变量或添加常驻的 system-prompt 段落。
40
+
41
+ ## Model Experience
42
+
43
+ 通过 shell 工具(`dsh-tool-bash`、`dsh-tool-pwsh`)间接产生影响;这些工具会把该注册表的受管 `DSH_*` 快照收集进每次 shell 工具调用。
44
+
45
+ #### KV Cache effect
46
+
47
+ 不会直接导致缓存失效;任何请求前缀变更均由上述消费方负责。
48
+
49
+ ## Known Limitations and Deferred Work
50
+
51
+ - **`list()` 只枚举 contributor 声明的变量** — 注册表自有的内置键(`DSH_HOME`、`DSH_SHELL`、`DSH_SESSION_ID`)不包含在内,因此诊断、prompt 或 UI 代码不得把 `list()` 当作完整的环境目录。
package/lib/index.js ADDED
@@ -0,0 +1,129 @@
1
+ import { Service } from "@deepseek-ai/cordis";
2
+ import z from "@deepseek-ai/schemastery";
3
+ import { DSH_ENV_PREFIX } from "@deepseek-ai/dsh-shell";
4
+ import { DSH_HOME_ENV, resolveDshHome } from "@deepseek-ai/dsh-home-paths";
5
+ //#region lib/types/index.js
6
+ /**
7
+ * Tool-independent shell environment plugin: owns the `ctx.shellEnv` registry of
8
+ * trusted, per-execution `DSH_*` variables consumed by the model-facing shell
9
+ * tools (`dsh-tool-bash`, `dsh-tool-pwsh`). Built-in shell facts are owned by
10
+ * the registry itself while plugins can register additional, enumerable facts
11
+ * with effect-scoped disposal.
12
+ *
13
+ * @module @deepseek-ai/dsh-shell-env
14
+ */
15
+ const name = "shell-env";
16
+ const inject = [];
17
+ /** Runtime configuration schema for the shell-env plugin. */
18
+ const Config = z.object({ dshHome: z.string() });
19
+ const DSH_SHELL_KEY = `${DSH_ENV_PREFIX}SHELL`;
20
+ const DSH_SESSION_ID_KEY = `${DSH_ENV_PREFIX}SESSION_ID`;
21
+ const DSH_SESSION_JSONL_KEY = `${DSH_ENV_PREFIX}SESSION_JSONL`;
22
+ const RESERVED_BASH_ENV_KEYS = new Set([
23
+ DSH_HOME_ENV,
24
+ DSH_SHELL_KEY,
25
+ DSH_SESSION_ID_KEY
26
+ ]);
27
+ const BASH_ENV_KEY_SUFFIX = /^[A-Z][A-Z0-9_]*$/;
28
+ /**
29
+ * Registry (`ctx.shellEnv`) for trusted, per-execution `DSH_*` variables.
30
+ * The namespace is rebuilt for every model shell call: ambient `DSH_*` values
31
+ * are discarded by the executor, then the registry's current snapshot is
32
+ * injected. Built-in shell facts remain owned by the registry itself while
33
+ * plugins can register additional, enumerable facts with effect-scoped
34
+ * disposal.
35
+ */
36
+ var ShellEnvRegistry = class extends Service {
37
+ contributors = /* @__PURE__ */ new Map();
38
+ keyOwners = /* @__PURE__ */ new Map();
39
+ dshHome;
40
+ /**
41
+ * Create and install the `ctx.shellEnv` service.
42
+ * @param ctx - Cordis context that owns the service and registrations.
43
+ * @param config - home-directory configuration for the built-in variables.
44
+ */
45
+ constructor(ctx, config = {}) {
46
+ super(ctx, "shellEnv");
47
+ this.dshHome = resolveDshHome(config.dshHome);
48
+ }
49
+ /**
50
+ * Register one environment contributor. Names and keys are unique; built-in
51
+ * keys are reserved. Registration is disposed with the calling plugin fiber.
52
+ * @param contributor - declared key ownership and per-execution resolver.
53
+ * @returns the disposer that unregisters the contribution.
54
+ */
55
+ register(contributor) {
56
+ const dispose = this.ctx.effect(function* () {
57
+ if (contributor.name.trim().length === 0) throw new Error("bash env contributor name must be non-empty");
58
+ if (this.contributors.has(contributor.name)) throw new Error(`bash env contributor "${contributor.name}" is already registered`);
59
+ const variables = Object.entries(contributor.variables);
60
+ for (const [key, variable] of variables) {
61
+ if (!key.startsWith(DSH_ENV_PREFIX) || !BASH_ENV_KEY_SUFFIX.test(key.slice(DSH_ENV_PREFIX.length))) throw new Error(`bash env contributor "${contributor.name}" declared invalid key "${key}"`);
62
+ if (RESERVED_BASH_ENV_KEYS.has(key)) throw new Error(`bash env contributor "${contributor.name}" cannot own reserved key "${key}"`);
63
+ if (variable.description.trim().length === 0) throw new Error(`bash env contributor "${contributor.name}" must describe "${key}"`);
64
+ const owner = this.keyOwners.get(key);
65
+ if (owner !== void 0) throw new Error(`bash env key "${key}" is already owned by contributor "${owner}"; contributor "${contributor.name}" cannot also own it`);
66
+ }
67
+ this.contributors.set(contributor.name, contributor);
68
+ for (const [key] of variables) this.keyOwners.set(key, contributor.name);
69
+ yield () => {
70
+ this.contributors.delete(contributor.name);
71
+ for (const [key] of variables) this.keyOwners.delete(key);
72
+ };
73
+ }.bind(this), "bashEnv.register()");
74
+ return () => void dispose();
75
+ }
76
+ /**
77
+ * Build the trusted `DSH_*` snapshot for one shell tool execution.
78
+ * @param execution - the current tool execution.
79
+ * @returns an immutable environment overlay containing built-ins and current contributions.
80
+ */
81
+ collect(execution) {
82
+ const values = {
83
+ [DSH_HOME_ENV]: this.dshHome,
84
+ [DSH_SHELL_KEY]: "1"
85
+ };
86
+ if (execution.agent !== void 0) values[DSH_SESSION_ID_KEY] = execution.agent.session.header.id;
87
+ for (const contributor of [...this.contributors.values()].sort((left, right) => left.name.localeCompare(right.name))) {
88
+ const resolved = contributor.resolve(execution);
89
+ for (const [rawKey, value] of Object.entries(resolved)) {
90
+ const key = rawKey;
91
+ if (!Object.hasOwn(contributor.variables, key)) throw new Error(`bash env contributor "${contributor.name}" returned undeclared key "${key}"`);
92
+ if (typeof value !== "string") throw new Error(`bash env contributor "${contributor.name}" returned a non-string value for "${key}"`);
93
+ values[key] = value;
94
+ }
95
+ }
96
+ return Object.freeze(Object.fromEntries(Object.entries(values).sort(([left], [right]) => left.localeCompare(right))));
97
+ }
98
+ /**
99
+ * Enumerate plugin-contributed variables without executing their resolvers.
100
+ * @returns declarations sorted by environment variable name.
101
+ */
102
+ list() {
103
+ return [...this.contributors.values()].flatMap((contributor) => Object.entries(contributor.variables).map(([key, variable]) => ({
104
+ contributor: contributor.name,
105
+ description: variable.description,
106
+ key
107
+ }))).sort((left, right) => left.key.localeCompare(right.key));
108
+ }
109
+ };
110
+ /**
111
+ * Load the shell-env plugin: register the `ctx.shellEnv` service and the
112
+ * shell-agnostic persistence contributor (`DSH_SESSION_JSONL`).
113
+ * @param ctx - Cordis context that owns the service and registrations.
114
+ * @param config - home-directory configuration for the built-in variables.
115
+ */
116
+ function apply(ctx, config = {}) {
117
+ new ShellEnvRegistry(ctx, config).register({
118
+ name: "session-persistence",
119
+ variables: { [DSH_SESSION_JSONL_KEY]: { description: "Absolute target path of the current session JSONL when the active persistence backend provides one." } },
120
+ resolve(execution) {
121
+ const agent = execution.agent;
122
+ if (agent === void 0) return {};
123
+ const location = ctx.get("sessionPersistence")?.locate(agent.session.header);
124
+ return location?.kind === "jsonl" ? { [DSH_SESSION_JSONL_KEY]: location.path } : {};
125
+ }
126
+ });
127
+ }
128
+ //#endregion
129
+ export { Config, ShellEnvRegistry, apply, inject, name };
@@ -0,0 +1,23 @@
1
+ //#region lib/types/invariant.js
2
+ /**
3
+ * Package-owned invariant companion for `@deepseek-ai/dsh-shell-env`.
4
+ * @module @deepseek-ai/dsh-shell-env/invariant
5
+ */
6
+ const PACKAGE_NAME = "@deepseek-ai/dsh-shell-env";
7
+ /** Cordis companion plugin name. */
8
+ const name = "shell-env-invariant";
9
+ /** Service required before the companion can reserve package ownership. */
10
+ const inject = ["invariants"];
11
+ /**
12
+ * No runtime invariant: the environment registry validates ownership and collected values at each
13
+ * registration/collection; it publishes no independent snapshot that a companion could cross-check.
14
+ */
15
+ const install = () => {};
16
+ /**
17
+ * Register this package's invariant companion.
18
+ * @param ctx - Cordis context carrying the invariant service.
19
+ * @returns the installed registration's disposer after setup succeeds.
20
+ */
21
+ const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
22
+ //#endregion
23
+ export { apply, inject, name };
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Tool-independent shell environment plugin: owns the `ctx.shellEnv` registry of
3
+ * trusted, per-execution `DSH_*` variables consumed by the model-facing shell
4
+ * tools (`dsh-tool-bash`, `dsh-tool-pwsh`). Built-in shell facts are owned by
5
+ * the registry itself while plugins can register additional, enumerable facts
6
+ * with effect-scoped disposal.
7
+ *
8
+ * @module @deepseek-ai/dsh-shell-env
9
+ */
10
+ import { Service, type Context } from '@deepseek-ai/cordis';
11
+ import z from '@deepseek-ai/schemastery';
12
+ import type { DshEnvironment, DshEnvironmentKey } from '@deepseek-ai/dsh-shell';
13
+ import type { ToolExecution } from '@deepseek-ai/dsh-tools';
14
+ declare module '@deepseek-ai/cordis' {
15
+ interface Context {
16
+ shellEnv: ShellEnvRegistry;
17
+ }
18
+ }
19
+ export declare const name = "shell-env";
20
+ export declare const inject: string[];
21
+ /** Plugin config (all optional — the built-in facts resolve without defaults). */
22
+ export interface Config {
23
+ /** DeepSeek Harness home directory exposed as `DSH_HOME`; defaults to `$DSH_HOME` or `~/.dsh`. */
24
+ dshHome?: string;
25
+ }
26
+ /** Runtime configuration schema for the shell-env plugin. */
27
+ export declare const Config: z<Config>;
28
+ /** Model-visible metadata for one managed `DSH_*` environment variable. */
29
+ export interface BashEnvVariable {
30
+ /** Concise description of the environment fact represented by the variable. */
31
+ description: string;
32
+ }
33
+ /**
34
+ * A plugin contribution to the managed environment of each model shell call.
35
+ * Declared keys make ownership conflicts detectable before the first command;
36
+ * `resolve` computes only the values available for the current execution.
37
+ */
38
+ export interface BashEnvContributor {
39
+ /** Stable contributor name used in diagnostics and duplicate detection. */
40
+ name: string;
41
+ /** Complete set of `DSH_*` keys this contributor may return. */
42
+ variables: Readonly<Record<DshEnvironmentKey, BashEnvVariable>>;
43
+ /**
44
+ * Resolve this contributor's available values for one tool execution.
45
+ * @param execution - the shell tool execution and its optional calling agent.
46
+ * @returns a partial map containing only keys declared in {@link variables}.
47
+ */
48
+ resolve(execution: ToolExecution): Readonly<Partial<Record<DshEnvironmentKey, string>>>;
49
+ }
50
+ /** An enumerable declaration returned by {@link ShellEnvRegistry.list}. */
51
+ export interface BashEnvVariableInfo extends BashEnvVariable {
52
+ /** Contributor that owns the variable. */
53
+ contributor: string;
54
+ /** Declared `DSH_*` environment variable name. */
55
+ key: DshEnvironmentKey;
56
+ }
57
+ /**
58
+ * Registry (`ctx.shellEnv`) for trusted, per-execution `DSH_*` variables.
59
+ * The namespace is rebuilt for every model shell call: ambient `DSH_*` values
60
+ * are discarded by the executor, then the registry's current snapshot is
61
+ * injected. Built-in shell facts remain owned by the registry itself while
62
+ * plugins can register additional, enumerable facts with effect-scoped
63
+ * disposal.
64
+ */
65
+ export declare class ShellEnvRegistry extends Service {
66
+ private readonly contributors;
67
+ private readonly keyOwners;
68
+ private readonly dshHome;
69
+ /**
70
+ * Create and install the `ctx.shellEnv` service.
71
+ * @param ctx - Cordis context that owns the service and registrations.
72
+ * @param config - home-directory configuration for the built-in variables.
73
+ */
74
+ constructor(ctx: Context, config?: Config);
75
+ /**
76
+ * Register one environment contributor. Names and keys are unique; built-in
77
+ * keys are reserved. Registration is disposed with the calling plugin fiber.
78
+ * @param contributor - declared key ownership and per-execution resolver.
79
+ * @returns the disposer that unregisters the contribution.
80
+ */
81
+ register(contributor: BashEnvContributor): () => void;
82
+ /**
83
+ * Build the trusted `DSH_*` snapshot for one shell tool execution.
84
+ * @param execution - the current tool execution.
85
+ * @returns an immutable environment overlay containing built-ins and current contributions.
86
+ */
87
+ collect(execution: ToolExecution): DshEnvironment;
88
+ /**
89
+ * Enumerate plugin-contributed variables without executing their resolvers.
90
+ * @returns declarations sorted by environment variable name.
91
+ */
92
+ list(): BashEnvVariableInfo[];
93
+ }
94
+ /**
95
+ * Load the shell-env plugin: register the `ctx.shellEnv` service and the
96
+ * shell-agnostic persistence contributor (`DSH_SESSION_JSONL`).
97
+ * @param ctx - Cordis context that owns the service and registrations.
98
+ * @param config - home-directory configuration for the built-in variables.
99
+ */
100
+ export declare function apply(ctx: Context, config?: Config): void;
101
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Package-owned invariant companion for `@deepseek-ai/dsh-shell-env`.
3
+ * @module @deepseek-ai/dsh-shell-env/invariant
4
+ */
5
+ import type { Context } from '@deepseek-ai/cordis';
6
+ /** Cordis companion plugin name. */
7
+ export declare const name = "shell-env-invariant";
8
+ /** Service required before the companion can reserve package ownership. */
9
+ export declare const inject: string[];
10
+ /**
11
+ * Register this package's invariant companion.
12
+ * @param ctx - Cordis context carrying the invariant service.
13
+ * @returns the installed registration's disposer after setup succeeds.
14
+ */
15
+ export declare const apply: (ctx: Context) => Promise<() => void>;
16
+ //# sourceMappingURL=invariant.d.ts.map
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@deepseek-ai/dsh-shell-env",
3
+ "description": "Tool-independent managed DSH_* shell environment registry",
4
+ "version": "0.0.1-rc.3",
5
+ "publishConfig": {
6
+ "access": "restricted"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "packages/shell/shell-env"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./invariant": {
22
+ "types": "./lib/types/invariant.d.ts",
23
+ "default": "./lib/invariant.js"
24
+ },
25
+ "./src/*": "./src/*",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "lib/index.js",
30
+ "lib/invariant.js",
31
+ "lib/types/**/*.d.ts"
32
+ ],
33
+ "license": "BSD-3-Clause",
34
+ "peerDependencies": {
35
+ "@deepseek-ai/dsh-shell": "^0.0.1-rc.3",
36
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
37
+ "@deepseek-ai/dsh-home-paths": "^0.0.1-rc.3",
38
+ "@deepseek-ai/dsh-session-persistence": "^0.0.1-rc.3",
39
+ "@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
40
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
41
+ },
42
+ "dependencies": {
43
+ "@deepseek-ai/schemastery": "^3.18.1-rc.1"
44
+ },
45
+ "devDependencies": {
46
+ "@deepseek-ai/dsh-agent": "^0.0.1-rc.3",
47
+ "@deepseek-ai/dsh-shell": "^0.0.1-rc.3",
48
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
49
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
50
+ "@deepseek-ai/dsh-home-paths": "^0.0.1-rc.3",
51
+ "@deepseek-ai/dsh-session-persistence": "^0.0.1-rc.3",
52
+ "@deepseek-ai/dsh-tools": "^0.0.1-rc.3",
53
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
54
+ }
55
+ }