@burdenoff/fe-libs 2026.1027.2 → 2026.1027.3

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 (50) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +8 -5
  2. package/dist/node_modules/@openuidev/devtools/dist/index.js +74 -0
  3. package/dist/node_modules/@openuidev/lang-core/dist/index.js +3779 -0
  4. package/dist/node_modules/@openuidev/lang-core/dist/shared-Dzgc28Wo.js +39 -0
  5. package/dist/node_modules/@openuidev/observability/dist/index.js +30 -0
  6. package/dist/node_modules/@openuidev/react-lang/dist/exports-CLfR509v.js +946 -0
  7. package/dist/node_modules/@openuidev/react-lang/dist/index.js +25 -0
  8. package/dist/node_modules/ci-info/index.js +34 -0
  9. package/dist/node_modules/ci-info/vendors.json.js +331 -0
  10. package/dist/node_modules/react-dom/cjs/react-dom-client.development.js +11168 -0
  11. package/dist/node_modules/react-dom/cjs/react-dom-client.production.js +7384 -0
  12. package/dist/node_modules/react-dom/client.js +19 -0
  13. package/dist/node_modules/scheduler/cjs/scheduler.development.js +203 -0
  14. package/dist/node_modules/scheduler/cjs/scheduler.production.js +203 -0
  15. package/dist/node_modules/scheduler/index.js +10 -0
  16. package/dist/node_modules/zod/v4/classic/errors.js +23 -0
  17. package/dist/node_modules/zod/v4/classic/iso.js +31 -0
  18. package/dist/node_modules/zod/v4/classic/parse.js +6 -0
  19. package/dist/node_modules/zod/v4/classic/schemas.js +339 -0
  20. package/dist/node_modules/zod/v4/core/api.js +491 -0
  21. package/dist/node_modules/zod/v4/core/checks.js +283 -0
  22. package/dist/node_modules/zod/v4/core/core.js +44 -0
  23. package/dist/node_modules/zod/v4/core/doc.js +23 -0
  24. package/dist/node_modules/zod/v4/core/errors.js +41 -0
  25. package/dist/node_modules/zod/v4/core/json-schema-processors.js +306 -0
  26. package/dist/node_modules/zod/v4/core/parse.js +68 -0
  27. package/dist/node_modules/zod/v4/core/regexes.js +25 -0
  28. package/dist/node_modules/zod/v4/core/registries.js +40 -0
  29. package/dist/node_modules/zod/v4/core/schemas.js +796 -0
  30. package/dist/node_modules/zod/v4/core/to-json-schema.js +222 -0
  31. package/dist/node_modules/zod/v4/core/util.js +266 -0
  32. package/dist/node_modules/zod/v4/core/versions.js +8 -0
  33. package/dist/shared/assistant/index.d.ts +4 -0
  34. package/dist/shared/assistant/openui/AssistantOpenUiBlock.d.ts +19 -0
  35. package/dist/shared/assistant/openui/AssistantOpenUiBlock.js +26 -0
  36. package/dist/shared/assistant/openui/AssistantRichContent.d.ts +13 -0
  37. package/dist/shared/assistant/openui/AssistantRichContent.js +37 -0
  38. package/dist/shared/assistant/openui/OpenUiBoundary.d.ts +26 -0
  39. package/dist/shared/assistant/openui/OpenUiBoundary.js +13 -0
  40. package/dist/shared/assistant/openui/generativeUi.d.ts +6 -0
  41. package/dist/shared/assistant/openui/generativeUi.js +12 -0
  42. package/dist/shared/assistant/openui/library.d.ts +2 -0
  43. package/dist/shared/assistant/openui/library.js +191 -0
  44. package/dist/shared/assistant/openui/limits.d.ts +12 -0
  45. package/dist/shared/assistant/openui/limits.js +7 -0
  46. package/dist/shared/assistant/openui/segments.d.ts +40 -0
  47. package/dist/shared/assistant/openui/segments.js +52 -0
  48. package/dist/shared/assistant/ui/AssistantMessageItem.js +115 -109
  49. package/dist/shared-assistant.js +108 -104
  50. package/package.json +2 -1
