@protogrid/ai-sdk 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -7,25 +7,25 @@ npm install @protogrid/ai-sdk ai
7
7
  ```
8
8
 
9
9
  ```ts
10
- import { generateText, stepCountIs } from "ai";
10
+ import { generateText, isStepCount } from "ai";
11
11
  import { loadTools } from "@protogrid/ai-sdk";
12
12
 
13
13
  await using mail = await loadTools({
14
14
  query: "send an email",
15
- rules: { min_quality: 70 }, // also refuses hidden text, tool poisoning and known vulnerabilities
15
+ rules: { min_quality: 70 }, // also refuses hidden text, tool poisoning, known vulnerabilities and paid servers
16
16
  secrets: { MAIL_API_KEY: process.env.MAIL_API_KEY },
17
17
  });
18
18
  const { text } = await generateText({
19
19
  model,
20
20
  tools: mail.tools,
21
21
  prompt: "Mail the report to ops",
22
- stopWhen: stepCountIs(5),
22
+ stopWhen: isStepCount(5),
23
23
  });
24
24
  ```
25
25
 
26
26
  - `loadTools` tries the best search results (or the `servers` you name) in order. Each goes through protogrid's gate with your rules; one that passes is connected to directly, with no proxy, and its tools come back named `<server key>_<tool>`. `origins` says which server each tool comes from; `close()` (or `await using`) closes the connections.
27
27
  - Secrets fill the `${NAME}` placeholders of the server's connection in your process; they are never sent to protogrid. A server needing a secret you did not give is passed over.
28
- - Rules are yours, not the model's. A rule you leave out keeps its default, which refuses tools that hide text from people, tools holding instructions aimed at the model, and servers with a known vulnerability in their dependencies. `paid: false` also refuses servers that charge per call (x402). Local packages are never loaded.
28
+ - Rules are yours, not the model's. A rule you leave out keeps its default, which refuses tools that hide text from people, tools holding instructions aimed at the model, and servers with a known vulnerability in their dependencies, and servers that charge per call (x402), which an agent without a wallet cannot use (`paid: null` accepts them). Local packages are never loaded.
29
29
  - `pins: { "io.github.owner/server": "<tools_hash>" }` passes over a server whose checked tools changed since you reviewed them; `strictTools: true` also compares the tools the server lists right now with the ones protogrid checked.
30
30
  - `searchTool()` and `gateTool({ rules })` let the agent look for servers and check one itself.
31
31
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { createClient, LoadReport, loadRules, loadServers, prefixedToolName, ProtogridError, } from "@protogrid/sdk";
2
2
  import { dynamicTool, jsonSchema, tool } from "ai";
3
3
  export { LoadReport, NoServerLoaded } from "@protogrid/sdk";
4
- const CLIENT = { name: "protogrid-ai-sdk", version: "0.1.0" };
4
+ const CLIENT = { name: "protogrid-ai-sdk", version: "0.1.1" };
5
5
  /**
6
6
  * The tools of up to `maxServers` MCP servers that pass `rules`. Give a `query` (the best `candidates` search results
7
7
  * are tried in order) or `servers` by registry name. Each server goes through protogrid's gate with your rules; one
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protogrid/ai-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Vercel AI SDK tools from the protogrid MCP registry: find MCP servers by what they do, check them against your rules, and give your agent the tools of the ones that pass.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@modelcontextprotocol/client": "^2.2.0",
29
- "@protogrid/sdk": "^0.6.0"
29
+ "@protogrid/sdk": "^0.6.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "ai": "^7.0.0"