agentsvc 0.1.1 → 0.1.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/ai-sdk.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { Tool } from 'ai';
2
+ import type { AgentsvcClient, ServicePick } from './index';
3
+ /** AI SDK tools for the picked agentsvc services, keyed by tool name (slug with underscores). */
4
+ export function agentsvcTools(client: AgentsvcClient, pick?: ServicePick): Promise<Record<string, Tool>>;
package/index.mjs CHANGED
@@ -57,7 +57,7 @@ export function createAgentsvc(opts = {}) {
57
57
  /** Call one service. Returns its data; throws AgentsvcError on 402 (no payment), input errors and service errors (none of them are charged). */
58
58
  async function call(slug, input = {}) {
59
59
  const f = await getFetch();
60
- const headers = { 'Content-Type': 'application/json', 'User-Agent': 'agentsvc-js/0.1.1' };
60
+ const headers = { 'Content-Type': 'application/json', 'User-Agent': 'agentsvc-js/0.1.2' };
61
61
  if (credit) headers.Authorization = `Bearer ${credit}`;
62
62
  const paid = credit || opts.privateKey || opts.payFetch;
63
63
  const url = paid ? `${base}/api/v1/proxy/${slug}` : `${base}/api/v1/try/${slug}`;
package/langchain.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { DynamicStructuredTool } from '@langchain/core/tools';
2
+ import type { AgentsvcClient, ServicePick } from './index';
3
+ /** LangChain.js tools for the picked agentsvc services. */
4
+ export function agentsvcLangChainTools(client: AgentsvcClient, pick?: ServicePick): Promise<DynamicStructuredTool[]>;
package/package.json CHANGED
@@ -1,22 +1,57 @@
1
1
  {
2
2
  "name": "agentsvc",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Pay-per-call tools for AI agents: 120+ web, data and crypto APIs paid in USDC via x402, with ready-made tools for the Vercel AI SDK and LangChain.js",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",
7
7
  "exports": {
8
- ".": "./index.mjs",
9
- "./ai-sdk": "./ai-sdk.mjs",
10
- "./langchain": "./langchain.mjs"
8
+ ".": {
9
+ "types": "./index.d.ts",
10
+ "default": "./index.mjs"
11
+ },
12
+ "./ai-sdk": {
13
+ "types": "./ai-sdk.d.ts",
14
+ "default": "./ai-sdk.mjs"
15
+ },
16
+ "./langchain": {
17
+ "types": "./langchain.d.ts",
18
+ "default": "./langchain.mjs"
19
+ }
11
20
  },
12
- "files": ["index.mjs", "ai-sdk.mjs", "langchain.mjs", "index.d.ts", "README.md"],
21
+ "files": [
22
+ "index.mjs",
23
+ "ai-sdk.mjs",
24
+ "langchain.mjs",
25
+ "index.d.ts",
26
+ "ai-sdk.d.ts",
27
+ "langchain.d.ts",
28
+ "README.md",
29
+ "LICENSE"
30
+ ],
13
31
  "types": "./index.d.ts",
14
- "keywords": ["x402", "ai-agents", "mcp", "vercel-ai-sdk", "langchain", "tools", "web-scraping", "crypto", "usdc", "pay-per-call"],
32
+ "keywords": [
33
+ "x402",
34
+ "ai-agents",
35
+ "mcp",
36
+ "vercel-ai-sdk",
37
+ "langchain",
38
+ "tools",
39
+ "web-scraping",
40
+ "crypto",
41
+ "usdc",
42
+ "pay-per-call"
43
+ ],
15
44
  "homepage": "https://agentsvc.io",
16
- "repository": { "type": "git", "url": "git+https://github.com/agentsvc/agentsvc.git", "directory": "packages/js" },
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/agentsvc/agentsvc.git",
48
+ "directory": "packages/js"
49
+ },
17
50
  "bugs": "https://github.com/agentsvc/agentsvc/issues",
18
51
  "license": "MIT",
19
- "engines": { "node": ">=18" },
52
+ "engines": {
53
+ "node": ">=18"
54
+ },
20
55
  "peerDependencies": {
21
56
  "@x402/fetch": ">=2.0.0",
22
57
  "@x402/evm": ">=2.0.0",
@@ -25,10 +60,20 @@
25
60
  "@langchain/core": ">=0.3.0"
26
61
  },
27
62
  "peerDependenciesMeta": {
28
- "@x402/fetch": { "optional": true },
29
- "@x402/evm": { "optional": true },
30
- "viem": { "optional": true },
31
- "ai": { "optional": true },
32
- "@langchain/core": { "optional": true }
63
+ "@x402/fetch": {
64
+ "optional": true
65
+ },
66
+ "@x402/evm": {
67
+ "optional": true
68
+ },
69
+ "viem": {
70
+ "optional": true
71
+ },
72
+ "ai": {
73
+ "optional": true
74
+ },
75
+ "@langchain/core": {
76
+ "optional": true
77
+ }
33
78
  }
34
79
  }