@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 +10 -3
- package/dist/agent.d.cts +3 -3
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1 -1
- package/dist/{chunk-5OOZPW2Y.js → chunk-E5QL22FX.js} +11 -7
- package/dist/index.cjs +10 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
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.
|
|
154
|
+
var Context7Agent = class extends import_ai3.ToolLoopAgent {
|
|
155
155
|
constructor(config) {
|
|
156
|
-
const {
|
|
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
|
-
|
|
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 {
|
|
1
|
+
import { ToolLoopAgent, ToolSet, ToolLoopAgentSettings } from 'ai';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for Context7 agent.
|
|
5
5
|
*/
|
|
6
|
-
interface Context7AgentConfig extends
|
|
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
|
|
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 {
|
|
1
|
+
import { ToolLoopAgent, ToolSet, ToolLoopAgentSettings } from 'ai';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for Context7 agent.
|
|
5
5
|
*/
|
|
6
|
-
interface Context7AgentConfig extends
|
|
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
|
|
35
|
+
declare class Context7Agent extends ToolLoopAgent<never, ToolSet> {
|
|
36
36
|
constructor(config: Context7AgentConfig);
|
|
37
37
|
}
|
|
38
38
|
|
package/dist/agent.js
CHANGED
|
@@ -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
|
|
136
|
+
var Context7Agent = class extends ToolLoopAgent {
|
|
140
137
|
constructor(config) {
|
|
141
|
-
const {
|
|
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
|
-
|
|
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.
|
|
168
|
+
var Context7Agent = class extends import_ai3.ToolLoopAgent {
|
|
169
169
|
constructor(config) {
|
|
170
|
-
const {
|
|
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
|
-
|
|
182
|
+
instructions: instructions || AGENT_PROMPT,
|
|
176
183
|
tools: {
|
|
177
184
|
...tools,
|
|
178
185
|
resolveLibraryId: resolveLibraryId(context7Config),
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upstash/context7-tools-ai-sdk",
|
|
3
|
-
"version": "0.2.
|
|
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": ">=
|
|
27
|
-
"zod": ">=
|
|
26
|
+
"ai": ">=6.0.0",
|
|
27
|
+
"zod": ">=4.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"ai": "^
|
|
31
|
-
"zod": "^3.
|
|
32
|
-
"@ai-sdk/amazon-bedrock": "^
|
|
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",
|