@hashgraphonline/conversational-agent 0.1.217 → 0.1.218
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/readme.md +181 -0
- package/dist/cjs/constants/entity-references.d.ts +18 -0
- package/dist/cjs/constants/form-priorities.d.ts +24 -0
- package/dist/cjs/constants/index.d.ts +4 -0
- package/dist/cjs/constants/messages.d.ts +19 -0
- package/dist/cjs/constants/test-constants.d.ts +42 -0
- package/dist/cjs/conversational-agent.d.ts +3 -8
- package/dist/cjs/core/{ToolRegistry.d.ts → tool-registry.d.ts} +10 -7
- package/dist/{types/execution/ExecutionPipeline.d.ts → cjs/execution/execution-pipeline.d.ts} +3 -3
- package/dist/cjs/forms/field-guidance-registry.d.ts +108 -0
- package/dist/cjs/forms/form-generator.d.ts +2 -7
- package/dist/cjs/forms/index.d.ts +3 -0
- package/dist/cjs/forms/types.d.ts +9 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.ts +7 -12
- package/dist/cjs/langchain/external-tool-wrapper.d.ts +101 -0
- package/dist/{types/langchain/FormAwareAgentExecutor.d.ts → cjs/langchain/form-aware-agent-executor.d.ts} +19 -12
- package/dist/cjs/langchain/index.d.ts +2 -0
- package/dist/{types → cjs/langchain}/langchain-agent.d.ts +15 -7
- package/dist/cjs/mcp/adapters/index.d.ts +1 -0
- package/dist/cjs/mcp/adapters/langchain.d.ts +1 -1
- package/dist/{types/mcp/ContentProcessor.d.ts → cjs/mcp/content-processor.d.ts} +1 -1
- package/dist/cjs/mcp/index.d.ts +5 -0
- package/dist/{types/mcp/MCPClientManager.d.ts → cjs/mcp/mcp-client-manager.d.ts} +1 -1
- package/dist/cjs/memory/{ContentStorage.d.ts → content-storage.d.ts} +4 -4
- package/dist/cjs/memory/index.d.ts +5 -7
- package/dist/{types/memory/MemoryWindow.d.ts → cjs/memory/memory-window.d.ts} +1 -1
- package/dist/{types/memory/SmartMemoryManager.d.ts → cjs/memory/smart-memory-manager.d.ts} +1 -1
- package/dist/cjs/services/{ContentStoreManager.d.ts → content-store-manager.d.ts} +6 -6
- package/dist/cjs/services/context/resolution-context.d.ts +49 -0
- package/dist/cjs/services/entity-resolver.d.ts +58 -0
- package/dist/cjs/services/formatters/converters/index.d.ts +2 -0
- package/dist/cjs/services/formatters/converters/string-normalization-converter.d.ts +13 -0
- package/dist/cjs/services/formatters/converters/topic-id-to-hrl-converter.d.ts +17 -0
- package/dist/cjs/services/formatters/format-converter-registry.d.ts +66 -0
- package/dist/cjs/services/formatters/index.d.ts +3 -0
- package/dist/cjs/services/formatters/types.d.ts +29 -0
- package/dist/cjs/services/index.d.ts +3 -0
- package/dist/cjs/services/resolution/resolution-pipeline.d.ts +44 -0
- package/dist/cjs/tools/index.d.ts +1 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/esm/index.js +40 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index10.js +669 -13
- package/dist/esm/index10.js.map +1 -1
- package/dist/esm/index11.js +310 -95
- package/dist/esm/index11.js.map +1 -1
- package/dist/esm/index12.js +130 -95
- package/dist/esm/index12.js.map +1 -1
- package/dist/esm/index13.js +262 -153
- package/dist/esm/index13.js.map +1 -1
- package/dist/esm/index14.js +100 -664
- package/dist/esm/index14.js.map +1 -1
- package/dist/esm/index15.js +135 -408
- package/dist/esm/index15.js.map +1 -1
- package/dist/esm/index16.js +240 -122
- package/dist/esm/index16.js.map +1 -1
- package/dist/esm/index17.js +147 -135
- package/dist/esm/index17.js.map +1 -1
- package/dist/esm/index18.js +376 -533
- package/dist/esm/index18.js.map +1 -1
- package/dist/esm/index19.js +87 -214
- package/dist/esm/index19.js.map +1 -1
- package/dist/esm/index2.js +21 -4
- package/dist/esm/index2.js.map +1 -1
- package/dist/esm/index20.js +158 -92
- package/dist/esm/index20.js.map +1 -1
- package/dist/esm/index21.js +717 -44
- package/dist/esm/index21.js.map +1 -1
- package/dist/esm/index22.js +58 -96
- package/dist/esm/index22.js.map +1 -1
- package/dist/esm/index23.js +324 -34
- package/dist/esm/index23.js.map +1 -1
- package/dist/esm/index24.js +125 -712
- package/dist/esm/index24.js.map +1 -1
- package/dist/esm/index25.js +113 -133
- package/dist/esm/index25.js.map +1 -1
- package/dist/esm/index26.js +18 -152
- package/dist/esm/index26.js.map +1 -1
- package/dist/esm/index27.js +14 -210
- package/dist/esm/index27.js.map +1 -1
- package/dist/esm/index28.js +70 -173
- package/dist/esm/index28.js.map +1 -1
- package/dist/esm/index29.js +811 -224
- package/dist/esm/index29.js.map +1 -1
- package/dist/esm/index30.js +1245 -122
- package/dist/esm/index30.js.map +1 -1
- package/dist/esm/index31.js +126 -56
- package/dist/esm/index31.js.map +1 -1
- package/dist/esm/index32.js +111 -24
- package/dist/esm/index32.js.map +1 -1
- package/dist/esm/index33.js +41 -87
- package/dist/esm/index33.js.map +1 -1
- package/dist/esm/index34.js +88 -227
- package/dist/esm/index34.js.map +1 -1
- package/dist/esm/index35.js +24 -0
- package/dist/esm/index35.js.map +1 -0
- package/dist/esm/index36.js +15 -0
- package/dist/esm/index36.js.map +1 -0
- package/dist/esm/index37.js +10 -0
- package/dist/esm/index37.js.map +1 -0
- package/dist/esm/index38.js +8 -0
- package/dist/esm/index38.js.map +1 -0
- package/dist/esm/index39.js +227 -0
- package/dist/esm/index39.js.map +1 -0
- package/dist/esm/index40.js +187 -0
- package/dist/esm/index40.js.map +1 -0
- package/dist/esm/index41.js +30 -0
- package/dist/esm/index41.js.map +1 -0
- package/dist/esm/index42.js +95 -0
- package/dist/esm/index42.js.map +1 -0
- package/dist/esm/index5.js +2 -2
- package/dist/esm/index5.js.map +1 -1
- package/dist/esm/index6.js +44 -67
- package/dist/esm/index6.js.map +1 -1
- package/dist/esm/index7.js +9 -0
- package/dist/esm/index7.js.map +1 -1
- package/dist/esm/index8.js +13 -1095
- package/dist/esm/index8.js.map +1 -1
- package/dist/esm/index9.js +17 -13
- package/dist/esm/index9.js.map +1 -1
- package/dist/types/constants/entity-references.d.ts +18 -0
- package/dist/types/constants/form-priorities.d.ts +24 -0
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/constants/messages.d.ts +19 -0
- package/dist/types/constants/test-constants.d.ts +42 -0
- package/dist/types/conversational-agent.d.ts +3 -8
- package/dist/types/core/{ToolRegistry.d.ts → tool-registry.d.ts} +10 -7
- package/dist/{cjs/execution/ExecutionPipeline.d.ts → types/execution/execution-pipeline.d.ts} +3 -3
- package/dist/types/forms/field-guidance-registry.d.ts +108 -0
- package/dist/types/forms/form-generator.d.ts +2 -7
- package/dist/types/forms/index.d.ts +3 -0
- package/dist/types/forms/types.d.ts +9 -1
- package/dist/types/index.d.ts +7 -12
- package/dist/types/langchain/external-tool-wrapper.d.ts +101 -0
- package/dist/{cjs/langchain/FormAwareAgentExecutor.d.ts → types/langchain/form-aware-agent-executor.d.ts} +19 -12
- package/dist/types/langchain/index.d.ts +2 -0
- package/dist/{cjs → types/langchain}/langchain-agent.d.ts +15 -7
- package/dist/types/mcp/adapters/index.d.ts +1 -0
- package/dist/types/mcp/adapters/langchain.d.ts +1 -1
- package/dist/{cjs/mcp/ContentProcessor.d.ts → types/mcp/content-processor.d.ts} +1 -1
- package/dist/types/mcp/index.d.ts +5 -0
- package/dist/{cjs/mcp/MCPClientManager.d.ts → types/mcp/mcp-client-manager.d.ts} +1 -1
- package/dist/types/memory/{ContentStorage.d.ts → content-storage.d.ts} +4 -4
- package/dist/types/memory/index.d.ts +5 -7
- package/dist/{cjs/memory/MemoryWindow.d.ts → types/memory/memory-window.d.ts} +1 -1
- package/dist/{cjs/memory/SmartMemoryManager.d.ts → types/memory/smart-memory-manager.d.ts} +1 -1
- package/dist/types/services/{ContentStoreManager.d.ts → content-store-manager.d.ts} +6 -6
- package/dist/types/services/context/resolution-context.d.ts +49 -0
- package/dist/types/services/entity-resolver.d.ts +58 -0
- package/dist/types/services/formatters/converters/index.d.ts +2 -0
- package/dist/types/services/formatters/converters/string-normalization-converter.d.ts +13 -0
- package/dist/types/services/formatters/converters/topic-id-to-hrl-converter.d.ts +17 -0
- package/dist/types/services/formatters/format-converter-registry.d.ts +66 -0
- package/dist/types/services/formatters/index.d.ts +3 -0
- package/dist/types/services/formatters/types.d.ts +29 -0
- package/dist/types/services/index.d.ts +3 -0
- package/dist/types/services/resolution/resolution-pipeline.d.ts +44 -0
- package/dist/types/tools/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +30 -27
- package/src/agent-factory.ts +1 -1
- package/src/base-agent.ts +9 -0
- package/src/config/system-message.ts +2 -15
- package/src/constants/entity-references.ts +23 -0
- package/src/constants/form-priorities.ts +25 -0
- package/src/constants/index.ts +4 -0
- package/src/constants/messages.ts +20 -0
- package/src/constants/test-constants.ts +49 -0
- package/src/conversational-agent.ts +42 -69
- package/src/core/{ToolRegistry.ts → tool-registry.ts} +70 -44
- package/src/examples/external-tool-wrapper-example.ts +56 -0
- package/src/execution/{ExecutionPipeline.ts → execution-pipeline.ts} +3 -3
- package/src/forms/field-guidance-registry.ts +415 -0
- package/src/forms/field-type-registry.ts +49 -48
- package/src/forms/{FormEngine.ts → form-engine.ts} +66 -43
- package/src/forms/form-generator.ts +91 -17
- package/src/forms/index.ts +4 -1
- package/src/forms/types.ts +9 -1
- package/src/index.ts +7 -37
- package/src/langchain/external-tool-wrapper.ts +90 -0
- package/src/langchain/{FormAwareAgentExecutor.ts → form-aware-agent-executor.ts} +579 -351
- package/src/langchain/index.ts +2 -0
- package/src/{langchain-agent.ts → langchain/langchain-agent.ts} +389 -113
- package/src/mcp/adapters/index.ts +1 -0
- package/src/mcp/adapters/langchain.ts +27 -18
- package/src/mcp/{ContentProcessor.ts → content-processor.ts} +71 -47
- package/src/mcp/index.ts +5 -0
- package/src/mcp/{MCPClientManager.ts → mcp-client-manager.ts} +2 -2
- package/src/memory/{ContentStorage.ts → content-storage.ts} +263 -167
- package/src/memory/index.ts +5 -8
- package/src/memory/{MemoryWindow.ts → memory-window.ts} +47 -24
- package/src/memory/{SmartMemoryManager.ts → smart-memory-manager.ts} +49 -22
- package/src/plugins/hbar/HbarPlugin.ts +1 -1
- package/src/plugins/hcs-10/HCS10Plugin.ts +46 -28
- package/src/scripts/test-external-tool-wrapper.ts +6 -6
- package/src/scripts/test-inscribe-form-generation.ts +22 -21
- package/src/scripts/test-inscribe-wrapper-verification.ts +5 -4
- package/src/services/{ContentStoreManager.ts → content-store-manager.ts} +75 -33
- package/src/services/context/resolution-context.ts +80 -0
- package/src/services/entity-resolver.ts +425 -0
- package/src/services/formatters/converters/index.ts +2 -0
- package/src/services/formatters/converters/string-normalization-converter.ts +106 -0
- package/src/services/formatters/converters/topic-id-to-hrl-converter.ts +25 -0
- package/src/services/formatters/format-converter-registry.ts +229 -0
- package/src/services/formatters/index.ts +3 -0
- package/src/services/formatters/types.ts +31 -0
- package/src/services/index.ts +3 -0
- package/src/services/resolution/resolution-pipeline.ts +106 -0
- package/src/tools/index.ts +1 -0
- package/src/types/content-reference.ts +87 -60
- package/src/utils/index.ts +1 -0
- package/cli/dist/CLIApp.d.ts +0 -9
- package/cli/dist/CLIApp.js +0 -127
- package/cli/dist/LocalConversationalAgent.d.ts +0 -37
- package/cli/dist/LocalConversationalAgent.js +0 -58
- package/cli/dist/app.d.ts +0 -16
- package/cli/dist/app.js +0 -13
- package/cli/dist/cli.d.ts +0 -2
- package/cli/dist/cli.js +0 -51
- package/cli/dist/components/AppContainer.d.ts +0 -16
- package/cli/dist/components/AppContainer.js +0 -24
- package/cli/dist/components/AppScreens.d.ts +0 -2
- package/cli/dist/components/AppScreens.js +0 -259
- package/cli/dist/components/ChatScreen.d.ts +0 -15
- package/cli/dist/components/ChatScreen.js +0 -39
- package/cli/dist/components/DebugLoadingScreen.d.ts +0 -5
- package/cli/dist/components/DebugLoadingScreen.js +0 -31
- package/cli/dist/components/LoadingScreen.d.ts +0 -2
- package/cli/dist/components/LoadingScreen.js +0 -16
- package/cli/dist/components/LoadingScreenDebug.d.ts +0 -5
- package/cli/dist/components/LoadingScreenDebug.js +0 -27
- package/cli/dist/components/MCPConfigScreen.d.ts +0 -28
- package/cli/dist/components/MCPConfigScreen.js +0 -168
- package/cli/dist/components/ScreenRouter.d.ts +0 -12
- package/cli/dist/components/ScreenRouter.js +0 -22
- package/cli/dist/components/SetupScreen.d.ts +0 -15
- package/cli/dist/components/SetupScreen.js +0 -65
- package/cli/dist/components/SingleLoadingScreen.d.ts +0 -5
- package/cli/dist/components/SingleLoadingScreen.js +0 -27
- package/cli/dist/components/StatusBadge.d.ts +0 -7
- package/cli/dist/components/StatusBadge.js +0 -28
- package/cli/dist/components/TerminalWindow.d.ts +0 -8
- package/cli/dist/components/TerminalWindow.js +0 -24
- package/cli/dist/components/WelcomeScreen.d.ts +0 -11
- package/cli/dist/components/WelcomeScreen.js +0 -47
- package/cli/dist/context/AppContext.d.ts +0 -68
- package/cli/dist/context/AppContext.js +0 -363
- package/cli/dist/hooks/useInitializeAgent.d.ts +0 -19
- package/cli/dist/hooks/useInitializeAgent.js +0 -28
- package/cli/dist/hooks/useStableState.d.ts +0 -38
- package/cli/dist/hooks/useStableState.js +0 -68
- package/cli/dist/managers/AgentManager.d.ts +0 -57
- package/cli/dist/managers/AgentManager.js +0 -119
- package/cli/dist/managers/ConfigManager.d.ts +0 -53
- package/cli/dist/managers/ConfigManager.js +0 -173
- package/cli/dist/types.d.ts +0 -31
- package/cli/dist/types.js +0 -19
- package/dist/cjs/context/ReferenceContextManager.d.ts +0 -84
- package/dist/cjs/context/ReferenceResponseProcessor.d.ts +0 -76
- package/dist/cjs/langchain/FormValidatingToolWrapper.d.ts +0 -81
- package/dist/cjs/services/EntityResolver.d.ts +0 -26
- package/dist/types/context/ReferenceContextManager.d.ts +0 -84
- package/dist/types/context/ReferenceResponseProcessor.d.ts +0 -76
- package/dist/types/langchain/FormValidatingToolWrapper.d.ts +0 -81
- package/dist/types/services/EntityResolver.d.ts +0 -26
- package/src/context/ReferenceContextManager.ts +0 -350
- package/src/context/ReferenceResponseProcessor.ts +0 -295
- package/src/langchain/FormValidatingToolWrapper.ts +0 -355
- package/src/scripts/test-hedera-kit-wrapper.ts +0 -265
- package/src/services/EntityResolver.ts +0 -128
- /package/dist/cjs/forms/{FormEngine.d.ts → form-engine.d.ts} +0 -0
- /package/dist/cjs/memory/{ReferenceIdGenerator.d.ts → reference-id-generator.d.ts} +0 -0
- /package/dist/cjs/memory/{TokenCounter.d.ts → token-counter.d.ts} +0 -0
- /package/dist/cjs/tools/{EntityResolverTool.d.ts → entity-resolver-tool.d.ts} +0 -0
- /package/dist/cjs/utils/{ResponseFormatter.d.ts → response-formatter.d.ts} +0 -0
- /package/dist/types/forms/{FormEngine.d.ts → form-engine.d.ts} +0 -0
- /package/dist/types/memory/{ReferenceIdGenerator.d.ts → reference-id-generator.d.ts} +0 -0
- /package/dist/types/memory/{TokenCounter.d.ts → token-counter.d.ts} +0 -0
- /package/dist/types/tools/{EntityResolverTool.d.ts → entity-resolver-tool.d.ts} +0 -0
- /package/dist/types/utils/{ResponseFormatter.d.ts → response-formatter.d.ts} +0 -0
- /package/src/memory/{ReferenceIdGenerator.ts → reference-id-generator.ts} +0 -0
- /package/src/memory/{TokenCounter.ts → token-counter.ts} +0 -0
- /package/src/tools/{EntityResolverTool.ts → entity-resolver-tool.ts} +0 -0
- /package/src/utils/{ResponseFormatter.ts → response-formatter.ts} +0 -0
package/cli/readme.md
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Hedera Conversational Agent CLI
|
|
2
|
+
|
|
3
|
+
A beautiful command-line interface for the Hedera Conversational Agent, built with [Ink](https://github.com/vadimdemedes/ink) and styled following Hashgraph Online design patterns.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- 🎨 **Beautiful Terminal UI** - Styled with HCS improvement proposals design patterns
|
|
8
|
+
- 💬 **Interactive Chat** - Chat with your Hedera agent in a clean terminal interface
|
|
9
|
+
- 🔐 **Secure Configuration** - Masked input for sensitive credentials
|
|
10
|
+
- 🌈 **Gradient Text & Colors** - Brand-consistent color scheme
|
|
11
|
+
- 🚀 **Fast & Responsive** - Built with React for smooth interactions
|
|
12
|
+
- 📊 **Transaction Details** - See transaction IDs and network responses
|
|
13
|
+
- 🎯 **HCS-10 Support** - Full support for agent connections and messaging
|
|
14
|
+
- 🔧 **MCP Integration** - Configure Model Context Protocol servers for extended capabilities
|
|
15
|
+
- 📁 **File Operations** - Built-in filesystem MCP server for file management
|
|
16
|
+
- ⚙️ **Custom MCP Servers** - Add your own MCP servers for specialized tools
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
For local development, the CLI uses the actual ConversationalAgent from the parent package:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 1. Build the parent package first
|
|
24
|
+
cd /path/to/conversational-agent
|
|
25
|
+
pnpm install
|
|
26
|
+
pnpm build
|
|
27
|
+
|
|
28
|
+
# 2. The CLI will be built automatically via postinstall hook
|
|
29
|
+
# Or build manually:
|
|
30
|
+
cd cli
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm build
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Usage
|
|
36
|
+
|
|
37
|
+
### Interactive Mode (Recommended)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# From the parent conversational-agent directory
|
|
41
|
+
pnpm cli
|
|
42
|
+
|
|
43
|
+
# This automatically builds if needed and runs the CLI
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### With Command Line Arguments
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
conversational-agent \
|
|
50
|
+
--account-id=0.0.12345 \
|
|
51
|
+
--private-key=your-private-key \
|
|
52
|
+
--network=testnet \
|
|
53
|
+
--openai-api-key=sk-...
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Using Environment Variables
|
|
57
|
+
|
|
58
|
+
The CLI automatically loads configuration from `.env` in the conversational-agent root:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# .env file in conversational-agent directory
|
|
62
|
+
HEDERA_ACCOUNT_ID=0.0.12345
|
|
63
|
+
HEDERA_PRIVATE_KEY=your-private-key
|
|
64
|
+
HEDERA_NETWORK=testnet
|
|
65
|
+
OPENAI_API_KEY=sk-...
|
|
66
|
+
MCP_SERVERS=[{"name":"filesystem","command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/tmp"]}]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then simply run: `pnpm cli`
|
|
70
|
+
|
|
71
|
+
## Interface Overview
|
|
72
|
+
|
|
73
|
+
### Welcome Screen
|
|
74
|
+
- Beautiful ASCII art logo with gradient colors
|
|
75
|
+
- Simple menu navigation with arrow keys
|
|
76
|
+
- Options: Start Chat, Configure, MCP Servers, Exit
|
|
77
|
+
|
|
78
|
+
### Configuration Screen
|
|
79
|
+
- Terminal-style window with macOS-like controls
|
|
80
|
+
- Secure input masking for sensitive data
|
|
81
|
+
- Tab navigation between fields
|
|
82
|
+
- Real-time validation
|
|
83
|
+
|
|
84
|
+
### MCP Servers Screen
|
|
85
|
+
- Configure Model Context Protocol servers
|
|
86
|
+
- Enable/disable filesystem server with custom path
|
|
87
|
+
- Add custom MCP servers with command and arguments
|
|
88
|
+
- Live preview of available tools
|
|
89
|
+
- Save configuration to environment
|
|
90
|
+
|
|
91
|
+
### Chat Interface
|
|
92
|
+
- Clean terminal aesthetic with prompt symbols
|
|
93
|
+
- Color-coded messages (user, assistant, system)
|
|
94
|
+
- Loading indicators with spinners
|
|
95
|
+
- Transaction ID display
|
|
96
|
+
- MCP server status and available tools
|
|
97
|
+
- Escape key to return to menu
|
|
98
|
+
|
|
99
|
+
## Design Features
|
|
100
|
+
|
|
101
|
+
The CLI follows Hashgraph Online's design system:
|
|
102
|
+
|
|
103
|
+
- **Brand Colors**: Primary blue (#5599fe), Green (#48df7b), Purple (#b56cff)
|
|
104
|
+
- **Hedera Colors**: Purple (#8259ef), Blue (#2d84eb), Green (#3ec878)
|
|
105
|
+
- **Terminal Window**: Rounded borders with window control dots
|
|
106
|
+
- **Status Badges**: Color-coded status indicators
|
|
107
|
+
- **Typography**: Monospace throughout with clear hierarchy
|
|
108
|
+
|
|
109
|
+
## Keyboard Shortcuts
|
|
110
|
+
|
|
111
|
+
- `↑/↓` - Navigate menus
|
|
112
|
+
- `Enter` - Select/Submit
|
|
113
|
+
- `Tab` - Next field (in configuration)
|
|
114
|
+
- `Escape` - Return to main menu (from chat)
|
|
115
|
+
- `Ctrl+C` - Exit application
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Watch mode for development
|
|
121
|
+
pnpm dev
|
|
122
|
+
|
|
123
|
+
# Run tests
|
|
124
|
+
pnpm test
|
|
125
|
+
|
|
126
|
+
# Build for production
|
|
127
|
+
pnpm build
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Examples
|
|
131
|
+
|
|
132
|
+
### Basic Chat Interaction
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
$ Find all AI agents on the network
|
|
136
|
+
→ I'll search for AI agents registered on the Hedera network...
|
|
137
|
+
|
|
138
|
+
[INFO] Found 5 agents with AI capabilities
|
|
139
|
+
→ Here are the AI agents I found:
|
|
140
|
+
1. Agent: 0.0.12345 - "GPT Assistant"
|
|
141
|
+
2. Agent: 0.0.23456 - "Code Helper"
|
|
142
|
+
...
|
|
143
|
+
|
|
144
|
+
$ Connect to agent 0.0.12345
|
|
145
|
+
→ Initiating connection to agent 0.0.12345...
|
|
146
|
+
[INFO] Transaction ID: 0.0.98765@1234567890.123
|
|
147
|
+
→ Successfully connected! You can now send messages to this agent.
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### MCP File Operations
|
|
151
|
+
|
|
152
|
+
With filesystem MCP server enabled:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
$ Create a new file called notes.txt with my meeting notes
|
|
156
|
+
→ I'll create a notes.txt file for you with meeting notes...
|
|
157
|
+
|
|
158
|
+
[INFO] MCP servers enabled: filesystem
|
|
159
|
+
→ I've created notes.txt in your configured directory with the meeting notes.
|
|
160
|
+
|
|
161
|
+
$ List all files in the current directory
|
|
162
|
+
→ Here are the files in /tmp:
|
|
163
|
+
- notes.txt (created just now)
|
|
164
|
+
- data.json
|
|
165
|
+
- config.yaml
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Custom MCP Server
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
$ Add GitHub repository operations
|
|
172
|
+
→ I can help you interact with GitHub repositories...
|
|
173
|
+
|
|
174
|
+
[INFO] MCP servers enabled: filesystem, github
|
|
175
|
+
→ I now have access to GitHub operations. I can help you create issues,
|
|
176
|
+
manage repositories, and work with pull requests.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## License
|
|
180
|
+
|
|
181
|
+
Apache-2.0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EntityFormat } from '../services/formatters/types';
|
|
2
|
+
/**
|
|
3
|
+
* Common entity reference patterns used across the application
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENTITY_PATTERNS: {
|
|
6
|
+
readonly TOPIC_REFERENCE: "the topic";
|
|
7
|
+
readonly TOKEN_REFERENCE: "the token";
|
|
8
|
+
readonly ACCOUNT_REFERENCE: "the account";
|
|
9
|
+
readonly TRANSACTION_REFERENCE: "the transaction";
|
|
10
|
+
readonly CONTRACT_REFERENCE: "the contract";
|
|
11
|
+
};
|
|
12
|
+
export declare const ENTITY_TYPES: {
|
|
13
|
+
readonly TOPIC: EntityFormat.TOPIC_ID;
|
|
14
|
+
readonly TOKEN: EntityFormat.TOKEN_ID;
|
|
15
|
+
readonly ACCOUNT: EntityFormat.ACCOUNT_ID;
|
|
16
|
+
readonly TRANSACTION: "transaction";
|
|
17
|
+
readonly CONTRACT: EntityFormat.CONTRACT_ID;
|
|
18
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form field priorities for progressive disclosure
|
|
3
|
+
*/
|
|
4
|
+
export declare const FIELD_PRIORITIES: {
|
|
5
|
+
readonly ESSENTIAL: "essential";
|
|
6
|
+
readonly COMMON: "common";
|
|
7
|
+
readonly ADVANCED: "advanced";
|
|
8
|
+
readonly EXPERT: "expert";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Form field types
|
|
12
|
+
*/
|
|
13
|
+
export declare const FORM_FIELD_TYPES: {
|
|
14
|
+
readonly TEXT: "text";
|
|
15
|
+
readonly NUMBER: "number";
|
|
16
|
+
readonly SELECT: "select";
|
|
17
|
+
readonly CHECKBOX: "checkbox";
|
|
18
|
+
readonly TEXTAREA: "textarea";
|
|
19
|
+
readonly FILE: "file";
|
|
20
|
+
readonly ARRAY: "array";
|
|
21
|
+
readonly OBJECT: "object";
|
|
22
|
+
readonly CURRENCY: "currency";
|
|
23
|
+
readonly PERCENTAGE: "percentage";
|
|
24
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ERROR_MESSAGES, STATUS_MESSAGES } from './messages';
|
|
2
|
+
export { ENTITY_PATTERNS, ENTITY_TYPES } from './entity-references';
|
|
3
|
+
export { FIELD_PRIORITIES, FORM_FIELD_TYPES } from './form-priorities';
|
|
4
|
+
export { TEST_ACCOUNT_IDS, TEST_NETWORK_CONFIGS, TEST_MESSAGES, TEST_TOOL_NAMES, TEST_KEYS, TEST_ERRORS, MOCK_FORM_DATA } from './test-constants';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common error messages and user feedback strings
|
|
3
|
+
*/
|
|
4
|
+
export declare const ERROR_MESSAGES: {
|
|
5
|
+
readonly TOO_MANY_REQUESTS: "Too many requests. Please wait a moment and try again.";
|
|
6
|
+
readonly RATE_LIMITED: "I'm receiving too many requests right now. Please wait a moment and try again.";
|
|
7
|
+
readonly SYSTEM_ERROR: "System error occurred";
|
|
8
|
+
readonly INVALID_INPUT: "Invalid input provided";
|
|
9
|
+
readonly NETWORK_ERROR: "Network error occurred";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Common success and status messages
|
|
13
|
+
*/
|
|
14
|
+
export declare const STATUS_MESSAGES: {
|
|
15
|
+
readonly OPERATION_SUCCESSFUL: "Operation completed successfully";
|
|
16
|
+
readonly PROCESSING: "Processing your request...";
|
|
17
|
+
readonly READY: "Ready to process requests";
|
|
18
|
+
readonly INITIALIZING: "Initializing...";
|
|
19
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common test constants to reduce string duplication in test files
|
|
3
|
+
*/
|
|
4
|
+
export declare const TEST_ACCOUNT_IDS: {
|
|
5
|
+
readonly OPERATOR: "0.0.12345";
|
|
6
|
+
readonly TARGET: "0.0.67890";
|
|
7
|
+
readonly SENDER: "0.0.800";
|
|
8
|
+
readonly RECEIVER: "0.0.801";
|
|
9
|
+
};
|
|
10
|
+
export declare const TEST_NETWORK_CONFIGS: {
|
|
11
|
+
readonly TESTNET: "testnet";
|
|
12
|
+
readonly MAINNET: "mainnet";
|
|
13
|
+
readonly PREVIEWNET: "previewnet";
|
|
14
|
+
};
|
|
15
|
+
export declare const TEST_MESSAGES: {
|
|
16
|
+
readonly SIMPLE_QUERY: "test message";
|
|
17
|
+
readonly AGENT_NOT_INITIALIZED: "Agent not initialized. Call boot() first.";
|
|
18
|
+
readonly PROCESSING_ERROR: "Error processing message";
|
|
19
|
+
readonly TEST_RESPONSE: "Test response";
|
|
20
|
+
};
|
|
21
|
+
export declare const TEST_TOOL_NAMES: {
|
|
22
|
+
readonly MOCK_TOOL: "mock-tool";
|
|
23
|
+
readonly HEDERA_GET_ACCOUNT: "hedera_get_account_info";
|
|
24
|
+
readonly HEDERA_TRANSFER: "hedera-account-transfer-hbar";
|
|
25
|
+
readonly INSCRIBE_HASHINAL: "inscribeHashinal";
|
|
26
|
+
};
|
|
27
|
+
export declare const TEST_KEYS: {
|
|
28
|
+
readonly OPENAI_API_KEY: "test-openai-key";
|
|
29
|
+
readonly PRIVATE_KEY: "mock-private-key";
|
|
30
|
+
readonly OPERATOR_KEY: "test-operator-key";
|
|
31
|
+
};
|
|
32
|
+
export declare const TEST_ERRORS: {
|
|
33
|
+
readonly INITIALIZATION_ERROR: "Initialization error";
|
|
34
|
+
readonly NETWORK_ERROR: "Network error";
|
|
35
|
+
readonly VALIDATION_ERROR: "Validation error";
|
|
36
|
+
};
|
|
37
|
+
export declare const MOCK_FORM_DATA: {
|
|
38
|
+
readonly FORM_ID: "mock-form-id";
|
|
39
|
+
readonly TOOL_NAME: "mock-tool";
|
|
40
|
+
readonly FIELD_NAME: "test-field";
|
|
41
|
+
readonly FIELD_TYPE: "text";
|
|
42
|
+
};
|
|
@@ -8,7 +8,7 @@ import { InscribePlugin } from './plugins/inscribe/InscribePlugin';
|
|
|
8
8
|
import { HbarPlugin } from './plugins/hbar/HbarPlugin';
|
|
9
9
|
import { IStateManager } from '@hashgraphonline/standards-agent-kit';
|
|
10
10
|
import { MCPServerConfig, MCPConnectionStatus } from './mcp/types';
|
|
11
|
-
import { ContentStoreManager } from './services/
|
|
11
|
+
import { ContentStoreManager } from './services/content-store-manager';
|
|
12
12
|
import { SmartMemoryManager, SmartMemoryConfig } from './memory';
|
|
13
13
|
import { FormSubmission } from './forms/types';
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ export type ToolDescriptor = {
|
|
|
17
17
|
namespace?: string;
|
|
18
18
|
};
|
|
19
19
|
export type ChatHistoryItem = {
|
|
20
|
-
type: 'human' | 'ai';
|
|
20
|
+
type: 'human' | 'ai' | 'system';
|
|
21
21
|
content: string;
|
|
22
22
|
};
|
|
23
23
|
export type AgentInstance = ReturnType<typeof createAgent>;
|
|
@@ -60,6 +60,7 @@ export interface ConversationalAgentOptions {
|
|
|
60
60
|
* @returns A new instance of the ConversationalAgent class.
|
|
61
61
|
*/
|
|
62
62
|
export declare class ConversationalAgent {
|
|
63
|
+
private static readonly NOT_INITIALIZED_ERROR;
|
|
63
64
|
protected agent?: AgentInstance;
|
|
64
65
|
hcs10Plugin: HCS10Plugin;
|
|
65
66
|
hcs2Plugin: HCS2Plugin;
|
|
@@ -192,12 +193,6 @@ export declare class ConversationalAgent {
|
|
|
192
193
|
* Create a ConversationalAgent with MCP servers configured
|
|
193
194
|
*/
|
|
194
195
|
static withMCP(options: ConversationalAgentOptions, mcpServers: MCPServerConfig[]): ConversationalAgent;
|
|
195
|
-
/**
|
|
196
|
-
* Resolve entity references using LLM-based resolver
|
|
197
|
-
* @param content - Message content to resolve
|
|
198
|
-
* @returns Resolved message content with entity IDs replaced
|
|
199
|
-
*/
|
|
200
|
-
private resolveEntitiesInMessage;
|
|
201
196
|
/**
|
|
202
197
|
* Extract and store entities from agent responses
|
|
203
198
|
* @param response - Agent response containing potential entity information
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { StructuredTool } from '@langchain/core/tools';
|
|
2
|
-
import { z } from 'zod';
|
|
3
2
|
import { Logger } from '@hashgraphonline/standards-sdk';
|
|
4
|
-
import { FormValidatingToolWrapper } from '../langchain/FormValidatingToolWrapper';
|
|
5
3
|
|
|
6
4
|
/**
|
|
7
5
|
* Tool capabilities configuration for registry entries
|
|
@@ -12,6 +10,15 @@ export interface ToolCapabilities {
|
|
|
12
10
|
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
13
11
|
category: 'core' | 'extension' | 'mcp';
|
|
14
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Entity resolution format preferences for tools
|
|
15
|
+
*/
|
|
16
|
+
export interface EntityResolutionPreferences {
|
|
17
|
+
inscription?: 'hrl' | 'topicId' | 'metadata' | 'any';
|
|
18
|
+
token?: 'tokenId' | 'address' | 'symbol' | 'any';
|
|
19
|
+
nft?: 'serialNumber' | 'metadata' | 'hrl' | 'any';
|
|
20
|
+
account?: 'accountId' | 'alias' | 'evmAddress' | 'any';
|
|
21
|
+
}
|
|
15
22
|
/**
|
|
16
23
|
* Tool metadata for comprehensive tool information
|
|
17
24
|
*/
|
|
@@ -23,6 +30,7 @@ export interface ToolMetadata {
|
|
|
23
30
|
capabilities: ToolCapabilities;
|
|
24
31
|
dependencies: string[];
|
|
25
32
|
schema: unknown;
|
|
33
|
+
entityResolutionPreferences?: EntityResolutionPreferences;
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
28
36
|
* Registry entry containing tool instance and metadata
|
|
@@ -30,7 +38,6 @@ export interface ToolMetadata {
|
|
|
30
38
|
export interface ToolRegistryEntry {
|
|
31
39
|
tool: StructuredTool;
|
|
32
40
|
metadata: ToolMetadata;
|
|
33
|
-
wrapper?: FormValidatingToolWrapper<z.ZodObject<z.ZodRawShape>> | undefined;
|
|
34
41
|
originalTool: StructuredTool;
|
|
35
42
|
}
|
|
36
43
|
/**
|
|
@@ -109,10 +116,6 @@ export declare class ToolRegistry {
|
|
|
109
116
|
* Check if tool has render configuration
|
|
110
117
|
*/
|
|
111
118
|
private hasRenderConfig;
|
|
112
|
-
/**
|
|
113
|
-
* Determine if tool should be wrapped
|
|
114
|
-
*/
|
|
115
|
-
private shouldWrapTool;
|
|
116
119
|
/**
|
|
117
120
|
* Check if schema is ZodObject-like
|
|
118
121
|
*/
|
package/dist/{types/execution/ExecutionPipeline.d.ts → cjs/execution/execution-pipeline.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logger } from '@hashgraphonline/standards-sdk';
|
|
2
|
-
import { SmartMemoryManager } from '../memory/
|
|
3
|
-
import { FormEngine, ToolExecutionResult } from '../forms/
|
|
4
|
-
import { ToolRegistry, ToolRegistryEntry } from '../core/
|
|
2
|
+
import { SmartMemoryManager } from '../memory/smart-memory-manager';
|
|
3
|
+
import { FormEngine, ToolExecutionResult } from '../forms/form-engine';
|
|
4
|
+
import { ToolRegistry, ToolRegistryEntry } from '../core/tool-registry';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Session context for tool execution
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { FormFieldType, FieldOption } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Field guidance configuration for providing contextual help and suggestions
|
|
5
|
+
*/
|
|
6
|
+
export interface FieldGuidance {
|
|
7
|
+
/**
|
|
8
|
+
* Suggestions to show as placeholder or examples
|
|
9
|
+
*/
|
|
10
|
+
suggestions?: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Predefined options for select fields
|
|
13
|
+
*/
|
|
14
|
+
predefinedOptions?: FieldOption[];
|
|
15
|
+
/**
|
|
16
|
+
* Warning messages for specific patterns to avoid
|
|
17
|
+
*/
|
|
18
|
+
warnings?: {
|
|
19
|
+
pattern: RegExp;
|
|
20
|
+
message: string;
|
|
21
|
+
}[];
|
|
22
|
+
/**
|
|
23
|
+
* Validation rules specific to the field context
|
|
24
|
+
*/
|
|
25
|
+
validationRules?: {
|
|
26
|
+
/**
|
|
27
|
+
* Patterns that should be rejected
|
|
28
|
+
*/
|
|
29
|
+
rejectPatterns?: {
|
|
30
|
+
pattern: RegExp;
|
|
31
|
+
reason: string;
|
|
32
|
+
}[];
|
|
33
|
+
/**
|
|
34
|
+
* Minimum quality requirements
|
|
35
|
+
*/
|
|
36
|
+
qualityChecks?: {
|
|
37
|
+
minNonTechnicalWords?: number;
|
|
38
|
+
requireSpecificTerms?: string[];
|
|
39
|
+
forbidTechnicalTerms?: string[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Field type override for specific contexts
|
|
44
|
+
*/
|
|
45
|
+
fieldTypeOverride?: FormFieldType;
|
|
46
|
+
/**
|
|
47
|
+
* Help text specific to the tool context
|
|
48
|
+
*/
|
|
49
|
+
contextualHelpText?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Tool-specific field configurations
|
|
53
|
+
*/
|
|
54
|
+
export interface ToolFieldConfiguration {
|
|
55
|
+
/**
|
|
56
|
+
* Tool name or pattern to match
|
|
57
|
+
*/
|
|
58
|
+
toolPattern: string | RegExp;
|
|
59
|
+
/**
|
|
60
|
+
* Field-specific guidance
|
|
61
|
+
*/
|
|
62
|
+
fields: Record<string, FieldGuidance>;
|
|
63
|
+
/**
|
|
64
|
+
* Global guidance for all fields in this tool
|
|
65
|
+
*/
|
|
66
|
+
globalGuidance?: {
|
|
67
|
+
/**
|
|
68
|
+
* General warnings to show
|
|
69
|
+
*/
|
|
70
|
+
warnings?: string[];
|
|
71
|
+
/**
|
|
72
|
+
* Quality standards for this tool
|
|
73
|
+
*/
|
|
74
|
+
qualityStandards?: string[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Registry for field guidance configurations
|
|
79
|
+
*/
|
|
80
|
+
declare class FieldGuidanceRegistry {
|
|
81
|
+
private configurations;
|
|
82
|
+
/**
|
|
83
|
+
* Register field guidance for a specific tool
|
|
84
|
+
*/
|
|
85
|
+
registerToolConfiguration(config: ToolFieldConfiguration): void;
|
|
86
|
+
/**
|
|
87
|
+
* Get field guidance for a specific tool and field
|
|
88
|
+
*/
|
|
89
|
+
getFieldGuidance(toolName: string, fieldName: string): FieldGuidance | null;
|
|
90
|
+
/**
|
|
91
|
+
* Get global guidance for a tool
|
|
92
|
+
*/
|
|
93
|
+
getGlobalGuidance(toolName: string): ToolFieldConfiguration['globalGuidance'] | null;
|
|
94
|
+
/**
|
|
95
|
+
* Validate field value against guidance rules
|
|
96
|
+
*/
|
|
97
|
+
validateFieldValue(toolName: string, fieldName: string, value: unknown): {
|
|
98
|
+
isValid: boolean;
|
|
99
|
+
warnings: string[];
|
|
100
|
+
errors: string[];
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Clear all configurations (useful for testing)
|
|
104
|
+
*/
|
|
105
|
+
clear(): void;
|
|
106
|
+
}
|
|
107
|
+
export declare const fieldGuidanceRegistry: FieldGuidanceRegistry;
|
|
108
|
+
export {};
|
|
@@ -112,12 +112,7 @@ export declare class FormGenerator {
|
|
|
112
112
|
* @returns Object containing jsonSchema and uiSchema
|
|
113
113
|
*/
|
|
114
114
|
generateJsonSchemaForm(zodSchema: z.ZodObject<z.ZodRawShape>, partialInput?: Record<string, unknown>, missingFields?: Set<string>): {
|
|
115
|
-
jsonSchema:
|
|
116
|
-
|
|
117
|
-
definitions?: {
|
|
118
|
-
[key: string]: import('zod-to-json-schema').JsonSchema7Type;
|
|
119
|
-
} | undefined;
|
|
120
|
-
};
|
|
121
|
-
uiSchema: Record<string, Record<string, unknown>>;
|
|
115
|
+
jsonSchema: Record<string, unknown>;
|
|
116
|
+
uiSchema: Record<string, unknown>;
|
|
122
117
|
};
|
|
123
118
|
}
|
|
@@ -48,6 +48,13 @@ export interface FormField {
|
|
|
48
48
|
options?: FieldOption[];
|
|
49
49
|
renderConfig?: RenderConfigSchema;
|
|
50
50
|
priority?: 'essential' | 'common' | 'advanced' | 'expert';
|
|
51
|
+
suggestions?: string[];
|
|
52
|
+
warnings?: string[];
|
|
53
|
+
contextualGuidance?: {
|
|
54
|
+
qualityStandards?: string[];
|
|
55
|
+
examples?: string[];
|
|
56
|
+
avoidPatterns?: string[];
|
|
57
|
+
};
|
|
51
58
|
}
|
|
52
59
|
/**
|
|
53
60
|
* Form field types supported by the UI
|
|
@@ -71,6 +78,7 @@ export interface FieldOption {
|
|
|
71
78
|
value: string;
|
|
72
79
|
label: string;
|
|
73
80
|
description?: string;
|
|
81
|
+
disabled?: boolean;
|
|
74
82
|
}
|
|
75
83
|
/**
|
|
76
84
|
* Validation error from Zod
|
|
@@ -92,7 +100,7 @@ export interface FormSubmission {
|
|
|
92
100
|
originalPrompt?: string;
|
|
93
101
|
partialInput?: Record<string, unknown>;
|
|
94
102
|
chatHistory?: Array<{
|
|
95
|
-
type: 'human' | 'ai';
|
|
103
|
+
type: 'human' | 'ai' | 'system';
|
|
96
104
|
content: string;
|
|
97
105
|
}>;
|
|
98
106
|
};
|