@hashgraphonline/standards-agent-kit 0.2.117 → 0.2.119
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.es33.js +2 -26
- package/dist/es/standards-agent-kit.es33.js.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +2 -2
- package/dist/es/standards-agent-kit.es35.js.map +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 +26 -29
- package/src/tools/inscriber/InscribeFromBufferTool.ts +2 -2
- package/src/tools/inscriber/InscribeFromUrlTool.ts +2 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/standards-agent-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.119",
|
|
4
4
|
"description": "A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/standards-agent-kit.cjs",
|
|
@@ -21,32 +21,6 @@
|
|
|
21
21
|
"LICENSE",
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"clean": "rimraf dist",
|
|
26
|
-
"build:es": "BUILD_FORMAT=es vite build",
|
|
27
|
-
"build:cjs": "BUILD_FORMAT=cjs vite build",
|
|
28
|
-
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
29
|
-
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:umd",
|
|
30
|
-
"test": "jest",
|
|
31
|
-
"lint": "eslint . --ext .ts",
|
|
32
|
-
"lint:fix": "eslint . --ext .ts --fix",
|
|
33
|
-
"prepare": "pnpm run build",
|
|
34
|
-
"prepublishOnly": "pnpm run build",
|
|
35
|
-
"release": "pnpm publish --access public",
|
|
36
|
-
"release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
|
|
37
|
-
"version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
|
|
38
|
-
"publish:canary": "pnpm run version:canary && pnpm run release:canary",
|
|
39
|
-
"demo:cli": "tsx examples/cli-demo.ts",
|
|
40
|
-
"demo:interactive": "tsx examples/interactive-demo.ts",
|
|
41
|
-
"demo:langchain": "tsx examples/langchain-demo.ts",
|
|
42
|
-
"demo:plugin": "tsx examples/plugin-system-example.ts",
|
|
43
|
-
"demo:plugin:weather": "tsx examples/plugins/weather/index.ts",
|
|
44
|
-
"demo:plugin:defi": "tsx examples/plugins/defi/index.ts",
|
|
45
|
-
"demo:plugin:openconvai": "tsx examples/openconvai-plugin-example.ts",
|
|
46
|
-
"standards-agent:start": "tsx examples/standards-expert/cli.ts -- start",
|
|
47
|
-
"standards-agent:process-docs": "tsx examples/standards-expert/cli.ts -- process-docs --all-repos",
|
|
48
|
-
"typecheck": "tsc --noEmit"
|
|
49
|
-
},
|
|
50
24
|
"keywords": [
|
|
51
25
|
"hedera",
|
|
52
26
|
"hcs10",
|
|
@@ -127,5 +101,28 @@
|
|
|
127
101
|
"vite-plugin-node-polyfills": "^0.23.0",
|
|
128
102
|
"vite-plugin-string-replace": "^1.1.3"
|
|
129
103
|
},
|
|
130
|
-
"
|
|
131
|
-
|
|
104
|
+
"scripts": {
|
|
105
|
+
"clean": "rimraf dist",
|
|
106
|
+
"build:es": "BUILD_FORMAT=es vite build",
|
|
107
|
+
"build:cjs": "BUILD_FORMAT=cjs vite build",
|
|
108
|
+
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
109
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:umd",
|
|
110
|
+
"test": "jest",
|
|
111
|
+
"lint": "eslint . --ext .ts",
|
|
112
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
113
|
+
"release": "pnpm publish --access public",
|
|
114
|
+
"release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
|
|
115
|
+
"version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
|
|
116
|
+
"publish:canary": "pnpm run version:canary && pnpm run release:canary",
|
|
117
|
+
"demo:cli": "tsx examples/cli-demo.ts",
|
|
118
|
+
"demo:interactive": "tsx examples/interactive-demo.ts",
|
|
119
|
+
"demo:langchain": "tsx examples/langchain-demo.ts",
|
|
120
|
+
"demo:plugin": "tsx examples/plugin-system-example.ts",
|
|
121
|
+
"demo:plugin:weather": "tsx examples/plugins/weather/index.ts",
|
|
122
|
+
"demo:plugin:defi": "tsx examples/plugins/defi/index.ts",
|
|
123
|
+
"demo:plugin:openconvai": "tsx examples/openconvai-plugin-example.ts",
|
|
124
|
+
"standards-agent:start": "tsx examples/standards-expert/cli.ts -- start",
|
|
125
|
+
"standards-agent:process-docs": "tsx examples/standards-expert/cli.ts -- process-docs --all-repos",
|
|
126
|
+
"typecheck": "tsc --noEmit"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -7,7 +7,7 @@ import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
|
7
7
|
* Schema for inscribing from buffer
|
|
8
8
|
*/
|
|
9
9
|
const inscribeFromBufferSchema = z.object({
|
|
10
|
-
base64Data: z.string().min(1, 'Data cannot be empty').describe('
|
|
10
|
+
base64Data: z.string().min(1, 'Data cannot be empty').describe('The FULL content to inscribe as plain text or base64. When asked to "inscribe it" after retrieving content, pass ALL the content you retrieved here as plain text - NOT a summary, NOT URLs, NOT truncated. Example: if you fetched Wikipedia articles, pass the complete article text you received.'),
|
|
11
11
|
fileName: z.string().min(1, 'File name cannot be empty').describe('Name for the inscribed content. Required for all inscriptions.'),
|
|
12
12
|
mimeType: z
|
|
13
13
|
.string()
|
|
@@ -53,7 +53,7 @@ const inscribeFromBufferSchema = z.object({
|
|
|
53
53
|
*/
|
|
54
54
|
export class InscribeFromBufferTool extends BaseInscriberQueryTool<typeof inscribeFromBufferSchema> {
|
|
55
55
|
name = 'inscribeFromBuffer';
|
|
56
|
-
description = '
|
|
56
|
+
description = 'PRIMARY inscription tool for ANY content you have already retrieved. USE THIS when asked to "inscribe it" after fetching content from MCP tools, search results, or any text data. Pass THE FULL CONTENT as plain text in base64Data field - the tool accepts both plain text and base64. CRITICAL: Pass the COMPLETE content you retrieved, NOT a summary or truncated version. Example: If you fetched Wikipedia articles with full text, pass ALL that text here as plain text.';
|
|
57
57
|
|
|
58
58
|
get specificInputSchema() {
|
|
59
59
|
return inscribeFromBufferSchema;
|
|
@@ -7,7 +7,7 @@ import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
|
7
7
|
* Schema for inscribing from URL
|
|
8
8
|
*/
|
|
9
9
|
const inscribeFromUrlSchema = z.object({
|
|
10
|
-
url: z.string().url().describe('ONLY direct file download URLs
|
|
10
|
+
url: z.string().url().describe('ONLY direct file download URLs with file extensions (.pdf, .jpg, .png, .json, .zip). NEVER use for web pages, articles, or when you already have content to inscribe.'),
|
|
11
11
|
mode: z
|
|
12
12
|
.enum(['file', 'hashinal'])
|
|
13
13
|
.optional()
|
|
@@ -48,7 +48,7 @@ const inscribeFromUrlSchema = z.object({
|
|
|
48
48
|
*/
|
|
49
49
|
export class InscribeFromUrlTool extends BaseInscriberQueryTool<typeof inscribeFromUrlSchema> {
|
|
50
50
|
name = 'inscribeFromUrl';
|
|
51
|
-
description = '
|
|
51
|
+
description = 'ONLY for direct FILE DOWNLOAD URLs ending with file extensions (.pdf, .jpg, .png, .json, .zip). NEVER use for web pages, articles, or ANY HTML content - it WILL FAIL. If you have already retrieved content from any source (including MCP tools), you MUST use inscribeFromBuffer instead. This tool downloads files from URLs - it does NOT inscribe content you already have. When asked to "inscribe it" after retrieving content, ALWAYS use inscribeFromBuffer with the actual content.';
|
|
52
52
|
|
|
53
53
|
get specificInputSchema() {
|
|
54
54
|
return inscribeFromUrlSchema;
|
|
@@ -73,35 +73,6 @@ export class InscribeFromUrlTool extends BaseInscriberQueryTool<typeof inscribeF
|
|
|
73
73
|
throw new Error('Only HTTP and HTTPS URLs are supported for inscription.');
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
// Block known article/webpage domains
|
|
77
|
-
const blockedDomains = [
|
|
78
|
-
'wikipedia.org',
|
|
79
|
-
'en.wikipedia.org',
|
|
80
|
-
'wikimedia.org',
|
|
81
|
-
'medium.com',
|
|
82
|
-
'twitter.com',
|
|
83
|
-
'x.com',
|
|
84
|
-
'facebook.com',
|
|
85
|
-
'linkedin.com',
|
|
86
|
-
'reddit.com',
|
|
87
|
-
'github.com',
|
|
88
|
-
'stackoverflow.com',
|
|
89
|
-
'news.ycombinator.com'
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
const hostname = urlObj.hostname.toLowerCase();
|
|
93
|
-
if (blockedDomains.some(domain => hostname.includes(domain))) {
|
|
94
|
-
throw new Error(`Cannot inscribe content from ${hostname}. This tool is only for direct file downloads (PDF, images, JSON, etc.), not web pages. To inscribe article content, first retrieve it using the appropriate tool, then use inscribeFromBuffer with the actual content.`);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Check for common file extensions to ensure it's a direct file
|
|
98
|
-
const pathname = urlObj.pathname.toLowerCase();
|
|
99
|
-
const validExtensions = ['.pdf', '.jpg', '.jpeg', '.png', '.gif', '.json', '.txt', '.csv', '.zip', '.tar', '.gz', '.mp3', '.mp4', '.wav'];
|
|
100
|
-
const hasValidExtension = validExtensions.some(ext => pathname.endsWith(ext));
|
|
101
|
-
|
|
102
|
-
if (!hasValidExtension && !pathname.includes('/api/') && !pathname.includes('/download/')) {
|
|
103
|
-
console.warn(`[InscribeFromUrlTool] WARNING: URL doesn't appear to be a direct file download: ${params.url}`);
|
|
104
|
-
}
|
|
105
76
|
} catch (error) {
|
|
106
77
|
if (error instanceof Error && error.message.includes('Cannot inscribe content from')) {
|
|
107
78
|
throw error;
|