zidane-ui 9.1.13 → 9.1.14
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/index.d.ts +2 -2
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/live.d.ts +29 -3
- package/dist/adapters/live.js +9 -1
- package/dist/adapters/server-composer-host.js +17 -2
- package/dist/adapters/server-extensions-host.d.ts +0 -1
- package/dist/adapters/server-extensions-host.js +5 -16
- package/dist/adapters/server-git-host.js +7 -16
- package/dist/adapters/server-host.js +181 -43
- package/dist/adapters/server-machines-host.d.ts +2 -0
- package/dist/adapters/server-machines-host.js +24 -25
- package/dist/adapters/server-onboarding-host.d.ts +1 -1
- package/dist/adapters/server-onboarding-host.js +3 -4
- package/dist/adapters/server-session-host.js +22 -3
- package/dist/adapters/server-settings-accounts.js +2 -2
- package/dist/adapters/server-settings-host.js +3 -3
- package/dist/adapters/server-settings-performance.js +7 -9
- package/dist/adapters/server-settings-sections.js +13 -14
- package/dist/adapters/server-sidebar-host.js +2 -2
- package/dist/adapters/sse-host.js +68 -3
- package/dist/adapters/sse-protocol.d.ts +12 -2
- package/dist/adapters/sse-protocol.js +4 -2
- package/dist/app/AppHostProvider.js +4 -3
- package/dist/app/ModalProvider.d.ts +13 -3
- package/dist/app/ModalProvider.js +103 -24
- package/dist/app/NoticeStack.d.ts +33 -0
- package/dist/app/NoticeStack.js +90 -0
- package/dist/app/index.d.ts +3 -2
- package/dist/app/index.js +3 -2
- package/dist/appearance/AppearanceProvider.js +2 -2
- package/dist/appearance/headless/index.js +1 -1
- package/dist/approvals/headless/index.js +2 -2
- package/dist/chat/SessionFilterMenu.d.ts +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -1
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/Composer.js +9 -6
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +1 -1
- package/dist/chat/composer/ModelChainList.js +17 -8
- package/dist/chat/composer/ModelChainTooltip.js +5 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-draft-target.d.ts +20 -1
- package/dist/chat/composer/use-draft-target.js +122 -6
- package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
- package/dist/chat/composer/use-new-session-defaults.js +17 -4
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/composer/use-send-prompt.js +1 -1
- package/dist/chat/headless/chip-labels.d.ts +1 -0
- package/dist/chat/headless/chip-labels.js +1 -0
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/draft-target.d.ts +21 -1
- package/dist/chat/headless/fixture-host.js +17 -2
- package/dist/chat/headless/host.d.ts +3 -3
- package/dist/chat/headless/index.d.ts +9 -9
- package/dist/chat/headless/index.js +15 -15
- package/dist/chat/headless/labels.d.ts +13 -4
- package/dist/chat/headless/labels.js +8 -5
- package/dist/chat/headless/session-list.d.ts +20 -6
- package/dist/chat/headless/session-list.js +1 -0
- package/dist/chat/headless/sidebar/directory.d.ts +56 -14
- package/dist/chat/headless/sidebar/directory.js +149 -70
- package/dist/chat/headless/sidebar/index.d.ts +3 -3
- package/dist/chat/headless/sidebar/index.js +3 -3
- package/dist/chat/headless/sidebar/labels.d.ts +15 -6
- package/dist/chat/headless/sidebar/types.d.ts +3 -1
- package/dist/chat/headless/sidebar/view.d.ts +13 -5
- package/dist/chat/headless/sidebar/view.js +31 -11
- package/dist/chat/headless/streams/actions.d.ts +5 -3
- package/dist/chat/headless/streams/actions.js +3 -2
- package/dist/chat/headless/streams/index.d.ts +3 -3
- package/dist/chat/headless/streams/merge.d.ts +6 -10
- package/dist/chat/headless/streams/merge.js +7 -21
- package/dist/chat/headless/streams/session-streams.d.ts +29 -4
- package/dist/chat/headless/streams/session-streams.js +86 -0
- package/dist/chat/headless/streams/store.d.ts +162 -16
- package/dist/chat/headless/streams/store.js +334 -38
- package/dist/chat/headless/streams/types.d.ts +10 -7
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/interactions/PlanCard.js +10 -3
- package/dist/chat/interactions/QuestionForm.js +7 -3
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +9 -7
- package/dist/chat/sidebar/SessionSidebar.js +5 -5
- package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
- package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
- package/dist/chat/sidebar/SidebarFrame.js +27 -9
- package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
- package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
- package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
- package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.js +4 -4
- package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
- package/dist/chat/testing/contract.js +2 -2
- package/dist/chat/transcript/AuthFailureCard.js +11 -8
- package/dist/chat/transcript/BadgeMenu.js +13 -2
- package/dist/chat/transcript/MermaidDiagram.js +7 -3
- package/dist/chat/transcript/fold.d.ts +4 -0
- package/dist/chat/transcript/fold.js +53 -22
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +8 -4
- package/dist/chat/transcript/useStickToBottom.js +12 -0
- package/dist/components/BrowserSignIn.js +23 -21
- package/dist/components/Form.d.ts +6 -4
- package/dist/components/Form.js +16 -8
- package/dist/components/LoadError.d.ts +4 -2
- package/dist/components/LoadError.js +13 -9
- package/dist/components/Notice.d.ts +29 -0
- package/dist/components/Notice.js +63 -0
- package/dist/components/PanelEmpty.d.ts +1 -1
- package/dist/components/PanelEmpty.js +4 -2
- package/dist/components/Restricted.d.ts +1 -1
- package/dist/components/palette/PaletteList.js +8 -1
- package/dist/components/palette/PalettePanel.js +14 -6
- package/dist/core.css +24 -5
- package/dist/dist/{index-Bq87OcGy.d.ts → index-C6rzc-tt.d.ts} +28 -3
- package/dist/dist/index.d.ts +2 -2
- package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cz9dRF8Q.d.ts} +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +2 -5
- package/dist/extensions/ExtensionSettingsSection.js +5 -4
- package/dist/extensions/ExtensionSettingsSidebar.js +3 -7
- package/dist/extensions/SettingsWireForm.d.ts +1 -7
- package/dist/extensions/SettingsWireForm.js +7 -5
- package/dist/extensions/headless/fixture-host.d.ts +1 -5
- package/dist/extensions/headless/fixture-host.js +2 -5
- package/dist/extensions/headless/host.d.ts +1 -11
- package/dist/extensions/headless/index.d.ts +3 -3
- package/dist/extensions/headless/index.js +6 -6
- package/dist/extensions/headless/select.d.ts +1 -11
- package/dist/extensions/headless/select.js +1 -18
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/EditorColumn.js +13 -2
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/TreeColumn.js +13 -20
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +3 -1
- package/dist/git/BranchMenu.js +6 -4
- package/dist/git/ImportRepoDialog.js +18 -9
- package/dist/git/MoveSessionDialog.js +16 -8
- package/dist/git/RemoteFolderPicker.js +35 -17
- package/dist/git/SyncChip.js +17 -17
- package/dist/git/WherePicker.d.ts +16 -1
- package/dist/git/WherePicker.js +81 -37
- package/dist/git/headless/environment.d.ts +33 -3
- package/dist/git/headless/environment.js +33 -5
- package/dist/git/headless/index.d.ts +2 -2
- package/dist/git/headless/index.js +2 -2
- package/dist/git/headless/labels.d.ts +15 -2
- package/dist/git/headless/labels.js +17 -4
- package/dist/git/useEnvironmentChoices.d.ts +3 -1
- package/dist/git/useEnvironmentChoices.js +7 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/labels.d.ts +5 -0
- package/dist/labels.js +5 -0
- package/dist/machines/AddMachineDialog.d.ts +34 -0
- package/dist/machines/AddMachineDialog.js +464 -0
- package/dist/machines/Banners.d.ts +33 -4
- package/dist/machines/Banners.js +64 -3
- package/dist/machines/DaemonMenu.js +27 -4
- package/dist/machines/HostCapabilities.d.ts +1 -3
- package/dist/machines/HostCapabilities.js +24 -45
- package/dist/machines/HostSyncPanel.js +124 -130
- package/dist/machines/HostsSection.d.ts +4 -1
- package/dist/machines/HostsSection.js +30 -7
- package/dist/machines/MachinesExplainer.d.ts +17 -0
- package/dist/machines/MachinesExplainer.js +71 -0
- package/dist/machines/MachinesProvider.d.ts +14 -2
- package/dist/machines/MachinesProvider.js +35 -1
- package/dist/machines/ServerAddedCard.d.ts +31 -0
- package/dist/machines/ServerAddedCard.js +72 -0
- package/dist/machines/ServerCard.js +91 -215
- package/dist/machines/ServerMachinesPanel.d.ts +2 -2
- package/dist/machines/ServerMachinesPanel.js +184 -323
- package/dist/machines/ServerUpdatePanel.js +51 -40
- package/dist/machines/ShareThisComputerForm.d.ts +19 -0
- package/dist/machines/ShareThisComputerForm.js +133 -0
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/TokensPanel.d.ts +5 -3
- package/dist/machines/TokensPanel.js +98 -78
- package/dist/machines/headless/fixture-host.d.ts +19 -3
- package/dist/machines/headless/fixture-host.js +43 -6
- package/dist/machines/headless/fixtures.js +4 -6
- package/dist/machines/headless/host.d.ts +40 -19
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +3 -3
- package/dist/machines/headless/labels.d.ts +63 -20
- package/dist/machines/headless/labels.js +88 -25
- package/dist/machines/headless/messages.js +8 -0
- package/dist/machines/headless/stores.d.ts +9 -2
- package/dist/machines/headless/stores.js +28 -1
- package/dist/machines/index.d.ts +7 -3
- package/dist/machines/index.js +8 -4
- package/dist/machines/testing/contract.d.ts +15 -3
- package/dist/machines/testing/contract.js +68 -14
- package/dist/motion/grow.d.ts +8 -1
- package/dist/motion/grow.js +10 -4
- package/dist/onboarding/headless/labels.d.ts +13 -0
- package/dist/onboarding/headless/labels.js +8 -0
- package/dist/onboarding/sources/SourceBrowser.js +11 -7
- package/dist/onboarding/steps/ImportStep.js +4 -1
- package/dist/onboarding/steps/ReadyStep.js +9 -2
- package/dist/onboarding/steps/connect/KeyForm.js +6 -2
- package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
- package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
- package/dist/onboarding/steps/tasks.js +17 -14
- package/dist/palette/app-sources.js +1 -1
- package/dist/server/sse-handler.js +141 -19
- package/dist/session/ArtifactsPanel.js +40 -18
- package/dist/session/PlanTracker.js +13 -8
- package/dist/session/ProjectHome.js +13 -11
- package/dist/session/RemindersPanel.js +35 -17
- package/dist/session/RunningWorkDialog.js +6 -2
- package/dist/session/SecretsPanel.js +29 -10
- package/dist/session/SessionDetailsDialog.d.ts +1 -1
- package/dist/session/SessionDetailsDialog.js +18 -10
- package/dist/session/SideChat.js +10 -7
- package/dist/session/TurnDetailsDialog.js +19 -5
- package/dist/session/UsagePanel.js +10 -4
- package/dist/session/headless/host.d.ts +2 -0
- package/dist/session/headless/index.js +2 -2
- package/dist/session/headless/labels.d.ts +19 -1
- package/dist/session/headless/labels.js +15 -1
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/reminder-labels.d.ts +4 -0
- package/dist/session/headless/reminder-labels.js +4 -0
- package/dist/settings/SettingsRestricted.d.ts +1 -1
- package/dist/settings/SettingsRestricted.js +4 -4
- package/dist/settings/SettingsShell.d.ts +7 -0
- package/dist/settings/SettingsShell.js +6 -1
- package/dist/settings/headless/fixture-performance.d.ts +1 -1
- package/dist/settings/headless/host.d.ts +2 -2
- package/dist/settings/headless/index.js +1 -1
- package/dist/settings/headless/labels.d.ts +3 -3
- package/dist/settings/headless/labels.js +3 -3
- package/dist/settings/headless/performance.d.ts +3 -4
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/sections/appearance/AppearanceSection.js +2 -2
- package/dist/settings/sections/claude-import/ClaudeImportDialog.js +1 -1
- package/dist/settings/sections/editor/EditorSection.js +8 -5
- package/dist/settings/sections/editor/labels.d.ts +1 -0
- package/dist/settings/sections/editor/labels.js +1 -0
- package/dist/settings/sections/environments/EnvironmentsSection.js +21 -14
- package/dist/settings/sections/environments/labels.d.ts +1 -0
- package/dist/settings/sections/environments/labels.js +2 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
- package/dist/settings/sections/extensions/options-labels.js +2 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/index.d.ts +2 -1
- package/dist/settings/sections/index.js +2 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
- package/dist/settings/sections/logs/LogsSection.js +2 -2
- package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
- package/dist/settings/sections/mcp/McpSection.js +13 -7
- package/dist/settings/sections/mcp/McpServerRow.js +21 -14
- package/dist/settings/sections/mcp/labels.d.ts +8 -2
- package/dist/settings/sections/mcp/labels.js +8 -2
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
- package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
- package/dist/settings/sections/models/labels.d.ts +7 -0
- package/dist/settings/sections/models/labels.js +7 -0
- package/dist/settings/sections/models/model-test.js +7 -4
- package/dist/settings/sections/performance/PerformanceSection.js +16 -6
- package/dist/settings/sections/performance/labels.d.ts +1 -1
- package/dist/settings/sections/performance/labels.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +15 -8
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +12 -6
- package/dist/settings/sections/providers/labels.d.ts +2 -2
- package/dist/settings/sections/providers/labels.js +2 -2
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/settings/testing/performance.contract.js +8 -12
- package/dist/styles.css +32 -3
- package/dist/terminal/HostTerminalSurface.js +17 -7
- package/dist/terminal/TerminalPanel.js +30 -17
- package/dist/terminal/TerminalSurface.js +11 -4
- package/dist/terminal/headless/labels.d.ts +5 -0
- package/dist/terminal/headless/labels.js +5 -0
- package/dist/terminal/headless/store.d.ts +1 -1
- package/dist/terminal/headless/store.js +6 -3
- package/dist/workspace/LayoutBudget.d.ts +5 -1
- package/dist/workspace/LayoutBudget.js +14 -1
- package/dist/workspace/PanelContentView.d.ts +1 -1
- package/dist/workspace/PanelContentView.js +17 -6
- package/dist/workspace/WorkspaceProvider.js +4 -3
- package/dist/workspace/extension-tabs.js +1 -1
- package/dist/workspace/headless/index.js +1 -1
- package/dist/workspace/headless/labels.d.ts +1 -0
- package/dist/workspace/headless/labels.js +1 -0
- package/package.json +3 -3
- package/src/styles/motion.css +8 -0
- package/src/styles/primitives.css +7 -0
|
@@ -50,6 +50,14 @@ function daemonStatusText(status, now = Date.now(), labels = DEFAULT_MACHINES_LA
|
|
|
50
50
|
title: labels.machinesDaemonNewer,
|
|
51
51
|
detail: labels.machinesDaemonNewerDetail(versions)
|
|
52
52
|
};
|
|
53
|
+
if (status.refused?.direction === "daemon-older" && status.refused.startsOlder) return {
|
|
54
|
+
title: labels.machinesDaemonCliOlder,
|
|
55
|
+
detail: labels.machinesDaemonCliOlderDetail(versions)
|
|
56
|
+
};
|
|
57
|
+
if (status.refused?.direction === "daemon-older" && status.refused.busy) return {
|
|
58
|
+
title: labels.machinesDaemonOlderBusy,
|
|
59
|
+
detail: labels.machinesDaemonOlderBusyDetail(versions)
|
|
60
|
+
};
|
|
53
61
|
if (status.refused?.direction === "daemon-older") return {
|
|
54
62
|
title: labels.machinesDaemonOlder,
|
|
55
63
|
detail: labels.machinesDaemonOlderDetail(versions)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Readable } from "../../chat/headless/store.js";
|
|
2
|
-
import { MachineList } from "./host.js";
|
|
2
|
+
import { MachineList, MachineListState } from "./host.js";
|
|
3
3
|
import { MachineInfo } from "zidane/chat/pure";
|
|
4
4
|
//#region src/machines/headless/stores.d.ts
|
|
5
5
|
/** A store and how to set it, for {@link lazyReadable}'s `start`. */
|
|
@@ -32,6 +32,13 @@ declare function lazyReadable<T>(initial: T, start: (sink: LazySink<T>) => () =>
|
|
|
32
32
|
* @param listen - Calls back with the server id whenever one of its machines changed status; returns how to stop.
|
|
33
33
|
*/
|
|
34
34
|
declare function createMachineLists(load: (hostId: string) => Promise<readonly MachineInfo[]>, listen: (onChange: (hostId: string) => void) => () => void): (hostId: string) => MachineList;
|
|
35
|
+
/**
|
|
36
|
+
* Several servers' machine lists as one store: each server's machines by its id, the same map until one list
|
|
37
|
+
* changes. A list that is still loading or failed counts as no machines.
|
|
38
|
+
*
|
|
39
|
+
* @param lists - Each server's id and its list state ({@link createMachineLists}' `state`).
|
|
40
|
+
*/
|
|
41
|
+
declare function machinesByHost(lists: readonly (readonly [string, Readable<MachineListState>])[]): Readable<ReadonlyMap<string, readonly MachineInfo[]>>;
|
|
35
42
|
/**
|
|
36
43
|
* The names of the machines last heard online, from status pushes. It keeps listening once read, so a
|
|
37
44
|
* machine that comes back while nothing shows the list still counts.
|
|
@@ -43,4 +50,4 @@ declare function createOnlineMachines(listen: (onChange: (change: {
|
|
|
43
50
|
status: 'online' | 'offline';
|
|
44
51
|
}) => void) => () => void): Readable<ReadonlySet<string>>;
|
|
45
52
|
//#endregion
|
|
46
|
-
export { LazyReadableOptions, LazySink, createMachineLists, createOnlineMachines, lazyReadable };
|
|
53
|
+
export { LazyReadableOptions, LazySink, createMachineLists, createOnlineMachines, lazyReadable, machinesByHost };
|
|
@@ -96,6 +96,33 @@ function createMachineLists(load, listen) {
|
|
|
96
96
|
return list;
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
+
const NO_MACHINES = /* @__PURE__ */ new Map();
|
|
100
|
+
/**
|
|
101
|
+
* Several servers' machine lists as one store: each server's machines by its id, the same map until one list
|
|
102
|
+
* changes. A list that is still loading or failed counts as no machines.
|
|
103
|
+
*
|
|
104
|
+
* @param lists - Each server's id and its list state ({@link createMachineLists}' `state`).
|
|
105
|
+
*/
|
|
106
|
+
function machinesByHost(lists) {
|
|
107
|
+
let parts = null;
|
|
108
|
+
let map = NO_MACHINES;
|
|
109
|
+
return {
|
|
110
|
+
get() {
|
|
111
|
+
const next = lists.map(([, state]) => state.get());
|
|
112
|
+
if (parts === null || next.some((part, i) => part !== parts[i])) {
|
|
113
|
+
parts = next;
|
|
114
|
+
map = new Map(lists.map(([hostId], i) => [hostId, next[i].machines]));
|
|
115
|
+
}
|
|
116
|
+
return map;
|
|
117
|
+
},
|
|
118
|
+
subscribe(onChange) {
|
|
119
|
+
const offs = lists.map(([, state]) => state.subscribe(onChange));
|
|
120
|
+
return () => {
|
|
121
|
+
for (const off of offs) off();
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
99
126
|
/**
|
|
100
127
|
* The names of the machines last heard online, from status pushes. It keeps listening once read, so a
|
|
101
128
|
* machine that comes back while nothing shows the list still counts.
|
|
@@ -111,4 +138,4 @@ function createOnlineMachines(listen) {
|
|
|
111
138
|
}), { keepAlive: true });
|
|
112
139
|
}
|
|
113
140
|
//#endregion
|
|
114
|
-
export { createMachineLists, createOnlineMachines, lazyReadable };
|
|
141
|
+
export { createMachineLists, createOnlineMachines, lazyReadable, machinesByHost };
|
package/dist/machines/index.d.ts
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
import { AddMachineDialog, AddMachineDialogProps, AddMachineTab, OpenAddMachine, useAddMachine } from "./AddMachineDialog.js";
|
|
1
2
|
import { AddServerForm, AddServerFormProps } from "./AddServerForm.js";
|
|
2
|
-
import { ComposerNotice, ComposerNoticeProps, HostRemovedBanner, HostRemovedBannerProps, MachineWaitingBanner, MachineWaitingBannerProps, ServerOfflineBanner, ServerOfflineBannerProps } from "./Banners.js";
|
|
3
|
-
import { MachinesConfirm, MachinesProvider, MachinesProviderProps, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useSessionPresence } from "./MachinesProvider.js";
|
|
3
|
+
import { ComposerNotice, ComposerNoticeProps, DraftPlaceNotice, DraftPlaceNoticeProps, HostRemovedBanner, HostRemovedBannerProps, MachineWaitingBanner, MachineWaitingBannerProps, ServerOfflineBanner, ServerOfflineBannerProps } from "./Banners.js";
|
|
4
|
+
import { MachinesConfirm, MachinesProvider, MachinesProviderProps, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useSessionPresence } from "./MachinesProvider.js";
|
|
4
5
|
import { DaemonMenu, DaemonMenuProps } from "./DaemonMenu.js";
|
|
5
6
|
import { CapabilitiesView, CapabilitiesViewProps, CapabilityTags, CapabilityTagsProps, HostCapabilitiesState, useHostCapabilities } from "./HostCapabilities.js";
|
|
6
7
|
import { HostSignIn, HostSignInProps } from "./HostSignIn.js";
|
|
7
8
|
import { HostSyncPanel, HostSyncPanelProps, useHostSync } from "./HostSyncPanel.js";
|
|
9
|
+
import { NewChatsServer, ServerAddedCard, ServerAddedCardProps } from "./ServerAddedCard.js";
|
|
8
10
|
import { HostsSection, HostsSectionProps } from "./HostsSection.js";
|
|
11
|
+
import { MachinesExplainer, MachinesExplainerProps } from "./MachinesExplainer.js";
|
|
9
12
|
import { CopyText, CopyTextProps, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, ServerCard, ServerCardProps, escapeCancels } from "./ServerCard.js";
|
|
10
13
|
import { ServerMachinesPanel, ServerMachinesPanelProps } from "./ServerMachinesPanel.js";
|
|
11
14
|
import { ServerUpdatePanel, ServerUpdatePanelProps } from "./ServerUpdatePanel.js";
|
|
15
|
+
import { ShareThisComputerForm, ShareThisComputerFormProps } from "./ShareThisComputerForm.js";
|
|
12
16
|
import { SyncAccounts, SyncAccountsProps } from "./SyncAccounts.js";
|
|
13
17
|
import { SyncMarker, SyncMarkerProps, useServerSyncStatus } from "./SyncMarker.js";
|
|
14
18
|
import { SyncOutcomeBadge, SyncOutcomeBadgeProps } from "./SyncOutcomeBadge.js";
|
|
15
19
|
import { TokensPanel, TokensPanelProps } from "./TokensPanel.js";
|
|
16
20
|
import { hostsSettingsSection } from "./settings-section.js";
|
|
17
|
-
export { AddServerForm, AddServerFormProps, CapabilitiesView, CapabilitiesViewProps, CapabilityTags, CapabilityTagsProps, ComposerNotice, ComposerNoticeProps, CopyText, CopyTextProps, DaemonMenu, DaemonMenuProps, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostCapabilitiesState, HostRemovedBanner, HostRemovedBannerProps, HostSignIn, HostSignInProps, HostSyncPanel, HostSyncPanelProps, HostsSection, HostsSectionProps, MachineWaitingBanner, MachineWaitingBannerProps, MachinesConfirm, MachinesProvider, MachinesProviderProps, ServerCard, ServerCardProps, ServerMachinesPanel, ServerMachinesPanelProps, ServerOfflineBanner, ServerOfflineBannerProps, ServerUpdatePanel, ServerUpdatePanelProps, SyncAccounts, SyncAccountsProps, SyncMarker, SyncMarkerProps, SyncOutcomeBadge, SyncOutcomeBadgeProps, TokensPanel, TokensPanelProps, escapeCancels, hostsSettingsSection, useHostCapabilities, useHostSync, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerSyncStatus, useSessionPresence };
|
|
21
|
+
export { AddMachineDialog, AddMachineDialogProps, AddMachineTab, AddServerForm, AddServerFormProps, CapabilitiesView, CapabilitiesViewProps, CapabilityTags, CapabilityTagsProps, ComposerNotice, ComposerNoticeProps, CopyText, CopyTextProps, DaemonMenu, DaemonMenuProps, DraftPlaceNotice, DraftPlaceNoticeProps, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostCapabilitiesState, HostRemovedBanner, HostRemovedBannerProps, HostSignIn, HostSignInProps, HostSyncPanel, HostSyncPanelProps, HostsSection, HostsSectionProps, MachineWaitingBanner, MachineWaitingBannerProps, MachinesConfirm, MachinesExplainer, MachinesExplainerProps, MachinesProvider, MachinesProviderProps, NewChatsServer, OpenAddMachine, ServerAddedCard, ServerAddedCardProps, ServerCard, ServerCardProps, ServerMachinesPanel, ServerMachinesPanelProps, ServerOfflineBanner, ServerOfflineBannerProps, ServerUpdatePanel, ServerUpdatePanelProps, ShareThisComputerForm, ShareThisComputerFormProps, SyncAccounts, SyncAccountsProps, SyncMarker, SyncMarkerProps, SyncOutcomeBadge, SyncOutcomeBadgeProps, TokensPanel, TokensPanelProps, escapeCancels, hostsSettingsSection, useAddMachine, useHostCapabilities, useHostSync, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useServerSyncStatus, useSessionPresence };
|
package/dist/machines/index.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { MachinesProvider, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useSessionPresence } from "./MachinesProvider.js";
|
|
1
|
+
import { MachinesProvider, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useSessionPresence } from "./MachinesProvider.js";
|
|
2
|
+
import { ShareThisComputerForm } from "./ShareThisComputerForm.js";
|
|
3
|
+
import { AddMachineDialog, useAddMachine } from "./AddMachineDialog.js";
|
|
2
4
|
import { CopyText, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, ServerCard, escapeCancels } from "./ServerCard.js";
|
|
3
5
|
import { AddServerForm } from "./AddServerForm.js";
|
|
4
|
-
import { ComposerNotice, HostRemovedBanner, MachineWaitingBanner, ServerOfflineBanner } from "./Banners.js";
|
|
6
|
+
import { ComposerNotice, DraftPlaceNotice, HostRemovedBanner, MachineWaitingBanner, ServerOfflineBanner } from "./Banners.js";
|
|
5
7
|
import { DaemonMenu } from "./DaemonMenu.js";
|
|
6
8
|
import { CapabilitiesView, CapabilityTags, useHostCapabilities } from "./HostCapabilities.js";
|
|
7
9
|
import { HostSignIn } from "./HostSignIn.js";
|
|
8
10
|
import { SyncAccounts } from "./SyncAccounts.js";
|
|
9
11
|
import { SyncOutcomeBadge } from "./SyncOutcomeBadge.js";
|
|
10
12
|
import { HostSyncPanel, useHostSync } from "./HostSyncPanel.js";
|
|
13
|
+
import { MachinesExplainer } from "./MachinesExplainer.js";
|
|
14
|
+
import { ServerAddedCard } from "./ServerAddedCard.js";
|
|
11
15
|
import { ServerMachinesPanel } from "./ServerMachinesPanel.js";
|
|
12
16
|
import { ServerUpdatePanel } from "./ServerUpdatePanel.js";
|
|
17
|
+
import { TokensPanel } from "./TokensPanel.js";
|
|
13
18
|
import { HostsSection } from "./HostsSection.js";
|
|
14
19
|
import { SyncMarker, useServerSyncStatus } from "./SyncMarker.js";
|
|
15
|
-
import { TokensPanel } from "./TokensPanel.js";
|
|
16
20
|
import { hostsSettingsSection } from "./settings-section.js";
|
|
17
|
-
export { AddServerForm, CapabilitiesView, CapabilityTags, ComposerNotice, CopyText, DaemonMenu, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostRemovedBanner, HostSignIn, HostSyncPanel, HostsSection, MachineWaitingBanner, MachinesProvider, ServerCard, ServerMachinesPanel, ServerOfflineBanner, ServerUpdatePanel, SyncAccounts, SyncMarker, SyncOutcomeBadge, TokensPanel, escapeCancels, hostsSettingsSection, useHostCapabilities, useHostSync, useLentServers, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerSyncStatus, useSessionPresence };
|
|
21
|
+
export { AddMachineDialog, AddServerForm, CapabilitiesView, CapabilityTags, ComposerNotice, CopyText, DaemonMenu, DraftPlaceNotice, HOST_CARD_ICON_CLASS, HOST_NAME_MAX, HOST_TOKEN_MAX, HOST_URL_MAX, HostRemovedBanner, HostSignIn, HostSyncPanel, HostsSection, MachineWaitingBanner, MachinesExplainer, MachinesProvider, ServerAddedCard, ServerCard, ServerMachinesPanel, ServerOfflineBanner, ServerUpdatePanel, ShareThisComputerForm, SyncAccounts, SyncMarker, SyncOutcomeBadge, TokensPanel, escapeCancels, hostsSettingsSection, useAddMachine, useHostCapabilities, useHostSync, useLentServers, useMachinesBridge, useMachinesConfirm, useMachinesHost, useMachinesLabels, useOnlineMachines, usePermitted, usePresenceMap, useServerMachines, useServerSyncStatus, useSessionPresence };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SessionPresence } from "../headless/presence.js";
|
|
2
|
-
import { DaemonStatus, HostCheckResult, MachineInfo as MachineInfo$1, MachineLinksStatus as MachineLinksStatus$1, MachinesHost, ServerToken,
|
|
2
|
+
import { DaemonStatus, HostCheckResult, MachineInfo as MachineInfo$1, MachineJoinEvent as MachineJoinEvent$1, MachineLinksStatus as MachineLinksStatus$1, MachinesHost, ServerToken, ServerUpdateStatus as ServerUpdateStatus$1 } from "../headless/host.js";
|
|
3
3
|
import { MachinesSyncCapability, MachinesSyncContractBackend, MachinesSyncHarness, MachinesSyncHarnessFactory, describeMachinesSyncContract } from "./sync.contract.js";
|
|
4
4
|
import { HostCapabilities } from "zidane/chat/pure";
|
|
5
5
|
//#region src/machines/testing/contract.d.ts
|
|
6
6
|
/** An optional `MachinesHost` member, by its path. */
|
|
7
|
-
type MachinesHostCapability = 'hosts' | 'refreshHosts' | 'retry' | 'testHost' | 'addHost' | 'renameHost' | 'setHostUrl' | 'removeHost' | 'savedHosts' | 'machines' | 'machines.forget' | 'machines.invite' | 'links' | 'links.shareStart' | 'links.shareStop' | 'links.useServer' | 'pickFolder' | 'updates' | 'updates.check' | 'updates.install' | 'updates.configure' | 'tokens' | 'tokens.create' | 'tokens.revoke' | 'tokens.onChanged' | 'daemon' | 'daemon.reconnect' | 'daemon.restart' | 'daemon.stopRun' | 'daemon.relaunchApp' | 'presence' | 'capabilities' | 'installTool' | 'permitted';
|
|
7
|
+
type MachinesHostCapability = 'hosts' | 'refreshHosts' | 'retry' | 'testHost' | 'addHost' | 'renameHost' | 'setHostUrl' | 'removeHost' | 'savedHosts' | 'machines' | 'machines.forget' | 'machines.invite' | 'machines.onJoin' | 'links' | 'links.shareStart' | 'links.shareStop' | 'links.useServer' | 'pickFolder' | 'newChat' | 'updates' | 'updates.check' | 'updates.install' | 'updates.configure' | 'tokens' | 'tokens.create' | 'tokens.revoke' | 'tokens.pair' | 'tokens.onChanged' | 'daemon' | 'daemon.reconnect' | 'daemon.restart' | 'daemon.stopRun' | 'daemon.relaunchApp' | 'presence' | 'capabilities' | 'installTool' | 'permitted';
|
|
8
8
|
/** What the backend behind the host holds, and what it records. */
|
|
9
9
|
interface MachinesHostContractBackend {
|
|
10
10
|
/**
|
|
@@ -73,15 +73,25 @@ interface MachinesHostContractBackend {
|
|
|
73
73
|
/** The backend calls this when an update action reaches it: {@link update} changes. */
|
|
74
74
|
updated(action: 'check' | 'install' | 'configure', enabled?: boolean): void;
|
|
75
75
|
/** The backend calls this when a token is created, and answers with what it returns. */
|
|
76
|
-
created(name: string
|
|
76
|
+
created(name: string): ServerToken & {
|
|
77
77
|
token: string;
|
|
78
78
|
};
|
|
79
|
+
/** The backend calls this when a browser pairing code is asked for, and answers with what it returns. */
|
|
80
|
+
paired(params: {
|
|
81
|
+
name?: string;
|
|
82
|
+
ttlMs?: number;
|
|
83
|
+
}): {
|
|
84
|
+
code: string;
|
|
85
|
+
expiresAt: number;
|
|
86
|
+
};
|
|
79
87
|
/** The backend calls this when a revoke reaches it. */
|
|
80
88
|
revoked(id: string): void;
|
|
81
89
|
/** The backend calls this when a link action reaches it: {@link links} changes. */
|
|
82
90
|
linked(action: 'shareStart' | 'shareStop' | 'useServer', detail?: unknown): void;
|
|
83
91
|
/** The backend calls this when a daemon action reaches it. */
|
|
84
92
|
daemonCalled(action: 'reconnect' | 'restart' | 'stopRun' | 'relaunchApp', detail?: unknown): void;
|
|
93
|
+
/** The app calls this when New chat reaches it: the server, and the machine's name when on one. */
|
|
94
|
+
chatOpened(hostId: string, machine?: string): void;
|
|
85
95
|
}
|
|
86
96
|
/** A host built over a contract backend, and the pushes its backend can make. */
|
|
87
97
|
interface MachinesHostHarness {
|
|
@@ -89,6 +99,8 @@ interface MachinesHostHarness {
|
|
|
89
99
|
host: MachinesHost;
|
|
90
100
|
/** Sets a machine's status in the backend and pushes the change, as the backend does. */
|
|
91
101
|
pushMachineStatus(machineId: string, status: 'online' | 'offline'): void;
|
|
102
|
+
/** Pushes what became of a join code, as the backend does (needed for `machines.onJoin`). */
|
|
103
|
+
pushJoin?(event: MachineJoinEvent$1): void;
|
|
92
104
|
/** Sets the backend's presence and pushes the snapshot, as the backend does (needed for `presence`). */
|
|
93
105
|
pushPresence?(sessions: SessionPresence[]): void;
|
|
94
106
|
/** Adds a token elsewhere (another page, the CLI) and says so, as the backend does (needed for `tokens.onChanged`). */
|
|
@@ -31,11 +31,13 @@ const CAPABILITIES = [
|
|
|
31
31
|
"machines",
|
|
32
32
|
"machines.forget",
|
|
33
33
|
"machines.invite",
|
|
34
|
+
"machines.onJoin",
|
|
34
35
|
"links",
|
|
35
36
|
"links.shareStart",
|
|
36
37
|
"links.shareStop",
|
|
37
38
|
"links.useServer",
|
|
38
39
|
"pickFolder",
|
|
40
|
+
"newChat",
|
|
39
41
|
"updates",
|
|
40
42
|
"updates.check",
|
|
41
43
|
"updates.install",
|
|
@@ -43,6 +45,7 @@ const CAPABILITIES = [
|
|
|
43
45
|
"tokens",
|
|
44
46
|
"tokens.create",
|
|
45
47
|
"tokens.revoke",
|
|
48
|
+
"tokens.pair",
|
|
46
49
|
"tokens.onChanged",
|
|
47
50
|
"daemon",
|
|
48
51
|
"daemon.reconnect",
|
|
@@ -98,7 +101,7 @@ function contractBackend() {
|
|
|
98
101
|
tokens: [{
|
|
99
102
|
id: "tok_1",
|
|
100
103
|
name: "phone",
|
|
101
|
-
scope: "
|
|
104
|
+
scope: "client",
|
|
102
105
|
createdAt: 17e11
|
|
103
106
|
}],
|
|
104
107
|
links: {
|
|
@@ -144,9 +147,7 @@ function contractBackend() {
|
|
|
144
147
|
allows: {
|
|
145
148
|
remoteInstalls: true,
|
|
146
149
|
asMachine: false,
|
|
147
|
-
sync: true
|
|
148
|
-
clone: true,
|
|
149
|
-
createFolders: true
|
|
150
|
+
sync: true
|
|
150
151
|
},
|
|
151
152
|
workspace: {
|
|
152
153
|
roots: ["/data"],
|
|
@@ -234,15 +235,12 @@ function contractBackend() {
|
|
|
234
235
|
state: "installing"
|
|
235
236
|
};
|
|
236
237
|
},
|
|
237
|
-
created(name
|
|
238
|
-
record("token.create", {
|
|
239
|
-
name,
|
|
240
|
-
scope
|
|
241
|
-
});
|
|
238
|
+
created(name) {
|
|
239
|
+
record("token.create", { name });
|
|
242
240
|
const token = {
|
|
243
241
|
id: `tok_${backend.tokens.length + 1}`,
|
|
244
242
|
name,
|
|
245
|
-
scope,
|
|
243
|
+
scope: "client",
|
|
246
244
|
createdAt: 17e11
|
|
247
245
|
};
|
|
248
246
|
backend.tokens = [...backend.tokens, token];
|
|
@@ -251,6 +249,13 @@ function contractBackend() {
|
|
|
251
249
|
token: "zds_secret"
|
|
252
250
|
};
|
|
253
251
|
},
|
|
252
|
+
paired(params) {
|
|
253
|
+
record("token.pair", params);
|
|
254
|
+
return {
|
|
255
|
+
code: "P4IR-C0DE",
|
|
256
|
+
expiresAt: 17000006e5
|
|
257
|
+
};
|
|
258
|
+
},
|
|
254
259
|
revoked(id) {
|
|
255
260
|
record("token.revoke", id);
|
|
256
261
|
backend.tokens = backend.tokens.map((t) => t.id === id ? {
|
|
@@ -285,7 +290,11 @@ function contractBackend() {
|
|
|
285
290
|
}] : []
|
|
286
291
|
};
|
|
287
292
|
},
|
|
288
|
-
daemonCalled: (action, detail) => record(`daemon.${action}`, detail)
|
|
293
|
+
daemonCalled: (action, detail) => record(`daemon.${action}`, detail),
|
|
294
|
+
chatOpened: (hostId, machine) => record("newChat", {
|
|
295
|
+
hostId,
|
|
296
|
+
machine
|
|
297
|
+
})
|
|
289
298
|
};
|
|
290
299
|
return {
|
|
291
300
|
backend,
|
|
@@ -481,6 +490,43 @@ function describeMachinesHostContract(name, makeHarness, capabilities) {
|
|
|
481
490
|
}]));
|
|
482
491
|
}
|
|
483
492
|
});
|
|
493
|
+
it.skipIf(!has("machines.onJoin"))("tells what became of a join code, until unsubscribed", async () => {
|
|
494
|
+
const harness = await setup();
|
|
495
|
+
const heard = [];
|
|
496
|
+
const off = harness.host.machines.onJoin(harness.id, (event) => void heard.push(event));
|
|
497
|
+
harness.pushJoin({
|
|
498
|
+
pairingId: "K7Q2",
|
|
499
|
+
outcome: "refused",
|
|
500
|
+
reason: "name-taken",
|
|
501
|
+
name: "desk"
|
|
502
|
+
});
|
|
503
|
+
await waitFor(() => expect(heard).toEqual([{
|
|
504
|
+
pairingId: "K7Q2",
|
|
505
|
+
outcome: "refused",
|
|
506
|
+
reason: "name-taken",
|
|
507
|
+
name: "desk"
|
|
508
|
+
}]));
|
|
509
|
+
off();
|
|
510
|
+
harness.pushJoin({
|
|
511
|
+
pairingId: "K7Q2",
|
|
512
|
+
outcome: "joined",
|
|
513
|
+
name: "desk"
|
|
514
|
+
});
|
|
515
|
+
await new Promise((resolve) => setTimeout(resolve, 20));
|
|
516
|
+
expect(heard).toHaveLength(1);
|
|
517
|
+
});
|
|
518
|
+
it.skipIf(!has("newChat"))("opens a new chat on the server, or on one of its machines", async () => {
|
|
519
|
+
const { host, id, calls: recorded } = await setup();
|
|
520
|
+
host.newChat(id);
|
|
521
|
+
host.newChat(id, "laptop");
|
|
522
|
+
await waitFor(() => expect(calls(recorded, "newChat").map((c) => c.detail)).toEqual([{
|
|
523
|
+
hostId: id,
|
|
524
|
+
machine: void 0
|
|
525
|
+
}, {
|
|
526
|
+
hostId: id,
|
|
527
|
+
machine: "laptop"
|
|
528
|
+
}]));
|
|
529
|
+
});
|
|
484
530
|
it.skipIf(!has("pickFolder"))("picks a folder", async () => {
|
|
485
531
|
const { host, backend } = await setup();
|
|
486
532
|
expect(await host.pickFolder()).toBe(backend.folder);
|
|
@@ -529,13 +575,13 @@ function describeMachinesHostContract(name, makeHarness, capabilities) {
|
|
|
529
575
|
])).toEqual([[
|
|
530
576
|
"tok_1",
|
|
531
577
|
"phone",
|
|
532
|
-
"
|
|
578
|
+
"client"
|
|
533
579
|
]]);
|
|
534
580
|
if (tokens.create) {
|
|
535
|
-
const created = await tokens.create(id, "laptop"
|
|
581
|
+
const created = await tokens.create(id, "laptop");
|
|
536
582
|
expect(created).toMatchObject({
|
|
537
583
|
name: "laptop",
|
|
538
|
-
scope: "
|
|
584
|
+
scope: "client"
|
|
539
585
|
});
|
|
540
586
|
expect(typeof created.token).toBe("string");
|
|
541
587
|
expect((await tokens.list(id)).map((t) => t.name)).toContain("laptop");
|
|
@@ -545,6 +591,14 @@ function describeMachinesHostContract(name, makeHarness, capabilities) {
|
|
|
545
591
|
expect((await tokens.list(id)).find((t) => t.id === "tok_1")?.revokedAt).toBeTypeOf("number");
|
|
546
592
|
}
|
|
547
593
|
});
|
|
594
|
+
it.skipIf(!has("tokens.pair"))("makes a one-time code a browser logs in with", async () => {
|
|
595
|
+
const { host, id, calls: recorded } = await setup();
|
|
596
|
+
expect(await host.tokens.pair(id)).toMatchObject({
|
|
597
|
+
code: "P4IR-C0DE",
|
|
598
|
+
expiresAt: expect.any(Number)
|
|
599
|
+
});
|
|
600
|
+
expect(calls(recorded, "token.pair")).toHaveLength(1);
|
|
601
|
+
});
|
|
548
602
|
it.skipIf(!has("tokens.onChanged"))("hears when the tokens change elsewhere", async () => {
|
|
549
603
|
const { host, backend, id, pushTokenCreated } = await setup();
|
|
550
604
|
const heard = vi.fn();
|
package/dist/motion/grow.d.ts
CHANGED
|
@@ -17,6 +17,13 @@ interface GrowProps {
|
|
|
17
17
|
axis?: 'x' | 'y';
|
|
18
18
|
/** Grow in when mounted. When `false`, the block starts open, for rows rendered with their list. */
|
|
19
19
|
appear: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Shrink out on the same motion it grows in on (`settle`), not the quicker `exit`. For a list
|
|
22
|
+
* that swaps rows (one leaves as another arrives, the live fold's stack): the two curves mirror
|
|
23
|
+
* each other, so the list keeps its height through the swap instead of dipping and recovering.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
symmetric?: boolean;
|
|
20
27
|
/** Extra classes on the element. */
|
|
21
28
|
className?: string;
|
|
22
29
|
/** Inline styles on the element. */
|
|
@@ -39,6 +46,6 @@ interface GrowProps {
|
|
|
39
46
|
*
|
|
40
47
|
* @param props - Component props.
|
|
41
48
|
*/
|
|
42
|
-
declare function Grow({ as: Tag, axis, appear, className, style, children, ...rest }: GrowProps): import("react").JSX.Element;
|
|
49
|
+
declare function Grow({ as: Tag, axis, appear, symmetric, className, style, children, ...rest }: GrowProps): import("react").JSX.Element;
|
|
43
50
|
//#endregion
|
|
44
51
|
export { Grow, GrowPresence, GrowProps };
|
package/dist/motion/grow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readExitMs } from "./presence.js";
|
|
1
|
+
import { readExitMs, readMotionMs } from "./presence.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { AnimatePresence as GrowPresence, usePresence } from "motion/react";
|
|
@@ -21,7 +21,7 @@ import { AnimatePresence as GrowPresence, usePresence } from "motion/react";
|
|
|
21
21
|
*
|
|
22
22
|
* @param props - Component props.
|
|
23
23
|
*/
|
|
24
|
-
function Grow({ as: Tag = "div", axis = "y", appear, className = "", style, children, ...rest }) {
|
|
24
|
+
function Grow({ as: Tag = "div", axis = "y", appear, symmetric = false, className = "", style, children, ...rest }) {
|
|
25
25
|
const [isPresent, safeToRemove] = usePresence();
|
|
26
26
|
const ref = useRef(null);
|
|
27
27
|
const [entered, setEntered] = useState(!appear);
|
|
@@ -32,14 +32,20 @@ function Grow({ as: Tag = "div", axis = "y", appear, className = "", style, chil
|
|
|
32
32
|
}, [entered]);
|
|
33
33
|
useLayoutEffect(() => {
|
|
34
34
|
if (isPresent) return void 0;
|
|
35
|
-
const
|
|
35
|
+
const ms = symmetric ? Math.max(readMotionMs("settle"), readExitMs()) : readExitMs();
|
|
36
|
+
const id = setTimeout(() => safeToRemove?.(), ms);
|
|
36
37
|
return () => clearTimeout(id);
|
|
37
|
-
}, [
|
|
38
|
+
}, [
|
|
39
|
+
isPresent,
|
|
40
|
+
safeToRemove,
|
|
41
|
+
symmetric
|
|
42
|
+
]);
|
|
38
43
|
return /* @__PURE__ */ jsx(Tag, {
|
|
39
44
|
ref,
|
|
40
45
|
className: `zg-grow ${className}`,
|
|
41
46
|
"data-shown": entered && isPresent ? "" : void 0,
|
|
42
47
|
"data-axis": axis === "x" ? "x" : void 0,
|
|
48
|
+
"data-symmetric": symmetric ? "" : void 0,
|
|
43
49
|
style,
|
|
44
50
|
...rest,
|
|
45
51
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -11,6 +11,10 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
11
11
|
done: string;
|
|
12
12
|
notNow: string;
|
|
13
13
|
saveFailed: (message: string) => string;
|
|
14
|
+
/** A source that did not load in the source browser; what went wrong folds under Details. */
|
|
15
|
+
sourceLoadFailed: string;
|
|
16
|
+
/** The Claude Code setup that could not be read in Bring your setup. */
|
|
17
|
+
importPreviewFailed: string;
|
|
14
18
|
recommended: string;
|
|
15
19
|
usedIn: (step: string) => string;
|
|
16
20
|
fullSetupDetail: string;
|
|
@@ -36,6 +40,8 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
36
40
|
testOk: (model: string, seconds: string) => string;
|
|
37
41
|
testFailed: string;
|
|
38
42
|
testAgain: string;
|
|
43
|
+
keySaveFailed: string;
|
|
44
|
+
installFailed: string;
|
|
39
45
|
connectFirst: string;
|
|
40
46
|
importFrom: (agent: string) => string;
|
|
41
47
|
importNothing: string;
|
|
@@ -232,6 +238,8 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
232
238
|
taskDone: string;
|
|
233
239
|
taskFailed: string;
|
|
234
240
|
taskNeedsSignIn: string;
|
|
241
|
+
/** A failed background task's line; its error folds under Details. */
|
|
242
|
+
taskFailedNote: string;
|
|
235
243
|
signIn: string;
|
|
236
244
|
recapLookSystem: (dark: string, light: string) => string;
|
|
237
245
|
recapAccent: (accent: string) => string;
|
|
@@ -308,6 +316,9 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
308
316
|
working: string;
|
|
309
317
|
loading: string;
|
|
310
318
|
retry: string;
|
|
319
|
+
noticeDetails: string;
|
|
320
|
+
noticeStack: string;
|
|
321
|
+
noticeDismiss: string;
|
|
311
322
|
filePath: (path: string) => string;
|
|
312
323
|
rename: string;
|
|
313
324
|
current: string;
|
|
@@ -325,6 +336,7 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
325
336
|
modalBack: string;
|
|
326
337
|
screenBack: (screen: string) => string;
|
|
327
338
|
screenBackKey: string;
|
|
339
|
+
screenNavBack: (screen: string) => string;
|
|
328
340
|
paletteLabel: string;
|
|
329
341
|
paletteFilter: string;
|
|
330
342
|
paletteBack: string;
|
|
@@ -389,6 +401,7 @@ declare const DEFAULT_ONBOARDING_LABELS: {
|
|
|
389
401
|
openInNewTab: string;
|
|
390
402
|
terminal: string;
|
|
391
403
|
terminalLoadFailed: (message: string) => string;
|
|
404
|
+
terminalStartFailed: string;
|
|
392
405
|
terminalExited: (code: number) => string;
|
|
393
406
|
};
|
|
394
407
|
/** The setup wizard's strings: {@link DEFAULT_ONBOARDING_LABELS}' keys. */
|
|
@@ -37,6 +37,10 @@ const DEFAULT_ONBOARDING_LABELS = {
|
|
|
37
37
|
done: "Done",
|
|
38
38
|
notNow: "Not now",
|
|
39
39
|
saveFailed: (message) => `The setup was not saved. ${message}`,
|
|
40
|
+
/** A source that did not load in the source browser; what went wrong folds under Details. */
|
|
41
|
+
sourceLoadFailed: "The source did not load.",
|
|
42
|
+
/** The Claude Code setup that could not be read in Bring your setup. */
|
|
43
|
+
importPreviewFailed: "Couldn't read this setup.",
|
|
40
44
|
recommended: "recommended",
|
|
41
45
|
usedIn: (step) => `Used in ${step}`,
|
|
42
46
|
fullSetupDetail: "Choose your provider, tools, look and how zidane works.",
|
|
@@ -62,6 +66,8 @@ const DEFAULT_ONBOARDING_LABELS = {
|
|
|
62
66
|
testOk: (model, seconds) => `${model} answered in ${seconds} s`,
|
|
63
67
|
testFailed: "The model did not answer",
|
|
64
68
|
testAgain: "Test again",
|
|
69
|
+
keySaveFailed: "Couldn't save the key.",
|
|
70
|
+
installFailed: "Couldn't install it.",
|
|
65
71
|
connectFirst: "Connect a provider to continue",
|
|
66
72
|
importFrom: (agent) => `From ${agent}`,
|
|
67
73
|
importNothing: "Nothing new to copy",
|
|
@@ -304,6 +310,8 @@ const DEFAULT_ONBOARDING_LABELS = {
|
|
|
304
310
|
taskDone: "Done",
|
|
305
311
|
taskFailed: "Failed",
|
|
306
312
|
taskNeedsSignIn: "Needs sign-in",
|
|
313
|
+
/** A failed background task's line; its error folds under Details. */
|
|
314
|
+
taskFailedNote: "It didn't finish.",
|
|
307
315
|
signIn: "Sign in",
|
|
308
316
|
recapLookSystem: (dark, light) => `${dark} and ${light}, as the system picks`,
|
|
309
317
|
recapAccent: (accent) => `${accent} accent`,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { buttonClass } from "../../components/button.js";
|
|
2
|
+
import { Notice } from "../../components/Notice.js";
|
|
2
3
|
import { EmptyState } from "../../components/Surface.js";
|
|
3
4
|
import { ErrorNote, INPUT_CLASS } from "../../components/Form.js";
|
|
5
|
+
import { errorMessage } from "../../components/report-error.js";
|
|
4
6
|
import { useOnboardingLabels } from "../OnboardingProvider.js";
|
|
5
7
|
import { SkeletonListing, SourceChips, SourceHeader, SourceRows } from "../skills/parts.js";
|
|
6
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -25,9 +27,6 @@ import { Fragment as Fragment$1, useCallback, useEffect, useId, useMemo, useRef,
|
|
|
25
27
|
*/
|
|
26
28
|
/** Above this many rows, a filter field shows over the list. */
|
|
27
29
|
const FILTER_FROM = 12;
|
|
28
|
-
function messageOf(error) {
|
|
29
|
-
return error instanceof Error ? error.message : String(error);
|
|
30
|
-
}
|
|
31
30
|
/**
|
|
32
31
|
* Renders a source browser: a field, the recommended sources, and the rows of the open source.
|
|
33
32
|
*
|
|
@@ -78,7 +77,7 @@ function SourceBrowser({ browse, itemsOf, cardOf, pickOf, selectable: canPick, r
|
|
|
78
77
|
if (seq.current === n) setOpened({
|
|
79
78
|
input: text,
|
|
80
79
|
kind: "error",
|
|
81
|
-
message:
|
|
80
|
+
message: errorMessage(error)
|
|
82
81
|
});
|
|
83
82
|
});
|
|
84
83
|
}, [browse]);
|
|
@@ -214,7 +213,10 @@ function SourceBrowser({ browse, itemsOf, cardOf, pickOf, selectable: canPick, r
|
|
|
214
213
|
}),
|
|
215
214
|
opened.kind === "error" && /* @__PURE__ */ jsxs("div", {
|
|
216
215
|
className: "flex flex-col gap-3 p-3",
|
|
217
|
-
children: [/* @__PURE__ */ jsx(ErrorNote, {
|
|
216
|
+
children: [/* @__PURE__ */ jsx(ErrorNote, {
|
|
217
|
+
detail: opened.message,
|
|
218
|
+
children: labels.sourceLoadFailed
|
|
219
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
218
220
|
type: "button",
|
|
219
221
|
onClick: () => open(opened.input),
|
|
220
222
|
className: `${buttonClass({
|
|
@@ -239,8 +241,10 @@ function SourceBrowser({ browse, itemsOf, cardOf, pickOf, selectable: canPick, r
|
|
|
239
241
|
className: "m-0 px-3 pb-2 text-zg-label text-[var(--zg-text-muted)] text-pretty",
|
|
240
242
|
children: note
|
|
241
243
|
}),
|
|
242
|
-
truncatedOf?.(listing) && /* @__PURE__ */ jsx(
|
|
243
|
-
|
|
244
|
+
truncatedOf?.(listing) && /* @__PURE__ */ jsx(Notice, {
|
|
245
|
+
tone: "warning",
|
|
246
|
+
compact: true,
|
|
247
|
+
className: "mx-3 mb-2",
|
|
244
248
|
children: labels.listingTruncated
|
|
245
249
|
}),
|
|
246
250
|
items.length > FILTER_FROM && /* @__PURE__ */ jsxs("div", {
|
|
@@ -65,7 +65,10 @@ function ImportStep({ className }) {
|
|
|
65
65
|
loaded.kind !== "none" && /* @__PURE__ */ jsxs(StepSection, {
|
|
66
66
|
title: labels.importFrom(labels.agentName("claude-code")),
|
|
67
67
|
visual: mark("claude-code", "sm"),
|
|
68
|
-
children: [loaded.kind === "failed" && /* @__PURE__ */ jsx(ErrorNote, {
|
|
68
|
+
children: [loaded.kind === "failed" && /* @__PURE__ */ jsx(ErrorNote, {
|
|
69
|
+
detail: loaded.message,
|
|
70
|
+
children: labels.importPreviewFailed
|
|
71
|
+
}), preview && selection && /* @__PURE__ */ jsxs("div", {
|
|
69
72
|
className: "zg-tray rounded-zg-xl p-2 flex flex-col",
|
|
70
73
|
children: [/* @__PURE__ */ jsx(ToggleCard, {
|
|
71
74
|
title: labels.importSessions,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BrandMark } from "../../components/BrandMark.js";
|
|
2
2
|
import { buttonClass } from "../../components/button.js";
|
|
3
|
+
import { Notice } from "../../components/Notice.js";
|
|
3
4
|
import { BrowserSignIn } from "../../components/BrowserSignIn.js";
|
|
4
5
|
import { presetFor } from "../../theme/accents.js";
|
|
5
6
|
import { constant, useReadable } from "../../chat/headless/store.js";
|
|
@@ -214,8 +215,14 @@ function TaskRow({ task }) {
|
|
|
214
215
|
children: task.label
|
|
215
216
|
}),
|
|
216
217
|
/* @__PURE__ */ jsx(TaskChip, { task }),
|
|
217
|
-
task.
|
|
218
|
-
|
|
218
|
+
task.status === "failed" ? /* @__PURE__ */ jsx(Notice, {
|
|
219
|
+
tone: "error",
|
|
220
|
+
compact: true,
|
|
221
|
+
className: "flex-1 min-w-0",
|
|
222
|
+
...task.message ? { detail: task.message } : {},
|
|
223
|
+
children: labels.taskFailedNote
|
|
224
|
+
}) : task.message && /* @__PURE__ */ jsx("span", {
|
|
225
|
+
className: "flex-1 min-w-0 break-words text-zg-label text-[var(--zg-text-muted)]",
|
|
219
226
|
children: task.message
|
|
220
227
|
}),
|
|
221
228
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buttonClass } from "../../../components/button.js";
|
|
2
2
|
import { ErrorNote, FIELD_LABEL_CLASS, INPUT_CLASS } from "../../../components/Form.js";
|
|
3
|
+
import { errorMessage } from "../../../components/report-error.js";
|
|
3
4
|
import { useOnboarding, useOnboardingLabels } from "../../OnboardingProvider.js";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { useState } from "react";
|
|
@@ -41,7 +42,7 @@ function KeyForm({ provider, className, style }) {
|
|
|
41
42
|
...Object.keys(filled).length ? { fields: filled } : {}
|
|
42
43
|
});
|
|
43
44
|
} catch (failure) {
|
|
44
|
-
setError(
|
|
45
|
+
setError(errorMessage(failure));
|
|
45
46
|
} finally {
|
|
46
47
|
setBusy(false);
|
|
47
48
|
}
|
|
@@ -90,7 +91,10 @@ function KeyForm({ provider, className, style }) {
|
|
|
90
91
|
onChange: (e) => setValue(e.target.value)
|
|
91
92
|
})]
|
|
92
93
|
}),
|
|
93
|
-
error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
94
|
+
error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
95
|
+
detail: error,
|
|
96
|
+
children: labels.keySaveFailed
|
|
97
|
+
}),
|
|
94
98
|
/* @__PURE__ */ jsxs("div", {
|
|
95
99
|
className: "flex items-center gap-3",
|
|
96
100
|
children: [setup.credentialsPath && /* @__PURE__ */ jsx("span", {
|
|
@@ -2,6 +2,7 @@ import { buttonClass } from "../../../components/button.js";
|
|
|
2
2
|
import { Segmented } from "../../../components/Segmented.js";
|
|
3
3
|
import { ErrorNote, FormCard, OpLine } from "../../../components/Form.js";
|
|
4
4
|
import { BrowserSignIn } from "../../../components/BrowserSignIn.js";
|
|
5
|
+
import { errorMessage } from "../../../components/report-error.js";
|
|
5
6
|
import { useOnboarding, useOnboardingLabels } from "../../OnboardingProvider.js";
|
|
6
7
|
import { useSignIn } from "../../useSignIn.js";
|
|
7
8
|
import { ProviderMark } from "../../marks.js";
|
|
@@ -109,7 +110,7 @@ function InstallProvider({ provider, extension }) {
|
|
|
109
110
|
try {
|
|
110
111
|
await install(entry.name, setLine);
|
|
111
112
|
} catch (failure) {
|
|
112
|
-
setError(
|
|
113
|
+
setError(errorMessage(failure));
|
|
113
114
|
} finally {
|
|
114
115
|
setBusy(false);
|
|
115
116
|
}
|
|
@@ -129,7 +130,10 @@ function InstallProvider({ provider, extension }) {
|
|
|
129
130
|
kind: "busy",
|
|
130
131
|
children: line
|
|
131
132
|
})]
|
|
132
|
-
}), error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
133
|
+
}), error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
134
|
+
detail: error,
|
|
135
|
+
children: labels.installFailed
|
|
136
|
+
})]
|
|
133
137
|
});
|
|
134
138
|
}
|
|
135
139
|
//#endregion
|