@strands-agents/cli 0.1.2 → 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 +5 -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 +71 -83
- package/dist/src/tui/chat/controller.js.map +1 -1
- package/dist/src/tui/chat/help.js +1 -0
- package/dist/src/tui/chat/help.js.map +1 -1
- package/dist/src/tui/chat/panels.js +21 -11
- package/dist/src/tui/chat/panels.js.map +1 -1
- package/dist/src/tui/chat/types.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/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 -7
- package/dist/src/tui/runtime.js.map +1 -1
- package/dist/src/tui/session/conversations.js +2 -2
- 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/view/app.js +2 -20
- 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 +3 -38
- 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 +5 -3
- 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/mcp-trust-prompt.js +17 -0
- package/dist/src/tui/view/mcp-trust-prompt.js.map +1 -0
- package/dist/src/tui/view/panels.js +10 -6
- package/dist/src/tui/view/panels.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/index.js +130 -131
- 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 +2 -1
- package/dist/src/tui/view/setup-wizard/providers.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/steps.js +89 -47
- package/dist/src/tui/view/setup-wizard/steps.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
|
@@ -4,14 +4,14 @@ import { Box, useInput, useStdout, useWindowSize } from 'ink';
|
|
|
4
4
|
import stringWidth from 'string-width';
|
|
5
5
|
import { PROVIDER_CREDENTIAL_KEYS, PROVIDER_ENVIRONMENT_KEYS, PROVIDER_LABELS, PROVIDER_IDS, } from '../../config.js';
|
|
6
6
|
import { importAgentProject } from '../../project/import.js';
|
|
7
|
+
import { exportFileName, exportSavedAgent } from '../../project/export.js';
|
|
7
8
|
import { configurationFromStore } from '../../agent-configuration.js';
|
|
8
9
|
import { DEFAULT_SETTINGS_CATEGORY, SETTINGS_CATEGORIES } from '../../settings.js';
|
|
9
10
|
import { parseMouseInput } from '../../terminal/mouse-input.js';
|
|
10
11
|
import { emptyEditor, graphemes, reduceInputSequence } from '../../terminal/composer.js';
|
|
11
12
|
import { errorMessage, sanitizeTerminalText } from '../../terminal/sanitize.js';
|
|
12
|
-
import { canChooseDirectory, chooseAgentProject, chooseDirectory } from '../../terminal/directory-picker.js';
|
|
13
|
+
import { canChooseDirectory, chooseAgentProject, chooseDirectory, chooseSaveFile, } from '../../terminal/directory-picker.js';
|
|
13
14
|
import { setTerminalMouseMotion } from '../../terminal/terminal.js';
|
|
14
|
-
import { renderSetupGuideTransitionFrame, SETUP_GUIDE_TRANSITION_DURATION_MS, setupGuideLayout, } from '../frog-intro-renderer.js';
|
|
15
15
|
import { elementAtMouse, elementContainsMouse, registerElement, mouseScrollDirection, scrollPanelViewport, revealPanelSelection, sliderOptionAtMouse, } from '../interaction.js';
|
|
16
16
|
import { wrapLines } from '../presentation.js';
|
|
17
17
|
import { Text, ThemeProvider, useTheme } from '../theme.js';
|
|
@@ -21,7 +21,7 @@ import { Fade, mixHexColors, useFadeTransition } from '../fade-in.js';
|
|
|
21
21
|
import { PROVIDERS, compatibleProfile, exaWebSearchActive, providerSupportsWebSearch, providerAssessment, providerFromModel, quickstartDraft, } from './providers.js';
|
|
22
22
|
import { EXA_WEB_SEARCH_WARNING } from '../../builtin-tools.js';
|
|
23
23
|
import { memoryForDir } from './profile-fields.js';
|
|
24
|
-
import { APPEARANCE_STEP, appearanceSettings,
|
|
24
|
+
import { APPEARANCE_STEP, appearanceSettings, CUSTOMIZE_STEPS, exportRows, OPENING_CHOICES, rowsForStep, setupStepProgress, wizardSettingsRows, } from './steps.js';
|
|
25
25
|
import { useBrandAnimation } from '../startup-view.js';
|
|
26
26
|
import { SetupBrand, setupBrandFrame } from './brand.js';
|
|
27
27
|
import { OpeningMenu } from './opening-menu.js';
|
|
@@ -35,7 +35,7 @@ export function SetupWizard(props) {
|
|
|
35
35
|
const [appearance, setAppearance] = useState(() => appearanceSettings({ ...props.config.snapshot().settings, ...props.initialSettings }));
|
|
36
36
|
return (_jsx(ThemeProvider, { settings: appearance, children: _jsx(SetupWizardContent, { ...props, appearance: appearance, setAppearance: setAppearance }) }));
|
|
37
37
|
}
|
|
38
|
-
function SetupWizardContent({ appearance, setAppearance, config, deferred = false, appearanceOnly = false, onComplete, onCancel,
|
|
38
|
+
function SetupWizardContent({ appearance, setAppearance, config, deferred = false, appearanceOnly = false, onComplete, onCancel, initialSettings, }) {
|
|
39
39
|
const { stdout } = useStdout();
|
|
40
40
|
const { columns, rows: terminalRows } = useWindowSize();
|
|
41
41
|
const [flow, setFlow] = useState();
|
|
@@ -79,9 +79,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
79
79
|
},
|
|
80
80
|
};
|
|
81
81
|
});
|
|
82
|
-
const [setupTarget, setSetupTarget] = useState();
|
|
83
82
|
const [profileBaseDir] = useState(() => config.snapshot().profileBaseDir);
|
|
84
83
|
const [importPath, setImportPath] = useState('');
|
|
84
|
+
const [exportLanguage, setExportLanguage] = useState('typescript');
|
|
85
|
+
const [exportPath, setExportPath] = useState('');
|
|
86
|
+
const [exportedPath, setExportedPath] = useState();
|
|
85
87
|
const [editing, setEditing] = useState();
|
|
86
88
|
const [pathCompletionIndex, setPathCompletionIndex] = useState(-1);
|
|
87
89
|
const [error, setError] = useState();
|
|
@@ -102,9 +104,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
102
104
|
const [quickstartProvider, setQuickstartProvider] = useState('bedrock');
|
|
103
105
|
const [selecting, setSelecting] = useState();
|
|
104
106
|
const [frogAnimationId, setFrogAnimationId] = useState();
|
|
105
|
-
const [agentHandoff, setAgentHandoff] = useState();
|
|
106
|
-
const [agentHandoffElapsedMs, setAgentHandoffElapsedMs] = useState(0);
|
|
107
|
-
const agentHandoffDelivered = useRef(false);
|
|
108
107
|
const rowElements = useRef(new Map());
|
|
109
108
|
const directoryElements = useRef(new Map());
|
|
110
109
|
const pathCompletionElements = useRef(new Map());
|
|
@@ -118,33 +117,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
118
117
|
const pressedElement = useRef(undefined);
|
|
119
118
|
const width = Math.max(1, columns);
|
|
120
119
|
const height = Math.max(1, terminalRows);
|
|
121
|
-
useEffect(() => {
|
|
122
|
-
if (!agentHandoff || !onAgentSetup) {
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
const duration = appearance.animations ? SETUP_GUIDE_TRANSITION_DURATION_MS : 0;
|
|
126
|
-
const startedAt = Date.now();
|
|
127
|
-
const finish = () => {
|
|
128
|
-
if (!agentHandoffDelivered.current) {
|
|
129
|
-
agentHandoffDelivered.current = true;
|
|
130
|
-
onAgentSetup(agentHandoff);
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
setAgentHandoffElapsedMs(duration === 0 ? SETUP_GUIDE_TRANSITION_DURATION_MS : 0);
|
|
134
|
-
if (duration === 0) {
|
|
135
|
-
finish();
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
const timer = setInterval(() => {
|
|
139
|
-
const elapsed = Math.min(duration, Date.now() - startedAt);
|
|
140
|
-
setAgentHandoffElapsedMs(elapsed);
|
|
141
|
-
if (elapsed >= duration) {
|
|
142
|
-
clearInterval(timer);
|
|
143
|
-
finish();
|
|
144
|
-
}
|
|
145
|
-
}, 32);
|
|
146
|
-
return () => clearInterval(timer);
|
|
147
|
-
}, [agentHandoff, appearance.animations, onAgentSetup]);
|
|
148
120
|
const navigationHeight = width < 32 ? 2 : 3;
|
|
149
121
|
const accent = palette.accent;
|
|
150
122
|
const pathEditing = editing?.field === 'importPath' ? editing : undefined;
|
|
@@ -203,13 +175,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
203
175
|
},
|
|
204
176
|
}));
|
|
205
177
|
}, [setAppearance]);
|
|
206
|
-
const isProviderSetup = (flow === 'quickstart' || flow === '
|
|
207
|
-
const isTools =
|
|
208
|
-
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;
|
|
209
181
|
const isCapabilities = isTools || isPlugins;
|
|
210
|
-
const isPermissions = flow === '
|
|
182
|
+
const isPermissions = flow === 'customize' && step === 6;
|
|
211
183
|
const isImport = flow === 'import' && step === 1;
|
|
212
|
-
const
|
|
184
|
+
const isExport = flow === 'export' && step === 1;
|
|
185
|
+
const hasExternalActions = !isSettings && (isProviderSetup || isImport || isExport || isCapabilities || isAppearance || flow === 'customize');
|
|
213
186
|
const bubbleWidth = Math.max(1, Math.min(isProviderSetup ? 144 : 112, width - 2));
|
|
214
187
|
const lockupWidth = Math.max(1, width - 2);
|
|
215
188
|
const brandFrame = setupBrandFrame(lockupWidth, height);
|
|
@@ -243,7 +216,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
243
216
|
? 1
|
|
244
217
|
: isPermissions
|
|
245
218
|
? 2
|
|
246
|
-
: flow === '
|
|
219
|
+
: flow === 'customize'
|
|
247
220
|
? step === 2
|
|
248
221
|
? 5
|
|
249
222
|
: step === 5
|
|
@@ -269,10 +242,18 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
269
242
|
const setupReadyProviders = useMemo(() => unavailableCredentialProvider
|
|
270
243
|
? readyProviders.filter((provider) => provider !== unavailableCredentialProvider)
|
|
271
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]);
|
|
272
251
|
const rows = useMemo(() => {
|
|
273
252
|
const stepRows = isAppearance
|
|
274
253
|
? wizardSettingsRows({ ...panelSettings, ...draft.settings, ...appearance }, isSettings ? updateSettings : updateSetupSettings, openAppearance, 'all').filter(({ section }) => section === settingsCategory)
|
|
275
|
-
:
|
|
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);
|
|
276
257
|
return isProviderSetup
|
|
277
258
|
? [
|
|
278
259
|
...stepRows,
|
|
@@ -307,6 +288,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
307
288
|
draft,
|
|
308
289
|
flow,
|
|
309
290
|
importPath,
|
|
291
|
+
isExport,
|
|
292
|
+
exportLanguage,
|
|
293
|
+
exportPath,
|
|
294
|
+
exportedPath,
|
|
295
|
+
changeExportLanguage,
|
|
310
296
|
ollamaDiscovery,
|
|
311
297
|
liteLlmDiscovery,
|
|
312
298
|
providerEnvironment,
|
|
@@ -322,8 +308,8 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
322
308
|
const selectedModelProvider = providerFromModel(draft.profile.model);
|
|
323
309
|
const hasSelectedModel = deselectedModel !== draft.profile.model;
|
|
324
310
|
const canContinue = step !== 1 ||
|
|
325
|
-
(flow === 'import'
|
|
326
|
-
? importPath.trim().length > 0
|
|
311
|
+
(flow === 'import' || flow === 'export'
|
|
312
|
+
? (flow === 'import' ? importPath : exportPath).trim().length > 0
|
|
327
313
|
: isProviderSetup
|
|
328
314
|
? hasSelectedModel &&
|
|
329
315
|
selectedModelProvider === quickstartProvider &&
|
|
@@ -335,6 +321,9 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
335
321
|
: undefined;
|
|
336
322
|
const warning = keyCredentialProvider ? undefined : inspectedAssessment?.warning;
|
|
337
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;
|
|
338
327
|
const bannerWarning = warning
|
|
339
328
|
? assessmentFacts.length > 0
|
|
340
329
|
? [
|
|
@@ -344,7 +333,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
344
333
|
warning,
|
|
345
334
|
].join('\n')
|
|
346
335
|
: `${PROVIDER_LABELS[inspectedProvider]}: ${warning}`
|
|
347
|
-
: isTools
|
|
336
|
+
: isTools || quickstartExaSearchActive
|
|
348
337
|
? EXA_WEB_SEARCH_WARNING
|
|
349
338
|
: undefined;
|
|
350
339
|
const bannerWarningStatus = warning ? inspectedAssessment.status : 'warning';
|
|
@@ -355,10 +344,12 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
355
344
|
const bannerLines = (text) => wrapLines(`⚠ ${text}`, Math.max(1, bubbleWidth - 4)).slice(0, Math.max(0, availableBubbleHeight - rowHeight - 1 - Number(error !== undefined)));
|
|
356
345
|
const warningLines = bannerWarning && !splitQuickstart ? bannerLines(bannerWarning) : [];
|
|
357
346
|
// Reserve the Exa banner's space whether or not web_search is on, so toggling it doesn't resize the panel.
|
|
358
|
-
const warningHeight = isTools
|
|
347
|
+
const warningHeight = (isTools || (quickstartWebSearchOffered && !splitQuickstart)) &&
|
|
348
|
+
!warning &&
|
|
349
|
+
!providerSupportsWebSearch(draft.profile.model)
|
|
359
350
|
? bannerLines(EXA_WEB_SEARCH_WARNING).length
|
|
360
351
|
: warningLines.length;
|
|
361
|
-
const warningGap = isCapabilities && warningHeight > 0 ? 1 : 0;
|
|
352
|
+
const warningGap = (isCapabilities || flow === 'quickstart') && warningHeight > 0 ? 1 : 0;
|
|
362
353
|
const extraRows = Number(error !== undefined) + warningGap + warningHeight;
|
|
363
354
|
const capabilityContentHeight = Math.max(0, rows.length - 1) * rowHeight + 2;
|
|
364
355
|
const bubbleHeight = isImport
|
|
@@ -369,10 +360,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
369
360
|
? Math.min(9 + Math.max(0, rows.length - 3) * rowHeight + extraRows, availableBubbleHeight)
|
|
370
361
|
: isAppearance
|
|
371
362
|
? availableBubbleHeight
|
|
372
|
-
: flow === '
|
|
363
|
+
: (flow === 'customize' && !isProviderSetup) || isExport
|
|
373
364
|
? Math.min(rows.length * rowHeight + 3 + extraRows, availableBubbleHeight)
|
|
374
365
|
: availableBubbleHeight;
|
|
375
|
-
const panelChromeHeight = isProviderSetup || isCapabilities ? 0 : isAppearance || flow === '
|
|
366
|
+
const panelChromeHeight = isProviderSetup || isCapabilities ? 0 : isAppearance || isExport || flow === 'customize' ? 2 : 4;
|
|
376
367
|
const rowCapacity = isAppearance
|
|
377
368
|
? settingsCategory === 'Appearance' && bubbleHeight < 18
|
|
378
369
|
? 1
|
|
@@ -383,7 +374,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
383
374
|
const visibleRows = rows.slice(viewportStart, viewportStart + rowCapacity);
|
|
384
375
|
const hiddenRowsBefore = viewportStart;
|
|
385
376
|
const hiddenRowsAfter = Math.max(0, rows.length - viewportStart - visibleRows.length);
|
|
386
|
-
const
|
|
377
|
+
const customizeOverflowLabel = [
|
|
387
378
|
hiddenRowsBefore > 0 ? `↑ ${hiddenRowsBefore} previous` : '',
|
|
388
379
|
hiddenRowsAfter > 0 ? `↓ ${hiddenRowsAfter} more` : '',
|
|
389
380
|
]
|
|
@@ -420,9 +411,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
420
411
|
...(reasoningRow.disabled ? { disabled: true } : {}),
|
|
421
412
|
}
|
|
422
413
|
: undefined;
|
|
423
|
-
const
|
|
424
|
-
const
|
|
425
|
-
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')
|
|
426
422
|
? [[index, row.field]]
|
|
427
423
|
: []));
|
|
428
424
|
const quickstartBodyHeight = bubbleHeight - panelChromeHeight - extraRows;
|
|
@@ -500,6 +496,20 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
500
496
|
const editable = row.input === true;
|
|
501
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));
|
|
502
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
|
+
};
|
|
503
513
|
const renderProviderSelect = (state) => {
|
|
504
514
|
const capacity = Math.max(1, quickstartBodyHeight - middleDetailHeight - 3);
|
|
505
515
|
const start = Math.max(0, Math.min(state.selection - capacity + 1, state.options.length - capacity));
|
|
@@ -588,7 +598,11 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
588
598
|
setError(undefined);
|
|
589
599
|
const selection = field === 'importPath'
|
|
590
600
|
? chooseAgentProject()
|
|
591
|
-
:
|
|
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');
|
|
592
606
|
void selection
|
|
593
607
|
.then((path) => {
|
|
594
608
|
if (!path)
|
|
@@ -597,6 +611,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
597
611
|
setImportPath(path);
|
|
598
612
|
setSelection(0);
|
|
599
613
|
}
|
|
614
|
+
else if (field === 'exportPath') {
|
|
615
|
+
setExportPath(path);
|
|
616
|
+
setExportedPath(undefined);
|
|
617
|
+
}
|
|
600
618
|
else {
|
|
601
619
|
updateProfile(field === 'skills' ? { skills: [path] } : { memory: memoryForDir(path) });
|
|
602
620
|
}
|
|
@@ -618,10 +636,16 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
618
636
|
setFlow(nextFlow);
|
|
619
637
|
setStep(1);
|
|
620
638
|
setError(undefined);
|
|
621
|
-
if (nextFlow
|
|
622
|
-
|
|
623
|
-
|
|
639
|
+
if (nextFlow === 'export') {
|
|
640
|
+
setSelection(0);
|
|
641
|
+
setExportedPath(undefined);
|
|
642
|
+
setExportPath(exportFileName(draft.profile.name, exportLanguage));
|
|
643
|
+
}
|
|
644
|
+
else if (nextFlow !== 'import') {
|
|
624
645
|
const provider = providerFromModel(draft.profile.model) ?? 'bedrock';
|
|
646
|
+
if (nextFlow === 'quickstart') {
|
|
647
|
+
setDraft(quickstartDraft(provider, effectiveEnvironment));
|
|
648
|
+
}
|
|
625
649
|
setQuickstartProvider(provider);
|
|
626
650
|
setSelection(PROVIDER_IDS.indexOf(provider));
|
|
627
651
|
}
|
|
@@ -679,6 +703,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
679
703
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
680
704
|
});
|
|
681
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
|
+
}
|
|
682
714
|
function continueFlow() {
|
|
683
715
|
if (editing || selecting || saving) {
|
|
684
716
|
return;
|
|
@@ -691,6 +723,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
691
723
|
completeSetup();
|
|
692
724
|
return;
|
|
693
725
|
}
|
|
726
|
+
if (flow === 'export') {
|
|
727
|
+
runExport();
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
694
730
|
if (flow === 'import') {
|
|
695
731
|
try {
|
|
696
732
|
const imported = importAgentProject(importPath);
|
|
@@ -705,30 +741,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
705
741
|
setError('Select a provider with detected credentials; follow the provider setup instructions.');
|
|
706
742
|
return;
|
|
707
743
|
}
|
|
708
|
-
if (flow === 'agent') {
|
|
709
|
-
if (!onAgentSetup || !setupTarget) {
|
|
710
|
-
setError('Agent Q&A is not available in this setup session.');
|
|
711
|
-
return;
|
|
712
|
-
}
|
|
713
|
-
agentHandoffDelivered.current = false;
|
|
714
|
-
setAgentHandoffElapsedMs(0);
|
|
715
|
-
setAgentHandoff({
|
|
716
|
-
model: draft.profile.model,
|
|
717
|
-
effort: compatibleProfile(draft.profile).effort,
|
|
718
|
-
configuration: {
|
|
719
|
-
profile: setupTarget.profile,
|
|
720
|
-
permissionMode: setupTarget.permissionMode,
|
|
721
|
-
allowedTools: setupTarget.customPermissions || setupTarget.permissionMode === 'bypassPermissions'
|
|
722
|
-
? setupTarget.allowedTools
|
|
723
|
-
: [],
|
|
724
|
-
providers: [...new Set([...setupTarget.providers, ...readyProviders])],
|
|
725
|
-
providerEnvironment,
|
|
726
|
-
settings: setupTarget.settings,
|
|
727
|
-
...(profileBaseDir !== undefined ? { profileBaseDir } : {}),
|
|
728
|
-
},
|
|
729
|
-
});
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
744
|
if (flow === 'quickstart') {
|
|
733
745
|
const provider = providerFromModel(draft.profile.model);
|
|
734
746
|
if (!provider || !readyProviders.includes(provider)) {
|
|
@@ -741,21 +753,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
741
753
|
providers: [provider, ...draft.providers.filter((candidate) => candidate !== provider)],
|
|
742
754
|
};
|
|
743
755
|
setDraft(completedDraft);
|
|
744
|
-
|
|
745
|
-
completeSetup(completedDraft);
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
panelTransition.transition(() => {
|
|
749
|
-
setStep(step + 1);
|
|
750
|
-
setSelection(0);
|
|
751
|
-
setFocusedAction(undefined);
|
|
752
|
-
if (step === 1) {
|
|
753
|
-
setModelSearchFocused(false);
|
|
754
|
-
}
|
|
755
|
-
});
|
|
756
|
+
completeSetup(completedDraft);
|
|
756
757
|
return;
|
|
757
758
|
}
|
|
758
|
-
if (step <
|
|
759
|
+
if (step < CUSTOMIZE_STEPS.length) {
|
|
759
760
|
panelTransition.transition(() => {
|
|
760
761
|
setStep((current) => current + 1);
|
|
761
762
|
setFocusedAction(undefined);
|
|
@@ -804,8 +805,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
804
805
|
return;
|
|
805
806
|
}
|
|
806
807
|
panelTransition.transition(() => {
|
|
807
|
-
if (flow === 'agent' && setupTarget)
|
|
808
|
-
setDraft(setupTarget);
|
|
809
808
|
setFlow(undefined);
|
|
810
809
|
setStep(0);
|
|
811
810
|
setSelection(0);
|
|
@@ -868,6 +867,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
868
867
|
if (editing.field === 'importPath') {
|
|
869
868
|
setImportPath(value);
|
|
870
869
|
}
|
|
870
|
+
else if (editing.field === 'exportPath') {
|
|
871
|
+
setExportPath(value);
|
|
872
|
+
setExportedPath(undefined);
|
|
873
|
+
}
|
|
871
874
|
else if (editing.field === 'memoryDir') {
|
|
872
875
|
updateProfile({ memory: memoryForDir(value) });
|
|
873
876
|
}
|
|
@@ -953,7 +956,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
953
956
|
if (editing && editing.field === row.field) {
|
|
954
957
|
return;
|
|
955
958
|
}
|
|
956
|
-
if (flow === '
|
|
959
|
+
if (flow === 'customize' && step === CUSTOMIZE_STEPS.length) {
|
|
957
960
|
const destination = [1, 2, 1, 3, 4, 5, 6][index];
|
|
958
961
|
panelTransition.transition(() => {
|
|
959
962
|
setStep(destination);
|
|
@@ -1029,7 +1032,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1029
1032
|
}, [awsDiscovery.credentialStatus, config, effectiveEnvironment, isProviderSetup, ollamaDiscovery, readyProviders]);
|
|
1030
1033
|
const frogElapsedMs = useBrandAnimation(frogAnimationId);
|
|
1031
1034
|
useInput((input, key) => {
|
|
1032
|
-
if (
|
|
1035
|
+
if (appearanceOpen || panelTransition.transitioning)
|
|
1033
1036
|
return;
|
|
1034
1037
|
const mouse = parseMouseInput(input);
|
|
1035
1038
|
if (mouse) {
|
|
@@ -1039,7 +1042,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1039
1042
|
if (isProviderSetup && modelListElement.current && elementContainsMouse(modelListElement.current, mouse)) {
|
|
1040
1043
|
setModelViewportStart((start) => scrollPanelViewport(start, scroll, filteredProviderModels.length, quickstartModelCapacity));
|
|
1041
1044
|
}
|
|
1042
|
-
else if (isCapabilities || isAppearance || flow === '
|
|
1045
|
+
else if (isCapabilities || isAppearance || flow === 'customize') {
|
|
1043
1046
|
setFocusedAction(undefined);
|
|
1044
1047
|
setSelection((current) => scrollPanelViewport(current, scroll, rows.length, 1));
|
|
1045
1048
|
}
|
|
@@ -1497,17 +1500,19 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1497
1500
|
}
|
|
1498
1501
|
});
|
|
1499
1502
|
const isSetupCompletion = isAppearance ||
|
|
1500
|
-
(flow === 'quickstart' && step ===
|
|
1501
|
-
(flow === '
|
|
1503
|
+
(flow === 'quickstart' && step === 1) ||
|
|
1504
|
+
(flow === 'customize' && step === CUSTOMIZE_STEPS.length) ||
|
|
1502
1505
|
(flow === 'import' && step === 1);
|
|
1503
1506
|
const primaryLabel = saving
|
|
1504
|
-
?
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
:
|
|
1510
|
-
?
|
|
1507
|
+
? isExport
|
|
1508
|
+
? 'Exporting...'
|
|
1509
|
+
: 'Saving...'
|
|
1510
|
+
: isExport
|
|
1511
|
+
? 'Export'
|
|
1512
|
+
: isSetupCompletion
|
|
1513
|
+
? deferred || !config.needsSetup()
|
|
1514
|
+
? 'Save and Launch'
|
|
1515
|
+
: 'Launch Strands harness'
|
|
1511
1516
|
: 'Continue';
|
|
1512
1517
|
const escapeAction = editing || selecting ? 'cancel' : step === 0 ? 'exit' : 'back';
|
|
1513
1518
|
const navigationHints = editing
|
|
@@ -1540,23 +1545,15 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1540
1545
|
}, width: 11, height: 1, paddingX: 1, flexShrink: 0, alignItems: "center", justifyContent: "center", backgroundColor: settingsBackHovered
|
|
1541
1546
|
? backHoverBackground
|
|
1542
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;
|
|
1543
|
-
if (agentHandoff) {
|
|
1544
|
-
const canvasHeight = Math.max(12, height - 2);
|
|
1545
|
-
const guideHeight = Math.max(4, height - 4);
|
|
1546
|
-
const { wide, frogWidth, frogHeight, contentWidth } = setupGuideLayout(lockupWidth, guideHeight);
|
|
1547
|
-
const landingX = wide
|
|
1548
|
-
? Math.max(frogWidth / 2, Math.floor((lockupWidth - contentWidth) / 2) + frogWidth / 2)
|
|
1549
|
-
: lockupWidth / 2;
|
|
1550
|
-
const landingY = Math.max(7, guideHeight + frogHeight - 16);
|
|
1551
|
-
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, {
|
|
1552
|
-
colorMode: palette.mode,
|
|
1553
|
-
customBase: appearance.customTheme.base,
|
|
1554
|
-
...(appearance.frogTheme === 'custom' ? { frogColor: palette.frog } : {}),
|
|
1555
|
-
}, landingY) }) }));
|
|
1556
|
-
}
|
|
1557
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) => {
|
|
1558
1549
|
frogElement.current = element ?? undefined;
|
|
1559
|
-
} })) : 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'
|
|
1560
1557
|
? (editing.cursor ?? graphemes(editing.value).length)
|
|
1561
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) ??
|
|
1562
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}`
|
|
@@ -1572,7 +1569,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1572
1569
|
? { hovered: PROVIDER_IDS[hoveredControl] }
|
|
1573
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
|
|
1574
1571
|
? renderProviderSelect(selecting)
|
|
1575
|
-
: visibleProviderFieldRows.map((row) => renderProviderField(row, quickstartDetailColumnWidth - 3))] })) : (_jsxs(Box, { flexGrow: 1, flexDirection:
|
|
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
|
|
1576
1573
|
? {
|
|
1577
1574
|
color: hoveredControl === 'models-previous' ? accent : palette.muted,
|
|
1578
1575
|
bold: hoveredControl === 'models-previous',
|
|
@@ -1587,18 +1584,20 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1587
1584
|
const highlighted = focused || hovered;
|
|
1588
1585
|
const harnessDefault = model.id === quickstartDefaultModel;
|
|
1589
1586
|
const modelSpecifier = `${quickstartProvider}/${model.id}`;
|
|
1590
|
-
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, { ...(
|
|
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
|
|
1591
1588
|
? { flexGrow: 1 }
|
|
1592
|
-
: { 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] }) }), !
|
|
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));
|
|
1593
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
|
|
1594
1591
|
? {
|
|
1595
1592
|
color: hoveredControl === 'models-next' ? accent : palette.muted,
|
|
1596
1593
|
bold: hoveredControl === 'models-next',
|
|
1597
1594
|
}
|
|
1598
|
-
: { dimColor: true }), children: ["\u2193 Next", nextModelCount > 0 ? ` · ${nextModelCount} more` : ''] }) })) : null, readyProviderControlRows.length > 0 ? (_jsx(Box, { flexShrink: 0, flexDirection: "column", children: readyProviderControlRows.map((row) =>
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
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
|
|
1602
1601
|
? `↓ ${rows.length - permissionViewportStart - visiblePermissionTools.length}`
|
|
1603
1602
|
: ''] })] }), visiblePermissionTools.map((row, visibleIndex) => {
|
|
1604
1603
|
const index = permissionViewportStart + visibleIndex;
|
|
@@ -1619,7 +1618,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1619
1618
|
], selected: quickstartProvider, width: bubbleWidth, rowHeight: rowHeight, selectedBackground: true, ...(hoveredControl === index ? { hovered: row.id } : {}), onElement: (_, element) => registerElement(rowElements.current, index, element) }, row.id));
|
|
1620
1619
|
}
|
|
1621
1620
|
const activeEditing = editing?.field === row.field ? editing : undefined;
|
|
1622
|
-
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}`) ??
|
|
1623
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
|
|
1624
1623
|
? (activeEditing.cursor ?? graphemes(activeEditing.value).length)
|
|
1625
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
|