@runtypelabs/cli 2.57.0 → 2.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +205 -114
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -1110,7 +1110,7 @@ runs, human takeovers of conversations, and skill proposals.
1110
1110
  | `events watch --once` | Exit after the first poll that returns events |
1111
1111
 
1112
1112
  `events watch` takes `--name <type>` (default: every type), the filters `--agent`, `--flow`,
1113
- `--product`, `--surface`, `--schedule`, `--suite`, `--task`, and `--only-regressions`, and
1113
+ `--product`, `--surface`, `--schedule`, `--suite`, `--task`, `--request`, and `--only-regressions`, and
1114
1114
  `--since <cursor>` (default `now`). Each event carries its `cursor`; pass the last one to `--since`
1115
1115
  to resume without gaps. Events are kept for 7 days. Diagnostics go to stderr, so
1116
1116
  `runtype events watch --json` can feed a monitor that wakes on each line.
package/dist/index.js CHANGED
@@ -56,7 +56,7 @@ var __exportAll = (all, no_symbols) => {
56
56
  return target;
57
57
  };
58
58
  var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
59
- // ../shared/dist/chunk-D9RiVw4h.mjs
59
+ // ../shared/dist/chunk-7fm07YIO.mjs
60
60
  /**
61
61
  * Every product surface type the platform stores and serves. The single source for the FPO surface
62
62
  * enum, the REST create and ensure schemas, and the shared `SurfaceType`; add a new type here only.
@@ -65,6 +65,7 @@ const PRODUCT_SURFACE_TYPES = [
65
65
  "chat",
66
66
  "mcp",
67
67
  "mcp_code",
68
+ "cli",
68
69
  "api",
69
70
  "webhook",
70
71
  "schedule",
@@ -110,7 +111,7 @@ function mergeResults(...results) {
110
111
  merged.valid = merged.errors.length === 0;
111
112
  return merged;
112
113
  }
113
- // ../shared/dist/chunk-XcxbQPuh.mjs
114
+ // ../shared/dist/chunk-BbTDzQd7.mjs
114
115
  /** Names every key of `T` exactly once, so a new credential field fails the build. */
