@n8n/agents 0.9.1 → 0.10.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.
@@ -3,14 +3,25 @@ import type { ZodType } from 'zod';
3
3
  import type { AgentMessage } from './message';
4
4
  import type { BuiltTelemetry } from '../telemetry';
5
5
  import type { JSONObject } from '../utils/json';
6
+ export interface ToolExecutionContext {
7
+ runId?: string;
8
+ persistence?: {
9
+ threadId: string;
10
+ resourceId: string;
11
+ };
12
+ }
6
13
  export interface ToolContext {
7
14
  toolCallId?: string;
15
+ runId?: string;
16
+ persistence?: ToolExecutionContext['persistence'];
8
17
  parentTelemetry?: BuiltTelemetry;
9
18
  }
10
19
  export interface InterruptibleToolContext<S = unknown, R = unknown> {
11
20
  suspend: (payload: S) => Promise<never>;
12
21
  resumeData: R | undefined;
13
22
  toolCallId?: string;
23
+ runId?: string;
24
+ persistence?: ToolExecutionContext['persistence'];
14
25
  parentTelemetry?: BuiltTelemetry;
15
26
  }
16
27
  export interface BuiltTool {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/agents",
3
- "version": "0.9.1",
3
+ "version": "0.10.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",
@@ -20,6 +20,7 @@
20
20
  "types": "./dist/index.d.ts",
21
21
  "default": "./dist/index.js"
22
22
  },
23
+ "./package.json": "./package.json",
23
24
  "./tool": {
24
25
  "types": "./dist/sdk/tool.d.ts",
25
26
  "default": "./dist/sdk/tool.js"
@@ -53,7 +54,7 @@
53
54
  "ajv": "^8.18.0",
54
55
  "yaml": "2.8.3",
55
56
  "zod": "3.25.67",
56
- "@n8n/ai-utilities": "0.17.0"
57
+ "@n8n/ai-utilities": "0.18.0"
57
58
  },
58
59
  "peerDependencies": {
59
60
  "@opentelemetry/exporter-trace-otlp-http": ">=0.50.0",
@@ -77,6 +78,10 @@
77
78
  },
78
79
  "devDependencies": {
79
80
  "@types/json-schema": "^7.0.15",
81
+ "@vitest/coverage-v8": "4.1.1",
82
+ "vitest": "^4.1.1",
83
+ "vitest-mock-extended": "^3.1.0",
84
+ "@n8n/vitest-config": "1.13.0",
80
85
  "@n8n/typescript-config": "1.4.0"
81
86
  },
82
87
  "license": "SEE LICENSE IN LICENSE.md",
@@ -99,9 +104,9 @@
99
104
  "lint": "eslint . --quiet",
100
105
  "lint:fix": "eslint . --fix",
101
106
  "watch": "tsc -p tsconfig.build.json --watch",
102
- "test": "jest",
103
- "test:unit": "jest",
104
- "test:dev": "jest --watch",
107
+ "test": "vitest run",
108
+ "test:unit": "vitest run",
109
+ "test:dev": "vitest --silent=false",
105
110
  "test:integration": "vitest run --config vitest.integration.config.mjs"
106
111
  }
107
112
  }