@declarion/react 0.446.0 → 0.517.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 (43) hide show
  1. package/dist-lib/components/agents/AgentChatPanel.impl.js +349 -332
  2. package/dist-lib/components/detail-layout/DetailAuditStrip.js +1 -1
  3. package/dist-lib/components/detail-layout/EvidenceBlock.js +36 -24
  4. package/dist-lib/components/detail-layout/FieldRow.js +56 -60
  5. package/dist-lib/components/detail-layout/FieldsBlock.js +48 -47
  6. package/dist-lib/components/detail-layout/PropertiesBlock.js +42 -41
  7. package/dist-lib/components/detail-layout/labelLayout.js +35 -0
  8. package/dist-lib/components/fields/JsonField.js +128 -125
  9. package/dist-lib/components/fields/StringField.js +10 -25
  10. package/dist-lib/components/fields/StructureField.js +125 -167
  11. package/dist-lib/components/fields/ValueRows.js +114 -0
  12. package/dist-lib/components/fields/cells/factories/id.js +10 -0
  13. package/dist-lib/components/fields/cells/factories/nextRun.js +18 -27
  14. package/dist-lib/components/fields/cells/factories/refLink.js +15 -41
  15. package/dist-lib/components/fields/cells/registry.js +25 -23
  16. package/dist-lib/components/file-widgets/DocumentCard.js +142 -142
  17. package/dist-lib/components/file-widgets/helpers.js +32 -19
  18. package/dist-lib/components/file-widgets/host.js +4 -1
  19. package/dist-lib/components/list/PeekFieldCell.js +57 -55
  20. package/dist-lib/components/list/QuickPeek.js +109 -121
  21. package/dist-lib/components/pages/SmartDetailPage.impl.js +403 -400
  22. package/dist-lib/components/pages/SmartListPage.impl.js +260 -260
  23. package/dist-lib/components/pages/list/ListCardRow.js +101 -100
  24. package/dist-lib/components/pages/list/cardProjection.js +117 -112
  25. package/dist-lib/components/pages/list/useListQuery.js +1 -1
  26. package/dist-lib/components/pages/list/useListRowInteraction.js +68 -65
  27. package/dist-lib/components/primitives/IdBadge.js +27 -0
  28. package/dist-lib/components/primitives/RowField.js +11 -43
  29. package/dist-lib/components/shared/CopyButton.js +13 -18
  30. package/dist-lib/components/shared/RefChip.js +33 -0
  31. package/dist-lib/declarion-react.css +1 -1
  32. package/dist-lib/hooks/useAgentConversation.js +134 -110
  33. package/dist-lib/hooks/useCopy.js +18 -0
  34. package/dist-lib/index.d.ts +55 -20
  35. package/dist-lib/index.js +116 -111
  36. package/dist-lib/lib/realtime-reconcile.js +70 -59
  37. package/dist-lib/lib/reference.js +52 -34
  38. package/dist-lib/lib/short-id.js +12 -0
  39. package/dist-lib/testing.d.ts +1 -1
  40. package/dist-lib/types/schema.js +84 -80
  41. package/dist-lib/{useResponsiveMode-3hOLBkey.d.ts → useResponsiveMode-BObVfNyN.d.ts} +7 -2
  42. package/package.json +6 -1
  43. package/dist-lib/components/primitives/RecordIdBadge.js +0 -25
@@ -1,32 +1,37 @@
1
- import { approveInvocation as e, cancelConversation as t, cancelInvocation as n, createConversation as r, listAvailableAgents as i, listConversations as a, loadConversation as o, loadConversationInvocations as s, loadConversationTurns as c, loadHistory as l, rejectInvocation as ee, sendElicitResponse as te, sendMessage as ne } from "../api/agents.js";
2
- import { AGENT_FRAME_EVENT as u, AGENT_MESSAGE_CHANGED_EVENT as d, agentBus as f } from "../api/events.js";
3
- import { useAuthStore as p } from "../stores/auth.js";
4
- import { ApiError as m } from "../types/api.js";
5
- import { coerceDisplayString as h } from "../lib/display-value.js";
6
- import { useCallback as g, useEffect as _, useMemo as re, useRef as v, useState as y } from "react";
1
+ import { approveInvocation as e, cancelConversation as t, cancelInvocation as n, createConversation as r, listAvailableAgents as i, listConversations as a, loadConversation as o, loadConversationInvocations as s, loadConversationTurns as c, loadHistory as l, rejectInvocation as u, sendElicitResponse as ee, sendMessage as te } from "../api/agents.js";
2
+ import { AGENT_FRAME_EVENT as d, AGENT_MESSAGE_CHANGED_EVENT as f, agentBus as p } from "../api/events.js";
3
+ import { useAuthStore as m } from "../stores/auth.js";
4
+ import { ApiError as h } from "../types/api.js";
5
+ import { coerceDisplayString as g } from "../lib/display-value.js";
6
+ import { useCallback as _, useEffect as v, useMemo as ne, useRef as y, useState as b } from "react";
7
7
  // src/hooks/useAgentConversation.ts
