@rcrsr/rill 0.16.0 → 0.18.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 (97) hide show
  1. package/README.md +37 -21
  2. package/dist/ast-nodes.d.ts +14 -4
  3. package/dist/ast-unions.d.ts +1 -1
  4. package/dist/constants.d.ts +1 -1
  5. package/dist/constants.js +1 -0
  6. package/dist/error-registry.js +228 -0
  7. package/dist/ext/crypto/index.d.ts +3 -3
  8. package/dist/ext/crypto/index.js +62 -59
  9. package/dist/ext/exec/index.d.ts +3 -3
  10. package/dist/ext/exec/index.js +15 -9
  11. package/dist/ext/fetch/index.d.ts +3 -3
  12. package/dist/ext/fetch/index.js +17 -12
  13. package/dist/ext/fetch/request.js +1 -1
  14. package/dist/ext/fs/index.d.ts +3 -3
  15. package/dist/ext/fs/index.js +256 -266
  16. package/dist/ext/fs/sandbox.d.ts +18 -0
  17. package/dist/ext/fs/sandbox.js +33 -0
  18. package/dist/ext/kv/index.d.ts +3 -3
  19. package/dist/ext/kv/index.js +198 -196
  20. package/dist/ext/kv/store.d.ts +1 -1
  21. package/dist/ext/kv/store.js +2 -1
  22. package/dist/ext-parse-bridge.d.ts +10 -0
  23. package/dist/ext-parse-bridge.js +10 -0
  24. package/dist/generated/introspection-data.d.ts +1 -1
  25. package/dist/generated/introspection-data.js +385 -296
  26. package/dist/generated/version-data.d.ts +1 -1
  27. package/dist/generated/version-data.js +2 -2
  28. package/dist/highlight-map.js +1 -0
  29. package/dist/index.d.ts +1 -4
  30. package/dist/index.js +1 -5
  31. package/dist/lexer/operators.js +1 -0
  32. package/dist/parser/helpers.js +1 -0
  33. package/dist/parser/parser-expr.js +44 -5
  34. package/dist/parser/parser-literals.js +111 -4
  35. package/dist/parser/parser-shape.js +2 -2
  36. package/dist/parser/parser-types.js +12 -0
  37. package/dist/parser/parser-use.js +26 -3
  38. package/dist/parser/parser.d.ts +2 -0
  39. package/dist/parser/parser.js +2 -0
  40. package/dist/runtime/core/callable.d.ts +24 -13
  41. package/dist/runtime/core/callable.js +71 -38
  42. package/dist/runtime/core/context.d.ts +2 -13
  43. package/dist/runtime/core/context.js +80 -79
  44. package/dist/runtime/core/eval/base.d.ts +2 -2
  45. package/dist/runtime/core/eval/base.js +2 -0
  46. package/dist/runtime/core/eval/evaluator.d.ts +1 -1
  47. package/dist/runtime/core/eval/index.d.ts +3 -3
  48. package/dist/runtime/core/eval/index.js +11 -0
  49. package/dist/runtime/core/eval/mixins/closures.js +381 -41
  50. package/dist/runtime/core/eval/mixins/collections.js +81 -6
  51. package/dist/runtime/core/eval/mixins/control-flow.js +1 -1
  52. package/dist/runtime/core/eval/mixins/conversion.js +61 -115
  53. package/dist/runtime/core/eval/mixins/core.js +17 -4
  54. package/dist/runtime/core/eval/mixins/expressions.js +36 -27
  55. package/dist/runtime/core/eval/mixins/extraction.js +2 -3
  56. package/dist/runtime/core/eval/mixins/list-dispatch.js +1 -1
  57. package/dist/runtime/core/eval/mixins/literals.js +17 -6
  58. package/dist/runtime/core/eval/mixins/types.js +73 -54
  59. package/dist/runtime/core/eval/mixins/variables.js +12 -8
  60. package/dist/runtime/core/execute.d.ts +1 -1
  61. package/dist/runtime/core/field-descriptor.d.ts +3 -3
  62. package/dist/runtime/core/field-descriptor.js +2 -1
  63. package/dist/runtime/core/introspection.d.ts +2 -2
  64. package/dist/runtime/core/introspection.js +7 -6
  65. package/dist/runtime/core/resolvers.d.ts +1 -1
  66. package/dist/runtime/core/signals.d.ts +6 -1
  67. package/dist/runtime/core/signals.js +9 -0
  68. package/dist/runtime/core/types/constructors.d.ts +54 -0
  69. package/dist/runtime/core/types/constructors.js +201 -0
  70. package/dist/runtime/core/types/guards.d.ts +42 -0
  71. package/dist/runtime/core/types/guards.js +88 -0
  72. package/dist/runtime/core/types/index.d.ts +18 -0
  73. package/dist/runtime/core/types/index.js +19 -0
  74. package/dist/runtime/core/types/markers.d.ts +12 -0
  75. package/dist/runtime/core/types/markers.js +7 -0
  76. package/dist/runtime/core/types/operations.d.ts +98 -0
  77. package/dist/runtime/core/types/operations.js +804 -0
  78. package/dist/runtime/core/types/registrations.d.ts +126 -0
  79. package/dist/runtime/core/types/registrations.js +751 -0
  80. package/dist/runtime/core/{types.d.ts → types/runtime.d.ts} +22 -10
  81. package/dist/runtime/core/types/structures.d.ts +146 -0
  82. package/dist/runtime/core/types/structures.js +12 -0
  83. package/dist/runtime/core/values.d.ts +29 -209
  84. package/dist/runtime/core/values.js +56 -968
  85. package/dist/runtime/ext/builtins.js +88 -68
  86. package/dist/runtime/ext/extensions.d.ts +31 -125
  87. package/dist/runtime/ext/extensions.js +2 -94
  88. package/dist/runtime/ext/test-context.d.ts +28 -0
  89. package/dist/runtime/ext/test-context.js +155 -0
  90. package/dist/runtime/index.d.ts +12 -12
  91. package/dist/runtime/index.js +13 -5
  92. package/dist/signature-parser.d.ts +2 -2
  93. package/dist/signature-parser.js +14 -14
  94. package/dist/token-types.d.ts +1 -0
  95. package/dist/token-types.js +1 -0
  96. package/package.json +1 -1
  97. /package/dist/runtime/core/{types.js → types/runtime.js} +0 -0
