@declarion/react 0.106.0 → 0.109.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.
Files changed (34) hide show
  1. package/dist-lib/api/agents.js +8 -7
  2. package/dist-lib/api/client.js +48 -49
  3. package/dist-lib/components/agents/AgentChatPanel.impl.js +362 -301
  4. package/dist-lib/components/agents/ChatAttachments.js +144 -0
  5. package/dist-lib/components/agents/transcript-runs.js +1 -1
  6. package/dist-lib/components/chrome/AssociationTabs.js +89 -75
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +243 -235
  8. package/dist-lib/components/detail-layout/ChildrenCards.js +57 -55
  9. package/dist-lib/components/detail-layout/ChildrenList.js +45 -43
  10. package/dist-lib/components/detail-layout/ChildrenTable.js +93 -91
  11. package/dist-lib/components/detail-layout/ChildrenTimeline.js +160 -155
  12. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +127 -121
  13. package/dist-lib/components/fields/RefCombobox.js +53 -48
  14. package/dist-lib/components/fields/index.js +1 -0
  15. package/dist-lib/components/file-widgets/useFileSelection.js +152 -0
  16. package/dist-lib/components/pages/SmartDetailPage.impl.js +506 -482
  17. package/dist-lib/components/pages/SmartRecordListPage.impl.js +335 -300
  18. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +112 -109
  19. package/dist-lib/components/params/ParamsBlock.js +18 -15
  20. package/dist-lib/components/params/param-editors.js +60 -54
  21. package/dist-lib/components/primitives/RetryButton.js +14 -0
  22. package/dist-lib/components/primitives/StatTile.js +42 -34
  23. package/dist-lib/hooks/useAgentConversation.js +18 -13
  24. package/dist-lib/hooks/useParams.js +54 -52
  25. package/dist-lib/hooks/useSchema.js +5 -2
  26. package/dist-lib/hooks/useTimelineData.js +26 -24
  27. package/dist-lib/index.d.ts +89 -5
  28. package/dist-lib/index.js +95 -93
  29. package/dist-lib/lib/read-display-state.js +19 -0
  30. package/dist-lib/stores/auth.js +1 -0
  31. package/dist-lib/testing.d.ts +1 -1
  32. package/dist-lib/types/fieldType.js +1 -1
  33. package/dist-lib/{useResponsiveMode-ECv1AEhv.d.ts → useResponsiveMode-DODbtSrY.d.ts} +3 -0
  34. package/package.json +1 -1
@@ -6,15 +6,16 @@ async function n() {
6
6
  }
7
7
  async function r(t) {
8
8
  return {
9
- id: (await e("agent.start_conversation", { ...t.agent_id ? { agent_id: t.agent_id } : {} })).conversation_id,
9
+ id: (await e("agents.start_conversation", { ...t.agent_id ? { agent_id: t.agent_id } : {} })).conversation_id,
10
10
  status: "active"
11
11
  };
12
12
  }
