@hashgraphonline/conversational-agent 0.2.211 → 0.2.213
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/cli/dist/CLIApp.d.ts +11 -0
- package/cli/dist/CLIApp.d.ts.map +1 -0
- package/cli/dist/CLIApp.js +128 -0
- package/cli/dist/CLIApp.js.map +1 -0
- package/cli/dist/LocalConversationalAgent.d.ts +37 -0
- package/cli/dist/LocalConversationalAgent.js +58 -0
- package/cli/dist/app.d.ts +18 -0
- package/cli/dist/app.d.ts.map +1 -0
- package/cli/dist/app.js +14 -0
- package/cli/dist/app.js.map +1 -0
- package/cli/dist/cli.d.ts +3 -0
- package/cli/dist/cli.d.ts.map +1 -0
- package/cli/dist/cli.js +87 -0
- package/cli/dist/cli.js.map +1 -0
- package/cli/dist/components/AppContainer.d.ts +16 -0
- package/cli/dist/components/AppContainer.js +24 -0
- package/cli/dist/components/AppScreens.d.ts +2 -0
- package/cli/dist/components/AppScreens.js +259 -0
- package/cli/dist/components/ChatScreen.d.ts +21 -0
- package/cli/dist/components/ChatScreen.d.ts.map +1 -0
- package/cli/dist/components/ChatScreen.js +40 -0
- package/cli/dist/components/ChatScreen.js.map +1 -0
- package/cli/dist/components/DebugLoadingScreen.d.ts +5 -0
- package/cli/dist/components/DebugLoadingScreen.js +31 -0
- package/cli/dist/components/LoadingScreen.d.ts +3 -0
- package/cli/dist/components/LoadingScreen.d.ts.map +1 -0
- package/cli/dist/components/LoadingScreen.js +17 -0
- package/cli/dist/components/LoadingScreen.js.map +1 -0
- package/cli/dist/components/LoadingScreenDebug.d.ts +5 -0
- package/cli/dist/components/LoadingScreenDebug.js +27 -0
- package/cli/dist/components/MCPConfigScreen.d.ts +28 -0
- package/cli/dist/components/MCPConfigScreen.d.ts.map +1 -0
- package/cli/dist/components/MCPConfigScreen.js +186 -0
- package/cli/dist/components/MCPConfigScreen.js.map +1 -0
- package/cli/dist/components/ScreenRouter.d.ts +13 -0
- package/cli/dist/components/ScreenRouter.d.ts.map +1 -0
- package/cli/dist/components/ScreenRouter.js +23 -0
- package/cli/dist/components/ScreenRouter.js.map +1 -0
- package/cli/dist/components/SetupScreen.d.ts +16 -0
- package/cli/dist/components/SetupScreen.d.ts.map +1 -0
- package/cli/dist/components/SetupScreen.js +67 -0
- package/cli/dist/components/SetupScreen.js.map +1 -0
- package/cli/dist/components/SingleLoadingScreen.d.ts +5 -0
- package/cli/dist/components/SingleLoadingScreen.js +27 -0
- package/cli/dist/components/StatusBadge.d.ts +10 -0
- package/cli/dist/components/StatusBadge.d.ts.map +1 -0
- package/cli/dist/components/StatusBadge.js +24 -0
- package/cli/dist/components/StatusBadge.js.map +1 -0
- package/cli/dist/components/TerminalWindow.d.ts +9 -0
- package/cli/dist/components/TerminalWindow.d.ts.map +1 -0
- package/cli/dist/components/TerminalWindow.js +19 -0
- package/cli/dist/components/TerminalWindow.js.map +1 -0
- package/cli/dist/components/WelcomeScreen.d.ts +12 -0
- package/cli/dist/components/WelcomeScreen.d.ts.map +1 -0
- package/cli/dist/components/WelcomeScreen.js +47 -0
- package/cli/dist/components/WelcomeScreen.js.map +1 -0
- package/cli/dist/context/AppContext.d.ts +68 -0
- package/cli/dist/context/AppContext.js +363 -0
- package/cli/dist/headless-runner.d.ts +17 -0
- package/cli/dist/headless-runner.d.ts.map +1 -0
- package/cli/dist/headless-runner.js +128 -0
- package/cli/dist/headless-runner.js.map +1 -0
- package/cli/dist/hooks/useInitializeAgent.d.ts +19 -0
- package/cli/dist/hooks/useInitializeAgent.d.ts.map +1 -0
- package/cli/dist/hooks/useInitializeAgent.js +29 -0
- package/cli/dist/hooks/useInitializeAgent.js.map +1 -0
- package/cli/dist/hooks/useStableState.d.ts +38 -0
- package/cli/dist/hooks/useStableState.d.ts.map +1 -0
- package/cli/dist/hooks/useStableState.js +69 -0
- package/cli/dist/hooks/useStableState.js.map +1 -0
- package/cli/dist/managers/AgentManager.d.ts +58 -0
- package/cli/dist/managers/AgentManager.d.ts.map +1 -0
- package/cli/dist/managers/AgentManager.js +121 -0
- package/cli/dist/managers/AgentManager.js.map +1 -0
- package/cli/dist/managers/ConfigManager.d.ts +54 -0
- package/cli/dist/managers/ConfigManager.d.ts.map +1 -0
- package/cli/dist/managers/ConfigManager.js +188 -0
- package/cli/dist/managers/ConfigManager.js.map +1 -0
- package/cli/dist/types.d.ts +52 -0
- package/cli/dist/types.d.ts.map +1 -0
- package/cli/dist/types.js +34 -0
- package/cli/dist/types.js.map +1 -0
- package/dist/esm/index10.js +1 -1
- package/dist/esm/index21.js +1 -1
- package/dist/esm/index23.js +1 -1
- package/dist/esm/index33.js +4 -4
- package/dist/esm/index42.js +26 -4
- package/dist/esm/index42.js.map +1 -1
- package/dist/esm/index43.js +4 -11
- package/dist/esm/index43.js.map +1 -1
- package/dist/esm/index44.js +12 -322
- package/dist/esm/index44.js.map +1 -1
- package/dist/esm/index45.js +280 -142
- package/dist/esm/index45.js.map +1 -1
- package/dist/esm/index46.js +181 -24
- package/dist/esm/index46.js.map +1 -1
- package/package.json +25 -33
- package/cli/readme.md +0 -181
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import TextInput from 'ink-text-input';
|
|
4
|
+
import SelectInput from 'ink-select-input';
|
|
5
|
+
import { TerminalWindow } from './TerminalWindow';
|
|
6
|
+
import { StatusBadge } from './StatusBadge';
|
|
7
|
+
import { BRAND_COLORS, } from '../types';
|
|
8
|
+
const customFieldDescriptors = [
|
|
9
|
+
{
|
|
10
|
+
key: 'newServerName',
|
|
11
|
+
label: 'Server Name:',
|
|
12
|
+
placeholder: 'my-server',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: 'newServerCommand',
|
|
16
|
+
label: 'Command:',
|
|
17
|
+
placeholder: 'npx',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
key: 'newServerArgs',
|
|
21
|
+
label: 'Arguments (comma-separated):',
|
|
22
|
+
placeholder: '-y, @modelcontextprotocol/server-github',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'newServerEnv',
|
|
26
|
+
label: 'Environment Variables (KEY=value, comma-separated):',
|
|
27
|
+
placeholder: 'MCP_LOG_LEVEL=info, GIT_SIGN_COMMITS=false',
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* MCP Configuration screen
|
|
32
|
+
*/
|
|
33
|
+
export const MCPConfigScreen = ({ mcpConfig, editingFilesystemPath, onSetMcpConfig, onSetEditingFilesystemPath, onSetScreen, onSaveMCPConfig, getMCPConfigPath, }) => {
|
|
34
|
+
useInput((_, key) => {
|
|
35
|
+
if (key.escape) {
|
|
36
|
+
if (mcpConfig.addingCustom) {
|
|
37
|
+
onSetMcpConfig({
|
|
38
|
+
addingCustom: false,
|
|
39
|
+
newServerName: '',
|
|
40
|
+
newServerCommand: '',
|
|
41
|
+
newServerArgs: '',
|
|
42
|
+
newServerEnv: '',
|
|
43
|
+
currentField: 0,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else if (editingFilesystemPath) {
|
|
47
|
+
onSetEditingFilesystemPath(false);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (editingFilesystemPath) {
|
|
52
|
+
return (React.createElement(TerminalWindow, { title: "Edit Filesystem Path" },
|
|
53
|
+
React.createElement(Box, { flexDirection: "column" },
|
|
54
|
+
React.createElement(Box, { marginBottom: 2 },
|
|
55
|
+
React.createElement(Text, null, "Enter the directory path for the filesystem server:")),
|
|
56
|
+
React.createElement(TextInput, { value: mcpConfig.filesystemPath, onChange: value => onSetMcpConfig({ filesystemPath: value }), onSubmit: () => {
|
|
57
|
+
onSetEditingFilesystemPath(false);
|
|
58
|
+
onSaveMCPConfig();
|
|
59
|
+
}, placeholder: process.cwd() }),
|
|
60
|
+
React.createElement(Box, { marginTop: 2 },
|
|
61
|
+
React.createElement(Text, { dimColor: true }, "Press Enter to save, Escape to cancel")))));
|
|
62
|
+
}
|
|
63
|
+
if (mcpConfig.addingCustom) {
|
|
64
|
+
const customFieldUpdaters = {
|
|
65
|
+
newServerName: value => onSetMcpConfig({ newServerName: value }),
|
|
66
|
+
newServerCommand: value => onSetMcpConfig({ newServerCommand: value }),
|
|
67
|
+
newServerArgs: value => onSetMcpConfig({ newServerArgs: value }),
|
|
68
|
+
newServerEnv: value => onSetMcpConfig({ newServerEnv: value }),
|
|
69
|
+
};
|
|
70
|
+
return (React.createElement(TerminalWindow, { title: "Add Custom MCP Server" },
|
|
71
|
+
React.createElement(Box, { flexDirection: "column" },
|
|
72
|
+
customFieldDescriptors.map(({ key, label, placeholder }, index) => (React.createElement(Box, { key: key, marginY: 1 },
|
|
73
|
+
React.createElement(Text, { color: mcpConfig.currentField === index
|
|
74
|
+
? BRAND_COLORS.blue
|
|
75
|
+
: BRAND_COLORS.hedera.smoke }, label),
|
|
76
|
+
mcpConfig.currentField === index ? (React.createElement(TextInput, { value: mcpConfig[key], onChange: value => customFieldUpdaters[key](value), onSubmit: () => {
|
|
77
|
+
if (index < customFieldDescriptors.length - 1) {
|
|
78
|
+
onSetMcpConfig({ currentField: index + 1 });
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (mcpConfig.newServerName && mcpConfig.newServerCommand) {
|
|
82
|
+
const env = {};
|
|
83
|
+
if (mcpConfig.newServerEnv) {
|
|
84
|
+
mcpConfig.newServerEnv.split(',').forEach(envVar => {
|
|
85
|
+
const [envKey, envValue] = envVar.trim().split('=');
|
|
86
|
+
if (envKey && envValue) {
|
|
87
|
+
env[envKey] = envValue;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const newServer = {
|
|
92
|
+
name: mcpConfig.newServerName,
|
|
93
|
+
command: mcpConfig.newServerCommand,
|
|
94
|
+
args: mcpConfig.newServerArgs
|
|
95
|
+
.split(',')
|
|
96
|
+
.map(arg => arg.trim())
|
|
97
|
+
.filter(Boolean),
|
|
98
|
+
transport: 'stdio',
|
|
99
|
+
autoConnect: true,
|
|
100
|
+
...(Object.keys(env).length > 0 && { env }),
|
|
101
|
+
};
|
|
102
|
+
const newCustomServers = [...mcpConfig.customServers, newServer];
|
|
103
|
+
onSetMcpConfig({
|
|
104
|
+
customServers: newCustomServers,
|
|
105
|
+
addingCustom: false,
|
|
106
|
+
newServerName: '',
|
|
107
|
+
newServerCommand: '',
|
|
108
|
+
newServerArgs: '',
|
|
109
|
+
newServerEnv: '',
|
|
110
|
+
currentField: 0,
|
|
111
|
+
});
|
|
112
|
+
onSaveMCPConfig();
|
|
113
|
+
}
|
|
114
|
+
}, placeholder: placeholder })) : (React.createElement(Text, { color: BRAND_COLORS.hedera.smoke }, mcpConfig[key] ? mcpConfig[key] : `(${placeholder})`))))),
|
|
115
|
+
React.createElement(Box, { marginTop: 2 },
|
|
116
|
+
React.createElement(Text, { dimColor: true }, "Press Tab or Enter to move between fields"),
|
|
117
|
+
React.createElement(Text, { dimColor: true }, "Press Enter on the last field to add the server"),
|
|
118
|
+
React.createElement(Text, { dimColor: true }, "Press Escape to cancel")))));
|
|
119
|
+
}
|
|
120
|
+
const menuItems = [
|
|
121
|
+
{
|
|
122
|
+
label: `Filesystem Server: ${mcpConfig.enableFilesystem ? 'Enabled' : 'Disabled'}`,
|
|
123
|
+
value: { type: 'filesystem' },
|
|
124
|
+
},
|
|
125
|
+
];
|
|
126
|
+
if (mcpConfig.enableFilesystem) {
|
|
127
|
+
menuItems.push({
|
|
128
|
+
label: `Filesystem Path: ${mcpConfig.filesystemPath}`,
|
|
129
|
+
value: { type: 'filesystem-path' },
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
mcpConfig.customServers.forEach((server, index) => {
|
|
133
|
+
menuItems.push({
|
|
134
|
+
label: `${server.name} (${server.command})`,
|
|
135
|
+
value: { type: 'custom', index },
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
menuItems.push({ label: 'Add Custom Server', value: { type: 'add-custom' } }, { label: 'Done (changes auto-saved)', value: { type: 'save' } }, { label: 'Back to Menu', value: { type: 'back' } });
|
|
139
|
+
return (React.createElement(TerminalWindow, { title: "MCP Server Configuration" },
|
|
140
|
+
React.createElement(Box, { flexDirection: "column" },
|
|
141
|
+
React.createElement(Box, { marginBottom: 2 },
|
|
142
|
+
React.createElement(StatusBadge, { status: "info" }),
|
|
143
|
+
React.createElement(Text, null, "Configure Model Context Protocol servers")),
|
|
144
|
+
React.createElement(SelectInput, { items: menuItems, onSelect: ({ value }) => {
|
|
145
|
+
switch (value.type) {
|
|
146
|
+
case 'filesystem': {
|
|
147
|
+
const enableFilesystem = !mcpConfig.enableFilesystem;
|
|
148
|
+
onSetMcpConfig({ enableFilesystem });
|
|
149
|
+
onSaveMCPConfig();
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
case 'filesystem-path': {
|
|
153
|
+
onSetEditingFilesystemPath(true);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
case 'add-custom': {
|
|
157
|
+
onSetMcpConfig({ addingCustom: true, currentField: 0 });
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
case 'save': {
|
|
161
|
+
onSaveMCPConfig();
|
|
162
|
+
onSetScreen('welcome');
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
case 'back': {
|
|
166
|
+
onSetScreen('welcome');
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
case 'custom': {
|
|
170
|
+
const newCustomServers = mcpConfig.customServers.filter((_, index) => index !== value.index);
|
|
171
|
+
onSetMcpConfig({ customServers: newCustomServers });
|
|
172
|
+
onSaveMCPConfig();
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
} }),
|
|
177
|
+
React.createElement(Box, { marginY: 2 },
|
|
178
|
+
React.createElement(Text, { dimColor: true }, "Press Enter to toggle/edit servers, or select actions"),
|
|
179
|
+
mcpConfig.enableFilesystem && (React.createElement(Text, { dimColor: true },
|
|
180
|
+
"Filesystem path: ",
|
|
181
|
+
mcpConfig.filesystemPath)),
|
|
182
|
+
React.createElement(Text, { dimColor: true },
|
|
183
|
+
"Config saved to: ",
|
|
184
|
+
getMCPConfigPath())))));
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=MCPConfigScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MCPConfigScreen.js","sourceRoot":"","sources":["../../src/components/MCPConfigScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,KAAK,CAAC;AACxC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EACL,YAAY,GAIb,MAAM,UAAU,CAAC;AAwBlB,MAAM,sBAAsB,GAIvB;IACH;QACE,GAAG,EAAE,eAAe;QACpB,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,WAAW;KACzB;IACD;QACE,GAAG,EAAE,kBAAkB;QACvB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,KAAK;KACnB;IACD;QACE,GAAG,EAAE,eAAe;QACpB,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,yCAAyC;KACvD;IACD;QACE,GAAG,EAAE,cAAc;QACnB,KAAK,EAAE,qDAAqD;QAC5D,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC;AAYF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB,CAAC,EAC/C,SAAS,EACT,qBAAqB,EACrB,cAAc,EACd,0BAA0B,EAC1B,WAAW,EACX,eAAe,EACf,gBAAgB,GACjB,EAAE,EAAE;IACH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,CAAC,CAAC;4BACvB,OAAO;wBACT,CAAC;wBACD,KAAK,QAAQ,CAAC,CAAC,CAAC;4BACd,MAAM,gBAAgB,GAAG,SAAS,CAAC,aAAa,CAAC,MAAM,CACrD,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK,CACpC,CAAC;4BACF,cAAc,CAAC,EAAC,aAAa,EAAE,gBAAgB,EAAC,CAAC,CAAC;4BAClD,eAAe,EAAE,CAAC;4BAClB,OAAO;wBACT,CAAC;oBACH,CAAC;gBACH,CAAC,GACD;YAEF,oBAAC,GAAG,IAAC,OAAO,EAAE,CAAC;gBACb,oBAAC,IAAI,IAAC,QAAQ,kEAEP;gBACN,SAAS,CAAC,gBAAgB,IAAI,CAC7B,oBAAC,IAAI,IAAC,QAAQ;;oBAAmB,SAAS,CAAC,cAAc,CAAQ,CAClE;gBACD,oBAAC,IAAI,IAAC,QAAQ;;oBAAmB,gBAAgB,EAAE,CAAQ,CACvD,CACF,CACS,CAClB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Config } from '../types';
|
|
3
|
+
import { type AppState } from '../hooks/useStableState';
|
|
4
|
+
interface Props {
|
|
5
|
+
state: AppState;
|
|
6
|
+
currentConfig: Config;
|
|
7
|
+
actions: any;
|
|
8
|
+
stableHandlers: any;
|
|
9
|
+
exit: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const ScreenRouter: React.FC<Props>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=ScreenRouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenRouter.d.ts","sourceRoot":"","sources":["../../src/components/ScreenRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,UAAU,CAAC;AACrC,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AAEtD,UAAU,KAAK;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,GAAG,CAAC;IACb,cAAc,EAAE,GAAG,CAAC;IACpB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA+DxC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WelcomeScreen } from './WelcomeScreen';
|
|
3
|
+
import { ChatScreen } from './ChatScreen';
|
|
4
|
+
import { LoadingScreen } from './LoadingScreen';
|
|
5
|
+
import { SetupScreen } from './SetupScreen';
|
|
6
|
+
import { MCPConfigScreen } from './MCPConfigScreen';
|
|
7
|
+
export const ScreenRouter = ({ state, currentConfig, actions, stableHandlers, exit, }) => {
|
|
8
|
+
switch (state.screen) {
|
|
9
|
+
case 'welcome':
|
|
10
|
+
return (React.createElement(WelcomeScreen, { config: currentConfig, onExit: exit, onInitializeAgent: stableHandlers.initializeAgent, onSetScreen: actions.setScreen }));
|
|
11
|
+
case 'loading':
|
|
12
|
+
return React.createElement(LoadingScreen, null);
|
|
13
|
+
case 'setup':
|
|
14
|
+
return (React.createElement(SetupScreen, { config: currentConfig, currentField: state.currentField, error: state.error, onUpdateConfig: stableHandlers.updateConfig, onSetCurrentField: actions.setCurrentField, onInitializeAgent: stableHandlers.initializeAgent }));
|
|
15
|
+
case 'mcp-config':
|
|
16
|
+
return (React.createElement(MCPConfigScreen, { mcpConfig: state.mcpConfig, editingFilesystemPath: state.editingFilesystemPath, onSetMcpConfig: actions.setMcpConfig, onSetEditingFilesystemPath: actions.setEditingFilesystemPath, onSetScreen: actions.setScreen, onSaveMCPConfig: stableHandlers.saveMCPConfig, getMCPConfigPath: stableHandlers.getMCPConfigPath }));
|
|
17
|
+
case 'chat':
|
|
18
|
+
return (React.createElement(ChatScreen, { config: currentConfig, messages: state.messages, input: state.input, isLoading: state.isLoading, setInput: actions.setInput, sendMessage: stableHandlers.sendMessage, showLogs: false, logs: state.logs }));
|
|
19
|
+
default:
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ScreenRouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScreenRouter.js","sourceRoot":"","sources":["../../src/components/ScreenRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAYlD,MAAM,CAAC,MAAM,YAAY,GAAoB,CAAC,EAC5C,KAAK,EACL,aAAa,EACb,OAAO,EACP,cAAc,EACd,IAAI,GACL,EAAE,EAAE;IACH,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,CACL,oBAAC,aAAa,IACZ,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,IAAI,EACZ,iBAAiB,EAAE,cAAc,CAAC,eAAe,EACjD,WAAW,EAAE,OAAO,CAAC,SAAS,GAC9B,CACH,CAAC;QAEJ,KAAK,SAAS;YACZ,OAAO,oBAAC,aAAa,OAAG,CAAC;QAE3B,KAAK,OAAO;YACV,OAAO,CACL,oBAAC,WAAW,IACV,MAAM,EAAE,aAAa,EACrB,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,cAAc,EAAE,cAAc,CAAC,YAAY,EAC3C,iBAAiB,EAAE,OAAO,CAAC,eAAe,EAC1C,iBAAiB,EAAE,cAAc,CAAC,eAAe,GACjD,CACH,CAAC;QAEJ,KAAK,YAAY;YACf,OAAO,CACL,oBAAC,eAAe,IACd,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,cAAc,EAAE,OAAO,CAAC,YAAY,EACpC,0BAA0B,EAAE,OAAO,CAAC,wBAAwB,EAC5D,WAAW,EAAE,OAAO,CAAC,SAAS,EAC9B,eAAe,EAAE,cAAc,CAAC,aAAa,EAC7C,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,GACjD,CACH,CAAC;QAEJ,KAAK,MAAM;YACT,OAAO,CACL,oBAAC,UAAU,IACT,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,WAAW,EAAE,cAAc,CAAC,WAAW,EACvC,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,KAAK,CAAC,IAAI,GAChB,CACH,CAAC;QAEJ;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Config } from '../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
config: Config;
|
|
5
|
+
currentField: number;
|
|
6
|
+
error: string | null;
|
|
7
|
+
onUpdateConfig: (field: keyof Config, value: string) => void;
|
|
8
|
+
onSetCurrentField: (field: number) => void;
|
|
9
|
+
onInitializeAgent: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Setup screen for configuring credentials
|
|
13
|
+
*/
|
|
14
|
+
export declare const SetupScreen: React.FC<Props>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=SetupScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetupScreen.d.ts","sourceRoot":"","sources":["../../src/components/SetupScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAe,KAAK,MAAM,EAAgC,MAAM,UAAU,CAAC;AAElF,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7D,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B;AAsBD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmGvC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import TextInput from 'ink-text-input';
|
|
4
|
+
import SelectInput from 'ink-select-input';
|
|
5
|
+
import { TerminalWindow } from './TerminalWindow';
|
|
6
|
+
import { StatusBadge } from './StatusBadge';
|
|
7
|
+
import { BRAND_COLORS } from '../types';
|
|
8
|
+
const hiddenValue = '••••••••';
|
|
9
|
+
const fieldDescriptors = [
|
|
10
|
+
{ key: 'accountId', label: 'Account ID:' },
|
|
11
|
+
{ key: 'privateKey', label: 'Private Key:', mask: true },
|
|
12
|
+
{ key: 'network', label: 'Network:' },
|
|
13
|
+
{ key: 'openAIApiKey', label: 'OpenAI Key:', mask: true },
|
|
14
|
+
];
|
|
15
|
+
const networkOptions = [
|
|
16
|
+
{ label: 'Testnet', value: 'testnet' },
|
|
17
|
+
{ label: 'Mainnet', value: 'mainnet' },
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Setup screen for configuring credentials
|
|
21
|
+
*/
|
|
22
|
+
export const SetupScreen = ({ config, currentField, error, onUpdateConfig, onSetCurrentField, onInitializeAgent, }) => {
|
|
23
|
+
useInput((_, key) => {
|
|
24
|
+
if (key.tab && !key.shift) {
|
|
25
|
+
const nextField = (currentField + 1) % fieldDescriptors.length;
|
|
26
|
+
onSetCurrentField(nextField);
|
|
27
|
+
}
|
|
28
|
+
else if (key.tab && key.shift) {
|
|
29
|
+
const prevField = currentField === 0 ? fieldDescriptors.length - 1 : currentField - 1;
|
|
30
|
+
onSetCurrentField(prevField);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return (React.createElement(TerminalWindow, { title: "Configuration" },
|
|
34
|
+
React.createElement(Box, { flexDirection: "column" },
|
|
35
|
+
React.createElement(Box, { marginBottom: 1 },
|
|
36
|
+
React.createElement(StatusBadge, { status: "info" }),
|
|
37
|
+
React.createElement(Text, null, "Configure your Hedera account credentials")),
|
|
38
|
+
fieldDescriptors.map(({ key, label, mask }, index) => (React.createElement(Box, { key: key, marginY: 1 },
|
|
39
|
+
React.createElement(Box, { width: 20 },
|
|
40
|
+
React.createElement(Text, { color: currentField === index
|
|
41
|
+
? BRAND_COLORS.blue
|
|
42
|
+
: BRAND_COLORS.hedera.smoke }, label)),
|
|
43
|
+
currentField === index ? (key === 'network' ? (React.createElement(SelectInput, { items: networkOptions, initialIndex: Math.max(0, networkOptions.findIndex(option => option.value === config.network)), onSelect: ({ value }) => {
|
|
44
|
+
onUpdateConfig('network', value);
|
|
45
|
+
if (currentField < fieldDescriptors.length - 1) {
|
|
46
|
+
onSetCurrentField(currentField + 1);
|
|
47
|
+
}
|
|
48
|
+
} })) : (React.createElement(TextInput, { value: config[key], onChange: value => onUpdateConfig(key, value), onSubmit: () => {
|
|
49
|
+
if (currentField < fieldDescriptors.length - 1) {
|
|
50
|
+
onSetCurrentField(currentField + 1);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
onInitializeAgent();
|
|
54
|
+
}
|
|
55
|
+
}, mask: mask ? '*' : undefined }))) : (React.createElement(Text, { color: BRAND_COLORS.hedera.smoke }, key === 'network'
|
|
56
|
+
? config.network
|
|
57
|
+
: config[key]
|
|
58
|
+
? hiddenValue
|
|
59
|
+
: '(not set)'))))),
|
|
60
|
+
error && (React.createElement(Box, { marginTop: 2 },
|
|
61
|
+
React.createElement(StatusBadge, { status: "error" }),
|
|
62
|
+
React.createElement(Text, { color: "red" }, error))),
|
|
63
|
+
React.createElement(Box, { marginTop: 2 },
|
|
64
|
+
React.createElement(Text, { dimColor: true }, "Press Tab to navigate fields, Enter to submit"),
|
|
65
|
+
React.createElement(Text, { dimColor: true }, "Complete all fields and press Enter on the last field to save and start")))));
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=SetupScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SetupScreen.js","sourceRoot":"","sources":["../../src/components/SetupScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAC,MAAM,KAAK,CAAC;AACxC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,YAAY,EAA6C,MAAM,UAAU,CAAC;AAalF,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,gBAAgB,GAIjB;IACH,EAAC,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,EAAC;IACxC,EAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAC;IACtD,EAAC,GAAG,EAAE,SAAS,EAAE,K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ACN,iBAAiB,EAAE,CAAC;wBACtB,CAAC;oBACH,CAAC,EACD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,GAC5B,CACH,CACF,CAAC,CAAC,CAAC,CACF,oBAAC,IAAI,IAAC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,IACnC,GAAG,KAAK,SAAS;oBAChB,CAAC,CAAC,MAAM,CAAC,OAAO;oBAChB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;wBACb,CAAC,CAAC,WAAW;wBACb,CAAC,CAAC,WAAW,CACV,CACR,CACG,CACP,CAAC;YAED,KAAK,IAAI,CACR,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;gBACf,oBAAC,WAAW,IAAC,MAAM,EAAC,OAAO,GAAG;gBAC9B,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,KAAK,CAAQ,CAC5B,CACP;YAED,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;gBACf,oBAAC,IAAI,IAAC,QAAQ,0DAAqD;gBACnE,oBAAC,IAAI,IAAC,QAAQ,oFAEP,CACH,CACF,CACS,CAClB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import { BRAND_COLORS } from '../types.js';
|
|
5
|
+
let globalRenderCount = 0;
|
|
6
|
+
/**
|
|
7
|
+
* Loading screen that tracks its own renders
|
|
8
|
+
*/
|
|
9
|
+
export const SingleLoadingScreen = () => {
|
|
10
|
+
const renderCount = useRef(0);
|
|
11
|
+
const instanceId = useRef(Math.random());
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
renderCount.current++;
|
|
14
|
+
globalRenderCount++;
|
|
15
|
+
console.error(`[LOADING] Instance ${instanceId.current.toFixed(4)} - Render #${renderCount.current} (Global: ${globalRenderCount})`);
|
|
16
|
+
return () => {
|
|
17
|
+
console.error(`[LOADING] Instance ${instanceId.current.toFixed(4)} - Unmounting after ${renderCount.current} renders`);
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
return (React.createElement(Box, { flexDirection: "column", alignItems: "center", paddingY: 4 },
|
|
21
|
+
React.createElement(Box, { marginBottom: 2 },
|
|
22
|
+
React.createElement(Text, { color: BRAND_COLORS.blue }, "Initializing "),
|
|
23
|
+
React.createElement(Text, { color: BRAND_COLORS.purple }, "Hashgraph "),
|
|
24
|
+
React.createElement(Text, { color: BRAND_COLORS.green }, "Online "),
|
|
25
|
+
React.createElement(Text, { color: BRAND_COLORS.blue }, "Agent...")),
|
|
26
|
+
React.createElement(Spinner, { type: "dots" })));
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBadge.d.ts","sourceRoot":"","sources":["../../src/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAgBvD;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,CAMlD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { BRAND_COLORS } from '../types';
|
|
4
|
+
const STATUS_COLORS = {
|
|
5
|
+
success: BRAND_COLORS.green,
|
|
6
|
+
info: BRAND_COLORS.blue,
|
|
7
|
+
warning: '#FFBD2E',
|
|
8
|
+
error: '#FF5F57',
|
|
9
|
+
};
|
|
10
|
+
const STATUS_LABELS = {
|
|
11
|
+
success: 'SUCCESS',
|
|
12
|
+
info: 'INFO',
|
|
13
|
+
warning: 'WARNING',
|
|
14
|
+
error: 'ERROR',
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Status badge component
|
|
18
|
+
*/
|
|
19
|
+
export const StatusBadge = ({ status }) => (React.createElement(Box, { marginRight: 1 },
|
|
20
|
+
React.createElement(Text, { color: STATUS_COLORS[status], bold: true },
|
|
21
|
+
"[",
|
|
22
|
+
STATUS_LABELS[status],
|
|
23
|
+
"]")));
|
|
24
|
+
//# sourceMappingURL=StatusBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","sourceRoot":"","sources":["../../src/components/StatusBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAItC,MAAM,aAAa,GAA2B;IAC7C,OAAO,EAAE,YAAY,CAAC,KAAK;IAC3B,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;CAChB,CAAC;AAEF,MAAM,aAAa,GAA2B;IAC7C,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,CACpE,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;IAClB,oBAAC,IAAI,IAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI;;QACrC,aAAa,CAAC,MAAM,CAAC;YACjB,CACF,CACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalWindow.d.ts","sourceRoot":"","sources":["../../src/components/TerminalWindow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,CA8B/E,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { BRAND_COLORS } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Terminal window decoration component
|
|
6
|
+
*/
|
|
7
|
+
export const TerminalWindow = ({ title, children, }) => {
|
|
8
|
+
return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: BRAND_COLORS.blue },
|
|
9
|
+
React.createElement(Box, { paddingX: 1, borderStyle: "single", borderBottom: true, borderColor: BRAND_COLORS.dark },
|
|
10
|
+
React.createElement(Box, { marginRight: 1 },
|
|
11
|
+
React.createElement(Text, { color: "red" }, "\u25CF"),
|
|
12
|
+
React.createElement(Text, null, " "),
|
|
13
|
+
React.createElement(Text, { color: "yellow" }, "\u25CF"),
|
|
14
|
+
React.createElement(Text, null, " "),
|
|
15
|
+
React.createElement(Text, { color: "green" }, "\u25CF")),
|
|
16
|
+
React.createElement(Text, { color: BRAND_COLORS.hedera.smoke }, title)),
|
|
17
|
+
React.createElement(Box, { paddingX: 2, paddingY: 1, flexDirection: "column" }, children)));
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=TerminalWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalWindow.js","sourceRoot":"","sources":["../../src/components/TerminalWindow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAyD,CAAC,EACpF,KAAK,EACL,QAAQ,GACR,EAAE,EAAE;IACJ,OAAO,CACN,oBAAC,GAAG,IACH,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,YAAY,CAAC,IAAI;QAE9B,oBAAC,GAAG,IACH,QAAQ,EAAE,CAAC,EACX,WAAW,EAAC,QAAQ,EACpB,YAAY,QACZ,WAAW,EAAE,YAAY,CAAC,IAAI;YAE9B,oBAAC,GAAG,IAAC,WAAW,EAAE,CAAC;gBAClB,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,aAAS;gBAC1B,oBAAC,IAAI,YAAS;gBACd,oBAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,aAAS;gBAC7B,oBAAC,IAAI,YAAS;gBACd,oBAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAAS,CACvB;YACN,oBAAC,IAAI,IAAC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,IAAG,KAAK,CAAQ,CACjD;QACN,oBAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,aAAa,EAAC,QAAQ,IACnD,QAAQ,CACJ,CACD,CACN,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Config, type Screen } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Welcome screen component
|
|
5
|
+
*/
|
|
6
|
+
export declare const WelcomeScreen: React.FC<{
|
|
7
|
+
config: Config;
|
|
8
|
+
onExit: () => void;
|
|
9
|
+
onInitializeAgent: () => void;
|
|
10
|
+
onSetScreen: (screen: Screen) => void;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=WelcomeScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeScreen.d.ts","sourceRoot":"","sources":["../../src/components/WelcomeScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAe,KAAK,MAAM,EAAE,KAAK,MAAM,EAAkB,MAAM,UAAU,CAAC;AAWjF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC,CAmDA,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import SelectInput from 'ink-select-input';
|
|
4
|
+
import Gradient from 'ink-gradient';
|
|
5
|
+
import { BRAND_COLORS } from '../types';
|
|
6
|
+
const menuItems = [
|
|
7
|
+
{ label: 'Start Chat', value: 'chat' },
|
|
8
|
+
{ label: 'Configure', value: 'setup' },
|
|
9
|
+
{ label: 'MCP Servers', value: 'mcp-config' },
|
|
10
|
+
{ label: 'Exit', value: 'exit' },
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* Welcome screen component
|
|
14
|
+
*/
|
|
15
|
+
export const WelcomeScreen = ({ config, onExit, onInitializeAgent, onSetScreen }) => (React.createElement(Box, { flexDirection: "column", alignItems: "center", paddingY: 2 },
|
|
16
|
+
React.createElement(Box, { flexDirection: "column", alignItems: "center", marginBottom: 2 },
|
|
17
|
+
React.createElement(Box, null,
|
|
18
|
+
React.createElement(Gradient, { name: "atlas" },
|
|
19
|
+
React.createElement(Text, { bold: true }, "\u2566 \u2566\u2554\u2550\u2557\u2554\u2550\u2557\u2566 \u2566\u2554\u2550\u2557\u2566\u2550\u2557\u2554\u2550\u2557\u2554\u2550\u2557\u2566 \u2566 \u2554\u2550\u2557\u2554\u2557\u2554\u2566 \u2566\u2554\u2557\u2554\u2554\u2550\u2557"))),
|
|
20
|
+
React.createElement(Box, null,
|
|
21
|
+
React.createElement(Gradient, { name: "atlas" },
|
|
22
|
+
React.createElement(Text, { bold: true }, "\u2560\u2550\u2563\u2560\u2550\u2563\u255A\u2550\u2557\u2560\u2550\u2563\u2551 \u2566\u2560\u2566\u255D\u2560\u2550\u2563\u2560\u2550\u255D\u2560\u2550\u2563 \u2551 \u2551\u2551\u2551\u2551\u2551 \u2551\u2551\u2551\u2551\u2551\u2563 "))),
|
|
23
|
+
React.createElement(Box, null,
|
|
24
|
+
React.createElement(Gradient, { name: "atlas" },
|
|
25
|
+
React.createElement(Text, { bold: true }, "\u2569 \u2569\u2569 \u2569\u255A\u2550\u255D\u2569 \u2569\u255A\u2550\u255D\u2569\u255A\u2550\u2569 \u2569\u2569 \u2569 \u2569 \u255A\u2550\u255D\u255D\u255A\u255D\u2569\u2550\u255D\u2569\u255D\u255A\u255D\u255A\u2550\u255D"))),
|
|
26
|
+
React.createElement(Text, { color: BRAND_COLORS.hedera.smoke }, "Conversational Agent CLI"),
|
|
27
|
+
React.createElement(Text, { color: BRAND_COLORS.hedera.smoke, dimColor: true }, "Powered by Hashgraph Online")),
|
|
28
|
+
React.createElement(Box, { marginY: 2 },
|
|
29
|
+
React.createElement(SelectInput, { items: menuItems, onSelect: ({ value }) => {
|
|
30
|
+
if (value === 'exit') {
|
|
31
|
+
onExit();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (value === 'chat') {
|
|
35
|
+
if (config.accountId && config.privateKey && config.openAIApiKey) {
|
|
36
|
+
onInitializeAgent();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
onSetScreen('setup');
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
onSetScreen(value);
|
|
44
|
+
} })),
|
|
45
|
+
React.createElement(Box, { marginTop: 2 },
|
|
46
|
+
React.createElement(Text, { dimColor: true }, "Press \u2191/\u2193 to navigate, Enter to select"))));
|
|
47
|
+
//# sour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IAAC,IAAI,EAAC,OAAO;gBACrB,oBAAC,IAAI,IAAC,IAAI,4OAAmD,CACnD,CACN;QACN,oBAAC,IAAI,IAAC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,+BAAiC;QACvE,oBAAC,IAAI,IAAC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,wCAEzC,CACF;IAEN,oBAAC,GAAG,IAAC,OAAO,EAAE,CAAC;QACd,oBAAC,WAAW,IACX,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,CAAC,EAAC,KAAK,EAAC,EAAE,EAAE;gBACrB,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;oBACtB,MAAM,EAAE,CAAC;oBACT,OAAO;gBACR,CAAC;gBAED,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;oBACtB,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;wBAClE,iBAAiB,EAAE,CAAC;oBACrB,CAAC;yBAAM,CAAC;wBACP,WAAW,CAAC,OAAO,CAAC,CAAC;oBACtB,CAAC;oBACD,OAAO;gBACR,CAAC;gBAED,WAAW,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC,GACA,CACG;IAEN,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;QAChB,oBAAC,IAAI,IAAC,QAAQ,6DAA8C,CACvD,CACD,CACN,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConversationalAgent, type MCPServerConfig } from '@hashgraphonline/conversational-agent';
|
|
3
|
+
import { type Screen, type Message, type Config } from '../types.js';
|
|
4
|
+
interface AppState {
|
|
5
|
+
screen: Screen;
|
|
6
|
+
agent: ConversationalAgent | null;
|
|
7
|
+
messages: Message[];
|
|
8
|
+
input: string;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
config: Config & {
|
|
12
|
+
mcpServers: MCPServerConfig[];
|
|
13
|
+
};
|
|
14
|
+
mcpConfig: {
|
|
15
|
+
enableFilesystem: boolean;
|
|
16
|
+
filesystemPath: string;
|
|
17
|
+
customServers: MCPServerConfig[];
|
|
18
|
+
addingCustom: boolean;
|
|
19
|
+
newServerName: string;
|
|
20
|
+
newServerCommand: string;
|
|
21
|
+
newServerArgs: string;
|
|
22
|
+
newServerEnv: string;
|
|
23
|
+
currentField: number;
|
|
24
|
+
};
|
|
25
|
+
editingFilesystemPath: boolean;
|
|
26
|
+
currentField: number;
|
|
27
|
+
logs: string[];
|
|
28
|
+
}
|
|
29
|
+
interface AppContextType {
|
|
30
|
+
state: AppState;
|
|
31
|
+
actions: {
|
|
32
|
+
setScreen: (screen: Screen) => void;
|
|
33
|
+
setAgent: (agent: ConversationalAgent | null) => void;
|
|
34
|
+
setMessages: (messages: Message[]) => void;
|
|
35
|
+
addMessages: (messages: Message[]) => void;
|
|
36
|
+
setInput: (input: string) => void;
|
|
37
|
+
setLoading: (loading: boolean) => void;
|
|
38
|
+
setError: (error: string | null) => void;
|
|
39
|
+
setConfig: (config: Config & {
|
|
40
|
+
mcpServers: MCPServerConfig[];
|
|
41
|
+
}) => void;
|
|
42
|
+
updateConfigField: (field: keyof Config, value: string) => void;
|
|
43
|
+
setMcpConfig: (config: Partial<AppState['mcpConfig']>) => void;
|
|
44
|
+
setEditingFilesystemPath: (editing: boolean) => void;
|
|
45
|
+
setCurrentField: (field: number) => void;
|
|
46
|
+
setLogs: (logs: string[]) => void;
|
|
47
|
+
initializeAgent: () => Promise<void>;
|
|
48
|
+
sendMessage: (message: string) => Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get MCP config file path
|
|
53
|
+
*/
|
|
54
|
+
declare const getMCPConfigPath: () => string;
|
|
55
|
+
/**
|
|
56
|
+
* Save MCP configuration to file
|
|
57
|
+
*/
|
|
58
|
+
declare const saveMCPConfig: (servers: MCPServerConfig[]) => void;
|
|
59
|
+
interface AppProviderProps {
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
accountId?: string;
|
|
62
|
+
privateKey?: string;
|
|
63
|
+
network?: 'testnet' | 'mainnet';
|
|
64
|
+
openAIApiKey?: string;
|
|
65
|
+
}
|
|
66
|
+
export declare const AppProvider: React.FC<AppProviderProps>;
|
|
67
|
+
export declare const useAppContext: () => AppContextType;
|
|
68
|
+
export { saveMCPConfig, getMCPConfigPath };
|