@nivaro/react 0.3.46 → 0.3.48

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 (57) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +248 -16
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/CollectionBrowserView.js +813 -826
  6. package/dist/shared/components/ErrorNotice.js +169 -0
  7. package/dist/shared/components/ErrorSurface.js +23 -17
  8. package/dist/shared/components/ListLoadError.js +8 -29
  9. package/dist/shared/components/LoadErrorNote.js +38 -21
  10. package/dist/shared/components/QueryErrorState.js +8 -11
  11. package/dist/shared/components/ReportView.js +1320 -1291
  12. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  13. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  14. package/dist/shared/components/chat/ChatPanel.js +368 -367
  15. package/dist/shared/components/command-center/PeekPanel.js +33 -32
  16. package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
  18. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  19. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  20. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  21. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  22. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  23. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  24. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  25. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  26. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  27. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  28. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  29. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  30. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  31. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  32. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  33. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  34. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  35. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  36. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  37. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  38. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  39. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  40. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  41. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  42. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  43. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  44. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  45. package/dist/shared/components/panels/SlaClock.js +35 -36
  46. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  47. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  48. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  49. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  50. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  51. package/dist/shared/components/support/SupportView.js +94 -87
  52. package/dist/shared/lib/autofill-poll.js +21 -18
  53. package/dist/shared/lib/error-actions.js +85 -0
  54. package/dist/shared/lib/error-message.js +223 -82
  55. package/dist/shared/lib/error-toast.js +71 -13
  56. package/dist/shared/lib/safe-error.js +136 -38
  57. package/package.json +1 -1
@@ -1,18 +1,19 @@
1
- import { jsxs as a, jsx as t, Fragment as v } from "react/jsx-runtime";
2
- import { useQuery as T, useQueryClient as P, useMutation as y } from "@tanstack/react-query";
1
+ import { jsxs as a, jsx as t, Fragment as N } from "react/jsx-runtime";
2
+ import { useQuery as T, useQueryClient as P, useMutation as v } from "@tanstack/react-query";
3
3
  import { Sparkles as Q } from "lucide-react";
4
4
  import { useState as h } from "react";
5
- import { toast as x } from "sonner";
5
+ import { toast as $ } from "sonner";
6
6
  import { useNivaroClient as C } from "../../context.js";
7
- import { get as $, post as w } from "../../lib/commands.js";
8
- import { cn as K } from "../../lib/utils.js";
9
- import { Button as f } from "../ui/button.js";
10
- import { Input as j } from "../ui/input.js";
7
+ import { get as K, post as y } from "../../lib/commands.js";
8
+ import { toastError as w } from "../../lib/error-toast.js";
9
+ import { cn as j } from "../../lib/utils.js";
10
+ import { Button as x } from "../ui/button.js";
11
+ import { Input as E } from "../ui/input.js";
11
12
  import { Skeleton as _ } from "../ui/skeleton.js";
