@aexhq/sdk 0.26.5 → 0.28.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/dist/_contracts/operations.d.ts +25 -1
- package/dist/_contracts/operations.js +115 -0
- package/dist/_contracts/runtime-types.d.ts +67 -0
- package/dist/_contracts/submission.d.ts +107 -62
- package/dist/_contracts/submission.js +154 -98
- package/dist/cli.mjs +106 -0
- package/dist/cli.mjs.sha256 +1 -1
- package/dist/client.d.ts +48 -16
- package/dist/client.js +72 -8
- package/dist/client.js.map +1 -1
- package/dist/data-tools.d.ts +56 -0
- package/dist/data-tools.js +149 -0
- package/dist/data-tools.js.map +1 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/concepts/agent-tools.md +45 -30
- package/docs/outputs.md +22 -0
- package/docs/run-config.md +1 -1
- package/docs/run-record.md +19 -0
- package/package.json +1 -1
|
@@ -1,40 +1,55 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Agent tools
|
|
3
|
-
description: The default
|
|
3
|
+
description: The default builtin tools available inside managed runs.
|
|
4
4
|
icon: TerminalSquare
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Managed runs
|
|
8
|
-
`
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- `
|
|
12
|
-
- `read
|
|
13
|
-
- `
|
|
14
|
-
- `
|
|
15
|
-
- `
|
|
16
|
-
- `
|
|
17
|
-
- `
|
|
18
|
-
- `bash
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
7
|
+
Managed runs inject a DX-first set of builtin tools to the agent by default. The
|
|
8
|
+
default set is every builtin tool EXCEPT `notebook_edit` (notebook editing is
|
|
9
|
+
opt-in). It includes:
|
|
10
|
+
|
|
11
|
+
- `bash`, `code_execution` — run shell commands / model-written snippets
|
|
12
|
+
- `read_file`, `write_file`, `edit_file` — file read/create/patch
|
|
13
|
+
- `grep`, `glob` — search file contents and paths
|
|
14
|
+
- `head`, `tail` — read bounded file slices
|
|
15
|
+
- `web_fetch`, `web_search` — fetch a URL / managed web search
|
|
16
|
+
- `todo_write` — maintain a todo list
|
|
17
|
+
- `subagent`, `subagent_result` — delegate to and read back from child runs
|
|
18
|
+
- `bash_output`, `bash_kill` — manage background bash jobs
|
|
19
|
+
- `wait`, `git` — bounded idle-yield and first-class git
|
|
20
|
+
|
|
21
|
+
## Toggling builtins
|
|
22
|
+
|
|
23
|
+
Set `includeBuiltinTools: false` to inject NO builtins — useful for a pure-MCP
|
|
24
|
+
or pure-custom run where every tool comes from `mcpServers` or `tools`.
|
|
25
|
+
|
|
26
|
+
`includeBuiltinTools` defaults to `true`.
|
|
27
|
+
|
|
28
|
+
## Cherry-picking builtins
|
|
29
|
+
|
|
30
|
+
The `tools` list accepts both custom tool bundles and BUILTIN tool references
|
|
31
|
+
(bare name strings, preferably `BuiltinTools.<name>`). Use a builtin reference
|
|
32
|
+
to add a tool the default set omits (notebook editing), or to pick a narrow
|
|
33
|
+
subset alongside `includeBuiltinTools: false`.
|
|
34
|
+
|
|
35
|
+
The final tool list is ordered: resolved builtin tools, then custom tools, then
|
|
36
|
+
MCP tools.
|
|
33
37
|
|
|
34
38
|
## Optional notebook support
|
|
35
39
|
|
|
36
|
-
`
|
|
37
|
-
|
|
40
|
+
`notebook_edit` edits Jupyter `.ipynb` cells as JSON. It is NOT in the default
|
|
41
|
+
builtin set; add it via `tools`:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { BuiltinTools, Models } from "@aexhq/sdk";
|
|
45
|
+
|
|
46
|
+
await aex.submit({
|
|
47
|
+
model: Models.CLAUDE_HAIKU_4_5,
|
|
48
|
+
prompt: "Edit the analysis notebook.",
|
|
49
|
+
tools: [BuiltinTools.notebook_edit],
|
|
50
|
+
secrets: { apiKey: process.env.ANTHROPIC_API_KEY! }
|
|
51
|
+
});
|
|
52
|
+
```
|
|
38
53
|
|
|
39
54
|
Networking is open by default. If you explicitly set
|
|
40
55
|
`environment.networking.mode` to `limited`, fetched hosts and the managed search
|
|
@@ -49,7 +64,7 @@ await aex.submit({
|
|
|
49
64
|
model: Models.CLAUDE_HAIKU_4_5,
|
|
50
65
|
prompt: "Use only the declared MCP tools.",
|
|
51
66
|
mcpServers,
|
|
52
|
-
|
|
67
|
+
includeBuiltinTools: false,
|
|
53
68
|
secrets: { apiKey: process.env.ANTHROPIC_API_KEY! }
|
|
54
69
|
});
|
|
55
70
|
```
|
package/docs/outputs.md
CHANGED
|
@@ -77,6 +77,28 @@ const looseReport = await aex.downloadOutput(runId, { path: "report.txt", match:
|
|
|
77
77
|
console.log(looseReport.byteLength);
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
## Reading one output as text
|
|
81
|
+
|
|
82
|
+
`readOutputText(runId, selector, options?)` reads ONE output file as byte-capped, decoded UTF-8 text. It streams the file and stops at `options.maxBytes` (default 50 KB, ceiling 10 MB), so a large deliverable never fully buffers — this is the read built for handing a run's output to an LLM tool. Select the file the same way as `downloadOutput`: by `{ path }` (suffix-matchable) or `{ id }`.
|
|
83
|
+
|
|
84
|
+
```ts
|
|
85
|
+
const { text, truncated, totalBytes } = await aex.readOutputText(
|
|
86
|
+
runId,
|
|
87
|
+
{ path: "report.md", match: "suffix" },
|
|
88
|
+
{ maxBytes: 50_000, grep: "error" }
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
if (truncated) {
|
|
92
|
+
// text is a prefix of a larger file — narrow with `grep` or a tighter `path`.
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Check `truncated` before treating `text` as complete. Pass `options.grep` (a substring or `RegExp`) to keep only matching lines of the capped text. The returned `output` is the matched `Output` record, and `totalBytes` is the file's full size when the server reports it.
|
|
97
|
+
|
|
98
|
+
### Chatting over a workspace's outputs
|
|
99
|
+
|
|
100
|
+
`createDataTools(client)` packages the read surface (`listRuns` + `listOutputs` + `readOutputText`) as a vendor-neutral LLM tool set (`{ tools, instructions, execute }`) so you can build a search-then-fetch chat over your runs and their outputs in a few lines on top of the public SDK. The `tools` are plain JSON-Schema definitions (the shape every major LLM tool API accepts); `execute(name, input)` dispatches a tool call against the workspace-scoped client. See the runnable `examples/data-chat/` example.
|
|
101
|
+
|
|
80
102
|
## Finding outputs
|
|
81
103
|
|
|
82
104
|
`listOutputs(runId, query?)` and its alias `outputs(runId, query?)` can filter the captured output list client-side. Use `findOutputs` when you want discovery to be explicit, or `findOutput` when exactly one file is expected:
|
package/docs/run-config.md
CHANGED
|
@@ -21,7 +21,7 @@ Allowed fields:
|
|
|
21
21
|
- `proxyEndpoints` - array of `PlatformProxyEndpoint`; endpoint-level `retry` is allowed here and remains declaration-based.
|
|
22
22
|
- `metadata` - non-secret structured metadata.
|
|
23
23
|
|
|
24
|
-
`agentsMd`, `files`, `outputs`, `
|
|
24
|
+
`agentsMd`, `files`, `outputs`, `tools`, `includeBuiltinTools`, and `outputMode` are top-level `submit` options, not run-config fields. They carry bytes, capture behavior, or agent tool/output controls that belong on a concrete run submission.
|
|
25
25
|
|
|
26
26
|
Secrets never live in run config. Pass credentials through `submit({ ...config, secrets })` in the SDK or the equivalent host-mode flags (`--anthropic-api-key`, `--mcp-auth`, `--proxy-auth`) in the CLI. See [Secrets](secrets.md) for secret lifecycles and [Credentials](credentials.md) for the proxy endpoint policy/auth split and retry fields.
|
|
27
27
|
|
package/docs/run-record.md
CHANGED
|
@@ -6,6 +6,25 @@ title: Run record
|
|
|
6
6
|
|
|
7
7
|
The run record is the durable product primitive for one run id. It is the public-safe bundle of status metadata, the non-secret submission snapshot when available, typed events, captured outputs, and manifest entries for custody and cost telemetry.
|
|
8
8
|
|
|
9
|
+
## Listing runs
|
|
10
|
+
|
|
11
|
+
`aex.listRuns(query?)` enumerates the runs in this workspace, most-recent first, one page at a time. The workspace is derived server-side from the API token, so this only ever returns your own runs. It is the workspace-wide discovery entry point: combine it with `listOutputs` / `readOutputText` (see [Outputs](outputs.md)) to reach any run's deliverables.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
let cursor: string | undefined;
|
|
15
|
+
do {
|
|
16
|
+
const page = await aex.listRuns({ status: "succeeded", limit: 25, cursor });
|
|
17
|
+
for (const run of page.runs) {
|
|
18
|
+
console.log(run.id, run.status, run.createdAt, run.costUsd);
|
|
19
|
+
}
|
|
20
|
+
cursor = page.nextCursor;
|
|
21
|
+
} while (cursor);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`query` fields are all optional: `status` (single run status, e.g. `"succeeded"`), `since` (ISO-8601 lower bound on `createdAt`), `limit` (defaults to 25, clamped to `[1, 100]`), and `cursor` (the opaque keyset cursor from a prior page's `nextCursor` — absent on the last page). Each page row is a public-safe `RunSummary` (`id`, `status`, `createdAt`, `updatedAt`, and `costUsd` once settled); it deliberately omits the submission snapshot (model / prompt / env). Use `aex.getRun(runId)` for status / timing / cost on one run, or `aex.getRunUnit(runId)` (alias `getUnit`) for the full self-contained record including the parsed submission.
|
|
25
|
+
|
|
26
|
+
## Downloading a run record
|
|
27
|
+
|
|
9
28
|
`aex.download(runId)` and `aex download <run-id>` return a zip with this layout:
|
|
10
29
|
|
|
11
30
|
```text
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aexhq/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "TypeScript SDK for running autonomous agent sessions across providers (Anthropic, OpenAI, DeepSeek, Gemini, Mistral) behind one interface.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|