@runtypelabs/cli 2.36.1 → 2.36.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +639 -75
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -21527,6 +21527,130 @@ var DEFAULT_FLOW_TIMEOUT_MS = 15 * 60 * 1e3;
21527
21527
  var ATTACHED_DISPATCH_STEP_TIMEOUT_MAX_MS = 10 * 60 * 1e3;
21528
21528
  var ASYNC_DISPATCH_TIMEOUT_MAX_MS = 30 * 60 * 1e3;
21529
21529
 
21530
+ // ../shared/dist/chunk-RT5M2CMG.mjs
21531
+ var EMBEDDING_COST_PER_1K_TOKENS = Object.freeze({
21532
+ "text-embedding-3-small": 2e-5,
21533
+ // $0.02 per 1M tokens
21534
+ "text-embedding-3-large": 13e-5
21535
+ // $0.13 per 1M tokens
21536
+ });
21537
+ var RETIRED_EMBEDDING_MODELS = Object.freeze({
21538
+ "text-embedding-004": Object.freeze({
21539
+ id: "text-embedding-004",
21540
+ retiredOn: "2026-01-14",
21541
+ replacement: "gemini-embedding-001"
21542
+ }),
21543
+ "embedding-001": Object.freeze({
21544
+ id: "embedding-001",
21545
+ retiredOn: "2025-10-30",
21546
+ replacement: "gemini-embedding-001"
21547
+ })
21548
+ });
21549
+ var GATEWAY_EMBEDDING_MODELS = Object.freeze({
21550
+ "text-embedding-3-small": Object.freeze({
21551
+ kind: "gateway",
21552
+ id: "text-embedding-3-small",
21553
+ gatewayModelId: "openai/text-embedding-3-small",
21554
+ provider: "openai",
21555
+ name: "text-embedding-3-small (OpenAI)",
21556
+ description: "OpenAI's small embedding model. Good balance of quality and cost. [Recommended]",
21557
+ dimensions: 1536,
21558
+ maxTokens: 8191,
21559
+ supportsDimensionsParameter: true
21560
+ }),
21561
+ "text-embedding-3-large": Object.freeze({
21562
+ kind: "gateway",
21563
+ id: "text-embedding-3-large",
21564
+ gatewayModelId: "openai/text-embedding-3-large",
21565
+ provider: "openai",
21566
+ name: "text-embedding-3-large (OpenAI)",
21567
+ description: "OpenAI's large embedding model. Best quality, higher cost.",
21568
+ dimensions: 3072,
21569
+ maxTokens: 8191,
21570
+ supportsDimensionsParameter: true
21571
+ }),
21572
+ "text-embedding-ada-002": Object.freeze({
21573
+ kind: "gateway",
21574
+ id: "text-embedding-ada-002",
21575
+ gatewayModelId: "openai/text-embedding-ada-002",
21576
+ provider: "openai",
21577
+ name: "text-embedding-ada-002 (OpenAI)",
21578
+ description: "OpenAI's legacy embedding model, kept for existing indexes.",
21579
+ dimensions: 1536,
21580
+ maxTokens: 8191,
21581
+ supportsDimensionsParameter: false
21582
+ }),
21583
+ "gemini-embedding-001": Object.freeze({
21584
+ kind: "gateway",
21585
+ id: "gemini-embedding-001",
21586
+ gatewayModelId: "google/gemini-embedding-001",
21587
+ provider: "google",
21588
+ name: "gemini-embedding-001 (Google)",
21589
+ description: "Google's Gemini embedding model. Returns 3072 values by default.",
21590
+ dimensions: 3072,
21591
+ maxTokens: 2048,
21592
+ supportsDimensionsParameter: true
21593
+ })
21594
+ });
21595
+ var WEAVIATE_VECTORIZER_MODELS = Object.freeze({
21596
+ "text2vec-openai": Object.freeze({
21597
+ kind: "weaviate-vectorizer",
21598
+ id: "text2vec-openai",
21599
+ name: "text2vec-openai (Weaviate)",
21600
+ description: "Weaviate's OpenAI text vectorization module. Uses OpenAI embeddings via Weaviate.",
21601
+ dimensions: 1536,
21602
+ maxTokens: 8191
21603
+ }),
21604
+ "text2vec-cohere": Object.freeze({
21605
+ kind: "weaviate-vectorizer",
21606
+ id: "text2vec-cohere",
21607
+ name: "text2vec-cohere (Weaviate)",
21608
+ description: "Weaviate's Cohere text vectorization module. Uses Cohere embeddings via Weaviate.",
21609
+ dimensions: 1024,
21610
+ maxTokens: 2048
21611
+ }),
21612
+ "text2vec-huggingface": Object.freeze({
21613
+ kind: "weaviate-vectorizer",
21614
+ id: "text2vec-huggingface",
21615
+ name: "text2vec-huggingface (Weaviate)",
21616
+ description: "Weaviate's HuggingFace text vectorization module. Uses HuggingFace models via Weaviate.",
21617
+ dimensions: 768,
21618
+ maxTokens: 512
21619
+ }),
21620
+ "Snowflake/snowflake-arctic-embed-l-v2.0": Object.freeze({
21621
+ kind: "weaviate-vectorizer",
21622
+ id: "Snowflake/snowflake-arctic-embed-l-v2.0",
21623
+ name: "snowflake-arctic-embed-l-v2.0 (Weaviate Cloud)",
21624
+ description: "Snowflake Arctic embedding model. Multilingual support with high performance.",
21625
+ dimensions: 1024,
21626
+ maxTokens: 8192
21627
+ }),
21628
+ "Snowflake/snowflake-arctic-embed-m-v2.0": Object.freeze({
21629
+ kind: "weaviate-vectorizer",
21630
+ id: "Snowflake/snowflake-arctic-embed-m-v2.0",
21631
+ name: "snowflake-arctic-embed-m-v2.0 (Weaviate Cloud)",
21632
+ description: "Snowflake Arctic medium embedding model. Balanced performance and efficiency.",
21633
+ dimensions: 768,
21634
+ maxTokens: 8192
21635
+ }),
21636
+ "Snowflake/snowflake-arctic-embed-s-v2.0": Object.freeze({
21637
+ kind: "weaviate-vectorizer",
21638
+ id: "Snowflake/snowflake-arctic-embed-s-v2.0",
21639
+ name: "snowflake-arctic-embed-s-v2.0 (Weaviate Cloud)",
21640
+ description: "Snowflake Arctic small embedding model. Optimized for speed and lower resource usage.",
21641
+ dimensions: 384,
21642
+ maxTokens: 8192
21643
+ }),
21644
+ "Snowflake/snowflake-arctic-embed-xs-v2.0": Object.freeze({
21645
+ kind: "weaviate-vectorizer",
21646
+ id: "Snowflake/snowflake-arctic-embed-xs-v2.0",
21647
+ name: "snowflake-arctic-embed-xs-v2.0 (Weaviate Cloud)",
21648
+ description: "Snowflake Arctic extra-small embedding model. Ultra-fast with minimal resource requirements.",
21649
+ dimensions: 384,
21650
+ maxTokens: 8192
21651
+ })
21652
+ });
21653
+
21530
21654
  // ../shared/dist/chunk-3N5ZK3YE.mjs
