@workbench-kit/adapters 0.0.2-prototype.0.2.4 → 0.0.2-prototype.0.2.41

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,16 +1,15 @@
1
1
  {
2
2
  "name": "@workbench-kit/adapters",
3
- "version": "0.0.2-prototype.0.2.4",
3
+ "version": "0.0.2-prototype.0.2.41",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
- "./library": "./src/library.ts",
9
- "./runtime": "./src/runtime.ts",
10
- "./workspace": "./src/workspace.ts",
11
- "./workbench-demo": "./src/workbench-demo.ts",
12
- "./workbench-demo-config": "./src/workbench-demo-config.ts",
13
- "./persistence": "./src/persistence.ts"
8
+ "./library": "./src/library/library.ts",
9
+ "./runtime": "./src/runtime/runtime.ts",
10
+ "./workspace": "./src/workspace/workspace.ts",
11
+ "./workbench-demo": "./src/demo/workbench-demo.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/runtime": "0.0.2-prototype.0.2.4",
24
- "@workbench-kit/contracts": "0.0.2-prototype.0.2.4",
25
- "@workbench-kit/workspace": "0.0.2-prototype.0.2.4"
22
+ "@workbench-kit/contracts": "0.0.2-prototype.0.2.41",
23
+ "@workbench-kit/workspace": "0.0.2-prototype.0.2.41",
24
+ "@workbench-kit/runtime": "0.0.2-prototype.0.2.41"
26
25
  },
27
26
  "description": "Workbench Kit adapters for workspace repositories and runtime transports.",
28
27
  "publishConfig": {
@@ -4,7 +4,7 @@ import type { WorkspaceFile } from '@workbench-kit/workspace';
4
4
  import {
5
5
  widgetStudioBuiltinAssetFiles,
6
6
  widgetStudioCustomAssetExampleFiles,
7
- } from './widget-studio-assets.js';
7
+ } from '../widget-studio/widget-studio-assets.js';
8
8
 
9
9
  export const integratedShellWorkspaceFolders = [
10
10
  'src',
@@ -194,7 +194,7 @@ export const integratedShellWorkspaceFiles: WorkspaceFile[] = [
194
194
  export {
195
195
  widgetStudioBuiltinAssetFiles,
196
196
  widgetStudioCustomAssetExampleFiles,
197
- } from './widget-studio-assets.js';
197
+ } from '../widget-studio/widget-studio-assets.js';
198
198
 
199
199
  export const integratedShellInitialRuntimeMessages: RuntimeChatMessage[] = [
200
200
  {
package/src/index.ts CHANGED
@@ -1,8 +1,7 @@
1
- export * from './runtime';
2
- export * from './library';
3
- export * from './workspace';
4
- export * from './workbench-demo';
5
- export * from './widget-studio-assets';
6
- export * from './widget-studio-asset-package';
7
- export * from './workbench-demo-config';
8
- export * from './persistence';
1
+ export * from './runtime/runtime';
2
+ export * from './library/library';
3
+ export * from './workspace/workspace';
4
+ export * from './demo/workbench-demo';
5
+ export * from './widget-studio/widget-studio-assets';
6
+ export * from './widget-studio/widget-studio-asset-package';
7
+ export * from './demo/workbench-demo-config';
@@ -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
- }
File without changes