plggmatic 0.2.1 → 0.2.2
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/dist/Catalog/index.d.ts +17 -0
- package/dist/Catalog/index.d.ts.map +1 -0
- package/dist/Catalog/model/tool.d.ts +101 -0
- package/dist/Catalog/model/tool.d.ts.map +1 -0
- package/dist/Catalog/usecase/adapter.d.ts +81 -0
- package/dist/Catalog/usecase/adapter.d.ts.map +1 -0
- package/dist/Catalog/usecase/catalog.d.ts +43 -0
- package/dist/Catalog/usecase/catalog.d.ts.map +1 -0
- package/dist/Catalog/usecase/runFlow.d.ts +77 -0
- package/dist/Catalog/usecase/runFlow.d.ts.map +1 -0
- package/dist/Component/index.d.ts +28 -0
- package/dist/Component/index.d.ts.map +1 -0
- package/dist/Component/model/interaction.d.ts +41 -0
- package/dist/Component/model/interaction.d.ts.map +1 -0
- package/dist/Component/model/navItem.d.ts +16 -0
- package/dist/Component/model/navItem.d.ts.map +1 -0
- package/dist/Component/usecase/breadcrumb.d.ts +26 -0
- package/dist/Component/usecase/breadcrumb.d.ts.map +1 -0
- package/dist/Component/usecase/button.d.ts +27 -0
- package/dist/Component/usecase/button.d.ts.map +1 -0
- package/dist/Component/usecase/checkbox.d.ts +20 -0
- package/dist/Component/usecase/checkbox.d.ts.map +1 -0
- package/dist/Component/usecase/colHead.d.ts +28 -0
- package/dist/Component/usecase/colHead.d.ts.map +1 -0
- package/dist/Component/usecase/confirmDialog.d.ts +25 -0
- package/dist/Component/usecase/confirmDialog.d.ts.map +1 -0
- package/dist/Component/usecase/navTree.d.ts +21 -0
- package/dist/Component/usecase/navTree.d.ts.map +1 -0
- package/dist/Component/usecase/selectInput.d.ts +28 -0
- package/dist/Component/usecase/selectInput.d.ts.map +1 -0
- package/dist/Component/usecase/textArea.d.ts +22 -0
- package/dist/Component/usecase/textArea.d.ts.map +1 -0
- package/dist/Component/usecase/textInput.d.ts +23 -0
- package/dist/Component/usecase/textInput.d.ts.map +1 -0
- package/dist/Component/usecase/textLink.d.ts +26 -0
- package/dist/Component/usecase/textLink.d.ts.map +1 -0
- package/dist/Component/usecase/themeToggle.d.ts +70 -0
- package/dist/Component/usecase/themeToggle.d.ts.map +1 -0
- package/dist/Component/usecase/toast.d.ts +32 -0
- package/dist/Component/usecase/toast.d.ts.map +1 -0
- package/dist/Component/usecase/typography.d.ts +33 -0
- package/dist/Component/usecase/typography.d.ts.map +1 -0
- package/dist/Declare/model/Action.d.ts +91 -0
- package/dist/Declare/model/Action.d.ts.map +1 -0
- package/dist/Declare/model/Adapter.d.ts +107 -0
- package/dist/Declare/model/Adapter.d.ts.map +1 -0
- package/dist/Declare/model/Collection.d.ts +55 -0
- package/dist/Declare/model/Collection.d.ts.map +1 -0
- package/dist/Declare/model/Declaration.d.ts +27 -0
- package/dist/Declare/model/Declaration.d.ts.map +1 -0
- package/dist/Declare/model/Menu.d.ts +21 -0
- package/dist/Declare/model/Menu.d.ts.map +1 -0
- package/dist/Declare/model/Query.d.ts +56 -0
- package/dist/Declare/model/Query.d.ts.map +1 -0
- package/dist/Declare/model/Row.d.ts +129 -0
- package/dist/Declare/model/Row.d.ts.map +1 -0
- package/dist/Declare/model/Source.d.ts +83 -0
- package/dist/Declare/model/Source.d.ts.map +1 -0
- package/dist/Declare/usecase/apply.d.ts +23 -0
- package/dist/Declare/usecase/apply.d.ts.map +1 -0
- package/dist/Declare/usecase/project.d.ts +66 -0
- package/dist/Declare/usecase/project.d.ts.map +1 -0
- package/dist/Declare/usecase/reconcile.d.ts +63 -0
- package/dist/Declare/usecase/reconcile.d.ts.map +1 -0
- package/dist/Flow/model/forms.d.ts +45 -0
- package/dist/Flow/model/forms.d.ts.map +1 -0
- package/dist/Flow/model/run.d.ts +74 -0
- package/dist/Flow/model/run.d.ts.map +1 -0
- package/dist/Flow/model/script.d.ts +279 -0
- package/dist/Flow/model/script.d.ts.map +1 -0
- package/dist/Flow/usecase/interpret.d.ts +17 -0
- package/dist/Flow/usecase/interpret.d.ts.map +1 -0
- package/dist/Flow/usecase/read.d.ts +46 -0
- package/dist/Flow/usecase/read.d.ts.map +1 -0
- package/dist/Form/index.d.ts +14 -0
- package/dist/Form/index.d.ts.map +1 -0
- package/dist/Form/model/control.d.ts +9 -0
- package/dist/Form/model/control.d.ts.map +1 -0
- package/dist/Form/model/submission.d.ts +30 -0
- package/dist/Form/model/submission.d.ts.map +1 -0
- package/dist/Form/usecase/controlParts.d.ts +30 -0
- package/dist/Form/usecase/controlParts.d.ts.map +1 -0
- package/dist/Form/usecase/formView.d.ts +21 -0
- package/dist/Form/usecase/formView.d.ts.map +1 -0
- package/dist/Form/usecase/parseForm.d.ts +28 -0
- package/dist/Form/usecase/parseForm.d.ts.map +1 -0
- package/dist/Layout/index.d.ts +16 -0
- package/dist/Layout/index.d.ts.map +1 -0
- package/dist/Layout/model/pane.d.ts +15 -0
- package/dist/Layout/model/pane.d.ts.map +1 -0
- package/dist/Layout/usecase/combinators.d.ts +49 -0
- package/dist/Layout/usecase/combinators.d.ts.map +1 -0
- package/dist/Meta/model/identity.d.ts +16 -0
- package/dist/Meta/model/identity.d.ts.map +1 -0
- package/dist/Render/index.d.ts +17 -0
- package/dist/Render/index.d.ts.map +1 -0
- package/dist/Render/model/mode.d.ts +13 -0
- package/dist/Render/model/mode.d.ts.map +1 -0
- package/dist/Render/model/screen.d.ts +27 -0
- package/dist/Render/model/screen.d.ts.map +1 -0
- package/dist/Render/usecase/multiColumn.d.ts +52 -0
- package/dist/Render/usecase/multiColumn.d.ts.map +1 -0
- package/dist/Render/usecase/parts.d.ts +56 -0
- package/dist/Render/usecase/parts.d.ts.map +1 -0
- package/dist/Render/usecase/renderMode.d.ts +17 -0
- package/dist/Render/usecase/renderMode.d.ts.map +1 -0
- package/dist/Render/usecase/singleColumn.d.ts +20 -0
- package/dist/Render/usecase/singleColumn.d.ts.map +1 -0
- package/dist/Schedule/model/Model.d.ts +103 -0
- package/dist/Schedule/model/Model.d.ts.map +1 -0
- package/dist/Schedule/model/Msg.d.ts +131 -0
- package/dist/Schedule/model/Msg.d.ts.map +1 -0
- package/dist/Schedule/model/Scene.d.ts +190 -0
- package/dist/Schedule/model/Scene.d.ts.map +1 -0
- package/dist/Schedule/model/View.d.ts +54 -0
- package/dist/Schedule/model/View.d.ts.map +1 -0
- package/dist/Schedule/usecase/chain.d.ts +16 -0
- package/dist/Schedule/usecase/chain.d.ts.map +1 -0
- package/dist/Schedule/usecase/codec.d.ts +44 -0
- package/dist/Schedule/usecase/codec.d.ts.map +1 -0
- package/dist/Schedule/usecase/lower.d.ts +45 -0
- package/dist/Schedule/usecase/lower.d.ts.map +1 -0
- package/dist/Schedule/usecase/scene.d.ts +16 -0
- package/dist/Schedule/usecase/scene.d.ts.map +1 -0
- package/dist/Schedule/usecase/schedule.d.ts +72 -0
- package/dist/Schedule/usecase/schedule.d.ts.map +1 -0
- package/dist/Schedule/usecase/update.d.ts +39 -0
- package/dist/Schedule/usecase/update.d.ts.map +1 -0
- package/dist/Style/index.d.ts +30 -0
- package/dist/Style/index.d.ts.map +1 -0
- package/dist/Style/model/appearance.d.ts +23 -0
- package/dist/Style/model/appearance.d.ts.map +1 -0
- package/dist/Style/model/breakpoint.d.ts +43 -0
- package/dist/Style/model/breakpoint.d.ts.map +1 -0
- package/dist/Style/model/hexColor.d.ts +24 -0
- package/dist/Style/model/hexColor.d.ts.map +1 -0
- package/dist/Style/model/metric.d.ts +35 -0
- package/dist/Style/model/metric.d.ts.map +1 -0
- package/dist/Style/model/palette.d.ts +38 -0
- package/dist/Style/model/palette.d.ts.map +1 -0
- package/dist/Style/model/scheme.d.ts +26 -0
- package/dist/Style/model/scheme.d.ts.map +1 -0
- package/dist/Style/model/syntax.d.ts +54 -0
- package/dist/Style/model/syntax.d.ts.map +1 -0
- package/dist/Style/model/theme.d.ts +58 -0
- package/dist/Style/model/theme.d.ts.map +1 -0
- package/dist/Style/model/token.d.ts +142 -0
- package/dist/Style/model/token.d.ts.map +1 -0
- package/dist/Style/model/typography.d.ts +83 -0
- package/dist/Style/model/typography.d.ts.map +1 -0
- package/dist/Style/model/zIndex.d.ts +25 -0
- package/dist/Style/model/zIndex.d.ts.map +1 -0
- package/dist/Style/usecase/appearanceScript.d.ts +43 -0
- package/dist/Style/usecase/appearanceScript.d.ts.map +1 -0
- package/dist/Style/usecase/chromeCss.d.ts +41 -0
- package/dist/Style/usecase/chromeCss.d.ts.map +1 -0
- package/dist/Style/usecase/contrast.d.ts +3 -0
- package/dist/Style/usecase/contrast.d.ts.map +1 -0
- package/dist/Style/usecase/metricCss.d.ts +17 -0
- package/dist/Style/usecase/metricCss.d.ts.map +1 -0
- package/dist/Style/usecase/reducedMotion.d.ts +20 -0
- package/dist/Style/usecase/reducedMotion.d.ts.map +1 -0
- package/dist/Style/usecase/schemeCss.d.ts +25 -0
- package/dist/Style/usecase/schemeCss.d.ts.map +1 -0
- package/dist/Style/usecase/syntaxCss.d.ts +14 -0
- package/dist/Style/usecase/syntaxCss.d.ts.map +1 -0
- package/dist/Style/usecase/utilities.d.ts +98 -0
- package/dist/Style/usecase/utilities.d.ts.map +1 -0
- package/dist/brand.d.ts +29 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +4427 -0
- package/dist/styleEntry.d.ts +29 -0
- package/dist/styleEntry.d.ts.map +1 -0
- package/dist/styleEntry.es.js +1036 -0
- package/package.json +4 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Row } from "./Row";
|
|
3
|
+
/**
|
|
4
|
+
* One declared choice filter of a {@link Query} — a typed
|
|
5
|
+
* query field (mission decision, 2026-07-12, point 4):
|
|
6
|
+
* `id` names the URL parameter and the input Msg, `label`
|
|
7
|
+
* captions the control, `field` names the row field the
|
|
8
|
+
* closed equality test reads, and `options` is the
|
|
9
|
+
* declared, closed value set (WebMCP tool schemas derive
|
|
10
|
+
* their enumerations from it).
|
|
11
|
+
*/
|
|
12
|
+
export type QueryChoice = Readonly<{
|
|
13
|
+
id: SoftStr;
|
|
14
|
+
label: SoftStr;
|
|
15
|
+
field: SoftStr;
|
|
16
|
+
options: ReadonlyArray<SoftStr>;
|
|
17
|
+
}>;
|
|
18
|
+
/** Constructs a {@link QueryChoice}. */
|
|
19
|
+
export declare const queryChoice: (id: SoftStr, label: SoftStr, field: SoftStr, options: ReadonlyArray<SoftStr>) => QueryChoice;
|
|
20
|
+
/**
|
|
21
|
+
* A declarative filter over a {@link Collection}'s rows:
|
|
22
|
+
* a keyword (case-insensitive substring over `Row.label`)
|
|
23
|
+
* plus the declared {@link QueryChoice} filters. The live
|
|
24
|
+
* values live in the scheduled model and are reflected
|
|
25
|
+
* into the URL, so a filtered arrangement is a shareable
|
|
26
|
+
* address. Client-side evaluation is CLOSED to this pair
|
|
27
|
+
* — substring for the keyword, equality for a choice;
|
|
28
|
+
* predicate expressions belong to the manifest/DSL and
|
|
29
|
+
* execute at the source.
|
|
30
|
+
*/
|
|
31
|
+
export type Query = Readonly<{
|
|
32
|
+
placeholder: SoftStr;
|
|
33
|
+
choices: ReadonlyArray<QueryChoice>;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Constructs a {@link Query}. The historical
|
|
37
|
+
* one-argument form is the degenerate keyword-only
|
|
38
|
+
* declaration.
|
|
39
|
+
*/
|
|
40
|
+
export declare const query: (placeholder: SoftStr, choices?: ReadonlyArray<QueryChoice>) => Query;
|
|
41
|
+
/**
|
|
42
|
+
* Whether a row label matches a query text — the shared
|
|
43
|
+
* filter semantics. Empty text matches everything (an
|
|
44
|
+
* empty filter is not a filter). Case-insensitive
|
|
45
|
+
* substring, so it is total and never throws.
|
|
46
|
+
*/
|
|
47
|
+
export declare const matchesQuery: (text: SoftStr, label: SoftStr) => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a row satisfies one chosen choice value — the
|
|
50
|
+
* closed equality half of the query semantics: the row
|
|
51
|
+
* field labelled `field` must display exactly the chosen
|
|
52
|
+
* value. An empty choice matches everything; a row
|
|
53
|
+
* without the field matches nothing (total either way).
|
|
54
|
+
*/
|
|
55
|
+
export declare const matchesChoice: (chosen: SoftStr, field: SoftStr, row: Row) => boolean;
|
|
56
|
+
//# sourceMappingURL=Query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../src/Declare/model/Query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,GAAG,EAGT,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC,CAAC;AAEH,wCAAwC;AACxC,eAAO,MAAM,WAAW,GACtB,IAAI,OAAO,EACX,OAAO,OAAO,EACd,OAAO,OAAO,EACd,SAAS,aAAa,CAAC,OAAO,CAAC,KAC9B,WAA8C,CAAC;AAElD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CACrC,CAAC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAChB,aAAa,OAAO,EACpB,UAAS,aAAa,CAAC,WAAW,CAAM,KACvC,KAAmC,CAAC;AAEvC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,OAAO,EACb,OAAO,OAAO,KACb,OAI8B,CAAC;AAElC;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,OAAO,EACf,OAAO,OAAO,EACd,KAAK,GAAG,KACP,OAMA,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { type SoftStr, type Box, type Option } from "plgg";
|
|
2
|
+
/**
|
|
3
|
+
* A field's typed value — the CLOSED union the typed-field
|
|
4
|
+
* decision fixed (mission changelog, 2026-07-12, point 3).
|
|
5
|
+
* A detail cell stops being a bare string: renderers fold
|
|
6
|
+
* this union exhaustively (a new kind is a compile error
|
|
7
|
+
* at every renderer) and WebMCP field schemas derive from
|
|
8
|
+
* the same vocabulary. The members mirror the manifest
|
|
9
|
+
* field types the lowering will map onto: string → `Text`,
|
|
10
|
+
* numeric/money → `Num`, boolean → `Flag`, date/time →
|
|
11
|
+
* `Moment`, relation/domain-id → `Reference`, media →
|
|
12
|
+
* `Media`.
|
|
13
|
+
*
|
|
14
|
+
* `Reference` is the decided cross-link jump realized at
|
|
15
|
+
* the field seam: it names a collection and a row id (a
|
|
16
|
+
* `Binding`, structurally), and the scene resolves it to
|
|
17
|
+
* the target's CANONICAL address — activation is a jump,
|
|
18
|
+
* never a walk.
|
|
19
|
+
*/
|
|
20
|
+
export type FieldValue = Box<"Text", SoftStr> | Box<"Num", Readonly<{
|
|
21
|
+
value: SoftStr;
|
|
22
|
+
unit: Option<SoftStr>;
|
|
23
|
+
}>> | Box<"Flag", boolean> | Box<"Moment", SoftStr> | Box<"Reference", Readonly<{
|
|
24
|
+
collection: SoftStr;
|
|
25
|
+
id: SoftStr;
|
|
26
|
+
label: SoftStr;
|
|
27
|
+
}>> | Box<"Media", Readonly<{
|
|
28
|
+
src: SoftStr;
|
|
29
|
+
alt: SoftStr;
|
|
30
|
+
}>>;
|
|
31
|
+
/** A plain text value. */
|
|
32
|
+
export declare const textValue: (value: SoftStr) => FieldValue;
|
|
33
|
+
/** A numeric value (pre-formatted) with an optional unit. */
|
|
34
|
+
export declare const numValue: (value: SoftStr, unit?: SoftStr) => FieldValue;
|
|
35
|
+
/** A yes/no value. */
|
|
36
|
+
export declare const flagValue: (value: boolean) => FieldValue;
|
|
37
|
+
/** A date/time value (ISO string). */
|
|
38
|
+
export declare const momentValue: (value: SoftStr) => FieldValue;
|
|
39
|
+
/**
|
|
40
|
+
* A reference to another collection's row — activation
|
|
41
|
+
* jumps to the target's canonical address.
|
|
42
|
+
*/
|
|
43
|
+
export declare const refValue: (collection: SoftStr, id: SoftStr, label: SoftStr) => FieldValue;
|
|
44
|
+
/** A media value (image source + alternative text). */
|
|
45
|
+
export declare const mediaValue: (src: SoftStr, alt: SoftStr) => FieldValue;
|
|
46
|
+
/** Matchers for folding a {@link FieldValue}. */
|
|
47
|
+
export declare const textValue$: () => {
|
|
48
|
+
__tag: "Text";
|
|
49
|
+
type: "tag";
|
|
50
|
+
body: undefined;
|
|
51
|
+
};
|
|
52
|
+
export declare const numValue$: () => {
|
|
53
|
+
__tag: "Num";
|
|
54
|
+
type: "tag";
|
|
55
|
+
body: undefined;
|
|
56
|
+
};
|
|
57
|
+
export declare const flagValue$: () => {
|
|
58
|
+
__tag: "Flag";
|
|
59
|
+
type: "tag";
|
|
60
|
+
body: undefined;
|
|
61
|
+
};
|
|
62
|
+
export declare const momentValue$: () => {
|
|
63
|
+
__tag: "Moment";
|
|
64
|
+
type: "tag";
|
|
65
|
+
body: undefined;
|
|
66
|
+
};
|
|
67
|
+
export declare const refValue$: () => {
|
|
68
|
+
__tag: "Reference";
|
|
69
|
+
type: "tag";
|
|
70
|
+
body: undefined;
|
|
71
|
+
};
|
|
72
|
+
export declare const mediaValue$: () => {
|
|
73
|
+
__tag: "Media";
|
|
74
|
+
type: "tag";
|
|
75
|
+
body: undefined;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* One labelled cell of a {@link Row}'s detail. `label`
|
|
79
|
+
* may be empty (a body paragraph has a value but no
|
|
80
|
+
* caption) — the emptiness is presentation. The value is
|
|
81
|
+
* a typed {@link FieldValue}; the plain-string
|
|
82
|
+
* {@link field} constructor lowers to `Text`, so the
|
|
83
|
+
* historical string shape keeps working.
|
|
84
|
+
*/
|
|
85
|
+
export type Field = Readonly<{
|
|
86
|
+
label: SoftStr;
|
|
87
|
+
value: FieldValue;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* The presentation-neutral projection of a collection
|
|
91
|
+
* item — the ONLY item shape the scheduled model and the
|
|
92
|
+
* renderer seam ever see (a typed `T` lives only at the
|
|
93
|
+
* {@link Collection} boundary, captured by its `toRow`).
|
|
94
|
+
* `label` is what a list shows; `fields` is what a detail
|
|
95
|
+
* shows; `id` is the item identity used as the URL and
|
|
96
|
+
* selection key. Mirrors the oracle's discipline: the
|
|
97
|
+
* model holds ids, never the domain objects.
|
|
98
|
+
*/
|
|
99
|
+
export type Row = Readonly<{
|
|
100
|
+
id: SoftStr;
|
|
101
|
+
label: SoftStr;
|
|
102
|
+
fields: ReadonlyArray<Field>;
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Constructs a plain-text {@link Field} — the historical
|
|
106
|
+
* string shape, lowered to a `Text` value.
|
|
107
|
+
*/
|
|
108
|
+
export declare const field: (label: SoftStr, value: SoftStr) => Field;
|
|
109
|
+
/** Constructs a {@link Field} with a typed value. */
|
|
110
|
+
export declare const fieldOf: (label: SoftStr, value: FieldValue) => Field;
|
|
111
|
+
/** Constructs a {@link Row}. */
|
|
112
|
+
export declare const row: (id: SoftStr, label: SoftStr, fields?: ReadonlyArray<Field>) => Row;
|
|
113
|
+
/**
|
|
114
|
+
* The reference target of a value, if it is one — the
|
|
115
|
+
* seam the scene uses to resolve a `Reference` into the
|
|
116
|
+
* href of its target's canonical address. `None` for
|
|
117
|
+
* every non-reference kind.
|
|
118
|
+
*/
|
|
119
|
+
export declare const refTarget: (value: FieldValue) => Option<Readonly<{
|
|
120
|
+
collection: SoftStr;
|
|
121
|
+
id: SoftStr;
|
|
122
|
+
}>>;
|
|
123
|
+
/**
|
|
124
|
+
* A {@link FieldValue}'s display text — the one total
|
|
125
|
+
* string projection shared by renderers and tests
|
|
126
|
+
* (references show their label; media its alt text).
|
|
127
|
+
*/
|
|
128
|
+
export declare const fieldText: (value: FieldValue) => SoftStr;
|
|
129
|
+
//# sourceMappingURL=Row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/Declare/model/Row.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,MAAM,EAQZ,MAAM,MAAM,CAAC;AAEd;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GACpB,GAAG,CACD,KAAK,EACL,QAAQ,CAAC;IACP,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACvB,CAAC,CACH,GACD,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GACpB,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,GACtB,GAAG,CACD,WAAW,EACX,QAAQ,CAAC;IACP,UAAU,EAAE,OAAO,CAAC;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC,CACH,GACD,GAAG,CACD,OAAO,EACP,QAAQ,CAAC;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAAC,CACzC,CAAC;AAEN,0BAA0B;AAC1B,eAAO,MAAM,SAAS,GACpB,OAAO,OAAO,KACb,UAAgC,CAAC;AAEpC,6DAA6D;AAC7D,eAAO,MAAM,QAAQ,GACnB,OAAO,OAAO,EACd,OAAO,OAAO,KACb,UAIC,CAAC;AAEL,sBAAsB;AACtB,eAAO,MAAM,SAAS,GACpB,OAAO,OAAO,KACb,UAAgC,CAAC;AAEpC,sCAAsC;AACtC,eAAO,MAAM,WAAW,GACtB,OAAO,OAAO,KACb,UAAkC,CAAC;AAEt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,OAAO,CAAA;CAAE,CAAC,CA+B7C,CAAC;AAOJ;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACpB,OAAO,UAAU,KAChB,OAgCA,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type SoftStr, type Box, type Option, type Result } from "plgg";
|
|
2
|
+
import { type Row } from "./Row";
|
|
3
|
+
/**
|
|
4
|
+
* The ancestor selections a source reads against, root→
|
|
5
|
+
* parent — so a child collection (notes) filters by its
|
|
6
|
+
* parent selection (a section id) WITHOUT the model
|
|
7
|
+
* storing the parent object. Empty at the root.
|
|
8
|
+
*/
|
|
9
|
+
export type Path = ReadonlyArray<SoftStr>;
|
|
10
|
+
/**
|
|
11
|
+
* A typed data-access seam over items `T`. Four shapes:
|
|
12
|
+
* `Sync` is an in-memory read, `Async` a deferred
|
|
13
|
+
* (`proc`/Promise-folded-to-`Result`) read the scheduler
|
|
14
|
+
* runs as a `Cmd` (design tenet e — swapping `Sync` for
|
|
15
|
+
* `Async` never rewrites the app), and `Dynamic` is a
|
|
16
|
+
* consumer-OWNED collection whose rows live in the model's
|
|
17
|
+
* slot rather than being read from a fixed thunk. `Dynamic`
|
|
18
|
+
* carries no read: the scheduler PRESERVES its slot on
|
|
19
|
+
* re-read, and the consumer supplies/updates the rows from
|
|
20
|
+
* data ITS Model owns via `Scheduled.withRows` — so a
|
|
21
|
+
* record created at runtime lives in the Model and
|
|
22
|
+
* `update` stays a pure `(msg, model) → [model, cmd]`
|
|
23
|
+
* instead of forcing a module-global store (ticket
|
|
24
|
+
* 20260708192518). `Sync`/`Async` are unchanged; a third
|
|
25
|
+
* variant never rewrites an existing consumer.
|
|
26
|
+
*/
|
|
27
|
+
export type TypedSource<T> = Box<"Sync", (path: Path) => ReadonlyArray<T>> | Box<"Async", (path: Path) => Promise<Result<ReadonlyArray<T>, Error>>> | Box<"Dynamic", null> | Box<"Adapter", Option<SoftStr>>;
|
|
28
|
+
/**
|
|
29
|
+
* The erased, `Row`-valued source the scheduler consumes
|
|
30
|
+
* (a {@link TypedSource} with its items already projected
|
|
31
|
+
* through the collection's `toRow`). Same two variants,
|
|
32
|
+
* so the sync/async symmetry survives erasure.
|
|
33
|
+
*/
|
|
34
|
+
export type Source = Box<"Sync", (path: Path) => ReadonlyArray<Row>> | Box<"Async", (path: Path) => Promise<Result<ReadonlyArray<Row>, Error>>> | Box<"Dynamic", null> | Box<"Adapter", Option<SoftStr>>;
|
|
35
|
+
/** A synchronous typed source. */
|
|
36
|
+
export declare const sync: <T>(read: (path: Path) => ReadonlyArray<T>) => TypedSource<T>;
|
|
37
|
+
/** A deferred typed source (folded to a `Cmd`). */
|
|
38
|
+
export declare const async: <T>(read: (path: Path) => Promise<Result<ReadonlyArray<T>, Error>>) => TypedSource<T>;
|
|
39
|
+
/**
|
|
40
|
+
* A consumer-owned (Model-driven) source: the collection's
|
|
41
|
+
* rows live in the scheduler slot, seeded/updated by the
|
|
42
|
+
* consumer from data ITS Model owns via
|
|
43
|
+
* `Scheduled.withRows`, and PRESERVED across navigation.
|
|
44
|
+
* Carries no read thunk (hence `null`) — the point is that
|
|
45
|
+
* no fixed thunk closes over external state, so the
|
|
46
|
+
* consumer's `update` stays pure.
|
|
47
|
+
*/
|
|
48
|
+
export declare const dynamic: <T>() => TypedSource<T>;
|
|
49
|
+
/**
|
|
50
|
+
* A host-adapter source (point 7): the collection's rows
|
|
51
|
+
* come from a registered {@link HostAdapter}'s `read`, run
|
|
52
|
+
* as a deferred `Cmd` exactly like `Async`. The optional
|
|
53
|
+
* `name` selects a NAMED adapter; omitting it reads the
|
|
54
|
+
* DEFAULT (the sole registration) — the common
|
|
55
|
+
* single-backend case names nothing. The read carries no
|
|
56
|
+
* thunk here (the adapter lives in the registry, resolved
|
|
57
|
+
* at read time); an unresolved name is reported by the
|
|
58
|
+
* startup reconciliation and, defensively, lands a Failed
|
|
59
|
+
* slot rather than throwing.
|
|
60
|
+
*/
|
|
61
|
+
export declare const adapter: <T>(name?: SoftStr) => TypedSource<T>;
|
|
62
|
+
/** Matchers for folding a {@link Source}. */
|
|
63
|
+
export declare const sync$: () => {
|
|
64
|
+
__tag: "Sync";
|
|
65
|
+
type: "tag";
|
|
66
|
+
body: undefined;
|
|
67
|
+
};
|
|
68
|
+
export declare const async$: () => {
|
|
69
|
+
__tag: "Async";
|
|
70
|
+
type: "tag";
|
|
71
|
+
body: undefined;
|
|
72
|
+
};
|
|
73
|
+
export declare const dynamic$: () => {
|
|
74
|
+
__tag: "Dynamic";
|
|
75
|
+
type: "tag";
|
|
76
|
+
body: undefined;
|
|
77
|
+
};
|
|
78
|
+
export declare const adapter$: () => {
|
|
79
|
+
__tag: "Adapter";
|
|
80
|
+
type: "tag";
|
|
81
|
+
body: undefined;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=Source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Source.d.ts","sourceRoot":"","sources":["../../../src/Declare/model/Source.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,MAAM,EACX,KAAK,MAAM,EAIZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,6BAA6B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,GAC7C,GAAG,CACD,OAAO,EACP,CACE,IAAI,EAAE,IAAI,KACP,OAAO,CACV,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAChC,CACF,GACD,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GACpB,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,OA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
3
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
4
|
+
import { type HostAdapter, type Effect, type Actor } from "../model/Adapter";
|
|
5
|
+
/**
|
|
6
|
+
* Builds an action `run` from a host adapter's `apply` — the
|
|
7
|
+
* apply HAND-OFF (point 7). `build` turns the dispatch
|
|
8
|
+
* target (the selected row, `None` for a create) into the
|
|
9
|
+
* checked {@link Effect}; the adapter applies it against the
|
|
10
|
+
* actor and the deferred Result folds INSIDE the `cmdEffect`
|
|
11
|
+
* thunk to a `Loaded` (the refreshed rows) or `Failed` (the
|
|
12
|
+
* error on the action-result path, named by `collection`)
|
|
13
|
+
* message. Nothing throws; an apply `Err` surfaces as a
|
|
14
|
+
* value exactly like a read `Err`.
|
|
15
|
+
*
|
|
16
|
+
* The `actor` here is the one the host also passes to
|
|
17
|
+
* `schedule` — the adapter's OPTIONAL re-enforcement seam
|
|
18
|
+
* (defense in depth). The engine's authorize gate over the
|
|
19
|
+
* runtime actor remains the primary boundary; an
|
|
20
|
+
* unauthorized action never reaches this `run` at all.
|
|
21
|
+
*/
|
|
22
|
+
export declare const applyVia: (adapter: HostAdapter, actor: Actor, collection: SoftStr, build: (target: Option<SoftStr>) => Effect) => (target: Option<SoftStr>) => Cmd<SchedulerMsg>;
|
|
23
|
+
//# sourceMappingURL=apply.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/Declare/usecase/apply.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,GAAG,EAET,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,KAAK,EAEX,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,QAAQ,GAEjB,SAAS,WAAW,EACpB,OAAO,KAAK,EACZ,YAAY,OAAO,EACnB,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,MAAM,MAE3C,QAAQ,MAAM,CAAC,OAAO,CAAC,KAAG,GAAG,CAAC,YAAY,CAcxC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type SoftStr, type Box, type Icon, type Option } from "plgg";
|
|
2
|
+
import { type Row } from "../model/Row";
|
|
3
|
+
/**
|
|
4
|
+
* A host RECORD — the untyped data an adapter read yields
|
|
5
|
+
* before projection: field keys mapped to their string
|
|
6
|
+
* values (the serialization every backend shares). The
|
|
7
|
+
* keyword projection lowers it to a typed {@link Row}.
|
|
8
|
+
*/
|
|
9
|
+
export type HostRecord = ReadonlyArray<readonly [SoftStr, SoftStr]>;
|
|
10
|
+
/**
|
|
11
|
+
* How a projected field lowers its raw string onto the
|
|
12
|
+
* closed {@link FieldValue} union — the DATA form of the
|
|
13
|
+
* per-field kind (the point-6 keyword-projection idea, the
|
|
14
|
+
* declaration-friendly alternative to a `toRow` function).
|
|
15
|
+
* v1 covers the scalar kinds; `Reference`/`Media` (which
|
|
16
|
+
* need several keys) stay in function-`toRow` territory.
|
|
17
|
+
*/
|
|
18
|
+
export type Projected = Icon<"AsText"> | Box<"AsNum", Option<SoftStr>> | Icon<"AsMoment"> | Icon<"AsFlag">;
|
|
19
|
+
/** Project a field as plain text. */
|
|
20
|
+
export declare const asText: () => Projected;
|
|
21
|
+
/** Project a field as a number with an optional unit. */
|
|
22
|
+
export declare const asNum: (unit?: SoftStr) => Projected;
|
|
23
|
+
/** Project a field as a date/time (ISO string). */
|
|
24
|
+
export declare const asMoment: () => Projected;
|
|
25
|
+
/** Project a field as a yes/no flag. */
|
|
26
|
+
export declare const asFlag: () => Projected;
|
|
27
|
+
/**
|
|
28
|
+
* One projected field: the row field `label`, the record
|
|
29
|
+
* `key` it reads, and how it lowers (`as`). A missing key
|
|
30
|
+
* omits the field (totality) — never a crash, never a bare
|
|
31
|
+
* empty cell.
|
|
32
|
+
*/
|
|
33
|
+
export type FieldProjection = Readonly<{
|
|
34
|
+
label: SoftStr;
|
|
35
|
+
key: SoftStr;
|
|
36
|
+
as: Projected;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* A keyword projection: which record keys supply the row's
|
|
40
|
+
* `id` and `label`, and the ordered field projections. The
|
|
41
|
+
* data alternative to a `toRow` function — a manifest/DSL
|
|
42
|
+
* declaration carries this instead of a closure.
|
|
43
|
+
*/
|
|
44
|
+
export type Projection = Readonly<{
|
|
45
|
+
id: SoftStr;
|
|
46
|
+
label: SoftStr;
|
|
47
|
+
fields: ReadonlyArray<FieldProjection>;
|
|
48
|
+
}>;
|
|
49
|
+
/** Constructs a {@link FieldProjection}. */
|
|
50
|
+
export declare const projectField: (label: SoftStr, key: SoftStr, as: Projected) => FieldProjection;
|
|
51
|
+
/** Constructs a {@link Projection}. */
|
|
52
|
+
export declare const projection: (p: {
|
|
53
|
+
id: SoftStr;
|
|
54
|
+
label: SoftStr;
|
|
55
|
+
fields?: ReadonlyArray<FieldProjection>;
|
|
56
|
+
}) => Projection;
|
|
57
|
+
/**
|
|
58
|
+
* Lowers a keyword {@link Projection} to a `toRow`-shaped
|
|
59
|
+
* function `(record) => Row` — the data alternative to a
|
|
60
|
+
* `toRow` closure, usable as any source's projection. Total:
|
|
61
|
+
* an absent `id`/`label` key reads as `""`, and an absent
|
|
62
|
+
* field key OMITS that field rather than throwing (the
|
|
63
|
+
* missing-field totality the gate requires).
|
|
64
|
+
*/
|
|
65
|
+
export declare const projectRow: (spec: Projection) => (record: HostRecord) => Row;
|
|
66
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/Declare/usecase/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAC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,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CACzC,KAAG,UAOF,CAAC;AAmBH;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GACpB,MAAM,UAAU,MAChB,QAAQ,UAAU,KAAG,GAsBnB,CAAC"}
|
|
@@ -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;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CACjD,GACD,GAAG,CACD,kBAAkB,EAClB,QAAQ,CAAC;IACP,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CACH,GACD,GAAG,CAAC,eAAe,EAAE,QAAQ,CAAC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC,CAAC;AAEtD,sCAAsC;AACtC,eAAO,MAAM,cAAc,GACzB,YAAY,OAAO,EACnB,MAAM,OAAO,KACZ,UAC0C,CAAC;AAE9C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,GAC3B,YAAY,OAAO,EACnB,YAAY,MAAM,KACjB,UAIC,CAAC;AAEL,sCAAsC;AACtC,eAAO,MAAM,aAAa,GACxB,MAAM,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,GAC7B,GAAG,UAAU,KACZ,OAAO,GAAG,SAcV,CAAC;AAoCJ;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,aAAa,WAAW,EACxB,UAAU,QAAQ,KACjB,aAAa,CAAC,UAAU,CAsD1B,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,GACrB,aAAa,aAAa,CAAC,gBAAgB,CAAC,KAC3C,UAA+B,CAAC;AAEnC,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,UAAU,EAClB,IAAI,OAAO,KACV,MAAM,CAAC,gBAAgB,CAGvB,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,IAAI,gBAAgB,EACpB,IAAI,OAAO,KACV,OAgBI,CAAC;AAER,qDAAqD;AACrD,eAAO,MAAM,SAAS,GACpB,IAAI,gBAAgB,EACpB,UAAU,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,YAAY,EAAE,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