@aexhq/sdk 0.71.0 → 0.72.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 +16 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -10,7 +10,7 @@ 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
13
+ extension builders are Brain's implementations. SDK 0.72 uses Brain SDK 0.21 and official
14
14
  extension packages 5.x. Rebuild custom Wasm Components against Brain 0.20's WIT; older
15
15
  Components and session configurations are not migrated automatically. See https://aex.dev/docs
16
16
  for a complete session example.
@@ -26,6 +26,21 @@ for `hostEnv` Tools in your application before registering them. Supply your mod
26
26
  an authenticated account session and is normally performed in the dashboard. API keys do
27
27
  not grant authority to create more credentials. New key secrets are returned once.
28
28
 
29
+ ## Structured output
30
+
31
+ Pass `output: { type: z.object({ name: z.string() }), maxRetries: 2 }` in the second
32
+ argument to `session.send`. The SDK prompts for JSON, validates with Zod locally,
33
+ and returns the inferred parsed value. Two additional correction turns are allowed
34
+ by default; set zero to disable retries. Ordinary sends keep returning session state.
35
+
36
+ See the [executable example](https://github.com/aexhq/aex/blob/main/examples/structured-output.mjs)
37
+ and [full contract](https://aex.dev/brain/docs/guides/structured-output).
38
+ Exhaustion throws `StructuredOutputError` with `attempts`, `lastOutput`, and `issues`.
39
+ Retries run in your client and are ordinary turns with the session's existing tools.
40
+ Use exclusive ownership of sends during the operation. An optional top-level
41
+ `signal` cancels the active turn and stops corrections. Raw attempts remain visible
42
+ in history and streams; validation does not change the Agentloop or provider format.
43
+
29
44
  ## Account management
30
45
 
31
46
  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.72.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.21.0"
32
32
  },
33
33
  "scripts": {
34
34
  "gen": "node ../../tools/sdk-contracts.mjs",