@hashgraphonline/conversational-agent 0.2.211 → 0.2.212
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/index46.js +6 -26
- package/dist/esm/index46.js.map +1 -1
- package/dist/esm/index47.js +26 -6
- package/dist/esm/index47.js.map +1 -1
- package/package.json +25 -33
- package/cli/readme.md +0 -181
package/dist/esm/index46.js
CHANGED
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
enableAutoCleanup: true,
|
|
7
|
-
cleanupIntervalMs: 5 * 60 * 1e3,
|
|
8
|
-
enablePersistence: false,
|
|
9
|
-
storageBackend: "memory",
|
|
10
|
-
cleanupPolicies: {
|
|
11
|
-
recent: { maxAgeMs: 30 * 60 * 1e3, priority: 1 },
|
|
12
|
-
userContent: { maxAgeMs: 2 * 60 * 60 * 1e3, priority: 2 },
|
|
13
|
-
agentGenerated: { maxAgeMs: 60 * 60 * 1e3, priority: 3 },
|
|
14
|
-
default: { maxAgeMs: 60 * 60 * 1e3, priority: 4 }
|
|
15
|
-
}
|
|
1
|
+
const FIELD_PRIORITIES = {
|
|
2
|
+
ESSENTIAL: "essential",
|
|
3
|
+
COMMON: "common",
|
|
4
|
+
ADVANCED: "advanced",
|
|
5
|
+
EXPERT: "expert"
|
|
16
6
|
};
|
|
17
|
-
class ContentReferenceError extends Error {
|
|
18
|
-
constructor(message, type, referenceId, suggestedActions) {
|
|
19
|
-
super(message);
|
|
20
|
-
this.type = type;
|
|
21
|
-
this.referenceId = referenceId;
|
|
22
|
-
this.suggestedActions = suggestedActions;
|
|
23
|
-
this.name = "ContentReferenceError";
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
7
|
export {
|
|
27
|
-
|
|
28
|
-
DEFAULT_CONTENT_REFERENCE_CONFIG
|
|
8
|
+
FIELD_PRIORITIES
|
|
29
9
|
};
|
|
30
10
|
//# sourceMappingURL=index46.js.map
|
package/dist/esm/index46.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index46.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index46.js","sources":["../../src/constants/form-priorities.ts"],"sourcesContent":["/**\n * Form field priorities for progressive disclosure\n */\nexport const FIELD_PRIORITIES = {\n ESSENTIAL: 'essential',\n COMMON: 'common', \n ADVANCED: 'advanced',\n EXPERT: 'expert'\n} as const;\n\n/**\n * Form field types\n */\nexport const FORM_FIELD_TYPES = {\n TEXT: 'text',\n NUMBER: 'number',\n SELECT: 'select',\n CHECKBOX: 'checkbox',\n TEXTAREA: 'textarea',\n FILE: 'file',\n ARRAY: 'array',\n OBJECT: 'object',\n CURRENCY: 'currency',\n PERCENTAGE: 'percentage',\n} as const;"],"names":[],"mappings":"AAGO,MAAM,mBAAmB;AAAA,EAC9B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AACV;"}
|
package/dist/esm/index47.js
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const DEFAULT_CONTENT_REFERENCE_CONFIG = {
|
|
2
|
+
sizeThresholdBytes: 10 * 1024,
|
|
3
|
+
maxAgeMs: 60 * 60 * 1e3,
|
|
4
|
+
maxReferences: 100,
|
|
5
|
+
maxTotalStorageBytes: 100 * 1024 * 1024,
|
|
6
|
+
enableAutoCleanup: true,
|
|
7
|
+
cleanupIntervalMs: 5 * 60 * 1e3,
|
|
8
|
+
enablePersistence: false,
|
|
9
|
+
storageBackend: "memory",
|
|
10
|
+
cleanupPolicies: {
|
|
11
|
+
recent: { maxAgeMs: 30 * 60 * 1e3, priority: 1 },
|
|
12
|
+
userContent: { maxAgeMs: 2 * 60 * 60 * 1e3, priority: 2 },
|
|
13
|
+
agentGenerated: { maxAgeMs: 60 * 60 * 1e3, priority: 3 },
|
|
14
|
+
default: { maxAgeMs: 60 * 60 * 1e3, priority: 4 }
|
|
15
|
+
}
|
|
6
16
|
};
|
|
17
|
+
class ContentReferenceError extends Error {
|
|
18
|
+
constructor(message, type, referenceId, suggestedActions) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.type = type;
|
|
21
|
+
this.referenceId = referenceId;
|
|
22
|
+
this.suggestedActions = suggestedActions;
|
|
23
|
+
this.name = "ContentReferenceError";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
7
26
|
export {
|
|
8
|
-
|
|
27
|
+
ContentReferenceError,
|
|
28
|
+
DEFAULT_CONTENT_REFERENCE_CONFIG
|
|
9
29
|
};
|
|
10
30
|
//# sourceMappingURL=index47.js.map
|
package/dist/esm/index47.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index47.js","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index47.js","sources":["../../src/types/content-reference.ts"],"sourcesContent":["/**\n * Content Reference System Types\n *\n * Shared interfaces for the Reference-Based Content System that handles\n * large content storage with unique reference IDs to optimize context window usage.\n */\n\n/**\n * Unique identifier for stored content references\n * Format: Cryptographically secure 32-byte identifier with base64url encoding\n */\nexport type ReferenceId = string;\n\n/**\n * Lifecycle state of a content reference\n */\nexport type ReferenceLifecycleState =\n | 'active'\n | 'expired'\n | 'cleanup_pending'\n | 'invalid';\n\n/**\n * Content types supported by the reference system\n */\nexport type ContentType =\n | 'text'\n | 'json'\n | 'html'\n | 'markdown'\n | 'binary'\n | 'unknown';\n\n/**\n * Sources that created the content reference\n */\nexport type ContentSource =\n | 'mcp_tool'\n | 'user_upload'\n | 'agent_generated'\n | 'system';\n\n/**\n * Metadata associated with stored content\n */\nexport interface ContentMetadata {\n /** Content type classification */\n contentType: ContentType;\n\n /** MIME type of the original content */\n mimeType?: string;\n\n /** Size in bytes of the stored content */\n sizeBytes: number;\n\n /** When the content was originally stored */\n createdAt: Date;\n\n /** Last time the content was accessed via reference resolution */\n lastAccessedAt: Date;\n\n /** Source that created this content reference */\n source: ContentSource;\n\n /** Name of the MCP tool that generated the content (if applicable) */\n mcpToolName?: string;\n\n /** Original filename or suggested name for the content */\n fileName?: string;\n\n /** Number of times this reference has been resolved */\n accessCount: number;\n\n /** Tags for categorization and cleanup policies */\n tags?: string[];\n\n /** Custom metadata from the source */\n customMetadata?: Record<string, unknown>;\n}\n\n/**\n * Core content reference object passed through agent context\n * Designed to be lightweight (<100 tokens) while providing enough\n * information for agent decision-making\n */\nexport interface ContentReference {\n /** Unique identifier for resolving the content */\n referenceId: ReferenceId;\n\n /** Current lifecycle state */\n state: ReferenceLifecycleState;\n\n /** Brief description or preview of the content (max 200 chars) */\n preview: string;\n\n /** Essential metadata for agent decision-making */\n metadata: Pick<\n ContentMetadata,\n 'contentType' | 'sizeBytes' | 'source' | 'fileName' | 'mimeType'\n >;\n\n /** When this reference was created */\n createdAt: Date;\n\n /** Special format indicator for reference IDs in content */\n readonly format: 'ref://{id}';\n}\n\n/**\n * Result of attempting to resolve a content reference\n */\nexport interface ReferenceResolutionResult {\n /** Whether the resolution was successful */\n success: boolean;\n\n /** The resolved content if successful */\n content?: Buffer;\n\n /** Complete metadata if successful */\n metadata?: ContentMetadata;\n\n /** Error message if resolution failed */\n error?: string;\n\n /** Specific error type for targeted error handling */\n errorType?:\n | 'not_found'\n | 'expired'\n | 'corrupted'\n | 'access_denied'\n | 'system_error';\n\n /** Suggested actions for recovery */\n suggestedActions?: string[];\n}\n\n/**\n * Configuration for content reference storage and lifecycle\n */\nexport interface ContentReferenceConfig {\n /** Size threshold above which content should be stored as references (default: 10KB) */\n sizeThresholdBytes: number;\n\n /** Maximum age for unused references before cleanup (default: 1 hour) */\n maxAgeMs: number;\n\n /** Maximum number of references to store simultaneously */\n maxReferences: number;\n\n /** Maximum total storage size for all references */\n maxTotalStorageBytes: number;\n\n /** Whether to enable automatic cleanup */\n enableAutoCleanup: boolean;\n\n /** Interval for cleanup checks in milliseconds */\n cleanupIntervalMs: number;\n\n /** Whether to persist references across restarts */\n enablePersistence: boolean;\n\n /** Storage backend configuration */\n storageBackend: 'memory' | 'filesystem' | 'hybrid';\n\n /** Cleanup policies for different content types */\n cleanupPolicies: {\n /** Policy for content marked as \"recent\" from MCP tools */\n recent: { maxAgeMs: number; priority: number };\n\n /** Policy for user-uploaded content */\n userContent: { maxAgeMs: number; priority: number };\n\n /** Policy for agent-generated content */\n agentGenerated: { maxAgeMs: number; priority: number };\n\n /** Default policy for other content */\n default: { maxAgeMs: number; priority: number };\n };\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_CONTENT_REFERENCE_CONFIG: ContentReferenceConfig = {\n sizeThresholdBytes: 10 * 1024,\n maxAgeMs: 60 * 60 * 1000,\n maxReferences: 100,\n maxTotalStorageBytes: 100 * 1024 * 1024,\n enableAutoCleanup: true,\n cleanupIntervalMs: 5 * 60 * 1000,\n enablePersistence: false,\n storageBackend: 'memory',\n cleanupPolicies: {\n recent: { maxAgeMs: 30 * 60 * 1000, priority: 1 },\n userContent: { maxAgeMs: 2 * 60 * 60 * 1000, priority: 2 },\n agentGenerated: { maxAgeMs: 60 * 60 * 1000, priority: 3 },\n default: { maxAgeMs: 60 * 60 * 1000, priority: 4 },\n },\n};\n\n/**\n * Statistics about content reference usage and storage\n */\nexport interface ContentReferenceStats {\n /** Total number of active references */\n activeReferences: number;\n\n /** Total storage used by all references in bytes */\n totalStorageBytes: number;\n\n /** Number of references cleaned up in last cleanup cycle */\n recentlyCleanedUp: number;\n\n /** Number of successful reference resolutions since startup */\n totalResolutions: number;\n\n /** Number of failed resolution attempts */\n failedResolutions: number;\n\n /** Average content size in bytes */\n averageContentSize: number;\n\n /** Most frequently accessed reference ID */\n mostAccessedReferenceId?: ReferenceId;\n\n /** Storage utilization percentage */\n storageUtilization: number;\n\n /** Performance metrics */\n performanceMetrics: {\n /** Average time to create a reference in milliseconds */\n averageCreationTimeMs: number;\n\n /** Average time to resolve a reference in milliseconds */\n averageResolutionTimeMs: number;\n\n /** Average cleanup time in milliseconds */\n averageCleanupTimeMs: number;\n };\n}\n\n/**\n * Error types for content reference operations\n */\nexport class ContentReferenceError extends Error {\n constructor(\n message: string,\n public readonly type: ReferenceResolutionResult['errorType'],\n public readonly referenceId?: ReferenceId,\n public readonly suggestedActions?: string[]\n ) {\n super(message);\n this.name = 'ContentReferenceError';\n }\n}\n\n/**\n * Interface for content reference storage implementations\n */\nexport interface ContentReferenceStore {\n /**\n * Store content and return a reference\n */\n storeContent(\n content: Buffer,\n metadata: Omit<\n ContentMetadata,\n 'createdAt' | 'lastAccessedAt' | 'accessCount'\n >\n ): Promise<ContentReference>;\n\n /**\n * Resolve a reference to its content\n */\n resolveReference(\n referenceId: ReferenceId\n ): Promise<ReferenceResolutionResult>;\n\n /**\n * Check if a reference exists and is valid\n */\n hasReference(referenceId: ReferenceId): Promise<boolean>;\n\n /**\n * Mark a reference for cleanup\n */\n cleanupReference(referenceId: ReferenceId): Promise<boolean>;\n\n /**\n * Get current storage statistics\n */\n getStats(): Promise<ContentReferenceStats>;\n\n /**\n * Update configuration\n */\n updateConfig(config: Partial<ContentReferenceConfig>): Promise<void>;\n\n /**\n * Perform cleanup based on current policies\n */\n performCleanup(): Promise<{ cleanedUp: number; errors: string[] }>;\n\n /**\n * Dispose of resources\n */\n dispose(): Promise<void>;\n}\n"],"names":[],"mappings":"AAuLO,MAAM,mCAA2D;AAAA,EACtE,oBAAoB,KAAK;AAAA,EACzB,UAAU,KAAK,KAAK;AAAA,EACpB,eAAe;AAAA,EACf,sBAAsB,MAAM,OAAO;AAAA,EACnC,mBAAmB;AAAA,EACnB,mBAAmB,IAAI,KAAK;AAAA,EAC5B,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,IACf,QAAQ,EAAE,UAAU,KAAK,KAAK,KAAM,UAAU,EAAA;AAAA,IAC9C,aAAa,EAAE,UAAU,IAAI,KAAK,KAAK,KAAM,UAAU,EAAA;AAAA,IACvD,gBAAgB,EAAE,UAAU,KAAK,KAAK,KAAM,UAAU,EAAA;AAAA,IACtD,SAAS,EAAE,UAAU,KAAK,KAAK,KAAM,UAAU,EAAA;AAAA,EAAE;AAErD;AA8CO,MAAM,8BAA8B,MAAM;AAAA,EAC/C,YACE,SACgB,MACA,aACA,kBAChB;AACA,UAAM,OAAO;AAJG,SAAA,OAAA;AACA,SAAA,cAAA;AACA,SAAA,mBAAA;AAGhB,SAAK,OAAO;AAAA,EACd;AACF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/conversational-agent",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.212",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/cjs/index.cjs",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -28,30 +28,6 @@
|
|
|
28
28
|
"LICENSE",
|
|
29
29
|
"README.md"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"test": "jest --detectOpenHandles",
|
|
33
|
-
"test:integration": "jest tests/integration",
|
|
34
|
-
"clean": "rimraf dist",
|
|
35
|
-
"build:es": "BUILD_FORMAT=es vite build",
|
|
36
|
-
"build:cjs": "BUILD_FORMAT=cjs vite build",
|
|
37
|
-
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
38
|
-
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs",
|
|
39
|
-
"build:all": "pnpm run build && pnpm run cli:build",
|
|
40
|
-
"prepublishOnly": "pnpm run build",
|
|
41
|
-
"release": "pnpm publish --access public",
|
|
42
|
-
"release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
|
|
43
|
-
"version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
|
|
44
|
-
"publish:canary": "pnpm run version:canary && pnpm run release:canary",
|
|
45
|
-
"lint": "eslint .",
|
|
46
|
-
"lint:fix": "eslint . --fix",
|
|
47
|
-
"typecheck": "tsc --noEmit",
|
|
48
|
-
"cli:build": "cd cli && pnpm install && pnpm build",
|
|
49
|
-
"cli": "tsx cli/scripts/run-cli.ts",
|
|
50
|
-
"cli:dev": "cd cli && pnpm dev",
|
|
51
|
-
"example:mcp-filesystem": "tsx examples/mcp-filesystem-demo.ts",
|
|
52
|
-
"example:mcp-multi": "tsx examples/mcp-multi-server-demo.ts",
|
|
53
|
-
"postinstall": "cd cli && pnpm install --silent 2>/dev/null || true"
|
|
54
|
-
},
|
|
55
31
|
"keywords": [
|
|
56
32
|
"hedera",
|
|
57
33
|
"hashgraph",
|
|
@@ -100,7 +76,7 @@
|
|
|
100
76
|
"dependencies": {
|
|
101
77
|
"@hashgraph/sdk": "^2.72.0",
|
|
102
78
|
"@hashgraphonline/hashinal-wc": "^1.0.107",
|
|
103
|
-
"@hashgraphonline/standards-agent-kit": "^0.2.
|
|
79
|
+
"@hashgraphonline/standards-agent-kit": "^0.2.158",
|
|
104
80
|
"@hashgraphonline/standards-sdk": "0.1.110",
|
|
105
81
|
"@langchain/anthropic": "^0.3.28",
|
|
106
82
|
"@langchain/core": "^0.3.77",
|
|
@@ -127,11 +103,27 @@
|
|
|
127
103
|
"url": "https://github.com/hashgraph-online/conversational-agent/issues"
|
|
128
104
|
},
|
|
129
105
|
"homepage": "https://github.com/hashgraph-online/conversational-agent#readme",
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
106
|
+
"scripts": {
|
|
107
|
+
"test": "jest --detectOpenHandles",
|
|
108
|
+
"test:integration": "jest tests/integration",
|
|
109
|
+
"clean": "rimraf dist",
|
|
110
|
+
"build:es": "BUILD_FORMAT=es vite build",
|
|
111
|
+
"build:cjs": "BUILD_FORMAT=cjs vite build",
|
|
112
|
+
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
113
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs",
|
|
114
|
+
"build:all": "pnpm run build && pnpm run cli:build",
|
|
115
|
+
"release": "pnpm publish --access public",
|
|
116
|
+
"release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
|
|
117
|
+
"version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
|
|
118
|
+
"publish:canary": "pnpm run version:canary && pnpm run release:canary",
|
|
119
|
+
"lint": "eslint .",
|
|
120
|
+
"lint:fix": "eslint . --fix",
|
|
121
|
+
"typecheck": "tsc --noEmit",
|
|
122
|
+
"cli:build": "cd cli && pnpm install && pnpm build",
|
|
123
|
+
"cli": "tsx cli/scripts/run-cli.ts",
|
|
124
|
+
"cli:dev": "cd cli && pnpm dev",
|
|
125
|
+
"example:mcp-filesystem": "tsx examples/mcp-filesystem-demo.ts",
|
|
126
|
+
"example:mcp-multi": "tsx examples/mcp-multi-server-demo.ts",
|
|
127
|
+
"postinstall": "cd cli && pnpm install --silent 2>/dev/null || true"
|
|
136
128
|
}
|
|
137
|
-
}
|
|
129
|
+
}
|
package/cli/readme.md
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
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
|