@plitzi/sdk-shared 0.38.24 → 0.39.1

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 (197) hide show
  1. package/CHANGELOG.md +153 -1
  2. package/dist/actions/functions.d.ts +22 -1
  3. package/dist/actions/functions.mjs +3 -3
  4. package/dist/actions/index.d.ts +1 -1
  5. package/dist/actions/index.mjs +7 -7
  6. package/dist/auth/failureChannel.mjs +1 -0
  7. package/dist/auth/index.d.ts +1 -1
  8. package/dist/auth/index.mjs +2 -2
  9. package/dist/auth/visitorRoles.d.ts +8 -0
  10. package/dist/auth/visitorRoles.mjs +5 -2
  11. package/dist/authoring/declare.d.ts +34 -1
  12. package/dist/authoring/elementCallbacks.d.ts +13 -0
  13. package/dist/authoring/elementCallbacks.mjs +11 -5
  14. package/dist/authoring/index.mjs +3 -3
  15. package/dist/authoring/paramSpec.d.ts +1 -0
  16. package/dist/dataSource/getBindingsDetails.d.ts +1 -1
  17. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  18. package/dist/dataSource/globalSources.d.ts +1 -1
  19. package/dist/dataSource/index.d.ts +1 -2
  20. package/dist/dataSource/index.mjs +1 -1
  21. package/dist/dataSource/utility/arrayMap.mjs +1 -1
  22. package/dist/dataSource/utility/capitalize.mjs +1 -1
  23. package/dist/dataSource/utility/styleSelector.mjs +5 -3
  24. package/dist/dataSource/utility/styleVariant.mjs +17 -13
  25. package/dist/dataSource/variables/index.d.ts +2 -0
  26. package/dist/dataSource/variables/index.mjs +1 -0
  27. package/dist/dataSource/{resolveVariables.d.ts → variables/resolveVariables.d.ts} +1 -1
  28. package/dist/dataSource/{resolveVariables.mjs → variables/resolveVariables.mjs} +1 -1
  29. package/dist/devTools/chrome.d.ts +6 -0
  30. package/dist/devTools/chrome.mjs +2 -2
  31. package/dist/devTools/index.mjs +5 -5
  32. package/dist/devTools/sight/index.d.ts +1 -0
  33. package/dist/devTools/sight/index.mjs +1 -0
  34. package/dist/devTools/sight/sight.d.ts +28 -0
  35. package/dist/devTools/sight/sight.mjs +127 -0
  36. package/dist/devTools/utils/PlitziConsole.d.ts +14 -0
  37. package/dist/devTools/utils/PlitziConsole.mjs +20 -3
  38. package/dist/flags/flagsCookie.mjs +4 -4
  39. package/dist/flags/resolveFlags.d.ts +1 -1
  40. package/dist/helpers/index.mjs +19 -19
  41. package/dist/helpers/ruleEvaluator.d.ts +2 -0
  42. package/dist/helpers/ruleEvaluator.mjs +2 -2
  43. package/dist/helpers/scroll.d.ts +10 -0
  44. package/dist/helpers/scroll.mjs +2 -2
  45. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +90 -88
  46. package/dist/helpers/twigWrapper/Evaluator/helpers.d.ts +6 -0
  47. package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +11 -2
  48. package/dist/helpers/twigWrapper/filters/arrays.d.ts +2 -0
  49. package/dist/helpers/twigWrapper/filters/arrays.mjs +66 -0
  50. package/dist/helpers/twigWrapper/filters/catalog/index.d.ts +17 -0
  51. package/dist/helpers/twigWrapper/filters/catalog/index.mjs +351 -0
  52. package/dist/helpers/twigWrapper/filters/dateParts.d.ts +25 -0
  53. package/dist/helpers/twigWrapper/filters/dateParts.mjs +56 -0
  54. package/dist/helpers/twigWrapper/filters/dates.d.ts +2 -0
  55. package/dist/helpers/twigWrapper/filters/dates.mjs +97 -0
  56. package/dist/helpers/twigWrapper/filters/filters.d.ts +3 -13
  57. package/dist/helpers/twigWrapper/filters/filters.mjs +25 -483
  58. package/dist/helpers/twigWrapper/filters/hashing.d.ts +3 -0
  59. package/dist/helpers/twigWrapper/filters/hashing.mjs +101 -0
  60. package/dist/helpers/twigWrapper/filters/index.mjs +4 -1
  61. package/dist/helpers/twigWrapper/filters/misc.d.ts +5 -0
  62. package/dist/helpers/twigWrapper/filters/misc.mjs +52 -0
  63. package/dist/helpers/twigWrapper/filters/numbers.d.ts +2 -0
  64. package/dist/helpers/twigWrapper/filters/numbers.mjs +36 -0
  65. package/dist/helpers/twigWrapper/filters/objects.d.ts +3 -0
  66. package/dist/helpers/twigWrapper/filters/objects.mjs +61 -0
  67. package/dist/helpers/twigWrapper/filters/raw.d.ts +8 -0
  68. package/dist/helpers/twigWrapper/filters/raw.mjs +7 -0
  69. package/dist/helpers/twigWrapper/filters/strings.d.ts +7 -0
  70. package/dist/helpers/twigWrapper/filters/strings.mjs +79 -0
  71. package/dist/helpers/twigWrapper/filters/types.d.ts +5 -0
  72. package/dist/helpers/twigWrapper/filters/types.mjs +4 -0
  73. package/dist/helpers/twigWrapper/filters/values.d.ts +12 -0
  74. package/dist/helpers/twigWrapper/filters/values.mjs +17 -0
  75. package/dist/helpers/twigWrapper/inspectTemplate.d.ts +5 -0
  76. package/dist/helpers/twigWrapper/inspectTemplate.mjs +39 -20
  77. package/dist/helpers/utils.d.ts +4 -0
  78. package/dist/helpers/utils.mjs +3 -5
  79. package/dist/navigation/index.d.ts +2 -0
  80. package/dist/navigation/index.mjs +2 -1
  81. package/dist/navigation/sitemap.d.ts +16 -0
  82. package/dist/navigation/sitemap.mjs +25 -0
  83. package/dist/network/entitlements.d.ts +101 -0
  84. package/dist/network/entitlements.mjs +4 -0
  85. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.d.ts +31 -0
  86. package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +13 -0
  87. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.d.ts +5 -0
  88. package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +11 -0
  89. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.d.ts +1 -1
  90. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -1
  91. package/dist/network/graphql/builder/Mutations/index.d.ts +5 -0
  92. package/dist/network/graphql/builder/Mutations/index.mjs +150 -146
  93. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.d.ts +40 -0
  94. package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +24 -0
  95. package/dist/network/graphql/builder/Queries/index.d.ts +3 -0
  96. package/dist/network/graphql/builder/Queries/index.mjs +44 -42
  97. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +3 -1
  98. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +1 -1
  99. package/dist/network/index.d.ts +1 -0
  100. package/dist/network/index.mjs +9 -8
  101. package/dist/network/spaceEvents.d.ts +20 -1
  102. package/dist/network/spaceEvents.mjs +12 -0
  103. package/dist/project/index.mjs +8 -5
  104. package/dist/project/layout/check.d.ts +22 -0
  105. package/dist/project/layout/check.mjs +60 -0
  106. package/dist/project/{layout.d.ts → layout/codes.d.ts} +3 -66
  107. package/dist/project/layout/codes.mjs +108 -0
  108. package/dist/project/layout/contents.d.ts +10 -0
  109. package/dist/project/layout/contents.mjs +31 -0
  110. package/dist/project/layout/files.d.ts +31 -0
  111. package/dist/project/layout/files.mjs +49 -0
  112. package/dist/project/layout/folders.d.ts +4 -0
  113. package/dist/project/layout/folders.mjs +69 -0
  114. package/dist/project/layout/index.d.ts +16 -0
  115. package/dist/project/layout/index.mjs +5 -0
  116. package/dist/project/layout/plugins.d.ts +46 -0
  117. package/dist/project/layout/plugins.mjs +99 -0
  118. package/dist/project/layout/vendor.d.ts +15 -0
  119. package/dist/project/layout/vendor.mjs +34 -0
  120. package/dist/project/pages/index.d.ts +8 -0
  121. package/dist/project/pages/index.mjs +14 -0
  122. package/dist/project/paths/index.d.ts +52 -4
  123. package/dist/project/paths/index.mjs +2 -2
  124. package/dist/project/root.d.ts +6 -0
  125. package/dist/project/root.mjs +11 -10
  126. package/dist/realtime/client.mjs +104 -91
  127. package/dist/realtime/presence.d.ts +2 -2
  128. package/dist/realtime/presence.mjs +27 -21
  129. package/dist/runs/index.d.ts +73 -0
  130. package/dist/runs/index.mjs +6 -0
  131. package/dist/runs/report.d.ts +56 -0
  132. package/dist/runs/report.mjs +17 -0
  133. package/dist/schema/index.d.ts +6 -0
  134. package/dist/schema/index.mjs +18 -12
  135. package/dist/schema/motion.d.ts +25 -0
  136. package/dist/schema/motion.mjs +47 -19
  137. package/dist/schema/pageAccess.d.ts +6 -0
  138. package/dist/schema/pageAccess.mjs +8 -3
  139. package/dist/schema/pageHead.d.ts +64 -0
  140. package/dist/schema/pageHead.mjs +68 -0
  141. package/dist/schema/providerAnswer.d.ts +17 -0
  142. package/dist/schema/providerAnswer.mjs +4 -0
  143. package/dist/schema/providerWhen.d.ts +36 -0
  144. package/dist/schema/providerWhen.mjs +58 -0
  145. package/dist/schema/schemaSettings.d.ts +14 -0
  146. package/dist/schema/schemaSettings.mjs +4 -0
  147. package/dist/schema/serverElements.d.ts +20 -1
  148. package/dist/schema/serverElements.mjs +41 -28
  149. package/dist/schema/serverInput.d.ts +34 -0
  150. package/dist/schema/serverInput.mjs +60 -0
  151. package/dist/schema/serverQuery.d.ts +47 -0
  152. package/dist/schema/serverQuery.mjs +70 -0
  153. package/dist/server/index.mjs +5 -5
  154. package/dist/server/rsc/refreshRsc.d.ts +6 -2
  155. package/dist/server/rsc/refreshRsc.mjs +75 -59
  156. package/dist/server/rsc/useRscSync.mjs +22 -18
  157. package/dist/source/export.d.ts +1 -1
  158. package/dist/state/index.mjs +3 -3
  159. package/dist/state/paintedState.d.ts +20 -4
  160. package/dist/state/paintedState.mjs +13 -12
  161. package/dist/state/runtimeStatePersist.mjs +109 -48
  162. package/dist/store/renderSettings.d.ts +2 -0
  163. package/dist/store/renderSettings.mjs +13 -5
  164. package/dist/store/storeHooks.d.ts +45 -45
  165. package/dist/style/index.mjs +16 -16
  166. package/dist/style/styleConstants.d.ts +12 -2
  167. package/dist/style/styleConstants.mjs +20 -0
  168. package/dist/style/styleStates.d.ts +5 -0
  169. package/dist/style/styleStates.mjs +21 -5
  170. package/dist/types/ActionTypes.d.ts +26 -3
  171. package/dist/types/AuthTypes.d.ts +19 -1
  172. package/dist/types/CommonTypes.d.ts +3 -2
  173. package/dist/types/ElementTypes.d.ts +1 -1
  174. package/dist/types/InteractionTypes.d.ts +10 -1
  175. package/dist/types/JobTypes.d.ts +2 -1
  176. package/dist/types/OAuthTypes.d.ts +246 -0
  177. package/dist/types/OAuthTypes.mjs +0 -0
  178. package/dist/types/PluginTypes.d.ts +2 -0
  179. package/dist/types/PreviewTypes.d.ts +71 -0
  180. package/dist/types/PreviewTypes.mjs +0 -0
  181. package/dist/types/RealtimeTypes.d.ts +11 -0
  182. package/dist/types/SchemaTypes.d.ts +63 -0
  183. package/dist/types/ServerAdapterTypes.d.ts +345 -0
  184. package/dist/types/ServerAdapterTypes.mjs +0 -0
  185. package/dist/types/ServerConfigTypes.d.ts +527 -0
  186. package/dist/types/ServerConfigTypes.mjs +0 -0
  187. package/dist/types/ServerLogTypes.d.ts +119 -0
  188. package/dist/types/ServerLogTypes.mjs +0 -0
  189. package/dist/types/ServerTypes.d.ts +30 -1215
  190. package/dist/types/StoreTypes.d.ts +39 -1
  191. package/dist/types/TestTypes.d.ts +249 -0
  192. package/dist/types/TestTypes.mjs +0 -0
  193. package/dist/types/index.d.ts +6 -0
  194. package/eslint.config.mjs +3 -1
  195. package/package.json +2 -2
  196. package/setupTests.ts +4 -3
  197. package/dist/project/layout.mjs +0 -394
