@almadar/core 10.83.0 → 10.85.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/dist/index.js CHANGED
@@ -1325,6 +1325,14 @@ var EntityFieldContractSchema = z.object({
1325
1325
  requires: z.array(z.string()),
1326
1326
  provides: z.array(z.string())
1327
1327
  });
1328
+ var EffectSiteSchema = z.enum(["transition", "tick"]);
1329
+ var EffectUseSchema = z.object({
1330
+ kind: z.string(),
1331
+ resource: z.string().optional(),
1332
+ resolved: z.boolean().optional(),
1333
+ site: EffectSiteSchema.optional()
1334
+ });
1335
+ var EffectRowSchema = z.array(EffectUseSchema);
1328
1336
  var SourceBehaviorMetadataSchema = z.object({
1329
1337
  behavior: z.string().min(1),
1330
1338
  alias: z.string().min(1),
@@ -1343,6 +1351,7 @@ var TraitSchema = z.object({
1343
1351
  category: TraitCategorySchema.optional(),
1344
1352
  entityRebindable: z.boolean().optional(),
1345
1353
  entityContract: EntityFieldContractSchema.optional(),
1354
+ effectRow: EffectRowSchema.optional(),
1346
1355
  entityBindingDescription: z.string().optional(),
1347
1356
  entityBindingSynonyms: z.string().optional(),
1348
1357
  capabilities: z.array(z.string()).optional(),
@@ -2475,7 +2484,7 @@ function getInteractionModelForDomain(domain) {
2475
2484
  // src/patterns/patterns-registry.json
2476
2485
  var patterns_registry_default = {
2477
2486
  version: "1.0.0",
2478
- exportedAt: "2026-09-04T03:53:29.561Z",
2487
+ exportedAt: "2026-09-05T01:37:56.135Z",
2479
2488
  patterns: {
2480
2489
  "entity-table": {
2481
2490
  type: "entity-table",
@@ -11756,6 +11765,11 @@ var patterns_registry_default = {
11756
11765
  "boolean"
11757
11766
  ]
11758
11767
  },
11768
+ title: {
11769
+ types: [
11770
+ "string"
11771
+ ]
11772
+ },
11759
11773
  onClick: {
11760
11774
  types: [
11761
11775
  "function"
@@ -19237,7 +19251,8 @@ var patterns_registry_default = {
19237
19251
  "paragraph-forward",
19238
19252
  "paragraph-back",
19239
19253
  "line",
19240
- "selection"
19254
+ "selection",
19255
+ "match-bracket"
19241
19256
  ]
19242
19257
  },
19243
19258
  {
@@ -19268,7 +19283,16 @@ var patterns_registry_default = {
19268
19283
  enumValues: [
19269
19284
  "delete",
19270
19285
  "yank",
19271
- "change"
19286
+ "change",
19287
+ "put",
19288
+ "put-before",
19289
+ "undo",
19290
+ "redo",
19291
+ "join",
19292
+ "toggle-case",
19293
+ "indent",
19294
+ "dedent",
19295
+ "replace"
19272
19296
  ]
19273
19297
  },
19274
19298
  {
@@ -19291,7 +19315,8 @@ var patterns_registry_default = {
19291
19315
  "paragraph-forward",
19292
19316
  "paragraph-back",
19293
19317
  "line",
19294
- "selection"
19318
+ "selection",
19319
+ "match-bracket"
19295
19320
  ]
19296
19321
  },
19297
19322
  {
@@ -19380,7 +19405,8 @@ var patterns_registry_default = {
19380
19405
  "paragraph-forward",
19381
19406
  "paragraph-back",
19382
19407
  "line",
19383
- "selection"
19408
+ "selection",
19409
+ "match-bracket"
19384
19410
  ]
19385
19411
  },
19386
19412
  default: [
@@ -19399,7 +19425,8 @@ var patterns_registry_default = {
19399
19425
  "paragraph-forward",
19400
19426
  "paragraph-back",
19401
19427
  "line",
19402
- "selection"
19428
+ "selection",
19429
+ "match-bracket"
19403
19430
  ],
19404
19431
  tier: "presentation"
19405
19432
  },
@@ -19415,13 +19442,31 @@ var patterns_registry_default = {
19415
19442
  enumValues: [
19416
19443
  "delete",
19417
19444
  "yank",
19418
- "change"
19445
+ "change",
19446
+ "put",
19447
+ "put-before",
19448
+ "undo",
19449
+ "redo",
19450
+ "join",
19451
+ "toggle-case",
19452
+ "indent",
19453
+ "dedent",
19454
+ "replace"
19419
19455
  ]
19420
19456
  },
19421
19457
  default: [
19422
19458
  "delete",
19423
19459
  "yank",
19424
- "change"
19460
+ "change",
19461
+ "put",
19462
+ "put-before",
19463
+ "undo",
19464
+ "redo",
19465
+ "join",
19466
+ "toggle-case",
19467
+ "indent",
19468
+ "dedent",
19469
+ "replace"
19425
19470
  ],
19426
19471
  tier: "presentation"
19427
19472
  }
@@ -54695,7 +54740,10 @@ var patterns_registry_default = {
54695
54740
  enumValues: [
54696
54741
  "bottom-center",
54697
54742
  "bottom-left",
54698
- "bottom-right"
54743
+ "bottom-right",
54744
+ "top-center",
54745
+ "top-left",
54746
+ "top-right"
54699
54747
  ],
54700
54748
  default: "bottom-center"
54701
54749
  },
@@ -55258,6 +55306,139 @@ var patterns_registry_default = {
55258
55306
  description: "Base URL prepended to every manifest path."
55259
55307
  }
55260
55308
  }
55309
+ },
55310
+ "ui-slot-component": {
55311
+ type: "ui-slot-component",
55312
+ category: "layout",
55313
+ tier: "organisms",
55314
+ family: "core",
55315
+ description: "UISlotComponent component",
55316
+ suggestedFor: [
55317
+ "slot",
55318
+ "component",
55319
+ "u i slot component"
55320
+ ],
55321
+ typicalSize: "large",
55322
+ propsSchema: {
55323
+ slot: {
55324
+ types: [
55325
+ "object"
55326
+ ],
55327
+ description: "slot prop",
55328
+ required: true
55329
+ },
55330
+ portal: {
55331
+ types: [
55332
+ "boolean"
55333
+ ],
55334
+ description: "portal prop",
55335
+ default: false
55336
+ },
55337
+ position: {
55338
+ types: [
55339
+ "string"
55340
+ ],
55341
+ description: "position prop",
55342
+ enumValues: [
55343
+ "left",
55344
+ "right",
55345
+ "top-right",
55346
+ "top-left",
55347
+ "bottom-right",
55348
+ "bottom-left"
55349
+ ]
55350
+ },
55351
+ className: {
55352
+ types: [
55353
+ "string"
55354
+ ],
55355
+ description: "className prop"
55356
+ },
55357
+ draggable: {
55358
+ types: [
55359
+ "boolean"
55360
+ ],
55361
+ description: "draggable prop"
55362
+ },
55363
+ isLoading: {
55364
+ types: [
55365
+ "boolean"
55366
+ ],
55367
+ description: "isLoading prop"
55368
+ },
55369
+ error: {
55370
+ types: [
55371
+ "object"
55372
+ ],
55373
+ description: "error prop",
55374
+ properties: {
55375
+ message: {
55376
+ types: [
55377
+ "string"
55378
+ ]
55379
+ },
55380
+ name: {
55381
+ types: [
55382
+ "string"
55383
+ ]
55384
+ },
55385
+ code: {
55386
+ types: [
55387
+ "string"
55388
+ ]
55389
+ },
55390
+ stack: {
55391
+ types: [
55392
+ "string"
55393
+ ]
55394
+ }
55395
+ },
55396
+ propertyRequired: [
55397
+ "message"
55398
+ ]
55399
+ },
55400
+ entity: {
55401
+ types: [
55402
+ "string"
55403
+ ],
55404
+ description: "entity prop"
55405
+ },
55406
+ children: {
55407
+ types: [
55408
+ "node"
55409
+ ],
55410
+ description: "Compiled mode: render children directly instead of resolving from context"
55411
+ },
55412
+ pattern: {
55413
+ types: [
55414
+ "string"
55415
+ ],
55416
+ description: "Pattern type for data-pattern attribute (compiled mode)"
55417
+ },
55418
+ sourceTrait: {
55419
+ types: [
55420
+ "string"
55421
+ ],
55422
+ description: "Source trait name for data-source-trait attribute (compiled mode)"
55423
+ },
55424
+ fallback: {
55425
+ types: [
55426
+ "node"
55427
+ ],
55428
+ description: "Host-supplied stock content for a slot-host region (Studio V4 \xA714 Part I2). Ignored whenever `children` is passed \u2014 `children` (compiled mode) always wins, so a compiled organism's slot can never be silently shadowed by a host `fallback`. In `portal` mode `fallback` never portals: it paints inline at this component's own position in the tree, while slot content (if present) still portals as usual \u2014 a plugin filling `modal` doesn't relocate the host's inline empty-state."
55429
+ },
55430
+ mode: {
55431
+ types: [
55432
+ "string"
55433
+ ],
55434
+ description: "`'replace'` (default): slot content when present, else `fallback`. `'append'`: `fallback` first, then slot content when present \u2014 both render together, so `fallback` is a fixture, not just a placeholder.",
55435
+ enumValues: [
55436
+ "replace",
55437
+ "append"
55438
+ ],
55439
+ default: "replace"
55440
+ }
55441
+ }
55261
55442
  }
55262
55443
  },
55263
55444
  categories: [
@@ -58801,7 +58982,7 @@ var integrators_registry_default = {
58801
58982
  // src/patterns/component-mapping.json
58802
58983
  var component_mapping_default = {
58803
58984
  version: "1.0.0",
58804
- exportedAt: "2026-09-04T03:53:29.561Z",
58985
+ exportedAt: "2026-09-05T01:37:56.135Z",
58805
58986
  mappings: {
58806
58987
  "page-header": {
58807
58988
  component: "PageHeader",
@@ -60234,6 +60415,11 @@ var component_mapping_default = {
60234
60415
  component: "GameAudioCue",
60235
60416
  importPath: "@/components/game/atoms/GameAudioCue",
60236
60417
  category: "game"
60418
+ },
60419
+ "ui-slot-component": {
60420
+ component: "UISlotComponent",
60421
+ importPath: "@/components/core/organisms/UISlotRenderer",
60422
+ category: "layout"
60237
60423
  }
60238
60424
  }
60239
60425
  };
@@ -60241,7 +60427,7 @@ var component_mapping_default = {
60241
60427
  // src/patterns/event-contracts.json
60242
60428
  var event_contracts_default = {
60243
60429
  version: "1.0.0",
60244
- exportedAt: "2026-09-04T03:53:29.561Z",
60430
+ exportedAt: "2026-09-05T01:37:56.135Z",
60245
60431
  contracts: {
60246
60432
  form: {
60247
60433
  emits: [
@@ -61693,6 +61879,7 @@ var PATTERN_TYPES = [
61693
61879
  "trend-indicator",
61694
61880
  "typewriter-text",
61695
61881
  "typography",
61882
+ "ui-slot-component",
61696
61883
  "ui-slot-renderer",
61697
61884
  "upload-drop-zone",
61698
61885
  "version-diff",
@@ -65593,6 +65780,61 @@ function nestedPayload(path, leaf) {
65593
65780
  function isPayloadObject(v) {
65594
65781
  return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
65595
65782
  }
65783
+ var SYNTHESIZED_GUARD_OPERATORS = /* @__PURE__ */ new Set([
65784
+ "not-nil",
65785
+ "not_nil",
65786
+ "nil",
65787
+ "eq",
65788
+ "==",
65789
+ "=",
65790
+ "not-eq",
65791
+ "!=",
65792
+ "neq",
65793
+ "gt",
65794
+ ">",
65795
+ "gte",
65796
+ ">=",
65797
+ "lt",
65798
+ "<",
65799
+ "lte",
65800
+ "<=",
65801
+ "and",
65802
+ "or",
65803
+ "not",
65804
+ "object/has",
65805
+ "object/get",
65806
+ "array/includes",
65807
+ "str/startsWith",
65808
+ "agent/is-pinned",
65809
+ "agent/memory-strength"
65810
+ ]);
65811
+ var ACKNOWLEDGED_UNSYNTHESIZED_GUARD_OPERATORS = /* @__PURE__ */ new Set(["if", "let", "array/some", "grid/in-bounds"]);
65812
+ function isRecognizedGuardOperator(op) {
65813
+ return SYNTHESIZED_GUARD_OPERATORS.has(op) || ACKNOWLEDGED_UNSYNTHESIZED_GUARD_OPERATORS.has(op) || op.startsWith("agent/");
65814
+ }
65815
+ var unhandledGuardOperators = [];
65816
+ function recordUnhandledOperator(op) {
65817
+ if (unhandledGuardOperators.includes(op)) return;
65818
+ unhandledGuardOperators.push(op);
65819
+ console.warn(
65820
+ `[@almadar/core buildGuardPayloads] unrecognized guard operator "${op}" \u2014 synthesizing {pass:{}, fail:{}}; this guard arm cannot be walked pass/fail by verify. Add synthesis (or a tracked-gap entry) in guard-payloads.ts.`
65821
+ );
65822
+ }
65823
+ function splitPayloadArg(a, b) {
65824
+ const pathA = extractPayloadFieldPath(a);
65825
+ if (pathA) return { path: pathA, collection: b };
65826
+ const pathB = extractPayloadFieldPath(b);
65827
+ if (pathB) return { path: pathB, collection: a };
65828
+ return null;
65829
+ }
65830
+ function isPlainRecord(v) {
65831
+ return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
65832
+ }
65833
+ function absentKey(keys) {
65834
+ let candidate = `${keys.reduce((longest, k) => k.length > longest.length ? k : longest, "")}_`;
65835
+ while (keys.includes(candidate)) candidate += "_";
65836
+ return candidate;
65837
+ }
65596
65838
  function mergePayloads(a, b) {
65597
65839
  const out = { ...a };
65598
65840
  for (const [k, v] of Object.entries(b)) {
@@ -65601,6 +65843,91 @@ function mergePayloads(a, b) {
65601
65843
  }
65602
65844
  return out;
65603
65845
  }
65846
+ function extractObjectGetOperand(x) {
65847
+ if (!Array.isArray(x) || x[0] !== "object/get") return null;
65848
+ const split = splitPayloadArg(x[1], x[2]);
65849
+ if (split && isPlainRecord(split.collection)) {
65850
+ return { path: split.path, map: split.collection };
65851
+ }
65852
+ return null;
65853
+ }
65854
+ function resolveObjectGetComparison(a, b) {
65855
+ const getA = extractObjectGetOperand(a);
65856
+ if (getA) return { path: getA.path, map: getA.map, literal: b };
65857
+ const getB = extractObjectGetOperand(b);
65858
+ if (getB) return { path: getB.path, map: getB.map, literal: a };
65859
+ return null;
65860
+ }
65861
+ function buildObjectGetComparisonPayload(a, b, negate) {
65862
+ const resolved = resolveObjectGetComparison(a, b);
65863
+ if (!resolved) return null;
65864
+ const { path, map, literal } = resolved;
65865
+ const keys = Object.keys(map);
65866
+ const passKey = keys.find((k) => negate ? map[k] !== literal : map[k] === literal);
65867
+ const failKey = keys.find((k) => negate ? map[k] === literal : map[k] !== literal);
65868
+ return {
65869
+ pass: passKey !== void 0 ? nestedPayload(path, passKey) : {},
65870
+ fail: failKey !== void 0 ? nestedPayload(path, failKey) : nestedPayload(path, absentKey(keys))
65871
+ };
65872
+ }
65873
+ function guardPassCandidateSet(guard) {
65874
+ if (!Array.isArray(guard) || guard.length === 0) return null;
65875
+ const op = String(guard[0]);
65876
+ if (op === "object/has") {
65877
+ const split = splitPayloadArg(guard[1], guard[2]);
65878
+ if (split && isPlainRecord(split.collection)) {
65879
+ return { path: split.path, values: Object.keys(split.collection) };
65880
+ }
65881
+ return null;
65882
+ }
65883
+ if (op === "eq" || op === "==" || op === "=" || op === "not-eq" || op === "!=" || op === "neq") {
65884
+ const negate = op === "not-eq" || op === "!=" || op === "neq";
65885
+ const resolved = resolveObjectGetComparison(guard[1], guard[2]);
65886
+ if (resolved) {
65887
+ const values = Object.keys(resolved.map).filter(
65888
+ (k) => negate ? resolved.map[k] !== resolved.literal : resolved.map[k] === resolved.literal
65889
+ );
65890
+ return { path: resolved.path, values };
65891
+ }
65892
+ if (!negate) {
65893
+ const path = extractPayloadFieldPath(guard[1]);
65894
+ if (path && typeof guard[2] === "string") return { path, values: [guard[2]] };
65895
+ }
65896
+ return null;
65897
+ }
65898
+ return null;
65899
+ }
65900
+ function withoutField(payload, path) {
65901
+ const [head, ...tail] = path;
65902
+ if (tail.length === 0) {
65903
+ const rest = {};
65904
+ for (const k of Object.keys(payload)) {
65905
+ if (k !== head) rest[k] = payload[k];
65906
+ }
65907
+ return rest;
65908
+ }
65909
+ const nested = payload[head];
65910
+ if (!isPayloadObject(nested)) return payload;
65911
+ return { ...payload, [head]: withoutField(nested, tail) };
65912
+ }
65913
+ function applyFieldIntersections(subs, pass) {
65914
+ const byField = /* @__PURE__ */ new Map();
65915
+ for (const sub of subs) {
65916
+ const candidate = guardPassCandidateSet(sub);
65917
+ if (!candidate) continue;
65918
+ const key = JSON.stringify(candidate.path);
65919
+ const entry = byField.get(key);
65920
+ if (entry) entry.sets.push(candidate.values);
65921
+ else byField.set(key, { path: candidate.path, sets: [candidate.values] });
65922
+ }
65923
+ let out = pass;
65924
+ for (const { path, sets } of byField.values()) {
65925
+ if (sets.length < 2) continue;
65926
+ const intersection = sets.reduce((acc, set2) => acc.filter((v) => set2.includes(v)));
65927
+ out = intersection.length > 0 ? mergePayloads(out, nestedPayload(path, intersection[0])) : withoutField(out, path);
65928
+ }
65929
+ return out;
65930
+ }
65604
65931
  function constTruth(guard) {
65605
65932
  if (typeof guard === "boolean") return guard;
65606
65933
  if (typeof guard === "string") {
@@ -65663,6 +65990,8 @@ function buildGuardPayloads(guard) {
65663
65990
  const failVal = typeof val === "number" ? val + 1 : typeof val === "string" ? `not-${val}` : null;
65664
65991
  return { pass: nestedPayload(path, val), fail: nestedPayload(path, failVal) };
65665
65992
  }
65993
+ const objectGetPayload = buildObjectGetComparisonPayload(guard[1], guard[2], false);
65994
+ if (objectGetPayload) return objectGetPayload;
65666
65995
  }
65667
65996
  if (op === "not-eq" || op === "!=" || op === "neq") {
65668
65997
  const path = extractPayloadFieldPath(guard[1]);
@@ -65671,6 +66000,8 @@ function buildGuardPayloads(guard) {
65671
66000
  const passVal = typeof val === "number" ? val + 1 : typeof val === "string" ? `not-${val}` : "other";
65672
66001
  return { pass: nestedPayload(path, passVal), fail: nestedPayload(path, val) };
65673
66002
  }
66003
+ const objectGetPayload = buildObjectGetComparisonPayload(guard[1], guard[2], true);
66004
+ if (objectGetPayload) return objectGetPayload;
65674
66005
  }
65675
66006
  if (op === "gt" || op === ">") {
65676
66007
  const path = extractPayloadFieldPath(guard[1]);
@@ -65696,7 +66027,8 @@ function buildGuardPayloads(guard) {
65696
66027
  const subs = guard.slice(1);
65697
66028
  if (subs.length >= 2) {
65698
66029
  const built = subs.map(buildGuardPayloads);
65699
- const pass = built.reduce((acc, b) => mergePayloads(acc, b.pass), {});
66030
+ const merged = built.reduce((acc, b) => mergePayloads(acc, b.pass), {});
66031
+ const pass = applyFieldIntersections(subs, merged);
65700
66032
  return { pass, fail: built[0].fail };
65701
66033
  }
65702
66034
  if (subs.length === 1) return buildGuardPayloads(subs[0]);
@@ -65715,6 +66047,44 @@ function buildGuardPayloads(guard) {
65715
66047
  const inner = buildGuardPayloads(guard[1]);
65716
66048
  return { pass: inner.fail, fail: inner.pass };
65717
66049
  }
66050
+ if (op === "object/has") {
66051
+ const split = splitPayloadArg(guard[1], guard[2]);
66052
+ if (split && isPlainRecord(split.collection)) {
66053
+ const keys = Object.keys(split.collection);
66054
+ if (keys.length > 0) {
66055
+ return { pass: nestedPayload(split.path, keys[0]), fail: nestedPayload(split.path, absentKey(keys)) };
66056
+ }
66057
+ }
66058
+ }
66059
+ if (op === "object/get") {
66060
+ const split = splitPayloadArg(guard[1], guard[2]);
66061
+ if (split && isPlainRecord(split.collection)) {
66062
+ const map = split.collection;
66063
+ const keys = Object.keys(map);
66064
+ const passKey = keys.find((k) => Boolean(map[k]));
66065
+ if (passKey !== void 0) {
66066
+ return { pass: nestedPayload(split.path, passKey), fail: nestedPayload(split.path, absentKey(keys)) };
66067
+ }
66068
+ }
66069
+ }
66070
+ if (op === "array/includes") {
66071
+ const split = splitPayloadArg(guard[1], guard[2]);
66072
+ if (split && Array.isArray(split.collection) && split.collection.length > 0) {
66073
+ const passVal = split.collection[0];
66074
+ const failVal = typeof passVal === "string" ? `${passVal}-not-in-list` : "not-in-list";
66075
+ return { pass: nestedPayload(split.path, passVal), fail: nestedPayload(split.path, failVal) };
66076
+ }
66077
+ }
66078
+ if (op === "str/startsWith") {
66079
+ const path = extractPayloadFieldPath(guard[1]);
66080
+ const prefix = typeof guard[2] === "string" ? guard[2] : "";
66081
+ if (path) {
66082
+ return {
66083
+ pass: nestedPayload(path, `${prefix}mock-suffix`),
66084
+ fail: nestedPayload(path, prefix.length > 0 ? `not-${prefix}` : "mock-test-value")
66085
+ };
66086
+ }
66087
+ }
65718
66088
  if (op === "agent/is-pinned") {
65719
66089
  const field = extractPayloadFieldRef(guard[1]);
65720
66090
  if (field) return { pass: { [field]: "mem_test_unpinned" }, fail: { [field]: "mem_test_pinned" } };
@@ -65726,6 +66096,9 @@ function buildGuardPayloads(guard) {
65726
66096
  if (op.startsWith("agent/")) {
65727
66097
  return { pass: {}, fail: {} };
65728
66098
  }
66099
+ if (!isRecognizedGuardOperator(op)) {
66100
+ recordUnhandledOperator(op);
66101
+ }
65729
66102
  return { pass: {}, fail: {} };
65730
66103
  }
65731
66104