21531
21655
  var travrseConfig = {
21532
21656
  name: "Travrse",
@@ -21690,7 +21814,7 @@ var recordCollectionSchemaSchema = external_exports.strictObject({
21690
21814
  additionalProperties: external_exports.boolean().optional()
21691
21815
  }).superRefine((schema, ctx) => addSemanticIssues(schema, ctx));
21692
21816
 
21693
- // ../shared/dist/chunk-44VM7STG.mjs
21817
+ // ../shared/dist/chunk-DVPH4AHH.mjs
21694
21818
  var MCPServerCategory = {
21695
21819
  COMMUNICATION: "communication",
21696
21820
  PRODUCTIVITY: "productivity",
@@ -21938,6 +22062,10 @@ function separateToolIds(toolIds) {
21938
22062
  function isDataConnectionToolId(toolId) {
21939
22063
  return toolId.startsWith("dc:");
21940
22064
  }
22065
+ var AGENT_TRANSIENT_SECRETS_CODE = "RUNTIME_AGENT_TRANSIENT_SECRETS_UNSUPPORTED";
22066
+ var FLOW_TRANSIENT_SECRETS_CODE = "RUNTIME_FLOW_TRANSIENT_SECRETS_UNSUPPORTED";
22067
+ var DISPATCH_TRANSIENT_SECRETS_RETIRED_NOTE = `Retired on BOTH dispatch targets. A NON-EMPTY map is rejected with 400: ${AGENT_TRANSIENT_SECRETS_CODE} on an agent dispatch, ${FLOW_TRANSIENT_SECRETS_CODE} on a flow dispatch (the flow target used to drop the map silently). An empty map is accepted and does nothing. Store credentials as managed secrets and reference them as {{secret:NAME}}. The field is kept on the wire for compatibility only.`;
22068
+ var DISPATCH_TRANSIENT_SECRETS_RETIRED_CLAUSE = `a non-empty dispatch secrets map is refused with 400 ${AGENT_TRANSIENT_SECRETS_CODE} on agent dispatches and 400 ${FLOW_TRANSIENT_SECRETS_CODE} on flow dispatches`;
21941
22069
  var SURFACE_TYPE_METADATA = {
21942
22070
  chat: {
21943
22071
  description: "Website widget, support bots, conversational interfaces. Uses Persona and can optionally accept WebMCP page tools discovered from document.modelContext.",
@@ -21965,6 +22093,7 @@ var SURFACE_TYPE_METADATA = {
21965
22093
  consumerType: "human",
21966
22094
  // SAFETY(docs/why/packages/shared/src/product-generation.md#browser-cant-self-approve-gated-tool-calls-reach): Browser can't self-approve gated tool calls; reachable approvals are rejected before execution.
21967
22095
  approvalCapture: "none",
22096
+ clientToolExecution: "caller",
21968
22097
  reasoningVisibility: "pass_through",
21969
22098
  markdownDialect: "mdx",
21970
22099
  threadModel: "flat",
@@ -21997,6 +22126,7 @@ var SURFACE_TYPE_METADATA = {
21997
22126
  inboundMediaSupport: true,
21998
22127
  consumerType: "machine",
21999
22128
  approvalCapture: "native-controls",
22129
+ clientToolExecution: "caller",
22000
22130
  reasoningVisibility: "pass_through",
22001
22131
  markdownDialect: "none",
22002
22132
  threadModel: "flat",
@@ -22029,6 +22159,7 @@ var SURFACE_TYPE_METADATA = {
22029
22159
  inboundMediaSupport: false,
22030
22160
  consumerType: "agent",
22031
22161
  approvalCapture: "native-controls",
22162
+ clientToolExecution: "none",
22032
22163
  reasoningVisibility: "pass_through",
22033
22164
  markdownDialect: "none",
22034
22165
  threadModel: "flat",
@@ -22062,6 +22193,7 @@ var SURFACE_TYPE_METADATA = {
22062
22193
  inboundMediaSupport: true,
22063
22194
  consumerType: "human",
22064
22195
  approvalCapture: "none",
22196
+ clientToolExecution: "none",
22065
22197
  reasoningVisibility: "always_strip",
22066
22198
  markdownDialect: "html",
22067
22199
  threadModel: "reply_chain",
@@ -22099,6 +22231,7 @@ var SURFACE_TYPE_METADATA = {
22099
22231
  inboundMediaSupport: false,
22100
22232
  consumerType: "machine",
22101
22233
  approvalCapture: "none",
22234
+ clientToolExecution: "none",
22102
22235
  reasoningVisibility: "pass_through",
22103
22236
  markdownDialect: "none",
22104
22237
  threadModel: "flat",
@@ -22132,6 +22265,7 @@ var SURFACE_TYPE_METADATA = {
22132
22265
  inboundMediaSupport: false,
22133
22266
  consumerType: "agent",
22134
22267
  approvalCapture: "native-controls",
22268
+ clientToolExecution: "none",
22135
22269
  reasoningVisibility: "pass_through",
22136
22270
  markdownDialect: "none",
22137
22271
  threadModel: "flat",
@@ -22164,6 +22298,7 @@ var SURFACE_TYPE_METADATA = {
22164
22298
  inboundMediaSupport: true,
22165
22299
  consumerType: "human",
22166
22300
  approvalCapture: "native-controls",
22301
+ clientToolExecution: "none",
22167
22302
  reasoningVisibility: "always_strip",
22168
22303
  markdownDialect: "mrkdwn",
22169
22304
  threadModel: "threaded",
@@ -22204,6 +22339,7 @@ var SURFACE_TYPE_METADATA = {
22204
22339
  inboundMediaSupport: false,
22205
22340
  consumerType: "machine",
22206
22341
  approvalCapture: "none",
22342
+ clientToolExecution: "none",
22207
22343
  reasoningVisibility: "always_strip",
22208
22344
  markdownDialect: "none",
22209
22345
  threadModel: "flat",
@@ -22236,6 +22372,7 @@ var SURFACE_TYPE_METADATA = {
22236
22372
  inboundMediaSupport: false,
22237
22373
  consumerType: "human",
22238
22374
  approvalCapture: "reply",
22375
+ clientToolExecution: "none",
22239
22376
  reasoningVisibility: "always_strip",
22240
22377
  markdownDialect: "none",
22241
22378
  threadModel: "flat",
@@ -22267,6 +22404,7 @@ var SURFACE_TYPE_METADATA = {
22267
22404
  inboundMediaSupport: true,
22268
22405
  consumerType: "human",
22269
22406
  approvalCapture: "reply",
22407
+ clientToolExecution: "none",
22270
22408
  reasoningVisibility: "always_strip",
22271
22409
  markdownDialect: "none",
22272
22410
  threadModel: "flat",
@@ -22309,6 +22447,7 @@ var SURFACE_TYPE_METADATA = {
22309
22447
  inboundMediaSupport: true,
22310
22448
  consumerType: "human",
22311
22449
  approvalCapture: "none",
22450
+ clientToolExecution: "none",
22312
22451
  reasoningVisibility: "always_strip",
22313
22452
  markdownDialect: "markdown",
22314
22453
  threadModel: "threaded",
@@ -22340,6 +22479,7 @@ var SURFACE_TYPE_METADATA = {
22340
22479
  inboundMediaSupport: true,
22341
22480
  consumerType: "human",
22342
22481
  approvalCapture: "none",
22482
+ clientToolExecution: "none",
22343
22483
  reasoningVisibility: "always_strip",
22344
22484
  markdownDialect: "none",
22345
22485
  threadModel: "flat",
@@ -22372,6 +22512,7 @@ var SURFACE_TYPE_METADATA = {
22372
22512
  inboundMediaSupport: true,
22373
22513
  consumerType: "human",
22374
22514
  approvalCapture: "native-controls",
22515
+ clientToolExecution: "none",
22375
22516
  reasoningVisibility: "always_strip",
22376
22517
  markdownDialect: "telegram_html",
22377
22518
  threadModel: "flat",
@@ -22404,6 +22545,7 @@ var SURFACE_TYPE_METADATA = {
22404
22545
  consumerType: "human",
22405
22546
  // WHY(docs/why/packages/shared/src/product-generation.md#generic-internal-messaging-has-no-provider-inter): Generic/internal messaging has no provider interaction a human can answer; Slack/Telegram declare their own
22406
22547
  approvalCapture: "none",
22548
+ clientToolExecution: "none",
22407
22549
  reasoningVisibility: "always_strip",
22408
22550
  markdownDialect: "none",
22409
22551
  threadModel: "flat",
@@ -22436,6 +22578,7 @@ var SURFACE_TYPE_METADATA = {
22436
22578
  inboundMediaSupport: false,
22437
22579
  consumerType: "agent",
22438
22580
  approvalCapture: "native-controls",
22581
+ clientToolExecution: "none",
22439
22582
  reasoningVisibility: "pass_through",
22440
22583
  markdownDialect: "none",
22441
22584
  threadModel: "flat",
@@ -22477,6 +22620,7 @@ var SURFACE_TYPE_METADATA = {
22477
22620
  inboundMediaSupport: true,
22478
22621
  consumerType: "human",
22479
22622
  approvalCapture: "native-controls",
22623
+ clientToolExecution: "caller",
22480
22624
  reasoningVisibility: "pass_through",
22481
22625
  markdownDialect: "mdx",
22482
22626
  threadModel: "flat",
@@ -22511,6 +22655,7 @@ var SURFACE_TYPE_METADATA = {
22511
22655
  inboundMediaSupport: false,
22512
22656
  consumerType: "machine",
22513
22657
  approvalCapture: "native-controls",
22658
+ clientToolExecution: "caller",
22514
22659
  reasoningVisibility: "pass_through",
22515
22660
  markdownDialect: "markdown",
22516
22661
  threadModel: "flat",
@@ -22550,6 +22695,7 @@ var SURFACE_TYPE_METADATA = {
22550
22695
  inboundMediaSupport: true,
22551
22696
  consumerType: "human",
22552
22697
  approvalCapture: "native-controls",
22698
+ clientToolExecution: "caller",
22553
22699
  reasoningVisibility: "pass_through",
22554
22700
  markdownDialect: "mdx",
22555
22701
  threadModel: "flat",
@@ -24793,7 +24939,7 @@ function unwrapVectorSourceTemplate(source) {
24793
24939
  return inner;
24794
24940
  }
24795
24941
 
24796
- // ../shared/dist/chunk-6D5PSRBO.mjs
24942
+ // ../shared/dist/chunk-2M6BB7GC.mjs
24797
24943
  var jsonPatchOperationSchema = external_exports.object({
24798
24944
  op: external_exports.enum(["add", "remove", "replace", "move", "copy", "test"]),
24799
24945
  /** JSON Pointer (RFC 6901) into the state document. `''` addresses the root. */
@@ -24907,13 +25053,20 @@ var unifiedExecutionErrorEventSchema = external_exports.object({
24907
25053
  // WHY(docs/why/packages/shared/src/utils.md#blockreason-mirrors-platformkeyblockreason-in-mo): blockReason mirrors PlatformKeyBlockReason (in model-execution, which shared can't import) as a string, for
24908
25054
  blockReason: external_exports.string().optional()
24909
25055
  });
25056
+ var unifiedSubagentAttributionSchema = external_exports.object({
25057
+ toolName: external_exports.string(),
25058
+ agentName: external_exports.string().optional(),
25059
+ // WHY(docs/why/packages/shared/src/utils.md#parent-stream-correlation-id-the-subagent-tool-b): Parent-stream correlation id: the subagent tool bubble the client already saw, not the muted child's tool_use
25060
+ parentToolCallId: external_exports.string().optional()
25061
+ });
24910
25062
  var unifiedTurnStartEventSchema = external_exports.object({
24911
25063
  ...unifiedBase,
24912
25064
  type: external_exports.literal("turn_start"),
24913
25065
  id: external_exports.string(),
24914
25066
  iteration: external_exports.number().optional(),
24915
25067
  turnIndex: external_exports.number().optional(),
24916
- role: external_exports.enum(["user", "assistant", "system"])
25068
+ role: external_exports.enum(["user", "assistant", "system"]),
25069
+ subagent: unifiedSubagentAttributionSchema.optional()
24917
25070
  });
24918
25071
  var unifiedTurnCompleteEventSchema = external_exports.object({
24919
25072
  ...unifiedBase,
@@ -24927,7 +25080,8 @@ var unifiedTurnCompleteEventSchema = external_exports.object({
24927
25080
  stopReason: wireStopReasonSchema.optional(),
24928
25081
  completedAt: external_exports.string().optional(),
24929
25082
  fallback: fallbackInfoSchema.optional(),
24930
- estimatedContextBreakdown: estimatedContextBreakdownSchema.optional()
25083
+ estimatedContextBreakdown: estimatedContextBreakdownSchema.optional(),
25084
+ subagent: unifiedSubagentAttributionSchema.optional()
24931
25085
  });
24932
25086
  var unifiedStepStartEventSchema = external_exports.object({
24933
25087
  ...unifiedBase,
@@ -24938,7 +25092,8 @@ var unifiedStepStartEventSchema = external_exports.object({
24938
25092
  index: external_exports.number().optional(),
24939
25093
  totalSteps: external_exports.number().optional(),
24940
25094
  startedAt: external_exports.string().optional(),
24941
- outputVariable: external_exports.string().optional()
25095
+ outputVariable: external_exports.string().optional(),
25096
+ subagent: unifiedSubagentAttributionSchema.optional()
24942
25097
  });
24943
25098
  var unifiedStepCompleteEventSchema = external_exports.object({
24944
25099
  ...unifiedBase,
@@ -24958,7 +25113,8 @@ var unifiedStepCompleteEventSchema = external_exports.object({
24958
25113
  unresolvedVariables: external_exports.array(external_exports.string()).optional(),
24959
25114
  // WHY(docs/why/packages/shared/src/utils.md#tokensused-is-a-per-step-scalar-forwarded-from-t): tokensUsed is a per-step scalar forwarded from the flow engine; context/non-model steps omit it.
24960
25115
  tokensUsed: external_exports.number().optional(),
24961
- fallback: fallbackInfoSchema.optional()
25116
+ fallback: fallbackInfoSchema.optional(),
25117
+ subagent: unifiedSubagentAttributionSchema.optional()
24962
25118
  });
24963
25119
  var unifiedStepSkipEventSchema = external_exports.object({
24964
25120
  ...unifiedBase,
@@ -24979,19 +25135,22 @@ var unifiedTextStartEventSchema = external_exports.object({
24979
25135
  turnId: external_exports.string().optional(),
24980
25136
  stepId: external_exports.string().optional(),
24981
25137
  // WHY(docs/why/packages/shared/src/utils.md#parenttoolcallid-routes-nested-flow-as-tool-text): parentToolCallId routes nested flow-as-tool text into the parent tool's row; absent for top-level text.
24982
- parentToolCallId: external_exports.string().optional()
25138
+ parentToolCallId: external_exports.string().optional(),
25139
+ subagent: unifiedSubagentAttributionSchema.optional()
24983
25140
  });
24984
25141
  var unifiedTextDeltaEventSchema = external_exports.object({
24985
25142
  ...unifiedBase,
24986
25143
  type: external_exports.literal("text_delta"),
24987
25144
  id: external_exports.string(),
24988
- delta: external_exports.string()
25145
+ delta: external_exports.string(),
25146
+ subagent: unifiedSubagentAttributionSchema.optional()
24989
25147
  });
24990
25148
  var unifiedTextCompleteEventSchema = external_exports.object({
24991
25149
  ...unifiedBase,
24992
25150
  type: external_exports.literal("text_complete"),
24993
25151
  id: external_exports.string(),
24994
- text: external_exports.string().optional()
25152
+ text: external_exports.string().optional(),
25153
+ subagent: unifiedSubagentAttributionSchema.optional()
24995
25154
  });
24996
25155
  var unifiedReasoningStartEventSchema = external_exports.object({
24997
25156
  ...unifiedBase,
@@ -25000,20 +25159,23 @@ var unifiedReasoningStartEventSchema = external_exports.object({
25000
25159
  // WHY(docs/why/packages/shared/src/utils.md#scope-loop-marks-loop-level-reflection-e3-fold-d): scope:'loop' marks loop-level reflection (E3 fold); default renders as thinking.
25001
25160
  scope: external_exports.enum(["turn", "loop"]).optional(),
25002
25161
  // WHY(docs/why/packages/shared/src/utils.md#parenttoolcallid-mirrors-text-starts-field-routi): parentToolCallId mirrors text_start's field, routing nested reasoning into the parent tool's row.
25003
- parentToolCallId: external_exports.string().optional()
25162
+ parentToolCallId: external_exports.string().optional(),
25163
+ subagent: unifiedSubagentAttributionSchema.optional()
25004
25164
  });
25005
25165
  var unifiedReasoningDeltaEventSchema = external_exports.object({
25006
25166
  ...unifiedBase,
25007
25167
  type: external_exports.literal("reasoning_delta"),
25008
25168
  id: external_exports.string(),
25009
- delta: external_exports.string()
25169
+ delta: external_exports.string(),
25170
+ subagent: unifiedSubagentAttributionSchema.optional()
25010
25171
  });
25011
25172
  var unifiedReasoningCompleteEventSchema = external_exports.object({
25012
25173
  ...unifiedBase,
25013
25174
  type: external_exports.literal("reasoning_complete"),
25014
25175
  id: external_exports.string(),
25015
25176
  text: external_exports.string().optional(),
25016
- scope: external_exports.enum(["turn", "loop"]).optional()
25177
+ scope: external_exports.enum(["turn", "loop"]).optional(),
25178
+ subagent: unifiedSubagentAttributionSchema.optional()
25017
25179
  });
25018
25180
  var unifiedMediaStartEventSchema = external_exports.object({
25019
25181
  ...unifiedBase,
@@ -25118,13 +25280,15 @@ var unifiedToolStartEventSchema = external_exports.object({
25118
25280
  hiddenParameterNames: external_exports.array(external_exports.string()).optional(),
25119
25281
  startedAt: external_exports.string().optional(),
25120
25282
  origin: external_exports.enum(["webmcp", "sdk"]).optional(),
25121
- pageOrigin: external_exports.string().optional()
25283
+ pageOrigin: external_exports.string().optional(),
25284
+ subagent: unifiedSubagentAttributionSchema.optional()
25122
25285
  });
25123
25286
  var unifiedToolInputDeltaEventSchema = external_exports.object({
25124
25287
  ...unifiedBase,
25125
25288
  type: external_exports.literal("tool_input_delta"),
25126
25289
  toolCallId: external_exports.string(),
25127
- delta: external_exports.string()
25290
+ delta: external_exports.string(),
25291
+ subagent: unifiedSubagentAttributionSchema.optional()
25128
25292
  });
25129
25293
  var unifiedToolInputCompleteEventSchema = external_exports.object({
25130
25294
  ...unifiedBase,
@@ -25132,7 +25296,8 @@ var unifiedToolInputCompleteEventSchema = external_exports.object({
25132
25296
  toolCallId: external_exports.string(),
25133
25297
  toolName: external_exports.string().optional(),
25134
25298
  parameters: external_exports.record(external_exports.string(), external_exports.unknown()),
25135
- hiddenParameterNames: external_exports.array(external_exports.string()).optional()
25299
+ hiddenParameterNames: external_exports.array(external_exports.string()).optional(),
25300
+ subagent: unifiedSubagentAttributionSchema.optional()
25136
25301
  });
25137
25302
  var unifiedToolOutputDeltaEventSchema = external_exports.object({
25138
25303
  ...unifiedBase,
@@ -25154,13 +25319,8 @@ var unifiedToolCompleteEventSchema = external_exports.object({
25154
25319
  iteration: external_exports.number().optional(),
25155
25320
  stepId: external_exports.string().optional(),
25156
25321
  // WHY(docs/why/packages/shared/src/utils.md#toolcost-is-debug-only-forwarded-from-flow-tool): toolCost is debug-only, forwarded from flow tool_complete; FilteredStream strips it for user-facing streams.
25157
- toolCost: external_exports.number().optional()
25158
- });
25159
- var unifiedSubagentAttributionSchema = external_exports.object({
25160
- toolName: external_exports.string(),
25161
- agentName: external_exports.string().optional(),
25162
- // WHY(docs/why/packages/shared/src/utils.md#parent-stream-correlation-id-the-subagent-tool-b): Parent-stream correlation id: the subagent tool bubble the client already saw, not the muted child's tool_use
25163
- parentToolCallId: external_exports.string().optional()
25322
+ toolCost: external_exports.number().optional(),
25323
+ subagent: unifiedSubagentAttributionSchema.optional()
25164
25324
  });
25165
25325
  var unifiedApprovalStartEventSchema = external_exports.object({
25166
25326
  ...unifiedBase,
@@ -25321,7 +25481,7 @@ var UNIFIED_SSE_EVENT_TYPES = _unifiedTuple([
25321
25481
  "custom"
25322
25482
  ]);
25323
25483
 
25324
- // ../shared/dist/chunk-5SCRYWGC.mjs
25484
+ // ../shared/dist/chunk-B4DUH7XO.mjs
25325
25485
  var mediaAnnotationsSchema = external_exports.object({
25326
25486
  audience: external_exports.array(external_exports.enum(["user", "assistant"])).optional()
25327
25487
  });
@@ -26379,67 +26539,256 @@ function neutralizeCsvFormula(value) {
26379
26539
  if (STRICT_NUMBER.test(value)) return value;
26380
26540
  return `'${value}`;
26381
26541
  }
26542
+ var voiceInterruptionModeSchema = external_exports.enum(["none", "cancel", "barge-in"]);
26543
+ var voiceEndpointingStrategySchema = external_exports.enum([
26544
+ "provider_vad",
26545
+ "server_vad",
26546
+ "client_commit",
26547
+ "manual"
26548
+ ]);
26549
+ var voiceSpeechModeSchema = external_exports.enum(["pipeline", "speech_to_speech", "provider_managed"]);
26550
+ var speechProviderSchema = external_exports.string().trim().min(1);
26551
+ var voiceSpeechProfileSchema = external_exports.object({
26552
+ mode: voiceSpeechModeSchema,
26553
+ transcriber: external_exports.object({
26554
+ provider: speechProviderSchema,
26555
+ model: external_exports.string().trim().min(1).optional()
26556
+ }).strict(),
26557
+ synthesizer: external_exports.object({
26558
+ provider: speechProviderSchema,
26559
+ model: external_exports.string().trim().min(1).optional(),
26560
+ voiceId: external_exports.string().trim().min(1).optional(),
26561
+ settings: external_exports.object({
26562
+ stability: external_exports.number().min(0).max(1).optional(),
26563
+ similarity: external_exports.number().min(0).max(1).optional()
26564
+ }).strict().optional()
26565
+ }).strict()
26566
+ }).strict();
26567
+ var canonicalAgentVoiceProfileSchema = external_exports.object({
26568
+ enabled: external_exports.boolean().optional(),
26569
+ greeting: external_exports.string().max(2e3).optional(),
26570
+ language: external_exports.string().trim().min(1).max(64).optional(),
26571
+ interruptionMode: voiceInterruptionModeSchema.optional(),
26572
+ endpointing: external_exports.object({
26573
+ strategy: voiceEndpointingStrategySchema,
26574
+ silenceMs: external_exports.number().int().min(0).max(3e4).optional()
26575
+ }).strict().optional(),
26576
+ speech: voiceSpeechProfileSchema.optional()
26577
+ }).strict();
26578
+ var legacyElevenLabsSchema = external_exports.object({
26579
+ voiceId: external_exports.string().trim().min(1).optional(),
26580
+ modelId: external_exports.string().trim().min(1).optional(),
26581
+ stability: external_exports.number().min(0).max(1).optional(),
26582
+ similarity: external_exports.number().min(0).max(1).optional()
26583
+ }).strict();
26584
+ var dualVoiceProfileSchema = canonicalAgentVoiceProfileSchema.extend({
26585
+ provider: external_exports.string().trim().min(1).optional(),
26586
+ elevenLabs: legacyElevenLabsSchema.optional()
26587
+ }).superRefine((profile, context) => {
26588
+ const hasLegacy = profile.provider !== void 0 || profile.elevenLabs !== void 0;
26589
+ if (!hasLegacy) return;
26590
+ const provider = profile.provider ?? "elevenlabs";
26591
+ if (provider !== "elevenlabs" && provider !== "cloudflare") {
26592
+ context.addIssue({
26593
+ code: "custom",
26594
+ path: ["provider"],
26595
+ message: `Unsupported legacy voice provider: ${provider}`
26596
+ });
26597
+ return;
26598
+ }
26599
+ if (profile.speech) {
26600
+ const legacySpeech = speechProfileFromLegacy(provider, profile.elevenLabs);
26601
+ if (!speechProfilesSemanticallyEqual(legacySpeech, profile.speech)) {
26602
+ context.addIssue({
26603
+ code: "custom",
26604
+ path: ["speech"],
26605
+ message: "Legacy and canonical voice speech settings must be semantically identical."
26606
+ });
26607
+ }
26608
+ }
26609
+ }).transform((profile) => {
26610
+ const { provider, elevenLabs, ...canonical } = profile;
26611
+ if (canonical.speech || provider === void 0 && elevenLabs === void 0) return canonical;
26612
+ return {
26613
+ ...canonical,
26614
+ speech: speechProfileFromLegacy(provider ?? "elevenlabs", elevenLabs)
26615
+ };
26616
+ });
26617
+ var agentVoiceProfileSchema = dualVoiceProfileSchema;
26618
+ var DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE = Object.freeze({
26619
+ mode: "pipeline",
26620
+ transcriber: Object.freeze({ provider: "elevenlabs", model: "scribe_v2_realtime" }),
26621
+ synthesizer: Object.freeze({
26622
+ provider: "elevenlabs",
26623
+ model: "eleven_flash_v2_5",
26624
+ voiceId: "rachel",
26625
+ settings: Object.freeze({ stability: 0.5, similarity: 0.75 })
26626
+ })
26627
+ });
26628
+ var DEFAULT_CLOUDFLARE_VOICE_SPEECH_PROFILE = Object.freeze({
26629
+ mode: "pipeline",
26630
+ transcriber: Object.freeze({ provider: "cloudflare", model: "workers-ai-flux" }),
26631
+ synthesizer: Object.freeze({
26632
+ provider: "cloudflare",
26633
+ model: "@cf/deepgram/aura-1",
26634
+ voiceId: "asteria"
26635
+ })
26636
+ });
26637
+ function resolveVoiceSpeechProfile(profile, managedDefault = DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE) {
26638
+ if (!profile.speech) return managedDefault;
26639
+ const defaults = profile.speech.transcriber.provider === "cloudflare" && profile.speech.synthesizer.provider === "cloudflare" ? DEFAULT_CLOUDFLARE_VOICE_SPEECH_PROFILE : profile.speech.transcriber.provider === "elevenlabs" && profile.speech.synthesizer.provider === "elevenlabs" ? DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE : void 0;
26640
+ return {
26641
+ mode: profile.speech.mode,
26642
+ transcriber: {
26643
+ provider: profile.speech.transcriber.provider,
26644
+ ...profile.speech.transcriber.model ?? defaults?.transcriber.model ? { model: profile.speech.transcriber.model ?? defaults?.transcriber.model } : {}
26645
+ },
26646
+ synthesizer: {
26647
+ provider: profile.speech.synthesizer.provider,
26648
+ ...profile.speech.synthesizer.model ?? defaults?.synthesizer.model ? { model: profile.speech.synthesizer.model ?? defaults?.synthesizer.model } : {},
26649
+ ...profile.speech.synthesizer.voiceId ?? defaults?.synthesizer.voiceId ? { voiceId: profile.speech.synthesizer.voiceId ?? defaults?.synthesizer.voiceId } : {},
26650
+ ...profile.speech.synthesizer.settings ?? defaults?.synthesizer.settings ? {
26651
+ settings: {
26652
+ ...defaults?.synthesizer.settings,
26653
+ ...profile.speech.synthesizer.settings
26654
+ }
26655
+ } : {}
26656
+ }
26657
+ };
26658
+ }
26659
+ function speechProfileFromLegacy(provider, elevenLabs) {
26660
+ if (provider === "cloudflare") return DEFAULT_CLOUDFLARE_VOICE_SPEECH_PROFILE;
26661
+ return {
26662
+ mode: "pipeline",
26663
+ transcriber: { ...DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE.transcriber },
26664
+ synthesizer: {
26665
+ ...DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE.synthesizer,
26666
+ ...elevenLabs?.voiceId ? { voiceId: elevenLabs.voiceId } : {},
26667
+ ...elevenLabs?.modelId ? { model: elevenLabs.modelId } : {},
26668
+ settings: {
26669
+ ...DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE.synthesizer.settings,
26670
+ ...elevenLabs?.stability === void 0 ? {} : { stability: elevenLabs.stability },
26671
+ ...elevenLabs?.similarity === void 0 ? {} : { similarity: elevenLabs.similarity }
26672
+ }
26673
+ }
26674
+ };
26675
+ }
26676
+ function speechProfilesSemanticallyEqual(legacy, canonical) {
26677
+ const resolved = resolveVoiceSpeechProfile({ speech: canonical });
26678
+ return JSON.stringify(legacy) === JSON.stringify(resolved);
26679
+ }
26382
26680
  var REPLAY_FROM_START = Object.freeze({
26383
26681
  row: 0,
26384
26682
  sub: Number.POSITIVE_INFINITY
26385
26683
  });
26684
+ var agUiEventBase = {
26685
+ // INVARIANT: Metadata is absent or an object; an explicit null fails the spec parse.
26686
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
26687
+ };
26688
+ var agUiInterruptSchema = external_exports.object({
26689
+ id: external_exports.string(),
26690
+ reason: external_exports.string(),
26691
+ message: external_exports.string().optional(),
26692
+ toolCallId: external_exports.string().optional(),
26693
+ responseSchema: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
26694
+ expiresAt: external_exports.string().optional(),
26695
+ metadata: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
26696
+ subagentRunId: external_exports.string().optional()
26697
+ });
26698
+ var agUiRunFinishedSuccessOutcomeSchema = external_exports.object({ type: external_exports.literal("success") });
26699
+ var agUiRunFinishedInterruptOutcomeSchema = external_exports.object({
26700
+ type: external_exports.literal("interrupt"),
26701
+ interrupts: external_exports.array(agUiInterruptSchema).min(1)
26702
+ });
26703
+ var agUiRunFinishedOutcomeSchema = external_exports.discriminatedUnion("type", [
26704
+ agUiRunFinishedSuccessOutcomeSchema,
26705
+ agUiRunFinishedInterruptOutcomeSchema
26706
+ ]);
26707
+ var agUiTokenUsageSchema = external_exports.object({
26708
+ provider: external_exports.string().optional(),
26709
+ model: external_exports.string().optional(),
26710
+ inputTokens: external_exports.number().int().nonnegative().optional(),
26711
+ outputTokens: external_exports.number().int().nonnegative().optional(),
26712
+ totalTokens: external_exports.number().int().nonnegative().optional(),
26713
+ reasoningTokens: external_exports.number().int().nonnegative().optional(),
26714
+ cachedInputTokens: external_exports.number().int().nonnegative().optional()
26715
+ });
26386
26716
  var agUiRoleSchema = external_exports.enum(["developer", "system", "assistant", "user", "tool"]);
26387
26717
  var runStartedEventSchema = external_exports.object({
26718
+ ...agUiEventBase,
26388
26719
  type: external_exports.literal("RUN_STARTED"),
26389
26720
  threadId: external_exports.string(),
26390
26721
  runId: external_exports.string()
26391
26722
  });
26392
26723
  var runFinishedEventSchema = external_exports.object({
26724
+ ...agUiEventBase,
26393
26725
  type: external_exports.literal("RUN_FINISHED"),
26394
26726
  threadId: external_exports.string(),
26395
26727
  runId: external_exports.string(),
26396
- result: external_exports.unknown().optional()
26728
+ result: external_exports.unknown().optional(),
26729
+ // WHY(docs/features/planning/2026-09-02-ag-ui-dojo-conformance-gaps.md): Absent reads as success to every spec client, so success runs stay outcome-less.
26730
+ outcome: agUiRunFinishedOutcomeSchema.optional(),
26731
+ usage: external_exports.array(agUiTokenUsageSchema).optional()
26397
26732
  });
26398
26733
  var runErrorEventSchema = external_exports.object({
26734
+ ...agUiEventBase,
26399
26735
  type: external_exports.literal("RUN_ERROR"),
26400
26736
  message: external_exports.string(),
26401
- code: external_exports.string().optional()
26737
+ code: external_exports.string().optional(),
26738
+ usage: external_exports.array(agUiTokenUsageSchema).optional()
26402
26739
  });
26403
26740
  var stepStartedEventSchema = external_exports.object({
26741
+ ...agUiEventBase,
26404
26742
  type: external_exports.literal("STEP_STARTED"),
26405
26743
  stepName: external_exports.string()
26406
26744
  });
26407
26745
  var stepFinishedEventSchema = external_exports.object({
26746
+ ...agUiEventBase,
26408
26747
  type: external_exports.literal("STEP_FINISHED"),
26409
26748
  stepName: external_exports.string()
26410
26749
  });
26411
26750
  var textMessageStartEventSchema = external_exports.object({
26751
+ ...agUiEventBase,
26412
26752
  type: external_exports.literal("TEXT_MESSAGE_START"),
26413
26753
  messageId: external_exports.string(),
26414
- role: agUiRoleSchema
26754
+ role: agUiRoleSchema,
26755
+ subagentRunId: external_exports.string().optional()
26415
26756
  });
26416
26757
  var textMessageContentEventSchema = external_exports.object({
26758
+ ...agUiEventBase,
26417
26759
  type: external_exports.literal("TEXT_MESSAGE_CONTENT"),
26418
26760
  messageId: external_exports.string(),
26419
26761
  /** Non-empty incremental text. */
26420
26762
  delta: external_exports.string()
26421
26763
  });
26422
26764
  var textMessageEndEventSchema = external_exports.object({
26765
+ ...agUiEventBase,
26423
26766
  type: external_exports.literal("TEXT_MESSAGE_END"),
26424
- messageId: external_exports.string()
26767
+ messageId: external_exports.string(),
26768
+ subagentRunId: external_exports.string().optional()
26425
26769
  });
26426
26770
  var toolCallStartEventSchema = external_exports.object({
26771
+ ...agUiEventBase,
26427
26772
  type: external_exports.literal("TOOL_CALL_START"),
26428
26773
  toolCallId: external_exports.string(),
26429
26774
  toolCallName: external_exports.string(),
26430
- parentMessageId: external_exports.string().optional()
26775
+ parentMessageId: external_exports.string().optional(),
26776
+ subagentRunId: external_exports.string().optional()
26431
26777
  });
26432
26778
  var toolCallArgsEventSchema = external_exports.object({
26779
+ ...agUiEventBase,
26433
26780
  type: external_exports.literal("TOOL_CALL_ARGS"),
26434
26781
  toolCallId: external_exports.string(),
26435
26782
  /** Incremental (or, for non-streaming providers, complete) JSON-text of args. */
26436
26783
  delta: external_exports.string()
26437
26784
  });
26438
26785
  var toolCallEndEventSchema = external_exports.object({
26786
+ ...agUiEventBase,
26439
26787
  type: external_exports.literal("TOOL_CALL_END"),
26440
26788
  toolCallId: external_exports.string()
26441
26789
  });
26442
26790
  var toolCallResultEventSchema = external_exports.object({
26791
+ ...agUiEventBase,
26443
26792
  type: external_exports.literal("TOOL_CALL_RESULT"),
26444
26793
  messageId: external_exports.string(),
26445
26794
  toolCallId: external_exports.string(),
@@ -26447,37 +26796,83 @@ var toolCallResultEventSchema = external_exports.object({
26447
26796
  role: external_exports.literal("tool").optional()
26448
26797
  });
26449
26798
  var stateSnapshotEventSchema = external_exports.object({
26799
+ ...agUiEventBase,
26450
26800
  type: external_exports.literal("STATE_SNAPSHOT"),
26451
26801
  snapshot: external_exports.record(external_exports.string(), external_exports.unknown())
26452
26802
  });
26453
26803
  var stateDeltaEventSchema = external_exports.object({
26804
+ ...agUiEventBase,
26454
26805
  type: external_exports.literal("STATE_DELTA"),
26455
26806
  delta: jsonPatchSchema
26456
26807
  });
26457
26808
  var reasoningStartEventSchema = external_exports.object({
26809
+ ...agUiEventBase,
26458
26810
  type: external_exports.literal("REASONING_START"),
26459
- messageId: external_exports.string()
26811
+ messageId: external_exports.string(),
26812
+ subagentRunId: external_exports.string().optional()
26460
26813
  });
26461
26814
  var reasoningMessageStartEventSchema = external_exports.object({
26815
+ ...agUiEventBase,
26462
26816
  type: external_exports.literal("REASONING_MESSAGE_START"),
26463
26817
  messageId: external_exports.string(),
26464
- role: external_exports.literal("reasoning")
26818
+ role: external_exports.literal("reasoning"),
26819
+ subagentRunId: external_exports.string().optional()
26465
26820
  });
26466
26821
  var reasoningMessageContentEventSchema = external_exports.object({
26822
+ ...agUiEventBase,
26467
26823
  type: external_exports.literal("REASONING_MESSAGE_CONTENT"),
26468
26824
  messageId: external_exports.string(),
26469
26825
  /** Non-empty incremental reasoning text. */
26470
- delta: external_exports.string()
26826
+ delta: external_exports.string(),
26827
+ subagentRunId: external_exports.string().optional()
26471
26828
  });
26472
26829
  var reasoningMessageEndEventSchema = external_exports.object({
26830
+ ...agUiEventBase,
26473
26831
  type: external_exports.literal("REASONING_MESSAGE_END"),
26474
- messageId: external_exports.string()
26832
+ messageId: external_exports.string(),
26833
+ subagentRunId: external_exports.string().optional()
26475
26834
  });
26476
26835
  var reasoningEndEventSchema = external_exports.object({
26836
+ ...agUiEventBase,
26477
26837
  type: external_exports.literal("REASONING_END"),
26478
- messageId: external_exports.string()
26838
+ messageId: external_exports.string(),
26839
+ subagentRunId: external_exports.string().optional()
26840
+ });
26841
+ var subagentStartedEventSchema = external_exports.object({
26842
+ ...agUiEventBase,
26843
+ type: external_exports.literal("SUBAGENT_STARTED"),
26844
+ subagentRunId: external_exports.string(),
26845
+ name: external_exports.string(),
26846
+ description: external_exports.string().optional(),
26847
+ parentSubagentRunId: external_exports.string().optional(),
26848
+ parentToolCallId: external_exports.string().optional(),
26849
+ parentMessageId: external_exports.string().optional()
26850
+ });
26851
+ var subagentFinishedSuccessOutcomeSchema = external_exports.object({ type: external_exports.literal("success") });
26852
+ var subagentFinishedSuspendedOutcomeSchema = external_exports.object({
26853
+ type: external_exports.literal("suspended"),
26854
+ interruptIds: external_exports.array(external_exports.string()).optional()
26855
+ });
26856
+ var subagentFinishedOutcomeSchema = external_exports.discriminatedUnion("type", [
26857
+ subagentFinishedSuccessOutcomeSchema,
26858
+ subagentFinishedSuspendedOutcomeSchema
26859
+ ]);
26860
+ var subagentFinishedEventSchema = external_exports.object({
26861
+ ...agUiEventBase,
26862
+ type: external_exports.literal("SUBAGENT_FINISHED"),
26863
+ subagentRunId: external_exports.string(),
26864
+ result: external_exports.unknown().optional(),
26865
+ outcome: subagentFinishedOutcomeSchema.optional()
26866
+ });
26867
+ var subagentErrorEventSchema = external_exports.object({
26868
+ ...agUiEventBase,
26869
+ type: external_exports.literal("SUBAGENT_ERROR"),
26870
+ subagentRunId: external_exports.string(),
26871
+ message: external_exports.string(),
26872
+ code: external_exports.string().optional()
26479
26873
  });
26480
26874
  var customEventSchema = external_exports.object({
26875
+ ...agUiEventBase,
26481
26876
  type: external_exports.literal("CUSTOM"),
26482
26877
  name: external_exports.string(),
26483
26878
  value: external_exports.unknown()
@@ -26502,6 +26897,9 @@ var agUiSSEEventSchema = external_exports.discriminatedUnion("type", [
26502
26897
  reasoningMessageContentEventSchema,
26503
26898
  reasoningMessageEndEventSchema,
26504
26899
  reasoningEndEventSchema,
26900
+ subagentStartedEventSchema,
26901
+ subagentFinishedEventSchema,
26902
+ subagentErrorEventSchema,
26505
26903
  customEventSchema
26506
26904
  ]);
26507
26905
  function isRecord(value) {
@@ -26549,6 +26947,18 @@ function isReservedRuntypeToolName(name) {
26549
26947
  function reservedToolNameMessage(subject, name) {
26550
26948
  return `${subject} "${name}" collides with the reserved tool name "${RUNTYPE_SET_STATE_TOOL_NAME}" (the agent state write tool). Tool names are lowercased and non-alphanumeric characters become "_" before the model sees them, so every spelling that normalizes to it is reserved with it. "runtype_" is a reserved tool namespace. Rename the tool.`;
26551
26949
  }
26950
+ var CLIENT_EXECUTED_TOOL_TYPES = /* @__PURE__ */ new Set(["local", "webmcp"]);
26951
+ function isClientExecutedToolType(toolType) {
26952
+ return typeof toolType === "string" && CLIENT_EXECUTED_TOOL_TYPES.has(toolType);
26953
+ }
26954
+ function productSurfacePauseReasonsFromFacts(facts, includeApproval) {
26955
+ const reasons = [];
26956
+ if (facts.hasClientExecutedTools) reasons.push("client-executed tools");
26957
+ if (includeApproval && facts.hasApprovalSteps) reasons.push("approval gates");
26958
+ if (facts.stepTypes.includes("wait-until")) reasons.push("wait-until steps");
26959
+ if (facts.stepTypes.includes("crawl")) reasons.push("crawl steps");
26960
+ return reasons;
26961
+ }
26552
26962
  function isCatalogToolCallStepToolId(toolId) {
26553
26963
  return isBuiltInToolId(toolId) || isPlatformToolId(toolId);
26554
26964
  }
@@ -27200,17 +27610,7 @@ var agentRuntimeConfigSchema = external_exports.object({
27200
27610
  // WHY(#7794): Defaults true; false keeps the pre-#7794 verdict for a length-truncated tool call.
27201
27611
  treatLengthCutoffAsFailure: external_exports.boolean().optional()
27202
27612
  }).optional(),
27203
- voice: external_exports.object({
27204
- enabled: external_exports.boolean().optional(),
27205
- provider: external_exports.string().optional(),
27206
- interruptionMode: external_exports.enum(["none", "cancel", "barge-in"]).optional(),
27207
- elevenLabs: external_exports.object({
27208
- voiceId: external_exports.string().optional(),
27209
- modelId: external_exports.string().optional(),
27210
- stability: external_exports.number().min(0).max(1).optional(),
27211
- similarity: external_exports.number().min(0).max(1).optional()
27212
- }).optional()
27213
- }).optional(),
27613
+ voice: agentVoiceProfileSchema.optional(),
27214
27614
  errorHandling: errorHandlingSchema,
27215
27615
  loggingPolicy: external_exports.enum(["default", "on", "off"]).optional(),
27216
27616
  // WHY(docs/why/packages/shared/src.md#default-pii-redaction-defers-to-a-lower-layer-or): 'default' PII redaction defers to a lower layer or the resolver default (off); mirrors loggingPolicy
@@ -32562,12 +32962,6 @@ function extractSecretReferencesFromAnyValue(value, maxDepth = 10) {
32562
32962
  }
32563
32963
  var STORE_ASSET_MAX_BYTES = 25 * 1024 * 1024;
32564
32964
  var STORE_ASSET_MAX_BASE64_LENGTH = Math.ceil(STORE_ASSET_MAX_BYTES * (4 / 3)) + 16;
32565
- var EMBEDDING_COST_PER_1K_TOKENS = Object.freeze({
32566
- "text-embedding-3-small": 2e-5,
32567
- // $0.02 per 1M tokens
32568
- "text-embedding-3-large": 13e-5
32569
- // $0.13 per 1M tokens
32570
- });
32571
32965
  var END_USER_USAGE_PERIODS = ["billing_period", "7d", "30d", "90d"];
32572
32966
  var endUserUsageQuerySchema = external_exports.object({
32573
32967
  productId: external_exports.string().min(1),
@@ -33607,17 +34001,7 @@ var agentReasoningConfigSchema = external_exports.object({
33607
34001
  thinkingLevel: external_exports.string().min(1).max(32).optional(),
33608
34002
  includeThoughts: external_exports.boolean().optional()
33609
34003
  });
33610
- var agentVoiceConfigSchema = external_exports.object({
33611
- enabled: external_exports.boolean().optional(),
33612
- provider: external_exports.string().optional(),
33613
- interruptionMode: external_exports.enum(["none", "cancel", "barge-in"]).optional(),
33614
- elevenLabs: external_exports.object({
33615
- voiceId: external_exports.string().optional(),
33616
- modelId: external_exports.string().optional(),
33617
- stability: external_exports.number().min(0).max(1).optional(),
33618
- similarity: external_exports.number().min(0).max(1).optional()
33619
- }).optional()
33620
- });
34004
+ var agentVoiceConfigSchema = agentVoiceProfileSchema;
33621
34005
  var agentErrorHandlingSchema = external_exports.object({
33622
34006
  onError: external_exports.enum(["fail", "continue", "fallback"]).optional(),
33623
34007
  fallbacks: external_exports.array(
@@ -34269,8 +34653,15 @@ var FLAT_ADVANCED_CONFIG_KEYS = {
34269
34653
  var FLAT_ADVANCED_CONFIG_KEY_LIST = Object.keys(
34270
34654
  FLAT_ADVANCED_CONFIG_KEYS
34271
34655
  );
34272
- function createIssue(severity, code, message, path21, suggestedFix) {
34273
- return { code, message, path: path21, severity, ...suggestedFix ? { suggestedFix } : {} };
34656
+ function createIssue(severity, code, message, path21, suggestedFix, details) {
34657
+ return {
34658
+ code,
34659
+ message,
34660
+ path: path21,
34661
+ severity,
34662
+ ...suggestedFix ? { suggestedFix } : {},
34663
+ ...details ? { details } : {}
34664
+ };
34274
34665
  }
34275
34666
  function emptyResult() {
34276
34667
  return { valid: true, errors: [], warnings: [], recommendations: [] };
@@ -34837,6 +35228,164 @@ function validateConnectivity(fpo) {
34837
35228
  result.valid = result.errors.length === 0;
34838
35229
  return result;
34839
35230
  }
35231
+ var AG_UI_SERVER_AUTHORED_PAUSE_CODE = "AG_UI_SERVER_AUTHORED_PAUSE";
35232
+ var INCLUDE_APPROVAL_REASON = false;
35233
+ var CONDITIONAL_BRANCH_STEP_KEYS2 = [
35234
+ "trueSteps",
35235
+ "falseSteps",
35236
+ "true_steps",
35237
+ "false_steps",
35238
+ "otherwiseSteps"
35239
+ ];
35240
+ function isRecord4(value) {
35241
+ return typeof value === "object" && value !== null && !Array.isArray(value);
35242
+ }
35243
+ function scanRuntimeTools(tools, acc, depth) {
35244
+ if (depth > MAX_CONDITIONAL_NESTING_DEPTH || !Array.isArray(tools)) return;
35245
+ for (const tool of tools) {
35246
+ if (!isRecord4(tool) || tool.enabled === false) continue;
35247
+ if (isClientExecutedToolType(tool.toolType)) acc.hasClientExecutedTools = true;
35248
+ const config3 = isRecord4(tool.config) ? tool.config : void 0;
35249
+ if (!config3) continue;
35250
+ if (isRecord4(config3.flow)) scanSteps(config3.flow.steps, acc, depth + 1);
35251
+ const inlineAgent = isRecord4(config3.agent) ? config3.agent : isRecord4(config3.subAgent) ? config3.subAgent : void 0;
35252
+ if (inlineAgent) scanAgentDefinition(inlineAgent, acc, depth + 1);
35253
+ }
35254
+ }
35255
+ function scanToolsBlock(tools, acc, depth) {
35256
+ if (!isRecord4(tools)) return;
35257
+ scanRuntimeTools(tools.runtimeTools, acc, depth);
35258
+ }
35259
+ function scanSteps(steps, acc, depth) {
35260
+ if (depth > MAX_CONDITIONAL_NESTING_DEPTH || !Array.isArray(steps)) return;
35261
+ for (const step of steps) {
35262
+ if (!isRecord4(step) || step.enabled === false) continue;
35263
+ if (typeof step.type === "string") acc.stepTypes.add(step.type);
35264
+ const config3 = isRecord4(step.config) ? step.config : void 0;
35265
+ if (!config3) continue;
35266
+ scanToolsBlock(config3.tools, acc, depth);
35267
+ scanSteps(config3.steps, acc, depth + 1);
35268
+ for (const key of CONDITIONAL_BRANCH_STEP_KEYS2) scanSteps(config3[key], acc, depth + 1);
35269
+ if (!Array.isArray(config3.branches)) continue;
35270
+ for (const branch of config3.branches) {
35271
+ if (isRecord4(branch)) scanSteps(branch.steps, acc, depth + 1);
35272
+ }
35273
+ }
35274
+ }
35275
+ function agentToolsBlock(agent) {
35276
+ if (isRecord4(agent.config)) return agent.config.tools;
35277
+ return agent.toolsConfig;
35278
+ }
35279
+ function scanAgentDefinition(agent, acc, depth) {
35280
+ if (depth > MAX_CONDITIONAL_NESTING_DEPTH) return;
35281
+ scanToolsBlock(agentToolsBlock(agent), acc, depth);
35282
+ if (!Array.isArray(agent.capabilities)) return;
35283
+ for (const capability of agent.capabilities) {
35284
+ if (!isRecord4(capability)) continue;
35285
+ if (isRecord4(capability.flow)) scanSteps(capability.flow.steps, acc, depth + 1);
35286
+ if (isRecord4(capability.subAgent)) scanAgentDefinition(capability.subAgent, acc, depth + 1);
35287
+ }
35288
+ }
35289
+ function referencedCapabilityIds(agent) {
35290
+ const ids = [];
35291
+ if (Array.isArray(agent.capabilityToolRefs)) {
35292
+ for (const ref of agent.capabilityToolRefs) {
35293
+ if (isRecord4(ref) && typeof ref.capabilityId === "string") ids.push(ref.capabilityId);
35294
+ }
35295
+ }
35296
+ const tools = agentToolsBlock(agent);
35297
+ const toolIds = isRecord4(tools) ? tools.toolIds : void 0;
35298
+ if (Array.isArray(toolIds)) {
35299
+ for (const toolId of toolIds) {
35300
+ if (typeof toolId === "string" && toolId.startsWith("capability:")) {
35301
+ ids.push(toolId.slice("capability:".length));
35302
+ }
35303
+ }
35304
+ }
35305
+ return ids;
35306
+ }
35307
+ function scanCapability(capabilityId, capabilities, acc, visited) {
35308
+ if (visited.has(capabilityId)) return;
35309
+ visited.add(capabilityId);
35310
+ const capability = capabilities.get(capabilityId);
35311
+ if (!capability) return;
35312
+ if (isRecord4(capability.flow)) scanSteps(capability.flow.steps, acc, 0);
35313
+ if (!isRecord4(capability.agent)) return;
35314
+ scanAgentDefinition(capability.agent, acc, 0);
35315
+ for (const ref of referencedCapabilityIds(capability.agent)) {
35316
+ scanCapability(ref, capabilities, acc, visited);
35317
+ }
35318
+ }
35319
+ function suggestedFixFor(reasons) {
35320
+ const fixes = [];
35321
+ if (reasons.includes("client-executed tools")) {
35322
+ fixes.push(
35323
+ "Declare client-executed tools from the AG-UI client in RunAgentInput.tools instead of on the agent"
35324
+ );
35325
+ }
35326
+ if (reasons.includes("wait-until steps") || reasons.includes("crawl steps")) {
35327
+ fixes.push(
35328
+ "move the waiting work into a separate capability this AG-UI surface does not route to"
35329
+ );
35330
+ }
35331
+ return `${fixes.join(", or ")}.`;
35332
+ }
35333
+ function pauseMessage(surfaceName, capabilityId, reasons) {
35334
+ return `The "${surfaceName}" AG-UI surface routes capability "${capabilityId}", whose execution pauses in a way an AG-UI client cannot resume: ${reasons.join(", ")}. Runtype refuses the run with 501 AG_UI_DEFINITION_CONTINUATION_UNSUPPORTED before the agent starts.`;
35335
+ }
35336
+ function agUiServerAuthoredPauseIssues(fpo) {
35337
+ const surfaces = Array.isArray(fpo.surfaces) ? fpo.surfaces : [];
35338
+ if (surfaces.length === 0) return [];
35339
+ const capabilities = /* @__PURE__ */ new Map();
35340
+ for (const capability of Array.isArray(fpo.capabilities) ? fpo.capabilities : []) {
35341
+ if (!isRecord4(capability) || typeof capability.id !== "string") continue;
35342
+ if (!capabilities.has(capability.id)) capabilities.set(capability.id, capability);
35343
+ }
35344
+ const reasonsByCapability = /* @__PURE__ */ new Map();
35345
+ const reasonsFor = (capabilityId) => {
35346
+ const cached2 = reasonsByCapability.get(capabilityId);
35347
+ if (cached2) return cached2;
35348
+ const acc = { hasClientExecutedTools: false, stepTypes: /* @__PURE__ */ new Set() };
35349
+ scanCapability(capabilityId, capabilities, acc, /* @__PURE__ */ new Set());
35350
+ const reasons = productSurfacePauseReasonsFromFacts(
35351
+ {
35352
+ hasClientExecutedTools: acc.hasClientExecutedTools,
35353
+ hasApprovalSteps: false,
35354
+ stepTypes: [...acc.stepTypes]
35355
+ },
35356
+ INCLUDE_APPROVAL_REASON
35357
+ );
35358
+ reasonsByCapability.set(capabilityId, reasons);
35359
+ return reasons;
35360
+ };
35361
+ const issues = [];
35362
+ for (const [si, surface] of surfaces.entries()) {
35363
+ if (!isRecord4(surface) || surface.type !== "ag-ui") continue;
35364
+ const surfaceName = typeof surface.name === "string" ? surface.name : "ag-ui";
35365
+ const routes = Array.isArray(surface.routes) ? surface.routes : [];
35366
+ for (const [ri, route] of routes.entries()) {
35367
+ if (!isRecord4(route) || typeof route.capabilityId !== "string") continue;
35368
+ const reasons = reasonsFor(route.capabilityId);
35369
+ if (reasons.length === 0) continue;
35370
+ issues.push(
35371
+ createIssue(
35372
+ "warning",
35373
+ AG_UI_SERVER_AUTHORED_PAUSE_CODE,
35374
+ pauseMessage(surfaceName, route.capabilityId, reasons),
35375
+ `surfaces[${si}].routes[${ri}].capabilityId`,
35376
+ suggestedFixFor(reasons),
35377
+ { reasons }
35378
+ )
35379
+ );
35380
+ }
35381
+ }
35382
+ return issues;
35383
+ }
35384
+ function validateAgUiSurfacePauses(fpo) {
35385
+ const result = emptyResult();
35386
+ result.warnings.push(...agUiServerAuthoredPauseIssues(fpo));
35387
+ return result;
35388
+ }
34840
35389
  function safeValidate(fn) {
34841
35390
  try {
34842
35391
  return fn();
@@ -35086,7 +35635,15 @@ function validateFPO(fpo) {
35086
35635
  (surface, i) => safeValidate(() => validateSurfaceDefinition(surface, i))
35087
35636
  );
35088
35637
  const connectivityResult = safeValidate(() => validateConnectivity(fpo));
35089
- return mergeResults(result, ...capResults, ...toolResults, ...surfaceResults, connectivityResult);
35638
+ const agUiPauseResult = safeValidate(() => validateAgUiSurfacePauses(fpo));
35639
+ return mergeResults(
35640
+ result,
35641
+ ...capResults,
35642
+ ...toolResults,
35643
+ ...surfaceResults,
35644
+ connectivityResult,
35645
+ agUiPauseResult
35646
+ );
35090
35647
  }
35091
35648
  function zodIssueCodeToValidationCode(code) {
35092
35649
  return code ? `SCHEMA_${code.toUpperCase()}` : "SCHEMA_ERROR";
@@ -35974,9 +36531,7 @@ var DispatchRequestEnvelopeSchema = external_exports.object({
35974
36531
  * every submitted webmcp tool. See {@link ClientToolsPolicySchema}.
35975
36532
  */
35976
36533
  clientToolsPolicy: ClientToolsPolicySchema.optional(),
35977
- secrets: external_exports.record(external_exports.string(), external_exports.string()).optional().describe(
35978
- "Retired. A NON-EMPTY map on an agent dispatch is rejected with 400 RUNTIME_AGENT_TRANSIENT_SECRETS_UNSUPPORTED. There is no longer an exception: the legacy engine that honored it for single-turn agents behind `options.useRuntimePackage: false` has been removed, and that opt-out is itself a 400 now. An empty map is accepted and does nothing. Ignored on flow dispatches. Store credentials as managed secrets and reference them as {{secret:NAME}}. The field is kept on the wire for compatibility only."
35979
- ),
36534
+ secrets: external_exports.record(external_exports.string(), external_exports.string()).optional().describe(DISPATCH_TRANSIENT_SECRETS_RETIRED_NOTE),
35980
36535
  credentialProxies: external_exports.array(credentialProxyConfigSchema).max(10).optional(),
35981
36536
  inputs: external_exports.record(external_exports.string(), external_exports.any()).optional().refine(
35982
36537
  (data) => {
@@ -36782,6 +37337,15 @@ var appRoutingDocSchema = external_exports.object({
36782
37337
  });
36783
37338
  var DEFAULT_STEP_TIMEOUT_MS = 5 * 60 * 1e3;
36784
37339
  var DEFAULT_AGENT_WALL_CLOCK_TIMEOUT_MS = 5 * 60 * 1e3;
37340
+ var customModelReasoningDeclarationSchema = external_exports.object({
37341
+ supported: external_exports.boolean(),
37342
+ defaultEffort: external_exports.string().trim().min(1).max(32).optional()
37343
+ }).refine((value) => value.defaultEffort === void 0 || value.supported, {
37344
+ message: "defaultEffort requires supported: true",
37345
+ path: ["defaultEffort"]
37346
+ });
37347
+ var CUSTOM_MODEL_REASONING_EFFORT_LADDER = ["low", "medium", "high"];
37348
+ var CUSTOM_MODEL_DEFAULT_EFFORT_OPTIONS = ["none", ...CUSTOM_MODEL_REASONING_EFFORT_LADDER];
36785
37349
 
36786
37350
  // src/config/env.ts
36787
37351
  function getApiUrl() {
@@ -67000,11 +67564,11 @@ import path20 from "path";
67000
67564
  var MAX_SIDECAR_OUTPUT_BYTES = 1048576;
67001
67565
  var MAX_HELPER_BYTES = 100 * 1048576;
67002
67566
  var DEFAULT_SIDECAR_TIMEOUT_MS = 3e4;
67003
- function isRecord4(value) {
67567
+ function isRecord5(value) {
67004
67568
  return typeof value === "object" && value !== null && !Array.isArray(value);
67005
67569
  }
67006
67570
  function parseHello(value) {
67007
- if (!isRecord4(value) || typeof value.providerId !== "string" || typeof value.protocolVersion !== "number" || typeof value.helperVersion !== "string" || typeof value.platform !== "string" || !Array.isArray(value.capabilities) || !value.capabilities.every((capability) => typeof capability === "string")) {
67571
+ if (!isRecord5(value) || typeof value.providerId !== "string" || typeof value.protocolVersion !== "number" || typeof value.helperVersion !== "string" || typeof value.platform !== "string" || !Array.isArray(value.capabilities) || !value.capabilities.every((capability) => typeof capability === "string")) {
67008
67572
  throw new DeviceProviderError(
67009
67573
  "The native helper returned an invalid hello response",
67010
67574
  "INVALID_RESPONSE"
@@ -67143,7 +67707,7 @@ var MacOSDeviceProvider = class {
67143
67707
  );
67144
67708
  }
67145
67709
  const result = await this.invokeAt(binaryPath, method, params);
67146
- if (!isRecord4(result)) {
67710
+ if (!isRecord5(result)) {
67147
67711
  throw new DeviceProviderError(
67148
67712
  "The native helper returned a non-object result",
67149
67713
  "INVALID_RESPONSE"
@@ -67373,11 +67937,11 @@ var defaultDependencies3 = {
67373
67937
  process.exitCode = code;
67374
67938
  }
67375
67939
  };
67376
- function isRecord5(value) {
67940
+ function isRecord6(value) {
67377
67941
  return typeof value === "object" && value !== null && !Array.isArray(value);
67378
67942
  }
67379
67943
  function unwrapData(response) {
67380
- if (!isRecord5(response) || !("data" in response)) {
67944
+ if (!isRecord6(response) || !("data" in response)) {
67381
67945
  throw new Error("Runtype API returned an invalid device response");
67382
67946
  }
67383
67947
  return response.data;
@@ -67386,11 +67950,11 @@ function errorMessage2(error61) {
67386
67950
  return error61 instanceof Error ? error61.message : String(error61);
67387
67951
  }
67388
67952
  function apiStatusCode(error61) {
67389
- return isRecord5(error61) && typeof error61.statusCode === "number" ? error61.statusCode : null;
67953
+ return isRecord6(error61) && typeof error61.statusCode === "number" ? error61.statusCode : null;
67390
67954
  }
67391
67955
  function isRecordedRevocationError(error61) {
67392
67956
  if (apiStatusCode(error61) !== 503) return false;
67393
- const data = isRecord5(error61) && isRecord5(error61.data) ? error61.data : null;
67957
+ const data = isRecord6(error61) && isRecord6(error61.data) ? error61.data : null;
67394
67958
  const detail = typeof data?.error === "string" ? data.error : errorMessage2(error61);
67395
67959
  return detail.toLowerCase().includes("revocation was recorded");
67396
67960
  }
@@ -67743,7 +68307,7 @@ Grant Full Disk Access to ${String(local.executablePath)} to enable iMessage rea
67743
68307
  return;
67744
68308
  }
67745
68309
  const content = await readFile2(status.logPath, "utf8").catch((error61) => {
67746
- const code = isRecord5(error61) ? error61.code : void 0;
68310
+ const code = isRecord6(error61) ? error61.code : void 0;
67747
68311
  if (code === "ENOENT") return "";
67748
68312
  throw error61;
67749
68313
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.36.1",
3
+ "version": "2.36.2",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,7 +11,7 @@
11
11
  "@modelcontextprotocol/client": "2.0.0",
12
12
  "@modelcontextprotocol/core": "2.0.0",
13
13
  "@runtypelabs/ink-components": "0.3.7",
14
- "@runtypelabs/sdk": "9.7.0",
14
+ "@runtypelabs/sdk": "9.8.0",
15
15
  "@runtypelabs/terminal-animations": "0.2.4",
16
16
  "add-mcp": "2.0.0",
17
17
  "chalk": "^5.3.0",
@@ -33,7 +33,7 @@
33
33
  "devDependencies": {
34
34
  "@modelcontextprotocol/server": "2.0.0",
35
35
  "@runtypelabs/persona": "4.22.0",
36
- "@runtypelabs/shared": "3.40.0",
36
+ "@runtypelabs/shared": "3.42.0",
37
37
  "@types/express": "^5.0.6",
38
38
  "@types/micromatch": "^4.0.9",
39
39
  "@types/node": "^25.3.3",