@runtypelabs/sdk 10.11.2 → 10.12.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.
package/README.md CHANGED
@@ -55,6 +55,37 @@ console.log(analysis)
55
55
  - **Error Handling**: Proper error handling with custom error types
56
56
  - **Zero Dependencies**: No external runtime dependencies
57
57
 
58
+ ## Expose an existing agent over A2A
59
+
60
+ Use `createA2AHandler` to expose a text-returning function through an A2A endpoint.
61
+ The handler uses Web `Request` and `Response` APIs and requires no framework dependency.
62
+
63
+ ```typescript
64
+ import { createA2AHandler } from '@runtypelabs/sdk'
65
+
66
+ export const handler = createA2AHandler({
67
+ name: 'Support agent',
68
+ url: 'http://localhost:4111/a2a',
69
+ run: async ({ text }) => `You sent: ${text}`,
70
+ })
71
+ ```
72
+
73
+ Mount the handler at `POST /a2a` and `GET /.well-known/agent-card.json` in your HTTP server.
74
+ For a public deployment, set `url` to the public endpoint and authenticate invocation POSTs before calling the handler.
75
+ Keep the basic agent card GET public; Runtype fetches that card without the invocation bearer token.
76
+ Authorize access to each conversation in your application before using its `contextId`.
77
+
78
+ Replace `run` with your framework's invocation and return its final text.
79
+ The callback receives `text`, the original text `message`, request `metadata`, a `contextId`, and an abort `signal`.
80
+ Store conversation history in your framework using `contextId`; the handler retains no history.
81
+ Pass `signal` to framework APIs that support cancellation.
82
+
83
+ The handler implements A2A 0.3 JSON-RPC `message/send` and returns a completed task with a text artifact.
84
+ It accepts text parts only and does not support streaming, retained tasks, or push notifications.
85
+ Requests are limited to 1 MiB by default; set `maxRequestBytes` to change that limit.
86
+ POSTs require `Content-Type: application/json`. If an `Origin` header is present, it must match the configured endpoint's origin.
87
+ Use the [official A2A JavaScript SDK](https://github.com/a2aproject/a2a-js) for the full protocol.
88
+
58
89
  ## FlowBuilder API
59
90
 
60
91
  The FlowBuilder provides a fluent interface for constructing and executing flows.
package/dist/index.cjs CHANGED
@@ -14068,6 +14068,174 @@ var Runtype = class {
14068
14068
  }
14069
14069
  };
14070
14070
  //#endregion
14071
+ //#region src/a2a-handler.ts
14072
+ function record(value) {
14073
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
14074
+ }
14075
+ function rpcError(id, code, message, status = 200) {
14076
+ return Response.json({
14077
+ jsonrpc: "2.0",
14078
+ id,
14079
+ error: {
14080
+ code,
14081
+ message
14082
+ }
14083
+ }, { status });
14084
+ }
14085
+ function isRpcId(value) {
14086
+ return value === null || typeof value === "string" || typeof value === "number" && Number.isFinite(value);
14087
+ }
14088
+ var RequestTooLargeError = class extends Error {};
14089
+ async function readRequest(request, limit) {
14090
+ const reader = request.body?.getReader();
14091
+ if (!reader) return JSON.parse("");
14092
+ const decoder = new TextDecoder();
14093
+ let size = 0;
14094
+ let text = "";
14095
+ const cancel = () => {
14096
+ reader.cancel().catch(() => void 0);
14097
+ };
14098
+ request.signal.addEventListener("abort", cancel, { once: true });
14099
+ try {
14100
+ request.signal.throwIfAborted();
14101
+ while (true) {
14102
+ const { done, value } = await reader.read();
14103
+ request.signal.throwIfAborted();
14104
+ if (done) break;
14105
+ size += value.byteLength;
14106
+ if (size > limit) {
14107
+ cancel();
14108
+ throw new RequestTooLargeError();
14109
+ }
14110
+ text += decoder.decode(value, { stream: true });
14111
+ }
14112
+ return JSON.parse(text + decoder.decode());
14113
+ } finally {
14114
+ request.signal.removeEventListener("abort", cancel);
14115
+ reader.releaseLock();
14116
+ }
14117
+ }
14118
+ function parseMessage(value) {
14119
+ const message = record(value);
14120
+ if (!message || message.role !== "user" && message.role !== "agent") return void 0;
14121
+ if (typeof message.messageId !== "string" || !message.messageId) return void 0;
14122
+ if (message.contextId !== void 0 && (typeof message.contextId !== "string" || !message.contextId)) return;
14123
+ if (message.metadata !== void 0 && !record(message.metadata)) return void 0;
14124
+ if (!Array.isArray(message.parts) || message.parts.length === 0) return void 0;
14125
+ for (const raw of message.parts) {
14126
+ const part = record(raw);
14127
+ if (!part || part.kind !== "text" || typeof part.text !== "string") return void 0;
14128
+ if (part.metadata !== void 0 && !record(part.metadata)) return void 0;
14129
+ }
14130
+ return message;
14131
+ }
14132
+ function validateSend(params, id) {
14133
+ if (record(params.message)?.taskId !== void 0) return rpcError(id, -32001, "Task not found");
14134
+ if (params.metadata !== void 0 && !record(params.metadata)) return rpcError(id, -32602, "Invalid metadata");
14135
+ const configuration = record(params.configuration);
14136
+ if (params.configuration !== void 0 && !configuration) return rpcError(id, -32602, "Invalid configuration");
14137
+ if (configuration?.pushNotificationConfig !== void 0) return rpcError(id, -32003, "Push notifications are not supported");
14138
+ const modes = configuration?.acceptedOutputModes;
14139
+ if (modes !== void 0 && (!Array.isArray(modes) || !modes.every((mode) => typeof mode === "string"))) return rpcError(id, -32602, "Invalid accepted output modes");
14140
+ if (Array.isArray(modes) && modes.length > 0 && !modes.includes("text/plain")) return rpcError(id, -32005, "Only text/plain output is supported");
14141
+ }
14142
+ /**
14143
+ * Serve POST at options.url and GET /.well-known/agent-card.json with Web APIs.
14144
+ * Supports A2A 0.3 message/send with text parts; no streaming or retained tasks.
14145
+ * The callback owns history, authorization of context IDs, and model cancellation.
14146
+ */
14147
+ function createA2AHandler(options) {
14148
+ const endpoint = new URL(options.url);
14149
+ if (!["http:", "https:"].includes(endpoint.protocol) || endpoint.username || endpoint.password || endpoint.search || endpoint.hash) throw new Error("A2A url must be an HTTP(S) endpoint without credentials, query, or fragment");
14150
+ if (!options.name.trim()) throw new Error("A2A name must not be empty");
14151
+ const limit = options.maxRequestBytes ?? 1048576;
14152
+ if (!Number.isSafeInteger(limit) || limit <= 0) throw new Error("maxRequestBytes must be a positive integer");
14153
+ const card = {
14154
+ protocolVersion: "0.3.0",
14155
+ name: options.name,
14156
+ description: options.description ?? options.name,
14157
+ url: endpoint.href,
14158
+ preferredTransport: "JSONRPC",
14159
+ version: "1.0.0",
14160
+ capabilities: {
14161
+ streaming: false,
14162
+ pushNotifications: false
14163
+ },
14164
+ defaultInputModes: ["text/plain"],
14165
+ defaultOutputModes: ["text/plain"],
14166
+ skills: [{
14167
+ id: "chat",
14168
+ name: options.name,
14169
+ description: options.description ?? options.name,
14170
+ tags: ["chat"]
14171
+ }]
14172
+ };
14173
+ return async (request) => {
14174
+ const path = new URL(request.url).pathname;
14175
+ if (request.method === "GET" && path === "/.well-known/agent-card.json") return Response.json(card);
14176
+ if (path !== endpoint.pathname) return new Response("Not found", { status: 404 });
14177
+ if (request.method !== "POST") return new Response("Method not allowed", {
14178
+ status: 405,
14179
+ headers: { Allow: "POST" }
14180
+ });
14181
+ if (request.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase() !== "application/json") return rpcError(null, -32600, "Content-Type must be application/json", 415);
14182
+ const origin = request.headers.get("origin");
14183
+ if (origin !== null && origin !== endpoint.origin) return rpcError(null, -32600, "Origin is not allowed", 403);
14184
+ const version = request.headers.get("a2a-version");
14185
+ if (version && version !== "0.3" && version !== "0.3.0") return rpcError(null, -32009, "Only A2A 0.3 is supported", 400);
14186
+ if (request.signal.aborted) return rpcError(null, -32603, "Request cancelled");
14187
+ let body;
14188
+ try {
14189
+ body = await readRequest(request, limit);
14190
+ } catch (error) {
14191
+ if (request.signal.aborted) return rpcError(null, -32603, "Request cancelled");
14192
+ return error instanceof RequestTooLargeError ? rpcError(null, -32600, "Request body too large", 413) : rpcError(null, -32700, "Invalid JSON");
14193
+ }
14194
+ const rpc = record(body);
14195
+ if (!rpc || rpc.jsonrpc !== "2.0" || !isRpcId(rpc.id) || typeof rpc.method !== "string") return rpcError(null, -32600, "Invalid JSON-RPC request");
14196
+ const id = rpc.id;
14197
+ if (rpc.method !== "message/send") return rpcError(id, -32601, "Method not supported");
14198
+ const params = record(rpc.params);
14199
+ if (!params) return rpcError(id, -32602, "Invalid message parameters");
14200
+ const invalid = validateSend(params, id);
14201
+ if (invalid) return invalid;
14202
+ const message = parseMessage(params.message);
14203
+ if (!message) return rpcError(id, -32602, "Expected a message with a messageId, role, and text parts");
14204
+ const contextId = message.contextId ?? crypto.randomUUID();
14205
+ try {
14206
+ request.signal.throwIfAborted();
14207
+ const output = await options.run({
14208
+ text: message.parts.map((part) => part.text).join(""),
14209
+ contextId,
14210
+ message,
14211
+ metadata: record(params.metadata) ?? {},
14212
+ signal: request.signal
14213
+ });
14214
+ request.signal.throwIfAborted();
14215
+ if (typeof output !== "string") return rpcError(id, -32603, "Agent must return text");
14216
+ return Response.json({
14217
+ jsonrpc: "2.0",
14218
+ id,
14219
+ result: {
14220
+ kind: "task",
14221
+ id: crypto.randomUUID(),
14222
+ contextId,
14223
+ status: { state: "completed" },
14224
+ artifacts: [{
14225
+ artifactId: crypto.randomUUID(),
14226
+ parts: [{
14227
+ kind: "text",
14228
+ text: output
14229
+ }]
14230
+ }]
14231
+ }
14232
+ });
14233
+ } catch {
14234
+ return rpcError(id, -32603, request.signal.aborted ? "Request cancelled" : "Agent execution failed");
14235
+ }
14236
+ };
14237
+ }
14238
+ //#endregion
14071
14239
  //#region src/agent-promotion.ts
14072
14240
  const MANIFEST_VERSION = 1;
14073
14241
  /** Receipts read per page, and the page ceiling, while hunting the staged receipt. */
@@ -14277,7 +14445,7 @@ function transformQueryParams(params) {
14277
14445
  }
14278
14446
  //#endregion
14279
14447
  //#region src/version.ts
14280
- const SDK_VERSION = "10.11.2";
14448
+ const SDK_VERSION = "10.12.1";
14281
14449
  /**
14282
14450
  * Canonical client identity the API uses for attribution
14283
14451
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -16595,6 +16763,7 @@ exports.computeSurfaceContentHash = computeSurfaceContentHash;
16595
16763
  exports.computeToolContentHash = computeToolContentHash;
16596
16764
  exports.contains = contains;
16597
16765
  exports.cost = cost;
16766
+ exports.createA2AHandler = createA2AHandler;
16598
16767
  exports.createAgentEventTranslator = createAgentEventTranslator;
16599
16768
  exports.createClient = createClient;
16600
16769
  exports.createExternalTool = createExternalTool;
package/dist/index.d.cts CHANGED
@@ -1283,10 +1283,11 @@ interface paths {
1283
1283
  }[];
1284
1284
  version?: string;
1285
1285
  };
1286
+ deviceId?: string;
1286
1287
  /** Format: uri */