@@ -75,3 +75,21 @@ export declare function checkMode(mode: 'read' | 'write' | 'read-write', operati
75
75
  * @throws RuntimeError - If mount path invalid or inaccessible
76
76
  */
77
77
  export declare function initializeMount(mount: MountConfig): Promise<void>;
78
+ /**
79
+ * Parses a mount-prefixed path into mount name and relative path.
80
+ *
81
+ * Uses longest-first prefix matching to support mount names containing slashes.
82
+ * Strips a leading `/` before matching.
83
+ * Example: "/workspace/my/file.txt" → { mountName: "workspace", relativePath: "my/file.txt" }
84
+ * Example: "/the/mount/file.txt" → { mountName: "the/mount", relativePath: "file.txt" }
85
+ * Example: "/workspace" → { mountName: "workspace", relativePath: "" }
86
+ *
87
+ * @param fullPath - Path with leading `/` and mount prefix
88
+ * @param mounts - Mount configuration map
89
+ * @returns Parsed mount name and relative path
90
+ * @throws RuntimeError - If no mount matches the path prefix
91
+ */
92
+ export declare function parseMountPath(fullPath: string, mounts: Record<string, MountConfig>): {
93
+ mountName: string;
94
+ relativePath: string;
95
+ };
@@ -205,3 +205,36 @@ export async function initializeMount(mount) {
205
205
  throw error;
206
206
  }
207
207
  }
