@strands-agents/cli 0.1.3 → 0.1.4
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 +8 -2
- package/dist/src/cli/arguments.js +40 -1
- package/dist/src/cli/arguments.js.map +1 -1
- package/dist/src/cli/run.js +5 -0
- package/dist/src/cli/run.js.map +1 -1
- package/dist/src/cli/update.js +67 -0
- package/dist/src/cli/update.js.map +1 -0
- package/dist/src/tui/chat/commands.js +1 -1
- package/dist/src/tui/chat/commands.js.map +1 -1
- package/dist/src/tui/chat/controller.js +10 -4
- package/dist/src/tui/chat/controller.js.map +1 -1
- package/dist/src/tui/npm.js +32 -0
- package/dist/src/tui/npm.js.map +1 -0
- package/dist/src/tui/project/python.js +1 -1
- package/dist/src/tui/project/python.js.map +1 -1
- package/dist/src/tui/project/worker.py +56 -7
- package/dist/src/tui/session/context.js +23 -13
- package/dist/src/tui/session/context.js.map +1 -1
- package/dist/src/tui/session/conversations.js +19 -1
- package/dist/src/tui/session/conversations.js.map +1 -1
- package/dist/src/tui/strands-backend.js +46 -9
- package/dist/src/tui/strands-backend.js.map +1 -1
- package/dist/src/tui/update-check.js +37 -0
- package/dist/src/tui/update-check.js.map +1 -0
- package/dist/src/tui/view/app.js +31 -0
- package/dist/src/tui/view/app.js.map +1 -1
- package/dist/src/tui/view/chat-view.js +1 -1
- package/dist/src/tui/view/chat-view.js.map +1 -1
- package/dist/src/tui/view/help-footer.js +19 -15
- package/dist/src/tui/view/help-footer.js.map +1 -1
- package/dist/src/tui/view/panels.js +15 -9
- package/dist/src/tui/view/panels.js.map +1 -1
- package/dist/src/tui/view/rename-panel.js +11 -0
- package/dist/src/tui/view/rename-panel.js.map +1 -0
- package/dist/src/tui/view/setup-wizard/index.js +49 -81
- package/dist/src/tui/view/setup-wizard/index.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/opening-menu.js +2 -2
- package/dist/src/tui/view/setup-wizard/opening-menu.js.map +1 -1
- package/dist/src/tui/view/setup-wizard/steps.js +2 -30
- package/dist/src/tui/view/setup-wizard/steps.js.map +1 -1
- package/dist/src/tui/view/transcript.js +1 -1
- package/package.json +3 -1
|
@@ -4,13 +4,12 @@ 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';
|
|
8
7
|
import { configurationFromStore } from '../../agent-configuration.js';
|
|
9
8
|
import { DEFAULT_SETTINGS_CATEGORY, SETTINGS_CATEGORIES } from '../../settings.js';
|
|
10
9
|
import { parseMouseInput } from '../../terminal/mouse-input.js';
|
|
11
10
|
import { emptyEditor, graphemes, reduceInputSequence } from '../../terminal/composer.js';
|
|
12
11
|
import { errorMessage, sanitizeTerminalText } from '../../terminal/sanitize.js';
|
|
13
|
-
import { canChooseDirectory, chooseAgentProject, chooseDirectory
|
|
12
|
+
import { canChooseDirectory, chooseAgentProject, chooseDirectory } from '../../terminal/directory-picker.js';
|
|
14
13
|
import { setTerminalMouseMotion } from '../../terminal/terminal.js';
|
|
15
14
|
import { elementAtMouse, elementContainsMouse, registerElement, mouseScrollDirection, scrollPanelViewport, revealPanelSelection, sliderOptionAtMouse, } from '../interaction.js';
|
|
16
15
|
import { wrapLines } from '../presentation.js';
|
|
@@ -21,7 +20,7 @@ import { Fade, mixHexColors, useFadeTransition } from '../fade-in.js';
|
|
|
21
20
|
import { PROVIDERS, compatibleProfile, exaWebSearchActive, providerSupportsWebSearch, providerAssessment, providerFromModel, quickstartDraft, } from './providers.js';
|
|
22
21
|
import { EXA_WEB_SEARCH_WARNING } from '../../builtin-tools.js';
|
|
23
22
|
import { memoryForDir } from './profile-fields.js';
|
|
24
|
-
import { APPEARANCE_STEP, appearanceSettings, CUSTOMIZE_STEPS,
|
|
23
|
+
import { APPEARANCE_STEP, appearanceSettings, CUSTOMIZE_STEPS, OPENING_CHOICES, rowsForStep, setupStepProgress, wizardSettingsRows, } from './steps.js';
|
|
25
24
|
import { useBrandAnimation } from '../startup-view.js';
|
|
26
25
|
import { SetupBrand, setupBrandFrame } from './brand.js';
|
|
27
26
|
import { OpeningMenu } from './opening-menu.js';
|
|
@@ -31,11 +30,12 @@ import { ProviderList } from '../provider-list.js';
|
|
|
31
30
|
import { useProviderDiscovery, useProviderDiscoveryEffects } from './use-provider-discovery.js';
|
|
32
31
|
import { importPathCompletions } from './path-completion.js';
|
|
33
32
|
import { SetupProgress } from './progress.js';
|
|
33
|
+
import { availableCliUpdate } from '../../update-check.js';
|
|
34
34
|
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, initialSettings, }) {
|
|
38
|
+
function SetupWizardContent({ appearance, setAppearance, config, deferred = false, appearanceOnly = false, onComplete, onCancel, initialSettings, checkForUpdate = availableCliUpdate, }) {
|
|
39
39
|
const { stdout } = useStdout();
|
|
40
40
|
const { columns, rows: terminalRows } = useWindowSize();
|
|
41
41
|
const [flow, setFlow] = useState();
|
|
@@ -81,12 +81,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
81
81
|
});
|
|
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();
|
|
87
84
|
const [editing, setEditing] = useState();
|
|
88
85
|
const [pathCompletionIndex, setPathCompletionIndex] = useState(-1);
|
|
89
86
|
const [error, setError] = useState();
|
|
87
|
+
const [availableUpdate, setAvailableUpdate] = useState();
|
|
90
88
|
const [saving, setSaving] = useState(false);
|
|
91
89
|
const [choosingDirectory, setChoosingDirectory] = useState(false);
|
|
92
90
|
const choosingDirectoryRef = useRef(false);
|
|
@@ -131,6 +129,20 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
131
129
|
useEffect(() => {
|
|
132
130
|
setPathCompletionIndex(-1);
|
|
133
131
|
}, [pathEditing?.value]);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (appearanceOnly) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
let active = true;
|
|
137
|
+
void checkForUpdate().then((version) => {
|
|
138
|
+
if (active) {
|
|
139
|
+
setAvailableUpdate(version);
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
return () => {
|
|
143
|
+
active = false;
|
|
144
|
+
};
|
|
145
|
+
}, [appearanceOnly, checkForUpdate]);
|
|
134
146
|
const isAppearance = step === APPEARANCE_STEP;
|
|
135
147
|
const isSettings = isAppearance && settingsReturn !== undefined;
|
|
136
148
|
const progress = appearanceOnly || isSettings ? undefined : setupStepProgress(flow, step);
|
|
@@ -181,8 +193,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
181
193
|
const isCapabilities = isTools || isPlugins;
|
|
182
194
|
const isPermissions = flow === 'customize' && step === 6;
|
|
183
195
|
const isImport = flow === 'import' && step === 1;
|
|
184
|
-
const
|
|
185
|
-
const hasExternalActions = !isSettings && (isProviderSetup || isImport || isExport || isCapabilities || isAppearance || flow === 'customize');
|
|
196
|
+
const hasExternalActions = !isSettings && (isProviderSetup || isImport || isCapabilities || isAppearance || flow === 'customize');
|
|
186
197
|
const bubbleWidth = Math.max(1, Math.min(isProviderSetup ? 144 : 112, width - 2));
|
|
187
198
|
const lockupWidth = Math.max(1, width - 2);
|
|
188
199
|
const brandFrame = setupBrandFrame(lockupWidth, height);
|
|
@@ -192,7 +203,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
192
203
|
const openingColumns = lockupWidth >= 64 ? 2 : 1;
|
|
193
204
|
const openingRows = Math.ceil(OPENING_CHOICES.length / openingColumns);
|
|
194
205
|
const openingRowGap = openingColumns === 2 ? 2 : 1;
|
|
195
|
-
const openingContentHeight = height - brandHeight - navigationHeight -
|
|
206
|
+
const openingContentHeight = height - brandHeight - navigationHeight - (error ? 2 : 0);
|
|
196
207
|
const openingTopGap = openingContentHeight >= openingRows * (openingColumns === 2 ? 9 : 5) + (openingRows - 1) * openingRowGap + 3
|
|
197
208
|
? 3
|
|
198
209
|
: openingContentHeight >= openingRows * (openingColumns === 2 ? 8 : 5) + (openingRows - 1) * openingRowGap + 2
|
|
@@ -242,18 +253,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
242
253
|
const setupReadyProviders = useMemo(() => unavailableCredentialProvider
|
|
243
254
|
? readyProviders.filter((provider) => provider !== unavailableCredentialProvider)
|
|
244
255
|
: 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]);
|
|
251
256
|
const rows = useMemo(() => {
|
|
252
257
|
const stepRows = isAppearance
|
|
253
258
|
? wizardSettingsRows({ ...panelSettings, ...draft.settings, ...appearance }, isSettings ? updateSettings : updateSetupSettings, openAppearance, 'all').filter(({ section }) => section === settingsCategory)
|
|
254
|
-
:
|
|
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);
|
|
259
|
+
: rowsForStep(step, flow, draft, importPath, providerEnvironment, detectedEnvironment, quickstartProvider, setupReadyProviders, awsDiscovery, ollamaDiscovery, setDraft, updateProfile, setEditing, liteLlmDiscovery, credentialRejectedProvider, credentialValidationProvider, providerModels.error);
|
|
257
260
|
return isProviderSetup
|
|
258
261
|
? [
|
|
259
262
|
...stepRows,
|
|
@@ -288,11 +291,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
288
291
|
draft,
|
|
289
292
|
flow,
|
|
290
293
|
importPath,
|
|
291
|
-
isExport,
|
|
292
|
-
exportLanguage,
|
|
293
|
-
exportPath,
|
|
294
|
-
exportedPath,
|
|
295
|
-
changeExportLanguage,
|
|
296
294
|
ollamaDiscovery,
|
|
297
295
|
liteLlmDiscovery,
|
|
298
296
|
providerEnvironment,
|
|
@@ -308,8 +306,8 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
308
306
|
const selectedModelProvider = providerFromModel(draft.profile.model);
|
|
309
307
|
const hasSelectedModel = deselectedModel !== draft.profile.model;
|
|
310
308
|
const canContinue = step !== 1 ||
|
|
311
|
-
(flow === 'import'
|
|
312
|
-
?
|
|
309
|
+
(flow === 'import'
|
|
310
|
+
? importPath.trim().length > 0
|
|
313
311
|
: isProviderSetup
|
|
314
312
|
? hasSelectedModel &&
|
|
315
313
|
selectedModelProvider === quickstartProvider &&
|
|
@@ -360,10 +358,10 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
360
358
|
? Math.min(9 + Math.max(0, rows.length - 3) * rowHeight + extraRows, availableBubbleHeight)
|
|
361
359
|
: isAppearance
|
|
362
360
|
? availableBubbleHeight
|
|
363
|
-
:
|
|
361
|
+
: flow === 'customize' && !isProviderSetup
|
|
364
362
|
? Math.min(rows.length * rowHeight + 3 + extraRows, availableBubbleHeight)
|
|
365
363
|
: availableBubbleHeight;
|
|
366
|
-
const panelChromeHeight = isProviderSetup || isCapabilities ? 0 : isAppearance ||
|
|
364
|
+
const panelChromeHeight = isProviderSetup || isCapabilities ? 0 : isAppearance || flow === 'customize' ? 2 : 4;
|
|
367
365
|
const rowCapacity = isAppearance
|
|
368
366
|
? settingsCategory === 'Appearance' && bubbleHeight < 18
|
|
369
367
|
? 1
|
|
@@ -416,9 +414,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
416
414
|
const showReasoningPanel = showModelOptionsPanel && reasoningSlider !== undefined;
|
|
417
415
|
const readyProviderControlRows = providerConfigurationRows.filter((row) => (row.id !== 'thinking' || (reasoningRow !== undefined && !showReasoningPanel)) &&
|
|
418
416
|
(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')
|
|
417
|
+
const directoryRows = new Map(rows.flatMap((row, index) => canChooseDirectory() && !row.disabled && (row.field === 'memoryDir' || row.field === 'skills')
|
|
422
418
|
? [[index, row.field]]
|
|
423
419
|
: []));
|
|
424
420
|
const quickstartBodyHeight = bubbleHeight - panelChromeHeight - extraRows;
|
|
@@ -598,11 +594,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
598
594
|
setError(undefined);
|
|
599
595
|
const selection = field === 'importPath'
|
|
600
596
|
? chooseAgentProject()
|
|
601
|
-
: field === '
|
|
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');
|
|
597
|
+
: chooseDirectory(field === 'memoryDir' ? 'Choose a directory for agent memory' : 'Choose a directory containing agent skills');
|
|
606
598
|
void selection
|
|
607
599
|
.then((path) => {
|
|
608
600
|
if (!path)
|
|
@@ -611,10 +603,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
611
603
|
setImportPath(path);
|
|
612
604
|
setSelection(0);
|
|
613
605
|
}
|
|
614
|
-
else if (field === 'exportPath') {
|
|
615
|
-
setExportPath(path);
|
|
616
|
-
setExportedPath(undefined);
|
|
617
|
-
}
|
|
618
606
|
else {
|
|
619
607
|
updateProfile(field === 'skills' ? { skills: [path] } : { memory: memoryForDir(path) });
|
|
620
608
|
}
|
|
@@ -636,12 +624,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
636
624
|
setFlow(nextFlow);
|
|
637
625
|
setStep(1);
|
|
638
626
|
setError(undefined);
|
|
639
|
-
if (nextFlow
|
|
640
|
-
setSelection(0);
|
|
641
|
-
setExportedPath(undefined);
|
|
642
|
-
setExportPath(exportFileName(draft.profile.name, exportLanguage));
|
|
643
|
-
}
|
|
644
|
-
else if (nextFlow !== 'import') {
|
|
627
|
+
if (nextFlow !== 'import') {
|
|
645
628
|
const provider = providerFromModel(draft.profile.model) ?? 'bedrock';
|
|
646
629
|
if (nextFlow === 'quickstart') {
|
|
647
630
|
setDraft(quickstartDraft(provider, effectiveEnvironment));
|
|
@@ -655,6 +638,17 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
655
638
|
}
|
|
656
639
|
});
|
|
657
640
|
}
|
|
641
|
+
function chooseOpeningChoice(choice) {
|
|
642
|
+
if (choice !== 'resume') {
|
|
643
|
+
chooseFlow(choice);
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
if (config.needsSetup()) {
|
|
647
|
+
setError('No harness is ready to resume yet. Choose Quickstart or Customize to create one, or Import your own.');
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
onCancel?.(0);
|
|
651
|
+
}
|
|
658
652
|
function completeSetup(completedDraft = draft, agentProject) {
|
|
659
653
|
let saved;
|
|
660
654
|
setSaving(true);
|
|
@@ -703,30 +697,18 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
703
697
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
704
698
|
});
|
|
705
699
|
}
|
|
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
|
-
}
|
|
714
700
|
function continueFlow() {
|
|
715
701
|
if (editing || selecting || saving) {
|
|
716
702
|
return;
|
|
717
703
|
}
|
|
718
704
|
if (step === 0) {
|
|
719
|
-
|
|
705
|
+
chooseOpeningChoice(OPENING_CHOICES[selection].id);
|
|
720
706
|
return;
|
|
721
707
|
}
|
|
722
708
|
if (isAppearance) {
|
|
723
709
|
completeSetup();
|
|
724
710
|
return;
|
|
725
711
|
}
|
|
726
|
-
if (flow === 'export') {
|
|
727
|
-
runExport();
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
712
|
if (flow === 'import') {
|
|
731
713
|
try {
|
|
732
714
|
const imported = importAgentProject(importPath);
|
|
@@ -867,10 +849,6 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
867
849
|
if (editing.field === 'importPath') {
|
|
868
850
|
setImportPath(value);
|
|
869
851
|
}
|
|
870
|
-
else if (editing.field === 'exportPath') {
|
|
871
|
-
setExportPath(value);
|
|
872
|
-
setExportedPath(undefined);
|
|
873
|
-
}
|
|
874
852
|
else if (editing.field === 'memoryDir') {
|
|
875
853
|
updateProfile({ memory: memoryForDir(value) });
|
|
876
854
|
}
|
|
@@ -907,7 +885,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
907
885
|
}
|
|
908
886
|
function activateRow(index) {
|
|
909
887
|
if (step === 0) {
|
|
910
|
-
|
|
888
|
+
chooseOpeningChoice(OPENING_CHOICES[index].id);
|
|
911
889
|
return;
|
|
912
890
|
}
|
|
913
891
|
if (isImport && index === 1) {
|
|
@@ -1504,16 +1482,12 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1504
1482
|
(flow === 'customize' && step === CUSTOMIZE_STEPS.length) ||
|
|
1505
1483
|
(flow === 'import' && step === 1);
|
|
1506
1484
|
const primaryLabel = saving
|
|
1507
|
-
?
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
:
|
|
1513
|
-
? deferred || !config.needsSetup()
|
|
1514
|
-
? 'Save and Launch'
|
|
1515
|
-
: 'Launch Strands harness'
|
|
1516
|
-
: 'Continue';
|
|
1485
|
+
? 'Saving...'
|
|
1486
|
+
: isSetupCompletion
|
|
1487
|
+
? deferred || !config.needsSetup()
|
|
1488
|
+
? 'Save and Launch'
|
|
1489
|
+
: 'Launch Strands harness'
|
|
1490
|
+
: 'Continue';
|
|
1517
1491
|
const escapeAction = editing || selecting ? 'cancel' : step === 0 ? 'exit' : 'back';
|
|
1518
1492
|
const navigationHints = editing
|
|
1519
1493
|
? [
|
|
@@ -1547,13 +1521,7 @@ function SetupWizardContent({ appearance, setAppearance, config, deferred = fals
|
|
|
1547
1521
|
: (controlBackground('settings', focusedAction === 'settings') ?? COMMAND_DECK_BACKGROUND), children: _jsx(Text, { color: settingsBackHovered ? palette.muted : focusedAction === 'settings' ? accent : palette.muted, children: isSettings ? 'Back' : 'Settings' }) })) : null;
|
|
1548
1522
|
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) => {
|
|
1549
1523
|
frogElement.current = element ?? undefined;
|
|
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 &&
|
|
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'
|
|
1524
|
+
} })) : 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 } : {}), ...(availableUpdate ? { availableUpdate } : {}), 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 && flow === 'customize' && !isProviderSetup && !isCapabilities ? (_jsxs(Box, { paddingX: 1, marginBottom: 1, justifyContent: "space-between", flexShrink: 0, children: [_jsx(Text, { bold: true, color: accent, children: isSettings ? 'Settings' : isAppearance ? 'Appearance' : 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'
|
|
1557
1525
|
? (editing.cursor ?? graphemes(editing.value).length)
|
|
1558
1526
|
: 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) ??
|
|
1559
1527
|
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}`
|