@runtypelabs/cli 2.40.16 → 2.41.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1446 -771
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -20278,7 +20278,7 @@ function date4(params) {
20278
20278
  return _coercedDate(ZodDate, params);
20279
20279
  }
20280
20280
 
20281
- // ../shared/dist/chunk-G3CLBFD7.mjs
20281
+ // ../shared/dist/chunk-U2LBCYYU.mjs
20282
20282
  var REPLAY_FROM_START = Object.freeze({
20283
20283
  row: 0,
20284
20284
  sub: Number.POSITIVE_INFINITY
@@ -20328,6 +20328,9 @@ var runListRowSchema = external_exports.object({
20328
20328
  parentExecutionId: str("Run that spawned this one."),
20329
20329
  parentToolCallId: str("Parent's tool call that spawned this run."),
20330
20330
  rootExecutionId: str("Outermost run of the tree."),
20331
+ childCount: num(
20332
+ "How many runs name this one as their parent. The unscoped feed returns roots only, so this is the size of the fold underneath a row; read the children with parentExecutionId=<executionId>. It is populated on a resource-scoped page too, where nothing is folded, so a surface can still offer the same expansion. WHICH children are counted depends on the arm that served the row: the span store counts every child, agent and nested-flow alike, while the legacy control-plane fallback counts agent children only, so on that arm a parent whose only child is a nested flow reports 0. That is deliberate \u2014 the fallback arm cannot enumerate a nested-flow child either, so counting one would advertise a fold that opens on nothing. It counts only children the CALLER may read: a credential holding one execution family (AGENTS:READ or FLOWS:READ alone) counts the children of that family and no others, so a count never discloses a run the same credential could not list. NULL means the arm cannot count children at all, which is not zero."
20333
+ ),
20331
20334
  source: external_exports.enum(RUN_SOURCES).describe("hosted, or ingested for an OTLP export. An ingested run is never reported running."),
20332
20335
  fidelityTier: str("Fidelity of the projection behind this row."),
20333
20336
  completeness: external_exports.enum(RUN_COMPLETENESS_VALUES).nullable().describe("Storage completeness; null on a row the control-plane arm served."),
@@ -20335,10 +20338,19 @@ var runListRowSchema = external_exports.object({
20335
20338
  spanCount: num("Spans the projection wrote."),
20336
20339
  inputTokens: num("Input tokens reported."),
20337
20340
  outputTokens: num("Output tokens reported."),
20341
+ cacheReadTokens: external_exports.number().nullish().describe(
20342
+ "Prompt-cache reads summed over the run's model calls (a subset of inputTokens). Returned by GET /v1/runs/{executionId} only; null means no model call reported one."
20343
+ ),
20344
+ cacheWriteTokens: external_exports.number().nullish().describe(
20345
+ "Prompt-cache writes summed over the run's model calls (a subset of inputTokens). Returned by GET /v1/runs/{executionId} only; null means no model call reported one."
20346
+ ),
20347
+ reasoningTokens: external_exports.number().nullish().describe(
20348
+ "Reasoning tokens summed over the run's model calls (a subset of outputTokens). Returned by GET /v1/runs/{executionId} only; null means no model call reported one."
20349
+ ),
20338
20350
  totalCost: str("Metered cost as a decimal string."),
20339
20351
  selfReportedCost: str("Cost the producer reported."),
20340
20352
  origin: external_exports.enum(RUN_ORIGINS).nullable().describe(
20341
- `Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field: dashboard for a Clerk session, api for a management API key, internal for a Runtype worker. NULL means the header states nothing about it, which is not "unknown caller": headers written before this field shipped, lanes that never see an auth principal, and every backfilled row carry no origin stamp.`
20353
+ `Where the run was dispatched from, taken from the caller's authenticated principal and never from a request field. ANY entrance that resolves a principal stamps it: a Clerk session answers dashboard; a management API key answers api, which includes the Runtype MCP server's tools and Code Mode, since both reach dispatch with a management key; and Runtype's own internal caller answers internal, for example the hosted /v1/mcp proxy. A lane that resolves NO principal carries NULL BY DESIGN: schedule, webhook, messaging, A2A, an agent exposed AS an MCP surface, subagent, nested flow, a client-token product surface (an end user is none of the three origins) and an ingested OTLP run. So NULL says "no authenticated principal at this entrance" rather than "unknown caller". The one NULL that is not a statement about the lane is a row whose header predates the field or came from the backfill: it stamps nothing even for a run that did resolve a principal.`
20342
20354
  ),
20343
20355
  storeResults: external_exports.boolean().nullable().describe(
20344
20356
  'The persistence posture the dispatch declared. FALSE means the run wrote no control-plane row, no journal outputs and no span content, so a surface that reports a missing transcript keys on this and never on origin. NULL means the header states nothing, which is not "true": a lane that takes no such flag carries no stamp, and an ingested (OTLP) run declared none. A row served from the legacy control-plane lane answers true, because that row exists only when the run stored.'
@@ -20402,6 +20414,7 @@ var runStatusFilterSchema = external_exports.enum(RUN_STATUS_FILTERS, {
20402
20414
  error: () => RUN_STATUS_FILTER_MESSAGE
20403
20415
  });
20404
20416
  var repeatable = () => external_exports.union([external_exports.string(), external_exports.array(external_exports.string())]);
20417
+ var RUN_LIST_INCLUDE_CHILDREN_DESCRIPTION = "true restores the flat enumeration on the UNSCOPED feed, in which a subagent run and a nested-flow run list beside their parent. The unscoped feed is roots only by default: a row whose parentExecutionId is set folds under its parent and is read with parentExecutionId=<executionId>. Any filter that scopes to a resource \u2014 agentId, flowId, conversationId, surfaceId, recordId, batchExecutionId, parentExecutionId, rootExecutionId or executionId \u2014 is already an explicit selection and never folds, so an agent that only ever runs as a subagent still lists under agentId. This parameter changes nothing on a scoped request.";
20405
20418
  var runListQuerySchema = external_exports.object({
20406
20419
  agentId: repeatable().optional().describe("Filter by agent id; repeat for a set."),
20407
20420
  flowId: repeatable().optional().describe("Filter by flow id; repeat for a set."),
@@ -20412,6 +20425,7 @@ var runListQuerySchema = external_exports.object({
20412
20425
  batchExecutionId: repeatable().optional().describe("Filter by batch id; repeat for a set."),
20413
20426
  parentExecutionId: external_exports.string().optional().describe("Runs spawned by this execution."),
20414
20427
  rootExecutionId: external_exports.string().optional().describe("Runs in this execution tree."),
20428
+ includeChildren: external_exports.enum(["true", "false"]).optional().describe(RUN_LIST_INCLUDE_CHILDREN_DESCRIPTION),
20415
20429
  executionId: repeatable().optional().describe(`Read specific runs by id; at most ${MAX_RUN_LIST_IDS} per request.`),
20416
20430
  source: external_exports.enum(RUN_SOURCES).optional().describe("Filter by producing lane."),
20417
20431
  status: runStatusFilterSchema.optional().describe(RUN_STATUS_FILTER_MESSAGE),
@@ -20438,123 +20452,7 @@ var scheduleRunLinkSchema = external_exports.object({
20438
20452
  batchExecutionId: external_exports.string().nullable().describe("The batch whose per-record runs are GET /v1/runs?batchExecutionId=.")
20439
20453
  });
20440
20454
 
20441
- // ../shared/dist/chunk-2NMGSD35.mjs
20442
- var GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
20443
- var GEN_AI_AGENT_ID = "gen_ai.agent.id";
20444
- var GEN_AI_AGENT_NAME = "gen_ai.agent.name";
20445
- var GEN_AI_CONVERSATION_ID = "gen_ai.conversation.id";
20446
- var GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
20447
- var GEN_AI_RESPONSE_MODEL_NAME = "gen_ai.response.model";
20448
- var GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens";
20449
- var GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens";
20450
- var GEN_AI_USAGE_CACHE_READ_TOKENS = "gen_ai.usage.cache_read.input_tokens";
20451
- var GEN_AI_USAGE_CACHE_CREATION_TOKENS = "gen_ai.usage.cache_creation.input_tokens";
20452
- var GEN_AI_TOOL_NAME = "gen_ai.tool.name";
20453
- var GEN_AI_TOOL_TYPE = "gen_ai.tool.type";
20454
- var GEN_AI_TOOL_CALL_ID = "gen_ai.tool.call.id";
20455
- var GEN_AI_ATTRIBUTES = {
20456
- operationName: GEN_AI_OPERATION_NAME,
20457
- agentId: GEN_AI_AGENT_ID,
20458
- agentName: GEN_AI_AGENT_NAME,
20459
- conversationId: GEN_AI_CONVERSATION_ID,
20460
- requestModel: GEN_AI_REQUEST_MODEL,
20461
- usageInputTokens: GEN_AI_USAGE_INPUT_TOKENS,
20462
- usageOutputTokens: GEN_AI_USAGE_OUTPUT_TOKENS,
20463
- /** Input tokens served from the provider's prompt cache, when the provider reports them. */
20464
- usageCacheReadTokens: GEN_AI_USAGE_CACHE_READ_TOKENS,
20465
- /** Input tokens written INTO the provider's prompt cache, when the provider reports them. */
20466
- usageCacheCreationTokens: GEN_AI_USAGE_CACHE_CREATION_TOKENS,
20467
- /** The model the provider reported having SERVED; the more accurate one to price. */
20468
- responseModel: GEN_AI_RESPONSE_MODEL_NAME,
20469
- toolName: GEN_AI_TOOL_NAME,
20470
- toolType: GEN_AI_TOOL_TYPE,
20471
- toolCallId: GEN_AI_TOOL_CALL_ID
20472
- };
20473
-
20474
- // ../shared/dist/chunk-GYGZIK4G.mjs
20475
- var RUNTYPE_ITERATION = "runtype.iteration";
20476
- var RUNTYPE_TOTAL_COST = "runtype.total_cost";
20477
- var RUNTYPE_TURN_INDEX = "runtype.turn.index";
20478
- var RUNTYPE_LEGACY_ATTRIBUTE_ALIASES = {
20479
- [RUNTYPE_ITERATION]: ["runtype.agent.iteration"],
20480
- [RUNTYPE_TOTAL_COST]: ["runtype.agent.totalCost"],
20481
- [RUNTYPE_TURN_INDEX]: ["runtype.agent.turnIndex"]
20482
- };
20483
- var GEN_AI_TOOL_CALL_ARGUMENTS = "gen_ai.tool.call.arguments";
20484
- var GEN_AI_TOOL_CALL_RESULT = "gen_ai.tool.call.result";
20485
- var GEN_AI_INPUT_MESSAGES = "gen_ai.input.messages";
20486
- var GEN_AI_OUTPUT_MESSAGES = "gen_ai.output.messages";
20487
- var GEN_AI_CONTENT_ATTRIBUTES = {
20488
- /** Chat history sent to the model, as semconv structured messages. */
20489
- inputMessages: GEN_AI_INPUT_MESSAGES,
20490
- /** Messages the model produced (includes reasoning content parts). */
20491
- outputMessages: GEN_AI_OUTPUT_MESSAGES,
20492
- /** System instructions, when separate from the input messages. */
20493
- systemInstructions: "gen_ai.system_instructions",
20494
- /** `execute_tool` span: the arguments the tool was called with. */
20495
- toolCallArguments: GEN_AI_TOOL_CALL_ARGUMENTS,
20496
- /** `execute_tool` span: the result the tool returned. */
20497
- toolCallResult: GEN_AI_TOOL_CALL_RESULT
20498
- };
20499
- var GEN_AI_CONTENT_ATTRIBUTE_ALIASES = {
20500
- [GEN_AI_INPUT_MESSAGES]: ["ai.prompt.messages", "ai.prompt"],
20501
- [GEN_AI_OUTPUT_MESSAGES]: ["ai.response.text", "ai.response.object"],
20502
- [GEN_AI_TOOL_CALL_ARGUMENTS]: ["flue.tool.call.arguments", "ai.toolCall.args"],
20503
- [GEN_AI_TOOL_CALL_RESULT]: ["flue.tool.call.result", "ai.toolCall.result"]
20504
- };
20505
- var OPENINFERENCE_CONTENT_PREFIXES = [
20506
- "llm.input_messages.",
20507
- "llm.output_messages.",
20508
- "llm.prompts",
20509
- "llm.prompt_template.",
20510
- "llm.choices",
20511
- "llm.function_call",
20512
- "retrieval.documents.",
20513
- "embedding.embeddings.",
20514
- "input.value",
20515
- "output.value"
20516
- ];
20517
- var AI_SDK_CONTENT_PREFIXES = ["ai.response.toolCalls"];
20518
- var MASTRA_CONTENT_PREFIXES = ["mastra.metadata.body"];
20519
- var CLOUDFLARE_AGENTS_CONTENT_PREFIXES = [
20520
- "cloudflare.agents.metadata.",
20521
- "cloudflare.agents.runtime_context."
20522
- ];
20523
- var GEN_AI_CONTENT_ATTRIBUTE_PREFIXES = [
20524
- ...OPENINFERENCE_CONTENT_PREFIXES,
20525
- ...AI_SDK_CONTENT_PREFIXES,
20526
- ...MASTRA_CONTENT_PREFIXES,
20527
- ...CLOUDFLARE_AGENTS_CONTENT_PREFIXES
20528
- ];
20529
- var GEN_AI_CONTENT_ATTRIBUTE_NAMES = /* @__PURE__ */ new Set([
20530
- ...Object.values(GEN_AI_CONTENT_ATTRIBUTES),
20531
- ...Object.values(GEN_AI_CONTENT_ATTRIBUTE_ALIASES).flat()
20532
- ]);
20533
- var GEN_AI_RESPONSE_MODEL = GEN_AI_ATTRIBUTES.responseModel;
20534
-
20535
- // ../shared/dist/chunk-7LZATPNB.mjs
20536
- var AGENT_EXECUTION_STATUSES = [
20537
- "queued",
20538
- "running",
20539
- "paused",
20540
- "completed",
20541
- "failed",
20542
- "cancelled",
20543
- "interrupted"
20544
- ];
20545
- var agentExecutionStatusSchema = external_exports.enum(AGENT_EXECUTION_STATUSES);
20546
- var UNSUCCESSFUL_AGENT_EXECUTION_STATUSES = [
20547
- "failed",
20548
- "cancelled",
20549
- "interrupted",
20550
- "timeout",
20551
- "error"
20552
- ];
20553
- var UNSUCCESSFUL_STATUS_SET = new Set(
20554
- UNSUCCESSFUL_AGENT_EXECUTION_STATUSES
20555
- );
20556
-
20557
- // ../shared/dist/chunk-CTJEYKNH.mjs
20455
+ // ../shared/dist/chunk-XRR5DUKF.mjs
20558
20456
  var BUILTIN_TOOLS_LEAN = [
20559
20457
  { "id": "gpt-image-2-5", "name": "GPT Image 2.5", "category": "image_generation", "providers": ["multi"], "defaultConfig": { "size": "1024x1024", "quality": "low", "outputFormat": "png", "background": "auto" }, "requiresApiKey": true, "executionHint": "platform", "platformKeySupport": true },
20560
20458
  { "id": "gpt-image-2", "name": "GPT Image 2", "category": "image_generation", "providers": ["multi"], "defaultConfig": { "size": "1024x1024", "quality": "low", "outputFormat": "png", "background": "auto" }, "requiresApiKey": true, "executionHint": "platform", "platformKeySupport": true, "hidden": true, "deprecated": true },
@@ -20590,6 +20488,7 @@ var BUILTIN_TOOLS_LEAN = [
20590
20488
  { "id": "browser:get_handoff_state", "name": "Browser Handoff State", "category": "browser", "toolGroup": "browser_use", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "aliases": ["browser-get-handoff-state", "browser:handoff-state"] },
20591
20489
  { "id": "browser:agent", "name": "Run Browser Agent", "category": "browser", "toolGroup": "browser_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "experimental": true, "aliases": ["browser-agent", "browser:task", "browser-task"] },
20592
20490
  { "id": "vector-search", "name": "Semantic Search", "category": "knowledge_retrieval", "providers": ["multi"], "defaultConfig": { "limit": 5, "threshold": 0.3 }, "requiresApiKey": true, "executionHint": "platform", "hasConfigSchema": true },
20491
+ { "id": "typesafe_judge", "name": "TypeSafe judgment", "category": "data_analysis", "providers": ["multi"], "requiresApiKey": true, "executionHint": "platform", "platformKeySupport": true, "hasConfigSchema": true },
20593
20492
  { "id": "search_runtype_docs", "name": "Search Runtype Docs", "category": "knowledge_retrieval", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": false, "experimental": true },
20594
20493
  { "id": "elevenlabs-tts", "name": "ElevenLabs Text-to-Speech", "category": "text_to_speech", "toolGroup": "voice", "providers": ["multi"], "defaultConfig": { "voice_id": "rachel", "model_id": "eleven_multilingual_v2", "stability": 0.5, "similarity_boost": 0.75 }, "requiresApiKey": true, "executionHint": "platform", "platformKeySupport": true, "marginPercent": 20, "hidden": true },
20595
20494
  { "id": "elevenlabs-stt", "name": "ElevenLabs Speech-to-Text", "category": "text_to_speech", "toolGroup": "voice", "providers": ["multi"], "defaultConfig": { "format": "wav", "model_id": "scribe_v2" }, "requiresApiKey": true, "executionHint": "platform", "platformKeySupport": true, "marginPercent": 20, "hidden": true },
@@ -20645,6 +20544,12 @@ var BUILTIN_TOOLS_LEAN = [
20645
20544
  { "id": "write_file", "name": "Write File", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20646
20545
  { "id": "edit_file", "name": "Edit File", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20647
20546
  { "id": "expose_port", "name": "Expose Port", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20547
+ { "id": "agent_session_start", "name": "Start Agent Session", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20548
+ { "id": "agent_session_prompt", "name": "Prompt Agent Session", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20549
+ { "id": "agent_session_status", "name": "Agent Session Status", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20550
+ { "id": "agent_session_events", "name": "Agent Session Events", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20551
+ { "id": "agent_session_cancel", "name": "Cancel Agent Session", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20552
+ { "id": "list_agent_sessions", "name": "List Agent Sessions", "category": "sandbox", "toolGroup": "sandbox_agent", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true, "hidden": true },
20648
20553
  { "id": "send_email", "name": "Send Email", "category": "messaging", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": true },
20649
20554
  { "id": "save_memory", "name": "Save to Memory", "category": "data_management", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": false },
20650
20555
  { "id": "recall_memory", "name": "Recall from Memory", "category": "data_management", "providers": ["multi"], "requiresApiKey": false, "executionHint": "platform", "platformKeySupport": false },
@@ -20819,7 +20724,7 @@ var BuiltInToolGroup = {
20819
20724
  TEMPORAL: "temporal"
20820
20725
  };
20821
20726
 
20822
- // ../shared/dist/chunk-EAURMPCP.mjs
20727
+ // ../shared/dist/chunk-TA7HT5YA.mjs
20823
20728
  var BUILTIN_TOOLS_REGISTRY = BUILTIN_TOOLS_LEAN;
20824
20729
  function formatSystemToolId(tool) {
20825
20730
  const prefix = tool.idPrefix ?? BuiltInToolIdPrefix.BUILTIN;
@@ -20852,8 +20757,14 @@ function isToolCompatibleWithModel(toolId, modelId, provider) {
20852
20757
  return compatibility.models.some((m2) => modelId.includes(m2));
20853
20758
  }
20854
20759
 
20855
- // ../shared/dist/chunk-BEHMNO5J.mjs
20760
+ // ../shared/dist/chunk-FBMBZPAG.mjs
20856
20761
  var MODEL_FAMILY_PROVIDER_IDS = {
20762
+ "arrow-2": {
20763
+ "vercel": "quiverai/arrow-2"
20764
+ },
20765
+ "arrow-2-telos": {
20766
+ "vercel": "quiverai/arrow-2-telos"
20767
+ },
20857
20768
  "claude-fable-5": {
20858
20769
  "anthropic": "claude-fable-5",
20859
20770
  "vercel": "anthropic/claude-fable-5"
@@ -20919,9 +20830,22 @@ var MODEL_FAMILY_PROVIDER_IDS = {
20919
20830
  "anthropic": "claude-opus-5",
20920
20831
  "vercel": "anthropic/claude-opus-5"
20921
20832
  },
20833
+ "claude-opus-5-5": {
20834
+ "anthropic": "claude-opus-5-5",
20835
+ "vercel": "anthropic/claude-opus-5.5"
20836
+ },
20837
+ "claude-opus-5-5-fast": {
20838
+ "vercel": "anthropic/claude-opus-5.5-fast"
20839
+ },
20922
20840
  "claude-opus-5-fast": {
20923
20841
  "vercel": "anthropic/claude-opus-5-fast"
20924
20842
  },
20843
+ "claude-opus-5.5": {
20844
+ "vercel": "anthropic/claude-opus-5.5"
20845
+ },
20846
+ "claude-opus-5.5-fast": {
20847
+ "vercel": "anthropic/claude-opus-5.5-fast"
20848
+ },
20925
20849
  "claude-sonnet-4": {
20926
20850
  "vercel": "anthropic/claude-sonnet-4"
20927
20851
  },
@@ -20961,9 +20885,6 @@ var MODEL_FAMILY_PROVIDER_IDS = {
20961
20885
  "deepseek-v4-1-flash": {
20962
20886
  "vercel": "deepseek/deepseek-v4.1-flash"
20963
20887
  },
20964
- "deepseek-v4-1-flash-beta": {
20965
- "vercel": "deepseek/deepseek-v4.1-flash-beta"
20966
- },
20967
20888
  "deepseek-v4-flash": {
20968
20889
  "vercel": "deepseek/deepseek-v4-flash"
20969
20890
  },
@@ -20982,17 +20903,14 @@ var MODEL_FAMILY_PROVIDER_IDS = {
20982
20903
  "deepseek-v4.1-flash": {
20983
20904
  "vercel": "deepseek/deepseek-v4.1-flash"
20984
20905
  },
20985
- "deepseek-v4.1-flash-beta": {
20986
- "vercel": "deepseek/deepseek-v4.1-flash-beta"
20987
- },
20988
- "devstral-2": {
20989
- "vercel": "mistral/devstral-2"
20990
- },
20991
- "devstral-small-2": {
20992
- "vercel": "mistral/devstral-small-2"
20906
+ "fugu-max": {
20907
+ "vercel": "sakana/fugu-max"
20993
20908
  },
20994
20909
  "fugu-ultra": {
20995
- "vercel": "sakana/fugu-ultra"
20910
+ "vercel": "sakana/fugu-ultra-v2"
20911
+ },
20912
+ "fugu-ultra-v2": {
20913
+ "vercel": "sakana/fugu-ultra-v2"
20996
20914
  },
20997
20915
  "gemini-2-5-computer-use-preview-10-2025": {
20998
20916
  "google": "gemini-2.5-computer-use-preview-10-2025"
@@ -21074,6 +20992,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21074
20992
  "google": "gemini-3.8-flash",
21075
20993
  "vercel": "google/gemini-3.8-flash"
21076
20994
  },
20995
+ "gemini-3-8-live": {
20996
+ "vercel": "google/gemini-3.8-live"
20997
+ },
20998
+ "gemini-3-8-live-extended": {
20999
+ "vercel": "google/gemini-3.8-live-extended-thinking"
21000
+ },
21077
21001
  "gemini-3-flash": {
21078
21002
  "google": "gemini-3-flash-preview"
21079
21003
  },
@@ -21129,6 +21053,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21129
21053
  "google": "gemini-3.8-flash",
21130
21054
  "vercel": "google/gemini-3.8-flash"
21131
21055
  },
21056
+ "gemini-3.8-live": {
21057
+ "vercel": "google/gemini-3.8-live"
21058
+ },
21059
+ "gemini-3.8-live-extended-thinking": {
21060
+ "vercel": "google/gemini-3.8-live-extended-thinking"
21061
+ },
21132
21062
  "gemini-embedding-001": {
21133
21063
  "google": "gemini-embedding-001"
21134
21064
  },
@@ -21150,7 +21080,6 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21150
21080
  "vercel": "google/gemma-4-31b-it"
21151
21081
  },
21152
21082
  "glm-5-2": {
21153
- "mixlayer": "z-ai/glm-5.2",
21154
21083
  "vercel": "zai/glm-5.2"
21155
21084
  },
21156
21085
  "glm-5-2-fast": {
@@ -21166,8 +21095,10 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21166
21095
  "glm-5-3-flash": {
21167
21096
  "vercel": "zai/glm-5.3-flash"
21168
21097
  },
21098
+ "glm-5-3-flashx": {
21099
+ "vercel": "zai/glm-5.3-flashx"
21100
+ },
21169
21101
  "glm-5.2": {
21170
- "mixlayer": "z-ai/glm-5.2",
21171
21102
  "vercel": "zai/glm-5.2"
21172
21103
  },
21173
21104
  "glm-5.2-fast": {
@@ -21183,6 +21114,9 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21183
21114
  "glm-5.3-flash": {
21184
21115
  "vercel": "zai/glm-5.3-flash"
21185
21116
  },
21117
+ "glm-5.3-flashx": {
21118
+ "vercel": "zai/glm-5.3-flashx"
21119
+ },
21186
21120
  "gpt-4-1": {
21187
21121
  "openai": "gpt-4.1",
21188
21122
  "vercel": "openai/gpt-4.1"
@@ -21463,6 +21397,20 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21463
21397
  "gpt-6-astra-fast": {
21464
21398
  "vercel": "openai/gpt-6-astra-fast"
21465
21399
  },
21400
+ "gpt-6-luna": {
21401
+ "openai": "gpt-6-luna",
21402
+ "vercel": "openai/gpt-6-luna"
21403
+ },
21404
+ "gpt-6-luna-fast": {
21405
+ "vercel": "openai/gpt-6-luna-fast"
21406
+ },
21407
+ "gpt-6-sol": {
21408
+ "openai": "gpt-6-sol",
21409
+ "vercel": "openai/gpt-6-sol"
21410
+ },
21411
+ "gpt-6-sol-fast": {
21412
+ "vercel": "openai/gpt-6-sol-fast"
21413
+ },
21466
21414
  "gpt-image-1-5": {
21467
21415
  "openai": "gpt-image-1.5"
21468
21416
  },
@@ -21472,6 +21420,9 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21472
21420
  "gpt-image-1.5": {
21473
21421
  "openai": "gpt-image-1.5"
21474
21422
  },
21423
+ "gpt-live-1": {
21424
+ "vercel": "openai/gpt-live-1"
21425
+ },
21475
21426
  "gpt-oss-safeguard-120b": {
21476
21427
  "vercel": "openai/gpt-oss-safeguard-120b"
21477
21428
  },
@@ -21505,6 +21456,10 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21505
21456
  "vercel": "spacexai/grok-4.6",
21506
21457
  "xai": "grok-4.6"
21507
21458
  },
21459
+ "grok-4-7": {
21460
+ "vercel": "spacexai/grok-4.7",
21461
+ "xai": "grok-4.7"
21462
+ },
21508
21463
  "grok-4.20-0309-non-reasoning": {
21509
21464
  "xai": "grok-4.20-0309-non-reasoning"
21510
21465
  },
@@ -21535,6 +21490,10 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21535
21490
  "vercel": "spacexai/grok-4.6",
21536
21491
  "xai": "grok-4.6"
21537
21492
  },
21493
+ "grok-4.7": {
21494
+ "vercel": "spacexai/grok-4.7",
21495
+ "xai": "grok-4.7"
21496
+ },
21538
21497
  "grok-build-0-1": {
21539
21498
  "vercel": "spacexai/grok-build-0.1",
21540
21499
  "xai": "grok-build-0.1"
@@ -21582,27 +21541,6 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21582
21541
  "interfaze-beta": {
21583
21542
  "vercel": "interfaze/interfaze-beta"
21584
21543
  },
21585
- "kat-coder-air-v2-5": {
21586
- "vercel": "kwaipilot/kat-coder-air-v2.5"
21587
- },
21588
- "kat-coder-air-v2.5": {
21589
- "vercel": "kwaipilot/kat-coder-air-v2.5"
21590
- },
21591
- "kat-coder-pro": {
21592
- "vercel": "kwaipilot/kat-coder-pro-v2"
21593
- },
21594
- "kat-coder-pro-v1": {
21595
- "vercel": "kwaipilot/kat-coder-pro-v1"
21596
- },
21597
- "kat-coder-pro-v2": {
21598
- "vercel": "kwaipilot/kat-coder-pro-v2"
21599
- },
21600
- "kat-coder-pro-v2-5": {
21601
- "vercel": "kwaipilot/kat-coder-pro-v2.5"
21602
- },
21603
- "kat-coder-pro-v2.5": {
21604
- "vercel": "kwaipilot/kat-coder-pro-v2.5"
21605
- },
21606
21544
  "kimi-k2": {
21607
21545
  "vercel": "moonshotai/kimi-k2-thinking"
21608
21546
  },
@@ -21610,7 +21548,7 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21610
21548
  "vercel": "moonshotai/kimi-k2.6"
21611
21549
  },
21612
21550
  "kimi-k2-7-code": {
21613
- "mixlayer": "moonshotai/kimi-k2.7-code"
21551
+ "vercel": "moonshotai/kimi-k2.7-code"
21614
21552
  },
21615
21553
  "kimi-k2-7-code-highspeed": {
21616
21554
  "vercel": "moonshotai/kimi-k2.7-code-highspeed"
@@ -21622,7 +21560,7 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21622
21560
  "vercel": "moonshotai/kimi-k2.6"
21623
21561
  },
21624
21562
  "kimi-k2.7-code": {
21625
- "mixlayer": "moonshotai/kimi-k2.7-code"
21563
+ "vercel": "moonshotai/kimi-k2.7-code"
21626
21564
  },
21627
21565
  "kimi-k2.7-code-highspeed": {
21628
21566
  "vercel": "moonshotai/kimi-k2.7-code-highspeed"
@@ -21654,6 +21592,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21654
21592
  "ling-3-0-flash-sante-free": {
21655
21593
  "vercel": "inclusionai/ling-3.0-flash-sante-free"
21656
21594
  },
21595
+ "ling-3-0-flash-vl": {
21596
+ "vercel": "inclusionai/ling-3.0-flash-vl"
21597
+ },
21598
+ "ling-3-0-flash-vl-free": {
21599
+ "vercel": "inclusionai/ling-3.0-flash-vl-free"
21600
+ },
21657
21601
  "ling-3.0-flash": {
21658
21602
  "vercel": "inclusionai/ling-3.0-flash"
21659
21603
  },
@@ -21663,6 +21607,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21663
21607
  "ling-3.0-flash-sante-free": {
21664
21608
  "vercel": "inclusionai/ling-3.0-flash-sante-free"
21665
21609
  },
21610
+ "ling-3.0-flash-vl": {
21611
+ "vercel": "inclusionai/ling-3.0-flash-vl"
21612
+ },
21613
+ "ling-3.0-flash-vl-free": {
21614
+ "vercel": "inclusionai/ling-3.0-flash-vl-free"
21615
+ },
21666
21616
  "llama-3.1-70b": {
21667
21617
  "vercel": "meta/llama-3.1-70b"
21668
21618
  },
@@ -21711,12 +21661,30 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21711
21661
  "mimo-v2-5-pro": {
21712
21662
  "vercel": "xiaomi/mimo-v2.5-pro"
21713
21663
  },
21664
+ "mimo-v2-6-flash": {
21665
+ "vercel": "xiaomi/mimo-v2.6-flash"
21666
+ },
21667
+ "mimo-v2-6-pro": {
21668
+ "vercel": "xiaomi/mimo-v2.6-pro"
21669
+ },
21670
+ "mimo-v2-6-pro-ultraspeed": {
21671
+ "vercel": "xiaomi/mimo-v2.6-pro-ultraspeed"
21672
+ },
21714
21673
  "mimo-v2.5": {
21715
21674
  "vercel": "xiaomi/mimo-v2.5"
21716
21675
  },
21717
21676
  "mimo-v2.5-pro": {
21718
21677
  "vercel": "xiaomi/mimo-v2.5-pro"
21719
21678
  },
21679
+ "mimo-v2.6-flash": {
21680
+ "vercel": "xiaomi/mimo-v2.6-flash"
21681
+ },
21682
+ "mimo-v2.6-pro": {
21683
+ "vercel": "xiaomi/mimo-v2.6-pro"
21684
+ },
21685
+ "mimo-v2.6-pro-ultraspeed": {
21686
+ "vercel": "xiaomi/mimo-v2.6-pro-ultraspeed"
21687
+ },
21720
21688
  "minimax-m2-7": {
21721
21689
  "vercel": "minimax/minimax-m2.7"
21722
21690
  },
@@ -21831,9 +21799,6 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21831
21799
  "nova-pro": {
21832
21800
  "vercel": "amazon/nova-pro"
21833
21801
  },
21834
- "pixtral-12b": {
21835
- "vercel": "mistral/pixtral-12b"
21836
- },
21837
21802
  "qwen-3-14b": {
21838
21803
  "vercel": "alibaba/qwen-3-14b"
21839
21804
  },
@@ -21910,15 +21875,15 @@ var MODEL_FAMILY_PROVIDER_IDS = {
21910
21875
  "qwen3-8-flash": {
21911
21876
  "vercel": "alibaba/qwen3.8-flash"
21912
21877
  },
21913
- "qwen3-8-flash-next": {
21914
- "vercel": "alibaba/qwen3.8-flash-next"
21915
- },
21916
21878
  "qwen3-8-max": {
21917
21879
  "vercel": "alibaba/qwen3.8-max"
21918
21880
  },
21919
21881
  "qwen3-8-max-0902": {
21920
21882
  "vercel": "alibaba/qwen3.8-max-0902"
21921
21883
  },
21884
+ "qwen3-8-omni-flash": {
21885
+ "vercel": "alibaba/qwen3.8-omni-flash"
21886
+ },
21922
21887
  "qwen3-coder": {
21923
21888
  "vercel": "alibaba/qwen3-coder"
21924
21889
  },
@@ -22010,15 +21975,15 @@ var MODEL_FAMILY_PROVIDER_IDS = {
22010
21975
  "qwen3.8-flash": {
22011
21976
  "vercel": "alibaba/qwen3.8-flash"
22012
21977
  },
22013
- "qwen3.8-flash-next": {
22014
- "vercel": "alibaba/qwen3.8-flash-next"
22015
- },
22016
21978
  "qwen3.8-max": {
22017
21979
  "vercel": "alibaba/qwen3.8-max"
22018
21980
  },
22019
21981
  "qwen3.8-max-0902": {
22020
21982
  "vercel": "alibaba/qwen3.8-max-0902"
22021
21983
  },
21984
+ "qwen3.8-omni-flash": {
21985
+ "vercel": "alibaba/qwen3.8-omni-flash"
21986
+ },
22022
21987
  "rerank-v3-5": {
22023
21988
  "vercel": "cohere/rerank-v3.5"
22024
21989
  },
@@ -22031,6 +21996,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
22031
21996
  "rerank-v4-pro": {
22032
21997
  "vercel": "cohere/rerank-v4-pro"
22033
21998
  },
21999
+ "schematron-v2-small": {
22000
+ "vercel": "inference-net/schematron-v2-small"
22001
+ },
22002
+ "schematron-v2-turbo": {
22003
+ "vercel": "inference-net/schematron-v2-turbo"
22004
+ },
22034
22005
  "seed-1-6": {
22035
22006
  "vercel": "bytedance/seed-1.6"
22036
22007
  },
@@ -22043,6 +22014,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
22043
22014
  "seed-1.8": {
22044
22015
  "vercel": "bytedance/seed-1.8"
22045
22016
  },
22017
+ "seed-2-1-turbo": {
22018
+ "vercel": "bytedance/seed-2.1-turbo"
22019
+ },
22020
+ "seed-2.1-turbo": {
22021
+ "vercel": "bytedance/seed-2.1-turbo"
22022
+ },
22046
22023
  "sonar": {
22047
22024
  "vercel": "perplexity/sonar"
22048
22025
  },
@@ -22064,6 +22041,12 @@ var MODEL_FAMILY_PROVIDER_IDS = {
22064
22041
  "step-3.7-flash": {
22065
22042
  "vercel": "stepfun/step-3.7-flash"
22066
22043
  },
22044
+ "step-5": {
22045
+ "vercel": "stepfun/step-5-preview"
22046
+ },
22047
+ "step-5-preview": {
22048
+ "vercel": "stepfun/step-5-preview"
22049
+ },
22067
22050
  "text-embedding-3-large": {
22068
22051
  "openai": "text-embedding-3-large"
22069
22052
  },
@@ -22073,6 +22056,9 @@ var MODEL_FAMILY_PROVIDER_IDS = {
22073
22056
  "text-embedding-ada-002": {
22074
22057
  "openai": "text-embedding-ada-002"
22075
22058
  },
22059
+ "toast-1": {
22060
+ "vercel": "mixedbread/toast-1"
22061
+ },
22076
22062
  "trinity-large": {
22077
22063
  "vercel": "arcee-ai/trinity-large-thinking"
22078
22064
  },
@@ -22294,10 +22280,10 @@ var PROVIDER_ROUTING_CONFIG = {
22294
22280
  ],
22295
22281
  fallback: ["vercel"]
22296
22282
  },
22297
- // WHY(docs/why/packages/shared/src.md#kimi-k2-7-code-routes-via-mixlayer-since-vercel): Kimi K2.7 Code routes via Mixlayer since Vercel renamed its listing and Workers AI dropped from models.dev in
22283
+ // WHY(docs/why/packages/shared/src.md#kimi-k2-7-code-routes-via-vercel-after-catalog-refresh): Vercel lists Kimi K2.7 Code; Workers AI is the fallback.
22298
22284
  "kimi-k2.7-code": {
22299
22285
  providers: [
22300
- { provider: "mixlayer", weight: 100 }
22286
+ { provider: "vercel", weight: 100 }
22301
22287
  ],
22302
22288
  fallback: ["workers-ai"]
22303
22289
  },
@@ -22320,24 +22306,24 @@ var PROVIDER_ROUTING_CONFIG = {
22320
22306
  ],
22321
22307
  fallback: ["workers-ai"]
22322
22308
  },
22323
- // WHY(docs/why/packages/shared/src.md#glm-5-2-chains-workers-ai-then-mixlayer-then-ver): GLM-5.2 chains Workers AI, then Mixlayer, then Vercel so a rate-limit/capacity failure fast-fails to the next
22309
+ // WHY(docs/why/packages/shared/src.md#glm-5-2-chains-workers-ai-then-vercel): Mixlayer no longer lists GLM-5.2.
22324
22310
  "glm-5.2": {
22325
22311
  providers: [
22326
22312
  { provider: "workers-ai", weight: 100 }
22327
22313
  ],
22328
- fallback: ["mixlayer", "vercel"]
22314
+ fallback: ["vercel"]
22329
22315
  },
22330
22316
  "glm-5-2": {
22331
22317
  providers: [
22332
22318
  { provider: "workers-ai", weight: 100 }
22333
22319
  ],
22334
- fallback: ["mixlayer", "vercel"]
22320
+ fallback: ["vercel"]
22335
22321
  },
22336
22322
  "zai/glm-5.2": {
22337
22323
  providers: [
22338
22324
  { provider: "workers-ai", weight: 100 }
22339
22325
  ],
22340
- fallback: ["mixlayer", "vercel"]
22326
+ fallback: ["vercel"]
22341
22327
  },
22342
22328
  // WHY(docs/why/packages/shared/src.md#deepseek-v4-pros-slash-forms-are-direct-provider): DeepSeek V4 Pro's slash forms are DIRECT provider ids, so an explicit entry is needed to win over
22343
22329
  "deepseek-v4-pro": {
@@ -22414,20 +22400,17 @@ var MANUAL_PROVIDER_MAP_OVERRIDES = {
22414
22400
  "gpt-5-4-nano": {
22415
22401
  "cloudflare": "openai/gpt-5.4-nano"
22416
22402
  },
22417
- // WHY(docs/why/packages/shared/src.md#every-glm-5-2-id-form-shares-the-same-per-provid): Every GLM-5.2 id form shares the same per-provider ids, matching the ordered fallback chain in
22403
+ // WHY(docs/why/packages/shared/src.md#glm-5-2-chains-workers-ai-then-vercel): Both GLM-5.2 providers retain explicit IDs.
22418
22404
  "glm-5.2": {
22419
22405
  "workers-ai": "@cf/zai-org/glm-5.2",
22420
- "mixlayer": "z-ai/glm-5.2",
22421
22406
  "vercel": "zai/glm-5.2"
22422
22407
  },
22423
22408
  "glm-5-2": {
22424
22409
  "workers-ai": "@cf/zai-org/glm-5.2",
22425
- "mixlayer": "z-ai/glm-5.2",
22426
22410
  "vercel": "zai/glm-5.2"
22427
22411
  },
22428
22412
  "zai/glm-5.2": {
22429
22413
  "workers-ai": "@cf/zai-org/glm-5.2",
22430
- "mixlayer": "z-ai/glm-5.2",
22431
22414
  "vercel": "zai/glm-5.2"
22432
22415
  },
22433
22416
  // WHY(docs/why/packages/shared/src.md#deepseek-v4-pros-slash-forms-need-an-explicit-ve-2): DeepSeek V4 Pro's slash forms need an explicit vercel id or getDefaultProviderMapping would synthesize a
@@ -22648,7 +22631,7 @@ function isSupportedElicitationSchema(schema) {
22648
22631
  return parsed.success && typeof parsed.data !== "boolean" && parsed.data.type === "object";
22649
22632
  }
22650
22633
 
22651
- // ../shared/dist/chunk-BSGZYLLL.mjs
22634
+ // ../shared/dist/chunk-E4UB4YQO.mjs
22652
22635
  var primitiveSchema = external_exports.strictObject({
22653
22636
  type: external_exports.enum(["string", "number", "integer", "boolean"]),
22654
22637
  title: external_exports.string().optional(),
@@ -22917,6 +22900,9 @@ var ExecuteToolSchema = external_exports.object({
22917
22900
  // WHY(docs/why/packages/shared/src.md#toolid-is-optional-here-so-mcp-sdk-callers-sendi): toolId is optional here so MCP/SDK callers sending only {parameters} aren't rejected at validation
22918
22901
  toolId: external_exports.string().optional(),
22919
22902
  parameters: external_exports.record(external_exports.string(), external_exports.any()),
22903
+ toolConfig: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe(
22904
+ "Built-in tools only: the instance config an agent's toolConfigs entry would carry, validated against the tool's configSchema. Rejected for a saved tool."
22905
+ ),
22920
22906
  context: external_exports.object({
22921
22907
  flowExecutionId: external_exports.string().optional(),
22922
22908
  stepId: external_exports.string().optional(),
@@ -23005,13 +22991,18 @@ function isDataConnectionToolId(toolId) {
23005
22991
  return toolId.startsWith("dc:");
23006
22992
  }
23007
22993
 
23008
- // ../shared/dist/chunk-HQXZXXZZ.mjs
22994
+ // ../shared/dist/chunk-OEUGY3JM.mjs
23009
22995
  function sanitizeToolNameForAiSdk(name) {
23010
22996
  return name.replace(/[^a-zA-Z0-9_]/g, "_").toLowerCase().replace(/_+/g, "_").replace(/^_|_$/g, "");
23011
22997
  }
22998
+ function modelVisibleToolName(toolId) {
22999
+ return sanitizeToolNameForAiSdk(toolId.replace(/^(builtin|platform):/, ""));
23000
+ }
23012
23001
  function toolNamesCollideForAiSdk(left, right) {
23013
23002
  return sanitizeToolNameForAiSdk(left) === sanitizeToolNameForAiSdk(right);
23014
23003
  }
23004
+
23005
+ // ../shared/dist/chunk-DK4YWFCU.mjs
23015
23006
  var RUNTYPE_SET_STATE_TOOL_NAME = "runtype_set_state";
23016
23007
  function isReservedRuntypeToolName(name) {
23017
23008
  return toolNamesCollideForAiSdk(name, RUNTYPE_SET_STATE_TOOL_NAME);
@@ -23141,13 +23132,6 @@ function resolveModelOptionalSettings(model) {
23141
23132
  return [];
23142
23133
  }
23143
23134
 
23144
- // ../shared/dist/chunk-CABFF4K3.mjs
23145
- var MANAGED_DEPLOYMENT_SOURCE_LIMITS = {
23146
- maxCompressedBytes: 25 * 1024 * 1024,
23147
- maxExpandedBytes: 100 * 1024 * 1024,
23148
- maxRegularFiles: 1e3
23149
- };
23150
-
23151
23135
  // ../shared/dist/chunk-EOJ3KTQ2.mjs
23152
23136
  var textPartSchema = external_exports.object({ type: external_exports.literal("text"), text: external_exports.string() }).passthrough();
23153
23137
  var imagePartSchema = external_exports.object({ type: external_exports.literal("image"), image: external_exports.string(), mimeType: external_exports.string().optional() }).passthrough();
@@ -23304,7 +23288,123 @@ var resolvedEdgeAuthSnapshotSchema = edgeAuthSnapshotSchema.extend({
23304
23288
  var CONTAINER_SANDBOX_INSTANCE_TYPE = "standard-4";
23305
23289
  var MAX_SANDBOX_EXECUTE_CONTAINMENT_WINDOW_MS = 30 * 60 * 1e3;
23306
23290
 
23307
- // ../shared/dist/chunk-R7QGO7VU.mjs
23291
+ // ../shared/dist/chunk-2NMGSD35.mjs
23292
+ var GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
23293
+ var GEN_AI_AGENT_ID = "gen_ai.agent.id";
23294
+ var GEN_AI_AGENT_NAME = "gen_ai.agent.name";
23295
+ var GEN_AI_CONVERSATION_ID = "gen_ai.conversation.id";
23296
+ var GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
23297
+ var GEN_AI_RESPONSE_MODEL_NAME = "gen_ai.response.model";
23298
+ var GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens";
23299
+ var GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens";
23300
+ var GEN_AI_USAGE_CACHE_READ_TOKENS = "gen_ai.usage.cache_read.input_tokens";
23301
+ var GEN_AI_USAGE_CACHE_CREATION_TOKENS = "gen_ai.usage.cache_creation.input_tokens";
23302
+ var GEN_AI_TOOL_NAME = "gen_ai.tool.name";
23303
+ var GEN_AI_TOOL_TYPE = "gen_ai.tool.type";
23304
+ var GEN_AI_TOOL_CALL_ID = "gen_ai.tool.call.id";
23305
+ var GEN_AI_ATTRIBUTES = {
23306
+ operationName: GEN_AI_OPERATION_NAME,
23307
+ agentId: GEN_AI_AGENT_ID,
23308
+ agentName: GEN_AI_AGENT_NAME,
23309
+ conversationId: GEN_AI_CONVERSATION_ID,
23310
+ requestModel: GEN_AI_REQUEST_MODEL,
23311
+ usageInputTokens: GEN_AI_USAGE_INPUT_TOKENS,
23312
+ usageOutputTokens: GEN_AI_USAGE_OUTPUT_TOKENS,
23313
+ /** Input tokens served from the provider's prompt cache, when the provider reports them. */
23314
+ usageCacheReadTokens: GEN_AI_USAGE_CACHE_READ_TOKENS,
23315
+ /** Input tokens written INTO the provider's prompt cache, when the provider reports them. */
23316
+ usageCacheCreationTokens: GEN_AI_USAGE_CACHE_CREATION_TOKENS,
23317
+ /** The model the provider reported having SERVED; the more accurate one to price. */
23318
+ responseModel: GEN_AI_RESPONSE_MODEL_NAME,
23319
+ toolName: GEN_AI_TOOL_NAME,
23320
+ toolType: GEN_AI_TOOL_TYPE,
23321
+ toolCallId: GEN_AI_TOOL_CALL_ID
23322
+ };
23323
+
23324
+ // ../shared/dist/chunk-4Y2IGOAU.mjs
23325
+ var RUNTYPE_ITERATION = "runtype.iteration";
23326
+ var RUNTYPE_TOTAL_COST = "runtype.total_cost";
23327
+ var RUNTYPE_TURN_INDEX = "runtype.turn.index";
23328
+ var RUNTYPE_LEGACY_ATTRIBUTE_ALIASES = {
23329
+ [RUNTYPE_ITERATION]: ["runtype.agent.iteration"],
23330
+ [RUNTYPE_TOTAL_COST]: ["runtype.agent.totalCost"],
23331
+ [RUNTYPE_TURN_INDEX]: ["runtype.agent.turnIndex"]
23332
+ };
23333
+ var GEN_AI_TOOL_CALL_ARGUMENTS = "gen_ai.tool.call.arguments";
23334
+ var GEN_AI_TOOL_CALL_RESULT = "gen_ai.tool.call.result";
23335
+ var GEN_AI_INPUT_MESSAGES = "gen_ai.input.messages";
23336
+ var GEN_AI_OUTPUT_MESSAGES = "gen_ai.output.messages";
23337
+ var GEN_AI_CONTENT_ATTRIBUTES = {
23338
+ /** Chat history sent to the model, as semconv structured messages. */
23339
+ inputMessages: GEN_AI_INPUT_MESSAGES,
23340
+ /** Messages the model produced (includes reasoning content parts). */
23341
+ outputMessages: GEN_AI_OUTPUT_MESSAGES,
23342
+ /** System instructions, when separate from the input messages. */
23343
+ systemInstructions: "gen_ai.system_instructions",
23344
+ /** `execute_tool` span: the arguments the tool was called with. */
23345
+ toolCallArguments: GEN_AI_TOOL_CALL_ARGUMENTS,
23346
+ /** `execute_tool` span: the result the tool returned. */
23347
+ toolCallResult: GEN_AI_TOOL_CALL_RESULT
23348
+ };
23349
+ var GEN_AI_CONTENT_ATTRIBUTE_ALIASES = {
23350
+ [GEN_AI_INPUT_MESSAGES]: ["ai.prompt.messages", "ai.prompt"],
23351
+ [GEN_AI_OUTPUT_MESSAGES]: ["ai.response.text", "ai.response.object"],
23352
+ [GEN_AI_TOOL_CALL_ARGUMENTS]: ["flue.tool.call.arguments", "ai.toolCall.args"],
23353
+ [GEN_AI_TOOL_CALL_RESULT]: ["flue.tool.call.result", "ai.toolCall.result"]
23354
+ };
23355
+ var OPENINFERENCE_CONTENT_PREFIXES = [
23356
+ "llm.input_messages.",
23357
+ "llm.output_messages.",
23358
+ "llm.prompts",
23359
+ "llm.prompt_template.",
23360
+ "llm.choices",
23361
+ "llm.function_call",
23362
+ "retrieval.documents.",
23363
+ "embedding.embeddings.",
23364
+ "input.value",
23365
+ "output.value"
23366
+ ];
23367
+ var AI_SDK_CONTENT_PREFIXES = ["ai.response.toolCalls"];
23368
+ var MASTRA_CONTENT_PREFIXES = ["mastra.metadata.body"];
23369
+ var CLOUDFLARE_AGENTS_CONTENT_PREFIXES = [
23370
+ "cloudflare.agents.metadata.",
23371
+ "cloudflare.agents.runtime_context."
23372
+ ];
23373
+ var GEN_AI_CONTENT_ATTRIBUTE_PREFIXES = [
23374
+ ...OPENINFERENCE_CONTENT_PREFIXES,
23375
+ ...AI_SDK_CONTENT_PREFIXES,
23376
+ ...MASTRA_CONTENT_PREFIXES,
23377
+ ...CLOUDFLARE_AGENTS_CONTENT_PREFIXES
23378
+ ];
23379
+ var GEN_AI_CONTENT_ATTRIBUTE_NAMES = /* @__PURE__ */ new Set([
23380
+ ...Object.values(GEN_AI_CONTENT_ATTRIBUTES),
23381
+ ...Object.values(GEN_AI_CONTENT_ATTRIBUTE_ALIASES).flat()
23382
+ ]);
23383
+ var GEN_AI_RESPONSE_MODEL = GEN_AI_ATTRIBUTES.responseModel;
23384
+
23385
+ // ../shared/dist/chunk-5G3ILWR3.mjs
23386
+ var AGENT_EXECUTION_STATUSES = [
23387
+ "queued",
23388
+ "running",
23389
+ "paused",
23390
+ "completed",
23391
+ "failed",
23392
+ "cancelled",
23393
+ "interrupted"
23394
+ ];
23395
+ var agentExecutionStatusSchema = external_exports.enum(AGENT_EXECUTION_STATUSES);
23396
+ var UNSUCCESSFUL_AGENT_EXECUTION_STATUSES = [
23397
+ "failed",
23398
+ "cancelled",
23399
+ "interrupted",
23400
+ "timeout",
23401
+ "error"
23402
+ ];
23403
+ var UNSUCCESSFUL_STATUS_SET = new Set(
23404
+ UNSUCCESSFUL_AGENT_EXECUTION_STATUSES
23405
+ );
23406
+
23407
+ // ../shared/dist/chunk-HFRQSSJJ.mjs
23308
23408
  var MANAGED_INGRESS_LIMITS = Object.freeze({
23309
23409
  requestBodyBytes: 10 * 1024 * 1024,
23310
23410
  responseBodyBytes: 25 * 1024 * 1024,
@@ -23359,6 +23459,119 @@ var MANAGED_INGRESS_RESERVED_PORTS = Object.freeze([
23359
23459
  9300
23360
23460
  ]);
23361
23461
 
23462
+ // ../shared/dist/chunk-FDEVW22I.mjs
23463
+ var MANAGED_SANDBOX_STAGES = [
23464
+ "apply-policies",
23465
+ "destroy-sandbox",
23466
+ "ensure-sandbox",
23467
+ "inspect-process",
23468
+ "inspect-sandbox",
23469
+ "install-dependencies",
23470
+ "resolve-ingress",
23471
+ "start-process",
23472
+ "stop-process",
23473
+ "stop-sandbox",
23474
+ "verify-runtime",
23475
+ "wake-sandbox",
23476
+ "write-bundle"
23477
+ ];
23478
+ var STAGE_VOCABULARY = new Set(MANAGED_SANDBOX_STAGES);
23479
+ var MANAGED_DEPLOYMENT_STAGE_PLAN = Object.freeze({
23480
+ create: Object.freeze([
23481
+ "ensure-sandbox",
23482
+ "apply-policies",
23483
+ "verify-runtime",
23484
+ "write-bundle",
23485
+ "install-dependencies",
23486
+ "start-process",
23487
+ "resolve-ingress"
23488
+ ]),
23489
+ update: Object.freeze([
23490
+ "ensure-sandbox",
23491
+ "apply-policies",
23492
+ "verify-runtime",
23493
+ "write-bundle",
23494
+ "install-dependencies",
23495
+ "start-process",
23496
+ "resolve-ingress"
23497
+ ]),
23498
+ resume: Object.freeze(["wake-sandbox", "start-process", "resolve-ingress"]),
23499
+ suspend: Object.freeze(["stop-process", "stop-sandbox"]),
23500
+ // INVARIANT: Containment for an idle stop is the CONFIRMED whole-sandbox stop, never a process-only claim.
23501
+ sleep: Object.freeze(["stop-sandbox"]),
23502
+ destroy: Object.freeze(["stop-process", "destroy-sandbox"]),
23503
+ expire: Object.freeze(["stop-process", "destroy-sandbox"]),
23504
+ // INVARIANT: Reconcile before destroying, and never create, wake or launch to clean a retained generation up.
23505
+ cleanup: Object.freeze(["inspect-sandbox", "destroy-sandbox"]),
23506
+ recover: Object.freeze([]),
23507
+ renew: Object.freeze([])
23508
+ });
23509
+ var MANAGED_STAGE_REQUIRED_CAPABILITY = Object.freeze({
23510
+ "apply-policies": "network-policy",
23511
+ "destroy-sandbox": "terminate:sandbox-destroy",
23512
+ "install-dependencies": "rebuild",
23513
+ "resolve-ingress": "private-ingress",
23514
+ "start-process": "process-adoption",
23515
+ "stop-process": "terminate:process-tree",
23516
+ "stop-sandbox": "terminate:sandbox-stop",
23517
+ "verify-runtime": "rebuild",
23518
+ "wake-sandbox": "wake",
23519
+ "write-bundle": "rebuild"
23520
+ });
23521
+ var MANAGED_HEALTH_PROBE_LIMITS = Object.freeze({
23522
+ /** One dedicated probe, connect through response headers, may take this long. */
23523
+ timeoutMs: 2e3,
23524
+ /** An HTTP probe reads at most this much body before cancelling the rest. */
23525
+ responseBodyBytes: 4 * 1024,
23526
+ /**
23527
+ * Below this much remaining budget the check is not run at all: the control
23528
+ * plane spent the probe's time, and a check that could only time out would
23529
+ * be counted as the application's failure.
23530
+ */
23531
+ minimumBudgetMs: 500
23532
+ });
23533
+ var MANAGED_SANDBOX_LABEL_KEYS = Object.freeze({
23534
+ managed: "runtype.managed",
23535
+ organization: "runtype.organization",
23536
+ deployment: "runtype.deployment",
23537
+ generation: "runtype.generation"
23538
+ });
23539
+
23540
+ // ../shared/dist/chunk-CTYT2JKN.mjs
23541
+ var MANAGED_HEALTH_LIMITS = Object.freeze({
23542
+ /** Probes are due this often while compute is expected to be awake. */
23543
+ probeIntervalMs: 3e4,
23544
+ /** Distinct consecutive failed dedicated probes before recovery is requested. */
23545
+ failuresBeforeRecovery: 3,
23546
+ /**
23547
+ * How long one in-flight probe holds its coordinator admission. The probe
23548
+ * itself ends at `MANAGED_HEALTH_PROBE_LIMITS.timeoutMs`; the margin covers
23549
+ * the RPC hop, and a completion nobody delivered is settled at this expiry.
23550
+ */
23551
+ probeAdmissionMs: MANAGED_HEALTH_PROBE_LIMITS.timeoutMs + 3e3,
23552
+ /**
23553
+ * Evidence older than this cannot authorize recovery: the runtime it
23554
+ * describes may have been replaced or repaired since. Equal to the operation
23555
+ * deadline, so a recovery accepted on fresh evidence still reads it when the
23556
+ * coordinator advances it late.
23557
+ */
23558
+ evidenceFreshnessMs: 10 * 6e4,
23559
+ /** After a refused recovery request the supervisor waits this long before it may ask again. */
23560
+ recoveryRefusedHoldMs: 5 * 6e4
23561
+ });
23562
+ var managedHealthEvidenceSchema = external_exports.object({
23563
+ kind: external_exports.enum(["probe_failures", "process_exited"]),
23564
+ consecutiveFailures: external_exports.number().int().nonnegative(),
23565
+ providerGeneration: external_exports.number().int().nonnegative(),
23566
+ runtimeEpoch: external_exports.number().int().nonnegative(),
23567
+ launchId: external_exports.string().min(1).nullable(),
23568
+ /** The key of the health configuration the probes ran under. */
23569
+ checkKey: external_exports.string().min(1),
23570
+ /** Epoch ms of the observation that completed the evidence. */
23571
+ observedAtMs: external_exports.number().int().nonnegative(),
23572
+ detail: external_exports.string().max(2e3)
23573
+ }).strict();
23574
+
23362
23575
  // ../shared/dist/chunk-KNCWLVL2.mjs
23363
23576
  var MANAGED_SANDBOX_CAPABILITIES = [
23364
23577
  "inspect-without-start",
@@ -23385,68 +23598,12 @@ var MANAGED_PROFILE_IDENTITY_FIELDS = Object.freeze([
23385
23598
  "environment"
23386
23599
  ]);
23387
23600
 
23388
- // ../shared/dist/chunk-NBGTI2DK.mjs
23389
- var apiReleaseChannelSchema = external_exports.enum(["staging", "production"]);
23390
- var API_ARTIFACT_SCRIPT_PATTERN = /^api-[a-z0-9][a-z0-9-]{0,62}$/;
23391
- var apiArtifactScriptNameSchema = external_exports.string().regex(
23392
- API_ARTIFACT_SCRIPT_PATTERN,
23393
- "API artifact script names look like api-<sha12> or api-<sha12>-<suffix> (lowercase alphanumeric and dashes)"
23394
- );
23395
- var RUNTIME_ARTIFACT_SCRIPT_PATTERN = /^rt-[a-z0-9][a-z0-9-]{0,80}$/;
23396
- var runtimeArtifactScriptNameSchema = external_exports.string().regex(
23397
- RUNTIME_ARTIFACT_SCRIPT_PATTERN,
23398
- "Runtime artifact script names look like rt-<namespace>-<flow|agent>-<hash> (lowercase alphanumeric and dashes)"
23399
- );
23400
- var apiHeaderOverrideModeSchema = external_exports.enum(["open", "token"]);
23401
- var apiArtifactStatusSchema = external_exports.enum([
23402
- "uploaded",
23403
- "active",
23404
- "superseded",
23405
- "pinned",
23406
- "failed",
23407
- "deleted"
23408
- ]);
23409
- var apiCanaryConfigSchema = external_exports.object({
23410
- script: apiArtifactScriptNameSchema,
23411
- percent: external_exports.number().int().min(1).max(100)
23412
- });
23413
- var apiRoutingDocSchema = external_exports.object({
23414
- version: external_exports.number().int().nonnegative(),
23415
- updatedAt: external_exports.string().min(1),
23416
- api: external_exports.object({
23417
- activeScript: apiArtifactScriptNameSchema.nullable(),
23418
- previousScript: apiArtifactScriptNameSchema.nullable(),
23419
- canary: apiCanaryConfigSchema.nullable(),
23420
- pinsEnabled: external_exports.boolean(),
23421
- legacyFallback: external_exports.boolean(),
23422
- headerOverride: apiHeaderOverrideModeSchema,
23423
- // WHY(docs/why/packages/shared/src.md#otlp-fast-lane-when-true-the-dispatch-worker-ter): OTLP fast lane: when true, the dispatch worker terminates `/v1/otel/*` at the standalone
23424
- /** OTLP fast lane: when true, the dispatch worker terminates `/v1/otel/*` at the standalone `runtype-otel-ingest` worker instead of resolving an API artifact (apps/api-dispatch/src/otel-lane.ts; docs/features/planning/2026-08-12-otel-ingest-worker.md, increment 3). */
23425
- otelIngest: external_exports.boolean().optional()
23426
- })
23427
- }).refine((doc) => doc.api.activeScript !== null || doc.api.legacyFallback, {
23428
- message: "activeScript may only be null while legacyFallback is true",
23429
- path: ["api", "activeScript"]
23430
- });
23431
- var edgeContextPayloadSchema = external_exports.object({
23432
- /** Resolved Runtype user id (`user_…`). */
23433
- userId: external_exports.string().min(1),
23434
- /** Resolved org id (`org_…`); null for a personal (no-org) credential. */
23435
- orgId: external_exports.string().min(1).nullable(),
23436
- /** Effective permission scopes for the credential (e.g. `["*"]`). */
23437
- scopes: external_exports.array(external_exports.string()),
23438
- /** Token id (one per mint) — replay/audit handle, never reused as a secret. */
23439
- jti: external_exports.string().min(1),
23440
- /** Expiry as epoch MILLISECONDS; the token is rejected once `exp <= now`. */
23441
- exp: external_exports.number().int().positive()
23442
- });
23443
-
23444
- // ../shared/dist/chunk-ZGF3GAF7.mjs
23445
- var DEFAULT_FLOW_TIMEOUT_MS = 15 * 60 * 1e3;
23446
- var ASYNC_REPLAY_AGENT_LANE_BUDGET_MS = 10 * 60 * 1e3;
23447
- var DEFAULT_AGENT_WALL_CLOCK_TIMEOUT_MS = 5 * 60 * 1e3;
23448
- var ATTACHED_DISPATCH_STEP_TIMEOUT_MAX_MS = 10 * 60 * 1e3;
23449
- var ASYNC_DISPATCH_TIMEOUT_MAX_MS = 30 * 60 * 1e3;
23601
+ // ../shared/dist/chunk-CABFF4K3.mjs
23602
+ var MANAGED_DEPLOYMENT_SOURCE_LIMITS = {
23603
+ maxCompressedBytes: 25 * 1024 * 1024,
23604
+ maxExpandedBytes: 100 * 1024 * 1024,
23605
+ maxRegularFiles: 1e3
23606
+ };
23450
23607
 
23451
23608
  // ../shared/dist/chunk-RT5M2CMG.mjs
23452
23609
  var EMBEDDING_COST_PER_1K_TOKENS = Object.freeze({
@@ -23572,7 +23729,288 @@ var WEAVIATE_VECTORIZER_MODELS = Object.freeze({
23572
23729
  })
23573
23730
  });
23574
23731
 
23575
- // ../shared/dist/chunk-2F2C3Q7I.mjs
23732
+ // ../shared/dist/chunk-FFGBEV63.mjs
23733
+ var JUDGMENT_CHOICE_MAX_OPTIONS = 255;
23734
+ var JUDGMENT_SCORE_MIN_LEVELS = 2;
23735
+ var JUDGMENT_SCORE_MAX_LEVELS = 10;
23736
+
23737
+ // ../shared/dist/chunk-CEATEZAQ.mjs
23738
+ var judgmentJsonValueSchema = external_exports.lazy(
23739
+ () => external_exports.union([
23740
+ external_exports.null(),
23741
+ external_exports.string(),
23742
+ external_exports.number(),
23743
+ external_exports.boolean(),
23744
+ external_exports.record(external_exports.string(), judgmentJsonValueSchema.optional()),
23745
+ external_exports.array(judgmentJsonValueSchema).readonly()
23746
+ ])
23747
+ );
23748
+ var judgmentInputSchema = external_exports.union([
23749
+ external_exports.string(),
23750
+ external_exports.record(external_exports.string(), judgmentJsonValueSchema.optional()),
23751
+ external_exports.array(judgmentJsonValueSchema).readonly()
23752
+ ]);
23753
+ var judgmentDescriptionSchema = judgmentInputSchema.nullable();
23754
+ var judgmentBooleanQuestionSchema = external_exports.strictObject({
23755
+ type: external_exports.literal("boolean"),
23756
+ instructions: judgmentInputSchema,
23757
+ criteria: external_exports.strictObject({
23758
+ true: judgmentDescriptionSchema.optional(),
23759
+ false: judgmentDescriptionSchema.optional()
23760
+ }).optional()
23761
+ });
23762
+ var judgmentChoiceQuestionSchema = external_exports.strictObject({
23763
+ type: external_exports.literal("choice"),
23764
+ instructions: judgmentInputSchema,
23765
+ criteria: external_exports.record(external_exports.string(), judgmentDescriptionSchema)
23766
+ });
23767
+ var judgmentScoreQuestionSchema = external_exports.strictObject({
23768
+ type: external_exports.literal("score"),
23769
+ instructions: judgmentInputSchema,
23770
+ criteria: external_exports.array(judgmentDescriptionSchema).readonly()
23771
+ });
23772
+ var JUDGMENT_BOOLEAN_TYPE_ALIAS = "noul";
23773
+ function foldBooleanAlias(value) {
23774
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && value.type === JUDGMENT_BOOLEAN_TYPE_ALIAS) {
23775
+ return { ...value, type: "boolean" };
23776
+ }
23777
+ return value;
23778
+ }
23779
+ var judgmentQuestionSchema = external_exports.preprocess(
23780
+ foldBooleanAlias,
23781
+ external_exports.discriminatedUnion("type", [
23782
+ judgmentBooleanQuestionSchema,
23783
+ judgmentChoiceQuestionSchema,
23784
+ judgmentScoreQuestionSchema
23785
+ ])
23786
+ );
23787
+ var unitIntervalSchema = external_exports.number().min(0).max(1);
23788
+ var distributionSchema = external_exports.record(external_exports.string(), unitIntervalSchema);
23789
+ var judgmentBooleanAnswerSchema = external_exports.object({
23790
+ type: external_exports.literal("boolean"),
23791
+ probability: unitIntervalSchema
23792
+ });
23793
+ var judgmentChoiceAnswerSchema = external_exports.object({
23794
+ type: external_exports.literal("choice"),
23795
+ choice: external_exports.string(),
23796
+ probabilities: distributionSchema.optional()
23797
+ });
23798
+ var judgmentScoreAnswerSchema = external_exports.object({
23799
+ type: external_exports.literal("score"),
23800
+ score: external_exports.number().min(0),
23801
+ probabilities: distributionSchema.optional()
23802
+ });
23803
+ var judgmentAnswerSchema = external_exports.discriminatedUnion("type", [
23804
+ judgmentBooleanAnswerSchema,
23805
+ judgmentChoiceAnswerSchema,
23806
+ judgmentScoreAnswerSchema
23807
+ ]);
23808
+ var judgmentAnswersSchema = external_exports.record(external_exports.string(), judgmentAnswerSchema);
23809
+ var judgmentQuestionMessages = {
23810
+ noQuestions: () => "A judgment needs at least one question.",
23811
+ notObject: (id) => `Question "${id}" must be an object with a type and instructions.`,
23812
+ unknownType: (id, type) => `Question "${id}" has type ${JSON.stringify(type) ?? "undefined"}, but the type must be "boolean", "choice" or "score".`,
23813
+ instructionsMissing: (id) => `Question "${id}" needs instructions, because the question's name is never sent to the model.`,
23814
+ choiceCriteriaEmpty: (id) => `Choice question "${id}" needs criteria as a non-empty map of option labels to descriptions.`,
23815
+ choiceTooManyOptions: (id, count) => `Choice question "${id}" has ${count} options, but a choice question accepts at most ${JUDGMENT_CHOICE_MAX_OPTIONS}.`,
23816
+ scoreLevelCount: (id, count) => count === void 0 ? `Score question "${id}" needs criteria as an ordered list of ${JUDGMENT_SCORE_MIN_LEVELS} to ${JUDGMENT_SCORE_MAX_LEVELS} levels.` : `Score question "${id}" has ${count} ${count === 1 ? "level" : "levels"}, but a score question needs ${JUDGMENT_SCORE_MIN_LEVELS} to ${JUDGMENT_SCORE_MAX_LEVELS}.`,
23817
+ malformed: (id, path21, detail) => `Question "${id}" is malformed at ${path21.length > 0 ? path21.join(".") : "its root"}: ${detail.replace(/\.$/, "")}.`
23818
+ };
23819
+ function isPlainObject2(value) {
23820
+ return typeof value === "object" && value !== null && !Array.isArray(value);
23821
+ }
23822
+ function instructionsMissing(value) {
23823
+ if (value === void 0 || value === null) return true;
23824
+ return typeof value === "string" && value.trim().length === 0;
23825
+ }
23826
+ function collectRuleIssues(id, question) {
23827
+ if (!isPlainObject2(question)) {
23828
+ return [{ code: "JUDGMENT_QUESTION_NOT_OBJECT", path: [id], message: judgmentQuestionMessages.notObject(id) }];
23829
+ }
23830
+ const issues = [];
23831
+ const type = question.type === JUDGMENT_BOOLEAN_TYPE_ALIAS ? "boolean" : question.type;
23832
+ if (type !== "boolean" && type !== "choice" && type !== "score") {
23833
+ issues.push({
23834
+ code: "JUDGMENT_QUESTION_UNKNOWN_TYPE",
23835
+ path: [id, "type"],
23836
+ message: judgmentQuestionMessages.unknownType(id, question.type)
23837
+ });
23838
+ }
23839
+ if (instructionsMissing(question.instructions)) {
23840
+ issues.push({
23841
+ code: "JUDGMENT_INSTRUCTIONS_MISSING",
23842
+ path: [id, "instructions"],
23843
+ message: judgmentQuestionMessages.instructionsMissing(id)
23844
+ });
23845
+ }
23846
+ const criteria = question.criteria;
23847
+ if (type === "choice") {
23848
+ if (!isPlainObject2(criteria) || Object.keys(criteria).length === 0) {
23849
+ issues.push({
23850
+ code: "JUDGMENT_CHOICE_CRITERIA_EMPTY",
23851
+ path: [id, "criteria"],
23852
+ message: judgmentQuestionMessages.choiceCriteriaEmpty(id)
23853
+ });
23854
+ } else if (Object.keys(criteria).length > JUDGMENT_CHOICE_MAX_OPTIONS) {
23855
+ issues.push({
23856
+ code: "JUDGMENT_CHOICE_TOO_MANY_OPTIONS",
23857
+ path: [id, "criteria"],
23858
+ message: judgmentQuestionMessages.choiceTooManyOptions(id, Object.keys(criteria).length)
23859
+ });
23860
+ }
23861
+ }
23862
+ if (type === "score") {
23863
+ const count = Array.isArray(criteria) ? criteria.length : void 0;
23864
+ if (count === void 0 || count < JUDGMENT_SCORE_MIN_LEVELS || count > JUDGMENT_SCORE_MAX_LEVELS) {
23865
+ issues.push({
23866
+ code: "JUDGMENT_SCORE_LEVEL_COUNT",
23867
+ path: [id, "criteria"],
23868
+ message: judgmentQuestionMessages.scoreLevelCount(id, count)
23869
+ });
23870
+ }
23871
+ }
23872
+ return issues;
23873
+ }
23874
+ function collectShapeIssues(id, question) {
23875
+ const parsed = judgmentQuestionSchema.safeParse(question);
23876
+ if (parsed.success) return [];
23877
+ return parsed.error.issues.map((issue2) => {
23878
+ const path21 = issue2.path.filter((segment) => typeof segment !== "symbol");
23879
+ return {
23880
+ code: "JUDGMENT_QUESTION_MALFORMED",
23881
+ path: [id, ...path21],
23882
+ message: judgmentQuestionMessages.malformed(id, path21, issue2.message)
23883
+ };
23884
+ });
23885
+ }
23886
+ function validateJudgmentQuestions(questions) {
23887
+ if (!isPlainObject2(questions) || Object.keys(questions).length === 0) {
23888
+ return [{ code: "JUDGMENT_NO_QUESTIONS", path: [], message: judgmentQuestionMessages.noQuestions() }];
23889
+ }
23890
+ const issues = [];
23891
+ for (const [id, question] of Object.entries(questions)) {
23892
+ const ruleIssues = collectRuleIssues(id, question);
23893
+ issues.push(...ruleIssues.length > 0 ? ruleIssues : collectShapeIssues(id, question));
23894
+ }
23895
+ return issues;
23896
+ }
23897
+ var judgmentQuestionsSchema = external_exports.unknown().superRefine((questions, ctx) => {
23898
+ for (const issue2 of validateJudgmentQuestions(questions)) {
23899
+ ctx.addIssue({ code: "custom", path: issue2.path, message: issue2.message });
23900
+ }
23901
+ }).pipe(external_exports.record(external_exports.string(), judgmentQuestionSchema));
23902
+ var unitIntervalSchema2 = external_exports.number().min(0).max(1);
23903
+ var judgmentQuestionCalibrationSchema = external_exports.object({
23904
+ threshold: external_exports.number().min(0),
23905
+ targetAccuracy: unitIntervalSchema2,
23906
+ heldOutAccuracy: unitIntervalSchema2,
23907
+ handledRate: unitIntervalSchema2,
23908
+ ece: unitIntervalSchema2
23909
+ });
23910
+ var judgmentCalibrationSchema = external_exports.object({
23911
+ labeledSetRef: external_exports.string().min(1),
23912
+ perQuestion: external_exports.record(external_exports.string(), judgmentQuestionCalibrationSchema).refine((perQuestion) => Object.keys(perQuestion).length > 0, {
23913
+ message: "A calibration needs at least one measured question."
23914
+ }),
23915
+ measuredModel: external_exports.string().min(1)
23916
+ });
23917
+ var judgmentInputMappingSchema = external_exports.record(external_exports.string().min(1), external_exports.string().min(1));
23918
+ var questionSetSchema = external_exports.object({
23919
+ id: external_exports.string().min(1),
23920
+ slug: external_exports.string().min(1),
23921
+ version: external_exports.number().int().min(1),
23922
+ questions: judgmentQuestionsSchema,
23923
+ inputMapping: judgmentInputMappingSchema.optional(),
23924
+ model: external_exports.string().min(1).optional(),
23925
+ calibration: judgmentCalibrationSchema.optional()
23926
+ });
23927
+
23928
+ // ../shared/dist/chunk-NDJK5NMQ.mjs
23929
+ var GATEWAY_EVALUATION_MODELS = Object.freeze({
23930
+ "typesafe-ai/jev": Object.freeze({
23931
+ id: "typesafe-ai/jev",
23932
+ name: "Jev",
23933
+ description: "Jev is TypeSafe AI\u2019s System One evaluation model for fast, structured decisions in software. It evaluates shared state against typed questions and returns choices, scores, and boolean probabilities, supporting classification, routing, rubric-based assessment, and automated verification. Multiple questions can be evaluated in parallel within a single request.",
23934
+ contextWindow: 32e3,
23935
+ supportedSpecifications: Object.freeze(["v4"]),
23936
+ pricing: Object.freeze({
23937
+ inputPerToken: "0.000000042",
23938
+ outputPerToken: "0",
23939
+ inputPer1MTokens: 0.042,
23940
+ outputPer1MTokens: 0
23941
+ })
23942
+ })
23943
+ });
23944
+
23945
+ // ../shared/dist/chunk-IJXPXFLP.mjs
23946
+ var JSON_VALUE = { anyOf: [{ type: "string" }, { type: "object" }, { type: "array" }] };
23947
+ var NULLABLE_JSON_VALUE = {
23948
+ anyOf: [{ type: "string" }, { type: "object" }, { type: "array" }, { type: "null" }]
23949
+ };
23950
+ var STATE_PROPERTY = {
23951
+ ...JSON_VALUE,
23952
+ description: "The text or JSON to judge. Select the fields the questions need rather than a whole record: input size is the only cost."
23953
+ };
23954
+ var BOOLEAN_QUESTION = {
23955
+ type: "object",
23956
+ properties: {
23957
+ type: { type: "string", enum: ["boolean"] },
23958
+ instructions: {
23959
+ ...JSON_VALUE,
23960
+ description: "What to decide. The question id is never sent to the model."
23961
+ },
23962
+ criteria: {
23963
+ type: "object",
23964
+ properties: {
23965
+ true: { ...NULLABLE_JSON_VALUE, description: "What a true answer means." },
23966
+ false: { ...NULLABLE_JSON_VALUE, description: "What a false answer means." }
23967
+ },
23968
+ additionalProperties: false
23969
+ }
23970
+ },
23971
+ required: ["type", "instructions"],
23972
+ additionalProperties: false
23973
+ };
23974
+ var CHOICE_QUESTION = {
23975
+ type: "object",
23976
+ properties: {
23977
+ type: { type: "string", enum: ["choice"] },
23978
+ instructions: {
23979
+ ...JSON_VALUE,
23980
+ description: "What to choose. The question id is never sent to the model."
23981
+ },
23982
+ criteria: {
23983
+ type: "object",
23984
+ description: `Option label to description, 1 to ${JUDGMENT_CHOICE_MAX_OPTIONS} options.`,
23985
+ additionalProperties: NULLABLE_JSON_VALUE,
23986
+ minProperties: 1,
23987
+ maxProperties: JUDGMENT_CHOICE_MAX_OPTIONS
23988
+ }
23989
+ },
23990
+ required: ["type", "instructions", "criteria"],
23991
+ additionalProperties: false
23992
+ };
23993
+ var SCORE_QUESTION = {
23994
+ type: "object",
23995
+ properties: {
23996
+ type: { type: "string", enum: ["score"] },
23997
+ instructions: {
23998
+ ...JSON_VALUE,
23999
+ description: "What to score. The question id is never sent to the model."
24000
+ },
24001
+ criteria: {
24002
+ type: "array",
24003
+ description: `Ordered level descriptions, lowest first, ${JUDGMENT_SCORE_MIN_LEVELS} to ${JUDGMENT_SCORE_MAX_LEVELS} levels.`,
24004
+ items: NULLABLE_JSON_VALUE,
24005
+ minItems: JUDGMENT_SCORE_MIN_LEVELS,
24006
+ maxItems: JUDGMENT_SCORE_MAX_LEVELS
24007
+ }
24008
+ },
24009
+ required: ["type", "instructions", "criteria"],
24010
+ additionalProperties: false
24011
+ };
24012
+
24013
+ // ../shared/dist/chunk-FSRL5TBK.mjs
23576
24014
  var THINKING_CONTENT_PART_TYPES = [
23577
24015
  "reasoning",
23578
24016
  "thinking",
@@ -23664,101 +24102,417 @@ function loadBrandConfig(env) {
23664
24102
  var BRAND = loadBrandConfig();
23665
24103
  var DEFAULT_BRAND_CONFIG = BRAND_CONFIGS[DEFAULT_BRAND_NAME];
23666
24104
 
23667
- // ../shared/dist/chunk-OS5X75LW.mjs
23668
- var RECORD_COLLECTION_FIELD_NAME_PATTERN = /^[a-z0-9_]{1,64}$/;
23669
- var RECORD_COLLECTION_MAX_PROPERTIES = 200;
23670
- var RECORD_COLLECTION_STRING_FORMATS = ["date-time", "email", "uri", "record-id"];
23671
- var fieldNameSchema = external_exports.string().regex(
23672
- RECORD_COLLECTION_FIELD_NAME_PATTERN,
23673
- "Property names must be normalized keys: lowercase letters, digits, and underscores (1-64 chars)"
24105
+ // ../shared/dist/chunk-NBGTI2DK.mjs
24106
+ var apiReleaseChannelSchema = external_exports.enum(["staging", "production"]);
24107
+ var API_ARTIFACT_SCRIPT_PATTERN = /^api-[a-z0-9][a-z0-9-]{0,62}$/;
24108
+ var apiArtifactScriptNameSchema = external_exports.string().regex(
24109
+ API_ARTIFACT_SCRIPT_PATTERN,
24110
+ "API artifact script names look like api-<sha12> or api-<sha12>-<suffix> (lowercase alphanumeric and dashes)"
23674
24111
  );
23675
- var descriptionSchema = external_exports.string().max(1024).optional();
23676
- var stringPropertySchema = external_exports.strictObject({
23677
- type: external_exports.literal("string"),
23678
- description: descriptionSchema,
23679
- format: external_exports.enum(RECORD_COLLECTION_STRING_FORMATS).optional(),
23680
- enum: external_exports.array(external_exports.string().max(256)).min(1).max(100).optional(),
23681
- maxLength: external_exports.number().int().positive().optional()
23682
- });
23683
- var numberPropertySchema = external_exports.strictObject({
23684
- type: external_exports.literal("number"),
23685
- description: descriptionSchema,
23686
- minimum: external_exports.number().optional(),
23687
- maximum: external_exports.number().optional()
23688
- });
23689
- var booleanPropertySchema = external_exports.strictObject({
23690
- type: external_exports.literal("boolean"),
23691
- description: descriptionSchema
23692
- });
23693
- var scalarPropertySchema = external_exports.discriminatedUnion("type", [
23694
- stringPropertySchema,
23695
- numberPropertySchema,
23696
- booleanPropertySchema
24112
+ var RUNTIME_ARTIFACT_SCRIPT_PATTERN = /^rt-[a-z0-9][a-z0-9-]{0,80}$/;
24113
+ var runtimeArtifactScriptNameSchema = external_exports.string().regex(
24114
+ RUNTIME_ARTIFACT_SCRIPT_PATTERN,
24115
+ "Runtime artifact script names look like rt-<namespace>-<flow|agent>-<hash> (lowercase alphanumeric and dashes)"
24116
+ );
24117
+ var apiHeaderOverrideModeSchema = external_exports.enum(["open", "token"]);
24118
+ var apiArtifactStatusSchema = external_exports.enum([
24119
+ "uploaded",
24120
+ "active",
24121
+ "superseded",
24122
+ "pinned",
24123
+ "failed",
24124
+ "deleted"
23697
24125
  ]);
23698
- var nestedObjectPropertySchema = external_exports.strictObject({
23699
- type: external_exports.literal("object"),
23700
- description: descriptionSchema,
23701
- properties: external_exports.record(fieldNameSchema, scalarPropertySchema),
23702
- required: external_exports.array(fieldNameSchema).optional(),
23703
- additionalProperties: external_exports.boolean().optional()
24126
+ var apiCanaryConfigSchema = external_exports.object({
24127
+ script: apiArtifactScriptNameSchema,
24128
+ percent: external_exports.number().int().min(1).max(100)
23704
24129
  });
23705
- var arrayPropertySchema = external_exports.strictObject({
23706
- type: external_exports.literal("array"),
23707
- description: descriptionSchema,
23708
- items: external_exports.union([scalarPropertySchema, nestedObjectPropertySchema])
24130
+ var apiRoutingDocSchema = external_exports.object({
24131
+ version: external_exports.number().int().nonnegative(),
24132
+ updatedAt: external_exports.string().min(1),
24133
+ api: external_exports.object({
24134
+ activeScript: apiArtifactScriptNameSchema.nullable(),
24135
+ previousScript: apiArtifactScriptNameSchema.nullable(),
24136
+ canary: apiCanaryConfigSchema.nullable(),
24137
+ pinsEnabled: external_exports.boolean(),
24138
+ legacyFallback: external_exports.boolean(),
24139
+ headerOverride: apiHeaderOverrideModeSchema,
24140
+ // WHY(docs/why/packages/shared/src.md#otlp-fast-lane-when-true-the-dispatch-worker-ter): OTLP fast lane: when true, the dispatch worker terminates `/v1/otel/*` at the standalone
24141
+ /** OTLP fast lane: when true, the dispatch worker terminates `/v1/otel/*` at the standalone `runtype-otel-ingest` worker instead of resolving an API artifact (apps/api-dispatch/src/otel-lane.ts; docs/features/planning/2026-08-12-otel-ingest-worker.md, increment 3). */
24142
+ otelIngest: external_exports.boolean().optional()
24143
+ })
24144
+ }).refine((doc) => doc.api.activeScript !== null || doc.api.legacyFallback, {
24145
+ message: "activeScript may only be null while legacyFallback is true",
24146
+ path: ["api", "activeScript"]
23709
24147
  });
23710
- var propertySchema = external_exports.union([
23711
- scalarPropertySchema,
23712
- arrayPropertySchema,
23713
- nestedObjectPropertySchema
23714
- ]);
23715
- function addSemanticIssues(schema, ctx, pathPrefix = []) {
23716
- const propertyNames = new Set(Object.keys(schema.properties));
23717
- for (const name of schema.required ?? []) {
23718
- if (!propertyNames.has(name)) {
23719
- ctx.addIssue({
23720
- code: "custom",
23721
- path: [...pathPrefix, "required"],
23722
- message: `Required property "${name}" is not declared in properties`
23723
- });
23724
- }
24148
+ var edgeContextPayloadSchema = external_exports.object({
24149
+ /** Resolved Runtype user id (`user_…`). */
24150
+ userId: external_exports.string().min(1),
24151
+ /** Resolved org id (`org_…`); null for a personal (no-org) credential. */
24152
+ orgId: external_exports.string().min(1).nullable(),
24153
+ /** Effective permission scopes for the credential (e.g. `["*"]`). */
24154
+ scopes: external_exports.array(external_exports.string()),
24155
+ /** Token id (one per mint) — replay/audit handle, never reused as a secret. */
24156
+ jti: external_exports.string().min(1),
24157
+ /** Expiry as epoch MILLISECONDS; the token is rejected once `exp <= now`. */
24158
+ exp: external_exports.number().int().positive()
24159
+ });
24160
+
24161
+ // ../shared/dist/chunk-ZGF3GAF7.mjs
24162
+ var DEFAULT_FLOW_TIMEOUT_MS = 15 * 60 * 1e3;
24163
+ var ASYNC_REPLAY_AGENT_LANE_BUDGET_MS = 10 * 60 * 1e3;
24164
+ var DEFAULT_AGENT_WALL_CLOCK_TIMEOUT_MS = 5 * 60 * 1e3;
24165
+ var ATTACHED_DISPATCH_STEP_TIMEOUT_MAX_MS = 10 * 60 * 1e3;
24166
+ var ASYNC_DISPATCH_TIMEOUT_MAX_MS = 30 * 60 * 1e3;
24167
+
24168
+ // ../shared/dist/chunk-CHLLKMWK.mjs
24169
+ function parseHTMLWithRegex(html) {
24170
+ if (typeof html !== "string") {
24171
+ throw new Error("parseHTML: input must be a string");
23725
24172
  }
23726
- for (const [name, property] of Object.entries(schema.properties)) {
23727
- const path21 = [...pathPrefix, "properties", name];
23728
- if (property.type === "string" && property.enum) {
23729
- if (new Set(property.enum).size !== property.enum.length) {
23730
- ctx.addIssue({
23731
- code: "custom",
23732
- path: [...path21, "enum"],
23733
- message: "Enum values must be unique"
23734
- });
24173
+ try {
24174
+ const parser = {
24175
+ stripTags(value) {
24176
+ return value.replace(/<[^>]*>/g, " ").replace(/<(\/?[a-zA-Z][^>]*)$/, "&lt;$1").replace(/\s+/g, " ").trim();
24177
+ },
24178
+ querySelector(selector) {
24179
+ try {
24180
+ const tag = selector.replace(/[^a-zA-Z0-9-]/g, "");
24181
+ const match = html.match(new RegExp("<" + tag + "[^>]*>(.*?)<\\/" + tag + ">", "is"));
24182
+ return match ? parser.stripTags(match[1]).trim() || null : null;
24183
+ } catch {
24184
+ return null;
24185
+ }
24186
+ },
24187
+ querySelectorAll(selector) {
24188
+ try {
24189
+ const tag = selector.replace(/[^a-zA-Z0-9-]/g, "");
24190
+ const regex = new RegExp("<" + tag + "[^>]*>(.*?)<\\/" + tag + ">", "gis");
24191
+ const results = [];
24192
+ let match;
24193
+ while ((match = regex.exec(html)) !== null) {
24194
+ const value = parser.stripTags(match[1]).trim();
24195
+ if (value) results.push(value);
24196
+ }
24197
+ return results;
24198
+ } catch {
24199
+ return [];
24200
+ }
23735
24201
  }
24202
+ };
24203
+ const titleMatch = html.match(/<title[^>]*>(.*?)<\/title>/is);
24204
+ const title = titleMatch ? parser.stripTags(titleMatch[1]).trim() || void 0 : void 0;
24205
+ const headingRegex = /<h[1-6][^>]*>(.*?)<\/h[1-6]>/gis;
24206
+ const headings = [];
24207
+ let headingMatch;
24208
+ while ((headingMatch = headingRegex.exec(html)) !== null) {
24209
+ const text2 = parser.stripTags(headingMatch[1]).trim();
24210
+ if (text2) headings.push(text2);
23736
24211
  }
23737
- if (property.type === "number" && property.minimum !== void 0 && property.maximum !== void 0 && property.minimum > property.maximum) {
23738
- ctx.addIssue({
23739
- code: "custom",
23740
- path: path21,
23741
- message: "minimum must be less than or equal to maximum"
23742
- });
23743
- }
23744
- if (property.type === "object") {
23745
- addSemanticIssues(property, ctx, path21);
23746
- }
23747
- if (property.type === "array" && property.items.type === "object") {
23748
- addSemanticIssues(property.items, ctx, [...path21, "items"]);
24212
+ const linkRegex = /<a\s[^>]*href=["']([^"']*)["'][^>]*>(.*?)<\/a>/gis;
24213
+ const links = [];
24214
+ let linkMatch;
24215
+ while ((linkMatch = linkRegex.exec(html)) !== null) {
24216
+ const href = linkMatch[1];
24217
+ const text2 = parser.stripTags(linkMatch[2]).trim();
24218
+ if (href) links.push({ href, text: text2 });
23749
24219
  }
24220
+ const text = parser.stripTags(html);
24221
+ return {
24222
+ title,
24223
+ headings,
24224
+ links,
24225
+ text,
24226
+ querySelector: parser.querySelector,
24227
+ querySelectorAll: parser.querySelectorAll
24228
+ };
24229
+ } catch (error62) {
24230
+ throw new Error(
24231
+ `parseHTML failed: ${error62 instanceof Error ? error62.message : "Unknown error"}`,
24232
+ {
24233
+ cause: error62
24234
+ }
24235
+ );
23750
24236
  }
23751
24237
  }
23752
- var recordCollectionSchemaSchema = external_exports.strictObject({
23753
- type: external_exports.literal("object"),
23754
- properties: external_exports.record(fieldNameSchema, propertySchema).refine((props) => Object.keys(props).length <= RECORD_COLLECTION_MAX_PROPERTIES, {
23755
- message: `Schemas may declare at most ${RECORD_COLLECTION_MAX_PROPERTIES} properties`
23756
- }),
23757
- required: external_exports.array(fieldNameSchema).optional(),
23758
- additionalProperties: external_exports.boolean().optional()
23759
- }).superRefine((schema, ctx) => addSemanticIssues(schema, ctx));
24238
+ function createPortableHelpers(parseHTML) {
24239
+ return {
24240
+ parseHTML,
24241
+ /**
24242
+ * Extract email addresses from text
24243
+ * @param text Text to search for emails
24244
+ * @returns Array of found email addresses
24245
+ */
24246
+ extractEmails(text) {
24247
+ if (typeof text !== "string") {
24248
+ return [];
24249
+ }
24250
+ const emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
24251
+ const matches = text.match(emailRegex);
24252
+ return matches ? [...new Set(matches)] : [];
24253
+ },
24254
+ /**
24255
+ * Extract URLs from text
24256
+ * @param text Text to search for URLs
24257
+ * @returns Array of found URLs
24258
+ */
24259
+ extractURLs(text) {
24260
+ if (typeof text !== "string") {
24261
+ return [];
24262
+ }
24263
+ const urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/g;
24264
+ const matches = text.match(urlRegex);
24265
+ return matches ? [...new Set(matches)] : [];
24266
+ },
24267
+ /**
24268
+ * Extract phone numbers from text
24269
+ * @param text Text to search for phone numbers
24270
+ * @returns Array of found phone numbers
24271
+ */
24272
+ extractPhoneNumbers(text) {
24273
+ if (typeof text !== "string") {
24274
+ return [];
24275
+ }
24276
+ const phoneRegex = /(?:\+?1[-.\s]?)?(?:\([0-9]{3}\)|[0-9]{3})[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}/g;
24277
+ const matches = text.match(phoneRegex);
24278
+ return matches ? [...new Set(matches)] : [];
24279
+ },
24280
+ /**
24281
+ * Truncate text to specified length with ellipsis
24282
+ * @param text Text to truncate
24283
+ * @param length Maximum length
24284
+ * @returns Truncated text
24285
+ */
24286
+ truncate(text, length) {
24287
+ if (typeof text !== "string" || typeof length !== "number") {
24288
+ return text || "";
24289
+ }
24290
+ if (text.length <= length) {
24291
+ return text;
24292
+ }
24293
+ return text.substring(0, length).trim() + "...";
24294
+ },
24295
+ /**
24296
+ * Create URL-friendly slug from text
24297
+ * @param text Text to slugify
24298
+ * @returns URL-friendly slug
24299
+ */
24300
+ slugify(text) {
24301
+ if (typeof text !== "string") {
24302
+ return "";
24303
+ }
24304
+ return text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
24305
+ },
24306
+ /**
24307
+ * Convert Markdown to HTML (basic conversion)
24308
+ * @param markdown Markdown text
24309
+ * @returns HTML string
24310
+ */
24311
+ markdown2html(markdown) {
24312
+ if (typeof markdown !== "string") {
24313
+ return "";
24314
+ }
24315
+ return markdown.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim, "<strong>$1</strong>").replace(/__(.*?)__/gim, "<strong>$1</strong>").replace(/\*(.*?)\*/gim, "<em>$1</em>").replace(/_(.*?)_/gim, "<em>$1</em>").replace(/`(.*?)`/gim, "<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim, '<a href="$2">$1</a>').replace(/\n\n/gim, "</p><p>").replace(/\n/gim, "<br>").replace(/^(?!<[h|u|o|l])/gim, "<p>").replace(/$/gim, "</p>").replace(/<p><\/p>/gim, "").replace(/<p>(<h[1-6]>.*<\/h[1-6]>)<\/p>/gim, "$1");
24316
+ },
24317
+ /**
24318
+ * Convert HTML to Markdown (basic conversion)
24319
+ * @param html HTML string
24320
+ * @returns Markdown text
24321
+ */
24322
+ html2markdown(html) {
24323
+ if (typeof html !== "string") {
24324
+ return "";
24325
+ }
24326
+ return html.replace(/<h1[^>]*>(.*?)<\/h1>/gim, "# $1\n\n").replace(/<h2[^>]*>(.*?)<\/h2>/gim, "## $1\n\n").replace(/<h3[^>]*>(.*?)<\/h3>/gim, "### $1\n\n").replace(/<h4[^>]*>(.*?)<\/h4>/gim, "#### $1\n\n").replace(/<h5[^>]*>(.*?)<\/h5>/gim, "##### $1\n\n").replace(/<h6[^>]*>(.*?)<\/h6>/gim, "###### $1\n\n").replace(/<strong[^>]*>(.*?)<\/strong>/gim, "**$1**").replace(/<b[^>]*>(.*?)<\/b>/gim, "**$1**").replace(/<em[^>]*>(.*?)<\/em>/gim, "*$1*").replace(/<i[^>]*>(.*?)<\/i>/gim, "*$1*").replace(/<code[^>]*>(.*?)<\/code>/gim, "`$1`").replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gim, "[$2]($1)").replace(/<br[^>]*>/gim, "\n").replace(/<\/p>/gim, "\n\n").replace(/<p[^>]*>/gim, "").replace(/<li[^>]*>(.*?)<\/li>/gim, "- $1\n").replace(/<ul[^>]*>/gim, "\n").replace(/<\/ul>/gim, "\n").replace(/<ol[^>]*>/gim, "\n").replace(/<\/ol>/gim, "\n").replace(/<[^>]*>/gim, "").replace(/<(\/?[a-zA-Z][^>]*)$/, "&lt;$1").replace(/\n\s*\n\s*\n/gim, "\n\n").trim();
24327
+ },
24328
+ /**
24329
+ * Parse date from various string formats
24330
+ * @param dateStr Date string to parse
24331
+ * @returns Date object or null if invalid
24332
+ */
24333
+ parseDate(dateStr) {
24334
+ if (typeof dateStr !== "string") {
24335
+ return null;
24336
+ }
24337
+ try {
24338
+ const date5 = new Date(dateStr);
24339
+ return isNaN(date5.getTime()) ? null : date5;
24340
+ } catch {
24341
+ return null;
24342
+ }
24343
+ },
24344
+ /**
24345
+ * Format date according to specified format
24346
+ * @param date Date object or string
24347
+ * @param format Format string (simple patterns)
24348
+ * @returns Formatted date string
24349
+ */
24350
+ formatDate(date5, format) {
24351
+ const defaultFormat = format || "YYYY-MM-DD";
24352
+ let dateObj;
24353
+ if (typeof date5 === "string") {
24354
+ dateObj = new Date(date5);
24355
+ } else if (date5 instanceof Date) {
24356
+ dateObj = date5;
24357
+ } else {
24358
+ return "";
24359
+ }
24360
+ if (isNaN(dateObj.getTime())) {
24361
+ return "";
24362
+ }
24363
+ const year = dateObj.getFullYear();
24364
+ const month = String(dateObj.getMonth() + 1).padStart(2, "0");
24365
+ const day = String(dateObj.getDate()).padStart(2, "0");
24366
+ const hours = String(dateObj.getHours()).padStart(2, "0");
24367
+ const minutes = String(dateObj.getMinutes()).padStart(2, "0");
24368
+ const seconds = String(dateObj.getSeconds()).padStart(2, "0");
24369
+ return defaultFormat.replace(/YYYY/g, String(year)).replace(/MM/g, month).replace(/DD/g, day).replace(/HH/g, hours).replace(/mm/g, minutes).replace(/ss/g, seconds);
24370
+ },
24371
+ /**
24372
+ * Add days to a date
24373
+ * @param date Date object or string
24374
+ * @param days Number of days to add (can be negative)
24375
+ * @returns New Date object
24376
+ */
24377
+ addDays(date5, days) {
24378
+ let dateObj;
24379
+ if (typeof date5 === "string") {
24380
+ dateObj = new Date(date5);
24381
+ } else if (date5 instanceof Date) {
24382
+ dateObj = new Date(date5.getTime());
24383
+ } else {
24384
+ return null;
24385
+ }
24386
+ if (isNaN(dateObj.getTime()) || typeof days !== "number") {
24387
+ return null;
24388
+ }
24389
+ dateObj.setDate(dateObj.getDate() + days);
24390
+ return dateObj;
24391
+ },
24392
+ /**
24393
+ * Validate email address format
24394
+ * @param email Email address to validate
24395
+ * @returns True if valid email format
24396
+ */
24397
+ isValidEmail(email3) {
24398
+ if (typeof email3 !== "string") {
24399
+ return false;
24400
+ }
24401
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
24402
+ return emailRegex.test(email3);
24403
+ },
24404
+ /**
24405
+ * Validate URL format
24406
+ * @param url URL to validate
24407
+ * @returns True if valid URL format
24408
+ */
24409
+ isValidURL(url2) {
24410
+ if (typeof url2 !== "string") {
24411
+ return false;
24412
+ }
24413
+ try {
24414
+ new URL(url2);
24415
+ return true;
24416
+ } catch {
24417
+ return false;
24418
+ }
24419
+ },
24420
+ /**
24421
+ * Validate JSON string
24422
+ * @param str String to validate as JSON
24423
+ * @returns True if valid JSON
24424
+ */
24425
+ isValidJSON(str2) {
24426
+ if (typeof str2 !== "string") {
24427
+ return false;
24428
+ }
24429
+ try {
24430
+ JSON.parse(str2);
24431
+ return true;
24432
+ } catch {
24433
+ return false;
24434
+ }
24435
+ },
24436
+ /**
24437
+ * Encode string to base64
24438
+ * @param str String to encode
24439
+ * @returns Base64 encoded string
24440
+ */
24441
+ base64Encode(str2) {
24442
+ if (typeof str2 !== "string") {
24443
+ return "";
24444
+ }
24445
+ try {
24446
+ return btoa(str2);
24447
+ } catch {
24448
+ return btoa(unescape(encodeURIComponent(str2)));
24449
+ }
24450
+ },
24451
+ /**
24452
+ * Decode base64 string
24453
+ * @param str Base64 string to decode
24454
+ * @returns Decoded string
24455
+ */
24456
+ base64Decode(str2) {
24457
+ if (typeof str2 !== "string") {
24458
+ return "";
24459
+ }
24460
+ try {
24461
+ return atob(str2);
24462
+ } catch {
24463
+ try {
24464
+ return decodeURIComponent(escape(atob(str2)));
24465
+ } catch {
24466
+ return "";
24467
+ }
24468
+ }
24469
+ },
24470
+ /**
24471
+ * URL encode string
24472
+ * @param str String to encode
24473
+ * @returns URL encoded string
24474
+ */
24475
+ urlEncode(str2) {
24476
+ if (typeof str2 !== "string") {
24477
+ return "";
24478
+ }
24479
+ return encodeURIComponent(str2);
24480
+ },
24481
+ /**
24482
+ * URL decode string
24483
+ * @param str URL encoded string to decode
24484
+ * @returns Decoded string
24485
+ */
24486
+ urlDecode(str2) {
24487
+ if (typeof str2 !== "string") {
24488
+ return "";
24489
+ }
24490
+ try {
24491
+ return decodeURIComponent(str2);
24492
+ } catch {
24493
+ return str2;
24494
+ }
24495
+ },
24496
+ /**
24497
+ * Return the first argument that is neither null nor undefined (a named
24498
+ * first-non-null / nullish coalesce). The script-side counterpart of the
24499
+ * `{{a ?? b}}` template operator — in templates prefer `{{a ?? b}}`; use
24500
+ * `helpers.coalesce(a, b)` inside transform-data scripts.
24501
+ * @param values Candidate values in priority order
24502
+ * @returns The first non-null/undefined value, or null if all are null/undefined
24503
+ */
24504
+ coalesce(...values) {
24505
+ for (const value of values) {
24506
+ if (value !== null && value !== void 0) {
24507
+ return value;
24508
+ }
24509
+ }
24510
+ return null;
24511
+ }
24512
+ };
24513
+ }
23760
24514
 
23761
- // ../shared/dist/chunk-4MQXFQJ4.mjs
24515
+ // ../shared/dist/chunk-2WE53SSZ.mjs
23762
24516
  var AGENT_TRANSIENT_SECRETS_CODE = "RUNTIME_AGENT_TRANSIENT_SECRETS_UNSUPPORTED";
23763
24517
  var FLOW_TRANSIENT_SECRETS_CODE = "RUNTIME_FLOW_TRANSIENT_SECRETS_UNSUPPORTED";
23764
24518
  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.`;
@@ -24121,7 +24875,7 @@ var SURFACE_TYPE_METADATA = {
24121
24875
  ].join("\n"),
24122
24876
  statusIndicator: "typing_loop",
24123
24877
  voiceSupport: "none",
24124
- historyBackfill: false,
24878
+ historyBackfill: true,
24125
24879
  supportsTextCommands: true,
24126
24880
  capabilityRouting: "first",
24127
24881
  capabilityFanout: "single",
@@ -24218,7 +24972,7 @@ var SURFACE_TYPE_METADATA = {
24218
24972
  executionHint: "You are responding via Telegram. Be clear and concise. Keep messages focused and avoid unnecessary verbosity. Do not include reasoning traces or tool call narration.",
24219
24973
  statusIndicator: "typing_loop",
24220
24974
  voiceSupport: "full",
24221
- historyBackfill: false,
24975
+ historyBackfill: true,
24222
24976
  supportsTextCommands: false,
24223
24977
  capabilityRouting: "first",
24224
24978
  capabilityFanout: "single",
@@ -24714,7 +25468,7 @@ var SLACK_INTEGRATION = {
24714
25468
  },
24715
25469
  {
24716
25470
  name: "send_rich_message",
24717
- description: "Send a Slack message with arbitrary Block Kit blocks. Unlike prompt_user / select_from_list this does NOT register an interaction \u2014 use it for informational cards that do not require a user response.",
25471
+ description: `Send a Slack message with arbitrary Block Kit blocks. Unlike ${modelVisibleToolName("builtin:slack:prompt_user")} / ${modelVisibleToolName("builtin:slack:select_from_list")} this does NOT register an interaction \u2014 use it for informational cards that do not require a user response.`,
24718
25472
  parametersSchema: {
24719
25473
  type: "object",
24720
25474
  properties: {
@@ -26081,6 +26835,40 @@ var toolInputCheckpointSchema = external_exports.object({
26081
26835
  }).optional()
26082
26836
  });
26083
26837
 
26838
+ // ../shared/dist/chunk-PB23OWQZ.mjs
26839
+ var CONTEXT_STEP_TYPES = [
26840
+ "crawl",
26841
+ "fetch-url",
26842
+ "retrieve-record",
26843
+ "get-record",
26844
+ "list-records",
26845
+ "api-call",
26846
+ "transform-data",
26847
+ "template",
26848
+ "conditional",
26849
+ "loop",
26850
+ "set-variable",
26851
+ "upsert-record",
26852
+ "send-email",
26853
+ "send-event",
26854
+ "send-stream",
26855
+ "update-record",
26856
+ "search",
26857
+ "generate-embedding",
26858
+ "vector-search",
26859
+ "tool-call",
26860
+ "wait-until",
26861
+ "paginate-api",
26862
+ "store-vector",
26863
+ "execute-agent",
26864
+ "store-asset",
26865
+ "generate-pdf",
26866
+ "save-memory",
26867
+ "recall-memory",
26868
+ "memory-summary"
26869
+ ];
26870
+ var FLOW_STEP_TYPES = ["prompt", ...CONTEXT_STEP_TYPES];
26871
+
26084
26872
  // ../shared/dist/chunk-FEQMZEYY.mjs
26085
26873
  var DEFAULT_MODELS_FOR_NEW_ACCOUNTS = [
26086
26874
  // WHY(docs/why/packages/shared/src.md#openai-models-route-via-openai-direct-with-verce): OpenAI models route via OpenAI direct with Vercel fallback; routed entries benefit from automatic provider
@@ -26178,39 +26966,99 @@ var DEFAULT_MODELS_FOR_NEW_ACCOUNTS = [
26178
26966
  ];
26179
26967
  var DEFAULT_MODEL_ID = DEFAULT_MODELS_FOR_NEW_ACCOUNTS.find((m2) => m2.isDefault)?.modelId ?? "kimi-k2.6";
26180
26968
 
26181
- // ../shared/dist/chunk-PB23OWQZ.mjs
26182
- var CONTEXT_STEP_TYPES = [
26183
- "crawl",
26184
- "fetch-url",
26185
- "retrieve-record",
26186
- "get-record",
26187
- "list-records",
26188
- "api-call",
26189
- "transform-data",
26190
- "template",
26191
- "conditional",
26192
- "loop",
26193
- "set-variable",
26194
- "upsert-record",
26195
- "send-email",
26196
- "send-event",
26197
- "send-stream",
26198
- "update-record",
26199
- "search",
26200
- "generate-embedding",
26201
- "vector-search",
26202
- "tool-call",
26203
- "wait-until",
26204
- "paginate-api",
26205
- "store-vector",
26206
- "execute-agent",
26207
- "store-asset",
26208
- "generate-pdf",
26209
- "save-memory",
26210
- "recall-memory",
26211
- "memory-summary"
26212
- ];
26213
- var FLOW_STEP_TYPES = ["prompt", ...CONTEXT_STEP_TYPES];
26969
+ // ../shared/dist/chunk-OS5X75LW.mjs
26970
+ var RECORD_COLLECTION_FIELD_NAME_PATTERN = /^[a-z0-9_]{1,64}$/;
26971
+ var RECORD_COLLECTION_MAX_PROPERTIES = 200;
26972
+ var RECORD_COLLECTION_STRING_FORMATS = ["date-time", "email", "uri", "record-id"];
26973
+ var fieldNameSchema = external_exports.string().regex(
26974
+ RECORD_COLLECTION_FIELD_NAME_PATTERN,
26975
+ "Property names must be normalized keys: lowercase letters, digits, and underscores (1-64 chars)"
26976
+ );
26977
+ var descriptionSchema = external_exports.string().max(1024).optional();
26978
+ var stringPropertySchema = external_exports.strictObject({
26979
+ type: external_exports.literal("string"),
26980
+ description: descriptionSchema,
26981
+ format: external_exports.enum(RECORD_COLLECTION_STRING_FORMATS).optional(),
26982
+ enum: external_exports.array(external_exports.string().max(256)).min(1).max(100).optional(),
26983
+ maxLength: external_exports.number().int().positive().optional()
26984
+ });
26985
+ var numberPropertySchema = external_exports.strictObject({
26986
+ type: external_exports.literal("number"),
26987
+ description: descriptionSchema,
26988
+ minimum: external_exports.number().optional(),
26989
+ maximum: external_exports.number().optional()
26990
+ });
26991
+ var booleanPropertySchema = external_exports.strictObject({
26992
+ type: external_exports.literal("boolean"),
26993
+ description: descriptionSchema
26994
+ });
26995
+ var scalarPropertySchema = external_exports.discriminatedUnion("type", [
26996
+ stringPropertySchema,
26997
+ numberPropertySchema,
26998
+ booleanPropertySchema
26999
+ ]);
27000
+ var nestedObjectPropertySchema = external_exports.strictObject({
27001
+ type: external_exports.literal("object"),
27002
+ description: descriptionSchema,
27003
+ properties: external_exports.record(fieldNameSchema, scalarPropertySchema),
27004
+ required: external_exports.array(fieldNameSchema).optional(),
27005
+ additionalProperties: external_exports.boolean().optional()
27006
+ });
27007
+ var arrayPropertySchema = external_exports.strictObject({
27008
+ type: external_exports.literal("array"),
27009
+ description: descriptionSchema,
27010
+ items: external_exports.union([scalarPropertySchema, nestedObjectPropertySchema])
27011
+ });
27012
+ var propertySchema = external_exports.union([
27013
+ scalarPropertySchema,
27014
+ arrayPropertySchema,
27015
+ nestedObjectPropertySchema
27016
+ ]);
27017
+ function addSemanticIssues(schema, ctx, pathPrefix = []) {
27018
+ const propertyNames = new Set(Object.keys(schema.properties));
27019
+ for (const name of schema.required ?? []) {
27020
+ if (!propertyNames.has(name)) {
27021
+ ctx.addIssue({
27022
+ code: "custom",
27023
+ path: [...pathPrefix, "required"],
27024
+ message: `Required property "${name}" is not declared in properties`
27025
+ });
27026
+ }
27027
+ }
27028
+ for (const [name, property] of Object.entries(schema.properties)) {
27029
+ const path21 = [...pathPrefix, "properties", name];
27030
+ if (property.type === "string" && property.enum) {
27031
+ if (new Set(property.enum).size !== property.enum.length) {
27032
+ ctx.addIssue({
27033
+ code: "custom",
27034
+ path: [...path21, "enum"],
27035
+ message: "Enum values must be unique"
27036
+ });
27037
+ }
27038
+ }
27039
+ if (property.type === "number" && property.minimum !== void 0 && property.maximum !== void 0 && property.minimum > property.maximum) {
27040
+ ctx.addIssue({
27041
+ code: "custom",
27042
+ path: path21,
27043
+ message: "minimum must be less than or equal to maximum"
27044
+ });
27045
+ }
27046
+ if (property.type === "object") {
27047
+ addSemanticIssues(property, ctx, path21);
27048
+ }
27049
+ if (property.type === "array" && property.items.type === "object") {
27050
+ addSemanticIssues(property.items, ctx, [...path21, "items"]);
27051
+ }
27052
+ }
27053
+ }
27054
+ var recordCollectionSchemaSchema = external_exports.strictObject({
27055
+ type: external_exports.literal("object"),
27056
+ properties: external_exports.record(fieldNameSchema, propertySchema).refine((props) => Object.keys(props).length <= RECORD_COLLECTION_MAX_PROPERTIES, {
27057
+ message: `Schemas may declare at most ${RECORD_COLLECTION_MAX_PROPERTIES} properties`
27058
+ }),
27059
+ required: external_exports.array(fieldNameSchema).optional(),
27060
+ additionalProperties: external_exports.boolean().optional()
27061
+ }).superRefine((schema, ctx) => addSemanticIssues(schema, ctx));
26214
27062
 
26215
27063
  // ../shared/dist/chunk-DIIGXWZV.mjs
26216
27064
  var MAX_DURABLE_POLL_ATTEMPTS = 1e3;
@@ -26264,7 +27112,7 @@ function durableCrawlBudget(plan) {
26264
27112
  };
26265
27113
  }
26266
27114
 
26267
- // ../shared/dist/chunk-JG4QDGFN.mjs
27115
+ // ../shared/dist/chunk-JMKZTEYJ.mjs
26268
27116
  function getNestedValue(obj, path21) {
26269
27117
  let normalizedPath = path21;
26270
27118
  normalizedPath = normalizedPath.replace(/^\$\.?/, "");
@@ -26357,6 +27205,11 @@ function isSystemVariable(varName) {
26357
27205
  const rootSegment = varName.split(".")[0] || "";
26358
27206
  return SYSTEM_VARIABLES.has(rootSegment);
26359
27207
  }
27208
+ var RESERVED_INPUT_KEY_MESSAGE = "Input keys cannot start with '_' (reserved for system variables)";
27209
+ function hasNoReservedInputKeys(inputs) {
27210
+ if (!inputs) return true;
27211
+ return Object.keys(inputs).every((key) => !key.startsWith("_"));
27212
+ }
26360
27213
  var TEMPLATE_EXPRESSION_PATTERN = /\{\{([^{}]+)\}\}/g;
26361
27214
  function parseTemplateExpression(expr) {
26362
27215
  const tokens = tokenizeFallbackExpression(expr);
@@ -26652,7 +27505,7 @@ function resolveFallback(parsed, context, tracking, options = {}) {
26652
27505
  }
26653
27506
  var templateEngine = new SimpleTemplateEngine();
26654
27507
 
26655
- // ../shared/dist/chunk-KRXG7FGZ.mjs
27508
+ // ../shared/dist/chunk-JBCJTEIN.mjs
26656
27509
  function unwrapVectorSourceTemplate(source) {
26657
27510
  const trimmed2 = source.trim();
26658
27511
  if (!trimmed2.startsWith("{{") || !trimmed2.endsWith("}}")) return source;
@@ -26661,7 +27514,7 @@ function unwrapVectorSourceTemplate(source) {
26661
27514
  return inner;
26662
27515
  }
26663
27516
 
26664
- // ../shared/dist/chunk-4FTKQ5PS.mjs
27517
+ // ../shared/dist/chunk-PCKXG4QA.mjs
26665
27518
  var jsonPatchOperationSchema = external_exports.object({
26666
27519
  op: external_exports.enum(["add", "remove", "replace", "move", "copy", "test"]),
26667
27520
  /** JSON Pointer (RFC 6901) into the state document. `''` addresses the root. */
@@ -26673,6 +27526,10 @@ var jsonPatchOperationSchema = external_exports.object({
26673
27526
  });
26674
27527
  var jsonPatchSchema = external_exports.array(jsonPatchOperationSchema);
26675
27528
  var tokensSchema = external_exports.object({ input: external_exports.number(), output: external_exports.number() });
27529
+ var unifiedTelemetryAttributesSchema = external_exports.record(
27530
+ external_exports.string(),
27531
+ external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean()])
27532
+ );
26676
27533
  var WIRE_STOP_REASONS = [
26677
27534
  "end_turn",
26678
27535
  "max_tool_calls",
@@ -26803,20 +27660,23 @@ var unifiedTurnCompleteEventSchema = external_exports.object({
26803
27660
  completedAt: external_exports.string().optional(),
26804
27661
  fallback: fallbackInfoSchema.optional(),
26805
27662
  estimatedContextBreakdown: estimatedContextBreakdownSchema.optional(),
26806
- subagent: unifiedSubagentAttributionSchema.optional()
27663
+ subagent: unifiedSubagentAttributionSchema.optional(),
27664
+ attributes: unifiedTelemetryAttributesSchema.optional()
26807
27665
  });
26808
27666
  var modelCallTokensSchema = external_exports.object({
26809
27667
  input: external_exports.number(),
26810
27668
  output: external_exports.number(),
26811
27669
  cacheRead: external_exports.number().optional(),
26812
- cacheWrite: external_exports.number().optional()
27670
+ cacheWrite: external_exports.number().optional(),
27671
+ /** Provider-reported reasoning tokens; a subset of `output`. */
27672
+ reasoning: external_exports.number().optional()
26813
27673
  });
26814
27674
  var unifiedModelCallStartEventSchema = external_exports.object({
26815
27675
  ...unifiedBase,
26816
27676
  type: external_exports.literal("model_call_start"),
26817
27677
  /** The call's own seam id; the same value a host joins usage telemetry on. */
26818
27678
  id: external_exports.string(),
26819
- // WHY(docs/features/planning/2026-09-09-unified-observability-data-model.md): D16's ordinal, emitter-minted so a re-projection derives the same span id.
27679
+ // WHY(docs/features/shipped/2026-09-09-unified-observability-data-model.md): D16's ordinal, emitter-minted so a re-projection derives the same span id.
26820
27680
  ordinal: external_exports.number().int().nonnegative(),
26821
27681
  // WHY(apps/api/src/lib/filtered-stream.ts): A user-facing stream drops the model identity, and a stripped frame must still be a valid union member.
26822
27682
  model: external_exports.string().optional(),
@@ -26831,7 +27691,7 @@ var unifiedModelCallCompleteEventSchema = external_exports.object({
26831
27691
  ...unifiedBase,
26832
27692
  type: external_exports.literal("model_call_complete"),
26833
27693
  id: external_exports.string(),
26834
- // WHY(docs/features/planning/2026-09-09-unified-observability-data-model.md): Carried on both frames, so the span id derives from whichever one a batch holds.
27694
+ // WHY(docs/features/shipped/2026-09-09-unified-observability-data-model.md): Carried on both frames, so the span id derives from whichever one a batch holds.
26835
27695
  ordinal: external_exports.number().int().nonnegative(),
26836
27696
  model: external_exports.string().optional(),
26837
27697
  responseModel: external_exports.string().optional(),
@@ -26842,6 +27702,7 @@ var unifiedModelCallCompleteEventSchema = external_exports.object({
26842
27702
  success: external_exports.boolean().optional(),
26843
27703
  durationMs: external_exports.number().optional(),
26844
27704
  completedAt: external_exports.string().optional(),
27705
+ attributes: unifiedTelemetryAttributesSchema.optional(),
26845
27706
  // WHY(packages/shared/src/unified-events-to-log-entries.ts): The live trace tree parents a model row by these, so the closing frame must carry them too.
26846
27707
  iteration: external_exports.number().optional(),
26847
27708
  turnId: external_exports.string().optional(),
@@ -27265,10 +28126,10 @@ var UNIFIED_SSE_EVENT_TYPES = _unifiedTuple([
27265
28126
  "custom"
27266
28127
  ]);
27267
28128
 
27268
- // ../shared/dist/chunk-3JBSYPFI.mjs
28129
+ // ../shared/dist/chunk-TXCLYD2M.mjs
27269
28130
  var UNIFIED_SSE_EVENT_TYPE_SET = new Set(UNIFIED_SSE_EVENT_TYPES);
27270
28131
 
27271
- // ../shared/dist/chunk-6STCS5KQ.mjs
28132
+ // ../shared/dist/chunk-OM3FVZKG.mjs
27272
28133
  var mediaAnnotationsSchema = external_exports.object({
27273
28134
  audience: external_exports.array(external_exports.enum(["user", "assistant"])).optional()
27274
28135
  });
@@ -27984,353 +28845,6 @@ var artifactSSEEventSchema = external_exports.discriminatedUnion("type", [
27984
28845
  artifactSingleEventSchema
27985
28846
  ]);
27986
28847
 
27987
- // ../shared/dist/chunk-CHLLKMWK.mjs
27988
- function parseHTMLWithRegex(html) {
27989
- if (typeof html !== "string") {
27990
- throw new Error("parseHTML: input must be a string");
27991
- }
27992
- try {
27993
- const parser = {
27994
- stripTags(value) {
27995
- return value.replace(/<[^>]*>/g, " ").replace(/<(\/?[a-zA-Z][^>]*)$/, "&lt;$1").replace(/\s+/g, " ").trim();
27996
- },
27997
- querySelector(selector) {
27998
- try {
27999
- const tag = selector.replace(/[^a-zA-Z0-9-]/g, "");
28000
- const match = html.match(new RegExp("<" + tag + "[^>]*>(.*?)<\\/" + tag + ">", "is"));
28001
- return match ? parser.stripTags(match[1]).trim() || null : null;
28002
- } catch {
28003
- return null;
28004
- }
28005
- },
28006
- querySelectorAll(selector) {
28007
- try {
28008
- const tag = selector.replace(/[^a-zA-Z0-9-]/g, "");
28009
- const regex = new RegExp("<" + tag + "[^>]*>(.*?)<\\/" + tag + ">", "gis");
28010
- const results = [];
28011
- let match;
28012
- while ((match = regex.exec(html)) !== null) {
28013
- const value = parser.stripTags(match[1]).trim();
28014
- if (value) results.push(value);
28015
- }
28016
- return results;
28017
- } catch {
28018
- return [];
28019
- }
28020
- }
28021
- };
28022
- const titleMatch = html.match(/<title[^>]*>(.*?)<\/title>/is);
28023
- const title = titleMatch ? parser.stripTags(titleMatch[1]).trim() || void 0 : void 0;
28024
- const headingRegex = /<h[1-6][^>]*>(.*?)<\/h[1-6]>/gis;
28025
- const headings = [];
28026
- let headingMatch;
28027
- while ((headingMatch = headingRegex.exec(html)) !== null) {
28028
- const text2 = parser.stripTags(headingMatch[1]).trim();
28029
- if (text2) headings.push(text2);
28030
- }
28031
- const linkRegex = /<a\s[^>]*href=["']([^"']*)["'][^>]*>(.*?)<\/a>/gis;
28032
- const links = [];
28033
- let linkMatch;
28034
- while ((linkMatch = linkRegex.exec(html)) !== null) {
28035
- const href = linkMatch[1];
28036
- const text2 = parser.stripTags(linkMatch[2]).trim();
28037
- if (href) links.push({ href, text: text2 });
28038
- }
28039
- const text = parser.stripTags(html);
28040
- return {
28041
- title,
28042
- headings,
28043
- links,
28044
- text,
28045
- querySelector: parser.querySelector,
28046
- querySelectorAll: parser.querySelectorAll
28047
- };
28048
- } catch (error62) {
28049
- throw new Error(
28050
- `parseHTML failed: ${error62 instanceof Error ? error62.message : "Unknown error"}`,
28051
- {
28052
- cause: error62
28053
- }
28054
- );
28055
- }
28056
- }
28057
- function createPortableHelpers(parseHTML) {
28058
- return {
28059
- parseHTML,
28060
- /**
28061
- * Extract email addresses from text
28062
- * @param text Text to search for emails
28063
- * @returns Array of found email addresses
28064
- */
28065
- extractEmails(text) {
28066
- if (typeof text !== "string") {
28067
- return [];
28068
- }
28069
- const emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
28070
- const matches = text.match(emailRegex);
28071
- return matches ? [...new Set(matches)] : [];
28072
- },
28073
- /**
28074
- * Extract URLs from text
28075
- * @param text Text to search for URLs
28076
- * @returns Array of found URLs
28077
- */
28078
- extractURLs(text) {
28079
- if (typeof text !== "string") {
28080
- return [];
28081
- }
28082
- const urlRegex = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/g;
28083
- const matches = text.match(urlRegex);
28084
- return matches ? [...new Set(matches)] : [];
28085
- },
28086
- /**
28087
- * Extract phone numbers from text
28088
- * @param text Text to search for phone numbers
28089
- * @returns Array of found phone numbers
28090
- */
28091
- extractPhoneNumbers(text) {
28092
- if (typeof text !== "string") {
28093
- return [];
28094
- }
28095
- const phoneRegex = /(?:\+?1[-.\s]?)?(?:\([0-9]{3}\)|[0-9]{3})[-.\s]?[0-9]{3}[-.\s]?[0-9]{4}/g;
28096
- const matches = text.match(phoneRegex);
28097
- return matches ? [...new Set(matches)] : [];
28098
- },
28099
- /**
28100
- * Truncate text to specified length with ellipsis
28101
- * @param text Text to truncate
28102
- * @param length Maximum length
28103
- * @returns Truncated text
28104
- */
28105
- truncate(text, length) {
28106
- if (typeof text !== "string" || typeof length !== "number") {
28107
- return text || "";
28108
- }
28109
- if (text.length <= length) {
28110
- return text;
28111
- }
28112
- return text.substring(0, length).trim() + "...";
28113
- },
28114
- /**
28115
- * Create URL-friendly slug from text
28116
- * @param text Text to slugify
28117
- * @returns URL-friendly slug
28118
- */
28119
- slugify(text) {
28120
- if (typeof text !== "string") {
28121
- return "";
28122
- }
28123
- return text.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
28124
- },
28125
- /**
28126
- * Convert Markdown to HTML (basic conversion)
28127
- * @param markdown Markdown text
28128
- * @returns HTML string
28129
- */
28130
- markdown2html(markdown) {
28131
- if (typeof markdown !== "string") {
28132
- return "";
28133
- }
28134
- return markdown.replace(/^### (.*$)/gim, "<h3>$1</h3>").replace(/^## (.*$)/gim, "<h2>$1</h2>").replace(/^# (.*$)/gim, "<h1>$1</h1>").replace(/\*\*(.*?)\*\*/gim, "<strong>$1</strong>").replace(/__(.*?)__/gim, "<strong>$1</strong>").replace(/\*(.*?)\*/gim, "<em>$1</em>").replace(/_(.*?)_/gim, "<em>$1</em>").replace(/`(.*?)`/gim, "<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim, '<a href="$2">$1</a>').replace(/\n\n/gim, "</p><p>").replace(/\n/gim, "<br>").replace(/^(?!<[h|u|o|l])/gim, "<p>").replace(/$/gim, "</p>").replace(/<p><\/p>/gim, "").replace(/<p>(<h[1-6]>.*<\/h[1-6]>)<\/p>/gim, "$1");
28135
- },
28136
- /**
28137
- * Convert HTML to Markdown (basic conversion)
28138
- * @param html HTML string
28139
- * @returns Markdown text
28140
- */
28141
- html2markdown(html) {
28142
- if (typeof html !== "string") {
28143
- return "";
28144
- }
28145
- return html.replace(/<h1[^>]*>(.*?)<\/h1>/gim, "# $1\n\n").replace(/<h2[^>]*>(.*?)<\/h2>/gim, "## $1\n\n").replace(/<h3[^>]*>(.*?)<\/h3>/gim, "### $1\n\n").replace(/<h4[^>]*>(.*?)<\/h4>/gim, "#### $1\n\n").replace(/<h5[^>]*>(.*?)<\/h5>/gim, "##### $1\n\n").replace(/<h6[^>]*>(.*?)<\/h6>/gim, "###### $1\n\n").replace(/<strong[^>]*>(.*?)<\/strong>/gim, "**$1**").replace(/<b[^>]*>(.*?)<\/b>/gim, "**$1**").replace(/<em[^>]*>(.*?)<\/em>/gim, "*$1*").replace(/<i[^>]*>(.*?)<\/i>/gim, "*$1*").replace(/<code[^>]*>(.*?)<\/code>/gim, "`$1`").replace(/<a[^>]*href="([^"]*)"[^>]*>(.*?)<\/a>/gim, "[$2]($1)").replace(/<br[^>]*>/gim, "\n").replace(/<\/p>/gim, "\n\n").replace(/<p[^>]*>/gim, "").replace(/<li[^>]*>(.*?)<\/li>/gim, "- $1\n").replace(/<ul[^>]*>/gim, "\n").replace(/<\/ul>/gim, "\n").replace(/<ol[^>]*>/gim, "\n").replace(/<\/ol>/gim, "\n").replace(/<[^>]*>/gim, "").replace(/<(\/?[a-zA-Z][^>]*)$/, "&lt;$1").replace(/\n\s*\n\s*\n/gim, "\n\n").trim();
28146
- },
28147
- /**
28148
- * Parse date from various string formats
28149
- * @param dateStr Date string to parse
28150
- * @returns Date object or null if invalid
28151
- */
28152
- parseDate(dateStr) {
28153
- if (typeof dateStr !== "string") {
28154
- return null;
28155
- }
28156
- try {
28157
- const date5 = new Date(dateStr);
28158
- return isNaN(date5.getTime()) ? null : date5;
28159
- } catch {
28160
- return null;
28161
- }
28162
- },
28163
- /**
28164
- * Format date according to specified format
28165
- * @param date Date object or string
28166
- * @param format Format string (simple patterns)
28167
- * @returns Formatted date string
28168
- */
28169
- formatDate(date5, format) {
28170
- const defaultFormat = format || "YYYY-MM-DD";
28171
- let dateObj;
28172
- if (typeof date5 === "string") {
28173
- dateObj = new Date(date5);
28174
- } else if (date5 instanceof Date) {
28175
- dateObj = date5;
28176
- } else {
28177
- return "";
28178
- }
28179
- if (isNaN(dateObj.getTime())) {
28180
- return "";
28181
- }
28182
- const year = dateObj.getFullYear();
28183
- const month = String(dateObj.getMonth() + 1).padStart(2, "0");
28184
- const day = String(dateObj.getDate()).padStart(2, "0");
28185
- const hours = String(dateObj.getHours()).padStart(2, "0");
28186
- const minutes = String(dateObj.getMinutes()).padStart(2, "0");
28187
- const seconds = String(dateObj.getSeconds()).padStart(2, "0");
28188
- return defaultFormat.replace(/YYYY/g, String(year)).replace(/MM/g, month).replace(/DD/g, day).replace(/HH/g, hours).replace(/mm/g, minutes).replace(/ss/g, seconds);
28189
- },
28190
- /**
28191
- * Add days to a date
28192
- * @param date Date object or string
28193
- * @param days Number of days to add (can be negative)
28194
- * @returns New Date object
28195
- */
28196
- addDays(date5, days) {
28197
- let dateObj;
28198
- if (typeof date5 === "string") {
28199
- dateObj = new Date(date5);
28200
- } else if (date5 instanceof Date) {
28201
- dateObj = new Date(date5.getTime());
28202
- } else {
28203
- return null;
28204
- }
28205
- if (isNaN(dateObj.getTime()) || typeof days !== "number") {
28206
- return null;
28207
- }
28208
- dateObj.setDate(dateObj.getDate() + days);
28209
- return dateObj;
28210
- },
28211
- /**
28212
- * Validate email address format
28213
- * @param email Email address to validate
28214
- * @returns True if valid email format
28215
- */
28216
- isValidEmail(email3) {
28217
- if (typeof email3 !== "string") {
28218
- return false;
28219
- }
28220
- const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
28221
- return emailRegex.test(email3);
28222
- },
28223
- /**
28224
- * Validate URL format
28225
- * @param url URL to validate
28226
- * @returns True if valid URL format
28227
- */
28228
- isValidURL(url2) {
28229
- if (typeof url2 !== "string") {
28230
- return false;
28231
- }
28232
- try {
28233
- new URL(url2);
28234
- return true;
28235
- } catch {
28236
- return false;
28237
- }
28238
- },
28239
- /**
28240
- * Validate JSON string
28241
- * @param str String to validate as JSON
28242
- * @returns True if valid JSON
28243
- */
28244
- isValidJSON(str2) {
28245
- if (typeof str2 !== "string") {
28246
- return false;
28247
- }
28248
- try {
28249
- JSON.parse(str2);
28250
- return true;
28251
- } catch {
28252
- return false;
28253
- }
28254
- },
28255
- /**
28256
- * Encode string to base64
28257
- * @param str String to encode
28258
- * @returns Base64 encoded string
28259
- */
28260
- base64Encode(str2) {
28261
- if (typeof str2 !== "string") {
28262
- return "";
28263
- }
28264
- try {
28265
- return btoa(str2);
28266
- } catch {
28267
- return btoa(unescape(encodeURIComponent(str2)));
28268
- }
28269
- },
28270
- /**
28271
- * Decode base64 string
28272
- * @param str Base64 string to decode
28273
- * @returns Decoded string
28274
- */
28275
- base64Decode(str2) {
28276
- if (typeof str2 !== "string") {
28277
- return "";
28278
- }
28279
- try {
28280
- return atob(str2);
28281
- } catch {
28282
- try {
28283
- return decodeURIComponent(escape(atob(str2)));
28284
- } catch {
28285
- return "";
28286
- }
28287
- }
28288
- },
28289
- /**
28290
- * URL encode string
28291
- * @param str String to encode
28292
- * @returns URL encoded string
28293
- */
28294
- urlEncode(str2) {
28295
- if (typeof str2 !== "string") {
28296
- return "";
28297
- }
28298
- return encodeURIComponent(str2);
28299
- },
28300
- /**
28301
- * URL decode string
28302
- * @param str URL encoded string to decode
28303
- * @returns Decoded string
28304
- */
28305
- urlDecode(str2) {
28306
- if (typeof str2 !== "string") {
28307
- return "";
28308
- }
28309
- try {
28310
- return decodeURIComponent(str2);
28311
- } catch {
28312
- return str2;
28313
- }
28314
- },
28315
- /**
28316
- * Return the first argument that is neither null nor undefined (a named
28317
- * first-non-null / nullish coalesce). The script-side counterpart of the
28318
- * `{{a ?? b}}` template operator — in templates prefer `{{a ?? b}}`; use
28319
- * `helpers.coalesce(a, b)` inside transform-data scripts.
28320
- * @param values Candidate values in priority order
28321
- * @returns The first non-null/undefined value, or null if all are null/undefined
28322
- */
28323
- coalesce(...values) {
28324
- for (const value of values) {
28325
- if (value !== null && value !== void 0) {
28326
- return value;
28327
- }
28328
- }
28329
- return null;
28330
- }
28331
- };
28332
- }
28333
-
28334
28848
  // ../shared/dist/index.mjs
28335
28849
  var FORMULA_TRIGGER = /^[=+\-@\t\r\n]/;
28336
28850
  var STRICT_NUMBER = /^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/;
@@ -28434,9 +28948,14 @@ var DEFAULT_CLOUDFLARE_VOICE_SPEECH_PROFILE = Object.freeze({
28434
28948
  voiceId: "asteria"
28435
28949
  })
28436
28950
  });
28951
+ var DEFAULT_OPENAI_LIVE_VOICE_SPEECH_PROFILE = Object.freeze({
28952
+ mode: "speech_to_speech",
28953
+ transcriber: Object.freeze({ provider: "openai", model: "gpt-live-1" }),
28954
+ synthesizer: Object.freeze({ provider: "openai", model: "gpt-live-1", voiceId: "marin" })
28955
+ });
28437
28956
  function resolveVoiceSpeechProfile(profile, managedDefault = DEFAULT_ELEVENLABS_VOICE_SPEECH_PROFILE) {
28438
28957
  if (!profile.speech) return managedDefault;
28439
- 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;
28958
+ 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 : profile.speech.mode === "speech_to_speech" && profile.speech.transcriber.provider === "openai" && profile.speech.synthesizer.provider === "openai" ? DEFAULT_OPENAI_LIVE_VOICE_SPEECH_PROFILE : void 0;
28440
28959
  return {
28441
28960
  mode: profile.speech.mode,
28442
28961
  transcriber: {
@@ -29227,6 +29746,20 @@ var MAX_MESSAGE_CONTENT_BYTES = 1024 * 1024;
29227
29746
  var MAX_MESSAGES_TOTAL_BYTES = 32 * 1024 * 1024;
29228
29747
  var encoder = new TextEncoder();
29229
29748
  var UNEVALUATED_VERDICT = Object.freeze({ status: "unevaluated" });
29749
+ var RESERVED_HIDDEN_PARAMETER_PREFIX = "_internal";
29750
+ function isReservedHiddenParameterName(name) {
29751
+ return name.startsWith(RESERVED_HIDDEN_PARAMETER_PREFIX);
29752
+ }
29753
+ function reservedHiddenParameterNameMessage(name) {
29754
+ return `hiddenParameterNames entry "${name}" is reserved: names starting with "${RESERVED_HIDDEN_PARAMETER_PREFIX}" are never filled from execution variables. Use a {{secret:NAME}} reference for credentials.`;
29755
+ }
29756
+ var runtimeToolHiddenParameterNamesSchema = external_exports.array(
29757
+ external_exports.string().min(1, "hiddenParameterNames entries must be non-empty parameter names").superRefine((name, ctx) => {
29758
+ if (isReservedHiddenParameterName(name)) {
29759
+ ctx.addIssue({ code: "custom", message: reservedHiddenParameterNameMessage(name) });
29760
+ }
29761
+ })
29762
+ );
29230
29763
  var AGENT_STATE_DEFAULT_MERGE_STRATEGY = "merge";
29231
29764
  var agentPredictStateMappingSchema = external_exports.object({
29232
29765
  /** Top-level state key the predicted argument projects into. */
@@ -29370,9 +29903,9 @@ var compactionConfigSchema = external_exports.object({
29370
29903
  /** Model id for the summarizer. Defaults to the session's routed model. */
29371
29904
  model: external_exports.string().optional()
29372
29905
  });
29906
+ var deprecatedInlineThresholdCharsSchema = external_exports.number().int().min(1024).optional().meta({ deprecated: true, description: "Deprecated and ignored. Tool results are never spilled." });
29373
29907
  var toolResultsConfigSchema = external_exports.object({
29374
- /** Tool results longer than this are spilled to storage and replaced by a marker. */
29375
- inlineThresholdChars: external_exports.number().int().min(1024).default(8192),
29908
+ inlineThresholdChars: deprecatedInlineThresholdCharsSchema,
29376
29909
  /** Tool output newer than this budget is never masked. */
29377
29910
  pruneHotWindowTokens: external_exports.number().int().min(4e3).default(4e4),
29378
29911
  pruneMode: external_exports.enum(["mask", "off"]).default("mask")
@@ -29404,7 +29937,7 @@ var contextManagementAgentConfigSchema = external_exports.object({
29404
29937
  model: external_exports.string().optional()
29405
29938
  }).optional(),
29406
29939
  toolResults: external_exports.object({
29407
- inlineThresholdChars: external_exports.number().int().min(1024).optional(),
29940
+ inlineThresholdChars: deprecatedInlineThresholdCharsSchema,
29408
29941
  pruneHotWindowTokens: external_exports.number().int().min(4e3).optional(),
29409
29942
  pruneMode: external_exports.enum(["mask", "off"]).optional()
29410
29943
  }).optional()
@@ -29514,7 +30047,10 @@ var sandboxConfigSchema = external_exports.object({
29514
30047
  external_exports.string().min(1, "must be a managed secret key")
29515
30048
  ).refine((record2) => Object.keys(record2).length <= 32, {
29516
30049
  message: "secretEnv supports at most 32 variables"
29517
- }).optional()
30050
+ }).optional(),
30051
+ codingAgents: external_exports.array(external_exports.enum(["opencode"])).max(4).optional().describe(
30052
+ "Coding agents the Sandbox can run as typed sessions. Non-empty adds the agent_session_* tools; empty or absent adds none."
30053
+ )
29518
30054
  // WHY(docs/why/packages/shared/src.md#requireapprovalforbash-was-removed-rather-than-s): requireApprovalForBash was removed rather than ship an inert control; use tools.approval instead
29519
30055
  });
29520
30056
  var agentDurabilityConfigSchema = external_exports.object({
@@ -29551,7 +30087,8 @@ var agentRuntimeConfigSchema = external_exports.object({
29551
30087
  parametersSchema: external_exports.record(external_exports.string(), external_exports.unknown()),
29552
30088
  config: external_exports.record(external_exports.string(), external_exports.unknown()),
29553
30089
  // WHY(docs/features/planning/2026-09-10-durable-inversion-program.md): authored opt-in to durable re-fire; absent means repair instead.
29554
- idempotent: external_exports.boolean().optional()
30090
+ idempotent: external_exports.boolean().optional(),
30091
+ hiddenParameterNames: runtimeToolHiddenParameterNamesSchema.optional()
29555
30092
  }).superRefine(validateToolElicitationDefinition)
29556
30093
  ).optional(),
29557
30094
  mcpServers: external_exports.array(
@@ -36272,8 +36809,9 @@ var userProfileFeaturesSchema = external_exports.object({
36272
36809
  // WHY(docs/claude/telemetry-suppression.md): Org-scoped external-telemetry gate; browser and Code Mode MCP surfaces read it here.
36273
36810
  externalTelemetryAllowed: external_exports.boolean().optional()
36274
36811
  });
36812
+ var SLACK_CHANNEL_HISTORY_SCOPE = "channels:history";
36275
36813
  var SLACK_REQUIRED_BOT_SCOPES = [
36276
- "channels:history",
36814
+ SLACK_CHANNEL_HISTORY_SCOPE,
36277
36815
  "channels:read",
36278
36816
  "chat:write",
36279
36817
  "groups:history",
@@ -36598,7 +37136,8 @@ var agentToolsConfigSchema2 = external_exports.object({
36598
37136
  toolType: external_exports.enum(["flow", "custom", "external", "local", "advisor", "subagent", "search"]).optional(),
36599
37137
  parametersSchema: external_exports.record(external_exports.string(), external_exports.any()).optional(),
36600
37138
  config: external_exports.record(external_exports.string(), external_exports.any()),
36601
- idempotent: external_exports.boolean().optional()
37139
+ idempotent: external_exports.boolean().optional(),
37140
+ hiddenParameterNames: runtimeToolHiddenParameterNamesSchema.optional()
36602
37141
  })
36603
37142
  ).optional(),
36604
37143
  mcpServers: external_exports.array(agentMcpServerSchema).optional(),
@@ -36664,7 +37203,8 @@ var agentClaudeManagedConfigSchema = external_exports.object({
36664
37203
  parametersSchema: external_exports.record(external_exports.string(), external_exports.any()).optional()
36665
37204
  })
36666
37205
  ).optional(),
36667
- timeoutMs: external_exports.number().int().positive().optional()
37206
+ timeoutMs: external_exports.number().int().positive().optional(),
37207
+ outputHandoff: external_exports.boolean().optional()
36668
37208
  }).superRefine((cm, ctx) => {
36669
37209
  const mode = cm.setupMode ?? "connect";
36670
37210
  if (mode === "connect") {
@@ -37099,6 +37639,7 @@ var productReadinessSchema = external_exports.object({
37099
37639
  /** Single best dashboard link if any browser step remains (secret-parity). */
37100
37640
  handoff: browserFulfillmentSchema.optional()
37101
37641
  });
37642
+ var SLACK_CHANNEL_HISTORY_SCOPE_WARNING = `This Slack app was installed without the ${SLACK_CHANNEL_HISTORY_SCOPE} scope, so it only receives mentions. Channel response mode always and judge behave as mention until the app is reinstalled.`;
37102
37643
  var briefFieldStatusSchema = external_exports.enum(["confirmed", "assumed"]);
37103
37644
  var briefProblemSchema = external_exports.object({
37104
37645
  status: briefFieldStatusSchema,
@@ -38889,7 +39430,9 @@ var NON_AI_PROVIDER_IDS = /* @__PURE__ */ new Set([
38889
39430
  "resend",
38890
39431
  "elevenlabs",
38891
39432
  "braintrust",
38892
- "granola"
39433
+ "granola",
39434
+ // WHY(docs/features/planning/2026-09-17-typesafe-system-one-integration.md): Jev is AI but answers questions, never prompts; excluded from prompt-model selectors
39435
+ "typesafe"
38893
39436
  ]);
38894
39437
  function isNonAIProvider(id) {
38895
39438
  const normalized = id.trim().toLowerCase();
@@ -39033,6 +39576,15 @@ var LocalInferenceClientFrameSchema = external_exports.discriminatedUnion("type"
39033
39576
  message: external_exports.string().min(1).max(2e3)
39034
39577
  })
39035
39578
  ]);
39579
+ var TAIL_LEVEL_MEMBERS = {
39580
+ debug: true,
39581
+ info: true,
39582
+ warn: true,
39583
+ error: true
39584
+ };
39585
+ var ALL_TAIL_LEVELS = Object.keys(
39586
+ TAIL_LEVEL_MEMBERS
39587
+ );
39036
39588
  function flattenTextContent(content) {
39037
39589
  if (typeof content === "string") return content;
39038
39590
  return content.filter(
@@ -39322,7 +39874,7 @@ var DispatchRequestEnvelopeSchema = external_exports.object({
39322
39874
  'Conversation history for this turn, or with `history: "stored"` only the new delta. A `system` message that is not the first message keeps its position on OpenAI-family models (so a per-turn system message sent last leaves the cached leading prompt untouched) and is folded into the leading system prompt on providers that require a single leading system turn. A `tool` message must carry `toolResults` answering an assistant `toolCalls` entry issued earlier in the array.'
39323
39875
  ),
39324
39876
  history: external_exports.enum(["inline", "stored"]).optional().describe(
39325
- 'Where this turn\'s prior history comes from. "inline" (the default, and today\'s behavior) replays exactly the `messages` sent here. "stored" replays the transcript saved on the `conversationId` conversation, treats `messages` as the new delta, and appends both the delta and the settled assistant turn back onto it; it requires a saved `agent.agentId` and a `conversationId`, and is refused for a flow dispatch, an inline or `claude_managed` agent, `Prefer: respond-async`, a join, or a resume.'
39877
+ 'Where this turn\'s prior history comes from. "inline" (the default, and today\'s behavior) replays exactly the `messages` sent here. "stored" replays the transcript saved on the `conversationId` conversation, treats `messages` as the new delta, and appends both the delta and the settled assistant turn back onto it; it requires a saved `agent.agentId` and a `conversationId`, and is refused for a flow dispatch, an inline or `claude_managed` agent, `Prefer: respond-async`, a steer (`x-runtype-concurrency: steer`), or a resume.'
39326
39878
  ),
39327
39879
  /**
39328
39880
  * Stable caller-provided conversation/session id. Used to scope
@@ -39347,13 +39899,7 @@ var DispatchRequestEnvelopeSchema = external_exports.object({
39347
39899
  clientToolsPolicy: ClientToolsPolicySchema.optional(),
39348
39900
  secrets: external_exports.record(external_exports.string(), external_exports.string()).optional().describe(DISPATCH_TRANSIENT_SECRETS_RETIRED_NOTE),
39349
39901
  credentialProxies: external_exports.array(credentialProxyConfigSchema).max(10).optional(),
39350
- inputs: external_exports.record(external_exports.string(), external_exports.any()).optional().refine(
39351
- (data) => {
39352
- if (!data) return true;
39353
- return Object.keys(data).every((key) => !key.startsWith("_"));
39354
- },
39355
- { message: "Input keys cannot start with '_' (reserved for system variables)" }
39356
- ),
39902
+ inputs: external_exports.record(external_exports.string(), external_exports.any()).optional().refine(hasNoReservedInputKeys, { message: RESERVED_INPUT_KEY_MESSAGE }),
39357
39903
  // WHY(docs/why/packages/shared/src/api-schemas.md#enduser-identity-drives-memory-profile-sharding): endUser identity drives memory-profile sharding and is exposed as _endUser.*, distinct from _user.
39358
39904
  endUser: external_exports.object({
39359
39905
  id: external_exports.string().min(1),
@@ -40015,6 +40561,58 @@ var sandboxDeployEffectivePolicySchema = external_exports.object({
40015
40561
  autoStopInterval: external_exports.number().optional(),
40016
40562
  autoDeleteInterval: external_exports.number().optional()
40017
40563
  });
40564
+ var MANAGED_RECOVERY_LIMITS = Object.freeze({
40565
+ /** Automatic attempts per incident, counted in OPERATIONS rather than requests. */
40566
+ attemptsPerIncident: 3,
40567
+ /** Backoff armed after attempt 1, 2 and 3 settles unsuccessfully; jitter is added to each. */
40568
+ retryDelaysMs: Object.freeze([5e3, 3e4, 12e4]),
40569
+ /** Automatic provider replacements per deployment inside `replacementWindowMs`. */
40570
+ replacementsPerWindow: 2,
40571
+ replacementWindowMs: 60 * 6e4,
40572
+ /** Continuously healthy for this long before an incident's counters reset. */
40573
+ healthyResetMs: 10 * 6e4,
40574
+ /** How long one cold request may observe an already-running reconcile. */
40575
+ coldObservationMs: 5e3
40576
+ });
40577
+ var MANAGED_RECOVERY_REPLACEMENT_STAGES = MANAGED_DEPLOYMENT_STAGE_PLAN.create;
40578
+ var MANAGED_RECOVERY_WAKE_STAGES = MANAGED_DEPLOYMENT_STAGE_PLAN.resume;
40579
+ var MANAGED_RECOVERY_PROCESS_STAGES = Object.freeze([
40580
+ "start-process",
40581
+ "resolve-ingress"
40582
+ ]);
40583
+ var MANAGED_RECOVERY_UNHEALTHY_PROCESS_STAGES = Object.freeze(["stop-process", "start-process", "resolve-ingress"]);
40584
+ var MANAGED_CLEANUP_LIMITS = Object.freeze({
40585
+ /** How long one worker holds a provider-instance row before another may reclaim it. */
40586
+ claimMs: 2 * 6e4,
40587
+ /** The cleanup operation's own absolute deadline, short because it holds the live-mutation slot. */
40588
+ operationDeadlineMs: 2 * 6e4,
40589
+ /** How long past an unacknowledged create's deadline before the durable host is asked to settle it. */
40590
+ // INVARIANT: Pacing only. Elapsed time never proves absence; only the host's destroy-sandbox answer does.
40591
+ lateCreateHoldMs: 10 * 6e4,
40592
+ /** First retry delay after a cleanup attempt that resolved nothing. */
40593
+ minBackoffMs: 6e4,
40594
+ /** Ceiling on the retry delay, so a permanently blocked row still re-checks. */
40595
+ maxBackoffMs: 6 * 60 * 6e4,
40596
+ /** Rows one bounded pass may claim, so cleanup never spends another phase's capacity. */
40597
+ batchLimit: 5,
40598
+ /** Bound on a persisted reason, matching what an operator can usefully read. */
40599
+ reasonLength: 500
40600
+ });
40601
+ var EVIDENCE_BY_FAILURE_CODE = Object.freeze({
40602
+ capability_not_admitted: "capability-unavailable",
40603
+ credential_unavailable: "credential-failure",
40604
+ deadline_exceeded: "provider-unreachable",
40605
+ dependency_lock_invalid: "provider-refused",
40606
+ initialization_incomplete: "provider-refused",
40607
+ instance_not_owned: "ownership-mismatch",
40608
+ network_policy_blocks_install: "provider-refused",
40609
+ profile_unavailable: "provider-refused",
40610
+ provider_error: "provider-refused",
40611
+ provider_unreachable: "provider-unreachable",
40612
+ runtime_profile_mismatch: "ownership-mismatch",
40613
+ source_rejected: "provider-refused",
40614
+ stage_unsupported: "capability-unavailable"
40615
+ });
40018
40616
  var MANAGED_DEPLOYMENT_DESIRED_STATES = [
40019
40617
  "active",
40020
40618
  "suspended",
@@ -40138,8 +40736,11 @@ var MANAGED_DEPLOYMENT_OPERATION_KINDS = [
40138
40736
  "renew",
40139
40737
  "suspend",
40140
40738
  "resume",
40739
+ "recover",
40740
+ "sleep",
40141
40741
  "destroy",
40142
- "expire"
40742
+ "expire",
40743
+ "cleanup"
40143
40744
  ];
40144
40745
  var MANAGED_DEPLOYMENT_OPERATION_STATUSES = [
40145
40746
  "pending",
@@ -45708,6 +46309,30 @@ import chalk13 from "chalk";
45708
46309
  import React8 from "react";
45709
46310
  import { render as render8 } from "ink";
45710
46311
  import { useState as useState9, useEffect as useEffect10 } from "react";
46312
+ function buildToolRunBody(options) {
46313
+ const parameters = resolveJsonPayload(options.input, options.fromFile, "input parameters");
46314
+ const toolConfig = options.config !== void 0 || options.configFile !== void 0 ? resolveJsonPayload(options.config, options.configFile, "tool config") : void 0;
46315
+ return { parameters, ...toolConfig ? { toolConfig } : {} };
46316
+ }
46317
+ function isRecord5(value) {
46318
+ return typeof value === "object" && value !== null && !Array.isArray(value);
46319
+ }
46320
+ function formatToolMetadata(metadata) {
46321
+ if (!metadata || Object.keys(metadata).length === 0) return void 0;
46322
+ const { judgment, ...rest } = metadata;
46323
+ const parts = [];
46324
+ if (isRecord5(judgment)) {
46325
+ const model = judgment.resolvedModelId ?? judgment.requestedModel ?? "unknown";
46326
+ const cost = typeof judgment.estimatedCostUsd === "number" ? `$${judgment.estimatedCostUsd.toFixed(6)}` : "unknown";
46327
+ parts.push(
46328
+ `judgment: model ${String(model)}, key source ${String(judgment.keySource ?? "unknown")}, estimated cost ${cost}`
46329
+ );
46330
+ } else if (judgment !== void 0) {
46331
+ rest.judgment = judgment;
46332
+ }
46333
+ if (Object.keys(rest).length > 0) parts.push(JSON.stringify(rest));
46334
+ return parts.join("; ");
46335
+ }
45711
46336
  var toolsCommand = new Command9("tools").description("Manage runtime tools (saved tools)");
45712
46337
  toolsCommand.command("list").description("List your tools").option("--limit <n>", "Limit results (defaults to the API page size)").option("--cursor <cursor>", "Pagination cursor for the next page").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(async (options) => {
45713
46338
  const apiKey = await ensureAuth();
@@ -46046,12 +46671,11 @@ toolsCommand.command("delete <id>").description("Delete a tool").option("--tty",
46046
46671
  const { waitUntilExit } = render8(React8.createElement(runDelete()));
46047
46672
  await waitUntilExit();
46048
46673
  });
46049
- toolsCommand.command("execute <id>").description("Execute a tool with input parameters").option("--input <json>", "Inline input parameters JSON").option("--from-file <file>", "Read input parameters JSON from a file").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
46674
+ toolsCommand.command("execute <id>").description("Execute a tool with input parameters").option("--input <json>", "Inline input parameters JSON").option("--from-file <file>", "Read input parameters JSON from a file").option("--config <json>", "Inline tool config JSON (builtin: and platform: tools)").option("--config-file <file>", "Read tool config JSON from a file").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
46050
46675
  async (id, options) => {
46051
46676
  const apiKey = await ensureAuth();
46052
46677
  if (!apiKey) return;
46053
- const parameters = resolveJsonPayload(options.input, options.fromFile, "input parameters");
46054
- const body = { parameters };
46678
+ const body = buildToolRunBody(options);
46055
46679
  const client = createCliClient(apiKey);
46056
46680
  if (!isTTY(options) || options.json) {
46057
46681
  try {
@@ -46070,6 +46694,8 @@ toolsCommand.command("execute <id>").description("Execute a tool with input para
46070
46694
  }
46071
46695
  const errMsg = data.error ?? data.errorMessage;
46072
46696
  if (errMsg) console.log(` ${chalk13.red("Error")}: ${errMsg}`);
46697
+ const metadataLine = formatToolMetadata(data.metadata);
46698
+ if (metadataLine) console.log(` Metadata: ${metadataLine}`);
46073
46699
  console.log(` Result: ${JSON.stringify(data.result ?? data, null, 2)}`);
46074
46700
  } catch (error62) {
46075
46701
  const message = error62 instanceof Error ? error62.message : "Unknown error";
@@ -46102,6 +46728,7 @@ toolsCommand.command("execute <id>").description("Execute a tool with input para
46102
46728
  value: data.executionTimeMs !== void 0 ? `${data.executionTimeMs}ms` : void 0
46103
46729
  },
46104
46730
  { label: "Error", value: errMsg, color: "red" },
46731
+ { label: "Metadata", value: formatToolMetadata(data.metadata) },
46105
46732
  {
46106
46733
  label: "Result",
46107
46734
  value: JSON.stringify(data.result ?? data)
@@ -46132,12 +46759,11 @@ toolsCommand.command("execute <id>").description("Execute a tool with input para
46132
46759
  await waitUntilExit();
46133
46760
  }
46134
46761
  );
46135
- toolsCommand.command("test <id>").description("Test a tool with sample input parameters").option("--input <json>", "Inline input parameters JSON").option("--from-file <file>", "Read input parameters JSON from a file").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
46762
+ toolsCommand.command("test <id>").description("Test a tool with sample input parameters").option("--input <json>", "Inline input parameters JSON").option("--from-file <file>", "Read input parameters JSON from a file").option("--config <json>", "Inline tool config JSON (builtin: and platform: tools)").option("--config-file <file>", "Read tool config JSON from a file").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
46136
46763
  async (id, options) => {
46137
46764
  const apiKey = await ensureAuth();
46138
46765
  if (!apiKey) return;
46139
- const parameters = resolveJsonPayload(options.input, options.fromFile, "input parameters");
46140
- const body = { parameters };
46766
+ const body = buildToolRunBody(options);
46141
46767
  const client = createCliClient(apiKey);
46142
46768
  if (!isTTY(options) || options.json) {
46143
46769
  try {
@@ -46156,6 +46782,8 @@ toolsCommand.command("test <id>").description("Test a tool with sample input par
46156
46782
  }
46157
46783
  const errMsg = data.error ?? data.errorMessage;
46158
46784
  if (errMsg) console.log(` ${chalk13.red("Error")}: ${errMsg}`);
46785
+ const metadataLine = formatToolMetadata(data.metadata);
46786
+ if (metadataLine) console.log(` Metadata: ${metadataLine}`);
46159
46787
  console.log(` Result: ${JSON.stringify(data.result ?? data, null, 2)}`);
46160
46788
  } catch (error62) {
46161
46789
  const message = error62 instanceof Error ? error62.message : "Unknown error";
@@ -46188,6 +46816,7 @@ toolsCommand.command("test <id>").description("Test a tool with sample input par
46188
46816
  value: data.executionTimeMs !== void 0 ? `${data.executionTimeMs}ms` : void 0
46189
46817
  },
46190
46818
  { label: "Error", value: errMsg, color: "red" },
46819
+ { label: "Metadata", value: formatToolMetadata(data.metadata) },
46191
46820
  {
46192
46821
  label: "Result",
46193
46822
  value: JSON.stringify(data.result ?? data)
@@ -46667,6 +47296,23 @@ import chalk16 from "chalk";
46667
47296
  import React11 from "react";
46668
47297
  import { render as render11 } from "ink";
46669
47298
  import { useState as useState12, useEffect as useEffect13 } from "react";
47299
+ var STORE_UNAVAILABLE_MESSAGE = "Log store temporarily unavailable";
47300
+ function reportStoreUnavailable(message, subject) {
47301
+ if (!message.includes(STORE_UNAVAILABLE_MESSAGE)) return false;
47302
+ console.error(
47303
+ chalk16.red(
47304
+ `The log store is temporarily unavailable. No ${subject} could be read; retry shortly.`
47305
+ )
47306
+ );
47307
+ return true;
47308
+ }
47309
+ function countsStartAfter(coveredFrom, from) {
47310
+ if (!coveredFrom) return null;
47311
+ const covered = Date.parse(coveredFrom);
47312
+ if (!Number.isFinite(covered)) return null;
47313
+ if (from !== void 0 && covered <= Date.parse(from)) return null;
47314
+ return new Date(covered).toISOString();
47315
+ }
46670
47316
  function filterParams(options) {
46671
47317
  return {
46672
47318
  from: options.from,
@@ -46677,7 +47323,9 @@ function filterParams(options) {
46677
47323
  agentId: options.agent,
46678
47324
  executionId: options.execution,
46679
47325
  surfaceId: options.surface,
46680
- conversationId: options.conversation
47326
+ conversationId: options.conversation,
47327
+ status: options.status,
47328
+ type: options.type
46681
47329
  };
46682
47330
  }
46683
47331
  function levelColor(level) {
@@ -46695,7 +47343,10 @@ function levelColor(level) {
46695
47343
  var logsCommand = new Command12("logs").description(
46696
47344
  "Query historical logs and aggregate stats (use `tail` for live streaming)"
46697
47345
  );
46698
- logsCommand.command("list").description("Query persisted logs with filtering, search, and pagination").option("--from <iso>", "Start timestamp (ISO 8601, default: 24 hours ago)").option("--to <iso>", "End timestamp (ISO 8601, default: now)").option("--level <levels>", "Comma-separated log levels (debug,info,warn,error)").option("--category <categories>", "Comma-separated categories (execution,agent,tool,...)").option("--flow <id>", "Filter by flow ID").option("--agent <id>", "Filter by agent ID").option("--execution <id>", "Filter by execution ID").option("--surface <id>", "Filter by surface ID").option("--conversation <id>", "Filter by conversation ID").option("--search <text>", "Full-text search within the log message").option("--limit <n>", "Max results per page (default 500, max 1000)").option("--cursor <cursor>", "Pagination cursor from a previous page").option("--order <order>", "Sort order: asc or desc (default desc)").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
47346
+ logsCommand.command("list").description("Query persisted logs with filtering, search, and pagination").option("--from <iso>", "Start timestamp (ISO 8601, default: 24 hours ago)").option("--to <iso>", "End timestamp (ISO 8601, default: now)").option("--level <levels>", "Comma-separated log levels (debug,info,warn,error)").option("--category <categories>", "Comma-separated categories (execution,agent,tool,...)").option("--flow <id>", "Filter by flow ID").option("--agent <id>", "Filter by agent ID").option("--execution <id>", "Filter by execution ID").option("--surface <id>", "Filter by surface ID").option("--conversation <id>", "Filter by conversation ID").option("--status <statuses>", "Comma-separated statuses (completed,failed,unknown,...)").option("--type <types>", "Comma-separated entry types (flow,step,tool,agent,model,...)").option(
47347
+ "--search <text>",
47348
+ "Substring search over a span's message, name, operation, tool name or error class"
47349
+ ).option("--limit <n>", "Max results per page (default 500, max 1000)").option("--cursor <cursor>", "Pagination cursor from a previous page").option("--order <order>", "Sort order: asc or desc (default desc)").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
46699
47350
  async (options) => {
46700
47351
  const apiKey = await ensureAuth();
46701
47352
  if (!apiKey) return;
@@ -46714,10 +47365,15 @@ logsCommand.command("list").description("Query persisted logs with filtering, se
46714
47365
  printJson(res);
46715
47366
  return;
46716
47367
  }
46717
- if (res.data?.degraded) {
47368
+ if (res.data?.live?.served === false && res.data.live.reason === "hot_tier_failed") {
47369
+ console.error(
47370
+ chalk16.yellow("Warning: entries from the last few minutes could not be loaded")
47371
+ );
47372
+ }
47373
+ if (res.data?.pagination?.cursorReset) {
46718
47374
  console.error(
46719
47375
  chalk16.yellow(
46720
- "Warning: historical logs are temporarily unavailable; showing recent entries only"
47376
+ "Warning: the cursor was rejected and this is page one again. Do not re-follow it."
46721
47377
  )
46722
47378
  );
46723
47379
  }
@@ -46746,9 +47402,15 @@ logsCommand.command("list").description("Query persisted logs with filtering, se
46746
47402
  }
46747
47403
  console.log(chalk16.dim(`
46748
47404
  Total: ${entries.length} entries`));
46749
- printNextCursorHint("runtype logs list", res.data?.pagination);
47405
+ if (!res.data?.pagination?.cursorReset) {
47406
+ printNextCursorHint("runtype logs list", res.data?.pagination);
47407
+ }
46750
47408
  } catch (error62) {
46751
47409
  const message = error62 instanceof Error ? error62.message : "Unknown error";
47410
+ if (reportStoreUnavailable(message, "entries")) {
47411
+ process.exitCode = 1;
47412
+ return;
47413
+ }
46752
47414
  console.error(chalk16.red(`Failed to query logs: ${message}`));
46753
47415
  process.exit(1);
46754
47416
  }
@@ -46794,12 +47456,15 @@ logsCommand.command("list").description("Query persisted logs with filtering, se
46794
47456
  await waitUntilExit();
46795
47457
  }
46796
47458
  );
46797
- logsCommand.command("stats").description("Aggregate log stats: totals, counts by level/category, and a histogram").option("--from <iso>", "Start timestamp (ISO 8601, default: 24 hours ago)").option("--to <iso>", "End timestamp (ISO 8601, default: now)").option("--level <levels>", "Comma-separated log levels (debug,info,warn,error)").option("--category <categories>", "Comma-separated categories (execution,agent,tool,...)").option("--flow <id>", "Filter by flow ID").option("--agent <id>", "Filter by agent ID").option("--execution <id>", "Filter by execution ID").option("--surface <id>", "Filter by surface ID").option("--conversation <id>", "Filter by conversation ID").option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
47459
+ logsCommand.command("stats").description("Aggregate log stats: totals, counts by level/category, and a histogram").option("--from <iso>", "Start timestamp (ISO 8601, default: 24 hours ago)").option("--to <iso>", "End timestamp (ISO 8601, default: now)").option("--level <levels>", "Comma-separated log levels (debug,info,warn,error)").option("--category <categories>", "Comma-separated categories (execution,agent,tool,...)").option("--flow <id>", "Filter by flow ID").option("--agent <id>", "Filter by agent ID").option("--execution <id>", "Filter by execution ID").option("--surface <id>", "Filter by surface ID").option("--conversation <id>", "Filter by conversation ID").option("--status <statuses>", "Comma-separated statuses (completed,failed,unknown,...)").option("--type <types>", "Comma-separated entry types (flow,step,tool,agent,model,...)").option(
47460
+ "--search <text>",
47461
+ "Substring search over a span's message, name, operation, tool name or error class"
47462
+ ).option("--json", "Output as JSON").option("--tty", "Force TTY mode").option("--no-tty", "Force non-TTY mode").action(
46798
47463
  async (options) => {
46799
47464
  const apiKey = await ensureAuth();
46800
47465
  if (!apiKey) return;
46801
47466
  const client = createCliClient(apiKey);
46802
- const params = filterParams(options);
47467
+ const params = { ...filterParams(options), search: options.search };
46803
47468
  const formatCounts = (counts) => {
46804
47469
  const entries = Object.entries(counts);
46805
47470
  if (entries.length === 0) return "(none)";
@@ -46816,10 +47481,14 @@ logsCommand.command("stats").description("Aggregate log stats: totals, counts by
46816
47481
  if (stats?.degraded) {
46817
47482
  console.error(
46818
47483
  chalk16.yellow(
46819
- "Warning: historical log storage is temporarily unavailable; counts cover recent entries only"
47484
+ "Warning: part of this window could not be read; counts are partial"
46820
47485
  )
46821
47486
  );
46822
47487
  }
47488
+ const startsLate = countsStartAfter(stats.coveredFrom, params.from);
47489
+ if (startsLate) {
47490
+ console.error(chalk16.yellow(`Counts start ${startsLate}`));
47491
+ }
46823
47492
  printDetail("Log Stats", [
46824
47493
  { label: "Total", value: stats.total },
46825
47494
  { label: "By Level", value: formatCounts(stats.byLevel ?? {}) },
@@ -46840,7 +47509,9 @@ Histogram (${histogram.length} buckets):`));
46840
47509
  }
46841
47510
  } catch (error62) {
46842
47511
  const message = error62 instanceof Error ? error62.message : "Unknown error";
46843
- console.error(chalk16.red(`Failed to query log stats: ${message}`));
47512
+ if (!reportStoreUnavailable(message, "counts")) {
47513
+ console.error(chalk16.red(`Failed to query log stats: ${message}`));
47514
+ }
46844
47515
  process.exit(1);
46845
47516
  }
46846
47517
  return;
@@ -50819,9 +51490,10 @@ function readFileContent(filePath, snapshots, liveTools, maxLines = 5e3) {
50819
51490
  // src/marathon/sandbox.ts
50820
51491
  import chalk20 from "chalk";
50821
51492
  import {
50822
- evaluateGeneratedRuntimeToolProposal
51493
+ evaluateGeneratedRuntimeToolProposal,
51494
+ isBuiltinToolExecuteResponse
50823
51495
  } from "@runtypelabs/sdk";
50824
- function isRecord5(value) {
51496
+ function isRecord6(value) {
50825
51497
  return typeof value === "object" && value !== null && !Array.isArray(value);
50826
51498
  }
50827
51499
  function parseSandboxProvider(value) {
@@ -51003,7 +51675,7 @@ function createSandboxLocalTool(client, provider, debugMode) {
51003
51675
  }
51004
51676
  const language = parseSandboxLanguage(provider, args.language);
51005
51677
  const timeout = parseSandboxTimeout(args.timeoutMs, provider);
51006
- const parameters = isRecord5(args.parameters) ? args.parameters : {};
51678
+ const parameters = isRecord6(args.parameters) ? args.parameters : {};
51007
51679
  const gateDecision = evaluateGeneratedRuntimeToolProposal(
51008
51680
  {
51009
51681
  name: "run_sandbox_code",
@@ -51055,6 +51727,9 @@ function createSandboxLocalTool(client, provider, debugMode) {
51055
51727
  parameters
51056
51728
  };
51057
51729
  const execution = await client.tools.execute(created.id, executeRequest);
51730
+ if (isBuiltinToolExecuteResponse(execution)) {
51731
+ throw new Error("Sandbox tool returned a built-in tool result for a saved tool");
51732
+ }
51058
51733
  const parsedResult = provider === "daytona" ? parseDaytonaExecutionResult(execution.result) : execution.result;
51059
51734
  return {
51060
51735
  success: execution.status === "success",
@@ -71875,11 +72550,11 @@ import path20 from "path";
71875
72550
  var MAX_SIDECAR_OUTPUT_BYTES = 1048576;
71876
72551
  var MAX_HELPER_BYTES = 100 * 1048576;
71877
72552
  var DEFAULT_SIDECAR_TIMEOUT_MS = 3e4;
71878
- function isRecord6(value) {
72553
+ function isRecord7(value) {
71879
72554
  return typeof value === "object" && value !== null && !Array.isArray(value);
71880
72555
  }
71881
72556
  function parseHello(value) {
71882
- if (!isRecord6(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")) {
72557
+ if (!isRecord7(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")) {
71883
72558
  throw new DeviceProviderError(
71884
72559
  "The native helper returned an invalid hello response",
71885
72560
  "INVALID_RESPONSE"
@@ -72018,7 +72693,7 @@ var MacOSDeviceProvider = class {
72018
72693
  );
72019
72694
  }
72020
72695
  const result = await this.invokeAt(binaryPath, method, params);
72021
- if (!isRecord6(result)) {
72696
+ if (!isRecord7(result)) {
72022
72697
  throw new DeviceProviderError(
72023
72698
  "The native helper returned a non-object result",
72024
72699
  "INVALID_RESPONSE"
@@ -72248,11 +72923,11 @@ var defaultDependencies3 = {
72248
72923
  process.exitCode = code;
72249
72924
  }
72250
72925
  };
72251
- function isRecord7(value) {
72926
+ function isRecord8(value) {
72252
72927
  return typeof value === "object" && value !== null && !Array.isArray(value);
72253
72928
  }
72254
72929
  function unwrapData(response) {
72255
- if (!isRecord7(response) || !("data" in response)) {
72930
+ if (!isRecord8(response) || !("data" in response)) {
72256
72931
  throw new Error("Runtype API returned an invalid device response");
72257
72932
  }
72258
72933
  return response.data;
@@ -72261,11 +72936,11 @@ function errorMessage2(error62) {
72261
72936
  return error62 instanceof Error ? error62.message : String(error62);
72262
72937
  }
72263
72938
  function apiStatusCode(error62) {
72264
- return isRecord7(error62) && typeof error62.statusCode === "number" ? error62.statusCode : null;
72939
+ return isRecord8(error62) && typeof error62.statusCode === "number" ? error62.statusCode : null;
72265
72940
  }
72266
72941
  function isRecordedRevocationError(error62) {
72267
72942
  if (apiStatusCode(error62) !== 503) return false;
72268
- const data = isRecord7(error62) && isRecord7(error62.data) ? error62.data : null;
72943
+ const data = isRecord8(error62) && isRecord8(error62.data) ? error62.data : null;
72269
72944
  const detail = typeof data?.error === "string" ? data.error : errorMessage2(error62);
72270
72945
  return detail.toLowerCase().includes("revocation was recorded");
72271
72946
  }
@@ -72618,7 +73293,7 @@ Grant Full Disk Access to ${String(local.executablePath)} to enable iMessage rea
72618
73293
  return;
72619
73294
  }
72620
73295
  const content = await readFile2(status.logPath, "utf8").catch((error62) => {
72621
- const code = isRecord7(error62) ? error62.code : void 0;
73296
+ const code = isRecord8(error62) ? error62.code : void 0;
72622
73297
  if (code === "ENOENT") return "";
72623
73298
  throw error62;
72624
73299
  });