@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,398 +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
- function Y(e) {
5
- return e.replace(new RegExp("[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?<![\\uD800-\\uDBFF])[\\uDC00-\\uDFFF]", "g"), "");
6
- }
7
- class f extends Error {
8
- }
9
- const v = [
10
- "$ref",
11
- "$defs",
12
- "definitions",
13
- "allOf",
14
- "oneOf",
15
- "patternProperties",
16
- "dependentSchemas",
17
- "dependencies",
18
- "unevaluatedProperties",
19
- "propertyNames",
20
- "contains",
21
- "prefixItems",
22
- "not",
23
- "if",
24
- "then",
25
- "else"
26
- ];
27
- function y(e) {
28
- return typeof e == "object" && e !== null && !Array.isArray(e);
29
- }
30
- function D(e) {
31
- if (!y(e))
32
- return !1;
33
- const r = typeof e.type == "string" ? [e.type] : Array.isArray(e.type) ? e.type : [];
34
- return r.includes("object") || r.includes("array") || e.properties !== void 0 || e.items !== void 0;
35
- }
36
- function N(e) {
37
- return y(e) ? e.type === "null" || Array.isArray(e.type) && e.type.includes("null") || e.const === null || Array.isArray(e.enum) && e.enum.includes(null) ? !0 : Array.isArray(e.anyOf) && e.anyOf.some((r) => N(r)) : !1;
38
- }
39
- function T(e) {
40
- if (!y(e))
41
- throw new f("boolean schemas are unsupported");
42
- for (const i of v)
43
- if (e[i] !== void 0)
44
- throw new f(`${i} schemas are unsupported`);
45
- if (e.anyOf !== void 0) {
46
- if (!Array.isArray(e.anyOf) || e.anyOf.length === 0)
47
- throw new f("anyOf must contain at least one schema");
48
- for (const i of e.anyOf) {
49
- if (D(i))
50
- throw new f("object and array unions are unsupported");
51
- T(i);
52
- }
53
- }
54
- if (e.items !== void 0) {
55
- if (Array.isArray(e.items))
56
- throw new f("tuple schemas are unsupported");
57
- T(e.items);
58
- }
59
- const r = e.type === "object";
60
- if (e.properties !== void 0 && !r)
61
- throw new f("properties require type object");
62
- if (!r)
63
- return;
64
- if (e.additionalProperties !== void 0 && e.additionalProperties !== !1)
65
- throw new f("schema-valued or true additionalProperties is unsupported");
66
- if (e.properties !== void 0 && !y(e.properties))
67
- throw new f("object properties must be a schema map");
68
- if (e.required !== void 0 && (!Array.isArray(e.required) || e.required.some((i) => typeof i != "string")))
69
- throw new f("object required must be a string array");
70
- const t = e.properties ?? {}, n = Object.keys(t), o = new Set(Array.isArray(e.required) ? e.required : []);
71
- if ([...o].some((i) => !n.includes(i)))
72
- throw new f("required contains an unknown property");
73
- for (const [i, d] of Object.entries(t))
74
- T(d), !o.has(i) && !N(d) && (t[i] = { anyOf: [d, { type: "null" }] });
75
- e.required = n, e.additionalProperties = !1;
76
- }
77
- function R(e) {
78
- const r = structuredClone(e);
79
- if (!y(r))
80
- throw new f("root schema must have type object");
81
- if (T(r), r.type !== "object")
82
- throw new f("root schema must have type object");
83
- return r;
84
- }
85
- function X(e, r) {
86
- return r === !0 ? R(e.parameters) : e.parameters;
87
- }
88
- function Q(e, r, t) {
89
- const n = r[t];
90
- if (typeof n != "string")
91
- throw new Error(`Grammar tool call "${e}" requires argument "${t}" to be a string.`);
92
- return n;
93
- }
94
- function Z(e, r, t, n) {
95
- if (e.closed) {
96
- if (n && t === e.input)
97
- return;
98
- throw new Error(`grammar tool input for property "${r}" changed after it was closed`);
99
- }
100
- if (!t.startsWith(e.input))
101
- throw new Error(`grammar tool input for property "${r}" changed non-monotonically`);
102
- const o = t.slice(e.input.length);
103
- if (!n && o.length === 0)
104
- return;
105
- let i = "";
106
- return e.started || (i += `{${JSON.stringify(r)}:"`, e.started = !0), i += JSON.stringify(o).slice(1, -1), e.input = t, n && (i += '"}', e.closed = !0), i;
107
- }
108
- function j(e) {
109
- const r = e.parameters;
110
- if (r.type !== "object")
111
- throw new Error("grammar constrained sampling requires an object parameter schema");
112
- if (!Array.isArray(r.required) || r.required.length !== 1 || typeof r.required[0] != "string")
113
- throw new Error("grammar constrained sampling requires exactly one required string property");
114
- const t = r.required[0];
115
- if (!r.properties?.[t])
116
- throw new Error(`grammar constrained sampling requires a properties entry for ${t}`);
117
- if (r.properties[t]?.type !== "string")
118
- throw new Error(`grammar constrained sampling property ${t} must have type string`);
119
- return t;
120
- }
121
- function ee(e, r) {
122
- const t = e.constrainedSampling;
123
- if (!(!t || t.type !== "json_schema")) {
124
- if (r)
125
- try {
126
- return R(e.parameters), !0;
127
- } catch (n) {
128
- if (!(n instanceof f))
129
- throw n;
130
- if (t.strict !== "require")
131
- return;
132
- throw new Error(`Tool "${e.name}" requires JSON-schema constrained sampling, but ${n.message}.`);
133
- }
134
- if (t.strict === "require")
135
- throw new Error(`Tool "${e.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`);
136
- }
137
- }
138
- function b(e, r) {
139
- const t = e.constrainedSampling;
140
- if (!t || t.type !== "grammar" || !r)
141
- return;
142
- const n = t.variants.openai_lark, o = t.variants.openai_regex, i = typeof n == "string" && n.trim().length > 0, d = typeof o == "string" && o.trim().length > 0;
143
- if (!i && !d)
144
- throw new Error(`Tool "${e.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);
145
- try {
146
- return {
147
- format: i ? "lark" : "regex",
148
- definition: i ? n : o,
149
- inputProperty: j(e)
150
- };
151
- } catch (l) {
152
- const p = l instanceof Error ? l.message : String(l);
153
- throw new Error(`Tool "${e.name}" cannot use grammar constrained sampling: ${p}.`);
154
- }
155
- }
156
- function te(e, r) {
157
- const t = /* @__PURE__ */ new Map();
158
- for (const n of e ?? []) {
159
- const o = b(n, r);
160
- o && t.set(n.name, o.inputProperty);
161
- }
162
- return t;
163
- }
164
- const A = 4, $ = 4800;
165
- function P(e) {
166
- return e.totalTokens || e.input + e.output + e.cacheRead + e.cacheWrite;
167
- }
168
- function _(e) {
169
- try {
170
- return JSON.stringify(e) ?? "undefined";
171
- } catch {
172
- return "[unserializable]";
173
- }
174
- }
175
- function U(e) {
176
- if (typeof e == "string")
177
- return e.length;
178
- let r = 0;
179
- for (const t of e)
180
- r += t.type === "text" ? t.text.length : $;
181
- return r;
182
- }
183
- function q(e) {
184
- return Math.ceil(e.length / A);
185
- }
186
- function k(e) {
187
- return Math.ceil(U(e) / A);
188
- }
189
- function I(e) {
190
- let r = 0;
191
- if (e.role === "user" || e.role === "toolResult")
192
- return k(e.content);
193
- for (const t of e.content)
194
- t.type === "text" ? r += t.text.length : t.type === "thinking" ? r += t.thinking.length : r += t.name.length + _(t.arguments).length;
195
- return Math.ceil(r / A);
196
- }
197
- function F(e) {
198
- let r = Number.NEGATIVE_INFINITY, t;
199
- for (let n = 0; n < e.length; n++) {
200
- const o = e[n];
201
- if (o.role === "assistant") {
202
- const i = o;
203
- i.timestamp >= r && i.stopReason !== "aborted" && i.stopReason !== "error" && P(i.usage) > 0 && (t = { usage: i.usage, index: n });
204
- }
205
- r = Math.max(r, o.timestamp);
206
- }
207
- return t;
208
- }
209
- function M(e) {
210
- const r = F(e);
211
- if (r) {
212
- const n = P(r.usage);
213
- let o = 0;
214
- for (let i = r.index + 1; i < e.length; i++)
215
- o += I(e[i]);
216
- return { tokens: n + o, usageTokens: n, trailingTokens: o, lastUsageIndex: r.index };
217
- }
218
- let t = 0;
219
- for (const n of e)
220
- t += I(n);
221
- return { tokens: t, usageTokens: 0, trailingTokens: t, lastUsageIndex: null };
222
- }
223
- function E(e) {
224
- return !e || e.length === 0 ? 0 : q(_(e));
225
- }
226
- function J(e) {
227
- return Array.isArray(e);
228
- }
229
- function G(e) {
230
- if (J(e))
231
- return M(e);
232
- const r = M(e.messages);
233
- if (r.lastUsageIndex !== null) {
234
- const n = new Set(e.messages.slice(r.lastUsageIndex + 1).filter((i) => i.role === "toolResult").flatMap((i) => i.addedToolNames ?? [])), o = E(e.tools?.filter((i) => n.has(i.name)));
235
- return {
236
- tokens: r.tokens + o,
237
- usageTokens: r.usageTokens,
238
- trailingTokens: r.trailingTokens + o,
239
- lastUsageIndex: r.lastUsageIndex
240
- };
241
- }
242
- const t = (e.systemPrompt ? q(e.systemPrompt) : 0) + E(e.tools);
243
- return {
244
- tokens: r.tokens + t,
245
- usageTokens: r.usageTokens,
246
- trailingTokens: r.trailingTokens + t,
247
- lastUsageIndex: r.lastUsageIndex
248
- };
249
- }
250
- const K = 4096, O = 1;
251
- function L(e, r, t) {
252
- if (e.contextWindow <= 0)
253
- return Math.max(O, t);
254
- const n = e.contextWindow - G(r).tokens - K;
255
- return Math.min(t, Math.max(O, n));
256
- }
257
- function re(e, r, t, n) {
258
- const o = e.samplingParams || t?.samplingParams ? { ...e.samplingParams, ...t?.samplingParams } : void 0;
259
- return {
260
- temperature: t?.temperature,
261
- samplingParams: o,
262
- maxTokens: L(e, r, t?.maxTokens ?? e.maxTokens),
263
- signal: t?.signal,
264
- telemetryContext: t?.telemetryContext,
265
- apiKey: n || t?.apiKey,
266
- fetch: t?.fetch,
267
- transport: t?.transport,
268
- cacheRetention: t?.cacheRetention,
269
- sessionId: t?.sessionId,
270
- headers: t?.headers,
271
- onPayload: t?.onPayload,
272
- onResponse: t?.onResponse,
273
- timeoutMs: t?.timeoutMs,
274
- websocketConnectTimeoutMs: t?.websocketConnectTimeoutMs,
275
- maxRetries: t?.maxRetries,
276
- maxRetryDelayMs: t?.maxRetryDelayMs,
277
- metadata: t?.metadata,
278
- env: t?.env
279
- };
280
- }
281
- const W = 1024;
282
- function B(e) {
283
- return e === "xhigh" || e === "max" ? "high" : e;
284
- }
285
- function ne(e, r, t, n) {
286
- const i = { ...{
287
- minimal: 1024,
288
- low: 2048,
289
- medium: 8192,
290
- high: 16384
291
- }, ...n }, d = B(t);
292
- let l = i[d];
293
- const p = e === void 0 ? r : Math.min(e + l, r);
294
- return p <= l && (l = Math.max(0, p - W)), { maxTokens: p, thinkingBudget: l };
295
- }
296
- const z = "(image omitted: model does not support images)", H = "(tool image omitted: model does not support images)";
297
- function C(e, r) {
298
- const t = [];
299
- let n = !1;
300
- for (const o of e) {
301
- if (o.type === "image") {
302
- n || t.push({ type: "text", text: r }), n = !0;
303
- continue;
304
- }
305
- t.push(o), n = o.text === r;
306
- }
307
- return t;
308
- }
309
- function V(e, r) {
310
- return r.input.includes("image") ? e : e.map((t) => t.role === "user" && Array.isArray(t.content) ? {
311
- ...t,
312
- content: C(t.content, z)
313
- } : t.role === "toolResult" ? {
314
- ...t,
315
- content: C(t.content, H)
316
- } : t);
317
- }
318
- function ie(e, r, t) {
319
- const n = /* @__PURE__ */ new Map(), o = e.map((s) => s.content == null ? { ...s, content: [] } : s), d = V(o, r).map((s) => {
320
- if (s.role === "user")
321
- return s;
322
- if (s.role === "toolResult") {
323
- const a = n.get(s.toolCallId);
324
- return a && a !== s.toolCallId ? { ...s, toolCallId: a } : s;
325
- }
326
- if (s.role === "assistant") {
327
- const a = s, c = a.provider === r.provider && a.api === r.api && a.model === r.id, w = a.content.flatMap((u) => {
328
- if (u.type === "thinking")
329
- return u.redacted ? c ? u : [] : c && u.thinkingSignature ? u : !u.thinking || u.thinking.trim() === "" ? [] : c ? u : {
330
- type: "text",
331
- text: u.thinking
332
- };
333
- if (u.type === "text")
334
- return c ? u : {
335
- type: "text",
336
- text: u.text
337
- };
338
- if (u.type === "toolCall") {
339
- const m = u;
340
- let g = m;
341
- if (!c && m.thoughtSignature && (g = { ...m }, delete g.thoughtSignature), !c && t) {
342
- const S = t(m.id, r, a);
343
- S !== m.id && (n.set(m.id, S), g = { ...g, id: S });
344
- }
345
- return g;
346
- }
347
- return u;
348
- });
349
- return {
350
- ...a,
351
- content: w
352
- };
353
- }
354
- return s;
355
- }), l = [];
356
- let p = [], h = /* @__PURE__ */ new Set();
357
- const x = () => {
358
- if (p.length > 0) {
359
- for (const s of p)
360
- h.has(s.id) || l.push({
361
- role: "toolResult",
362
- toolCallId: s.id,
363
- toolName: s.name,
364
- content: [{ type: "text", text: "No result provided" }],
365
- isError: !0,
366
- timestamp: Date.now()
367
- });
368
- p = [], h = /* @__PURE__ */ new Set();
369
- }
370
- };
371
- for (let s = 0; s < d.length; s++) {
372
- const a = d[s];
373
- if (a.role === "assistant") {
374
- x();
375
- const c = a;
376
- if (c.stopReason === "error" || c.stopReason === "aborted")
377
- continue;
378
- const w = c.content.filter((u) => u.type === "toolCall");
379
- w.length > 0 && (p = w, h = /* @__PURE__ */ new Set()), l.push(a);
380
- } else a.role === "toolResult" ? (h.add(a.toolCallId), l.push(a)) : (a.role === "user" && x(), l.push(a));
381
- }
382
- return x(), l;
383
- }
384
- export {
385
- W as M,
386
- Z as a,
387
- re as b,
388
- te as c,
389
- ee as d,
390
- X as e,
391
- B as f,
392
- Q as g,
393
- ne as h,
394
- L as i,
395
- b as r,
396
- Y as s,
397
- ie as t
398
- };