@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.
- package/dist/cli.js +490 -418
- 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
|
|
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
|
|
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 =
|
|
3392
|
-
var csv =
|
|
3393
|
-
var
|
|
3394
|
-
var
|
|
3395
|
-
var
|
|
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:
|
|
3398
|
-
end:
|
|
3450
|
+
start: z23.string().max(40).optional(),
|
|
3451
|
+
end: z23.string().max(40).optional()
|
|
3399
3452
|
};
|
|
3400
|
-
var traceId =
|
|
3401
|
-
var spanId =
|
|
3402
|
-
var attrs =
|
|
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:
|
|
3458
|
+
project: projectIds2.optional(),
|
|
3406
3459
|
environment: csv.optional(),
|
|
3407
3460
|
service: csv.optional(),
|
|
3408
3461
|
attrs
|
|
3409
3462
|
};
|
|
3410
|
-
var issueChange =
|
|
3411
|
-
|
|
3412
|
-
action:
|
|
3413
|
-
inNextRelease:
|
|
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
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
action:
|
|
3420
|
-
mode:
|
|
3421
|
-
events:
|
|
3422
|
-
users:
|
|
3423
|
-
until:
|
|
3424
|
-
}),
|
|
3425
|
-
|
|
3426
|
-
|
|
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:
|
|
3430
|
-
project:
|
|
3431
|
-
status:
|
|
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:
|
|
3489
|
+
assignee: z23.string().max(64).optional(),
|
|
3437
3490
|
period: period.optional(),
|
|
3438
|
-
q:
|
|
3439
|
-
sort:
|
|
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:
|
|
3494
|
+
limit: z23.number().int().min(1).max(100).optional()
|
|
3442
3495
|
}),
|
|
3443
|
-
issue:
|
|
3444
|
-
issueStats:
|
|
3445
|
-
issueEvents:
|
|
3446
|
-
issueEvent:
|
|
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:
|
|
3501
|
+
eventId: z23.string().regex(/^([0-9a-f]{32}|latest|oldest)$/)
|
|
3449
3502
|
}),
|
|
3450
|
-
issueUpdate:
|
|
3451
|
-
issuesBulk:
|
|
3452
|
-
issueIds:
|
|
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:
|
|
3508
|
+
spansList: z23.object({
|
|
3456
3509
|
...telemetryCommon,
|
|
3457
|
-
operation:
|
|
3458
|
-
status:
|
|
3459
|
-
kind:
|
|
3460
|
-
minDurationMs:
|
|
3461
|
-
maxDurationMs:
|
|
3462
|
-
mode:
|
|
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:
|
|
3518
|
+
spansHistogram: z23.object({
|
|
3466
3519
|
...telemetryCommon,
|
|
3467
|
-
operation:
|
|
3468
|
-
status:
|
|
3520
|
+
operation: z23.string().min(1).max(1024).optional(),
|
|
3521
|
+
status: z23.enum(["unset", "ok", "error"]).optional()
|
|
3469
3522
|
}),
|
|
3470
|
-
trace:
|
|
3471
|
-
traceSpans:
|
|
3472
|
-
span:
|
|
3473
|
-
logsList:
|
|
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:
|
|
3528
|
+
severityMin: z23.enum(["trace", "debug", "info", "warn", "error", "fatal"]).optional(),
|
|
3476
3529
|
traceId: traceId.optional(),
|
|
3477
3530
|
spanId: spanId.optional(),
|
|
3478
|
-
q:
|
|
3479
|
-
order:
|
|
3531
|
+
q: z23.string().max(500).optional(),
|
|
3532
|
+
order: z23.enum(["asc", "desc"]).optional(),
|
|
3480
3533
|
cursor: nodeCursor
|
|
3481
3534
|
}),
|
|
3482
|
-
logsFacets:
|
|
3535
|
+
logsFacets: z23.object({
|
|
3483
3536
|
...telemetryCommon,
|
|
3484
|
-
severityMin:
|
|
3485
|
-
q:
|
|
3486
|
-
}),
|
|
3487
|
-
logAround:
|
|
3488
|
-
logId:
|
|
3489
|
-
at:
|
|
3490
|
-
same:
|
|
3491
|
-
before:
|
|
3492
|
-
after:
|
|
3493
|
-
}),
|
|
3494
|
-
metricsNames:
|
|
3495
|
-
project:
|
|
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:
|
|
3550
|
+
q: z23.string().max(255).optional()
|
|
3498
3551
|
}),
|
|
3499
|
-
metricsSeries:
|
|
3500
|
-
project:
|
|
3501
|
-
name:
|
|
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:
|
|
3557
|
+
cursor: z23.string().regex(/^[0-9a-f]{16}$/).optional()
|
|
3505
3558
|
}),
|
|
3506
|
-
metricsQuery:
|
|
3507
|
-
project:
|
|
3508
|
-
name:
|
|
3509
|
-
aggregation:
|
|
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:
|
|
3564
|
+
step: z23.number().int().min(METRIC_QUERY.minStepSeconds).max(METRIC_QUERY.maxStepSeconds).multipleOf(60).optional(),
|
|
3512
3565
|
attrs,
|
|
3513
|
-
groupBy:
|
|
3566
|
+
groupBy: z23.string().min(1).max(600).optional(),
|
|
3514
3567
|
environment: csv.optional()
|
|
3515
3568
|
}),
|
|
3516
|
-
telemetryUsage:
|
|
3517
|
-
project:
|
|
3518
|
-
days:
|
|
3569
|
+
telemetryUsage: z23.object({
|
|
3570
|
+
project: projectIds2.optional(),
|
|
3571
|
+
days: z23.number().int().min(1).max(31).optional()
|
|
3519
3572
|
}),
|
|
3520
|
-
monitorSignal:
|
|
3521
|
-
monitorId:
|
|
3522
|
-
hours:
|
|
3573
|
+
monitorSignal: z23.object({
|
|
3574
|
+
monitorId: z23.guid(),
|
|
3575
|
+
hours: z23.number().int().min(1).max(24).optional()
|
|
3523
3576
|
}),
|
|
3524
|
-
monitorOccurrences:
|
|
3525
|
-
monitorId:
|
|
3526
|
-
state:
|
|
3527
|
-
environment:
|
|
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:
|
|
3531
|
-
project:
|
|
3583
|
+
monitorBacktest: z23.object({
|
|
3584
|
+
project: z23.number().int().positive(),
|
|
3532
3585
|
settings: backtestSettingsSchema
|
|
3533
3586
|
}),
|
|
3534
|
-
occurrenceCreate:
|
|
3535
|
-
project:
|
|
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:
|
|
3542
|
-
project:
|
|
3543
|
-
monitorSlug:
|
|
3544
|
-
occurrenceId:
|
|
3545
|
-
environment:
|
|
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
|
-
|
|
3548
|
-
project:
|
|
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:
|
|
3552
|
-
project:
|
|
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:
|
|
3558
|
-
project:
|
|
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:
|
|
3568
|
-
scope:
|
|
3569
|
-
project:
|
|
3570
|
-
environment:
|
|
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
|
|
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
|
|
3966
|
+
import { z as z25 } from "zod";
|
|
3899
3967
|
|
|
3900
3968
|
// ../src/shared/contracts/privacy.ts
|
|
3901
|
-
import { z as
|
|
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
|
|
3932
|
-
var
|
|
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:
|
|
3935
|
-
type:
|
|
3936
|
-
method:
|
|
3937
|
-
pattern:
|
|
3938
|
-
ignoreCase:
|
|
3939
|
-
replaceWith:
|
|
3940
|
-
enabled:
|
|
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 =
|
|
3943
|
-
mode:
|
|
3944
|
-
rules:
|
|
3945
|
-
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 =
|
|
3948
|
-
schema:
|
|
3949
|
-
version:
|
|
3950
|
-
mode:
|
|
3951
|
-
rules:
|
|
3952
|
-
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 =
|
|
3955
|
-
var privacyRollupSchema =
|
|
3956
|
-
applied_version:
|
|
3957
|
-
policy_missing_24h:
|
|
3958
|
-
budget_exceeded_24h:
|
|
3959
|
-
sdk_versions:
|
|
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:
|
|
3965
|
-
set:
|
|
4035
|
+
get: z25.object({ workspaceId: uuid, projectId }),
|
|
4036
|
+
set: z25.object({
|
|
3966
4037
|
workspaceId: uuid,
|
|
3967
4038
|
projectId,
|
|
3968
|
-
expectedVersion:
|
|
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
|
|
4079
|
+
import { z as z29 } from "zod";
|
|
4009
4080
|
|
|
4010
4081
|
// ../src/shared/contracts/ingest-keys.ts
|
|
4011
|
-
import { z as
|
|
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 =
|
|
4022
|
-
v:
|
|
4023
|
-
key_id:
|
|
4024
|
-
project_public_id:
|
|
4025
|
-
project_id:
|
|
4026
|
-
workspace_id:
|
|
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:
|
|
4029
|
-
environments:
|
|
4030
|
-
expires_at:
|
|
4031
|
-
state:
|
|
4032
|
-
workspace_status:
|
|
4033
|
-
ingest_kill:
|
|
4034
|
-
telemetry_kill:
|
|
4035
|
-
telemetry_rate_bytes_per_sec:
|
|
4036
|
-
telemetry_burst_bytes:
|
|
4037
|
-
traces_monthly_bytes:
|
|
4038
|
-
logs_monthly_bytes:
|
|
4039
|
-
metrics_monthly_bytes:
|
|
4040
|
-
telemetry_buffer_minutes:
|
|
4041
|
-
revision:
|
|
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 =
|
|
4044
|
-
projectId:
|
|
4045
|
-
name:
|
|
4046
|
-
scopes:
|
|
4047
|
-
environments:
|
|
4048
|
-
expiresAt:
|
|
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 =
|
|
4051
|
-
id:
|
|
4052
|
-
project_id:
|
|
4053
|
-
name:
|
|
4054
|
-
prefix:
|
|
4055
|
-
scopes:
|
|
4056
|
-
environments:
|
|
4057
|
-
expires_at:
|
|
4058
|
-
state:
|
|
4059
|
-
created_by:
|
|
4060
|
-
created_at:
|
|
4061
|
-
revoked_at:
|
|
4062
|
-
last_used_at:
|
|
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
|
|
4137
|
+
import { z as z28 } from "zod";
|
|
4067
4138
|
|
|
4068
4139
|
// ../src/shared/contracts/backup.ts
|
|
4069
|
-
import { z as
|
|
4140
|
+
import { z as z27 } from "zod";
|
|
4070
4141
|
var BACKUP_KINDS = ["daily", "weekly", "manual", "pre_upgrade"];
|
|
4071
|
-
var ageRecipient =
|
|
4072
|
-
var backupIdSchema =
|
|
4073
|
-
var nodeBackupConfigSchema =
|
|
4074
|
-
enabled:
|
|
4075
|
-
hour_utc:
|
|
4076
|
-
weekly_day:
|
|
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 =
|
|
4080
|
-
mode:
|
|
4150
|
+
var backupCredentialsRequestSchema = z27.object({
|
|
4151
|
+
mode: z27.enum(["upload", "download"]),
|
|
4081
4152
|
backup_id: backupIdSchema,
|
|
4082
|
-
source_node_id:
|
|
4153
|
+
source_node_id: z27.guid().optional()
|
|
4083
4154
|
});
|
|
4084
|
-
var backupCredentialsSchema =
|
|
4085
|
-
endpoint:
|
|
4086
|
-
bucket:
|
|
4087
|
-
prefix:
|
|
4088
|
-
access_key_id:
|
|
4089
|
-
secret_access_key:
|
|
4090
|
-
session_token:
|
|
4091
|
-
expires_at:
|
|
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 =
|
|
4094
|
-
var backupManifestSchema =
|
|
4095
|
-
v:
|
|
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:
|
|
4098
|
-
kind:
|
|
4099
|
-
created_at:
|
|
4100
|
-
object_key:
|
|
4101
|
-
size_bytes:
|
|
4102
|
-
sha256:
|
|
4103
|
-
clickhouse_version:
|
|
4104
|
-
schema_version:
|
|
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:
|
|
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 =
|
|
4191
|
+
var backupReportSchema = z27.object({
|
|
4121
4192
|
backup_id: backupIdSchema,
|
|
4122
|
-
kind:
|
|
4123
|
-
status:
|
|
4124
|
-
started_at:
|
|
4125
|
-
finished_at:
|
|
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:
|
|
4198
|
+
error_code: z27.enum(BACKUP_ERROR_CODES).nullable()
|
|
4128
4199
|
});
|
|
4129
|
-
var drillReportSchema =
|
|
4200
|
+
var drillReportSchema = z27.object({
|
|
4130
4201
|
backup_id: backupIdSchema,
|
|
4131
|
-
kind:
|
|
4132
|
-
status:
|
|
4133
|
-
finished_at:
|
|
4134
|
-
detail:
|
|
4135
|
-
error_code:
|
|
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 =
|
|
4138
|
-
v:
|
|
4139
|
-
node_id:
|
|
4140
|
-
seal:
|
|
4141
|
-
publicKey:
|
|
4142
|
-
privateKey:
|
|
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:
|
|
4215
|
+
created_at: z27.string().datetime()
|
|
4145
4216
|
});
|
|
4146
|
-
var restoreArgsSchema =
|
|
4147
|
-
job_id:
|
|
4148
|
-
workspace_id:
|
|
4149
|
-
source_node_id:
|
|
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:
|
|
4152
|
-
mode:
|
|
4222
|
+
sealed_identity: z27.string().regex(/^[A-Za-z0-9_-]{40,2000}$/),
|
|
4223
|
+
mode: z27.enum(["rebuild", "drill"])
|
|
4153
4224
|
});
|
|
4154
|
-
var restoreReportSchema =
|
|
4155
|
-
job_id:
|
|
4225
|
+
var restoreReportSchema = z27.object({
|
|
4226
|
+
job_id: z27.guid(),
|
|
4156
4227
|
backup_id: backupIdSchema,
|
|
4157
|
-
mode:
|
|
4158
|
-
status:
|
|
4159
|
-
finished_at:
|
|
4160
|
-
detail:
|
|
4161
|
-
error_code:
|
|
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 =
|
|
4176
|
-
var publicKey =
|
|
4177
|
-
var nodeConfigSchema =
|
|
4178
|
-
v:
|
|
4179
|
-
config_version:
|
|
4180
|
-
node_id:
|
|
4181
|
-
workspace_id:
|
|
4182
|
-
workspace_status:
|
|
4183
|
-
issued_at:
|
|
4184
|
-
retention_days:
|
|
4185
|
-
channel:
|
|
4186
|
-
projects:
|
|
4187
|
-
project_id:
|
|
4188
|
-
slug:
|
|
4189
|
-
short_prefix:
|
|
4190
|
-
user_id_salt:
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
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:
|
|
4199
|
-
control_ops_keys:
|
|
4200
|
-
kill_switches:
|
|
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:
|
|
4203
|
-
monitors:
|
|
4204
|
-
purged_monitors:
|
|
4205
|
-
telemetry:
|
|
4206
|
-
traces_retention_days:
|
|
4207
|
-
logs_retention_days:
|
|
4208
|
-
traces_disk_share:
|
|
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:
|
|
4212
|
-
signal_monitors:
|
|
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 =
|
|
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 =
|
|
4220
|
-
var name3 =
|
|
4221
|
-
var label2 =
|
|
4222
|
-
var platform =
|
|
4223
|
-
var origin =
|
|
4224
|
-
var keyId =
|
|
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:
|
|
4227
|
-
update:
|
|
4228
|
-
updateIntake:
|
|
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:
|
|
4231
|
-
burst:
|
|
4232
|
-
allowedOrigins:
|
|
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:
|
|
4306
|
+
updateObservability: z29.object({
|
|
4235
4307
|
projectId,
|
|
4236
|
-
primaryEnvironment:
|
|
4237
|
-
allowCodeMonitors:
|
|
4308
|
+
primaryEnvironment: z29.string().trim().min(1).max(64).refine((v) => v !== "*" && ENVIRONMENT_RE.test(v)),
|
|
4309
|
+
allowCodeMonitors: z29.boolean()
|
|
4238
4310
|
}),
|
|
4239
|
-
setScrub:
|
|
4240
|
-
setCheckinAuth:
|
|
4241
|
-
setEnvironmentHidden:
|
|
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:
|
|
4244
|
-
hidden:
|
|
4245
|
-
}),
|
|
4246
|
-
scheduleDeletion:
|
|
4247
|
-
projectOnly:
|
|
4248
|
-
labelled:
|
|
4249
|
-
keyOnly:
|
|
4250
|
-
tokenOnly:
|
|
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:
|
|
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
|
|
4508
|
-
var list =
|
|
4579
|
+
import { z as z30 } from "zod";
|
|
4580
|
+
var list = z30.object({ workspaceId: uuid, limit: pageLimit, cursor });
|
|
4509
4581
|
var READ_INPUTS = {
|
|
4510
|
-
workspace:
|
|
4582
|
+
workspace: z30.object({ workspaceId: uuid }),
|
|
4511
4583
|
list,
|
|
4512
|
-
projectsGet:
|
|
4584
|
+
projectsGet: z30.object({ workspaceId: uuid, projectId }),
|
|
4513
4585
|
monitorsList: list.extend({ projectId: projectId.optional() }),
|
|
4514
|
-
monitorsGet:
|
|
4515
|
-
uptimeGet:
|
|
4516
|
-
slosGet:
|
|
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:
|
|
4590
|
+
state: z30.enum(["open", "resolved", "all"]).default("all"),
|
|
4519
4591
|
monitorId: uuid.optional()
|
|
4520
4592
|
}),
|
|
4521
|
-
approvalsGet:
|
|
4593
|
+
approvalsGet: z30.object({ workspaceId: uuid, approvalId: uuid }),
|
|
4522
4594
|
monitorsListTyped: list.extend({
|
|
4523
4595
|
projectId: projectId.optional(),
|
|
4524
|
-
type:
|
|
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
|
|
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 =
|
|
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
|
|
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 =
|
|
5123
|
-
untrusted:
|
|
5124
|
-
data:
|
|
5125
|
-
provenance:
|
|
5126
|
-
source:
|
|
5127
|
-
operations:
|
|
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:
|
|
5131
|
-
slug:
|
|
5132
|
-
locale:
|
|
5133
|
-
url:
|
|
5134
|
-
markdown:
|
|
5135
|
-
truncated:
|
|
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:
|
|
5138
|
-
slug:
|
|
5139
|
-
title:
|
|
5140
|
-
description:
|
|
5141
|
-
section:
|
|
5142
|
-
url:
|
|
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:
|
|
5145
|
-
complete:
|
|
5146
|
-
omitted:
|
|
5147
|
-
truncated:
|
|
5148
|
-
suspicious_unicode:
|
|
5149
|
-
error:
|
|
5150
|
-
code:
|
|
5151
|
-
status:
|
|
5152
|
-
detail:
|
|
5153
|
-
scope:
|
|
5154
|
-
retry_after:
|
|
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:
|
|
5157
|
-
operation:
|
|
5158
|
-
plan:
|
|
5159
|
-
status:
|
|
5160
|
-
approval:
|
|
5161
|
-
approval_id:
|
|
5162
|
-
approval_url:
|
|
5163
|
-
expires_at:
|
|
5164
|
-
state:
|
|
5165
|
-
result_code:
|
|
5166
|
-
result:
|
|
5167
|
-
next:
|
|
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:
|
|
5214
|
-
end:
|
|
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 =
|
|
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 =
|
|
5281
|
-
var operationIdArg =
|
|
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:
|
|
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:
|
|
5324
|
-
issue_id:
|
|
5325
|
-
include_latest_event:
|
|
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:
|
|
5438
|
+
input: z32.object({
|
|
5367
5439
|
trace_id: traceIdSchema.describe("W3C trace id, 32 hex characters."),
|
|
5368
|
-
spans:
|
|
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:
|
|
5401
|
-
project:
|
|
5402
|
-
name:
|
|
5403
|
-
q:
|
|
5404
|
-
aggregation:
|
|
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:
|
|
5408
|
-
attrs:
|
|
5409
|
-
group_by:
|
|
5410
|
-
environment:
|
|
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:
|
|
5466
|
-
project:
|
|
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:
|
|
5570
|
+
input: z32.object({
|
|
5499
5571
|
trace_id: traceIdSchema.optional(),
|
|
5500
|
-
run_id:
|
|
5572
|
+
run_id: z32.string().min(1).max(128).optional(),
|
|
5501
5573
|
...isoWindow,
|
|
5502
|
-
project:
|
|
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:
|
|
5562
|
-
kind:
|
|
5563
|
-
project_id:
|
|
5564
|
-
limit:
|
|
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:
|
|
5600
|
-
kind:
|
|
5601
|
-
id:
|
|
5602
|
-
backtest:
|
|
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:
|
|
5663
|
-
project_id:
|
|
5664
|
-
idempotency_key:
|
|
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:
|
|
5683
|
-
query:
|
|
5684
|
-
limit:
|
|
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:
|
|
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:
|
|
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:
|
|
5862
|
+
input: z32.object({
|
|
5791
5863
|
operation_id: operationIdArg,
|
|
5792
5864
|
params,
|
|
5793
|
-
idempotency_key:
|
|
5794
|
-
if_match:
|
|
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:
|
|
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:
|
|
5876
|
-
query:
|
|
5877
|
-
locale:
|
|
5878
|
-
limit:
|
|
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:
|
|
5895
|
-
slug:
|
|
5896
|
-
locale:
|
|
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.
|
|
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(",")}]
|