@almadar/core 10.129.0 → 11.0.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 (135) hide show
  1. package/dist/behavior-package.d.ts +49 -11
  2. package/dist/behavior-package.js +1 -1
  3. package/dist/{orbital-CkFdDS9f.d.ts → builders-BdgbY7Th.d.ts} +5828 -6917
  4. package/dist/builders.d.ts +6 -6
  5. package/dist/builders.js +7 -6
  6. package/dist/{bus-CcbB__oo.d.ts → bus-C0hFDNFR.d.ts} +262 -354
  7. package/dist/chunk-347APWFM.js +286 -0
  8. package/dist/chunk-347APWFM.js.map +1 -0
  9. package/dist/chunk-5WQ3U7NJ.js +2363 -0
  10. package/dist/chunk-5WQ3U7NJ.js.map +1 -0
  11. package/dist/chunk-5YTPYMPZ.js +99 -0
  12. package/dist/chunk-5YTPYMPZ.js.map +1 -0
  13. package/dist/chunk-66Q5VX2F.js +3810 -0
  14. package/dist/chunk-66Q5VX2F.js.map +1 -0
  15. package/dist/chunk-7GHJU5WI.js +39 -0
  16. package/dist/chunk-7GHJU5WI.js.map +1 -0
  17. package/dist/chunk-B4MNHGBP.js +8 -0
  18. package/dist/chunk-B4MNHGBP.js.map +1 -0
  19. package/dist/chunk-E4T2MQAV.js +24 -0
  20. package/dist/chunk-E4T2MQAV.js.map +1 -0
  21. package/dist/chunk-ENOCKYGA.js +412 -0
  22. package/dist/chunk-ENOCKYGA.js.map +1 -0
  23. package/dist/chunk-FGT5OS2Y.js +918 -0
  24. package/dist/chunk-FGT5OS2Y.js.map +1 -0
  25. package/dist/chunk-GF7KCLNR.js +3284 -0
  26. package/dist/chunk-GF7KCLNR.js.map +1 -0
  27. package/dist/chunk-PNGFWLHD.js +1567 -0
  28. package/dist/chunk-PNGFWLHD.js.map +1 -0
  29. package/dist/{chunk-X4SC7FGF.js → chunk-RGACZEYC.js} +99 -96
  30. package/dist/chunk-RGACZEYC.js.map +1 -0
  31. package/dist/{chunk-RYPVOI6H.js → chunk-SNZYN7UA.js} +2541 -433
  32. package/dist/{chunk-RYPVOI6H.js.map → chunk-SNZYN7UA.js.map} +1 -1
  33. package/dist/{chunk-KDMV222Q.js → chunk-TDNQT3M3.js} +304 -373
  34. package/dist/chunk-TDNQT3M3.js.map +1 -0
  35. package/dist/chunk-VG7BRFUD.js +152 -0
  36. package/dist/chunk-VG7BRFUD.js.map +1 -0
  37. package/dist/chunk-Z7BI7DE7.js +1293 -0
  38. package/dist/chunk-Z7BI7DE7.js.map +1 -0
  39. package/dist/{domain-Dz3jP-UM.d.ts → domain-Cpmja5ak.d.ts} +55 -55
  40. package/dist/{effect-CiEVLsZz.d.ts → effect-DZaXwSAz.d.ts} +283 -453
  41. package/dist/{effect-result-Bebwu9yT.d.ts → effect-result-1HpXgeBc.d.ts} +656 -851
  42. package/dist/{expression-D0Fs0riG.d.ts → expression-DirYKz-f.d.ts} +5 -13
  43. package/dist/factory/index.d.ts +7 -144
  44. package/dist/factory/index.js +8 -8
  45. package/dist/factory-runtime/index.d.ts +7 -6
  46. package/dist/factory-runtime/index.js +527 -8
  47. package/dist/factory-runtime/index.js.map +1 -1
  48. package/dist/fixtures.d.ts +9 -11
  49. package/dist/fixtures.js +12 -8
  50. package/dist/fixtures.js.map +1 -1
  51. package/dist/i18n/index.d.ts +15 -19
  52. package/dist/i18n/index.js +2 -1
  53. package/dist/{index-BC-Jycqj.d.ts → index-D7SxwNdv.d.ts} +34 -734
  54. package/dist/index.d.ts +92 -247
  55. package/dist/index.js +322 -986
  56. package/dist/index.js.map +1 -1
  57. package/dist/kernel-wire.d.ts +3 -3
  58. package/dist/kernel-wire.js +3 -79
  59. package/dist/kernel-wire.js.map +1 -1
  60. package/dist/language/constructs.json +22 -2
  61. package/dist/language/program-types.json +203 -22
  62. package/dist/language/protocols.json +46 -0
  63. package/dist/language/ui-vocabulary.json +1697 -0
  64. package/dist/language/validation-codes.json +1222 -1212
  65. package/dist/language/vocabulary.json +44 -8
  66. package/dist/language-data.d.ts +7 -4
  67. package/dist/language-data.js +20 -14
  68. package/dist/language-data.js.map +1 -1
  69. package/dist/patterns/component-mapping.json +11 -1
  70. package/dist/patterns/definitions.d.ts +2 -2
  71. package/dist/patterns/definitions.js +1 -1
  72. package/dist/patterns/event-contracts.json +1 -15
  73. package/dist/patterns/game-font-families.json +13 -0
  74. package/dist/patterns/index.d.ts +24 -120
  75. package/dist/patterns/index.js +3 -3
  76. package/dist/patterns/pattern-tile-geometry.json +1065 -0
  77. package/dist/patterns/patterns-registry.json +2539 -431
  78. package/dist/patterns/registry.json +2539 -431
  79. package/dist/trait-sRjIivFq.d.ts +3519 -0
  80. package/dist/types/index.d.ts +9 -10
  81. package/dist/types/index.js +11 -5
  82. package/dist/{types-DGwrltUF.d.ts → types-C6_yPMpn.d.ts} +3 -3
  83. package/fixtures/events-wire/client-effects-by-trait/response.json +0 -18
  84. package/fixtures/events-wire/client-effects-provenance/response.json +0 -18
  85. package/fixtures/events-wire/effect-results-every-kind/response.json +2 -27
  86. package/fixtures/events-wire/navigate-1/response.json +8 -5
  87. package/fixtures/events-wire/navigate-2/response.json +11 -8
  88. package/fixtures/events-wire/navigate-3/response.json +14 -11
  89. package/fixtures/events-wire/navigate-back/response.json +7 -4
  90. package/fixtures/events-wire/render-ui-3/response.json +12 -9
  91. package/fixtures/events-wire/render-ui-clear/response.json +0 -7
  92. package/fixtures/events-wire/sse-stream/response.json +0 -20
  93. package/fixtures/events-wire/sse-stream/stream.json +0 -20
  94. package/fixtures/events-wire/stateless-traits/response.json +14 -5
  95. package/fixtures/kernel-wire/golden/basic-entity.json +1687 -0
  96. package/fixtures/kernel-wire/golden/entity-rerender.json +743 -0
  97. package/fixtures/kernel-wire/golden/rollback.json +793 -0
  98. package/fixtures/kernel-wire/golden/tick-counter.json +1538 -0
  99. package/fixtures/kernel-wire/golden/two-orbital-chore.json +847 -0
  100. package/fixtures/kernel-wire/golden/two-orbital-task.json +457 -0
  101. package/fixtures/kernel-wire/played-step.json +136 -0
  102. package/fixtures/kernel-wire/scripts/basic-entity.json +28 -0
  103. package/fixtures/kernel-wire/scripts/entity-rerender.json +13 -0
  104. package/fixtures/kernel-wire/scripts/rollback.json +53 -0
  105. package/fixtures/kernel-wire/scripts/tick-counter.json +26 -0
  106. package/fixtures/kernel-wire/scripts/two-orbital-chore.json +9 -0
  107. package/fixtures/kernel-wire/scripts/two-orbital-task.json +9 -0
  108. package/package.json +28 -19
  109. package/dist/builders-DmZE5By0.d.ts +0 -2663
  110. package/dist/chunk-45I2O4SJ.js +0 -4646
  111. package/dist/chunk-45I2O4SJ.js.map +0 -1
  112. package/dist/chunk-6LR43Z5E.js +0 -3061
  113. package/dist/chunk-6LR43Z5E.js.map +0 -1
  114. package/dist/chunk-GIUA3NUJ.js +0 -809
  115. package/dist/chunk-GIUA3NUJ.js.map +0 -1
  116. package/dist/chunk-GTY53NS5.js +0 -1908
  117. package/dist/chunk-GTY53NS5.js.map +0 -1
  118. package/dist/chunk-JOHDVS6J.js +0 -1614
  119. package/dist/chunk-JOHDVS6J.js.map +0 -1
  120. package/dist/chunk-KDMV222Q.js.map +0 -1
  121. package/dist/chunk-QRHJUS3D.js +0 -23
  122. package/dist/chunk-QRHJUS3D.js.map +0 -1
  123. package/dist/chunk-QUOTJULD.js +0 -4009
  124. package/dist/chunk-QUOTJULD.js.map +0 -1
  125. package/dist/chunk-V5VNGRVU.js +0 -66
  126. package/dist/chunk-V5VNGRVU.js.map +0 -1
  127. package/dist/chunk-X4SC7FGF.js.map +0 -1
  128. package/dist/entityAccess-BPSz1i2n.d.ts +0 -80
  129. package/dist/mock/index.d.ts +0 -153
  130. package/dist/mock/index.js +0 -190
  131. package/dist/mock/index.js.map +0 -1
  132. package/dist/schema-T5RT5s6H.d.ts +0 -282
  133. package/dist/state-machine/index.d.ts +0 -359
  134. package/dist/state-machine/index.js +0 -3
  135. package/dist/state-machine/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/mock/identityOwners.ts"],"names":[],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**\n * Owner columns derived from a program's `[identity]` entity.\n *\n * The JS mirror of `orbital-core/src/runtime/seed.rs`\n * (`identity_entity_name` / `owner_fields_from_schema`). Both paths must agree:\n * a column is an owner column because the source *declared* it as a relation to\n * the `[identity]` entity (`patientId : Person`), never because its name looks\n * like one — a name-matching guess would silently scope the wrong column.\n *\n * @packageDocumentation\n */\n\nimport type { OrbitalEntity } from '../types/entity.js';\nimport type { EntityField } from '../types/field.js';\nimport type { OrbitalDefinition } from '../types/orbital.js';\nimport type { OrbitalSchema } from '../types/schema.js';\nimport type { SExpr } from '../types/expression.js';\nimport {\n entityAccessPolicies,\n orbitalInlineEntities,\n type EntityAccessPolicies,\n} from '../access/entityAccess.js';\n\n/** Inline entity definitions of every orbital in a schema: each orbital's\n * primary entity plus any auxiliaries. */\nfunction inlineEntities(schema: OrbitalSchema): OrbitalEntity[] {\n return (schema.orbitals ?? []).flatMap(orbitalInlineEntities);\n}\n\n/**\n * Every `[identity]`-tagged entity, primaries first, paired with whether it is\n * an orbital's PRIMARY entity or an auxiliary copy an import brought along.\n *\n * Compiled-path twin: `identity_entities_tagged` in\n * `orbital-compiler/src/phases/validation/identity/user_identity.rs` (L57-76).\n */\nfunction identityEntitiesTaggedOf(\n orbitals: readonly OrbitalDefinition[],\n): Array<{ def: OrbitalEntity; primary: boolean }> {\n const out: Array<{ def: OrbitalEntity; primary: boolean }> = [];\n for (const orbital of orbitals) {\n const ref = orbital.entity;\n if (typeof ref === 'object' && ref !== null && 'fields' in ref && (ref as OrbitalEntity).identity === true) {\n out.push({ def: ref as OrbitalEntity, primary: true });\n }\n }\n for (const orbital of orbitals) {\n for (const ref of orbital.auxiliaryEntities ?? []) {\n if (typeof ref === 'object' && ref !== null && 'fields' in ref && (ref as OrbitalEntity).identity === true) {\n out.push({ def: ref as OrbitalEntity, primary: false });\n }\n }\n }\n return out;\n}\n\n/**\n * The `[identity]` entities that decide what `@user` resolves to, primaries\n * first then auxiliaries.\n *\n * A behavior declares its own roster so it runs standalone. Composing it never\n * imports that orbital, but a trait bound to one of its siblings drags the\n * roster in as an auxiliary copy, tag and all — so a PRIMARY roster shadows\n * every imported copy: the composing app decides who `@user` is. With no\n * primary roster the copies still count, which is what lets a thin app that\n * wraps one behavior inherit that behavior's roster.\n *\n * Compiled-path twin: `identity_entities` in\n * `orbital-compiler/src/phases/validation/identity/user_identity.rs` (L94-102).\n */\nexport function identityEntitiesOf(orbitals: readonly OrbitalDefinition[]): OrbitalEntity[] {\n const tagged = identityEntitiesTaggedOf(orbitals);\n const hasPrimary = tagged.some((e) => e.primary);\n return tagged.filter((e) => e.primary || !hasPrimary).map((e) => e.def);\n}\n\n/**\n * The name of the schema's `[identity]` entity, if it declares one.\n *\n * Compiled-path twin: `identity_entities` in\n * `orbital-compiler/src/phases/validation/identity/user_identity.rs`.\n */\nexport function identityEntityName(schema: OrbitalSchema): string | undefined {\n return identityEntitiesOf(schema.orbitals ?? [])[0]?.name;\n}\n\n/**\n * Every `[identity]`-tagged name, shadowed copies included.\n *\n * Owner-column derivation asks whether a relation targets *a* roster, not *the*\n * one: `Timesheet.employeeId : Employee` is an owner column whether or not\n * `Employee` won the `@user` binding. Dropping the shadowed names here would\n * leave an imported behavior's rows unscoped at runtime while the compiled path\n * treats the very same column as an owner column.\n *\n * Compiled-path twin: `identity_entity_names` in\n * `orbital-compiler/src/phases/validation/identity/user_identity.rs`.\n */\nexport function identityEntityNames(schema: OrbitalSchema): string[] {\n const out: string[] = [];\n for (const { def } of identityEntitiesTaggedOf(schema.orbitals ?? [])) {\n if (!out.includes(def.name)) out.push(def.name);\n }\n return out;\n}\n\n/**\n * The declared vocabulary for an identity field, following `items` for the\n * array/map form. `roles : [\"a\" | \"b\"]` keeps the union on the ELEMENT, so a\n * multi-valued role field is read through `items` — one level, not recursive.\n *\n * Compiled-path twin: `vocabulary` in\n * `orbital-compiler/src/phases/validation/identity/user_identity.rs` (L125-134).\n */\nexport function roleVocabularyOf(\n entity: OrbitalEntity,\n field = 'role',\n): readonly string[] | undefined {\n const def = entity.fields.find((f) => f.name === field);\n if (!def) return undefined;\n return fieldVocabulary(def);\n}\n\nfunction fieldVocabulary(field: EntityField): readonly string[] | undefined {\n if ('values' in field && field.values && field.values.length > 0) {\n return field.values;\n }\n if ('items' in field && field.items && 'values' in field.items && field.items.values && field.items.values.length > 0) {\n return field.items.values;\n }\n return undefined;\n}\n\n/**\n * The field name `x` reads off `binding` — either the dotted-path form\n * (`@entity.id`) or the lowered `.lolo` call form (`(object/get @entity id)`\n * → `[\"object/get\", \"@entity\", \"id\"]`, the shape `std-time-tracking`'s\n * `Employee [identity]` actually compiles to; verified against\n * `packages/almadar-behaviors/behaviors/registry/app/organisms/\n * std-time-tracking.orb`). `undefined` when `x` reads a different binding, a\n * different shape entirely, or isn't a field read at all.\n */\nfunction fieldRefName(x: SExpr, binding: string): string | undefined {\n if (typeof x === 'string' && x.startsWith(`${binding}.`)) return x.slice(binding.length + 1);\n if (Array.isArray(x) && x.length === 3 && x[0] === 'object/get' && x[1] === binding && typeof x[2] === 'string') {\n return x[2];\n }\n return undefined;\n}\n\n/** `true` when `x` reads field `field` off binding `binding` (either\n * spelling — see {@link fieldRefName}). */\nfunction isFieldRef(x: SExpr, binding: string, field: string): boolean {\n return fieldRefName(x, binding) === field;\n}\n\n/**\n * Equality operator spellings a direct-ownership comparison may use. `=` is\n * what `.lolo`-authored policies lower to; `==` stays shape-identical to the\n * Rust twin's generalized reader (`POLICY_EQ_OPS` in\n * `orbital-core/src/runtime/seed.rs`), which also accepts a codegen-derived\n * policy bridged through `OirBinaryOp::Eq`'s `==` spelling\n * (`access_policies.rs::owner_fields`).\n */\nconst OWNER_EQ_OPS: readonly string[] = ['=', '=='];\n\n/**\n * Every column `expr` compares to `@user.id` via direct equality — the\n * general form of \"self-identity\": `@entity.<field> == @user.id` (either\n * operand order, either spelling — see `fieldRefName`) names `field` as an\n * owner column, whether `field` is the row's OWN `id` (distinct from a\n * relation column like `@entity.managerId == @user.id`) or any other\n * declared field (the shape `ORB_S_OWNER_FIELD_NOT_IDENTITY_TYPED` flags as\n * an authoring error when it is neither — codegen still needs to seed it).\n * Recurses through `and`/`or`/`not`/any other combinator —\n * `std-time-tracking`'s `Employee [identity]` declares\n * `@read (or (= @user.role \"approver\") (= (object/get @entity id) @user.id))`,\n * and the self-access arm counts even though it isn't the whole policy.\n * Rust twin: `owner_columns_from_policy` in `orbital-core/src/runtime/seed.rs`.\n */\nexport function ownerColumnsFromPolicy(expr: SExpr, out: string[] = []): string[] {\n if (Array.isArray(expr)) {\n if (expr.length === 3) {\n const [op, a, b] = expr;\n if (typeof op === 'string' && OWNER_EQ_OPS.includes(op)) {\n const field = isFieldRef(b, '@user', 'id')\n ? fieldRefName(a, '@entity')\n : isFieldRef(a, '@user', 'id')\n ? fieldRefName(b, '@entity')\n : undefined;\n if (field !== undefined && !out.includes(field)) out.push(field);\n }\n }\n for (const item of expr) ownerColumnsFromPolicy(item, out);\n }\n return out;\n}\n\n/** `true` when ANY of `policies`' four declared directives self-identifies\n * the row — the `[identity]` entity's OWN `id` compared directly to\n * `@user.id` (see {@link ownerColumnsFromPolicy}). */\nfunction policiesSelfIdentify(policies: EntityAccessPolicies | undefined): boolean {\n if (policies === undefined) return false;\n return [policies.read, policies.create, policies.update, policies.delete].some(\n (expr) => expr !== undefined && ownerColumnsFromPolicy(expr).includes('id'),\n );\n}\n\n/**\n * Owner columns as `Entity.field` pairs — every NON-INTRINSIC relation field\n * pointing at an `[identity]`-tagged entity, shadowed imported rosters\n * included, PLUS `Entity.id` for an `[identity]` entity whose own declared\n * access policy compares its row directly to the viewer (self-identity), PLUS\n * any other column an entity's own declared `@read`/`@update`/`@delete`\n * compares to `@user.id` (see `ownerColumnsFromPolicy`). Empty when the\n * program declares no identity, which keeps every unmigrated app behaving\n * exactly as before.\n *\n * An `intrinsic: true` relation field is excluded even when it targets the\n * identity entity: intrinsic marks framework plumbing the owning trait\n * computes itself (`EntityField.intrinsic` doc, `types/field.ts`), never\n * domain ownership — a generic atom's self-relation (`ModalRecord.seedRow :\n * ModalRecord`, record-detail/modal edit-seed plumbing) gets its relation\n * target rewritten onto whatever entity the trait binds, so a self-identity\n * entity like `std-time-tracking`'s `Employee [identity]` ends up with an\n * `Employee.seedRow : Employee` self-relation that is structurally\n * indistinguishable from a real owner column by type/target alone. Stamping\n * it with the viewer id (as an owner column would be) creates a row that\n * references itself, which trips the entity's own `onDelete: restrict`.\n */\nexport function ownerFieldsFromSchema(schema: OrbitalSchema): string[] {\n const identities = identityEntityNames(schema);\n if (identities.length === 0) return [];\n\n const out: string[] = [];\n const defs = inlineEntities(schema);\n const declaredByCollection = new Map<string, string[]>();\n for (const def of defs) {\n for (const field of def.fields ?? []) {\n // Cardinality-one only: an owner column holds ONE viewer id. A\n // `[Person]` array is a participant list, not ownership. Intrinsic\n // fields are framework plumbing the owning trait computes itself\n // (e.g. a record-detail/modal's `seedRow` edit-seed relation) — never\n // domain ownership, even when the field happens to relate to the\n // identity entity because a generic atom's self-relation was rewritten\n // onto the concrete bound entity (`ModalRecord.seedRow : ModalRecord`\n // → `Employee.seedRow : Employee` once bound). Rust twin:\n // `owner_fields_from_schema` in `orbital-core/src/runtime/seed.rs`.\n if (\n field.name &&\n field.type === 'relation' &&\n !field.intrinsic &&\n identities.includes(field.relation.entity)\n ) {\n out.push(`${def.name}.${field.name}`);\n if (def.collection) {\n const cols = declaredByCollection.get(def.collection) ?? [];\n if (!cols.includes(field.name)) cols.push(field.name);\n declaredByCollection.set(def.collection, cols);\n }\n }\n }\n }\n\n // Self-identity: the `[identity]` entity's OWN `id` is the owner column\n // when its declared access policy compares it directly to `@user.id`.\n for (const name of identities) {\n if (policiesSelfIdentify(entityAccessPolicies(schema, name))) {\n const key = `${name}.id`;\n if (!out.includes(key)) out.push(key);\n }\n }\n\n // Policy-derived: a column an entity's OWN `@read`/`@update`/`@delete`\n // compares to `@user.id` is an owner column whether or not it is a\n // relation-to-identity FIELD — the codegen twin\n // (`access_policies.rs::owner_fields`, same reader) already finds this\n // shape (a policy naming a non-relation field), which the type-only scan\n // above cannot. `@create` is excluded — it compares the row being\n // written, which says nothing about what a fixture should already own.\n // Deduped against the type-derived set above (a relation field whose\n // policy also names it, e.g. `managerId`, is not double-counted). Rust\n // twin: `owner_fields_from_schema`'s policy-derived arm in\n // `orbital-core/src/runtime/seed.rs`.\n for (const def of defs) {\n const policies = entityAccessPolicies(schema, def.name);\n if (policies === undefined) continue;\n for (const policy of [policies.read, policies.update, policies.delete]) {\n if (policy === undefined) continue;\n for (const field of ownerColumnsFromPolicy(policy)) {\n const key = `${def.name}.${field}`;\n if (!out.includes(key)) out.push(key);\n }\n }\n }\n\n // Collection mirror of `entityAccessTable`'s policy inheritance: an entity\n // sharing a collection with a declaring sibling is scoped by that sibling's\n // @read policy, so its same-named column IS the owner column the policy\n // compares — an imported atom's entity structurally cannot declare the\n // relation itself (it does not know the app's identity entity). Still\n // declaration-grounded, never name-guessing across collections.\n for (const def of defs) {\n const cols = def.collection ? declaredByCollection.get(def.collection) : undefined;\n if (!cols) continue;\n for (const col of cols) {\n const key = `${def.name}.${col}`;\n if (out.includes(key)) continue;\n if ((def.fields ?? []).some((f) => f.name === col)) out.push(key);\n }\n }\n return out;\n}\n\n/**\n * Equality operators an access-policy comparison may use. Compiled-path twin:\n * `EQUALITY_OPS` in `orbital-compiler/src/phases/validation/identity/user_identity.rs`\n * — shared there with the orbital-import role-literal rewrite\n * (`inline/rewrite.rs` `rewrite_role_literals`), so this JS list and\n * {@link collectUserFieldLiterals} must stay shape-identical to that Rust\n * pair too.\n */\nconst EQUALITY_OPS: readonly string[] = ['=', '==', '!=', '!==', 'eq', 'neq'];\n\n/** `true` when `x` is a direct `@user.<field>` sigil read (either spelling —\n * see {@link fieldRefName}), regardless of WHICH field. Used to locate the\n * sigil operand of an `array/includes` node BY CONTENT rather than\n * position — see {@link collectUserFieldLiterals}'s doc. */\nfunction isUserFieldSigil(x: SExpr): boolean {\n return typeof x === 'string' && fieldRefName(x, '@user') !== undefined;\n}\n\n/**\n * Is an `array/includes` haystack array a LITERAL role list, and if so,\n * which elements are the members? Twin of Rust\n * `validation::user_identity::literal_haystack_members` (`user_identity.rs`)\n * — the two must stay shape-identical: either a `[\"list\", …]`\n * array-construction call (Rust `mark_literal_list_in_place`'s wrap for a\n * config-array-override value that would otherwise collide with operator\n * dispatch; both `.lolo` spellings `(a b)`/`[a, b]` lower through it) whose\n * TAIL is all-string, or a bare array whose every element (including\n * position 0) is a string literal. Any other shape — a nested call like\n * `[\"object/get\", [\"array/nth\", …], \"allowedRoles\"]`, std-step-flow's\n * per-step dynamic role guard — is not a literal haystack: `undefined`.\n */\nfunction literalHaystackMembers(items: readonly SExpr[]): string[] | undefined {\n const isListCall = items[0] === 'list';\n const members = isListCall ? items.slice(1) : items;\n return members.every((v): v is string => typeof v === 'string') ? [...members] : undefined;\n}\n\n/**\n * Every literal an expression compares against `@user.<field>` (any field),\n * keyed by field name — the collecting counterpart of `orbital-compiler`'s\n * `validation::user_identity::check_comparison` (B4-R4; the two must stay\n * shape-identical, each cites the other): an equality node (`EQUALITY_OPS`)\n * or an `array/includes` node, walked transparently through `and`/`or`/`not`\n * and any other combinator (the Rust check runs on EVERY array node\n * regardless of what wraps it, so this does too).\n *\n * `array/includes` is directional, but the sigil can sit on EITHER side:\n * `(array/includes @user.roles \"ghost\")` checks a literal against a\n * multi-valued field's own vocabulary (field is the haystack, position 0);\n * the Stage-B orbital-import role rewrite (Rust `inline/rewrite.rs`\n * `rewrite_role_literals`, which `check_comparison` mirrors) instead\n * produces `(array/includes [\"owner\",\"project_manager\"] @user.role)` — a\n * literal ARRAY haystack with the sigil as the needle, position 1 (found\n * live: Project Friday's imported `Timesheet.@delete` after `roles {\n * approver: [owner, project_manager] }`). So the sigil is located BY\n * CONTENT, never position: check position 0 first, fall back to position 1.\n * The OTHER side is then flattened to a literal list — a scalar (equality,\n * or an `array/includes` whose haystack is the sigil's own multi-valued\n * field) or, for the role-rewrite shape, every string element of a literal\n * array.\n *\n * A collected literal is a CANDIDATE a viewer might satisfy the expression\n * with, never a proof: a policy that ANDs the field check with an unrelated\n * condition can still reject a viewer carrying it. Callers that need\n * certainty re-check with the real evaluator (`checkMutationAccess` /\n * `evaluate`), the way any other synthesized dispatch is confirmed.\n */\nexport function collectUserFieldLiterals(\n expr: SExpr,\n out: Map<string, Set<string>> = new Map(),\n): Map<string, Set<string>> {\n if (Array.isArray(expr)) {\n const [op, ...args] = expr;\n if (typeof op === 'string' && args.length >= 2 && (EQUALITY_OPS.includes(op) || op === 'array/includes')) {\n const isIncludes = op === 'array/includes';\n let sigilSide: SExpr[];\n let literalSide: SExpr[];\n if (isIncludes) {\n if (isUserFieldSigil(args[0])) {\n sigilSide = args.slice(0, 1);\n literalSide = args.slice(1, 2);\n } else {\n sigilSide = args.slice(1, 2);\n literalSide = args.slice(0, 1);\n }\n } else {\n sigilSide = args;\n literalSide = args;\n }\n const field = sigilSide.map((arg) => fieldRefName(arg, '@user')).find((f): f is string => f !== undefined);\n if (field !== undefined) {\n const literalArrayHaystack = literalSide[0];\n const literals: SExpr[] =\n isIncludes && Array.isArray(literalArrayHaystack)\n ? (literalHaystackMembers(literalArrayHaystack) ?? [])\n : literalSide;\n for (const literal of literals) {\n if (typeof literal === 'string' && !literal.startsWith('@')) {\n const set = out.get(field) ?? new Set<string>();\n set.add(literal);\n out.set(field, set);\n }\n }\n }\n }\n for (const item of expr) collectUserFieldLiterals(item, out);\n return out;\n }\n if (expr !== null && typeof expr === 'object') {\n for (const value of Object.values(expr)) collectUserFieldLiterals(value, out);\n }\n return out;\n}\n\n/**\n * A `@user.<field>` value that satisfies `policy`, chosen from the identity\n * entity's own declared vocabulary — never a guess: only a literal BOTH\n * (a) compared against `field` in an equality/`array/includes` node\n * somewhere in `policy` (see {@link collectUserFieldLiterals}) AND (b) a\n * declared member of `identity`'s `field` vocabulary (see\n * {@link roleVocabularyOf}) is a candidate. The pick is deterministic — the\n * first vocabulary value, in declaration order, that is also a candidate —\n * so two callers asking about the same policy always agree.\n *\n * `undefined` when `policy` is absent/`null` (no restriction — nothing to\n * satisfy), `field` carries no declared vocabulary on `identity`, or no\n * declared value appears anywhere in the policy. The last case is a genuine\n * finding for the CALLER to report, not a probe defect to paper over: the\n * policy structurally cannot be satisfied by any roster member, so forcing a\n * viewer past it would misreport an unreachable transition as reachable.\n */\nexport function roleSatisfyingPolicy(\n policy: SExpr | undefined,\n identity: OrbitalEntity,\n field = 'role',\n): string | undefined {\n if (policy === undefined || policy === null) return undefined;\n const vocab = roleVocabularyOf(identity, field);\n if (vocab === undefined) return undefined;\n const accepted = collectUserFieldLiterals(policy).get(field);\n if (accepted === undefined) return undefined;\n return vocab.find((value) => accepted.has(value));\n}\n"]}
