@upstash/context7-tools-ai-sdk 0.2.0 → 0.2.2

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.cjs CHANGED
@@ -151,14 +151,21 @@ function queryDocs(config = {}) {
151
151
  }
152
152
 
153
153
  // src/agents/context7.ts
154
- var Context7Agent = class extends import_ai3.Experimental_Agent {
154
+ var Context7Agent = class extends import_ai3.ToolLoopAgent {
155
155
  constructor(config) {
156
- const { model, stopWhen = (0, import_ai3.stepCountIs)(5), system, apiKey, tools, ...agentSettings } = config;
156
+ const {
157
+ model,
158
+ stopWhen = (0, import_ai3.stepCountIs)(5),
159
+ instructions,
160
+ apiKey,
161
+ tools,
162
+ ...agentSettings
163
+ } = config;
157
164
  const context7Config = { apiKey };
158
165
  super({
159
166
  ...agentSettings,
160
167
  model,
161
- system: system || AGENT_PROMPT,
168
+ instructions: instructions || AGENT_PROMPT,
162
169
  tools: {
163
170
  ...tools,
164
171
  resolveLibraryId: resolveLibraryId(context7Config),
package/dist/agent.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { Experimental_Agent, ToolSet, Experimental_AgentSettings } from 'ai';
1
+ import { ToolLoopAgent, ToolSet, ToolLoopAgentSettings } from 'ai';
2
2
 
3
3
  /**
4
4
  * Configuration for Context7 agent.
5
5
  */
6
- interface Context7AgentConfig extends Experimental_AgentSettings<ToolSet> {
6
+ interface Context7AgentConfig extends ToolLoopAgentSettings<never, ToolSet> {
7
7
  /**
8
8
  * Context7 API key. If not provided, uses the CONTEXT7_API_KEY environment variable.
9
9
  */
@@ -32,7 +32,7 @@ interface Context7AgentConfig extends Experimental_AgentSettings<ToolSet> {
32
32
  * });
33
33
  * ```
34
34
  */
35
- declare class Context7Agent extends Experimental_Agent<ToolSet> {
35
+ declare class Context7Agent extends ToolLoopAgent<never, ToolSet> {
36
36
  constructor(config: Context7AgentConfig);
37
37
  }
38
38
 
package/dist/agent.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { Experimental_Agent, ToolSet, Experimental_AgentSettings } from 'ai';
1
+ import { ToolLoopAgent, ToolSet, ToolLoopAgentSettings } from 'ai';
2
2
 
3
3
  /**
4
4
  * Configuration for Context7 agent.
5
5
  */
6
- interface Context7AgentConfig extends Experimental_AgentSettings<ToolSet> {
6
+ interface Context7AgentConfig extends ToolLoopAgentSettings<never, ToolSet> {
7
7
  /**
8
8
  * Context7 API key. If not provided, uses the CONTEXT7_API_KEY environment variable.
9
9
  */
@@ -32,7 +32,7 @@ interface Context7AgentConfig extends Experimental_AgentSettings<ToolSet> {
32
32
  * });
33
33
  * ```
34
34
  */
35
- declare class Context7Agent extends Experimental_Agent<ToolSet> {
35
+ declare class Context7Agent extends ToolLoopAgent<never, ToolSet> {
36
36
  constructor(config: Context7AgentConfig);
37
37
  }
38
38
 
package/dist/agent.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Context7Agent
3
- } from "./chunk-5OOZPW2Y.js";
3
+ } from "./chunk-E5QL22FX.js";
4
4
  export {
5
5
  Context7Agent
6
6
  };
@@ -1,8 +1,5 @@
1
1
  // src/agents/context7.ts
2
- import {
3
- Experimental_Agent as Agent,
4
- stepCountIs
5
- } from "ai";
2
+ import { ToolLoopAgent, stepCountIs } from "ai";
6
3
 
7
4
  // src/tools/resolve-library-id.ts
8
5
  import { tool } from "ai";
@@ -136,14 +133,21 @@ function queryDocs(config = {}) {
136
133
  }
137
134
 
138
135
  // src/agents/context7.ts
139
- var Context7Agent = class extends Agent {
136
+ var Context7Agent = class extends ToolLoopAgent {
140
137
  constructor(config) {
141
- const { model, stopWhen = stepCountIs(5), system, apiKey, tools, ...agentSettings } = config;
138
+ const {
139
+ model,
140
+ stopWhen = stepCountIs(5),
141
+ instructions,
142
+ apiKey,
143
+ tools,
144
+ ...agentSettings
145
+ } = config;
142
146
  const context7Config = { apiKey };
143
147
  super({
144
148
  ...agentSettings,
145
149
  model,
146
- system: system || AGENT_PROMPT,
150
+ instructions: instructions || AGENT_PROMPT,
147
151
  tools: {
148
152
  ...tools,
149
153
  resolveLibraryId: resolveLibraryId(context7Config),
package/dist/index.cjs CHANGED
@@ -165,14 +165,21 @@ function queryDocs(config = {}) {
165
165
  }
166
166
 
167
167
  // src/agents/context7.ts
168
- var Context7Agent = class extends import_ai3.Experimental_Agent {
168
+ var Context7Agent = class extends import_ai3.ToolLoopAgent {
169
169
  constructor(config) {
170
- const { model, stopWhen = (0, import_ai3.stepCountIs)(5), system, apiKey, tools, ...agentSettings } = config;
170
+ const {
171
+ model,
172
+ stopWhen = (0, import_ai3.stepCountIs)(5),
173
+ instructions,
174
+ apiKey,
175
+ tools,
176
+ ...agentSettings
177
+ } = config;
171
178
  const context7Config = { apiKey };
172
179
  super({
173
180
  ...agentSettings,
174
181
  model,
175
- system: system || AGENT_PROMPT,
182
+ instructions: instructions || AGENT_PROMPT,
176
183
  tools: {
177
184
  ...tools,
178
185
  resolveLibraryId: resolveLibraryId(context7Config),
package/dist/index.d.cts CHANGED
@@ -70,8 +70,8 @@ declare function resolveLibraryId(config?: Context7ToolsConfig): ai.Tool<{
70
70
  * ```
71
71
  */
72
72
  declare function queryDocs(config?: Context7ToolsConfig): ai.Tool<{
73
- query: string;
74
73
  libraryId: string;
74
+ query: string;
75
75
  }, string>;
76
76
 
77
77
  /**
package/dist/index.d.ts CHANGED
@@ -70,8 +70,8 @@ declare function resolveLibraryId(config?: Context7ToolsConfig): ai.Tool<{
70
70
  * ```
71
71
  */
72
72
  declare function queryDocs(config?: Context7ToolsConfig): ai.Tool<{
73
- query: string;
74
73
  libraryId: string;
74
+ query: string;
75
75
  }, string>;
76
76
 
77
77
  /**
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  SYSTEM_PROMPT,
7
7
  queryDocs,
8
8
  resolveLibraryId
9
- } from "./chunk-5OOZPW2Y.js";
9
+ } from "./chunk-E5QL22FX.js";
10
10
  export {
11
11
  AGENT_PROMPT,
12
12
  Context7Agent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upstash/context7-tools-ai-sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Context7 tools for Vercel AI SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -23,13 +23,13 @@
23
23
  ],
24
24
  "peerDependencies": {
25
25
  "@upstash/context7-sdk": ">=0.3.0",
26
- "ai": ">=5.0.0",
27
- "zod": ">=3.24.0"
26
+ "ai": ">=6.0.0",
27
+ "zod": ">=4.0.0"
28
28
  },
29
29
  "devDependencies": {
30
- "ai": "^5.0.0",
31
- "zod": "^3.24.0",
32
- "@ai-sdk/amazon-bedrock": "^3.0.55",
30
+ "ai": "^6.0.5",
31
+ "zod": "^4.3.4",
32
+ "@ai-sdk/amazon-bedrock": "^4.0.9",
33
33
  "@types/node": "^25.0.3",
34
34
  "dotenv": "^17.2.3",
35
35
  "tsup": "^8.5.1",