@sentropic/cluster-mesh 0.29.2 → 0.29.3

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 (49) hide show
  1. package/README.md +27 -0
  2. package/dist/loaders/workspace-store/index.d.ts +5 -0
  3. package/dist/loaders/workspace-store/index.d.ts.map +1 -0
  4. package/dist/loaders/workspace-store/index.js +6 -0
  5. package/dist/loaders/workspace-store/index.js.map +1 -0
  6. package/dist/modules/catalog.d.ts.map +1 -1
  7. package/dist/modules/catalog.js +3 -0
  8. package/dist/modules/catalog.js.map +1 -1
  9. package/dist/modules/contracts.d.ts +1 -1
  10. package/dist/modules/contracts.d.ts.map +1 -1
  11. package/dist/modules/contracts.js +1 -0
  12. package/dist/modules/contracts.js.map +1 -1
  13. package/dist/workspace-store/identity.d.ts +26 -0
  14. package/dist/workspace-store/identity.d.ts.map +1 -0
  15. package/dist/workspace-store/identity.js +26 -0
  16. package/dist/workspace-store/identity.js.map +1 -0
  17. package/dist/workspace-store/index.d.ts +7 -0
  18. package/dist/workspace-store/index.d.ts.map +1 -0
  19. package/dist/workspace-store/index.js +5 -0
  20. package/dist/workspace-store/index.js.map +1 -0
  21. package/dist/workspace-store/local-broker.d.ts +33 -0
  22. package/dist/workspace-store/local-broker.d.ts.map +1 -0
  23. package/dist/workspace-store/local-broker.js +195 -0
  24. package/dist/workspace-store/local-broker.js.map +1 -0
  25. package/dist/workspace-store/local-gc.d.ts +11 -0
  26. package/dist/workspace-store/local-gc.d.ts.map +1 -0
  27. package/dist/workspace-store/local-gc.js +94 -0
  28. package/dist/workspace-store/local-gc.js.map +1 -0
  29. package/dist/workspace-store/local-tree.d.ts +19 -0
  30. package/dist/workspace-store/local-tree.d.ts.map +1 -0
  31. package/dist/workspace-store/local-tree.js +162 -0
  32. package/dist/workspace-store/local-tree.js.map +1 -0
  33. package/dist/workspace-store/local-view.d.ts +7 -0
  34. package/dist/workspace-store/local-view.d.ts.map +1 -0
  35. package/dist/workspace-store/local-view.js +272 -0
  36. package/dist/workspace-store/local-view.js.map +1 -0
  37. package/dist/workspace-store/ports.d.ts +65 -0
  38. package/dist/workspace-store/ports.d.ts.map +1 -0
  39. package/dist/workspace-store/ports.js +2 -0
  40. package/dist/workspace-store/ports.js.map +1 -0
  41. package/dist/workspace-store/receipt.d.ts +47 -0
  42. package/dist/workspace-store/receipt.d.ts.map +1 -0
  43. package/dist/workspace-store/receipt.js +2 -0
  44. package/dist/workspace-store/receipt.js.map +1 -0
  45. package/dist/workspace-store/view-plan.d.ts +17 -0
  46. package/dist/workspace-store/view-plan.d.ts.map +1 -0
  47. package/dist/workspace-store/view-plan.js +60 -0
  48. package/dist/workspace-store/view-plan.js.map +1 -0
  49. package/package.json +10 -1
