zidane-ui 9.1.6 → 9.1.9
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/run-host.js +17 -20
- package/dist/adapters/server-files-host.js +3 -1
- package/dist/adapters/server-host.js +18 -11
- package/dist/adapters/server-machines-host.js +3 -1
- package/dist/adapters/server-session-host.js +2 -1
- package/dist/adapters/server-settings-accounts.js +2 -1
- package/dist/adapters/server-settings-host.js +3 -3
- package/dist/adapters/sse-host.js +9 -7
- package/dist/chat/SessionGroupHeader.js +2 -2
- package/dist/chat/SessionHostHeader.js +1 -1
- package/dist/chat/StatusDot.js +24 -20
- package/dist/chat/composer/Composer.d.ts +13 -8
- package/dist/chat/composer/Composer.js +14 -10
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/composer/HostComposer.d.ts +1 -1
- package/dist/chat/composer/HostComposer.js +7 -10
- package/dist/chat/composer/RunStatusChip.js +13 -1
- package/dist/chat/composer/attachment-ingest.d.ts +4 -1
- package/dist/chat/composer/attachment-ingest.js +27 -10
- package/dist/chat/composer/composer-bus.d.ts +9 -1
- package/dist/chat/composer/composer-bus.js +49 -6
- package/dist/chat/composer/index.d.ts +2 -2
- package/dist/chat/composer/index.js +2 -2
- package/dist/chat/composer/use-draft-target.d.ts +4 -0
- package/dist/chat/composer/use-draft-target.js +15 -4
- package/dist/chat/composer/use-send-prompt.d.ts +5 -1
- package/dist/chat/composer/use-send-prompt.js +2 -12
- package/dist/chat/headless/chip-labels.d.ts +2 -0
- package/dist/chat/headless/chip-labels.js +3 -1
- package/dist/chat/headless/composer/labels-editor.d.ts +2 -0
- package/dist/chat/headless/composer/labels-editor.js +2 -0
- package/dist/chat/headless/file-chip.d.ts +12 -13
- package/dist/chat/headless/file-chip.js +40 -2
- package/dist/chat/headless/fixture-host.js +14 -17
- package/dist/chat/headless/host.d.ts +24 -6
- package/dist/chat/headless/index.d.ts +4 -4
- package/dist/chat/headless/index.js +4 -4
- package/dist/chat/headless/labels.d.ts +16 -0
- package/dist/chat/headless/labels.js +15 -2
- package/dist/chat/headless/send-flow.d.ts +21 -4
- package/dist/chat/headless/send-flow.js +25 -6
- package/dist/chat/headless/session-list.d.ts +11 -0
- package/dist/chat/headless/sidebar/index.js +1 -1
- package/dist/chat/headless/sidebar/labels.d.ts +12 -1
- package/dist/chat/headless/transcript-host.d.ts +8 -1
- package/dist/chat/headless/transcript-labels.d.ts +2 -0
- package/dist/chat/index.d.ts +3 -3
- package/dist/chat/index.js +2 -2
- package/dist/chat/interactions/InboxPanel.js +2 -2
- package/dist/chat/interactions/QuestionField.js +2 -2
- package/dist/chat/rich-composer/RichComposer.d.ts +9 -2
- package/dist/chat/rich-composer/RichComposer.js +28 -7
- package/dist/chat/rich-composer/composer-extensions.d.ts +2 -0
- package/dist/chat/rich-composer/composer-extensions.js +2 -2
- package/dist/chat/rich-composer/composer-keys.js +1 -1
- package/dist/chat/rich-composer/use-composer-bus.js +2 -1
- package/dist/chat/rich-composer/use-composer-editor.d.ts +4 -1
- package/dist/chat/rich-composer/use-composer-editor.js +2 -1
- package/dist/chat/sidebar/SessionSidebar.js +1 -2
- package/dist/chat/sidebar/SidebarSearchRow.js +1 -1
- package/dist/chat/sidebar/useSidebarKeyboardNav.d.ts +0 -2
- package/dist/chat/sidebar/useSidebarKeyboardNav.js +7 -13
- package/dist/chat/testing/contract.d.ts +1 -1
- package/dist/chat/testing/contract.js +8 -7
- package/dist/chat/transcript/BadgeMenu.d.ts +12 -3
- package/dist/chat/transcript/BadgeMenu.js +20 -3
- package/dist/chat/transcript/CodemodeScript.js +147 -44
- package/dist/chat/transcript/EditDiffBlock.js +1 -4
- package/dist/chat/transcript/FileChip.js +60 -14
- package/dist/chat/transcript/LiveOutput.js +7 -3
- package/dist/chat/transcript/badges.js +2 -2
- package/dist/chat/transcript/index.d.ts +2 -2
- package/dist/chat/transcript/markdown-context.d.ts +4 -1
- package/dist/chat/transcript/rolling.d.ts +12 -0
- package/dist/chat/transcript/rolling.js +22 -0
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +70 -60
- package/dist/chat/transcript/tool-row.js +21 -5
- package/dist/code/editor/FileTree.d.ts +3 -1
- package/dist/code/editor/FileTree.js +29 -1
- package/dist/components/Restricted.d.ts +25 -0
- package/dist/components/Restricted.js +32 -0
- package/dist/components/StepFrame.d.ts +1 -1
- package/dist/components/ZidaneMark.d.ts +28 -0
- package/dist/components/ZidaneMark.js +114 -0
- package/dist/components/palette/PalettePanel.d.ts +7 -1
- package/dist/components/palette/PalettePanel.js +37 -11
- package/dist/components/zidane-mark.d.ts +52 -0
- package/dist/components/zidane-mark.js +94 -0
- package/dist/core.css +59 -6
- package/dist/dist/{index-DqCio7Nd.d.ts → index-Bq87OcGy.d.ts} +19 -12
- package/dist/dist/index.d.ts +1 -1
- package/dist/extensions/ExtensionSettingsSection.d.ts +18 -0
- package/dist/extensions/ExtensionSettingsSection.js +227 -0
- package/dist/extensions/headless/host.d.ts +1 -1
- package/dist/extensions/headless/labels.d.ts +41 -1
- package/dist/extensions/headless/labels.js +57 -0
- package/dist/extensions/headless/select.js +1 -2
- package/dist/extensions/index.d.ts +2 -1
- package/dist/extensions/index.js +2 -1
- package/dist/files/FilesTab.js +2 -0
- package/dist/files/TreeColumn.d.ts +5 -1
- package/dist/files/TreeColumn.js +6 -0
- package/dist/files/headless/fixture-host.js +5 -3
- package/dist/files/headless/host.d.ts +24 -6
- package/dist/files/headless/index.d.ts +2 -2
- package/dist/files/headless/labels.d.ts +1 -0
- package/dist/files/headless/labels.js +1 -0
- package/dist/files/testing/contract.js +9 -2
- package/dist/files/useWorkspace.d.ts +14 -2
- package/dist/files/useWorkspace.js +87 -9
- package/dist/git/BranchMenu.js +1 -1
- package/dist/git/MoveSessionDialog.js +1 -1
- package/dist/git/RemoteFolderPicker.js +1 -1
- package/dist/git/WherePicker.js +1 -1
- package/dist/git/headless/index.js +1 -1
- package/dist/git/useEnvironmentChoices.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/keybindings/headless/catalog.js +1 -1
- package/dist/labels.d.ts +1 -0
- package/dist/labels.js +1 -0
- package/dist/machines/DaemonMenu.js +1 -1
- package/dist/machines/HostCapabilities.d.ts +23 -1
- package/dist/machines/HostCapabilities.js +149 -65
- package/dist/machines/HostSyncPanel.js +129 -123
- package/dist/machines/HostsSection.js +5 -1
- package/dist/machines/ServerCard.d.ts +4 -2
- package/dist/machines/ServerCard.js +222 -99
- package/dist/machines/ServerMachinesPanel.js +16 -13
- package/dist/machines/ServerUpdatePanel.js +31 -21
- package/dist/machines/TokensPanel.js +75 -53
- package/dist/machines/headless/fixture-host.d.ts +5 -0
- package/dist/machines/headless/fixture-host.js +13 -4
- package/dist/machines/headless/fixtures.js +1 -1
- package/dist/machines/headless/host.d.ts +22 -2
- package/dist/machines/headless/index.d.ts +2 -2
- package/dist/machines/headless/labels.d.ts +22 -1
- package/dist/machines/headless/labels.js +22 -2
- package/dist/machines/testing/contract.d.ts +3 -1
- package/dist/machines/testing/contract.js +9 -0
- package/dist/motion/size.d.ts +22 -1
- package/dist/motion/size.js +82 -4
- package/dist/onboarding/demos/delivery.d.ts +16 -0
- package/dist/onboarding/demos/delivery.js +132 -0
- package/dist/onboarding/demos/index.d.ts +2 -1
- package/dist/onboarding/demos/index.js +2 -1
- package/dist/onboarding/headless/labels.d.ts +8 -0
- package/dist/onboarding/headless/labels.js +7 -0
- package/dist/onboarding/index.d.ts +2 -1
- package/dist/onboarding/index.js +2 -1
- package/dist/onboarding/steps/ConversationStep.js +46 -4
- package/dist/palette/CommandPalette.js +3 -0
- package/dist/palette/PaletteDialog.js +7 -3
- package/dist/palette/usePaletteController.d.ts +10 -0
- package/dist/palette/usePaletteController.js +25 -3
- package/dist/server/sse-handler.js +6 -1
- package/dist/session/ArtifactsPanel.js +1 -1
- package/dist/session/SideChat.js +1 -2
- package/dist/session/UsagePanel.js +1 -1
- package/dist/session/headless/host.d.ts +3 -1
- package/dist/session/headless/index.js +2 -2
- package/dist/settings/SettingsRestricted.d.ts +25 -0
- package/dist/settings/SettingsRestricted.js +44 -0
- package/dist/settings/SettingsRowsPage.js +31 -37
- package/dist/settings/headless/catalog.js +7 -6
- package/dist/settings/headless/labels.d.ts +4 -2
- package/dist/settings/headless/labels.js +4 -2
- package/dist/settings/headless/layout.js +1 -1
- package/dist/settings/headless/providers.d.ts +2 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +2 -2
- package/dist/settings/index.js +2 -2
- package/dist/settings/rows.d.ts +51 -8
- package/dist/settings/rows.js +81 -26
- package/dist/settings/sections/enabled-list/EnabledListSection.js +3 -2
- package/dist/settings/sections/environments/EnvironmentsSection.js +4 -3
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +2 -2
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +22 -25
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +3 -2
- package/dist/settings/sections/extensions/options-labels.d.ts +2 -2
- package/dist/settings/sections/extensions/options-labels.js +2 -2
- package/dist/settings/sections/host-catalog/HostCatalogSection.d.ts +5 -3
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +7 -4
- package/dist/settings/sections/instructions/InstructionsSection.js +24 -17
- package/dist/settings/sections/logs/LogsSection.d.ts +2 -1
- package/dist/settings/sections/logs/LogsSection.js +64 -56
- package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
- package/dist/settings/sections/mcp/McpSection.js +18 -17
- package/dist/settings/sections/models/ModelRows.d.ts +3 -3
- package/dist/settings/sections/models/ModelRows.js +8 -7
- package/dist/settings/sections/performance/PerformanceSection.js +13 -4
- package/dist/settings/sections/performance/labels.d.ts +0 -1
- package/dist/settings/sections/performance/labels.js +0 -1
- package/dist/settings/sections/providers/CredentialSources.js +18 -8
- package/dist/settings/sections/providers/ProvidersSection.d.ts +2 -2
- package/dist/settings/sections/providers/ProvidersSection.js +20 -17
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +10 -14
- package/dist/settings/sections/shared/catalog.js +3 -2
- package/dist/settings/sections/skills/SkillList.js +3 -2
- package/dist/settings/testing/accounts-demo.js +1 -0
- package/dist/settings/testing/accounts.contract.js +2 -0
- package/dist/styles.css +160 -24
- package/dist/terminal/HostTerminalSurface.js +1 -1
- package/dist/terminal/headless/links.d.ts +19 -1
- package/dist/terminal/headless/links.js +26 -2
- package/dist/theme/css-vars.js +1 -0
- package/dist/theme/derive.d.ts +4 -0
- package/dist/theme/derive.js +2 -0
- package/dist/workspace/PanelContentView.js +1 -1
- package/dist/workspace/PanelHome.d.ts +3 -1
- package/dist/workspace/PanelHome.js +4 -3
- package/dist/workspace/SidePanel.d.ts +3 -1
- package/dist/workspace/SidePanel.js +3 -2
- package/dist/workspace/headless/open-target.d.ts +1 -1
- package/dist/workspace/headless/open-target.js +2 -2
- package/package.json +2 -2
- package/src/styles/chat.css +10 -10
- package/src/styles/motion.css +37 -0
- package/src/styles/primitives.css +11 -3
- package/src/styles/sidebar.css +12 -0
- package/src/styles/tokens.css +6 -0
- package/src/styles/transcript.css +69 -5
package/dist/settings/rows.d.ts
CHANGED
|
@@ -34,8 +34,8 @@ interface ChoiceRowProps {
|
|
|
34
34
|
row: SettingsChoice;
|
|
35
35
|
/** The setting's value: the option it names is shown. */
|
|
36
36
|
value: unknown;
|
|
37
|
-
/**
|
|
38
|
-
|
|
37
|
+
/** An option was picked (not called for the current one). */
|
|
38
|
+
onChange: (value: SettingsChoice['options'][number]['value']) => void;
|
|
39
39
|
/** Read-only here: inert, its value shown. */
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
/** Why the host can't apply the setting: the row is inert, shows it as unavailable, and this note replaces its description. */
|
|
@@ -46,11 +46,54 @@ interface ChoiceRowProps {
|
|
|
46
46
|
style?: CSSProperties;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* A catalog choice as a row:
|
|
49
|
+
* A catalog choice as a row: a press opens a menu of its options.
|
|
50
50
|
*
|
|
51
|
-
* @param props - The choice, its value, what
|
|
51
|
+
* @param props - The choice, its value, what sets it and why it may be unavailable.
|
|
52
52
|
*/
|
|
53
|
-
declare function ChoiceRow({ row, value,
|
|
53
|
+
declare function ChoiceRow({ row, value, onChange, disabled, unavailable, className, style }: ChoiceRowProps): import("react").JSX.Element;
|
|
54
|
+
/** One option of a {@link SelectRow}. */
|
|
55
|
+
interface SelectRowOption<T> {
|
|
56
|
+
/** The value it sets. */
|
|
57
|
+
value: T;
|
|
58
|
+
/** Its label, in the menu and the value chip. */
|
|
59
|
+
label: string;
|
|
60
|
+
/** What it does, under its label in the menu. */
|
|
61
|
+
description?: string;
|
|
62
|
+
/** A glyph class (`i-ph-hand`), before its label in the menu and the chip. */
|
|
63
|
+
icon?: string;
|
|
64
|
+
/** Offered but not pickable now. */
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
/** The option's tooltip (why it is disabled). */
|
|
67
|
+
hint?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Props for {@link SelectRow}. */
|
|
70
|
+
interface SelectRowProps<T> {
|
|
71
|
+
/** The row's label, also the menu's name. */
|
|
72
|
+
label: string;
|
|
73
|
+
/** The row's description. */
|
|
74
|
+
description?: ReactNode;
|
|
75
|
+
/** The value now: its option is checked and named on the chip. */
|
|
76
|
+
value: T;
|
|
77
|
+
/** The options, in menu order. */
|
|
78
|
+
options: readonly SelectRowOption<T>[];
|
|
79
|
+
/** An option was picked (not called for the current one). */
|
|
80
|
+
onChange: (value: T) => void;
|
|
81
|
+
/** Read-only here: inert, its value shown. @default false */
|
|
82
|
+
disabled?: boolean | undefined;
|
|
83
|
+
/** Why the host can't apply the setting: the row is inert, shows it as unavailable, and this note replaces its description. */
|
|
84
|
+
unavailable?: string | undefined;
|
|
85
|
+
/** Classes merged on the row's button. */
|
|
86
|
+
className?: string | undefined;
|
|
87
|
+
/** Inline styles on the row's button. */
|
|
88
|
+
style?: CSSProperties | undefined;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A row whose value chip opens a menu of options: the current one checked, each with its icon,
|
|
92
|
+
* description and why it may be disabled.
|
|
93
|
+
*
|
|
94
|
+
* @param props - The row's text, its value and options, what sets it and why it may be inert.
|
|
95
|
+
*/
|
|
96
|
+
declare function SelectRow<T>({ label, description, value, options, onChange, disabled, unavailable, className, style }: SelectRowProps<T>): import("react").JSX.Element;
|
|
54
97
|
/** Props for {@link ValueChip}. */
|
|
55
98
|
interface ValueChipProps {
|
|
56
99
|
/** It names a default left unset ("last used", "automatic (Haiku)") or an unavailable setting. @default false */
|
|
@@ -65,12 +108,12 @@ interface ValueChipProps {
|
|
|
65
108
|
children: ReactNode;
|
|
66
109
|
}
|
|
67
110
|
/**
|
|
68
|
-
* The value of a row that picks
|
|
69
|
-
*
|
|
111
|
+
* The value of a row that picks one (a choice, a model, an agent): the
|
|
112
|
+
* caret says it opens a menu. Muted while it names a default or an
|
|
70
113
|
* unavailable setting.
|
|
71
114
|
*
|
|
72
115
|
* @param props - The value, muted or not, and its tooltip.
|
|
73
116
|
*/
|
|
74
117
|
declare function ValueChip({ muted, title, className, style, children }: ValueChipProps): import("react").JSX.Element;
|
|
75
118
|
//#endregion
|
|
76
|
-
export { ChoiceRow, ChoiceRowProps, ToggleRow, ToggleRowProps, ValueChip, ValueChipProps };
|
|
119
|
+
export { ChoiceRow, ChoiceRowProps, SelectRow, SelectRowOption, SelectRowProps, ToggleRow, ToggleRowProps, ValueChip, ValueChipProps };
|
package/dist/settings/rows.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { MetaChip, ROW_BUTTON_CLASS, RowText, Switch } from "../components/Form.js";
|
|
2
|
+
import { Menu, MenuRow } from "../components/Menu.js";
|
|
3
|
+
import { Popover } from "../components/floating/Popover.js";
|
|
2
4
|
import { useSettingsLabels } from "./SettingsProvider.js";
|
|
3
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
6
|
//#region src/settings/rows.tsx
|
|
@@ -33,39 +35,92 @@ function ToggleRow(props) {
|
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
37
|
/**
|
|
36
|
-
* A catalog choice as a row:
|
|
38
|
+
* A catalog choice as a row: a press opens a menu of its options.
|
|
37
39
|
*
|
|
38
|
-
* @param props - The choice, its value, what
|
|
40
|
+
* @param props - The choice, its value, what sets it and why it may be unavailable.
|
|
39
41
|
*/
|
|
40
|
-
function ChoiceRow({ row, value,
|
|
42
|
+
function ChoiceRow({ row, value, onChange, disabled, unavailable, className, style }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(SelectRow, {
|
|
44
|
+
label: row.label,
|
|
45
|
+
description: row.description,
|
|
46
|
+
value,
|
|
47
|
+
options: row.options,
|
|
48
|
+
onChange,
|
|
49
|
+
disabled,
|
|
50
|
+
unavailable,
|
|
51
|
+
className,
|
|
52
|
+
style
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A row whose value chip opens a menu of options: the current one checked, each with its icon,
|
|
57
|
+
* description and why it may be disabled.
|
|
58
|
+
*
|
|
59
|
+
* @param props - The row's text, its value and options, what sets it and why it may be inert.
|
|
60
|
+
*/
|
|
61
|
+
function SelectRow({ label, description, value, options, onChange, disabled = false, unavailable, className, style }) {
|
|
41
62
|
const labels = useSettingsLabels();
|
|
42
|
-
const current =
|
|
63
|
+
const current = options.find((opt) => opt.value === value);
|
|
43
64
|
const blocked = unavailable !== void 0;
|
|
44
65
|
const inert = blocked || disabled;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
const described = options.some((opt) => opt.description);
|
|
67
|
+
return /* @__PURE__ */ jsx(Popover, {
|
|
68
|
+
role: "menu",
|
|
69
|
+
ariaLabel: label,
|
|
70
|
+
side: "bottom",
|
|
71
|
+
align: "end",
|
|
72
|
+
...described ? { width: 320 } : {},
|
|
73
|
+
trigger: (props) => /* @__PURE__ */ jsxs("button", {
|
|
74
|
+
type: "button",
|
|
75
|
+
...props,
|
|
76
|
+
onClick: inert ? void 0 : props.onClick,
|
|
77
|
+
disabled: inert || void 0,
|
|
78
|
+
"aria-disabled": blocked || void 0,
|
|
79
|
+
className: [
|
|
80
|
+
ROW_BUTTON_CLASS,
|
|
81
|
+
blocked ? "!cursor-not-allowed" : "",
|
|
82
|
+
className
|
|
83
|
+
].filter(Boolean).join(" "),
|
|
84
|
+
style,
|
|
85
|
+
children: [/* @__PURE__ */ jsx(RowText, {
|
|
86
|
+
label,
|
|
87
|
+
description: unavailable ?? description,
|
|
88
|
+
truncate: false
|
|
89
|
+
}), /* @__PURE__ */ jsxs(ValueChip, {
|
|
90
|
+
muted: blocked,
|
|
91
|
+
children: [!blocked && current?.icon && /* @__PURE__ */ jsx("span", {
|
|
92
|
+
"aria-hidden": true,
|
|
93
|
+
className: `${current.icon} shrink-0`
|
|
94
|
+
}), blocked ? labels.settingsUnavailable : current?.label ?? String(value)]
|
|
95
|
+
})]
|
|
96
|
+
}),
|
|
97
|
+
children: (close) => /* @__PURE__ */ jsx(Menu, {
|
|
98
|
+
role: "group",
|
|
99
|
+
children: options.map((opt) => /* @__PURE__ */ jsx(MenuRow, {
|
|
100
|
+
role: "menuitemradio",
|
|
101
|
+
checked: opt.value === value,
|
|
102
|
+
disabled: opt.disabled,
|
|
103
|
+
...opt.hint ? { hint: opt.hint } : {},
|
|
104
|
+
...opt.icon ? { icon: /* @__PURE__ */ jsx("span", {
|
|
105
|
+
"aria-hidden": true,
|
|
106
|
+
className: opt.icon
|
|
107
|
+
}) } : {},
|
|
108
|
+
title: opt.label,
|
|
109
|
+
...opt.description ? {
|
|
110
|
+
description: opt.description,
|
|
111
|
+
size: "lg"
|
|
112
|
+
} : {},
|
|
113
|
+
onClick: () => {
|
|
114
|
+
close();
|
|
115
|
+
if (opt.value !== value) onChange(opt.value);
|
|
116
|
+
}
|
|
117
|
+
}, String(opt.value)))
|
|
118
|
+
})
|
|
64
119
|
});
|
|
65
120
|
}
|
|
66
121
|
/**
|
|
67
|
-
* The value of a row that picks
|
|
68
|
-
*
|
|
122
|
+
* The value of a row that picks one (a choice, a model, an agent): the
|
|
123
|
+
* caret says it opens a menu. Muted while it names a default or an
|
|
69
124
|
* unavailable setting.
|
|
70
125
|
*
|
|
71
126
|
* @param props - The value, muted or not, and its tooltip.
|
|
@@ -86,4 +141,4 @@ function ValueChip({ muted = false, title, className, style, children }) {
|
|
|
86
141
|
});
|
|
87
142
|
}
|
|
88
143
|
//#endregion
|
|
89
|
-
export { ChoiceRow, ToggleRow, ValueChip };
|
|
144
|
+
export { ChoiceRow, SelectRow, ToggleRow, ValueChip };
|
|
@@ -2,6 +2,7 @@ import { Checkbox, FormSection, ROW_BUTTON_CLASS, RowText } from "../../../compo
|
|
|
2
2
|
import { useSettingsWritable } from "../../SettingsProvider.js";
|
|
3
3
|
import { SettingsPanel, SettingsPanelBody } from "../../section.js";
|
|
4
4
|
import { useSectionLabels } from "../use-section-labels.js";
|
|
5
|
+
import { SettingsRestricted } from "../../SettingsRestricted.js";
|
|
5
6
|
import { useSettingsValues, useWriteSetting } from "../shared/catalog.js";
|
|
6
7
|
import { DEFAULT_ENABLED_LIST_SECTION_LABELS } from "./labels.js";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -50,7 +51,7 @@ function EnabledListSection({ settingKey, hostName, className, style }) {
|
|
|
50
51
|
return /* @__PURE__ */ jsx(SettingsPanel, {
|
|
51
52
|
className,
|
|
52
53
|
style,
|
|
53
|
-
children: /* @__PURE__ */ jsxs(SettingsPanelBody, { children: [/* @__PURE__ */ jsxs(FormSection, {
|
|
54
|
+
children: /* @__PURE__ */ jsxs(SettingsPanelBody, { children: [/* @__PURE__ */ jsx(SettingsRestricted, { children: /* @__PURE__ */ jsxs(FormSection, {
|
|
54
55
|
title: l.enabledListTitle(hostName),
|
|
55
56
|
children: [entries.length === 0 && /* @__PURE__ */ jsx("p", {
|
|
56
57
|
className: "text-xs text-[var(--zg-text-muted)] px-3 py-2 m-0",
|
|
@@ -72,7 +73,7 @@ function EnabledListSection({ settingKey, hostName, className, style }) {
|
|
|
72
73
|
}, name);
|
|
73
74
|
})
|
|
74
75
|
})]
|
|
75
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
76
|
+
}) }), /* @__PURE__ */ jsx("p", {
|
|
76
77
|
className: "text-xs text-[var(--zg-text-muted)] px-1 mt-3 mb-0 zg-pretty",
|
|
77
78
|
children: l.enabledListNote(noun)
|
|
78
79
|
})] })
|
|
@@ -2,13 +2,14 @@ import { BTN_SECONDARY } from "../../../components/button.js";
|
|
|
2
2
|
import { Segmented } from "../../../components/Segmented.js";
|
|
3
3
|
import { ErrorNote, FormCard, FormSection, INPUT_CLASS as INPUT_CLASS$1, MetaChip, RowText, Switch } from "../../../components/Form.js";
|
|
4
4
|
import { constant, useReadable } from "../../../chat/headless/store.js";
|
|
5
|
+
import { environmentKindIcon } from "../../../git/headless/environment.js";
|
|
5
6
|
import { toSettingsError } from "../../headless/host.js";
|
|
6
7
|
import { useMachinesHost } from "../../../machines/MachinesProvider.js";
|
|
7
8
|
import { useSettingsHost } from "../../SettingsProvider.js";
|
|
8
9
|
import { HostBadge } from "../../../chat/HostBadge.js";
|
|
9
|
-
import { environmentKindIcon } from "../../../git/headless/environment.js";
|
|
10
10
|
import { SettingsPanel, SettingsPanelBody, useSettingsSection } from "../../section.js";
|
|
11
11
|
import { useSectionLabels } from "../use-section-labels.js";
|
|
12
|
+
import { SettingsRestricted } from "../../SettingsRestricted.js";
|
|
12
13
|
import { useCatalogSharedLabels, useSettingsValues } from "../shared/catalog.js";
|
|
13
14
|
import { SettingsTutorial } from "../../SettingsTutorial.js";
|
|
14
15
|
import { hostSettingsFocus } from "../../../machines/headless/settings-focus.js";
|
|
@@ -107,7 +108,7 @@ function EnvironmentsSection({ cwd, className, style }) {
|
|
|
107
108
|
children: shared.catalogError(error)
|
|
108
109
|
})]
|
|
109
110
|
}) }),
|
|
110
|
-
/* @__PURE__ */ jsx(FormSection, { children: /* @__PURE__ */ jsxs("div", {
|
|
111
|
+
/* @__PURE__ */ jsx(SettingsRestricted, { children: /* @__PURE__ */ jsx(FormSection, { children: /* @__PURE__ */ jsxs("div", {
|
|
111
112
|
className: "flex flex-col items-start gap-3 px-3 py-3",
|
|
112
113
|
children: [/* @__PURE__ */ jsx(RowText, {
|
|
113
114
|
label: l.environmentsSectionDefault,
|
|
@@ -128,7 +129,7 @@ function EnvironmentsSection({ cwd, className, style }) {
|
|
|
128
129
|
ariaLabel: l.environmentsSectionDefault,
|
|
129
130
|
className: "max-w-full overflow-x-auto"
|
|
130
131
|
})]
|
|
131
|
-
}) }),
|
|
132
|
+
}) }) }),
|
|
132
133
|
/* @__PURE__ */ jsx(FormSection, {
|
|
133
134
|
layout: "cards",
|
|
134
135
|
children: descriptors.map((descriptor) => /* @__PURE__ */ jsx(EnvironmentCard, {
|
|
@@ -22,8 +22,8 @@ interface ExtensionActionRowProps {
|
|
|
22
22
|
busy?: boolean;
|
|
23
23
|
/** The button is off (another row's run is going). */
|
|
24
24
|
disabled?: boolean;
|
|
25
|
-
/** The token scope this client lacks to run it: the button is off,
|
|
26
|
-
needsScope?: 'chat' | '
|
|
25
|
+
/** The token scope this client lacks to run it: the button is off, restricted ("Admin only"). */
|
|
26
|
+
needsScope?: 'chat' | 'admin' | null;
|
|
27
27
|
/** Runs the action (the Run button). */
|
|
28
28
|
onRun(): void;
|
|
29
29
|
}
|
|
@@ -2,6 +2,7 @@ import { IconButton } from "../../../components/IconButton.js";
|
|
|
2
2
|
import { BTN_SECONDARY } from "../../../components/button.js";
|
|
3
3
|
import { HostRow, INPUT_CLASS, MetaChip, ROW_BUTTON_CLASS, ROW_CLASS, RowText, Switch } from "../../../components/Form.js";
|
|
4
4
|
import { SegmentSpinner } from "../../../components/SegmentSpinner.js";
|
|
5
|
+
import { Restricted } from "../../../components/Restricted.js";
|
|
5
6
|
import { useComposerModelName } from "../../../chat/composer/use-composer-stores.js";
|
|
6
7
|
import { useSectionLabels } from "../use-section-labels.js";
|
|
7
8
|
import { ModelListPicker } from "../models/ModelListPicker.js";
|
|
@@ -36,35 +37,31 @@ function useExtensionOptionsLabels() {
|
|
|
36
37
|
*/
|
|
37
38
|
function ExtensionActionRow({ label, description, status, busy, disabled, needsScope, onRun }) {
|
|
38
39
|
const l = useExtensionOptionsLabels();
|
|
39
|
-
const hint = needsScope ? l.extensionOptionsNeedsScope(needsScope) : void 0;
|
|
40
40
|
return /* @__PURE__ */ jsxs("div", {
|
|
41
41
|
className: ROW_CLASS,
|
|
42
42
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
43
43
|
className: "flex-1 min-w-0",
|
|
44
|
-
children: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
status
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
size: "xs",
|
|
66
|
-
label: l.extensionOptionsRunning
|
|
67
|
-
}), l.extensionOptionsRunning] }) : l.extensionOptionsRun
|
|
44
|
+
children: [/* @__PURE__ */ jsx(RowText, {
|
|
45
|
+
label,
|
|
46
|
+
description
|
|
47
|
+
}), status?.text && /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: `text-xs break-words ${status.error ? "text-zg-danger" : "text-[var(--zg-text-muted)]"}`,
|
|
49
|
+
children: status.text
|
|
50
|
+
})]
|
|
51
|
+
}), /* @__PURE__ */ jsx(Restricted, {
|
|
52
|
+
restricted: Boolean(needsScope),
|
|
53
|
+
reason: l.extensionOptionsAdminOnly,
|
|
54
|
+
inline: true,
|
|
55
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: onRun,
|
|
58
|
+
disabled: disabled || busy || Boolean(needsScope),
|
|
59
|
+
className: BTN_SECONDARY,
|
|
60
|
+
children: busy ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SegmentSpinner, {
|
|
61
|
+
size: "xs",
|
|
62
|
+
label: l.extensionOptionsRunning
|
|
63
|
+
}), l.extensionOptionsRunning] }) : l.extensionOptionsRun
|
|
64
|
+
})
|
|
68
65
|
})]
|
|
69
66
|
});
|
|
70
67
|
}
|
|
@@ -3,6 +3,7 @@ import { LoadError } from "../../../components/LoadError.js";
|
|
|
3
3
|
import { useSettings, useSettingsHost } from "../../SettingsProvider.js";
|
|
4
4
|
import { useModelCatalog } from "../../../chat/composer/use-composer-stores.js";
|
|
5
5
|
import { ExtensionActionRow, ExtensionConfigRow, extensionConfigValue, useExtensionOptionsLabels } from "./ExtensionConfigRows.js";
|
|
6
|
+
import { SettingsRestricted } from "../../SettingsRestricted.js";
|
|
6
7
|
import { useSettingsResource } from "../shared/catalog.js";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -226,13 +227,13 @@ function ExtensionOptionRows({ schema, actions, values, cwd, visible, onWrite, o
|
|
|
226
227
|
className: "text-xs font-medium text-[var(--zg-text-muted)] px-3 pt-2.5 pb-0.5",
|
|
227
228
|
children: cat.label
|
|
228
229
|
}),
|
|
229
|
-
cat.items.map((item) => /* @__PURE__ */ jsx(ExtensionConfigRow, {
|
|
230
|
+
cat.items.length > 0 && /* @__PURE__ */ jsx(SettingsRestricted, { children: /* @__PURE__ */ jsx("div", { children: cat.items.map((item) => /* @__PURE__ */ jsx(ExtensionConfigRow, {
|
|
230
231
|
item,
|
|
231
232
|
value: extensionConfigValue(item, values?.[group.ext]?.[item.key]),
|
|
232
233
|
modelCatalog,
|
|
233
234
|
modelCatalogFailed,
|
|
234
235
|
onWrite: (v) => onWrite(group.ext, item.key, v)
|
|
235
|
-
}, `${group.ext}:${item.key}`)),
|
|
236
|
+
}, `${group.ext}:${item.key}`)) }) }),
|
|
236
237
|
runAction && cat.actions.map((action) => /* @__PURE__ */ jsx(ExtensionActionRow, {
|
|
237
238
|
label: action.label,
|
|
238
239
|
...action.description ? { description: action.description } : {},
|
|
@@ -6,8 +6,8 @@ declare const DEFAULT_EXTENSION_OPTIONS_LABELS: {
|
|
|
6
6
|
extensionOptionsRun: string;
|
|
7
7
|
/** An action row's Run button while it runs. */
|
|
8
8
|
extensionOptionsRunning: string;
|
|
9
|
-
/** An action row this client's token may not run:
|
|
10
|
-
|
|
9
|
+
/** An action row this client's token may not run: its Run button's tooltip and name. */
|
|
10
|
+
extensionOptionsAdminOnly: string;
|
|
11
11
|
/** An action row's status while it runs. */
|
|
12
12
|
extensionOptionsRunningStatus: string;
|
|
13
13
|
/** A model option with nothing picked. */
|
|
@@ -5,8 +5,8 @@ const DEFAULT_EXTENSION_OPTIONS_LABELS = {
|
|
|
5
5
|
extensionOptionsRun: "Run",
|
|
6
6
|
/** An action row's Run button while it runs. */
|
|
7
7
|
extensionOptionsRunning: "Running",
|
|
8
|
-
/** An action row this client's token may not run:
|
|
9
|
-
|
|
8
|
+
/** An action row this client's token may not run: its Run button's tooltip and name. */
|
|
9
|
+
extensionOptionsAdminOnly: "Admin only",
|
|
10
10
|
/** An action row's status while it runs. */
|
|
11
11
|
extensionOptionsRunningStatus: "running…",
|
|
12
12
|
/** A model option with nothing picked. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SettingsCatalogKind } from "../../headless/sections-host.js";
|
|
2
2
|
import { HostCatalogLabels } from "./labels.js";
|
|
3
|
-
import { CSSProperties } from "react";
|
|
3
|
+
import { CSSProperties, ReactNode } from "react";
|
|
4
4
|
//#region src/settings/sections/host-catalog/HostCatalogSection.d.ts
|
|
5
5
|
/** The host catalog section's strings, overridable through `LabelsProvider`. */
|
|
6
6
|
declare function useHostCatalogLabels(): HostCatalogLabels;
|
|
@@ -14,6 +14,8 @@ interface HostCatalogSectionProps {
|
|
|
14
14
|
hostName: string;
|
|
15
15
|
/** The session's folder on the host (adds its project scope); absent: the host user's scope. */
|
|
16
16
|
cwd?: string | null;
|
|
17
|
+
/** Under the extensions list, in the same scroll (the extensions' settings, as on This computer's page). */
|
|
18
|
+
children?: ReactNode;
|
|
17
19
|
/** Extra classes on the root. */
|
|
18
20
|
className?: string;
|
|
19
21
|
/** Inline styles on the root. */
|
|
@@ -22,8 +24,8 @@ interface HostCatalogSectionProps {
|
|
|
22
24
|
/**
|
|
23
25
|
* Renders one catalog of the nearest `SettingsProvider`'s host, as the host reports it.
|
|
24
26
|
*
|
|
25
|
-
* @param props - The kind, the host's name, the folder there, `className` and `style`.
|
|
27
|
+
* @param props - The kind, the host's name, the folder there, `children` (extensions), `className` and `style`.
|
|
26
28
|
*/
|
|
27
|
-
declare function HostCatalogSection({ kind, hostName, cwd, className, style }: HostCatalogSectionProps): import("react").JSX.Element | null;
|
|
29
|
+
declare function HostCatalogSection({ kind, hostName, cwd, children, className, style }: HostCatalogSectionProps): import("react").JSX.Element | null;
|
|
28
30
|
//#endregion
|
|
29
31
|
export { HostCatalogSection, HostCatalogSectionKind, HostCatalogSectionProps, useHostCatalogLabels };
|
|
@@ -5,6 +5,7 @@ import { toSettingsError } from "../../headless/host.js";
|
|
|
5
5
|
import { useSettingsHost } from "../../SettingsProvider.js";
|
|
6
6
|
import { SettingsPanel, SettingsPanelActions, SettingsPanelBody } from "../../section.js";
|
|
7
7
|
import { useSectionLabels } from "../use-section-labels.js";
|
|
8
|
+
import { useSettingsRestricted } from "../../SettingsRestricted.js";
|
|
8
9
|
import { useCatalogSharedLabels } from "../shared/catalog.js";
|
|
9
10
|
import { SettingsTutorial } from "../../SettingsTutorial.js";
|
|
10
11
|
import { useChangeOriginLayer } from "../extensions/ChangeOriginDialog.js";
|
|
@@ -81,9 +82,9 @@ const rejectedOff = (plugin) => plugin.ok ? void 0 : false;
|
|
|
81
82
|
/**
|
|
82
83
|
* Renders one catalog of the nearest `SettingsProvider`'s host, as the host reports it.
|
|
83
84
|
*
|
|
84
|
-
* @param props - The kind, the host's name, the folder there, `className` and `style`.
|
|
85
|
+
* @param props - The kind, the host's name, the folder there, `children` (extensions), `className` and `style`.
|
|
85
86
|
*/
|
|
86
|
-
function HostCatalogSection({ kind, hostName, cwd, className, style }) {
|
|
87
|
+
function HostCatalogSection({ kind, hostName, cwd, children, className, style }) {
|
|
87
88
|
const catalog = useSettingsHost().hostCatalog;
|
|
88
89
|
const l = useHostCatalogLabels();
|
|
89
90
|
const shared = useCatalogSharedLabels();
|
|
@@ -101,6 +102,7 @@ function HostCatalogSection({ kind, hostName, cwd, className, style }) {
|
|
|
101
102
|
const extensionLabels = useExtensionsSectionLabels();
|
|
102
103
|
const [picks, setPicks, togglePicks] = useExtensionPicks();
|
|
103
104
|
const [installing, setInstalling] = useState(false);
|
|
105
|
+
const restricted = useSettingsRestricted();
|
|
104
106
|
useEffect(() => {
|
|
105
107
|
if (!catalog) return void 0;
|
|
106
108
|
let cancelled = false;
|
|
@@ -209,7 +211,7 @@ function HostCatalogSection({ kind, hostName, cwd, className, style }) {
|
|
|
209
211
|
return done;
|
|
210
212
|
};
|
|
211
213
|
const notes = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
212
|
-
!installs && installKind && /* @__PURE__ */ jsx("p", {
|
|
214
|
+
!installs && installKind && !restricted && /* @__PURE__ */ jsx("p", {
|
|
213
215
|
className: "text-xs text-[var(--zg-text-muted)] px-1 m-0 zg-pretty",
|
|
214
216
|
children: l.hostCatalogNoInstalls(hostName)
|
|
215
217
|
}),
|
|
@@ -296,7 +298,8 @@ function HostCatalogSection({ kind, hostName, cwd, className, style }) {
|
|
|
296
298
|
}) : null;
|
|
297
299
|
},
|
|
298
300
|
emptyMessage: l.hostCatalogEmpty(hostName, kind)
|
|
299
|
-
})
|
|
301
|
+
}),
|
|
302
|
+
children
|
|
300
303
|
]
|
|
301
304
|
});
|
|
302
305
|
else body = /* @__PURE__ */ jsxs("div", {
|
|
@@ -7,6 +7,7 @@ import { useSettingsHost } from "../../SettingsProvider.js";
|
|
|
7
7
|
import { Markdown } from "../../../chat/transcript/markdown.js";
|
|
8
8
|
import { SettingsPanel, SettingsPanelBody } from "../../section.js";
|
|
9
9
|
import { useSectionLabels } from "../use-section-labels.js";
|
|
10
|
+
import { SettingsRestricted } from "../../SettingsRestricted.js";
|
|
10
11
|
import { OpenFileButton, RevealPathButton, useCatalogSharedLabels } from "../shared/catalog.js";
|
|
11
12
|
import { SettingsTutorial } from "../../SettingsTutorial.js";
|
|
12
13
|
import { formatTokens } from "../../../session/headless/usage-format.js";
|
|
@@ -131,16 +132,19 @@ function InstructionsSection({ sessionId, localFiles = true, renderMarkdown = re
|
|
|
131
132
|
/* @__PURE__ */ jsx(SettingsTutorial, {
|
|
132
133
|
topic: "instructions",
|
|
133
134
|
className: "mb-3",
|
|
134
|
-
actions: editPrompt && /* @__PURE__ */ jsx(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
actions: editPrompt && /* @__PURE__ */ jsx(SettingsRestricted, {
|
|
136
|
+
inline: true,
|
|
137
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
138
|
+
type: "button",
|
|
139
|
+
disabled: busy,
|
|
140
|
+
title: editPrompt.title,
|
|
141
|
+
onClick: editPrompt.run,
|
|
142
|
+
className: buttonClass({
|
|
143
|
+
variant: "secondary",
|
|
144
|
+
size: "sm"
|
|
145
|
+
}),
|
|
146
|
+
children: l.instructionsSectionEditPrompt
|
|
147
|
+
})
|
|
144
148
|
})
|
|
145
149
|
}),
|
|
146
150
|
state.kind === "none" && /* @__PURE__ */ jsx(EmptyState, { title: l.instructionsSectionNoSession }),
|
|
@@ -258,13 +262,16 @@ function ContextSegmentRow({ segment, expanded, total, onToggle, onOpen, canReve
|
|
|
258
262
|
}), /* @__PURE__ */ jsxs("div", {
|
|
259
263
|
className: "shrink-0 flex items-center gap-0.5 -my-0.5",
|
|
260
264
|
children: [
|
|
261
|
-
override?.canCreate && onCreateOverride && /* @__PURE__ */ jsx(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
override?.canCreate && onCreateOverride && /* @__PURE__ */ jsx(SettingsRestricted, {
|
|
266
|
+
inline: true,
|
|
267
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
268
|
+
type: "button",
|
|
269
|
+
className: BTN_SECONDARY,
|
|
270
|
+
disabled: busy,
|
|
271
|
+
onClick: onCreateOverride,
|
|
272
|
+
title: l.instructionsSectionCreateOverrideTitle,
|
|
273
|
+
children: busy ? l.instructionsSectionCreating : l.instructionsSectionCreate
|
|
274
|
+
})
|
|
268
275
|
}),
|
|
269
276
|
onOpen && segment.path && /* @__PURE__ */ jsx(OpenFileButton, {
|
|
270
277
|
path: segment.path,
|
|
@@ -11,7 +11,8 @@ interface LogsSectionProps {
|
|
|
11
11
|
style?: CSSProperties;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Renders the log records of the nearest `SettingsProvider`'s host, filtered by level and text.
|
|
14
|
+
* Renders the log records of the nearest `SettingsProvider`'s host, filtered by level and text. A connection
|
|
15
|
+
* that may not write gets no `logs` (reading them is admin-only too): the frame shows, restricted and empty.
|
|
15
16
|
*
|
|
16
17
|
* @param props - `className` and `style`.
|
|
17
18
|
*/
|