@hintergrund/ui 0.3.0 → 0.3.1

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 (25) hide show
  1. package/dist/{BuilderAgentPane-EOT6JCrB.js → BuilderAgentPane-B7-K-t7-.js} +3356 -3267
  2. package/dist/IntegrationHealth-CGj9Gtg3.js +246 -0
  3. package/dist/admin.js +8119 -8540
  4. package/dist/{anthropic-messages-Dl81zJep.js → anthropic-messages-B9cFrV8_.js} +1 -1
  5. package/dist/{azure-openai-responses-CrrDLA8-.js → azure-openai-responses-DDg04vbg.js} +2 -2
  6. package/dist/builder.js +5 -5
  7. package/dist/config.types-iZoywORE.js +15 -0
  8. package/dist/{global-1QvFLK43.js → global-CGPq4E9I.js} +4467 -4457
  9. package/dist/{google-generative-ai-DrT6NouV.js → google-generative-ai-CLKiyDxm.js} +8 -8
  10. package/dist/{google-shared-mbv_hDdk.js → google-shared-BVSu3Wpo.js} +1 -1
  11. package/dist/{google-vertex-CjHfRBgt.js → google-vertex-Cvrx6WS_.js} +15 -15
  12. package/dist/{legacy-ByJa-XpS.js → legacy-Ch3FhyVA.js} +1 -1
  13. package/dist/login.js +50 -50
  14. package/dist/mail.js +195 -195
  15. package/dist/{mistral-conversations-DpV92sl0.js → mistral-conversations-C7SJfbbS.js} +12 -12
  16. package/dist/{openai-codex-responses-Dw4e7edD.js → openai-codex-responses-BLdLSFPf.js} +2 -2
  17. package/dist/{openai-completions-DfWju8NF.js → openai-completions-CSZqjwmH.js} +16 -16
  18. package/dist/{openai-responses-D22Qtayx.js → openai-responses-BLltsSBW.js} +2 -2
  19. package/dist/{openai-responses-shared-DGHcHw_F.js → openai-responses-shared-C_oYyHxW.js} +1 -1
  20. package/dist/{pi-messages-BJSKKlfC.js → pi-messages-BbItJqhU.js} +9 -9
  21. package/dist/{select-cKciKujV.js → select-nmcCSHOs.js} +3 -3
  22. package/dist/setup.js +311 -504
  23. package/package.json +1 -1
  24. package/dist/IntegrationHealth-ZCazAhaQ.js +0 -280
  25. package/dist/brand-DteO2G6R.js +0 -95
@@ -1,8 +1,8 @@
1
- import { x as L, y as j, z as N } from "./BuilderAgentPane-EOT6JCrB.js";
2
- import { s as D } from "./hash-DFlR084x.js";
1
+ import { D as L, G as j, H as D } from "./BuilderAgentPane-B7-K-t7-.js";
2
+ import { s as N } from "./hash-DFlR084x.js";
3
3
  import { h as U } from "./headers-D4iLzGaS.js";
4
4
  import { p as T } from "./json-parse-LZdWp-Nd.js";
5
- import { t as B, b as J, s as g, d as z, e as H } from "./transform-messages-CsKsy6b4.js";
5
+ import { t as B, b as H, s as g, d as J, e as z } from "./transform-messages-CsKsy6b4.js";
6
6
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(t) {
7
7
  return Promise.resolve().then(t);
8
8
  } });
@@ -29,14 +29,14 @@ const C = 9, K = 4e3, W = (t, e, n) => {
29
29
  } catch (l) {
30
30
  for (const i of o.content)
31
31
  delete i.partialArgs;
32
- o.stopReason = n?.signal?.aborted ? "aborted" : "error", o.errorMessage = Z(l), r.push({ type: "error", reason: o.stopReason, error: o }), r.end();
32
+ o.stopReason = n?.signal?.aborted ? "aborted" : "error", o.errorMessage = G(l), r.push({ type: "error", reason: o.stopReason, error: o }), r.end();
33
33
  }
34
34
  })(), r;
