@hashgraphonline/standards-agent-kit 0.2.115 → 0.2.116
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/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +23 -13
- package/dist/es/standards-agent-kit.es35.js.map +1 -1
- package/dist/es/standards-agent-kit.es38.js +1 -1
- package/dist/es/standards-agent-kit.es39.js +1 -1
- package/dist/es/standards-agent-kit.es41.js +3 -24
- package/dist/es/standards-agent-kit.es41.js.map +1 -1
- package/dist/es/standards-agent-kit.es42.js +24 -3
- package/dist/es/standards-agent-kit.es42.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/tools/inscriber/InscribeFromBufferTool.ts +32 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { BaseInscriberQueryTool } from "./standards-agent-kit.es32.js";
|
|
3
3
|
const inscribeFromBufferSchema = z.object({
|
|
4
|
-
base64Data: z.string().min(1, "
|
|
4
|
+
base64Data: z.string().min(1, "Data cannot be empty").describe("Content to inscribe. Can be either base64 encoded data OR plain text. The tool will automatically detect and handle both formats. Must contain valid, non-empty content (minimum 10 bytes)."),
|
|
5
5
|
fileName: z.string().min(1, "File name cannot be empty").describe("Name for the inscribed content. Required for all inscriptions."),
|
|
6
6
|
mimeType: z.string().optional().describe("MIME type of the content"),
|
|
7
7
|
mode: z.enum(["file", "hashinal"]).optional().describe("Inscription mode: file or hashinal NFT"),
|
|
@@ -16,7 +16,7 @@ class InscribeFromBufferTool extends BaseInscriberQueryTool {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
super(...arguments);
|
|
18
18
|
this.name = "inscribeFromBuffer";
|
|
19
|
-
this.description = "Use this
|
|
19
|
+
this.description = "Use this to inscribe ANY content you have retrieved, including articles, web pages, or text data from MCP tools. IMPORTANT: When asked to inscribe content from MCP tools or external sources, pass THE ACTUAL CONTENT YOU RETRIEVED (the article text, search results, etc.) to this tool - NOT links or empty HTML. This tool accepts both plain text and base64. Inscribe the actual content/summaries you displayed to the user, not HTML with links. DO NOT create new HTML - inscribe the actual retrieved content.";
|
|
20
20
|
}
|
|
21
21
|
get specificInputSchema() {
|
|
22
22
|
return inscribeFromBufferSchema;
|
|
@@ -35,31 +35,41 @@ class InscribeFromBufferTool extends BaseInscriberQueryTool {
|
|
|
35
35
|
throw new Error("No fileName provided. A valid fileName is required for inscription.");
|
|
36
36
|
}
|
|
37
37
|
let buffer;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(params.base64Data);
|
|
39
|
+
if (isValidBase64) {
|
|
40
|
+
try {
|
|
41
|
+
buffer = Buffer.from(params.base64Data, "base64");
|
|
42
|
+
console.log(`[InscribeFromBufferTool] Successfully decoded base64 data`);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.log(`[InscribeFromBufferTool] ERROR: Failed to decode base64`);
|
|
45
|
+
throw new Error("Failed to decode base64 data. Please ensure the data is properly encoded.");
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
console.log(`[InscribeFromBufferTool] WARNING: Data is not base64 encoded, treating as plain text`);
|
|
49
|
+
buffer = Buffer.from(params.base64Data, "utf8");
|
|
50
|
+
console.log(`[InscribeFromBufferTool] Converted plain text to buffer`);
|
|
43
51
|
}
|
|
44
52
|
console.log(`[InscribeFromBufferTool] Buffer length after conversion: ${buffer.length}`);
|
|
45
53
|
if (buffer.length === 0) {
|
|
46
54
|
console.log(`[InscribeFromBufferTool] ERROR: Buffer is empty after conversion`);
|
|
47
|
-
throw new Error("Buffer is empty after
|
|
55
|
+
throw new Error("Buffer is empty after conversion. The provided data appears to be invalid or empty.");
|
|
48
56
|
}
|
|
49
57
|
if (buffer.length < 10) {
|
|
50
58
|
console.log(`[InscribeFromBufferTool] WARNING: Buffer is very small (${buffer.length} bytes)`);
|
|
51
59
|
console.log(`[InscribeFromBufferTool] Buffer content preview: ${buffer.toString("utf8", 0, Math.min(buffer.length, 50))}`);
|
|
52
60
|
throw new Error(`Buffer content is too small (${buffer.length} bytes). This may indicate empty or invalid content. Please verify the source data contains actual content.`);
|
|
53
61
|
}
|
|
54
|
-
const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(params.base64Data);
|
|
55
|
-
if (!isValidBase64) {
|
|
56
|
-
console.log(`[InscribeFromBufferTool] ERROR: Invalid base64 format`);
|
|
57
|
-
throw new Error("Invalid base64 format. The data does not appear to be properly base64 encoded.");
|
|
58
|
-
}
|
|
59
62
|
if (buffer.toString("utf8", 0, Math.min(buffer.length, 100)).trim() === "") {
|
|
60
63
|
console.log(`[InscribeFromBufferTool] ERROR: Buffer contains only whitespace or empty content`);
|
|
61
64
|
throw new Error("Buffer contains only whitespace or empty content. Cannot inscribe meaningless data.");
|
|
62
65
|
}
|
|
66
|
+
const contentStr = buffer.toString("utf8");
|
|
67
|
+
const emptyHtmlPattern = /<a\s+href=["'][^"']+["']\s*>\s*<\/a>/i;
|
|
68
|
+
const hasOnlyEmptyLinks = emptyHtmlPattern.test(contentStr) && contentStr.replace(/<[^>]+>/g, "").trim().length < 50;
|
|
69
|
+
if (hasOnlyEmptyLinks) {
|
|
70
|
+
console.log(`[InscribeFromBufferTool] ERROR: Buffer contains empty HTML with just links and no content`);
|
|
71
|
+
throw new Error("Buffer contains empty HTML with only links and no actual content. When inscribing content from external sources, use the actual article text you retrieved, not empty HTML with links.");
|
|
72
|
+
}
|
|
63
73
|
const options = {
|
|
64
74
|
mode: params.mode,
|
|
65
75
|
metadata: params.metadata,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es35.js","sources":["../../src/tools/inscriber/InscribeFromBufferTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseInscriberQueryTool } from './base-inscriber-tools';\nimport { InscriptionOptions } from '@hashgraphonline/standards-sdk';\nimport { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';\n\n/**\n * Schema for inscribing from buffer\n */\nconst inscribeFromBufferSchema = z.object({\n base64Data: z.string().min(1, 'Base64 data cannot be empty').describe('Base64 encoded content to inscribe. Must contain valid, non-empty content (minimum 10 bytes after decoding).'),\n fileName: z.string().min(1, 'File name cannot be empty').describe('Name for the inscribed content. Required for all inscriptions.'),\n mimeType: z\n .string()\n .optional()\n .describe('MIME type of the content'),\n mode: z\n .enum(['file', 'hashinal'])\n .optional()\n .describe('Inscription mode: file or hashinal NFT'),\n metadata: z\n .record(z.unknown())\n .optional()\n .describe('Metadata to attach to the inscription'),\n tags: z\n .array(z.string())\n .optional()\n .describe('Tags to categorize the inscription'),\n chunkSize: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Chunk size for large files'),\n waitForConfirmation: z\n .boolean()\n .optional()\n .describe('Whether to wait for inscription confirmation'),\n timeoutMs: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Timeout in milliseconds for inscription (default: no timeout - waits until completion)'),\n apiKey: z\n .string()\n .optional()\n .describe('API key for inscription service'),\n});\n\n\n/**\n * Tool for inscribing content from buffer\n */\nexport class InscribeFromBufferTool extends BaseInscriberQueryTool<typeof inscribeFromBufferSchema> {\n name = 'inscribeFromBuffer';\n description = 'Use this for ANY web page, article, or content you retrieve. If user asks to inscribe a web page or article, FIRST retrieve it, THEN use this tool. This is the CORRECT tool for: web pages, news articles, blog posts, social media content, API responses, or any text content. Steps: 1) Retrieve content, 2) Convert to base64, 3) Use this tool. DO NOT use inscribeFromUrl for web content.';\n\n get specificInputSchema() {\n return inscribeFromBufferSchema;\n }\n\n protected async executeQuery(\n params: z.infer<typeof inscribeFromBufferSchema>,\n _runManager?: CallbackManagerForToolRun\n ): Promise<unknown> {\n console.log(`[DEBUG] InscribeFromBufferTool.executeQuery called`);\n console.log(`[DEBUG] Buffer tool received base64Data length: ${params.base64Data?.length || 0}`);\n console.log(`[DEBUG] Buffer tool fileName: ${params.fileName}`);\n console.log(`[DEBUG] Buffer tool mimeType: ${params.mimeType}`);\n \n if (!params.base64Data || params.base64Data.trim() === '') {\n console.log(`[InscribeFromBufferTool] ERROR: No data provided`);\n throw new Error('No data provided. Cannot inscribe empty content. Please provide valid base64 encoded data.');\n }\n\n if (!params.fileName || params.fileName.trim() === '') {\n console.log(`[InscribeFromBufferTool] ERROR: No fileName provided`);\n throw new Error('No fileName provided. A valid fileName is required for inscription.');\n }\n\n let buffer: Buffer;\n try {\n buffer = Buffer.from(params.base64Data, 'base64');\n } catch (error) {\n console.log(`[InscribeFromBufferTool] ERROR: Invalid base64 data`);\n throw new Error('Invalid base64 data provided. Please ensure the data is properly base64 encoded.');\n }\n \n console.log(`[InscribeFromBufferTool] Buffer length after conversion: ${buffer.length}`);\n \n if (buffer.length === 0) {\n console.log(`[InscribeFromBufferTool] ERROR: Buffer is empty after conversion`);\n throw new Error('Buffer is empty after base64 conversion. The provided data appears to be invalid or empty.');\n }\n\n if (buffer.length < 10) {\n console.log(`[InscribeFromBufferTool] WARNING: Buffer is very small (${buffer.length} bytes)`);\n console.log(`[InscribeFromBufferTool] Buffer content preview: ${buffer.toString('utf8', 0, Math.min(buffer.length, 50))}`);\n throw new Error(`Buffer content is too small (${buffer.length} bytes). This may indicate empty or invalid content. Please verify the source data contains actual content.`);\n }\n\n const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(params.base64Data);\n if (!isValidBase64) {\n console.log(`[InscribeFromBufferTool] ERROR: Invalid base64 format`);\n throw new Error('Invalid base64 format. The data does not appear to be properly base64 encoded.');\n }\n\n if (buffer.toString('utf8', 0, Math.min(buffer.length, 100)).trim() === '') {\n console.log(`[InscribeFromBufferTool] ERROR: Buffer contains only whitespace or empty content`);\n throw new Error('Buffer contains only whitespace or empty content. Cannot inscribe meaningless data.');\n }\n\n const options: InscriptionOptions = {\n mode: params.mode,\n metadata: params.metadata,\n tags: params.tags,\n chunkSize: params.chunkSize,\n waitForConfirmation: params.waitForConfirmation ?? true,\n waitMaxAttempts: 10,\n waitIntervalMs: 3000,\n apiKey: params.apiKey,\n network: this.inscriberBuilder['hederaKit'].client.network.toString().includes('mainnet') ? 'mainnet' : 'testnet',\n };\n\n try {\n let result: Awaited<ReturnType<typeof this.inscriberBuilder.inscribe>>;\n \n if (params.timeoutMs) {\n const timeoutPromise = new Promise<never>((_, reject) => {\n setTimeout(\n () => reject(new Error(`Inscription timed out after ${params.timeoutMs}ms`)),\n params.timeoutMs\n );\n });\n\n result = await Promise.race([\n this.inscriberBuilder.inscribe(\n {\n type: 'buffer',\n buffer,\n fileName: params.fileName,\n mimeType: params.mimeType,\n },\n options\n ),\n timeoutPromise,\n ]);\n } else {\n result = await this.inscriberBuilder.inscribe(\n {\n type: 'buffer',\n buffer,\n fileName: params.fileName,\n mimeType: params.mimeType,\n },\n options\n );\n }\n\n if (result.confirmed) {\n const topicId = result.inscription?.topic_id || result.result.topicId;\n const network = options.network || 'testnet';\n const cdnUrl = topicId ? `https://kiloscribe.com/api/inscription-cdn/${topicId}?network=${network}` : null;\n return `Successfully inscribed and confirmed content on the Hedera network!\\n\\nTransaction ID: ${result.result.transactionId}\\nTopic ID: ${topicId || 'N/A'}${cdnUrl ? `\\nView inscription: ${cdnUrl}` : ''}\\n\\nThe inscription is now available.`;\n } else {\n return `Successfully submitted inscription to the Hedera network!\\n\\nTransaction ID: ${result.result.transactionId}\\n\\nThe inscription is processing and will be confirmed shortly.`;\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to inscribe from buffer';\n throw new Error(`Inscription failed: ${errorMessage}`);\n }\n }\n}"],"names":[],"mappings":";;AAQA,MAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,YAAY,EAAE,SAAS,IAAI,GAAG,6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|
+
{"version":3,"file":"standards-agent-kit.es35.js","sources":["../../src/tools/inscriber/InscribeFromBufferTool.ts"],"sourcesContent":["import { z } from 'zod';\nimport { BaseInscriberQueryTool } from './base-inscriber-tools';\nimport { InscriptionOptions } from '@hashgraphonline/standards-sdk';\nimport { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';\n\n/**\n * Schema for inscribing from buffer\n */\nconst inscribeFromBufferSchema = z.object({\n base64Data: z.string().min(1, 'Data cannot be empty').describe('Content to inscribe. Can be either base64 encoded data OR plain text. The tool will automatically detect and handle both formats. Must contain valid, non-empty content (minimum 10 bytes).'),\n fileName: z.string().min(1, 'File name cannot be empty').describe('Name for the inscribed content. Required for all inscriptions.'),\n mimeType: z\n .string()\n .optional()\n .describe('MIME type of the content'),\n mode: z\n .enum(['file', 'hashinal'])\n .optional()\n .describe('Inscription mode: file or hashinal NFT'),\n metadata: z\n .record(z.unknown())\n .optional()\n .describe('Metadata to attach to the inscription'),\n tags: z\n .array(z.string())\n .optional()\n .describe('Tags to categorize the inscription'),\n chunkSize: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Chunk size for large files'),\n waitForConfirmation: z\n .boolean()\n .optional()\n .describe('Whether to wait for inscription confirmation'),\n timeoutMs: z\n .number()\n .int()\n .positive()\n .optional()\n .describe('Timeout in milliseconds for inscription (default: no timeout - waits until completion)'),\n apiKey: z\n .string()\n .optional()\n .describe('API key for inscription service'),\n});\n\n\n/**\n * Tool for inscribing content from buffer\n */\nexport class InscribeFromBufferTool extends BaseInscriberQueryTool<typeof inscribeFromBufferSchema> {\n name = 'inscribeFromBuffer';\n description = 'Use this to inscribe ANY content you have retrieved, including articles, web pages, or text data from MCP tools. IMPORTANT: When asked to inscribe content from MCP tools or external sources, pass THE ACTUAL CONTENT YOU RETRIEVED (the article text, search results, etc.) to this tool - NOT links or empty HTML. This tool accepts both plain text and base64. Inscribe the actual content/summaries you displayed to the user, not HTML with links. DO NOT create new HTML - inscribe the actual retrieved content.';\n\n get specificInputSchema() {\n return inscribeFromBufferSchema;\n }\n\n protected async executeQuery(\n params: z.infer<typeof inscribeFromBufferSchema>,\n _runManager?: CallbackManagerForToolRun\n ): Promise<unknown> {\n console.log(`[DEBUG] InscribeFromBufferTool.executeQuery called`);\n console.log(`[DEBUG] Buffer tool received base64Data length: ${params.base64Data?.length || 0}`);\n console.log(`[DEBUG] Buffer tool fileName: ${params.fileName}`);\n console.log(`[DEBUG] Buffer tool mimeType: ${params.mimeType}`);\n \n if (!params.base64Data || params.base64Data.trim() === '') {\n console.log(`[InscribeFromBufferTool] ERROR: No data provided`);\n throw new Error('No data provided. Cannot inscribe empty content. Please provide valid base64 encoded data.');\n }\n\n if (!params.fileName || params.fileName.trim() === '') {\n console.log(`[InscribeFromBufferTool] ERROR: No fileName provided`);\n throw new Error('No fileName provided. A valid fileName is required for inscription.');\n }\n\n let buffer: Buffer;\n \n // First check if it's valid base64\n const isValidBase64 = /^[A-Za-z0-9+/]*={0,2}$/.test(params.base64Data);\n \n if (isValidBase64) {\n // Try to decode as base64\n try {\n buffer = Buffer.from(params.base64Data, 'base64');\n console.log(`[InscribeFromBufferTool] Successfully decoded base64 data`);\n } catch (error) {\n console.log(`[InscribeFromBufferTool] ERROR: Failed to decode base64`);\n throw new Error('Failed to decode base64 data. Please ensure the data is properly encoded.');\n }\n } else {\n // Not base64, treat as plain text and encode it\n console.log(`[InscribeFromBufferTool] WARNING: Data is not base64 encoded, treating as plain text`);\n buffer = Buffer.from(params.base64Data, 'utf8');\n console.log(`[InscribeFromBufferTool] Converted plain text to buffer`);\n }\n \n console.log(`[InscribeFromBufferTool] Buffer length after conversion: ${buffer.length}`);\n \n if (buffer.length === 0) {\n console.log(`[InscribeFromBufferTool] ERROR: Buffer is empty after conversion`);\n throw new Error('Buffer is empty after conversion. The provided data appears to be invalid or empty.');\n }\n\n if (buffer.length < 10) {\n console.log(`[InscribeFromBufferTool] WARNING: Buffer is very small (${buffer.length} bytes)`);\n console.log(`[InscribeFromBufferTool] Buffer content preview: ${buffer.toString('utf8', 0, Math.min(buffer.length, 50))}`);\n throw new Error(`Buffer content is too small (${buffer.length} bytes). This may indicate empty or invalid content. Please verify the source data contains actual content.`);\n }\n\n if (buffer.toString('utf8', 0, Math.min(buffer.length, 100)).trim() === '') {\n console.log(`[InscribeFromBufferTool] ERROR: Buffer contains only whitespace or empty content`);\n throw new Error('Buffer contains only whitespace or empty content. Cannot inscribe meaningless data.');\n }\n\n // Check for empty HTML pattern (just links with no content)\n const contentStr = buffer.toString('utf8');\n const emptyHtmlPattern = /<a\\s+href=[\"'][^\"']+[\"']\\s*>\\s*<\\/a>/i;\n const hasOnlyEmptyLinks = emptyHtmlPattern.test(contentStr) && \n contentStr.replace(/<[^>]+>/g, '').trim().length < 50;\n \n if (hasOnlyEmptyLinks) {\n console.log(`[InscribeFromBufferTool] ERROR: Buffer contains empty HTML with just links and no content`);\n throw new Error('Buffer contains empty HTML with only links and no actual content. When inscribing content from external sources, use the actual article text you retrieved, not empty HTML with links.');\n }\n\n const options: InscriptionOptions = {\n mode: params.mode,\n metadata: params.metadata,\n tags: params.tags,\n chunkSize: params.chunkSize,\n waitForConfirmation: params.waitForConfirmation ?? true,\n waitMaxAttempts: 10,\n waitIntervalMs: 3000,\n apiKey: params.apiKey,\n network: this.inscriberBuilder['hederaKit'].client.network.toString().includes('mainnet') ? 'mainnet' : 'testnet',\n };\n\n try {\n let result: Awaited<ReturnType<typeof this.inscriberBuilder.inscribe>>;\n \n if (params.timeoutMs) {\n const timeoutPromise = new Promise<never>((_, reject) => {\n setTimeout(\n () => reject(new Error(`Inscription timed out after ${params.timeoutMs}ms`)),\n params.timeoutMs\n );\n });\n\n result = await Promise.race([\n this.inscriberBuilder.inscribe(\n {\n type: 'buffer',\n buffer,\n fileName: params.fileName,\n mimeType: params.mimeType,\n },\n options\n ),\n timeoutPromise,\n ]);\n } else {\n result = await this.inscriberBuilder.inscribe(\n {\n type: 'buffer',\n buffer,\n fileName: params.fileName,\n mimeType: params.mimeType,\n },\n options\n );\n }\n\n if (result.confirmed) {\n const topicId = result.inscription?.topic_id || result.result.topicId;\n const network = options.network || 'testnet';\n const cdnUrl = topicId ? `https://kiloscribe.com/api/inscription-cdn/${topicId}?network=${network}` : null;\n return `Successfully inscribed and confirmed content on the Hedera network!\\n\\nTransaction ID: ${result.result.transactionId}\\nTopic ID: ${topicId || 'N/A'}${cdnUrl ? `\\nView inscription: ${cdnUrl}` : ''}\\n\\nThe inscription is now available.`;\n } else {\n return `Successfully submitted inscription to the Hedera network!\\n\\nTransaction ID: ${result.result.transactionId}\\n\\nThe inscription is processing and will be confirmed shortly.`;\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Failed to inscribe from buffer';\n throw new Error(`Inscription failed: ${errorMessage}`);\n }\n }\n}"],"names":[],"mappings":";;AAQA,MAAM,2BAA2B,EAAE,OAAO;AAAA,EACxC,YAAY,EAAE,SAAS,IAAI,GAAG,sBAAsB,EAAE,SAAS,6LAA6L;AAAA,EAC5P,UAAU,EAAE,SAAS,IAAI,GAAG,2BAA2B,EAAE,SAAS,gEAAgE;AAAA,EAClI,UAAU,EACP,OAAA,EACA,SAAA,EACA,SAAS,0BAA0B;AAAA,EACtC,MAAM,EACH,KAAK,CAAC,QAAQ,UAAU,CAAC,EACzB,SAAA,EACA,SAAS,wCAAwC;AAAA,EACpD,UAAU,EACP,OAAO,EAAE,QAAA,CAAS,EAClB,SAAA,EACA,SAAS,uCAAuC;AAAA,EACnD,MAAM,EACH,MAAM,EAAE,OAAA,CAAQ,EAChB,SAAA,EACA,SAAS,oCAAoC;AAAA,EAChD,WAAW,EACR,OAAA,EACA,IAAA,EACA,SAAA,EACA,SAAA,EACA,SAAS,4BAA4B;AAAA,EACxC,qBAAqB,EAClB,QAAA,EACA,SAAA,EACA,SAAS,8CAA8C;AAAA,EAC1D,WAAW,EACR,OAAA,EACA,IAAA,EACA,SAAA,EACA,SAAA,EACA,SAAS,wFAAwF;AAAA,EACpG,QAAQ,E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QAAQ,KAAK;AAAA,UAC1B,KAAK,iBAAiB;AAAA,YACpB;AAAA,cACE,MAAM;AAAA,cACN;AAAA,cACA,UAAU,OAAO;AAAA,cACjB,UAAU,OAAO;AAAA,YAAA;AAAA,YAEnB;AAAA,UAAA;AAAA,UAEF;AAAA,QAAA,CACD;AAAA,MACH,OAAO;AACL,iBAAS,MAAM,KAAK,iBAAiB;AAAA,UACnC;AAAA,YACE,MAAM;AAAA,YACN;AAAA,YACA,UAAU,OAAO;AAAA,YACjB,UAAU,OAAO;AAAA,UAAA;AAAA,UAEnB;AAAA,QAAA;AAAA,MAEJ;AAEA,UAAI,OAAO,WAAW;AACpB,cAAM,UAAU,OAAO,aAAa,YAAY,OAAO,OAAO;AAC9D,cAAM,UAAU,QAAQ,WAAW;AACnC,cAAM,SAAS,UAAU,8CAA8C,OAAO,YAAY,OAAO,KAAK;AACtG,eAAO;AAAA;AAAA,kBAA0F,OAAO,OAAO,aAAa;AAAA,YAAe,WAAW,KAAK,GAAG,SAAS;AAAA,oBAAuB,MAAM,KAAK,EAAE;AAAA;AAAA;AAAA,MAC7M,OAAO;AACL,eAAO;AAAA;AAAA,kBAAgF,OAAO,OAAO,aAAa;AAAA;AAAA;AAAA,MACpH;AAAA,IACF,SAAS,OAAO;AACd,YAAM,eAAe,iBAAiB,QAAQ,MAAM,UAAU;AAC9D,YAAM,IAAI,MAAM,uBAAuB,YAAY,EAAE;AAAA,IACvD;AAAA,EACF;AACF;"}
|
|
@@ -13,7 +13,7 @@ import { RetrieveProfileTool } from "./standards-agent-kit.es17.js";
|
|
|
13
13
|
import { ListUnapprovedConnectionRequestsTool } from "./standards-agent-kit.es18.js";
|
|
14
14
|
import { OpenConvaiState } from "./standards-agent-kit.es38.js";
|
|
15
15
|
import { Logger } from "@hashgraphonline/standards-sdk";
|
|
16
|
-
import { ENV_FILE_PATH } from "./standards-agent-kit.
|
|
16
|
+
import { ENV_FILE_PATH } from "./standards-agent-kit.es42.js";
|
|
17
17
|
const initializeStandardsAgentKit = async (options) => {
|
|
18
18
|
const config = options?.clientConfig || {};
|
|
19
19
|
const operatorId = config.operatorId || process.env.HEDERA_OPERATOR_ID;
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import path__default from "path";
|
|
4
|
-
const ENV_FILE_PATH = path__default.join(process.cwd(), ".env");
|
|
5
|
-
async function updateEnvFile(envFilePath, variables) {
|
|
6
|
-
let envContent = "";
|
|
7
|
-
if (fs.existsSync(envFilePath)) {
|
|
8
|
-
envContent = fs.readFileSync(envFilePath, "utf8");
|
|
9
|
-
}
|
|
10
|
-
const envLines = envContent.split("\n");
|
|
11
|
-
const updatedLines = [...envLines];
|
|
12
|
-
for (const [key, value] of Object.entries(variables)) {
|
|
13
|
-
const lineIndex = updatedLines.findIndex(
|
|
14
|
-
(line) => line.startsWith(`${key}=`)
|
|
15
|
-
);
|
|
16
|
-
if (lineIndex !== -1) {
|
|
17
|
-
updatedLines[lineIndex] = `${key}=${value}`;
|
|
18
|
-
} else {
|
|
19
|
-
updatedLines.push(`${key}=${value}`);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
fs.writeFileSync(envFilePath, updatedLines.join("\n"));
|
|
1
|
+
function encryptMessage(message) {
|
|
2
|
+
return message;
|
|
23
3
|
}
|
|
24
4
|
export {
|
|
25
|
-
|
|
26
|
-
updateEnvFile
|
|
5
|
+
encryptMessage
|
|
27
6
|
};
|
|
28
7
|
//# sourceMappingURL=standards-agent-kit.es41.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es41.js","sources":["../../src/utils/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es41.js","sources":["../../src/utils/Encryption.ts"],"sourcesContent":["// src/utils/Encryption.ts\n/**\n * Placeholder for encryption functionality.\n * Currently, encryption is disabled. The useEncryption flag is false by default.\n * TODO: Implement actual encryption/decryption logic.\n */\n\nexport function encryptMessage(message: string): string {\n // TODO: Add encryption logic here if useEncryption flag is true.\n return message; // currently returns plaintext.\n}\n\nexport function decryptMessage(encryptedMessage: string): string {\n // TODO: Add decryption logic here.\n return encryptedMessage;\n}\n"],"names":[],"mappings":"AAOO,SAAS,eAAe,SAAyB;AAEpD,SAAO;AACX;"}
|
|
@@ -1,7 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import "@hashgraphonline/standards-sdk";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path__default from "path";
|
|
4
|
+
const ENV_FILE_PATH = path__default.join(process.cwd(), ".env");
|
|
5
|
+
async function updateEnvFile(envFilePath, variables) {
|
|
6
|
+
let envContent = "";
|
|
7
|
+
if (fs.existsSync(envFilePath)) {
|
|
8
|
+
envContent = fs.readFileSync(envFilePath, "utf8");
|
|
9
|
+
}
|
|
10
|
+
const envLines = envContent.split("\n");
|
|
11
|
+
const updatedLines = [...envLines];
|
|
12
|
+
for (const [key, value] of Object.entries(variables)) {
|
|
13
|
+
const lineIndex = updatedLines.findIndex(
|
|
14
|
+
(line) => line.startsWith(`${key}=`)
|
|
15
|
+
);
|
|
16
|
+
if (lineIndex !== -1) {
|
|
17
|
+
updatedLines[lineIndex] = `${key}=${value}`;
|
|
18
|
+
} else {
|
|
19
|
+
updatedLines.push(`${key}=${value}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
fs.writeFileSync(envFilePath, updatedLines.join("\n"));
|
|
3
23
|
}
|
|
4
24
|
export {
|
|
5
|
-
|
|
25
|
+
ENV_FILE_PATH,
|
|
26
|
+
updateEnvFile
|
|
6
27
|
};
|
|
7
28
|
//# sourceMappingURL=standards-agent-kit.es42.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-agent-kit.es42.js","sources":["../../src/utils/
|
|
1
|
+
{"version":3,"file":"standards-agent-kit.es42.js","sources":["../../src/utils/state-tools.ts"],"sourcesContent":["import {\n HCS10Client,\n AgentBuilder,\n Logger,\n} from '@hashgraphonline/standards-sdk';\nimport fs from 'fs';\nimport path from 'path';\nimport { ensureAgentHasEnoughHbar } from './ensure-agent-has-hbar';\n\nexport const ENV_FILE_PATH = path.join(process.cwd(), '.env');\n\nexport interface AgentData {\n accountId: string;\n operatorId: string;\n inboundTopicId: string;\n outboundTopicId: string;\n client: HCS10Client;\n}\n\nexport interface RegistrationProgressData {\n registered: boolean;\n accountId?: string;\n privateKey?: string;\n publicKey?: string;\n inboundTopicId?: string;\n outboundTopicId?: string;\n}\n\nexport async function getAgentFromEnv(\n logger: Logger,\n baseClient: HCS10Client,\n agentName: string,\n envPrefix: string\n): Promise<AgentData | null> {\n const accountIdEnvVar = `${envPrefix}_ACCOUNT_ID`;\n const privateKeyEnvVar = `${envPrefix}_PRIVATE_KEY`;\n const inboundTopicIdEnvVar = `${envPrefix}_INBOUND_TOPIC_ID`;\n const outboundTopicIdEnvVar = `${envPrefix}_OUTBOUND_TOPIC_ID`;\n\n const accountId = process.env[accountIdEnvVar];\n const privateKey = process.env[privateKeyEnvVar];\n const inboundTopicId = process.env[inboundTopicIdEnvVar];\n const outboundTopicId = process.env[outboundTopicIdEnvVar];\n\n if (!accountId || !privateKey || !inboundTopicId || !outboundTopicId) {\n logger.info(`${agentName} agent not found in environment variables`);\n return null;\n }\n\n logger.info(`${agentName} agent found in environment variables`);\n logger.info(`${agentName} account ID: ${accountId}`);\n logger.info(`${agentName} inbound topic ID: ${inboundTopicId}`);\n logger.info(`${agentName} outbound topic ID: ${outboundTopicId}`);\n\n const client = new HCS10Client({\n network: 'testnet',\n operatorId: accountId,\n operatorPrivateKey: privateKey,\n guardedRegistryBaseUrl: process.env.REGISTRY_URL,\n prettyPrint: true,\n logLevel: 'debug',\n });\n\n await ensureAgentHasEnoughHbar(logger, baseClient, accountId, agentName);\n\n return {\n accountId,\n operatorId: `${inboundTopicId}@${accountId}`,\n inboundTopicId,\n outboundTopicId,\n client,\n };\n}\n\nexport async function createAgent(\n logger: Logger,\n baseClient: HCS10Client,\n agentName: string,\n agentBuilder: AgentBuilder,\n envPrefix: string\n): Promise<AgentData | null> {\n try {\n logger.info(`Creating ${agentName} agent...`);\n\n const result = await baseClient.createAndRegisterAgent(agentBuilder);\n\n if (!result.metadata) {\n logger.error(`${agentName} agent creation failed`);\n return null;\n }\n\n logger.info(`${agentName} agent created successfully`);\n logger.info(`${agentName} account ID: ${result.metadata.accountId}`);\n logger.info(`${agentName} private key: ${result.metadata.privateKey}`);\n logger.info(\n `${agentName} inbound topic ID: ${result.metadata.inboundTopicId}`\n );\n logger.info(\n `${agentName} outbound topic ID: ${result.metadata.outboundTopicId}`\n );\n\n const envVars = {\n [`${envPrefix}_ACCOUNT_ID`]: result.metadata.accountId,\n [`${envPrefix}_PRIVATE_KEY`]: result.metadata.privateKey,\n [`${envPrefix}_INBOUND_TOPIC_ID`]: result.metadata.inboundTopicId,\n [`${envPrefix}_OUTBOUND_TOPIC_ID`]: result.metadata.outboundTopicId,\n };\n\n await updateEnvFile(ENV_FILE_PATH, envVars);\n\n const client = new HCS10Client({\n network: 'testnet',\n operatorId: result.metadata.accountId,\n operatorPrivateKey: result.metadata.privateKey,\n guardedRegistryBaseUrl: process.env.REGISTRY_URL,\n prettyPrint: true,\n logLevel: 'debug',\n });\n\n return {\n accountId: result.metadata.accountId,\n operatorId: `${result.metadata.inboundTopicId}@${result.metadata.accountId}`,\n inboundTopicId: result.metadata.inboundTopicId,\n outboundTopicId: result.metadata.outboundTopicId,\n client,\n };\n } catch (error) {\n console.log('error', error, baseClient);\n logger.error(`Error creating ${agentName} agent:`, error);\n return null;\n }\n}\n\nexport async function updateEnvFile(\n envFilePath: string,\n variables: Record<string, string>\n): Promise<void> {\n let envContent = '';\n\n if (fs.existsSync(envFilePath)) {\n envContent = fs.readFileSync(envFilePath, 'utf8');\n }\n\n const envLines = envContent.split('\\n');\n const updatedLines = [...envLines];\n\n for (const [key, value] of Object.entries(variables)) {\n const lineIndex = updatedLines.findIndex((line) =>\n line.startsWith(`${key}=`)\n );\n\n if (lineIndex !== -1) {\n updatedLines[lineIndex] = `${key}=${value}`;\n } else {\n updatedLines.push(`${key}=${value}`);\n }\n }\n\n fs.writeFileSync(envFilePath, updatedLines.join('\\n'));\n}\n"],"names":["path"],"mappings":";;;AASO,MAAM,gBAAgBA,cAAK,KAAK,QAAQ,IAAA,GAAO,MAAM;AA4H5D,eAAsB,cACpB,aACA,WACe;AACf,MAAI,aAAa;AAEjB,MAAI,GAAG,WAAW,WAAW,GAAG;AAC9B,iBAAa,GAAG,aAAa,aAAa,MAAM;AAAA,EAClD;AAEA,QAAM,WAAW,WAAW,MAAM,IAAI;AACtC,QAAM,eAAe,CAAC,GAAG,QAAQ;AAEjC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,SAAS,GAAG;AACpD,UAAM,YAAY,aAAa;AAAA,MAAU,CAAC,SACxC,KAAK,WAAW,GAAG,GAAG,GAAG;AAAA,IAAA;AAG3B,QAAI,cAAc,IAAI;AACpB,mBAAa,SAAS,IAAI,GAAG,GAAG,IAAI,KAAK;AAAA,IAC3C,OAAO;AACL,mBAAa,KAAK,GAAG,GAAG,IAAI,KAAK,EAAE;AAAA,IACrC;AAAA,EACF;AAEA,KAAG,cAAc,aAAa,aAAa,KAAK,IAAI,CAAC;AACvD;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HCS10Client as HCS10Client$1, Logger, AgentBuilder, AIAgentCapability, InboundTopicType } from "@hashgraphonline/standards-sdk";
|
|
2
|
-
import { encryptMessage } from "./standards-agent-kit.
|
|
2
|
+
import { encryptMessage } from "./standards-agent-kit.es41.js";
|
|
3
3
|
class HCS10Client {
|
|
4
4
|
constructor(operatorId, operatorPrivateKey, network, options) {
|
|
5
5
|
this.standardClient = new HCS10Client$1({
|