@sdk-it/rpc 0.46.11 → 0.47.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.
- package/README.md +21 -1
- package/dist/index.d.ts +0 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +199 -899
- package/dist/index.js.map +4 -4
- package/dist/lib/rpc.d.ts +8 -10
- package/dist/lib/rpc.d.ts.map +1 -1
- package/dist/lib/zod.d.ts +5 -5
- package/dist/lib/zod.d.ts.map +1 -1
- package/package.json +20 -11
- package/dist/lib/http/dispatcher.d.ts +0 -33
- package/dist/lib/http/dispatcher.d.ts.map +0 -1
- package/dist/lib/http/interceptors.d.ts +0 -8
- package/dist/lib/http/interceptors.d.ts.map +0 -1
- package/dist/lib/http/parse-response.d.ts +0 -4
- package/dist/lib/http/parse-response.d.ts.map +0 -1
- package/dist/lib/http/parser.d.ts +0 -7
- package/dist/lib/http/parser.d.ts.map +0 -1
- package/dist/lib/http/request.d.ts +0 -55
- package/dist/lib/http/request.d.ts.map +0 -1
- package/dist/lib/http/response.d.ts +0 -176
- package/dist/lib/http/response.d.ts.map +0 -1
- package/dist/lib/http/sse.d.ts +0 -3
- package/dist/lib/http/sse.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Create a runtime HTTP client or AI SDK tools directly from an OpenAPI
|
|
4
4
|
document, without generating source files.
|
|
5
5
|
|
|
6
|
-
Requires Node.js
|
|
6
|
+
Requires Node.js 24 or newer.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -33,6 +33,13 @@ Inputs are validated before dispatch. Non-success HTTP responses throw an
|
|
|
33
33
|
`APIError` subclass; successful calls return an `APIResponse` with `status`,
|
|
34
34
|
`headers`, and `data`.
|
|
35
35
|
|
|
36
|
+
These classes come from [`@sdk-it/runtime`](../runtime/README.md). Import them
|
|
37
|
+
from that package:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
import { APIError, NotFound } from '@sdk-it/runtime';
|
|
41
|
+
```
|
|
42
|
+
|
|
36
43
|
Use `createRpc(ir, options)` instead when you already have a processed
|
|
37
44
|
[`IR`](../spec/README.md).
|
|
38
45
|
|
|
@@ -51,5 +58,18 @@ const agents = await toAgents('./openapi.yaml', {
|
|
|
51
58
|
const userTools = agents.users.tools;
|
|
52
59
|
```
|
|
53
60
|
|
|
61
|
+
Each agent is AI SDK `ToolLoopAgent` settings (`{ id, instructions?, tools }`),
|
|
62
|
+
so you can give it to the agent class as is:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { ToolLoopAgent } from 'ai';
|
|
66
|
+
|
|
67
|
+
const users = new ToolLoopAgent({ model: 'openai/gpt-5', ...agents.users });
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The `id` is the tag's `x-name`, else its `summary`, else its `name`. The
|
|
71
|
+
`instructions` are the tag's `x-instructions`, else its `description`. An agent
|
|
72
|
+
whose tag has neither has no `instructions`.
|
|
73
|
+
|
|
54
74
|
With `useTools: 'defined'`, only operations carrying SDK-IT's `x-tool`
|
|
55
75
|
metadata are exposed.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
export * from './lib/http/dispatcher.js';
|
|
2
|
-
export * from './lib/http/interceptors.js';
|
|
3
|
-
export * from './lib/http/parser.js';
|
|
4
|
-
export * from './lib/http/request.js';
|
|
5
|
-
export * from './lib/http/response.js';
|
|
6
1
|
export * from './lib/rpc.js';
|
|
7
2
|
export * from './lib/zod.js';
|
|
8
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|