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
package/dist/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as AuthFailureKind, u as AuthFailure } from "./timeout-
|
|
1
|
+
import { d as AuthFailureKind, u as AuthFailure } from "./timeout-Cz9dRF8Q.js";
|
|
2
2
|
import "./types-2HrgolQz.js";
|
|
3
3
|
import "./oauth-callback-page-DMxIgurj.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Ab as SessionQueryAll, Cb as SessionFieldName, Db as SessionGroupOrder, Eb as SessionGroupBy, Fb as SessionQueryNot, Lb as SessionSort, Sb as SessionCondition, bb as QueryBound, jb as SessionQueryAny, kb as SessionQuery, rz as ThinkingLevel, wb as SessionFieldPath, xb as QueryValue, yb as FacetPath } from "./index-C6rzc-tt.js";
|
|
5
5
|
import "./index-f-XWIoYo.js";
|
|
6
6
|
import "./sandbox-B4OW6oNx.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { constant, useReadable } from "../chat/headless/store.js";
|
|
2
|
-
import { extensionsErrorOf } from "./headless/host.js";
|
|
3
2
|
import { useExtensionsLabels } from "./useExtensionsLabels.js";
|
|
4
3
|
import { ExtensionComponent } from "./ExtensionComponent.js";
|
|
5
4
|
import { useExtensionItems, useExtensionsHost } from "./ExtensionsProvider.js";
|
|
5
|
+
import { extensionsErrorOf } from "./headless/host.js";
|
|
6
6
|
import { settingsValues } from "./headless/select.js";
|
|
7
7
|
import { SettingsWireForm } from "./SettingsWireForm.js";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -17,7 +17,6 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
17
17
|
* `invoke('setting.action')`. Without `settings.set` the rows are read-only.
|
|
18
18
|
*/
|
|
19
19
|
const NO_SETTINGS = constant(null);
|
|
20
|
-
const NOT_LIMITED = constant(null);
|
|
21
20
|
/**
|
|
22
21
|
* Draws one extension settings page. Draws nothing when no extension offers `id`.
|
|
23
22
|
*
|
|
@@ -28,7 +27,6 @@ function ExtensionSettingsPage({ id, className, style }) {
|
|
|
28
27
|
const labels = useExtensionsLabels();
|
|
29
28
|
const entry = useExtensionItems("settings-page").find((e) => e.item.id === id);
|
|
30
29
|
const live = useReadable(host?.settings?.wire ?? NO_SETTINGS);
|
|
31
|
-
const scope = useReadable(host?.scope ?? NOT_LIMITED);
|
|
32
30
|
const [errors, setErrors] = useState({});
|
|
33
31
|
const [actions, setActions] = useState({});
|
|
34
32
|
const schema = entry?.item.schema;
|
|
@@ -98,8 +96,7 @@ function ExtensionSettingsPage({ id, className, style }) {
|
|
|
98
96
|
onChange,
|
|
99
97
|
onRunAction: invoke ? onRunAction : void 0,
|
|
100
98
|
actionStates: actions,
|
|
101
|
-
errors
|
|
102
|
-
scope
|
|
99
|
+
errors
|
|
103
100
|
}) : null;
|
|
104
101
|
return /* @__PURE__ */ jsx("div", {
|
|
105
102
|
className,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Notice } from "../components/Notice.js";
|
|
1
2
|
import { useReadable } from "../chat/headless/store.js";
|
|
2
|
-
import { extensionsErrorOf } from "./headless/host.js";
|
|
3
3
|
import { useExtensionsLabels } from "./useExtensionsLabels.js";
|
|
4
4
|
import { useExtensionsHost } from "./ExtensionsProvider.js";
|
|
5
|
+
import { extensionsErrorOf } from "./headless/host.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
//#region src/extensions/ExtensionSettingsSection.tsx
|
|
@@ -133,9 +134,9 @@ function IntegrationRow({ integration }) {
|
|
|
133
134
|
onClick: () => run(() => host?.integrations?.connect(integration.id, { methodId: method.id })),
|
|
134
135
|
children: connected ? l.extensionIntegrationAddAccountWith(method.label) : method.label
|
|
135
136
|
}, method.id)),
|
|
136
|
-
error && /* @__PURE__ */ jsx(
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
138
|
+
tone: "error",
|
|
139
|
+
compact: true,
|
|
139
140
|
children: error
|
|
140
141
|
})
|
|
141
142
|
]
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Tray } from "../components/Surface.js";
|
|
2
2
|
import { ROW_BUTTON_CLASS, RowText } from "../components/Form.js";
|
|
3
3
|
import { constant, useReadable } from "../chat/headless/store.js";
|
|
4
|
-
import { extensionsErrorOf } from "./headless/host.js";
|
|
5
4
|
import { useExtensionsLabels } from "./useExtensionsLabels.js";
|
|
6
5
|
import { useExtensionsHost } from "./ExtensionsProvider.js";
|
|
6
|
+
import { extensionsErrorOf } from "./headless/host.js";
|
|
7
7
|
import { settingsValues } from "./headless/select.js";
|
|
8
8
|
import { SettingsPanel, SettingsPanelBody, useSettingsSection } from "../settings/section.js";
|
|
9
9
|
import { SettingsWireForm } from "./SettingsWireForm.js";
|
|
@@ -41,11 +41,9 @@ import { extensionMark, settingsSearchIndex, settingsSidebar } from "zidane/chat
|
|
|
41
41
|
* <SettingsShell sections={[...builtins, ...ext.entries, ...ext.categories]} extraSearch={ext.search} />
|
|
42
42
|
*
|
|
43
43
|
* Rows write through the host's `settings.set` and actions run through
|
|
44
|
-
* `invoke('setting.action')
|
|
45
|
-
* (`ExtensionsHost.scope`) shows disabled, with why.
|
|
44
|
+
* `invoke('setting.action')`.
|
|
46
45
|
*/
|
|
47
46
|
const EMPTY = constant(null);
|
|
48
|
-
const NOT_LIMITED = constant(null);
|
|
49
47
|
/** A section's glyph: the first icon given, else a letter badge of `monogram`. */
|
|
50
48
|
function glyph(monogram, ...icons) {
|
|
51
49
|
const icon = icons.find((candidate) => candidate?.trim());
|
|
@@ -230,7 +228,6 @@ function SchemaPage({ page, className, style }) {
|
|
|
230
228
|
const host = useExtensionsHost();
|
|
231
229
|
const labels = useExtensionsLabels();
|
|
232
230
|
const wire = useReadable(host?.settings?.wire ?? EMPTY);
|
|
233
|
-
const scope = useReadable(host?.scope ?? NOT_LIMITED);
|
|
234
231
|
const [errors, setErrors] = useState({});
|
|
235
232
|
const [actions, setActions] = useState({});
|
|
236
233
|
const parts = useMemo(() => wire ? pageWires(wire, page) : null, [wire, page]);
|
|
@@ -277,8 +274,7 @@ function SchemaPage({ page, className, style }) {
|
|
|
277
274
|
onChange,
|
|
278
275
|
onRunAction: invoke ? onRunAction : void 0,
|
|
279
276
|
actionStates: actions,
|
|
280
|
-
errors
|
|
281
|
-
scope
|
|
277
|
+
errors
|
|
282
278
|
}, key);
|
|
283
279
|
return /* @__PURE__ */ jsx("div", {
|
|
284
280
|
className: ["space-y-5", className].filter(Boolean).join(" "),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { WireSettings } from "./headless/wire.js";
|
|
2
|
-
import { ExtensionAccessScope } from "./headless/host.js";
|
|
3
2
|
import { SettingValue } from "./headless/select.js";
|
|
4
3
|
import { CSSProperties } from "react";
|
|
5
4
|
//#region src/extensions/SettingsWireForm.d.ts
|
|
@@ -24,11 +23,6 @@ interface SettingsWireFormProps {
|
|
|
24
23
|
actionStates?: Readonly<Record<string, SettingsWireActionState>>;
|
|
25
24
|
/** A message per row (a refused write), by `extension:key`. */
|
|
26
25
|
errors?: Readonly<Record<string, string>>;
|
|
27
|
-
/**
|
|
28
|
-
* The scope this client's token grants (`ExtensionsHost.scope`): an action needing more shows its
|
|
29
|
-
* button disabled, with why. `null` or absent: never limited (a local or in-process host).
|
|
30
|
-
*/
|
|
31
|
-
scope?: ExtensionAccessScope | null;
|
|
32
26
|
/** Extra classes on the root. */
|
|
33
27
|
className?: string;
|
|
34
28
|
/** Inline styles on the root. */
|
|
@@ -39,6 +33,6 @@ interface SettingsWireFormProps {
|
|
|
39
33
|
*
|
|
40
34
|
* @param props - The rows, their values, the change and action handlers, `className` and `style`.
|
|
41
35
|
*/
|
|
42
|
-
declare function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors,
|
|
36
|
+
declare function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors, className, style }: SettingsWireFormProps): import("react").JSX.Element;
|
|
43
37
|
//#endregion
|
|
44
38
|
export { SettingsWireActionState, SettingsWireForm, SettingsWireFormProps };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Notice } from "../components/Notice.js";
|
|
1
2
|
import { FormSection, MetaChip } from "../components/Form.js";
|
|
2
3
|
import { useExtensionsLabels } from "./useExtensionsLabels.js";
|
|
3
|
-
import { isSettingLocked
|
|
4
|
+
import { isSettingLocked } from "./headless/select.js";
|
|
4
5
|
import { SettingFocus } from "../settings/section.js";
|
|
5
6
|
import { ExtensionActionRow, ExtensionConfigRow } from "../settings/sections/extensions/ExtensionConfigRows.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -30,7 +31,7 @@ function categories(settings) {
|
|
|
30
31
|
*
|
|
31
32
|
* @param props - The rows, their values, the change and action handlers, `className` and `style`.
|
|
32
33
|
*/
|
|
33
|
-
function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors,
|
|
34
|
+
function SettingsWireForm({ settings, values, onChange, onRunAction, actionStates, errors, className, style }) {
|
|
34
35
|
const labels = useExtensionsLabels();
|
|
35
36
|
const cats = categories(settings);
|
|
36
37
|
if (cats.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
@@ -53,8 +54,10 @@ function SettingsWireForm({ settings, values, onChange, onRunAction, actionState
|
|
|
53
54
|
value,
|
|
54
55
|
locked: isSettingLocked(settings, item.extension, item.key),
|
|
55
56
|
onChange
|
|
56
|
-
}), errors?.[id] && /* @__PURE__ */ jsx(
|
|
57
|
-
|
|
57
|
+
}), errors?.[id] && /* @__PURE__ */ jsx(Notice, {
|
|
58
|
+
tone: "error",
|
|
59
|
+
compact: true,
|
|
60
|
+
className: "mx-3 mb-1.5",
|
|
58
61
|
children: errors[id]
|
|
59
62
|
})]
|
|
60
63
|
}, id);
|
|
@@ -71,7 +74,6 @@ function SettingsWireForm({ settings, values, onChange, onRunAction, actionState
|
|
|
71
74
|
error: run.state === "error"
|
|
72
75
|
} } : {},
|
|
73
76
|
busy: run?.state === "busy",
|
|
74
|
-
needsScope: missingScope(scope, action.scope),
|
|
75
77
|
onRun: () => onRunAction(action.extension, action.key)
|
|
76
78
|
})
|
|
77
79
|
}, id);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DialogRequestWire, ExtensionItem, ExtensionTokenName, ExtensionWireMap } from "./wire.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionIntegrationWire, ExtensionLinkRequest, ExtensionPanelChange, ExtensionSettingsWire, ExtensionStoreRef, ExtensionUiEffect, ExtensionsHost } from "./host.js";
|
|
3
3
|
import { DialogQueueShowContext } from "./dialog-queue.js";
|
|
4
4
|
import { ExtensionUiEffectResult } from "./effect-channel.js";
|
|
5
5
|
//#region src/extensions/headless/fixture-host.d.ts
|
|
@@ -44,8 +44,6 @@ interface FixtureExtensionsOptions {
|
|
|
44
44
|
capabilities?: readonly FixtureExtensionsCapability[];
|
|
45
45
|
/** The link handlers: whether one opens a link. Absent: no `openLink` (links open the app's way). */
|
|
46
46
|
openLink?: (request: ExtensionLinkRequest) => boolean | Promise<boolean>;
|
|
47
|
-
/** The scope the client's token grants. Absent: no `scope` (never limited). */
|
|
48
|
-
scope?: ExtensionAccessScope | null;
|
|
49
47
|
}
|
|
50
48
|
/** Drives a fixture host from outside, as the extensions behind it would. */
|
|
51
49
|
interface FixtureExtensionsControl {
|
|
@@ -78,8 +76,6 @@ interface FixtureExtensionsControl {
|
|
|
78
76
|
panelChanged(change: ExtensionPanelChange): void;
|
|
79
77
|
/** The links offered to the link handlers so far. */
|
|
80
78
|
links(): readonly ExtensionLinkRequest[];
|
|
81
|
-
/** Changes the token's scope (with `scope` given). */
|
|
82
|
-
setScope(next: ExtensionAccessScope | null): void;
|
|
83
79
|
}
|
|
84
80
|
/** An in-memory {@link ExtensionsHost} and its control. */
|
|
85
81
|
type FixtureExtensionsHost = ExtensionsHost & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writable } from "../../chat/headless/store.js";
|
|
2
|
+
import { ExtensionsHostError } from "./host.js";
|
|
2
3
|
import { createDialogQueue } from "./dialog-queue.js";
|
|
3
4
|
import { createUiEffectChannel } from "./effect-channel.js";
|
|
4
|
-
import { ExtensionsHostError } from "./host.js";
|
|
5
5
|
import { EXTENSION_TOKENS } from "./wire.js";
|
|
6
6
|
//#region src/extensions/headless/fixture-host.ts
|
|
7
7
|
/**
|
|
@@ -74,14 +74,12 @@ function createFixtureExtensionsHost(options = {}) {
|
|
|
74
74
|
const goodKey = options.goodKey ?? "good-key";
|
|
75
75
|
const panelListeners = /* @__PURE__ */ new Set();
|
|
76
76
|
const links = [];
|
|
77
|
-
const scope = writable(options.scope ?? null);
|
|
78
77
|
const host = { items: lists };
|
|
79
78
|
const openLink = options.openLink;
|
|
80
79
|
if (openLink) host.openLink = async (request) => {
|
|
81
80
|
links.push(request);
|
|
82
81
|
return openLink(request);
|
|
83
82
|
};
|
|
84
|
-
if (options.scope !== void 0) host.scope = scope;
|
|
85
83
|
if (has("invoke")) host.invoke = async (id, args) => {
|
|
86
84
|
invoked.push({
|
|
87
85
|
id,
|
|
@@ -233,8 +231,7 @@ function createFixtureExtensionsHost(options = {}) {
|
|
|
233
231
|
panelChanged: (change) => {
|
|
234
232
|
for (const listener of [...panelListeners]) listener(change);
|
|
235
233
|
},
|
|
236
|
-
links: () => links
|
|
237
|
-
setScope: (next) => scope.set(next)
|
|
234
|
+
links: () => links
|
|
238
235
|
}
|
|
239
236
|
};
|
|
240
237
|
}
|
|
@@ -377,11 +377,6 @@ interface ExtensionLinkRequest {
|
|
|
377
377
|
/** The session it was clicked in. */
|
|
378
378
|
sessionId?: string;
|
|
379
379
|
}
|
|
380
|
-
/**
|
|
381
|
-
* The least client token scope that may run something (`chat` ⊂ `approve` ⊂ `admin`): zidane's
|
|
382
|
-
* `AccessScope`, the scope of an action setting.
|
|
383
|
-
*/
|
|
384
|
-
type ExtensionAccessScope = 'chat' | 'admin';
|
|
385
380
|
/** Options of {@link ExtensionsHost.rpc}. */
|
|
386
381
|
interface ExtensionRpcOptions {
|
|
387
382
|
/** The extension whose UI calls: its own contracts count as local (internal methods allowed). */
|
|
@@ -423,11 +418,6 @@ interface ExtensionsHost {
|
|
|
423
418
|
* skips it while Alt is held (`routeLink`). Absent: links open the app's way.
|
|
424
419
|
*/
|
|
425
420
|
openLink?(request: ExtensionLinkRequest): Promise<boolean>;
|
|
426
|
-
/**
|
|
427
|
-
* The scope this client's token grants (`null`: not limited, as a local or in-process host). Action
|
|
428
|
-
* settings above it show disabled with why. Absent: never limited.
|
|
429
|
-
*/
|
|
430
|
-
scope?: Readable<ExtensionAccessScope | null>;
|
|
431
421
|
}
|
|
432
422
|
//#endregion
|
|
433
|
-
export {
|
|
423
|
+
export { ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffects, ExtensionWebviews, ExtensionsError, ExtensionsHost, ExtensionsHostError, extensionsErrorOf };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BadgeActionWire, ComponentWire, ContextSectionWire, DialogKind, DialogRequestWire, EXTENSION_TOKENS, ExtensionItem, ExtensionTokenName, ExtensionWireMap, LinkHandlerWire, PanelWire, RendererTarget, RendererWire, SLOT_NAMES, ScreenWire, SelectOptionWire, SettingsPageWire, SidebarDecorationWire, SidebarFilterWire, SidebarGroupWire, SidebarRowActionWire, SidebarRowWire, SidebarSortWire, SlotName, SlotWire, SpaceWire, WebviewWire, WireSettings, WireSettingsPage } from "./wire.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffects, ExtensionWebviews, ExtensionsError, ExtensionsHost, ExtensionsHostError, extensionsErrorOf } from "./host.js";
|
|
3
3
|
import { ExtensionEffectApply, ExtensionEffectOutcome, ExtensionEffectRoute, ExtensionEffectRouter, createEffectRouter } from "./effect-router.js";
|
|
4
4
|
import { DEFAULT_EXTENSIONS_LABELS, ExtensionsLabels } from "./labels.js";
|
|
5
|
-
import { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked,
|
|
5
|
+
import { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems } from "./select.js";
|
|
6
6
|
import { DialogQueue, DialogQueueShowContext, createDialogQueue } from "./dialog-queue.js";
|
|
7
7
|
import { ExtensionUiEffectResult, UiEffectChannel, createUiEffectChannel } from "./effect-channel.js";
|
|
8
8
|
import { LinkRouteOptions, openInNewTab, routeLink } from "./links.js";
|
|
9
9
|
import { WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, WebviewRpcBridge, WebviewRpcBridgeOptions, WebviewRpcRequest, WebviewRpcResult, createWebviewRpcBridge, isWebviewRpcRequest } from "./webview-bridge.js";
|
|
10
|
-
export { BadgeActionWire, ComponentWire, ContextSectionWire, DEFAULT_EXTENSIONS_LABELS, DialogKind, DialogQueue, DialogQueueShowContext, DialogRequestWire, EXTENSION_TOKENS,
|
|
10
|
+
export { BadgeActionWire, ComponentWire, ContextSectionWire, DEFAULT_EXTENSIONS_LABELS, DialogKind, DialogQueue, DialogQueueShowContext, DialogRequestWire, EXTENSION_TOKENS, ExtensionCallbackId, ExtensionCallbacks, ExtensionCommandWire, ExtensionCommands, ExtensionComposerFile, ExtensionDialog, ExtensionDialogs, ExtensionEffectApply, ExtensionEffectOutcome, ExtensionEffectRoute, ExtensionEffectRouter, ExtensionIntegrationConnectionWire, ExtensionIntegrationWire, ExtensionIntegrations, ExtensionItem, ExtensionItemStores, ExtensionLinkRequest, ExtensionLinkSource, ExtensionNavigateTarget, ExtensionPanelChange, ExtensionProvenanceWire, ExtensionRpcOptions, ExtensionSettings, ExtensionSettingsWire, ExtensionStorage, ExtensionStoreRef, ExtensionTokenName, ExtensionUiEffect, ExtensionUiEffectRequest, ExtensionUiEffectResult, ExtensionUiEffects, ExtensionWebviews, ExtensionWireMap, ExtensionsError, ExtensionsHost, ExtensionsHostError, ExtensionsLabels, LinkHandlerWire, LinkRouteOptions, PanelWire, RendererTarget, RendererWire, SLOT_NAMES, ScreenWire, SelectOptionWire, SettingValue, SettingsPageWire, SidebarDecorationWire, SidebarFilterWire, SidebarGroupWire, SidebarRowActionWire, SidebarRowWire, SidebarSortWire, SlotName, SlotWire, SpaceWire, TITLEBAR_ITEMS_PER_EXTENSION, UiEffectChannel, WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, WebviewRpcBridge, WebviewRpcBridgeOptions, WebviewRpcRequest, WebviewRpcResult, WebviewWire, WireSettings, WireSettingsPage, clampSettingNumber, createDialogQueue, createEffectRouter, createUiEffectChannel, createWebviewRpcBridge, extensionsErrorOf, filterSelectOptions, groupSelectOptions, isSettingLocked, isWebviewRpcRequest, openInNewTab, qualifyPanelId, rendererMatches, renderersFor, routeLink, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createDialogQueue } from "./dialog-queue.js";
|
|
2
|
-
import { createUiEffectChannel } from "./effect-channel.js";
|
|
3
|
-
import { ExtensionsHostError, extensionsErrorOf } from "./host.js";
|
|
4
|
-
import { EXTENSION_TOKENS, SLOT_NAMES } from "./wire.js";
|
|
5
1
|
import { createEffectRouter } from "./effect-router.js";
|
|
6
2
|
import { DEFAULT_EXTENSIONS_LABELS } from "./labels.js";
|
|
3
|
+
import { ExtensionsHostError, extensionsErrorOf } from "./host.js";
|
|
7
4
|
import { WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, createWebviewRpcBridge, isWebviewRpcRequest } from "./webview-bridge.js";
|
|
8
5
|
import { openInNewTab, routeLink } from "./links.js";
|
|
9
|
-
import { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked,
|
|
10
|
-
|
|
6
|
+
import { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems } from "./select.js";
|
|
7
|
+
import { createDialogQueue } from "./dialog-queue.js";
|
|
8
|
+
import { createUiEffectChannel } from "./effect-channel.js";
|
|
9
|
+
import { EXTENSION_TOKENS, SLOT_NAMES } from "./wire.js";
|
|
10
|
+
export { DEFAULT_EXTENSIONS_LABELS, EXTENSION_TOKENS, ExtensionsHostError, SLOT_NAMES, TITLEBAR_ITEMS_PER_EXTENSION, WEBVIEW_RPC_NOT_ALLOWED, WEBVIEW_RPC_REQUEST, WEBVIEW_RPC_RESULT, WEBVIEW_RPC_UNAVAILABLE, clampSettingNumber, createDialogQueue, createEffectRouter, createUiEffectChannel, createWebviewRpcBridge, extensionsErrorOf, filterSelectOptions, groupSelectOptions, isSettingLocked, isWebviewRpcRequest, openInNewTab, qualifyPanelId, rendererMatches, renderersFor, routeLink, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExtensionItem, RendererTarget, RendererWire, SelectOptionWire, SlotName, SlotWire, WireSettings } from "./wire.js";
|
|
2
|
-
import { ExtensionAccessScope } from "./host.js";
|
|
3
2
|
import { ExtensionConfigValue, WireExtensionConfigItem } from "zidane";
|
|
4
3
|
//#region src/extensions/headless/select.d.ts
|
|
5
4
|
/**
|
|
@@ -14,15 +13,6 @@ import { ExtensionConfigValue, WireExtensionConfigItem } from "zidane";
|
|
|
14
13
|
* @param turnId - `transcript.turn-end`: the turn the place follows. Absent: the end of the transcript.
|
|
15
14
|
*/
|
|
16
15
|
declare function slotItems(items: readonly ExtensionItem<'slot'>[], at: SlotName, sessionId?: string, turnId?: string): readonly ExtensionItem<'slot'>[];
|
|
17
|
-
/**
|
|
18
|
-
* The scope an action needs that this client's token lacks, or `null` when it may run it: the token
|
|
19
|
-
* grants `granted` (`null` or absent: not limited, as a local or in-process host), the action needs
|
|
20
|
-
* `required` (default `admin`, as zidane's).
|
|
21
|
-
*
|
|
22
|
-
* @param granted - The token's scope (`ExtensionsHost.scope`).
|
|
23
|
-
* @param required - The action's `scope`.
|
|
24
|
-
*/
|
|
25
|
-
declare function missingScope(granted: ExtensionAccessScope | null | undefined, required: ExtensionAccessScope | undefined): ExtensionAccessScope | null;
|
|
26
16
|
/** How many `app.titlebar` items one extension shows: as many as its composer badges. */
|
|
27
17
|
declare const TITLEBAR_ITEMS_PER_EXTENSION = 8;
|
|
28
18
|
/**
|
|
@@ -117,4 +107,4 @@ declare function clampSettingNumber(item: Extract<WireExtensionConfigItem, {
|
|
|
117
107
|
*/
|
|
118
108
|
declare function slotIsActionable(item: SlotWire): boolean;
|
|
119
109
|
//#endregion
|
|
120
|
-
export { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked,
|
|
110
|
+
export { SettingValue, TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
|
|
@@ -16,23 +16,6 @@ function slotItems(items, at, sessionId, turnId) {
|
|
|
16
16
|
index
|
|
17
17
|
})).sort((a, b) => a.e.item.order - b.e.item.order || a.index - b.index).map((x) => x.e);
|
|
18
18
|
}
|
|
19
|
-
const SCOPE_RANK = {
|
|
20
|
-
chat: 0,
|
|
21
|
-
admin: 1
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* The scope an action needs that this client's token lacks, or `null` when it may run it: the token
|
|
25
|
-
* grants `granted` (`null` or absent: not limited, as a local or in-process host), the action needs
|
|
26
|
-
* `required` (default `admin`, as zidane's).
|
|
27
|
-
*
|
|
28
|
-
* @param granted - The token's scope (`ExtensionsHost.scope`).
|
|
29
|
-
* @param required - The action's `scope`.
|
|
30
|
-
*/
|
|
31
|
-
function missingScope(granted, required) {
|
|
32
|
-
if (!granted) return null;
|
|
33
|
-
const need = required ?? "admin";
|
|
34
|
-
return SCOPE_RANK[granted] >= SCOPE_RANK[need] ? null : need;
|
|
35
|
-
}
|
|
36
19
|
/** How many `app.titlebar` items one extension shows: as many as its composer badges. */
|
|
37
20
|
const TITLEBAR_ITEMS_PER_EXTENSION = 8;
|
|
38
21
|
/**
|
|
@@ -187,4 +170,4 @@ function slotIsActionable(item) {
|
|
|
187
170
|
return item.panel !== void 0 || item.command !== void 0;
|
|
188
171
|
}
|
|
189
172
|
//#endregion
|
|
190
|
-
export { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked,
|
|
173
|
+
export { TITLEBAR_ITEMS_PER_EXTENSION, clampSettingNumber, filterSelectOptions, groupSelectOptions, isSettingLocked, qualifyPanelId, rendererMatches, renderersFor, settingValue, settingsValues, slotIsActionable, slotItems, titlebarItems };
|
package/dist/extensions/hooks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { constant, useReadable } from "../chat/headless/store.js";
|
|
2
|
-
import { ExtensionsHostError } from "./headless/host.js";
|
|
3
2
|
import { useExtensionScope } from "./ExtensionComponent.js";
|
|
4
3
|
import { useExtensionEffectRouter, useExtensionsHost } from "./ExtensionsProvider.js";
|
|
4
|
+
import { ExtensionsHostError } from "./headless/host.js";
|
|
5
5
|
import { isSettingLocked, settingValue } from "./headless/select.js";
|
|
6
6
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
7
7
|
//#region src/extensions/hooks.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Breadcrumb } from "../components/Breadcrumb.js";
|
|
2
2
|
import { IconToggle } from "../components/IconToggle.js";
|
|
3
3
|
import { PanelEmpty, PanelLoading } from "../components/PanelEmpty.js";
|
|
4
|
-
import { mediaSiblings, mediaTypeOfPath } from "./headless/media.js";
|
|
5
4
|
import { useFilesHost } from "./FilesProvider.js";
|
|
5
|
+
import { mediaSiblings, mediaTypeOfPath } from "./headless/media.js";
|
|
6
6
|
import { absolutePath } from "./file-actions.js";
|
|
7
7
|
import { useFilesLabels } from "./useFilesLabels.js";
|
|
8
8
|
import { useLsp } from "./useLsp.js";
|
|
@@ -85,6 +85,17 @@ const EditorColumn = memo(function EditorColumn({ cwd, files, treeSide, treeOpen
|
|
|
85
85
|
}, [revealAt, navigate]);
|
|
86
86
|
const changed = active && host.workingTreeDiff && !(active.file && active.file !== "missing" && active.file.media) ? hasChanges(active.path) : false;
|
|
87
87
|
const dirty = useIsDirty(files.drafts, active?.path ?? null);
|
|
88
|
+
if (active && dirty && diffOverride[active.path] !== false) setDiffOverride((o) => ({
|
|
89
|
+
...o,
|
|
90
|
+
[active.path]: false
|
|
91
|
+
}));
|
|
92
|
+
const adoptSaved = useCallback((path, file, reset) => {
|
|
93
|
+
if (!reset) setDiffOverride((o) => o[path] === false ? o : {
|
|
94
|
+
...o,
|
|
95
|
+
[path]: false
|
|
96
|
+
});
|
|
97
|
+
adoptFile(path, file, reset);
|
|
98
|
+
}, [adoptFile]);
|
|
88
99
|
const activeFile = active && active.file !== null && active.file !== "missing" ? active.file : null;
|
|
89
100
|
const isNew = active !== null && isNewFile(active.path);
|
|
90
101
|
const smallEnough = useMemo(() => diffFits(activeFile), [activeFile]);
|
|
@@ -317,7 +328,7 @@ const EditorColumn = memo(function EditorColumn({ cwd, files, treeSide, treeOpen
|
|
|
317
328
|
visible: isActive,
|
|
318
329
|
findAsk,
|
|
319
330
|
onDraft: setDraft,
|
|
320
|
-
onAdopt:
|
|
331
|
+
onAdopt: adoptSaved
|
|
321
332
|
})
|
|
322
333
|
}, f.path);
|
|
323
334
|
})
|
package/dist/files/MediaDiff.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mediaTypeOfPath } from "./headless/media.js";
|
|
2
1
|
import { useFilesHost } from "./FilesProvider.js";
|
|
2
|
+
import { mediaTypeOfPath } from "./headless/media.js";
|
|
3
3
|
import { useFilesLabels } from "./useFilesLabels.js";
|
|
4
4
|
import { MediaView } from "./MediaView.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/files/TreeColumn.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IconButton } from "../components/IconButton.js";
|
|
2
|
+
import { Notice } from "../components/Notice.js";
|
|
2
3
|
import { readPanelMs, usePresence } from "../motion/presence.js";
|
|
3
4
|
import { IconToggle } from "../components/IconToggle.js";
|
|
4
5
|
import { PanelEmpty, PanelLoading } from "../components/PanelEmpty.js";
|
|
@@ -159,26 +160,18 @@ const TreeColumn = memo(function TreeColumn(p) {
|
|
|
159
160
|
title: labels.filesTruncated(p.truncated.shown, p.truncated.total, !!p.truncated.atLeast),
|
|
160
161
|
children: labels.filesTruncated(p.truncated.shown, p.truncated.total, !!p.truncated.atLeast)
|
|
161
162
|
}),
|
|
162
|
-
p.notice && !p.search && /* @__PURE__ */
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}),
|
|
175
|
-
/* @__PURE__ */ jsx(IconButton, {
|
|
176
|
-
size: "xs",
|
|
177
|
-
icon: "i-ph-x",
|
|
178
|
-
label: labels.filesDismiss,
|
|
179
|
-
onClick: () => p.onDismissNotice?.()
|
|
180
|
-
})
|
|
181
|
-
]
|
|
163
|
+
p.notice && !p.search && /* @__PURE__ */ jsx(Notice, {
|
|
164
|
+
tone: "error",
|
|
165
|
+
compact: true,
|
|
166
|
+
className: "shrink-0 mx-2 mb-1",
|
|
167
|
+
action: /* @__PURE__ */ jsx(IconButton, {
|
|
168
|
+
size: "xs",
|
|
169
|
+
icon: "i-ph-x",
|
|
170
|
+
label: labels.filesDismiss,
|
|
171
|
+
onClick: () => p.onDismissNotice?.(),
|
|
172
|
+
className: "ml-auto"
|
|
173
|
+
}),
|
|
174
|
+
children: p.notice
|
|
182
175
|
}),
|
|
183
176
|
p.entries === null ? !p.search && /* @__PURE__ */ jsx(PanelLoading, {}) : p.entries.length === 0 && !(p.editing && !p.changedOnly) ? !p.search && /* @__PURE__ */ jsx(PanelEmpty, {
|
|
184
177
|
icon: "i-ph-tree-structure",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { droppedItems, entryRefusalText, inFolder, nameOf, parentOf, topLevelPaths } from "./headless/entries.js";
|
|
2
1
|
import { useOptionalConfirm } from "../app/useConfirm.js";
|
|
2
|
+
import { droppedItems, entryRefusalText, inFolder, nameOf, parentOf, topLevelPaths } from "./headless/entries.js";
|
|
3
3
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
4
|
//#region src/files/useEntryActions.ts
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isUnder, movedPath } from "./headless/entries.js";
|
|
2
1
|
import { useFilesHost } from "./FilesProvider.js";
|
|
2
|
+
import { isUnder, movedPath } from "./headless/entries.js";
|
|
3
3
|
import { filesRootOf } from "./headless/view.js";
|
|
4
4
|
import { folderBuffers } from "./drafts-store.js";
|
|
5
5
|
import { editedPath, sameFile, statusDelta } from "./headless/workspace-diff.js";
|
|
@@ -78,6 +78,8 @@ function useOpenFiles(scope, layout, layoutStore, prefs, source) {
|
|
|
78
78
|
}, [buffers, slots]);
|
|
79
79
|
const [savedAt, setSavedAt] = useState(/* @__PURE__ */ new Map());
|
|
80
80
|
const adoptFile = useCallback((path, file, resetEditor = false) => {
|
|
81
|
+
const inFlight = reads.current.get(path);
|
|
82
|
+
if (inFlight !== void 0) reads.current.set(path, inFlight + 1);
|
|
81
83
|
if (resetEditor) resetEditSession(path);
|
|
82
84
|
else setSavedAt((m) => new Map(m).set(path, Date.now()));
|
|
83
85
|
setOpen((current) => current.map((f) => f.path === path && f.file !== file ? {
|
package/dist/git/BranchMenu.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IconButton } from "../components/IconButton.js";
|
|
2
2
|
import { CopyButton } from "../components/CopyButton.js";
|
|
3
|
+
import { Notice } from "../components/Notice.js";
|
|
3
4
|
import { Tooltip } from "../components/Tooltip.js";
|
|
4
5
|
import { MenuNote } from "../components/Menu.js";
|
|
5
6
|
import { FloatingSurface } from "../components/floating/FloatingSurface.js";
|
|
6
|
-
import { environmentKindIcon } from "./headless/environment.js";
|
|
7
7
|
import { gitErrorText } from "./headless/labels.js";
|
|
8
8
|
import { useGitHost, useGitLabels } from "./GitProvider.js";
|
|
9
9
|
import { useLinkRouter } from "../extensions/links.js";
|
|
10
10
|
import { relativeTime } from "../chat/headless/session-list.js";
|
|
11
|
+
import { environmentKindIcon } from "./headless/environment.js";
|
|
11
12
|
import { ageIsDuration, clockTime, compactCount, readPullRequests, switcherCacheOf, switcherCreates, switcherKey, switcherSections } from "./headless/switcher.js";
|
|
12
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { memo, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
@@ -358,9 +359,10 @@ function BranchMenu({ open, anchorRef, cwd, sessionId, current, onClose, onSwitc
|
|
|
358
359
|
className: "zg-well w-full h-7 px-2.5 text-zg-label placeholder:text-[var(--zg-text-subtle)]"
|
|
359
360
|
})
|
|
360
361
|
}),
|
|
361
|
-
error && /* @__PURE__ */ jsx(
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
363
|
+
tone: "error",
|
|
364
|
+
compact: true,
|
|
365
|
+
className: "mx-1 mb-1",
|
|
364
366
|
children: error
|
|
365
367
|
}),
|
|
366
368
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { buttonClass } from "../components/button.js";
|
|
2
|
+
import { Notice } from "../components/Notice.js";
|
|
2
3
|
import { MetaChip } from "../components/Form.js";
|
|
4
|
+
import { errorMessage } from "../components/report-error.js";
|
|
3
5
|
import { compactPath } from "../path.js";
|
|
4
6
|
import { useDisplayPath } from "../hooks/useDisplayPath.js";
|
|
5
7
|
import { gitErrorText } from "./headless/labels.js";
|
|
@@ -71,9 +73,12 @@ function ImportRepoDialog({ clone, initialParent, pickFolder, hostId, onDone, on
|
|
|
71
73
|
try {
|
|
72
74
|
const result = await clone.clone(input, parent);
|
|
73
75
|
if (result.ok) onDone(result.path);
|
|
74
|
-
else if (!("cancelled" in result)) setError(gitErrorText(result.error, labels));
|
|
76
|
+
else if (!("cancelled" in result)) setError({ message: gitErrorText(result.error, labels) });
|
|
75
77
|
} catch (err) {
|
|
76
|
-
setError(
|
|
78
|
+
setError({
|
|
79
|
+
message: labels.gitImportFailed,
|
|
80
|
+
detail: errorMessage(err)
|
|
81
|
+
});
|
|
77
82
|
} finally {
|
|
78
83
|
setCloning(false);
|
|
79
84
|
}
|
|
@@ -133,10 +138,14 @@ function ImportRepoDialog({ clone, initialParent, pickFolder, hostId, onDone, on
|
|
|
133
138
|
"aria-invalid": invalid || void 0,
|
|
134
139
|
className: "zg-well w-full h-8 px-2.5 font-mono text-zg-label placeholder:text-[var(--zg-text-subtle)] disabled:opacity-zg-disabled"
|
|
135
140
|
}),
|
|
136
|
-
/* @__PURE__ */ jsx(
|
|
137
|
-
|
|
141
|
+
invalid ? /* @__PURE__ */ jsx(Notice, {
|
|
142
|
+
tone: "error",
|
|
143
|
+
compact: true,
|
|
144
|
+
children: labels.gitImportInvalid
|
|
145
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
146
|
+
className: "zg-meta min-h-4 truncate",
|
|
138
147
|
"aria-live": "polite",
|
|
139
|
-
children:
|
|
148
|
+
children: spec ? labels.gitImportPreview(spec.label, spec.branch, compactPath(display.path(joinPath(parent, spec.name), hostId), 44)) : ""
|
|
140
149
|
})
|
|
141
150
|
]
|
|
142
151
|
}),
|
|
@@ -182,10 +191,10 @@ function ImportRepoDialog({ clone, initialParent, pickFolder, hostId, onDone, on
|
|
|
182
191
|
children: progress ? labels.gitImportProgress(progress.phase, progress.percent) : labels.gitImportConnecting
|
|
183
192
|
})]
|
|
184
193
|
}),
|
|
185
|
-
error && /* @__PURE__ */ jsx(
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
children: error
|
|
194
|
+
error && /* @__PURE__ */ jsx(Notice, {
|
|
195
|
+
tone: "error",
|
|
196
|
+
...error.detail ? { detail: error.detail } : {},
|
|
197
|
+
children: error.message
|
|
189
198
|
}),
|
|
190
199
|
/* @__PURE__ */ jsx("button", {
|
|
191
200
|
type: "submit",
|