@aexhq/sdk 0.26.4 → 0.27.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/index.js CHANGED
@@ -17,6 +17,10 @@ export { McpServer } from "./mcp-server.js";
17
17
  export { ProxyEndpoint } from "./proxy-endpoint.js";
18
18
  export { Secret } from "./secret.js";
19
19
  export { bundleSkillFiles, hashSkillBundle } from "./bundle.js";
20
+ // Data-source chat tools — turn the read surface (listRuns / listOutputs /
21
+ // readOutputText) into vendor-neutral LLM tool definitions + an executor, so a
22
+ // chat over workspace/run data is a few lines on top of the public SDK.
23
+ export { createDataTools, DataToolError, DATA_TOOLS_INSTRUCTIONS } from "./data-tools.js";
20
24
  // Errors
21
25
  export { AexApiError, AexError, CleanupError, CredentialValidationError, ProviderError, RunStateError } from "./_contracts/index.js";
22
26
  // Skill / MCP wire types
@@ -25,11 +29,11 @@ export { MCP_SERVER_NAME_PATTERN, SKILL_BUNDLE_LIMITS, SkillBundleValidationErro
25
29
  // Prefer the `RuntimeSizes` symbol const (e.g. `RuntimeSizes.SHARED_2X_2GB`)
26
30
  // so an invalid token is a compile error, not a runtime 400.
27
31
  export { CUSTODY_MANIFEST_SCHEMA_VERSION, RUN_RECORD_MANIFEST_SCHEMA_VERSION, RUN_RECORD_SCHEMA_VERSION, DEFAULT_RUNTIME_SIZE, RUNTIME_SIZE_PRESETS, RUNTIME_SIZES, RuntimeSizes } from "./_contracts/index.js";
28
- // Managed-runtime builtins — the default and closed builtin sets.
29
- // Prefer the `Builtins` symbol const (e.g.
30
- // `Builtins.WEB_SEARCH`) so an invalid token is a compile
31
- // error, not a runtime 400.
32
- export { DEFAULT_BUILTINS, BUILTINS, Builtins } from "./_contracts/index.js";
32
+ // Builtin tools — the closed + default builtin tool sets. Toggle the standard
33
+ // set with `includeBuiltinTools` on submit; cherry-pick individual tools by
34
+ // listing their names in `tools`. Prefer the `BuiltinTools` const (e.g.
35
+ // `BuiltinTools.notebook_edit`) so a typo is a compile error, not a runtime 400.
36
+ export { BUILTIN_TOOL_NAMES, BuiltinTools, DEFAULT_BUILTIN_TOOLS, resolveBuiltinToolNames } from "./_contracts/index.js";
33
37
  // Provider + runtime dispatch surface. Agents and SDK consumers
34
38
  // inspect these to know which (provider, runtime) combos are valid
35
39
  // and to validate submissions offline before posting.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AActG,yBAAyB;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASrC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAGhE,SAAS;AACT,OAAO,EACL,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B,yBAAyB;AACzB,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAqE1B,oEAAoE;AACpE,6EAA6E;AAC7E,6DAA6D;AAC7D,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACb,MAAM,kBAAkB,CAAC;AAG1B,kEAAkE;AAClE,2CAA2C;AAC3C,0DAA0D;AAC1D,4BAA4B;AAC5B,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGxE,gEAAgE;AAChE,mEAAmE;AACnE,sDAAsD;AACtD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,iCAAiC,EACjC,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAU1B,sCAAsC;AACtC,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,KAAK,EACL,UAAU,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,gFAAgF;AAChF,6EAA6E;AAC7E,iFAAiF;AACjF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAQ1B,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,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AAgE;AAChE,mEAAmE;AACnE,sDAAsD;AACtD,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,iCAAiC,EACjC,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAU1B,sCAAsC;AACtC,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,KAAK,EACL,UAAU,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAE1B,gFAAgF;AAChF,6EAA6E;AAC7E,iFAAiF;AACjF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAQ1B,mBAAmB;AACnB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/version.d.ts CHANGED
@@ -6,4 +6,4 @@
6
6
  *
7
7
  * Used by the (future) User-Agent header on outbound SDK requests.
8
8
  */
9
- export declare const SDK_VERSION = "0.26.4";
9
+ export declare const SDK_VERSION = "0.27.0";
package/dist/version.js CHANGED
@@ -6,5 +6,5 @@
6
6
  *
7
7
  * Used by the (future) User-Agent header on outbound SDK requests.
8
8
  */
9
- export const SDK_VERSION = "0.26.4";
9
+ export const SDK_VERSION = "0.27.0";
10
10
  //# sourceMappingURL=version.js.map
@@ -1,40 +1,55 @@
1
1
  ---
2
2
  title: Agent tools
3
- description: The default machine tools available inside managed runs.
3
+ description: The default builtin tools available inside managed runs.
4
4
  icon: TerminalSquare
5
5
  ---
6
6
 
7
- Managed runs expose a DX-first default builtin set to the agent. Omit
8
- `builtins` for the recommended defaults:
9
-
10
- - `web_search`
11
- - `web_fetch`
12
- - `read`
13
- - `edit`
14
- - `glob`
15
- - `grep`
16
- - `head`
17
- - `tail`
18
- - `bash`
19
-
20
- Pass `builtins: []` for a pure-MCP run with no builtins. Pass a custom list to
21
- narrow or extend the surface, for example adding the optional `notebook`
22
- builtin. MCP-derived tools and subagent tools are separate surfaces.
23
-
24
- ## Default filesystem and web tools
25
-
26
- - `read` and `edit` expose file read/create/patch tools.
27
- - `grep` and `glob` search file contents and paths.
28
- - `head` and `tail` read bounded file slices.
29
- - `bash` runs shell commands in the run sandbox.
30
- - `web_fetch` fetches a URL and returns readable text.
31
- - `web_search` performs managed web search without requiring a caller-supplied
32
- search key.
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
- `notebook` edits Jupyter `.ipynb` cells as JSON. It is accepted by the
37
- contract, but it is not in the default builtin list.
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
- builtins: [],
67
+ includeBuiltinTools: false,
53
68
  secrets: { apiKey: process.env.ANTHROPIC_API_KEY! }
54
69
  });
