@declarion/react 0.177.0 → 0.180.0

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.
@@ -3,19 +3,31 @@ var e = /* @__PURE__ */ new Set(["operation.search"]);
3
3
  function t(t, i = []) {
4
4
  let s = [], c = /* @__PURE__ */ new Map();
5
5
  for (let e of i) e.assistant_message_id && e.provider_call_id && c.set(r(e.assistant_message_id, e.provider_call_id), e);
6
+ let l = /* @__PURE__ */ new Map(), u = new Set(t.filter((e) => e.role === "assistant").map((e) => e.id));
7
+ for (let e of t) {
8
+ let t = e.delivery_key?.startsWith("reply:") ? e.delivery_key.slice(6) : "";
9
+ u.has(t) && l.set(t, e);
10
+ }
11
+ let d = new Set(l.values());
6
12
  for (let r of t) {
13
+ if (d.has(r)) continue;
7
14
  let t = n(r, c);
8
- if (o(r) && s.push({
9
- kind: "message",
10
- message: a(r)
11
- }), t.length === 0) continue;
12
- let i = s[s.length - 1], l = i?.kind === "run" ? i : (s.push({
15
+ if (o(r)) {
16
+ let e = l.get(r.id);
17
+ s.push({
18
+ kind: "message",
19
+ message: a(r),
20
+ ...e ? { delivered: e } : {}
21
+ });
22
+ }
23
+ if (t.length === 0) continue;
24
+ let i = s[s.length - 1], u = i?.kind === "run" ? i : (s.push({
13
25
  kind: "run",
14
26
  id: r.id,
15
27
  calls: []
16
28
  }), s[s.length - 1]);
17
- for (let n of t) e.has(n.name) || l.calls.push(n);
18
- l.calls.length === 0 && s.pop();
29
+ for (let n of t) e.has(n.name) || u.calls.push(n);
30
+ u.calls.length === 0 && s.pop();
19
31
  }
20
32
  return s;
21
33
  }
@@ -49,7 +49,7 @@ function c({ evidence: i }) {
49
49
  fontSize: 12,
50
50
  color: "var(--muted-foreground)"
51
51
  },
52
- children: c("record.evidence.verified", "Verified {when}", { when: u })
52
+ children: c("record.evidence.verified", "Checked {when}", { when: u })
53
53
  })
54
54
  ]
55
55
  }), i?.reason && /* @__PURE__ */ a("span", {
@@ -123,14 +123,16 @@ function j() {
123
123
  size: "md",
124
124
  style: {
125
125
  justifyContent: "center",
126
- width: "100%"
126
+ width: "100%",
127
+ ...B === e.slug && { opacity: 1 }
127
128
  },
128
129
  icon: t.icon,
130
+ "aria-busy": B === e.slug,
129
131
  disabled: H,
130
132
  onClick: (t) => {
131
133
  t.preventDefault(), V(e.slug);
132
134
  },
133
- children: F("auth.signin.sso_continue", "Continue with {provider}", { provider: t.name })
135
+ children: B === e.slug ? F("auth.signin.sso_opening", "Opening {provider}…", { provider: t.name }) : F("auth.signin.sso_continue", "Continue with {provider}", { provider: t.name })
134
136
  }, e.slug);
135
137
  })