8
- var b = { streaming: !1 }, x = "declarion.agents.conversation_id";
9
- function S(e, t) {
10
- if (e) return t ? `${x}:${e}:${t}` : `${x}:${e}`;
8
+ var x = { streaming: !1 }, S = "declarion.agents.conversation_id";
9
+ function C(e, t, n) {
10
+ if (e) return [
11
+ S,
12
+ e,
13
+ t,
14
+ n
15
+ ].filter(Boolean).join(":");
11
16
  }
12
- function ie(e, t) {
17
+ function re(e, t, n) {
13
18
  if (typeof window > "u") return;
14
- let n = S(e, t);
15
- if (n) try {
16
- return window.localStorage.getItem(n) || void 0;
19
+ let r = C(e, t, n);
20
+ if (r) try {
21
+ return window.localStorage.getItem(r) || void 0;
17
22
  } catch {
18
23
  return;
19
24
  }
20
25
  }
21
- function ae(e, t, n) {
26
+ function ie(e, t, n, r) {
22
27
  if (typeof window > "u") return;
23
- let r = S(e, t);
24
- if (r) try {
25
- n ? window.localStorage.setItem(r, n) : window.localStorage.removeItem(r);
28
+ let i = C(e, t, r);
29
+ if (i) try {
30
+ n ? window.localStorage.setItem(i, n) : window.localStorage.removeItem(i);
26
31
  } catch {}
27
32
  }
28
- function C(e) {
29
- return !(e instanceof m) || e.code !== "entity.foreign_key_violation" ? !1 : e.ext("constraint") === "agent_messages_tenant_conv_fk";
33
+ function ae(e) {
34
+ return !(e instanceof h) || e.code !== "entity.foreign_key_violation" ? !1 : e.ext("constraint") === "agent_messages_tenant_conv_fk";
30
35
  }
31
36
  function w(e, t) {
32
37
  return {
@@ -54,19 +59,19 @@ function E(e, t) {
54
59
  }) : r.push(i)));
55
60
  return n ? r : e;
56
61
  }
57
- function oe(e) {
62
+ function D(e) {
58
63
  let t = e;
59
64
  for (let n of e) n.role === "assistant" && n.streaming && (t = E(t, n.id));
60
65
  return t;
61
66
  }
62
- function D(e, t, n, r) {
67
+ function O(e, t, n, r) {
63
68
  let i = !1, a = e.map((e) => e.id === n ? (i = !0, r(e)) : e);
64
69
  return i ? a : [...e, r(w(n, t))];
65
70
  }
66
- function O(e, t, n, r) {
71
+ function k(e, t, n, r) {
67
72
  if (!r) return e;
68
73
  let i = e.find((e) => e.id === n);
69
- return i && !i.streaming ? e : D(T(e, n), t, n, (e) => {
74
+ return i && !i.streaming ? e : O(T(e, n), t, n, (e) => {
70
75
  let t = [...e.content], n = t[t.length - 1];
71
76
  return n?.type === "text" ? t[t.length - 1] = {
72
77
  ...n,
@@ -81,9 +86,9 @@ function O(e, t, n, r) {
81
86
  };
82
87
  });
83
88
  }
84
- function se(e, t, n, r, i, a) {
89
+ function oe(e, t, n, r, i, a) {
85
90
  let o = e.find((e) => e.id === n);
86
- return o && !o.streaming ? e : D(T(e, n), t, n, (e) => r && e.content.some((e) => e.type === "tool_use" && e.id === r) ? e.streaming ? e : {
91
+ return o && !o.streaming ? e : O(T(e, n), t, n, (e) => r && e.content.some((e) => e.type === "tool_use" && e.id === r) ? e.streaming ? e : {
87
92
  ...e,
88
93
  streaming: !0
89
94
  } : {
@@ -97,7 +102,7 @@ function se(e, t, n, r, i, a) {
97
102
  }]
98
103
  });
99
104
  }
100
- function ce(e, t) {
105
+ function se(e, t) {
101
106
  let n = /* @__PURE__ */ new Map();
102
107
  for (let e of t) e.response_message_id && e.provider_call_id && n.set(`${e.response_message_id}\u0000${e.provider_call_id}`, e);
103
108
  return e.map((e) => {
@@ -120,7 +125,7 @@ function ce(e, t) {
120
125
  } : e;
121
126
  });
122
127
  }
123
- function le(e, t) {
128
+ function ce(e, t) {
124
129
  let n = e.map((e) => e.streaming ? {
125
130
  ...e,
126
131
  streaming: !1
@@ -137,35 +142,60 @@ function le(e, t) {
137
142
  }
138
143
  return n;
139
144
  }
140
- function k(e) {
145
+ function A(e) {
141
146
  let t = e.payload?.message_id;
142
147
  return typeof t == "string" && t ? t : void 0;
143
148
  }
144
- function A(m, x) {
145
- let S = p.getState().activeTenant?.id, [w, A] = y(m ?? ie(S, x)), j = g((e) => {
146
- ae(S, x, e), A(e);
147
- }, [S, x]), [M, N] = y([]), [ue, P] = y(b), [de, F] = y([]), [I, L] = y([]), [R, z] = y([]), [B, V] = y(1), [fe, H] = y(!1), [pe, U] = y();
148
- _(() => {
149
+ function le(e) {
150
+ let [t, n] = b([]), [r, a] = b(), [o, s] = b(e ? "pending" : "found");
151
+ return v(() => {
152
+ let t = !0;
153
+ return i().then((r) => {
154
+ if (!t) return;
155
+ n(r);
156
+ let i = e ? r.find((t) => t.code === e) : void 0;
157
+ a((t) => t ?? (e ? i : r.find((e) => e.is_default))?.id), e && s(i ? "found" : "missing");
158
+ }).catch((n) => {
159
+ console.warn("agents.list_available failed; the agent picker is unavailable", n), t && e && s("missing");
160
+ }), () => {
161
+ t = !1;
162
+ };
163
+ }, [e]), {
164
+ agents: t,
165
+ selectedAgentId: r,
166
+ setSelectedAgentId: a,
167
+ agentLookup: o
168
+ };
169
+ }
170
+ function j(i, h, S) {
171
+ let C = m.getState().activeTenant?.id, [w, j] = b(i ?? re(C, h, S)), M = _((e) => {
172
+ ie(C, h, e, S), j(e);
173
+ }, [
174
+ C,
175
+ h,
176
+ S
177
+ ]), [N, P] = b([]), [ue, F] = b(x), [de, I] = b([]), [L, R] = b([]), [z, B] = b([]), [V, H] = b(1), [fe, U] = b(!1), [pe, W] = b();
178
+ v(() => {
149
179
  if (!w) {
150
- U(void 0);
180
+ W(void 0);
151
181
  return;
152
182
  }
153
183
  let e = !1;
154
184
  return o(w).then((t) => {
155
- e || U(t);
185
+ e || W(t);
156
186
  }, () => {
157
- e || U(void 0);
187
+ e || W(void 0);
158
188
  }), () => {
159
189
  e = !0;
160
190
  };
161
191
  }, [w]);
162
- let [me, he] = y([]), [W, G] = y(), K = v(/* @__PURE__ */ new Set()), q = v(0), J = v(null), ge = (e) => (J.current?.fingerprint !== e && (J.current = {
192
+ let { agents: me, selectedAgentId: G, setSelectedAgentId: he, agentLookup: ge } = le(h), K = y(/* @__PURE__ */ new Set()), q = y(0), J = y(null), _e = (e) => (J.current?.fingerprint !== e && (J.current = {
163
193
  key: crypto.randomUUID(),
164
194
  fingerprint: e
165
195
  }), J.current.key);
166
- _(() => {
196
+ v(() => {
167
197
  if (!w) {
168
- N([]), P(b), F([]), L([]);
198
+ P([]), F(x), I([]), R([]);
169
199
  return;
170
200
  }
171
201
  if (K.current.has(w)) {
@@ -183,18 +213,18 @@ function A(m, x) {
183
213
  ...e,
184
214
  streaming: !1
185
215
  } : e);
186
- N(a), F(r), L(i);
216
+ P(a), I(r), R(i);
187
217
  }, (t) => {
188
- e || t?.status === 404 && (j(void 0), N([]));
218
+ e || t?.status === 404 && (M(void 0), P([]));
189
219
  }), () => {
190
220
  e = !0;
191
221
  };
192
- }, [w, j]);
193
- let Y = v(w);
194
- _(() => {
222
+ }, [w, M]);
223
+ let Y = y(w);
224
+ v(() => {
195
225
  Y.current = w;
196
226
  }, [w]);
197
- let X = v(!1), Z = v(null), Q = g((e) => {
227
+ let X = y(!1), Z = y(null), Q = _((e) => {
198
228
  if (X.current) {
199
229
  Z.current = e;
200
230
  return;
@@ -206,14 +236,14 @@ function A(m, x) {
206
236
  c(e),
207
237
  s(e)
208
238
  ]).then(([n, r, i]) => {
209
- e === Y.current && t === q.current && (N((e) => le(n, e)), F(r), L(i));
239
+ e === Y.current && t === q.current && (P((e) => ce(n, e)), I(r), R(i));
210
240
  }, () => {}).finally(() => {
211
241
  X.current = !1;
212
242
  let e = Z.current;
213
243
  Z.current = null, e && Q(e);
214
244
  });
215
245
  }, []);
216
- _(() => {
246
+ v(() => {
217
247
  let e = (e) => {
218
248
  let { convId: n, kind: r, turnId: i, payload: a } = e.detail;
219
249
  n === Y.current && t(n, {
@@ -222,28 +252,28 @@ function A(m, x) {
222
252
  payload: a
223
253
  });
224
254
  };
225
- f.addEventListener(u, e);
255
+ p.addEventListener(d, e);
226
256
  let t = (e, t) => {
227
257
  switch (t.kind) {
228
258
  case "turn.started":
229
- P((e) => ({
259
+ F((e) => ({
230
260
  ...e,
231
261
  streaming: !0
232
- })), N((e) => T(e));
262
+ })), P((e) => T(e));
233
263
  break;
234
264
  case "assistant.message.created": {
235
265
  let n = typeof t.payload?.message_id == "string" ? t.payload.message_id : "";
236
266
  if (!n) break;
237
- N((t) => D(T(t, n), e, n, (e) => ({
267
+ P((t) => O(T(t, n), e, n, (e) => ({
238
268
  ...e,
239
269
  streaming: !0
240
270
  })));
241
271
  break;
242
272
  }
243
273
  case "text.delta": {
244
- let n = h(t.payload?.text), r = k(t);
274
+ let n = g(t.payload?.text), r = A(t);
245
275
  if (!r || !n) break;
246
- N((t) => O(t, e, r, n));
276
+ P((t) => k(t, e, r, n));
247
277
  break;
248
278
  }
249
279
  case "elicit.pending":
@@ -253,9 +283,9 @@ function A(m, x) {
253
283
  Q(e);
254
284
  break;
255
285
  case "tool.proposed": {
256
- let n = k(t), r = typeof t.payload?.tool == "string" ? t.payload.tool : "", i = t.payload?.params ?? {}, a = typeof t.payload?.tool_use_id == "string" ? t.payload.tool_use_id : "";
286
+ let n = A(t), r = typeof t.payload?.tool == "string" ? t.payload.tool : "", i = t.payload?.params ?? {}, a = typeof t.payload?.tool_use_id == "string" ? t.payload.tool_use_id : "";
257
287
  if (!n || !r) break;
258
- N((t) => se(t, e, n, a, r, i));
288
+ P((t) => oe(t, e, n, a, r, i));
259
289
  break;
260
290
  }
261
291
  case "tool.result":
@@ -264,12 +294,12 @@ function A(m, x) {
264
294
  Q(e);
265
295
  break;
266
296
  case "turn.finished": {
267
- P(b);
268
- let e = k(t);
269
- e && N((t) => E(t, e));
297
+ F(x);
298
+ let e = A(t);
299
+ e && P((t) => E(t, e));
270
300
  break;
271
301
  }
272
- case "error": N((e) => oe(e)), P((e) => ({
302
+ case "error": P((e) => D(e)), F((e) => ({
273
303
  ...e,
274
304
  streaming: !1
275
305
  }));
@@ -278,14 +308,15 @@ function A(m, x) {
278
308
  let e = Y.current;
279
309
  e && Q(e);
280
310
  };
281
- return f.addEventListener(d, n), () => {
282
- f.removeEventListener(u, e), f.removeEventListener(d, n);
311
+ return p.addEventListener(f, n), () => {
312
+ p.removeEventListener(d, e), p.removeEventListener(f, n);
283
313
  };
284
314
  }, [Q]);
285
- let $ = g(async (e, t, n = []) => {
315
+ let ve = _(async (e, t, n = []) => {
316
+ if (h && !G) throw Error(`the agent ${h} is not available`);
286
317
  let i = n.map((e) => e.id), a = w;
287
- a || (a = (await r({ agent_id: W })).id, K.current.add(a), Y.current = a, j(a));
288
- let o, s = (n) => ne(e, n, t, i, ge(JSON.stringify([
318
+ a || (a = (await r({ agent_id: G })).id, K.current.add(a), Y.current = a, M(a));
319
+ let o, s = (n) => te(e, n, t, i, _e(JSON.stringify([
289
320
  n,
290
321
  e,
291
322
  t ?? null,
@@ -294,10 +325,10 @@ function A(m, x) {
294
325
  try {
295
326
  o = await s(a);
296
327
  } catch (e) {
297
- if (!C(e)) throw e;
298
- a = (await r({ agent_id: W })).id, K.current.add(a), Y.current = a, j(a), o = await s(a);
328
+ if (!ae(e)) throw e;
329
+ a = (await r({ agent_id: G })).id, K.current.add(a), Y.current = a, M(a), o = await s(a);
299
330
  }
300
- J.current = null, N((t) => {
331
+ J.current = null, P((t) => {
301
332
  if (t.some((e) => e.id === o.id)) return t;
302
333
  let r = e ? [{
303
334
  type: "text",
@@ -311,58 +342,51 @@ function A(m, x) {
311
342
  });
312
343
  }, [
313
344
  w,
314
- j,
315
- W
316
- ]), _e = g(async (t, n) => {
345
+ M,
346
+ G,
347
+ h
348
+ ]), ye = _(async (t, n) => {
317
349
  await e(t, n), w && Q(w);
318
- }, [w, Q]), ve = g(async (e, t) => {
319
- await ee(e, t), w && Q(w);
320
- }, [w, Q]), ye = g(async (e, t) => {
321
- w && (await te(w, e, t), Q(w));
322
- }, [w, Q]), be = g(async (e) => {
350
+ }, [w, Q]), be = _(async (e, t) => {
351
+ await u(e, t), w && Q(w);
352
+ }, [w, Q]), xe = _(async (e, t) => {
353
+ w && (await ee(w, e, t), Q(w));
354
+ }, [w, Q]), Se = _(async (e) => {
323
355
  w && (await n(e), Q(w));
324
- }, [w, Q]), xe = g(async () => {
356
+ }, [w, Q]), Ce = _(async () => {
325
357
  w && await t(w);
326
- }, [w]), Se = g(async () => {
358
+ }, [w]), $ = _(async () => {
327
359
  let e = await a();
328
- z(e), V(1), H(e.length === 50);
329
- }, []), Ce = g(async () => {
330
- let e = await a(B + 1);
331
- z((t) => [...t, ...e.filter((e) => !t.some((t) => t.id === e.id))]), V(B + 1), H(e.length === 50);
332
- }, [B]), we = g(() => {
333
- j(void 0), N([]), P(b);
334
- }, [j]);
335
- return _(() => {
336
- let e = !0;
337
- return i().then((t) => {
338
- e && (he(t), G((e) => e ?? t.find((e) => x ? e.code === x : e.is_default)?.id));
339
- }).catch((e) => {
340
- console.warn("agents.list_available failed; the agent picker is unavailable", e);
341
- }), () => {
342
- e = !1;
343
- };
344
- }, [x]), {
360
+ B(e), H(1), U(e.length === 50);
361
+ }, []), we = _(async () => {
362
+ let e = await a(V + 1);
363
+ B((t) => [...t, ...e.filter((e) => !t.some((t) => t.id === e.id))]), H(V + 1), U(e.length === 50);
364
+ }, [V]), Te = _(() => {
365
+ M(void 0), P([]), F(x);
366
+ }, [M]);
367
+ return {
345
368
  conversationId: w,
346
- messages: re(() => ce(M, I), [M, I]),
369
+ messages: ne(() => se(N, L), [N, L]),
347
370
  turn: ue,
348
371
  turns: de,
349
- invocations: I,
350
- conversations: R,
372
+ invocations: L,
373
+ conversations: z,
351
374
  openedConversation: pe,
352
375
  moreConversations: fe,
353
- showMoreConversations: Ce,
354
- send: $,
355
- approve: _e,
356
- reject: ve,
357
- submitInput: ye,
358
- cancelInput: be,
359
- cancel: xe,
360
- refreshConversations: Se,
361
- startNew: we,
376
+ showMoreConversations: we,
377
+ send: ve,
378
+ approve: ye,
379
+ reject: be,
380
+ submitInput: xe,
381
+ cancelInput: Se,
382
+ cancel: Ce,
383
+ refreshConversations: $,
384
+ startNew: Te,
362
385
  agents: me,
363
- selectedAgentId: W,
364
- selectAgent: G,
365
- setConversationId: j
386
+ selectedAgentId: G,
387
+ agentLookup: ge,
388
+ selectAgent: he,
389
+ setConversationId: M
366
390
  };
367
391
  }
368
- export { A as useAgentConversation };
392
+ export { j as useAgentConversation };
@@ -0,0 +1,18 @@
1
+ import { useCallback as e, useState as t } from "react";
2
+ // src/hooks/useCopy.ts
3
+ var n = 1500;
4
+ function r(r) {
5
+ let [i, a] = t(!1);
6
+ return {
7
+ copied: i,
8
+ copy: e(async (e) => {
9
+ e?.stopPropagation(), e?.preventDefault();
10
+ try {
11
+ await navigator.clipboard.writeText(r), a(!0), window.setTimeout(() => a(!1), n);
12
+ } catch {
13
+ a(!1);
14
+ }
15
+ }, [r])
16
+ };
17
+ }
18
+ export { n as COPY_FEEDBACK_MS, r as useCopy };
@@ -1,7 +1,7 @@
1
- import { $ as Action, $t as FileFieldValue, A as EnrichedRow, At as resolveDetailRoute, B as Refs, Bt as FilterURLState, C as ApiErrorBody, Ct as extractPkValues, D as CURSOR_SEMANTICS_MISMATCH, Dt as pkValuesFromId, E as CURSOR_LANGUAGE_CHANGED, Et as pkValuePartsToId, F as LoginResponse, Ft as pickLocalized, G as V2ListParams, Gt as hasOrGroups, H as StatusInfo, Ht as NO_VALUE_OPS, I as ParamLookup, It as pluralText, J as V2ParamInstance, Jt as setFiltersInURL, K as V2ListResponse, Kt as parseFilterURLState, L as PropertyValue, Lt as textWithNodes, M as ListMeta, Mt as TextFn, N as ListParams, Nt as TextVars, O as CheckSetupResponse, Ot as pkValuesToDetailId, P as ListResponse, Pt as makeTextFn, Q as isCursorStaleError, Qt as FileFieldMode, R as PublicParam, Rt as FilterNode, S as ApiError, St as buildRowDetailHref, T as BrandingIdentity, Tt as getPrimaryKeyFields, U as Tenant, Ut as OP_LABELS, V as SignupResponse, Vt as FilterValueResolver, W as TenantEnv, Wt as countActiveFilters, X as V2StatusInstance, Xt as FileFieldDef, Y as V2PropertyInstance, Yt as FileAddress, Z as errorCodeOf, Zt as FileFieldDisplay, _ as executeAction, _t as StatusDef, a as ResponsiveMode, at as EnumDef, b as AggregateParams, bt as buildDetailHrefFromId, c as resolveViewportCategory, ct as LocalizedString, d as ActionExecuteResponse, dt as PkValues, en as HydratedFile, et as AreaDef, f as ActionItemError, ft as PropertyDef, g as deleteObject, gt as SpecialValue, h as buildActionBody, ht as Screen, i as ResponsiveBreakpoints, it as EntityField, j as ImpersonationInfo, jt as MANDATORY_LANGUAGE, k as DataResponse, kt as pkValuesToId, l as ActionBatchError, lt as NavNode, m as GetEntityOptions, mt as Schema, n as useResponsiveMode, nn as UploadedFile, nt as ClassificationTierDef, o as ResponsiveViewport, ot as FieldAccessInfo, p as ActionItemSkip, pt as RefConfig, q as V2Meta, qt as parseFiltersFromURL, r as DEFAULT_RESPONSIVE_BREAKPOINTS, rn as OrderedMap, rt as Entity, s as ViewportCategory, st as LanguageDef, t as ResponsiveModeProvider, tn as UploadProgress, tt as ChildRelation, u as ActionExecuteRequest, ut as ParameterDef, v as restoreObject, vt as StatusGroupDef, w as AuthUser, wt as fieldDisplayName, x as AggregateResponse, xt as buildEntityDetailHref, y as AggregateGroup, yt as StructureDef, z as PublicParamsResponse, zt as FilterOp } from "./useResponsiveMode-3hOLBkey.js";
1
+ import { $ as Action, $t as FileFieldValue, A as EnrichedRow, At as resolveDetailRoute, B as Refs, Bt as FilterURLState, C as ApiErrorBody, Ct as extractPkValues, D as CURSOR_SEMANTICS_MISMATCH, Dt as pkValuesFromId, E as CURSOR_LANGUAGE_CHANGED, Et as pkValuePartsToId, F as LoginResponse, Ft as pickLocalized, G as V2ListParams, Gt as hasOrGroups, H as StatusInfo, Ht as NO_VALUE_OPS, I as ParamLookup, It as pluralText, J as V2ParamInstance, Jt as setFiltersInURL, K as V2ListResponse, Kt as parseFilterURLState, L as PropertyValue, Lt as textWithNodes, M as ListMeta, Mt as TextFn, N as ListParams, Nt as TextVars, O as CheckSetupResponse, Ot as pkValuesToDetailId, P as ListResponse, Pt as makeTextFn, Q as isCursorStaleError, Qt as FileFieldMode, R as PublicParam, Rt as FilterNode, S as ApiError, St as buildRowDetailHref, T as BrandingIdentity, Tt as getPrimaryKeyFields, U as Tenant, Ut as OP_LABELS, V as SignupResponse, Vt as FilterValueResolver, W as TenantEnv, Wt as countActiveFilters, X as V2StatusInstance, Xt as FileFieldDef, Y as V2PropertyInstance, Yt as FileAddress, Z as errorCodeOf, Zt as FileFieldDisplay, _ as executeAction, _t as StatusDef, a as ResponsiveMode, at as EnumDef, b as AggregateParams, bt as buildDetailHrefFromId, c as resolveViewportCategory, ct as LocalizedString, d as ActionExecuteResponse, dt as PkValues, en as HydratedFile, et as AreaDef, f as ActionItemError, ft as PropertyDef, g as deleteObject, gt as SpecialValue, h as buildActionBody, ht as Screen, i as ResponsiveBreakpoints, it as EntityField, j as ImpersonationInfo, jt as MANDATORY_LANGUAGE, k as DataResponse, kt as pkValuesToId, l as ActionBatchError, lt as NavNode, m as GetEntityOptions, mt as Schema, n as useResponsiveMode, nn as UploadedFile, nt as ClassificationTierDef, o as ResponsiveViewport, ot as FieldAccessInfo, p as ActionItemSkip, pt as RefConfig, q as V2Meta, qt as parseFiltersFromURL, r as DEFAULT_RESPONSIVE_BREAKPOINTS, rn as OrderedMap, rt as Entity, s as ViewportCategory, st as LanguageDef, t as ResponsiveModeProvider, tn as UploadProgress, tt as ChildRelation, u as ActionExecuteRequest, ut as ParameterDef, v as restoreObject, vt as StatusGroupDef, w as AuthUser, wt as fieldDisplayName, x as AggregateResponse, xt as buildEntityDetailHref, y as AggregateGroup, yt as StructureDef, z as PublicParamsResponse, zt as FilterOp } from "./useResponsiveMode-BObVfNyN.js";
2
2
  import { i as setIconRegistry, n as getIcon, t as IconDef } from "./icon-registry-BY2tt-GF.js";
3
3
  import { i as DynamicIcon, n as IconName, r as IconProps, t as Icon } from "./Icons-BdXCxyw3.js";
4
- import { ButtonHTMLAttributes, CSSProperties, ComponentType, InputHTMLAttributes, MouseEvent, ReactNode, RefObject } from "react";
4
+ import { ButtonHTMLAttributes, CSSProperties, ComponentType, InputHTMLAttributes, MouseEvent, ReactNode, RefObject, SyntheticEvent } from "react";
5
5
  import { QueryClient, QueryKey, UseQueryResult } from "@tanstack/react-query";
6
6
  import { useLocation, useNavigate, useParams, useSearchParams } from "react-router";
7
7
  export declare function App(): import("react").JSX.Element;
@@ -443,9 +443,48 @@ interface FieldRendererProps {
443
443
  t: TextFn;
444
444
  detailScreen?: string;
445
445
  }
446
- export declare function StructureField(props: FieldRendererProps & {
447
- nested?: boolean;
446
+ export declare function StructureField(props: FieldRendererProps): import("react").JSX.Element;
447
+ interface ValueRow {
448
+ key: string;
449
+ label: string;
450
+ title?: string;
451
+ value?: ReactNode;
452
+ rows?: ValueRow[];
453
+ }
454
+ export declare function ValueRows({ rows, flat }: {
455
+ rows: ValueRow[];
456
+ flat?: boolean;
448
457
  }): import("react").JSX.Element;
458
+ export declare function shortId(value: string): string;
459
+ export declare function useCopy(value: string): {
460
+ copied: boolean;
461
+ copy: (event?: SyntheticEvent) => Promise<void>;
462
+ };
463
+ export declare function jsonRows(value: object, label?: (key: string) => string): ValueRow[];
464
+ export declare function parseJsonText(value: unknown): object | undefined;
465
+ export declare function isNestable(value: unknown): value is object;
466
+ interface FieldsGridProps {
467
+ columns?: number;
468
+ children: ReactNode;
469
+ }
470
+ export declare function FieldsGrid({ columns, children }: FieldsGridProps): import("react").JSX.Element;
471
+ interface FieldRowProps {
472
+ label: ReactNode;
473
+ children: ReactNode;
474
+ span?: boolean;
475
+ nested?: boolean;
476
+ required?: boolean;
477
+ error?: string;
478
+ hint?: ReactNode;
479
+ actions?: ReactNode;
480
+ copyValue?: string;
481
+ mode?: "display" | "edit";
482
+ htmlFor?: string;
483
+ labelId?: string;
484
+ labelTitle?: string;
485
+ "data-testid"?: string;
486
+ }
487
+ export declare function FieldRow({ label, children, span, nested, required, error, hint, actions, copyValue, mode, htmlFor, labelId, labelTitle, "data-testid": testId }: FieldRowProps): import("react").JSX.Element;
449
488
  type LiveObjectResult<T extends Record<string, unknown> = EnrichedRow> = UseQueryResult<DataResponse<T>, Error> & {
450
489
  object: T | undefined;
451
490
  isLive: boolean;
@@ -1328,11 +1367,6 @@ interface QuickPeekProps<R extends Record<string, unknown> = Record<string, unkn
1328
1367
  onSave?: (next: R) => void;
1329
1368
  }
1330
1369
  export declare function QuickPeek<R extends Record<string, unknown>>({ entity, entityCode, record, title, recordId, avatarName, fields, refs, entities, screens, screen, actions, screenActionLayout, entityActionLayout, executeAction, onClose, onOpen, onSave }: QuickPeekProps<R>): import("react").JSX.Element;
1331
- interface QEFieldProps {
1332
- label: string;
1333
- children: ReactNode;
1334
- }
1335
- export declare function QEField({ label, children }: QEFieldProps): import("react").JSX.Element;
1336
1370
  type BtnKind = "primary" | "ghost" | "subtle" | "default";
1337
1371
  type BtnSize = "xs" | "sm" | "md" | "lg";
1338
1372
  type BtnProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size"> & {
@@ -1474,14 +1508,10 @@ type StatTileProps = {
1474
1508
  href?: string;
1475
1509
  };
1476
1510
  export declare function StatTile({ label, value, unit, tone, delta, note, footer, loading, error, onRetry, href }: StatTileProps): import("react").JSX.Element;
1477
- type RecordIdBadgeProps = {
1511
+ type IdBadgeProps = {
1478
1512
  value: string;
1479
1513
  };
1480
- /**
1481
- * Compact record-ID badge. Truncates UUIDs to their first segment for readability
1482
- * and copies the full value on click. Non-UUID ids render in full.
1483
- */
1484
- export declare function RecordIdBadge({ value }: RecordIdBadgeProps): import("react").JSX.Element;
1514
+ export declare function IdBadge({ value }: IdBadgeProps): import("react").JSX.Element;
1485
1515
  type RowFieldProps = {
1486
1516
  label: ReactNode;
1487
1517
  children?: ReactNode;
@@ -1490,7 +1520,7 @@ type RowFieldProps = {
1490
1520
  required?: boolean;
1491
1521
  hint?: string;
1492
1522
  };
1493
- export declare function RowField({ label, children, wide, editing, required }: RowFieldProps): import("react").JSX.Element;
1523
+ export declare function RowField({ label, children, wide, editing, required, hint }: RowFieldProps): import("react").JSX.Element;
1494
1524
  type BoolToggleProps = {
1495
1525
  value?: boolean;
1496
1526
  onChange?: (v: boolean) => void;
@@ -1698,6 +1728,9 @@ interface FileWidgetProps {
1698
1728
  recordTitle?: string;
1699
1729
  uploadFieldCode?: string;
1700
1730
  uploadSlotCode?: string;
1731
+ refs?: Refs;
1732
+ entities?: Record<string, Entity>;
1733
+ screens?: Record<string, Screen>;
1701
1734
  fieldId?: string;
1702
1735
  }
1703
1736
  type FileWidget = React.ComponentType<FileWidgetProps>;
@@ -2219,6 +2252,7 @@ interface AgentChatPanelProps {
2219
2252
  askOnOpen?: string;
2220
2253
  docked?: boolean;
2221
2254
  agentCode?: string;
2255
+ conversationScope?: string;
2222
2256
  }
2223
2257
  export declare function AgentChatPanel(props: AgentChatPanelProps): import("react").JSX.Element | null;
2224
2258
  type JSONSchemaProp = {
@@ -2267,9 +2301,9 @@ export declare function AgentConversationDrawer({ open, onClose, conversations,
2267
2301
  interface AgentTurnState {
2268
2302
  streaming: boolean;
2269
2303
  }
2270
- /** agentCode names the agent a screen's own panel talks to: it is preselected instead of the tenant's default, and the
2271
- * panel remembers its conversation apart from the general one. */
2272
- export declare function useAgentConversation(initialConversationId?: string, agentCode?: string): {
2304
+ /** agentCode names the agent a screen's own panel talks to: it is preselected instead of the tenant's default, nothing is
2305
+ * sent until it is found, and the panel remembers its conversation apart from the general one, per scope (a record). */
2306
+ export declare function useAgentConversation(initialConversationId?: string, agentCode?: string, scope?: string): {
2273
2307
  conversationId: string | undefined;
2274
2308
  messages: AgentMessage[];
2275
2309
  turn: AgentTurnState;
@@ -2289,6 +2323,7 @@ export declare function useAgentConversation(initialConversationId?: string, age
2289
2323
  startNew: () => void;
2290
2324
  agents: AvailableAgent[];
2291
2325
  selectedAgentId: string | undefined;
2326
+ agentLookup: "pending" | "found" | "missing";
2292
2327
  selectAgent: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
2293
2328
  setConversationId: (id: string | undefined) => void;
2294
2329
  };
@@ -2452,4 +2487,4 @@ export declare function isFieldSoDProtected(schema: Schema | undefined, entity:
2452
2487
  * both classification name + required_permission hint).
2453
2488
  */
2454
2489
  export declare function fieldAccessInfo(entity: Entity | undefined, fieldName: string): FieldAccessInfo | undefined;
2455
- export { type Action, ActionBatchError, type ActionExecuteRequest, type ActionExecuteResponse, type ActionItemError, type ActionItemSkip, type ActionListPage, type AgentChatPanelProps, type AgentContentBlock, type AgentConversation, type AgentConversationDrawerProps, type AgentConversationStatus, type AgentElicitFormProps, type AgentInvocationKind, type AgentInvocationStatus, type AgentMessage, type AgentMessengerButton, type AgentPickerProps, type AgentRole, type AgentToolInvocation, type AgentTurn, type AgentTurnState, type AgentTurnStatus, type AggregateGroup, type AggregateParams, type AggregateResponse, type ApiError, App as Declarion, type ApprovalScope, type AuthShellProps, type AuthUser, type AvailableAgent, type AvatarProps, type BatchOp, type BatchOpResult, type BatchResponse, type BoolToggleProps, type BrandGlyphProps, type BreadcrumbsProps, type BtnKind, type BtnProps, type BtnSize, CURSOR_LANGUAGE_CHANGED, CURSOR_SEMANTICS_MISMATCH, type CanonicalLocation, type ChangePasswordDialogProps, type CheckProps, type CheckSetupResponse, type ChildRelation, type ChipProps, type ClassificationTierDef, type CommandAction, type CommandActionType, type CommandPaletteProps, type CropperOptions, type CropperResult, type Crumb, type CurrencyDisplay, type CurrentScreen, type CursorActionDataResult, type CursorEntityDataParams, type CursorEntityDataResult, type CustomScreenProps, DEFAULT_RESPONSIVE_BREAKPOINTS, type DataResponse, type DateInputProps, type DeclaredValue, type DraftEntry, type DropdownProps, DynamicIcon, type EnrichedRow, type Entity, type EntityField, type EnumDef, type FieldAccessInfo, type FieldLabelProps, type FileAddress, type FileDraftScopeApi, type FileFieldDef, type FileFieldDisplay, type FileFieldMode, type FileSelection, type FileSelectionEvent, type FileSelectionState, type FileSelectionSummary, type FileWidget, type FileWidgetProps, type FilterNode, type FilterOp, type FilterRecord, type FilterRecordField, type FilterRecordFields, type FilterURLState, type HoverCardAlign, type HoverCardProps, type HydratedFile, Icon, type IconBtnProps, type IconDef, type IconName, type IconProps, type ImageCropper, type InfoTooltipProps, type InlineEditCellProps, type InlineEditKind, type InlineEditTrigger, type JsonFieldProps, type LanguageDef, type LayoutWidget, type LayoutWidgetProps, type ListMeta, type ListParams, type ListResponse, type LiveObjectResult, type LocalizedString, type LoginResponse, MANDATORY_LANGUAGE, MULTIPLE_VALUES, type MassEditTarget, type MassEditTargetKind, type MenuItemProps, type MoneyTextOptions, type MultiSelectProps, NO_VALUE_OPS, type NavNode, OP_LABELS, type ObjectActionBarProps, type ObjectActionBarSlot, type ObjectActionSelection, OrderedMap, type PageStateSetter, type ParameterDef, type PasswordInputProps, type PatchMap, type PillColor, type PillProps, type PillSize, type PillTone, type PkValues, type PropertyDef, type PropertyValue, type PublicParam, type QEFieldProps, type QuickEditCellProps, type QuickPeekFieldSpec, type QuickPeekProps, type RailAreaItem, type RailProps, type ReadDisplayState, type ReadQuery, type RecordIdBadgeProps, type RefComboboxProps, type RefFieldItem, type RefFieldProps, type RefreshControlProps, type Refs, type ResponsiveBreakpoints, type ResponsiveMode, ResponsiveModeProvider, type ResponsiveViewport, type ReturnTarget, type RowFieldProps, type RowHelpers, type RunActionOptions, type Schema, type Screen, type ScreenBack, type ScrollAnchor, type ScrollableVirtualizer, type SectionBadge, type SectionCardProps, type SectionEmphasis, type SelectOption, type SelectProps, type SidebarProps, type StatTileProps, type StatTileTone, type StatusDef, type StatusGroupDef, type StatusInfo, type StructureDef, type TabItem, type TabStripProps, type TagsInputProps, type Tenant, type TenantChipProps, type TextAreaProps, type TextFn, type TextInputProps, type TextVars, type TooltipProps, type TopBarProps, type UploadCheck, type UploadProgress, type UploadedFile, type UseFileSelection, type UseFileSelectionOptions, type UseObjectActionsResult, type UseScreenBackOptions, type UseScreenTabOptions, type V2ListParams, type V2ListResponse, type V2Meta, type V2ParamInstance, type V2PropertyInstance, type V2StatusInstance, type ViewFieldProps, type ViewportCategory, buildActionBody, buildDetailHrefFromId, buildEntityDetailHref, buildRowDetailHref, countActiveFilters, deleteObject, errorCodeOf, executeAction, extractPkValues, fieldDisplayName, getIcon, getPrimaryKeyFields, hasOrGroups, isCursorStaleError, makeTextFn, parseFilterURLState, parseFiltersFromURL, pickLocalized, pkValuePartsToId, pkValuesFromId, pkValuesToDetailId, pkValuesToId, pluralText, resolveDetailRoute, resolveViewportCategory, restoreObject, setFiltersInURL, setIconRegistry, textWithNodes, useLocation, useNavigate, useParams, useResponsiveMode, useSearchParams };
2490
+ export { type Action, ActionBatchError, type ActionExecuteRequest, type ActionExecuteResponse, type ActionItemError, type ActionItemSkip, type ActionListPage, type AgentChatPanelProps, type AgentContentBlock, type AgentConversation, type AgentConversationDrawerProps, type AgentConversationStatus, type AgentElicitFormProps, type AgentInvocationKind, type AgentInvocationStatus, type AgentMessage, type AgentMessengerButton, type AgentPickerProps, type AgentRole, type AgentToolInvocation, type AgentTurn, type AgentTurnState, type AgentTurnStatus, type AggregateGroup, type AggregateParams, type AggregateResponse, type ApiError, App as Declarion, type ApprovalScope, type AuthShellProps, type AuthUser, type AvailableAgent, type AvatarProps, type BatchOp, type BatchOpResult, type BatchResponse, type BoolToggleProps, type BrandGlyphProps, type BreadcrumbsProps, type BtnKind, type BtnProps, type BtnSize, CURSOR_LANGUAGE_CHANGED, CURSOR_SEMANTICS_MISMATCH, type CanonicalLocation, type ChangePasswordDialogProps, type CheckProps, type CheckSetupResponse, type ChildRelation, type ChipProps, type ClassificationTierDef, type CommandAction, type CommandActionType, type CommandPaletteProps, type CropperOptions, type CropperResult, type Crumb, type CurrencyDisplay, type CurrentScreen, type CursorActionDataResult, type CursorEntityDataParams, type CursorEntityDataResult, type CustomScreenProps, DEFAULT_RESPONSIVE_BREAKPOINTS, type DataResponse, type DateInputProps, type DeclaredValue, type DraftEntry, type DropdownProps, DynamicIcon, type EnrichedRow, type Entity, type EntityField, type EnumDef, type FieldAccessInfo, type FieldLabelProps, type FileAddress, type FileDraftScopeApi, type FileFieldDef, type FileFieldDisplay, type FileFieldMode, type FileSelection, type FileSelectionEvent, type FileSelectionState, type FileSelectionSummary, type FileWidget, type FileWidgetProps, type FilterNode, type FilterOp, type FilterRecord, type FilterRecordField, type FilterRecordFields, type FilterURLState, type HoverCardAlign, type HoverCardProps, type HydratedFile, Icon, type IconBtnProps, type IconDef, type IconName, type IconProps, type IdBadgeProps, type ImageCropper, type InfoTooltipProps, type InlineEditCellProps, type InlineEditKind, type InlineEditTrigger, type JsonFieldProps, type LanguageDef, type LayoutWidget, type LayoutWidgetProps, type ListMeta, type ListParams, type ListResponse, type LiveObjectResult, type LocalizedString, type LoginResponse, MANDATORY_LANGUAGE, MULTIPLE_VALUES, type MassEditTarget, type MassEditTargetKind, type MenuItemProps, type MoneyTextOptions, type MultiSelectProps, NO_VALUE_OPS, type NavNode, OP_LABELS, type ObjectActionBarProps, type ObjectActionBarSlot, type ObjectActionSelection, OrderedMap, type PageStateSetter, type ParameterDef, type PasswordInputProps, type PatchMap, type PillColor, type PillProps, type PillSize, type PillTone, type PkValues, type PropertyDef, type PropertyValue, type PublicParam, type QuickEditCellProps, type QuickPeekFieldSpec, type QuickPeekProps, type RailAreaItem, type RailProps, type ReadDisplayState, type ReadQuery, type RefComboboxProps, type RefFieldItem, type RefFieldProps, type RefreshControlProps, type Refs, type ResponsiveBreakpoints, type ResponsiveMode, ResponsiveModeProvider, type ResponsiveViewport, type ReturnTarget, type RowFieldProps, type RowHelpers, type RunActionOptions, type Schema, type Screen, type ScreenBack, type ScrollAnchor, type ScrollableVirtualizer, type SectionBadge, type SectionCardProps, type SectionEmphasis, type SelectOption, type SelectProps, type SidebarProps, type StatTileProps, type StatTileTone, type StatusDef, type StatusGroupDef, type StatusInfo, type StructureDef, type TabItem, type TabStripProps, type TagsInputProps, type Tenant, type TenantChipProps, type TextAreaProps, type TextFn, type TextInputProps, type TextVars, type TooltipProps, type TopBarProps, type UploadCheck, type UploadProgress, type UploadedFile, type UseFileSelection, type UseFileSelectionOptions, type UseObjectActionsResult, type UseScreenBackOptions, type UseScreenTabOptions, type V2ListParams, type V2ListResponse, type V2Meta, type V2ParamInstance, type V2PropertyInstance, type V2StatusInstance, type ValueRow, type ViewFieldProps, type ViewportCategory, buildActionBody, buildDetailHrefFromId, buildEntityDetailHref, buildRowDetailHref, countActiveFilters, deleteObject, errorCodeOf, executeAction, extractPkValues, fieldDisplayName, getIcon, getPrimaryKeyFields, hasOrGroups, isCursorStaleError, makeTextFn, parseFilterURLState, parseFiltersFromURL, pickLocalized, pkValuePartsToId, pkValuesFromId, pkValuesToDetailId, pkValuesToId, pluralText, resolveDetailRoute, resolveViewportCategory, restoreObject, setFiltersInURL, setIconRegistry, textWithNodes, useLocation, useNavigate, useParams, useResponsiveMode, useSearchParams };