@almadar/core 10.96.0 → 10.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +25 -0
  2. package/dist/builders.d.ts +5 -4
  3. package/dist/builders.js +60 -34
  4. package/dist/builders.js.map +1 -1
  5. package/dist/bus-BGDM3Xot.d.ts +565 -0
  6. package/dist/domain-Ds_7wZIL.d.ts +16213 -0
  7. package/dist/{effect-Bw8T4qh5.d.ts → effect-CW_IT0Jn.d.ts} +59 -4
  8. package/dist/{entityAccess-DfoXs9mc.d.ts → entityAccess-BLpOMojb.d.ts} +3 -3
  9. package/dist/{expression-WfTp2arD.d.ts → expression-DRwzVnMu.d.ts} +5 -1
  10. package/dist/factory/index.d.ts +5 -5
  11. package/dist/factory/index.js +22 -0
  12. package/dist/factory/index.js.map +1 -1
  13. package/dist/factory-runtime/index.d.ts +5 -4
  14. package/dist/factory-runtime/index.js +176 -34
  15. package/dist/factory-runtime/index.js.map +1 -1
  16. package/dist/fixtures.d.ts +45 -0
  17. package/dist/fixtures.js +693 -0
  18. package/dist/fixtures.js.map +1 -0
  19. package/dist/{index-CN16-h3i.d.ts → index-CHHuux4I.d.ts} +9 -375
  20. package/dist/index.d.ts +19 -15
  21. package/dist/index.js +9070 -44
  22. package/dist/index.js.map +1 -1
  23. package/dist/mock/index.d.ts +6 -5
  24. package/dist/mock/index.js +14 -0
  25. package/dist/mock/index.js.map +1 -1
  26. package/dist/patterns/component-mapping.json +1 -1
  27. package/dist/patterns/event-contracts.json +1 -1
  28. package/dist/patterns/index.d.ts +12 -8
  29. package/dist/patterns/index.js +15 -4
  30. package/dist/patterns/index.js.map +1 -1
  31. package/dist/patterns/patterns-registry.json +1 -1
  32. package/dist/patterns/registry.json +1 -1
  33. package/dist/{schema-DPpES4qj.d.ts → schema-BVjtoRYf.d.ts} +2134 -23608
  34. package/dist/state-machine/index.d.ts +1 -1
  35. package/dist/themes/index.d.ts +19 -0
  36. package/dist/themes/index.js +9251 -0
  37. package/dist/themes/index.js.map +1 -0
  38. package/dist/{trait-DXXRrRMP.d.ts → trait-C9lr222u.d.ts} +26 -26
  39. package/dist/types/index.d.ts +8 -6
  40. package/dist/types/index.js +208 -41
  41. package/dist/types/index.js.map +1 -1
  42. package/dist/{types-BMaTUGyk.d.ts → types-BoyvM79n.d.ts} +2 -2
  43. package/fixtures/events-wire/cascade-emitted-events/request.json +9 -0
  44. package/fixtures/events-wire/cascade-emitted-events/response.json +30 -0
  45. package/fixtures/events-wire/client-effects-by-trait/request.json +4 -0
  46. package/fixtures/events-wire/client-effects-by-trait/response.json +52 -0
  47. package/fixtures/events-wire/effect-results/request.json +9 -0
  48. package/fixtures/events-wire/effect-results/response.json +42 -0
  49. package/fixtures/events-wire/effect-results-every-kind/request.json +9 -0
  50. package/fixtures/events-wire/effect-results-every-kind/response.json +70 -0
  51. package/fixtures/events-wire/guard-rejected/request.json +6 -0
  52. package/fixtures/events-wire/guard-rejected/response.json +11 -0
  53. package/fixtures/events-wire/live-push/live-push.json +12 -0
  54. package/fixtures/events-wire/live-push/request.json +9 -0
  55. package/fixtures/events-wire/live-push/response.json +33 -0
  56. package/fixtures/events-wire/navigate-1/request.json +5 -0
  57. package/fixtures/events-wire/navigate-1/response.json +16 -0
  58. package/fixtures/events-wire/navigate-2/request.json +8 -0
  59. package/fixtures/events-wire/navigate-2/response.json +19 -0
  60. package/fixtures/events-wire/navigate-3/request.json +8 -0
  61. package/fixtures/events-wire/navigate-3/response.json +22 -0
  62. package/fixtures/events-wire/navigate-back/request.json +5 -0
  63. package/fixtures/events-wire/navigate-back/response.json +15 -0
  64. package/fixtures/events-wire/render-ui-3/request.json +5 -0
  65. package/fixtures/events-wire/render-ui-3/response.json +20 -0
  66. package/fixtures/events-wire/render-ui-4/request.json +5 -0
  67. package/fixtures/events-wire/render-ui-4/response.json +41 -0
  68. package/fixtures/events-wire/render-ui-5/request.json +9 -0
  69. package/fixtures/events-wire/render-ui-5/response.json +52 -0
  70. package/fixtures/events-wire/render-ui-clear/request.json +5 -0
  71. package/fixtures/events-wire/render-ui-clear/response.json +27 -0
  72. package/fixtures/events-wire/sse-stream/request.json +9 -0
  73. package/fixtures/events-wire/sse-stream/response.json +79 -0
  74. package/fixtures/events-wire/sse-stream/stream.json +131 -0
  75. package/fixtures/events-wire/stateless-traits/request.json +27 -0
  76. package/fixtures/events-wire/stateless-traits/response.json +15 -0
  77. package/fixtures/theme-tokens/every-key.json +43 -0
  78. package/package.json +18 -3
  79. package/themes/almadar-website.json +207 -0
  80. package/themes/almadar.json +203 -0
  81. package/themes/atelier.json +459 -0
  82. package/themes/bloomberg-dense.json +459 -0
  83. package/themes/clay.json +445 -0
  84. package/themes/comic.json +457 -0
  85. package/themes/corporate.json +445 -0
  86. package/themes/game-adventure.json +229 -0
  87. package/themes/game-rpg.json +230 -0
  88. package/themes/game-sci-fi.json +229 -0
  89. package/themes/game-ui-pack.json +230 -0
  90. package/themes/gazette.json +445 -0
  91. package/themes/glass.json +445 -0
  92. package/themes/kiosk.json +441 -0
  93. package/themes/linear-clean.json +459 -0
  94. package/themes/minimalist.json +445 -0
  95. package/themes/neon.json +445 -0
  96. package/themes/notion-editorial.json +459 -0
  97. package/themes/prism.json +203 -0
  98. package/themes/retro.json +445 -0
  99. package/themes/terminal.json +457 -0
  100. package/themes/trait-wars.json +493 -0
  101. package/themes/wireframe.json +445 -0
