@plitzi/sdk-shared 0.33.2 → 0.34.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 (204) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/actions/cron.d.ts +34 -0
  3. package/dist/actions/cron.mjs +72 -0
  4. package/dist/actions/index.d.ts +6 -0
  5. package/dist/actions/index.mjs +5 -0
  6. package/dist/actions/triggerParams.d.ts +41 -0
  7. package/dist/actions/triggerParams.mjs +40 -0
  8. package/dist/actions/triggers.d.ts +29 -0
  9. package/dist/actions/triggers.mjs +4 -0
  10. package/dist/actions/validateDocument.d.ts +23 -0
  11. package/dist/actions/validateDocument.mjs +267 -0
  12. package/dist/auth/failureChannel.d.ts +9 -4
  13. package/dist/auth/failureChannel.mjs +3 -2
  14. package/dist/authoring/builder.d.ts +51 -0
  15. package/dist/authoring/builder.mjs +29 -0
  16. package/dist/authoring/declare.d.ts +64 -0
  17. package/dist/authoring/declare.mjs +4 -0
  18. package/dist/authoring/elementCallbacks.d.ts +13 -0
  19. package/dist/authoring/elementCallbacks.mjs +71 -0
  20. package/dist/authoring/index.d.ts +21 -0
  21. package/dist/authoring/index.mjs +6 -0
  22. package/dist/authoring/paramSpec.d.ts +51 -0
  23. package/dist/authoring/paramSpec.mjs +40 -0
  24. package/dist/authoring/spaceCallbacks.d.ts +10 -0
  25. package/dist/authoring/spaceCallbacks.mjs +51 -0
  26. package/dist/builder/contexts/BuilderContext.d.ts +2 -4
  27. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  28. package/dist/dataSource/helpers/getSourceName.d.ts +1 -3
  29. package/dist/dataSource/helpers/getSourceName.mjs +1 -1
  30. package/dist/dataSource/index.d.ts +2 -0
  31. package/dist/dataSource/index.mjs +6 -5
  32. package/dist/dataSource/resolveVariables.d.ts +22 -0
  33. package/dist/dataSource/resolveVariables.mjs +16 -0
  34. package/dist/dataSource/utility/index.mjs +15 -13
  35. package/dist/dataSource/utility/not.d.ts +11 -0
  36. package/dist/dataSource/utility/not.mjs +15 -0
  37. package/dist/devTools/debugCookie.d.ts +16 -0
  38. package/dist/devTools/debugCookie.mjs +7 -0
  39. package/dist/devTools/index.d.ts +6 -2
  40. package/dist/devTools/index.mjs +4 -2
  41. package/dist/devTools/interactionLog.d.ts +14 -0
  42. package/dist/devTools/interactionLog.mjs +4 -0
  43. package/dist/helpers/index.d.ts +2 -0
  44. package/dist/helpers/index.mjs +11 -9
  45. package/dist/helpers/reducerOrigin.d.ts +15 -0
  46. package/dist/helpers/reducerOrigin.mjs +4 -0
  47. package/dist/helpers/ruleEvaluator.d.ts +14 -0
  48. package/dist/helpers/ruleEvaluator.mjs +5 -0
  49. package/dist/helpers/twigWrapper/AST.d.ts +12 -1
  50. package/dist/helpers/twigWrapper/AST.mjs +0 -0
  51. package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +7 -0
  52. package/dist/helpers/twigWrapper/Parser/Cursor.d.ts +7 -0
  53. package/dist/helpers/twigWrapper/Parser/Cursor.mjs +5 -0
  54. package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +46 -8
  55. package/dist/helpers/twigWrapper/Parser/types.mjs +0 -0
  56. package/dist/helpers/twigWrapper/charClass.d.ts +7 -0
  57. package/dist/helpers/twigWrapper/charClass.mjs +16 -12
  58. package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +2 -2
  59. package/dist/helpers/utils.d.ts +0 -2
  60. package/dist/helpers/utils.mjs +16 -19
  61. package/dist/hooks/index.d.ts +2 -1
  62. package/dist/hooks/index.mjs +4 -3
  63. package/dist/hooks/useFontHead.d.ts +3 -0
  64. package/dist/hooks/useFontHead.mjs +23 -0
  65. package/dist/hooks/usePlitziServiceContext.d.ts +3 -2
  66. package/dist/index.mjs +61 -45
  67. package/dist/navigation/index.d.ts +1 -1
  68. package/dist/navigation/index.mjs +2 -2
  69. package/dist/navigation/routes.d.ts +8 -0
  70. package/dist/navigation/routes.mjs +39 -39
  71. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddMutation.mjs +0 -1
  72. package/dist/network/graphql/builder/Mutations/Segment/SegmentAddTemplateMutation.mjs +0 -1
  73. package/dist/network/graphql/builder/Mutations/Segment/SegmentUpdateMutation.mjs +0 -1
  74. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentAddElementMutation.mjs +0 -1
  75. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentCloneElementMutation.mjs +0 -1
  76. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentMoveElementMutation.mjs +0 -1
  77. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRemoveElementMutation.mjs +0 -1
  78. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.d.ts +3 -0
  79. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentRenameElementMutation.mjs +9 -0
  80. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementMutation.mjs +0 -1
  81. package/dist/network/graphql/builder/Mutations/Segment/space/elements/SegmentUpdateElementsMutation.mjs +0 -1
  82. package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +0 -1
  83. package/dist/network/graphql/builder/Mutations/Space/SpaceAddTemplateMutation.mjs +0 -1
  84. package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +0 -1
  85. package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +0 -1
  86. package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +0 -1
  87. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.d.ts +5 -0
  88. package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +9 -0
  89. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +0 -1
  90. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +0 -1
  91. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +0 -1
  92. package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +0 -1
  93. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.d.ts +8 -0
  94. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +16 -0
  95. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.d.ts +4 -0
  96. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +16 -0
  97. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.d.ts +4 -0
  98. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +14 -0
  99. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.d.ts +4 -0
  100. package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +16 -0
  101. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +2 -3
  102. package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +0 -1
  103. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.d.ts +2 -0
  104. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +11 -0
  105. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.d.ts +2 -0
  106. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +11 -0
  107. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.d.ts +2 -0
  108. package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +11 -0
  109. package/dist/network/graphql/builder/Mutations/index.d.ts +24 -0
  110. package/dist/network/graphql/builder/Mutations/index.mjs +150 -132
  111. package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
  112. package/dist/network/graphql/builder/Queries/Segment/SegmentQuery.mjs +0 -1
  113. package/dist/network/graphql/builder/Queries/Segment/SegmentsQuery.mjs +0 -1
  114. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.d.ts +9 -0
  115. package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +30 -0
  116. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.d.ts +6 -0
  117. package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +16 -0
  118. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.d.ts +9 -0
  119. package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +25 -0
  120. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.d.ts +6 -0
  121. package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +17 -0
  122. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.d.ts +30 -0
  123. package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +40 -0
  124. package/dist/network/graphql/builder/Queries/index.d.ts +16 -0
  125. package/dist/network/graphql/builder/Queries/index.mjs +24 -14
  126. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +4 -0
  127. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +5 -2
  128. package/dist/network/graphql/sdk/Queries/Segment/SegmentQuery.mjs +0 -1
  129. package/dist/network/graphql/sdk/Queries/Segment/SegmentsQuery.mjs +0 -1
  130. package/dist/network/spaceEvents.d.ts +20 -1
  131. package/dist/network/spaceEvents.mjs +89 -74
  132. package/dist/schema/index.d.ts +1 -0
  133. package/dist/schema/index.mjs +2 -1
  134. package/dist/schema/serverElements.d.ts +16 -0
  135. package/dist/schema/serverElements.mjs +18 -0
  136. package/dist/server/actions/useActionsSync.d.ts +10 -0
  137. package/dist/server/actions/useActionsSync.mjs +7 -0
  138. package/dist/server/index.d.ts +2 -1
  139. package/dist/server/index.mjs +5 -4
  140. package/dist/server/rsc/refreshRsc.d.ts +11 -1
  141. package/dist/server/rsc/refreshRsc.mjs +30 -12
  142. package/dist/server/rsc/useRscSync.mjs +20 -13
  143. package/dist/state/runtimeStatePersist.mjs +4 -3
  144. package/dist/store/actionRuns/actionRunsRecorder.d.ts +36 -0
  145. package/dist/store/actionRuns/actionRunsRecorder.mjs +39 -0
  146. package/dist/store/actionRuns/actionRunsStore.d.ts +16 -0
  147. package/dist/store/actionRuns/actionRunsStore.mjs +5 -0
  148. package/dist/store/actionRuns/index.d.ts +6 -0
  149. package/dist/store/actionRuns/index.mjs +4 -0
  150. package/dist/store/actionRuns/useActionRuns.d.ts +13 -0
  151. package/dist/store/actionRuns/useActionRuns.mjs +10 -0
  152. package/dist/store/index.d.ts +46 -45
  153. package/dist/store/index.mjs +6 -3
  154. package/dist/store/renderSettings.d.ts +3 -0
  155. package/dist/store/renderSettings.mjs +17 -5
  156. package/dist/store/tracing/tracingCollector.d.ts +1 -1
  157. package/dist/store/tracing/tracingCollector.mjs +37 -35
  158. package/dist/store/tracing/tracingStore.d.ts +13 -0
  159. package/dist/store/tracing/tracingStore.mjs +3 -3
  160. package/dist/style/fontAssets.d.ts +12 -0
  161. package/dist/style/fontAssets.mjs +18 -0
  162. package/dist/style/fontValidation.d.ts +8 -0
  163. package/dist/style/fontValidation.mjs +107 -0
  164. package/dist/style/fonts.d.ts +74 -0
  165. package/dist/style/fonts.mjs +198 -0
  166. package/dist/style/fontsFromCss.d.ts +27 -0
  167. package/dist/style/fontsFromCss.mjs +43 -0
  168. package/dist/style/index.d.ts +4 -0
  169. package/dist/style/index.mjs +5 -1
  170. package/dist/style/styleConstants.d.ts +2 -2
  171. package/dist/style/styleConstants.mjs +1 -0
  172. package/dist/theme/ThemeProvider.d.ts +36 -6
  173. package/dist/theme/ThemeProvider.mjs +49 -35
  174. package/dist/theme/ThemeScope.d.ts +16 -0
  175. package/dist/theme/ThemeScope.mjs +6 -0
  176. package/dist/theme/index.d.ts +7 -1
  177. package/dist/theme/index.mjs +6 -2
  178. package/dist/theme/themeCookie.d.ts +30 -0
  179. package/dist/theme/themeCookie.mjs +24 -0
  180. package/dist/theme/themeStore.d.ts +40 -0
  181. package/dist/theme/themeStore.mjs +17 -0
  182. package/dist/theme/useTheme.d.ts +29 -0
  183. package/dist/theme/useTheme.mjs +20 -0
  184. package/dist/types/ActionTypes.d.ts +396 -0
  185. package/dist/types/ActionTypes.mjs +0 -0
  186. package/dist/types/AuthTypes.d.ts +23 -2
  187. package/dist/types/BuilderTypes.d.ts +0 -12
  188. package/dist/types/CommonTypes.d.ts +13 -0
  189. package/dist/types/DevToolsTypes.d.ts +57 -14
  190. package/dist/types/EventBridgeTypes.d.ts +1 -1
  191. package/dist/types/InteractionTypes.d.ts +23 -3
  192. package/dist/types/PluginTypes.d.ts +0 -3
  193. package/dist/types/SchemaTypes.d.ts +29 -4
  194. package/dist/types/ServerTypes.d.ts +390 -46
  195. package/dist/types/SpaceTypes.d.ts +16 -0
  196. package/dist/types/StoreTypes.d.ts +181 -3
  197. package/dist/types/StyleTypes.d.ts +83 -4
  198. package/dist/types/TemplateTypes.d.ts +20 -0
  199. package/dist/types/TemplateTypes.mjs +0 -0
  200. package/dist/types/ThemeTypes.d.ts +28 -1
  201. package/dist/types/index.d.ts +2 -0
  202. package/eslint.config.mjs +2 -0
  203. package/package.json +244 -29
  204. package/vite.config.ts +27 -7
