@tai42/api-client 0.1.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/LICENSE +202 -0
- package/README.md +28 -0
- package/dist/agents.d.ts +265 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +200 -0
- package/dist/agents.js.map +1 -0
- package/dist/client.d.ts +1316 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +468 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +43 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +1 -0
- package/dist/fleet-report.d.ts +61 -0
- package/dist/fleet-report.d.ts.map +1 -0
- package/dist/fleet-report.js +42 -0
- package/dist/fleet-report.js.map +1 -0
- package/dist/http.d.ts +69 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +152 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas.d.ts +5469 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +1103 -0
- package/dist/schemas.js.map +1 -0
- package/dist/sse.d.ts +27 -0
- package/dist/sse.d.ts.map +1 -0
- package/dist/sse.js +84 -0
- package/dist/sse.js.map +1 -0
- package/dist/tool-runs.d.ts +112 -0
- package/dist/tool-runs.d.ts.map +1 -0
- package/dist/tool-runs.js +70 -0
- package/dist/tool-runs.js.map +1 -0
- package/package.json +51 -0
- package/src/agents.ts +248 -0
- package/src/client.ts +837 -0
- package/src/errors.ts +67 -0
- package/src/fleet-report.ts +94 -0
- package/src/http.ts +198 -0
- package/src/index.ts +142 -0
- package/src/schemas.ts +1341 -0
- package/src/sse.ts +90 -0
- package/src/tool-runs.ts +103 -0
package/src/errors.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loud error types. Every failure surfaces — a failed request or a schema
|
|
3
|
+
* mismatch throws, so the UI can render a visible error state, never a silent
|
|
4
|
+
* empty render.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** The skeleton returned `{ "error": "<message>" }` (or a non-2xx status). */
|
|
8
|
+
export class ApiError extends Error {
|
|
9
|
+
readonly status: number;
|
|
10
|
+
/** The optional machine-readable `code` from the `{ error, code }` envelope. */
|
|
11
|
+
readonly code: string | undefined;
|
|
12
|
+
constructor(message: string, status: number, code?: string) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = 'ApiError';
|
|
15
|
+
this.status = status;
|
|
16
|
+
this.code = code;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** A 401 from any data route. The shell routes this back to `/login`. */
|
|
21
|
+
export class ApiUnauthorizedError extends ApiError {
|
|
22
|
+
constructor(message = 'unauthorized') {
|
|
23
|
+
super(message, 401);
|
|
24
|
+
this.name = 'ApiUnauthorizedError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** A duplicate answer / alias collision etc. (HTTP 409). */
|
|
29
|
+
export class ApiConflictError extends ApiError {
|
|
30
|
+
constructor(message: string) {
|
|
31
|
+
super(message, 409);
|
|
32
|
+
this.name = 'ApiConflictError';
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A login attempt was REJECTED (bad credentials, expired invite/SSO code,
|
|
38
|
+
* rate-limited). Deliberately NOT an ApiUnauthorizedError: that type means "your
|
|
39
|
+
* stored session credential is dead" and routes to /login globally (the
|
|
40
|
+
* create-studio wiring); this one means "the credentials you just typed on the
|
|
41
|
+
* login page were refused" and renders inline, on the page the user is already
|
|
42
|
+
* on.
|
|
43
|
+
*/
|
|
44
|
+
export class ApiLoginFailedError extends Error {
|
|
45
|
+
readonly status: number;
|
|
46
|
+
constructor(message: string, status: number) {
|
|
47
|
+
super(message);
|
|
48
|
+
this.name = 'ApiLoginFailedError';
|
|
49
|
+
this.status = status;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The response body did not match its declared zod schema. This is a contract
|
|
55
|
+
* drift between the Studio and the skeleton — a loud, visible error, never a
|
|
56
|
+
* silently-coerced value.
|
|
57
|
+
*/
|
|
58
|
+
export class ApiSchemaError extends Error {
|
|
59
|
+
readonly endpoint: string;
|
|
60
|
+
readonly issues: unknown;
|
|
61
|
+
constructor(endpoint: string, issues: unknown) {
|
|
62
|
+
super(`response from ${endpoint} did not match its expected schema`);
|
|
63
|
+
this.name = 'ApiSchemaError';
|
|
64
|
+
this.endpoint = endpoint;
|
|
65
|
+
this.issues = issues;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared fleet-report handler — the single interpreter of a config mutation's
|
|
3
|
+
* fleet broadcast. Every mutation surface (connector, backup, mcp-config, env,
|
|
4
|
+
* extensions, single-MCP reload, fleet reload) routes its broadcast report through
|
|
5
|
+
* this one function so a FAILED propagation is never invisible: an unconfirmed
|
|
6
|
+
* sibling (`failed`/`missing`/`departed`/`timed_out`) or an unreachable bus becomes
|
|
7
|
+
* an explicit summary the UI renders as a loud, user-visible state — never a faked
|
|
8
|
+
* success on a departed/timed_out/failed origin.
|
|
9
|
+
*
|
|
10
|
+
* A mutation embeds its broadcast in one of two shapes: the mode-wrapped
|
|
11
|
+
* {@link FleetReportFanout} (`fanout` field) or the bare {@link FleetResult} (the
|
|
12
|
+
* fleet-reload and single-MCP-reload bodies). Both normalize to a
|
|
13
|
+
* {@link FleetReportSummary} through the functions here; the SDK's `FleetReport`
|
|
14
|
+
* component renders the summary.
|
|
15
|
+
*/
|
|
16
|
+
import type { FleetOutcome, FleetReportFanout, FleetResult } from './schemas';
|
|
17
|
+
|
|
18
|
+
/** A per-origin propagation FAILURE: an origin that did not confirm `applied`. */
|
|
19
|
+
export type FleetFailureOutcome = Exclude<FleetOutcome, 'applied'>;
|
|
20
|
+
|
|
21
|
+
/** One origin that failed to converge, with the report's message for it. */
|
|
22
|
+
export interface FleetOriginFailure {
|
|
23
|
+
readonly origin: string;
|
|
24
|
+
readonly outcome: FleetFailureOutcome;
|
|
25
|
+
/** The failed apply's `error`, or the publisher's computed-outcome `detail`. */
|
|
26
|
+
readonly message: string | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The interpreted state of one broadcast.
|
|
31
|
+
* - `converged` — the bus was reached and every origin applied (or the change was
|
|
32
|
+
* local-only on a lone worker). The caller renders its own success; the report
|
|
33
|
+
* needs no loud state.
|
|
34
|
+
* - `degraded` — the bus was reached but one or more origins did not confirm; the
|
|
35
|
+
* named `failures` are stale/unreached siblings the operator must see.
|
|
36
|
+
* - `unreachable` — the bus itself could not be reached, so no sibling was told;
|
|
37
|
+
* `error` carries the transport failure.
|
|
38
|
+
*/
|
|
39
|
+
export type FleetReportStatus = 'converged' | 'degraded' | 'unreachable';
|
|
40
|
+
|
|
41
|
+
export interface FleetReportSummary {
|
|
42
|
+
readonly status: FleetReportStatus;
|
|
43
|
+
/** The single-worker `local-only` note, when the broadcast reached no sibling. */
|
|
44
|
+
readonly note: string | null;
|
|
45
|
+
/** The origins that did not apply — empty unless `status` is `degraded`. */
|
|
46
|
+
readonly failures: readonly FleetOriginFailure[];
|
|
47
|
+
/** The bus-unreachable transport error — non-null only when `unreachable`. */
|
|
48
|
+
readonly error: string | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** True when a summary describes a propagation the operator must be shown. */
|
|
52
|
+
export function isFleetReportFailure(summary: FleetReportSummary | null): boolean {
|
|
53
|
+
return summary !== null && summary.status !== 'converged';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Interpret a bare {@link FleetResult} (the fleet-reload / single-MCP-reload body).
|
|
58
|
+
* An unreachable bus is `unreachable`; a reachable report with any non-`applied`
|
|
59
|
+
* origin is `degraded` (those origins named); otherwise `converged`.
|
|
60
|
+
*/
|
|
61
|
+
export function summarizeFleetResult(result: FleetResult): FleetReportSummary {
|
|
62
|
+
if (!result.reachable) {
|
|
63
|
+
return { status: 'unreachable', note: null, failures: [], error: result.error };
|
|
64
|
+
}
|
|
65
|
+
const failures: FleetOriginFailure[] = result.results
|
|
66
|
+
.filter((entry) => entry.outcome !== 'applied')
|
|
67
|
+
.map((entry) => ({
|
|
68
|
+
origin: entry.origin,
|
|
69
|
+
outcome: entry.outcome as FleetFailureOutcome,
|
|
70
|
+
message: entry.error ?? entry.detail ?? null,
|
|
71
|
+
}));
|
|
72
|
+
return {
|
|
73
|
+
status: failures.length > 0 ? 'degraded' : 'converged',
|
|
74
|
+
note: null,
|
|
75
|
+
failures,
|
|
76
|
+
error: null,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Interpret a mutation's mode-wrapped {@link FleetReportFanout}. `null`/`undefined`
|
|
82
|
+
* (the response path mutated no manifest) yields `null` — there is nothing to report.
|
|
83
|
+
* A `local-only` fan-out is `converged` with its note; `fleet`/`unreachable` carry a
|
|
84
|
+
* bare {@link FleetResult} and defer to {@link summarizeFleetResult}.
|
|
85
|
+
*/
|
|
86
|
+
export function summarizeFleetFanout(
|
|
87
|
+
fanout: FleetReportFanout | null | undefined,
|
|
88
|
+
): FleetReportSummary | null {
|
|
89
|
+
if (fanout === null || fanout === undefined) return null;
|
|
90
|
+
if (fanout.mode === 'local-only') {
|
|
91
|
+
return { status: 'converged', note: fanout.note, failures: [], error: null };
|
|
92
|
+
}
|
|
93
|
+
return summarizeFleetResult(fanout);
|
|
94
|
+
}
|
package/src/http.ts
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP core: a fetch wrapper that attaches the auth header, unwraps the
|
|
3
|
+
* skeleton's `{ "data" }` / `{ "error" }` envelope, and validates the payload
|
|
4
|
+
* against a per-endpoint zod schema. Every failure throws.
|
|
5
|
+
*
|
|
6
|
+
* Same-origin by default: the skeleton serves the built SPA, so requests use
|
|
7
|
+
* relative `/api/...` URLs. `VITE_API_BASE_URL` can override for cross-origin
|
|
8
|
+
* deployments (documented as requiring CORS on the skeleton).
|
|
9
|
+
*/
|
|
10
|
+
import type { z } from 'zod';
|
|
11
|
+
|
|
12
|
+
import { ApiConflictError, ApiError, ApiSchemaError, ApiUnauthorizedError } from './errors';
|
|
13
|
+
|
|
14
|
+
/** Supplies the current API key (in-memory or sessionStorage-backed) + base URL. */
|
|
15
|
+
export interface ApiConfig {
|
|
16
|
+
/** Absolute base (e.g. `https://host`) or '' for same-origin relative `/api`. */
|
|
17
|
+
readonly baseUrl?: string;
|
|
18
|
+
/** Returns the pre-provisioned API key, or null when unauthenticated. */
|
|
19
|
+
getToken: () => string | null;
|
|
20
|
+
/** Optional fetch impl (tests inject one; defaults to global fetch). */
|
|
21
|
+
fetch?: typeof fetch;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface RequestOptions {
|
|
25
|
+
readonly method?: string;
|
|
26
|
+
readonly body?: unknown;
|
|
27
|
+
// An array value is sent as REPEATED params, one occurrence per element (e.g.
|
|
28
|
+
// `tags=a&tags=b`); a scalar is sent once. `undefined` values are dropped.
|
|
29
|
+
readonly query?: Record<string, string | number | string[] | undefined>;
|
|
30
|
+
readonly signal?: AbortSignal;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const JSON_HEADERS = { 'content-type': 'application/json' } as const;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Whether a value can never be faithfully transmitted as a single URL path
|
|
37
|
+
* segment. The browser's WHATWG URL parser removes dot-segments (`.`, `..`) from a
|
|
38
|
+
* relative request path before it is sent — even percent-encoded — and reads an
|
|
39
|
+
* empty or absolute (`/`-prefixed) value as a path boundary, so any of these would
|
|
40
|
+
* silently retarget the request at an unrelated same-origin route. The path
|
|
41
|
+
* encoders reject such a segment loudly at the client boundary instead of letting
|
|
42
|
+
* it leave; the server enforces the same relative-path rule.
|
|
43
|
+
*/
|
|
44
|
+
export function isUnsafePathSegment(segment: string): boolean {
|
|
45
|
+
return segment === '' || segment === '.' || segment === '..' || segment.startsWith('/');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Encode a single id (string or number) as ONE URL path segment.
|
|
50
|
+
* `encodeURIComponent` already percent-encodes any interior `/`, so the value is
|
|
51
|
+
* guaranteed to stay a single segment (spaces, `#`, `?`, … all escape). An empty,
|
|
52
|
+
* `.`, `..`, or absolute id is REJECTED loudly rather than encoded (see
|
|
53
|
+
* `isUnsafePathSegment`): the browser would collapse it and retarget the request
|
|
54
|
+
* at a different route. A number stringifies to digits and is always safe.
|
|
55
|
+
*/
|
|
56
|
+
export function encodeSegment(value: string | number): string {
|
|
57
|
+
const segment = String(value);
|
|
58
|
+
if (isUnsafePathSegment(segment)) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`URL path segment must not be empty, '.', '..', or absolute; received ${JSON.stringify(segment)}`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
return encodeURIComponent(segment);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function buildUrl(base: string, path: string, query?: RequestOptions['query']): string {
|
|
67
|
+
const url = `${base}${path}`;
|
|
68
|
+
if (!query) return url;
|
|
69
|
+
const params = new URLSearchParams();
|
|
70
|
+
for (const [key, value] of Object.entries(query)) {
|
|
71
|
+
if (value === undefined) continue;
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
for (const element of value) params.append(key, element);
|
|
74
|
+
} else {
|
|
75
|
+
params.set(key, String(value));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const qs = params.toString();
|
|
79
|
+
return qs ? `${url}?${qs}` : url;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Send a request and validate the unwrapped `data` against `schema`. The auth
|
|
84
|
+
* header is `X-Api-Key` (the skeleton's access-control middleware also accepts
|
|
85
|
+
* `Authorization: Bearer`; we use the dedicated key header).
|
|
86
|
+
*/
|
|
87
|
+
export async function apiRequest<S extends z.ZodTypeAny>(
|
|
88
|
+
config: ApiConfig,
|
|
89
|
+
path: string,
|
|
90
|
+
schema: S,
|
|
91
|
+
options: RequestOptions = {},
|
|
92
|
+
): Promise<z.infer<S>> {
|
|
93
|
+
const doFetch = config.fetch ?? globalThis.fetch;
|
|
94
|
+
const token = config.getToken();
|
|
95
|
+
const headers: Record<string, string> = { ...JSON_HEADERS };
|
|
96
|
+
if (token) headers['x-api-key'] = token;
|
|
97
|
+
|
|
98
|
+
const response = await doFetch(buildUrl(config.baseUrl ?? '', path, options.query), {
|
|
99
|
+
method: options.method ?? 'GET',
|
|
100
|
+
headers,
|
|
101
|
+
body: options.body === undefined ? undefined : JSON.stringify(options.body),
|
|
102
|
+
signal: options.signal,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
if (response.status === 401) throw new ApiUnauthorizedError();
|
|
106
|
+
|
|
107
|
+
let payload: unknown;
|
|
108
|
+
try {
|
|
109
|
+
payload = await response.json();
|
|
110
|
+
} catch {
|
|
111
|
+
if (response.ok) throw new ApiSchemaError(path, 'response was not valid JSON');
|
|
112
|
+
throw new ApiError(response.statusText || 'request failed', response.status);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
const { message, code } = extractError(payload);
|
|
117
|
+
const text = message ?? (response.statusText || 'request failed');
|
|
118
|
+
if (response.status === 409) throw new ApiConflictError(text);
|
|
119
|
+
throw new ApiError(text, response.status, code);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!isDataEnvelope(payload)) {
|
|
123
|
+
throw new ApiSchemaError(path, 'response was not a { data } envelope');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const parsed = schema.safeParse(payload.data);
|
|
127
|
+
if (!parsed.success) throw new ApiSchemaError(path, parsed.error.issues);
|
|
128
|
+
return parsed.data as z.infer<S>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Fetch a plain-text endpoint (the skeleton's `/health` → `"OK"` and `/metrics`
|
|
133
|
+
* → Prometheus text). No `{ data }` envelope, no zod — the body is returned
|
|
134
|
+
* verbatim. Non-2xx still throws loudly.
|
|
135
|
+
*/
|
|
136
|
+
export async function apiText(
|
|
137
|
+
config: ApiConfig,
|
|
138
|
+
path: string,
|
|
139
|
+
options: RequestOptions = {},
|
|
140
|
+
): Promise<string> {
|
|
141
|
+
const doFetch = config.fetch ?? globalThis.fetch;
|
|
142
|
+
const token = config.getToken();
|
|
143
|
+
const headers: Record<string, string> = {};
|
|
144
|
+
if (token) headers['x-api-key'] = token;
|
|
145
|
+
|
|
146
|
+
const response = await doFetch(buildUrl(config.baseUrl ?? '', path, options.query), {
|
|
147
|
+
method: options.method ?? 'GET',
|
|
148
|
+
headers,
|
|
149
|
+
signal: options.signal,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
if (response.status === 401) throw new ApiUnauthorizedError();
|
|
153
|
+
if (!response.ok) throw new ApiError(response.statusText || 'request failed', response.status);
|
|
154
|
+
return response.text();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Fetch a raw file download (the skeleton's backup export and observability
|
|
159
|
+
* exports stream a document, NOT a `{ data }` envelope). Attaches the auth
|
|
160
|
+
* header, serializes a JSON body when one is given (POST exports), and returns
|
|
161
|
+
* the response as a `Blob`. Non-2xx throws loudly — no silent empty download.
|
|
162
|
+
*/
|
|
163
|
+
export async function apiDownload(
|
|
164
|
+
config: ApiConfig,
|
|
165
|
+
path: string,
|
|
166
|
+
options: RequestOptions = {},
|
|
167
|
+
): Promise<Blob> {
|
|
168
|
+
const doFetch = config.fetch ?? globalThis.fetch;
|
|
169
|
+
const token = config.getToken();
|
|
170
|
+
const headers: Record<string, string> = {};
|
|
171
|
+
if (options.body !== undefined) Object.assign(headers, JSON_HEADERS);
|
|
172
|
+
if (token) headers['x-api-key'] = token;
|
|
173
|
+
|
|
174
|
+
const response = await doFetch(buildUrl(config.baseUrl ?? '', path, options.query), {
|
|
175
|
+
method: options.method ?? 'GET',
|
|
176
|
+
headers,
|
|
177
|
+
body: options.body === undefined ? undefined : JSON.stringify(options.body),
|
|
178
|
+
signal: options.signal,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
if (response.status === 401) throw new ApiUnauthorizedError();
|
|
182
|
+
if (!response.ok) throw new ApiError(response.statusText || 'download failed', response.status);
|
|
183
|
+
return response.blob();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function isDataEnvelope(value: unknown): value is { data: unknown } {
|
|
187
|
+
return typeof value === 'object' && value !== null && 'data' in value;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Pull the `error` message and optional machine `code` from the failure envelope. */
|
|
191
|
+
export function extractError(value: unknown): { message: string | null; code: string | undefined } {
|
|
192
|
+
if (typeof value === 'object' && value !== null) {
|
|
193
|
+
const message = 'error' in value && typeof value.error === 'string' ? value.error : null;
|
|
194
|
+
const code = 'code' in value && typeof value.code === 'string' ? value.code : undefined;
|
|
195
|
+
return { message, code };
|
|
196
|
+
}
|
|
197
|
+
return { message: null, code: undefined };
|
|
198
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tai42/api-client — the typed transport for the tai-skeleton HTTP API.
|
|
3
|
+
*
|
|
4
|
+
* One zod schema per consumed endpoint; every response is
|
|
5
|
+
* validated and every failure throws. No caching of its own — server state
|
|
6
|
+
* lives in TanStack Query in the feature packages.
|
|
7
|
+
*/
|
|
8
|
+
export { createApiClient, isSafeApiPath } from './client';
|
|
9
|
+
export type {
|
|
10
|
+
ApiClient,
|
|
11
|
+
RunToolArgs,
|
|
12
|
+
StartConnectArgs,
|
|
13
|
+
ApiKeyBody,
|
|
14
|
+
ClaimLinkBody,
|
|
15
|
+
ValidateConditionBody,
|
|
16
|
+
TopicVerifierBody,
|
|
17
|
+
AddUrlToScopeBody,
|
|
18
|
+
PinRoutePublicBody,
|
|
19
|
+
CreatePresetBody,
|
|
20
|
+
SavePresetVersionBody,
|
|
21
|
+
ValidatePresetBody,
|
|
22
|
+
StorageUploadBody,
|
|
23
|
+
MetricsQuery,
|
|
24
|
+
RunsQuery,
|
|
25
|
+
MarketplaceSearchQuery,
|
|
26
|
+
MarketplaceInstallBody,
|
|
27
|
+
MarketplaceUninstallBody,
|
|
28
|
+
} from './client';
|
|
29
|
+
export type { ApiConfig, RequestOptions } from './http';
|
|
30
|
+
export { apiRequest, apiText, apiDownload } from './http';
|
|
31
|
+
export {
|
|
32
|
+
ApiError,
|
|
33
|
+
ApiUnauthorizedError,
|
|
34
|
+
ApiConflictError,
|
|
35
|
+
ApiLoginFailedError,
|
|
36
|
+
ApiSchemaError,
|
|
37
|
+
} from './errors';
|
|
38
|
+
export { SseFrameParser, readSseFrames } from './sse';
|
|
39
|
+
export type { SseFrame } from './sse';
|
|
40
|
+
export { parseAgentFrame, parseAgentTranscript, agentEventSchema } from './agents';
|
|
41
|
+
export type { AgentSummary, AgentEvent, UnknownAgentEvent, ParsedAgentEvent } from './agents';
|
|
42
|
+
export {
|
|
43
|
+
toolRunStatus,
|
|
44
|
+
toolRunSubmitResult,
|
|
45
|
+
toolRunRecord,
|
|
46
|
+
toolRunListItem,
|
|
47
|
+
toolRunList,
|
|
48
|
+
isTerminalRunStatus,
|
|
49
|
+
} from './tool-runs';
|
|
50
|
+
export type {
|
|
51
|
+
ToolRunStatus,
|
|
52
|
+
ToolRunSubmitResult,
|
|
53
|
+
ToolRunRecord,
|
|
54
|
+
ToolRunListItem,
|
|
55
|
+
SubmitToolRunArgs,
|
|
56
|
+
} from './tool-runs';
|
|
57
|
+
export { summarizeFleetResult, summarizeFleetFanout, isFleetReportFailure } from './fleet-report';
|
|
58
|
+
export type {
|
|
59
|
+
FleetReportSummary,
|
|
60
|
+
FleetReportStatus,
|
|
61
|
+
FleetOriginFailure,
|
|
62
|
+
FleetFailureOutcome,
|
|
63
|
+
} from './fleet-report';
|
|
64
|
+
export * as schemas from './schemas';
|
|
65
|
+
export type {
|
|
66
|
+
ToolSchema,
|
|
67
|
+
ToolMediaResult,
|
|
68
|
+
ToolTagEntry,
|
|
69
|
+
AuthRoute,
|
|
70
|
+
PresetRecord,
|
|
71
|
+
PresetDetail,
|
|
72
|
+
PresetBody,
|
|
73
|
+
PresetVersion,
|
|
74
|
+
PresetRenamed,
|
|
75
|
+
PresetReferees,
|
|
76
|
+
PresetValidation,
|
|
77
|
+
PresetVersionTags,
|
|
78
|
+
PresetExtensionElement,
|
|
79
|
+
PolicyBody,
|
|
80
|
+
PolicyVersion,
|
|
81
|
+
ValidateConditionResult,
|
|
82
|
+
Extension,
|
|
83
|
+
ToolExtensions,
|
|
84
|
+
ToolExtensionsApplyResult,
|
|
85
|
+
ProviderView,
|
|
86
|
+
ConnectionView,
|
|
87
|
+
OAuthCompleteResult,
|
|
88
|
+
StudioPluginManifest,
|
|
89
|
+
Interaction,
|
|
90
|
+
InteractionAnswered,
|
|
91
|
+
InteractionMediaItem,
|
|
92
|
+
MediaKind,
|
|
93
|
+
AnswerFormat,
|
|
94
|
+
Channels,
|
|
95
|
+
Notification,
|
|
96
|
+
Notifications,
|
|
97
|
+
HookParams,
|
|
98
|
+
SettingsSchema,
|
|
99
|
+
TokensPayload,
|
|
100
|
+
LoginFormField,
|
|
101
|
+
LoginMethod,
|
|
102
|
+
LoginMethods,
|
|
103
|
+
LoginResult,
|
|
104
|
+
MeProjection,
|
|
105
|
+
RouteEntry,
|
|
106
|
+
PatternEntry,
|
|
107
|
+
SubMcpEntry,
|
|
108
|
+
ClaimLinkCreated,
|
|
109
|
+
LogoutResult,
|
|
110
|
+
AuthCapabilities,
|
|
111
|
+
BackupDocument,
|
|
112
|
+
BackupImportReport,
|
|
113
|
+
ScheduleItem,
|
|
114
|
+
StorageInfo,
|
|
115
|
+
StorageResourceStat,
|
|
116
|
+
BackendInfo,
|
|
117
|
+
OriginKind,
|
|
118
|
+
FleetOrigin,
|
|
119
|
+
FleetWorkers,
|
|
120
|
+
FleetOutcome,
|
|
121
|
+
FleetOriginResult,
|
|
122
|
+
FleetResult,
|
|
123
|
+
FleetReloadResult,
|
|
124
|
+
FleetReportFanout,
|
|
125
|
+
ReloadConfigResult,
|
|
126
|
+
McpReloadResult,
|
|
127
|
+
KindStatus,
|
|
128
|
+
DashboardMetrics,
|
|
129
|
+
Run,
|
|
130
|
+
RunSpan,
|
|
131
|
+
RunTrace,
|
|
132
|
+
MarketplaceItem,
|
|
133
|
+
MarketplaceSearchRow,
|
|
134
|
+
MarketplaceSearchPage,
|
|
135
|
+
MarketplaceVersion,
|
|
136
|
+
MarketplaceLatestVersion,
|
|
137
|
+
MarketplaceAdvisory,
|
|
138
|
+
MarketplacePluginDetail,
|
|
139
|
+
MarketplaceInstalledPlugin,
|
|
140
|
+
MarketplaceInstallResult,
|
|
141
|
+
MarketplaceUninstallResult,
|
|
142
|
+
} from './schemas';
|