@hashgraphonline/standards-sdk 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/hcs-10/base-client.d.ts +56 -1
- package/dist/es/hcs-10/base-client.d.ts.map +1 -1
- package/dist/es/hcs-10/browser.d.ts +9 -20
- package/dist/es/hcs-10/browser.d.ts.map +1 -1
- package/dist/es/hcs-10/sdk.d.ts +7 -79
- package/dist/es/hcs-10/sdk.d.ts.map +1 -1
- package/dist/es/hcs-10/types.d.ts +7 -0
- package/dist/es/hcs-10/types.d.ts.map +1 -1
- package/dist/es/hcs-11/index.d.ts +1 -1
- package/dist/es/hcs-11/index.d.ts.map +1 -1
- package/dist/es/inscribe/types.d.ts +1 -1
- package/dist/es/inscribe/types.d.ts.map +1 -1
- package/dist/es/services/mirror-node.d.ts.map +1 -1
- package/dist/es/standards-sdk.es10.js +122 -115
- package/dist/es/standards-sdk.es10.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +1 -1
- package/dist/es/standards-sdk.es102.js +6 -6
- package/dist/es/standards-sdk.es103.js +3 -3
- package/dist/es/standards-sdk.es110.js +1 -1
- package/dist/es/standards-sdk.es111.js +2 -2
- package/dist/es/standards-sdk.es12.js.map +1 -1
- package/dist/es/standards-sdk.es13.js +1 -1
- package/dist/es/standards-sdk.es16.js +1 -1
- package/dist/es/standards-sdk.es17.js +1 -3
- package/dist/es/standards-sdk.es17.js.map +1 -1
- package/dist/es/standards-sdk.es18.js.map +1 -1
- package/dist/es/standards-sdk.es21.js +948 -6531
- package/dist/es/standards-sdk.es21.js.map +1 -1
- package/dist/es/standards-sdk.es23.js +17 -17
- package/dist/es/standards-sdk.es24.js +6624 -2
- package/dist/es/standards-sdk.es24.js.map +1 -1
- package/dist/es/standards-sdk.es25.js +5 -1041
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +2 -5
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +1 -1
- package/dist/es/standards-sdk.es30.js +2 -2
- package/dist/es/standards-sdk.es31.js +2282 -419
- package/dist/es/standards-sdk.es31.js.map +1 -1
- package/dist/es/standards-sdk.es32.js +2 -2
- package/dist/es/standards-sdk.es32.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +412 -113
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +2 -2282
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +120 -2
- package/dist/es/standards-sdk.es35.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +2 -29
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +29 -2
- package/dist/es/standards-sdk.es37.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +346 -68
- package/dist/es/standards-sdk.es38.js.map +1 -1
- package/dist/es/standards-sdk.es39.js +5 -22
- package/dist/es/standards-sdk.es39.js.map +1 -1
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es40.js +166 -135
- package/dist/es/standards-sdk.es40.js.map +1 -1
- package/dist/es/standards-sdk.es41.js +72 -82
- package/dist/es/standards-sdk.es41.js.map +1 -1
- package/dist/es/standards-sdk.es42.js +105 -165
- package/dist/es/standards-sdk.es42.js.map +1 -1
- package/dist/es/standards-sdk.es43.js +47 -190
- package/dist/es/standards-sdk.es43.js.map +1 -1
- package/dist/es/standards-sdk.es44.js +10 -438
- package/dist/es/standards-sdk.es44.js.map +1 -1
- package/dist/es/standards-sdk.es45.js +91 -19
- package/dist/es/standards-sdk.es45.js.map +1 -1
- package/dist/es/standards-sdk.es46.js +3 -138
- package/dist/es/standards-sdk.es46.js.map +1 -1
- package/dist/es/standards-sdk.es47.js +2 -18
- package/dist/es/standards-sdk.es47.js.map +1 -1
- package/dist/es/standards-sdk.es48.js +105 -22
- package/dist/es/standards-sdk.es48.js.map +1 -1
- package/dist/es/standards-sdk.es49.js +71 -26
- package/dist/es/standards-sdk.es49.js.map +1 -1
- package/dist/es/standards-sdk.es5.js +112 -444
- package/dist/es/standards-sdk.es5.js.map +1 -1
- package/dist/es/standards-sdk.es50.js +5 -20
- package/dist/es/standards-sdk.es50.js.map +1 -1
- package/dist/es/standards-sdk.es51.js +4 -43
- package/dist/es/standards-sdk.es51.js.map +1 -1
- package/dist/es/standards-sdk.es52.js +216 -13
- package/dist/es/standards-sdk.es52.js.map +1 -1
- package/dist/es/standards-sdk.es53.js +54 -57
- package/dist/es/standards-sdk.es53.js.map +1 -1
- package/dist/es/standards-sdk.es54.js +67 -1287
- package/dist/es/standards-sdk.es54.js.map +1 -1
- package/dist/es/standards-sdk.es55.js +190 -27
- package/dist/es/standards-sdk.es55.js.map +1 -1
- package/dist/es/standards-sdk.es56.js +437 -5
- package/dist/es/standards-sdk.es56.js.map +1 -1
- package/dist/es/standards-sdk.es57.js +21 -155
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +123 -777
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +13 -138
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +26 -24
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +27 -24
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +19 -36
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +39 -357
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +17 -5
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +50 -168
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +1287 -79
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +136 -102
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +85 -46
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +84 -10
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es70.js +26 -91
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +5 -3
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +159 -2
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +21 -110
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +790 -71
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +142 -5
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +173 -4
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +26 -215
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +60 -55
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +50 -69
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +167 -0
- package/dist/es/standards-sdk.es8.js.map +1 -1
- package/dist/es/standards-sdk.es80.js +9 -20
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +60 -27
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +6 -63
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +12 -47
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +7 -10
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +41 -61
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +2 -6
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +134 -13
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +171 -6
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +21 -45
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es9.js +1 -1
- package/dist/es/standards-sdk.es90.js +27 -2
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +26 -136
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +38 -172
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +1 -1
- package/dist/es/standards-sdk.es94.js +3 -3
- package/dist/es/standards-sdk.es99.js +1 -1
- package/dist/umd/hcs-10/base-client.d.ts +56 -1
- package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
- package/dist/umd/hcs-10/browser.d.ts +9 -20
- package/dist/umd/hcs-10/browser.d.ts.map +1 -1
- package/dist/umd/hcs-10/sdk.d.ts +7 -79
- package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
- package/dist/umd/hcs-10/types.d.ts +7 -0
- package/dist/umd/hcs-10/types.d.ts.map +1 -1
- package/dist/umd/hcs-11/index.d.ts +1 -1
- package/dist/umd/hcs-11/index.d.ts.map +1 -1
- package/dist/umd/inscribe/types.d.ts +1 -1
- package/dist/umd/inscribe/types.d.ts.map +1 -1
- package/dist/umd/services/mirror-node.d.ts.map +1 -1
- package/dist/umd/standards-sdk.umd.js +1 -1
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es10.js","sources":["../../src/hcs-10/browser.ts"],"sourcesContent":["import {\n KeyList,\n PublicKey,\n TopicCreateTransaction,\n TopicMessageSubmitTransaction,\n TransactionReceipt,\n} from '@hashgraph/sdk';\nimport { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinal-wc';\nimport { Logger, LogLevel } from '../utils/logger';\nimport {\n InscriptionSDK,\n RetrievedInscriptionResult,\n} from '@kiloscribe/inscription-sdk';\nimport { HCS10BaseClient } from './base-client';\nimport * as mime from 'mime-types';\nimport {\n HCSClientConfig,\n NetworkType,\n RegistrationResponse,\n AgentConfig,\n CreateAgentResponse,\n InscribePfpResponse,\n StoreHCS11ProfileResponse,\n AgentRegistrationResult,\n HandleConnectionRequestResponse,\n WaitForConnectionConfirmationResponse,\n RegistrationProgressCallback,\n AgentCreationState,\n GetAccountAndSignerResponse\n} from './types';\nimport { HCS11Client, AIAgentMetadata } from '../hcs-11';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { Transaction } from '@hashgraph/sdk';\nimport { AgentBuilder } from './agent-builder';\n\nconst isBrowser = typeof window !== 'undefined';\n\nexport type BrowserHCSClientConfig = {\n network: 'mainnet' | 'testnet';\n hwc: HashinalsWalletConnectSDK;\n logLevel?: LogLevel;\n prettyPrint?: boolean;\n guardedRegistryTopicId?: string;\n guardedRegistryBaseUrl?: string;\n};\n\ninterface AgentMetadata {\n name: string;\n description: string;\n version?: string;\n type?: string;\n logo?: string;\n socials?: SocialLinks;\n}\n\ninterface SocialLinks {\n twitter?: string;\n discord?: string;\n github?: string;\n website?: string;\n}\n\nexport type BrowserAgentConfig = Omit<\n AgentConfig<BrowserHCSClient>,\n 'privateKey'\n> & {\n client: BrowserHCSClient;\n};\n\nexport type RegisteredAgent = {\n outboundTopicId: string;\n inboundTopicId: string;\n pfpTopicId: string;\n profileTopicId: string;\n error?: string;\n success: boolean;\n state: AgentCreationState;\n};\n\nexport class BrowserHCSClient extends HCS10BaseClient {\n private hwc: HashinalsWalletConnectSDK;\n protected declare logger: Logger;\n private guardedRegistryBaseUrl: string;\n private hcs11Client: HCS11Client | null = null;\n\n constructor(config: BrowserHCSClientConfig) {\n super({\n network: config.network,\n logLevel: config.logLevel,\n prettyPrint: config.prettyPrint,\n });\n\n this.hwc = config.hwc;\n this.guardedRegistryBaseUrl =\n config.guardedRegistryBaseUrl || 'https://moonscape.tech';\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-Browser',\n prettyPrint: config.prettyPrint,\n });\n\n if (isBrowser) {\n try {\n const { accountId, signer } = this.getAccountAndSigner();\n\n this.hcs11Client = new HCS11Client({\n network: config.network,\n auth: {\n operatorId: accountId,\n signer: signer as any,\n },\n logLevel: config.logLevel,\n });\n } catch (err) {\n this.logger.warn(`Failed to initialize HCS11Client: ${err}`);\n }\n } else {\n this.logger.error(\n 'BrowserHCSClient initialized in server environment - browser-specific features will not be available. Use HCS10Client instead.'\n );\n }\n }\n\n async sendMessage(\n connectionTopicId: string,\n operatorId: string,\n data: string,\n memo?: string\n ): Promise<void> {\n this.logger.info('Sending message');\n const payload = {\n p: 'hcs-10',\n op: 'message',\n operator_id: operatorId,\n data,\n m: memo,\n };\n\n const payloadString = JSON.stringify(payload);\n const isLargePayload = Buffer.from(payloadString).length > 1000;\n\n if (isLargePayload) {\n this.logger.info(\n 'Message payload exceeds 1000 bytes, storing via inscription'\n );\n try {\n const contentBuffer = Buffer.from(data);\n const fileName = `message-${Date.now()}.json`;\n const inscriptionResult = await this.inscribeFile(\n contentBuffer,\n fileName\n );\n\n if (inscriptionResult?.topic_id) {\n payload.data = `hcs://1/${inscriptionResult.topic_id}`;\n this.logger.info(\n `Large message inscribed with topic ID: ${inscriptionResult.topic_id}`\n );\n } else {\n throw new Error('Failed to inscribe large message content');\n }\n } catch (error) {\n this.logger.error('Error inscribing large message:', error);\n throw new Error(\n `Failed to handle large message: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n }\n }\n\n await this.submitPayload(connectionTopicId, payload);\n }\n\n async submitConnectionRequest(\n inboundTopicId: string,\n requestingAccountId: string,\n operatorId: string,\n memo: string\n ): Promise<TransactionReceipt | undefined> {\n this.logger.info('Submitting connection request');\n const connectionRequestMessage = {\n p: 'hcs-10',\n op: 'connection_request',\n requesting_account_id: requestingAccountId,\n operator_id: operatorId,\n m: memo,\n };\n\n const response = await this.submitPayload(\n inboundTopicId,\n connectionRequestMessage\n );\n this.logger.info(\n `Submitted connection request to topic ID: ${inboundTopicId}`\n );\n\n const outboundTopic = await this.retrieveOutboundConnectTopic(\n requestingAccountId\n );\n\n if (!outboundTopic?.outboundTopic) {\n this.logger.error(\n `Failed to retrieve outbound topic for account ID: ${requestingAccountId}`\n );\n throw new Error(\n `Failed to retrieve outbound topic for account ID: ${requestingAccountId}`\n );\n }\n\n this.logger.info(\n `Retrieved outbound topic ID: ${outboundTopic.outboundTopic} for account ID: ${requestingAccountId}`\n );\n const responseSequenceNumber =\n response?.result?.topicSequenceNumber?.toNumber();\n\n if (!responseSequenceNumber) {\n throw new Error('Failed to get response sequence number');\n }\n\n await this.submitPayload(outboundTopic.outboundTopic, {\n ...connectionRequestMessage,\n outbound_topic_id: inboundTopicId,\n connection_request_id: responseSequenceNumber,\n });\n\n return response.result;\n }\n\n async recordOutboundConnectionConfirmation({\n outboundTopicId,\n connectionRequestId,\n confirmedRequestId,\n connectionTopicId,\n operatorId,\n memo,\n }: {\n outboundTopicId: string;\n connectionRequestId: number;\n confirmedRequestId: number;\n connectionTopicId: string;\n operatorId: string;\n memo: string;\n }): Promise<{\n result?: TransactionReceipt;\n error?: string;\n }> {\n const payload = {\n p: 'hcs-10',\n op: 'connection_created',\n connection_topic_id: connectionTopicId,\n outbound_topic_id: outboundTopicId,\n confirmed_request_id: confirmedRequestId,\n connection_request_id: connectionRequestId,\n operator_id: operatorId,\n m: memo,\n };\n\n return await this.submitPayload(outboundTopicId, payload);\n }\n\n async getPublicKey(accountId: string): Promise<PublicKey> {\n return await this.mirrorNode.getPublicKey(accountId);\n }\n\n async handleConnectionRequest(\n inboundTopicId: string,\n requestingAccountId: string,\n connectionId: number,\n connectionMemo: string = 'Connection accepted. Looking forward to collaborating!'\n ): Promise<HandleConnectionRequestResponse> {\n this.logger.info('Handling connection request');\n const userAccountId = this.hwc.getAccountInfo().accountId;\n if (!userAccountId) {\n throw new Error('Failed to retrieve user account ID');\n }\n\n const requesterKey = await this.mirrorNode.getPublicKey(\n requestingAccountId\n );\n const accountKey = await this.mirrorNode.getPublicKey(userAccountId);\n\n if (!accountKey) {\n throw new Error('Failed to retrieve public key');\n }\n\n const thresholdKey = new KeyList([accountKey, requesterKey], 1);\n const memo = `hcs-10:${inboundTopicId}:${connectionId}`;\n\n const transaction = new TopicCreateTransaction()\n .setTopicMemo(memo)\n .setAdminKey(thresholdKey)\n .setSubmitKey(thresholdKey);\n\n this.logger.debug('Executing topic creation transaction');\n const receipt = await this.hwc.executeTransactionWithErrorHandling(\n transaction as any,\n false\n );\n if (receipt.error) {\n this.logger.error(receipt.error);\n throw new Error(receipt.error);\n }\n\n const result = receipt.result;\n if (!result?.topicId) {\n this.logger.error('Failed to create topic: topicId is null');\n throw new Error('Failed to create topic: topicId is null');\n }\n\n const connectionTopicId = result.topicId.toString();\n const operatorId = `${inboundTopicId}@${userAccountId}`;\n const confirmedConnectionSequenceNumber = await this.confirmConnection(\n inboundTopicId,\n connectionTopicId,\n requestingAccountId,\n connectionId,\n operatorId,\n connectionMemo\n );\n\n return {\n connectionTopicId,\n confirmedConnectionSequenceNumber,\n operatorId,\n };\n }\n\n async confirmConnection(\n inboundTopicId: string,\n connectionTopicId: string,\n connectedAccountId: string,\n connectionId: number,\n operatorId: string,\n memo: string\n ): Promise<number> {\n this.logger.info('Confirming connection');\n const payload = {\n p: 'hcs-10',\n op: 'connection_created',\n connection_topic_id: connectionTopicId,\n connected_account_id: connectedAccountId,\n operator_id: operatorId,\n connection_id: connectionId,\n m: memo,\n };\n\n const transactionResponse = await this.submitPayload(\n inboundTopicId,\n payload\n );\n if (!transactionResponse?.result?.topicSequenceNumber) {\n this.logger.error(\n 'Failed to confirm connection: sequence number is null'\n );\n throw new Error('Failed to confirm connection: sequence number is null');\n }\n return transactionResponse.result.topicSequenceNumber.toNumber();\n }\n\n async submitMessage(\n topicId: string,\n content: string,\n metadata: object = {},\n memo: string = ''\n ): Promise<{\n result?: TransactionReceipt;\n error?: string;\n }> {\n this.logger.info('Submitting message');\n const payload = {\n p: 'hcs-10',\n op: 'message',\n data: {\n content,\n metadata,\n },\n m: memo,\n };\n\n return await this.submitPayload(topicId, payload);\n }\n\n /**\n * Creates an agent directly, but does not register.\n * We highly recommend calling createAndRegisterAgent instead.\n *\n * @param pfpBuffer - The buffer containing the PFP image.\n * @param pfpFileName - The name of the file containing the PFP image.\n * @param agentName - The name of the agent.\n * @param agentDescription - The description of the agent.\n * @param capabilities - The capabilities of the agent.\n * @param metadata - The metadata of the agent.\n * @param existingPfpTopicId - The topic ID of the existing PFP.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the agent creation state.\n */\n async createAgent(\n pfpBuffer: Buffer,\n pfpFileName: string,\n agentName: string,\n agentDescription: string,\n capabilities: number[],\n metadata: AgentMetadata,\n existingPfpTopicId?: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n existingState?: AgentCreationState;\n }\n ): Promise<RegisteredAgent> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'AgentCreate',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n let state =\n options?.existingState ||\n ({\n currentStage: 'init',\n completedPercentage: 0,\n createdResources: [],\n } as AgentCreationState);\n\n if (!state.outboundTopicId) {\n state.currentStage = 'topics';\n progressReporter.preparing('Creating agent outbound topic', 0, {\n state,\n });\n\n const outboundResult = await this.createTopic(\n 'hcs-10:0:60:1',\n true,\n true\n );\n if (!outboundResult.success || !outboundResult.topicId) {\n state.error =\n outboundResult.error || 'Failed to create outbound topic';\n progressReporter.failed(\n `Failed to create outbound topic: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: '',\n inboundTopicId: '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.outboundTopicId = outboundResult.topicId;\n if (state.createdResources) {\n state.createdResources.push(`outbound:${state.outboundTopicId}`);\n }\n progressReporter.preparing('Outbound topic created', 20, { state });\n } else {\n progressReporter.preparing('Using existing outbound topic', 20, {\n state,\n });\n }\n\n const accountId = this.hwc.getAccountInfo().accountId;\n if (!accountId) {\n throw new Error('Failed to retrieve user account ID');\n }\n\n if (!state.inboundTopicId) {\n const memo = `hcs-10:0:60:0:${accountId}`;\n const inboundResult = await this.createTopic(memo, true, true);\n\n if (!inboundResult.success || !inboundResult.topicId) {\n state.error = inboundResult.error || 'Failed to create inbound topic';\n progressReporter.failed(\n `Failed to create inbound topic: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.inboundTopicId = inboundResult.topicId;\n if (state.createdResources) {\n state.createdResources.push(`inbound:${state.inboundTopicId}`);\n }\n progressReporter.preparing('Inbound topic created', 40, { state });\n } else {\n progressReporter.preparing('Using existing inbound topic', 40, {\n state,\n });\n }\n\n if (!state.pfpTopicId && !existingPfpTopicId) {\n state.currentStage = 'pfp';\n progressReporter.preparing('Creating agent profile picture', 40, {\n state,\n });\n\n const pfpProgress = progressReporter.createSubProgress({\n minPercent: 40,\n maxPercent: 60,\n logPrefix: 'PFP',\n });\n\n const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName, {\n progressCallback: (data) => {\n pfpProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent || 0,\n details: { ...data.details, state },\n });\n },\n });\n\n if (!pfpResult.success) {\n state.error = pfpResult.error || 'Failed to inscribe profile picture';\n progressReporter.failed(\n `Failed to inscribe profile picture: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.pfpTopicId = pfpResult.pfpTopicId;\n state.completedPercentage = 60;\n if (state.createdResources) {\n state.createdResources.push(`pfp:${state.pfpTopicId}`);\n }\n\n progressReporter.preparing('Profile picture created', 60, { state });\n } else {\n state.pfpTopicId = existingPfpTopicId || state.pfpTopicId;\n progressReporter.preparing(\n `Using existing profile picture: ${state.pfpTopicId}`,\n 60,\n {\n state,\n }\n );\n }\n\n if (!state.profileTopicId) {\n state.currentStage = 'profile';\n progressReporter.preparing('Creating agent profile', 60, { state });\n\n const profileProgress = progressReporter.createSubProgress({\n minPercent: 60,\n maxPercent: 100,\n logPrefix: 'Profile',\n });\n\n if (!this.hcs11Client) {\n state.error = 'HCS11Client is not available in this environment';\n progressReporter.failed(state.error, { state });\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: state.pfpTopicId || '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n const storeProfileResult = await this.storeHCS11Profile(\n agentName,\n agentDescription,\n state.inboundTopicId!,\n state.outboundTopicId!,\n capabilities,\n metadata,\n undefined,\n undefined,\n state.pfpTopicId,\n {\n progressCallback: (data) => {\n profileProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent || 0,\n details: { ...data.details, state },\n });\n },\n }\n );\n\n if (!storeProfileResult.success) {\n state.error =\n storeProfileResult.error || 'Failed to store agent profile';\n progressReporter.failed(\n `Failed to store agent profile: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: state.pfpTopicId || '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.profileTopicId = storeProfileResult.profileTopicId;\n if (state.createdResources) {\n state.createdResources.push(`profile:${state.profileTopicId}`);\n }\n\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n } else {\n progressReporter.preparing('Using existing agent profile', 100, {\n state,\n });\n if (state.currentStage !== 'complete') {\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n }\n }\n\n progressReporter.completed('Agent successfully created', {\n inboundTopicId: state.inboundTopicId,\n outboundTopicId: state.outboundTopicId,\n pfpTopicId: state.pfpTopicId,\n profileTopicId: state.profileTopicId,\n state,\n });\n\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: state.pfpTopicId || '',\n profileTopicId: state.profileTopicId || '',\n success: true,\n state,\n };\n } catch (error: any) {\n this.logger.error(`Error creating agent: ${error.message}`);\n return {\n outboundTopicId: '',\n inboundTopicId: '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: `Error creating agent: ${error.message}`,\n state: {\n currentStage: 'init',\n completedPercentage: 0,\n error: error.message,\n },\n };\n }\n }\n\n private initializeRegistrationState(\n inboundTopicId: string,\n existingState?: AgentCreationState\n ): AgentCreationState {\n const state = existingState || {\n inboundTopicId,\n currentStage: 'registration',\n completedPercentage: 0,\n createdResources: [],\n };\n\n if (\n state.currentStage !== 'registration' &&\n state.currentStage !== 'complete'\n ) {\n state.currentStage = 'registration';\n }\n\n return state;\n }\n\n private updateStateForCompletedRegistration(\n state: AgentCreationState,\n inboundTopicId: string\n ): void {\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n if (state.createdResources) {\n state.createdResources.push(`registration:${inboundTopicId}`);\n }\n }\n\n async registerAgentWithGuardedRegistry(\n accountId: string,\n network: string = this.network,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n maxAttempts?: number;\n delayMs?: number;\n existingState?: AgentCreationState;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n this.logger.info('Registering agent with guarded registry');\n\n const agentProfile = await this.retrieveProfile(accountId);\n const inboundTopicId = agentProfile.topicInfo.inboundTopic;\n const state = this.initializeRegistrationState(\n inboundTopicId,\n options?.existingState\n );\n const progressReporter = new ProgressReporter({\n module: 'AgentRegistration',\n logger: this.logger,\n callback: options?.progressCallback,\n });\n\n progressReporter.preparing('Preparing agent registration', 10, {\n inboundTopicId,\n accountId,\n });\n\n const registrationResult = await this.executeRegistration(\n accountId,\n network as string,\n this.guardedRegistryBaseUrl,\n this.logger\n );\n\n if (!registrationResult.success) {\n return {\n ...registrationResult,\n state,\n };\n }\n\n progressReporter.submitting('Submitting registration to registry', 30, {\n transactionId: registrationResult.transactionId,\n });\n\n if (registrationResult.transaction) {\n const transaction = Transaction.fromBytes(\n Buffer.from(registrationResult.transaction, 'base64')\n );\n\n this.logger.info(`Processing registration transaction`);\n const txResult = await this.hwc.executeTransactionWithErrorHandling(\n transaction as any,\n true\n );\n\n if (txResult.error) {\n return {\n ...registrationResult,\n error: txResult.error,\n success: false,\n state,\n };\n }\n\n this.logger.info(`Successfully processed registration transaction`);\n }\n\n progressReporter.confirming('Confirming registration transaction', 60, {\n accountId,\n inboundTopicId,\n transactionId: registrationResult.transactionId,\n });\n\n const maxAttempts = options?.maxAttempts ?? 60;\n const delayMs = options?.delayMs ?? 2000;\n\n const confirmed = await this.waitForRegistrationConfirmation(\n registrationResult.transactionId!,\n network,\n this.guardedRegistryBaseUrl,\n maxAttempts,\n delayMs,\n this.logger\n );\n\n this.updateStateForCompletedRegistration(state, inboundTopicId);\n\n progressReporter.completed('Agent registration complete', {\n transactionId: registrationResult.transactionId,\n inboundTopicId,\n state,\n confirmed,\n });\n\n return {\n ...registrationResult,\n confirmed,\n state,\n };\n } catch (error: any) {\n this.logger.error(`Registration error: ${error.message}`);\n return {\n error: `Error during registration: ${error.message}`,\n success: false,\n state: {\n currentStage: 'registration',\n completedPercentage: 0,\n error: error.message,\n },\n };\n }\n }\n\n async createAndRegisterAgent(\n builder: AgentBuilder,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n maxAttempts?: number;\n delayMs?: number;\n existingState?: AgentCreationState;\n baseUrl?: string;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n const config = builder.build();\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'AgentCreateRegister',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n let state =\n options?.existingState ||\n ({\n currentStage: 'init',\n completedPercentage: 0,\n createdResources: [],\n } as AgentCreationState);\n\n state.agentMetadata = config.metadata;\n\n progressReporter.preparing('Starting agent creation process', 0, {\n state,\n });\n\n if (\n state.currentStage !== 'complete' ||\n !state.inboundTopicId ||\n !state.outboundTopicId ||\n !state.profileTopicId\n ) {\n const agentResult = await this.createAgent(\n config.pfpBuffer || Buffer.from([]),\n config.pfpFileName || 'default.png',\n config.name,\n config.description,\n config.capabilities,\n config.metadata,\n config.existingPfpTopicId,\n {\n progressCallback: (progress) => {\n const adjustedPercent = (progress.progressPercent || 0) * 0.3;\n progressReporter.report({\n stage: progress.stage,\n message: progress.message,\n progressPercent: adjustedPercent,\n details: {\n ...progress.details,\n state: progress.details?.state || state,\n },\n });\n },\n existingState: state,\n }\n );\n\n if (!agentResult.success) {\n throw new Error(\n agentResult.error || 'Failed to create agent with topics'\n );\n }\n\n state = agentResult.state;\n state.agentMetadata = config.metadata;\n }\n\n progressReporter.preparing(\n `Agent creation status: ${state.currentStage}, ${state.completedPercentage}%`,\n 30,\n { state }\n );\n\n const { accountId } = this.getAccountAndSigner();\n\n if (\n state.currentStage !== 'complete' ||\n !state.createdResources?.includes(\n `registration:${state.inboundTopicId}`\n )\n ) {\n if (options?.baseUrl) {\n this.guardedRegistryBaseUrl = options.baseUrl;\n }\n\n const registrationResult = await this.registerAgentWithGuardedRegistry(\n accountId,\n config.network,\n {\n progressCallback: (progress) => {\n const adjustedPercent =\n 30 + (progress.progressPercent || 0) * 0.7;\n progressReporter.report({\n stage: progress.stage,\n message: progress.message,\n progressPercent: adjustedPercent,\n details: {\n ...progress.details,\n state: progress.details?.state || state,\n },\n });\n },\n maxAttempts: options?.maxAttempts,\n delayMs: options?.delayMs,\n existingState: state,\n }\n );\n\n if (!registrationResult.success) {\n throw new Error(\n registrationResult.error || 'Failed to register agent with registry'\n );\n }\n\n state = registrationResult.state;\n }\n\n progressReporter.completed('Agent creation and registration complete', {\n state,\n });\n\n return {\n success: true,\n state,\n metadata: {\n accountId,\n operatorId: `${state.inboundTopicId}@${accountId}`,\n inboundTopicId: state.inboundTopicId!,\n outboundTopicId: state.outboundTopicId!,\n profileTopicId: state.profileTopicId!,\n pfpTopicId: state.pfpTopicId!,\n privateKey: null,\n ...state.agentMetadata,\n },\n };\n } catch (error: any) {\n throw new Error(`Failed to create and register agent: ${error.message}`);\n }\n }\n\n async storeHCS11Profile(\n agentName: string,\n agentDescription: string,\n inboundTopicId: string,\n outboundTopicId: string,\n capabilities: number[] = [],\n metadata: Record<string, any> = {},\n pfpBuffer?: Buffer,\n pfpFileName?: string,\n existingPfpTopicId?: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n }\n ): Promise<StoreHCS11ProfileResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'StoreHCS11Profile',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Preparing agent profile data', 0);\n\n let pfpTopicId = existingPfpTopicId;\n\n if (!pfpTopicId && pfpBuffer && pfpFileName) {\n const pfpProgress = progressReporter.createSubProgress({\n minPercent: 0,\n maxPercent: 60,\n logPrefix: 'PFP',\n });\n\n const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName, {\n progressCallback: (data) => {\n pfpProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent || 0,\n details: data.details,\n });\n },\n });\n\n if (!pfpResult.success) {\n progressReporter.failed(\n 'Failed to inscribe profile picture, continuing without PFP'\n );\n } else {\n pfpTopicId = pfpResult.pfpTopicId;\n }\n } else if (existingPfpTopicId) {\n progressReporter.preparing(\n `Using existing profile picture: ${existingPfpTopicId}`,\n 30\n );\n } else {\n progressReporter.preparing('No profile picture provided', 30);\n }\n\n const agentType = this.hcs11Client?.getAgentTypeFromMetadata({\n type: metadata.type || 'autonomous',\n } as AIAgentMetadata);\n\n progressReporter.preparing('Building agent profile', 65);\n\n const formattedSocials = [];\n if (metadata.socials) {\n if (metadata.socials.twitter) {\n formattedSocials.push({\n platform: 'twitter',\n handle: metadata.socials.twitter,\n });\n }\n if (metadata.socials.discord) {\n formattedSocials.push({\n platform: 'discord',\n handle: metadata.socials.discord,\n });\n }\n if (metadata.socials.github) {\n formattedSocials.push({\n platform: 'github',\n handle: metadata.socials.github,\n });\n }\n if (metadata.socials.website) {\n formattedSocials.push({\n platform: 'website',\n handle: metadata.socials.website,\n });\n }\n if (metadata.socials.x) {\n formattedSocials.push({\n platform: 'twitter',\n handle: metadata.socials.x,\n });\n }\n if (metadata.socials.linkedin) {\n formattedSocials.push({\n platform: 'linkedin',\n handle: metadata.socials.linkedin,\n });\n }\n if (metadata.socials.youtube) {\n formattedSocials.push({\n platform: 'youtube',\n handle: metadata.socials.youtube,\n });\n }\n if (metadata.socials.telegram) {\n formattedSocials.push({\n platform: 'telegram',\n handle: metadata.socials.telegram,\n });\n }\n }\n\n if (!this.hcs11Client) {\n progressReporter.failed(\n 'HCS11Client is not available in this environment'\n );\n return {\n profileTopicId: '',\n success: false,\n error: 'HCS11Client is not available in this environment',\n transactionId: '',\n };\n }\n\n const profile = this.hcs11Client.createAIAgentProfile(\n agentName,\n agentType!,\n capabilities,\n metadata.model || 'unknown',\n {\n alias: agentName.toLowerCase().replace(/\\s+/g, '_'),\n bio: agentDescription,\n profileImage: pfpTopicId ? `hcs://1/${pfpTopicId}` : undefined,\n socials: formattedSocials.length > 0 ? formattedSocials : undefined,\n properties: {\n description: agentDescription,\n version: metadata.version || '1.0.0',\n creator: metadata.creator || 'Unknown',\n supported_languages: metadata.supported_languages || ['en'],\n permissions: metadata.permissions || [],\n model_details: metadata.model_details,\n training: metadata.training,\n capabilities_description: metadata.capabilities_description,\n ...metadata,\n },\n inboundTopicId,\n outboundTopicId,\n creator: metadata.creator,\n }\n );\n\n const profileProgress = progressReporter.createSubProgress({\n minPercent: 65,\n maxPercent: 100,\n logPrefix: 'Profile',\n });\n\n const profileResult = await this.hcs11Client.createAndInscribeProfile(\n profile,\n true,\n {\n progressCallback: (profileData) => {\n profileProgress.report({\n stage: profileData.stage,\n message: profileData.message,\n progressPercent: profileData.progressPercent || 0,\n details: profileData.details,\n });\n },\n }\n );\n\n if (!profileResult.success) {\n progressReporter.failed('Failed to inscribe profile');\n return {\n profileTopicId: '',\n success: false,\n error: profileResult.error || 'Failed to inscribe profile',\n transactionId: profileResult.transactionId || '',\n };\n }\n\n progressReporter.completed('Profile stored successfully', {\n profileTopicId: profileResult.profileTopicId,\n });\n\n return {\n profileTopicId: profileResult.profileTopicId,\n pfpTopicId,\n success: true,\n transactionId: profileResult.transactionId || '',\n };\n } catch (error: any) {\n this.logger.error(`Error storing HCS11 profile: ${error.message}`);\n return {\n profileTopicId: '',\n success: false,\n error: error.message,\n transactionId: '',\n };\n }\n }\n\n async createTopic(\n memo: string,\n adminKey?: boolean,\n submitKey?: boolean\n ): Promise<{\n success: boolean;\n topicId?: string;\n error?: string;\n }> {\n this.logger.info('Creating topic');\n const { accountId, signer } = this.getAccountAndSigner();\n\n const transaction = new TopicCreateTransaction().setTopicMemo(memo);\n\n const publicKey = await this.mirrorNode.getPublicKey(accountId);\n\n if (adminKey && publicKey) {\n transaction.setAdminKey(publicKey);\n transaction.setAutoRenewAccountId(accountId);\n }\n\n if (submitKey && publicKey) {\n transaction.setSubmitKey(publicKey);\n }\n\n const transactionResponse =\n await this.hwc.executeTransactionWithErrorHandling(\n transaction as any,\n false\n );\n\n const error = transactionResponse.error;\n\n if (error) {\n this.logger.error(error);\n return {\n success: false,\n error,\n };\n }\n\n const result = transactionResponse.result;\n\n if (!result?.topicId) {\n this.logger.error('Failed to create topic: topicId is null');\n return {\n success: false,\n error: 'Failed to create topic: topicId is null',\n };\n }\n\n return {\n success: true,\n topicId: result.topicId.toString(),\n };\n }\n\n private async submitPayload(\n topicId: string,\n payload: object\n ): Promise<{\n result?: TransactionReceipt;\n error?: string;\n }> {\n this.logger.debug('Submitting payload');\n\n const transaction = new TopicMessageSubmitTransaction()\n .setTopicId(topicId)\n .setMessage(JSON.stringify(payload));\n\n return await this.hwc.executeTransactionWithErrorHandling(\n transaction,\n false\n );\n }\n\n async inscribeFile(\n buffer: Buffer,\n fileName: string\n ): Promise<RetrievedInscriptionResult> {\n const { accountId, signer } = this.getAccountAndSigner();\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const sdk = await InscriptionSDK.createWithAuth({\n type: 'client',\n accountId: accountId,\n signer: signer as any,\n network: this.network as 'testnet' | 'mainnet',\n });\n\n const result = await sdk.inscribe(\n {\n file: {\n type: 'base64',\n base64: buffer.toString('base64'),\n fileName,\n mimeType,\n },\n holderId: accountId.toString(),\n mode: 'file',\n network: this.network as 'testnet' | 'mainnet',\n },\n signer as any\n );\n\n if (!result.transactionId || !result.jobId) {\n this.logger.error('Failed to inscribe, no transaction ID or job ID.');\n throw new Error('Failed to inscribe, no transaction ID or job ID.');\n }\n\n if (result.transactionId && result.jobId) {\n this.logger.info(\n `Transaction ID: ${result.transactionId}, Job ID: ${result.jobId}`\n );\n }\n\n const status = await sdk.waitForInscription(result.jobId, 30, 4000, true);\n return status;\n }\n\n getAccountAndSigner(): GetAccountAndSignerResponse {\n const accountInfo = this.hwc.getAccountInfo();\n const accountId = accountInfo.accountId.toString();\n const signer = this.hwc.dAppConnector.signers.find((s) => {\n return s.getAccountId().toString() === accountId;\n });\n\n if (!signer) {\n this.logger.error('Failed to find signer');\n throw new Error('Failed to find signer');\n }\n\n return { accountId, signer: signer as any };\n }\n\n /**\n * Inscribes a profile picture (PFP) on HCS-11.\n *\n * @param buffer - The buffer containing the PFP image.\n * @param fileName - The name of the file containing the PFP image.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the topic ID of the inscribed PFP.\n */\n async inscribePfp(\n buffer: Buffer,\n fileName: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n }\n ): Promise<InscribePfpResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'PFP-Inscription',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n if (!this.hcs11Client) {\n progressReporter.failed(\n 'HCS11Client is not available in this environment'\n );\n return {\n pfpTopicId: '',\n success: false,\n error: 'HCS11Client is not available in this environment',\n transactionId: '',\n };\n }\n\n progressReporter.preparing('Preparing to inscribe profile picture', 10);\n this.logger.info('Inscribing profile picture using HCS-11 client');\n\n const wrappedProgressCallback = (data: any) => {\n progressReporter.report({\n stage: data.stage || 'confirming',\n message: data.message || 'Processing PFP inscription',\n progressPercent: data.progressPercent || 50,\n details: data.details,\n });\n };\n\n const imageResult = await this.hcs11Client.inscribeImage(\n buffer,\n fileName,\n { progressCallback: wrappedProgressCallback }\n );\n\n if (!imageResult.success) {\n progressReporter.failed(\n `Failed to inscribe profile picture: ${imageResult.error}`\n );\n this.logger.error(\n `Failed to inscribe profile picture: ${imageResult.error}`\n );\n return {\n pfpTopicId: '',\n success: false,\n error: imageResult.error || 'Failed to inscribe profile picture',\n transactionId: imageResult.transactionId || '',\n };\n }\n\n progressReporter.completed('Successfully inscribed profile picture', {\n pfpTopicId: imageResult.imageTopicId,\n });\n\n this.logger.info(\n `Successfully inscribed profile picture with topic ID: ${imageResult.imageTopicId}`\n );\n return {\n pfpTopicId: imageResult.imageTopicId,\n success: true,\n transactionId: imageResult.transactionId || '',\n };\n } catch (error: any) {\n this.logger.error(`Error inscribing profile picture: ${error.message}`);\n return {\n pfpTopicId: '',\n success: false,\n error: error.message,\n transactionId: '',\n };\n }\n }\n}\n"],"names":["mime.lookup"],"mappings":";;;;;;;AAmCA,MAAM,YAAY,OAAO,WAAW;AA4C7B,MAAM,yBAAyB,gBAAgB;AAAA,EAMpD,YAAY,QAAgC;AACpC,UAAA;AAAA,MACJ,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,MACjB,aAAa,OAAO;AAAA,IAAA,CACrB;AAPH,SAAQ,cAAkC;AASxC,SAAK,MAAM,OAAO;AACb,SAAA,yBACH,OAAO,0B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AAAA,UACL,YAAY;AAAA,UACZ,SAAS;AAAA,UACT,OAAO,YAAY,SAAS;AAAA,UAC5B,eAAe,YAAY,iBAAiB;AAAA,QAC9C;AAAA,MAAA;AAGF,uBAAiB,UAAU,0CAA0C;AAAA,QACnE,YAAY,YAAY;AAAA,MAAA,CACzB;AAED,WAAK,OAAO;AAAA,QACV,yDAAyD,YAAY,YAAY;AAAA,MACnF;AACO,aAAA;AAAA,QACL,YAAY,YAAY;AAAA,QACxB,SAAS;AAAA,QACT,eAAe,YAAY,iBAAiB;AAAA,MAC9C;AAAA,aACO,OAAY;AACnB,WAAK,OAAO,MAAM,qCAAqC,MAAM,OAAO,EAAE;AAC/D,aAAA;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,OAAO,MAAM;AAAA,QACb,eAAe;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es10.js","sources":["../../src/hcs-10/browser.ts"],"sourcesContent":["import {\n KeyList,\n PublicKey,\n TopicCreateTransaction,\n TopicMessageSubmitTransaction,\n TransactionReceipt,\n PrivateKey,\n} from '@hashgraph/sdk';\nimport { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinal-wc';\nimport { Logger, LogLevel } from '../utils/logger';\nimport {\n InscriptionSDK,\n RetrievedInscriptionResult,\n} from '@kiloscribe/inscription-sdk';\nimport { HCS10BaseClient } from './base-client';\nimport * as mime from 'mime-types';\nimport {\n HCSClientConfig,\n NetworkType,\n RegistrationResponse,\n AgentConfig,\n CreateAgentResponse,\n InscribePfpResponse,\n StoreHCS11ProfileResponse,\n AgentRegistrationResult,\n HandleConnectionRequestResponse,\n WaitForConnectionConfirmationResponse,\n RegistrationProgressCallback,\n AgentCreationState,\n GetAccountAndSignerResponse,\n RegistrationProgressData,\n InscriptionProgressData,\n InscriptionProgressCallback,\n} from './types';\nimport { HCS11Client, AIAgentMetadata } from '../hcs-11';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { Transaction } from '@hashgraph/sdk';\nimport { AgentBuilder } from './agent-builder';\nimport { inscribeWithSigner } from '../inscribe/inscriber';\n\nconst isBrowser = typeof window !== 'undefined';\n\nexport type BrowserHCSClientConfig = {\n network: 'mainnet' | 'testnet';\n hwc: HashinalsWalletConnectSDK;\n logLevel?: LogLevel;\n prettyPrint?: boolean;\n guardedRegistryTopicId?: string;\n guardedRegistryBaseUrl?: string;\n};\n\ninterface AgentMetadata {\n name: string;\n description: string;\n version?: string;\n type?: string;\n logo?: string;\n socials?: SocialLinks;\n}\n\ninterface SocialLinks {\n twitter?: string;\n discord?: string;\n github?: string;\n website?: string;\n}\n\nexport type BrowserAgentConfig = Omit<\n AgentConfig<BrowserHCSClient>,\n 'privateKey'\n> & {\n client: BrowserHCSClient;\n};\n\nexport type RegisteredAgent = {\n outboundTopicId: string;\n inboundTopicId: string;\n pfpTopicId: string;\n profileTopicId: string;\n error?: string;\n success: boolean;\n state: AgentCreationState;\n};\n\nexport class BrowserHCSClient extends HCS10BaseClient {\n private hwc: HashinalsWalletConnectSDK;\n protected declare logger: Logger;\n private guardedRegistryBaseUrl: string;\n private hcs11Client: HCS11Client | null = null;\n\n constructor(config: BrowserHCSClientConfig) {\n super({\n network: config.network,\n logLevel: config.logLevel,\n prettyPrint: config.prettyPrint,\n });\n\n this.hwc = config.hwc;\n this.guardedRegistryBaseUrl =\n config.guardedRegistryBaseUrl || 'https://moonscape.tech';\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-Browser',\n prettyPrint: config.prettyPrint,\n });\n\n if (isBrowser) {\n try {\n const { accountId, signer } = this.getAccountAndSigner();\n\n this.hcs11Client = new HCS11Client({\n network: config.network,\n auth: {\n operatorId: accountId,\n signer: signer as any,\n },\n logLevel: config.logLevel,\n });\n } catch (err) {\n this.logger.warn(`Failed to initialize HCS11Client: ${err}`);\n }\n } else {\n this.logger.error(\n 'BrowserHCSClient initialized in server environment - browser-specific features will not be available. Use HCS10Client instead.'\n );\n }\n }\n\n async submitConnectionRequest(\n inboundTopicId: string,\n requestingAccountId: string,\n operatorId: string,\n memo: string\n ): Promise<TransactionReceipt | undefined> {\n this.logger.info('Submitting connection request');\n const connectionRequestMessage = {\n p: 'hcs-10',\n op: 'connection_request',\n requesting_account_id: requestingAccountId,\n operator_id: operatorId,\n m: memo,\n };\n\n const response = await this.submitPayload(\n inboundTopicId,\n connectionRequestMessage\n );\n this.logger.info(\n `Submitted connection request to topic ID: ${inboundTopicId}`\n );\n\n const outboundTopic = await this.retrieveOutboundConnectTopic(\n requestingAccountId\n );\n\n if (!outboundTopic?.outboundTopic) {\n this.logger.error(\n `Failed to retrieve outbound topic for account ID: ${requestingAccountId}`\n );\n throw new Error(\n `Failed to retrieve outbound topic for account ID: ${requestingAccountId}`\n );\n }\n\n this.logger.info(\n `Retrieved outbound topic ID: ${outboundTopic.outboundTopic} for account ID: ${requestingAccountId}`\n );\n const responseSequenceNumber = response?.topicSequenceNumber?.toNumber();\n\n if (!responseSequenceNumber) {\n throw new Error('Failed to get response sequence number');\n }\n\n await this.submitPayload(outboundTopic.outboundTopic, {\n ...connectionRequestMessage,\n outbound_topic_id: inboundTopicId,\n connection_request_id: responseSequenceNumber,\n });\n\n return response;\n }\n\n async getPublicKey(accountId: string): Promise<PublicKey> {\n return await this.mirrorNode.getPublicKey(accountId);\n }\n\n async handleConnectionRequest(\n inboundTopicId: string,\n requestingAccountId: string,\n connectionId: number,\n connectionMemo: string = 'Connection accepted. Looking forward to collaborating!'\n ): Promise<HandleConnectionRequestResponse> {\n this.logger.info('Handling connection request');\n const userAccountId = this.hwc.getAccountInfo().accountId;\n if (!userAccountId) {\n throw new Error('Failed to retrieve user account ID');\n }\n\n const requesterKey = await this.mirrorNode.getPublicKey(\n requestingAccountId\n );\n const accountKey = await this.mirrorNode.getPublicKey(userAccountId);\n\n if (!accountKey) {\n throw new Error('Failed to retrieve public key');\n }\n\n const thresholdKey = new KeyList([accountKey, requesterKey], 1);\n const memo = `hcs-10:${inboundTopicId}:${connectionId}`;\n\n const transaction = new TopicCreateTransaction()\n .setTopicMemo(memo)\n .setAdminKey(thresholdKey)\n .setSubmitKey(thresholdKey);\n\n this.logger.debug('Executing topic creation transaction');\n const txResponse = await this.hwc.executeTransactionWithErrorHandling(\n transaction,\n false\n );\n if (txResponse.error) {\n this.logger.error(txResponse.error);\n throw new Error(txResponse.error);\n }\n\n const resultReceipt = txResponse.result;\n if (!resultReceipt?.topicId) {\n this.logger.error('Failed to create topic: topicId is null');\n throw new Error('Failed to create topic: topicId is null');\n }\n\n const connectionTopicId = resultReceipt.topicId.toString();\n const operatorId = `${inboundTopicId}@${userAccountId}`;\n const confirmedConnectionSequenceNumber = await this.confirmConnection(\n inboundTopicId,\n connectionTopicId,\n requestingAccountId,\n connectionId,\n operatorId,\n connectionMemo\n );\n\n return {\n connectionTopicId,\n confirmedConnectionSequenceNumber,\n operatorId,\n };\n }\n\n async confirmConnection(\n inboundTopicId: string,\n connectionTopicId: string,\n connectedAccountId: string,\n connectionId: number,\n operatorId: string,\n memo: string\n ): Promise<number> {\n this.logger.info('Confirming connection');\n const payload = {\n p: 'hcs-10',\n op: 'connection_created',\n connection_topic_id: connectionTopicId,\n connected_account_id: connectedAccountId,\n operator_id: operatorId,\n connection_id: connectionId,\n m: memo,\n };\n\n const transactionResponse = await this.submitPayload(\n inboundTopicId,\n payload\n );\n if (!transactionResponse?.topicSequenceNumber) {\n this.logger.error(\n 'Failed to confirm connection: sequence number is null'\n );\n throw new Error('Failed to confirm connection: sequence number is null');\n }\n return transactionResponse.topicSequenceNumber.toNumber();\n }\n\n async submitMessage(\n topicId: string,\n content: string,\n metadata: object = {},\n memo: string = ''\n ): Promise<TransactionReceipt> {\n this.logger.info('Submitting message');\n const payload = {\n p: 'hcs-10',\n op: 'message',\n data: {\n content,\n metadata,\n },\n m: memo,\n };\n\n return await this.submitPayload(topicId, payload);\n }\n\n /**\n * Creates an agent directly, but does not register.\n * We highly recommend calling createAndRegisterAgent instead.\n *\n * @param pfpBuffer - The buffer containing the PFP image.\n * @param pfpFileName - The name of the file containing the PFP image.\n * @param agentName - The name of the agent.\n * @param agentDescription - The description of the agent.\n * @param capabilities - The capabilities of the agent.\n * @param metadata - The metadata of the agent.\n * @param existingPfpTopicId - The topic ID of the existing PFP.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the agent creation state.\n */\n async createAgent(\n pfpBuffer: Buffer,\n pfpFileName: string,\n agentName: string,\n agentDescription: string,\n capabilities: number[],\n metadata: AgentMetadata,\n existingPfpTopicId?: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n existingState?: AgentCreationState;\n }\n ): Promise<RegisteredAgent> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'AgentCreate',\n logger: this.logger,\n callback: progressCallback,\n });\n\n let state =\n options?.existingState ||\n ({\n currentStage: 'init',\n completedPercentage: 0,\n createdResources: [],\n } as AgentCreationState);\n\n if (!state.outboundTopicId) {\n state.currentStage = 'topics';\n progressReporter.preparing('Creating agent outbound topic', 0, {\n state,\n });\n\n const outboundResult = await this.createTopic(\n 'hcs-10:0:60:1',\n true,\n true\n );\n if (!outboundResult.success || !outboundResult.topicId) {\n state.error =\n outboundResult.error || 'Failed to create outbound topic';\n progressReporter.failed(\n `Failed to create outbound topic: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: '',\n inboundTopicId: '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.outboundTopicId = outboundResult.topicId;\n if (state.createdResources) {\n state.createdResources.push(`outbound:${state.outboundTopicId}`);\n }\n progressReporter.preparing('Outbound topic created', 20, { state });\n } else {\n progressReporter.preparing('Using existing outbound topic', 20, {\n state,\n });\n }\n\n const accountId = this.hwc.getAccountInfo().accountId;\n if (!accountId) {\n throw new Error('Failed to retrieve user account ID');\n }\n\n if (!state.inboundTopicId) {\n const memo = `hcs-10:0:60:0:${accountId}`;\n const inboundResult = await this.createTopic(memo, true, true);\n\n if (!inboundResult.success || !inboundResult.topicId) {\n state.error = inboundResult.error || 'Failed to create inbound topic';\n progressReporter.failed(\n `Failed to create inbound topic: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.inboundTopicId = inboundResult.topicId;\n if (state.createdResources) {\n state.createdResources.push(`inbound:${state.inboundTopicId}`);\n }\n progressReporter.preparing('Inbound topic created', 40, { state });\n } else {\n progressReporter.preparing('Using existing inbound topic', 40, {\n state,\n });\n }\n\n if (!state.pfpTopicId && !existingPfpTopicId) {\n state.currentStage = 'pfp';\n progressReporter.preparing('Creating agent profile picture', 40, {\n state,\n });\n\n const pfpProgress = progressReporter.createSubProgress({\n minPercent: 40,\n maxPercent: 60,\n logPrefix: 'PFP',\n });\n\n const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName, {\n progressCallback: (data: RegistrationProgressData) => {\n pfpProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent || 0,\n details: {\n ...data.details,\n state: data?.details?.state ? data.details.state : state,\n },\n });\n },\n });\n\n if (!pfpResult.success) {\n state.error = pfpResult.error || 'Failed to inscribe profile picture';\n progressReporter.failed(\n `Failed to inscribe profile picture: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.pfpTopicId = pfpResult.pfpTopicId;\n state.completedPercentage = 60;\n if (state.createdResources) {\n state.createdResources.push(`pfp:${state.pfpTopicId}`);\n }\n\n progressReporter.preparing('Profile picture created', 60, { state });\n } else {\n state.pfpTopicId = existingPfpTopicId || state.pfpTopicId;\n progressReporter.preparing(\n `Using existing profile picture: ${state.pfpTopicId}`,\n 60,\n {\n state,\n }\n );\n }\n\n if (!state.profileTopicId) {\n state.currentStage = 'profile';\n progressReporter.preparing('Creating agent profile', 60, { state });\n\n const profileProgress = progressReporter.createSubProgress({\n minPercent: 60,\n maxPercent: 100,\n logPrefix: 'Profile',\n });\n\n if (!this.hcs11Client) {\n state.error = 'HCS11Client is not available in this environment';\n progressReporter.failed(state.error, { state });\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: state.pfpTopicId || '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n const storeProfileResult = await this.storeHCS11Profile(\n agentName,\n agentDescription,\n state.inboundTopicId!,\n state.outboundTopicId!,\n capabilities,\n metadata,\n undefined,\n undefined,\n state.pfpTopicId,\n {\n progressCallback: (data: RegistrationProgressData) => {\n profileProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent || 0,\n details: {\n ...data.details,\n state:\n data.details && data.details.state\n ? data.details.state\n : state,\n },\n });\n },\n }\n );\n\n if (!storeProfileResult.success) {\n state.error =\n storeProfileResult.error || 'Failed to store agent profile';\n progressReporter.failed(\n `Failed to store agent profile: ${state.error}`,\n { state }\n );\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: state.pfpTopicId || '',\n profileTopicId: '',\n success: false,\n error: state.error,\n state,\n };\n }\n\n state.profileTopicId = storeProfileResult.profileTopicId;\n if (state.createdResources) {\n state.createdResources.push(`profile:${state.profileTopicId}`);\n }\n\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n } else {\n progressReporter.preparing('Using existing agent profile', 100, {\n state,\n });\n if (state.currentStage !== 'complete') {\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n }\n }\n\n progressReporter.completed('Agent successfully created', {\n inboundTopicId: state.inboundTopicId,\n outboundTopicId: state.outboundTopicId,\n pfpTopicId: state.pfpTopicId,\n profileTopicId: state.profileTopicId,\n state,\n });\n\n return {\n outboundTopicId: state.outboundTopicId || '',\n inboundTopicId: state.inboundTopicId || '',\n pfpTopicId: state.pfpTopicId || '',\n profileTopicId: state.profileTopicId || '',\n success: true,\n state,\n };\n } catch (error: any) {\n this.logger.error(`Error creating agent: ${error.message}`);\n return {\n outboundTopicId: '',\n inboundTopicId: '',\n pfpTopicId: '',\n profileTopicId: '',\n success: false,\n error: `Error creating agent: ${error.message}`,\n state: {\n currentStage: 'init',\n completedPercentage: 0,\n error: error.message,\n },\n };\n }\n }\n\n private initializeRegistrationState(\n inboundTopicId: string,\n existingState?: AgentCreationState\n ): AgentCreationState {\n const state = existingState || {\n inboundTopicId,\n currentStage: 'registration',\n completedPercentage: 0,\n createdResources: [],\n };\n\n if (\n state.currentStage !== 'registration' &&\n state.currentStage !== 'complete'\n ) {\n state.currentStage = 'registration';\n }\n\n return state;\n }\n\n private updateStateForCompletedRegistration(\n state: AgentCreationState,\n inboundTopicId: string\n ): void {\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n if (state.createdResources) {\n state.createdResources.push(`registration:${inboundTopicId}`);\n }\n }\n\n async registerAgentWithGuardedRegistry(\n accountId: string,\n network: string = this.network,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n maxAttempts?: number;\n delayMs?: number;\n existingState?: AgentCreationState;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n this.logger.info('Registering agent with guarded registry');\n\n const agentProfile = await this.retrieveProfile(accountId);\n const inboundTopicId = agentProfile.topicInfo.inboundTopic;\n const state = this.initializeRegistrationState(\n inboundTopicId,\n options?.existingState\n );\n const progressReporter = new ProgressReporter({\n module: 'AgentRegistration',\n logger: this.logger,\n callback: options?.progressCallback,\n });\n\n progressReporter.preparing('Preparing agent registration', 10, {\n inboundTopicId,\n accountId,\n });\n\n const registrationResult = await this.executeRegistration(\n accountId,\n network as string,\n this.guardedRegistryBaseUrl,\n this.logger\n );\n\n if (!registrationResult.success) {\n return {\n ...registrationResult,\n state,\n };\n }\n\n progressReporter.submitting('Submitting registration to registry', 30, {\n transactionId: registrationResult.transactionId,\n });\n\n if (registrationResult.transaction) {\n const transaction = Transaction.fromBytes(\n Buffer.from(registrationResult.transaction, 'base64')\n );\n\n this.logger.info(`Processing registration transaction`);\n const txResult = await this.hwc.executeTransactionWithErrorHandling(\n transaction,\n true\n );\n\n if (txResult.error) {\n return {\n ...registrationResult,\n error: txResult.error,\n success: false,\n state,\n };\n }\n\n this.logger.info(`Successfully processed registration transaction`);\n }\n\n progressReporter.confirming('Confirming registration transaction', 60, {\n accountId,\n inboundTopicId,\n transactionId: registrationResult.transactionId,\n });\n\n const maxAttempts = options?.maxAttempts ?? 60;\n const delayMs = options?.delayMs ?? 2000;\n\n const confirmed = await this.waitForRegistrationConfirmation(\n registrationResult.transactionId!,\n network,\n this.guardedRegistryBaseUrl,\n maxAttempts,\n delayMs,\n this.logger\n );\n\n this.updateStateForCompletedRegistration(state, inboundTopicId);\n\n progressReporter.completed('Agent registration complete', {\n transactionId: registrationResult.transactionId,\n inboundTopicId,\n state,\n confirmed,\n });\n\n return {\n ...registrationResult,\n confirmed,\n state,\n };\n } catch (error: any) {\n this.logger.error(`Registration error: ${error.message}`);\n return {\n error: `Error during registration: ${error.message}`,\n success: false,\n state: {\n currentStage: 'registration',\n completedPercentage: 0,\n error: error.message,\n },\n };\n }\n }\n\n async createAndRegisterAgent(\n builder: AgentBuilder,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n maxAttempts?: number;\n delayMs?: number;\n existingState?: AgentCreationState;\n baseUrl?: string;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n const config = builder.build();\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'AgentCreateRegister',\n logger: this.logger,\n callback: progressCallback,\n });\n\n let state =\n options?.existingState ||\n ({\n currentStage: 'init',\n completedPercentage: 0,\n createdResources: [],\n } as AgentCreationState);\n\n state.agentMetadata = config.metadata;\n\n progressReporter.preparing('Starting agent creation process', 0, {\n state,\n });\n\n if (\n state.currentStage !== 'complete' ||\n !state.inboundTopicId ||\n !state.outboundTopicId ||\n !state.profileTopicId\n ) {\n const agentResult = await this.createAgent(\n config.pfpBuffer || Buffer.from([]),\n config.pfpFileName || 'default.png',\n config.name,\n config.description,\n config.capabilities,\n config.metadata,\n config.existingPfpTopicId,\n {\n progressCallback: (progress: RegistrationProgressData) => {\n const adjustedPercent = (progress.progressPercent || 0) * 0.3;\n progressReporter.report({\n stage: progress.stage,\n message: progress.message,\n progressPercent: adjustedPercent,\n details: {\n ...progress.details,\n state:\n progress.details && progress.details.state\n ? progress.details.state\n : state,\n },\n });\n },\n existingState: state,\n }\n );\n\n if (!agentResult.success) {\n throw new Error(\n agentResult.error || 'Failed to create agent with topics'\n );\n }\n\n state = agentResult.state;\n state.agentMetadata = config.metadata;\n }\n\n progressReporter.preparing(\n `Agent creation status: ${state.currentStage}, ${state.completedPercentage}%`,\n 30,\n { state }\n );\n\n const { accountId } = this.getAccountAndSigner();\n\n if (\n state.currentStage !== 'complete' ||\n !state.createdResources?.includes(\n `registration:${state.inboundTopicId}`\n )\n ) {\n if (options?.baseUrl) {\n this.guardedRegistryBaseUrl = options.baseUrl;\n }\n\n const registrationResult = await this.registerAgentWithGuardedRegistry(\n accountId,\n config.network,\n {\n progressCallback: (progress: RegistrationProgressData) => {\n const adjustedPercent =\n 30 + (progress.progressPercent || 0) * 0.7;\n progressReporter.report({\n stage: progress.stage,\n message: progress.message,\n progressPercent: adjustedPercent,\n details: {\n ...progress.details,\n state:\n progress.details && progress.details.state\n ? progress.details.state\n : state,\n },\n });\n },\n maxAttempts: options?.maxAttempts,\n delayMs: options?.delayMs,\n existingState: state,\n }\n );\n\n if (!registrationResult.success) {\n throw new Error(\n registrationResult.error || 'Failed to register agent with registry'\n );\n }\n\n state = registrationResult.state;\n }\n\n progressReporter.completed('Agent creation and registration complete', {\n state,\n });\n\n return {\n success: true,\n state,\n metadata: {\n accountId,\n operatorId: `${state.inboundTopicId}@${accountId}`,\n inboundTopicId: state.inboundTopicId!,\n outboundTopicId: state.outboundTopicId!,\n profileTopicId: state.profileTopicId!,\n pfpTopicId: state.pfpTopicId!,\n privateKey: null,\n ...state.agentMetadata,\n },\n };\n } catch (error: any) {\n throw new Error(`Failed to create and register agent: ${error.message}`);\n }\n }\n\n async storeHCS11Profile(\n agentName: string,\n agentDescription: string,\n inboundTopicId: string,\n outboundTopicId: string,\n capabilities: number[] = [],\n metadata: Record<string, any> = {},\n pfpBuffer?: Buffer,\n pfpFileName?: string,\n existingPfpTopicId?: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n }\n ): Promise<StoreHCS11ProfileResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'StoreHCS11Profile',\n logger: this.logger,\n callback: progressCallback,\n });\n\n progressReporter.preparing('Preparing agent profile data', 0);\n\n let pfpTopicId = existingPfpTopicId;\n\n if (!pfpTopicId && pfpBuffer && pfpFileName) {\n const pfpProgress = progressReporter.createSubProgress({\n minPercent: 0,\n maxPercent: 60,\n logPrefix: 'PFP',\n });\n\n const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName, {\n progressCallback: (data: RegistrationProgressData) => {\n pfpProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent || 0,\n details: data.details,\n });\n },\n });\n\n if (!pfpResult.success) {\n progressReporter.failed(\n 'Failed to inscribe profile picture, continuing without PFP'\n );\n } else {\n pfpTopicId = pfpResult.pfpTopicId;\n }\n } else if (existingPfpTopicId) {\n progressReporter.preparing(\n `Using existing profile picture: ${existingPfpTopicId}`,\n 30\n );\n } else {\n progressReporter.preparing('No profile picture provided', 30);\n }\n\n const agentType = this.hcs11Client?.getAgentTypeFromMetadata({\n type: metadata.type || 'autonomous',\n } as AIAgentMetadata);\n\n progressReporter.preparing('Building agent profile', 65);\n\n const formattedSocials = [];\n if (metadata.socials) {\n if (metadata.socials.twitter) {\n formattedSocials.push({\n platform: 'twitter',\n handle: metadata.socials.twitter,\n });\n }\n if (metadata.socials.discord) {\n formattedSocials.push({\n platform: 'discord',\n handle: metadata.socials.discord,\n });\n }\n if (metadata.socials.github) {\n formattedSocials.push({\n platform: 'github',\n handle: metadata.socials.github,\n });\n }\n if (metadata.socials.website) {\n formattedSocials.push({\n platform: 'website',\n handle: metadata.socials.website,\n });\n }\n if (metadata.socials.x) {\n formattedSocials.push({\n platform: 'twitter',\n handle: metadata.socials.x,\n });\n }\n if (metadata.socials.linkedin) {\n formattedSocials.push({\n platform: 'linkedin',\n handle: metadata.socials.linkedin,\n });\n }\n if (metadata.socials.youtube) {\n formattedSocials.push({\n platform: 'youtube',\n handle: metadata.socials.youtube,\n });\n }\n if (metadata.socials.telegram) {\n formattedSocials.push({\n platform: 'telegram',\n handle: metadata.socials.telegram,\n });\n }\n }\n\n if (!this.hcs11Client) {\n progressReporter.failed(\n 'HCS11Client is not available in this environment'\n );\n return {\n profileTopicId: '',\n success: false,\n error: 'HCS11Client is not available in this environment',\n transactionId: '',\n };\n }\n\n const profile = this.hcs11Client.createAIAgentProfile(\n agentName,\n agentType!,\n capabilities,\n metadata.model || 'unknown',\n {\n alias: agentName.toLowerCase().replace(/\\s+/g, '_'),\n bio: agentDescription,\n profileImage: undefined,\n socials: undefined,\n properties: {\n description: agentDescription,\n version: metadata.version || '1.0.0',\n creator: metadata.creator || 'Unknown',\n supported_languages: metadata.supported_languages || ['en'],\n permissions: metadata.permissions || [],\n model_details: metadata.model_details,\n training: metadata.training,\n capabilities_description: metadata.capabilities_description,\n ...metadata,\n },\n inboundTopicId,\n outboundTopicId,\n creator: metadata.creator,\n }\n );\n\n if (pfpTopicId) {\n profile.profileImage = `hcs://1/${pfpTopicId}`;\n }\n if (formattedSocials.length > 0) {\n profile.socials = formattedSocials;\n }\n\n const profileProgress = progressReporter.createSubProgress({\n minPercent: 65,\n maxPercent: 100,\n logPrefix: 'Profile',\n });\n\n const profileResult = await this.hcs11Client.createAndInscribeProfile(\n profile,\n true,\n {\n progressCallback: (profileData: RegistrationProgressData) => {\n profileProgress.report({\n stage: profileData.stage,\n message: profileData.message,\n progressPercent: profileData.progressPercent || 0,\n details: profileData.details,\n });\n },\n }\n );\n\n if (!profileResult.success) {\n progressReporter.failed('Failed to inscribe profile');\n return {\n profileTopicId: '',\n success: false,\n error: profileResult.error || 'Failed to inscribe profile',\n transactionId: profileResult.transactionId || '',\n };\n }\n\n progressReporter.completed('Profile stored successfully', {\n profileTopicId: profileResult.profileTopicId,\n });\n\n return {\n profileTopicId: profileResult.profileTopicId,\n pfpTopicId,\n success: true,\n transactionId: profileResult.transactionId || '',\n };\n } catch (error: any) {\n this.logger.error(`Error storing HCS11 profile: ${error.message}`);\n return {\n profileTopicId: '',\n success: false,\n error: error.message,\n transactionId: '',\n };\n }\n }\n\n async createTopic(\n memo: string,\n adminKey?: boolean,\n submitKey?: boolean\n ): Promise<{\n success: boolean;\n topicId?: string;\n error?: string;\n }> {\n this.logger.info('Creating topic');\n const { accountId, signer } = this.getAccountAndSigner();\n\n const transaction = new TopicCreateTransaction().setTopicMemo(memo);\n\n const publicKey = await this.mirrorNode.getPublicKey(accountId);\n\n if (adminKey && publicKey) {\n transaction.setAdminKey(publicKey);\n transaction.setAutoRenewAccountId(accountId);\n }\n\n if (submitKey && publicKey) {\n transaction.setSubmitKey(publicKey);\n }\n\n const transactionResponse =\n await this.hwc.executeTransactionWithErrorHandling(transaction, false);\n\n const error = transactionResponse.error;\n\n if (error) {\n this.logger.error(error);\n return {\n success: false,\n error,\n };\n }\n\n const resultReceipt = transactionResponse.result;\n\n if (!resultReceipt?.topicId) {\n this.logger.error('Failed to create topic: topicId is null');\n return {\n success: false,\n error: 'Failed to create topic: topicId is null',\n };\n }\n\n return {\n success: true,\n topicId: resultReceipt.topicId.toString(),\n };\n }\n\n public async submitPayload(\n topicId: string,\n payload: object | string,\n _submitKey?: PrivateKey,\n _requiresFee?: boolean\n ): Promise<TransactionReceipt> {\n this.logger.debug(`Submitting payload to topic ${topicId}`);\n\n let message: string;\n if (typeof payload === 'string') {\n message = payload;\n } else {\n message = JSON.stringify(payload);\n }\n\n const transaction = new TopicMessageSubmitTransaction()\n .setTopicId(topicId)\n .setMessage(message);\n\n const txResponse = await this.hwc.executeTransactionWithErrorHandling(\n transaction,\n false\n );\n\n if (txResponse.error) {\n this.logger.error(`Failed to submit payload: ${txResponse.error}`);\n throw new Error(`Failed to submit payload: ${txResponse.error}`);\n }\n\n if (!txResponse.result) {\n this.logger.error(\n 'Failed to submit message: receipt is null or undefined'\n );\n throw new Error('Failed to submit message: receipt is null or undefined');\n }\n\n this.logger.debug('Payload submitted successfully via HWC');\n return txResponse.result;\n }\n\n async inscribeFile(\n buffer: Buffer,\n fileName: string,\n options?: {\n progressCallback?: InscriptionProgressCallback;\n waitMaxAttempts?: number;\n waitIntervalMs?: number;\n }\n ): Promise<RetrievedInscriptionResult> {\n const { accountId, signer } = this.getAccountAndSigner();\n\n let mimeType = 'application/octet-stream';\n try {\n const detectedType = mime.lookup(fileName);\n if (detectedType) {\n mimeType = detectedType;\n }\n } catch (error) {\n this.logger.warn(`Error detecting MIME type, using default: ${error}`);\n }\n\n this.logger.info(`Inscribing file: ${fileName} (${mimeType})`);\n\n const progressReporter = new ProgressReporter({\n module: 'FileInscriber',\n logger: this.logger,\n callback: options?.progressCallback,\n });\n\n progressReporter.preparing('Preparing file for inscription', 10, {\n fileName,\n size: buffer.length,\n mimeType,\n });\n\n try {\n const response = await inscribeWithSigner(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n signer as any,\n {\n mode: 'file',\n network: this.network as 'testnet' | 'mainnet',\n waitForConfirmation: true,\n waitMaxAttempts:\n options && options.waitMaxAttempts ? options.waitMaxAttempts : 30,\n waitIntervalMs:\n options && options.waitIntervalMs ? options.waitIntervalMs : 4000,\n progressCallback: (data: any) => {\n const stageName = data.stage || 'preparing';\n const message = data.message || 'Processing file inscription';\n const percent = data.progressPercent || 50;\n\n progressReporter.report({\n stage: stageName as InscriptionProgressData['stage'],\n message,\n progressPercent: 10 + percent * 0.9, // Scale from 10% to 100%\n details: data.details || {},\n });\n },\n logging: {\n level: 'debug',\n },\n }\n );\n\n if (!response.confirmed) {\n throw new Error('Failed to inscribe file: inscription not confirmed');\n }\n\n const inscription = response.inscription;\n\n progressReporter.completed('File successfully inscribed', {\n fileName,\n topicId: inscription.topic_id,\n transactionId: inscription.transactionId,\n });\n\n return inscription;\n } catch (error) {\n let errorMessage = String(error);\n if (error instanceof Error) {\n errorMessage = error.message;\n }\n progressReporter.failed(`Failed to inscribe file: ${errorMessage}`);\n this.logger.error(`Error inscribing file: ${error}`);\n throw error;\n }\n }\n\n getAccountAndSigner(): GetAccountAndSignerResponse {\n const accountInfo = this.hwc.getAccountInfo();\n const accountId = accountInfo.accountId.toString();\n const signer = this.hwc.dAppConnector.signers.find((s) => {\n return s.getAccountId().toString() === accountId;\n });\n\n if (!signer) {\n this.logger.error('Failed to find signer');\n throw new Error('Failed to find signer');\n }\n\n return { accountId, signer: signer as any };\n }\n\n /**\n * Inscribes a profile picture (PFP) on HCS-11.\n *\n * @param buffer - The buffer containing the PFP image.\n * @param fileName - The name of the file containing the PFP image.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the topic ID of the inscribed PFP.\n */\n async inscribePfp(\n buffer: Buffer,\n fileName: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n }\n ): Promise<InscribePfpResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'PFP-Inscription',\n logger: this.logger,\n callback: progressCallback,\n });\n\n if (!this.hcs11Client) {\n progressReporter.failed(\n 'HCS11Client is not available in this environment'\n );\n return {\n pfpTopicId: '',\n success: false,\n error: 'HCS11Client is not available in this environment',\n transactionId: '',\n };\n }\n\n progressReporter.preparing('Preparing to inscribe profile picture', 10);\n this.logger.info('Inscribing profile picture using HCS-11 client');\n\n const wrappedProgressCallback = (data: RegistrationProgressData) => {\n progressReporter.report({\n stage: data.stage || 'confirming',\n message: data.message || 'Processing PFP inscription',\n progressPercent: data.progressPercent || 50,\n details: data.details,\n });\n };\n\n const imageResult = await this.hcs11Client.inscribeImage(\n buffer,\n fileName,\n { progressCallback: wrappedProgressCallback }\n );\n\n if (!imageResult.success) {\n progressReporter.failed(\n `Failed to inscribe profile picture: ${imageResult.error}`\n );\n this.logger.error(\n `Failed to inscribe profile picture: ${imageResult.error}`\n );\n return {\n pfpTopicId: '',\n success: false,\n error: imageResult.error || 'Failed to inscribe profile picture',\n transactionId: imageResult.transactionId || '',\n };\n }\n\n progressReporter.completed('Successfully inscribed profile picture', {\n pfpTopicId: imageResult.imageTopicId,\n });\n\n this.logger.info(\n `Successfully inscribed profile picture with topic ID: ${imageResult.imageTopicId}`\n );\n return {\n pfpTopicId: imageResult.imageTopicId,\n success: true,\n transactionId: imageResult.transactionId || '',\n };\n } catch (error: any) {\n this.logger.error(`Error inscribing profile picture: ${error.message}`);\n return {\n pfpTopicId: '',\n success: false,\n error: error.message,\n transactionId: '',\n };\n }\n }\n}\n"],"names":["mime.lookup"],"mappings":";;;;;;;AAwCA,MAAM,YAAY,OAAO,WAAW;AA4C7B,MAAM,yBAAyB,gBAAgB;AAAA,EAMpD,YAAY,QAAgC;AACpC,UAAA;AAAA,MACJ,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,MACjB,aAAa,OAAO;AAAA,IAAA,CACrB;AAPH,SAAQ,cAAkC;AASxC,SAAK,MAAM,OAAO;AACb,SAAA,yBACH,OAAO,0BAA0B;AAC9B,SAAA,SAAS,OAAO,YAAY;AAAA,MAC/B,OAAO,OAAO,YAAY;AAAA,MAC1B,QAAQ;AAAA,MACR,aAAa,OAAO;AAAA,IAAA,CACrB;AAED,QAAI,WAAW;AACT,UAAA;AACF,cAAM,EAAE,WAAW,WAAW,KAAK,oBAAoB;AAElD,aAAA,cAAc,IAAI,YAAY;AAAA,UACjC,SAAS,OAAO;AAAA,UAChB,MAAM;AAAA,YACJ,YAAY;AAAA,YACZ;AAAA,UACF;AAAA,UACA,UAAU,OA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;AAAA,MAAA;AAGF,uBAAiB,UAAU,0CAA0C;AAAA,QACnE,YAAY,YAAY;AAAA,MAAA,CACzB;AAED,WAAK,OAAO;AAAA,QACV,yDAAyD,YAAY,YAAY;AAAA,MACnF;AACO,aAAA;AAAA,QACL,YAAY,YAAY;AAAA,QACxB,SAAS;AAAA,QACT,eAAe,YAAY,iBAAiB;AAAA,MAC9C;AAAA,aACO,OAAY;AACnB,WAAK,OAAO,MAAM,qCAAqC,MAAM,OAAO,EAAE;AAC/D,aAAA;AAAA,QACL,YAAY;AAAA,QACZ,SAAS;AAAA,QACT,OAAO,MAAM;AAAA,QACb,eAAe;AAAA,MACjB;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import speedometer from "./standards-sdk.es108.js";
|
|
2
2
|
import throttle from "./standards-sdk.es109.js";
|
|
3
|
-
import utils from "./standards-sdk.
|
|
3
|
+
import utils from "./standards-sdk.es38.js";
|
|
4
4
|
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
5
5
|
let bytesNotified = 0;
|
|
6
6
|
const _speedometer = speedometer(50, 250);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import platform from "./standards-sdk.
|
|
2
|
-
import utils from "./standards-sdk.
|
|
1
|
+
import platform from "./standards-sdk.es84.js";
|
|
2
|
+
import utils from "./standards-sdk.es38.js";
|
|
3
3
|
import isURLSameOrigin from "./standards-sdk.es110.js";
|
|
4
4
|
import cookies from "./standards-sdk.es111.js";
|
|
5
|
-
import buildFullPath from "./standards-sdk.
|
|
6
|
-
import mergeConfig from "./standards-sdk.
|
|
7
|
-
import AxiosHeaders from "./standards-sdk.
|
|
8
|
-
import buildURL from "./standards-sdk.
|
|
5
|
+
import buildFullPath from "./standards-sdk.es80.js";
|
|
6
|
+
import mergeConfig from "./standards-sdk.es41.js";
|
|
7
|
+
import AxiosHeaders from "./standards-sdk.es52.js";
|
|
8
|
+
import buildURL from "./standards-sdk.es77.js";
|
|
9
9
|
const resolveConfig = (config) => {
|
|
10
10
|
const newConfig = mergeConfig({}, config);
|
|
11
11
|
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import CanceledError from "./standards-sdk.
|
|
2
|
-
import AxiosError from "./standards-sdk.
|
|
3
|
-
import utils from "./standards-sdk.
|
|
1
|
+
import CanceledError from "./standards-sdk.es44.js";
|
|
2
|
+
import AxiosError from "./standards-sdk.es49.js";
|
|
3
|
+
import utils from "./standards-sdk.es38.js";
|
|
4
4
|
const composeSignals = (signals, timeout) => {
|
|
5
5
|
const { length } = signals = signals ? signals.filter(Boolean) : [];
|
|
6
6
|
if (timeout || length) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import platform from "./standards-sdk.
|
|
1
|
+
import platform from "./standards-sdk.es84.js";
|
|
2
2
|
const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin, isMSIE) => (url) => {
|
|
3
3
|
url = new URL(url, platform.origin);
|
|
4
4
|
return origin.protocol === url.protocol && origin.host === url.host && (isMSIE || origin.port === url.port);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import utils from "./standards-sdk.
|
|
2
|
-
import platform from "./standards-sdk.
|
|
1
|
+
import utils from "./standards-sdk.es38.js";
|
|
2
|
+
import platform from "./standards-sdk.es84.js";
|
|
3
3
|
const cookies = platform.hasStandardBrowserEnv ? (
|
|
4
4
|
// Standard browser envs support document.cookie
|
|
5
5
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es12.js","sources":["../../src/hcs-11/index.ts"],"sourcesContent":["import {\n AccountId,\n AccountInfoQuery,\n AccountUpdateTransaction,\n Client,\n PrivateKey,\n Status,\n Transaction,\n} from '@hashgraph/sdk';\nimport {\n inscribe,\n inscribeWithSigner,\n InscriptionInput,\n InscriptionOptions,\n} from '../inscribe';\nimport { Logger, LogLevel } from '../utils/logger';\nimport * as mime from 'mime-types';\nimport { z } from 'zod';\nimport type { Signer } from '@hashgraph/sdk';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { RegistrationProgressCallback } from '../hcs-10/types.d';\nimport * as fileType from 'file-type';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { HederaMirrorNode } from '../services';\nimport { TopicInfo } from '../services/types';\n\nexport enum ProfileType {\n PERSONAL = 0,\n AI_AGENT = 1,\n}\n\nexport enum AIAgentType {\n MANUAL = 0,\n AUTONOMOUS = 1,\n}\n\nexport enum EndpointType {\n REST = 0,\n WEBSOCKET = 1,\n GRPC = 2,\n}\n\nexport enum AIAgentCapability {\n TEXT_GENERATION = 0,\n IMAGE_GENERATION = 1,\n AUDIO_GENERATION = 2,\n VIDEO_GENERATION = 3,\n CODE_GENERATION = 4,\n LANGUAGE_TRANSLATION = 5,\n SUMMARIZATION_EXTRACTION = 6,\n KNOWLEDGE_RETRIEVAL = 7,\n DATA_INTEGRATION = 8,\n MARKET_INTELLIGENCE = 9,\n TRANSACTION_ANALYTICS = 10,\n SMART_CONTRACT_AUDIT = 11,\n GOVERNANCE_FACILITATION = 12,\n SECURITY_MONITORING = 13,\n COMPLIANCE_ANALYSIS = 14,\n FRAUD_DETECTION = 15,\n MULTI_AGENT_COORDINATION = 16,\n API_INTEGRATION = 17,\n WORKFLOW_AUTOMATION = 18,\n}\n\nexport const SUPPORTED_SOCIAL_PLATFORMS = [\n 'twitter',\n 'github',\n 'discord',\n 'telegram',\n 'linkedin',\n 'youtube',\n];\n\nexport interface SocialLink {\n platform: string;\n handle: string;\n}\n\nexport interface AIAgentDetails {\n type: AIAgentType;\n capabilities: AIAgentCapability[];\n model: string;\n creator?: string;\n}\n\nexport interface BaseProfile {\n version: string;\n type: ProfileType;\n display_name: string;\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n}\n\nexport interface PersonalProfile extends BaseProfile {\n type: ProfileType.PERSONAL;\n language?: string;\n timezone?: string;\n}\n\nexport interface AIAgentProfile extends BaseProfile {\n type: ProfileType.AI_AGENT;\n aiAgent: AIAgentDetails;\n}\n\nexport type HCS11Profile = PersonalProfile | AIAgentProfile;\n\nexport interface HCS11Auth {\n operatorId: string;\n privateKey?: string;\n signer?: DAppSigner | Signer;\n}\n\nexport interface HCS11ClientConfig {\n network: 'mainnet' | 'testnet';\n auth: HCS11Auth;\n logLevel?: LogLevel;\n}\n\nexport interface TransactionResult<T = unknown> {\n success: boolean;\n error?: string;\n result?: T;\n}\n\nexport interface InscribeProfileResponse {\n profileTopicId: string;\n transactionId: string;\n success: boolean;\n error?: string;\n}\n\nexport interface InscribeImageResponse {\n imageTopicId: string;\n transactionId: string;\n success: boolean;\n error?: string;\n}\n\nexport interface AIAgentMetadata {\n type: 'autonomous' | 'manual';\n}\n\nexport interface ProgressOptions {\n progressCallback?: RegistrationProgressCallback;\n}\n\nexport interface InscribeImageOptions extends ProgressOptions {\n waitForConfirmation?: boolean;\n}\n\nexport interface InscribeProfileOptions extends ProgressOptions {\n waitForConfirmation?: boolean;\n}\n\nconst SocialLinkSchema = z.object({\n platform: z.string().min(1),\n handle: z.string().min(1),\n});\n\nconst AIAgentDetailsSchema = z.object({\n type: z.nativeEnum(AIAgentType),\n capabilities: z.array(z.nativeEnum(AIAgentCapability)).min(1),\n model: z.string().min(1),\n creator: z.string().optional(),\n});\n\nconst BaseProfileSchema = z.object({\n version: z.string().min(1),\n type: z.nativeEnum(ProfileType),\n display_name: z.string().min(1),\n alias: z.string().optional(),\n bio: z.string().optional(),\n socials: z.array(SocialLinkSchema).optional(),\n profileImage: z.string().optional(),\n properties: z.record(z.any()).optional(),\n inboundTopicId: z.string().optional(),\n outboundTopicId: z.string().optional(),\n});\n\nconst PersonalProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.PERSONAL),\n language: z.string().optional(),\n timezone: z.string().optional(),\n});\n\nconst AIAgentProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.AI_AGENT),\n aiAgent: AIAgentDetailsSchema,\n});\n\nconst HCS11ProfileSchema = z.union([\n PersonalProfileSchema,\n AIAgentProfileSchema,\n]);\n\nexport const capabilityNameToCapabilityMap: Record<string, AIAgentCapability> =\n {\n text_generation: AIAgentCapability.TEXT_GENERATION,\n image_generation: AIAgentCapability.IMAGE_GENERATION,\n audio_generation: AIAgentCapability.AUDIO_GENERATION,\n video_generation: AIAgentCapability.VIDEO_GENERATION,\n code_generation: AIAgentCapability.CODE_GENERATION,\n language_translation: AIAgentCapability.LANGUAGE_TRANSLATION,\n summarization: AIAgentCapability.SUMMARIZATION_EXTRACTION,\n extraction: AIAgentCapability.SUMMARIZATION_EXTRACTION,\n knowledge_retrieval: AIAgentCapability.KNOWLEDGE_RETRIEVAL,\n data_integration: AIAgentCapability.DATA_INTEGRATION,\n data_visualization: AIAgentCapability.DATA_INTEGRATION,\n market_intelligence: AIAgentCapability.MARKET_INTELLIGENCE,\n transaction_analytics: AIAgentCapability.TRANSACTION_ANALYTICS,\n smart_contract_audit: AIAgentCapability.SMART_CONTRACT_AUDIT,\n governance: AIAgentCapability.GOVERNANCE_FACILITATION,\n security_monitoring: AIAgentCapability.SECURITY_MONITORING,\n compliance_analysis: AIAgentCapability.COMPLIANCE_ANALYSIS,\n fraud_detection: AIAgentCapability.FRAUD_DETECTION,\n multi_agent: AIAgentCapability.MULTI_AGENT_COORDINATION,\n api_integration: AIAgentCapability.API_INTEGRATION,\n workflow_automation: AIAgentCapability.WORKFLOW_AUTOMATION,\n };\n\nexport class HCS11Client {\n private client: Client;\n private auth: HCS11Auth;\n private network: string;\n private logger: Logger;\n private mirrorNode: HederaMirrorNode;\n\n constructor(config: HCS11ClientConfig) {\n this.client =\n config.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();\n this.auth = config.auth;\n this.network = config.network;\n this.mirrorNode = new HederaMirrorNode(\n this.network as 'mainnet' | 'testnet',\n this.logger\n );\n\n if (this.auth.privateKey) {\n const privateKey = PrivateKey.fromString(this.auth.privateKey);\n this.client.setOperator(this.auth.operatorId, privateKey);\n }\n\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-11',\n });\n }\n\n public getClient(): Client {\n return this.client;\n }\n\n public getOperatorId(): string {\n return this.auth.operatorId;\n }\n\n public createPersonalProfile(\n displayName: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n language?: string;\n timezone?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n }\n ): PersonalProfile {\n return {\n version: '1.0',\n type: ProfileType.PERSONAL,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n language: options?.language,\n timezone: options?.timezone,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n };\n }\n\n public createAIAgentProfile(\n displayName: string,\n agentType: AIAgentType,\n capabilities: AIAgentCapability[],\n model: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n creator?: string;\n }\n ): AIAgentProfile {\n const validation = this.validateProfile({\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n });\n\n if (!validation.valid) {\n throw new Error(\n `Invalid AI Agent Profile: ${validation.errors.join(', ')}`\n );\n }\n\n return {\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n };\n }\n\n public validateProfile(profile: unknown): {\n valid: boolean;\n errors: string[];\n } {\n const result = HCS11ProfileSchema.safeParse(profile);\n\n if (result.success) {\n return { valid: true, errors: [] };\n }\n\n const formattedErrors = result.error.errors.map((err) => {\n const path = err.path.join('.');\n let message = err.message;\n\n if (err.code === 'invalid_type') {\n message = `Expected ${err.expected}, got ${err.received}`;\n } else if (err.code === 'invalid_enum_value') {\n const validOptions = (err as any).options?.join(', ');\n message = `Invalid value. Valid options are: ${validOptions}`;\n } else if (err.code === 'too_small' && err.type === 'string') {\n message = 'Cannot be empty';\n }\n\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors: formattedErrors };\n }\n\n public profileToJSONString(profile: HCS11Profile): string {\n return JSON.stringify(profile);\n }\n\n public parseProfileFromString(profileStr: string): HCS11Profile | null {\n try {\n const parsedProfile = JSON.parse(profileStr);\n const validation = this.validateProfile(parsedProfile);\n if (!validation.valid) {\n this.logger.error('Invalid profile format:', validation.errors);\n return null;\n }\n return parsedProfile as HCS11Profile;\n } catch (error) {\n this.logger.error('Error parsing profile:', error);\n return null;\n }\n }\n\n public setProfileForAccountMemo(\n topicId: string,\n topicStandard: 1 | 2 | 7 = 1\n ): string {\n return `hcs-11:hcs://${topicStandard}/${topicId}`;\n }\n\n private async executeTransaction<T>(\n transaction: Transaction\n ): Promise<TransactionResult<T>> {\n try {\n if (this.auth.privateKey) {\n const signedTx = await transaction.signWithOperator(this.client);\n const response = await signedTx.execute(this.client);\n const receipt = await response.getReceipt(this.client);\n\n if (receipt.status !== Status.Success) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n }\n\n if (!this.auth.signer) {\n throw new Error('No valid authentication method provided');\n }\n\n const signer = this.auth.signer;\n const frozenTransaction = await transaction.freezeWithSigner(signer);\n const response = await frozenTransaction.executeWithSigner(signer);\n const receipt = await response.getReceiptWithSigner(signer);\n\n if (receipt.status !== Status.Success) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error during transaction execution',\n };\n }\n }\n\n public async inscribeImage(\n buffer: Buffer,\n fileName: string,\n options?: InscribeImageOptions\n ): Promise<InscribeImageResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Image',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Preparing to inscribe image', 0);\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const waitForConfirmation = options?.waitForConfirmation ?? true;\n\n let inscriptionResponse;\n if (this.auth.signer) {\n if ('accountId' in this.auth.signer) {\n progressReporter.preparing('Using signer for inscription', 10);\n\n inscriptionResponse = await inscribeWithSigner(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n this.auth.signer as DAppSigner,\n {\n network: this.network as 'mainnet' | 'testnet',\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 4000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n } else {\n progressReporter.failed(\n 'Signer must be a DAppSigner for inscription'\n );\n throw new Error('Signer must be a DAppSigner for inscription');\n }\n } else {\n if (!this.auth.privateKey) {\n progressReporter.failed('Private key is required for inscription');\n this.logger.error('Private key is required for inscription');\n throw new Error('Private key is required for inscription');\n }\n\n progressReporter.preparing('Using private key for inscription', 10);\n\n inscriptionResponse = await inscribe(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n {\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 2000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n }\n\n if (inscriptionResponse.confirmed) {\n progressReporter.completed('Image inscription completed', {\n topic_id: inscriptionResponse.inscription.topic_id,\n });\n return {\n imageTopicId: inscriptionResponse.inscription.topic_id || '',\n transactionId: inscriptionResponse.result.jobId,\n success: true,\n };\n } else {\n progressReporter.verifying('Waiting for inscription confirmation', 50, {\n jobId: inscriptionResponse.result.jobId,\n });\n return {\n imageTopicId: '',\n transactionId: inscriptionResponse.result.jobId,\n success: false,\n error: 'Inscription not confirmed',\n };\n }\n } catch (error: any) {\n this.logger.error('Error inscribing image:', error);\n return {\n imageTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Error inscribing image',\n };\n }\n }\n\n public async inscribeProfile(\n profile: HCS11Profile,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n this.logger.info('Inscribing HCS-11 profile');\n\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Profile',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Validating profile data', 5);\n\n const validation = this.validateProfile(profile);\n if (!validation.valid) {\n progressReporter.failed(\n `Invalid profile: ${validation.errors.join(', ')}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: `Invalid profile: ${validation.errors.join(', ')}`,\n };\n }\n\n progressReporter.preparing('Formatting profile for inscription', 15);\n\n const profileJson = this.profileToJSONString(profile);\n const fileName = `profile-${profile.display_name\n .toLowerCase()\n .replace(/\\s+/g, '-')}.json`;\n\n try {\n const contentBuffer = Buffer.from(profileJson, 'utf-8');\n const contentType = 'application/json';\n\n progressReporter.preparing('Preparing profile for inscription', 20);\n\n const input: InscriptionInput = {\n type: 'buffer',\n buffer: contentBuffer,\n fileName,\n mimeType: contentType,\n };\n\n const inscriptionOptions: InscriptionOptions = {\n waitForConfirmation: true,\n mode: 'file',\n network: this.network as 'mainnet' | 'testnet',\n waitMaxAttempts: 100,\n waitIntervalMs: 2000,\n progressCallback: (data: any) => {\n const adjustedPercent = 20 + Number(data?.progressPercent || 0) * 0.75;\n progressReporter?.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n };\n\n progressReporter.submitting('Submitting profile to Hedera network', 30);\n\n const inscriptionResponse = this.auth.privateKey\n ? await inscribe(\n input,\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n inscriptionOptions,\n )\n : await inscribeWithSigner(\n input,\n this.auth.signer as DAppSigner,\n inscriptionOptions\n );\n\n if (\n !inscriptionResponse.confirmed ||\n !inscriptionResponse.inscription.topic_id\n ) {\n progressReporter.failed('Failed to inscribe profile content');\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: 'Failed to inscribe profile content',\n };\n }\n\n const topicId = inscriptionResponse.inscription.topic_id;\n\n progressReporter.completed('Profile inscription completed', {\n topicId,\n transactionId: inscriptionResponse.result.transactionId,\n });\n\n return {\n profileTopicId: topicId,\n transactionId: inscriptionResponse.result.transactionId,\n success: true,\n };\n } catch (error: any) {\n progressReporter.failed(\n `Error inscribing profile: ${error.message || 'Unknown error'}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Unknown error during inscription',\n };\n }\n }\n\n public async updateAccountMemoWithProfile(\n accountId: string | AccountId,\n profileTopicId: string\n ): Promise<TransactionResult> {\n try {\n this.logger.info(\n `Updating account memo for ${accountId} with profile ${profileTopicId}`\n );\n const memo = this.setProfileForAccountMemo(profileTopicId);\n\n const transaction = new AccountUpdateTransaction()\n .setAccountMemo(memo)\n .setAccountId(accountId);\n\n return this.executeTransaction(transaction);\n } catch (error) {\n this.logger.error(\n `Error updating account memo: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error updating account memo',\n };\n }\n }\n\n /**\n * Creates and inscribes a profile.\n *\n * @param profile - The profile to create and inscribe.\n * @param updateAccountMemo - Whether to update the account memo with the profile.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the inscription result.\n */\n public async createAndInscribeProfile(\n profile: HCS11Profile,\n updateAccountMemo = true,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-ProfileCreation',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Starting profile creation process', 0);\n\n const inscriptionProgress = progressReporter.createSubProgress({\n minPercent: 0,\n maxPercent: 80,\n logPrefix: 'Inscription',\n });\n\n const inscriptionResult = await this.inscribeProfile(profile, {\n ...options,\n progressCallback: (data: any) => {\n inscriptionProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent,\n details: data.details,\n });\n },\n });\n\n if (!inscriptionResult?.success) {\n progressReporter.failed('Profile inscription failed', {\n error: inscriptionResult?.error,\n });\n return inscriptionResult;\n }\n\n progressReporter.confirming('Profile inscribed, updating account memo', 85);\n\n if (updateAccountMemo) {\n const memoResult = await this.updateAccountMemoWithProfile(\n this.auth.operatorId,\n inscriptionResult.profileTopicId\n );\n\n if (!memoResult.success) {\n progressReporter.failed('Failed to update account memo', {\n error: memoResult?.error,\n });\n return {\n ...inscriptionResult,\n success: false,\n error: memoResult?.error,\n };\n }\n }\n\n progressReporter.completed('Profile creation completed successfully', {\n profileTopicId: inscriptionResult.profileTopicId,\n transactionId: inscriptionResult.transactionId,\n });\n\n return inscriptionResult;\n }\n\n /**\n * Gets the capabilities from the capability names.\n *\n * @param capabilityNames - The capability names to get the capabilities for.\n * @returns The capabilities.\n */\n public async getCapabilitiesFromTags(\n capabilityNames: string[]\n ): Promise<number[]> {\n const capabilities: number[] = [];\n\n if (capabilityNames.length === 0) {\n return [AIAgentCapability.TEXT_GENERATION];\n }\n\n for (const capabilityName of capabilityNames) {\n const capability =\n capabilityNameToCapabilityMap[capabilityName.toLowerCase()];\n if (capability !== undefined && !capabilities.includes(capability)) {\n capabilities.push(capability);\n }\n }\n\n if (capabilities.length === 0) {\n capabilities.push(AIAgentCapability.TEXT_GENERATION);\n }\n\n return capabilities;\n }\n\n /**\n * Gets the agent type from the metadata.\n *\n * @param metadata - The metadata of the agent.\n * @returns The agent type.\n */\n public getAgentTypeFromMetadata(metadata: AIAgentMetadata): AIAgentType {\n if (metadata.type === 'autonomous') {\n return AIAgentType.AUTONOMOUS;\n } else {\n return AIAgentType.MANUAL;\n }\n }\n\n /**\n * Fetches a profile from the account memo.\n *\n * @param accountId - The account ID of the agent to fetch the profile for.\n * @param network - The network to use for the fetch.\n * @returns A promise that resolves to the profile.\n */\n public async fetchProfileByAccountId(\n accountId: string | AccountId,\n network?: string\n ): Promise<{\n success: boolean;\n profile?: HCS11Profile;\n error?: string;\n topicInfo?: TopicInfo;\n }> {\n try {\n this.logger.info(\n `Fetching profile for account ${accountId.toString()} on ${\n this.network\n }`\n );\n\n const memo = await this.mirrorNode.getAccountMemo(accountId.toString());\n\n this.logger.info(`Got account memo: ${memo}`);\n\n if (!memo?.startsWith('hcs-11:')) {\n return {\n success: false,\n error: `Account ${accountId.toString()} does not have a valid HCS-11 memo`,\n };\n }\n\n this.logger.info(`Found HCS-11 memo: ${memo}`);\n\n const protocolReference = memo.substring(7);\n\n if (protocolReference?.startsWith('hcs://')) {\n const hcsFormat = protocolReference.match(/hcs:\\/\\/(\\d+)\\/(.+)/);\n\n if (!hcsFormat) {\n return {\n success: false,\n error: `Invalid HCS protocol reference format: ${protocolReference}`,\n };\n }\n\n const [_, protocolId, profileTopicId] = hcsFormat;\n const networkParam = network || this.network || 'mainnet';\n\n this.logger.info(\n `Retrieving profile from Kiloscribe CDN: ${profileTopicId}`\n );\n const cdnUrl = `https://kiloscribe.com/api/inscription-cdn/${profileTopicId}?network=${networkParam}`;\n\n try {\n const response = await fetch(cdnUrl);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Kiloscribe CDN: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n if (!profileData) {\n return {\n success: false,\n error: `No profile data found for topic ${profileTopicId}`,\n };\n }\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId,\n },\n };\n } catch (cdnError: any) {\n this.logger.error(\n `Error retrieving from Kiloscribe CDN: ${cdnError.message}`\n );\n return {\n success: false,\n error: `Error retrieving from Kiloscribe CDN: ${cdnError.message}`,\n };\n }\n } else if (protocolReference.startsWith('ipfs://')) {\n this.logger.warn('IPFS protocol references are not fully supported');\n const response = await fetch(\n `https://ipfs.io/ipfs/${protocolReference.replace('ipfs://', '')}`\n );\n const profileData = await response.json();\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else if (protocolReference.startsWith('ar://')) {\n const arTxId = protocolReference.replace('ar://', '');\n const response = await fetch(`https://arweave.net/${arTxId}`);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Arweave ${arTxId}: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else {\n return {\n success: false,\n error: `Invalid protocol reference format: ${protocolReference}`,\n };\n }\n } catch (error: any) {\n this.logger.error(`Error fetching profile: ${error.message}`);\n return {\n success: false,\n error: `Error fetching profile: ${error.message}`,\n };\n }\n }\n}\n"],"names":["ProfileType","AIAgentType","EndpointType","AIAgentCapability","response","receipt","mime.lookup"],"mappings":";;;;;;;AA0BY,IAAA,gCAAAA,iBAAL;AACLA,eAAAA,aAAA,cAAW,CAAX,IAAA;AACAA,eAAAA,aAAA,cAAW,CAAX,IAAA;AAFUA,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAKA,IAAA,gCAAAC,iBAAL;AACLA,eAAAA,aAAA,YAAS,CAAT,IAAA;AACAA,eAAAA,aAAA,gBAAa,CAAb,IAAA;AAFUA,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAKA,IAAA,iCAAAC,kBAAL;AACLA,gBAAAA,cAAA,UAAO,CAAP,IAAA;AACAA,gBAAAA,cAAA,eAAY,CAAZ,IAAA;AACAA,gBAAAA,cAAA,UAAO,CAAP,IAAA;AAHUA,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAMA,IAAA,sCAAAC,uBAAL;AACLA,qBAAAA,mBAAA,qBAAkB,CAAlB,IAAA;AACAA,qBAAAA,mBAAA,sBAAmB,CAAnB,IAAA;AACAA,qBAAAA,mBAAA,sBAAmB,CAAnB,IAAA;AACAA,qBAAAA,mBAAA,sBAAmB,CAAnB,IAAA;AACAA,qBAAAA,mBAAA,qBAAkB,CAAlB,IAAA;AACAA,qBAAAA,mBAAA,0BAAuB,CAAvB,IAAA;AACAA,qBAAAA,mBAAA,8BAA2B,CAA3B,IAAA;AACAA,qBAAAA,mBAAA,yBAAsB,CAAtB,IAAA;AACAA,qBAAAA,mBAAA,sBAAmB,CAAnB,IAAA;AACAA,qBAAAA,mBAAA,yBAAsB,CAAtB,IAAA;AACAA,qBAAAA,mBAAA,2BAAwB,EAAxB,IAAA;AACAA,qBAAAA,mBAAA,0BAAuB,EAAvB,IAAA;AACAA,qBAAAA,mBAAA,6BAA0B,EAA1B,IAAA;AACAA,qBAA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AY;AAAA,UAAA;AAAA,QAEhC;AAAA,MACS,WAAA,kBAAkB,WAAW,OAAO,GAAG;AAChD,cAAM,SAAS,kBAAkB,QAAQ,SAAS,EAAE;AACpD,cAAM,WAAW,MAAM,MAAM,uBAAuB,MAAM,EAAE;AAExD,YAAA,CAAC,SAAS,IAAI;AACT,iBAAA;AAAA,YACL,SAAS;AAAA,YACT,OAAO,wCAAwC,MAAM,KAAK,SAAS,UAAU;AAAA,UAC/E;AAAA,QAAA;AAGI,cAAA,cAAc,MAAM,SAAS,KAAK;AAEjC,eAAA;AAAA,UACL,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,YACT,cAAc,YAAY;AAAA,YAC1B,eAAe,YAAY;AAAA,YAC3B,gBAAgB,YAAY;AAAA,UAAA;AAAA,QAEhC;AAAA,MAAA,OACK;AACE,eAAA;AAAA,UACL,SAAS;AAAA,UACT,OAAO,sCAAsC,iBAAiB;AAAA,QAChE;AAAA,MAAA;AAAA,aAEK,OAAY;AACnB,WAAK,OAAO,MAAM,2BAA2B,MAAM,OAAO,EAAE;AACrD,aAAA;AAAA,QACL,SAAS;AAAA,QACT,OAAO,2BAA2B,MAAM,OAAO;AAAA,MACjD;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es12.js","sources":["../../src/hcs-11/index.ts"],"sourcesContent":["import {\n AccountId,\n AccountInfoQuery,\n AccountUpdateTransaction,\n Client,\n PrivateKey,\n Status,\n Transaction,\n} from '@hashgraph/sdk';\nimport {\n inscribe,\n inscribeWithSigner,\n InscriptionInput,\n InscriptionOptions,\n} from '../inscribe';\nimport { Logger, LogLevel } from '../utils/logger';\nimport * as mime from 'mime-types';\nimport { z } from 'zod';\nimport type { Signer } from '@hashgraph/sdk';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { RegistrationProgressCallback } from '../hcs-10/types';\nimport * as fileType from 'file-type';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { HederaMirrorNode } from '../services';\nimport { TopicInfo } from '../services/types';\n\nexport enum ProfileType {\n PERSONAL = 0,\n AI_AGENT = 1,\n}\n\nexport enum AIAgentType {\n MANUAL = 0,\n AUTONOMOUS = 1,\n}\n\nexport enum EndpointType {\n REST = 0,\n WEBSOCKET = 1,\n GRPC = 2,\n}\n\nexport enum AIAgentCapability {\n TEXT_GENERATION = 0,\n IMAGE_GENERATION = 1,\n AUDIO_GENERATION = 2,\n VIDEO_GENERATION = 3,\n CODE_GENERATION = 4,\n LANGUAGE_TRANSLATION = 5,\n SUMMARIZATION_EXTRACTION = 6,\n KNOWLEDGE_RETRIEVAL = 7,\n DATA_INTEGRATION = 8,\n MARKET_INTELLIGENCE = 9,\n TRANSACTION_ANALYTICS = 10,\n SMART_CONTRACT_AUDIT = 11,\n GOVERNANCE_FACILITATION = 12,\n SECURITY_MONITORING = 13,\n COMPLIANCE_ANALYSIS = 14,\n FRAUD_DETECTION = 15,\n MULTI_AGENT_COORDINATION = 16,\n API_INTEGRATION = 17,\n WORKFLOW_AUTOMATION = 18,\n}\n\nexport const SUPPORTED_SOCIAL_PLATFORMS = [\n 'twitter',\n 'github',\n 'discord',\n 'telegram',\n 'linkedin',\n 'youtube',\n];\n\nexport interface SocialLink {\n platform: string;\n handle: string;\n}\n\nexport interface AIAgentDetails {\n type: AIAgentType;\n capabilities: AIAgentCapability[];\n model: string;\n creator?: string;\n}\n\nexport interface BaseProfile {\n version: string;\n type: ProfileType;\n display_name: string;\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n}\n\nexport interface PersonalProfile extends BaseProfile {\n type: ProfileType.PERSONAL;\n language?: string;\n timezone?: string;\n}\n\nexport interface AIAgentProfile extends BaseProfile {\n type: ProfileType.AI_AGENT;\n aiAgent: AIAgentDetails;\n}\n\nexport type HCS11Profile = PersonalProfile | AIAgentProfile;\n\nexport interface HCS11Auth {\n operatorId: string;\n privateKey?: string;\n signer?: DAppSigner | Signer;\n}\n\nexport interface HCS11ClientConfig {\n network: 'mainnet' | 'testnet';\n auth: HCS11Auth;\n logLevel?: LogLevel;\n}\n\nexport interface TransactionResult<T = unknown> {\n success: boolean;\n error?: string;\n result?: T;\n}\n\nexport interface InscribeProfileResponse {\n profileTopicId: string;\n transactionId: string;\n success: boolean;\n error?: string;\n}\n\nexport interface InscribeImageResponse {\n imageTopicId: string;\n transactionId: string;\n success: boolean;\n error?: string;\n}\n\nexport interface AIAgentMetadata {\n type: 'autonomous' | 'manual';\n}\n\nexport interface ProgressOptions {\n progressCallback?: RegistrationProgressCallback;\n}\n\nexport interface InscribeImageOptions extends ProgressOptions {\n waitForConfirmation?: boolean;\n}\n\nexport interface InscribeProfileOptions extends ProgressOptions {\n waitForConfirmation?: boolean;\n}\n\nconst SocialLinkSchema = z.object({\n platform: z.string().min(1),\n handle: z.string().min(1),\n});\n\nconst AIAgentDetailsSchema = z.object({\n type: z.nativeEnum(AIAgentType),\n capabilities: z.array(z.nativeEnum(AIAgentCapability)).min(1),\n model: z.string().min(1),\n creator: z.string().optional(),\n});\n\nconst BaseProfileSchema = z.object({\n version: z.string().min(1),\n type: z.nativeEnum(ProfileType),\n display_name: z.string().min(1),\n alias: z.string().optional(),\n bio: z.string().optional(),\n socials: z.array(SocialLinkSchema).optional(),\n profileImage: z.string().optional(),\n properties: z.record(z.any()).optional(),\n inboundTopicId: z.string().optional(),\n outboundTopicId: z.string().optional(),\n});\n\nconst PersonalProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.PERSONAL),\n language: z.string().optional(),\n timezone: z.string().optional(),\n});\n\nconst AIAgentProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.AI_AGENT),\n aiAgent: AIAgentDetailsSchema,\n});\n\nconst HCS11ProfileSchema = z.union([\n PersonalProfileSchema,\n AIAgentProfileSchema,\n]);\n\nexport const capabilityNameToCapabilityMap: Record<string, AIAgentCapability> =\n {\n text_generation: AIAgentCapability.TEXT_GENERATION,\n image_generation: AIAgentCapability.IMAGE_GENERATION,\n audio_generation: AIAgentCapability.AUDIO_GENERATION,\n video_generation: AIAgentCapability.VIDEO_GENERATION,\n code_generation: AIAgentCapability.CODE_GENERATION,\n language_translation: AIAgentCapability.LANGUAGE_TRANSLATION,\n summarization: AIAgentCapability.SUMMARIZATION_EXTRACTION,\n extraction: AIAgentCapability.SUMMARIZATION_EXTRACTION,\n knowledge_retrieval: AIAgentCapability.KNOWLEDGE_RETRIEVAL,\n data_integration: AIAgentCapability.DATA_INTEGRATION,\n data_visualization: AIAgentCapability.DATA_INTEGRATION,\n market_intelligence: AIAgentCapability.MARKET_INTELLIGENCE,\n transaction_analytics: AIAgentCapability.TRANSACTION_ANALYTICS,\n smart_contract_audit: AIAgentCapability.SMART_CONTRACT_AUDIT,\n governance: AIAgentCapability.GOVERNANCE_FACILITATION,\n security_monitoring: AIAgentCapability.SECURITY_MONITORING,\n compliance_analysis: AIAgentCapability.COMPLIANCE_ANALYSIS,\n fraud_detection: AIAgentCapability.FRAUD_DETECTION,\n multi_agent: AIAgentCapability.MULTI_AGENT_COORDINATION,\n api_integration: AIAgentCapability.API_INTEGRATION,\n workflow_automation: AIAgentCapability.WORKFLOW_AUTOMATION,\n };\n\nexport class HCS11Client {\n private client: Client;\n private auth: HCS11Auth;\n private network: string;\n private logger: Logger;\n private mirrorNode: HederaMirrorNode;\n\n constructor(config: HCS11ClientConfig) {\n this.client =\n config.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();\n this.auth = config.auth;\n this.network = config.network;\n this.mirrorNode = new HederaMirrorNode(\n this.network as 'mainnet' | 'testnet',\n this.logger\n );\n\n if (this.auth.privateKey) {\n const privateKey = PrivateKey.fromString(this.auth.privateKey);\n this.client.setOperator(this.auth.operatorId, privateKey);\n }\n\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-11',\n });\n }\n\n public getClient(): Client {\n return this.client;\n }\n\n public getOperatorId(): string {\n return this.auth.operatorId;\n }\n\n public createPersonalProfile(\n displayName: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n language?: string;\n timezone?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n }\n ): PersonalProfile {\n return {\n version: '1.0',\n type: ProfileType.PERSONAL,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n language: options?.language,\n timezone: options?.timezone,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n };\n }\n\n public createAIAgentProfile(\n displayName: string,\n agentType: AIAgentType,\n capabilities: AIAgentCapability[],\n model: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n creator?: string;\n }\n ): AIAgentProfile {\n const validation = this.validateProfile({\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n });\n\n if (!validation.valid) {\n throw new Error(\n `Invalid AI Agent Profile: ${validation.errors.join(', ')}`\n );\n }\n\n return {\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n };\n }\n\n public validateProfile(profile: unknown): {\n valid: boolean;\n errors: string[];\n } {\n const result = HCS11ProfileSchema.safeParse(profile);\n\n if (result.success) {\n return { valid: true, errors: [] };\n }\n\n const formattedErrors = result.error.errors.map((err) => {\n const path = err.path.join('.');\n let message = err.message;\n\n if (err.code === 'invalid_type') {\n message = `Expected ${err.expected}, got ${err.received}`;\n } else if (err.code === 'invalid_enum_value') {\n const validOptions = (err as any).options?.join(', ');\n message = `Invalid value. Valid options are: ${validOptions}`;\n } else if (err.code === 'too_small' && err.type === 'string') {\n message = 'Cannot be empty';\n }\n\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors: formattedErrors };\n }\n\n public profileToJSONString(profile: HCS11Profile): string {\n return JSON.stringify(profile);\n }\n\n public parseProfileFromString(profileStr: string): HCS11Profile | null {\n try {\n const parsedProfile = JSON.parse(profileStr);\n const validation = this.validateProfile(parsedProfile);\n if (!validation.valid) {\n this.logger.error('Invalid profile format:', validation.errors);\n return null;\n }\n return parsedProfile as HCS11Profile;\n } catch (error) {\n this.logger.error('Error parsing profile:', error);\n return null;\n }\n }\n\n public setProfileForAccountMemo(\n topicId: string,\n topicStandard: 1 | 2 | 7 = 1\n ): string {\n return `hcs-11:hcs://${topicStandard}/${topicId}`;\n }\n\n private async executeTransaction<T>(\n transaction: Transaction\n ): Promise<TransactionResult<T>> {\n try {\n if (this.auth.privateKey) {\n const signedTx = await transaction.signWithOperator(this.client);\n const response = await signedTx.execute(this.client);\n const receipt = await response.getReceipt(this.client);\n\n if (receipt.status !== Status.Success) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n }\n\n if (!this.auth.signer) {\n throw new Error('No valid authentication method provided');\n }\n\n const signer = this.auth.signer;\n const frozenTransaction = await transaction.freezeWithSigner(signer);\n const response = await frozenTransaction.executeWithSigner(signer);\n const receipt = await response.getReceiptWithSigner(signer);\n\n if (receipt.status !== Status.Success) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error during transaction execution',\n };\n }\n }\n\n public async inscribeImage(\n buffer: Buffer,\n fileName: string,\n options?: InscribeImageOptions\n ): Promise<InscribeImageResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Image',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Preparing to inscribe image', 0);\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const waitForConfirmation = options?.waitForConfirmation ?? true;\n\n let inscriptionResponse;\n if (this.auth.signer) {\n if ('accountId' in this.auth.signer) {\n progressReporter.preparing('Using signer for inscription', 10);\n\n inscriptionResponse = await inscribeWithSigner(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n this.auth.signer as DAppSigner,\n {\n network: this.network as 'mainnet' | 'testnet',\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 4000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n } else {\n progressReporter.failed(\n 'Signer must be a DAppSigner for inscription'\n );\n throw new Error('Signer must be a DAppSigner for inscription');\n }\n } else {\n if (!this.auth.privateKey) {\n progressReporter.failed('Private key is required for inscription');\n this.logger.error('Private key is required for inscription');\n throw new Error('Private key is required for inscription');\n }\n\n progressReporter.preparing('Using private key for inscription', 10);\n\n inscriptionResponse = await inscribe(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n {\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 2000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n }\n\n if (inscriptionResponse.confirmed) {\n progressReporter.completed('Image inscription completed', {\n topic_id: inscriptionResponse.inscription.topic_id,\n });\n return {\n imageTopicId: inscriptionResponse.inscription.topic_id || '',\n transactionId: inscriptionResponse.result.jobId,\n success: true,\n };\n } else {\n progressReporter.verifying('Waiting for inscription confirmation', 50, {\n jobId: inscriptionResponse.result.jobId,\n });\n return {\n imageTopicId: '',\n transactionId: inscriptionResponse.result.jobId,\n success: false,\n error: 'Inscription not confirmed',\n };\n }\n } catch (error: any) {\n this.logger.error('Error inscribing image:', error);\n return {\n imageTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Error inscribing image',\n };\n }\n }\n\n public async inscribeProfile(\n profile: HCS11Profile,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n this.logger.info('Inscribing HCS-11 profile');\n\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Profile',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Validating profile data', 5);\n\n const validation = this.validateProfile(profile);\n if (!validation.valid) {\n progressReporter.failed(\n `Invalid profile: ${validation.errors.join(', ')}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: `Invalid profile: ${validation.errors.join(', ')}`,\n };\n }\n\n progressReporter.preparing('Formatting profile for inscription', 15);\n\n const profileJson = this.profileToJSONString(profile);\n const fileName = `profile-${profile.display_name\n .toLowerCase()\n .replace(/\\s+/g, '-')}.json`;\n\n try {\n const contentBuffer = Buffer.from(profileJson, 'utf-8');\n const contentType = 'application/json';\n\n progressReporter.preparing('Preparing profile for inscription', 20);\n\n const input: InscriptionInput = {\n type: 'buffer',\n buffer: contentBuffer,\n fileName,\n mimeType: contentType,\n };\n\n const inscriptionOptions: InscriptionOptions = {\n waitForConfirmation: true,\n mode: 'file',\n network: this.network as 'mainnet' | 'testnet',\n waitMaxAttempts: 100,\n waitIntervalMs: 2000,\n progressCallback: (data: any) => {\n const adjustedPercent = 20 + Number(data?.progressPercent || 0) * 0.75;\n progressReporter?.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n };\n\n progressReporter.submitting('Submitting profile to Hedera network', 30);\n\n const inscriptionResponse = this.auth.privateKey\n ? await inscribe(\n input,\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n inscriptionOptions,\n )\n : await inscribeWithSigner(\n input,\n this.auth.signer as DAppSigner,\n inscriptionOptions\n );\n\n if (\n !inscriptionResponse.confirmed ||\n !inscriptionResponse.inscription.topic_id\n ) {\n progressReporter.failed('Failed to inscribe profile content');\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: 'Failed to inscribe profile content',\n };\n }\n\n const topicId = inscriptionResponse.inscription.topic_id;\n\n progressReporter.completed('Profile inscription completed', {\n topicId,\n transactionId: inscriptionResponse.result.transactionId,\n });\n\n return {\n profileTopicId: topicId,\n transactionId: inscriptionResponse.result.transactionId,\n success: true,\n };\n } catch (error: any) {\n progressReporter.failed(\n `Error inscribing profile: ${error.message || 'Unknown error'}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Unknown error during inscription',\n };\n }\n }\n\n public async updateAccountMemoWithProfile(\n accountId: string | AccountId,\n profileTopicId: string\n ): Promise<TransactionResult> {\n try {\n this.logger.info(\n `Updating account memo for ${accountId} with profile ${profileTopicId}`\n );\n const memo = this.setProfileForAccountMemo(profileTopicId);\n\n const transaction = new AccountUpdateTransaction()\n .setAccountMemo(memo)\n .setAccountId(accountId);\n\n return this.executeTransaction(transaction);\n } catch (error) {\n this.logger.error(\n `Error updating account memo: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error updating account memo',\n };\n }\n }\n\n /**\n * Creates and inscribes a profile.\n *\n * @param profile - The profile to create and inscribe.\n * @param updateAccountMemo - Whether to update the account memo with the profile.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the inscription result.\n */\n public async createAndInscribeProfile(\n profile: HCS11Profile,\n updateAccountMemo = true,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-ProfileCreation',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Starting profile creation process', 0);\n\n const inscriptionProgress = progressReporter.createSubProgress({\n minPercent: 0,\n maxPercent: 80,\n logPrefix: 'Inscription',\n });\n\n const inscriptionResult = await this.inscribeProfile(profile, {\n ...options,\n progressCallback: (data: any) => {\n inscriptionProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent,\n details: data.details,\n });\n },\n });\n\n if (!inscriptionResult?.success) {\n progressReporter.failed('Profile inscription failed', {\n error: inscriptionResult?.error,\n });\n return inscriptionResult;\n }\n\n progressReporter.confirming('Profile inscribed, updating account memo', 85);\n\n if (updateAccountMemo) {\n const memoResult = await this.updateAccountMemoWithProfile(\n this.auth.operatorId,\n inscriptionResult.profileTopicId\n );\n\n if (!memoResult.success) {\n progressReporter.failed('Failed to update account memo', {\n error: memoResult?.error,\n });\n return {\n ...inscriptionResult,\n success: false,\n error: memoResult?.error,\n };\n }\n }\n\n progressReporter.completed('Profile creation completed successfully', {\n profileTopicId: inscriptionResult.profileTopicId,\n transactionId: inscriptionResult.transactionId,\n });\n\n return inscriptionResult;\n }\n\n /**\n * Gets the capabilities from the capability names.\n *\n * @param capabilityNames - The capability names to get the capabilities for.\n * @returns The capabilities.\n */\n public async getCapabilitiesFromTags(\n capabilityNames: string[]\n ): Promise<number[]> {\n const capabilities: number[] = [];\n\n if (capabilityNames.length === 0) {\n return [AIAgentCapability.TEXT_GENERATION];\n }\n\n for (const capabilityName of capabilityNames) {\n const capability =\n capabilityNameToCapabilityMap[capabilityName.toLowerCase()];\n if (capability !== undefined && !capabilities.includes(capability)) {\n capabilities.push(capability);\n }\n }\n\n if (capabilities.length === 0) {\n capabilities.push(AIAgentCapability.TEXT_GENERATION);\n }\n\n return capabilities;\n }\n\n /**\n * Gets the agent type from the metadata.\n *\n * @param metadata - The metadata of the agent.\n * @returns The agent type.\n */\n public getAgentTypeFromMetadata(metadata: AIAgentMetadata): AIAgentType {\n if (metadata.type === 'autonomous') {\n return AIAgentType.AUTONOMOUS;\n } else {\n return AIAgentType.MANUAL;\n }\n }\n\n /**\n * Fetches a profile from the account memo.\n *\n * @param accountId - The account ID of the agent to fetch the profile for.\n * @param network - The network to use for the fetch.\n * @returns A promise that resolves to the profile.\n */\n public async fetchProfileByAccountId(\n accountId: string | AccountId,\n network?: string\n ): Promise<{\n success: boolean;\n profile?: HCS11Profile;\n error?: string;\n topicInfo?: TopicInfo;\n }> {\n try {\n this.logger.info(\n `Fetching profile for account ${accountId.toString()} on ${\n this.network\n }`\n );\n\n const memo = await this.mirrorNode.getAccountMemo(accountId.toString());\n\n this.logger.info(`Got account memo: ${memo}`);\n\n if (!memo?.startsWith('hcs-11:')) {\n return {\n success: false,\n error: `Account ${accountId.toString()} does not have a valid HCS-11 memo`,\n };\n }\n\n this.logger.info(`Found HCS-11 memo: ${memo}`);\n\n const protocolReference = memo.substring(7);\n\n if (protocolReference?.startsWith('hcs://')) {\n const hcsFormat = protocolReference.match(/hcs:\\/\\/(\\d+)\\/(.+)/);\n\n if (!hcsFormat) {\n return {\n success: false,\n error: `Invalid HCS protocol reference format: ${protocolReference}`,\n };\n }\n\n const [_, protocolId, profileTopicId] = hcsFormat;\n const networkParam = network || this.network || 'mainnet';\n\n this.logger.info(\n `Retrieving profile from Kiloscribe CDN: ${profileTopicId}`\n );\n const cdnUrl = `https://kiloscribe.com/api/inscription-cdn/${profileTopicId}?network=${networkParam}`;\n\n try {\n const response = await fetch(cdnUrl);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Kiloscribe CDN: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n if (!profileData) {\n return {\n success: false,\n error: `No profile data found for topic ${profileTopicId}`,\n };\n }\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId,\n },\n };\n } catch (cdnError: any) {\n this.logger.error(\n `Error retrieving from Kiloscribe CDN: ${cdnError.message}`\n );\n return {\n success: false,\n error: `Error retrieving from Kiloscribe CDN: ${cdnError.message}`,\n };\n }\n } else if (protocolReference.startsWith('ipfs://')) {\n this.logger.warn('IPFS protocol references are not fully supported');\n const response = await fetch(\n `https://ipfs.io/ipfs/${protocolReference.replace('ipfs://', '')}`\n );\n const profileData = await response.json();\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else if (protocolReference.startsWith('ar://')) {\n const arTxId = protocolReference.replace('ar://', '');\n const response = await fetch(`https://arweave.net/${arTxId}`);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Arweave ${arTxId}: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else {\n return {\n success: false,\n error: `Invalid protocol reference format: ${protocolReference}`,\n };\n }\n } catch (error: any) {\n this.logger.error(`Error fetching profile: ${error.message}`);\n return {\n success: false,\n error: `Error fetching profile: ${error.message}`,\n };\n }\n }\n}\n"],"names":["ProfileType","AIAgentType","EndpointType","AIAgentCapability","response","receipt","mime.lookup"],"mappings":";;;;;;;AA0BY,IAAA,gCAAAA,iBAAL;AACLA,eAAAA,aAAA,cAAW,CAAX,IAAA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;AAAA,YACL,SAAS;AAAA,YACT,OAAO,wCAAwC,MAAM,KAAK,SAAS,UAAU;AAAA,UAC/E;AAAA,QAAA;AAGI,cAAA,cAAc,MAAM,SAAS,KAAK;AAEjC,eAAA;AAAA,UACL,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,YACT,cAAc,YAAY;AAAA,YAC1B,eAAe,YAAY;AAAA,YAC3B,gBAAgB,YAAY;AAAA,UAAA;AAAA,QAEhC;AAAA,MAAA,OACK;AACE,eAAA;AAAA,UACL,SAAS;AAAA,UACT,OAAO,sCAAsC,iBAAiB;AAAA,QAChE;AAAA,MAAA;AAAA,aAEK,OAAY;AACnB,WAAK,OAAO,MAAM,2BAA2B,MAAM,OAAO,EAAE;AACrD,aAAA;AAAA,QACL,SAAS;AAAA,QACT,OAAO,2BAA2B,MAAM,OAAO;AAAA,MACjD;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
1
|
+
import { InscriptionSDK } from "./standards-sdk.es24.js";
|
|
2
2
|
import { Logger } from "./standards-sdk.es13.js";
|
|
3
3
|
import { ProgressReporter } from "./standards-sdk.es15.js";
|
|
4
4
|
async function inscribe(input, clientConfig, options, existingSDK) {
|
|
@@ -135,9 +135,7 @@ class HederaMirrorNode {
|
|
|
135
135
|
...messageJson,
|
|
136
136
|
consensus_timestamp: message.consensus_timestamp,
|
|
137
137
|
sequence_number: message.sequence_number,
|
|
138
|
-
created: new Date(
|
|
139
|
-
Number(message.consensus_timestamp) * 1e3
|
|
140
|
-
)
|
|
138
|
+
created: new Date(Number(message.consensus_timestamp) * 1e3)
|
|
141
139
|
});
|
|
142
140
|
} catch (error) {
|
|
143
141
|
this.logger.error(`Error processing message: ${error.message}`);
|