feat(credentials): file-backed provider layering process env over $DSH_HOME/.env

Live environment wins read-only (shadowed writes reject instead of
appearing to succeed); the file is the writable source with byte-preserving
line edits, a quoting ladder dotenv reads back verbatim, atomic 0600
writes, wholesale snapshot replacement on reload, and write-drain
teardown.
This commit is contained in:
Yichen Jiang
2026-07-29 13:14:20 +08:00
parent 3a794495ad
commit aee06097ee
11 changed files with 1089 additions and 0 deletions

34
pnpm-lock.yaml generated
View File

@@ -2074,6 +2074,34 @@ importers:
specifier: ^4.0.0-rc.7
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
packages/credentials/credentials-local:
dependencies:
chokidar:
specifier: ^4.0.3
version: 4.0.3
dotenv:
specifier: ^17.2.0
version: 17.4.2
schemastery:
specifier: ^3.18.0
version: 3.18.0
devDependencies:
'@deepseek-ai/dsh-atomic-write':
specifier: workspace:^
version: link:../../util/atomic-write
'@deepseek-ai/dsh-credentials':
specifier: workspace:^
version: link:../credentials
'@deepseek-ai/dsh-invariants':
specifier: workspace:^
version: link:../../support/invariants
'@deepseek-ai/dsh-paths':
specifier: workspace:^
version: link:../../util/paths
cordis:
specifier: ^4.0.0-rc.7
version: 4.0.0-rc.7(@cordisjs/plugin-include@1.0.4)(@cordisjs/plugin-loader@1.0.0-rc.5)
packages/examples/acp-demo:
devDependencies:
'@cordisjs/plugin-include':
@@ -8637,6 +8665,10 @@ packages:
dompurify@3.4.11:
resolution: {integrity: sha512-zhlUV12GsaRzMsf9q5M254YhA4+VuF0fG+QFqu6aYpoGlKtz+w8//jBcGVYBgQkR5GHjUomejY84AV+/uPbWdw==}
dotenv@17.4.2:
resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==}
engines: {node: '>=12'}
dts-resolver@3.0.0:
resolution: {integrity: sha512-1T1f+z+4tl9XD+m+0HBgWoL/nm0bOIffyWaUuUSBlFg/86IWvfx+wjNaO/ybU0AJzG9/Mi5hBUgGV6zCmWEN7Q==}
engines: {node: ^22.18.0 || >=24.0.0}
@@ -13610,6 +13642,8 @@ snapshots:
optionalDependencies:
'@types/trusted-types': 2.0.7
dotenv@17.4.2: {}
dts-resolver@3.0.0(oxc-resolver@11.20.0):
optionalDependencies:
oxc-resolver: 11.20.0