@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,69 @@
|
|
|
1
|
+
import { useReducer, useCallback, useMemo } from 'react';
|
|
2
|
+
const appReducer = (state, action) => {
|
|
3
|
+
switch (action.type) {
|
|
4
|
+
case 'SET_SCREEN':
|
|
5
|
+
return { ...state, screen: action.payload };
|
|
6
|
+
case 'SET_MESSAGES':
|
|
7
|
+
return { ...state, messages: action.payload };
|
|
8
|
+
case 'ADD_MESSAGES':
|
|
9
|
+
return { ...state, messages: [...state.messages, ...action.payload] };
|
|
10
|
+
case 'SET_INPUT':
|
|
11
|
+
return { ...state, input: action.payload };
|
|
12
|
+
case 'SET_LOADING':
|
|
13
|
+
return { ...state, isLoading: action.payload };
|
|
14
|
+
case 'SET_ERROR':
|
|
15
|
+
return { ...state, error: action.payload };
|
|
16
|
+
case 'SET_MCP_CONFIG':
|
|
17
|
+
return { ...state, mcpConfig: { ...state.mcpConfig, ...action.payload } };
|
|
18
|
+
case 'SET_EDITING_FILESYSTEM_PATH':
|
|
19
|
+
return { ...state, editingFilesystemPath: action.payload };
|
|
20
|
+
case 'SET_CURRENT_FIELD':
|
|
21
|
+
return { ...state, currentField: action.payload };
|
|
22
|
+
case 'SET_LOGS':
|
|
23
|
+
return { ...state, logs: action.payload };
|
|
24
|
+
default:
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export const useStableState = (initialMcpServers) => {
|
|
29
|
+
const getInitialState = useCallback(() => {
|
|
30
|
+
const filesystemServer = initialMcpServers.find(s => s.name === 'filesystem');
|
|
31
|
+
const customServers = initialMcpServers.filter(s => s.name !== 'filesystem');
|
|
32
|
+
return {
|
|
33
|
+
screen: 'welcome',
|
|
34
|
+
messages: [],
|
|
35
|
+
input: '',
|
|
36
|
+
isLoading: false,
|
|
37
|
+
error: null,
|
|
38
|
+
mcpConfig: {
|
|
39
|
+
enableFilesystem: !!filesystemServer,
|
|
40
|
+
filesystemPath: filesystemServer ? filesystemServer.args[2] || process.cwd() : process.cwd(),
|
|
41
|
+
customServers,
|
|
42
|
+
addingCustom: false,
|
|
43
|
+
newServerName: '',
|
|
44
|
+
newServerCommand: '',
|
|
45
|
+
newServerArgs: '',
|
|
46
|
+
newServerEnv: '',
|
|
47
|
+
currentField: 0,
|
|
48
|
+
},
|
|
49
|
+
editingFilesystemPath: false,
|
|
50
|
+
currentField: 0,
|
|
51
|
+
logs: [],
|
|
52
|
+
};
|
|
53
|
+
}, [initialMcpServers]);
|
|
54
|
+
const [state, dispatch] = useReducer(appReducer, null, getInitialState);
|
|
55
|
+
const actions = useMemo(() => ({
|
|
56
|
+
setScreen: (screen) => dispatch({ type: 'SET_SCREEN', payload: screen }),
|
|
57
|
+
setMessages: (messages) => dispatch({ type: 'SET_MESSAGES', payload: messages }),
|
|
58
|
+
addMessages: (messages) => dispatch({ type: 'ADD_MESSAGES', payload: messages }),
|
|
59
|
+
setInput: (input) => dispatch({ type: 'SET_INPUT', payload: input }),
|
|
60
|
+
setLoading: (loading) => dispatch({ type: 'SET_LOADING', payload: loading }),
|
|
61
|
+
setError: (error) => dispatch({ type: 'SET_ERROR', payload: error }),
|
|
62
|
+
setMcpConfig: (config) => dispatch({ type: 'SET_MCP_CONFIG', payload: config }),
|
|
63
|
+
setEditingFilesystemPath: (editing) => dispatch({ type: 'SET_EDITING_FILESYSTEM_PATH', payload: editing }),
|
|
64
|
+
setCurrentField: (field) => dispatch({ type: 'SET_CURRENT_FIELD', payload: field }),
|
|
65
|
+
setLogs: (logs) => dispatch({ type: 'SET_LOGS', payload: logs }),
|
|
66
|
+
}), [dispatch]);
|
|
67
|
+
return { state, actions };
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=useStableState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStableState.js","sourceRoot":"","sources":["../../src/hooks/useStableState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,WAAW,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAqCvD,MAAM,UAAU,GAAG,CAAC,KAAe,EAAE,MAAiB,EAAY,EAAE;IAClE,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,YAAY;YACf,OAAO,EAAC,GAAG,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,EAAC,CAAC;QAC5C,KAAK,cAAc;YACjB,OAAO,EAAC,GAAG,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAC,CAAC;QAC9C,KAAK,cAAc;YACjB,OAAO,EAAC,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,EAAC,CAAC;QACtE,KAAK,WAAW;YACd,OAAO,EAAC,GAAG,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAC,CAAC;QAC3C,KAAK,aAAa;YAChB,O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Q,EAAE,CAAC,KAAoB,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;QACjF,YAAY,EAAE,CAAC,MAAsC,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC;QAC7G,wBAAwB,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,6BAA6B,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC;QACjH,eAAe,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,KAAK,EAAC,CAAC;QACzF,OAAO,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;KACzE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ConversationalAgent } from '@hashgraphonline/conversational-agent';
|
|
2
|
+
import { type MCPServerConfig, type Config, type Message } from '../types';
|
|
3
|
+
export declare class AgentManager {
|
|
4
|
+
private static instance;
|
|
5
|
+
private agent;
|
|
6
|
+
private initializing;
|
|
7
|
+
private initialized;
|
|
8
|
+
private constructor();
|
|
9
|
+
static getInstance(): AgentManager;
|
|
10
|
+
/**
|
|
11
|
+
* Initialize the conversational agent
|
|
12
|
+
*/
|
|
13
|
+
initialize(config: Config & {
|
|
14
|
+
mcpServers: MCPServerConfig[];
|
|
15
|
+
}, mcpConfig: {
|
|
16
|
+
enableFilesystem: boolean;
|
|
17
|
+
filesystemPath: string;
|
|
18
|
+
customServers: MCPServerConfig[];
|
|
19
|
+
}): Promise<{
|
|
20
|
+
agent: ConversationalAgent;
|
|
21
|
+
welcomeMessages: Message[];
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Get welcome messages
|
|
25
|
+
*/
|
|
26
|
+
private getWelcomeMessages;
|
|
27
|
+
/**
|
|
28
|
+
* Send message to agent
|
|
29
|
+
*/
|
|
30
|
+
sendMessage(message: string, chatHistory: Array<{
|
|
31
|
+
type: 'human' | 'ai';
|
|
32
|
+
content: string;
|
|
33
|
+
}>): Promise<{
|
|
34
|
+
message?: string;
|
|
35
|
+
output?: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
transactionId?: string;
|
|
38
|
+
scheduleId?: string;
|
|
39
|
+
notes?: string[];
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Get current agent
|
|
43
|
+
*/
|
|
44
|
+
getAgent(): ConversationalAgent | null;
|
|
45
|
+
/**
|
|
46
|
+
* Check if agent is initialized
|
|
47
|
+
*/
|
|
48
|
+
isInitialized(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Check if agent is initializing
|
|
51
|
+
*/
|
|
52
|
+
isInitializing(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Reset agent (for testing)
|
|
55
|
+
*/
|
|
56
|
+
reset(): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=AgentManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentManager.d.ts","sourceRoot":"","sources":["../../src/managers/AgentManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EAEnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAa,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAC,MAAM,UAAU,CAAC;AAErF,qBAAa,YAAY;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IACtC,OAAO,CAAC,KAAK,CAAoC;IACjD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAS;IAE5B,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,YAAY;IAOlC;;OAEG;IACG,UAAU,CACf,MAAM,EAAE,MAAM,GAAG;QAAC,UAAU,EAAE,eAAe,EAAE,CAAA;KAAC,EAChD,SAAS,EAAE;QACV,gBAAgB,EAAE,OAAO,CAAC;QAC1B,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,eAAe,EAAE,CAAC;KACjC,GACC,OAAO,CAAC;QAAC,KAAK,EAAE,mBAAmB,CAAC;QAAC,eAAe,EAAE,OAAO,EAAE,CAAA;KAAC,CAAC;IAgDpE;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAkC1B;;OAEG;IACG,WAAW,CAChB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,GACzD,OAAO,CAAC;QACV,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IAQF;;OAEG;IACH,QAAQ,IAAI,mBAAmB,GAAG,IAAI;IAItC;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,cAAc,IAAI,OAAO;IAIzB;;OAEG;IACH,KAAK,IAAI,IAAI;CAKb"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ConversationalAgent, } from '@hashgraphonline/conversational-agent';
|
|
2
|
+
import { MCPServers } from '../types';
|
|
3
|
+
export class AgentManager {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.agent = null;
|
|
6
|
+
this.initializing = false;
|
|
7
|
+
this.initialized = false;
|
|
8
|
+
}
|
|
9
|
+
static getInstance() {
|
|
10
|
+
if (!AgentManager.instance) {
|
|
11
|
+
AgentManager.instance = new AgentManager();
|
|
12
|
+
}
|
|
13
|
+
return AgentManager.instance;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the conversational agent
|
|
17
|
+
*/
|
|
18
|
+
async initialize(config, mcpConfig) {
|
|
19
|
+
if (this.agent && this.initialized) {
|
|
20
|
+
return {
|
|
21
|
+
agent: this.agent,
|
|
22
|
+
welcomeMessages: this.getWelcomeMessages(config, []),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (this.initializing) {
|
|
26
|
+
throw new Error('Agent is already initializing');
|
|
27
|
+
}
|
|
28
|
+
this.initializing = true;
|
|
29
|
+
try {
|
|
30
|
+
const mcpServers = [];
|
|
31
|
+
if (mcpConfig.enableFilesystem && mcpConfig.filesystemPath) {
|
|
32
|
+
mcpServers.push(MCPServers.filesystem(mcpConfig.filesystemPath));
|
|
33
|
+
}
|
|
34
|
+
mcpServers.push(...mcpConfig.customServers);
|
|
35
|
+
const agentConfig = {
|
|
36
|
+
accountId: config.accountId,
|
|
37
|
+
privateKey: config.privateKey,
|
|
38
|
+
network: config.network,
|
|
39
|
+
openAIApiKey: config.openAIApiKey,
|
|
40
|
+
openAIModelName: 'gpt-4o-mini',
|
|
41
|
+
verbose: false,
|
|
42
|
+
disableLogging: true,
|
|
43
|
+
...(mcpServers.length > 0 && { mcpServers }),
|
|
44
|
+
};
|
|
45
|
+
const conversationalAgent = new ConversationalAgent(agentConfig);
|
|
46
|
+
await conversationalAgent.initialize();
|
|
47
|
+
this.agent = conversationalAgent;
|
|
48
|
+
this.initialized = true;
|
|
49
|
+
const welcomeMessages = this.getWelcomeMessages(config, mcpServers);
|
|
50
|
+
return { agent: conversationalAgent, welcomeMessages };
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
this.initializing = false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get welcome messages
|
|
58
|
+
*/
|
|
59
|
+
getWelcomeMessages(config, mcpServers) {
|
|
60
|
+
const welcomeMessages = [
|
|
61
|
+
{
|
|
62
|
+
role: 'system',
|
|
63
|
+
content: `Connected to Hedera ${config.network}`,
|
|
64
|
+
timestamp: new Date(),
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
if (mcpServers.length > 0) {
|
|
68
|
+
welcomeMessages.push({
|
|
69
|
+
role: 'system',
|
|
70
|
+
content: `MCP servers enabled: ${mcpServers
|
|
71
|
+
.map(s => s.name)
|
|
72
|
+
.join(', ')}`,
|
|
73
|
+
timestamp: new Date(),
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
welcomeMessages.push({
|
|
77
|
+
role: 'assistant',
|
|
78
|
+
content: mcpServers.length > 0
|
|
79
|
+
? "Hello! I'm your Conversational Agent powered by Hashgraph Online, with extended MCP capabilities. I can help you with:\n\n• HCS-10 agent registrations and HCS-11 profiles\n• Sending messages through HCS standards\n• Creating accounts, transferring HBAR, and managing tokens\n• Deploying smart contracts and interacting with them\n• Managing NFTs, token swaps, and staking operations\n• Scheduling transactions and consensus submissions\n• File operations and external tool integration\n\nHow can I assist you today?"
|
|
80
|
+
: "Hello! I'm your Conversational Agent powered by Hashgraph Online. I can help you with:\n\n• HCS-10 agent registrations and HCS-11 profiles\n• Sending messages through HCS standards\n• Creating accounts, transferring HBAR, and managing tokens\n• Deploying smart contracts and interacting with them\n• Managing NFTs, token swaps, and staking operations\n• Scheduling transactions and consensus submissions\n\nHow can I assist you today?",
|
|
81
|
+
timestamp: new Date(),
|
|
82
|
+
});
|
|
83
|
+
return welcomeMessages;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Send message to agent
|
|
87
|
+
*/
|
|
88
|
+
async sendMessage(message, chatHistory) {
|
|
89
|
+
if (!this.agent) {
|
|
90
|
+
throw new Error('Agent not initialized');
|
|
91
|
+
}
|
|
92
|
+
return this.agent.processMessage(message, chatHistory);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get current agent
|
|
96
|
+
*/
|
|
97
|
+
getAgent() {
|
|
98
|
+
return this.agent;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if agent is initialized
|
|
102
|
+
*/
|
|
103
|
+
isInitialized() {
|
|
104
|
+
return this.initialized;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Check if agent is initializing
|
|
108
|
+
*/
|
|
109
|
+
isInitializing() {
|
|
110
|
+
return this.initializing;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Reset agent (for testing)
|
|
114
|
+
*/
|
|
115
|
+
reset() {
|
|
116
|
+
this.agent = null;
|
|
117
|
+
this.initialized = false;
|
|
118
|
+
this.initializing = false;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=AgentManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentManager.js","sourceRoot":"","sources":["../../src/managers/AgentManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,GAEnB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAkD,MAAM,UAAU,CAAC;AAErF,MAAM,OAAO,YAAY;IAMxB;QAJQ,UAAK,GAA+B,IAAI,CAAC;QACzC,iBAAY,GAAG,KAAK,CAAC;QACrB,gBAAW,GAAG,KAAK,CAAC;IAEL,CAAC;IAExB,MAAM,CAAC,WAAW;QACjB,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC5B,YAAY,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC5C,CAAC;QACD,OAAO,YAAY,CAAC,QAAQ,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,UAAU,CACf,MAAgD,EAChD,SAIC;QAED,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,C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KAAK,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,aAAa;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,cAAc;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,KAAK;QACJ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC3B,CAAC;CACD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type MCPServerConfig, type Config } from '../types';
|
|
2
|
+
export declare class ConfigManager {
|
|
3
|
+
private static instance;
|
|
4
|
+
private _config;
|
|
5
|
+
private _mcpServers;
|
|
6
|
+
private logger;
|
|
7
|
+
private constructor();
|
|
8
|
+
static getInstance(): ConfigManager;
|
|
9
|
+
/**
|
|
10
|
+
* Get MCP config file path
|
|
11
|
+
*/
|
|
12
|
+
private getMCPConfigPath;
|
|
13
|
+
/**
|
|
14
|
+
* Load MCP configuration from file
|
|
15
|
+
*/
|
|
16
|
+
private loadMCPConfig;
|
|
17
|
+
/**
|
|
18
|
+
* Save MCP configuration to file
|
|
19
|
+
*/
|
|
20
|
+
saveMCPConfig(servers: MCPServerConfig[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Load config from .env file
|
|
23
|
+
*/
|
|
24
|
+
private loadConfigFromEnv;
|
|
25
|
+
/**
|
|
26
|
+
* Save config to .env file
|
|
27
|
+
*/
|
|
28
|
+
saveConfig(configToSave: Config): void;
|
|
29
|
+
/**
|
|
30
|
+
* Get complete config (cached)
|
|
31
|
+
*/
|
|
32
|
+
getConfig(props?: Partial<Config>): Config & {
|
|
33
|
+
mcpServers: MCPServerConfig[];
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Update config and save
|
|
37
|
+
*/
|
|
38
|
+
updateConfig(updates: Partial<Config>): Config & {
|
|
39
|
+
mcpServers: MCPServerConfig[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Get MCP servers
|
|
43
|
+
*/
|
|
44
|
+
getMCPServers(): MCPServerConfig[];
|
|
45
|
+
/**
|
|
46
|
+
* Get MCP config path for display
|
|
47
|
+
*/
|
|
48
|
+
getMCPConfigPathForDisplay(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Reset cache (for testing)
|
|
51
|
+
*/
|
|
52
|
+
resetCache(): void;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ConfigManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigManager.d.ts","sourceRoot":"","sources":["../../src/managers/ConfigManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,KAAK,eAAe,EAAE,KAAK,MAAM,EAAe,MAAM,UAAU,CAAC;AAErF,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAgB;IACvC,OAAO,CAAC,OAAO,CAAyD;IACxE,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,MAAM,CAA0C;IAExD,OAAO;IAQP,MAAM,CAAC,WAAW,IAAI,aAAa;IAOnC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;OAEG;IACH,OAAO,CAAC,aAAa;IAwBrB;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI;IAoB/C;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAuCzB;;OAEG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IA6BtC;;OAEG;IACH,SAAS,CAAC,KAAK,GAAE,OAAO,CAAC,MAAM,CAAM,GAAG,MAAM,GAAG;QAAC,UAAU,EAAE,eAAe,EAAE,CAAA;KAAC;IAgBhF;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG;QAAC,UAAU,EAAE,eAAe,EAAE,CAAA;KAAC;IAQhF;;OAEG;IACH,aAAa,IAAI,eAAe,EAAE;IAIlC;;OAEG;IACH,0BAA0B,IAAI,MAAM;IAIpC;;OAEG;IACH,UAAU,IAAI,IAAI;CAInB"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { MCPServers } from '../types';
|
|
4
|
+
export class ConfigManager {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._config = null;
|
|
7
|
+
this._mcpServers = null;
|
|
8
|
+
this.logger = {
|
|
9
|
+
error: (...args) => {
|
|
10
|
+
console.error('[ConfigManager]', ...args);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static getInstance() {
|
|
15
|
+
if (!ConfigManager.instance) {
|
|
16
|
+
ConfigManager.instance = new ConfigManager();
|
|
17
|
+
}
|
|
18
|
+
return ConfigManager.instance;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get MCP config file path
|
|
22
|
+
*/
|
|
23
|
+
getMCPConfigPath() {
|
|
24
|
+
const projectRoot = process.env['CONVERSATIONAL_AGENT_ROOT'] || path.resolve('./../../');
|
|
25
|
+
return path.join(projectRoot, 'mcp-config.json');
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Load MCP configuration from file
|
|
29
|
+
*/
|
|
30
|
+
loadMCPConfig() {
|
|
31
|
+
if (this._mcpServers)
|
|
32
|
+
return this._mcpServers;
|
|
33
|
+
const configPath = this.getMCPConfigPath();
|
|
34
|
+
try {
|
|
35
|
+
if (fs.existsSync(configPath)) {
|
|
36
|
+
const configContent = fs.readFileSync(configPath, 'utf-8');
|
|
37
|
+
const config = JSON.parse(configContent);
|
|
38
|
+
this._mcpServers = Object.values(config.mcpServers || {});
|
|
39
|
+
return this._mcpServers;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
this.logger.error('Failed to load MCP config', {
|
|
44
|
+
configPath,
|
|
45
|
+
error: err instanceof Error ? err.message : String(err)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const defaultServers = [MCPServers.filesystem(process.cwd())];
|
|
49
|
+
this.saveMCPConfig(defaultServers);
|
|
50
|
+
this._mcpServers = defaultServers;
|
|
51
|
+
return defaultServers;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Save MCP configuration to file
|
|
55
|
+
*/
|
|
56
|
+
saveMCPConfig(servers) {
|
|
57
|
+
const configPath = this.getMCPConfigPath();
|
|
58
|
+
try {
|
|
59
|
+
const mcpServers = {};
|
|
60
|
+
servers.forEach(server => {
|
|
61
|
+
mcpServers[server.name] = server;
|
|
62
|
+
});
|
|
63
|
+
const config = { mcpServers };
|
|
64
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
65
|
+
this._mcpServers = servers;
|
|
66
|
+
}
|
|
67
|
+
catch (err) {
|
|
68
|
+
this.logger.error('Failed to save MCP config', {
|
|
69
|
+
configPath,
|
|
70
|
+
serversCount: servers.length,
|
|
71
|
+
error: err instanceof Error ? err.message : String(err)
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Load config from .env file
|
|
77
|
+
*/
|
|
78
|
+
loadConfigFromEnv() {
|
|
79
|
+
const projectRoot = process.env['CONVERSATIONAL_AGENT_ROOT'] || path.resolve('./../../');
|
|
80
|
+
const envPath = path.join(projectRoot, '.env');
|
|
81
|
+
try {
|
|
82
|
+
if (fs.existsSync(envPath)) {
|
|
83
|
+
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
84
|
+
const envVars = {};
|
|
85
|
+
envContent.split('\n').forEach(line => {
|
|
86
|
+
const trimmedLine = line.trim();
|
|
87
|
+
if (trimmedLine && !trimmedLine.startsWith('#')) {
|
|
88
|
+
const [key, ...valueParts] = trimmedLine.split('=');
|
|
89
|
+
if (key && valueParts.length > 0) {
|
|
90
|
+
envVars[key] = valueParts.join('=');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const networkEnv = envVars['HEDERA_NETWORK'];
|
|
95
|
+
const network = networkEnv === 'mainnet' ? 'mainnet' : 'testnet';
|
|
96
|
+
return {
|
|
97
|
+
accountId: envVars['HEDERA_ACCOUNT_ID'] || '',
|
|
98
|
+
privateKey: envVars['HEDERA_PRIVATE_KEY'] || '',
|
|
99
|
+
network,
|
|
100
|
+
openAIApiKey: envVars['OPENAI_API_KEY'] || '',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch (err) { }
|
|
105
|
+
return {
|
|
106
|
+
accountId: '',
|
|
107
|
+
privateKey: '',
|
|
108
|
+
network: 'testnet',
|
|
109
|
+
openAIApiKey: '',
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Save config to .env file
|
|
114
|
+
*/
|
|
115
|
+
saveConfig(configToSave) {
|
|
116
|
+
const projectRoot = process.env['CONVERSATIONAL_AGENT_ROOT'] || path.resolve('./../../');
|
|
117
|
+
const envPath = path.join(projectRoot, '.env');
|
|
118
|
+
try {
|
|
119
|
+
let envContent = '';
|
|
120
|
+
if (fs.existsSync(envPath)) {
|
|
121
|
+
envContent = fs.readFileSync(envPath, 'utf-8');
|
|
122
|
+
}
|
|
123
|
+
const updateEnvVar = (key, value) => {
|
|
124
|
+
const regex = new RegExp(`^${key}=.*$`, 'gm');
|
|
125
|
+
if (regex.test(envContent)) {
|
|
126
|
+
envContent = envContent.replace(regex, `${key}=${value}`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
envContent += `${envContent ? '\n' : ''}${key}=${value}`;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
updateEnvVar('HEDERA_ACCOUNT_ID', configToSave.accountId);
|
|
133
|
+
updateEnvVar('HEDERA_PRIVATE_KEY', configToSave.privateKey);
|
|
134
|
+
updateEnvVar('HEDERA_NETWORK', configToSave.network);
|
|
135
|
+
updateEnvVar('OPENAI_API_KEY', configToSave.openAIApiKey);
|
|
136
|
+
fs.writeFileSync(envPath, envContent);
|
|
137
|
+
this._config = null;
|
|
138
|
+
}
|
|
139
|
+
catch (err) { }
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Get complete config (cached)
|
|
143
|
+
*/
|
|
144
|
+
getConfig(props = {}) {
|
|
145
|
+
if (!this._config) {
|
|
146
|
+
const envConfig = this.loadConfigFromEnv();
|
|
147
|
+
const mcpServers = this.loadMCPConfig();
|
|
148
|
+
this._config = {
|
|
149
|
+
accountId: props.accountId || envConfig.accountId,
|
|
150
|
+
privateKey: props.privateKey || envConfig.privateKey,
|
|
151
|
+
network: props.network || envConfig.network,
|
|
152
|
+
openAIApiKey: props.openAIApiKey || envConfig.openAIApiKey,
|
|
153
|
+
mcpServers,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return this._config;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Update config and save
|
|
160
|
+
*/
|
|
161
|
+
updateConfig(updates) {
|
|
162
|
+
const current = this.getConfig();
|
|
163
|
+
const updated = { ...current, ...updates };
|
|
164
|
+
this.saveConfig(updated);
|
|
165
|
+
this._config = updated;
|
|
166
|
+
return updated;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get MCP servers
|
|
170
|
+
*/
|
|
171
|
+
getMCPServers() {
|
|
172
|
+
return this.loadMCPConfig();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get MCP config path for display
|
|
176
|
+
*/
|
|
177
|
+
getMCPConfigPathForDisplay() {
|
|
178
|
+
return this.getMCPConfigPath();
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Reset cache (for testing)
|
|
182
|
+
*/
|
|
183
|
+
resetCache() {
|
|
184
|
+
this._config = null;
|
|
185
|
+
this._mcpServers = null;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=ConfigManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigManager.js","sourceRoot":"","sources":["../../src/managers/ConfigManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,UAAU,EAAkD,MAAM,UAAU,CAAC;AAErF,MAAM,OAAO,aAAa;IAMxB;QAJQ,YAAO,GAAoD,IAAI,CAAC;QAChE,gBAAW,GAA6B,IAAI,CAAC;QAInD,IAAI,CAAC,MAAM,GAAG;YACZ,KAAK,EAAE,CAAC,GAAG,IAAe,EAAE,EAAE;gBAC5B,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,IAAI,CAAC,CAAC;YAC5C,CAAC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;YAC5B,aAAa,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAC;QAC/C,CAAC;QACD,OAAO,aAAa,CAAC,QAAQ,CAAC;IAChC,CAAC;IAED;;OAEG;IACK,gBAAgB;QACtB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACzF,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;IACnD,CAAC;IAED;;OAEG;IACK,aAAa;QACnB,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC,WAAW,CAAC;QAE9C,MAAM,UAAU,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC3C,IAAI,CAAC;YACH,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC9B,MAAM,aAAa,GAAG,EAAE,CAAC,YAA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AAC,OAAwB;QACnC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,EAAC,GAAG,OAAO,EAAE,GAAG,OAAO,EAAC,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,0BAA0B;QACxB,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type Screen = 'welcome' | 'setup' | 'mcp-config' | 'chat' | 'loading';
|
|
2
|
+
export interface Message {
|
|
3
|
+
role: 'user' | 'assistant' | 'system';
|
|
4
|
+
content: string;
|
|
5
|
+
timestamp: Date;
|
|
6
|
+
}
|
|
7
|
+
export type Network = 'testnet' | 'mainnet';
|
|
8
|
+
export interface Config {
|
|
9
|
+
accountId: string;
|
|
10
|
+
privateKey: string;
|
|
11
|
+
network: Network;
|
|
12
|
+
openAIApiKey: string;
|
|
13
|
+
}
|
|
14
|
+
export type MCPTransport = 'stdio' | 'http' | 'websocket';
|
|
15
|
+
export interface MCPServerConfig {
|
|
16
|
+
name: string;
|
|
17
|
+
command: string;
|
|
18
|
+
args: string[];
|
|
19
|
+
transport?: MCPTransport;
|
|
20
|
+
autoConnect?: boolean;
|
|
21
|
+
env?: Record<string, string>;
|
|
22
|
+
additionalContext?: string;
|
|
23
|
+
toolDescriptions?: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export declare const MCPServers: {
|
|
26
|
+
filesystem: (path: string) => MCPServerConfig;
|
|
27
|
+
};
|
|
28
|
+
export type SelectItem<TValue> = {
|
|
29
|
+
key?: string;
|
|
30
|
+
label: string;
|
|
31
|
+
value: TValue;
|
|
32
|
+
};
|
|
33
|
+
export declare const BRAND_COLORS: {
|
|
34
|
+
blue: string;
|
|
35
|
+
green: string;
|
|
36
|
+
purple: string;
|
|
37
|
+
dark: string;
|
|
38
|
+
white: string;
|
|
39
|
+
hedera: {
|
|
40
|
+
purple: string;
|
|
41
|
+
blue: string;
|
|
42
|
+
green: string;
|
|
43
|
+
charcoal: string;
|
|
44
|
+
smoke: string;
|
|
45
|
+
};
|
|
46
|
+
keywords: string;
|
|
47
|
+
functions: string;
|
|
48
|
+
strings: string;
|
|
49
|
+
variables: string;
|
|
50
|
+
comments: string;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7E,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CAChB;AAED,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C,MAAM,WAAW,MAAM;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;AAE1D,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,UAAU;uBACH,MAAM,KAAG,eAAe;CAa3C,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;CAoBxB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const MCPServers = {
|
|
2
|
+
filesystem: (path) => ({
|
|
3
|
+
name: 'filesystem',
|
|
4
|
+
command: 'npx',
|
|
5
|
+
args: ['-y', '@modelcontextprotocol/server-filesystem', path],
|
|
6
|
+
transport: 'stdio',
|
|
7
|
+
autoConnect: true,
|
|
8
|
+
additionalContext: 'This server provides access to files and directories in the current working directory.',
|
|
9
|
+
toolDescriptions: {
|
|
10
|
+
list_directory: 'Use this tool when users ask about files in the current directory or working directory.',
|
|
11
|
+
read_file: 'Use this tool when users ask to see or check files in the current directory.',
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
export const BRAND_COLORS = {
|
|
16
|
+
blue: '#5599fe',
|
|
17
|
+
green: '#48df7b',
|
|
18
|
+
purple: '#b56cff',
|
|
19
|
+
dark: '#3f4174',
|
|
20
|
+
white: '#ffffff',
|
|
21
|
+
hedera: {
|
|
22
|
+
purple: '#8259ef',
|
|
23
|
+
blue: '#2d84eb',
|
|
24
|
+
green: '#3ec878',
|
|
25
|
+
charcoal: '#464646',
|
|
26
|
+
smoke: '#8c8c8c',
|
|
27
|
+
},
|
|
28
|
+
keywords: '#3f4174',
|
|
29
|
+
functions: '#5599fe',
|
|
30
|
+
strings: '#48df7b',
|
|
31
|
+
variables: '#b56cff',
|
|
32
|
+
comments: '#6b7280',
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA8BA,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB,UAAU,EAAE,CAAC,IAAY,EAAmB,EAAE,CAAC,CAAC;QAC/C,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,yCAAyC,EAAE,IAAI,CAAC;QAC7D,SAAS,EAAE,OAAO;QAClB,WAAW,EAAE,IAAI;QACjB,iBAAiB,EAChB,wFAAwF;QACzF,gBAAgB,EAAE;YACjB,cAAc,EAAE,yFAAyF;YACzG,SAAS,EAAE,8EAA8E;SACzF;KACD,CAAC;CACF,CAAC;AAQF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAEhB,MAAM,EAAE;QACP,MAAM,EAAE,SAAS;QACjB,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,SAAS;QACnB,KAAK,EAAE,SAAS;KAChB;IAED,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,SAAS;CACnB,CAAC"}
|
package/dist/esm/index10.js
CHANGED
|
@@ -3,7 +3,7 @@ import { extractRenderConfigs, generateFieldOrdering } from "@hashgraphonline/st
|
|
|
3
3
|
import { Logger } from "@hashgraphonline/standards-sdk";
|
|
4
4
|
import { fieldTypeRegistry } from "./index12.js";
|
|
5
5
|
import { fieldGuidanceRegistry } from "./index13.js";
|
|
6
|
-
import "./
|
|
6
|
+
import "./index44.js";
|
|
7
7
|
import { FIELD_PRIORITIES } from "./index47.js";
|
|
8
8
|
function isZodObjectSchema(schema) {
|
|
9
9
|
return typeof schema === "object" && schema !== null && "shape" in schema;
|
package/dist/esm/index21.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReferenceIdGenerator } from "./index22.js";
|
|
2
|
-
import { DEFAULT_CONTENT_REFERENCE_CONFIG, ContentReferenceError } from "./
|
|
2
|
+
import { DEFAULT_CONTENT_REFERENCE_CONFIG, ContentReferenceError } from "./index42.js";
|
|
3
3
|
const _ContentStorage = class _ContentStorage {
|
|
4
4
|
constructor(maxStorage = _ContentStorage.DEFAULT_MAX_STORAGE, referenceConfig) {
|
|
5
5
|
this.messages = [];
|
package/dist/esm/index23.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChatOpenAI } from "@langchain/openai";
|
|
2
2
|
import { Logger } from "@hashgraphonline/standards-sdk";
|
|
3
|
-
import { ENTITY_PATTERNS } from "./
|
|
3
|
+
import { ENTITY_PATTERNS } from "./index44.js";
|
|
4
4
|
import "hedera-agent-kit";
|
|
5
5
|
import "@hashgraphonline/standards-agent-kit";
|
|
6
6
|
import "./index13.js";
|