@aexhq/sdk 0.34.0 → 0.36.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 +16 -15
- package/dist/_contracts/index.d.ts +3 -4
- package/dist/_contracts/index.js +1 -4
- package/dist/_contracts/operations.d.ts +2 -1
- package/dist/_contracts/operations.js +10 -0
- package/dist/_contracts/run-config.d.ts +1 -3
- package/dist/_contracts/run-config.js +2 -7
- package/dist/_contracts/run-trace.d.ts +0 -86
- package/dist/_contracts/run-trace.js +1 -184
- package/dist/_contracts/run-unit.d.ts +2 -25
- package/dist/_contracts/run-unit.js +1 -2
- package/dist/_contracts/runtime-manifest.d.ts +1 -1
- package/dist/_contracts/runtime-security-profile.d.ts +0 -2
- package/dist/_contracts/runtime-security-profile.js +0 -9
- package/dist/_contracts/runtime-types.d.ts +25 -4
- package/dist/_contracts/stable.d.ts +1 -1
- package/dist/_contracts/stable.js +1 -1
- package/dist/_contracts/submission.d.ts +62 -95
- package/dist/_contracts/submission.js +59 -482
- package/dist/cli.mjs +99 -442
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +49 -25
- package/dist/client.js +341 -70
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +9 -15
- package/dist/index.js +11 -17
- package/dist/index.js.map +1 -1
- package/dist/retry.d.ts +162 -0
- package/dist/retry.js +320 -0
- package/dist/retry.js.map +1 -0
- package/dist/secret.d.ts +2 -2
- package/dist/secret.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/concepts/composition.md +8 -14
- package/docs/credentials.md +59 -101
- package/docs/defaults.md +0 -8
- package/docs/events.md +8 -9
- package/docs/limits-and-quotas.md +1 -4
- package/docs/limits.md +2 -6
- package/docs/mcp.md +4 -5
- package/docs/networking.md +6 -16
- package/docs/outputs.md +0 -4
- package/docs/public-surface.json +3 -3
- package/docs/quickstart.md +3 -7
- package/docs/retries.md +129 -0
- package/docs/run-config.md +6 -3
- package/docs/secrets.md +1 -1
- package/docs/skills.md +3 -3
- package/docs/vision-skills.md +52 -101
- package/examples/feature-tour.ts +284 -0
- package/package.json +1 -1
- package/dist/_contracts/proxy-protocol.d.ts +0 -305
- package/dist/_contracts/proxy-protocol.js +0 -297
- package/dist/_contracts/proxy-validation.d.ts +0 -19
- package/dist/_contracts/proxy-validation.js +0 -51
- package/dist/data-tools.d.ts +0 -82
- package/dist/data-tools.js +0 -251
- package/dist/data-tools.js.map +0 -1
- package/dist/proxy-endpoint.d.ts +0 -131
- package/dist/proxy-endpoint.js +0 -144
- package/dist/proxy-endpoint.js.map +0 -1
- package/examples/chat-corpus.ts +0 -84
package/dist/cli.mjs.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
07c9307bf82f025b845d4495eb41039ac3f684c4a75244af85871809206bf704 cli.mjs
|
package/dist/client.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { HttpClient, SecretString, type AexEvent, type AgentsMdRecord, type
|
|
1
|
+
import { HttpClient, SecretString, type AexEvent, type AgentsMdRecord, type DebugSink, type FetchLike, type FileRecord, type Output, type OutputFileType, type OutputLink, type OutputLinkOptions, type OutputQuery, type OutputText, type OutputMode, type ReadOutputTextOptions, type OutputSearchQuery, type OutputSearchPage, type Session, type SessionCreateRequest, type SessionEvent, type SessionListPage, type SessionListQuery, type SessionMessage, type SessionStateChangeAccepted, type SessionTurn, type PlatformEnvironmentInput, type PlatformSubmission, type Run, type RunModel, type RunEvent, type RunTrace, type UsageSummary, type RunWebhookDelivery, type RunProvider, type SecretRecord, type RunUnit, type BuiltinToolName, type RuntimeSize, type WebSocketFactory, type WhoAmI } from "./_contracts/index.js";
|
|
2
2
|
import { AgentsMd } from "./agents-md.js";
|
|
3
3
|
import { type UploadedAsset } from "./asset-upload.js";
|
|
4
4
|
import { File } from "./file.js";
|
|
5
5
|
import { McpServer } from "./mcp-server.js";
|
|
6
|
-
import {
|
|
6
|
+
import { type RetryOptions } from "./retry.js";
|
|
7
7
|
import { Secret } from "./secret.js";
|
|
8
8
|
import { SkillTool } from "./skill-tool.js";
|
|
9
9
|
import { Tool } from "./tool.js";
|
|
10
|
-
export interface
|
|
10
|
+
export interface AexOptions {
|
|
11
11
|
/** Workspace-scoped SDK API token. */
|
|
12
|
-
readonly
|
|
12
|
+
readonly apiKey?: string;
|
|
13
|
+
/** @deprecated Use `apiKey`; kept as a source-compatible alias during launch. */
|
|
14
|
+
readonly apiToken?: string;
|
|
13
15
|
/**
|
|
14
16
|
* API plane root, e.g. `https://aex.example.com`. Optional —
|
|
15
17
|
* defaults to the canonical hosted URL (`https://api.aex.dev`).
|
|
@@ -24,9 +26,19 @@ export interface AgentExecutorOptions {
|
|
|
24
26
|
* route the traces elsewhere. Purely local — nothing is uploaded.
|
|
25
27
|
*/
|
|
26
28
|
readonly debug?: boolean | DebugSink;
|
|
29
|
+
/**
|
|
30
|
+
* Built-in transport retry policy. Every BFF request is retried on transient
|
|
31
|
+
* failures (HTTP 429/500/502/503/504/529 and network errors) with bounded
|
|
32
|
+
* exponential backoff + jitter, honoring `Retry-After`. Billable submits carry
|
|
33
|
+
* a stable idempotency key, so a retry never creates a duplicate billable run.
|
|
34
|
+
*
|
|
35
|
+
* Omit for sensible defaults (4 attempts, ~2 min budget); pass an object to
|
|
36
|
+
* tune `maxAttempts` / delays / `maxElapsedMs`; pass `false` to disable.
|
|
37
|
+
*/
|
|
38
|
+
readonly retry?: RetryOptions | false;
|
|
27
39
|
}
|
|
28
40
|
/**
|
|
29
|
-
* The settle-consistent result of {@link
|
|
41
|
+
* The settle-consistent result of {@link Aex.run}:
|
|
30
42
|
* the one-shot session record plus its events, decoded trace, assistant text,
|
|
31
43
|
* and captured outputs — everything a "do it and give me the result" caller
|
|
32
44
|
* needs without hand-rolling a session/message/stream loop.
|
|
@@ -46,6 +58,8 @@ export interface RunResult {
|
|
|
46
58
|
readonly ok: boolean;
|
|
47
59
|
/** The assistant's final text. */
|
|
48
60
|
readonly text: string;
|
|
61
|
+
/** Assistant messages projected from the settled event stream. */
|
|
62
|
+
readonly messages: readonly Message[];
|
|
49
63
|
/** The session turn event stream. */
|
|
50
64
|
readonly events: readonly RunEvent[];
|
|
51
65
|
/** Decoded view of the events: tool calls + usage + assistant text. */
|
|
@@ -59,7 +73,7 @@ export interface RunResult {
|
|
|
59
73
|
/** The run's error message when `!ok`. */
|
|
60
74
|
readonly error?: string;
|
|
61
75
|
}
|
|
62
|
-
/** Options for {@link
|
|
76
|
+
/** Options for {@link Aex.run}. */
|
|
63
77
|
export interface RunCollectOptions {
|
|
64
78
|
/** Overall wait budget (ms) for the one-shot session turn to park. */
|
|
65
79
|
readonly timeoutMs?: number;
|
|
@@ -91,9 +105,8 @@ export interface SessionOverrides {
|
|
|
91
105
|
* - `agentsMd` / `files` — local composition instances
|
|
92
106
|
* (`AgentsMd.fromContent` / `File.fromBytes`, …), materialized to the
|
|
93
107
|
* hosted asset store before the session lands.
|
|
94
|
-
* - `mcpServers`
|
|
95
|
-
*
|
|
96
|
-
* only the declarations.
|
|
108
|
+
* - `mcpServers` — instances whose secrets are split into the vaulted secrets
|
|
109
|
+
* channel server-side; the public submission carries only the declarations.
|
|
97
110
|
* - `apiKeys` — the BYOK provider key(s), keyed by provider. A key for the
|
|
98
111
|
* selected provider is REQUIRED. The platform never holds a long-lived
|
|
99
112
|
* provider key on your behalf.
|
|
@@ -147,7 +160,6 @@ export interface SessionCreateOptions {
|
|
|
147
160
|
readonly outputMode?: OutputMode;
|
|
148
161
|
readonly metadata?: PlatformSubmission["metadata"];
|
|
149
162
|
readonly idempotencyKey?: string;
|
|
150
|
-
readonly proxyEndpoints?: readonly ProxyEndpoint[];
|
|
151
163
|
/** BYOK provider key(s), keyed by provider. */
|
|
152
164
|
readonly apiKeys?: Partial<Record<RunProvider, string>>;
|
|
153
165
|
readonly environment?: SessionEnvironmentOptions;
|
|
@@ -188,6 +200,7 @@ export interface SessionTurnResult {
|
|
|
188
200
|
readonly text: string;
|
|
189
201
|
readonly events: readonly SessionEvent[];
|
|
190
202
|
readonly outputs: readonly Output[];
|
|
203
|
+
readonly messages: readonly Message[];
|
|
191
204
|
}
|
|
192
205
|
export interface SessionRunResult extends SessionTurnResult {
|
|
193
206
|
}
|
|
@@ -197,14 +210,18 @@ export declare class SessionTurnStream implements AsyncIterable<SessionEvent> {
|
|
|
197
210
|
[Symbol.asyncIterator](): AsyncIterator<SessionEvent>;
|
|
198
211
|
done(): Promise<SessionTurnResult>;
|
|
199
212
|
}
|
|
213
|
+
type CallableSessionMessages = SessionMessages & (() => SessionMessages);
|
|
214
|
+
export type Message = SessionMessage;
|
|
200
215
|
/**
|
|
201
|
-
* Accessor over the session's
|
|
202
|
-
*
|
|
216
|
+
* Accessor over the session's assistant messages. `session.messages` returns
|
|
217
|
+
* this synchronously; each method fetches on call.
|
|
203
218
|
*/
|
|
204
219
|
export interface SessionMessages {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
220
|
+
all(): Promise<readonly Message[]>;
|
|
221
|
+
/** Compatibility alias for {@link SessionMessages.all}. */
|
|
222
|
+
list(): Promise<readonly Message[]>;
|
|
223
|
+
last(): Promise<Message | undefined>;
|
|
224
|
+
first(): Promise<Message | undefined>;
|
|
208
225
|
}
|
|
209
226
|
/**
|
|
210
227
|
* Accessor over the session's event stream (`session.events()`): the buffered
|
|
@@ -250,16 +267,25 @@ export declare class SessionHandle {
|
|
|
250
267
|
get id(): string;
|
|
251
268
|
get record(): Session;
|
|
252
269
|
send(input: SessionInput, options?: SessionSendOptions): SessionTurnStream;
|
|
270
|
+
/**
|
|
271
|
+
* Re-send the last message on this session — the clean way to retry a turn a
|
|
272
|
+
* throttle or transient failure interrupted. By default it REUSES the previous
|
|
273
|
+
* message's idempotency key, so if the original turn actually landed
|
|
274
|
+
* server-side the replay de-duplicates instead of creating a second billable
|
|
275
|
+
* turn; pass a fresh `idempotencyKey` to force a brand-new turn.
|
|
276
|
+
*/
|
|
277
|
+
replayLast(options?: SessionSendOptions): SessionTurnStream;
|
|
253
278
|
suspend(options?: Pick<SessionSendOptions, "idempotencyKey">): Promise<SessionStateChangeAccepted>;
|
|
254
279
|
cancel(options?: Pick<SessionSendOptions, "idempotencyKey">): Promise<SessionStateChangeAccepted>;
|
|
255
280
|
resume(options?: Pick<SessionSendOptions, "idempotencyKey">): Promise<SessionStateChangeAccepted>;
|
|
256
281
|
delete(options?: Pick<SessionSendOptions, "idempotencyKey">): Promise<void>;
|
|
257
282
|
/**
|
|
258
|
-
* Accessor for the session's
|
|
259
|
-
*
|
|
260
|
-
*
|
|
283
|
+
* Accessor for the session's assistant messages. `all()` returns them
|
|
284
|
+
* oldest-first; `last()`/`first()` return a single entry or `undefined` when
|
|
285
|
+
* empty. The accessor is callable as a compatibility shim for older
|
|
286
|
+
* `session.messages().list()` callers.
|
|
261
287
|
*/
|
|
262
|
-
messages():
|
|
288
|
+
get messages(): CallableSessionMessages;
|
|
263
289
|
/**
|
|
264
290
|
* Accessor for the session's event stream: the buffered `SessionEvent`
|
|
265
291
|
* snapshots (`list`/`last`/`first`), the polling `RunEvent` iterator
|
|
@@ -454,13 +480,14 @@ export declare class SecretsClient {
|
|
|
454
480
|
* `client.whoami()` if you want to introspect which workspace the
|
|
455
481
|
* token resolves to.
|
|
456
482
|
*/
|
|
457
|
-
export declare class
|
|
483
|
+
export declare class Aex {
|
|
458
484
|
#private;
|
|
459
485
|
readonly agentsMd: AgentsMdClient;
|
|
460
486
|
readonly files: FilesClient;
|
|
461
487
|
readonly secrets: SecretsClient;
|
|
462
488
|
readonly sessions: SessionClient;
|
|
463
|
-
constructor(
|
|
489
|
+
constructor(apiKey: string, options?: Omit<AexOptions, "apiKey" | "apiToken">);
|
|
490
|
+
constructor(options: AexOptions);
|
|
464
491
|
/**
|
|
465
492
|
* Internal: satisfies the `SecretUploader` surface so a
|
|
466
493
|
* `Secret.value(...).upload(client, { name })` promotes an ephemeral secret
|
|
@@ -503,7 +530,4 @@ export declare class AgentExecutor {
|
|
|
503
530
|
deleteWorkspaceAsset(hash: string): Promise<void>;
|
|
504
531
|
whoami(): Promise<WhoAmI>;
|
|
505
532
|
}
|
|
506
|
-
|
|
507
|
-
export declare class Aex extends AgentExecutor {
|
|
508
|
-
}
|
|
509
|
-
export type { OutputFileType, OutputLink, OutputLinkOptions, OutputQuery, PlatformProxyEndpoint, PlatformProxyEndpointAuth };
|
|
533
|
+
export type { OutputFileType, OutputLink, OutputLinkOptions, OutputQuery };
|