@n8n/agents 0.10.0 → 0.11.0
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/build.tsbuildinfo +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +27 -5
- package/dist/index.js.map +1 -1
- package/dist/runtime/agent-runtime.d.ts +14 -6
- package/dist/runtime/agent-runtime.js +320 -243
- package/dist/runtime/agent-runtime.js.map +1 -1
- package/dist/runtime/delegate-sub-agent-tool.d.ts +87 -0
- package/dist/runtime/delegate-sub-agent-tool.js +362 -0
- package/dist/runtime/delegate-sub-agent-tool.js.map +1 -0
- package/dist/runtime/event-bus.d.ts +8 -0
- package/dist/runtime/event-bus.js +48 -0
- package/dist/runtime/event-bus.js.map +1 -1
- package/dist/runtime/mcp-connection.d.ts +1 -2
- package/dist/runtime/mcp-connection.js +1 -4
- package/dist/runtime/mcp-connection.js.map +1 -1
- package/dist/runtime/message-list.d.ts +9 -3
- package/dist/runtime/message-list.js +16 -5
- package/dist/runtime/message-list.js.map +1 -1
- package/dist/runtime/messages.js +10 -2
- package/dist/runtime/messages.js.map +1 -1
- package/dist/runtime/model-factory.js +12 -0
- package/dist/runtime/model-factory.js.map +1 -1
- package/dist/runtime/provider-credentials.d.ts +13 -0
- package/dist/runtime/provider-credentials.js +1 -0
- package/dist/runtime/provider-credentials.js.map +1 -1
- package/dist/runtime/runtime-helpers.d.ts +1 -2
- package/dist/runtime/runtime-helpers.js +0 -8
- package/dist/runtime/runtime-helpers.js.map +1 -1
- package/dist/runtime/sdk-owned-tool.d.ts +4 -0
- package/dist/runtime/sdk-owned-tool.js +19 -0
- package/dist/runtime/sdk-owned-tool.js.map +1 -0
- package/dist/runtime/stream.js +8 -0
- package/dist/runtime/stream.js.map +1 -1
- package/dist/runtime/sub-agent-task-path.d.ts +10 -0
- package/dist/runtime/sub-agent-task-path.js +39 -0
- package/dist/runtime/sub-agent-task-path.js.map +1 -0
- package/dist/runtime/title-generation.js +3 -5
- package/dist/runtime/title-generation.js.map +1 -1
- package/dist/runtime/tool-adapter.d.ts +0 -9
- package/dist/runtime/tool-adapter.js +12 -21
- package/dist/runtime/tool-adapter.js.map +1 -1
- package/dist/runtime/write-todos-tool.d.ts +3 -0
- package/dist/runtime/write-todos-tool.js +95 -0
- package/dist/runtime/write-todos-tool.js.map +1 -0
- package/dist/sdk/agent.d.ts +19 -12
- package/dist/sdk/agent.js +318 -91
- package/dist/sdk/agent.js.map +1 -1
- package/dist/sdk/cancellation.d.ts +7 -0
- package/dist/sdk/cancellation.js +16 -0
- package/dist/sdk/cancellation.js.map +1 -0
- package/dist/sdk/catalog.js +20 -4
- package/dist/sdk/catalog.js.map +1 -1
- package/dist/sdk/mcp-client.d.ts +1 -1
- package/dist/sdk/mcp-client.js +2 -2
- package/dist/sdk/mcp-client.js.map +1 -1
- package/dist/sdk/memory.d.ts +1 -3
- package/dist/sdk/memory.js +0 -14
- package/dist/sdk/memory.js.map +1 -1
- package/dist/sdk/provider-capabilities.js +1 -0
- package/dist/sdk/provider-capabilities.js.map +1 -1
- package/dist/sdk/tool.d.ts +3 -0
- package/dist/sdk/tool.js +42 -10
- package/dist/sdk/tool.js.map +1 -1
- package/dist/storage/base-memory.d.ts +0 -31
- package/dist/storage/base-memory.js +0 -9
- package/dist/storage/base-memory.js.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/runtime/event.d.ts +31 -1
- package/dist/types/runtime/event.js +2 -0
- package/dist/types/runtime/event.js.map +1 -1
- package/dist/types/sdk/agent-builder.d.ts +0 -1
- package/dist/types/sdk/agent.d.ts +20 -15
- package/dist/types/sdk/memory.d.ts +0 -42
- package/dist/types/sdk/message.d.ts +1 -0
- package/dist/types/sdk/tool.d.ts +19 -1
- package/dist/utils/json-schema.d.ts +3 -0
- package/dist/utils/json-schema.js +72 -0
- package/dist/utils/json-schema.js.map +1 -0
- package/dist/workspace/filesystem/daytona-filesystem.d.ts +25 -0
- package/dist/workspace/filesystem/daytona-filesystem.js +130 -0
- package/dist/workspace/filesystem/daytona-filesystem.js.map +1 -0
- package/dist/workspace/filesystem/n8n-sandbox-filesystem.d.ts +25 -0
- package/dist/workspace/filesystem/n8n-sandbox-filesystem.js +126 -0
- package/dist/workspace/filesystem/n8n-sandbox-filesystem.js.map +1 -0
- package/dist/workspace/sandbox/base-sandbox.d.ts +1 -0
- package/dist/workspace/sandbox/base-sandbox.js +5 -0
- package/dist/workspace/sandbox/base-sandbox.js.map +1 -1
- package/dist/workspace/sandbox/create-workspace.d.ts +4 -0
- package/dist/workspace/sandbox/create-workspace.js +58 -0
- package/dist/workspace/sandbox/create-workspace.js.map +1 -0
- package/dist/workspace/sandbox/daytona-auth-manager.d.ts +26 -0
- package/dist/workspace/sandbox/daytona-auth-manager.js +84 -0
- package/dist/workspace/sandbox/daytona-auth-manager.js.map +1 -0
- package/dist/workspace/sandbox/daytona-sandbox.d.ts +72 -0
- package/dist/workspace/sandbox/daytona-sandbox.js +357 -0
- package/dist/workspace/sandbox/daytona-sandbox.js.map +1 -0
- package/dist/workspace/sandbox/index.d.ts +7 -0
- package/dist/workspace/sandbox/index.js +22 -0
- package/dist/workspace/sandbox/index.js.map +1 -0
- package/dist/workspace/sandbox/lazy-daytona.d.ts +2 -0
- package/dist/workspace/sandbox/lazy-daytona.js +12 -0
- package/dist/workspace/sandbox/lazy-daytona.js.map +1 -0
- package/dist/workspace/sandbox/logger.d.ts +12 -0
- package/dist/workspace/sandbox/logger.js +3 -0
- package/dist/workspace/sandbox/logger.js.map +1 -0
- package/dist/workspace/sandbox/n8n-sandbox-sandbox.d.ts +35 -0
- package/dist/workspace/sandbox/n8n-sandbox-sandbox.js +138 -0
- package/dist/workspace/sandbox/n8n-sandbox-sandbox.js.map +1 -0
- package/dist/workspace/sandbox/provider.d.ts +4 -0
- package/dist/workspace/sandbox/provider.js +14 -0
- package/dist/workspace/sandbox/provider.js.map +1 -0
- package/dist/workspace/sandbox/run-in-sandbox.d.ts +26 -0
- package/dist/workspace/sandbox/run-in-sandbox.js +19 -0
- package/dist/workspace/sandbox/run-in-sandbox.js.map +1 -0
- package/dist/workspace/sandbox/types.d.ts +41 -0
- package/dist/workspace/sandbox/types.js +3 -0
- package/dist/workspace/sandbox/types.js.map +1 -0
- package/dist/workspace/sandbox/workspace-root.d.ts +16 -0
- package/dist/workspace/sandbox/workspace-root.js +69 -0
- package/dist/workspace/sandbox/workspace-root.js.map +1 -0
- package/dist/workspace/tools/batch-str-replace-file.js +2 -2
- package/dist/workspace/tools/batch-str-replace-file.js.map +1 -1
- package/dist/workspace/tools/str-replace-file.js +2 -2
- package/dist/workspace/tools/str-replace-file.js.map +1 -1
- package/package.json +29 -17
- package/dist/sdk/network.d.ts +0 -20
- package/dist/sdk/network.js +0 -46
- package/dist/sdk/network.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/agents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "AI agent SDK for n8n's code-first execution engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
],
|
|
13
13
|
"catalog": [
|
|
14
14
|
"dist/sdk/catalog.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"sandbox": [
|
|
17
|
+
"dist/workspace/sandbox/index.d.ts"
|
|
15
18
|
]
|
|
16
19
|
}
|
|
17
20
|
},
|
|
@@ -28,6 +31,10 @@
|
|
|
28
31
|
"./catalog": {
|
|
29
32
|
"types": "./dist/sdk/catalog.d.ts",
|
|
30
33
|
"default": "./dist/sdk/catalog.js"
|
|
34
|
+
},
|
|
35
|
+
"./sandbox": {
|
|
36
|
+
"types": "./dist/workspace/sandbox/index.d.ts",
|
|
37
|
+
"default": "./dist/workspace/sandbox/index.js"
|
|
31
38
|
}
|
|
32
39
|
},
|
|
33
40
|
"files": [
|
|
@@ -36,25 +43,29 @@
|
|
|
36
43
|
"LICENSE_EE.md"
|
|
37
44
|
],
|
|
38
45
|
"dependencies": {
|
|
39
|
-
"@ai-sdk/amazon-bedrock": "^4.0.
|
|
40
|
-
"@ai-sdk/anthropic": "3.0.
|
|
41
|
-
"@ai-sdk/azure": "^3.0.
|
|
42
|
-
"@ai-sdk/cohere": "^3.0.
|
|
43
|
-
"@ai-sdk/deepseek": "^2.0.
|
|
44
|
-
"@ai-sdk/gateway": "^3.0.
|
|
45
|
-
"@ai-sdk/google": "^3.0.
|
|
46
|
-
"@ai-sdk/groq": "^3.0.
|
|
47
|
-
"@ai-sdk/mistral": "^3.0.
|
|
48
|
-
"@ai-sdk/openai": "^3.0.
|
|
49
|
-
"@ai-sdk/
|
|
50
|
-
"@ai-sdk/
|
|
46
|
+
"@ai-sdk/amazon-bedrock": "^4.0.113",
|
|
47
|
+
"@ai-sdk/anthropic": "^3.0.81",
|
|
48
|
+
"@ai-sdk/azure": "^3.0.70",
|
|
49
|
+
"@ai-sdk/cohere": "^3.0.36",
|
|
50
|
+
"@ai-sdk/deepseek": "^2.0.35",
|
|
51
|
+
"@ai-sdk/gateway": "^3.0.125",
|
|
52
|
+
"@ai-sdk/google": "^3.0.80",
|
|
53
|
+
"@ai-sdk/groq": "^3.0.39",
|
|
54
|
+
"@ai-sdk/mistral": "^3.0.37",
|
|
55
|
+
"@ai-sdk/openai": "^3.0.68",
|
|
56
|
+
"@ai-sdk/openai-compatible": "^2.0.48",
|
|
57
|
+
"@ai-sdk/provider-utils": "^4.0.27",
|
|
58
|
+
"@ai-sdk/xai": "^3.0.93",
|
|
59
|
+
"@daytonaio/sdk": "0.175.0",
|
|
51
60
|
"@modelcontextprotocol/sdk": "1.26.0",
|
|
61
|
+
"@n8n/sandbox-client": "0.0.4",
|
|
52
62
|
"@openrouter/ai-sdk-provider": "^2.8.0",
|
|
53
|
-
"ai": "^6.0.
|
|
63
|
+
"ai": "^6.0.197",
|
|
54
64
|
"ajv": "^8.18.0",
|
|
55
65
|
"yaml": "2.8.3",
|
|
56
66
|
"zod": "3.25.67",
|
|
57
|
-
"@n8n/
|
|
67
|
+
"@n8n/utils": "1.34.0",
|
|
68
|
+
"@n8n/ai-utilities": "0.19.0"
|
|
58
69
|
},
|
|
59
70
|
"peerDependencies": {
|
|
60
71
|
"@opentelemetry/exporter-trace-otlp-http": ">=0.50.0",
|
|
@@ -81,8 +92,8 @@
|
|
|
81
92
|
"@vitest/coverage-v8": "4.1.1",
|
|
82
93
|
"vitest": "^4.1.1",
|
|
83
94
|
"vitest-mock-extended": "^3.1.0",
|
|
84
|
-
"@n8n/
|
|
85
|
-
"@n8n/
|
|
95
|
+
"@n8n/typescript-config": "1.5.0",
|
|
96
|
+
"@n8n/vitest-config": "1.14.0"
|
|
86
97
|
},
|
|
87
98
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
88
99
|
"homepage": "https://n8n.io",
|
|
@@ -99,6 +110,7 @@
|
|
|
99
110
|
"dev": "pnpm watch",
|
|
100
111
|
"typecheck": "tsc --noEmit",
|
|
101
112
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
113
|
+
"build:unchecked": "rimraf dist && tsc -p tsconfig.build.json --noCheck",
|
|
102
114
|
"format": "biome format --write src examples",
|
|
103
115
|
"format:check": "biome ci src examples",
|
|
104
116
|
"lint": "eslint . --quiet",
|
package/dist/sdk/network.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Agent } from './agent';
|
|
2
|
-
import type { GenerateResult, RunOptions } from '../types';
|
|
3
|
-
interface BuiltNetwork {
|
|
4
|
-
readonly name: string;
|
|
5
|
-
run(prompt: string, options?: RunOptions): Promise<GenerateResult>;
|
|
6
|
-
}
|
|
7
|
-
export declare class Network {
|
|
8
|
-
private networkName;
|
|
9
|
-
private coordinatorAgent?;
|
|
10
|
-
private agents;
|
|
11
|
-
private built?;
|
|
12
|
-
constructor(name: string);
|
|
13
|
-
coordinator(a: Agent): this;
|
|
14
|
-
agent(a: Agent): this;
|
|
15
|
-
private ensureBuilt;
|
|
16
|
-
get name(): string;
|
|
17
|
-
run(prompt: string, options?: RunOptions): Promise<GenerateResult>;
|
|
18
|
-
protected build(): BuiltNetwork;
|
|
19
|
-
}
|
|
20
|
-
export {};
|
package/dist/sdk/network.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Network = void 0;
|
|
4
|
-
class Network {
|
|
5
|
-
constructor(name) {
|
|
6
|
-
this.agents = [];
|
|
7
|
-
this.networkName = name;
|
|
8
|
-
}
|
|
9
|
-
coordinator(a) {
|
|
10
|
-
this.coordinatorAgent = a;
|
|
11
|
-
return this;
|
|
12
|
-
}
|
|
13
|
-
agent(a) {
|
|
14
|
-
this.agents.push(a);
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
ensureBuilt() {
|
|
18
|
-
this.built ??= this.build();
|
|
19
|
-
return this.built;
|
|
20
|
-
}
|
|
21
|
-
get name() {
|
|
22
|
-
return this.networkName;
|
|
23
|
-
}
|
|
24
|
-
async run(prompt, options) {
|
|
25
|
-
return await this.ensureBuilt().run(prompt, options);
|
|
26
|
-
}
|
|
27
|
-
build() {
|
|
28
|
-
if (!this.coordinatorAgent) {
|
|
29
|
-
throw new Error(`Network "${this.networkName}" requires a coordinator`);
|
|
30
|
-
}
|
|
31
|
-
if (this.agents.length === 0) {
|
|
32
|
-
throw new Error(`Network "${this.networkName}" requires at least one agent`);
|
|
33
|
-
}
|
|
34
|
-
const coordinator = this.coordinatorAgent;
|
|
35
|
-
const name = this.networkName;
|
|
36
|
-
return {
|
|
37
|
-
name,
|
|
38
|
-
async run(prompt, options) {
|
|
39
|
-
const messages = [{ role: 'user', content: [{ type: 'text', text: prompt }] }];
|
|
40
|
-
return await coordinator.generate(messages, options);
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.Network = Network;
|
|
46
|
-
//# sourceMappingURL=network.js.map
|
package/dist/sdk/network.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/sdk/network.ts"],"names":[],"mappings":";;;AAsBA,MAAa,OAAO;IASnB,YAAY,IAAY;QAJhB,WAAM,GAAY,EAAE,CAAC;QAK5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IAGD,WAAW,CAAC,CAAQ;QACnB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACb,CAAC;IAGD,KAAK,CAAC,CAAQ;QACb,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,IAAI,CAAC;IACb,CAAC;IAGO,WAAW;QAClB,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAGD,IAAI,IAAI;QACP,OAAO,IAAI,CAAC,WAAW,CAAC;IACzB,CAAC;IAGD,KAAK,CAAC,GAAG,CAAC,MAAc,EAAE,OAAoB;QAC7C,OAAO,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAGS,KAAK;QACd,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,WAAW,0BAA0B,CAAC,CAAC;QACzE,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,WAAW,+BAA+B,CAAC,CAAC;QAC9E,CAAC;QAOD,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC;QAE9B,OAAO;YACN,IAAI;YAEJ,KAAK,CAAC,GAAG,CAAC,MAAc,EAAE,OAAoB;gBAC7C,MAAM,QAAQ,GAAc,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC1F,OAAO,MAAM,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACtD,CAAC;SACD,CAAC;IACH,CAAC;CACD;AAnED,0BAmEC"}
|