@mantyx/sdk 0.22.0 → 0.22.1

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 (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/a2a-server.cjs.map +1 -1
  3. package/dist/a2a-server.d.ts +13 -16
  4. package/dist/a2a-server.d.ts.map +1 -0
  5. package/dist/a2a-server.js +1 -1
  6. package/dist/{chunk-5NKXV5XZ.js → chunk-STB4Z6F4.js} +25 -3
  7. package/dist/chunk-STB4Z6F4.js.map +1 -0
  8. package/dist/{client-C7TzTpNW.d.ts → client.d.ts} +83 -831
  9. package/dist/client.d.ts.map +1 -0
  10. package/dist/{computer-use-4QzI3lGU.d.ts → computer-use.d.ts} +21 -22
  11. package/dist/computer-use.d.ts.map +1 -0
  12. package/dist/errors.d.ts +153 -0
  13. package/dist/errors.d.ts.map +1 -0
  14. package/dist/index.cjs +25 -3
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.ts +44 -55
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +2 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/local-resolver.d.ts +49 -0
  21. package/dist/local-resolver.d.ts.map +1 -0
  22. package/dist/oauth.d.ts +189 -0
  23. package/dist/oauth.d.ts.map +1 -0
  24. package/dist/playwright.d.ts +6 -11
  25. package/dist/playwright.d.ts.map +1 -0
  26. package/dist/sse.d.ts +27 -0
  27. package/dist/sse.d.ts.map +1 -0
  28. package/dist/tools.d.ts +426 -0
  29. package/dist/tools.d.ts.map +1 -0
  30. package/dist/version.d.ts +5 -0
  31. package/dist/version.d.ts.map +1 -0
  32. package/dist/zod-to-json-schema.d.ts +25 -0
  33. package/dist/zod-to-json-schema.d.ts.map +1 -0
  34. package/package.json +11 -11
  35. package/dist/a2a-server.d.cts +0 -176
  36. package/dist/chunk-5NKXV5XZ.js.map +0 -1
  37. package/dist/client-C7TzTpNW.d.cts +0 -2033
  38. package/dist/computer-use-1m6E_VIl.d.cts +0 -193
  39. package/dist/index.d.cts +0 -61
  40. package/dist/playwright.d.cts +0 -88
@@ -1,10 +1,3 @@
1
- import { AgentCard } from '@a2a-js/sdk';
2
- export { AgentCard, Message, MessageSendParams, Task, TaskArtifactUpdateEvent, TaskStatusUpdateEvent } from '@a2a-js/sdk';
3
- import { AgentExecutor, RequestContext, ExecutionEventBus } from '@a2a-js/sdk/server';
4
- export { AgentExecutor, ExecutionEventBus, RequestContext } from '@a2a-js/sdk/server';
5
- import { M as MantyxClient, T as ToolRef, R as ReasoningLevel, O as OutputSchema } from './client-C7TzTpNW.js';
6
- import 'zod';
7
-
8
1
  /**
9
2
  * Expose a MANTYX agent over the [Agent2Agent (A2A)](https://google-a2a.github.io/A2A/)
10
3
  * protocol so other agents can talk to it as a peer.
@@ -44,7 +37,10 @@ import 'zod';
44
37
  *
45
38
  * console.log(`Listening on ${server.url}`);
46
39
  */
47
-
40
+ import type { AgentCard } from "@a2a-js/sdk";
41
+ import type { AgentExecutor, ExecutionEventBus, RequestContext } from "@a2a-js/sdk/server";
42
+ import { type MantyxClient, type OutputSchema } from "./client.js";
43
+ import type { ReasoningLevel, ToolRef } from "./tools.js";
48
44
  /**
49
45
  * Description of the MANTYX agent that should answer A2A requests.
50
46
  *
@@ -55,7 +51,7 @@ import 'zod';
55
51
  *
56
52
  * Either `agentId` or `systemPrompt` is required.
57
53
  */
58
- interface MantyxAgentSpec {
54
+ export interface MantyxAgentSpec {
59
55
  /** Reference to a persisted MANTYX agent. Mutually exclusive with `systemPrompt`. */
60
56
  agentId?: string;
61
57
  /** System prompt for an inline / ephemeral agent. Mutually exclusive with `agentId`. */
@@ -79,7 +75,7 @@ interface MantyxAgentSpec {
79
75
  */
80
76
  name?: string;
81
77
  }
82
- interface MantyxAgentExecutorOptions {
78
+ export interface MantyxAgentExecutorOptions {
83
79
  client: MantyxClient;
84
80
  agent: MantyxAgentSpec;
85
81
  /**
@@ -107,7 +103,7 @@ interface MantyxAgentExecutorOptions {
107
103
  */
108
104
  onAssistantDelta?: (delta: string, ctx: RequestContext, eventBus: ExecutionEventBus) => void;
109
105
  }
110
- interface ServeAgentOverA2AOptions extends MantyxAgentExecutorOptions {
106
+ export interface ServeAgentOverA2AOptions extends MantyxAgentExecutorOptions {
111
107
  /** A2A Agent Card published at `/.well-known/agent-card.json`. */
112
108
  agentCard: AgentCard;
113
109
  /** TCP port to listen on. Default: 0 (let the OS pick). */
@@ -124,7 +120,7 @@ interface ServeAgentOverA2AOptions extends MantyxAgentExecutorOptions {
124
120
  */
125
121
  restPath?: string | false;
126
122
  }
127
- interface ServeAgentOverA2AHandle {
123
+ export interface ServeAgentOverA2AHandle {
128
124
  /** Origin of the running server, e.g. `"http://localhost:4000"`. */
129
125
  url: string;
130
126
  /** Resolved port number (useful when you let the OS pick one). */
@@ -139,7 +135,7 @@ interface ServeAgentOverA2AHandle {
139
135
  * when you need to mount the executor inside an existing Express, Fastify, or
140
136
  * Connect app.
141
137
  */
142
- declare class MantyxAgentExecutor implements AgentExecutor {
138
+ export declare class MantyxAgentExecutor implements AgentExecutor {
143
139
  readonly client: MantyxClient;
144
140
  readonly agent: MantyxAgentSpec;
145
141
  readonly conversation: "auto" | "stateless";
@@ -171,6 +167,7 @@ declare class MantyxAgentExecutor implements AgentExecutor {
171
167
  * Throws if `express` / `@a2a-js/sdk` aren't installed; install them as peer
172
168
  * deps with `npm install express @a2a-js/sdk`.
173
169
  */
174
- declare function serveAgentOverA2A(options: ServeAgentOverA2AOptions): Promise<ServeAgentOverA2AHandle>;
175
-
176
- export { MantyxAgentExecutor, type MantyxAgentExecutorOptions, type MantyxAgentSpec, type ServeAgentOverA2AHandle, type ServeAgentOverA2AOptions, serveAgentOverA2A };
170
+ export declare function serveAgentOverA2A(options: ServeAgentOverA2AOptions): Promise<ServeAgentOverA2AHandle>;
171
+ export type { AgentCard, Message, MessageSendParams, Task, TaskArtifactUpdateEvent, TaskStatusUpdateEvent, } from "@a2a-js/sdk";
172
+ export type { AgentExecutor, ExecutionEventBus, RequestContext } from "@a2a-js/sdk/server";
173
+ //# sourceMappingURL=a2a-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"a2a-server.d.ts","sourceRoot":"","sources":["../src/a2a-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EACV,SAAS,EAOV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,YAAY,EAIlB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAI1D;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC9B,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;IACvB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;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AAC,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0DxF;IAEK,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3E;IAED;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAI3B;YAIa,OAAO;YAoBP,kBAAkB;YAelB,aAAa;CAa5B;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAiElC;AA4MD,YAAY,EACV,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,IAAI,EACJ,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MantyxError,
3
3
  MantyxRunError
4
- } from "./chunk-5NKXV5XZ.js";
4
+ } from "./chunk-STB4Z6F4.js";
5
5
 
6
6
  // src/a2a-server.ts
7
7
  var MantyxAgentExecutor = class {
@@ -328,12 +328,34 @@ function isZodSchema(value) {
328
328
  const o = value;
329
329
  return typeof o._def !== "undefined" || typeof o._zod !== "undefined";
330
330
  }
331
+ function normalizeWireJsonSchema(out, schema) {
332
+ const normalized = { ...out };
333
+ delete normalized.$schema;
334
+ delete normalized.additionalProperties;
335
+ const def = schema._def;
336
+ const kind = schemaKind(def);
337
+ if (kind === "ZodObject" || kind === "object") {
338
+ const shape = def?.shape;
339
+ const fields = typeof shape === "function" ? shape() : shape;
340
+ if (fields) {
341
+ const required = [];
342
+ for (const [key, value] of Object.entries(fields)) {
343
+ if (!isOptionalField(value)) {
344
+ required.push(key);
345
+ }
346
+ }
347
+ if (required.length > 0) normalized.required = required;
348
+ else delete normalized.required;
349
+ }
350
+ }
351
+ return normalized;
352
+ }
331
353
  function zodToJsonSchema(schema) {
332
354
  const instance = schema;
333
355
  if (typeof instance.toJSONSchema === "function") {
334
356
  try {
335
357
  const out = instance.toJSONSchema();
336
- if (out && typeof out === "object") return out;
358
+ if (out && typeof out === "object") return normalizeWireJsonSchema(out, schema);
337
359
  } catch {
338
360
  }
339
361
  }
@@ -341,7 +363,7 @@ function zodToJsonSchema(schema) {
341
363
  if (typeof builtIn === "function") {
342
364
  try {
343
365
  const out = builtIn.call(z, schema);
344
- if (out && typeof out === "object") return out;
366
+ if (out && typeof out === "object") return normalizeWireJsonSchema(out, schema);
345
367
  } catch {
346
368
  }
347
369
  }
@@ -1982,4 +2004,4 @@ export {
1982
2004
  AgentSession,
1983
2005
  parseRunOutput
1984
2006
  };
1985
- //# sourceMappingURL=chunk-5NKXV5XZ.js.map
2007
+ //# sourceMappingURL=chunk-STB4Z6F4.js.map