1287
1288
  endpoint: string;
1288
1289
  /** @enum {string} */
1289
- framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "custom";
1290
+ framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "mastra" | "custom";
1290
1291
  /** @enum {string} */
1291
1292
  protocol?: "a2a" | "runtype-stream";
1292
1293
  retryCount?: number;
@@ -1323,6 +1324,8 @@ interface paths {
1323
1324
  role?: "orchestrator" | "tool" | "standalone" | "hidden";
1324
1325
  }[];
1325
1326
  timeoutMs?: number;
1327
+ /** @enum {string} */
1328
+ transport?: "http" | "device";
1326
1329
  };
1327
1330
  icon?: string;
1328
1331
  maxTurns?: number;
@@ -1881,7 +1884,7 @@ interface paths {
1881
1884
  put?: never;
1882
1885
  /**
1883
1886
  * Fetch external agent card
1884
- * @description Proxy-fetch an external agent card from a URL, avoiding CORS issues. The URL is validated against SSRF attacks.
1887
+ * @description Proxy-fetch an external agent card from a URL, avoiding CORS issues. The URL is validated against SSRF attacks. With `transport: "device"`, the card is fetched through the paired local listener `deviceId`, so the URL must be a loopback address on that machine. Pass `bearerToken` when the card itself requires one.
1885
1888
  */
1886
1889
  post: {
1887
1890
  parameters: {
@@ -1893,6 +1896,15 @@ interface paths {
1893
1896
  requestBody?: {
1894
1897
  content: {
1895
1898
  "application/json": {
1899
+ /** @description Sent as `Authorization: Bearer` on the card request. Never stored or echoed. */
1900
+ bearerToken?: string;
1901
+ /** @description The paired listener to fetch through. Required when transport is "device". */
1902
+ deviceId?: string;
1903
+ /**
1904
+ * @description How to reach the card: directly (default) or through a paired local listener
1905
+ * @enum {string}
1906
+ */
1907
+ transport?: "http" | "device";
1896
1908
  /** Format: uri */
1897
1909
  url: string;
1898
1910
  };
@@ -2606,10 +2618,11 @@ interface paths {
2606
2618
  }[];
2607
2619
  version?: string;
2608
2620
  } | null;
2621
+ deviceId?: string | null;
2609
2622
  /** Format: uri */
2610
2623
  endpoint?: string;
2611
2624
  /** @enum {string|null} */
2612
- framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "custom" | null;
2625
+ framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "mastra" | "custom" | null;
2613
2626
  /** @enum {string|null} */
2614
2627
  protocol?: "a2a" | "runtype-stream" | null;
2615
2628
  retryCount?: number | null;
@@ -2646,6 +2659,8 @@ interface paths {
2646
2659
  role?: "orchestrator" | "tool" | "standalone" | "hidden";
2647
2660
  }[] | null;
2648
2661
  timeoutMs?: number | null;
2662
+ /** @enum {string|null} */
2663
+ transport?: "http" | "device" | null;
2649
2664
  } | null;
2650
2665
  icon?: string;
2651
2666
  maxTurns?: number;
@@ -4475,6 +4490,15 @@ interface paths {
4475
4490
  "application/json": components["schemas"]["Error"];
4476
4491
  };
4477
4492
  };
4493
+ /** @description An external agent call failed upstream: rejected credentials, rate limited, an HTTP error, a network failure, or an invalid response */
4494
+ 502: {
4495
+ headers: {
4496
+ [name: string]: unknown;
4497
+ };
4498
+ content: {
4499
+ "application/json": components["schemas"]["Error"];
4500
+ };
4501
+ };
4478
4502
  /** @description Asynchronous execution unavailable */
4479
4503
  503: {
4480
4504
  headers: {
@@ -4484,6 +4508,15 @@ interface paths {
4484
4508
  "application/json": components["schemas"]["Error"];
4485
4509
  };
4486
4510
  };
4511
+ /** @description An external agent call timed out */
4512
+ 504: {
4513
+ headers: {
4514
+ [name: string]: unknown;
4515
+ };
4516
+ content: {
4517
+ "application/json": components["schemas"]["Error"];
4518
+ };
4519
+ };
4487
4520
  };
4488
4521
  };
4489
4522
  delete?: never;
@@ -12984,7 +13017,7 @@ interface paths {
12984
13017
  mcpUrl: string;
12985
13018
  name: string;
12986
13019
  /** @enum {string} */
12987
- platform: "macos";
13020
+ platform: "macos" | "cli";
12988
13021
  publicKeyFingerprint: string;
12989
13022
  revokedAt: string | null;
12990
13023
  status: {
@@ -13028,6 +13061,87 @@ interface paths {
13028
13061
  patch?: never;
13029
13062
  trace?: never;
13030
13063
  };
13064
+ "/v1/devices/loopback": {
13065
+ parameters: {
13066
+ query?: never;
13067
+ header?: never;
13068
+ path?: never;
13069
+ cookie?: never;
13070
+ };
13071
+ get?: never;
13072
+ put?: never;
13073
+ /** Register this computer as a local loopback device (development only) */
13074
+ post: {
13075
+ parameters: {
13076
+ query?: never;
13077
+ header?: never;
13078
+ path?: never;
13079
+ cookie?: never;
13080
+ };
13081
+ requestBody?: {
13082
+ content: {
13083
+ "application/json": Record<string, never>;
13084
+ };
13085
+ };
13086
+ responses: {
13087
+ /** @description Loopback device ready */
13088
+ 201: {
13089
+ headers: {
13090
+ [name: string]: unknown;
13091
+ };
13092
+ content: {
13093
+ "application/json": {
13094
+ data: {
13095
+ appVersion: string | null;
13096
+ createdAt: string;
13097
+ id: string;
13098
+ lastAuthenticatedAt: string | null;
13099
+ /** Format: uri */
13100
+ mcpUrl: string;
13101
+ name: string;
13102
+ /** @enum {string} */
13103
+ platform: "macos" | "cli";
13104
+ publicKeyFingerprint: string;
13105
+ revokedAt: string | null;
13106
+ status: {
13107
+ appVersion?: string;
13108
+ availableTools: string[];
13109
+ deviceId: string;
13110
+ lastSeenAt?: string;
13111
+ online: boolean;
13112
+ protocolVersion?: number;
13113
+ };
13114
+ updatedAt: string;
13115
+ };
13116
+ };
13117
+ };
13118
+ };
13119
+ /** @description Unauthorized */
13120
+ 401: {
13121
+ headers: {
13122
+ [name: string]: unknown;
13123
+ };
13124
+ content: {
13125
+ "application/json": components["schemas"]["Error"];
13126
+ };
13127
+ };
13128
+ /** @description Forbidden */
13129
+ 403: {
13130
+ headers: {
13131
+ [name: string]: unknown;
13132
+ };
13133
+ content: {
13134
+ "application/json": components["schemas"]["Error"];
13135
+ };
13136
+ };
13137
+ };
13138
+ };
13139
+ delete?: never;
13140
+ options?: never;
13141
+ head?: never;
13142
+ patch?: never;
13143
+ trace?: never;
13144
+ };
13031
13145
  "/v1/devices/pair": {
13032
13146
  parameters: {
13033
13147
  query?: never;
@@ -13052,7 +13166,7 @@ interface paths {
13052
13166
  code: string;
13053
13167
  name: string;
13054
13168
  /** @enum {string} */
13055
- platform: "macos";
13169
+ platform: "macos" | "cli";
13056
13170
  publicKey: string;
13057
13171
  };
13058
13172
  };
@@ -13072,7 +13186,7 @@ interface paths {
13072
13186
  lastAuthenticatedAt: string | null;
13073
13187
  name: string;
13074
13188
  /** @enum {string} */
13075
- platform: "macos";
13189
+ platform: "macos" | "cli";
13076
13190
  publicKeyFingerprint: string;
13077
13191
  revokedAt: string | null;
13078
13192
  updatedAt: string;
@@ -13215,7 +13329,7 @@ interface paths {
13215
13329
  mcpUrl: string;
13216
13330
  name: string;
13217
13331
  /** @enum {string} */
13218
- platform: "macos";
13332
+ platform: "macos" | "cli";
13219
13333
  publicKeyFingerprint: string;
13220
13334
  revokedAt: string | null;
13221
13335
  status: {
@@ -13401,7 +13515,7 @@ interface paths {
13401
13515
  lastAuthenticatedAt: string | null;
13402
13516
  name: string;
13403
13517
  /** @enum {string} */
13404
- platform: "macos";
13518
+ platform: "macos" | "cli";
13405
13519
  publicKeyFingerprint: string;
13406
13520
  revokedAt: string | null;
13407
13521
  updatedAt: string;
@@ -63615,6 +63729,42 @@ export declare class Runtype {
63615
63729
  static get clientTokens(): ClientTokensNamespace;
63616
63730
  }
63617
63731
  //#endregion
63732
+ //#region src/a2a-handler.d.ts
63733
+ /** The text-only A2A 0.3 message delivered to a framework callback. */
63734
+ interface A2ATextMessage {
63735
+ role: 'user' | 'agent';
63736
+ messageId: string;
63737
+ parts: Array<{
63738
+ kind: 'text';
63739
+ text: string;
63740
+ metadata?: Record<string, unknown>;
63741
+ }>;
63742
+ contextId?: string;
63743
+ metadata?: Record<string, unknown>;
63744
+ }
63745
+ /** A single incoming turn; persist conversation history in the framework using contextId. */
63746
+ interface A2ARunInput {
63747
+ text: string;
63748
+ contextId: string;
63749
+ message: A2ATextMessage;
63750
+ metadata: Record<string, unknown>;
63751
+ signal: AbortSignal;
63752
+ }
63753
+ /** Configure a synchronous text adapter. Authenticate invocation POSTs before calling the handler. */
63754
+ interface A2AHandlerOptions {
63755
+ name: string;
63756
+ description?: string;
63757
+ url: string;
63758
+ maxRequestBytes?: number;
63759
+ run: (input: A2ARunInput) => string | Promise<string>;
63760
+ }
63761
+ /**
63762
+ * Serve POST at options.url and GET /.well-known/agent-card.json with Web APIs.
63763
+ * Supports A2A 0.3 message/send with text parts; no streaming or retained tasks.
63764
+ * The callback owns history, authorization of context IDs, and model cancellation.
63765
+ */
63766
+ export declare function createA2AHandler(options: A2AHandlerOptions): (request: Request) => Promise<Response>;
63767
+ //#endregion
63618
63768
  //#region src/agent-promotion.d.ts
63619
63769
  /**
63620
63770
  * The HTTP surface a promotion leg needs from one organization's credentials.
@@ -68978,5 +69128,5 @@ export declare function getLikelySupportingCandidatePaths(bestCandidatePath: str
68978
69128
  export declare function getDefaultPlanPath(taskName: string): string;
68979
69129
  export declare function sanitizeTaskSlug(taskName: string): string;
68980
69130
  //#endregion
68981
- export type { AIGrader, ActivateAgentAliasInput, ActivateAgentPromotionInput, AgentAlias, AgentAliasActivation, AgentAliasArchiveFailure, AgentAliasArchived, AgentAliasList, AgentAliasTransport, AgentCapabilityChange, AgentCapabilityDeclaration, AgentDefinition, AgentDefinitionConfig, AgentDeploymentList, AgentDeploymentPromotion, AgentDeploymentReceipt, AgentPromotionManifest, AgentPromotionTransport, AgentPromotionValidation, AgentPullResult, AgentSkillBinding, AgentSkillBindingChange, AgentStreamEvent, ApiKeyRequest, ApiKeyRequestDelivery, ApiKeyRequestEnvironment, ApiKeyRequestHandoff, ApiKeyRequestListParams, ApiKeyRequestRequester, ApiKeyRequestStatus, ApplyGeneratedProposalOptions, ApplyGeneratedProposalResult, ArchiveAgentAliasEverywhereResult, ArchiveAgentAliasInput, AttachRuntimeToolsOptions, BatchClient, BatchListParams, BatchOptions, BatchRequest, BatchResult, BatchScheduleConfig, BatchStatus, BindSkillInput, BuiltInGraderId, CaseExpected, CheckGrader, ClaimApiKeyRequestInput, ClaimApiKeyRequestResponse, ClientConversation, ClientToken, ClientTokenConfig, ClientTokenDefinition, ClientTokenEnvironment, ClientTokenVersionPin, ClientWidgetTheme, CollectionPullResult, CollectionSchemaChange, ConditionalGetResult, ConditionalStepConfig, ContextErrorHandling, ContextFallback, CreateApiKeyRequestInput, CreateApiKeyRequestResponse, CreateClientTokenRequest, CreateClientTokenResponse, CreateEvalSuiteInput, CreatePromptData, DecomposeCriteriaResult, DefineAgentInput, DefineEvalCaseInput, DefineEvalInput, DefineFlowInput, DefineProductInput, DefineScheduleInput, DefineSkillInput, DefineSurfaceInput, DefineToolInput, DetachedReattach, DetachedReconnectOptions, DispatchClient, DispatchEvent, DispatchOptions, EnsureAgentConverged, EnsureAgentOptions, EnsureAgentPlan, EnsureAgentResult, EnsureClientTokenConverged, EnsureClientTokenOptions, EnsureClientTokenPlan, EnsureClientTokenResult, EnsureCollectionConverged, EnsureCollectionOptions, EnsureCollectionPlan, EnsureCollectionResult, EnsureEvalApplyOptions, EnsureEvalOptions, EnsureEvalPlan, EnsureEvalResult, EnsureFlowConverged, EnsureFlowOptions, EnsureFlowPlan, EnsureFlowResult, EnsureFpoOptions, EnsureFpoResult, EnsureProductConverged, EnsureProductOptions, EnsureProductPlan, EnsureProductResult, EnsureQuestionSetConverged, EnsureQuestionSetOptions, EnsureQuestionSetPlan, EnsureQuestionSetResult, EnsureScheduleConverged, EnsureScheduleOptions, EnsureSchedulePlan, EnsureScheduleResult, EnsureSkillConverged, EnsureSkillOptions, EnsureSkillPlan, EnsureSkillResult, EnsureSurfaceConverged, EnsureSurfaceOptions, EnsureSurfacePlan, EnsureSurfaceResult, EnsureToolConverged, EnsureToolOptions, EnsureToolPlan, EnsureToolResult, ErrorHandlingMode, EvalAgentSelector, EvalAgentTargetResolution, EvalCaseDefinition, EvalCaseInput, EvalCaseProposal, EvalCaseProposalAccepted, EvalCaseProposalListResult, EvalCasesGenerated, EvalClient, EvalDefinition, EvalListParams, EvalMessage, EvalOptions, EvalProposalSource, EvalProposalStatus, EvalProposedCase, EvalPullResult, EvalRecord, EvalRequest, EvalResult, EvalRunCaseScores, EvalRunConfig, EvalRunEvidence, EvalRunScores, EvalStatus, EvalSuiteCase, EvalSuiteCaseInput, EvalSuiteCoverage, EvalSuiteDetail, EvalSuiteLatestRun, EvalSuiteListResult, EvalSuiteRunQueued, EvalSuiteRunResult, EvalSuiteSummary, EvalTarget, ExecutionStreamEvent, FallbackFailEvent, FallbackStartEvent, FallbackSuccessEvent, FallbackTrigger, FallbackTriggerType, FallbacksExhaustedEvent, FallbacksInitiatedEvent, FetchUrlStepConfig, FieldFormat, FlowCompleteEvent, FlowConfig, FlowDefinition, FlowDefinitionStep, FlowErrorEvent, FlowFallback, FlowInlineEvalInput, FlowPausedEvent, FlowPullResult, FlowStartEvent, FlowStreamEvent, FlowSummary, FlowValidationClient, FlowValidationIssue, FlowValidationResult, FpoEntityOutcome, FpoInput, GenerateEmbeddingStepConfig, GenerateEvalCasesInput, GeneratedRuntimeToolGateDecision, GeneratedRuntimeToolGateOptions, GetApiKeyRequestResponse, GetRecordStepConfig, Gradeable, GraderConfig, GraderOutcome, GraderSeverity, HumanVerdict, ListAgentAliasesOptions, ListAgentDeploymentsOptions, ListConversationsResponse, ListRecordsStepConfig, LoopStepConfig, Message, MessageFallback, ModelFallback, ModelOverride, OrganizationAgentAlias, OrganizationAgentAliasList, PersistedGraderOutcome, PrepareAgentPromotionInput, ProductDefinition, ProductPullResult, PromoteAgentInput, PromoteAgentResult, PromptErrorHandling, PromptFallback, PromptListParams, PromptStepConfig, PullFpoResult, QuestionSetDefinition, QuestionSetPullResult, RecordCollectionDefinition, RecordCollectionValidationMode, RecordConfig, RecordFilter, RecordFilterCondition, RecordFilterGroup, RecordFilterOperator, RetrieveRecordStepConfig, RetryFallback, RollbackAgentAliasInput, RunEvalCaseResult, RunEvalInput, RunEvalResult, RunListParams, RunListResponse, RunListRow, AgentSkillBinding$1 as RuntypeAgentSkillBinding, ConditionalStepConfig$1 as RuntypeConditionalStepConfig, RuntypeConfig, FetchUrlStepConfig$1 as RuntypeFetchUrlStepConfig, FlowConfig$1 as RuntypeFlowConfig, GenerateEmbeddingStepConfig$1 as RuntypeGenerateEmbeddingStepConfig, GetRecordStepConfig$1 as RuntypeGetRecordStepConfig, ListRecordsStepConfig$1 as RuntypeListRecordsStepConfig, LoopStepConfig$1 as RuntypeLoopStepConfig, Message$1 as RuntypeMessage, ModelOverride$1 as RuntypeModelOverride, Prompt$1 as RuntypePrompt, PromptStepConfig$1 as RuntypePromptStepConfig, RecordConfig$1 as RuntypeRecordConfig, RetrieveRecordStepConfig$1 as RuntypeRetrieveRecordStepConfig, SearchStepConfig as RuntypeSearchStepConfig, SendEmailStepConfig as RuntypeSendEmailStepConfig, SendEventStepConfig as RuntypeSendEventStepConfig, SendStreamStepConfig as RuntypeSendStreamStepConfig, SetVariableStepConfig as RuntypeSetVariableStepConfig, Skill as RuntypeSkill, SkillBindingWithAgent as RuntypeSkillBindingWithAgent, SkillCapabilities as RuntypeSkillCapabilities, SkillFrontmatter as RuntypeSkillFrontmatter, SkillManifest as RuntypeSkillManifest, SkillProposal as RuntypeSkillProposal, SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, SkillVersion as RuntypeSkillVersion, TransformDataStepConfig as RuntypeTransformDataStepConfig, UpsertFlowConfig as RuntypeUpsertFlowConfig, UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, VectorSearchStepConfig as RuntypeVectorSearchStepConfig, WaitUntilStepConfig as RuntypeWaitUntilStepConfig, ScheduleDefinition, ScheduleDefinitionMessage, ScheduleEnsureTransport, SchedulePullResult, SearchStepConfig$1 as SearchStepConfig, SendEmailStepConfig$1 as SendEmailStepConfig, SendEventStepConfig$1 as SendEventStepConfig, SendStreamStepConfig$1 as SendStreamStepConfig, SetVariableStepConfig$1 as SetVariableStepConfig, SkillDefinition, SkillListPage, SkillListPagination, SkillListParams, SkillManifestInput, SkillMarkdownInput, SkillOrigin, SkillProposalStatus, SkillPullResult, SkillStatus, SkillTrustLevel, SkillVersionStatus, SkillWithVersion, SkillWriteInput, StepCompleteEvent, StepDeltaEvent, StepFallback, StepFieldMeta, StepStartEvent, StepWaitingLocalEvent, StreamCallbacks, StreamConsumeOptions, StreamEvent, StreamEventOf, SurfaceDefinition, SurfaceDefinitionStatus, SurfaceDefinitionType, SurfacePullResult, ToolDefinition, ToolDefinitionType, ToolPullResult, TransformDataStepConfig$1 as TransformDataStepConfig, UpdateClientTokenRequest, UpdateEvalCaseInput, UpdateEvalSuiteInput, UpdatePromptData, UpsertFlowConfig$1 as UpsertFlowConfig, UpsertRecordStepConfig$1 as UpsertRecordStepConfig, ValidateAgentPromotionInput, VectorSearchStepConfig$1 as VectorSearchStepConfig, WaitUntilStepConfig$1 as WaitUntilStepConfig, WorkflowCompileDeps, WorkflowCompletionCriteriaConfig, WorkflowConfig, WorkflowConfigFactory, WorkflowHookEntry, WorkflowHookKind, WorkflowHookRef, WorkflowHookSignatures, WorkflowMilestoneConfig, WorkflowPolicyConfig, WorkflowRecoveryConfig, WorkflowSlot };
69131
+ export type { A2AHandlerOptions, A2ARunInput, A2ATextMessage, AIGrader, ActivateAgentAliasInput, ActivateAgentPromotionInput, AgentAlias, AgentAliasActivation, AgentAliasArchiveFailure, AgentAliasArchived, AgentAliasList, AgentAliasTransport, AgentCapabilityChange, AgentCapabilityDeclaration, AgentDefinition, AgentDefinitionConfig, AgentDeploymentList, AgentDeploymentPromotion, AgentDeploymentReceipt, AgentPromotionManifest, AgentPromotionTransport, AgentPromotionValidation, AgentPullResult, AgentSkillBinding, AgentSkillBindingChange, AgentStreamEvent, ApiKeyRequest, ApiKeyRequestDelivery, ApiKeyRequestEnvironment, ApiKeyRequestHandoff, ApiKeyRequestListParams, ApiKeyRequestRequester, ApiKeyRequestStatus, ApplyGeneratedProposalOptions, ApplyGeneratedProposalResult, ArchiveAgentAliasEverywhereResult, ArchiveAgentAliasInput, AttachRuntimeToolsOptions, BatchClient, BatchListParams, BatchOptions, BatchRequest, BatchResult, BatchScheduleConfig, BatchStatus, BindSkillInput, BuiltInGraderId, CaseExpected, CheckGrader, ClaimApiKeyRequestInput, ClaimApiKeyRequestResponse, ClientConversation, ClientToken, ClientTokenConfig, ClientTokenDefinition, ClientTokenEnvironment, ClientTokenVersionPin, ClientWidgetTheme, CollectionPullResult, CollectionSchemaChange, ConditionalGetResult, ConditionalStepConfig, ContextErrorHandling, ContextFallback, CreateApiKeyRequestInput, CreateApiKeyRequestResponse, CreateClientTokenRequest, CreateClientTokenResponse, CreateEvalSuiteInput, CreatePromptData, DecomposeCriteriaResult, DefineAgentInput, DefineEvalCaseInput, DefineEvalInput, DefineFlowInput, DefineProductInput, DefineScheduleInput, DefineSkillInput, DefineSurfaceInput, DefineToolInput, DetachedReattach, DetachedReconnectOptions, DispatchClient, DispatchEvent, DispatchOptions, EnsureAgentConverged, EnsureAgentOptions, EnsureAgentPlan, EnsureAgentResult, EnsureClientTokenConverged, EnsureClientTokenOptions, EnsureClientTokenPlan, EnsureClientTokenResult, EnsureCollectionConverged, EnsureCollectionOptions, EnsureCollectionPlan, EnsureCollectionResult, EnsureEvalApplyOptions, EnsureEvalOptions, EnsureEvalPlan, EnsureEvalResult, EnsureFlowConverged, EnsureFlowOptions, EnsureFlowPlan, EnsureFlowResult, EnsureFpoOptions, EnsureFpoResult, EnsureProductConverged, EnsureProductOptions, EnsureProductPlan, EnsureProductResult, EnsureQuestionSetConverged, EnsureQuestionSetOptions, EnsureQuestionSetPlan, EnsureQuestionSetResult, EnsureScheduleConverged, EnsureScheduleOptions, EnsureSchedulePlan, EnsureScheduleResult, EnsureSkillConverged, EnsureSkillOptions, EnsureSkillPlan, EnsureSkillResult, EnsureSurfaceConverged, EnsureSurfaceOptions, EnsureSurfacePlan, EnsureSurfaceResult, EnsureToolConverged, EnsureToolOptions, EnsureToolPlan, EnsureToolResult, ErrorHandlingMode, EvalAgentSelector, EvalAgentTargetResolution, EvalCaseDefinition, EvalCaseInput, EvalCaseProposal, EvalCaseProposalAccepted, EvalCaseProposalListResult, EvalCasesGenerated, EvalClient, EvalDefinition, EvalListParams, EvalMessage, EvalOptions, EvalProposalSource, EvalProposalStatus, EvalProposedCase, EvalPullResult, EvalRecord, EvalRequest, EvalResult, EvalRunCaseScores, EvalRunConfig, EvalRunEvidence, EvalRunScores, EvalStatus, EvalSuiteCase, EvalSuiteCaseInput, EvalSuiteCoverage, EvalSuiteDetail, EvalSuiteLatestRun, EvalSuiteListResult, EvalSuiteRunQueued, EvalSuiteRunResult, EvalSuiteSummary, EvalTarget, ExecutionStreamEvent, FallbackFailEvent, FallbackStartEvent, FallbackSuccessEvent, FallbackTrigger, FallbackTriggerType, FallbacksExhaustedEvent, FallbacksInitiatedEvent, FetchUrlStepConfig, FieldFormat, FlowCompleteEvent, FlowConfig, FlowDefinition, FlowDefinitionStep, FlowErrorEvent, FlowFallback, FlowInlineEvalInput, FlowPausedEvent, FlowPullResult, FlowStartEvent, FlowStreamEvent, FlowSummary, FlowValidationClient, FlowValidationIssue, FlowValidationResult, FpoEntityOutcome, FpoInput, GenerateEmbeddingStepConfig, GenerateEvalCasesInput, GeneratedRuntimeToolGateDecision, GeneratedRuntimeToolGateOptions, GetApiKeyRequestResponse, GetRecordStepConfig, Gradeable, GraderConfig, GraderOutcome, GraderSeverity, HumanVerdict, ListAgentAliasesOptions, ListAgentDeploymentsOptions, ListConversationsResponse, ListRecordsStepConfig, LoopStepConfig, Message, MessageFallback, ModelFallback, ModelOverride, OrganizationAgentAlias, OrganizationAgentAliasList, PersistedGraderOutcome, PrepareAgentPromotionInput, ProductDefinition, ProductPullResult, PromoteAgentInput, PromoteAgentResult, PromptErrorHandling, PromptFallback, PromptListParams, PromptStepConfig, PullFpoResult, QuestionSetDefinition, QuestionSetPullResult, RecordCollectionDefinition, RecordCollectionValidationMode, RecordConfig, RecordFilter, RecordFilterCondition, RecordFilterGroup, RecordFilterOperator, RetrieveRecordStepConfig, RetryFallback, RollbackAgentAliasInput, RunEvalCaseResult, RunEvalInput, RunEvalResult, RunListParams, RunListResponse, RunListRow, AgentSkillBinding$1 as RuntypeAgentSkillBinding, ConditionalStepConfig$1 as RuntypeConditionalStepConfig, RuntypeConfig, FetchUrlStepConfig$1 as RuntypeFetchUrlStepConfig, FlowConfig$1 as RuntypeFlowConfig, GenerateEmbeddingStepConfig$1 as RuntypeGenerateEmbeddingStepConfig, GetRecordStepConfig$1 as RuntypeGetRecordStepConfig, ListRecordsStepConfig$1 as RuntypeListRecordsStepConfig, LoopStepConfig$1 as RuntypeLoopStepConfig, Message$1 as RuntypeMessage, ModelOverride$1 as RuntypeModelOverride, Prompt$1 as RuntypePrompt, PromptStepConfig$1 as RuntypePromptStepConfig, RecordConfig$1 as RuntypeRecordConfig, RetrieveRecordStepConfig$1 as RuntypeRetrieveRecordStepConfig, SearchStepConfig as RuntypeSearchStepConfig, SendEmailStepConfig as RuntypeSendEmailStepConfig, SendEventStepConfig as RuntypeSendEventStepConfig, SendStreamStepConfig as RuntypeSendStreamStepConfig, SetVariableStepConfig as RuntypeSetVariableStepConfig, Skill as RuntypeSkill, SkillBindingWithAgent as RuntypeSkillBindingWithAgent, SkillCapabilities as RuntypeSkillCapabilities, SkillFrontmatter as RuntypeSkillFrontmatter, SkillManifest as RuntypeSkillManifest, SkillProposal as RuntypeSkillProposal, SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, SkillVersion as RuntypeSkillVersion, TransformDataStepConfig as RuntypeTransformDataStepConfig, UpsertFlowConfig as RuntypeUpsertFlowConfig, UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, VectorSearchStepConfig as RuntypeVectorSearchStepConfig, WaitUntilStepConfig as RuntypeWaitUntilStepConfig, ScheduleDefinition, ScheduleDefinitionMessage, ScheduleEnsureTransport, SchedulePullResult, SearchStepConfig$1 as SearchStepConfig, SendEmailStepConfig$1 as SendEmailStepConfig, SendEventStepConfig$1 as SendEventStepConfig, SendStreamStepConfig$1 as SendStreamStepConfig, SetVariableStepConfig$1 as SetVariableStepConfig, SkillDefinition, SkillListPage, SkillListPagination, SkillListParams, SkillManifestInput, SkillMarkdownInput, SkillOrigin, SkillProposalStatus, SkillPullResult, SkillStatus, SkillTrustLevel, SkillVersionStatus, SkillWithVersion, SkillWriteInput, StepCompleteEvent, StepDeltaEvent, StepFallback, StepFieldMeta, StepStartEvent, StepWaitingLocalEvent, StreamCallbacks, StreamConsumeOptions, StreamEvent, StreamEventOf, SurfaceDefinition, SurfaceDefinitionStatus, SurfaceDefinitionType, SurfacePullResult, ToolDefinition, ToolDefinitionType, ToolPullResult, TransformDataStepConfig$1 as TransformDataStepConfig, UpdateClientTokenRequest, UpdateEvalCaseInput, UpdateEvalSuiteInput, UpdatePromptData, UpsertFlowConfig$1 as UpsertFlowConfig, UpsertRecordStepConfig$1 as UpsertRecordStepConfig, ValidateAgentPromotionInput, VectorSearchStepConfig$1 as VectorSearchStepConfig, WaitUntilStepConfig$1 as WaitUntilStepConfig, WorkflowCompileDeps, WorkflowCompletionCriteriaConfig, WorkflowConfig, WorkflowConfigFactory, WorkflowHookEntry, WorkflowHookKind, WorkflowHookRef, WorkflowHookSignatures, WorkflowMilestoneConfig, WorkflowPolicyConfig, WorkflowRecoveryConfig, WorkflowSlot };
68982
69132
  export {}
package/dist/index.d.ts CHANGED
@@ -1283,10 +1283,11 @@ interface paths {
1283
1283
  }[];
1284
1284
  version?: string;
1285
1285
  };
1286
+ deviceId?: string;
1286
1287
  /** Format: uri */
1287
1288
  endpoint: string;
1288
1289
  /** @enum {string} */
1289
- framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "custom";
1290
+ framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "mastra" | "custom";
1290
1291
  /** @enum {string} */
1291
1292
  protocol?: "a2a" | "runtype-stream";
1292
1293
  retryCount?: number;
@@ -1323,6 +1324,8 @@ interface paths {
1323
1324
  role?: "orchestrator" | "tool" | "standalone" | "hidden";
1324
1325
  }[];
1325
1326
  timeoutMs?: number;
1327
+ /** @enum {string} */
1328
+ transport?: "http" | "device";
1326
1329
  };
1327
1330
  icon?: string;
1328
1331
  maxTurns?: number;
@@ -1881,7 +1884,7 @@ interface paths {
1881
1884
  put?: never;
1882
1885
  /**
1883
1886
  * Fetch external agent card
1884
- * @description Proxy-fetch an external agent card from a URL, avoiding CORS issues. The URL is validated against SSRF attacks.
1887
+ * @description Proxy-fetch an external agent card from a URL, avoiding CORS issues. The URL is validated against SSRF attacks. With `transport: "device"`, the card is fetched through the paired local listener `deviceId`, so the URL must be a loopback address on that machine. Pass `bearerToken` when the card itself requires one.
1885
1888
  */
1886
1889
  post: {
1887
1890
  parameters: {
@@ -1893,6 +1896,15 @@ interface paths {
1893
1896
  requestBody?: {
1894
1897
  content: {
1895
1898
  "application/json": {
1899
+ /** @description Sent as `Authorization: Bearer` on the card request. Never stored or echoed. */
1900
+ bearerToken?: string;
1901
+ /** @description The paired listener to fetch through. Required when transport is "device". */
1902
+ deviceId?: string;
1903
+ /**
1904
+ * @description How to reach the card: directly (default) or through a paired local listener
1905
+ * @enum {string}
1906
+ */
1907
+ transport?: "http" | "device";
1896
1908
  /** Format: uri */
1897
1909
  url: string;
1898
1910
  };
@@ -2606,10 +2618,11 @@ interface paths {
2606
2618
  }[];
2607
2619
  version?: string;
2608
2620
  } | null;
2621
+ deviceId?: string | null;
2609
2622
  /** Format: uri */
2610
2623
  endpoint?: string;
2611
2624
  /** @enum {string|null} */
2612
- framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "custom" | null;
2625
+ framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "mastra" | "custom" | null;
2613
2626
  /** @enum {string|null} */
2614
2627
  protocol?: "a2a" | "runtype-stream" | null;
2615
2628
  retryCount?: number | null;
@@ -2646,6 +2659,8 @@ interface paths {
2646
2659
  role?: "orchestrator" | "tool" | "standalone" | "hidden";
2647
2660
  }[] | null;
2648
2661
  timeoutMs?: number | null;
2662
+ /** @enum {string|null} */
2663
+ transport?: "http" | "device" | null;
2649
2664
  } | null;
2650
2665
  icon?: string;
2651
2666
  maxTurns?: number;
@@ -4475,6 +4490,15 @@ interface paths {
4475
4490
  "application/json": components["schemas"]["Error"];
4476
4491
  };
4477
4492
  };
4493
+ /** @description An external agent call failed upstream: rejected credentials, rate limited, an HTTP error, a network failure, or an invalid response */
4494
+ 502: {
4495
+ headers: {
4496
+ [name: string]: unknown;
4497
+ };
4498
+ content: {
4499
+ "application/json": components["schemas"]["Error"];
4500
+ };
4501
+ };
4478
4502
  /** @description Asynchronous execution unavailable */
4479
4503
  503: {
4480
4504
  headers: {
@@ -4484,6 +4508,15 @@ interface paths {
4484
4508
  "application/json": components["schemas"]["Error"];
4485
4509
  };
4486
4510
  };
4511
+ /** @description An external agent call timed out */
4512
+ 504: {
4513
+ headers: {
4514
+ [name: string]: unknown;
4515
+ };
4516
+ content: {
4517
+ "application/json": components["schemas"]["Error"];
4518
+ };
4519
+ };
4487
4520
  };
4488
4521
  };
4489
4522
  delete?: never;
@@ -12984,7 +13017,7 @@ interface paths {
12984
13017
  mcpUrl: string;
12985
13018
  name: string;
12986
13019
  /** @enum {string} */
12987
- platform: "macos";
13020
+ platform: "macos" | "cli";
12988
13021
  publicKeyFingerprint: string;
12989
13022
  revokedAt: string | null;
12990
13023
  status: {
@@ -13028,6 +13061,87 @@ interface paths {
13028
13061
  patch?: never;
13029
13062
  trace?: never;
13030
13063
  };
13064
+ "/v1/devices/loopback": {
13065
+ parameters: {
13066
+ query?: never;
13067
+ header?: never;
13068
+ path?: never;
13069
+ cookie?: never;
13070
+ };
13071
+ get?: never;
13072
+ put?: never;
13073
+ /** Register this computer as a local loopback device (development only) */
13074
+ post: {
13075
+ parameters: {
13076
+ query?: never;
13077
+ header?: never;
13078
+ path?: never;
13079
+ cookie?: never;
13080
+ };
13081
+ requestBody?: {
13082
+ content: {
13083
+ "application/json": Record<string, never>;
13084
+ };
13085
+ };
13086
+ responses: {
13087
+ /** @description Loopback device ready */
13088
+ 201: {
13089
+ headers: {
13090
+ [name: string]: unknown;
13091
+ };
13092
+ content: {
13093
+ "application/json": {
13094
+ data: {
13095
+ appVersion: string | null;
13096
+ createdAt: string;
13097
+ id: string;
13098
+ lastAuthenticatedAt: string | null;
13099
+ /** Format: uri */
13100
+ mcpUrl: string;
13101
+ name: string;
13102
+ /** @enum {string} */
13103
+ platform: "macos" | "cli";
13104
+ publicKeyFingerprint: string;
13105
+ revokedAt: string | null;
13106
+ status: {
13107
+ appVersion?: string;
13108
+ availableTools: string[];
13109
+ deviceId: string;
13110
+ lastSeenAt?: string;
13111
+ online: boolean;
13112
+ protocolVersion?: number;
13113
+ };
13114
+ updatedAt: string;
13115
+ };
13116
+ };
13117
+ };
13118
+ };
13119
+ /** @description Unauthorized */
13120
+ 401: {
13121
+ headers: {
13122
+ [name: string]: unknown;
13123
+ };
13124
+ content: {
13125
+ "application/json": components["schemas"]["Error"];
13126
+ };
13127
+ };
13128
+ /** @description Forbidden */
13129
+ 403: {
13130
+ headers: {
13131
+ [name: string]: unknown;
13132
+ };
13133
+ content: {
13134
+ "application/json": components["schemas"]["Error"];
13135
+ };
13136
+ };
13137
+ };
13138
+ };
13139
+ delete?: never;
13140
+ options?: never;
13141
+ head?: never;
13142
+ patch?: never;
13143
+ trace?: never;
13144
+ };
13031
13145
  "/v1/devices/pair": {
13032
13146
  parameters: {
13033
13147
  query?: never;
@@ -13052,7 +13166,7 @@ interface paths {
13052
13166
  code: string;
13053
13167
  name: string;
13054
13168
  /** @enum {string} */
13055
- platform: "macos";
13169
+ platform: "macos" | "cli";
13056
13170
  publicKey: string;
13057
13171
  };
13058
13172
  };
@@ -13072,7 +13186,7 @@ interface paths {
13072
13186
  lastAuthenticatedAt: string | null;
13073
13187
  name: string;
13074
13188
  /** @enum {string} */
13075
- platform: "macos";
13189
+ platform: "macos" | "cli";
13076
13190
  publicKeyFingerprint: string;
13077
13191
  revokedAt: string | null;
13078
13192
  updatedAt: string;
@@ -13215,7 +13329,7 @@ interface paths {
13215
13329
  mcpUrl: string;
13216
13330
  name: string;
13217
13331
  /** @enum {string} */
13218
- platform: "macos";
13332
+ platform: "macos" | "cli";
13219
13333
  publicKeyFingerprint: string;
13220
13334
  revokedAt: string | null;
13221
13335
  status: {
@@ -13401,7 +13515,7 @@ interface paths {
13401
13515
  lastAuthenticatedAt: string | null;
13402
13516
  name: string;
13403
13517
  /** @enum {string} */
13404
- platform: "macos";
13518
+ platform: "macos" | "cli";
13405
13519
  publicKeyFingerprint: string;
13406
13520
  revokedAt: string | null;
13407
13521
  updatedAt: string;
@@ -63615,6 +63729,42 @@ export declare class Runtype {
63615
63729
  static get clientTokens(): ClientTokensNamespace;
63616
63730
  }
63617
63731
  //#endregion
63732
+ //#region src/a2a-handler.d.ts
63733
+ /** The text-only A2A 0.3 message delivered to a framework callback. */
63734
+ interface A2ATextMessage {
63735
+ role: 'user' | 'agent';
63736
+ messageId: string;
63737
+ parts: Array<{
63738
+ kind: 'text';
63739
+ text: string;
63740
+ metadata?: Record<string, unknown>;
63741
+ }>;
63742
+ contextId?: string;
63743
+ metadata?: Record<string, unknown>;
63744
+ }
63745
+ /** A single incoming turn; persist conversation history in the framework using contextId. */
63746
+ interface A2ARunInput {
63747
+ text: string;
63748
+ contextId: string;
63749
+ message: A2ATextMessage;
63750
+ metadata: Record<string, unknown>;
63751
+ signal: AbortSignal;
63752
+ }
63753
+ /** Configure a synchronous text adapter. Authenticate invocation POSTs before calling the handler. */
63754
+ interface A2AHandlerOptions {
63755
+ name: string;
63756
+ description?: string;
63757
+ url: string;
63758
+ maxRequestBytes?: number;
63759
+ run: (input: A2ARunInput) => string | Promise<string>;
63760
+ }
63761
+ /**
63762
+ * Serve POST at options.url and GET /.well-known/agent-card.json with Web APIs.
63763
+ * Supports A2A 0.3 message/send with text parts; no streaming or retained tasks.
63764
+ * The callback owns history, authorization of context IDs, and model cancellation.
63765
+ */
63766
+ export declare function createA2AHandler(options: A2AHandlerOptions): (request: Request) => Promise<Response>;
63767
+ //#endregion
63618
63768
  //#region src/agent-promotion.d.ts
63619
63769
  /**
63620
63770
  * The HTTP surface a promotion leg needs from one organization's credentials.
@@ -68978,5 +69128,5 @@ export declare function getLikelySupportingCandidatePaths(bestCandidatePath: str
68978
69128
  export declare function getDefaultPlanPath(taskName: string): string;
68979
69129
  export declare function sanitizeTaskSlug(taskName: string): string;
68980
69130
  //#endregion
68981
- export type { AIGrader, ActivateAgentAliasInput, ActivateAgentPromotionInput, AgentAlias, AgentAliasActivation, AgentAliasArchiveFailure, AgentAliasArchived, AgentAliasList, AgentAliasTransport, AgentCapabilityChange, AgentCapabilityDeclaration, AgentDefinition, AgentDefinitionConfig, AgentDeploymentList, AgentDeploymentPromotion, AgentDeploymentReceipt, AgentPromotionManifest, AgentPromotionTransport, AgentPromotionValidation, AgentPullResult, AgentSkillBinding, AgentSkillBindingChange, AgentStreamEvent, ApiKeyRequest, ApiKeyRequestDelivery, ApiKeyRequestEnvironment, ApiKeyRequestHandoff, ApiKeyRequestListParams, ApiKeyRequestRequester, ApiKeyRequestStatus, ApplyGeneratedProposalOptions, ApplyGeneratedProposalResult, ArchiveAgentAliasEverywhereResult, ArchiveAgentAliasInput, AttachRuntimeToolsOptions, BatchClient, BatchListParams, BatchOptions, BatchRequest, BatchResult, BatchScheduleConfig, BatchStatus, BindSkillInput, BuiltInGraderId, CaseExpected, CheckGrader, ClaimApiKeyRequestInput, ClaimApiKeyRequestResponse, ClientConversation, ClientToken, ClientTokenConfig, ClientTokenDefinition, ClientTokenEnvironment, ClientTokenVersionPin, ClientWidgetTheme, CollectionPullResult, CollectionSchemaChange, ConditionalGetResult, ConditionalStepConfig, ContextErrorHandling, ContextFallback, CreateApiKeyRequestInput, CreateApiKeyRequestResponse, CreateClientTokenRequest, CreateClientTokenResponse, CreateEvalSuiteInput, CreatePromptData, DecomposeCriteriaResult, DefineAgentInput, DefineEvalCaseInput, DefineEvalInput, DefineFlowInput, DefineProductInput, DefineScheduleInput, DefineSkillInput, DefineSurfaceInput, DefineToolInput, DetachedReattach, DetachedReconnectOptions, DispatchClient, DispatchEvent, DispatchOptions, EnsureAgentConverged, EnsureAgentOptions, EnsureAgentPlan, EnsureAgentResult, EnsureClientTokenConverged, EnsureClientTokenOptions, EnsureClientTokenPlan, EnsureClientTokenResult, EnsureCollectionConverged, EnsureCollectionOptions, EnsureCollectionPlan, EnsureCollectionResult, EnsureEvalApplyOptions, EnsureEvalOptions, EnsureEvalPlan, EnsureEvalResult, EnsureFlowConverged, EnsureFlowOptions, EnsureFlowPlan, EnsureFlowResult, EnsureFpoOptions, EnsureFpoResult, EnsureProductConverged, EnsureProductOptions, EnsureProductPlan, EnsureProductResult, EnsureQuestionSetConverged, EnsureQuestionSetOptions, EnsureQuestionSetPlan, EnsureQuestionSetResult, EnsureScheduleConverged, EnsureScheduleOptions, EnsureSchedulePlan, EnsureScheduleResult, EnsureSkillConverged, EnsureSkillOptions, EnsureSkillPlan, EnsureSkillResult, EnsureSurfaceConverged, EnsureSurfaceOptions, EnsureSurfacePlan, EnsureSurfaceResult, EnsureToolConverged, EnsureToolOptions, EnsureToolPlan, EnsureToolResult, ErrorHandlingMode, EvalAgentSelector, EvalAgentTargetResolution, EvalCaseDefinition, EvalCaseInput, EvalCaseProposal, EvalCaseProposalAccepted, EvalCaseProposalListResult, EvalCasesGenerated, EvalClient, EvalDefinition, EvalListParams, EvalMessage, EvalOptions, EvalProposalSource, EvalProposalStatus, EvalProposedCase, EvalPullResult, EvalRecord, EvalRequest, EvalResult, EvalRunCaseScores, EvalRunConfig, EvalRunEvidence, EvalRunScores, EvalStatus, EvalSuiteCase, EvalSuiteCaseInput, EvalSuiteCoverage, EvalSuiteDetail, EvalSuiteLatestRun, EvalSuiteListResult, EvalSuiteRunQueued, EvalSuiteRunResult, EvalSuiteSummary, EvalTarget, ExecutionStreamEvent, FallbackFailEvent, FallbackStartEvent, FallbackSuccessEvent, FallbackTrigger, FallbackTriggerType, FallbacksExhaustedEvent, FallbacksInitiatedEvent, FetchUrlStepConfig, FieldFormat, FlowCompleteEvent, FlowConfig, FlowDefinition, FlowDefinitionStep, FlowErrorEvent, FlowFallback, FlowInlineEvalInput, FlowPausedEvent, FlowPullResult, FlowStartEvent, FlowStreamEvent, FlowSummary, FlowValidationClient, FlowValidationIssue, FlowValidationResult, FpoEntityOutcome, FpoInput, GenerateEmbeddingStepConfig, GenerateEvalCasesInput, GeneratedRuntimeToolGateDecision, GeneratedRuntimeToolGateOptions, GetApiKeyRequestResponse, GetRecordStepConfig, Gradeable, GraderConfig, GraderOutcome, GraderSeverity, HumanVerdict, ListAgentAliasesOptions, ListAgentDeploymentsOptions, ListConversationsResponse, ListRecordsStepConfig, LoopStepConfig, Message, MessageFallback, ModelFallback, ModelOverride, OrganizationAgentAlias, OrganizationAgentAliasList, PersistedGraderOutcome, PrepareAgentPromotionInput, ProductDefinition, ProductPullResult, PromoteAgentInput, PromoteAgentResult, PromptErrorHandling, PromptFallback, PromptListParams, PromptStepConfig, PullFpoResult, QuestionSetDefinition, QuestionSetPullResult, RecordCollectionDefinition, RecordCollectionValidationMode, RecordConfig, RecordFilter, RecordFilterCondition, RecordFilterGroup, RecordFilterOperator, RetrieveRecordStepConfig, RetryFallback, RollbackAgentAliasInput, RunEvalCaseResult, RunEvalInput, RunEvalResult, RunListParams, RunListResponse, RunListRow, AgentSkillBinding$1 as RuntypeAgentSkillBinding, ConditionalStepConfig$1 as RuntypeConditionalStepConfig, RuntypeConfig, FetchUrlStepConfig$1 as RuntypeFetchUrlStepConfig, FlowConfig$1 as RuntypeFlowConfig, GenerateEmbeddingStepConfig$1 as RuntypeGenerateEmbeddingStepConfig, GetRecordStepConfig$1 as RuntypeGetRecordStepConfig, ListRecordsStepConfig$1 as RuntypeListRecordsStepConfig, LoopStepConfig$1 as RuntypeLoopStepConfig, Message$1 as RuntypeMessage, ModelOverride$1 as RuntypeModelOverride, Prompt$1 as RuntypePrompt, PromptStepConfig$1 as RuntypePromptStepConfig, RecordConfig$1 as RuntypeRecordConfig, RetrieveRecordStepConfig$1 as RuntypeRetrieveRecordStepConfig, SearchStepConfig as RuntypeSearchStepConfig, SendEmailStepConfig as RuntypeSendEmailStepConfig, SendEventStepConfig as RuntypeSendEventStepConfig, SendStreamStepConfig as RuntypeSendStreamStepConfig, SetVariableStepConfig as RuntypeSetVariableStepConfig, Skill as RuntypeSkill, SkillBindingWithAgent as RuntypeSkillBindingWithAgent, SkillCapabilities as RuntypeSkillCapabilities, SkillFrontmatter as RuntypeSkillFrontmatter, SkillManifest as RuntypeSkillManifest, SkillProposal as RuntypeSkillProposal, SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, SkillVersion as RuntypeSkillVersion, TransformDataStepConfig as RuntypeTransformDataStepConfig, UpsertFlowConfig as RuntypeUpsertFlowConfig, UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, VectorSearchStepConfig as RuntypeVectorSearchStepConfig, WaitUntilStepConfig as RuntypeWaitUntilStepConfig, ScheduleDefinition, ScheduleDefinitionMessage, ScheduleEnsureTransport, SchedulePullResult, SearchStepConfig$1 as SearchStepConfig, SendEmailStepConfig$1 as SendEmailStepConfig, SendEventStepConfig$1 as SendEventStepConfig, SendStreamStepConfig$1 as SendStreamStepConfig, SetVariableStepConfig$1 as SetVariableStepConfig, SkillDefinition, SkillListPage, SkillListPagination, SkillListParams, SkillManifestInput, SkillMarkdownInput, SkillOrigin, SkillProposalStatus, SkillPullResult, SkillStatus, SkillTrustLevel, SkillVersionStatus, SkillWithVersion, SkillWriteInput, StepCompleteEvent, StepDeltaEvent, StepFallback, StepFieldMeta, StepStartEvent, StepWaitingLocalEvent, StreamCallbacks, StreamConsumeOptions, StreamEvent, StreamEventOf, SurfaceDefinition, SurfaceDefinitionStatus, SurfaceDefinitionType, SurfacePullResult, ToolDefinition, ToolDefinitionType, ToolPullResult, TransformDataStepConfig$1 as TransformDataStepConfig, UpdateClientTokenRequest, UpdateEvalCaseInput, UpdateEvalSuiteInput, UpdatePromptData, UpsertFlowConfig$1 as UpsertFlowConfig, UpsertRecordStepConfig$1 as UpsertRecordStepConfig, ValidateAgentPromotionInput, VectorSearchStepConfig$1 as VectorSearchStepConfig, WaitUntilStepConfig$1 as WaitUntilStepConfig, WorkflowCompileDeps, WorkflowCompletionCriteriaConfig, WorkflowConfig, WorkflowConfigFactory, WorkflowHookEntry, WorkflowHookKind, WorkflowHookRef, WorkflowHookSignatures, WorkflowMilestoneConfig, WorkflowPolicyConfig, WorkflowRecoveryConfig, WorkflowSlot };
69131
+ export type { A2AHandlerOptions, A2ARunInput, A2ATextMessage, AIGrader, ActivateAgentAliasInput, ActivateAgentPromotionInput, AgentAlias, AgentAliasActivation, AgentAliasArchiveFailure, AgentAliasArchived, AgentAliasList, AgentAliasTransport, AgentCapabilityChange, AgentCapabilityDeclaration, AgentDefinition, AgentDefinitionConfig, AgentDeploymentList, AgentDeploymentPromotion, AgentDeploymentReceipt, AgentPromotionManifest, AgentPromotionTransport, AgentPromotionValidation, AgentPullResult, AgentSkillBinding, AgentSkillBindingChange, AgentStreamEvent, ApiKeyRequest, ApiKeyRequestDelivery, ApiKeyRequestEnvironment, ApiKeyRequestHandoff, ApiKeyRequestListParams, ApiKeyRequestRequester, ApiKeyRequestStatus, ApplyGeneratedProposalOptions, ApplyGeneratedProposalResult, ArchiveAgentAliasEverywhereResult, ArchiveAgentAliasInput, AttachRuntimeToolsOptions, BatchClient, BatchListParams, BatchOptions, BatchRequest, BatchResult, BatchScheduleConfig, BatchStatus, BindSkillInput, BuiltInGraderId, CaseExpected, CheckGrader, ClaimApiKeyRequestInput, ClaimApiKeyRequestResponse, ClientConversation, ClientToken, ClientTokenConfig, ClientTokenDefinition, ClientTokenEnvironment, ClientTokenVersionPin, ClientWidgetTheme, CollectionPullResult, CollectionSchemaChange, ConditionalGetResult, ConditionalStepConfig, ContextErrorHandling, ContextFallback, CreateApiKeyRequestInput, CreateApiKeyRequestResponse, CreateClientTokenRequest, CreateClientTokenResponse, CreateEvalSuiteInput, CreatePromptData, DecomposeCriteriaResult, DefineAgentInput, DefineEvalCaseInput, DefineEvalInput, DefineFlowInput, DefineProductInput, DefineScheduleInput, DefineSkillInput, DefineSurfaceInput, DefineToolInput, DetachedReattach, DetachedReconnectOptions, DispatchClient, DispatchEvent, DispatchOptions, EnsureAgentConverged, EnsureAgentOptions, EnsureAgentPlan, EnsureAgentResult, EnsureClientTokenConverged, EnsureClientTokenOptions, EnsureClientTokenPlan, EnsureClientTokenResult, EnsureCollectionConverged, EnsureCollectionOptions, EnsureCollectionPlan, EnsureCollectionResult, EnsureEvalApplyOptions, EnsureEvalOptions, EnsureEvalPlan, EnsureEvalResult, EnsureFlowConverged, EnsureFlowOptions, EnsureFlowPlan, EnsureFlowResult, EnsureFpoOptions, EnsureFpoResult, EnsureProductConverged, EnsureProductOptions, EnsureProductPlan, EnsureProductResult, EnsureQuestionSetConverged, EnsureQuestionSetOptions, EnsureQuestionSetPlan, EnsureQuestionSetResult, EnsureScheduleConverged, EnsureScheduleOptions, EnsureSchedulePlan, EnsureScheduleResult, EnsureSkillConverged, EnsureSkillOptions, EnsureSkillPlan, EnsureSkillResult, EnsureSurfaceConverged, EnsureSurfaceOptions, EnsureSurfacePlan, EnsureSurfaceResult, EnsureToolConverged, EnsureToolOptions, EnsureToolPlan, EnsureToolResult, ErrorHandlingMode, EvalAgentSelector, EvalAgentTargetResolution, EvalCaseDefinition, EvalCaseInput, EvalCaseProposal, EvalCaseProposalAccepted, EvalCaseProposalListResult, EvalCasesGenerated, EvalClient, EvalDefinition, EvalListParams, EvalMessage, EvalOptions, EvalProposalSource, EvalProposalStatus, EvalProposedCase, EvalPullResult, EvalRecord, EvalRequest, EvalResult, EvalRunCaseScores, EvalRunConfig, EvalRunEvidence, EvalRunScores, EvalStatus, EvalSuiteCase, EvalSuiteCaseInput, EvalSuiteCoverage, EvalSuiteDetail, EvalSuiteLatestRun, EvalSuiteListResult, EvalSuiteRunQueued, EvalSuiteRunResult, EvalSuiteSummary, EvalTarget, ExecutionStreamEvent, FallbackFailEvent, FallbackStartEvent, FallbackSuccessEvent, FallbackTrigger, FallbackTriggerType, FallbacksExhaustedEvent, FallbacksInitiatedEvent, FetchUrlStepConfig, FieldFormat, FlowCompleteEvent, FlowConfig, FlowDefinition, FlowDefinitionStep, FlowErrorEvent, FlowFallback, FlowInlineEvalInput, FlowPausedEvent, FlowPullResult, FlowStartEvent, FlowStreamEvent, FlowSummary, FlowValidationClient, FlowValidationIssue, FlowValidationResult, FpoEntityOutcome, FpoInput, GenerateEmbeddingStepConfig, GenerateEvalCasesInput, GeneratedRuntimeToolGateDecision, GeneratedRuntimeToolGateOptions, GetApiKeyRequestResponse, GetRecordStepConfig, Gradeable, GraderConfig, GraderOutcome, GraderSeverity, HumanVerdict, ListAgentAliasesOptions, ListAgentDeploymentsOptions, ListConversationsResponse, ListRecordsStepConfig, LoopStepConfig, Message, MessageFallback, ModelFallback, ModelOverride, OrganizationAgentAlias, OrganizationAgentAliasList, PersistedGraderOutcome, PrepareAgentPromotionInput, ProductDefinition, ProductPullResult, PromoteAgentInput, PromoteAgentResult, PromptErrorHandling, PromptFallback, PromptListParams, PromptStepConfig, PullFpoResult, QuestionSetDefinition, QuestionSetPullResult, RecordCollectionDefinition, RecordCollectionValidationMode, RecordConfig, RecordFilter, RecordFilterCondition, RecordFilterGroup, RecordFilterOperator, RetrieveRecordStepConfig, RetryFallback, RollbackAgentAliasInput, RunEvalCaseResult, RunEvalInput, RunEvalResult, RunListParams, RunListResponse, RunListRow, AgentSkillBinding$1 as RuntypeAgentSkillBinding, ConditionalStepConfig$1 as RuntypeConditionalStepConfig, RuntypeConfig, FetchUrlStepConfig$1 as RuntypeFetchUrlStepConfig, FlowConfig$1 as RuntypeFlowConfig, GenerateEmbeddingStepConfig$1 as RuntypeGenerateEmbeddingStepConfig, GetRecordStepConfig$1 as RuntypeGetRecordStepConfig, ListRecordsStepConfig$1 as RuntypeListRecordsStepConfig, LoopStepConfig$1 as RuntypeLoopStepConfig, Message$1 as RuntypeMessage, ModelOverride$1 as RuntypeModelOverride, Prompt$1 as RuntypePrompt, PromptStepConfig$1 as RuntypePromptStepConfig, RecordConfig$1 as RuntypeRecordConfig, RetrieveRecordStepConfig$1 as RuntypeRetrieveRecordStepConfig, SearchStepConfig as RuntypeSearchStepConfig, SendEmailStepConfig as RuntypeSendEmailStepConfig, SendEventStepConfig as RuntypeSendEventStepConfig, SendStreamStepConfig as RuntypeSendStreamStepConfig, SetVariableStepConfig as RuntypeSetVariableStepConfig, Skill as RuntypeSkill, SkillBindingWithAgent as RuntypeSkillBindingWithAgent, SkillCapabilities as RuntypeSkillCapabilities, SkillFrontmatter as RuntypeSkillFrontmatter, SkillManifest as RuntypeSkillManifest, SkillProposal as RuntypeSkillProposal, SkillRuntypeExtensions as RuntypeSkillRuntypeExtensions, SkillVersion as RuntypeSkillVersion, TransformDataStepConfig as RuntypeTransformDataStepConfig, UpsertFlowConfig as RuntypeUpsertFlowConfig, UpsertRecordStepConfig as RuntypeUpsertRecordStepConfig, VectorSearchStepConfig as RuntypeVectorSearchStepConfig, WaitUntilStepConfig as RuntypeWaitUntilStepConfig, ScheduleDefinition, ScheduleDefinitionMessage, ScheduleEnsureTransport, SchedulePullResult, SearchStepConfig$1 as SearchStepConfig, SendEmailStepConfig$1 as SendEmailStepConfig, SendEventStepConfig$1 as SendEventStepConfig, SendStreamStepConfig$1 as SendStreamStepConfig, SetVariableStepConfig$1 as SetVariableStepConfig, SkillDefinition, SkillListPage, SkillListPagination, SkillListParams, SkillManifestInput, SkillMarkdownInput, SkillOrigin, SkillProposalStatus, SkillPullResult, SkillStatus, SkillTrustLevel, SkillVersionStatus, SkillWithVersion, SkillWriteInput, StepCompleteEvent, StepDeltaEvent, StepFallback, StepFieldMeta, StepStartEvent, StepWaitingLocalEvent, StreamCallbacks, StreamConsumeOptions, StreamEvent, StreamEventOf, SurfaceDefinition, SurfaceDefinitionStatus, SurfaceDefinitionType, SurfacePullResult, ToolDefinition, ToolDefinitionType, ToolPullResult, TransformDataStepConfig$1 as TransformDataStepConfig, UpdateClientTokenRequest, UpdateEvalCaseInput, UpdateEvalSuiteInput, UpdatePromptData, UpsertFlowConfig$1 as UpsertFlowConfig, UpsertRecordStepConfig$1 as UpsertRecordStepConfig, ValidateAgentPromotionInput, VectorSearchStepConfig$1 as VectorSearchStepConfig, WaitUntilStepConfig$1 as WaitUntilStepConfig, WorkflowCompileDeps, WorkflowCompletionCriteriaConfig, WorkflowConfig, WorkflowConfigFactory, WorkflowHookEntry, WorkflowHookKind, WorkflowHookRef, WorkflowHookSignatures, WorkflowMilestoneConfig, WorkflowPolicyConfig, WorkflowRecoveryConfig, WorkflowSlot };
68982
69132
  export {}
package/dist/index.mjs CHANGED
@@ -14067,6 +14067,174 @@ var Runtype = class {
14067
14067
  }
14068
14068
  };
14069
14069
  //#endregion
14070
+ //#region src/a2a-handler.ts
14071
+ function record(value) {
14072
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
14073
+ }
14074
+ function rpcError(id, code, message, status = 200) {
14075
+ return Response.json({
14076
+ jsonrpc: "2.0",
14077
+ id,
14078
+ error: {
14079
+ code,
14080
+ message
14081
+ }
14082
+ }, { status });
14083
+ }
14084
+ function isRpcId(value) {
14085
+ return value === null || typeof value === "string" || typeof value === "number" && Number.isFinite(value);
14086
+ }
14087
+ var RequestTooLargeError = class extends Error {};
14088
+ async function readRequest(request, limit) {
14089
+ const reader = request.body?.getReader();
14090
+ if (!reader) return JSON.parse("");
14091
+ const decoder = new TextDecoder();
14092
+ let size = 0;
14093
+ let text = "";
14094
+ const cancel = () => {
14095
+ reader.cancel().catch(() => void 0);
14096
+ };
14097
+ request.signal.addEventListener("abort", cancel, { once: true });
14098
+ try {
14099
+ request.signal.throwIfAborted();
14100
+ while (true) {
14101
+ const { done, value } = await reader.read();
14102
+ request.signal.throwIfAborted();
14103
+ if (done) break;
14104
+ size += value.byteLength;
14105
+ if (size > limit) {
14106
+ cancel();
14107
+ throw new RequestTooLargeError();
14108
+ }
14109
+ text += decoder.decode(value, { stream: true });
14110
+ }
14111
+ return JSON.parse(text + decoder.decode());
14112
+ } finally {
14113
+ request.signal.removeEventListener("abort", cancel);
14114
+ reader.releaseLock();
14115
+ }
14116
+ }
14117
+ function parseMessage(value) {
14118
+ const message = record(value);
14119
+ if (!message || message.role !== "user" && message.role !== "agent") return void 0;
14120
+ if (typeof message.messageId !== "string" || !message.messageId) return void 0;
14121
+ if (message.contextId !== void 0 && (typeof message.contextId !== "string" || !message.contextId)) return;
14122
+ if (message.metadata !== void 0 && !record(message.metadata)) return void 0;
14123
+ if (!Array.isArray(message.parts) || message.parts.length === 0) return void 0;
14124
+ for (const raw of message.parts) {
14125
+ const part = record(raw);
14126
+ if (!part || part.kind !== "text" || typeof part.text !== "string") return void 0;
14127
+ if (part.metadata !== void 0 && !record(part.metadata)) return void 0;
14128
+ }
14129
+ return message;
14130
+ }
14131
+ function validateSend(params, id) {
14132
+ if (record(params.message)?.taskId !== void 0) return rpcError(id, -32001, "Task not found");
14133
+ if (params.metadata !== void 0 && !record(params.metadata)) return rpcError(id, -32602, "Invalid metadata");
14134
+ const configuration = record(params.configuration);
14135
+ if (params.configuration !== void 0 && !configuration) return rpcError(id, -32602, "Invalid configuration");
14136
+ if (configuration?.pushNotificationConfig !== void 0) return rpcError(id, -32003, "Push notifications are not supported");
14137
+ const modes = configuration?.acceptedOutputModes;
14138
+ if (modes !== void 0 && (!Array.isArray(modes) || !modes.every((mode) => typeof mode === "string"))) return rpcError(id, -32602, "Invalid accepted output modes");
14139
+ if (Array.isArray(modes) && modes.length > 0 && !modes.includes("text/plain")) return rpcError(id, -32005, "Only text/plain output is supported");
14140
+ }
14141
+ /**
14142
+ * Serve POST at options.url and GET /.well-known/agent-card.json with Web APIs.
14143
+ * Supports A2A 0.3 message/send with text parts; no streaming or retained tasks.
14144
+ * The callback owns history, authorization of context IDs, and model cancellation.
14145
+ */
14146
+ function createA2AHandler(options) {
14147
+ const endpoint = new URL(options.url);
14148
+ if (!["http:", "https:"].includes(endpoint.protocol) || endpoint.username || endpoint.password || endpoint.search || endpoint.hash) throw new Error("A2A url must be an HTTP(S) endpoint without credentials, query, or fragment");
14149
+ if (!options.name.trim()) throw new Error("A2A name must not be empty");
14150
+ const limit = options.maxRequestBytes ?? 1048576;
14151
+ if (!Number.isSafeInteger(limit) || limit <= 0) throw new Error("maxRequestBytes must be a positive integer");
14152
+ const card = {
14153
+ protocolVersion: "0.3.0",
14154
+ name: options.name,
14155
+ description: options.description ?? options.name,
14156
+ url: endpoint.href,
14157
+ preferredTransport: "JSONRPC",
14158
+ version: "1.0.0",
14159
+ capabilities: {
14160
+ streaming: false,
14161
+ pushNotifications: false
14162
+ },
14163
+ defaultInputModes: ["text/plain"],
14164
+ defaultOutputModes: ["text/plain"],
14165
+ skills: [{
14166
+ id: "chat",
14167
+ name: options.name,
14168
+ description: options.description ?? options.name,
14169
+ tags: ["chat"]
14170
+ }]
14171
+ };
14172
+ return async (request) => {
14173
+ const path = new URL(request.url).pathname;
14174
+ if (request.method === "GET" && path === "/.well-known/agent-card.json") return Response.json(card);
14175
+ if (path !== endpoint.pathname) return new Response("Not found", { status: 404 });
14176
+ if (request.method !== "POST") return new Response("Method not allowed", {
14177
+ status: 405,
14178
+ headers: { Allow: "POST" }
14179
+ });
14180
+ if (request.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase() !== "application/json") return rpcError(null, -32600, "Content-Type must be application/json", 415);
14181
+ const origin = request.headers.get("origin");
14182
+ if (origin !== null && origin !== endpoint.origin) return rpcError(null, -32600, "Origin is not allowed", 403);
14183
+ const version = request.headers.get("a2a-version");
14184
+ if (version && version !== "0.3" && version !== "0.3.0") return rpcError(null, -32009, "Only A2A 0.3 is supported", 400);
14185
+ if (request.signal.aborted) return rpcError(null, -32603, "Request cancelled");
14186
+ let body;
14187
+ try {
14188
+ body = await readRequest(request, limit);
14189
+ } catch (error) {
14190
+ if (request.signal.aborted) return rpcError(null, -32603, "Request cancelled");
14191
+ return error instanceof RequestTooLargeError ? rpcError(null, -32600, "Request body too large", 413) : rpcError(null, -32700, "Invalid JSON");
14192
+ }
14193
+ const rpc = record(body);
14194
+ if (!rpc || rpc.jsonrpc !== "2.0" || !isRpcId(rpc.id) || typeof rpc.method !== "string") return rpcError(null, -32600, "Invalid JSON-RPC request");
14195
+ const id = rpc.id;
14196
+ if (rpc.method !== "message/send") return rpcError(id, -32601, "Method not supported");
14197
+ const params = record(rpc.params);
14198
+ if (!params) return rpcError(id, -32602, "Invalid message parameters");
14199
+ const invalid = validateSend(params, id);
14200
+ if (invalid) return invalid;
14201
+ const message = parseMessage(params.message);
14202
+ if (!message) return rpcError(id, -32602, "Expected a message with a messageId, role, and text parts");
14203
+ const contextId = message.contextId ?? crypto.randomUUID();
14204
+ try {
14205
+ request.signal.throwIfAborted();
14206
+ const output = await options.run({
14207
+ text: message.parts.map((part) => part.text).join(""),
14208
+ contextId,
14209
+ message,
14210
+ metadata: record(params.metadata) ?? {},
14211
+ signal: request.signal
14212
+ });
14213
+ request.signal.throwIfAborted();
14214
+ if (typeof output !== "string") return rpcError(id, -32603, "Agent must return text");
14215
+ return Response.json({
14216
+ jsonrpc: "2.0",
14217
+ id,
14218
+ result: {
14219
+ kind: "task",
14220
+ id: crypto.randomUUID(),
14221
+ contextId,
14222
+ status: { state: "completed" },
14223
+ artifacts: [{
14224
+ artifactId: crypto.randomUUID(),
14225
+ parts: [{
14226
+ kind: "text",
14227
+ text: output
14228
+ }]
14229
+ }]
14230
+ }
14231
+ });
14232
+ } catch {
14233
+ return rpcError(id, -32603, request.signal.aborted ? "Request cancelled" : "Agent execution failed");
14234
+ }
14235
+ };
14236
+ }
14237
+ //#endregion
14070
14238
  //#region src/agent-promotion.ts
14071
14239
  const MANIFEST_VERSION = 1;
14072
14240
  /** Receipts read per page, and the page ceiling, while hunting the staged receipt. */
@@ -14276,7 +14444,7 @@ function transformQueryParams(params) {
14276
14444
  }
14277
14445
  //#endregion
14278
14446
  //#region src/version.ts
14279
- const SDK_VERSION = "10.11.2";
14447
+ const SDK_VERSION = "10.12.1";
14280
14448
  /**
14281
14449
  * Canonical client identity the API uses for attribution
14282
14450
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -16465,5 +16633,5 @@ const STEP_TYPE_TO_METHOD = {
16465
16633
  "memory-summary": "memorySummary"
16466
16634
  };
16467
16635
  //#endregion
16468
- export { AgentAliasDependencyError, AgentAliasNotFoundError, AgentAliasRevisionMismatchError, AgentAliasRevisionRequiredError, AgentAliasesNamespace, AgentDeploymentsNamespace, AgentDriftError, AgentEnsureConflictError, AgentPromotionError, AgentVersionsEndpoint, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, ApiKeyRequestsEndpoint, ApiKeysEndpoint, BatchBuilder, BatchesNamespace, BillingEndpoint, ChatEndpoint, ClientBatchBuilder, ClientEvalBuilder, ClientFlowBuilder, ClientTokenDriftError, ClientTokenEnsureError, ClientTokensEndpoint, ClientTokensNamespace, CollectionDriftError, CollectionEnsureConflictError, CollectionsEndpoint, ContextTemplatesEndpoint, ConversationsEndpoint, DEFAULT_MAX_DETACHED_RECONNECTS, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, DispatchEndpoint, ENSURE_RELEASE_DEPLOY_CONFLICT_MESSAGE, EvalBuilder, EvalDriftError, EvalEndpoint, EvalEnsureConflictError, EvalRunner, EvalSuitesNamespace, EvalsNamespace, ExecutionsEndpoint, ExecutionsNamespace, FlowBuilder, FlowDriftError, FlowEnsureConflictError, FlowResult, FlowStepsEndpoint, FlowVersionsEndpoint, FlowsEndpoint, FlowsNamespace, FpoDriftError, IntegrationsEndpoint, LEDGER_ARTIFACT_LINE_PREFIX, LIVE_AGENT_ALIAS, LogsEndpoint, ModelConfigsEndpoint, ProductDriftError, ProductEnsureConflictError, ProductsNamespace, PromptsEndpoint, PromptsNamespace, ProviderKeysEndpoint, QuestionSetDriftError, QuestionSetEnsureConflictError, QuestionSetsNamespace, RUNTYPE_CLIENT_KIND, RecordsEndpoint, RunsNamespace, Runtype, RuntypeApiError, RuntypeClient, RuntypeFlowBuilder, SDK_USER_AGENT, SDK_VERSION, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, ScheduleDriftError, ScheduleEnsureConflictError, SchedulesEndpoint, SecretsEndpoint, SkillDriftError, SkillEnsureConflictError, SkillProposalsNamespace, SkillsNamespace, SurfaceDriftError, SurfaceEnsureConflictError, SurfacesEndpoint, SurfacesNamespace, ToolApprovalGrantsEndpoint, ToolDriftError, ToolEnsureConflictError, ToolsEndpoint, ToolsNamespace, TypedRecordsScope, UNIFIED_EVENTS_QUERY, UsersEndpoint, activateAgentPromotion, agentAliasErrorCode, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildAgentAdmissionHeaders, buildEmptySessionNudge, buildExecutionEventsPath, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildObservationMaskMarker, buildPolicyGuidance, buildSendViewOffloadMarker, calledTool, combineAbortSignals, compileWorkflowConfig, completed, computeAgentContentHash, computeEvalContentHash, computeFlowContentHash, computeFpoContentHash, computeProductContentHash, computeQuestionSetContentHash, computeRecordCollectionContentHash, computeScheduleContentHash, computeScheduleDefinitionHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, contains, cost, createAgentEventTranslator, createClient, createExternalTool, createFlowEventTranslator, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineEval, defineFlow, defineFpo, definePlaybook, defineProduct, defineQuestionSet, defineSchedule, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, ensureEval, ensureFpo, ensureSchedule, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, fpoPlanHasDrift, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isBuiltinToolExecuteResponse, isCatalogClientToolRef, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isUnifiedEventType, isWorkflowHookRef, jsonField, judge, judges, latency, length, listWorkflowHooks, matchesExpected, maxToolCalls, noError, normalizeAgentDefinition, normalizeCandidatePath, normalizeFpoDefinition, normalizeProductDefinition, normalizeQuestionSetDefinition, normalizeRecordCollectionDefinition, normalizeScheduleContent, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, notCalledTool, notContains, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, prepareAgentPromotion, processStream, promoteAgent, promotionIdempotencyKey, pullEval, pullFpo, pullSchedule, ranStep, regex, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, runEvalSuite, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, stepOrder, streamEvents, toolOrder, unregisterWorkflowHook, usedNoTools, validJson, validateAgentPromotion, withDetachedReconnect, withUnifiedEvents };
16636
+ export { AgentAliasDependencyError, AgentAliasNotFoundError, AgentAliasRevisionMismatchError, AgentAliasRevisionRequiredError, AgentAliasesNamespace, AgentDeploymentsNamespace, AgentDriftError, AgentEnsureConflictError, AgentPromotionError, AgentVersionsEndpoint, AgentsEndpoint, AgentsNamespace, AnalyticsEndpoint, ApiKeyRequestsEndpoint, ApiKeysEndpoint, BatchBuilder, BatchesNamespace, BillingEndpoint, ChatEndpoint, ClientBatchBuilder, ClientEvalBuilder, ClientFlowBuilder, ClientTokenDriftError, ClientTokenEnsureError, ClientTokensEndpoint, ClientTokensNamespace, CollectionDriftError, CollectionEnsureConflictError, CollectionsEndpoint, ContextTemplatesEndpoint, ConversationsEndpoint, DEFAULT_MAX_DETACHED_RECONNECTS, DEFAULT_RECOVERY_AFTER_EMPTY_SESSIONS, DEFAULT_STALL_STOP_AFTER, DispatchEndpoint, ENSURE_RELEASE_DEPLOY_CONFLICT_MESSAGE, EvalBuilder, EvalDriftError, EvalEndpoint, EvalEnsureConflictError, EvalRunner, EvalSuitesNamespace, EvalsNamespace, ExecutionsEndpoint, ExecutionsNamespace, FlowBuilder, FlowDriftError, FlowEnsureConflictError, FlowResult, FlowStepsEndpoint, FlowVersionsEndpoint, FlowsEndpoint, FlowsNamespace, FpoDriftError, IntegrationsEndpoint, LEDGER_ARTIFACT_LINE_PREFIX, LIVE_AGENT_ALIAS, LogsEndpoint, ModelConfigsEndpoint, ProductDriftError, ProductEnsureConflictError, ProductsNamespace, PromptsEndpoint, PromptsNamespace, ProviderKeysEndpoint, QuestionSetDriftError, QuestionSetEnsureConflictError, QuestionSetsNamespace, RUNTYPE_CLIENT_KIND, RecordsEndpoint, RunsNamespace, Runtype, RuntypeApiError, RuntypeClient, RuntypeFlowBuilder, SDK_USER_AGENT, SDK_VERSION, STEP_FIELD_REGISTRY, STEP_TYPE_TO_METHOD, ScheduleDriftError, ScheduleEnsureConflictError, SchedulesEndpoint, SecretsEndpoint, SkillDriftError, SkillEnsureConflictError, SkillProposalsNamespace, SkillsNamespace, SurfaceDriftError, SurfaceEnsureConflictError, SurfacesEndpoint, SurfacesNamespace, ToolApprovalGrantsEndpoint, ToolDriftError, ToolEnsureConflictError, ToolsEndpoint, ToolsNamespace, TypedRecordsScope, UNIFIED_EVENTS_QUERY, UsersEndpoint, activateAgentPromotion, agentAliasErrorCode, applyGeneratedRuntimeToolProposalToDispatchRequest, attachRuntimeToolsToDispatchRequest, buildAgentAdmissionHeaders, buildEmptySessionNudge, buildExecutionEventsPath, buildGeneratedRuntimeToolGateOutput, buildLedgerOffloadReference, buildObservationMaskMarker, buildPolicyGuidance, buildSendViewOffloadMarker, calledTool, combineAbortSignals, compileWorkflowConfig, completed, computeAgentContentHash, computeEvalContentHash, computeFlowContentHash, computeFpoContentHash, computeProductContentHash, computeQuestionSetContentHash, computeRecordCollectionContentHash, computeScheduleContentHash, computeScheduleDefinitionHash, computeSkillContentHash, computeSurfaceContentHash, computeToolContentHash, contains, cost, createA2AHandler, createAgentEventTranslator, createClient, createExternalTool, createFlowEventTranslator, defaultWorkflow, defaultWorkflowConfig, defineAgent, defineEval, defineFlow, defineFpo, definePlaybook, defineProduct, defineQuestionSet, defineSchedule, defineSkill, defineSurface, defineTool, deployWorkflow, ensureDefaultWorkflowHooks, ensureEval, ensureFpo, ensureSchedule, evaluateGeneratedRuntimeToolProposal, extractDeclaredToolResultChars, fpoPlanHasDrift, gameWorkflow, getDefaultPlanPath, getLikelySupportingCandidatePaths, interpolateWorkflowTemplate, isBuiltinToolExecuteResponse, isCatalogClientToolRef, isDiscoveryToolName, isMarathonArtifactPath, isPreservationSensitiveTask, isUnifiedEventType, isWorkflowHookRef, jsonField, judge, judges, latency, length, listWorkflowHooks, matchesExpected, maxToolCalls, noError, normalizeAgentDefinition, normalizeCandidatePath, normalizeFpoDefinition, normalizeProductDefinition, normalizeQuestionSetDefinition, normalizeRecordCollectionDefinition, normalizeScheduleContent, normalizeSkillDefinition, normalizeSurfaceDefinition, normalizeToolDefinition, notCalledTool, notContains, parseFinalBuffer, parseLedgerArtifactRelativePath, parseOffloadedOutputId, parseSSEChunk, prepareAgentPromotion, processStream, promoteAgent, promotionIdempotencyKey, pullEval, pullFpo, pullSchedule, ranStep, regex, registerWorkflowHook, resolveStallStopAfter, resolveWorkflowHook, runEvalSuite, sanitizeTaskSlug, shouldInjectEmptySessionNudge, shouldRequestModelEscalation, stepOrder, streamEvents, toolOrder, unregisterWorkflowHook, usedNoTools, validJson, validateAgentPromotion, withDetachedReconnect, withUnifiedEvents };
16469
16637
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "10.11.2",
3
+ "version": "10.12.1",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {},
26
26
  "devDependencies": {
27
- "@runtypelabs/shared": "3.71.1",
27
+ "@runtypelabs/shared": "3.73.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.0",
30
30
  "typescript": "^6.0.3",