@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. https://hol.org
235 lines (234 loc) • 10.4 kB
TypeScript
import { AIAgentCapability } from '@hashgraphonline/standards-sdk';
import { z } from 'zod';
import { BaseServiceBuilder } from 'hedera-agent-kit';
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
import { BaseHCS10TransactionTool } from './base-hcs10-tools';
import { HCS10TransactionToolParams } from './hcs10-tool-params';
declare const RegisterAgentZodSchema: z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
alias: z.ZodEffects<z.ZodOptional<z.ZodString>, string, string | undefined>;
type: z.ZodOptional<z.ZodEnum<["autonomous", "manual"]>>;
model: z.ZodOptional<z.ZodString>;
capabilities: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodNativeEnum<typeof AIAgentCapability>, "many">, z.ZodArray<z.ZodString, "many">, z.ZodString]>>, AIAgentCapability[] | undefined, string | string[] | AIAgentCapability[] | undefined>;
tags: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>, AIAgentCapability[] | undefined, string | string[] | undefined>;
creator: z.ZodOptional<z.ZodString>;
socials: z.ZodOptional<z.ZodRecord<z.ZodEnum<["twitter", "github", "discord", "telegram", "linkedin", "youtube", "website", "x"]>, z.ZodString>>;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
profilePicture: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
url: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodString>;
filename: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
}, {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
}>]>>;
existingProfilePictureTopicId: z.ZodOptional<z.ZodString>;
initialBalance: z.ZodOptional<z.ZodNumber>;
userAccountId: z.ZodOptional<z.ZodString>;
hbarFee: z.ZodOptional<z.ZodNumber>;
tokenFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
amount: z.ZodNumber;
tokenId: z.ZodString;
}, "strip", z.ZodTypeAny, {
amount: number;
tokenId: string;
}, {
amount: number;
tokenId: string;
}>, "many">>;
exemptAccountIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
setAsCurrent: z.ZodOptional<z.ZodBoolean>;
persistence: z.ZodOptional<z.ZodObject<{
prefix: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
prefix?: string | undefined;
}, {
prefix?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
alias: string;
tokenFees?: {
amount: number;
tokenId: string;
}[] | undefined;
exemptAccountIds?: string[] | undefined;
type?: "autonomous" | "manual" | undefined;
description?: string | undefined;
model?: string | undefined;
capabilities?: AIAgentCapability[] | undefined;
tags?: AIAgentCapability[] | undefined;
creator?: string | undefined;
socials?: Partial<Record<"twitter" | "github" | "discord" | "telegram" | "linkedin" | "youtube" | "website" | "x", string>> | undefined;
properties?: Record<string, unknown> | undefined;
profilePicture?: string | {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
} | undefined;
existingProfilePictureTopicId?: string | undefined;
initialBalance?: number | undefined;
userAccountId?: string | undefined;
hbarFee?: number | undefined;
setAsCurrent?: boolean | undefined;
persistence?: {
prefix?: string | undefined;
} | undefined;
}, {
name: string;
tokenFees?: {
amount: number;
tokenId: string;
}[] | undefined;
exemptAccountIds?: string[] | undefined;
type?: "autonomous" | "manual" | undefined;
description?: string | undefined;
alias?: string | undefined;
model?: string | undefined;
capabilities?: string | string[] | AIAgentCapability[] | undefined;
tags?: string | string[] | undefined;
creator?: string | undefined;
socials?: Partial<Record<"twitter" | "github" | "discord" | "telegram" | "linkedin" | "youtube" | "website" | "x", string>> | undefined;
properties?: Record<string, unknown> | undefined;
profilePicture?: string | {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
} | undefined;
existingProfilePictureTopicId?: string | undefined;
initialBalance?: number | undefined;
userAccountId?: string | undefined;
hbarFee?: number | undefined;
setAsCurrent?: boolean | undefined;
persistence?: {
prefix?: string | undefined;
} | undefined;
}>;
export declare class RegisterAgentTool extends BaseHCS10TransactionTool<typeof RegisterAgentZodSchema> {
name: string;
description: string;
specificInputSchema: z.ZodObject<{
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
alias: z.ZodEffects<z.ZodOptional<z.ZodString>, string, string | undefined>;
type: z.ZodOptional<z.ZodEnum<["autonomous", "manual"]>>;
model: z.ZodOptional<z.ZodString>;
capabilities: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodNativeEnum<typeof AIAgentCapability>, "many">, z.ZodArray<z.ZodString, "many">, z.ZodString]>>, AIAgentCapability[] | undefined, string | string[] | AIAgentCapability[] | undefined>;
tags: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodString]>>, AIAgentCapability[] | undefined, string | string[] | undefined>;
creator: z.ZodOptional<z.ZodString>;
socials: z.ZodOptional<z.ZodRecord<z.ZodEnum<["twitter", "github", "discord", "telegram", "linkedin", "youtube", "website", "x"]>, z.ZodString>>;
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
profilePicture: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
url: z.ZodOptional<z.ZodString>;
path: z.ZodOptional<z.ZodString>;
filename: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
}, {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
}>]>>;
existingProfilePictureTopicId: z.ZodOptional<z.ZodString>;
initialBalance: z.ZodOptional<z.ZodNumber>;
userAccountId: z.ZodOptional<z.ZodString>;
hbarFee: z.ZodOptional<z.ZodNumber>;
tokenFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
amount: z.ZodNumber;
tokenId: z.ZodString;
}, "strip", z.ZodTypeAny, {
amount: number;
tokenId: string;
}, {
amount: number;
tokenId: string;
}>, "many">>;
exemptAccountIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
setAsCurrent: z.ZodOptional<z.ZodBoolean>;
persistence: z.ZodOptional<z.ZodObject<{
prefix: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
prefix?: string | undefined;
}, {
prefix?: string | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
name: string;
alias: string;
tokenFees?: {
amount: number;
tokenId: string;
}[] | undefined;
exemptAccountIds?: string[] | undefined;
type?: "autonomous" | "manual" | undefined;
description?: string | undefined;
model?: string | undefined;
capabilities?: AIAgentCapability[] | undefined;
tags?: AIAgentCapability[] | undefined;
creator?: string | undefined;
socials?: Partial<Record<"twitter" | "github" | "discord" | "telegram" | "linkedin" | "youtube" | "website" | "x", string>> | undefined;
properties?: Record<string, unknown> | undefined;
profilePicture?: string | {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
} | undefined;
existingProfilePictureTopicId?: string | undefined;
initialBalance?: number | undefined;
userAccountId?: string | undefined;
hbarFee?: number | undefined;
setAsCurrent?: boolean | undefined;
persistence?: {
prefix?: string | undefined;
} | undefined;
}, {
name: string;
tokenFees?: {
amount: number;
tokenId: string;
}[] | undefined;
exemptAccountIds?: string[] | undefined;
type?: "autonomous" | "manual" | undefined;
description?: string | undefined;
alias?: string | undefined;
model?: string | undefined;
capabilities?: string | string[] | AIAgentCapability[] | undefined;
tags?: string | string[] | undefined;
creator?: string | undefined;
socials?: Partial<Record<"twitter" | "github" | "discord" | "telegram" | "linkedin" | "youtube" | "website" | "x", string>> | undefined;
properties?: Record<string, unknown> | undefined;
profilePicture?: string | {
filename?: string | undefined;
url?: string | undefined;
path?: string | undefined;
} | undefined;
existingProfilePictureTopicId?: string | undefined;
initialBalance?: number | undefined;
userAccountId?: string | undefined;
hbarFee?: number | undefined;
setAsCurrent?: boolean | undefined;
persistence?: {
prefix?: string | undefined;
} | undefined;
}>;
private specificArgs;
constructor(params: HCS10TransactionToolParams);
protected callBuilderMethod(builder: BaseServiceBuilder, specificArgs: z.infer<typeof RegisterAgentZodSchema>): Promise<void>;
/**
* Override _call to intercept the result and save agent to state if needed
*/
protected _call(args: z.infer<ReturnType<this['schema']>>, runManager?: CallbackManagerForToolRun): Promise<string>;
/**
* Extract agent data from registration result and save to state
*/
private _handleRegistrationResult;
}
export {};