136
138
  }), /* @__PURE__ */ w("div", {
@@ -21,28 +21,28 @@ import { FileDraftScope as x, useFileDraftScope as S } from "../../file-widgets/
21
21
  import { buildFilesPayload as C } from "../../file-widgets/payload.js";
22
22
  import { getFileFieldValue as w, renderSchemaField as T } from "../../file-widgets/host.js";
23
23
  import { singleFileFromValue as E } from "../../file-widgets/value.js";
24
- import { DynamicIcon as ee } from "../../shared/DynamicIcon.js";
25
- import { toast as D } from "../../../lib/toast.js";
26
- import { useSchema as O } from "../../../hooks/useSchema.js";
27
- import { useBrandingChrome as k } from "../../../hooks/useBrandingChrome.js";
28
- import { useCurrentScreen as A } from "../../../hooks/useCurrentScreen.js";
29
- import { useObject as j } from "../../../hooks/useObject.js";
30
- import { useResponsiveMode as M } from "../../../hooks/useResponsiveMode.js";
31
- import { AssociatedBlock as N } from "../../detail-layout/AssociatedBlock.js";
32
- import { ParamsBlock as P } from "../../params/ParamsBlock.js";
33
- import { ErrorLine as F } from "../../params/param-editors.js";
34
- import { useAllParams as I } from "../../../hooks/useParams.js";
35
- import { useText as L } from "../../../hooks/useText.js";
36
- import { failureTitle as R } from "../../../lib/failure.js";
37
- import { LANGUAGE_PARAMETER as z, pluralText as te } from "../../../lib/language.js";
38
- import { activeRoleLabel as ne } from "../../../lib/role-label.js";
39
- import { Fragment as B, useId as V, useState as H } from "react";
40
- import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
24
+ import { DynamicIcon as D } from "../../shared/DynamicIcon.js";
25
+ import { toast as O } from "../../../lib/toast.js";
26
+ import { useSchema as k } from "../../../hooks/useSchema.js";
27
+ import { useBrandingChrome as A } from "../../../hooks/useBrandingChrome.js";
28
+ import { useCurrentScreen as ee } from "../../../hooks/useCurrentScreen.js";
29
+ import { useObject as te } from "../../../hooks/useObject.js";
30
+ import { useResponsiveMode as j } from "../../../hooks/useResponsiveMode.js";
31
+ import { AssociatedBlock as M } from "../../detail-layout/AssociatedBlock.js";
32
+ import { ParamsBlock as N } from "../../params/ParamsBlock.js";
33
+ import { ErrorLine as P } from "../../params/param-editors.js";
34
+ import { useAllParams as F } from "../../../hooks/useParams.js";
35
+ import { useText as I } from "../../../hooks/useText.js";
36
+ import { failureTitle as L } from "../../../lib/failure.js";
37
+ import { LANGUAGE_PARAMETER as R, pluralText as z } from "../../../lib/language.js";
38
+ import { activeRoleLabel as B } from "../../../lib/role-label.js";
39
+ import { Fragment as V, useId as H, useState as U } from "react";
40
+ import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
41
41
  // src/components/pages/profile/Profile.impl.tsx
42
- var K = "avatar";
43
- function q() {
44
- let a = t(), c = v((e) => e.user), l = v((e) => e.activeTenant), u = v((e) => e.refreshMe), { data: b } = O(), S = A(), C = k("custom"), w = L(), E = j(e, c?.id), M = E.data?.data, [N, P] = H(!1), [F, I] = H(!1), R = b?.entities[e], z = c?.display_name || c?.email || w("profile.user_fallback", "User"), B = (e) => w(c?.role_names?.[e]) || e, V = ne(c, w), K = l?.env ? `${l.name} · ${l.env}` : l?.name ?? "—", q = (e) => R && T({
45
- entity: R,
42
+ var q = "avatar", J = "user_messenger_account";
43
+ function ne() {
44
+ let a = t(), c = v((e) => e.user), l = v((e) => e.activeTenant), u = v((e) => e.refreshMe), { data: b } = k(), S = ee(), C = A("custom"), w = I(), E = te(e, c?.id), j = E.data?.data, [M, N] = U(!1), [P, F] = U(!1), L = b?.entities[e], R = c?.display_name || c?.email || w("profile.user_fallback", "User"), V = (e) => w(c?.role_names?.[e]) || e, H = B(c, w), q = l?.env ? `${l.name} · ${l.env}` : l?.name ?? "—", J = (e) => L && T({
45
+ entity: L,
46
46
  entityCode: "profile",
47
47
  fieldName: e,
48
48
  record: {
@@ -52,33 +52,33 @@ function q() {
52
52
  mode: "display",
53
53
  t: w
54
54
  });
55
- return /* @__PURE__ */ G(U, { children: [
56
- /* @__PURE__ */ G(d, {
57
- header: /* @__PURE__ */ W("div", {
55
+ return /* @__PURE__ */ K(W, { children: [
56
+ /* @__PURE__ */ K(d, {
57
+ header: /* @__PURE__ */ G("div", {
58
58
  "data-testid": "profile-hero",
59
- children: /* @__PURE__ */ W(f, {
60
- icon: R?.display.icon ? /* @__PURE__ */ W(ee, {
61
- name: R.display.icon,
59
+ children: /* @__PURE__ */ G(f, {
60
+ icon: L?.display.icon ? /* @__PURE__ */ G(D, {
61
+ name: L.display.icon,
62
62
  size: 16
63
63
  }) : void 0,
64
- title: z,
64
+ title: R,
65
65
  mode: "display",
66
66
  showTitle: C.isVisible("show_title"),
67
- highlights: /* @__PURE__ */ G("div", {
67
+ highlights: /* @__PURE__ */ K("div", {
68
68
  className: "flex flex-wrap gap-1",
69
69
  children: [
70
- /* @__PURE__ */ W(o, {
70
+ /* @__PURE__ */ G(o, {
71
71
  tone: "violet",
72
72
  size: "xs",
73
73
  dot: !0,
74
- children: V
74
+ children: H
75
75
  }),
76
- /* @__PURE__ */ W(o, {
76
+ /* @__PURE__ */ G(o, {
77
77
  tone: "slate",
78
78
  size: "xs",
79
- children: K
79
+ children: q
80
80
  }),
81
- c?.is_active && /* @__PURE__ */ W(o, {
81
+ c?.is_active && /* @__PURE__ */ G(o, {
82
82
  tone: "emerald",
83
83
  size: "xs",
84
84
  dot: !0,
@@ -86,132 +86,133 @@ function q() {
86
86
  })
87
87
  ]
88
88
  }),
89
- right: C.isVisible("show_actions") && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(n, {
90
- icon: /* @__PURE__ */ W(i.edit, { size: 13 }),
91
- onClick: () => I(!0),
89
+ right: C.isVisible("show_actions") && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(n, {
90
+ icon: /* @__PURE__ */ G(i.edit, { size: 13 }),
91
+ onClick: () => F(!0),
92
92
  children: w("profile.edit", "Edit profile")
93
- }), /* @__PURE__ */ W(n, {
94
- icon: /* @__PURE__ */ W(i.settings, { size: 13 }),
93
+ }), /* @__PURE__ */ G(n, {
94
+ icon: /* @__PURE__ */ G(i.settings, { size: 13 }),
95
95
  onClick: () => a("/preferences", { topLevel: !0 }),
96
96
  children: w("profile.preferences", "Preferences")
97
97
  })] })
98
98
  })
99
99
  }),
100
100
  children: [
101
- /* @__PURE__ */ W(s, {
101
+ /* @__PURE__ */ G(s, {
102
102
  title: w("profile.personal.title", "Personal info"),
103
- icon: /* @__PURE__ */ W(i.users, { size: 14 }),
104
- children: /* @__PURE__ */ W("div", {
103
+ icon: /* @__PURE__ */ G(i.users, { size: 14 }),
104
+ children: /* @__PURE__ */ G("div", {
105
105
  "data-testid": "profile-personal-info-grid",
106
- children: /* @__PURE__ */ G(m, { children: [
107
- c && R && M && /* @__PURE__ */ W(p, {
106
+ children: /* @__PURE__ */ K(m, { children: [
107
+ c && L && j && /* @__PURE__ */ G(p, {
108
108
  label: w("profile.avatar", "Avatar"),
109
- children: /* @__PURE__ */ W(x, { children: /* @__PURE__ */ W(Y, {
109
+ children: /* @__PURE__ */ G(x, { children: /* @__PURE__ */ G(re, {
110
110
  userId: c.id,
111
- entity: R,
112
- record: M,
111
+ entity: L,
112
+ record: j,
113
113
  onCommitted: async () => {
114
114
  await E.refetch();
115
115
  }
116
- }, J(M)) })
116
+ }, Y(j)) })
117
117
  }),
118
- /* @__PURE__ */ W(p, {
118
+ /* @__PURE__ */ G(p, {
119
119
  label: w("profile.display_name", "Display name"),
120
- children: q("display_name")
120
+ children: J("display_name")
121
121
  }),
122
- /* @__PURE__ */ W(p, {
122
+ /* @__PURE__ */ G(p, {
123
123
  label: w("profile.personal.email", "Email"),
124
124
  "data-testid": "profile-email",
125
- children: q("email")
125
+ children: J("email")
126
126
  }),
127
- /* @__PURE__ */ W(p, {
127
+ /* @__PURE__ */ G(p, {
128
128
  label: w("profile.personal.timezone", "Timezone"),
129
- children: re()
129
+ children: ae()
130
130
  }),
131
- /* @__PURE__ */ W($, {})
131
+ /* @__PURE__ */ G(Q, {})
132
132
  ] })
133
133
  })
134
134
  }),
135
- /* @__PURE__ */ W(s, {
135
+ /* @__PURE__ */ G(s, {
136
136
  title: w("profile.security.title", "Security"),
137
- icon: /* @__PURE__ */ W(i.shield, { size: 14 }),
138
- children: /* @__PURE__ */ W(m, { children: /* @__PURE__ */ W(p, {
137
+ icon: /* @__PURE__ */ G(i.shield, { size: 14 }),
138
+ children: /* @__PURE__ */ G(m, { children: /* @__PURE__ */ G(p, {
139
139
  label: w("profile.security.password", "Password"),
140
140
  hint: w("profile.security.password_hint", "Update at any time"),
141
- children: /* @__PURE__ */ W(n, {
141
+ children: /* @__PURE__ */ G(n, {
142
142
  size: "xs",
143
- onClick: () => P(!0),
143
+ onClick: () => N(!0),
144
144
  children: w("profile.security.password_change", "Change")
145
145
  })
146
146
  }) })
147
147
  }),
148
- /* @__PURE__ */ W(s, {
148
+ /* @__PURE__ */ G(s, {
149
149
  title: w("profile.access.title", "Access"),
150
- icon: /* @__PURE__ */ W(i.key, { size: 14 }),
151
- children: /* @__PURE__ */ G(m, { children: [
152
- /* @__PURE__ */ W(p, {
150
+ icon: /* @__PURE__ */ G(i.key, { size: 14 }),
151
+ children: /* @__PURE__ */ K(m, { children: [
152
+ /* @__PURE__ */ G(p, {
153
153
  label: w("profile.access.role", "Role"),
154
- children: /* @__PURE__ */ W(o, {
154
+ children: /* @__PURE__ */ G(o, {
155
155
  tone: "violet",
156
156
  size: "xs",
157
157
  dot: !0,
158
- children: V
158
+ children: H
159
159
  })
160
160
  }),
161
- /* @__PURE__ */ W(p, {
161
+ /* @__PURE__ */ G(p, {
162
162
  label: w("profile.access.groups", "Groups"),
163
- children: c?.roles && c.roles.length > 0 ? /* @__PURE__ */ W("div", {
163
+ children: c?.roles && c.roles.length > 0 ? /* @__PURE__ */ G("div", {
164
164
  className: "flex flex-wrap gap-1",
165
- children: c.roles.map((e) => /* @__PURE__ */ W(r, { children: B(e) }, e))
165
+ children: c.roles.map((e) => /* @__PURE__ */ G(r, { children: V(e) }, e))
166
166
  }) : g
167
167
  }),
168
- /* @__PURE__ */ W(p, {
168
+ /* @__PURE__ */ G(p, {
169
169
  label: w("profile.access.permissions", "Permissions"),
170
- children: te(w, "profile.access.permissions_explicit", c?.permissions?.length ?? 0, {
170
+ children: z(w, "profile.access.permissions_explicit", c?.permissions?.length ?? 0, {
171
171
  one: "{count} explicit",
172
172
  other: "{count} explicit"
173
173
  })
174
174
  })
175
175
  ] })
176
176
  }),
177
- /* @__PURE__ */ W(ie, { userId: c?.id }),
178
- c?.id && /* @__PURE__ */ W(Z, { userId: c.id }),
179
- S?.screen && b && R && M && /* @__PURE__ */ W(h, {
177
+ /* @__PURE__ */ G(oe, { userId: c?.id }),
178
+ /* @__PURE__ */ G(se, { userId: c?.id }),
179
+ c?.id && /* @__PURE__ */ G(X, { userId: c.id }),
180
+ S?.screen && b && L && j && /* @__PURE__ */ G(h, {
180
181
  screen: S.screen,
181
- entity: R,
182
+ entity: L,
182
183
  entityCode: "profile",
183
- record: M,
184
+ record: j,
184
185
  recordId: c?.id,
185
186
  schema: b
186
187
  })
187
188
  ]
188
189
  }),
189
- /* @__PURE__ */ W(X, {
190
- open: F,
190
+ /* @__PURE__ */ G(ie, {
191
+ open: P,
191
192
  initialName: c?.display_name ?? "",
192
193
  userId: c?.id ?? "",
193
- onClose: () => I(!1),
194
+ onClose: () => F(!1),
194
195
  onSaved: async () => {
195
- await u(), I(!1);
196
+ await u(), F(!1);
196
197
  }
197
198
  }),
198
- /* @__PURE__ */ W(_, {
199
- open: N,
200
- onClose: () => P(!1),
199
+ /* @__PURE__ */ G(_, {
200
+ open: M,
201
+ onClose: () => N(!1),
201
202
  onSubmit: async ({ current: e, next: t }) => {
202
- await y(e, t), D.success(w("profile.password.changed", "Password changed. Sign in again to continue."));
203
+ await y(e, t), O.success(w("profile.password.changed", "Password changed. Sign in again to continue."));
203
204
  }
204
205
  })
205
206
  ] });
206
207
  }
207
- function J(e) {
208
- return E(w(e, K))?.id ?? "";
208
+ function Y(e) {
209
+ return E(w(e, q))?.id ?? "";
209
210
  }
210
- function Y({ userId: t, entity: n, record: r, onCommitted: i }) {
211
- let a = L(), o = L("errors"), s = S(), [c, l] = H(!1), [u, d] = H(0), f = async (c) => {
211
+ function re({ userId: t, entity: n, record: r, onCommitted: i }) {
212
+ let a = I(), o = I("errors"), s = S(), [c, l] = U(!1), [u, d] = U(0), f = async (c) => {
212
213
  let u = C({
213
214
  entity: n,
214
- formData: { [K]: c },
215
+ formData: { [q]: c },
215
216
  record: r,
216
217
  isNew: !1
217
218
  });
@@ -219,19 +220,19 @@ function Y({ userId: t, entity: n, record: r, onCommitted: i }) {
219
220
  l(!0);
220
221
  try {
221
222
  await b(e, { id: t }, { $files: u });
222
- let n = J({ [K]: c });
223
- n && s.markCommitted(n), await i(), D.success(a("profile.avatar.updated", "Avatar updated."));
223
+ let n = Y({ [q]: c });
224
+ n && s.markCommitted(n), await i(), O.success(a("profile.avatar.updated", "Avatar updated."));
224
225
  } catch (e) {
225
- await s.flushAllDrafts(), d((e) => e + 1), D.error(R(o, e));
226
+ await s.flushAllDrafts(), d((e) => e + 1), O.error(L(o, e));
226
227
  } finally {
227
228
  l(!1);
228
229
  }
229
230
  }
230
231
  };
231
- return /* @__PURE__ */ W(B, { children: T({
232
+ return /* @__PURE__ */ G(V, { children: T({
232
233
  entity: n,
233
234
  entityCode: e,
234
- fieldName: K,
235
+ fieldName: q,
235
236
  record: r,
236
237
  mode: "edit",
237
238
  onChange: (e) => void f(e),
@@ -240,13 +241,13 @@ function Y({ userId: t, entity: n, record: r, onCommitted: i }) {
240
241
  fieldId: "profile-avatar"
241
242
  }) }, u);
242
243
  }
243
- function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
244
- let f = M().isPhone, p = L(), m = L("errors"), h = V(), [g, _] = H(r), [v, y] = H(!1), [x, S] = H(null);
244
+ function ie({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
245
+ let f = j().isPhone, p = I(), m = I("errors"), h = H(), [g, _] = U(r), [v, y] = U(!1), [x, S] = U(null);
245
246
  if (!t) return null;
246
247
  let C = () => {
247
248
  _(r), S(null), s();
248
249
  };
249
- return /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
250
+ return /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
250
251
  onClick: C,
251
252
  style: {
252
253
  position: "fixed",
@@ -255,7 +256,7 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
255
256
  zIndex: 60,
256
257
  backdropFilter: "blur(2px)"
257
258
  }
258
- }), /* @__PURE__ */ G("div", {
259
+ }), /* @__PURE__ */ K("div", {
259
260
  "data-testid": "edit-profile-dialog",
260
261
  style: {
261
262
  position: "fixed",
@@ -272,7 +273,7 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
272
273
  overflow: "hidden"
273
274
  },
274
275
  children: [
275
- /* @__PURE__ */ G("div", {
276
+ /* @__PURE__ */ K("div", {
276
277
  style: {
277
278
  padding: "14px 18px 0",
278
279
  display: "flex",
@@ -280,7 +281,7 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
280
281
  gap: 10
281
282
  },
282
283
  children: [
283
- /* @__PURE__ */ W("span", {
284
+ /* @__PURE__ */ G("span", {
284
285
  style: {
285
286
  width: 28,
286
287
  height: 28,
@@ -291,18 +292,18 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
291
292
  alignItems: "center",
292
293
  justifyContent: "center"
293
294
  },
294
- children: /* @__PURE__ */ W(i.edit, { size: 15 })
295
+ children: /* @__PURE__ */ G(i.edit, { size: 15 })
295
296
  }),
296
- /* @__PURE__ */ G("div", {
297
+ /* @__PURE__ */ K("div", {
297
298
  style: { flex: 1 },
298
- children: [/* @__PURE__ */ W("div", {
299
+ children: [/* @__PURE__ */ G("div", {
299
300
  style: {
300
301
  fontSize: 14,
301
302
  fontWeight: 600,
302
303
  color: "var(--text)"
303
304
  },
304
305
  children: p("profile.edit", "Edit profile")
305
- }), /* @__PURE__ */ W("div", {
306
+ }), /* @__PURE__ */ G("div", {
306
307
  style: {
307
308
  fontSize: 11.5,
308
309
  color: "var(--text-3)"
@@ -310,33 +311,33 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
310
311
  children: p("profile.edit.subtitle", "Update your display name.")
311
312
  })]
312
313
  }),
313
- /* @__PURE__ */ W(a, {
314
- icon: /* @__PURE__ */ W(i.x, { size: 14 }),
314
+ /* @__PURE__ */ G(a, {
315
+ icon: /* @__PURE__ */ G(i.x, { size: 14 }),
315
316
  title: p("profile.edit.close", "Close"),
316
317
  onClick: C
317
318
  })
318
319
  ]
319
320
  }),
320
- /* @__PURE__ */ G("div", {
321
+ /* @__PURE__ */ K("div", {
321
322
  style: {
322
323
  padding: "12px 18px 16px",
323
324
  display: "flex",
324
325
  flexDirection: "column",
325
326
  gap: 12
326
327
  },
327
- children: [/* @__PURE__ */ G("div", { children: [/* @__PURE__ */ W(c, {
328
+ children: [/* @__PURE__ */ K("div", { children: [/* @__PURE__ */ G(c, {
328
329
  required: !0,
329
330
  htmlFor: h,
330
331
  children: p("profile.display_name", "Display name")
331
- }), /* @__PURE__ */ W(l, {
332
+ }), /* @__PURE__ */ G(l, {
332
333
  id: h,
333
334
  value: g,
334
335
  onChange: _,
335
336
  placeholder: p("profile.edit.name_placeholder", "Your name"),
336
337
  autoFocus: !0
337
- })] }), x && /* @__PURE__ */ W(F, { text: x })]
338
+ })] }), x && /* @__PURE__ */ G(P, { text: x })]
338
339
  }),
339
- /* @__PURE__ */ G("div", {
340
+ /* @__PURE__ */ K("div", {
340
341
  style: {
341
342
  padding: "10px 16px",
342
343
  borderTop: "1px solid var(--divider)",
@@ -347,14 +348,14 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
347
348
  flexWrap: f ? "wrap" : "nowrap"
348
349
  },
349
350
  children: [
350
- /* @__PURE__ */ W("div", { style: { flex: 1 } }),
351
- /* @__PURE__ */ W(n, {
351
+ /* @__PURE__ */ G("div", { style: { flex: 1 } }),
352
+ /* @__PURE__ */ G(n, {
352
353
  onClick: C,
353
354
  children: p("dialog.cancel", "Cancel")
354
355
  }),
355
- /* @__PURE__ */ W(n, {
356
+ /* @__PURE__ */ G(n, {
356
357
  kind: "primary",
357
- icon: W(v ? u : i.check, { size: 13 }),
358
+ icon: G(v ? u : i.check, { size: 13 }),
358
359
  onClick: async () => {
359
360
  if (!g.trim()) S(p("profile.edit.name_required", "Display name is required."));
360
361
  else {
@@ -362,7 +363,7 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
362
363
  try {
363
364
  await b(e, { id: o }, { display_name: g.trim() }), await d();
364
365
  } catch (e) {
365
- S(R(m, e));
366
+ S(L(m, e));
366
367
  } finally {
367
368
  y(!1);
368
369
  }
@@ -376,45 +377,58 @@ function X({ open: t, initialName: r, userId: o, onClose: s, onSaved: d }) {
376
377
  ]
377
378
  })] });
378
379
  }
379
- function re() {
380
+ function ae() {
380
381
  try {
381
382
  return Intl.DateTimeFormat().resolvedOptions().timeZone || "—";
382
383
  } catch {
383
384
  return "—";
384
385
  }
385
386
  }
386
- function Z({ userId: t }) {
387
- let { data: n } = O(), r = Q(n);
388
- return /* @__PURE__ */ W(P, {
387
+ function X({ userId: t }) {
388
+ let { data: n } = k(), r = Z(n);
389
+ return /* @__PURE__ */ G(N, {
389
390
  carrierEntityCode: e,
390
391
  carrierScope: r,
391
392
  rowId: t
392
393
  });
393
394
  }
394
- function Q(e) {
395
+ function Z(e) {
395
396
  return e?.entities.profile?.params_scope ?? "profile";
396
397
  }
397
- function $() {
398
- let e = L(), { data: t } = O(), n = I().data?.find((e) => e.code === z);
399
- if (n?.scopes?.includes(Q(t))) return null;
398
+ function Q() {
399
+ let e = I(), { data: t } = k(), n = F().data?.find((e) => e.code === R);
400
+ if (n?.scopes?.includes(Z(t))) return null;
400
401
  let r = typeof n?.value == "string" ? n.value : e.language, i = t?.languages?.find((e) => e.code === r);
401
- return /* @__PURE__ */ W(p, {
402
+ return /* @__PURE__ */ G(p, {
402
403
  label: e(n?.name),
403
- children: n ? i?.name[i.code] || e(i?.name) || r : /* @__PURE__ */ W(u, { size: 12 })
404
+ children: n ? i?.name[i.code] || e(i?.name) || r : /* @__PURE__ */ G(u, { size: 12 })
404
405
  });
405
406
  }
406
- function ie({ userId: t }) {
407
- let { data: n } = O();
408
- if (!t || !n) return null;
409
- let r = n.entities[e];
410
- return r ? /* @__PURE__ */ W(N, {
407
+ function oe({ userId: e }) {
408
+ return /* @__PURE__ */ G($, {
409
+ userId: e,
410
+ associated: "api_key"
411
+ });
412
+ }
413
+ function se({ userId: e }) {
414
+ let { data: t } = k();
415
+ return t?.entities[J] ? /* @__PURE__ */ G($, {
416
+ userId: e,
417
+ associated: J
418
+ }) : null;
419
+ }
420
+ function $({ userId: t, associated: n }) {
421
+ let { data: r } = k();
422
+ if (!t || !r) return null;
423
+ let i = r.entities[e];
424
+ return i ? /* @__PURE__ */ G(M, {
411
425
  node: {
412
- associated: "api_key",
426
+ associated: n,
413
427
  foreign_key: "user_id"
414
428
  },
415
429
  ctx: {
416
- schema: n,
417
- entity: r,
430
+ schema: r,
431
+ entity: i,
418
432
  entityCode: e,
419
433
  recordId: t,
420
434
  record: { id: t },
@@ -423,4 +437,4 @@ function ie({ userId: t }) {
423
437
  }
424
438
  }) : null;
425
439
  }
426
- export { q as Profile, $ as ProfileLanguageRow, Z as ProfileParamsBlock };
440
+ export { ne as Profile, Q as ProfileLanguageRow, X as ProfileParamsBlock };
@@ -1993,6 +1993,11 @@ type AgentRole = "user" | "assistant" | "tool" | "system";
1993
1993
  type AgentContentBlock = {
1994
1994
  type: "text";
1995
1995
  text: string;
1996
+ callback_data?: string;
1997
+ heard?: boolean;
1998
+ } | {
1999
+ type: "reaction";
2000
+ emoji?: string;
1996
2001
  } | {
1997
2002
  type: "tool_use";
1998
2003
  id: string;
@@ -2054,7 +2059,17 @@ interface AgentMessage {
2054
2059
  turn_id?: string | null;
2055
2060
  created_at: string;
2056
2061
  streaming?: boolean;
2057
- }
2062
+ bot_id?: string | null;
2063
+ chat_id?: string | null;
2064
+ topic_id?: string | null;
2065
+ sender_external_id?: string | null;
2066
+ sender_user_id?: string | null;
2067
+ delivery_key?: string | null;
2068
+ delivery_status?: AgentDeliveryStatus | null;
2069
+ bot?: string;
2070
+ sender_user?: string;
2071
+ }
2072
+ type AgentDeliveryStatus = "pending" | "sent" | "failed" | "unknown";
2058
2073
  type AgentTurnStatus = "queued" | "running" | "waiting" | "completed" | "failed" | "canceled";
2059
2074
  interface AgentTurn {
2060
2075
  id: string;
@@ -2111,6 +2126,9 @@ interface AgentConversation {
2111
2126
  created_by?: string;
2112
2127
  agent_id?: string;
2113
2128
  agent?: string;
2129
+ chat_id?: string | null;
2130
+ topic_id?: string | null;
2131
+ updated_at?: string;
2114
2132
  title?: string;
2115
2133
  model?: string;
2116
2134
  status: AgentConversationStatus;