@lumerahq/ui 0.19.4 → 0.19.5

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.
@@ -1,9 +1,9 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, cloneElement, isValidElement, useCallback, Suspense, lazy, Fragment as Fragment$1, useLayoutEffect } from "react";
4
- import { u as useAgentChat, b as useAgentChatSessions, a as areAgentChatMutationsBlocked, c as useAutomationRun } from "./use-automation-run-DnVJ1_3F.js";
4
+ import { u as useAgentChat, b as useAgentChatSessions, a as areAgentChatMutationsBlocked, c as useAutomationRun } from "./use-automation-run-CuJ-xpUg.js";
5
5
  import { t as twMerge, p as clsx, o as cn$2, a as formatCellValue$2 } from "./formatters-D4T821Dv.js";
6
- import { v as pbSql, f as getDownloadUrl, p as parentApiRequest, d as parentApiStream, B as BridgeError, g as getAppProjectExternalId, _ as resolveProjectResourceId, C as automationStatuses, N as getAutomationRunFileDownloadUrl, T as listAutomationRunFiles } from "./automations-C6SMookl.js";
6
+ import { A as pbSql, n as getDownloadUrl, p as parentApiRequest, k as parentApiStream, B as BridgeError, g as getAppProjectExternalId, a3 as resolveProjectResourceId, I as automationStatuses, S as getAutomationRunFileDownloadUrl, Y as listAutomationRunFiles } from "./automations-TTSbZaKC.js";
7
7
  import * as ReactDOM from "react-dom";
8
8
  import { createPortal } from "react-dom";
