@hashgraphonline/standards-sdk 0.0.157-canary.2 → 0.0.157-canary.4
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-10/base-client.d.ts +1 -1
- package/dist/cjs/hcs-10/base-client.d.ts.map +1 -1
- package/dist/cjs/hcs-10/sdk.d.ts +1 -1
- package/dist/cjs/hcs-10/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-11/agent-builder.d.ts +2 -0
- package/dist/cjs/hcs-11/agent-builder.d.ts.map +1 -1
- package/dist/cjs/hcs-11/client.d.ts +2 -0
- package/dist/cjs/hcs-11/client.d.ts.map +1 -1
- package/dist/cjs/hcs-11/types.d.ts +4 -2
- package/dist/cjs/hcs-11/types.d.ts.map +1 -1
- package/dist/cjs/hcs-15/index.d.ts +3 -0
- package/dist/cjs/hcs-15/index.d.ts.map +1 -0
- package/dist/cjs/hcs-15/petal-manager.d.ts +27 -0
- package/dist/cjs/hcs-15/petal-manager.d.ts.map +1 -0
- package/dist/cjs/hcs-15/types.d.ts +41 -0
- package/dist/cjs/hcs-15/types.d.ts.map +1 -0
- package/dist/cjs/hcs-16/flora-account-manager.d.ts.map +1 -1
- package/dist/cjs/hcs-16/types.d.ts +3 -5
- package/dist/cjs/hcs-16/types.d.ts.map +1 -1
- package/dist/cjs/hcs-18/discovery.d.ts +1 -0
- package/dist/cjs/hcs-18/discovery.d.ts.map +1 -1
- package/dist/cjs/hcs-18/types.d.ts +1 -0
- package/dist/cjs/hcs-18/types.d.ts.map +1 -1
- package/dist/cjs/hcs-20/sdk.d.ts.map +1 -1
- package/dist/cjs/hcs-7/evm-bridge.d.ts.map +1 -1
- package/dist/cjs/hcs-7/redis-cache.d.ts.map +1 -1
- package/dist/cjs/hcs-7/wasm-bridge.d.ts.map +1 -1
- package/dist/cjs/{index-xZmk-HBD.cjs → index-CJsmyij2.cjs} +12 -12
- package/dist/cjs/index-CJsmyij2.cjs.map +1 -0
- package/dist/cjs/{index-CyAbgH2f-Cv8mxAhS.cjs → index-CyAbgH2f-Dn5WQtPx.cjs} +2 -2
- package/dist/cjs/{index-CyAbgH2f-Cv8mxAhS.cjs.map → index-CyAbgH2f-Dn5WQtPx.cjs.map} +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/services/types.d.ts +1 -1
- package/dist/cjs/services/types.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +1 -1
- package/dist/cjs/{standards-sdk.es45-BxAtDqsy-ELd4REyl.cjs → standards-sdk.es45-BxAtDqsy-CiMtsDbD.cjs} +2 -2
- package/dist/cjs/{standards-sdk.es45-BxAtDqsy-ELd4REyl.cjs.map → standards-sdk.es45-BxAtDqsy-CiMtsDbD.cjs.map} +1 -1
- package/dist/cjs/{standards-sdk.es46-BI8ACeLM-DRmcgoN0.cjs → standards-sdk.es46-BI8ACeLM-DFYgO-fP.cjs} +2 -2
- package/dist/cjs/{standards-sdk.es46-BI8ACeLM-DRmcgoN0.cjs.map → standards-sdk.es46-BI8ACeLM-DFYgO-fP.cjs.map} +1 -1
- package/dist/cjs/{standards-sdk.es47-DbkY3FlD-DfMpZygD.cjs → standards-sdk.es47-DbkY3FlD-2qTWs2BD.cjs} +2 -2
- package/dist/cjs/{standards-sdk.es47-DbkY3FlD-DfMpZygD.cjs.map → standards-sdk.es47-DbkY3FlD-2qTWs2BD.cjs.map} +1 -1
- package/dist/cjs/{standards-sdk.es48-DzT9Qc3F-CmCkJl3x.cjs → standards-sdk.es48-DzT9Qc3F-Byz0fQnW.cjs} +2 -2
- package/dist/cjs/{standards-sdk.es48-DzT9Qc3F-CmCkJl3x.cjs.map → standards-sdk.es48-DzT9Qc3F-Byz0fQnW.cjs.map} +1 -1
- package/dist/cjs/utils/logger.d.ts.map +1 -1
- package/dist/es/hcs-10/base-client.d.ts +1 -1
- package/dist/es/hcs-10/base-client.d.ts.map +1 -1
- package/dist/es/hcs-10/sdk.d.ts +1 -1
- package/dist/es/hcs-10/sdk.d.ts.map +1 -1
- package/dist/es/hcs-11/agent-builder.d.ts +2 -0
- package/dist/es/hcs-11/agent-builder.d.ts.map +1 -1
- package/dist/es/hcs-11/client.d.ts +2 -0
- package/dist/es/hcs-11/client.d.ts.map +1 -1
- package/dist/es/hcs-11/types.d.ts +4 -2
- package/dist/es/hcs-11/types.d.ts.map +1 -1
- package/dist/es/hcs-15/index.d.ts +3 -0
- package/dist/es/hcs-15/index.d.ts.map +1 -0
- package/dist/es/hcs-15/petal-manager.d.ts +27 -0
- package/dist/es/hcs-15/petal-manager.d.ts.map +1 -0
- package/dist/es/hcs-15/types.d.ts +41 -0
- package/dist/es/hcs-15/types.d.ts.map +1 -0
- package/dist/es/hcs-16/flora-account-manager.d.ts.map +1 -1
- package/dist/es/hcs-16/types.d.ts +3 -5
- package/dist/es/hcs-16/types.d.ts.map +1 -1
- package/dist/es/hcs-18/discovery.d.ts +1 -0
- package/dist/es/hcs-18/discovery.d.ts.map +1 -1
- package/dist/es/hcs-18/types.d.ts +1 -0
- package/dist/es/hcs-18/types.d.ts.map +1 -1
- package/dist/es/hcs-20/sdk.d.ts.map +1 -1
- package/dist/es/hcs-7/evm-bridge.d.ts.map +1 -1
- package/dist/es/hcs-7/redis-cache.d.ts.map +1 -1
- package/dist/es/hcs-7/wasm-bridge.d.ts.map +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/services/types.d.ts +1 -1
- package/dist/es/services/types.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +19 -22
- 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 +10 -2
- package/dist/es/standards-sdk.es11.js.map +1 -1
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es13.js +1 -1
- package/dist/es/standards-sdk.es13.js.map +1 -1
- package/dist/es/standards-sdk.es14.js +1 -1
- package/dist/es/standards-sdk.es15.js +39 -9
- package/dist/es/standards-sdk.es15.js.map +1 -1
- package/dist/es/standards-sdk.es16.js +1 -0
- package/dist/es/standards-sdk.es16.js.map +1 -1
- package/dist/es/standards-sdk.es18.js +1 -1
- package/dist/es/standards-sdk.es19.js +1 -1
- package/dist/es/standards-sdk.es2.js +1 -1
- package/dist/es/standards-sdk.es20.js +2 -2
- package/dist/es/standards-sdk.es23.js +2 -2
- package/dist/es/standards-sdk.es25.js +4 -2
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +2 -2
- package/dist/es/standards-sdk.es27.js +152 -6
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es28.js +26 -189
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +446 -26
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es3.js +1 -1
- package/dist/es/standards-sdk.es3.js.map +1 -1
- package/dist/es/standards-sdk.es30.js +6 -342
- package/dist/es/standards-sdk.es30.js.map +1 -1
- package/dist/es/standards-sdk.es31.js +202 -6
- package/dist/es/standards-sdk.es31.js.map +1 -1
- package/dist/es/standards-sdk.es32.js +34 -202
- package/dist/es/standards-sdk.es32.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +529 -34
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +87 -501
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +19 -98
- package/dist/es/standards-sdk.es35.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +156 -18
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +146 -150
- package/dist/es/standards-sdk.es37.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +561 -134
- package/dist/es/standards-sdk.es38.js.map +1 -1
- package/dist/es/standards-sdk.es39.js +562 -543
- package/dist/es/standards-sdk.es39.js.map +1 -1
- package/dist/es/standards-sdk.es4.js +6 -4
- package/dist/es/standards-sdk.es4.js.map +1 -1
- package/dist/es/standards-sdk.es40.js +4 -601
- package/dist/es/standards-sdk.es40.js.map +1 -1
- package/dist/es/standards-sdk.es41.js +415 -4
- package/dist/es/standards-sdk.es41.js.map +1 -1
- package/dist/es/standards-sdk.es42.js +1536 -389
- package/dist/es/standards-sdk.es42.js.map +1 -1
- package/dist/es/standards-sdk.es43.js +133 -1541
- package/dist/es/standards-sdk.es43.js.map +1 -1
- package/dist/es/standards-sdk.es44.js +7 -155
- package/dist/es/standards-sdk.es44.js.map +1 -1
- package/dist/es/standards-sdk.es45.js +2 -7
- package/dist/es/standards-sdk.es45.js.map +1 -1
- package/dist/es/standards-sdk.es46.js +5 -5
- package/dist/es/standards-sdk.es48.js +1 -1
- package/dist/es/standards-sdk.es49.js +1 -1
- package/dist/es/standards-sdk.es5.js +4 -6
- package/dist/es/standards-sdk.es5.js.map +1 -1
- package/dist/es/standards-sdk.es50.js +1 -1
- package/dist/es/standards-sdk.es51.js +1 -1
- package/dist/es/standards-sdk.es52.js +1 -1
- package/dist/es/standards-sdk.es54.js +7135 -2
- package/dist/es/standards-sdk.es54.js.map +1 -1
- package/dist/es/standards-sdk.es55.js +7134 -41
- package/dist/es/standards-sdk.es55.js.map +1 -1
- package/dist/es/standards-sdk.es56.js +37 -37
- package/dist/es/standards-sdk.es56.js.map +1 -1
- package/dist/es/standards-sdk.es57.js +37 -37
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +78 -72
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +41 -7134
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es6.js.map +1 -1
- package/dist/es/standards-sdk.es7.js +28 -22
- package/dist/es/standards-sdk.es7.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +5 -5
- package/dist/es/utils/logger.d.ts.map +1 -1
- package/package.json +37 -35
- package/dist/cjs/hcs-21/index.d.ts +0 -4
- package/dist/cjs/hcs-21/index.d.ts.map +0 -1
- package/dist/cjs/hcs-21/petal-account-manager.d.ts +0 -52
- package/dist/cjs/hcs-21/petal-account-manager.d.ts.map +0 -1
- package/dist/cjs/hcs-21/types.d.ts +0 -44
- package/dist/cjs/hcs-21/types.d.ts.map +0 -1
- package/dist/cjs/index-xZmk-HBD.cjs.map +0 -1
- package/dist/es/hcs-21/index.d.ts +0 -4
- package/dist/es/hcs-21/index.d.ts.map +0 -1
- package/dist/es/hcs-21/petal-account-manager.d.ts +0 -52
- package/dist/es/hcs-21/petal-account-manager.d.ts.map +0 -1
- package/dist/es/hcs-21/types.d.ts +0 -44
- package/dist/es/hcs-21/types.d.ts.map +0 -1
- package/dist/es/standards-sdk.es60.js +0 -7144
- package/dist/es/standards-sdk.es60.js.map +0 -1
|
@@ -23,25 +23,24 @@ import { HCS20BaseClient } from "./standards-sdk.es23.js";
|
|
|
23
23
|
import { BrowserHCS20Client } from "./standards-sdk.es24.js";
|
|
24
24
|
import { HCS20Client } from "./standards-sdk.es25.js";
|
|
25
25
|
import { HCS20PointsIndexer } from "./standards-sdk.es26.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import { CustomFeeType } from "./standards-sdk.es45.js";
|
|
26
|
+
import { HCS15PetalManager } from "./standards-sdk.es27.js";
|
|
27
|
+
import { FloraError, FloraOperation, FloraTopicType } from "./standards-sdk.es28.js";
|
|
28
|
+
import { FloraAccountManager, FloraAccountManager as FloraAccountManager2 } from "./standards-sdk.es29.js";
|
|
29
|
+
import { StateHashError } from "./standards-sdk.es30.js";
|
|
30
|
+
import { StateHashCalculator, StateHashCalculator as StateHashCalculator2 } from "./standards-sdk.es31.js";
|
|
31
|
+
import { DiscoveryError, DiscoveryErrorCodes, DiscoveryOperation, DiscoveryState } from "./standards-sdk.es32.js";
|
|
32
|
+
import { FloraDiscovery, FloraDiscovery as FloraDiscovery2 } from "./standards-sdk.es33.js";
|
|
33
|
+
import { Logger } from "./standards-sdk.es34.js";
|
|
34
|
+
import { accountIdsToExemptKeys } from "./standards-sdk.es35.js";
|
|
35
|
+
import { ProgressReporter } from "./standards-sdk.es36.js";
|
|
36
|
+
import { HRLResolver } from "./standards-sdk.es37.js";
|
|
37
|
+
import { TransactionParser } from "./standards-sdk.es38.js";
|
|
38
|
+
import { KeyType, KeyTypeDetector, detectKeyTypeFromString } from "./standards-sdk.es39.js";
|
|
39
|
+
import { getTopicId } from "./standards-sdk.es40.js";
|
|
40
|
+
import { inscribe, inscribeWithSigner, retrieveInscription, waitForInscriptionConfirmation } from "./standards-sdk.es41.js";
|
|
41
|
+
import { HederaMirrorNode } from "./standards-sdk.es42.js";
|
|
42
|
+
import { FeeConfigBuilder } from "./standards-sdk.es43.js";
|
|
43
|
+
import { CustomFeeType } from "./standards-sdk.es44.js";
|
|
45
44
|
export {
|
|
46
45
|
AIAgentCapability,
|
|
47
46
|
AIAgentType,
|
|
@@ -71,6 +70,7 @@ export {
|
|
|
71
70
|
HCS10Cache,
|
|
72
71
|
HCS10Client,
|
|
73
72
|
HCS11Client,
|
|
73
|
+
HCS15PetalManager,
|
|
74
74
|
FloraDiscovery2 as HCS18Discovery,
|
|
75
75
|
HCS20BaseClient,
|
|
76
76
|
HCS20BurnMessageSchema,
|
|
@@ -83,7 +83,6 @@ export {
|
|
|
83
83
|
HCS20RegisterMessageSchema,
|
|
84
84
|
HCS20TransferMessageSchema,
|
|
85
85
|
HCS20_CONSTANTS,
|
|
86
|
-
PetalAccountManager as HCS21Client,
|
|
87
86
|
FloraAccountManager2 as HCS22Client,
|
|
88
87
|
StateHashCalculator as HCS23Client,
|
|
89
88
|
HCS2BaseClient,
|
|
@@ -107,8 +106,6 @@ export {
|
|
|
107
106
|
MintLimitExceededError,
|
|
108
107
|
PayloadSizeError,
|
|
109
108
|
PersonBuilder,
|
|
110
|
-
PetalAccountError,
|
|
111
|
-
PetalAccountManager2 as PetalAccountManager,
|
|
112
109
|
PointsBurnError,
|
|
113
110
|
PointsDeploymentError,
|
|
114
111
|
PointsMintError,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standards-sdk.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InboundTopicType } from "./standards-sdk.es16.js";
|
|
2
|
-
import { Logger } from "./standards-sdk.
|
|
2
|
+
import { Logger } from "./standards-sdk.es34.js";
|
|
3
3
|
class AgentBuilder {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.config = {};
|
|
@@ -124,6 +124,10 @@ class AgentBuilder {
|
|
|
124
124
|
this.config.outboundTopicId = outboundTopicId;
|
|
125
125
|
return this;
|
|
126
126
|
}
|
|
127
|
+
setBaseAccount(baseAccountId) {
|
|
128
|
+
this.baseAccount = baseAccountId;
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
127
131
|
build() {
|
|
128
132
|
if (!this.config.name) {
|
|
129
133
|
throw new Error("Agent display name is required");
|
|
@@ -151,7 +155,11 @@ class AgentBuilder {
|
|
|
151
155
|
if (this.config.inboundTopicType === InboundTopicType.FEE_BASED && !this.config.feeConfig) {
|
|
152
156
|
throw new Error("Fee configuration is required for fee-based topics");
|
|
153
157
|
}
|
|
154
|
-
|
|
158
|
+
const config = this.config;
|
|
159
|
+
if (this.baseAccount) {
|
|
160
|
+
config.baseAccount = this.baseAccount;
|
|
161
|
+
}
|
|
162
|
+
return config;
|
|
155
163
|
}
|
|
156
164
|
}
|
|
157
165
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es11.js","sources":["../../src/hcs-11/agent-builder.ts"],"sourcesContent":["import {\n InboundTopicType,\n AgentConfiguration,\n AgentMetadata,\n AIAgentCapability,\n SocialPlatform,\n} from './types';\nimport { Logger } from '../utils/logger';\nimport { FeeConfigBuilderInterface } from '../fees';\nimport { NetworkType } from '../utils/types';\n\n/**\n * AgentBuilder is a builder class for creating agent configurations.\n * It provides a fluent interface for setting various properties of the agent.\n *\n * Example usage:\n * ```typescript\n * const agentBuilder = new AgentBuilder();\n * agentBuilder.setName('My Agent');\n * agentBuilder.setDescription('This is my agent');\n * agentBuilder.setCapabilities([AIAgentCapability.CREATE_CONTENT]);\n * agentBuilder.setModel('gpt-4o');\n * agentBuilder.setCreator('John Doe');\n * agentBuilder.addSocial('twitter', 'JohnDoe');\n * agentBuilder.addProperty('key', 'value');\n * const agentConfig = agentBuilder.build();\n * ```\n *\n */\nexport class AgentBuilder {\n private config: Partial<AgentConfiguration> = {};\n private logger: Logger;\n\n constructor() {\n this.logger = Logger.getInstance({\n module: 'AgentBuilder',\n });\n }\n\n setName(name: string): this {\n this.config.name = name;\n return this;\n }\n\n setAlias(alias: string): this {\n this.config.alias = alias;\n return this;\n }\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 this.config.bio = description;\n return this;\n }\n\n setCapabilities(capabilities: AIAgentCapability[]): this {\n this.config.capabilities = capabilities;\n return this;\n }\n\n /**\n * @deprecated Use setType instead\n */\n setAgentType(type: 'autonomous' | 'manual'): this {\n if (!this.config.metadata) {\n this.config.metadata = { type };\n } else {\n this.config.metadata.type = type;\n }\n return this;\n }\n\n setType(type: 'autonomous' | 'manual'): this {\n if (!this.config.metadata) {\n this.config.metadata = { type };\n } else {\n this.config.metadata.type = type;\n }\n return this;\n }\n\n setModel(model: string): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n this.config.metadata.model = model;\n return this;\n }\n\n setCreator(creator: string): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n this.config.metadata.creator = creator;\n return this;\n }\n\n addSocial(platform: SocialPlatform, handle: string): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n if (!this.config.metadata.socials) {\n this.config.metadata.socials = {};\n }\n this.config.metadata.socials[platform] = handle;\n return this;\n }\n\n addProperty(key: string, value: any): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n if (!this.config.metadata.properties) {\n this.config.metadata.properties = {};\n }\n this.config.metadata.properties[key] = value;\n return this;\n }\n\n setMetadata(metadata: AgentMetadata): this {\n this.config.metadata = metadata;\n return this;\n }\n\n setProfilePicture(pfpBuffer: Buffer, pfpFileName: string): this {\n this.config.pfpBuffer = pfpBuffer;\n this.config.pfpFileName = pfpFileName;\n return this;\n }\n\n setExistingProfilePicture(pfpTopicId: string): this {\n this.config.existingPfpTopicId = pfpTopicId;\n return this;\n }\n\n setNetwork(network: NetworkType): this {\n this.config.network = network;\n return this;\n }\n\n setInboundTopicType(inboundTopicType: InboundTopicType): this {\n this.config.inboundTopicType = inboundTopicType;\n return this;\n }\n\n setFeeConfig(feeConfigBuilder: FeeConfigBuilderInterface): this {\n this.config.feeConfig = feeConfigBuilder;\n return this;\n }\n\n setConnectionFeeConfig(feeConfigBuilder: FeeConfigBuilderInterface): this {\n this.config.connectionFeeConfig = feeConfigBuilder;\n return this;\n }\n\n setExistingAccount(accountId: string, privateKey: string): this {\n this.config.existingAccount = { accountId, privateKey };\n return this;\n }\n\n setInboundTopicId(inboundTopicId: string): this {\n this.config.inboundTopicId = inboundTopicId;\n return this;\n }\n\n setOutboundTopicId(outboundTopicId: string): this {\n this.config.outboundTopicId = outboundTopicId;\n return this;\n }\n\n build(): AgentConfiguration {\n if (!this.config.name) {\n throw new Error('Agent display name is required');\n }\n\n if (!this.config.bio) {\n this.logger?.warn('Agent description is not set');\n }\n\n if (!this.config.pfpBuffer && !this.config.existingPfpTopicId) {\n this.logger.warn('No profile picture provided or referenced.');\n }\n\n if (!this.config.network) {\n throw new Error('Network is required');\n }\n\n if (!this.config.inboundTopicType) {\n this.config.inboundTopicType = InboundTopicType.PUBLIC;\n }\n\n if (!this.config.capabilities) {\n this.config.capabilities = [];\n }\n\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n } else if (!this.config.metadata.type) {\n this.config.metadata.type = 'manual';\n }\n\n if (\n this.config.inboundTopicType === InboundTopicType.FEE_BASED &&\n !this.config.feeConfig\n ) {\n throw new Error('Fee configuration is required for fee-based topics');\n }\n\n
|
|
1
|
+
{"version":3,"file":"standards-sdk.es11.js","sources":["../../src/hcs-11/agent-builder.ts"],"sourcesContent":["import {\n InboundTopicType,\n AgentConfiguration,\n AgentMetadata,\n AIAgentCapability,\n SocialPlatform,\n} from './types';\nimport { Logger } from '../utils/logger';\nimport { FeeConfigBuilderInterface } from '../fees';\nimport { NetworkType } from '../utils/types';\n\n/**\n * AgentBuilder is a builder class for creating agent configurations.\n * It provides a fluent interface for setting various properties of the agent.\n *\n * Example usage:\n * ```typescript\n * const agentBuilder = new AgentBuilder();\n * agentBuilder.setName('My Agent');\n * agentBuilder.setDescription('This is my agent');\n * agentBuilder.setCapabilities([AIAgentCapability.CREATE_CONTENT]);\n * agentBuilder.setModel('gpt-4o');\n * agentBuilder.setCreator('John Doe');\n * agentBuilder.addSocial('twitter', 'JohnDoe');\n * agentBuilder.addProperty('key', 'value');\n * const agentConfig = agentBuilder.build();\n * ```\n *\n */\nexport class AgentBuilder {\n private config: Partial<AgentConfiguration> = {};\n private logger: Logger;\n private baseAccount?: string;\n\n constructor() {\n this.logger = Logger.getInstance({\n module: 'AgentBuilder',\n });\n }\n\n setName(name: string): this {\n this.config.name = name;\n return this;\n }\n\n setAlias(alias: string): this {\n this.config.alias = alias;\n return this;\n }\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 this.config.bio = description;\n return this;\n }\n\n setCapabilities(capabilities: AIAgentCapability[]): this {\n this.config.capabilities = capabilities;\n return this;\n }\n\n /**\n * @deprecated Use setType instead\n */\n setAgentType(type: 'autonomous' | 'manual'): this {\n if (!this.config.metadata) {\n this.config.metadata = { type };\n } else {\n this.config.metadata.type = type;\n }\n return this;\n }\n\n setType(type: 'autonomous' | 'manual'): this {\n if (!this.config.metadata) {\n this.config.metadata = { type };\n } else {\n this.config.metadata.type = type;\n }\n return this;\n }\n\n setModel(model: string): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n this.config.metadata.model = model;\n return this;\n }\n\n setCreator(creator: string): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n this.config.metadata.creator = creator;\n return this;\n }\n\n addSocial(platform: SocialPlatform, handle: string): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n if (!this.config.metadata.socials) {\n this.config.metadata.socials = {};\n }\n this.config.metadata.socials[platform] = handle;\n return this;\n }\n\n addProperty(key: string, value: any): this {\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n }\n if (!this.config.metadata.properties) {\n this.config.metadata.properties = {};\n }\n this.config.metadata.properties[key] = value;\n return this;\n }\n\n setMetadata(metadata: AgentMetadata): this {\n this.config.metadata = metadata;\n return this;\n }\n\n setProfilePicture(pfpBuffer: Buffer, pfpFileName: string): this {\n this.config.pfpBuffer = pfpBuffer;\n this.config.pfpFileName = pfpFileName;\n return this;\n }\n\n setExistingProfilePicture(pfpTopicId: string): this {\n this.config.existingPfpTopicId = pfpTopicId;\n return this;\n }\n\n setNetwork(network: NetworkType): this {\n this.config.network = network;\n return this;\n }\n\n setInboundTopicType(inboundTopicType: InboundTopicType): this {\n this.config.inboundTopicType = inboundTopicType;\n return this;\n }\n\n setFeeConfig(feeConfigBuilder: FeeConfigBuilderInterface): this {\n this.config.feeConfig = feeConfigBuilder;\n return this;\n }\n\n setConnectionFeeConfig(feeConfigBuilder: FeeConfigBuilderInterface): this {\n this.config.connectionFeeConfig = feeConfigBuilder;\n return this;\n }\n\n setExistingAccount(accountId: string, privateKey: string): this {\n this.config.existingAccount = { accountId, privateKey };\n return this;\n }\n\n setInboundTopicId(inboundTopicId: string): this {\n this.config.inboundTopicId = inboundTopicId;\n return this;\n }\n\n setOutboundTopicId(outboundTopicId: string): this {\n this.config.outboundTopicId = outboundTopicId;\n return this;\n }\n\n setBaseAccount(baseAccountId: string): this {\n this.baseAccount = baseAccountId;\n return this;\n }\n\n build(): AgentConfiguration {\n if (!this.config.name) {\n throw new Error('Agent display name is required');\n }\n\n if (!this.config.bio) {\n this.logger?.warn('Agent description is not set');\n }\n\n if (!this.config.pfpBuffer && !this.config.existingPfpTopicId) {\n this.logger.warn('No profile picture provided or referenced.');\n }\n\n if (!this.config.network) {\n throw new Error('Network is required');\n }\n\n if (!this.config.inboundTopicType) {\n this.config.inboundTopicType = InboundTopicType.PUBLIC;\n }\n\n if (!this.config.capabilities) {\n this.config.capabilities = [];\n }\n\n if (!this.config.metadata) {\n this.config.metadata = { type: 'manual' };\n } else if (!this.config.metadata.type) {\n this.config.metadata.type = 'manual';\n }\n\n if (\n this.config.inboundTopicType === InboundTopicType.FEE_BASED &&\n !this.config.feeConfig\n ) {\n throw new Error('Fee configuration is required for fee-based topics');\n }\n\n const config = this.config as AgentConfiguration & { baseAccount?: string };\n if (this.baseAccount) {\n (config as any).baseAccount = this.baseAccount;\n }\n return config as AgentConfiguration;\n }\n}\n"],"names":[],"mappings":";;AA6BO,MAAM,aAAa;AAAA,EAKxB,cAAc;AAJd,SAAQ,SAAsC,CAAA;AAK5C,SAAK,SAAS,OAAO,YAAY;AAAA,MAC/B,QAAQ;AAAA,IAAA,CACT;AAAA,EACH;AAAA,EAEA,QAAQ,MAA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;AAAA,EAEA,eAAe,eAA6B;AAC1C,SAAK,cAAc;AACnB,WAAO;AAAA,EACT;AAAA,EAEA,QAA4B;AAC1B,QAAI,CAAC,KAAK,OAAO,MAAM;AACrB,YAAM,IAAI,MAAM,gCAAgC;AAAA,IAClD;AAEA,QAAI,CAAC,KAAK,OAAO,KAAK;AACpB,WAAK,QAAQ,KAAK,8BAA8B;AAAA,IAClD;AAEA,QAAI,CAAC,KAAK,OAAO,aAAa,CAAC,KAAK,OAAO,oBAAoB;AAC7D,WAAK,OAAO,KAAK,4CAA4C;AAAA,IAC/D;AAEA,QAAI,CAAC,KAAK,OAAO,SAAS;AACxB,YAAM,IAAI,MAAM,qBAAqB;AAAA,IACvC;AAEA,QAAI,CAAC,KAAK,OAAO,kBAAkB;AACjC,WAAK,OAAO,mBAAmB,iBAAiB;AAAA,IAClD;AAEA,QAAI,CAAC,KAAK,OAAO,cAAc;AAC7B,WAAK,OAAO,eAAe,CAAA;AAAA,IAC7B;AAEA,QAAI,CAAC,KAAK,OAAO,UAAU;AACzB,WAAK,OAAO,WAAW,EAAE,MAAM,SAAA;AAAA,IACjC,WAAW,CAAC,KAAK,OAAO,SAAS,MAAM;AACrC,WAAK,OAAO,SAAS,OAAO;AAAA,IAC9B;AAEA,QACE,KAAK,OAAO,qBAAqB,iBAAiB,aAClD,CAAC,KAAK,OAAO,WACb;AACA,YAAM,IAAI,MAAM,oDAAoD;AAAA,IACtE;AAEA,UAAM,SAAS,KAAK;AACpB,QAAI,KAAK,aAAa;AACnB,aAAe,cAAc,KAAK;AAAA,IACrC;AACA,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es13.js","sources":["../../src/hcs-11/mcp-server-builder.ts"],"sourcesContent":["import {\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.setServerDescription('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 * @param name The display name for the MCP server profile\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 * @param alias Alternative identifier 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 * @param bio Brief description or biography for the MCP server\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 * @param version The MCP server version (e.g., \"2024-06-01\")\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 * @param url Base URL for the MCP server (e.g., \"https://mcp.example.com\")\n * @param transport Transport type (\"stdio\" or \"sse\")\n */\n setConnectionInfo(url: string, transport: 'stdio' | 'sse'): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const connectionInfo: MCPServerConnectionInfo = {\n url,\n transport,\n };\n\n this.config.mcpServer.connectionInfo = connectionInfo;\n return this;\n }\n\n /**\n * Sets the detailed description for the MCP server capabilities\n *\n * @param description Detailed description of server functionality\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 * @param services Array of service types offered by this 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 * @param minVersion Minimum host version required (e.g., \"2024-11-05\")\n */\n setHostRequirements(minVersion?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const hostInfo: MCPServerHost = {\n minVersion,\n };\n\n this.config.mcpServer.host = hostInfo;\n return this;\n }\n\n /**\n * Sets the MCP capabilities supported by the server\n *\n * @param capabilities Array of capability strings (e.g., [\"resources.get\", \"tools.invoke\"])\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 * @param name Resource name identifier (e.g., \"hcs_topics\")\n * @param description Human-readable description of the resource\n */\n addResource(name: string, description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n if (!this.config.mcpServer.resources) {\n this.config.mcpServer.resources = [];\n }\n\n const resource: MCPServerResource = {\n name,\n description,\n };\n\n this.config.mcpServer.resources.push(resource);\n return this;\n }\n\n /**\n * Sets all resources the MCP server exposes (replaces existing resources)\n *\n * @param resources Array of resource objects with name and description\n */\n setResources(resources: MCPServerResource[]): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n this.config.mcpServer.resources = resources;\n return this;\n }\n\n /**\n * Adds a tool that the MCP server provides\n *\n * @param name Tool name identifier (e.g., \"topic_submit\")\n * @param description Human-readable description of what the tool does\n */\n addTool(name: string, description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n if (!this.config.mcpServer.tools) {\n this.config.mcpServer.tools = [];\n }\n\n const tool: MCPServerTool = {\n name,\n description,\n };\n\n this.config.mcpServer.tools.push(tool);\n return this;\n }\n\n /**\n * Sets all tools the MCP server provides (replaces existing tools)\n *\n * @param tools Array of tool objects with name and description\n */\n setTools(tools: MCPServerTool[]): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n this.config.mcpServer.tools = tools;\n return this;\n }\n\n /**\n * Sets information about who maintains the MCP server\n *\n * @param maintainer Organization or entity maintaining this 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 * @param repository URL to 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 * @param docs URL to 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 * Sets the verification information for the MCP server\n *\n * @param verification Complete verification object\n */\n setVerification(verification: MCPServerVerification): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds DNS-based verification of endpoint ownership\n *\n * For DNS verification, the MCP server owner must add a DNS TXT record to their domain with:\n * - Name: By default, `_hedera` or a custom name specified in `dnsField` (automatically prefixed with `_`)\n * - Value: Equal to their Hedera account ID (e.g., `0.0.12345678`)\n *\n * Example DNS record:\n * ```\n * _hedera.example.com. 3600 IN TXT \"0.0.12345678\"\n * ```\n *\n * @param domain The fully qualified domain name to check (e.g., \"example.com\")\n * @param dnsField Optional custom DNS TXT record name (defaults to \"hedera\")\n */\n addVerificationDNS(domain: string, dnsField?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const verification: MCPServerVerification = {\n type: VerificationType.DNS,\n value: domain,\n dns_field: dnsField,\n };\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds signature-based verification of endpoint ownership\n *\n * For signature verification:\n * 1. The message to be signed must be the server URL exactly as it appears in the connectionInfo.url field\n * 2. The signature must be created using the ED25519 key associated with the Hedera account\n * 3. The signature must be encoded as a hexadecimal string with no `0x` prefix\n *\n * @param signature Hex-encoded ED25519 signature of the server URL\n */\n addVerificationSignature(signature: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const verification: MCPServerVerification = {\n type: VerificationType.SIGNATURE,\n value: signature,\n };\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds challenge-based verification of endpoint ownership\n *\n * For challenge verification:\n * 1. The MCP server must expose an endpoint that responds to HTTP GET requests\n * 2. The endpoint path defaults to \"/hedera-verification\" or can be customized with challengePath\n * 3. The server must respond with a JSON object containing:\n * ```json\n * {\n * \"accountId\": \"0.0.12345678\",\n * \"timestamp\": 1620000000000,\n * \"signature\": \"a1b2c3d4e5f6...\"\n * }\n * ```\n * 4. The signature must be an ED25519 signature of the UTF-8 encoded string `{accountId}:{timestamp}`\n *\n * @param challengePath Optional custom challenge endpoint path (defaults to \"hedera-verification\")\n */\n addVerificationChallenge(challengePath?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const verification: MCPServerVerification = {\n type: VerificationType.CHALLENGE,\n value: '',\n challenge_path: challengePath,\n };\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds a social media link to the profile\n *\n * @param platform Social media platform (e.g., \"twitter\", \"github\")\n * @param handle Username on the platform (e.g., \"@username\", \"username\")\n */\n addSocial(platform: SocialPlatform, handle: string): this {\n const existingSocial = this.socials.find(s => s.platform === platform);\n\n if (!existingSocial) {\n const socialLink: SocialLink = {\n platform,\n handle,\n };\n\n this.socials.push(socialLink);\n } else {\n existingSocial.handle = handle;\n }\n\n return this;\n }\n\n /**\n * Sets all social media links for the profile (replaces existing links)\n *\n * @param socials Array of social media links\n */\n setSocials(socials: SocialLink[]): this {\n this.socials = socials;\n return this;\n }\n\n /**\n * Sets the profile picture for the MCP server\n *\n * @param pfpBuffer Buffer containing the profile picture data\n * @param pfpFileName Filename for the profile picture including extension\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 * @param pfpTopicId Topic ID containing the profile picture (for reuse)\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 * @param network Network type (\"mainnet\" or \"testnet\")\n */\n setNetworkType(network: NetworkType): this {\n this.config.network = network;\n return this;\n }\n\n /**\n * Sets an existing account to use for the MCP server\n *\n * @param accountId Hedera account ID (e.g., \"0.0.12345678\")\n * @param privateKey ED25519 private key as a string\n */\n setExistingAccount(accountId: string, privateKey: string): this {\n this.config.existingAccount = {\n accountId,\n privateKey,\n };\n return this;\n }\n\n /**\n * Builds and validates the MCP server configuration\n *\n * @returns Complete MCPServerConfig object ready for use\n * @throws Error if required fields are missing\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 (\n !this.config.mcpServer.services ||\n this.config.mcpServer.services.length === 0\n ) {\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\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}\n"],"names":[],"mappings":";;AAiCO,MAAM,iBAAiB;AAAA,EAO5B,cAAc;AANd,SAAQ,SAAmC;AAAA,MACzC,WAAW,CAAA;AAAA,IAAC;AAEd,SAAQ,UAAwB,CAAA;AAI9B,SAAK,SAAS,OAAO,YAAY;AAAA,MAC/B,QAAQ;AAAA,IAAA,CACT;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAQ,MAAoB;AAC1B,SAAK,OAAO,OAAO;AACnB,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,OAAqB;AAC5B,SAAK,OAAO,QAAQ;AACpB,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,KAAmB;AACxB,SAAK,OAAO,MAAM;AAClB,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,eAAe,aAA2B;AACxC,WAAO,KAAK,OAAO,WA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.js","sources":["../../src/hcs-11/mcp-server-builder.ts"],"sourcesContent":["import {\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.setServerDescription('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 * @param name The display name for the MCP server profile\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 * @param alias Alternative identifier 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 * @param bio Brief description or biography for the MCP server\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 * @param version The MCP server version (e.g., \"2024-06-01\")\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 * @param url Base URL for the MCP server (e.g., \"https://mcp.example.com\")\n * @param transport Transport type (\"stdio\" or \"sse\")\n */\n setConnectionInfo(url: string, transport: 'stdio' | 'sse'): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const connectionInfo: MCPServerConnectionInfo = {\n url,\n transport,\n };\n\n this.config.mcpServer.connectionInfo = connectionInfo;\n return this;\n }\n\n /**\n * Sets the detailed description for the MCP server capabilities\n *\n * @param description Detailed description of server functionality\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 * @param services Array of service types offered by this 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 * @param minVersion Minimum host version required (e.g., \"2024-11-05\")\n */\n setHostRequirements(minVersion?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const hostInfo: MCPServerHost = {\n minVersion,\n };\n\n this.config.mcpServer.host = hostInfo;\n return this;\n }\n\n /**\n * Sets the MCP capabilities supported by the server\n *\n * @param capabilities Array of capability strings (e.g., [\"resources.get\", \"tools.invoke\"])\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 * @param name Resource name identifier (e.g., \"hcs_topics\")\n * @param description Human-readable description of the resource\n */\n addResource(name: string, description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n if (!this.config.mcpServer.resources) {\n this.config.mcpServer.resources = [];\n }\n\n const resource: MCPServerResource = {\n name,\n description,\n };\n\n this.config.mcpServer.resources.push(resource);\n return this;\n }\n\n /**\n * Sets all resources the MCP server exposes (replaces existing resources)\n *\n * @param resources Array of resource objects with name and description\n */\n setResources(resources: MCPServerResource[]): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n this.config.mcpServer.resources = resources;\n return this;\n }\n\n /**\n * Adds a tool that the MCP server provides\n *\n * @param name Tool name identifier (e.g., \"topic_submit\")\n * @param description Human-readable description of what the tool does\n */\n addTool(name: string, description: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n if (!this.config.mcpServer.tools) {\n this.config.mcpServer.tools = [];\n }\n\n const tool: MCPServerTool = {\n name,\n description,\n };\n\n this.config.mcpServer.tools.push(tool);\n return this;\n }\n\n /**\n * Sets all tools the MCP server provides (replaces existing tools)\n *\n * @param tools Array of tool objects with name and description\n */\n setTools(tools: MCPServerTool[]): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n this.config.mcpServer.tools = tools;\n return this;\n }\n\n /**\n * Sets information about who maintains the MCP server\n *\n * @param maintainer Organization or entity maintaining this 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 * @param repository URL to 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 * @param docs URL to 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 * Sets the verification information for the MCP server\n *\n * @param verification Complete verification object\n */\n setVerification(verification: MCPServerVerification): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds DNS-based verification of endpoint ownership\n *\n * For DNS verification, the MCP server owner must add a DNS TXT record to their domain with:\n * - Name: By default, `_hedera` or a custom name specified in `dnsField` (automatically prefixed with `_`)\n * - Value: Equal to their Hedera account ID (e.g., `0.0.12345678`)\n *\n * Example DNS record:\n * ```\n * _hedera.example.com. 3600 IN TXT \"0.0.12345678\"\n * ```\n *\n * @param domain The fully qualified domain name to check (e.g., \"example.com\")\n * @param dnsField Optional custom DNS TXT record name (defaults to \"hedera\")\n */\n addVerificationDNS(domain: string, dnsField?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const verification: MCPServerVerification = {\n type: VerificationType.DNS,\n value: domain,\n dns_field: dnsField,\n };\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds signature-based verification of endpoint ownership\n *\n * For signature verification:\n * 1. The message to be signed must be the server URL exactly as it appears in the connectionInfo.url field\n * 2. The signature must be created using the ED25519 key associated with the Hedera account\n * 3. The signature must be encoded as a hexadecimal string with no `0x` prefix\n *\n * @param signature Hex-encoded ED25519 signature of the server URL\n */\n addVerificationSignature(signature: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const verification: MCPServerVerification = {\n type: VerificationType.SIGNATURE,\n value: signature,\n };\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds challenge-based verification of endpoint ownership\n *\n * For challenge verification:\n * 1. The MCP server must expose an endpoint that responds to HTTP GET requests\n * 2. The endpoint path defaults to \"/hedera-verification\" or can be customized with challengePath\n * 3. The server must respond with a JSON object containing:\n * ```json\n * {\n * \"accountId\": \"0.0.12345678\",\n * \"timestamp\": 1620000000000,\n * \"signature\": \"a1b2c3d4e5f6...\"\n * }\n * ```\n * 4. The signature must be an ED25519 signature of the UTF-8 encoded string `{accountId}:{timestamp}`\n *\n * @param challengePath Optional custom challenge endpoint path (defaults to \"hedera-verification\")\n */\n addVerificationChallenge(challengePath?: string): this {\n if (!this.config.mcpServer) {\n this.config.mcpServer = {} as MCPServerDetails;\n }\n\n const verification: MCPServerVerification = {\n type: VerificationType.CHALLENGE,\n value: '',\n challenge_path: challengePath,\n };\n\n this.config.mcpServer.verification = verification;\n return this;\n }\n\n /**\n * Adds a social media link to the profile\n *\n * @param platform Social media platform (e.g., \"twitter\", \"github\")\n * @param handle Username on the platform (e.g., \"@username\", \"username\")\n */\n addSocial(platform: SocialPlatform, handle: string): this {\n const existingSocial = this.socials.find(s => s.platform === platform);\n\n if (!existingSocial) {\n const socialLink: SocialLink = {\n platform,\n handle,\n };\n\n this.socials.push(socialLink);\n } else {\n existingSocial.handle = handle;\n }\n\n return this;\n }\n\n /**\n * Sets all social media links for the profile (replaces existing links)\n *\n * @param socials Array of social media links\n */\n setSocials(socials: SocialLink[]): this {\n this.socials = socials;\n return this;\n }\n\n /**\n * Sets the profile picture for the MCP server\n *\n * @param pfpBuffer Buffer containing the profile picture data\n * @param pfpFileName Filename for the profile picture including extension\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 * @param pfpTopicId Topic ID containing the profile picture (for reuse)\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 * @param network Network type (\"mainnet\" or \"testnet\")\n */\n setNetworkType(network: NetworkType): this {\n this.config.network = network;\n return this;\n }\n\n /**\n * Sets an existing account to use for the MCP server\n *\n * @param accountId Hedera account ID (e.g., \"0.0.12345678\")\n * @param privateKey ED25519 private key as a string\n */\n setExistingAccount(accountId: string, privateKey: string): this {\n this.config.existingAccount = {\n accountId,\n privateKey,\n };\n return this;\n }\n\n /**\n * Builds and validates the MCP server configuration\n *\n * @returns Complete MCPServerConfig object ready for use\n * @throws Error if required fields are missing\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 (\n !this.config.mcpServer.services ||\n this.config.mcpServer.services.length === 0\n ) {\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}\n"],"names":[],"mappings":";;AAiCO,MAAM,iBAAiB;AAAA,EAO5B,cAAc;AANd,SAAQ,SAAmC;AAAA,MACzC,WAAW,CAAA;AAAA,IAAC;AAEd,SAAQ,UAAwB,CAAA;AAI9B,SAAK,SAAS,OAAO,YAAY;AAAA,MAC/B,QAAQ;AAAA,IAAA,CACT;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAQ,MAAoB;AAC1B,SAAK,OAAO,OAAO;AACnB,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAS,OAAqB;AAC5B,SAAK,OAAO,QAAQ;AACpB,WAA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AAI,KAAK,QAAQ,SAAS,GAAG;AAC3B,aAAO;AAAA,QACL,GAAI,KAAK;AAAA,QACT,SAAS,KAAK;AAAA,MAAA;AAAA,IAElB;AAEA,WAAO,KAAK;AAAA,EACd;AACF;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Client, PrivateKey, Status, AccountUpdateTransaction } from "@hashgraph/sdk";
|
|
2
|
-
import { inscribeWithSigner, inscribe } from "./standards-sdk.
|
|
3
|
-
import { Logger } from "./standards-sdk.
|
|
4
|
-
import { HederaMirrorNode } from "./standards-sdk.
|
|
5
|
-
import { ProgressReporter } from "./standards-sdk.
|
|
2
|
+
import { inscribeWithSigner, inscribe } from "./standards-sdk.es41.js";
|
|
3
|
+
import { Logger } from "./standards-sdk.es34.js";
|
|
4
|
+
import { HederaMirrorNode } from "./standards-sdk.es42.js";
|
|
5
|
+
import { ProgressReporter } from "./standards-sdk.es36.js";
|
|
6
6
|
import "axios";
|
|
7
7
|
import "@hashgraph/proto";
|
|
8
8
|
import "buffer";
|
|
9
9
|
import "ethers";
|
|
10
|
-
import { detectKeyTypeFromString } from "./standards-sdk.
|
|
11
|
-
import { getTopicId } from "./standards-sdk.
|
|
10
|
+
import { detectKeyTypeFromString } from "./standards-sdk.es39.js";
|
|
11
|
+
import { getTopicId } from "./standards-sdk.es40.js";
|
|
12
12
|
import * as mime from "mime-types";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
import { AIAgentCapability, AIAgentType, VerificationType, MCPServerCapability, ProfileType, capabilityNameToCapabilityMap } from "./standards-sdk.es16.js";
|
|
@@ -67,7 +67,8 @@ const BaseProfileSchema = z.object({
|
|
|
67
67
|
profileImage: z.string().optional(),
|
|
68
68
|
properties: z.record(z.any()).optional(),
|
|
69
69
|
inboundTopicId: z.string().optional(),
|
|
70
|
-
outboundTopicId: z.string().optional()
|
|
70
|
+
outboundTopicId: z.string().optional(),
|
|
71
|
+
base_account: z.string().optional()
|
|
71
72
|
});
|
|
72
73
|
const PersonalProfileSchema = BaseProfileSchema.extend({
|
|
73
74
|
type: z.literal(ProfileType.PERSONAL),
|
|
@@ -82,10 +83,34 @@ const MCPServerProfileSchema = BaseProfileSchema.extend({
|
|
|
82
83
|
type: z.literal(ProfileType.MCP_SERVER),
|
|
83
84
|
mcpServer: MCPServerDetailsSchema
|
|
84
85
|
});
|
|
86
|
+
const FloraProfileSchema = z.object({
|
|
87
|
+
version: z.string(),
|
|
88
|
+
type: z.literal(ProfileType.FLORA),
|
|
89
|
+
display_name: z.string().min(1),
|
|
90
|
+
members: z.array(
|
|
91
|
+
z.object({
|
|
92
|
+
accountId: z.string(),
|
|
93
|
+
publicKey: z.string().optional(),
|
|
94
|
+
weight: z.number().optional()
|
|
95
|
+
})
|
|
96
|
+
),
|
|
97
|
+
threshold: z.number().min(1),
|
|
98
|
+
topics: z.object({
|
|
99
|
+
communication: z.string(),
|
|
100
|
+
transaction: z.string(),
|
|
101
|
+
state: z.string()
|
|
102
|
+
}),
|
|
103
|
+
inboundTopicId: z.string(),
|
|
104
|
+
outboundTopicId: z.string(),
|
|
105
|
+
bio: z.string().optional(),
|
|
106
|
+
metadata: z.record(z.any()).optional(),
|
|
107
|
+
policies: z.record(z.any()).optional()
|
|
108
|
+
});
|
|
85
109
|
const HCS11ProfileSchema = z.union([
|
|
86
110
|
PersonalProfileSchema,
|
|
87
111
|
AIAgentProfileSchema,
|
|
88
|
-
MCPServerProfileSchema
|
|
112
|
+
MCPServerProfileSchema,
|
|
113
|
+
FloraProfileSchema
|
|
89
114
|
]);
|
|
90
115
|
class HCS11Client {
|
|
91
116
|
constructor(config) {
|
|
@@ -160,7 +185,8 @@ class HCS11Client {
|
|
|
160
185
|
profileImage: options?.profileImage,
|
|
161
186
|
properties: options?.properties,
|
|
162
187
|
inboundTopicId: options?.inboundTopicId,
|
|
163
|
-
outboundTopicId: options?.outboundTopicId
|
|
188
|
+
outboundTopicId: options?.outboundTopicId,
|
|
189
|
+
base_account: options?.baseAccount
|
|
164
190
|
};
|
|
165
191
|
}
|
|
166
192
|
createAIAgentProfile(displayName, agentType, capabilities, model, options) {
|
|
@@ -175,6 +201,7 @@ class HCS11Client {
|
|
|
175
201
|
properties: options?.properties,
|
|
176
202
|
inboundTopicId: options?.inboundTopicId,
|
|
177
203
|
outboundTopicId: options?.outboundTopicId,
|
|
204
|
+
base_account: options?.baseAccount,
|
|
178
205
|
aiAgent: {
|
|
179
206
|
type: agentType,
|
|
180
207
|
capabilities,
|
|
@@ -198,6 +225,7 @@ class HCS11Client {
|
|
|
198
225
|
properties: options?.properties,
|
|
199
226
|
inboundTopicId: options?.inboundTopicId,
|
|
200
227
|
outboundTopicId: options?.outboundTopicId,
|
|
228
|
+
base_account: options?.baseAccount,
|
|
201
229
|
aiAgent: {
|
|
202
230
|
type: agentType,
|
|
203
231
|
capabilities,
|
|
@@ -393,6 +421,7 @@ class HCS11Client {
|
|
|
393
421
|
},
|
|
394
422
|
{
|
|
395
423
|
accountId: this.auth.operatorId,
|
|
424
|
+
// @ts-ignore
|
|
396
425
|
privateKey: PK,
|
|
397
426
|
network: this.network
|
|
398
427
|
},
|
|
@@ -503,6 +532,7 @@ class HCS11Client {
|
|
|
503
532
|
input,
|
|
504
533
|
{
|
|
505
534
|
accountId: this.auth.operatorId,
|
|
535
|
+
// @ts-ignore
|
|
506
536
|
privateKey: PK,
|
|
507
537
|
network: this.network
|
|
508
538
|
},
|