@tracon/client 1.0.0-preview.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/LICENSE.md +164 -0
- package/README.md +105 -0
- package/dist/client.d.ts +26 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +51 -0
- package/dist/client.js.map +1 -0
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +20 -0
- package/dist/error.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/schema.d.ts +12840 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +6 -0
- package/dist/schema.js.map +1 -0
- package/dist/sse.d.ts +75 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +166 -0
- package/dist/sse.js.map +1 -0
- package/package.json +42 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Tracon License
|
|
2
|
+
|
|
3
|
+
Tracon is licensed under the **PolyForm Small Business License 1.0.0**. The
|
|
4
|
+
canonical text follows below and is reproduced without modification.
|
|
5
|
+
|
|
6
|
+
Required Notice: Copyright (c) 2026 Faruk Atasoy (https://tracon.dev)
|
|
7
|
+
|
|
8
|
+
## Are you free to use it?
|
|
9
|
+
|
|
10
|
+
Yes, at no cost, if your company has fewer than 100 total individuals working as
|
|
11
|
+
employees and independent contractors, and less than 1,000,000 USD (2019, adjusted
|
|
12
|
+
for inflation) total revenue in the prior tax year. An individual, a student and an
|
|
13
|
+
open source project are all under that threshold. The exact wording is in the
|
|
14
|
+
**Small Business** section below, which is the clause that governs.
|
|
15
|
+
|
|
16
|
+
Above that threshold, use of Tracon needs a commercial licence. Write to
|
|
17
|
+
hfarukatasoy@gmail.com.
|
|
18
|
+
|
|
19
|
+
## Three packages are MIT instead
|
|
20
|
+
|
|
21
|
+
| Package | Why it is MIT |
|
|
22
|
+
|---------|---------------|
|
|
23
|
+
| `Tracon.Abstractions` | Contracts only. A third party writes an extension against these interfaces; nothing here runs an agent. |
|
|
24
|
+
| `Tracon.Testing.Contracts.Xunit` | The behaviour contract suites that an extension has to pass. It depends only on `Tracon.Abstractions`. |
|
|
25
|
+
| `Tracon.Templates` | `dotnet new tracon-api` generates source into your project. The code it generates is yours, under no obligation to these terms. |
|
|
26
|
+
|
|
27
|
+
Those three ship `LICENSE-MIT.md`. Every other package ships this file. A package
|
|
28
|
+
states its own licence in its `.nuspec`; if the two ever disagree, the file inside
|
|
29
|
+
the package governs.
|
|
30
|
+
|
|
31
|
+
## There is no licence key
|
|
32
|
+
|
|
33
|
+
No package contains an activation call, a licence check, a phone-home request or a
|
|
34
|
+
feature gate. Nothing stops you from running Tracon. Compliance is yours to
|
|
35
|
+
determine, the same way it is for any dependency your build already carries.
|
|
36
|
+
|
|
37
|
+
## A published version keeps its licence
|
|
38
|
+
|
|
39
|
+
The licence of a version that is already on NuGet never changes. Re-licensing, if
|
|
40
|
+
it ever happens, applies to versions published after that point.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
# PolyForm Small Business License 1.0.0
|
|
45
|
+
|
|
46
|
+
<https://polyformproject.org/licenses/small-business/1.0.0>
|
|
47
|
+
|
|
48
|
+
## Acceptance
|
|
49
|
+
|
|
50
|
+
In order to get any license under these terms, you must agree
|
|
51
|
+
to them as both strict obligations and conditions to all
|
|
52
|
+
your licenses.
|
|
53
|
+
|
|
54
|
+
## Copyright License
|
|
55
|
+
|
|
56
|
+
The licensor grants you a copyright license for the
|
|
57
|
+
software to do everything you might do with the software
|
|
58
|
+
that would otherwise infringe the licensor's copyright
|
|
59
|
+
in it for any permitted purpose. However, you may
|
|
60
|
+
only distribute the software according to [Distribution
|
|
61
|
+
License](#distribution-license) and make changes or new works
|
|
62
|
+
based on the software according to [Changes and New Works
|
|
63
|
+
License](#changes-and-new-works-license).
|
|
64
|
+
|
|
65
|
+
## Distribution License
|
|
66
|
+
|
|
67
|
+
The licensor grants you an additional copyright license
|
|
68
|
+
to distribute copies of the software. Your license
|
|
69
|
+
to distribute covers distributing the software with
|
|
70
|
+
changes and new works permitted by [Changes and New Works
|
|
71
|
+
License](#changes-and-new-works-license).
|
|
72
|
+
|
|
73
|
+
## Notices
|
|
74
|
+
|
|
75
|
+
You must ensure that anyone who gets a copy of any part of
|
|
76
|
+
the software from you also gets a copy of these terms or the
|
|
77
|
+
URL for them above, as well as copies of any plain-text lines
|
|
78
|
+
beginning with `Required Notice:` that the licensor provided
|
|
79
|
+
with the software. For example:
|
|
80
|
+
|
|
81
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
82
|
+
|
|
83
|
+
## Changes and New Works License
|
|
84
|
+
|
|
85
|
+
The licensor grants you an additional copyright license to
|
|
86
|
+
make changes and new works based on the software for any
|
|
87
|
+
permitted purpose.
|
|
88
|
+
|
|
89
|
+
## Patent License
|
|
90
|
+
|
|
91
|
+
The licensor grants you a patent license for the software that
|
|
92
|
+
covers patent claims the licensor can license, or becomes able
|
|
93
|
+
to license, that you would infringe by using the software.
|
|
94
|
+
|
|
95
|
+
## Fair Use
|
|
96
|
+
|
|
97
|
+
You may have "fair use" rights for the software under the
|
|
98
|
+
law. These terms do not limit them.
|
|
99
|
+
|
|
100
|
+
## Small Business
|
|
101
|
+
|
|
102
|
+
Use of the software for the benefit of your company is use for
|
|
103
|
+
a permitted purpose if your company has fewer than 100 total
|
|
104
|
+
individuals working as employees and independent contractors,
|
|
105
|
+
and less than 1,000,000 USD (2019) total revenue in the prior
|
|
106
|
+
tax year. Adjust this revenue threshold for inflation according
|
|
107
|
+
to the United States Bureau of Labor Statistics' consumer price
|
|
108
|
+
index for all urban consumers, U.S. city average, for all items,
|
|
109
|
+
not seasonally adjusted, with 1982–1984=100 reference base.
|
|
110
|
+
|
|
111
|
+
## No Other Rights
|
|
112
|
+
|
|
113
|
+
These terms do not allow you to sublicense or transfer any of
|
|
114
|
+
your licenses to anyone else, or prevent the licensor from
|
|
115
|
+
granting licenses to anyone else. These terms do not imply
|
|
116
|
+
any other licenses.
|
|
117
|
+
|
|
118
|
+
## Patent Defense
|
|
119
|
+
|
|
120
|
+
If you make any written claim that the software infringes or
|
|
121
|
+
contributes to infringement of any patent, your patent license
|
|
122
|
+
for the software granted under these terms ends immediately. If
|
|
123
|
+
your company makes such a claim, your patent license ends
|
|
124
|
+
immediately for work on behalf of your company.
|
|
125
|
+
|
|
126
|
+
## Violations
|
|
127
|
+
|
|
128
|
+
The first time you are notified in writing that you have
|
|
129
|
+
violated any of these terms, or done anything with the software
|
|
130
|
+
not covered by your licenses, your licenses can nonetheless
|
|
131
|
+
continue if you come into full compliance with these terms,
|
|
132
|
+
and take practical steps to correct past violations, within
|
|
133
|
+
32 days of receiving notice. Otherwise, all your licenses
|
|
134
|
+
end immediately.
|
|
135
|
+
|
|
136
|
+
## No Liability
|
|
137
|
+
|
|
138
|
+
***As far as the law allows, the software comes as is, without
|
|
139
|
+
any warranty or condition, and the licensor will not be liable
|
|
140
|
+
to you for any damages arising out of these terms or the use
|
|
141
|
+
or nature of the software, under any kind of legal claim.***
|
|
142
|
+
|
|
143
|
+
## Definitions
|
|
144
|
+
|
|
145
|
+
The **licensor** is the individual or entity offering these
|
|
146
|
+
terms, and the **software** is the software the licensor makes
|
|
147
|
+
available under these terms.
|
|
148
|
+
|
|
149
|
+
**You** refers to the individual or entity agreeing to these
|
|
150
|
+
terms.
|
|
151
|
+
|
|
152
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
153
|
+
or other kind of organization that you work for, plus all
|
|
154
|
+
organizations that have control over, are under the control of,
|
|
155
|
+
or are under common control with that organization. **Control**
|
|
156
|
+
means ownership of substantially all the assets of an entity,
|
|
157
|
+
or the power to direct its management and policies by vote,
|
|
158
|
+
contract, or otherwise. Control can be direct or indirect.
|
|
159
|
+
|
|
160
|
+
**Your licenses** are all the licenses granted to you for the
|
|
161
|
+
software under these terms.
|
|
162
|
+
|
|
163
|
+
**Use** means anything you do with the software requiring one
|
|
164
|
+
of your licenses.
|
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# @tracon/client
|
|
2
|
+
|
|
3
|
+
A typed TypeScript client for Tracon's management API, generated from its
|
|
4
|
+
published [OpenAPI document](https://tracon.dev/openapi/tracon.json).
|
|
5
|
+
Covers every `/api/*` and `/v1/*` operation: agents, runs, sessions, evals,
|
|
6
|
+
workflows, tenants, and the rest of the control plane. Built on
|
|
7
|
+
[`openapi-fetch`](https://openapi-ts.dev/openapi-fetch/) — the only runtime
|
|
8
|
+
dependency.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @tracon/client
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { createTraconClient } from '@tracon/client';
|
|
18
|
+
|
|
19
|
+
const client = createTraconClient({
|
|
20
|
+
// The application root PLUS the MapTracon prefix. The default prefix
|
|
21
|
+
// is "/tracon"; an app that called MapTracon("/control") needs
|
|
22
|
+
// "https://example.com/control" instead.
|
|
23
|
+
baseUrl: 'https://example.com/tracon',
|
|
24
|
+
token: 'a-secret-token', // or a function called per request
|
|
25
|
+
onUnauthorized: () => {
|
|
26
|
+
/* the server answered 401 — your app decides what that means */
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const { data: agents } = await client.GET('/api/agents');
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Every call is typed against the OpenAPI document: the path, its parameters,
|
|
34
|
+
its request body, and its response are all checked at compile time. A schema
|
|
35
|
+
type is also exported by name for every schema in the document, so a
|
|
36
|
+
response can be typed without indexing into `components`:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import type { RunRecord } from '@tracon/client';
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Errors are thrown, not returned
|
|
43
|
+
|
|
44
|
+
`openapi-fetch` on its own returns `{ data, error }`. This package wraps it so
|
|
45
|
+
a failed response instead **throws** `TraconError` — a request either
|
|
46
|
+
resolves with `data` or the call rejects:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { TraconError } from '@tracon/client';
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
await client.GET('/api/agents/{name}', { params: { path: { name: 'missing' } } });
|
|
53
|
+
} catch (error) {
|
|
54
|
+
if (error instanceof TraconError) {
|
|
55
|
+
console.error(error.status, error.title, error.detail);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`title` and `detail` come from the server's `application/problem+json` body
|
|
61
|
+
and are shown verbatim — this package does not translate them.
|
|
62
|
+
|
|
63
|
+
## What this package does not cover
|
|
64
|
+
|
|
65
|
+
- **Server-Sent Events.** Six operations (agent `run`, workflow
|
|
66
|
+
`run`/`resume`/`respond`, and the OpenAI-compatible `responses` and
|
|
67
|
+
`chat/completions` endpoints) answer `text/event-stream`, not JSON. A
|
|
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.
|
|
74
|
+
|
|
75
|
+
## Why the base URL needs the prefix
|
|
76
|
+
|
|
77
|
+
`MapTracon`'s prefix is a runtime parameter, not a fixed value — the
|
|
78
|
+
document this package is generated from carries no prefix at all (it is
|
|
79
|
+
stripped as part of the generation step). If requests went to the document's
|
|
80
|
+
bare paths, a consumer that moved the mount point off the default
|
|
81
|
+
`/tracon` would get a silent `404` on every call. `baseUrl` is where the
|
|
82
|
+
prefix goes instead.
|
|
83
|
+
|
|
84
|
+
## Regenerating
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run generate # docs/openapi/tracon.json -> src/schema.ts (committed)
|
|
88
|
+
npm run build # tsc -> dist/
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`npm run generate` is a development step; it is not part of `npm run build`
|
|
92
|
+
and is not called by `dotnet build`. Run it after `docs/openapi/tracon.json`
|
|
93
|
+
changes, and commit the result — `npm test`'s `schema-drift` check fails the
|
|
94
|
+
build otherwise.
|
|
95
|
+
|
|
96
|
+
## Links
|
|
97
|
+
|
|
98
|
+
- Guide: <https://tracon.dev/guides/typescript-client/>
|
|
99
|
+
- `Tracon.Client` (the .NET counterpart, same document, same shape): <https://tracon.dev/api/>
|
|
100
|
+
- Capability map: <https://tracon.dev/capabilities/>
|
|
101
|
+
|
|
102
|
+
License: PolyForm Small Business 1.0.0, the same terms as its .NET counterpart
|
|
103
|
+
`Tracon.Client` - free below 100 people and 1,000,000 USD (2019, inflation
|
|
104
|
+
adjusted) revenue; a commercial licence applies above that. The text ships in this
|
|
105
|
+
package as LICENSE.md. Details: <https://tracon.dev/reference/licensing/>
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Client } from 'openapi-fetch';
|
|
2
|
+
import type { paths } from './schema.js';
|
|
3
|
+
/** Options for {@link createTraconClient}. */
|
|
4
|
+
export interface TraconClientOptions {
|
|
5
|
+
/** Application root plus the prefix passed to `MapTracon` (default `/tracon`). */
|
|
6
|
+
baseUrl: string;
|
|
7
|
+
/** Bearer token, or a function that supplies one per request. */
|
|
8
|
+
token?: string | (() => string | null);
|
|
9
|
+
/** Called when the server answers 401 — the caller decides what "reject the token" means. */
|
|
10
|
+
onUnauthorized?: () => void;
|
|
11
|
+
/** Custom fetch, defaults to `globalThis.fetch`. */
|
|
12
|
+
fetch?: typeof globalThis.fetch;
|
|
13
|
+
}
|
|
14
|
+
/** A client typed against every Tracon management API path. */
|
|
15
|
+
export type TraconClient = Client<paths>;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a typed client that throws {@link TraconError} on a failed
|
|
18
|
+
* response.
|
|
19
|
+
*
|
|
20
|
+
* This layer stores no token itself — the caller's own token store (or a
|
|
21
|
+
* closure over one) is passed as `token`, and this layer only reads it. It
|
|
22
|
+
* does not translate `title`/`detail` (K-232): they come from the server and
|
|
23
|
+
* are shown verbatim.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createTraconClient(options: TraconClientOptions): TraconClient;
|
|
26
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAqB,EAAE,KAAK,MAAM,EAAmB,MAAM,eAAe,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGzC,8CAA8C;AAC9C,MAAM,WAAW,mBAAmB;IAClC,kFAAkF;IAClF,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC;IACvC,6FAA6F;IAC7F,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AAED,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAOzC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CA+C7E"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import createClient, {} from 'openapi-fetch';
|
|
2
|
+
import { TraconError } from './error.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a typed client that throws {@link TraconError} on a failed
|
|
5
|
+
* response.
|
|
6
|
+
*
|
|
7
|
+
* This layer stores no token itself — the caller's own token store (or a
|
|
8
|
+
* closure over one) is passed as `token`, and this layer only reads it. It
|
|
9
|
+
* does not translate `title`/`detail` (K-232): they come from the server and
|
|
10
|
+
* are shown verbatim.
|
|
11
|
+
*/
|
|
12
|
+
export function createTraconClient(options) {
|
|
13
|
+
const client = createClient({
|
|
14
|
+
baseUrl: options.baseUrl,
|
|
15
|
+
fetch: options.fetch,
|
|
16
|
+
});
|
|
17
|
+
const middleware = {
|
|
18
|
+
onRequest({ request }) {
|
|
19
|
+
const token = typeof options.token === 'function' ? options.token() : options.token;
|
|
20
|
+
if (token) {
|
|
21
|
+
request.headers.set('Authorization', `Bearer ${token}`);
|
|
22
|
+
}
|
|
23
|
+
return request;
|
|
24
|
+
},
|
|
25
|
+
async onResponse({ response }) {
|
|
26
|
+
if (response.ok) {
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
if (response.status === 401) {
|
|
30
|
+
// The token was rejected. The caller decides what that means (drop it,
|
|
31
|
+
// prompt again); this layer still throws below so the failed call does
|
|
32
|
+
// not silently resolve with no data.
|
|
33
|
+
options.onUnauthorized?.();
|
|
34
|
+
}
|
|
35
|
+
let title = `HTTP ${response.status}`;
|
|
36
|
+
let detail = null;
|
|
37
|
+
try {
|
|
38
|
+
const body = (await response.clone().json());
|
|
39
|
+
title = body.title ?? title;
|
|
40
|
+
detail = body.detail ?? null;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// A body that is not problem+json leaves the status line as the message.
|
|
44
|
+
}
|
|
45
|
+
throw new TraconError(response.status, title, detail);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
client.use(middleware);
|
|
49
|
+
return client;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,EAAE,EAAgC,MAAM,eAAe,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAsBzC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAA4B;IAC7D,MAAM,MAAM,GAAG,YAAY,CAAQ;QACjC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAe;QAC7B,SAAS,CAAC,EAAE,OAAO,EAAE;YACnB,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;YAEpF,IAAI,KAAK,EAAE,CAAC;gBACV,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;YAC1D,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,KAAK,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE;YAC3B,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,OAAO,QAAQ,CAAC;YAClB,CAAC;YAED,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC5B,uEAAuE;gBACvE,uEAAuE;gBACvE,qCAAqC;gBACrC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;YAC7B,CAAC;YAED,IAAI,KAAK,GAAG,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC;YACtC,IAAI,MAAM,GAAkB,IAAI,CAAC;YAEjC,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAuB,CAAC;gBAEnE,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC;gBAC5B,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC;YAC/B,CAAC;YAAC,MAAM,CAAC;gBACP,yEAAyE;YAC3E,CAAC;YAED,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAEvB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/error.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A failed request, carrying the server's own explanation.
|
|
3
|
+
*
|
|
4
|
+
* The management API answers with `application/problem+json` (decision
|
|
5
|
+
* K-038), so `title` and `detail` are written for a human and are shown
|
|
6
|
+
* verbatim (K-232) — this layer does not translate them.
|
|
7
|
+
*/
|
|
8
|
+
export declare class TraconError extends Error {
|
|
9
|
+
readonly status: number;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly detail: string | null;
|
|
12
|
+
constructor(status: number, title: string, detail: string | null);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEnB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAOjE"}
|
package/dist/error.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A failed request, carrying the server's own explanation.
|
|
3
|
+
*
|
|
4
|
+
* The management API answers with `application/problem+json` (decision
|
|
5
|
+
* K-038), so `title` and `detail` are written for a human and are shown
|
|
6
|
+
* verbatim (K-232) — this layer does not translate them.
|
|
7
|
+
*/
|
|
8
|
+
export class TraconError extends Error {
|
|
9
|
+
status;
|
|
10
|
+
title;
|
|
11
|
+
detail;
|
|
12
|
+
constructor(status, title, detail) {
|
|
13
|
+
super(detail ? `${title}: ${detail}` : title);
|
|
14
|
+
this.name = 'TraconError';
|
|
15
|
+
this.status = status;
|
|
16
|
+
this.title = title;
|
|
17
|
+
this.detail = detail;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK;IAC3B,MAAM,CAAS;IACf,KAAK,CAAS;IACd,MAAM,CAAgB;IAE/B,YAAY,MAAc,EAAE,KAAa,EAAE,MAAqB;QAC9D,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './schema.js';
|
|
2
|
+
import type { components } from './schema.js';
|
|
3
|
+
/** Wire contracts, by schema name. Example: `Schemas['RunRecord']`. */
|
|
4
|
+
export type Schemas = components['schemas'];
|
|
5
|
+
export { TraconError } from './error.js';
|
|
6
|
+
export { createTraconClient, type TraconClient, type TraconClientOptions } from './client.js';
|
|
7
|
+
export { readSse, SseDecoder, SseIdleTimeoutError, type ReadSseOptions, type SseFrame, } from './sse.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAE5B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,uEAAuE;AACvE,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAM9F,OAAO,EACL,OAAO,EACP,UAAU,EACV,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,QAAQ,GACd,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Generated — every path, operation and schema, including a readable
|
|
2
|
+
// root-level type alias per schema (e.g. `RunRecord`, `AgentDefinition`).
|
|
3
|
+
export * from './schema.js';
|
|
4
|
+
// Hand-written — the thin layer described in docs/arsiv/fazlar/84-TYPESCRIPT-ISTEMCISI-VE-NPM.md, section 84.5.
|
|
5
|
+
export { TraconError } from './error.js';
|
|
6
|
+
export { createTraconClient } from './client.js';
|
|
7
|
+
// Streaming. A `text/event-stream` endpoint needs no special client method —
|
|
8
|
+
// pass `parseAs: 'stream'`, or read the `response` every call returns — but it
|
|
9
|
+
// does need a decoder, and writing one per consumer is how framing bugs get
|
|
10
|
+
// duplicated (Phase 159).
|
|
11
|
+
export { readSse, SseDecoder, SseIdleTimeoutError, } from './sse.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,0EAA0E;AAC1E,cAAc,aAAa,CAAC;AAO5B,gHAAgH;AAChH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAA+C,MAAM,aAAa,CAAC;AAE9F,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,0BAA0B;AAC1B,OAAO,EACL,OAAO,EACP,UAAU,EACV,mBAAmB,GAGpB,MAAM,UAAU,CAAC"}
|