@hashgraphonline/standards-agent-kit 0.2.112 → 0.2.113
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/index.d.ts +1 -1
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/hcs6/CreateDynamicRegistryTool.d.ts +44 -0
- package/dist/cjs/tools/hcs6/QueryDynamicRegistryTool.d.ts +50 -0
- package/dist/cjs/tools/hcs6/RegisterDynamicHashinalTool.d.ts +102 -0
- package/dist/cjs/tools/hcs6/UpdateDynamicHashinalTool.d.ts +96 -0
- package/dist/cjs/tools/hcs6/base-hcs6-tools.d.ts +28 -0
- package/dist/cjs/tools/hcs6/hcs6-tool-params.d.ts +18 -0
- package/dist/cjs/tools/hcs6/index.d.ts +6 -0
- package/dist/cjs/tools/index.d.ts +1 -0
- package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +4 -4
- package/dist/es/index.d.ts +1 -1
- package/dist/es/standards-agent-kit.es.js +44 -31
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +27 -27
- package/dist/es/standards-agent-kit.es10.js.map +1 -1
- package/dist/es/standards-agent-kit.es11.js +20 -30
- package/dist/es/standards-agent-kit.es11.js.map +1 -1
- package/dist/es/standards-agent-kit.es12.js +27 -37
- package/dist/es/standards-agent-kit.es12.js.map +1 -1
- package/dist/es/standards-agent-kit.es13.js +48 -60
- package/dist/es/standards-agent-kit.es13.js.map +1 -1
- package/dist/es/standards-agent-kit.es14.js +60 -23
- package/dist/es/standards-agent-kit.es14.js.map +1 -1
- package/dist/es/standards-agent-kit.es15.js +23 -23
- package/dist/es/standards-agent-kit.es15.js.map +1 -1
- package/dist/es/standards-agent-kit.es16.js +23 -33
- package/dist/es/standards-agent-kit.es16.js.map +1 -1
- package/dist/es/standards-agent-kit.es17.js +34 -10
- package/dist/es/standards-agent-kit.es17.js.map +1 -1
- package/dist/es/standards-agent-kit.es18.js +16 -155
- package/dist/es/standards-agent-kit.es18.js.map +1 -1
- package/dist/es/standards-agent-kit.es19.js +150 -22
- package/dist/es/standards-agent-kit.es19.js.map +1 -1
- package/dist/es/standards-agent-kit.es20.js +25 -39
- package/dist/es/standards-agent-kit.es20.js.map +1 -1
- package/dist/es/standards-agent-kit.es21.js +26 -28
- package/dist/es/standards-agent-kit.es21.js.map +1 -1
- package/dist/es/standards-agent-kit.es22.js +16 -19
- package/dist/es/standards-agent-kit.es22.js.map +1 -1
- package/dist/es/standards-agent-kit.es23.js +21 -15
- package/dist/es/standards-agent-kit.es23.js.map +1 -1
- package/dist/es/standards-agent-kit.es24.js +18 -21
- package/dist/es/standards-agent-kit.es24.js.map +1 -1
- package/dist/es/standards-agent-kit.es25.js +35 -32
- package/dist/es/standards-agent-kit.es25.js.map +1 -1
- package/dist/es/standards-agent-kit.es26.js +38 -25
- package/dist/es/standards-agent-kit.es26.js.map +1 -1
- package/dist/es/standards-agent-kit.es27.js +25 -116
- package/dist/es/standards-agent-kit.es27.js.map +1 -1
- package/dist/es/standards-agent-kit.es28.js +33 -166
- package/dist/es/standards-agent-kit.es28.js.map +1 -1
- package/dist/es/standards-agent-kit.es29.js +42 -121
- package/dist/es/standards-agent-kit.es29.js.map +1 -1
- package/dist/es/standards-agent-kit.es30.js +40 -77
- package/dist/es/standards-agent-kit.es30.js.map +1 -1
- package/dist/es/standards-agent-kit.es31.js +42 -37
- package/dist/es/standards-agent-kit.es31.js.map +1 -1
- package/dist/es/standards-agent-kit.es32.js +20 -237
- package/dist/es/standards-agent-kit.es32.js.map +1 -1
- package/dist/es/standards-agent-kit.es33.js +154 -135
- package/dist/es/standards-agent-kit.es33.js.map +1 -1
- package/dist/es/standards-agent-kit.es34.js +168 -23
- package/dist/es/standards-agent-kit.es34.js.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +126 -21
- package/dist/es/standards-agent-kit.es35.js.map +1 -1
- package/dist/es/standards-agent-kit.es36.js +86 -3
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +45 -0
- package/dist/es/standards-agent-kit.es37.js.map +1 -0
- package/dist/es/standards-agent-kit.es38.js +249 -0
- package/dist/es/standards-agent-kit.es38.js.map +1 -0
- package/dist/es/standards-agent-kit.es39.js +141 -0
- package/dist/es/standards-agent-kit.es39.js.map +1 -0
- package/dist/es/standards-agent-kit.es4.js +65 -32
- package/dist/es/standards-agent-kit.es4.js.map +1 -1
- package/dist/es/standards-agent-kit.es40.js +33 -0
- package/dist/es/standards-agent-kit.es40.js.map +1 -0
- package/dist/es/standards-agent-kit.es41.js +28 -0
- package/dist/es/standards-agent-kit.es41.js.map +1 -0
- package/dist/es/standards-agent-kit.es42.js +7 -0
- package/dist/es/standards-agent-kit.es42.js.map +1 -0
- package/dist/es/standards-agent-kit.es5.js +35 -311
- package/dist/es/standards-agent-kit.es5.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +320 -20
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/standards-agent-kit.es7.js +19 -227
- package/dist/es/standards-agent-kit.es7.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +216 -65
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +72 -23
- package/dist/es/standards-agent-kit.es9.js.map +1 -1
- package/dist/es/tools/hcs6/CreateDynamicRegistryTool.d.ts +44 -0
- package/dist/es/tools/hcs6/QueryDynamicRegistryTool.d.ts +50 -0
- package/dist/es/tools/hcs6/RegisterDynamicHashinalTool.d.ts +102 -0
- package/dist/es/tools/hcs6/UpdateDynamicHashinalTool.d.ts +96 -0
- package/dist/es/tools/hcs6/base-hcs6-tools.d.ts +28 -0
- package/dist/es/tools/hcs6/hcs6-tool-params.d.ts +18 -0
- package/dist/es/tools/hcs6/index.d.ts +6 -0
- package/dist/es/tools/index.d.ts +1 -0
- package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +4 -4
- package/dist/umd/index.d.ts +1 -1
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/dist/umd/tools/hcs6/CreateDynamicRegistryTool.d.ts +44 -0
- package/dist/umd/tools/hcs6/QueryDynamicRegistryTool.d.ts +50 -0
- package/dist/umd/tools/hcs6/RegisterDynamicHashinalTool.d.ts +102 -0
- package/dist/umd/tools/hcs6/UpdateDynamicHashinalTool.d.ts +96 -0
- package/dist/umd/tools/hcs6/base-hcs6-tools.d.ts +28 -0
- package/dist/umd/tools/hcs6/hcs6-tool-params.d.ts +18 -0
- package/dist/umd/tools/hcs6/index.d.ts +6 -0
- package/dist/umd/tools/index.d.ts +1 -0
- package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +4 -4
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/tools/hcs6/CreateDynamicRegistryTool.ts +66 -0
- package/src/tools/hcs6/QueryDynamicRegistryTool.ts +72 -0
- package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +79 -0
- package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +74 -0
- package/src/tools/hcs6/base-hcs6-tools.ts +63 -0
- package/src/tools/hcs6/hcs6-tool-params.ts +21 -0
- package/src/tools/hcs6/index.ts +6 -0
- package/src/tools/index.ts +1 -0
- package/src/tools/inscriber/InscribeFromBufferTool.ts +1 -1
- package/src/tools/inscriber/InscribeFromUrlTool.ts +60 -7
|
@@ -1,50 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { BaseHCS10QueryTool } from "./standards-agent-kit.
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
"
|
|
2
|
+
import { BaseHCS10QueryTool } from "./standards-agent-kit.es7.js";
|
|
3
|
+
const ListConnectionsZodSchema = z.object({
|
|
4
|
+
includeDetails: z.boolean().optional().describe(
|
|
5
|
+
"Whether to include detailed information about each connection"
|
|
6
6
|
),
|
|
7
|
-
|
|
8
|
-
"Set to true to fetch the latest messages even if they have been seen before, ignoring the last checked timestamp. Defaults to false (fetching only new messages)."
|
|
9
|
-
),
|
|
10
|
-
lastMessagesCount: z.number().int().positive().optional().describe(
|
|
11
|
-
"When fetchLatest is true, specifies how many of the most recent messages to retrieve. Defaults to 1."
|
|
12
|
-
)
|
|
7
|
+
showPending: z.boolean().optional().describe("Whether to include pending connection requests")
|
|
13
8
|
});
|
|
14
|
-
class
|
|
9
|
+
class ListConnectionsTool extends BaseHCS10QueryTool {
|
|
15
10
|
constructor(params) {
|
|
16
11
|
super(params);
|
|
17
|
-
this.name = "
|
|
18
|
-
this.description =
|
|
19
|
-
|
|
20
|
-
By default, it only retrieves messages newer than the last check.
|
|
21
|
-
Use 'fetchLatest: true' to get the most recent messages regardless of when they arrived.
|
|
22
|
-
Use 'lastMessagesCount' to specify how many latest messages to retrieve (default 1 when fetchLatest is true).`;
|
|
23
|
-
this.specificInputSchema = CheckMessagesZodSchema;
|
|
12
|
+
this.name = "list_connections";
|
|
13
|
+
this.description = "Lists all active HCS-10 connections. Use this FIRST before sending messages to check if you already have an active connection to a target agent. Shows connection details and agent information for each active connection.";
|
|
14
|
+
this.specificInputSchema = ListConnectionsZodSchema;
|
|
24
15
|
}
|
|
25
|
-
async executeQuery({
|
|
26
|
-
targetIdentifier,
|
|
27
|
-
fetchLatest,
|
|
28
|
-
lastMessagesCount
|
|
29
|
-
}) {
|
|
16
|
+
async executeQuery(args) {
|
|
30
17
|
const hcs10Builder = this.hcs10Builder;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
const params = {};
|
|
19
|
+
if (args.includeDetails !== void 0) {
|
|
20
|
+
params.includeDetails = args.includeDetails;
|
|
21
|
+
}
|
|
22
|
+
if (args.showPending !== void 0) {
|
|
23
|
+
params.showPending = args.showPending;
|
|
24
|
+
}
|
|
25
|
+
await hcs10Builder.listConnections(params);
|
|
36
26
|
const result = await hcs10Builder.execute();
|
|
37
27
|
if (result.success && "rawResult" in result && result.rawResult) {
|
|
38
28
|
const raw = result.rawResult;
|
|
39
29
|
return {
|
|
40
30
|
success: true,
|
|
41
|
-
data: raw.formattedOutput || raw.message || "
|
|
31
|
+
data: raw.formattedOutput || raw.message || "Connections listed"
|
|
42
32
|
};
|
|
43
33
|
}
|
|
44
34
|
return result;
|
|
45
35
|
}
|
|
46
36
|
}
|
|
47
37
|
export {
|
|
48
|
-
|
|
38
|
+
ListConnectionsTool
|
|
49
39
|
};
|
|
50
40
|
//# sourceMappingURL=standards-agent-kit.es11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es11.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es11.js","sources":["../../src/tools/hcs10/ListConnectionsTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10QueryTool } from './base-hcs10-tools';\nimport { HCS10QueryToolParams } from './hcs10-tool-params';\n\n/**\n * A tool to list currently active HCS-10 connections stored in the state manager.\n * Enhanced to show more details similar to moonscape's implementation.\n */\nconst ListConnectionsZodSchema = z.object({\n includeDetails: z\n .boolean()\n .optional()\n .describe(\n 'Whether to include detailed information about each connection'\n ),\n showPending: z\n .boolean()\n .optional()\n .describe('Whether to include pending connection requests'),\n});\n\nexport class ListConnectionsTool extends BaseHCS10QueryTool<\n typeof ListConnectionsZodSchema\n> {\n name = 'list_connections';\n description =\n 'Lists all active HCS-10 connections. Use this FIRST before sending messages to check if you already have an active connection to a target agent. Shows connection details and agent information for each active connection.';\n specificInputSchema = ListConnectionsZodSchema;\n constructor(params: HCS10QueryToolParams) {\n super(params);\n }\n\n protected async executeQuery(\n args: z.infer<typeof ListConnectionsZodSchema>\n ): Promise<unknown> {\n const hcs10Builder = this.hcs10Builder;\n const params: { includeDetails?: boolean; showPending?: boolean } = {};\n if (args.includeDetails !== undefined) {\n params.includeDetails = args.includeDetails;\n }\n if (args.showPending !== undefined) {\n params.showPending = args.showPending;\n }\n await hcs10Builder.listConnections(params);\n\n const result = await hcs10Builder.execute();\n\n if (result.success && 'rawResult' in result && result.rawResult) {\n const raw = result.rawResult as { formattedOutput?: string; message?: string };\n return {\n success: true,\n data: raw.formattedOutput || raw.message || 'Connections listed'\n };\n }\n\n return result;\n }\n}"],"names":[],"mappings":";;AAQA,MAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,gBAAgB,EACb,UACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,aAAa,EACV,QAAA,EACA,SAAA,EACA,SAAS,gDAAgD;AAC9D,CAAC;AAEM,MAAM,4BAA4B,mBAEvC;AAAA,EAKA,YAAY,QAA8B;AACxC,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAAA,EAGtB;AAAA,EAEA,MAAgB,aACd,MACkB;AAClB,UAAM,eAAe,KAAK;AAC1B,UAAM,SAA8D,CAAA;AACpE,QAAI,KAAK,mBAAmB,QAAW;AACrC,aAAO,iBAAiB,KAAK;AAAA,IAC/B;AACA,QAAI,KAAK,gBAAgB,QAAW;AAClC,aAAO,cAAc,KAAK;AAAA,IAC5B;AACA,UAAM,aAAa,gBAAgB,MAAM;AAEzC,UAAM,SAAS,MAAM,aAAa,QAAA;AAElC,QAAI,OAAO,WAAW,eAAe,UAAU,OAAO,WAAW;AAC/D,YAAM,MAAM,OAAO;AACnB,aAAO;AAAA,QACL,SAAS;AAAA,QACT,MAAM,IAAI,mBAAmB,IAAI,WAAW;AAAA,MAAA;AAAA,IAEhD;AAEA,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -1,60 +1,50 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
accountId: z.string().optional().describe(
|
|
7
|
-
"Optional: Filter registrations by a specific Hedera account ID (e.g., 0.0.12345)."
|
|
2
|
+
import { BaseHCS10QueryTool } from "./standards-agent-kit.es7.js";
|
|
3
|
+
const CheckMessagesZodSchema = z.object({
|
|
4
|
+
targetIdentifier: z.string().describe(
|
|
5
|
+
"The account ID (e.g., 0.0.12345) of the target agent OR the connection number (e.g., '1', '2') from the 'list_connections' tool to check messages for."
|
|
8
6
|
),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (!val) return void 0;
|
|
15
|
-
if (typeof val === "string") {
|
|
16
|
-
return NaturalLanguageMapper.parseCapabilities(val);
|
|
17
|
-
}
|
|
18
|
-
if (Array.isArray(val) && val.length > 0 && typeof val[0] === "string") {
|
|
19
|
-
return NaturalLanguageMapper.parseTagsOrCapabilities(val);
|
|
20
|
-
}
|
|
21
|
-
return val;
|
|
22
|
-
}).describe(
|
|
23
|
-
'Optional: Filter by capabilities/tags like "ai", "data", "analytics". Can be natural language terms or capability numbers.'
|
|
7
|
+
fetchLatest: z.boolean().optional().default(false).describe(
|
|
8
|
+
"Set to true to fetch the latest messages even if they have been seen before, ignoring the last checked timestamp. Defaults to false (fetching only new messages)."
|
|
9
|
+
),
|
|
10
|
+
lastMessagesCount: z.number().int().positive().optional().describe(
|
|
11
|
+
"When fetchLatest is true, specifies how many of the most recent messages to retrieve. Defaults to 1."
|
|
24
12
|
)
|
|
25
13
|
});
|
|
26
|
-
class
|
|
14
|
+
class CheckMessagesTool extends BaseHCS10QueryTool {
|
|
27
15
|
constructor(params) {
|
|
28
16
|
super(params);
|
|
29
|
-
this.name = "
|
|
30
|
-
this.description =
|
|
31
|
-
|
|
17
|
+
this.name = "check_messages";
|
|
18
|
+
this.description = `Checks for and retrieves messages from an active connection.
|
|
19
|
+
Identify the target agent using their account ID (e.g., 0.0.12345) or the connection number shown in 'list_connections'.
|
|
20
|
+
By default, it only retrieves messages newer than the last check.
|
|
21
|
+
Use 'fetchLatest: true' to get the most recent messages regardless of when they arrived.
|
|
22
|
+
Use 'lastMessagesCount' to specify how many latest messages to retrieve (default 1 when fetchLatest is true).`;
|
|
23
|
+
this.specificInputSchema = CheckMessagesZodSchema;
|
|
32
24
|
}
|
|
33
25
|
async executeQuery({
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
targetIdentifier,
|
|
27
|
+
fetchLatest,
|
|
28
|
+
lastMessagesCount
|
|
36
29
|
}) {
|
|
37
30
|
const hcs10Builder = this.hcs10Builder;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
params.tags = tags;
|
|
44
|
-
}
|
|
45
|
-
await hcs10Builder.findRegistrations(params);
|
|
31
|
+
await hcs10Builder.checkMessages({
|
|
32
|
+
targetIdentifier,
|
|
33
|
+
fetchLatest,
|
|
34
|
+
lastMessagesCount: lastMessagesCount || 1
|
|
35
|
+
});
|
|
46
36
|
const result = await hcs10Builder.execute();
|
|
47
37
|
if (result.success && "rawResult" in result && result.rawResult) {
|
|
48
38
|
const raw = result.rawResult;
|
|
49
39
|
return {
|
|
50
40
|
success: true,
|
|
51
|
-
data: raw.formattedOutput || raw.message || "
|
|
41
|
+
data: raw.formattedOutput || raw.message || "Messages checked"
|
|
52
42
|
};
|
|
53
43
|
}
|
|
54
44
|
return result;
|
|
55
45
|
}
|
|
56
46
|
}
|
|
57
47
|
export {
|
|
58
|
-
|
|
48
|
+
CheckMessagesTool
|
|
59
49
|
};
|
|
60
50
|
//# sourceMappingURL=standards-agent-kit.es12.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es12.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es12.js","sources":["../../src/tools/hcs10/CheckMessagesTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10QueryTool } from './base-hcs10-tools';\nimport { HCS10QueryToolParams } from './hcs10-tool-params';\n\n/**\n * A tool to check for new messages on an active HCS-10 connection topic,\n * or optionally fetch the latest messages regardless of timestamp.\n */\nconst CheckMessagesZodSchema = z.object({\n targetIdentifier: z\n .string()\n .describe(\n \"The account ID (e.g., 0.0.12345) of the target agent OR the connection number (e.g., '1', '2') from the 'list_connections' tool to check messages for.\"\n ),\n fetchLatest: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n 'Set to true to fetch the latest messages even if they have been seen before, ignoring the last checked timestamp. Defaults to false (fetching only new messages).'\n ),\n lastMessagesCount: z\n .number()\n .int()\n .positive()\n .optional()\n .describe(\n 'When fetchLatest is true, specifies how many of the most recent messages to retrieve. Defaults to 1.'\n ),\n});\n\nexport class CheckMessagesTool extends BaseHCS10QueryTool<\n typeof CheckMessagesZodSchema\n> {\n name = 'check_messages';\n description = `Checks for and retrieves messages from an active connection.\nIdentify the target agent using their account ID (e.g., 0.0.12345) or the connection number shown in 'list_connections'.\nBy default, it only retrieves messages newer than the last check.\nUse 'fetchLatest: true' to get the most recent messages regardless of when they arrived.\nUse 'lastMessagesCount' to specify how many latest messages to retrieve (default 1 when fetchLatest is true).`;\n specificInputSchema = CheckMessagesZodSchema;\n constructor(params: HCS10QueryToolParams) {\n super(params);\n }\n\n protected async executeQuery({\n targetIdentifier,\n fetchLatest,\n lastMessagesCount,\n }: z.infer<typeof CheckMessagesZodSchema>): Promise<unknown> {\n const hcs10Builder = this.hcs10Builder;\n await hcs10Builder.checkMessages({\n targetIdentifier,\n fetchLatest,\n lastMessagesCount: lastMessagesCount || 1,\n });\n\n const result = await hcs10Builder.execute();\n\n if (result.success && 'rawResult' in result && result.rawResult) {\n const raw = result.rawResult as {\n formattedOutput?: string;\n message?: string;\n };\n return {\n success: true,\n data: raw.formattedOutput || raw.message || 'Messages checked',\n };\n }\n\n return result;\n }\n}"],"names":[],"mappings":";;AAQA,MAAM,yBAAyB,EAAE,OAAO;AAAA,EACtC,kBAAkB,EACf,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,aAAa,EACV,QAAA,EACA,WACA,QAAQ,KAAK,EACb;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,mBAAmB,EAChB,SACA,MACA,SAAA,EACA,SAAA,EACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAEM,MAAM,0BAA0B,mBAErC;AAAA,EAQA,YAAY,QAA8B;AACxC,UAAM,MAAM;AARd,SAAA,OAAO;AACP,SAAA,cAAc;AAAA;AAAA;AAAA;AAAA;AAKd,SAAA,sBAAsB;AAAA,EAGtB;AAAA,EAEA,MAAgB,aAAa;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA,EAAA,GAC2D;AAC3D,UAAM,eAAe,KAAK;AAC1B,UAAM,aAAa,cAAc;AAAA,MAC/B;AAAA,MACA;AAAA,MACA,mBAAmB,qBAAqB;AAAA,IAAA,CACzC;AAED,UAAM,SAAS,MAAM,aAAa,QAAA;AAElC,QAAI,OAAO,WAAW,eAAe,UAAU,OAAO,WAAW;AAC/D,YAAM,MAAM,OAAO;AAInB,aAAO;AAAA,QACL,SAAS;AAAA,QACT,MAAM,IAAI,mBAAmB,IAAI,WAAW;AAAA,MAAA;AAAA,IAEhD;AAEA,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -1,72 +1,60 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { AIAgentCapability } from "@hashgraphonline/standards-sdk";
|
|
3
|
+
import { BaseHCS10QueryTool } from "./standards-agent-kit.es7.js";
|
|
4
|
+
import { NaturalLanguageMapper } from "./standards-agent-kit.es19.js";
|
|
5
|
+
const FindRegistrationsZodSchema = z.object({
|
|
6
|
+
accountId: z.string().optional().describe(
|
|
7
|
+
"Optional: Filter registrations by a specific Hedera account ID (e.g., 0.0.12345)."
|
|
6
8
|
),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
collectorAccount: z.string().optional()
|
|
23
|
-
})
|
|
24
|
-
).optional().describe(
|
|
25
|
-
"Array of token fee amounts and IDs to charge per message (with optional collector accounts)."
|
|
26
|
-
),
|
|
27
|
-
exemptAccountIds: z.array(z.string()).optional().describe(
|
|
28
|
-
"Array of account IDs to exempt from ALL fees set in this request."
|
|
29
|
-
),
|
|
30
|
-
monitorDurationSeconds: z.number().optional().describe(
|
|
31
|
-
"How long to monitor for incoming requests in seconds. Default is 120."
|
|
32
|
-
),
|
|
33
|
-
defaultCollectorAccount: z.string().optional().describe(
|
|
34
|
-
"Default account to collect fees if not specified at the fee level. Defaults to the agent account."
|
|
9
|
+
tags: z.union([
|
|
10
|
+
z.array(z.nativeEnum(AIAgentCapability)),
|
|
11
|
+
z.array(z.string()),
|
|
12
|
+
z.string()
|
|
13
|
+
]).optional().transform((val) => {
|
|
14
|
+
if (!val) return void 0;
|
|
15
|
+
if (typeof val === "string") {
|
|
16
|
+
return NaturalLanguageMapper.parseCapabilities(val);
|
|
17
|
+
}
|
|
18
|
+
if (Array.isArray(val) && val.length > 0 && typeof val[0] === "string") {
|
|
19
|
+
return NaturalLanguageMapper.parseTagsOrCapabilities(val);
|
|
20
|
+
}
|
|
21
|
+
return val;
|
|
22
|
+
}).describe(
|
|
23
|
+
'Optional: Filter by capabilities/tags like "ai", "data", "analytics". Can be natural language terms or capability numbers.'
|
|
35
24
|
)
|
|
36
25
|
});
|
|
37
|
-
class
|
|
26
|
+
class FindRegistrationsTool extends BaseHCS10QueryTool {
|
|
38
27
|
constructor(params) {
|
|
39
28
|
super(params);
|
|
40
|
-
this.name = "
|
|
41
|
-
this.description =
|
|
42
|
-
this.specificInputSchema =
|
|
43
|
-
this.neverScheduleThisTool = true;
|
|
44
|
-
this.requiresMultipleTransactions = true;
|
|
29
|
+
this.name = "find_registrations";
|
|
30
|
+
this.description = 'Searches the configured agent registry for HCS-10 agents. You can filter by account ID or tags/capabilities using natural language like "ai", "data processing", "analytics". Returns basic registration info.';
|
|
31
|
+
this.specificInputSchema = FindRegistrationsZodSchema;
|
|
45
32
|
}
|
|
46
|
-
async
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
33
|
+
async executeQuery({
|
|
34
|
+
accountId,
|
|
35
|
+
tags
|
|
36
|
+
}) {
|
|
37
|
+
const hcs10Builder = this.hcs10Builder;
|
|
38
|
+
const params = {};
|
|
39
|
+
if (accountId) {
|
|
40
|
+
params.accountId = accountId;
|
|
41
|
+
}
|
|
42
|
+
if (tags) {
|
|
43
|
+
params.tags = tags;
|
|
44
|
+
}
|
|
45
|
+
await hcs10Builder.findRegistrations(params);
|
|
46
|
+
const result = await hcs10Builder.execute();
|
|
47
|
+
if (result.success && "rawResult" in result && result.rawResult) {
|
|
48
|
+
const raw = result.rawResult;
|
|
49
|
+
return {
|
|
50
|
+
success: true,
|
|
51
|
+
data: raw.formattedOutput || raw.message || "Registrations searched"
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
67
55
|
}
|
|
68
56
|
}
|
|
69
57
|
export {
|
|
70
|
-
|
|
58
|
+
FindRegistrationsTool
|
|
71
59
|
};
|
|
72
60
|
//# sourceMappingURL=standards-agent-kit.es13.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es13.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es13.js","sources":["../../src/tools/hcs10/FindRegistrationsTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { AIAgentCapability } from '@hashgraphonline/standards-sdk';\nimport { BaseHCS10QueryTool } from './base-hcs10-tools';\nimport { HCS10QueryToolParams } from './hcs10-tool-params';\nimport { NaturalLanguageMapper } from './natural-language-mapper';\n\n/**\n * A tool to search for registered HCS-10 agents using the configured registry.\n */\nconst FindRegistrationsZodSchema = z.object({\n accountId: z\n .string()\n .optional()\n .describe(\n 'Optional: Filter registrations by a specific Hedera account ID (e.g., 0.0.12345).'\n ),\n tags: z\n .union([\n z.array(z.nativeEnum(AIAgentCapability)),\n z.array(z.string()),\n z.string(),\n ])\n .optional()\n .transform((val) => {\n if (!val) return undefined;\n if (typeof val === 'string') {\n return NaturalLanguageMapper.parseCapabilities(val);\n }\n if (Array.isArray(val) && val.length > 0 && typeof val[0] === 'string') {\n return NaturalLanguageMapper.parseTagsOrCapabilities(val);\n }\n return val as AIAgentCapability[];\n })\n .describe(\n 'Optional: Filter by capabilities/tags like \"ai\", \"data\", \"analytics\". Can be natural language terms or capability numbers.'\n ),\n});\n\nexport class FindRegistrationsTool extends BaseHCS10QueryTool<\n typeof FindRegistrationsZodSchema\n> {\n name = 'find_registrations';\n description =\n 'Searches the configured agent registry for HCS-10 agents. You can filter by account ID or tags/capabilities using natural language like \"ai\", \"data processing\", \"analytics\". Returns basic registration info.';\n specificInputSchema = FindRegistrationsZodSchema;\n constructor(params: HCS10QueryToolParams) {\n super(params);\n }\n\n protected async executeQuery({\n accountId,\n tags,\n }: z.infer<typeof FindRegistrationsZodSchema>): Promise<unknown> {\n const hcs10Builder = this.hcs10Builder;\n const params: { accountId?: string; tags?: number[] } = {};\n if (accountId) {\n params.accountId = accountId;\n }\n if (tags) {\n params.tags = tags as number[];\n }\n await hcs10Builder.findRegistrations(params);\n\n const result = await hcs10Builder.execute();\n\n if (result.success && 'rawResult' in result && result.rawResult) {\n const raw = result.rawResult as {\n formattedOutput?: string;\n message?: string;\n };\n return {\n success: true,\n data: raw.formattedOutput || raw.message || 'Registrations searched',\n };\n }\n\n return result;\n }\n}"],"names":[],"mappings":";;;;AASA,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,WAAW,EACR,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,MAAM,EACH,MAAM;AAAA,IACL,EAAE,MAAM,EAAE,WAAW,iBAAiB,CAAC;AAAA,IACvC,EAAE,MAAM,EAAE,QAAQ;AAAA,IAClB,EAAE,OAAA;AAAA,EAAO,CACV,EACA,SAAA,EACA,UAAU,CAAC,QAAQ;AAClB,QAAI,CAAC,IAAK,QAAO;AACjB,QAAI,OAAO,QAAQ,UAAU;AAC3B,aAAO,sBAAsB,kBAAkB,GAAG;AAAA,IACpD;AACA,QAAI,MAAM,QAAQ,GAAG,KAAK,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,MAAM,UAAU;AACtE,aAAO,sBAAsB,wBAAwB,GAAG;AAAA,IAC1D;AACA,WAAO;AAAA,EACT,CAAC,EACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAEM,MAAM,8BAA8B,mBAEzC;AAAA,EAKA,YAAY,QAA8B;AACxC,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAAA,EAGtB;AAAA,EAEA,MAAgB,aAAa;AAAA,IAC3B;AAAA,IACA;AAAA,EAAA,GAC+D;AAC/D,UAAM,eAAe,KAAK;AAC1B,UAAM,SAAkD,CAAA;AACxD,QAAI,WAAW;AACb,aAAO,YAAY;AAAA,IACrB;AACA,QAAI,MAAM;AACR,aAAO,OAAO;AAAA,IAChB;AACA,UAAM,aAAa,kBAAkB,MAAM;AAE3C,UAAM,SAAS,MAAM,aAAa,QAAA;AAElC,QAAI,OAAO,WAAW,eAAe,UAAU,OAAO,WAAW;AAC/D,YAAM,MAAM,OAAO;AAInB,aAAO;AAAA,QACL,SAAS;AAAA,QACT,MAAM,IAAI,mBAAmB,IAAI,WAAW;AAAA,MAAA;AAAA,IAEhD;AAEA,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -1,35 +1,72 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
"
|
|
2
|
+
import { BaseHCS10TransactionTool } from "./standards-agent-kit.es7.js";
|
|
3
|
+
const ConnectionMonitorZodSchema = z.object({
|
|
4
|
+
acceptAll: z.boolean().optional().describe(
|
|
5
|
+
"Whether to automatically accept all incoming connection requests. Default is false."
|
|
6
6
|
),
|
|
7
|
-
|
|
8
|
-
"
|
|
7
|
+
targetAccountId: z.string().optional().describe(
|
|
8
|
+
"If provided, only accept connection requests from this specific account ID."
|
|
9
|
+
),
|
|
10
|
+
hbarFees: z.array(
|
|
11
|
+
z.object({
|
|
12
|
+
amount: z.number(),
|
|
13
|
+
collectorAccount: z.string().optional()
|
|
14
|
+
})
|
|
15
|
+
).optional().describe(
|
|
16
|
+
"Array of HBAR fee amounts to charge per message (with optional collector accounts)."
|
|
17
|
+
),
|
|
18
|
+
tokenFees: z.array(
|
|
19
|
+
z.object({
|
|
20
|
+
amount: z.number(),
|
|
21
|
+
tokenId: z.string(),
|
|
22
|
+
collectorAccount: z.string().optional()
|
|
23
|
+
})
|
|
24
|
+
).optional().describe(
|
|
25
|
+
"Array of token fee amounts and IDs to charge per message (with optional collector accounts)."
|
|
26
|
+
),
|
|
27
|
+
exemptAccountIds: z.array(z.string()).optional().describe(
|
|
28
|
+
"Array of account IDs to exempt from ALL fees set in this request."
|
|
29
|
+
),
|
|
30
|
+
monitorDurationSeconds: z.number().optional().describe(
|
|
31
|
+
"How long to monitor for incoming requests in seconds. Default is 120."
|
|
32
|
+
),
|
|
33
|
+
defaultCollectorAccount: z.string().optional().describe(
|
|
34
|
+
"Default account to collect fees if not specified at the fee level. Defaults to the agent account."
|
|
9
35
|
)
|
|
10
36
|
});
|
|
11
|
-
class
|
|
37
|
+
class ConnectionMonitorTool extends BaseHCS10TransactionTool {
|
|
12
38
|
constructor(params) {
|
|
13
39
|
super(params);
|
|
14
|
-
this.name = "
|
|
15
|
-
this.description =
|
|
16
|
-
this.specificInputSchema =
|
|
40
|
+
this.name = "monitor_connections";
|
|
41
|
+
this.description = "Monitors for incoming connection requests and accepts them with optional fee settings. Use this to watch for connection requests and accept them, optionally setting HBAR or token fees on the connection. Note: When acceptAll=true, this tool requires multiple transactions and cannot be used in returnBytes mode.";
|
|
42
|
+
this.specificInputSchema = ConnectionMonitorZodSchema;
|
|
43
|
+
this.neverScheduleThisTool = true;
|
|
44
|
+
this.requiresMultipleTransactions = true;
|
|
17
45
|
}
|
|
18
|
-
async
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
46
|
+
async callBuilderMethod(builder, specificArgs) {
|
|
47
|
+
const hcs10Builder = builder;
|
|
48
|
+
await hcs10Builder.monitorConnections({
|
|
49
|
+
...specificArgs.acceptAll !== void 0 && {
|
|
50
|
+
acceptAll: specificArgs.acceptAll
|
|
51
|
+
},
|
|
52
|
+
...specificArgs.targetAccountId !== void 0 && {
|
|
53
|
+
targetAccountId: specificArgs.targetAccountId
|
|
54
|
+
},
|
|
55
|
+
...specificArgs.monitorDurationSeconds !== void 0 && {
|
|
56
|
+
monitorDurationSeconds: specificArgs.monitorDurationSeconds
|
|
57
|
+
},
|
|
58
|
+
hbarFees: specificArgs.hbarFees || [],
|
|
59
|
+
tokenFees: specificArgs.tokenFees || [],
|
|
60
|
+
...specificArgs.exemptAccountIds !== void 0 && {
|
|
61
|
+
exemptAccountIds: specificArgs.exemptAccountIds
|
|
62
|
+
},
|
|
63
|
+
...specificArgs.defaultCollectorAccount !== void 0 && {
|
|
64
|
+
defaultCollectorAccount: specificArgs.defaultCollectorAccount
|
|
65
|
+
}
|
|
66
|
+
});
|
|
30
67
|
}
|
|
31
68
|
}
|
|
32
69
|
export {
|
|
33
|
-
|
|
70
|
+
ConnectionMonitorTool
|
|
34
71
|
};
|
|
35
72
|
//# sourceMappingURL=standards-agent-kit.es14.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es14.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es14.js","sources":["../../src/tools/hcs10/ConnectionMonitorTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10TransactionTool } from './base-hcs10-tools';\nimport { HCS10Builder } from '../../builders/hcs10/hcs10-builder';\nimport { HCS10TransactionToolParams } from './hcs10-tool-params';\nimport { BaseServiceBuilder } from 'hedera-agent-kit';\n\nconst ConnectionMonitorZodSchema = z.object({\n acceptAll: z\n .boolean()\n .optional()\n .describe(\n 'Whether to automatically accept all incoming connection requests. Default is false.'\n ),\n targetAccountId: z\n .string()\n .optional()\n .describe(\n 'If provided, only accept connection requests from this specific account ID.'\n ),\n hbarFees: z\n .array(\n z.object({\n amount: z.number(),\n collectorAccount: z.string().optional(),\n })\n )\n .optional()\n .describe(\n 'Array of HBAR fee amounts to charge per message (with optional collector accounts).'\n ),\n tokenFees: z\n .array(\n z.object({\n amount: z.number(),\n tokenId: z.string(),\n collectorAccount: z.string().optional(),\n })\n )\n .optional()\n .describe(\n 'Array of token fee amounts and IDs to charge per message (with optional collector accounts).'\n ),\n exemptAccountIds: z\n .array(z.string())\n .optional()\n .describe(\n 'Array of account IDs to exempt from ALL fees set in this request.'\n ),\n monitorDurationSeconds: z\n .number()\n .optional()\n .describe(\n 'How long to monitor for incoming requests in seconds. Default is 120.'\n ),\n defaultCollectorAccount: z\n .string()\n .optional()\n .describe(\n 'Default account to collect fees if not specified at the fee level. Defaults to the agent account.'\n ),\n});\n\n/**\n * A tool for monitoring incoming connection requests and accepting them with optional fee settings.\n */\nexport class ConnectionMonitorTool extends BaseHCS10TransactionTool<\n typeof ConnectionMonitorZodSchema\n> {\n name = 'monitor_connections';\n description =\n 'Monitors for incoming connection requests and accepts them with optional fee settings. Use this to watch for connection requests and accept them, optionally setting HBAR or token fees on the connection. Note: When acceptAll=true, this tool requires multiple transactions and cannot be used in returnBytes mode.';\n specificInputSchema = ConnectionMonitorZodSchema;\n constructor(params: HCS10TransactionToolParams) {\n super(params);\n this.neverScheduleThisTool = true;\n this.requiresMultipleTransactions = true;\n }\n\n protected async callBuilderMethod(\n builder: BaseServiceBuilder,\n specificArgs: z.infer<typeof ConnectionMonitorZodSchema>\n ): Promise<void> {\n const hcs10Builder = builder as HCS10Builder;\n await hcs10Builder.monitorConnections({\n ...(specificArgs.acceptAll !== undefined && {\n acceptAll: specificArgs.acceptAll,\n }),\n ...(specificArgs.targetAccountId !== undefined && {\n targetAccountId: specificArgs.targetAccountId,\n }),\n ...(specificArgs.monitorDurationSeconds !== undefined && {\n monitorDurationSeconds: specificArgs.monitorDurationSeconds,\n }),\n hbarFees: (specificArgs.hbarFees || []) as Array<{\n amount: number;\n collectorAccount?: string;\n }>,\n tokenFees: (specificArgs.tokenFees || []) as Array<{\n amount: number;\n tokenId: string;\n collectorAccount?: string;\n }>,\n ...(specificArgs.exemptAccountIds !== undefined && {\n exemptAccountIds: specificArgs.exemptAccountIds,\n }),\n ...(specificArgs.defaultCollectorAccount !== undefined && {\n defaultCollectorAccount: specificArgs.defaultCollectorAccount,\n }),\n });\n }\n}\n"],"names":[],"mappings":";;AAMA,MAAM,6BAA6B,EAAE,OAAO;AAAA,EAC1C,WAAW,EACR,UACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,iBAAiB,EACd,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,UAAU,EACP;AAAA,IACC,EAAE,OAAO;AAAA,MACP,QAAQ,EAAE,OAAA;AAAA,MACV,kBAAkB,EAAE,OAAA,EAAS,SAAA;AAAA,IAAS,CACvC;AAAA,EAAA,EAEF,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,WAAW,EACR;AAAA,IACC,EAAE,OAAO;AAAA,MACP,QAAQ,EAAE,OAAA;AAAA,MACV,SAAS,EAAE,OAAA;AAAA,MACX,kBAAkB,EAAE,OAAA,EAAS,SAAA;AAAA,IAAS,CACvC;AAAA,EAAA,EAEF,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,kBAAkB,EACf,MAAM,EAAE,QAAQ,EAChB,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,wBAAwB,EACrB,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,yBAAyB,EACtB,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAKM,MAAM,8BAA8B,yBAEzC;AAAA,EAKA,YAAY,QAAoC;AAC9C,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAGpB,SAAK,wBAAwB;AAC7B,SAAK,+BAA+B;AAAA,EACtC;AAAA,EAEA,MAAgB,kBACd,SACA,cACe;AACf,UAAM,eAAe;AACrB,UAAM,aAAa,mBAAmB;AAAA,MACpC,GAAI,aAAa,cAAc,UAAa;AAAA,QAC1C,WAAW,aAAa;AAAA,MAAA;AAAA,MAE1B,GAAI,aAAa,oBAAoB,UAAa;AAAA,QAChD,iBAAiB,aAAa;AAAA,MAAA;AAAA,MAEhC,GAAI,aAAa,2BAA2B,UAAa;AAAA,QACvD,wBAAwB,aAAa;AAAA,MAAA;AAAA,MAEvC,UAAW,aAAa,YAAY,CAAA;AAAA,MAIpC,WAAY,aAAa,aAAa,CAAA;AAAA,MAKtC,GAAI,aAAa,qBAAqB,UAAa;AAAA,QACjD,kBAAkB,aAAa;AAAA,MAAA;AAAA,MAEjC,GAAI,aAAa,4BAA4B,UAAa;AAAA,QACxD,yBAAyB,aAAa;AAAA,MAAA;AAAA,IACxC,CACD;AAAA,EACH;AACF;"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { BaseHCS10QueryTool } from "./standards-agent-kit.es7.js";
|
|
3
|
+
const ManageConnectionRequestsZodSchema = z.object({
|
|
4
|
+
action: z.enum(["list", "view", "reject"]).describe(
|
|
5
|
+
"The action to perform: list all requests, view details of a specific request, or reject a request"
|
|
6
6
|
),
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
),
|
|
10
|
-
exemptAccountIds: z.array(z.string()).optional().describe(
|
|
11
|
-
"Optional list of account IDs to exempt from any configured fees on the new connection topic."
|
|
7
|
+
requestKey: z.string().optional().describe(
|
|
8
|
+
"The unique request key to view or reject (required for view and reject actions)"
|
|
12
9
|
)
|
|
13
10
|
});
|
|
14
|
-
class
|
|
11
|
+
class ManageConnectionRequestsTool extends BaseHCS10QueryTool {
|
|
15
12
|
constructor(params) {
|
|
16
13
|
super(params);
|
|
17
|
-
this.name = "
|
|
18
|
-
this.description =
|
|
19
|
-
this.specificInputSchema =
|
|
20
|
-
this.neverScheduleThisTool = true;
|
|
21
|
-
this.requiresMultipleTransactions = true;
|
|
14
|
+
this.name = "manage_connection_requests";
|
|
15
|
+
this.description = 'Manage incoming connection requests. List pending requests, view details about requesting agents, and reject connection requests. Use the separate "accept_connection_request" tool to accept.';
|
|
16
|
+
this.specificInputSchema = ManageConnectionRequestsZodSchema;
|
|
22
17
|
}
|
|
23
|
-
async
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
18
|
+
async executeQuery({
|
|
19
|
+
action,
|
|
20
|
+
requestKey
|
|
21
|
+
}) {
|
|
22
|
+
const hcs10Builder = this.hcs10Builder;
|
|
23
|
+
const params = { action };
|
|
24
|
+
if (requestKey !== void 0) {
|
|
25
|
+
params.requestKey = requestKey;
|
|
26
|
+
}
|
|
27
|
+
await hcs10Builder.manageConnectionRequests(params);
|
|
28
|
+
const result = await hcs10Builder.execute();
|
|
29
|
+
return "rawResult" in result ? result.rawResult : result;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
ManageConnectionRequestsTool
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=standards-agent-kit.es15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es15.js","sources":["../../src/tools/hcs10/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es15.js","sources":["../../src/tools/hcs10/ManageConnectionRequestsTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseHCS10QueryTool } from './base-hcs10-tools';\nimport { HCS10QueryToolParams } from './hcs10-tool-params';\n\nconst ManageConnectionRequestsZodSchema = z.object({\n action: z\n .enum(['list', 'view', 'reject'])\n .describe(\n 'The action to perform: list all requests, view details of a specific request, or reject a request'\n ),\n requestKey: z\n .string()\n .optional()\n .describe(\n 'The unique request key to view or reject (required for view and reject actions)'\n ),\n});\n\n/**\n * A tool for managing incoming connection requests in a LangChain-compatible way.\n * This tool allows an agent to list, view details of, and reject incoming connection requests.\n */\nexport class ManageConnectionRequestsTool extends BaseHCS10QueryTool<\n typeof ManageConnectionRequestsZodSchema\n> {\n name = 'manage_connection_requests';\n description =\n 'Manage incoming connection requests. List pending requests, view details about requesting agents, and reject connection requests. Use the separate \"accept_connection_request\" tool to accept.';\n specificInputSchema = ManageConnectionRequestsZodSchema;\n constructor(params: HCS10QueryToolParams) {\n super(params);\n }\n\n protected async executeQuery({\n action,\n requestKey,\n }: z.infer<typeof ManageConnectionRequestsZodSchema>): Promise<unknown> {\n const hcs10Builder = this.hcs10Builder;\n const params: { action: 'list' | 'view' | 'reject'; requestKey?: string } =\n { action };\n if (requestKey !== undefined) {\n params.requestKey = requestKey;\n }\n await hcs10Builder.manageConnectionRequests(params);\n const result = await hcs10Builder.execute();\n return 'rawResult' in result ? result.rawResult : result;\n }\n}\n"],"names":[],"mappings":";;AAIA,MAAM,oCAAoC,EAAE,OAAO;AAAA,EACjD,QAAQ,EACL,KAAK,CAAC,QAAQ,QAAQ,QAAQ,CAAC,EAC/B;AAAA,IACC;AAAA,EAAA;AAAA,EAEJ,YAAY,EACT,SACA,WACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC;AAMM,MAAM,qCAAqC,mBAEhD;AAAA,EAKA,YAAY,QAA8B;AACxC,UAAM,MAAM;AALd,SAAA,OAAO;AACP,SAAA,cACE;AACF,SAAA,sBAAsB;AAAA,EAGtB;AAAA,EAEA,MAAgB,aAAa;AAAA,IAC3B;AAAA,IACA;AAAA,EAAA,GACsE;AACtE,UAAM,eAAe,KAAK;AAC1B,UAAM,SACJ,EAAE,OAAA;AACJ,QAAI,eAAe,QAAW;AAC5B,aAAO,aAAa;AAAA,IACtB;AACA,UAAM,aAAa,yBAAyB,MAAM;AAClD,UAAM,SAAS,MAAM,aAAa,QAAA;AAClC,WAAO,eAAe,SAAS,OAAO,YAAY;AAAA,EACpD;AACF;"}
|