@@ -1,10 +1,12 @@
1
- import { b4 as PageTraitRef, O as OrbitalSchema, bi as ThemeDefinition, a9 as Orbital, c as Page, M as DomainContext, a as OrbitalDefinition } from './schema-DPpES4qj.js';
2
- import { F as FieldValue, E as EntityField, a as EntityPersistence, bP as ServiceParams, f as Entity, g as EntityRow, A as AnyPatternConfig, d as OrbitalId, T as TraitId, b as EventId, c as Effect } from './effect-Bw8T4qh5.js';
3
- import { S as SExpr, b as EventPayloadValue, a as EventPayload, L as LogMeta, d as EvalContext } from './expression-WfTp2arD.js';
1
+ import { R as PageTraitRef, O as OrbitalSchema, s as Orbital, c as Page, a as OrbitalDefinition } from './schema-BVjtoRYf.js';
2
+ import { E as EntityField, a as EntityPersistence, bY as ServiceParams, F as FieldValue, f as Entity, g as EntityRow, A as AnyPatternConfig, c as Effect } from './effect-CW_IT0Jn.js';
3
+ import { S as SExpr, a as EventPayloadValue, b as EventPayload, L as LogMeta, d as EvalContext } from './expression-DRwzVnMu.js';
4
4
  import { z } from 'zod';
5
5
  import { R as RuntimeValue, J as JsonValue, a as JsonObject, T as ToolArgs } from './json-D8gmyK3l.js';
6
- import { a as TraitReference, h as Trait, L as ListenSource, D as DeclaredTraitConfig, b as TraitConfig, C as ConfigFieldDeclaration, S as State, ah as Transition, s as Event, g as TraitConfigValue, $ as TraitCategory, ax as TraitScope } from './trait-DXXRrRMP.js';
7
- import { T as TraitOverlay, R as RuleOverlay, J as JsonSchema, c as FactoryConfigTier } from './types-BMaTUGyk.js';
6
+ import { c as BusEventSource } from './bus-BGDM3Xot.js';
7
+ import { a as TraitReference, h as Trait, L as ListenSource, D as DeclaredTraitConfig, b as TraitConfig, C as ConfigFieldDeclaration, S as State, ah as Transition, s as Event, g as TraitConfigValue, $ as TraitCategory, ax as TraitScope } from './trait-C9lr222u.js';
8
+ import { T as TraitOverlay, R as RuleOverlay, J as JsonSchema, c as FactoryConfigTier } from './types-BoyvM79n.js';
9
+ import { T as ThemeDefinition, D as DomainContext } from './domain-Ds_7wZIL.js';
8
10
  import { MakeTraitRefOpts, EventWiringEntry, LayoutStrategy } from './builders.js';
9
11
 
10
12
  /**
@@ -226,148 +228,6 @@ declare function isTraitFieldRef(value: RuntimeValue): value is TraitFieldRef;
226
228
  * JSON or recipe overrides at runtime boundaries. */
227
229
  declare const TraitFieldRefSchema: z.ZodString;
228
230
 
