@workbench-kit/adapters 0.0.2-prototype.0.2.31 → 0.0.2-prototype.0.2.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workbench-kit/adapters",
3
- "version": "0.0.2-prototype.0.2.31",
3
+ "version": "0.0.2-prototype.0.2.33",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,8 +9,7 @@
9
9
  "./runtime": "./src/runtime/runtime.ts",
10
10
  "./workspace": "./src/workspace/workspace.ts",
11
11
  "./workbench-demo": "./src/demo/workbench-demo.ts",
12
- "./workbench-demo-config": "./src/demo/workbench-demo-config.ts",
13
- "./persistence": "./src/persistence/persistence.ts"
12
+ "./workbench-demo-config": "./src/demo/workbench-demo-config.ts"
14
13
  },
15
14
  "files": [
16
15
  "src",
@@ -20,9 +19,9 @@
20
19
  "!src/**/*.stories.tsx"
21
20
  ],
22
21
  "dependencies": {
23
- "@workbench-kit/contracts": "0.0.2-prototype.0.2.31",
24
- "@workbench-kit/runtime": "0.0.2-prototype.0.2.31",
25
- "@workbench-kit/workspace": "0.0.2-prototype.0.2.31"
22
+ "@workbench-kit/workspace": "0.0.2-prototype.0.2.33",
23
+ "@workbench-kit/runtime": "0.0.2-prototype.0.2.33",
24
+ "@workbench-kit/contracts": "0.0.2-prototype.0.2.33"
26
25
  },
27
26
  "description": "Workbench Kit adapters for workspace repositories and runtime transports.",
28
27
  "publishConfig": {
package/src/index.ts CHANGED
@@ -5,4 +5,3 @@ export * from './demo/workbench-demo';
5
5
  export * from './widget-studio/widget-studio-assets';
6
6
  export * from './widget-studio/widget-studio-asset-package';
7
7
  export * from './demo/workbench-demo-config';
8
- export * from './persistence/persistence';
@@ -85,13 +85,3 @@ export function createChatTransportFromRuntime({
85
85
  }),
86
86
  };
87
87
  }
88
-
89
- export function emitRuntimeWorkspacePatch({
90
- runtime,
91
- patch,
92
- }: {
93
- runtime: Pick<MockWorkbenchRuntime, 'emitWorkspacePatch'>;
94
- patch: Parameters<MockWorkbenchRuntime['emitWorkspacePatch']>[0];
95
- }) {
96
- runtime.emitWorkspacePatch(patch);
97
- }
@@ -1,5 +1,3 @@
1
- import type { WorkspaceFile } from '@workbench-kit/workspace';
2
-
3
1
  import {
4
2
  flattenWidgetStudioAssetPackages,
5
3
  WIDGET_STUDIO_ASSETS_DIR,
@@ -9,8 +7,6 @@ import {
9
7
 
10
8
  export { WIDGET_STUDIO_ASSETS_DIR, WIDGET_STUDIO_CUSTOM_ASSETS_DIR };
11
9
 
12
- export type WidgetStudioWorkspaceAssetFile = WorkspaceFile;
13
-
14
10
  const TEXT_INPUTS_SCHEMA = {
15
11
  $schema: 'http://json-schema.org/draft-07/schema#',
16
12
  title: 'TextAssetInputs',
@@ -321,8 +317,3 @@ const customAssetPackages: WidgetStudioAssetPackageDefinition[] = [
321
317
  export const widgetStudioBuiltinAssetFiles = flattenWidgetStudioAssetPackages(builtinAssetPackages);
322
318
  export const widgetStudioCustomAssetExampleFiles =
323
319
  flattenWidgetStudioAssetPackages(customAssetPackages);
324
-
325
- export const widgetStudioAssetPackageSlugs = [
326
- ...builtinAssetPackages.map((pkg) => pkg.slug),
327
- ...customAssetPackages.map((pkg) => `${pkg.baseDir?.split('/').pop()}/${pkg.slug}`),
328
- ];
@@ -12,11 +12,6 @@ export interface WorkspaceFileRepositoryCallbacks {
12
12
  saveFile: (path: string, file: WriteWorkspaceFileInput) => void;
13
13
  }
14
14
 
15
- export interface WorkspaceFileAdapterState {
16
- getFiles: () => WorkspaceFile[];
17
- files: WorkspaceFile[];
18
- }
19
-
20
15
  const cloneFile = (file: WorkspaceFile): WorkspaceFile => ({ ...file });
21
16
 
22
17
  function normalizeInputPath(path: string) {
@@ -1,26 +0,0 @@
1
- /**
2
- * Optional persistence boundary for host apps that store workbench UI state
3
- * outside the in-memory adapters used by Storybook fixtures.
4
- */
5
- export interface WorkbenchPersistenceAdapter {
6
- loadState<T>(key: string): Promise<T | null>;
7
- removeState(key: string): Promise<void>;
8
- saveState<T>(key: string, value: T): Promise<void>;
9
- }
10
-
11
- export class InMemoryWorkbenchPersistenceAdapter implements WorkbenchPersistenceAdapter {
12
- private readonly store = new Map<string, unknown>();
13
-
14
- async loadState<T>(key: string): Promise<T | null> {
15
- if (!this.store.has(key)) return null;
16
- return structuredClone(this.store.get(key)) as T;
17
- }
18
-
19
- async removeState(key: string): Promise<void> {
20
- this.store.delete(key);
21
- }
22
-
23
- async saveState<T>(key: string, value: T): Promise<void> {
24
- this.store.set(key, structuredClone(value));
25
- }
26
- }