@deepseek-ai/dsh-storage 0.1.2-alpha.3 → 0.1.2-alpha.5
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 +1 -1
- package/lib/types/backend.d.ts +22 -0
- package/package.json +2 -9
- package/lib/invariant.js +0 -25
- package/lib/types/invariant.d.ts +0 -16
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/storage/storage/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 27034b7d3fa67216e777d31c54ceb96dc6c16338
|
|
6
|
+
README.zh.md: 595070f2f2e5f7628063cfa442ea924becf3b4e8
|
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ The hub is a pure registration table with two faces, designed so backends and da
|
|
|
86
86
|
| [`src/registry.ts`](src/registry.ts) | `BackendRegistry`: name → backend table, registration disposers |
|
|
87
87
|
| [`src/backend.ts`](src/backend.ts) | The backend contract: facets, units, `UNIT_NAME_RE` |
|
|
88
88
|
| [`src/error.ts`](src/error.ts) | `StorageError` codes shared by the hub and every backend |
|
|
89
|
-
|
|
|
89
|
+
| — | No runtime invariant companion is published; the hub is a pure registration table (names → backends, forms → facilities) whose consistency is fully enforced at the call sites (duplicate/missing entries fail loud synchronously); it owns no event stream or mutable medium to cross-check. |
|
|
90
90
|
| [`tests/contract.ts`](tests/contract.ts) | The shared conformance suite run against each backend |
|
|
91
91
|
|
|
92
92
|
</details>
|
package/README.zh.md
CHANGED
|
@@ -86,7 +86,7 @@ kind: "package-reference"
|
|
|
86
86
|
| [`src/registry.ts`](src/registry.ts) | `BackendRegistry`:名称 → 后端表、注册资源释放函数 |
|
|
87
87
|
| [`src/backend.ts`](src/backend.ts) | 后端约定:分面、单元、`UNIT_NAME_RE` |
|
|
88
88
|
| [`src/error.ts`](src/error.ts) | 枢纽与每个后端共享的 `StorageError` 代码 |
|
|
89
|
-
|
|
|
89
|
+
| — | 不发布运行时不变式伴生入口;纯注册表。 |
|
|
90
90
|
| [`tests/contract.ts`](tests/contract.ts) | 针对每个后端运行的共享一致性套件 |
|
|
91
91
|
|
|
92
92
|
</details>
|
package/lib/types/backend.d.ts
CHANGED
|
@@ -56,6 +56,16 @@ export interface KvUnitDescriptor {
|
|
|
56
56
|
* foreign documents.
|
|
57
57
|
*/
|
|
58
58
|
readonly layout?: 'single' | 'per-record';
|
|
59
|
+
/**
|
|
60
|
+
* Older unit versions whose stored records are also readable under the
|
|
61
|
+
* declaring owner's current record schemas (the owner vouches for that —
|
|
62
|
+
* typically by declaring the fields old records lack as optional). Reads of
|
|
63
|
+
* a `per-record` unit accept documents stamped with any listed version, and
|
|
64
|
+
* the legacy whole-unit bootstrap accepts a legacy file stamped with one;
|
|
65
|
+
* writes always stamp {@link version}. `single`-layout reads stay
|
|
66
|
+
* exact-version.
|
|
67
|
+
*/
|
|
68
|
+
readonly compatibleVersions?: readonly number[];
|
|
59
69
|
}
|
|
60
70
|
/**
|
|
61
71
|
* One opened unit. Values are opaque JSON to this layer: no schema, no
|
|
@@ -93,6 +103,18 @@ export interface KvUnit {
|
|
|
93
103
|
* @returns resolution after durability.
|
|
94
104
|
*/
|
|
95
105
|
deleteRecord(table: string, key: string): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Move one record's stored document out of the unit's readable set,
|
|
108
|
+
* preserving its bytes for inspection instead of deleting them. Backends
|
|
109
|
+
* whose medium has no per-record document to move (the `single` layout, a
|
|
110
|
+
* row store) omit this member, and the caller falls back to its
|
|
111
|
+
* reject-loud path. Absent after the move: a later {@link loadAll} reads
|
|
112
|
+
* the key as missing and a later {@link putRecord} recreates it fresh.
|
|
113
|
+
* @param table - Declared table name.
|
|
114
|
+
* @param key - Record key.
|
|
115
|
+
* @returns the medium location the document was moved to (diagnostics).
|
|
116
|
+
*/
|
|
117
|
+
backupRecord?(table: string, key: string): Promise<string>;
|
|
96
118
|
/**
|
|
97
119
|
* Write the global singleton durably. Only valid when the descriptor
|
|
98
120
|
* declared `hasGlobal`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-storage",
|
|
3
3
|
"description": "Storage hub (ctx.storage): named backend registry plus mounted data-form facilities for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,25 +18,18 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./src/*": "./src/*",
|
|
26
22
|
"./package.json": "./package.json"
|
|
27
23
|
},
|
|
28
24
|
"files": [
|
|
29
25
|
"lib/index.js",
|
|
30
|
-
"lib/invariant.js",
|
|
31
26
|
"lib/types/**/*.d.ts"
|
|
32
27
|
],
|
|
33
28
|
"license": "MIT",
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
36
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3"
|
|
30
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
37
31
|
},
|
|
38
32
|
"devDependencies": {
|
|
39
|
-
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.3",
|
|
40
33
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
41
34
|
}
|
|
42
35
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-storage`.
|
|
4
|
-
* @module @deepseek-ai/dsh-storage/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-storage";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "storage-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: the hub is a pure registration table (names →
|
|
13
|
-
* backends, forms → facilities) whose consistency is fully enforced at the
|
|
14
|
-
* call sites (duplicate/missing entries fail loud synchronously); it owns no
|
|
15
|
-
* event stream or mutable medium to cross-check.
|
|
16
|
-
*/
|
|
17
|
-
const install = () => {};
|
|
18
|
-
/**
|
|
19
|
-
* Register this package's invariant companion.
|
|
20
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
21
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
22
|
-
*/
|
|
23
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
24
|
-
//#endregion
|
|
25
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-storage`.
|
|
3
|
-
* @module @deepseek-ai/dsh-storage/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "storage-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
|