@@ -0,0 +1,396 @@
1
+ import { Environment } from './CommonTypes';
2
+ import { ElementInteraction } from './SchemaTypes';
3
+ /**
4
+ * What an action's inputs and outputs may be.
5
+ *
6
+ * Deliberately NOT `CollectionField['type']`: that vocabulary describes CMS content (`richText`, `multiImage`,
7
+ * `video`) and an action takes arguments, not entries. `json` is the escape hatch for a nested payload, and it is
8
+ * the only one whose contents are not validated beyond being parseable.
9
+ */
10
+ export type ActionFieldType = 'text' | 'number' | 'boolean' | 'date' | 'json' | 'file';
11
+ export type ActionField = {
12
+ type: ActionFieldType;
13
+ required?: boolean;
14
+ defaultValue?: string | number | boolean;
15
+ /** Shown in the builder, and read by the MCP agent when it wires a call. */
16
+ label?: string;
17
+ };
18
+ /**
19
+ * Who may start a run through ONE way in. Resolved against the auth kernel — never re-implemented here.
20
+ *
21
+ * It belongs to the trigger and not to the action, because the two are different questions: a webhook is reachable
22
+ * by anyone who learns its URL and is gated on its signature, while the same flow called from a page may well
23
+ * require a session. Stating it once for the action forced the loosest of its ways in onto all of them.
24
+ *
25
+ * There is no implicit default: a trigger that declares no access is refused at save time rather than falling back
26
+ * to something a reader has to guess at.
27
+ */
28
+ export type ActionAccess =
29
+ /** Anyone, including an anonymous visitor. Implicit for a webhook; anywhere else it is a deliberate choice. */
30
+ {
31
+ mode: 'public';
32
+ }
33
+ /** Any request carrying a valid session for this space. */
34
+ | {
35
+ mode: 'session';
36
+ }
37
+ /** A session holding every one of these space permissions. */
38
+ | {
39
+ mode: 'role';
40
+ permissions: string[];
41
+ };
42
+ /**
43
+ * How an inbound webhook proves it is who it claims to be. Verified against the RAW body, before parsing and before
44
+ * the run starts — a public endpoint with no verification is a warning at save time and in the logs.
45
+ */
46
+ export type ActionWebhookVerification = {
47
+ type: 'hmac';
48
+ /** Header carrying the signature, e.g. `stripe-signature`. */
49
+ header: string;
50
+ algorithm: 'sha256' | 'sha1';
51
+ /** The credential holding the signing secret. Named outright rather than templated: this runs before anything
52
+ * else does, and a token that renders to nothing here is an endpoint that verifies against an empty secret. */
53
+ credential: string;
54
+ /** Which key of that credential is the secret. Defaults to `secret`. */
55
+ secretField?: string;
56
+ /**
57
+ * Header carrying the moment the sender signed, when it sends one separately (the Stripe shape). The signed
58
+ * payload is then `<timestamp>.<body>` rather than the body alone.
59
+ *
60
+ * Without it `toleranceSeconds` has nothing to compare against: a signature over the body alone is valid
61
+ * forever, so a captured request can be replayed until the secret rotates.
62
+ */
63
+ timestampHeader?: string;
64
+ /** Rejects a signature older than this many seconds. Needs `timestampHeader`. */
65
+ toleranceSeconds?: number;
66
+ };
67
+ /**
68
+ * The ways into an action, as the `action` of a trigger STEP rather than a list beside the flow.
69
+ *
70
+ * `call` — a client flow through the action endpoint. `webhook` — an inbound request, public by construction.
71
+ * `schedule` — a cron tick. `render` — a `runtime: 'server'` element naming this action. `custom` — a trigger the
72
+ * deployment mounted itself.
73
+ */
74
+ export type ActionTriggerType = 'call' | 'webhook' | 'schedule' | 'render' | 'custom';
75
+ /**
76
+ * What a trigger step carries, in its `params`.
77
+ *
78
+ * FLAT and stringy, because that is what a step's params are everywhere in this product: the flow editor renders
79
+ * `text`, `select` and `codemirror-json` controls over primitives, and a trigger authored anywhere else would be a
80
+ * second editor to build and to keep in step. So the two contracts an action has are both JSON on a step — `input`
81
+ * here, and the output step's `values` at the other end.
82
+ *
83
+ * Read it with the helpers in `@plitzi/sdk-shared/actions` rather than by hand: they are what the validator and
84
+ * the runner share, so what the editor accepts is exactly what the runner will do.
85
+ */
86
+ export type ActionTriggerParams = {
87
+ /** Who may start a run this way. Required for every kind but `schedule`, which has no caller. */
88
+ access?: ActionAccess['mode'];
89
+ /** Comma-separated, and only meaningful for `access: 'role'`. */
90
+ permissions?: string;
91
+ /** JSON map of {@link ActionField} by name: what a caller may send THIS way. Undeclared keys are dropped. */
92
+ input?: string;
93
+ /**
94
+ * `webhook`: the credential holding the signing secret.
95
+ *
96
+ * **Naming one is what turns verification on**, and it is the only field that has to be set — everything below
97
+ * has a default that works. That is deliberate: a half-filled verification is an endpoint that looks protected
98
+ * and is not, so the shape does not allow one. Absent means an endpoint anyone who learns the URL can start,
99
+ * which the validator warns about.
100
+ */
101
+ signatureCredential?: string;
102
+ /** Header the signature arrives in. Defaults to `x-signature`; a provider that uses its own says so here. */
103
+ signatureHeader?: string;
104
+ /** `sha256` (the default) or `sha1`. */
105
+ signatureAlgorithm?: string;
106
+ /** Which key of the credential holds the secret. Defaults to `secret`. */
107
+ signatureSecretField?: string;
108
+ /**
109
+ * Header carrying the moment the sender signed, when it sends one separately (the Stripe shape). The signed
110
+ * payload is then `<timestamp>.<body>` rather than the body alone.
111
+ */
112
+ signatureTimestampHeader?: string;
113
+ /** Rejects a signature older than this many seconds. Means nothing without the timestamp header. */
114
+ signatureToleranceSeconds?: string;
115
+ /**
116
+ * `render`: how long an answer may be reused, in seconds. Absent or `0` means every render runs the flow.
117
+ *
118
+ * It belongs to the trigger for the same reason access does: it is a property of THIS way in. A call is
119
+ * somebody asking for something to happen and must not be served from a cache; a render is a read repeated
120
+ * once per visitor, and the difference between one outbound request and ten thousand of them is this number.
121
+ *
122
+ * Renders that arrive while one is already in flight are answered by it whatever this says — that is not a
123
+ * cache, it is the same run being shared, and it can never serve an answer older than the request.
124
+ */
125
+ cacheSeconds?: string;
126
+ /** `schedule`: five fields — minute hour day-of-month month day-of-week. UTC. */
127
+ cron?: string;
128
+ timezone?: string;
129
+ /** `custom`: the name the deployment mounts it under. */
130
+ name?: string;
131
+ };
132
+ /** Ceilings for one run. A per-action value may only tighten the deployment's own. */
133
+ export type ActionLimits = {
134
+ timeoutMs?: number;
135
+ /** Ceiling for a streaming run, which is allowed to be longer-lived than a request/response one. */
136
+ streamTimeoutMs?: number;
137
+ maxNodes?: number;
138
+ maxRequests?: number;
139
+ /**
140
+ * Bytes one outbound response may carry back into a flow.
141
+ *
142
+ * A timeout does not cover this: a backend answering a gigabyte quickly is a fast way to take a process down,
143
+ * and every other ceiling here is about how LONG a run may take rather than how much it may hold. Counted per
144
+ * response rather than per run, because it exists to stop one answer from being unbounded.
145
+ */
146
+ maxResponseBytes?: number;
147
+ };
148
+ /**
149
+ * A server action: a declarative flow, stored per space, executed by the server.
150
+ *
151
+ * It is the SAME document an element's interactions are — a map of steps, each naming a task, chained by
152
+ * `afterNode` — and it is deliberately nothing more. Everything that used to be declared beside the flow now lives
153
+ * on the step that starts it, so there is one place to read and one place to author, and the editor is the one
154
+ * already in the product.
155
+ *
156
+ * It lives in shared types because the builder authors the very document the server executes — the same reason
157
+ * `ConnectorManifest` does. It is server-side state: it goes to the BUILDER, which is authorized to edit it, and
158
+ * never into a page. What a visitor's page holds is the action's identifier, and what it gets back is whatever the
159
+ * output step named.
160
+ *
161
+ * There is no `enabled` here. Whether an action can run is whether any way INTO it is switched on, and that switch
162
+ * is the trigger step's own — one per way in, which is finer than one per action and is the control an author
163
+ * actually reaches for. A field beside the flow was the same fact written twice, with no rule for which won.
164
+ * Read it with `isActionEnabled` from `@plitzi/sdk-shared/actions`.
165
+ */
166
+ export type ActionDocument = {
167
+ name: string;
168
+ description?: string;
169
+ /**
170
+ * The flows. One or more `trigger` steps, each heading a chain of `task` steps — the same node map an element's
171
+ * `interactions` holds, so one editor authors both.
172
+ */
173
+ nodes: Record<string, ElementInteraction>;
174
+ /**
175
+ * The keys the `flow.output` step names, DERIVED from it — never authored beside it.
176
+ *
177
+ * It exists so the builder can offer typed bindings on a call's result without opening the flow. Declaring it by
178
+ * hand was the original design and it was wrong: it asks an author to know what a flow returns before the steps
179
+ * that produce it exist, and it leaves two places to keep in step. The runner ignores this entirely and answers
180
+ * exactly what the output step named.
181
+ */
182
+ output?: Record<string, ActionField>;
183
+ limits?: ActionLimits;
184
+ };
185
+ /**
186
+ * An action as a server-side reader hands it over.
187
+ *
188
+ * `id` is stamped by the store rather than carried by the document, for the same reason `ConnectorManifestDraft`
189
+ * drops it: a document holding its own id can disagree with the one it was fetched by.
190
+ */
191
+ export type ActionEntry = {
192
+ id: string;
193
+ document: ActionDocument;
194
+ };
195
+ /**
196
+ * One server task, as the builder's flow editor receives it.
197
+ *
198
+ * The catalog is served by the deployment rather than hardcoded, which is what lets a self-hoster's own task show
199
+ * up in their editor. `params` is the same `InteractionCallbackParam` map an interaction callback declares — but
200
+ * anything function-valued in it (a `when`, options computed from another param) does not survive the wire, so a
201
+ * task meant to be authored visually declares static params.
202
+ */
203
+ export type ActionTaskDescriptor = {
204
+ name: string;
205
+ namespace: string;
206
+ action: string;
207
+ title: string;
208
+ description?: string;
209
+ params: Record<string, unknown>;
210
+ };
211
+ /**
212
+ * One run as an authoring caller receives it — the builder's test run.
213
+ *
214
+ * `trace` is the same `InteractionNode[]` the dev-tools panel renders, redacted of credential values. A visitor
215
+ * never sees it; an author looking at their own flow should see nothing less than the steps that ran.
216
+ */
217
+ export type ActionRunReport = {
218
+ runId: string;
219
+ status: ActionRunStatus;
220
+ output: Record<string, unknown>;
221
+ trace: Record<string, unknown>[];
222
+ };
223
+ /**
224
+ * Whether the CLIENT flow waits. The server side is synchronous in every mode: `detached` means the step does not
225
+ * await its own request, not that the run outlives it.
226
+ */
227
+ export type ActionCallMode = 'await' | 'detached' | 'stream';
228
+ export type ActionRunStatus = 'completed' | 'failed' | 'skipped' | 'aborted';
229
+ /**
230
+ * Why a run did not produce an answer. Reported to the caller — and to the `onFlowError` trigger — because a guard
231
+ * an author cannot observe is a guard they will work around.
232
+ */
233
+ export type ActionErrorReason = 'not_found' | 'disabled'
234
+ /**
235
+ * Nobody was signed in and the trigger asked for somebody.
236
+ *
237
+ * Separate from `forbidden` because the two ask different things of the caller: this one says "sign in again",
238
+ * and it is usually a session that ended under a page that still believes it has one — so the client reports it
239
+ * to auth, which renews or signs the visitor out at once. `forbidden` says "not you", and reading that as a dead
240
+ * session would sign out somebody who is merely short a permission.
241
+ */
242
+ | 'unauthenticated' | 'forbidden' | 'invalid_input'
243
+ /** Another run holds this action's single-flight key. */
244
+ | 'duplicate'
245
+ /** A concurrency or stream cap was reached. */
246
+ | 'over_capacity'
247
+ /** The run's lineage already names this action: a loop through the outside world. */
248
+ | 'recursion' | 'timeout' | 'aborted' | 'failed';
249
+ /**
250
+ * Why a request never became a run.
251
+ *
252
+ * A superset of {@link ActionErrorReason}: everything a run can be refused for, plus what only an inbound
253
+ * webhook can be refused for — the checks that happen before there is a document to run at all. They are named
254
+ * separately because they are the ones an author has to be able to SEE: a signature that does not match is a
255
+ * misconfiguration somebody has to fix, and it is indistinguishable from silence unless it is reported.
256
+ */
257
+ export type ActionRejectReason = ActionErrorReason
258
+ /** The signature did not verify against the raw body. */
259
+ | 'invalid_signature'
260
+ /** This caller sent more deliveries this minute than the deployment allows. */
261
+ | 'rate_limited'
262
+ /** The body was not JSON. */
263
+ | 'malformed_body'
264
+ /** The trigger carries a signature check in a shape nothing reads, so the endpoint fails closed. */
265
+ | 'unverifiable';
266
+ /**
267
+ * A request that was refused before it became a run.
268
+ *
269
+ * The counterpart to {@link ActionRunRecord}, and the reason it exists: `onRun` reports runs that STARTED, so a
270
+ * webhook rejected for a bad signature — the single most common way an integration is broken — produced nothing
271
+ * anybody could look at. Whether a refusal is worth keeping is the deployment's call: a duplicate delivery is a
272
+ * well-behaved sender retrying and is noise, while an invalid signature is somebody's afternoon. The mechanism
273
+ * reports all of them and filters none.
274
+ *
275
+ * Never carries the body or the signature. What went wrong is `detail`, in the server's own words.
276
+ */
277
+ export type ActionRejectRecord = {
278
+ actionId: string;
279
+ spaceId: number;
280
+ environment: Environment;
281
+ trigger: ActionTriggerType;
282
+ reason: ActionRejectReason;
283
+ /** Why, for whoever has to fix it. Never the offending value itself. */
284
+ detail?: string;
285
+ /** Who asked, as the transport identifies them — a session subject or an address. */
286
+ callerId?: string;
287
+ };
288
+ /**
289
+ * What one run was, for whoever keeps the record.
290
+ *
291
+ * Emitted for every run that STARTED — completed, failed or aborted — and never for one refused before it began:
292
+ * a 409 is not a run, and logging it would bury the real ones under retries.
293
+ *
294
+ * Deliberately not the trace: step results are the space's own data and can be large, so what travels here is the
295
+ * shape of what happened. The trace goes to the author who asked for it, in the test-run panel.
296
+ */
297
+ export type ActionRunRecord = {
298
+ runId: string;
299
+ actionId: string;
300
+ spaceId: number;
301
+ environment: Environment;
302
+ trigger: ActionTriggerType;
303
+ status: ActionRunStatus;
304
+ durationMs: number;
305
+ /** Who asked, when a session carried it. Absent for a webhook, a schedule or an anonymous visitor. */
306
+ userId?: number;
307
+ /** One entry per step that ran, in order — enough to see where a flow stopped without keeping its data. */
308
+ nodes: {
309
+ id: string;
310
+ action: string;
311
+ status: string;
312
+ }[];
313
+ /** Present when the run ended badly. Already redacted of credential values. */
314
+ error?: string;
315
+ };
316
+ /**
317
+ * One thing a CHECK found about an action, before anybody runs it.
318
+ *
319
+ * The complement to `validateActionDocument`, which reads the document alone and therefore cannot know whether
320
+ * the credential a step names exists, whether this server registers that task, or whether the cron would ever
321
+ * fire. Those are the failures that only show up at 3am on the first real delivery, and they are exactly what an
322
+ * author cannot see from the editor.
323
+ */
324
+ export type ActionCheckIssue = {
325
+ /** `error` — it cannot work as written. `warning` — it will run, and somebody should know. */
326
+ level: 'error' | 'warning';
327
+ /** Where it is, in the same `nodes.<id>.params.<field>` shape the document validator uses. */
328
+ path: string;
329
+ message: string;
330
+ hint?: string;
331
+ };
332
+ /** What the deployment answered about one action. `valid` is "nothing here is fatal", not "it will succeed". */
333
+ export type ActionCheckReport = {
334
+ valid: boolean;
335
+ issues: ActionCheckIssue[];
336
+ };
337
+ /**
338
+ * One thing that happened to an action, as the builder reads it back.
339
+ *
340
+ * A run and a refusal in one shape, because the question an author asks is "what happened", and the most common
341
+ * answer for a webhook is that nothing ran: the signature did not verify. `status: 'refused'` is that answer, and
342
+ * `reason` says which check turned it away.
343
+ *
344
+ * Never the trace — that belongs to the test run the author asked for. A history is which steps ran and how each
345
+ * ended, not what they held.
346
+ */
347
+ export type ActionEvent = {
348
+ id: number;
349
+ actionId: string;
350
+ runId?: string | null;
351
+ trigger: string;
352
+ status: ActionRunStatus | 'refused' | 'unknown';
353
+ refused: boolean;
354
+ reason?: ActionRejectReason | null;
355
+ durationMs?: number | null;
356
+ steps: string[];
357
+ /** What went wrong, already redacted of credential values. */
358
+ detail?: string | null;
359
+ createdAt: number;
360
+ };
361
+ /** Action-addressed call. The element-addressed connector write keeps its own shape on the same endpoint. */
362
+ export type ActionCallRequest = {
363
+ actionId: string;
364
+ input?: Record<string, unknown>;
365
+ /** Replaces the derived single-flight key, so a caller can make a retry provably the same run. */
366
+ idempotencyKey?: string;
367
+ };
368
+ export type ActionCallResult = {
369
+ runId: string;
370
+ status: ActionRunStatus;
371
+ output: Record<string, unknown>;
372
+ };
373
+ export type ActionCallError = {
374
+ runId?: string;
375
+ error: string;
376
+ reason: ActionErrorReason;
377
+ };
378
+ /** One frame of a streaming run. `node` frames are the trace arriving live; `data` frames are `stream.emit`. */
379
+ export type ActionStreamFrame = {
380
+ event: 'node';
381
+ data: {
382
+ id: string;
383
+ status: string;
384
+ };
385
+ } | {
386
+ event: 'data';
387
+ data: {
388
+ chunk: unknown;
389
+ };
390
+ } | {
391
+ event: 'done';
392
+ data: ActionCallResult;
393
+ } | {
394
+ event: 'error';
395
+ data: ActionCallError;
396
+ };
File without changes
@@ -20,8 +20,13 @@ export type AuthState = 'init' | 'initLoading' | 'authenticating' | 'authenticat
20
20
  * Why a credential was refused, as reported by the auth backend (Plitzi's API answers it in `reason` on every 401).
21
21
  * The distinction that matters to a client is renewable versus not: `expired` asks for a refresh, `revoked`,
22
22
  * `inactive` and `missing` end the session, and `network` is not an answer at all — it must never sign anyone out.
23
+ *
24
+ * `unverified` is the one that is not about the credential: the password was right and the address has never answered.
25
+ * It is terminal like `inactive` — there is no session to be had — but it is the only refusal a person can do
26
+ * something about, which is why it is worth telling them apart. A sign-in screen that cannot distinguish them says
27
+ * "that email or password was not right" to somebody whose password was fine, and they try it again.
23
28
  */
24
- export type AuthFailureReason = 'missing' | 'expired' | 'revoked' | 'inactive' | 'malformed' | 'outdated' | 'network';
29
+ export type AuthFailureReason = 'missing' | 'expired' | 'revoked' | 'inactive' | 'unverified' | 'malformed' | 'outdated' | 'network';
25
30
  /** What an auth backend hands back from a grant (login, refresh) or an identity call. Both halves are optional:
26
31
  * a backend may answer a refresh with tokens alone, or an identity call with a user alone. */
27
32
  export type AuthGrant<U = Record<string, unknown>> = {
@@ -34,9 +39,25 @@ export type AuthResult<U = Record<string, unknown>> = ({
34
39
  ok: false;
35
40
  reason: AuthFailureReason;
36
41
  };
42
+ /**
43
+ * What a sign-in came to: the session it minted, or why there is none.
44
+ *
45
+ * A bare `TokenResult | undefined` was not enough to write a sign-in screen with. Absence is every refusal at once —
46
+ * wrong password, unconfirmed address, blocked account, backend unreachable — so the only sentence a page could write
47
+ * under it was the one that covers all four, and it is wrong for three of them.
48
+ *
49
+ * The success half spreads a {@link TokenResult}, so `accessToken` is read off the outcome itself and a flow written
50
+ * against the old shape still finds it where it always was.
51
+ */
52
+ export type LoginResult = ({
53
+ ok: true;
54
+ } & TokenResult) | {
55
+ ok: false;
56
+ reason: AuthFailureReason;
57
+ };
37
58
  export type AuthContextValue = {
38
59
  /** The credentials your login endpoint expects. Values arrive from interaction parameters, hence `unknown`. */
39
- login: (params: Record<string, unknown>) => Promise<TokenResult | undefined>;
60
+ login: (params: Record<string, unknown>) => Promise<LoginResult>;
40
61
  refresh: (params?: Record<string, unknown>) => Promise<TokenResult | undefined>;
41
62
  can: (permission: string) => boolean;
42
63
  logout: () => Promise<void>;
@@ -1,15 +1,3 @@
1
- import { Schema } from './SchemaTypes';
2
- import { Style } from './StyleTypes';
3
- export type Template = {
4
- id?: string;
5
- definition: {
6
- name: string;
7
- description: string;
8
- baseElementId: Element['id'];
9
- };
10
- schema: Schema;
11
- style: Style;
12
- };
13
1
  export type SubscriptionCollaboratorElement = {
14
2
  elementId: string;
15
3
  rootId: string;
@@ -9,6 +9,15 @@ export type Server<T extends Record<string, unknown> = Record<string, unknown>>
9
9
  domain?: string;
10
10
  requestUrl?: string;
11
11
  serverUrl: string;
12
+ /**
13
+ * Where this deployment serves the font files a space uploaded — a CDN prefix in the cloud, a path on the page
14
+ * server when it keeps them itself.
15
+ *
16
+ * Configuration rather than something to derive: a manifest holds store-relative paths precisely so that the
17
+ * origin is the deployment's answer, and an editor guessing it from the SSR host would address the CDN's files
18
+ * on the wrong origin. Absent means `/fonts` on whatever origin is rendering.
19
+ */
20
+ fontsBaseUrl?: string;
12
21
  websocketServer: string;
13
22
  subscriptionServer: string;
14
23
  location?: Location;
@@ -31,6 +40,10 @@ export type ServerSSR = {
31
40
  rscPath?: string;
32
41
  /** The payload that server already resolved for this page, so the first render costs no request. */
33
42
  rscData?: SSRRscData;
43
+ /** Path where this origin runs server actions. Published only by a server that mounts the endpoint: its absence
44
+ * is what tells a client flow that a `serverAction` step has nowhere to run, rather than letting it fail per
45
+ * click. A static export publishes nothing here and the step reports itself inert. */
46
+ actionPath?: string;
34
47
  /** Channel the SSR render writes its response into (status, redirect). Server-side only and by reference: it never
35
48
  * crosses to the browser, and nothing subscribes to it. */
36
49
  renderResult?: SSRRenderResult;
@@ -3,7 +3,7 @@ import { NavigationStatus } from './NavigationTypes';
3
3
  import { ElementInteraction } from './SchemaTypes';
4
4
  import { ReactNode } from 'react';
5
5
  export type LogType = 'info' | 'warning' | 'danger' | 'success' | 'custom';
6
- export type LogCategory = 'navigation' | 'interactions' | 'store' | 'network';
6
+ export type LogCategory = 'navigation' | 'interactions' | 'store' | 'network' | 'actions';
7
7
  export type LogNavigation = {
8
8
  category: 'navigation';
9
9
  params: {
@@ -15,19 +15,39 @@ export type LogEventBridge = {
15
15
  category: 'eventBridge';
16
16
  params: Record<string, unknown>;
17
17
  };
18
+ /** A whole flow that ran, with every step it took. What `logInteraction` writes when a trigger finishes. */
19
+ export type InteractionFlowParams = {
20
+ /** The SOURCE a global callback or utility named — `space`, `state` — not the element it ran on. */
21
+ elementId: string;
22
+ /** The id of the element the interaction fired on. What tells two identical-looking entries apart. */
23
+ hostElementId?: string;
24
+ startTime: number;
25
+ endTime: number;
26
+ node: ElementInteraction;
27
+ status: InteractionStatus;
28
+ nodes: Record<string, InteractionNode>;
29
+ };
30
+ /**
31
+ * A note about ONE step, written while a flow is still running.
32
+ *
33
+ * A step wired to a callback nobody registered, a `{{token}}` that would not resolve, a step that threw — all of
34
+ * them are reported the moment they happen, from inside the traversal, so none of them can carry the flow's
35
+ * summary. They were typed as though they did, and the panel rendered them as one: `Object.values(nodes)` on an
36
+ * entry that has no `nodes` took the whole dev-tools down with it, and only for people whose interactions were
37
+ * already misbehaving.
38
+ */
39
+ export type InteractionNoteParams = {
40
+ node?: ElementInteraction;
41
+ /** The message of whatever was thrown, when a step failed rather than merely being misconfigured. */
42
+ error?: string;
43
+ /** What WAS registered under the element the step named, so a typo shows itself. */
44
+ available?: string[];
45
+ param?: string;
46
+ value?: unknown;
47
+ };
18
48
  export type LogInteraction = {
19
49
  category: 'interactions';
20
- params: {
21
- /** The SOURCE a global callback or utility named — `space`, `state` — not the element it ran on. */
22
- elementId: string;
23
- /** The idRef of the element the interaction fired on. What tells two identical-looking entries apart. */
24
- elementRef?: string;
25
- startTime: number;
26
- endTime: number;
27
- node: ElementInteraction;
28
- status: InteractionStatus;
29
- nodes: Record<string, InteractionNode>;
30
- };
50
+ params: InteractionFlowParams | InteractionNoteParams;
31
51
  };
32
52
  export type LogStore = {
33
53
  category: 'store';
@@ -38,6 +58,29 @@ export type LogStore = {
38
58
  next: unknown;
39
59
  };
40
60
  };
61
+ /**
62
+ * A server action this page started, as a log line.
63
+ *
64
+ * Its own category rather than an `interactions` entry: an action is not a step that ran in the browser, and the
65
+ * things worth reading about one — which way in, the server's run id, the reason it was refused — have no place
66
+ * in a client flow's shape. The Actions tab shows the run in full; this is the line that says it happened, in the
67
+ * stream where everything else the page did is already ordered.
68
+ */
69
+ export type LogAction = {
70
+ category: 'actions';
71
+ params: {
72
+ actionId: string;
73
+ /** `await`, `detached`, `stream` — or `cancel` for a run somebody stopped. */
74
+ mode?: string;
75
+ /** The server's own id, once there is one. */
76
+ runId?: string;
77
+ status?: string;
78
+ /** The server's vocabulary when it refused: `duplicate`, `over_capacity`, `recursion`, `forbidden`… */
79
+ reason?: string;
80
+ error?: string;
81
+ output?: Record<string, unknown>;
82
+ };
83
+ };
41
84
  /** Something that arrived from the server and was not what it claimed to be — a space event failing its schema. */
42
85
  export type LogNetwork = {
43
86
  category: 'network';
@@ -50,10 +93,10 @@ export type LogNetwork = {
50
93
  payload?: unknown;
51
94
  };
52
95
  };
53
- export type LogParams = LogNavigation['params'] | LogInteraction['params'] | LogEventBridge['params'] | LogStore['params'] | LogNetwork['params'];
96
+ export type LogParams = LogNavigation['params'] | LogInteraction['params'] | LogEventBridge['params'] | LogStore['params'] | LogNetwork['params'] | LogAction['params'];
54
97
  export type Log = {
55
98
  logType: string;
56
99
  message: ReactNode;
57
100
  time?: string;
58
- } & (LogInteraction | LogNavigation | LogEventBridge | LogStore | LogNetwork);
101
+ } & (LogInteraction | LogNavigation | LogEventBridge | LogStore | LogNetwork | LogAction);
59
102
  export type ProviderCallback = (...args: unknown[]) => Record<string, unknown>;
@@ -2,4 +2,4 @@ export type EventBridgeContextValue<T = any> = {
2
2
  eventBridge: T;
3
3
  };
4
4
  export type EventBridgeModule = 'main' | 'builder' | 'segment' | 'template' | 'interaction' | 'element';
5
- export type EventBridgeEvent = 'schemaAddPage' | 'schemaHomePage' | 'schemaUpdatePage' | 'schemaRemovePage' | 'schemaAddPageFolder' | 'schemaUpdatePageFolder' | 'schemaRemovePageFolder' | 'schemaUpdateSettings' | 'schemaUpdate' | 'schemaAddElement' | 'schemaUpdateElement' | 'schemaUpdateElements' | 'schemaRemoveElement' | 'schemaMoveElement' | 'schemaCloneElement' | 'schemaAddVariable' | 'schemaUpdateVariable' | 'schemaRemoveVariable' | 'schemaAddTemplate' | 'styleUpdate' | 'styleAddSelector' | 'styleUpdateSelector' | 'styleRemoveSelector' | 'styleRemoveSelectors' | 'styleAddSelectorVariable' | 'styleUpdateSelectorVariable' | 'styleRemoveSelectorVariable' | 'styleAddVariable' | 'styleUpdateVariable' | 'styleRemoveVariable' | 'styleAddTemplate' | 'styleUpdateSettings' | 'builderSetBaseContext' | 'builderSetSelected' | 'builderSetHovered';
5
+ export type EventBridgeEvent = 'schemaAddPage' | 'schemaHomePage' | 'schemaUpdatePage' | 'schemaRemovePage' | 'schemaAddPageFolder' | 'schemaUpdatePageFolder' | 'schemaRemovePageFolder' | 'schemaUpdateSettings' | 'schemaUpdate' | 'schemaAddElement' | 'schemaUpdateElement' | 'schemaRenameElement' | 'schemaUpdateElements' | 'schemaRemoveElement' | 'schemaMoveElement' | 'schemaCloneElement' | 'schemaAddVariable' | 'schemaUpdateVariable' | 'schemaRemoveVariable' | 'schemaAddTemplate' | 'styleUpdate' | 'styleAddSelector' | 'styleUpdateSelector' | 'styleRemoveSelector' | 'styleRemoveSelectors' | 'styleAddSelectorVariable' | 'styleUpdateSelectorVariable' | 'styleRemoveSelectorVariable' | 'styleAddVariable' | 'styleUpdateVariable' | 'styleRemoveVariable' | 'styleAddFont' | 'styleUpdateFont' | 'styleRemoveFont' | 'styleAddTemplate' | 'styleUpdateSettings' | 'builderSetBaseContext' | 'builderSetSelected' | 'builderSetHovered';
@@ -1,6 +1,6 @@
1
1
  import { ElementInteraction } from './SchemaTypes';
2
2
  import { RuleValue } from '@plitzi/plitzi-ui/QueryBuilder';
3
- export type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility';
3
+ export type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility' | 'task';
4
4
  export type InteractionStatus = 'completed' | 'skipped' | 'failed';
5
5
  export type InteractionNodeStatus = 'success' | 'failed' | 'skipped' | 'disabled';
6
6
  export type InteractionPostCallback<T extends Record<string, unknown> = Record<string, unknown>> = (params: InteractionCallbackParamValues<T>, callbackResult?: unknown) => unknown;
@@ -62,15 +62,25 @@ export type InteractionCallbackParam<T extends Record<string, unknown> = Record<
62
62
  });
63
63
  export type InteractionCallbackPreview = string | Record<string, unknown>;
64
64
  export type InteractionCallbackPreviews = Record<string, InteractionCallbackPreview>;
65
+ /**
66
+ * What a callback learns about the flow running it.
67
+ *
68
+ * Only the element the flow fired on, and only because a step that starts something asynchronous has to be able to
69
+ * report back TO that element — a server action running detached finishes long after the flow that launched it
70
+ * returned, and `onFlowEnd` has to fire somewhere specific.
71
+ */
72
+ export type InteractionCallbackContext = {
73
+ /** Id of the element this flow fired on. Absent for a flow with no host element. */
74
+ hostElementId?: string;
75
+ };
65
76
  export type InteractionCallback<T extends Record<string, unknown> = Record<string, unknown>> = {
66
77
  elementId?: string;
67
78
  action: string;
68
79
  title: string;
69
80
  type: InteractionCallbackType;
70
81
  enabled?: boolean;
71
- unreferenced?: boolean;
72
82
  params: Record<keyof T, InteractionCallbackParam<T>> | ((params: InteractionCallbackParamValues<T>) => Record<keyof T, InteractionCallbackParam<T>>);
73
- callback?: (params: InteractionCallbackParamValues<T>) => unknown;
83
+ callback?: (params: InteractionCallbackParamValues<T>, context?: InteractionCallbackContext) => unknown;
74
84
  postCallback?: InteractionPostCallback<T>;
75
85
  preview?: InteractionCallbackPreviews | ((params: InteractionCallbackParamValues<T>) => InteractionCallbackPreviews);
76
86
  };
@@ -100,3 +110,13 @@ export type InteractionsContextValue<TManager = any> = {
100
110
  getAdditionalParams?: Subscriptor<T>['getAdditionalParams'];
101
111
  }) => void;
102
112
  };
113
+ /**
114
+ * What an embedding application offers a space it renders.
115
+ *
116
+ * The one direction that did not exist: a space acts on its own state, its own router and its own session, and had
117
+ * no way to ask the application AROUND it for anything — so every application shell had to be written in the host's
118
+ * own code, which is the one part of a product that cannot then be authored or themed without a release.
119
+ *
120
+ * Keyed by the name a space's `hostAction` step calls. A name the host did not register does nothing.
121
+ */
122
+ export type HostActions = Record<string, (params: Record<string, unknown>) => void>;
@@ -92,15 +92,12 @@ export type Plugin = {
92
92
  isMain?: boolean;
93
93
  manifest: PluginManifest;
94
94
  market: ComponentDefinition['market'];
95
- module: string;
96
95
  resource: string;
97
- scope: string;
98
96
  settings: Record<string, unknown>;
99
97
  subPlugins?: string[];
100
98
  type: string;
101
99
  };
102
100
  export type PluginsContextValue = {
103
- baseAssets?: Record<string, Asset>;
104
101
  assets: Record<string, Asset>;
105
102
  plugins: Record<string, ComponentDefinition>;
106
103
  dispatchPlugins?: unknown;