@almadar/core 10.82.0 → 10.84.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
@@ -2475,7 +2475,7 @@ function getInteractionModelForDomain(domain) {
2475
2475
  // src/patterns/patterns-registry.json
2476
2476
  var patterns_registry_default = {
2477
2477
  version: "1.0.0",
2478
- exportedAt: "2026-09-03T18:48:23.816Z",
2478
+ exportedAt: "2026-09-04T03:53:29.561Z",
2479
2479
  patterns: {
2480
2480
  "entity-table": {
2481
2481
  type: "entity-table",
@@ -18876,7 +18876,7 @@ var patterns_registry_default = {
18876
18876
  types: [
18877
18877
  "object"
18878
18878
  ],
18879
- description: "GAP-80: line-level error/warning highlights for editable mode. Map of 1-based line number \u2192 severity. The overlay paints a colored background on each line: error = red, warning = yellow. Pass undefined (default) to disable. The consumer is responsible for computing the path \u2192 line map from the schema + validation results.",
18879
+ description: "GAP-80: line-level error/warning highlights. Map of 1-based line number \u2192 severity. Paints a colored background on each line: error = red, warning = yellow. Honored by the editable overlay and (GAP-84) by viewer mode's non-diff highlight; pass undefined (default) to disable. The consumer is responsible for computing the path \u2192 line map from the schema + validation results.",
18880
18880
  nonAuthorable: true
18881
18881
  },
18882
18882
  title: {
@@ -19165,6 +19165,265 @@ var patterns_registry_default = {
19165
19165
  "boolean"
19166
19166
  ],
19167
19167
  description: "Show copy button (viewer alias for showCopyButton)"
19168
+ },
19169
+ editorId: {
19170
+ types: [
19171
+ "string"
19172
+ ],
19173
+ description: "Stable identity for the keyboard router / plugin host to target this editor. Unset = this instance never receives capability events.",
19174
+ tier: "presentation"
19175
+ },
19176
+ onEditorFocus: {
19177
+ types: [
19178
+ "string"
19179
+ ],
19180
+ description: "Declarative bus emit fired when this editor gains focus.",
19181
+ kind: "event-ref",
19182
+ emitPayloadSchema: [
19183
+ {
19184
+ name: "editorId",
19185
+ type: "string",
19186
+ required: true
19187
+ }
19188
+ ],
19189
+ default: "EDITOR_FOCUS",
19190
+ tier: "presentation"
19191
+ },
19192
+ onEditorBlur: {
19193
+ types: [
19194
+ "string"
19195
+ ],
19196
+ description: "Declarative bus emit fired when this editor loses focus.",
19197
+ kind: "event-ref",
19198
+ emitPayloadSchema: [
19199
+ {
19200
+ name: "editorId",
19201
+ type: "string",
19202
+ required: true
19203
+ }
19204
+ ],
19205
+ default: "EDITOR_BLUR",
19206
+ tier: "presentation"
19207
+ },
19208
+ onMotion: {
19209
+ types: [
19210
+ "string"
19211
+ ],
19212
+ description: "Declarative bus listen: move the cursor per the vim-style motion vocabulary.",
19213
+ kind: "event-listen",
19214
+ listenPayloadSchema: [
19215
+ {
19216
+ name: "editorId",
19217
+ type: "string",
19218
+ required: true
19219
+ },
19220
+ {
19221
+ name: "motion",
19222
+ type: "string",
19223
+ required: true,
19224
+ enumValues: [
19225
+ "left",
19226
+ "right",
19227
+ "up",
19228
+ "down",
19229
+ "word-forward",
19230
+ "word-back",
19231
+ "word-end",
19232
+ "line-start",
19233
+ "line-end",
19234
+ "first-nonblank",
19235
+ "doc-start",
19236
+ "doc-end",
19237
+ "paragraph-forward",
19238
+ "paragraph-back",
19239
+ "line",
19240
+ "selection"
19241
+ ]
19242
+ },
19243
+ {
19244
+ name: "count",
19245
+ type: "number",
19246
+ required: true
19247
+ }
19248
+ ],
19249
+ default: "MOTION",
19250
+ tier: "presentation"
19251
+ },
19252
+ onOperate: {
19253
+ types: [
19254
+ "string"
19255
+ ],
19256
+ description: "Declarative bus listen: apply a text operator over a motion's range.",
19257
+ kind: "event-listen",
19258
+ listenPayloadSchema: [
19259
+ {
19260
+ name: "editorId",
19261
+ type: "string",
19262
+ required: true
19263
+ },
19264
+ {
19265
+ name: "operator",
19266
+ type: "string",
19267
+ required: true,
19268
+ enumValues: [
19269
+ "delete",
19270
+ "yank",
19271
+ "change"
19272
+ ]
19273
+ },
19274
+ {
19275
+ name: "motion",
19276
+ type: "string",
19277
+ required: true,
19278
+ enumValues: [
19279
+ "left",
19280
+ "right",
19281
+ "up",
19282
+ "down",
19283
+ "word-forward",
19284
+ "word-back",
19285
+ "word-end",
19286
+ "line-start",
19287
+ "line-end",
19288
+ "first-nonblank",
19289
+ "doc-start",
19290
+ "doc-end",
19291
+ "paragraph-forward",
19292
+ "paragraph-back",
19293
+ "line",
19294
+ "selection"
19295
+ ]
19296
+ },
19297
+ {
19298
+ name: "count",
19299
+ type: "number",
19300
+ required: true
19301
+ }
19302
+ ],
19303
+ default: "OPERATE",
19304
+ tier: "presentation"
19305
+ },
19306
+ onInsertText: {
19307
+ types: [
19308
+ "string"
19309
+ ],
19310
+ description: "Declarative bus listen: insert literal text at the cursor.",
19311
+ kind: "event-listen",
19312
+ listenPayloadSchema: [
19313
+ {
19314
+ name: "editorId",
19315
+ type: "string",
19316
+ required: true
19317
+ },
19318
+ {
19319
+ name: "text",
19320
+ type: "string",
19321
+ required: true
19322
+ }
19323
+ ],
19324
+ default: "INSERT_TEXT",
19325
+ tier: "presentation"
19326
+ },
19327
+ onSetMode: {
19328
+ types: [
19329
+ "string"
19330
+ ],
19331
+ description: "Declarative bus listen: switch editor mode and caret style.",
19332
+ kind: "event-listen",
19333
+ listenPayloadSchema: [
19334
+ {
19335
+ name: "editorId",
19336
+ type: "string",
19337
+ required: true
19338
+ },
19339
+ {
19340
+ name: "mode",
19341
+ type: "string",
19342
+ required: true
19343
+ },
19344
+ {
19345
+ name: "caret",
19346
+ type: "string",
19347
+ required: true,
19348
+ enumValues: [
19349
+ "bar",
19350
+ "block",
19351
+ "underline"
19352
+ ]
19353
+ }
19354
+ ],
19355
+ default: "SET_MODE",
19356
+ tier: "presentation"
19357
+ },
19358
+ motions: {
19359
+ types: [
19360
+ "array"
19361
+ ],
19362
+ description: "Motion vocabulary this editor accepts. Default: the full `EditorMotion` set.",
19363
+ items: {
19364
+ types: [
19365
+ "string"
19366
+ ],
19367
+ enumValues: [
19368
+ "left",
19369
+ "right",
19370
+ "up",
19371
+ "down",
19372
+ "word-forward",
19373
+ "word-back",
19374
+ "word-end",
19375
+ "line-start",
19376
+ "line-end",
19377
+ "first-nonblank",
19378
+ "doc-start",
19379
+ "doc-end",
19380
+ "paragraph-forward",
19381
+ "paragraph-back",
19382
+ "line",
19383
+ "selection"
19384
+ ]
19385
+ },
19386
+ default: [
19387
+ "left",
19388
+ "right",
19389
+ "up",
19390
+ "down",
19391
+ "word-forward",
19392
+ "word-back",
19393
+ "word-end",
19394
+ "line-start",
19395
+ "line-end",
19396
+ "first-nonblank",
19397
+ "doc-start",
19398
+ "doc-end",
19399
+ "paragraph-forward",
19400
+ "paragraph-back",
19401
+ "line",
19402
+ "selection"
19403
+ ],
19404
+ tier: "presentation"
19405
+ },
19406
+ operators: {
19407
+ types: [
19408
+ "array"
19409
+ ],
19410
+ description: "Operator vocabulary this editor accepts. Default: the full `EditorOperator` set.",
19411
+ items: {
19412
+ types: [
19413
+ "string"
19414
+ ],
19415
+ enumValues: [
19416
+ "delete",
19417
+ "yank",
19418
+ "change"
19419
+ ]
19420
+ },
19421
+ default: [
19422
+ "delete",
19423
+ "yank",
19424
+ "change"
19425
+ ],
19426
+ tier: "presentation"
19168
19427
  }
19169
19428
  }
19170
19429
  },
@@ -29227,7 +29486,12 @@ var patterns_registry_default = {
29227
29486
  {
29228
29487
  name: "next",
29229
29488
  type: "string",
29230
- required: true
29489
+ required: true,
29490
+ enumValues: [
29491
+ "up",
29492
+ "down",
29493
+ "none"
29494
+ ]
29231
29495
  }
29232
29496
  ]
29233
29497
  },
@@ -29695,7 +29959,12 @@ var patterns_registry_default = {
29695
29959
  {
29696
29960
  name: "vote",
29697
29961
  type: "string",
29698
- required: true
29962
+ required: true,
29963
+ enumValues: [
29964
+ "up",
29965
+ "down",
29966
+ "none"
29967
+ ]
29699
29968
  }
29700
29969
  ]
29701
29970
  },