@@ -0,0 +1,65 @@
1
+ import type { WORKSPACE_STORE_VERSION, WorkspaceStoreRecipeV1, WorkspaceStoreScopeV1 } from './identity.js';
2
+ export interface WorkspaceStoreHandleV1 {
3
+ readonly version: typeof WORKSPACE_STORE_VERSION;
4
+ readonly scope: WorkspaceStoreScopeV1;
5
+ readonly storeKey: string;
6
+ readonly treeGeneration: string;
7
+ readonly reservationId: string;
8
+ readonly expiresAtMs: number;
9
+ }
10
+ export interface WorkspaceStoreLaneOwnerV1 {
11
+ readonly sessionId: string;
12
+ readonly laneId: string;
13
+ }
14
+ export type WorkspaceStoreMountV1 = {
15
+ readonly readOnly: true;
16
+ } & ({
17
+ readonly kind: 'local';
18
+ readonly path: string;
19
+ } | {
20
+ readonly kind: 'volume';
21
+ readonly volume: string;
22
+ readonly subpath: string;
23
+ } | {
24
+ readonly kind: 'oci';
25
+ readonly manifestDigest: string;
26
+ readonly path: string;
27
+ });
28
+ export type WorkspaceStoreOutcomeV1<T> = {
29
+ readonly ok: true;
30
+ readonly value: T;
31
+ } | {
32
+ readonly ok: false;
33
+ readonly error: {
34
+ readonly code: 'capacity' | 'integrity' | 'incompatible' | 'unavailable' | 'reservation_expired' | 'stale_generation' | 'detach_required';
35
+ readonly message: string;
36
+ };
37
+ };
38
+ export interface WorkspaceStoreGcV1 {
39
+ readonly reclaimed: number;
40
+ readonly pending: number;
41
+ readonly protected: number;
42
+ readonly blocked: number;
43
+ /** Allocated bytes reclaimed, or projected bytes for a dry run. */
44
+ readonly bytes: number;
45
+ }
46
+ export interface WorkspaceStorePortsV1 {
47
+ /** Reserve a verified generation. Retries with the same scoped request ID reuse the reservation. */
48
+ ensure(lockHash: string, recipe: WorkspaceStoreRecipeV1, scope: WorkspaceStoreScopeV1, requestId: string): Promise<WorkspaceStoreOutcomeV1<WorkspaceStoreHandleV1>>;
49
+ /** Convert under the GC lock. Replay for the same lane, generation and tree returns the original lease and mount. */
50
+ lease(handle: WorkspaceStoreHandleV1, owner: WorkspaceStoreLaneOwnerV1, generation: number): Promise<WorkspaceStoreOutcomeV1<{
51
+ readonly leaseId: string;
52
+ readonly mount: WorkspaceStoreMountV1;
53
+ }>>;
54
+ /** Replayable CAS to the next lane generation. Keep the tree and all predecessor readers pinned. */
55
+ transfer(leaseId: string, expectedGeneration: number, nextGeneration: number): Promise<WorkspaceStoreOutcomeV1<void>>;
56
+ /** The lane generation fences renewals and releases. Expiry requests reconciliation. */
57
+ renew(leaseId: string, generation: number): Promise<WorkspaceStoreOutcomeV1<{
58
+ readonly expiresAtMs: number;
59
+ }>>;
60
+ /** Release only after broker authority confirms every reader detached, including predecessors. Replay returns the recorded outcome. */
61
+ release(leaseId: string, generation: number): Promise<WorkspaceStoreOutcomeV1<void>>;
62
+ /** Protect reservations, build and teardown pins, active leases and resumable lanes. Dry runs are read-only. */
63
+ gc(scope: WorkspaceStoreScopeV1, budgetBytes: number, dryRun: boolean): Promise<WorkspaceStoreOutcomeV1<WorkspaceStoreGcV1>>;
64
+ }
65
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/workspace-store/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uB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vI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,CAAC;IACrF,gHAAgH;IAChH,EAAE,CAAC,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CAAC;CAC9H"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/workspace-store/ports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import type { WORKSPACE_STORE_VERSION, WorkspaceStoreScopeV1 } from './identity.js';
2
+ export interface WorkspaceStorePackageV1 {
3
+ readonly name: string;
4
+ /** Resolved package path relative to the dependency tree root. */
5
+ readonly path: string;
6
+ readonly version: string;
7
+ }
8
+ export type WorkspaceStoreFileV1 = {
9
+ readonly kind: 'file';
10
+ readonly path: string;
11
+ readonly sha256: string;
12
+ readonly mode: number;
13
+ } | {
14
+ readonly kind: 'directory';
15
+ readonly path: string;
16
+ readonly mode: number;
17
+ } | {
18
+ readonly kind: 'symlink';
19
+ readonly path: string;
20
+ readonly target: string;
21
+ };
22
+ export type WorkspaceStoreScriptV1 = WorkspaceStorePackageV1 & ({
23
+ readonly disposition: 'rebuilt';
24
+ readonly recipeId: string;
25
+ } | {
26
+ readonly disposition: 'lane_provisioned';
27
+ readonly recipeId: string;
28
+ } | {
29
+ readonly disposition: 'skipped' | 'inapplicable';
30
+ readonly reason: string;
31
+ });
32
+ export interface WorkspaceStoreReceiptV1 {
33
+ readonly version: typeof WORKSPACE_STORE_VERSION;
34
+ readonly scope: WorkspaceStoreScopeV1;
35
+ readonly storeKey: string;
36
+ /** Immutable tree generation, separate from the h2a lane generation. */
37
+ readonly treeGeneration: string;
38
+ readonly tarballs: readonly (WorkspaceStorePackageV1 & {
39
+ readonly integrity: string;
40
+ })[];
41
+ readonly files: readonly WorkspaceStoreFileV1[];
42
+ readonly installScripts: readonly WorkspaceStoreScriptV1[];
43
+ readonly workspaceClosure: readonly WorkspaceStorePackageV1[];
44
+ readonly workspaceLinks?: Readonly<Record<string, string>>;
45
+ readonly workspaceLocal?: readonly string[];
46
+ }
47
+ //# sourceMappingURL=receipt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receipt.d.ts","sourceRoot":"","sources":["../../src/workspace-store/receipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAChG;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5E;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,GAAG,CAC3D;IAAE,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC9D;IAAE,QAAQ,CAAC,WAAW,EAAE,kBAAkB,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,QAAQ,CAAC,WAAW,EAAE,SAAS,GAAG,cAAc,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAChF,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,OAAO,uBAAuB,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,uBAAuB,GAAG;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,CAAC;IACzF,QAAQ,CAAC,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAChD,QAAQ,CAAC,cAAc,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC3D,QAAQ,CAAC,gBAAgB,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC9D,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=receipt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receipt.js","sourceRoot":"","sources":["../../src/workspace-store/receipt.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import type { WorkspaceStoreReceiptV1, WorkspaceStoreScriptV1 } from './receipt.js';
2
+ interface NpmLockPackage {
3
+ readonly name?: string;
4
+ readonly version?: string;
5
+ readonly resolved?: string;
6
+ readonly link?: boolean;
7
+ readonly dependencies?: Readonly<Record<string, string>>;
8
+ readonly optionalDependencies?: Readonly<Record<string, string>>;
9
+ readonly peerDependencies?: Readonly<Record<string, string>>;
10
+ }
11
+ export declare const packageGroup: (path: string) => string;
12
+ /** Resolve npm's lockfile locations before choosing which physical package trees must move together. */
13
+ export declare function planWorkspaceStoreViewV1(packages: Readonly<Record<string, NpmLockPackage>>): Required<Pick<WorkspaceStoreReceiptV1, 'workspaceLinks' | 'workspaceLocal' | 'workspaceClosure'>>;
14
+ /** Apply the caller's reviewed rebuild policy to exact installed package paths. */
15
+ export declare function verifyWorkspaceStoreRebuildsV1(scripts: readonly WorkspaceStoreScriptV1[], required: readonly string[]): void;
16
+ export {};
17
+ //# sourceMappingURL=view-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-plan.d.ts","sourceRoot":"","sources":["../../src/workspace-store/view-plan.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEpF,UAAU,cAAc;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD,QAAQ,CAAC,oBAAoB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACjE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC9D;AAID,eAAO,MAAM,YAAY,SAAU,MAAM,KAAG,MAA0E,CAAC;AAEvH,wGAAwG;AACxG,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GACzF,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,CAAC,CAqClG;AAED,mFAAmF;AACnF,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,SAAS,sBAAsB,EAAE,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAQ5H"}
@@ -0,0 +1,60 @@
1
+ import { dirname } from 'node:path/posix';
2
+ const modules = 'node_modules/';
3
+ const nested = '/' + modules;
4
+ export const packageGroup = (path) => path.split('/').slice(0, path.startsWith('@') ? 2 : 1).join('/');
5
+ /** Resolve npm's lockfile locations before choosing which physical package trees must move together. */
6
+ export function planWorkspaceStoreViewV1(packages) {
7
+ const entries = Object.entries(packages).sort(([a], [b]) => a.localeCompare(b, 'en'));
8
+ const roots = entries.filter(([path]) => path.startsWith(modules));
9
+ const workspaceLinks = Object.fromEntries(roots.flatMap(([path, pkg]) => pkg.link && pkg.resolved && !path.includes(nested) ? [[path.slice(modules.length), pkg.resolved]] : []));
10
+ const workspaceLocal = entries.flatMap(([path, pkg]) => (!path.startsWith(modules) && path.includes(nested)) || (pkg.link && path.includes(nested)) ? [path] : []);
11
+ const resolveDependency = (path, name) => {
12
+ for (let parent = path; parent !== '.'; parent = dirname(parent)) {
13
+ const candidate = parent + nested + name;
14
+ if (Object.hasOwn(packages, candidate))
15
+ return candidate;
16
+ }
17
+ return modules + name;
18
+ };
19
+ // A package's nested installs move with it. Propagate back through any consumer of that group.
20
+ const reverse = new Map();
21
+ for (const [path, pkg] of roots) {
22
+ if (pkg.link)
23
+ continue;
24
+ const group = packageGroup(path.slice(modules.length));
25
+ for (const name of Object.keys({ ...pkg.dependencies, ...pkg.optionalDependencies, ...pkg.peerDependencies })) {
26
+ const target = resolveDependency(path, name);
27
+ const provider = packageGroup(target.slice(modules.length));
28
+ const consumers = reverse.get(provider) ?? new Set();
29
+ if (group !== provider)
30
+ consumers.add(group);
31
+ reverse.set(provider, consumers);
32
+ }
33
+ }
34
+ const local = new Set(Object.keys(workspaceLinks));
35
+ for (const [path, pkg] of roots)
36
+ if (pkg.resolved?.startsWith('file:'))
37
+ local.add(packageGroup(path.slice(modules.length)));
38
+ for (const group of local)
39
+ for (const consumer of reverse.get(group) ?? [])
40
+ local.add(consumer);
41
+ const workspaceClosure = roots.flatMap(([path, pkg]) => {
42
+ const relative = path.slice(modules.length);
43
+ if (pkg.link || !pkg.version || !local.has(packageGroup(relative)))
44
+ return [];
45
+ return [{ name: pkg.name ?? relative.split(nested).at(-1), path: relative, version: pkg.version }];
46
+ });
47
+ return { workspaceLinks, workspaceLocal, workspaceClosure };
48
+ }
49
+ /** Apply the caller's reviewed rebuild policy to exact installed package paths. */
50
+ export function verifyWorkspaceStoreRebuildsV1(scripts, required) {
51
+ const byPath = new Map(scripts.map(script => [script.path, script]));
52
+ for (const path of required) {
53
+ const script = byPath.get(path);
54
+ if (script?.disposition === 'rebuilt')
55
+ continue;
56
+ const detail = script && ('reason' in script ? script.reason : script.disposition);
57
+ throw new Error(`Required rebuild for ${script?.name ?? path} at ${path}: ${detail ?? 'missing receipt'}`);
58
+ }
59
+ }
60
+ //# sourceMappingURL=view-plan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view-plan.js","sourceRoot":"","sources":["../../src/workspace-store/view-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAa1C,MAAM,OAAO,GAAG,eAAe,CAAC;AAChC,MAAM,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KA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AAM,UAAU,8BAA8B,CAAC,OAA0C,EAAE,QAA2B;IACpH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACrE,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAChC,IAAI,MAAM,EAAE,WAAW,KAAK,SAAS;YAAE,SAAS;QAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACnF,MAAM,IAAI,KAAK,CAAC,wBAAwB,MAAM,EAAE,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,MAAM,IAAI,iBAAiB,EAAE,CAAC,CAAC;IAC7G,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentropic/cluster-mesh",
3
- "version": "0.29.2",
3
+ "version": "0.29.3",
4
4
  "description": "Injectable Cluster Mesh control-plane contracts, namespace modules, and single-instance runtime.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -100,6 +100,14 @@
100
100
  "types": "./dist/loaders/notifications/index.d.ts",
101
101
  "import": "./dist/loaders/notifications/index.js"
102
102
  },
103
+ "./workspace-store": {
104
+ "types": "./dist/workspace-store/index.d.ts",
105
+ "import": "./dist/workspace-store/index.js"
106
+ },
107
+ "./loaders/workspace-store": {
108
+ "types": "./dist/loaders/workspace-store/index.d.ts",
109
+ "import": "./dist/loaders/workspace-store/index.js"
110
+ },
103
111
  "./llm-mesh": {
104
112
  "types": "./dist/integrations/llm-mesh/index.d.ts",
105
113
  "import": "./dist/integrations/llm-mesh/index.js"
@@ -247,6 +255,7 @@
247
255
  "./dist/modules/topology-guard-gateway.js",
248
256
  "./dist/modules/topology-guard-llm-mesh.js",
249
257
  "./dist/integrations/**",
258
+ "./dist/workspace-store/index.js",
250
259
  "./dist/loaders/**",
251
260
  "./dist/compose/**"
252
261
  ],