@dsh-plus/secret-env 0.1.5 → 0.1.7

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/lib/index.d.ts CHANGED
@@ -44,7 +44,7 @@ interface InheritedEntry {
44
44
  //#endregion
45
45
  //#region src/service.d.ts
46
46
  declare class SecretEnvService extends Service {
47
- static [Context.inject]: string[];
47
+ static inject: string[];
48
48
  /** 全局值镜像(seam resolve 为异步,contributor 同步读这里)。 */
49
49
  private readonly globalMirror;
50
50
  /** 会话桶:sessionId → 后缀 → 条目。 */
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
- import { Context, Service } from "@deepseek-ai/cordis";
2
+ import { Service } from "@deepseek-ai/cordis";
3
3
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
4
4
  //#region src/ns.ts
5
5
  /**
@@ -311,23 +311,8 @@ function inheritedEntriesOf(suffixes, globalMasked, sessionMask) {
311
311
  }
312
312
  //#endregion
313
313
  //#region src/service.ts
314
- /**
315
- * secret-env 服务主体(host 半):
316
- * - 全局臂:值经 dsh-credentials seam 持久($DSH_HOME/.credentials.yaml),
317
- * 服务内存中维护同步镜像(contributor.resolve 是同步签名,无法现查异步 seam);
318
- * - 会话臂:Map<SessionId, Map<后缀, 值>> 纯内存,session/disposed 清除;
319
- * - 屏蔽臂:全局屏蔽名单持久于 settings(继承变量主要开关),
320
- * 会话级屏蔽纯内存;两级都在 contributor resolve 时现判;
321
- * - 注入臂:每个变量名一个 dsh-shell-env contributor(ContributorBook),
322
- * 每次 shell 执行由注册表 collect 现取——写入/删除/屏蔽下一条命令即生效,
323
- * 不进消息流、不动前缀。继承变量(宿主环境 DSH_VAR_*)平台默认剥离,
324
- * 本服务按「默认纳入」逐一转发,可被屏蔽名单拦截。
325
- *
326
- * 红线:值只流经「端点 → 本服务 → dshEnv」,任何日志/事件/返回值不带值。
327
- * @module secret-env/service
328
- */
329
314
  var SecretEnvService = class extends Service {
330
- static [Context.inject] = ["credentials", "shellEnv"];
315
+ static inject = ["credentials", "shellEnv"];
331
316
  /** 全局值镜像(seam resolve 为异步,contributor 同步读这里)。 */
332
317
  globalMirror = /* @__PURE__ */ new Map();
333
318
  /** 会话桶:sessionId → 后缀 → 条目。 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-plus/secret-env",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "dsh-plus service+ui plugin: 密钥环境变量——以 $DSH_VAR_* 变量名向 agent 暴露密钥(全局持久/会话级/一次性),执行期经 dsh-shell-env 原生注入,值不进消息流,不影响缓存率",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -19,25 +19,25 @@
19
19
  "src"
20
20
  ],
21
21
  "dependencies": {
22
- "@dsh-plus/shared": "0.1.11"
22
+ "@dsh-plus/shared": "0.1.13"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@deepseek-ai/cordis": "^4.0.2",
26
- "@deepseek-ai/dsh-credentials": "*",
27
- "@deepseek-ai/dsh-host-webserver": "*",
28
- "@deepseek-ai/dsh-settings": "*",
29
- "@deepseek-ai/dsh-shell-env": "*",
26
+ "@deepseek-ai/dsh-credentials": "^0.1.5-alpha.2",
27
+ "@deepseek-ai/dsh-host-webserver": "^0.1.5-alpha.2",
28
+ "@deepseek-ai/dsh-settings": "^0.1.5-alpha.2",
29
+ "@deepseek-ai/dsh-shell-env": "^0.1.5-alpha.2",
30
30
  "@deepseek-ai/schemastery": "^3.18.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@deepseek-ai/cordis": "4.0.2",
34
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.5-alpha.1",
35
- "@deepseek-ai/dsh-credentials": "0.1.5-alpha.1",
36
- "@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.1",
37
- "@deepseek-ai/dsh-session": "0.1.5-alpha.1",
38
- "@deepseek-ai/dsh-settings": "0.1.5-alpha.1",
39
- "@deepseek-ai/dsh-shell-env": "0.1.5-alpha.1",
40
- "@deepseek-ai/dsh-tools": "0.1.5-alpha.1",
34
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.5-alpha.2",
35
+ "@deepseek-ai/dsh-credentials": "0.1.5-alpha.2",
36
+ "@deepseek-ai/dsh-host-webserver": "0.1.5-alpha.2",
37
+ "@deepseek-ai/dsh-session": "0.1.5-alpha.2",
38
+ "@deepseek-ai/dsh-settings": "0.1.5-alpha.2",
39
+ "@deepseek-ai/dsh-shell-env": "0.1.5-alpha.2",
40
+ "@deepseek-ai/dsh-tools": "0.1.5-alpha.2",
41
41
  "@deepseek-ai/schemastery": "3.18.2",
42
42
  "@types/node": "26.4.0",
43
43
  "@types/react": "~18.3.31",
package/src/service.ts CHANGED
@@ -13,7 +13,8 @@
13
13
  * 红线:值只流经「端点 → 本服务 → dshEnv」,任何日志/事件/返回值不带值。
14
14
  * @module secret-env/service
15
15
  */
16
- import { Context, Service } from '@deepseek-ai/cordis'
16
+ import type { Context } from '@deepseek-ai/cordis'
17
+ import { Service } from '@deepseek-ai/cordis'
17
18
  import { type CredentialInfo, credentialRef } from '@deepseek-ai/dsh-credentials'
18
19
  import type {} from '@deepseek-ai/dsh-session'
19
20
  import type {} from '@deepseek-ai/dsh-settings'
@@ -50,7 +51,9 @@ interface SettingsLike {
50
51
  }
51
52
 
52
53
  export class SecretEnvService extends Service {
53
- static [Context.inject] = ['credentials', 'shellEnv']
54
+ // 普通 static inject:cordis 4.0.2 不存在 Context.inject 符号(computed key
55
+ // 会失效为 'undefined' 使声明无效);构造期读 ctx.shellEnv/credentials 依赖此声明。
56
+ static inject = ['credentials', 'shellEnv']
54
57
 
55
58
  /** 全局值镜像(seam resolve 为异步,contributor 同步读这里)。 */
56
59
  private readonly globalMirror = new Map<string, string>()