@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.
36 lines (35 loc) • 1.37 kB
JavaScript
import { z } from "zod";
import { BaseHCS10QueryTool } from "./standards-agent-kit.es7.js";
const ManageConnectionRequestsZodSchema = z.object({
action: z.enum(["list", "view", "reject"]).describe(
"The action to perform: list all requests, view details of a specific request, or reject a request"
),
requestKey: z.string().optional().describe(
"The unique request key to view or reject (required for view and reject actions)"
)
});
class ManageConnectionRequestsTool extends BaseHCS10QueryTool {
constructor(params) {
super(params);
this.name = "manage_connection_requests";
this.description = 'Manage incoming connection requests. List pending requests, view details about requesting agents, and reject connection requests. Use the separate "accept_connection_request" tool to accept.';
this.specificInputSchema = ManageConnectionRequestsZodSchema;
}
async executeQuery({
action,
requestKey
}) {
const hcs10Builder = this.hcs10Builder;
const params = { action };
if (requestKey !== void 0) {
params.requestKey = requestKey;
}
await hcs10Builder.manageConnectionRequests(params);
const result = await hcs10Builder.execute();
return "rawResult" in result ? result.rawResult : result;
}
}
export {
ManageConnectionRequestsTool
};
//# sourceMappingURL=standards-agent-kit.es15.js.map