@rcrsr/rill 0.16.0 → 0.17.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.
- package/README.md +37 -21
- package/dist/ext/crypto/index.d.ts +3 -3
- package/dist/ext/crypto/index.js +61 -58
- package/dist/ext/exec/index.d.ts +3 -3
- package/dist/ext/exec/index.js +14 -8
- package/dist/ext/fetch/index.d.ts +3 -3
- package/dist/ext/fetch/index.js +16 -11
- package/dist/ext/fs/index.d.ts +3 -3
- package/dist/ext/fs/index.js +242 -239
- package/dist/ext/kv/index.d.ts +3 -3
- package/dist/ext/kv/index.js +197 -195
- package/dist/ext/kv/store.js +2 -1
- package/dist/ext-parse-bridge.d.ts +10 -0
- package/dist/ext-parse-bridge.js +10 -0
- package/dist/generated/introspection-data.d.ts +1 -1
- package/dist/generated/introspection-data.js +385 -296
- package/dist/generated/version-data.d.ts +1 -1
- package/dist/generated/version-data.js +2 -2
- package/dist/index.d.ts +15 -4
- package/dist/index.js +14 -5
- package/dist/parser/parser-types.js +12 -0
- package/dist/parser/parser-use.js +7 -1
- package/dist/runtime/core/callable.d.ts +20 -8
- package/dist/runtime/core/callable.js +63 -23
- package/dist/runtime/core/context.d.ts +0 -11
- package/dist/runtime/core/context.js +76 -75
- package/dist/runtime/core/eval/index.d.ts +2 -2
- package/dist/runtime/core/eval/index.js +11 -0
- package/dist/runtime/core/eval/mixins/closures.js +15 -15
- package/dist/runtime/core/eval/mixins/conversion.js +51 -110
- package/dist/runtime/core/eval/mixins/core.js +2 -2
- package/dist/runtime/core/eval/mixins/expressions.js +35 -27
- package/dist/runtime/core/eval/mixins/literals.js +3 -3
- package/dist/runtime/core/eval/mixins/types.js +44 -54
- package/dist/runtime/core/eval/mixins/variables.js +10 -8
- package/dist/runtime/core/field-descriptor.d.ts +3 -3
- package/dist/runtime/core/field-descriptor.js +2 -1
- package/dist/runtime/core/introspection.js +6 -6
- package/dist/runtime/core/markers.d.ts +12 -0
- package/dist/runtime/core/markers.js +7 -0
- package/dist/runtime/core/type-registrations.d.ts +136 -0
- package/dist/runtime/core/type-registrations.js +749 -0
- package/dist/runtime/core/type-structures.d.ts +128 -0
- package/dist/runtime/core/type-structures.js +12 -0
- package/dist/runtime/core/types.d.ts +15 -3
- package/dist/runtime/core/values.d.ts +62 -153
- package/dist/runtime/core/values.js +308 -524
- package/dist/runtime/ext/builtins.js +83 -64
- package/dist/runtime/ext/extensions.d.ts +30 -124
- package/dist/runtime/ext/extensions.js +0 -93
- package/dist/runtime/ext/test-context.d.ts +28 -0
- package/dist/runtime/ext/test-context.js +154 -0
- package/dist/runtime/index.d.ts +22 -8
- package/dist/runtime/index.js +18 -4
- package/dist/signature-parser.d.ts +2 -2
- package/dist/signature-parser.js +14 -14
- package/package.json +1 -1
package/dist/ext/fs/index.js
CHANGED
|
@@ -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 { toCallable } from '../../runtime/core/callable.js';
|
|
10
11
|
import { rillTypeToTypeValue, } from '../../runtime/core/values.js';
|
|
11
12
|
import { resolvePath, matchesGlob, initializeMount, } from './sandbox.js';
|
|
12
13
|
export const configSchema = {
|
|
@@ -22,7 +23,7 @@ export const configSchema = {
|
|
|
22
23
|
* Returns 12 functions: read, write, append, list, find, exists, remove, stat, mkdir, copy, move, mounts.
|
|
23
24
|
*
|
|
24
25
|
* @param config - Mount configuration and defaults
|
|
25
|
-
* @returns
|
|
26
|
+
* @returns ExtensionFactoryResult with 12 filesystem functions
|
|
26
27
|
* @throws RuntimeError if mount initialization fails
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
@@ -412,244 +413,246 @@ export function createFsExtension(config) {
|
|
|
412
413
|
// EXTENSION RESULT
|
|
413
414
|
// ============================================================
|
|
414
415
|
return {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
416
|
+
value: {
|
|
417
|
+
read: toCallable({
|
|
418
|
+
params: [
|
|
419
|
+
{
|
|
420
|
+
name: 'mount',
|
|
421
|
+
type: { kind: 'string' },
|
|
422
|
+
defaultValue: undefined,
|
|
423
|
+
annotations: { description: 'Mount name' },
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: 'path',
|
|
427
|
+
type: { kind: 'string' },
|
|
428
|
+
defaultValue: undefined,
|
|
429
|
+
annotations: { description: 'File path relative to mount' },
|
|
430
|
+
},
|
|
431
|
+
],
|
|
432
|
+
fn: read,
|
|
433
|
+
annotations: { description: 'Read file contents' },
|
|
434
|
+
returnType: rillTypeToTypeValue({ kind: 'string' }),
|
|
435
|
+
}),
|
|
436
|
+
write: toCallable({
|
|
437
|
+
params: [
|
|
438
|
+
{
|
|
439
|
+
name: 'mount',
|
|
440
|
+
type: { kind: 'string' },
|
|
441
|
+
defaultValue: undefined,
|
|
442
|
+
annotations: { description: 'Mount name' },
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: 'path',
|
|
446
|
+
type: { kind: 'string' },
|
|
447
|
+
defaultValue: undefined,
|
|
448
|
+
annotations: { description: 'File path relative to mount' },
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: 'content',
|
|
452
|
+
type: { kind: 'string' },
|
|
453
|
+
defaultValue: undefined,
|
|
454
|
+
annotations: { description: 'Content to write' },
|
|
455
|
+
},
|
|
456
|
+
],
|
|
457
|
+
fn: write,
|
|
458
|
+
annotations: { description: 'Write file, replacing if exists' },
|
|
459
|
+
returnType: rillTypeToTypeValue({ kind: 'string' }),
|
|
460
|
+
}),
|
|
461
|
+
append: toCallable({
|
|
462
|
+
params: [
|
|
463
|
+
{
|
|
464
|
+
name: 'mount',
|
|
465
|
+
type: { kind: 'string' },
|
|
466
|
+
defaultValue: undefined,
|
|
467
|
+
annotations: { description: 'Mount name' },
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: 'path',
|
|
471
|
+
type: { kind: 'string' },
|
|
472
|
+
defaultValue: undefined,
|
|
473
|
+
annotations: { description: 'File path relative to mount' },
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
name: 'content',
|
|
477
|
+
type: { kind: 'string' },
|
|
478
|
+
defaultValue: undefined,
|
|
479
|
+
annotations: { description: 'Content to append' },
|
|
480
|
+
},
|
|
481
|
+
],
|
|
482
|
+
fn: append,
|
|
483
|
+
annotations: { description: 'Append content to file' },
|
|
484
|
+
returnType: rillTypeToTypeValue({ kind: 'string' }),
|
|
485
|
+
}),
|
|
486
|
+
list: toCallable({
|
|
487
|
+
params: [
|
|
488
|
+
{
|
|
489
|
+
name: 'mount',
|
|
490
|
+
type: { kind: 'string' },
|
|
491
|
+
defaultValue: undefined,
|
|
492
|
+
annotations: { description: 'Mount name' },
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
name: 'path',
|
|
496
|
+
type: { kind: 'string' },
|
|
497
|
+
defaultValue: '',
|
|
498
|
+
annotations: { description: 'Directory path relative to mount' },
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
fn: list,
|
|
502
|
+
annotations: { description: 'List directory contents' },
|
|
503
|
+
returnType: rillTypeToTypeValue({ kind: 'list' }),
|
|
504
|
+
}),
|
|
505
|
+
find: toCallable({
|
|
506
|
+
params: [
|
|
507
|
+
{
|
|
508
|
+
name: 'mount',
|
|
509
|
+
type: { kind: 'string' },
|
|
510
|
+
defaultValue: undefined,
|
|
511
|
+
annotations: { description: 'Mount name' },
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
name: 'pattern',
|
|
515
|
+
type: { kind: 'string' },
|
|
516
|
+
defaultValue: '*',
|
|
517
|
+
annotations: { description: 'Glob pattern for filtering' },
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
fn: find,
|
|
521
|
+
annotations: { description: 'Recursive file search' },
|
|
522
|
+
returnType: rillTypeToTypeValue({ kind: 'list' }),
|
|
523
|
+
}),
|
|
524
|
+
exists: toCallable({
|
|
525
|
+
params: [
|
|
526
|
+
{
|
|
527
|
+
name: 'mount',
|
|
528
|
+
type: { kind: 'string' },
|
|
529
|
+
defaultValue: undefined,
|
|
530
|
+
annotations: { description: 'Mount name' },
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'path',
|
|
534
|
+
type: { kind: 'string' },
|
|
535
|
+
defaultValue: undefined,
|
|
536
|
+
annotations: { description: 'File path relative to mount' },
|
|
537
|
+
},
|
|
538
|
+
],
|
|
539
|
+
fn: exists,
|
|
540
|
+
annotations: { description: 'Check file existence' },
|
|
541
|
+
returnType: rillTypeToTypeValue({ kind: 'bool' }),
|
|
542
|
+
}),
|
|
543
|
+
remove: toCallable({
|
|
544
|
+
params: [
|
|
545
|
+
{
|
|
546
|
+
name: 'mount',
|
|
547
|
+
type: { kind: 'string' },
|
|
548
|
+
defaultValue: undefined,
|
|
549
|
+
annotations: { description: 'Mount name' },
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
name: 'path',
|
|
553
|
+
type: { kind: 'string' },
|
|
554
|
+
defaultValue: undefined,
|
|
555
|
+
annotations: { description: 'File path relative to mount' },
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
fn: remove,
|
|
559
|
+
annotations: { description: 'Delete file' },
|
|
560
|
+
returnType: rillTypeToTypeValue({ kind: 'bool' }),
|
|
561
|
+
}),
|
|
562
|
+
stat: toCallable({
|
|
563
|
+
params: [
|
|
564
|
+
{
|
|
565
|
+
name: 'mount',
|
|
566
|
+
type: { kind: 'string' },
|
|
567
|
+
defaultValue: undefined,
|
|
568
|
+
annotations: { description: 'Mount name' },
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
name: 'path',
|
|
572
|
+
type: { kind: 'string' },
|
|
573
|
+
defaultValue: undefined,
|
|
574
|
+
annotations: { description: 'File path relative to mount' },
|
|
575
|
+
},
|
|
576
|
+
],
|
|
577
|
+
fn: stat,
|
|
578
|
+
annotations: { description: 'Get file metadata' },
|
|
579
|
+
returnType: rillTypeToTypeValue({ kind: 'dict' }),
|
|
580
|
+
}),
|
|
581
|
+
mkdir: toCallable({
|
|
582
|
+
params: [
|
|
583
|
+
{
|
|
584
|
+
name: 'mount',
|
|
585
|
+
type: { kind: 'string' },
|
|
586
|
+
defaultValue: undefined,
|
|
587
|
+
annotations: { description: 'Mount name' },
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
name: 'path',
|
|
591
|
+
type: { kind: 'string' },
|
|
592
|
+
defaultValue: undefined,
|
|
593
|
+
annotations: { description: 'Directory path relative to mount' },
|
|
594
|
+
},
|
|
595
|
+
],
|
|
596
|
+
fn: mkdir,
|
|
597
|
+
annotations: { description: 'Create directory' },
|
|
598
|
+
returnType: rillTypeToTypeValue({ kind: 'bool' }),
|
|
599
|
+
}),
|
|
600
|
+
copy: toCallable({
|
|
601
|
+
params: [
|
|
602
|
+
{
|
|
603
|
+
name: 'mount',
|
|
604
|
+
type: { kind: 'string' },
|
|
605
|
+
defaultValue: undefined,
|
|
606
|
+
annotations: { description: 'Mount name' },
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: 'src',
|
|
610
|
+
type: { kind: 'string' },
|
|
611
|
+
defaultValue: undefined,
|
|
612
|
+
annotations: { description: 'Source file path' },
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: 'dest',
|
|
616
|
+
type: { kind: 'string' },
|
|
617
|
+
defaultValue: undefined,
|
|
618
|
+
annotations: { description: 'Destination file path' },
|
|
619
|
+
},
|
|
620
|
+
],
|
|
621
|
+
fn: copy,
|
|
622
|
+
annotations: { description: 'Copy file within mount' },
|
|
623
|
+
returnType: rillTypeToTypeValue({ kind: 'bool' }),
|
|
624
|
+
}),
|
|
625
|
+
move: toCallable({
|
|
626
|
+
params: [
|
|
627
|
+
{
|
|
628
|
+
name: 'mount',
|
|
629
|
+
type: { kind: 'string' },
|
|
630
|
+
defaultValue: undefined,
|
|
631
|
+
annotations: { description: 'Mount name' },
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: 'src',
|
|
635
|
+
type: { kind: 'string' },
|
|
636
|
+
defaultValue: undefined,
|
|
637
|
+
annotations: { description: 'Source file path' },
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: 'dest',
|
|
641
|
+
type: { kind: 'string' },
|
|
642
|
+
defaultValue: undefined,
|
|
643
|
+
annotations: { description: 'Destination file path' },
|
|
644
|
+
},
|
|
645
|
+
],
|
|
646
|
+
fn: move,
|
|
647
|
+
annotations: { description: 'Move file within mount' },
|
|
648
|
+
returnType: rillTypeToTypeValue({ kind: 'bool' }),
|
|
649
|
+
}),
|
|
650
|
+
mounts: toCallable({
|
|
651
|
+
params: [],
|
|
652
|
+
fn: mountsList,
|
|
653
|
+
annotations: { description: 'List configured mounts' },
|
|
654
|
+
returnType: rillTypeToTypeValue({ kind: 'list' }),
|
|
655
|
+
}),
|
|
653
656
|
},
|
|
654
657
|
};
|
|
655
658
|
}
|
package/dist/ext/kv/index.d.ts
CHANGED
|
@@ -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 {
|
|
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
|
|
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):
|
|
81
|
+
export declare function createKvExtension(config: KvConfig): ExtensionFactoryResult;
|
|
82
82
|
export declare const extensionManifest: ExtensionManifest;
|