@mantyx/sdk 0.24.0 → 0.25.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/CHANGELOG.md +7 -0
- package/README.md +15 -5
- package/dist/a2a-server.cjs +9 -0
- package/dist/a2a-server.cjs.map +1 -1
- package/dist/a2a-server.js +1 -1
- package/dist/{chunk-OUK6ZZ5H.js → chunk-4EJRV6KZ.js} +40 -1
- package/dist/chunk-4EJRV6KZ.js.map +1 -0
- package/dist/client.d.ts +19 -6
- package/dist/client.d.ts.map +1 -1
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.cjs +40 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/structured-output.d.ts +12 -0
- package/dist/structured-output.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/docs/agent-runs-protocol.md +171 -87
- package/docs/wire-protocol.md +201 -82
- package/package.json +1 -1
- package/dist/chunk-OUK6ZZ5H.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## [0.24.0] — 2026-07-24
|
|
7
|
+
|
|
8
|
+
### Documentation
|
|
9
|
+
|
|
10
|
+
- Add audio attachment support_(protocol)_
|
|
11
|
+
|
|
6
12
|
## [0.23.0] — 2026-07-15
|
|
7
13
|
|
|
8
14
|
### Added
|
|
@@ -175,6 +181,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
175
181
|
|
|
176
182
|
## [0.1.0] — 2026-05-02
|
|
177
183
|
|
|
184
|
+
[0.24.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.23.0..v0.24.0
|
|
178
185
|
[0.23.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.22.1..v0.23.0
|
|
179
186
|
[0.22.1]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.22.0..v0.22.1
|
|
180
187
|
[0.22.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.21.0..v0.22.0
|
package/README.md
CHANGED
|
@@ -306,10 +306,10 @@ inherits from the session and can be overridden per `session.send`.
|
|
|
306
306
|
|
|
307
307
|
## Structured output (`outputSchema`)
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
JSON Schema. The wire still ships the reply as
|
|
311
|
-
string
|
|
312
|
-
|
|
309
|
+
Ask the provider to constrain the assistant's **final reply** to a JSON
|
|
310
|
+
document matching a JSON Schema. The wire still ships the reply as
|
|
311
|
+
`text: string`. Set `enforcement: "strict"` when an unsupported schema or
|
|
312
|
+
unconstrained fallback must fail, and pair it with `parseRunOutput`:
|
|
313
313
|
|
|
314
314
|
```ts
|
|
315
315
|
import { z } from "zod";
|
|
@@ -329,7 +329,11 @@ const WeatherJsonSchema = {
|
|
|
329
329
|
const result = await client.runAgent({
|
|
330
330
|
systemPrompt: "Return the weather as JSON.",
|
|
331
331
|
prompt: "What's the weather in San Francisco right now?",
|
|
332
|
-
outputSchema: {
|
|
332
|
+
outputSchema: {
|
|
333
|
+
name: "weather_report",
|
|
334
|
+
schema: WeatherJsonSchema,
|
|
335
|
+
enforcement: "strict",
|
|
336
|
+
},
|
|
333
337
|
});
|
|
334
338
|
|
|
335
339
|
const report = parseRunOutput(result, (v) => Weather.parse(v));
|
|
@@ -342,6 +346,12 @@ typed `MantyxError` up front instead of a server round-trip rejection.
|
|
|
342
346
|
On parse failure (rare; bad model output), `parseRunOutput` throws
|
|
343
347
|
`MantyxParseError` with the original `text` preserved.
|
|
344
348
|
|
|
349
|
+
On success, `result.structuredOutput` reports whether enforcement actually
|
|
350
|
+
occurred, its `native_schema` / `synthetic_tool` mechanism, and whether a
|
|
351
|
+
best-effort unconstrained fallback occurred. Strict provider rejection raises
|
|
352
|
+
`MantyxRunError` with `errorClass === "structured_output_schema_rejected"` and
|
|
353
|
+
preserves `apiStatus`, `apiCode`, and the provider message.
|
|
354
|
+
|
|
345
355
|
`outputSchema` is independent of `reasoningLevel` — combine them for
|
|
346
356
|
deep-reasoning JSON outputs. On sessions it inherits from
|
|
347
357
|
`createSession({ outputSchema })` and can be overridden per
|
package/dist/a2a-server.cjs
CHANGED
|
@@ -65,6 +65,12 @@ var MantyxRunError = class extends MantyxError {
|
|
|
65
65
|
turns;
|
|
66
66
|
/** See {@link MantyxRunErrorInit.model}. */
|
|
67
67
|
model;
|
|
68
|
+
/** Provider HTTP status associated with the failure, when available. */
|
|
69
|
+
apiStatus;
|
|
70
|
+
/** Provider-specific error code associated with the failure, when available. */
|
|
71
|
+
apiCode;
|
|
72
|
+
/** Structured-output enforcement metadata, when reported by the server. */
|
|
73
|
+
structuredOutput;
|
|
68
74
|
constructor(runId, subtype, message, init = {}) {
|
|
69
75
|
super(message, { code: subtype });
|
|
70
76
|
this.name = "MantyxRunError";
|
|
@@ -77,6 +83,9 @@ var MantyxRunError = class extends MantyxError {
|
|
|
77
83
|
this.tokens = init.tokens;
|
|
78
84
|
this.turns = init.turns;
|
|
79
85
|
this.model = init.model;
|
|
86
|
+
this.apiStatus = init.apiStatus;
|
|
87
|
+
this.apiCode = init.apiCode;
|
|
88
|
+
this.structuredOutput = init.structuredOutput;
|
|
80
89
|
}
|
|
81
90
|
};
|
|
82
91
|
|