208
+ // ============================================================
209
+ // MOUNT PATH PARSING
210
+ // ============================================================
211
+ /**
212
+ * Parses a mount-prefixed path into mount name and relative path.
213
+ *
214
+ * Uses longest-first prefix matching to support mount names containing slashes.
215
+ * Strips a leading `/` before matching.
216
+ * Example: "/workspace/my/file.txt" → { mountName: "workspace", relativePath: "my/file.txt" }
217
+ * Example: "/the/mount/file.txt" → { mountName: "the/mount", relativePath: "file.txt" }
218
+ * Example: "/workspace" → { mountName: "workspace", relativePath: "" }
219
+ *
220
+ * @param fullPath - Path with leading `/` and mount prefix
221
+ * @param mounts - Mount configuration map
222
+ * @returns Parsed mount name and relative path
223
+ * @throws RuntimeError - If no mount matches the path prefix
224
+ */
225
+ export function parseMountPath(fullPath, mounts) {
226
+ const normalized = fullPath.startsWith('/') ? fullPath.slice(1) : fullPath;
227
+ const sortedNames = Object.keys(mounts).sort((a, b) => b.length - a.length);
228
+ for (const mountName of sortedNames) {
229
+ if (normalized === mountName) {
230
+ return { mountName, relativePath: '' };
231
+ }
232
+ if (normalized.startsWith(mountName + '/')) {
233
+ return {
234
+ mountName,
235
+ relativePath: normalized.slice(mountName.length + 1),
236
+ };
237
+ }
238
+ }
239
+ throw new RuntimeError('RILL-R017', `no mount matches path "${fullPath}"`, undefined, { path: fullPath });
240
+ }
@@ -4,7 +4,7 @@
4
4
  * Provides key-value store operations with JSON persistence and schema validation.
5
5
  * Supports both open mode (any key/value) and declared mode (schema-defined keys only).
6
6
  */
7
- import type { ExtensionResult, ExtensionConfigSchema, ExtensionManifest } from '../../runtime/ext/extensions.js';
7
+ import type { ExtensionFactoryResult, ExtensionConfigSchema, ExtensionManifest } from '../../runtime/ext/extensions.js';
8
8
  import { type SchemaEntry } from './store.js';
9
9
  /** Configuration for a single KV mount */
10
10
  export interface KvMountConfig {
@@ -51,7 +51,7 @@ export declare const configSchema: ExtensionConfigSchema;
51
51
  * Returns 11 functions: get, get_or, set, merge, delete, keys, has, clear, getAll, schema, mounts.
52
52
  *
53
53
  * @param config - Store configuration (mount-based or single-store)
54
- * @returns ExtensionResult with 11 KV functions and dispose handler
54
+ * @returns ExtensionFactoryResult with 11 KV functions and dispose handler
55
55
  * @throws RuntimeError if store file is corrupt (EC-25)
56
56
  *
57
57
  * @example
@@ -78,5 +78,5 @@ export declare const configSchema: ExtensionConfigSchema;
78
78
  * });
