@hintergrund/ui 0.3.9 → 0.3.11
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/BuilderAgentPane-Cf2EQd0U.js +1 -0
- package/dist/IntegrationHealth-CBFYmR_K.js +1 -0
- package/dist/admin.js +2 -23351
- package/dist/anthropic-messages-CXPLHUpk.js +1 -0
- package/dist/assets/index-DI9TbuA9.js +34669 -0
- package/dist/builder.js +1 -28
- package/dist/config.types-CElC76m0.js +1 -0
- package/dist/deferred-tools-8QtAASke.js +1 -0
- package/dist/error-body-B13t5xBI.js +1 -0
- package/dist/github-copilot-headers-n6Dqf6oj.js +1 -0
- package/dist/global-BmWXMWNY.js +2 -0
- package/dist/google-generative-ai-CNHCOvQN.js +1 -0
- package/dist/legacy-DcJfom53.js +1 -0
- package/dist/login.js +1 -133
- package/dist/mail.js +1 -698
- package/dist/openai-completions-CSZJSCfj.js +1 -0
- package/dist/openai-prompt-cache-Mi5dPc0-.js +1 -0
- package/dist/openai-responses-BU24JgAs.js +1 -0
- package/dist/setup.js +1 -402
- package/dist/transform-messages-C1f-L9_8.js +1 -0
- package/package.json +4 -3
- package/dist/BuilderAgentPane-DsEI4-Al.js +0 -23164
- package/dist/IntegrationHealth-jTXhVEhP.js +0 -218
- package/dist/anthropic-messages-DeTygrtE.js +0 -3772
- package/dist/azure-openai-responses-BEt9HtWb.js +0 -168
- package/dist/config.types-DZ5yfeqq.js +0 -20
- package/dist/deferred-tools-nxpq94I4.js +0 -34
- package/dist/diagnostics-x5QOwca_.js +0 -91
- package/dist/error-body-pXgvw5vV.js +0 -68
- package/dist/font-pool/LICENSES.txt +0 -22
- package/dist/font-pool/inter.ttf +0 -0
- package/dist/font-pool/inter.woff2 +0 -0
- package/dist/font-pool/jetbrains-mono.ttf +0 -0
- package/dist/font-pool/jetbrains-mono.woff2 +0 -0
- package/dist/font-pool/lora.ttf +0 -0
- package/dist/font-pool/lora.woff2 +0 -0
- package/dist/font-pool/merriweather.ttf +0 -0
- package/dist/font-pool/merriweather.woff2 +0 -0
- package/dist/font-pool/montserrat.ttf +0 -0
- package/dist/font-pool/montserrat.woff2 +0 -0
- package/dist/font-pool/playfair-display.ttf +0 -0
- package/dist/font-pool/playfair-display.woff2 +0 -0
- package/dist/font-pool/poppins.ttf +0 -0
- package/dist/font-pool/poppins.woff2 +0 -0
- package/dist/font-pool/roboto.ttf +0 -0
- package/dist/font-pool/roboto.woff2 +0 -0
- package/dist/font-pool/space-grotesk.ttf +0 -0
- package/dist/font-pool/space-grotesk.woff2 +0 -0
- package/dist/font-pool/work-sans.ttf +0 -0
- package/dist/font-pool/work-sans.woff2 +0 -0
- package/dist/github-copilot-headers-pRo3v4t7.js +0 -27
- package/dist/global-5AbycIwc.js +0 -33349
- package/dist/google-generative-ai-CwE_Q3Ns.js +0 -291
- package/dist/google-shared-CG2Lbh1z.js +0 -8746
- package/dist/google-vertex-Bps529Az.js +0 -329
- package/dist/hash-BixfZjoG.js +0 -21
- package/dist/headers-CnTiKpOL.js +0 -24
- package/dist/json-parse-CxjAnWaM.js +0 -231
- package/dist/legacy-DeQqoiXf.js +0 -14
- package/dist/mistral-conversations-B48Orl3n.js +0 -558
- package/dist/openai-ClxLHXsh.js +0 -5371
- package/dist/openai-codex-responses-CV5PzsyD.js +0 -909
- package/dist/openai-completions-Lehh2IT3.js +0 -730
- package/dist/openai-prompt-cache-Bm8Re6Vv.js +0 -17
- package/dist/openai-responses-BXliJnO9.js +0 -192
- package/dist/openai-responses-shared-BfJJDr6-.js +0 -481
- package/dist/pi-messages-CRx0yqMp.js +0 -268
- package/dist/pi-user-agent-CsXkkH60.js +0 -20
- package/dist/provider-env-Cj6X7Wly.js +0 -35
- package/dist/provider-retry-BGImU1PV.js +0 -68
- package/dist/rolldown-runtime-nTTD767F.js +0 -37
- package/dist/transform-messages-DvxSeyBQ.js +0 -383
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
globalThis.process === void 0 && (globalThis.process = {
|
|
2
|
-
env: {},
|
|
3
|
-
platform: "browser",
|
|
4
|
-
version: "",
|
|
5
|
-
versions: {},
|
|
6
|
-
browser: !0,
|
|
7
|
-
nextTick: function(e) {
|
|
8
|
-
return Promise.resolve().then(e);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
import { m as e, p as t } from "./BuilderAgentPane-DsEI4-Al.js";
|
|
12
|
-
import { i as n } from "./diagnostics-x5QOwca_.js";
|
|
13
|
-
import { n as r } from "./headers-CnTiKpOL.js";
|
|
14
|
-
import { i, p as a } from "./transform-messages-DvxSeyBQ.js";
|
|
15
|
-
import { n as o, t as s } from "./error-body-pXgvw5vV.js";
|
|
16
|
-
import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h, t as g } from "./google-shared-CG2Lbh1z.js";
|
|
17
|
-
//#region ../../../../node_modules/.pnpm/@earendil-works+pi-ai@0.84.2_supports-color@10.2.2_ws@8.21.3_zod@4.4.3/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js
|
|
18
|
-
var _ = 0, v = (e, r, i) => {
|
|
19
|
-
let a = new n();
|
|
20
|
-
return (async () => {
|
|
21
|
-
let n = {
|
|
22
|
-
role: "assistant",
|
|
23
|
-
content: [],
|
|
24
|
-
api: "google-generative-ai",
|
|
25
|
-
provider: e.provider,
|
|
26
|
-
model: e.id,
|
|
27
|
-
usage: {
|
|
28
|
-
input: 0,
|
|
29
|
-
output: 0,
|
|
30
|
-
cacheRead: 0,
|
|
31
|
-
cacheWrite: 0,
|
|
32
|
-
totalTokens: 0,
|
|
33
|
-
cost: {
|
|
34
|
-
input: 0,
|
|
35
|
-
output: 0,
|
|
36
|
-
cacheRead: 0,
|
|
37
|
-
cacheWrite: 0,
|
|
38
|
-
total: 0
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
stopReason: "pending",
|
|
42
|
-
timestamp: Date.now()
|
|
43
|
-
};
|
|
44
|
-
try {
|
|
45
|
-
if (i?.fetch && i.fetch !== globalThis.fetch) throw Error("Custom fetch is not supported by the Google Generative AI adapter");
|
|
46
|
-
let o = i?.apiKey;
|
|
47
|
-
if (!o) throw Error(`No API key for provider: ${e.provider}`);
|
|
48
|
-
let s = b(e, o, i?.headers), c = x(e, r, i), l = await i?.onPayload?.(c, e);
|
|
49
|
-
l !== void 0 && (c = l);
|
|
50
|
-
let d = await h(() => s.models.generateContentStream(c), i);
|
|
51
|
-
a.push({
|
|
52
|
-
type: "start",
|
|
53
|
-
partial: n
|
|
54
|
-
});
|
|
55
|
-
let f = null, g = n.content, v = () => g.length - 1;
|
|
56
|
-
for await (let r of d) {
|
|
57
|
-
n.responseId ||= r.responseId;
|
|
58
|
-
let i = r.candidates?.[0];
|
|
59
|
-
if (i?.content?.parts) for (let e of i.content.parts) {
|
|
60
|
-
if (e.text !== void 0) {
|
|
61
|
-
let t = m(e);
|
|
62
|
-
(!f || t && f.type !== "thinking" || !t && f.type !== "text") && (f && (f.type === "text" ? a.push({
|
|
63
|
-
type: "text_end",
|
|
64
|
-
contentIndex: g.length - 1,
|
|
65
|
-
content: f.text,
|
|
66
|
-
partial: n
|
|
67
|
-
}) : a.push({
|
|
68
|
-
type: "thinking_end",
|
|
69
|
-
contentIndex: v(),
|
|
70
|
-
content: f.thinking,
|
|
71
|
-
partial: n
|
|
72
|
-
})), t ? (f = {
|
|
73
|
-
type: "thinking",
|
|
74
|
-
thinking: "",
|
|
75
|
-
thinkingSignature: void 0
|
|
76
|
-
}, n.content.push(f), a.push({
|
|
77
|
-
type: "thinking_start",
|
|
78
|
-
contentIndex: v(),
|
|
79
|
-
partial: n
|
|
80
|
-
})) : (f = {
|
|
81
|
-
type: "text",
|
|
82
|
-
text: ""
|
|
83
|
-
}, n.content.push(f), a.push({
|
|
84
|
-
type: "text_start",
|
|
85
|
-
contentIndex: v(),
|
|
86
|
-
partial: n
|
|
87
|
-
}))), f.type === "thinking" ? (f.thinking += e.text, f.thinkingSignature = p(f.thinkingSignature, e.thoughtSignature), a.push({
|
|
88
|
-
type: "thinking_delta",
|
|
89
|
-
contentIndex: v(),
|
|
90
|
-
delta: e.text,
|
|
91
|
-
partial: n
|
|
92
|
-
})) : (f.text += e.text, f.textSignature = p(f.textSignature, e.thoughtSignature), a.push({
|
|
93
|
-
type: "text_delta",
|
|
94
|
-
contentIndex: v(),
|
|
95
|
-
delta: e.text,
|
|
96
|
-
partial: n
|
|
97
|
-
}));
|
|
98
|
-
}
|
|
99
|
-
if (e.functionCall) {
|
|
100
|
-
f &&= (f.type === "text" ? a.push({
|
|
101
|
-
type: "text_end",
|
|
102
|
-
contentIndex: v(),
|
|
103
|
-
content: f.text,
|
|
104
|
-
partial: n
|
|
105
|
-
}) : a.push({
|
|
106
|
-
type: "thinking_end",
|
|
107
|
-
contentIndex: v(),
|
|
108
|
-
content: f.thinking,
|
|
109
|
-
partial: n
|
|
110
|
-
}), null);
|
|
111
|
-
let t = e.functionCall.id, r = {
|
|
112
|
-
type: "toolCall",
|
|
113
|
-
id: !t || n.content.some((e) => e.type === "toolCall" && e.id === t) ? `${e.functionCall.name}_${Date.now()}_${++_}` : t,
|
|
114
|
-
name: e.functionCall.name || "",
|
|
115
|
-
arguments: e.functionCall.args ?? {},
|
|
116
|
-
...e.thoughtSignature && { thoughtSignature: e.thoughtSignature }
|
|
117
|
-
};
|
|
118
|
-
n.content.push(r), a.push({
|
|
119
|
-
type: "toolcall_start",
|
|
120
|
-
contentIndex: v(),
|
|
121
|
-
partial: n
|
|
122
|
-
}), a.push({
|
|
123
|
-
type: "toolcall_delta",
|
|
124
|
-
contentIndex: v(),
|
|
125
|
-
delta: JSON.stringify(r.arguments),
|
|
126
|
-
partial: n
|
|
127
|
-
}), a.push({
|
|
128
|
-
type: "toolcall_end",
|
|
129
|
-
contentIndex: v(),
|
|
130
|
-
toolCall: r,
|
|
131
|
-
partial: n
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
i?.finishReason && (n.rawStopReason = i.finishReason, n.stopReason = u(i.finishReason), n.content.some((e) => e.type === "toolCall") && n.stopReason === "stop" && (n.stopReason = "toolUse")), r.usageMetadata && (n.usage = {
|
|
136
|
-
input: (r.usageMetadata.promptTokenCount || 0) - (r.usageMetadata.cachedContentTokenCount || 0),
|
|
137
|
-
output: (r.usageMetadata.candidatesTokenCount || 0) + (r.usageMetadata.thoughtsTokenCount || 0),
|
|
138
|
-
cacheRead: r.usageMetadata.cachedContentTokenCount || 0,
|
|
139
|
-
cacheWrite: 0,
|
|
140
|
-
reasoning: r.usageMetadata.thoughtsTokenCount || 0,
|
|
141
|
-
totalTokens: r.usageMetadata.totalTokenCount || 0,
|
|
142
|
-
cost: {
|
|
143
|
-
input: 0,
|
|
144
|
-
output: 0,
|
|
145
|
-
cacheRead: 0,
|
|
146
|
-
cacheWrite: 0,
|
|
147
|
-
total: 0
|
|
148
|
-
}
|
|
149
|
-
}, t(e, n.usage));
|
|
150
|
-
}
|
|
151
|
-
if (f && (f.type === "text" ? a.push({
|
|
152
|
-
type: "text_end",
|
|
153
|
-
contentIndex: v(),
|
|
154
|
-
content: f.text,
|
|
155
|
-
partial: n
|
|
156
|
-
}) : a.push({
|
|
157
|
-
type: "thinking_end",
|
|
158
|
-
contentIndex: v(),
|
|
159
|
-
content: f.thinking,
|
|
160
|
-
partial: n
|
|
161
|
-
})), i?.signal?.aborted) throw Error("Request was aborted");
|
|
162
|
-
if (n.stopReason === "pending") throw Error("Google stream ended without a finish reason");
|
|
163
|
-
if (n.stopReason === "aborted" || n.stopReason === "error") {
|
|
164
|
-
let e = n.rawStopReason ? `Provider stopped with: ${n.rawStopReason}` : "An unknown error occurred";
|
|
165
|
-
throw Error(e);
|
|
166
|
-
}
|
|
167
|
-
a.push({
|
|
168
|
-
type: "done",
|
|
169
|
-
reason: n.stopReason,
|
|
170
|
-
message: n
|
|
171
|
-
}), a.end();
|
|
172
|
-
} catch (e) {
|
|
173
|
-
for (let e of n.content) "index" in e && delete e.index;
|
|
174
|
-
n.stopReason = i?.signal?.aborted ? "aborted" : "error", n.errorMessage = s(o(e)), a.push({
|
|
175
|
-
type: "error",
|
|
176
|
-
reason: n.stopReason,
|
|
177
|
-
error: n
|
|
178
|
-
}), a.end();
|
|
179
|
-
}
|
|
180
|
-
})(), a;
|
|
181
|
-
}, y = (t, n, r) => {
|
|
182
|
-
let a = r?.apiKey;
|
|
183
|
-
if (!a) throw Error(`No API key for provider: ${t.provider}`);
|
|
184
|
-
let o = i(t, n, r, a);
|
|
185
|
-
if (!r?.reasoning) return v(t, n, {
|
|
186
|
-
...o,
|
|
187
|
-
thinking: { enabled: !1 }
|
|
188
|
-
});
|
|
189
|
-
let s = e(t, r.reasoning), c = s === "off" ? "high" : s, l = t;
|
|
190
|
-
return C(l) || w(l) || S(l) ? v(t, n, {
|
|
191
|
-
...o,
|
|
192
|
-
thinking: {
|
|
193
|
-
enabled: !0,
|
|
194
|
-
level: E(c, l)
|
|
195
|
-
}
|
|
196
|
-
}) : v(t, n, {
|
|
197
|
-
...o,
|
|
198
|
-
thinking: {
|
|
199
|
-
enabled: !0,
|
|
200
|
-
budgetTokens: D(l, c, r.thinkingBudgets)
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
function b(e, t, n) {
|
|
205
|
-
let i = {};
|
|
206
|
-
e.baseUrl && (i.baseUrl = e.baseUrl, i.apiVersion = "");
|
|
207
|
-
let a = r({
|
|
208
|
-
...e.headers,
|
|
209
|
-
...n
|
|
210
|
-
});
|
|
211
|
-
return a && (i.headers = a), new d({
|
|
212
|
-
apiKey: t,
|
|
213
|
-
httpOptions: Object.keys(i).length > 0 ? i : void 0
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
function x(e, t, n = {}) {
|
|
217
|
-
let r = g(e, t), i = {};
|
|
218
|
-
n.temperature !== void 0 && (i.temperature = n.temperature), n.maxTokens !== void 0 && (i.maxOutputTokens = n.maxTokens);
|
|
219
|
-
let o = l(e.id), s = t.tools?.length ? c(t.tools, n.toolChoice, o) : void 0, u = {
|
|
220
|
-
...Object.keys(i).length > 0 && i,
|
|
221
|
-
...t.systemPrompt && { systemInstruction: a(t.systemPrompt) },
|
|
222
|
-
...t.tools && t.tools.length > 0 && { tools: f(t.tools, !1, o) },
|
|
223
|
-
...s !== void 0 && { toolConfig: { functionCallingConfig: { mode: s } } }
|
|
224
|
-
};
|
|
225
|
-
if (n.thinking?.enabled && e.reasoning) {
|
|
226
|
-
let e = { includeThoughts: !0 };
|
|
227
|
-
n.thinking.level === void 0 ? n.thinking.budgetTokens !== void 0 && (e.thinkingBudget = n.thinking.budgetTokens) : e.thinkingLevel = n.thinking.level, u.thinkingConfig = e;
|
|
228
|
-
} else e.reasoning && n.thinking && !n.thinking.enabled && (u.thinkingConfig = T(e));
|
|
229
|
-
if (n.signal) {
|
|
230
|
-
if (n.signal.aborted) throw Error("Request aborted");
|
|
231
|
-
u.abortSignal = n.signal;
|
|
232
|
-
}
|
|
233
|
-
return {
|
|
234
|
-
model: e.id,
|
|
235
|
-
contents: r,
|
|
236
|
-
config: u
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
function S(e) {
|
|
240
|
-
return /gemma-?4/.test(e.id.toLowerCase());
|
|
241
|
-
}
|
|
242
|
-
function C(e) {
|
|
243
|
-
return /gemini-3(?:\.\d+)?-pro/.test(e.id.toLowerCase());
|
|
244
|
-
}
|
|
245
|
-
function w(e) {
|
|
246
|
-
let t = e.id.toLowerCase();
|
|
247
|
-
return /gemini-3(?:\.\d+)?-flash/.test(t) || t === "gemini-flash-latest" || t === "gemini-flash-lite-latest";
|
|
248
|
-
}
|
|
249
|
-
function T(e) {
|
|
250
|
-
return C(e) ? { thinkingLevel: "LOW" } : w(e) || S(e) ? { thinkingLevel: "MINIMAL" } : { thinkingBudget: 0 };
|
|
251
|
-
}
|
|
252
|
-
function E(e, t) {
|
|
253
|
-
if (C(t)) switch (e) {
|
|
254
|
-
case "minimal":
|
|
255
|
-
case "low": return "LOW";
|
|
256
|
-
case "medium":
|
|
257
|
-
case "high": return "HIGH";
|
|
258
|
-
}
|
|
259
|
-
if (S(t)) switch (e) {
|
|
260
|
-
case "minimal":
|
|
261
|
-
case "low": return "MINIMAL";
|
|
262
|
-
case "medium":
|
|
263
|
-
case "high": return "HIGH";
|
|
264
|
-
}
|
|
265
|
-
switch (e) {
|
|
266
|
-
case "minimal": return "MINIMAL";
|
|
267
|
-
case "low": return "LOW";
|
|
268
|
-
case "medium": return "MEDIUM";
|
|
269
|
-
case "high": return "HIGH";
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function D(e, t, n) {
|
|
273
|
-
return n?.[t] === void 0 ? e.id.includes("2.5-pro") ? {
|
|
274
|
-
minimal: 128,
|
|
275
|
-
low: 2048,
|
|
276
|
-
medium: 8192,
|
|
277
|
-
high: 32768
|
|
278
|
-
}[t] : e.id.includes("2.5-flash-lite") ? {
|
|
279
|
-
minimal: 512,
|
|
280
|
-
low: 2048,
|
|
281
|
-
medium: 8192,
|
|
282
|
-
high: 24576
|
|
283
|
-
}[t] : e.id.includes("2.5-flash") ? {
|
|
284
|
-
minimal: 128,
|
|
285
|
-
low: 2048,
|
|
286
|
-
medium: 8192,
|
|
287
|
-
high: 24576
|
|
288
|
-
}[t] : -1 : n[t];
|
|
289
|
-
}
|
|
290
|
-
//#endregion
|
|
291
|
-
export { v as stream, y as streamSimple };
|