@mantyx/sdk 0.11.0 → 0.13.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 +20 -1
- package/README.md +28 -0
- package/dist/a2a-server.cjs +2 -0
- package/dist/a2a-server.cjs.map +1 -1
- package/dist/a2a-server.d.cts +7 -1
- package/dist/a2a-server.d.ts +7 -1
- package/dist/a2a-server.js +3 -1
- package/dist/a2a-server.js.map +1 -1
- package/dist/{chunk-DR625E6B.js → chunk-36QXU6NV.js} +79 -4
- package/dist/chunk-36QXU6NV.js.map +1 -0
- package/dist/{client-Byb0Zdo7.d.cts → client-C-jl6_nH.d.cts} +129 -4
- package/dist/{client-Byb0Zdo7.d.ts → client-C-jl6_nH.d.ts} +129 -4
- package/dist/index.cjs +79 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/docs/agent-runs-protocol.md +169 -21
- package/docs/wire-protocol.md +126 -26
- package/package.json +1 -1
- package/dist/chunk-DR625E6B.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
### Added
|
|
9
9
|
|
|
10
|
+
- Add Zod outputSchema support and wire it through A2A server
|
|
11
|
+
- Add session metadata querying and history retrieval
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
- Sync wire-protocol.md from mantyx-platform source of truth
|
|
16
|
+
|
|
17
|
+
## [0.12.0] — 2026-06-04
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Add supervisor
|
|
22
|
+
|
|
23
|
+
## [0.11.0] — 2026-05-18
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
10
27
|
- Update protocol
|
|
11
28
|
|
|
12
29
|
## [0.10.0] — 2026-05-13
|
|
@@ -86,7 +103,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
86
103
|
|
|
87
104
|
## [0.1.0] — 2026-05-02
|
|
88
105
|
|
|
89
|
-
[unreleased]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.
|
|
106
|
+
[unreleased]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.12.0..HEAD
|
|
107
|
+
[0.12.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.11.0..v0.12.0
|
|
108
|
+
[0.11.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.10.1..v0.11.0
|
|
90
109
|
[0.10.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.9.1..v0.10.0
|
|
91
110
|
[0.9.1]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.9.0..v0.9.1
|
|
92
111
|
[0.9.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.8.0..v0.9.0
|
package/README.md
CHANGED
|
@@ -480,6 +480,32 @@ Limits enforced server-side: max 16 entries; keys match `[A-Za-z0-9._-]{1,64}`;
|
|
|
480
480
|
values are strings ≤ 256 chars; serialized JSON ≤ 4 KB. Bigger payloads return
|
|
481
481
|
`400 invalid_request`.
|
|
482
482
|
|
|
483
|
+
### Finding and restoring past sessions
|
|
484
|
+
|
|
485
|
+
Use the metadata you attached at create time to find earlier sessions, then
|
|
486
|
+
replay their conversation into a UI through the same handler you use for the
|
|
487
|
+
live stream.
|
|
488
|
+
|
|
489
|
+
```ts
|
|
490
|
+
// Find sessions by your own identifiers (AND-combined server-side)
|
|
491
|
+
const { sessions, total } = await client.listSessions({
|
|
492
|
+
metadata: { customer: "acme" },
|
|
493
|
+
status: "active", // optional: "active" | "ended"
|
|
494
|
+
limit: 50, // optional pagination
|
|
495
|
+
offset: 0,
|
|
496
|
+
});
|
|
497
|
+
// Each row: { sessionId, creationDate, lastInteractionDate, summary, metadata, status }
|
|
498
|
+
|
|
499
|
+
// Replay a session as realtime-style frames so a UI can rebuild the thread.
|
|
500
|
+
// Returns `user_message` / `assistant_message` frames (wire protocol §6.2).
|
|
501
|
+
const events = await client.getSessionEvents(sessions[0].sessionId);
|
|
502
|
+
|
|
503
|
+
// Or fetch only the most recent turns:
|
|
504
|
+
const recent = await client.getSessionEvents(sessions[0].sessionId, {
|
|
505
|
+
lastMessages: 10,
|
|
506
|
+
});
|
|
507
|
+
```
|
|
508
|
+
|
|
483
509
|
Resuming a session from a different process re-binds your local tool
|
|
484
510
|
handlers; pass them in via `resumeSession`:
|
|
485
511
|
|
|
@@ -519,6 +545,8 @@ interface MantyxClientOptions {
|
|
|
519
545
|
| `streamAgent(spec)` | `AsyncIterable<RunEvent>` |
|
|
520
546
|
| `createSession(spec)` | `Promise<AgentSession>` |
|
|
521
547
|
| `resumeSession(sessionId, { tools? })` | `Promise<AgentSession>` |
|
|
548
|
+
| `listSessions({ metadata?, status?, limit?, offset? })` | `Promise<SessionListResult>` |
|
|
549
|
+
| `getSessionEvents(sessionId, { full?, lastMessages? })` | `Promise<RunEvent[]>` |
|
|
522
550
|
| `endSession(sessionId)` | `Promise<void>` |
|
|
523
551
|
| `cancelRun(runId)` | `Promise<void>` |
|
|
524
552
|
|
package/dist/a2a-server.cjs
CHANGED
|
@@ -340,6 +340,7 @@ function specForRun(spec) {
|
|
|
340
340
|
if (spec.modelId) out.modelId = spec.modelId;
|
|
341
341
|
if (spec.tools) out.tools = spec.tools;
|
|
342
342
|
if (spec.reasoningLevel !== void 0) out.reasoningLevel = spec.reasoningLevel;
|
|
343
|
+
if (spec.outputSchema !== void 0) out.outputSchema = spec.outputSchema;
|
|
343
344
|
if (spec.metadata) out.metadata = spec.metadata;
|
|
344
345
|
if (spec.budgets) out.budgets = spec.budgets;
|
|
345
346
|
if (spec.name) out.name = spec.name;
|
|
@@ -352,6 +353,7 @@ function specForSession(spec, contextId) {
|
|
|
352
353
|
if (spec.modelId) out.modelId = spec.modelId;
|
|
353
354
|
if (spec.tools) out.tools = spec.tools;
|
|
354
355
|
if (spec.reasoningLevel !== void 0) out.reasoningLevel = spec.reasoningLevel;
|
|
356
|
+
if (spec.outputSchema !== void 0) out.outputSchema = spec.outputSchema;
|
|
355
357
|
const meta = { ...spec.metadata ?? {} };
|
|
356
358
|
if (!meta.a2a_context_id) meta.a2a_context_id = contextId;
|
|
357
359
|
out.metadata = meta;
|