@tracon/client 1.0.0-preview.1 → 1.0.0-preview.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/README.md +30 -10
- package/package.json +15 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ workflows, tenants, and the rest of the control plane. Built on
|
|
|
8
8
|
dependency.
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
npm install @tracon/client
|
|
11
|
+
npm install @tracon/client@next
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## Setup
|
|
@@ -60,17 +60,37 @@ try {
|
|
|
60
60
|
`title` and `detail` come from the server's `application/problem+json` body
|
|
61
61
|
and are shown verbatim — this package does not translate them.
|
|
62
62
|
|
|
63
|
+
## Streaming responses
|
|
64
|
+
|
|
65
|
+
Seven operations answer `text/event-stream`: agent `run`, the run event stream,
|
|
66
|
+
workflow `run`/`resume`/`respond`, and the OpenAI-compatible `responses` and
|
|
67
|
+
`chat/completions` endpoints. Request a raw stream, then use the decoder shipped
|
|
68
|
+
by this package:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { readSse } from '@tracon/client';
|
|
72
|
+
|
|
73
|
+
const { response } = await client.POST('/api/agents/{name}/run', {
|
|
74
|
+
params: { path: { name: 'support' } },
|
|
75
|
+
body: { message: 'Where is order 4182?' },
|
|
76
|
+
parseAs: 'stream',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
for await (const frame of readSse(response)) {
|
|
80
|
+
console.log(frame.event, frame.data);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`readSse` handles split network chunks and keep-alive comments. `SseDecoder` is
|
|
85
|
+
also exported for transports that do not expose a `fetch` `Response`. Do not use
|
|
86
|
+
`EventSource`: it cannot send the required `Authorization` header or issue a
|
|
87
|
+
`POST`.
|
|
88
|
+
|
|
63
89
|
## What this package does not cover
|
|
64
90
|
|
|
65
|
-
- **
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
`fetch`-based typed client reads a response body as JSON; call these with
|
|
69
|
-
your own `EventSource`/`fetch` streaming code instead, using this
|
|
70
|
-
package's `paths` types for the request shape.
|
|
71
|
-
- **Token storage.** This package reads a token you supply — it does not
|
|
72
|
-
read or write `localStorage`, a cookie, or anything else. Store it however
|
|
73
|
-
your application already does.
|
|
91
|
+
- **Token storage.** This package reads a token you supply — it does not read or
|
|
92
|
+
write `localStorage`, a cookie, or anything else. Store it however your
|
|
93
|
+
application already does.
|
|
74
94
|
|
|
75
95
|
## Why the base URL needs the prefix
|
|
76
96
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracon/client",
|
|
3
|
-
"version": "1.0.0-preview.
|
|
3
|
+
"version": "1.0.0-preview.2",
|
|
4
4
|
"description": "Typed TypeScript client for the Tracon management API, generated from its OpenAPI document.",
|
|
5
5
|
"license": "PolyForm-Small-Business-1.0.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"homepage": "https://tracon.dev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/farukatasoy/Tracon.git",
|
|
11
|
+
"directory": "packages/tracon-client"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/farukatasoy/Tracon/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai-agents",
|
|
18
|
+
"microsoft-agent-framework",
|
|
19
|
+
"openapi",
|
|
20
|
+
"tracon"
|
|
21
|
+
],
|
|
8
22
|
"main": "./dist/index.js",
|
|
9
23
|
"types": "./dist/index.d.ts",
|
|
10
24
|
"exports": {
|