zidane-ui 9.1.4 → 9.1.6
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/server-extensions-host.js +1 -1
- package/dist/adapters/server-host.js +2 -1
- package/dist/adapters/server-machines-host.js +1 -1
- package/dist/adapters/server-session-host.js +87 -13
- package/dist/adapters/server-settings-host.js +1 -1
- 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/HostTranscript.d.ts +5 -1
- package/dist/chat/HostTranscript.js +16 -4
- package/dist/chat/RunEstimateChip.d.ts +5 -3
- package/dist/chat/RunEstimateChip.js +33 -3
- package/dist/chat/Transcript.js +1 -1
- package/dist/chat/composer/ConversationBadges.js +16 -10
- package/dist/chat/composer/composer-bus.d.ts +2 -2
- package/dist/chat/composer/composer-bus.js +2 -2
- package/dist/chat/composer/use-composer-stores.js +1 -1
- package/dist/chat/composer/use-run-meter.js +1 -1
- package/dist/chat/headless/composer/conversation-badges.d.ts +8 -3
- package/dist/chat/headless/composer/conversation-badges.js +26 -11
- package/dist/chat/headless/composer/index.js +2 -2
- package/dist/chat/headless/composer/labels-chrome.d.ts +3 -1
- package/dist/chat/headless/composer/labels-chrome.js +3 -1
- package/dist/chat/headless/index.d.ts +6 -3
- package/dist/chat/headless/index.js +16 -13
- package/dist/chat/headless/labels.d.ts +54 -1
- package/dist/chat/headless/labels.js +62 -2
- package/dist/chat/headless/secrets.d.ts +32 -0
- package/dist/chat/headless/secrets.js +43 -0
- package/dist/chat/headless/session-list.d.ts +45 -0
- package/dist/chat/headless/sidebar/estimates.js +13 -1
- package/dist/chat/headless/sidebar/history.d.ts +71 -0
- package/dist/chat/headless/sidebar/history.js +174 -0
- package/dist/chat/headless/sidebar/index.d.ts +3 -2
- package/dist/chat/headless/sidebar/index.js +2 -1
- package/dist/chat/headless/sidebar/labels.d.ts +50 -0
- package/dist/chat/headless/sidebar/labels.js +1 -0
- package/dist/chat/headless/sidebar/query.d.ts +2 -2
- package/dist/chat/headless/sidebar/query.js +6 -3
- package/dist/chat/headless/sidebar/types.d.ts +7 -1
- package/dist/chat/headless/sidebar/view.js +2 -0
- package/dist/chat/headless/transcript/auth-failure.d.ts +67 -0
- package/dist/chat/headless/transcript/auth-failure.js +87 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -1
- package/dist/chat/headless/transcript/index.js +2 -1
- package/dist/chat/headless/transcript/nesting.d.ts +3 -3
- package/dist/chat/headless/transcript/nesting.js +12 -4
- package/dist/chat/index.d.ts +4 -2
- package/dist/chat/index.js +3 -1
- package/dist/chat/interactions/InboxPanel.d.ts +6 -2
- package/dist/chat/interactions/InboxPanel.js +82 -44
- package/dist/chat/interactions/PlanCard.d.ts +2 -2
- package/dist/chat/interactions/PlanCard.js +1 -1
- package/dist/chat/interactions/QuestionField.d.ts +8 -3
- package/dist/chat/interactions/QuestionField.js +89 -8
- package/dist/chat/interactions/QuestionForm.d.ts +3 -1
- package/dist/chat/interactions/QuestionForm.js +48 -10
- package/dist/chat/interactions/SecretInput.d.ts +32 -0
- package/dist/chat/interactions/SecretInput.js +72 -0
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +5 -3
- package/dist/chat/interactions/index.d.ts +2 -1
- package/dist/chat/interactions/index.js +2 -1
- package/dist/chat/sidebar/SessionSidebar.js +2 -0
- package/dist/chat/sidebar/SidebarFilterMenu.d.ts +7 -2
- package/dist/chat/sidebar/SidebarFilterMenu.js +26 -2
- package/dist/chat/sidebar/SidebarSessionRow.d.ts +3 -1
- package/dist/chat/sidebar/SidebarSessionRow.js +8 -3
- package/dist/chat/sidebar/sidebar-live.js +8 -4
- package/dist/chat/transcript/AuthFailureCard.d.ts +34 -0
- package/dist/chat/transcript/AuthFailureCard.js +358 -0
- package/dist/chat/transcript/InteractionToolBody.js +12 -2
- package/dist/chat/transcript/actions.d.ts +24 -1
- package/dist/chat/transcript/index.d.ts +3 -2
- package/dist/chat/transcript/index.js +2 -1
- package/dist/chat/transcript/notices.d.ts +2 -1
- package/dist/chat/transcript/notices.js +13 -1
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +1 -1
- package/dist/components/HowItWorks.d.ts +8 -1
- package/dist/components/HowItWorks.js +2 -2
- package/dist/components/RowActionsMenu.d.ts +6 -1
- package/dist/components/RowActionsMenu.js +4 -0
- package/dist/core.css +24 -0
- package/dist/dist/{index-WlE93Q6d.d.ts → index-DqCio7Nd.d.ts} +36 -3
- package/dist/dist/index-f-XWIoYo.d.ts +1 -0
- package/dist/dist/index.d.ts +6 -0
- package/dist/dist/sandbox-B4OW6oNx.d.ts +2 -0
- package/dist/dist/timeout-B5pO5I5a.d.ts +30 -0
- package/dist/extensions/ExtensionSettingsPage.js +1 -1
- package/dist/extensions/ExtensionSettingsSidebar.js +1 -1
- package/dist/extensions/headless/fixture-host.js +1 -1
- package/dist/extensions/headless/index.js +4 -4
- package/dist/extensions/hooks.js +1 -1
- package/dist/files/DiffsTab.js +1 -1
- package/dist/files/EditorColumn.js +1 -1
- package/dist/files/MediaDiff.js +1 -1
- package/dist/files/SearchPanel.js +121 -53
- package/dist/files/headless/name-match.js +29 -14
- package/dist/files/useEntryActions.js +1 -1
- package/dist/files/useOpenFiles.js +1 -1
- package/dist/git/WherePicker.js +2 -2
- package/dist/git/headless/environment.d.ts +6 -1
- package/dist/git/headless/environment.js +5 -2
- package/dist/git/headless/labels.d.ts +2 -0
- package/dist/git/headless/labels.js +2 -0
- package/dist/git/index.d.ts +2 -1
- package/dist/git/index.js +2 -1
- package/dist/git/useStartFromPanel.d.ts +22 -0
- package/dist/git/useStartFromPanel.js +91 -0
- package/dist/keybindings/KeyCommands.js +1 -1
- package/dist/keybindings/KeybindingsProvider.js +1 -1
- package/dist/keybindings/headless/catalog.d.ts +1 -1
- package/dist/keybindings/headless/catalog.js +14 -2
- package/dist/keybindings/headless/index.js +2 -2
- package/dist/keybindings/headless/key-scope.d.ts +4 -2
- package/dist/keybindings/headless/key-scope.js +17 -2
- package/dist/keybindings/headless/overrides.js +1 -1
- package/dist/machines/HostSyncPanel.js +1 -1
- package/dist/machines/SyncOutcomeBadge.js +1 -1
- package/dist/machines/headless/index.js +1 -1
- package/dist/onboarding/demos/features.d.ts +9 -1
- package/dist/onboarding/demos/features.js +107 -2
- package/dist/onboarding/demos/how-it-works.d.ts +5 -1
- package/dist/onboarding/demos/how-it-works.js +120 -2
- package/dist/onboarding/demos/index.js +1 -1
- package/dist/onboarding/headless/labels.d.ts +17 -0
- package/dist/onboarding/headless/labels.js +17 -0
- package/dist/onboarding/index.js +4 -4
- package/dist/onboarding/marks.d.ts +1 -2
- package/dist/onboarding/marks.js +4 -12
- package/dist/onboarding/steps/ConnectorsStep.js +1 -1
- package/dist/onboarding/steps/ReadyStep.js +1 -1
- package/dist/onboarding/steps/SkillsStep.js +1 -1
- package/dist/onboarding/steps/connect/ProviderPanel.js +1 -1
- package/dist/onboarding/tutorials.d.ts +3 -1
- package/dist/onboarding/tutorials.js +2 -1
- package/dist/palette/app-sources.js +1 -1
- package/dist/palette/headless/app-sources.js +10 -0
- package/dist/palette/headless/labels.js +2 -0
- package/dist/session/ArtifactsPanel.js +1 -1
- package/dist/session/PanelAttention.d.ts +14 -6
- package/dist/session/PanelAttention.js +35 -24
- package/dist/session/PlanTracker.d.ts +54 -0
- package/dist/session/PlanTracker.js +413 -0
- package/dist/session/ProjectHome.d.ts +15 -2
- package/dist/session/ProjectHome.js +158 -85
- package/dist/session/RemindersPanel.d.ts +25 -0
- package/dist/session/RemindersPanel.js +526 -0
- package/dist/session/SecretsPanel.d.ts +19 -0
- package/dist/session/SecretsPanel.js +241 -0
- package/dist/session/SessionProvider.d.ts +26 -5
- package/dist/session/SessionProvider.js +51 -6
- package/dist/session/StepStatusIcon.d.ts +24 -0
- package/dist/session/StepStatusIcon.js +50 -0
- package/dist/session/TodoList.d.ts +4 -3
- package/dist/session/TodoList.js +6 -5
- package/dist/session/headless/fixture-host.d.ts +32 -22
- package/dist/session/headless/fixture-host.js +86 -51
- package/dist/session/headless/fixture-plans.d.ts +57 -0
- package/dist/session/headless/fixture-plans.js +141 -0
- package/dist/session/headless/fixture-schedules.d.ts +49 -0
- package/dist/session/headless/fixture-schedules.js +133 -0
- package/dist/session/headless/home-layout.d.ts +10 -2
- package/dist/session/headless/home-layout.js +7 -2
- package/dist/session/headless/host.d.ts +85 -13
- package/dist/session/headless/index.d.ts +5 -3
- package/dist/session/headless/index.js +5 -3
- package/dist/session/headless/labels.d.ts +95 -12
- package/dist/session/headless/labels.js +67 -18
- package/dist/session/headless/plans.d.ts +53 -0
- package/dist/session/headless/plans.js +78 -0
- package/dist/session/headless/reminder-labels.d.ts +63 -0
- package/dist/session/headless/reminder-labels.js +84 -0
- package/dist/session/headless/schedules.d.ts +93 -0
- package/dist/session/headless/schedules.js +190 -0
- package/dist/session/headless/secrets.d.ts +28 -0
- package/dist/session/headless/secrets.js +48 -0
- package/dist/session/index.d.ts +7 -5
- package/dist/session/index.js +6 -4
- package/dist/session/testing/contract.d.ts +18 -5
- package/dist/session/testing/contract.js +351 -43
- package/dist/session/testing/index.d.ts +4 -2
- package/dist/session/testing/index.js +4 -2
- package/dist/settings/headless/catalog.js +17 -1
- package/dist/settings/headless/index.d.ts +2 -2
- package/dist/settings/headless/index.js +3 -3
- package/dist/settings/headless/labels.d.ts +0 -2
- package/dist/settings/headless/labels.js +0 -2
- package/dist/settings/headless/layout.js +7 -1
- package/dist/settings/headless/providers.d.ts +17 -1
- package/dist/settings/headless/providers.js +19 -1
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/rows.d.ts +1 -1
- package/dist/settings/rows.js +2 -2
- 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 +1 -1
- package/dist/settings/sections/environments/EnvironmentsSection.js +1 -1
- package/dist/settings/sections/extensions/ChangeOriginDialog.js +1 -1
- package/dist/settings/sections/extensions/CreateExtensionDialog.js +1 -1
- package/dist/settings/sections/extensions/ExtensionsSection.js +1 -1
- package/dist/settings/sections/host-catalog/HostCatalogSection.js +1 -1
- package/dist/settings/sections/instructions/InstructionsSection.js +1 -1
- package/dist/settings/sections/keybindings/labels.d.ts +2 -0
- package/dist/settings/sections/keybindings/labels.js +2 -0
- package/dist/settings/sections/keybindings/rows.js +8 -0
- package/dist/settings/sections/mcp/McpSection.js +1 -1
- package/dist/settings/sections/mcp/McpServerRow.js +1 -1
- package/dist/settings/sections/models/ModelRows.js +2 -2
- package/dist/settings/sections/providers/ProvidersSection.js +209 -201
- package/dist/settings/sections/providers/ServerProvidersSection.js +1 -1
- package/dist/settings/sections/shared/catalog.js +1 -1
- package/dist/settings/sections/skills/SkillList.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +2 -2
- package/dist/styles.css +59 -1
- package/dist/terminal/HostTerminalSurface.js +2 -2
- package/dist/workspace/PanelContentView.d.ts +22 -4
- package/dist/workspace/PanelContentView.js +112 -16
- package/dist/workspace/PanelGlyph.d.ts +21 -0
- package/dist/workspace/PanelGlyph.js +33 -0
- package/dist/workspace/PanelHome.js +5 -3
- package/dist/workspace/PanelStrip.js +11 -4
- package/dist/workspace/PanelToolbar.d.ts +32 -0
- package/dist/workspace/PanelToolbar.js +194 -0
- package/dist/workspace/WorkspaceProvider.d.ts +3 -1
- package/dist/workspace/WorkspaceProvider.js +6 -2
- package/dist/workspace/extension-tabs.js +5 -2
- package/dist/workspace/headless/host.d.ts +4 -0
- package/dist/workspace/headless/index.d.ts +3 -1
- package/dist/workspace/headless/index.js +4 -2
- package/dist/workspace/headless/labels.d.ts +10 -0
- package/dist/workspace/headless/labels.js +11 -1
- package/dist/workspace/headless/pages.d.ts +15 -0
- package/dist/workspace/headless/pages.js +49 -0
- package/dist/workspace/headless/tab-mark.d.ts +14 -0
- package/dist/workspace/headless/tab-mark.js +27 -0
- package/dist/workspace/headless/view.d.ts +7 -1
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +3 -2
- package/dist/workspace/testing/index.js +6 -0
- package/dist/workspace/workspace-key-commands.js +3 -3
- package/package.json +2 -2
- package/src/styles/motion.css +13 -0
- package/src/styles/onboarding.css +0 -1
- package/src/styles/primitives.css +10 -0
- package/src/styles/workspace.css +17 -0
- package/dist/session/TodosPanel.d.ts +0 -19
- package/dist/session/TodosPanel.js +0 -251
- package/dist/session/headless/todos.d.ts +0 -22
- package/dist/session/headless/todos.js +0 -38
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { buttonClass } from "../../components/button.js";
|
|
2
|
+
import "../../components/Form.js";
|
|
3
|
+
import { useReadable } from "../headless/store.js";
|
|
4
|
+
import { RoutedLink } from "../../extensions/links.js";
|
|
5
|
+
import { useChatLabels } from "../useChatLabels.js";
|
|
6
|
+
import { useTranscriptActions } from "./actions.js";
|
|
7
|
+
import { failureTooltip } from "../headless/transcript/run-failures.js";
|
|
8
|
+
import { authFailureDetails, createAuthFixes, isAuthFixed, planAuthCard } from "../headless/transcript/auth-failure.js";
|
|
9
|
+
import { useSignIn } from "../../onboarding/useSignIn.js";
|
|
10
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { memo, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
12
|
+
import { CONTINUE_PROMPT, authOffersSignInFallback, authPrimaryAction } from "zidane/chat/pure";
|
|
13
|
+
//#region src/chat/transcript/AuthFailureCard.tsx
|
|
14
|
+
/**
|
|
15
|
+
* A run that stopped because a sign-in failed (`detail.auth`): instead of the
|
|
16
|
+
* quiet "Stopped" line, a compact card with what failed (the provider's
|
|
17
|
+
* name, the account), the reason, and what fixes it, in place: sign that
|
|
18
|
+
* account in again (the browser flow runs inside the card, a pasted code
|
|
19
|
+
* included), retry, switch to another stored account, open Settings there,
|
|
20
|
+
* or copy the details. A sign-in that succeeds resends the failed prompt
|
|
21
|
+
* when the stop is still the transcript's last word.
|
|
22
|
+
*
|
|
23
|
+
* Only the last stop is interactive (the rule the Retry button follows);
|
|
24
|
+
* older cards keep their headline. Once a sign-in is fixed, every card for
|
|
25
|
+
* it in the session says so. The accounts come from the transcript actions
|
|
26
|
+
* (`TranscriptActions.accounts`): a member the app leaves out hides its
|
|
27
|
+
* button.
|
|
28
|
+
*/
|
|
29
|
+
/** The sign-ins fixed from a card in this page's life, per session. */
|
|
30
|
+
const FIXES = createAuthFixes();
|
|
31
|
+
const BODY_TEXT = "text-sm leading-[1.6]";
|
|
32
|
+
const BTN_MAIN = buttonClass({
|
|
33
|
+
variant: "primary",
|
|
34
|
+
size: "xs"
|
|
35
|
+
});
|
|
36
|
+
const BTN_OTHER = buttonClass({
|
|
37
|
+
variant: "secondary",
|
|
38
|
+
size: "xs"
|
|
39
|
+
});
|
|
40
|
+
const BTN_QUIET = buttonClass({
|
|
41
|
+
variant: "ghost",
|
|
42
|
+
size: "xs"
|
|
43
|
+
});
|
|
44
|
+
const COPIED_MS = 1200;
|
|
45
|
+
const noop = () => () => {};
|
|
46
|
+
const idle = () => void 0;
|
|
47
|
+
/** A host's provider list, re-rendering when it changes (`undefined` without one). */
|
|
48
|
+
function useProviderList(resource) {
|
|
49
|
+
return useSyncExternalStore(resource ? resource.subscribe : noop, resource ? resource.get : idle, resource ? resource.get : idle);
|
|
50
|
+
}
|
|
51
|
+
/** A rejected action's words: a `SettingsError`'s detail, an `Error`'s message. */
|
|
52
|
+
function messageOf(error) {
|
|
53
|
+
if (error && typeof error === "object") {
|
|
54
|
+
if ("detail" in error && typeof error.detail === "string" && error.detail) return error.detail;
|
|
55
|
+
if ("message" in error && typeof error.message === "string" && error.message) return error.message;
|
|
56
|
+
if ("kind" in error && typeof error.kind === "string") return error.kind;
|
|
57
|
+
}
|
|
58
|
+
return String(error);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Renders a sign-in failure as a card with its fixes; see the module
|
|
62
|
+
* comment for the rules.
|
|
63
|
+
*
|
|
64
|
+
* @param props - Component props.
|
|
65
|
+
*/
|
|
66
|
+
const AuthFailureCard = memo(function AuthFailureCard({ auth, text, detail, failure, resumable, onResume, className, style }) {
|
|
67
|
+
const labels = useChatLabels();
|
|
68
|
+
const { sessionId, accounts } = useTranscriptActions();
|
|
69
|
+
const cwd = accounts?.cwd ?? "";
|
|
70
|
+
const providers = auth.source === "provider" ? accounts?.providers : void 0;
|
|
71
|
+
const list = useProviderList(useMemo(() => providers?.list(cwd) ?? null, [providers, cwd]))?.data;
|
|
72
|
+
const plan = useMemo(() => planAuthCard(auth, list), [auth, list]);
|
|
73
|
+
const fixes = useReadable(FIXES.fixed(sessionId));
|
|
74
|
+
const headline = labels.authHeadline(auth, plan.label);
|
|
75
|
+
const prompt = failure.resume === "retry" && failure.prompt ? failure.prompt : CONTINUE_PROMPT;
|
|
76
|
+
const latest = useRef({
|
|
77
|
+
resumable,
|
|
78
|
+
onResume,
|
|
79
|
+
prompt
|
|
80
|
+
});
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
latest.current = {
|
|
83
|
+
resumable,
|
|
84
|
+
onResume,
|
|
85
|
+
prompt
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
/** Resends the failed prompt if the stop is still the last word; says whether it did. */
|
|
89
|
+
const resumeIfLast = () => {
|
|
90
|
+
const now = latest.current;
|
|
91
|
+
if (!now.resumable || !now.onResume) return false;
|
|
92
|
+
now.onResume(now.prompt);
|
|
93
|
+
return true;
|
|
94
|
+
};
|
|
95
|
+
const [outcome, setOutcome] = useState(null);
|
|
96
|
+
const signIn = useSignIn(() => {
|
|
97
|
+
FIXES.add(sessionId, auth);
|
|
98
|
+
setOutcome(resumeIfLast() ? "retrying" : "signed-in");
|
|
99
|
+
});
|
|
100
|
+
const [switching, setSwitching] = useState(null);
|
|
101
|
+
const [copied, setCopied] = useState(false);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (!copied) return void 0;
|
|
104
|
+
const timer = window.setTimeout(() => setCopied(false), COPIED_MS);
|
|
105
|
+
return () => window.clearTimeout(timer);
|
|
106
|
+
}, [copied]);
|
|
107
|
+
const flow = signIn.state;
|
|
108
|
+
const running = flow !== null && flow.kind !== "done" && flow.kind !== "error";
|
|
109
|
+
const fixed = outcome !== null || !resumable && !running && isAuthFixed(fixes, auth);
|
|
110
|
+
const open = resumable || running;
|
|
111
|
+
const begin = useMemo(() => {
|
|
112
|
+
if (auth.source === "provider") {
|
|
113
|
+
const provider = plan.provider;
|
|
114
|
+
if (!providers?.signIn || !provider?.oauth) return null;
|
|
115
|
+
const replaceKey = plan.replaceKey;
|
|
116
|
+
return () => providers.signIn(provider.key, replaceKey ? { replaceKey } : void 0);
|
|
117
|
+
}
|
|
118
|
+
const mcp = accounts?.mcp;
|
|
119
|
+
if (auth.source === "mcp" && mcp?.signIn) return () => mcp.signIn(cwd, auth.provider);
|
|
120
|
+
return null;
|
|
121
|
+
}, [
|
|
122
|
+
auth,
|
|
123
|
+
plan,
|
|
124
|
+
providers,
|
|
125
|
+
accounts?.mcp,
|
|
126
|
+
cwd
|
|
127
|
+
]);
|
|
128
|
+
const other = plan.otherAccount;
|
|
129
|
+
const canSwitch = Boolean(other?.key && plan.provider && providers?.setPreferred);
|
|
130
|
+
const switchAccount = async () => {
|
|
131
|
+
setSwitching({});
|
|
132
|
+
try {
|
|
133
|
+
await providers.setPreferred(cwd, plan.provider.key, { key: other.key });
|
|
134
|
+
setSwitching(null);
|
|
135
|
+
resumeIfLast();
|
|
136
|
+
} catch (error) {
|
|
137
|
+
setSwitching({ error: messageOf(error) });
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
const switchBusy = switching !== null && switching.error === void 0;
|
|
141
|
+
const primary = authPrimaryAction(auth);
|
|
142
|
+
const offerSignIn = begin !== null && (primary === "sign-in" || authOffersSignInFallback(auth));
|
|
143
|
+
const offerRetry = onResume !== void 0 && (primary === "retry" || !offerSignIn);
|
|
144
|
+
const otherLabel = other ? other.label ?? other.detail : "";
|
|
145
|
+
const copy = async () => {
|
|
146
|
+
try {
|
|
147
|
+
await navigator.clipboard.writeText(authFailureDetails(headline, text, detail?.raw));
|
|
148
|
+
setCopied(true);
|
|
149
|
+
} catch {}
|
|
150
|
+
};
|
|
151
|
+
const signInButton = offerSignIn && /* @__PURE__ */ jsxs("button", {
|
|
152
|
+
type: "button",
|
|
153
|
+
className: primary === "sign-in" ? BTN_MAIN : BTN_OTHER,
|
|
154
|
+
onClick: () => signIn.start(begin),
|
|
155
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
156
|
+
"aria-hidden": true,
|
|
157
|
+
className: "i-ph-sign-in"
|
|
158
|
+
}), labels.authSignInAgain]
|
|
159
|
+
});
|
|
160
|
+
const retryButton = offerRetry && /* @__PURE__ */ jsxs("button", {
|
|
161
|
+
type: "button",
|
|
162
|
+
className: primary === "retry" ? BTN_MAIN : BTN_OTHER,
|
|
163
|
+
title: failure.resume === "retry" ? labels.retryHint : labels.continueHint,
|
|
164
|
+
onClick: () => onResume(prompt),
|
|
165
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
166
|
+
"aria-hidden": true,
|
|
167
|
+
className: "i-ph-arrow-clockwise"
|
|
168
|
+
}), labels.retry]
|
|
169
|
+
});
|
|
170
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
171
|
+
role: "group",
|
|
172
|
+
"aria-label": labels.authCard,
|
|
173
|
+
"data-testid": "run-failure",
|
|
174
|
+
"data-cause": failure.cause,
|
|
175
|
+
"data-auth": auth.kind,
|
|
176
|
+
"data-fixed": fixed ? "" : void 0,
|
|
177
|
+
className: [`flex flex-col gap-1 min-w-0 pl-3 border-l-2 ${fixed ? "border-zg-success" : "border-zg-danger"} ${BODY_TEXT}`, className].filter(Boolean).join(" "),
|
|
178
|
+
style,
|
|
179
|
+
children: [
|
|
180
|
+
/* @__PURE__ */ jsxs("div", {
|
|
181
|
+
className: "flex items-center gap-2 min-w-0",
|
|
182
|
+
title: failureTooltip(text, detail, labels.resetsAt),
|
|
183
|
+
children: [
|
|
184
|
+
/* @__PURE__ */ jsx("span", {
|
|
185
|
+
"aria-hidden": true,
|
|
186
|
+
className: `shrink-0 ${fixed ? "i-ph-check-circle text-zg-success" : "i-ph-key text-zg-danger"}`
|
|
187
|
+
}),
|
|
188
|
+
/* @__PURE__ */ jsx("span", {
|
|
189
|
+
className: "min-w-0 truncate font-medium text-[var(--zg-text)]",
|
|
190
|
+
children: headline
|
|
191
|
+
}),
|
|
192
|
+
fixed && outcome === null && /* @__PURE__ */ jsxs("span", {
|
|
193
|
+
className: "zg-meta-chip zg-meta shrink-0 gap-1 text-zg-success",
|
|
194
|
+
"data-testid": "auth-fixed",
|
|
195
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
196
|
+
"aria-hidden": true,
|
|
197
|
+
className: "i-ph-check"
|
|
198
|
+
}), labels.authFixed]
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
}),
|
|
202
|
+
(open || outcome !== null) && text && /* @__PURE__ */ jsx("div", {
|
|
203
|
+
className: "min-w-0 text-[var(--zg-text-muted)] whitespace-pre-wrap break-words",
|
|
204
|
+
children: text
|
|
205
|
+
}),
|
|
206
|
+
outcome !== null ? /* @__PURE__ */ jsxs("div", {
|
|
207
|
+
role: "status",
|
|
208
|
+
className: "flex items-center gap-1.5 text-zg-success",
|
|
209
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
210
|
+
"aria-hidden": true,
|
|
211
|
+
className: "i-ph-check"
|
|
212
|
+
}), outcome === "retrying" ? labels.authSignedInRetrying : labels.authSignedIn]
|
|
213
|
+
}) : !open ? null : running ? /* @__PURE__ */ jsx(SignInProgress, {
|
|
214
|
+
state: flow,
|
|
215
|
+
submit: signIn.submit,
|
|
216
|
+
onCancel: signIn.cancel
|
|
217
|
+
}) : flow?.kind === "error" ? /* @__PURE__ */ jsxs("div", {
|
|
218
|
+
className: "flex flex-col gap-1.5",
|
|
219
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
220
|
+
role: "alert",
|
|
221
|
+
className: "text-zg-danger break-words",
|
|
222
|
+
children: labels.authFailed(flow.message)
|
|
223
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
224
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
225
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
226
|
+
type: "button",
|
|
227
|
+
className: BTN_MAIN,
|
|
228
|
+
onClick: () => signIn.start(begin),
|
|
229
|
+
children: labels.authTryAgain
|
|
230
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
231
|
+
type: "button",
|
|
232
|
+
className: BTN_OTHER,
|
|
233
|
+
onClick: signIn.cancel,
|
|
234
|
+
children: labels.authCancel
|
|
235
|
+
})]
|
|
236
|
+
})]
|
|
237
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
238
|
+
className: "flex flex-col gap-1.5",
|
|
239
|
+
children: [switching?.error !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
240
|
+
role: "alert",
|
|
241
|
+
className: "text-zg-danger break-words",
|
|
242
|
+
children: labels.authFailed(switching.error)
|
|
243
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
244
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
245
|
+
children: [
|
|
246
|
+
primary === "sign-in" ? signInButton : retryButton,
|
|
247
|
+
primary === "sign-in" ? retryButton : signInButton,
|
|
248
|
+
canSwitch && /* @__PURE__ */ jsxs("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
className: BTN_OTHER,
|
|
251
|
+
disabled: switchBusy,
|
|
252
|
+
onClick: () => void switchAccount(),
|
|
253
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
254
|
+
"aria-hidden": true,
|
|
255
|
+
className: "i-ph-user-switch"
|
|
256
|
+
}), switchBusy ? labels.authSwitching(otherLabel) : labels.authUseAccount(otherLabel)]
|
|
257
|
+
}),
|
|
258
|
+
accounts?.openSettings && /* @__PURE__ */ jsxs("button", {
|
|
259
|
+
type: "button",
|
|
260
|
+
className: BTN_QUIET,
|
|
261
|
+
title: labels.authSettingsHint,
|
|
262
|
+
onClick: () => accounts.openSettings(plan.settings),
|
|
263
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
264
|
+
"aria-hidden": true,
|
|
265
|
+
className: "i-ph-gear"
|
|
266
|
+
}), labels.authSettings]
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ jsxs("button", {
|
|
269
|
+
type: "button",
|
|
270
|
+
className: BTN_QUIET,
|
|
271
|
+
onClick: () => void copy(),
|
|
272
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
273
|
+
"aria-hidden": true,
|
|
274
|
+
className: copied ? "i-ph-check" : "i-ph-copy"
|
|
275
|
+
}), copied ? labels.authCopied : labels.authCopyDetails]
|
|
276
|
+
})
|
|
277
|
+
]
|
|
278
|
+
})]
|
|
279
|
+
})
|
|
280
|
+
]
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
/** A sign-in while it runs, inside the card: where it is, the page's link, a pasted code, Cancel. */
|
|
284
|
+
function SignInProgress({ state, submit, onCancel }) {
|
|
285
|
+
const labels = useChatLabels();
|
|
286
|
+
const [pasted, setPasted] = useState("");
|
|
287
|
+
const page = state.kind === "url" || state.kind === "device" ? state : null;
|
|
288
|
+
const instructions = state.kind === "url" && "instructions" in state && typeof state.instructions === "string" ? state.instructions : null;
|
|
289
|
+
const line = state.kind === "url" ? labels.authWaiting : state.kind === "device" ? labels.authEnterCode(state.userCode) : state.kind === "prompt" || state.kind === "progress" ? state.message : labels.authOpeningBrowser;
|
|
290
|
+
const takesInput = submit !== void 0 && (state.kind === "url" || state.kind === "prompt");
|
|
291
|
+
const send = (event) => {
|
|
292
|
+
event.preventDefault();
|
|
293
|
+
if (!pasted.trim()) return;
|
|
294
|
+
submit?.(pasted.trim());
|
|
295
|
+
setPasted("");
|
|
296
|
+
};
|
|
297
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
298
|
+
className: "flex flex-col gap-1.5",
|
|
299
|
+
"data-testid": "auth-sign-in",
|
|
300
|
+
children: [
|
|
301
|
+
/* @__PURE__ */ jsxs("div", {
|
|
302
|
+
role: "status",
|
|
303
|
+
"aria-live": "polite",
|
|
304
|
+
className: "flex items-center gap-2 min-w-0 text-[var(--zg-text)]",
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ jsx("span", {
|
|
307
|
+
"aria-hidden": true,
|
|
308
|
+
className: "zg-spin-ring zg-loop block shrink-0 text-[var(--zg-accent)]"
|
|
309
|
+
}),
|
|
310
|
+
/* @__PURE__ */ jsx("span", {
|
|
311
|
+
className: "min-w-0 break-words",
|
|
312
|
+
children: line
|
|
313
|
+
}),
|
|
314
|
+
page && /* @__PURE__ */ jsx(RoutedLink, {
|
|
315
|
+
href: page.url,
|
|
316
|
+
source: "auth",
|
|
317
|
+
className: "shrink-0 text-[var(--zg-accent-hover)] underline underline-offset-2",
|
|
318
|
+
children: labels.authOpenPage
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
}),
|
|
322
|
+
instructions && /* @__PURE__ */ jsx("div", {
|
|
323
|
+
className: "text-[var(--zg-text-muted)] break-words",
|
|
324
|
+
children: instructions
|
|
325
|
+
}),
|
|
326
|
+
state.kind === "prompt" && state.options && /* @__PURE__ */ jsx("ol", {
|
|
327
|
+
className: "m-0 pl-5 text-[var(--zg-text-muted)]",
|
|
328
|
+
children: state.options.map((option) => /* @__PURE__ */ jsx("li", { children: option }, option))
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ jsxs("form", {
|
|
331
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
332
|
+
onSubmit: send,
|
|
333
|
+
children: [takesInput && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("input", {
|
|
334
|
+
type: "text",
|
|
335
|
+
autoComplete: "off",
|
|
336
|
+
spellCheck: false,
|
|
337
|
+
"aria-label": labels.authPaste,
|
|
338
|
+
placeholder: state.kind === "prompt" && state.placeholder ? state.placeholder : labels.authPaste,
|
|
339
|
+
value: pasted,
|
|
340
|
+
onChange: (event) => setPasted(event.target.value),
|
|
341
|
+
className: `zg-well w-full h-8 px-2.5 text-zg-ui placeholder:text-[var(--zg-text-subtle)] disabled:opacity-zg-disabled flex-1 !w-auto min-w-40 h-6`
|
|
342
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
343
|
+
type: "submit",
|
|
344
|
+
className: BTN_MAIN,
|
|
345
|
+
disabled: !pasted.trim(),
|
|
346
|
+
children: labels.authPasteSend
|
|
347
|
+
})] }), /* @__PURE__ */ jsx("button", {
|
|
348
|
+
type: "button",
|
|
349
|
+
className: BTN_OTHER,
|
|
350
|
+
onClick: onCancel,
|
|
351
|
+
children: labels.authCancel
|
|
352
|
+
})]
|
|
353
|
+
})
|
|
354
|
+
]
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
export { AuthFailureCard };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useChatLabels } from "../useChatLabels.js";
|
|
2
2
|
import { ProseMarkdown } from "./ProseMarkdown.js";
|
|
3
|
+
import { useOptionalWorkspaceActions, useOptionalWorkspaceView } from "../../workspace/WorkspaceProvider.js";
|
|
3
4
|
import { PlanBody } from "../interactions/PlanCard.js";
|
|
4
5
|
import { AnsweredQuestions } from "../interactions/QuestionForm.js";
|
|
5
6
|
import { TodoListView } from "../../session/TodoList.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { SECRETS_PANEL_ID } from "zidane/chat/pure";
|
|
7
9
|
//#region src/chat/transcript/InteractionToolBody.tsx
|
|
8
10
|
/**
|
|
9
11
|
* The tools this body knows how to render.
|
|
@@ -20,7 +22,7 @@ function hasInteractionBody(tool) {
|
|
|
20
22
|
function parseResult(result) {
|
|
21
23
|
if (!result) return null;
|
|
22
24
|
try {
|
|
23
|
-
const parsed = JSON.parse(result);
|
|
25
|
+
const parsed = JSON.parse(result.split("\n\n", 1)[0]);
|
|
24
26
|
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
25
27
|
} catch {
|
|
26
28
|
return null;
|
|
@@ -109,6 +111,12 @@ function waiting(tool, label) {
|
|
|
109
111
|
label
|
|
110
112
|
}) : null;
|
|
111
113
|
}
|
|
114
|
+
/** Opens the Secrets tab, when the workspace around offers it (`Settings.secrets` on). */
|
|
115
|
+
function useOpenSecrets() {
|
|
116
|
+
const actions = useOptionalWorkspaceActions();
|
|
117
|
+
const offered = useOptionalWorkspaceView()?.tabs.some((tab) => tab.id === SECRETS_PANEL_ID) ?? false;
|
|
118
|
+
return actions && offered ? () => actions.focusTab(SECRETS_PANEL_ID) : void 0;
|
|
119
|
+
}
|
|
112
120
|
/**
|
|
113
121
|
* The expanded body of a `present_plan`, `ask_user` or `todowrite` call (see the module comment); `null` for any other.
|
|
114
122
|
*
|
|
@@ -116,6 +124,7 @@ function waiting(tool, label) {
|
|
|
116
124
|
*/
|
|
117
125
|
function InteractionToolBody({ tool }) {
|
|
118
126
|
const labels = useChatLabels();
|
|
127
|
+
const openSecrets = useOpenSecrets();
|
|
119
128
|
if (!hasInteractionBody(tool)) return null;
|
|
120
129
|
const input = tool.rawInput;
|
|
121
130
|
const response = parseResult(tool.result);
|
|
@@ -162,7 +171,8 @@ function InteractionToolBody({ tool }) {
|
|
|
162
171
|
answers: answers ?? {},
|
|
163
172
|
instructions,
|
|
164
173
|
id: tool.id,
|
|
165
|
-
Markdown: ProseMarkdown
|
|
174
|
+
Markdown: ProseMarkdown,
|
|
175
|
+
onOpenSecrets: openSecrets
|
|
166
176
|
}),
|
|
167
177
|
!answers && (waiting(tool, labels.interactionWaitingAnswers) ?? (tool.result ? /* @__PURE__ */ jsx(Outcome, {
|
|
168
178
|
icon: "i-ph-minus-circle",
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
import { SettingsProvidersHost } from "../../settings/headless/providers.js";
|
|
2
|
+
import { SettingsMcpHost } from "../../settings/headless/mcp.js";
|
|
3
|
+
import { AuthSettingsTarget } from "../headless/transcript/auth-failure.js";
|
|
1
4
|
import { ReactNode } from "react";
|
|
2
5
|
import { ModelNamer } from "zidane/chat/pure";
|
|
3
6
|
//#region src/chat/transcript/actions.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* The accounts of the host that holds a session's credentials, for the card
|
|
9
|
+
* a run stopped by a failed sign-in shows (`AuthFailureCard`). Each member is
|
|
10
|
+
* optional, and the card's button that needs it hides without it.
|
|
11
|
+
*/
|
|
12
|
+
interface TranscriptAccounts {
|
|
13
|
+
/** The session's folder, whose extension providers count (`''`: built-ins only). */
|
|
14
|
+
cwd: string;
|
|
15
|
+
/** Its providers: their labels and accounts, Sign in again (`signIn`), Use another account (`setPreferred`). */
|
|
16
|
+
providers?: SettingsProvidersHost;
|
|
17
|
+
/** Its MCP servers: Sign in again on a server whose sign-in ended the run. */
|
|
18
|
+
mcp?: Pick<SettingsMcpHost, 'signIn'>;
|
|
19
|
+
/** Opens Settings on that provider's account (or that MCP server). */
|
|
20
|
+
openSettings?(target: AuthSettingsTarget): void;
|
|
21
|
+
}
|
|
4
22
|
/** What a transcript row can ask of the app that hosts it. Every action but `sessionId` is optional, and its control is hidden when the app leaves it out. */
|
|
5
23
|
interface TranscriptActions {
|
|
6
24
|
/** The session on screen; actions that address a call need it. */
|
|
@@ -38,6 +56,11 @@ interface TranscriptActions {
|
|
|
38
56
|
* no Run in a terminal.
|
|
39
57
|
*/
|
|
40
58
|
runInTerminal?(input: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* The accounts a run that stopped on a failed sign-in can be fixed with,
|
|
61
|
+
* in place. Without it, the card offers only Retry and Copy details.
|
|
62
|
+
*/
|
|
63
|
+
accounts?: TranscriptAccounts;
|
|
41
64
|
}
|
|
42
65
|
/** Props for {@link TranscriptActionsProvider}. */
|
|
43
66
|
interface TranscriptActionsProviderProps {
|
|
@@ -57,4 +80,4 @@ declare function useTranscriptActions(): TranscriptActions;
|
|
|
57
80
|
/** How the transcript names a model: the app's `modelName`, else from the id. */
|
|
58
81
|
declare function useModelName(): ModelNamer;
|
|
59
82
|
//#endregion
|
|
60
|
-
export { TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, useModelName, useTranscriptActions };
|
|
83
|
+
export { TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, useModelName, useTranscriptActions };
|
|
@@ -2,7 +2,7 @@ import { RowContext, SlotEntry, TranscriptRow, TranscriptRowProps, TranscriptRow
|
|
|
2
2
|
import { TranscriptRenderersProvider, TranscriptRenderersProviderProps } from "./renderer-slots.js";
|
|
3
3
|
import { AttachmentLabelParts, CodeBlockSlotProps, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, InlineTextSlotProps, MarkdownSlotProps, PromptSlotProps, SessionTitleSlotProps, TextPreviewSlotProps, ToolBodySlotProps, TranscriptRenderers, defaultAttachmentLabel, useTranscriptRenderers } from "./renderers.js";
|
|
4
4
|
import { ToolMediaItem, parseToolMedia } from "../headless/transcript/tool-media.js";
|
|
5
|
-
import { TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, useModelName, useTranscriptActions } from "./actions.js";
|
|
5
|
+
import { TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, useModelName, useTranscriptActions } from "./actions.js";
|
|
6
6
|
import { DiffLines, DiffLinesProps } from "./DiffLines.js";
|
|
7
7
|
import { EditDiffBlock, EditDiffBlockProps } from "./EditDiffBlock.js";
|
|
8
8
|
import { ExchangeFoldRow, ExchangeFoldRowProps, FoldHeader, FoldHeaderProps } from "./fold.js";
|
|
@@ -14,6 +14,7 @@ import { Markdown, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownLinkProps, M
|
|
|
14
14
|
import { MermaidDiagram, MermaidDiagramProps } from "./MermaidDiagram.js";
|
|
15
15
|
import { MessageGroupRow, MessageGroupRowProps } from "./messages.js";
|
|
16
16
|
import { COMMAND_DETAIL_LINE, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, ErrorRow, ErrorRowProps, FailureRow, FailureRowProps, InfoRow, InfoRowProps, NoticeRow, NoticeRowProps, SessionEventRow, SessionEventRowProps, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps } from "./notices.js";
|
|
17
|
+
import { AuthFailureCard, AuthFailureCardProps } from "./AuthFailureCard.js";
|
|
17
18
|
import { AttachmentIcon, AttachmentIconProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps } from "./prompt.js";
|
|
18
19
|
import { PromptLines, PromptLinesProps, copyPromptLines } from "./prompt-lines.js";
|
|
19
20
|
import { TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingRow, ThinkingRowProps } from "./prose.js";
|
|
@@ -66,4 +67,4 @@ import { TranscriptRows, TranscriptRowsInput, useSelectStops, useTranscriptRows
|
|
|
66
67
|
import { UserBashRow, UserBashRowProps } from "./user-bash.js";
|
|
67
68
|
import { RowPlace, ScrollPosition, StickToBottomOptions, useStickToBottom } from "./useStickToBottom.js";
|
|
68
69
|
import { useTranscriptSelectionCopy } from "./useTranscriptSelectionCopy.js";
|
|
69
|
-
export { AUTO_FILL_PAGES, AnsiSpans, type AnsiSpansProps, AnsiText, type AnsiTextProps, AttachmentIcon, AttachmentIconProps, AttachmentLabelParts, BADGE_GLYPH, BadgeEffectContext, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, CardMarkdownProps, Caret, CaretProps, ChipCard, ChipCardProps, ChipHover, ChipHoverProps, ChipOpener, CodeBlockSlotProps, CodemodeScript, type CodemodeScriptProps, CommandCard, CommandCardProps, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, CommandScope, CommandScopeContext, CommitCard, CommitCardProps, CompactSummaryRow, CompactSummaryRowProps, ComposerSearch, CvRow, CvRowProps, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, DiffLines, DiffLinesProps, Dot, DotProps, EditDiffBlock, EditDiffBlockProps, ErrorRow, ErrorRowProps, ExchangeFoldRow, ExchangeFoldRowProps, FILL_MIN_PROMPTS, FailedMark, FailedMarkProps, FailureRow, FailureRowProps, FileBadgeIcon, FileBadgeIconProps, FoldHeader, FoldHeaderProps, GUTTER_STEP_PX, INLINE_CODE_CLASS, ImageGenerationBlock, ImageGenerationBlockProps, InfoRow, InfoRowProps, InlineChipText, InlineChipTextProps, InlineCode, InlineCodeProps, InlineTextSlotProps, InteractionTool, InteractionToolBody, InteractionToolBodyProps, LazyRow, LazyRowProps, LineState, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, LiveOutput, type LiveOutputProps, LoadEarlierRow, LoadEarlierRowProps, LoadFullOutputButton, LoadFullOutputButtonProps, MAX_MATCHES, Markdown, MarkdownContext, MarkdownContextValue, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownLinkProps, MarkdownProps, MarkdownSlotProps, MermaidDiagram, type MermaidDiagramProps, MessageGroupRow, MessageGroupRowProps, ModelVerdict, ModelVerdictProps, NestedToolCalls, NestedToolCallsProps, NoticeRow, NoticeRowProps, OpenBadgeMenu, OpenSessionContext, ParsedRef, ParsedReferenceUrl, PromptEcho, PromptEchoProps, PromptLines, PromptLinesProps, PromptSlotProps, ProseMarkdown, ProseMarkdownProps, ReadFileBlock, ReadFileBlockProps, RefChip, RefChipProps, RefMatch, ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps, RowContext, RowFrame, RowFrameProps, RowIconsContext, RowPlace, RunReceiptInline, RunReceiptInlineProps, RunSummaryRow, RunSummaryRowProps, RunnableCodeBlock, type RunnableCodeBlockProps, ScrollPosition, SearchHighlightStyle, SelectCursor, SelectCursorProps, SelectTurnCommands, SelectTurnExit, SelectTurnHintKeys, SelectTurnHintKeysProps, SelectTurnKeysOptions, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, SessionCard, SessionCardProps, SessionEventRow, SessionEventRowProps, SessionTitleSlotProps, ShellBlockProvider, type ShellBlockProviderProps, type ShellBlockScope, SkillCard, SkillCardProps, SlotEntry, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps, StickToBottomOptions, SubagentBlock, SubagentBlockProps, TextPreviewSlotProps, TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingRow, ThinkingRowProps, ToolBatchRow, ToolBatchRowProps, ToolBodySlotProps, ToolDetails, ToolDetailsProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolMedia, type ToolMediaItem, ToolMediaProps, ToolRow, ToolRowProps, ToolTiming, ToolTimingProps, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, TranscriptFind, TranscriptFindKeyOptions, TranscriptFindOptions, TranscriptFindTarget, TranscriptRenderers, TranscriptRenderersProvider, type TranscriptRenderersProviderProps, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptRows, TranscriptRowsInput, TranscriptScrollInputs, TranscriptSearch, TranscriptSearchOptions, TranscriptSearchProps, TranscriptSearchState, TranscriptSettling, TranscriptTurnMenu, TurnCommands, TurnCommandsOptions, TurnMenuActions, TurnMenuTarget, UserBashRow, UserBashRowProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps, WorkerDetails, WorkerDetailsProps, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph, mountRowNow, numberRef, parseRefUrl, parseReferenceUrl, parseToolMedia, refHref, referenceUrl, remarkReferences, remarkRefs, savedPaths, siteIconValue, useBackgroundMount, useBadgeMenu, useChipResolution, useCommand, useCommitInfo, useComposerSearch, useFillViewportScrollback, useForceMountRows, useFullOutput, useModelName, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useResolveChipNow, useRowIcons, useSelectStops, useSelectTurn, useSelectTurnKeys, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause };
|
|
70
|
+
export { AUTO_FILL_PAGES, AnsiSpans, type AnsiSpansProps, AnsiText, type AnsiTextProps, AttachmentIcon, AttachmentIconProps, AttachmentLabelParts, AuthFailureCard, AuthFailureCardProps, BADGE_GLYPH, BadgeEffectContext, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, CardMarkdownProps, Caret, CaretProps, ChipCard, ChipCardProps, ChipHover, ChipHoverProps, ChipOpener, CodeBlockSlotProps, CodemodeScript, type CodemodeScriptProps, CommandCard, CommandCardProps, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, CommandScope, CommandScopeContext, CommitCard, CommitCardProps, CompactSummaryRow, CompactSummaryRowProps, ComposerSearch, CvRow, CvRowProps, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, DiffLines, DiffLinesProps, Dot, DotProps, EditDiffBlock, EditDiffBlockProps, ErrorRow, ErrorRowProps, ExchangeFoldRow, ExchangeFoldRowProps, FILL_MIN_PROMPTS, FailedMark, FailedMarkProps, FailureRow, FailureRowProps, FileBadgeIcon, FileBadgeIconProps, FoldHeader, FoldHeaderProps, GUTTER_STEP_PX, INLINE_CODE_CLASS, ImageGenerationBlock, ImageGenerationBlockProps, InfoRow, InfoRowProps, InlineChipText, InlineChipTextProps, InlineCode, InlineCodeProps, InlineTextSlotProps, InteractionTool, InteractionToolBody, InteractionToolBodyProps, LazyRow, LazyRowProps, LineState, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, LiveOutput, type LiveOutputProps, LoadEarlierRow, LoadEarlierRowProps, LoadFullOutputButton, LoadFullOutputButtonProps, MAX_MATCHES, Markdown, MarkdownContext, MarkdownContextValue, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownLinkProps, MarkdownProps, MarkdownSlotProps, MermaidDiagram, type MermaidDiagramProps, MessageGroupRow, MessageGroupRowProps, ModelVerdict, ModelVerdictProps, NestedToolCalls, NestedToolCallsProps, NoticeRow, NoticeRowProps, OpenBadgeMenu, OpenSessionContext, ParsedRef, ParsedReferenceUrl, PromptEcho, PromptEchoProps, PromptLines, PromptLinesProps, PromptSlotProps, ProseMarkdown, ProseMarkdownProps, ReadFileBlock, ReadFileBlockProps, RefChip, RefChipProps, RefMatch, ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps, RowContext, RowFrame, RowFrameProps, RowIconsContext, RowPlace, RunReceiptInline, RunReceiptInlineProps, RunSummaryRow, RunSummaryRowProps, RunnableCodeBlock, type RunnableCodeBlockProps, ScrollPosition, SearchHighlightStyle, SelectCursor, SelectCursorProps, SelectTurnCommands, SelectTurnExit, SelectTurnHintKeys, SelectTurnHintKeysProps, SelectTurnKeysOptions, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, SessionCard, SessionCardProps, SessionEventRow, SessionEventRowProps, SessionTitleSlotProps, ShellBlockProvider, type ShellBlockProviderProps, type ShellBlockScope, SkillCard, SkillCardProps, SlotEntry, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps, StickToBottomOptions, SubagentBlock, SubagentBlockProps, TextPreviewSlotProps, TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingRow, ThinkingRowProps, ToolBatchRow, ToolBatchRowProps, ToolBodySlotProps, ToolDetails, ToolDetailsProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolMedia, type ToolMediaItem, ToolMediaProps, ToolRow, ToolRowProps, ToolTiming, ToolTimingProps, TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, TranscriptFind, TranscriptFindKeyOptions, TranscriptFindOptions, TranscriptFindTarget, TranscriptRenderers, TranscriptRenderersProvider, type TranscriptRenderersProviderProps, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptRows, TranscriptRowsInput, TranscriptScrollInputs, TranscriptSearch, TranscriptSearchOptions, TranscriptSearchProps, TranscriptSearchState, TranscriptSettling, TranscriptTurnMenu, TurnCommands, TurnCommandsOptions, TurnMenuActions, TurnMenuTarget, UserBashRow, UserBashRowProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps, WorkerDetails, WorkerDetailsProps, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph, mountRowNow, numberRef, parseRefUrl, parseReferenceUrl, parseToolMedia, refHref, referenceUrl, remarkReferences, remarkRefs, savedPaths, siteIconValue, useBackgroundMount, useBadgeMenu, useChipResolution, useCommand, useCommitInfo, useComposerSearch, useFillViewportScrollback, useForceMountRows, useFullOutput, useModelName, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useResolveChipNow, useRowIcons, useSelectStops, useSelectTurn, useSelectTurnKeys, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause };
|
|
@@ -38,6 +38,7 @@ import { ImageGenerationBlock, drawsImageGeneration, imageRequestsOf, savedPaths
|
|
|
38
38
|
import { ModelVerdict, NestedToolCalls, ToolRow } from "./tool-row.js";
|
|
39
39
|
import { ExchangeFoldRow, FoldHeader } from "./fold.js";
|
|
40
40
|
import { MessageGroupRow } from "./messages.js";
|
|
41
|
+
import { AuthFailureCard } from "./AuthFailureCard.js";
|
|
41
42
|
import { COMMAND_DETAIL_LINE, CommandDetailRow, CommandNoteRow, ErrorRow, FailureRow, InfoRow, NoticeRow, SessionEventRow, SpawnEndRow, SpawnStartRow } from "./notices.js";
|
|
42
43
|
import { AttachmentIcon, UserPromptAttachments, UserPromptRow } from "./prompt.js";
|
|
43
44
|
import { CompactSummaryRow, RunReceiptInline, RunSummaryRow } from "./run-rows.js";
|
|
@@ -66,4 +67,4 @@ import { useTranscriptFindKey } from "./useTranscriptFindKey.js";
|
|
|
66
67
|
import { useTranscriptFind } from "./useTranscriptFind.js";
|
|
67
68
|
import { useTurnMenu } from "./TurnMenu.js";
|
|
68
69
|
import { createTurnCommands, useTurnCommands } from "./turn-commands.js";
|
|
69
|
-
export { AUTO_FILL_PAGES, AnsiSpans, AnsiText, AttachmentIcon, BADGE_GLYPH, BadgeMenuProvider, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, Caret, ChipCard, ChipHover, CodemodeScript, CommandCard, CommandDetailRow, CommandNoteRow, CommandScopeContext, CommitCard, CompactSummaryRow, CvRow, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, DiffLines, Dot, EditDiffBlock, ErrorRow, ExchangeFoldRow, FILL_MIN_PROMPTS, FailedMark, FailureRow, FileBadgeIcon, FoldHeader, GUTTER_STEP_PX, INLINE_CODE_CLASS, ImageGenerationBlock, InfoRow, InlineChipText, InlineCode, InteractionToolBody, LazyRow, LinkBadge, LinkIcon, LiveOutput, LoadEarlierRow, LoadFullOutputButton, MAX_MATCHES, Markdown, MarkdownContext, MarkdownDiagrams, MermaidDiagram, MessageGroupRow, ModelVerdict, NestedToolCalls, NoticeRow, OpenSessionContext, PromptEcho, PromptLines, ProseMarkdown, ReadFileBlock, RefChip, ReferenceChip, ReferenceText, RowFrame, RowIconsContext, RunReceiptInline, RunSummaryRow, RunnableCodeBlock, SearchHighlightStyle, SelectCursor, SelectTurnExit, SelectTurnHintKeys, SelectTurnProvider, SessionCard, SessionEventRow, ShellBlockProvider, SkillCard, SpawnEndRow, SpawnStartRow, SubagentBlock, TextRow, ThinkingBatchRow, ThinkingRow, ToolBatchRow, ToolDetails, ToolGlyph, ToolInput, ToolMedia, ToolRow, ToolTiming, TranscriptActionsProvider, TranscriptRenderersProvider, TranscriptRow, TranscriptRowSlot, TranscriptSearch, TranscriptSettling, UserBashRow, UserPromptAttachments, UserPromptRow, WorkerDetails, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph, mountRowNow, numberRef, parseRefUrl, parseReferenceUrl, parseToolMedia, refHref, referenceUrl, remarkReferences, remarkRefs, savedPaths, siteIconValue, useBackgroundMount, useBadgeMenu, useChipResolution, useCommand, useCommitInfo, useComposerSearch, useFillViewportScrollback, useForceMountRows, useFullOutput, useModelName, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useResolveChipNow, useRowIcons, useSelectStops, useSelectTurn, useSelectTurnKeys, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause };
|
|
70
|
+
export { AUTO_FILL_PAGES, AnsiSpans, AnsiText, AttachmentIcon, AuthFailureCard, BADGE_GLYPH, BadgeMenuProvider, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, Caret, ChipCard, ChipHover, CodemodeScript, CommandCard, CommandDetailRow, CommandNoteRow, CommandScopeContext, CommitCard, CompactSummaryRow, CvRow, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, DiffLines, Dot, EditDiffBlock, ErrorRow, ExchangeFoldRow, FILL_MIN_PROMPTS, FailedMark, FailureRow, FileBadgeIcon, FoldHeader, GUTTER_STEP_PX, INLINE_CODE_CLASS, ImageGenerationBlock, InfoRow, InlineChipText, InlineCode, InteractionToolBody, LazyRow, LinkBadge, LinkIcon, LiveOutput, LoadEarlierRow, LoadFullOutputButton, MAX_MATCHES, Markdown, MarkdownContext, MarkdownDiagrams, MermaidDiagram, MessageGroupRow, ModelVerdict, NestedToolCalls, NoticeRow, OpenSessionContext, PromptEcho, PromptLines, ProseMarkdown, ReadFileBlock, RefChip, ReferenceChip, ReferenceText, RowFrame, RowIconsContext, RunReceiptInline, RunSummaryRow, RunnableCodeBlock, SearchHighlightStyle, SelectCursor, SelectTurnExit, SelectTurnHintKeys, SelectTurnProvider, SessionCard, SessionEventRow, ShellBlockProvider, SkillCard, SpawnEndRow, SpawnStartRow, SubagentBlock, TextRow, ThinkingBatchRow, ThinkingRow, ToolBatchRow, ToolDetails, ToolGlyph, ToolInput, ToolMedia, ToolRow, ToolTiming, TranscriptActionsProvider, TranscriptRenderersProvider, TranscriptRow, TranscriptRowSlot, TranscriptSearch, TranscriptSettling, UserBashRow, UserPromptAttachments, UserPromptRow, WorkerDetails, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph, mountRowNow, numberRef, parseRefUrl, parseReferenceUrl, parseToolMedia, refHref, referenceUrl, remarkReferences, remarkRefs, savedPaths, siteIconValue, useBackgroundMount, useBadgeMenu, useChipResolution, useCommand, useCommitInfo, useComposerSearch, useFillViewportScrollback, useForceMountRows, useFullOutput, useModelName, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useResolveChipNow, useRowIcons, useSelectStops, useSelectTurn, useSelectTurnKeys, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause };
|
|
@@ -84,7 +84,8 @@ interface FailureRowProps {
|
|
|
84
84
|
* word a small button that picks the work back up: Continue when the run
|
|
85
85
|
* had done something, Retry (the same prompt) when it had not. Both hand
|
|
86
86
|
* their prompt to `onResume` (the desktop app: the composer's send); without
|
|
87
|
-
* it there is no button.
|
|
87
|
+
* it there is no button. A run stopped by a failed sign-in (`detail.auth`)
|
|
88
|
+
* shows the sign-in's card instead (`AuthFailureCard`).
|
|
88
89
|
*/
|
|
89
90
|
declare const FailureRow: import("react").MemoExoticComponent<({ text, detail, failure, resumable, onResume, className, style }: FailureRowProps) => import("react").JSX.Element>;
|
|
90
91
|
/** Props for {@link SessionEventRow}. */
|
|
@@ -3,6 +3,7 @@ import { useChatLabels } from "../useChatLabels.js";
|
|
|
3
3
|
import { Caret } from "./frame.js";
|
|
4
4
|
import { useTranscriptRenderers } from "./renderers.js";
|
|
5
5
|
import { failureTooltip } from "../headless/transcript/run-failures.js";
|
|
6
|
+
import { AuthFailureCard } from "./AuthFailureCard.js";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { memo, useId, useState } from "react";
|
|
8
9
|
import { CONTINUE_PROMPT, SESSION_EVENT_STATUS_STYLE, describeSpawnEnd, sessionDirLabel, sessionEventExcerpt, sessionEventMeta, shortSessionId, spawnStartParts } from "zidane/chat/pure";
|
|
@@ -100,10 +101,21 @@ const ErrorRow = memo(({ text, className, style }) => {
|
|
|
100
101
|
* word a small button that picks the work back up: Continue when the run
|
|
101
102
|
* had done something, Retry (the same prompt) when it had not. Both hand
|
|
102
103
|
* their prompt to `onResume` (the desktop app: the composer's send); without
|
|
103
|
-
* it there is no button.
|
|
104
|
+
* it there is no button. A run stopped by a failed sign-in (`detail.auth`)
|
|
105
|
+
* shows the sign-in's card instead (`AuthFailureCard`).
|
|
104
106
|
*/
|
|
105
107
|
const FailureRow = memo(({ text, detail, failure, resumable, onResume, className, style }) => {
|
|
106
108
|
const labels = useChatLabels();
|
|
109
|
+
if (detail?.auth && failure.cause === "error") return /* @__PURE__ */ jsx(AuthFailureCard, {
|
|
110
|
+
auth: detail.auth,
|
|
111
|
+
text,
|
|
112
|
+
detail,
|
|
113
|
+
failure,
|
|
114
|
+
resumable,
|
|
115
|
+
...onResume ? { onResume } : {},
|
|
116
|
+
className,
|
|
117
|
+
style
|
|
118
|
+
});
|
|
107
119
|
const retry = failure.resume === "retry" && failure.prompt;
|
|
108
120
|
const byUser = failure.cause === "aborted";
|
|
109
121
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolRowModel } from "../headless/transcript/rows.js";
|
|
2
2
|
import "../headless/transcript/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Gw as ScriptProgress } from "../../dist/index-DqCio7Nd.js";
|
|
4
4
|
//#region src/chat/transcript/script-input.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* A tool row's progress and how it ended, as `ToolInput` takes them for a Codemode script.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { iconButtonClass } from "../../components/IconButton.js";
|
|
2
2
|
import { CopyButton } from "../../components/CopyButton.js";
|
|
3
3
|
import { constant, useReadable } from "../headless/store.js";
|
|
4
|
+
import "../headless/block-runs.js";
|
|
4
5
|
import { useOptionalChatHost } from "../ChatProvider.js";
|
|
5
6
|
import { useChatLabels } from "../useChatLabels.js";
|
|
6
7
|
import { relativeTime } from "../headless/session-list.js";
|
|
@@ -9,7 +10,6 @@ import { useTranscriptActions } from "./actions.js";
|
|
|
9
10
|
import { AnsiText } from "./AnsiText.js";
|
|
10
11
|
import { LiveOutput } from "./LiveOutput.js";
|
|
11
12
|
import { ToolTiming } from "./tool-parts.js";
|
|
12
|
-
import "../headless/block-runs.js";
|
|
13
13
|
import { pushComposerAttachment, textAttachment } from "../composer/composer-bus.js";
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { Suspense, lazy, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
@@ -20,6 +20,13 @@ interface HowItWorksProps {
|
|
|
20
20
|
illustration: ReactNode | ((step: number) => ReactNode);
|
|
21
21
|
/** Buttons or links that act on what the tutorial explains, such as "Build an extension". */
|
|
22
22
|
actions?: ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* The block's surface: `tray` sits into the page (a settings page), `raised`
|
|
25
|
+
* lifts it off a bare panel so it stands out there.
|
|
26
|
+
*
|
|
27
|
+
* @default 'tray'
|
|
28
|
+
*/
|
|
29
|
+
surface?: 'tray' | 'raised';
|
|
23
30
|
/** Extra classes on the block. */
|
|
24
31
|
className?: string;
|
|
25
32
|
/** Inline styles on the root element, merged after the component's own. */
|
|
@@ -30,6 +37,6 @@ interface HowItWorksProps {
|
|
|
30
37
|
*
|
|
31
38
|
* @param props - Component props.
|
|
32
39
|
*/
|
|
33
|
-
declare function HowItWorks({ title, steps, illustration, actions, className, style }: HowItWorksProps): import("react").JSX.Element;
|
|
40
|
+
declare function HowItWorks({ title, steps, illustration, actions, surface, className, style }: HowItWorksProps): import("react").JSX.Element;
|
|
34
41
|
//#endregion
|
|
35
42
|
export { HowItWorks, HowItWorksProps, HowItWorksStep };
|
|
@@ -17,7 +17,7 @@ import { useCallback, useEffect, useId, useRef, useState } from "react";
|
|
|
17
17
|
*
|
|
18
18
|
* @param props - Component props.
|
|
19
19
|
*/
|
|
20
|
-
function HowItWorks({ title, steps, illustration, actions, className = "", style }) {
|
|
20
|
+
function HowItWorks({ title, steps, illustration, actions, surface = "tray", className = "", style }) {
|
|
21
21
|
const id = useId();
|
|
22
22
|
const [shown, setShown] = useState(0);
|
|
23
23
|
const tour = typeof illustration === "function";
|
|
@@ -26,7 +26,7 @@ function HowItWorks({ title, steps, illustration, actions, className = "", style
|
|
|
26
26
|
return /* @__PURE__ */ jsx("div", {
|
|
27
27
|
role: "group",
|
|
28
28
|
"aria-labelledby": `${id}-title`,
|
|
29
|
-
className: `zg-how zg-tray rounded-zg-xl p-2 ${className}`,
|
|
29
|
+
className: `zg-how ${surface === "raised" ? "zg-raised border" : "zg-tray"} rounded-zg-xl p-2 ${className}`,
|
|
30
30
|
style,
|
|
31
31
|
children: /* @__PURE__ */ jsxs("div", {
|
|
32
32
|
className: "zg-how-split",
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { CSSProperties } from "react";
|
|
1
|
+
import { CSSProperties, ReactElement } from "react";
|
|
2
2
|
//#region src/components/RowActionsMenu.d.ts
|
|
3
3
|
interface RowActionBase {
|
|
4
4
|
/** Stable identifier, used as the row's key. */
|
|
5
5
|
id: string;
|
|
6
6
|
/** Text of the row. */
|
|
7
7
|
label: string;
|
|
8
|
+
/**
|
|
9
|
+
* Leading glyph, drawn muted: an icon class (`i-ph-terminal-window`), or an element (a logo). Give every row
|
|
10
|
+
* of a menu one, or none.
|
|
11
|
+
*/
|
|
12
|
+
icon?: string | ReactElement;
|
|
8
13
|
/** Red-tinted treatment for destructive actions (e.g. Delete). */
|
|
9
14
|
destructive?: boolean;
|
|
10
15
|
/** Grays the row out and ignores clicks + shortcut dispatch (e.g. while the action is already running). */
|