@osovv/vv-opencode 2.3.3 → 2.5.0
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/CHANGELOG.md +23 -0
- package/README.md +18 -13
- package/dist/cli.js +5 -3
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.js +60 -51
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/plugin-toggle.d.ts +0 -16
- package/dist/commands/plugin-toggle.js +2 -34
- package/dist/commands/plugin-toggle.js.map +1 -1
- package/dist/commands/preset.d.ts +0 -8
- package/dist/commands/preset.js +3 -24
- package/dist/commands/preset.js.map +1 -1
- package/dist/commands/role.js +2 -30
- package/dist/commands/role.js.map +1 -1
- package/dist/commands/session.d.ts +50 -0
- package/dist/commands/session.js +354 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/lib/managed-agents.js +2 -2
- package/dist/lib/managed-agents.js.map +1 -1
- package/dist/lib/managed-skills.js +3 -3
- package/dist/lib/managed-skills.js.map +1 -1
- package/dist/lib/opencode/agent-registrations.js +103 -13
- package/dist/lib/opencode/agent-registrations.js.map +1 -1
- package/dist/lib/opencode/inspection.js +131 -5
- package/dist/lib/opencode/inspection.js.map +1 -1
- package/dist/plugins/analytics/index.js +8 -19
- package/dist/plugins/analytics/index.js.map +1 -1
- package/dist/plugins/guardian/index.js +7 -21
- package/dist/plugins/guardian/index.js.map +1 -1
- package/dist/plugins/hashline-edit/index.js +6 -20
- package/dist/plugins/hashline-edit/index.js.map +1 -1
- package/dist/plugins/model-roles/index.d.ts +3 -3
- package/dist/plugins/model-roles/index.js +8 -8
- package/dist/plugins/model-roles/index.js.map +1 -1
- package/dist/plugins/peak-hours/index.js +9 -20
- package/dist/plugins/peak-hours/index.js.map +1 -1
- package/dist/plugins/secrets-redaction/index.js +11 -24
- package/dist/plugins/secrets-redaction/index.js.map +1 -1
- package/dist/plugins/spec-guard/index.js +10 -22
- package/dist/plugins/spec-guard/index.js.map +1 -1
- package/dist/plugins/system-context-injection/guidance.d.ts +6 -0
- package/dist/plugins/system-context-injection/guidance.js +79 -0
- package/dist/plugins/system-context-injection/guidance.js.map +1 -0
- package/dist/plugins/system-context-injection/index.js +20 -121
- package/dist/plugins/system-context-injection/index.js.map +1 -1
- package/dist/plugins/tool-history-compaction/index.js +14 -25
- package/dist/plugins/tool-history-compaction/index.js.map +1 -1
- package/dist/plugins/web-tools/index.js +14 -25
- package/dist/plugins/web-tools/index.js.map +1 -1
- package/dist/plugins/workflow/index.d.ts +3 -2
- package/dist/plugins/workflow/index.js +6 -22
- package/dist/plugins/workflow/index.js.map +1 -1
- package/dist/plugins/workflow/input-validation.d.ts +1 -1
- package/dist/plugins/workflow/input-validation.js +2 -2
- package/dist/plugins/workflow/input-validation.js.map +1 -1
- package/dist/plugins/workflow/results.d.ts +40 -40
- package/dist/plugins/workflow/system-instruction.md +20 -0
- package/dist/runtime/auxiliary.d.ts +11 -6
- package/dist/runtime/auxiliary.js +43 -35
- package/dist/runtime/auxiliary.js.map +1 -1
- package/dist/runtime/context-inspection.d.ts +7 -6
- package/dist/runtime/context-inspection.js +37 -43
- package/dist/runtime/context-inspection.js.map +1 -1
- package/dist/runtime/context.d.ts +22 -45
- package/dist/runtime/context.js +348 -634
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/model-registry.d.ts +3 -34
- package/dist/runtime/model-registry.js +10 -190
- package/dist/runtime/model-registry.js.map +1 -1
- package/dist/runtime/session-settings.d.ts +204 -0
- package/dist/runtime/session-settings.js +445 -0
- package/dist/runtime/session-settings.js.map +1 -0
- package/dist/runtime/snapshot-config.d.ts +7 -70
- package/dist/runtime/snapshot-config.js +16 -198
- package/dist/runtime/snapshot-config.js.map +1 -1
- package/dist/runtime/types.d.ts +15 -256
- package/dist/runtime/types.js +9 -63
- package/dist/runtime/types.js.map +1 -1
- package/dist/tui/settings/plugin.d.ts +29 -0
- package/dist/tui/settings/plugin.js +134 -0
- package/dist/tui/settings/plugin.js.map +1 -0
- package/dist/tui.js +12 -12
- package/dist/tui.js.map +1 -1
- package/package.json +1 -1
- package/schemas/vvoc/v3.json +1 -1
- package/templates/agents/vv-code-reviewer.md +2 -2
- package/templates/agents/vv-controller.md +176 -151
- package/templates/agents/vv-implementer.md +2 -2
- package/templates/agents/vv-reflector.md +7 -0
- package/templates/agents/vv-spec-reviewer.md +2 -2
- package/templates/skills/vv-execute/SKILL.md +25 -4
- package/templates/skills/vv-execute/references/tool-contracts.md +3 -3
- package/templates/skills/vv-reflect/SKILL.md +1 -0
- package/templates/skills/vv-reflect/references/session-graph.py +581 -7
- package/templates/skills/vv-review/SKILL.md +2 -2
- package/dist/lib/rebind-request.d.ts +0 -41
- package/dist/lib/rebind-request.js +0 -134
- package/dist/lib/rebind-request.js.map +0 -1
- package/dist/runtime/snapshot-store.d.ts +0 -63
- package/dist/runtime/snapshot-store.js +0 -668
- package/dist/runtime/snapshot-store.js.map +0 -1
- package/dist/runtime/snapshots.d.ts +0 -36
- package/dist/runtime/snapshots.js +0 -508
- package/dist/runtime/snapshots.js.map +0 -1
- package/dist/tui/rebind/plugin.d.ts +0 -22
- package/dist/tui/rebind/plugin.js +0 -101
- package/dist/tui/rebind/plugin.js.map +0 -1
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** Directory name (inside the vvoc data dir) holding pending rebind request markers. */
|
|
2
|
-
export declare const REBIND_REQUEST_DIR_NAME = "rebind";
|
|
3
|
-
/** Age after which an unapplied marker is pruned and ignored, so stale requests cannot surprise a later session. */
|
|
4
|
-
export declare const REBIND_REQUEST_TTL_MS: number;
|
|
5
|
-
/** One project-directory-scoped rebind request written by the CLI and consumed lazily by the runtime. */
|
|
6
|
-
export interface RebindRequest {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly requestedAt: number;
|
|
9
|
-
readonly directory: string;
|
|
10
|
-
readonly sessionId?: string;
|
|
11
|
-
}
|
|
12
|
-
/** Atomically write a project-directory-scoped rebind request marker. */
|
|
13
|
-
export declare function writeRebindRequest(input: {
|
|
14
|
-
readonly directory: string;
|
|
15
|
-
readonly sessionId?: string | undefined;
|
|
16
|
-
readonly dataDir?: string | undefined;
|
|
17
|
-
readonly now?: number | undefined;
|
|
18
|
-
}): Promise<RebindRequest>;
|
|
19
|
-
/** Write a marker only when `force` is set; return it, or undefined when no rebind was requested. */
|
|
20
|
-
export declare function requestRebind(input: {
|
|
21
|
-
readonly force: boolean;
|
|
22
|
-
readonly directory: string;
|
|
23
|
-
readonly sessionId?: string | undefined;
|
|
24
|
-
readonly dataDir?: string | undefined;
|
|
25
|
-
readonly now?: number | undefined;
|
|
26
|
-
}): Promise<RebindRequest | undefined>;
|
|
27
|
-
/** List live markers, pruning malformed and expired files so requests stay one-shot and bounded. */
|
|
28
|
-
export declare function listRebindRequests(options?: {
|
|
29
|
-
readonly dataDir?: string | undefined;
|
|
30
|
-
readonly now?: number | undefined;
|
|
31
|
-
readonly ttlMs?: number | undefined;
|
|
32
|
-
}): Promise<readonly RebindRequest[]>;
|
|
33
|
-
/** Remove one marker by id; used when a request is explicitly consumed. */
|
|
34
|
-
export declare function removeRebindRequest(id: string, options?: {
|
|
35
|
-
readonly dataDir?: string | undefined;
|
|
36
|
-
}): Promise<void>;
|
|
37
|
-
/** True when a marker targets the given project directory and, when set, the given session. */
|
|
38
|
-
export declare function rebindRequestMatches(request: RebindRequest, input: {
|
|
39
|
-
readonly directory: string;
|
|
40
|
-
readonly sessionId?: string | undefined;
|
|
41
|
-
}): boolean;
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// FILE: src/lib/rebind-request.ts
|
|
2
|
-
// VERSION: 1.0.0
|
|
3
|
-
// START_MODULE_CONTRACT
|
|
4
|
-
// PURPOSE: Persist and read one-shot, project-directory-scoped rebind requests written by the CLI and consumed lazily by the running snapshot service.
|
|
5
|
-
// SCOPE: Marker naming, atomic write, best-effort listing with TTL pruning, removal, strict decoding, and matching by project directory plus optional session. No config mutation, no credential values.
|
|
6
|
-
// DEPENDS: [node:fs/promises, node:path, src/lib/vvoc-paths.ts]
|
|
7
|
-
// LINKS: [M-CLI-PRESET, M-CLI-PLUGIN-TOGGLE, M-CLI-ROLE, M-NATIVE-RUNTIME]
|
|
8
|
-
// ROLE: RUNTIME
|
|
9
|
-
// MAP_MODE: EXPORTS
|
|
10
|
-
// END_MODULE_CONTRACT
|
|
11
|
-
//
|
|
12
|
-
// START_MODULE_MAP
|
|
13
|
-
// REBIND_REQUEST_DIR_NAME - Directory name holding pending rebind request markers.
|
|
14
|
-
// REBIND_REQUEST_TTL_MS - Age after which an unapplied marker is pruned and ignored.
|
|
15
|
-
// RebindRequest - One project-directory-scoped rebind request marker.
|
|
16
|
-
// writeRebindRequest - Atomically write a rebind request marker and return it.
|
|
17
|
-
// requestRebind - Write a marker only when the force flag is set.
|
|
18
|
-
// listRebindRequests - List live markers, pruning malformed or expired ones.
|
|
19
|
-
// removeRebindRequest - Remove one marker by id.
|
|
20
|
-
// rebindRequestMatches - True when a marker targets the given directory and optional session.
|
|
21
|
-
// END_MODULE_MAP
|
|
22
|
-
//
|
|
23
|
-
// START_CHANGE_SUMMARY
|
|
24
|
-
// LAST_CHANGE: [C-SNAPSHOT-ANCHORING-REDESIGN T-006 - Added the project-directory-scoped rebind request marker shared by the CLI force flags and the lazy runtime consumer.]
|
|
25
|
-
// END_CHANGE_SUMMARY
|
|
26
|
-
import { mkdir, readdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
27
|
-
import { randomBytes } from "node:crypto";
|
|
28
|
-
import { join, resolve } from "node:path";
|
|
29
|
-
import { getGlobalVvocDataDir } from "./vvoc-paths.js";
|
|
30
|
-
/** Directory name (inside the vvoc data dir) holding pending rebind request markers. */
|
|
31
|
-
export const REBIND_REQUEST_DIR_NAME = "rebind";
|
|
32
|
-
/** Age after which an unapplied marker is pruned and ignored, so stale requests cannot surprise a later session. */
|
|
33
|
-
export const REBIND_REQUEST_TTL_MS = 24 * 60 * 60 * 1000;
|
|
34
|
-
function requestsDir(dataDir) {
|
|
35
|
-
return join(dataDir ?? getGlobalVvocDataDir(), REBIND_REQUEST_DIR_NAME);
|
|
36
|
-
}
|
|
37
|
-
function isRecord(value) {
|
|
38
|
-
return typeof value === "object" && value !== null;
|
|
39
|
-
}
|
|
40
|
-
function decodeRebindRequest(text) {
|
|
41
|
-
let value;
|
|
42
|
-
try {
|
|
43
|
-
value = JSON.parse(text);
|
|
44
|
-
}
|
|
45
|
-
catch {
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
if (!isRecord(value))
|
|
49
|
-
return undefined;
|
|
50
|
-
if (typeof value.id !== "string" ||
|
|
51
|
-
typeof value.requestedAt !== "number" ||
|
|
52
|
-
typeof value.directory !== "string") {
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
|
-
if (value.sessionId !== undefined && typeof value.sessionId !== "string")
|
|
56
|
-
return undefined;
|
|
57
|
-
return {
|
|
58
|
-
id: value.id,
|
|
59
|
-
requestedAt: value.requestedAt,
|
|
60
|
-
directory: value.directory,
|
|
61
|
-
...(value.sessionId === undefined ? {} : { sessionId: value.sessionId }),
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/** Atomically write a project-directory-scoped rebind request marker. */
|
|
65
|
-
export async function writeRebindRequest(input) {
|
|
66
|
-
const requestedAt = input.now ?? Date.now();
|
|
67
|
-
const id = `${requestedAt}-${randomBytes(4).toString("hex")}`;
|
|
68
|
-
const sessionId = input.sessionId?.trim();
|
|
69
|
-
const request = {
|
|
70
|
-
id,
|
|
71
|
-
requestedAt,
|
|
72
|
-
directory: resolve(input.directory),
|
|
73
|
-
...(sessionId === undefined || sessionId === "" ? {} : { sessionId }),
|
|
74
|
-
};
|
|
75
|
-
const dir = requestsDir(input.dataDir);
|
|
76
|
-
await mkdir(dir, { recursive: true });
|
|
77
|
-
const path = join(dir, `${id}.json`);
|
|
78
|
-
const temporary = `${path}.${randomBytes(4).toString("hex")}.tmp`;
|
|
79
|
-
await writeFile(temporary, JSON.stringify(request), { mode: 0o600 });
|
|
80
|
-
await rename(temporary, path);
|
|
81
|
-
return request;
|
|
82
|
-
}
|
|
83
|
-
/** Write a marker only when `force` is set; return it, or undefined when no rebind was requested. */
|
|
84
|
-
export async function requestRebind(input) {
|
|
85
|
-
if (!input.force)
|
|
86
|
-
return undefined;
|
|
87
|
-
return writeRebindRequest(input);
|
|
88
|
-
}
|
|
89
|
-
/** List live markers, pruning malformed and expired files so requests stay one-shot and bounded. */
|
|
90
|
-
export async function listRebindRequests(options = {}) {
|
|
91
|
-
const dir = requestsDir(options.dataDir);
|
|
92
|
-
let names;
|
|
93
|
-
try {
|
|
94
|
-
names = await readdir(dir);
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
return [];
|
|
98
|
-
}
|
|
99
|
-
const now = options.now ?? Date.now();
|
|
100
|
-
const ttl = options.ttlMs ?? REBIND_REQUEST_TTL_MS;
|
|
101
|
-
const live = [];
|
|
102
|
-
for (const name of names) {
|
|
103
|
-
if (!name.endsWith(".json"))
|
|
104
|
-
continue;
|
|
105
|
-
const path = join(dir, name);
|
|
106
|
-
let text;
|
|
107
|
-
try {
|
|
108
|
-
text = await readFile(path, "utf8");
|
|
109
|
-
}
|
|
110
|
-
catch {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
const request = decodeRebindRequest(text);
|
|
114
|
-
if (request === undefined || now - request.requestedAt > ttl) {
|
|
115
|
-
await rm(path, { force: true }).catch(() => undefined);
|
|
116
|
-
continue;
|
|
117
|
-
}
|
|
118
|
-
live.push(request);
|
|
119
|
-
}
|
|
120
|
-
return live;
|
|
121
|
-
}
|
|
122
|
-
/** Remove one marker by id; used when a request is explicitly consumed. */
|
|
123
|
-
export async function removeRebindRequest(id, options = {}) {
|
|
124
|
-
await rm(join(requestsDir(options.dataDir), `${id}.json`), { force: true });
|
|
125
|
-
}
|
|
126
|
-
/** True when a marker targets the given project directory and, when set, the given session. */
|
|
127
|
-
export function rebindRequestMatches(request, input) {
|
|
128
|
-
if (resolve(input.directory) !== resolve(request.directory))
|
|
129
|
-
return false;
|
|
130
|
-
if (request.sessionId !== undefined && request.sessionId !== input.sessionId)
|
|
131
|
-
return false;
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=rebind-request.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rebind-request.js","sourceRoot":"","sources":["../../src/lib/rebind-request.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAClC,iBAAiB;AACjB,wBAAwB;AACxB,yJAAyJ;AACzJ,2MAA2M;AAC3M,kEAAkE;AAClE,6EAA6E;AAC7E,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,qFAAqF;AACrF,uFAAuF;AACvF,wEAAwE;AACxE,iFAAiF;AACjF,oEAAoE;AACpE,+EAA+E;AAC/E,mDAAmD;AACnD,gGAAgG;AAChG,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,+KAA+K;AAC/K,qBAAqB;AAErB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,wFAAwF;AACxF,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAEhD,oHAAoH;AACpH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAUzD,SAAS,WAAW,CAAC,OAAgB;IACnC,OAAO,IAAI,CAAC,OAAO,IAAI,oBAAoB,EAAE,EAAE,uBAAuB,CAAC,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C9E,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,oBAAoB,CAClC,OAAsB,EACtB,KAA8E;IAE9E,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1E,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAC3F,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { type BehaviourProjection } from "./snapshot-config.js";
|
|
2
|
-
import { type FamilyCapture, type SnapshotStore, type StagedCandidate } from "./types.js";
|
|
3
|
-
/** Directory name holding vvoc family snapshots inside the vvoc data dir. */
|
|
4
|
-
export declare const SNAPSHOT_STORE_DIR_NAME = "snapshots";
|
|
5
|
-
/** Project scope and optional data-dir override for the file store. */
|
|
6
|
-
export interface FileSnapshotStoreOptions {
|
|
7
|
-
/**
|
|
8
|
-
* Project scope key (project id). Family captures live under one project so a
|
|
9
|
-
* moved worktree still resolves its root while another project cannot read it.
|
|
10
|
-
*/
|
|
11
|
-
readonly scopeKey: string;
|
|
12
|
-
/** Override the vvoc data dir root; defaults to `$XDG_DATA_HOME/vvoc`. */
|
|
13
|
-
readonly dataDir?: string | undefined;
|
|
14
|
-
}
|
|
15
|
-
/** Stable, collision-free directory name for one project scope. */
|
|
16
|
-
export declare function snapshotScopeDirName(scopeKey: string): string;
|
|
17
|
-
/** Recompute the behavior-relevant content digest of a capture. */
|
|
18
|
-
export declare function familyCaptureIntegrity(capture: FamilyCapture): string;
|
|
19
|
-
/** Strictly validate and integrity-check a persisted family capture. */
|
|
20
|
-
export declare function decodeFamilyCapture(value: unknown): FamilyCapture | undefined;
|
|
21
|
-
/** Strictly validate a persisted staged candidate. */
|
|
22
|
-
export declare function decodeStagedCandidate(value: unknown): StagedCandidate | undefined;
|
|
23
|
-
/** Strictly validate a persisted staged-candidate array; any invalid entry fails the whole read. */
|
|
24
|
-
export declare function decodeStagedCandidates(value: unknown): StagedCandidate[] | undefined;
|
|
25
|
-
/** Build a durable file-backed SnapshotStore for one project scope. */
|
|
26
|
-
export declare function createFileSnapshotStore(options: FileSnapshotStoreOptions): SnapshotStore;
|
|
27
|
-
/** Directory name holding content-addressed policy snapshots and family pointers. */
|
|
28
|
-
export declare const BINDING_STORE_DIR_NAME = "bindings";
|
|
29
|
-
/** Project scope and optional data-dir override for the content-addressed binding store. */
|
|
30
|
-
export interface FileBindingStoreOptions {
|
|
31
|
-
/** Project scope key; families in one project cannot read another project's snapshots. */
|
|
32
|
-
readonly scopeKey: string;
|
|
33
|
-
/** Override the vvoc data dir root; defaults to `$XDG_DATA_HOME/vvoc`. */
|
|
34
|
-
readonly dataDir?: string | undefined;
|
|
35
|
-
}
|
|
36
|
-
/** Durable pointer from one family to its content-addressed policy snapshot. */
|
|
37
|
-
export interface FamilyBindingRecord {
|
|
38
|
-
readonly familyId: string;
|
|
39
|
-
readonly snapshotHash: string;
|
|
40
|
-
readonly boundAt: string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Content-addressed store for credential-free behaviour-policy snapshots plus a
|
|
44
|
-
* tiny per-family pointer. Reads never throw: a missing, unparseable, or
|
|
45
|
-
* hash-mismatched artifact returns undefined so callers can fail soft per family.
|
|
46
|
-
*/
|
|
47
|
-
export declare class FileBindingStore {
|
|
48
|
-
#private;
|
|
49
|
-
constructor(options: FileBindingStoreOptions);
|
|
50
|
-
/** Persist a projection under its content hash and return that hash; identical content reuses the file. */
|
|
51
|
-
writeSnapshot(projection: BehaviourProjection): Promise<string>;
|
|
52
|
-
/** Load a projection by hash; undefined when missing, corrupt, or hash-mismatched. */
|
|
53
|
-
readSnapshot(hash: string): Promise<BehaviourProjection | undefined>;
|
|
54
|
-
writeBinding(record: FamilyBindingRecord): Promise<void>;
|
|
55
|
-
/** Load a family pointer; undefined when missing or corrupt. */
|
|
56
|
-
readBinding(familyId: string): Promise<FamilyBindingRecord | undefined>;
|
|
57
|
-
removeBinding(familyId: string): Promise<void>;
|
|
58
|
-
listBindings(): Promise<readonly FamilyBindingRecord[]>;
|
|
59
|
-
listSnapshots(): Promise<readonly string[]>;
|
|
60
|
-
removeSnapshot(hash: string): Promise<void>;
|
|
61
|
-
/** Count how many live families reference each snapshot hash, for reference-counted garbage collection. */
|
|
62
|
-
countBindings(): Promise<ReadonlyMap<string, number>>;
|
|
63
|
-
}
|