@strands-agents/cli 0.1.1 → 0.1.3
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/README.md +15 -8
- package/dist/src/cli/run.js +2 -9
- package/dist/src/cli/run.js.map +1 -1
- package/dist/src/tui/agent-configuration.js +30 -38
- package/dist/src/tui/agent-configuration.js.map +1 -1
- package/dist/src/tui/builtin-tools.js +29 -0
- package/dist/src/tui/builtin-tools.js.map +1 -1
- package/dist/src/tui/chat/commands.js +1 -0
- package/dist/src/tui/chat/commands.js.map +1 -1
- package/dist/src/tui/chat/controller.js +93 -136
- package/dist/src/tui/chat/controller.js.map +1 -1
- package/dist/src/tui/chat/help.js +2 -1
- package/dist/src/tui/chat/help.js.map +1 -1
- package/dist/src/tui/chat/panels.js +22 -20
- package/dist/src/tui/chat/panels.js.map +1 -1
- package/dist/src/tui/chat/types.js.map +1 -1
- package/dist/src/tui/config.js +4 -61
- package/dist/src/tui/config.js.map +1 -1
- package/dist/src/tui/model/context.js +10 -2
- package/dist/src/tui/model/context.js.map +1 -1
- package/dist/src/tui/permissions/policy.js +1 -9
- package/dist/src/tui/permissions/policy.js.map +1 -1
- package/dist/src/tui/permissions/settings.js +9 -8
- package/dist/src/tui/permissions/settings.js.map +1 -1
- package/dist/src/tui/project/export.js +19 -2
- package/dist/src/tui/project/export.js.map +1 -1
- package/dist/src/tui/project/run.js +0 -2
- package/dist/src/tui/project/run.js.map +1 -1
- package/dist/src/tui/project/worker.py +6 -0
- package/dist/src/tui/provider/aws-client.js +3 -3
- package/dist/src/tui/provider/aws-client.js.map +1 -1
- package/dist/src/tui/run.js +5 -12
- package/dist/src/tui/run.js.map +1 -1
- package/dist/src/tui/runtime.js +8 -9
- package/dist/src/tui/runtime.js.map +1 -1
- package/dist/src/tui/session/conversations.js +2 -5
- package/dist/src/tui/session/conversations.js.map +1 -1
- package/dist/src/tui/strands-backend.js +0 -6
- package/dist/src/tui/strands-backend.js.map +1 -1
- package/dist/src/tui/terminal/composer.js +1 -1
- package/dist/src/tui/terminal/composer.js.map +1 -1
- package/dist/src/tui/view/app.js +36 -65
- package/dist/src/tui/view/app.js.map +1 -1
- package/dist/src/tui/view/chat-root.js +38 -29
- package/dist/src/tui/view/chat-root.js.map +1 -1
- package/dist/src/tui/view/chat-view.js +4 -39
- package/dist/src/tui/view/chat-view.js.map +1 -1
- package/dist/src/tui/view/frog-intro-renderer.js +14 -84
- package/dist/src/tui/view/frog-intro-renderer.js.map +1 -1
- package/dist/src/tui/view/help-footer.js +16 -12
- package/dist/src/tui/view/help-footer.js.map +1 -1
- package/dist/src/tui/view/interaction.js +1 -1
- package/dist/src/tui/view/interaction.js.map +1 -1
- package/dist/src/tui/view/intro.js +25 -3
- package/dist/src/tui/view/intro.js.map +1 -1
- package/dist/src/tui/view/mcp-trust-prompt.js +17 -0
- package/dist/src/tui/view/mcp-trust-prompt.js.map +1 -0
- package/dist/src/tui/view/model-panel.js +5 -6
- package/dist/src/tui/view/model-panel.js.map +1 -1
- package/dist/src/tui/view/panel-components.js +3 -2
- package/dist/src/tui/view/panel-components.js.map +1 -1
- package/dist/src/tui/view/panels.js +19 -11
- package/dist/src/tui/view/panels.js.map +1 -1
- package/dist/src/tui/view/presentation.js +2 -1
- package/dist/src/tui/view/presentation.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/index.js +248 -172
- package/dist/src/tui/view/setup-wizard/index.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/progress.js +1 -2
- package/dist/src/tui/view/setup-wizard/progress.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/providers.js +11 -3
- package/dist/src/tui/view/setup-wizard/providers.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/steps.js +97 -54
- package/dist/src/tui/view/setup-wizard/steps.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/use-provider-discovery.js +1 -3
- package/dist/src/tui/view/setup-wizard/use-provider-discovery.js.map +1 -1
- package/dist/src/tui/view/startup-view.js +4 -2
- package/dist/src/tui/view/startup-view.js.map +1 -1
- package/package.json +2 -2
- package/dist/src/tui/agent-setup.js +0 -80
- package/dist/src/tui/agent-setup.js.map +0 -1
- package/dist/src/tui/setup/questions.js +0 -277
- package/dist/src/tui/setup/questions.js.map +0 -1
- package/dist/src/tui/view/setup-question.js +0 -90
- package/dist/src/tui/view/setup-question.js.map +0 -1
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
3
|
import { Box, useInput, useStdout, useWindowSize } from 'ink';
|
|
4
|
+
import stringWidth from 'string-width';
|
|
4
5
|
import { PROVIDER_CREDENTIAL_KEYS, PROVIDER_ENVIRONMENT_KEYS, PROVIDER_LABELS, PROVIDER_IDS, } from '../../config.js';
|
|
5
6
|
import { importAgentProject } from '../../project/import.js';
|
|
7
|
+
import { exportFileName, exportSavedAgent } from '../../project/export.js';
|
|
6
8
|
import { configurationFromStore } from '../../agent-configuration.js';
|
|
7
9
|
import { DEFAULT_SETTINGS_CATEGORY, SETTINGS_CATEGORIES } from '../../settings.js';
|
|
8
10
|
import { parseMouseInput } from '../../terminal/mouse-input.js';
|
|
9
11
|
import { emptyEditor, graphemes, reduceInputSequence } from '../../terminal/composer.js';
|
|
10
12
|
import { errorMessage, sanitizeTerminalText } from '../../terminal/sanitize.js';
|
|
11
|
-
import { canChooseDirectory, chooseAgentProject, chooseDirectory } from '../../terminal/directory-picker.js';
|
|
13
|
+
import { canChooseDirectory, chooseAgentProject, chooseDirectory, chooseSaveFile, } from '../../terminal/directory-picker.js';
|
|
12
14
|
import { setTerminalMouseMotion } from '../../terminal/terminal.js';
|
|
13
|
-
import { renderSetupGuideTransitionFrame, SETUP_GUIDE_TRANSITION_DURATION_MS, setupGuideLayout, } from '../frog-intro-renderer.js';
|
|
14
15
|
import { elementAtMouse, elementContainsMouse, registerElement, mouseScrollDirection, scrollPanelViewport, revealPanelSelection, sliderOptionAtMouse, } from '../interaction.js';
|
|
15
16
|
import { wrapLines } from '../presentation.js';
|
|
16
17
|
import { Text, ThemeProvider, useTheme } from '../theme.js';
|
|
17
18
|
import { BlinkingCursor, EditableText } from '../text-input.js';
|
|
18
19
|
import { CustomThemeEditor } from '../custom-theme-editor.js';
|
|
19
20
|
import { Fade, mixHexColors, useFadeTransition } from '../fade-in.js';
|
|
20
|
-
import { PROVIDERS, compatibleProfile, exaWebSearchActive, providerAssessment, providerFromModel, quickstartDraft, } from './providers.js';
|
|
21
|
+
import { PROVIDERS, compatibleProfile, exaWebSearchActive, providerSupportsWebSearch, providerAssessment, providerFromModel, quickstartDraft, } from './providers.js';
|
|
21
22
|
import { EXA_WEB_SEARCH_WARNING } from '../../builtin-tools.js';
|
|
22
23
|
import { memoryForDir } from './profile-fields.js';
|
|
23
|
-
import { APPEARANCE_STEP, appearanceSettings,
|
|
24
|
+
import { APPEARANCE_STEP, appearanceSettings, CUSTOMIZE_STEPS, exportRows, OPENING_CHOICES, rowsForStep, setupStepProgress, wizardSettingsRows, } from './steps.js';
|
|
24
25
|
import { useBrandAnimation } from '../startup-view.js';
|
|
25
26
|
import { SetupBrand, setupBrandFrame } from './brand.js';
|
|
26
27
|
import { OpeningMenu } from './opening-menu.js';
|
|
@@ -34,7 +35,7 @@ export function SetupWizard(props) {
|
|
|
34
35
|
const [appearance, setAppearance] = useState(() => appearanceSettings({ ...props.config.snapshot().settings, ...props.initialSettings }));
|
|
35
36
|
return (_jsx(ThemeProvider, { settings: appearance, children: _jsx(SetupWizardContent, { ...props, appearance: appearance, setAppearance: setAppearance }) }));
|
|
36
37
|
}
|
|
37
|
-
function SetupWizardContent({ appearance, setAppearance, config, deferred = false, appearanceOnly = false, onComplete, onCancel,
|
|
38
|
+
function SetupWizardContent({ appearance, setAppearance, config, deferred = false, appearanceOnly = false, onComplete, onCancel, initialSettings, }) {
|
|
38
39
|
const { stdout } = useStdout();
|
|
39
40
|
const { columns, rows: terminalRows } = useWindowSize();
|
|
40
41
|
const [flow, setFlow] = useState();
|
|
@@ -78,9 +79,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
78
79
|
},
|
|
79
80
|
};
|
|
80
81
|
});
|
|
81
|
-
const [setupTarget, setSetupTarget] = useState();
|
|
82
82
|
const [profileBaseDir] = useState(() => config.snapshot().profileBaseDir);
|
|
83
83
|
const [importPath, setImportPath] = useState('');
|
|
84
|
+
const [exportLanguage, setExportLanguage] = useState('typescript');
|
|
85
|
+
const [exportPath, setExportPath] = useState('');
|
|
86
|
+
const [exportedPath, setExportedPath] = useState();
|
|
84
87
|
const [editing, setEditing] = useState();
|
|
85
88
|
const [pathCompletionIndex, setPathCompletionIndex] = useState(-1);
|
|
86
89
|
const [error, setError] = useState();
|
|
@@ -92,15 +95,15 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
92
95
|
const [modelViewportStart, setModelViewportStart] = useState(0);
|
|
93
96
|
const [modelQuery, setModelQuery] = useState('');
|
|
94
97
|
const [modelSearchFocused, setModelSearchFocused] = useState(false);
|
|
98
|
+
const [deselectedModel, setDeselectedModel] = useState();
|
|
95
99
|
const modelListElement = useRef(null);
|
|
96
100
|
const modelSearchElement = useRef(null);
|
|
101
|
+
const modelPreviousElement = useRef(null);
|
|
102
|
+
const modelNextElement = useRef(null);
|
|
97
103
|
const setupEffortSliderElement = useRef(null);
|
|
98
104
|
const [quickstartProvider, setQuickstartProvider] = useState('bedrock');
|
|
99
105
|
const [selecting, setSelecting] = useState();
|
|
100
106
|
const [frogAnimationId, setFrogAnimationId] = useState();
|
|
101
|
-
const [agentHandoff, setAgentHandoff] = useState();
|
|
102
|
-
const [agentHandoffElapsedMs, setAgentHandoffElapsedMs] = useState(0);
|
|
103
|
-
const agentHandoffDelivered = useRef(false);
|
|
104
107
|
const rowElements = useRef(new Map());
|
|
105
108
|
const directoryElements = useRef(new Map());
|
|
106
109
|
const pathCompletionElements = useRef(new Map());
|
|
@@ -114,33 +117,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
114
117
|
const pressedElement = useRef(undefined);
|
|
115
118
|
const width = Math.max(1, columns);
|
|
116
119
|
const height = Math.max(1, terminalRows);
|
|
117
|
-
useEffect(() => {
|
|
118
|
-
if (!agentHandoff || !onAgentSetup) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const duration = appearance.animations ? SETUP_GUIDE_TRANSITION_DURATION_MS : 0;
|
|
122
|
-
const startedAt = Date.now();
|
|
123
|
-
const finish = () => {
|
|
124
|
-
if (!agentHandoffDelivered.current) {
|
|
125
|
-
agentHandoffDelivered.current = true;
|
|
126
|
-
onAgentSetup(agentHandoff);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
setAgentHandoffElapsedMs(duration === 0 ? SETUP_GUIDE_TRANSITION_DURATION_MS : 0);
|
|
130
|
-
if (duration === 0) {
|
|
131
|
-
finish();
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const timer = setInterval(() => {
|
|
135
|
-
const elapsed = Math.min(duration, Date.now() - startedAt);
|
|
136
|
-
setAgentHandoffElapsedMs(elapsed);
|
|
137
|
-
if (elapsed >= duration) {
|
|
138
|
-
clearInterval(timer);
|
|
139
|
-
finish();
|
|
140
|
-
}
|
|
141
|
-
}, 32);
|
|
142
|
-
return () => clearInterval(timer);
|
|
143
|
-
}, [agentHandoff, appearance.animations, onAgentSetup]);
|
|
144
120
|
const navigationHeight = width < 32 ? 2 : 3;
|
|
145
121
|
const accent = palette.accent;
|
|
146
122
|
const pathEditing = editing?.field === 'importPath' ? editing : undefined;
|
|
@@ -199,14 +175,15 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
199
175
|
},
|
|
200
176
|
}));
|
|
201
177
|
}, [setAppearance]);
|
|
202
|
-
const isProviderSetup = (flow === 'quickstart' || flow === '
|
|
203
|
-
const isTools =
|
|
204
|
-
const isPlugins =
|
|
178
|
+
const isProviderSetup = (flow === 'quickstart' || flow === 'customize') && step === 1;
|
|
179
|
+
const isTools = flow === 'customize' && step === 3;
|
|
180
|
+
const isPlugins = flow === 'customize' && step === 4;
|
|
205
181
|
const isCapabilities = isTools || isPlugins;
|
|
206
|
-
const isPermissions = flow === '
|
|
182
|
+
const isPermissions = flow === 'customize' && step === 6;
|
|
207
183
|
const isImport = flow === 'import' && step === 1;
|
|
208
|
-
const
|
|
209
|
-
const
|
|
184
|
+
const isExport = flow === 'export' && step === 1;
|
|
185
|
+
const hasExternalActions = !isSettings && (isProviderSetup || isImport || isExport || isCapabilities || isAppearance || flow === 'customize');
|
|
186
|
+
const bubbleWidth = Math.max(1, Math.min(isProviderSetup ? 144 : 112, width - 2));
|
|
210
187
|
const lockupWidth = Math.max(1, width - 2);
|
|
211
188
|
const brandFrame = setupBrandFrame(lockupWidth, height);
|
|
212
189
|
const lockupHeight = brandFrame.height;
|
|
@@ -236,13 +213,15 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
236
213
|
: isProviderSetup
|
|
237
214
|
? 4
|
|
238
215
|
: isCapabilities
|
|
239
|
-
?
|
|
216
|
+
? 1
|
|
240
217
|
: isPermissions
|
|
241
218
|
? 2
|
|
242
|
-
: flow === '
|
|
219
|
+
: flow === 'customize'
|
|
243
220
|
? step === 2
|
|
244
221
|
? 5
|
|
245
|
-
:
|
|
222
|
+
: step === 5
|
|
223
|
+
? 2
|
|
224
|
+
: 3
|
|
246
225
|
: 2;
|
|
247
226
|
const updateProfile = useCallback((update) => {
|
|
248
227
|
setDraft((current) => ({ ...current, profile: { ...current.profile, ...update } }));
|
|
@@ -263,10 +242,18 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
263
242
|
const setupReadyProviders = useMemo(() => unavailableCredentialProvider
|
|
264
243
|
? readyProviders.filter((provider) => provider !== unavailableCredentialProvider)
|
|
265
244
|
: readyProviders, [readyProviders, unavailableCredentialProvider]);
|
|
245
|
+
const agentName = draft.profile.name;
|
|
246
|
+
const changeExportLanguage = useCallback((language) => {
|
|
247
|
+
setExportLanguage(language);
|
|
248
|
+
setExportedPath(undefined);
|
|
249
|
+
setExportPath((path) => path === exportFileName(agentName, exportLanguage) ? exportFileName(agentName, language) : path);
|
|
250
|
+
}, [agentName, exportLanguage]);
|
|
266
251
|
const rows = useMemo(() => {
|
|
267
252
|
const stepRows = isAppearance
|
|
268
253
|
? wizardSettingsRows({ ...panelSettings, ...draft.settings, ...appearance }, isSettings ? updateSettings : updateSetupSettings, openAppearance, 'all').filter(({ section }) => section === settingsCategory)
|
|
269
|
-
:
|
|
254
|
+
: isExport
|
|
255
|
+
? exportRows(exportLanguage, exportPath, exportedPath, changeExportLanguage, setEditing)
|
|
256
|
+
: rowsForStep(step, flow, draft, importPath, providerEnvironment, detectedEnvironment, quickstartProvider, setupReadyProviders, awsDiscovery, ollamaDiscovery, setDraft, updateProfile, setEditing, liteLlmDiscovery, credentialRejectedProvider, credentialValidationProvider, providerModels.error);
|
|
270
257
|
return isProviderSetup
|
|
271
258
|
? [
|
|
272
259
|
...stepRows,
|
|
@@ -301,6 +288,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
301
288
|
draft,
|
|
302
289
|
flow,
|
|
303
290
|
importPath,
|
|
291
|
+
isExport,
|
|
292
|
+
exportLanguage,
|
|
293
|
+
exportPath,
|
|
294
|
+
exportedPath,
|
|
295
|
+
changeExportLanguage,
|
|
304
296
|
ollamaDiscovery,
|
|
305
297
|
liteLlmDiscovery,
|
|
306
298
|
providerEnvironment,
|
|
@@ -314,11 +306,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
314
306
|
updateProfile,
|
|
315
307
|
]);
|
|
316
308
|
const selectedModelProvider = providerFromModel(draft.profile.model);
|
|
309
|
+
const hasSelectedModel = deselectedModel !== draft.profile.model;
|
|
317
310
|
const canContinue = step !== 1 ||
|
|
318
|
-
(flow === 'import'
|
|
319
|
-
? importPath.trim().length > 0
|
|
311
|
+
(flow === 'import' || flow === 'export'
|
|
312
|
+
? (flow === 'import' ? importPath : exportPath).trim().length > 0
|
|
320
313
|
: isProviderSetup
|
|
321
|
-
?
|
|
314
|
+
? hasSelectedModel &&
|
|
315
|
+
selectedModelProvider === quickstartProvider &&
|
|
316
|
+
setupReadyProviders.includes(quickstartProvider)
|
|
322
317
|
: draft.providers.some((provider) => readyProviders.includes(provider)));
|
|
323
318
|
const inspectedProvider = isProviderSetup ? quickstartProvider : undefined;
|
|
324
319
|
const inspectedAssessment = inspectedProvider
|
|
@@ -326,6 +321,9 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
326
321
|
: undefined;
|
|
327
322
|
const warning = keyCredentialProvider ? undefined : inspectedAssessment?.warning;
|
|
328
323
|
const assessmentFacts = inspectedAssessment?.facts ?? [];
|
|
324
|
+
const quickstartExaSearchActive = flow === 'quickstart' && step === 1 && exaWebSearchActive(draft.profile);
|
|
325
|
+
const quickstartWebSearchOffered = rows.some((row) => row.id === 'quickstart-web-search');
|
|
326
|
+
const canShowQuickstartOptionsPanel = splitQuickstart && quickstartDetailColumnWidth >= 62;
|
|
329
327
|
const bannerWarning = warning
|
|
330
328
|
? assessmentFacts.length > 0
|
|
331
329
|
? [
|
|
@@ -335,7 +333,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
335
333
|
warning,
|
|
336
334
|
].join('\n')
|
|
337
335
|
: `${PROVIDER_LABELS[inspectedProvider]}: ${warning}`
|
|
338
|
-
: isTools
|
|
336
|
+
: isTools || quickstartExaSearchActive
|
|
339
337
|
? EXA_WEB_SEARCH_WARNING
|
|
340
338
|
: undefined;
|
|
341
339
|
const bannerWarningStatus = warning ? inspectedAssessment.status : 'warning';
|
|
@@ -343,10 +341,16 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
343
341
|
const showProviderConfiguration = isProviderSetup && !providerReady;
|
|
344
342
|
const modelPanelVisible = splitQuickstart && providerReady;
|
|
345
343
|
const availableBubbleHeight = Math.max(1, height - brandHeight - progressHeight - (hasExternalActions ? actionHeight + actionGap : 0) - navigationHeight);
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
const
|
|
344
|
+
const bannerLines = (text) => wrapLines(`⚠ ${text}`, Math.max(1, bubbleWidth - 4)).slice(0, Math.max(0, availableBubbleHeight - rowHeight - 1 - Number(error !== undefined)));
|
|
345
|
+
const warningLines = bannerWarning && !splitQuickstart ? bannerLines(bannerWarning) : [];
|
|
346
|
+
// Reserve the Exa banner's space whether or not web_search is on, so toggling it doesn't resize the panel.
|
|
347
|
+
const warningHeight = (isTools || (quickstartWebSearchOffered && !splitQuickstart)) &&
|
|
348
|
+
!warning &&
|
|
349
|
+
!providerSupportsWebSearch(draft.profile.model)
|
|
350
|
+
? bannerLines(EXA_WEB_SEARCH_WARNING).length
|
|
351
|
+
: warningLines.length;
|
|
352
|
+
const warningGap = (isCapabilities || flow === 'quickstart') && warningHeight > 0 ? 1 : 0;
|
|
353
|
+
const extraRows = Number(error !== undefined) + warningGap + warningHeight;
|
|
350
354
|
const capabilityContentHeight = Math.max(0, rows.length - 1) * rowHeight + 2;
|
|
351
355
|
const bubbleHeight = isImport
|
|
352
356
|
? Math.min(9 + extraRows + importCompletionCapacity, availableBubbleHeight)
|
|
@@ -356,10 +360,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
356
360
|
? Math.min(9 + Math.max(0, rows.length - 3) * rowHeight + extraRows, availableBubbleHeight)
|
|
357
361
|
: isAppearance
|
|
358
362
|
? availableBubbleHeight
|
|
359
|
-
: flow === '
|
|
363
|
+
: (flow === 'customize' && !isProviderSetup) || isExport
|
|
360
364
|
? Math.min(rows.length * rowHeight + 3 + extraRows, availableBubbleHeight)
|
|
361
365
|
: availableBubbleHeight;
|
|
362
|
-
const panelChromeHeight = isProviderSetup || isCapabilities ? 0 : isAppearance || flow === '
|
|
366
|
+
const panelChromeHeight = isProviderSetup || isCapabilities ? 0 : isAppearance || isExport || flow === 'customize' ? 2 : 4;
|
|
363
367
|
const rowCapacity = isAppearance
|
|
364
368
|
? settingsCategory === 'Appearance' && bubbleHeight < 18
|
|
365
369
|
? 1
|
|
@@ -368,6 +372,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
368
372
|
const firstListRow = isCapabilities ? 1 : 0;
|
|
369
373
|
const viewportStart = Math.max(firstListRow, Math.min(selection - rowCapacity + 1, rows.length - rowCapacity));
|
|
370
374
|
const visibleRows = rows.slice(viewportStart, viewportStart + rowCapacity);
|
|
375
|
+
const hiddenRowsBefore = viewportStart;
|
|
376
|
+
const hiddenRowsAfter = Math.max(0, rows.length - viewportStart - visibleRows.length);
|
|
377
|
+
const customizeOverflowLabel = [
|
|
378
|
+
hiddenRowsBefore > 0 ? `↑ ${hiddenRowsBefore} previous` : '',
|
|
379
|
+
hiddenRowsAfter > 0 ? `↓ ${hiddenRowsAfter} more` : '',
|
|
380
|
+
]
|
|
381
|
+
.filter(Boolean)
|
|
382
|
+
.join(' · ');
|
|
371
383
|
const visibleCapabilityRows = isCapabilities ? visibleRows.filter((row) => row.id !== 'select-all') : [];
|
|
372
384
|
const permissionToolCapacity = Math.max(1, Math.floor((bubbleHeight - 9 - extraRows) / rowHeight));
|
|
373
385
|
const permissionViewportStart = Math.max(3, Math.min(selection - permissionToolCapacity + 1, rows.length - permissionToolCapacity));
|
|
@@ -380,7 +392,8 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
380
392
|
? 'error'
|
|
381
393
|
: bannerWarningStatus;
|
|
382
394
|
const availableReasoningRow = providerConfigurationRows.find((row) => row.id === 'thinking');
|
|
383
|
-
const selectedModelAvailable =
|
|
395
|
+
const selectedModelAvailable = hasSelectedModel &&
|
|
396
|
+
providerModels.provider === quickstartProvider &&
|
|
384
397
|
providerModels.available &&
|
|
385
398
|
!providerModels.loading &&
|
|
386
399
|
providerModels.models.some((model) => `${quickstartProvider}/${model.id}` === draft.profile.model);
|
|
@@ -398,9 +411,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
398
411
|
...(reasoningRow.disabled ? { disabled: true } : {}),
|
|
399
412
|
}
|
|
400
413
|
: undefined;
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
const
|
|
414
|
+
const webSearchRow = providerConfigurationRows.find((row) => row.id === 'quickstart-web-search');
|
|
415
|
+
const showModelOptionsPanel = modelPanelVisible && canShowQuickstartOptionsPanel && (reasoningSlider !== undefined || webSearchRow !== undefined);
|
|
416
|
+
const showReasoningPanel = showModelOptionsPanel && reasoningSlider !== undefined;
|
|
417
|
+
const readyProviderControlRows = providerConfigurationRows.filter((row) => (row.id !== 'thinking' || (reasoningRow !== undefined && !showReasoningPanel)) &&
|
|
418
|
+
(row.id !== 'quickstart-web-search' || !showModelOptionsPanel));
|
|
419
|
+
const directoryRows = new Map(rows.flatMap((row, index) => canChooseDirectory() &&
|
|
420
|
+
!row.disabled &&
|
|
421
|
+
(row.field === 'memoryDir' || row.field === 'skills' || row.field === 'exportPath')
|
|
404
422
|
? [[index, row.field]]
|
|
405
423
|
: []));
|
|
406
424
|
const quickstartBodyHeight = bubbleHeight - panelChromeHeight - extraRows;
|
|
@@ -434,10 +452,16 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
434
452
|
const defaultModel = quickstartProvider === 'ollama' ? undefined : PROVIDERS[quickstartProvider].model(effectiveEnvironment);
|
|
435
453
|
const quickstartDefaultModel = defaultModel?.slice(defaultModel.indexOf('/') + 1);
|
|
436
454
|
const readyProviderControlsHeight = readyProviderControlRows.length * quickstartFieldRowHeight;
|
|
437
|
-
const quickstartModelRowHeight =
|
|
455
|
+
const quickstartModelRowHeight = 1;
|
|
438
456
|
const quickstartModelCapacity = Math.max(1, Math.floor((quickstartBodyHeight - 5 - readyProviderControlsHeight) / quickstartModelRowHeight));
|
|
439
457
|
const quickstartModelViewportStart = Math.max(0, Math.min(modelViewportStart, filteredProviderModels.length - quickstartModelCapacity));
|
|
440
458
|
const visibleProviderModels = filteredProviderModels.slice(quickstartModelViewportStart, quickstartModelViewportStart + quickstartModelCapacity);
|
|
459
|
+
const previousModelCount = quickstartModelViewportStart;
|
|
460
|
+
const nextModelCount = Math.max(0, filteredProviderModels.length - quickstartModelViewportStart - visibleProviderModels.length);
|
|
461
|
+
const showModelPagination = providerModels.provider === quickstartProvider && providerModels.available && visibleProviderModels.length > 0;
|
|
462
|
+
const quickstartModelContentWidth = Math.max(1, quickstartDetailColumnWidth - 4);
|
|
463
|
+
const quickstartModelNameWidth = Math.min(Math.max(1, ...filteredProviderModels.map((model) => stringWidth(model.name) + (model.id === quickstartDefaultModel ? 2 : 0))), Math.max(1, quickstartModelContentWidth - 15));
|
|
464
|
+
const quickstartModelIdWidth = Math.max(1, quickstartModelContentWidth - quickstartModelNameWidth - 3);
|
|
441
465
|
const quickstartSelectableRows = rows.length + (modelPanelVisible && providerModels.available ? filteredProviderModels.length : 0);
|
|
442
466
|
const controlBackground = (control, focused, disabled = false) => {
|
|
443
467
|
if (disabled || saving) {
|
|
@@ -450,9 +474,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
450
474
|
};
|
|
451
475
|
const backHoverBackground = mixHexColors(COMMAND_DECK_BACKGROUND, palette.error, palette.mode === 'dark' ? 0.22 : 0.16);
|
|
452
476
|
const nextHoverBackground = mixHexColors(COMMAND_DECK_BACKGROUND, palette.accent, palette.mode === 'dark' ? 0.22 : 0.16);
|
|
477
|
+
// Sized from every row, not just the visible ones, so descriptions stay aligned while scrolling.
|
|
478
|
+
const capabilityLabelWidth = Math.max(0, ...rows.filter((row) => row.id !== 'select-all').map((row) => graphemes(row.label).length));
|
|
453
479
|
const renderCapabilityRows = (capabilityRows) => (_jsx(Box, { flexGrow: 1, paddingX: 1, flexDirection: "column", overflow: "hidden", children: capabilityRows.map((row) => {
|
|
454
480
|
const index = rows.indexOf(row);
|
|
455
|
-
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), height:
|
|
481
|
+
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), height: 1, paddingX: 1, flexShrink: 0, backgroundColor: rowBackground(index), children: [_jsx(Box, { width: capabilityLabelWidth + 4, flexShrink: 0, children: _jsxs(Text, { color: row.active ? accent : palette.foreground, bold: index === selection, wrap: "truncate-end", children: [row.active ? '☑' : '☐', " ", row.label] }) }), _jsx(Text, { ...(row.descriptionColor ? { color: row.descriptionColor } : { dimColor: true }), wrap: "truncate-end", children: row.description })] }, row.id));
|
|
456
482
|
}) }));
|
|
457
483
|
const renderChoices = (choices, index) => (_jsx(Box, { flexWrap: "wrap", children: choices.map((choice, choiceIndex) => {
|
|
458
484
|
const target = `choice:${index}:${choiceIndex}`;
|
|
@@ -470,10 +496,24 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
470
496
|
const editable = row.input === true;
|
|
471
497
|
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), height: quickstartFieldRowHeight, flexShrink: 0, flexDirection: "column", backgroundColor: credential && editable ? undefined : rowBackground(index), children: [_jsx(Text, { bold: true, ...(index === selection ? { color: accent } : {}), wrap: "truncate-end", children: row.label }), editable ? (_jsxs(_Fragment, { children: [_jsx(Box, { width: fieldWidth, height: 3, paddingX: 1, alignItems: "center", backgroundColor: rowBackground(index) ?? COMMAND_DECK_BACKGROUND, children: _jsx(EditableText, { value: activeEditing?.value ?? (row.selectOptions ? row.description : ''), cursor: activeEditing?.cursor ?? graphemes(activeEditing?.value ?? '').length, width: Math.max(1, fieldWidth - 4), active: Boolean(activeEditing), animate: appearance.animations, masked: credential }) }), credential ? (_jsx(Text, { dimColor: true, wrap: "truncate-end", children: row.description })) : null] })) : row.choices?.length ? (renderChoices(row.choices, index)) : activeEditing ? (_jsx(EditableText, { value: activeEditing.value, cursor: activeEditing.cursor ?? graphemes(activeEditing.value).length, width: Math.max(1, fieldWidth - 4), active: true, animate: appearance.animations })) : (_jsx(Text, { dimColor: true, children: row.description || ' ' }))] }, row.id));
|
|
472
498
|
};
|
|
499
|
+
// The note keeps a fixed height so toggling Exa never resizes the panel.
|
|
500
|
+
const renderQuickstartWebSearch = (row, panel) => {
|
|
501
|
+
const index = rows.indexOf(row);
|
|
502
|
+
const focused = focusedAction === undefined && !modelSearchFocused && index === selection && !saving;
|
|
503
|
+
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), ...(panel ? {} : { height: quickstartFieldRowHeight }), flexShrink: 0, flexDirection: "column", children: [_jsx(Text, { bold: true, ...(panel || focused ? { color: accent } : {}), children: row.label }), _jsx(Box, { flexShrink: 0, alignSelf: "flex-start", backgroundColor: focused ? PANEL_SELECTION : COMMAND_DECK_BACKGROUND, children: row.choices?.map((choice, choiceIndex) => {
|
|
504
|
+
const target = `choice:${index}:${choiceIndex}`;
|
|
505
|
+
const background = choice.active
|
|
506
|
+
? nextHoverBackground
|
|
507
|
+
: hoveredControl === target && !saving
|
|
508
|
+
? PANEL_SELECTION
|
|
509
|
+
: undefined;
|
|
510
|
+
return (_jsx(Box, { ref: (element) => registerElement(choiceElements.current, target, element), paddingX: 2, backgroundColor: background, children: _jsx(Text, { bold: choice.active, ...(choice.active ? { color: accent } : { dimColor: true }), children: choice.label }) }, choice.label));
|
|
511
|
+
}) }), quickstartExaSearchActive ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: palette.warning, wrap: "truncate-end", children: "\u26A0 Third-party search via Exa" }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: "https://exa.ai/privacy-policy" })] })) : (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, wrap: "truncate-end", children: row.description }), _jsx(Text, { children: " " })] }))] }, row.id));
|
|
512
|
+
};
|
|
473
513
|
const renderProviderSelect = (state) => {
|
|
474
514
|
const capacity = Math.max(1, quickstartBodyHeight - middleDetailHeight - 3);
|
|
475
515
|
const start = Math.max(0, Math.min(state.selection - capacity + 1, state.options.length - capacity));
|
|
476
|
-
return (_jsxs(Box, { backgroundColor: PANEL_BACKGROUND, paddingX: 1, flexDirection: "column", overflow: "hidden", children: [_jsx(Text, { bold: true, wrap: "truncate-end", children: providerFieldRows.find((row) => row.field === state.field)?.label ?? 'Choose' }), state.options.slice(start, start + capacity).map((option, index) => {
|
|
516
|
+
return (_jsxs(Box, { width: "100%", flexGrow: 1, backgroundColor: PANEL_BACKGROUND, paddingX: 1, flexDirection: "column", overflow: "hidden", children: [_jsx(Text, { bold: true, wrap: "truncate-end", children: providerFieldRows.find((row) => row.field === state.field)?.label ?? 'Choose' }), state.options.slice(start, start + capacity).map((option, index) => {
|
|
477
517
|
const optionIndex = start + index;
|
|
478
518
|
return (_jsx(Box, { ref: (element) => registerElement(selectOptionElements.current, optionIndex, element), flexShrink: 0, backgroundColor: controlBackground(`option:${optionIndex}`, optionIndex === state.selection), children: _jsxs(Text, { ...(optionIndex === state.selection ? { color: accent } : {}), wrap: "truncate-end", children: [optionIndex === state.selection ? '› ' : ' ', option.label] }) }, `${option.label}:${option.value ?? 'custom'}`));
|
|
479
519
|
})] }));
|
|
@@ -525,6 +565,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
525
565
|
if (PROVIDER_IDS[index] !== quickstartProvider) {
|
|
526
566
|
setModelQuery('');
|
|
527
567
|
setModelViewportStart(0);
|
|
568
|
+
setDeselectedModel(undefined);
|
|
528
569
|
}
|
|
529
570
|
setQuickstartProvider(PROVIDER_IDS[index]);
|
|
530
571
|
setSelecting(undefined);
|
|
@@ -539,6 +580,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
539
580
|
setSelection(quickstartModelOffset);
|
|
540
581
|
setHoveredControl(undefined);
|
|
541
582
|
};
|
|
583
|
+
function paginateModels(direction) {
|
|
584
|
+
const lastPageStart = Math.max(0, filteredProviderModels.length - quickstartModelCapacity);
|
|
585
|
+
const nextStart = Math.max(0, Math.min(lastPageStart, quickstartModelViewportStart + direction * quickstartModelCapacity));
|
|
586
|
+
setModelViewportStart(nextStart);
|
|
587
|
+
setSelection(quickstartModelOffset + nextStart);
|
|
588
|
+
setModelSearchFocused(false);
|
|
589
|
+
setFocusedAction(undefined);
|
|
590
|
+
}
|
|
542
591
|
function browseForDirectory(field) {
|
|
543
592
|
if (choosingDirectoryRef.current) {
|
|
544
593
|
return;
|
|
@@ -549,7 +598,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
549
598
|
setError(undefined);
|
|
550
599
|
const selection = field === 'importPath'
|
|
551
600
|
? chooseAgentProject()
|
|
552
|
-
:
|
|
601
|
+
: field === 'exportPath'
|
|
602
|
+
? chooseSaveFile('Export harness project', exportFileName(draft.profile.name, exportLanguage))
|
|
603
|
+
: chooseDirectory(field === 'memoryDir'
|
|
604
|
+
? 'Choose a directory for agent memory'
|
|
605
|
+
: 'Choose a directory containing agent skills');
|
|
553
606
|
void selection
|
|
554
607
|
.then((path) => {
|
|
555
608
|
if (!path)
|
|
@@ -558,6 +611,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
558
611
|
setImportPath(path);
|
|
559
612
|
setSelection(0);
|
|
560
613
|
}
|
|
614
|
+
else if (field === 'exportPath') {
|
|
615
|
+
setExportPath(path);
|
|
616
|
+
setExportedPath(undefined);
|
|
617
|
+
}
|
|
561
618
|
else {
|
|
562
619
|
updateProfile(field === 'skills' ? { skills: [path] } : { memory: memoryForDir(path) });
|
|
563
620
|
}
|
|
@@ -579,10 +636,16 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
579
636
|
setFlow(nextFlow);
|
|
580
637
|
setStep(1);
|
|
581
638
|
setError(undefined);
|
|
582
|
-
if (nextFlow
|
|
583
|
-
|
|
584
|
-
|
|
639
|
+
if (nextFlow === 'export') {
|
|
640
|
+
setSelection(0);
|
|
641
|
+
setExportedPath(undefined);
|
|
642
|
+
setExportPath(exportFileName(draft.profile.name, exportLanguage));
|
|
643
|
+
}
|
|
644
|
+
else if (nextFlow !== 'import') {
|
|
585
645
|
const provider = providerFromModel(draft.profile.model) ?? 'bedrock';
|
|
646
|
+
if (nextFlow === 'quickstart') {
|
|
647
|
+
setDraft(quickstartDraft(provider, effectiveEnvironment));
|
|
648
|
+
}
|
|
586
649
|
setQuickstartProvider(provider);
|
|
587
650
|
setSelection(PROVIDER_IDS.indexOf(provider));
|
|
588
651
|
}
|
|
@@ -640,6 +703,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
640
703
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
641
704
|
});
|
|
642
705
|
}
|
|
706
|
+
function runExport() {
|
|
707
|
+
setSaving(true);
|
|
708
|
+
setError(undefined);
|
|
709
|
+
void exportSavedAgent(config.snapshot(), exportLanguage, exportPath)
|
|
710
|
+
.then(setExportedPath)
|
|
711
|
+
.catch((cause) => setError(errorMessage(cause)))
|
|
712
|
+
.finally(() => setSaving(false));
|
|
713
|
+
}
|
|
643
714
|
function continueFlow() {
|
|
644
715
|
if (editing || selecting || saving) {
|
|
645
716
|
return;
|
|
@@ -652,6 +723,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
652
723
|
completeSetup();
|
|
653
724
|
return;
|
|
654
725
|
}
|
|
726
|
+
if (flow === 'export') {
|
|
727
|
+
runExport();
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
655
730
|
if (flow === 'import') {
|
|
656
731
|
try {
|
|
657
732
|
const imported = importAgentProject(importPath);
|
|
@@ -666,30 +741,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
666
741
|
setError('Select a provider with detected credentials; follow the provider setup instructions.');
|
|
667
742
|
return;
|
|
668
743
|
}
|
|
669
|
-
if (flow === 'agent') {
|
|
670
|
-
if (!onAgentSetup || !setupTarget) {
|
|
671
|
-
setError('Agent Q&A is not available in this setup session.');
|
|
672
|
-
return;
|
|
673
|
-
}
|
|
674
|
-
agentHandoffDelivered.current = false;
|
|
675
|
-
setAgentHandoffElapsedMs(0);
|
|
676
|
-
setAgentHandoff({
|
|
677
|
-
model: draft.profile.model,
|
|
678
|
-
effort: draft.profile.effort,
|
|
679
|
-
configuration: {
|
|
680
|
-
profile: setupTarget.profile,
|
|
681
|
-
permissionMode: setupTarget.permissionMode,
|
|
682
|
-
allowedTools: setupTarget.customPermissions || setupTarget.permissionMode === 'bypassPermissions'
|
|
683
|
-
? setupTarget.allowedTools
|
|
684
|
-
: [],
|
|
685
|
-
providers: [...new Set([...setupTarget.providers, ...readyProviders])],
|
|
686
|
-
providerEnvironment,
|
|
687
|
-
settings: setupTarget.settings,
|
|
688
|
-
...(profileBaseDir !== undefined ? { profileBaseDir } : {}),
|
|
689
|
-
},
|
|
690
|
-
});
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
744
|
if (flow === 'quickstart') {
|
|
694
745
|
const provider = providerFromModel(draft.profile.model);
|
|
695
746
|
if (!provider || !readyProviders.includes(provider)) {
|
|
@@ -702,21 +753,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
702
753
|
providers: [provider, ...draft.providers.filter((candidate) => candidate !== provider)],
|
|
703
754
|
};
|
|
704
755
|
setDraft(completedDraft);
|
|
705
|
-
|
|
706
|
-
completeSetup(completedDraft);
|
|
707
|
-
return;
|
|
708
|
-
}
|
|
709
|
-
panelTransition.transition(() => {
|
|
710
|
-
setStep(step + 1);
|
|
711
|
-
setSelection(0);
|
|
712
|
-
setFocusedAction(undefined);
|
|
713
|
-
if (step === 1) {
|
|
714
|
-
setModelSearchFocused(false);
|
|
715
|
-
}
|
|
716
|
-
});
|
|
756
|
+
completeSetup(completedDraft);
|
|
717
757
|
return;
|
|
718
758
|
}
|
|
719
|
-
if (step <
|
|
759
|
+
if (step < CUSTOMIZE_STEPS.length) {
|
|
720
760
|
panelTransition.transition(() => {
|
|
721
761
|
setStep((current) => current + 1);
|
|
722
762
|
setFocusedAction(undefined);
|
|
@@ -765,8 +805,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
765
805
|
return;
|
|
766
806
|
}
|
|
767
807
|
panelTransition.transition(() => {
|
|
768
|
-
if (flow === 'agent' && setupTarget)
|
|
769
|
-
setDraft(setupTarget);
|
|
770
808
|
setFlow(undefined);
|
|
771
809
|
setStep(0);
|
|
772
810
|
setSelection(0);
|
|
@@ -829,6 +867,13 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
829
867
|
if (editing.field === 'importPath') {
|
|
830
868
|
setImportPath(value);
|
|
831
869
|
}
|
|
870
|
+
else if (editing.field === 'exportPath') {
|
|
871
|
+
setExportPath(value);
|
|
872
|
+
setExportedPath(undefined);
|
|
873
|
+
}
|
|
874
|
+
else if (editing.field === 'memoryDir') {
|
|
875
|
+
updateProfile({ memory: memoryForDir(value) });
|
|
876
|
+
}
|
|
832
877
|
else if (editing.field === 'skills') {
|
|
833
878
|
const paths = value
|
|
834
879
|
.split(',')
|
|
@@ -876,6 +921,12 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
876
921
|
}
|
|
877
922
|
const profile = quickstartDraft(quickstartProvider, effectiveEnvironment).profile;
|
|
878
923
|
const modelSpecifier = `${quickstartProvider}/${model.id}`;
|
|
924
|
+
if (draft.profile.model === modelSpecifier && deselectedModel !== modelSpecifier) {
|
|
925
|
+
setDeselectedModel(modelSpecifier);
|
|
926
|
+
setError(undefined);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
setDeselectedModel(undefined);
|
|
879
930
|
setDraft((current) => ({
|
|
880
931
|
...current,
|
|
881
932
|
providers: [quickstartProvider, ...current.providers.filter((provider) => provider !== quickstartProvider)],
|
|
@@ -905,7 +956,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
905
956
|
if (editing && editing.field === row.field) {
|
|
906
957
|
return;
|
|
907
958
|
}
|
|
908
|
-
if (flow === '
|
|
959
|
+
if (flow === 'customize' && step === CUSTOMIZE_STEPS.length) {
|
|
909
960
|
const destination = [1, 2, 1, 3, 4, 5, 6][index];
|
|
910
961
|
panelTransition.transition(() => {
|
|
911
962
|
setStep(destination);
|
|
@@ -949,7 +1000,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
949
1000
|
quickstartProvider,
|
|
950
1001
|
selectWizardRow,
|
|
951
1002
|
]);
|
|
952
|
-
useProviderDiscoveryEffects(discovery, isProviderSetup, quickstartProvider
|
|
1003
|
+
useProviderDiscoveryEffects(discovery, isProviderSetup, quickstartProvider);
|
|
953
1004
|
useEffect(() => {
|
|
954
1005
|
if (!isProviderSetup || awsDiscovery.credentialStatus === undefined || !ollamaDiscovery) {
|
|
955
1006
|
return;
|
|
@@ -981,7 +1032,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
981
1032
|
}, [awsDiscovery.credentialStatus, config, effectiveEnvironment, isProviderSetup, ollamaDiscovery, readyProviders]);
|
|
982
1033
|
const frogElapsedMs = useBrandAnimation(frogAnimationId);
|
|
983
1034
|
useInput((input, key) => {
|
|
984
|
-
if (
|
|
1035
|
+
if (appearanceOpen || panelTransition.transitioning)
|
|
985
1036
|
return;
|
|
986
1037
|
const mouse = parseMouseInput(input);
|
|
987
1038
|
if (mouse) {
|
|
@@ -991,7 +1042,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
991
1042
|
if (isProviderSetup && modelListElement.current && elementContainsMouse(modelListElement.current, mouse)) {
|
|
992
1043
|
setModelViewportStart((start) => scrollPanelViewport(start, scroll, filteredProviderModels.length, quickstartModelCapacity));
|
|
993
1044
|
}
|
|
994
|
-
else if (isCapabilities || isAppearance || flow === '
|
|
1045
|
+
else if (isCapabilities || isAppearance || flow === 'customize') {
|
|
995
1046
|
setFocusedAction(undefined);
|
|
996
1047
|
setSelection((current) => scrollPanelViewport(current, scroll, rows.length, 1));
|
|
997
1048
|
}
|
|
@@ -1007,25 +1058,33 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1007
1058
|
const settings = settingsElement.current ? elementContainsMouse(settingsElement.current, mouse) : false;
|
|
1008
1059
|
const frog = frogElement.current ? elementContainsMouse(frogElement.current, mouse) : false;
|
|
1009
1060
|
const search = modelSearchElement.current ? elementContainsMouse(modelSearchElement.current, mouse) : false;
|
|
1061
|
+
const modelsPrevious = previousModelCount > 0 && modelPreviousElement.current
|
|
1062
|
+
? elementContainsMouse(modelPreviousElement.current, mouse)
|
|
1063
|
+
: false;
|
|
1064
|
+
const modelsNext = nextModelCount > 0 && modelNextElement.current ? elementContainsMouse(modelNextElement.current, mouse) : false;
|
|
1010
1065
|
const effortSliderHit = setupEffortSliderElement.current
|
|
1011
1066
|
? elementContainsMouse(setupEffortSliderElement.current, mouse)
|
|
1012
1067
|
: false;
|
|
1013
|
-
const target =
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1068
|
+
const target = modelsPrevious || modelsNext
|
|
1069
|
+
? modelsPrevious
|
|
1070
|
+
? 'models-previous'
|
|
1071
|
+
: 'models-next'
|
|
1072
|
+
: ((pathCompletion !== undefined ? `completion:${pathCompletion}` : undefined) ??
|
|
1073
|
+
(directory !== undefined ? `browse:${directory}` : undefined) ??
|
|
1074
|
+
choice ??
|
|
1075
|
+
(selectOption !== undefined
|
|
1076
|
+
? `option:${selectOption}`
|
|
1077
|
+
: row !== undefined && !rows[row]?.disabled && !(isImport && row === 1 && choosingDirectory)
|
|
1078
|
+
? row
|
|
1079
|
+
: back
|
|
1080
|
+
? 'back'
|
|
1081
|
+
: next && canContinue
|
|
1082
|
+
? 'next'
|
|
1083
|
+
: settings
|
|
1084
|
+
? 'settings'
|
|
1085
|
+
: search
|
|
1086
|
+
? 'search'
|
|
1087
|
+
: undefined));
|
|
1029
1088
|
if (saving || choosingDirectory) {
|
|
1030
1089
|
return;
|
|
1031
1090
|
}
|
|
@@ -1073,6 +1132,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1073
1132
|
setFocusedAction(undefined);
|
|
1074
1133
|
setEditing(undefined);
|
|
1075
1134
|
}
|
|
1135
|
+
else if (target === 'models-previous' || target === 'models-next') {
|
|
1136
|
+
pressedElement.current = undefined;
|
|
1137
|
+
paginateModels(target === 'models-previous' ? -1 : 1);
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1076
1140
|
else if (choice?.startsWith('choice:')) {
|
|
1077
1141
|
selectWizardRow(Number(choice.split(':')[1]));
|
|
1078
1142
|
}
|
|
@@ -1127,6 +1191,12 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1127
1191
|
else
|
|
1128
1192
|
openSettings();
|
|
1129
1193
|
}
|
|
1194
|
+
else if (pressed === 'models-previous' && modelsPrevious) {
|
|
1195
|
+
paginateModels(-1);
|
|
1196
|
+
}
|
|
1197
|
+
else if (pressed === 'models-next' && modelsNext) {
|
|
1198
|
+
paginateModels(1);
|
|
1199
|
+
}
|
|
1130
1200
|
}
|
|
1131
1201
|
else if (mouse.action === 'move') {
|
|
1132
1202
|
setHoveredControl(isCapabilities && row !== undefined ? row : target);
|
|
@@ -1203,13 +1273,13 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1203
1273
|
if (key.tab) {
|
|
1204
1274
|
leaveEdit();
|
|
1205
1275
|
}
|
|
1206
|
-
else if (key.return
|
|
1276
|
+
else if (key.return) {
|
|
1207
1277
|
commitEdit();
|
|
1208
1278
|
return;
|
|
1209
1279
|
}
|
|
1210
1280
|
else {
|
|
1211
1281
|
const multiline = editing.field === 'instructions';
|
|
1212
|
-
const result = reduceInputSequence({ ...emptyEditor(), input: editing.value, cursor: editing.cursor ?? graphemes(editing.value).length }, multiline ? input : input.replace(/[\r\n]/g, ''),
|
|
1282
|
+
const result = reduceInputSequence({ ...emptyEditor(), input: editing.value, cursor: editing.cursor ?? graphemes(editing.value).length }, multiline ? input : input.replace(/[\r\n]/g, ''), key, 'idle');
|
|
1213
1283
|
setEditing({ ...editing, value: result.state.input, cursor: result.state.cursor });
|
|
1214
1284
|
setError(undefined);
|
|
1215
1285
|
return;
|
|
@@ -1430,24 +1500,26 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1430
1500
|
}
|
|
1431
1501
|
});
|
|
1432
1502
|
const isSetupCompletion = isAppearance ||
|
|
1433
|
-
(flow === 'quickstart' && step ===
|
|
1434
|
-
(flow === '
|
|
1503
|
+
(flow === 'quickstart' && step === 1) ||
|
|
1504
|
+
(flow === 'customize' && step === CUSTOMIZE_STEPS.length) ||
|
|
1435
1505
|
(flow === 'import' && step === 1);
|
|
1436
1506
|
const primaryLabel = saving
|
|
1437
|
-
?
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
:
|
|
1443
|
-
?
|
|
1507
|
+
? isExport
|
|
1508
|
+
? 'Exporting...'
|
|
1509
|
+
: 'Saving...'
|
|
1510
|
+
: isExport
|
|
1511
|
+
? 'Export'
|
|
1512
|
+
: isSetupCompletion
|
|
1513
|
+
? deferred || !config.needsSetup()
|
|
1514
|
+
? 'Save and Launch'
|
|
1515
|
+
: 'Launch Strands harness'
|
|
1444
1516
|
: 'Continue';
|
|
1445
1517
|
const escapeAction = editing || selecting ? 'cancel' : step === 0 ? 'exit' : 'back';
|
|
1446
1518
|
const navigationHints = editing
|
|
1447
1519
|
? [
|
|
1448
1520
|
width < 32 ? 'Enter save · Tab move' : 'Enter save · Tab/Shift+Tab move',
|
|
1449
1521
|
editing.field === 'instructions'
|
|
1450
|
-
? '
|
|
1522
|
+
? 'Ctrl+J newline · Esc cancel'
|
|
1451
1523
|
: width < 60
|
|
1452
1524
|
? 'Click focus · Esc cancel'
|
|
1453
1525
|
: 'Mouse click: switch controls · Ctrl+U: clear · Esc: cancel',
|
|
@@ -1473,23 +1545,15 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1473
1545
|
}, width: 11, height: 1, paddingX: 1, flexShrink: 0, alignItems: "center", justifyContent: "center", backgroundColor: settingsBackHovered
|
|
1474
1546
|
? backHoverBackground
|
|
1475
1547
|
: (controlBackground('settings', focusedAction === 'settings') ?? COMMAND_DECK_BACKGROUND), children: _jsx(Text, { color: settingsBackHovered ? palette.muted : focusedAction === 'settings' ? accent : palette.muted, children: isSettings ? 'Back' : 'Settings' }) })) : null;
|
|
1476
|
-
if (agentHandoff) {
|
|
1477
|
-
const canvasHeight = Math.max(12, height - 2);
|
|
1478
|
-
const guideHeight = Math.max(4, height - 4);
|
|
1479
|
-
const { wide, frogWidth, frogHeight, contentWidth } = setupGuideLayout(lockupWidth, guideHeight);
|
|
1480
|
-
const landingX = wide
|
|
1481
|
-
? Math.max(frogWidth / 2, Math.floor((lockupWidth - contentWidth) / 2) + frogWidth / 2)
|
|
1482
|
-
: lockupWidth / 2;
|
|
1483
|
-
const landingY = Math.max(7, guideHeight + frogHeight - 16);
|
|
1484
|
-
return (_jsx(Box, { width: width, height: height, paddingX: 1, paddingTop: 2, overflow: "hidden", backgroundColor: palette.background, children: _jsx(Text, { children: renderSetupGuideTransitionFrame(lockupWidth, canvasHeight, agentHandoffElapsedMs / SETUP_GUIDE_TRANSITION_DURATION_MS, agentHandoffElapsedMs, landingX, true, appearance.frogTheme, {
|
|
1485
|
-
colorMode: palette.mode,
|
|
1486
|
-
customBase: appearance.customTheme.base,
|
|
1487
|
-
...(appearance.frogTheme === 'custom' ? { frogColor: palette.frog } : {}),
|
|
1488
|
-
}, landingY) }) }));
|
|
1489
|
-
}
|
|
1490
1548
|
return (_jsxs(Box, { width: width, height: height, paddingX: 1, flexDirection: "column", overflow: "hidden", backgroundColor: palette.background, children: [showBrand ? (_jsx(SetupBrand, { frame: brandFrame, appearance: appearance, animationId: frogAnimationId, elapsedMs: frogElapsedMs, onFrogElement: (element) => {
|
|
1491
1549
|
frogElement.current = element ?? undefined;
|
|
1492
|
-
} })) : null, step === 0 ? (_jsx(Fade, { background: palette.background, progress: panelTransition.progress, children: _jsx(OpeningMenu, { width: lockupWidth, buttonHeight: openingButtonHeight, selection: selection, showSelection: openingSelectionVisible, ...(typeof hoveredControl === 'number' ? { hovered: hoveredControl } : {}), topGap: openingTopGap, animate: appearance.animations, ...(error ? { error } : {}), onRowElement: (index, element) => registerElement(rowElements.current, index, element) }) })) : null, step === 0 ? null : (_jsx(Fade, { background: palette.background, progress: panelTransition.progress, children: _jsxs(Box, { flexGrow: 1, alignItems: "center", justifyContent: "center", flexDirection: "column", overflow: "hidden", children: [progress ? (_jsxs(Box, { width: bubbleWidth, marginBottom: 1, alignItems: "center", flexDirection: "column", flexShrink: 0, children: [_jsx(Text, { bold: true, color: accent, wrap: "truncate-end", children: progress.instruction }), _jsx(SetupProgress, { current: progress.current, total: progress.total, width: Math.min(bubbleWidth, 48), animate: appearance.animations })] })) : null, _jsxs(Box, { width: bubbleWidth, height: bubbleHeight, flexDirection: "column", overflow: "hidden", backgroundColor: PANEL_BACKGROUND, children: [!isAppearance && flow === '
|
|
1550
|
+
} })) : null, step === 0 ? (_jsx(Fade, { background: palette.background, progress: panelTransition.progress, children: _jsx(OpeningMenu, { width: lockupWidth, buttonHeight: openingButtonHeight, selection: selection, showSelection: openingSelectionVisible, ...(typeof hoveredControl === 'number' ? { hovered: hoveredControl } : {}), topGap: openingTopGap, animate: appearance.animations, ...(error ? { error } : {}), onRowElement: (index, element) => registerElement(rowElements.current, index, element) }) })) : null, step === 0 ? null : (_jsx(Fade, { background: palette.background, progress: panelTransition.progress, children: _jsxs(Box, { flexGrow: 1, alignItems: "center", justifyContent: "center", flexDirection: "column", overflow: "hidden", children: [progress ? (_jsxs(Box, { width: bubbleWidth, marginBottom: 1, alignItems: "center", flexDirection: "column", flexShrink: 0, children: [_jsx(Text, { bold: true, color: accent, wrap: "truncate-end", children: progress.instruction }), _jsx(SetupProgress, { current: progress.current, total: progress.total, ...(progress.label ? { label: progress.label } : {}), width: Math.min(bubbleWidth, 48), animate: appearance.animations })] })) : null, _jsxs(Box, { width: bubbleWidth, height: bubbleHeight, flexDirection: "column", overflow: "hidden", backgroundColor: PANEL_BACKGROUND, children: [!isAppearance && (isExport || (flow === 'customize' && !isProviderSetup && !isCapabilities)) ? (_jsxs(Box, { paddingX: 1, marginBottom: 1, justifyContent: "space-between", flexShrink: 0, children: [_jsx(Text, { bold: true, color: accent, children: isSettings
|
|
1551
|
+
? 'Settings'
|
|
1552
|
+
: isAppearance
|
|
1553
|
+
? 'Appearance'
|
|
1554
|
+
: isExport
|
|
1555
|
+
? 'Export your agent'
|
|
1556
|
+
: CUSTOMIZE_STEPS[step - 1] }), customizeOverflowLabel ? _jsx(Text, { dimColor: true, children: customizeOverflowLabel }) : null] })) : null, isCapabilities ? (_jsxs(_Fragment, { children: [_jsxs(Box, { paddingX: 1, marginBottom: 1, justifyContent: "space-between", flexShrink: 0, children: [_jsx(Text, { bold: true, color: accent, children: isTools ? 'Tools' : 'Plugins & features' }), _jsx(Box, { ref: (element) => registerElement(rowElements.current, 0, element), paddingX: 1, backgroundColor: rowBackground(0) ?? COMMAND_DECK_BACKGROUND, children: _jsx(Text, { bold: true, children: rows[0].label }) })] }), renderCapabilityRows(visibleCapabilityRows)] })) : isImport ? (_jsxs(Box, { flexGrow: 1, paddingX: 2, paddingY: 1, flexDirection: "column", overflow: "hidden", children: [_jsx(Text, { bold: true, wrap: "truncate-end", children: "Import an agent" }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { bold: true, ...(selection === 0 ? { color: accent } : {}), wrap: "truncate-end", children: "Path to ZIP, file, or folder" }) }), _jsxs(Box, { height: 3, flexDirection: "row", children: [_jsx(Box, { ref: (element) => registerElement(rowElements.current, 0, element), flexGrow: 1, paddingX: 1, flexDirection: "column", justifyContent: "center", backgroundColor: rowBackground(0) ?? COMMAND_DECK_BACKGROUND, children: _jsx(EditableText, { value: editing?.field === 'importPath' ? editing.value : importPath, cursor: editing?.field === 'importPath'
|
|
1493
1557
|
? (editing.cursor ?? graphemes(editing.value).length)
|
|
1494
1558
|
: graphemes(importPath).length, width: Math.max(1, bubbleWidth - (canChooseDirectory() ? 17 : 6)), active: editing?.field === 'importPath', animate: appearance.animations }) }), canChooseDirectory() ? (_jsx(Box, { ref: (element) => registerElement(rowElements.current, 1, element), width: 12, marginLeft: 1, alignItems: "center", justifyContent: "center", backgroundColor: controlBackground(1, focusedAction === undefined && selection === 1, choosingDirectory) ??
|
|
1495
1559
|
COMMAND_DECK_BACKGROUND, children: _jsx(Text, { bold: true, ...(selection === 1 && !choosingDirectory ? { color: accent } : {}), dimColor: choosingDirectory, children: choosingDirectory ? 'Opening...' : 'Browse' }) })) : null] }), pathEditing && importCompletionCapacity > 0 ? (_jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [_jsx(Box, { paddingX: 1, height: 1, flexShrink: 0, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: "Suggestions \u00B7 \u2191\u2193 choose \u00B7 Tab complete" }) }), pathCompletions.slice(0, importCompletionCapacity).map((completion, index) => (_jsx(Box, { ref: (element) => registerElement(pathCompletionElements.current, index, element), height: 1, paddingX: 1, flexShrink: 0, backgroundColor: pathCompletionIndex === index || hoveredControl === `completion:${index}`
|
|
@@ -1505,23 +1569,35 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1505
1569
|
? { hovered: PROVIDER_IDS[hoveredControl] }
|
|
1506
1570
|
: {}), onElement: (id, element) => registerElement(rowElements.current, PROVIDER_IDS.indexOf(id), element) }) }), _jsx(Box, { flexGrow: 1 }), refreshRow ? renderRefreshButton(refreshRow, quickstartProviderColumnWidth - 2, true) : null] }), _jsx(Box, { width: quickstartDetailColumnWidth, flexGrow: 1, flexShrink: 0, paddingX: 1, flexDirection: "column", overflow: "hidden", children: showProviderConfiguration ? (_jsxs(_Fragment, { children: [middleFacts.length > 0 || middleWarningLines.length > 0 ? (_jsxs(Box, { paddingX: 1, marginBottom: middleFieldGap, flexShrink: 0, flexDirection: "column", children: [middleFacts.map((fact) => (_jsxs(Box, { children: [_jsxs(Text, { dimColor: true, children: [fact.label, ": "] }), _jsx(Text, { bold: true, color: palette[fact.status], children: fact.value })] }, fact.label))), middleWarningLines.length > 0 ? (_jsx(Box, { marginTop: middleFacts.length > 0 ? 1 : 0, children: _jsx(Text, { color: palette[providerWarningStatus], children: middleWarningLines.join('\n') }) })) : null] })) : null, selecting
|
|
1507
1571
|
? renderProviderSelect(selecting)
|
|
1508
|
-
: visibleProviderFieldRows.map((row) => renderProviderField(row, quickstartDetailColumnWidth - 3))] })) : (_jsxs(Box, { flexGrow: 1, flexDirection:
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1572
|
+
: visibleProviderFieldRows.map((row) => renderProviderField(row, quickstartDetailColumnWidth - 3))] })) : (_jsxs(Box, { flexGrow: 1, flexDirection: showModelOptionsPanel ? 'row' : 'column', overflow: "hidden", children: [_jsxs(Box, { ref: modelListElement, flexGrow: 1, flexDirection: "column", overflow: "hidden", children: [_jsx(Box, { flexShrink: 0, children: _jsx(Text, { bold: true, color: accent, children: "Models" }) }), _jsx(Box, { ref: modelSearchElement, marginBottom: 1, flexShrink: 0, backgroundColor: controlBackground('search', modelSearchFocused), children: _jsx(Text, { wrap: "truncate-end", children: modelSearchFocused ? (_jsxs(_Fragment, { children: [modelQuery, _jsx(BlinkingCursor, { animate: appearance.animations })] })) : (_jsxs(Text, { dimColor: true, children: ["/ ", modelQuery || 'Search models'] })) }) }), showModelPagination ? (_jsx(Box, { ref: modelPreviousElement, width: "100%", height: 1, paddingX: 1, flexShrink: 0, backgroundColor: controlBackground('models-previous', false) ?? COMMAND_DECK_BACKGROUND, children: _jsxs(Text, { ...(previousModelCount > 0
|
|
1573
|
+
? {
|
|
1574
|
+
color: hoveredControl === 'models-previous' ? accent : palette.muted,
|
|
1575
|
+
bold: hoveredControl === 'models-previous',
|
|
1576
|
+
}
|
|
1577
|
+
: { dimColor: true }), children: ["\u2191 Previous", previousModelCount > 0 ? ` · ${previousModelCount}` : ''] }) })) : null, _jsx(Box, { flexShrink: 0, flexDirection: "column", overflow: "hidden", children: providerModels.provider !== quickstartProvider || providerModels.loading ? (_jsx(Text, { dimColor: true, children: "Loading model catalog..." })) : !providerModels.available ? (_jsxs(Text, { color: palette.warning, children: ["Model catalog unavailable", providerModels.error ? ` · ${providerModels.error}` : ''] })) : visibleProviderModels.length === 0 ? (_jsx(Text, { dimColor: true, children: modelQuery.trim() ? 'No matching models' : 'No models reported' })) : (_jsx(_Fragment, { children: visibleProviderModels.map((model, visibleIndex) => {
|
|
1578
|
+
const modelIndex = quickstartModelViewportStart + visibleIndex;
|
|
1579
|
+
const index = quickstartModelOffset + modelIndex;
|
|
1580
|
+
const active = `${quickstartProvider}/${model.id}` === draft.profile.model &&
|
|
1581
|
+
deselectedModel !== draft.profile.model;
|
|
1582
|
+
const focused = focusedAction === undefined && !modelSearchFocused && index === selection;
|
|
1583
|
+
const hovered = hoveredControl === index;
|
|
1584
|
+
const highlighted = focused || hovered;
|
|
1585
|
+
const harnessDefault = model.id === quickstartDefaultModel;
|
|
1586
|
+
const modelSpecifier = `${quickstartProvider}/${model.id}`;
|
|
1587
|
+
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), width: "100%", height: quickstartModelRowHeight, paddingX: 1, flexShrink: 0, overflow: "hidden", backgroundColor: rowBackground(index) ?? (active ? COMMAND_DECK_BACKGROUND : undefined), children: [_jsx(Box, { width: 2, flexShrink: 0, children: _jsx(Text, { ...(active || highlighted ? { color: accent, bold: true } : {}), children: active ? '✓ ' : highlighted ? '› ' : ' ' }) }), _jsx(Box, { ...(showModelOptionsPanel
|
|
1588
|
+
? { flexGrow: 1 }
|
|
1589
|
+
: { width: quickstartModelNameWidth, flexShrink: 0 }), overflow: "hidden", children: _jsxs(Text, { ...(active || highlighted ? { color: accent, bold: true } : {}), wrap: "truncate-end", children: [model.name, harnessDefault ? _jsx(Text, { color: accent, children: " \u2605" }) : null] }) }), !showModelOptionsPanel ? (_jsxs(_Fragment, { children: [_jsx(Box, { width: 1, flexShrink: 0 }), _jsx(Box, { width: quickstartModelIdWidth, flexShrink: 0, overflow: "hidden", children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: modelSpecifier }) })] })) : null] }, model.id));
|
|
1590
|
+
}) })) }), showModelPagination ? (_jsx(Box, { ref: modelNextElement, width: "100%", height: 1, paddingX: 1, flexShrink: 0, backgroundColor: controlBackground('models-next', false) ?? COMMAND_DECK_BACKGROUND, children: _jsxs(Text, { ...(nextModelCount > 0
|
|
1591
|
+
? {
|
|
1592
|
+
color: hoveredControl === 'models-next' ? accent : palette.muted,
|
|
1593
|
+
bold: hoveredControl === 'models-next',
|
|
1594
|
+
}
|
|
1595
|
+
: { dimColor: true }), children: ["\u2193 Next", nextModelCount > 0 ? ` · ${nextModelCount} more` : ''] }) })) : null, readyProviderControlRows.length > 0 ? (_jsx(Box, { flexShrink: 0, flexDirection: "column", children: readyProviderControlRows.map((row) => row.id === 'quickstart-web-search'
|
|
1596
|
+
? renderQuickstartWebSearch(row, false)
|
|
1597
|
+
: renderProviderField(row, quickstartDetailColumnWidth - (showModelOptionsPanel ? 36 : 3))) })) : null] }), showModelOptionsPanel ? (_jsxs(Box, { width: 32, marginLeft: 1, paddingLeft: 1, flexDirection: "column", flexShrink: 0, overflow: "hidden", children: [showReasoningPanel ? (_jsxs(_Fragment, { children: [_jsx(Text, { bold: true, color: accent, children: "Reasoning" }), _jsx(EffortSlider, { slider: reasoningSlider, width: 26, compact: false, pressed: false, focused: reasoningRowIndex === selection, onElement: (element) => {
|
|
1598
|
+
setupEffortSliderElement.current = element;
|
|
1599
|
+
registerElement(rowElements.current, reasoningRowIndex, element);
|
|
1600
|
+
} })] })) : null, webSearchRow ? (_jsx(Box, { marginTop: showReasoningPanel ? 1 : 0, flexShrink: 0, children: renderQuickstartWebSearch(webSearchRow, true) })) : null] })) : null] })) })] })) : isAppearance ? (_jsx(SetupSettingsPanel, { rows: visibleRows, category: settingsCategory, settings: { ...panelSettings, ...draft.settings, ...appearance }, start: viewportStart, selected: selection, width: bubbleWidth, height: bubbleHeight, ...(typeof hoveredControl === 'string' ? { hoveredControl } : {}), onRowElement: (index, element) => registerElement(rowElements.current, index, element), onChoiceElement: (target, element) => registerElement(choiceElements.current, target, element) })) : isPermissions ? (_jsxs(Box, { flexGrow: 1, paddingX: 1, flexDirection: "column", overflow: "hidden", children: [_jsx(Box, { height: 7, flexShrink: 0, children: rows.slice(0, 3).map((row, index) => (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), flexGrow: 1, flexBasis: 0, height: 7, marginRight: index < 2 ? 1 : 0, paddingX: 1, borderStyle: "single", borderColor: index === selection ? accent : row.active ? palette.success : palette.muted, flexDirection: "column", justifyContent: "center", backgroundColor: rowBackground(index), children: [_jsxs(Text, { bold: true, color: row.active || index === selection ? accent : palette.foreground, children: [row.active ? '◆ ' : '', row.label] }), _jsx(Text, { dimColor: true, wrap: "wrap", children: row.description })] }, row.id))) }), draft.customPermissions ? (_jsxs(Box, { marginTop: 1, flexGrow: 1, flexDirection: "column", overflow: "hidden", children: [_jsxs(Box, { justifyContent: "space-between", flexShrink: 0, children: [_jsx(Text, { bold: true, children: "Per-tool behavior" }), _jsxs(Text, { dimColor: true, children: [permissionViewportStart > 3 ? `↑ ${permissionViewportStart - 3} ` : '', permissionViewportStart + visiblePermissionTools.length < rows.length
|
|
1525
1601
|
? `↓ ${rows.length - permissionViewportStart - visiblePermissionTools.length}`
|
|
1526
1602
|
: ''] })] }), visiblePermissionTools.map((row, visibleIndex) => {
|
|
1527
1603
|
const index = permissionViewportStart + visibleIndex;
|
|
@@ -1542,7 +1618,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1542
1618
|
], selected: quickstartProvider, width: bubbleWidth, rowHeight: rowHeight, selectedBackground: true, ...(hoveredControl === index ? { hovered: row.id } : {}), onElement: (_, element) => registerElement(rowElements.current, index, element) }, row.id));
|
|
1543
1619
|
}
|
|
1544
1620
|
const activeEditing = editing?.field === row.field ? editing : undefined;
|
|
1545
|
-
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), paddingX: row.field ? 0 : 1, height: rowHeight, flexShrink: 0, flexDirection: "column", backgroundColor: row.field ? undefined : rowBackground(index), children: [_jsxs(Box, { paddingX: row.field ? 1 : 0, justifyContent: "space-between", flexShrink: 0, children: [_jsxs(Text, { bold: row.field !== undefined, ...(!row.disabled && index === selection ? { color: accent } : {}), dimColor: row.disabled === true, wrap: "truncate-end", children: [row.status ? (_jsx(Text, { color: palette[row.status], children: "\u25CF " })) : row.field ? ('') : row.active === undefined ? ('') : row.active ? ('☑ ') : ('☐ '), row.label, flow === '
|
|
1621
|
+
return (_jsxs(Box, { ref: (element) => registerElement(rowElements.current, index, element), paddingX: row.field ? 0 : 1, height: rowHeight, flexShrink: 0, flexDirection: "column", backgroundColor: row.field ? undefined : rowBackground(index), children: [_jsxs(Box, { paddingX: row.field ? 1 : 0, justifyContent: "space-between", flexShrink: 0, children: [_jsxs(Text, { bold: row.field !== undefined, ...(!row.disabled && index === selection ? { color: accent } : {}), dimColor: row.disabled === true, wrap: "truncate-end", children: [row.status ? (_jsx(Text, { color: palette[row.status], children: "\u25CF " })) : row.field ? ('') : row.active === undefined ? ('') : row.active ? ('☑ ') : ('☐ '), row.label, flow === 'customize' && step === CUSTOMIZE_STEPS.length ? ' →' : ''] }), directoryRows.has(index) ? (_jsx(Box, { ref: (element) => registerElement(directoryElements.current, index, element), paddingX: 1, flexShrink: 0, backgroundColor: controlBackground(`browse:${index}`, focusedAction === `browse:${index}`) ??
|
|
1546
1622
|
COMMAND_DECK_BACKGROUND, children: _jsx(Text, { bold: true, children: choosingDirectory && focusedAction === `browse:${index}` ? 'Opening...' : 'Browse' }) })) : null] }), row.choices?.length ? (renderChoices(row.choices, index)) : row.field ? (_jsx(Box, { flexGrow: 1, paddingX: 1, flexDirection: "column", justifyContent: row.field === 'instructions' ? 'flex-start' : 'center', backgroundColor: rowBackground(index) ?? COMMAND_DECK_BACKGROUND, children: _jsx(EditableText, { value: activeEditing?.value ?? row.description, cursor: activeEditing
|
|
1547
1623
|
? (activeEditing.cursor ?? graphemes(activeEditing.value).length)
|
|
1548
1624
|
: graphemes(row.description).length, width: Math.max(1, bubbleWidth - 4), maxRows: row.field === 'instructions' ? rowHeight - 2 : 1, active: Boolean(activeEditing), animate: appearance.animations }) })) : (_jsx(Text, { ...(row.descriptionColor
|
|
@@ -1550,7 +1626,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1550
1626
|
: row.status
|
|
1551
1627
|
? { color: palette[row.status] }
|
|
1552
1628
|
: { dimColor: true }), wrap: "truncate-end", children: row.description }))] }, row.id));
|
|
1553
|
-
}) })),
|
|
1629
|
+
}) })), warningHeight > 0 ? (_jsx(Box, { paddingX: 1, marginTop: warningGap, height: warningHeight, flexShrink: 0, children: _jsx(Text, { color: palette[providerWarningStatus], children: warningLines.join('\n') }) })) : null, error ? (_jsx(Box, { paddingX: 1, height: 1, children: _jsx(Text, { color: "red", wrap: "truncate-end", children: error }) })) : null] }), hasExternalActions ? (_jsx(Box, { width: bubbleWidth, height: actionHeight, marginTop: actionGap, columnGap: actionColumnGap, justifyContent: "space-between", children: [
|
|
1554
1630
|
['back', 'Back', backElement],
|
|
1555
1631
|
['next', primaryLabel, nextElement],
|
|
1556
1632
|
].map(([action, label, elementRef]) => {
|