79
79
  * ```
80
80
  */
81
- export declare function createKvExtension(config: KvConfig): ExtensionResult;
81
+ export declare function createKvExtension(config: KvConfig): ExtensionFactoryResult;
82
82
  export declare const extensionManifest: ExtensionManifest;
@@ -5,9 +5,10 @@
5
5
  * Supports both open mode (any key/value) and declared mode (schema-defined keys only).
6
6
  */
7
7
  import { RuntimeError } from '../../error-classes.js';
8
+ import { toCallable } from '../../runtime/core/callable.js';
8
9
  import { isDict } from '../../runtime/core/callable.js';
9
10
  import { createStore } from './store.js';
10
- import { rillTypeToTypeValue, } from '../../runtime/core/values.js';
11
+ import { structureToTypeValue } from '../../runtime/core/values.js';
11
12
  export const configSchema = {
12
13
  store: { type: 'string' },
13
14
  mounts: { type: 'string' },
@@ -22,7 +23,7 @@ export const configSchema = {
22
23
  * Returns 11 functions: get, get_or, set, merge, delete, keys, has, clear, getAll, schema, mounts.
23
24
  *
24
25
  * @param config - Store configuration (mount-based or single-store)
25
- * @returns ExtensionResult with 11 KV functions and dispose handler
26
+ * @returns ExtensionFactoryResult with 11 KV functions and dispose handler
26
27
  * @throws RuntimeError if store file is corrupt (EC-25)
27
28
  *
28
29
  * @example
@@ -279,204 +280,205 @@ export function createKvExtension(config) {
279
280
  // ============================================================
280
281
  // EXTENSION RESULT
281
282
  // ============================================================
282
- const result = {
283
- get: {
284
- params: [
285
- {
286
- name: 'mount',
287
- type: { type: 'string' },
288
- defaultValue: undefined,
289
- annotations: { description: 'Mount name' },
283
+ return {
284
+ value: {
285
+ get: toCallable({
286
+ params: [
287
+ {
288
+ name: 'mount',
289
+ type: { kind: 'string' },
290
+ defaultValue: undefined,
291
+ annotations: { description: 'Mount name' },
292
+ },
293
+ {
294
+ name: 'key',
295
+ type: { kind: 'string' },
296
+ defaultValue: undefined,
297
+ annotations: { description: 'Key to retrieve' },
298
+ },
299
+ ],
300
+ fn: get,
301
+ annotations: { description: 'Get value or schema default' },
302
+ returnType: structureToTypeValue({ kind: 'any' }),
303
+ }),
304
+ get_or: toCallable({
305
+ params: [
306
+ {
307
+ name: 'mount',
308
+ type: { kind: 'string' },
309
+ defaultValue: undefined,
310
+ annotations: { description: 'Mount name' },
311
+ },
312
+ {
313
+ name: 'key',
314
+ type: { kind: 'string' },
315
+ defaultValue: undefined,
316
+ annotations: { description: 'Key to retrieve' },
317
+ },
318
+ {
319
+ name: 'fallback',
320
+ type: { kind: 'any' },
321
+ defaultValue: undefined,
322
+ annotations: { description: 'Fallback value if key missing' },
323
+ },
324
+ ],
325
+ fn: get_or,
326
+ annotations: {
327
+ description: 'Get value or return fallback if key missing',
290
328
  },
291
- {
292
- name: 'key',
293
- type: { type: 'string' },
294
- defaultValue: undefined,
295
- annotations: { description: 'Key to retrieve' },
329
+ returnType: structureToTypeValue({ kind: 'any' }),
330
+ }),
331
+ set: toCallable({
332
+ params: [
333
+ {
334
+ name: 'mount',
335
+ type: { kind: 'string' },
336
+ defaultValue: undefined,
337
+ annotations: { description: 'Mount name' },
338
+ },
339
+ {
340
+ name: 'key',
341
+ type: { kind: 'string' },
342
+ defaultValue: undefined,
343
+ annotations: { description: 'Key to set' },
344
+ },
345
+ {
346
+ name: 'value',
347
+ type: { kind: 'any' },
348
+ defaultValue: undefined,
349
+ annotations: { description: 'Value to store' },
350
+ },
351
+ ],
352
+ fn: set,
353
+ annotations: { description: 'Set value with validation' },
354
+ returnType: structureToTypeValue({ kind: 'bool' }),
355
+ }),
356
+ merge: toCallable({
357
+ params: [
358
+ {
359
+ name: 'mount',
360
+ type: { kind: 'string' },
361
+ defaultValue: undefined,
362
+ annotations: { description: 'Mount name' },
363
+ },
364
+ {
365
+ name: 'key',
366
+ type: { kind: 'string' },
367
+ defaultValue: undefined,
368
+ annotations: { description: 'Key to merge into' },
369
+ },
370
+ {
371
+ name: 'partial',
372
+ type: { kind: 'dict' },
373
+ defaultValue: undefined,
374
+ annotations: { description: 'Partial dict to merge' },
375
+ },
376
+ ],
377
+ fn: merge,
378
+ annotations: {
379
+ description: 'Merge partial dict into existing dict value',
296
380
  },
297
- ],
298
- fn: get,
299
- annotations: { description: 'Get value or schema default' },
300
- returnType: rillTypeToTypeValue({ type: 'any' }),
301
- },
302
- get_or: {
303
- params: [
304
- {
305
- name: 'mount',
306
- type: { type: 'string' },
307
- defaultValue: undefined,
308
- annotations: { description: 'Mount name' },
309
- },
310
- {
311
- name: 'key',
312
- type: { type: 'string' },
313
- defaultValue: undefined,
314
- annotations: { description: 'Key to retrieve' },
315
- },
316
- {
317
- name: 'fallback',
318
- type: { type: 'any' },
319
- defaultValue: undefined,
320
- annotations: { description: 'Fallback value if key missing' },
321
- },
322
- ],
323
- fn: get_or,
324
- annotations: {
325
- description: 'Get value or return fallback if key missing',
326
- },
327
- returnType: rillTypeToTypeValue({ type: 'any' }),
328
- },
329
- set: {
330
- params: [
331
- {
332
- name: 'mount',
333
- type: { type: 'string' },
334
- defaultValue: undefined,
335
- annotations: { description: 'Mount name' },
336
- },
337
- {
338
- name: 'key',
339
- type: { type: 'string' },
340
- defaultValue: undefined,
341
- annotations: { description: 'Key to set' },
342
- },
343
- {
344
- name: 'value',
345
- type: { type: 'any' },
346
- defaultValue: undefined,
347
- annotations: { description: 'Value to store' },
348
- },
349
- ],
350
- fn: set,
351
- annotations: { description: 'Set value with validation' },
352
- returnType: rillTypeToTypeValue({ type: 'bool' }),
353
- },
354
- merge: {
355
- params: [
356
- {
357
- name: 'mount',
358
- type: { type: 'string' },
359
- defaultValue: undefined,
360
- annotations: { description: 'Mount name' },
361
- },
362
- {
363
- name: 'key',
364
- type: { type: 'string' },
365
- defaultValue: undefined,
366
- annotations: { description: 'Key to merge into' },
367
- },
368
- {
369
- name: 'partial',
370
- type: { type: 'dict' },
371
- defaultValue: undefined,
372
- annotations: { description: 'Partial dict to merge' },
373
- },
374
- ],
375
- fn: merge,
376
- annotations: {
377
- description: 'Merge partial dict into existing dict value',
378
- },
379
- returnType: rillTypeToTypeValue({ type: 'bool' }),
380
- },
381
- delete: {
382
- params: [
383
- {
384
- name: 'mount',
385
- type: { type: 'string' },
386
- defaultValue: undefined,
387
- annotations: { description: 'Mount name' },
388
- },
389
- {
390
- name: 'key',
391
- type: { type: 'string' },
392
- defaultValue: undefined,
393
- annotations: { description: 'Key to delete' },
394
- },
395
- ],
396
- fn: deleteKey,
397
- annotations: { description: 'Delete key' },
398
- returnType: rillTypeToTypeValue({ type: 'bool' }),
399
- },
400
- keys: {
401
- params: [
402
- {
403
- name: 'mount',
404
- type: { type: 'string' },
405
- defaultValue: undefined,
406
- annotations: { description: 'Mount name' },
407
- },
408
- ],
409
- fn: keys,
410
- annotations: { description: 'Get all keys in mount' },
411
- returnType: rillTypeToTypeValue({ type: 'list' }),
412
- },
413
- has: {
414
- params: [
415
- {
416
- name: 'mount',
417
- type: { type: 'string' },
418
- defaultValue: undefined,
419
- annotations: { description: 'Mount name' },
420
- },
421
- {
422
- name: 'key',
423
- type: { type: 'string' },
424
- defaultValue: undefined,
425
- annotations: { description: 'Key to check' },
426
- },
427
- ],
428
- fn: has,
429
- annotations: { description: 'Check key existence' },
430
- returnType: rillTypeToTypeValue({ type: 'bool' }),
431
- },
432
- clear: {
433
- params: [
434
- {
435
- name: 'mount',
436
- type: { type: 'string' },
437
- defaultValue: undefined,
438
- annotations: { description: 'Mount name' },
439
- },
440
- ],
441
- fn: clear,
442
- annotations: { description: 'Clear all keys in mount' },
443
- returnType: rillTypeToTypeValue({ type: 'bool' }),
444
- },
445
- getAll: {
446
- params: [
447
- {
448
- name: 'mount',
449
- type: { type: 'string' },
450
- defaultValue: undefined,
451
- annotations: { description: 'Mount name' },
452
- },
453
- ],
454
- fn: getAll,
455
- annotations: { description: 'Get all entries as dict' },
456
- returnType: rillTypeToTypeValue({ type: 'dict' }),
457
- },
458
- schema: {
459
- params: [
460
- {
461
- name: 'mount',
462
- type: { type: 'string' },
463
- defaultValue: undefined,
464
- annotations: { description: 'Mount name' },
465
- },
466
- ],
467
- fn: schema,
468
- annotations: { description: 'Get schema information' },
469
- returnType: rillTypeToTypeValue({ type: 'list' }),
470
- },
471
- mounts: {
472
- params: [],
473
- fn: mountsList,
474
- annotations: { description: 'Get list of mount metadata' },
475
- returnType: rillTypeToTypeValue({ type: 'list' }),
381
+ returnType: structureToTypeValue({ kind: 'bool' }),
382
+ }),
383
+ delete: toCallable({
384
+ params: [
385
+ {
386
+ name: 'mount',
387
+ type: { kind: 'string' },
388
+ defaultValue: undefined,
389
+ annotations: { description: 'Mount name' },
390
+ },
391
+ {
392
+ name: 'key',
393
+ type: { kind: 'string' },
394
+ defaultValue: undefined,
395
+ annotations: { description: 'Key to delete' },
396
+ },
397
+ ],
398
+ fn: deleteKey,
399
+ annotations: { description: 'Delete key' },
400
+ returnType: structureToTypeValue({ kind: 'bool' }),
401
+ }),
402
+ keys: toCallable({
403
+ params: [
404
+ {
405
+ name: 'mount',
406
+ type: { kind: 'string' },
407
+ defaultValue: undefined,
408
+ annotations: { description: 'Mount name' },
409
+ },
410
+ ],
411
+ fn: keys,
412
+ annotations: { description: 'Get all keys in mount' },
413
+ returnType: structureToTypeValue({ kind: 'list' }),
414
+ }),
415
+ has: toCallable({
416
+ params: [
417
+ {
418
+ name: 'mount',
419
+ type: { kind: 'string' },
420
+ defaultValue: undefined,
421
+ annotations: { description: 'Mount name' },
422
+ },
423
+ {
424
+ name: 'key',
425
+ type: { kind: 'string' },
426
+ defaultValue: undefined,
427
+ annotations: { description: 'Key to check' },
428
+ },
429
+ ],
430
+ fn: has,
431
+ annotations: { description: 'Check key existence' },
432
+ returnType: structureToTypeValue({ kind: 'bool' }),
433
+ }),
434
+ clear: toCallable({
435
+ params: [
436
+ {
437
+ name: 'mount',
438
+ type: { kind: 'string' },
439
+ defaultValue: undefined,
440
+ annotations: { description: 'Mount name' },
441
+ },
442
+ ],
443
+ fn: clear,
444
+ annotations: { description: 'Clear all keys in mount' },
445
+ returnType: structureToTypeValue({ kind: 'bool' }),
446
+ }),
447
+ getAll: toCallable({
448
+ params: [
449
+ {
450
+ name: 'mount',
451
+ type: { kind: 'string' },
452
+ defaultValue: undefined,
453
+ annotations: { description: 'Mount name' },
454
+ },
455
+ ],
456
+ fn: getAll,
457
+ annotations: { description: 'Get all entries as dict' },
458
+ returnType: structureToTypeValue({ kind: 'dict' }),
459
+ }),
460
+ schema: toCallable({
461
+ params: [
462
+ {
463
+ name: 'mount',
464
+ type: { kind: 'string' },
465
+ defaultValue: undefined,
466
+ annotations: { description: 'Mount name' },
467
+ },
468
+ ],
469
+ fn: schema,
470
+ annotations: { description: 'Get schema information' },
471
+ returnType: structureToTypeValue({ kind: 'list' }),
472
+ }),
473
+ mounts: toCallable({
474
+ params: [],
475
+ fn: mountsList,
476
+ annotations: { description: 'Get list of mount metadata' },
477
+ returnType: structureToTypeValue({ kind: 'list' }),
478
+ }),
476
479
  },
480
+ dispose,
477
481
  };
478
- result.dispose = dispose;
479
- return result;
480
482
  }
481
483
  // ============================================================
482
484
  // MANIFEST
@@ -4,7 +4,7 @@
4
4
  * Provides JSON-based key-value persistence with schema validation.
5
5
  * Lifecycle: Load (read store file) -> Execute (in-memory operations) -> Flush (atomic write on dispose)
6
6
  */
7
- import type { RillValue } from '../../runtime/core/values.js';
7
+ import type { RillValue } from '../../runtime/core/types/structures.js';
8
8
  /** Schema entry defining type and default for a key */
9
9
  export interface SchemaEntry {
10
10
  type: 'string' | 'number' | 'bool' | 'list' | 'dict';
@@ -7,6 +7,7 @@
7
7
  import fs from 'node:fs/promises';
8
8
  import path from 'node:path';
9
9
  import { RuntimeError } from '../../error-classes.js';
10
+ import { deserializeValue } from '../../runtime/core/types/registrations.js';
10
11
  // ============================================================
11
12
  // STORE IMPLEMENTATION
12
13
  // ============================================================
@@ -52,7 +53,7 @@ export async function createStore(config) {
52
53
  // Load declared keys with defaults, validate existing values
53
54
  for (const [key, schemaEntry] of Object.entries(schema)) {
54
55
  if (key in parsed) {
55
- const value = parsed[key];
56
+ const value = deserializeValue(parsed[key], schemaEntry.type);
56
57
  validateType(key, value, schemaEntry.type, storePath);
57
58
  data.set(key, value);
58
59
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Bridge for runtime/ext modules that need parse().
3
+ *
4
+ * Import boundary note (§NOD.2.1):
5
+ * - This file lives at src/ level (not in runtime/), so it may import
6
+ * from the parser barrel.
7
+ * - runtime/ext/test-context.ts imports from this file
8
+ * (../../ext-parse-bridge.js), which is NOT in parser/* — boundary preserved.
9
+ */
10
+ export { parse as parseSource } from './parser/index.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Bridge for runtime/ext modules that need parse().
3
+ *
4
+ * Import boundary note (§NOD.2.1):
5
+ * - This file lives at src/ level (not in runtime/), so it may import
6
+ * from the parser barrel.
7
+ * - runtime/ext/test-context.ts imports from this file
8
+ * (../../ext-parse-bridge.js), which is NOT in parser/* — boundary preserved.
9
+ */
10
+ export { parse as parseSource } from './parser/index.js';