@texuli/spec 0.3.0 → 0.5.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 (48) hide show
  1. package/README.md +82 -14
  2. package/dist/build.d.ts +5 -0
  3. package/dist/build.js +1 -0
  4. package/dist/canonical.js +20 -13
  5. package/dist/catalog.d.ts +9 -3
  6. package/dist/catalog.js +7 -1
  7. package/dist/codegen/index.d.ts +2 -2
  8. package/dist/codegen/index.js +2 -2
  9. package/dist/codegen/kotlin.d.ts +6 -0
  10. package/dist/codegen/kotlin.js +80 -8
  11. package/dist/conformance.d.ts +11 -2
  12. package/dist/conformance.js +93 -2
  13. package/dist/contract.d.ts +112 -0
  14. package/dist/contract.js +196 -0
  15. package/dist/dialect.d.ts +10 -1
  16. package/dist/dialect.js +6 -1
  17. package/dist/generated/typescript/blueprint.d.ts +103 -5
  18. package/dist/generated/typescript/blueprint.js +1 -1
  19. package/dist/generated/typescript/catalog-schema.d.ts +35 -0
  20. package/dist/generated/typescript/catalog-schema.js +1 -1
  21. package/dist/generated/typescript/diagnostics.d.ts +10 -1
  22. package/dist/generated/typescript/diagnostics.js +1 -1
  23. package/dist/generated/typescript/manifest.js +1 -1
  24. package/dist/generated/typescript/vocabulary.d.ts +194 -4
  25. package/dist/generated/typescript/vocabulary.js +31 -2
  26. package/dist/generated/typescript/workflow.d.ts +84 -0
  27. package/dist/generated/typescript/workflow.js +3 -0
  28. package/dist/index.d.ts +13 -5
  29. package/dist/index.js +9 -3
  30. package/dist/migrations/0.2.0-0.3.0.d.ts +7 -0
  31. package/dist/migrations/0.2.0-0.3.0.js +10 -0
  32. package/dist/migrations/0.3.0-0.4.0.d.ts +9 -0
  33. package/dist/migrations/0.3.0-0.4.0.js +12 -0
  34. package/dist/migrations/0.4.0-0.5.0.d.ts +8 -0
  35. package/dist/migrations/0.4.0-0.5.0.js +11 -0
  36. package/dist/migrations/index.d.ts +15 -0
  37. package/dist/migrations/index.js +55 -0
  38. package/dist/migrations/types.d.ts +14 -0
  39. package/dist/migrations/types.js +1 -0
  40. package/dist/surface.d.ts +60 -0
  41. package/dist/surface.js +162 -0
  42. package/dist/validate.d.ts +89 -14
  43. package/dist/validate.js +725 -64
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/dist/workflow.d.ts +15 -0
  47. package/dist/workflow.js +256 -0
  48. package/package.json +13 -1
@@ -1,10 +1,14 @@
1
1
  /** The built catalog this vocabulary was projected from. */
2
- export declare const SPEC_CATALOG_HASH = "b073e30b4c8b1a30b3ef3ccb372e552d2d88e584616b74591c6c32923b471376";
2
+ export declare const SPEC_CATALOG_HASH = "4ac7ecedd1c59d1999a9f7eea2f523c7653fececb97258a478f09253f6b6057f";
3
3
  /** Every closed component id, sorted. */