9
9
  const mergeClasses = (...classes) => classes.filter((className, index2, array) => {
@@ -24010,7 +24010,7 @@ var lr = (e) => {
24010
24010
  for (; t > 0 && e[t - 1] === `
24011
24011
  `; ) t--;
24012
24012
  return e.slice(0, t);
24013
- }, cr = lazy(() => import("./highlighted-body-OFNGDK62-CqC81Ot1.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24013
+ }, cr = lazy(() => import("./highlighted-body-OFNGDK62-BZWB5CNY.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24014
24014
  let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
24015
24015
  `).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
24016
24016
  return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
@@ -24372,7 +24372,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
24372
24372
  let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
24373
24373
  return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
24374
24374
  };
24375
- var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-B2G9Qig1.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24375
+ var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-DGRhAYJL.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24376
24376
  function qe(e, t) {
24377
24377
  if (!(e != null && e.position || t != null && t.position)) return true;
24378
24378
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -1,4 +1,4 @@
1
- import { Z as requestApi } from "./automations-C6SMookl.js";
1
+ import { a2 as requestApi } from "./automations-TTSbZaKC.js";
2
2
  const RECORD_AUDIT_EXPORT_LIMIT = 1e4;
3
3
  const RECORD_AUDIT_MAX_COLLECTIONS = 20;
4
4
  const normalizeRecordAuditPageSize = (value = 50) => Math.min(200, Math.max(1, Math.trunc(value) || 50));
@@ -81,6 +81,17 @@ let hasStoredHostPayload = false;
81
81
  function getAppProjectExternalId() {
82
82
  return storedHostPayload?.app?.projectExternalId;
83
83
  }
84
+ function getViewerContext() {
85
+ return storedHostPayload?.viewer;
86
+ }
87
+ const isOrganizationMember = (viewer) => viewer?.belongsToOrganization === true && viewer.organizationMembership != null;
88
+ const isCompanyAdmin = (viewer) => isOrganizationMember(viewer) && viewer.organizationMembership.isCompanyAdmin;
89
+ const isDepartment = (viewer, departmentKey) => isOrganizationMember(viewer) && viewer.organizationMembership.department?.key.trim().toLowerCase() === departmentKey.trim().toLowerCase();
90
+ const hasMemberTag = (viewer, tagKey) => {
91
+ if (!isOrganizationMember(viewer)) return false;
92
+ const normalized = tagKey.trim().toLowerCase();
93
+ return viewer.organizationMembership.tags.some((tag) => tag.key.trim().toLowerCase() === normalized);
94
+ };
84
95
  const normalizeHash = (hash) => {
85
96
  if (!hash) return "";
86
97
  return hash.startsWith("#") ? hash : `#${hash}`;
@@ -521,6 +532,76 @@ const directHostApiStream = (request2, handlers) => {
521
532
  };
522
533
  };
523
534
  let directModeInitFired = false;
535
+ const normalizeViewerSubject = (value) => {
536
+ if (value === "org_member") return "org_member";
537
+ if (value === "app_user" || value === "public_app_user") return "public_app_user";
538
+ return "anonymous";
539
+ };
540
+ const viewerContextFromMe = (me) => {
541
+ const response = me.viewer;
542
+ const subjectType = normalizeViewerSubject(response?.subject_type ?? me.subject_type);
543
+ const user = me.user ?? null;
544
+ if (response) {
545
+ const membership = response.organization_membership;
546
+ const appUser = response.app_user;
547
+ return {
548
+ version: 1,
549
+ isSignedIn: response.is_signed_in === true,
550
+ subjectType,
551
+ belongsToOrganization: response.belongs_to_organization === true,
552
+ identity: response.identity ? {
553
+ id: response.identity.id ?? "",
554
+ name: response.identity.name ?? "",
555
+ email: response.identity.email ?? ""
556
+ } : null,
557
+ organizationMembership: membership ? {
558
+ id: membership.id ?? "",
559
+ role: membership.role ?? "",
560
+ isCompanyAdmin: membership.is_company_admin === true,
561
+ department: membership.department ?? null,
562
+ tags: membership.tags ?? []
563
+ } : null,
564
+ appUser: appUser ? { id: appUser.id ?? "", role: appUser.role ?? "" } : null
565
+ };
566
+ }
567
+ if (subjectType === "org_member" && user) {
568
+ return {
569
+ version: 1,
570
+ isSignedIn: true,
571
+ subjectType,
572
+ belongsToOrganization: true,
573
+ identity: { id: user.id, name: user.name, email: user.email },
574
+ organizationMembership: {
575
+ id: user.id,
576
+ role: user.role ?? "",
577
+ isCompanyAdmin: user.role?.toLowerCase() === "admin",
578
+ department: null,
579
+ tags: []
580
+ },
581
+ appUser: null
582
+ };
583
+ }
584
+ if (subjectType === "public_app_user" && user) {
585
+ return {
586
+ version: 1,
587
+ isSignedIn: true,
588
+ subjectType,
589
+ belongsToOrganization: false,
590
+ identity: { id: user.id, name: user.name, email: user.email },
591
+ organizationMembership: null,
592
+ appUser: { id: user.id, role: user.role ?? "" }
593
+ };
594
+ }
595
+ return {
596
+ version: 1,
597
+ isSignedIn: false,
598
+ subjectType: "anonymous",
599
+ belongsToOrganization: false,
600
+ identity: null,
601
+ organizationMembership: null,
602
+ appUser: null
603
+ };
604
+ };
524
605
  const fireDirectModeInit = () => {
525
606
  if (directModeInitFired || !isDirectMode()) return;
526
607
  directModeInitFired = true;
@@ -528,7 +609,7 @@ const fireDirectModeInit = () => {
528
609
  let payload;
529
610
  try {
530
611
  const response = await fetch("/api/me", { credentials: "same-origin" });
531
- if (response.ok || response.status === 401) {
612
+ if (response.ok) {
532
613
  let me;
533
614
  try {
534
615
  me = await response.json();
@@ -543,7 +624,8 @@ const fireDirectModeInit = () => {
543
624
  projectExternalId: me.project_external_id,
544
625
  accessLevel: me.access_level
545
626
  },
546
- subjectType: me.subject_type
627
+ subjectType: me.subject_type,
628
+ viewer: viewerContextFromMe(me)
547
629
  };
548
630
  }
549
631
  }
@@ -568,15 +650,48 @@ const logout = async () => {
568
650
  const fireDevModeInit = () => {
569
651
  if (devModeInitFired || !isStandaloneDevMode()) return;
570
652
  devModeInitFired = true;
653
+ const role = viteEnv.VITE_DEV_USER_ROLE ?? "admin";
654
+ const departmentKey = viteEnv.VITE_DEV_USER_DEPARTMENT ?? "finance";
655
+ const tagKeys = parseParentOrigins(viteEnv.VITE_DEV_USER_TAGS ?? "approver");
656
+ const identity = {
657
+ id: viteEnv.VITE_DEV_USER_ID ?? "__dev_user__",
658
+ name: viteEnv.VITE_DEV_USER_NAME ?? "Dev User",
659
+ email: viteEnv.VITE_DEV_USER_EMAIL ?? "dev@localhost"
660
+ };
571
661
  const mockPayload = {
572
662
  company: {
573
663
  id: viteEnv.VITE_DEV_COMPANY_ID ?? "__dev_company__",
574
664
  name: viteEnv.VITE_DEV_COMPANY_NAME ?? "Dev Company"
575
665
  },
576
666
  user: {
577
- id: viteEnv.VITE_DEV_USER_ID ?? "__dev_user__",
578
- name: viteEnv.VITE_DEV_USER_NAME ?? "Dev User",
579
- email: viteEnv.VITE_DEV_USER_EMAIL ?? "dev@localhost"
667
+ ...identity,
668
+ role
669
+ },
670
+ subjectType: "org_member",
671
+ viewer: {
672
+ version: 1,
673
+ isSignedIn: true,
674
+ subjectType: "org_member",
675
+ belongsToOrganization: true,
676
+ identity,
677
+ organizationMembership: {
678
+ id: identity.id,
679
+ role,
680
+ isCompanyAdmin: role.toLowerCase() === "admin",
681
+ department: departmentKey ? {
682
+ id: `__dev_department_${departmentKey}__`,
683
+ key: departmentKey,
684
+ label: departmentKey,
685
+ color: "#10b981"
686
+ } : null,
687
+ tags: tagKeys.map((key) => ({
688
+ id: `__dev_tag_${key}__`,
689
+ key,
690
+ label: key,
691
+ color: "#3b82f6"
692
+ }))
693
+ },
694
+ appUser: null
580
695
  },
581
696
  session: {
582
697
  token: viteEnv.VITE_DEV_AUTH_TOKEN
@@ -1454,57 +1569,62 @@ async function listRunsByExternalId(params) {
1454
1569
  });
1455
1570
  }
1456
1571
  export {
1457
- uploadFile as A,
1572
+ listRunsByExternalId as $,
1573
+ pbSql as A,
1458
1574
  BridgeError as B,
1459
- automationStatuses as C,
1460
- cancelAutomationRun as D,
1575
+ pbUpdate as C,
1576
+ pbUpdateRecord as D,
1461
1577
  EXPECTED_PARENT_ORIGIN as E,
1462
- cancelRun as F,
1463
- clearAutomationCache as G,
1464
- createAutomationRun as H,
1465
- createRun as I,
1466
- ensureAutomationRun as J,
1467
- ensureRun as K,
1468
- getAutomationByExternalId as L,
1469
- getAutomationRun as M,
1470
- getAutomationRunFileDownloadUrl as N,
1471
- getRun as O,
1472
- getRunFiles as P,
1473
- getRunFileUrl as Q,
1474
- isActiveStatus as R,
1475
- isTerminalStatus as S,
1476
- listAutomationRunFiles as T,
1477
- listRuns as U,
1478
- listRunsByAgent as V,
1479
- listRunsByExternalId as W,
1480
- pollAutomationRun as X,
1481
- pollRun as Y,
1482
- requestApi as Z,
1483
- resolveProjectResourceId as _,
1578
+ pbUpsert as F,
1579
+ sendEmail as G,
1580
+ uploadFile as H,
1581
+ automationStatuses as I,
1582
+ cancelAutomationRun as J,
1583
+ cancelRun as K,
1584
+ clearAutomationCache as L,
1585
+ createAutomationRun as M,
1586
+ createRun as N,
1587
+ ensureAutomationRun as O,
1588
+ ensureRun as P,
1589
+ getAutomationByExternalId as Q,
1590
+ getAutomationRun as R,
1591
+ getAutomationRunFileDownloadUrl as S,
1592
+ getRun as T,
1593
+ getRunFiles as U,
1594
+ getRunFileUrl as V,
1595
+ isActiveStatus as W,
1596
+ isTerminalStatus as X,
1597
+ listAutomationRunFiles as Y,
1598
+ listRuns as Z,
1599
+ listRunsByAgent as _,
1484
1600
  getShareableAppUrl as a,
1601
+ pollAutomationRun as a0,
1602
+ pollRun as a1,
1603
+ requestApi as a2,
1604
+ resolveProjectResourceId as a3,
1485
1605
  buildShareableAppUrl as b,
1486
1606
  configureBridge as c,
1487
- parentApiStream as d,
1488
- postReadyMessage as e,
1489
- getDownloadUrl as f,
1607
+ getViewerContext as d,
1608
+ isDepartment as e,
1609
+ isEmbedded as f,
1490
1610
  getAppProjectExternalId as g,
1491
- getUploadUrl as h,
1492
- isEmbedded as i,
1493
- pbBulkDelete as j,
1494
- pbBulkUpdate as k,
1611
+ hasMemberTag as h,
1612
+ isCompanyAdmin as i,
1613
+ isOrganizationMember as j,
1614
+ parentApiStream as k,
1495
1615
  logout as l,
1496
- pbCreate as m,
1497
- pbDelete as n,
1616
+ postReadyMessage as m,
1617
+ getDownloadUrl as n,
1498
1618
  onInitMessage as o,
1499
1619
  parentApiRequest as p,
1500
- pbGet as q,
1620
+ getUploadUrl as q,
1501
1621
  redirectToLogin as r,
1502
1622
  serializeBridgeRuntimeConfig as s,
1503
- pbList as t,
1504
- pbSearch as u,
1505
- pbSql as v,
1506
- pbUpdate as w,
1507
- pbUpdateRecord as x,
1508
- pbUpsert as y,
1509
- sendEmail as z
1623
+ pbBulkDelete as t,
1624
+ pbBulkUpdate as u,
1625
+ pbCreate as v,
1626
+ pbDelete as w,
1627
+ pbGet as x,
1628
+ pbList as y,
1629
+ pbSearch as z
1510
1630
  };
@@ -1,4 +1,4 @@
1
- import { A, a, b, c, r, t, v, B, C, D, E, F, R, T, q, d, e, f, g, h, i, j, k, l, m, n, x, o, p, s, y, u, w, z } from "../RecordSheet-BGfO2C8P.js";
1
+ import { A, a, b, c, r, t, v, B, C, D, E, F, R, T, q, d, e, f, g, h, i, j, k, l, m, n, x, o, p, s, y, u, w, z } from "../RecordSheet-DYD2utw-.js";
2
2
  export {
3
3
  A as ActivityStrip,
4
4
  a as AgentChat,
@@ -1,4 +1,4 @@
1
- import { H as R$1, L as Li, I as At } from "./RecordSheet-BGfO2C8P.js";
1
+ import { H as R$1, L as Li, I as At } from "./RecordSheet-DYD2utw-.js";
2
2
  import { useContext, useState, useEffect } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var R = ({ code: s, language: e, raw: t, className: h, startLine: d, lineNumbers: m, ...p }) => {
@@ -1,5 +1,5 @@
1
- import { a, u, b, c } from "../use-automation-run-DnVJ1_3F.js";
2
- import { u as u2, a as a2, b as b2, c as c2, d, e, f, g } from "../use-sql-table-DCe9zwOx.js";
1
+ import { a, u, b, c } from "../use-automation-run-CuJ-xpUg.js";
2
+ import { u as u2, a as a2, b as b2, c as c2, d, e, f, g } from "../use-sql-table-DpHd0VWk.js";
3
3
  export {
4
4
  a as areAgentChatMutationsBlocked,
5
5
  u as useAgentChat,
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { A, a, b, c, r, t, v, B, C, D, E, F, R, T, q, d, e, f, g, h, i, j, k, l, m, n, x, o, p, s, y, u, w, z } from "./RecordSheet-BGfO2C8P.js";
2
- import { a as a2, u as u2, b as b2, c as c2 } from "./use-automation-run-DnVJ1_3F.js";
3
- import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2, f as f2, g as g2 } from "./use-sql-table-DCe9zwOx.js";
4
- import { B as B2, E as E2, C as C2, b as b4, D as D2, F as F2, G, c as c4, H, I, J, K, g as g3, L, M, N, f as f3, O, Q, P, a as a4, h as h2, R as R2, i as i2, S, T as T2, U, V, W, l as l2, o as o2, p as p2, d as d3, j as j2, k as k2, m as m2, n as n2, q as q2, t as t2, u as u4, v as v2, w as w2, x as x2, y as y2, X, Y, e as e3, r as r2, z as z2, s as s2, A as A2 } from "./automations-C6SMookl.js";
1
+ import { A, a, b, c, r, t, v, B, C, D, E, F, R, T, q, d, e, f, g, h, i, j, k, l, m, n, x, o, p, s, y, u, w, z } from "./RecordSheet-DYD2utw-.js";
2
+ import { a as a2, u as u2, b as b2, c as c2 } from "./use-automation-run-CuJ-xpUg.js";
3
+ import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2, f as f2, g as g2 } from "./use-sql-table-DpHd0VWk.js";
4
+ import { B as B2, E as E2, I, b as b4, J, K, L, c as c4, M, N, O, P, g as g3, Q, R as R2, S, n as n2, T as T2, V, U, a as a4, q as q2, d as d3, h as h2, W, i as i2, e as e3, f as f3, j as j2, X, Y, Z, _, $, l as l2, o as o2, p as p2, k as k2, t as t2, u as u4, v as v2, w as w2, x as x2, y as y2, z as z2, A as A2, C as C2, D as D2, F as F2, a0, a1, m as m2, r as r2, G, s as s2, H } from "./automations-TTSbZaKC.js";
5
5
  import { o as o3, f as f4, a as a5, b as b5, c as c5, d as d4, e as e4, g as g4, h as h3, i as i3, j as j3, k as k3, l as l3, m as m3, n as n3, s as s3 } from "./formatters-D4T821Dv.js";
6
6
  import { q as q3 } from "./query-client-DdOWay4_.js";
7
- import { R as R3, e as e5, b as b6, a as a6, f as f5, g as g5, l as l4, n as n4, c as c6, d as d5, r as r3 } from "./audit-log-CBcctM1l.js";
7
+ import { R as R3, e as e5, b as b6, a as a6, f as f5, g as g5, l as l4, n as n4, c as c6, d as d5, r as r3 } from "./audit-log-BFPtNHQh.js";
8
8
  export {
9
9
  A as ActivityStrip,
10
10
  a as AgentChat,
@@ -27,24 +27,24 @@ export {
27
27
  q as ToolRenderersProvider,
28
28
  d as activityDurationSeconds,
29
29
  a2 as areAgentChatMutationsBlocked,
30
- C2 as automationStatuses,
30
+ I as automationStatuses,
31
31
  b6 as buildRecordAuditCsv,
32
32
  a6 as buildRecordAuditLogPath,
33
33
  b4 as buildShareableAppUrl,
34
- D2 as cancelAutomationRun,
35
- F2 as cancelRun,
34
+ J as cancelAutomationRun,
35
+ K as cancelRun,
36
36
  e as chatMarkdownComponents,
37
- G as clearAutomationCache,
37
+ L as clearAutomationCache,
38
38
  f as clipLabel,
39
39
  o3 as cn,
40
40
  c4 as configureBridge,
41
- H as createAutomationRun,
41
+ M as createAutomationRun,
42
42
  g as createLumeraAgentChatTransport,
43
- I as createRun,
43
+ N as createRun,
44
44
  h as defaultToolRenderers,
45
45
  i as encodeActivityLabels,
46
- J as ensureAutomationRun,
47
- K as ensureRun,
46
+ O as ensureAutomationRun,
47
+ P as ensureRun,
48
48
  f5 as fetchRecordAuditLogCsv,
49
49
  j as findRenderer,
50
50
  f4 as formatBoolean,
@@ -62,60 +62,65 @@ export {
62
62
  m3 as formatSelect,
63
63
  n3 as formatText,
64
64
  g3 as getAppProjectExternalId,
65
- L as getAutomationByExternalId,
66
- M as getAutomationRun,
67
- N as getAutomationRunFileDownloadUrl,
65
+ Q as getAutomationByExternalId,
66
+ R2 as getAutomationRun,
67
+ S as getAutomationRunFileDownloadUrl,
68
68
  k as getCollectionMap,
69
- f3 as getDownloadUrl,
69
+ n2 as getDownloadUrl,
70
70
  g5 as getRecordAuditLogSnapshot,
71
- O as getRun,
72
- Q as getRunFileUrl,
73
- P as getRunFiles,
71
+ T2 as getRun,
72
+ V as getRunFileUrl,
73
+ U as getRunFiles,
74
74
  a4 as getShareableAppUrl,
75
- h2 as getUploadUrl,
75
+ q2 as getUploadUrl,
76
+ d3 as getViewerContext,
77
+ h2 as hasMemberTag,
76
78
  l as humanizeCollectionName,
77
- R2 as isActiveStatus,
79
+ W as isActiveStatus,
78
80
  m as isActivityBlock,
79
- i2 as isEmbedded,
81
+ i2 as isCompanyAdmin,
82
+ e3 as isDepartment,
83
+ f3 as isEmbedded,
80
84
  n as isExploratoryToolCallError,
81
85
  x as isMutatingToolCall,
86
+ j2 as isOrganizationMember,
82
87
  o as isSessionActive,
83
- S as isTerminalStatus,
84
- T2 as listAutomationRunFiles,
88
+ X as isTerminalStatus,
89
+ Y as listAutomationRunFiles,
85
90
  l4 as listRecordAuditLog,
86
- U as listRuns,
87
- V as listRunsByAgent,
88
- W as listRunsByExternalId,
91
+ Z as listRuns,
92
+ _ as listRunsByAgent,
93
+ $ as listRunsByExternalId,
89
94
  l2 as logout,
90
95
  n4 as normalizeRecordAuditCollections,
91
96
  c6 as normalizeRecordAuditExportLimit,
92
97
  d5 as normalizeRecordAuditPageSize,
93
98
  o2 as onInitMessage,
94
99
  p2 as parentApiRequest,
95
- d3 as parentApiStream,
100
+ k2 as parentApiStream,
96
101
  p as parseSessionActivity,
97
- j2 as pbBulkDelete,
98
- k2 as pbBulkUpdate,
99
- m2 as pbCreate,
100
- n2 as pbDelete,
101
- q2 as pbGet,
102
- t2 as pbList,
103
- u4 as pbSearch,
104
- v2 as pbSql,
105
- w2 as pbUpdate,
106
- x2 as pbUpdateRecord,
107
- y2 as pbUpsert,
108
- X as pollAutomationRun,
109
- Y as pollRun,
110
- e3 as postReadyMessage,
102
+ t2 as pbBulkDelete,
103
+ u4 as pbBulkUpdate,
104
+ v2 as pbCreate,
105
+ w2 as pbDelete,
106
+ x2 as pbGet,
107
+ y2 as pbList,
108
+ z2 as pbSearch,
109
+ A2 as pbSql,
110
+ C2 as pbUpdate,
111
+ D2 as pbUpdateRecord,
112
+ F2 as pbUpsert,
113
+ a0 as pollAutomationRun,
114
+ a1 as pollRun,
115
+ m2 as postReadyMessage,
111
116
  q3 as queryClient,
112
117
  r3 as recordAuditActorLabel,
113
118
  r2 as redirectToLogin,
114
- z2 as sendEmail,
119
+ G as sendEmail,
115
120
  s2 as serializeBridgeRuntimeConfig,
116
121
  s3 as stripHtml,
117
122
  s as summarizeActivityLabels,
118
- A2 as uploadFile,
123
+ H as uploadFile,
119
124
  u2 as useAgentChat,
120
125
  b2 as useAgentChatSessions,
121
126
  u3 as useAutomationAgent,
@@ -41,6 +41,42 @@ export declare const serializeBridgeRuntimeConfig: (config: BridgeRuntimeConfig)
41
41
  * Payload received from the parent during initialization.
42
42
  * Contains company, user, and session information.
43
43
  */
44
+ export type ViewerSubjectType = 'anonymous' | 'org_member' | 'public_app_user';
45
+ export type ViewerMemberTag = {
46
+ id: string;
47
+ key: string;
48
+ label: string;
49
+ color: string;
50
+ };
51
+ export type ViewerOrganizationMembership = {
52
+ id: string;
53
+ role: string;
54
+ isCompanyAdmin: boolean;
55
+ department: ViewerMemberTag | null;
56
+ tags: ViewerMemberTag[];
57
+ };
58
+ export type ViewerAppUser = {
59
+ id: string;
60
+ role: string;
61
+ };
62
+ /**
63
+ * Canonical identity and organization-membership context for app UI policy.
64
+ * This data is suitable for choosing frontend experiences; app APIs must
65
+ * independently enforce every protected operation.
66
+ */
67
+ export type ViewerContext = {
68
+ version: 1;
69
+ isSignedIn: boolean;
70
+ subjectType: ViewerSubjectType;
71
+ belongsToOrganization: boolean;
72
+ identity: {
73
+ id: string;
74
+ name: string;
75
+ email: string;
76
+ } | null;
77
+ organizationMembership: ViewerOrganizationMembership | null;
78
+ appUser: ViewerAppUser | null;
79
+ };
44
80
  export type HostPayload = {
45
81
  company?: {
46
82
  id: string;
@@ -72,6 +108,8 @@ export type HostPayload = {
72
108
  * signed-in user), or 'anonymous'.
73
109
  */
74
110
  subjectType?: string;
111
+ /** Canonical signed-in/member context for permission-aware app UI. */
112
+ viewer?: ViewerContext;
75
113
  message?: string;
76
114
  session?: {
77
115
  token?: string;
@@ -175,6 +213,14 @@ export declare class BridgeError extends Error {
175
213
  * Returns the project external ID (package.json name) if available.
176
214
  */
177
215
  export declare function getAppProjectExternalId(): string | undefined;
216
+ /** Return the latest viewer context delivered during app initialization. */
217
+ export declare function getViewerContext(): ViewerContext | undefined;
218
+ export declare const isOrganizationMember: (viewer: ViewerContext | null | undefined) => viewer is ViewerContext & {
219
+ organizationMembership: ViewerOrganizationMembership;
220
+ };
221
+ export declare const isCompanyAdmin: (viewer: ViewerContext | null | undefined) => boolean;
222
+ export declare const isDepartment: (viewer: ViewerContext | null | undefined, departmentKey: string) => boolean;
223
+ export declare const hasMemberTag: (viewer: ViewerContext | null | undefined, tagKey: string) => boolean;
178
224
  /**
179
225
  * Build a shareable Lumera host URL for any route in the current embedded app.
180
226
  *
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/lib/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA2CH,eAAO,MAAM,sBAAsB,KAA0D,CAAC;AAQ9F,MAAM,MAAM,mBAAmB,GAAG;IAChC,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AA2CF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GAAI,QAAQ,mBAAmB,KAAG,MAI1E,CAAC;AAMF;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE;QACR,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,yEAAyE;QACzE,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,mEAAmE;QACnE,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF;;;;OAIG;IACH,WAAW,CAAC,EAA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MAAM,KAAG,OAIvF,CAAC;AA2HF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM,GAAG,SAAS,CAEvG;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM,GAAG,SAAS,CAUvF;AA6mBD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,WAAW,MAAM,KAAG,IAInD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,IAAI,CAG3C,CAAC;AA0SF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,mBAAmB,KAAG,IAE7D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,QAAO,OAAsE,CAAC;AAErG;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,QAAO,IAoFnC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,aAAa,GAAI,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CA6B/F,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,gBAAgB,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,cAAc,CAwDrF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,aAAa,EAAE,UAAU,oBAAoB,KAAG,YA0DxF,CAAC"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @module @lumerahq/ui/lib
5
5
  */
6
- export { BridgeError, type BridgeRequest, type BridgeResponse, type BridgeRuntimeConfig, type BridgeStream, type BridgeStreamHandlers, type BridgeStreamOpen, type BridgeStreamResponse, buildShareableAppUrl, configureBridge, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, type HostPayload, isEmbedded, logout, onInitMessage, parentApiRequest, parentApiStream, postReadyMessage, redirectToLogin, type ShareableAppRouter, type ShareableAppUrlOptions, serializeBridgeRuntimeConfig, } from './bridge';
6
+ export { BridgeError, type BridgeRequest, type BridgeResponse, type BridgeRuntimeConfig, type BridgeStream, type BridgeStreamHandlers, type BridgeStreamOpen, type BridgeStreamResponse, buildShareableAppUrl, configureBridge, EXPECTED_PARENT_ORIGIN, getAppProjectExternalId, getShareableAppUrl, getViewerContext, type HostPayload, hasMemberTag, isCompanyAdmin, isDepartment, isEmbedded, isOrganizationMember, logout, onInitMessage, parentApiRequest, parentApiStream, postReadyMessage, redirectToLogin, type ShareableAppRouter, type ShareableAppUrlOptions, serializeBridgeRuntimeConfig, type ViewerAppUser, type ViewerContext, type ViewerMemberTag, type ViewerOrganizationMembership, type ViewerSubjectType, } from './bridge';
7
7
  export { type EmailSendRequest, type EmailSendResult, type FileDescriptor, getDownloadUrl, getUploadUrl, type PbBulkResult, type PbListOptions, type PbListResponse, type PbRecord, type PbSearchMetadata, type PbSearchOptions, type PbSearchResult, type PbSqlRequest, type PbSqlResponse, pbBulkDelete, pbBulkUpdate, pbCreate, pbDelete, pbGet, pbList, pbSearch, pbSql, pbUpdate, pbUpdateRecord, pbUpsert, sendEmail, type UploadOptions, type UploadUrlResponse, uploadFile, } from './api';
8
8
  export { type Automation, type AutomationRun, type AutomationRunFile, type AutomationStatus, automationStatuses, type CreateRunOptions, cancelAutomationRun, cancelRun, clearAutomationCache, createAutomationRun, createRun, ensureAutomationRun, ensureRun, getAutomationByExternalId, getAutomationRun, getAutomationRunFileDownloadUrl, getRun, getRunFiles, getRunFileUrl, isActiveStatus, isTerminalStatus, type LegacyCreateRunOptions, type ListRunsOptions, listAutomationRunFiles, listRuns, listRunsByAgent, listRunsByExternalId, type PollOptions, pollAutomationRun, pollRun, } from './automations';
9
9
  export { type ColumnType, type FileDescriptor as FormatterFileDescriptor, type FormatOptions, formatBoolean, formatCellValue, formatCurrency, formatDate, formatDateTime, formatEditor, formatFile, formatFileSize, formatJson, formatNumber, formatPercent, formatRelation, formatSelect, formatText, stripHtml, } from './formatters';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAEL,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,oBAAoB,EAEpB,eAAe,EAEf,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAElB,KAAK,WAAW,EAChB,UAAU,EACV,MAAM,EACN,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,4BAA4B,GAC7B,MAAM,UAAU,CAAC;AAMlB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,cAAc,EAEd,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,EAEnB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,YAAY,EAEZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EAER,KAAK,EACL,MAAM,EACN,QAAQ,EAER,KAAK,EACL,QAAQ,EAER,cAAc,EACd,QAAQ,EAER,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,UAAU,GACX,MAAM,OAAO,CAAC;AAMf,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,mBAAmB,EACn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,MAAM,aAAa,CAAC"}
package/dist/lib/index.js CHANGED
@@ -1,25 +1,25 @@
1
- import { B, E, C, b, D, F, G, c, H, I, J, K, g, L, M, N, f, O, Q, P, a, h, R, i, S, T, U, V, W, l, o, p, d, j, k, m, n, q, t, u, v, w, x, y, X, Y, e, r, z, s, A } from "../automations-C6SMookl.js";
1
+ import { B, E, I, b, J, K, L, c, M, N, O, P, g, Q, R, S, n, T, V, U, a, q, d, h, W, i, e, f, j, X, Y, Z, _, $, l, o, p, k, t, u, v, w, x, y, z, A, C, D, F, a0, a1, m, r, G, s, H } from "../automations-TTSbZaKC.js";
2
2
  import { o as o2, f as f2, a as a2, b as b2, c as c2, d as d2, e as e2, g as g2, h as h2, i as i2, j as j2, k as k2, l as l2, m as m2, n as n2, s as s2 } from "../formatters-D4T821Dv.js";
3
3
  import { q as q2 } from "../query-client-DdOWay4_.js";
4
- import { R as R2, e as e3, b as b3, a as a3, f as f3, g as g3, l as l3, n as n3, c as c3, d as d3, r as r2 } from "../audit-log-CBcctM1l.js";
4
+ import { R as R2, e as e3, b as b3, a as a3, f as f3, g as g3, l as l3, n as n3, c as c3, d as d3, r as r2 } from "../audit-log-BFPtNHQh.js";
5
5
  export {
6
6
  B as BridgeError,
7
7
  E as EXPECTED_PARENT_ORIGIN,
8
8
  R2 as RECORD_AUDIT_EXPORT_LIMIT,
9
9
  e3 as RECORD_AUDIT_MAX_COLLECTIONS,
10
- C as automationStatuses,
10
+ I as automationStatuses,
11
11
  b3 as buildRecordAuditCsv,
12
12
  a3 as buildRecordAuditLogPath,
13
13
  b as buildShareableAppUrl,
14
- D as cancelAutomationRun,
15
- F as cancelRun,
16
- G as clearAutomationCache,
14
+ J as cancelAutomationRun,
15
+ K as cancelRun,
16
+ L as clearAutomationCache,
17
17
  o2 as cn,
18
18
  c as configureBridge,
19
- H as createAutomationRun,
20
- I as createRun,
21
- J as ensureAutomationRun,
22
- K as ensureRun,
19
+ M as createAutomationRun,
20
+ N as createRun,
21
+ O as ensureAutomationRun,
22
+ P as ensureRun,
23
23
  f3 as fetchRecordAuditLogCsv,
24
24
  f2 as formatBoolean,
25
25
  a2 as formatCellValue,
@@ -36,50 +36,55 @@ export {
36
36
  m2 as formatSelect,
37
37
  n2 as formatText,
38
38
  g as getAppProjectExternalId,
39
- L as getAutomationByExternalId,
40
- M as getAutomationRun,
41
- N as getAutomationRunFileDownloadUrl,
42
- f as getDownloadUrl,
39
+ Q as getAutomationByExternalId,
40
+ R as getAutomationRun,
41
+ S as getAutomationRunFileDownloadUrl,
42
+ n as getDownloadUrl,
43
43
  g3 as getRecordAuditLogSnapshot,
44
- O as getRun,
45
- Q as getRunFileUrl,
46
- P as getRunFiles,
44
+ T as getRun,
45
+ V as getRunFileUrl,
46
+ U as getRunFiles,
47
47
  a as getShareableAppUrl,
48
- h as getUploadUrl,
49
- R as isActiveStatus,
50
- i as isEmbedded,
51
- S as isTerminalStatus,
52
- T as listAutomationRunFiles,
48
+ q as getUploadUrl,
49
+ d as getViewerContext,
50
+ h as hasMemberTag,
51
+ W as isActiveStatus,
52
+ i as isCompanyAdmin,
53
+ e as isDepartment,
54
+ f as isEmbedded,
55
+ j as isOrganizationMember,
56
+ X as isTerminalStatus,
57
+ Y as listAutomationRunFiles,
53
58
  l3 as listRecordAuditLog,
54
- U as listRuns,
55
- V as listRunsByAgent,
56
- W as listRunsByExternalId,
59
+ Z as listRuns,
60
+ _ as listRunsByAgent,
61
+ $ as listRunsByExternalId,
57
62
  l as logout,
58
63
  n3 as normalizeRecordAuditCollections,
59
64
  c3 as normalizeRecordAuditExportLimit,
60
65
  d3 as normalizeRecordAuditPageSize,
61
66
  o as onInitMessage,
62
67
  p as parentApiRequest,
63
- d as parentApiStream,
64
- j as pbBulkDelete,
65
- k as pbBulkUpdate,
66
- m as pbCreate,
67
- n as pbDelete,
68
- q as pbGet,
69
- t as pbList,
70
- u as pbSearch,
71
- v as pbSql,
72
- w as pbUpdate,
73
- x as pbUpdateRecord,
74
- y as pbUpsert,
75
- X as pollAutomationRun,
76
- Y as pollRun,
77
- e as postReadyMessage,
68
+ k as parentApiStream,
69
+ t as pbBulkDelete,
70
+ u as pbBulkUpdate,
71
+ v as pbCreate,
72
+ w as pbDelete,
73
+ x as pbGet,
74
+ y as pbList,
75
+ z as pbSearch,
76
+ A as pbSql,
77
+ C as pbUpdate,
78
+ D as pbUpdateRecord,
79
+ F as pbUpsert,
80
+ a0 as pollAutomationRun,
81
+ a1 as pollRun,
82
+ m as postReadyMessage,
78
83
  q2 as queryClient,
79
84
  r2 as recordAuditActorLabel,
80
85
  r as redirectToLogin,
81
- z as sendEmail,
86
+ G as sendEmail,
82
87
  s as serializeBridgeRuntimeConfig,
83
88
  s2 as stripHtml,
84
- A as uploadFile
89
+ H as uploadFile
85
90
  };
@@ -0,0 +1,4 @@
1
+ import { G } from "./RecordSheet-DYD2utw-.js";
2
+ export {
3
+ G as Mermaid
4
+ };
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useState, useRef, useCallback, useMemo } from "react";
2
2
  import { useQueryClient, useMutation, useQuery } from "@tanstack/react-query";
3
- import { J as ensureAutomationRun, H as createAutomationRun, D as cancelAutomationRun, C as automationStatuses, M as getAutomationRun } from "./automations-C6SMookl.js";
3
+ import { O as ensureAutomationRun, M as createAutomationRun, J as cancelAutomationRun, I as automationStatuses, R as getAutomationRun } from "./automations-TTSbZaKC.js";
4
4
  const QUEUED_DISCOVERY_POLL_MS = 2e3;
5
5
  const IDLE_DISCOVERY_POLL_MS = 1e4;
6
6
  const HIDDEN_DISCOVERY_POLL_MS = 3e4;
@@ -1,7 +1,7 @@
1
1
  import { useQueryClient, useQuery, useMutation, useInfiniteQuery } from "@tanstack/react-query";
2
2
  import { useState, useCallback, useEffect, useMemo } from "react";
3
- import { V as listRunsByAgent, C as automationStatuses, H as createAutomationRun, A as uploadFile, o as onInitMessage, v as pbSql, x as pbUpdateRecord } from "./automations-C6SMookl.js";
4
- import { n as normalizeRecordAuditCollections, d as normalizeRecordAuditPageSize, l as listRecordAuditLog, g as getRecordAuditLogSnapshot } from "./audit-log-CBcctM1l.js";
3
+ import { _ as listRunsByAgent, I as automationStatuses, M as createAutomationRun, H as uploadFile, o as onInitMessage, A as pbSql, D as pbUpdateRecord } from "./automations-TTSbZaKC.js";
4
+ import { n as normalizeRecordAuditCollections, d as normalizeRecordAuditPageSize, l as listRecordAuditLog, g as getRecordAuditLogSnapshot } from "./audit-log-BFPtNHQh.js";
5
5
  function useAutomationAgent({
6
6
  agentId,
7
7
  limit = 5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/ui",
3
- "version": "0.19.4",
3
+ "version": "0.19.5",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -1,4 +0,0 @@
1
- import { G } from "./RecordSheet-BGfO2C8P.js";
2
- export {
3
- G as Mermaid
4
- };