13
- async function i(t, n, r) {
13
+ async function i(t, n, r, i) {
14
14
  return {
15
- id: (await e("agent.send_message", {
15
+ id: (await e("agents.send_message", {
16
16
  conversation_id: n,
17
- text: t,
17
+ ...t ? { text: t } : {},
18
+ ...i?.length ? { attachments: i } : {},
18
19
  ...r ? { context: r } : {}
19
20
  })).message_id,
20
21
  conversation_id: n,
@@ -22,7 +23,7 @@ async function i(t, n, r) {
22
23
  };
23
24
  }
24
25
  async function a(t, n) {
25
- await e("agent.answer_question", {
26
+ await e("agents.answer_question", {
26
27
  invocation_id: t,
27
28
  answer: n
28
29
  });
@@ -43,10 +44,10 @@ async function c(e, t) {
43
44
  });
44
45
  }
45
46
  async function l(t) {
46
- await e("agent.cancel_question", { invocation_id: t });
47
+ await e("agents.cancel_question", { invocation_id: t });
47
48
  }
48
49
  async function u(t) {
49
- await e("agent.cancel_conversation", { conversation_id: t });
50
+ await e("agents.cancel_conversation", { conversation_id: t });
50
51
  }
51
52
  async function d() {
52
53
  let e = await t("agent_conversation", {
@@ -116,11 +116,11 @@ async function A() {
116
116
  let n = await O(t);
117
117
  return T(n), n;
118
118
  }
119
- var j = null;
120
- function M(n) {
119
+ var j = null, M = /* @__PURE__ */ new Set(["auth.token_refresh_needed", "auth.unauthorized"]);
120
+ function N(n) {
121
121
  return n instanceof t || n instanceof e;
122
122
  }
123
- async function N() {
123
+ async function P() {
124
124
  if (j !== null) throw new S(j);
125
125
  return h || (h = x().catch((e) => {
126
126
  throw e instanceof S && (j = e.status), e;
@@ -128,67 +128,66 @@ async function N() {
128
128
  h = null;
129
129
  }), h);
130
130
  }
131
- var P = () => {
131
+ var F = () => {
132
132
  if (typeof window > "u") return;
133
133
  let { pathname: e } = window.location;
134
134
  e.startsWith("/login") || e.startsWith("/signup") || e === "/reset" || e === "/forgot" || e === "/2fa" || (window.location.href = i());
135
135
  };
136
- function F(e) {
137
- let t = P;
138
- return P = e, t;
136
+ function I(e) {
137
+ let t = F;
138
+ return F = e, t;
139
139
  }
140
- function I() {
141
- return P;
140
+ function L() {
141
+ return F;
142
142
  }
143
- var L = ({ status: e, code: t, message: n }) => {
143
+ var R = ({ status: e, code: t, message: n }) => {
144
144
  console.error(`[API ${e}] ${t}: ${n}`);
145
145
  };
146
- function R(e, t, n, r) {
146
+ function z(e, t, n, r) {
147
147
  let i = new Headers(e);
148
148
  return !i.has("Content-Type") && t && i.set("Content-Type", "application/json"), n.setAccept && !i.has("Accept") && i.set("Accept", "*/*"), r && i.set("Authorization", `Bearer ${r}`), i;
149
149
  }
150
- var z = null, B = 0;
151
- function V(e) {
152
- e || B++, z = e || null;
150
+ var B = null, V = 0;
151
+ function H(e) {
152
+ e || V++, B = e || null;
153
153
  }
154
- function H() {
155
- return B;
154
+ function U() {
155
+ return V;
156
156
  }
157
- function U(e, t) {
158
- e === B && (z = t || null);
157
+ function W(e, t) {
158
+ e === V && (B = t || null);
159
159
  }
160
- function W() {
161
- return z;
160
+ function G() {
161
+ return B;
162
162
  }
163
- function G(e) {
164
- return !z || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(z)}`;
163
+ function K(e) {
164
+ return !B || !e.startsWith("/api/") || /[?&]language=/.test(e) ? e : `${e}${e.includes("?") ? "&" : "?"}language=${encodeURIComponent(B)}`;
165
165
  }
166
- async function K(t, i, u, f) {
167
- let p = G(t), m = c(), h = m ? "omit" : "include", g = R(i.headers, !!i.body, u, m ? s() : null), _ = d(t, i), v = await D(p, {
166
+ async function q(t, i, u, f) {
167
+ let p = K(t), m = c(), h = m ? "omit" : "include", g = z(i.headers, !!i.body, u, m ? s() : null), _ = d(t, i), v = await D(p, {
168
168
  ...i,
169
169
  headers: g,
170
170
  credentials: h
171
171
  }, _);
172
172
  if (l(v.headers), !v.ok) {
173
173
  let { raw: t, body: s } = await r(v), c = n(s.type), l = s.title ?? "";
174
- if (v.status === 401 && (c === "auth.token_refresh_needed" || c === "auth.unauthorized")) try {
174
+ if (v.status === 401 && M.has(c)) try {
175
175
  let t = null;
176
- m ? (o(), t = await a()) : await N();
177
- let n = R(i.headers, !!i.body, u, t), s = await D(p, {
176
+ m ? (o(), t = await a()) : await P();
177
+ let s = z(i.headers, !!i.body, u, t), c = await D(p, {
178
178
  ...i,
179
- headers: n,
179
+ headers: s,
180
180
  credentials: h
181
181
  }, _);
182
- if (!s.ok) {
183
- s.status === 401 && !u.isSessionProbe && P();
184
- let t = await r(s);
185
- throw new e(s.status, t.body, t.raw);
182
+ if (!c.ok) {
183
+ let t = await r(c);
184
+ throw !m && c.status === 401 && M.has(n(t.body.type)) && (j = 401), c.status === 401 && !u.isSessionProbe && F(), new e(c.status, t.body, t.raw);
186
185
  }
187
- return f(s);
186
+ return f(c);
188
187
  } catch (n) {
189
- throw M(n) ? n : (u.isSessionProbe || P(), new e(401, s, t));
188
+ throw N(n) ? n : (u.isSessionProbe || F(), new e(401, s, t));
190
189
  }
191
- throw v.status === 401 && !u.isSessionProbe && P(), L({
190
+ throw v.status === 401 && !u.isSessionProbe && F(), R({
192
191
  status: v.status,
193
192
  code: c,
194
193
  message: l
@@ -196,29 +195,29 @@ async function K(t, i, u, f) {
196
195
  }
197
196
  return f(v);
198
197
  }
199
- function q(e) {
198
+ function J(e) {
200
199
  return e.status === 204 ? Promise.resolve(void 0) : e.json();
201
200
  }
202
- async function J(e, t = {}, { isSessionProbe: n = !1 } = {}) {
203
- return K(e, t, {
201
+ async function Y(e, t = {}, { isSessionProbe: n = !1 } = {}) {
202
+ return q(e, t, {
204
203
  setAccept: !1,
205
204
  isSessionProbe: n
206
- }, q);
205
+ }, J);
207
206
  }
208
- async function Y(e) {
207
+ async function X(e) {
209
208
  return {
210
209
  blob: await e.blob(),
211
- filename: Z(e.headers),
210
+ filename: Q(e.headers),
212
211
  headers: e.headers
213
212
  };
214
213
  }
215
- async function X(e, t = {}) {
216
- return K(e, t, {
214
+ async function Z(e, t = {}) {
215
+ return q(e, t, {
217
216
  setAccept: !0,
218
217
  isSessionProbe: !1
219
- }, Y);
218
+ }, X);
220
219
  }
221
- function Z(e) {
220
+ function Q(e) {
222
221
  let t = e.get("Content-Disposition");
223
222
  if (!t) return "";
224
223
  let n = t.match(/filename\*\s*=\s*([^']*)'([^']*)'([^;]+)/i);
@@ -228,14 +227,14 @@ function Z(e) {
228
227
  let r = t.match(/filename\s*=\s*("([^"]+)"|([^;]+))/i);
229
228
  return r ? (r[2] ?? r[3] ?? "").trim() : "";
230
229
  }
231
- async function Q(e, t = {}, { isSessionProbe: n = !1 } = {}) {
232
- return (await K(`/api/actions/${encodeURIComponent(e)}`, {
230
+ async function $(e, t = {}, { isSessionProbe: n = !1 } = {}) {
231
+ return (await q(`/api/actions/${encodeURIComponent(e)}`, {
233
232
  method: "POST",
234
233
  body: m(t)
235
234
  }, {
236
235
  setAccept: !1,
237
236
  isSessionProbe: n
238
- }, q)).result;
237
+ }, J)).result;
239
238
  }
240
239
  //#endregion
241
- export { S as RefreshDeadError, J as apiFetch, X as apiFetchBlob, Q as callHandler, E as cancelProactiveRefresh, W as currentPublishedLanguage, H as currentReader, N as ensureRefresh, I as getPersistentAuthFailureHandler, M as isTransientFailure, Z as parseContentDispositionFilename, V as publishLanguage, U as publishLanguageFor, T as scheduleProactiveRefresh, F as setPersistentAuthFailureHandler, G as withPublishedLanguage };
240
+ export { S as RefreshDeadError, Y as apiFetch, Z as apiFetchBlob, $ as callHandler, E as cancelProactiveRefresh, G as currentPublishedLanguage, U as currentReader, P as ensureRefresh, L as getPersistentAuthFailureHandler, N as isTransientFailure, Q as parseContentDispositionFilename, H as publishLanguage, W as publishLanguageFor, T as scheduleProactiveRefresh, I as setPersistentAuthFailureHandler, K as withPublishedLanguage };