@strands-agents/cli 0.1.0 → 0.1.1
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 +10 -7
- package/bin/strands.js +8 -14
- package/dist/src/tui/provider/discovery.js +20 -3
- package/dist/src/tui/provider/discovery.js.map +1 -1
- package/dist/src/tui/provider/packages.js +3 -5
- package/dist/src/tui/provider/packages.js.map +1 -1
- package/dist/src/tui/run.js +2 -0
- package/dist/src/tui/run.js.map +1 -1
- package/dist/src/tui/view/chat-root.js +1 -1
- package/dist/src/tui/view/chat-root.js.map +1 -1
- package/dist/src/tui/view/frog-intro-renderer.js +58 -35
- package/dist/src/tui/view/frog-intro-renderer.js.map +1 -1
- package/dist/src/tui/view/intro.js +4 -2
- package/dist/src/tui/view/intro.js.map +1 -1
- package/dist/src/tui/view/presentation.js +1 -1
- package/dist/src/tui/view/setup-wizard/brand.js +16 -3
- package/dist/src/tui/view/setup-wizard/brand.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/index.js +105 -83
- package/dist/src/tui/view/setup-wizard/index.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/opening-menu.js +16 -5
- package/dist/src/tui/view/setup-wizard/opening-menu.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/providers.js +2 -5
- package/dist/src/tui/view/setup-wizard/providers.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/steps.js +22 -17
- package/dist/src/tui/view/setup-wizard/steps.js.map +1 -1
- package/dist/src/tui/view/startup-view.js +1 -1
- package/dist/src/tui/view/startup-view.js.map +1 -1
- package/package.json +5 -5
|
@@ -10,7 +10,7 @@ import { emptyEditor, graphemes, reduceInputSequence } from '../../terminal/comp
|
|
|
10
10
|
import { errorMessage, sanitizeTerminalText } from '../../terminal/sanitize.js';
|
|
11
11
|
import { canChooseDirectory, chooseAgentProject, chooseDirectory } from '../../terminal/directory-picker.js';
|
|
12
12
|
import { setTerminalMouseMotion } from '../../terminal/terminal.js';
|
|
13
|
-
import {
|
|
13
|
+
import { renderSetupGuideTransitionFrame, SETUP_GUIDE_TRANSITION_DURATION_MS, setupGuideLayout, } from '../frog-intro-renderer.js';
|
|
14
14
|
import { elementAtMouse, elementContainsMouse, registerElement, mouseScrollDirection, scrollPanelViewport, revealPanelSelection, sliderOptionAtMouse, } from '../interaction.js';
|
|
15
15
|
import { wrapLines } from '../presentation.js';
|
|
16
16
|
import { Text, ThemeProvider, useTheme } from '../theme.js';
|
|
@@ -22,7 +22,7 @@ import { EXA_WEB_SEARCH_WARNING } from '../../builtin-tools.js';
|
|
|
22
22
|
import { memoryForDir } from './profile-fields.js';
|
|
23
23
|
import { APPEARANCE_STEP, appearanceSettings, MANUAL_STEPS, OPENING_CHOICES, rowsForStep, setupStepProgress, wizardSettingsRows, } from './steps.js';
|
|
24
24
|
import { useBrandAnimation } from '../startup-view.js';
|
|
25
|
-
import { SetupBrand } from './brand.js';
|
|
25
|
+
import { SetupBrand, setupBrandFrame } from './brand.js';
|
|
26
26
|
import { OpeningMenu } from './opening-menu.js';
|
|
27
27
|
import { SetupSettingsPanel } from './settings-panel.js';
|
|
28
28
|
import { EffortSlider } from '../model-panel.js';
|
|
@@ -81,7 +81,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
81
81
|
const [setupTarget, setSetupTarget] = useState();
|
|
82
82
|
const [profileBaseDir] = useState(() => config.snapshot().profileBaseDir);
|
|
83
83
|
const [importPath, setImportPath] = useState('');
|
|
84
|
-
const [importedEntrypoint, setImportedEntrypoint] = useState();
|
|
85
84
|
const [editing, setEditing] = useState();
|
|
86
85
|
const [pathCompletionIndex, setPathCompletionIndex] = useState(-1);
|
|
87
86
|
const [error, setError] = useState();
|
|
@@ -209,12 +208,8 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
209
208
|
const hasExternalActions = !isSettings && (isProviderSetup || isImport || isCapabilities || isAppearance || flow === 'manual');
|
|
210
209
|
const bubbleWidth = Math.max(1, Math.min(isProviderSetup ? 118 : 112, width - 2));
|
|
211
210
|
const lockupWidth = Math.max(1, width - 2);
|
|
212
|
-
const
|
|
213
|
-
const
|
|
214
|
-
const fullLockupHeight = frogStartupHeight(lockupWidth, Number.POSITIVE_INFINITY);
|
|
215
|
-
const lockupHeight = lockupWidth >= 74 && brandAvailableHeight >= fullLockupHeight + 2
|
|
216
|
-
? fullLockupHeight
|
|
217
|
-
: frogStartupHeight(lockupWidth, brandAvailableHeight);
|
|
211
|
+
const brandFrame = setupBrandFrame(lockupWidth, height);
|
|
212
|
+
const lockupHeight = brandFrame.height;
|
|
218
213
|
const showBrand = lockupHeight > 1;
|
|
219
214
|
const brandHeight = showBrand ? lockupHeight + 2 : 0;
|
|
220
215
|
const openingColumns = lockupWidth >= 64 ? 2 : 1;
|
|
@@ -252,10 +247,26 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
252
247
|
const updateProfile = useCallback((update) => {
|
|
253
248
|
setDraft((current) => ({ ...current, profile: { ...current.profile, ...update } }));
|
|
254
249
|
}, []);
|
|
250
|
+
const credentialRejectedProvider = providerModels.provider === quickstartProvider &&
|
|
251
|
+
!providerModels.loading &&
|
|
252
|
+
providerModels.credentialRejected === true
|
|
253
|
+
? quickstartProvider
|
|
254
|
+
: undefined;
|
|
255
|
+
const keyCredentialProvider = ['anthropic', 'openai', 'google'].includes(quickstartProvider);
|
|
256
|
+
const credentialValidationProvider = isProviderSetup &&
|
|
257
|
+
keyCredentialProvider &&
|
|
258
|
+
readyProviders.includes(quickstartProvider) &&
|
|
259
|
+
(providerModels.provider !== quickstartProvider || providerModels.loading)
|
|
260
|
+
? quickstartProvider
|
|
261
|
+
: undefined;
|
|
262
|
+
const unavailableCredentialProvider = credentialRejectedProvider ?? credentialValidationProvider;
|
|
263
|
+
const setupReadyProviders = useMemo(() => unavailableCredentialProvider
|
|
264
|
+
? readyProviders.filter((provider) => provider !== unavailableCredentialProvider)
|
|
265
|
+
: readyProviders, [readyProviders, unavailableCredentialProvider]);
|
|
255
266
|
const rows = useMemo(() => {
|
|
256
267
|
const stepRows = isAppearance
|
|
257
268
|
? wizardSettingsRows({ ...panelSettings, ...draft.settings, ...appearance }, isSettings ? updateSettings : updateSetupSettings, openAppearance, 'all').filter(({ section }) => section === settingsCategory)
|
|
258
|
-
: rowsForStep(step, flow, draft, importPath, providerEnvironment, detectedEnvironment, quickstartProvider,
|
|
269
|
+
: rowsForStep(step, flow, draft, importPath, providerEnvironment, detectedEnvironment, quickstartProvider, setupReadyProviders, awsDiscovery, ollamaDiscovery, setDraft, updateProfile, setEditing, liteLlmDiscovery, credentialRejectedProvider, credentialValidationProvider, providerModels.error);
|
|
259
270
|
return isProviderSetup
|
|
260
271
|
? [
|
|
261
272
|
...stepRows,
|
|
@@ -294,7 +305,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
294
305
|
liteLlmDiscovery,
|
|
295
306
|
providerEnvironment,
|
|
296
307
|
quickstartProvider,
|
|
297
|
-
|
|
308
|
+
setupReadyProviders,
|
|
309
|
+
credentialRejectedProvider,
|
|
310
|
+
credentialValidationProvider,
|
|
311
|
+
providerModels.error,
|
|
298
312
|
recheck,
|
|
299
313
|
step,
|
|
300
314
|
updateProfile,
|
|
@@ -304,13 +318,13 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
304
318
|
(flow === 'import'
|
|
305
319
|
? importPath.trim().length > 0
|
|
306
320
|
: isProviderSetup
|
|
307
|
-
? selectedModelProvider === quickstartProvider &&
|
|
321
|
+
? selectedModelProvider === quickstartProvider && setupReadyProviders.includes(quickstartProvider)
|
|
308
322
|
: draft.providers.some((provider) => readyProviders.includes(provider)));
|
|
309
323
|
const inspectedProvider = isProviderSetup ? quickstartProvider : undefined;
|
|
310
324
|
const inspectedAssessment = inspectedProvider
|
|
311
325
|
? providerAssessment(inspectedProvider, effectiveEnvironment, awsDiscovery, ollamaDiscovery, liteLlmDiscovery)
|
|
312
326
|
: undefined;
|
|
313
|
-
const warning = inspectedAssessment?.warning;
|
|
327
|
+
const warning = keyCredentialProvider ? undefined : inspectedAssessment?.warning;
|
|
314
328
|
const assessmentFacts = inspectedAssessment?.facts ?? [];
|
|
315
329
|
const bannerWarning = warning
|
|
316
330
|
? assessmentFacts.length > 0
|
|
@@ -325,7 +339,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
325
339
|
? EXA_WEB_SEARCH_WARNING
|
|
326
340
|
: undefined;
|
|
327
341
|
const bannerWarningStatus = warning ? inspectedAssessment.status : 'warning';
|
|
328
|
-
const providerReady = isProviderSetup &&
|
|
342
|
+
const providerReady = isProviderSetup && setupReadyProviders.includes(quickstartProvider);
|
|
329
343
|
const showProviderConfiguration = isProviderSetup && !providerReady;
|
|
330
344
|
const modelPanelVisible = splitQuickstart && providerReady;
|
|
331
345
|
const availableBubbleHeight = Math.max(1, height - brandHeight - progressHeight - (hasExternalActions ? actionHeight + actionGap : 0) - navigationHeight);
|
|
@@ -454,7 +468,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
454
468
|
const activeEditing = editing?.field === row.field ? editing : undefined;
|
|
455
469
|
const credential = PROVIDER_CREDENTIAL_KEYS.includes(row.field);
|
|
456
470
|
const editable = row.input === true;
|
|
457
|
-
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 ?? '', 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));
|
|
471
|
+
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));
|
|
458
472
|
};
|
|
459
473
|
const renderProviderSelect = (state) => {
|
|
460
474
|
const capacity = Math.max(1, quickstartBodyHeight - middleDetailHeight - 3);
|
|
@@ -478,6 +492,14 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
478
492
|
});
|
|
479
493
|
setError(undefined);
|
|
480
494
|
}
|
|
495
|
+
function focusNextProviderField(field) {
|
|
496
|
+
const current = rows.findIndex((row) => row.field === field);
|
|
497
|
+
const next = rows.findIndex((row, index) => index > current && !row.disabled);
|
|
498
|
+
if (next >= 0) {
|
|
499
|
+
setSelection(next);
|
|
500
|
+
setFocusedAction(undefined);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
481
503
|
function chooseSelectOption(option) {
|
|
482
504
|
if (!selecting) {
|
|
483
505
|
return;
|
|
@@ -488,6 +510,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
488
510
|
}
|
|
489
511
|
else {
|
|
490
512
|
setProviderValue(selecting.field, option.value ?? '');
|
|
513
|
+
focusNextProviderField(selecting.field);
|
|
491
514
|
}
|
|
492
515
|
setSelecting(undefined);
|
|
493
516
|
}
|
|
@@ -569,6 +592,54 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
569
592
|
}
|
|
570
593
|
});
|
|
571
594
|
}
|
|
595
|
+
function completeSetup(completedDraft = draft, agentProject) {
|
|
596
|
+
let saved;
|
|
597
|
+
setSaving(true);
|
|
598
|
+
if (appearanceOnly || agentProject) {
|
|
599
|
+
if (deferred) {
|
|
600
|
+
onComplete({
|
|
601
|
+
configuration: {
|
|
602
|
+
...configurationFromStore(config),
|
|
603
|
+
settings: { ...panelSettings, ...completedDraft.settings, ...appearance },
|
|
604
|
+
},
|
|
605
|
+
...(agentProject ? { agentProject } : {}),
|
|
606
|
+
});
|
|
607
|
+
return;
|
|
608
|
+
}
|
|
609
|
+
saved = appearanceOnly
|
|
610
|
+
? config.setSettings({ ...panelSettings, ...appearance })
|
|
611
|
+
: config.useAgentProject(agentProject, {
|
|
612
|
+
...panelSettings,
|
|
613
|
+
...completedDraft.settings,
|
|
614
|
+
...appearance,
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
setError(undefined);
|
|
619
|
+
const configuration = {
|
|
620
|
+
providers: completedDraft.providers,
|
|
621
|
+
profile: compatibleProfile(completedDraft.profile),
|
|
622
|
+
...(profileBaseDir !== undefined ? { profileBaseDir } : {}),
|
|
623
|
+
permissionMode: completedDraft.permissionMode,
|
|
624
|
+
allowedTools: completedDraft.customPermissions || completedDraft.permissionMode === 'bypassPermissions'
|
|
625
|
+
? completedDraft.allowedTools
|
|
626
|
+
: [],
|
|
627
|
+
providerEnvironment,
|
|
628
|
+
settings: { ...panelSettings, ...completedDraft.settings, ...appearance },
|
|
629
|
+
};
|
|
630
|
+
if (deferred) {
|
|
631
|
+
onComplete({ configuration });
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
saved = config.saveSetup(configuration);
|
|
635
|
+
}
|
|
636
|
+
void saved
|
|
637
|
+
.then(() => onComplete())
|
|
638
|
+
.catch((cause) => {
|
|
639
|
+
setSaving(false);
|
|
640
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
641
|
+
});
|
|
642
|
+
}
|
|
572
643
|
function continueFlow() {
|
|
573
644
|
if (editing || selecting || saving) {
|
|
574
645
|
return;
|
|
@@ -578,58 +649,13 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
578
649
|
return;
|
|
579
650
|
}
|
|
580
651
|
if (isAppearance) {
|
|
581
|
-
|
|
582
|
-
setSaving(true);
|
|
583
|
-
if (appearanceOnly || (flow === 'import' && importedEntrypoint)) {
|
|
584
|
-
if (deferred) {
|
|
585
|
-
onComplete({
|
|
586
|
-
configuration: {
|
|
587
|
-
...configurationFromStore(config),
|
|
588
|
-
settings: { ...panelSettings, ...draft.settings, ...appearance },
|
|
589
|
-
},
|
|
590
|
-
...(!appearanceOnly ? { agentProject: importedEntrypoint } : {}),
|
|
591
|
-
});
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
saved = appearanceOnly
|
|
595
|
-
? config.setSettings({ ...panelSettings, ...appearance })
|
|
596
|
-
: config.useAgentProject(importedEntrypoint, { ...panelSettings, ...draft.settings, ...appearance });
|
|
597
|
-
}
|
|
598
|
-
else {
|
|
599
|
-
setError(undefined);
|
|
600
|
-
const configuration = {
|
|
601
|
-
providers: draft.providers,
|
|
602
|
-
profile: compatibleProfile(draft.profile),
|
|
603
|
-
...(profileBaseDir !== undefined ? { profileBaseDir } : {}),
|
|
604
|
-
permissionMode: draft.permissionMode,
|
|
605
|
-
allowedTools: draft.customPermissions || draft.permissionMode === 'bypassPermissions' ? draft.allowedTools : [],
|
|
606
|
-
providerEnvironment,
|
|
607
|
-
settings: { ...panelSettings, ...draft.settings, ...appearance },
|
|
608
|
-
};
|
|
609
|
-
if (deferred) {
|
|
610
|
-
onComplete({ configuration });
|
|
611
|
-
return;
|
|
612
|
-
}
|
|
613
|
-
saved = config.saveSetup(configuration);
|
|
614
|
-
}
|
|
615
|
-
void saved
|
|
616
|
-
.then(() => onComplete())
|
|
617
|
-
.catch((cause) => {
|
|
618
|
-
setSaving(false);
|
|
619
|
-
setError(cause instanceof Error ? cause.message : String(cause));
|
|
620
|
-
});
|
|
652
|
+
completeSetup();
|
|
621
653
|
return;
|
|
622
654
|
}
|
|
623
655
|
if (flow === 'import') {
|
|
624
656
|
try {
|
|
625
657
|
const imported = importAgentProject(importPath);
|
|
626
|
-
|
|
627
|
-
setImportedEntrypoint(imported.entrypoint);
|
|
628
|
-
setSettingsCategory(DEFAULT_SETTINGS_CATEGORY);
|
|
629
|
-
setStep(APPEARANCE_STEP);
|
|
630
|
-
setSelection(0);
|
|
631
|
-
setFocusedAction(undefined);
|
|
632
|
-
});
|
|
658
|
+
completeSetup(draft, imported.entrypoint);
|
|
633
659
|
}
|
|
634
660
|
catch (cause) {
|
|
635
661
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
@@ -671,15 +697,17 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
671
697
|
panelTransition.transition(() => setStep(1));
|
|
672
698
|
return;
|
|
673
699
|
}
|
|
674
|
-
|
|
700
|
+
const completedDraft = {
|
|
675
701
|
...draft,
|
|
676
702
|
providers: [provider, ...draft.providers.filter((candidate) => candidate !== provider)],
|
|
677
|
-
}
|
|
703
|
+
};
|
|
704
|
+
setDraft(completedDraft);
|
|
705
|
+
if (step >= 3) {
|
|
706
|
+
completeSetup(completedDraft);
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
678
709
|
panelTransition.transition(() => {
|
|
679
|
-
|
|
680
|
-
setSettingsCategory(DEFAULT_SETTINGS_CATEGORY);
|
|
681
|
-
}
|
|
682
|
-
setStep(step < 3 ? step + 1 : APPEARANCE_STEP);
|
|
710
|
+
setStep(step + 1);
|
|
683
711
|
setSelection(0);
|
|
684
712
|
setFocusedAction(undefined);
|
|
685
713
|
if (step === 1) {
|
|
@@ -707,12 +735,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
707
735
|
});
|
|
708
736
|
return;
|
|
709
737
|
}
|
|
710
|
-
|
|
711
|
-
setSettingsCategory(DEFAULT_SETTINGS_CATEGORY);
|
|
712
|
-
setStep(APPEARANCE_STEP);
|
|
713
|
-
setSelection(0);
|
|
714
|
-
setFocusedAction(undefined);
|
|
715
|
-
});
|
|
738
|
+
completeSetup();
|
|
716
739
|
}
|
|
717
740
|
function moveBack() {
|
|
718
741
|
if (editing || selecting || saving) {
|
|
@@ -734,12 +757,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
734
757
|
if (appearanceOnly) {
|
|
735
758
|
onCancel?.(0);
|
|
736
759
|
}
|
|
737
|
-
else {
|
|
738
|
-
panelTransition.transition(() => {
|
|
739
|
-
setStep(flow === 'manual' ? MANUAL_STEPS.length : flow === 'quickstart' ? 3 : 1);
|
|
740
|
-
setSelection(0);
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
760
|
return;
|
|
744
761
|
}
|
|
745
762
|
if (step <= 1) {
|
|
@@ -799,6 +816,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
799
816
|
}
|
|
800
817
|
else {
|
|
801
818
|
setProviderValue(editing.field, value);
|
|
819
|
+
focusNextProviderField(editing.field);
|
|
802
820
|
}
|
|
803
821
|
setEditing(undefined);
|
|
804
822
|
setError(undefined);
|
|
@@ -1411,9 +1429,13 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1411
1429
|
});
|
|
1412
1430
|
}
|
|
1413
1431
|
});
|
|
1432
|
+
const isSetupCompletion = isAppearance ||
|
|
1433
|
+
(flow === 'quickstart' && step === 3) ||
|
|
1434
|
+
(flow === 'manual' && step === MANUAL_STEPS.length) ||
|
|
1435
|
+
(flow === 'import' && step === 1);
|
|
1414
1436
|
const primaryLabel = saving
|
|
1415
1437
|
? 'Saving...'
|
|
1416
|
-
:
|
|
1438
|
+
: isSetupCompletion
|
|
1417
1439
|
? deferred || !config.needsSetup()
|
|
1418
1440
|
? 'Save and Launch'
|
|
1419
1441
|
: 'Launch Strands harness'
|
|
@@ -1465,7 +1487,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1465
1487
|
...(appearance.frogTheme === 'custom' ? { frogColor: palette.frog } : {}),
|
|
1466
1488
|
}, landingY) }) }));
|
|
1467
1489
|
}
|
|
1468
|
-
return (_jsxs(Box, { width: width, height: height, paddingX: 1, flexDirection: "column", overflow: "hidden", backgroundColor: palette.background, children: [showBrand ? (_jsx(SetupBrand, {
|
|
1490
|
+
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) => {
|
|
1469
1491
|
frogElement.current = element ?? undefined;
|
|
1470
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 === 'manual' && !isProviderSetup && !isCapabilities ? (_jsx(Box, { paddingX: 1, marginBottom: 1, flexShrink: 0, children: _jsx(Text, { bold: true, color: accent, children: isSettings ? 'Settings' : isAppearance ? 'Appearance' : MANUAL_STEPS[step - 1] }) })) : 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'
|
|
1471
1493
|
? (editing.cursor ?? graphemes(editing.value).length)
|
|
@@ -1483,7 +1505,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1483
1505
|
? { hovered: PROVIDER_IDS[hoveredControl] }
|
|
1484
1506
|
: {}), 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
|
|
1485
1507
|
? renderProviderSelect(selecting)
|
|
1486
|
-
: visibleProviderFieldRows.map((row) => renderProviderField(row, quickstartDetailColumnWidth - 3))] })) : (_jsxs(Box, { flexGrow: 1, flexDirection: showReasoningPanel ? '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'] })) }) }), _jsxs(Box, { flexGrow: 1, flexDirection: "column", overflow: "hidden", children: [providerModels.provider !== quickstartProvider || providerModels.loading ? (_jsx(Text, { dimColor: true, children: "Loading model catalog..." })) : !providerModels.available ? (
|
|
1508
|
+
: visibleProviderFieldRows.map((row) => renderProviderField(row, quickstartDetailColumnWidth - 3))] })) : (_jsxs(Box, { flexGrow: 1, flexDirection: showReasoningPanel ? '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'] })) }) }), _jsxs(Box, { flexGrow: 1, 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' })) : (_jsxs(_Fragment, { children: [quickstartModelViewportStart > 0 ? (_jsxs(Text, { dimColor: true, children: ["\u2191 ", quickstartModelViewportStart, " more"] })) : null, visibleProviderModels.map((model, visibleIndex) => {
|
|
1487
1509
|
const modelIndex = quickstartModelViewportStart + visibleIndex;
|
|
1488
1510
|
const index = quickstartModelOffset + modelIndex;
|
|
1489
1511
|
const active = `${quickstartProvider}/${model.id}` === draft.profile.model;
|