package/CHANGELOG.md CHANGED
@@ -1,5 +1,157 @@
1
1
  # @plitzi/sdk-shared
2
2
 
3
+ ## 0.39.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f174a61: Released with every `@plitzi` package at this version. What changed in each, and what to do when you upgrade, is in
8
+ `@plitzi/cli`'s `CHANGELOG.md`: one copy of the notes, not one per package.
9
+
10
+ ## 0.39.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 587c35b: A team of agents on one project (`plitzi run`, `plitzi task`), the page tools those agents measure with, tests kept in
15
+ the space, and what authoring and the elements learnt from the runs. Each command and option is in the CLI's README;
16
+ how the runs work, in `docs/en/agent-runs.md`.
17
+
18
+ ## To do when you upgrade
19
+ - **Node 24.** `engines` is `^24.22.1 || >=26.12.1`; Node 22 is no longer supported (`plitzi doctor` says it,
20
+ `doctor --fix` raises an older project's `engines`).
21
+ - **`createServer({ outbound: { privateOrigins } })` replaces `allowPrivatePluginHosts`:** a space's requests reach no
22
+ private address but the origins named (`privateOrigins: ['http://localhost:9000']`).
23
+ - **Job queues from 0.38.20 or before are recreated, not upgraded:** `createMongoJobQueue` / `createMysqlJobQueue` empty
24
+ or drop the old `action_jobs` / `action_kv` and make them again; `mysqlJobSchemaUpgrades` is gone.
25
+ - **`PLITZI_KV_FILE` is `PLITZI_STATE_DIR`**, a folder holding the server's `kv` and job queue.
26
+ - **A social provider's `fetchProfile` takes `{ accessToken, idToken, nonce }`**, and `createSocialAuth(...).start` is
27
+ async.
28
+ - **A `DraftStore` of a deployment's own keeps `inspected`** beside `reusable`, or a test session renders without the
29
+ state bridge.
30
+ - **`navigation.navigate(url, { external, replace })`** takes an object where it took `navigate(url, true)`.
31
+ - **`window.__plitzi.setSource` / `setAttribute` may answer `{ refused }`**: read it before treating the answer as written.
32
+ - **Renamed:** `stepText` → `e2eStepText` (a run's `said` is the step in words); `OverQuotaNotice` → `QuotaNotice` and
33
+ its classes `plitzi-quota-notice…`; `sightOf` / `sightText` come from `@plitzi/sdk-shared/devTools/sight`.
34
+ - **`SchemaVariables` and `StyleVariables` draw no add button of their own:** the holder passes `adding`, `onAddingEnd`
35
+ and optionally `empty`.
36
+ - **A page handed to `runE2eTest`** has `selectOption`, `position` in `click`/`hover` and `evaluate(fn, arg)`, as a
37
+ Playwright locator: a hand-written page adds them.
38
+ - **Journey steps play as the page commands do:** `scroll` with `dx`/`dy` scrolls the element's content, `waitFor`
39
+ waits 10 s, `type` replaces a field's value.
40
+ - **Authoring refuses more:** two flows of one element naming a step alike (`step-duplicate`), `visible` written as an
41
+ expression (`visible-expression`), a step condition naming a source by id alone (`condition-short-source`).
42
+ `navbar` / `navbarItem` are no longer read by `specFromSpace`.
43
+ - **`/robots.txt` ends naming its sitemap** unless the space's own text does.
44
+ - **The CLI's part of a project is `.plitzi/`** (it was split with `plitzi/`): `plitzi doctor --fix` moves it, and a
45
+ tsconfig names `.plitzi/**/*`.
46
+ - **`plitzi upgrade`** brings the new scripts (`start:preview`, the visual suite's server on 8400, `test`), the ignores
47
+ for `.plitzi/plitzi-reports/` and the skills. `test` runs the project's own tests, so red tests now fail
48
+ `plitzi verify` and a run's checks.
49
+ - **Reports to Plitzi live in `.plitzi/plitzi-reports/`**, committed: a run's in `runs/<run>/`, an agent's in
50
+ `agents/<date>/`. The old files are read no more.
51
+ - **The CLI's surface is smaller — one command for each thing.** Old names and flags are refused naming the new one;
52
+ `plitzi upgrade skills --write` updates the agents' skills. The main moves: `run plan` / `run rehearse` →
53
+ `run open --dry-run [--rehearse]`; `run extend` → `run open <stage>`; `run purge` → `run abort`; `task take` →
54
+ `task next <task>`; `task ask` / `block` / `note` → `task tell --ask | --blocked | --handoff`; `task wait` / `release`
55
+ → `task claim --wait | --release`; `task request` → `task propose --file`; `task check --before | --mutate` →
56
+ `task prove`; `run feedback` → `run report --plitzi`; `functions pull|push` → `space pull|push functions`;
57
+ `runtime push` → `space push runtime`; `page shot --live` / `--clip` → `--fresh` / `--within`; `PLITZI_TASK_TOKEN` →
58
+ `PLITZI_TOKEN`.
59
+ - **Research and reviews are cards on one board:** `task spike` and the separate UI review are gone; a card's `review`
60
+ names its roles in order. Runs opened before keep working.
61
+ - **Page commands:** `page check --expect` fails only on what it expects; every page command reads at 900 px tall
62
+ (`--height`); a page that sends a guest away is read signed in as the project's account (`--as`, `--guest`).
63
+ - **`create --from`** names page files by the page's name; a space's functions are pushed without their tests.
64
+
65
+ ## A space's tests (`@plitzi/sdk-authoring`, `@plitzi/sdk-shared`, `@plitzi/plitzi-builder`, `@plitzi/sdk-mcp`)
66
+ - **Tests are part of the space's document** (`Schema.tests`): unit tests (element checks) and journeys (what a visitor
67
+ does), authored in code, edited in the builder's Tests area, played on the canvas or the server. See
68
+ `docs/en/space-tests.md`.
69
+ - **Journeys play signed in as test accounts** (`tests.accounts`), carry tags, can be held and stopped
70
+ (`runE2eTest`'s `beforeStep`), and hold element checks (`e2e.expectCheck`).
71
+ - **`plitzi test [id…]`** runs a project's tests; **`plitzi_test`** lets an agent run them over the MCP. What a plan
72
+ allows (`journeysPerSpace`, `serverRunsPerMonth`) is in its entitlements; a `canTest` grant writes tests alone.
73
+
74
+ ## Several agents on one project (`@plitzi/cli`)
75
+ - **A run is a kanban:** a lead plans, reviews and closes; developers, testers, designers and scouts take cards with
76
+ `task next`, each in its own copy of the project; every card is reviewed by the roles it names, step by step.
77
+ Nothing reaches the project until a person applies the run (`run finish --apply`).
78
+ - **Files are owned by imports:** one agent per file, shared files taken by turns or changed by agreement
79
+ (`task propose`), merged line by line, checked on the whole result.
80
+ - **The run keeps itself going:** a keeper starts the agents work is waiting for, and holds
81
+ starts after the harness's limit or repeated quick exits until the lead allows them (`run hold`, `run allow`).
82
+ - **`run monitor`:** the run live in a terminal — board, flow, agents, spend, activity — with an emergency panel (`!`)
83
+ to pause, resume, hold or allow agents.
84
+ - **A change mid-run says what it reaches:** `run open <stage> --dry-run` and `run amend --dry-run` name the approved
85
+ tasks, tasks at work and tests each change touches, read off the import graph.
86
+ - **Reviews see what goes in:** a review taken says whether the task merges with the run's newer work and, if not, the
87
+ failing lines; `task show <file> --merged` and `task look --merged` read and serve the merge;
88
+ `task look --alone <element> --with '{…}'` draws a component or plugin no page places yet. A step's time stops while
89
+ its reviewer proves or looks.
90
+ - **Proofs:** `task prove --before` (what each acceptance line proves against the run before the task) and
91
+ `--mutate` (whether a task's tests catch a broken change, with a control run).
92
+ - **The finish:** `run finish` checks the whole result and stops at the first failing line; `--every-line` reports
93
+ them all. The run then leaves its reports in `.plitzi/plitzi-reports/runs/<run>/`.
94
+ - **A report to Plitzi holds nothing of the person or the project:** a run's `feedback.md` writes over names, emails,
95
+ addresses, IPs, the project's files, tasks and elements, leaves out what was said of the project alone, and lists
96
+ quoted passages for the person to read before sending. `plitzi feedback` carries no project name, asks the developer
97
+ before anything of the project goes in, and `plitzi feedback --check <file>` names what a filled report still holds.
98
+
99
+ ## Page tools (`@plitzi/cli`, `@plitzi/sdk-authoring`)
100
+ - **`page measure`** reads what an element draws (`--only drawn`, `box-*`, `attr:<name>`, `accessible-name`,
101
+ `scroll-*`, custom properties) and holds bounds and positions (`--expect "width<=44px"`, `"a.bottom + 8 <= b.top"`).
102
+ - **`page play`** plays steps — `drag … hold`, `scroll page 1500`, `click <el> 30%,60%` — reads what is drawn, not
103
+ what is in the DOM, and `--motion` plays animations moving. A press is made once and waits for the page to take it.
104
+ - **`page check`** says what a visitor cannot reach, text cut or spilling, canvases left blank, the server's error page
105
+ when the space does not author, and holds a text whole (`=`) or in part (`~`).
106
+ - **`page shot`** waits for canvases, pictures hovers (`--hover`, `--frames`) and parts (`--within`), and says what it
107
+ could not picture.
108
+ - **Every page command reads a page as one visitor from the same flags** (`--as`, `--guest`, `--width`, `--height`,
109
+ `--fresh`), with a browser driver of the CLI's own.
110
+
111
+ ## Authoring (`@plitzi/sdk-authoring`)
112
+ - **New checks:** a server provider the page server cannot read (`server-query-unresolved`) or that reads browser state
113
+ (`server-when-unknown`), an action without `runtime: 'server'` (`server-source-in-browser`), class overrides,
114
+ messages arriving while a flow runs, unused plugins.
115
+ - **New authoring:** `focus('field')`, a factory for every trigger, the scroll family's sides, `pagesIn(...)` to
116
+ register pages by folder, channel topics with a choice, a plugin's imported stylesheets read for its tokens.
117
+ - **An element drawn alone:** a server started with `PLITZI_PREVIEW_FILE` gets a page for one element at
118
+ `/plitzi-preview` (`withPreview`, `SpacePreviewError`) — what `task look --alone` uses.
119
+
120
+ ## Elements and the SDK (`@plitzi/sdk-elements`, `@plitzi/plitzi-sdk`, `@plitzi/sdk-shared`)
121
+ - **Navigation:** `navigate` can replace the address, and a navigation inside the site leaves the scroll as a page
122
+ load would.
123
+ - **Providers:** a `when` holds the same in the browser and on the page server; a server provider can read another
124
+ site's address while the page is built.
125
+ - **Plans and roles in the contract:** entitlements (`TSpaceEntitlements`), the space role (`TSpaceAccess`), the quota
126
+ warning at 80% (`render.quotaNear`) and the "Made with Plitzi" badge (`PlitziBadge`).
127
+ - **Fixes:** a binding's `sourceTo` is the previous value; an element with no tag and no `visible` draws nothing;
128
+ placeholder words never reach a page; notifications stay open for a visitor who asked for less motion.
129
+
130
+ ## Server (`@plitzi/sdk-server`, `@plitzi/sdk-auth`, `@plitzi/sdk-mcp`)
131
+ - **`/sitemap.xml`** for every space, and `/robots.txt` naming it.
132
+ - **Accounts:** terms accepted at sign-up (MySQL schema version 7), single sign-on with any OpenID Connect issuer
133
+ (`createOidcProvider`), providers resolved at run time, a password that may not sign in, `/auth/continue` with a step
134
+ of the deployment's own, a signed-out visitor never signed back in by a stale answer.
135
+ - **Policy adapters:** metering can hold a page back (503), decide the badge and `noindex`; the MCP can cap tool calls
136
+ and names the space's plan; realtime admits spaces per deployment.
137
+ - **Dev server:** a removed plugin folder is unregistered (`PluginRegistry.unregister`), and a space that does not
138
+ author is said whole, with no stack.
139
+
140
+ ## The builder (`@plitzi/plitzi-builder`)
141
+ - **A Tests area** with journeys played beside the page at the journey's device, and element checks.
142
+ - **One way to build a panel**, a header grouped by what its controls do, and the layout's mask dimming only what the
143
+ layout draws.
144
+ - **Plans and roles shown:** what the role allows (`useSpaceAccess`), what the plan leaves out shown locked, the plan
145
+ and its spend in the header; pages left out of the sitemap marked.
146
+
147
+ ## Dev tools (`@plitzi/sdk-dev-tools`)
148
+ - **`element(id).visible` is what a visitor sees** (`sightOf`), with why not; `element(id).resolved` says what each
149
+ binding gave; a refused server action is a `refused` step.
150
+ - **Report what you see** in the Run tab of a run's preview, and the panel docks at the bottom under 900 px.
151
+
152
+ ## The workspace
153
+ - **No file past 600 lines of code** (`max-lines`), and ESLint's `quotes` rule is gone — Prettier writes them.
154
+
3
155
  ## 0.38.24
4
156
 
5
157
  ### Patch Changes
@@ -3616,7 +3768,7 @@ author`, `plitzi_validate`/`plitzi_apply`, `plitzi explain` and the builder's pr
3616
3768
  - **Devices are listed by device, not by session.** `GET /devices/sessions` groups sessions by what they were created
3617
3769
  from and answers this device apart; a browser that signed in forty times is one row saying "40 sessions". The list
3618
3770
  had shipped and drawn every session — 1,218 for one account a test suite signs in as — inside a box that scrolled.
3619
- - **Every device is named for what it is**: the application as it registered over OAuth (`Plitzi CLI on carlos-mbp`,
3771
+ - **Every device is named for what it is**: the application as it registered over OAuth (`Plitzi CLI on dev-laptop`,
3620
3772
  `Plitzi Desktop on studio`), a browser and its system, an automated client (Playwright, headless Chrome) — never a
3621
3773
  raw user agent. Sessions record their address and **when they were last used** (at most every five minutes, on the
3622
3774
  lookup a request already makes). A sign-in deletes the account's dead sessions.
@@ -30,6 +30,27 @@ export declare const isFunctionRoutePath: (path: string) => boolean;
30
30
  * reads exactly this.
31
31
  */
32
32
  export declare const isFunctionsSourcePath: (path: string) => boolean;
33
+ /**
34
+ * The files a space's functions are made of, each a definition of its own: every file at the top of `functions/` —
35
+ * never one in a folder (a helper), a test or a declaration. A domain is a file (`rooms.ts`, `queue.ts`) that exports
36
+ * `defineFunctions({ tasks })` by default, and nothing lists them: a run's agents all appended to one `index.ts`, and
37
+ * four of its conflicts and three integration tasks were that list. A file with no definition by default — a module of
38
+ * types, a helper at the top — is imported by the others, as any file: the bundle starts from those whose text
39
+ * {@link exportsByDefault}, never from the rest.
40
+ */
41
+ export declare const isFunctionsDefinitionFile: (file: string) => boolean;
42
+ /**
43
+ * Whether a file's text exports something by default — `export default …`, `export { x as default }`: a definition,
44
+ * for a file at the top of `functions/`. A run's `testing.ts`, a helper of its tests that reads `node:fs`, has none:
45
+ * bundled as a definition, it refused every build.
46
+ */
47
+ export declare const exportsByDefault: (text: string) => boolean;
48
+ /**
49
+ * Whether a file of `functions/` is a test's — a test (`*.test.ts`, `*.spec.ts`) or what only tests read
50
+ * (`*.fixture.json`): the project's, never the space's. A run's push sent 33 files to the platform, a third of them
51
+ * tests and their fixtures; a working copy is read without them.
52
+ */
53
+ export declare const isFunctionsTestPath: (path: string) => boolean;
33
54
  /** How a reader reaches a directory, whatever it runs on: Node's `fs`, a test's map. */
34
55
  export type FunctionsSourceReader = {
35
56
  list: (dir: string) => Promise<{
@@ -40,7 +61,7 @@ export type FunctionsSourceReader = {
40
61
  };
41
62
  /**
42
63
  * A space's functions as a directory holds them — every source file under `root`, by its path there (`lib/feed.ts`),
43
- * `node_modules` and dotted folders skipped. What a project's working copy is read as, by the CLI and by a server
64
+ * `node_modules`, dotted folders and the tests' files skipped. What a project's working copy is read as, by the CLI and by a server
44
65
  * loading its own; a directory that is not there reads as none.
45
66
  */
46
67
  export declare const readFunctionsSource: (root: string, reader: FunctionsSourceReader) => Promise<Record<string, string>>;
@@ -2,7 +2,7 @@
2
2
  var e = "/fn", t = "plugins", n = "functions.source.json", r = (e, n = "/") => `/fn/${t}/${encodeURIComponent(e)}${n.startsWith("/") ? n : `/${n}`}`, i = {
3
3
  cpuMs: 100,
4
4
  wallMs: 1e4
5
- }, a = (e) => e === "/fn" || e.startsWith("/fn/"), o = (e) => /^[A-Za-z0-9_][A-Za-z0-9_./-]*\.(ts|js|mjs|json)$/.test(e) && !e.split("/").some((e) => e === ".." || e === "." || e === ""), s = async (e, t) => {
5
+ }, a = (e) => e === "/fn" || e.startsWith("/fn/"), o = (e) => /^[A-Za-z0-9_][A-Za-z0-9_./-]*\.(ts|js|mjs|json)$/.test(e) && !e.split("/").some((e) => e === ".." || e === "." || e === ""), s = (e) => !e.includes("/") && /\.(ts|js|mjs)$/.test(e) && !/\.(test|spec)\.(ts|js|mjs)$/.test(e) && !e.endsWith(".d.ts"), c = (e) => /^\s*export\s+default\b|\bas\s+default\s*[,}]/m.test(e), l = (e) => /\.(test|spec|fixture)\.[A-Za-z0-9]+$/.test(e), u = async (e, t) => {
6
6
  let n = {}, r = async (i) => {
7
7
  let a;
8
8
  try {
@@ -12,10 +12,10 @@ var e = "/fn", t = "plugins", n = "functions.source.json", r = (e, n = "/") => `
12
12
  }
13
13
  for (let s of a) {
14
14
  let a = i ? `${i}/${s.name}` : s.name;
15
- s.directory ? s.name !== "node_modules" && !s.name.startsWith(".") && await r(a) : o(a) && (n[a] = await t.read(`${e}/${a}`));
15
+ s.directory ? s.name !== "node_modules" && !s.name.startsWith(".") && await r(a) : o(a) && !l(a) && (n[a] = await t.read(`${e}/${a}`));
16
16
  }
17
17
  };
18
18
  return await r(""), n;
19
19
  };
20
20
  //#endregion
21
- export { i as DEFAULT_FUNCTION_TIME_LIMITS, e as FUNCTION_ROUTES_PREFIX, n as PLUGIN_FUNCTIONS_SOURCE, t as PLUGIN_ROUTES_SEGMENT, a as isFunctionRoutePath, o as isFunctionsSourcePath, r as pluginRoutePath, s as readFunctionsSource };
21
+ export { i as DEFAULT_FUNCTION_TIME_LIMITS, e as FUNCTION_ROUTES_PREFIX, n as PLUGIN_FUNCTIONS_SOURCE, t as PLUGIN_ROUTES_SEGMENT, c as exportsByDefault, a as isFunctionRoutePath, s as isFunctionsDefinitionFile, o as isFunctionsSourcePath, l as isFunctionsTestPath, r as pluginRoutePath, u as readFunctionsSource };
@@ -2,7 +2,7 @@ export { accessRefusal, actionAccessOf } from './access';
2
2
  export { JOB_KINDS, JOB_STATUSES, TERMINAL_JOB_STATUSES, isJobKind, isJobStatus, isTerminalJobStatus } from './jobs';
3
3
  export { cronFiresBetween, cronMatches, cronNextFire, isKnownTimeZone, parseCron, zonedClock } from './cron';
4
4
  export { FAILURE_HANDLER_TASK } from './failureHandler';
5
- export { DEFAULT_FUNCTION_TIME_LIMITS, FUNCTION_ROUTES_PREFIX, isFunctionRoutePath, isFunctionsSourcePath, PLUGIN_FUNCTIONS_SOURCE, PLUGIN_ROUTES_SEGMENT, pluginRoutePath, readFunctionsSource } from './functions';
5
+ export { DEFAULT_FUNCTION_TIME_LIMITS, FUNCTION_ROUTES_PREFIX, isFunctionRoutePath, exportsByDefault, isFunctionsDefinitionFile, isFunctionsSourcePath, isFunctionsTestPath, PLUGIN_FUNCTIONS_SOURCE, PLUGIN_ROUTES_SEGMENT, pluginRoutePath, readFunctionsSource } from './functions';
6
6
  export { triggerAccess, triggerCacheMs, triggerHasStaleVerify, triggerInput, triggerVerify } from './triggerParams';
7
7
  export { actionName, actionTriggers, isActionEnabled } from './triggers';
8
8
  export { isActionDocument, validateActionDocument } from './validateDocument';
@@ -1,10 +1,10 @@
1
1
  import { accessRefusal as e, actionAccessOf as t } from "./access.mjs";
2
2
  import { cronFiresBetween as n, cronMatches as r, cronNextFire as i, isKnownTimeZone as a, parseCron as o, zonedClock as s } from "./cron.mjs";
3
3
  import { FAILURE_HANDLER_TASK as c } from "./failureHandler.mjs";
4
- import { DEFAULT_FUNCTION_TIME_LIMITS as l, FUNCTION_ROUTES_PREFIX as u, PLUGIN_FUNCTIONS_SOURCE as d, PLUGIN_ROUTES_SEGMENT as f, isFunctionRoutePath as p, isFunctionsSourcePath as m, pluginRoutePath as h, readFunctionsSource as g } from "./functions.mjs";
5
- import { JOB_KINDS as _, JOB_STATUSES as v, TERMINAL_JOB_STATUSES as y, isJobKind as b, isJobStatus as x, isTerminalJobStatus as S } from "./jobs.mjs";
6
- import { triggerAccess as C, triggerCacheMs as w, triggerHasStaleVerify as T, triggerInput as E, triggerVerify as D } from "./triggerParams.mjs";
7
- import { actionName as O, actionTriggers as k, isActionEnabled as A } from "./triggers.mjs";
8
- import { isActionDocument as j, validateActionDocument as M } from "./validateDocument.mjs";
9
- import { SMTP_CREDENTIAL_KEYS as N, isSingleEmailAddress as P, readSmtpCredential as F } from "./smtp.mjs";
10
- export { l as DEFAULT_FUNCTION_TIME_LIMITS, c as FAILURE_HANDLER_TASK, u as FUNCTION_ROUTES_PREFIX, _ as JOB_KINDS, v as JOB_STATUSES, d as PLUGIN_FUNCTIONS_SOURCE, f as PLUGIN_ROUTES_SEGMENT, N as SMTP_CREDENTIAL_KEYS, y as TERMINAL_JOB_STATUSES, e as accessRefusal, t as actionAccessOf, O as actionName, k as actionTriggers, n as cronFiresBetween, r as cronMatches, i as cronNextFire, j as isActionDocument, A as isActionEnabled, p as isFunctionRoutePath, m as isFunctionsSourcePath, b as isJobKind, x as isJobStatus, a as isKnownTimeZone, P as isSingleEmailAddress, S as isTerminalJobStatus, o as parseCron, h as pluginRoutePath, g as readFunctionsSource, F as readSmtpCredential, C as triggerAccess, w as triggerCacheMs, T as triggerHasStaleVerify, E as triggerInput, D as triggerVerify, M as validateActionDocument, s as zonedClock };
4
+ import { DEFAULT_FUNCTION_TIME_LIMITS as l, FUNCTION_ROUTES_PREFIX as u, PLUGIN_FUNCTIONS_SOURCE as d, PLUGIN_ROUTES_SEGMENT as f, exportsByDefault as p, isFunctionRoutePath as m, isFunctionsDefinitionFile as h, isFunctionsSourcePath as g, isFunctionsTestPath as _, pluginRoutePath as v, readFunctionsSource as y } from "./functions.mjs";
5
+ import { JOB_KINDS as b, JOB_STATUSES as x, TERMINAL_JOB_STATUSES as S, isJobKind as C, isJobStatus as w, isTerminalJobStatus as T } from "./jobs.mjs";
6
+ import { triggerAccess as E, triggerCacheMs as D, triggerHasStaleVerify as O, triggerInput as k, triggerVerify as A } from "./triggerParams.mjs";
7
+ import { actionName as j, actionTriggers as M, isActionEnabled as N } from "./triggers.mjs";
8
+ import { isActionDocument as P, validateActionDocument as F } from "./validateDocument.mjs";
9
+ import { SMTP_CREDENTIAL_KEYS as I, isSingleEmailAddress as L, readSmtpCredential as R } from "./smtp.mjs";
10
+ export { l as DEFAULT_FUNCTION_TIME_LIMITS, c as FAILURE_HANDLER_TASK, u as FUNCTION_ROUTES_PREFIX, b as JOB_KINDS, x as JOB_STATUSES, d as PLUGIN_FUNCTIONS_SOURCE, f as PLUGIN_ROUTES_SEGMENT, I as SMTP_CREDENTIAL_KEYS, S as TERMINAL_JOB_STATUSES, e as accessRefusal, t as actionAccessOf, j as actionName, M as actionTriggers, n as cronFiresBetween, r as cronMatches, i as cronNextFire, p as exportsByDefault, P as isActionDocument, N as isActionEnabled, m as isFunctionRoutePath, h as isFunctionsDefinitionFile, g as isFunctionsSourcePath, _ as isFunctionsTestPath, C as isJobKind, w as isJobStatus, a as isKnownTimeZone, L as isSingleEmailAddress, T as isTerminalJobStatus, o as parseCron, v as pluginRoutePath, y as readFunctionsSource, R as readSmtpCredential, E as triggerAccess, D as triggerCacheMs, O as triggerHasStaleVerify, k as triggerInput, A as triggerVerify, F as validateActionDocument, s as zonedClock };
@@ -5,6 +5,7 @@ var e = /* @__PURE__ */ new Set(), t = async (t) => (await Promise.all([...e].ma
5
5
  "revoked",
6
6
  "inactive",
7
7
  "unverified",
8
+ "sso-required",
8
9
  "malformed",
9
10
  "outdated",
10
11
  "network"
@@ -1,4 +1,4 @@
1
1
  export { authFailureFromResponse, onAuthFailure, reportAuthFailure, sameRegistrableDomain } from './failureChannel';
2
- export { checkVisitorRoles, visitorAccess, VISITOR_NAME } from './visitorRoles';
2
+ export { checkVisitorRoles, rolesGrant, visitorAccess, VISITOR_NAME } from './visitorRoles';
3
3
  export type { AuthFailureListener, AuthFailureSignal } from './failureChannel';
4
4
  export type { VisitorRoles } from './visitorRoles';
@@ -1,3 +1,3 @@
1
1
  import { authFailureFromResponse as e, onAuthFailure as t, reportAuthFailure as n, sameRegistrableDomain as r } from "./failureChannel.mjs";
2
- import { VISITOR_NAME as i, checkVisitorRoles as a, visitorAccess as o } from "./visitorRoles.mjs";
3
- export { i as VISITOR_NAME, e as authFailureFromResponse, a as checkVisitorRoles, t as onAuthFailure, n as reportAuthFailure, r as sameRegistrableDomain, o as visitorAccess };
2
+ import { VISITOR_NAME as i, checkVisitorRoles as a, rolesGrant as o, visitorAccess as s } from "./visitorRoles.mjs";
3
+ export { i as VISITOR_NAME, e as authFailureFromResponse, a as checkVisitorRoles, t as onAuthFailure, n as reportAuthFailure, o as rolesGrant, r as sameRegistrableDomain, s as visitorAccess };
@@ -25,3 +25,11 @@ export declare const visitorAccess: (declared: unknown, held: readonly string[])
25
25
  roles: string[];
26
26
  permissions: string[];
27
27
  };
28
+ /**
29
+ * What a set of roles gives in a space — the permissions of each, once — and the roles it names that the space does not
30
+ * declare (removed since, or never there): what a test account signed in as them may, and what it is warned of.
31
+ */
32
+ export declare const rolesGrant: (declared: VisitorRoles | undefined, roles: readonly string[]) => {
33
+ permissions: string[];
34
+ missing: string[];
35
+ };
@@ -43,6 +43,9 @@ var e = /^[A-Za-z][\w-]{0,63}$/, t = "`visitorRoles: { author: [\"postPublish\"]
43
43
  roles: i,
44
44
  permissions: [...new Set(i.flatMap((e) => r.roles[e]))]
45
45
  };
46
- };
46
+ }, i = (e, t) => ({
47
+ permissions: [...new Set(t.flatMap((t) => e?.[t] ?? []))],
48
+ missing: t.filter((t) => !e || !Object.hasOwn(e, t))
49
+ });
47
50
  //#endregion
