@di-framework/cli-plugin-platform 6.1.1 → 6.2.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.
Files changed (43) hide show
  1. package/README.md +259 -2
  2. package/dist/assets/http-adapter.js +6 -6
  3. package/dist/assets/sqlite/BUILD-INFO.txt +1 -1
  4. package/dist/assets/wit/deps/di-framework-pglite/package.wit +175 -0
  5. package/dist/bindings.js +7 -6
  6. package/dist/build.d.ts +31 -0
  7. package/dist/build.js +192 -12
  8. package/dist/console/catalog.js +2 -1
  9. package/dist/console/cluster.d.ts +3 -0
  10. package/dist/console/cluster.js +57 -4
  11. package/dist/control/auth.js +14 -2
  12. package/dist/deploy.d.ts +6 -0
  13. package/dist/deploy.js +27 -5
  14. package/dist/deps.js +1 -1
  15. package/dist/environment-names.d.ts +6 -0
  16. package/dist/environment-names.js +10 -0
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/node-compat/console.js +16 -1
  20. package/dist/node-compat/crypto-subtle.d.ts +6 -0
  21. package/dist/node-compat/crypto-subtle.js +41 -4
  22. package/dist/node-compat/crypto.d.ts +3 -2
  23. package/dist/node-compat/crypto.js +66 -17
  24. package/dist/node-compat/fs.d.ts +24 -2
  25. package/dist/node-compat/fs.js +137 -15
  26. package/dist/node-compat/node-errors.d.ts +20 -0
  27. package/dist/node-compat/node-errors.js +73 -0
  28. package/dist/node-compat/storage.d.ts +3 -3
  29. package/dist/node-compat/wasi-random.d.ts +21 -1
  30. package/dist/node-compat/wasi-random.js +45 -12
  31. package/dist/pglite-encryption.d.ts +79 -0
  32. package/dist/pglite-encryption.js +196 -0
  33. package/dist/pglite.d.ts +153 -0
  34. package/dist/pglite.js +423 -0
  35. package/dist/project.d.ts +18 -0
  36. package/dist/project.js +49 -1
  37. package/dist/secret-admission.d.ts +21 -0
  38. package/dist/secret-admission.js +29 -0
  39. package/dist/wit.d.ts +3 -0
  40. package/dist/wit.js +12 -0
  41. package/dist/workload.d.ts +51 -0
  42. package/dist/workload.js +320 -40
  43. package/package.json +2 -2
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Wiring a PGlite encryption layer between the provider and the host filesystem.
3
+ *
4
+ * `wac plug` is best effort: it plugs each export of the layer whose name matches an import of
5
+ * the provider *and* whose type is a subtype of it, silently skips the rest, and exits 0 as soon
6
+ * as one pair plugged. A layer that exports only `wasi:cli/environment`, exports the filesystem
7
+ * at a version wac does not match, or exports it with a different type would compose cleanly and
8
+ * leave PGlite writing plaintext to the host. So the build does not use `wac plug` here: it
9
+ * plans the wiring itself and composes an explicit WAC document with `wac compose`, where every
10
+ * provider import that must go to the layer is a named instantiation argument. wac then
11
+ * type-checks each one and fails loudly instead of skipping it.
12
+ */
13
+ /** An interface a component's world imports or exports, e.g. `wasi:filesystem/types@0.2.9`. */
14
+ export type WitInterface = {
15
+ name: string;
16
+ version?: string;
17
+ };
18
+ /**
19
+ * The interfaces a component's world imports and exports, from `jco wit` output. `unrecognized`
20
+ * holds every other `import`/`export` line, such as a plain-named `import fs: interface {` or a
21
+ * bare function, which the wiring cannot reason about.
22
+ */
23
+ export declare function worldInterfaces(wit: string): {
24
+ imports: WitInterface[];
25
+ exports: WitInterface[];
26
+ unrecognized: string[];
27
+ };
28
+ /**
29
+ * Interfaces the provider may take straight from the host. Everything else it imports must be
30
+ * wired to the layer, so a provider that reached storage some other way (another filesystem
31
+ * package, a plain-named interface) stops the build instead of bypassing the layer.
32
+ */
33
+ export declare const HOST_PASS_THROUGH: string[];
34
+ export declare function formatInterface(item: WitInterface): string;
35
+ /**
36
+ * Whether two versions of an interface are on the same semver track, as wac decides it
37
+ * (wac-types `are_semver_compatible`), in either direction: the same major from 1.0 on, the
38
+ * same minor for 0.x with x ≥ 1, and an exact match for 0.0.z and pre-releases. Unversioned
39
+ * names match only each other.
40
+ */
41
+ export declare function semverCompatible(a?: string, b?: string): boolean;
42
+ /** One provider import wired to one layer export, by their full names. */
43
+ export type Wire = {
44
+ providerImport: string;
45
+ layerExport: string;
46
+ };
47
+ /**
48
+ * Which layer export each provider import is wired to: the export with the same name and
49
+ * version, else the first on the same semver track (wac's own matching). Every
50
+ * `wasi:filesystem/*` import must be wired, or `problem` says why not; other interfaces the
51
+ * layer re-exports (`wasi:io/streams`, `wasi:cli/*`, …) are wired too, since the filesystem
52
+ * types refer to them.
53
+ */
54
+ export declare function planWiring(provider: {
55
+ imports: WitInterface[];
56
+ exports?: WitInterface[];
57
+ unrecognized?: string[];
58
+ }, layer: {
59
+ exports: WitInterface[];
60
+ }): {
61
+ wires: Wire[];
62
+ problem?: string;
63
+ };
64
+ /** WAC package names the composition document refers to (bound with `wac compose --dep`). */
65
+ export declare const LAYER_PACKAGE = "pglite:layer";
66
+ export declare const PROVIDER_PACKAGE = "pglite:provider";
67
+ /**
68
+ * The WAC document that instantiates the layer against the host and the provider with every
69
+ * wired import taken from the layer's instance, re-exporting the provider's exports. Imports of
70
+ * either that are not wired stay imports of the result (`...`).
71
+ */
72
+ export declare function encryptionComposition(wires: readonly Wire[], providerExports: WitInterface[]): string;
73
+ /** Custom section the platform's encryption layer carries (`format=1 codec=aes-256-xts`). */
74
+ export declare const ENCFS_SECTION = "di-framework:pglite-encfs";
75
+ /**
76
+ * The contents of the `di-framework:pglite-encfs` custom section anywhere in a core module or
77
+ * component binary, including nested modules and components, or undefined when there is none.
78
+ */
79
+ export declare function encfsSection(bytes: Uint8Array): string | undefined;
@@ -0,0 +1,196 @@
1
+ /**
2
+ * Wiring a PGlite encryption layer between the provider and the host filesystem.
3
+ *
4
+ * `wac plug` is best effort: it plugs each export of the layer whose name matches an import of
5
+ * the provider *and* whose type is a subtype of it, silently skips the rest, and exits 0 as soon
6
+ * as one pair plugged. A layer that exports only `wasi:cli/environment`, exports the filesystem
7
+ * at a version wac does not match, or exports it with a different type would compose cleanly and
8
+ * leave PGlite writing plaintext to the host. So the build does not use `wac plug` here: it
9
+ * plans the wiring itself and composes an explicit WAC document with `wac compose`, where every
10
+ * provider import that must go to the layer is a named instantiation argument. wac then
11
+ * type-checks each one and fails loudly instead of skipping it.
12
+ */
13
+ const FILESYSTEM = 'wasi:filesystem/';
14
+ const WORLD_ITEM = /^\s*(import|export)\s+([a-z][a-z0-9-]*:[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*)(?:@([^;\s]+))?;\s*$/;
15
+ const SEMVER = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
16
+ const WORLD_LINE = /^\s*(import|export)\s/;
17
+ /**
18
+ * The interfaces a component's world imports and exports, from `jco wit` output. `unrecognized`
19
+ * holds every other `import`/`export` line, such as a plain-named `import fs: interface {` or a
20
+ * bare function, which the wiring cannot reason about.
21
+ */
22
+ export function worldInterfaces(wit) {
23
+ const imports = [];
24
+ const exports = [];
25
+ const unrecognized = [];
26
+ for (const line of wit.split('\n')) {
27
+ const match = WORLD_ITEM.exec(line);
28
+ if (match === null) {
29
+ if (WORLD_LINE.test(line))
30
+ unrecognized.push(line.trim());
31
+ continue;
32
+ }
33
+ const item = {
34
+ name: match[2],
35
+ ...(match[3] === undefined ? {} : { version: match[3] }),
36
+ };
37
+ (match[1] === 'import' ? imports : exports).push(item);
38
+ }
39
+ return { imports, exports, unrecognized };
40
+ }
41
+ /**
42
+ * Interfaces the provider may take straight from the host. Everything else it imports must be
43
+ * wired to the layer, so a provider that reached storage some other way (another filesystem
44
+ * package, a plain-named interface) stops the build instead of bypassing the layer.
45
+ */
46
+ export const HOST_PASS_THROUGH = ['wasi:io/', 'wasi:clocks/', 'wasi:random/', 'wasi:cli/'];
47
+ export function formatInterface(item) {
48
+ return item.version === undefined ? item.name : `${item.name}@${item.version}`;
49
+ }
50
+ /**
51
+ * Whether two versions of an interface are on the same semver track, as wac decides it
52
+ * (wac-types `are_semver_compatible`), in either direction: the same major from 1.0 on, the
53
+ * same minor for 0.x with x ≥ 1, and an exact match for 0.0.z and pre-releases. Unversioned
54
+ * names match only each other.
55
+ */
56
+ export function semverCompatible(a, b) {
57
+ if (a === b)
58
+ return true;
59
+ if (a === undefined || b === undefined)
60
+ return false;
61
+ const x = SEMVER.exec(a);
62
+ const y = SEMVER.exec(b);
63
+ if (x === null || y === null || x[4] !== undefined || y[4] !== undefined)
64
+ return false;
65
+ const [xMajor, xMinor, xPatch] = [1, 2, 3].map((n) => Number(x[n]));
66
+ const [yMajor, yMinor, yPatch] = [1, 2, 3].map((n) => Number(y[n]));
67
+ if (xMajor !== yMajor)
68
+ return false;
69
+ if (xMajor !== 0)
70
+ return true;
71
+ if (xMinor !== yMinor)
72
+ return false;
73
+ if (xMinor !== 0)
74
+ return true;
75
+ return xPatch === yPatch;
76
+ }
77
+ const isFilesystem = (item) => item.name.startsWith(FILESYSTEM);
78
+ /**
79
+ * Which layer export each provider import is wired to: the export with the same name and
80
+ * version, else the first on the same semver track (wac's own matching). Every
81
+ * `wasi:filesystem/*` import must be wired, or `problem` says why not; other interfaces the
82
+ * layer re-exports (`wasi:io/streams`, `wasi:cli/*`, …) are wired too, since the filesystem
83
+ * types refer to them.
84
+ */
85
+ export function planWiring(provider, layer) {
86
+ if (provider.unrecognized !== undefined && provider.unrecognized.length > 0)
87
+ return {
88
+ wires: [],
89
+ problem: `the provider's world has items the build cannot wire: ${provider.unrecognized.join('; ')}`,
90
+ };
91
+ const required = provider.imports.filter(isFilesystem);
92
+ if (required.length === 0)
93
+ return {
94
+ wires: [],
95
+ problem: 'the provider imports no wasi:filesystem interface, so there is nothing for the layer to encrypt',
96
+ };
97
+ const wires = [];
98
+ const missing = [];
99
+ for (const wanted of provider.imports) {
100
+ const offered = layer.exports.find((item) => item.name === wanted.name && item.version === wanted.version) ??
101
+ layer.exports.find((item) => item.name === wanted.name && semverCompatible(item.version, wanted.version));
102
+ if (offered !== undefined) {
103
+ wires.push({
104
+ providerImport: formatInterface(wanted),
105
+ layerExport: formatInterface(offered),
106
+ });
107
+ continue;
108
+ }
109
+ if (!isFilesystem(wanted)) {
110
+ if (!HOST_PASS_THROUGH.some((prefix) => wanted.name.startsWith(prefix)))
111
+ missing.push(`${formatInterface(wanted)} (neither exported by the layer nor allowed from the host)`);
112
+ continue;
113
+ }
114
+ const found = layer.exports
115
+ .filter((item) => item.name === wanted.name)
116
+ .map((item) => `@${item.version ?? 'unversioned'}`);
117
+ const detail = found.length === 0 ? 'not exported' : `the layer exports ${found.join(', ')}`;
118
+ missing.push(`${formatInterface(wanted)} (${detail})`);
119
+ }
120
+ return missing.length === 0
121
+ ? { wires }
122
+ : {
123
+ wires,
124
+ problem: `the layer does not export what the provider imports: ${missing.join('; ')}`,
125
+ };
126
+ }
127
+ /** WAC package names the composition document refers to (bound with `wac compose --dep`). */
128
+ export const LAYER_PACKAGE = 'pglite:layer';
129
+ export const PROVIDER_PACKAGE = 'pglite:provider';
130
+ /**
131
+ * The WAC document that instantiates the layer against the host and the provider with every
132
+ * wired import taken from the layer's instance, re-exporting the provider's exports. Imports of
133
+ * either that are not wired stay imports of the result (`...`).
134
+ */
135
+ export function encryptionComposition(wires, providerExports) {
136
+ const quote = (name) => JSON.stringify(name);
137
+ return [
138
+ 'package di-framework:pglite-encrypted;',
139
+ '',
140
+ `let layer = new ${LAYER_PACKAGE} { ... };`,
141
+ `let provider = new ${PROVIDER_PACKAGE} {`,
142
+ ...wires.map((wire) => ` ${quote(wire.providerImport)}: layer[${quote(wire.layerExport)}],`),
143
+ ' ...',
144
+ '};',
145
+ '',
146
+ ...providerExports.map((item) => `export provider[${quote(formatInterface(item))}];`),
147
+ '',
148
+ ].join('\n');
149
+ }
150
+ /** Custom section the platform's encryption layer carries (`format=1 codec=aes-256-xts`). */
151
+ export const ENCFS_SECTION = 'di-framework:pglite-encfs';
152
+ /**
153
+ * The contents of the `di-framework:pglite-encfs` custom section anywhere in a core module or
154
+ * component binary, including nested modules and components, or undefined when there is none.
155
+ */
156
+ export function encfsSection(bytes) {
157
+ const decoder = new TextDecoder();
158
+ const walk = (start, end) => {
159
+ if (end - start < 8 || bytes[start] !== 0 || bytes[start + 1] !== 0x61)
160
+ return undefined;
161
+ const component = bytes[start + 6] === 1;
162
+ let offset = start + 8;
163
+ const leb = () => {
164
+ let result = 0;
165
+ let shift = 0;
166
+ for (;;) {
167
+ const byte = bytes[offset++];
168
+ result += (byte & 0x7f) * 2 ** shift;
169
+ if ((byte & 0x80) === 0 || offset >= end)
170
+ return result;
171
+ shift += 7;
172
+ }
173
+ };
174
+ while (offset < end) {
175
+ const id = bytes[offset++];
176
+ const size = leb();
177
+ const body = offset;
178
+ const next = Math.min(end, body + size);
179
+ if (id === 0) {
180
+ offset = body;
181
+ const length = leb();
182
+ const name = decoder.decode(bytes.subarray(offset, offset + length));
183
+ if (name === ENCFS_SECTION)
184
+ return decoder.decode(bytes.subarray(offset + length, next));
185
+ }
186
+ else if (component && (id === 1 || id === 4)) {
187
+ const found = walk(body, next);
188
+ if (found !== undefined)
189
+ return found;
190
+ }
191
+ offset = next;
192
+ }
193
+ return undefined;
194
+ };
195
+ return walk(0, bytes.length);
196
+ }
@@ -0,0 +1,153 @@
1
+ import { type CliIo } from '@di-framework/cli-extension';
2
+ import type { WasmcloudDeps } from './deps.js';
3
+ import type { ClusterConnection } from './target.js';
4
+ export { DI_PGLITE_PACKAGE, DI_PGLITE_VERSION, PGLITE_SOURCE } from './wit.js';
5
+ /**
6
+ * Embedded PostgreSQL provider (`di-framework:pglite`), published by di-framework/platform
7
+ * as `ghcr.io/di-framework/pglite-component`. A guest that imports its `database` interface
8
+ * gets the provider plugged in after componentize; the deployed component is then marked
9
+ * exclusive and given persistent storage, because the engine tolerates exactly one opener
10
+ * of its data directory.
11
+ */
12
+ export declare const PGLITE_REPOSITORY = "ghcr.io/di-framework/pglite-component";
13
+ /** Absolute (or cwd-relative) path of a local provider build; wins over the config. */
14
+ export declare const PGLITE_WASM_ENV = "DI_FRAMEWORK_PGLITE_WASM";
15
+ /** Root of the CLI's download cache. Defaults to `$XDG_CACHE_HOME/di-framework`. */
16
+ export declare const CACHE_DIR_ENV = "DI_FRAMEWORK_CACHE_DIR";
17
+ /** Guest environment entry naming the database root the guest passes to `open`. */
18
+ export declare const PGLITE_DATA_DIR_ENV = "DI_PGLITE_DATA_DIR";
19
+ /**
20
+ * `localResources.config` entry the patched tenant host reads (di-framework/platform#140).
21
+ * Components only: platform admission rejects it on the service.
22
+ */
23
+ export declare const EXCLUSIVE_INSTANCE_KEY = "di-framework.dev/exclusive-instance";
24
+ export declare const DEFAULT_PGLITE_STORAGE_MOUNT = "/data";
25
+ /** File name of the provider inside a cache entry. */
26
+ export declare const PGLITE_WASM_FILE = "di-framework-pglite.wasm";
27
+ /**
28
+ * Encrypting `wasi:filesystem` layer for the provider (`pglite.encryption`), published by
29
+ * di-framework/platform. The build composes it into the provider with an explicit `wac compose`
30
+ * document (`.di-framework/pglite-encryption.wac`, see `encryptProvider`) before the provider is
31
+ * plugged into the guest, so only the engine sees the encrypted view.
32
+ */
33
+ export declare const PGLITE_ENCFS_REPOSITORY = "ghcr.io/di-framework/pglite-encfs";
34
+ /** Absolute (or cwd-relative) path of a local encryption layer build; wins over the config. */
35
+ export declare const PGLITE_ENCFS_WASM_ENV = "DI_FRAMEWORK_PGLITE_ENCFS_WASM";
36
+ /** File name of the encryption layer inside a cache entry. */
37
+ export declare const PGLITE_ENCFS_WASM_FILE = "di-framework-pglite-encfs.wasm";
38
+ /** The provider with the encryption layer plugged in, as the build plugs it into the guest. */
39
+ export declare const PGLITE_ENCRYPTED_WASM_FILE = "di-framework-pglite.encrypted.wasm";
40
+ /**
41
+ * The guest environment variable the encryption layer reads its master key from. It must come
42
+ * from the control Secret, so the project declares it in `controlSecretKeys`.
43
+ */
44
+ export declare const PGLITE_KEY_ENV = "DI_PGLITE_KEY";
45
+ /** A digest-pinned component the CLI pulls: the provider or its encryption layer. */
46
+ export type PinnedComponent = {
47
+ /** How messages name it. */
48
+ label: string;
49
+ /** The config object that pins it: `pglite` or `pglite.encryption`. */
50
+ field: string;
51
+ repository: string;
52
+ /** Environment variable naming a local build. */
53
+ localEnv: string;
54
+ /** File name inside a cache entry. */
55
+ file: string;
56
+ };
57
+ export declare const PGLITE_PROVIDER: PinnedComponent;
58
+ export declare const PGLITE_ENCFS: PinnedComponent;
59
+ /** `pglite.encryption`, resolved: where the encryption layer comes from. */
60
+ export type PgliteEncryptionConfig = {
61
+ /** `<repository>@sha256:<hex>` of the encryption layer. */
62
+ image?: string;
63
+ /** Absolute path of a local encryption layer build, used instead of `image`. */
64
+ wasm?: string;
65
+ };
66
+ /** `pglite` in di-framework.config.json, resolved. */
67
+ export type PgliteConfig = {
68
+ /** `<repository>@sha256:<hex>`; the manifest digest the platform publish job records. */
69
+ image?: string;
70
+ /** Absolute path of a local provider build, used instead of `image`. */
71
+ wasm?: string;
72
+ /** Guest preopen for the workload's persistent directory. */
73
+ storageMount: string;
74
+ /** Database root the guest opens; at or under `storageMount`. */
75
+ dataDir: string;
76
+ /** Encrypt the data directory at rest with this layer, keyed by `DI_PGLITE_KEY`. */
77
+ encryption?: PgliteEncryptionConfig;
78
+ };
79
+ export type ResolvedPglite = {
80
+ /** Verified provider bytes; the build plugs a private copy of these. */
81
+ bytes: Buffer;
82
+ source: 'local' | 'cache' | 'registry';
83
+ /** The digest pin, when the bytes came from the registry or the cache. */
84
+ image?: string;
85
+ /** The local file, when the bytes came from one. */
86
+ path?: string;
87
+ };
88
+ export declare function parseDigestReference(reference: string, repository?: string): {
89
+ repository: string;
90
+ digest: string;
91
+ };
92
+ /** True when `path` is `directory` or below it (both normalized guest paths). */
93
+ export declare function isWithin(path: string, directory: string): boolean;
94
+ /** Validates `pglite` from the config. `resolveFile` keeps `wasm` inside the project. */
95
+ export declare function parsePgliteConfig(value: unknown, configPath: string, resolveFile: (path: string) => string): PgliteConfig | undefined;
96
+ export declare function cacheRoot(env: Record<string, string | undefined>): string;
97
+ /** Where a digest-pinned provider is cached: `<cache>/oci/sha256/<hex>/`. */
98
+ export declare function cacheEntry(env: Record<string, string | undefined>, digest: string): string;
99
+ /**
100
+ * The manifest bytes must hash to the pinned digest; then the single `application/wasm`
101
+ * layer names the blob digest the provider bytes must hash to.
102
+ */
103
+ export declare function verifyManifest(bytes: Uint8Array, image: string): string;
104
+ export declare function verifyLayer(bytes: Uint8Array, image: string, layerDigest: string): void;
105
+ /** Staging directories older than this were left by a killed build and are removed. */
106
+ export declare const STALE_STAGING_MS: number;
107
+ /**
108
+ * Pulls the provider by digest with `oras`, verifying the manifest digest and the layer
109
+ * digest, into the cache. A cached entry is re-verified on every use; a corrupt one is
110
+ * pulled again. Returns the verified bytes, so later readers never see a swapped file.
111
+ */
112
+ export declare function pullPgliteComponent(image: string, io: CliIo, deps: WasmcloudDeps, cwd: string, component?: PinnedComponent): Promise<ResolvedPglite>;
113
+ /** Set to `1` to let `deploy` or a CI build use a local, unverified provider. */
114
+ export declare const ALLOW_LOCAL_PGLITE_ENV = "DI_FRAMEWORK_ALLOW_LOCAL_PGLITE";
115
+ export type ResolvePgliteOptions = {
116
+ /** A deploy ships the provider, so a local file needs the explicit opt-in. */
117
+ deploy?: boolean;
118
+ };
119
+ /**
120
+ * The provider to compose: `DI_FRAMEWORK_PGLITE_WASM`, then `pglite.wasm`, then the
121
+ * digest-pinned `pglite.image`. Local files are only checked to be WebAssembly, and are
122
+ * refused in a deploy or on CI without `DI_FRAMEWORK_ALLOW_LOCAL_PGLITE=1`.
123
+ */
124
+ export declare function resolvePgliteComponent(config: PgliteConfig, io: CliIo, deps: WasmcloudDeps, projectRoot: string, options?: ResolvePgliteOptions): Promise<ResolvedPglite>;
125
+ /**
126
+ * The encryption layer to plug into the provider, resolved like the provider:
127
+ * `DI_FRAMEWORK_PGLITE_ENCFS_WASM`, then `pglite.encryption.wasm`, then the digest-pinned
128
+ * `pglite.encryption.image`, with the same local-file refusal in a deploy or on CI.
129
+ */
130
+ export declare function resolvePgliteEncryption(config: PgliteEncryptionConfig, io: CliIo, deps: WasmcloudDeps, projectRoot: string, options?: ResolvePgliteOptions): Promise<ResolvedPglite>;
131
+ /**
132
+ * Members of one workload share one storage directory, mounted at each member's own
133
+ * `storageMount`. Two members whose `dataDir` is the same path relative to their mount
134
+ * would open the same database from separate instances, which exclusivity cannot stop.
135
+ */
136
+ export declare function assertDistinctPgliteRoots(workload: string, members: Iterable<{
137
+ applicationName: string;
138
+ workload?: string;
139
+ pglite?: PgliteConfig;
140
+ }>): void;
141
+ /** Tag fragment of the tenant host image that honours the exclusive opt-in (#140). */
142
+ export declare const EXCLUSIVE_HOST_IMAGE_MARKER = "-exclusive";
143
+ /**
144
+ * Stock wash ignores `di-framework.dev/exclusive-instance`: when its pool saturates or an
145
+ * instance drains, it builds a second store, which opens the same data directory. Warn when
146
+ * a tenant host group's image is not the exclusive build; elsewhere the CLI cannot see the
147
+ * host, so say what the opt-in depends on.
148
+ */
149
+ export declare function warnIfHostIgnoresExclusive(project: {
150
+ applicationName: string;
151
+ projectRoot: string;
152
+ pglite?: PgliteConfig;
153
+ }, connection: ClusterConnection, io: CliIo, deps: WasmcloudDeps): Promise<void>;