12
- function O({ onApplied: s }) {
13
+ function U({ onApplied: s }) {
13
14
  const m = C(), { data: i, isLoading: l, isError: o } = T({
14
15
  queryKey: ["team-suggestions"],
15
- queryFn: () => m.request($("/user-groups/suggestions")).then((n) => n.data),
16
+ queryFn: () => m.request(K("/user-groups/suggestions")).then((n) => n.data),
16
17
  staleTime: 6e4
17
18
  });
18
19
  return /* @__PURE__ */ a("div", { className: "p-6", "data-team-suggestions": !0, children: [
@@ -30,7 +31,7 @@ function O({ onApplied: s }) {
30
31
  ] });
31
32
  }
32
33
  function F({ s, onApplied: m }) {
33
- const i = C(), l = P(), [o, n] = h(s.existing_team ? s.existing_team.name : s.suggested_name), [b, S] = h(!1), [r, c] = h(null), k = (e) => {
34
+ const i = C(), l = P(), [o, n] = h(s.existing_team ? s.existing_team.name : s.suggested_name), [f, S] = h(!1), [r, c] = h(null), b = (e) => {
34
35
  var d;
35
36
  return {
36
37
  members: s.members.map((g) => g.id),
@@ -39,19 +40,19 @@ function F({ s, onApplied: m }) {
39
40
  existing_team_id: ((d = s.existing_team) == null ? void 0 : d.id) ?? null,
40
41
  execute: e
41
42
  };
42
- }, u = y({
43
- mutationFn: () => i.request(w("/user-groups/suggestions/apply", k(!1))).then((e) => e.data),
43
+ }, u = v({
44
+ mutationFn: () => i.request(y("/user-groups/suggestions/apply", b(!1))).then((e) => e.data),
44
45
  onSuccess: (e) => c(e),
45
- onError: (e) => x.error(e.message || "Preview failed")
46
- }), p = y({
47
- mutationFn: () => i.request(w("/user-groups/suggestions/apply", k(!0))).then((e) => e.data),
46
+ onError: (e) => w(e, "Preview failed")
47
+ }), p = v({
48
+ mutationFn: () => i.request(y("/user-groups/suggestions/apply", b(!0))).then((e) => e.data),
48
49
  onSuccess: (e) => {
49
- x.success(
50
+ $.success(
50
51
  `${e.team.action === "create" ? "Created" : "Linked"} ${e.team.name} on ${e.cells.length} cell${e.cells.length === 1 ? "" : "s"}`
51
52
  ), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["owner-groups"] }), e.team.id != null && m(e.team.id);
52
53
  },
53
- onError: (e) => x.error(e.message || "Could not apply")
54
- }), q = [...new Set(s.cells.map((e) => e.template_name ?? "Template"))], N = s.members.filter((e) => e.redacted || e.status && e.status !== "active");
54
+ onError: (e) => w(e, "Could not apply")
55
+ }), q = [...new Set(s.cells.map((e) => e.template_name ?? "Template"))], k = s.members.filter((e) => e.redacted || e.status && e.status !== "active");
55
56
  return /* @__PURE__ */ a(
56
57
  "div",
57
58
  {
@@ -74,7 +75,7 @@ function F({ s, onApplied: m }) {
74
75
  return /* @__PURE__ */ a(
75
76
  "span",
76
77
  {
77
- className: K(
78
+ className: j(
78
79
  "rounded-full border px-2 py-0.5 text-[11.5px]",
79
80
  d ? "border-rose-200 bg-rose-50 text-rose-700 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-300" : "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted/40 dark:text-foreground"
80
81
  ),
@@ -86,8 +87,8 @@ function F({ s, onApplied: m }) {
86
87
  e.id
87
88
  );
88
89
  }) }),
89
- N.length > 0 && /* @__PURE__ */ a("p", { className: "mt-1.5 text-[11.5px] text-rose-600 dark:text-rose-400", children: [
90
- N.length,
90
+ k.length > 0 && /* @__PURE__ */ a("p", { className: "mt-1.5 text-[11.5px] text-rose-600 dark:text-rose-400", children: [
91
+ k.length,
91
92
  " of them can no longer act — remove them from the team after creating it, or fix the cells first."
92
93
  ] }),
93
94
  /* @__PURE__ */ a(
@@ -97,14 +98,14 @@ function F({ s, onApplied: m }) {
97
98
  onClick: () => S((e) => !e),
98
99
  className: "mt-2 text-[11.5px] text-slate-500 underline-offset-2 hover:underline dark:text-muted-foreground",
99
100
  children: [
100
- b ? "Hide" : "Show",
101
+ f ? "Hide" : "Show",
101
102
  " the ",
102
103
  s.cell_count,
103
104
  " cells"
104
105
  ]
105
106
  }
106
107
  ),
107
- b && /* @__PURE__ */ t("ul", { className: "mt-1.5 max-h-48 space-y-0.5 overflow-y-auto rounded-md border border-slate-100 p-2 text-[11.5px] text-slate-600 dark:border-border/60 dark:text-muted-foreground", children: s.cells.map((e) => /* @__PURE__ */ a("li", { children: [
108
+ f && /* @__PURE__ */ t("ul", { className: "mt-1.5 max-h-48 space-y-0.5 overflow-y-auto rounded-md border border-slate-100 p-2 text-[11.5px] text-slate-600 dark:border-border/60 dark:text-muted-foreground", children: s.cells.map((e) => /* @__PURE__ */ a("li", { children: [
108
109
  /* @__PURE__ */ a("span", { className: "text-slate-400", children: [
109
110
  e.template_name,
110
111
  " ›"
@@ -122,7 +123,7 @@ function F({ s, onApplied: m }) {
122
123
  /* @__PURE__ */ t("span", { className: "font-medium", children: s.existing_team.name }),
123
124
  " already has exactly these members — it will be linked instead of creating a new one."
124
125
  ] }) : /* @__PURE__ */ t(
125
- j,
126
+ E,
126
127
  {
127
128
  value: o,
128
129
  onChange: (e) => {
@@ -135,7 +136,7 @@ function F({ s, onApplied: m }) {
135
136
  }
136
137
  ),
137
138
  /* @__PURE__ */ t(
138
- f,
139
+ x,
139
140
  {
140
141
  size: "sm",
141
142
  variant: "outline",
@@ -154,7 +155,7 @@ function F({ s, onApplied: m }) {
154
155
  "data-team-suggestion-plan": !0,
155
156
  children: [
156
157
  /* @__PURE__ */ a("p", { className: "text-slate-700 dark:text-foreground", children: [
157
- r.team.action === "create" ? /* @__PURE__ */ a(v, { children: [
158
+ r.team.action === "create" ? /* @__PURE__ */ a(N, { children: [
158
159
  "Create ",
159
160
  /* @__PURE__ */ t("span", { className: "font-semibold", children: r.team.name }),
160
161
  " (@",
@@ -162,7 +163,7 @@ function F({ s, onApplied: m }) {
162
163
  ") with ",
163
164
  s.members.length,
164
165
  " members,"
165
- ] }) : /* @__PURE__ */ a(v, { children: [
166
+ ] }) : /* @__PURE__ */ a(N, { children: [
166
167
  "Link ",
167
168
  /* @__PURE__ */ t("span", { className: "font-semibold", children: r.team.name })
168
169
  ] }),
@@ -187,7 +188,7 @@ function F({ s, onApplied: m }) {
187
188
  ] }),
188
189
  /* @__PURE__ */ a("div", { className: "mt-2 flex gap-2", children: [
189
190
  /* @__PURE__ */ t(
190
- f,
191
+ x,
191
192
  {
192
193
  size: "sm",
193
194
  className: "h-8 text-[12.5px]",
@@ -198,7 +199,7 @@ function F({ s, onApplied: m }) {
198
199
  }
199
200
  ),
200
201
  /* @__PURE__ */ t(
201
- f,
202
+ x,
202
203
  {
203
204
  size: "sm",
204
205
  variant: "ghost",
@@ -216,5 +217,5 @@ function F({ s, onApplied: m }) {
216
217
  );
217
218
  }
218
219
  export {
219
- O as TeamSuggestionsPanel
220
+ U as TeamSuggestionsPanel
220
221
  };
@@ -1,21 +1,22 @@
1
- import { jsxs as a, jsx as t, Fragment as M } from "react/jsx-runtime";
2
- import { useQueryClient as z, useQuery as V, useInfiniteQuery as Z, useMutation as D } from "@tanstack/react-query";
3
- import { Bot as G, Plug as H, Loader2 as w, ListChecks as X, KeyRound as Y, ChevronRight as J, AlertTriangle as ee, Undo2 as te } from "lucide-react";
4
- import { useState as v, useRef as ae, useMemo as I, Fragment as ne } from "react";
5
- import { useNivaroClient as se, useItemNavigation as U } from "../../context.js";
6
- import { get as q, del as re, post as oe } from "../../lib/commands.js";
7
- import { cn as y, formatDate as C, formatRelative as E, formatNumber as g, formatDateTime as le, formatFileSize as B } from "../../lib/utils.js";
8
- import { ScopeBadge as ie, McpScopeSheet as de } from "../McpConnectionScope.js";
9
- import { SimpleSelectXs as ce } from "../ui/SimpleSelect.js";
10
- import { Skeleton as me } from "../ui/skeleton.js";
11
- import { ConnectionRollback as pe } from "./ConnectionRollback.js";
12
- import { SectionCard as A, EmptyLine as k, ConfirmButton as O, Pill as Q } from "./primitives.js";
13
- const ue = {
1
+ import { jsxs as a, jsx as t, Fragment as E } from "react/jsx-runtime";
2
+ import { useQueryClient as V, useQuery as Z, useInfiniteQuery as G, useMutation as D } from "@tanstack/react-query";
3
+ import { Bot as H, Plug as X, Loader2 as w, ListChecks as Y, KeyRound as J, ChevronRight as ee, AlertTriangle as te, Undo2 as ae } from "lucide-react";
4
+ import { useState as v, useRef as ne, useMemo as I, Fragment as se } from "react";
5
+ import { useNivaroClient as re, useItemNavigation as U } from "../../context.js";
6
+ import { get as q, del as oe, post as le } from "../../lib/commands.js";
7
+ import { userErrorMessage as A } from "../../lib/safe-error.js";
8
+ import { cn as y, formatDate as C, formatRelative as B, formatNumber as g, formatDateTime as ie, formatFileSize as O } from "../../lib/utils.js";
9
+ import { ScopeBadge as de, McpScopeSheet as ce } from "../McpConnectionScope.js";
10
+ import { SimpleSelectXs as me } from "../ui/SimpleSelect.js";
11
+ import { Skeleton as pe } from "../ui/skeleton.js";
12
+ import { ConnectionRollback as ue } from "./ConnectionRollback.js";
13
+ import { SectionCard as M, EmptyLine as k, ConfirmButton as Q, Pill as j } from "./primitives.js";
14
+ const he = {
14
15
  oauth: "Signed in",
15
16
  api_key: "API key",
16
17
  token: "Personal token"
17
18
  }, T = (e) => ["nvr-mcp-connections", e];
18
- function he({ days: e }) {
19
+ function xe({ days: e }) {
19
20
  const i = Math.max(1, ...e.map((r) => r.calls));
20
21
  return /* @__PURE__ */ t("div", { className: "flex h-6 items-end gap-[2px]", "aria-hidden": !0, children: e.map((r) => {
21
22
  const l = r.calls ? Math.max(3, Math.round(r.calls / i * 24)) : 2, d = r.errors + r.refused;
@@ -40,7 +41,7 @@ function he({ days: e }) {
40
41
  );
41
42
  }) });
42
43
  }
43
- function xe({ s: e }) {
44
+ function be({ s: e }) {
44
45
  return !e || e.calls === 0 ? /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "No tool calls" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-slate-600 dark:text-slate-300", children: [
45
46
  /* @__PURE__ */ t("b", { className: "font-semibold text-slate-800 dark:text-slate-100", children: g(e.calls) }),
46
47
  " ",
@@ -59,14 +60,14 @@ function xe({ s: e }) {
59
60
  ] }),
60
61
  /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-slate-400", children: [
61
62
  " · ",
62
- B(e.bytes)
63
+ O(e.bytes)
63
64
  ] })
64
65
  ] });
65
66
  }
66
- function be({ kind: e }) {
67
- return /* @__PURE__ */ t(Q, { tone: e === "oauth" ? "brand" : "neutral", children: ue[e] });
67
+ function fe({ kind: e }) {
68
+ return /* @__PURE__ */ t(j, { tone: e === "oauth" ? "brand" : "neutral", children: he[e] });
68
69
  }
69
- function fe({ c: e }) {
70
+ function ge({ c: e }) {
70
71
  if (!e.idle || e.idle.status === "active") return null;
71
72
  const i = C(`${e.idle.revoke_on}T12:00:00Z`, {
72
73
  month: "short",
@@ -74,7 +75,7 @@ function fe({ c: e }) {
74
75
  year: "numeric"
75
76
  });
76
77
  return /* @__PURE__ */ a("p", { className: "mt-1.5 flex items-center gap-1.5 text-[12px] text-amber-700 dark:text-amber-400", children: [
77
- /* @__PURE__ */ t(ee, { className: "h-3.5 w-3.5 shrink-0" }),
78
+ /* @__PURE__ */ t(te, { className: "h-3.5 w-3.5 shrink-0" }),
78
79
  "Unused for ",
79
80
  e.idle.idle_days,
80
81
  " days — it will be disconnected on ",
@@ -82,19 +83,19 @@ function fe({ c: e }) {
82
83
  " unless it is used."
83
84
  ] });
84
85
  }
85
- const ge = {
86
+ const ve = {
86
87
  ok: { label: "Done", tone: "green" },
87
88
  refused: { label: "Refused", tone: "amber" },
88
89
  error: { label: "Failed", tone: "red" }
89
- }, ve = {
90
+ }, ye = {
90
91
  create: "Created",
91
92
  update: "Changed",
92
93
  delete: "Deleted"
93
94
  };
94
95
  function K({ rows: e = 3 }) {
95
- return /* @__PURE__ */ t("div", { className: "space-y-3", "aria-busy": "true", children: Array.from({ length: e }, (i, r) => /* @__PURE__ */ t(me, { className: "h-10 rounded-md" }, r)) });
96
+ return /* @__PURE__ */ t("div", { className: "space-y-3", "aria-busy": "true", children: Array.from({ length: e }, (i, r) => /* @__PURE__ */ t(pe, { className: "h-10 rounded-md" }, r)) });
96
97
  }
97
- function ye({
98
+ function ke({
98
99
  c: e,
99
100
  onShowCalls: i,
100
101
  onDisconnect: r,
@@ -106,23 +107,23 @@ function ye({
106
107
  /* @__PURE__ */ a("div", { className: "min-w-[220px] flex-1", children: [
107
108
  /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
108
109
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: e.name }),
109
- /* @__PURE__ */ t(be, { kind: e.kind })
110
+ /* @__PURE__ */ t(fe, { kind: e.kind })
110
111
  ] }),
111
112
  /* @__PURE__ */ a("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-slate-400", children: [
112
113
  e.created_at ? `Connected ${C(e.created_at)}` : "Seen in the request log",
113
114
  " · ",
114
- d ? `last used ${E(d)}` : "never used"
115
+ d ? `last used ${B(d)}` : "never used"
115
116
  ] }),
116
- /* @__PURE__ */ t(fe, { c: e }),
117
+ /* @__PURE__ */ t(ge, { c: e }),
117
118
  e.scope !== void 0 && /* @__PURE__ */ a("p", { className: "mt-1 flex min-w-0 items-center gap-1.5", children: [
118
119
  /* @__PURE__ */ t("span", { className: "shrink-0 text-[12px] text-slate-500 dark:text-slate-400", children: "May use:" }),
119
- /* @__PURE__ */ t(ie, { scope: e.scope ?? null }),
120
+ /* @__PURE__ */ t(de, { scope: e.scope ?? null }),
120
121
  ((x = e.scope) == null ? void 0 : x.locked) && /* @__PURE__ */ t("span", { className: "shrink-0 text-[11.5px] text-slate-500 dark:text-slate-400", children: "· set by an administrator" })
121
122
  ] })
122
123
  ] }),
123
124
  /* @__PURE__ */ a("div", { className: "flex min-w-[180px] flex-col gap-1", children: [
124
- e.stats && /* @__PURE__ */ t(he, { days: e.stats.days }),
125
- /* @__PURE__ */ t(xe, { s: e.stats })
125
+ e.stats && /* @__PURE__ */ t(xe, { days: e.stats.days }),
126
+ /* @__PURE__ */ t(be, { s: e.stats })
126
127
  ] }),
127
128
  /* @__PURE__ */ t("div", { className: "hidden min-w-[160px] flex-wrap gap-1 lg:flex", children: (((o = e.stats) == null ? void 0 : o.top_tools) ?? []).slice(0, 4).map((f) => /* @__PURE__ */ t(
128
129
  "span",
@@ -134,7 +135,7 @@ function ye({
134
135
  f.tool
135
136
  )) }),
136
137
  /* @__PURE__ */ a("div", { className: "ml-auto flex items-center gap-1.5", children: [
137
- e.scope_editable && /* @__PURE__ */ a(M, { children: [
138
+ e.scope_editable && /* @__PURE__ */ a(E, { children: [
138
139
  /* @__PURE__ */ t(
139
140
  "button",
140
141
  {
@@ -145,7 +146,7 @@ function ye({
145
146
  }
146
147
  ),
147
148
  /* @__PURE__ */ t(
148
- de,
149
+ ce,
149
150
  {
150
151
  open: h,
151
152
  onClose: () => m(!1),
@@ -177,7 +178,7 @@ function ye({
177
178
  }
178
179
  ),
179
180
  e.kind === "oauth" && e.created_at ? /* @__PURE__ */ t(
180
- O,
181
+ Q,
181
182
  {
182
183
  onConfirm: r,
183
184
  disabled: l,
@@ -193,14 +194,14 @@ function ye({
193
194
  className: "inline-flex items-center gap-1 text-[11.5px] text-slate-500 dark:text-slate-400",
194
195
  "data-tip": "Switch it off from API keys (administrators)",
195
196
  children: [
196
- /* @__PURE__ */ t(Y, { className: "h-3.5 w-3.5" }),
197
+ /* @__PURE__ */ t(J, { className: "h-3.5 w-3.5" }),
197
198
  " Managed by an administrator"
198
199
  ]
199
200
  }
200
201
  ) : null
201
202
  ] }),
202
203
  u && /* @__PURE__ */ t("div", { className: "basis-full", children: /* @__PURE__ */ t(
203
- pe,
204
+ ue,
204
205
  {
205
206
  conn: e.conn,
206
207
  name: e.name,
@@ -210,7 +211,7 @@ function ye({
210
211
  ) })
211
212
  ] });
212
213
  }
213
- function ke({
214
+ function Ne({
214
215
  w: e,
215
216
  onUndo: i,
216
217
  undoing: r
@@ -218,7 +219,7 @@ function ke({
218
219
  const { urlFor: l, open: d } = U(), u = e.collection && e.item ? { collection: e.collection, itemId: e.item } : null;
219
220
  return /* @__PURE__ */ a("li", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 py-1.5", children: [
220
221
  /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
221
- ve[e.action] ?? e.action,
222
+ ye[e.action] ?? e.action,
222
223
  " ",
223
224
  u && e.action !== "delete" ? /* @__PURE__ */ a(
224
225
  "a",
@@ -241,7 +242,7 @@ function ke({
241
242
  ] })
242
243
  ] }),
243
244
  e.undoable ? /* @__PURE__ */ a(
244
- O,
245
+ Q,
245
246
  {
246
247
  onConfirm: i,
247
248
  disabled: r,
@@ -250,20 +251,20 @@ function ke({
250
251
  className: "inline-flex h-6 items-center gap-1 rounded-md border border-slate-200 px-2 text-[11.5px] font-medium text-slate-700 transition-colors hover:border-nvr-cyan hover:text-nvr-navy focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 disabled:opacity-40 dark:border-border dark:text-slate-200 dark:hover:text-nvr-cyan",
251
252
  armedClassName: "border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-300",
252
253
  children: [
253
- r ? /* @__PURE__ */ t(w, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(te, { className: "h-3 w-3" }),
254
+ r ? /* @__PURE__ */ t(w, { className: "h-3 w-3 animate-spin" }) : /* @__PURE__ */ t(ae, { className: "h-3 w-3" }),
254
255
  "Undo"
255
256
  ]
256
257
  }
257
258
  ) : /* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: e.reason })
258
259
  ] });
259
260
  }
260
- function Ne({
261
+ function we({
261
262
  call: e,
262
263
  onUndo: i,
263
264
  undoingId: r
264
265
  }) {
265
- const [l, d] = v(!1), { urlFor: u, open: p } = U(), h = ge[e.outcome], m = e.writes.length > 0 || !!e.message, s = e.record, x = s != null && s.id ? { collection: s.collection, itemId: s.id } : null;
266
- return /* @__PURE__ */ a(ne, { children: [
266
+ const [l, d] = v(!1), { urlFor: u, open: p } = U(), h = ve[e.outcome], m = e.writes.length > 0 || !!e.message, s = e.record, x = s != null && s.id ? { collection: s.collection, itemId: s.id } : null;
267
+ return /* @__PURE__ */ a(se, { children: [
267
268
  /* @__PURE__ */ a(
268
269
  "tr",
269
270
  {
@@ -284,7 +285,7 @@ function Ne({
284
285
  "aria-label": l ? "Hide what this call changed" : "Show what this call changed",
285
286
  className: "flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:hover:text-slate-200",
286
287
  children: /* @__PURE__ */ t(
287
- J,
288
+ ee,
288
289
  {
289
290
  className: y(
290
291
  "h-3.5 w-3.5 transition-transform duration-150",
@@ -298,8 +299,8 @@ function Ne({
298
299
  "td",
299
300
  {
300
301
  className: "whitespace-nowrap py-2 pr-3 text-slate-500 dark:text-slate-400",
301
- "data-tip": le(e.at),
302
- children: E(e.at)
302
+ "data-tip": ie(e.at),
303
+ children: B(e.at)
303
304
  }
304
305
  ),
305
306
  /* @__PURE__ */ t("td", { className: "max-w-[160px] truncate py-2 pr-3 text-slate-700 dark:text-slate-200", children: e.app }),
@@ -320,14 +321,14 @@ function Ne({
320
321
  }
321
322
  ) : s ? /* @__PURE__ */ t("span", { className: "font-mono text-[11.5px] text-slate-600 dark:text-slate-300", children: s.collection }) : /* @__PURE__ */ t("span", { className: "text-slate-400 dark:text-slate-500", children: "—" }) }),
322
323
  /* @__PURE__ */ t("td", { className: "py-2 pr-3", children: /* @__PURE__ */ a("span", { className: "inline-flex items-center gap-1.5", children: [
323
- /* @__PURE__ */ t(Q, { tone: h.tone, children: h.label }),
324
+ /* @__PURE__ */ t(j, { tone: h.tone, children: h.label }),
324
325
  e.writes.length > 0 && /* @__PURE__ */ a("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: [
325
326
  e.writes.length,
326
327
  " write",
327
328
  e.writes.length === 1 ? "" : "s"
328
329
  ] })
329
330
  ] }) }),
330
- /* @__PURE__ */ t("td", { className: "whitespace-nowrap py-2 pr-1 text-right tabular-nums text-slate-500 dark:text-slate-400", children: e.bytes != null ? B(e.bytes) : "" })
331
+ /* @__PURE__ */ t("td", { className: "whitespace-nowrap py-2 pr-1 text-right tabular-nums text-slate-500 dark:text-slate-400", children: e.bytes != null ? O(e.bytes) : "" })
331
332
  ]
332
333
  }
333
334
  ),
@@ -339,7 +340,7 @@ function Ne({
339
340
  e.message
340
341
  ] }),
341
342
  e.writes.length > 0 && /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: e.writes.map((o) => /* @__PURE__ */ t(
342
- ke,
343
+ Ne,
343
344
  {
344
345
  w: o,
345
346
  onUndo: () => i(o),
@@ -359,12 +360,12 @@ function Ne({
359
360
  ] })
360
361
  ] });
361
362
  }
362
- function Ae({ className: e }) {
363
+ function Te({ className: e }) {
363
364
  var P, S, $, R, F, L;
364
- const i = se(), r = z(), [l, d] = v(""), u = ae(null), [p, h] = v(null), m = V({
365
+ const i = re(), r = V(), [l, d] = v(""), u = ne(null), [p, h] = v(null), m = Z({
365
366
  queryKey: T("mine"),
366
367
  queryFn: () => i.request(q("/mcp-connections/mine")).then((n) => n.data)
367
- }), s = Z({
368
+ }), s = G({
368
369
  queryKey: ["nvr-mcp-activity", l],
369
370
  initialPageParam: null,
370
371
  queryFn: ({ pageParam: n }) => i.request(
@@ -375,24 +376,24 @@ function Ae({ className: e }) {
375
376
  ).then((c) => c.data),
376
377
  getNextPageParam: (n) => n.next_before
377
378
  }), x = D({
378
- mutationFn: (n) => i.request(re(`/mcp-connections/mine/${n}`)),
379
+ mutationFn: (n) => i.request(oe(`/mcp-connections/mine/${n}`)),
379
380
  onSuccess: () => {
380
381
  h({ tone: "ok", text: "Disconnected. Its tokens stopped working at once." }), r.invalidateQueries({ queryKey: T("mine") });
381
382
  },
382
- onError: (n) => h({ tone: "bad", text: (n == null ? void 0 : n.message) || "Could not disconnect" })
383
+ onError: (n) => h({ tone: "bad", text: A(n, "Could not disconnect") })
383
384
  }), o = D({
384
- mutationFn: (n) => i.request(oe(`/mcp-connections/mine/activity/${n.activity_id}/undo`)),
385
+ mutationFn: (n) => i.request(le(`/mcp-connections/mine/activity/${n.activity_id}/undo`)),
385
386
  onSuccess: (n, c) => {
386
387
  h({
387
388
  tone: "ok",
388
389
  text: c.action === "create" ? "Undone — the record was deleted." : "Undone — the previous values are back."
389
390
  }), r.invalidateQueries({ queryKey: ["nvr-mcp-activity"] });
390
391
  },
391
- onError: (n) => h({ tone: "bad", text: (n == null ? void 0 : n.message) || "Could not undo that change" })
392
+ onError: (n) => h({ tone: "bad", text: A(n, "Could not undo that change") })
392
393
  }), b = ((P = m.data) == null ? void 0 : P.connections) ?? [], f = I(() => {
393
394
  var n;
394
395
  return ((n = s.data) == null ? void 0 : n.pages.flatMap((c) => c.calls)) ?? [];
395
- }, [s.data]), j = ((S = m.data) == null ? void 0 : S.logged) !== !1 && ((R = ($ = s.data) == null ? void 0 : $.pages[0]) == null ? void 0 : R.logged) !== !1, _ = I(
396
+ }, [s.data]), W = ((S = m.data) == null ? void 0 : S.logged) !== !1 && ((R = ($ = s.data) == null ? void 0 : $.pages[0]) == null ? void 0 : R.logged) !== !1, _ = I(
396
397
  () => [
397
398
  { value: "", label: "Every app" },
398
399
  ...b.filter((n) => {
@@ -426,17 +427,17 @@ function Ae({ className: e }) {
426
427
  }
427
428
  ),
428
429
  /* @__PURE__ */ t(
429
- A,
430
+ M,
430
431
  {
431
- icon: /* @__PURE__ */ t(H, { className: "h-4 w-4" }),
432
+ icon: /* @__PURE__ */ t(X, { className: "h-4 w-4" }),
432
433
  title: "Connected apps",
433
434
  hint: "AI assistants that act as you through Nivaro’s MCP server, with your permissions",
434
435
  children: m.isLoading ? /* @__PURE__ */ t(K, {}) : m.isError ? /* @__PURE__ */ t(k, { children: "Connected apps could not be loaded. Try again in a moment." }) : b.length === 0 ? /* @__PURE__ */ a("div", { className: "flex items-start gap-3", children: [
435
- /* @__PURE__ */ t(G, { className: "mt-0.5 h-5 w-5 shrink-0 text-slate-400" }),
436
+ /* @__PURE__ */ t(H, { className: "mt-0.5 h-5 w-5 shrink-0 text-slate-400" }),
436
437
  /* @__PURE__ */ t("p", { className: "max-w-[70ch] text-[12.5px] text-slate-600 dark:text-slate-300", children: "No assistant is connected. Add Nivaro as a connector in Claude, ChatGPT, Claude Code or Codex and sign in — the app shows up here with what it did, and you can disconnect it at any time." })
437
- ] }) : /* @__PURE__ */ a(M, { children: [
438
+ ] }) : /* @__PURE__ */ a(E, { children: [
438
439
  /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: b.map((n) => /* @__PURE__ */ t(
439
- ye,
440
+ ke,
440
441
  {
441
442
  c: n,
442
443
  onShowCalls: () => {
@@ -462,13 +463,13 @@ function Ae({ className: e }) {
462
463
  }
463
464
  ),
464
465
  /* @__PURE__ */ t("div", { ref: u, className: "scroll-mt-4", children: /* @__PURE__ */ t(
465
- A,
466
+ M,
466
467
  {
467
- icon: /* @__PURE__ */ t(X, { className: "h-4 w-4" }),
468
+ icon: /* @__PURE__ */ t(Y, { className: "h-4 w-4" }),
468
469
  title: "What my agents did",
469
470
  hint: "Every tool call, newest first. Open one to see its changes and undo them.",
470
471
  actions: _.length > 2 ? /* @__PURE__ */ t(
471
- ce,
472
+ me,
472
473
  {
473
474
  value: l,
474
475
  onChange: d,
@@ -476,7 +477,7 @@ function Ae({ className: e }) {
476
477
  ariaLabel: "Show calls from"
477
478
  }
478
479
  ) : null,
479
- children: j ? s.isLoading ? /* @__PURE__ */ t(K, { rows: 5 }) : s.isError ? /* @__PURE__ */ t(k, { children: "The list could not be loaded. Try again in a moment." }) : f.length === 0 ? /* @__PURE__ */ t(k, { children: l ? "This app made no tool calls in the last 14 days." : "Your agents made no tool calls in the last 14 days." }) : /* @__PURE__ */ a("div", { className: "-mx-1 overflow-x-auto", children: [
480
+ children: W ? s.isLoading ? /* @__PURE__ */ t(K, { rows: 5 }) : s.isError ? /* @__PURE__ */ t(k, { children: "The list could not be loaded. Try again in a moment." }) : f.length === 0 ? /* @__PURE__ */ t(k, { children: l ? "This app made no tool calls in the last 14 days." : "Your agents made no tool calls in the last 14 days." }) : /* @__PURE__ */ a("div", { className: "-mx-1 overflow-x-auto", children: [
480
481
  /* @__PURE__ */ a("table", { className: "w-full min-w-[640px] text-left text-[12px]", children: [
481
482
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ a("tr", { className: "border-b border-slate-200 text-[11px] font-medium text-slate-500 dark:border-border dark:text-slate-400", children: [
482
483
  /* @__PURE__ */ t("th", { className: "w-5" }),
@@ -490,10 +491,10 @@ function Ae({ className: e }) {
490
491
  /* @__PURE__ */ t("tbody", { children: f.map((n) => {
491
492
  var c;
492
493
  return /* @__PURE__ */ t(
493
- Ne,
494
+ we,
494
495
  {
495
496
  call: n,
496
- onUndo: (W) => o.mutate(W),
497
+ onUndo: (z) => o.mutate(z),
497
498
  undoingId: o.isPending ? ((c = o.variables) == null ? void 0 : c.activity_id) ?? null : null
498
499
  },
499
500
  n.id
@@ -519,10 +520,10 @@ function Ae({ className: e }) {
519
520
  ] });
520
521
  }
521
522
  export {
522
- Ae as AgentsPanel,
523
- xe as CallFigures,
524
- he as CallsSparkline,
525
- fe as IdleNote,
526
- be as KindPill,
523
+ Te as AgentsPanel,
524
+ be as CallFigures,
525
+ xe as CallsSparkline,
526
+ ge as IdleNote,
527
+ fe as KindPill,
527
528
  T as mcpConnectionsKey
528
529
  };
@@ -1,46 +1,47 @@
1
- import { jsxs as f, jsx as d } from "react/jsx-runtime";
2
- import { useQueryClient as h, useMutation as g, useQuery as x } from "@tanstack/react-query";
1
+ import { jsxs as m, jsx as d } from "react/jsx-runtime";
2
+ import { useQueryClient as f, useMutation as h, useQuery as x } from "@tanstack/react-query";
3
3
  import { MailX as b } from "lucide-react";
4
- import { toast as c } from "sonner";
5
- import { useOptionalNivaroClient as p } from "../../context.js";
4
+ import { toast as g } from "sonner";
5
+ import { useOptionalNivaroClient as c } from "../../context.js";
6
6
  import { del as y, get as k } from "../../lib/commands.js";
7
- import { formatDate as q, cn as v } from "../../lib/utils.js";
8
- function C(t, i = !0) {
9
- const n = p(), r = String(t ?? "").trim().toLowerCase();
7
+ import { toastError as q } from "../../lib/error-toast.js";
8
+ import { formatDate as v, cn as C } from "../../lib/utils.js";
9
+ function N(t, i = !0) {
10
+ const o = c(), r = String(t ?? "").trim().toLowerCase();
10
11
  return x({
11
12
  queryKey: ["mail-suppression", r],
12
- queryFn: () => n.request(k("/mail-suppressions/check", { address: r })).then((o) => o.data),
13
- enabled: !!n && i && r.includes("@"),
13
+ queryFn: () => o.request(k("/mail-suppressions/check", { address: r })).then((n) => n.data),
14
+ enabled: !!o && i && r.includes("@"),
14
15
  staleTime: 6e4
15
16
  });
16
17
  }
17
- function E({
18
+ function P({
18
19
  email: t,
19
20
  canClear: i = !1,
20
- enabled: n = !0,
21
+ enabled: o = !0,
21
22
  className: r
22
23
  }) {
23
- const o = p(), a = h(), { data: e } = C(t, n), l = g({
24
- mutationFn: (s) => o.request(y(`/mail-suppressions/${s}`)),
24
+ const n = c(), a = f(), { data: e } = N(t, o), l = h({
25
+ mutationFn: (s) => n.request(y(`/mail-suppressions/${s}`)),
25
26
  onSuccess: () => {
26
- c.success(`Cleared — mail to ${String(t ?? "").trim()} will send again`), a.invalidateQueries({ queryKey: ["mail-suppression"] }), a.invalidateQueries({ queryKey: ["mail-suppressions"] });
27
+ g.success(`Cleared — mail to ${String(t ?? "").trim()} will send again`), a.invalidateQueries({ queryKey: ["mail-suppression"] }), a.invalidateQueries({ queryKey: ["mail-suppressions"] });
27
28
  },
28
- onError: (s) => c.error(s instanceof Error && s.message ? s.message : "Could not clear the mark")
29
+ onError: (s) => q(s, "Could not clear the mark")
29
30
  });
30
31
  if (!(e != null && e.suppressed)) return null;
31
- const u = e.since ? q(e.since) : null, m = [
32
+ const u = e.since ? v(e.since) : null, p = [
32
33
  "The mail relay refused this address with a hard bounce",
33
34
  e.reason ? `Reason: ${e.reason}` : null,
34
35
  e.count && e.count > 1 ? `${e.count} bounces` : null,
35
36
  "Nothing is sent there until an administrator clears the mark"
36
37
  ].filter(Boolean).join(`
37
38
  `);
38
- return /* @__PURE__ */ f(
39
+ return /* @__PURE__ */ m(
39
40
  "span",
40
41
  {
41
42
  "data-mail-suppressed": e.id ?? "",
42
- "data-tip": m,
43
- className: v(
43
+ "data-tip": p,
44
+ className: C(
44
45
  "inline-flex items-center gap-1 rounded-full bg-rose-50 px-2 py-px text-[10.5px] font-semibold text-rose-700 dark:bg-rose-500/10 dark:text-rose-400",
45
46
  r
46
47
  ),
@@ -66,6 +67,6 @@ function E({
66
67
  );
67
68
  }
68
69
  export {
69
- E as MailSuppressedPill,
70
- C as useMailSuppression
70
+ P as MailSuppressedPill,
71
+ N as useMailSuppression
71
72
  };