@hintergrund/ui 0.3.3 → 0.3.6

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 (87) hide show
  1. package/dist/BuilderAgentPane-Vj3NCGvZ.js +25916 -0
  2. package/dist/IntegrationHealth-D1HcBrQn.js +218 -0
  3. package/dist/admin.js +22766 -28480
  4. package/dist/anthropic-messages-D8Vp-Ncs.js +3772 -0
  5. package/dist/azure-openai-responses-DnjyYuiz.js +168 -0
  6. package/dist/builder.js +27 -22
  7. package/dist/config.types-DZ5yfeqq.js +20 -0
  8. package/dist/deferred-tools-nxpq94I4.js +34 -0
  9. package/dist/diagnostics-x5QOwca_.js +91 -0
  10. package/dist/error-body-pXgvw5vV.js +68 -0
  11. package/dist/font-pool/LICENSES.txt +22 -0
  12. package/dist/font-pool/inter.ttf +0 -0
  13. package/dist/font-pool/inter.woff2 +0 -0
  14. package/dist/font-pool/jetbrains-mono.ttf +0 -0
  15. package/dist/font-pool/jetbrains-mono.woff2 +0 -0
  16. package/dist/font-pool/lora.ttf +0 -0
  17. package/dist/font-pool/lora.woff2 +0 -0
  18. package/dist/font-pool/merriweather.ttf +0 -0
  19. package/dist/font-pool/merriweather.woff2 +0 -0
  20. package/dist/font-pool/montserrat.ttf +0 -0
  21. package/dist/font-pool/montserrat.woff2 +0 -0
  22. package/dist/font-pool/playfair-display.ttf +0 -0
  23. package/dist/font-pool/playfair-display.woff2 +0 -0
  24. package/dist/font-pool/poppins.ttf +0 -0
  25. package/dist/font-pool/poppins.woff2 +0 -0
  26. package/dist/font-pool/roboto.ttf +0 -0
  27. package/dist/font-pool/roboto.woff2 +0 -0
  28. package/dist/font-pool/space-grotesk.ttf +0 -0
  29. package/dist/font-pool/space-grotesk.woff2 +0 -0
  30. package/dist/font-pool/work-sans.ttf +0 -0
  31. package/dist/font-pool/work-sans.woff2 +0 -0
  32. package/dist/github-copilot-headers-pRo3v4t7.js +27 -0
  33. package/dist/global-xsR9gLDa.js +30568 -0
  34. package/dist/google-generative-ai-BmzNjEvl.js +291 -0
  35. package/dist/google-shared-CG2Lbh1z.js +8746 -0
  36. package/dist/google-vertex-Dfla93V_.js +329 -0
  37. package/dist/hash-BixfZjoG.js +21 -0
  38. package/dist/headers-CnTiKpOL.js +24 -0
  39. package/dist/json-parse-CxjAnWaM.js +231 -0
  40. package/dist/legacy-Zmnk-v81.js +14 -0
  41. package/dist/login.js +131 -146
  42. package/dist/mail.js +694 -789
  43. package/dist/mistral-conversations-DeDb7Gbd.js +558 -0
  44. package/dist/openai-ClxLHXsh.js +5371 -0
  45. package/dist/openai-codex-responses-usgOtWUT.js +909 -0
  46. package/dist/openai-completions-D_nFQy7A.js +730 -0
  47. package/dist/openai-prompt-cache-Bm8Re6Vv.js +17 -0
  48. package/dist/openai-responses-BqL3PFsb.js +192 -0
  49. package/dist/openai-responses-shared-BhQj78KM.js +481 -0
  50. package/dist/pi-messages-CRx0yqMp.js +268 -0
  51. package/dist/pi-user-agent-CsXkkH60.js +20 -0
  52. package/dist/provider-env-Cj6X7Wly.js +35 -0
  53. package/dist/provider-retry-BGImU1PV.js +68 -0
  54. package/dist/rolldown-runtime-nTTD767F.js +37 -0
  55. package/dist/setup.js +391 -418
  56. package/dist/transform-messages-DvxSeyBQ.js +383 -0
  57. package/dist/ui.css +2 -1
  58. package/package.json +6 -6
  59. package/dist/BuilderAgentPane-CwG29LOX.js +0 -13938
  60. package/dist/IntegrationHealth-G_4vzV66.js +0 -209
  61. package/dist/anthropic-messages-BmLfYiwX.js +0 -5605
  62. package/dist/azure-openai-responses-yf2M6GVe.js +0 -222
  63. package/dist/client-Cd7yMX39.js +0 -7860
  64. package/dist/config.types-iZoywORE.js +0 -15
  65. package/dist/deferred-tools-BZWMWBYN.js +0 -28
  66. package/dist/error-body-BUPcH4GF.js +0 -71
  67. package/dist/github-copilot-headers-B1RBGoZi.js +0 -21
  68. package/dist/global-CTQcFve1.js +0 -36177
  69. package/dist/google-generative-ai-DkzwUYzL.js +0 -264
  70. package/dist/google-shared-DTgKMtfJ.js +0 -11710
  71. package/dist/google-vertex-D2IzqvQM.js +0 -305
  72. package/dist/hash-DFlR084x.js +0 -14
  73. package/dist/headers-D4iLzGaS.js +0 -21
  74. package/dist/json-parse-LZdWp-Nd.js +0 -232
  75. package/dist/legacy-CckexQcJ.js +0 -5
  76. package/dist/mistral-conversations-CNfKG0tU.js +0 -513
  77. package/dist/openai-codex-responses-BLNjExaC.js +0 -947
  78. package/dist/openai-completions-46IVoF2N.js +0 -741
  79. package/dist/openai-prompt-cache-BJwqbEDx.js +0 -13
  80. package/dist/openai-responses-BfHoZFHI.js +0 -184
  81. package/dist/openai-responses-shared-DOTQAbCj.js +0 -477
  82. package/dist/pi-messages-fnW87Z4Z.js +0 -251
  83. package/dist/pi-user-agent-CUqx-qiX.js +0 -13
  84. package/dist/provider-env-D2VjEV3S.js +0 -26
  85. package/dist/provider-retry-BsigVlMg.js +0 -67
  86. package/dist/select-Cke4DYH1.js +0 -78
  87. package/dist/transform-messages-CsKsy6b4.js +0 -398
