plggmatic 0.2.1 → 0.3.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 (221) hide show
  1. package/README.md +37 -0
  2. package/dist/Catalog/index.d.ts +17 -0
  3. package/dist/Catalog/index.d.ts.map +1 -0
  4. package/dist/Catalog/model/tool.d.ts +101 -0
  5. package/dist/Catalog/model/tool.d.ts.map +1 -0
  6. package/dist/Catalog/usecase/adapter.d.ts +81 -0
  7. package/dist/Catalog/usecase/adapter.d.ts.map +1 -0
  8. package/dist/Catalog/usecase/catalog.d.ts +43 -0
  9. package/dist/Catalog/usecase/catalog.d.ts.map +1 -0
  10. package/dist/Catalog/usecase/runFlow.d.ts +77 -0
  11. package/dist/Catalog/usecase/runFlow.d.ts.map +1 -0
  12. package/dist/Component/index.d.ts +30 -0
  13. package/dist/Component/index.d.ts.map +1 -0
  14. package/dist/Component/model/interaction.d.ts +41 -0
  15. package/dist/Component/model/interaction.d.ts.map +1 -0
  16. package/dist/Component/model/navItem.d.ts +16 -0
  17. package/dist/Component/model/navItem.d.ts.map +1 -0
  18. package/dist/Component/usecase/breadcrumb.d.ts +26 -0
  19. package/dist/Component/usecase/breadcrumb.d.ts.map +1 -0
  20. package/dist/Component/usecase/button.d.ts +27 -0
  21. package/dist/Component/usecase/button.d.ts.map +1 -0
  22. package/dist/Component/usecase/checkbox.d.ts +20 -0
  23. package/dist/Component/usecase/checkbox.d.ts.map +1 -0
  24. package/dist/Component/usecase/colHead.d.ts +28 -0
  25. package/dist/Component/usecase/colHead.d.ts.map +1 -0
  26. package/dist/Component/usecase/confirmDialog.d.ts +25 -0
  27. package/dist/Component/usecase/confirmDialog.d.ts.map +1 -0
  28. package/dist/Component/usecase/declaredForm.d.ts +89 -0
  29. package/dist/Component/usecase/declaredForm.d.ts.map +1 -0
  30. package/dist/Component/usecase/navTree.d.ts +21 -0
  31. package/dist/Component/usecase/navTree.d.ts.map +1 -0
  32. package/dist/Component/usecase/selectInput.d.ts +28 -0
  33. package/dist/Component/usecase/selectInput.d.ts.map +1 -0
  34. package/dist/Component/usecase/sidebarNav.d.ts +77 -0
  35. package/dist/Component/usecase/sidebarNav.d.ts.map +1 -0
  36. package/dist/Component/usecase/textArea.d.ts +22 -0
  37. package/dist/Component/usecase/textArea.d.ts.map +1 -0
  38. package/dist/Component/usecase/textInput.d.ts +23 -0
  39. package/dist/Component/usecase/textInput.d.ts.map +1 -0
  40. package/dist/Component/usecase/textLink.d.ts +26 -0
  41. package/dist/Component/usecase/textLink.d.ts.map +1 -0
  42. package/dist/Component/usecase/themeToggle.d.ts +75 -0
  43. package/dist/Component/usecase/themeToggle.d.ts.map +1 -0
  44. package/dist/Component/usecase/toast.d.ts +32 -0
  45. package/dist/Component/usecase/toast.d.ts.map +1 -0
  46. package/dist/Component/usecase/typography.d.ts +33 -0
  47. package/dist/Component/usecase/typography.d.ts.map +1 -0
  48. package/dist/Declare/model/Action.d.ts +91 -0
  49. package/dist/Declare/model/Action.d.ts.map +1 -0
  50. package/dist/Declare/model/Adapter.d.ts +107 -0
  51. package/dist/Declare/model/Adapter.d.ts.map +1 -0
  52. package/dist/Declare/model/Collection.d.ts +55 -0
  53. package/dist/Declare/model/Collection.d.ts.map +1 -0
  54. package/dist/Declare/model/Declaration.d.ts +27 -0
  55. package/dist/Declare/model/Declaration.d.ts.map +1 -0
  56. package/dist/Declare/model/Menu.d.ts +21 -0
  57. package/dist/Declare/model/Menu.d.ts.map +1 -0
  58. package/dist/Declare/model/Query.d.ts +56 -0
  59. package/dist/Declare/model/Query.d.ts.map +1 -0
  60. package/dist/Declare/model/Row.d.ts +129 -0
  61. package/dist/Declare/model/Row.d.ts.map +1 -0
  62. package/dist/Declare/model/Source.d.ts +83 -0
  63. package/dist/Declare/model/Source.d.ts.map +1 -0
  64. package/dist/Declare/usecase/apply.d.ts +23 -0
  65. package/dist/Declare/usecase/apply.d.ts.map +1 -0
  66. package/dist/Declare/usecase/project.d.ts +66 -0
  67. package/dist/Declare/usecase/project.d.ts.map +1 -0
  68. package/dist/Declare/usecase/reconcile.d.ts +63 -0
  69. package/dist/Declare/usecase/reconcile.d.ts.map +1 -0
  70. package/dist/Flow/model/forms.d.ts +45 -0
  71. package/dist/Flow/model/forms.d.ts.map +1 -0
  72. package/dist/Flow/model/run.d.ts +74 -0
  73. package/dist/Flow/model/run.d.ts.map +1 -0
  74. package/dist/Flow/model/script.d.ts +279 -0
  75. package/dist/Flow/model/script.d.ts.map +1 -0
  76. package/dist/Flow/usecase/interpret.d.ts +17 -0
  77. package/dist/Flow/usecase/interpret.d.ts.map +1 -0
  78. package/dist/Flow/usecase/read.d.ts +46 -0
  79. package/dist/Flow/usecase/read.d.ts.map +1 -0
  80. package/dist/Form/index.d.ts +14 -0
  81. package/dist/Form/index.d.ts.map +1 -0
  82. package/dist/Form/model/control.d.ts +9 -0
  83. package/dist/Form/model/control.d.ts.map +1 -0
  84. package/dist/Form/model/submission.d.ts +30 -0
  85. package/dist/Form/model/submission.d.ts.map +1 -0
  86. package/dist/Form/usecase/controlParts.d.ts +30 -0
  87. package/dist/Form/usecase/controlParts.d.ts.map +1 -0
  88. package/dist/Form/usecase/formView.d.ts +21 -0
  89. package/dist/Form/usecase/formView.d.ts.map +1 -0
  90. package/dist/Form/usecase/parseForm.d.ts +28 -0
  91. package/dist/Form/usecase/parseForm.d.ts.map +1 -0
  92. package/dist/Layout/index.d.ts +21 -0
  93. package/dist/Layout/index.d.ts.map +1 -0
  94. package/dist/Layout/model/geometry.d.ts +97 -0
  95. package/dist/Layout/model/geometry.d.ts.map +1 -0
  96. package/dist/Layout/model/pane.d.ts +15 -0
  97. package/dist/Layout/model/pane.d.ts.map +1 -0
  98. package/dist/Layout/model/reveal.d.ts +26 -0
  99. package/dist/Layout/model/reveal.d.ts.map +1 -0
  100. package/dist/Layout/usecase/combinators.d.ts +78 -0
  101. package/dist/Layout/usecase/combinators.d.ts.map +1 -0
  102. package/dist/Layout/usecase/preference.d.ts +27 -0
  103. package/dist/Layout/usecase/preference.d.ts.map +1 -0
  104. package/dist/Layout/usecase/revealColumn.d.ts +39 -0
  105. package/dist/Layout/usecase/revealColumn.d.ts.map +1 -0
  106. package/dist/Layout/usecase/workspace.d.ts +58 -0
  107. package/dist/Layout/usecase/workspace.d.ts.map +1 -0
  108. package/dist/Meta/model/classHooks.d.ts +141 -0
  109. package/dist/Meta/model/classHooks.d.ts.map +1 -0
  110. package/dist/Meta/model/identity.d.ts +16 -0
  111. package/dist/Meta/model/identity.d.ts.map +1 -0
  112. package/dist/Navigate/index.d.ts +19 -0
  113. package/dist/Navigate/index.d.ts.map +1 -0
  114. package/dist/Navigate/model/Composition.d.ts +50 -0
  115. package/dist/Navigate/model/Composition.d.ts.map +1 -0
  116. package/dist/Navigate/model/Trail.d.ts +84 -0
  117. package/dist/Navigate/model/Trail.d.ts.map +1 -0
  118. package/dist/Navigate/model/marker.d.ts +44 -0
  119. package/dist/Navigate/model/marker.d.ts.map +1 -0
  120. package/dist/Navigate/usecase/compositionUrl.d.ts +63 -0
  121. package/dist/Navigate/usecase/compositionUrl.d.ts.map +1 -0
  122. package/dist/Navigate/usecase/navigationScript.d.ts +16 -0
  123. package/dist/Navigate/usecase/navigationScript.d.ts.map +1 -0
  124. package/dist/Navigate/usecase/trailUrl.d.ts +61 -0
  125. package/dist/Navigate/usecase/trailUrl.d.ts.map +1 -0
  126. package/dist/Render/index.d.ts +18 -0
  127. package/dist/Render/index.d.ts.map +1 -0
  128. package/dist/Render/model/mode.d.ts +13 -0
  129. package/dist/Render/model/mode.d.ts.map +1 -0
  130. package/dist/Render/model/screen.d.ts +27 -0
  131. package/dist/Render/model/screen.d.ts.map +1 -0
  132. package/dist/Render/usecase/advanceColumns.d.ts +41 -0
  133. package/dist/Render/usecase/advanceColumns.d.ts.map +1 -0
  134. package/dist/Render/usecase/multiColumn.d.ts +52 -0
  135. package/dist/Render/usecase/multiColumn.d.ts.map +1 -0
  136. package/dist/Render/usecase/parts.d.ts +56 -0
  137. package/dist/Render/usecase/parts.d.ts.map +1 -0
  138. package/dist/Render/usecase/renderMode.d.ts +17 -0
  139. package/dist/Render/usecase/renderMode.d.ts.map +1 -0
  140. package/dist/Render/usecase/singleColumn.d.ts +20 -0
  141. package/dist/Render/usecase/singleColumn.d.ts.map +1 -0
  142. package/dist/Schedule/model/Model.d.ts +103 -0
  143. package/dist/Schedule/model/Model.d.ts.map +1 -0
  144. package/dist/Schedule/model/Msg.d.ts +131 -0
  145. package/dist/Schedule/model/Msg.d.ts.map +1 -0
  146. package/dist/Schedule/model/Scene.d.ts +190 -0
  147. package/dist/Schedule/model/Scene.d.ts.map +1 -0
  148. package/dist/Schedule/model/View.d.ts +54 -0
  149. package/dist/Schedule/model/View.d.ts.map +1 -0
  150. package/dist/Schedule/usecase/chain.d.ts +16 -0
  151. package/dist/Schedule/usecase/chain.d.ts.map +1 -0
  152. package/dist/Schedule/usecase/codec.d.ts +44 -0
  153. package/dist/Schedule/usecase/codec.d.ts.map +1 -0
  154. package/dist/Schedule/usecase/lower.d.ts +45 -0
  155. package/dist/Schedule/usecase/lower.d.ts.map +1 -0
  156. package/dist/Schedule/usecase/scene.d.ts +16 -0
  157. package/dist/Schedule/usecase/scene.d.ts.map +1 -0
  158. package/dist/Schedule/usecase/schedule.d.ts +72 -0
  159. package/dist/Schedule/usecase/schedule.d.ts.map +1 -0
  160. package/dist/Schedule/usecase/update.d.ts +39 -0
  161. package/dist/Schedule/usecase/update.d.ts.map +1 -0
  162. package/dist/Style/index.d.ts +34 -0
  163. package/dist/Style/index.d.ts.map +1 -0
  164. package/dist/Style/model/appearance.d.ts +23 -0
  165. package/dist/Style/model/appearance.d.ts.map +1 -0
  166. package/dist/Style/model/breakpoint.d.ts +43 -0
  167. package/dist/Style/model/breakpoint.d.ts.map +1 -0
  168. package/dist/Style/model/componentSlot.d.ts +35 -0
  169. package/dist/Style/model/componentSlot.d.ts.map +1 -0
  170. package/dist/Style/model/hexColor.d.ts +26 -0
  171. package/dist/Style/model/hexColor.d.ts.map +1 -0
  172. package/dist/Style/model/metric.d.ts +35 -0
  173. package/dist/Style/model/metric.d.ts.map +1 -0
  174. package/dist/Style/model/palette.d.ts +38 -0
  175. package/dist/Style/model/palette.d.ts.map +1 -0
  176. package/dist/Style/model/scheme.d.ts +26 -0
  177. package/dist/Style/model/scheme.d.ts.map +1 -0
  178. package/dist/Style/model/syntax.d.ts +54 -0
  179. package/dist/Style/model/syntax.d.ts.map +1 -0
  180. package/dist/Style/model/theme.d.ts +68 -0
  181. package/dist/Style/model/theme.d.ts.map +1 -0
  182. package/dist/Style/model/token.d.ts +142 -0
  183. package/dist/Style/model/token.d.ts.map +1 -0
  184. package/dist/Style/model/typography.d.ts +83 -0
  185. package/dist/Style/model/typography.d.ts.map +1 -0
  186. package/dist/Style/model/zIndex.d.ts +25 -0
  187. package/dist/Style/model/zIndex.d.ts.map +1 -0
  188. package/dist/Style/usecase/appearanceScript.d.ts +43 -0
  189. package/dist/Style/usecase/appearanceScript.d.ts.map +1 -0
  190. package/dist/Style/usecase/chromeCss.d.ts +41 -0
  191. package/dist/Style/usecase/chromeCss.d.ts.map +1 -0
  192. package/dist/Style/usecase/contrast.d.ts +3 -0
  193. package/dist/Style/usecase/contrast.d.ts.map +1 -0
  194. package/dist/Style/usecase/metricCss.d.ts +17 -0
  195. package/dist/Style/usecase/metricCss.d.ts.map +1 -0
  196. package/dist/Style/usecase/reducedMotion.d.ts +20 -0
  197. package/dist/Style/usecase/reducedMotion.d.ts.map +1 -0
  198. package/dist/Style/usecase/runwayCss.d.ts +50 -0
  199. package/dist/Style/usecase/runwayCss.d.ts.map +1 -0
  200. package/dist/Style/usecase/schemeCss.d.ts +25 -0
  201. package/dist/Style/usecase/schemeCss.d.ts.map +1 -0
  202. package/dist/Style/usecase/slotCss.d.ts +73 -0
  203. package/dist/Style/usecase/slotCss.d.ts.map +1 -0
  204. package/dist/Style/usecase/syntaxCss.d.ts +14 -0
  205. package/dist/Style/usecase/syntaxCss.d.ts.map +1 -0
  206. package/dist/Style/usecase/utilities.d.ts +98 -0
  207. package/dist/Style/usecase/utilities.d.ts.map +1 -0
  208. package/dist/Style/usecase/workspaceCss.d.ts +48 -0
  209. package/dist/Style/usecase/workspaceCss.d.ts.map +1 -0
  210. package/dist/brand.d.ts +29 -0
  211. package/dist/brand.d.ts.map +1 -0
  212. package/dist/columnsEntry.d.ts +27 -0
  213. package/dist/columnsEntry.d.ts.map +1 -0
  214. package/dist/columnsEntry.es.js +452 -0
  215. package/dist/index.d.ts +63 -0
  216. package/dist/index.d.ts.map +1 -0
  217. package/dist/index.es.js +6022 -0
  218. package/dist/styleEntry.d.ts +34 -0
  219. package/dist/styleEntry.d.ts.map +1 -0
  220. package/dist/styleEntry.es.js +1615 -0
  221. package/package.json +15 -8
