plggmatic 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -84
- 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 +52 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4369 -407
- 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 +17 -22
- package/dist/App/model/AppError.d.ts +0 -31
- package/dist/App/model/AppError.d.ts.map +0 -1
- package/dist/App/model/AppOptions.d.ts +0 -31
- package/dist/App/model/AppOptions.d.ts.map +0 -1
- package/dist/Build/usecase/build.d.ts +0 -48
- package/dist/Build/usecase/build.d.ts.map +0 -1
- package/dist/Cli/usecase/resolveOptions.d.ts +0 -27
- package/dist/Cli/usecase/resolveOptions.d.ts.map +0 -1
- package/dist/Cli/usecase/runApp.d.ts +0 -39
- package/dist/Cli/usecase/runApp.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/invalid.config.d.ts +0 -5
- package/dist/Config/usecase/fixtures/invalid.config.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/named-only.config.d.ts +0 -2
- package/dist/Config/usecase/fixtures/named-only.config.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/throws.config.d.ts +0 -2
- package/dist/Config/usecase/fixtures/throws.config.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/valid.config.d.ts +0 -5
- package/dist/Config/usecase/fixtures/valid.config.d.ts.map +0 -1
- package/dist/Config/usecase/loadConfig.d.ts +0 -15
- package/dist/Config/usecase/loadConfig.d.ts.map +0 -1
- package/dist/Routing/usecase/buildRouter.d.ts +0 -17
- package/dist/Routing/usecase/buildRouter.d.ts.map +0 -1
- package/dist/ssg.d.ts +0 -2
- package/dist/ssg.d.ts.map +0 -1
- package/dist/ssg.es.js +0 -54
- package/dist/style.d.ts +0 -2
- package/dist/style.d.ts.map +0 -1
- package/dist/style.es.js +0 -98
package/README.md
CHANGED
|
@@ -1,89 +1,155 @@
|
|
|
1
1
|
# plggmatic
|
|
2
2
|
|
|
3
|
-
> **UNSTABLE** - Experimental study work.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
A
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
> **UNSTABLE** - Experimental study work. A package of the
|
|
4
|
+
> [qfs-viewer repository](../../README.md).
|
|
5
|
+
|
|
6
|
+
> **Provenance.** This package was ported from the retired
|
|
7
|
+
> [`qmu/plggmatic`](https://github.com/qmu/plggmatic) repository
|
|
8
|
+
> (`packages/plggmatic`) on 2026-07-16 (HQ ticket 20260716212002). Its git
|
|
9
|
+
> history stays in the retired repo; the reference app (`plggmatic-example`)
|
|
10
|
+
> remains there pending its integration into qmu-co-jp's design-pattern
|
|
11
|
+
> article. Body text below predates the move, so monorepo-relative links
|
|
12
|
+
> (`packages/site/`, `packages/plggmatic-example/`, sibling plgg packages) refer
|
|
13
|
+
> to the old homes.
|
|
14
|
+
|
|
15
|
+
A **column-oriented UI design framework** on the plgg family: a typed light/dark
|
|
16
|
+
**color scheme** (roles resolved through `var(--pm-*)` custom properties, so one
|
|
17
|
+
`dark` class reschemes the whole tree), **layout combinators** (`row` / `column`
|
|
18
|
+
/ `pane`) composed like element builders take `(parts, children)`, and
|
|
19
|
+
**fundamental components** as pure `(props) => Html<Msg>`. Styling is data —
|
|
20
|
+
atoms composed through [plgg-view](../plgg-view/)'s `style_`, gathered by
|
|
21
|
+
`collectCss`. No layout config object and no runtime to boot.
|
|
22
|
+
|
|
23
|
+
The vocabulary is one word per concept: **Column**, **Pane**, **Alignment**,
|
|
24
|
+
**Token**, **Scheme**. The design system is emergent — seeded minimal, one
|
|
25
|
+
recorded rule per component.
|
|
26
|
+
|
|
27
|
+
This is the UI design framework, canonical in this monorepo since `6d7a832`
|
|
28
|
+
(decision D13). See the documentation site in [`packages/site/`](../site/) and
|
|
29
|
+
the workbench demo in [`packages/plggmatic-example/`](../plggmatic-example/).
|
|
30
|
+
|
|
31
|
+
**Disambiguation — "plggmatic" has two historical meanings.** (a) A retired
|
|
32
|
+
2026-06/07 _app-framework facade_, absorbed into
|
|
33
|
+
[`plggpress/src/framework/`](../plggpress/src/framework/) in `31fdee9`; archived
|
|
34
|
+
tickets and their "rewire map" tables describe _that_ plggmatic — do not apply
|
|
35
|
+
them to this package. (b) _This_ package — the UI design framework — re-imported
|
|
36
|
+
at `6d7a832` and canonical here (D13). This note is the single source of the
|
|
37
|
+
distinction; other sites link here rather than repeating it.
|
|
38
|
+
|
|
39
|
+
## The declarative scheduler (framework half)
|
|
40
|
+
|
|
41
|
+
plggmatic is not only the design system — its essence is **declarative
|
|
42
|
+
definition of menus, data lists/details, actions, search, and flows, from which
|
|
43
|
+
a UI program is automatically _scheduled_** (D1). You write a **declaration** as
|
|
44
|
+
data; `schedule(...)` derives the whole plgg-view program except the view — the
|
|
45
|
+
`Model`, the `Msg` union, a pure `update`, and a total URL codec — plus a typed
|
|
46
|
+
`Scene` a renderer draws. The vocabulary is **mode-agnostic** (D10): no
|
|
47
|
+
declaration or derived type names a column, pane, drawer, or screen. Renderers
|
|
48
|
+
(tickets 10/11) project the derived level stack into a display.
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import {
|
|
52
|
+
schedule,
|
|
53
|
+
declare,
|
|
54
|
+
menu,
|
|
55
|
+
menuEntry,
|
|
56
|
+
collection,
|
|
57
|
+
sync,
|
|
58
|
+
query,
|
|
59
|
+
makeRow,
|
|
60
|
+
} from "plggmatic";
|
|
61
|
+
import { application } from "plgg-view/client";
|
|
62
|
+
|
|
63
|
+
// a declaration — pure data, performs nothing
|
|
64
|
+
const app = declare({
|
|
65
|
+
title: "Field Notes",
|
|
66
|
+
menu: menu([menuEntry("Sections", "sections")]),
|
|
67
|
+
collections: [
|
|
68
|
+
collection<Section>({
|
|
69
|
+
id: "sections",
|
|
70
|
+
title: "Sections",
|
|
71
|
+
toRow: (s) => makeRow(s.id, s.label),
|
|
72
|
+
source: sync(() => sections),
|
|
73
|
+
child: "notes",
|
|
74
|
+
query: query("Filter"),
|
|
75
|
+
}),
|
|
76
|
+
collection<Note>({
|
|
77
|
+
id: "notes",
|
|
78
|
+
title: "Notes",
|
|
79
|
+
toRow: (n) =>
|
|
80
|
+
makeRow(n.id, n.title, [/*…*/]),
|
|
81
|
+
source: sync((path) => notesFor(path[0])),
|
|
82
|
+
}),
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// schedule derives init/update/onUrlChange/toUrl/scene;
|
|
87
|
+
// a renderer supplies the missing `view`
|
|
88
|
+
const s = schedule(app);
|
|
89
|
+
application({
|
|
90
|
+
...s,
|
|
91
|
+
view: (m) => render(s.scene(m)),
|
|
92
|
+
})(document.getElementById("root")!);
|
|
20
93
|
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
94
|
+
|
|
95
|
+
### Two modes, one declaration (D10)
|
|
96
|
+
|
|
97
|
+
The scheduled `Scene` is **mode-agnostic**: the multi-column renderer draws it
|
|
98
|
+
as panes expanding rightward, the single-column renderer as one operation per
|
|
99
|
+
screen, and `renderMode(mode)(scene)` dispatches between them. A consumer holds
|
|
100
|
+
the `Mode` _beside_ the scheduled model (never in it), and a flip mid-flow is
|
|
101
|
+
loss-free by construction — same flow position, selection, query, confirmation,
|
|
102
|
+
and URL:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import {
|
|
106
|
+
schedule,
|
|
107
|
+
renderMode,
|
|
108
|
+
toggleMode,
|
|
109
|
+
type Mode,
|
|
110
|
+
} from "plggmatic";
|
|
111
|
+
|
|
112
|
+
const scheduled = schedule(app);
|
|
113
|
+
|
|
114
|
+
// the consumer's model = scheduled model + a Mode
|
|
115
|
+
type Model = {
|
|
116
|
+
scheduled: ScheduledModel;
|
|
117
|
+
mode: Mode;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const view = (model: Model) =>
|
|
121
|
+
renderMode(model.mode)(
|
|
122
|
+
scheduled.scene(model.scheduled),
|
|
123
|
+
);
|
|
124
|
+
// a "toggle mode" button dispatches toggleMode(model.mode)
|
|
26
125
|
```
|
|
27
126
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
[`
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
[
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
own
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
`
|
|
56
|
-
|
|
57
|
-
Nine names exist in two wrapped libraries with different
|
|
58
|
-
meanings; the root barrel resolves them to the
|
|
59
|
-
**page-authoring (plgg-view) variant**: `head`, `header`,
|
|
60
|
-
`on`, `link`, `strong`, `table`, `text$`, `ListItem`,
|
|
61
|
-
`TableRow`. The shadowed variants (plgg-server's HEAD-route
|
|
62
|
-
`head`, context `header`, route-matcher `on`; plgg-md's AST
|
|
63
|
-
constructors and node types) remain reachable from their own
|
|
64
|
-
packages.
|
|
65
|
-
|
|
66
|
-
## How it's organized
|
|
67
|
-
|
|
68
|
-
- **Config** — `loadConfig` reads and validates an app's
|
|
69
|
-
config across the untrusted boundary.
|
|
70
|
-
- **Routing** — `buildRouter` assembles a
|
|
71
|
-
[`plgg-server`](../plgg-server/) router from the app's page
|
|
72
|
-
set.
|
|
73
|
-
- **Build** — `build` runs a `BuildSpec` to emit the static
|
|
74
|
-
site, returning a `BuildReport`.
|
|
75
|
-
- **App** — `AppOptions` / `BuildReport` and the
|
|
76
|
-
`ConfigLoadError` vocabulary.
|
|
77
|
-
- **Cli** — `runApp` + `resolveOptions` are the pre-organized
|
|
78
|
-
`argv` → build/serve entrypoint, built on
|
|
79
|
-
[`plgg-cli`](../plgg-cli/).
|
|
80
|
-
|
|
81
|
-
plggmatic is ESM-only (no CJS entry).
|
|
82
|
-
|
|
83
|
-
## Conventions
|
|
84
|
-
|
|
85
|
-
- `as` / `any` / `ts-ignore` are prohibited (see root
|
|
86
|
-
`CLAUDE.md`); config crosses into the typed core through one
|
|
87
|
-
validating boundary.
|
|
88
|
-
- After editing a `file:`-linked dependency's source, rebuild
|
|
89
|
-
its `dist` or this package won't see new exports.
|
|
127
|
+
The vocabulary — **Resource/Collection** (sync or async through one shape),
|
|
128
|
+
**Menu**, **Row** (the list/detail projection), **Action** (create/update/delete
|
|
129
|
+
with confirmation-as-data), **Query**, and the **Flow** graph (menu roots +
|
|
130
|
+
each collection's `child`) — is a set of closed unions consumed with exhaustive
|
|
131
|
+
`match`, so adding a variant is a compile error at every interpreter. Effects
|
|
132
|
+
are `Cmd` data: an `async` source read and an `Action`'s verb are _returned_ by
|
|
133
|
+
`update`, never run by it. See the runnable proof-of-value — the reference app
|
|
134
|
+
is itself a declaration scheduled and drawn by the multi-column renderer —
|
|
135
|
+
in [`packages/plggmatic-example/`](../plggmatic-example/) (`src/declaration.ts` +
|
|
136
|
+
`src/app.ts`; the form components have their own showcase in `src/forms/`), and
|
|
137
|
+
the design record at
|
|
138
|
+
[`.workaholic/specs/20260704-plggmatic-scheduler-design.md`](../../.workaholic/specs/20260704-plggmatic-scheduler-design.md).
|
|
139
|
+
|
|
140
|
+
## Palette override & scheme persistence
|
|
141
|
+
|
|
142
|
+
The color system is a closed role×variant matrix (see the
|
|
143
|
+
[color-scheme docs](../site/color-scheme.md)) with a **monochrome default**.
|
|
144
|
+
Two consumer seams:
|
|
145
|
+
|
|
146
|
+
- **Override** — `defaultPalette` is the shipped monochrome palette; an app
|
|
147
|
+
validates its own brand colors with `asPalette` (`unknown` → `Result`, a
|
|
148
|
+
missing scheme/token/bad-hex is an `Err` naming the path) and emits the CSS
|
|
149
|
+
with `schemeCssOf`. `contrastRatio` runs the same WCAG math the phase-1 gate
|
|
150
|
+
uses so an override can be audited. Atoms and `var(--pm-*)` are untouched.
|
|
151
|
+
- **Persistence** — the contract is framework-owned: one storage key
|
|
152
|
+
`appearanceStorageKey` = **`vp-appearance`** (preserved per D16), one
|
|
153
|
+
mechanism **`html.dark`**, a no-FOUC `appearanceInitScript` +
|
|
154
|
+
`injectAppearanceScript`, a pure `decideScheme`, and an `applyScheme` effect
|
|
155
|
+
helper. Every consumer schemes identically — no per-app key drift.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plggmatic Catalog module: the THIRD renderer of the
|
|
3
|
+
* settled {@link import("../Schedule/model/Scene").Scene}
|
|
4
|
+
* (beside the two HTML renderers) — a fold to the engine-
|
|
5
|
+
* owned {@link Tool} catalog (mission point 8, 2026-07-13),
|
|
6
|
+
* plus the fuel-bounded {@link runFlow} the standing
|
|
7
|
+
* `run_flow` tool composes, and a thin, disposable WebMCP
|
|
8
|
+
* adapter over the `navigator.modelContext` proposal. The
|
|
9
|
+
* catalog is transport-neutral DATA; the adapter is the
|
|
10
|
+
* only impure edge and is inert when the API is absent.
|
|
11
|
+
* An explicit named barrel (house style).
|
|
12
|
+
*/
|
|
13
|
+
export { type ToolInput, type ToolEffect, type Tool, nullary, textArg, enumArg, emit, runFlowEffect, tool, nullary$, textArg$, enumArg$, emit$, runFlow$, } from "./model/tool";
|
|
14
|
+
export { rowCap, catalogOf, } from "./usecase/catalog";
|
|
15
|
+
export { type FlowHost, type RunOutcome, flowHost, flowSchemaOf, runFlow, rejected, stalled, ran, rejected$, stalled$, ran$, } from "./usecase/runFlow";
|
|
16
|
+
export { type ToolDescriptor, type CatalogDiff, type ModelContext, descriptorOf, diffCatalog, syncCatalog, invokeWith, detectModelContext, inertModelContext, } from "./usecase/adapter";
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Catalog/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,IAAI,EACT,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,MAAM,EACN,SAAS,GACV,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,OAAO,EACP,GAAG,EACH,SAAS,EACT,QAAQ,EACR,IAAI,GACL,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { type SoftStr, type Box, type Icon } from "plgg";
|
|
2
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
3
|
+
/**
|
|
4
|
+
* A tool's argument schema — the CLOSED engine union the
|
|
5
|
+
* catalog fold emits, kept transport-neutral: the JSON-
|
|
6
|
+
* Schema serialization a WebMCP (or any) adapter needs is
|
|
7
|
+
* the ADAPTER's job, derived from this data. Every v1 tool
|
|
8
|
+
* takes at most one argument, so the union is a single
|
|
9
|
+
* argument slot:
|
|
10
|
+
*
|
|
11
|
+
* - `Nullary` — no argument (a create/row action, whose
|
|
12
|
+
* target is fixed by the scene position).
|
|
13
|
+
* - `TextArg` — one free-text argument (the keyword filter,
|
|
14
|
+
* the `run_flow` script source).
|
|
15
|
+
* - `EnumArg` — one argument drawn from a CLOSED option set
|
|
16
|
+
* (a row-selection id, a declared query choice, a menu
|
|
17
|
+
* section). An EMPTY option set withholds the choices
|
|
18
|
+
* deliberately (the row-cap guard) — never a free string.
|
|
19
|
+
*/
|
|
20
|
+
export type ToolInput = Icon<"Nullary"> | Box<"TextArg", Readonly<{
|
|
21
|
+
name: SoftStr;
|
|
22
|
+
description: SoftStr;
|
|
23
|
+
}>> | Box<"EnumArg", Readonly<{
|
|
24
|
+
name: SoftStr;
|
|
25
|
+
description: SoftStr;
|
|
26
|
+
options: ReadonlyArray<SoftStr>;
|
|
27
|
+
}>>;
|
|
28
|
+
/** A no-argument input. */
|
|
29
|
+
export declare const nullary: () => ToolInput;
|
|
30
|
+
/** A single free-text argument. */
|
|
31
|
+
export declare const textArg: (name: SoftStr, description: SoftStr) => ToolInput;
|
|
32
|
+
/** A single argument drawn from a closed option set. */
|
|
33
|
+
export declare const enumArg: (name: SoftStr, description: SoftStr, options: ReadonlyArray<SoftStr>) => ToolInput;
|
|
34
|
+
/** Matchers for folding a {@link ToolInput}. */
|
|
35
|
+
export declare const nullary$: () => {
|
|
36
|
+
__tag: "Nullary";
|
|
37
|
+
type: "tag";
|
|
38
|
+
body: undefined;
|
|
39
|
+
};
|
|
40
|
+
export declare const textArg$: () => {
|
|
41
|
+
__tag: "TextArg";
|
|
42
|
+
type: "tag";
|
|
43
|
+
body: undefined;
|
|
44
|
+
};
|
|
45
|
+
export declare const enumArg$: () => {
|
|
46
|
+
__tag: "EnumArg";
|
|
47
|
+
type: "tag";
|
|
48
|
+
body: undefined;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* What invoking a tool does — a CLOSED union so the adapter
|
|
52
|
+
* folds it exhaustively:
|
|
53
|
+
*
|
|
54
|
+
* - `Emit` — lower the (validated) argument onto a single
|
|
55
|
+
* {@link SchedulerMsg} the host dispatches, EXACTLY as
|
|
56
|
+
* the human path does (the same `select`/`queryInput`/
|
|
57
|
+
* `requestAction`/`urlChanged` constructors the renderers
|
|
58
|
+
* wire). A `Nullary` tool ignores the passed `""`.
|
|
59
|
+
* - `RunFlow` — the standing `run_flow` tool: the argument
|
|
60
|
+
* is a flow DSL source the adapter reads, checks, and
|
|
61
|
+
* runs against the current scene (see `runFlow`).
|
|
62
|
+
*/
|
|
63
|
+
export type ToolEffect = Box<"Emit", (arg: SoftStr) => SchedulerMsg> | Icon<"RunFlow">;
|
|
64
|
+
/** Lowers the validated argument onto a scheduler message. */
|
|
65
|
+
export declare const emit: (lower: (arg: SoftStr) => SchedulerMsg) => ToolEffect;
|
|
66
|
+
/** The `run_flow` effect (the argument is a flow source). */
|
|
67
|
+
export declare const runFlowEffect: () => ToolEffect;
|
|
68
|
+
/** Matchers for folding a {@link ToolEffect}. */
|
|
69
|
+
export declare const emit$: () => {
|
|
70
|
+
__tag: "Emit";
|
|
71
|
+
type: "tag";
|
|
72
|
+
body: undefined;
|
|
73
|
+
};
|
|
74
|
+
export declare const runFlow$: () => {
|
|
75
|
+
__tag: "RunFlow";
|
|
76
|
+
type: "tag";
|
|
77
|
+
body: undefined;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* One engine-owned tool: a name (the diff/registration
|
|
81
|
+
* key), a human/agent-readable description, its argument
|
|
82
|
+
* schema, and the lowering of a validated argument onto an
|
|
83
|
+
* effect. Pure DATA — a renderer-parallel fold from the
|
|
84
|
+
* settled {@link import("../../Schedule/model/Scene").Scene}
|
|
85
|
+
* produces the catalog; the WebMCP adapter is a thin,
|
|
86
|
+
* disposable skin over this.
|
|
87
|
+
*/
|
|
88
|
+
export type Tool = Readonly<{
|
|
89
|
+
name: SoftStr;
|
|
90
|
+
description: SoftStr;
|
|
91
|
+
input: ToolInput;
|
|
92
|
+
effect: ToolEffect;
|
|
93
|
+
}>;
|
|
94
|
+
/** Constructs a {@link Tool}. */
|
|
95
|
+
export declare const tool: (t: {
|
|
96
|
+
name: SoftStr;
|
|
97
|
+
description: SoftStr;
|
|
98
|
+
input: ToolInput;
|
|
99
|
+
effect: ToolEffect;
|
|
100
|
+
}) => Tool;
|
|
101
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/Catalog/model/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,IAAI,EAIV,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,GACjB,IAAI,CAAC,SAAS,CAAC,GACf,GAAG,CACD,SAAS,EACT,QAAQ,CAAC;IACP,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CACH,GACD,GAAG,CACD,SAAS,EACT,QAAQ,CAAC;IACP,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACjC,CAAC,CACH,CAAC;AAEN,2BAA2B;AAC3B,eAAO,MAAM,OAAO,QAAO,SACV,CAAC;AAElB,mCAAmC;AACnC,eAAO,MAAM,OAAO,GAClB,MAAM,OAAO,EACb,aAAa,OAAO,KACnB,SACoC,CAAC;AAExC,wDAAwD;AACxD,eAAO,MAAM,OAAO,GAClB,MAAM,OAAO,EACb,aAAa,OAAO,EACpB,SAAS,aAAa,CAAC,OAAO,CAAC,KAC9B,SAC6C,CAAC;AAEjD,gDAAgD;AAChD,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AACvB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AACvB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,YAAY,CAAC,GAC3C,IAAI,CAAC,SAAS,CAAC,CAAC;AAEpB,8DAA8D;AAC9D,eAAO,MAAM,IAAI,GACf,OAAO,CAAC,GAAG,EAAE,OAAO,KAAK,YAAY,KACpC,UAAgC,CAAC;AAEpC,6DAA6D;AAC7D,eAAO,MAAM,aAAa,QAAO,UAChB,CAAC;AAElB,iDAAiD;AACjD,eAAO,MAAM,KAAK;;;;CAA0B,CAAC;AAC7C,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,IAAI,GAAG,QAAQ,CAAC;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC,CAAC;AAEH,iCAAiC;AACjC,eAAO,MAAM,IAAI,GAAI,GAAG;IACtB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB,KAAG,IAAS,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
3
|
+
import { type Tool, type ToolInput } from "../model/tool";
|
|
4
|
+
/**
|
|
5
|
+
* The WebMCP adapter — a deliberately thin, disposable skin
|
|
6
|
+
* that projects the transport-neutral tool catalog onto an
|
|
7
|
+
* in-browser tool host (the `navigator.modelContext` moving
|
|
8
|
+
* proposal). All the durable logic is here as PURE data
|
|
9
|
+
* transforms over a small {@link ModelContext} seam; the
|
|
10
|
+
* feature-detected binding to the real browser API is the
|
|
11
|
+
* only impure edge, and it is inert when the API is absent
|
|
12
|
+
* (the engine is untouched). The transport (HTTP/MCP) stays
|
|
13
|
+
* deferred — this file is meant to be rewritten without
|
|
14
|
+
* touching the fold (sacrificial architecture).
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* The SERIALIZABLE identity of a tool the host registers —
|
|
18
|
+
* everything but the effect (which is invoked by name).
|
|
19
|
+
* Two settles that produce a byte-equal descriptor for a
|
|
20
|
+
* name need no re-registration (the diff key).
|
|
21
|
+
*/
|
|
22
|
+
export type ToolDescriptor = Readonly<{
|
|
23
|
+
name: SoftStr;
|
|
24
|
+
description: SoftStr;
|
|
25
|
+
input: ToolInput;
|
|
26
|
+
}>;
|
|
27
|
+
/** The descriptor of a tool (drops the effect). */
|
|
28
|
+
export declare const descriptorOf: (t: Tool) => ToolDescriptor;
|
|
29
|
+
/**
|
|
30
|
+
* The minimal difference between the registered descriptors
|
|
31
|
+
* and the next catalog: tools to add, names to drop, and
|
|
32
|
+
* tools whose descriptor CHANGED under a stable name
|
|
33
|
+
* (re-registered). Pure and order-preserving.
|
|
34
|
+
*/
|
|
35
|
+
export type CatalogDiff = Readonly<{
|
|
36
|
+
added: ReadonlyArray<Tool>;
|
|
37
|
+
removed: ReadonlyArray<SoftStr>;
|
|
38
|
+
changed: ReadonlyArray<Tool>;
|
|
39
|
+
}>;
|
|
40
|
+
/** Diffs the registered descriptors against the next catalog by name. */
|
|
41
|
+
export declare const diffCatalog: (prev: ReadonlyArray<ToolDescriptor>, next: ReadonlyArray<Tool>) => CatalogDiff;
|
|
42
|
+
/**
|
|
43
|
+
* The in-browser tool host the adapter drives — the subset
|
|
44
|
+
* of the `navigator.modelContext` proposal the catalog
|
|
45
|
+
* uses: register a descriptor with an invocation handler,
|
|
46
|
+
* and unregister by name.
|
|
47
|
+
*/
|
|
48
|
+
export type ModelContext = Readonly<{
|
|
49
|
+
registerTool: (descriptor: ToolDescriptor, invoke: (arg: SoftStr) => void) => void;
|
|
50
|
+
unregisterTool: (name: SoftStr) => void;
|
|
51
|
+
}>;
|
|
52
|
+
/** A no-op host: the adapter is inert (the API is absent). */
|
|
53
|
+
export declare const inertModelContext: ModelContext;
|
|
54
|
+
/**
|
|
55
|
+
* Builds a per-tool invocation handler from the host's
|
|
56
|
+
* dispatch and a flow runner: an `Emit` tool lowers its
|
|
57
|
+
* argument onto a message the host dispatches; the
|
|
58
|
+
* `run_flow` tool hands its argument (a script) to `run`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const invokeWith: (dispatch: (msg: SchedulerMsg) => void, run: (source: SoftStr) => void) => (t: Tool) => (arg: SoftStr) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Applies one catalog settle to the host: unregister
|
|
63
|
+
* dropped names, re-register changed tools (unregister then
|
|
64
|
+
* register), register new tools — the DIFF-MINIMAL update
|
|
65
|
+
* (unchanged tools are left alone). Returns the next
|
|
66
|
+
* descriptor set for the following settle. The `invokerOf`
|
|
67
|
+
* seam wires each registered tool's handler.
|
|
68
|
+
*/
|
|
69
|
+
export declare const syncCatalog: (host: ModelContext, invokerOf: (t: Tool) => (arg: SoftStr) => void, prev: ReadonlyArray<ToolDescriptor>, next: ReadonlyArray<Tool>) => ReadonlyArray<ToolDescriptor>;
|
|
70
|
+
/**
|
|
71
|
+
* Feature-detects `navigator.modelContext` (or any host
|
|
72
|
+
* candidate) WITHOUT an escape hatch: `None` when the
|
|
73
|
+
* object or its `registerTool`/`unregisterTool` methods are
|
|
74
|
+
* absent — the adapter then stays inert. When present, a
|
|
75
|
+
* {@link ModelContext} that FORWARDS to the detected
|
|
76
|
+
* methods (the descriptor + handler passed positionally);
|
|
77
|
+
* the exact payload shape is the disposable part that
|
|
78
|
+
* follows the proposal.
|
|
79
|
+
*/
|
|
80
|
+
export declare const detectModelContext: (candidate: unknown) => Option<ModelContext>;
|
|
81
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/Catalog/usecase/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EASZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EACL,KAAK,IAAI,EACT,KAAK,SAAS,EAMf,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;GAWG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,YAAY,GACvB,GAAG,IAAI,KACN,cAID,CAAC;AAwBH;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3B,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,WAAW,GACtB,MAAM,aAAa,CAAC,cAAc,CAAC,EACnC,MAAM,aAAa,CAAC,IAAI,CAAC,KACxB,WA8BD,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,YAAY,EAAE,CACZ,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KAC3B,IAAI,CAAC;IACV,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC,CAAC,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,EAAE,YAG/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAEnB,UAAU,CAAC,GAAG,EAAE,YAAY,KAAK,IAAI,EACrC,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,MAE/B,GAAG,IAAI,MACP,KAAK,OAAO,KAAG,IAQb,CAAC;AAEN;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GACtB,MAAM,YAAY,EAClB,WAAW,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,EAC9C,MAAM,aAAa,CAAC,cAAc,CAAC,EACnC,MAAM,aAAa,CAAC,IAAI,CAAC,KACxB,aAAa,CAAC,cAAc,CAmB9B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,GAC7B,WAAW,OAAO,KACjB,MAAM,CAAC,YAAY,CAwBrB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Scene } from "../../Schedule/model/Scene";
|
|
2
|
+
import { type Tool } from "../model/tool";
|
|
3
|
+
/**
|
|
4
|
+
* The fold from the settled {@link Scene} to the engine-
|
|
5
|
+
* owned tool catalog — the THIRD renderer, beside the two
|
|
6
|
+
* HTML renderers: the SAME closed {@link Level} union, the
|
|
7
|
+
* SAME exhaustive `match`, so a new level kind is a compile
|
|
8
|
+
* error here too (mission point 8, 2026-07-13). A tool
|
|
9
|
+
* lowers its validated argument onto the very
|
|
10
|
+
* {@link SchedulerMsg} the renderers' human path dispatches
|
|
11
|
+
* (navigation is `select`/`urlChanged`; the query, actions,
|
|
12
|
+
* and flow are their own messages) — no parallel dispatch.
|
|
13
|
+
*
|
|
14
|
+
* What each level contributes:
|
|
15
|
+
* - `MenuLevel` → one `open_menu` tool whose section enum is
|
|
16
|
+
* the menu labels; choosing one navigates to that section.
|
|
17
|
+
* - `ListLevel` → a `select` tool (its id enum is the
|
|
18
|
+
* VISIBLE rows, capped), the keyword and declared-choice
|
|
19
|
+
* FILTER tools, and the create-action tools the legality
|
|
20
|
+
* projection already left on the scene. A still-loading
|
|
21
|
+
* list contributes NOTHING.
|
|
22
|
+
* - `BoardLevel` → one `jump` tool over the tiles that carry
|
|
23
|
+
* a jump; a loading board contributes nothing.
|
|
24
|
+
* - `DetailLevel` → the row-action tools (update/delete) the
|
|
25
|
+
* legality projection left, targeted at the loaded row.
|
|
26
|
+
* Plus the standing `run_flow` tool at every scene.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* The visible-row cap: a `select` tool enumerates at most
|
|
30
|
+
* this many row ids. Over the cap the choices are WITHHELD
|
|
31
|
+
* (an empty enum) and the description directs the agent to
|
|
32
|
+
* filter first — never a free-string id fallback.
|
|
33
|
+
*/
|
|
34
|
+
export declare const rowCap = 50;
|
|
35
|
+
/**
|
|
36
|
+
* The full tool catalog for a settled scene. The menu is
|
|
37
|
+
* always at level 0; a list/board follows at flow depth
|
|
38
|
+
* `position - 1` (the chain index `select` and the scene
|
|
39
|
+
* addressing use). Loading collections contribute nothing;
|
|
40
|
+
* `run_flow` is always available.
|
|
41
|
+
*/
|
|
42
|
+
export declare const catalogOf: (scene: Scene) => ReadonlyArray<Tool>;
|
|
43
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/Catalog/usecase/catalog.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,KAAK,KAAK,EAYX,MAAM,gCAAgC,CAAC;AASxC,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,MAAM,KAAK,CAAC;AAwSzB;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,OAAO,KAAK,KACX,aAAa,CAAC,IAAI,CA8BpB,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type SoftStr, type Box } from "plgg";
|
|
2
|
+
import { type SemDiagnostic } from "plgg-ir-language";
|
|
3
|
+
import { type Declaration } from "../../Declare/model/Declaration";
|
|
4
|
+
import { type Scene, type ConfirmPrompt } from "../../Schedule/model/Scene";
|
|
5
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
6
|
+
import { type Model } from "../../Schedule/model/Model";
|
|
7
|
+
import { type Scheduled } from "../../Schedule/usecase/schedule";
|
|
8
|
+
import { type FlowSchema } from "../../Flow/model/forms";
|
|
9
|
+
import { type FlowOutcome } from "../../Flow/model/run";
|
|
10
|
+
/**
|
|
11
|
+
* The pure scheduler seam `run_flow` drives: the current
|
|
12
|
+
* settled {@link Scene}, and a `settle` that folds one
|
|
13
|
+
* {@link SchedulerMsg} into the NEXT seam (the model is
|
|
14
|
+
* threaded inside; the returned `Cmd` is DROPPED — the
|
|
15
|
+
* flow harness is pure, exactly as the scheduler "executes
|
|
16
|
+
* nothing"). {@link flowHost} builds one from a derived
|
|
17
|
+
* program and a model.
|
|
18
|
+
*/
|
|
19
|
+
export type FlowHost = Readonly<{
|
|
20
|
+
scene: Scene;
|
|
21
|
+
settle: (msg: SchedulerMsg) => FlowHost;
|
|
22
|
+
}>;
|
|
23
|
+
/** Builds a {@link FlowHost} from a derived program + model. */
|
|
24
|
+
export declare const flowHost: (scheduled: Scheduled, model: Model) => FlowHost;
|
|
25
|
+
/**
|
|
26
|
+
* The result of a `run_flow` invocation — a closed union so
|
|
27
|
+
* the adapter reports it as a value:
|
|
28
|
+
* - `Rejected` — the reader/checker refused the script;
|
|
29
|
+
* the positioned diagnostics carry source ranges.
|
|
30
|
+
* - `Stalled` — the flow ran to completion but left a
|
|
31
|
+
* destructive action PARKED at its confirmation (no
|
|
32
|
+
* auto-confirm — mission point 8): the caller must
|
|
33
|
+
* dispatch the confirm explicitly.
|
|
34
|
+
* - `Ran` — the flow reached a terminal {@link FlowOutcome}
|
|
35
|
+
* (a value, or a positioned runtime failure).
|
|
36
|
+
*/
|
|
37
|
+
export type RunOutcome = Box<"Rejected", ReadonlyArray<SemDiagnostic>> | Box<"Stalled", ConfirmPrompt> | Box<"Ran", FlowOutcome>;
|
|
38
|
+
/** Constructs a `Rejected` result. */
|
|
39
|
+
export declare const rejected: (diagnostics: ReadonlyArray<SemDiagnostic>) => RunOutcome;
|
|
40
|
+
/** Constructs a `Stalled` result. */
|
|
41
|
+
export declare const stalled: (confirm: ConfirmPrompt) => RunOutcome;
|
|
42
|
+
/** Constructs a `Ran` result. */
|
|
43
|
+
export declare const ran: (outcome: FlowOutcome) => RunOutcome;
|
|
44
|
+
/** Matchers for folding a {@link RunOutcome}. */
|
|
45
|
+
export declare const rejected$: () => {
|
|
46
|
+
__tag: "Rejected";
|
|
47
|
+
type: "tag";
|
|
48
|
+
body: undefined;
|
|
49
|
+
};
|
|
50
|
+
export declare const stalled$: () => {
|
|
51
|
+
__tag: "Stalled";
|
|
52
|
+
type: "tag";
|
|
53
|
+
body: undefined;
|
|
54
|
+
};
|
|
55
|
+
export declare const ran$: () => {
|
|
56
|
+
__tag: "Ran";
|
|
57
|
+
type: "tag";
|
|
58
|
+
body: undefined;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Derives the {@link FlowSchema} a flow is checked against
|
|
62
|
+
* from a declaration — every collection's id, its observed
|
|
63
|
+
* field types, and its declared choice ids. The cross-
|
|
64
|
+
* dialect binding set `readFlow` resolves names against.
|
|
65
|
+
*/
|
|
66
|
+
export declare const flowSchemaOf: (declaration: Declaration) => FlowSchema;
|
|
67
|
+
/**
|
|
68
|
+
* `run_flow`: reads + checks a flow DSL source against the
|
|
69
|
+
* schema, then runs it fuel-bounded through the pure host
|
|
70
|
+
* seam — the standing catalog tool the point-8 design
|
|
71
|
+
* names. Total: a rejected script is a `Rejected` value
|
|
72
|
+
* (positioned diagnostics), a parked destructive action is
|
|
73
|
+
* a `Stalled` value, and every runtime error is a `Failed`
|
|
74
|
+
* outcome inside `Ran` — never a throw.
|
|
75
|
+
*/
|
|
76
|
+
export declare const runFlow: (source: SoftStr, schema: FlowSchema, host: FlowHost, fuel?: number) => RunOutcome;
|
|
77
|
+
//# sourceMappingURL=runFlow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runFlow.d.ts","sourceRoot":"","sources":["../../../src/Catalog/usecase/runFlow.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EAMT,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAwBtD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EACL,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,KAAK,WAAW,EAKjB,MAAM,0BAA0B,CAAC;AAOlC;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;IAC9B,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,QAAQ,CAAC;CACzC,CAAC,CAAC;AAEH,gEAAgE;AAChE,eAAO,MAAM,QAAQ,GACnB,WAAW,SAAS,EACpB,OAAO,KAAK,KACX,QAOD,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAClB,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,GAC7C,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC,GAC7B,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;AAE5B,sCAAsC;AACtC,eAAO,MAAM,QAAQ,GACnB,aAAa,aAAa,CAAC,aAAa,CAAC,KACxC,UAA0C,CAAC;AAE9C,qCAAqC;AACrC,eAAO,MAAM,OAAO,GAClB,SAAS,aAAa,KACrB,UAAqC,CAAC;AAEzC,iCAAiC;AACjC,eAAO,MAAM,GAAG,GACd,SAAS,WAAW,KACnB,UAAiC,CAAC;AAErC,iDAAiD;AACjD,eAAO,MAAM,SAAS;;;;CACC,CAAC;AACxB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AACvB,eAAO,MAAM,IAAI;;;;CAAyB,CAAC;AAkH3C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GACvB,aAAa,WAAW,KACvB,UAKA,CAAC;AA8CJ;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,GAClB,QAAQ,OAAO,EACf,QAAQ,UAAU,EAClB,MAAM,QAAQ,EACd,OAAM,MAAoB,KACzB,UAQF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plggmatic Component module: the seed set of
|
|
3
|
+
* fundamental components, each a pure `(props) =>
|
|
4
|
+
* Html<Msg>` styled through the token utilities, each
|
|
5
|
+
* carrying exactly one recorded interaction rule (see
|
|
6
|
+
* each function's doc comment). An explicit named barrel
|
|
7
|
+
* (house style); the set is deliberately small — form
|
|
8
|
+
* controls, tables, and overlays arrive in later
|
|
9
|
+
* tickets, each with its own rule. The shared
|
|
10
|
+
* interaction-state vocabulary is defined once in
|
|
11
|
+
* `model/interaction` and imported by all.
|
|
12
|
+
*/
|
|
13
|
+
export { type InteractionState, focusRing, hoverDim, pressDim, } from "./model/interaction";
|
|
14
|
+
export { type ButtonProps, button, } from "./usecase/button";
|
|
15
|
+
export { type TextLinkProps, textLink, } from "./usecase/textLink";
|
|
16
|
+
export { type HeadingLevel, heading, prose, } from "./usecase/typography";
|
|
17
|
+
export { type ThemeToggleProps, themeToggle, staticThemeToggle, themeToggleClass, themeToggleCss, } from "./usecase/themeToggle";
|
|
18
|
+
export { type NavItem } from "./model/navItem";
|
|
19
|
+
export { navTree } from "./usecase/navTree";
|
|
20
|
+
export { type ColHeadProps, colHead, } from "./usecase/colHead";
|
|
21
|
+
export { type Crumb, breadcrumb, } from "./usecase/breadcrumb";
|
|
22
|
+
export { type TextInputProps, textInput, } from "./usecase/textInput";
|
|
23
|
+
export { type TextAreaProps, textArea, } from "./usecase/textArea";
|
|
24
|
+
export { type SelectOption, type SelectProps, selectInput, } from "./usecase/selectInput";
|
|
25
|
+
export { type CheckboxProps, checkbox, } from "./usecase/checkbox";
|
|
26
|
+
export { type ConfirmDialogProps, confirmDialog, } from "./usecase/confirmDialog";
|
|
27
|
+
export { type Tone, type ToastProps, tones, toast, toaster, } from "./usecase/toast";
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Component/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,KAAK,gBAAgB,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,GACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,KAAK,WAAW,EAChB,MAAM,GACP,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,YAAY,EACjB,OAAO,EACP,KAAK,GACN,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,gBAAgB,EACrB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACf,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EACL,KAAK,YAAY,EACjB,OAAO,GACR,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,KAAK,KAAK,EACV,UAAU,GACX,MAAM,wCAAwC,CAAC;AAKhD,OAAO,EACL,KAAK,cAAc,EACnB,SAAS,GACV,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,WAAW,GACZ,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,KAAK,aAAa,EAClB,QAAQ,GACT,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,kBAAkB,EACvB,aAAa,GACd,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK,EACL,KAAK,EACL,OAAO,GACR,MAAM,mCAAmC,CAAC"}
|