@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 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 22 or newer.
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}