@mantyx/sdk 0.12.0 → 0.14.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 +14 -2
- package/CONTRIBUTING.md +2 -8
- package/README.md +33 -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-2K4BGJGJ.js → chunk-XENCO3EF.js} +166 -4
- package/dist/chunk-XENCO3EF.js.map +1 -0
- package/dist/{client-LQlx7iYY.d.cts → client-Ct6G4TVc.d.cts} +172 -4
- package/dist/{client-LQlx7iYY.d.ts → client-Ct6G4TVc.d.ts} +172 -4
- package/dist/index.cjs +167 -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 +4 -2
- package/dist/index.js.map +1 -1
- package/docs/agent-runs-protocol.md +177 -15
- package/docs/wire-protocol.md +116 -10
- package/package.json +1 -1
- package/dist/chunk-2K4BGJGJ.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
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
|
-
## [
|
|
6
|
+
## [0.13.0] — 2026-06-09
|
|
7
|
+
|
|
8
|
+
### Added
|
|
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
|
|
7
18
|
|
|
8
19
|
### Added
|
|
9
20
|
|
|
@@ -92,7 +103,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
92
103
|
|
|
93
104
|
## [0.1.0] — 2026-05-02
|
|
94
105
|
|
|
95
|
-
[
|
|
106
|
+
[0.13.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.12.0..v0.13.0
|
|
107
|
+
[0.12.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.11.0..v0.12.0
|
|
96
108
|
[0.11.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.10.1..v0.11.0
|
|
97
109
|
[0.10.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.9.1..v0.10.0
|
|
98
110
|
[0.9.1]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.9.0..v0.9.1
|
package/CONTRIBUTING.md
CHANGED
|
@@ -60,18 +60,12 @@ exercises it end-to-end.
|
|
|
60
60
|
1. Fork and create a feature branch.
|
|
61
61
|
2. Add or update tests.
|
|
62
62
|
3. `pnpm test && pnpm typecheck && pnpm build`.
|
|
63
|
-
4.
|
|
63
|
+
4. Use [Conventional Commits](https://www.conventionalcommits.org/) with scope `ts` — `CHANGELOG.md` is regenerated from git history on release (do not edit it by hand).
|
|
64
64
|
5. Open a PR. Describe the change and any protocol implications.
|
|
65
65
|
|
|
66
66
|
## Releasing
|
|
67
67
|
|
|
68
|
-
Releases
|
|
69
|
-
|
|
70
|
-
1. Move `## [Unreleased]` content into a new version section in
|
|
71
|
-
`CHANGELOG.md`.
|
|
72
|
-
2. Bump `package.json` `version`.
|
|
73
|
-
3. `pnpm build && pnpm publish --access public`.
|
|
74
|
-
4. Tag the commit `sdk-typescript-vX.Y.Z` and push.
|
|
68
|
+
Releases are handled by the shared **Publish** GitHub Actions workflow on `main` (lockstep across all three SDKs). See the [top-level CONTRIBUTING.md](../CONTRIBUTING.md#releasing). The npm tag is `vX.Y.Z`; do not publish or tag manually from this package.
|
|
75
69
|
|
|
76
70
|
## Code of Conduct
|
|
77
71
|
|
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
|
|
|
@@ -510,15 +536,22 @@ interface MantyxClientOptions {
|
|
|
510
536
|
}
|
|
511
537
|
```
|
|
512
538
|
|
|
539
|
+
## Task planning (`plan` / `runPlan`)
|
|
540
|
+
|
|
541
|
+
Opt-in multi-step checklists. Pass `plan: true` (auto-classify + live tracking) or `plan: { steps, brief? }` on `runAgent` / `session.send`. For **plan-only** runs that stop after producing the checklist, use `client.runPlan({ ... })` (or `session.runPlan(prompt, { steps?, brief? })`) — the structured result is on `result.plan`. See `docs/agent-runs-protocol.md` §4.9.
|
|
542
|
+
|
|
513
543
|
### Methods
|
|
514
544
|
|
|
515
545
|
| Method | Returns |
|
|
516
546
|
| --------------------------------------------- | ------------------------------------ |
|
|
517
547
|
| `listModels()` | `Promise<ModelCatalog>` |
|
|
518
548
|
| `runAgent(spec)` | `Promise<RunResult>` |
|
|
549
|
+
| `runPlan(spec)` | `Promise<RunResult>` (plan-only) |
|
|
519
550
|
| `streamAgent(spec)` | `AsyncIterable<RunEvent>` |
|
|
520
551
|
| `createSession(spec)` | `Promise<AgentSession>` |
|
|
521
552
|
| `resumeSession(sessionId, { tools? })` | `Promise<AgentSession>` |
|
|
553
|
+
| `listSessions({ metadata?, status?, limit?, offset? })` | `Promise<SessionListResult>` |
|
|
554
|
+
| `getSessionEvents(sessionId, { full?, lastMessages? })` | `Promise<RunEvent[]>` |
|
|
522
555
|
| `endSession(sessionId)` | `Promise<void>` |
|
|
523
556
|
| `cancelRun(runId)` | `Promise<void>` |
|
|
524
557
|
|
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;
|