48
- export { e as VISITOR_NAME, n as checkVisitorRoles, r as visitorAccess };
51
+ export { e as VISITOR_NAME, n as checkVisitorRoles, i as rolesGrant, r as visitorAccess };
@@ -33,6 +33,19 @@ export interface ElementDeclarationData {
33
33
  * reads it to resolve a binding that named the element alone.
34
34
  */
35
35
  sourceType?: string;
36
+ /**
37
+ * What its source holds, field by field — `atEnd: 'At its last slide…'` — for whoever writes a binding to it: what
38
+ * `plitzi explain <type>` says and its search finds, where an author otherwise read the bundle's types to learn a
39
+ * carousel could say where it stands. The fields the element writes itself; a provider's answer is the
40
+ * service's, and is said as `…`.
41
+ */
42
+ publishes?: Record<string, string>;
43
+ /**
44
+ * What it writes on its node that a style or a check reads it by — `role="tab"`, `aria-selected`, a class it adds —
45
+ * and how a class styles it: what `plitzi explain <type>` says under "On the page". A run's developer read the
46
+ * served HTML to learn a tab says `aria-selected`, and lit the open tab with a state that never matched it.
47
+ */
48
+ marks?: Record<string, string>;
36
49
  /**
37
50
  * The triggers this type fires on top of the ones every element does (`onClick`, `onLoad`…), by action name.
38
51
  *
@@ -83,8 +96,17 @@ export interface ElementDeclarationData {
83
96
  * authoring lint, which holds them to that context.
84
97
  */
85
98
  serverTemplates?: readonly string[];
99
+ /**
100
+ * The attributes that are the element's content — what it says or shows, never how: its words, a link's address, an
101
+ * image's source and its text alternative, a field's label. A space role that edits the content and not the design
102
+ * (`spaceContent`, a client editing a site an agency built) changes these alone, in the builder and at the server; an
103
+ * element that names none has nothing such a role may change.
104
+ */
105
+ contentAttributes?: readonly string[];
86
106
  content?: {
87
107
  attributes?: Record<string, unknown>;
108
+ /** The attributes whose default is the builder's placeholder words, never a value ({@link ElementContentSpec}). */
109
+ placeholders?: readonly string[];
88
110
  definition?: {
89
111
  label?: string;
90
112
  };
@@ -159,6 +181,12 @@ export declare const valuesOf: <T extends string>() => <const V extends readonly
159
181
  /** What a built-in element writes in its declaration's `content`: what is its own — the rest is filled in. */
160
182
  export interface ElementContentSpec {
161
183
  attributes: Record<string, unknown>;
184
+ /**
185
+ * The attributes whose default is the builder's placeholder — the words an element shows on the canvas when it is
186
+ * placed ("Text", "Button") — never a value: code that writes the element without one draws nothing, as a bound
187
+ * text whose binding read nothing (a run's room cards and Home's window said "Text").
188
+ */
189
+ placeholders?: readonly string[];
162
190
  /** Left out: `type` (the declaration's), no bindings, visible, and the `base` style selector beside its own. */
163
191
  definition: Omit<Partial<ElementDefinition>, 'type' | 'rootId' | 'parentId' | 'interactions' | 'runtime' | 'styleSelectors'> & {
164
192
  label: string;
@@ -227,7 +255,9 @@ export type DeclaredElement<D extends ElementDeclarationSpec, A> = D & {
227
255
  * Called twice, as {@link definePlugin} is: the first call takes the attributes the element accepts, the second the
228
256
  * declaration.
229
257
  */
230
- export declare const elementDeclaration: <A>() => <const D extends ElementDeclarationSpec>(declaration: D) => DeclaredElement<D, A>;
258
+ export declare const elementDeclaration: <A>() => <const D extends ElementDeclarationSpec & {
259
+ contentAttributes?: readonly (keyof A & string)[];
260
+ }>(declaration: D) => DeclaredElement<D, A>;
231
261
  /** An event a plugin fires, as {@link definePlugin} takes it: what a flow it starts reads (`preview`) — the rest derived. */
232
262
  export type PluginTriggerSpec = {
233
263
  /** Left out, the event's name in words: `onEdit` is "On Edit". */
@@ -260,6 +290,9 @@ export interface PluginSpec<A extends object, T extends Record<string, PluginTri
260
290
  market?: Partial<PluginContent<A>['market']>;
261
291
  /** The attributes a data source may be pointed at. Left out, every one. */
262
292
  bindable?: readonly (keyof A & string)[];
293
+ /** The attributes a role that edits the content and not the design may change — its words, a link, a
294
+ * picture. Left out, none: a content editor changes nothing on it. */
295
+ contentAttributes?: readonly (keyof A & string)[];
263
296
  /** Its style before anybody styles it. */
264
297
  style?: PluginSchema['defaultStyle']['style'];
265
298
  /** More of the element's definition — children it starts with (`items`), its style selectors. */
@@ -65,6 +65,19 @@ export declare const SCROLL_CALLBACKS: {
65
65
  };
66
66
  };
67
67
  };
68
+ /**
69
+ * The keyboard's focus given to an element — itself, or the first field, button or link inside it (a form control's
70
+ * input). A composer sent with its key gives its field the focus back; no step could, so only Enter kept it.
71
+ */
72
+ export declare const FOCUS_CALLBACKS: {
73
+ focus: {
74
+ title: string;
75
+ type: "callback";
76
+ strictParams: true;
77
+ params: {};
78
+ };
79
+ };
80
+ /** The callbacks every element answers — `setState`, `scrollTo`, `scrollIntoView`, `focus`… — each with its params, as a flow's step calls them. */
68
81
  export declare const BUILTIN_ELEMENT_CALLBACKS: Record<string, BuiltinElementCallback>;
69
82
  /** The built-in element callback for an action, or undefined when the action is not a known built-in (an
70
83
  * element-type-specific/plugin callback whose schema is not knowable here). */
@@ -63,7 +63,12 @@ var r = {
63
63
  behavior: r
64
64
  }
65
65
  }
66
- }, a = {
66
+ }, a = { focus: {
67
+ title: "Focus",
68
+ type: "callback",
69
+ strictParams: !0,
70
+ params: {}
71
+ } }, o = {
67
72
  setState: {
68
73
  title: "Update Element (set attribute / state)",
69
74
  type: "callback",
@@ -120,9 +125,10 @@ var r = {
120
125
  }
121
126
  }
122
127
  },
123
- ...i
124
- }, o = (e) => Object.hasOwn(a, e) ? a[e] : void 0, s = (t, n) => {
125
- let r = o(t);
128
+ ...i,
129
+ ...a
130
+ }, s = (e) => Object.hasOwn(o, e) ? o[e] : void 0, c = (t, n) => {
131
+ let r = s(t);
126
132
  return r ? {
127
133
  known: !0,
128
134
  params: e(n, r.params, r.strictParams)
@@ -132,4 +138,4 @@ var r = {
132
138
  };
133
139
  };
134
140
  //#endregion
135
- export { a as BUILTIN_ELEMENT_CALLBACKS, i as SCROLL_CALLBACKS, s as applyElementCallback, o as getElementCallback };
141
+ export { o as BUILTIN_ELEMENT_CALLBACKS, a as FOCUS_CALLBACKS, i as SCROLL_CALLBACKS, c as applyElementCallback, s as getElementCallback };
@@ -1,6 +1,6 @@
1
1
  import { toBuilderParams as e, toInteractionCallback as t, toInteractionCallbacks as n } from "./builder.mjs";
2
2
  import { definePlugin as r, elementDeclaration as i, valuesOf as a } from "./declare.mjs";
3
3
  import { BUILTIN_PARAM_TYPES as o, hiddenParams as s, invalidParams as c, missingRequiredParams as l, reconcileParams as u } from "./paramSpec.mjs";
4
- import { BUILTIN_ELEMENT_CALLBACKS as d, SCROLL_CALLBACKS as f, applyElementCallback as p, getElementCallback as m } from "./elementCallbacks.mjs";
5
- import { NOTIFICATION_APPEARANCES as h, NOTIFICATION_DEFAULTS as g, NOTIFICATION_PLACEMENTS as _, readNotificationOptions as v, spaceCallbacks as y } from "./spaceCallbacks.mjs";
6
- export { d as BUILTIN_ELEMENT_CALLBACKS, o as BUILTIN_PARAM_TYPES, h as NOTIFICATION_APPEARANCES, g as NOTIFICATION_DEFAULTS, _ as NOTIFICATION_PLACEMENTS, f as SCROLL_CALLBACKS, p as applyElementCallback, r as definePlugin, i as elementDeclaration, m as getElementCallback, s as hiddenParams, c as invalidParams, l as missingRequiredParams, v as readNotificationOptions, u as reconcileParams, y as spaceCallbacks, e as toBuilderParams, t as toInteractionCallback, n as toInteractionCallbacks, a as valuesOf };
4
+ import { BUILTIN_ELEMENT_CALLBACKS as d, FOCUS_CALLBACKS as f, SCROLL_CALLBACKS as p, applyElementCallback as m, getElementCallback as h } from "./elementCallbacks.mjs";
5
+ import { NOTIFICATION_APPEARANCES as g, NOTIFICATION_DEFAULTS as _, NOTIFICATION_PLACEMENTS as v, readNotificationOptions as y, spaceCallbacks as b } from "./spaceCallbacks.mjs";
6
+ export { d as BUILTIN_ELEMENT_CALLBACKS, o as BUILTIN_PARAM_TYPES, f as FOCUS_CALLBACKS, g as NOTIFICATION_APPEARANCES, _ as NOTIFICATION_DEFAULTS, v as NOTIFICATION_PLACEMENTS, p as SCROLL_CALLBACKS, m as applyElementCallback, r as definePlugin, i as elementDeclaration, h as getElementCallback, s as hiddenParams, c as invalidParams, l as missingRequiredParams, y as readNotificationOptions, u as reconcileParams, b as spaceCallbacks, e as toBuilderParams, t as toInteractionCallback, n as toInteractionCallbacks, a as valuesOf };
@@ -1,4 +1,5 @@
1
1
  import { InteractionParamType } from '../types';
2
+ /** The types a step's, an action's or a task's param takes: what its value is checked as, and the builder's widget for it. */
2
3
  export declare const BUILTIN_PARAM_TYPES: readonly ["text", "textarea", "select", "boolean", "number", "scalar", "json", "elementIds"];
3
4
  export type BuiltinParamType = (typeof BUILTIN_PARAM_TYPES)[number];
4
5
  export interface BuiltinParam {
@@ -1,6 +1,6 @@
1
1
  import { Element } from '../types';
2
2
  import { RuleValue } from '@plitzi/plitzi-ui/QueryBuilder';
3
- declare const getBindingsDetails: (dataSource: Record<string, RuleValue>, element: Element, style?: Record<string, string>) => {
3
+ declare const getBindingsDetails: (dataSource: Record<string, RuleValue>, element: Pick<Element, "attributes" | "definition">, style?: Record<string, string>) => {
4
4
  attributes: Record<string, unknown> & {
5
5
  subType?: string;
6
6
  };
@@ -9,7 +9,7 @@ var c = (e, t, n, r, a) => {
9
9
  let o = r === "initialState" ? `definition.${r}.${a}` : `${r}.${a}`;
10
10
  return {
11
11
  fromValue: t ? i(e, t) : void 0,
12
- toValue: i(n, o, t ? i(e, t) : void 0)
12
+ toValue: i(n, o)
13
13
  };
14
14
  }, l = (e) => typeof e == "number" || typeof e == "string" && !/[;{}<>]/.test(e), u = (u, d, f = {}) => {
15
15
  let { attributes: p, definition: m } = d, { bindings: h } = m;
@@ -12,7 +12,7 @@ export type GlobalSource = (typeof GLOBAL_SOURCES)[number];
12
12
  * What a computed value is evaluated over: every global but `state`, which a flow hands it live, and `computed`, which
13
13
  * is what is being evaluated.
14
14
  */
15
- export declare const COMPUTED_GLOBALS: ("auth" | "flags" | "host" | "navigation" | "variables" | "theme")[];
15
+ export declare const COMPUTED_GLOBALS: ("auth" | "host" | "flags" | "navigation" | "variables" | "theme")[];
16
16
  /**
17
17
  * The fields of the globals whose shape the platform decides, as `GlobalSources` publishes them: a read of any other
18
18
  * — `auth.authenticated` for `auth.isAuthenticated` — resolves to nothing, and the authoring linter says so. An `open`
@@ -3,7 +3,6 @@ export { evaluateComputed, liveSources } from './computed';
3
3
  export { GLOBAL_SOURCES, COMPUTED_GLOBALS } from './globalSources';
4
4
  export type { GlobalSource } from './globalSources';
5
5
  export { default as getBindingsDetails } from './getBindingsDetails';
6
- export { default as resolveVariables } from './resolveVariables';
7
- export type { VariableScope } from './resolveVariables';
6
+ export * from './variables';
8
7
  export { default as utility, utilityOptions } from './utility';
9
8
  export * from './globalSources';
@@ -3,5 +3,5 @@ import { evaluateComputed as r, liveSources as i } from "./computed.mjs";
3
3
  import a, { utilityOptions as o } from "./utility/index.mjs";
4
4
  import s from "./getBindingsDetails.mjs";
5
5
  import c from "./helpers/getSourceName.mjs";
6
- import l from "./resolveVariables.mjs";
6
+ import l from "./variables/resolveVariables.mjs";
7
7
  export { e as COMPUTED_GLOBALS, t as GLOBAL_SOURCES, n as GLOBAL_SOURCE_FIELDS, r as evaluateComputed, s as getBindingsDetails, c as getSourceName, i as liveSources, l as resolveVariables, a as utility, o as utilityOptions };
@@ -1,4 +1,4 @@
1
- import { get as e, set as t } from "@plitzi/plitzi-ui/helpers";
1
+ import { get as e, set as t } from "@plitzi/plitzi-ui/helpers/lodash";
2
2
  var n = {
3
3
  action: "arrayMap",
4
4
  title: "Array Map",
@@ -1,4 +1,4 @@
1
- import { capitalize as e } from "@plitzi/plitzi-ui/helpers";
1
+ import { capitalize as e } from "@plitzi/plitzi-ui/helpers/lodash";
2
2
  var t = {
3
3
  action: "capitalize",
4
4
  title: "Capitalize",
@@ -1,4 +1,4 @@
1
- import { get as e } from "@plitzi/plitzi-ui/helpers";
1
+ import { get as e } from "@plitzi/plitzi-ui/helpers/lodash";
2
2
  var t = {
3
3
  action: "styleSelector",
4
4
  title: "Style Selector",
@@ -39,8 +39,10 @@ var t = {
39
39
  },
40
40
  callback: (t, n, r, i = {}) => {
41
41
  let { originalSelector: a, append: o, selector: s } = n, c = [];
42
- if (o && !a && i.sourceTo) c.push(i.sourceTo, s);
43
- else if (a && o) {
42
+ if (o && !a) {
43
+ let e = typeof i.sourceTo == "string" ? i.sourceTo : "";
44
+ c.push(...e ? [e] : [], s);
45
+ } else if (a && o) {
44
46
  let t = e(r, "definition.styleSelectors.base", "");
45
47
  t ? c.push(t, s) : c.push(s);
46
48
  }
@@ -1,17 +1,21 @@
1
- import { set as e } from "@plitzi/plitzi-ui/helpers/lodash";
1
+ import { isRecord as e } from "../../helpers/isRecord.mjs";
2
+ import { set as t } from "@plitzi/plitzi-ui/helpers/lodash";
2
3
  //#region src/dataSource/utility/styleVariant.ts
3
- var t = (t, n, r, i = {}) => {
4
- let { key: a, variant: o, append: s } = n;
5
- if (!a) return i.sourceTo ?? {};
6
- let c = a || "base", l = o || t;
7
- return typeof l == "object" && !Array.isArray(l) ? l : e(s ? { ...i.sourceTo } : {}, c, l);
8
- }, n = (e) => {
4
+ var n = (n, r, i, a = {}) => {
5
+ let { key: o, variant: s, append: c } = r;
6
+ if (!o) return a.sourceTo ?? {};
7
+ let l = o || "base", u = s || n;
8
+ if (typeof u == "object" && !Array.isArray(u)) return u;
9
+ if (!c) return t({}, l, u);
10
+ let d = a.sourceTo;
11
+ return t(e(d) ? { ...d } : {}, l, u);
12
+ }, r = (e) => {
9
13
  let t = e.reduce((e, { groupLabel: t, option: n }) => (t in e || (e[t] = []), e[t].push(n), e), {});
10
14
  return Object.entries(t).map(([e, t]) => ({
11
15
  label: e,
12
16
  options: t
13
17
  }));
14
- }, r = {
18
+ }, i = {
15
19
  action: "styleVariant",
16
20
  title: "Style Variant",
17
21
  type: "utility",
@@ -21,10 +25,10 @@ var t = (t, n, r, i = {}) => {
21
25
  defaultValue: "",
22
26
  type: "select",
23
27
  options: (e, t) => {
24
- let r = t?.definition?.styleSelectors;
25
- if (!t || !t.definition || !r) return [];
28
+ let n = t?.definition?.styleSelectors;
29
+ if (!t || !t.definition || !n) return [];
26
30
  let i = t.definition.type;
27
- return n(Object.entries(r).flatMap(([e, t]) => (t ? [i, ...t.split(" ")] : [i]).map((t) => ({
31
+ return r(Object.entries(n).flatMap(([e, t]) => (t ? [i, ...t.split(" ")] : [i]).map((t) => ({
28
32
  groupLabel: e,
29
33
  option: {
30
34
  value: `${t}.${e}`,
@@ -70,7 +74,7 @@ var t = (t, n, r, i = {}) => {
70
74
  variant: "",
71
75
  append: ""
72
76
  },
73
- callback: t
77
+ callback: n
74
78
  };
75
79
  //#endregion
76
- export { r as default };
80
+ export { i as default };
@@ -0,0 +1,2 @@
1
+ export { default as resolveVariables } from './resolveVariables';
2
+ export type { VariableScope } from './resolveVariables';
@@ -0,0 +1 @@
1
+ export { default as resolveVariables } from "./resolveVariables.mjs";
@@ -1,4 +1,4 @@
1
- import { SchemaVariable, SchemaVariableValue } from '../types';
1
+ import { SchemaVariable, SchemaVariableValue } from '../../types';
2
2
  /** What a variable's `subValues` are matched against — everything a `when` rule may name. */
3
3
  export type VariableScope = {
4
4
  routeParams?: Record<string, unknown>;