@@ -0,0 +1,63 @@
1
+ import { type SoftStr, type Box } from "plgg";
2
+ import { type Declaration } from "../model/Declaration";
3
+ import { type Registry } from "../model/Adapter";
4
+ /**
5
+ * A startup reconciliation finding — the binding check that
6
+ * runs before the first render (point-7 naming decision):
7
+ *
8
+ * - `UnknownAdapter` — a NAMED adapter source the host never
9
+ * registered (a positioned ERROR, keyed by collection).
10
+ * - `NoDefaultAdapter` — an UNNAMED (default) adapter source
11
+ * meeting a registry that is not exactly one, so there is
12
+ * no sole default to resolve (a positioned ERROR).
13
+ * - `UnusedAdapter` — a registration no collection reads
14
+ * through (a WARNING).
15
+ *
16
+ * v1 has no cross-adapter include/projection to check: each
17
+ * collection reads through exactly ONE adapter (its source's
18
+ * name), so "one read within one adapter" holds structurally
19
+ * — a cross-backend read is the host's business inside a
20
+ * single adapter's `read`.
21
+ */
22
+ export type Diagnostic = Box<"UnknownAdapter", Readonly<{
23
+ collection: SoftStr;
24
+ name: SoftStr;
25
+ }>> | Box<"NoDefaultAdapter", Readonly<{
26
+ collection: SoftStr;
27
+ registered: number;
28
+ }>> | Box<"UnusedAdapter", Readonly<{
29
+ name: SoftStr;
30
+ }>>;
31
+ /** An unknown named-adapter error. */
32
+ export declare const unknownAdapter: (collection: SoftStr, name: SoftStr) => Diagnostic;
33
+ /** A missing-default error for an unnamed adapter source. */
34
+ export declare const noDefaultAdapter: (collection: SoftStr, registered: number) => Diagnostic;
35
+ /** An unused-registration warning. */
36
+ export declare const unusedAdapter: (name: SoftStr) => Diagnostic;
37
+ /** Matchers for folding a {@link Diagnostic}. */
38
+ export declare const unknownAdapter$: () => {
39
+ __tag: "UnknownAdapter";
40
+ type: "tag";
41
+ body: undefined;
42
+ };
43
+ export declare const noDefaultAdapter$: () => {
44
+ __tag: "NoDefaultAdapter";
45
+ type: "tag";
46
+ body: undefined;
47
+ };
48
+ export declare const unusedAdapter$: () => {
49
+ __tag: "UnusedAdapter";
50
+ type: "tag";
51
+ body: undefined;
52
+ };
53
+ /** A diagnostic's severity — errors block, warnings inform. */
54
+ export declare const diagnosticSeverity: (d: Diagnostic) => "error" | "warning";
55
+ /**
56
+ * Reconciles a declaration's adapter sources against the
57
+ * host {@link Registry} — the total startup check. Returns
58
+ * every {@link Diagnostic} (errors and warnings); an empty
59
+ * array means the bindings are sound. Pure: reads no data,
60
+ * runs no adapter.
61
+ */
62
+ export declare const reconcile: (declaration: Declaration, registry: Registry) => ReadonlyArray<Diagnostic>;
63
+ //# sourceMappingURL=reconcile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../../src/Declare/usecase/reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAST,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAShE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,CACD,gBAAgB,EAChB,QAAQ,CAAC;IACP,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC,CACH,GACD,GAAG,CACD,kBAAkB,EAClB,QAAQ,CAAC;IACP,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CACH,GACD,GAAG,CACD,eAAe,EACf,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAC5B,CAAC;AAEN,sCAAsC;AACtC,eAAO,MAAM,cAAc,eACb,OAAO,QACb,OAAO,KACZ,UAC0C,CAAC;AAE9C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,eACf,OAAO,cACP,MAAM,KACjB,UAIC,CAAC;AAEL,sCAAsC;AACtC,eAAO,MAAM,aAAa,SAClB,OAAO,KACZ,UAA4C,CAAC;AAEhD,iDAAiD;AACjD,eAAO,MAAM,eAAe;;;;CACC,CAAC;AAC9B,eAAO,MAAM,iBAAiB;;;;CACC,CAAC;AAChC,eAAO,MAAM,cAAc;;;;CACC,CAAC;AAE7B,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,MAC1B,UAAU,KACZ,OAAO,GAAG,SAcV,CAAC;AAoCJ;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,gBACP,WAAW,YACd,QAAQ,KACjB,aAAa,CAAC,UAAU,CAyD1B,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { type SoftStr, type Option } from "plgg";
2
+ /**
3
+ * The manifest-SHAPED schema the flow reader checks a flow
4
+ * against. A `Collection`'s `toRow` is a function that
5
+ * carries no static field types, so field types come from
6
+ * a schema the manifest supplies (point-3 decision) rather
7
+ * than from the opaque TypeScript `Declaration`. The bridge
8
+ * from a real `Declaration` (collection + declared-choice
9
+ * names, plus manifest field types) lands with the host-
10
+ * adapter ticket; a spec fixture builds a {@link FlowSchema}
11
+ * directly.
12
+ *
13
+ * A field's static type is v1-simple: numeric or not (the
14
+ * only distinction the flow type-checker needs — `sum`
15
+ * over numbers vs strings). Richer field types arrive with
16
+ * the manifest lowering; the plgg-ir-language `SemType`
17
+ * vocabulary is reserved for that, not spent on a boolean.
18
+ */
19
+ /** One collection's static schema. */
20
+ export type CollectionSchema = Readonly<{
21
+ id: SoftStr;
22
+ fields: ReadonlyArray<Readonly<{
23
+ kw: SoftStr;
24
+ numeric: boolean;
25
+ }>>;
26
+ choices: ReadonlyArray<SoftStr>;
27
+ }>;
28
+ /** The schema a flow is checked against. */
29
+ export type FlowSchema = Readonly<{
30
+ collections: ReadonlyArray<CollectionSchema>;
31
+ }>;
32
+ /** Constructs a {@link FlowSchema}. */
33
+ export declare const flowSchema: (collections: ReadonlyArray<CollectionSchema>) => FlowSchema;
34
+ /** Finds a collection's schema by id. */
35
+ export declare const collectionSchema: (schema: FlowSchema, id: SoftStr) => Option<CollectionSchema>;
36
+ /**
37
+ * Whether a keyword projects to a number. `label`/`id`
38
+ * are the row's own string identity; an undeclared field
39
+ * defaults to string (the conservative `fieldText`
40
+ * projection).
41
+ */
42
+ export declare const fieldIsNumeric: (cs: CollectionSchema, kw: SoftStr) => boolean;
43
+ /** True if the collection declares the choice id. */
44
+ export declare const hasChoice: (cs: CollectionSchema, choiceId: SoftStr) => boolean;
45
+ //# sourceMappingURL=forms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../src/Flow/model/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAGZ,MAAM,MAAM,CAAC;AAEd;;;;;;;;;;;;;;;;GAgBG;AAEH,sCAAsC;AACtC,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,aAAa,CACnB,QAAQ,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAC5C,CAAC;IACF,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC;CAC9C,CAAC,CAAC;AAEH,uCAAuC;AACvC,eAAO,MAAM,UAAU,gBACR,aAAa,CAAC,gBAAgB,CAAC,KAC3C,UAA+B,CAAC;AAEnC,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,WACnB,UAAU,MACd,OAAO,KACV,MAAM,CAAC,gBAAgB,CAGvB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,OACrB,gBAAgB,MAChB,OAAO,KACV,OAgBI,CAAC;AAER,qDAAqD;AACrD,eAAO,MAAM,SAAS,OAChB,gBAAgB,YACV,OAAO,KAChB,OACqC,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { type SoftStr, type Box } from "plgg";
2
+ import { type SchedulerMsg } from "../../Schedule/model/Msg";
3
+ import { type FlowScript, type FlowValue } from "./script";
4
+ /**
5
+ * The interpreter's outcome vocabulary — the run-state
6
+ * union of `dsl-v1-core.md` §1 (`run.ts`), prototype
7
+ * scale. Everything here is inert, JSON-safe data:
8
+ * failure is a value (never a throw — fuel semantics
9
+ * §5.3), and the PAUSED state is the serializable
10
+ * continuation the whole point-9 prototype exists to
11
+ * prove (§5.4).
12
+ */
13
+ /** Why a flow failed — a closed diagnostic code set. */
14
+ export type FlowDiagCode = "fuel-exhausted" | "unknown-collection" | "unbound-name" | "type-mismatch" | "unknown-host";
15
+ /**
16
+ * A failure diagnostic: the code and the step index the
17
+ * reduction was working on (the prototype's stand-in for
18
+ * the source range the checked IR will carry).
19
+ */
20
+ export type FlowDiag = Readonly<{
21
+ code: FlowDiagCode;
22
+ at: number;
23
+ }>;
24
+ /**
25
+ * A paused flow — the DEFUNCTIONALIZED continuation:
26
+ * the script itself, the index of the next step, the
27
+ * bindings computed so far, the REMAINING fuel (§5.4:
28
+ * fuel serializes with the continuation and none is
29
+ * consumed while paused), and the yielded Msg the
30
+ * harness must dispatch before resuming.
31
+ */
32
+ export type PausedFlow = Readonly<{
33
+ script: FlowScript;
34
+ next: number;
35
+ env: Readonly<Record<string, FlowValue>>;
36
+ fuel: number;
37
+ msg: SchedulerMsg;
38
+ }>;
39
+ /**
40
+ * The step outcome: paused on a dispatch, done with the
41
+ * flow's value, or failed with a diagnostic.
42
+ */
43
+ export type FlowOutcome = Box<"FlowPaused", PausedFlow> | Box<"FlowDone", FlowValue> | Box<"FlowFailed", FlowDiag>;
44
+ /** Constructs a paused outcome. */
45
+ export declare const flowPaused: (p: PausedFlow) => FlowOutcome;
46
+ /** Constructs a done outcome. */
47
+ export declare const flowDone: (value: FlowValue) => FlowOutcome;
48
+ /** Constructs a failed outcome. */
49
+ export declare const flowFailed: (code: FlowDiagCode, at: number) => FlowOutcome;
50
+ /** Matchers for folding a {@link FlowOutcome}. */
51
+ export declare const flowPaused$: () => {
52
+ __tag: "FlowPaused";
53
+ type: "tag";
54
+ body: undefined;
55
+ };
56
+ export declare const flowDone$: () => {
57
+ __tag: "FlowDone";
58
+ type: "tag";
59
+ body: undefined;
60
+ };
61
+ export declare const flowFailed$: () => {
62
+ __tag: "FlowFailed";
63
+ type: "tag";
64
+ body: undefined;
65
+ };
66
+ /** The spec-set default fuel budget (§5.2). */
67
+ export declare const defaultFuel = 10000;
68
+ /** A binding environment (JSON-safe). */
69
+ export type FlowEnv = Readonly<Record<string, FlowValue>>;
70
+ /** The empty environment. */
71
+ export declare const emptyEnv: () => FlowEnv;
72
+ /** Extends an environment with one binding. */
73
+ export declare const bind: (env: FlowEnv, name: SoftStr, value: FlowValue) => FlowEnv;
74
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/Flow/model/run.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAGT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,YAA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CAAyC;AACzC,MAAM,MAAM,OAAO,GAAG,QAAQ,CAC5B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAC1B,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,QAAQ,QAAO,OAAe,CAAC;AAE5C,+CAA+C;AAC/C,eAAO,MAAM,IAAI,QACV,OAAO,QACN,OAAO,SACN,SAAS,KACf,OAAsC,CAAC"}
@@ -0,0 +1,279 @@
1
+ import { type SoftStr, type Box, type Icon } from "plgg";
2
+ import { type Row } from "../../Declare/model/Row";
3
+ import { type SchedulerMsg } from "../../Schedule/model/Msg";
4
+ /**
5
+ * The checked, normalized flow IR — the shape the reader
6
+ * (`Flow/usecase/read.ts`) produces and the interpreter
7
+ * (`Flow/usecase/interpret.ts`) evaluates. Everything here
8
+ * is inert, JSON-safe DATA — no closures anywhere —
9
+ * because the paused continuation must serialize
10
+ * (`dsl-v1-core.md` §5.4).
11
+ *
12
+ * The expression side generalized from the point-9
13
+ * prototype's ad-hoc node set to a host-application model
14
+ * (`EApp{op, args}`) so all three worked spec §6 flows —
15
+ * including `(sum (map :hours …))` — are expressible. The
16
+ * old prototype constructors survive as thin builders over
17
+ * the new nodes, so the interpreter's existing spec keeps
18
+ * compiling.
19
+ *
20
+ * Restriction (frozen back to `dsl-v1-core.md` §2 by the
21
+ * point-9 prototype): `dispatch` appears only as a DIRECT
22
+ * STEP of a flow body, never nested in an expression — so
23
+ * pure expressions never pause and the paused continuation
24
+ * is a step index + bindings + fuel.
25
+ */
26
+ /**
27
+ * A runtime value — the CLOSED, JSON-safe value union of
28
+ * the evaluator. Option/Result are the DSL's no-nil
29
+ * discipline (`dsl-v1-core.md` §3): absence and failure
30
+ * are values folded by match forms, never null, never a
31
+ * throw.
32
+ */
33
+ export type FlowValue = Box<"VStr", SoftStr> | Box<"VNum", number> | Box<"VList", Readonly<{
34
+ items: ReadonlyArray<FlowValue>;
35
+ }>> | Box<"VRow", Row> | Icon<"VNone"> | Box<"VSome", Readonly<{
36
+ value: FlowValue;
37
+ }>> | Box<"VOk", Readonly<{
38
+ value: FlowValue;
39
+ }>> | Box<"VErr", SoftStr>;
40
+ /** Constructs a string value. */
41
+ export declare const vStr: (s: SoftStr) => FlowValue;
42
+ /** Constructs a number value. */
43
+ export declare const vNum: (n: number) => FlowValue;
44
+ /** Constructs a list value. */
45
+ export declare const vList: (items: ReadonlyArray<FlowValue>) => FlowValue;
46
+ /** Constructs a row value (a scene-read row). */
47
+ export declare const vRow: (r: Row) => FlowValue;
48
+ /** The absent Option value. */
49
+ export declare const vNone: () => FlowValue;
50
+ /** Constructs a present Option value. */
51
+ export declare const vSome: (v: FlowValue) => FlowValue;
52
+ /** Constructs a success Result value. */
53
+ export declare const vOk: (v: FlowValue) => FlowValue;
54
+ /** Constructs a failure Result value (a keyword). */
55
+ export declare const vErr: (kw: SoftStr) => FlowValue;
56
+ /** Matchers for folding a {@link FlowValue}. */
57
+ export declare const vStr$: () => {
58
+ __tag: "VStr";
59
+ type: "tag";
60
+ body: undefined;
61
+ };
62
+ export declare const vNum$: () => {
63
+ __tag: "VNum";
64
+ type: "tag";
65
+ body: undefined;
66
+ };
67
+ export declare const vList$: () => {
68
+ __tag: "VList";
69
+ type: "tag";
70
+ body: undefined;
71
+ };
72
+ export declare const vRow$: () => {
73
+ __tag: "VRow";
74
+ type: "tag";
75
+ body: undefined;
76
+ };
77
+ export declare const vNone$: () => {
78
+ __tag: "VNone";
79
+ type: "tag";
80
+ body: undefined;
81
+ };
82
+ export declare const vSome$: () => {
83
+ __tag: "VSome";
84
+ type: "tag";
85
+ body: undefined;
86
+ };
87
+ export declare const vOk$: () => {
88
+ __tag: "VOk";
89
+ type: "tag";
90
+ body: undefined;
91
+ };
92
+ export declare const vErr$: () => {
93
+ __tag: "VErr";
94
+ type: "tag";
95
+ body: undefined;
96
+ };
97
+ /**
98
+ * A pure expression. `scene-rows` is the only read of the
99
+ * settled Scene; `EProj`/`EGet` are the no-`fn` keyword
100
+ * projection of `dsl-v1-core.md` §4; `EApp` is a host
101
+ * function application (the ~31-name vocabulary); the two
102
+ * match forms are the exhaustive folds over "rows
103
+ * present?" and Option. No expression dispatches: pure
104
+ * evaluation never pauses.
105
+ */
106
+ export type FlowExpr = Box<"EStr", SoftStr> | Box<"ENum", number> | Box<"EVar", SoftStr> | Box<"ESceneRows", SoftStr> | Box<"EProj", Readonly<{
107
+ kw: SoftStr;
108
+ of: FlowExpr;
109
+ }>> | Box<"EGet", Readonly<{
110
+ kw: SoftStr;
111
+ of: FlowExpr;
112
+ }>> | Box<"EApp", Readonly<{
113
+ op: SoftStr;
114
+ args: ReadonlyArray<FlowExpr>;
115
+ }>> | Box<"EOk", Readonly<{
116
+ of: FlowExpr;
117
+ }>> | Box<"EErr", SoftStr> | Box<"ESome", Readonly<{
118
+ of: FlowExpr;
119
+ }>> | Icon<"ENone"> | Box<"EMatchEmpty", Readonly<{
120
+ of: FlowExpr;
121
+ whenEmpty: FlowExpr;
122
+ bind: SoftStr;
123
+ whenRest: FlowExpr;
124
+ }>> | Box<"EMatchOption", Readonly<{
125
+ of: FlowExpr;
126
+ whenNone: FlowExpr;
127
+ bind: SoftStr;
128
+ whenSome: FlowExpr;
129
+ }>>;
130
+ /** A string literal. */
131
+ export declare const strLit: (s: SoftStr) => FlowExpr;
132
+ /** A number literal. */
133
+ export declare const numLit: (n: number) => FlowExpr;
134
+ /** References a bound name. */
135
+ export declare const varRef: (name: SoftStr) => FlowExpr;
136
+ /** Reads a collection's settled rows. */
137
+ export declare const sceneRows: (collection: SoftStr) => FlowExpr;
138
+ /** Keyword projection over a list of rows. */
139
+ export declare const mapKw: (kw: SoftStr, of: FlowExpr) => FlowExpr;
140
+ /** Keyword lookup on one row, as an Option. */
141
+ export declare const getKw: (kw: SoftStr, of: FlowExpr) => FlowExpr;
142
+ /** A host-function application. */
143
+ export declare const app: (op: SoftStr, args: ReadonlyArray<FlowExpr>) => FlowExpr;
144
+ /** The first element, as an Option (host `first`). */
145
+ export declare const firstOf: (of: FlowExpr) => FlowExpr;
146
+ /** The element count of a list (host `count`). */
147
+ export declare const countOf: (of: FlowExpr) => FlowExpr;
148
+ /** The numeric sum of a list (host `sum`). */
149
+ export declare const sumOf: (of: FlowExpr) => FlowExpr;
150
+ /** Wraps a value in Ok. */
151
+ export declare const okOf: (of: FlowExpr) => FlowExpr;
152
+ /** An Err carrying a keyword. */
153
+ export declare const errOf: (kw: SoftStr) => FlowExpr;
154
+ /** Wraps a value in Some. */
155
+ export declare const someOf: (of: FlowExpr) => FlowExpr;
156
+ /** The absent Option. */
157
+ export declare const noneOf: () => FlowExpr;
158
+ /** Folds a list: empty vs bound non-empty. */
159
+ export declare const matchEmpty: (m: {
160
+ of: FlowExpr;
161
+ whenEmpty: FlowExpr;
162
+ bind: SoftStr;
163
+ whenRest: FlowExpr;
164
+ }) => FlowExpr;
165
+ /** Folds an Option: none vs bound some. */
166
+ export declare const matchOption: (m: {
167
+ of: FlowExpr;
168
+ whenNone: FlowExpr;
169
+ bind: SoftStr;
170
+ whenSome: FlowExpr;
171
+ }) => FlowExpr;
172
+ /** Matchers for folding a {@link FlowExpr}. */
173
+ export declare const strLit$: () => {
174
+ __tag: "EStr";
175
+ type: "tag";
176
+ body: undefined;
177
+ };
178
+ export declare const numLit$: () => {
179
+ __tag: "ENum";
180
+ type: "tag";
181
+ body: undefined;
182
+ };
183
+ export declare const varRef$: () => {
184
+ __tag: "EVar";
185
+ type: "tag";
186
+ body: undefined;
187
+ };
188
+ export declare const sceneRows$: () => {
189
+ __tag: "ESceneRows";
190
+ type: "tag";
191
+ body: undefined;
192
+ };
193
+ export declare const mapKw$: () => {
194
+ __tag: "EProj";
195
+ type: "tag";
196
+ body: undefined;
197
+ };
198
+ export declare const getKw$: () => {
199
+ __tag: "EGet";
200
+ type: "tag";
201
+ body: undefined;
202
+ };
203
+ export declare const app$: () => {
204
+ __tag: "EApp";
205
+ type: "tag";
206
+ body: undefined;
207
+ };
208
+ export declare const okOf$: () => {
209
+ __tag: "EOk";
210
+ type: "tag";
211
+ body: undefined;
212
+ };
213
+ export declare const errOf$: () => {
214
+ __tag: "EErr";
215
+ type: "tag";
216
+ body: undefined;
217
+ };
218
+ export declare const someOf$: () => {
219
+ __tag: "ESome";
220
+ type: "tag";
221
+ body: undefined;
222
+ };
223
+ export declare const noneOf$: () => {
224
+ __tag: "ENone";
225
+ type: "tag";
226
+ body: undefined;
227
+ };
228
+ export declare const matchEmpty$: () => {
229
+ __tag: "EMatchEmpty";
230
+ type: "tag";
231
+ body: undefined;
232
+ };
233
+ export declare const matchOption$: () => {
234
+ __tag: "EMatchOption";
235
+ type: "tag";
236
+ body: undefined;
237
+ };
238
+ /**
239
+ * One step of a flow body: dispatch a Msg (and PAUSE
240
+ * until the scheduler settles), or bind a pure
241
+ * expression's value to a name for later steps.
242
+ */
243
+ export type FlowStep = Box<"DispatchStep", SchedulerMsg> | Box<"BindStep", Readonly<{
244
+ name: SoftStr;
245
+ expr: FlowExpr;
246
+ }>>;
247
+ /** A dispatch step (the flow's only world-touching口). */
248
+ export declare const dispatchStep: (msg: SchedulerMsg) => FlowStep;
249
+ /** A pure binding step. */
250
+ export declare const bindStep: (name: SoftStr, expr: FlowExpr) => FlowStep;
251
+ /** Matchers for folding a {@link FlowStep}. */
252
+ export declare const dispatchStep$: () => {
253
+ __tag: "DispatchStep";
254
+ type: "tag";
255
+ body: undefined;
256
+ };
257
+ export declare const bindStep$: () => {
258
+ __tag: "BindStep";
259
+ type: "tag";
260
+ body: undefined;
261
+ };
262
+ /**
263
+ * A whole flow: named steps run in order, then `result`
264
+ * evaluates to the flow's value. The unit `run_flow`
265
+ * (point 8) accepts, and the shape a paused continuation
266
+ * references by step index.
267
+ */
268
+ export type FlowScript = Readonly<{
269
+ name: SoftStr;
270
+ steps: ReadonlyArray<FlowStep>;
271
+ result: FlowExpr;
272
+ }>;
273
+ /** Constructs a {@link FlowScript}. */
274
+ export declare const flowScript: (s: {
275
+ name: SoftStr;
276
+ steps: ReadonlyArray<FlowStep>;
277
+ result: FlowExpr;
278
+ }) => FlowScript;
279
+ //# sourceMappingURL=script.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.d.ts","sourceRoot":"","sources":["../../../src/Flow/model/script.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,IAAI,EAIV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GACjB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GACpB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACnB,GAAG,CACD,OAAO,EACP,QAAQ,CAAC;IACP,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACjC,CAAC,CACH,GACD,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,GAChB,IAAI,CAAC,OAAO,CAAC,GACb,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC,GAC5C,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC,GAC1C,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEzB,iCAAiC;AACjC,eAAO,MAAM,IAAI,MAAO,OAAO,KAAG,SAClB,CAAC;AAEjB,iCAAiC;AACjC,eAAO,MAAM,IAAI,MAAO,MAAM,KAAG,SACjB,CAAC;AAEjB,+BAA+B;AAC/B,eAAO,MAAM,KAAK,UACT,aAAa,CAAC,SAAS,CAAC,KAC9B,SAAoC,CAAC;AAExC,iDAAiD;AACjD,eAAO,MAAM,IAAI,MAAO,GAAG,KAAG,SACd,CAAC;AAEjB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M,OAAO;;;;CAA2B,CAAC;AAChD,eAAO,MAAM,WAAW;;;;CACE,CAAC;AAC3B,eAAO,MAAM,YAAY;;;;CACE,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAChB,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,GACjC,GAAG,CACD,UAAU,EACV,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAC5C,CAAC;AAEN,yDAAyD;AACzD,eAAO,MAAM,YAAY,QAClB,YAAY,KAChB,QAAoC,CAAC;AAExC,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,SACb,OAAO,QACP,QAAQ,KACb,QAA2C,CAAC;AAE/C,+CAA+C;AAC/C,eAAO,MAAM,aAAa;;;;CACC,CAAC;AAC5B,eAAO,MAAM,SAAS;;;;CACC,CAAC;AAExB;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,EAAE,QAAQ,CAAC;CAClB,CAAC,CAAC;AAEH,uCAAuC;AACvC,eAAO,MAAM,UAAU,MAAO;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,EAAE,QAAQ,CAAC;CAClB,KAAG,UAAe,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type Scene } from "../../Schedule/model/Scene";
2
+ import { type FlowScript } from "../model/script";
3
+ import { type FlowOutcome, type PausedFlow } from "../model/run";
4
+ /**
5
+ * Starts a flow against the current settled scene with a
6
+ * fuel budget. Returns paused-on-first-dispatch, done, or
7
+ * failed — never throws.
8
+ */
9
+ export declare const startFlow: (script: FlowScript, scene: Scene, fuel: number) => FlowOutcome;
10
+ /**
11
+ * Resumes a paused flow with the scene the scheduler
12
+ * settled on after dispatching the paused Msg. The paused
13
+ * value is pure data — a JSON-revived copy resumes
14
+ * identically.
15
+ */
16
+ export declare const resumeFlow: (paused: PausedFlow, scene: Scene) => FlowOutcome;
17
+ //# sourceMappingURL=interpret.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interpret.d.ts","sourceRoot":"","sources":["../../../src/Flow/usecase/interpret.ts"],"names":[],"mappings":"AA0BA,OAAO,EACL,KAAK,KAAK,EAOX,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAIL,KAAK,UAAU,EAgChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,WAAW,EAEhB,KAAK,UAAU,EAMhB,MAAM,0BAA0B,CAAC;AA4pBlC;;;;GAIG;AACH,eAAO,MAAM,SAAS,WACZ,UAAU,SACX,KAAK,QACN,MAAM,KACX,WAC0C,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,UAAU,WACb,UAAU,SACX,KAAK,KACX,WAOA,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { type SoftStr, type Result, type Box } from "plgg";
2
+ import { type SemDiagnostic } from "plgg-ir-language";
3
+ import { type FlowScript } from "../model/script";
4
+ import { type FlowSchema } from "../model/forms";
5
+ /**
6
+ * The static layer's reader: flow DSL text → a checked,
7
+ * normalized {@link FlowScript}, or accumulated positioned
8
+ * diagnostics. Total — never throws.
9
+ *
10
+ * Parsing is `plgg-ir-syntax` (the shared S-expression
11
+ * grammar and its ranged diagnostics) and diagnostics are
12
+ * `plgg-ir-language`'s `SemDiagnostic` vocabulary (its code
13
+ * constants + `fromSyntaxDiagnostic`); type checking runs
14
+ * on a structural {@link FlowType} (the manifest `SemType`
15
+ * vocabulary is reserved for the manifest lowering, not
16
+ * spent on v1's numeric/not distinction). Collection,
17
+ * choice, and field names resolve against the manifest-
18
+ * shaped {@link FlowSchema} (the seeded binding set) — the
19
+ * cross-dialect seam a compiled manifest will feed. (The
20
+ * manifest exports a `Language<Module>`, not a composable
21
+ * `Dialect`, so `compose` onto it is unavailable via the
22
+ * public API and unsound anyway; scope-seeding is the
23
+ * seam — see the ticket's recorded findings.)
24
+ *
25
+ * v1 surface: `(flow <name> <step>* <result-expr>)` where
26
+ * a step is `(dispatch <msg>)` or `(let <name> <expr>)`,
27
+ * and folds are explicit `(match-empty …)` /
28
+ * `(match-option …)` forms (a 1:1-to-`FlowScript` surface
29
+ * over `dsl-v1-core.md` §6's sugar).
30
+ */
31
+ /** A structural flow type (containers nest; leaves are str/num/row). */
32
+ export type FlowType = Box<"TStr", null> | Box<"TNum", null> | Box<"TRow", SoftStr> | Box<"TList", Readonly<{
33
+ el: FlowType;
34
+ }>> | Box<"TOption", Readonly<{
35
+ el: FlowType;
36
+ }>> | Box<"TResult", Readonly<{
37
+ el: FlowType;
38
+ }>>;
39
+ type Diags = ReadonlyArray<SemDiagnostic>;
40
+ /**
41
+ * Reads flow DSL text into a checked {@link FlowScript}.
42
+ * Expects exactly one top-level `(flow <name> …)` form.
43
+ */
44
+ export declare const readFlow: (source: SoftStr, schema: FlowSchema) => Result<FlowScript, Diags>;
45
+ export {};
46
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/Flow/usecase/read.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,MAAM,EACX,KAAK,GAAG,EAUT,MAAM,MAAM,CAAC;AAWd,OAAO,EACL,KAAK,aAAa,EAQnB,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAGL,KAAK,UAAU,EAmBhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,wEAAwE;AACxE,MAAM,MAAM,QAAQ,GAChB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GACjB,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,GACjB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GACpB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC,GACxC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC,GAC1C,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC,CAAC;AAmB/C,KAAK,KAAK,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;AAo9B1C;;;GAGG;AACH,eAAO,MAAM,QAAQ,WACX,OAAO,UACP,UAAU,KACjB,MAAM,CAAC,UAAU,EAAE,KAAK,CAsE1B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The plggmatic Form module (ticket 12): the headless
3
+ * form machinery the control components render against —
4
+ * the caster-parse fold ("parse, don't validate": the
5
+ * only validation is the cast that produces the typed
6
+ * payload), the control-kind and submission-state unions,
7
+ * and the form assembly. DOM-free where it can be; the
8
+ * views compose plgg-view element builders.
9
+ */
10
+ export { type ControlKind, controlKinds, } from "./model/control";
11
+ export { type SubmissionState, idleSubmission, pendingSubmission, isPending, } from "./model/submission";
12
+ export { type FieldSpec, type FormErrors, type Payload, parseForm, errorFor, } from "./usecase/parseForm";
13
+ export { type FormViewProps, formView, } from "./usecase/formView";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Form/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,KAAK,WAAW,EAChB,YAAY,GACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,iBAAiB,EACjB,SAAS,GACV,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,OAAO,EACZ,SAAS,EACT,QAAQ,GACT,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The kind of form control a {@link Field} renders — a
3
+ * closed union so a renderer's `match` is exhaustive and
4
+ * a new control kind cannot be added without every
5
+ * interpreter site acknowledging it.
6
+ */
7
+ export type ControlKind = "text" | "textarea" | "select" | "checkbox";
8
+ export declare const controlKinds: ReadonlyArray<ControlKind>;
9
+ //# sourceMappingURL=control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/Form/model/control.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GACrB,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE9C,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,WAAW,CACR,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type Icon } from "plgg";
2
+ /**
3
+ * A form's submission state — a closed union so pending
4
+ * cannot be confused with idle and a renderer must handle
5
+ * both. `Pending` disables every control and the submit
6
+ * button and withholds hover/press feedback; the action's
7
+ * completion `Msg` folds the `Result` back to `Idle`. The
8
+ * scheduler (ticket 09) owns the action LIFECYCLE; this
9
+ * is the local view state a form control reads to disable
10
+ * itself, not a second action state machine.
11
+ */
12
+ export type SubmissionState = Icon<"Idle"> | Icon<"Pending">;
13
+ /** The idle submission state. */
14
+ export declare const idleSubmission: () => SubmissionState;
15
+ /** The pending submission state (in flight). */
16
+ export declare const pendingSubmission: () => SubmissionState;
17
+ /** Matchers for folding a {@link SubmissionState}. */
18
+ export declare const idleSubmission$: () => {
19
+ __tag: "Idle";
20
+ type: "tag";
21
+ body: undefined;
22
+ };
23
+ export declare const pendingSubmission$: () => {
24
+ __tag: "Pending";
25
+ type: "tag";
26
+ body: undefined;
27
+ };
28
+ /** Whether the form is currently submitting. */
29
+ export declare const isPending: (s: SubmissionState) => boolean;
30
+ //# sourceMappingURL=submission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"submission.d.ts","sourceRoot":"","sources":["../../../src/Form/model/submission.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAIV,MAAM,MAAM,CAAC;AAEd;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GACzB,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AAEjC,iCAAiC;AACjC,eAAO,MAAM,cAAc,QACrB,eAA+B,CAAC;AAEtC,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,QACxB,eAAkC,CAAC;AAEzC,sDAAsD;AACtD,eAAO,MAAM,eAAe;;;;CACT,CAAC;AACpB,eAAO,MAAM,kBAAkB;;;;CACT,CAAC;AAEvB,gDAAgD;AAChD,eAAO,MAAM,SAAS,MACjB,eAAe,KACjB,OAIA,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type SoftStr, type Option } from "plgg";
2
+ import { type Html, type Attribute } from "plgg-view";
3
+ /**
4
+ * The shared accessibility + labelling pieces every form
5
+ * control uses (ticket 12), so label association, the
6
+ * `aria-invalid`/`aria-describedby` error wiring, and the
7
+ * `danger`-role error text are framework-owned and
8
+ * identical across `textInput`/`textArea`/`selectInput`/
9
+ * `checkbox` — spec-asserted once here.
10
+ */
11
+ /** The `<label for=name>` associated with a control by id. */
12
+ export declare const fieldLabel: <Msg>(name: SoftStr, labelText: SoftStr) => Html<Msg, "label">;
13
+ /**
14
+ * The id a control's error text carries and its
15
+ * `aria-describedby` points at.
16
+ */
17
+ export declare const errorId: (name: SoftStr) => SoftStr;
18
+ /**
19
+ * The `aria-invalid` + `aria-describedby` attributes when
20
+ * the field has an error (empty otherwise) — spread into
21
+ * the control's attribute list.
22
+ */
23
+ export declare const errorAria: (name: SoftStr, error: Option<SoftStr>) => ReadonlyArray<Attribute<never>>;
24
+ /**
25
+ * The error text node (in the `danger` text role),
26
+ * carrying the id `aria-describedby` references. Empty
27
+ * when there is no error.
28
+ */
29
+ export declare const fieldError: <Msg>(name: SoftStr, error: Option<SoftStr>) => ReadonlyArray<Html<Msg>>;
30
+ //# sourceMappingURL=controlParts.d.ts.map