@mantyx/sdk 0.25.0 → 2026.9.3
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 +24 -1
- package/LICENSE +201 -0
- package/README.md +16 -7
- package/dist/a2a-server.cjs +0 -1
- package/dist/a2a-server.d.ts +0 -1
- package/dist/a2a-server.js +1 -2
- package/dist/{chunk-4EJRV6KZ.js → chunk-G46SVM2Q.js} +33 -2
- package/dist/client.d.ts +31 -1
- package/dist/computer-use.d.ts +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/index.cjs +34 -3
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -3
- package/dist/local-resolver.d.ts +0 -1
- package/dist/oauth.d.ts +0 -1
- package/dist/playwright.cjs +0 -1
- package/dist/playwright.d.ts +0 -1
- package/dist/playwright.js +0 -1
- package/dist/sse.d.ts +0 -1
- package/dist/structured-output.d.ts +0 -1
- package/dist/tools.d.ts +0 -1
- package/dist/version.d.ts +2 -3
- package/dist/zod-to-json-schema.d.ts +0 -1
- package/docs/agent-runs-protocol.md +63 -4
- package/package.json +17 -18
- package/CONTRIBUTING.md +0 -72
- package/EXTRACT.md +0 -70
- package/dist/a2a-server.cjs.map +0 -1
- package/dist/a2a-server.d.ts.map +0 -1
- package/dist/a2a-server.js.map +0 -1
- package/dist/chunk-4EJRV6KZ.js.map +0 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/computer-use.d.ts.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/local-resolver.d.ts.map +0 -1
- package/dist/oauth.d.ts.map +0 -1
- package/dist/playwright.cjs.map +0 -1
- package/dist/playwright.d.ts.map +0 -1
- package/dist/playwright.js.map +0 -1
- package/dist/sse.d.ts.map +0 -1
- package/dist/structured-output.d.ts.map +0 -1
- package/dist/tools.d.ts.map +0 -1
- package/dist/version.d.ts.map +0 -1
- package/dist/zod-to-json-schema.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
4
|
-
and
|
|
4
|
+
and new releases use calendar versions (`YYYY.M.RELEASE`). Historical versions retain their original identifiers.
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Cursor-based session pagination and bounded session event pages (SDK PR #9).
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- Experimental `newLoop` opt-in for the reviewed harness loop. Agent runs use the existing loop.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Calendar versioning with automatic SDK publication after successful deployments when SDK code or build inputs change.
|
|
19
|
+
- Develop and release SDKs from the private MANTYX platform repository.
|
|
20
|
+
- Export `SessionEventsPage`; wait for eval local tool callbacks; reject null output schemas.
|
|
21
|
+
|
|
22
|
+
## [0.25.0] — 2026-08-01
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Expose structured output enforcement
|
|
5
27
|
|
|
6
28
|
## [0.24.0] — 2026-07-24
|
|
7
29
|
|
|
@@ -181,6 +203,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
181
203
|
|
|
182
204
|
## [0.1.0] — 2026-05-02
|
|
183
205
|
|
|
206
|
+
[0.25.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.24.0..v0.25.0
|
|
184
207
|
[0.24.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.23.0..v0.24.0
|
|
185
208
|
[0.23.0]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.22.1..v0.23.0
|
|
186
209
|
[0.22.1]: https://github.com/mantyx-io/mantyx-sdk/compare/v0.22.0..v0.22.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for describing the origin of the Work and
|
|
141
|
+
reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 MANTYX
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -501,12 +501,14 @@ live stream.
|
|
|
501
501
|
|
|
502
502
|
```ts
|
|
503
503
|
// Find sessions by your own identifiers (AND-combined server-side)
|
|
504
|
-
const { sessions, total } = await client.listSessions({
|
|
504
|
+
const { sessions, total, nextCursor } = await client.listSessions({
|
|
505
505
|
metadata: { customer: "acme" },
|
|
506
506
|
status: "active", // optional: "active" | "ended"
|
|
507
507
|
limit: 50, // optional pagination
|
|
508
|
-
offset: 0,
|
|
509
508
|
});
|
|
509
|
+
const nextPage = nextCursor
|
|
510
|
+
? await client.listSessions({ limit: 50, cursor: nextCursor })
|
|
511
|
+
: null;
|
|
510
512
|
// Each row: { sessionId, creationDate, lastInteractionDate, summary, metadata, status }
|
|
511
513
|
|
|
512
514
|
// Replay a session as realtime-style frames so a UI can rebuild the thread.
|
|
@@ -517,6 +519,14 @@ const events = await client.getSessionEvents(sessions[0].sessionId);
|
|
|
517
519
|
const recent = await client.getSessionEvents(sessions[0].sessionId, {
|
|
518
520
|
lastMessages: 10,
|
|
519
521
|
});
|
|
522
|
+
|
|
523
|
+
// For bounded backward paging, use the page response metadata:
|
|
524
|
+
const page = await client.getSessionEventsPage(sessions[0].sessionId);
|
|
525
|
+
const older = page.nextBeforeSeq
|
|
526
|
+
? await client.getSessionEventsPage(sessions[0].sessionId, {
|
|
527
|
+
beforeSeq: page.nextBeforeSeq,
|
|
528
|
+
})
|
|
529
|
+
: null;
|
|
520
530
|
```
|
|
521
531
|
|
|
522
532
|
Resuming a session from a different process re-binds your local tool
|
|
@@ -563,8 +573,9 @@ Opt-in multi-step checklists. Pass `plan: true` (auto-classify + live tracking)
|
|
|
563
573
|
| `streamAgent(spec)` | `AsyncIterable<RunEvent>` |
|
|
564
574
|
| `createSession(spec)` | `Promise<AgentSession>` |
|
|
565
575
|
| `resumeSession(sessionId, { tools? })` | `Promise<AgentSession>` |
|
|
566
|
-
| `listSessions({ metadata?, status?, limit?, offset? })` | `Promise<SessionListResult>` |
|
|
576
|
+
| `listSessions({ metadata?, status?, limit?, offset?, cursor? })` | `Promise<SessionListResult>` |
|
|
567
577
|
| `getSessionEvents(sessionId, { full?, lastMessages? })` | `Promise<RunEvent[]>` |
|
|
578
|
+
| `getSessionEventsPage(sessionId, { lastMessages?, beforeSeq? })` | `Promise<SessionEventsPage>` |
|
|
568
579
|
| `endSession(sessionId)` | `Promise<void>` |
|
|
569
580
|
| `cancelRun(runId)` | `Promise<void>` |
|
|
570
581
|
|
|
@@ -694,10 +705,8 @@ pnpm build # emits dist/ (ESM + CJS + d.ts)
|
|
|
694
705
|
The SDK has zero internal `workspace:*` dependencies. `pnpm build` produces a
|
|
695
706
|
self-contained `dist/` ready for `npm publish`.
|
|
696
707
|
|
|
697
|
-
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for the
|
|
698
|
-
[`EXTRACT.md`](./EXTRACT.md) for the (very small) steps to lift this folder
|
|
699
|
-
into its own public repository.
|
|
708
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for development and the shared release guide in the private repository for publishing.
|
|
700
709
|
|
|
701
710
|
## License
|
|
702
711
|
|
|
703
|
-
[Apache-2.0](
|
|
712
|
+
[Apache-2.0](./LICENSE)
|
package/dist/a2a-server.cjs
CHANGED
package/dist/a2a-server.d.ts
CHANGED
|
@@ -170,4 +170,3 @@ export declare class MantyxAgentExecutor implements AgentExecutor {
|
|
|
170
170
|
export declare function serveAgentOverA2A(options: ServeAgentOverA2AOptions): Promise<ServeAgentOverA2AHandle>;
|
|
171
171
|
export type { AgentCard, Message, MessageSendParams, Task, TaskArtifactUpdateEvent, TaskStatusUpdateEvent, } from "@a2a-js/sdk";
|
|
172
172
|
export type { AgentExecutor, ExecutionEventBus, RequestContext } from "@a2a-js/sdk/server";
|
|
173
|
-
//# sourceMappingURL=a2a-server.d.ts.map
|
package/dist/a2a-server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MantyxError,
|
|
3
3
|
MantyxRunError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G46SVM2Q.js";
|
|
5
5
|
|
|
6
6
|
// src/a2a-server.ts
|
|
7
7
|
var MantyxAgentExecutor = class {
|
|
@@ -343,4 +343,3 @@ export {
|
|
|
343
343
|
MantyxAgentExecutor,
|
|
344
344
|
serveAgentOverA2A
|
|
345
345
|
};
|
|
346
|
-
//# sourceMappingURL=a2a-server.js.map
|
|
@@ -871,6 +871,7 @@ var MantyxClient = class {
|
|
|
871
871
|
if (opts.status) query.status = opts.status;
|
|
872
872
|
if (typeof opts.limit === "number") query.limit = opts.limit;
|
|
873
873
|
if (typeof opts.offset === "number") query.offset = opts.offset;
|
|
874
|
+
if (opts.cursor) query.cursor = opts.cursor;
|
|
874
875
|
return this.request({
|
|
875
876
|
method: "GET",
|
|
876
877
|
path: "/agent-sessions",
|
|
@@ -897,6 +898,28 @@ var MantyxClient = class {
|
|
|
897
898
|
});
|
|
898
899
|
return res.events ?? [];
|
|
899
900
|
}
|
|
901
|
+
/**
|
|
902
|
+
* Fetch one bounded page of session events. Pages are returned in ascending
|
|
903
|
+
* sequence order; follow `nextBeforeSeq` to walk backward through history.
|
|
904
|
+
*/
|
|
905
|
+
async getSessionEventsPage(sessionId, opts = {}) {
|
|
906
|
+
const query = {
|
|
907
|
+
lastMessages: opts.lastMessages ?? 100,
|
|
908
|
+
beforeSeq: opts.beforeSeq
|
|
909
|
+
};
|
|
910
|
+
const res = await this.request({
|
|
911
|
+
method: "GET",
|
|
912
|
+
path: `/agent-sessions/${encodeURIComponent(sessionId)}/events`,
|
|
913
|
+
query
|
|
914
|
+
});
|
|
915
|
+
return {
|
|
916
|
+
sessionId: res.sessionId,
|
|
917
|
+
total: res.total,
|
|
918
|
+
events: res.events ?? [],
|
|
919
|
+
nextBeforeSeq: res.nextBeforeSeq ?? null,
|
|
920
|
+
truncated: res.truncated ?? false
|
|
921
|
+
};
|
|
922
|
+
}
|
|
900
923
|
// ----------------------------------------------------------- Internals
|
|
901
924
|
/** Drive an existing run to completion (collect events, dispatch local tools). */
|
|
902
925
|
async driveRun(runId, handlers, opts = {}) {
|
|
@@ -1216,7 +1239,7 @@ var MantyxClient = class {
|
|
|
1216
1239
|
const agentRunId = typeof record.agentRunId === "string" ? record.agentRunId : typeof nested?.agentRunId === "string" ? nested.agentRunId : "";
|
|
1217
1240
|
if (agentRunId) {
|
|
1218
1241
|
const localEv = evalEventToLocalToolCall(ev);
|
|
1219
|
-
|
|
1242
|
+
await this.dispatchLocalTool(agentRunId, localEv, handlers);
|
|
1220
1243
|
}
|
|
1221
1244
|
}
|
|
1222
1245
|
options.onEvent?.(ev);
|
|
@@ -1444,6 +1467,12 @@ var AgentSession = class {
|
|
|
1444
1467
|
async info() {
|
|
1445
1468
|
return this.client.getSessionInfo(this.id);
|
|
1446
1469
|
}
|
|
1470
|
+
async events(opts = {}) {
|
|
1471
|
+
return this.client.getSessionEvents(this.id, opts);
|
|
1472
|
+
}
|
|
1473
|
+
async eventsPage(opts = {}) {
|
|
1474
|
+
return this.client.getSessionEventsPage(this.id, opts);
|
|
1475
|
+
}
|
|
1447
1476
|
async end() {
|
|
1448
1477
|
try {
|
|
1449
1478
|
await this.client.endSession(this.id);
|
|
@@ -1687,6 +1716,9 @@ function normalizeOutputSchema(value) {
|
|
|
1687
1716
|
}
|
|
1688
1717
|
out.enforcement = value.enforcement;
|
|
1689
1718
|
}
|
|
1719
|
+
if (value.schema == null) {
|
|
1720
|
+
throw new MantyxError("outputSchema.schema must be a Zod schema or a non-null JSON object");
|
|
1721
|
+
}
|
|
1690
1722
|
const schema = toToolParametersWire(
|
|
1691
1723
|
value.schema
|
|
1692
1724
|
);
|
|
@@ -2094,4 +2126,3 @@ export {
|
|
|
2094
2126
|
taskPlanFromEventData,
|
|
2095
2127
|
parseRunOutput
|
|
2096
2128
|
};
|
|
2097
|
-
//# sourceMappingURL=chunk-4EJRV6KZ.js.map
|
package/dist/client.d.ts
CHANGED
|
@@ -1054,8 +1054,21 @@ export interface SessionListResult {
|
|
|
1054
1054
|
total: number;
|
|
1055
1055
|
limit: number;
|
|
1056
1056
|
offset: number;
|
|
1057
|
+
/** Opaque cursor for the next page. Absent on older MANTYX servers. */
|
|
1058
|
+
nextCursor?: string | null;
|
|
1057
1059
|
sessions: SessionSummary[];
|
|
1058
1060
|
}
|
|
1061
|
+
/** One bounded page from {@link MantyxClient.getSessionEventsPage}. */
|
|
1062
|
+
export interface SessionEventsPage {
|
|
1063
|
+
sessionId: string;
|
|
1064
|
+
/** Total messages in the session, not just this page. */
|
|
1065
|
+
total: number;
|
|
1066
|
+
events: RunEvent[];
|
|
1067
|
+
/** Pass this value back as `beforeSeq` to fetch the preceding page. */
|
|
1068
|
+
nextBeforeSeq: number | null;
|
|
1069
|
+
/** True when older messages remain before this page. */
|
|
1070
|
+
truncated: boolean;
|
|
1071
|
+
}
|
|
1059
1072
|
export declare class MantyxClient {
|
|
1060
1073
|
readonly options: Required<Pick<MantyxClientOptions, "workspaceSlug" | "baseUrl">> & {
|
|
1061
1074
|
/**
|
|
@@ -1123,6 +1136,8 @@ export declare class MantyxClient {
|
|
|
1123
1136
|
status?: "active" | "ended";
|
|
1124
1137
|
limit?: number;
|
|
1125
1138
|
offset?: number;
|
|
1139
|
+
/** Opaque `nextCursor` returned by the previous page. */
|
|
1140
|
+
cursor?: string;
|
|
1126
1141
|
}): Promise<SessionListResult>;
|
|
1127
1142
|
/**
|
|
1128
1143
|
* Fetch a session's conversation as realtime-style event frames so a UI can
|
|
@@ -1135,6 +1150,14 @@ export declare class MantyxClient {
|
|
|
1135
1150
|
full?: boolean;
|
|
1136
1151
|
lastMessages?: number;
|
|
1137
1152
|
}): Promise<RunEvent[]>;
|
|
1153
|
+
/**
|
|
1154
|
+
* Fetch one bounded page of session events. Pages are returned in ascending
|
|
1155
|
+
* sequence order; follow `nextBeforeSeq` to walk backward through history.
|
|
1156
|
+
*/
|
|
1157
|
+
getSessionEventsPage(sessionId: string, opts?: {
|
|
1158
|
+
lastMessages?: number;
|
|
1159
|
+
beforeSeq?: number;
|
|
1160
|
+
}): Promise<SessionEventsPage>;
|
|
1138
1161
|
/** Drive an existing run to completion (collect events, dispatch local tools). */
|
|
1139
1162
|
driveRun(runId: string, handlers: LocalHandlers, opts?: {
|
|
1140
1163
|
onAssistantDelta?: (delta: string) => void;
|
|
@@ -1291,6 +1314,14 @@ export declare class AgentSession {
|
|
|
1291
1314
|
}): Promise<RunResult>;
|
|
1292
1315
|
history(): Promise<ConversationMessage[]>;
|
|
1293
1316
|
info(): Promise<SessionInfo>;
|
|
1317
|
+
events(opts?: {
|
|
1318
|
+
full?: boolean;
|
|
1319
|
+
lastMessages?: number;
|
|
1320
|
+
}): Promise<RunEvent[]>;
|
|
1321
|
+
eventsPage(opts?: {
|
|
1322
|
+
lastMessages?: number;
|
|
1323
|
+
beforeSeq?: number;
|
|
1324
|
+
}): Promise<SessionEventsPage>;
|
|
1294
1325
|
end(): Promise<void>;
|
|
1295
1326
|
}
|
|
1296
1327
|
/** Internal registry of client-resolved handlers, indexed by `kind`. */
|
|
@@ -1334,4 +1365,3 @@ export declare function taskPlanFromEventData(data: Record<string, unknown>): Ta
|
|
|
1334
1365
|
* ```
|
|
1335
1366
|
*/
|
|
1336
1367
|
export declare function parseRunOutput<T = unknown>(result: RunResult, validator?: (value: unknown) => T): T;
|
|
1337
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/computer-use.d.ts
CHANGED
|
@@ -189,4 +189,3 @@ export declare function extractActions(result: RunResult): ComputerUseActionCall
|
|
|
189
189
|
* console.log(out.finalText);
|
|
190
190
|
*/
|
|
191
191
|
export declare function runComputerUse(opts: RunComputerUseOptions): Promise<ComputerUseResult>;
|
|
192
|
-
//# sourceMappingURL=computer-use.d.ts.map
|
package/dist/errors.d.ts
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -945,6 +945,7 @@ var MantyxClient = class {
|
|
|
945
945
|
if (opts.status) query.status = opts.status;
|
|
946
946
|
if (typeof opts.limit === "number") query.limit = opts.limit;
|
|
947
947
|
if (typeof opts.offset === "number") query.offset = opts.offset;
|
|
948
|
+
if (opts.cursor) query.cursor = opts.cursor;
|
|
948
949
|
return this.request({
|
|
949
950
|
method: "GET",
|
|
950
951
|
path: "/agent-sessions",
|
|
@@ -971,6 +972,28 @@ var MantyxClient = class {
|
|
|
971
972
|
});
|
|
972
973
|
return res.events ?? [];
|
|
973
974
|
}
|
|
975
|
+
/**
|
|
976
|
+
* Fetch one bounded page of session events. Pages are returned in ascending
|
|
977
|
+
* sequence order; follow `nextBeforeSeq` to walk backward through history.
|
|
978
|
+
*/
|
|
979
|
+
async getSessionEventsPage(sessionId, opts = {}) {
|
|
980
|
+
const query = {
|
|
981
|
+
lastMessages: opts.lastMessages ?? 100,
|
|
982
|
+
beforeSeq: opts.beforeSeq
|
|
983
|
+
};
|
|
984
|
+
const res = await this.request({
|
|
985
|
+
method: "GET",
|
|
986
|
+
path: `/agent-sessions/${encodeURIComponent(sessionId)}/events`,
|
|
987
|
+
query
|
|
988
|
+
});
|
|
989
|
+
return {
|
|
990
|
+
sessionId: res.sessionId,
|
|
991
|
+
total: res.total,
|
|
992
|
+
events: res.events ?? [],
|
|
993
|
+
nextBeforeSeq: res.nextBeforeSeq ?? null,
|
|
994
|
+
truncated: res.truncated ?? false
|
|
995
|
+
};
|
|
996
|
+
}
|
|
974
997
|
// ----------------------------------------------------------- Internals
|
|
975
998
|
/** Drive an existing run to completion (collect events, dispatch local tools). */
|
|
976
999
|
async driveRun(runId, handlers, opts = {}) {
|
|
@@ -1290,7 +1313,7 @@ var MantyxClient = class {
|
|
|
1290
1313
|
const agentRunId = typeof record.agentRunId === "string" ? record.agentRunId : typeof nested?.agentRunId === "string" ? nested.agentRunId : "";
|
|
1291
1314
|
if (agentRunId) {
|
|
1292
1315
|
const localEv = evalEventToLocalToolCall(ev);
|
|
1293
|
-
|
|
1316
|
+
await this.dispatchLocalTool(agentRunId, localEv, handlers);
|
|
1294
1317
|
}
|
|
1295
1318
|
}
|
|
1296
1319
|
options.onEvent?.(ev);
|
|
@@ -1518,6 +1541,12 @@ var AgentSession = class {
|
|
|
1518
1541
|
async info() {
|
|
1519
1542
|
return this.client.getSessionInfo(this.id);
|
|
1520
1543
|
}
|
|
1544
|
+
async events(opts = {}) {
|
|
1545
|
+
return this.client.getSessionEvents(this.id, opts);
|
|
1546
|
+
}
|
|
1547
|
+
async eventsPage(opts = {}) {
|
|
1548
|
+
return this.client.getSessionEventsPage(this.id, opts);
|
|
1549
|
+
}
|
|
1521
1550
|
async end() {
|
|
1522
1551
|
try {
|
|
1523
1552
|
await this.client.endSession(this.id);
|
|
@@ -1761,6 +1790,9 @@ function normalizeOutputSchema(value) {
|
|
|
1761
1790
|
}
|
|
1762
1791
|
out.enforcement = value.enforcement;
|
|
1763
1792
|
}
|
|
1793
|
+
if (value.schema == null) {
|
|
1794
|
+
throw new MantyxError("outputSchema.schema must be a Zod schema or a non-null JSON object");
|
|
1795
|
+
}
|
|
1764
1796
|
const schema = toToolParametersWire(
|
|
1765
1797
|
value.schema
|
|
1766
1798
|
);
|
|
@@ -2712,7 +2744,7 @@ async function runComputerUse(opts) {
|
|
|
2712
2744
|
}
|
|
2713
2745
|
|
|
2714
2746
|
// src/version.ts
|
|
2715
|
-
var SDK_VERSION = "
|
|
2747
|
+
var SDK_VERSION = "2026.9.3";
|
|
2716
2748
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2717
2749
|
0 && (module.exports = {
|
|
2718
2750
|
AgentSession,
|
|
@@ -2755,4 +2787,3 @@ var SDK_VERSION = "0.25.0";
|
|
|
2755
2787
|
toToolParametersWire,
|
|
2756
2788
|
zodToJsonSchema
|
|
2757
2789
|
});
|
|
2758
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* console.log(result.text);
|
|
35
35
|
*/
|
|
36
36
|
export { MantyxClient, AgentSession, DEFAULT_BASE_URL, parseRunOutput, planOnly, taskPlanFromEventData, inputFileAttachment, inputFileUrlAttachment, } from "./client.js";
|
|
37
|
-
export type { MantyxClientOptions, ModelInfo, ModelCatalog, AgentSpecBase, RunSpec, SessionSpec, OutputSchema, OutputSchemaValue, LoopDetection, ToolBudget, ToolBudgets, Supervisor, SupervisorAction, SupervisorPhase, ReasoningTrigger, PlanOptions, PlanMode, PlanSpec, TaskPlan, TaskPlanStep, TaskPlanStepStatus, TaskPlanTransition, RunResult, RunTokenUsage, RunModelInfo, RunEvent, RunEventBase, AssistantDeltaEvent, ThinkingDeltaEvent, AssistantMessageEvent, UserMessageEvent, InputFileAttachment, InputFileUrlAttachment, MessageAttachment, InputFileAttachmentMetadata, InputFileUrlAttachmentMetadata, AttachmentMetadata, ConversationMessage, ServerToolResultEvent, LocalToolCallEvent, LocalToolResultInEvent, LoopDetectedEvent, ToolBudgetExceededEvent, SupervisorEvent, TaskPlanEvent, ResultEvent, ErrorEvent, CancelledEvent, SessionInfo, SessionSummary, SessionListResult, LocalHandlers, RunFeedbackVerdict, RunFeedbackInput, RunFeedbackResult, EvalRunStatus, InlineEvalCaseSpec, InlineEvalDatasetSpec, AgentEvalOverrides, CreateEvalRunRequest, EvalDatasetSummary, EvalDatasetList, EvalCase, EvalDatasetDetail, EvalRunAccepted, EvalRunSummary, EvalCaseResult, EvalRunDetail, EvalRunList, EvalRunCompareSide, EvalRunCompareCase, EvalRunCompare, EvalRunEvent, ListEvalRunsOptions, RunEvalOptions, } from "./client.js";
|
|
37
|
+
export type { MantyxClientOptions, ModelInfo, ModelCatalog, AgentSpecBase, RunSpec, SessionSpec, OutputSchema, OutputSchemaValue, LoopDetection, ToolBudget, ToolBudgets, Supervisor, SupervisorAction, SupervisorPhase, ReasoningTrigger, PlanOptions, PlanMode, PlanSpec, TaskPlan, TaskPlanStep, TaskPlanStepStatus, TaskPlanTransition, RunResult, RunTokenUsage, RunModelInfo, RunEvent, RunEventBase, AssistantDeltaEvent, ThinkingDeltaEvent, AssistantMessageEvent, UserMessageEvent, InputFileAttachment, InputFileUrlAttachment, MessageAttachment, InputFileAttachmentMetadata, InputFileUrlAttachmentMetadata, AttachmentMetadata, ConversationMessage, ServerToolResultEvent, LocalToolCallEvent, LocalToolResultInEvent, LoopDetectedEvent, ToolBudgetExceededEvent, SupervisorEvent, TaskPlanEvent, ResultEvent, ErrorEvent, CancelledEvent, SessionInfo, SessionSummary, SessionListResult, SessionEventsPage, LocalHandlers, RunFeedbackVerdict, RunFeedbackInput, RunFeedbackResult, EvalRunStatus, InlineEvalCaseSpec, InlineEvalDatasetSpec, AgentEvalOverrides, CreateEvalRunRequest, EvalDatasetSummary, EvalDatasetList, EvalCase, EvalDatasetDetail, EvalRunAccepted, EvalRunSummary, EvalCaseResult, EvalRunDetail, EvalRunList, EvalRunCompareSide, EvalRunCompareCase, EvalRunCompare, EvalRunEvent, ListEvalRunsOptions, RunEvalOptions, } from "./client.js";
|
|
38
38
|
export { defineLocalTool, mantyxTool, mantyxPluginTool, mantyxA2A, defineLocalA2A, mantyxMcp, defineLocalMcp, isLocalTool, isLocalA2ATool, isLocalMcpServer, } from "./tools.js";
|
|
39
39
|
export type { LocalTool, LocalToolResult, LocalToolOutput, ToolResultFile, MantyxToolRef, MantyxPluginToolRef, ToolRef, ZodLikeObject, DefineLocalToolOptions, ReasoningLevel, A2AToolRef, LocalA2ATool, McpToolRef, LocalMcpServer, LocalMcpHttpTransport, LocalMcpStdioTransport, MantyxA2AOptions, DefineLocalA2AOptions, MantyxMcpOptions, DefineLocalMcpOptions, } from "./tools.js";
|
|
40
40
|
export { MantyxError, MantyxAuthError, MantyxNetworkError, MantyxParseError, MantyxScopeError, MantyxToolError, MantyxRunError, } from "./errors.js";
|
|
@@ -48,4 +48,3 @@ export { zodToJsonSchema, toToolParametersWire } from "./zod-to-json-schema.js";
|
|
|
48
48
|
export { readSseStream } from "./sse.js";
|
|
49
49
|
export type { SseEvent, SseStreamOptions } from "./sse.js";
|
|
50
50
|
export { SDK_VERSION } from "./version.js";
|
|
51
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
taskPlanFromEventData,
|
|
28
28
|
toToolParametersWire,
|
|
29
29
|
zodToJsonSchema
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-G46SVM2Q.js";
|
|
31
31
|
|
|
32
32
|
// src/oauth.ts
|
|
33
33
|
var DEFAULT_OAUTH_BASE_URL = "https://app.mantyx.io";
|
|
@@ -603,7 +603,7 @@ async function runComputerUse(opts) {
|
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
// src/version.ts
|
|
606
|
-
var SDK_VERSION = "
|
|
606
|
+
var SDK_VERSION = "2026.9.3";
|
|
607
607
|
export {
|
|
608
608
|
AgentSession,
|
|
609
609
|
COMPUTER_USE_ACTIONS,
|
|
@@ -645,4 +645,3 @@ export {
|
|
|
645
645
|
toToolParametersWire,
|
|
646
646
|
zodToJsonSchema
|
|
647
647
|
};
|
|
648
|
-
//# sourceMappingURL=index.js.map
|
package/dist/local-resolver.d.ts
CHANGED
package/dist/oauth.d.ts
CHANGED
package/dist/playwright.cjs
CHANGED
package/dist/playwright.d.ts
CHANGED
|
@@ -80,4 +80,3 @@ export declare class PlaywrightController implements BrowserController {
|
|
|
80
80
|
}
|
|
81
81
|
/** @internal Exported for unit tests. */
|
|
82
82
|
export declare function scrollDelta(direction: ScrollDirection, magnitude: number): [number, number];
|
|
83
|
-
//# sourceMappingURL=playwright.d.ts.map
|
package/dist/playwright.js
CHANGED
package/dist/sse.d.ts
CHANGED
|
@@ -24,4 +24,3 @@ export interface SseStreamOptions {
|
|
|
24
24
|
* Comment frames (`:keep-alive`) are dropped.
|
|
25
25
|
*/
|
|
26
26
|
export declare function readSseStream(body: ReadableStream<Uint8Array> | null, opts?: SseStreamOptions): AsyncGenerator<SseEvent, void, void>;
|
|
27
|
-
//# sourceMappingURL=sse.d.ts.map
|
package/dist/tools.d.ts
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Release version — synced from
|
|
2
|
+
* Release version — synced from sdk/VERSION (`pnpm run sync-version`).
|
|
3
3
|
*/
|
|
4
|
-
export declare const SDK_VERSION = "
|
|
5
|
-
//# sourceMappingURL=version.d.ts.map
|
|
4
|
+
export declare const SDK_VERSION = "2026.9.3";
|