@runtypelabs/sdk 10.11.1 → 10.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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.1";
14448
+ const SDK_VERSION = "10.12.0";
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;
@@ -2606,10 +2609,11 @@ interface paths {
2606
2609
  }[];
2607
2610
  version?: string;
2608
2611
  } | null;
2612
+ deviceId?: string | null;
2609
2613
  /** Format: uri */
2610
2614
  endpoint?: string;
2611
2615
  /** @enum {string|null} */
2612
- framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "custom" | null;
2616
+ framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "mastra" | "custom" | null;
2613
2617
  /** @enum {string|null} */
2614
2618
  protocol?: "a2a" | "runtype-stream" | null;
2615
2619
  retryCount?: number | null;
@@ -2646,6 +2650,8 @@ interface paths {
2646
2650
  role?: "orchestrator" | "tool" | "standalone" | "hidden";
2647
2651
  }[] | null;
2648
2652
  timeoutMs?: number | null;
2653
+ /** @enum {string|null} */
2654
+ transport?: "http" | "device" | null;
2649
2655
  } | null;
2650
2656
  icon?: string;
2651
2657
  maxTurns?: number;
@@ -12984,7 +12990,7 @@ interface paths {
12984
12990
  mcpUrl: string;
12985
12991
  name: string;
12986
12992
  /** @enum {string} */
12987
- platform: "macos";
12993
+ platform: "macos" | "cli";
12988
12994
  publicKeyFingerprint: string;
12989
12995
  revokedAt: string | null;
12990
12996
  status: {
@@ -13028,6 +13034,87 @@ interface paths {
13028
13034
  patch?: never;
13029
13035
  trace?: never;
13030
13036
  };
13037
+ "/v1/devices/loopback": {
13038
+ parameters: {
13039
+ query?: never;
13040
+ header?: never;
13041
+ path?: never;
13042
+ cookie?: never;
13043
+ };
13044
+ get?: never;
13045
+ put?: never;
13046
+ /** Register this computer as a local loopback device (development only) */
13047
+ post: {
13048
+ parameters: {
13049
+ query?: never;
13050
+ header?: never;
13051
+ path?: never;
13052
+ cookie?: never;
13053
+ };
13054
+ requestBody?: {
13055
+ content: {
13056
+ "application/json": Record<string, never>;
13057
+ };
13058
+ };
13059
+ responses: {
13060
+ /** @description Loopback device ready */
13061
+ 201: {
13062
+ headers: {
13063
+ [name: string]: unknown;
13064
+ };
13065
+ content: {
13066
+ "application/json": {
13067
+ data: {
13068
+ appVersion: string | null;
13069
+ createdAt: string;
13070
+ id: string;
13071
+ lastAuthenticatedAt: string | null;
13072
+ /** Format: uri */
13073
+ mcpUrl: string;
13074
+ name: string;
13075
+ /** @enum {string} */
13076
+ platform: "macos" | "cli";
13077
+ publicKeyFingerprint: string;
13078
+ revokedAt: string | null;
13079
+ status: {
13080
+ appVersion?: string;
13081
+ availableTools: string[];
13082
+ deviceId: string;
13083
+ lastSeenAt?: string;
13084
+ online: boolean;
13085
+ protocolVersion?: number;
13086
+ };
13087
+ updatedAt: string;
13088
+ };
13089
+ };
13090
+ };
13091
+ };
13092
+ /** @description Unauthorized */
13093
+ 401: {
13094
+ headers: {
13095
+ [name: string]: unknown;
13096
+ };
13097
+ content: {
13098
+ "application/json": components["schemas"]["Error"];
13099
+ };
13100
+ };
13101
+ /** @description Forbidden */
13102
+ 403: {
13103
+ headers: {
13104
+ [name: string]: unknown;
13105
+ };
13106
+ content: {
13107
+ "application/json": components["schemas"]["Error"];
13108
+ };
13109
+ };
13110
+ };
13111
+ };
13112
+ delete?: never;
13113
+ options?: never;
13114
+ head?: never;
13115
+ patch?: never;
13116
+ trace?: never;
13117
+ };
13031
13118
  "/v1/devices/pair": {
13032
13119
  parameters: {
13033
13120
  query?: never;
@@ -13052,7 +13139,7 @@ interface paths {
13052
13139
  code: string;
13053
13140
  name: string;
13054
13141
  /** @enum {string} */
13055
- platform: "macos";
13142
+ platform: "macos" | "cli";
13056
13143
  publicKey: string;
13057
13144
  };
13058
13145
  };
@@ -13072,7 +13159,7 @@ interface paths {
13072
13159
  lastAuthenticatedAt: string | null;
13073
13160
  name: string;
13074
13161
  /** @enum {string} */
13075
- platform: "macos";
13162
+ platform: "macos" | "cli";
13076
13163
  publicKeyFingerprint: string;
13077
13164
  revokedAt: string | null;
13078
13165
  updatedAt: string;
@@ -13215,7 +13302,7 @@ interface paths {
13215
13302
  mcpUrl: string;
13216
13303
  name: string;
13217
13304
  /** @enum {string} */
13218
- platform: "macos";
13305
+ platform: "macos" | "cli";
13219
13306
  publicKeyFingerprint: string;
13220
13307
  revokedAt: string | null;
13221
13308
  status: {
@@ -13401,7 +13488,7 @@ interface paths {
13401
13488
  lastAuthenticatedAt: string | null;
13402
13489
  name: string;
13403
13490
  /** @enum {string} */
13404
- platform: "macos";
13491
+ platform: "macos" | "cli";
13405
13492
  publicKeyFingerprint: string;
13406
13493
  revokedAt: string | null;
13407
13494
  updatedAt: string;
@@ -28836,6 +28923,8 @@ interface paths {
28836
28923
  displayName?: string;
28837
28924
  id: string;
28838
28925
  inputCostPer1kTokens?: number;
28926
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
28927
+ isAvailable?: boolean;
28839
28928
  isDefault: boolean;
28840
28929
  isEnabled: boolean;
28841
28930
  /** @enum {string} */
@@ -29007,6 +29096,8 @@ interface paths {
29007
29096
  displayName?: string;
29008
29097
  id: string;
29009
29098
  inputCostPer1kTokens?: number;
29099
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
29100
+ isAvailable?: boolean;
29010
29101
  isDefault: boolean;
29011
29102
  isEnabled: boolean;
29012
29103
  /** @enum {string} */
@@ -29678,6 +29769,8 @@ interface paths {
29678
29769
  displayName?: string;
29679
29770
  id: string;
29680
29771
  inputCostPer1kTokens?: number;
29772
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
29773
+ isAvailable?: boolean;
29681
29774
  isDefault: boolean;
29682
29775
  isEnabled: boolean;
29683
29776
  /** @enum {string} */
@@ -29954,6 +30047,8 @@ interface paths {
29954
30047
  displayName?: string;
29955
30048
  id: string;
29956
30049
  inputCostPer1kTokens?: number;
30050
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
30051
+ isAvailable?: boolean;
29957
30052
  isDefault: boolean;
29958
30053
  isEnabled: boolean;
29959
30054
  /** @enum {string} */
@@ -57068,6 +57163,8 @@ export interface ModelConfig {
57068
57163
  supportsToolUse?: boolean;
57069
57164
  supportsReasoning?: boolean;
57070
57165
  isEnabled: boolean;
57166
+ /** Read-only inference availability under workspace policy; persisted enablement is unchanged. */
57167
+ isAvailable?: boolean;
57071
57168
  isDefault: boolean;
57072
57169
  settings: JsonObject;
57073
57170
  createdAt: string;
@@ -63605,6 +63702,42 @@ export declare class Runtype {
63605
63702
  static get clientTokens(): ClientTokensNamespace;
63606
63703
  }
63607
63704
  //#endregion
63705
+ //#region src/a2a-handler.d.ts
63706
+ /** The text-only A2A 0.3 message delivered to a framework callback. */
63707
+ interface A2ATextMessage {
63708
+ role: 'user' | 'agent';
63709
+ messageId: string;
63710
+ parts: Array<{
63711
+ kind: 'text';
63712
+ text: string;
63713
+ metadata?: Record<string, unknown>;
63714
+ }>;
63715
+ contextId?: string;
63716
+ metadata?: Record<string, unknown>;
63717
+ }
63718
+ /** A single incoming turn; persist conversation history in the framework using contextId. */
63719
+ interface A2ARunInput {
63720
+ text: string;
63721
+ contextId: string;
63722
+ message: A2ATextMessage;
63723
+ metadata: Record<string, unknown>;
63724
+ signal: AbortSignal;
63725
+ }
63726
+ /** Configure a synchronous text adapter. Authenticate invocation POSTs before calling the handler. */
63727
+ interface A2AHandlerOptions {
63728
+ name: string;
63729
+ description?: string;
63730
+ url: string;
63731
+ maxRequestBytes?: number;
63732
+ run: (input: A2ARunInput) => string | Promise<string>;
63733
+ }
63734
+ /**
63735
+ * Serve POST at options.url and GET /.well-known/agent-card.json with Web APIs.
63736
+ * Supports A2A 0.3 message/send with text parts; no streaming or retained tasks.
63737
+ * The callback owns history, authorization of context IDs, and model cancellation.
63738
+ */
63739
+ export declare function createA2AHandler(options: A2AHandlerOptions): (request: Request) => Promise<Response>;
63740
+ //#endregion
63608
63741
  //#region src/agent-promotion.d.ts
63609
63742
  /**
63610
63743
  * The HTTP surface a promotion leg needs from one organization's credentials.
@@ -68968,5 +69101,5 @@ export declare function getLikelySupportingCandidatePaths(bestCandidatePath: str
68968
69101
  export declare function getDefaultPlanPath(taskName: string): string;
68969
69102
  export declare function sanitizeTaskSlug(taskName: string): string;
68970
69103
  //#endregion
68971
- 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 };
69104
+ 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 };
68972
69105
  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;
@@ -2606,10 +2609,11 @@ interface paths {
2606
2609
  }[];
2607
2610
  version?: string;
2608
2611
  } | null;
2612
+ deviceId?: string | null;
2609
2613
  /** Format: uri */
2610
2614
  endpoint?: string;
2611
2615
  /** @enum {string|null} */
2612
- framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "custom" | null;
2616
+ framework?: "langchain" | "vercel_ai" | "crewai" | "cloudflare" | "autogen" | "flue" | "mastra" | "custom" | null;
2613
2617
  /** @enum {string|null} */
2614
2618
  protocol?: "a2a" | "runtype-stream" | null;
2615
2619
  retryCount?: number | null;
@@ -2646,6 +2650,8 @@ interface paths {
2646
2650
  role?: "orchestrator" | "tool" | "standalone" | "hidden";
2647
2651
  }[] | null;
2648
2652
  timeoutMs?: number | null;
2653
+ /** @enum {string|null} */
2654
+ transport?: "http" | "device" | null;
2649
2655
  } | null;
2650
2656
  icon?: string;
2651
2657
  maxTurns?: number;
@@ -12984,7 +12990,7 @@ interface paths {
12984
12990
  mcpUrl: string;
12985
12991
  name: string;
12986
12992
  /** @enum {string} */
12987
- platform: "macos";
12993
+ platform: "macos" | "cli";
12988
12994
  publicKeyFingerprint: string;
12989
12995
  revokedAt: string | null;
12990
12996
  status: {
@@ -13028,6 +13034,87 @@ interface paths {
13028
13034
  patch?: never;
13029
13035
  trace?: never;
13030
13036
  };
13037
+ "/v1/devices/loopback": {
13038
+ parameters: {
13039
+ query?: never;
13040
+ header?: never;
13041
+ path?: never;
13042
+ cookie?: never;
13043
+ };
13044
+ get?: never;
13045
+ put?: never;
13046
+ /** Register this computer as a local loopback device (development only) */
13047
+ post: {
13048
+ parameters: {
13049
+ query?: never;
13050
+ header?: never;
13051
+ path?: never;
13052
+ cookie?: never;
13053
+ };
13054
+ requestBody?: {
13055
+ content: {
13056
+ "application/json": Record<string, never>;
13057
+ };
13058
+ };
13059
+ responses: {
13060
+ /** @description Loopback device ready */
13061
+ 201: {
13062
+ headers: {
13063
+ [name: string]: unknown;
13064
+ };
13065
+ content: {
13066
+ "application/json": {
13067
+ data: {
13068
+ appVersion: string | null;
13069
+ createdAt: string;
13070
+ id: string;
13071
+ lastAuthenticatedAt: string | null;
13072
+ /** Format: uri */
13073
+ mcpUrl: string;
13074
+ name: string;
13075
+ /** @enum {string} */
13076
+ platform: "macos" | "cli";
13077
+ publicKeyFingerprint: string;
13078
+ revokedAt: string | null;
13079
+ status: {
13080
+ appVersion?: string;
13081
+ availableTools: string[];
13082
+ deviceId: string;
13083
+ lastSeenAt?: string;
13084
+ online: boolean;
13085
+ protocolVersion?: number;
13086
+ };
13087
+ updatedAt: string;
13088
+ };
13089
+ };
13090
+ };
13091
+ };
13092
+ /** @description Unauthorized */
13093
+ 401: {
13094
+ headers: {
13095
+ [name: string]: unknown;
13096
+ };
13097
+ content: {
13098
+ "application/json": components["schemas"]["Error"];
13099
+ };
13100
+ };
13101
+ /** @description Forbidden */
13102
+ 403: {
13103
+ headers: {
13104
+ [name: string]: unknown;
13105
+ };
13106
+ content: {
13107
+ "application/json": components["schemas"]["Error"];
13108
+ };
13109
+ };
13110
+ };
13111
+ };
13112
+ delete?: never;
13113
+ options?: never;
13114
+ head?: never;
13115
+ patch?: never;
13116
+ trace?: never;
13117
+ };
13031
13118
  "/v1/devices/pair": {
13032
13119
  parameters: {
13033
13120
  query?: never;
@@ -13052,7 +13139,7 @@ interface paths {
13052
13139
  code: string;
13053
13140
  name: string;
13054
13141
  /** @enum {string} */
13055
- platform: "macos";
13142
+ platform: "macos" | "cli";
13056
13143
  publicKey: string;
13057
13144
  };
13058
13145
  };
@@ -13072,7 +13159,7 @@ interface paths {
13072
13159
  lastAuthenticatedAt: string | null;
13073
13160
  name: string;
13074
13161
  /** @enum {string} */
13075
- platform: "macos";
13162
+ platform: "macos" | "cli";
13076
13163
  publicKeyFingerprint: string;
13077
13164
  revokedAt: string | null;
13078
13165
  updatedAt: string;
@@ -13215,7 +13302,7 @@ interface paths {
13215
13302
  mcpUrl: string;
13216
13303
  name: string;
13217
13304
  /** @enum {string} */
13218
- platform: "macos";
13305
+ platform: "macos" | "cli";
13219
13306
  publicKeyFingerprint: string;
13220
13307
  revokedAt: string | null;
13221
13308
  status: {
@@ -13401,7 +13488,7 @@ interface paths {
13401
13488
  lastAuthenticatedAt: string | null;
13402
13489
  name: string;
13403
13490
  /** @enum {string} */
13404
- platform: "macos";
13491
+ platform: "macos" | "cli";
13405
13492
  publicKeyFingerprint: string;
13406
13493
  revokedAt: string | null;
13407
13494
  updatedAt: string;
@@ -28836,6 +28923,8 @@ interface paths {
28836
28923
  displayName?: string;
28837
28924
  id: string;
28838
28925
  inputCostPer1kTokens?: number;
28926
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
28927
+ isAvailable?: boolean;
28839
28928
  isDefault: boolean;
28840
28929
  isEnabled: boolean;
28841
28930
  /** @enum {string} */
@@ -29007,6 +29096,8 @@ interface paths {
29007
29096
  displayName?: string;
29008
29097
  id: string;
29009
29098
  inputCostPer1kTokens?: number;
29099
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
29100
+ isAvailable?: boolean;
29010
29101
  isDefault: boolean;
29011
29102
  isEnabled: boolean;
29012
29103
  /** @enum {string} */
@@ -29678,6 +29769,8 @@ interface paths {
29678
29769
  displayName?: string;
29679
29770
  id: string;
29680
29771
  inputCostPer1kTokens?: number;
29772
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
29773
+ isAvailable?: boolean;
29681
29774
  isDefault: boolean;
29682
29775
  isEnabled: boolean;
29683
29776
  /** @enum {string} */
@@ -29954,6 +30047,8 @@ interface paths {
29954
30047
  displayName?: string;
29955
30048
  id: string;
29956
30049
  inputCostPer1kTokens?: number;
30050
+ /** @description Read-only inference availability under workspace policy; does not change persisted isEnabled. */
30051
+ isAvailable?: boolean;
29957
30052
  isDefault: boolean;
29958
30053
  isEnabled: boolean;
29959
30054
  /** @enum {string} */
@@ -57068,6 +57163,8 @@ export interface ModelConfig {
57068
57163
  supportsToolUse?: boolean;
57069
57164
  supportsReasoning?: boolean;
57070
57165
  isEnabled: boolean;
57166
+ /** Read-only inference availability under workspace policy; persisted enablement is unchanged. */
57167
+ isAvailable?: boolean;
57071
57168
  isDefault: boolean;
57072
57169
  settings: JsonObject;
57073
57170
  createdAt: string;
@@ -63605,6 +63702,42 @@ export declare class Runtype {
63605
63702
  static get clientTokens(): ClientTokensNamespace;
63606
63703
  }
63607
63704
  //#endregion
63705
+ //#region src/a2a-handler.d.ts
63706
+ /** The text-only A2A 0.3 message delivered to a framework callback. */
63707
+ interface A2ATextMessage {
63708
+ role: 'user' | 'agent';
63709
+ messageId: string;
63710
+ parts: Array<{
63711
+ kind: 'text';
63712
+ text: string;
63713
+ metadata?: Record<string, unknown>;
63714
+ }>;
63715
+ contextId?: string;
63716
+ metadata?: Record<string, unknown>;
63717
+ }
63718
+ /** A single incoming turn; persist conversation history in the framework using contextId. */
63719
+ interface A2ARunInput {
63720
+ text: string;
63721
+ contextId: string;
63722
+ message: A2ATextMessage;
63723
+ metadata: Record<string, unknown>;
63724
+ signal: AbortSignal;
63725
+ }
63726
+ /** Configure a synchronous text adapter. Authenticate invocation POSTs before calling the handler. */
63727
+ interface A2AHandlerOptions {
63728
+ name: string;
63729
+ description?: string;
63730
+ url: string;
63731
+ maxRequestBytes?: number;
63732
+ run: (input: A2ARunInput) => string | Promise<string>;
63733
+ }
63734
+ /**
63735
+ * Serve POST at options.url and GET /.well-known/agent-card.json with Web APIs.
63736
+ * Supports A2A 0.3 message/send with text parts; no streaming or retained tasks.
63737
+ * The callback owns history, authorization of context IDs, and model cancellation.
63738
+ */
63739
+ export declare function createA2AHandler(options: A2AHandlerOptions): (request: Request) => Promise<Response>;
63740
+ //#endregion
63608
63741
  //#region src/agent-promotion.d.ts
63609
63742
  /**
63610
63743
  * The HTTP surface a promotion leg needs from one organization's credentials.
@@ -68968,5 +69101,5 @@ export declare function getLikelySupportingCandidatePaths(bestCandidatePath: str
68968
69101
  export declare function getDefaultPlanPath(taskName: string): string;
68969
69102
  export declare function sanitizeTaskSlug(taskName: string): string;
68970
69103
  //#endregion
68971
- 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 };
69104
+ 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 };
68972
69105
  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.1";
14447
+ const SDK_VERSION = "10.12.0";
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.1",
3
+ "version": "10.12.0",
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.72.0",
28
28
  "openapi-typescript": "^7.13.0",
29
29
  "tsdown": "^0.23.0",
30
30
  "typescript": "^6.0.3",