@nivaro/react 0.3.114 → 0.3.115

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 (281) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1717 -21
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4088 -3592
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +1 -0
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  62. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  63. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  65. package/dist/shared/components/change-proposals/types.js +4 -0
  66. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  67. package/dist/shared/components/chat/Composer.js +276 -298
  68. package/dist/shared/components/chat/room-due.js +13 -0
  69. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  70. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  71. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  72. package/dist/shared/components/imports/ImportConsole.js +159 -155
  73. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  74. package/dist/shared/components/integrations/SendStatus.js +202 -0
  75. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  76. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  77. package/dist/shared/components/integrations/console/api.js +161 -117
  78. package/dist/shared/components/integrations/console/tone.js +15 -12
  79. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  80. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  81. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  82. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  83. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  84. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  85. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  86. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  87. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  88. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  89. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  90. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  91. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  92. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  93. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  94. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  95. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  96. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  97. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  98. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  99. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  100. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  101. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  102. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  103. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  104. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  105. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  106. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  107. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  108. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  109. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  110. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  111. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  112. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  113. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  114. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  115. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  116. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  117. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  118. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  119. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  120. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  121. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  122. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  123. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  124. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  125. package/dist/shared/components/item-edit/file-live.js +77 -0
  126. package/dist/shared/components/item-edit/file-processing.js +87 -0
  127. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  128. package/dist/shared/components/item-edit/live-related.js +23 -0
  129. package/dist/shared/components/item-edit/live-title.js +66 -0
  130. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  131. package/dist/shared/components/item-edit/removed-line.js +58 -0
  132. package/dist/shared/components/item-edit/render-stability.js +70 -59
  133. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  134. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  135. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  136. package/dist/shared/components/list/InlineEdit.js +504 -208
  137. package/dist/shared/components/list/ListViewers.js +81 -0
  138. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  139. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  140. package/dist/shared/components/merge/merge-values.js +110 -0
  141. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  142. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  143. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  144. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  145. package/dist/shared/components/notifications/bundles.js +21 -19
  146. package/dist/shared/components/notifications/resolved-line.js +25 -0
  147. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  148. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  149. package/dist/shared/components/panels/AlertBanners.js +132 -0
  150. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  151. package/dist/shared/components/panels/BranchLanes.js +82 -54
  152. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  153. package/dist/shared/components/panels/CommentImages.js +219 -0
  154. package/dist/shared/components/panels/CommentPanel.js +649 -530
  155. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  156. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  157. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  158. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  159. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  160. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  161. package/dist/shared/components/panels/SlaClock.js +130 -99
  162. package/dist/shared/components/panels/TaskPanel.js +308 -287
  163. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  164. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  165. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  166. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  167. package/dist/shared/components/profile/AgentNameField.js +141 -0
  168. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  169. package/dist/shared/components/profile/PersonAccess.js +398 -330
  170. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  171. package/dist/shared/components/profile/PersonProfile.js +81 -73
  172. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  173. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  174. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  175. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  176. package/dist/shared/components/queue/QueueWorklist.js +1927 -1635
  177. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  178. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  179. package/dist/shared/components/support/ReportProblem.js +1 -0
  180. package/dist/shared/components/support/ScreenShare.js +554 -0
  181. package/dist/shared/components/support/SupportView.js +160 -129
  182. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  183. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  184. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  185. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  186. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  187. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  188. package/dist/shared/lib/activity-sentence.js +87 -75
  189. package/dist/shared/lib/agent-presence.js +46 -0
  190. package/dist/shared/lib/approval-progress.js +49 -0
  191. package/dist/shared/lib/attention-prefs.js +27 -0
  192. package/dist/shared/lib/cell-locks.js +56 -0
  193. package/dist/shared/lib/co-edit.js +166 -0
  194. package/dist/shared/lib/coedit-registry.js +44 -0
  195. package/dist/shared/lib/comment-awareness.js +124 -0
  196. package/dist/shared/lib/comment-images.js +45 -0
  197. package/dist/shared/lib/config-watch.js +94 -0
  198. package/dist/shared/lib/copy-rules.js +65 -0
  199. package/dist/shared/lib/count-step.js +30 -0
  200. package/dist/shared/lib/deadline-ticker.js +68 -0
  201. package/dist/shared/lib/derived-causes.js +115 -0
  202. package/dist/shared/lib/draft-store.js +114 -85
  203. package/dist/shared/lib/error-hints.js +1 -0
  204. package/dist/shared/lib/field-merge.js +126 -0
  205. package/dist/shared/lib/filter-sentence.js +10 -10
  206. package/dist/shared/lib/focus-mode.js +16 -12
  207. package/dist/shared/lib/grid-cursors.js +77 -0
  208. package/dist/shared/lib/grid-presence.js +182 -0
  209. package/dist/shared/lib/idle-reload.js +100 -73
  210. package/dist/shared/lib/in-step.js +45 -0
  211. package/dist/shared/lib/integration-chip.js +19 -18
  212. package/dist/shared/lib/line-locks.js +141 -0
  213. package/dist/shared/lib/line-split.js +41 -0
  214. package/dist/shared/lib/linked-changes.js +150 -0
  215. package/dist/shared/lib/list-return.js +231 -0
  216. package/dist/shared/lib/list-viewers.js +52 -0
  217. package/dist/shared/lib/live-announcer.js +86 -0
  218. package/dist/shared/lib/live-counts.js +85 -0
  219. package/dist/shared/lib/live-data-changed.js +108 -0
  220. package/dist/shared/lib/live-deltas.js +81 -0
  221. package/dist/shared/lib/live-findings.js +113 -0
  222. package/dist/shared/lib/live-groups.js +122 -0
  223. package/dist/shared/lib/live-link-labels.js +162 -0
  224. package/dist/shared/lib/live-list-flow.js +334 -0
  225. package/dist/shared/lib/live-list.js +143 -129
  226. package/dist/shared/lib/live-moves.js +51 -0
  227. package/dist/shared/lib/live-ops.js +26 -26
  228. package/dist/shared/lib/live-pickers.js +7 -0
  229. package/dist/shared/lib/live-preference.js +184 -0
  230. package/dist/shared/lib/live-queries.js +226 -181
  231. package/dist/shared/lib/live-screen.js +333 -0
  232. package/dist/shared/lib/live-search.js +108 -0
  233. package/dist/shared/lib/live-seen.js +35 -0
  234. package/dist/shared/lib/live-views.js +100 -0
  235. package/dist/shared/lib/live.js +159 -133
  236. package/dist/shared/lib/missed-updates.js +198 -0
  237. package/dist/shared/lib/newer-file.js +56 -0
  238. package/dist/shared/lib/notification-sound.js +42 -20
  239. package/dist/shared/lib/own-writes.js +59 -41
  240. package/dist/shared/lib/picker-badges.js +94 -0
  241. package/dist/shared/lib/presence-signals.js +131 -84
  242. package/dist/shared/lib/realtime.js +49 -24
  243. package/dist/shared/lib/record-gaps.js +85 -0
  244. package/dist/shared/lib/record-outbox.js +369 -222
  245. package/dist/shared/lib/record-peek.js +75 -0
  246. package/dist/shared/lib/record-tabs.js +92 -72
  247. package/dist/shared/lib/relative-ticker.js +42 -0
  248. package/dist/shared/lib/request-gate.js +119 -119
  249. package/dist/shared/lib/rollup-recalc.js +107 -0
  250. package/dist/shared/lib/room-gaps.js +40 -36
  251. package/dist/shared/lib/rum.js +137 -87
  252. package/dist/shared/lib/save-progress.js +20 -0
  253. package/dist/shared/lib/scheduled-countdown.js +67 -0
  254. package/dist/shared/lib/screen-refresh.js +160 -0
  255. package/dist/shared/lib/screen-share.js +234 -0
  256. package/dist/shared/lib/seen-since.js +74 -0
  257. package/dist/shared/lib/selection-watch.js +205 -0
  258. package/dist/shared/lib/send-status.js +132 -0
  259. package/dist/shared/lib/send-view.js +23 -0
  260. package/dist/shared/lib/socket-liveness.js +155 -0
  261. package/dist/shared/lib/socket-realtime.js +168 -140
  262. package/dist/shared/lib/state-census.js +53 -0
  263. package/dist/shared/lib/summary-mode.js +61 -39
  264. package/dist/shared/lib/tab-attention.js +143 -32
  265. package/dist/shared/lib/table-density.js +64 -0
  266. package/dist/shared/lib/track-travel.js +40 -0
  267. package/dist/shared/lib/unseen-changes.js +68 -0
  268. package/dist/shared/lib/upload-file.js +33 -0
  269. package/dist/shared/lib/upload-presence.js +127 -0
  270. package/dist/shared/lib/urgent-chime.js +65 -0
  271. package/dist/shared/lib/use-online-users.js +32 -11
  272. package/dist/shared/lib/user-sync.js +155 -39
  273. package/dist/shared/lib/waiting-count.js +44 -0
  274. package/dist/shared/lib/watch-desktop.js +83 -0
  275. package/dist/shared/lib/watch-list.js +447 -0
  276. package/dist/shared/lib/widget-image-render.js +64 -0
  277. package/dist/shared/lib/widget-image.js +111 -0
  278. package/dist/shared/lib/worker-socket.js +130 -104
  279. package/dist/shared/lib/write-to-screen.js +133 -0
  280. package/package.json +1 -1
  281. package/styles.css +49 -1