@@ -1,251 +0,0 @@
1
- import { D as x, I as f, J as y } from "./BuilderAgentPane-CwG29LOX.js";
2
- import { p as b, h as w } from "./headers-D4iLzGaS.js";
3
- import { p as I } from "./json-parse-LZdWp-Nd.js";
4
- import { g as k } from "./provider-env-D2VjEV3S.js";
5
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(r) {
6
- return Promise.resolve().then(r);
7
- } });
8
- class h extends Error {
9
- code;
10
- diagnosticDetails;
11
- constructor(t, n, e) {
12
- super(t), this.name = "PiMessagesResponseError", this.code = n, this.diagnosticDetails = e;
13
- }
14
- }
15
- function E(r) {
16
- try {
17
- const t = JSON.parse(r), n = t?.error;
18
- return t && typeof n == "object" && n !== null && !Array.isArray(n) ? t : void 0;
19
- } catch {
20
- return;
21
- }
22
- }
23
- function R(r) {
24
- return r.length > 8192 ? `${r.slice(0, 8192)}…` : r;
25
- }
26
- function _(r, t, n) {
27
- const e = typeof n?.error?.message == "string" ? n.error.message : void 0, s = typeof n?.error?.code == "string" ? n.error.code : void 0, a = e ?? t, o = s ? ` (${s})` : "";
28
- return `${r.status} ${r.statusText}: ${a}${o}`;
29
- }
30
- function M(r, t, n, e) {
31
- const s = E(e), a = typeof s?.error?.code == "string" ? s.error.code : void 0;
32
- return new h(_(n, e, s), a, {
33
- version: 1,
34
- provider: r.provider,
35
- model: r.id,
36
- url: t.toString(),
37
- status: n.status,
38
- statusText: n.statusText,
39
- error: s?.error,
40
- body: s ? void 0 : R(e),
41
- timestampMs: Date.now()
42
- });
43
- }
44
- function m() {
45
- return {
46
- input: 0,
47
- output: 0,
48
- cacheRead: 0,
49
- cacheWrite: 0,
50
- totalTokens: 0,
51
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }
52
- };
53
- }
54
- function p(r, t) {
55
- t && f(r, {
56
- type: "pi_messages_rewrite",
57
- timestamp: Date.now(),
58
- details: { ...t }
59
- });
60
- }
61
- function S(r) {
62
- const t = {
63
- role: "assistant",
64
- content: [],
65
- api: r.api,
66
- provider: r.provider,
67
- model: r.id,
68
- usage: m(),
69
- stopReason: "pending",
70
- timestamp: Date.now()
71
- }, n = /* @__PURE__ */ new Map();
72
- return (e) => {
73
- switch (e.type) {
74
- case "done":
75
- return Object.assign(t, {
76
- stopReason: e.reason,
77
- usage: e.usage,
78
- responseId: e.responseId
79
- }), p(t, e.rewrite), { type: "done", reason: e.reason, message: t };
80
- case "error":
81
- return Object.assign(t, {
82
- stopReason: e.reason,
83
- usage: e.usage,
84
- errorMessage: e.errorMessage,
85
- responseId: e.responseId
86
- }), p(t, e.rewrite), { type: "error", reason: e.reason, error: t };
87
- case "start":
88
- break;
89
- case "text_start":
90
- t.content[e.contentIndex] = { type: "text", text: "" };
91
- break;
92
- case "text_delta":
93
- t.content[e.contentIndex].text += e.delta;
94
- break;
95
- case "text_end":
96
- Object.assign(t.content[e.contentIndex], {
97
- text: e.content,
98
- textSignature: e.contentSignature
99
- });
100
- break;
101
- case "thinking_start":
102
- t.content[e.contentIndex] = { type: "thinking", thinking: "" };
103
- break;
104
- case "thinking_delta":
105
- t.content[e.contentIndex].thinking += e.delta;
106
- break;
107
- case "thinking_end":
108
- Object.assign(t.content[e.contentIndex], {
109
- thinking: e.content,
110
- thinkingSignature: e.contentSignature,
111
- redacted: e.redacted
112
- });
113
- break;
114
- case "toolcall_start":
115
- t.content[e.contentIndex] = {
116
- type: "toolCall",
117
- id: e.id,
118
- name: e.toolName,
119
- arguments: {}
120
- }, n.set(e.contentIndex, "");
121
- break;
122
- case "toolcall_delta": {
123
- const s = `${n.get(e.contentIndex) ?? ""}${e.delta}`;
124
- n.set(e.contentIndex, s), t.content[e.contentIndex].arguments = I(s);
125
- break;
126
- }
127
- case "toolcall_end":
128
- return Object.assign(t.content[e.contentIndex], e.toolCall), n.delete(e.contentIndex), {
129
- type: "toolcall_end",
130
- contentIndex: e.contentIndex,
131
- toolCall: t.content[e.contentIndex],
132
- partial: t
133
- };
134
- }
135
- return { ...e, partial: t };
136
- };
137
- }
138
- async function* T(r) {
139
- const t = new TextDecoder(), n = r.getReader();
140
- let e = "";
141
- try {
142
- for (; ; ) {
143
- const { done: s, value: a } = await n.read();
144
- e += s ? t.decode() : t.decode(a, { stream: !0 }), e = e.replace(/\r\n/g, `
145
- `);
146
- let o = e.indexOf(`
147
-
148
- `);
149
- for (; o !== -1; ) {
150
- const c = l(e.slice(0, o));
151
- c && (yield c), e = e.slice(o + 2), o = e.indexOf(`
152
-
153
- `);
154
- }
155
- if (s)
156
- break;
157
- }
158
- if (e.trim()) {
159
- const s = l(e);
160
- s && (yield s);
161
- }
162
- } finally {
163
- n.releaseLock();
164
- }
165
- }
166
- function l(r) {
167
- const t = r.split(`
168
- `).find((n) => n.startsWith("data:"))?.slice(5).trim();
169
- return t && t !== "[DONE]" ? JSON.parse(t) : void 0;
170
- }
171
- function P(r, t, n) {
172
- const e = n ? "aborted" : "error", s = {
173
- role: "assistant",
174
- content: [],
175
- api: r.api,
176
- provider: r.provider,
177
- model: r.id,
178
- usage: m(),
179
- stopReason: e,
180
- errorMessage: t instanceof Error ? t.message : String(t),
181
- timestamp: Date.now()
182
- };
183
- return !n && t instanceof h && f(s, y("pi_messages_response_failure", t, t.diagnosticDetails)), { type: "error", reason: e, error: s };
184
- }
185
- function D(r, t) {
186
- return r || (k("PI_CACHE_RETENTION", t) === "long" ? "long" : void 0);
187
- }
188
- const $ = (r, t, n) => {
189
- const e = new x(), s = S(r);
190
- return (async () => {
191
- try {
192
- const a = n?.apiKey;
193
- if (!a)
194
- throw new Error(`No API key provided for provider "${r.provider}"`);
195
- const o = new URL(`${r.baseUrl.replace(/\/+$/u, "")}/messages`);
196
- n?.debug && o.searchParams.set("debug", "1");
197
- let c = {
198
- model: r.id,
199
- context: t,
200
- options: {
201
- temperature: n?.temperature,
202
- maxTokens: n?.maxTokens,
203
- reasoning: n?.reasoning,
204
- cacheRetention: D(n?.cacheRetention, n?.env),
205
- sessionId: n?.sessionId,
206
- toolChoice: n?.toolChoice
207
- }
208
- };
209
- const g = await n?.onPayload?.(c, r);
210
- g !== void 0 && (c = g);
211
- const i = await (n?.fetch ?? globalThis.fetch)(o, {
212
- method: "POST",
213
- headers: {
214
- authorization: `Bearer ${a}`,
215
- accept: "text/event-stream",
216
- "content-type": "application/json",
217
- ...b(n?.headers)
218
- },
219
- body: JSON.stringify(c),
220
- signal: n?.signal
221
- });
222
- if (await n?.onResponse?.({ status: i.status, headers: w(i.headers) }, r), !i.ok) {
223
- const d = await i.text();
224
- throw M(r, o, i, d);
225
- }
226
- if (!i.body)
227
- throw new Error(`${r.provider} response has no body`);
228
- for await (const d of T(i.body)) {
229
- const u = s(d);
230
- if (e.push(u), u.type === "done" || u.type === "error")
231
- return;
232
- }
233
- throw new Error(`${r.provider} stream ended without a terminal event`);
234
- } catch (a) {
235
- e.push(P(r, a, n?.signal?.aborted ?? !1));
236
- }
237
- })(), e;
238
- }, A = (r, t, n) => {
239
- const e = n;
240
- return $(r, t, {
241
- ...n,
242
- reasoning: n?.reasoning,
243
- toolChoice: e?.toolChoice,
244
- debug: e?.debug
245
- });
246
- };
247
- export {
248
- h as PiMessagesResponseError,
249
- $ as stream,
250
- A as streamSimple
251
- };
@@ -1,13 +0,0 @@
1
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(o) {
2
- return Promise.resolve().then(o);
3
- } });
4
- function r() {
5
- return typeof process > "u" || !(process.versions?.node || process.versions?.bun) ? null : process.getBuiltinModule?.("node:os") ?? null;
6
- }
7
- const e = r();
8
- function s() {
9
- return e ? `pi (${e.platform()} ${e.release()}; ${e.arch()})` : "pi (browser)";
10
- }
11
- export {
12
- s as g
13
- };
@@ -1,26 +0,0 @@
1
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
2
- return Promise.resolve().then(e);
3
- } });
4
- let n = null;
5
- function i(e) {
6
- if (!(typeof process > "u" || !process.versions?.bun || Object.keys(process.env).length > 0)) {
7
- if (n === null) {
8
- n = /* @__PURE__ */ new Map();
9
- try {
10
- const { readFileSync: o } = require("node:fs"), t = o("/proc/self/environ", "utf-8");
11
- for (const r of t.split("\0")) {
12
- const s = r.indexOf("=");
13
- s > 0 && n.set(r.slice(0, s), r.slice(s + 1));
14
- }
15
- } catch {
16
- }
17
- }
18
- return n.get(e);
19
- }
20
- }
21
- function c(e, o) {
22
- return o?.[e] || (typeof process < "u" ? process.env[e] : void 0) || i(e) || void 0;
23
- }
24
- export {
25
- c as g
26
- };
@@ -1,67 +0,0 @@
1
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
2
- return Promise.resolve().then(e);
3
- } });
4
- const c = 6e4;
5
- function d(e) {
6
- return !(e instanceof Error) || !("status" in e) || !("headers" in e) ? !1 : (e.status === void 0 || typeof e.status == "number") && (e.headers === void 0 || e.headers instanceof Headers);
7
- }
8
- function l(e) {
9
- const t = e.headers?.get("x-should-retry");
10
- return t === "true" ? !0 : t === "false" ? !1 : e.status === void 0 ? !0 : e.status === 408 || e.status === 409 || e.status === 429 || typeof e.status == "number" && e.status >= 500;
11
- }
12
- function u(e, t, n) {
13
- const r = t ?? c;
14
- if (r > 0 && e > r)
15
- throw new Error(`Server requested ${Math.ceil(e / 1e3)}s retry delay (max: ${Math.ceil(r / 1e3)}s). ${n}`);
16
- return e;
17
- }
18
- function m(e, t, n) {
19
- const r = e.headers?.get("retry-after-ms");
20
- if (r) {
21
- const a = Number.parseFloat(r);
22
- if (!Number.isNaN(a))
23
- return u(a, n, e.message);
24
- }
25
- const s = e.headers?.get("retry-after");
26
- if (s) {
27
- const a = Number.parseFloat(s), f = Number.isNaN(a) ? Date.parse(s) - Date.now() : a * 1e3;
28
- return u(f, n, e.message);
29
- }
30
- return Math.min(0.5 * 2 ** t, 8) * 1e3 * (1 - Math.random() * 0.25);
31
- }
32
- function i() {
33
- const e = new Error("Request aborted");
34
- return e.name = "AbortError", e;
35
- }
36
- function y(e, t) {
37
- return new Promise((n, r) => {
38
- if (t?.aborted) {
39
- r(i());
40
- return;
41
- }
42
- const s = () => {
43
- clearTimeout(o), r(i());
44
- }, o = setTimeout(() => {
45
- t?.removeEventListener("abort", s), n();
46
- }, Math.max(0, e));
47
- t?.addEventListener("abort", s, { once: !0 });
48
- });
49
- }
50
- async function b(e, t = {}) {
51
- const n = t.maxRetries ?? 0;
52
- let r = n;
53
- for (; ; )
54
- try {
55
- return await e();
56
- } catch (s) {
57
- if (t.signal?.aborted)
58
- throw i();
59
- if (r <= 0 || !d(s) || !l(s))
60
- throw s;
61
- const o = n - r;
62
- r--, await y(m(s, o, t.maxRetryDelayMs), t.signal);
63
- }
64
- }
65
- export {
66
- b as r
67
- };
@@ -1,78 +0,0 @@
1
- import { x as _, bj as d, bK as b, bL as c, bM as m, bN as s, j as h } from "./global-CTQcFve1.js";
2
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
3
- return Promise.resolve().then(e);
4
- } });
5
- function v(e, r, f = !1) {
6
- if (e.multiple) {
7
- if (r == null)
8
- return;
9
- if (!d(r))
10
- return b();
11
- for (var n of e.options)
12
- n.selected = r.includes(t(n));
13
- return;
14
- }
15
- for (n of e.options) {
16
- var u = t(n);
17
- if (c(u, r)) {
18
- n.selected = !0;
19
- return;
20
- }
21
- }
22
- (!f || r !== void 0) && (e.selectedIndex = -1);
23
- }
24
- function p(e) {
25
- var r = new MutationObserver(() => {
26
- "__value" in e && v(e, e.__value);
27
- });
28
- r.observe(e, {
29
- // Listen to option element changes
30
- childList: !0,
31
- subtree: !0,
32
- // because of <optgroup>
33
- // Listen to option element value attribute changes
34
- // (doesn't get notified of select value changes,
35
- // because that property is not reflected as an attribute)
36
- attributes: !0,
37
- attributeFilter: ["value"]
38
- }), _(() => {
39
- r.disconnect();
40
- });
41
- }
42
- function q(e, r, f = r) {
43
- var n = /* @__PURE__ */ new WeakSet(), u = !0;
44
- m(e, "change", (a) => {
45
- var l = a ? "[selected]" : ":checked", i;
46
- if (e.multiple)
47
- i = [].map.call(e.querySelectorAll(l), t);
48
- else {
49
- var o = e.querySelector(l) ?? // will fall back to first non-disabled option if no option is selected
50
- e.querySelector("option:not([disabled])");
51
- i = o && t(o);
52
- }
53
- f(i), e.__value = i, s !== null && n.add(s);
54
- }), h(() => {
55
- var a = r();
56
- if (e === document.activeElement) {
57
- var l = (
58
- /** @type {Batch} */
59
- s
60
- );
61
- if (n.has(l))
62
- return;
63
- }
64
- if (v(e, a, u), u && a === void 0) {
65
- var i = e.querySelector(":checked");
66
- i !== null && (a = t(i), f(a));
67
- }
68
- e.__value = a, u = !1;
69
- }), p(e);
70
- }
71
- function t(e) {
72
- return "__value" in e ? e.__value : e.value;
73
- }
74
- export {
75
- q as b,
76
- p as i,
77
- v as s
78
- };