@hintergrund/ui 0.3.4 → 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 +5 -5
  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,264 +0,0 @@
1
- import { r as v, i as M, a as I, m as T, G as R, c as S, s as G, b as L, d as _ } from "./google-shared-DTgKMtfJ.js";
2
- import { D as P, H as E, G as A } from "./BuilderAgentPane-CwG29LOX.js";
3
- import { f as O, n as N } from "./error-body-BUPcH4GF.js";
4
- import { p as H } from "./headers-D4iLzGaS.js";
5
- import { b as W, s as $ } from "./transform-messages-CsKsy6b4.js";
6
- typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(t) {
7
- return Promise.resolve().then(t);
8
- } });
9
- let B = 0;
10
- const k = (t, a, n) => {
11
- const i = new P();
12
- return (async () => {
13
- const e = {
14
- role: "assistant",
15
- content: [],
16
- api: "google-generative-ai",
17
- provider: t.provider,
18
- model: t.id,
19
- usage: {
20
- input: 0,
21
- output: 0,
22
- cacheRead: 0,
23
- cacheWrite: 0,
24
- totalTokens: 0,
25
- cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 }
26
- },
27
- stopReason: "pending",
28
- timestamp: Date.now()
29
- };
30
- try {
31
- if (n?.fetch && n.fetch !== globalThis.fetch)
32
- throw new Error("Custom fetch is not supported by the Google Generative AI adapter");
33
- const g = n?.apiKey;
34
- if (!g)
35
- throw new Error(`No API key for provider: ${t.provider}`);
36
- const c = D(t, g, n?.headers);
37
- let s = U(t, a, n);
38
- const f = await n?.onPayload?.(s, t);
39
- f !== void 0 && (s = f);
40
- const h = await v(() => c.models.generateContentStream(s), n);
41
- i.push({ type: "start", partial: e });
42
- let o = null;
43
- const b = e.content, u = () => b.length - 1;
44
- for await (const l of h) {
45
- e.responseId ||= l.responseId;
46
- const p = l.candidates?.[0];
47
- if (p?.content?.parts)
48
- for (const r of p.content.parts) {
49
- if (r.text !== void 0) {
50
- const d = M(r);
51
- (!o || d && o.type !== "thinking" || !d && o.type !== "text") && (o && (o.type === "text" ? i.push({
52
- type: "text_end",
53
- contentIndex: b.length - 1,
54
- content: o.text,
55
- partial: e
56
- }) : i.push({
57
- type: "thinking_end",
58
- contentIndex: u(),
59
- content: o.thinking,
60
- partial: e
61
- })), d ? (o = { type: "thinking", thinking: "", thinkingSignature: void 0 }, e.content.push(o), i.push({ type: "thinking_start", contentIndex: u(), partial: e })) : (o = { type: "text", text: "" }, e.content.push(o), i.push({ type: "text_start", contentIndex: u(), partial: e }))), o.type === "thinking" ? (o.thinking += r.text, o.thinkingSignature = I(o.thinkingSignature, r.thoughtSignature), i.push({
62
- type: "thinking_delta",
63
- contentIndex: u(),
64
- delta: r.text,
65
- partial: e
66
- })) : (o.text += r.text, o.textSignature = I(o.textSignature, r.thoughtSignature), i.push({
67
- type: "text_delta",
68
- contentIndex: u(),
69
- delta: r.text,
70
- partial: e
71
- }));
72
- }
73
- if (r.functionCall) {
74
- o && (o.type === "text" ? i.push({
75
- type: "text_end",
76
- contentIndex: u(),
77
- content: o.text,
78
- partial: e
79
- }) : i.push({
80
- type: "thinking_end",
81
- contentIndex: u(),
82
- content: o.thinking,
83
- partial: e
84
- }), o = null);
85
- const d = r.functionCall.id, m = {
86
- type: "toolCall",
87
- id: !d || e.content.some((C) => C.type === "toolCall" && C.id === d) ? `${r.functionCall.name}_${Date.now()}_${++B}` : d,
88
- name: r.functionCall.name || "",
89
- arguments: r.functionCall.args ?? {},
90
- ...r.thoughtSignature && { thoughtSignature: r.thoughtSignature }
91
- };
92
- e.content.push(m), i.push({ type: "toolcall_start", contentIndex: u(), partial: e }), i.push({
93
- type: "toolcall_delta",
94
- contentIndex: u(),
95
- delta: JSON.stringify(m.arguments),
96
- partial: e
97
- }), i.push({ type: "toolcall_end", contentIndex: u(), toolCall: m, partial: e });
98
- }
99
- }
100
- p?.finishReason && (e.rawStopReason = p.finishReason, e.stopReason = T(p.finishReason), e.content.some((r) => r.type === "toolCall") && e.stopReason === "stop" && (e.stopReason = "toolUse")), l.usageMetadata && (e.usage = {
101
- input: (l.usageMetadata.promptTokenCount || 0) - (l.usageMetadata.cachedContentTokenCount || 0),
102
- output: (l.usageMetadata.candidatesTokenCount || 0) + (l.usageMetadata.thoughtsTokenCount || 0),
103
- cacheRead: l.usageMetadata.cachedContentTokenCount || 0,
104
- cacheWrite: 0,
105
- reasoning: l.usageMetadata.thoughtsTokenCount || 0,
106
- totalTokens: l.usageMetadata.totalTokenCount || 0,
107
- cost: {
108
- input: 0,
109
- output: 0,
110
- cacheRead: 0,
111
- cacheWrite: 0,
112
- total: 0
113
- }
114
- }, E(t, e.usage));
115
- }
116
- if (o && (o.type === "text" ? i.push({
117
- type: "text_end",
118
- contentIndex: u(),
119
- content: o.text,
120
- partial: e
121
- }) : i.push({
122
- type: "thinking_end",
123
- contentIndex: u(),
124
- content: o.thinking,
125
- partial: e
126
- })), n?.signal?.aborted)
127
- throw new Error("Request was aborted");
128
- if (e.stopReason === "pending")
129
- throw new Error("Google stream ended without a finish reason");
130
- if (e.stopReason === "aborted" || e.stopReason === "error") {
131
- const l = e.rawStopReason ? `Provider stopped with: ${e.rawStopReason}` : "An unknown error occurred";
132
- throw new Error(l);
133
- }
134
- i.push({ type: "done", reason: e.stopReason, message: e }), i.end();
135
- } catch (g) {
136
- for (const c of e.content)
137
- "index" in c && delete c.index;
138
- e.stopReason = n?.signal?.aborted ? "aborted" : "error", e.errorMessage = O(N(g)), i.push({ type: "error", reason: e.stopReason, error: e }), i.end();
139
- }
140
- })(), i;
141
- }, Z = (t, a, n) => {
142
- const i = n?.apiKey;
143
- if (!i)
144
- throw new Error(`No API key for provider: ${t.provider}`);
145
- const e = W(t, a, n, i);
146
- if (!n?.reasoning)
147
- return k(t, a, { ...e, thinking: { enabled: !1 } });
148
- const g = A(t, n.reasoning), c = g === "off" ? "high" : g, s = t;
149
- return w(s) || x(s) || y(s) ? k(t, a, {
150
- ...e,
151
- thinking: {
152
- enabled: !0,
153
- level: q(c, s)
154
- }
155
- }) : k(t, a, {
156
- ...e,
157
- thinking: {
158
- enabled: !0,
159
- budgetTokens: j(s, c, n.thinkingBudgets)
160
- }
161
- });
162
- };
163
- function D(t, a, n) {
164
- const i = {};
165
- t.baseUrl && (i.baseUrl = t.baseUrl, i.apiVersion = "");
166
- const e = H({ ...t.headers, ...n });
167
- return e && (i.headers = e), new R({
168
- apiKey: a,
169
- httpOptions: Object.keys(i).length > 0 ? i : void 0
170
- });
171
- }
172
- function U(t, a, n = {}) {
173
- const i = S(t, a), e = {};
174
- n.temperature !== void 0 && (e.temperature = n.temperature), n.maxTokens !== void 0 && (e.maxOutputTokens = n.maxTokens);
175
- const g = G(t.id), c = a.tools?.length ? L(a.tools, n.toolChoice, g) : void 0, s = {
176
- ...Object.keys(e).length > 0 && e,
177
- ...a.systemPrompt && { systemInstruction: $(a.systemPrompt) },
178
- ...a.tools && a.tools.length > 0 && {
179
- tools: _(a.tools, !1, g)
180
- },
181
- ...c !== void 0 && {
182
- toolConfig: { functionCallingConfig: { mode: c } }
183
- }
184
- };
185
- if (n.thinking?.enabled && t.reasoning) {
186
- const h = { includeThoughts: !0 };
187
- n.thinking.level !== void 0 ? h.thinkingLevel = n.thinking.level : n.thinking.budgetTokens !== void 0 && (h.thinkingBudget = n.thinking.budgetTokens), s.thinkingConfig = h;
188
- } else t.reasoning && n.thinking && !n.thinking.enabled && (s.thinkingConfig = K(t));
189
- if (n.signal) {
190
- if (n.signal.aborted)
191
- throw new Error("Request aborted");
192
- s.abortSignal = n.signal;
193
- }
194
- return {
195
- model: t.id,
196
- contents: i,
197
- config: s
198
- };
199
- }
200
- function y(t) {
201
- return /gemma-?4/.test(t.id.toLowerCase());
202
- }
203
- function w(t) {
204
- return /gemini-3(?:\.\d+)?-pro/.test(t.id.toLowerCase());
205
- }
206
- function x(t) {
207
- const a = t.id.toLowerCase();
208
- return /gemini-3(?:\.\d+)?-flash/.test(a) || a === "gemini-flash-latest" || a === "gemini-flash-lite-latest";
209
- }
210
- function K(t) {
211
- return w(t) ? { thinkingLevel: "LOW" } : x(t) ? { thinkingLevel: "MINIMAL" } : y(t) ? { thinkingLevel: "MINIMAL" } : { thinkingBudget: 0 };
212
- }
213
- function q(t, a) {
214
- if (w(a))
215
- switch (t) {
216
- case "minimal":
217
- case "low":
218
- return "LOW";
219
- case "medium":
220
- case "high":
221
- return "HIGH";
222
- }
223
- if (y(a))
224
- switch (t) {
225
- case "minimal":
226
- case "low":
227
- return "MINIMAL";
228
- case "medium":
229
- case "high":
230
- return "HIGH";
231
- }
232
- switch (t) {
233
- case "minimal":
234
- return "MINIMAL";
235
- case "low":
236
- return "LOW";
237
- case "medium":
238
- return "MEDIUM";
239
- case "high":
240
- return "HIGH";
241
- }
242
- }
243
- function j(t, a, n) {
244
- return n?.[a] !== void 0 ? n[a] : t.id.includes("2.5-pro") ? {
245
- minimal: 128,
246
- low: 2048,
247
- medium: 8192,
248
- high: 32768
249
- }[a] : t.id.includes("2.5-flash-lite") ? {
250
- minimal: 512,
251
- low: 2048,
252
- medium: 8192,
253
- high: 24576
254
- }[a] : t.id.includes("2.5-flash") ? {
255
- minimal: 128,
256
- low: 2048,
257
- medium: 8192,
258
- high: 24576
259
- }[a] : -1;
260
- }
261
- export {
262
- k as stream,
263
- Z as streamSimple
264
- };