@@ -0,0 +1,141 @@
1
+ import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
+ import { useQueryClient as A, useMutation as P } from "@tanstack/react-query";
3
+ import { Pencil as S, Loader2 as I, Check as M } from "lucide-react";
4
+ import { useState as v, useRef as $, useId as j, useEffect as q } from "react";
5
+ import { useNivaroClient as D } from "../../context.js";
6
+ import { patch as U } from "../../lib/commands.js";
7
+ import { userErrorMessage as F } from "../../lib/safe-error.js";
8
+ import { cn as g } from "../../lib/utils.js";
9
+ const K = 40;
10
+ function B({
11
+ conn: c,
12
+ displayName: a,
13
+ customName: d,
14
+ appName: s,
15
+ forName: k,
16
+ scope: w,
17
+ trailing: y,
18
+ className: u
19
+ }) {
20
+ const N = D(), C = A(), [o, l] = v(!1), [m, f] = v(a), h = $(null), x = j();
21
+ q(() => {
22
+ const e = h.current;
23
+ !o || !e || (e.focus(), e.setSelectionRange(e.value.length, e.value.length));
24
+ }, [o]);
25
+ const t = P({
26
+ mutationFn: (e) => N.request(
27
+ U(
28
+ w === "mine" ? `/mcp-connections/mine/${encodeURIComponent(c)}/name` : `/mcp-connections/${encodeURIComponent(c)}/name`,
29
+ { name: e }
30
+ )
31
+ ),
32
+ onSuccess: () => {
33
+ l(!1), C.invalidateQueries({ queryKey: ["nvr-mcp-connections"] });
34
+ }
35
+ }), i = m.trim(), p = i === a, R = () => {
36
+ f(a), t.reset(), l(!0);
37
+ }, b = () => {
38
+ l(!1), t.reset();
39
+ };
40
+ if (!o)
41
+ return /* @__PURE__ */ r("span", { className: g("inline-flex min-w-0 items-center gap-1", u), children: [
42
+ /* @__PURE__ */ n(
43
+ "span",
44
+ {
45
+ className: "truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100",
46
+ "data-tip": d ? `Named by its owner or an administrator · app: ${s}` : void 0,
47
+ children: a
48
+ }
49
+ ),
50
+ /* @__PURE__ */ n(
51
+ "button",
52
+ {
53
+ type: "button",
54
+ onClick: R,
55
+ "aria-label": `Rename ${a}`,
56
+ "data-tip": "Rename — the name records and notifications show for this agent",
57
+ className: "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/40 dark:text-slate-500 dark:hover:text-slate-200",
58
+ children: /* @__PURE__ */ n(S, { className: "h-3.5 w-3.5", "aria-hidden": !0 })
59
+ }
60
+ ),
61
+ y
62
+ ] });
63
+ const E = i || s;
64
+ return /* @__PURE__ */ r(
65
+ "form",
66
+ {
67
+ className: g("flex w-full min-w-0 flex-col gap-1", u),
68
+ "data-nvr-agent-name-edit": !0,
69
+ onSubmit: (e) => {
70
+ e.preventDefault(), !(p || !i) && t.mutate(i);
71
+ },
72
+ children: [
73
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-1.5", children: [
74
+ /* @__PURE__ */ n(
75
+ "input",
76
+ {
77
+ ref: h,
78
+ value: m,
79
+ maxLength: K,
80
+ onChange: (e) => f(e.target.value),
81
+ onKeyDown: (e) => {
82
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), b());
83
+ },
84
+ "aria-label": "Agent name",
85
+ "aria-describedby": x,
86
+ className: "h-8 w-48 min-w-0 rounded-md border border-slate-200 bg-white px-2 text-[13px] text-slate-800 outline-none transition-colors focus:border-nvr-cyan focus-visible:ring-2 focus-visible:ring-nvr-cyan/25 dark:border-border dark:bg-background dark:text-slate-100"
87
+ }
88
+ ),
89
+ /* @__PURE__ */ r(
90
+ "button",
91
+ {
92
+ type: "submit",
93
+ disabled: p || !i || t.isPending,
94
+ className: "inline-flex h-8 items-center gap-1 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-colors hover:bg-nvr-cyan/90 disabled:opacity-40",
95
+ children: [
96
+ t.isPending ? /* @__PURE__ */ n(I, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": !0 }) : /* @__PURE__ */ n(M, { className: "h-3.5 w-3.5", "aria-hidden": !0 }),
97
+ "Save"
98
+ ]
99
+ }
100
+ ),
101
+ /* @__PURE__ */ n(
102
+ "button",
103
+ {
104
+ type: "button",
105
+ onClick: b,
106
+ className: "h-8 rounded-md px-2 text-[12px] font-medium text-slate-600 transition-colors hover:bg-muted hover:text-slate-900 dark:text-slate-300 dark:hover:text-white",
107
+ children: "Cancel"
108
+ }
109
+ ),
110
+ d && /* @__PURE__ */ r(
111
+ "button",
112
+ {
113
+ type: "button",
114
+ disabled: t.isPending,
115
+ onClick: () => t.mutate(null),
116
+ className: "h-8 rounded-md px-2 text-[12px] font-medium text-slate-500 underline-offset-2 transition-colors hover:text-slate-800 hover:underline disabled:opacity-40 dark:text-slate-400 dark:hover:text-slate-100",
117
+ children: [
118
+ "Use “",
119
+ s,
120
+ "”"
121
+ ]
122
+ }
123
+ )
124
+ ] }),
125
+ /* @__PURE__ */ r("p", { id: x, className: "text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: [
126
+ "Records it works on show “",
127
+ /* @__PURE__ */ n("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: E }),
128
+ " (for",
129
+ " ",
130
+ k,
131
+ ") is updating this record”.",
132
+ t.isError && /* @__PURE__ */ n("span", { role: "alert", className: "ml-1 text-red-600 dark:text-red-400", children: F(t.error, "The name could not be saved") })
133
+ ] })
134
+ ]
135
+ }
136
+ );
137
+ }
138
+ export {
139
+ K as AGENT_NAME_MAX,
140
+ B as AgentNameField
141
+ };
@@ -1,22 +1,23 @@
1
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";
2
+ import { useQueryClient as V, useQuery as Z, useInfiniteQuery as G, useMutation as A } from "@tanstack/react-query";
3
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";
4
+ import { useState as v, useRef as ne, useMemo as D, Fragment as se } from "react";
5
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";
6
+ import { get as I, del as oe, post as le } from "../../lib/commands.js";
7
+ import { userErrorMessage as q } from "../../lib/safe-error.js";
8
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
9
  import { ScopeBadge as de, McpScopeSheet as ce } from "../McpConnectionScope.js";
