@deepseek-ai/dsh-credentials-local 0.0.1-rc.1 → 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/README.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +4 -4
- package/lib/index.js +7 -7
- package/lib/types/index.d.ts +3 -3
- package/package.json +13 -13
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/credentials/credentials-local/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 63895d34fe8396d55c1d6ef29b3e3d9a9dc17264
|
|
6
|
+
README.zh.md: 3c60fb7bbf06a0ae9ec905f36a5c543c2fb6af1b
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The launching environment wins because a per-run override (`DEEPSEEK_API_KEY=…
|
|
|
15
15
|
|
|
16
16
|
Everything below it loses to the managed store, so a key written by the Models page takes effect immediately even when an older key sits in a `.env`. Those two layers still resolve when nothing is stored, and `describe()` names them `project-env` or `user-env` with `writable: true` — storing a key replaces them as the effective source.
|
|
17
17
|
|
|
18
|
-
Under the product CLI, resolution reads the launcher's frozen [environment snapshot](../../util/environment/README.md) rather than `process.env`: only the snapshot can say whether a value came from the launching shell or from a file. A composition the product CLI did not boot has the inherited environment as its only layer, which keeps embedders on the semantics they already had.
|
|
18
|
+
Under the product CLI, resolution reads the launcher's frozen [environment snapshot](../../util/launch-environment/README.md) rather than `process.env`: only the snapshot can say whether a value came from the launching shell or from a file. A composition the product CLI did not boot has the inherited environment as its only layer, which keeps embedders on the semantics they already had.
|
|
19
19
|
|
|
20
20
|
## Config
|
|
21
21
|
|
package/README.zh.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
文件型[凭据](../credentials/README.md)
|
|
5
|
+
文件型[凭据](../credentials/README.md)提供方:四层来源,一套明确的优先级。
|
|
6
6
|
|
|
7
7
|
| 层 | 来源 id | 可写 | 优先 |
|
|
8
8
|
|---|---|---|---|
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
启动环境优先,因为按次覆盖(`DEEPSEEK_API_KEY=… dsh`、CI 机密、容器 `-e`)代表本次运行的操作者意图——而它无法从进程内部修改,就必须*可见地*只读:`describe()` 报告 `source: 'env', writable: false`,`set`/`unset` 直接拒绝,而不是写下一个读取方永远看不到的变更。
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
它之下的所有来源优先级都低于受管存储,因此 Models 页写入的密钥会立即生效,即使某个 `.env` 里还留着更旧的密钥。没有存储任何东西时这两层仍会参与解析,`describe()` 会把来源报告为 `project-env` 或 `user-env` 且 `writable: true`——存入一个密钥就会取代它们成为生效来源。
|
|
17
17
|
|
|
18
|
-
在产品 CLI(命令行界面)下,解析读取的是启动器冻结的[环境快照](../../util/environment/README.md)而不是 `process.env`:只有快照才说得清某个值来自启动 shell 还是来自某个文件。并非由产品 CLI 启动的组合只有继承环境这一层,这让嵌入方保持它们原有的语义。
|
|
18
|
+
在产品 CLI(命令行界面)下,解析读取的是启动器冻结的[环境快照](../../util/launch-environment/README.md)而不是 `process.env`:只有快照才说得清某个值来自启动 shell 还是来自某个文件。并非由产品 CLI 启动的组合只有继承环境这一层,这让嵌入方保持它们原有的语义。
|
|
19
19
|
|
|
20
20
|
## 配置
|
|
21
21
|
|
|
@@ -55,7 +55,7 @@ OPENAI_API_KEY: sk-…
|
|
|
55
55
|
|
|
56
56
|
文档在 `0700` 目录下以 `0600` 权限存放,这挡得住其他 OS 用户,**挡不住**模型。工具进程(bash、文件系统工具)以同一用户身份运行,而已交付的 `workspace-write` 文件策略限制的是修改而非读取,因此它们读这个文件与读该用户拥有的任何其他文件毫无二致;也没有任何沙箱模式会把它单独挑出来。harness 真正守住的更窄:它绝不把该文档的解析后路径交给模型,也绝不把它载入进程环境——这与用户的普通环境层 `$DSH_HOME/.env` 不同(见 [app-boot 的 Harness home 各层](../../boot/app-boot/README.md#profiles))——因此要拿到这个值,需要刻意去读一条并未交给 agent(智能体)的路径。
|
|
57
57
|
|
|
58
|
-
这是审慎,不是边界。必须让提供方密钥远离自身 agent 的部署无法靠文件权限做到;OS
|
|
58
|
+
这是审慎,不是边界。必须让提供方密钥远离自身 agent 的部署无法靠文件权限做到;OS 钥匙串提供方——一种模型运行所在进程根本无法读取的存储——才是延后的答案,它应当作为平级包与本提供方并列。
|
|
59
59
|
|
|
60
60
|
## 模型体验
|
|
61
61
|
|
package/lib/index.js
CHANGED
|
@@ -5,9 +5,9 @@ import { mkdir, readFile, stat } from "node:fs/promises";
|
|
|
5
5
|
import { dirname, join, resolve } from "node:path";
|
|
6
6
|
import { Document, parseDocument } from "yaml";
|
|
7
7
|
import { withFileLock, writeFileAtomic } from "@deepseek-ai/dsh-atomic-write";
|
|
8
|
-
import { canonicalizeWatchPath, resolveDshHome } from "@deepseek-ai/dsh-paths";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { canonicalizeWatchPath, resolveDshHome } from "@deepseek-ai/dsh-home-paths";
|
|
9
|
+
import { launchEnvironmentOf } from "@deepseek-ai/dsh-launch-environment";
|
|
10
|
+
import { CredentialProvider, credentialRef } from "@deepseek-ai/dsh-credentials";
|
|
11
11
|
//#region lib/types/index.js
|
|
12
12
|
/**
|
|
13
13
|
* File-backed credentials provider over `$DSH_HOME/.credentials.yaml`, layered
|
|
@@ -151,7 +151,7 @@ function renderDocument(text, ref, value) {
|
|
|
151
151
|
return document.toString();
|
|
152
152
|
}
|
|
153
153
|
/** File-backed credentials provider (`$DSH_HOME/.credentials.yaml`). */
|
|
154
|
-
var
|
|
154
|
+
var LocalCredentialProvider = class extends CredentialProvider {
|
|
155
155
|
config;
|
|
156
156
|
static Config = z.object({
|
|
157
157
|
path: z.string(),
|
|
@@ -187,7 +187,7 @@ var CredentialsLocal = class extends Credentials {
|
|
|
187
187
|
}
|
|
188
188
|
/** The inherited-environment value for a reference, or `undefined` when empty or unset. */
|
|
189
189
|
inherited(ref) {
|
|
190
|
-
const entry =
|
|
190
|
+
const entry = launchEnvironmentOf(this.ctx).getFrom(ref, ["process"]);
|
|
191
191
|
return entry !== void 0 && entry.value.length > 0 ? entry.value : void 0;
|
|
192
192
|
}
|
|
193
193
|
/**
|
|
@@ -196,7 +196,7 @@ var CredentialsLocal = class extends Credentials {
|
|
|
196
196
|
* environment layering: the more specific location wins.
|
|
197
197
|
*/
|
|
198
198
|
dotenvFallback(ref) {
|
|
199
|
-
const entry =
|
|
199
|
+
const entry = launchEnvironmentOf(this.ctx).getFrom(ref, ["project-env", "user-env"]);
|
|
200
200
|
return entry !== void 0 && entry.value.length > 0 ? entry : void 0;
|
|
201
201
|
}
|
|
202
202
|
async *[Service.init]() {
|
|
@@ -395,4 +395,4 @@ var CredentialsLocal = class extends Credentials {
|
|
|
395
395
|
}
|
|
396
396
|
};
|
|
397
397
|
//#endregion
|
|
398
|
-
export { CREDENTIALS_FILENAME,
|
|
398
|
+
export { CREDENTIALS_FILENAME, LocalCredentialProvider, LocalCredentialProvider as default, parseCredentialsDocument, resolveSpec };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
*/
|
|
37
37
|
import { Context, Service } from '@deepseek-ai/cordis';
|
|
38
38
|
import z from '@deepseek-ai/schemastery';
|
|
39
|
-
import {
|
|
39
|
+
import { CredentialProvider } from '@deepseek-ai/dsh-credentials';
|
|
40
40
|
import type { CredentialInfo, CredentialRef, ResolvedCredential } from '@deepseek-ai/dsh-credentials';
|
|
41
41
|
/** Basename of the credentials document inside the harness home. */
|
|
42
42
|
export declare const CREDENTIALS_FILENAME = ".credentials.yaml";
|
|
@@ -78,7 +78,7 @@ export declare function resolveSpec(config: Config): ResolvedSpec;
|
|
|
78
78
|
*/
|
|
79
79
|
export declare function parseCredentialsDocument(text: string, filename: string): Map<string, string>;
|
|
80
80
|
/** File-backed credentials provider (`$DSH_HOME/.credentials.yaml`). */
|
|
81
|
-
export declare class
|
|
81
|
+
export declare class LocalCredentialProvider extends CredentialProvider {
|
|
82
82
|
config: Config;
|
|
83
83
|
static Config: z<Config>;
|
|
84
84
|
private readonly spec;
|
|
@@ -151,5 +151,5 @@ export declare class CredentialsLocal extends Credentials {
|
|
|
151
151
|
/** Entries whose stored value changed; the parser has already proven every key addressable. */
|
|
152
152
|
private changedRefs;
|
|
153
153
|
}
|
|
154
|
-
export default
|
|
154
|
+
export default LocalCredentialProvider;
|
|
155
155
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-credentials-local",
|
|
3
3
|
"description": "File-backed credentials provider ($DSH_HOME/.env under the live process environment) for the DeepSeek Harness",
|
|
4
|
-
"version": "0.0.1-rc.
|
|
4
|
+
"version": "0.0.1-rc.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "BSD-3-Clause",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-atomic-write": "^0.0.1-rc.
|
|
36
|
-
"@deepseek-ai/dsh-credentials": "^0.0.1-rc.
|
|
37
|
-
"@deepseek-ai/dsh-environment": "^0.0.1-rc.
|
|
38
|
-
"@deepseek-ai/
|
|
39
|
-
"@deepseek-ai/dsh-
|
|
40
|
-
"@deepseek-ai/
|
|
35
|
+
"@deepseek-ai/dsh-atomic-write": "^0.0.1-rc.3",
|
|
36
|
+
"@deepseek-ai/dsh-credentials": "^0.0.1-rc.3",
|
|
37
|
+
"@deepseek-ai/dsh-launch-environment": "^0.0.1-rc.3",
|
|
38
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
39
|
+
"@deepseek-ai/dsh-home-paths": "^0.0.1-rc.3",
|
|
40
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"chokidar": "^4.0.3",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"@deepseek-ai/schemastery": "^3.18.1-rc.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@deepseek-ai/dsh-atomic-write": "^0.0.1-rc.
|
|
49
|
-
"@deepseek-ai/dsh-credentials": "^0.0.1-rc.
|
|
50
|
-
"@deepseek-ai/dsh-environment": "^0.0.1-rc.
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/
|
|
53
|
-
"@deepseek-ai/
|
|
48
|
+
"@deepseek-ai/dsh-atomic-write": "^0.0.1-rc.3",
|
|
49
|
+
"@deepseek-ai/dsh-credentials": "^0.0.1-rc.3",
|
|
50
|
+
"@deepseek-ai/dsh-launch-environment": "^0.0.1-rc.3",
|
|
51
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
52
|
+
"@deepseek-ai/dsh-home-paths": "^0.0.1-rc.3",
|
|
53
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
54
54
|
}
|
|
55
55
|
}
|