35
35
  }, _e = (t, e, n) => {
36
36
  const r = n?.apiKey;
37
37
  if (!r)
38
38
  throw new Error(`No API key for provider: ${t.provider}`);
39
- const o = J(t, e, n, r), l = n?.reasoning ? j(t, n.reasoning) : void 0, i = l === "off" ? void 0 : l, u = t.reasoning && i !== void 0;
39
+ const o = H(t, e, n, r), l = n?.reasoning ? j(t, n.reasoning) : void 0, i = l === "off" ? void 0 : l, u = t.reasoning && i !== void 0;
40
40
  return W(t, e, {
41
41
  ...o,
42
42
  promptMode: u && fe(t) ? "reasoning" : void 0,
@@ -82,16 +82,16 @@ function P(t, e) {
82
82
  if (e === 0 && n.length === C)
83
83
  return n;
84
84
  const r = n || t, o = e === 0 ? r : `${r}:${e}`;
85
- return D(o).replace(/[^a-zA-Z0-9]/g, "").slice(0, C);
85
+ return N(o).replace(/[^a-zA-Z0-9]/g, "").slice(0, C);
86
86
  }
87
- function Z(t) {
87
+ function G(t) {
88
88
  if (t instanceof Error) {
89
89
  const e = t, n = typeof e.statusCode == "number" ? e.statusCode : void 0, r = typeof e.body == "string" ? e.body.trim() : void 0;
90
- return n !== void 0 && r ? `Mistral API error (${n}): ${G(r, K)}` : n !== void 0 ? `Mistral API error (${n}): ${t.message}` : t.message;
90
+ return n !== void 0 && r ? `Mistral API error (${n}): ${Z(r, K)}` : n !== void 0 ? `Mistral API error (${n}): ${t.message}` : t.message;
91
91
  }
92
92
  return X(t);
93
93
  }
94
- function G(t, e) {
94
+ function Z(t, e) {
95
95
  return t.length <= e ? t : `${t.slice(0, e)}... [truncated ${t.length - e} chars]`;
96
96
  }
97
97
  function X(t) {
@@ -300,7 +300,7 @@ async function ae(t, e, n, r) {
300
300
  const c = a.data;
301
301
  if (e.responseId ||= c.id, c.usage) {
302
302
  const d = c.usage.prompt_tokens || 0, p = se(c.usage, d);
303
- e.usage.input = Math.max(0, d - p), e.usage.output = c.usage.completion_tokens || 0, e.usage.cacheRead = p, e.usage.cacheWrite = 0, e.usage.totalTokens = c.usage.total_tokens || e.usage.input + e.usage.output + e.usage.cacheRead + e.usage.cacheWrite, N(t, e.usage);
303
+ e.usage.input = Math.max(0, d - p), e.usage.output = c.usage.completion_tokens || 0, e.usage.cacheRead = p, e.usage.cacheWrite = 0, e.usage.totalTokens = c.usage.total_tokens || e.usage.input + e.usage.output + e.usage.cacheRead + e.usage.cacheWrite, D(t, e.usage);
304
304
  }
305
305
  const f = c.choices[0];
306
306
  if (!f)
@@ -388,13 +388,13 @@ async function ae(t, e, n, r) {
388
388
  }
389
389
  function ie(t) {
390
390
  return t.map((e) => {
391
- const n = z(e, !0);
391
+ const n = J(e, !0);
392
392
  return {
393
393
  type: "function",
394
394
  function: {
395
395
  name: e.name,
396
396
  description: e.description,
397
- parameters: w(H(e, n)),
397
+ parameters: w(z(e, n)),
398
398
  strict: n ?? !1
399
399
  }
400
400
  };
@@ -1,4 +1,4 @@
1
- import { x as he, D as we, G as ge, y as Ee, H as z } from "./BuilderAgentPane-EOT6JCrB.js";
1
+ import { D as he, I as we, J as ge, G as Ee, K as z } from "./BuilderAgentPane-B7-K-t7-.js";
2
2
  import { s as Se } from "./deferred-tools-BZWMWBYN.js";
3
3
  import { f as ve, n as xe } from "./error-body-BUPcH4GF.js";
4
4
  import { h as re } from "./headers-D4iLzGaS.js";
@@ -6,7 +6,7 @@ import { g as G } from "./provider-env-D2VjEV3S.js";
6
6
  import { g as _e } from "./pi-user-agent-CUqx-qiX.js";
7
7
  import { c as oe, b as Te } from "./transform-messages-CsKsy6b4.js";
8
8
  import { c as ke } from "./openai-prompt-cache-BJwqbEDx.js";
9
- import { c as se, a as Re, p as ne } from "./openai-responses-shared-DGHcHw_F.js";
9
+ import { c as se, a as Re, p as ne } from "./openai-responses-shared-C_oYyHxW.js";
10
10
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
11
11
  return Promise.resolve().then(e);
12
12
  } });
@@ -1,5 +1,5 @@
1
1
  import { O as ee } from "./client-Cd7yMX39.js";
2
- import { x as te, y as ne, z as se } from "./BuilderAgentPane-EOT6JCrB.js";
2
+ import { D as te, G as ne, H as se } from "./BuilderAgentPane-B7-K-t7-.js";
3
3
  import { f as re, n as oe } from "./error-body-BUPcH4GF.js";
4
4
  import { s as ie } from "./hash-DFlR084x.js";
5
5
  import { h as ae } from "./headers-D4iLzGaS.js";
@@ -12,7 +12,7 @@ import { c as _e } from "./openai-prompt-cache-BJwqbEDx.js";
12
12
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
13
13
  return Promise.resolve().then(e);
14
14
  } });
15
- function z(e, n) {
15
+ function D(e, n) {
16
16
  if (!e)
17
17
  return !1;
18
18
  const t = n.toLowerCase();
@@ -21,10 +21,10 @@ function z(e, n) {
21
21
  return !0;
22
22
  return !1;
23
23
  }
24
- function $(e, n, t) {
24
+ function H(e, n, t) {
25
25
  if (n)
26
26
  return n;
27
- if (z(t, "authorization") || z(t, "cf-aig-authorization"))
27
+ if (D(t, "authorization") || D(t, "cf-aig-authorization"))
28
28
  return "unused";
29
29
  throw new Error(`No API key for provider: ${e}`);
30
30
  }
@@ -48,7 +48,7 @@ function Ae(e, n) {
48
48
  const t = new Map(e.map((s) => [s.name, s]));
49
49
  return Array.from(n).map((s) => t.get(s)).filter((s) => s !== void 0);
50
50
  }
51
- function D(e) {
51
+ function z(e) {
52
52
  return e.type === "text";
53
53
  }
54
54
  function Me(e) {
@@ -66,7 +66,7 @@ function Ee(e) {
66
66
  const n = e;
67
67
  return n.type === "reasoning.encrypted" && typeof n.id == "string" && n.id.length > 0 && typeof n.data == "string" && n.data.length > 0;
68
68
  }
69
- function H(e, n) {
69
+ function $(e, n) {
70
70
  return e || (fe("PI_CACHE_RETENTION", n) === "long" ? "long" : "short");
71
71
  }
72
72
  const we = (e, n, t) => {
@@ -90,7 +90,7 @@ const we = (e, n, t) => {
90
90
  timestamp: Date.now()
91
91
  };
92
92
  try {
93
- const h = $(e.provider, t?.apiKey, t?.headers), u = B(e), g = K(n.tools, u.supportsOpenAIGrammarTools), i = H(t?.cacheRetention, t?.env), m = i === "none" ? void 0 : t?.sessionId, l = Se(e, n, h, t?.headers, t?.fetch, m, u);
93
+ const h = H(e.provider, t?.apiKey, t?.headers), u = B(e), g = K(n.tools, u.supportsOpenAIGrammarTools), i = $(t?.cacheRetention, t?.env), m = i === "none" ? void 0 : t?.sessionId, l = Se(e, n, h, t?.headers, t?.fetch, m, u);
94
94
  let a = be(e, n, t, u, i, g);
95
95
  const c = await t?.onPayload?.(a, e);
96
96
  c !== void 0 && (a = c);
@@ -284,7 +284,7 @@ ${u}`), s.push({ type: "error", reason: r.stopReason, error: r }), s.end();
284
284
  }
285
285
  })(), s;
286
286
  }, et = (e, n, t) => {
287
- $(e.provider, t?.apiKey, t?.headers);
287
+ H(e.provider, t?.apiKey, t?.headers);
288
288
  const s = ge(e, n, t, t?.apiKey), r = t?.reasoning ? ne(e, t.reasoning) : void 0, h = r === "off" ? void 0 : r, u = t?.toolChoice;
289
289
  return we(e, n, {
290
290
  ...s,
@@ -310,8 +310,8 @@ function Se(e, n, t, s, r, h, u = B(e)) {
310
310
  defaultHeaders: g
311
311
  });
312
312
  }
313
- function be(e, n, t, s = B(e), r = H(t?.cacheRetention, t?.env), h = K(n.tools, s.supportsOpenAIGrammarTools)) {
314
- const u = De(e, n, s, { grammarToolInputProperties: h }), g = Oe(s, r), i = {
313
+ function be(e, n, t, s = B(e), r = $(t?.cacheRetention, t?.env), h = K(n.tools, s.supportsOpenAIGrammarTools)) {
314
+ const u = ze(e, n, s, { grammarToolInputProperties: h }), g = Oe(s, r), i = {
315
315
  model: e.id,
316
316
  messages: u,
317
317
  stream: !0,
@@ -424,7 +424,7 @@ function Be(e, n) {
424
424
  function Le(e, n) {
425
425
  for (let t = e.length - 1; t >= 0; t--) {
426
426
  const s = e[t];
427
- if ((s.role === "user" || s.role === "assistant" || s.role === "tool") && ze(s, n))
427
+ if ((s.role === "user" || s.role === "assistant" || s.role === "tool") && De(s, n))
428
428
  return;
429
429
  }
430
430
  }
@@ -437,7 +437,7 @@ function qe(e, n) {
437
437
  function Ne(e, n) {
438
438
  return W(e, n);
439
439
  }
440
- function ze(e, n) {
440
+ function De(e, n) {
441
441
  return e.role === "user" || e.role === "assistant" || e.role === "tool" ? W(e, n) : !1;
442
442
  }
443
443
  function W(e, n) {
@@ -461,7 +461,7 @@ function W(e, n) {
461
461
  }
462
462
  return !1;
463
463
  }
464
- function De(e, n, t, s) {
464
+ function ze(e, n, t, s) {
465
465
  const r = [], h = (i) => {
466
466
  if (i.includes("|")) {
467
467
  const m = i.indexOf("|"), l = i.slice(0, m).replace(/[^a-zA-Z0-9_-]/g, "_"), a = i.slice(m + 1).replace(/[^a-zA-Z0-9_-]/g, "_"), c = a.length > 0 ? `${l}_${a}` : l;
@@ -509,7 +509,7 @@ function De(e, n, t, s) {
509
509
  const l = {
510
510
  role: "assistant",
511
511
  content: t.requiresAssistantAfterToolResult ? "" : null
512
- }, a = m.content.filter(D).filter((k) => k.text.trim().length > 0).map((k) => ({
512
+ }, a = m.content.filter(z).filter((k) => k.text.trim().length > 0).map((k) => ({
513
513
  type: "text",
514
514
  text: w(k.text)
515
515
  })), c = a.map((k) => k.text).join(""), p = m.content.filter(Me).filter((k) => k.thinking.trim().length > 0);
@@ -564,7 +564,7 @@ function De(e, n, t, s) {
564
564
  const l = [], a = /* @__PURE__ */ new Set();
565
565
  let c = i;
566
566
  for (; c < u.length && u[c].role === "toolResult"; c++) {
567
- const p = u[c], _ = p.content.filter(D).map((A) => A.text).join(`
567
+ const p = u[c], _ = p.content.filter(z).map((A) => A.text).join(`
568
568
  `), v = p.content.some((A) => A.type === "image"), k = _.length > 0 ? _ : v ? "(see attached image)" : "(no tool output)", T = {
569
569
  role: "tool",
570
570
  content: w(k),
@@ -735,7 +735,7 @@ function B(e) {
735
735
  } : n;
736
736
  }
737
737
  export {
738
- De as convertMessages,
738
+ ze as convertMessages,
739
739
  we as stream,
740
740
  et as streamSimple
741
741
  };
@@ -1,5 +1,5 @@
1
1
  import { O as P } from "./client-Cd7yMX39.js";
2
- import { x as w, y as E } from "./BuilderAgentPane-EOT6JCrB.js";
2
+ import { D as w, G as E } from "./BuilderAgentPane-B7-K-t7-.js";
3
3
  import { s as I } from "./deferred-tools-BZWMWBYN.js";
4
4
  import { f as b, n as S } from "./error-body-BUPcH4GF.js";
5
5
  import { h as M } from "./headers-D4iLzGaS.js";
@@ -8,7 +8,7 @@ import { r as _ } from "./provider-retry-BsigVlMg.js";
8
8
  import { c as g, b as x } from "./transform-messages-CsKsy6b4.js";
9
9
  import { h as k, b as L } from "./github-copilot-headers-B1RBGoZi.js";
10
10
  import { c as G } from "./openai-prompt-cache-BJwqbEDx.js";
11
- import { p as D, c as N, a as K } from "./openai-responses-shared-DGHcHw_F.js";
11
+ import { p as D, c as N, a as K } from "./openai-responses-shared-C_oYyHxW.js";
12
12
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
13
13
  return Promise.resolve().then(e);
14
14
  } });
@@ -1,4 +1,4 @@
1
- import { z as P } from "./BuilderAgentPane-EOT6JCrB.js";
1
+ import { H as P } from "./BuilderAgentPane-B7-K-t7-.js";
2
2
  import { s as R } from "./hash-DFlR084x.js";
3
3
  import { p as C } from "./json-parse-LZdWp-Nd.js";
4
4
  import { t as O, s as k, g as z, r as N, d as j, e as W, a as A } from "./transform-messages-CsKsy6b4.js";
@@ -1,7 +1,7 @@
1
- import { x as m, D as f, G as y } from "./BuilderAgentPane-EOT6JCrB.js";
1
+ import { D as x, I as f, J as y } from "./BuilderAgentPane-B7-K-t7-.js";
2
2
  import { p as b, h as w } from "./headers-D4iLzGaS.js";
3
- import { p as k } from "./json-parse-LZdWp-Nd.js";
4
- import { g as I } from "./provider-env-D2VjEV3S.js";
3
+ import { p as I } from "./json-parse-LZdWp-Nd.js";
4
+ import { g as k } from "./provider-env-D2VjEV3S.js";
5
5
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(r) {
6
6
  return Promise.resolve().then(r);
7
7
  } });
@@ -41,7 +41,7 @@ function M(r, t, n, e) {
41
41
  timestampMs: Date.now()
42
42
  });
43
43
  }
44
- function x() {
44
+ function m() {
45
45
  return {
46
46
  input: 0,
47
47
  output: 0,
@@ -65,7 +65,7 @@ function S(r) {
65
65
  api: r.api,
66
66
  provider: r.provider,
67
67
  model: r.id,
68
- usage: x(),
68
+ usage: m(),
69
69
  stopReason: "pending",
70
70
  timestamp: Date.now()
71
71
  }, n = /* @__PURE__ */ new Map();
@@ -121,7 +121,7 @@ function S(r) {
121
121
  break;
122
122
  case "toolcall_delta": {
123
123
  const s = `${n.get(e.contentIndex) ?? ""}${e.delta}`;
124
- n.set(e.contentIndex, s), t.content[e.contentIndex].arguments = k(s);
124
+ n.set(e.contentIndex, s), t.content[e.contentIndex].arguments = I(s);
125
125
  break;
126
126
  }
127
127
  case "toolcall_end":
@@ -175,7 +175,7 @@ function P(r, t, n) {
175
175
  api: r.api,
176
176
  provider: r.provider,
177
177
  model: r.id,
178
- usage: x(),
178
+ usage: m(),
179
179
  stopReason: e,
180
180
  errorMessage: t instanceof Error ? t.message : String(t),
181
181
  timestamp: Date.now()
@@ -183,10 +183,10 @@ function P(r, t, n) {
183
183
  return !n && t instanceof h && f(s, y("pi_messages_response_failure", t, t.diagnosticDetails)), { type: "error", reason: e, error: s };
184
184
  }
185
185
  function D(r, t) {
186
- return r || (I("PI_CACHE_RETENTION", t) === "long" ? "long" : void 0);
186
+ return r || (k("PI_CACHE_RETENTION", t) === "long" ? "long" : void 0);
187
187
  }
188
188
  const $ = (r, t, n) => {
189
- const e = new m(), s = S(r);
189
+ const e = new x(), s = S(r);
190
190
  return (async () => {
191
191
  try {
192
192
  const a = n?.apiKey;
@@ -1,4 +1,4 @@
1
- import { t as _, bi as d, bD as b, bE as c, bF as m, bG as s, j as h } from "./global-1QvFLK43.js";
1
+ import { x as _, bh as d, bI as b, bJ as c, bK as h, bL as s, j as m } from "./global-CGPq4E9I.js";
2
2
  typeof globalThis.process > "u" && (globalThis.process = { env: {}, platform: "browser", version: "", versions: {}, browser: !0, nextTick: function(e) {
3
3
  return Promise.resolve().then(e);
4
4
  } });
@@ -41,7 +41,7 @@ function p(e) {
41
41
  }
42
42
  function q(e, r, f = r) {
43
43
  var n = /* @__PURE__ */ new WeakSet(), u = !0;
44
- m(e, "change", (a) => {
44
+ h(e, "change", (a) => {
45
45
  var l = a ? "[selected]" : ":checked", i;
46
46
  if (e.multiple)
47
47
  i = [].map.call(e.querySelectorAll(l), t);
@@ -51,7 +51,7 @@ function q(e, r, f = r) {
51
51
  i = o && t(o);
52
52
  }
53
53
  f(i), e.__value = i, s !== null && n.add(s);
54
- }), h(() => {
54
+ }), m(() => {
55
55
  var a = r();
56
56
  if (e === document.activeElement) {
57
57
  var l = (