4
- export declare const SPEC_COMPONENT_IDS: readonly ["alert", "alert-dialog", "analytics-grid", "app-nav", "badge", "banner", "blocks-code", "blocks-data", "blocks-diagram", "blocks-embed", "blocks-interactive", "blocks-map", "blocks-media", "blocks-structure", "blocks-text", "breadcrumb", "button", "button-group", "callout", "card", "charts-area", "charts-bar", "charts-bubble", "charts-bullet", "charts-canvas-renderer", "charts-cartesian", "charts-combo", "charts-donut", "charts-funnel", "charts-gauge", "charts-geo-map", "charts-geo-point-map", "charts-heatmap", "charts-line", "charts-network", "charts-pie", "charts-progress-ring", "charts-sankey", "charts-scatter", "charts-sparkline", "charts-stacked-bar", "charts-sunburst", "charts-treemap", "checkbox", "chip", "code", "combobox", "command-palette", "content-layout", "context-menu", "context-menu-trigger", "deck-slide", "description", "detail-panel", "dialog", "drawer", "dropdown-menu", "dropdown-menu-content", "dropdown-menu-item", "dropdown-menu-trigger", "empty-state", "error-state", "field", "field-error", "form", "hover-card", "hover-card-content", "icon-button", "inline-text", "input", "input-group", "kbd", "kpi", "label", "layout-auth-split", "layout-blog", "layout-card", "layout-chrome", "layout-dashboard-grid", "layout-deck", "layout-doc", "layout-docs", "layout-drawer", "layout-dual-sidebar", "layout-editorial", "layout-grid", "layout-host", "layout-landing", "layout-marketing", "layout-page", "layout-pricing", "layout-settings", "layout-sidebar", "layout-top-nav", "layout-wizard", "media-composition-canvas", "media-composition-svg", "media-image", "menubar", "menubar-trigger", "multi-select", "nav-icon", "navigation-menu", "pagination", "popover", "popover-content", "radio", "radio-group", "responsive-modal", "screen-outlet", "select", "select-content", "select-group", "select-item", "select-label", "select-portal", "select-separator", "select-trigger", "select-value", "select-viewport", "sheet", "sidebar", "split-view", "stat", "stepper", "switch", "table", "tag", "text-counter", "textarea", "timeline", "toaster", "tooltip"];
4
+ export declare const SPEC_COMPONENT_IDS: readonly ["action-form", "alert", "alert-dialog", "analytics-grid", "app-nav", "badge", "banner", "blocks-code", "blocks-data", "blocks-diagram", "blocks-embed", "blocks-interactive", "blocks-map", "blocks-media", "blocks-structure", "blocks-text", "breadcrumb", "button", "button-group", "callout", "card", "charts-area", "charts-bar", "charts-bubble", "charts-bullet", "charts-canvas-renderer", "charts-cartesian", "charts-combo", "charts-donut", "charts-funnel", "charts-gauge", "charts-geo-map", "charts-geo-point-map", "charts-heatmap", "charts-line", "charts-network", "charts-pie", "charts-progress-ring", "charts-sankey", "charts-scatter", "charts-sparkline", "charts-stacked-bar", "charts-sunburst", "charts-treemap", "chat-message", "chat-thread", "checkbox", "chip", "code", "combobox", "command-palette", "content-layout", "context-menu", "context-menu-trigger", "control-choice", "control-filter", "control-slider", "control-toggle", "data-board", "data-calendar", "data-cohort-table", "data-files", "data-filter-builder", "data-grid", "data-map", "data-notification-inbox", "data-timeline", "data-tree-view", "deck-slide", "description", "detail-panel", "dialog", "drawer", "dropdown-menu", "dropdown-menu-content", "dropdown-menu-item", "dropdown-menu-trigger", "empty-state", "error-state", "field", "field-error", "flow-action", "flow-view", "form", "form-field", "form-submit", "host-region", "hover-card", "hover-card-content", "icon-button", "inline-text", "input", "input-group", "kbd", "kpi", "label", "layout-auth-split", "layout-blog", "layout-card", "layout-chrome", "layout-dashboard-grid", "layout-deck", "layout-doc", "layout-docs", "layout-drawer", "layout-dual-sidebar", "layout-editorial", "layout-grid", "layout-host", "layout-landing", "layout-marketing", "layout-page", "layout-pricing", "layout-row", "layout-settings", "layout-sidebar", "layout-split", "layout-stack", "layout-tile", "layout-top-nav", "layout-wizard", "media-composition-canvas", "media-composition-svg", "media-image", "menubar", "menubar-trigger", "multi-select", "nav-icon", "navigation-menu", "pagination", "popover", "popover-content", "radio", "radio-group", "responsive-modal", "screen-outlet", "select", "select-content", "select-group", "select-item", "select-label", "select-portal", "select-separator", "select-trigger", "select-value", "select-viewport", "sheet", "sidebar", "sortable-list", "split-view", "stat", "stepper", "switch", "table", "tag", "text-counter", "textarea", "time-field", "timeline", "toaster", "tooltip", "workflow-graph"];
5
5
  export type SpecComponentId = (typeof SPEC_COMPONENT_IDS)[number];
6
6
  /** The props a blueprint may set on each component (platform extensions left out). */
