@runtypelabs/cli 2.57.1 → 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 +51 -12
  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
@@ -28103,7 +28103,8 @@ const PRODUCT_EVENT_NAMES = [
28103
28103
  "runtype.task.failed",
28104
28104
  "runtype.task.cancelled",
28105
28105
  "runtype.signal.fired",
28106
- "runtype.signal.cluster_appeared"
28106
+ "runtype.signal.cluster_appeared",
28107
+ "runtype.api_key_request.decided"
28107
28108
  ];
28108
28109
  const PRODUCT_EVENT_DEFAULT_NEXT_POLL_MS = 5e3;
28109
28110
  const PRODUCT_EVENT_MAX_WAIT_MS = 5e4;
@@ -28123,6 +28124,7 @@ const ProductEventFilterFieldSchemas = {
28123
28124
  suiteId: resourceId("Only occurrences for this eval suite"),
28124
28125
  simulationId: resourceId("Only occurrences for this simulation"),
28125
28126
  taskId: resourceId("Only occurrences for this delegated task"),
28127
+ requestId: resourceId("Only occurrences for this API key request"),
28126
28128
  key: string$2().min(1).max(64).describe("Only signal occurrences for this signal key, such as tool_error"),
28127
28129
  onlyRegressions: boolean().describe("Only eval runs whose pass rate dropped below the previous run"),
28128
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")
@@ -28166,6 +28168,7 @@ const SignalClusterAppearedArgumentsSchema = object$4({
28166
28168
  agentId: filter.agentId.optional(),
28167
28169
  key: filter.key.optional()
28168
28170
  }).strict();
28171
+ const ApiKeyRequestDecidedArgumentsSchema = object$4({ requestId: filter.requestId.optional() }).strict();
28169
28172
  object$4({
28170
28173
  agentId: filter.agentId.optional(),
28171
28174
  flowId: filter.flowId.optional(),
@@ -28175,6 +28178,7 @@ object$4({
28175
28178
  suiteId: filter.suiteId.optional(),
28176
28179
  simulationId: filter.simulationId.optional(),
28177
28180
  taskId: filter.taskId.optional(),
28181
+ requestId: filter.requestId.optional(),
28178
28182
  key: filter.key.optional(),
28179
28183
  onlyRegressions: filter.onlyRegressions.optional(),
28180
28184
  minIntervalMs: filter.minIntervalMs.optional()
@@ -28294,6 +28298,17 @@ const SignalClusterAppearedPayloadSchema = object$4({
28294
28298
  memberCount: number$2().int().min(0).describe("Answers in the cluster"),
28295
28299
  firstSeenAt: isoTimestamp("When the earliest member was seen")
28296
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
+ });
28297
28312
  const PRODUCT_EVENT_ARGUMENT_SCHEMAS = {
28298
28313
  "runtype.execution.failed": ExecutionFailedArgumentsSchema,
28299
28314
  "runtype.approval.requested": ApprovalRequestedArgumentsSchema,
@@ -28307,7 +28322,8 @@ const PRODUCT_EVENT_ARGUMENT_SCHEMAS = {
28307
28322
  "runtype.task.failed": DelegateTaskArgumentsSchema,
28308
28323
  "runtype.task.cancelled": DelegateTaskArgumentsSchema,
28309
28324
  "runtype.signal.fired": SignalFiredArgumentsSchema,
28310
- "runtype.signal.cluster_appeared": SignalClusterAppearedArgumentsSchema
28325
+ "runtype.signal.cluster_appeared": SignalClusterAppearedArgumentsSchema,
28326
+ "runtype.api_key_request.decided": ApiKeyRequestDecidedArgumentsSchema
28311
28327
  };
28312
28328
  const PRODUCT_EVENT_PAYLOAD_SCHEMAS = {
28313
28329
  "runtype.execution.failed": ExecutionFailedPayloadSchema,
@@ -28322,7 +28338,8 @@ const PRODUCT_EVENT_PAYLOAD_SCHEMAS = {
28322
28338
  "runtype.task.failed": TaskFailedPayloadSchema,
28323
28339
  "runtype.task.cancelled": TaskCancelledPayloadSchema,
28324
28340
  "runtype.signal.fired": SignalFiredPayloadSchema,
28325
- "runtype.signal.cluster_appeared": SignalClusterAppearedPayloadSchema
28341
+ "runtype.signal.cluster_appeared": SignalClusterAppearedPayloadSchema,
28342
+ "runtype.api_key_request.decided": ApiKeyRequestDecidedPayloadSchema
28326
28343
  };
28327
28344
  const PRODUCT_EVENT_DESCRIPTIONS = {
28328
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.",
@@ -28337,7 +28354,8 @@ const PRODUCT_EVENT_DESCRIPTIONS = {
28337
28354
  "runtype.task.failed": "A delegated task ended in failure.",
28338
28355
  "runtype.task.cancelled": "A delegated task was cancelled before it finished.",
28339
28356
  "runtype.signal.fired": "A trace signal fired on an agent turn, including the built-in failure facts every agent gets.",
28340
- "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."
28341
28359
  };
28342
28360
  /** API-key scopes that may read each event; holding any one of them is enough. */
28343
28361
  const PRODUCT_EVENT_REQUIRED_SCOPES = {
@@ -28357,7 +28375,8 @@ const PRODUCT_EVENT_REQUIRED_SCOPES = {
28357
28375
  "runtype.task.failed": ["DELEGATE_TASKS:READ", "DELEGATE_TASKS:WRITE"],
28358
28376
  "runtype.task.cancelled": ["DELEGATE_TASKS:READ", "DELEGATE_TASKS:WRITE"],
28359
28377
  "runtype.signal.fired": ["SIGNALS:READ", "SIGNALS:WRITE"],
28360
- "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"]
28361
28380
  };
28362
28381
  /** Derive a draft-07 JSON Schema object from a Zod object, without the `$schema` marker. */
28363
28382
  function productEventJsonSchema(schema) {
@@ -54161,6 +54180,20 @@ modelsCommand.command("usage").description("Show model usage statistics").option
54161
54180
  process.exit(1);
54162
54181
  }
54163
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
+ }
54164
54197
  // src/commands/schedules.ts
54165
54198
  const schedulesCommand = new Command("schedules").description("Manage schedules");
54166
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) => {
@@ -54358,12 +54391,15 @@ schedulesCommand.command("runs <id>").description("List run history for a schedu
54358
54391
  const client = createCliClient(apiKey);
54359
54392
  if (!isTTY(options) || options.json) {
54360
54393
  try {
54361
- const data = await client.get(`/schedules/${id}/runs`);
54394
+ const runs = await fetchAllScheduleRuns(client, id);
54362
54395
  if (options.json) {
54363
- printJson(data);
54396
+ printJson({
54397
+ data: runs,
54398
+ hasMore: false,
54399
+ nextCursor: null
54400
+ });
54364
54401
  return;
54365
54402
  }
54366
- const runs = data.data ?? [];
54367
54403
  if (runs.length === 0) {
54368
54404
  console.log("No runs found");
54369
54405
  return;
@@ -54390,7 +54426,7 @@ schedulesCommand.command("runs <id>").description("List run history for a schedu
54390
54426
  const [items, setItems] = useState(null);
54391
54427
  const [error, setError] = useState(null);
54392
54428
  useEffect(() => {
54393
- 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))));
54394
54430
  }, []);
54395
54431
  return React.createElement(DataList, {
54396
54432
  title: "Schedule Runs",
@@ -60046,11 +60082,13 @@ function parseEventName(value) {
60046
60082
  if (value === void 0 || isProductEventName(value)) return value;
60047
60083
  throw new Error(`Unknown event type "${value}". Known types: ${PRODUCT_EVENT_NAMES.join(", ")}`);
60048
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";
60049
60087
  /** Query string for one GET /events call; `after` omitted asks the API for the head cursor. */
60050
60088
  function buildEventsQuery(options, after) {
60051
60089
  const params = new URLSearchParams();
60052
60090
  const entries = [
60053
- ["name", options.name],
60091
+ ["name", options.name ?? (options.request ? API_KEY_REQUEST_DECIDED_EVENT : void 0)],
60054
60092
  ["agentId", options.agent],
60055
60093
  ["flowId", options.flow],
60056
60094
  ["productId", options.product],
@@ -60059,6 +60097,7 @@ function buildEventsQuery(options, after) {
60059
60097
  ["suiteId", options.suite],
60060
60098
  ["simulationId", options.simulation],
60061
60099
  ["taskId", options.task],
60100
+ ["requestId", options.request],
60062
60101
  ["key", options.key],
60063
60102
  ["onlyRegressions", options.onlyRegressions ? "true" : void 0],
60064
60103
  ["after", after],
@@ -60226,7 +60265,7 @@ const eventsCommand = new Command("events").description("Watch product events (f
60226
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) => {
60227
60266
  await runTypes(options);
60228
60267
  });
60229
- 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) => {
60230
60269
  await runWatch(options);
60231
60270
  });
60232
60271
  // src/commands/validate-product.ts
@@ -63485,7 +63524,7 @@ function de(e) {
63485
63524
  return r(`${e.map((e) => ` ${e.command.padEnd(t)} ${e.summary}${e.badges.length > 0 ? ` [${e.badges.join(`, `)}]` : ``}`.trimEnd()).join(`
63486
63525
  `)}\n`);
63487
63526
  }
63488
- // ../mcp-cli/dist/chunk-BRgLEWMS.mjs
63527
+ // ../mcp-cli/dist/chunk-BzzREe8T.mjs
63489
63528
  var p = class extends n$2 {};
63490
63529
  function m(e) {
63491
63530
  return typeof e == `object` && !!e && !Array.isArray(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/cli",
3
- "version": "2.57.1",
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.18.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.2.0",
41
- "@runtypelabs/model-execution": "0.41.7",
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.111.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",