229
- /**
230
- * Authenticated user context — what `@user.x` resolves against.
231
- *
232
- * The canonical shape for the `user` binding root, shared by both execution
233
- * paths: the JS interpreter resolves `@user.id` through
234
- * `EvaluationContext.user`, and the compiled shell emits `user?.id` against the
235
- * `UserContext` its `@app/shared` re-exports from here.
236
- *
237
- * `id` is the field the behavior library reads for ownership scoping and `role`
238
- * the field it reads for capability gating. Auth providers that name the subject
239
- * `uid` must normalize at their boundary — {@link normalizeUserContext} does that.
240
- *
241
- * @packageDocumentation
242
- */
243
-
244
- /** Authenticated user / agent identity behind `@user.x` bindings. */
245
- interface UserContext {
246
- /** Stable subject identifier. `@user.id` — the ownership key. */
247
- id: string;
248
- /** `@user.email` */
249
- email?: string;
250
- /** `@user.name` — display name. */
251
- name?: string;
252
- /** `@user.role` — single role string, compared against a policy's allowed list. */
253
- role?: string;
254
- /** `@user.permissions` — fine-grained capability strings. */
255
- permissions?: string[];
256
- /** Additional provider claims, readable as `@user.<claim>`. */
257
- [key: string]: FieldValue | undefined;
258
- }
259
- /**
260
- * The identity of an unauthenticated viewer. A resolvable object rather than
261
- * `undefined` so a role predicate evaluates to a definite `false` instead of
262
- * comparing against nothing.
263
- */
264
- declare const ANONYMOUS_USER: UserContext;
265
- /** Provider-shaped identity claims, before normalization. */
266
- interface RawUserClaims {
267
- id?: string;
268
- uid?: string;
269
- email?: string | null;
270
- name?: string;
271
- displayName?: string | null;
272
- role?: string;
273
- permissions?: string[];
274
- [key: string]: FieldValue | undefined;
275
- }
276
- /**
277
- * Normalize provider claims into a {@link UserContext}.
278
- *
279
- * Firebase (and most OIDC providers) name the subject `uid` and the display name
280
- * `displayName`, while every `.lolo` behavior reads `@user.id` / `@user.name`.
281
- * Without this normalization `@user.id` is `undefined` against a fully
282
- * authenticated request and every ownership filter silently matches no rows.
283
- * `uid` is preserved so `@user.uid` keeps working.
284
- *
285
- * Returns `undefined` for absent or subject-less claims so callers can
286
- * distinguish "no auth ran" from "anonymous"; use {@link ANONYMOUS_USER} where a
287
- * definite identity is required.
288
- */
289
- declare function normalizeUserContext(claims: RawUserClaims | null | undefined): UserContext | undefined;
290
- /**
291
- * Turn a row of an app's `[identity]` entity into a viewer.
292
- *
293
- * There is no separate persona shape: an identity row IS the persona
294
- * (`Almadar_LOLO_Identity.md` §4.3), so this only guards the one field the
295
- * behavior library requires — a non-empty string `id` — and passes every other
296
- * declared field through as a `@user.<field>` claim. Rows without a usable id
297
- * yield `undefined` rather than a persona nobody can own rows as.
298
- */
299
- declare function personaFromIdentityRow(row: Record<string, FieldValue | undefined>): UserContext | undefined;
300
- /**
301
- * The viewer a host presents when nothing named one.
302
- *
303
- * Without this, `@user` is `Null` in headless verify and preview, so every
304
- * `viewerName: @user.name` binding renders blank and the account menu never
305
- * appears — an app that cannot say who you are. Worse, an ownership filter that
306
- * works and one that is broken both render an empty table.
307
- *
308
- * `role` is deliberately EMPTY, not a guess. A default of `admin` would silently
309
- * flip which branch renders at the 38 `@user.role` comparisons in the corpus;
310
- * an empty role matches no literal, exactly as `Null` did, so this fixes
311
- * "undefined at runtime" without changing a single guard outcome.
312
- */
313
- declare const DEFAULT_VIEWER: UserContext;
314
- /**
315
- * The viewer to present an app as when nothing named one.
316
- *
317
- * `DEFAULT_VIEWER` is synthetic — `viewer-1` is in no app's roster — so under it
318
- * every ownership predicate (`@entity.<owner> == @user.id`) matches zero rows and
319
- * a correctly-scoped app renders empty tables everywhere. That is indistinguishable
320
- * on screen from a broken filter, which is exactly the failure DEFAULT_VIEWER's own
321
- * comment warns about.
322
- *
323
- * So when the app declares an `[identity]` roster, the default viewer is a REAL
324
- * member of it. `DEFAULT_VIEWER` remains the fallback for apps that declare no
325
- * identity entity, where there is nobody to be.
326
- *
327
- * Both execution paths share this rule; the Rust twin is
328
- * `orbital-core::runtime::persona::resolve_default_viewer`.
329
- */
330
- declare function resolveDefaultViewer(roster: readonly UserContext[]): UserContext;
331
- /** Look a persona up in a roster by id, or by role when no id matches. */
332
- declare function findPersonaInRoster(roster: readonly UserContext[], idOrRole: string): UserContext | undefined;
333
- /**
334
- * Resolve a persona spec — a bare id/role (`Person Id 3`, `moderator`) or a full
335
- * JSON `UserContext` — into a viewer. This is the `ALMADAR_PERSONA` contract,
336
- * shared by every host that presents an app as somebody.
337
- *
338
- * The roster is the app's OWN declared personas — the seeded rows of its
339
- * `[identity]` entity (`Almadar_LOLO_Identity.md` §4.3) — supplied by the host
340
- * that has them in hand (the runtime's live store on the interpreter path, the
341
- * schema-derived seed rows on the compiled path). There is no global roster:
342
- * an app without an `[identity]` entity resolves only JSON-form specs.
343
- *
344
- * Throws on anything unresolvable rather than returning `undefined`: "no persona"
345
- * and "persona silently ignored" look identical on screen, so a bad spec must
346
- * fail at boot instead of rendering as nobody.
347
- */
348
- declare function resolvePersonaSpec(spec: string, roster: readonly UserContext[]): UserContext;
349
- /**
350
- * Marks a bearer token as a mocked dev identity rather than a real ID token.
351
- * The prefix is deliberately unmistakable: a server accepts these ONLY behind an
352
- * explicit dev opt-in, so a production deployment rejects them like any other
353
- * malformed token.
354
- */
355
- declare const DEV_TOKEN_PREFIX = "almadar-dev.";
356
- /**
357
- * Encode a viewer as a dev bearer token.
358
- *
359
- * Carries the WHOLE identity, not just the subject: real Firebase claims have no
360
- * `role`, so a server that only reads `uid` leaves every `@user.role` gate inert
361
- * even for a signed-in user. URI-encoded JSON keeps the token header-safe (no
362
- * spaces or delimiters) and works unchanged in Node and the browser.
363
- */
364
- declare function encodeDevIdentityToken(user: UserContext): string;
365
- /**
366
- * Decode a dev bearer token back into a viewer, or `undefined` if it is not one
367
- * / is malformed — callers fail closed rather than inventing an identity.
368
- */
369
- declare function decodeDevIdentityToken(token: string): UserContext | undefined;
370
-
371
231
  /**
372
232
  * Validation error types — the shape emitted by every
373
233
  * `.orb` / `.lolo` validator pass.
@@ -474,6 +334,7 @@ declare const KNOWN_VALIDATION_ERROR_CODES: {
474
334
  readonly ORB_BINDING_UNKNOWN_ROOT: "ORB_BINDING_UNKNOWN_ROOT";
475
335
  readonly ORB_CIRCUIT_VIEWER_STRANDED: "ORB_CIRCUIT_VIEWER_STRANDED";
476
336
  readonly ORB_EMBED_CONFIG_FORWARD_MULTI_REFERRER: "ORB_EMBED_CONFIG_FORWARD_MULTI_REFERRER";
337
+ readonly ORB_E_DEFAULT_TYPE_MISMATCH: "ORB_E_DEFAULT_TYPE_MISMATCH";
477
338
  readonly ORB_E_DUPLICATE_FIELD: "ORB_E_DUPLICATE_FIELD";
478
339
  readonly ORB_E_EMPTY_ENUM_VALUES: "ORB_E_EMPTY_ENUM_VALUES";
479
340
  readonly ORB_E_INVALID_FIELD_NAME: "ORB_E_INVALID_FIELD_NAME";
@@ -2005,233 +1866,6 @@ declare function isResolvedIR(ir: RuntimeValue): ir is ResolvedIR;
2005
1866
  interface ContextExtensions {
2006
1867
  }
2007
1868
 
2008
- /**
2009
- * Bus Event Types (framework concept)
2010
- *
2011
- * Canonical event shape for Almadar's cross-package event bus. Hoisted into
2012
- * `@almadar/core` so `@almadar/ui`, `@almadar/runtime`, and generated code
2013
- * all agree on the same structure. Replaces the previously divergent
2014
- * `KFlowEvent` (ui) and `RuntimeEvent` (runtime) definitions.
2015
- *
2016
- * @packageDocumentation
2017
- */
2018
-
2019
- /**
2020
- * Declared event key. A trait's event names (INIT, SAVE, CLOSE,
2021
- * CONFIRM_REMOVE, ...) flow through the orbital schema and the UI as
2022
- * strings; this alias marks "this string is a declared event key, not
2023
- * arbitrary text."
2024
- *
2025
- * Component props typed as `EventKey` are detected by the pattern-sync
2026
- * tool (`tools/almadar-pattern-sync/parser.ts`) via a TS-type lookup and
2027
- * marked as `kind: "event"` in the patterns registry
2028
- * (`@almadar/patterns`). Consumers of the registry — the Rust compiler's
2029
- * inline phase and the `@almadar/runtime` preprocess — read that marker
2030
- * to apply call-site `events: { OLD: NEW }` renames to render-ui trees
2031
- * without name-matching heuristics.
2032
- *
2033
- * Plain alias over `string`. Not branded because event keys originate
2034
- * from user data at runtime (orb schema literals, bus emits), so cast
2035
- * friction would buy nothing. The value of the alias is at the type
2036
- * surface — it's a marker the pattern-sync tool can find via
2037
- * `getSymbolAtLocation`.
2038
- */
2039
- type EventKey = string;
2040
- /**
2041
- * Phantom-typed brand for declarative bus-emit props on UI components.
2042
- *
2043
- * Used by component authors to BOTH mark a prop as a bus-event reference
2044
- * AND document the payload shape that the component will fire onto the
2045
- * bus when that prop is bound. Authors write:
2046
- *
2047
- * // Tabs.tsx
2048
- * export interface TabsProps {
2049
- * tabChangeEvent?: EventEmit<{ tabId: string }>;
2050
- * }
2051
- *
2052
- * Consumers see only the structural `string` (no UX impact: passing a
2053
- * literal `"TAB_CHANGED"` keeps working). The phantom `P` parameter
2054
- * carries the bus-payload schema at the type level for pattern-sync to
2055
- * extract.
2056
- *
2057
- * Pattern-sync (`tools/almadar-pattern-sync/parser.ts`) detects this
2058
- * brand via TS type-lookup (mirrors how it detects `EventKey`) and
2059
- * writes two registry fields per prop:
2060
- * - `kind: "event-ref"` — the discriminant rules read in lolo / orb
2061
- * validator to know "this prop's string value is a bus event name."
2062
- * - `emitPayloadSchema` — the structural shape of `P`, serialized as
2063
- * the same JSON-Schema-shaped record Almadar uses for trait
2064
- * `payloadSchema`. Validator rules cross-check this against the
2065
- * trait's declared `emits { EVENT { ... } }` payload to catch mismatches
2066
- * at parse / validate time instead of runtime.
2067
- *
2068
- * Example payload bus emission inside the component (no wrapper —
2069
- * `EventEmit<P>` erases to `string`):
2070
- *
2071
- * if (tabChangeEvent) eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
2072
- *
2073
- * The brand is structurally an unused optional readonly property; TS
2074
- * never asks for it at construction, so authors and consumers never
2075
- * see it.
2076
- */
2077
- type EventEmit<P> = string & {
2078
- readonly __emitPayload?: P;
2079
- };
2080
- /**
2081
- * Phantom-typed brand for declarative bus-listen props on UI components.
2082
- *
2083
- * Mirror of `EventEmit<P>`. Used by future patterns where a UI component
2084
- * subscribes to a bus event and forwards its payload upward via prop
2085
- * (e.g. an editor pattern that listens for `EXTERNAL_RESET` and exposes
2086
- * the consumed payload to the parent). Pattern-sync detects this brand
2087
- * the same way as `EventEmit<P>` and writes:
2088
- * - `kind: "event-listen"` (or a sub-discriminant of `event-ref`)
2089
- * - `listenPayloadSchema` with the structural shape of `P`
2090
- *
2091
- * Validator rules use this to verify the trait the prop is bound to
2092
- * actually emits a payload of the expected shape.
2093
- *
2094
- * Reserved for symmetry; no @almadar/ui component uses it as of this
2095
- * commit. Add usages incrementally as patterns require them.
2096
- */
2097
- type EventListen<P> = string & {
2098
- readonly __listenPayload?: P;
2099
- };
2100
- /**
2101
- * Identifies the origin of a bus event. Used by cross-trait listeners to
2102
- * filter emits from specific orbitals, traits, transitions, or ticks.
2103
- *
2104
- * `transition` and `tick` are optional runtime-internal details; most
2105
- * consumers only care about `orbital` and `trait`.
2106
- */
2107
- interface BusEventSource {
2108
- orbital?: string;
2109
- /** V4 dual-carry id sibling of `orbital` — stable across an orbital rename. */
2110
- orbitalId?: OrbitalId;
2111
- trait?: string;
2112
- /** V4 dual-carry id sibling of `trait` — stable across a trait rename. */
2113
- traitId?: TraitId;
2114
- /** V4 dual-carry id of the emitted event — stable across an event rename. */
2115
- eventId?: EventId;
2116
- transition?: string;
2117
- tick?: string;
2118
- /**
2119
- * True when the orbital bridge re-broadcasts an event onto the bus
2120
- * (any source — both echoes of the dispatched event and server-side
2121
- * cascade emits via `(emit X)` / `fetch.emit.success`). Cross-trait
2122
- * listeners filter on this flag so the click-time qualified emit
2123
- * (which has no `fromBridge`) doesn't double-fire alongside the
2124
- * post-server bridge confirmation. See `dispatched` for the narrower
2125
- * "echo of the just-dispatched event" signal.
2126
- */
2127
- fromBridge?: boolean;
2128
- /**
2129
- * True ONLY for bridge echoes the receiving tab already processed, so
2130
- * the originating trait's self-subscription skips them instead of
2131
- * re-dispatching its own echo (infinite loop / double execution).
2132
- * Set by path 1 of useOrbitalBridge (compiled shell — echo of the
2133
- * just-dispatched event; server-side cascade emits there carry
2134
- * `fromBridge: true` but NOT `dispatched`, so they still reach the
2135
- * source trait's transition handler, e.g. `loading -> browsing` on a
2136
- * fetch's `emit.success`) and by ServerBridge (runtime path — stamped
2137
- * on exactly one response-cascade echo per event the dispatch delivered
2138
- * locally on the bare key, `stampLocallyDeliveredEchoes`; server-only
2139
- * results stay unstamped). Cross-trait `listens` never filter on this
2140
- * flag, so their delivery is unaffected. Push-leg events from OTHER
2141
- * tabs (multiplayer) are never stamped.
2142
- */
2143
- dispatched?: boolean;
2144
- /**
2145
- * The client that originated the dispatch whose effects emitted this
2146
- * event (from `OrbitalEventRequest.clientId`); absent for headless
2147
- * dispatches (ticks, circuit-router probes, walkers). The server-side
2148
- * listens fan-out skips client-originated cascade emits — under dual
2149
- * execution the originating client relays every cascade hop through the
2150
- * bridge itself, so the server dispatching the same hop double-ran it
2151
- * (one Send persisted two rows). Headless topology keeps the fan-out:
2152
- * there is no client to drive the circuit.
2153
- */
2154
- originClientId?: string;
2155
- }
2156
- /**
2157
- * An event flowing on the bus.
2158
- *
2159
- * The `source` field is structured so cross-trait listeners can match
2160
- * `event.source?.orbital === 'X' && event.source?.trait === 'Y'` without
2161
- * parsing a delimiter.
2162
- */
2163
- interface BusEvent {
2164
- /** Event type identifier (e.g., 'CartItemLoaded', 'TASK_COMPLETED') */
2165
- type: EventKey;
2166
- /** Optional structured payload */
2167
- payload?: EventPayload;
2168
- /** Timestamp when the event was emitted */
2169
- timestamp: number;
2170
- /** Optional origin info for filtering */
2171
- source?: BusEventSource;
2172
- }
2173
- /** Bus event listener callback. */
2174
- type BusEventListener = (event: BusEvent) => void;
2175
- /** Returned by `on()` / `once()` to detach a listener. */
2176
- type Unsubscribe = () => void;
2177
- /**
2178
- * One event a transition's effects emitted, carried back to the client to
2179
- * re-dispatch (in order) so the state machine advances through the
2180
- * cascade without server-side recursion. Named/shaped to match the
2181
- * generated compiled-path `EmittedEvent` (orbital-shell-typescript's
2182
- * `shared/types.ts`) so the two execution paths agree on one shape.
2183
- */
2184
- interface EmittedEvent {
2185
- event: string;
2186
- payload?: EventPayload;
2187
- source?: BusEventSource;
2188
- }
2189
- /**
2190
- * Client → server event dispatch request. The single upstream owner of
2191
- * this shape — both the JS interpreter and the compiled path's generated
2192
- * `EventRequest` (orbital-shell-typescript's `shared/types.ts`) carry the
2193
- * same fields, so the two execution paths cannot drift.
2194
- */
2195
- interface EventDispatchRequest {
2196
- event: string;
2197
- payload?: EventPayload;
2198
- /** Current client state, for validation. */
2199
- currentState?: string;
2200
- /** Per-tab client id — the live-broadcast origin-exclusion key. */
2201
- clientId?: string;
2202
- /**
2203
- * The dispatching trait's current `@entity` frame (declared defaults <
2204
- * fetched row < `[shared]` frame). The server layers it over the row it
2205
- * resolves via `resolveEntityView` so guards and effects read the same
2206
- * values the client does.
2207
- */
2208
- fields?: EntityRow;
2209
- }
2210
- /**
2211
- * Server → client event dispatch response. Mirrors the compiled path's
2212
- * generated `EventResponse` (orbital-shell-typescript's `shared/types.ts`);
2213
- * kept field-for-field in sync except `effectResults`, which core has no
2214
- * canonical shape for yet (the per-app generated `EffectResult` is
2215
- * distinct from core's `EffectResult` in `types/living.ts` — reusing that
2216
- * one would misdescribe this field, so it is intentionally omitted here).
2217
- */
2218
- interface EventDispatchResponse {
2219
- success: boolean;
2220
- newState?: string;
2221
- data?: Record<string, EntityRow[]>;
2222
- /** Events emitted while running this transition's effects, in order. */
2223
- emittedEvents?: EmittedEvent[];
2224
- /**
2225
- * `@entity` fields this transition's server-side `set` effects wrote,
2226
- * post-effect. The client merges them over its own effect results
2227
- * (server wins).
2228
- */
2229
- fields?: EntityRow;
2230
- error?: string;
2231
- /** Guard that failed, for debugging. */
2232
- guardFailed?: string;
2233
- }
2234
-
2235
1869
  /**
2236
1870
  * Verification Types (framework concept)
2237
1871
  *
@@ -3274,4 +2908,4 @@ interface RenderOverlayResult {
3274
2908
  */
