@almadar/evaluator 2.44.0 → 2.45.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.
@@ -18,6 +18,18 @@ interface EvaluationContext {
18
18
  entity: EntityRow;
19
19
  /** Payload data for @payload bindings */
20
20
  payload: EventPayload;
21
+ /**
22
+ * The composing effect's triggering payload, for a trait embedded via
23
+ * `@trait.X` inline into a parent's render-ui. The lolo lowerer hoists a
24
+ * JSX render site's `?field` reads into the embedded child's config as
25
+ * `@callsitePayload.<field>` — mirrors the compiled path's
26
+ * `CALLSITE_PAYLOAD_PREFIX` (`orbital-core/src/schema/types.rs`) and
27
+ * `@almadar/core`'s `CORE_BINDINGS` root `callsitePayload`. Set by
28
+ * `OrbitalServerRuntime.executeEffects` / the client's
29
+ * `useTraitStateMachine` when re-running an embedded child's lifecycle
30
+ * transition under its embedder's payload.
31
+ */
32
+ callsitePayload?: EventPayload;
21
33
  /** Current state for @state binding */
22
34
  state: string;
23
35
  /** Current timestamp for @now binding (defaults to Date.now()) */
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { SExpr, RuntimeValue, ListenPayloadEvaluator } from '@almadar/core';
2
2
  export { CORE_BINDINGS, CoreBinding, Expression, ExpressionSchema, ParsedBinding, SExpr, SExprAtom, SExprSchema, UserContext, collectBindings, getArgs, getOperator, isBinding, isSExpr, isSExprAtom, isSExprCall, isValidBinding, parseBinding, sexpr, walkSExpr } from '@almadar/core';
3
- import { E as EvaluationContext } from './index-DDh6RIVu.js';
4
- export { c as createChildContext, a as createEffectContext, b as createMinimalContext, e as evalAbs, d as evalAdd, f as evalAnd, g as evalAtomic, h as evalCallService, i as evalCeil, j as evalClamp, k as evalConcat, l as evalCount, m as evalDecrement, n as evalDeref, o as evalDespawn, p as evalDivide, q as evalDo, r as evalEmit, s as evalEmpty, t as evalEqual, u as evalFilter, v as evalFind, w as evalFirst, x as evalFloor, y as evalFn, z as evalGreaterThan, A as evalGreaterThanOrEqual, B as evalIf, C as evalIncludes, D as evalIncrement, F as evalLast, G as evalLessThan, H as evalLessThanOrEqual, I as evalLet, J as evalList, K as evalMap, L as evalMatches, M as evalMax, N as evalMin, O as evalModulo, P as evalMultiply, Q as evalNavigate, R as evalNot, S as evalNotEqual, T as evalNotify, U as evalNth, V as evalOr, W as evalPersist, X as evalRef, Y as evalRenderUI, Z as evalRound, _ as evalSet, $ as evalSetDynamic, a0 as evalSpawn, a1 as evalSubtract, a2 as evalSum, a3 as evalSwap, a4 as evalWatch, a5 as evalWhen, a6 as resolveBinding } from './index-DDh6RIVu.js';
3
+ import { E as EvaluationContext } from './index-DmefVNGd.js';
4
+ export { c as createChildContext, a as createEffectContext, b as createMinimalContext, e as evalAbs, d as evalAdd, f as evalAnd, g as evalAtomic, h as evalCallService, i as evalCeil, j as evalClamp, k as evalConcat, l as evalCount, m as evalDecrement, n as evalDeref, o as evalDespawn, p as evalDivide, q as evalDo, r as evalEmit, s as evalEmpty, t as evalEqual, u as evalFilter, v as evalFind, w as evalFirst, x as evalFloor, y as evalFn, z as evalGreaterThan, A as evalGreaterThanOrEqual, B as evalIf, C as evalIncludes, D as evalIncrement, F as evalLast, G as evalLessThan, H as evalLessThanOrEqual, I as evalLet, J as evalList, K as evalMap, L as evalMatches, M as evalMax, N as evalMin, O as evalModulo, P as evalMultiply, Q as evalNavigate, R as evalNot, S as evalNotEqual, T as evalNotify, U as evalNth, V as evalOr, W as evalPersist, X as evalRef, Y as evalRenderUI, Z as evalRound, _ as evalSet, $ as evalSetDynamic, a0 as evalSpawn, a1 as evalSubtract, a2 as evalSum, a3 as evalSwap, a4 as evalWatch, a5 as evalWhen, a6 as resolveBinding } from './index-DmefVNGd.js';
5
5
 
6
6
  /**
7
7
  * S-Expression Evaluator
package/dist/index.js CHANGED
@@ -63,6 +63,9 @@ function resolveBinding(binding, ctx) {
63
63
  case "payload":
64
64
  value = ctx.payload;
65
65
  break;
66
+ case "callsitePayload":
67
+ value = ctx.callsitePayload;
68
+ break;
66
69
  case "state":
67
70
  return ctx.state;
68
71
  // @state has no path
@@ -1035,10 +1038,6 @@ function evalArrayRange(args, evaluate2, ctx) {
1035
1038
  }
1036
1039
  return out;
1037
1040
  }
1038
- function evalArrayEmpty(args, evaluate2, ctx) {
1039
- const arr = evaluate2(args[0], ctx);
1040
- return !arr || arr.length === 0;
1041
- }
1042
1041
  function evalArrayFirst(args, evaluate2, ctx) {
1043
1042
  const arr = evaluate2(args[0], ctx);
1044
1043
  return arr?.[0] ?? null;
@@ -1526,10 +1525,6 @@ function evalObjectFilter(args, evaluate2, ctx) {
1526
1525
  }
1527
1526
  return result;
1528
1527
  }
1529
- function evalObjectEmpty(args, evaluate2, ctx) {
1530
- const obj = evaluate2(args[0], ctx);
1531
- return !obj || Object.keys(obj).length === 0;
1532
- }
1533
1528
  function evalObjectEquals(args, evaluate2, ctx) {
1534
1529
  const a = evaluate2(args[0], ctx);
1535
1530
  const b = evaluate2(args[1], ctx);
@@ -4366,7 +4361,6 @@ var OPERATOR_TABLE = {
4366
4361
  "to-string": (args, evaluate2, ctx) => String(evaluate2(args[0], ctx)),
4367
4362
  "array/len": evalArrayLen,
4368
4363
  "array/range": evalArrayRange,
4369
- "array/empty?": evalArrayEmpty,
4370
4364
  "array/first": evalArrayFirst,
4371
4365
  "array/last": evalArrayLast,
4372
4366
  "array/nth": evalArrayNth,
@@ -4420,7 +4414,6 @@ var OPERATOR_TABLE = {
4420
4414
  "object/mapValues": evalObjectMapValues,
4421
4415
  "object/mapKeys": evalObjectMapKeys,
4422
4416
  "object/filter": evalObjectFilter,
4423
- "object/empty?": evalObjectEmpty,
4424
4417
  "object/equals": evalObjectEquals,
4425
4418
  "object/clone": evalObjectClone,
4426
4419
  "object/deepClone": evalObjectDeepClone,