10
10
  import { SimpleSelectXs as me } from "../ui/SimpleSelect.js";
11
11
  import { Skeleton as pe } from "../ui/skeleton.js";
12
- import { ConnectionRollback as ue } from "./ConnectionRollback.js";
12
+ import { AgentNameField as ue } from "./AgentNameField.js";
13
+ import { ConnectionRollback as he } from "./ConnectionRollback.js";
13
14
  import { SectionCard as M, EmptyLine as k, ConfirmButton as Q, Pill as j } from "./primitives.js";
14
- const he = {
15
+ const xe = {
15
16
  oauth: "Signed in",
16
17
  api_key: "API key",
17
18
  token: "Personal token"
18
19
  }, T = (e) => ["nvr-mcp-connections", e];
19
- function xe({ days: e }) {
20
+ function be({ days: e }) {
20
21
  const i = Math.max(1, ...e.map((r) => r.calls));
21
22
  return /* @__PURE__ */ t("div", { className: "flex h-6 items-end gap-[2px]", "aria-hidden": !0, children: e.map((r) => {
22
23
  const l = r.calls ? Math.max(3, Math.round(r.calls / i * 24)) : 2, d = r.errors + r.refused;
@@ -41,7 +42,7 @@ function xe({ days: e }) {
41
42
  );
42
43
  }) });
43
44
  }
44
- function be({ s: e }) {
45
+ function fe({ s: e }) {
45
46
  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: [
46
47
  /* @__PURE__ */ t("b", { className: "font-semibold text-slate-800 dark:text-slate-100", children: g(e.calls) }),
47
48
  " ",
@@ -64,10 +65,10 @@ function be({ s: e }) {
64
65
  ] })
65
66
  ] });
