UNPKG

@hashgraphonline/standards-agent-kit

Version:

A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.

107 lines (106 loc) 3.91 kB
import { GenericPlugin } from "./standards-agent-kit.es22.js"; import { HCS10Client } from "./standards-agent-kit.es2.js"; import { OpenConvaiState } from "./standards-agent-kit.es16.js"; import { RegisterAgentTool } from "./standards-agent-kit.es3.js"; import { SendMessageTool } from "./standards-agent-kit.es4.js"; import { ConnectionTool } from "./standards-agent-kit.es5.js"; import { FindRegistrationsTool } from "./standards-agent-kit.es10.js"; import { InitiateConnectionTool } from "./standards-agent-kit.es7.js"; import { ListConnectionsTool } from "./standards-agent-kit.es8.js"; import { SendMessageToConnectionTool } from "./standards-agent-kit.es6.js"; import { CheckMessagesTool } from "./standards-agent-kit.es9.js"; import { ConnectionMonitorTool } from "./standards-agent-kit.es11.js"; import { ManageConnectionRequestsTool } from "./standards-agent-kit.es12.js"; import { AcceptConnectionRequestTool } from "./standards-agent-kit.es13.js"; import { RetrieveProfileTool } from "./standards-agent-kit.es14.js"; import { ListUnapprovedConnectionRequestsTool } from "./standards-agent-kit.es15.js"; class OpenConvAIPlugin extends GenericPlugin { constructor() { super(...arguments); this.id = "openconvai-standards-agent-kit"; this.name = "OpenConvAI Standards Agent Kit Plugin"; this.description = "Comprehensive plugin providing all HCS-10 agent tools for registration, connections, and messaging"; this.version = "1.0.0"; this.author = "Hashgraph Online"; this.namespace = "openconvai"; this.tools = []; } async initialize(context) { await super.initialize(context); if (!(context.client instanceof HCS10Client)) { throw new Error("OpenConvAIPlugin requires an HCS10Client instance"); } this.hcs10Client = context.client; this.stateManager = context.stateManager || new OpenConvaiState(); this.initializeTools(); this.context.logger.info( "OpenConvAI Standards Agent Kit Plugin initialized successfully" ); } initializeTools() { if (!this.hcs10Client || !this.stateManager) { throw new Error( "HCS10Client and StateManager must be initialized before creating tools" ); } this.tools = [ new RegisterAgentTool(this.hcs10Client, this.stateManager), new SendMessageTool(this.hcs10Client), new ConnectionTool({ client: this.hcs10Client, stateManager: this.stateManager }), new FindRegistrationsTool({ hcsClient: this.hcs10Client }), new RetrieveProfileTool(this.hcs10Client), new InitiateConnectionTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new ListConnectionsTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new SendMessageToConnectionTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new CheckMessagesTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new ConnectionMonitorTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new ManageConnectionRequestsTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new AcceptConnectionRequestTool({ hcsClient: this.hcs10Client, stateManager: this.stateManager }), new ListUnapprovedConnectionRequestsTool({ stateManager: this.stateManager, hcsClient: this.hcs10Client }) ]; } getTools() { return this.tools; } async cleanup() { this.tools = []; this.hcs10Client = void 0; this.stateManager = void 0; this.context.logger.info( "OpenConvAI Standards Agent Kit Plugin cleaned up" ); } } export { OpenConvAIPlugin }; //# sourceMappingURL=standards-agent-kit.es23.js.map