@hashgraphonline/standards-sdk 0.0.121 → 0.0.122

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.
Files changed (90) hide show
  1. package/dist/cjs/hcs-11/client.d.ts +18 -1
  2. package/dist/cjs/hcs-11/client.d.ts.map +1 -1
  3. package/dist/cjs/hcs-11/index.d.ts +1 -0
  4. package/dist/cjs/hcs-11/index.d.ts.map +1 -1
  5. package/dist/cjs/hcs-11/mcp-server-builder.d.ts +118 -0
  6. package/dist/cjs/hcs-11/mcp-server-builder.d.ts.map +1 -0
  7. package/dist/cjs/hcs-11/types.d.ts +77 -18
  8. package/dist/cjs/hcs-11/types.d.ts.map +1 -1
  9. package/dist/cjs/{index-CHar8dVv-B2IK-7-2.cjs → index-CHar8dVv-BkACF223.cjs} +2 -2
  10. package/dist/cjs/{index-CHar8dVv-B2IK-7-2.cjs.map → index-CHar8dVv-BkACF223.cjs.map} +1 -1
  11. package/dist/cjs/index-DjDDRcKz.cjs +11 -0
  12. package/dist/cjs/index-DjDDRcKz.cjs.map +1 -0
  13. package/dist/cjs/standards-sdk.cjs +1 -1
  14. package/dist/es/hcs-11/client.d.ts +18 -1
  15. package/dist/es/hcs-11/client.d.ts.map +1 -1
  16. package/dist/es/hcs-11/index.d.ts +1 -0
  17. package/dist/es/hcs-11/index.d.ts.map +1 -1
  18. package/dist/es/hcs-11/mcp-server-builder.d.ts +118 -0
  19. package/dist/es/hcs-11/mcp-server-builder.d.ts.map +1 -0
  20. package/dist/es/hcs-11/types.d.ts +77 -18
  21. package/dist/es/hcs-11/types.d.ts.map +1 -1
  22. package/dist/es/standards-sdk.es.js +17 -12
  23. package/dist/es/standards-sdk.es.js.map +1 -1
  24. package/dist/es/standards-sdk.es10.js +1 -1
  25. package/dist/es/standards-sdk.es11.js +2 -2
  26. package/dist/es/standards-sdk.es12.js +1 -1
  27. package/dist/es/standards-sdk.es13.js +226 -639
  28. package/dist/es/standards-sdk.es13.js.map +1 -1
  29. package/dist/es/standards-sdk.es14.js +770 -85
  30. package/dist/es/standards-sdk.es14.js.map +1 -1
  31. package/dist/es/standards-sdk.es15.js +132 -68
  32. package/dist/es/standards-sdk.es15.js.map +1 -1
  33. package/dist/es/standards-sdk.es16.js +66 -19
  34. package/dist/es/standards-sdk.es16.js.map +1 -1
  35. package/dist/es/standards-sdk.es17.js +18 -156
  36. package/dist/es/standards-sdk.es17.js.map +1 -1
  37. package/dist/es/standards-sdk.es18.js +150 -146
  38. package/dist/es/standards-sdk.es18.js.map +1 -1
  39. package/dist/es/standards-sdk.es19.js +134 -561
  40. package/dist/es/standards-sdk.es19.js.map +1 -1
  41. package/dist/es/standards-sdk.es2.js +1 -1
  42. package/dist/es/standards-sdk.es20.js +577 -24
  43. package/dist/es/standards-sdk.es20.js.map +1 -1
  44. package/dist/es/standards-sdk.es21.js +23 -400
  45. package/dist/es/standards-sdk.es21.js.map +1 -1
  46. package/dist/es/standards-sdk.es22.js +381 -1507
  47. package/dist/es/standards-sdk.es22.js.map +1 -1
  48. package/dist/es/standards-sdk.es23.js +1511 -133
  49. package/dist/es/standards-sdk.es23.js.map +1 -1
  50. package/dist/es/standards-sdk.es24.js +155 -7
  51. package/dist/es/standards-sdk.es24.js.map +1 -1
  52. package/dist/es/standards-sdk.es25.js +7 -7190
  53. package/dist/es/standards-sdk.es25.js.map +1 -1
  54. package/dist/es/standards-sdk.es26.js +7190 -2
  55. package/dist/es/standards-sdk.es26.js.map +1 -1
  56. package/dist/es/standards-sdk.es27.js +2 -501
  57. package/dist/es/standards-sdk.es27.js.map +1 -1
  58. package/dist/es/standards-sdk.es28.js +456 -64
  59. package/dist/es/standards-sdk.es28.js.map +1 -1
  60. package/dist/es/standards-sdk.es29.js +79 -36
  61. package/dist/es/standards-sdk.es29.js.map +1 -1
  62. package/dist/es/standards-sdk.es3.js +1 -1
  63. package/dist/es/standards-sdk.es30.js +32 -222
  64. package/dist/es/standards-sdk.es30.js.map +1 -1
  65. package/dist/es/standards-sdk.es31.js +183 -100
  66. package/dist/es/standards-sdk.es31.js.map +1 -1
  67. package/dist/es/standards-sdk.es32.js +167 -5
  68. package/dist/es/standards-sdk.es32.js.map +1 -1
  69. package/dist/es/standards-sdk.es33.js +8 -7132
  70. package/dist/es/standards-sdk.es33.js.map +1 -1
  71. package/dist/es/standards-sdk.es35.js +7138 -0
  72. package/dist/es/standards-sdk.es35.js.map +1 -0
  73. package/dist/es/standards-sdk.es4.js +1 -1
  74. package/dist/es/standards-sdk.es5.js +4 -4
  75. package/dist/es/standards-sdk.es7.js +7 -7
  76. package/dist/es/standards-sdk.es8.js +5 -5
  77. package/dist/es/standards-sdk.es9.js +2 -2
  78. package/dist/umd/hcs-11/client.d.ts +18 -1
  79. package/dist/umd/hcs-11/client.d.ts.map +1 -1
  80. package/dist/umd/hcs-11/index.d.ts +1 -0
  81. package/dist/umd/hcs-11/index.d.ts.map +1 -1
  82. package/dist/umd/hcs-11/mcp-server-builder.d.ts +118 -0
  83. package/dist/umd/hcs-11/mcp-server-builder.d.ts.map +1 -0
  84. package/dist/umd/hcs-11/types.d.ts +77 -18
  85. package/dist/umd/hcs-11/types.d.ts.map +1 -1
  86. package/dist/umd/standards-sdk.umd.js +12 -12
  87. package/dist/umd/standards-sdk.umd.js.map +1 -1
  88. package/package.json +1 -1
  89. package/dist/cjs/index-CHS2J8pS.cjs +0 -11
  90. package/dist/cjs/index-CHS2J8pS.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es13.js","sources":["../../src/hcs-11/client.ts"],"sourcesContent":["import {\n AccountId,\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, detectKeyTypeFromString } from '../utils';\nimport * as mime from 'mime-types';\nimport { z, ZodIssue } from 'zod';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { HederaMirrorNode } from '../services';\nimport { TopicInfo } from '../services/types';\nimport {\n ProfileType,\n AIAgentType,\n AIAgentCapability,\n SocialLink,\n PersonalProfile,\n AIAgentProfile,\n HCS11Profile,\n HCS11Auth,\n HCS11ClientConfig,\n TransactionResult,\n InscribeProfileResponse,\n InscribeImageResponse,\n AgentMetadata,\n InscribeImageOptions,\n InscribeProfileOptions,\n capabilityNameToCapabilityMap,\n} from './types';\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 class HCS11Client {\n private client: Client;\n private auth: HCS11Auth;\n private network: string;\n private logger: Logger;\n private mirrorNode: HederaMirrorNode;\n private keyType: 'ed25519' | 'ecdsa';\n private operatorId: string;\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.operatorId = config.auth.operatorId;\n \n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-11',\n silent: config.silent,\n });\n \n this.mirrorNode = new HederaMirrorNode(\n this.network as 'mainnet' | 'testnet',\n this.logger,\n );\n\n if (this.auth.privateKey) {\n if (config.keyType) {\n this.keyType = config.keyType;\n this.initializeOperatorWithKeyType();\n } else {\n try {\n const keyDetection = detectKeyTypeFromString(this.auth.privateKey);\n this.keyType = keyDetection.detectedType;\n this.client.setOperator(this.operatorId, keyDetection.privateKey);\n } catch (error) {\n this.logger.warn('Failed to detect key type from private key format, will query mirror node');\n this.keyType = 'ed25519';\n }\n \n this.initializeOperator();\n }\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 async initializeOperator() {\n const account = await this.mirrorNode.requestAccount(this.operatorId);\n const keyType = account?.key?._type;\n\n if (keyType && keyType.includes('ECDSA')) {\n this.keyType = 'ecdsa';\n } else if (keyType && keyType.includes('ED25519')) {\n this.keyType = 'ed25519';\n } else {\n this.keyType = 'ed25519';\n }\n\n this.initializeOperatorWithKeyType();\n }\n\n private initializeOperatorWithKeyType() {\n if (!this.auth.privateKey) {\n return;\n }\n\n const PK =\n this.keyType === 'ecdsa'\n ? PrivateKey.fromStringECDSA(this.auth.privateKey)\n : PrivateKey.fromStringED25519(this.auth.privateKey);\n\n this.client.setOperator(this.operatorId, PK);\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 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: ZodIssue) => {\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:');\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.toString() !== Status.Success.toString()) {\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.toString() !== Status.Success.toString()) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}: ${Status.Success.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 =\n 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: AgentMetadata): 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":["response","receipt"],"mappings":";;;;;;;;;;;;;AAwCA,MAAM,mBAAmB,EAAE,OAAO;AAAA,EAChC,UAAU,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;AAC1B,CAAC;AAED,MAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,MAAM,EAAE,WAAW,WAAW;AAAA,EAC9B,cAAc,EAAE,MAAM,EAAE,WAAW,iBAAiB,CAAC,EAAE,IAAI,CAAC;AAAA,EAC5D,OAAO,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAED,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,SAAS,EAAE,SAAS,IAAI,CAAC;AAAA,EACzB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AgB,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.es13.js","sources":["../../src/hcs-11/mcp-server-builder.ts"],"sourcesContent":["import {\n ProfileType,\n MCPServerConfig,\n MCPServerDetails,\n MCPServerConnectionInfo,\n MCPServerVerification,\n MCPServerHost,\n MCPServerResource,\n MCPServerTool,\n MCPServerCapability,\n SocialPlatform,\n VerificationType,\n SocialLink,\n} from './types';\nimport { Logger } from '../utils/logger';\nimport { NetworkType } from '../utils/types';\n\n/**\n * MCPServerBuilder is a builder class for creating MCP server configurations.\n * It provides a fluent interface for setting various properties of the MCP server.\n *\n * Example usage:\n * ```typescript\n * const mcpBuilder = new MCPServerBuilder();\n * mcpBuilder.setName('My MCP Server');\n * mcpBuilder.setDescription('This is my MCP server for AI integration');\n * mcpBuilder.setVersion('2024-06-01');\n * mcpBuilder.setConnectionInfo('https://mcp.example.com', 'sse');\n * mcpBuilder.setServices([MCPServerCapability.TOOL_PROVIDER, MCPServerCapability.API_INTEGRATION]);\n * mcpBuilder.setNetworkType('mainnet');\n * mcpBuilder.addVerificationDNS('example.com', 'mcp-verify');\n * const serverConfig = mcpBuilder.build();\n * ```\n */\nexport class MCPServerBuilder {\n private config: Partial<MCPServerConfig> = {\n mcpServer: {} as MCPServerDetails,\n };\n private socials: SocialLink[] = [];\n private logger: Logger;\n\n constructor() {\n this.logger = Logger.getInstance({\n module: 'MCPServerBuilder',\n });\n }\n\n /**\n * Sets the display name of the MCP server\n */\n setName(name: string): this {\n this.config.name = name;\n return this;\n }\n\n /**\n * Sets the alias for the MCP server\n */\n setAlias(alias: string): this {\n this.config.alias = alias;\n return this;\n }\n\n /**\n * Sets the bio/description for the MCP server profile\n */\n setBio(bio: string): this {\n this.config.bio = bio;\n return this;\n }\n\n /**\n * @deprecated Use setBio instead\n */\n setDescription(description: string): this {\n return this.setBio(description);\n }\n\n /**\n * Sets the version of the MCP server\n */\n setVersion(version: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.version = version;\n return this;\n }\n\n /**\n * Sets the connection information for the MCP server\n */\n setConnectionInfo(url: string, transport: 'stdio' | 'sse'): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.connectionInfo = {\n url,\n transport,\n };\n return this;\n }\n\n /**\n * Sets the detailed description for the MCP server capabilities\n */\n setServerDescription(description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.description = description;\n return this;\n }\n\n /**\n * Sets the services/capabilities provided by the MCP server\n */\n setServices(services: MCPServerCapability[]): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.services = services;\n return this;\n }\n\n /**\n * Sets the minimum host version requirements\n */\n setHostRequirements(minVersion?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.host = { minVersion };\n return this;\n }\n\n /**\n * Sets the MCP capabilities supported by the server\n */\n setCapabilities(capabilities: string[]): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.capabilities = capabilities;\n return this;\n }\n\n /**\n * Adds a resource that the MCP server exposes\n */\n addResource(name: string, description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n if (!this.config.mcpServer.resources) {\n this.config.mcpServer.resources = [];\n }\n this.config.mcpServer.resources.push({ name, description });\n return this;\n }\n\n /**\n * Adds a tool that the MCP server provides\n */\n addTool(name: string, description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n if (!this.config.mcpServer.tools) {\n this.config.mcpServer.tools = [];\n }\n this.config.mcpServer.tools.push({ name, description });\n return this;\n }\n\n /**\n * Sets information about who maintains the MCP server\n */\n setMaintainer(maintainer: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.maintainer = maintainer;\n return this;\n }\n\n /**\n * Sets the URL to the source code repository\n */\n setRepository(repository: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.repository = repository;\n return this;\n }\n\n /**\n * Sets the URL to the server documentation\n */\n setDocs(docs: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.docs = docs;\n return this;\n }\n\n /**\n * Adds DNS-based verification of endpoint ownership\n */\n addVerificationDNS(domain: string, dnsField?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.verification = {\n type: VerificationType.DNS,\n value: domain,\n dns_field: dnsField,\n };\n return this;\n }\n\n /**\n * Adds signature-based verification of endpoint ownership\n */\n addVerificationSignature(signature: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.verification = {\n type: VerificationType.SIGNATURE,\n value: signature,\n };\n return this;\n }\n\n /**\n * Adds challenge-based verification of endpoint ownership\n */\n addVerificationChallenge(challengePath?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n this.config.mcpServer.verification = {\n type: VerificationType.CHALLENGE,\n value: '',\n challenge_path: challengePath,\n };\n return this;\n }\n\n /**\n * Adds a social media link to the profile\n */\n addSocial(platform: SocialPlatform, handle: string): this {\n const existingSocial = this.socials.find(s => s.platform === platform);\n\n if (!existingSocial) {\n this.socials.push({ platform, handle });\n } else {\n existingSocial.handle = handle;\n }\n\n return this;\n }\n\n /**\n * Sets the profile picture for the MCP server\n */\n setProfilePicture(pfpBuffer: Buffer, pfpFileName: string): this {\n this.config.pfpBuffer = pfpBuffer;\n this.config.pfpFileName = pfpFileName;\n return this;\n }\n\n /**\n * Sets a reference to an existing profile picture\n */\n setExistingProfilePicture(pfpTopicId: string): this {\n this.config.existingPfpTopicId = pfpTopicId;\n return this;\n }\n\n /**\n * Sets the network type (mainnet or testnet)\n */\n setNetworkType(network: NetworkType): this {\n this.config.network = network;\n return this;\n }\n\n /**\n * Builds and validates the MCP server configuration\n */\n build(): MCPServerConfig {\n if (!this.config.name) {\n throw new Error('MCP server name is required');\n }\n\n if (!this.config.network) {\n throw new Error('Network type is required');\n }\n\n if (!this.config.mcpServer) {\n throw new Error('MCP server details are required');\n }\n\n if (!this.config.mcpServer.version) {\n throw new Error('MCP server version is required');\n }\n\n if (!this.config.mcpServer.connectionInfo) {\n throw new Error('MCP server connection info is required');\n }\n\n if (!this.config.mcpServer.services || this.config.mcpServer.services.length === 0) {\n throw new Error('At least one MCP service type is required');\n }\n\n if (!this.config.mcpServer.description) {\n throw new Error('MCP server description is required');\n }\n\n if (!this.config.bio) {\n this.logger.warn('No bio provided for MCP server profile');\n }\n\n if (!this.config.pfpBuffer && !this.config.existingPfpTopicId) {\n this.logger.warn('No profile picture provided or referenced');\n }\n\n // Include social links in the final configuration\n if (this.socials.length > 0) {\n return {\n ...this.config as MCPServerConfig,\n socials: this.socials\n };\n }\n\n return this.config as MCPServerConfig;\n }\n}"],"names":[],"mappings":";;AAkCO,MAAM,iBAAiB;AAAA,EAO5B,cAAc;AANd,SAAQ,SAAmC;AAAA,MACzC,WAAW,CAAA;AAAA,IACb;AACA,SAAQ,UAAwB,CAAC;AAI1B,SAAA,SAAS,OAAO,YAAY;AAAA,MAC/B,QAAQ;AAAA,IAAA,CACT;AAAA,EAAA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