66
67
  }
67
- function fe({ kind: e }) {
68
- return /* @__PURE__ */ t(j, { tone: e === "oauth" ? "brand" : "neutral", children: he[e] });
68
+ function ge({ kind: e }) {
69
+ return /* @__PURE__ */ t(j, { tone: e === "oauth" ? "brand" : "neutral", children: xe[e] });
69
70
  }
70
- function ge({ c: e }) {
71
+ function ve({ c: e }) {
71
72
  if (!e.idle || e.idle.status === "active") return null;
72
73
  const i = C(`${e.idle.revoke_on}T12:00:00Z`, {
73
74
  month: "short",
@@ -83,11 +84,11 @@ function ge({ c: e }) {
83
84
  " unless it is used."
84
85
  ] });
85
86
  }
86
- const ve = {
87
+ const ye = {
87
88
  ok: { label: "Done", tone: "green" },
88
89
  refused: { label: "Refused", tone: "amber" },
89
90
  error: { label: "Failed", tone: "red" }
90
- }, ye = {
91
+ }, ke = {
91
92
  create: "Created",
92
93
  update: "Changed",
93
94
  delete: "Deleted"
@@ -95,7 +96,7 @@ const ve = {
95
96
  function K({ rows: e = 3 }) {
96
97
  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)) });
97
98
  }
98
- function ke({
99
+ function Ne({
99
100
  c: e,
100
101
  onShowCalls: i,
101
102
  onDisconnect: r,
@@ -105,16 +106,24 @@ function ke({
105
106
  const d = ((s = e.stats) == null ? void 0 : s.last_call_at) ?? e.last_used_at, [u, p] = v(!1), [h, m] = v(!1);
106
107
  return /* @__PURE__ */ a("li", { className: "flex flex-wrap items-center gap-x-6 gap-y-3 py-3 first:pt-0 last:pb-0", children: [
107
108
  /* @__PURE__ */ a("div", { className: "min-w-[220px] flex-1", children: [
108
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
109
- /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: e.name }),
110
- /* @__PURE__ */ t(fe, { kind: e.kind })
111
- ] }),
109
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ t(
110
+ ue,
111
+ {
112
+ conn: e.conn,
113
+ displayName: e.display_name ?? e.name,
114
+ customName: e.custom_name,
115
+ appName: e.name,
116
+ forName: "you",
117
+ scope: "mine",
118
+ trailing: /* @__PURE__ */ t(ge, { kind: e.kind })
119
+ }
120
+ ) }),
112
121
  /* @__PURE__ */ a("p", { className: "mt-0.5 text-[12px] text-slate-500 dark:text-slate-400", children: [
113
122
  e.created_at ? `Connected ${C(e.created_at)}` : "Seen in the request log",
114
123
  " · ",
115
124
  d ? `last used ${B(d)}` : "never used"
116
125
  ] }),
117
- /* @__PURE__ */ t(ge, { c: e }),
126
+ /* @__PURE__ */ t(ve, { c: e }),
118
127
  e.scope !== void 0 && /* @__PURE__ */ a("p", { className: "mt-1 flex min-w-0 items-center gap-1.5", children: [
119
128
  /* @__PURE__ */ t("span", { className: "shrink-0 text-[12px] text-slate-500 dark:text-slate-400", children: "May use:" }),
120
129
  /* @__PURE__ */ t(de, { scope: e.scope ?? null }),
@@ -122,8 +131,8 @@ function ke({
122
131
  ] })
123
132
  ] }),
124
133
  /* @__PURE__ */ a("div", { className: "flex min-w-[180px] flex-col gap-1", children: [
125
- e.stats && /* @__PURE__ */ t(xe, { days: e.stats.days }),
126
- /* @__PURE__ */ t(be, { s: e.stats })
134
+ e.stats && /* @__PURE__ */ t(be, { days: e.stats.days }),
135
+ /* @__PURE__ */ t(fe, { s: e.stats })
127
136
  ] }),
128
137
  /* @__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(
129
138
  "span",
@@ -201,7 +210,7 @@ function ke({
201
210
  ) : null
202
211
  ] }),
203
212
  u && /* @__PURE__ */ t("div", { className: "basis-full", children: /* @__PURE__ */ t(
204
- ue,
213
+ he,
205
214
  {
206
215
  conn: e.conn,
207
216
  name: e.name,
@@ -211,7 +220,7 @@ function ke({
211
220
  ) })
212
221
  ] });
213
222
  }
214
- function Ne({
223
+ function we({
215
224
  w: e,
216
225
  onUndo: i,
217
226
  undoing: r
@@ -219,7 +228,7 @@ function Ne({
219
228
  const { urlFor: l, open: d } = U(), u = e.collection && e.item ? { collection: e.collection, itemId: e.item } : null;
220
229
  return /* @__PURE__ */ a("li", { className: "flex flex-wrap items-center gap-x-3 gap-y-1 py-1.5", children: [
221
230
  /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: [
222
- ye[e.action] ?? e.action,
231
+ ke[e.action] ?? e.action,
223
232
  " ",
224
233
  u && e.action !== "delete" ? /* @__PURE__ */ a(
225
234
  "a",
@@ -258,12 +267,12 @@ function Ne({
258
267
  ) : /* @__PURE__ */ t("span", { className: "text-[11.5px] text-slate-500 dark:text-slate-400", children: e.reason })
259
268
  ] });
260
269
  }
261
- function we({
270
+ function Ce({
262
271
  call: e,
263
272
  onUndo: i,
264
273
  undoingId: r
265
274
  }) {
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;
275
+ const [l, d] = v(!1), { urlFor: u, open: p } = U(), h = ye[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
276
  return /* @__PURE__ */ a(se, { children: [
268
277
  /* @__PURE__ */ a(
269
278
  "tr",
@@ -340,7 +349,7 @@ function we({
340
349
  e.message
341
350
  ] }),
342
351
  e.writes.length > 0 && /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: e.writes.map((o) => /* @__PURE__ */ t(
343
- Ne,
352
+ we,
344
353
  {
345
354
  w: o,
346
355
  onUndo: () => i(o),
@@ -360,28 +369,28 @@ function we({
360
369
  ] })
361
370
  ] });
362
371
  }
363
- function Te({ className: e }) {
364
- var P, S, $, R, F, L;
372
+ function Ee({ className: e }) {
373
+ var P, S, $, F, R, L;
365
374
  const i = re(), r = V(), [l, d] = v(""), u = ne(null), [p, h] = v(null), m = Z({
366
375
  queryKey: T("mine"),
367
- queryFn: () => i.request(q("/mcp-connections/mine")).then((n) => n.data)
376
+ queryFn: () => i.request(I("/mcp-connections/mine")).then((n) => n.data)
368
377
  }), s = G({
369
378
  queryKey: ["nvr-mcp-activity", l],
370
379
  initialPageParam: null,
371
380
  queryFn: ({ pageParam: n }) => i.request(
372
- q(
381
+ I(
373
382
  "/mcp-connections/mine/activity",
374
383
  { ...l ? { conn: l } : {}, ...n ? { before: n } : {}, limit: 50 }
375
384
  )
376
385
  ).then((c) => c.data),
377
386
  getNextPageParam: (n) => n.next_before
378
- }), x = D({
387
+ }), x = A({
379
388
  mutationFn: (n) => i.request(oe(`/mcp-connections/mine/${n}`)),
380
389
  onSuccess: () => {
381
390
  h({ tone: "ok", text: "Disconnected. Its tokens stopped working at once." }), r.invalidateQueries({ queryKey: T("mine") });
382
391
  },
383
- onError: (n) => h({ tone: "bad", text: A(n, "Could not disconnect") })
384
- }), o = D({
392
+ onError: (n) => h({ tone: "bad", text: q(n, "Could not disconnect") })
393
+ }), o = A({
385
394
  mutationFn: (n) => i.request(le(`/mcp-connections/mine/activity/${n.activity_id}/undo`)),
386
395
  onSuccess: (n, c) => {
387
396
  h({
@@ -389,20 +398,20 @@ function Te({ className: e }) {
389
398
  text: c.action === "create" ? "Undone — the record was deleted." : "Undone — the previous values are back."
390
399
  }), r.invalidateQueries({ queryKey: ["nvr-mcp-activity"] });
391
400
  },
392
- onError: (n) => h({ tone: "bad", text: A(n, "Could not undo that change") })
393
- }), b = ((P = m.data) == null ? void 0 : P.connections) ?? [], f = I(() => {
401
+ onError: (n) => h({ tone: "bad", text: q(n, "Could not undo that change") })
402
+ }), b = ((P = m.data) == null ? void 0 : P.connections) ?? [], f = D(() => {
394
403
  var n;
395
404
  return ((n = s.data) == null ? void 0 : n.pages.flatMap((c) => c.calls)) ?? [];
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(
405
+ }, [s.data]), W = ((S = m.data) == null ? void 0 : S.logged) !== !1 && ((F = ($ = s.data) == null ? void 0 : $.pages[0]) == null ? void 0 : F.logged) !== !1, _ = D(
397
406
  () => [
398
407
  { value: "", label: "Every app" },
399
408
  ...b.filter((n) => {
400
409
  var c;
401
410
  return (((c = n.stats) == null ? void 0 : c.calls) ?? 0) > 0;
402
- }).map((n) => ({ value: n.conn, label: n.name }))
411
+ }).map((n) => ({ value: n.conn, label: n.display_name ?? n.name }))
403
412
  ],
404
413
  [b]
405
- ), N = (F = m.data) == null ? void 0 : F.settings;
414
+ ), N = (R = m.data) == null ? void 0 : R.settings;
406
415
  return /* @__PURE__ */ a("div", { className: y("flex flex-col gap-4", e), "data-nvr-agents": !0, children: [
407
416
  p && /* @__PURE__ */ a(
408
417
  "div",
@@ -437,7 +446,7 @@ function Te({ className: e }) {
437
446
  /* @__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." })
438
447
  ] }) : /* @__PURE__ */ a(E, { children: [
439
448
  /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: b.map((n) => /* @__PURE__ */ t(
440
- ke,
449
+ Ne,
441
450
  {
442
451
  c: n,
443
452
  onShowCalls: () => {
@@ -491,7 +500,7 @@ function Te({ className: e }) {
491
500
  /* @__PURE__ */ t("tbody", { children: f.map((n) => {
492
501
  var c;
493
502
  return /* @__PURE__ */ t(
494
- we,
503
+ Ce,
495
504
  {
496
505
  call: n,
497
506
  onUndo: (z) => o.mutate(z),
@@ -520,10 +529,10 @@ function Te({ className: e }) {
520
529
  ] });
521
530
  }
522
531
  export {
523
- Te as AgentsPanel,
524
- be as CallFigures,
525
- xe as CallsSparkline,
526
- ge as IdleNote,
527
- fe as KindPill,
532
+ Ee as AgentsPanel,
533
+ fe as CallFigures,
534
+ be as CallsSparkline,
535
+ ve as IdleNote,
536
+ ge as KindPill,
528
537
  T as mcpConnectionsKey
529
538
  };