7
7
  export interface SpecComponentProps {
8
+ 'action-form': {
9
+ action: string;
10
+ label: string;
11
+ };
8
12
  alert: {
9
13
  actionHref?: string;
10
14
  actionLabel?: string;
@@ -365,6 +369,15 @@ export interface SpecComponentProps {
365
369
  title: string;
366
370
  width?: number;
367
371
  };
372
+ 'chat-message': {
373
+ at?: string;
374
+ author: string;
375
+ role: 'user' | 'agent' | 'system';
376
+ text?: string;
377
+ };
378
+ 'chat-thread': {
379
+ label?: string;
380
+ };
368
381
  checkbox: {
369
382
  checked?: boolean;
370
383
  defaultChecked?: boolean;
@@ -434,12 +447,110 @@ export interface SpecComponentProps {
434
447
  'context-menu-trigger': {
435
448
  disabled?: boolean;
436
449
  };
450
+ 'control-choice': {
451
+ label: string;
452
+ state: string;
453
+ };
454
+ 'control-filter': {
455
+ label: string;
456
+ placeholder?: string;
457
+ state: string;
458
+ };
459
+ 'control-slider': {
460
+ label: string;
461
+ state: string;
462
+ step?: number;
463
+ };
464
+ 'control-toggle': {
465
+ label: string;
466
+ state: string;
467
+ };
468
+ 'data-board': {
469
+ columns: readonly unknown[];
470
+ density?: 'comfortable' | 'compact';
471
+ items: readonly unknown[];
472
+ label: string;
473
+ lanes?: readonly unknown[];
474
+ };
475
+ 'data-calendar': {
476
+ anchor?: string;
477
+ events: readonly unknown[];
478
+ label: string;
479
+ locale?: string;
480
+ readOnly?: boolean;
481
+ timeZone?: string;
482
+ view?: 'month' | 'week' | 'day' | 'agenda';
483
+ };
484
+ 'data-cohort-table': {
485
+ average?: boolean;
486
+ caption: string;
487
+ captionHidden?: boolean;
488
+ density?: 'compact' | 'default' | 'comfortable';
489
+ heat?: boolean;
490
+ locale?: string;
491
+ max?: number;
492
+ periods?: readonly unknown[];
493
+ rows: readonly unknown[];
494
+ valueKind?: 'rate' | 'count';
495
+ };
496
+ 'data-files': {
497
+ density?: 'comfortable' | 'compact';
498
+ entries: readonly unknown[];
499
+ label: string;
500
+ layout?: 'grid' | 'list';
501
+ };
502
+ 'data-filter-builder': {
503
+ disabled?: boolean;
504
+ fields: readonly unknown[];
505
+ label: string;
506
+ maxDepth?: number;
507
+ value?: Readonly<Record<string, unknown>>;
508
+ };
509
+ 'data-grid': {
510
+ caption: string;
511
+ columns: readonly unknown[];
512
+ density?: 'compact' | 'default' | 'comfortable';
513
+ rows: readonly unknown[];
514
+ searchable?: boolean;
515
+ selectable?: boolean;
516
+ };
517
+ 'data-map': {
518
+ label: string;
519
+ listPlacement?: 'side' | 'below';
520
+ markers: readonly unknown[];
521
+ };
522
+ 'data-notification-inbox': {
523
+ filter?: 'all' | 'unread';
524
+ headingLevel?: number;
525
+ items: readonly unknown[];
526
+ locale?: string;
527
+ markReadOnOpen?: boolean;
528
+ now?: string;
529
+ timeZone?: string;
530
+ };
531
+ 'data-timeline': {
532
+ dependencies?: readonly unknown[];
533
+ label: string;
534
+ locale?: string;
535
+ tasks: readonly unknown[];
536
+ zoom?: 'day' | 'week' | 'month' | 'quarter';
537
+ };
538
+ 'data-tree-view': {
539
+ checkboxes?: boolean;
540
+ density?: 'comfortable' | 'compact';
541
+ items: readonly unknown[];
542
+ label: string;
543
+ };
437
544
  'deck-slide': {
545
+ component?: Readonly<Record<string, unknown>>;
546
+ layout?: string;
438
547
  master?: 'title' | 'section' | 'content' | 'two-column' | 'media-left' | 'media-right' | 'quote' | 'closing';
439
548
  notes?: string;
549
+ props?: Readonly<Record<string, unknown>>;
440
550
  slideId: string;
551
+ steps?: readonly unknown[];
441
552
  title?: string;
442
- transition?: 'none' | 'fade' | 'fade-up';
553
+ transition?: 'none' | 'fade' | 'fade-up' | 'slide' | 'zoom' | 'morph';
443
554
  };
444
555
  description: Record<string, never>;
445
556
  'detail-panel': {
@@ -506,11 +617,40 @@ export interface SpecComponentProps {
506
617
  'field-error': {
507
618
  show?: boolean;
508
619
  };
620
+ 'flow-action': {
621
+ event: string;
622
+ label: string;
623
+ };
624
+ 'flow-view': {
625
+ label?: string;
626
+ name: string;
627
+ };
509
628
  form: {
510
629
  errors?: Readonly<Record<string, unknown>>;
511
630
  layout?: 'stack' | 'grid';
512
631
  noValidate?: boolean;
513
632
  };
633
+ 'form-field': {
634
+ autocomplete?: 'off' | 'name' | 'given-name' | 'family-name' | 'nickname' | 'email' | 'tel' | 'organization' | 'organization-title' | 'street-address' | 'address-level1' | 'address-level2' | 'postal-code' | 'country-name' | 'language' | 'url';
635
+ kind?: 'text' | 'email' | 'tel' | 'number' | 'multiline';
636
+ label: string;
637
+ max?: number;
638
+ maxLength?: number;
639
+ min?: number;
640
+ minLength?: number;
641
+ name: string;
642
+ pattern?: 'email' | 'phone' | 'postal-code' | 'digits' | 'slug';
643
+ placeholder?: string;
644
+ required?: boolean;
645
+ state: string;
646
+ };
647
+ 'form-submit': {
648
+ label: string;
649
+ };
650
+ 'host-region': {
651
+ label: string;
652
+ name: string;
653
+ };
514
654
  'hover-card': {
515
655
  open?: boolean;
516
656
  };
@@ -600,13 +740,17 @@ export interface SpecComponentProps {
600
740
  storageKey?: string;
601
741
  };
602
742
  'layout-deck': {
603
- aspect?: '16:9' | '4:3' | '1:1';
743
+ aspect?: '16:9' | '4:3' | '9:16' | '1:1';
604
744
  description?: string;
605
745
  locale?: string;
606
746
  masters?: readonly unknown[];
747
+ motion?: 'full' | 'subtle' | 'none';
748
+ navigation?: Readonly<Record<string, unknown>>;
749
+ outline?: Readonly<Record<string, unknown>>;
607
750
  settings?: Readonly<Record<string, unknown>>;
608
751
  slides?: readonly unknown[];
609
752
  title?: string;
753
+ transition?: 'none' | 'fade' | 'fade-up' | 'slide' | 'zoom' | 'morph';
610
754
  };
611
755
  'layout-doc': {
612
756
  title?: string;
@@ -671,6 +815,11 @@ export interface SpecComponentProps {
671
815
  plans?: readonly unknown[];
672
816
  title?: string;
673
817
  };
818
+ 'layout-row': {
819
+ align?: 'start' | 'center' | 'end' | 'stretch';
820
+ gap?: 'none' | 'small' | 'medium' | 'large';
821
+ wrap?: boolean;
822
+ };
674
823
  'layout-settings': {
675
824
  active?: string;
676
825
  backLabel?: string;
@@ -689,6 +838,18 @@ export interface SpecComponentProps {
689
838
  skipLabel?: string;
690
839
  storageKey?: string;
691
840
  };
841
+ 'layout-split': {
842
+ gap?: 'none' | 'small' | 'medium' | 'large';
843
+ ratio?: '1:1' | '1:2' | '2:1' | '1:3' | '3:1';
844
+ };
845
+ 'layout-stack': {
846
+ gap?: 'none' | 'small' | 'medium' | 'large';
847
+ };
848
+ 'layout-tile': {
849
+ rowSpan?: number;
850
+ span?: number;
851
+ title?: string;
852
+ };
692
853
  'layout-top-nav': {
693
854
  closeLabel?: string;
694
855
  menuLabel?: string;
@@ -767,6 +928,7 @@ export interface SpecComponentProps {
767
928
  variant?: 'outline' | 'soft';
768
929
  };
769
930
  'nav-icon': {
931
+ icon: string;
770
932
  label?: string;
771
933
  };
772
934
  'navigation-menu': {
@@ -874,16 +1036,24 @@ export interface SpecComponentProps {
874
1036
  sections?: readonly unknown[];
875
1037
  variant?: 'default' | 'inset';
876
1038
  };
1039
+ 'sortable-list': {
1040
+ itemDetail?: string;
1041
+ itemLabel?: string;
1042
+ label: string;
1043
+ reorder: Readonly<Record<string, unknown>>;
1044
+ };
877
1045
  'split-view': {
878
1046
  detailActive?: boolean;
879
1047
  detailLabel?: string;
880
1048
  listLabel?: string;
881
1049
  };
882
1050
  stat: {
1051
+ delta?: string;
883
1052
  hint?: string;
884
1053
  label: string;
885
1054
  positive?: 'up' | 'down';
886
1055
  trend?: 'up' | 'down' | 'neutral';
1056
+ value: string;
887
1057
  variant?: 'elevated' | 'flat';
888
1058
  };
889
1059
  stepper: {
@@ -946,6 +1116,20 @@ export interface SpecComponentProps {
946
1116
  rows?: number;
947
1117
  value?: string;
948
1118
  };
1119
+ 'time-field': {
1120
+ description?: string;
1121
+ disabled?: boolean;
1122
+ error?: string;
1123
+ hourCycle?: number;
1124
+ label: string;
1125
+ labels?: Readonly<Record<string, unknown>>;
1126
+ locale?: string;
1127
+ minuteStep?: number;
1128
+ name?: string;
1129
+ required?: boolean;
1130
+ size?: 'sm' | 'md';
1131
+ value?: string;
1132
+ };
949
1133
  timeline: {
950
1134
  hrefTrust?: 'developer' | 'untrusted';
951
1135
  items?: readonly unknown[];
@@ -969,4 +1153,10 @@ export interface SpecComponentProps {
969
1153
  side?: 'top' | 'right' | 'bottom' | 'left';
970
1154
  sideOffset?: number;
971
1155
  };
1156
+ 'workflow-graph': {
1157
+ flow?: 'LR' | 'TB';
1158
+ graph: Readonly<Record<string, unknown>>;
1159
+ label: string;
1160
+ mode?: 'view' | 'edit';
1161
+ };
972
1162
  }
@@ -1,9 +1,10 @@
1
1
  // Generated by @texuli/spec from catalog/components.json. Do not edit: run the spec generator.
2
- // Spec 0.2.0, digest d9eccaba1826e7d87648a4a33787d873245592dda843607a10b2c68a77f1806f
2
+ // Spec 0.5.0, digest 1ba15e8b082f68140c4b2768b8fd69c9f760e655dd117fac756f356a71525b2d
3
3
  /** The built catalog this vocabulary was projected from. */
4
- export const SPEC_CATALOG_HASH = 'b073e30b4c8b1a30b3ef3ccb372e552d2d88e584616b74591c6c32923b471376';
4
+ export const SPEC_CATALOG_HASH = '4ac7ecedd1c59d1999a9f7eea2f523c7653fececb97258a478f09253f6b6057f';
5
5
  /** Every closed component id, sorted. */
6
6
  export const SPEC_COMPONENT_IDS = [
7
+ 'action-form',
7
8
  'alert',
8
9
  'alert-dialog',
9
10
  'analytics-grid',
@@ -47,6 +48,8 @@ export const SPEC_COMPONENT_IDS = [
47
48
  'charts-stacked-bar',
48
49
  'charts-sunburst',
49
50
  'charts-treemap',
51
+ 'chat-message',
52
+ 'chat-thread',
50
53
  'checkbox',
51
54
  'chip',
52
55
  'code',
@@ -55,6 +58,20 @@ export const SPEC_COMPONENT_IDS = [
55
58
  'content-layout',
56
59
  'context-menu',
57
60
  'context-menu-trigger',
61
+ 'control-choice',
62
+ 'control-filter',
63
+ 'control-slider',
64
+ 'control-toggle',
65
+ 'data-board',
66
+ 'data-calendar',
67
+ 'data-cohort-table',
68
+ 'data-files',
69
+ 'data-filter-builder',
70
+ 'data-grid',
71
+ 'data-map',
72
+ 'data-notification-inbox',
73
+ 'data-timeline',
74
+ 'data-tree-view',
58
75
  'deck-slide',
59
76
  'description',
60
77
  'detail-panel',
@@ -68,7 +85,12 @@ export const SPEC_COMPONENT_IDS = [
68
85
  'error-state',
69
86
  'field',
70
87
  'field-error',
88
+ 'flow-action',
89
+ 'flow-view',
71
90
  'form',
91
+ 'form-field',
92
+ 'form-submit',
93
+ 'host-region',
72
94
  'hover-card',
73
95
  'hover-card-content',
74
96
  'icon-button',
@@ -95,8 +117,12 @@ export const SPEC_COMPONENT_IDS = [
95
117
  'layout-marketing',
96
118
  'layout-page',
97
119
  'layout-pricing',
120
+ 'layout-row',
98
121
  'layout-settings',
99
122
  'layout-sidebar',
123
+ 'layout-split',
124
+ 'layout-stack',
125
+ 'layout-tile',
100
126
  'layout-top-nav',
101
127
  'layout-wizard',
102
128
  'media-composition-canvas',
@@ -126,6 +152,7 @@ export const SPEC_COMPONENT_IDS = [
126
152
  'select-viewport',
127
153
  'sheet',
128
154
  'sidebar',
155
+ 'sortable-list',
129
156
  'split-view',
130
157
  'stat',
131
158
  'stepper',
@@ -134,7 +161,9 @@ export const SPEC_COMPONENT_IDS = [
134
161
  'tag',
135
162
  'text-counter',
136
163
  'textarea',
164
+ 'time-field',
137
165
  'timeline',
138
166
  'toaster',
139
167
  'tooltip',
168
+ 'workflow-graph',
140
169
  ];
@@ -0,0 +1,84 @@
1
+ export type WorkflowId = string;
2
+ /** Display text: no control characters and no bidirectional overrides or isolates. */
3
+ export type WorkflowLabel = string;
4
+ export type WorkflowCoordinate = number;
5
+ export interface WorkflowPosition {
6
+ x: WorkflowCoordinate;
7
+ y: WorkflowCoordinate;
8
+ }
9
+ export interface WorkflowSize {
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface WorkflowPort {
14
+ id: WorkflowId;
15
+ direction: 'in' | 'out';
16
+ label?: WorkflowLabel;
17
+ /** Ports with a kind connect only to ports of the same kind. */
18
+ kind?: string;
19
+ /** Whether the port takes more than one edge. */
20
+ multiple?: boolean;
21
+ }
22
+ export interface WorkflowField {
23
+ name: string;
24
+ label?: WorkflowLabel;
25
+ kind: 'string' | 'number' | 'boolean' | 'enum';
26
+ required?: boolean;
27
+ enumValues?: readonly string[];
28
+ /** For string fields; 2000 when omitted. */
29
+ maxLength?: number;
30
+ }
31
+ export interface WorkflowNodeType {
32
+ id: WorkflowId;
33
+ label: WorkflowLabel;
34
+ category?: WorkflowLabel;
35
+ ports: readonly WorkflowPort[];
36
+ fields?: readonly WorkflowField[];
37
+ }
38
+ export interface WorkflowNode {
39
+ id: WorkflowId;
40
+ type: WorkflowId;
41
+ label: WorkflowLabel;
42
+ position: WorkflowPosition;
43
+ size?: WorkflowSize;
44
+ group?: WorkflowId;
45
+ /** Field values by field name: scalars of the field kind. */
46
+ data?: Readonly<Record<string, unknown>>;
47
+ locked?: boolean;
48
+ }
49
+ export interface WorkflowEndpoint {
50
+ node: WorkflowId;
51
+ port: WorkflowId;
52
+ }
53
+ export interface WorkflowEdge {
54
+ id: WorkflowId;
55
+ from: WorkflowEndpoint;
56
+ to: WorkflowEndpoint;
57
+ label?: WorkflowLabel;
58
+ }
59
+ export interface WorkflowGroup {
60
+ id: WorkflowId;
61
+ label: WorkflowLabel;
62
+ position?: WorkflowPosition;
63
+ size?: WorkflowSize;
64
+ }
65
+ export interface WorkflowViewport {
66
+ x: WorkflowCoordinate;
67
+ y: WorkflowCoordinate;
68
+ zoom: number;
69
+ }
70
+ /**
71
+ * A workflow graph as data (ADR-008): closed node types with typed ports and fields, nodes, edges
72
+ * between declared ports, optional groups and a cycle policy. At most 500 nodes and 2,000 edges.
73
+ * Ids, references, field values, port directions and cycles are checked by validateWorkflowGraph.
74
+ */
75
+ export interface WorkflowGraph {
76
+ version: 1;
77
+ nodeTypes: readonly WorkflowNodeType[];
78
+ nodes: readonly WorkflowNode[];
79
+ edges: readonly WorkflowEdge[];
80
+ groups?: readonly WorkflowGroup[];
81
+ /** forbid makes the graph acyclic (a self-loop counts); omitted means allow. */
82
+ cycles?: 'allow' | 'forbid';
83
+ viewport?: WorkflowViewport;
84
+ }
@@ -0,0 +1,3 @@
1
+ // Generated by @texuli/spec from schemas/workflow.schema.json. Do not edit: run the spec generator.
2
+ // Spec 0.5.0, digest 1ba15e8b082f68140c4b2768b8fd69c9f760e655dd117fac756f356a71525b2d
3
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,17 +1,25 @@
1
1
  /**
2
2
  * `@texuli/spec` — the schema-first blueprint contract (spec/Compose design
3
3
  * B1), runtime half: the generated types and vocabulary, the dialect
4
- * validator, the target-neutral blueprint validator and deterministic
5
- * hashing. Build-time generation and the conformance harness live in
6
- * `@texuli/spec/codegen`. Framework-free: no DOM, no Svelte and no Node APIs.
4
+ * validator, the target-neutral blueprint validator, the 0.3.0 interaction
5
+ * contract (bindings, closed actions, events) and deterministic hashing.
6
+ * Opt-in subpaths keep the root small: `@texuli/spec/workflow` (the workflow
7
+ * graph validator, passed in `SpecDocuments.validateWorkflowGraph`) and
8
+ * `@texuli/spec/migrate` (envelope migrations). Build-time generation and the
9
+ * conformance harness live in `@texuli/spec/codegen`. Framework-free: no DOM,
10
+ * no Svelte and no Node APIs.
7
11
  */
8
12
  export type * from './generated/typescript/blueprint.js';
9
13
  export type * from './generated/typescript/catalog-schema.js';
10
14
  export type * from './generated/typescript/diagnostics.js';
11
15
  export type * from './generated/typescript/manifest.js';
12
16
  export { SPEC_CATALOG_HASH, SPEC_COMPONENT_IDS, type SpecComponentId, type SpecComponentProps, } from './generated/typescript/vocabulary.js';
17
+ export type * from './generated/typescript/workflow.js';
13
18
  export { canonicalJson, sha256 } from './canonical.js';
14
19
  export { CAPABILITIES, type Capability, type SpecPropKind, WEB_ONLY_KINDS, WEB_ONLY_PROP_NAMES, } from './catalog.js';
15
- export { checkSchemaDocument, DIALECT_KEYWORDS, DIALECT_TYPES, DIALECT_URI, type DialectType, type Schema, type SchemaIssue, validateInstance, } from './dialect.js';
16
- export { type SpecDocuments, validateBlueprint, validateTree, } from './validate.js';
20
+ export { ACTION_FIELDS, contractRoot, DATA_BINDING_KEY, SPEC_ACTION_OPS, SPEC_EVENT_NAMES, SPEC_LIMITS, SPEC_PATTERNS, SPEC_PROP_REFS, SPEC_STATE_TYPES, type SpecActionOp, type SpecStateType, STATE_BINDING_KEY, STATE_FIELDS, toDialectSchema, } from './contract.js';
21
+ export { checkSchemaDocument, DIALECT_KEYWORDS, DIALECT_TYPES, DIALECT_URI, type DialectHooks, type DialectType, type Schema, type SchemaIssue, validateInstance, } from './dialect.js';
22
+ export type { SpecMigration, SpecMigrationResult } from './migrations/types.js';
23
+ export { checkStateSurface, LIST_TEXT_PATTERN, SPEC_CONTROL_STATE_TYPES, SURFACE_PLAYER_CODES, type SurfaceCode, type SurfaceInputs, type SurfaceIssue, surfaceInputs, } from './surface.js';
24
+ export { type SpecDocuments, type SpecFlowInfo, type SpecStateVariable, type TreeOptions, validateBlueprint, validateTree, type WorkflowGraphValidator, } from './validate.js';
17
25
  export { SPEC_VERSION } from './version.js';
package/dist/index.js CHANGED
@@ -1,13 +1,19 @@
1
1
  /**
2
2
  * `@texuli/spec` — the schema-first blueprint contract (spec/Compose design
3
3
  * B1), runtime half: the generated types and vocabulary, the dialect
4
- * validator, the target-neutral blueprint validator and deterministic
5
- * hashing. Build-time generation and the conformance harness live in
6
- * `@texuli/spec/codegen`. Framework-free: no DOM, no Svelte and no Node APIs.
4
+ * validator, the target-neutral blueprint validator, the 0.3.0 interaction
5
+ * contract (bindings, closed actions, events) and deterministic hashing.
6
+ * Opt-in subpaths keep the root small: `@texuli/spec/workflow` (the workflow
7
+ * graph validator, passed in `SpecDocuments.validateWorkflowGraph`) and
8
+ * `@texuli/spec/migrate` (envelope migrations). Build-time generation and the
9
+ * conformance harness live in `@texuli/spec/codegen`. Framework-free: no DOM,
10
+ * no Svelte and no Node APIs.
7
11
  */
8
12
  export { SPEC_CATALOG_HASH, SPEC_COMPONENT_IDS, } from "./generated/typescript/vocabulary.js";
9
13
  export { canonicalJson, sha256 } from "./canonical.js";
10
14
  export { CAPABILITIES, WEB_ONLY_KINDS, WEB_ONLY_PROP_NAMES, } from "./catalog.js";
15
+ export { ACTION_FIELDS, contractRoot, DATA_BINDING_KEY, SPEC_ACTION_OPS, SPEC_EVENT_NAMES, SPEC_LIMITS, SPEC_PATTERNS, SPEC_PROP_REFS, SPEC_STATE_TYPES, STATE_BINDING_KEY, STATE_FIELDS, toDialectSchema, } from "./contract.js";
11
16
  export { checkSchemaDocument, DIALECT_KEYWORDS, DIALECT_TYPES, DIALECT_URI, validateInstance, } from "./dialect.js";
17
+ export { checkStateSurface, LIST_TEXT_PATTERN, SPEC_CONTROL_STATE_TYPES, SURFACE_PLAYER_CODES, surfaceInputs, } from "./surface.js";
12
18
  export { validateBlueprint, validateTree, } from "./validate.js";
13
19
  export { SPEC_VERSION } from "./version.js";
@@ -0,0 +1,7 @@
1
+ import type { SpecMigration } from './types.js';
2
+ /**
3
+ * 0.2.0 → 0.3.0 is additive (ADR-008): every 0.2.0 envelope is a valid
4
+ * 0.3.0 envelope, so the step only stamps `spec`. Object spread keeps a
5
+ * parsed `__proto__` key as an own property, so validation still refuses it.
6
+ */
7
+ export declare const migration020to030: SpecMigration;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 0.2.0 → 0.3.0 is additive (ADR-008): every 0.2.0 envelope is a valid
3
+ * 0.3.0 envelope, so the step only stamps `spec`. Object spread keeps a
4
+ * parsed `__proto__` key as an own property, so validation still refuses it.
5
+ */
6
+ export const migration020to030 = Object.freeze({
7
+ from: '0.2.0',
8
+ to: '0.3.0',
9
+ migrate: (envelope) => ({ ...envelope, spec: '0.3.0' }),
10
+ });
@@ -0,0 +1,9 @@
1
+ import type { SpecMigration } from './types.js';
2
+ /**
3
+ * 0.3.0 → 0.4.0 is additive (PLAN_008 T-catalog-player / ADR-009 deck encoding):
4
+ * layout-deck and deck-slide gain optional model-v2 props (aspect 9:16,
5
+ * transitions slide/zoom/morph, motion, navigation, outline, layout, background,
6
+ * steps, component). Every 0.3.0 envelope is a valid 0.4.0 envelope, so the
7
+ * step only stamps `spec`.
8
+ */
9
+ export declare const migration030to040: SpecMigration;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 0.3.0 → 0.4.0 is additive (PLAN_008 T-catalog-player / ADR-009 deck encoding):
3
+ * layout-deck and deck-slide gain optional model-v2 props (aspect 9:16,
4
+ * transitions slide/zoom/morph, motion, navigation, outline, layout, background,
5
+ * steps, component). Every 0.3.0 envelope is a valid 0.4.0 envelope, so the
6
+ * step only stamps `spec`.
7
+ */
8
+ export const migration030to040 = Object.freeze({
9
+ from: '0.3.0',
10
+ to: '0.4.0',
11
+ migrate: (envelope) => ({ ...envelope, spec: '0.4.0' }),
12
+ });
@@ -0,0 +1,8 @@
1
+ import type { SpecMigration } from './types.js';
2
+ /**
3
+ * 0.4.0 → 0.5.0 is additive (PLAN_009 catalog coverage): the catalog gains
4
+ * the data-cohort-table, data-notification-inbox and data-filter-builder
5
+ * ids and the app-tier time-field id. Every 0.4.0 envelope is a valid 0.5.0
6
+ * envelope, so the step only stamps `spec`.
7
+ */
8
+ export declare const migration040to050: SpecMigration;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 0.4.0 → 0.5.0 is additive (PLAN_009 catalog coverage): the catalog gains
3
+ * the data-cohort-table, data-notification-inbox and data-filter-builder
4
+ * ids and the app-tier time-field id. Every 0.4.0 envelope is a valid 0.5.0
5
+ * envelope, so the step only stamps `spec`.
6
+ */
7
+ export const migration040to050 = Object.freeze({
8
+ from: '0.4.0',
9
+ to: '0.5.0',
10
+ migrate: (envelope) => ({ ...envelope, spec: '0.5.0' }),
11
+ });
@@ -0,0 +1,15 @@
1
+ import type { SpecMigration, SpecMigrationResult } from './types.js';
2
+ export type { SpecMigration, SpecMigrationResult };
3
+ /** The version an envelope without `spec` was written for. */
4
+ export declare const UNDECLARED_SPEC_VERSION = "0.2.0";
5
+ /** Every step, in order; each `to` is the next step's `from`. */
6
+ export declare const SPEC_MIGRATIONS: readonly SpecMigration[];
7
+ /**
8
+ * Bring a blueprint envelope up to `target` (the current spec by default)
9
+ * before validation. Never throws and never mutates its input: a value that
10
+ * is not an envelope, or one declaring a version no chain starts from, passes
11
+ * through with no step applied (validation then refuses an unknown `spec`).
12
+ * Only the envelope's `spec` field changes, so the tree, status, provenance
13
+ * and activation digest stay as they were. Idempotent.
14
+ */
15
+ export declare function migrateBlueprint(input: unknown, target?: string): SpecMigrationResult;