@nodetool-ai/agents 0.7.0-rc.11
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/agent-executor.d.ts +62 -0
- package/dist/agent-executor.d.ts.map +1 -0
- package/dist/agent-executor.js +324 -0
- package/dist/agent-executor.js.map +1 -0
- package/dist/agent-step-executor.d.ts +28 -0
- package/dist/agent-step-executor.d.ts.map +1 -0
- package/dist/agent-step-executor.js +99 -0
- package/dist/agent-step-executor.js.map +1 -0
- package/dist/agent-workflow-runner.d.ts +31 -0
- package/dist/agent-workflow-runner.d.ts.map +1 -0
- package/dist/agent-workflow-runner.js +124 -0
- package/dist/agent-workflow-runner.js.map +1 -0
- package/dist/agent.d.ts +115 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +587 -0
- package/dist/agent.js.map +1 -0
- package/dist/base-agent.d.ts +42 -0
- package/dist/base-agent.d.ts.map +1 -0
- package/dist/base-agent.js +29 -0
- package/dist/base-agent.js.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/graph-builder.d.ts +49 -0
- package/dist/graph-builder.d.ts.map +1 -0
- package/dist/graph-builder.js +206 -0
- package/dist/graph-builder.js.map +1 -0
- package/dist/graph-planner.d.ts +56 -0
- package/dist/graph-planner.d.ts.map +1 -0
- package/dist/graph-planner.js +311 -0
- package/dist/graph-planner.js.map +1 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +81 -0
- package/dist/index.js.map +1 -0
- package/dist/js-sandbox.d.ts +84 -0
- package/dist/js-sandbox.d.ts.map +1 -0
- package/dist/js-sandbox.js +654 -0
- package/dist/js-sandbox.js.map +1 -0
- package/dist/multi-mode-agent.d.ts +86 -0
- package/dist/multi-mode-agent.d.ts.map +1 -0
- package/dist/multi-mode-agent.js +476 -0
- package/dist/multi-mode-agent.js.map +1 -0
- package/dist/output-format.d.ts +10 -0
- package/dist/output-format.d.ts.map +1 -0
- package/dist/output-format.js +17 -0
- package/dist/output-format.js.map +1 -0
- package/dist/parallel-task-executor.d.ts +87 -0
- package/dist/parallel-task-executor.d.ts.map +1 -0
- package/dist/parallel-task-executor.js +332 -0
- package/dist/parallel-task-executor.js.map +1 -0
- package/dist/prompts/graph-planner-prompt.d.ts +48 -0
- package/dist/prompts/graph-planner-prompt.d.ts.map +1 -0
- package/dist/prompts/graph-planner-prompt.js +180 -0
- package/dist/prompts/graph-planner-prompt.js.map +1 -0
- package/dist/reject-agentic-provider.d.ts +21 -0
- package/dist/reject-agentic-provider.d.ts.map +1 -0
- package/dist/reject-agentic-provider.js +32 -0
- package/dist/reject-agentic-provider.js.map +1 -0
- package/dist/simple-agent.d.ts +29 -0
- package/dist/simple-agent.d.ts.map +1 -0
- package/dist/simple-agent.js +54 -0
- package/dist/simple-agent.js.map +1 -0
- package/dist/step-executor.d.ts +162 -0
- package/dist/step-executor.d.ts.map +1 -0
- package/dist/step-executor.js +1114 -0
- package/dist/step-executor.js.map +1 -0
- package/dist/sub-agent-planner.d.ts +33 -0
- package/dist/sub-agent-planner.d.ts.map +1 -0
- package/dist/sub-agent-planner.js +203 -0
- package/dist/sub-agent-planner.js.map +1 -0
- package/dist/task-executor.d.ts +89 -0
- package/dist/task-executor.d.ts.map +1 -0
- package/dist/task-executor.js +359 -0
- package/dist/task-executor.js.map +1 -0
- package/dist/task-planner.d.ts +44 -0
- package/dist/task-planner.d.ts.map +1 -0
- package/dist/task-planner.js +532 -0
- package/dist/task-planner.js.map +1 -0
- package/dist/team/db-task-board.d.ts +54 -0
- package/dist/team/db-task-board.d.ts.map +1 -0
- package/dist/team/db-task-board.js +361 -0
- package/dist/team/db-task-board.js.map +1 -0
- package/dist/team/edge-message-bus.d.ts +51 -0
- package/dist/team/edge-message-bus.d.ts.map +1 -0
- package/dist/team/edge-message-bus.js +169 -0
- package/dist/team/edge-message-bus.js.map +1 -0
- package/dist/team/edge-task-board.d.ts +77 -0
- package/dist/team/edge-task-board.d.ts.map +1 -0
- package/dist/team/edge-task-board.js +140 -0
- package/dist/team/edge-task-board.js.map +1 -0
- package/dist/team/index.d.ts +16 -0
- package/dist/team/index.d.ts.map +1 -0
- package/dist/team/index.js +17 -0
- package/dist/team/index.js.map +1 -0
- package/dist/team/message-bus.d.ts +58 -0
- package/dist/team/message-bus.d.ts.map +1 -0
- package/dist/team/message-bus.js +151 -0
- package/dist/team/message-bus.js.map +1 -0
- package/dist/team/task-board.d.ts +106 -0
- package/dist/team/task-board.d.ts.map +1 -0
- package/dist/team/task-board.js +370 -0
- package/dist/team/task-board.js.map +1 -0
- package/dist/team/team-executor.d.ts +72 -0
- package/dist/team/team-executor.d.ts.map +1 -0
- package/dist/team/team-executor.js +466 -0
- package/dist/team/team-executor.js.map +1 -0
- package/dist/team/team-tools.d.ts +252 -0
- package/dist/team/team-tools.d.ts.map +1 -0
- package/dist/team/team-tools.js +412 -0
- package/dist/team/team-tools.js.map +1 -0
- package/dist/team/types.d.ts +198 -0
- package/dist/team/types.d.ts.map +1 -0
- package/dist/team/types.js +8 -0
- package/dist/team/types.js.map +1 -0
- package/dist/tools/add-edge-tool.d.ts +18 -0
- package/dist/tools/add-edge-tool.d.ts.map +1 -0
- package/dist/tools/add-edge-tool.js +92 -0
- package/dist/tools/add-edge-tool.js.map +1 -0
- package/dist/tools/add-node-tool.d.ts +22 -0
- package/dist/tools/add-node-tool.d.ts.map +1 -0
- package/dist/tools/add-node-tool.js +128 -0
- package/dist/tools/add-node-tool.js.map +1 -0
- package/dist/tools/asset-tools.d.ts +58 -0
- package/dist/tools/asset-tools.d.ts.map +1 -0
- package/dist/tools/asset-tools.js +191 -0
- package/dist/tools/asset-tools.js.map +1 -0
- package/dist/tools/base-tool.d.ts +25 -0
- package/dist/tools/base-tool.d.ts.map +1 -0
- package/dist/tools/base-tool.js +24 -0
- package/dist/tools/base-tool.js.map +1 -0
- package/dist/tools/browser-tools.d.ts +32 -0
- package/dist/tools/browser-tools.d.ts.map +1 -0
- package/dist/tools/browser-tools.js +208 -0
- package/dist/tools/browser-tools.js.map +1 -0
- package/dist/tools/calculator-tool.d.ts +24 -0
- package/dist/tools/calculator-tool.d.ts.map +1 -0
- package/dist/tools/calculator-tool.js +64 -0
- package/dist/tools/calculator-tool.js.map +1 -0
- package/dist/tools/claude-code-tools.d.ts +96 -0
- package/dist/tools/claude-code-tools.d.ts.map +1 -0
- package/dist/tools/claude-code-tools.js +463 -0
- package/dist/tools/claude-code-tools.js.map +1 -0
- package/dist/tools/code-tools.d.ts +26 -0
- package/dist/tools/code-tools.d.ts.map +1 -0
- package/dist/tools/code-tools.js +82 -0
- package/dist/tools/code-tools.js.map +1 -0
- package/dist/tools/control-tool.d.ts +47 -0
- package/dist/tools/control-tool.d.ts.map +1 -0
- package/dist/tools/control-tool.js +101 -0
- package/dist/tools/control-tool.js.map +1 -0
- package/dist/tools/create-plan-tool.d.ts +29 -0
- package/dist/tools/create-plan-tool.d.ts.map +1 -0
- package/dist/tools/create-plan-tool.js +355 -0
- package/dist/tools/create-plan-tool.js.map +1 -0
- package/dist/tools/create-task-tool.d.ts +28 -0
- package/dist/tools/create-task-tool.d.ts.map +1 -0
- package/dist/tools/create-task-tool.js +254 -0
- package/dist/tools/create-task-tool.js.map +1 -0
- package/dist/tools/dataseo-tools.d.ts +38 -0
- package/dist/tools/dataseo-tools.d.ts.map +1 -0
- package/dist/tools/dataseo-tools.js +329 -0
- package/dist/tools/dataseo-tools.js.map +1 -0
- package/dist/tools/email-tools.d.ts +76 -0
- package/dist/tools/email-tools.d.ts.map +1 -0
- package/dist/tools/email-tools.js +259 -0
- package/dist/tools/email-tools.js.map +1 -0
- package/dist/tools/filesystem-tools.d.ts +77 -0
- package/dist/tools/filesystem-tools.d.ts.map +1 -0
- package/dist/tools/filesystem-tools.js +334 -0
- package/dist/tools/filesystem-tools.js.map +1 -0
- package/dist/tools/find-model-tool.d.ts +25 -0
- package/dist/tools/find-model-tool.d.ts.map +1 -0
- package/dist/tools/find-model-tool.js +236 -0
- package/dist/tools/find-model-tool.js.map +1 -0
- package/dist/tools/finish-graph-tool.d.ts +23 -0
- package/dist/tools/finish-graph-tool.d.ts.map +1 -0
- package/dist/tools/finish-graph-tool.js +46 -0
- package/dist/tools/finish-graph-tool.js.map +1 -0
- package/dist/tools/finish-step-tool.d.ts +16 -0
- package/dist/tools/finish-step-tool.d.ts.map +1 -0
- package/dist/tools/finish-step-tool.js +68 -0
- package/dist/tools/finish-step-tool.js.map +1 -0
- package/dist/tools/google-tools.d.ts +44 -0
- package/dist/tools/google-tools.d.ts.map +1 -0
- package/dist/tools/google-tools.js +176 -0
- package/dist/tools/google-tools.js.map +1 -0
- package/dist/tools/http-tools.d.ts +56 -0
- package/dist/tools/http-tools.d.ts.map +1 -0
- package/dist/tools/http-tools.js +180 -0
- package/dist/tools/http-tools.js.map +1 -0
- package/dist/tools/js-code-tool.d.ts +30 -0
- package/dist/tools/js-code-tool.d.ts.map +1 -0
- package/dist/tools/js-code-tool.js +98 -0
- package/dist/tools/js-code-tool.js.map +1 -0
- package/dist/tools/local-get-node-info-tool.d.ts +19 -0
- package/dist/tools/local-get-node-info-tool.d.ts.map +1 -0
- package/dist/tools/local-get-node-info-tool.js +75 -0
- package/dist/tools/local-get-node-info-tool.js.map +1 -0
- package/dist/tools/local-list-nodes-tool.d.ts +19 -0
- package/dist/tools/local-list-nodes-tool.d.ts.map +1 -0
- package/dist/tools/local-list-nodes-tool.js +69 -0
- package/dist/tools/local-list-nodes-tool.js.map +1 -0
- package/dist/tools/local-search-nodes-tool.d.ts +21 -0
- package/dist/tools/local-search-nodes-tool.d.ts.map +1 -0
- package/dist/tools/local-search-nodes-tool.js +111 -0
- package/dist/tools/local-search-nodes-tool.js.map +1 -0
- package/dist/tools/math-tools.d.ts +156 -0
- package/dist/tools/math-tools.d.ts.map +1 -0
- package/dist/tools/math-tools.js +422 -0
- package/dist/tools/math-tools.js.map +1 -0
- package/dist/tools/mcp-tools.d.ts +413 -0
- package/dist/tools/mcp-tools.d.ts.map +1 -0
- package/dist/tools/mcp-tools.js +618 -0
- package/dist/tools/mcp-tools.js.map +1 -0
- package/dist/tools/media-tools.d.ts +277 -0
- package/dist/tools/media-tools.d.ts.map +1 -0
- package/dist/tools/media-tools.js +682 -0
- package/dist/tools/media-tools.js.map +1 -0
- package/dist/tools/model-tools.d.ts +25 -0
- package/dist/tools/model-tools.d.ts.map +1 -0
- package/dist/tools/model-tools.js +48 -0
- package/dist/tools/model-tools.js.map +1 -0
- package/dist/tools/openai-tools.d.ts +73 -0
- package/dist/tools/openai-tools.d.ts.map +1 -0
- package/dist/tools/openai-tools.js +193 -0
- package/dist/tools/openai-tools.js.map +1 -0
- package/dist/tools/pdf-tools.d.ts +152 -0
- package/dist/tools/pdf-tools.d.ts.map +1 -0
- package/dist/tools/pdf-tools.js +339 -0
- package/dist/tools/pdf-tools.js.map +1 -0
- package/dist/tools/plan-builder-tools.d.ts +72 -0
- package/dist/tools/plan-builder-tools.d.ts.map +1 -0
- package/dist/tools/plan-builder-tools.js +438 -0
- package/dist/tools/plan-builder-tools.js.map +1 -0
- package/dist/tools/search-tools.d.ts +39 -0
- package/dist/tools/search-tools.d.ts.map +1 -0
- package/dist/tools/search-tools.js +218 -0
- package/dist/tools/search-tools.js.map +1 -0
- package/dist/tools/serp-providers/dataforseo-provider.d.ts +14 -0
- package/dist/tools/serp-providers/dataforseo-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/dataforseo-provider.js +114 -0
- package/dist/tools/serp-providers/dataforseo-provider.js.map +1 -0
- package/dist/tools/serp-providers/index.d.ts +35 -0
- package/dist/tools/serp-providers/index.d.ts.map +1 -0
- package/dist/tools/serp-providers/index.js +14 -0
- package/dist/tools/serp-providers/index.js.map +1 -0
- package/dist/tools/serp-providers/serpapi-provider.d.ts +18 -0
- package/dist/tools/serp-providers/serpapi-provider.d.ts.map +1 -0
- package/dist/tools/serp-providers/serpapi-provider.js +66 -0
- package/dist/tools/serp-providers/serpapi-provider.js.map +1 -0
- package/dist/tools/tool-registry.d.ts +9 -0
- package/dist/tools/tool-registry.d.ts.map +1 -0
- package/dist/tools/tool-registry.js +17 -0
- package/dist/tools/tool-registry.js.map +1 -0
- package/dist/tools/vector-tools.d.ts +224 -0
- package/dist/tools/vector-tools.d.ts.map +1 -0
- package/dist/tools/vector-tools.js +582 -0
- package/dist/tools/vector-tools.js.map +1 -0
- package/dist/tools/workspace-tools.d.ts +58 -0
- package/dist/tools/workspace-tools.d.ts.map +1 -0
- package/dist/tools/workspace-tools.js +152 -0
- package/dist/tools/workspace-tools.js.map +1 -0
- package/dist/types.d.ts +65 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/json-parser.d.ts +15 -0
- package/dist/utils/json-parser.d.ts.map +1 -0
- package/dist/utils/json-parser.js +78 -0
- package/dist/utils/json-parser.js.map +1 -0
- package/dist/utils/remove-base64-images.d.ts +12 -0
- package/dist/utils/remove-base64-images.d.ts.map +1 -0
- package/dist/utils/remove-base64-images.js +20 -0
- package/dist/utils/remove-base64-images.js.map +1 -0
- package/dist/utils/wrap-generators-parallel.d.ts +11 -0
- package/dist/utils/wrap-generators-parallel.d.ts.map +1 -0
- package/dist/utils/wrap-generators-parallel.js +38 -0
- package/dist/utils/wrap-generators-parallel.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MiniJS Agent Tool -- a lightweight sandboxed JavaScript interpreter for agents.
|
|
3
|
+
*
|
|
4
|
+
* Replaces multiple single-purpose tool calls with a single code execution that
|
|
5
|
+
* can do loops, conditionals, data transformation, HTTP requests, and more.
|
|
6
|
+
* Delegates to the shared js-sandbox engine.
|
|
7
|
+
*/
|
|
8
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
9
|
+
import { Tool } from "./base-tool.js";
|
|
10
|
+
export declare class MiniJSAgentTool extends Tool {
|
|
11
|
+
readonly name = "js";
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly inputSchema: {
|
|
14
|
+
type: "object";
|
|
15
|
+
properties: {
|
|
16
|
+
code: {
|
|
17
|
+
type: "string";
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
required: string[];
|
|
22
|
+
};
|
|
23
|
+
private readonly timeoutMs;
|
|
24
|
+
constructor(options?: {
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
});
|
|
27
|
+
process(context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
28
|
+
userMessage(params: Record<string, unknown>): string;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=js-code-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-code-tool.d.ts","sourceRoot":"","sources":["../../src/tools/js-code-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAQtC,qBAAa,eAAgB,SAAQ,IAAI;IACvC,QAAQ,CAAC,IAAI,QAAQ;IACrB,QAAQ,CAAC,WAAW,SAiDkC;IAEtD,QAAQ,CAAC,WAAW;;;;;;;;;MAUlB;IAEF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;IAKtC,OAAO,CACX,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,OAAO,CAAC;IAanB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CASrD"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MiniJS Agent Tool -- a lightweight sandboxed JavaScript interpreter for agents.
|
|
3
|
+
*
|
|
4
|
+
* Replaces multiple single-purpose tool calls with a single code execution that
|
|
5
|
+
* can do loops, conditionals, data transformation, HTTP requests, and more.
|
|
6
|
+
* Delegates to the shared js-sandbox engine.
|
|
7
|
+
*/
|
|
8
|
+
import { Tool } from "./base-tool.js";
|
|
9
|
+
import { DEFAULT_TIMEOUT_MS, MAX_LOOP_ITERATIONS, MAX_FETCH_CALLS, runInSandbox } from "../js-sandbox.js";
|
|
10
|
+
export class MiniJSAgentTool extends Tool {
|
|
11
|
+
name = "js";
|
|
12
|
+
description = `Execute JavaScript code in a sandboxed environment. Use this tool to perform data processing, \
|
|
13
|
+
HTTP requests, loops, conditionals, and complex logic in a single call instead of multiple tool calls.
|
|
14
|
+
|
|
15
|
+
## Sandbox environment
|
|
16
|
+
|
|
17
|
+
Vanilla JavaScript with full syntax: variables, loops, conditionals, functions, arrow functions, \
|
|
18
|
+
destructuring, spread, template literals, try/catch, async/await, Map, Set, RegExp, URL, \
|
|
19
|
+
URLSearchParams, Date, Math, JSON, Array methods (map, filter, reduce, find, every, some, etc).
|
|
20
|
+
|
|
21
|
+
Third-party helpers (lodash, dayjs, cheerio, csv-parse, validator) are NOT available. \
|
|
22
|
+
Use vanilla JS equivalents, or call dedicated tools/nodes when richer behaviour is needed.
|
|
23
|
+
|
|
24
|
+
## Bridge APIs
|
|
25
|
+
|
|
26
|
+
### fetch(url, options?) → {ok, status, headers, body, json, text(), arrayBuffer(), bytes()}
|
|
27
|
+
HTTP client. Options: {method, headers, body}. Returns a Response-like object.
|
|
28
|
+
\`\`\`js
|
|
29
|
+
const res = await fetch("https://api.example.com/data");
|
|
30
|
+
const items = res.json.results;
|
|
31
|
+
\`\`\`
|
|
32
|
+
|
|
33
|
+
### console.log(...args) / .warn / .error / .info
|
|
34
|
+
Output appears in the "logs" field of the result.
|
|
35
|
+
|
|
36
|
+
### workspace.read(path) / .write(path, content) / .list(path)
|
|
37
|
+
Read/write files in the agent workspace.
|
|
38
|
+
|
|
39
|
+
### assetToSandbox(assetId, path)
|
|
40
|
+
Copy a persistent platform asset into the sandbox workspace at the given path.
|
|
41
|
+
|
|
42
|
+
### sandboxToAsset(path) → AssetRef
|
|
43
|
+
Persist a workspace file as an asset and return an AssetRef.
|
|
44
|
+
|
|
45
|
+
### getSecret(name) → string | undefined
|
|
46
|
+
Read a secret by name (API keys, tokens, etc).
|
|
47
|
+
|
|
48
|
+
### uuid() → string
|
|
49
|
+
Generate a random UUID v4.
|
|
50
|
+
|
|
51
|
+
### sleep(ms)
|
|
52
|
+
Pause execution (max 5s per call).
|
|
53
|
+
|
|
54
|
+
## Guidelines
|
|
55
|
+
- Use \`return\` to produce the final result (returned in the "result" field)
|
|
56
|
+
- Use \`console.log()\` for intermediate values (captured in "logs" field)
|
|
57
|
+
- Loops are capped at ${MAX_LOOP_ITERATIONS.toLocaleString()} iterations for safety
|
|
58
|
+
- HTTP requests are capped at ${MAX_FETCH_CALLS} per execution
|
|
59
|
+
- Execution timeout: ${DEFAULT_TIMEOUT_MS / 1000}s
|
|
60
|
+
- Prefer this tool over multiple sequential tool calls when doing data transformation, \
|
|
61
|
+
API pagination, conditional logic, or batch operations`;
|
|
62
|
+
inputSchema = {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: {
|
|
65
|
+
code: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "JavaScript code to execute. Use `return` for the final result. Top-level `await` is supported."
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
required: ["code"]
|
|
71
|
+
};
|
|
72
|
+
timeoutMs;
|
|
73
|
+
constructor(options) {
|
|
74
|
+
super();
|
|
75
|
+
this.timeoutMs = options?.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
76
|
+
}
|
|
77
|
+
async process(context, params) {
|
|
78
|
+
const code = params.code;
|
|
79
|
+
if (typeof code !== "string" || !code.trim()) {
|
|
80
|
+
return { success: false, error: "No code provided", logs: [] };
|
|
81
|
+
}
|
|
82
|
+
return runInSandbox({
|
|
83
|
+
code,
|
|
84
|
+
context,
|
|
85
|
+
timeoutMs: this.timeoutMs
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
userMessage(params) {
|
|
89
|
+
const code = params.code ?? "";
|
|
90
|
+
const firstLine = code.split("\n")[0].trim();
|
|
91
|
+
if (firstLine.length > 0 && firstLine.length < 60) {
|
|
92
|
+
return `Running JS: ${firstLine}`;
|
|
93
|
+
}
|
|
94
|
+
const lines = code.split("\n").length;
|
|
95
|
+
return `Running JS (${lines} lines)`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=js-code-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-code-tool.js","sourceRoot":"","sources":["../../src/tools/js-code-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACb,MAAM,kBAAkB,CAAC;AAE1B,MAAM,OAAO,eAAgB,SAAQ,IAAI;IAC9B,IAAI,GAAG,IAAI,CAAC;IACZ,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6CD,mBAAmB,CAAC,cAAc,EAAE;gCAC5B,eAAe;uBACxB,kBAAkB,GAAG,IAAI;;uDAEO,CAAC;IAE7C,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAiB;gBACvB,WAAW,EACT,gGAAgG;aACnG;SACF;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB,CAAC;IAEe,SAAS,CAAS;IAEnC,YAAY,OAAgC;QAC1C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,kBAAkB,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAA0B,EAC1B,MAA+B;QAE/B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAC7C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACjE,CAAC;QAED,OAAO,YAAY,CAAC;YAClB,IAAI;YACJ,OAAO;YACP,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC,CAAC;IACL,CAAC;IAED,WAAW,CAAC,MAA+B;QACzC,MAAM,IAAI,GAAI,MAAM,CAAC,IAAe,IAAI,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YAClD,OAAO,eAAe,SAAS,EAAE,CAAC;QACpC,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QACtC,OAAO,eAAe,KAAK,SAAS,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalGetNodeInfoTool -- get full metadata for a specific node type.
|
|
3
|
+
*
|
|
4
|
+
* Local version of GetNodeInfoTool (from mcp-tools.ts) that queries
|
|
5
|
+
* the registry directly instead of via REST API.
|
|
6
|
+
*/
|
|
7
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
8
|
+
import type { NodeRegistry } from "@nodetool-ai/node-sdk";
|
|
9
|
+
import { Tool } from "./base-tool.js";
|
|
10
|
+
export declare class LocalGetNodeInfoTool extends Tool {
|
|
11
|
+
private readonly registry;
|
|
12
|
+
readonly name = "get_node_info";
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly inputSchema: Record<string, unknown>;
|
|
15
|
+
constructor(registry: NodeRegistry);
|
|
16
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
17
|
+
userMessage(params: Record<string, unknown>): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=local-get-node-info-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-get-node-info-tool.d.ts","sourceRoot":"","sources":["../../src/tools/local-get-node-info-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAqBtC,qBAAa,oBAAqB,SAAQ,IAAI;IAOhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IANrC,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,SAEmD;IACvE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAA8B;gBAE9C,QAAQ,EAAE,YAAY;IAI7C,OAAO,CACX,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,OAAO,CAAC;IA0CnB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAGrD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalGetNodeInfoTool -- get full metadata for a specific node type.
|
|
3
|
+
*
|
|
4
|
+
* Local version of GetNodeInfoTool (from mcp-tools.ts) that queries
|
|
5
|
+
* the registry directly instead of via REST API.
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from "./base-tool.js";
|
|
8
|
+
function typeMetaToString(tm) {
|
|
9
|
+
const args = (tm.type_args ?? []).map(typeMetaToString).filter(Boolean);
|
|
10
|
+
return args.length > 0 ? `${tm.type}[${args.join(", ")}]` : tm.type;
|
|
11
|
+
}
|
|
12
|
+
const GET_NODE_INFO_INPUT_SCHEMA = {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
node_type: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Fully-qualified node type (e.g. 'nodetool.text.Concat')"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: ["node_type"]
|
|
21
|
+
};
|
|
22
|
+
export class LocalGetNodeInfoTool extends Tool {
|
|
23
|
+
registry;
|
|
24
|
+
name = "get_node_info";
|
|
25
|
+
description = "Get detailed metadata for a node type including all inputs, outputs, types, and defaults. " +
|
|
26
|
+
"Use this before add_node to verify exact property names and types.";
|
|
27
|
+
inputSchema = GET_NODE_INFO_INPUT_SCHEMA;
|
|
28
|
+
constructor(registry) {
|
|
29
|
+
super();
|
|
30
|
+
this.registry = registry;
|
|
31
|
+
}
|
|
32
|
+
async process(_context, params) {
|
|
33
|
+
const nodeType = params["node_type"];
|
|
34
|
+
if (!nodeType) {
|
|
35
|
+
return { status: "error", errors: ["node_type is required"] };
|
|
36
|
+
}
|
|
37
|
+
const meta = this.registry.getMetadata(nodeType);
|
|
38
|
+
if (!meta) {
|
|
39
|
+
return {
|
|
40
|
+
status: "error",
|
|
41
|
+
errors: [
|
|
42
|
+
`Node type '${nodeType}' not found. Use search_nodes to find available types.`
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
node_type: meta.node_type,
|
|
48
|
+
title: meta.title,
|
|
49
|
+
description: meta.description,
|
|
50
|
+
namespace: meta.namespace,
|
|
51
|
+
properties: meta.properties.map((p) => ({
|
|
52
|
+
name: p.name,
|
|
53
|
+
type: typeMetaToString(p.type),
|
|
54
|
+
default: p.default,
|
|
55
|
+
description: p.description ?? undefined,
|
|
56
|
+
required: p.required ?? false,
|
|
57
|
+
min: p.min ?? undefined,
|
|
58
|
+
max: p.max ?? undefined,
|
|
59
|
+
values: p.values ?? undefined
|
|
60
|
+
})),
|
|
61
|
+
outputs: meta.outputs.map((o) => ({
|
|
62
|
+
name: o.name,
|
|
63
|
+
type: typeMetaToString(o.type)
|
|
64
|
+
})),
|
|
65
|
+
is_streaming_output: meta.is_streaming_output ?? false,
|
|
66
|
+
is_streaming_input: meta.is_streaming_input ?? false,
|
|
67
|
+
required_settings: meta.required_settings ?? [],
|
|
68
|
+
required_runtimes: meta.required_runtimes ?? []
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
userMessage(params) {
|
|
72
|
+
return `Getting info for node type ${params["node_type"]}`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=local-get-node-info-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-get-node-info-tool.js","sourceRoot":"","sources":["../../src/tools/local-get-node-info-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,SAAS,gBAAgB,CACvB,EAA8C;IAE9C,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;AACtE,CAAC;AAED,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AC,CAAC,IAAI,CAAC;gBAC9B,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,SAAS;gBACvC,QAAQ,EAAE,CAAC,CAAC,QAAQ,IAAI,KAAK;gBAC7B,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,SAAS;gBACvB,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,SAAS;gBACvB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,SAAS;aAC9B,CAAC,CAAC;YACH,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAkC,EAAE,EAAE,CAAC,CAAC;gBACjE,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;aAC/B,CAAC,CAAC;YACH,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,IAAI,KAAK;YACtD,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,IAAI,KAAK;YACpD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,EAAE;YAC/C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,EAAE;SAChD,CAAC;IACJ,CAAC;IAED,WAAW,CAAC,MAA+B;QACzC,OAAO,8BAA8B,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalListNodesTool -- list available node types from the registry.
|
|
3
|
+
*
|
|
4
|
+
* Local version of ListNodesTool (from mcp-tools.ts) that queries
|
|
5
|
+
* the registry directly instead of via REST API.
|
|
6
|
+
*/
|
|
7
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
8
|
+
import type { NodeRegistry } from "@nodetool-ai/node-sdk";
|
|
9
|
+
import { Tool } from "./base-tool.js";
|
|
10
|
+
export declare class LocalListNodesTool extends Tool {
|
|
11
|
+
private readonly registry;
|
|
12
|
+
readonly name = "list_nodes";
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly inputSchema: Record<string, unknown>;
|
|
15
|
+
constructor(registry: NodeRegistry);
|
|
16
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
17
|
+
userMessage(params: Record<string, unknown>): string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=local-list-nodes-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-list-nodes-tool.d.ts","sourceRoot":"","sources":["../../src/tools/local-list-nodes-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAyBtC,qBAAa,kBAAmB,SAAQ,IAAI;IAO9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IANrC,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,SAE2C;IAC/D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAA2B;gBAE3C,QAAQ,EAAE,YAAY;IAI7C,OAAO,CACX,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,OAAO,CAAC;IAkCnB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAIrD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalListNodesTool -- list available node types from the registry.
|
|
3
|
+
*
|
|
4
|
+
* Local version of ListNodesTool (from mcp-tools.ts) that queries
|
|
5
|
+
* the registry directly instead of via REST API.
|
|
6
|
+
*/
|
|
7
|
+
import { Tool } from "./base-tool.js";
|
|
8
|
+
function firstSentence(text) {
|
|
9
|
+
const dot = text.indexOf(".");
|
|
10
|
+
if (dot > 0 && dot < 120)
|
|
11
|
+
return text.slice(0, dot + 1);
|
|
12
|
+
return text.length > 120 ? text.slice(0, 117) + "..." : text;
|
|
13
|
+
}
|
|
14
|
+
const LIST_NODES_INPUT_SCHEMA = {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
namespace: {
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Optional namespace prefix filter (e.g. 'nodetool.text', 'lib.image')"
|
|
20
|
+
},
|
|
21
|
+
limit: {
|
|
22
|
+
type: "number",
|
|
23
|
+
description: "Maximum number of nodes to return (default 50)",
|
|
24
|
+
default: 50
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
required: []
|
|
28
|
+
};
|
|
29
|
+
export class LocalListNodesTool extends Tool {
|
|
30
|
+
registry;
|
|
31
|
+
name = "list_nodes";
|
|
32
|
+
description = "List available node types, optionally filtered by namespace. " +
|
|
33
|
+
"Use this to browse what deterministic nodes are available.";
|
|
34
|
+
inputSchema = LIST_NODES_INPUT_SCHEMA;
|
|
35
|
+
constructor(registry) {
|
|
36
|
+
super();
|
|
37
|
+
this.registry = registry;
|
|
38
|
+
}
|
|
39
|
+
async process(_context, params) {
|
|
40
|
+
const namespace = params["namespace"];
|
|
41
|
+
const limit = typeof params["limit"] === "number" ? params["limit"] : 50;
|
|
42
|
+
let allMetadata = this.registry.listMetadata();
|
|
43
|
+
if (namespace) {
|
|
44
|
+
allMetadata = allMetadata.filter((m) => m.namespace === namespace ||
|
|
45
|
+
m.namespace.startsWith(namespace + ".") ||
|
|
46
|
+
m.node_type.startsWith(namespace + "."));
|
|
47
|
+
}
|
|
48
|
+
// Group by namespace for overview
|
|
49
|
+
const namespaces = new Map();
|
|
50
|
+
for (const m of allMetadata) {
|
|
51
|
+
namespaces.set(m.namespace, (namespaces.get(m.namespace) ?? 0) + 1);
|
|
52
|
+
}
|
|
53
|
+
const limited = allMetadata.slice(0, limit);
|
|
54
|
+
return {
|
|
55
|
+
total: allMetadata.length,
|
|
56
|
+
namespaces: Object.fromEntries(namespaces),
|
|
57
|
+
nodes: limited.map((m) => ({
|
|
58
|
+
type: m.node_type,
|
|
59
|
+
title: m.title,
|
|
60
|
+
description: firstSentence(m.description)
|
|
61
|
+
}))
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
userMessage(params) {
|
|
65
|
+
const ns = params["namespace"];
|
|
66
|
+
return ns ? `Listing nodes in namespace ${ns}` : "Listing available nodes";
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=local-list-nodes-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-list-nodes-tool.js","sourceRoot":"","sources":["../../src/tools/local-list-nodes-tool.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC;AAED,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAiB;YACvB,WAAW,EACT,sEAAsE;SACzE;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAiB;YACvB,WA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OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QAC5C,OAAO;YACL,KAAK,EAAE,WAAW,CAAC,MAAM;YACzB,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC;YAC1C,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAe,EAAE,EAAE,CAAC,CAAC;gBACvC,IAAI,EAAE,CAAC,CAAC,SAAS;gBACjB,KAAK,EAAE,CAAC,CAAC,KAAK;gBACd,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;aAC1C,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;IAED,WAAW,CAAC,MAA+B;QACzC,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC,CAAC,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalSearchNodesTool — namespace-aware search over the NodeRegistry.
|
|
3
|
+
*
|
|
4
|
+
* Hides provider-specific nodes (`openai.*`, `anthropic.*`, etc.) by default
|
|
5
|
+
* so the agent reaches for `nodetool.*` core nodes first. Set
|
|
6
|
+
* `include_provider_nodes: true` only when the user explicitly named a
|
|
7
|
+
* provider.
|
|
8
|
+
*/
|
|
9
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
10
|
+
import type { NodeRegistry } from "@nodetool-ai/node-sdk";
|
|
11
|
+
import { Tool } from "./base-tool.js";
|
|
12
|
+
export declare class LocalSearchNodesTool extends Tool {
|
|
13
|
+
private readonly registry;
|
|
14
|
+
readonly name = "search_nodes";
|
|
15
|
+
readonly description = "Search for available nodes by keyword. Provider-specific nodes are hidden by default \u2014 set include_provider_nodes:true only when the user named a provider. Use namespace to scope to e.g. 'nodetool.control'.";
|
|
16
|
+
readonly inputSchema: Record<string, unknown>;
|
|
17
|
+
constructor(registry: NodeRegistry);
|
|
18
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
19
|
+
userMessage(params: Record<string, unknown>): string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=local-search-nodes-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-search-nodes-tool.d.ts","sourceRoot":"","sources":["../../src/tools/local-search-nodes-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,uBAAuB,CAAC;AAExE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AA8EtC,qBAAa,oBAAqB,SAAQ,IAAI;IAMhC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IALrC,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,yNAC+L;IACnN,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAA6B;gBAE7C,QAAQ,EAAE,YAAY;IAI7C,OAAO,CACX,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,OAAO,CAAC;IA4CnB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAIrD"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LocalSearchNodesTool — namespace-aware search over the NodeRegistry.
|
|
3
|
+
*
|
|
4
|
+
* Hides provider-specific nodes (`openai.*`, `anthropic.*`, etc.) by default
|
|
5
|
+
* so the agent reaches for `nodetool.*` core nodes first. Set
|
|
6
|
+
* `include_provider_nodes: true` only when the user explicitly named a
|
|
7
|
+
* provider.
|
|
8
|
+
*/
|
|
9
|
+
import { rankNodeMetadata } from "@nodetool-ai/node-sdk";
|
|
10
|
+
import { Tool } from "./base-tool.js";
|
|
11
|
+
function typeMetaToString(tm) {
|
|
12
|
+
const args = (tm.type_args ?? []).map(typeMetaToString).filter(Boolean);
|
|
13
|
+
return args.length > 0 ? `${tm.type}[${args.join(", ")}]` : tm.type;
|
|
14
|
+
}
|
|
15
|
+
function firstSentence(text) {
|
|
16
|
+
const dot = text.indexOf(".");
|
|
17
|
+
if (dot > 0 && dot < 120)
|
|
18
|
+
return text.slice(0, dot + 1);
|
|
19
|
+
return text.length > 120 ? text.slice(0, 117) + "..." : text;
|
|
20
|
+
}
|
|
21
|
+
function toCompact(meta, score) {
|
|
22
|
+
return {
|
|
23
|
+
type: meta.node_type,
|
|
24
|
+
title: meta.title,
|
|
25
|
+
description: firstSentence(meta.description),
|
|
26
|
+
score,
|
|
27
|
+
inputs: meta.properties.map((p) => ({
|
|
28
|
+
name: p.name,
|
|
29
|
+
type: typeMetaToString(p.type)
|
|
30
|
+
})),
|
|
31
|
+
outputs: meta.outputs.map((o) => ({
|
|
32
|
+
name: o.name,
|
|
33
|
+
type: typeMetaToString(o.type)
|
|
34
|
+
}))
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const SEARCH_NODES_INPUT_SCHEMA = {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
query: {
|
|
41
|
+
type: "array",
|
|
42
|
+
items: { type: "string" },
|
|
43
|
+
description: "Search terms matched against title, node_type, namespace, and description."
|
|
44
|
+
},
|
|
45
|
+
n_results: {
|
|
46
|
+
type: "number",
|
|
47
|
+
description: "Maximum number of results to return (default 10).",
|
|
48
|
+
default: 10
|
|
49
|
+
},
|
|
50
|
+
namespace: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Optional namespace prefix to scope the search (e.g. 'nodetool.control')."
|
|
53
|
+
},
|
|
54
|
+
input_type: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Optional filter: only nodes that accept this input type."
|
|
57
|
+
},
|
|
58
|
+
output_type: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Optional filter: only nodes that emit this output type."
|
|
61
|
+
},
|
|
62
|
+
include_provider_nodes: {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
description: "Include provider-specific nodes (openai.*, anthropic.*, etc.) in results. Set to true ONLY when the user explicitly named a provider. Default: false.",
|
|
65
|
+
default: false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
required: ["query"]
|
|
69
|
+
};
|
|
70
|
+
export class LocalSearchNodesTool extends Tool {
|
|
71
|
+
registry;
|
|
72
|
+
name = "search_nodes";
|
|
73
|
+
description = "Search for available nodes by keyword. Provider-specific nodes are hidden by default — set include_provider_nodes:true only when the user named a provider. Use namespace to scope to e.g. 'nodetool.control'.";
|
|
74
|
+
inputSchema = SEARCH_NODES_INPUT_SCHEMA;
|
|
75
|
+
constructor(registry) {
|
|
76
|
+
super();
|
|
77
|
+
this.registry = registry;
|
|
78
|
+
}
|
|
79
|
+
async process(_context, params) {
|
|
80
|
+
const queryArr = params["query"] ?? [];
|
|
81
|
+
const maxResults = typeof params["n_results"] === "number" ? params["n_results"] : 10;
|
|
82
|
+
const inputType = params["input_type"];
|
|
83
|
+
const outputType = params["output_type"];
|
|
84
|
+
const namespace = params["namespace"];
|
|
85
|
+
const includeProviderNodes = params["include_provider_nodes"] === true;
|
|
86
|
+
if (queryArr.length === 0) {
|
|
87
|
+
return { status: "error", errors: ["query must be a non-empty array"] };
|
|
88
|
+
}
|
|
89
|
+
const allMetadata = this.registry.listMetadata();
|
|
90
|
+
let ranked = rankNodeMetadata(allMetadata, queryArr, {
|
|
91
|
+
includeProviderNodes,
|
|
92
|
+
namespacePrefix: namespace
|
|
93
|
+
});
|
|
94
|
+
if (inputType) {
|
|
95
|
+
ranked = ranked.filter(({ meta }) => meta.properties.some((p) => typeMetaToString(p.type).toLowerCase() === inputType.toLowerCase()));
|
|
96
|
+
}
|
|
97
|
+
if (outputType) {
|
|
98
|
+
ranked = ranked.filter(({ meta }) => meta.outputs.some((o) => typeMetaToString(o.type).toLowerCase() === outputType.toLowerCase()));
|
|
99
|
+
}
|
|
100
|
+
const limited = ranked.slice(0, maxResults);
|
|
101
|
+
return {
|
|
102
|
+
total: ranked.length,
|
|
103
|
+
results: limited.map(({ meta, score }) => toCompact(meta, score))
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
userMessage(params) {
|
|
107
|
+
const query = params["query"] ?? [];
|
|
108
|
+
return `Searching for nodes: ${query.join(", ")}`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=local-search-nodes-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-search-nodes-tool.js","sourceRoot":"","sources":["../../src/tools/local-search-nodes-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,SAAS,gBAAgB,CACvB,EAA8C;IAE9C,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC;AACtE,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,GAAG;QAAE,OAAO,IAAI,CAAC,KAAK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geometric, trigonometric, and unit conversion calculations.
|
|
3
|
+
*
|
|
4
|
+
* Port of src/nodetool/agents/tools/math_tools.py (excluding CalculatorTool which is in calculator-tool.ts)
|
|
5
|
+
*/
|
|
6
|
+
import type { ProcessingContext } from "@nodetool-ai/runtime";
|
|
7
|
+
import { Tool } from "./base-tool.js";
|
|
8
|
+
export declare class StatisticsTool extends Tool {
|
|
9
|
+
readonly name = "statistics";
|
|
10
|
+
readonly description: string;
|
|
11
|
+
readonly inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
data: {
|
|
15
|
+
type: "array";
|
|
16
|
+
items: {
|
|
17
|
+
type: "number";
|
|
18
|
+
};
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
calculations: {
|
|
22
|
+
type: "array";
|
|
23
|
+
items: {
|
|
24
|
+
type: "string";
|
|
25
|
+
enum: string[];
|
|
26
|
+
};
|
|
27
|
+
description: string;
|
|
28
|
+
default: string[];
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
required: string[];
|
|
32
|
+
};
|
|
33
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
34
|
+
userMessage(params: Record<string, unknown>): string;
|
|
35
|
+
}
|
|
36
|
+
export declare class GeometryTool extends Tool {
|
|
37
|
+
readonly name = "geometry";
|
|
38
|
+
readonly description: string;
|
|
39
|
+
readonly inputSchema: {
|
|
40
|
+
type: "object";
|
|
41
|
+
properties: {
|
|
42
|
+
shape: {
|
|
43
|
+
type: "string";
|
|
44
|
+
enum: string[];
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
dimensions: {
|
|
48
|
+
type: "object";
|
|
49
|
+
description: string;
|
|
50
|
+
properties: {
|
|
51
|
+
radius: {
|
|
52
|
+
type: "number";
|
|
53
|
+
};
|
|
54
|
+
width: {
|
|
55
|
+
type: "number";
|
|
56
|
+
};
|
|
57
|
+
height: {
|
|
58
|
+
type: "number";
|
|
59
|
+
};
|
|
60
|
+
length: {
|
|
61
|
+
type: "number";
|
|
62
|
+
};
|
|
63
|
+
base: {
|
|
64
|
+
type: "number";
|
|
65
|
+
};
|
|
66
|
+
side_a: {
|
|
67
|
+
type: "number";
|
|
68
|
+
};
|
|
69
|
+
side_b: {
|
|
70
|
+
type: "number";
|
|
71
|
+
};
|
|
72
|
+
side_c: {
|
|
73
|
+
type: "number";
|
|
74
|
+
};
|
|
75
|
+
side: {
|
|
76
|
+
type: "number";
|
|
77
|
+
};
|
|
78
|
+
x1: {
|
|
79
|
+
type: "number";
|
|
80
|
+
};
|
|
81
|
+
y1: {
|
|
82
|
+
type: "number";
|
|
83
|
+
};
|
|
84
|
+
z1: {
|
|
85
|
+
type: "number";
|
|
86
|
+
};
|
|
87
|
+
x2: {
|
|
88
|
+
type: "number";
|
|
89
|
+
};
|
|
90
|
+
y2: {
|
|
91
|
+
type: "number";
|
|
92
|
+
};
|
|
93
|
+
z2: {
|
|
94
|
+
type: "number";
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
required: string[];
|
|
100
|
+
};
|
|
101
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
102
|
+
userMessage(params: Record<string, unknown>): string;
|
|
103
|
+
}
|
|
104
|
+
export declare class TrigonometryTool extends Tool {
|
|
105
|
+
readonly name = "trigonometry";
|
|
106
|
+
readonly description: string;
|
|
107
|
+
readonly inputSchema: {
|
|
108
|
+
type: "object";
|
|
109
|
+
properties: {
|
|
110
|
+
function: {
|
|
111
|
+
type: "string";
|
|
112
|
+
enum: string[];
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
value: {
|
|
116
|
+
type: "number";
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
angle_unit: {
|
|
120
|
+
type: "string";
|
|
121
|
+
enum: string[];
|
|
122
|
+
description: string;
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
required: string[];
|
|
127
|
+
};
|
|
128
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
129
|
+
userMessage(params: Record<string, unknown>): string;
|
|
130
|
+
}
|
|
131
|
+
export declare class ConversionTool extends Tool {
|
|
132
|
+
readonly name = "unit_conversion";
|
|
133
|
+
readonly description: string;
|
|
134
|
+
readonly inputSchema: {
|
|
135
|
+
type: "object";
|
|
136
|
+
properties: {
|
|
137
|
+
value: {
|
|
138
|
+
type: "number";
|
|
139
|
+
description: string;
|
|
140
|
+
};
|
|
141
|
+
from_unit: {
|
|
142
|
+
type: "string";
|
|
143
|
+
description: string;
|
|
144
|
+
};
|
|
145
|
+
to_unit: {
|
|
146
|
+
type: "string";
|
|
147
|
+
description: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
required: string[];
|
|
151
|
+
};
|
|
152
|
+
process(_context: ProcessingContext, params: Record<string, unknown>): Promise<unknown>;
|
|
153
|
+
private convertTemperature;
|
|
154
|
+
userMessage(params: Record<string, unknown>): string;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=math-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math-tools.d.ts","sourceRoot":"","sources":["../../src/tools/math-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,qBAAa,cAAe,SAAQ,IAAI;IACtC,QAAQ,CAAC,IAAI,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,SAEuE;IAC3F,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;;MA+BlB;IAEI,OAAO,CACX,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,OAA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