@aexhq/sdk 0.71.0 → 0.73.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.
Files changed (2) hide show
  1. package/README.md +30 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -10,11 +10,23 @@ console.log(await aex.account.get());
10
10
  ```
11
11
 
12
12
  `Aex` extends the pinned Brain client. Its sessions, registration, Events, Components and
13
- extension builders are Brain's implementations. SDK 0.71 uses Brain 0.20 and official
14
- extension packages 5.x. Rebuild custom Wasm Components against Brain 0.20's WIT; older
15
- Components and session configurations are not migrated automatically. See https://aex.dev/docs
13
+ extension builders are Brain's implementations. SDK 0.73 uses Brain SDK 0.22 and Pi/Codex/Tools
14
+ 5.1. Brain 0.22 retains the existing Wasm interface. Components and session configurations are
15
+ not migrated automatically. See https://aex.dev/docs
16
16
  for a complete session example.
17
17
 
18
+ Host Tools return ordinary successful output or a Brain `Outcome` directly. Structured errors retain
19
+ code, message, retryable and details. The top-level statuses `ok`, `error`, `timeout`, `cancelled`
20
+ and `unknown` declare outcomes; malformed envelopes fail validation, and only successful values
21
+ pass through the output schema. Tool deadlines produce `timeout`, explicit cancellation produces
22
+ `cancelled`, and missing reliable results after dispatch produce `unknown`. All are failed Tool
23
+ results. Timeout and cancellation do not promise rollback. See
24
+ [the full return contract](https://aex.dev/brain/docs/guides/write-a-tool#return-values-and-outcomes).
25
+
26
+ `@aexhq/tools-mcp` runs selected MCP Tools in your application host, preserving structured failures
27
+ and original JSON Schema constraints. The official Docker and browser HTTP Environments target
28
+ standalone Brain and require operator deployment. See [official extensions](https://github.com/aexhq/extensions).
29
+
18
30
  Place uploaded Wasm Agentloops and Tools in `brainEnv` for hosted execution. `hostEnv`
19
31
  executes application functions in your process. Native hosted Components receive no server
20
32
  secrets, filesystem or network grants. Customer-selected HTTP Environments are not enabled
@@ -26,6 +38,21 @@ for `hostEnv` Tools in your application before registering them. Supply your mod
26
38
  an authenticated account session and is normally performed in the dashboard. API keys do
27
39
  not grant authority to create more credentials. New key secrets are returned once.
28
40
 
41
+ ## Structured output
42
+
43
+ Pass `output: { type: z.object({ name: z.string() }), maxRetries: 2 }` in the second
44
+ argument to `session.send`. The SDK prompts for JSON, validates with Zod locally,
45
+ and returns the inferred parsed value. Two additional correction turns are allowed
46
+ by default; set zero to disable retries. Ordinary sends keep returning session state.
47
+
48
+ See the [executable example](https://github.com/aexhq/aex/blob/main/examples/structured-output.mjs)
49
+ and [full contract](https://aex.dev/brain/docs/guides/structured-output).
50
+ Exhaustion throws `StructuredOutputError` with `attempts`, `lastOutput`, and `issues`.
51
+ Retries run in your client and are ordinary turns with the session's existing tools.
52
+ Use exclusive ownership of sends during the operation. An optional top-level
53
+ `signal` cancels the active turn and stops corrections. Raw attempts remain visible
54
+ in history and streams; validation does not change the Agentloop or provider format.
55
+
29
56
  ## Account management
30
57
 
31
58
  Use an account session obtained through browser login for account management. Workload
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aexhq/sdk",
3
- "version": "0.71.0",
3
+ "version": "0.73.0",
4
4
  "description": "Aex accounts and hosted sessions using the Brain SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -28,7 +28,7 @@
28
28
  "tag": "next"
29
29
  },
30
30
  "dependencies": {
31
- "@aexhq/brain": "0.20.0"
31
+ "@aexhq/brain": "0.22.0"
32
32
  },
33
33
  "scripts": {
34
34
  "gen": "node ../../tools/sdk-contracts.mjs",