@xenosystem/agents-client 0.1.3
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 +67 -0
- package/dist/index.d.ts +322 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +528 -0
- package/dist/index.js.map +1 -0
- package/dist/modelCatalog.d.ts +29 -0
- package/dist/modelCatalog.d.ts.map +1 -0
- package/dist/modelCatalog.js +137 -0
- package/dist/modelCatalog.js.map +1 -0
- package/dist/node.d.ts +45 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +106 -0
- package/dist/node.js.map +1 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
XENO Agent — Proprietary Software License
|
|
2
|
+
Copyright © 2026 XENO Corporation. All rights reserved.
|
|
3
|
+
|
|
4
|
+
This software, including its source code, compiled binaries, published packages,
|
|
5
|
+
assets, and accompanying documentation (collectively, the "Software"), is the
|
|
6
|
+
proprietary and confidential property of XENO Corporation ("XENO"). The Software
|
|
7
|
+
is licensed for use, not sold, and no title to or ownership of the Software is
|
|
8
|
+
transferred to any user.
|
|
9
|
+
|
|
10
|
+
1. GRANT OF USE
|
|
11
|
+
Subject to a separate written agreement and/or the terms of service published
|
|
12
|
+
at https://xenostudio.ai, XENO grants the end user a limited, non-exclusive,
|
|
13
|
+
non-transferable, revocable license to install and use the Software for its
|
|
14
|
+
intended purpose. The standalone desktop application ("the Agent") may be used
|
|
15
|
+
locally at no charge; connected platform features — hosted agent runs, model
|
|
16
|
+
inference, credits, and account services — are governed by the applicable
|
|
17
|
+
subscription and the XENO terms of service.
|
|
18
|
+
|
|
19
|
+
2. PACKAGE DISTRIBUTION
|
|
20
|
+
The `@xeno-corporation/xeno-agent-interface-*` and
|
|
21
|
+
`@xeno-corporation/xeno-agents-client` packages are published to a PRIVATE
|
|
22
|
+
registry and are licensed for use solely by XENO products and by parties
|
|
23
|
+
holding a separate written agreement with XENO. Access credentials to that
|
|
24
|
+
registry do not grant redistribution rights. Publication of any package in
|
|
25
|
+
this repository to a public registry is prohibited without written
|
|
26
|
+
authorization from XENO.
|
|
27
|
+
|
|
28
|
+
3. RESTRICTIONS
|
|
29
|
+
Except to the extent expressly permitted by applicable law or by a separate
|
|
30
|
+
written agreement with XENO, you may NOT: (a) copy, redistribute, sell, rent,
|
|
31
|
+
lease, sublicense, or otherwise transfer the Software; (b) modify, adapt,
|
|
32
|
+
translate, or create derivative works of the Software; (c) reverse-engineer,
|
|
33
|
+
decompile, or disassemble the Software, or attempt to derive its source code;
|
|
34
|
+
(d) remove, obscure, or alter any proprietary notices; or (e) use the Software
|
|
35
|
+
to build a competing product.
|
|
36
|
+
|
|
37
|
+
4. RESERVATION OF RIGHTS
|
|
38
|
+
All rights not expressly granted are reserved by XENO Corporation. The Software
|
|
39
|
+
is protected by copyright and other intellectual-property laws and treaties.
|
|
40
|
+
|
|
41
|
+
5. DISCLAIMER OF WARRANTY
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF ANY
|
|
43
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
44
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE
|
|
45
|
+
SOFTWARE EXECUTES AGENT-DIRECTED OPERATIONS AGAINST A USER-SELECTED WORKSPACE,
|
|
46
|
+
INCLUDING FILE AND PROCESS ACTIONS; THE USER IS RESPONSIBLE FOR THE WORKSPACES
|
|
47
|
+
AND PERMISSIONS THEY GRANT IT.
|
|
48
|
+
|
|
49
|
+
6. LIMITATION OF LIABILITY
|
|
50
|
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL XENO CORPORATION BE
|
|
51
|
+
LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, OR PUNITIVE
|
|
52
|
+
DAMAGES, OR ANY LOSS OF PROFITS OR DATA, ARISING FROM OR RELATED TO THE USE OF
|
|
53
|
+
OR INABILITY TO USE THE SOFTWARE.
|
|
54
|
+
|
|
55
|
+
7. THIRD-PARTY COMPONENTS
|
|
56
|
+
The Software includes third-party open-source components, each licensed under
|
|
57
|
+
its own terms; those terms govern those components and are not superseded by
|
|
58
|
+
this license. It also composes third-party agent providers over the Agent
|
|
59
|
+
Client Protocol and hosted APIs; use of those providers is governed by their
|
|
60
|
+
own terms.
|
|
61
|
+
|
|
62
|
+
For licensing inquiries, contact: legal@xenostudio.ai
|
|
63
|
+
|
|
64
|
+
NOTE TO OPERATOR: confirm the exact legal entity name and notice/contact details
|
|
65
|
+
with counsel before public distribution and code-signing (the code-signing
|
|
66
|
+
publisher name must match the registered entity). No public distribution of this
|
|
67
|
+
product is authorized by this file — see docs/PRODUCT_STATUS.md.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @xeno/agents-client — the SHARED, portable client for the hosted agent-runs API
|
|
3
|
+
* (`xeno-agents-api`, live at https://api.xenostudio.ai/v1/agents).
|
|
4
|
+
*
|
|
5
|
+
* CANONICAL. Every XENO product (Hub, the desktop apps, the web console, agents,
|
|
6
|
+
* SDKs) vendors THIS single file to dispatch and stream cloud agent runs — nobody
|
|
7
|
+
* re-implements the wire contract. It is the generalized, framework-agnostic
|
|
8
|
+
* distillation of the contract the XENO Agent CLI already speaks in its
|
|
9
|
+
* `remote.ts` (capability negotiation + start/list/get/stop/events/attach with
|
|
10
|
+
* SSE + NDJSON parsing). See `XENO AGENTS API - SPEC.md` §4–6.
|
|
11
|
+
*
|
|
12
|
+
* Zero dependencies. Works in Node ≥18, Electron (main or renderer) and browsers:
|
|
13
|
+
* uses only global `fetch`, `ReadableStream`, `TextDecoder`, `AbortController`.
|
|
14
|
+
* NO node-only imports, NO npm deps.
|
|
15
|
+
*
|
|
16
|
+
* Auth reality (2026-07): the server today accepts a platform **OIDC JWT**;
|
|
17
|
+
* **API-key support is being added separately** (§13 caveat). This client is
|
|
18
|
+
* auth-agnostic — it just sends `Authorization: Bearer <token>` — so it works with
|
|
19
|
+
* either the moment the server accepts it.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* import { createAgentsClient } from './xeno-agents-client';
|
|
23
|
+
* const agents = createAgentsClient({ token: myPlatformJwt });
|
|
24
|
+
* const run = await agents.createRun({ prompt: 'Fix the failing tests', model: 'gpt-5.5' });
|
|
25
|
+
* for await (const ev of agents.attach(run.runId)) console.log(ev.type, ev.payload);
|
|
26
|
+
* await agents.stopRun(run.runId);
|
|
27
|
+
*/
|
|
28
|
+
export declare const SCHEMA_VERSION: 1;
|
|
29
|
+
/** The 15-state AgentRunStatus union (SPEC §5.2 / D8), verbatim. */
|
|
30
|
+
export type RunStatus = "queued" | "starting" | "running" | "blocked" | "waiting_for_user" | "waiting_for_tool" | "waiting_for_hook" | "waiting_for_permission" | "paused" | "completed" | "failed" | "skipped" | "cancelled" | "interrupted" | "detached";
|
|
31
|
+
/** Terminal states — a run in one of these will never transition again. */
|
|
32
|
+
export declare const TERMINAL_STATUSES: ReadonlySet<RunStatus>;
|
|
33
|
+
export declare function isTerminalStatus(status: RunStatus): boolean;
|
|
34
|
+
/** Terminal lifecycle event types — the attach stream ends after one of these. */
|
|
35
|
+
export declare const TERMINAL_LIFECYCLE_EVENTS: ReadonlySet<string>;
|
|
36
|
+
export type PermissionMode = "default" | "plan" | "acceptEdits" | "auto" | "dontAsk" | "bypassPermissions";
|
|
37
|
+
export type Effort = "low" | "medium" | "high" | "xhigh" | "max";
|
|
38
|
+
export interface RunUsage {
|
|
39
|
+
input: number;
|
|
40
|
+
output: number;
|
|
41
|
+
total: number;
|
|
42
|
+
estimatedCostUsd?: number;
|
|
43
|
+
}
|
|
44
|
+
export interface RunGit {
|
|
45
|
+
branch?: string;
|
|
46
|
+
baseRef?: string;
|
|
47
|
+
commit?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface AgentRef {
|
|
50
|
+
name?: string;
|
|
51
|
+
scope?: string;
|
|
52
|
+
path?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
model?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface HostedReferences {
|
|
57
|
+
playbooks?: string[];
|
|
58
|
+
knowledge?: string[];
|
|
59
|
+
secrets?: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface RunBudget {
|
|
62
|
+
/** Hard cap; sizes the ledger hold (SPEC §8). */
|
|
63
|
+
maxCredits?: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Public projection of a run (SPEC §5.2, server `RunRecordPublic`). Host-local
|
|
67
|
+
* fields (absolute cwd, worker pid, stdout/stderr paths) are stripped server-side.
|
|
68
|
+
*/
|
|
69
|
+
export interface AgentRunRecord {
|
|
70
|
+
schemaVersion: typeof SCHEMA_VERSION;
|
|
71
|
+
runId: string;
|
|
72
|
+
sessionId: string;
|
|
73
|
+
rootRunId: string;
|
|
74
|
+
parentRunId?: string;
|
|
75
|
+
workspaceId: string;
|
|
76
|
+
prompt: string;
|
|
77
|
+
title?: string;
|
|
78
|
+
status: RunStatus;
|
|
79
|
+
statusReason?: string;
|
|
80
|
+
blockedReason?: string;
|
|
81
|
+
model: string;
|
|
82
|
+
effort?: Effort;
|
|
83
|
+
agent?: AgentRef;
|
|
84
|
+
permissionMode: PermissionMode;
|
|
85
|
+
createdAt: string;
|
|
86
|
+
updatedAt: string;
|
|
87
|
+
startedAt?: string;
|
|
88
|
+
endedAt?: string;
|
|
89
|
+
lastActivityAt?: string;
|
|
90
|
+
exitCode?: number;
|
|
91
|
+
git?: RunGit;
|
|
92
|
+
usage: RunUsage;
|
|
93
|
+
children: string[];
|
|
94
|
+
tags: string[];
|
|
95
|
+
creditsHeld?: number;
|
|
96
|
+
creditsSettled?: number;
|
|
97
|
+
url: string;
|
|
98
|
+
}
|
|
99
|
+
/** Compact list item (SPEC §4.3, server `RunListItem`). */
|
|
100
|
+
export interface RunListItem {
|
|
101
|
+
runId: string;
|
|
102
|
+
status: RunStatus;
|
|
103
|
+
url: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
model: string;
|
|
106
|
+
promptPreview: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Persisted, append-only run event (SPEC §5.3). `sequence` is a per-run monotonic
|
|
110
|
+
* integer assigned at append time — the SSE/NDJSON resume cursor.
|
|
111
|
+
*/
|
|
112
|
+
export interface RunEvent {
|
|
113
|
+
schemaVersion: typeof SCHEMA_VERSION;
|
|
114
|
+
runId: string;
|
|
115
|
+
sequence: number;
|
|
116
|
+
type: string;
|
|
117
|
+
timestamp: string;
|
|
118
|
+
/** The SDK runtime-event body. The wire nests all event data here. */
|
|
119
|
+
payload: Record<string, unknown>;
|
|
120
|
+
/** `model.text.delta` → the streamed text chunk. */
|
|
121
|
+
text?: string;
|
|
122
|
+
/** `tool.started` / `tool.completed` → the tool's name. */
|
|
123
|
+
toolName?: string;
|
|
124
|
+
/** `tool.started` → a truncated preview of the tool input. */
|
|
125
|
+
inputPreview?: Record<string, unknown>;
|
|
126
|
+
/** `tool.completed` → a truncated preview of the tool result. */
|
|
127
|
+
resultPreview?: unknown;
|
|
128
|
+
/** `turn.completed` → per-turn token totals. */
|
|
129
|
+
tokenUsage?: {
|
|
130
|
+
input: number;
|
|
131
|
+
output: number;
|
|
132
|
+
total: number;
|
|
133
|
+
};
|
|
134
|
+
/** `run.usage` → run token totals. */
|
|
135
|
+
usage?: {
|
|
136
|
+
input: number;
|
|
137
|
+
output: number;
|
|
138
|
+
total: number;
|
|
139
|
+
};
|
|
140
|
+
/** `run.usage` → credits actually settled for the run. */
|
|
141
|
+
creditsSettled?: number;
|
|
142
|
+
/** `turn.completed` → a short preview of the assistant output. */
|
|
143
|
+
outputPreview?: string;
|
|
144
|
+
/** `*.failed` → error/reason text. */
|
|
145
|
+
error?: string;
|
|
146
|
+
reason?: string;
|
|
147
|
+
/** `run.status` → the run's status/statusReason. */
|
|
148
|
+
status?: string;
|
|
149
|
+
statusReason?: string;
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The `XenoRuntimeEvent` kinds relayed verbatim in `RunEvent.payload` (SPEC §6.1,
|
|
154
|
+
* schema of record: xeno-agent-sdk `src/runtime/events.ts`). The canonical 12 kinds
|
|
155
|
+
* plus the SDK's additive extensions — additive-only per D3 (a wire type now).
|
|
156
|
+
*/
|
|
157
|
+
export type XenoRuntimeEventType = "thread.started" | "turn.started" | "turn.completed" | "turn.failed" | "turn.interrupted" | "query.state" | "query.watchdog" | "model.text.delta" | "tool.started" | "tool.permission" | "tool.completed" | "diff.completed" | "provider.event" | "tool.history.repaired" | "tool.failure_guard.tripped" | "turn.suspended" | "turn.continuation_enqueued" | "turn.continuation_resumed" | "turn.continuation_exhausted" | (string & {});
|
|
158
|
+
/**
|
|
159
|
+
* The SDK runtime-event envelope carried inside `RunEvent.payload` (its own
|
|
160
|
+
* `id/sequence/timestamp/threadId/turnId` is preserved for fidelity; the OUTER
|
|
161
|
+
* `RunEvent.sequence` is the durable cursor). Kept open (index signature) because
|
|
162
|
+
* per-kind payloads live in the SDK, not on the wire boundary.
|
|
163
|
+
*/
|
|
164
|
+
export interface XenoRuntimeEvent {
|
|
165
|
+
id?: string;
|
|
166
|
+
sequence?: number;
|
|
167
|
+
type: XenoRuntimeEventType;
|
|
168
|
+
timestamp?: string;
|
|
169
|
+
threadId?: string;
|
|
170
|
+
turnId?: string;
|
|
171
|
+
[key: string]: unknown;
|
|
172
|
+
}
|
|
173
|
+
/** Control-plane capability negotiation payload (SPEC §4.1). */
|
|
174
|
+
export interface AgentsApiStatus {
|
|
175
|
+
schemaVersion: typeof SCHEMA_VERSION;
|
|
176
|
+
ok: boolean;
|
|
177
|
+
service?: string;
|
|
178
|
+
version?: string;
|
|
179
|
+
capabilities: string[];
|
|
180
|
+
}
|
|
181
|
+
/** The v0.1 required capability set the CLI negotiates against (SPEC §4.1). */
|
|
182
|
+
export declare const REQUIRED_CAPABILITIES: readonly ["runs.start", "runs.list", "runs.get", "runs.events", "runs.attach", "runs.stop"];
|
|
183
|
+
export type AgentsApiErrorCode = "unauthorized" | "forbidden" | "run_not_found" | "not_found" | "insufficient_credits" | "budget_exceeded" | "invalid_request" | "rate_limited" | "http_error" | "network_error";
|
|
184
|
+
/** Typed API error carrying the server's error code + HTTP status. */
|
|
185
|
+
export declare class AgentsApiError extends Error {
|
|
186
|
+
readonly code: AgentsApiErrorCode;
|
|
187
|
+
readonly status: number;
|
|
188
|
+
/** True when caused by a fetch/abort/timeout rather than an HTTP response. */
|
|
189
|
+
readonly isNetwork: boolean;
|
|
190
|
+
readonly cause?: unknown;
|
|
191
|
+
constructor(code: AgentsApiErrorCode, message: string, status?: number, opts?: {
|
|
192
|
+
isNetwork?: boolean;
|
|
193
|
+
cause?: unknown;
|
|
194
|
+
});
|
|
195
|
+
get isBudgetExceeded(): boolean;
|
|
196
|
+
get isInsufficientCredits(): boolean;
|
|
197
|
+
get isUnauthorized(): boolean;
|
|
198
|
+
get isNotFound(): boolean;
|
|
199
|
+
}
|
|
200
|
+
export declare function isAgentsApiError(err: unknown): err is AgentsApiError;
|
|
201
|
+
export type TokenProvider = string | (() => string | null | undefined | Promise<string | null | undefined>);
|
|
202
|
+
export interface AgentsClientConfig {
|
|
203
|
+
/** Base of the agents API. Default `https://api.xenostudio.ai/v1/agents`. */
|
|
204
|
+
baseUrl?: string;
|
|
205
|
+
/** Platform bearer — an OIDC JWT or (once supported) a platform API key. */
|
|
206
|
+
token: TokenProvider;
|
|
207
|
+
/** Optional workspace selector → `x-xeno-workspace` header (SPEC §7). */
|
|
208
|
+
workspace?: string;
|
|
209
|
+
/** Optional fetch impl (custom / testing). Defaults to global fetch. */
|
|
210
|
+
fetchImpl?: typeof fetch;
|
|
211
|
+
/** Default timeout (ms) for non-streaming requests. Default 30_000. */
|
|
212
|
+
timeoutMs?: number;
|
|
213
|
+
}
|
|
214
|
+
/** Normalized input to run creation (SPEC §4.2, server `CreateRunInput`). */
|
|
215
|
+
export interface CreateRunInput {
|
|
216
|
+
/** Required, non-empty. */
|
|
217
|
+
prompt: string;
|
|
218
|
+
command?: string;
|
|
219
|
+
cwd?: string;
|
|
220
|
+
model?: string;
|
|
221
|
+
effort?: Effort;
|
|
222
|
+
/**
|
|
223
|
+
* What the run may DO — ENFORCED server-side since 2026-07-26. Omitted means
|
|
224
|
+
* `default`, under which Read/Glob/Grep are allowed and **Write/Edit are
|
|
225
|
+
* REFUSED** (a hosted run has no human to approve an edit, and an
|
|
226
|
+
* unanswerable prompt resolves to deny). `plan` and `auto` also refuse
|
|
227
|
+
* writes. `acceptEdits` is the narrowest mode that permits edits inside the
|
|
228
|
+
* run's jail; `bypassPermissions` is blanket autonomy over the granted tools.
|
|
229
|
+
*/
|
|
230
|
+
permissionMode?: PermissionMode;
|
|
231
|
+
/**
|
|
232
|
+
* Optional per-run tool grant. May only ever NARROW the server's ceiling
|
|
233
|
+
* (`Read`/`Write`/`Edit`/`Glob`/`Grep`/`WebFetch`) — naming a tool outside it
|
|
234
|
+
* is a 400 that names the offender, never a silent drop. Omit for the full
|
|
235
|
+
* default set.
|
|
236
|
+
*/
|
|
237
|
+
allowedTools?: string[];
|
|
238
|
+
title?: string;
|
|
239
|
+
environmentId?: string;
|
|
240
|
+
attempts?: number;
|
|
241
|
+
hostedReferences?: HostedReferences;
|
|
242
|
+
agent?: AgentRef;
|
|
243
|
+
workspace?: string;
|
|
244
|
+
/** Continuity (D2): seed context from a prior run. */
|
|
245
|
+
previousRunId?: string;
|
|
246
|
+
/** Hard credit cap; sizes the ledger hold (SPEC §8). */
|
|
247
|
+
budget?: RunBudget;
|
|
248
|
+
/** v0.2 git workspace provisioning. */
|
|
249
|
+
repo?: {
|
|
250
|
+
url?: string;
|
|
251
|
+
ref?: string;
|
|
252
|
+
};
|
|
253
|
+
/** Idempotency key → `Idempotency-Key` header. */
|
|
254
|
+
idempotencyKey?: string;
|
|
255
|
+
}
|
|
256
|
+
export interface ListRunsOptions {
|
|
257
|
+
limit?: number;
|
|
258
|
+
signal?: AbortSignal;
|
|
259
|
+
}
|
|
260
|
+
export interface EventsOptions {
|
|
261
|
+
/** Trailing N events. */
|
|
262
|
+
tail?: number;
|
|
263
|
+
/** Return events with `sequence > since`. Wins over `tail` if both set. */
|
|
264
|
+
since?: number;
|
|
265
|
+
signal?: AbortSignal;
|
|
266
|
+
}
|
|
267
|
+
export type AttachTransport = "ndjson" | "sse";
|
|
268
|
+
export interface AttachOptions {
|
|
269
|
+
/** Cursor: start from the trailing N events. */
|
|
270
|
+
tail?: number;
|
|
271
|
+
/** Cursor: resume from `sequence > since` (SSE `Last-Event-ID` / `?since`). */
|
|
272
|
+
since?: number;
|
|
273
|
+
/** Abort the stream. */
|
|
274
|
+
signal?: AbortSignal;
|
|
275
|
+
/** Wire transport. Default `ndjson`; `sse` sends `Accept: text/event-stream`. */
|
|
276
|
+
transport?: AttachTransport;
|
|
277
|
+
/**
|
|
278
|
+
* Auto-reconnect on a dropped stream, resuming from the last seen `sequence`.
|
|
279
|
+
* Default false. Stops after a terminal lifecycle event or when aborted.
|
|
280
|
+
*/
|
|
281
|
+
reconnect?: boolean;
|
|
282
|
+
/** Base backoff (ms) between reconnect attempts. Default 1000. */
|
|
283
|
+
reconnectDelayMs?: number;
|
|
284
|
+
/** Max reconnect attempts after a drop (per gap). Default 5. */
|
|
285
|
+
maxReconnects?: number;
|
|
286
|
+
}
|
|
287
|
+
export declare function createAgentsClient(config: AgentsClientConfig): {
|
|
288
|
+
/** Resolved base URL (with trailing path stripped). */
|
|
289
|
+
baseUrl: string;
|
|
290
|
+
/** GET /status — capability negotiation (SPEC §4.1). */
|
|
291
|
+
status: (opts?: {
|
|
292
|
+
signal?: AbortSignal;
|
|
293
|
+
}) => Promise<AgentsApiStatus>;
|
|
294
|
+
/** True iff the server advertises every required v0.1 capability. */
|
|
295
|
+
supportsRequiredCapabilities(opts?: {
|
|
296
|
+
signal?: AbortSignal;
|
|
297
|
+
}): Promise<boolean>;
|
|
298
|
+
/** POST /runs — create a durable, asynchronous run (SPEC §4.2). */
|
|
299
|
+
createRun(input: CreateRunInput, opts?: {
|
|
300
|
+
signal?: AbortSignal;
|
|
301
|
+
}): Promise<AgentRunRecord>;
|
|
302
|
+
/** GET /runs?limit=<n> — list the caller's runs (SPEC §4.3). */
|
|
303
|
+
listRuns(options?: ListRunsOptions): Promise<RunListItem[]>;
|
|
304
|
+
/** GET /runs/:id — fetch one run (SPEC §4.4). 404 → run_not_found. */
|
|
305
|
+
getRun(runId: string, opts?: {
|
|
306
|
+
signal?: AbortSignal;
|
|
307
|
+
}): Promise<AgentRunRecord>;
|
|
308
|
+
/** GET /runs/:id/events — event history, no follow (SPEC §4.5). */
|
|
309
|
+
getEvents(runId: string, options?: EventsOptions): Promise<RunEvent[]>;
|
|
310
|
+
/** POST /runs/:id/stop — graceful stop (SPEC §4.7). */
|
|
311
|
+
stopRun(runId: string, opts?: {
|
|
312
|
+
signal?: AbortSignal;
|
|
313
|
+
}): Promise<AgentRunRecord>;
|
|
314
|
+
attach: (runId: string, options?: AttachOptions) => AsyncGenerator<RunEvent, void, void>;
|
|
315
|
+
onEvent: (runId: string, handler: (event: RunEvent) => void | Promise<void>, options?: AttachOptions) => {
|
|
316
|
+
close: () => void;
|
|
317
|
+
done: Promise<void>;
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
export type AgentsClient = ReturnType<typeof createAgentsClient>;
|
|
321
|
+
export * from './modelCatalog.js';
|
|
322
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,eAAO,MAAM,cAAc,EAAG,CAAU,CAAC;AAEzC,oEAAoE;AACpE,MAA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