@vybestack/llxprt-code 0.8.0-nightly.260111.af7260fe6 → 0.8.0-nightly.260113.48db4b09b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +3 -3
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/runtime/runtimeSettings.d.ts +1 -0
- package/dist/src/runtime/runtimeSettings.js +4 -0
- package/dist/src/runtime/runtimeSettings.js.map +1 -1
- package/dist/src/ui/AppContainer.js +67 -0
- package/dist/src/ui/AppContainer.js.map +1 -1
- package/dist/src/ui/commands/profileCommand.js +111 -9
- package/dist/src/ui/commands/profileCommand.js.map +1 -1
- package/dist/src/ui/commands/profileCommand.test.js +3 -6
- package/dist/src/ui/commands/profileCommand.test.js.map +1 -1
- package/dist/src/ui/commands/subagentCommand.js +58 -244
- package/dist/src/ui/commands/subagentCommand.js.map +1 -1
- package/dist/src/ui/commands/test/subagentCommand.schema.test.js +4 -3
- package/dist/src/ui/commands/test/subagentCommand.schema.test.js.map +1 -1
- package/dist/src/ui/commands/test/subagentCommand.test.js +44 -124
- package/dist/src/ui/commands/test/subagentCommand.test.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +43 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/DialogManager.js +17 -0
- package/dist/src/ui/components/DialogManager.js.map +1 -1
- package/dist/src/ui/components/ProfileDetailDialog.d.ts +22 -0
- package/dist/src/ui/components/ProfileDetailDialog.js +113 -0
- package/dist/src/ui/components/ProfileDetailDialog.js.map +1 -0
- package/dist/src/ui/components/ProfileInlineEditor.d.ts +16 -0
- package/dist/src/ui/components/ProfileInlineEditor.js +216 -0
- package/dist/src/ui/components/ProfileInlineEditor.js.map +1 -0
- package/dist/src/ui/components/ProfileListDialog.d.ts +26 -0
- package/dist/src/ui/components/ProfileListDialog.js +172 -0
- package/dist/src/ui/components/ProfileListDialog.js.map +1 -0
- package/dist/src/ui/components/ProviderDialog.js +1 -1
- package/dist/src/ui/components/ProviderDialog.js.map +1 -1
- package/dist/src/ui/components/ProviderModelDialog.js +1 -1
- package/dist/src/ui/components/ProviderModelDialog.js.map +1 -1
- package/dist/src/ui/components/SubagentManagement/ProfileAttachmentWizard.d.ts +24 -0
- package/dist/src/ui/components/SubagentManagement/ProfileAttachmentWizard.js +102 -0
- package/dist/src/ui/components/SubagentManagement/ProfileAttachmentWizard.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentCreationWizard.d.ts +14 -0
- package/dist/src/ui/components/SubagentManagement/SubagentCreationWizard.js +179 -0
- package/dist/src/ui/components/SubagentManagement/SubagentCreationWizard.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentDeleteDialog.d.ts +15 -0
- package/dist/src/ui/components/SubagentManagement/SubagentDeleteDialog.js +47 -0
- package/dist/src/ui/components/SubagentManagement/SubagentDeleteDialog.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentEditForm.d.ts +18 -0
- package/dist/src/ui/components/SubagentManagement/SubagentEditForm.js +111 -0
- package/dist/src/ui/components/SubagentManagement/SubagentEditForm.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentListMenu.d.ts +19 -0
- package/dist/src/ui/components/SubagentManagement/SubagentListMenu.js +137 -0
- package/dist/src/ui/components/SubagentManagement/SubagentListMenu.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentMainMenu.d.ts +13 -0
- package/dist/src/ui/components/SubagentManagement/SubagentMainMenu.js +14 -0
- package/dist/src/ui/components/SubagentManagement/SubagentMainMenu.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentManagerDialog.d.ts +8 -0
- package/dist/src/ui/components/SubagentManagement/SubagentManagerDialog.js +293 -0
- package/dist/src/ui/components/SubagentManagement/SubagentManagerDialog.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/SubagentShowView.d.ts +15 -0
- package/dist/src/ui/components/SubagentManagement/SubagentShowView.js +35 -0
- package/dist/src/ui/components/SubagentManagement/SubagentShowView.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/index.d.ts +14 -0
- package/dist/src/ui/components/SubagentManagement/index.js +15 -0
- package/dist/src/ui/components/SubagentManagement/index.js.map +1 -0
- package/dist/src/ui/components/SubagentManagement/types.d.ts +109 -0
- package/dist/src/ui/components/SubagentManagement/types.js +77 -0
- package/dist/src/ui/components/SubagentManagement/types.js.map +1 -0
- package/dist/src/ui/contexts/KeypressContext.js +2 -1
- package/dist/src/ui/contexts/KeypressContext.js.map +1 -1
- package/dist/src/ui/contexts/RuntimeContext.d.ts +2 -1
- package/dist/src/ui/contexts/RuntimeContext.js +2 -1
- package/dist/src/ui/contexts/RuntimeContext.js.map +1 -1
- package/dist/src/ui/contexts/UIActionsContext.d.ts +13 -0
- package/dist/src/ui/contexts/UIActionsContext.js.map +1 -1
- package/dist/src/ui/contexts/UIStateContext.d.ts +21 -0
- package/dist/src/ui/contexts/UIStateContext.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +25 -1
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.test.js +127 -91
- package/dist/src/ui/hooks/atCommandProcessor.test.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +5 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js +34 -0
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useEditorSettings.test.js +3 -0
- package/dist/src/ui/hooks/useEditorSettings.test.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js +1 -1
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -1
- package/dist/src/ui/hooks/useProfileManagement.d.ts +40 -0
- package/dist/src/ui/hooks/useProfileManagement.js +350 -0
- package/dist/src/ui/hooks/useProfileManagement.js.map +1 -0
- package/dist/src/ui/hooks/useReactToolScheduler.js +103 -33
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.test.js.map +1 -1
- package/dist/src/ui/hooks/useToolScheduler.test.js +322 -220
- package/dist/src/ui/hooks/useToolScheduler.test.js.map +1 -1
- package/dist/src/ui/layouts/DefaultAppLayout.js +5 -0
- package/dist/src/ui/layouts/DefaultAppLayout.js.map +1 -1
- package/dist/src/ui/reducers/appReducer.d.ts +5 -2
- package/dist/src/ui/reducers/appReducer.js +3 -0
- package/dist/src/ui/reducers/appReducer.js.map +1 -1
- package/dist/src/ui/reducers/appReducer.test.js +6 -0
- package/dist/src/ui/reducers/appReducer.test.js.map +1 -1
- package/dist/src/utils/sandbox.d.ts +1 -0
- package/dist/src/utils/sandbox.js +22 -20
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/sandbox.test.d.ts +6 -0
- package/dist/src/utils/sandbox.test.js +176 -0
- package/dist/src/utils/sandbox.test.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Vybestack LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
import { Box, Text } from 'ink';
|
|
9
|
+
import { SemanticColors } from '../colors.js';
|
|
10
|
+
import { useResponsive } from '../hooks/useResponsive.js';
|
|
11
|
+
import { useKeypress } from '../hooks/useKeypress.js';
|
|
12
|
+
/**
|
|
13
|
+
* Allowlist of ephemeralSettings keys that are safe to display.
|
|
14
|
+
* Any key NOT in this set will be hidden to prevent accidental secret leakage.
|
|
15
|
+
*/
|
|
16
|
+
const SAFE_EPHEMERAL_KEYS = new Set([
|
|
17
|
+
'baseurl',
|
|
18
|
+
'endpoint',
|
|
19
|
+
'url',
|
|
20
|
+
'timeout',
|
|
21
|
+
'maxretries',
|
|
22
|
+
'retries',
|
|
23
|
+
'region',
|
|
24
|
+
'debug',
|
|
25
|
+
'loglevel',
|
|
26
|
+
'version',
|
|
27
|
+
'apiversion',
|
|
28
|
+
'organization',
|
|
29
|
+
'orgid',
|
|
30
|
+
'project',
|
|
31
|
+
'projectid',
|
|
32
|
+
'maxtokens',
|
|
33
|
+
'temperature',
|
|
34
|
+
'topp',
|
|
35
|
+
'topk',
|
|
36
|
+
'stream',
|
|
37
|
+
'safetysettings',
|
|
38
|
+
]);
|
|
39
|
+
// Type guard for load balancer profile
|
|
40
|
+
function isLoadBalancerProfile(profile) {
|
|
41
|
+
const p = profile;
|
|
42
|
+
return (profile.type === 'loadbalancer' &&
|
|
43
|
+
Array.isArray(p.profiles) &&
|
|
44
|
+
typeof p.policy === 'string');
|
|
45
|
+
}
|
|
46
|
+
export const ProfileDetailDialog = ({ profileName, profile, onClose, onLoad, onDelete, onSetDefault, onEdit, isLoading = false, isDefault = false, isActive = false, error, }) => {
|
|
47
|
+
const { isNarrow, width } = useResponsive();
|
|
48
|
+
const [confirmDelete, setConfirmDelete] = useState(false);
|
|
49
|
+
useKeypress((key) => {
|
|
50
|
+
if (key.name === 'escape') {
|
|
51
|
+
if (confirmDelete) {
|
|
52
|
+
setConfirmDelete(false);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return onClose();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// On error / missing profile screens, only Esc should do anything.
|
|
59
|
+
if (error || !profile) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (confirmDelete) {
|
|
63
|
+
if (key.sequence === 'y' || key.sequence === 'Y') {
|
|
64
|
+
onDelete(profileName);
|
|
65
|
+
}
|
|
66
|
+
else if (key.sequence === 'n' || key.sequence === 'N') {
|
|
67
|
+
setConfirmDelete(false);
|
|
68
|
+
}
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// Quick actions
|
|
72
|
+
if (key.sequence === 'l') {
|
|
73
|
+
return onLoad(profileName);
|
|
74
|
+
}
|
|
75
|
+
if (key.sequence === 'e') {
|
|
76
|
+
return onEdit(profileName);
|
|
77
|
+
}
|
|
78
|
+
if (key.sequence === 'd') {
|
|
79
|
+
setConfirmDelete(true);
|
|
80
|
+
}
|
|
81
|
+
if (key.sequence === 's') {
|
|
82
|
+
return onSetDefault(profileName);
|
|
83
|
+
}
|
|
84
|
+
}, { isActive: !isLoading });
|
|
85
|
+
if (isLoading) {
|
|
86
|
+
return (_jsx(Box, { borderStyle: "round", borderColor: SemanticColors.border.default, flexDirection: "column", padding: 1, children: _jsx(Text, { color: SemanticColors.text.primary, children: "Loading profile..." }) }));
|
|
87
|
+
}
|
|
88
|
+
if (error) {
|
|
89
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: SemanticColors.status.error, flexDirection: "column", padding: 1, children: [_jsx(Text, { bold: true, color: SemanticColors.status.error, children: "Error Loading Profile" }), _jsx(Text, { color: SemanticColors.text.secondary, children: error }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: SemanticColors.text.secondary, children: "Press Esc to go back" }) })] }));
|
|
90
|
+
}
|
|
91
|
+
if (!profile) {
|
|
92
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: SemanticColors.border.default, flexDirection: "column", padding: 1, children: [_jsxs(Text, { color: SemanticColors.text.secondary, children: ["Profile not found: ", profileName] }), _jsx(Text, { color: SemanticColors.text.secondary, children: "Press Esc to go back" })] }));
|
|
93
|
+
}
|
|
94
|
+
// Render JSON config in a readable format
|
|
95
|
+
const renderConfig = () => {
|
|
96
|
+
if (isLoadBalancerProfile(profile)) {
|
|
97
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Type: " }), _jsx(Text, { color: SemanticColors.text.accent, children: "Load Balancer" })] }), _jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Policy: " }), _jsx(Text, { color: SemanticColors.text.primary, children: profile.policy })] }), _jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Member Profiles:" }), profile.profiles.map((p) => (_jsxs(Text, { color: SemanticColors.text.primary, children: [' ', "- ", p] }, p)))] })] }));
|
|
98
|
+
}
|
|
99
|
+
// Standard profile
|
|
100
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Type: " }), _jsx(Text, { color: SemanticColors.text.primary, children: "Standard" })] }), _jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Provider: " }), _jsx(Text, { color: SemanticColors.text.accent, children: profile.provider })] }), _jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Model: " }), _jsx(Text, { color: SemanticColors.text.primary, children: profile.model })] }), profile.modelParams && Object.keys(profile.modelParams).length > 0 && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Model Parameters:" }), Object.entries(profile.modelParams).map(([key, value]) => (_jsxs(Text, { color: SemanticColors.text.primary, children: [' ', key, ": ", JSON.stringify(value)] }, key)))] })), profile.ephemeralSettings && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Settings:" }), Object.entries(profile.ephemeralSettings)
|
|
101
|
+
.filter(([key]) => SAFE_EPHEMERAL_KEYS.has(key.toLowerCase()))
|
|
102
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
103
|
+
.slice(0, 10) // Limit displayed settings
|
|
104
|
+
.map(([key, value]) => (_jsxs(Text, { color: SemanticColors.text.primary, children: [' ', key, ": ", JSON.stringify(value)] }, key)))] })), profile.auth && (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: SemanticColors.text.secondary, children: "Authentication:" }), _jsxs(Text, { color: SemanticColors.text.primary, children: [' ', "Type: ", profile.auth.type] }), profile.auth.buckets && profile.auth.buckets.length > 0 && (_jsxs(Text, { color: SemanticColors.text.primary, children: [' ', "Buckets: ", profile.auth.buckets.join(', ')] }))] }))] }));
|
|
105
|
+
};
|
|
106
|
+
// Delete confirmation overlay
|
|
107
|
+
if (confirmDelete) {
|
|
108
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: SemanticColors.status.warning, flexDirection: "column", padding: 1, width: Math.min(width, 60), children: [_jsx(Text, { bold: true, color: SemanticColors.status.warning, children: "Delete Profile?" }), _jsx(Box, { marginY: 1, children: _jsxs(Text, { color: SemanticColors.text.primary, children: ["Are you sure you want to delete \"", profileName, "\"?"] }) }), _jsx(Text, { color: SemanticColors.text.secondary, children: "This action cannot be undone." }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: SemanticColors.text.accent, children: "Press y to confirm, n or Esc to cancel" }) })] }));
|
|
109
|
+
}
|
|
110
|
+
const dialogWidth = isNarrow ? undefined : Math.min(width, 80);
|
|
111
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: SemanticColors.border.default, flexDirection: "column", padding: 1, width: dialogWidth, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { bold: true, color: SemanticColors.text.accent, children: profileName }), isActive && (_jsx(Text, { color: SemanticColors.status.success, children: " (Active)" })), isDefault && (_jsx(Text, { color: SemanticColors.text.secondary, children: " (Default)" }))] }), renderConfig(), _jsx(Box, { marginTop: 1, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: SemanticColors.border.default, paddingTop: 1, children: _jsxs(Text, { color: SemanticColors.text.secondary, children: ["Actions: ", _jsx(Text, { color: SemanticColors.text.accent, children: "l" }), "=load", ' ', _jsx(Text, { color: SemanticColors.text.accent, children: "e" }), "=edit", ' ', _jsx(Text, { color: SemanticColors.text.accent, children: "d" }), "=delete", ' ', _jsx(Text, { color: SemanticColors.text.accent, children: "s" }), "=set-default", ' ', _jsx(Text, { color: SemanticColors.text.secondary, children: "Esc" }), "=back"] }) })] }));
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=ProfileDetailDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileDetailDialog.js","sourceRoot":"","sources":["../../../../src/ui/components/ProfileDetailDialog.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAiBtD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,SAAS;IACT,UAAU;IACV,KAAK;IACL,SAAS;IACT,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,OAAO;IACP,UAAU;IACV,SAAS;IACT,YAAY;IACZ,cAAc;IACd,OAAO;IACP,SAAS;IACT,WAAW;IACX,WAAW;IACX,aAAa;IACb,MAAM;IACN,MAAM;IACN,QAAQ;IACR,gBAAgB;CACjB,CAAC,CAAC;AAEH,uCAAuC;AACvC,SAAS,qBAAqB,CAAC,OAAgB;IAK7C,MAAM,CAAC,GAAG,OAA6C,CAAC;IACxD,OAAO,CACL,OAAO,CAAC,IAAI,KAAK,cAAc;QAC/B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;QACzB,OAAO,CAAC,CAAC,MAAM,KAAK,QAAQ,CAC7B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAuC,CAAC,EAC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,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,0BAAkB,CAC7D,EACA,SAAS,IAAI,CACZ,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,2BAAmB,CAC9D,IACG,EAGL,YAAY,EAAE,EAGf,KAAC,GAAG,IACF,SAAS,EAAE,CAAC,EACZ,WAAW,EAAC,QAAQ,EACpB,SAAS,QACT,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,EAC1C,UAAU,EAAE,CAAC,YAEb,MAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,0BAC/B,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,kBAAU,WAAM,GAAG,EACnE,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,kBAAU,WAAM,GAAG,EAC1D,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,kBAAU,aAAQ,GAAG,EAC5D,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,kBAAU,kBAAa,GAAG,EACjE,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,oBAAY,aACjD,GACH,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { Profile } from '@vybestack/llxprt-code-core';
|
|
8
|
+
interface ProfileInlineEditorProps {
|
|
9
|
+
profileName: string;
|
|
10
|
+
profile: Profile;
|
|
11
|
+
onSave: (profileName: string, updatedProfile: Profile) => void;
|
|
12
|
+
onCancel: () => void;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const ProfileInlineEditor: React.FC<ProfileInlineEditorProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Vybestack LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
8
|
+
import { Box, Text } from 'ink';
|
|
9
|
+
import { SemanticColors } from '../colors.js';
|
|
10
|
+
import { useResponsive } from '../hooks/useResponsive.js';
|
|
11
|
+
import { useKeypress } from '../hooks/useKeypress.js';
|
|
12
|
+
/**
|
|
13
|
+
* Validates a profile structure. Returns error message or null if valid.
|
|
14
|
+
*/
|
|
15
|
+
function validateProfile(profile) {
|
|
16
|
+
if (typeof profile !== 'object' || profile === null) {
|
|
17
|
+
return 'Invalid profile: must be an object';
|
|
18
|
+
}
|
|
19
|
+
const p = profile;
|
|
20
|
+
if (!('version' in p) || typeof p.version !== 'string') {
|
|
21
|
+
return 'Missing or invalid version';
|
|
22
|
+
}
|
|
23
|
+
if (!('type' in p) || typeof p.type !== 'string') {
|
|
24
|
+
return 'Missing or invalid type';
|
|
25
|
+
}
|
|
26
|
+
if (p.type === 'standard') {
|
|
27
|
+
if (!('provider' in p) || typeof p.provider !== 'string' || !p.provider) {
|
|
28
|
+
return 'Standard profile requires provider';
|
|
29
|
+
}
|
|
30
|
+
if (!('model' in p) || typeof p.model !== 'string' || !p.model) {
|
|
31
|
+
return 'Standard profile requires model';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (p.type === 'loadbalancer') {
|
|
35
|
+
if (!('profiles' in p) || !Array.isArray(p.profiles)) {
|
|
36
|
+
return 'Load balancer requires profiles array';
|
|
37
|
+
}
|
|
38
|
+
if (p.profiles.length === 0) {
|
|
39
|
+
return 'Load balancer requires at least one profile';
|
|
40
|
+
}
|
|
41
|
+
if (!p.profiles.every((item) => typeof item === 'string')) {
|
|
42
|
+
return 'Profiles must be strings';
|
|
43
|
+
}
|
|
44
|
+
if (!('policy' in p) || typeof p.policy !== 'string' || !p.policy) {
|
|
45
|
+
return 'Load balancer requires policy';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return `Unknown profile type: ${p.type}`;
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
// Simple JSON editor that allows line-by-line editing
|
|
54
|
+
export const ProfileInlineEditor = ({ profileName, profile, onSave, onCancel, error: externalError, }) => {
|
|
55
|
+
const { width } = useResponsive();
|
|
56
|
+
// Convert profile to formatted JSON lines
|
|
57
|
+
const formatProfile = (p) => {
|
|
58
|
+
const json = JSON.stringify(p, null, 2);
|
|
59
|
+
return json.split('\n');
|
|
60
|
+
};
|
|
61
|
+
const [lines, setLines] = useState(() => formatProfile(profile));
|
|
62
|
+
const [cursorLine, setCursorLine] = useState(0);
|
|
63
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
64
|
+
const [editBuffer, setEditBuffer] = useState('');
|
|
65
|
+
const [validationError, setValidationError] = useState(null);
|
|
66
|
+
const [hasChanges, setHasChanges] = useState(false);
|
|
67
|
+
// Visible window for scrolling
|
|
68
|
+
const maxVisibleLines = 15;
|
|
69
|
+
const [scrollOffset, setScrollOffset] = useState(0);
|
|
70
|
+
// Reset editor when a different profile is loaded into the dialog.
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
setLines(formatProfile(profile));
|
|
73
|
+
setCursorLine(0);
|
|
74
|
+
setScrollOffset(0);
|
|
75
|
+
setIsEditing(false);
|
|
76
|
+
setEditBuffer('');
|
|
77
|
+
setValidationError(null);
|
|
78
|
+
setHasChanges(false);
|
|
79
|
+
}, [profileName, profile]);
|
|
80
|
+
// Ensure cursor line is visible
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (cursorLine < scrollOffset) {
|
|
83
|
+
setScrollOffset(cursorLine);
|
|
84
|
+
}
|
|
85
|
+
else if (cursorLine >= scrollOffset + maxVisibleLines) {
|
|
86
|
+
setScrollOffset(cursorLine - maxVisibleLines + 1);
|
|
87
|
+
}
|
|
88
|
+
}, [cursorLine, scrollOffset, maxVisibleLines]);
|
|
89
|
+
// Validate JSON on changes
|
|
90
|
+
const validateJson = useMemo(() => {
|
|
91
|
+
try {
|
|
92
|
+
const jsonString = lines.join('\n');
|
|
93
|
+
JSON.parse(jsonString);
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
return e instanceof Error ? e.message : 'Invalid JSON';
|
|
98
|
+
}
|
|
99
|
+
}, [lines]);
|
|
100
|
+
// Clear stale validation errors when JSON becomes valid
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (!validateJson) {
|
|
103
|
+
setValidationError(null);
|
|
104
|
+
}
|
|
105
|
+
}, [validateJson]);
|
|
106
|
+
useKeypress((key) => {
|
|
107
|
+
if (isEditing) {
|
|
108
|
+
// Edit mode
|
|
109
|
+
if (key.name === 'escape') {
|
|
110
|
+
// Cancel line edit
|
|
111
|
+
setIsEditing(false);
|
|
112
|
+
setEditBuffer('');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (key.name === 'return') {
|
|
116
|
+
// Commit line edit
|
|
117
|
+
const newLines = [...lines];
|
|
118
|
+
newLines[cursorLine] = editBuffer;
|
|
119
|
+
setLines(newLines);
|
|
120
|
+
setIsEditing(false);
|
|
121
|
+
setEditBuffer('');
|
|
122
|
+
setHasChanges(true);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (key.name === 'backspace' || key.name === 'delete') {
|
|
126
|
+
setEditBuffer((prev) => prev.slice(0, -1));
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (key.sequence &&
|
|
130
|
+
typeof key.sequence === 'string' &&
|
|
131
|
+
!key.ctrl &&
|
|
132
|
+
!key.meta &&
|
|
133
|
+
key.insertable !== false) {
|
|
134
|
+
setEditBuffer((prev) => prev + key.sequence);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
// Navigation mode
|
|
140
|
+
if (key.name === 'escape') {
|
|
141
|
+
onCancel();
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
// Save
|
|
145
|
+
if (key.ctrl && key.name === 's') {
|
|
146
|
+
if (validateJson) {
|
|
147
|
+
setValidationError(validateJson);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
const updatedProfile = JSON.parse(lines.join('\n'));
|
|
152
|
+
// Comprehensive profile validation
|
|
153
|
+
const profileError = validateProfile(updatedProfile);
|
|
154
|
+
if (profileError) {
|
|
155
|
+
setValidationError(profileError);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
onSave(profileName, updatedProfile);
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
setValidationError(e instanceof Error ? e.message : 'Invalid JSON');
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
// Navigation
|
|
166
|
+
if (key.name === 'up' || key.sequence === 'k') {
|
|
167
|
+
setCursorLine((prev) => Math.max(0, prev - 1));
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (key.name === 'down' || key.sequence === 'j') {
|
|
171
|
+
setCursorLine((prev) => Math.min(lines.length - 1, prev + 1));
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// Enter edit mode
|
|
175
|
+
if (key.name === 'return' || key.sequence === 'e') {
|
|
176
|
+
setIsEditing(true);
|
|
177
|
+
setEditBuffer(lines[cursorLine]);
|
|
178
|
+
setValidationError(null);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
// Page up/down
|
|
182
|
+
if (key.name === 'pageup') {
|
|
183
|
+
setCursorLine((prev) => Math.max(0, prev - maxVisibleLines));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (key.name === 'pagedown') {
|
|
187
|
+
setCursorLine((prev) => Math.min(lines.length - 1, prev + maxVisibleLines));
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
// Home/End
|
|
191
|
+
if (key.sequence === 'g') {
|
|
192
|
+
setCursorLine(0);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (key.sequence === 'G') {
|
|
196
|
+
setCursorLine(lines.length - 1);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}, { isActive: true });
|
|
200
|
+
const visibleLines = lines.slice(scrollOffset, scrollOffset + maxVisibleLines);
|
|
201
|
+
const dialogWidth = Math.min(width, 90);
|
|
202
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: validateJson
|
|
203
|
+
? SemanticColors.status.error
|
|
204
|
+
: hasChanges
|
|
205
|
+
? SemanticColors.status.warning
|
|
206
|
+
: SemanticColors.border.default, flexDirection: "column", padding: 1, width: dialogWidth, children: [_jsxs(Box, { marginBottom: 1, children: [_jsxs(Text, { bold: true, color: SemanticColors.text.accent, children: ["Edit: ", profileName] }), hasChanges && (_jsx(Text, { color: SemanticColors.status.warning, children: " (modified)" }))] }), (validationError || externalError || validateJson) && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: SemanticColors.status.error, children: ["Error: ", validationError || externalError || validateJson] }) })), _jsx(Box, { flexDirection: "column", marginBottom: 1, children: visibleLines.map((line, idx) => {
|
|
207
|
+
const actualLine = scrollOffset + idx;
|
|
208
|
+
const isCurrentLine = actualLine === cursorLine;
|
|
209
|
+
return (_jsxs(Box, { children: [_jsx(Box, { width: 4, children: _jsx(Text, { color: isCurrentLine
|
|
210
|
+
? SemanticColors.text.accent
|
|
211
|
+
: SemanticColors.text.secondary, children: String(actualLine + 1).padStart(3, ' ') }) }), isEditing && isCurrentLine ? (_jsx(Box, { children: _jsxs(Text, { color: SemanticColors.text.accent, children: [editBuffer, _jsx(Text, { color: SemanticColors.text.accent, children: "\u258C" })] }) })) : (_jsxs(Text, { color: isCurrentLine
|
|
212
|
+
? SemanticColors.text.accent
|
|
213
|
+
: SemanticColors.text.primary, bold: isCurrentLine, children: [isCurrentLine ? '› ' : ' ', line] }))] }, actualLine));
|
|
214
|
+
}) }), lines.length > maxVisibleLines && (_jsx(Box, { marginBottom: 1, children: _jsxs(Text, { color: SemanticColors.text.secondary, children: ["Lines ", scrollOffset + 1, "-", Math.min(scrollOffset + maxVisibleLines, lines.length), " of", ' ', lines.length] }) })), _jsx(Box, { borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: SemanticColors.border.default, paddingTop: 1, children: isEditing ? (_jsxs(Text, { color: SemanticColors.text.secondary, children: ["Editing line ", cursorLine + 1, ". Enter=commit, Esc=cancel"] })) : (_jsx(Text, { color: SemanticColors.text.secondary, children: "\u2191/\u2193=navigate, Enter/e=edit line, Ctrl+S=save, Esc=cancel" })) })] }));
|
|
215
|
+
};
|
|
216
|
+
//# sourceMappingURL=ProfileInlineEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileInlineEditor.js","sourceRoot":"","sources":["../../../../src/ui/components/ProfileInlineEditor.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAWtD;;GAEG;AACH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R,GACH,CACP,EAGD,KAAC,GAAG,IACF,WAAW,EAAC,QAAQ,EACpB,SAAS,QACT,YAAY,EAAE,KAAK,EACnB,UAAU,EAAE,KAAK,EACjB,WAAW,EAAE,KAAK,EAClB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,EAC1C,UAAU,EAAE,CAAC,YAEZ,SAAS,CAAC,CAAC,CAAC,CACX,MAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,8BAC1B,UAAU,GAAG,CAAC,kCACvB,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,SAAS,mFAEnC,CACR,GACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Vybestack LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export interface ProfileListItem {
|
|
8
|
+
name: string;
|
|
9
|
+
type: 'standard' | 'loadbalancer';
|
|
10
|
+
provider?: string;
|
|
11
|
+
model?: string;
|
|
12
|
+
isDefault?: boolean;
|
|
13
|
+
isActive?: boolean;
|
|
14
|
+
loadError?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface ProfileListDialogProps {
|
|
17
|
+
profiles: ProfileListItem[];
|
|
18
|
+
onSelect: (profileName: string) => void;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
onViewDetail: (profileName: string) => void;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
defaultProfileName?: string;
|
|
23
|
+
activeProfileName?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const ProfileListDialog: React.FC<ProfileListDialogProps>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Vybestack LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import React, { useState, useMemo } from 'react';
|
|
8
|
+
import { Box, Text } from 'ink';
|
|
9
|
+
import { SemanticColors } from '../colors.js';
|
|
10
|
+
import { useResponsive } from '../hooks/useResponsive.js';
|
|
11
|
+
import { truncateEnd } from '../utils/responsive.js';
|
|
12
|
+
import { useKeypress } from '../hooks/useKeypress.js';
|
|
13
|
+
export const ProfileListDialog = ({ profiles, onSelect, onClose, onViewDetail, isLoading = false, defaultProfileName, activeProfileName, }) => {
|
|
14
|
+
const { isNarrow, isWide, width } = useResponsive();
|
|
15
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
16
|
+
const [isSearching, setIsSearching] = useState(true); // Start in search mode
|
|
17
|
+
const [index, setIndex] = useState(0);
|
|
18
|
+
// Filter profiles based on search term
|
|
19
|
+
const filteredProfiles = useMemo(() => profiles.filter((p) => p.name.toLowerCase().includes(searchTerm.toLowerCase())), [profiles, searchTerm]);
|
|
20
|
+
// Reset index when search term changes
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
setIndex(0);
|
|
23
|
+
}, [searchTerm]);
|
|
24
|
+
// Clamp index when the underlying list changes.
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
setIndex((prev) => {
|
|
27
|
+
if (filteredProfiles.length === 0)
|
|
28
|
+
return 0;
|
|
29
|
+
return Math.min(prev, filteredProfiles.length - 1);
|
|
30
|
+
});
|
|
31
|
+
}, [filteredProfiles.length]);
|
|
32
|
+
const columns = isNarrow ? 1 : isWide ? 3 : 2;
|
|
33
|
+
const longest = filteredProfiles.reduce((len, p) => Math.max(len, p.name.length + 10), // account for indicators
|
|
34
|
+
0);
|
|
35
|
+
const colWidth = isWide
|
|
36
|
+
? Math.max(longest + 4, 35)
|
|
37
|
+
: Math.max(longest + 4, 25);
|
|
38
|
+
const rows = Math.ceil(filteredProfiles.length / columns);
|
|
39
|
+
const move = (delta) => {
|
|
40
|
+
if (filteredProfiles.length === 0) {
|
|
41
|
+
setIndex(0);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let next = index + delta;
|
|
45
|
+
if (next < 0)
|
|
46
|
+
next = 0;
|
|
47
|
+
if (next >= filteredProfiles.length)
|
|
48
|
+
next = filteredProfiles.length - 1;
|
|
49
|
+
setIndex(next);
|
|
50
|
+
};
|
|
51
|
+
useKeypress((key) => {
|
|
52
|
+
if (key.name === 'escape') {
|
|
53
|
+
if (isSearching && searchTerm.length > 0) {
|
|
54
|
+
setSearchTerm('');
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return onClose();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (isSearching || isNarrow) {
|
|
61
|
+
if (key.name === 'return') {
|
|
62
|
+
if (filteredProfiles.length > 0) {
|
|
63
|
+
if (isNarrow) {
|
|
64
|
+
return onViewDetail(filteredProfiles[index].name);
|
|
65
|
+
}
|
|
66
|
+
setIsSearching(false);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (key.name === 'tab' && !isNarrow) {
|
|
70
|
+
setIsSearching(false);
|
|
71
|
+
}
|
|
72
|
+
else if (key.name === 'backspace' || key.name === 'delete') {
|
|
73
|
+
setSearchTerm((prev) => prev.slice(0, -1));
|
|
74
|
+
}
|
|
75
|
+
else if (key.sequence &&
|
|
76
|
+
typeof key.sequence === 'string' &&
|
|
77
|
+
!key.ctrl &&
|
|
78
|
+
!key.meta &&
|
|
79
|
+
key.insertable !== false) {
|
|
80
|
+
setSearchTerm((prev) => prev + key.sequence);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Navigation mode
|
|
85
|
+
if (key.name === 'return' && filteredProfiles.length > 0) {
|
|
86
|
+
return onViewDetail(filteredProfiles[index].name);
|
|
87
|
+
}
|
|
88
|
+
if (key.name === 'tab') {
|
|
89
|
+
setIsSearching(true);
|
|
90
|
+
}
|
|
91
|
+
if (filteredProfiles.length === 0) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Quick actions
|
|
95
|
+
if (key.sequence === 'l' && filteredProfiles.length > 0) {
|
|
96
|
+
return onSelect(filteredProfiles[index].name);
|
|
97
|
+
}
|
|
98
|
+
// Navigation
|
|
99
|
+
if (key.name === 'left')
|
|
100
|
+
move(-1);
|
|
101
|
+
if (key.name === 'right')
|
|
102
|
+
move(1);
|
|
103
|
+
if (key.name === 'up')
|
|
104
|
+
move(-columns);
|
|
105
|
+
if (key.name === 'down')
|
|
106
|
+
move(columns);
|
|
107
|
+
// Vim-style navigation
|
|
108
|
+
if (key.sequence === 'j')
|
|
109
|
+
move(columns);
|
|
110
|
+
if (key.sequence === 'k')
|
|
111
|
+
move(-columns);
|
|
112
|
+
if (key.sequence === 'h')
|
|
113
|
+
move(-1);
|
|
114
|
+
}
|
|
115
|
+
}, { isActive: !isLoading });
|
|
116
|
+
const renderItem = (profile, i) => {
|
|
117
|
+
const selected = i === index && (!isSearching || isNarrow);
|
|
118
|
+
const isActiveProfile = profile.name === activeProfileName;
|
|
119
|
+
const isDefaultProfile = profile.name === defaultProfileName;
|
|
120
|
+
// Build indicators
|
|
121
|
+
let indicators = '';
|
|
122
|
+
if (isActiveProfile)
|
|
123
|
+
indicators += '*';
|
|
124
|
+
if (isDefaultProfile)
|
|
125
|
+
indicators += 'D';
|
|
126
|
+
if (profile.type === 'loadbalancer')
|
|
127
|
+
indicators += 'LB';
|
|
128
|
+
const indicatorText = indicators ? ` [${indicators}]` : '';
|
|
129
|
+
// Truncate name if needed
|
|
130
|
+
const maxNameLen = colWidth - 6 - indicatorText.length;
|
|
131
|
+
const displayName = isWide
|
|
132
|
+
? profile.name
|
|
133
|
+
: profile.name.length > maxNameLen
|
|
134
|
+
? truncateEnd(profile.name, maxNameLen)
|
|
135
|
+
: profile.name;
|
|
136
|
+
return (_jsx(Box, { width: isWide ? undefined : colWidth, marginRight: 2, children: _jsxs(Text, { color: selected
|
|
137
|
+
? SemanticColors.text.accent
|
|
138
|
+
: isSearching && !isNarrow
|
|
139
|
+
? SemanticColors.text.secondary
|
|
140
|
+
: isActiveProfile
|
|
141
|
+
? SemanticColors.status.success
|
|
142
|
+
: SemanticColors.text.primary, children: [selected ? '● ' : '○ ', displayName, indicatorText && (_jsx(Text, { color: SemanticColors.text.secondary, children: indicatorText }))] }) }, profile.name));
|
|
143
|
+
};
|
|
144
|
+
const grid = [];
|
|
145
|
+
for (let r = 0; r < rows; r++) {
|
|
146
|
+
const rowItems = [];
|
|
147
|
+
for (let c = 0; c < columns; c++) {
|
|
148
|
+
const i = r * columns + c;
|
|
149
|
+
if (i < filteredProfiles.length) {
|
|
150
|
+
rowItems.push(renderItem(filteredProfiles[i], i));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
grid.push(_jsx(Box, { children: rowItems }, r));
|
|
154
|
+
}
|
|
155
|
+
if (isLoading) {
|
|
156
|
+
return (_jsx(Box, { borderStyle: "round", borderColor: SemanticColors.border.default, flexDirection: "column", padding: 1, children: _jsx(Text, { color: SemanticColors.text.primary, children: "Loading profiles..." }) }));
|
|
157
|
+
}
|
|
158
|
+
if (profiles.length === 0) {
|
|
159
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: SemanticColors.border.default, flexDirection: "column", padding: 1, children: [_jsx(Text, { color: SemanticColors.text.primary, children: "No saved profiles found. Use /profile save model <name> to create one." }), _jsx(Text, { color: SemanticColors.text.secondary, children: "Press Esc to close" })] }));
|
|
160
|
+
}
|
|
161
|
+
const renderContent = () => {
|
|
162
|
+
if (isNarrow) {
|
|
163
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, color: SemanticColors.text.primary, children: "Profiles" }), _jsxs(Box, { marginY: 1, children: [_jsxs(Text, { color: SemanticColors.text.primary, children: ["Search: ", _jsx(Text, { color: SemanticColors.text.accent, children: "\u258C" })] }), _jsx(Text, { color: SemanticColors.text.primary, children: searchTerm })] }), _jsx(Text, { color: SemanticColors.text.secondary, children: "Type to filter, Enter for details, Esc to cancel" }), _jsxs(Text, { color: SemanticColors.text.secondary, children: [filteredProfiles.length, " profiles", searchTerm && ' found'] }), filteredProfiles.length > 0 ? (grid) : (_jsx(Box, { marginY: 1, children: _jsxs(Text, { color: SemanticColors.text.secondary, children: ["No profiles match \"", searchTerm, "\""] }) }))] }));
|
|
164
|
+
}
|
|
165
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, color: SemanticColors.text.primary, children: "Profile List" }), _jsxs(Box, { marginY: 1, children: [_jsxs(Text, { color: isSearching
|
|
166
|
+
? SemanticColors.text.primary
|
|
167
|
+
: SemanticColors.text.secondary, children: ["Search:", ' ', isSearching && _jsx(Text, { color: SemanticColors.text.accent, children: "\u258C" })] }), _jsx(Text, { color: SemanticColors.text.primary, children: searchTerm }), _jsxs(Text, { color: SemanticColors.text.secondary, children: [' ', "(press Tab to ", isSearching ? 'navigate' : 'search', ") Found", ' ', filteredProfiles.length, " profiles"] })] }), filteredProfiles.length > 0 ? (grid) : (_jsx(Box, { marginY: 1, children: _jsxs(Text, { color: SemanticColors.text.secondary, children: ["No profiles match \"", searchTerm, "\""] }) })), filteredProfiles.length > 0 && !isSearching && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: SemanticColors.text.secondary, children: ["Selected: ", filteredProfiles[index].name, filteredProfiles[index].provider && (_jsxs(Text, { color: SemanticColors.text.secondary, children: [' ', "(", filteredProfiles[index].provider, filteredProfiles[index].model &&
|
|
168
|
+
` / ${filteredProfiles[index].model}`, ")"] }))] }) })), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: SemanticColors.text.secondary, children: "Legend: * = active, D = default, LB = load balancer" }) }), _jsx(Box, { marginTop: 1 }), _jsx(Text, { color: SemanticColors.text.secondary, children: "Controls: \u2191\u2193\u2190\u2192 Navigate [Enter] Details [l] Load [Esc] Close" })] }));
|
|
169
|
+
};
|
|
170
|
+
return isNarrow ? (_jsx(Box, { flexDirection: "column", padding: 1, children: renderContent() })) : (_jsx(Box, { borderStyle: "round", borderColor: SemanticColors.border.default, flexDirection: "column", padding: 1, width: Math.min(width, 100), children: renderContent() }));
|
|
171
|
+
};
|
|
172
|
+
//# sourceMappingURL=ProfileListDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProfileListDialog.js","sourceRoot":"","sources":["../../../../src/ui/components/ProfileListDialog.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAsBtD,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,aAAa,EAAE,CAAC;IACpD,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,uBAAuB;IAC7E,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtC,uCAAuC;I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ACH,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC,YACnC,aAAa,EAAE,GACZ,CACP,CAAC,CAAC,CAAC,CACF,KAAC,GAAG,IACF,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,OAAO,EAC1C,aAAa,EAAC,QAAQ,EACtB,OAAO,EAAE,CAAC,EACV,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,YAE1B,aAAa,EAAE,GACZ,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -73,7 +73,7 @@ export const ProviderDialog = ({ providers, currentProvider, onSelect, onClose,
|
|
|
73
73
|
typeof key.sequence === 'string' &&
|
|
74
74
|
!key.ctrl &&
|
|
75
75
|
!key.meta &&
|
|
76
|
-
key.insertable) {
|
|
76
|
+
key.insertable !== false) {
|
|
77
77
|
setSearchTerm((prev) => prev + key.sequence);
|
|
78
78
|
}
|
|
79
79
|
}
|