@nonoun/native-ai 1.0.21 → 1.0.23

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 (144) hide show
  1. package/dist/a2ui/a2ui-diagnostics.d.ts +31 -0
  2. package/dist/a2ui/a2ui-diagnostics.d.ts.map +1 -0
  3. package/dist/a2ui/a2ui-element.d.ts +30 -0
  4. package/dist/a2ui/a2ui-element.d.ts.map +1 -0
  5. package/dist/a2ui/a2ui-presets.d.ts +22 -0
  6. package/dist/a2ui/a2ui-presets.d.ts.map +1 -0
  7. package/dist/a2ui/adapters/a2a-adapter.d.ts +38 -0
  8. package/dist/a2ui/adapters/a2a-adapter.d.ts.map +1 -0
  9. package/dist/a2ui/adapters/adapter-types.d.ts +19 -0
  10. package/dist/a2ui/adapters/adapter-types.d.ts.map +1 -0
  11. package/dist/a2ui/adapters/ag-ui-adapter.d.ts +42 -0
  12. package/dist/a2ui/adapters/ag-ui-adapter.d.ts.map +1 -0
  13. package/dist/a2ui/adapters/direct-adapter.d.ts +30 -0
  14. package/dist/a2ui/adapters/direct-adapter.d.ts.map +1 -0
  15. package/dist/a2ui/adapters/index.d.ts +8 -0
  16. package/dist/a2ui/adapters/index.d.ts.map +1 -0
  17. package/dist/a2ui/index.d.ts +15 -0
  18. package/dist/a2ui/index.d.ts.map +1 -0
  19. package/dist/a2ui/install.d.ts +23 -0
  20. package/dist/a2ui/install.d.ts.map +1 -0
  21. package/dist/a2ui/protocol/a2ui-adapter.d.ts +52 -0
  22. package/dist/a2ui/protocol/a2ui-adapter.d.ts.map +1 -0
  23. package/dist/a2ui/protocol/a2ui-component-map.d.ts +98 -0
  24. package/dist/a2ui/protocol/a2ui-component-map.d.ts.map +1 -0
  25. package/dist/a2ui/protocol/a2ui-composition-map.d.ts +101 -0
  26. package/dist/a2ui/protocol/a2ui-composition-map.d.ts.map +1 -0
  27. package/dist/a2ui/protocol/a2ui-converter.d.ts +37 -0
  28. package/dist/a2ui/protocol/a2ui-converter.d.ts.map +1 -0
  29. package/dist/a2ui/protocol/a2ui-surface.d.ts +34 -0
  30. package/dist/a2ui/protocol/a2ui-surface.d.ts.map +1 -0
  31. package/dist/a2ui/protocol/a2ui-transport.d.ts +80 -0
  32. package/dist/a2ui/protocol/a2ui-transport.d.ts.map +1 -0
  33. package/dist/a2ui/protocol/a2ui-types.d.ts +104 -0
  34. package/dist/a2ui/protocol/a2ui-types.d.ts.map +1 -0
  35. package/dist/a2ui/protocol/index.d.ts +15 -0
  36. package/dist/a2ui/protocol/index.d.ts.map +1 -0
  37. package/dist/a2ui/protocol/kernel-bridge.d.ts +114 -0
  38. package/dist/a2ui/protocol/kernel-bridge.d.ts.map +1 -0
  39. package/dist/a2ui/register.d.ts +12 -0
  40. package/dist/a2ui/register.d.ts.map +1 -0
  41. package/dist/a2ui/session/agent-session.d.ts +44 -0
  42. package/dist/a2ui/session/agent-session.d.ts.map +1 -0
  43. package/dist/a2ui/session/catalog.d.ts +41 -0
  44. package/dist/a2ui/session/catalog.d.ts.map +1 -0
  45. package/dist/a2ui/session/event-emitter.d.ts +17 -0
  46. package/dist/a2ui/session/event-emitter.d.ts.map +1 -0
  47. package/dist/a2ui/session/index.d.ts +9 -0
  48. package/dist/a2ui/session/index.d.ts.map +1 -0
  49. package/dist/a2ui/session/session-manager.d.ts +33 -0
  50. package/dist/a2ui/session/session-manager.d.ts.map +1 -0
  51. package/dist/a2ui/session/surface-registry.d.ts +32 -0
  52. package/dist/a2ui/session/surface-registry.d.ts.map +1 -0
  53. package/dist/a2ui/session/types.d.ts +27 -0
  54. package/dist/a2ui/session/types.d.ts.map +1 -0
  55. package/dist/chat/avatar/chat-avatar-element.d.ts +18 -0
  56. package/dist/chat/avatar/chat-avatar-element.d.ts.map +1 -0
  57. package/dist/chat/avatar/index.d.ts +2 -0
  58. package/dist/chat/avatar/index.d.ts.map +1 -0
  59. package/dist/chat/avatar/n-chat-avatar.d.ts +2 -0
  60. package/dist/chat/avatar/n-chat-avatar.d.ts.map +1 -0
  61. package/dist/chat/chat-input-element.d.ts +35 -0
  62. package/dist/chat/chat-input-element.d.ts.map +1 -0
  63. package/dist/chat/chat-panel-element.d.ts +100 -0
  64. package/dist/chat/chat-panel-element.d.ts.map +1 -0
  65. package/dist/chat/feed/chat-feed-element.d.ts +48 -0
  66. package/dist/chat/feed/chat-feed-element.d.ts.map +1 -0
  67. package/dist/chat/feed/index.d.ts +2 -0
  68. package/dist/chat/feed/index.d.ts.map +1 -0
  69. package/dist/chat/feed/n-chat-feed.d.ts +2 -0
  70. package/dist/chat/feed/n-chat-feed.d.ts.map +1 -0
  71. package/dist/chat/gateway/adapter-chatgpt.d.ts +67 -0
  72. package/dist/chat/gateway/adapter-chatgpt.d.ts.map +1 -0
  73. package/dist/chat/gateway/adapter-claude.d.ts +68 -0
  74. package/dist/chat/gateway/adapter-claude.d.ts.map +1 -0
  75. package/dist/chat/gateway/adapter-mock.d.ts +3 -0
  76. package/dist/chat/gateway/adapter-mock.d.ts.map +1 -0
  77. package/dist/chat/gateway/adapter.d.ts +71 -0
  78. package/dist/chat/gateway/adapter.d.ts.map +1 -0
  79. package/dist/chat/gateway/controller.d.ts +46 -0
  80. package/dist/chat/gateway/controller.d.ts.map +1 -0
  81. package/dist/chat/gateway/index.d.ts +9 -0
  82. package/dist/chat/gateway/index.d.ts.map +1 -0
  83. package/dist/chat/gateway/runtime.d.ts +53 -0
  84. package/dist/chat/gateway/runtime.d.ts.map +1 -0
  85. package/dist/chat/gateway/types.d.ts +73 -0
  86. package/dist/chat/gateway/types.d.ts.map +1 -0
  87. package/dist/chat/gateway.d.ts +2 -0
  88. package/dist/chat/gateway.d.ts.map +1 -0
  89. package/dist/chat/index.d.ts +17 -0
  90. package/dist/chat/index.d.ts.map +1 -0
  91. package/dist/chat/message/chat-input-structured-element.d.ts +43 -0
  92. package/dist/chat/message/chat-input-structured-element.d.ts.map +1 -0
  93. package/dist/chat/message/chat-message-activity-element.d.ts +32 -0
  94. package/dist/chat/message/chat-message-activity-element.d.ts.map +1 -0
  95. package/dist/chat/message/chat-message-element.d.ts +44 -0
  96. package/dist/chat/message/chat-message-element.d.ts.map +1 -0
  97. package/dist/chat/message/chat-message-genui-element.d.ts +45 -0
  98. package/dist/chat/message/chat-message-genui-element.d.ts.map +1 -0
  99. package/dist/chat/message/chat-message-seed-element.d.ts +33 -0
  100. package/dist/chat/message/chat-message-seed-element.d.ts.map +1 -0
  101. package/dist/chat/message/chat-message-text-element.d.ts +37 -0
  102. package/dist/chat/message/chat-message-text-element.d.ts.map +1 -0
  103. package/dist/chat/message/chat-messages-element.d.ts +39 -0
  104. package/dist/chat/message/chat-messages-element.d.ts.map +1 -0
  105. package/dist/chat/message/index.d.ts +8 -0
  106. package/dist/chat/message/index.d.ts.map +1 -0
  107. package/dist/chat/message/n-chat-message.d.ts +2 -0
  108. package/dist/chat/message/n-chat-message.d.ts.map +1 -0
  109. package/dist/chat/register.d.ts +13 -0
  110. package/dist/chat/register.d.ts.map +1 -0
  111. package/dist/chat/stream/classify.d.ts +19 -0
  112. package/dist/chat/stream/classify.d.ts.map +1 -0
  113. package/dist/chat/stream/create-transport.d.ts +19 -0
  114. package/dist/chat/stream/create-transport.d.ts.map +1 -0
  115. package/dist/chat/stream/index.d.ts +9 -0
  116. package/dist/chat/stream/index.d.ts.map +1 -0
  117. package/dist/chat/stream/parse-json.d.ts +9 -0
  118. package/dist/chat/stream/parse-json.d.ts.map +1 -0
  119. package/dist/chat/stream/parse-ndjson.d.ts +9 -0
  120. package/dist/chat/stream/parse-ndjson.d.ts.map +1 -0
  121. package/dist/chat/stream/parse-sse.d.ts +9 -0
  122. package/dist/chat/stream/parse-sse.d.ts.map +1 -0
  123. package/dist/chat/stream/types.d.ts +42 -0
  124. package/dist/chat/stream/types.d.ts.map +1 -0
  125. package/dist/chat/telemetry/emitter.d.ts +20 -0
  126. package/dist/chat/telemetry/emitter.d.ts.map +1 -0
  127. package/dist/chat/telemetry/events.d.ts +11 -0
  128. package/dist/chat/telemetry/events.d.ts.map +1 -0
  129. package/dist/chat/telemetry/index.d.ts +5 -0
  130. package/dist/chat/telemetry/index.d.ts.map +1 -0
  131. package/dist/chat/telemetry/redactor.d.ts +17 -0
  132. package/dist/chat/telemetry/redactor.d.ts.map +1 -0
  133. package/dist/chat/telemetry/types.d.ts +27 -0
  134. package/dist/chat/telemetry/types.d.ts.map +1 -0
  135. package/dist/gateway.d.ts +2 -0
  136. package/dist/gateway.d.ts.map +1 -0
  137. package/dist/index.d.ts +5 -0
  138. package/dist/index.d.ts.map +1 -0
  139. package/dist/native-ai.css +1567 -0
  140. package/dist/native-ai.js +252 -202
  141. package/dist/register.d.ts +12 -0
  142. package/dist/register.d.ts.map +1 -0
  143. package/dist/register.js +246 -196
  144. package/package.json +1 -1
