zidane-ui 9.3.1 → 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 +2 -0
- package/dist/adapters/live.js +3 -0
- package/dist/adapters/server-git-host.js +5 -2
- package/dist/adapters/server-host.js +17 -11
- package/dist/adapters/server-machines-host.js +7 -0
- 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.js +15 -1
- package/dist/chat/SessionStreamsProvider.d.ts +1 -1
- package/dist/chat/Transcript.d.ts +3 -2
- package/dist/chat/Transcript.js +26 -7
- package/dist/chat/composer/ComposerEditor.js +1 -1
- 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/hosts.d.ts +4 -0
- package/dist/chat/headless/index.d.ts +25 -25
- package/dist/chat/headless/index.js +6 -6
- package/dist/chat/headless/markdown-scan.d.ts +0 -2
- package/dist/chat/headless/markdown-scan.js +3 -8
- package/dist/chat/headless/markdown-stream.js +3 -3
- package/dist/chat/headless/prompt-origin.d.ts +2 -0
- package/dist/chat/headless/prompt-origin.js +6 -2
- package/dist/chat/headless/sidebar/directory.d.ts +10 -1
- package/dist/chat/headless/sidebar/directory.js +9 -1
- 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 +9 -2
- package/dist/chat/headless/sidebar/labels.js +8 -1
- package/dist/chat/headless/streams/actions.d.ts +2 -2
- package/dist/chat/headless/streams/actions.js +1 -1
- package/dist/chat/headless/streams/event-bytes.d.ts +12 -1
- package/dist/chat/headless/streams/event-bytes.js +13 -1
- package/dist/chat/headless/streams/store.d.ts +21 -5
- package/dist/chat/headless/streams/store.js +36 -7
- package/dist/chat/headless/streams/transcript-map.js +2 -5
- package/dist/chat/headless/streams/types.d.ts +2 -1
- package/dist/chat/headless/transcript/collapse.js +3 -0
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/index.js +2 -2
- 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/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/transcript/FileChip.js +28 -0
- package/dist/chat/transcript/LazyRow.d.ts +1 -1
- package/dist/chat/transcript/LazyRow.js +3 -4
- 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/TranscriptRail.d.ts +1 -1
- package/dist/chat/transcript/chip-details.d.ts +11 -0
- package/dist/chat/transcript/chip-details.js +17 -1
- package/dist/chat/transcript/fold-worker.js +2 -1
- package/dist/chat/transcript/fold.js +11 -3
- package/dist/chat/transcript/index.d.ts +2 -2
- package/dist/chat/transcript/index.js +2 -2
- package/dist/chat/transcript/markdown-cache.d.ts +10 -1
- package/dist/chat/transcript/markdown-cache.js +37 -4
- package/dist/chat/transcript/markdown.js +27 -34
- package/dist/chat/transcript/media-gallery.js +13 -16
- package/dist/chat/transcript/messages.js +5 -4
- package/dist/chat/transcript/prompt.d.ts +1 -1
- package/dist/chat/transcript/row-mount.d.ts +27 -8
- package/dist/chat/transcript/row-mount.js +114 -80
- package/dist/chat/transcript/row-parking.d.ts +27 -0
- package/dist/chat/transcript/row-parking.js +37 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tool-parts.js +0 -1
- package/dist/chat/transcript/use-transcript-rows.d.ts +1 -1
- package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
- package/dist/chat/transcript/useHistoryBackfill.js +170 -0
- 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 +6 -6
- package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
- package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
- 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-C6-t1SS9.d.ts → index-BheVJOLc.d.ts} +1 -0
- 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/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/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/styles.css +32 -7
- 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/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 +17 -3
- /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
|
@@ -238,6 +238,12 @@ const SESSION_SURFACE_LABELS = {
|
|
|
238
238
|
lost: "Gone",
|
|
239
239
|
unreachable: "Not answering"
|
|
240
240
|
},
|
|
241
|
+
/** Work on a ready environment, in place of `placeTones.busy` ("Setting up"). */
|
|
242
|
+
placeWorking: {
|
|
243
|
+
pausing: "Pausing…",
|
|
244
|
+
deleting: "Deleting the sandbox…",
|
|
245
|
+
action: (label) => label ? `${label}…` : "Working…"
|
|
246
|
+
},
|
|
241
247
|
placeTip: (where, state) => `${where}: ${state}`,
|
|
242
248
|
placeResumes: "resumes on your next prompt",
|
|
243
249
|
/** After `placeTones.removed`: when the new sandbox comes. */
|
|
@@ -403,6 +409,56 @@ const STOP_REASON = {
|
|
|
403
409
|
};
|
|
404
410
|
/** The default English strings of the session panels. Override any of them through `SessionProvider`. */
|
|
405
411
|
const DEFAULT_SESSION_LABELS = {
|
|
412
|
+
/** At the right of a shared session's header: who else has it open. */
|
|
413
|
+
peopleHere: (names) => names.length === 1 ? `${names[0]} is here` : names.length === 2 ? `${names[0]} and ${names[1]} are here` : `${names.slice(0, -1).join(", ")} and ${names.at(-1)} are here`,
|
|
414
|
+
peopleMore: (count) => `+${count}`,
|
|
415
|
+
/** Under the composer of a shared session: who else is typing. */
|
|
416
|
+
typingOne: (name) => `${name} is typing…`,
|
|
417
|
+
typingTwo: (first, second) => `${first} and ${second} are typing…`,
|
|
418
|
+
typingMany: (count) => `${count} people are typing…`,
|
|
419
|
+
shareTitle: "Share this session",
|
|
420
|
+
shareNotify: "Notify me",
|
|
421
|
+
shareNotifyLevels: {
|
|
422
|
+
all: "Everything",
|
|
423
|
+
attention: "Only what needs me"
|
|
424
|
+
},
|
|
425
|
+
shareOwner: "owner",
|
|
426
|
+
shareGrants: {
|
|
427
|
+
read: "Read-only",
|
|
428
|
+
prompt: "Can prompt",
|
|
429
|
+
trusted: "Trusted"
|
|
430
|
+
},
|
|
431
|
+
shareInvite: "Invite",
|
|
432
|
+
shareInvitePlaceholder: "Someone in the organization",
|
|
433
|
+
shareRemove: "Remove",
|
|
434
|
+
shareOpen: "Anyone in the organization can join",
|
|
435
|
+
shareOpenGrant: "People who join get",
|
|
436
|
+
shareLeave: "Leave",
|
|
437
|
+
shareFrozen: "The owner is disabled. This session is read-only until an admin enables the owner or transfers the session.",
|
|
438
|
+
shareActsAsOwner: "Everyone here acts as the owner, with the owner's keys, tools and accounts.",
|
|
439
|
+
shareLoading: "Loading who shares it…",
|
|
440
|
+
shareFailed: "Changing who shares the session failed.",
|
|
441
|
+
shareLoadFailed: "Reading who shares the session failed.",
|
|
442
|
+
shareUsersFailed: "Reading the people you can invite failed.",
|
|
443
|
+
/** The grant picker of one member, for screen readers. */
|
|
444
|
+
shareGrantFor: (name) => `What ${name} can do`,
|
|
445
|
+
/** The grant picker next to Invite, for screen readers. */
|
|
446
|
+
shareInviteGrant: "What they can do",
|
|
447
|
+
shareRemoveConfirm: (name) => `Remove ${name}? They lose the session at once.`,
|
|
448
|
+
shareTransferConfirm: (name) => `Give this session to ${name}? It becomes theirs, and you stay as a trusted member.`,
|
|
449
|
+
shareConfirmCancel: "Keep",
|
|
450
|
+
shareDone: "Done",
|
|
451
|
+
shareTransfer: "Transfer to…",
|
|
452
|
+
openSessionsTitle: "Open sessions",
|
|
453
|
+
openSessionsNone: "Nobody opened a session to the organization yet.",
|
|
454
|
+
openSessionsLoading: "Loading the open sessions…",
|
|
455
|
+
openSessionsLoadFailed: "Reading the open sessions failed.",
|
|
456
|
+
openSessionsJoinFailed: "Joining the session failed.",
|
|
457
|
+
openSessionsJoin: "Join",
|
|
458
|
+
openSessionsOpen: "Open",
|
|
459
|
+
/** The people in an open session, its owner included. */
|
|
460
|
+
openSessionsMembers: (count) => `${count} ${count === 1 ? "person" : "people"}`,
|
|
461
|
+
shareTransferSubmit: "Transfer",
|
|
406
462
|
diffChangedFiles: "Changed files",
|
|
407
463
|
diffFindings: (errors, warnings) => `${errors} error${errors === 1 ? "" : "s"}, ${warnings} warning${warnings === 1 ? "" : "s"} from project tools`,
|
|
408
464
|
todoTally: {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who else has a session open (organization mode, docs/MULTIPLAYER.md), from the host's presence rows
|
|
3
|
+
* (`SessionPresence.people`). The server leaves each connection's own person out. Listens only while something
|
|
4
|
+
* watches.
|
|
5
|
+
*/
|
|
6
|
+
import { PresencePerson } from "zidane/ipc";
|
|
7
|
+
/** A presence row as a host or an app gives it: the session, and who has it open. */
|
|
8
|
+
export interface PresenceRow {
|
|
9
|
+
/** The session. */
|
|
10
|
+
sessionId: string;
|
|
11
|
+
/** Who has it open. */
|
|
12
|
+
people?: readonly PresencePerson[];
|
|
13
|
+
}
|
|
14
|
+
/** Who else has each session open, kept current. */
|
|
15
|
+
export interface SessionPeople {
|
|
16
|
+
/** Calls `listener` with who has `sessionId` open now, then on every change. Returns the unsubscribe. */
|
|
17
|
+
watch: (sessionId: string, listener: (people: readonly PresencePerson[]) => void) => () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A {@link SessionPeople} over a host's presence: its first list, then each full snapshot it sends.
|
|
21
|
+
*
|
|
22
|
+
* @param source - Reads the presence rows, and subscribes to each new snapshot (returns the unsubscribe).
|
|
23
|
+
* @param source.list - The current rows.
|
|
24
|
+
* @param source.onChanged - Each new snapshot.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createSessionPeople(source: {
|
|
27
|
+
list: () => Promise<readonly PresenceRow[]>;
|
|
28
|
+
onChanged: (listener: (rows: readonly PresenceRow[]) => void) => () => void;
|
|
29
|
+
}): SessionPeople;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// src/session/headless/people.ts
|
|
2
|
+
const NOBODY = [];
|
|
3
|
+
/** The same people, in the same order: no redraw. */
|
|
4
|
+
function samePeople(a, b) {
|
|
5
|
+
return a.length === b.length && a.every((person, i) => person.userId === b[i].userId && person.name === b[i].name && person.avatar === b[i].avatar);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A {@link SessionPeople} over a host's presence: its first list, then each full snapshot it sends.
|
|
9
|
+
*
|
|
10
|
+
* @param source - Reads the presence rows, and subscribes to each new snapshot (returns the unsubscribe).
|
|
11
|
+
* @param source.list - The current rows.
|
|
12
|
+
* @param source.onChanged - Each new snapshot.
|
|
13
|
+
*/
|
|
14
|
+
function createSessionPeople(source) {
|
|
15
|
+
let rows = /* @__PURE__ */ new Map();
|
|
16
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
17
|
+
let stop = null;
|
|
18
|
+
let snapshots = 0;
|
|
19
|
+
const apply = (next) => {
|
|
20
|
+
const before = rows;
|
|
21
|
+
rows = new Map(next.filter((row) => row.people?.length).map((row) => [row.sessionId, row.people]));
|
|
22
|
+
for (const [sessionId, set] of listeners) {
|
|
23
|
+
const now = rows.get(sessionId) ?? NOBODY;
|
|
24
|
+
if (samePeople(before.get(sessionId) ?? NOBODY, now)) continue;
|
|
25
|
+
for (const listener of set) listener(now);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return { watch(sessionId, listener) {
|
|
29
|
+
const set = listeners.get(sessionId) ?? /* @__PURE__ */ new Set();
|
|
30
|
+
listeners.set(sessionId, set);
|
|
31
|
+
set.add(listener);
|
|
32
|
+
if (!stop) {
|
|
33
|
+
stop = source.onChanged((next) => {
|
|
34
|
+
snapshots++;
|
|
35
|
+
apply(next);
|
|
36
|
+
});
|
|
37
|
+
const asked = snapshots;
|
|
38
|
+
source.list().then((next) => {
|
|
39
|
+
if (stop && snapshots === asked) apply(next);
|
|
40
|
+
}, () => {});
|
|
41
|
+
}
|
|
42
|
+
listener(rows.get(sessionId) ?? NOBODY);
|
|
43
|
+
return () => {
|
|
44
|
+
set.delete(listener);
|
|
45
|
+
if (set.size === 0) listeners.delete(sessionId);
|
|
46
|
+
if (listeners.size === 0 && stop) {
|
|
47
|
+
stop();
|
|
48
|
+
stop = null;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
} };
|
|
52
|
+
}
|
|
53
|
+
export { createSessionPeople };
|
|
@@ -37,6 +37,11 @@ export declare function isExternalEnvironment(environment: SessionEnvironmentSum
|
|
|
37
37
|
export declare function environmentStateLabel(labels: {
|
|
38
38
|
placeTones: Record<SessionPlaceTone, string>;
|
|
39
39
|
placeBroken: Record<'lost' | 'unreachable', string>;
|
|
40
|
+
placeWorking: {
|
|
41
|
+
pausing: string;
|
|
42
|
+
deleting: string;
|
|
43
|
+
action: (label?: string) => string;
|
|
44
|
+
};
|
|
40
45
|
}, environment: SessionEnvironmentSummary | undefined, tone: SessionPlaceTone): string;
|
|
41
46
|
/**
|
|
42
47
|
* One tone for where a session runs: a failure wins (unless the host is reconnecting to it, or it is a sandbox
|
|
@@ -28,7 +28,10 @@ function isExternalEnvironment(environment) {
|
|
|
28
28
|
* @param tone - Its tone (`sessionPlaceTone`).
|
|
29
29
|
*/
|
|
30
30
|
function environmentStateLabel(labels, environment, tone) {
|
|
31
|
-
|
|
31
|
+
if (tone === "failed" && environment?.failure) return labels.placeBroken[environment.failure];
|
|
32
|
+
const busy = tone === "busy" && environment?.state === "ready" ? environment.busy : void 0;
|
|
33
|
+
if (busy) return busy.what === "action" ? labels.placeWorking.action(busy.label) : labels.placeWorking[busy.what];
|
|
34
|
+
return labels.placeTones[tone];
|
|
32
35
|
}
|
|
33
36
|
const SERVER_DOWN = /* @__PURE__ */ new Set([
|
|
34
37
|
"offline",
|
|
@@ -50,6 +53,7 @@ function sessionPlaceTone(environment, server, now = Date.now()) {
|
|
|
50
53
|
if (!serverDown && environment?.state === "failed" && environment.removed) return "removed";
|
|
51
54
|
if (environment?.state === "failed" || server === null || server && SERVER_DOWN.has(server.status)) return "failed";
|
|
52
55
|
if (environment?.state === "provisioning" || server?.status === "connecting" || server?.status === "reconnecting") return "busy";
|
|
56
|
+
if (environment?.busy) return "busy";
|
|
53
57
|
if (environment?.resuming) return "resuming";
|
|
54
58
|
if (environment?.suspended) return "paused";
|
|
55
59
|
return "ready";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who else is typing in a session (organization mode, docs/MULTIPLAYER.md):
|
|
3
|
+
* kept from the server's `members:typing` signals. A name goes away when its
|
|
4
|
+
* person stops, or when nothing more is heard from them for
|
|
5
|
+
* {@link TYPING_EXPIRE_MS} (their window closed mid-word).
|
|
6
|
+
*/
|
|
7
|
+
/** Someone typing in a session. */
|
|
8
|
+
export interface TypingPerson {
|
|
9
|
+
/** Their user id. */
|
|
10
|
+
userId: string;
|
|
11
|
+
/** Their display name. */
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
/** A `members:typing` signal, with the session id as the host keys it. */
|
|
15
|
+
export interface TypingSignal {
|
|
16
|
+
/** The session, by its id on this host. */
|
|
17
|
+
sessionId: string;
|
|
18
|
+
/** Who types. */
|
|
19
|
+
userId: string;
|
|
20
|
+
/** Their display name. */
|
|
21
|
+
name: string;
|
|
22
|
+
/** True while they type; false when they stop. */
|
|
23
|
+
typing: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** The others typing in a session, kept current. */
|
|
26
|
+
export interface SessionTyping {
|
|
27
|
+
/** Calls `listener` with who is typing in `sessionId` now, then on every change. Returns the unsubscribe. */
|
|
28
|
+
watch: (sessionId: string, listener: (people: readonly TypingPerson[]) => void) => () => void;
|
|
29
|
+
}
|
|
30
|
+
/** A name not heard again for this long is dropped: the server repeats "typing" every 2 s while it lasts. */
|
|
31
|
+
export declare const TYPING_EXPIRE_MS = 6000;
|
|
32
|
+
/**
|
|
33
|
+
* A {@link SessionTyping} over a host's signals. Listens only while something watches.
|
|
34
|
+
*
|
|
35
|
+
* @param onSignal - Subscribes to the host's `members:typing` signals; returns the unsubscribe.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createSessionTyping(onSignal: (listener: (signal: TypingSignal) => void) => () => void): SessionTyping;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/session/headless/typing.ts
|
|
2
|
+
/** A name not heard again for this long is dropped: the server repeats "typing" every 2 s while it lasts. */
|
|
3
|
+
const TYPING_EXPIRE_MS = 6e3;
|
|
4
|
+
/**
|
|
5
|
+
* A {@link SessionTyping} over a host's signals. Listens only while something watches.
|
|
6
|
+
*
|
|
7
|
+
* @param onSignal - Subscribes to the host's `members:typing` signals; returns the unsubscribe.
|
|
8
|
+
*/
|
|
9
|
+
function createSessionTyping(onSignal) {
|
|
10
|
+
const typing = /* @__PURE__ */ new Map();
|
|
11
|
+
const listeners = /* @__PURE__ */ new Map();
|
|
12
|
+
let stop = null;
|
|
13
|
+
const people = (sessionId) => [...(typing.get(sessionId) ?? /* @__PURE__ */ new Map()).entries()].map(([userId, entry]) => ({
|
|
14
|
+
userId,
|
|
15
|
+
name: entry.name
|
|
16
|
+
}));
|
|
17
|
+
const tell = (sessionId) => {
|
|
18
|
+
const now = people(sessionId);
|
|
19
|
+
for (const listener of listeners.get(sessionId) ?? []) listener(now);
|
|
20
|
+
};
|
|
21
|
+
const drop = (sessionId, userId) => {
|
|
22
|
+
const inSession = typing.get(sessionId);
|
|
23
|
+
const entry = inSession?.get(userId);
|
|
24
|
+
if (!inSession || !entry) return;
|
|
25
|
+
clearTimeout(entry.timer);
|
|
26
|
+
inSession.delete(userId);
|
|
27
|
+
if (inSession.size === 0) typing.delete(sessionId);
|
|
28
|
+
tell(sessionId);
|
|
29
|
+
};
|
|
30
|
+
const heard = (signal) => {
|
|
31
|
+
if (!signal.typing) return drop(signal.sessionId, signal.userId);
|
|
32
|
+
const inSession = typing.get(signal.sessionId) ?? /* @__PURE__ */ new Map();
|
|
33
|
+
typing.set(signal.sessionId, inSession);
|
|
34
|
+
const had = inSession.get(signal.userId);
|
|
35
|
+
if (had) clearTimeout(had.timer);
|
|
36
|
+
inSession.set(signal.userId, {
|
|
37
|
+
name: signal.name,
|
|
38
|
+
timer: setTimeout(drop, TYPING_EXPIRE_MS, signal.sessionId, signal.userId)
|
|
39
|
+
});
|
|
40
|
+
if (!had || had.name !== signal.name) tell(signal.sessionId);
|
|
41
|
+
};
|
|
42
|
+
return { watch(sessionId, listener) {
|
|
43
|
+
const set = listeners.get(sessionId) ?? /* @__PURE__ */ new Set();
|
|
44
|
+
listeners.set(sessionId, set);
|
|
45
|
+
set.add(listener);
|
|
46
|
+
stop ??= onSignal(heard);
|
|
47
|
+
listener(people(sessionId));
|
|
48
|
+
return () => {
|
|
49
|
+
set.delete(listener);
|
|
50
|
+
if (set.size === 0) listeners.delete(sessionId);
|
|
51
|
+
if (listeners.size === 0 && stop) {
|
|
52
|
+
stop();
|
|
53
|
+
stop = null;
|
|
54
|
+
for (const inSession of typing.values()) for (const entry of inSession.values()) clearTimeout(entry.timer);
|
|
55
|
+
typing.clear();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
} };
|
|
59
|
+
}
|
|
60
|
+
export { TYPING_EXPIRE_MS, createSessionTyping };
|
package/dist/session/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, BADGE_
|
|
|
2
2
|
import { ArtifactOpenEvent, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews } from "./ArtifactsPanel.js";
|
|
3
3
|
import { DiffFileTree, DiffFileTreeProps, FindingCounts } from "./DiffFileTree.js";
|
|
4
4
|
import { renderSessionModalShell, renderWideSessionModalShell } from "./modal-shell.js";
|
|
5
|
+
import { OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, useOpenSessions } from "./OpenSessionsDialog.js";
|
|
5
6
|
import { AttentionActions, InboxAttention, InboxAttentionProps, PanelAttentionProps, QueueAttention, SecretsAttention, SecretsAttentionProps } from "./PanelAttention.js";
|
|
6
7
|
import { PlanTracker, PlanTrackerProps, RecentPlans, RecentPlansProps, planStateTone, useInboxPlans } from "./PlanTracker.js";
|
|
7
8
|
import { ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher } from "./ProjectHome.js";
|
|
@@ -13,15 +14,18 @@ import { SecretsPanel, SecretsPanelProps } from "./SecretsPanel.js";
|
|
|
13
14
|
import { SessionCacheFacts, SessionCacheFactsProps, useSessionCacheReport } from "./SessionCacheFacts.js";
|
|
14
15
|
import { SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation } from "./SessionDetailsDialog.js";
|
|
15
16
|
import { SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer } from "./SessionHeader.js";
|
|
17
|
+
import { SessionPeopleStack, SessionPeopleStackProps } from "./SessionPeopleStack.js";
|
|
16
18
|
import { SessionPlaceMenu, SessionPlaceMenuProps } from "./SessionPlaceMenu.js";
|
|
17
19
|
import { SessionProvider, SessionProviderProps, useAllSchedules, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
|
|
18
20
|
import { RenderSessionShell, SessionShell, SessionShellProps } from "./SessionShell.js";
|
|
21
|
+
import { ShareSessionDialog, ShareSessionDialogProps, useShareSession } from "./ShareSessionDialog.js";
|
|
19
22
|
import { SideChat, SideChatProps } from "./SideChat.js";
|
|
20
23
|
import { TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, isDoneTodo, todoGlyphTone } from "./TodoList.js";
|
|
21
24
|
import { TurnDetailsDialog, TurnDetailsDialogProps } from "./TurnDetailsDialog.js";
|
|
25
|
+
import { TypingLine, TypingLineProps } from "./TypingLine.js";
|
|
22
26
|
import { UsagePanel, UsagePanelProps } from "./UsagePanel.js";
|
|
23
27
|
import { useSessionActionError } from "./useSessionActionError.js";
|
|
24
28
|
import { useSessionLabels } from "./useSessionLabels.js";
|
|
25
29
|
import { UsageSummaryView, useUsageSummary } from "./useUsageSummary.js";
|
|
26
30
|
import { WelcomeScreen, WelcomeScreenProps } from "./WelcomeScreen.js";
|
|
27
|
-
export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, InboxAttention, InboxAttentionProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPlaceMenu, SessionPlaceMenuProps, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, UsagePanel, UsagePanelProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useUsageSummary };
|
|
31
|
+
export { ArtifactOpenEvent, ArtifactRowChips, ArtifactRowChipsFields, ArtifactRowChipsProps, ArtifactsPanel, ArtifactsPanelFocus, ArtifactsPanelProps, ArtifactsSavedViews, AttentionActions, BADGE_ICONS, DiffFacts, DiffFactsProps, DiffFileTree, DiffFileTreeProps, FindingCounts, InboxAttention, InboxAttentionProps, OpenSessionsButton, OpenSessionsButtonProps, OpenSessionsDialog, OpenSessionsDialogProps, PanelAttentionProps, PlanTracker, PlanTrackerProps, ProjectHome, ProjectHomeProject, ProjectHomeProps, ProjectHomeRepo, ProjectHomeStartResult, ProjectHomeSwitcher, ProviderUsage, ProviderUsageProvider, ProviderUsageProviderProps, QueueAttachmentRowProps, QueueAttachmentsSlot, QueueAttention, QueueTab, QueueTabProps, RecentPlans, RecentPlansProps, RemindersPanel, RemindersPanelProps, RemindersScope, type RenderSessionShell, RunningWorkDialog, RunningWorkDialogProps, SecretsAttention, SecretsAttentionProps, SecretsPanel, SecretsPanelProps, SessionCacheFacts, SessionCacheFactsProps, SessionDetailsDialog, SessionDetailsDialogProps, SessionDetailsFacts, SessionDetailsSpace, SessionDetailsStatus, SessionFolderLocation, SessionHeader, SessionHeaderOrigin, SessionHeaderProps, SessionHeaderServer, SessionPeopleStack, SessionPeopleStackProps, SessionPlaceMenu, SessionPlaceMenuProps, SessionProvider, SessionProviderProps, SessionShell, type SessionShellProps, ShareSessionDialog, ShareSessionDialogProps, SideChat, SideChatProps, TODO_ROW_CLASS, TodoListItem, TodoListView, TodoListViewProps, TodoTally, TodoTallyProps, TurnDetailsDialog, TurnDetailsDialogProps, TypingLine, TypingLineProps, UsagePanel, UsagePanelProps, UsageSummaryView, WelcomeScreen, WelcomeScreenProps, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useOpenSessions, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useShareSession, useUsageSummary };
|
package/dist/session/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { ArtifactRowChips, BADGE_ICONS, DiffFacts, badgeColorStyle, badgeToneCla
|
|
|
2
2
|
import { ArtifactsPanel } from "./ArtifactsPanel.js";
|
|
3
3
|
import { DiffFileTree } from "./DiffFileTree.js";
|
|
4
4
|
import { renderSessionModalShell, renderWideSessionModalShell } from "./modal-shell.js";
|
|
5
|
+
import { OpenSessionsButton, OpenSessionsDialog, useOpenSessions } from "./OpenSessionsDialog.js";
|
|
5
6
|
import { InboxAttention, QueueAttention, SecretsAttention } from "./PanelAttention.js";
|
|
6
7
|
import { PlanTracker, RecentPlans, planStateTone, useInboxPlans } from "./PlanTracker.js";
|
|
7
8
|
import { ProjectHome } from "./ProjectHome.js";
|
|
@@ -13,15 +14,18 @@ import { SecretsPanel } from "./SecretsPanel.js";
|
|
|
13
14
|
import { SessionCacheFacts, useSessionCacheReport } from "./SessionCacheFacts.js";
|
|
14
15
|
import { SessionDetailsDialog } from "./SessionDetailsDialog.js";
|
|
15
16
|
import { SessionHeader } from "./SessionHeader.js";
|
|
17
|
+
import { SessionPeopleStack } from "./SessionPeopleStack.js";
|
|
16
18
|
import { SessionPlaceMenu } from "./SessionPlaceMenu.js";
|
|
17
19
|
import { SessionProvider, useAllSchedules, useSchedulesStatus, useSessionArtifacts, useSessionHost, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets } from "./SessionProvider.js";
|
|
18
20
|
import { SessionShell } from "./SessionShell.js";
|
|
21
|
+
import { ShareSessionDialog, useShareSession } from "./ShareSessionDialog.js";
|
|
19
22
|
import { SideChat } from "./SideChat.js";
|
|
20
23
|
import { TODO_ROW_CLASS, TodoListView, TodoTally, isDoneTodo, todoGlyphTone } from "./TodoList.js";
|
|
21
24
|
import { TurnDetailsDialog } from "./TurnDetailsDialog.js";
|
|
25
|
+
import { TypingLine } from "./TypingLine.js";
|
|
22
26
|
import { UsagePanel } from "./UsagePanel.js";
|
|
23
27
|
import { useSessionActionError } from "./useSessionActionError.js";
|
|
24
28
|
import { useSessionLabels } from "./useSessionLabels.js";
|
|
25
29
|
import { useUsageSummary } from "./useUsageSummary.js";
|
|
26
30
|
import { WelcomeScreen } from "./WelcomeScreen.js";
|
|
27
|
-
export { ArtifactRowChips, ArtifactsPanel, BADGE_ICONS, DiffFacts, DiffFileTree, InboxAttention, PlanTracker, ProjectHome, ProviderUsageProvider, QueueAttention, QueueTab, RecentPlans, RemindersPanel, RunningWorkDialog, SecretsAttention, SecretsPanel, SessionCacheFacts, SessionDetailsDialog, SessionHeader, SessionPlaceMenu, SessionProvider, SessionShell, SideChat, TODO_ROW_CLASS, TodoListView, TodoTally, TurnDetailsDialog, UsagePanel, WelcomeScreen, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useUsageSummary };
|
|
31
|
+
export { ArtifactRowChips, ArtifactsPanel, BADGE_ICONS, DiffFacts, DiffFileTree, InboxAttention, OpenSessionsButton, OpenSessionsDialog, PlanTracker, ProjectHome, ProviderUsageProvider, QueueAttention, QueueTab, RecentPlans, RemindersPanel, RunningWorkDialog, SecretsAttention, SecretsPanel, SessionCacheFacts, SessionDetailsDialog, SessionHeader, SessionPeopleStack, SessionPlaceMenu, SessionProvider, SessionShell, ShareSessionDialog, SideChat, TODO_ROW_CLASS, TodoListView, TodoTally, TurnDetailsDialog, TypingLine, UsagePanel, WelcomeScreen, badgeColorStyle, badgeToneClass, hasArtifactRowChips, isDoneTodo, planStateTone, renderSessionModalShell, renderWideSessionModalShell, todoGlyphTone, useAllSchedules, useInboxPlans, useOpenSessions, useProviderUsage, useSchedulesStatus, useSessionActionError, useSessionArtifacts, useSessionCacheReport, useSessionHost, useSessionLabels, useSessionPlans, useSessionQueue, useSessionRunningWork, useSessionSchedules, useSessionSecrets, useShareSession, useUsageSummary };
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* best first, once each, and `groupSettingsResults` groups them by page
|
|
13
13
|
* and section.
|
|
14
14
|
*/
|
|
15
|
-
import { UO as Settings } from "../../dist/index-
|
|
15
|
+
import { UO as Settings } from "../../dist/index-BheVJOLc.js";
|
|
16
16
|
import { SettingsActionId, SettingsPage } from "./layout.js";
|
|
17
17
|
import { SettingsSearchEntry, SettingsSection } from "./registry.js";
|
|
18
18
|
import { SettingSurface } from "zidane/chat/pure";
|
|
@@ -270,8 +270,13 @@ export interface SettingsInstructionsHost {
|
|
|
270
270
|
}
|
|
271
271
|
/** Where new sessions run: the environment kinds and their settings. */
|
|
272
272
|
export interface SettingsEnvironmentsHost {
|
|
273
|
-
/**
|
|
274
|
-
|
|
273
|
+
/**
|
|
274
|
+
* Every kind, described for a new session in `cwd` (`''`: none). `machineOnly`:
|
|
275
|
+
* what the host can run whatever the folder (Manage reads which kinds it can list).
|
|
276
|
+
*/
|
|
277
|
+
list: (cwd: string, options?: {
|
|
278
|
+
machineOnly?: boolean;
|
|
279
|
+
}) => Promise<readonly EnvironmentDescriptor[]>;
|
|
275
280
|
/** Applies one edit (on, default, an option, a secret). Absent: read-only. */
|
|
276
281
|
update?: (change: EnvironmentSettingsChange) => Promise<void>;
|
|
277
282
|
/** Tests a kind's connection. Absent: no test button. */
|
|
@@ -15,11 +15,23 @@ export interface SettingsSectionState {
|
|
|
15
15
|
/** Opens a section, optionally landing on (and highlighting) the row with `data-setting-focus={focus}`. */
|
|
16
16
|
select: (id: string, focus?: string | null) => void;
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The shell's per-section value.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
19
23
|
export declare const SettingsSectionContext: import("react").Context<SettingsSectionState>;
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The header slot a kept-mounted section portals its actions into.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
21
29
|
export declare const SettingsActionsSlotContext: import("react").Context<HTMLElement | null>;
|
|
22
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The row a deep link or search pick landed on, and how to let go of it.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
23
35
|
export declare const SettingFocusContext: import("react").Context<{
|
|
24
36
|
focusKey: string | null;
|
|
25
37
|
clear: () => void;
|
package/dist/settings/section.js
CHANGED
|
@@ -2,15 +2,27 @@ import { createContext, useContext } from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
// src/settings/section.tsx
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* The shell's per-section value.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
6
10
|
const SettingsSectionContext = createContext({
|
|
7
11
|
id: "",
|
|
8
12
|
visible: true,
|
|
9
13
|
select: () => {}
|
|
10
14
|
});
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* The header slot a kept-mounted section portals its actions into.
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
12
20
|
const SettingsActionsSlotContext = createContext(null);
|
|
13
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The row a deep link or search pick landed on, and how to let go of it.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
14
26
|
const SettingFocusContext = createContext({
|
|
15
27
|
focusKey: null,
|
|
16
28
|
clear: () => {}
|
|
@@ -180,18 +180,42 @@ function ManageSandboxes({ kinds, onOpenSession }) {
|
|
|
180
180
|
remove,
|
|
181
181
|
shared
|
|
182
182
|
]);
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
const machine = useMachineAvailability(host?.list, kinds);
|
|
184
|
+
const shown = useMemo(() => kinds.map((d) => {
|
|
185
|
+
const reason = machine.get(d.kind);
|
|
186
|
+
return {
|
|
187
|
+
kind: d.kind,
|
|
188
|
+
label: d.label,
|
|
189
|
+
icon: environmentKindIcon(d.kind),
|
|
190
|
+
...reason ? { unavailable: reason } : {}
|
|
191
|
+
};
|
|
192
|
+
}), [kinds, machine]);
|
|
189
193
|
return /* @__PURE__ */ jsx(SandboxManager, {
|
|
190
194
|
kinds: shown,
|
|
191
195
|
source,
|
|
192
196
|
...onOpenSession ? { onOpenSession } : {}
|
|
193
197
|
});
|
|
194
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Why each of `kinds` can't run on this machine at all, by kind (absent: it can), from `list` with
|
|
201
|
+
* `machineOnly`. Until that answers, and when it fails, nothing is withheld: listing a kind that can't run
|
|
202
|
+
* shows its provider's own error.
|
|
203
|
+
*/
|
|
204
|
+
function useMachineAvailability(list, kinds) {
|
|
205
|
+
const [reasons, setReasons] = useState(() => /* @__PURE__ */ new Map());
|
|
206
|
+
const kindsKey = kinds.map((d) => d.kind).join("\0");
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
if (!list) return void 0;
|
|
209
|
+
let live = true;
|
|
210
|
+
list("", { machineOnly: true }).then((descriptors) => {
|
|
211
|
+
if (live) setReasons(new Map(descriptors.filter((d) => !d.available && d.reason).map((d) => [d.kind, d.reason])));
|
|
212
|
+
}, () => {});
|
|
213
|
+
return () => {
|
|
214
|
+
live = false;
|
|
215
|
+
};
|
|
216
|
+
}, [list, kindsKey]);
|
|
217
|
+
return reasons;
|
|
218
|
+
}
|
|
195
219
|
function EnvironmentCard({ descriptor, baseLabel, onUpdate }) {
|
|
196
220
|
const l = useEnvironmentsSectionLabels();
|
|
197
221
|
const shared = useCatalogSharedLabels();
|
|
@@ -36,6 +36,9 @@ export declare const DEFAULT_KEYBINDINGS_SECTION_LABELS: {
|
|
|
36
36
|
keybindingsSectionExportJson: string;
|
|
37
37
|
keybindingsSectionCopyId: string;
|
|
38
38
|
keybindingsSectionFavorite: string;
|
|
39
|
+
keybindingsSectionMove: string;
|
|
40
|
+
keybindingsSectionShare: string;
|
|
41
|
+
keybindingsSectionOpenSessions: string;
|
|
39
42
|
keybindingsSectionDelete: string;
|
|
40
43
|
keybindingsSectionPanels: string;
|
|
41
44
|
keybindingsSectionPanelNext: string;
|
|
@@ -37,6 +37,9 @@ const DEFAULT_KEYBINDINGS_SECTION_LABELS = {
|
|
|
37
37
|
keybindingsSectionExportJson: "Export as JSON",
|
|
38
38
|
keybindingsSectionCopyId: "Copy session id",
|
|
39
39
|
keybindingsSectionFavorite: "Add to or remove from favorites",
|
|
40
|
+
keybindingsSectionMove: "Move to another host, machine or sandbox",
|
|
41
|
+
keybindingsSectionShare: "Share with people of your organization",
|
|
42
|
+
keybindingsSectionOpenSessions: "Open sessions to join",
|
|
40
43
|
keybindingsSectionDelete: "Delete session",
|
|
41
44
|
keybindingsSectionPanels: "Panels and tabs",
|
|
42
45
|
keybindingsSectionPanelNext: "Next panel",
|
|
@@ -110,6 +110,18 @@ const KEYBINDING_SECTIONS = [
|
|
|
110
110
|
action: "sessionFavorite",
|
|
111
111
|
label: "keybindingsSectionFavorite"
|
|
112
112
|
},
|
|
113
|
+
{
|
|
114
|
+
action: "sessionMove",
|
|
115
|
+
label: "keybindingsSectionMove"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
action: "sessionShare",
|
|
119
|
+
label: "keybindingsSectionShare"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
action: "openSessions",
|
|
123
|
+
label: "keybindingsSectionOpenSessions"
|
|
124
|
+
},
|
|
113
125
|
{
|
|
114
126
|
action: "sessionDelete",
|
|
115
127
|
label: "keybindingsSectionDelete"
|
|
@@ -6,7 +6,7 @@ import { useSettingsHost, useSettingsLabels } from "../../SettingsProvider.js";
|
|
|
6
6
|
import { SettingsRestricted, useSettingsRestricted } from "../../SettingsRestricted.js";
|
|
7
7
|
import { useSectionLabels } from "../use-section-labels.js";
|
|
8
8
|
import { DEFAULT_LOGS_SECTION_LABELS } from "./labels.js";
|
|
9
|
-
import { useEffect, useMemo, useState } from "react";
|
|
9
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { LOG_LEVEL_CYCLE, filterLogRecords, formatLogLine } from "zidane/chat/pure";
|
|
12
12
|
// src/settings/sections/logs/LogsSection.tsx
|
|
@@ -128,16 +128,13 @@ function LogsSection({ className, style }) {
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
function LogList({ rows, follow }) {
|
|
131
|
-
const
|
|
131
|
+
const listRef = useRef(null);
|
|
132
132
|
useEffect(() => {
|
|
133
|
+
const el = listRef.current;
|
|
133
134
|
if (follow && el) el.scrollTop = el.scrollHeight;
|
|
134
|
-
}, [
|
|
135
|
-
rows,
|
|
136
|
-
follow,
|
|
137
|
-
el
|
|
138
|
-
]);
|
|
135
|
+
}, [rows, follow]);
|
|
139
136
|
return /* @__PURE__ */ jsx("pre", {
|
|
140
|
-
ref:
|
|
137
|
+
ref: listRef,
|
|
141
138
|
className: "zg-code-panel m-0 flex-1 min-h-0 overflow-auto py-2.5 text-xs leading-6 font-mono whitespace-pre",
|
|
142
139
|
children: rows.map((r, i) => /* @__PURE__ */ jsx("span", {
|
|
143
140
|
className: `block w-max min-w-full px-3 hover:bg-[var(--zg-row-hover)] ${LEVEL_CLS[r.level]}`,
|