@nonoun/native-ai 1.0.71 → 1.0.73
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/a2ui/a2ui-element.d.ts +1 -1
- package/dist/a2ui/a2ui-element.d.ts.map +1 -1
- package/dist/chat/chat-input-element.d.ts +1 -1
- package/dist/chat/chat-input-element.d.ts.map +1 -1
- package/dist/chat/chat-panel-element.d.ts.map +1 -1
- package/dist/chat/feed/chat-feed-element.d.ts +3 -3
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/message/chat-message-element.d.ts +1 -1
- package/dist/chat/message/chat-message-element.d.ts.map +1 -1
- package/dist/chat/message/chat-messages-element.d.ts +6 -6
- package/dist/chat/message/chat-messages-element.d.ts.map +1 -1
- package/dist/chat/message/index.d.ts +2 -2
- package/dist/chat/message/index.d.ts.map +1 -1
- package/dist/chat/register.d.ts +4 -4
- package/dist/chat/register.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/native-ai.css +43 -43
- package/dist/native-ai.js +43 -47
- package/dist/register.d.ts +1 -1
- package/dist/register.d.ts.map +1 -1
- package/dist/register.js +349 -353
- package/package.json +1 -1
package/dist/native-ai.js
CHANGED
|
@@ -10464,7 +10464,7 @@ const Ie = [
|
|
|
10464
10464
|
*
|
|
10465
10465
|
* Layout: chip-toggled multi-panel — preview left, N resizable panes right.
|
|
10466
10466
|
* Chips: JSON-IN, JSON-OUT, HTML, CSS, JS, COMPONENTS (multiple active at once).
|
|
10467
|
-
* Chrome & layout patterns mirror <
|
|
10467
|
+
* Chrome & layout patterns mirror <n-playground> for a unified devtool look.
|
|
10468
10468
|
*
|
|
10469
10469
|
* Renders A2UI components directly (no iframe) using a local Kernel + A2UIAdapter.
|
|
10470
10470
|
* Native-ui components must be registered on the page for rendering to work.
|
|
@@ -10847,40 +10847,38 @@ var W = [
|
|
|
10847
10847
|
let e = document.createElement("n-header"), t = document.createElement("n-toolbar");
|
|
10848
10848
|
t.setAttribute("size", "sm"), t.setAttribute("variant", "ghost");
|
|
10849
10849
|
let n = document.createElement("n-select");
|
|
10850
|
-
n.setAttribute("size", "sm"), n.setAttribute("inline", "");
|
|
10851
|
-
let r = document.createElement("n-
|
|
10852
|
-
r.setAttribute("
|
|
10853
|
-
let i = document.createElement("n-listbox");
|
|
10854
|
-
i.setAttribute("popover", "");
|
|
10850
|
+
n.setAttribute("size", "sm"), n.setAttribute("inline", ""), n.setAttribute("placeholder", "Presets");
|
|
10851
|
+
let r = document.createElement("n-listbox");
|
|
10852
|
+
r.setAttribute("popover", "");
|
|
10855
10853
|
for (let e of Ie) {
|
|
10856
10854
|
if ("hidden" in e && e.hidden) continue;
|
|
10857
10855
|
let t = Object.entries(U).filter(([t, n]) => n.group === e.id);
|
|
10858
10856
|
if (t.length === 0) continue;
|
|
10859
|
-
let n = document.createElement("n-option-group"),
|
|
10860
|
-
|
|
10857
|
+
let n = document.createElement("n-option-group"), i = document.createElement("n-option-group-header");
|
|
10858
|
+
i.textContent = e.label, n.appendChild(i);
|
|
10861
10859
|
for (let [e, r] of t) {
|
|
10862
10860
|
let t = document.createElement("n-option");
|
|
10863
10861
|
t.setAttribute("value", e), t.setAttribute("label", r.label), t.textContent = r.label, n.appendChild(t);
|
|
10864
10862
|
}
|
|
10865
|
-
|
|
10863
|
+
r.appendChild(n);
|
|
10866
10864
|
}
|
|
10867
|
-
n.appendChild(
|
|
10865
|
+
n.appendChild(r), n.addEventListener("native:change", this.#be), t.appendChild(n);
|
|
10868
10866
|
for (let e of W) {
|
|
10869
10867
|
let n = document.createElement("n-button");
|
|
10870
10868
|
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);
|
|
10871
10869
|
}
|
|
10870
|
+
let i = document.createElement("n-button");
|
|
10871
|
+
i.setAttribute("variant", "ghost"), i.setAttribute("size", "sm"), i.title = "Auto-play presets on load", i.innerHTML = "<n-icon name=\"lightning\"></n-icon>", i.addEventListener("native:press", this.#ke), t.appendChild(i), this.#N = i;
|
|
10872
10872
|
let a = document.createElement("n-button");
|
|
10873
|
-
a.setAttribute("variant", "ghost"), a.setAttribute("size", "sm"), a.title = "
|
|
10874
|
-
let o = document.createElement("
|
|
10875
|
-
o.
|
|
10873
|
+
a.setAttribute("variant", "ghost"), a.setAttribute("size", "sm"), a.title = "Expand", a.innerHTML = "<n-icon name=\"arrows-out-simple\"></n-icon>", a.addEventListener("native:press", this.#_e), t.appendChild(a), this.#M = a;
|
|
10874
|
+
let o = document.createElement("div");
|
|
10875
|
+
o.className = "a2ui-split", this.#S = o;
|
|
10876
10876
|
let s = document.createElement("div");
|
|
10877
|
-
s.className = "a2ui-
|
|
10877
|
+
s.className = "a2ui-preview", this.#x = s;
|
|
10878
10878
|
let c = document.createElement("div");
|
|
10879
|
-
c.className = "a2ui-preview", this.#
|
|
10879
|
+
c.className = "a2ui-preview-content", s.appendChild(c), this.#b = c;
|
|
10880
10880
|
let l = document.createElement("div");
|
|
10881
|
-
l.className = "a2ui-
|
|
10882
|
-
let u = document.createElement("div");
|
|
10883
|
-
u.className = "a2ui-resize-handle", c.appendChild(u), s.appendChild(c);
|
|
10881
|
+
l.className = "a2ui-resize-handle", s.appendChild(l), o.appendChild(s);
|
|
10884
10882
|
for (let e of W) {
|
|
10885
10883
|
let t = document.createElement("n-pane");
|
|
10886
10884
|
t.dataset.panel = e, this.#n.value.has(e) || (t.hidden = !0);
|
|
@@ -10888,13 +10886,13 @@ var W = [
|
|
|
10888
10886
|
i.setAttribute("name", Re[e]), r.appendChild(i), n.appendChild(r);
|
|
10889
10887
|
let a = document.createElement("span");
|
|
10890
10888
|
a.textContent = Le[e], n.appendChild(a);
|
|
10891
|
-
let
|
|
10889
|
+
let s = document.createElement("aside");
|
|
10892
10890
|
if (e === "js" || e === "html" || e === "css") {
|
|
10893
10891
|
let t = document.createElement("n-button");
|
|
10894
|
-
t.setAttribute("variant", "ghost"), t.setAttribute("size", "sm"), t.title = "Reset to computed", t.innerHTML = "<n-icon name=\"arrow-counter-clockwise\"></n-icon>", t.addEventListener("native:press", this.#Ae(e)),
|
|
10892
|
+
t.setAttribute("variant", "ghost"), t.setAttribute("size", "sm"), t.title = "Reset to computed", t.innerHTML = "<n-icon name=\"arrow-counter-clockwise\"></n-icon>", t.addEventListener("native:press", this.#Ae(e)), s.appendChild(t);
|
|
10895
10893
|
}
|
|
10896
10894
|
let c = document.createElement("n-button");
|
|
10897
|
-
if (c.setAttribute("variant", "ghost"), c.setAttribute("size", "sm"), c.title = "Close pane", c.innerHTML = "<n-icon name=\"x\"></n-icon>", c.addEventListener("native:press", this.#je(e)),
|
|
10895
|
+
if (c.setAttribute("variant", "ghost"), c.setAttribute("size", "sm"), c.title = "Close pane", c.innerHTML = "<n-icon name=\"x\"></n-icon>", c.addEventListener("native:press", this.#je(e)), s.appendChild(c), n.appendChild(s), t.appendChild(n), e === "json-in") {
|
|
10898
10896
|
let e = document.createElement("n-toolbar");
|
|
10899
10897
|
e.setAttribute("variant", "plain"), e.setAttribute("size", "sm"), e.setAttribute("fill", "");
|
|
10900
10898
|
let n = this.#Q("Step back", "caret-left");
|
|
@@ -10930,17 +10928,17 @@ var W = [
|
|
|
10930
10928
|
}
|
|
10931
10929
|
let l = document.createElement("n-body");
|
|
10932
10930
|
if (t.appendChild(l), this.#w.set(e, l), e === "json-in" || e === "js" || e === "html" || e === "css") {
|
|
10933
|
-
let t = document.createElement("
|
|
10931
|
+
let t = document.createElement("n-editor");
|
|
10934
10932
|
t.setAttribute("line-numbers", "false"), l.appendChild(t), e === "json-in" ? this.#p = t : e === "js" ? this.#m = t : e === "html" ? this.#h = t : e === "css" && (this.#g = t);
|
|
10935
10933
|
} else if (e === "components") this.#v = l;
|
|
10936
10934
|
else if (e === "schema") {
|
|
10937
|
-
let e = document.createElement("
|
|
10935
|
+
let e = document.createElement("n-editor");
|
|
10938
10936
|
e.setAttribute("line-numbers", "false"), l.appendChild(e), this.#y = e;
|
|
10939
10937
|
}
|
|
10940
10938
|
let u = document.createElement("div");
|
|
10941
|
-
u.className = "a2ui-resize-handle", t.appendChild(u),
|
|
10939
|
+
u.className = "a2ui-resize-handle", t.appendChild(u), o.appendChild(t), this.#C.set(e, t);
|
|
10942
10940
|
}
|
|
10943
|
-
e.appendChild(t), this.append(e,
|
|
10941
|
+
e.appendChild(t), this.append(e, o);
|
|
10944
10942
|
}
|
|
10945
10943
|
#Q(e, t, n = !1) {
|
|
10946
10944
|
let r = document.createElement("n-button");
|
|
@@ -11210,7 +11208,7 @@ var W = [
|
|
|
11210
11208
|
r.className = "a2ui-map-editor-toolbar";
|
|
11211
11209
|
let i = document.createElement("n-button");
|
|
11212
11210
|
i.setAttribute("variant", "ghost"), i.setAttribute("size", "sm"), i.title = "Apply changes to stream", i.innerHTML = "<n-icon name=\"play\" weight=\"fill\"></n-icon>", i.addEventListener("native:press", () => this.#he(t)), r.appendChild(i), n.appendChild(r);
|
|
11213
|
-
let a = document.createElement("
|
|
11211
|
+
let a = document.createElement("n-editor");
|
|
11214
11212
|
a.setAttribute("line-numbers", "false"), n.appendChild(a), this.#_ = a, requestAnimationFrame(() => {
|
|
11215
11213
|
a.extensions = [v()], a.value = JSON.stringify(s, null, 2);
|
|
11216
11214
|
}), e.appendChild(n);
|
|
@@ -12191,15 +12189,13 @@ var Ze = class {
|
|
|
12191
12189
|
let e = this.#i.value;
|
|
12192
12190
|
if (e.length > 0 && !this.#b) {
|
|
12193
12191
|
let e = document.createElement("n-select");
|
|
12194
|
-
e.setAttribute("aria-label", "Select model"), e.setAttribute("data-role", "model-picker"), e.addEventListener("native:change", this.#M);
|
|
12195
|
-
let t = document.createElement("n-
|
|
12196
|
-
t.setAttribute("
|
|
12197
|
-
let n = document.createElement("n-
|
|
12198
|
-
n.setAttribute("
|
|
12199
|
-
let r =
|
|
12200
|
-
r
|
|
12201
|
-
let i = this.#y?.querySelector("[data-submit]");
|
|
12202
|
-
i ? this.#y?.insertBefore(e, i) : this.#y?.appendChild(e);
|
|
12192
|
+
e.setAttribute("aria-label", "Select model"), e.setAttribute("data-role", "model-picker"), e.setAttribute("variant", "ghost"), e.setAttribute("inline", ""), e.addEventListener("native:change", this.#M);
|
|
12193
|
+
let t = document.createElement("n-icon");
|
|
12194
|
+
t.setAttribute("name", "dots-three-outline-fill"), t.setAttribute("slot", "label");
|
|
12195
|
+
let n = document.createElement("n-listbox");
|
|
12196
|
+
n.setAttribute("popover", "manual"), e.append(t, n), this.#b = e, this.#x = n;
|
|
12197
|
+
let r = this.#y?.querySelector("[data-submit]");
|
|
12198
|
+
r ? this.#y?.insertBefore(e, r) : this.#y?.appendChild(e);
|
|
12203
12199
|
} else e.length === 0 && this.#b && this.#B();
|
|
12204
12200
|
}), this.addEffect(() => {
|
|
12205
12201
|
let e = this.#i.value, t = this.#a.value, n = this.#b, r = this.#x;
|
|
@@ -12441,9 +12437,9 @@ var Ze = class {
|
|
|
12441
12437
|
#F(t) {
|
|
12442
12438
|
let n = this.#h;
|
|
12443
12439
|
if (!n) return;
|
|
12444
|
-
let r = document.createElement("n-
|
|
12440
|
+
let r = document.createElement("n-agent-dialogue");
|
|
12445
12441
|
r.setAttribute("data-role", t.role), r.setAttribute("sender", t.role === "user" ? "You" : "Assistant");
|
|
12446
|
-
let i = document.createElement("n-
|
|
12442
|
+
let i = document.createElement("n-agent-dialogue-item");
|
|
12447
12443
|
i.setAttribute("data-role", t.role), i.setAttribute("message-id", `msg-${e()}`), i.setAttribute("status", "sent");
|
|
12448
12444
|
let a = document.createElement("n-chat-message-text");
|
|
12449
12445
|
a.content = t.message, i.appendChild(a), r.appendChild(i), n.appendChild(r);
|
|
@@ -12451,9 +12447,9 @@ var Ze = class {
|
|
|
12451
12447
|
#I(e) {
|
|
12452
12448
|
let t = this.#h;
|
|
12453
12449
|
if (!t) return null;
|
|
12454
|
-
let n = document.createElement("n-
|
|
12450
|
+
let n = document.createElement("n-agent-dialogue");
|
|
12455
12451
|
n.setAttribute("data-role", "assistant"), n.setAttribute("sender", "Assistant");
|
|
12456
|
-
let r = document.createElement("n-
|
|
12452
|
+
let r = document.createElement("n-agent-dialogue-item");
|
|
12457
12453
|
r.setAttribute("data-role", "assistant"), r.setAttribute("message-id", e), r.setAttribute("status", "streaming");
|
|
12458
12454
|
let i = document.createElement("n-chat-message-text");
|
|
12459
12455
|
return r.appendChild(i), n.appendChild(r), t.appendChild(n), r;
|
|
@@ -12900,19 +12896,19 @@ function dt(e, t, n) {
|
|
|
12900
12896
|
*
|
|
12901
12897
|
* On setup, non-avatar children are sorted into two wrapper divs:
|
|
12902
12898
|
* - `.n-chat-context` — non-message children (row 1)
|
|
12903
|
-
* - `.n-chat-bubbles` — `n-
|
|
12899
|
+
* - `.n-chat-bubbles` — `n-agent-dialogue-item` children (row 2)
|
|
12904
12900
|
*
|
|
12905
12901
|
* A MutationObserver routes dynamically added children into the
|
|
12906
12902
|
* correct wrapper automatically.
|
|
12907
12903
|
*
|
|
12908
12904
|
* ```html
|
|
12909
|
-
* <n-
|
|
12905
|
+
* <n-agent-dialogue role="assistant" sender="AI">
|
|
12910
12906
|
* <n-chat-avatar>AI</n-chat-avatar>
|
|
12911
12907
|
* <span class="reasoning">Thinking...</span>
|
|
12912
|
-
* <n-
|
|
12908
|
+
* <n-agent-dialogue-item role="assistant">
|
|
12913
12909
|
* <n-chat-message-text>Hello!</n-chat-message-text>
|
|
12914
|
-
* </n-
|
|
12915
|
-
* </n-
|
|
12910
|
+
* </n-agent-dialogue-item>
|
|
12911
|
+
* </n-agent-dialogue>
|
|
12916
12912
|
* ```
|
|
12917
12913
|
*
|
|
12918
12914
|
* @attr {string} role - `user` | `assistant` | `system`
|
|
@@ -12939,7 +12935,7 @@ var ft = class extends i {
|
|
|
12939
12935
|
super.setup(), this.#e.role = "group";
|
|
12940
12936
|
let e = this.getAttribute("sender");
|
|
12941
12937
|
e && this.setAttribute("aria-label", `Messages from ${e}`), this.#i(), this.#r = new MutationObserver((e) => {
|
|
12942
|
-
for (let t of e) for (let e of t.addedNodes) e instanceof Element && e.localName !== "n-chat-avatar" && (e === this.#t || e === this.#n || (e.localName === "n-
|
|
12938
|
+
for (let t of e) for (let e of t.addedNodes) e instanceof Element && e.localName !== "n-chat-avatar" && (e === this.#t || e === this.#n || (e.localName === "n-agent-dialogue-item" ? this.#n?.appendChild(e) : this.#t?.appendChild(e)));
|
|
12943
12939
|
}), this.#r.observe(this, { childList: !0 });
|
|
12944
12940
|
}
|
|
12945
12941
|
teardown() {
|
|
@@ -12959,7 +12955,7 @@ var ft = class extends i {
|
|
|
12959
12955
|
let t = document.createElement("div");
|
|
12960
12956
|
t.className = "n-chat-bubbles";
|
|
12961
12957
|
let n = Array.from(this.childNodes);
|
|
12962
|
-
for (let r of n) r instanceof Element && r.localName === "n-chat-avatar" || (r instanceof Element && r.localName === "n-
|
|
12958
|
+
for (let r of n) r instanceof Element && r.localName === "n-chat-avatar" || (r instanceof Element && r.localName === "n-agent-dialogue-item" ? t.appendChild(r) : e.appendChild(r));
|
|
12963
12959
|
this.appendChild(e), this.appendChild(t), this.#t = e, this.#n = t;
|
|
12964
12960
|
}
|
|
12965
12961
|
}, pt = class extends i {
|
|
@@ -14016,4 +14012,4 @@ var Bt = class {
|
|
|
14016
14012
|
});
|
|
14017
14013
|
}
|
|
14018
14014
|
};
|
|
14019
|
-
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,
|
|
14015
|
+
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, ft as NAgentDialogue, ut as NAgentDialogueItem, nt as NAgentInput, Ke as NAgentSession, Ye as NCatalog, ot as NChatAvatar, at as NChatFeed, tt as NChatInput, Ct as NChatInputStructured, gt as NChatMessageActivity, xt as NChatMessageGenUI, yt as NChatMessageSeed, pt as NChatMessageText, 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 };
|
package/dist/register.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* import '@nonoun/native-ai/register';
|
|
9
9
|
*/
|
|
10
10
|
export { NA2UI } from './a2ui/register.ts';
|
|
11
|
-
export { NChatInput, NChatPanel, NChatFeed, NChatAvatar,
|
|
11
|
+
export { NChatInput, NChatPanel, NChatFeed, NChatAvatar, NAgentDialogueItem, NAgentDialogue, NChatMessageText, NChatMessageActivity, NChatMessageSeed, NChatMessageGenUI, NChatInputStructured, } from './chat/register.ts';
|
|
12
12
|
//# sourceMappingURL=register.d.ts.map
|
package/dist/register.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAC9C,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EACL,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAC9C,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EACpD,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EACzD,oBAAoB,GACrB,MAAM,oBAAoB,CAAC"}
|