@lmzhen/dsh-evolution-state-storage 0.3.51 → 0.3.52
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.js +42 -1
- package/lib/types/constants.d.ts +33 -0
- package/lib/types/index.d.ts +6 -0
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
import { Service } from "@deepseek-ai/cordis";
|
|
2
|
+
//#region lib/types/constants.js
|
|
3
|
+
/**
|
|
4
|
+
* Single source for the state-stack magic strings (audit v10 S-06).
|
|
5
|
+
*
|
|
6
|
+
* The singleton curator key, the on-disk state file names, the provider names
|
|
7
|
+
* and the domain table names live here so the two providers (json/domain)
|
|
8
|
+
* cannot drift a literal independently — a drifted literal is exactly the
|
|
9
|
+
* E-10 divergence class both providers already guard against elsewhere.
|
|
10
|
+
* These values are FORMAT-STABLE: the file names and the `'primary'` key are
|
|
11
|
+
* on-disk contracts, the provider names are registry keys, and the table
|
|
12
|
+
* names are domain-spec keys — renaming any of them orphans data or breaks
|
|
13
|
+
* the seam, never rename casually.
|
|
14
|
+
* @module @lmzhen/dsh-evolution-state-storage/src/constants
|
|
15
|
+
*/
|
|
16
|
+
/** Singleton curator-state record key in both providers (the json map key and
|
|
17
|
+
* the domain table key). */
|
|
18
|
+
const CURATOR_STATE_KEY = "primary";
|
|
19
|
+
/** On-disk state file names (json provider, relative to its configured root). */
|
|
20
|
+
const REVIEW_STATE_FILE = "review-state.json";
|
|
21
|
+
const CURATOR_STATE_FILE = "curator-state.json";
|
|
22
|
+
const PENDING_STATE_FILE = "pending-state.json";
|
|
23
|
+
/** Pre-split approval store; read-only legacy, retired after the merge. */
|
|
24
|
+
const PENDING_LEGACY_FILE = "pending.json";
|
|
25
|
+
const PENDING_ARCHIVE_FILE = "pending-state-archive.json";
|
|
26
|
+
/** Rotation sidecar of {@link PENDING_ARCHIVE_FILE} (V4-01). */
|
|
27
|
+
const PENDING_ARCHIVE_BAK_FILE = "pending-state-archive.json.bak";
|
|
28
|
+
/** Provider names as registered on the `evolutionStateStorage` seam. */
|
|
29
|
+
const PROVIDER_JSON = "json";
|
|
30
|
+
const PROVIDER_DOMAIN = "domain";
|
|
31
|
+
/** Domain table names of the evolution storage-domain spec. */
|
|
32
|
+
const REVIEW_STATE_TABLE = "review_state";
|
|
33
|
+
const CURATOR_STATE_TABLE = "curator_state";
|
|
34
|
+
const PENDING_TABLE = "pending";
|
|
35
|
+
//#endregion
|
|
2
36
|
//#region lib/types/index.js
|
|
3
37
|
/**
|
|
4
38
|
* Provider seam for durable evolution state.
|
|
@@ -28,6 +62,13 @@ var EvolutionStateStorageRegistry = class extends Service {
|
|
|
28
62
|
if (this.providers.get(provider.name) === provider) this.providers.delete(provider.name);
|
|
29
63
|
};
|
|
30
64
|
}
|
|
65
|
+
/** S-07: whether ANY provider is registered. Lets the state
|
|
66
|
+
* consumer precheck a pinned `provider` config at mount time (a typo fails
|
|
67
|
+
* at start with the registry's precise message) while staying lazy when no
|
|
68
|
+
* provider has registered yet (mount order not settled). */
|
|
69
|
+
hasProviders() {
|
|
70
|
+
return this.providers.size > 0;
|
|
71
|
+
}
|
|
31
72
|
provider(name) {
|
|
32
73
|
if (name) {
|
|
33
74
|
const provider = this.providers.get(name);
|
|
@@ -40,4 +81,4 @@ var EvolutionStateStorageRegistry = class extends Service {
|
|
|
40
81
|
}
|
|
41
82
|
};
|
|
42
83
|
//#endregion
|
|
43
|
-
export { EvolutionStateStorageRegistry, EvolutionStateStorageRegistry as default, canClaimPending, canResolvePending, releasedStatus };
|
|
84
|
+
export { CURATOR_STATE_FILE, CURATOR_STATE_KEY, CURATOR_STATE_TABLE, EvolutionStateStorageRegistry, EvolutionStateStorageRegistry as default, PENDING_ARCHIVE_BAK_FILE, PENDING_ARCHIVE_FILE, PENDING_LEGACY_FILE, PENDING_STATE_FILE, PENDING_TABLE, PROVIDER_DOMAIN, PROVIDER_JSON, REVIEW_STATE_FILE, REVIEW_STATE_TABLE, canClaimPending, canResolvePending, releasedStatus };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source for the state-stack magic strings (audit v10 S-06).
|
|
3
|
+
*
|
|
4
|
+
* The singleton curator key, the on-disk state file names, the provider names
|
|
5
|
+
* and the domain table names live here so the two providers (json/domain)
|
|
6
|
+
* cannot drift a literal independently — a drifted literal is exactly the
|
|
7
|
+
* E-10 divergence class both providers already guard against elsewhere.
|
|
8
|
+
* These values are FORMAT-STABLE: the file names and the `'primary'` key are
|
|
9
|
+
* on-disk contracts, the provider names are registry keys, and the table
|
|
10
|
+
* names are domain-spec keys — renaming any of them orphans data or breaks
|
|
11
|
+
* the seam, never rename casually.
|
|
12
|
+
* @module @lmzhen/dsh-evolution-state-storage/src/constants
|
|
13
|
+
*/
|
|
14
|
+
/** Singleton curator-state record key in both providers (the json map key and
|
|
15
|
+
* the domain table key). */
|
|
16
|
+
export declare const CURATOR_STATE_KEY = "primary";
|
|
17
|
+
/** On-disk state file names (json provider, relative to its configured root). */
|
|
18
|
+
export declare const REVIEW_STATE_FILE = "review-state.json";
|
|
19
|
+
export declare const CURATOR_STATE_FILE = "curator-state.json";
|
|
20
|
+
export declare const PENDING_STATE_FILE = "pending-state.json";
|
|
21
|
+
/** Pre-split approval store; read-only legacy, retired after the merge. */
|
|
22
|
+
export declare const PENDING_LEGACY_FILE = "pending.json";
|
|
23
|
+
export declare const PENDING_ARCHIVE_FILE = "pending-state-archive.json";
|
|
24
|
+
/** Rotation sidecar of {@link PENDING_ARCHIVE_FILE} (V4-01). */
|
|
25
|
+
export declare const PENDING_ARCHIVE_BAK_FILE = "pending-state-archive.json.bak";
|
|
26
|
+
/** Provider names as registered on the `evolutionStateStorage` seam. */
|
|
27
|
+
export declare const PROVIDER_JSON = "json";
|
|
28
|
+
export declare const PROVIDER_DOMAIN = "domain";
|
|
29
|
+
/** Domain table names of the evolution storage-domain spec. */
|
|
30
|
+
export declare const REVIEW_STATE_TABLE = "review_state";
|
|
31
|
+
export declare const CURATOR_STATE_TABLE = "curator_state";
|
|
32
|
+
export declare const PENDING_TABLE = "pending";
|
|
33
|
+
//# sourceMappingURL=constants.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @module @lmzhen/dsh-evolution-state-storage
|
|
8
8
|
*/
|
|
9
9
|
import { Context, Service } from '@deepseek-ai/cordis';
|
|
10
|
+
export * from './constants.ts';
|
|
10
11
|
/** 0.3.17 (S3.5, D-4): 'skill_batch' removed — nothing ever created one
|
|
11
12
|
* (dead enum member); the historic value, if it ever reached disk, is read as
|
|
12
13
|
* an unknown kind by consumers rather than minted here. */
|
|
@@ -96,6 +97,11 @@ export declare class EvolutionStateStorageRegistry extends Service {
|
|
|
96
97
|
private readonly providers;
|
|
97
98
|
constructor(ctx: Context);
|
|
98
99
|
registerProvider(provider: EvolutionStateStorage): () => void;
|
|
100
|
+
/** S-07: whether ANY provider is registered. Lets the state
|
|
101
|
+
* consumer precheck a pinned `provider` config at mount time (a typo fails
|
|
102
|
+
* at start with the registry's precise message) while staying lazy when no
|
|
103
|
+
* provider has registered yet (mount order not settled). */
|
|
104
|
+
hasProviders(): boolean;
|
|
99
105
|
provider(name?: string): EvolutionStateStorage;
|
|
100
106
|
}
|
|
101
107
|
export default EvolutionStateStorageRegistry;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-state-storage",
|
|
3
3
|
"description": "Provider registry seam for durable evolution state (community build)",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.52",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+https://github.com/lmzhen/dsh-evolution.git",
|
|
11
|
-
"directory": "packages/
|
|
11
|
+
"directory": "packages/evolution-state-storage"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "lib/index.js",
|