@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.
- package/dist/cjs/hcs-11/client.d.ts +18 -1
- package/dist/cjs/hcs-11/client.d.ts.map +1 -1
- package/dist/cjs/hcs-11/index.d.ts +1 -0
- package/dist/cjs/hcs-11/index.d.ts.map +1 -1
- package/dist/cjs/hcs-11/mcp-server-builder.d.ts +118 -0
- package/dist/cjs/hcs-11/mcp-server-builder.d.ts.map +1 -0
- package/dist/cjs/hcs-11/types.d.ts +77 -18
- package/dist/cjs/hcs-11/types.d.ts.map +1 -1
- package/dist/cjs/{index-CHar8dVv-B2IK-7-2.cjs → index-CHar8dVv-BkACF223.cjs} +2 -2
- package/dist/cjs/{index-CHar8dVv-B2IK-7-2.cjs.map → index-CHar8dVv-BkACF223.cjs.map} +1 -1
- package/dist/cjs/index-DjDDRcKz.cjs +11 -0
- package/dist/cjs/index-DjDDRcKz.cjs.map +1 -0
- package/dist/cjs/standards-sdk.cjs +1 -1
- package/dist/es/hcs-11/client.d.ts +18 -1
- package/dist/es/hcs-11/client.d.ts.map +1 -1
- package/dist/es/hcs-11/index.d.ts +1 -0
- package/dist/es/hcs-11/index.d.ts.map +1 -1
- package/dist/es/hcs-11/mcp-server-builder.d.ts +118 -0
- package/dist/es/hcs-11/mcp-server-builder.d.ts.map +1 -0
- package/dist/es/hcs-11/types.d.ts +77 -18
- package/dist/es/hcs-11/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +17 -12
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/standards-sdk.es10.js +1 -1
- package/dist/es/standards-sdk.es11.js +2 -2
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es13.js +226 -639
- package/dist/es/standards-sdk.es13.js.map +1 -1
- package/dist/es/standards-sdk.es14.js +770 -85
- package/dist/es/standards-sdk.es14.js.map +1 -1
- package/dist/es/standards-sdk.es15.js +132 -68
- package/dist/es/standards-sdk.es15.js.map +1 -1
- package/dist/es/standards-sdk.es16.js +66 -19
- package/dist/es/standards-sdk.es16.js.map +1 -1
- package/dist/es/standards-sdk.es17.js +18 -156
- package/dist/es/standards-sdk.es17.js.map +1 -1
- package/dist/es/standards-sdk.es18.js +150 -146
- package/dist/es/standards-sdk.es18.js.map +1 -1
- package/dist/es/standards-sdk.es19.js +134 -561
- package/dist/es/standards-sdk.es19.js.map +1 -1
- package/dist/es/standards-sdk.es2.js +1 -1
- package/dist/es/standards-sdk.es20.js +577 -24
- package/dist/es/standards-sdk.es20.js.map +1 -1
- package/dist/es/standards-sdk.es21.js +23 -400
- package/dist/es/standards-sdk.es21.js.map +1 -1
- package/dist/es/standards-sdk.es22.js +381 -1507
- package/dist/es/standards-sdk.es22.js.map +1 -1
- package/dist/es/standards-sdk.es23.js +1511 -133
- package/dist/es/standards-sdk.es23.js.map +1 -1
- package/dist/es/standards-sdk.es24.js +155 -7
- package/dist/es/standards-sdk.es24.js.map +1 -1
- package/dist/es/standards-sdk.es25.js +7 -7190
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +7190 -2
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +2 -501
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es28.js +456 -64
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +79 -36
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es3.js +1 -1
- package/dist/es/standards-sdk.es30.js +32 -222
- package/dist/es/standards-sdk.es30.js.map +1 -1
- package/dist/es/standards-sdk.es31.js +183 -100
- package/dist/es/standards-sdk.es31.js.map +1 -1
- package/dist/es/standards-sdk.es32.js +167 -5
- package/dist/es/standards-sdk.es32.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +8 -7132
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +7138 -0
- package/dist/es/standards-sdk.es35.js.map +1 -0
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es5.js +4 -4
- package/dist/es/standards-sdk.es7.js +7 -7
- package/dist/es/standards-sdk.es8.js +5 -5
- package/dist/es/standards-sdk.es9.js +2 -2
- package/dist/umd/hcs-11/client.d.ts +18 -1
- package/dist/umd/hcs-11/client.d.ts.map +1 -1
- package/dist/umd/hcs-11/index.d.ts +1 -0
- package/dist/umd/hcs-11/index.d.ts.map +1 -1
- package/dist/umd/hcs-11/mcp-server-builder.d.ts +118 -0
- package/dist/umd/hcs-11/mcp-server-builder.d.ts.map +1 -0
- package/dist/umd/hcs-11/types.d.ts +77 -18
- package/dist/umd/hcs-11/types.d.ts.map +1 -1
- package/dist/umd/standards-sdk.umd.js +12 -12
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/index-CHS2J8pS.cjs +0 -11
- package/dist/cjs/index-CHS2J8pS.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es14.js","sources":["../../src/hcs-11/types.ts"],"sourcesContent":["import type { Signer } from '@hashgraph/sdk';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { RegistrationProgressCallback } from '../hcs-10/types';\nimport { LogLevel } from '../utils/logger';\nimport { FeeConfigBuilderInterface } from '../fees';\nimport { NetworkType } from '../utils/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 type SocialPlatform =\n | 'twitter'\n | 'github'\n | 'discord'\n | 'telegram'\n | 'linkedin'\n | 'youtube'\n | 'website'\n | 'x';\n\nexport interface SocialLink {\n platform: SocialPlatform;\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}\n\nexport interface AIAgentProfile extends BaseProfile {\n type: ProfileType.AI_AGENT;\n aiAgent: AIAgentDetails;\n}\n\nexport type HCS11Profile = PersonalProfile | AIAgentProfile;\n\nexport enum InboundTopicType {\n PUBLIC = 'PUBLIC',\n CONTROLLED = 'CONTROLLED',\n FEE_BASED = 'FEE_BASED',\n}\n\nexport interface HCS11Auth {\n operatorId: string;\n privateKey?: string;\n signer?: DAppSigner | Signer;\n}\n\nexport interface HCS11ClientConfig {\n network: NetworkType;\n auth: HCS11Auth;\n logLevel?: LogLevel;\n silent?: boolean;\n keyType?: 'ed25519' | 'ecdsa';\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 inboundTopicId?: string;\n outboundTopicId?: string;\n}\n\nexport interface InscribeImageResponse {\n imageTopicId: string;\n transactionId: string;\n success: boolean;\n error?: string;\n}\n\nexport interface AgentMetadata {\n type: 'autonomous' | 'manual';\n model?: string;\n socials?: { [key in SocialPlatform]?: string };\n creator?: string;\n properties?: Record<string, any>;\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\nexport interface AgentConfiguration {\n name: string;\n alias: string;\n bio: string;\n capabilities: number[];\n metadata: AgentMetadata;\n pfpBuffer?: Buffer;\n pfpFileName?: string;\n network: NetworkType;\n inboundTopicType: InboundTopicType;\n feeConfig?: FeeConfigBuilderInterface;\n connectionFeeConfig?: FeeConfigBuilderInterface;\n existingAccount?: {\n accountId: string;\n privateKey: string;\n };\n existingPfpTopicId?: string;\n}\n\nexport interface PersonConfig extends BaseProfile {\n type: ProfileType.PERSONAL;\n pfpBuffer?: Buffer;\n pfpFileName?: string;\n}\n\nexport const SUPPORTED_SOCIAL_PLATFORMS: SocialPlatform[] = [\n 'twitter',\n 'github',\n 'discord',\n 'telegram',\n 'linkedin',\n 'youtube',\n 'website',\n 'x',\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 interface AgentMetadata {\n type: 'autonomous' | 'manual';\n model?: string;\n socials?: {\n twitter?: string;\n discord?: string;\n github?: string;\n website?: string;\n x?: string;\n linkedin?: string;\n youtube?: string;\n telegram?: string;\n };\n creator?: string;\n properties?: Record<string, any>;\n}\n"],"names":["ProfileType","AIAgentType","EndpointType","AIAgentCapability","InboundTopicType"],"mappings":"AAOY,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,qBAA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A,EACjB,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,YAAY;AAAA,EACZ,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,qBAAqB;AAAA;AACvB;"}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es14.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 MCPServerDetails,\n MCPServerProfile,\n MCPServerCapability,\n VerificationType,\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 MCPServerConnectionInfoSchema = z.object({\n url: z.string().min(1),\n transport: z.enum(['stdio', 'sse']),\n});\n\nconst MCPServerVerificationSchema = z.object({\n type: z.nativeEnum(VerificationType),\n value: z.string(),\n dns_field: z.string().optional(),\n challenge_path: z.string().optional(),\n});\n\nconst MCPServerHostSchema = z.object({\n minVersion: z.string().optional(),\n});\n\nconst MCPServerResourceSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n});\n\nconst MCPServerToolSchema = z.object({\n name: z.string().min(1),\n description: z.string().min(1),\n});\n\nconst MCPServerDetailsSchema = z.object({\n version: z.string().min(1),\n connectionInfo: MCPServerConnectionInfoSchema,\n services: z.array(z.nativeEnum(MCPServerCapability)).min(1),\n description: z.string().min(1),\n verification: MCPServerVerificationSchema.optional(),\n host: MCPServerHostSchema.optional(),\n capabilities: z.array(z.string()).optional(),\n resources: z.array(MCPServerResourceSchema).optional(),\n tools: z.array(MCPServerToolSchema).optional(),\n maintainer: z.string().optional(),\n repository: z.string().optional(),\n docs: 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 MCPServerProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.MCP_SERVER),\n mcpServer: MCPServerDetailsSchema,\n});\n\nconst HCS11ProfileSchema = z.union([\n PersonalProfileSchema,\n AIAgentProfileSchema,\n MCPServerProfileSchema,\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(\n 'Failed to detect key type from private key format, will query mirror node',\n );\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 /**\n * Creates an MCP server profile.\n *\n * @param displayName - The display name for the MCP server\n * @param serverDetails - The MCP server details\n * @param options - Additional profile options\n * @returns An MCPServerProfile object\n */\n public createMCPServerProfile(\n displayName: string,\n serverDetails: MCPServerDetails,\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 },\n ): MCPServerProfile {\n const validation = this.validateProfile({\n version: '1.0',\n type: ProfileType.MCP_SERVER,\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 mcpServer: serverDetails,\n });\n\n if (!validation.valid) {\n throw new Error(\n `Invalid MCP Server Profile: ${validation.errors.join(', ')}`,\n );\n }\n\n return {\n version: '1.0',\n type: ProfileType.MCP_SERVER,\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 mcpServer: serverDetails,\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":";;;;;;;;;;;;;AA4CA,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,gCAAgC,EAAE,OAAO;AAAA,EAC7C,KAAK,EAAE,SAAS,IAAI,CAAC;AAAA,EACrB,WAAW,EAAE,KAAK,CAAC,SAAS,KAAK,CAAC;AACpC,CAAC;AAED,MAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,MAAM,EAAE,WAAW,gBAAgB;AAAA,EACnC,OAAO,EAAE,OAAO;AAAA,EAChB,WAAW,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/B,gBAAgB,EAAE,OAAO,EAAE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|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
var ProfileType = /* @__PURE__ */ ((ProfileType2) => {
|
|
2
|
+
ProfileType2[ProfileType2["PERSONAL"] = 0] = "PERSONAL";
|
|
3
|
+
ProfileType2[ProfileType2["AI_AGENT"] = 1] = "AI_AGENT";
|
|
4
|
+
ProfileType2[ProfileType2["MCP_SERVER"] = 2] = "MCP_SERVER";
|
|
5
|
+
return ProfileType2;
|
|
6
|
+
})(ProfileType || {});
|
|
7
|
+
var AIAgentType = /* @__PURE__ */ ((AIAgentType2) => {
|
|
8
|
+
AIAgentType2[AIAgentType2["MANUAL"] = 0] = "MANUAL";
|
|
9
|
+
AIAgentType2[AIAgentType2["AUTONOMOUS"] = 1] = "AUTONOMOUS";
|
|
10
|
+
return AIAgentType2;
|
|
11
|
+
})(AIAgentType || {});
|
|
12
|
+
var EndpointType = /* @__PURE__ */ ((EndpointType2) => {
|
|
13
|
+
EndpointType2[EndpointType2["REST"] = 0] = "REST";
|
|
14
|
+
EndpointType2[EndpointType2["WEBSOCKET"] = 1] = "WEBSOCKET";
|
|
15
|
+
EndpointType2[EndpointType2["GRPC"] = 2] = "GRPC";
|
|
16
|
+
return EndpointType2;
|
|
17
|
+
})(EndpointType || {});
|
|
18
|
+
var AIAgentCapability = /* @__PURE__ */ ((AIAgentCapability2) => {
|
|
19
|
+
AIAgentCapability2[AIAgentCapability2["TEXT_GENERATION"] = 0] = "TEXT_GENERATION";
|
|
20
|
+
AIAgentCapability2[AIAgentCapability2["IMAGE_GENERATION"] = 1] = "IMAGE_GENERATION";
|
|
21
|
+
AIAgentCapability2[AIAgentCapability2["AUDIO_GENERATION"] = 2] = "AUDIO_GENERATION";
|
|
22
|
+
AIAgentCapability2[AIAgentCapability2["VIDEO_GENERATION"] = 3] = "VIDEO_GENERATION";
|
|
23
|
+
AIAgentCapability2[AIAgentCapability2["CODE_GENERATION"] = 4] = "CODE_GENERATION";
|
|
24
|
+
AIAgentCapability2[AIAgentCapability2["LANGUAGE_TRANSLATION"] = 5] = "LANGUAGE_TRANSLATION";
|
|
25
|
+
AIAgentCapability2[AIAgentCapability2["SUMMARIZATION_EXTRACTION"] = 6] = "SUMMARIZATION_EXTRACTION";
|
|
26
|
+
AIAgentCapability2[AIAgentCapability2["KNOWLEDGE_RETRIEVAL"] = 7] = "KNOWLEDGE_RETRIEVAL";
|
|
27
|
+
AIAgentCapability2[AIAgentCapability2["DATA_INTEGRATION"] = 8] = "DATA_INTEGRATION";
|
|
28
|
+
AIAgentCapability2[AIAgentCapability2["MARKET_INTELLIGENCE"] = 9] = "MARKET_INTELLIGENCE";
|
|
29
|
+
AIAgentCapability2[AIAgentCapability2["TRANSACTION_ANALYTICS"] = 10] = "TRANSACTION_ANALYTICS";
|
|
30
|
+
AIAgentCapability2[AIAgentCapability2["SMART_CONTRACT_AUDIT"] = 11] = "SMART_CONTRACT_AUDIT";
|
|
31
|
+
AIAgentCapability2[AIAgentCapability2["GOVERNANCE_FACILITATION"] = 12] = "GOVERNANCE_FACILITATION";
|
|
32
|
+
AIAgentCapability2[AIAgentCapability2["SECURITY_MONITORING"] = 13] = "SECURITY_MONITORING";
|
|
33
|
+
AIAgentCapability2[AIAgentCapability2["COMPLIANCE_ANALYSIS"] = 14] = "COMPLIANCE_ANALYSIS";
|
|
34
|
+
AIAgentCapability2[AIAgentCapability2["FRAUD_DETECTION"] = 15] = "FRAUD_DETECTION";
|
|
35
|
+
AIAgentCapability2[AIAgentCapability2["MULTI_AGENT_COORDINATION"] = 16] = "MULTI_AGENT_COORDINATION";
|
|
36
|
+
AIAgentCapability2[AIAgentCapability2["API_INTEGRATION"] = 17] = "API_INTEGRATION";
|
|
37
|
+
AIAgentCapability2[AIAgentCapability2["WORKFLOW_AUTOMATION"] = 18] = "WORKFLOW_AUTOMATION";
|
|
38
|
+
return AIAgentCapability2;
|
|
39
|
+
})(AIAgentCapability || {});
|
|
40
|
+
var MCPServerCapability = /* @__PURE__ */ ((MCPServerCapability2) => {
|
|
41
|
+
MCPServerCapability2[MCPServerCapability2["RESOURCE_PROVIDER"] = 0] = "RESOURCE_PROVIDER";
|
|
42
|
+
MCPServerCapability2[MCPServerCapability2["TOOL_PROVIDER"] = 1] = "TOOL_PROVIDER";
|
|
43
|
+
MCPServerCapability2[MCPServerCapability2["PROMPT_TEMPLATE_PROVIDER"] = 2] = "PROMPT_TEMPLATE_PROVIDER";
|
|
44
|
+
MCPServerCapability2[MCPServerCapability2["LOCAL_FILE_ACCESS"] = 3] = "LOCAL_FILE_ACCESS";
|
|
45
|
+
MCPServerCapability2[MCPServerCapability2["DATABASE_INTEGRATION"] = 4] = "DATABASE_INTEGRATION";
|
|
46
|
+
MCPServerCapability2[MCPServerCapability2["API_INTEGRATION"] = 5] = "API_INTEGRATION";
|
|
47
|
+
MCPServerCapability2[MCPServerCapability2["WEB_ACCESS"] = 6] = "WEB_ACCESS";
|
|
48
|
+
MCPServerCapability2[MCPServerCapability2["KNOWLEDGE_BASE"] = 7] = "KNOWLEDGE_BASE";
|
|
49
|
+
MCPServerCapability2[MCPServerCapability2["MEMORY_PERSISTENCE"] = 8] = "MEMORY_PERSISTENCE";
|
|
50
|
+
MCPServerCapability2[MCPServerCapability2["CODE_ANALYSIS"] = 9] = "CODE_ANALYSIS";
|
|
51
|
+
MCPServerCapability2[MCPServerCapability2["CONTENT_GENERATION"] = 10] = "CONTENT_GENERATION";
|
|
52
|
+
MCPServerCapability2[MCPServerCapability2["COMMUNICATION"] = 11] = "COMMUNICATION";
|
|
53
|
+
MCPServerCapability2[MCPServerCapability2["DOCUMENT_PROCESSING"] = 12] = "DOCUMENT_PROCESSING";
|
|
54
|
+
MCPServerCapability2[MCPServerCapability2["CALENDAR_SCHEDULE"] = 13] = "CALENDAR_SCHEDULE";
|
|
55
|
+
MCPServerCapability2[MCPServerCapability2["SEARCH"] = 14] = "SEARCH";
|
|
56
|
+
MCPServerCapability2[MCPServerCapability2["ASSISTANT_ORCHESTRATION"] = 15] = "ASSISTANT_ORCHESTRATION";
|
|
57
|
+
return MCPServerCapability2;
|
|
58
|
+
})(MCPServerCapability || {});
|
|
59
|
+
var VerificationType = /* @__PURE__ */ ((VerificationType2) => {
|
|
60
|
+
VerificationType2["DNS"] = "dns";
|
|
61
|
+
VerificationType2["SIGNATURE"] = "signature";
|
|
62
|
+
VerificationType2["CHALLENGE"] = "challenge";
|
|
63
|
+
return VerificationType2;
|
|
64
|
+
})(VerificationType || {});
|
|
65
|
+
var InboundTopicType = /* @__PURE__ */ ((InboundTopicType2) => {
|
|
66
|
+
InboundTopicType2["PUBLIC"] = "PUBLIC";
|
|
67
|
+
InboundTopicType2["CONTROLLED"] = "CONTROLLED";
|
|
68
|
+
InboundTopicType2["FEE_BASED"] = "FEE_BASED";
|
|
69
|
+
return InboundTopicType2;
|
|
70
|
+
})(InboundTopicType || {});
|
|
71
|
+
const SUPPORTED_SOCIAL_PLATFORMS = [
|
|
72
|
+
"twitter",
|
|
73
|
+
"github",
|
|
74
|
+
"discord",
|
|
75
|
+
"telegram",
|
|
76
|
+
"linkedin",
|
|
77
|
+
"youtube",
|
|
78
|
+
"website",
|
|
79
|
+
"x"
|
|
80
|
+
];
|
|
81
|
+
const capabilityNameToCapabilityMap = {
|
|
82
|
+
text_generation: 0,
|
|
83
|
+
image_generation: 1,
|
|
84
|
+
audio_generation: 2,
|
|
85
|
+
video_generation: 3,
|
|
86
|
+
code_generation: 4,
|
|
87
|
+
language_translation: 5,
|
|
88
|
+
summarization: 6,
|
|
89
|
+
extraction: 6,
|
|
90
|
+
knowledge_retrieval: 7,
|
|
91
|
+
data_integration: 8,
|
|
92
|
+
data_visualization: 8,
|
|
93
|
+
market_intelligence: 9,
|
|
94
|
+
transaction_analytics: 10,
|
|
95
|
+
smart_contract_audit: 11,
|
|
96
|
+
governance: 12,
|
|
97
|
+
security_monitoring: 13,
|
|
98
|
+
compliance_analysis: 14,
|
|
99
|
+
fraud_detection: 15,
|
|
100
|
+
multi_agent: 16,
|
|
101
|
+
api_integration: 17,
|
|
102
|
+
workflow_automation: 18
|
|
103
|
+
/* WORKFLOW_AUTOMATION */
|
|
104
|
+
};
|
|
105
|
+
const mcpServiceNameToCapabilityMap = {
|
|
106
|
+
resource_provider: 0,
|
|
107
|
+
tool_provider: 1,
|
|
108
|
+
prompt_template_provider: 2,
|
|
109
|
+
local_file_access: 3,
|
|
110
|
+
database_integration: 4,
|
|
111
|
+
api_integration: 5,
|
|
112
|
+
web_access: 6,
|
|
113
|
+
knowledge_base: 7,
|
|
114
|
+
memory_persistence: 8,
|
|
115
|
+
code_analysis: 9,
|
|
116
|
+
content_generation: 10,
|
|
117
|
+
communication: 11,
|
|
118
|
+
document_processing: 12,
|
|
119
|
+
calendar_schedule: 13,
|
|
120
|
+
search: 14,
|
|
121
|
+
assistant_orchestration: 15
|
|
122
|
+
/* ASSISTANT_ORCHESTRATION */
|
|
66
123
|
};
|
|
67
|
-
_Logger.instances = /* @__PURE__ */ new Map();
|
|
68
|
-
let Logger = _Logger;
|
|
69
124
|
export {
|
|
70
|
-
|
|
125
|
+
AIAgentCapability,
|
|
126
|
+
AIAgentType,
|
|
127
|
+
EndpointType,
|
|
128
|
+
InboundTopicType,
|
|
129
|
+
MCPServerCapability,
|
|
130
|
+
ProfileType,
|
|
131
|
+
SUPPORTED_SOCIAL_PLATFORMS,
|
|
132
|
+
VerificationType,
|
|
133
|
+
capabilityNameToCapabilityMap,
|
|
134
|
+
mcpServiceNameToCapabilityMap
|
|
71
135
|
};
|
|
72
136
|
//# sourceMappingURL=standards-sdk.es15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es15.js","sources":["../../src/utils/logger.ts"],"sourcesContent":["import pino from 'pino';\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';\n\nexport interface LoggerOptions {\n level?: LogLevel;\n module?: string;\n prettyPrint?: boolean;\n silent?: boolean;\n}\nexport class Logger {\n private static instances: Map<string, Logger> = new Map();\n private logger: pino.Logger;\n private moduleContext: string;\n\n constructor(options: LoggerOptions = {}) {\n const globalDisable = process.env.DISABLE_LOGS === 'true';\n\n const shouldSilence = options.silent || globalDisable;\n const level = shouldSilence ? 'silent' : options.level || 'info';\n this.moduleContext = options.module || 'app';\n\n const shouldEnablePrettyPrint =\n !shouldSilence && options.prettyPrint !== false;\n const pinoOptions: pino.LoggerOptions = {\n level,\n enabled: !shouldSilence,\n transport: shouldEnablePrettyPrint\n ? {\n target: 'pino-pretty',\n options: {\n colorize: true,\n translateTime: 'SYS:standard',\n ignore: 'pid,hostname',\n },\n }\n : undefined,\n };\n\n this.logger = pino(pinoOptions);\n }\n\n static getInstance(options: LoggerOptions = {}): Logger {\n const moduleKey = options.module || 'default';\n\n const globalDisable = process.env.DISABLE_LOGS === 'true';\n\n if (globalDisable && Logger.instances.has(moduleKey)) {\n const existingLogger = Logger.instances.get(moduleKey)!;\n if (existingLogger.getLevel() !== 'silent') {\n Logger.instances.delete(moduleKey);\n }\n }\n\n if (!Logger.instances.has(moduleKey)) {\n Logger.instances.set(moduleKey, new Logger(options));\n }\n\n return Logger.instances.get(moduleKey)!;\n }\n\n setLogLevel(level: LogLevel): void {\n this.logger.level = level;\n }\n\n getLevel(): LogLevel {\n return this.logger.level as LogLevel;\n }\n\n setSilent(silent: boolean): void {\n if (silent) {\n this.logger.level = 'silent';\n }\n }\n\n setModule(module: string): void {\n this.moduleContext = module;\n }\n\n debug(...args: any[]): void {\n this.logger.debug({ module: this.moduleContext }, ...args);\n }\n\n info(...args: any[]): void {\n this.logger.info({ module: this.moduleContext }, ...args);\n }\n\n warn(...args: any[]): void {\n this.logger.warn({ module: this.moduleContext }, ...args);\n }\n\n error(...args: any[]): void {\n this.logger.error({ module: this.moduleContext }, ...args);\n }\n\n trace(...args: any[]): void {\n this.logger.trace({ module: this.moduleContext }, ...args);\n }\n}\n"],"names":[],"mappings":";AAUO,MAAM,UAAN,MAAM,QAAO;AAAA,EAKlB,YAAY,UAAyB,IAAI;AACjC,UAAA,gBAAgB,QAAQ,IAAI,iBAAiB;AAE7C,UAAA,gBAAgB,QAAQ,UAAU;AACxC,UAAM,QAAQ,gBAAgB,WAAW,QAAQ,SAAS;AACrD,SAAA,gBAAgB,QAAQ,UAAU;AAEvC,UAAM,0BACJ,CAAC,iBAAiB,QAAQ,gBAAgB;AAC5C,UAAM,cAAkC;AAAA,MACtC;AAAA,MACA,SAAS,CAAC;AAAA,MACV,WAAW,0BACP;AAAA,QACE,QAAQ;AAAA,QACR,SAAS;AAAA,UACP,UAAU;AAAA,UACV,eAAe;AAAA,UACf,QAAQ;AAAA,QAAA;AAAA,MACV,IAEF;AAAA,IACN;AAEK,SAAA,SAAS,KAAK,WAAW;AAAA,EAAA;AAAA,EAGhC,OAAO,YAAY,UAAyB,IAAY;AAChD,UAAA,YAAY,QAAQ,UAAU;AAE9B,UAAA,gBAAgB,QAAQ,IAAI,iBAAiB;AAEnD,QAAI,iBAAiB,QAAO,UAAU,IAAI,SAAS,GAAG;AACpD,YAAM,iBAAiB,QAAO,UAAU,IAAI,SAAS;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from '@hashgraph/hedera-wallet-connect';\nimport { RegistrationProgressCallback } from '../hcs-10/types';\nimport { LogLevel } from '../utils/logger';\nimport { FeeConfigBuilderInterface } from '../fees';\nimport { NetworkType } from '../utils/types';\n\nexport enum ProfileType {\n PERSONAL = 0,\n AI_AGENT = 1,\n MCP_SERVER = 2,\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 enum MCPServerCapability {\n RESOURCE_PROVIDER = 0,\n TOOL_PROVIDER = 1,\n PROMPT_TEMPLATE_PROVIDER = 2,\n LOCAL_FILE_ACCESS = 3,\n DATABASE_INTEGRATION = 4,\n API_INTEGRATION = 5,\n WEB_ACCESS = 6,\n KNOWLEDGE_BASE = 7,\n MEMORY_PERSISTENCE = 8,\n CODE_ANALYSIS = 9,\n CONTENT_GENERATION = 10,\n COMMUNICATION = 11,\n DOCUMENT_PROCESSING = 12,\n CALENDAR_SCHEDULE = 13,\n SEARCH = 14,\n ASSISTANT_ORCHESTRATION = 15,\n}\n\nexport enum VerificationType {\n DNS = 'dns',\n SIGNATURE = 'signature',\n CHALLENGE = 'challenge',\n}\n\nexport type SocialPlatform =\n | 'twitter'\n | 'github'\n | 'discord'\n | 'telegram'\n | 'linkedin'\n | 'youtube'\n | 'website'\n | 'x';\n\nexport interface SocialLink {\n platform: SocialPlatform;\n handle: string;\n}\n\nexport interface AIAgentDetails {\n type: AIAgentType;\n capabilities: AIAgentCapability[];\n model: string;\n creator?: string;\n}\n\nexport interface MCPServerVerification {\n type: VerificationType;\n value: string;\n dns_field?: string;\n challenge_path?: string;\n}\n\nexport interface MCPServerConnectionInfo {\n url: string;\n transport: 'stdio' | 'sse';\n}\n\nexport interface MCPServerHost {\n minVersion?: string;\n}\n\nexport interface MCPServerResource {\n name: string;\n description: string;\n}\n\nexport interface MCPServerTool {\n name: string;\n description: string;\n}\n\nexport interface MCPServerDetails {\n version: string;\n connectionInfo: MCPServerConnectionInfo;\n services: MCPServerCapability[];\n description: string;\n verification?: MCPServerVerification;\n host?: MCPServerHost;\n capabilities?: string[];\n resources?: MCPServerResource[];\n tools?: MCPServerTool[];\n maintainer?: string;\n repository?: string;\n docs?: 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}\n\nexport interface AIAgentProfile extends BaseProfile {\n type: ProfileType.AI_AGENT;\n aiAgent: AIAgentDetails;\n}\n\nexport interface MCPServerProfile extends BaseProfile {\n type: ProfileType.MCP_SERVER;\n mcpServer: MCPServerDetails;\n}\n\nexport type HCS11Profile = PersonalProfile | AIAgentProfile | MCPServerProfile;\n\nexport enum InboundTopicType {\n PUBLIC = 'PUBLIC',\n CONTROLLED = 'CONTROLLED',\n FEE_BASED = 'FEE_BASED',\n}\n\nexport interface HCS11Auth {\n operatorId: string;\n privateKey?: string;\n signer?: DAppSigner | Signer;\n}\n\nexport interface HCS11ClientConfig {\n network: NetworkType;\n auth: HCS11Auth;\n logLevel?: LogLevel;\n silent?: boolean;\n keyType?: 'ed25519' | 'ecdsa';\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 inboundTopicId?: string;\n outboundTopicId?: string;\n}\n\nexport interface InscribeImageResponse {\n imageTopicId: string;\n transactionId: string;\n success: boolean;\n error?: string;\n}\n\nexport interface AgentMetadata {\n type: 'autonomous' | 'manual';\n model?: string;\n socials?: { [key in SocialPlatform]?: string };\n creator?: string;\n properties?: Record<string, any>;\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\nexport interface AgentConfiguration {\n name: string;\n alias: string;\n bio: string;\n capabilities: number[];\n metadata: AgentMetadata;\n pfpBuffer?: Buffer;\n pfpFileName?: string;\n network: NetworkType;\n inboundTopicType: InboundTopicType;\n feeConfig?: FeeConfigBuilderInterface;\n connectionFeeConfig?: FeeConfigBuilderInterface;\n existingAccount?: {\n accountId: string;\n privateKey: string;\n };\n existingPfpTopicId?: string;\n}\n\nexport interface PersonConfig extends BaseProfile {\n type: ProfileType.PERSONAL;\n pfpBuffer?: Buffer;\n pfpFileName?: string;\n}\n\nexport interface MCPServerConfig {\n name: string;\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n network: NetworkType;\n mcpServer: MCPServerDetails;\n pfpBuffer?: Buffer;\n pfpFileName?: string;\n existingPfpTopicId?: string;\n}\n\nexport const SUPPORTED_SOCIAL_PLATFORMS: SocialPlatform[] = [\n 'twitter',\n 'github',\n 'discord',\n 'telegram',\n 'linkedin',\n 'youtube',\n 'website',\n 'x',\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 const mcpServiceNameToCapabilityMap: Record<string, MCPServerCapability> = {\n resource_provider: MCPServerCapability.RESOURCE_PROVIDER,\n tool_provider: MCPServerCapability.TOOL_PROVIDER,\n prompt_template_provider: MCPServerCapability.PROMPT_TEMPLATE_PROVIDER,\n local_file_access: MCPServerCapability.LOCAL_FILE_ACCESS,\n database_integration: MCPServerCapability.DATABASE_INTEGRATION,\n api_integration: MCPServerCapability.API_INTEGRATION,\n web_access: MCPServerCapability.WEB_ACCESS,\n knowledge_base: MCPServerCapability.KNOWLEDGE_BASE,\n memory_persistence: MCPServerCapability.MEMORY_PERSISTENCE,\n code_analysis: MCPServerCapability.CODE_ANALYSIS,\n content_generation: MCPServerCapability.CONTENT_GENERATION,\n communication: MCPServerCapability.COMMUNICATION,\n document_processing: MCPServerCapability.DOCUMENT_PROCESSING,\n calendar_schedule: MCPServerCapability.CALENDAR_SCHEDULE,\n search: MCPServerCapability.SEARCH,\n assistant_orchestration: MCPServerCapability.ASSISTANT_ORCHESTRATION,\n};\n"],"names":["ProfileType","AIAgentType","EndpointType","AIAgentCapability","MCPServerCapability","VerificationType","InboundTopicType"],"mappings":"AAOY,IAAA,gCAAAA,iBAAL;AACLA,eAAAA,aAAA,cAAW,CAAX,IAAA;AACAA,eAAAA,aAAA,cAAW,CAAX,IAAA;AACAA,eAAAA,aAAA,gBAAa,CAAb,IAAA;AAHUA,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAMA,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,mB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1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import pino from "pino";
|
|
2
|
+
const _Logger = class _Logger {
|
|
3
|
+
constructor(options = {}) {
|
|
4
|
+
const globalDisable = process.env.DISABLE_LOGS === "true";
|
|
5
|
+
const shouldSilence = options.silent || globalDisable;
|
|
6
|
+
const level = shouldSilence ? "silent" : options.level || "info";
|
|
7
|
+
this.moduleContext = options.module || "app";
|
|
8
|
+
const shouldEnablePrettyPrint = !shouldSilence && options.prettyPrint !== false;
|
|
9
|
+
const pinoOptions = {
|
|
10
|
+
level,
|
|
11
|
+
enabled: !shouldSilence,
|
|
12
|
+
transport: shouldEnablePrettyPrint ? {
|
|
13
|
+
target: "pino-pretty",
|
|
14
|
+
options: {
|
|
15
|
+
colorize: true,
|
|
16
|
+
translateTime: "SYS:standard",
|
|
17
|
+
ignore: "pid,hostname"
|
|
18
|
+
}
|
|
19
|
+
} : void 0
|
|
20
|
+
};
|
|
21
|
+
this.logger = pino(pinoOptions);
|
|
22
|
+
}
|
|
23
|
+
static getInstance(options = {}) {
|
|
24
|
+
const moduleKey = options.module || "default";
|
|
25
|
+
const globalDisable = process.env.DISABLE_LOGS === "true";
|
|
26
|
+
if (globalDisable && _Logger.instances.has(moduleKey)) {
|
|
27
|
+
const existingLogger = _Logger.instances.get(moduleKey);
|
|
28
|
+
if (existingLogger.getLevel() !== "silent") {
|
|
29
|
+
_Logger.instances.delete(moduleKey);
|
|
17
30
|
}
|
|
18
31
|
}
|
|
32
|
+
if (!_Logger.instances.has(moduleKey)) {
|
|
33
|
+
_Logger.instances.set(moduleKey, new _Logger(options));
|
|
34
|
+
}
|
|
35
|
+
return _Logger.instances.get(moduleKey);
|
|
36
|
+
}
|
|
37
|
+
setLogLevel(level) {
|
|
38
|
+
this.logger.level = level;
|
|
39
|
+
}
|
|
40
|
+
getLevel() {
|
|
41
|
+
return this.logger.level;
|
|
42
|
+
}
|
|
43
|
+
setSilent(silent) {
|
|
44
|
+
if (silent) {
|
|
45
|
+
this.logger.level = "silent";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
setModule(module) {
|
|
49
|
+
this.moduleContext = module;
|
|
19
50
|
}
|
|
20
|
-
|
|
21
|
-
}
|
|
51
|
+
debug(...args) {
|
|
52
|
+
this.logger.debug({ module: this.moduleContext }, ...args);
|
|
53
|
+
}
|
|
54
|
+
info(...args) {
|
|
55
|
+
this.logger.info({ module: this.moduleContext }, ...args);
|
|
56
|
+
}
|
|
57
|
+
warn(...args) {
|
|
58
|
+
this.logger.warn({ module: this.moduleContext }, ...args);
|
|
59
|
+
}
|
|
60
|
+
error(...args) {
|
|
61
|
+
this.logger.error({ module: this.moduleContext }, ...args);
|
|
62
|
+
}
|
|
63
|
+
trace(...args) {
|
|
64
|
+
this.logger.trace({ module: this.moduleContext }, ...args);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
_Logger.instances = /* @__PURE__ */ new Map();
|
|
68
|
+
let Logger = _Logger;
|
|
22
69
|
export {
|
|
23
|
-
|
|
70
|
+
Logger
|
|
24
71
|
};
|
|
25
72
|
//# sourceMappingURL=standards-sdk.es16.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es16.js","sources":["../../src/utils/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es16.js","sources":["../../src/utils/logger.ts"],"sourcesContent":["import pino from 'pino';\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';\n\nexport interface LoggerOptions {\n level?: LogLevel;\n module?: string;\n prettyPrint?: boolean;\n silent?: boolean;\n}\nexport class Logger {\n private static instances: Map<string, Logger> = new Map();\n private logger: pino.Logger;\n private moduleContext: string;\n\n constructor(options: LoggerOptions = {}) {\n const globalDisable = process.env.DISABLE_LOGS === 'true';\n\n const shouldSilence = options.silent || globalDisable;\n const level = shouldSilence ? 'silent' : options.level || 'info';\n this.moduleContext = options.module || 'app';\n\n const shouldEnablePrettyPrint =\n !shouldSilence && options.prettyPrint !== false;\n const pinoOptions: pino.LoggerOptions = {\n level,\n enabled: !shouldSilence,\n transport: shouldEnablePrettyPrint\n ? {\n target: 'pino-pretty',\n options: {\n colorize: true,\n translateTime: 'SYS:standard',\n ignore: 'pid,hostname',\n },\n }\n : undefined,\n };\n\n this.logger = pino(pinoOptions);\n }\n\n static getInstance(options: LoggerOptions = {}): Logger {\n const moduleKey = options.module || 'default';\n\n const globalDisable = process.env.DISABLE_LOGS === 'true';\n\n if (globalDisable && Logger.instances.has(moduleKey)) {\n const existingLogger = Logger.instances.get(moduleKey)!;\n if (existingLogger.getLevel() !== 'silent') {\n Logger.instances.delete(moduleKey);\n }\n }\n\n if (!Logger.instances.has(moduleKey)) {\n Logger.instances.set(moduleKey, new Logger(options));\n }\n\n return Logger.instances.get(moduleKey)!;\n }\n\n setLogLevel(level: LogLevel): void {\n this.logger.level = level;\n }\n\n getLevel(): LogLevel {\n return this.logger.level as LogLevel;\n }\n\n setSilent(silent: boolean): void {\n if (silent) {\n this.logger.level = 'silent';\n }\n }\n\n setModule(module: string): void {\n this.moduleContext = module;\n }\n\n debug(...args: any[]): void {\n this.logger.debug({ module: this.moduleContext }, ...args);\n }\n\n info(...args: any[]): void {\n this.logger.info({ module: this.moduleContext }, ...args);\n }\n\n warn(...args: any[]): void {\n this.logger.warn({ module: this.moduleContext }, ...args);\n }\n\n error(...args: any[]): void {\n this.logger.error({ module: this.moduleContext }, ...args);\n }\n\n trace(...args: any[]): void {\n this.logger.trace({ module: this.moduleContext }, ...args);\n }\n}\n"],"names":[],"mappings":";AAUO,MAAM,UAAN,MAAM,QAAO;AAAA,EAKlB,YAAY,UAAyB,IAAI;AACjC,UAAA,gBAAgB,QAAQ,IAAI,iBAAiB;AAE7C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