55
70
  ```
@@ -10,13 +10,31 @@ credentials. Reusable env secrets are documented separately in
10
10
 
11
11
  The caller passes a workspace-scoped SDK token and the provider key inline on every `submit` call. aex holds the bundle in run-scoped custody for the run lifecycle and attempts terminal cleanup/revocation for the aex-controlled references. MCP credentials and proxy endpoint auth values travel the same way.
12
12
 
13
- A run targets exactly one provider (selected by `provider`, default `anthropic`), so the key is a single flat field:
13
+ A run selects one upstream `provider` (default `anthropic`) and must carry a BYOK
14
+ key for it. Keys are supplied per-provider so a run can also hold keys for the
15
+ **other** providers its subagents may use:
14
16
 
15
17
  | Field | Required secret |
16
18
  | --- | --- |
17
- | Provider API key | `secrets.apiKey` |
19
+ | Provider API keys | `secrets.apiKeys` (keyed by provider) |
18
20
 
19
- The same `secrets.apiKey` carries the BYOK key for whichever `provider` the run selects.
21
+ ```ts
22
+ // The run's own provider key, plus extra keys its subagents can use.
23
+ secrets: {
24
+ apiKeys: {
25
+ anthropic: process.env.ANTHROPIC_API_KEY!, // the run's provider
26
+ deepseek: process.env.DEEPSEEK_API_KEY! // for a cross-provider subagent
27
+ }
28
+ }
29
+ ```
30
+
31
+ A `subagent` spawned with a different-family model **inherits the parent's keys
32
+ server-side** from the run's vaulted bundle — the keys never transit the
33
+ container. If the parent holds no key for the child's provider, the child submit
34
+ is rejected with `parent_missing_provider_key`.
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]`).
20
38
 
21
39
  MCP credential types:
22
40
 
@@ -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`, `builtins`, 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.
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexhq/sdk",
3
- "version": "0.26.4",
3
+ "version": "0.27.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": {
@@ -26,15 +26,19 @@
26
26
  "examples"
27
27
  ],
28
28
  "scripts": {
29
- "build": "bun ./scripts/clean-dist.mjs && bun run --cwd ../.. --filter @aexhq/contracts build && bun run --cwd ../.. --filter @aexhq/cli build && tsc -p tsconfig.build.json && bun ./scripts/bundle-cli.mjs && bun ./scripts/inline-contracts.mjs",
30
- "lint": "tsc --noEmit",
29
+ "build": "bun ../../scripts/with-generated-dist-lock.mjs bun run build:unlocked",
30
+ "build:unlocked": "bun ./scripts/clean-dist.mjs && bun run --cwd ../.. --filter @aexhq/contracts build && bun run --cwd ../.. --filter @aexhq/cli build && tsc -p tsconfig.build.json && bun ./scripts/bundle-cli.mjs && bun ./scripts/inline-contracts.mjs",
31
+ "lint": "bun ../../scripts/with-generated-dist-lock.mjs bun run lint:unlocked",
32
+ "lint:unlocked": "tsc --noEmit",
31
33
  "test": "bun run test:unit",
32
- "test:unit": "vitest run test/unit",
33
- "test:security": "vitest run test/security",
34
+ "test:unit": "bun ../../scripts/with-generated-dist-lock.mjs bun run test:unit:unlocked",
35
+ "test:unit:unlocked": "vitest run test/unit",
36
+ "test:security": "bun ../../scripts/with-generated-dist-lock.mjs bun run test:security:unlocked",
37
+ "test:security:unlocked": "vitest run test/security",
34
38
  "test:property": "vitest run --passWithNoTests property",
35
39
  "test:coverage": "vitest run --coverage test/unit",
36
40
  "prepack": "bun run build",
37
- "pack:dry-run": "bun pm pack --dry-run --ignore-scripts"
41
+ "pack:dry-run": "bun ../../scripts/with-generated-dist-lock.mjs bun pm pack --dry-run --ignore-scripts"
38
42
  },
39
43
  "devDependencies": {
40
44
  "@aexhq/contracts": "0.26.0"