115
116
  function credentialKeysOf(presence) {
116
117
  return Object.keys(presence);
@@ -122,7 +123,8 @@ const SURFACE_INBOUND_CREDENTIAL_KEYS = credentialKeysOf({
122
123
  secret: true,
123
124
  publicKey: true,
124
125
  authToken: true,
125
- twilioAuthToken: true
126
+ twilioAuthToken: true,
127
+ identityClientSecret: true
126
128
  });
127
129
  const SURFACE_OUTBOUND_CREDENTIAL_KEYS = credentialKeysOf({
128
130
  botToken: true,
@@ -135,6 +137,15 @@ const SURFACE_OUTBOUND_CREDENTIAL_KEYS = credentialKeysOf({
135
137
  smtpPassword: true
136
138
  });
137
139
  [.../* @__PURE__ */ new Set([...SURFACE_INBOUND_CREDENTIAL_KEYS, ...SURFACE_OUTBOUND_CREDENTIAL_KEYS])];
140
+ const OFFERS_OAUTH = {
141
+ keys_only: false,
142
+ consent: true,
143
+ required: true,
144
+ none: false
145
+ };
146
+ /** Every `authMode` a surface can store. Any other stored value reads as unset. */
147
+ const SURFACE_AUTH_MODES = Object.keys(OFFERS_OAUTH);
148
+ new Set(SURFACE_AUTH_MODES.filter((mode) => OFFERS_OAUTH[mode]));
138
149
  // ../shared/dist/chunk-DRY4gGEy.mjs
139
150
  /** Every evaluation model the gateway lists, keyed by the gateway id a call names. */
140
151
  const GATEWAY_EVALUATION_MODELS = Object.freeze({
@@ -7135,7 +7146,7 @@ function resolveFallback(parsed, context, tracking, options = {}) {
7135
7146
  return tracking.match;
7136
7147
  }
7137
7148
  new SimpleTemplateEngine();
7138
- // ../shared/dist/chunk-BfSQ06hZ.mjs
7149
+ // ../shared/dist/chunk-CYZSyWdd.mjs
7139
7150
  /**
7140
7151
  * Maps model families to provider-specific model IDs.
7141
7152
  * Use for routing: family + provider → exact model ID
@@ -7157,9 +7168,13 @@ const MODEL_FAMILY_PROVIDER_IDS = {
7157
7168
  "vercel": "anthropic/claude-fable-5.1"
7158
7169
  },
7159
7170
  "claude-fable-5-1-batch": { "vercel": "anthropic/claude-fable-5.1-batch" },
7171
+ "claude-fable-5-2": { "vercel": "anthropic/claude-fable-5.2" },
7172
+ "claude-fable-5-2-batch": { "vercel": "anthropic/claude-fable-5.2-batch" },
7160
7173
  "claude-fable-5-batch": { "vercel": "anthropic/claude-fable-5-batch" },
7161
7174
  "claude-fable-5.1": { "vercel": "anthropic/claude-fable-5.1" },
7162
7175
  "claude-fable-5.1-batch": { "vercel": "anthropic/claude-fable-5.1-batch" },
7176
+ "claude-fable-5.2": { "vercel": "anthropic/claude-fable-5.2" },
7177
+ "claude-fable-5.2-batch": { "vercel": "anthropic/claude-fable-5.2-batch" },
7163
7178
  "claude-haiku-4-5": {
7164
7179
  "anthropic": "claude-haiku-4-5-20251001",
7165
7180
  "vercel": "anthropic/claude-haiku-4.5"
@@ -7839,6 +7854,7 @@ const MODEL_FAMILY_PROVIDER_IDS = {
7839
7854
  "mistral-small": { "vercel": "mistral/mistral-small" },
7840
7855
  "morph-v3-fast": { "vercel": "morph/morph-v3-fast" },
7841
7856
  "morph-v3-large": { "vercel": "morph/morph-v3-large" },
7857
+ "muse-ember": { "vercel": "meta/muse-ember" },
7842
7858
  "muse-glimmer-30b": { "vercel": "meta/muse-glimmer-30b" },
7843
7859
  "muse-spark-1-1": { "vercel": "meta/muse-spark-1.1" },
7844
7860
  "muse-spark-1-2": { "vercel": "meta/muse-spark-1.2" },
@@ -8236,7 +8252,7 @@ const CREATOR_TO_PROVIDER = {
8236
8252
  "unknown": "openai"
8237
8253
  };
8238
8254
  new RegExp(`^${/Model stream stalled \((awaiting_first_token|idle|empty_completion)\) after \d+ms with no progress/.source}`);
8239
- // ../shared/dist/chunk-BtSflVAD.mjs
8255
+ // ../shared/dist/chunk-F1-FFFE7.mjs
8240
8256
  /**
8241
8257
  * Unwraps a single {{variableName}} template to its bare variable name, preserving array/object identity instead of stringifying via the template engine.
8242
8258
  * Returns source unchanged when it is not a lone {{...}} wrapper.
@@ -12659,7 +12675,7 @@ object$4({
12659
12675
  externalId: string$2().min(1).max(500).optional().describe("The conversation id in the source system. Re-creating with the same system and externalId returns the existing conversation with imported: false instead of a duplicate."),
12660
12676
  importedAt: string$2().datetime({ offset: true }).optional()
12661
12677
  });
12662
- // ../shared/dist/chunk-CoA2IB3c.mjs
12678
+ // ../shared/dist/chunk-Dkn7TqhO.mjs
12663
12679
  const voiceInterruptionModeSchema = _enum([
12664
12680
  "none",
12665
12681
  "cancel",
@@ -26276,12 +26292,13 @@ function loadBrandConfig(env) {
26276
26292
  }
26277
26293
  loadBrandConfig();
26278
26294
  BRAND_CONFIGS[DEFAULT_BRAND_NAME];
26279
- // ../shared/dist/chunk-2W0oIwXh.mjs
26295
+ // ../shared/dist/chunk-DV7xJaYR.mjs
26280
26296
  const ARCHITECTURE_PREVIEW_SURFACE_TYPES = [
26281
26297
  "chat",
26282
26298
  "api",
26283
26299
  "mcp",
26284
26300
  "mcp_code",
26301
+ "cli",
26285
26302
  "webhook",
26286
26303
  "schedule",
26287
26304
  "a2a",
@@ -27747,7 +27764,14 @@ object$4({
27747
27764
  simulationsAvailable: boolean().optional(),
27748
27765
  enableDelegateToRuntype: boolean().optional(),
27749
27766
  enableDelegateToOtto: boolean().optional(),
27750
- signalsConfigured: boolean().optional()
27767
+ signalsConfigured: boolean().optional(),
27768
+ enableCliSurface: boolean().optional(),
27769
+ enableCliSurfacePublish: boolean().optional(),
27770
+ enableCliSurfaceGraduation: boolean().optional(),
27771
+ enableMcpSurfaceSignIn: boolean().optional(),
27772
+ enableMcpSurfaceDeviceGrant: boolean().optional(),
27773
+ enableMcpSurfaceOobApprovals: boolean().optional(),
27774
+ enableMcpSurfaceCustomerIdp: boolean().optional()
27751
27775
  });
27752
27776
  const SLACK_REQUIRED_BOT_SCOPES = [
27753
27777
  "channels:history",
@@ -28079,7 +28103,8 @@ const PRODUCT_EVENT_NAMES = [
28079
28103
  "runtype.task.failed",
28080
28104
  "runtype.task.cancelled",
28081
28105
  "runtype.signal.fired",
28082
- "runtype.signal.cluster_appeared"
28106
+ "runtype.signal.cluster_appeared",
28107
+ "runtype.api_key_request.decided"
28083
28108
  ];
28084
28109
  const PRODUCT_EVENT_DEFAULT_NEXT_POLL_MS = 5e3;
28085
28110
  const PRODUCT_EVENT_MAX_WAIT_MS = 5e4;
@@ -28099,6 +28124,7 @@ const ProductEventFilterFieldSchemas = {
28099
28124
  suiteId: resourceId("Only occurrences for this eval suite"),
28100
28125
  simulationId: resourceId("Only occurrences for this simulation"),
28101
28126
  taskId: resourceId("Only occurrences for this delegated task"),
28127
+ requestId: resourceId("Only occurrences for this API key request"),
28102
28128
  key: string$2().min(1).max(64).describe("Only signal occurrences for this signal key, such as tool_error"),
28103
28129
  onlyRegressions: boolean().describe("Only eval runs whose pass rate dropped below the previous run"),
28104
28130
  minIntervalMs: number$2().int().min(0).max(PRODUCT_EVENT_MAX_MIN_INTERVAL_MS).describe("Coalesce repeats: after one execution failure per agent or flow and error class, or one fired signal per agent, key and value, drop later ones within this window")
@@ -28142,6 +28168,7 @@ const SignalClusterAppearedArgumentsSchema = object$4({
28142
28168
  agentId: filter.agentId.optional(),
28143
28169
  key: filter.key.optional()
28144
28170
  }).strict();
28171
+ const ApiKeyRequestDecidedArgumentsSchema = object$4({ requestId: filter.requestId.optional() }).strict();
28145
28172
  object$4({
28146
28173
  agentId: filter.agentId.optional(),
28147
28174
  flowId: filter.flowId.optional(),
@@ -28151,6 +28178,7 @@ object$4({
28151
28178
  suiteId: filter.suiteId.optional(),
28152
28179
  simulationId: filter.simulationId.optional(),
28153
28180
  taskId: filter.taskId.optional(),
28181
+ requestId: filter.requestId.optional(),
28154
28182
  key: filter.key.optional(),
28155
28183
  onlyRegressions: filter.onlyRegressions.optional(),
28156
28184
  minIntervalMs: filter.minIntervalMs.optional()
@@ -28270,6 +28298,17 @@ const SignalClusterAppearedPayloadSchema = object$4({
28270
28298
  memberCount: number$2().int().min(0).describe("Answers in the cluster"),
28271
28299
  firstSeenAt: isoTimestamp("When the earliest member was seen")
28272
28300
  });
28301
+ const ApiKeyRequestDecidedPayloadSchema = object$4({
28302
+ requestId: resourceId("The API key request"),
28303
+ status: _enum([
28304
+ "approved",
28305
+ "declined",
28306
+ "expired",
28307
+ "cancelled"
28308
+ ]).describe("Where the request went from pending; on approved, redeem it with claim_api_key"),
28309
+ decidedAt: isoTimestamp("When the request left pending"),
28310
+ claimExpiresAt: isoTimestamp("Approved only: redeem before this time or the approval expires").optional()
28311
+ });
28273
28312
  const PRODUCT_EVENT_ARGUMENT_SCHEMAS = {
28274
28313
  "runtype.execution.failed": ExecutionFailedArgumentsSchema,
28275
28314
  "runtype.approval.requested": ApprovalRequestedArgumentsSchema,
@@ -28283,7 +28322,8 @@ const PRODUCT_EVENT_ARGUMENT_SCHEMAS = {
28283
28322
  "runtype.task.failed": DelegateTaskArgumentsSchema,
28284
28323
  "runtype.task.cancelled": DelegateTaskArgumentsSchema,
28285
28324
  "runtype.signal.fired": SignalFiredArgumentsSchema,
28286
- "runtype.signal.cluster_appeared": SignalClusterAppearedArgumentsSchema
28325
+ "runtype.signal.cluster_appeared": SignalClusterAppearedArgumentsSchema,
28326
+ "runtype.api_key_request.decided": ApiKeyRequestDecidedArgumentsSchema
28287
28327
  };
28288
28328
  const PRODUCT_EVENT_PAYLOAD_SCHEMAS = {
28289
28329
  "runtype.execution.failed": ExecutionFailedPayloadSchema,
@@ -28298,7 +28338,8 @@ const PRODUCT_EVENT_PAYLOAD_SCHEMAS = {
28298
28338
  "runtype.task.failed": TaskFailedPayloadSchema,
28299
28339
  "runtype.task.cancelled": TaskCancelledPayloadSchema,
28300
28340
  "runtype.signal.fired": SignalFiredPayloadSchema,
28301
- "runtype.signal.cluster_appeared": SignalClusterAppearedPayloadSchema
28341
+ "runtype.signal.cluster_appeared": SignalClusterAppearedPayloadSchema,
28342
+ "runtype.api_key_request.decided": ApiKeyRequestDecidedPayloadSchema
28302
28343
  };
28303
28344
  const PRODUCT_EVENT_DESCRIPTIONS = {
28304
28345
  "runtype.execution.failed": "An agent or flow execution ended in failure. An API key sees agent runs with AGENTS:READ and flow runs with FLOWS:READ.",
@@ -28313,7 +28354,8 @@ const PRODUCT_EVENT_DESCRIPTIONS = {
28313
28354
  "runtype.task.failed": "A delegated task ended in failure.",
28314
28355
  "runtype.task.cancelled": "A delegated task was cancelled before it finished.",
28315
28356
  "runtype.signal.fired": "A trace signal fired on an agent turn, including the built-in failure facts every agent gets.",
28316
- "runtype.signal.cluster_appeared": "A new cluster of similar signal answers appeared for an agent. Declared ahead of clustering; nothing emits it yet."
28357
+ "runtype.signal.cluster_appeared": "A new cluster of similar signal answers appeared for an agent. Declared ahead of clustering; nothing emits it yet.",
28358
+ "runtype.api_key_request.decided": "An API key request left pending: approved, declined or cancelled, or expired, which is recorded only when the request is read after its expiresAt. On approved, call claim_api_key before claimExpiresAt. An API key without API_KEYS:READ sees only the requests it filed."
28317
28359
  };
28318
28360
  /** API-key scopes that may read each event; holding any one of them is enough. */
28319
28361
  const PRODUCT_EVENT_REQUIRED_SCOPES = {
@@ -28333,7 +28375,8 @@ const PRODUCT_EVENT_REQUIRED_SCOPES = {
28333
28375
  "runtype.task.failed": ["DELEGATE_TASKS:READ", "DELEGATE_TASKS:WRITE"],
28334
28376
  "runtype.task.cancelled": ["DELEGATE_TASKS:READ", "DELEGATE_TASKS:WRITE"],
28335
28377
  "runtype.signal.fired": ["SIGNALS:READ", "SIGNALS:WRITE"],
28336
- "runtype.signal.cluster_appeared": ["SIGNALS:READ", "SIGNALS:WRITE"]
28378
+ "runtype.signal.cluster_appeared": ["SIGNALS:READ", "SIGNALS:WRITE"],
28379
+ "runtype.api_key_request.decided": ["API_KEYS:READ"]
28337
28380
  };
28338
28381
  /** Derive a draft-07 JSON Schema object from a Zod object, without the `$schema` marker. */
28339
28382
  function productEventJsonSchema(schema) {
@@ -54137,6 +54180,20 @@ modelsCommand.command("usage").description("Show model usage statistics").option
54137
54180
  process.exit(1);
54138
54181
  }
54139
54182
  });
54183
+ /** Reads a schedule's whole run history, newest first, one page at a time. */
54184
+ async function fetchAllScheduleRuns(client, scheduleId) {
54185
+ const runs = [];
54186
+ let cursor;
54187
+ do {
54188
+ const page = await client.get(`/schedules/${scheduleId}/runs`, {
54189
+ limit: 500,
54190
+ ...cursor ? { cursor } : {}
54191
+ });
54192
+ runs.push(...page.data ?? []);
54193
+ cursor = page.hasMore && page.nextCursor ? page.nextCursor : void 0;
54194
+ } while (cursor);
54195
+ return runs;
54196
+ }
54140
54197
  // src/commands/schedules.ts
54141
54198
  const schedulesCommand = new Command("schedules").description("Manage schedules");
54142
54199
  schedulesCommand.command("list").description("List all schedules").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) => {
@@ -54334,12 +54391,15 @@ schedulesCommand.command("runs <id>").description("List run history for a schedu
54334
54391
  const client = createCliClient(apiKey);
54335
54392
  if (!isTTY(options) || options.json) {
54336
54393
  try {
54337
- const data = await client.get(`/schedules/${id}/runs`);
54394
+ const runs = await fetchAllScheduleRuns(client, id);
54338
54395
  if (options.json) {
54339
- printJson(data);
54396
+ printJson({
54397
+ data: runs,
54398
+ hasMore: false,
54399
+ nextCursor: null
54400
+ });
54340
54401
  return;
54341
54402
  }
54342
- const runs = data.data ?? [];
54343
54403
  if (runs.length === 0) {
54344
54404
  console.log("No runs found");
54345
54405
  return;
@@ -54366,7 +54426,7 @@ schedulesCommand.command("runs <id>").description("List run history for a schedu
54366
54426
  const [items, setItems] = useState(null);
54367
54427
  const [error, setError] = useState(null);
54368
54428
  useEffect(() => {
54369
- client.get(`/schedules/${id}/runs`).then((res) => setItems(res.data ?? [])).catch((err) => setError(err instanceof Error ? err : new Error(String(err))));
54429
+ fetchAllScheduleRuns(client, id).then(setItems).catch((err) => setError(err instanceof Error ? err : new Error(String(err))));
54370
54430
  }, []);
54371
54431
  return React.createElement(DataList, {
54372
54432
  title: "Schedule Runs",
@@ -60022,11 +60082,13 @@ function parseEventName(value) {
60022
60082
  if (value === void 0 || isProductEventName(value)) return value;
60023
60083
  throw new Error(`Unknown event type "${value}". Known types: ${PRODUCT_EVENT_NAMES.join(", ")}`);
60024
60084
  }
60085
+ /** `--request` filters only this event, and a key with no event scope may read it only by name. */
60086
+ const API_KEY_REQUEST_DECIDED_EVENT = "runtype.api_key_request.decided";
60025
60087
  /** Query string for one GET /events call; `after` omitted asks the API for the head cursor. */
60026
60088
  function buildEventsQuery(options, after) {
60027
60089
  const params = new URLSearchParams();
60028
60090
  const entries = [
60029
- ["name", options.name],
60091
+ ["name", options.name ?? (options.request ? API_KEY_REQUEST_DECIDED_EVENT : void 0)],
60030
60092
  ["agentId", options.agent],
60031
60093
  ["flowId", options.flow],
60032
60094
  ["productId", options.product],
@@ -60035,6 +60097,7 @@ function buildEventsQuery(options, after) {
60035
60097
  ["suiteId", options.suite],
60036
60098
  ["simulationId", options.simulation],
60037
60099
  ["taskId", options.task],
60100
+ ["requestId", options.request],
60038
60101
  ["key", options.key],
60039
60102
  ["onlyRegressions", options.onlyRegressions ? "true" : void 0],
60040
60103
  ["after", after],
@@ -60202,7 +60265,7 @@ const eventsCommand = new Command("events").description("Watch product events (f
60202
60265
  eventsCommand.command("types").description("List the product event types you can watch").option("--json", "Output as JSON").option("--no-color", "Disable color output").action(async (options) => {
60203
60266
  await runTypes(options);
60204
60267
  });
60205
- eventsCommand.command("watch").description("Long-poll product events and print one line per event").option("--name <name>", "Event type to watch (default: every type; see `runtype events types`)").option("--agent <id>", "Filter by agent ID").option("--flow <id>", "Filter by flow ID").option("--product <id>", "Filter by product ID").option("--surface <id>", "Filter by surface ID").option("--schedule <id>", "Filter by schedule ID").option("--suite <id>", "Filter by eval suite ID").option("--simulation <id>", "Filter by simulation ID").option("--task <id>", "Filter by delegated task ID").option("--key <key>", "Signal events: only this signal key, such as tool_error").option("--only-regressions", "Eval runs: only those whose pass rate dropped").option("--since <cursor>", "Start after this cursor, or \"now\" (default)").option("--json", "Output NDJSON: one event object per line on stdout").option("--once", "Exit after the first poll that returns events").option("--no-color", "Disable color output").action(async (options) => {
60268
+ eventsCommand.command("watch").description("Long-poll product events and print one line per event").option("--name <name>", "Event type to watch (default: every type; see `runtype events types`)").option("--agent <id>", "Filter by agent ID").option("--flow <id>", "Filter by flow ID").option("--product <id>", "Filter by product ID").option("--surface <id>", "Filter by surface ID").option("--schedule <id>", "Filter by schedule ID").option("--suite <id>", "Filter by eval suite ID").option("--simulation <id>", "Filter by simulation ID").option("--task <id>", "Filter by delegated task ID").option("--request <id>", "Filter by API key request ID").option("--key <key>", "Signal events: only this signal key, such as tool_error").option("--only-regressions", "Eval runs: only those whose pass rate dropped").option("--since <cursor>", "Start after this cursor, or \"now\" (default)").option("--json", "Output NDJSON: one event object per line on stdout").option("--once", "Exit after the first poll that returns events").option("--no-color", "Disable color output").action(async (options) => {
60206
60269
  await runWatch(options);
60207
60270
  });
60208
60271
  // src/commands/validate-product.ts
@@ -62752,7 +62815,7 @@ function h$2(e, t) {
62752
62815
  }
62753
62816
  }
62754
62817
  }
62755
- // ../mcp-cli/dist/chunk-CL8BNzsR.mjs
62818
+ // ../mcp-cli/dist/chunk-Ce22LqPV.mjs
62756
62819
  const i = /* @__PURE__ */ new Set([
62757
62820
  `approvals`,
62758
62821
  `auth`,
@@ -62799,7 +62862,10 @@ function l(e, t = {}) {
62799
62862
  for (let i of e) {
62800
62863
  if (a.has(i.name)) continue;
62801
62864
  let e = Object.prototype.hasOwnProperty.call(t, i.name) ? t[i.name] : void 0, c = s(i, e), l = {
62802
- tool: i,
62865
+ tool: e?.description ? {
62866
+ ...i,
62867
+ description: e.description
62868
+ } : i,
62803
62869
  path: c,
62804
62870
  aliases: [],
62805
62871
  hidden: e?.hidden === !0,
@@ -63090,16 +63156,16 @@ function te(e) {
63090
63156
  required: Array.isArray(t.required) ? t.required.filter((e) => typeof e == `string` && Object.hasOwn(i, e)) : []
63091
63157
  };
63092
63158
  }
63093
- function C$1(e, t) {
63159
+ function ne(e, t) {
63094
63160
  let n = (Array.isArray(t.anyOf) ? t.anyOf : Array.isArray(t.oneOf) ? t.oneOf : []).filter((e) => u(e) && !v$1(e));
63095
63161
  return n.length === 1 ? g$1(e, n[0]).schema : t;
63096
63162
  }
63097
- function w$1(e, t) {
63163
+ function re(e, t) {
63098
63164
  let n = e;
63099
63165
  for (let r of t) {
63100
63166
  let { schema: t, recursive: i } = g$1(e, n);
63101
63167
  if (i) return;
63102
- let a = C$1(e, t);
63168
+ let a = ne(e, t);
63103
63169
  if (r === `[]`) {
63104
63170
  if (!u(a.items)) return;
63105
63171
  n = a.items;
@@ -63109,11 +63175,11 @@ function w$1(e, t) {
63109
63175
  }
63110
63176
  return S$1(e, n);
63111
63177
  }
63112
- const T$1 = /* @__PURE__ */ new Set(/* @__PURE__ */ `answers.approvals.approve.approve-all.color.deny.detach.dry-run.example.field.help.help-all.input.json.json-body.jsonl.max-output.no-color.no-input.output.profile.raw-field.raw-strings.save.stream.timeout.token.verbose.wait.yes`.split(`.`));
63113
- function E$1(e) {
63178
+ const C$1 = /* @__PURE__ */ new Set(/* @__PURE__ */ `answers.approvals.approve.approve-all.color.deny.detach.dry-run.example.field.help.help-all.input.json.json-body.jsonl.max-output.no-color.no-input.output.profile.raw-field.raw-strings.save.stream.timeout.token.verbose.wait.yes`.split(`.`));
63179
+ function w$1(e) {
63114
63180
  return e.kind === `string` || e.kind === `enum` || e.kind === `binary`;
63115
63181
  }
63116
- function D$1(e, t) {
63182
+ function T$1(e, t) {
63117
63183
  let r = e.inputSchema ?? {}, i = te(r);
63118
63184
  if (!i) return {
63119
63185
  tool: e,
@@ -63132,21 +63198,23 @@ function D$1(e, t) {
63132
63198
  let u = S$1(r, t);
63133
63199
  if (u.readOnly) continue;
63134
63200
  if (u.kind === `const`) {
63135
- O$1(a, e, u.constValue);
63201
+ E$1(a, e, u.constValue);
63136
63202
  continue;
63137
63203
  }
63138
63204
  let d = e$1(e) || e, f = d;
63139
- if (T$1.has(f) || (l.get(d) ?? 0) > 1 || c.has(f)) for (f = `arg-${d}`, (c.has(f) || (l.get(d) ?? 0) > 1) && (f = `arg-${e}`); c.has(f);) f = `arg-${f}`;
63140
- c.add(f), s.push({
63205
+ if (C$1.has(f) || (l.get(d) ?? 0) > 1 || c.has(f)) for (f = `arg-${d}`, (c.has(f) || (l.get(d) ?? 0) > 1) && (f = `arg-${e}`); c.has(f);) f = `arg-${f}`;
63206
+ c.add(f);
63207
+ let p = i.required.includes(e);
63208
+ p && u.hasDefault && !Object.hasOwn(o, e) && E$1(o, e, u.defaultValue), s.push({
63141
63209
  wire: e,
63142
63210
  flag: f,
63143
63211
  field: u,
63144
- required: i.required.includes(e) && !u.hasDefault && !Object.hasOwn(o, e),
63212
+ required: p && !Object.hasOwn(o, e),
63145
63213
  hidden: u.deprecated
63146
63214
  });
63147
63215
  }
63148
63216
  let u = new Map(s.map((e) => [e.wire, e])), d = [];
63149
- if (t?.positional && t.positional.length > 0) d = t.positional.map((e) => u.get(e)).filter((e) => e !== void 0 && E$1(e.field));
63217
+ if (t?.positional && t.positional.length > 0) d = t.positional.map((e) => u.get(e)).filter((e) => e !== void 0 && w$1(e.field));
63150
63218
  else {
63151
63219
  let e = s.filter((e) => e.required);
63152
63220
  e.length === 1 && e[0].field.kind === `string` && (d = e);
@@ -63165,7 +63233,7 @@ function D$1(e, t) {
63165
63233
  required: s.filter((e) => e.required).map((e) => e.wire)
63166
63234
  };
63167
63235
  }
63168
- function O$1(e, t, n) {
63236
+ function E$1(e, t, n) {
63169
63237
  Object.defineProperty(e, t, {
63170
63238
  value: n,
63171
63239
  enumerable: !0,
@@ -63173,14 +63241,14 @@ function O$1(e, t, n) {
63173
63241
  writable: !0
63174
63242
  });
63175
63243
  }
63176
- function k$1(e) {
63244
+ function D$1(e) {
63177
63245
  return e?.startsWith(`\0`) === !0;
63178
63246
  }
63179
- function A$1(t, n) {
63247
+ function O$1(t, n) {
63180
63248
  let r = n.slice(1), i = t.startsWith(`--`) ? `${t}=${r}` : `${t}${r}`;
63181
63249
  return new n$2(`usage`, `${t} needs a value, but the word after it, ${r}, is a global flag`, `Write ${i} to pass it as the value, or put ${r} after the value`);
63182
63250
  }
63183
- const j$1 = /* @__PURE__ */ new Set([
63251
+ const k$1 = /* @__PURE__ */ new Set([
63184
63252
  `auto`,
63185
63253
  `json`,
63186
63254
  `text`,
@@ -63188,7 +63256,7 @@ const j$1 = /* @__PURE__ */ new Set([
63188
63256
  `ndjson`,
63189
63257
  `table`
63190
63258
  ]);
63191
- const M$1 = /* @__PURE__ */ new Set([
63259
+ const A$1 = /* @__PURE__ */ new Set([
63192
63260
  `output`,
63193
63261
  `timeout`,
63194
63262
  `save`,
@@ -63204,34 +63272,34 @@ const M$1 = /* @__PURE__ */ new Set([
63204
63272
  `wait`,
63205
63273
  `stream`
63206
63274
  ]);
63207
- const N$1 = /* @__PURE__ */ new Set([
63275
+ const j$1 = /* @__PURE__ */ new Set([
63208
63276
  `auto`,
63209
63277
  `raw`,
63210
63278
  `off`
63211
63279
  ]);
63212
- const re = /* @__PURE__ */ new Set([
63280
+ const M$1 = /* @__PURE__ */ new Set([
63213
63281
  `prompt`,
63214
63282
  `fail`,
63215
63283
  `deny`
63216
63284
  ]);
63217
- const P$1 = {
63285
+ const N$1 = {
63218
63286
  h: `help`,
63219
63287
  o: `output`,
63220
63288
  y: `yes`,
63221
63289
  f: `raw-field`,
63222
63290
  F: `field`
63223
63291
  };
63224
- function F(e) {
63292
+ function P$1(e) {
63225
63293
  return e.field.kind === `scalar-array` || e.field.kind === `object-array` || e.field.kind === `map`;
63226
63294
  }
63227
- function I(t, n) {
63295
+ function F(t, n) {
63228
63296
  let r = /^(\d+(?:\.\d+)?)(ms|s|m|h)?$/.exec(t.trim());
63229
63297
  if (!r) throw new n$2(`invalid_value`, `${n} expects a duration such as 30000, 30s or 5m`);
63230
63298
  let i = Number(r[1]), a = r[2] ?? `ms`, o = Math.round(i * (a === `h` ? 36e5 : a === `m` ? 6e4 : a === `s` ? 1e3 : 1));
63231
63299
  if (o <= 0) throw new n$2(`invalid_value`, `${n} must be greater than zero`);
63232
63300
  return o;
63233
63301
  }
63234
- function ie(t) {
63302
+ function I(t) {
63235
63303
  if (t === `0` || t === `none` || t === `unlimited`) return null;
63236
63304
  if (!/^\d+$/.test(t)) throw new n$2(`invalid_value`, `--max-output expects a character count, or 0 for unlimited`);
63237
63305
  return Number(t);
@@ -63260,11 +63328,11 @@ function ae(t, n) {
63260
63328
  if (s.has(t)) throw new n$2(`usage`, `--${t} was given more than once`);
63261
63329
  switch (s.add(t), t) {
63262
63330
  case `output`:
63263
- if (!j$1.has(n)) throw new n$2(`invalid_value`, `--output must be one of ${[...j$1].join(`, `)}`);
63331
+ if (!k$1.has(n)) throw new n$2(`invalid_value`, `--output must be one of ${[...k$1].join(`, `)}`);
63264
63332
  r.output = L(r.output, n);
63265
63333
  return;
63266
63334
  case `timeout`:
63267
- r.timeoutMs = I(n, `--timeout`);
63335
+ r.timeoutMs = F(n, `--timeout`);
63268
63336
  return;
63269
63337
  case `save`:
63270
63338
  r.save = n;
@@ -63276,10 +63344,10 @@ function ae(t, n) {
63276
63344
  r.jsonBody = n;
63277
63345
  return;
63278
63346
  case `max-output`:
63279
- r.maxOutput = ie(n);
63347
+ r.maxOutput = I(n);
63280
63348
  return;
63281
63349
  case `approvals`:
63282
- if (!re.has(n)) throw new n$2(`invalid_value`, `--approvals must be prompt, fail or deny`);
63350
+ if (!M$1.has(n)) throw new n$2(`invalid_value`, `--approvals must be prompt, fail or deny`);
63283
63351
  r.approvals = n;
63284
63352
  return;
63285
63353
  case `answers`:
@@ -63289,7 +63357,7 @@ function ae(t, n) {
63289
63357
  r.wait = n;
63290
63358
  return;
63291
63359
  case `stream`:
63292
- if (!N$1.has(n)) throw new n$2(`invalid_value`, `--stream must be auto, raw or off`);
63360
+ if (!j$1.has(n)) throw new n$2(`invalid_value`, `--stream must be auto, raw or off`);
63293
63361
  r.stream = n;
63294
63362
  return;
63295
63363
  }
@@ -63310,7 +63378,7 @@ function ae(t, n) {
63310
63378
  }
63311
63379
  }, u = (t, n) => {
63312
63380
  let r = i.get(t) ?? [];
63313
- if (r.length > 0 && !F(t)) throw new n$2(`usage`, `--${t.flag} was given more than once`, oe(t));
63381
+ if (r.length > 0 && !P$1(t)) throw new n$2(`usage`, `--${t.flag} was given more than once`, oe(t));
63314
63382
  r.push(n), i.set(t, r);
63315
63383
  }, d = (t, n) => {
63316
63384
  if (a.has(t)) throw new n$2(`usage`, `--${t.flag} was given more than once`);
@@ -63318,7 +63386,7 @@ function ae(t, n) {
63318
63386
  };
63319
63387
  for (let r = 0; r < t.length; r += 1) {
63320
63388
  let i = t[r];
63321
- if (!k$1(i)) {
63389
+ if (!D$1(i)) {
63322
63390
  if (i === `--`) {
63323
63391
  o.push(...t.slice(r + 1));
63324
63392
  break;
@@ -63326,7 +63394,7 @@ function ae(t, n) {
63326
63394
  if (i.startsWith(`--`) && i.length > 2) {
63327
63395
  let a = i.indexOf(`=`), o = a === -1 ? i.slice(2) : i.slice(2, a), s = a === -1 ? void 0 : i.slice(a + 1), f = () => {
63328
63396
  if (s !== void 0) return s;
63329
- if (k$1(t[r + 1])) throw A$1(i, t[r + 1]);
63397
+ if (D$1(t[r + 1])) throw O$1(i, t[r + 1]);
63330
63398
  if (r + 1 >= t.length) throw new n$2(`missing_argument`, `--${o} needs a value`);
63331
63399
  return r += 1, t[r];
63332
63400
  }, p = n.byFlag.get(o);
@@ -63342,7 +63410,7 @@ function ae(t, n) {
63342
63410
  continue;
63343
63411
  }
63344
63412
  }
63345
- if (M$1.has(o)) {
63413
+ if (A$1.has(o)) {
63346
63414
  c(o, f());
63347
63415
  continue;
63348
63416
  }
@@ -63350,13 +63418,13 @@ function ae(t, n) {
63350
63418
  throw R(o, n);
63351
63419
  }
63352
63420
  if (i.startsWith(`-`) && i.length > 1 && !/^-\d/.test(i)) {
63353
- let a = i.slice(1, 2), o = P$1[a];
63421
+ let a = i.slice(1, 2), o = N$1[a];
63354
63422
  if (!o) throw R(i.slice(1), n);
63355
63423
  let s = i.slice(2);
63356
- if (M$1.has(o)) {
63424
+ if (A$1.has(o)) {
63357
63425
  let n = s;
63358
63426
  if (n === ``) {
63359
- if (k$1(t[r + 1])) throw A$1(i, t[r + 1]);
63427
+ if (D$1(t[r + 1])) throw O$1(i, t[r + 1]);
63360
63428
  if (r + 1 >= t.length) throw new n$2(`missing_argument`, `-${a} needs a value`);
63361
63429
  r += 1, n = t[r];
63362
63430
  }
@@ -63389,7 +63457,7 @@ function se(t, n) {
63389
63457
  throw new n$2(`invalid_value`, `${n} expects true or false, got ${JSON.stringify(t)}`);
63390
63458
  }
63391
63459
  function R(n, r) {
63392
- let a = n$1(n, [...r.flags.filter((e) => !e.hidden).map((e) => e.flag), ...T$1]);
63460
+ let a = n$1(n, [...r.flags.filter((e) => !e.hidden).map((e) => e.flag), ...C$1]);
63393
63461
  return new n$2(`unknown_flag`, `Unknown flag --${n} for ${r.tool.name}`, a.length > 0 ? `Did you mean ${a.map((e) => `--${e}`).join(`, `)}?` : `Run with --help to list flags`);
63394
63462
  }
63395
63463
  function z(e) {
@@ -63433,7 +63501,7 @@ function U(e, t, n = 0) {
63433
63501
  return a.length > 0 ? `{ ${a.join(`; `)} }` : `object`;
63434
63502
  }
63435
63503
  function W(e) {
63436
- let t = e.inputSchema ?? {}, n = D$1(e);
63504
+ let t = e.inputSchema ?? {}, n = T$1(e);
63437
63505
  if (n.bodyOnly) return r(`${e.name}(body: unknown)`);
63438
63506
  let i = n.flags.filter((e) => !e.hidden).map((e) => `${e.wire}${e.required ? `` : `?`}: ${V(e.field, t)}${e.field.nullable ? ` | null` : ``}`);
63439
63507
  return r(`${e.name}(${i.length > 0 ? `{ ${i.join(`; `)} }` : ``})`);
@@ -63456,7 +63524,7 @@ function de(e) {
63456
63524
  return r(`${e.map((e) => ` ${e.command.padEnd(t)} ${e.summary}${e.badges.length > 0 ? ` [${e.badges.join(`, `)}]` : ``}`.trimEnd()).join(`
63457
63525
  `)}\n`);
63458
63526
  }
63459
- // ../mcp-cli/dist/chunk-DqN1GrzM.mjs
63527
+ // ../mcp-cli/dist/chunk-BzzREe8T.mjs
63460
63528
  var p = class extends n$2 {};
63461
63529
  function m(e) {
63462
63530
  return typeof e == `object` && !!e && !Array.isArray(e);
@@ -63472,17 +63540,17 @@ function g(e) {
63472
63540
  if (Array.isArray(e)) return e.map(g);
63473
63541
  if (m(e)) {
63474
63542
  let t = {};
63475
- for (let [r, i] of Object.entries(e)) O$1(t, r, g(i));
63543
+ for (let [r, i] of Object.entries(e)) E$1(t, r, g(i));
63476
63544
  return t;
63477
63545
  }
63478
63546
  return e;
63479
63547
  }
63480
63548
  function _(e, t) {
63481
63549
  let r = {};
63482
- for (let [t, i] of Object.entries(e)) O$1(r, t, i);
63550
+ for (let [t, i] of Object.entries(e)) E$1(r, t, i);
63483
63551
  for (let [e, i] of Object.entries(t)) {
63484
63552
  let t = Object.prototype.hasOwnProperty.call(r, e) ? r[e] : void 0;
63485
- O$1(r, e, m(t) && m(i) ? _(t, i) : i);
63553
+ E$1(r, e, m(t) && m(i) ? _(t, i) : i);
63486
63554
  }
63487
63555
  return r;
63488
63556
  }
@@ -63594,7 +63662,7 @@ async function w(t, r, i) {
63594
63662
  if (r <= 0) throw new p(`invalid_value`, `${a} expects key=value`);
63595
63663
  let c = s.slice(0, r);
63596
63664
  if (Object.prototype.hasOwnProperty.call(t, c)) throw new n$2(`usage`, `${a} sets ${c} more than once`);
63597
- O$1(t, c, await C(o.item ?? o, s.slice(r + 1), `${a} ${c}`, i));
63665
+ E$1(t, c, await C(o.item ?? o, s.slice(r + 1), `${a} ${c}`, i));
63598
63666
  }
63599
63667
  return t;
63600
63668
  }
@@ -63624,7 +63692,7 @@ function T(t, n) {
63624
63692
  async function E(e, n, r, i) {
63625
63693
  let a = `${e.typed ? `-F` : `-f`} ${e.path.join(`.`)}`;
63626
63694
  if (!e.typed || r) return e.raw;
63627
- let s = w$1(n, e.append ? [...e.path, `[]`] : e.path), c = e.raw;
63695
+ let s = re(n, e.append ? [...e.path, `[]`] : e.path), c = e.raw;
63628
63696
  if (c.startsWith(`@@`)) c = c.slice(1);
63629
63697
  else if (c.startsWith(`@`)) {
63630
63698
  let e = await v(c, i, a);
@@ -63651,19 +63719,19 @@ function O(t, r, i) {
63651
63719
  let i = Object.prototype.hasOwnProperty.call(a, t) ? a[t] : void 0;
63652
63720
  if (i === void 0) {
63653
63721
  let e = {};
63654
- O$1(a, t, e), a = e;
63722
+ E$1(a, t, e), a = e;
63655
63723
  } else if (m(i)) a = i;
63656
63724
  else throw new n$2(`usage`, `-F ${r.path.join(`.`)} conflicts with a non-object value`);
63657
63725
  }
63658
63726
  let o = r.path[r.path.length - 1];
63659
63727
  if (r.append) {
63660
63728
  let t = Object.prototype.hasOwnProperty.call(a, o) ? a[o] : void 0, s = r.empty ? [] : [i];
63661
- if (t === void 0) O$1(a, o, s);
63729
+ if (t === void 0) E$1(a, o, s);
63662
63730
  else if (Array.isArray(t)) t.push(...s);
63663
63731
  else throw new n$2(`usage`, `-F ${o}[] conflicts with a non-array value`);
63664
63732
  } else {
63665
63733
  if (Object.prototype.hasOwnProperty.call(a, o)) throw new n$2(`usage`, `${r.path.join(`.`)} is set more than once by -f/-F`);
63666
- O$1(a, o, i);
63734
+ E$1(a, o, i);
63667
63735
  }
63668
63736
  }
63669
63737
  async function k(e, t) {
@@ -63745,12 +63813,12 @@ async function P(t, r, i) {
63745
63813
  for (let [a, o] of r.positionals.entries()) {
63746
63814
  let s = t.positionals[a], c = r.values.get(s);
63747
63815
  if (c && c.some((e) => e !== o)) throw new n$2(`usage`, `${s.wire} was given both positionally and as --${s.flag}, with different values`);
63748
- O$1(d, s.wire, await C(s.field, o, s.wire, i));
63816
+ E$1(d, s.wire, await C(s.field, o, s.wire, i));
63749
63817
  }
63750
- for (let [e, t] of r.values) O$1(d, e.wire, await w(e, t, i));
63751
- for (let [e, t] of r.booleans) O$1(d, e.wire, t);
63818
+ for (let [e, t] of r.values) E$1(d, e.wire, await w(e, t, i));
63819
+ for (let [e, t] of r.booleans) E$1(d, e.wire, t);
63752
63820
  u = _(u, d);
63753
- for (let [e, r] of [...Object.entries(t.constFields), ...Object.entries(t.defaults)]) Object.prototype.hasOwnProperty.call(u, e) || O$1(u, e, structuredClone(r));
63821
+ for (let [e, r] of [...Object.entries(t.constFields), ...Object.entries(t.defaults)]) Object.prototype.hasOwnProperty.call(u, e) || E$1(u, e, structuredClone(r));
63754
63822
  let f = t.required.filter((e) => !Object.prototype.hasOwnProperty.call(u, e));
63755
63823
  if (f.length > 0) {
63756
63824
  let e = f.map((e) => {
@@ -63779,7 +63847,7 @@ function toMcpCliArgv(options) {
63779
63847
  }
63780
63848
  /** Whether resolving these arguments will consume the process stdin stream; the parser that reads it decides. */
63781
63849
  function usesMcpStdin(options) {
63782
- const spec = D$1(SCHEMALESS);
63850
+ const spec = T$1(SCHEMALESS);
63783
63851
  try {
63784
63852
  return N(ae(toMcpCliArgv(options), spec), spec);
63785
63853
  } catch {
@@ -63809,8 +63877,8 @@ async function resolveMcpArguments(options, dependencies = {}) {
63809
63877
  },
63810
63878
  ...dependencies
63811
63879
  };
63812
- const toolSpec = D$1(deps.tool ?? SCHEMALESS);
63813
- const spec = toolSpec.bodyOnly ? D$1(SCHEMALESS) : {
63880
+ const toolSpec = T$1(deps.tool ?? SCHEMALESS);
63881
+ const spec = toolSpec.bodyOnly ? T$1(SCHEMALESS) : {
63814
63882
  ...toolSpec,
63815
63883
  required: [],
63816
63884
  positionals: []
@@ -70302,6 +70370,43 @@ function createHarnessCaptureFactory(options) {
70302
70370
  });
70303
70371
  return factory;
70304
70372
  }
70373
+ // ../shared/dist/simulation/reported-usage.mjs
70374
+ const amount = number$2().finite().nonnegative();
70375
+ const tokens = amount.int();
70376
+ /** Producer estimates for one turn, independent of Runtype's measured usage and billing. */
70377
+ const reportedUsageSchema = object$4({
70378
+ costUsd: amount.nullable(),
70379
+ completeness: _enum(["complete", "partial"]),
70380
+ scope: string$2().min(1).max(120),
70381
+ models: array(object$4({
70382
+ model: string$2().min(1).max(200),
70383
+ canonicalModel: string$2().min(1).max(200).optional(),
70384
+ provider: string$2().max(100).optional(),
70385
+ pricingBasis: _enum([
70386
+ "list",
70387
+ "managed",
70388
+ "unknown"
70389
+ ]).optional(),
70390
+ costUsd: amount.nullable().optional(),
70391
+ inputTokens: tokens.optional(),
70392
+ outputTokens: tokens.optional(),
70393
+ cacheReadInputTokens: tokens.optional(),
70394
+ cacheCreationInputTokens: tokens.optional()
70395
+ })).max(100).optional()
70396
+ });
70397
+ /** Known estimates and reporting coverage; a partial sum is never a whole-episode cost. */
70398
+ const selfReportedCostSchema = object$4({
70399
+ knownCostUsd: amount.nullable(),
70400
+ reportedTurns: tokens,
70401
+ totalTurns: tokens,
70402
+ completeTurns: tokens,
70403
+ unknownEpisodes: tokens.optional(),
70404
+ completeness: _enum([
70405
+ "complete",
70406
+ "partial",
70407
+ "unknown"
70408
+ ])
70409
+ });
70305
70410
  const simTerminationSchema = _enum([
70306
70411
  "goal_met",
70307
70412
  "gave_up",
@@ -70432,43 +70537,7 @@ const productKindSchema = _enum([
70432
70537
  "external",
70433
70538
  "spec_only"
70434
70539
  ]);
70435
- // ../shared/dist/chunk-CLmUyAjf.mjs
70436
- const amount = number$2().finite().nonnegative();
70437
- const tokens = amount.int();
70438
- /** Producer estimates for one turn, independent of Runtype's measured usage and billing. */
70439
- const reportedUsageSchema = object$4({
70440
- costUsd: amount.nullable(),
70441
- completeness: _enum(["complete", "partial"]),
70442
- scope: string$2().min(1).max(120),
70443
- models: array(object$4({
70444
- model: string$2().min(1).max(200),
70445
- canonicalModel: string$2().min(1).max(200).optional(),
70446
- provider: string$2().max(100).optional(),
70447
- pricingBasis: _enum([
70448
- "list",
70449
- "managed",
70450
- "unknown"
70451
- ]).optional(),
70452
- costUsd: amount.nullable().optional(),
70453
- inputTokens: tokens.optional(),
70454
- outputTokens: tokens.optional(),
70455
- cacheReadInputTokens: tokens.optional(),
70456
- cacheCreationInputTokens: tokens.optional()
70457
- })).max(100).optional()
70458
- });
70459
- /** Known estimates and reporting coverage; a partial sum is never a whole-episode cost. */
70460
- const selfReportedCostSchema = object$4({
70461
- knownCostUsd: amount.nullable(),
70462
- reportedTurns: tokens,
70463
- totalTurns: tokens,
70464
- completeTurns: tokens,
70465
- unknownEpisodes: tokens.optional(),
70466
- completeness: _enum([
70467
- "complete",
70468
- "partial",
70469
- "unknown"
70470
- ])
70471
- });
70540
+ // ../shared/dist/chunk-BobaAxaK.mjs
70472
70541
  /** The manifest file at the root of a candidate's source bundle. */
70473
70542
  const CANDIDATE_MANIFEST_FILENAME = "runtype-candidate.json";
70474
70543
  const candidateRuntimeSchema = _enum([
@@ -71044,7 +71113,8 @@ const targetRecordingSchema = object$4({
71044
71113
  enabled: boolean(),
71045
71114
  retentionDays: number$2().int().min(1).max(365)
71046
71115
  });
71047
- object$4({
71116
+ /** One target's recording policy as admission froze it into the run plan. */
71117
+ const frozenTargetRecordingSchema = object$4({
71048
71118
  mode: _enum([
71049
71119
  "off",
71050
71120
  "shape-only",
@@ -73164,10 +73234,18 @@ const draftSimulationToolsSchema = array(object$4({
73164
73234
  /** The tool's input JSON Schema as the target listed it; the drafting agent reads its parameters. */
73165
73235
  inputSchema: record$2(string$2(), unknown()).refine((schema) => jsonChars(schema) <= MAX_DRAFT_TOOL_INPUT_SCHEMA_CHARS, { message: `An inputSchema may take at most ${MAX_DRAFT_TOOL_INPUT_SCHEMA_CHARS} characters as JSON.` }).optional()
73166
73236
  })).min(1).max(1e3).refine((tools) => tools.reduce((sum, tool) => sum + (tool.inputSchema ? jsonChars(tool.inputSchema) : 0), 0) <= MAX_DRAFT_TOOL_INPUT_SCHEMAS_TOTAL_CHARS, { message: `The inputSchemas of one request may take at most ${MAX_DRAFT_TOOL_INPUT_SCHEMAS_TOTAL_CHARS} characters together.` });
73237
+ /** Harder tasks than a simulation already runs: each chains two or more tool calls, around the tools agents used least. */
73238
+ const draftHarderTasksSchema = object$4({
73239
+ /** Tools agents called least in a report; when any is listed, every task uses at least one of them. */
73240
+ focusTools: array(string$2().min(1).max(128)).max(12),
73241
+ /** The titles of the tasks the simulation already has; a task repeating one is turned back. */
73242
+ existingTitles: array(string$2().min(1).max(255)).max(200)
73243
+ });
73167
73244
  object$4({
73168
73245
  targetName: string$2().min(1).max(255),
73169
73246
  tools: draftSimulationToolsSchema,
73170
- count: number$2().int().min(1).max(12).optional()
73247
+ count: number$2().int().min(1).max(12).optional(),
73248
+ harder: draftHarderTasksSchema.optional()
73171
73249
  });
73172
73250
  /** One drafted task; every `expectedTools` name is one the request listed. */
73173
73251
  const draftedSimulationTaskSchema = object$4({
@@ -73282,11 +73360,18 @@ object$4({
73282
73360
  trials: number$2().int().min(1).max(10).optional(),
73283
73361
  trigger: simulationRunTriggerSchema.optional(),
73284
73362
  /** The variant the others are compared against: one of the run's variants, over the simulation's own baseline. */
73285
- baselineVariantId: entityId.optional()
73363
+ baselineVariantId: entityId.optional(),
73364
+ /**
73365
+ * A recording run: these server tools answer live on every variant, so the recorder keeps their real answers for
73366
+ * later replay. Every variant must be today's version (no overlay), and every target must record in `full`.
73367
+ */
73368
+ recordTools: array(string$2().min(1).max(255)).min(1).max(64).optional()
73286
73369
  });
73287
73370
  discriminatedUnion("dryRun", [object$4({
73288
73371
  dryRun: literal(true),
73289
- estimate: runEstimateSchema
73372
+ estimate: runEstimateSchema,
73373
+ /** How each variant target would record this run, keyed by target id: the kill switch, then the target (D1). */
73374
+ recording: record$2(string$2(), frozenTargetRecordingSchema).optional()
73290
73375
  }), object$4({
73291
73376
  dryRun: literal(false),
73292
73377
  runId: entityId,
@@ -73298,6 +73383,12 @@ const simulationRunResponseSchema = object$4({
73298
73383
  run: simulationRunSchema,
73299
73384
  reportId: entityId.nullable()
73300
73385
  });
73386
+ object$4({
73387
+ /** Comma-separated server tools; the response then counts this run's live calls to each that the recorder kept. */
73388
+ recordedCallsFor: string$2().max(4096).optional() });
73389
+ simulationRunResponseSchema.extend({
73390
+ /** Per tool named in `recordedCallsFor`: this run's live calls the recorder kept, 0 for a tool with none. */
73391
+ recordedCalls: record$2(string$2(), number$2().int()).optional() });
73301
73392
  object$4({ run: simulationRunSchema });
73302
73393
  simulationRunResponseSchema.extend({ repair: object$4({
73303
73394
  /** Episodes whose AI judge failed, graded again from their stored transcripts. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.57.0",
3
+ "version": "2.58.0",
4
4
  "description": "Command-line interface for Runtype AI platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -12,8 +12,8 @@
12
12
  "@modelcontextprotocol/client": "2.3.1",
13
13
  "@modelcontextprotocol/core": "2.3.1",
14
14
  "@napi-rs/keyring": "2.1.0",
15
- "@runtypelabs/ink-components": "0.3.13",
16
- "@runtypelabs/sdk": "11.17.0",
15
+ "@runtypelabs/ink-components": "0.3.14",
16
+ "@runtypelabs/sdk": "11.18.2",
17
17
  "@runtypelabs/terminal-animations": "0.2.4",
18
18
  "add-mcp": "2.6.0",
19
19
  "chalk": "^5.3.0",
@@ -37,10 +37,10 @@
37
37
  "devDependencies": {
38
38
  "@modelcontextprotocol/server": "2.3.1",
39
39
  "@runtypelabs/device-bridge": "0.2.5",
40
- "@runtypelabs/mcp-cli": "0.1.0",
41
- "@runtypelabs/model-execution": "0.41.6",
40
+ "@runtypelabs/mcp-cli": "0.2.1",
41
+ "@runtypelabs/model-execution": "0.41.8",
42
42
  "@runtypelabs/persona": "4.34.0",
43
- "@runtypelabs/shared": "3.110.0",
43
+ "@runtypelabs/shared": "3.113.0",
44
44
  "@types/express": "^5.0.6",
45
45
  "@types/micromatch": "^4.0.9",
46
46
  "@types/node": "^25.3.3",