3275
2909
  declare function applyRenderOverlay(orbital: OrbitalDefinition, patches: readonly RenderUiPatch[]): RenderOverlayResult;
3276
2910
 
3277
- export { DEFAULT_INTERACTION_MODELS as $, ANONYMOUS_USER as A, BINDING_CONTEXT_RULES as B, type ChangesetValue as C, type BridgeHealth as D, type BuilderResult as E, type BusEvent as F, type BusEventListener as G, type BusEventSource as H, type CancelledEvent as I, type ChangeAuthor as J, type ChangeSetDocument as K, type ChangeSummary as L, type ChangesetRecordedEvent as M, type CheckStatus as N, type Clarification as O, type PageContentReduction as P, type ClarificationCandidate as Q, type ResolvedIR as R, type SchemaChange as S, type ClarificationLevel as T, type CompleteEvent as U, type ComplexityAssessment as V, type ComposeAllResult as W, type ComposeChildrenResult as X, type ComposeOptions as Y, type ContextExtensions as Z, type CreateFlow as _, type ResolvedEntity as a, type MemoryContext as a$, DEFAULT_VIEWER as a0, DEV_TOKEN_PREFIX as a1, type DeleteFlow as a2, type DispatchUpdatesResult as a3, type DrawableDescriptor as a4, type EdgeType as a5, type EditFlow as a6, type EditFocus as a7, type EditFocusLevel as a8, type EffectPayload as a9, KNOWN_VALIDATION_ERROR_CODES as aA, type KnobPayload as aB, type KnownValidationErrorCode as aC, type LLMErrorContext as aD, type LazyService as aE, type LineageEntry as aF, type ListInteraction as aG, type LivingEdge as aH, type LivingEffect as aI, type LivingEntity as aJ, type LivingEvent as aK, type LivingField as aL, type LivingOrbital as aM, type LivingOrbitalSchema as aN, type LivingPage as aO, type LivingState as aP, type LivingTrait as aQ, type LivingTransition as aR, type LivingValue as aS, type LivingVertex as aT, type LlmCallToolsResult as aU, type LlmContext as aV, type LlmMessage as aW, type LlmTokenUsage as aX, type LlmToolCall as aY, type LlmToolDef as aZ, type LoloEmitResult as a_, type EffectResult as aa, type EffectTrace as ab, type EmittedEvent as ac, type ErrorEvent as ad, type EventDispatchRequest as ae, type EventDispatchResponse as af, type EventEmit as ag, type EventKey as ah, type EventListen as ai, type EventLogEntry as aj, type EvolutionDelta as ak, type ExecutePlanResult as al, type ExtraTraitRef as am, type FileOperationEvent as an, type FileWrittenEvent as ao, type GateState as ap, type GenerationLogEvent as aq, type GitHubIssue as ar, type GitHubLink as as, type GitHubRepo as at, type HistoryMeta as au, type IntegrationContext as av, type InteractionModel as aw, type InteractionModelInput as ax, InteractionModelSchema as ay, type InterruptEvent as az, type ResolvedPage as b, type SemanticChangeKind as b$, type MessageEvent as b0, type OrbitalAddedEvent as b1, type OrbitalSchemaCompleteEvent as b2, type OrbitalVerificationAPI as b3, type ParamsRepairEmittedEvent as b4, type ParsedDesign as b5, type ParsedDomainContext as b6, type ParsedEmitDeclaration as b7, type ParsedEntity as b8, type ParsedEvent as b9, type RenderUiPatchAddress as bA, type RenderUiPatchOp as bB, type RepairResult as bC, type ResolvedEntityBinding as bD, type ResolvedField as bE, type ResolvedNavigation as bF, type ResolvedPattern as bG, type ResolvedSection as bH, type ResolvedSectionEvent as bI, type ResolvedTraitBinding as bJ, type ResolvedTraitDataEntity as bK, type ResolvedTraitEvent as bL, type ResolvedTraitGuard as bM, type ResolvedTraitListener as bN, type ResolvedTraitState as bO, type ResolvedTraitTick as bP, type ResolvedTraitTransition as bQ, type ResolvedTraitUIBinding as bR, type SSEEvent as bS, type SSEEventBase as bT, type SSEEventType as bU, type SaveOptions as bV, type SaveResult as bW, type SchemaPhaseUpdateEvent as bX, type SchemaPhaseValidatedEvent as bY, type SchemaUpdateEvent as bZ, type SemanticAnnotation as b_, type ParsedListenDeclaration as ba, type ParsedOrbital as bb, type ParsedPage as bc, type ParsedState as bd, type ParsedStateMachine as be, type ParsedTrait as bf, type ParsedTraitConfig as bg, type ParsedTransition as bh, type PatternNode as bi, PatternTypeSchema as bj, type PatternValue as bk, type PersistActionName as bl, type PlanSnapshot as bm, type PlanSnapshotStatus as bn, type PlannerResult as bo, type Probability as bp, type ProcessCompleteEvent as bq, type ProcessErrorEvent as br, type ProcessRepairCompleteEvent as bs, type ProcessRepairEvent as bt, type ProcessStartEvent as bu, RENDER_BINDING_MARKER as bv, type RawUserClaims as bw, type RenderBindingMarker as bx, type RenderOverlayResult as by, type RenderUiPatch as bz, type ResolvedTrait as c, getInteractionModelForDomain as c$, type SemanticVector as c0, type ServerResponseTrace as c1, type ServiceAction as c2, type ServiceActionName as c3, type ServiceCallResult as c4, type ServiceContract as c5, type ServiceEvents as c6, type SessionContext as c7, type SessionHistoryEntry as c8, type SnapshotCreatedEvent as c9, type ValidationError as cA, type ValidationErrorCode as cB, type ValidationIssue as cC, type ValidationMeta as cD, type ValidationResult as cE, type ValidationResults as cF, type VerificationCheck as cG, type VerificationSnapshot as cH, type VerificationSummary as cI, type VertexId as cJ, type VertexPayload as cK, type VertexType as cL, type ViewFlow as cM, type WorkspaceContext as cN, applyRenderOverlay as cO, containsEntityBinding as cP, containsPayloadBinding as cQ, createEmptyResolvedPage as cR, createEmptyResolvedTrait as cS, createLazyService as cT, createResolvedField as cU, createTypedEventBus as cV, decodeDevIdentityToken as cW, encodeDevIdentityToken as cX, findPersonaInRoster as cY, fingerprintNode as cZ, getBindingExamples as c_, type SnapshotDocument as ca, type SpawnResult as cb, type StartEvent as cc, type StatsView as cd, type StoreContract as ce, type StoreFilter as cf, type StoreFilterOp as cg, type SubagentCompleteEvent as ch, type SubagentEvent as ci, type SubagentProgressEvent as cj, type SubagentStartEvent as ck, type TodoActivityType as cl, type TodoDetailEvent as cm, type TodoUpdateEvent as cn, type ToolCallEvent as co, type ToolResultEvent as cp, type TraceContext as cq, type TraitFieldRef as cr, TraitFieldRefSchema as cs, type TraitStateSnapshot as ct, type TransitionFrom as cu, type TransitionTrace as cv, type Unsubscribe as cw, type UserContext as cx, type ValidateResult as cy, type ValidationDocument as cz, type CategorizedRemovals as d, inferTsType as d0, insertChildAtPath as d1, isKnownValidationErrorCode as d2, isPlanSnapshot as d3, isRenderBindingMarker as d4, isResolvedIR as d5, isSessionHistoryEntry as d6, isTraitFieldRef as d7, navigatePatternPath as d8, normalizeUserContext as d9, personaFromIdentityRow as da, removeChildAtPath as db, replaceChildAtPath as dc, resolveDefaultViewer as dd, resolvePersonaSpec as de, setPropAtPath as df, toBindingRoot as dg, validateBindingInContext as dh, widenTier as di, type SemanticSchemaChange as e, type AgentCodeSearchResult as f, type AgentCompactResult as g, type AgentCompactStrategy as h, type AgentContext as i, type AgentGenerateOptions as j, type AgentMemoryCategory as k, type AgentMemoryRecord as l, type AnalysisOrbital as m, type AnalysisOrbitalParams as n, type AnalysisPageOverride as o, type AnalysisRename as p, type AnalysisResult as q, type AnnotationTier as r, type AppCreatedEvent as s, type AppSummary as t, type AssetLoadStatus as u, BINDING_DOCS as v, BINDING_ROOTS as w, type BindingContext as x, type BindingRoot as y, BindingSchema as z };
2911
+ export { type EdgeType as $, type AgentCodeSearchResult as A, BINDING_CONTEXT_RULES as B, type ChangesetValue as C, type BuilderResult as D, type CancelledEvent as E, type ChangeAuthor as F, type ChangeSetDocument as G, type ChangeSummary as H, type ChangesetRecordedEvent as I, type CheckStatus as J, type Clarification as K, type ClarificationCandidate as L, type ClarificationLevel as M, type CompleteEvent as N, type ComplexityAssessment as O, type PageContentReduction as P, type ComposeAllResult as Q, type ResolvedIR as R, type SchemaChange as S, type ComposeChildrenResult as T, type ComposeOptions as U, type ContextExtensions as V, type CreateFlow as W, DEFAULT_INTERACTION_MODELS as X, type DeleteFlow as Y, type DispatchUpdatesResult as Z, type DrawableDescriptor as _, type ResolvedEntity as a, type ParsedOrbital as a$, type EditFlow as a0, type EditFocus as a1, type EditFocusLevel as a2, type EffectPayload as a3, type EffectResult as a4, type EffectTrace as a5, type ErrorEvent as a6, type EventLogEntry as a7, type EvolutionDelta as a8, type ExecutePlanResult as a9, type LivingOrbital as aA, type LivingOrbitalSchema as aB, type LivingPage as aC, type LivingState as aD, type LivingTrait as aE, type LivingTransition as aF, type LivingValue as aG, type LivingVertex as aH, type LlmCallToolsResult as aI, type LlmContext as aJ, type LlmMessage as aK, type LlmTokenUsage as aL, type LlmToolCall as aM, type LlmToolDef as aN, type LoloEmitResult as aO, type MemoryContext as aP, type MessageEvent as aQ, type OrbitalAddedEvent as aR, type OrbitalSchemaCompleteEvent as aS, type OrbitalVerificationAPI as aT, type ParamsRepairEmittedEvent as aU, type ParsedDesign as aV, type ParsedDomainContext as aW, type ParsedEmitDeclaration as aX, type ParsedEntity as aY, type ParsedEvent as aZ, type ParsedListenDeclaration as a_, type ExtraTraitRef as aa, type FileOperationEvent as ab, type FileWrittenEvent as ac, type GateState as ad, type GenerationLogEvent as ae, type GitHubIssue as af, type GitHubLink as ag, type GitHubRepo as ah, type HistoryMeta as ai, type IntegrationContext as aj, type InteractionModel as ak, type InteractionModelInput as al, InteractionModelSchema as am, type InterruptEvent as an, KNOWN_VALIDATION_ERROR_CODES as ao, type KnobPayload as ap, type KnownValidationErrorCode as aq, type LLMErrorContext as ar, type LazyService as as, type LineageEntry as at, type ListInteraction as au, type LivingEdge as av, type LivingEffect as aw, type LivingEntity as ax, type LivingEvent as ay, type LivingField as az, type ResolvedPage as b, type StartEvent as b$, type ParsedPage as b0, type ParsedState as b1, type ParsedStateMachine as b2, type ParsedTrait as b3, type ParsedTraitConfig as b4, type ParsedTransition as b5, type PatternNode as b6, PatternTypeSchema as b7, type PatternValue as b8, type PersistActionName as b9, type ResolvedTraitListener as bA, type ResolvedTraitState as bB, type ResolvedTraitTick as bC, type ResolvedTraitTransition as bD, type ResolvedTraitUIBinding as bE, type SSEEvent as bF, type SSEEventBase as bG, type SSEEventType as bH, type SaveOptions as bI, type SaveResult as bJ, type SchemaPhaseUpdateEvent as bK, type SchemaPhaseValidatedEvent as bL, type SchemaUpdateEvent as bM, type SemanticAnnotation as bN, type SemanticChangeKind as bO, type SemanticVector as bP, type ServerResponseTrace as bQ, type ServiceAction as bR, type ServiceActionName as bS, type ServiceCallResult as bT, type ServiceContract as bU, type ServiceEvents as bV, type SessionContext as bW, type SessionHistoryEntry as bX, type SnapshotCreatedEvent as bY, type SnapshotDocument as bZ, type SpawnResult as b_, type PlanSnapshot as ba, type PlanSnapshotStatus as bb, type PlannerResult as bc, type Probability as bd, type ProcessCompleteEvent as be, type ProcessErrorEvent as bf, type ProcessRepairCompleteEvent as bg, type ProcessRepairEvent as bh, type ProcessStartEvent as bi, RENDER_BINDING_MARKER as bj, type RenderBindingMarker as bk, type RenderOverlayResult as bl, type RenderUiPatch as bm, type RenderUiPatchAddress as bn, type RenderUiPatchOp as bo, type RepairResult as bp, type ResolvedEntityBinding as bq, type ResolvedField as br, type ResolvedNavigation as bs, type ResolvedPattern as bt, type ResolvedSection as bu, type ResolvedSectionEvent as bv, type ResolvedTraitBinding as bw, type ResolvedTraitDataEntity as bx, type ResolvedTraitEvent as by, type ResolvedTraitGuard as bz, type ResolvedTrait as c, type StatsView as c0, type StoreContract as c1, type StoreFilter as c2, type StoreFilterOp as c3, type SubagentCompleteEvent as c4, type SubagentEvent as c5, type SubagentProgressEvent as c6, type SubagentStartEvent as c7, type TodoActivityType as c8, type TodoDetailEvent as c9, containsEntityBinding as cA, containsPayloadBinding as cB, createEmptyResolvedPage as cC, createEmptyResolvedTrait as cD, createLazyService as cE, createResolvedField as cF, createTypedEventBus as cG, fingerprintNode as cH, getBindingExamples as cI, getInteractionModelForDomain as cJ, inferTsType as cK, insertChildAtPath as cL, isKnownValidationErrorCode as cM, isPlanSnapshot as cN, isRenderBindingMarker as cO, isResolvedIR as cP, isSessionHistoryEntry as cQ, isTraitFieldRef as cR, navigatePatternPath as cS, removeChildAtPath as cT, replaceChildAtPath as cU, setPropAtPath as cV, toBindingRoot as cW, validateBindingInContext as cX, widenTier as cY, type TodoUpdateEvent as ca, type ToolCallEvent as cb, type ToolResultEvent as cc, type TraceContext as cd, type TraitFieldRef as ce, TraitFieldRefSchema as cf, type TraitStateSnapshot as cg, type TransitionFrom as ch, type TransitionTrace as ci, type ValidateResult as cj, type ValidationDocument as ck, type ValidationError as cl, type ValidationErrorCode as cm, type ValidationIssue as cn, type ValidationMeta as co, type ValidationResult as cp, type ValidationResults as cq, type VerificationCheck as cr, type VerificationSnapshot as cs, type VerificationSummary as ct, type VertexId as cu, type VertexPayload as cv, type VertexType as cw, type ViewFlow as cx, type WorkspaceContext as cy, applyRenderOverlay as cz, type CategorizedRemovals as d, type SemanticSchemaChange as e, type AgentCompactResult as f, type AgentCompactStrategy as g, type AgentContext as h, type AgentGenerateOptions as i, type AgentMemoryCategory as j, type AgentMemoryRecord as k, type AnalysisOrbital as l, type AnalysisOrbitalParams as m, type AnalysisPageOverride as n, type AnalysisRename as o, type AnalysisResult as p, type AnnotationTier as q, type AppCreatedEvent as r, type AppSummary as s, type AssetLoadStatus as t, BINDING_DOCS as u, BINDING_ROOTS as v, type BindingContext as w, type BindingRoot as x, BindingSchema as y, type BridgeHealth as z };