@dexto/image-bundler 1.7.2 → 1.8.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.
@@ -2,7 +2,7 @@
2
2
  * Image Definition Types (bundler-only)
3
3
  *
4
4
  * The bundler consumes a `dexto.image.ts` file that declares metadata and defaults.
5
- * Concrete tools/storage/hooks/compaction factories are discovered from convention folders
5
+ * Concrete tools/hooks/compaction factories are discovered from convention folders
6
6
  * and must `export const factory = ...` from their `index.ts`.
7
7
  */
8
8
 
@@ -12,6 +12,7 @@ import type { ImageDefaults } from '@dexto/agent-config';
12
12
  * Image definition structure consumed by `@dexto/image-bundler`.
13
13
  *
14
14
  * Note: Provider factories are discovered from folders; this file is metadata + defaults only.
15
+ * Storage is supplied by the runtime image's `storage.createStores` implementation.
15
16
  */
16
17
  export interface ImageDefinition {
17
18
  /** Unique name for this image (e.g., 'image-local') */
@@ -96,7 +96,7 @@ export const factory = {
96
96
  }
97
97
  }, 20000);
98
98
 
99
- it('bundles an image with tools/storage/hooks/compaction factories', async () => {
99
+ it('bundles an image with tools/hooks/compaction factories', async () => {
100
100
  const logSpy = vi.spyOn(console, 'log').mockImplementation(() => undefined);
101
101
  const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => undefined);
102
102
 
@@ -125,7 +125,7 @@ export const factory = {
125
125
  const image = {
126
126
  name: 'test-image-full',
127
127
  version: '1.0.0',
128
- description: 'Test image with tools/storage/hooks/compaction factories',
128
+ description: 'Test image with tools/hooks/compaction factories',
129
129
  target: 'local-development',
130
130
  } satisfies ImageDefinition;
131
131
 
@@ -189,45 +189,6 @@ export const factory = {
189
189
  `
190
190
  );
191
191
 
192
- await writeFileEnsuringDir(
193
- path.join(tempDir, 'storage', 'blob', 'in-memory', 'index.ts'),
194
- `const configSchema = {
195
- parse: (value: unknown) => value,
196
- };
197
-
198
- export const factory = {
199
- configSchema,
200
- create: (_config: unknown, _logger: unknown) => ({}),
201
- };
202
- `
203
- );
204
-
205
- await writeFileEnsuringDir(
206
- path.join(tempDir, 'storage', 'database', 'in-memory', 'index.ts'),
207
- `const configSchema = {
208
- parse: (value: unknown) => value,
209
- };
210
-
211
- export const factory = {
212
- configSchema,
213
- create: (_config: unknown, _logger: unknown) => ({}),
214
- };
215
- `
216
- );
217
-
218
- await writeFileEnsuringDir(
219
- path.join(tempDir, 'storage', 'cache', 'in-memory', 'index.ts'),
220
- `const configSchema = {
221
- parse: (value: unknown) => value,
222
- };
223
-
224
- export const factory = {
225
- configSchema,
226
- create: (_config: unknown, _logger: unknown) => ({}),
227
- };
228
- `
229
- );
230
-
231
192
  const distDir = path.join(tempDir, 'dist');
232
193
  const result = await bundle({
233
194
  imagePath: path.join(tempDir, 'dexto.image.ts'),
@@ -241,9 +202,8 @@ export const factory = {
241
202
  expect(image.hooks['sample-hook']).toBeDefined();
242
203
  expect(image.compaction['noop']).toBeDefined();
243
204
 
244
- expect(image.storage.blob['in-memory']).toBeDefined();
245
- expect(image.storage.database['in-memory']).toBeDefined();
246
- expect(image.storage.cache['in-memory']).toBeDefined();
205
+ expect(image.storage.configSchema).toBeDefined();
206
+ expect(image.storage.createStores).toBeDefined();
247
207
  } finally {
248
208
  await rm(tempDir, { recursive: true, force: true });
249
209
  logSpy.mockRestore();