@@ -38769,7 +39038,11 @@ var patterns_registry_default = {
38769
39038
  {
38770
39039
  name: "direction",
38771
39040
  type: "string",
38772
- required: true
39041
+ required: true,
39042
+ enumValues: [
39043
+ "asc",
39044
+ "desc"
39045
+ ]
38773
39046
  }
38774
39047
  ]
38775
39048
  },
@@ -40733,7 +41006,13 @@ var patterns_registry_default = {
40733
41006
  {
40734
41007
  name: "direction",
40735
41008
  type: "string",
40736
- required: true
41009
+ required: true,
41010
+ enumValues: [
41011
+ "up",
41012
+ "down",
41013
+ "left",
41014
+ "right"
41015
+ ]
40737
41016
  },
40738
41017
  {
40739
41018
  name: "pressed",
@@ -41764,6 +42043,7 @@ var patterns_registry_default = {
41764
42043
  "string"
41765
42044
  ],
41766
42045
  enumValues: [
42046
+ "solid",
41767
42047
  "dashed",
41768
42048
  "dotted"
41769
42049
  ]
@@ -43141,6 +43421,7 @@ var patterns_registry_default = {
43141
43421
  "string"
43142
43422
  ],
43143
43423
  enumValues: [
43424
+ "solid",
43144
43425
  "dashed",
43145
43426
  "dotted"
43146
43427
  ]
@@ -44421,6 +44702,7 @@ var patterns_registry_default = {
44421
44702
  "string"
44422
44703
  ],
44423
44704
  enumValues: [
44705
+ "solid",
44424
44706
  "dashed",
44425
44707
  "dotted"
44426
44708
  ]
@@ -44892,6 +45174,7 @@ var patterns_registry_default = {
44892
45174
  "string"
44893
45175
  ],
44894
45176
  enumValues: [
45177
+ "solid",
44895
45178
  "dashed",
44896
45179
  "dotted"
44897
45180
  ]
@@ -45177,6 +45460,7 @@ var patterns_registry_default = {
45177
45460
  "string"
45178
45461
  ],
45179
45462
  enumValues: [
45463
+ "solid",
45180
45464
  "dashed",
45181
45465
  "dotted"
45182
45466
  ]
@@ -45485,6 +45769,7 @@ var patterns_registry_default = {
45485
45769
  "string"
45486
45770
  ],
45487
45771
  enumValues: [
45772
+ "solid",
45488
45773
  "dashed",
45489
45774
  "dotted"
45490
45775
  ]
@@ -47025,6 +47310,7 @@ var patterns_registry_default = {
47025
47310
  "string"
47026
47311
  ],
47027
47312
  enumValues: [
47313
+ "solid",
47028
47314
  "dashed",
47029
47315
  "dotted"
47030
47316
  ]
@@ -48239,6 +48525,7 @@ var patterns_registry_default = {
48239
48525
  "string"
48240
48526
  ],
48241
48527
  enumValues: [
48528
+ "solid",
48242
48529
  "dashed",
48243
48530
  "dotted"
48244
48531
  ]
@@ -53138,6 +53425,7 @@ var patterns_registry_default = {
53138
53425
  "string"
53139
53426
  ],
53140
53427
  enumValues: [
53428
+ "solid",
53141
53429
  "dashed",
53142
53430
  "dotted"
53143
53431
  ]
@@ -58513,7 +58801,7 @@ var integrators_registry_default = {
58513
58801
  // src/patterns/component-mapping.json
58514
58802
  var component_mapping_default = {
58515
58803
  version: "1.0.0",
58516
- exportedAt: "2026-09-03T18:48:23.816Z",
58804
+ exportedAt: "2026-09-04T03:53:29.561Z",
58517
58805
  mappings: {
58518
58806
  "page-header": {
58519
58807
  component: "PageHeader",
@@ -59953,7 +60241,7 @@ var component_mapping_default = {
59953
60241
  // src/patterns/event-contracts.json
59954
60242
  var event_contracts_default = {
59955
60243
  version: "1.0.0",
59956
- exportedAt: "2026-09-03T18:48:23.816Z",
60244
+ exportedAt: "2026-09-04T03:53:29.561Z",
59957
60245
  contracts: {
59958
60246
  form: {
59959
60247
  emits: [
@@ -60863,6 +61151,20 @@ var event_contracts_default = {
60863
61151
  payload: {
60864
61152
  type: "object"
60865
61153
  }
61154
+ },
61155
+ {
61156
+ event: "EDITOR_FOCUS",
61157
+ trigger: "action",
61158
+ payload: {
61159
+ type: "object"
61160
+ }
61161
+ },
61162
+ {
61163
+ event: "EDITOR_BLUR",
61164
+ trigger: "action",
61165
+ payload: {
61166
+ type: "object"
61167
+ }
60866
61168
  }
60867
61169
  ],
60868
61170
  requires: [],
@@ -65291,6 +65593,61 @@ function nestedPayload(path, leaf) {
65291
65593
  function isPayloadObject(v) {
65292
65594
  return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
65293
65595
  }
65596
+ var SYNTHESIZED_GUARD_OPERATORS = /* @__PURE__ */ new Set([
65597
+ "not-nil",
65598
+ "not_nil",
65599
+ "nil",
65600
+ "eq",
65601
+ "==",
65602
+ "=",
65603
+ "not-eq",
65604
+ "!=",
65605
+ "neq",
65606
+ "gt",
65607
+ ">",
65608
+ "gte",
65609
+ ">=",
65610
+ "lt",
65611
+ "<",
65612
+ "lte",
65613
+ "<=",
65614
+ "and",
65615
+ "or",
65616
+ "not",
65617
+ "object/has",
65618
+ "object/get",
65619
+ "array/includes",
65620
+ "str/startsWith",
65621
+ "agent/is-pinned",
65622
+ "agent/memory-strength"
65623
+ ]);
65624
+ var ACKNOWLEDGED_UNSYNTHESIZED_GUARD_OPERATORS = /* @__PURE__ */ new Set(["if", "let", "array/some", "grid/in-bounds"]);
65625
+ function isRecognizedGuardOperator(op) {
65626
+ return SYNTHESIZED_GUARD_OPERATORS.has(op) || ACKNOWLEDGED_UNSYNTHESIZED_GUARD_OPERATORS.has(op) || op.startsWith("agent/");
65627
+ }
65628
+ var unhandledGuardOperators = [];
65629
+ function recordUnhandledOperator(op) {
65630
+ if (unhandledGuardOperators.includes(op)) return;
65631
+ unhandledGuardOperators.push(op);
65632
+ console.warn(
65633
+ `[@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.`
65634
+ );
65635
+ }
65636
+ function splitPayloadArg(a, b) {
65637
+ const pathA = extractPayloadFieldPath(a);
65638
+ if (pathA) return { path: pathA, collection: b };
65639
+ const pathB = extractPayloadFieldPath(b);
65640
+ if (pathB) return { path: pathB, collection: a };
65641
+ return null;
65642
+ }
65643
+ function isPlainRecord(v) {
65644
+ return typeof v === "object" && v !== null && !Array.isArray(v) && !(v instanceof Date);
65645
+ }
65646
+ function absentKey(keys) {
65647
+ let candidate = `${keys.reduce((longest, k) => k.length > longest.length ? k : longest, "")}_`;
65648
+ while (keys.includes(candidate)) candidate += "_";
65649
+ return candidate;
65650
+ }
65294
65651
  function mergePayloads(a, b) {
65295
65652
  const out = { ...a };
65296
65653
  for (const [k, v] of Object.entries(b)) {
@@ -65413,6 +65770,44 @@ function buildGuardPayloads(guard) {
65413
65770
  const inner = buildGuardPayloads(guard[1]);
65414
65771
  return { pass: inner.fail, fail: inner.pass };
65415
65772
  }
65773
+ if (op === "object/has") {
65774
+ const split = splitPayloadArg(guard[1], guard[2]);
65775
+ if (split && isPlainRecord(split.collection)) {
65776
+ const keys = Object.keys(split.collection);
65777
+ if (keys.length > 0) {
65778
+ return { pass: nestedPayload(split.path, keys[0]), fail: nestedPayload(split.path, absentKey(keys)) };
65779
+ }
65780
+ }
65781
+ }
65782
+ if (op === "object/get") {
65783
+ const split = splitPayloadArg(guard[1], guard[2]);
65784
+ if (split && isPlainRecord(split.collection)) {
65785
+ const map = split.collection;
65786
+ const keys = Object.keys(map);
65787
+ const passKey = keys.find((k) => Boolean(map[k]));
65788
+ if (passKey !== void 0) {
65789
+ return { pass: nestedPayload(split.path, passKey), fail: nestedPayload(split.path, absentKey(keys)) };
65790
+ }
65791
+ }
65792
+ }
65793
+ if (op === "array/includes") {
65794
+ const split = splitPayloadArg(guard[1], guard[2]);
65795
+ if (split && Array.isArray(split.collection) && split.collection.length > 0) {
65796
+ const passVal = split.collection[0];
65797
+ const failVal = typeof passVal === "string" ? `${passVal}-not-in-list` : "not-in-list";
65798
+ return { pass: nestedPayload(split.path, passVal), fail: nestedPayload(split.path, failVal) };
65799
+ }
65800
+ }
65801
+ if (op === "str/startsWith") {
65802
+ const path = extractPayloadFieldPath(guard[1]);
65803
+ const prefix = typeof guard[2] === "string" ? guard[2] : "";
65804
+ if (path) {
65805
+ return {
65806
+ pass: nestedPayload(path, `${prefix}mock-suffix`),
65807
+ fail: nestedPayload(path, prefix.length > 0 ? `not-${prefix}` : "mock-test-value")
65808
+ };
65809
+ }
65810
+ }
65416
65811
  if (op === "agent/is-pinned") {
65417
65812
  const field = extractPayloadFieldRef(guard[1]);
65418
65813
  if (field) return { pass: { [field]: "mem_test_unpinned" }, fail: { [field]: "mem_test_pinned" } };
@@ -65424,6 +65819,9 @@ function buildGuardPayloads(guard) {
65424
65819
  if (op.startsWith("agent/")) {
65425
65820
  return { pass: {}, fail: {} };
65426
65821
  }
65822
+ if (!isRecognizedGuardOperator(op)) {
65823
+ recordUnhandledOperator(op);
65824
+ }
65427
65825
  return { pass: {}, fail: {} };
65428
65826
  }
65429
65827