@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.
54 lines (53 loc) • 1.95 kB
TypeScript
import { StructuredTool, ToolParams } from '@langchain/core/tools';
import { z } from 'zod';
import { IStateManager } from '../state/state-types';
import { HCS10Client } from '../hcs10/HCS10Client';
type ListPendingRequestsToolParams = ToolParams & {
hcsClient: HCS10Client;
stateManager: IStateManager;
};
export declare class ListUnapprovedConnectionRequestsTool extends StructuredTool {
name: string;
description: string;
schema: z.ZodObject<{
sortBy: z.ZodOptional<z.ZodEnum<["time_asc", "time_desc", "name_asc", "name_desc"]>>;
limit: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
sortBy?: "time_asc" | "time_desc" | "name_asc" | "name_desc" | undefined;
limit?: number | undefined;
}, {
sortBy?: "time_asc" | "time_desc" | "name_asc" | "name_desc" | undefined;
limit?: number | undefined;
}>;
private hcsClient;
private stateManager;
private logger;
constructor({ hcsClient, stateManager, ...rest }: ListPendingRequestsToolParams);
protected _call({ sortBy, limit, }: z.infer<this['schema']>): Promise<string>;
/**
* Processes the connection connectionMap to find all requests
* that are not fully established (incoming unapproved and outgoing pending).
*/
private findAllPendingRequests;
/**
* Helper to attempt extracting target account ID from outbound request message.
*/
private extractTargetAccountIdFromOutbound;
/**
* Maps HCS11Profile to the AgentProfileInfo used in state/display.
*/
private mapSDKProfileToInfo;
/**
* Extracts the account ID from relevant fields in an HCSMessage.
*/
private extractAccountIdFromMessage;
/**
* Formats the list of pending requests for display.
*/
private formatRequestsList;
/**
* Sorts connection requests based on the specified criteria.
*/
private sortRequests;
}
export {};