zidane-ui 9.1.13 → 9.1.16
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 +4 -15
- 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 +22 -23
- 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 +2 -2
- 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/chat/SessionFilterMenu.d.ts +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -1
- package/dist/chat/composer/Composer.js +10 -8
- package/dist/chat/composer/ModelChainList.js +17 -8
- package/dist/chat/composer/ModelChainTooltip.js +5 -2
- package/dist/chat/composer/use-draft-target.d.ts +20 -1
- package/dist/chat/composer/use-draft-target.js +121 -5
- 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/headless/chip-labels.d.ts +1 -0
- package/dist/chat/headless/chip-labels.js +1 -0
- package/dist/chat/headless/composer/labels-editor.d.ts +0 -2
- package/dist/chat/headless/composer/labels-editor.js +0 -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 +2 -2
- package/dist/chat/headless/labels.d.ts +13 -6
- package/dist/chat/headless/labels.js +10 -9
- package/dist/chat/headless/session-list.d.ts +20 -8
- 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 +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +15 -8
- 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/rich-composer/RichComposer.js +1 -7
- package/dist/chat/rich-composer/composer-extensions.d.ts +0 -2
- package/dist/chat/rich-composer/composer-extensions.js +2 -2
- package/dist/chat/rich-composer/use-composer-editor.d.ts +0 -2
- package/dist/chat/rich-composer/use-composer-editor.js +1 -2
- 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 +7 -3
- 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-BZM8tu4L.d.ts} +28 -3
- package/dist/dist/index.d.ts +2 -2
- package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cyx3VGPz.d.ts} +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +1 -4
- package/dist/extensions/ExtensionSettingsSection.js +4 -3
- package/dist/extensions/ExtensionSettingsSidebar.js +2 -6
- 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 +1 -4
- package/dist/extensions/headless/host.d.ts +1 -11
- package/dist/extensions/headless/index.d.ts +3 -3
- package/dist/extensions/headless/index.js +2 -2
- package/dist/extensions/headless/select.d.ts +1 -11
- package/dist/extensions/headless/select.js +1 -18
- package/dist/files/EditorColumn.js +12 -1
- package/dist/files/TreeColumn.js +13 -20
- package/dist/files/useOpenFiles.js +2 -0
- package/dist/git/BranchMenu.js +5 -3
- package/dist/git/ImportRepoDialog.js +18 -9
- package/dist/git/MoveSessionDialog.js +15 -7
- package/dist/git/RemoteFolderPicker.js +34 -16
- package/dist/git/SyncChip.js +17 -17
- package/dist/git/WherePicker.d.ts +16 -1
- package/dist/git/WherePicker.js +80 -36
- 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 +6 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -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 +123 -129
- 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/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 +42 -5
- 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 +2 -2
- 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/demos/index.js +1 -1
- package/dist/onboarding/headless/labels.d.ts +13 -0
- package/dist/onboarding/headless/labels.js +8 -0
- package/dist/onboarding/index.js +3 -3
- package/dist/onboarding/sources/SourceBrowser.js +11 -7
- package/dist/onboarding/steps/ConnectorsStep.js +1 -1
- package/dist/onboarding/steps/ImportStep.js +4 -1
- package/dist/onboarding/steps/ReadyStep.js +9 -2
- package/dist/onboarding/steps/SkillsStep.js +1 -1
- 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/server/sse-handler.js +141 -19
- package/dist/session/ArtifactsPanel.js +39 -17
- package/dist/session/PlanTracker.js +12 -7
- package/dist/session/ProjectHome.js +13 -11
- package/dist/session/RemindersPanel.js +34 -16
- 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/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/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/editor/EditorSection.js +7 -4
- 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 +19 -12
- package/dist/settings/sections/environments/labels.d.ts +1 -0
- package/dist/settings/sections/environments/labels.js +2 -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/options-labels.d.ts +2 -1
- package/dist/settings/sections/extensions/options-labels.js +2 -1
- package/dist/settings/sections/index.d.ts +2 -1
- package/dist/settings/sections/index.js +2 -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 +12 -6
- package/dist/settings/sections/mcp/McpServerRow.js +20 -13
- 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 +14 -7
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +11 -5
- package/dist/settings/sections/providers/labels.d.ts +2 -2
- package/dist/settings/sections/providers/labels.js +2 -2
- package/dist/settings/sections/skills/SkillList.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 +15 -5
- 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 +3 -2
- 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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BrandMark } from "../../../components/BrandMark.js";
|
|
2
2
|
import { IconButton } from "../../../components/IconButton.js";
|
|
3
3
|
import { BTN_DANGER, BTN_DANGER_CONFIRM, BTN_PRIMARY, BTN_SECONDARY } from "../../../components/button.js";
|
|
4
|
+
import { Notice } from "../../../components/Notice.js";
|
|
4
5
|
import { Tray } from "../../../components/Surface.js";
|
|
5
6
|
import { HostRow, MetaChip, ToggleSwitch } from "../../../components/Form.js";
|
|
6
7
|
import { mcpBadge } from "../../headless/mcp.js";
|
|
@@ -87,9 +88,12 @@ function McpServerRow({ server: mcp, enabled, expanded, probing, enabledTools, r
|
|
|
87
88
|
title: mcp.url,
|
|
88
89
|
children: mcp.url
|
|
89
90
|
}),
|
|
90
|
-
mcp.lastError && !flow && /* @__PURE__ */ jsx(
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
mcp.lastError && !flow && /* @__PURE__ */ jsx(Notice, {
|
|
92
|
+
tone: "error",
|
|
93
|
+
compact: true,
|
|
94
|
+
detail: mcp.lastError,
|
|
95
|
+
className: "mt-1",
|
|
96
|
+
children: l.mcpSectionServerError
|
|
93
97
|
}),
|
|
94
98
|
mcp.lastError && !flow && /dynamic client registration/i.test(mcp.lastError) && /* @__PURE__ */ jsx("div", {
|
|
95
99
|
className: "mt-1 text-zg-meta text-[var(--zg-text-muted)]",
|
|
@@ -99,9 +103,12 @@ function McpServerRow({ server: mcp, enabled, expanded, probing, enabledTools, r
|
|
|
99
103
|
test: mcp.test,
|
|
100
104
|
probing,
|
|
101
105
|
labels: l
|
|
102
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [mcp.toolError && /* @__PURE__ */ jsx(
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [mcp.toolError && /* @__PURE__ */ jsx(Notice, {
|
|
107
|
+
tone: "error",
|
|
108
|
+
compact: true,
|
|
109
|
+
detail: mcp.toolError,
|
|
110
|
+
className: "mt-1",
|
|
111
|
+
children: l.mcpSectionToolsFailed
|
|
105
112
|
}), mcp.toolsUpdatedAt && !probing && /* @__PURE__ */ jsx("div", {
|
|
106
113
|
className: "zg-meta mt-1",
|
|
107
114
|
children: l.mcpSectionToolsListed(ageString(mcp.toolsUpdatedAt))
|
|
@@ -175,17 +182,17 @@ function McpServerRow({ server: mcp, enabled, expanded, probing, enabledTools, r
|
|
|
175
182
|
]
|
|
176
183
|
}), flow && /* @__PURE__ */ jsx("div", {
|
|
177
184
|
className: "zg-tray mt-3 px-3 py-2.5 rounded-zg-md text-xs",
|
|
178
|
-
children: flow.kind === "error" ? /* @__PURE__ */
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
185
|
+
children: flow.kind === "error" ? /* @__PURE__ */ jsx(Notice, {
|
|
186
|
+
tone: "error",
|
|
187
|
+
compact: true,
|
|
188
|
+
detail: flow.message,
|
|
189
|
+
action: /* @__PURE__ */ jsx("button", {
|
|
184
190
|
type: "button",
|
|
185
191
|
onClick: signIn.cancel,
|
|
186
192
|
className: BTN_SECONDARY,
|
|
187
193
|
children: l.mcpSectionDismiss
|
|
188
|
-
})
|
|
194
|
+
}),
|
|
195
|
+
children: l.mcpSectionSignInFailed
|
|
189
196
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
190
197
|
className: "flex items-center gap-2",
|
|
191
198
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -3,8 +3,8 @@ import { SettingsError } from "../../headless/host.js";
|
|
|
3
3
|
//#region src/settings/sections/mcp/labels.d.ts
|
|
4
4
|
/** The default English strings of the MCP servers section. */
|
|
5
5
|
declare const DEFAULT_MCP_SECTION_LABELS: {
|
|
6
|
-
/** A failed read or action, worded
|
|
7
|
-
|
|
6
|
+
/** A failed read or action, worded by its kind. What the host said goes under Details. */
|
|
7
|
+
mcpSectionFailed: (error: SettingsError) => "Couldn't reach the host." | "Not allowed: this connection may not do that." | "Something went wrong.";
|
|
8
8
|
/** Tests every enabled server. */
|
|
9
9
|
mcpSectionTestAll: string;
|
|
10
10
|
/** While that runs. */
|
|
@@ -71,6 +71,12 @@ declare const DEFAULT_MCP_SECTION_LABELS: {
|
|
|
71
71
|
mcpSectionDisable: string;
|
|
72
72
|
/** Its tooltip when off. */
|
|
73
73
|
mcpSectionEnable: string;
|
|
74
|
+
/** The server's last error, worded; what it said goes under Details. */
|
|
75
|
+
mcpSectionServerError: string;
|
|
76
|
+
/** Listing its tools failed. */
|
|
77
|
+
mcpSectionToolsFailed: string;
|
|
78
|
+
/** A sign-in failed. */
|
|
79
|
+
mcpSectionSignInFailed: string;
|
|
74
80
|
/** Drops a failed sign-in. */
|
|
75
81
|
mcpSectionDismiss: string;
|
|
76
82
|
/** The sign-in page is open. */
|
|
@@ -9,8 +9,8 @@ import { MCP_KEY_REFUSED_HINT, MCP_STATUS_LABEL } from "zidane/chat/pure";
|
|
|
9
9
|
*/
|
|
10
10
|
/** The default English strings of the MCP servers section. */
|
|
11
11
|
const DEFAULT_MCP_SECTION_LABELS = {
|
|
12
|
-
/** A failed read or action, worded
|
|
13
|
-
|
|
12
|
+
/** A failed read or action, worded by its kind. What the host said goes under Details. */
|
|
13
|
+
mcpSectionFailed: (error) => error.kind === "unreachable" ? "Couldn't reach the host." : error.kind === "refused" ? "Not allowed: this connection may not do that." : "Something went wrong.",
|
|
14
14
|
/** Tests every enabled server. */
|
|
15
15
|
mcpSectionTestAll: "Test all",
|
|
16
16
|
/** While that runs. */
|
|
@@ -77,6 +77,12 @@ const DEFAULT_MCP_SECTION_LABELS = {
|
|
|
77
77
|
mcpSectionDisable: "Disable for this folder",
|
|
78
78
|
/** Its tooltip when off. */
|
|
79
79
|
mcpSectionEnable: "Enable for this folder",
|
|
80
|
+
/** The server's last error, worded; what it said goes under Details. */
|
|
81
|
+
mcpSectionServerError: "The server reported an error.",
|
|
82
|
+
/** Listing its tools failed. */
|
|
83
|
+
mcpSectionToolsFailed: "Couldn't list its tools.",
|
|
84
|
+
/** A sign-in failed. */
|
|
85
|
+
mcpSectionSignInFailed: "Sign-in failed.",
|
|
80
86
|
/** Drops a failed sign-in. */
|
|
81
87
|
mcpSectionDismiss: "Dismiss",
|
|
82
88
|
/** The sign-in page is open. */
|
|
@@ -6,8 +6,8 @@ import { useSettingsHost } from "../../SettingsProvider.js";
|
|
|
6
6
|
import { useComposerModelName, useModelCatalog } from "../../../chat/composer/use-composer-stores.js";
|
|
7
7
|
import { ModelTestButton, ModelTestLine, useModelRowsLabels, useModelTest } from "./model-test.js";
|
|
8
8
|
import { ModelListPicker } from "./ModelListPicker.js";
|
|
9
|
-
import { useSettingsResource } from "../shared/catalog.js";
|
|
10
9
|
import { ConversationPresetPreview } from "../../../onboarding/conversation.js";
|
|
10
|
+
import { useSettingsResource } from "../shared/catalog.js";
|
|
11
11
|
import { SelectRow, ValueChip } from "../../rows.js";
|
|
12
12
|
import { ModelPickField } from "./ModelPickField.js";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CSSProperties } from "react";
|
|
2
|
+
import { NewChatPlace } from "zidane/chat/pure";
|
|
3
|
+
//#region src/settings/sections/models/NewChatPlaceRow.d.ts
|
|
4
|
+
/** Props for {@link NewChatPlaceRow}. */
|
|
5
|
+
interface NewChatPlaceRowProps {
|
|
6
|
+
/** The place set here; `null` or absent: none. */
|
|
7
|
+
value: NewChatPlace | null | undefined;
|
|
8
|
+
/** What applies while none is set here (a space's row: the global place). Absent: this computer. */
|
|
9
|
+
inherited?: NewChatPlace | null;
|
|
10
|
+
/** A space's row: words it for the space. */
|
|
11
|
+
inSpace?: boolean;
|
|
12
|
+
/** Takes the place back. */
|
|
13
|
+
onClear: () => void;
|
|
14
|
+
/** Extra classes on the row. */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Inline styles on the row. */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders where new chats start, and Clear when a place is set here.
|
|
21
|
+
*
|
|
22
|
+
* @param props - The place, what applies without it, and Clear.
|
|
23
|
+
*/
|
|
24
|
+
declare function NewChatPlaceRow({ value, inherited, inSpace, onClear, className, style }: NewChatPlaceRowProps): import("react").JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { NewChatPlaceRow, NewChatPlaceRowProps };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { IconButton } from "../../../components/IconButton.js";
|
|
2
|
+
import { HostRow, MetaChip, RowText } from "../../../components/Form.js";
|
|
3
|
+
import { useModelRowsLabels } from "./model-test.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { LOCAL_HOST_KEY } from "zidane/chat/pure";
|
|
6
|
+
//#region src/settings/sections/models/NewChatPlaceRow.tsx
|
|
7
|
+
/** The place as chips: where, on which machine, in which folder, how. */
|
|
8
|
+
function PlaceChips({ place, muted }) {
|
|
9
|
+
const l = useModelRowsLabels();
|
|
10
|
+
const host = !place || place.hostId === LOCAL_HOST_KEY ? l.modelRowsThisComputer : place.hostName ?? place.hostId;
|
|
11
|
+
const tone = muted ? "muted" : "text";
|
|
12
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
13
|
+
className: "flex items-center gap-1 flex-wrap justify-end min-w-0",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsxs(MetaChip, {
|
|
16
|
+
tone,
|
|
17
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
18
|
+
"aria-hidden": true,
|
|
19
|
+
className: !place || place.hostId === LOCAL_HOST_KEY ? "i-ph-laptop" : "i-ph-hard-drives"
|
|
20
|
+
}), host]
|
|
21
|
+
}),
|
|
22
|
+
place?.machine && /* @__PURE__ */ jsxs(MetaChip, {
|
|
23
|
+
tone,
|
|
24
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
25
|
+
"aria-hidden": true,
|
|
26
|
+
className: "i-ph-desktop-tower"
|
|
27
|
+
}), place.machine]
|
|
28
|
+
}),
|
|
29
|
+
place?.folder && /* @__PURE__ */ jsx(MetaChip, {
|
|
30
|
+
tone,
|
|
31
|
+
className: "font-mono max-w-[16rem]",
|
|
32
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: "truncate",
|
|
34
|
+
children: place.folder
|
|
35
|
+
})
|
|
36
|
+
}),
|
|
37
|
+
place?.isolation && place.isolation !== "local" && /* @__PURE__ */ jsx(MetaChip, {
|
|
38
|
+
tone,
|
|
39
|
+
children: place.isolation
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Renders where new chats start, and Clear when a place is set here.
|
|
46
|
+
*
|
|
47
|
+
* @param props - The place, what applies without it, and Clear.
|
|
48
|
+
*/
|
|
49
|
+
function NewChatPlaceRow({ value, inherited, inSpace = false, onClear, className, style }) {
|
|
50
|
+
const l = useModelRowsLabels();
|
|
51
|
+
const label = l.modelRowsNewChatsStart;
|
|
52
|
+
return /* @__PURE__ */ jsxs(HostRow, {
|
|
53
|
+
"data-testid": "new-chat-place-row",
|
|
54
|
+
disabled: true,
|
|
55
|
+
className,
|
|
56
|
+
style,
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(RowText, {
|
|
59
|
+
label,
|
|
60
|
+
description: l.modelRowsNewChatsStartHint(inSpace),
|
|
61
|
+
truncate: false
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsx(PlaceChips, {
|
|
64
|
+
place: value ?? inherited,
|
|
65
|
+
muted: !value
|
|
66
|
+
}),
|
|
67
|
+
value && /* @__PURE__ */ jsx(IconButton, {
|
|
68
|
+
icon: "i-ph-x",
|
|
69
|
+
label: l.modelRowsClear(inSpace ? l.modelRowsPlaceResetSpace : l.modelRowsPlaceReset, label),
|
|
70
|
+
title: inSpace ? l.modelRowsPlaceResetSpace : l.modelRowsPlaceReset,
|
|
71
|
+
size: "sm",
|
|
72
|
+
onClick: onClear
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { NewChatPlaceRow };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { useSettings } from "../../SettingsProvider.js";
|
|
2
2
|
import { AgentDefaultsRows, agentDefaultsOf } from "./AgentDefaults.js";
|
|
3
3
|
import { SpacesSection } from "../../../chat/sidebar/SpacesSection.js";
|
|
4
|
-
import {
|
|
4
|
+
import { NewChatPlaceRow } from "./NewChatPlaceRow.js";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { readNewChatPlace } from "zidane/chat/pure";
|
|
5
7
|
//#region src/settings/sections/models/SpacesDefaultsSection.tsx
|
|
6
8
|
/**
|
|
7
9
|
* The Spaces sections of the General page: the switch, then the list with each space's defaults while it is on.
|
|
@@ -11,14 +13,24 @@ import { jsx } from "react/jsx-runtime";
|
|
|
11
13
|
function SpacesDefaultsSection({ cwd, className, style }) {
|
|
12
14
|
const { settings } = useSettings();
|
|
13
15
|
const inherited = agentDefaultsOf(settings);
|
|
14
|
-
return /* @__PURE__ */ jsx(SpacesSection, { renderDefaults: (space, update) => /* @__PURE__ */ jsx(AgentDefaultsRows, {
|
|
16
|
+
return /* @__PURE__ */ jsx(SpacesSection, { renderDefaults: (space, update) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AgentDefaultsRows, {
|
|
15
17
|
value: spaceDefaults(space),
|
|
16
18
|
onChange: (next) => update((s) => withSpaceDefaults(s, next)),
|
|
17
19
|
cwd,
|
|
18
20
|
inherited,
|
|
19
21
|
className,
|
|
20
22
|
style
|
|
21
|
-
})
|
|
23
|
+
}), /* @__PURE__ */ jsx(NewChatPlaceRow, {
|
|
24
|
+
value: space.place,
|
|
25
|
+
inherited: readNewChatPlace(settings.defaultPlace) ?? null,
|
|
26
|
+
inSpace: true,
|
|
27
|
+
onClear: () => update((s) => {
|
|
28
|
+
const { place: _place, ...rest } = s;
|
|
29
|
+
return rest;
|
|
30
|
+
}),
|
|
31
|
+
className,
|
|
32
|
+
style
|
|
33
|
+
})] }) });
|
|
22
34
|
}
|
|
23
35
|
/**
|
|
24
36
|
* A space's defaults for new sessions, as the rows edit them.
|
|
@@ -40,6 +40,8 @@ declare const DEFAULT_MODEL_ROWS_LABELS: {
|
|
|
40
40
|
modelRowsDuration: (ms: number) => string;
|
|
41
41
|
/** A failed test: why, and what the provider said. */
|
|
42
42
|
modelRowsFailed: (reason: string | undefined, message: string | undefined) => string;
|
|
43
|
+
/** A failed test, worded; what the provider said goes under Details. */
|
|
44
|
+
modelRowsTestFailed: (reason: string | undefined) => string;
|
|
43
45
|
/** A failed test's model on its provider, after the reason. */
|
|
44
46
|
modelRowsFailedTarget: (target: string) => string;
|
|
45
47
|
/** The text model row. */
|
|
@@ -88,6 +90,11 @@ declare const DEFAULT_MODEL_ROWS_LABELS: {
|
|
|
88
90
|
modelRowsStartWith: (where: string) => string;
|
|
89
91
|
/** The default agent row. */
|
|
90
92
|
modelRowsDefaultAgent: string;
|
|
93
|
+
modelRowsNewChatsStart: string;
|
|
94
|
+
modelRowsNewChatsStartHint: (inSpace: boolean) => "To change it, pick a place in a new chat of this space, then Use for new chats." | "To change it, pick a place in a new chat, then Use for new chats.";
|
|
95
|
+
modelRowsThisComputer: string;
|
|
96
|
+
modelRowsPlaceReset: string;
|
|
97
|
+
modelRowsPlaceResetSpace: string;
|
|
91
98
|
/** The agent new sessions start on with none set. */
|
|
92
99
|
modelRowsBuild: string;
|
|
93
100
|
/** A saved agent this folder doesn't offer. */
|
|
@@ -40,6 +40,8 @@ const DEFAULT_MODEL_ROWS_LABELS = {
|
|
|
40
40
|
modelRowsDuration: (ms) => `${ms}ms`,
|
|
41
41
|
/** A failed test: why, and what the provider said. */
|
|
42
42
|
modelRowsFailed: (reason, message) => `${reason ?? "error"}: ${message ?? "failed"}`,
|
|
43
|
+
/** A failed test, worded; what the provider said goes under Details. */
|
|
44
|
+
modelRowsTestFailed: (reason) => reason ? `The model didn't answer (${reason}).` : "The model didn't answer.",
|
|
43
45
|
/** A failed test's model on its provider, after the reason. */
|
|
44
46
|
modelRowsFailedTarget: (target) => ` (${target})`,
|
|
45
47
|
/** The text model row. */
|
|
@@ -88,6 +90,11 @@ const DEFAULT_MODEL_ROWS_LABELS = {
|
|
|
88
90
|
modelRowsStartWith: (where) => `${where} start with them.`,
|
|
89
91
|
/** The default agent row. */
|
|
90
92
|
modelRowsDefaultAgent: "Default agent",
|
|
93
|
+
modelRowsNewChatsStart: "Where new chats start",
|
|
94
|
+
modelRowsNewChatsStartHint: (inSpace) => inSpace ? "To change it, pick a place in a new chat of this space, then Use for new chats." : "To change it, pick a place in a new chat, then Use for new chats.",
|
|
95
|
+
modelRowsThisComputer: "This computer",
|
|
96
|
+
modelRowsPlaceReset: "Start new chats on this computer",
|
|
97
|
+
modelRowsPlaceResetSpace: "Use the default place",
|
|
91
98
|
/** The agent new sessions start on with none set. */
|
|
92
99
|
modelRowsBuild: "Build",
|
|
93
100
|
/** A saved agent this folder doesn't offer. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BTN_SECONDARY } from "../../../components/button.js";
|
|
2
|
+
import { Notice } from "../../../components/Notice.js";
|
|
2
3
|
import { MetaChip } from "../../../components/Form.js";
|
|
3
4
|
import { toSettingsError } from "../../headless/host.js";
|
|
4
5
|
import { useComposerModelName, useComposerProviderLabel } from "../../../chat/composer/use-composer-stores.js";
|
|
@@ -94,10 +95,12 @@ function ModelTestLine({ result, className }) {
|
|
|
94
95
|
]
|
|
95
96
|
});
|
|
96
97
|
const target = model && provider ? l.modelRowsPickLabel(model, provider) : model ?? provider;
|
|
97
|
-
return /* @__PURE__ */ jsxs(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
return /* @__PURE__ */ jsxs(Notice, {
|
|
99
|
+
tone: "error",
|
|
100
|
+
compact: true,
|
|
101
|
+
...result.message ? { detail: result.message } : {},
|
|
102
|
+
className: `mx-3 mb-2${className ? ` ${className}` : ""}`,
|
|
103
|
+
children: [l.modelRowsTestFailed(result.reason), target ? l.modelRowsFailedTarget(target) : ""]
|
|
101
104
|
});
|
|
102
105
|
}
|
|
103
106
|
//#endregion
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { IconButton } from "../../../components/IconButton.js";
|
|
2
2
|
import { BTN_PRIMARY, BTN_SECONDARY } from "../../../components/button.js";
|
|
3
|
+
import { Notice } from "../../../components/Notice.js";
|
|
3
4
|
import { Segmented } from "../../../components/Segmented.js";
|
|
4
5
|
import { EmptyState, Tray } from "../../../components/Surface.js";
|
|
5
6
|
import { MetaChip } from "../../../components/Form.js";
|
|
7
|
+
import { errorMessage } from "../../../components/report-error.js";
|
|
6
8
|
import { CountBadge } from "../../../components/TabPill.js";
|
|
7
9
|
import { useStaysMounted } from "../../../motion/collapse.js";
|
|
8
10
|
import { useSettingsHost, useSettingsLabels } from "../../SettingsProvider.js";
|
|
@@ -26,8 +28,7 @@ import { memo, useCallback, useMemo, useState } from "react";
|
|
|
26
28
|
* summed in its header's badges: Processes (open), Sessions, Threads, Slow
|
|
27
29
|
* frames and IPC (hosts that keep those counters: the desktop app, not a
|
|
28
30
|
* server), CPU profile (hosts that record one). A host that can't be
|
|
29
|
-
* watched says why (too old, an error)
|
|
30
|
-
* restricted ("Admin only") and empty. The process tree opens one level at a time; what
|
|
31
|
+
* watched says why (too old, an error). The process tree opens one level at a time; what
|
|
31
32
|
* sessions and terminals launched is its own group, collapsed. Sessions lists
|
|
32
33
|
* what each session runs, one collapsed group per session. Rows are one line:
|
|
33
34
|
* the pid and command line are the row's tooltip.
|
|
@@ -60,7 +61,7 @@ function PerformanceSection({ className, style }) {
|
|
|
60
61
|
const l = usePerformanceSectionLabels();
|
|
61
62
|
const settingsLabels = useSettingsLabels();
|
|
62
63
|
const latest = samples[samples.length - 1];
|
|
63
|
-
const restricted = useSettingsRestricted() && !host
|
|
64
|
+
const restricted = useSettingsRestricted() && !host;
|
|
64
65
|
return /* @__PURE__ */ jsxs(SettingsPanel, {
|
|
65
66
|
className,
|
|
66
67
|
style,
|
|
@@ -677,7 +678,7 @@ function Profile({ host, reveal }) {
|
|
|
677
678
|
ok: false,
|
|
678
679
|
error: {
|
|
679
680
|
kind: "failed",
|
|
680
|
-
detail:
|
|
681
|
+
detail: errorMessage(error)
|
|
681
682
|
}
|
|
682
683
|
});
|
|
683
684
|
} finally {
|
|
@@ -732,8 +733,17 @@ function Profile({ host, reveal }) {
|
|
|
732
733
|
]
|
|
733
734
|
}),
|
|
734
735
|
outcome && !outcome.ok && /* @__PURE__ */ jsx("div", {
|
|
735
|
-
className: "px-2 pb-1.5
|
|
736
|
-
children: outcome.error.kind === "busy" ?
|
|
736
|
+
className: "px-2 pb-1.5",
|
|
737
|
+
children: outcome.error.kind === "busy" ? /* @__PURE__ */ jsx(Notice, {
|
|
738
|
+
tone: "warning",
|
|
739
|
+
compact: true,
|
|
740
|
+
children: l.perfProfileBusy
|
|
741
|
+
}) : /* @__PURE__ */ jsx(Notice, {
|
|
742
|
+
tone: "error",
|
|
743
|
+
compact: true,
|
|
744
|
+
...outcome.error.detail ? { detail: outcome.error.detail } : {},
|
|
745
|
+
children: l.perfProfileError
|
|
746
|
+
})
|
|
737
747
|
}),
|
|
738
748
|
outcome?.ok && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Heads, { names: [l.perfColShare, l.perfColSelf] }), outcome.profile.top.slice(0, LIST_CAP).map((fn) => /* @__PURE__ */ jsxs("div", {
|
|
739
749
|
className: ROW,
|
|
@@ -70,7 +70,7 @@ declare const DEFAULT_PERFORMANCE_SECTION_LABELS: {
|
|
|
70
70
|
perfProfileRecord: string;
|
|
71
71
|
perfProfileRecording: (s: number) => string;
|
|
72
72
|
perfProfileBusy: string;
|
|
73
|
-
|
|
73
|
+
perfProfileError: string;
|
|
74
74
|
perfHud: string;
|
|
75
75
|
perfHudClose: string;
|
|
76
76
|
perfHudOpen: string;
|
|
@@ -94,7 +94,7 @@ const DEFAULT_PERFORMANCE_SECTION_LABELS = {
|
|
|
94
94
|
perfProfileRecord: "Record",
|
|
95
95
|
perfProfileRecording: (s) => `Recording ${s} s…`,
|
|
96
96
|
perfProfileBusy: "Busy. Close DevTools and retry.",
|
|
97
|
-
|
|
97
|
+
perfProfileError: "Couldn't record the profile.",
|
|
98
98
|
perfHud: "Performance",
|
|
99
99
|
perfHudClose: "Close the performance overlay",
|
|
100
100
|
perfHudOpen: "Open Settings › Performance",
|
|
@@ -22,7 +22,7 @@ interface ProvidersSectionProps {
|
|
|
22
22
|
/**
|
|
23
23
|
* Renders the providers of the nearest `SettingsProvider`'s host (`providers`). Without it the list is
|
|
24
24
|
* empty; without an action, its control is hidden; a connection that may not write (`writable`) sees
|
|
25
|
-
* the list restricted
|
|
25
|
+
* the list restricted.
|
|
26
26
|
*
|
|
27
27
|
* @param props - The `cwd`, an `intro`, `confirm`, `className` and `style`.
|
|
28
28
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BrandMark } from "../../../components/BrandMark.js";
|
|
2
2
|
import { BTN_DANGER, BTN_PRIMARY, BTN_SECONDARY } from "../../../components/button.js";
|
|
3
|
+
import { Notice } from "../../../components/Notice.js";
|
|
3
4
|
import { MetaChip } from "../../../components/Form.js";
|
|
4
5
|
import { BrowserSignIn } from "../../../components/BrowserSignIn.js";
|
|
5
6
|
import { toSettingsError } from "../../headless/host.js";
|
|
@@ -36,7 +37,7 @@ const NO_PROVIDERS = [];
|
|
|
36
37
|
/**
|
|
37
38
|
* Renders the providers of the nearest `SettingsProvider`'s host (`providers`). Without it the list is
|
|
38
39
|
* empty; without an action, its control is hidden; a connection that may not write (`writable`) sees
|
|
39
|
-
* the list restricted
|
|
40
|
+
* the list restricted.
|
|
40
41
|
*
|
|
41
42
|
* @param props - The `cwd`, an `intro`, `confirm`, `className` and `style`.
|
|
42
43
|
*/
|
|
@@ -64,9 +65,12 @@ function ProvidersSection({ cwd, intro, confirm = YES, className, style }) {
|
|
|
64
65
|
confirm
|
|
65
66
|
}, status.key))
|
|
66
67
|
}) }),
|
|
67
|
-
load.error && /* @__PURE__ */ jsx(
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
load.error && /* @__PURE__ */ jsx(Notice, {
|
|
69
|
+
tone: "error",
|
|
70
|
+
compact: true,
|
|
71
|
+
className: "mt-3",
|
|
72
|
+
...load.error.detail ? { detail: load.error.detail } : {},
|
|
73
|
+
children: l.accountsFailed(load.error)
|
|
70
74
|
})
|
|
71
75
|
] })
|
|
72
76
|
});
|
|
@@ -351,9 +355,12 @@ function ProviderRow({ status, cwd, host, restricted, labels: l, confirm }) {
|
|
|
351
355
|
onError: setRowError,
|
|
352
356
|
onReauth: canSignIn && !flow ? startSignIn : void 0
|
|
353
357
|
}),
|
|
354
|
-
rowError && /* @__PURE__ */ jsx(
|
|
355
|
-
|
|
356
|
-
|
|
358
|
+
rowError && /* @__PURE__ */ jsx(Notice, {
|
|
359
|
+
tone: "error",
|
|
360
|
+
compact: true,
|
|
361
|
+
className: "mt-2",
|
|
362
|
+
...rowError.detail ? { detail: rowError.detail } : {},
|
|
363
|
+
children: l.accountsFailed(rowError)
|
|
357
364
|
})
|
|
358
365
|
]
|
|
359
366
|
})
|
|
@@ -14,7 +14,7 @@ interface ServerProvidersSectionProps {
|
|
|
14
14
|
/**
|
|
15
15
|
* Renders the providers of the nearest `SettingsProvider`'s host (`providers`) as a server's cards: Set API
|
|
16
16
|
* key needs `setApiKey`, Sign in `signIn`, Remove `remove`; a connection that may not write (`writable`)
|
|
17
|
-
* sees the cards restricted
|
|
17
|
+
* sees the cards restricted.
|
|
18
18
|
*
|
|
19
19
|
* @param props - The `hostName`, an `intro`, `className` and `style`.
|
|
20
20
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BTN_DANGER, BTN_PRIMARY, BTN_SECONDARY } from "../../../components/button.js";
|
|
2
|
+
import { Notice } from "../../../components/Notice.js";
|
|
2
3
|
import { ErrorNote, FormCard, FormSection, MetaChip, OpLine, RowText } from "../../../components/Form.js";
|
|
3
4
|
import { toSettingsError } from "../../headless/host.js";
|
|
4
5
|
import { useSettingsHost } from "../../SettingsProvider.js";
|
|
@@ -25,7 +26,7 @@ const YES = async () => true;
|
|
|
25
26
|
/**
|
|
26
27
|
* Renders the providers of the nearest `SettingsProvider`'s host (`providers`) as a server's cards: Set API
|
|
27
28
|
* key needs `setApiKey`, Sign in `signIn`, Remove `remove`; a connection that may not write (`writable`)
|
|
28
|
-
* sees the cards restricted
|
|
29
|
+
* sees the cards restricted.
|
|
29
30
|
*
|
|
30
31
|
* @param props - The `hostName`, an `intro`, `className` and `style`.
|
|
31
32
|
*/
|
|
@@ -41,7 +42,10 @@ function ServerProvidersSection({ hostName, intro, className, style }) {
|
|
|
41
42
|
children: /* @__PURE__ */ jsxs(SettingsPanelBody, { children: [intro, /* @__PURE__ */ jsxs("div", {
|
|
42
43
|
className: "space-y-4",
|
|
43
44
|
children: [
|
|
44
|
-
load.error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
45
|
+
load.error && /* @__PURE__ */ jsx(ErrorNote, {
|
|
46
|
+
...load.error.detail ? { detail: load.error.detail } : {},
|
|
47
|
+
children: l.accountsServerReadFailed(hostName, l.accountsFailed(load.error))
|
|
48
|
+
}),
|
|
45
49
|
!list && !load.error && /* @__PURE__ */ jsx(OpLine, {
|
|
46
50
|
kind: "busy",
|
|
47
51
|
children: l.accountsServerReading(hostName)
|
|
@@ -198,9 +202,11 @@ function ProviderCard({ host, hostName, provider, labels: l }) {
|
|
|
198
202
|
}),
|
|
199
203
|
error && /* @__PURE__ */ jsx("div", {
|
|
200
204
|
className: "px-3 pb-2.5",
|
|
201
|
-
children: /* @__PURE__ */ jsx(
|
|
202
|
-
|
|
203
|
-
|
|
205
|
+
children: /* @__PURE__ */ jsx(Notice, {
|
|
206
|
+
tone: "error",
|
|
207
|
+
compact: true,
|
|
208
|
+
...error.detail ? { detail: error.detail } : {},
|
|
209
|
+
children: l.accountsFailed(error)
|
|
204
210
|
})
|
|
205
211
|
})
|
|
206
212
|
]
|
|
@@ -2,8 +2,8 @@ import { SettingsError } from "../../headless/host.js";
|
|
|
2
2
|
//#region src/settings/sections/providers/labels.d.ts
|
|
3
3
|
/** The default English strings of the Accounts sections. */
|
|
4
4
|
declare const DEFAULT_ACCOUNTS_SECTION_LABELS: {
|
|
5
|
-
/** A failed read or action, worded
|
|
6
|
-
|
|
5
|
+
/** A failed read or action, worded by its kind. What the host said goes under Details. */
|
|
6
|
+
accountsFailed: (error: SettingsError) => "Couldn't reach the host." | "Not allowed: this connection may not do that." | "Something went wrong.";
|
|
7
7
|
/** The status dot of a provider with a credential. */
|
|
8
8
|
accountsAuthenticated: string;
|
|
9
9
|
/** The status dot of a provider without one. */
|
|
@@ -9,8 +9,8 @@ import { DEFAULT_OAUTH_ACCOUNT_LABEL } from "zidane/chat/pure";
|
|
|
9
9
|
*/
|
|
10
10
|
/** The default English strings of the Accounts sections. */
|
|
11
11
|
const DEFAULT_ACCOUNTS_SECTION_LABELS = {
|
|
12
|
-
/** A failed read or action, worded
|
|
13
|
-
|
|
12
|
+
/** A failed read or action, worded by its kind. What the host said goes under Details. */
|
|
13
|
+
accountsFailed: (error) => error.kind === "unreachable" ? "Couldn't reach the host." : error.kind === "refused" ? "Not allowed: this connection may not do that." : "Something went wrong.",
|
|
14
14
|
/** The status dot of a provider with a credential. */
|
|
15
15
|
accountsAuthenticated: "Authenticated",
|
|
16
16
|
/** The status dot of a provider without one. */
|
|
@@ -5,8 +5,8 @@ import { EmptyState } from "../../../components/Surface.js";
|
|
|
5
5
|
import { Checkbox, MetaChip } from "../../../components/Form.js";
|
|
6
6
|
import { LoadError } from "../../../components/LoadError.js";
|
|
7
7
|
import { useSettingsHost } from "../../SettingsProvider.js";
|
|
8
|
-
import { useSectionLabels } from "../use-section-labels.js";
|
|
9
8
|
import { useCodeDocument } from "../../../code/editor/useCodeDocument.js";
|
|
9
|
+
import { useSectionLabels } from "../use-section-labels.js";
|
|
10
10
|
import { SettingsRestricted } from "../../SettingsRestricted.js";
|
|
11
11
|
import { OpenFileButton, RevealPathButton, useCatalogSharedLabels, useEnabledList, useSettingsResource } from "../shared/catalog.js";
|
|
12
12
|
import { formatTokens } from "../../../session/headless/usage-format.js";
|
|
@@ -3,9 +3,9 @@ import { OpLine } from "../../../components/Form.js";
|
|
|
3
3
|
import { toSettingsError } from "../../headless/host.js";
|
|
4
4
|
import { useSettingsHost } from "../../SettingsProvider.js";
|
|
5
5
|
import { SettingsPanel, SettingsPanelActions, SettingsPanelBody } from "../../section.js";
|
|
6
|
+
import { SkillSourceBrowser } from "../../../onboarding/skills/SkillSourceBrowser.js";
|
|
6
7
|
import { ScopePicker, useCatalogSharedLabels, useOpLine, useSettingsResource, useSettingsValues, useWriteSetting } from "../shared/catalog.js";
|
|
7
8
|
import { SettingsTutorial } from "../../SettingsTutorial.js";
|
|
8
|
-
import { SkillSourceBrowser } from "../../../onboarding/skills/SkillSourceBrowser.js";
|
|
9
9
|
import { SkillActions, SkillList, useSkillsSectionLabels } from "./SkillList.js";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -99,17 +99,10 @@ function describeSettingsPerformanceContract(name, makeHarness, capabilities, op
|
|
|
99
99
|
control.emit(fixturePerfSample(3, 7e3));
|
|
100
100
|
expect(seen).toEqual([5e3]);
|
|
101
101
|
});
|
|
102
|
-
it.skipIf(!options.watchErrors).each([
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
detail: "\"perf.watch\" needs an admin token"
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
kind: "failed",
|
|
110
|
-
detail: "offline"
|
|
111
|
-
}
|
|
112
|
-
])("a refused watch ($kind) reaches onError as its kind, once", async (error) => {
|
|
102
|
+
it.skipIf(!options.watchErrors).each([{ kind: "unavailable" }, {
|
|
103
|
+
kind: "failed",
|
|
104
|
+
detail: "offline"
|
|
105
|
+
}])("a refused watch ($kind) reaches onError as its kind, once", async (error) => {
|
|
113
106
|
const { host } = await setup({ watchError: error });
|
|
114
107
|
const errors = [];
|
|
115
108
|
const seen = [];
|
|
@@ -119,7 +112,10 @@ function describeSettingsPerformanceContract(name, makeHarness, capabilities, op
|
|
|
119
112
|
expect(seen).toEqual([]);
|
|
120
113
|
});
|
|
121
114
|
it.skipIf(!options.watchErrors)("a watch released before its refusal lands hears nothing", async () => {
|
|
122
|
-
const { host } = await setup({ watchError: {
|
|
115
|
+
const { host } = await setup({ watchError: {
|
|
116
|
+
kind: "failed",
|
|
117
|
+
detail: "offline"
|
|
118
|
+
} });
|
|
123
119
|
const errors = [];
|
|
124
120
|
host.performance.watch(() => void 0, (e) => errors.push(e))();
|
|
125
121
|
await new Promise((resolve) => setTimeout(resolve, 0));
|