@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.
46 lines (45 loc) • 1.46 kB
JavaScript
import { z } from "zod";
import { BaseHCS10QueryTool } from "./standards-agent-kit.es7.js";
const RetrieveProfileZodSchema = z.object({
accountId: z.string().describe(
"The Hedera account ID of the agent whose profile you want to retrieve (e.g., 0.0.12345)."
),
disableCache: z.boolean().optional().describe(
"Optional: Force refresh from the network instead of using cache."
)
});
class RetrieveProfileTool extends BaseHCS10QueryTool {
constructor(params) {
super(params);
this.name = "retrieve_profile";
this.description = "Gets the detailed profile information for a specific HCS-10 agent by their account ID. Returns name, bio, capabilities, topics, and other metadata.";
this.specificInputSchema = RetrieveProfileZodSchema;
}
async executeQuery({
accountId,
disableCache
}) {
const hcs10Builder = this.hcs10Builder;
const params = {
accountId
};
if (disableCache !== void 0) {
params.disableCache = disableCache;
}
await hcs10Builder.retrieveProfile(params);
const result = await hcs10Builder.execute();
if (result.success && "rawResult" in result && result.rawResult) {
const raw = result.rawResult;
return {
success: true,
data: raw.profileDetails || "Profile retrieved",
rawProfile: raw.rawProfile
};
}
return result;
}
}
export {
RetrieveProfileTool
};
//# sourceMappingURL=standards-agent-kit.es17.js.map