@@ -1,282 +0,0 @@
1
- import { z } from 'zod';
2
- import { E as EventPayloadField, a as Orbital, b as OsGrants, D as Deployment, L as LazyPage, c as DeclaredTraitConfig, T as Trait } from './orbital-CkFdDS9f.js';
3
- import { a as ThemeRef, T as ThemeDefinition, D as DomainContext, b as DesignPreferences, c as DesignTokens, C as CustomPatternMap } from './domain-Dz3jP-UM.js';
4
- import { S as ServiceDefinition, I as IdentityLedger } from './effect-CiEVLsZz.js';
5
- import { R as RuntimeValue } from './expression-D0Fs0riG.js';
6
-
7
- /**
8
- * Orbital Schema Type (Self-Contained)
9
- *
10
- * Defines the OrbitalSchema - the top-level application definition.
11
- * An application is a composition of orbitals: App = Σ(Orbitals)
12
- *
13
- * @packageDocumentation
14
- */
15
-
16
- /**
17
- * OrbitalSchema - The top-level application definition.
18
- *
19
- * An application is a composition of orbitals:
20
- * App = Σ(Orbitals)
21
- *
22
- * Custom traits can be defined at the schema level and referenced
23
- * by orbitals via TraitRef. This allows LLMs to generate custom
24
- * traits that aren't in the trait library.
25
- */
26
- /**
27
- * One `@config.<knob>` → render-ui prop substitution recorded by the inline
28
- * phase. Lets a consumer trace a resolved render-ui literal back to the config
29
- * knob it came from (the `@config.X` string is erased after substitution).
30
- * Mirrors the Rust `ConfigProvenanceRecord`.
31
- */
32
- interface ConfigProvenanceRecord {
33
- /** Resolved trait name (post call-site rename) owning the render-ui effect. */
34
- trait: string;
35
- /** Pattern path within the render-ui tree (e.g. `root.children.0`). */
36
- patternPath?: string;
37
- /** The pattern-node prop key whose value was a `@config.X` binding. */
38
- prop: string;
39
- /** The config knob name (`X` in `@config.X`). */
40
- knob: string;
41
- }
42
- /** Compiler-emitted schema metadata — the resolved `.orb` `_metadata` block. */
43
- interface SchemaMetadata {
44
- version?: number;
45
- createdAt?: number;
46
- source?: string;
47
- updatedAt?: number;
48
- /** Config→knob provenance keyed by orbital name. See {@link ConfigProvenanceRecord}. */
49
- configProvenance?: Record<string, ConfigProvenanceRecord[]>;
50
- /** For a program with `locales`: each loaded behavior → its source folder, relative to the program's (catalogs at `<folder>/locales/<locale>/<name>.json`). */
51
- messageSources?: Record<string, string>;
52
- /** Compiled client programs: where each effect operator the client's traits run executes, for a kernel with no operator table. */
53
- operatorSites?: Record<string, 'client' | 'server' | 'any'>;
54
- /** Compiled client programs: the operator-table facts a kernel reads at dispatch. */
55
- dispatchFacts?: DispatchFacts;
56
- }
57
- /** The operator-table facts a browser kernel reads at dispatch (`emit` busExcluded, `program/dispatch` targetOptions). */
58
- interface DispatchFacts {
59
- busExcluded: string[];
60
- targetOptions: string[];
61
- }
62
- /** App-level site modifiers: `origin`, `icon`, `siteName` (→ `name`), `signIn`. */
63
- interface SiteMeta {
64
- /** Canonical production origin, e.g. `https://orb.almadar.io`. */
65
- origin?: string;
66
- /** Site icon path served from the public folder. */
67
- icon?: string;
68
- /** Site name (og:site_name). */
69
- name?: string;
70
- /** Route an `access: authenticated` page sends a non-admitted viewer to. */
71
- signIn?: string;
72
- }
73
- /**
74
- * The sign-in route every host provides itself (the compiled shell's login form, the
75
- * runtime host's sign-in surface). `signIn:` may name it without a page, and no page
76
- * may be declared on it. Mirrors `orbital-core` `HOST_SIGN_IN_ROUTE`.
77
- */
78
- declare const HOST_SIGN_IN_ROUTE = "/login";
79
- /** Whether `path` is {@link HOST_SIGN_IN_ROUTE}, ignoring a trailing slash. */
80
- declare function isHostSignInRoute(path: string): boolean;
81
- declare const SiteMetaSchema: z.ZodObject<{
82
- origin: z.ZodOptional<z.ZodString>;
83
- icon: z.ZodOptional<z.ZodString>;
84
- name: z.ZodOptional<z.ZodString>;
85
- signIn: z.ZodOptional<z.ZodString>;
86
- }, z.core.$strict>;
87
- /** A program's merged message catalogs: locale → qualified key (`<behavior>:<key>`) → message. `orb resolve` writes one `<stem>.<locale>.json` per locale. */
88
- type MessageCatalogs = Record<string, Record<string, string>>;
89
- interface OrbitalSchema {
90
- types?: Record<string, EventPayloadField[]>;
91
- typeContractVersion?: 1;
92
- /** Application name */
93
- name: string;
94
- /** Description */
95
- description?: string;
96
- /**
97
- * App-level theme: the skin every orbital's `@currentTheme` seeds from
98
- * unless the orbital declares its own `theme` (precedence: orbital →
99
- * app → the runtime's baseline default). Authored as `theme "<key>"` in
100
- * the `.lolo` app header; a full `<base>-<light|dark>` registry key.
101
- * Distinct from {@link OrbitalSchema.config} — this names a registry
102
- * theme, not a declared knob.
103
- */
104
- theme?: ThemeRef;
105
- /**
106
- * The registry themes the program switches to inside a page (a sub-frame's
107
- * `data-theme`, a theme switcher's options), beyond its app and orbital
108
- * themes. Authored as `themes: [<key>, …]` in the `.lolo` app header; each
109
- * a full `<base>-<light|dark>` registry key.
110
- */
111
- themes?: string[];
112
- /**
113
- * The theme presets this program references (app and orbital `theme`
114
- * keys) plus the runtime default, written by `orb` when it compiles the
115
- * program for a runtime, so a kernel with no installed `@almadar/core`
116
- * (wasm, mobile) resolves `@currentTheme` from the program alone. Never
117
- * authored; absent on a source `.orb`.
118
- */
119
- themeDefinitions?: ThemeDefinition[];
120
- /**
121
- * Short human-readable summary distinct from `description`. Typically an
122
- * AI-generated one-liner used by app list views, breadcrumbs, and the
123
- * `GET /graphs/:appId/domain-text` projection. Kept separate from
124
- * `description` (which may be longer / authored copy) so consumers can
125
- * present a stable short label without truncating.
126
- */
127
- summary?: string;
128
- /** Version (semver) */
129
- version?: string;
130
- /** Domain context - user request + classification */
131
- domainContext?: DomainContext;
132
- /** Design preferences */
133
- design?: DesignPreferences;
134
- /**
135
- * Design tokens - reusable Tailwind class collections.
136
- * Reference via `token: "surfaces.glass"` in patterns.
137
- */
138
- designTokens?: DesignTokens;
139
- /**
140
- * Custom pattern definitions for app-specific reusable patterns.
141
- * Register custom designs that can be referenced by name.
142
- */
143
- customPatterns?: CustomPatternMap;
144
- /** Array of orbitals */
145
- orbitals: Orbital[];
146
- /** `locales [en, ar, sl]` — the locales this program ships; every `(i18n/t …)` key must exist in each one's catalog. */
147
- locales?: string[];
148
- /** `public: "./public"` — a folder beside the program copied verbatim to the built site's root. */
149
- publicDir?: string;
150
- /** `app … [store: Driver]` — the default store-driver orbital for persistent entities that name none. */
151
- store?: string;
152
- /** Origins (`scheme://host[:port]`) the program's `http` effects may reach. */
153
- egress?: string[];
154
- /** `os-grants { … }` — the `os/` permissions the whole program holds; every orbital inherits them. */
155
- osGrants?: OsGrants;
156
- /** `deployment { target: [Orbital, …] }` — which orbitals ship to which target. */
157
- deployment?: Deployment;
158
- /** `inbound: [...]` — the hook names (`/api/hooks/<name>`) the program accepts deliveries on. */
159
- inbound?: string[];
160
- /** Site modifiers from the app bracket (`origin`, `icon`, `siteName`, `signIn`). */
161
- site?: SiteMeta;
162
- /** Pages served by `uses lazy` behaviors, each loaded from its own `.orb` when opened. */
163
- lazyPages?: LazyPage[];
164
- /** External services */
165
- services?: ServiceDefinition[];
166
- /**
167
- * Organism-level DECLARED knobs (§4.5) — shared by every orbital in this
168
- * schema, forwarded via `@config.<knob>`. Distinct from `Orbital.config`,
169
- * which declares one orbital's own knobs.
170
- */
171
- config?: DeclaredTraitConfig;
172
- /** Compiler-emitted metadata (resolved `.orb` `_metadata`). */
173
- _metadata?: SchemaMetadata;
174
- /**
175
- * V4 IR schema version. Distinct from the semver `version` above; gates the
176
- * identity-keyed reference semantics. Optional/unset for pre-V4 schemas.
177
- */
178
- schemaVersion?: number;
179
- /**
180
- * V4 identity ledger — the sole name↔id map for this schema's nodes. Optional
181
- * until the Phase-7 flip; absent on pre-V4 schemas.
182
- */
183
- ledger?: IdentityLedger;
184
- }
185
- declare const ConfigProvenanceRecordSchema: z.ZodObject<{
186
- trait: z.ZodString;
187
- patternPath: z.ZodOptional<z.ZodString>;
188
- prop: z.ZodString;
189
- knob: z.ZodString;
190
- }, z.core.$strip>;
191
- declare const SchemaMetadataSchema: z.ZodObject<{
192
- version: z.ZodOptional<z.ZodNumber>;
193
- createdAt: z.ZodOptional<z.ZodNumber>;
194
- source: z.ZodOptional<z.ZodString>;
195
- updatedAt: z.ZodOptional<z.ZodNumber>;
196
- configProvenance: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
197
- trait: z.ZodString;
198
- patternPath: z.ZodOptional<z.ZodString>;
199
- prop: z.ZodString;
200
- knob: z.ZodString;
201
- }, z.core.$strip>>>>;
202
- messageSources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
203
- operatorSites: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
204
- any: "any";
205
- client: "client";
206
- server: "server";
207
- }>>>;
208
- dispatchFacts: z.ZodOptional<z.ZodObject<{
209
- busExcluded: z.ZodArray<z.ZodString>;
210
- targetOptions: z.ZodArray<z.ZodString>;
211
- }, z.core.$strip>>;
212
- }, z.core.$strip>;
213
- declare const OrbitalSchemaSchema: z.ZodType<OrbitalSchema, object>;
214
- /**
215
- * Flattened `OrbitalSchema` view used by the persistence/runtime layer.
216
- *
217
- * Canonical `OrbitalSchema` keeps every trait inside its owning
218
- * `OrbitalDefinition.traits`. Some runtime paths (e.g. the orbital-agent
219
- * stream, Firestore persistence) additionally roll the resolved trait set up
220
- * to the top level as `traits[]` so diffs and list views don't have to walk
221
- * every orbital.
222
- *
223
- * This is intentionally a LOSSY persisted view, NOT the canonical authoring
224
- * shape: it carries the rolled-up array alongside the per-orbital trait
225
- * lists, and consumers should prefer `OrbitalSchema` whenever the rolled-up
226
- * surface isn't required.
227
- */
228
- interface OrbitalSchemaWithTraits extends OrbitalSchema {
229
- /** Flattened trait set rolled up from all orbitals. Persisted-view only. */
230
- traits?: Trait[];
231
- }
232
- /**
233
- * Parses raw data into a validated OrbitalSchema.
234
- *
235
- * Uses Zod validation to ensure the data conforms to the OrbitalSchema structure.
236
- * Throws a ZodError if validation fails. For safe parsing that doesn't throw,
237
- * use `safeParseOrbitalSchema()` instead.
238
- *
239
- * @param {unknown} data - Raw data to parse (typically JSON)
240
- * @returns {OrbitalSchema} Validated orbital schema
241
- * @throws {z.ZodError} If data doesn't match OrbitalSchema structure
242
- *
243
- * @example
244
- * ```typescript
245
- * try {
246
- * const schema = parseOrbitalSchema(jsonData);
247
- * console.log('Valid schema:', schema.name);
248
- * } catch (error) {
249
- * console.error('Invalid schema:', error);
250
- * }
251
- * ```
252
- *
253
- * @see safeParseOrbitalSchema
254
- */
255
- declare function parseOrbitalSchema(data: RuntimeValue): OrbitalSchema;
256
- /**
257
- * Safely parses raw data into a validated OrbitalSchema without throwing.
258
- *
259
- * Uses Zod's safeParse method to validate data and return a result object
260
- * instead of throwing errors. This is useful for form validation and
261
- * user input handling where you want to gracefully handle invalid data.
262
- *
263
- * @param {unknown} data - Raw data to parse (typically JSON)
264
- * @returns {z.ZodSafeParseResult<OrbitalSchema>} Parse result with success/status
265
- *
266
- * @example
267
- * ```typescript
268
- * const result = safeParseOrbitalSchema(jsonData);
269
- * if (result.success) {
270
- * console.log('Valid schema:', result.data.name);
271
- * } else {
272
- * console.error('Validation errors:', result.error);
273
- * }
274
- * ```
275
- *
276
- * @see parseOrbitalSchema
277
- */
278
- declare function safeParseOrbitalSchema(data: RuntimeValue): z.ZodSafeParseResult<OrbitalSchema>;
279
- type OrbitalSchemaInput = z.input<typeof OrbitalSchemaSchema>;
280
-
281
- export { HOST_SIGN_IN_ROUTE as H, ConfigProvenanceRecordSchema as a, OrbitalSchemaSchema as c, SchemaMetadataSchema as e, SiteMetaSchema as g, isHostSignInRoute as i, parseOrbitalSchema as p, safeParseOrbitalSchema as s };
282
- export type { ConfigProvenanceRecord as C, DispatchFacts as D, MessageCatalogs as M, OrbitalSchema as O, SchemaMetadata as S, OrbitalSchemaInput as b, OrbitalSchemaWithTraits as d, SiteMeta as f };