@belvador/mcp 0.6.0 → 0.7.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 (2) hide show
  1. package/dist/cli.js +490 -418
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -255,7 +255,7 @@ function docsFetcher(siteUrl, fetcher = fetch, now = () => Date.now()) {
255
255
  import { CLIENT_CAPABILITIES_META_KEY, inputRequired, McpServer } from "@modelcontextprotocol/server";
256
256
 
257
257
  // ../src/shared/contracts/mcp-tools.ts
258
- import { z as z31 } from "zod";
258
+ import { z as z32 } from "zod";
259
259
 
260
260
  // ../src/shared/contracts/api-ops/access.ts
261
261
  import { z as z3 } from "zod";
@@ -1236,7 +1236,7 @@ var TELEMETRY_PLAN_DEFAULTS = {
1236
1236
  // ../src/shared/contracts/vocab/metrics.ts
1237
1237
  var METRIC_TYPES = ["gauge", "sum", "histogram", "exp_histogram"];
1238
1238
  var METRIC_KINDS = ["gauge", "counter", "histogram", "exp_histogram"];
1239
- var METRIC_AGGREGATIONS = ["avg", "sum", "min", "max", "count", "rate", "p50", "p90", "p95", "p99"];
1239
+ var METRIC_AGGREGATIONS = ["avg", "sum", "min", "max", "count", "rate", "p50", "p75", "p90", "p95", "p99"];
1240
1240
  var METRIC_NAME_RE = /^[A-Za-z_][A-Za-z0-9_.:\-/]{0,254}$/;
1241
1241
  var METRIC_ATTR_KEY_RE = /^[A-Za-z0-9_.:\-/@]{1,256}$/;
1242
1242
  var METRIC_GROUP_BY_MAX = 2;
@@ -3129,7 +3129,7 @@ var MONITOR_OPERATIONS = [
3129
3129
  ];
3130
3130
 
3131
3131
  // ../src/shared/contracts/api-ops/node-data.ts
3132
- import { z as z22 } from "zod";
3132
+ import { z as z23 } from "zod";
3133
3133
 
3134
3134
  // ../src/shared/contracts/release-health.ts
3135
3135
  import { z as z21 } from "zod";
@@ -3387,175 +3387,234 @@ var fixStatusSchema = z21.object({
3387
3387
  verify_hours: z21.number()
3388
3388
  });
3389
3389
 
3390
+ // ../src/shared/contracts/web-vitals.ts
3391
+ import { z as z22 } from "zod";
3392
+
3393
+ // ../src/shared/contracts/vocab/web-vitals.ts
3394
+ var WEB_VITAL_NAMES = ["LCP", "INP", "CLS", "FCP", "TTFB"];
3395
+ var WEB_VITAL_RATINGS = ["good", "needs-improvement", "poor"];
3396
+ var WEB_VITAL_PATH_MAX_CHARS = 200;
3397
+
3398
+ // ../src/shared/contracts/web-vitals.ts
3399
+ var WEB_VITAL_LIMITS = {
3400
+ routesMax: 200,
3401
+ routesShown: 20,
3402
+ attributionShown: 10,
3403
+ estimateBelow: 100,
3404
+ defaultSampleRate: 0.1,
3405
+ targetMaxChars: 100,
3406
+ pathMaxChars: WEB_VITAL_PATH_MAX_CHARS,
3407
+ maxWindowMs: 7 * 24 * 3600 * 1000,
3408
+ defaultWindowMs: 24 * 3600 * 1000
3409
+ };
3410
+ var ratingCounts = z22.object({
3411
+ good: z22.number().int().nonnegative(),
3412
+ needs_improvement: z22.number().int().nonnegative(),
3413
+ poor: z22.number().int().nonnegative()
3414
+ });
3415
+ var webVitalSummarySchema = z22.object({
3416
+ name: z22.enum(WEB_VITAL_NAMES),
3417
+ metric: z22.string(),
3418
+ unit: z22.enum(["ms", "1"]),
3419
+ samples: z22.number().int().nonnegative(),
3420
+ p75: z22.number().nullable(),
3421
+ rating: z22.enum(WEB_VITAL_RATINGS).nullable(),
3422
+ estimate: z22.boolean(),
3423
+ ratings: ratingCounts,
3424
+ distribution: z22.array(z22.object({ le: z22.number().nullable(), count: z22.number().int().nonnegative() })),
3425
+ routes: z22.array(z22.object({
3426
+ path: z22.string(),
3427
+ samples: z22.number().int().nonnegative(),
3428
+ p75: z22.number().nullable(),
3429
+ rating: z22.enum(WEB_VITAL_RATINGS).nullable()
3430
+ })),
3431
+ routes_total: z22.number().int().nonnegative(),
3432
+ attribution: z22.array(z22.object({ target: z22.string(), samples: z22.number().int().nonnegative(), p75: z22.number().nullable() }))
3433
+ });
3434
+ var webVitalsSummarySchema = z22.object({
3435
+ from: z22.string(),
3436
+ to: z22.string(),
3437
+ path: z22.string().nullable(),
3438
+ vitals: z22.array(webVitalSummarySchema),
3439
+ complete: z22.boolean()
3440
+ });
3441
+
3390
3442
  // ../src/shared/contracts/api-ops/node-data.ts
3391
- var issueId = z22.number().int().positive();
3392
- var csv = z22.string().min(1).max(2000);
3393
- var name2 = z22.string().min(1).max(256);
3394
- var period = z22.enum(["1h", "24h", "7d", "14d", "30d"]);
3395
- var nodeCursor = z22.string().min(1).max(600).optional();
3443
+ var issueId = z23.number().int().positive();
3444
+ var csv = z23.string().min(1).max(2000);
3445
+ var projectIds2 = z23.string().max(2000).regex(/^[1-9][0-9]{0,15}(?:,[1-9][0-9]{0,15}){0,99}$/, "comma-separated project ids");
3446
+ var name2 = z23.string().min(1).max(256);
3447
+ var period = z23.enum(["1h", "24h", "7d", "14d", "30d"]);
3448
+ var nodeCursor = z23.string().min(1).max(600).optional();
3396
3449
  var windowFields = {
3397
- start: z22.string().max(40).optional(),
3398
- end: z22.string().max(40).optional()
3450
+ start: z23.string().max(40).optional(),
3451
+ end: z23.string().max(40).optional()
3399
3452
  };
3400
- var traceId = z22.string().regex(/^[0-9a-fA-F]{32}$/);
3401
- var spanId = z22.string().regex(/^[0-9a-fA-F]{16}$/);
3402
- var attrs = z22.string().max(2000).optional();
3453
+ var traceId = z23.string().regex(/^[0-9a-fA-F]{32}$/);
3454
+ var spanId = z23.string().regex(/^[0-9a-fA-F]{16}$/);
3455
+ var attrs = z23.string().max(2000).optional();
3403
3456
  var telemetryCommon = {
3404
3457
  ...windowFields,
3405
- project: csv.optional(),
3458
+ project: projectIds2.optional(),
3406
3459
  environment: csv.optional(),
3407
3460
  service: csv.optional(),
3408
3461
  attrs
3409
3462
  };
3410
- var issueChange = z22.union([
3411
- z22.object({
3412
- action: z22.literal("resolve"),
3413
- inNextRelease: z22.boolean().optional(),
3463
+ var issueChange = z23.union([
3464
+ z23.object({
3465
+ action: z23.literal("resolve"),
3466
+ inNextRelease: z23.boolean().optional(),
3414
3467
  inRelease: releaseNameSchema.optional()
3415
3468
  }),
3416
- z22.object({ action: z22.literal("unresolve") }),
3417
- z22.object({ action: z22.literal("archive"), mode: z22.enum(["until_escalating", "forever"]) }),
3418
- z22.object({
3419
- action: z22.literal("archive"),
3420
- mode: z22.literal("until_condition"),
3421
- events: z22.number().int().min(1).max(1e6).optional(),
3422
- users: z22.number().int().min(1).max(1e5).optional(),
3423
- until: z22.string().datetime().optional()
3424
- }),
3425
- z22.object({ action: z22.literal("assign"), userId: z22.guid().nullable() }),
3426
- z22.object({ action: z22.literal("priority"), priority: z22.enum(["low", "medium", "high"]) })
3469
+ z23.object({ action: z23.literal("unresolve") }),
3470
+ z23.object({ action: z23.literal("archive"), mode: z23.enum(["until_escalating", "forever"]) }),
3471
+ z23.object({
3472
+ action: z23.literal("archive"),
3473
+ mode: z23.literal("until_condition"),
3474
+ events: z23.number().int().min(1).max(1e6).optional(),
3475
+ users: z23.number().int().min(1).max(1e5).optional(),
3476
+ until: z23.string().datetime().optional()
3477
+ }),
3478
+ z23.object({ action: z23.literal("assign"), userId: z23.guid().nullable() }),
3479
+ z23.object({ action: z23.literal("priority"), priority: z23.enum(["low", "medium", "high"]) })
3427
3480
  ]);
3428
3481
  var NODE_INPUTS = {
3429
- issuesList: z22.object({
3430
- project: csv.optional(),
3431
- status: z22.enum(["unresolved", "resolved", "archived", "all"]).optional(),
3482
+ issuesList: z23.object({
3483
+ project: projectIds2.optional(),
3484
+ status: z23.enum(["unresolved", "resolved", "archived", "all"]).optional(),
3432
3485
  level: csv.optional(),
3433
3486
  priority: csv.optional(),
3434
3487
  environment: csv.optional(),
3435
3488
  release: csv.optional(),
3436
- assignee: z22.string().max(64).optional(),
3489
+ assignee: z23.string().max(64).optional(),
3437
3490
  period: period.optional(),
3438
- q: z22.string().max(200).optional(),
3439
- sort: z22.enum(["last_seen", "first_seen", "events", "users", "priority"]).optional(),
3491
+ q: z23.string().max(200).optional(),
3492
+ sort: z23.enum(["last_seen", "first_seen", "events", "users", "priority"]).optional(),
3440
3493
  cursor: nodeCursor,
3441
- limit: z22.number().int().min(1).max(100).optional()
3494
+ limit: z23.number().int().min(1).max(100).optional()
3442
3495
  }),
3443
- issue: z22.object({ issueId }),
3444
- issueStats: z22.object({ issueId, range: z22.enum(["24h", "30d"]).optional() }),
3445
- issueEvents: z22.object({ issueId, cursor: nodeCursor }),
3446
- issueEvent: z22.object({
3496
+ issue: z23.object({ issueId }),
3497
+ issueStats: z23.object({ issueId, range: z23.enum(["24h", "30d"]).optional() }),
3498
+ issueEvents: z23.object({ issueId, cursor: nodeCursor }),
3499
+ issueEvent: z23.object({
3447
3500
  issueId,
3448
- eventId: z22.string().regex(/^([0-9a-f]{32}|latest|oldest)$/)
3501
+ eventId: z23.string().regex(/^([0-9a-f]{32}|latest|oldest)$/)
3449
3502
  }),
3450
- issueUpdate: z22.object({ issueId, change: issueChange }),
3451
- issuesBulk: z22.object({
3452
- issueIds: z22.array(issueId).min(1).max(100),
3503
+ issueUpdate: z23.object({ issueId, change: issueChange }),
3504
+ issuesBulk: z23.object({
3505
+ issueIds: z23.array(issueId).min(1).max(100),
3453
3506
  action: issueChange
3454
3507
  }),
3455
- spansList: z22.object({
3508
+ spansList: z23.object({
3456
3509
  ...telemetryCommon,
3457
- operation: z22.string().min(1).max(1024).optional(),
3458
- status: z22.enum(["unset", "ok", "error"]).optional(),
3459
- kind: z22.enum(["internal", "server", "client", "producer", "consumer"]).optional(),
3460
- minDurationMs: z22.number().min(0).max(86400000).optional(),
3461
- maxDurationMs: z22.number().min(0).max(86400000).optional(),
3462
- mode: z22.enum(["spans", "traces"]).optional(),
3510
+ operation: z23.string().min(1).max(1024).optional(),
3511
+ status: z23.enum(["unset", "ok", "error"]).optional(),
3512
+ kind: z23.enum(["internal", "server", "client", "producer", "consumer"]).optional(),
3513
+ minDurationMs: z23.number().min(0).max(86400000).optional(),
3514
+ maxDurationMs: z23.number().min(0).max(86400000).optional(),
3515
+ mode: z23.enum(["spans", "traces"]).optional(),
3463
3516
  cursor: nodeCursor
3464
3517
  }),
3465
- spansHistogram: z22.object({
3518
+ spansHistogram: z23.object({
3466
3519
  ...telemetryCommon,
3467
- operation: z22.string().min(1).max(1024).optional(),
3468
- status: z22.enum(["unset", "ok", "error"]).optional()
3520
+ operation: z23.string().min(1).max(1024).optional(),
3521
+ status: z23.enum(["unset", "ok", "error"]).optional()
3469
3522
  }),
3470
- trace: z22.object({ traceId }),
3471
- traceSpans: z22.object({ traceId, errorsOnly: z22.enum(["1"]).optional(), ...windowFields }),
3472
- span: z22.object({ traceId, spanId, ...windowFields }),
3473
- logsList: z22.object({
3523
+ trace: z23.object({ traceId }),
3524
+ traceSpans: z23.object({ traceId, errorsOnly: z23.enum(["1"]).optional(), ...windowFields }),
3525
+ span: z23.object({ traceId, spanId, ...windowFields }),
3526
+ logsList: z23.object({
3474
3527
  ...telemetryCommon,
3475
- severityMin: z22.enum(["trace", "debug", "info", "warn", "error", "fatal"]).optional(),
3528
+ severityMin: z23.enum(["trace", "debug", "info", "warn", "error", "fatal"]).optional(),
3476
3529
  traceId: traceId.optional(),
3477
3530
  spanId: spanId.optional(),
3478
- q: z22.string().max(500).optional(),
3479
- order: z22.enum(["asc", "desc"]).optional(),
3531
+ q: z23.string().max(500).optional(),
3532
+ order: z23.enum(["asc", "desc"]).optional(),
3480
3533
  cursor: nodeCursor
3481
3534
  }),
3482
- logsFacets: z22.object({
3535
+ logsFacets: z23.object({
3483
3536
  ...telemetryCommon,
3484
- severityMin: z22.enum(["trace", "debug", "info", "warn", "error", "fatal"]).optional(),
3485
- q: z22.string().max(500).optional()
3486
- }),
3487
- logAround: z22.object({
3488
- logId: z22.guid(),
3489
- at: z22.string().max(40),
3490
- same: z22.enum(["service", "trace"]).optional(),
3491
- before: z22.number().int().min(0).max(200).optional(),
3492
- after: z22.number().int().min(0).max(200).optional()
3493
- }),
3494
- metricsNames: z22.object({
3495
- project: z22.number().int().positive(),
3537
+ severityMin: z23.enum(["trace", "debug", "info", "warn", "error", "fatal"]).optional(),
3538
+ q: z23.string().max(500).optional()
3539
+ }),
3540
+ logAround: z23.object({
3541
+ logId: z23.guid(),
3542
+ at: z23.string().max(40),
3543
+ same: z23.enum(["service", "trace"]).optional(),
3544
+ before: z23.number().int().min(0).max(200).optional(),
3545
+ after: z23.number().int().min(0).max(200).optional()
3546
+ }),
3547
+ metricsNames: z23.object({
3548
+ project: z23.number().int().positive(),
3496
3549
  environment: csv.optional(),
3497
- q: z22.string().max(255).optional()
3550
+ q: z23.string().max(255).optional()
3498
3551
  }),
3499
- metricsSeries: z22.object({
3500
- project: z22.number().int().positive(),
3501
- name: z22.string().regex(METRIC_NAME_RE),
3552
+ metricsSeries: z23.object({
3553
+ project: z23.number().int().positive(),
3554
+ name: z23.string().regex(METRIC_NAME_RE),
3502
3555
  environment: csv.optional(),
3503
3556
  attrs,
3504
- cursor: z22.string().regex(/^[0-9a-f]{16}$/).optional()
3557
+ cursor: z23.string().regex(/^[0-9a-f]{16}$/).optional()
3505
3558
  }),
3506
- metricsQuery: z22.object({
3507
- project: z22.number().int().positive(),
3508
- name: z22.string().regex(METRIC_NAME_RE),
3509
- aggregation: z22.enum(METRIC_AGGREGATIONS),
3559
+ metricsQuery: z23.object({
3560
+ project: z23.number().int().positive(),
3561
+ name: z23.string().regex(METRIC_NAME_RE),
3562
+ aggregation: z23.enum(METRIC_AGGREGATIONS),
3510
3563
  ...windowFields,
3511
- step: z22.number().int().min(METRIC_QUERY.minStepSeconds).max(METRIC_QUERY.maxStepSeconds).multipleOf(60).optional(),
3564
+ step: z23.number().int().min(METRIC_QUERY.minStepSeconds).max(METRIC_QUERY.maxStepSeconds).multipleOf(60).optional(),
3512
3565
  attrs,
3513
- groupBy: z22.string().min(1).max(600).optional(),
3566
+ groupBy: z23.string().min(1).max(600).optional(),
3514
3567
  environment: csv.optional()
3515
3568
  }),
3516
- telemetryUsage: z22.object({
3517
- project: csv.optional(),
3518
- days: z22.number().int().min(1).max(31).optional()
3569
+ telemetryUsage: z23.object({
3570
+ project: projectIds2.optional(),
3571
+ days: z23.number().int().min(1).max(31).optional()
3519
3572
  }),
3520
- monitorSignal: z22.object({
3521
- monitorId: z22.guid(),
3522
- hours: z22.number().int().min(1).max(24).optional()
3573
+ monitorSignal: z23.object({
3574
+ monitorId: z23.guid(),
3575
+ hours: z23.number().int().min(1).max(24).optional()
3523
3576
  }),
3524
- monitorOccurrences: z22.object({
3525
- monitorId: z22.guid(),
3526
- state: z22.enum(["open", "finished", "all"]).optional(),
3527
- environment: z22.string().min(1).max(64).optional(),
3577
+ monitorOccurrences: z23.object({
3578
+ monitorId: z23.guid(),
3579
+ state: z23.enum(["open", "finished", "all"]).optional(),
3580
+ environment: z23.string().min(1).max(64).optional(),
3528
3581
  cursor: nodeCursor
3529
3582
  }),
3530
- monitorBacktest: z22.object({
3531
- project: z22.number().int().positive(),
3583
+ monitorBacktest: z23.object({
3584
+ project: z23.number().int().positive(),
3532
3585
  settings: backtestSettingsSchema
3533
3586
  }),
3534
- occurrenceCreate: z22.object({
3535
- project: z22.number().int().positive(),
3587
+ occurrenceCreate: z23.object({
3588
+ project: z23.number().int().positive(),
3536
3589
  monitorSlug: occurrenceInputSchema.shape.monitor_slug,
3537
3590
  occurrenceId: occurrenceInputSchema.shape.occurrence_id,
3538
3591
  dueAt: occurrenceInputSchema.shape.due_at,
3539
3592
  environment: occurrenceInputSchema.shape.environment
3540
3593
  }),
3541
- occurrenceCancel: z22.object({
3542
- project: z22.number().int().positive(),
3543
- monitorSlug: z22.string().regex(SLUG_RE),
3544
- occurrenceId: z22.string().regex(OCCURRENCE_ID_RE),
3545
- environment: z22.string().min(1).max(64).optional()
3594
+ occurrenceCancel: z23.object({
3595
+ project: z23.number().int().positive(),
3596
+ monitorSlug: z23.string().regex(SLUG_RE),
3597
+ occurrenceId: z23.string().regex(OCCURRENCE_ID_RE),
3598
+ environment: z23.string().min(1).max(64).optional()
3546
3599
  }),
3547
- releasesList: z22.object({
3548
- project: z22.number().int().positive(),
3600
+ webVitals: z23.object({
3601
+ project: z23.number().int().positive(),
3602
+ ...windowFields,
3603
+ environment: csv.optional(),
3604
+ path: z23.string().max(WEB_VITAL_LIMITS.pathMaxChars).regex(/^(?:\/[^\s?#]*|other)$/).optional()
3605
+ }),
3606
+ releasesList: z23.object({
3607
+ project: z23.number().int().positive(),
3549
3608
  environment: environmentNameSchema.optional()
3550
3609
  }),
3551
- releaseHealth: z22.object({
3552
- project: z22.number().int().positive(),
3610
+ releaseHealth: z23.object({
3611
+ project: z23.number().int().positive(),
3553
3612
  version: releaseNameSchema,
3554
3613
  environment: environmentNameSchema.optional(),
3555
3614
  compare: releaseNameSchema.optional()
3556
3615
  }),
3557
- deploymentCreate: z22.object({
3558
- project: z22.number().int().positive(),
3616
+ deploymentCreate: z23.object({
3617
+ project: z23.number().int().positive(),
3559
3618
  version: deploymentInputSchema.shape.version,
3560
3619
  environment: deploymentInputSchema.shape.environment,
3561
3620
  name: deploymentInputSchema.shape.name,
@@ -3564,10 +3623,10 @@ var NODE_INPUTS = {
3564
3623
  finishedAt: deploymentInputSchema.shape.finished_at,
3565
3624
  deployId: deploymentInputSchema.shape.deploy_id
3566
3625
  }),
3567
- ticket: z22.object({
3568
- scope: z22.enum(["read", "write"]).default("read"),
3569
- project: z22.number().int().positive().optional(),
3570
- environment: z22.string().min(1).max(64).optional()
3626
+ ticket: z23.object({
3627
+ scope: z23.enum(["read", "write"]).default("read"),
3628
+ project: z23.number().int().positive().optional(),
3629
+ environment: z23.string().min(1).max(64).optional()
3571
3630
  })
3572
3631
  };
3573
3632
  var N = NODE_INPUTS;
@@ -3755,7 +3814,16 @@ var NODE_OPERATIONS = [
3755
3814
  scope: "metrics:read",
3756
3815
  input: N.metricsQuery,
3757
3816
  node: { path: "q/metrics/query", window: true },
3758
- summary: "One metric aggregated per step (avg, sum, min, max, count, rate, p50–p99) in a window of at most 7 days, optionally grouped by up to two attributes (≤ 50 groups, ≤ 10,000 points), with exemplar trace ids."
3817
+ summary: "One metric aggregated per step (avg, sum, min, max, count, rate, p50, p75, p90, p95, p99) in a window of at most 7 days, optionally grouped by up to two attributes (≤ 50 groups, ≤ 10,000 points), with exemplar trace ids."
3818
+ }),
3819
+ op({
3820
+ ...read,
3821
+ id: "metrics.web_vitals",
3822
+ path: "/v1/projects/{project}/web-vitals",
3823
+ scope: "metrics:read",
3824
+ input: N.webVitals,
3825
+ node: { path: "q/metrics/web-vitals", window: true },
3826
+ summary: "Core Web Vitals of real users (LCP, INP, CLS, FCP, TTFB) in a window of at most 7 days: samples, p75 with its web.dev rating, samples per rating, the distribution, the busiest routes and the elements behind slow samples. Optionally one route. Needs browser SDK `webVitals` and node agent 0.1.40."
3759
3827
  }),
3760
3828
  op({
3761
3829
  ...read,
@@ -3895,10 +3963,10 @@ var NODE_OPERATIONS = [
3895
3963
  ];
3896
3964
 
3897
3965
  // ../src/shared/contracts/api-ops/privacy.ts
3898
- import { z as z24 } from "zod";
3966
+ import { z as z25 } from "zod";
3899
3967
 
3900
3968
  // ../src/shared/contracts/privacy.ts
3901
- import { z as z23 } from "zod";
3969
+ import { z as z24 } from "zod";
3902
3970
 
3903
3971
  // ../src/shared/privacy/rules.ts
3904
3972
  var PRIVACY_SCHEMA = 1;
@@ -3928,44 +3996,47 @@ var IPV6_RE = new RegExp(`(^|[^0-9A-Fa-f:])((?:${H}:){7}${H}|(?:${H}:){1,6}:(?:$
3928
3996
  var REMOVE = Symbol("remove");
3929
3997
 
3930
3998
  // ../src/shared/contracts/privacy.ts
3931
- var ruleId = z23.string().regex(/^[A-Za-z0-9_-]{1,64}$/);
3932
- var privacyRuleInputSchema = z23.object({
3999
+ var PRIVACY_KEY_MAX_VERSION = 1e6;
4000
+ var ruleId = z24.string().regex(/^[A-Za-z0-9_-]{1,64}$/);
4001
+ var privacyRuleInputSchema = z24.object({
3933
4002
  id: ruleId,
3934
- selector: z23.string().min(1).max(PRIVACY_LIMITS.selector),
3935
- type: z23.enum(PRIVACY_RULE_TYPES),
3936
- method: z23.enum(PRIVACY_METHODS),
3937
- pattern: z23.string().min(1).max(PRIVACY_LIMITS.pattern).optional(),
3938
- ignoreCase: z23.boolean().optional(),
3939
- replaceWith: z23.string().max(PRIVACY_LIMITS.replaceWith).optional(),
3940
- enabled: z23.boolean().optional()
4003
+ selector: z24.string().min(1).max(PRIVACY_LIMITS.selector),
4004
+ type: z24.enum(PRIVACY_RULE_TYPES),
4005
+ method: z24.enum(PRIVACY_METHODS),
4006
+ pattern: z24.string().min(1).max(PRIVACY_LIMITS.pattern).optional(),
4007
+ ignoreCase: z24.boolean().optional(),
4008
+ replaceWith: z24.string().max(PRIVACY_LIMITS.replaceWith).optional(),
4009
+ enabled: z24.boolean().optional()
3941
4010
  });
3942
- var privacyPolicyInputSchema = z23.object({
3943
- mode: z23.enum(PRIVACY_MODES),
3944
- rules: z23.array(privacyRuleInputSchema).max(PRIVACY_LIMITS.rules),
3945
- allowlist: z23.array(z23.string().min(1).max(PRIVACY_LIMITS.selector)).max(PRIVACY_LIMITS.allowlist)
4011
+ var privacyPolicyInputSchema = z24.object({
4012
+ mode: z24.enum(PRIVACY_MODES),
4013
+ rules: z24.array(privacyRuleInputSchema).max(PRIVACY_LIMITS.rules),
4014
+ allowlist: z24.array(z24.string().min(1).max(PRIVACY_LIMITS.selector)).max(PRIVACY_LIMITS.allowlist)
3946
4015
  });
3947
- var storedPolicySchema = z23.object({
3948
- schema: z23.literal(PRIVACY_SCHEMA),
3949
- version: z23.number().int().min(0),
3950
- mode: z23.enum(PRIVACY_MODES),
3951
- rules: z23.array(z23.record(z23.string(), z23.unknown())).max(PRIVACY_LIMITS.rules),
3952
- allowlist: z23.array(z23.string()).max(PRIVACY_LIMITS.allowlist)
4016
+ var storedPolicySchema = z24.object({
4017
+ schema: z24.literal(PRIVACY_SCHEMA),
4018
+ version: z24.number().int().min(0),
4019
+ mode: z24.enum(PRIVACY_MODES),
4020
+ rules: z24.array(z24.record(z24.string(), z24.unknown())).max(PRIVACY_LIMITS.rules),
4021
+ allowlist: z24.array(z24.string()).max(PRIVACY_LIMITS.allowlist)
3953
4022
  });
3954
- var nodePrivacyBlockSchema = z23.array(z23.object({ project_id: z23.number().int().positive(), policy: z23.unknown() })).max(1000);
3955
- var privacyRollupSchema = z23.object({
3956
- applied_version: z23.number().int().min(0).nullable(),
3957
- policy_missing_24h: z23.number().int().nonnegative(),
3958
- budget_exceeded_24h: z23.number().int().nonnegative(),
3959
- sdk_versions: z23.array(z23.object({ version: z23.number().int().min(0), last_seen_at: z23.string().datetime() })).max(5)
4023
+ var nodePrivacyBlockSchema = z24.array(z24.object({ project_id: z24.number().int().positive(), policy: z24.unknown() })).max(1000);
4024
+ var privacyRollupSchema = z24.object({
4025
+ applied_version: z24.number().int().min(0).nullable(),
4026
+ policy_missing_24h: z24.number().int().nonnegative(),
4027
+ budget_exceeded_24h: z24.number().int().nonnegative(),
4028
+ sdk_versions: z24.array(z24.object({ version: z24.number().int().min(0), last_seen_at: z24.string().datetime() })).max(5),
4029
+ key_version: z24.number().int().min(1).max(PRIVACY_KEY_MAX_VERSION).optional(),
4030
+ key_created_at: z24.string().datetime().nullable().optional()
3960
4031
  });
3961
4032
 
3962
4033
  // ../src/shared/contracts/api-ops/privacy.ts
3963
4034
  var PRIVACY_INPUTS = {
3964
- get: z24.object({ workspaceId: uuid, projectId }),
3965
- set: z24.object({
4035
+ get: z25.object({ workspaceId: uuid, projectId }),
4036
+ set: z25.object({
3966
4037
  workspaceId: uuid,
3967
4038
  projectId,
3968
- expectedVersion: z24.number().int().min(0),
4039
+ expectedVersion: z25.number().int().min(0),
3969
4040
  policy: privacyPolicyInputSchema
3970
4041
  })
3971
4042
  };
@@ -3983,7 +4054,7 @@ var PRIVACY_OPERATIONS = [
3983
4054
  workspace: true,
3984
4055
  idempotency: "none",
3985
4056
  mcp: "configure",
3986
- summary: "A project's privacy policy (mode, rules, strict allowlist, version), the built-in detectors that are off, whether user ids are pseudonymised, the last 20 versions and what the node applies and counted in the last 24 h.",
4057
+ summary: "A project's privacy policy (mode, rules, strict allowlist, version), the built-in detectors that are off, whether user ids are pseudonymised, the pseudonymisation key version (never the key), the last 20 versions and what the node applies, hashes with and counted in the last 24 h.",
3987
4058
  ui: []
3988
4059
  }),
3989
4060
  op({
@@ -4005,10 +4076,10 @@ var PRIVACY_OPERATIONS = [
4005
4076
  ];
4006
4077
 
4007
4078
  // ../src/shared/contracts/api-ops/projects.ts
4008
- import { z as z28 } from "zod";
4079
+ import { z as z29 } from "zod";
4009
4080
 
4010
4081
  // ../src/shared/contracts/ingest-keys.ts
4011
- import { z as z25 } from "zod";
4082
+ import { z as z26 } from "zod";
4012
4083
  var INGEST_KEY_SCOPES = ["traces", "logs", "metrics", "errors", "monitors"];
4013
4084
  var INGEST_KEY_STATES = ["active", "revoked"];
4014
4085
  var INGEST_KEY_LIMITS = {
@@ -4018,92 +4089,92 @@ var INGEST_KEY_LIMITS = {
4018
4089
  edgeCacheSeconds: 60
4019
4090
  };
4020
4091
  var CHECKIN_AUTH_MODES = ["public_or_key", "key_only"];
4021
- var ingestKeyConfigSchema = z25.object({
4022
- v: z25.literal(1),
4023
- key_id: z25.guid(),
4024
- project_public_id: z25.number().int().positive(),
4025
- project_id: z25.number().int().positive(),
4026
- workspace_id: z25.guid(),
4092
+ var ingestKeyConfigSchema = z26.object({
4093
+ v: z26.literal(1),
4094
+ key_id: z26.guid(),
4095
+ project_public_id: z26.number().int().positive(),
4096
+ project_id: z26.number().int().positive(),
4097
+ workspace_id: z26.guid(),
4027
4098
  node_id: nodeIdSchema,
4028
- scopes: z25.array(z25.enum(INGEST_KEY_SCOPES)).min(1).max(INGEST_KEY_SCOPES.length),
4029
- environments: z25.array(z25.string().max(INGEST_KEY_LIMITS.environmentMaxChars)).max(INGEST_KEY_LIMITS.environmentsMax),
4030
- expires_at: z25.string().datetime({ offset: true }).nullable(),
4031
- state: z25.enum(INGEST_KEY_STATES),
4032
- workspace_status: z25.enum(["active", "suspended", "deleting"]),
4033
- ingest_kill: z25.boolean(),
4034
- telemetry_kill: z25.boolean(),
4035
- telemetry_rate_bytes_per_sec: z25.number().int().positive(),
4036
- telemetry_burst_bytes: z25.number().int().positive(),
4037
- traces_monthly_bytes: z25.number().int().positive(),
4038
- logs_monthly_bytes: z25.number().int().positive(),
4039
- metrics_monthly_bytes: z25.number().int().positive().optional(),
4040
- telemetry_buffer_minutes: z25.number().int().min(1).max(1440),
4041
- revision: z25.number().int().nonnegative()
4099
+ scopes: z26.array(z26.enum(INGEST_KEY_SCOPES)).min(1).max(INGEST_KEY_SCOPES.length),
4100
+ environments: z26.array(z26.string().max(INGEST_KEY_LIMITS.environmentMaxChars)).max(INGEST_KEY_LIMITS.environmentsMax),
4101
+ expires_at: z26.string().datetime({ offset: true }).nullable(),
4102
+ state: z26.enum(INGEST_KEY_STATES),
4103
+ workspace_status: z26.enum(["active", "suspended", "deleting"]),
4104
+ ingest_kill: z26.boolean(),
4105
+ telemetry_kill: z26.boolean(),
4106
+ telemetry_rate_bytes_per_sec: z26.number().int().positive(),
4107
+ telemetry_burst_bytes: z26.number().int().positive(),
4108
+ traces_monthly_bytes: z26.number().int().positive(),
4109
+ logs_monthly_bytes: z26.number().int().positive(),
4110
+ metrics_monthly_bytes: z26.number().int().positive().optional(),
4111
+ telemetry_buffer_minutes: z26.number().int().min(1).max(1440),
4112
+ revision: z26.number().int().nonnegative()
4042
4113
  });
4043
- var createIngestKeyInputSchema = z25.object({
4044
- projectId: z25.number().int().positive(),
4045
- name: z25.string().trim().min(1).max(INGEST_KEY_LIMITS.nameMaxChars).refine((s) => !/[\u0000-\u001f\u007f]/.test(s)),
4046
- scopes: z25.array(z25.enum(INGEST_KEY_SCOPES)).min(1).max(INGEST_KEY_SCOPES.length),
4047
- environments: z25.array(z25.string().trim().min(1).max(INGEST_KEY_LIMITS.environmentMaxChars).regex(/^[^\s/\u0000-\u001f]+$/)).max(INGEST_KEY_LIMITS.environmentsMax),
4048
- expiresAt: z25.string().datetime({ offset: true }).nullable()
4114
+ var createIngestKeyInputSchema = z26.object({
4115
+ projectId: z26.number().int().positive(),
4116
+ name: z26.string().trim().min(1).max(INGEST_KEY_LIMITS.nameMaxChars).refine((s) => !/[\u0000-\u001f\u007f]/.test(s)),
4117
+ scopes: z26.array(z26.enum(INGEST_KEY_SCOPES)).min(1).max(INGEST_KEY_SCOPES.length),
4118
+ environments: z26.array(z26.string().trim().min(1).max(INGEST_KEY_LIMITS.environmentMaxChars).regex(/^[^\s/\u0000-\u001f]+$/)).max(INGEST_KEY_LIMITS.environmentsMax),
4119
+ expiresAt: z26.string().datetime({ offset: true }).nullable()
4049
4120
  });
4050
- var ingestKeyRowSchema = z25.object({
4051
- id: z25.guid(),
4052
- project_id: z25.number().int().positive(),
4053
- name: z25.string(),
4054
- prefix: z25.string(),
4055
- scopes: z25.array(z25.enum(INGEST_KEY_SCOPES)),
4056
- environments: z25.array(z25.string()),
4057
- expires_at: z25.string().nullable(),
4058
- state: z25.enum(INGEST_KEY_STATES),
4059
- created_by: z25.guid().nullable(),
4060
- created_at: z25.string(),
4061
- revoked_at: z25.string().nullable(),
4062
- last_used_at: z25.string().nullable()
4121
+ var ingestKeyRowSchema = z26.object({
4122
+ id: z26.guid(),
4123
+ project_id: z26.number().int().positive(),
4124
+ name: z26.string(),
4125
+ prefix: z26.string(),
4126
+ scopes: z26.array(z26.enum(INGEST_KEY_SCOPES)),
4127
+ environments: z26.array(z26.string()),
4128
+ expires_at: z26.string().nullable(),
4129
+ state: z26.enum(INGEST_KEY_STATES),
4130
+ created_by: z26.guid().nullable(),
4131
+ created_at: z26.string(),
4132
+ revoked_at: z26.string().nullable(),
4133
+ last_used_at: z26.string().nullable()
4063
4134
  });
4064
4135
 
4065
4136
  // ../src/shared/contracts/node-config.ts
4066
- import { z as z27 } from "zod";
4137
+ import { z as z28 } from "zod";
4067
4138
 
4068
4139
  // ../src/shared/contracts/backup.ts
4069
- import { z as z26 } from "zod";
4140
+ import { z as z27 } from "zod";
4070
4141
  var BACKUP_KINDS = ["daily", "weekly", "manual", "pre_upgrade"];
4071
- var ageRecipient = z26.string().regex(/^age1[02-9ac-hj-np-z]{58}$/);
4072
- var backupIdSchema = z26.string().regex(/^[a-z0-9-]{8,64}$/);
4073
- var nodeBackupConfigSchema = z26.object({
4074
- enabled: z26.boolean(),
4075
- hour_utc: z26.number().int().min(0).max(23),
4076
- weekly_day: z26.number().int().min(1).max(7),
4142
+ var ageRecipient = z27.string().regex(/^age1[02-9ac-hj-np-z]{58}$/);
4143
+ var backupIdSchema = z27.string().regex(/^[a-z0-9-]{8,64}$/);
4144
+ var nodeBackupConfigSchema = z27.object({
4145
+ enabled: z27.boolean(),
4146
+ hour_utc: z27.number().int().min(0).max(23),
4147
+ weekly_day: z27.number().int().min(1).max(7),
4077
4148
  workspace_recipient: ageRecipient
4078
4149
  });
4079
- var backupCredentialsRequestSchema = z26.object({
4080
- mode: z26.enum(["upload", "download"]),
4150
+ var backupCredentialsRequestSchema = z27.object({
4151
+ mode: z27.enum(["upload", "download"]),
4081
4152
  backup_id: backupIdSchema,
4082
- source_node_id: z26.guid().optional()
4153
+ source_node_id: z27.guid().optional()
4083
4154
  });
4084
- var backupCredentialsSchema = z26.object({
4085
- endpoint: z26.string().url(),
4086
- bucket: z26.string().regex(/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/),
4087
- prefix: z26.string().regex(/^backups\/[0-9a-f-]{36}\/$/),
4088
- access_key_id: z26.string().min(8).max(200),
4089
- secret_access_key: z26.string().min(8).max(200),
4090
- session_token: z26.string().min(8).max(4000),
4091
- expires_at: z26.string().datetime()
4155
+ var backupCredentialsSchema = z27.object({
4156
+ endpoint: z27.string().url(),
4157
+ bucket: z27.string().regex(/^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/),
4158
+ prefix: z27.string().regex(/^backups\/[0-9a-f-]{36}\/$/),
4159
+ access_key_id: z27.string().min(8).max(200),
4160
+ secret_access_key: z27.string().min(8).max(200),
4161
+ session_token: z27.string().min(8).max(4000),
4162
+ expires_at: z27.string().datetime()
4092
4163
  });
4093
- var rowCountsSchema = z26.record(z26.string().regex(/^[a-z_][a-z0-9_]{0,63}$/), z26.number().int().nonnegative());
4094
- var backupManifestSchema = z26.object({
4095
- v: z26.literal(1),
4164
+ var rowCountsSchema = z27.record(z27.string().regex(/^[a-z_][a-z0-9_]{0,63}$/), z27.number().int().nonnegative());
4165
+ var backupManifestSchema = z27.object({
4166
+ v: z27.literal(1),
4096
4167
  backup_id: backupIdSchema,
4097
- node_id: z26.guid(),
4098
- kind: z26.enum(BACKUP_KINDS),
4099
- created_at: z26.string().datetime(),
4100
- object_key: z26.string(),
4101
- size_bytes: z26.number().int().nonnegative(),
4102
- sha256: z26.string().regex(/^[0-9a-f]{64}$/),
4103
- clickhouse_version: z26.string().max(40),
4104
- schema_version: z26.number().int().nonnegative(),
4168
+ node_id: z27.guid(),
4169
+ kind: z27.enum(BACKUP_KINDS),
4170
+ created_at: z27.string().datetime(),
4171
+ object_key: z27.string(),
4172
+ size_bytes: z27.number().int().nonnegative(),
4173
+ sha256: z27.string().regex(/^[0-9a-f]{64}$/),
4174
+ clickhouse_version: z27.string().max(40),
4175
+ schema_version: z27.number().int().nonnegative(),
4105
4176
  row_counts: rowCountsSchema,
4106
- recipients: z26.array(z26.string().regex(/^[0-9a-f]{8}$/)).min(1).max(4)
4177
+ recipients: z27.array(z27.string().regex(/^[0-9a-f]{8}$/)).min(1).max(4)
4107
4178
  });
4108
4179
  var BACKUP_ERROR_CODES = [
4109
4180
  "CLICKHOUSE_BACKUP_FAILED",
@@ -4117,48 +4188,48 @@ var BACKUP_ERROR_CODES = [
4117
4188
  "RESTORE_FAILED",
4118
4189
  "ROW_COUNT_MISMATCH"
4119
4190
  ];
4120
- var backupReportSchema = z26.object({
4191
+ var backupReportSchema = z27.object({
4121
4192
  backup_id: backupIdSchema,
4122
- kind: z26.enum(BACKUP_KINDS),
4123
- status: z26.enum(["succeeded", "failed"]),
4124
- started_at: z26.string().datetime(),
4125
- finished_at: z26.string().datetime(),
4193
+ kind: z27.enum(BACKUP_KINDS),
4194
+ status: z27.enum(["succeeded", "failed"]),
4195
+ started_at: z27.string().datetime(),
4196
+ finished_at: z27.string().datetime(),
4126
4197
  manifest: backupManifestSchema.nullable(),
4127
- error_code: z26.enum(BACKUP_ERROR_CODES).nullable()
4198
+ error_code: z27.enum(BACKUP_ERROR_CODES).nullable()
4128
4199
  });
4129
- var drillReportSchema = z26.object({
4200
+ var drillReportSchema = z27.object({
4130
4201
  backup_id: backupIdSchema,
4131
- kind: z26.enum(["weekly_local", "monthly_new_machine"]),
4132
- status: z26.enum(["passed", "failed"]),
4133
- finished_at: z26.string().datetime(),
4134
- detail: z26.string().max(300),
4135
- error_code: z26.enum(BACKUP_ERROR_CODES).nullable()
4202
+ kind: z27.enum(["weekly_local", "monthly_new_machine"]),
4203
+ status: z27.enum(["passed", "failed"]),
4204
+ finished_at: z27.string().datetime(),
4205
+ detail: z27.string().max(300),
4206
+ error_code: z27.enum(BACKUP_ERROR_CODES).nullable()
4136
4207
  });
4137
- var nodeIdentityEscrowSchema = z26.object({
4138
- v: z26.literal(1),
4139
- node_id: z26.guid(),
4140
- seal: z26.object({
4141
- publicKey: z26.string().regex(/^[A-Za-z0-9_-]{43}$/),
4142
- privateKey: z26.string().regex(/^[A-Za-z0-9_-]{43}$/)
4208
+ var nodeIdentityEscrowSchema = z27.object({
4209
+ v: z27.literal(1),
4210
+ node_id: z27.guid(),
4211
+ seal: z27.object({
4212
+ publicKey: z27.string().regex(/^[A-Za-z0-9_-]{43}$/),
4213
+ privateKey: z27.string().regex(/^[A-Za-z0-9_-]{43}$/)
4143
4214
  }),
4144
- created_at: z26.string().datetime()
4215
+ created_at: z27.string().datetime()
4145
4216
  });
4146
- var restoreArgsSchema = z26.object({
4147
- job_id: z26.guid(),
4148
- workspace_id: z26.guid(),
4149
- source_node_id: z26.guid(),
4217
+ var restoreArgsSchema = z27.object({
4218
+ job_id: z27.guid(),
4219
+ workspace_id: z27.guid(),
4220
+ source_node_id: z27.guid(),
4150
4221
  manifest: backupManifestSchema,
4151
- sealed_identity: z26.string().regex(/^[A-Za-z0-9_-]{40,2000}$/),
4152
- mode: z26.enum(["rebuild", "drill"])
4222
+ sealed_identity: z27.string().regex(/^[A-Za-z0-9_-]{40,2000}$/),
4223
+ mode: z27.enum(["rebuild", "drill"])
4153
4224
  });
4154
- var restoreReportSchema = z26.object({
4155
- job_id: z26.guid(),
4225
+ var restoreReportSchema = z27.object({
4226
+ job_id: z27.guid(),
4156
4227
  backup_id: backupIdSchema,
4157
- mode: z26.enum(["rebuild", "drill"]),
4158
- status: z26.enum(["succeeded", "failed"]),
4159
- finished_at: z26.string().datetime(),
4160
- detail: z26.string().max(300),
4161
- error_code: z26.enum(BACKUP_ERROR_CODES).nullable()
4228
+ mode: z27.enum(["rebuild", "drill"]),
4229
+ status: z27.enum(["succeeded", "failed"]),
4230
+ finished_at: z27.string().datetime(),
4231
+ detail: z27.string().max(300),
4232
+ error_code: z27.enum(BACKUP_ERROR_CODES).nullable()
4162
4233
  });
4163
4234
 
4164
4235
  // ../src/shared/contracts/node-config.ts
@@ -4172,84 +4243,85 @@ var SCRUB_GROUPS = [
4172
4243
  "headers"
4173
4244
  ];
4174
4245
  var MAX_NODE_MONITORS = 5000;
4175
- var kid = z27.string().regex(/^[A-Za-z0-9_-]{1,40}$/);
4176
- var publicKey = z27.string().regex(/^[A-Za-z0-9_-]{43}$/);
4177
- var nodeConfigSchema = z27.object({
4178
- v: z27.literal(1),
4179
- config_version: z27.number().int().positive(),
4180
- node_id: z27.guid(),
4181
- workspace_id: z27.guid(),
4182
- workspace_status: z27.enum(["active", "suspended"]),
4183
- issued_at: z27.string().datetime(),
4184
- retention_days: z27.number().int().min(1).max(3650),
4185
- channel: z27.enum(["stable", "canary"]).optional(),
4186
- projects: z27.array(z27.object({
4187
- project_id: z27.number().int().positive(),
4188
- slug: z27.string().max(64),
4189
- short_prefix: z27.string().regex(/^[A-Z0-9]{1,12}$/),
4190
- user_id_salt: z27.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
4191
- scrub_disabled: z27.array(z27.enum(SCRUB_GROUPS)).max(SCRUB_GROUPS.length),
4192
- upload_tokens: z27.array(z27.object({
4193
- hash: z27.string().regex(/^[a-f0-9]{64}$/),
4194
- expires_at: z27.string().datetime(),
4195
- scopes: z27.array(z27.enum(UPLOAD_SCOPES)).min(1).max(UPLOAD_SCOPES.length).optional()
4246
+ var kid = z28.string().regex(/^[A-Za-z0-9_-]{1,40}$/);
4247
+ var publicKey = z28.string().regex(/^[A-Za-z0-9_-]{43}$/);
4248
+ var nodeConfigSchema = z28.object({
4249
+ v: z28.literal(1),
4250
+ config_version: z28.number().int().positive(),
4251
+ node_id: z28.guid(),
4252
+ workspace_id: z28.guid(),
4253
+ workspace_status: z28.enum(["active", "suspended"]),
4254
+ issued_at: z28.string().datetime(),
4255
+ retention_days: z28.number().int().min(1).max(3650),
4256
+ channel: z28.enum(["stable", "canary"]).optional(),
4257
+ projects: z28.array(z28.object({
4258
+ project_id: z28.number().int().positive(),
4259
+ slug: z28.string().max(64),
4260
+ short_prefix: z28.string().regex(/^[A-Z0-9]{1,12}$/),
4261
+ user_id_salt: z28.string().regex(/^[A-Za-z0-9_-]{22,64}$/),
4262
+ privacy_key_version: z28.number().int().min(1).max(PRIVACY_KEY_MAX_VERSION).optional(),
4263
+ scrub_disabled: z28.array(z28.enum(SCRUB_GROUPS)).max(SCRUB_GROUPS.length),
4264
+ upload_tokens: z28.array(z28.object({
4265
+ hash: z28.string().regex(/^[a-f0-9]{64}$/),
4266
+ expires_at: z28.string().datetime(),
4267
+ scopes: z28.array(z28.enum(UPLOAD_SCOPES)).min(1).max(UPLOAD_SCOPES.length).optional()
4196
4268
  })).max(10).optional()
4197
4269
  })).max(1000),
4198
- ticket_keys: z27.array(z27.object({ kid, public_key: publicKey, not_after: z27.string().datetime() })).min(1).max(5),
4199
- control_ops_keys: z27.array(z27.object({ kid, public_key: publicKey })).min(1).max(5),
4200
- kill_switches: z27.object({ ingest: z27.boolean(), alerts: z27.boolean() }),
4270
+ ticket_keys: z28.array(z28.object({ kid, public_key: publicKey, not_after: z28.string().datetime() })).min(1).max(5),
4271
+ control_ops_keys: z28.array(z28.object({ kid, public_key: publicKey })).min(1).max(5),
4272
+ kill_switches: z28.object({ ingest: z28.boolean(), alerts: z28.boolean() }),
4201
4273
  backup: nodeBackupConfigSchema.optional(),
4202
- purged_projects: z27.array(z27.number().int().positive()).max(1000).optional(),
4203
- monitors: z27.array(monitorDefinitionSchema).max(MAX_NODE_MONITORS).optional(),
4204
- purged_monitors: z27.array(z27.guid()).max(5000).optional(),
4205
- telemetry: z27.object({
4206
- traces_retention_days: z27.number().int().min(1).max(90),
4207
- logs_retention_days: z27.number().int().min(1).max(90),
4208
- traces_disk_share: z27.number().min(0.2).max(0.8)
4274
+ purged_projects: z28.array(z28.number().int().positive()).max(1000).optional(),
4275
+ monitors: z28.array(monitorDefinitionSchema).max(MAX_NODE_MONITORS).optional(),
4276
+ purged_monitors: z28.array(z28.guid()).max(5000).optional(),
4277
+ telemetry: z28.object({
4278
+ traces_retention_days: z28.number().int().min(1).max(90),
4279
+ logs_retention_days: z28.number().int().min(1).max(90),
4280
+ traces_disk_share: z28.number().min(0.2).max(0.8)
4209
4281
  }).optional(),
4210
4282
  metrics: metricsConfigSchema.optional(),
4211
- slos: z27.array(nodeSloSchema).max(SLO_LIMITS.maxNodeSlos).optional(),
4212
- signal_monitors: z27.array(signalMonitorDefinitionSchema).max(MAX_NODE_MONITORS).optional(),
4283
+ slos: z28.array(nodeSloSchema).max(SLO_LIMITS.maxNodeSlos).optional(),
4284
+ signal_monitors: z28.array(signalMonitorDefinitionSchema).max(MAX_NODE_MONITORS).optional(),
4213
4285
  signal_limits: signalLimitsConfigSchema.optional(),
4214
4286
  privacy: nodePrivacyBlockSchema.optional()
4215
4287
  });
4216
- var signedNodeConfigSchema = z27.object({ config: nodeConfigSchema, kid, sig: z27.string() });
4288
+ var signedNodeConfigSchema = z28.object({ config: nodeConfigSchema, kid, sig: z28.string() });
4217
4289
 
4218
4290
  // ../src/shared/contracts/api-ops/projects.ts
4219
- var slug = z28.string().regex(/^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$/);
4220
- var name3 = z28.string().trim().min(1).max(60);
4221
- var label2 = z28.string().trim().min(1).max(40);
4222
- var platform = z28.enum(PLATFORMS);
4223
- var origin = z28.string().trim().toLowerCase().regex(/^https?:\/\/[a-z0-9.-]+(:[0-9]{1,5})?$/).max(200);
4224
- var keyId = z28.number().int().positive();
4291
+ var slug = z29.string().regex(/^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$/);
4292
+ var name3 = z29.string().trim().min(1).max(60);
4293
+ var label2 = z29.string().trim().min(1).max(40);
4294
+ var platform = z29.enum(PLATFORMS);
4295
+ var origin = z29.string().trim().toLowerCase().regex(/^https?:\/\/[a-z0-9.-]+(:[0-9]{1,5})?$/).max(200);
4296
+ var keyId = z29.number().int().positive();
4225
4297
  var PROJECT_INPUTS = {
4226
- create: z28.object({ workspaceId: uuid, name: name3, slug, platform }),
4227
- update: z28.object({ projectId, name: name3, platform, isPinned: z28.boolean() }),
4228
- updateIntake: z28.object({
4298
+ create: z29.object({ workspaceId: uuid, name: name3, slug, platform }),
4299
+ update: z29.object({ projectId, name: name3, platform, isPinned: z29.boolean() }),
4300
+ updateIntake: z29.object({
4229
4301
  projectId,
4230
- rateLimit: z28.number().int().positive().nullable(),
4231
- burst: z28.number().int().positive().nullable(),
4232
- allowedOrigins: z28.array(origin).max(50)
4302
+ rateLimit: z29.number().int().positive().nullable(),
4303
+ burst: z29.number().int().positive().nullable(),
4304
+ allowedOrigins: z29.array(origin).max(50)
4233
4305
  }),
4234
- updateObservability: z28.object({
4306
+ updateObservability: z29.object({
4235
4307
  projectId,
4236
- primaryEnvironment: z28.string().trim().min(1).max(64).refine((v) => v !== "*" && ENVIRONMENT_RE.test(v)),
4237
- allowCodeMonitors: z28.boolean()
4308
+ primaryEnvironment: z29.string().trim().min(1).max(64).refine((v) => v !== "*" && ENVIRONMENT_RE.test(v)),
4309
+ allowCodeMonitors: z29.boolean()
4238
4310
  }),
4239
- setScrub: z28.object({ projectId, group: z28.enum(SCRUB_GROUPS), enabled: z28.boolean() }),
4240
- setCheckinAuth: z28.object({ projectId, mode: z28.enum(CHECKIN_AUTH_MODES) }),
4241
- setEnvironmentHidden: z28.object({
4311
+ setScrub: z29.object({ projectId, group: z29.enum(SCRUB_GROUPS), enabled: z29.boolean() }),
4312
+ setCheckinAuth: z29.object({ projectId, mode: z29.enum(CHECKIN_AUTH_MODES) }),
4313
+ setEnvironmentHidden: z29.object({
4242
4314
  projectId,
4243
- name: z28.string().min(1).max(64),
4244
- hidden: z28.boolean()
4245
- }),
4246
- scheduleDeletion: z28.object({ projectId, confirmSlug: slug }),
4247
- projectOnly: z28.object({ projectId }),
4248
- labelled: z28.object({ projectId, label: label2 }),
4249
- keyOnly: z28.object({ keyId }),
4250
- tokenOnly: z28.object({ tokenId: keyId }),
4315
+ name: z29.string().min(1).max(64),
4316
+ hidden: z29.boolean()
4317
+ }),
4318
+ scheduleDeletion: z29.object({ projectId, confirmSlug: slug }),
4319
+ projectOnly: z29.object({ projectId }),
4320
+ labelled: z29.object({ projectId, label: label2 }),
4321
+ keyOnly: z29.object({ keyId }),
4322
+ tokenOnly: z29.object({ tokenId: keyId }),
4251
4323
  createIngestKey: createIngestKeyInputSchema,
4252
- ingestKeyOnly: z28.object({ keyId: uuid })
4324
+ ingestKeyOnly: z29.object({ keyId: uuid })
4253
4325
  };
4254
4326
  var P2 = PROJECT_INPUTS;
4255
4327
  var PROJECT_OPERATIONS = [
@@ -4504,24 +4576,24 @@ var PROJECT_OPERATIONS = [
4504
4576
  ];
4505
4577
 
4506
4578
  // ../src/shared/contracts/api-ops/reads.ts
4507
- import { z as z29 } from "zod";
4508
- var list = z29.object({ workspaceId: uuid, limit: pageLimit, cursor });
4579
+ import { z as z30 } from "zod";
4580
+ var list = z30.object({ workspaceId: uuid, limit: pageLimit, cursor });
4509
4581
  var READ_INPUTS = {
4510
- workspace: z29.object({ workspaceId: uuid }),
4582
+ workspace: z30.object({ workspaceId: uuid }),
4511
4583
  list,
4512
- projectsGet: z29.object({ workspaceId: uuid, projectId }),
4584
+ projectsGet: z30.object({ workspaceId: uuid, projectId }),
4513
4585
  monitorsList: list.extend({ projectId: projectId.optional() }),
4514
- monitorsGet: z29.object({ workspaceId: uuid, monitorId: uuid }),
4515
- uptimeGet: z29.object({ workspaceId: uuid, checkId: uuid }),
4516
- slosGet: z29.object({ workspaceId: uuid, sloId: uuid }),
4586
+ monitorsGet: z30.object({ workspaceId: uuid, monitorId: uuid }),
4587
+ uptimeGet: z30.object({ workspaceId: uuid, checkId: uuid }),
4588
+ slosGet: z30.object({ workspaceId: uuid, sloId: uuid }),
4517
4589
  alertsList: list.extend({
4518
- state: z29.enum(["open", "resolved", "all"]).default("all"),
4590
+ state: z30.enum(["open", "resolved", "all"]).default("all"),
4519
4591
  monitorId: uuid.optional()
4520
4592
  }),
4521
- approvalsGet: z29.object({ workspaceId: uuid, approvalId: uuid }),
4593
+ approvalsGet: z30.object({ workspaceId: uuid, approvalId: uuid }),
4522
4594
  monitorsListTyped: list.extend({
4523
4595
  projectId: projectId.optional(),
4524
- type: z29.enum(MONITOR_TYPES).optional()
4596
+ type: z30.enum(MONITOR_TYPES).optional()
4525
4597
  })
4526
4598
  };
4527
4599
  var R = READ_INPUTS;
@@ -4805,14 +4877,14 @@ function approvalRequestSchema(operationId, input) {
4805
4877
  }
4806
4878
 
4807
4879
  // ../src/shared/contracts/api-ops/wire.ts
4808
- import { z as z30 } from "zod";
4880
+ import { z as z31 } from "zod";
4809
4881
  var toSnake = (s) => s.replace(/[A-Z]/g, (c) => `_${c.toLowerCase()}`);
4810
4882
  var toCamel = (s) => s.replace(/_([a-z0-9])/g, (_, c) => c.toUpperCase());
4811
4883
  var schemaCache = new WeakMap;
4812
4884
  function inputJsonSchema(op) {
4813
4885
  let js = schemaCache.get(op.input);
4814
4886
  if (!js) {
4815
- js = z30.toJSONSchema(op.input, { io: "input", unrepresentable: "any" });
4887
+ js = z31.toJSONSchema(op.input, { io: "input", unrepresentable: "any" });
4816
4888
  schemaCache.set(op.input, js);
4817
4889
  }
4818
4890
  return js;
@@ -5026,7 +5098,7 @@ function wireInput(operationId, opts = {}) {
5026
5098
  for (const [k, v] of Object.entries(op.input.shape))
5027
5099
  if (!omit.has(k))
5028
5100
  shape[toSnake(k)] = v;
5029
- return z31.object(shape);
5101
+ return z32.object(shape);
5030
5102
  }
5031
5103
  var BUDGETS = [
5032
5104
  { stringBytes: MCP_LIMITS.untrustedStringMaxBytes, listMax: MCP_LIMITS.listMax },
@@ -5119,52 +5191,52 @@ function errorResult(o) {
5119
5191
  }
5120
5192
  };
5121
5193
  }
5122
- var TOOL_OUTPUT_SCHEMA = z31.object({
5123
- untrusted: z31.object({
5124
- data: z31.unknown(),
5125
- provenance: z31.object({
5126
- source: z31.enum(["node", "control_plane", "docs"]),
5127
- operations: z31.array(z31.string())
5194
+ var TOOL_OUTPUT_SCHEMA = z32.object({
5195
+ untrusted: z32.object({
5196
+ data: z32.unknown(),
5197
+ provenance: z32.object({
5198
+ source: z32.enum(["node", "control_plane", "docs"]),
5199
+ operations: z32.array(z32.string())
5128
5200
  })
5129
5201
  }).optional(),
5130
- doc: z31.object({
5131
- slug: z31.string(),
5132
- locale: z31.enum(["en", "vi"]),
5133
- url: z31.string(),
5134
- markdown: z31.string(),
5135
- truncated: z31.boolean()
5202
+ doc: z32.object({
5203
+ slug: z32.string(),
5204
+ locale: z32.enum(["en", "vi"]),
5205
+ url: z32.string(),
5206
+ markdown: z32.string(),
5207
+ truncated: z32.boolean()
5136
5208
  }).optional(),
5137
- results: z31.array(z31.object({
5138
- slug: z31.string(),
5139
- title: z31.string(),
5140
- description: z31.string(),
5141
- section: z31.string(),
5142
- url: z31.string()
5209
+ results: z32.array(z32.object({
5210
+ slug: z32.string(),
5211
+ title: z32.string(),
5212
+ description: z32.string(),
5213
+ section: z32.string(),
5214
+ url: z32.string()
5143
5215
  })).optional(),
5144
- next_cursor: z31.string().nullable().optional(),
5145
- complete: z31.boolean().optional(),
5146
- omitted: z31.array(z31.object({ part: z31.string(), reason: z31.string(), scope: z31.string().optional() })).optional(),
5147
- truncated: z31.literal(true).optional(),
5148
- suspicious_unicode: z31.literal(true).optional(),
5149
- error: z31.object({
5150
- code: z31.string(),
5151
- status: z31.number(),
5152
- detail: z31.string().optional(),
5153
- scope: z31.string().optional(),
5154
- retry_after: z31.number().optional()
5216
+ next_cursor: z32.string().nullable().optional(),
5217
+ complete: z32.boolean().optional(),
5218
+ omitted: z32.array(z32.object({ part: z32.string(), reason: z32.string(), scope: z32.string().optional() })).optional(),
5219
+ truncated: z32.literal(true).optional(),
5220
+ suspicious_unicode: z32.literal(true).optional(),
5221
+ error: z32.object({
5222
+ code: z32.string(),
5223
+ status: z32.number(),
5224
+ detail: z32.string().optional(),
5225
+ scope: z32.string().optional(),
5226
+ retry_after: z32.number().optional()
5155
5227
  }).optional(),
5156
- operations: z31.array(z31.record(z31.string(), z31.unknown())).optional(),
5157
- operation: z31.record(z31.string(), z31.unknown()).optional(),
5158
- plan: z31.record(z31.string(), z31.unknown()).optional(),
5159
- status: z31.enum(["done", "approval_required", "approval_pending", ...APPROVAL_STATES]).optional(),
5160
- approval: z31.object({
5161
- approval_id: z31.string(),
5162
- approval_url: z31.string(),
5163
- expires_at: z31.string(),
5164
- state: z31.enum(APPROVAL_STATES),
5165
- result_code: z31.string().nullable().optional(),
5166
- result: z31.record(z31.string(), z31.unknown()).optional(),
5167
- next: z31.string().optional()
5228
+ operations: z32.array(z32.record(z32.string(), z32.unknown())).optional(),
5229
+ operation: z32.record(z32.string(), z32.unknown()).optional(),
5230
+ plan: z32.record(z32.string(), z32.unknown()).optional(),
5231
+ status: z32.enum(["done", "approval_required", "approval_pending", ...APPROVAL_STATES]).optional(),
5232
+ approval: z32.object({
5233
+ approval_id: z32.string(),
5234
+ approval_url: z32.string(),
5235
+ expires_at: z32.string(),
5236
+ state: z32.enum(APPROVAL_STATES),
5237
+ result_code: z32.string().nullable().optional(),
5238
+ result: z32.record(z32.string(), z32.unknown()).optional(),
5239
+ next: z32.string().optional()
5168
5240
  }).optional()
5169
5241
  });
5170
5242
  var spec = (name) => {
@@ -5210,10 +5282,10 @@ var has = (rt, operationId) => {
5210
5282
  return !!op && rt.scopes.includes(op.scope);
5211
5283
  };
5212
5284
  var isoWindow = {
5213
- start: z31.string().max(40).describe("RFC 3339 start of the window, e.g. 2026-10-26T00:00:00Z. Required with end."),
5214
- end: z31.string().max(40).describe("RFC 3339 end of the window. The plan limits its length.")
5285
+ start: z32.string().max(40).describe("RFC 3339 start of the window, e.g. 2026-10-26T00:00:00Z. Required with end."),
5286
+ end: z32.string().max(40).describe("RFC 3339 end of the window. The plan limits its length.")
5215
5287
  };
5216
- var traceIdSchema = z31.string().regex(/^[0-9a-fA-F]{32}$/);
5288
+ var traceIdSchema = z32.string().regex(/^[0-9a-fA-F]{32}$/);
5217
5289
  var MONITOR_KINDS2 = {
5218
5290
  cron: { list: "monitors.list", get: "monitors.get", idField: "monitor_id" },
5219
5291
  uptime: { list: "uptime.list", get: "uptime.get", idField: "check_id" },
@@ -5277,8 +5349,8 @@ function describe(op, scopes) {
5277
5349
  destructive: isDestructiveOperation(op)
5278
5350
  };
5279
5351
  }
5280
- var params = z31.record(z31.string(), z31.unknown()).default({}).describe("Operation fields in wire names (snake_case), as describe_operation's args_schema shows.");
5281
- var operationIdArg = z31.string().min(3).max(80).describe("An operation id from search_operations, e.g. `monitors.update`.");
5352
+ var params = z32.record(z32.string(), z32.unknown()).default({}).describe("Operation fields in wire names (snake_case), as describe_operation's args_schema shows.");
5353
+ var operationIdArg = z32.string().min(3).max(80).describe("An operation id from search_operations, e.g. `monitors.update`.");
5282
5354
  function approvalBlock(t, next) {
5283
5355
  return {
5284
5356
  approval_id: t.approval_id,
@@ -5298,7 +5370,7 @@ var MCP_TOOL_DEFS = [
5298
5370
  title: "Workspace and node",
5299
5371
  description: "The workspace this token belongs to (name, plan, limits) and the state of its node, the server that stores errors, traces and logs. Start here to learn what the token can reach.",
5300
5372
  operations: ["workspace.get", "node.get"],
5301
- input: z31.object({}),
5373
+ input: z32.object({}),
5302
5374
  async run(_args, rt) {
5303
5375
  const [ws, node] = await Promise.all([rt.call("workspace.get", {}), rt.call("node.get", {})]);
5304
5376
  if (!ws.ok)
@@ -5320,9 +5392,9 @@ var MCP_TOOL_DEFS = [
5320
5392
  title: "Get an issue",
5321
5393
  description: "One issue with its 24 h and 30 d counts and, when the token can read events, its latest event (stack trace, request, breadcrumbs — scrubbed on the node). A resolved issue also carries `fix_status` when the token can read releases: fixed, unverified, not_fixed (with the event that broke it) or unknown, per environment.",
5322
5394
  operations: ["issues.get", "events.get", "issues.fix_status"],
5323
- input: z31.object({
5324
- issue_id: z31.number().int().positive().describe("Issue id from search_issues."),
5325
- include_latest_event: z31.boolean().default(true)
5395
+ input: z32.object({
5396
+ issue_id: z32.number().int().positive().describe("Issue id from search_issues."),
5397
+ include_latest_event: z32.boolean().default(true)
5326
5398
  }),
5327
5399
  async run(args, rt) {
5328
5400
  const omitted = [];
@@ -5363,9 +5435,9 @@ var MCP_TOOL_DEFS = [
5363
5435
  title: "Get a trace",
5364
5436
  description: "Summary of one distributed trace (services, duration, errors) by its 32-hex trace id, and optionally its spans (errors only, or the first page).",
5365
5437
  operations: ["traces.get", "traces.spans"],
5366
- input: z31.object({
5438
+ input: z32.object({
5367
5439
  trace_id: traceIdSchema.describe("W3C trace id, 32 hex characters."),
5368
- spans: z31.enum(["none", "errors", "all"]).default("none")
5440
+ spans: z32.enum(["none", "errors", "all"]).default("none")
5369
5441
  }),
5370
5442
  async run(args, rt) {
5371
5443
  const sum = await rt.call("traces.get", { trace_id: args["trace_id"] });
@@ -5397,17 +5469,17 @@ var MCP_TOOL_DEFS = [
5397
5469
  title: "Query metrics",
5398
5470
  description: "OpenTelemetry metrics of one project. Without `name`: the metric catalog (name, type, unit, series count, last seen; `q` narrows by name) and the node's series caps. With `name` plus start and end: the metric aggregated per step — `aggregation` defaults to rate for counters, p95 for histograms and avg for gauges — optionally filtered by attributes (`attrs`, JSON list of {k, op, v}) and grouped by up to two attribute keys (`group_by`, comma-separated). Exemplar trace ids open with get_trace.",
5399
5471
  operations: ["metrics.names", "metrics.query"],
5400
- input: z31.object({
5401
- project: z31.number().int().positive().describe("Numeric project id from list_projects."),
5402
- name: z31.string().regex(METRIC_NAME_RE).optional().describe("Metric name from the catalog, e.g. http.server.request.duration."),
5403
- q: z31.string().max(255).optional().describe("Catalog only: part of a metric name."),
5404
- aggregation: z31.enum(METRIC_AGGREGATIONS).optional(),
5472
+ input: z32.object({
5473
+ project: z32.number().int().positive().describe("Numeric project id from list_projects."),
5474
+ name: z32.string().regex(METRIC_NAME_RE).optional().describe("Metric name from the catalog, e.g. http.server.request.duration."),
5475
+ q: z32.string().max(255).optional().describe("Catalog only: part of a metric name."),
5476
+ aggregation: z32.enum(METRIC_AGGREGATIONS).optional(),
5405
5477
  start: isoWindow.start.optional(),
5406
5478
  end: isoWindow.end.optional(),
5407
- step: z31.number().int().min(60).max(86400).multipleOf(60).optional().describe("Seconds per point (whole minutes); picked from the window when absent."),
5408
- attrs: z31.string().max(2000).optional(),
5409
- group_by: z31.string().max(600).optional(),
5410
- environment: z31.string().max(2000).optional().describe("Comma-separated environments.")
5479
+ step: z32.number().int().min(60).max(86400).multipleOf(60).optional().describe("Seconds per point (whole minutes); picked from the window when absent."),
5480
+ attrs: z32.string().max(2000).optional(),
5481
+ group_by: z32.string().max(600).optional(),
5482
+ environment: z32.string().max(2000).optional().describe("Comma-separated environments.")
5411
5483
  }),
5412
5484
  async run(args, rt) {
5413
5485
  const scope = {
@@ -5462,8 +5534,8 @@ var MCP_TOOL_DEFS = [
5462
5534
  title: "Release health",
5463
5535
  description: "What changed with a release (spec 13). With `version`: that release in one environment against the previous one (or `compare`) — three lists for its first 24 hours: new issues, regressed issues and increased issues (≥ 2× events per hour and ≥ 10 events), up to 50 each with hourly sparklines, plus its deploy markers. Without `version`: the project's releases, newest deploy first, with those three counts. `environment` defaults to production (else the busiest). Whether a resolved issue is really fixed: get_issue returns its fix status.",
5464
5536
  operations: ["releases.list", "releases.health"],
5465
- input: z31.object({
5466
- project: z31.number().int().positive().describe("Numeric project id from list_projects."),
5537
+ input: z32.object({
5538
+ project: z32.number().int().positive().describe("Numeric project id from list_projects."),
5467
5539
  version: releaseNameSchema.optional().describe("Release name exactly as the SDK sends it, e.g. web@1.4.2."),
5468
5540
  environment: environmentNameSchema.optional().describe("One environment, e.g. production."),
5469
5541
  compare: releaseNameSchema.optional().describe("With version: compare against this release instead of the previous one.")
@@ -5495,11 +5567,11 @@ var MCP_TOOL_DEFS = [
5495
5567
  title: "Correlate by trace or run",
5496
5568
  description: "Everything that shares one W3C trace id or one Belvador run id (`belvador.run.id`, set by job monitors) in a time window: the trace summary, its error spans and the logs. Give exactly one of trace_id or run_id.",
5497
5569
  operations: ["traces.get", "traces.spans", "spans.list", "logs.list"],
5498
- input: z31.object({
5570
+ input: z32.object({
5499
5571
  trace_id: traceIdSchema.optional(),
5500
- run_id: z31.string().min(1).max(128).optional(),
5572
+ run_id: z32.string().min(1).max(128).optional(),
5501
5573
  ...isoWindow,
5502
- project: z31.string().max(2000).optional().describe("Comma-separated project ids.")
5574
+ project: z32.string().max(2000).optional().describe("Comma-separated project ids.")
5503
5575
  }),
5504
5576
  async run(args, rt) {
5505
5577
  const trace = args["trace_id"];
@@ -5558,10 +5630,10 @@ var MCP_TOOL_DEFS = [
5558
5630
  title: "List monitors",
5559
5631
  description: "Monitors (cron, heartbeat, count, assertion, deadline, progress), uptime checks and SLOs with their current status. `kind` narrows to one family; `project_id` to one project (cron and uptime).",
5560
5632
  operations: ["monitors.list", "uptime.list", "slos.list"],
5561
- input: z31.object({
5562
- kind: z31.enum(["all", "cron", "uptime", "slo"]).default("all"),
5563
- project_id: z31.number().int().positive().optional(),
5564
- limit: z31.number().int().min(1).max(200).default(50)
5633
+ input: z32.object({
5634
+ kind: z32.enum(["all", "cron", "uptime", "slo"]).default("all"),
5635
+ project_id: z32.number().int().positive().optional(),
5636
+ limit: z32.number().int().min(1).max(200).default(50)
5565
5637
  }),
5566
5638
  async run(args, rt) {
5567
5639
  const kinds = args["kind"] && args["kind"] !== "all" ? [args["kind"]] : ["cron", "uptime", "slo"];
@@ -5596,10 +5668,10 @@ var MCP_TOOL_DEFS = [
5596
5668
  "monitors.occurrences",
5597
5669
  "monitors.backtest"
5598
5670
  ],
5599
- input: z31.object({
5600
- kind: z31.enum(["cron", "uptime", "slo"]),
5601
- id: z31.guid(),
5602
- backtest: z31.boolean().default(false)
5671
+ input: z32.object({
5672
+ kind: z32.enum(["cron", "uptime", "slo"]),
5673
+ id: z32.guid(),
5674
+ backtest: z32.boolean().default(false)
5603
5675
  }),
5604
5676
  async run(args, rt) {
5605
5677
  const k = MONITOR_KINDS2[args["kind"]];
@@ -5659,9 +5731,9 @@ var MCP_TOOL_DEFS = [
5659
5731
  title: "Send a test event",
5660
5732
  description: "Asks the node to send one tagged test error through the public intake of a project, proving the path real errors take. Not read-only: it creates one test event (reuse idempotency_key to retry without a second one).",
5661
5733
  operations: ["projects.send_test_event"],
5662
- input: z31.object({
5663
- project_id: z31.number().int().positive(),
5664
- idempotency_key: z31.string().min(8).max(255).optional()
5734
+ input: z32.object({
5735
+ project_id: z32.number().int().positive(),
5736
+ idempotency_key: z32.string().min(8).max(255).optional()
5665
5737
  }),
5666
5738
  async run(args, rt) {
5667
5739
  const r = await rt.call("projects.send_test_event", { project_id: args["project_id"] }, { idempotencyKey: args["idempotency_key"] ?? rt.newKey() });
@@ -5679,9 +5751,9 @@ var MCP_TOOL_DEFS = [
5679
5751
  title: "Find a configuration change",
5680
5752
  description: "Searches what this token can change in its Belvador workspace: projects, keys and tokens, monitors of every type, maintenance windows, occurrences, uptime checks, SLOs, alert rules and destinations, members, service accounts and the node. Returns operation ids for describe_operation and plan_change, whether a person must approve the change, and whether this token holds the scope.",
5681
5753
  operations: [],
5682
- input: z31.object({
5683
- query: z31.string().min(1).max(200).describe("Words such as `rotate dsn key`, `heartbeat monitor`, `slack alert`."),
5684
- limit: z31.number().int().min(1).max(20).default(10)
5754
+ input: z32.object({
5755
+ query: z32.string().min(1).max(200).describe("Words such as `rotate dsn key`, `heartbeat monitor`, `slack alert`."),
5756
+ limit: z32.number().int().min(1).max(20).default(10)
5685
5757
  }),
5686
5758
  async run(args, rt) {
5687
5759
  const q = words(String(args["query"]));
@@ -5709,7 +5781,7 @@ var MCP_TOOL_DEFS = [
5709
5781
  title: "Describe a configuration change",
5710
5782
  description: "Everything needed to call one operation: its fields (JSON Schema, wire names), the scope, whether it needs If-Match (call plan_change for the current ETag), an idempotency key, or a person's approval, and which fields the approving person types on belvador.dev instead of the agent.",
5711
5783
  operations: [],
5712
- input: z31.object({ operation_id: operationIdArg }),
5784
+ input: z32.object({ operation_id: operationIdArg }),
5713
5785
  async run(args, rt) {
5714
5786
  const op = configureOp(args["operation_id"]);
5715
5787
  if (!op || op.method === "GET")
@@ -5738,7 +5810,7 @@ var MCP_TOOL_DEFS = [
5738
5810
  title: "Check a change before applying it",
5739
5811
  description: "Validates params for one operation without changing anything: field errors, missing scope, whether a person must approve, and — when the resource can be read — its current state, the fields that would change and the ETag to pass as if_match.",
5740
5812
  operations: [],
5741
- input: z31.object({ operation_id: operationIdArg, params }),
5813
+ input: z32.object({ operation_id: operationIdArg, params }),
5742
5814
  async run(args, rt) {
5743
5815
  const op = configureOp(args["operation_id"]);
5744
5816
  if (!op || op.method === "GET")
@@ -5787,11 +5859,11 @@ var MCP_TOOL_DEFS = [
5787
5859
  title: "Apply a configuration change",
5788
5860
  description: "Runs one operation with params (validate first with plan_change). Always send idempotency_key: repeating a call with the same key never applies it twice. Sensitive operations answer approval_required with an approval_url a person opens on belvador.dev; nothing changes until they approve with their authenticator code.",
5789
5861
  operations: [],
5790
- input: z31.object({
5862
+ input: z32.object({
5791
5863
  operation_id: operationIdArg,
5792
5864
  params,
5793
- idempotency_key: z31.string().min(8).max(255).describe("Unique per change; reuse it to retry or to fetch the result."),
5794
- if_match: z31.string().max(200).optional().describe("ETag from plan_change, for operations that need it.")
5865
+ idempotency_key: z32.string().min(8).max(255).describe("Unique per change; reuse it to retry or to fetch the result."),
5866
+ if_match: z32.string().max(200).optional().describe("ETag from plan_change, for operations that need it.")
5795
5867
  }),
5796
5868
  async run(args, rt) {
5797
5869
  const op = configureOp(args["operation_id"]);
@@ -5852,7 +5924,7 @@ var MCP_TOOL_DEFS = [
5852
5924
  title: "Follow an approval",
5853
5925
  description: "State of a change waiting for a person's approval: pending, approved, executed (with the ids it produced), rejected, expired or failed (with the error code).",
5854
5926
  operations: ["approvals.get"],
5855
- input: z31.object({ approval_id: z31.guid().describe("approval_id from apply_change.") }),
5927
+ input: z32.object({ approval_id: z32.guid().describe("approval_id from apply_change.") }),
5856
5928
  async run(args, rt) {
5857
5929
  const r = await rt.call("approvals.get", { approval_id: args["approval_id"] });
5858
5930
  if (!r.ok)
@@ -5872,10 +5944,10 @@ var MCP_TOOL_DEFS = [
5872
5944
  title: "Search Belvador docs",
5873
5945
  description: "Searches the public Belvador documentation (titles and summaries) and returns the best pages with their slugs for get_doc.",
5874
5946
  operations: [],
5875
- input: z31.object({
5876
- query: z31.string().min(1).max(200),
5877
- locale: z31.enum(["en", "vi"]).default("en"),
5878
- limit: z31.number().int().min(1).max(10).default(5)
5947
+ input: z32.object({
5948
+ query: z32.string().min(1).max(200),
5949
+ locale: z32.enum(["en", "vi"]).default("en"),
5950
+ limit: z32.number().int().min(1).max(10).default(5)
5879
5951
  }),
5880
5952
  async run(args, rt) {
5881
5953
  const locale = args["locale"] ?? "en";
@@ -5891,9 +5963,9 @@ var MCP_TOOL_DEFS = [
5891
5963
  title: "Read a docs page",
5892
5964
  description: "The Markdown of one public Belvador docs page by slug (e.g. `quickstart`, `sdk/react`, `reference/api`).",
5893
5965
  operations: [],
5894
- input: z31.object({
5895
- slug: z31.string().regex(/^[a-z0-9][a-z0-9/-]{0,120}$/),
5896
- locale: z31.enum(["en", "vi"]).default("en")
5966
+ input: z32.object({
5967
+ slug: z32.string().regex(/^[a-z0-9][a-z0-9/-]{0,120}$/),
5968
+ locale: z32.enum(["en", "vi"]).default("en")
5897
5969
  }),
5898
5970
  async run(args, rt) {
5899
5971
  const locale = args["locale"] ?? "en";
@@ -6087,7 +6159,7 @@ function findToken(env = process.env, keychain = keychainToken) {
6087
6159
  }
6088
6160
 
6089
6161
  // packages/mcp/src/cli.ts
6090
- var PACKAGE_VERSION = "0.6.0";
6162
+ var PACKAGE_VERSION = "0.7.0";
6091
6163
  var HELP = `belvador-mcp ${PACKAGE_VERSION} — Belvador MCP server (stdio)
6092
6164
 
6093
6165
  Usage: npx -y @belvador/mcp [--toolsets=${MCP_DEFAULT_TOOLSETS.join(",")}]