zidane-ui 9.2.3 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/live.d.ts +8 -0
- package/dist/adapters/live.js +19 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +158 -27
- package/dist/adapters/server-machines-host.js +7 -0
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/adapters/server-session-host.js +49 -0
- package/dist/adapters/server-settings-sections.js +4 -1
- package/dist/adapters/sse-host.js +3 -0
- package/dist/adapters/sse-protocol.d.ts +10 -0
- package/dist/appearance/ZoomIndicator.js +5 -8
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +20 -1
- package/dist/chat/SessionStreamsProvider.d.ts +9 -1
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/Transcript.d.ts +21 -11
- package/dist/chat/Transcript.js +346 -161
- package/dist/chat/composer/ModelOptionsPicker.js +6 -2
- package/dist/chat/composer/ModelPicker.d.ts +1 -1
- package/dist/chat/composer/PlacePicker.d.ts +3 -1
- package/dist/chat/composer/PlacePicker.js +5 -1
- package/dist/chat/composer/use-draft-target.js +15 -3
- package/dist/chat/headless/block-runs.js +26 -1
- package/dist/chat/headless/chip-views.js +1 -1
- package/dist/chat/headless/draft-target.d.ts +28 -1
- package/dist/chat/headless/draft-target.js +22 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +27 -26
- package/dist/chat/headless/index.js +15 -14
- package/dist/chat/headless/labels.d.ts +17 -0
- package/dist/chat/headless/labels.js +17 -0
- package/dist/chat/headless/markdown-chunks.d.ts +2 -1
- package/dist/chat/headless/markdown-chunks.js +12 -20
- package/dist/chat/headless/markdown-scan.d.ts +64 -0
- package/dist/chat/headless/markdown-scan.js +119 -0
- package/dist/chat/headless/markdown-stream.d.ts +64 -0
- package/dist/chat/headless/markdown-stream.js +143 -0
- package/dist/chat/headless/output-pager.d.ts +68 -0
- package/dist/chat/headless/output-pager.js +113 -0
- package/dist/chat/headless/prompt-origin.d.ts +2 -0
- package/dist/chat/headless/prompt-origin.js +6 -2
- package/dist/chat/headless/session-list.d.ts +10 -0
- package/dist/chat/headless/sidebar/activity.d.ts +14 -0
- package/dist/chat/headless/sidebar/activity.js +32 -0
- package/dist/chat/headless/sidebar/directory.d.ts +19 -2
- package/dist/chat/headless/sidebar/directory.js +19 -51
- package/dist/chat/headless/sidebar/environment.d.ts +15 -4
- package/dist/chat/headless/sidebar/environment.js +27 -9
- package/dist/chat/headless/sidebar/index.d.ts +2 -2
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +19 -2
- package/dist/chat/headless/sidebar/labels.js +8 -1
- package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
- package/dist/chat/headless/sidebar/prewarm.js +114 -0
- package/dist/chat/headless/streams/actions.d.ts +4 -2
- package/dist/chat/headless/streams/actions.js +2 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +17 -0
- package/dist/chat/headless/streams/event-bytes.js +46 -0
- package/dist/chat/headless/streams/live-events.d.ts +25 -1
- package/dist/chat/headless/streams/live-events.js +53 -2
- package/dist/chat/headless/streams/selectors.d.ts +3 -0
- package/dist/chat/headless/streams/selectors.js +8 -1
- package/dist/chat/headless/streams/session-streams.d.ts +15 -3
- package/dist/chat/headless/streams/session-streams.js +31 -3
- package/dist/chat/headless/streams/store.d.ts +45 -6
- package/dist/chat/headless/streams/store.js +85 -31
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +85 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/batch.js +5 -1
- package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
- package/dist/chat/headless/transcript/blob-media.js +23 -0
- package/dist/chat/headless/transcript/collapse.d.ts +10 -0
- package/dist/chat/headless/transcript/collapse.js +35 -6
- package/dist/chat/headless/transcript/derive.d.ts +98 -0
- package/dist/chat/headless/transcript/derive.js +89 -0
- package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
- package/dist/chat/headless/transcript/exchange-media.js +8 -5
- package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
- package/dist/chat/headless/transcript/fold-attachments.js +3 -2
- package/dist/chat/headless/transcript/fold.d.ts +2 -1
- package/dist/chat/headless/transcript/fold.js +16 -6
- package/dist/chat/headless/transcript/incremental.d.ts +53 -0
- package/dist/chat/headless/transcript/incremental.js +181 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -2
- package/dist/chat/headless/transcript/index.js +2 -2
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +50 -1
- package/dist/chat/headless/transcript/rail.js +165 -23
- package/dist/chat/headless/transcript/rows.d.ts +5 -1
- package/dist/chat/headless/transcript/run-failures.js +2 -1
- package/dist/chat/headless/transcript/seams.d.ts +78 -0
- package/dist/chat/headless/transcript/seams.js +116 -0
- package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
- package/dist/chat/headless/transcript/tool-media.js +27 -9
- package/dist/chat/index.d.ts +9 -8
- package/dist/chat/index.js +18 -17
- package/dist/chat/sidebar/ProjectIcon.js +1 -1
- package/dist/chat/sidebar/RowChips.js +2 -2
- package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
- package/dist/chat/sidebar/SessionSidebar.js +23 -16
- package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
- package/dist/chat/sidebar/SidebarFold.js +17 -16
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
- package/dist/chat/sidebar/session-menu.d.ts +4 -0
- package/dist/chat/sidebar/session-menu.js +14 -2
- package/dist/chat/sidebar/sidebar-live.js +28 -4
- package/dist/chat/sidebar/useInboxRows.js +6 -6
- package/dist/chat/sidebar/useInboxTriage.js +50 -47
- package/dist/chat/sidebar/useSessionSearch.js +19 -18
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- package/dist/chat/transcript/DiffLines.d.ts +6 -1
- package/dist/chat/transcript/DiffLines.js +35 -20
- package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
- package/dist/chat/transcript/EditDiffBlock.js +89 -30
- package/dist/chat/transcript/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +100 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/PromptEcho.js +3 -11
- package/dist/chat/transcript/SessionChip.d.ts +11 -0
- package/dist/chat/transcript/SessionChip.js +34 -0
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
- package/dist/chat/transcript/TranscriptRail.js +175 -17
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +4 -3
- package/dist/chat/transcript/actions.d.ts +37 -1
- package/dist/chat/transcript/actions.js +27 -1
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -1
- package/dist/chat/transcript/clipped-output.d.ts +58 -0
- package/dist/chat/transcript/clipped-output.js +131 -0
- package/dist/chat/transcript/fold-attachments.js +10 -5
- package/dist/chat/transcript/fold-worker.js +5 -3
- package/dist/chat/transcript/fold.js +13 -4
- package/dist/chat/transcript/index.d.ts +11 -10
- package/dist/chat/transcript/index.js +10 -9
- package/dist/chat/transcript/markdown-cache.d.ts +17 -2
- package/dist/chat/transcript/markdown-cache.js +48 -4
- package/dist/chat/transcript/markdown.js +110 -55
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +19 -19
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/notices.js +2 -1
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +2 -1
- package/dist/chat/transcript/root-items.d.ts +96 -0
- package/dist/chat/transcript/root-items.js +180 -0
- package/dist/chat/transcript/row-mount.d.ts +184 -0
- package/dist/chat/transcript/row-mount.js +532 -0
- package/dist/chat/transcript/row-parking.d.ts +152 -0
- package/dist/chat/transcript/row-parking.js +171 -0
- package/dist/chat/transcript/row-ui-state.d.ts +37 -0
- package/dist/chat/transcript/row-ui-state.js +53 -0
- package/dist/chat/transcript/run-rows.js +3 -2
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tasks.js +3 -2
- package/dist/chat/transcript/tool-media.d.ts +4 -2
- package/dist/chat/transcript/tool-media.js +15 -7
- package/dist/chat/transcript/tool-parts.d.ts +27 -4
- package/dist/chat/transcript/tool-parts.js +31 -6
- package/dist/chat/transcript/tool-payload.js +26 -11
- package/dist/chat/transcript/tool-row.d.ts +2 -1
- package/dist/chat/transcript/tool-row.js +38 -19
- package/dist/chat/transcript/use-transcript-rows.d.ts +25 -8
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- package/dist/chat/transcript/useStickToBottom.js +2 -3
- package/dist/chat/transcript/useTranscriptFind.js +2 -4
- package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
- package/dist/chat/transcript/useTranscriptScroll.js +12 -1
- package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
- package/dist/chat/transcript/useTranscriptSearch.js +35 -19
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/code/editor/FileTree.d.ts +2 -0
- package/dist/code/editor/FileTree.js +1 -1
- package/dist/code/editor/FileView.js +16 -25
- package/dist/code/editor/find/useFind.js +17 -17
- package/dist/code/editor/useCodeDocument.js +22 -19
- package/dist/code/editor/useDetachCleanup.js +4 -3
- package/dist/code/use-highlighted-html.js +12 -13
- package/dist/components/IconButton.d.ts +3 -1
- package/dist/components/IconButton.js +7 -2
- package/dist/components/IconButtonTip.d.ts +3 -1
- package/dist/components/IconButtonTip.js +2 -1
- package/dist/components/RowActionsMenu.js +7 -14
- package/dist/components/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip.js +8 -6
- package/dist/components/assign-ref.d.ts +8 -0
- package/dist/components/assign-ref.js +12 -0
- package/dist/components/floating/FloatingSurface.js +2 -2
- package/dist/components/floating/HoverCard.js +32 -14
- package/dist/components/floating/Popover.js +4 -7
- package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
- package/dist/components/floating/useAnchoredPosition.js +7 -7
- package/dist/components/object-key.d.ts +7 -0
- package/dist/components/object-key.js +18 -0
- package/dist/components/palette/PaletteList.js +2 -7
- package/dist/components/tooltip-arming.d.ts +3 -0
- package/dist/components/tooltip-arming.js +8 -1
- package/dist/core.css +3 -3
- package/dist/dist/{index-E1Z0aPmi.d.ts → index-BheVJOLc.d.ts} +3 -1
- package/dist/dist/index.d.ts +2 -2
- package/dist/files/FilesTab.js +0 -1
- package/dist/files/TreeColumn.d.ts +2 -4
- package/dist/files/TreeColumn.js +0 -5
- package/dist/files/headless/host.d.ts +3 -7
- package/dist/files/headless/labels.d.ts +0 -1
- package/dist/files/headless/labels.js +0 -1
- package/dist/files/headless/workspace-diff.js +1 -1
- package/dist/files/useCodeReview.js +1 -3
- package/dist/files/useFilesDiagnostics.d.ts +1 -1
- package/dist/files/useFilesDiagnostics.js +4 -11
- package/dist/files/useOpenFiles.js +9 -12
- package/dist/files/useWorkspace.d.ts +5 -7
- package/dist/files/useWorkspace.js +4 -15
- package/dist/git/GitBar.js +5 -3
- package/dist/git/MoveSessionDialog.d.ts +18 -8
- package/dist/git/MoveSessionDialog.js +32 -53
- package/dist/git/MoveToDialog.d.ts +61 -0
- package/dist/git/MoveToDialog.js +240 -0
- package/dist/git/SandboxManager.js +9 -4
- package/dist/git/SyncChip.js +11 -4
- package/dist/git/TeleportSessionDialog.d.ts +69 -0
- package/dist/git/TeleportSessionDialog.js +440 -0
- package/dist/git/headless/host.d.ts +14 -0
- package/dist/git/headless/index.d.ts +2 -1
- package/dist/git/headless/index.js +2 -1
- package/dist/git/headless/labels.d.ts +44 -1
- package/dist/git/headless/labels.js +50 -0
- package/dist/git/headless/sandboxes.d.ts +1 -1
- package/dist/git/headless/sandboxes.js +4 -3
- package/dist/git/headless/teleport.d.ts +76 -0
- package/dist/git/headless/teleport.js +19 -0
- package/dist/git/index.d.ts +4 -2
- package/dist/git/index.js +4 -2
- package/dist/git/useEnvironmentChoices.d.ts +5 -2
- package/dist/git/useEnvironmentChoices.js +12 -4
- package/dist/hooks/useLatest.d.ts +8 -0
- package/dist/hooks/useLatest.js +17 -0
- package/dist/hooks/useMinuteTick.d.ts +6 -2
- package/dist/hooks/useMinuteTick.js +12 -6
- package/dist/hooks/useNearViewport.js +11 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -1
- package/dist/keybindings/KeybindingsProvider.js +3 -4
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +18 -0
- package/dist/machines/AddServerForm.js +55 -3
- package/dist/machines/Banners.d.ts +2 -2
- package/dist/machines/Banners.js +3 -3
- package/dist/machines/DaemonMenu.js +1 -3
- package/dist/machines/HostsSection.js +5 -1
- package/dist/machines/OrganizationPanel.d.ts +25 -0
- package/dist/machines/OrganizationPanel.js +266 -0
- package/dist/machines/PersonalLayerPanel.d.ts +32 -0
- package/dist/machines/PersonalLayerPanel.js +360 -0
- package/dist/machines/headless/fixture-host.d.ts +10 -0
- package/dist/machines/headless/fixture-host.js +44 -0
- package/dist/machines/headless/host.d.ts +21 -1
- package/dist/machines/headless/index.d.ts +3 -1
- package/dist/machines/headless/index.js +3 -1
- package/dist/machines/headless/labels.d.ts +55 -0
- package/dist/machines/headless/labels.js +58 -1
- package/dist/machines/headless/layer.d.ts +64 -0
- package/dist/machines/headless/layer.js +56 -0
- package/dist/machines/headless/organization.d.ts +38 -0
- package/dist/machines/headless/organization.js +44 -0
- package/dist/machines/index.d.ts +3 -1
- package/dist/machines/index.js +3 -1
- package/dist/machines/testing/contract.d.ts +25 -1
- package/dist/machines/testing/contract.js +97 -1
- package/dist/motion/grow.js +12 -13
- package/dist/motion/swap.js +2 -5
- package/dist/motion/use-flip-list.d.ts +14 -0
- package/dist/motion/use-flip-list.js +17 -12
- package/dist/palette/headless/app-sources.js +37 -0
- package/dist/palette/headless/labels.js +3 -0
- package/dist/server/sse-handler.js +25 -2
- package/dist/session/DiffFileTree.js +1 -4
- package/dist/session/OpenSessionsDialog.d.ts +46 -0
- package/dist/session/OpenSessionsDialog.js +170 -0
- package/dist/session/PlanTracker.js +1 -2
- package/dist/session/ProjectHome.js +10 -9
- package/dist/session/RemindersPanel.js +10 -12
- package/dist/session/SecretsPanel.js +2 -1
- package/dist/session/SessionHeader.js +1 -0
- package/dist/session/SessionPeopleStack.d.ts +23 -0
- package/dist/session/SessionPeopleStack.js +65 -0
- package/dist/session/SessionPlaceMenu.js +5 -4
- package/dist/session/ShareSessionDialog.d.ts +32 -0
- package/dist/session/ShareSessionDialog.js +342 -0
- package/dist/session/TypingLine.d.ts +22 -0
- package/dist/session/TypingLine.js +31 -0
- package/dist/session/headless/host.d.ts +40 -1
- package/dist/session/headless/index.d.ts +4 -2
- package/dist/session/headless/index.js +3 -1
- package/dist/session/headless/labels.d.ts +49 -0
- package/dist/session/headless/labels.js +56 -0
- package/dist/session/headless/people.d.ts +29 -0
- package/dist/session/headless/people.js +53 -0
- package/dist/session/headless/place.d.ts +5 -0
- package/dist/session/headless/place.js +5 -1
- package/dist/session/headless/typing.d.ts +37 -0
- package/dist/session/headless/typing.js +60 -0
- package/dist/session/index.d.ts +5 -1
- package/dist/session/index.js +5 -1
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/headless/sections-host.d.ts +7 -2
- package/dist/settings/section.d.ts +15 -3
- package/dist/settings/section.js +15 -3
- package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
- package/dist/settings/sections/keybindings/labels.d.ts +3 -0
- package/dist/settings/sections/keybindings/labels.js +3 -0
- package/dist/settings/sections/keybindings/rows.js +12 -0
- package/dist/settings/sections/logs/LogsSection.js +5 -8
- package/dist/settings/sections/performance/PerformanceSection.js +8 -1
- package/dist/settings/sections/performance/labels.d.ts +2 -0
- package/dist/settings/sections/performance/labels.js +2 -0
- package/dist/styles.css +65 -9
- package/dist/terminal/HostTerminalSurface.js +28 -30
- package/dist/terminal/TerminalPanel.js +4 -12
- package/dist/terminal/TerminalProvider.d.ts +10 -2
- package/dist/terminal/TerminalProvider.js +10 -2
- package/dist/terminal/headless/labels.d.ts +0 -1
- package/dist/terminal/headless/labels.js +1 -2
- package/dist/terminal/headless/store.js +5 -1
- package/dist/views/headless/answers.d.ts +8 -2
- package/dist/views/headless/answers.js +58 -1
- package/dist/views/headless/placement.d.ts +78 -0
- package/dist/views/headless/placement.js +154 -44
- package/dist/workspace/LayoutBudget.js +1 -7
- package/package.json +2 -2
- package/src/styles/chat.css +3 -1
- package/src/styles/palette.css +3 -3
- package/src/styles/transcript.css +50 -5
- /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
|
@@ -12,6 +12,8 @@ import { CapabilitiesView, CapabilityTags, useHostCapabilities } from "./HostCap
|
|
|
12
12
|
import { HostIcon } from "./HostIcon.js";
|
|
13
13
|
import { HostSyncPanel, useHostSync } from "./HostSyncPanel.js";
|
|
14
14
|
import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
15
|
+
import { OrganizationPanel } from "./OrganizationPanel.js";
|
|
16
|
+
import { PersonalLayerPanel } from "./PersonalLayerPanel.js";
|
|
15
17
|
import { ServerAddedCard } from "./ServerAddedCard.js";
|
|
16
18
|
import { ServerCard } from "./ServerCard.js";
|
|
17
19
|
import { ServerMachinesPanel } from "./ServerMachinesPanel.js";
|
|
@@ -305,7 +307,9 @@ function ServerDetail({ host, saved, onChanged, confirm, now, className = "", st
|
|
|
305
307
|
host,
|
|
306
308
|
confirm: ask,
|
|
307
309
|
...timed
|
|
308
|
-
})
|
|
310
|
+
}),
|
|
311
|
+
machinesHost.organization && /* @__PURE__ */ jsx(OrganizationPanel, { host }),
|
|
312
|
+
machinesHost.layer && /* @__PURE__ */ jsx(PersonalLayerPanel, { host })
|
|
309
313
|
]
|
|
310
314
|
});
|
|
311
315
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A server's People section (docs/IDENTITY.md): what organization mode is when the server does not sign its users in,
|
|
3
|
+
* with the command that turns it on; once it does, who you are there and whether people can share sessions. An admin
|
|
4
|
+
* also manages the people: Add person, then per person Make admin or Make user, Disable or Enable, and Remove (their
|
|
5
|
+
* sessions come to the admin, their tokens stop at once). Disable and Remove ask first.
|
|
6
|
+
*
|
|
7
|
+
* Needs the host's `organization`; nothing while the server is not connected.
|
|
8
|
+
*/
|
|
9
|
+
import { HostSummary } from "./headless/host.js";
|
|
10
|
+
import { CSSProperties } from "react";
|
|
11
|
+
/** Props for {@link OrganizationPanel}. */
|
|
12
|
+
export interface OrganizationPanelProps {
|
|
13
|
+
/** The server. */
|
|
14
|
+
host: HostSummary;
|
|
15
|
+
/** Extra classes on the root. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** Inline styles on the root. */
|
|
18
|
+
style?: CSSProperties;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Renders the server's People section, or nothing without the host's `organization` or a connection.
|
|
22
|
+
*
|
|
23
|
+
* @param props - The {@link OrganizationPanelProps}.
|
|
24
|
+
*/
|
|
25
|
+
export declare function OrganizationPanel(props: OrganizationPanelProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { BTN_PRIMARY, BTN_SECONDARY, buttonClass } from "../components/button.js";
|
|
2
|
+
import { CopyValue } from "../components/CopyValue.js";
|
|
3
|
+
import { Checkbox, ErrorNote, FormSection, INPUT_CLASS, MetaChip, RowText } from "../components/Form.js";
|
|
4
|
+
import { RowMenuButton } from "../components/RowMenuButton.js";
|
|
5
|
+
import { machinesError } from "./headless/host.js";
|
|
6
|
+
import { HostIcon } from "./HostIcon.js";
|
|
7
|
+
import { useMachinesConfirm, useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
|
|
8
|
+
import { useCallback, useEffect, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
// src/machines/OrganizationPanel.tsx
|
|
11
|
+
/** The command that starts a server in organization mode. */
|
|
12
|
+
const TURN_ON = "zidane server --organization";
|
|
13
|
+
/**
|
|
14
|
+
* Renders the server's People section, or nothing without the host's `organization` or a connection.
|
|
15
|
+
*
|
|
16
|
+
* @param props - The {@link OrganizationPanelProps}.
|
|
17
|
+
*/
|
|
18
|
+
function OrganizationPanel(props) {
|
|
19
|
+
const organization = useMachinesHost().organization;
|
|
20
|
+
if (!organization || props.host.status !== "connected") return null;
|
|
21
|
+
return /* @__PURE__ */ jsx(PeopleBody, {
|
|
22
|
+
...props,
|
|
23
|
+
organization
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function PeopleBody({ host, organization, className = "", style }) {
|
|
27
|
+
const labels = useMachinesLabels();
|
|
28
|
+
const ask = useMachinesConfirm();
|
|
29
|
+
const [status, setStatus] = useState(null);
|
|
30
|
+
const [people, setPeople] = useState([]);
|
|
31
|
+
const [error, setError] = useState(null);
|
|
32
|
+
const [note, setNote] = useState(null);
|
|
33
|
+
const [adding, setAdding] = useState(false);
|
|
34
|
+
const [busy, setBusy] = useState(false);
|
|
35
|
+
const read = useCallback(async () => {
|
|
36
|
+
try {
|
|
37
|
+
const next = await organization.status(host.id);
|
|
38
|
+
setStatus(next);
|
|
39
|
+
setPeople(next.mode === "on" && next.role === "admin" ? await organization.users(host.id) : []);
|
|
40
|
+
} catch (err) {
|
|
41
|
+
setError(labels.machinesError(machinesError("people", err)));
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
organization,
|
|
45
|
+
host.id,
|
|
46
|
+
labels
|
|
47
|
+
]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
read();
|
|
50
|
+
}, [read]);
|
|
51
|
+
const act = async (action) => {
|
|
52
|
+
setBusy(true);
|
|
53
|
+
setError(null);
|
|
54
|
+
setNote(null);
|
|
55
|
+
try {
|
|
56
|
+
const said = await action();
|
|
57
|
+
if (said) setNote(said);
|
|
58
|
+
} catch (err) {
|
|
59
|
+
setError(labels.machinesError(machinesError("people", err)));
|
|
60
|
+
} finally {
|
|
61
|
+
setBusy(false);
|
|
62
|
+
read();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
if (!status) return error ? /* @__PURE__ */ jsx(ErrorNote, {
|
|
66
|
+
className,
|
|
67
|
+
style,
|
|
68
|
+
children: error
|
|
69
|
+
}) : null;
|
|
70
|
+
if (status.mode === "off") return /* @__PURE__ */ jsx(FormSection, {
|
|
71
|
+
title: labels.machinesPeopleTitle,
|
|
72
|
+
className,
|
|
73
|
+
style,
|
|
74
|
+
"data-testid": `people-${host.id}`,
|
|
75
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
76
|
+
className: "px-3 py-2 space-y-2",
|
|
77
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
78
|
+
className: "m-0 text-xs text-[var(--zg-text-muted)]",
|
|
79
|
+
children: labels.machinesPeopleOff
|
|
80
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
className: "flex items-center gap-2 text-xs text-[var(--zg-text-muted)]",
|
|
82
|
+
children: [/* @__PURE__ */ jsx("span", { children: labels.machinesPeopleTurnOn }), /* @__PURE__ */ jsx(CopyValue, {
|
|
83
|
+
text: TURN_ON,
|
|
84
|
+
label: TURN_ON,
|
|
85
|
+
copiedLabel: labels.machinesCopiedText(TURN_ON)
|
|
86
|
+
})]
|
|
87
|
+
})]
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
const admin = status.role === "admin";
|
|
91
|
+
const items = (person) => [
|
|
92
|
+
person.role === "admin" ? {
|
|
93
|
+
id: "user",
|
|
94
|
+
label: labels.machinesPeopleMakeUser,
|
|
95
|
+
icon: "i-ph-user",
|
|
96
|
+
onSelect: () => void act(() => organization.setRole(host.id, person.userId, "user"))
|
|
97
|
+
} : {
|
|
98
|
+
id: "admin",
|
|
99
|
+
label: labels.machinesPeopleMakeAdmin,
|
|
100
|
+
icon: "i-ph-shield-check",
|
|
101
|
+
onSelect: () => void act(() => organization.setRole(host.id, person.userId, "admin"))
|
|
102
|
+
},
|
|
103
|
+
person.disabled ? {
|
|
104
|
+
id: "enable",
|
|
105
|
+
label: labels.machinesPeopleEnable,
|
|
106
|
+
icon: "i-ph-play",
|
|
107
|
+
onSelect: () => void act(() => organization.setDisabled(host.id, person.userId, false))
|
|
108
|
+
} : {
|
|
109
|
+
id: "disable",
|
|
110
|
+
label: labels.machinesPeopleDisable,
|
|
111
|
+
icon: "i-ph-prohibit",
|
|
112
|
+
onSelect: () => void ask({
|
|
113
|
+
title: labels.machinesPeopleDisableTitle(person.email),
|
|
114
|
+
message: labels.machinesPeopleDisableMessage,
|
|
115
|
+
confirmLabel: labels.machinesPeopleDisable,
|
|
116
|
+
destructive: true
|
|
117
|
+
}).then((ok) => {
|
|
118
|
+
if (ok) act(() => organization.setDisabled(host.id, person.userId, true));
|
|
119
|
+
})
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: "remove",
|
|
123
|
+
label: labels.machinesRemove,
|
|
124
|
+
icon: "i-ph-trash",
|
|
125
|
+
destructive: true,
|
|
126
|
+
onSelect: () => void ask({
|
|
127
|
+
title: labels.machinesPeopleRemoveTitle(person.email),
|
|
128
|
+
message: labels.machinesPeopleRemoveMessage,
|
|
129
|
+
confirmLabel: labels.machinesRemove,
|
|
130
|
+
destructive: true
|
|
131
|
+
}).then((ok) => {
|
|
132
|
+
if (ok) act(async () => labels.machinesPeopleRemoved(await organization.removeUser(host.id, person.userId)));
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
return /* @__PURE__ */ jsxs(FormSection, {
|
|
137
|
+
title: labels.machinesPeopleTitle,
|
|
138
|
+
className,
|
|
139
|
+
style,
|
|
140
|
+
"data-testid": `people-${host.id}`,
|
|
141
|
+
...admin && !adding ? { trailing: /* @__PURE__ */ jsx("button", {
|
|
142
|
+
type: "button",
|
|
143
|
+
className: BTN_SECONDARY,
|
|
144
|
+
onClick: () => setAdding(true),
|
|
145
|
+
children: labels.machinesPeopleAdd
|
|
146
|
+
}) } : {},
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ jsxs("div", {
|
|
149
|
+
className: "px-3 py-2 space-y-0.5 text-xs text-[var(--zg-text-muted)]",
|
|
150
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
151
|
+
className: "m-0",
|
|
152
|
+
children: labels.machinesPeopleYou(status.email, status.role)
|
|
153
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
154
|
+
className: "m-0",
|
|
155
|
+
"data-testid": "people-sharing",
|
|
156
|
+
children: status.sharing ? labels.machinesPeopleSharingOn : labels.machinesPeopleSharingOff
|
|
157
|
+
})]
|
|
158
|
+
}),
|
|
159
|
+
adding && /* @__PURE__ */ jsx(AddPerson, {
|
|
160
|
+
busy,
|
|
161
|
+
onCancel: () => setAdding(false),
|
|
162
|
+
onAdd: (input) => void act(async () => {
|
|
163
|
+
await organization.addUser(host.id, input);
|
|
164
|
+
setAdding(false);
|
|
165
|
+
})
|
|
166
|
+
}),
|
|
167
|
+
admin && /* @__PURE__ */ jsx("div", {
|
|
168
|
+
role: "list",
|
|
169
|
+
"aria-label": labels.machinesPeopleTitle,
|
|
170
|
+
className: "contents",
|
|
171
|
+
children: people.map((person) => /* @__PURE__ */ jsxs("div", {
|
|
172
|
+
role: "listitem",
|
|
173
|
+
className: "flex items-center gap-3 px-3 py-2",
|
|
174
|
+
"data-testid": `person-${person.email}`,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ jsx(HostIcon, { icon: person.role === "admin" ? "i-ph-shield-check" : "i-ph-user" }),
|
|
177
|
+
/* @__PURE__ */ jsx(RowText, { label: person.name ? `${person.name} (${person.email})` : person.email }),
|
|
178
|
+
/* @__PURE__ */ jsxs("span", {
|
|
179
|
+
className: "flex items-center gap-1 shrink-0",
|
|
180
|
+
children: [
|
|
181
|
+
person.role === "admin" && /* @__PURE__ */ jsx(MetaChip, { children: labels.machinesPeopleAdmin }),
|
|
182
|
+
person.disabled && /* @__PURE__ */ jsx(MetaChip, {
|
|
183
|
+
tone: "warn",
|
|
184
|
+
children: labels.machinesPeopleDisabled
|
|
185
|
+
}),
|
|
186
|
+
person.email === status.email && /* @__PURE__ */ jsx(MetaChip, { children: labels.machinesPeopleYouChip })
|
|
187
|
+
]
|
|
188
|
+
}),
|
|
189
|
+
person.email !== status.email && /* @__PURE__ */ jsx(RowMenuButton, {
|
|
190
|
+
label: labels.machinesPeopleRowActions(person.email),
|
|
191
|
+
items: items(person)
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
}, person.userId))
|
|
195
|
+
}),
|
|
196
|
+
note && /* @__PURE__ */ jsx("p", {
|
|
197
|
+
role: "status",
|
|
198
|
+
className: "m-0 px-3 pb-2 text-xs text-[var(--zg-text-muted)]",
|
|
199
|
+
children: note
|
|
200
|
+
}),
|
|
201
|
+
error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
202
|
+
className: "mx-3",
|
|
203
|
+
children: error
|
|
204
|
+
})
|
|
205
|
+
]
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/** Add person: an email, and whether they are an admin. */
|
|
209
|
+
function AddPerson({ busy, onAdd, onCancel }) {
|
|
210
|
+
const labels = useMachinesLabels();
|
|
211
|
+
const [email, setEmail] = useState("");
|
|
212
|
+
const [admin, setAdmin] = useState(false);
|
|
213
|
+
return /* @__PURE__ */ jsxs("form", {
|
|
214
|
+
className: "px-3 py-2 space-y-2",
|
|
215
|
+
onSubmit: (event) => {
|
|
216
|
+
event.preventDefault();
|
|
217
|
+
if (email.trim()) onAdd({
|
|
218
|
+
email: email.trim(),
|
|
219
|
+
role: admin ? "admin" : "user"
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
223
|
+
"aria-label": labels.machinesPeopleEmail,
|
|
224
|
+
placeholder: labels.machinesPeopleEmail,
|
|
225
|
+
type: "email",
|
|
226
|
+
autoComplete: "off",
|
|
227
|
+
autoFocus: true,
|
|
228
|
+
className: `${INPUT_CLASS} w-full`,
|
|
229
|
+
value: email,
|
|
230
|
+
onChange: (event) => setEmail(event.target.value),
|
|
231
|
+
onKeyDown: (event) => {
|
|
232
|
+
if (event.key === "Escape") {
|
|
233
|
+
event.stopPropagation();
|
|
234
|
+
onCancel();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
238
|
+
className: "flex items-center justify-between gap-2",
|
|
239
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
240
|
+
type: "button",
|
|
241
|
+
role: "checkbox",
|
|
242
|
+
"aria-checked": admin,
|
|
243
|
+
onClick: () => setAdmin((on) => !on),
|
|
244
|
+
className: "flex items-center gap-2 bg-transparent border-0 p-0 text-xs text-[var(--zg-text)] cursor-pointer",
|
|
245
|
+
children: [/* @__PURE__ */ jsx(Checkbox, { checked: admin }), /* @__PURE__ */ jsx("span", { children: labels.machinesPeopleAdmin })]
|
|
246
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
247
|
+
className: "flex gap-2",
|
|
248
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
className: buttonClass({
|
|
251
|
+
variant: "ghost",
|
|
252
|
+
size: "sm"
|
|
253
|
+
}),
|
|
254
|
+
onClick: onCancel,
|
|
255
|
+
children: labels.machinesCancel
|
|
256
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
257
|
+
type: "submit",
|
|
258
|
+
className: BTN_PRIMARY,
|
|
259
|
+
disabled: busy || !email.trim(),
|
|
260
|
+
children: labels.machinesPeopleAdd
|
|
261
|
+
})]
|
|
262
|
+
})]
|
|
263
|
+
})]
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
export { OrganizationPanel };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Yours on this server": what the signed-in user keeps for themselves on a
|
|
3
|
+
* server in organization mode (docs/IDENTITY.md, Per-user layers). Sessions
|
|
4
|
+
* they own there use it on top of the server's.
|
|
5
|
+
*
|
|
6
|
+
* - **API keys**: the providers they hold a key for (never the key), Add key,
|
|
7
|
+
* Remove in the ⋯ menu.
|
|
8
|
+
* - **MCP servers**: their servers reached over HTTP, Add server, Sign in
|
|
9
|
+
* (theirs alone, through the host's `signIn`), Sign out, Remove.
|
|
10
|
+
* - **Skills**: their skills, Add skill, Edit and Remove.
|
|
11
|
+
* - **SYSTEM.md**: theirs instead of the server's, Save and Remove.
|
|
12
|
+
*
|
|
13
|
+
* Needs the host's `layer`; nothing when the server does not sign its users in.
|
|
14
|
+
*/
|
|
15
|
+
import { HostSummary } from "./headless/host.js";
|
|
16
|
+
import { CSSProperties } from "react";
|
|
17
|
+
/** Props for {@link PersonalLayerPanel}. */
|
|
18
|
+
export interface PersonalLayerPanelProps {
|
|
19
|
+
/** The server whose layer to show. */
|
|
20
|
+
host: HostSummary;
|
|
21
|
+
/** Extra classes on the root. */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Inline styles on the root. */
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Renders the signed-in user's keys, MCP servers, skills and SYSTEM.md on a server. Nothing without the host's
|
|
28
|
+
* `layer`, or when the server does not sign its users in.
|
|
29
|
+
*
|
|
30
|
+
* @param props - The server, `className` and `style`.
|
|
31
|
+
*/
|
|
32
|
+
export declare function PersonalLayerPanel(props: PersonalLayerPanelProps): import("react").JSX.Element | null;
|