package/dist/native-ai.js CHANGED
@@ -20,10 +20,10 @@ function T(e) {
20
20
  function E(e) {
21
21
  return "deleteSurface" in e;
22
22
  }
23
- function D(e) {
23
+ function ee(e) {
24
24
  return "requestCatalog" in e;
25
25
  }
26
- function ee(e) {
26
+ function D(e) {
27
27
  return "action" in e;
28
28
  }
29
29
  function te(e) {
@@ -157,8 +157,34 @@ var k = class e {
157
157
  this.#t.clear();
158
158
  for (let e of this.#e.values()) e.nativeTag !== "div" && e.nativeTag !== "span" && !this.#t.has(e.nativeTag) && this.#t.set(e.nativeTag, e);
159
159
  }
160
- };
161
- const A = new k([
160
+ }, A = [
161
+ {
162
+ attr: "intent",
163
+ type: "'neutral' | 'accent' | 'info' | 'success' | 'warning' | 'danger'",
164
+ note: "Color intent — drives background, border, and text color tokens"
165
+ },
166
+ {
167
+ attr: "variant",
168
+ type: "'default' | 'primary' | 'secondary' | 'ghost' | 'outline'",
169
+ note: "Visual weight — primary=filled, ghost=transparent, outline=bordered"
170
+ },
171
+ {
172
+ attr: "size",
173
+ type: "'xs' | 'sm' | 'md' | 'lg' | 'xl'",
174
+ note: "Component scale — affects height, padding, font-size, icon-size"
175
+ },
176
+ {
177
+ attr: "radius",
178
+ type: "'none' | 'sm' | 'md' | 'lg' | 'full'",
179
+ note: "Border radius override"
180
+ },
181
+ {
182
+ attr: "density",
183
+ type: "'compact' | 'inline'",
184
+ note: "compact=reduced padding, inline=minimal height"
185
+ }
186
+ ];
187
+ const j = new k([
162
188
  {
163
189
  a2uiType: "Text",
164
190
  nativeTag: "span",
@@ -190,15 +216,19 @@ const A = new k([
190
216
  event: "native:press",
191
217
  description: "Fires on click or keyboard activation (Enter/Space)."
192
218
  }],
193
- properties: [{
194
- attr: "disabled",
195
- type: "boolean",
196
- reactive: !0
197
- }, {
198
- attr: "type",
199
- type: "'button' | 'submit' | 'reset'",
200
- reactive: !0
201
- }],
219
+ properties: [
220
+ ...A,
221
+ {
222
+ attr: "disabled",
223
+ type: "boolean",
224
+ reactive: !0
225
+ },
226
+ {
227
+ attr: "type",
228
+ type: "'button' | 'submit' | 'reset'",
229
+ reactive: !0
230
+ }
231
+ ],
202
232
  methods: []
203
233
  },
204
234
  {
@@ -232,6 +262,7 @@ const A = new k([
232
262
  }
233
263
  ],
234
264
  properties: [
265
+ ...A,
235
266
  {
236
267
  attr: "value",
237
268
  type: "string",
@@ -318,6 +349,7 @@ const A = new k([
318
349
  }
319
350
  ],
320
351
  properties: [
352
+ ...A,
321
353
  {
322
354
  attr: "value",
323
355
  type: "string",
@@ -389,6 +421,7 @@ const A = new k([
389
421
  description: "Fires when checked state toggles."
390
422
  }],
391
423
  properties: [
424
+ ...A,
392
425
  {
393
426
  attr: "checked",
394
427
  type: "boolean",
@@ -436,6 +469,7 @@ const A = new k([
436
469
  description: "Fires when toggled on/off."
437
470
  }],
438
471
  properties: [
472
+ ...A,
439
473
  {
440
474
  attr: "checked",
441
475
  type: "boolean",
@@ -480,6 +514,7 @@ const A = new k([
480
514
  description: "Fires when selection changes."
481
515
  }],
482
516
  properties: [
517
+ ...A,
483
518
  {
484
519
  attr: "value",
485
520
  type: "string",
@@ -534,6 +569,7 @@ const A = new k([
534
569
  description: "Fires when slider value changes."
535
570
  }],
536
571
  properties: [
572
+ ...A,
537
573
  {
538
574
  attr: "value",
539
575
  type: "number",
@@ -576,6 +612,7 @@ const A = new k([
576
612
  description: "Fires when date/time value changes."
577
613
  }],
578
614
  properties: [
615
+ ...A,
579
616
  {
580
617
  attr: "value",
581
618
  type: "string",
@@ -678,13 +715,17 @@ const A = new k([
678
715
  event: "close",
679
716
  description: "Fires when the dialog is closed."
680
717
  }],
681
- properties: [{
682
- attr: "no-close-on-escape",
683
- type: "boolean"
684
- }, {
685
- attr: "no-close-on-backdrop",
686
- type: "boolean"
687
- }],
718
+ properties: [
719
+ ...A,
720
+ {
721
+ attr: "no-close-on-escape",
722
+ type: "boolean"
723
+ },
724
+ {
725
+ attr: "no-close-on-backdrop",
726
+ type: "boolean"
727
+ }
728
+ ],
688
729
  methods: [{
689
730
  name: "showModal",
690
731
  returns: "void",
@@ -708,6 +749,7 @@ const A = new k([
708
749
  description: "Fires when the active tab changes."
709
750
  }],
710
751
  properties: [
752
+ ...A,
711
753
  {
712
754
  attr: "value",
713
755
  type: "string",
@@ -740,6 +782,7 @@ const A = new k([
740
782
  description: "Fires when the selected option changes."
741
783
  }],
742
784
  properties: [
785
+ ...A,
743
786
  {
744
787
  attr: "disabled",
745
788
  type: "boolean",
@@ -881,6 +924,7 @@ const A = new k([
881
924
  description: "Fires when selection changes."
882
925
  }],
883
926
  properties: [
927
+ ...A,
884
928
  {
885
929
  attr: "value",
886
930
  type: "string",
@@ -953,15 +997,19 @@ const A = new k([
953
997
  nativeTag: "n-accordion",
954
998
  childStrategy: "children",
955
999
  events: [],
956
- properties: [{
957
- attr: "multiple",
958
- type: "boolean",
959
- reactive: !0
960
- }, {
961
- attr: "disabled",
962
- type: "boolean",
963
- reactive: !0
964
- }],
1000
+ properties: [
1001
+ ...A,
1002
+ {
1003
+ attr: "multiple",
1004
+ type: "boolean",
1005
+ reactive: !0
1006
+ },
1007
+ {
1008
+ attr: "disabled",
1009
+ type: "boolean",
1010
+ reactive: !0
1011
+ }
1012
+ ],
965
1013
  methods: []
966
1014
  },
967
1015
  {
@@ -1021,6 +1069,7 @@ const A = new k([
1021
1069
  }
1022
1070
  ],
1023
1071
  properties: [
1072
+ ...A,
1024
1073
  {
1025
1074
  attr: "selectable",
1026
1075
  type: "boolean",
@@ -1056,14 +1105,18 @@ const A = new k([
1056
1105
  max: "max"
1057
1106
  },
1058
1107
  events: [],
1059
- properties: [{
1060
- attr: "value",
1061
- type: "number",
1062
- reactive: !0
1063
- }, {
1064
- attr: "max",
1065
- type: "number"
1066
- }],
1108
+ properties: [
1109
+ ...A,
1110
+ {
1111
+ attr: "value",
1112
+ type: "number",
1113
+ reactive: !0
1114
+ },
1115
+ {
1116
+ attr: "max",
1117
+ type: "number"
1118
+ }
1119
+ ],
1067
1120
  methods: []
1068
1121
  },
1069
1122
  {
@@ -1083,6 +1136,7 @@ const A = new k([
1083
1136
  description: "Fires when the toast dismiss button is clicked."
1084
1137
  }],
1085
1138
  properties: [
1139
+ ...A,
1086
1140
  {
1087
1141
  attr: "message",
1088
1142
  type: "string"
@@ -1090,10 +1144,6 @@ const A = new k([
1090
1144
  {
1091
1145
  attr: "dismissible",
1092
1146
  type: "boolean"
1093
- },
1094
- {
1095
- attr: "intent",
1096
- type: "'info' | 'success' | 'warning' | 'danger'"
1097
1147
  }
1098
1148
  ],
1099
1149
  methods: []
@@ -1132,21 +1182,21 @@ const A = new k([
1132
1182
  AudioPlayer: "media",
1133
1183
  Table: "data",
1134
1184
  Toast: "feedback"
1135
- }), re = A;
1136
- function j(e) {
1137
- return A.resolveNativeTag(e);
1185
+ }), re = j;
1186
+ function M(e) {
1187
+ return j.resolveNativeTag(e);
1138
1188
  }
1139
- function M(e, t) {
1140
- return A.resolveA2UIType(e, t);
1189
+ function N(e, t) {
1190
+ return j.resolveA2UIType(e, t);
1141
1191
  }
1142
- function N() {
1143
- return A.getSupportedTypes();
1192
+ function P() {
1193
+ return j.getSupportedTypes();
1144
1194
  }
1145
1195
  function ie(e) {
1146
- return A.getComponentCategory(e);
1196
+ return j.getComponentCategory(e);
1147
1197
  }
1148
1198
  function ae(e) {
1149
- return A.getCompatibleTypes(e);
1199
+ return j.getCompatibleTypes(e);
1150
1200
  }
1151
1201
  var oe = {
1152
1202
  h1: "h1",
@@ -1194,7 +1244,7 @@ var de = new Set(/* @__PURE__ */ "id.component.children.child.text.label.variant
1194
1244
  "Body",
1195
1245
  "Footer"
1196
1246
  ]);
1197
- function P(e, t) {
1247
+ function F(e, t) {
1198
1248
  if (e.length === 0) return {
1199
1249
  root: {
1200
1250
  id: "empty-root",
@@ -1226,7 +1276,7 @@ function P(e, t) {
1226
1276
  warnings: ["No root component found"],
1227
1277
  orphans: []
1228
1278
  };
1229
- let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map(), s = [], c = t?.surfaceId ?? "default", l = t?.registry ? (e) => t.registry.resolveNativeTag(e) : j, u = F(i, n, a, o, s, c, l), d = e.filter((e) => !a.has(e.id)).map((e) => e.id);
1279
+ let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map(), s = [], c = t?.surfaceId ?? "default", l = t?.registry ? (e) => t.registry.resolveNativeTag(e) : M, u = I(i, n, a, o, s, c, l), d = e.filter((e) => !a.has(e.id)).map((e) => e.id);
1230
1280
  return d.length > 0 && s.push(`Orphan components not reachable from root: ${d.join(", ")}`), {
1231
1281
  root: u,
1232
1282
  bindings: o,
@@ -1234,7 +1284,7 @@ function P(e, t) {
1234
1284
  orphans: d
1235
1285
  };
1236
1286
  }
1237
- function F(e, t, n, r, i, a, o = j) {
1287
+ function I(e, t, n, r, i, a, o = M) {
1238
1288
  if (n.has(e)) return i.push(`Cycle detected at component "${e}"`), {
1239
1289
  id: `${e}-cycle`,
1240
1290
  tag: "div",
@@ -1311,7 +1361,7 @@ function F(e, t, n, r, i, a, o = j) {
1311
1361
  attributes: { value: u },
1312
1362
  textContent: d
1313
1363
  });
1314
- let f = l.children ?? (l.child ? [l.child] : void 0), h = f ? f.map((e) => F(e, t, n, r, i, a, o)) : void 0, g = typeof l.text == "string" ? l.text : void 0;
1364
+ let f = l.children ?? (l.child ? [l.child] : void 0), h = f ? f.map((e) => I(e, t, n, r, i, a, o)) : void 0, g = typeof l.text == "string" ? l.text : void 0;
1315
1365
  s.push({
1316
1366
  id: `${c}-panel`,
1317
1367
  tag: "n-tab-panel",
@@ -1350,7 +1400,7 @@ function F(e, t, n, r, i, a, o = j) {
1350
1400
  } else if (s.component === "Card" && m && m.length > 0) if (m.some((e) => {
1351
1401
  let n = t.get(e);
1352
1402
  return n ? fe.has(n.component) : !1;
1353
- })) p = m.map((e) => F(e, t, n, r, i, a, o));
1403
+ })) p = m.map((e) => I(e, t, n, r, i, a, o));
1354
1404
  else {
1355
1405
  p = [];
1356
1406
  let c = s.header ?? s.label;
@@ -1364,7 +1414,7 @@ function F(e, t, n, r, i, a, o = j) {
1364
1414
  textContent: c
1365
1415
  }]
1366
1416
  });
1367
- let l = m.map((e) => F(e, t, n, r, i, a, o));
1417
+ let l = m.map((e) => I(e, t, n, r, i, a, o));
1368
1418
  p.push({
1369
1419
  id: `${e}-body`,
1370
1420
  tag: "n-body",
@@ -1377,7 +1427,7 @@ function F(e, t, n, r, i, a, o = j) {
1377
1427
  textContent: u
1378
1428
  }), c && (d = void 0);
1379
1429
  }
1380
- else m && m.length > 0 && (p = m.map((e) => F(e, t, n, r, i, a, o)));
1430
+ else m && m.length > 0 && (p = m.map((e) => I(e, t, n, r, i, a, o)));
1381
1431
  if (c.childStrategy === "slot-label" && d && !p) p = [{
1382
1432
  id: `${e}-label`,
1383
1433
  tag: "span",
@@ -1426,10 +1476,10 @@ function F(e, t, n, r, i, a, o = j) {
1426
1476
  };
1427
1477
  }
1428
1478
  function pe(e, t) {
1429
- let n = [], r = t?.registry ? (e, n) => t.registry.resolveA2UIType(e, n) : M, i = t?.registry ? (e) => t.registry.resolveNativeTag(e) : j;
1430
- return I(e, n, t?.surfaceId ?? "default", r, i), n;
1479
+ let n = [], r = t?.registry ? (e, n) => t.registry.resolveA2UIType(e, n) : N, i = t?.registry ? (e) => t.registry.resolveNativeTag(e) : M;
1480
+ return L(e, n, t?.surfaceId ?? "default", r, i), n;
1431
1481
  }
1432
- function I(e, t, n, r = M, i = j) {
1482
+ function L(e, t, n, r = N, i = M) {
1433
1483
  let a = r(e.tag, e.attributes);
1434
1484
  if (!a) {
1435
1485
  let a = {
@@ -1438,7 +1488,7 @@ function I(e, t, n, r = M, i = j) {
1438
1488
  ...e.children ? { children: e.children.map((e) => e.id) } : {},
1439
1489
  ...e.textContent ? { text: e.textContent } : {}
1440
1490
  };
1441
- if (t.push(a), e.children) for (let a of e.children) I(a, t, n, r, i);
1491
+ if (t.push(a), e.children) for (let a of e.children) L(a, t, n, r, i);
1442
1492
  return;
1443
1493
  }
1444
1494
  let o = i(a), s = {
@@ -1451,7 +1501,7 @@ function I(e, t, n, r = M, i = j) {
1451
1501
  } else if (o?.childStrategy === "slot-label" && e.children.length === 1 && e.children[0].attributes?.slot === "label" && e.children[0].textContent) s.text = e.children[0].textContent;
1452
1502
  else {
1453
1503
  s.children = e.children.map((e) => e.id);
1454
- for (let a of e.children) I(a, t, n, r, i);
1504
+ for (let a of e.children) L(a, t, n, r, i);
1455
1505
  }
1456
1506
  if (e.textContent && (a === "CheckBox" || a === "Switch" || a === "ListItem" ? s.label = e.textContent : s.text = e.textContent), e.attributes) {
1457
1507
  let t = o?.propertyMap ? me(o.propertyMap) : {};
@@ -1486,18 +1536,18 @@ function he(e, t = "generated") {
1486
1536
  * Manages A2UI surface lifecycle: create → updateComponents → updateDataModel → delete.
1487
1537
  * Each surface maps to one UIPlan in the kernel.
1488
1538
  */
1489
- function L(e, t) {
1539
+ function R(e, t) {
1490
1540
  if (!t || t === "/") return e;
1491
- let n = t.replace(/^\//, "").split("/").map(z), r = e;
1541
+ let n = t.replace(/^\//, "").split("/").map(ge), r = e;
1492
1542
  for (let e of n) {
1493
1543
  if (typeof r != "object" || !r) return;
1494
1544
  r = r[e];
1495
1545
  }
1496
1546
  return r;
1497
1547
  }
1498
- function R(e, t, n) {
1548
+ function z(e, t, n) {
1499
1549
  if (!t || t === "/") return;
1500
- let r = t.replace(/^\//, "").split("/").map(z), i = e;
1550
+ let r = t.replace(/^\//, "").split("/").map(ge), i = e;
1501
1551
  for (let e = 0; e < r.length - 1; e++) {
1502
1552
  let t = r[e];
1503
1553
  (i[t] == null || typeof i[t] != "object") && (i[t] = {}), i = i[t];
@@ -1505,7 +1555,7 @@ function R(e, t, n) {
1505
1555
  let a = r[r.length - 1];
1506
1556
  n === void 0 ? delete i[a] : i[a] = n;
1507
1557
  }
1508
- function z(e) {
1558
+ function ge(e) {
1509
1559
  return e.replace(/~1/g, "/").replace(/~0/g, "~");
1510
1560
  }
1511
1561
  var B = class {
@@ -1558,7 +1608,7 @@ var B = class {
1558
1608
  }, this.#i.set(n, i), this.#a.value = this.#i.size), i.rendered ? (this.#l(i, r), i.components = [...r]) : (i.components = [...r], this.#c(i)), i.rendered && this.#n?.(i.surfaceId, i.container);
1559
1609
  }
1560
1610
  #c(e) {
1561
- let t = P(e.components, {
1611
+ let t = F(e.components, {
1562
1612
  surfaceId: e.surfaceId,
1563
1613
  registry: this.#r
1564
1614
  });
@@ -1571,7 +1621,7 @@ var B = class {
1571
1621
  } catch {}
1572
1622
  }
1573
1623
  #l(e, t) {
1574
- let n = ye(e.components, t, e.surfaceId, this.#r);
1624
+ let n = be(e.components, t, e.surfaceId, this.#r);
1575
1625
  if (n.length === 0) return;
1576
1626
  this.#e.patchPlan({
1577
1627
  planId: e.planId,
@@ -1579,7 +1629,7 @@ var B = class {
1579
1629
  source: "generated",
1580
1630
  timestamp: Date.now()
1581
1631
  });
1582
- let r = P(t, {
1632
+ let r = F(t, {
1583
1633
  surfaceId: e.surfaceId,
1584
1634
  registry: this.#r
1585
1635
  });
@@ -1593,7 +1643,7 @@ var B = class {
1593
1643
  let { surfaceId: t, path: n, value: r } = e.updateDataModel, i = this.#i.get(t);
1594
1644
  if (!i) return;
1595
1645
  let a = { ...i.dataModel.value };
1596
- !n || n === "/" ? i.dataModel.value = r ?? {} : (R(a, n, r), i.dataModel.value = a);
1646
+ !n || n === "/" ? i.dataModel.value = r ?? {} : (z(a, n, r), i.dataModel.value = a);
1597
1647
  }
1598
1648
  #d(e) {
1599
1649
  let { surfaceId: t } = e.deleteSurface, n = this.#i.get(t);
@@ -1608,7 +1658,7 @@ var B = class {
1608
1658
  let i = t.get(n);
1609
1659
  if (i) for (let t of r) {
1610
1660
  let n = u(() => {
1611
- let n = e.dataModel.value, r = L(n, t.path);
1661
+ let n = e.dataModel.value, r = R(n, t.path);
1612
1662
  r !== void 0 && (t.property === "textContent" ? i.textContent = String(r) : t.property === "src" || t.property === "alt" || t.property.startsWith("aria-") ? i.setAttribute(t.property, String(r)) : i[t.property] = r);
1613
1663
  });
1614
1664
  e.bindingDisposers.push(n);
@@ -1620,7 +1670,7 @@ var B = class {
1620
1670
  e.actionDisposer = this.#e.bus.on((e) => e.type.startsWith(t), (t) => {
1621
1671
  let n = t.type.split(":");
1622
1672
  if (n.length < 4) return;
1623
- let r = n[2], i = n[3], a = e.components.find((e) => e.id === r)?.action?.event?.context, o = a ? ge(a, e.dataModel.value) : void 0;
1673
+ let r = n[2], i = n[3], a = e.components.find((e) => e.id === r)?.action?.event?.context, o = a ? _e(a, e.dataModel.value) : void 0;
1624
1674
  this.#t({ action: {
1625
1675
  surfaceId: e.surfaceId,
1626
1676
  sourceComponentId: r,
@@ -1651,13 +1701,13 @@ var B = class {
1651
1701
  for (let e of this.#i.keys()) this.#d({ deleteSurface: { surfaceId: e } });
1652
1702
  }
1653
1703
  };
1654
- function ge(e, t) {
1704
+ function _e(e, t) {
1655
1705
  let n = {};
1656
- for (let [r, i] of Object.entries(e)) typeof i == "object" && i && "path" in i ? n[r] = L(t, i.path) : n[r] = i;
1706
+ for (let [r, i] of Object.entries(e)) typeof i == "object" && i && "path" in i ? n[r] = R(t, i.path) : n[r] = i;
1657
1707
  return n;
1658
1708
  }
1659
1709
  /** A2UI properties that map to HTML attributes on the rendered element. */
1660
- var _e = [
1710
+ var ve = [
1661
1711
  "variant",
1662
1712
  "placeholder",
1663
1713
  "name",
@@ -1670,8 +1720,8 @@ var _e = [
1670
1720
  "fit",
1671
1721
  "style",
1672
1722
  "intent"
1673
- ], ve = ["value"];
1674
- function ye(e, t, n, r) {
1723
+ ], ye = ["value"];
1724
+ function be(e, t, n, r) {
1675
1725
  let i = /* @__PURE__ */ new Map();
1676
1726
  for (let t of e) i.set(t.id, t);
1677
1727
  let a = /* @__PURE__ */ new Map();
@@ -1682,9 +1732,9 @@ function ye(e, t, n, r) {
1682
1732
  targetId: e
1683
1733
  });
1684
1734
  for (let [e, s] of a) if (!i.has(e)) {
1685
- let i = be(e, t);
1735
+ let i = xe(e, t);
1686
1736
  if (i) {
1687
- let t = P([s], {
1737
+ let t = F([s], {
1688
1738
  surfaceId: n,
1689
1739
  rootId: e,
1690
1740
  registry: r
@@ -1700,7 +1750,7 @@ function ye(e, t, n, r) {
1700
1750
  let a = i.get(e);
1701
1751
  if (a) {
1702
1752
  if (s.component !== a.component) {
1703
- let i = P(xe(e, t), {
1753
+ let i = F(Se(e, t), {
1704
1754
  surfaceId: n,
1705
1755
  rootId: e,
1706
1756
  registry: r
@@ -1713,7 +1763,7 @@ function ye(e, t, n, r) {
1713
1763
  continue;
1714
1764
  }
1715
1765
  if (JSON.stringify(a.children ?? a.child ?? []) !== JSON.stringify(s.children ?? s.child ?? [])) {
1716
- let i = P(xe(e, t), {
1766
+ let i = F(Se(e, t), {
1717
1767
  surfaceId: n,
1718
1768
  rootId: e,
1719
1769
  registry: r
@@ -1743,7 +1793,7 @@ function ye(e, t, n, r) {
1743
1793
  targetId: e,
1744
1794
  name: "disabled"
1745
1795
  }));
1746
- for (let t of _e) {
1796
+ for (let t of ve) {
1747
1797
  let n = a[t], r = s[t];
1748
1798
  r !== n && (r == null || r === !1 ? o.push({
1749
1799
  type: "remove-attribute",
@@ -1756,7 +1806,7 @@ function ye(e, t, n, r) {
1756
1806
  value: String(r)
1757
1807
  }));
1758
1808
  }
1759
- for (let t of ve) {
1809
+ for (let t of ye) {
1760
1810
  let n = a[t], r = s[t];
1761
1811
  r !== n && r !== void 0 && o.push({
1762
1812
  type: "set-property",
@@ -1769,11 +1819,11 @@ function ye(e, t, n, r) {
1769
1819
  }
1770
1820
  return o;
1771
1821
  }
1772
- function be(e, t) {
1822
+ function xe(e, t) {
1773
1823
  for (let n of t) if (n.children?.includes(e) || n.child === e) return n.id;
1774
1824
  return null;
1775
1825
  }
1776
- function xe(e, t) {
1826
+ function Se(e, t) {
1777
1827
  let n = /* @__PURE__ */ new Map();
1778
1828
  for (let e of t) n.set(e.id, e);
1779
1829
  let r = [], i = /* @__PURE__ */ new Set();
@@ -1788,7 +1838,7 @@ function xe(e, t) {
1788
1838
  }
1789
1839
  return a(e), r;
1790
1840
  }
1791
- function Se(e, t, n) {
1841
+ function Ce(e, t, n) {
1792
1842
  return new B(e, t, void 0, n);
1793
1843
  }
1794
1844
  var V = class {
@@ -1816,14 +1866,14 @@ var V = class {
1816
1866
  } });
1817
1867
  return;
1818
1868
  }
1819
- if (D(n)) {
1869
+ if (ee(n)) {
1820
1870
  this.#n(n.requestCatalog.surfaceId);
1821
1871
  return;
1822
1872
  }
1823
1873
  this.#e.handleMessage(n, t);
1824
1874
  }
1825
1875
  #n(e) {
1826
- let t = this.#t.registry?.getSupportedTypes() ?? N(), n = { catalog: {
1876
+ let t = this.#t.registry?.getSupportedTypes() ?? P(), n = { catalog: {
1827
1877
  ...e ? { surfaceId: e } : {},
1828
1878
  supportedTypes: [...t],
1829
1879
  version: this.#t.version ?? "0.9"
@@ -1870,13 +1920,13 @@ var V = class {
1870
1920
  * Returns the list of A2UI component types supported by this adapter.
1871
1921
  */
1872
1922
  getSupportedTypes() {
1873
- return this.#t.registry?.getSupportedTypes() ?? N();
1923
+ return this.#t.registry?.getSupportedTypes() ?? P();
1874
1924
  }
1875
1925
  destroy() {
1876
1926
  this.#e.destroy();
1877
1927
  }
1878
1928
  };
1879
- function Ce(e, t) {
1929
+ function we(e, t) {
1880
1930
  return new V(e, t);
1881
1931
  }
1882
1932
  /**
@@ -1893,7 +1943,7 @@ function Ce(e, t) {
1893
1943
  * change tracking via a signal. The default singleton
1894
1944
  * (`defaultCompositionRegistry`) preserves backward compatibility.
1895
1945
  */
1896
- var we = class e {
1946
+ var Te = class e {
1897
1947
  #e = /* @__PURE__ */ new Map();
1898
1948
  #t;
1899
1949
  constructor(e) {
@@ -1955,7 +2005,7 @@ var we = class e {
1955
2005
  };
1956
2006
  }
1957
2007
  };
1958
- function Te(e, t, n) {
2008
+ function Ee(e, t, n) {
1959
2009
  let r = t.resolveStrategy(e, n);
1960
2010
  return r === "direct" ? {
1961
2011
  strategy: "direct",
@@ -1968,7 +2018,7 @@ function Te(e, t, n) {
1968
2018
  type: e
1969
2019
  };
1970
2020
  }
1971
- const Ee = new we([
2021
+ const De = new Te([
1972
2022
  {
1973
2023
  a2uiType: "SearchInput",
1974
2024
  description: "Text field with integrated clear button for search workflows.",
@@ -2619,8 +2669,8 @@ const Ee = new we([
2619
2669
  requiredStates: ["active", "hidden"],
2620
2670
  gaps: []
2621
2671
  }
2622
- ]), De = Ee;
2623
- var Oe = class {
2672
+ ]), Oe = De;
2673
+ var ke = class {
2624
2674
  #e;
2625
2675
  #t;
2626
2676
  #n;
@@ -2685,7 +2735,7 @@ var Oe = class {
2685
2735
  this.#o = null, this.#i !== "closed" && this.connect();
2686
2736
  }, n);
2687
2737
  }
2688
- }, ke = class {
2738
+ }, Ae = class {
2689
2739
  #e;
2690
2740
  #t;
2691
2741
  #n;
@@ -2745,13 +2795,13 @@ var Oe = class {
2745
2795
  this.#i !== e && (this.#i = e, this.#n.onStateChange?.(e));
2746
2796
  }
2747
2797
  };
2748
- function Ae(e, t, n) {
2749
- return new Oe(e, t, n);
2750
- }
2751
2798
  function je(e, t, n) {
2752
2799
  return new ke(e, t, n);
2753
2800
  }
2754
- function Me(e, t) {
2801
+ function Me(e, t, n) {
2802
+ return new Ae(e, t, n);
2803
+ }
2804
+ function Ne(e, t) {
2755
2805
  e.use("a2ui", () => new V(e, t));
2756
2806
  }
2757
2807
  var H = new Set([
@@ -2765,7 +2815,7 @@ var H = new Set([
2765
2815
  * Find top-level `{}` blocks using brace-counting with string-escape awareness.
2766
2816
  * Same algorithm as the workbench's `#getEnvelopes()` method.
2767
2817
  */
2768
- function Ne(e) {
2818
+ function Pe(e) {
2769
2819
  let t = [], n = 0, r = -1, i = !1, a = !1;
2770
2820
  for (let o = 0; o < e.length; o++) {
2771
2821
  let s = e[o];
@@ -2798,8 +2848,8 @@ function Ne(e) {
2798
2848
  * const ext = linter(a2uiLinter);
2799
2849
  * ```
2800
2850
  */
2801
- function Pe(e) {
2802
- let t = e.state.doc.toString(), n = [], r = Ne(t), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = [], s = /* @__PURE__ */ new Map();
2851
+ function Fe(e) {
2852
+ let t = e.state.doc.toString(), n = [], r = Pe(t), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = [], s = /* @__PURE__ */ new Map();
2803
2853
  for (let e of r) {
2804
2854
  let { from: t, to: r, text: c } = e, l;
2805
2855
  try {
@@ -2900,7 +2950,7 @@ function Pe(e) {
2900
2950
  }
2901
2951
  return n;
2902
2952
  }
2903
- const Fe = [
2953
+ const Ie = [
2904
2954
  {
2905
2955
  id: "general",
2906
2956
  label: "General"
@@ -10310,7 +10360,7 @@ var W = [
10310
10360
  "js",
10311
10361
  "components",
10312
10362
  "schema"
10313
- ], Ie = {
10363
+ ], Le = {
10314
10364
  "json-in": "IN",
10315
10365
  "json-out": "OUT",
10316
10366
  html: "HTML",
@@ -10318,7 +10368,7 @@ var W = [
10318
10368
  js: "JS",
10319
10369
  components: "UI",
10320
10370
  schema: "SCHEMA"
10321
- }, Le = {
10371
+ }, Re = {
10322
10372
  "json-in": "brackets-curly",
10323
10373
  "json-out": "chat-circle-dots",
10324
10374
  html: "code",
@@ -10326,21 +10376,21 @@ var W = [
10326
10376
  js: "terminal",
10327
10377
  components: "squares-four",
10328
10378
  schema: "file-code"
10329
- }, Re = h.define(), ze = p.line({ class: "cm-a2ui-sent" }), Be = p.line({ class: "cm-a2ui-next" }), Ve = g.define({
10379
+ }, ze = h.define(), Be = p.line({ class: "cm-a2ui-sent" }), Ve = p.line({ class: "cm-a2ui-next" }), He = g.define({
10330
10380
  create() {
10331
10381
  return p.none;
10332
10382
  },
10333
10383
  update(e, t) {
10334
- for (let e of t.effects) if (e.is(Re)) {
10384
+ for (let e of t.effects) if (e.is(ze)) {
10335
10385
  let n = t.state.doc, { sentUpToLine: r, nextFromLine: i, nextToLine: a } = e.value, o = [];
10336
- for (let e = 1; e <= Math.min(r, n.lines); e++) o.push(ze.range(n.line(e).from));
10337
- for (let e = Math.max(1, i); e <= Math.min(a, n.lines); e++) o.push(Be.range(n.line(e).from));
10386
+ for (let e = 1; e <= Math.min(r, n.lines); e++) o.push(Be.range(n.line(e).from));
10387
+ for (let e = Math.max(1, i); e <= Math.min(a, n.lines); e++) o.push(Ve.range(n.line(e).from));
10338
10388
  return p.set(o, !0);
10339
10389
  }
10340
10390
  return e;
10341
10391
  },
10342
10392
  provide: (e) => m.decorations.from(e)
10343
- }), He = class extends i {
10393
+ }), Ue = class extends i {
10344
10394
  static observedAttributes = ["stream"];
10345
10395
  #e = d("");
10346
10396
  #t = d(0);
@@ -10368,7 +10418,7 @@ var W = [
10368
10418
  #C = /* @__PURE__ */ new Map();
10369
10419
  #w = /* @__PURE__ */ new Map();
10370
10420
  #T = /* @__PURE__ */ new Map();
10371
- #E = A.clone();
10421
+ #E = j.clone();
10372
10422
  #D = null;
10373
10423
  #O = null;
10374
10424
  #k = null;
@@ -10437,7 +10487,7 @@ var W = [
10437
10487
  this.#m.value = r ? r + "\n\n" + n : n;
10438
10488
  }), this.addEffect(() => {
10439
10489
  let e = this.#s.value;
10440
- this.#h && (this.#h.value = e ? Ue(e) : "");
10490
+ this.#h && (this.#h.value = e ? We(e) : "");
10441
10491
  }), this.addEffect(() => {
10442
10492
  let e = this.#c.value;
10443
10493
  this.#g && (typeof e == "object" && e && Object.keys(e).length > 0 ? this.#g.value = JSON.stringify(e, null, 2) : this.#g.value = "");
@@ -10450,7 +10500,7 @@ var W = [
10450
10500
  i = n[t].startLine, a = n[t].endLine;
10451
10501
  break;
10452
10502
  }
10453
- t.dispatch({ effects: Re.of({
10503
+ t.dispatch({ effects: ze.of({
10454
10504
  sentUpToLine: r,
10455
10505
  nextFromLine: i,
10456
10506
  nextToLine: a
@@ -10463,7 +10513,7 @@ var W = [
10463
10513
  this.#A?.destroy(), this.#A = null, this.removeEventListener("native:present", this.#ve), this.removeEventListener("native:dismiss", this.#ye), this.#j?.destroy(), this.#j = null, this.#M = null, this.#N = null, this.#x?.removeEventListener("native:resize-end", this.#De), this.#S?.removeEventListener("pointerdown", this.#q), this.#S?.removeEventListener("dblclick", this.#X), document.removeEventListener("pointermove", this.#J), document.removeEventListener("pointerup", this.#Y), this.#P = null, this.#x = null, this.#S = null, this.#C.clear(), this.#w.clear(), this.#T.clear(), this.#I(), this.#p = null, this.#m = null, this.#h = null, this.#g = null, this.#_ = null, this.#v = null, this.#y = null, this.#b = null, super.teardown();
10464
10514
  }
10465
10515
  #F() {
10466
- x(), this.#D = new b({ allowUnregistered: !0 }), this.#O = Ce(this.#D, {
10516
+ x(), this.#D = new b({ allowUnregistered: !0 }), this.#O = we(this.#D, {
10467
10517
  registry: this.#E,
10468
10518
  onClientMessage: (e) => {
10469
10519
  this.#se("received", e);
@@ -10515,7 +10565,7 @@ var W = [
10515
10565
  } catch {}
10516
10566
  }
10517
10567
  #B() {
10518
- this.#E = A.clone(), this.#L(), this.#y && (this.#y.value = JSON.stringify(this.#E.toJSON(), null, 2)), this.#v && this.#fe(this.#v, this.#l.value);
10568
+ this.#E = j.clone(), this.#L(), this.#y && (this.#y.value = JSON.stringify(this.#E.toJSON(), null, 2)), this.#v && this.#fe(this.#v, this.#l.value);
10519
10569
  }
10520
10570
  #V() {
10521
10571
  if (!this.#O) return;
@@ -10681,7 +10731,7 @@ var W = [
10681
10731
  r.setAttribute("justify", "spread"), r.innerHTML = "<span slot=\"label\">Presets</span><n-icon name=\"caret-up-down\" slot=\"trailing\"></n-icon>", n.appendChild(r);
10682
10732
  let i = document.createElement("n-listbox");
10683
10733
  i.setAttribute("popover", "");
10684
- for (let e of Fe) {
10734
+ for (let e of Ie) {
10685
10735
  if ("hidden" in e && e.hidden) continue;
10686
10736
  let t = Object.entries(U).filter(([t, n]) => n.group === e.id);
10687
10737
  if (t.length === 0) continue;
@@ -10696,7 +10746,7 @@ var W = [
10696
10746
  n.appendChild(i), n.addEventListener("native:change", this.#be), t.appendChild(n);
10697
10747
  for (let e of W) {
10698
10748
  let n = document.createElement("n-button");
10699
- n.setAttribute("variant", "ghost"), n.setAttribute("size", "sm"), n.textContent = Ie[e], this.#n.value.has(e) && n.toggleAttribute("data-active", !0), n.addEventListener("native:press", this.#je(e)), t.appendChild(n), this.#T.set(e, n);
10749
+ n.setAttribute("variant", "ghost"), n.setAttribute("size", "sm"), n.textContent = Le[e], this.#n.value.has(e) && n.toggleAttribute("data-active", !0), n.addEventListener("native:press", this.#je(e)), t.appendChild(n), this.#T.set(e, n);
10700
10750
  }
10701
10751
  let a = document.createElement("n-button");
10702
10752
  a.setAttribute("variant", "ghost"), a.setAttribute("size", "sm"), a.title = "Auto-play presets on load", a.innerHTML = "<n-icon name=\"lightning\"></n-icon>", a.addEventListener("native:press", this.#ke), t.appendChild(a), this.#N = a;
@@ -10714,9 +10764,9 @@ var W = [
10714
10764
  let t = document.createElement("div");
10715
10765
  t.className = "a2ui-pane", t.dataset.panel = e, this.#n.value.has(e) || (t.hidden = !0);
10716
10766
  let n = document.createElement("n-header"), r = document.createElement("nav"), i = document.createElement("n-icon");
10717
- i.setAttribute("name", Le[e]), r.appendChild(i), n.appendChild(r);
10767
+ i.setAttribute("name", Re[e]), r.appendChild(i), n.appendChild(r);
10718
10768
  let a = document.createElement("span");
10719
- a.textContent = Ie[e], n.appendChild(a);
10769
+ a.textContent = Le[e], n.appendChild(a);
10720
10770
  let o = document.createElement("aside");
10721
10771
  if (e === "js" || e === "html" || e === "css") {
10722
10772
  let t = document.createElement("n-button");
@@ -10786,8 +10836,8 @@ var W = [
10786
10836
  if (!this.#p) return;
10787
10837
  this.#p.value = this.#e.value, this.#p.extensions = [
10788
10838
  v(),
10789
- Ve,
10790
- y(Pe)
10839
+ He,
10840
+ y(Fe)
10791
10841
  ], this.#p.addEventListener("native:input", (e) => {
10792
10842
  this.#e.value = e.detail.value;
10793
10843
  });
@@ -11203,7 +11253,7 @@ var W = [
11203
11253
  } else if (e === "html") {
11204
11254
  if (!this.#h) return;
11205
11255
  let e = this.#s.value;
11206
- this.#h.value = e ? Ue(e) : "";
11256
+ this.#h.value = e ? We(e) : "";
11207
11257
  } else if (e === "css") {
11208
11258
  if (!this.#g) return;
11209
11259
  let e = this.#c.value;
@@ -11215,7 +11265,7 @@ var W = [
11215
11265
  t.has(e) ? t.delete(e) : t.add(e), this.#n.value = t;
11216
11266
  };
11217
11267
  };
11218
- function Ue(e) {
11268
+ function We(e) {
11219
11269
  let t = "", n = 0, r = 0;
11220
11270
  for (; r < e.length;) if (e[r] === "<") {
11221
11271
  let i = e.indexOf(">", r);
@@ -11230,7 +11280,7 @@ function Ue(e) {
11230
11280
  }
11231
11281
  return t.trimEnd();
11232
11282
  }
11233
- var We = class {
11283
+ var Ge = class {
11234
11284
  #e = /* @__PURE__ */ new Set();
11235
11285
  /** Emit an interaction event to all subscribers. */
11236
11286
  emit(e) {
@@ -11246,7 +11296,7 @@ var We = class {
11246
11296
  destroy() {
11247
11297
  this.#e.clear();
11248
11298
  }
11249
- }, Ge = class {
11299
+ }, Ke = class {
11250
11300
  id;
11251
11301
  agentId;
11252
11302
  catalog;
@@ -11258,9 +11308,9 @@ var We = class {
11258
11308
  #i;
11259
11309
  #a = /* @__PURE__ */ new Map();
11260
11310
  constructor(e, t, n) {
11261
- this.id = f("session"), this.agentId = n.agentId, this.catalog = n.catalog, this.#t = t, this.#i = new Set(n.surfaces ?? []), this.eventEmitter = new We(), this.#e = new V(e, {
11311
+ this.id = f("session"), this.agentId = n.agentId, this.catalog = n.catalog, this.#t = t, this.#i = new Set(n.surfaces ?? []), this.eventEmitter = new Ge(), this.#e = new V(e, {
11262
11312
  onClientMessage: (e) => {
11263
- if (ee(e)) {
11313
+ if (D(e)) {
11264
11314
  let t = e.action, n = {
11265
11315
  surfaceId: t.surfaceId,
11266
11316
  componentId: t.sourceComponentId,
@@ -11294,7 +11344,7 @@ var We = class {
11294
11344
  if (this.#n === "terminated") return;
11295
11345
  let t = typeof e == "string" ? O(e) : e;
11296
11346
  if (!t) return;
11297
- let n = Ke(t);
11347
+ let n = qe(t);
11298
11348
  if (n && !this.#i.has(n) && !this.#t.isOwner(n, this)) {
11299
11349
  this.#s("catalog-violation", n, "");
11300
11350
  return;
@@ -11332,13 +11382,13 @@ var We = class {
11332
11382
  if (n) for (let e of n) e(...t);
11333
11383
  }
11334
11384
  };
11335
- function Ke(e) {
11385
+ function qe(e) {
11336
11386
  if (C(e)) return e.createSurface.surfaceId;
11337
11387
  if (w(e)) return e.updateComponents.surfaceId;
11338
11388
  if (T(e)) return e.updateDataModel.surfaceId;
11339
11389
  if (E(e)) return e.deleteSurface.surfaceId;
11340
11390
  }
11341
- var qe = class {
11391
+ var Je = class {
11342
11392
  #e = /* @__PURE__ */ new Map();
11343
11393
  #t = /* @__PURE__ */ new Set();
11344
11394
  #n = /* @__PURE__ */ new Set();
@@ -11418,7 +11468,7 @@ var qe = class {
11418
11468
  destroy() {
11419
11469
  this.#e.clear(), this.#t.clear(), this.#n.clear();
11420
11470
  }
11421
- }, Je = class {
11471
+ }, Ye = class {
11422
11472
  #e;
11423
11473
  constructor(e) {
11424
11474
  let t = /* @__PURE__ */ new Map();
@@ -11467,7 +11517,7 @@ var qe = class {
11467
11517
  });
11468
11518
  }
11469
11519
  };
11470
- function Ye(e) {
11520
+ function Xe(e) {
11471
11521
  return {
11472
11522
  a2uiType: e.a2uiType,
11473
11523
  tagName: e.nativeTag,
@@ -11482,21 +11532,21 @@ function Ye(e) {
11482
11532
  */
11483
11533
  function G(e = "core-only") {
11484
11534
  let t = [];
11485
- for (let [n, r] of re) e === "core-only" && r.nativeTag.startsWith("native-dashboard-") || t.push(Ye(r));
11486
- return new Je(t);
11535
+ for (let [n, r] of re) e === "core-only" && r.nativeTag.startsWith("native-dashboard-") || t.push(Xe(r));
11536
+ return new Ye(t);
11487
11537
  }
11488
- var Xe = class {
11538
+ var Ze = class {
11489
11539
  surfaces;
11490
11540
  #e;
11491
11541
  #t = /* @__PURE__ */ new Map();
11492
11542
  constructor(e) {
11493
- this.#e = e, this.surfaces = new qe();
11543
+ this.#e = e, this.surfaces = new Je();
11494
11544
  }
11495
11545
  /** Create a new agent session with the given configuration. */
11496
11546
  createSession(e) {
11497
11547
  let t;
11498
11548
  t = e.catalog === "full" ? G("full") : e.catalog === "core-only" ? G("core-only") : e.catalog;
11499
- let n = new Ge(this.#e, this.surfaces, {
11549
+ let n = new Ke(this.#e, this.surfaces, {
11500
11550
  agentId: e.agentId,
11501
11551
  catalog: t,
11502
11552
  surfaces: e.surfaces
@@ -11535,7 +11585,7 @@ var Xe = class {
11535
11585
  destroy() {
11536
11586
  this.terminateAll(), this.surfaces.destroy();
11537
11587
  }
11538
- }, Ze = class {
11588
+ }, Qe = class {
11539
11589
  type = "direct";
11540
11590
  #e;
11541
11591
  #t = null;
@@ -11572,7 +11622,7 @@ var Xe = class {
11572
11622
  async disconnect() {
11573
11623
  this.#r?.(), this.#r = null, this.#n && this.#t && this.#t.sessionManager.terminateSession(this.#n.id), this.#n = null, this.#t = null;
11574
11624
  }
11575
- }, Qe = class {
11625
+ }, $e = class {
11576
11626
  type = "a2a";
11577
11627
  #e;
11578
11628
  #t = null;
@@ -11634,7 +11684,7 @@ var Xe = class {
11634
11684
  });
11635
11685
  } catch {}
11636
11686
  }
11637
- }, $e = class {
11687
+ }, et = class {
11638
11688
  type = "ag-ui";
11639
11689
  #e;
11640
11690
  #t = null;
@@ -11673,7 +11723,7 @@ var Xe = class {
11673
11723
  }
11674
11724
  e.type === "RUN_FINISHED" || e.type;
11675
11725
  }
11676
- }, et = class extends i {
11726
+ }, tt = class extends i {
11677
11727
  static observedAttributes = [
11678
11728
  "disabled",
11679
11729
  "busy",
@@ -11803,7 +11853,7 @@ var Xe = class {
11803
11853
  })) && !this.hasAttribute("no-auto-clear") && (this.value = "", this.#i?.setAttribute("disabled", ""));
11804
11854
  }
11805
11855
  }
11806
- }, tt = class extends et {}, nt = class extends i {
11856
+ }, nt = class extends tt {}, rt = class extends i {
11807
11857
  static MAX_CONTEXT_MESSAGES = 50;
11808
11858
  static observedAttributes = [
11809
11859
  "show-stop",
@@ -12322,7 +12372,7 @@ var Xe = class {
12322
12372
  #B() {
12323
12373
  this.#b &&= (this.#b.removeEventListener("native:change", this.#M), this.#b.remove(), null), this.#x = null;
12324
12374
  }
12325
- }, rt = 40, it = class extends i {
12375
+ }, it = 40, at = class extends i {
12326
12376
  static observedAttributes = [
12327
12377
  "auto-scroll",
12328
12378
  "scrollable",
@@ -12431,7 +12481,7 @@ var Xe = class {
12431
12481
  }
12432
12482
  }
12433
12483
  #f = () => {
12434
- let e = this.#n.value, t = this.scrollTop + this.clientHeight >= this.scrollHeight - rt;
12484
+ let e = this.#n.value, t = this.scrollTop + this.clientHeight >= this.scrollHeight - it;
12435
12485
  this.#n.value = t, t !== e && this.dispatchEvent(new CustomEvent("native:feed-scroll", {
12436
12486
  bubbles: !0,
12437
12487
  composed: !0,
@@ -12449,7 +12499,7 @@ var Xe = class {
12449
12499
  });
12450
12500
  });
12451
12501
  };
12452
- }, at = class extends i {
12502
+ }, ot = class extends i {
12453
12503
  static observedAttributes = [
12454
12504
  "src",
12455
12505
  "name",
@@ -12489,7 +12539,7 @@ var Xe = class {
12489
12539
  }
12490
12540
  if (n) {
12491
12541
  let e = document.createElement("span");
12492
- e.className = "n-chat-avatar-initials", e.textContent = ot(n), e.setAttribute("aria-hidden", "true"), this.appendChild(e);
12542
+ e.className = "n-chat-avatar-initials", e.textContent = st(n), e.setAttribute("aria-hidden", "true"), this.appendChild(e);
12493
12543
  return;
12494
12544
  }
12495
12545
  let r = document.createElement("n-icon");
@@ -12500,11 +12550,11 @@ var Xe = class {
12500
12550
  this.textContent = "", super.teardown();
12501
12551
  }
12502
12552
  };
12503
- function ot(e) {
12553
+ function st(e) {
12504
12554
  let t = e.trim().split(/\s+/);
12505
12555
  return t.length === 0 ? "" : t.length === 1 ? t[0][0].toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
12506
12556
  }
12507
- const st = {
12557
+ const ct = {
12508
12558
  copy: {
12509
12559
  label: "Copy",
12510
12560
  icon: "copy"
@@ -12529,7 +12579,7 @@ const st = {
12529
12579
  label: "Continue",
12530
12580
  icon: "arrow-right"
12531
12581
  }
12532
- }, ct = {
12582
+ }, lt = {
12533
12583
  assistant: [
12534
12584
  "copy",
12535
12585
  "retry",
@@ -12554,7 +12604,7 @@ const st = {
12554
12604
  * @fires native:message-action - Fired when an action button is clicked
12555
12605
  * @fires native:continue-request - Fired when continue is requested for a partial message
12556
12606
  */
12557
- var lt = class extends i {
12607
+ var ut = class extends i {
12558
12608
  static observedAttributes = [
12559
12609
  "data-role",
12560
12610
  "message-id",
@@ -12673,12 +12723,12 @@ var lt = class extends i {
12673
12723
  #p(e, t, n, r, i) {
12674
12724
  if (this.#o &&= (this.#f(), null), clearTimeout(this.#l), t === "none" || this.querySelector("[slot=\"actions\"]")) return;
12675
12725
  let a;
12676
- if (a = t ? t.split(",").map((e) => e.trim()).filter(Boolean) : ct[e] ?? [], i === "partial" && !a.includes("continue") && (a = [...a, "continue"]), a.length === 0) return;
12726
+ if (a = t ? t.split(",").map((e) => e.trim()).filter(Boolean) : lt[e] ?? [], i === "partial" && !a.includes("continue") && (a = [...a, "continue"]), a.length === 0) return;
12677
12727
  let o = document.createElement("n-toolbar");
12678
12728
  o.dataset.role = "actions", o.setAttribute("padding", "tight"), o.setAttribute("aria-label", "Message actions"), n !== "label" && o.setAttribute("data-style", n);
12679
12729
  for (let e of a) {
12680
- let t = st[e];
12681
- t && o.appendChild(ut(e, t, n));
12730
+ let t = ct[e];
12731
+ t && o.appendChild(dt(e, t, n));
12682
12732
  }
12683
12733
  if (o.children.length !== 0) {
12684
12734
  if (o.addEventListener("native:press", this.#m), r === "below") {
@@ -12711,7 +12761,7 @@ var lt = class extends i {
12711
12761
  }
12712
12762
  };
12713
12763
  };
12714
- function ut(e, t, n) {
12764
+ function dt(e, t, n) {
12715
12765
  let r = document.createElement("n-button");
12716
12766
  if (r.setAttribute("variant", "ghost"), r.setAttribute("size", "sm"), r.setAttribute("inline", ""), r.setAttribute("data-action", e), r.setAttribute("aria-label", t.label), n === "icon" || n === "icon-label") {
12717
12767
  let e = document.createElement("n-icon");
@@ -12748,7 +12798,7 @@ function ut(e, t, n) {
12748
12798
  * @attr {string} sender - Display name of the sender
12749
12799
  * @attr {string} avatar-align - `"top"` | `"center"` | `"bottom"` (default) — avatar vertical alignment
12750
12800
  */
12751
- var dt = class extends i {
12801
+ var ft = class extends i {
12752
12802
  static observedAttributes = [
12753
12803
  "data-role",
12754
12804
  "sender",
@@ -12791,7 +12841,7 @@ var dt = class extends i {
12791
12841
  for (let r of n) r instanceof Element && r.localName === "n-chat-avatar" || (r instanceof Element && r.localName === "n-chat-message" ? t.appendChild(r) : e.appendChild(r));
12792
12842
  this.appendChild(e), this.appendChild(t), this.#t = e, this.#n = t;
12793
12843
  }
12794
- }, ft = class extends i {
12844
+ }, pt = class extends i {
12795
12845
  static observedAttributes = ["format"];
12796
12846
  #e = d("markdown");
12797
12847
  #t = d("");
@@ -12817,7 +12867,7 @@ var dt = class extends i {
12817
12867
  !this.#t.value && this.textContent?.trim() && (this.#t.value = this.textContent.trim()), this.#n = document.createElement("div"), this.#n.className = "n-chat-prose", this.textContent = "", this.appendChild(this.#n), this.addEffect(() => {
12818
12868
  let e = this.#t.value, t = this.#e.value;
12819
12869
  this.#n && (t === "plain" ? this.#n.textContent = e : (cancelAnimationFrame(this.#r), this.#r = requestAnimationFrame(() => {
12820
- this.#n && (this.#n.innerHTML = mt(J(e)));
12870
+ this.#n && (this.#n.innerHTML = ht(J(e)));
12821
12871
  })));
12822
12872
  });
12823
12873
  });
@@ -12825,7 +12875,7 @@ var dt = class extends i {
12825
12875
  teardown() {
12826
12876
  cancelAnimationFrame(this.#r), this.#n = null, super.teardown();
12827
12877
  }
12828
- }, pt = new Set([
12878
+ }, mt = new Set([
12829
12879
  "p",
12830
12880
  "br",
12831
12881
  "strong",
@@ -12904,10 +12954,10 @@ function J(e) {
12904
12954
  return n.join("");
12905
12955
  }
12906
12956
  /** Sanitize rendered HTML — strip any tags not in allowlist. */
12907
- function mt(e) {
12957
+ function ht(e) {
12908
12958
  return e.replace(/<\/?([a-zA-Z][a-zA-Z0-9]*)[^>]*>/g, (e, t) => {
12909
12959
  let n = t.toLowerCase();
12910
- return pt.has(n) ? e : "";
12960
+ return mt.has(n) ? e : "";
12911
12961
  });
12912
12962
  }
12913
12963
  /**
@@ -12928,7 +12978,7 @@ function mt(e) {
12928
12978
  * @attr {boolean} expandable - Allow click to expand trace content
12929
12979
  * @fires native:activity-toggle - Fired when trace is expanded/collapsed
12930
12980
  */
12931
- var ht = class extends i {
12981
+ var gt = class extends i {
12932
12982
  static observedAttributes = [
12933
12983
  "type",
12934
12984
  "label",
@@ -12986,7 +13036,7 @@ var ht = class extends i {
12986
13036
  this.#r.value ? (this.#p(), this.#e.states.add("active")) : (this.#m(), this.#e.states.delete("active"));
12987
13037
  }), this.addEffect(() => {
12988
13038
  if (!this.#c) return;
12989
- let e = this.#n.value || gt(this.#t.value);
13039
+ let e = this.#n.value || _t(this.#t.value);
12990
13040
  this.#c.textContent = e;
12991
13041
  }), this.addEffect(() => {
12992
13042
  this.#u && (this.#u.hidden = !this.#r.value);
@@ -13016,7 +13066,7 @@ var ht = class extends i {
13016
13066
  #h = () => {
13017
13067
  if (!this.#r.value || !this.#l) return;
13018
13068
  let e = performance.now() - this.#o;
13019
- this.#l.textContent = _t(e), this.#s = requestAnimationFrame(this.#h);
13069
+ this.#l.textContent = vt(e), this.#s = requestAnimationFrame(this.#h);
13020
13070
  };
13021
13071
  #g = () => {
13022
13072
  this.#i.value && (this.#a.value = !this.#a.value, this.toggleAttribute("expanded", this.#a.value), this.dispatchEvent(new CustomEvent("native:activity-toggle", {
@@ -13026,14 +13076,14 @@ var ht = class extends i {
13026
13076
  })));
13027
13077
  };
13028
13078
  };
13029
- function gt(e) {
13079
+ function _t(e) {
13030
13080
  switch (e) {
13031
13081
  case "thinking": return "Thinking…";
13032
13082
  case "tool-use": return "Using tools…";
13033
13083
  default: return "Host is typing…";
13034
13084
  }
13035
13085
  }
13036
- function _t(e) {
13086
+ function vt(e) {
13037
13087
  let t = Math.floor(e / 1e3);
13038
13088
  if (t < 60) return `${t}s`;
13039
13089
  let n = Math.floor(t / 60), r = t % 60;
@@ -13053,7 +13103,7 @@ function _t(e) {
13053
13103
  * @attr {boolean} disabled - Disables all chips
13054
13104
  * @fires native:seed-select - Fired when a chip is clicked
13055
13105
  */
13056
- var vt = class extends i {
13106
+ var yt = class extends i {
13057
13107
  static observedAttributes = ["options", "disabled"];
13058
13108
  #e;
13059
13109
  #t = d([]);
@@ -13125,7 +13175,7 @@ var vt = class extends i {
13125
13175
  }
13126
13176
  }));
13127
13177
  };
13128
- }, yt = new Set([
13178
+ }, bt = new Set([
13129
13179
  "script",
13130
13180
  "style",
13131
13181
  "link",
@@ -13142,7 +13192,7 @@ var vt = class extends i {
13142
13192
  "frame",
13143
13193
  "frameset",
13144
13194
  "noscript"
13145
- ]), bt = class extends i {
13195
+ ]), xt = class extends i {
13146
13196
  static observedAttributes = ["schema-type", "mode"];
13147
13197
  #e;
13148
13198
  #t = d("a2ui");
@@ -13188,7 +13238,7 @@ var vt = class extends i {
13188
13238
  super.setup(), this.#i = document.createElement("div"), this.#i.className = "n-chat-genui-container", this.appendChild(this.#i), this.addEffect(() => {
13189
13239
  let e = this.#r.value, t = this.#n.value;
13190
13240
  if (!this.#i || (this.#i.textContent = "", !e)) return;
13191
- let n = xt(e);
13241
+ let n = St(e);
13192
13242
  if (n.length > 0) {
13193
13243
  this.#o(n), this.dispatchEvent(new CustomEvent("native:genui-error", {
13194
13244
  bubbles: !0,
@@ -13252,15 +13302,15 @@ var vt = class extends i {
13252
13302
  }));
13253
13303
  };
13254
13304
  };
13255
- function xt(e, t = 0) {
13305
+ function St(e, t = 0) {
13256
13306
  let n = [];
13257
13307
  if (t > 20) return n.push("Maximum nesting depth (20) exceeded"), n;
13258
13308
  if (!e.tag || typeof e.tag != "string") return n.push("Node missing required \"tag\" property"), n;
13259
- if (yt.has(e.tag.toLowerCase()) && n.push(`Forbidden tag: <${e.tag}>`), e.children) for (let r of e.children) n.push(...xt(r, t + 1));
13309
+ if (bt.has(e.tag.toLowerCase()) && n.push(`Forbidden tag: <${e.tag}>`), e.children) for (let r of e.children) n.push(...St(r, t + 1));
13260
13310
  return n;
13261
13311
  }
13262
13312
  function Y(e) {
13263
- if (yt.has(e.tag.toLowerCase())) return null;
13313
+ if (bt.has(e.tag.toLowerCase())) return null;
13264
13314
  let t = document.createElement(e.tag);
13265
13315
  if (e.id && (t.id = e.id), e.slot && (t.slot = e.slot), e.attributes) for (let [n, r] of Object.entries(e.attributes)) t.setAttribute(n, r);
13266
13316
  if (e.properties) for (let [n, r] of Object.entries(e.properties)) t[n] = r;
@@ -13290,7 +13340,7 @@ function Y(e) {
13290
13340
  * @fires native:structured-submit - Fired on submit with selections
13291
13341
  * @fires native:structured-cancel - Fired when dismissed without selecting
13292
13342
  */
13293
- var St = class extends i {
13343
+ var Ct = class extends i {
13294
13344
  static observedAttributes = [
13295
13345
  "question",
13296
13346
  "type",
@@ -13431,7 +13481,7 @@ var St = class extends i {
13431
13481
  * Reads `data:` lines from the response body, skips empty lines and comments,
13432
13482
  * handles the `[DONE]` sentinel, and accumulates the full message across chunks.
13433
13483
  */
13434
- async function* Ct(e) {
13484
+ async function* wt(e) {
13435
13485
  let t = e.body.getReader(), n = new TextDecoder("utf-8"), r = "", i = "";
13436
13486
  try {
13437
13487
  for (;;) {
@@ -13511,7 +13561,7 @@ async function* Ct(e) {
13511
13561
  * Each non-empty line is parsed as a standalone JSON object.
13512
13562
  * Accumulates the full message across chunks.
13513
13563
  */
13514
- async function* wt(e) {
13564
+ async function* Tt(e) {
13515
13565
  let t = e.body.getReader(), n = new TextDecoder("utf-8"), r = "", i = "";
13516
13566
  try {
13517
13567
  for (;;) {
@@ -13572,7 +13622,7 @@ async function* wt(e) {
13572
13622
  * Reads the entire response body, parses as JSON, and yields one chunk
13573
13623
  * with `done: true`.
13574
13624
  */
13575
- async function* Tt(e) {
13625
+ async function* Et(e) {
13576
13626
  let t = await e.json(), n = "";
13577
13627
  typeof t.content == "string" ? n = t.content : typeof t.message == "string" ? n = t.message : typeof t.delta == "string" ? n = t.delta : Array.isArray(t.choices) && typeof t.choices[0]?.message?.content == "string" && (n = t.choices[0].message.content), yield {
13578
13628
  delta: n,
@@ -13589,13 +13639,13 @@ async function* Tt(e) {
13589
13639
  * - `error` — an error occurred during streaming
13590
13640
  * - `stopped` — consumer aborted the stream
13591
13641
  */
13592
- function Et(e, t) {
13642
+ function Dt(e, t) {
13593
13643
  return t ? t.name === "AbortError" ? "stopped" : "error" : e.partial ? "partial" : "complete";
13594
13644
  }
13595
13645
  /**
13596
13646
  * Classify an HTTP status code into a transport state.
13597
13647
  */
13598
- function Dt(e) {
13648
+ function Ot(e) {
13599
13649
  return e === 401 || e === 403 ? "auth-required" : e === 429 ? "rate-limited" : "server-error";
13600
13650
  }
13601
13651
  /**
@@ -13607,7 +13657,7 @@ function X(e, t = 1e3, n = 3e4) {
13607
13657
  /**
13608
13658
  * Detect the stream format from a Content-Type header value.
13609
13659
  */
13610
- function Ot(e) {
13660
+ function Z(e) {
13611
13661
  let t = e.toLowerCase();
13612
13662
  return t.includes("text/event-stream") ? "sse" : t.includes("ndjson") || t.includes("x-ndjson") ? "ndjson" : "json";
13613
13663
  }
@@ -13615,16 +13665,16 @@ function Ot(e) {
13615
13665
  * Create an async generator that yields ChatStreamChunk values from a
13616
13666
  * Response, auto-detecting the format from Content-Type when not specified.
13617
13667
  */
13618
- async function* Z(e, t) {
13619
- switch (t ?? Ot(e.headers.get("content-type") ?? "")) {
13668
+ async function* kt(e, t) {
13669
+ switch (t ?? Z(e.headers.get("content-type") ?? "")) {
13620
13670
  case "sse":
13621
- yield* Ct(e);
13671
+ yield* wt(e);
13622
13672
  break;
13623
13673
  case "ndjson":
13624
- yield* wt(e);
13674
+ yield* Tt(e);
13625
13675
  break;
13626
13676
  case "json":
13627
- yield* Tt(e);
13677
+ yield* Et(e);
13628
13678
  break;
13629
13679
  }
13630
13680
  }
@@ -13632,7 +13682,7 @@ async function* Z(e, t) {
13632
13682
  * Create a reusable chat transport that sends requests and returns a
13633
13683
  * streaming async generator. Supports retry/backoff and transport state callbacks.
13634
13684
  */
13635
- function kt(e) {
13685
+ function At(e) {
13636
13686
  let t = (t) => {
13637
13687
  e.onStateChange?.(t);
13638
13688
  }, n = e.retry?.maxAttempts ?? 1, r = e.retry?.baseDelayMs ?? 1e3, i = e.retry?.maxDelayMs ?? 3e4;
@@ -13670,13 +13720,13 @@ function kt(e) {
13670
13720
  retryInMs: e,
13671
13721
  attempt: c + 1,
13672
13722
  maxAttempts: n
13673
- }), await jt(e);
13723
+ }), await Mt(e);
13674
13724
  continue;
13675
13725
  }
13676
13726
  break;
13677
13727
  }
13678
13728
  if (!l.ok) {
13679
- let e = Dt(l.status);
13729
+ let e = Ot(l.status);
13680
13730
  s = /* @__PURE__ */ Error(`Chat transport error: ${l.status} ${l.statusText}`);
13681
13731
  let a;
13682
13732
  if (l.status === 429) {
@@ -13700,12 +13750,12 @@ function kt(e) {
13700
13750
  retryInMs: e,
13701
13751
  attempt: c + 1,
13702
13752
  maxAttempts: n
13703
- }), await jt(e);
13753
+ }), await Mt(e);
13704
13754
  continue;
13705
13755
  }
13706
13756
  break;
13707
13757
  }
13708
- return t({ state: "streaming" }), At(Z(l, e.format), t);
13758
+ return t({ state: "streaming" }), jt(kt(l, e.format), t);
13709
13759
  }
13710
13760
  throw s ?? /* @__PURE__ */ Error("Chat transport failed");
13711
13761
  } };
@@ -13713,7 +13763,7 @@ function kt(e) {
13713
13763
  /**
13714
13764
  * Wraps an async generator to emit `ready` state when the stream finishes.
13715
13765
  */
13716
- async function* At(e, t) {
13766
+ async function* jt(e, t) {
13717
13767
  try {
13718
13768
  yield* e, t({ state: "ready" });
13719
13769
  } catch (e) {
@@ -13723,7 +13773,7 @@ async function* At(e, t) {
13723
13773
  }), e;
13724
13774
  }
13725
13775
  }
13726
- function jt(e) {
13776
+ function Mt(e) {
13727
13777
  return new Promise((t) => setTimeout(t, e));
13728
13778
  }
13729
13779
  const Q = {
@@ -13733,7 +13783,7 @@ const Q = {
13733
13783
  GENERATION_STOP: "native:generation-stop",
13734
13784
  GENERATION_ERROR: "native:generation-error",
13735
13785
  WARNING: "native:chat-warning"
13736
- }, Mt = [
13786
+ }, Nt = [
13737
13787
  "requestId",
13738
13788
  "sessionId",
13739
13789
  "conversationId",
@@ -13746,7 +13796,7 @@ const Q = {
13746
13796
  "attempt",
13747
13797
  "maxAttempts",
13748
13798
  "chunkIndex"
13749
- ], Nt = [
13799
+ ], Pt = [
13750
13800
  "query",
13751
13801
  "message",
13752
13802
  "delta",
@@ -13756,17 +13806,17 @@ const Q = {
13756
13806
  "prompt",
13757
13807
  "response"
13758
13808
  ];
13759
- var Pt = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g, Ft = /\b(?:\+?\d{1,3}[-.\s]?)?\(?\d{2,4}\)?[-.\s]?\d{3,4}[-.\s]?\d{3,4}\b/g, It = /\b(?:\d{4}[-\s]?){3}\d{4}\b/g;
13809
+ var Ft = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g, It = /\b(?:\+?\d{1,3}[-.\s]?)?\(?\d{2,4}\)?[-.\s]?\d{3,4}[-.\s]?\d{3,4}\b/g, Lt = /\b(?:\d{4}[-\s]?){3}\d{4}\b/g;
13760
13810
  /**
13761
13811
  * Scrub common PII patterns from a string.
13762
13812
  *
13763
13813
  * Replaces email addresses, phone-like numbers, and credit-card-like
13764
13814
  * number sequences with `[redacted]` placeholders.
13765
13815
  */
13766
- function Lt(e) {
13767
- return e.replace(Pt, "[redacted:email]").replace(It, "[redacted:card]").replace(Ft, "[redacted:phone]");
13816
+ function Rt(e) {
13817
+ return e.replace(Ft, "[redacted:email]").replace(Lt, "[redacted:card]").replace(It, "[redacted:phone]");
13768
13818
  }
13769
- var Rt = new Set(Nt);
13819
+ var zt = new Set(Pt);
13770
13820
  /**
13771
13821
  * Create a default redactor for the given telemetry level.
13772
13822
  *
@@ -13778,7 +13828,7 @@ function $(e) {
13778
13828
  return e === "debug" ? (e) => e : (e) => {
13779
13829
  if (!e.detail) return e;
13780
13830
  let t = {};
13781
- for (let [n, r] of Object.entries(e.detail)) Rt.has(n) && typeof r == "string" ? t[n] = `[redacted:${r.length}chars]` : t[n] = r;
13831
+ for (let [n, r] of Object.entries(e.detail)) zt.has(n) && typeof r == "string" ? t[n] = `[redacted:${r.length}chars]` : t[n] = r;
13782
13832
  return {
13783
13833
  ...e,
13784
13834
  detail: t
@@ -13789,7 +13839,7 @@ function $(e) {
13789
13839
  * Dispatches telemetry events as `CustomEvent` instances on a given
13790
13840
  * `EventTarget`, applying a configurable redactor before emission.
13791
13841
  */
13792
- var zt = class {
13842
+ var Bt = class {
13793
13843
  #e;
13794
13844
  #t;
13795
13845
  constructor(e, t = "minimal") {
@@ -13849,4 +13899,4 @@ var zt = class {
13849
13899
  });
13850
13900
  }
13851
13901
  };
13852
- export { Qe as A2AAdapter, V as A2UIAdapter, st as ACTION_REGISTRY, $e as AGUIAdapter, Q as CHAT_EVENTS, re as COMPONENT_MAP, De as COMPOSITION_MAP, k as ComponentRegistry, we as CompositionRegistry, Ze as DirectAdapter, He as NA2UI, Ge as NAgentSession, Je as NCatalog, at as NChatAvatar, it as NChatFeed, et as NChatInput, tt as NChatInputAdvanced, St as NChatInputStructured, lt as NChatMessage, ht as NChatMessageActivity, bt as NChatMessageGenUI, vt as NChatMessageSeed, ft as NChatMessageText, dt as NChatMessages, nt as NChatPanel, We as NEventEmitter, Xe as NSessionManager, qe as NSurfaceRegistry, ct as ROLE_DEFAULTS, Mt as SAFE_FIELDS, Nt as SENSITIVE_FIELDS, ke as SSETransport, B as SurfaceManager, zt as TelemetryEmitter, Oe as WebSocketTransport, P as a2uiToUINode, X as backoffDelay, G as buildCatalogFromRegistry, Dt as classifyHttpError, Et as classifyStreamEnd, he as conversionToPlan, Ce as createA2UIAdapter, Z as createChatStream, kt as createChatTransport, $ as createDefaultRedactor, je as createSSETransport, Se as createSurfaceManager, Ae as createWebSocketTransport, ce as dateTimeInputType, Ee as defaultCompositionRegistry, A as defaultRegistry, Ot as detectFormat, ae as getCompatibleTypes, ie as getComponentCategory, N as getSupportedTypes, Me as installA2UI, ee as isActionMessage, D as isCatalogRequest, ne as isCatalogResponse, C as isCreateSurface, S as isDataBinding, E as isDeleteSurface, te as isErrorMessage, w as isUpdateComponents, T as isUpdateDataModel, Tt as parseJSON, wt as parseNDJSON, Ct as parseSSE, O as parseServerMessage, q as renderInline, J as renderMarkdown, M as resolveA2UIType, Te as resolveComponent, L as resolveJsonPointer, j as resolveNativeTag, mt as sanitizeHtml, Lt as scrubPII, R as setJsonPointer, ue as textFieldInputType, se as textVariantTag, pe as uiNodeToA2UI };
13902
+ export { $e as A2AAdapter, V as A2UIAdapter, ct as ACTION_REGISTRY, et as AGUIAdapter, Q as CHAT_EVENTS, re as COMPONENT_MAP, Oe as COMPOSITION_MAP, k as ComponentRegistry, Te as CompositionRegistry, Qe as DirectAdapter, Ue as NA2UI, Ke as NAgentSession, Ye as NCatalog, ot as NChatAvatar, at as NChatFeed, tt as NChatInput, nt as NChatInputAdvanced, Ct as NChatInputStructured, ut as NChatMessage, gt as NChatMessageActivity, xt as NChatMessageGenUI, yt as NChatMessageSeed, pt as NChatMessageText, ft as NChatMessages, rt as NChatPanel, Ge as NEventEmitter, Ze as NSessionManager, Je as NSurfaceRegistry, lt as ROLE_DEFAULTS, Nt as SAFE_FIELDS, Pt as SENSITIVE_FIELDS, Ae as SSETransport, B as SurfaceManager, Bt as TelemetryEmitter, ke as WebSocketTransport, F as a2uiToUINode, X as backoffDelay, G as buildCatalogFromRegistry, Ot as classifyHttpError, Dt as classifyStreamEnd, he as conversionToPlan, we as createA2UIAdapter, kt as createChatStream, At as createChatTransport, $ as createDefaultRedactor, Me as createSSETransport, Ce as createSurfaceManager, je as createWebSocketTransport, ce as dateTimeInputType, De as defaultCompositionRegistry, j as defaultRegistry, Z as detectFormat, ae as getCompatibleTypes, ie as getComponentCategory, P as getSupportedTypes, Ne as installA2UI, D as isActionMessage, ee as isCatalogRequest, ne as isCatalogResponse, C as isCreateSurface, S as isDataBinding, E as isDeleteSurface, te as isErrorMessage, w as isUpdateComponents, T as isUpdateDataModel, Et as parseJSON, Tt as parseNDJSON, wt as parseSSE, O as parseServerMessage, q as renderInline, J as renderMarkdown, N as resolveA2UIType, Ee as resolveComponent, R as resolveJsonPointer, M as resolveNativeTag, ht as sanitizeHtml, Rt as scrubPII, z as setJsonPointer, ue as textFieldInputType, se as textVariantTag, pe as uiNodeToA2UI };