@almadar/core 10.97.0 → 10.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/builders.d.ts +5 -4
- package/dist/builders.js +62 -34
- package/dist/builders.js.map +1 -1
- package/dist/bus-D69s_77B.d.ts +588 -0
- package/dist/domain-Ds_7wZIL.d.ts +16213 -0
- package/dist/{effect-Bw8T4qh5.d.ts → effect-Hm_QDaSI.d.ts} +65 -4
- package/dist/{entityAccess-DfoXs9mc.d.ts → entityAccess-DdcKps16.d.ts} +3 -3
- package/dist/{expression-WfTp2arD.d.ts → expression-DRwzVnMu.d.ts} +5 -1
- package/dist/factory/index.d.ts +5 -5
- package/dist/factory/index.js +36 -1
- package/dist/factory/index.js.map +1 -1
- package/dist/factory-runtime/index.d.ts +5 -4
- package/dist/factory-runtime/index.js +189 -34
- package/dist/factory-runtime/index.js.map +1 -1
- package/dist/fixtures.d.ts +45 -0
- package/dist/fixtures.js +704 -0
- package/dist/fixtures.js.map +1 -0
- package/dist/{index-H0bOi9oP.d.ts → index-DPdJPQZe.d.ts} +8 -375
- package/dist/index.d.ts +19 -15
- package/dist/index.js +9112 -45
- package/dist/index.js.map +1 -1
- package/dist/mock/index.d.ts +6 -5
- package/dist/mock/index.js +14 -0
- package/dist/mock/index.js.map +1 -1
- package/dist/patterns/component-mapping.json +1 -1
- package/dist/patterns/event-contracts.json +1 -1
- package/dist/patterns/index.d.ts +44 -9
- package/dist/patterns/index.js +29 -5
- package/dist/patterns/index.js.map +1 -1
- package/dist/patterns/patterns-registry.json +15 -2
- package/dist/patterns/registry.json +15 -2
- package/dist/{schema-DPpES4qj.d.ts → schema-TqLV2wlK.d.ts} +411 -21713
- package/dist/state-machine/index.d.ts +1 -1
- package/dist/themes/index.d.ts +19 -0
- package/dist/themes/index.js +9251 -0
- package/dist/themes/index.js.map +1 -0
- package/dist/{trait-DXXRrRMP.d.ts → trait-YlNXc4H3.d.ts} +62 -26
- package/dist/types/index.d.ts +8 -6
- package/dist/types/index.js +236 -41
- package/dist/types/index.js.map +1 -1
- package/dist/{types-BMaTUGyk.d.ts → types-Ug92oza4.d.ts} +2 -2
- package/fixtures/events-wire/cascade-emitted-events/request.json +9 -0
- package/fixtures/events-wire/cascade-emitted-events/response.json +30 -0
- package/fixtures/events-wire/client-effects-by-trait/request.json +4 -0
- package/fixtures/events-wire/client-effects-by-trait/response.json +52 -0
- package/fixtures/events-wire/effect-results/request.json +9 -0
- package/fixtures/events-wire/effect-results/response.json +42 -0
- package/fixtures/events-wire/effect-results-every-kind/request.json +9 -0
- package/fixtures/events-wire/effect-results-every-kind/response.json +70 -0
- package/fixtures/events-wire/guard-rejected/request.json +6 -0
- package/fixtures/events-wire/guard-rejected/response.json +11 -0
- package/fixtures/events-wire/live-push/live-push.json +12 -0
- package/fixtures/events-wire/live-push/request.json +9 -0
- package/fixtures/events-wire/live-push/response.json +33 -0
- package/fixtures/events-wire/navigate-1/request.json +5 -0
- package/fixtures/events-wire/navigate-1/response.json +16 -0
- package/fixtures/events-wire/navigate-2/request.json +8 -0
- package/fixtures/events-wire/navigate-2/response.json +19 -0
- package/fixtures/events-wire/navigate-3/request.json +8 -0
- package/fixtures/events-wire/navigate-3/response.json +22 -0
- package/fixtures/events-wire/navigate-back/request.json +5 -0
- package/fixtures/events-wire/navigate-back/response.json +15 -0
- package/fixtures/events-wire/render-ui-3/request.json +5 -0
- package/fixtures/events-wire/render-ui-3/response.json +20 -0
- package/fixtures/events-wire/render-ui-4/request.json +5 -0
- package/fixtures/events-wire/render-ui-4/response.json +41 -0
- package/fixtures/events-wire/render-ui-5/request.json +9 -0
- package/fixtures/events-wire/render-ui-5/response.json +52 -0
- package/fixtures/events-wire/render-ui-clear/request.json +5 -0
- package/fixtures/events-wire/render-ui-clear/response.json +27 -0
- package/fixtures/events-wire/sse-stream/request.json +9 -0
- package/fixtures/events-wire/sse-stream/response.json +79 -0
- package/fixtures/events-wire/sse-stream/stream.json +131 -0
- package/fixtures/events-wire/stateless-traits/request.json +27 -0
- package/fixtures/events-wire/stateless-traits/response.json +15 -0
- package/fixtures/theme-tokens/every-key.json +43 -0
- package/package.json +18 -3
- package/themes/almadar-website.json +207 -0
- package/themes/almadar.json +203 -0
- package/themes/atelier.json +459 -0
- package/themes/bloomberg-dense.json +459 -0
- package/themes/clay.json +445 -0
- package/themes/comic.json +457 -0
- package/themes/corporate.json +445 -0
- package/themes/game-adventure.json +229 -0
- package/themes/game-rpg.json +230 -0
- package/themes/game-sci-fi.json +229 -0
- package/themes/game-ui-pack.json +230 -0
- package/themes/gazette.json +445 -0
- package/themes/glass.json +445 -0
- package/themes/kiosk.json +441 -0
- package/themes/linear-clean.json +459 -0
- package/themes/minimalist.json +445 -0
- package/themes/neon.json +445 -0
- package/themes/notion-editorial.json +459 -0
- package/themes/prism.json +203 -0
- package/themes/retro.json +445 -0
- package/themes/terminal.json +457 -0
- package/themes/trait-wars.json +493 -0
- package/themes/wireframe.json +445 -0
package/README.md
CHANGED
|
@@ -20,6 +20,31 @@ import { /* ... */ } from '@almadar/core';
|
|
|
20
20
|
|
|
21
21
|
<!-- Document public exports here -->
|
|
22
22
|
|
|
23
|
+
## Event-wire fixtures (`@almadar/core/fixtures`)
|
|
24
|
+
|
|
25
|
+
`fixtures/events-wire/<case>/{request,response}.json` (+ `stream.json` for
|
|
26
|
+
`sse-stream`, `live-push.json` for `live-push`) is the ONE recorded fixture
|
|
27
|
+
set for the event-dispatch wire (Program A, §156) — canonical =
|
|
28
|
+
`OrbitalEventRequest`/`OrbitalEventResponse`/`LiveBroadcastItem` from
|
|
29
|
+
`src/types/bus.ts`. Generated and zod-validated by
|
|
30
|
+
`scripts/generate-event-wire-fixtures.ts` (`pnpm run build:fixtures`, wired
|
|
31
|
+
into `build`); loaded at runtime via `loadEventWireFixture(caseName)` /
|
|
32
|
+
`EVENT_WIRE_FIXTURE_CASES` from the `@almadar/core/fixtures` subpath
|
|
33
|
+
(Node-only — reads from disk — never the main entry).
|
|
34
|
+
|
|
35
|
+
Consumers, all reading these SAME files instead of hand-rolled wire
|
|
36
|
+
examples:
|
|
37
|
+
|
|
38
|
+
- vitest in `@almadar/runtime`, `@almadar/ui`, `almadar-playground-runtime`
|
|
39
|
+
- `cargo test` in `orbital-core` (serde round trip), `orbital-server`
|
|
40
|
+
(posts fixture requests), `orbital-client`, and the Android/iOS native
|
|
41
|
+
shell decoders
|
|
42
|
+
- the Hono/Express codegen contract test (`orbital-shell-typescript`)
|
|
43
|
+
- `orb verify --server`
|
|
44
|
+
|
|
45
|
+
Separate from `packages/almadar-parity` (behaviour traces across execution
|
|
46
|
+
paths, not wire bytes).
|
|
47
|
+
|
|
23
48
|
## License
|
|
24
49
|
|
|
25
50
|
BSL 1.1 (Business Source License). Converts to Apache 2.0 on 2030-02-01. Non-production use is free.
|
package/dist/builders.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect,
|
|
2
|
-
import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-
|
|
3
|
-
import { b as TraitConfig, h as Trait, T as TraitEventListener, i as CallSiteConfig, k as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-
|
|
4
|
-
import { S as SExpr } from './expression-
|
|
1
|
+
import { I as IdentityLedger, A as AnyPatternConfig, U as UISlot, c as Effect, l as RenderBinding, m as RenderUIEffect, e as EntityId, f as Entity, E as EntityField, a as EntityPersistence, g as EntityRow } from './effect-Hm_QDaSI.js';
|
|
2
|
+
import { a as OrbitalDefinition, O as OrbitalSchema, U as UseDeclaration, E as EntityRef, b as ExpectDeclaration, P as PageRef, c as Page, d as PageRefObject } from './schema-TqLV2wlK.js';
|
|
3
|
+
import { b as TraitConfig, h as Trait, T as TraitEventListener, i as CallSiteConfig, k as TraitEventContract, d as TraitRef, a as TraitReference } from './trait-YlNXc4H3.js';
|
|
4
|
+
import { S as SExpr } from './expression-DRwzVnMu.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import './json-D8gmyK3l.js';
|
|
7
|
+
import './domain-Ds_7wZIL.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Event Wiring
|
package/dist/builders.js
CHANGED
|
@@ -415,6 +415,19 @@ var SExprSchema = z.lazy(
|
|
|
415
415
|
])
|
|
416
416
|
);
|
|
417
417
|
var ExpressionSchema = SExprSchema;
|
|
418
|
+
var EventPayloadValueSchema = z.lazy(
|
|
419
|
+
() => z.union([
|
|
420
|
+
z.string(),
|
|
421
|
+
z.number(),
|
|
422
|
+
z.boolean(),
|
|
423
|
+
z.date(),
|
|
424
|
+
z.null(),
|
|
425
|
+
z.undefined(),
|
|
426
|
+
EventPayloadSchema,
|
|
427
|
+
z.array(EventPayloadValueSchema)
|
|
428
|
+
])
|
|
429
|
+
);
|
|
430
|
+
var EventPayloadSchema = z.lazy(() => z.record(EventPayloadValueSchema));
|
|
418
431
|
|
|
419
432
|
// src/types/entity.ts
|
|
420
433
|
var EntityPersistenceSchema = z.enum([
|
|
@@ -463,6 +476,7 @@ var EntitySchema = OrbitalEntitySchema;
|
|
|
463
476
|
var FieldValueSchema = z.lazy(
|
|
464
477
|
() => z.union([z.string(), z.number(), z.boolean(), z.date(), z.null(), z.array(FieldValueSchema), z.record(FieldValueSchema.optional())])
|
|
465
478
|
);
|
|
479
|
+
z.object({ id: z.string().optional() }).catchall(FieldValueSchema.optional());
|
|
466
480
|
var UI_SLOTS = [
|
|
467
481
|
// App slots
|
|
468
482
|
"main",
|
|
@@ -496,6 +510,14 @@ var EffectSchema = z.array(SExprDataSchema).min(1).refine(
|
|
|
496
510
|
(arr) => typeof arr[0] === "string",
|
|
497
511
|
{ message: "Effect must be an S-expression with a string operator as first element" }
|
|
498
512
|
);
|
|
513
|
+
z.custom(
|
|
514
|
+
(value) => value === null || typeof value === "object" && value !== null && !Array.isArray(value),
|
|
515
|
+
{ message: "Expected a pattern config object or null" }
|
|
516
|
+
);
|
|
517
|
+
z.custom(
|
|
518
|
+
(value) => typeof value === "object" && value !== null && !Array.isArray(value),
|
|
519
|
+
{ message: "Expected a resolved pattern props object" }
|
|
520
|
+
);
|
|
499
521
|
|
|
500
522
|
// src/types/state-machine.ts
|
|
501
523
|
var StateSchema = z.object({
|
|
@@ -873,6 +895,8 @@ var TraitSchema = z.object({
|
|
|
873
895
|
ticks: z.array(TraitTickSchema).optional(),
|
|
874
896
|
emits: z.array(TraitEventContractSchema).optional(),
|
|
875
897
|
listens: z.array(TraitEventListenerSchema).optional(),
|
|
898
|
+
/** Call-site rename map (`events { ACTION: CONFIRM_VOID }`) — mirrors `Trait.events`. */
|
|
899
|
+
events: z.record(z.string().min(1), z.string().min(1)).optional(),
|
|
876
900
|
ui: TraitUIBindingSchema.optional(),
|
|
877
901
|
config: DeclaredTraitConfigSchema.optional(),
|
|
878
902
|
sourceBehavior: SourceBehaviorMetadataSchema.optional(),
|
|
@@ -1194,40 +1218,44 @@ var GeometryTokensSchema = z.object({
|
|
|
1194
1218
|
borderStandard: z.string().optional(),
|
|
1195
1219
|
borderHeavy: z.string().optional()
|
|
1196
1220
|
});
|
|
1197
|
-
var
|
|
1198
|
-
primary
|
|
1199
|
-
primaryHover
|
|
1200
|
-
primaryForeground
|
|
1201
|
-
secondary
|
|
1202
|
-
secondaryHover
|
|
1203
|
-
secondaryForeground
|
|
1204
|
-
accent
|
|
1205
|
-
accentForeground
|
|
1206
|
-
muted
|
|
1207
|
-
mutedForeground
|
|
1208
|
-
background
|
|
1209
|
-
foreground
|
|
1210
|
-
card
|
|
1211
|
-
cardForeground
|
|
1212
|
-
surface
|
|
1213
|
-
border
|
|
1214
|
-
input
|
|
1215
|
-
ring
|
|
1216
|
-
error
|
|
1217
|
-
errorForeground
|
|
1218
|
-
success
|
|
1219
|
-
successForeground
|
|
1220
|
-
warning
|
|
1221
|
-
warningForeground
|
|
1222
|
-
info
|
|
1223
|
-
infoForeground
|
|
1224
|
-
tableHeader
|
|
1225
|
-
tableBorder
|
|
1226
|
-
tableRowHover
|
|
1227
|
-
surfaceHover
|
|
1228
|
-
borderHover
|
|
1229
|
-
placeholder
|
|
1230
|
-
|
|
1221
|
+
var COLOR_TOKEN_KEY_LIST = [
|
|
1222
|
+
"primary",
|
|
1223
|
+
"primaryHover",
|
|
1224
|
+
"primaryForeground",
|
|
1225
|
+
"secondary",
|
|
1226
|
+
"secondaryHover",
|
|
1227
|
+
"secondaryForeground",
|
|
1228
|
+
"accent",
|
|
1229
|
+
"accentForeground",
|
|
1230
|
+
"muted",
|
|
1231
|
+
"mutedForeground",
|
|
1232
|
+
"background",
|
|
1233
|
+
"foreground",
|
|
1234
|
+
"card",
|
|
1235
|
+
"cardForeground",
|
|
1236
|
+
"surface",
|
|
1237
|
+
"border",
|
|
1238
|
+
"input",
|
|
1239
|
+
"ring",
|
|
1240
|
+
"error",
|
|
1241
|
+
"errorForeground",
|
|
1242
|
+
"success",
|
|
1243
|
+
"successForeground",
|
|
1244
|
+
"warning",
|
|
1245
|
+
"warningForeground",
|
|
1246
|
+
"info",
|
|
1247
|
+
"infoForeground",
|
|
1248
|
+
"tableHeader",
|
|
1249
|
+
"tableBorder",
|
|
1250
|
+
"tableRowHover",
|
|
1251
|
+
"surfaceHover",
|
|
1252
|
+
"borderHover",
|
|
1253
|
+
"placeholder"
|
|
1254
|
+
];
|
|
1255
|
+
var COLOR_TOKEN_KEYS = COLOR_TOKEN_KEY_LIST;
|
|
1256
|
+
var ColorTokensSchema = z.object(
|
|
1257
|
+
Object.fromEntries(COLOR_TOKEN_KEYS.map((key) => [key, z.string().optional()]))
|
|
1258
|
+
);
|
|
1231
1259
|
var IllustrationStyleSchema = z.enum([
|
|
1232
1260
|
"minimal",
|
|
1233
1261
|
"illustrated",
|