@aexhq/sdk 0.29.0 → 0.31.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 +95 -8
- package/dist/_contracts/connection-ticket.d.ts +1 -1
- package/dist/_contracts/connection-ticket.js +1 -1
- package/dist/_contracts/event-envelope.d.ts +5 -8
- package/dist/_contracts/event-envelope.js +5 -6
- package/dist/_contracts/event-guards.d.ts +67 -0
- package/dist/_contracts/event-guards.js +36 -0
- package/dist/_contracts/event-stream-client.d.ts +1 -1
- package/dist/_contracts/http.js +1 -1
- package/dist/_contracts/index.d.ts +2 -0
- package/dist/_contracts/index.js +6 -0
- package/dist/_contracts/operations.d.ts +2 -47
- package/dist/_contracts/operations.js +7 -112
- package/dist/_contracts/provider-support.d.ts +48 -138
- package/dist/_contracts/provider-support.js +10 -41
- package/dist/_contracts/proxy-protocol.d.ts +7 -7
- package/dist/_contracts/proxy-protocol.js +8 -8
- package/dist/_contracts/run-config.d.ts +7 -20
- package/dist/_contracts/run-config.js +8 -46
- package/dist/_contracts/run-cost.d.ts +1 -5
- package/dist/_contracts/run-cost.js +0 -8
- package/dist/_contracts/run-custody.d.ts +4 -6
- package/dist/_contracts/run-custody.js +0 -8
- package/dist/_contracts/run-trace.d.ts +7 -0
- package/dist/_contracts/run-trace.js +9 -0
- package/dist/_contracts/run-unit.d.ts +1 -1
- package/dist/_contracts/run-unit.js +2 -2
- package/dist/_contracts/runner-event.d.ts +1 -1
- package/dist/_contracts/runner-event.js +1 -1
- package/dist/_contracts/runtime-manifest.d.ts +13 -26
- package/dist/_contracts/runtime-manifest.js +6 -35
- package/dist/_contracts/runtime-types.d.ts +32 -1
- package/dist/_contracts/sdk-secrets.js +4 -4
- package/dist/_contracts/side-effect-audit.d.ts +2 -4
- package/dist/_contracts/side-effect-audit.js +2 -4
- package/dist/_contracts/status.d.ts +1 -1
- package/dist/_contracts/status.js +1 -1
- package/dist/_contracts/submission.d.ts +19 -126
- package/dist/_contracts/submission.js +31 -185
- package/dist/_contracts/webhook-verify.d.ts +1 -1
- package/dist/_contracts/webhook-verify.js +1 -1
- package/dist/agents-md.d.ts +4 -1
- package/dist/agents-md.js +10 -9
- package/dist/agents-md.js.map +1 -1
- package/dist/asset-upload.d.ts +4 -10
- package/dist/asset-upload.js +4 -47
- package/dist/asset-upload.js.map +1 -1
- package/dist/cli.mjs +17647 -3950
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +79 -61
- package/dist/client.js +207 -125
- package/dist/client.js.map +1 -1
- package/dist/data-tools.d.ts +23 -0
- package/dist/data-tools.js +102 -13
- package/dist/data-tools.js.map +1 -1
- package/dist/file.d.ts +4 -1
- package/dist/file.js +10 -9
- package/dist/file.js.map +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/skill.d.ts +9 -7
- package/dist/skill.js +15 -15
- package/dist/skill.js.map +1 -1
- package/dist/tool.d.ts +4 -1
- package/dist/tool.js +10 -8
- package/dist/tool.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/cleanup.md +2 -2
- package/docs/concepts/agent-tools.md +9 -5
- package/docs/concepts/composition.md +1 -1
- package/docs/concepts/providers-and-runtimes.md +2 -4
- package/docs/concepts/runs.md +3 -6
- package/docs/credentials.md +2 -5
- package/docs/defaults.md +22 -22
- package/docs/events.md +32 -9
- package/docs/limits-and-quotas.md +40 -40
- package/docs/limits.md +1 -1
- package/docs/networking.md +141 -0
- package/docs/outputs.md +1 -1
- package/docs/provider-runtime-capabilities.md +36 -64
- package/docs/public-surface.json +2 -3
- package/docs/quickstart.md +32 -11
- package/docs/run-config.md +3 -4
- package/docs/secrets.md +7 -5
- package/docs/skills.md +4 -12
- package/docs/vision-skills.md +1 -1
- package/examples/chat-corpus.ts +85 -0
- package/package.json +2 -2
package/dist/skill.d.ts
CHANGED
|
@@ -36,7 +36,10 @@ export declare class Skill {
|
|
|
36
36
|
get ref(): AssetRef | DraftSkillRef;
|
|
37
37
|
/** True for local-bytes Skills that haven't been uploaded yet. */
|
|
38
38
|
get isDraft(): boolean;
|
|
39
|
-
|
|
39
|
+
/** Internal: the asset id resolved on a prior submit, or undefined. */
|
|
40
|
+
get _cachedAssetId(): string | undefined;
|
|
41
|
+
/** Internal: remember the asset id resolved for this draft's bytes. */
|
|
42
|
+
_rememberAsset(assetId: string): void;
|
|
40
43
|
/**
|
|
41
44
|
* Build a draft Skill from an inline files map. The SDK validates
|
|
42
45
|
* basic safety (no path traversal, size caps, has `SKILL.md`),
|
|
@@ -78,7 +81,7 @@ export declare class Skill {
|
|
|
78
81
|
}): Promise<Skill>;
|
|
79
82
|
/**
|
|
80
83
|
* Reference a skill already uploaded to the workspace catalog
|
|
81
|
-
* (`aex skills upload`
|
|
84
|
+
* (`aex skills upload`) in a run.
|
|
82
85
|
*
|
|
83
86
|
* A catalog skill's bytes are a content-addressed asset, so referencing it
|
|
84
87
|
* is just an `{ kind:"asset" }` ref — once a run snapshots the bytes, it is
|
|
@@ -96,11 +99,10 @@ export declare class Skill {
|
|
|
96
99
|
readonly hash?: string | null;
|
|
97
100
|
}): Skill;
|
|
98
101
|
/**
|
|
99
|
-
* Internal: yield the draft's bytes + metadata so `client.submit`
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* supported retry pattern).
|
|
102
|
+
* Internal: yield the draft's bytes + metadata so `client.submit` can upload
|
|
103
|
+
* the asset. Idempotent (non-consuming): a Skill is reusable across submits —
|
|
104
|
+
* the first submit caches the resolved asset id (see `_rememberAsset`) so
|
|
105
|
+
* later submits reuse it instead of re-uploading.
|
|
104
106
|
*
|
|
105
107
|
* Returns undefined for already-materialized Skills.
|
|
106
108
|
*/
|
package/dist/skill.js
CHANGED
|
@@ -25,7 +25,8 @@ import { readDirectoryAsFiles } from "./node-fs.js";
|
|
|
25
25
|
export class Skill {
|
|
26
26
|
#ref;
|
|
27
27
|
#inlineBytes;
|
|
28
|
-
|
|
28
|
+
/** Asset id cached after the first submit, so reuse skips a re-upload. */
|
|
29
|
+
#assetId;
|
|
29
30
|
/**
|
|
30
31
|
* Internal constructor. Use `Skill.fromFiles` or `Skill.fromPath` to create
|
|
31
32
|
* instances.
|
|
@@ -45,10 +46,15 @@ export class Skill {
|
|
|
45
46
|
}
|
|
46
47
|
/** True for local-bytes Skills that haven't been uploaded yet. */
|
|
47
48
|
get isDraft() {
|
|
48
|
-
return this.#ref.kind === "draft"
|
|
49
|
+
return this.#ref.kind === "draft";
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
/** Internal: the asset id resolved on a prior submit, or undefined. */
|
|
52
|
+
get _cachedAssetId() {
|
|
53
|
+
return this.#assetId;
|
|
54
|
+
}
|
|
55
|
+
/** Internal: remember the asset id resolved for this draft's bytes. */
|
|
56
|
+
_rememberAsset(assetId) {
|
|
57
|
+
this.#assetId = assetId;
|
|
52
58
|
}
|
|
53
59
|
/**
|
|
54
60
|
* Build a draft Skill from an inline files map. The SDK validates
|
|
@@ -112,7 +118,7 @@ export class Skill {
|
|
|
112
118
|
}
|
|
113
119
|
/**
|
|
114
120
|
* Reference a skill already uploaded to the workspace catalog
|
|
115
|
-
* (`aex skills upload`
|
|
121
|
+
* (`aex skills upload`) in a run.
|
|
116
122
|
*
|
|
117
123
|
* A catalog skill's bytes are a content-addressed asset, so referencing it
|
|
118
124
|
* is just an `{ kind:"asset" }` ref — once a run snapshots the bytes, it is
|
|
@@ -141,23 +147,17 @@ export class Skill {
|
|
|
141
147
|
return new Skill(ref);
|
|
142
148
|
}
|
|
143
149
|
/**
|
|
144
|
-
* Internal: yield the draft's bytes + metadata so `client.submit`
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* supported retry pattern).
|
|
150
|
+
* Internal: yield the draft's bytes + metadata so `client.submit` can upload
|
|
151
|
+
* the asset. Idempotent (non-consuming): a Skill is reusable across submits —
|
|
152
|
+
* the first submit caches the resolved asset id (see `_rememberAsset`) so
|
|
153
|
+
* later submits reuse it instead of re-uploading.
|
|
149
154
|
*
|
|
150
155
|
* Returns undefined for already-materialized Skills.
|
|
151
156
|
*/
|
|
152
157
|
_takeDraftBundle() {
|
|
153
|
-
if (this.#consumed) {
|
|
154
|
-
throw new Error("Skill: cannot reuse a consumed Skill in submit. Build a fresh Skill via " +
|
|
155
|
-
"Skill.fromPath(...) / Skill.fromFiles(...) per submit call.");
|
|
156
|
-
}
|
|
157
158
|
if (this.#ref.kind !== "draft" || !this.#inlineBytes) {
|
|
158
159
|
return undefined;
|
|
159
160
|
}
|
|
160
|
-
this.#consumed = true;
|
|
161
161
|
return {
|
|
162
162
|
name: this.#ref.name,
|
|
163
163
|
contentHash: this.#ref.contentHash,
|
package/dist/skill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAInB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,KAAK;IACP,IAAI,CAA2B;IAC/B,YAAY,CAAyB;IAC9C,
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAInB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEp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ACd,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACrD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACpB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW;YAClC,KAAK,EAAE,IAAI,CAAC,YAAY;SACzB,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,MAAM,CAAC,MAAqB;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,gEAAgE;gBAC9D,iDAAiD,CACpD,CAAC;QACJ,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;YACzC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,MAAM,CAAC,WAAW;YACxB,WAAW,EAAE,iBAAiB;SAC/B,CAAC,CAAC;QACH,MAAM,GAAG,GAAa,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QACtF,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC/B,MAAM,IAAI,KAAK,CACb,kFAAkF;gBAClF,8CAA8C,CAC/C,CAAC;QACJ,CAAC;QACD,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
package/dist/tool.d.ts
CHANGED
|
@@ -12,7 +12,10 @@ export declare class Tool {
|
|
|
12
12
|
private constructor();
|
|
13
13
|
get ref(): ToolRef | DraftToolRef;
|
|
14
14
|
get isDraft(): boolean;
|
|
15
|
-
|
|
15
|
+
/** Internal: the asset id resolved on a prior submit, or undefined. */
|
|
16
|
+
get _cachedAssetId(): string | undefined;
|
|
17
|
+
/** Internal: remember the asset id resolved for this draft's bytes. */
|
|
18
|
+
_rememberAsset(assetId: string): void;
|
|
16
19
|
static fromFiles(args: ToolManifestInput & {
|
|
17
20
|
readonly files: SkillFiles;
|
|
18
21
|
}): Promise<Tool>;
|
package/dist/tool.js
CHANGED
|
@@ -4,7 +4,8 @@ import { readDirectoryAsFiles } from "./node-fs.js";
|
|
|
4
4
|
export class Tool {
|
|
5
5
|
#ref;
|
|
6
6
|
#inlineBytes;
|
|
7
|
-
|
|
7
|
+
/** Asset id cached after the first submit, so reuse skips a re-upload. */
|
|
8
|
+
#assetId;
|
|
8
9
|
constructor(ref, inlineBytes) {
|
|
9
10
|
this.#ref = ref;
|
|
10
11
|
this.#inlineBytes = inlineBytes;
|
|
@@ -13,10 +14,15 @@ export class Tool {
|
|
|
13
14
|
return this.#ref;
|
|
14
15
|
}
|
|
15
16
|
get isDraft() {
|
|
16
|
-
return this.#ref.kind === "draft"
|
|
17
|
+
return this.#ref.kind === "draft";
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
/** Internal: the asset id resolved on a prior submit, or undefined. */
|
|
20
|
+
get _cachedAssetId() {
|
|
21
|
+
return this.#assetId;
|
|
22
|
+
}
|
|
23
|
+
/** Internal: remember the asset id resolved for this draft's bytes. */
|
|
24
|
+
_rememberAsset(assetId) {
|
|
25
|
+
this.#assetId = assetId;
|
|
20
26
|
}
|
|
21
27
|
static async fromFiles(args) {
|
|
22
28
|
if (!args || typeof args !== "object") {
|
|
@@ -60,13 +66,9 @@ export class Tool {
|
|
|
60
66
|
return new Tool(normalizeToolRef("Tool.fromAsset", ref));
|
|
61
67
|
}
|
|
62
68
|
_takeDraftBundle() {
|
|
63
|
-
if (this.#consumed) {
|
|
64
|
-
throw new Error("Tool: cannot reuse a consumed Tool in submit. Build a fresh Tool via Tool.fromPath(...) / Tool.fromFiles(...) per submit call.");
|
|
65
|
-
}
|
|
66
69
|
if (this.#ref.kind !== "draft" || !this.#inlineBytes) {
|
|
67
70
|
return undefined;
|
|
68
71
|
}
|
|
69
|
-
this.#consumed = true;
|
|
70
72
|
const { kind: _kind, contentHash, ...ref } = this.#ref;
|
|
71
73
|
return {
|
|
72
74
|
ref: { kind: "asset", ...ref },
|
package/dist/tool.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EAIzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,eAAe,EAGhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAUpD,MAAM,OAAO,IAAI;IACN,IAAI,CAAyB;IAC7B,YAAY,CAAyB;IAC9C,
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../src/tool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EAIzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,eAAe,EAGhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAUpD,MAAM,OAAO,IAAI;IACN,IAAI,CAAyB;IAC7B,YAAY,CAAyB;IAC9C,0EAA0E;IAC1E,QAAQ,CAAqB;IAE7B,YAAoB,GAA2B,EAAE,WAAwB;QACvE,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,IAAI,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK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EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAC;AAC9D,CAAC"}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/docs/cleanup.md
CHANGED
|
@@ -20,7 +20,7 @@ import { RunModels } from "@aexhq/sdk";
|
|
|
20
20
|
const runId = await aex.submit({
|
|
21
21
|
model: RunModels.CLAUDE_HAIKU_4_5,
|
|
22
22
|
prompt: "...",
|
|
23
|
-
secrets: {
|
|
23
|
+
secrets: { apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY! } }
|
|
24
24
|
});
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -33,7 +33,7 @@ run's tracked resources. It is one of:
|
|
|
33
33
|
- `pending` / `running` - cleanup is queued or in progress.
|
|
34
34
|
- `succeeded` - tracked cleanup work completed for the resources aex
|
|
35
35
|
controls.
|
|
36
|
-
- `failed_retryable` - a step failed in a way the cleanup
|
|
36
|
+
- `failed_retryable` - a step failed in a way the cleanup task will retry.
|
|
37
37
|
- `failed_terminal` - a step failed past retries; manual intervention may be
|
|
38
38
|
needed.
|
|
39
39
|
- `skipped` - cleanup was not applicable for a tracked resource, or the
|
|
@@ -47,13 +47,17 @@ await aex.submit({
|
|
|
47
47
|
model: Models.CLAUDE_HAIKU_4_5,
|
|
48
48
|
prompt: "Edit the analysis notebook.",
|
|
49
49
|
tools: [BuiltinTools.notebook_edit],
|
|
50
|
-
secrets: {
|
|
50
|
+
secrets: { apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY! } }
|
|
51
51
|
});
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
Networking is open by default
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
Networking is open by default: the agent may reach any public host, subject to a
|
|
55
|
+
fixed SSRF deny-list. `web_fetch` and `web_search` reach the network over a
|
|
56
|
+
managed, SSRF-guarded path that is **not** governed by `environment.networking`,
|
|
57
|
+
so their hosts never need to be listed in a `limited` allowlist. Setting
|
|
58
|
+
`environment.networking.mode` to `limited` restricts only the agent's own
|
|
59
|
+
arbitrary egress (e.g. a `curl` in `bash`); the built-in web tools keep working.
|
|
60
|
+
See [Networking](../networking.md).
|
|
57
61
|
|
|
58
62
|
## Disable builtins
|
|
59
63
|
|
|
@@ -65,6 +69,6 @@ await aex.submit({
|
|
|
65
69
|
prompt: "Use only the declared MCP tools.",
|
|
66
70
|
mcpServers,
|
|
67
71
|
includeBuiltinTools: false,
|
|
68
|
-
secrets: {
|
|
72
|
+
secrets: { apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY! } }
|
|
69
73
|
});
|
|
70
74
|
```
|
|
@@ -17,9 +17,7 @@ aex exposes one submission shape across supported providers:
|
|
|
17
17
|
| Doubao | `Providers.DOUBAO` |
|
|
18
18
|
| Doubao China | `Providers.DOUBAO_CN` |
|
|
19
19
|
|
|
20
|
-
All submissions run on the managed runtime.
|
|
21
|
-
`runtime: "managed"`; `runtime: "native"` is rejected before any runtime side
|
|
22
|
-
effect.
|
|
20
|
+
All submissions run on the managed runtime. There is no public runtime selector; omit `runtime`.
|
|
23
21
|
|
|
24
22
|
## Selection
|
|
25
23
|
|
|
@@ -32,7 +30,7 @@ await aex.submit({
|
|
|
32
30
|
provider: Providers.OPENAI,
|
|
33
31
|
model: Models.GPT_4_1,
|
|
34
32
|
prompt: "Summarise the attached files.",
|
|
35
|
-
secrets: {
|
|
33
|
+
secrets: { apiKeys: { openai: process.env.OPENAI_API_KEY! } }
|
|
36
34
|
});
|
|
37
35
|
```
|
|
38
36
|
|
package/docs/concepts/runs.md
CHANGED
|
@@ -19,7 +19,7 @@ const runId = await aex.submit({
|
|
|
19
19
|
provider: "anthropic",
|
|
20
20
|
model: Models.CLAUDE_HAIKU_4_5,
|
|
21
21
|
prompt: "Write the report and save it as a file.",
|
|
22
|
-
secrets: {
|
|
22
|
+
secrets: { apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY! } }
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
for await (const event of aex.stream(runId)) {
|
|
@@ -39,8 +39,5 @@ the normalized non-secret submission, so a retry with the same key and same body
|
|
|
39
39
|
returns the existing run while a mismatched body fails with an idempotency
|
|
40
40
|
conflict.
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
backing for the run; they are not exact city guarantees. When omitted, aex
|
|
45
|
-
infers a configured region from request geography and falls back when no hint
|
|
46
|
-
matches.
|
|
42
|
+
aex selects product placement server-side. There is no submit-time region
|
|
43
|
+
selector.
|
package/docs/credentials.md
CHANGED
|
@@ -33,9 +33,6 @@ server-side** from the run's vaulted bundle — the keys never transit the
|
|
|
33
33
|
container. If the parent holds no key for the child's provider, the child submit
|
|
34
34
|
is rejected with `parent_missing_provider_key`.
|
|
35
35
|
|
|
36
|
-
The flat `secrets.apiKey` is still accepted as a back-compat shorthand for the
|
|
37
|
-
run's own provider key (equivalent to `apiKeys[provider]`).
|
|
38
|
-
|
|
39
36
|
MCP credential types:
|
|
40
37
|
|
|
41
38
|
- `static_bearer`;
|
|
@@ -105,7 +102,7 @@ const runId = await aex.submit({
|
|
|
105
102
|
prompt: "…",
|
|
106
103
|
proxyEndpoints,
|
|
107
104
|
secrets: {
|
|
108
|
-
|
|
105
|
+
apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY! },
|
|
109
106
|
proxyEndpointAuth
|
|
110
107
|
}
|
|
111
108
|
});
|
|
@@ -143,7 +140,7 @@ const runId = await aex.submit({
|
|
|
143
140
|
model: RunModels.CLAUDE_HAIKU_4_5,
|
|
144
141
|
prompt: "…",
|
|
145
142
|
proxyEndpoints,
|
|
146
|
-
secrets: {
|
|
143
|
+
secrets: { apiKeys: { anthropic: process.env.ANTHROPIC_API_KEY! } }
|
|
147
144
|
});
|
|
148
145
|
```
|
|
149
146
|
|
package/docs/defaults.md
CHANGED
|
@@ -7,13 +7,12 @@ title: Defaults
|
|
|
7
7
|
These are the values aex applies when you **omit** the corresponding option on a
|
|
8
8
|
run. Every value is mirrored from a single source-of-truth constant; the
|
|
9
9
|
constant file is authoritative and this page is generated documentation, not a
|
|
10
|
-
second source of truth. If a value here ever disagrees with
|
|
10
|
+
second source of truth. If a value here ever disagrees with that constant,
|
|
11
11
|
the constant wins.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(runtime-
|
|
16
|
-
[`packages/contracts/src/runtime-sizes.ts`](https://github.com/aexhq/aex/blob/main/packages/contracts/src/runtime-sizes.ts)).
|
|
13
|
+
Each value below is named by its source-of-truth constant. The runtime-size
|
|
14
|
+
presets are defined in the public
|
|
15
|
+
[`packages/contracts/src/runtime-sizes.ts`](https://github.com/aexhq/aex/blob/main/packages/contracts/src/runtime-sizes.ts).
|
|
17
16
|
For the hard ceilings and who can raise them, see
|
|
18
17
|
[Limits & quotas](limits-and-quotas.md). For policy boundaries, see
|
|
19
18
|
[Limits](limits.md).
|
|
@@ -22,50 +21,51 @@ For the hard ceilings and who can raise them, see
|
|
|
22
21
|
|
|
23
22
|
| Option | Default | How to override | Source |
|
|
24
23
|
| --- | --- | --- | --- |
|
|
25
|
-
| `timeout` (run deadline) | 1 hour | Per-run via `options.timeout` (e.g. `"30m"`, `"2h"`), clamped to the run-timeout floor/ceiling. |
|
|
26
|
-
| `runtimeSize` (machine size) | `shared-0.25x-1gb` — 0.25 vCPU, 1 GB | Per-run via `options.runtimeSize` (use `RuntimeSizes.*` in TypeScript). |
|
|
27
|
-
| `postHook.timeout` | 60 minutes | Per-run via the hook's `timeoutMs`. |
|
|
28
|
-
| `postHook.maxTurns` (repair budget) | 10 turns | Per-run via the hook's `maxTurns`. |
|
|
24
|
+
| `timeout` (run deadline) | 1 hour | Per-run via `options.timeout` (e.g. `"30m"`, `"2h"`), clamped to the run-timeout floor/ceiling. | `RUN_DEFAULT_TIMEOUT_MS` |
|
|
25
|
+
| `runtimeSize` (machine size) | `shared-0.25x-1gb` — 0.25 vCPU, 1 GB | Per-run via `options.runtimeSize` (use `RuntimeSizes.*` in TypeScript). | `RUN_DEFAULT_RUNTIME_SIZE` |
|
|
26
|
+
| `postHook.timeout` | 60 minutes | Per-run via the hook's `timeoutMs`. | `RUN_DEFAULT_POST_HOOK_TIMEOUT_MS` |
|
|
27
|
+
| `postHook.maxTurns` (repair budget) | 10 turns | Per-run via the hook's `maxTurns`. | `RUN_DEFAULT_POST_HOOK_MAX_TURNS` |
|
|
28
|
+
| `limits.maxSpendUsd` (per-run spend cap) | None — no per-run spend cap (the run is still bounded by its `timeout` and any workspace-level cap) | Per-run via `options.limits.maxSpendUsd` (a positive USD amount); the run is stopped once its spend would exceed the cap. | — |
|
|
29
29
|
|
|
30
30
|
## Tools
|
|
31
31
|
|
|
32
32
|
| Option | Default | How to override | Source |
|
|
33
33
|
| --- | --- | --- | --- |
|
|
34
|
-
| Per-call exec timeout | 30 minutes | Per-call via the tool call's `timeoutMs`. |
|
|
35
|
-
| `web_fetch` returned body | 500 KB (UTF-8) | Per-call via the tool's `max_bytes` argument. |
|
|
34
|
+
| Per-call exec timeout | 30 minutes | Per-call via the tool call's `timeoutMs`. | `RUN_DEFAULT_EXEC_TIMEOUT_MS` |
|
|
35
|
+
| `web_fetch` returned body | 500 KB (UTF-8) | Per-call via the tool's `max_bytes` argument. | `REQUEST_WEB_FETCH_DEFAULT_MAX_BYTES` |
|
|
36
36
|
|
|
37
37
|
## MCP
|
|
38
38
|
|
|
39
39
|
| Option | Default | How to override | Source |
|
|
40
40
|
| --- | --- | --- | --- |
|
|
41
|
-
| MCP connect timeout (register + initialize + discover) | 30 seconds | Per-port via `connectTimeoutMs`. |
|
|
42
|
-
| MCP `tools/call` timeout | 30 minutes | Per-port via `callTimeoutMs`. |
|
|
41
|
+
| MCP connect timeout (register + initialize + discover) | 30 seconds | Per-port via `connectTimeoutMs`. | `RUN_DEFAULT_MCP_CONNECT_TIMEOUT_MS` |
|
|
42
|
+
| MCP `tools/call` timeout | 30 minutes | Per-port via `callTimeoutMs`. | `RUN_DEFAULT_MCP_CALL_TIMEOUT_MS` |
|
|
43
43
|
|
|
44
44
|
## Proxy endpoints
|
|
45
45
|
|
|
46
46
|
| Option | Default | How to override | Source |
|
|
47
47
|
| --- | --- | --- | --- |
|
|
48
|
-
| `maxRequestBytes` | 10 MiB | Per-endpoint via the endpoint's `maxRequestBytes`. |
|
|
49
|
-
| `maxResponseBytes` | `0` (unlimited — the response is streamed unbuffered) | Per-endpoint via the endpoint's `maxResponseBytes`. |
|
|
50
|
-
| `timeoutMs` (upstream) | 5 minutes | Per-endpoint via the endpoint's `timeoutMs`. |
|
|
48
|
+
| `maxRequestBytes` | 10 MiB | Per-endpoint via the endpoint's `maxRequestBytes`. | `REQUEST_PROXY_DEFAULT_MAX_REQUEST_BYTES` |
|
|
49
|
+
| `maxResponseBytes` | `0` (unlimited — the response is streamed unbuffered) | Per-endpoint via the endpoint's `maxResponseBytes`. | `REQUEST_PROXY_DEFAULT_MAX_RESPONSE_BYTES` |
|
|
50
|
+
| `timeoutMs` (upstream) | 5 minutes | Per-endpoint via the endpoint's `timeoutMs`. | `REQUEST_PROXY_DEFAULT_TIMEOUT_MS` |
|
|
51
51
|
|
|
52
52
|
## Links (signed URLs and tickets)
|
|
53
53
|
|
|
54
54
|
| Option | Default | How to override | Source |
|
|
55
55
|
| --- | --- | --- | --- |
|
|
56
|
-
| Output link / signed-URL TTL | 300 seconds (5 minutes) at the storage layer; `outputLink(...)` defaults to `"1h"` | Per-call via `expiresSeconds` (storage) or `expiresIn` on `outputLink` / `fetchOutput`. |
|
|
57
|
-
| Event-stream connection ticket TTL | 60 seconds | Per-mint via the `ttlMs` argument. |
|
|
56
|
+
| Output link / signed-URL TTL | 300 seconds (5 minutes) at the storage layer; `outputLink(...)` defaults to `"1h"` | Per-call via `expiresSeconds` (storage) or `expiresIn` on `outputLink` / `fetchOutput`. | `REQUEST_PRESIGN_URL_DEFAULT_TTL_SECONDS` |
|
|
57
|
+
| Event-stream connection ticket TTL | 60 seconds | Per-mint via the `ttlMs` argument. | `REQUEST_TICKET_DEFAULT_TTL_MS` |
|
|
58
58
|
|
|
59
59
|
## Subagents
|
|
60
60
|
|
|
61
61
|
| Option | Default | How to override | Source |
|
|
62
62
|
| --- | --- | --- | --- |
|
|
63
|
-
| Concurrent child runs per lineage root | 1000 (live, non-terminal child runs) | Per-run via `options.limits.maxConcurrentChildRuns`, clamped to the 4096 platform ceiling. |
|
|
64
|
-
| Max subagent depth | 5 | Per-run via `options.limits.maxSubagentDepth`, clamped to the same hard ceiling. |
|
|
63
|
+
| Concurrent child runs per lineage root | 1000 (live, non-terminal child runs) | Per-run via `options.limits.maxConcurrentChildRuns`, clamped to the 4096 platform ceiling. | `RUN_DEFAULT_MAX_CONCURRENT_CHILD_RUNS` |
|
|
64
|
+
| Max subagent depth | 5 | Per-run via `options.limits.maxSubagentDepth`, clamped to the same hard ceiling. | `RUN_MAX_PUBLIC_SUBAGENT_DEPTH` |
|
|
65
65
|
|
|
66
66
|
## Workspace
|
|
67
67
|
|
|
68
68
|
| Option | Default | How to override | Source |
|
|
69
69
|
| --- | --- | --- | --- |
|
|
70
|
-
| Per-workspace mutation rate limits (per minute) | run submit 60, run cancel 30, run delete 30, signed link 120, API token create 10, API token delete 30 | Per-plane via the matching `AEX_RATE_LIMIT_<ACTION>_PER_MINUTE` env var. |
|
|
71
|
-
| Workspace storage cap | 50 GiB | Per-plane via env `AEX_WORKSPACE_STORAGE_CAP_BYTES`; admin workspaces are uncapped (not a customer entitlement). |
|
|
70
|
+
| Per-workspace mutation rate limits (per minute) | run submit 60, run cancel 30, run delete 30, signed link 120, API token create 10, API token delete 30 | Per-plane via the matching `AEX_RATE_LIMIT_<ACTION>_PER_MINUTE` env var. | `WORKSPACE_RATE_LIMIT_DEFAULTS` |
|
|
71
|
+
| Workspace storage cap | 50 GiB | Per-plane via env `AEX_WORKSPACE_STORAGE_CAP_BYTES`; admin workspaces are uncapped (not a customer entitlement). | `WORKSPACE_DEFAULT_STORAGE_CAP_BYTES` |
|
package/docs/events.md
CHANGED
|
@@ -36,11 +36,23 @@ for await (const event of aex.streamEnvelopes(runId, { from: 0 })) {
|
|
|
36
36
|
The CLI mirrors the same surface:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
aex events
|
|
40
|
-
aex events
|
|
41
|
-
aex
|
|
39
|
+
aex events <run-id> --api-token … [--aex-url …] # snapshot (polling)
|
|
40
|
+
aex events <run-id> --follow [--timeout 8m] --api-token … [--aex-url …] # stream until terminal (polling)
|
|
41
|
+
aex tail <run-id> [--json] [--filter <type|source>] [--logs] [--settle] [--timeout 8m] --api-token … # live, human-readable, over the WS envelope stream
|
|
42
|
+
aex inspect <run-id> [--json] [--filter <type|source>] [--logs] [--timeout 8m] --api-token … # one-shot full timeline + jump-to-failure + cost/usage
|
|
43
|
+
aex wait <run-id> [--timeout 8m] [--interval 2s] --api-token … # block, print final run
|
|
42
44
|
```
|
|
43
45
|
|
|
46
|
+
`aex tail` and `aex inspect` consume the same coordinator WebSocket envelope
|
|
47
|
+
stream as `streamEnvelopes()` (replay-from-cursor + tail + exactly-once resume),
|
|
48
|
+
so they are the low-latency equivalents of `events --follow`'s polling. `--json`
|
|
49
|
+
is the raw-NDJSON escape hatch; `--filter` keeps only the named AG-UI types
|
|
50
|
+
(`TEXT_MESSAGE_CONTENT`, `TOOL_CALL_START`, …) or sources (`agent`/`runtime`/…);
|
|
51
|
+
a `RUN_ERROR` is surfaced as a jump-to-failure line. `aex inspect` adds a header,
|
|
52
|
+
a settle-consistent full timeline, and a cost/usage footer. Both exit `0`
|
|
53
|
+
succeeded / `1` other terminal / `3` timeout. They need a global `WebSocket`
|
|
54
|
+
(Bun or Node ≥ 22).
|
|
55
|
+
|
|
44
56
|
`aex wait` is the host mirror of `aex.wait(runId)` / `aex.waitForRun(runId)`:
|
|
45
57
|
it polls until the run reaches a terminal status and prints the final `Run`
|
|
46
58
|
record. Exit `0` when the run `succeeded`, `1` for any other terminal status,
|
|
@@ -69,9 +81,11 @@ Two facts make this easy to work with:
|
|
|
69
81
|
consistently, don't key off the terminal event — use one of:
|
|
70
82
|
|
|
71
83
|
```ts
|
|
72
|
-
// Blocking:
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
// Blocking: submit + wait + collect. Resolves once the RECORD is terminal
|
|
85
|
+
// (polls getRun, not the event) and returns a settle-consistent RunResult
|
|
86
|
+
// (status, ok, text, events, trace, outputs, costUsd).
|
|
87
|
+
const result = await aex.run(runConfig);
|
|
88
|
+
const sameRun = await aex.waitForRun(runId); // or wait on an already-submitted run for the bare Run record
|
|
75
89
|
```
|
|
76
90
|
|
|
77
91
|
```ts
|
|
@@ -112,7 +126,7 @@ terminal event is `RUN_ERROR` with `data.reason: "failed"` and
|
|
|
112
126
|
|
|
113
127
|
## Typed helpers
|
|
114
128
|
|
|
115
|
-
The package exports conservative type guards
|
|
129
|
+
The package exports conservative type guards over run events:
|
|
116
130
|
|
|
117
131
|
```ts
|
|
118
132
|
import {
|
|
@@ -126,8 +140,17 @@ import {
|
|
|
126
140
|
isToolCallResult,
|
|
127
141
|
isCustom,
|
|
128
142
|
isLog,
|
|
129
|
-
isEventChannel
|
|
143
|
+
isEventChannel,
|
|
144
|
+
textOf
|
|
130
145
|
} from "@aexhq/sdk";
|
|
131
146
|
```
|
|
132
147
|
|
|
133
|
-
|
|
148
|
+
All guards test the `type` discriminant at runtime. `isTextMessage`,
|
|
149
|
+
`isToolCallStart`, `isToolCallResult`, and `isRunFinished` operate on the loose
|
|
150
|
+
`RunEvent` snapshot (`listEvents` / `RunResult.events`) and additionally NARROW
|
|
151
|
+
`event.data` to the fields that event type carries — e.g. inside
|
|
152
|
+
`if (isTextMessage(e))`, `e.data.text` is typed `string`. The lifecycle/channel
|
|
153
|
+
guards (`isRunStarted`, `isRunError`, `isCustom`, `isLog`, …) operate on the
|
|
154
|
+
coordinator envelope and narrow only the discriminant. `textOf(events)` returns
|
|
155
|
+
the run's final assistant text concatenated from the `TEXT_MESSAGE_CONTENT`
|
|
156
|
+
blocks.
|