@@ -0,0 +1,191 @@
1
+ import { barWidthPercent as e } from "./limits.js";
2
+ import { array as t, number as n, object as r, string as i, union as a } from "../../../node_modules/zod/v4/classic/schemas.js";
3
+ import { createLibrary$1 as o, defineComponent$1 as s, useRenderNode as c } from "../../../node_modules/@openuidev/react-lang/dist/exports-CLfR509v.js";
4
+ import "../../../node_modules/@openuidev/react-lang/dist/index.js";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ //#region src/shared/assistant/openui/library.tsx
7
+ var d = ({ items: e, limit: t, className: n, testId: r, cellClassName: i }) => {
8
+ let a = c();
9
+ return /* @__PURE__ */ l("div", {
10
+ className: n,
11
+ "data-testid": r,
12
+ children: e.slice(0, t).map((e, t) => /* @__PURE__ */ l("div", {
13
+ className: i,
14
+ children: a(e)
15
+ }, t))
16
+ });
17
+ }, f = a([i(), n()]), p = s({
18
+ name: "Stat",
19
+ description: "One headline figure: a short label, its value, and an optional one-line hint.",
20
+ props: r({
21
+ label: i().describe("What the figure measures, e.g. \"Open tasks\""),
22
+ value: f.describe("The figure itself, e.g. 12 or \"98%\""),
23
+ hint: i().optional().describe("Optional context, e.g. \"+3 since yesterday\"")
24
+ }),
25
+ component: ({ props: e }) => /* @__PURE__ */ u("div", {
26
+ className: "min-w-0 rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5",
27
+ "data-testid": "assistant-openui-stat",
28
+ children: [
29
+ /* @__PURE__ */ l("div", {
30
+ className: "truncate text-[12px] text-text-muted",
31
+ children: e.label
32
+ }),
33
+ /* @__PURE__ */ l("div", {
34
+ className: "mt-0.5 truncate text-xl font-semibold leading-tight text-text-primary",
35
+ children: String(e.value)
36
+ }),
37
+ e.hint ? /* @__PURE__ */ l("div", {
38
+ className: "mt-0.5 truncate text-[12px] text-text-muted",
39
+ children: e.hint
40
+ }) : null
41
+ ]
42
+ })
43
+ }), m = s({
44
+ name: "StatGrid",
45
+ description: "A row of up to 8 Stat cards for headline numbers.",
46
+ props: r({ stats: t(p.ref) }),
47
+ component: ({ props: e }) => /* @__PURE__ */ l(d, {
48
+ className: "grid grid-cols-2 gap-2",
49
+ testId: "assistant-openui-stat-grid",
50
+ items: e.stats,
51
+ limit: 8,
52
+ cellClassName: "min-w-0"
53
+ })
54
+ }), h = s({
55
+ name: "DataTable",
56
+ description: "A table. columns are the header labels (max 8); rows are arrays of cells in the same order (max 50 rows).",
57
+ props: r({
58
+ columns: t(i()),
59
+ rows: t(t(f)),
60
+ caption: i().optional()
61
+ }),
62
+ component: ({ props: e }) => {
63
+ let t = e.columns.slice(0, 8), n = e.rows.slice(0, 50);
64
+ return /* @__PURE__ */ l("div", {
65
+ className: "overflow-x-auto rounded-lg border border-border-subtle",
66
+ "data-testid": "assistant-openui-table",
67
+ children: /* @__PURE__ */ u("table", {
68
+ className: "w-full border-collapse text-[0.9em]",
69
+ children: [
70
+ e.caption ? /* @__PURE__ */ l("caption", {
71
+ className: "px-2 py-1.5 text-left text-[12px] text-text-muted",
72
+ children: e.caption
73
+ }) : null,
74
+ /* @__PURE__ */ l("thead", {
75
+ className: "bg-bg-sunken",
76
+ children: /* @__PURE__ */ l("tr", { children: t.map((e, t) => /* @__PURE__ */ l("th", {
77
+ scope: "col",
78
+ className: "px-2 py-1.5 text-left font-semibold text-text-primary",
79
+ children: e
80
+ }, t)) })
81
+ }),
82
+ /* @__PURE__ */ l("tbody", { children: n.map((e, n) => /* @__PURE__ */ l("tr", {
83
+ className: "border-t border-border-subtle",
84
+ children: t.map((t, n) => /* @__PURE__ */ l("td", {
85
+ className: "px-2 py-1.5 align-top text-text-primary",
86
+ children: e[n] === void 0 ? "" : String(e[n])
87
+ }, n))
88
+ }, n)) })
89
+ ]
90
+ })
91
+ });
92
+ }
93
+ }), g = s({
94
+ name: "Bar",
95
+ description: "One bar of a BarChart: a label and a non-negative number.",
96
+ props: r({
97
+ label: i(),
98
+ value: n()
99
+ }),
100
+ component: ({ props: e }) => /* @__PURE__ */ u("span", { children: [
101
+ e.label,
102
+ ": ",
103
+ e.value
104
+ ] })
105
+ }), _ = s({
106
+ name: "BarChart",
107
+ description: "A horizontal bar chart comparing up to 20 values. Use for rankings and breakdowns.",
108
+ props: r({
109
+ title: i().optional(),
110
+ bars: t(g.ref)
111
+ }),
112
+ component: ({ props: t }) => {
113
+ let n = t.bars.slice(0, 20).map((e) => e.props), r = Math.max(0, ...n.map((e) => Number.isFinite(e.value) ? e.value : 0));
114
+ return /* @__PURE__ */ u("figure", {
115
+ className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
116
+ "data-testid": "assistant-openui-bar-chart",
117
+ children: [t.title ? /* @__PURE__ */ l("figcaption", {
118
+ className: "mb-2 text-[13px] font-semibold text-text-primary",
119
+ children: t.title
120
+ }) : null, /* @__PURE__ */ l("ul", {
121
+ className: "space-y-1.5",
122
+ children: n.map((t, n) => /* @__PURE__ */ u("li", {
123
+ className: "text-[12px]",
124
+ children: [/* @__PURE__ */ u("div", {
125
+ className: "mb-0.5 flex justify-between gap-2 text-text-primary",
126
+ children: [/* @__PURE__ */ l("span", {
127
+ className: "min-w-0 truncate",
128
+ children: t.label
129
+ }), /* @__PURE__ */ l("span", {
130
+ className: "shrink-0 text-text-muted",
131
+ children: t.value
132
+ })]
133
+ }), /* @__PURE__ */ l("div", {
134
+ className: "h-2 overflow-hidden rounded-full bg-bg-sunken",
135
+ children: /* @__PURE__ */ l("div", {
136
+ className: "h-full rounded-full bg-action-primary-bg",
137
+ style: { width: `${e(t.value, r)}%` }
138
+ })
139
+ })]
140
+ }, n))
141
+ })]
142
+ });
143
+ }
144
+ }), v = s({
145
+ name: "Callout",
146
+ description: "A short highlighted note: a one-line title and a sentence or two of body.",
147
+ props: r({
148
+ title: i(),
149
+ body: i().optional()
150
+ }),
151
+ component: ({ props: e }) => /* @__PURE__ */ u("div", {
152
+ className: "rounded-lg border border-border-default bg-bg-sunken px-3 py-2",
153
+ role: "note",
154
+ "data-testid": "assistant-openui-callout",
155
+ children: [/* @__PURE__ */ l("div", {
156
+ className: "text-[13px] font-semibold text-text-primary",
157
+ children: e.title
158
+ }), e.body ? /* @__PURE__ */ l("div", {
159
+ className: "mt-0.5 text-[13px] leading-relaxed text-text-muted",
160
+ children: e.body
161
+ }) : null]
162
+ })
163
+ }), y = o({
164
+ components: [
165
+ s({
166
+ name: "Stack",
167
+ description: "The root: lays out up to 12 blocks (StatGrid, DataTable, BarChart, Callout) top to bottom.",
168
+ props: r({ children: t(a([
169
+ m.ref,
170
+ h.ref,
171
+ _.ref,
172
+ v.ref
173
+ ])) }),
174
+ component: ({ props: e }) => /* @__PURE__ */ l(d, {
175
+ className: "my-2 flex flex-col gap-2",
176
+ testId: "assistant-openui-stack",
177
+ items: e.children,
178
+ limit: 12
179
+ })
180
+ }),
181
+ m,
182
+ p,
183
+ h,
184
+ _,
185
+ g,
186
+ v
187
+ ],
188
+ root: "Stack"
189
+ });
190
+ //#endregion
191
+ export { y as default };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Size limits for generative-UI blocks (BOFF-9710). A reply is untrusted model
3
+ * output, so every collection the library draws is capped; kept apart from the
4
+ * library so they can be read without loading the OpenUI runtime.
5
+ */
6
+ export declare const MAX_STATS = 8;
7
+ export declare const MAX_TABLE_COLUMNS = 8;
8
+ export declare const MAX_TABLE_ROWS = 50;
9
+ export declare const MAX_BARS = 20;
10
+ export declare const MAX_STACK_CHILDREN = 12;
11
+ /** Bar length as a percentage of the largest value; zero, negative or non-finite draws no bar. */
12
+ export declare function barWidthPercent(value: number, max: number): number;
@@ -0,0 +1,7 @@
1
+ //#region src/shared/assistant/openui/limits.ts
2
+ var e = 8, t = 8, n = 50, r = 20, i = 12;
3
+ function a(e, t) {
4
+ return !Number.isFinite(e) || e <= 0 || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(100, Math.round(e / t * 100));
5
+ }
6
+ //#endregion
7
+ export { r as MAX_BARS, i as MAX_STACK_CHILDREN, e as MAX_STATS, t as MAX_TABLE_COLUMNS, n as MAX_TABLE_ROWS, a as barWidthPercent };
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Splits an assistant reply into markdown and generative-UI segments (BOFF-9710).
3
+ *
4
+ * The agent keeps writing ordinary markdown and puts a structured answer in a
5
+ * fenced block whose info string is `openui`:
6
+ *
7
+ * Here is the breakdown.
8
+ *
9
+ * ```openui
10
+ * root = Stack([StatGrid([Stat("Open", "12")])])
11
+ * ```
12
+ *
13
+ * Everything outside such a fence is returned untouched, so a reply with no
14
+ * block is a single markdown segment and renders exactly as it did before.
15
+ *
16
+ * Only a fence that STARTS a line counts. A block quoted inside another code
17
+ * fence (a reply explaining the syntax) is therefore left as text.
18
+ */
19
+ export type OpenUiSegment = {
20
+ readonly kind: 'markdown';
21
+ readonly text: string;
22
+ }
23
+ /**
24
+ * `complete` is false when the closing fence has not arrived — a turn still
25
+ * streaming, or a model that stopped mid-block. The caller decides whether to
26
+ * show a placeholder or the raw source.
27
+ */
28
+ | {
29
+ readonly kind: 'openui';
30
+ readonly source: string;
31
+ readonly complete: boolean;
32
+ };
33
+ /** Cheap pre-check so the common, no-block reply skips line splitting. */
34
+ export declare function hasOpenUiBlock(content: string): boolean;
35
+ export declare function splitOpenUiSegments(content: string): OpenUiSegment[];
36
+ /**
37
+ * The reply as text for anything that cannot draw UI — Copy, Listen, export. A
38
+ * block becomes `placeholder` (or nothing) rather than raw component syntax.
39
+ */
40
+ export declare function stripOpenUiBlocks(content: string, placeholder?: string): string;
@@ -0,0 +1,52 @@
1
+ //#region src/shared/assistant/openui/segments.ts
2
+ var e = /^[ \t]{0,3}```openui[ \t]*$/, t = /^[ \t]{0,3}(`{3,}|~{3,})/, n = /^[ \t]{0,3}(`{3,}|~{3,})[ \t]*$/;
3
+ function r(e, t) {
4
+ let r = n.exec(e)?.[1];
5
+ return r !== void 0 && r[0] === t[0] && r.length >= t.length;
6
+ }
7
+ function i(e) {
8
+ return e.includes("```openui");
9
+ }
10
+ function a(n) {
11
+ if (!i(n)) return n ? [{
12
+ kind: "markdown",
13
+ text: n
14
+ }] : [];
15
+ let a = [], o = [], s = [], c = null, l = "", u = () => {
16
+ let e = o.join("\n");
17
+ o.length = 0, e.trim() && a.push({
18
+ kind: "markdown",
19
+ text: e
20
+ });
21
+ };
22
+ for (let i of n.split("\n")) {
23
+ if (c === "openui") {
24
+ r(i, "```") ? (a.push({
25
+ kind: "openui",
26
+ source: s.join("\n"),
27
+ complete: !0
28
+ }), s.length = 0, c = null) : s.push(i);
29
+ continue;
30
+ }
31
+ if (c === "other") {
32
+ o.push(i), r(i, l) && (c = null);
33
+ continue;
34
+ }
35
+ if (e.test(i)) {
36
+ u(), c = "openui";
37
+ continue;
38
+ }
39
+ let n = t.exec(i)?.[1];
40
+ n !== void 0 && (c = "other", l = n), o.push(i);
41
+ }
42
+ return c === "openui" ? a.push({
43
+ kind: "openui",
44
+ source: s.join("\n"),
45
+ complete: !1
46
+ }) : u(), a;
47
+ }
48
+ function o(e, t = "") {
49
+ return i(e) ? a(e).map((e) => e.kind === "markdown" ? e.text : t).filter((e) => e !== "").join("\n\n") : e;
50
+ }
51
+ //#endregion
52
+ export { i as hasOpenUiBlock, a as splitOpenUiSegments, o as stripOpenUiBlocks };