glimmervoid 0.35.0 → 0.36.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/README.md +2 -0
- package/dist/bin/glimmervoid.js +17 -12
- package/dist/chunks/{adapters-B37wqNti.js → adapters-BVozg-Lg.js} +1 -1
- package/dist/chunks/{adapters-CADejSpq.js → adapters-BdnLyJjf.js} +10 -49
- package/dist/chunks/{agent-api-cli-CRj_FYbz.js → agent-api-cli-DIqRLvu3.js} +1 -1
- package/dist/chunks/{agent-api-cli-vGwstJ1j.js → agent-api-cli-d-Bgsshx.js} +3 -3
- package/dist/chunks/{agent-api-core-D1233u1U.js → agent-api-core-BUC9WND7.js} +2 -2
- package/dist/chunks/{agent-setup-cli-BTAFcckd.js → agent-setup-cli-CH7EHsAX.js} +1 -1
- package/dist/chunks/{config-rPbbL4nW.js → config-CuZ16F9W.js} +47 -771
- package/dist/chunks/config-store-LqQ7MuyV.js +4181 -0
- package/dist/chunks/config-store-tVmt_nfm.js +1 -0
- package/dist/chunks/{contracts-DjIgIuDk.js → contracts-BLZAOP57.js} +55 -6
- package/dist/chunks/{grok-KKgdSe-7.js → grok-Ch4-35_r.js} +3 -3
- package/dist/chunks/{hook-command-core-DclEoE9e.js → hook-command-core-qTNK-xMF.js} +4 -1
- package/dist/chunks/{hook-tools-UX2fmt81.js → hook-tools-BkxllUHE.js} +9 -16
- package/dist/chunks/{knowledge-graph-cli-Rj5nj87L.js → knowledge-graph-cli-DD7QvcFd.js} +1 -1
- package/dist/chunks/{main-BTI0J5QE.js → main-Rmo83Ow-.js} +3087 -834
- package/dist/chunks/{pair-cli-Dcyzv3In.js → pair-cli-DzFeAmq5.js} +2 -2
- package/dist/chunks/{remote-config-Dd1T-VJA.js → remote-config-CPdSF2Xi.js} +1 -1
- package/dist/chunks/{rtk-hook-core-BmEz2aq9.js → rtk-hook-core-VrUafGAp.js} +15 -5
- package/dist/chunks/rtk-resolver-B8BPgN9L.js +1 -0
- package/dist/chunks/{rtk-resolver-B9pzjLsM.js → rtk-resolver-C_micGrL.js} +1 -1
- package/dist/chunks/session-B8RhqQJe.js +986 -0
- package/dist/chunks/{session-routes-BYy3am9m.js → session-routes-DB5aDKsx.js} +1 -1
- package/dist/chunks/settings-cli-C2TY6hl-.js +484 -0
- package/dist/chunks/{ssh-sign-cli-DPHpT22B.js → ssh-sign-cli-C2nUwJC-.js} +2 -2
- package/dist/client/assets/index-BIaSyXwH.css +1 -0
- package/dist/client/assets/index-Ddu7M4Ad.js +259 -0
- package/dist/client/index.html +5 -3
- package/dist/server/index.js +1 -1
- package/dist/session/hook-tool-relay.js +3 -3
- package/package.json +3 -3
- package/dist/chunks/config-store-BeIxAZNn.js +0 -1
- package/dist/chunks/config-store-BtsYbNC3.js +0 -1713
- package/dist/chunks/rtk-resolver-SWU5VVM7.js +0 -1
- package/dist/chunks/session-D6xXN0UU.js +0 -232
- package/dist/client/assets/index-DE2GUmqs.css +0 -1
- package/dist/client/assets/index-Ds4ngkHp.js +0 -254
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as GH_SEGMENT, E as TaskTitle, Et as repoParts, G as CommitSha, L as MyPrSearchNode, U as SessionPrLinks, W as repositoryName } from "./session-B8RhqQJe.js";
|
|
2
2
|
import { n as isRecord } from "./coerce-NSst8oRP.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -165,10 +165,27 @@ var FLYING_ANIMALS_SCALE_RANGE = Object.freeze({
|
|
|
165
165
|
min: .5,
|
|
166
166
|
max: 2
|
|
167
167
|
});
|
|
168
|
+
var FLYING_ANIMALS_DEFAULTS = Object.freeze({
|
|
169
|
+
flyingAnimalsMinGapSeconds: 20,
|
|
170
|
+
flyingAnimalsMaxGapSeconds: 40,
|
|
171
|
+
flyingAnimalsMinDurationSeconds: 6.9,
|
|
172
|
+
flyingAnimalsMaxDurationSeconds: 11.5,
|
|
173
|
+
flyingAnimalsScale: 1,
|
|
174
|
+
flyingAnimalsOnPhone: true
|
|
175
|
+
});
|
|
168
176
|
var REPLAY_BUFFER_KB_RANGE = Object.freeze({
|
|
169
177
|
min: 64,
|
|
170
178
|
max: 16384
|
|
171
179
|
});
|
|
180
|
+
var PORT_RANGE = Object.freeze({
|
|
181
|
+
min: 0,
|
|
182
|
+
max: 65535
|
|
183
|
+
});
|
|
184
|
+
var TASK_TITLE_TIMEOUT_RANGE = Object.freeze({
|
|
185
|
+
min: 0,
|
|
186
|
+
exclusiveMin: true,
|
|
187
|
+
max: 2147483647 / 1e3
|
|
188
|
+
});
|
|
172
189
|
var BRANCH_GC_STALE_DAYS_RANGE = POSITIVE_NUMBER_RANGE;
|
|
173
190
|
var BRANCH_GC_INTERVAL_MS_RANGE = POSITIVE_NUMBER_RANGE;
|
|
174
191
|
var VISIONS_QUIET_MS_RANGE = POSITIVE_NUMBER_RANGE;
|
|
@@ -250,6 +267,7 @@ Object.freeze({
|
|
|
250
267
|
FLYING_ANIMALS_SCALE_RANGE,
|
|
251
268
|
CHANGE_MAP_NARRATOR_TIMEOUT_RANGE,
|
|
252
269
|
KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE,
|
|
270
|
+
PORT_RANGE,
|
|
253
271
|
POSTHOG_ESCALATION_RANGE,
|
|
254
272
|
POSTHOG_FIX_TIMEOUT_RANGE,
|
|
255
273
|
POSTHOG_INTERVAL_RANGE,
|
|
@@ -261,6 +279,7 @@ Object.freeze({
|
|
|
261
279
|
POSTHOG_TRAFFIC_MIN_USERS_RANGE,
|
|
262
280
|
POSTHOG_TRAFFIC_MULTIPLIER_RANGE,
|
|
263
281
|
REPLAY_BUFFER_KB_RANGE,
|
|
282
|
+
TASK_TITLE_TIMEOUT_RANGE,
|
|
264
283
|
USAGE_BUDGET_RANGE,
|
|
265
284
|
USAGE_RETAIN_DAYS_RANGE,
|
|
266
285
|
USAGE_SCAN_INTERVAL_RANGE,
|
|
@@ -374,766 +393,6 @@ var USAGE_COST_MODES = Object.freeze([
|
|
|
374
393
|
var USAGE_VENDOR_KEYS = Object.freeze(["codex", "grok"]);
|
|
375
394
|
var USAGE_BUDGET_KEYS = Object.freeze(["dailyUsd", "monthlyUsd"]);
|
|
376
395
|
//#endregion
|
|
377
|
-
//#region shared/contracts/github-polling.ts
|
|
378
|
-
var GithubPollingRetry = z.object({
|
|
379
|
-
attempt: z.number().int().positive(),
|
|
380
|
-
limit: z.number().int().positive()
|
|
381
|
-
}).refine((retry) => retry.attempt <= retry.limit);
|
|
382
|
-
var githubPollingShape = {
|
|
383
|
-
error: z.string().nullable().optional(),
|
|
384
|
-
nextAttemptAt: z.number().finite().nonnegative().nullable().optional(),
|
|
385
|
-
retry: GithubPollingRetry.nullable().optional(),
|
|
386
|
-
isRefreshing: z.boolean().optional(),
|
|
387
|
-
refreshNotice: z.string().nullable().optional()
|
|
388
|
-
};
|
|
389
|
-
var GithubPollingRefreshRequest = z.object({ lane: z.enum([
|
|
390
|
-
"my-prs",
|
|
391
|
-
"team-review",
|
|
392
|
-
"issues"
|
|
393
|
-
]) });
|
|
394
|
-
var GithubPollingRefreshResult = z.object({
|
|
395
|
-
ok: z.boolean(),
|
|
396
|
-
error: z.string().optional()
|
|
397
|
-
});
|
|
398
|
-
//#endregion
|
|
399
|
-
//#region shared/contracts/github-ids.ts
|
|
400
|
-
var GH_SEGMENT = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
401
|
-
var REPO_SLUG_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*\/[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
402
|
-
var NODE_ID_RE = /^[A-Za-z0-9_=-]+$/;
|
|
403
|
-
function repoParts(repo) {
|
|
404
|
-
const parts = repo.split("/");
|
|
405
|
-
if (parts.length !== 2 || !parts.every((part) => GH_SEGMENT.test(part))) return null;
|
|
406
|
-
return [parts[0], parts[1]];
|
|
407
|
-
}
|
|
408
|
-
var HEX_SHA_RE = /^[0-9a-f]{7,40}$/i;
|
|
409
|
-
var FULL_SHA_RE = /^[0-9a-f]{40}$/;
|
|
410
|
-
function shortSha(sha, { chars = 7, validate = false } = {}) {
|
|
411
|
-
if (typeof sha !== "string" || !sha) return "";
|
|
412
|
-
if (!validate) return sha.slice(0, chars);
|
|
413
|
-
const text = sha.trim();
|
|
414
|
-
if (!HEX_SHA_RE.test(text)) return "";
|
|
415
|
-
return text.slice(0, chars).toLowerCase();
|
|
416
|
-
}
|
|
417
|
-
//#endregion
|
|
418
|
-
//#region shared/contracts/team-review.ts
|
|
419
|
-
var CommitSha = z.string().regex(FULL_SHA_RE);
|
|
420
|
-
var repoSlug = z.string().regex(/^[^/]+\/[^/]+$/);
|
|
421
|
-
var SearchedPr = z.object({
|
|
422
|
-
number: z.number().int().positive(),
|
|
423
|
-
title: z.string(),
|
|
424
|
-
html_url: z.string(),
|
|
425
|
-
draft: z.boolean().optional(),
|
|
426
|
-
created_at: z.string().optional(),
|
|
427
|
-
updated_at: z.string().optional(),
|
|
428
|
-
repository_url: z.string(),
|
|
429
|
-
user: z.object({
|
|
430
|
-
login: z.string(),
|
|
431
|
-
type: z.enum(["User", "Bot"])
|
|
432
|
-
}).passthrough(),
|
|
433
|
-
pull_request: z.object({}).passthrough()
|
|
434
|
-
}).passthrough();
|
|
435
|
-
var PrDetail = z.object({
|
|
436
|
-
number: z.number().int().positive(),
|
|
437
|
-
title: z.string(),
|
|
438
|
-
body: z.string(),
|
|
439
|
-
url: z.string(),
|
|
440
|
-
author: z.object({
|
|
441
|
-
login: z.string(),
|
|
442
|
-
is_bot: z.boolean().optional()
|
|
443
|
-
}).passthrough(),
|
|
444
|
-
isDraft: z.boolean(),
|
|
445
|
-
isCrossRepository: z.boolean(),
|
|
446
|
-
baseRefName: z.string(),
|
|
447
|
-
baseRefOid: CommitSha,
|
|
448
|
-
headRefOid: CommitSha,
|
|
449
|
-
additions: z.number().int().nonnegative(),
|
|
450
|
-
deletions: z.number().int().nonnegative(),
|
|
451
|
-
files: z.array(z.object({
|
|
452
|
-
path: z.string(),
|
|
453
|
-
additions: z.number().int().nonnegative(),
|
|
454
|
-
deletions: z.number().int().nonnegative()
|
|
455
|
-
}).passthrough())
|
|
456
|
-
}).passthrough();
|
|
457
|
-
var ReviewComment = z.object({
|
|
458
|
-
path: z.string(),
|
|
459
|
-
line: z.number().int().positive(),
|
|
460
|
-
side: z.enum(["RIGHT", "LEFT"]).default("RIGHT"),
|
|
461
|
-
body: z.string()
|
|
462
|
-
});
|
|
463
|
-
var LEGACY_VERDICTS = Object.freeze({
|
|
464
|
-
STAMP: "APPROVE",
|
|
465
|
-
COMMENT: "APPROVE WITH NITS",
|
|
466
|
-
NEEDS_YOU: "REQUEST CHANGES"
|
|
467
|
-
});
|
|
468
|
-
var ReviewVerdict = z.enum([
|
|
469
|
-
"APPROVE",
|
|
470
|
-
"APPROVE WITH NITS",
|
|
471
|
-
"REQUEST CHANGES",
|
|
472
|
-
"BLOCKED"
|
|
473
|
-
]);
|
|
474
|
-
var storedVerdict = z.preprocess((verdict) => typeof verdict === "string" && Object.hasOwn(LEGACY_VERDICTS, verdict) ? LEGACY_VERDICTS[verdict] : verdict, ReviewVerdict);
|
|
475
|
-
var FindingSeverity = z.enum([
|
|
476
|
-
"CRITICAL",
|
|
477
|
-
"HIGH",
|
|
478
|
-
"MEDIUM",
|
|
479
|
-
"LOW"
|
|
480
|
-
]);
|
|
481
|
-
var DraftComment = ReviewComment.extend({ severity: FindingSeverity.optional() });
|
|
482
|
-
var ReviewFinding = z.object({
|
|
483
|
-
path: z.string().min(1),
|
|
484
|
-
line: z.number().int().positive().nullable(),
|
|
485
|
-
side: z.enum(["RIGHT", "LEFT"]),
|
|
486
|
-
severity: FindingSeverity,
|
|
487
|
-
reviewer: z.string().min(1),
|
|
488
|
-
disposition: z.enum([
|
|
489
|
-
"ACTIONABLE",
|
|
490
|
-
"NIT",
|
|
491
|
-
"AMBIGUOUS"
|
|
492
|
-
]).nullable(),
|
|
493
|
-
body: z.string().min(1)
|
|
494
|
-
});
|
|
495
|
-
var ReviewAssessment = z.object({
|
|
496
|
-
goal: z.string().default(""),
|
|
497
|
-
change: z.string(),
|
|
498
|
-
checked: z.array(z.string()),
|
|
499
|
-
gaps: z.array(z.string())
|
|
500
|
-
});
|
|
501
|
-
var ReviewResult = z.object({
|
|
502
|
-
verdict: ReviewVerdict,
|
|
503
|
-
head: CommitSha,
|
|
504
|
-
summary: z.string(),
|
|
505
|
-
assessment: ReviewAssessment.nullable(),
|
|
506
|
-
findings: z.array(ReviewFinding)
|
|
507
|
-
});
|
|
508
|
-
var PostingPlan = z.object({
|
|
509
|
-
body: z.string(),
|
|
510
|
-
commit_id: CommitSha,
|
|
511
|
-
comments: z.array(z.object({
|
|
512
|
-
path: z.string().min(1),
|
|
513
|
-
line: z.number().int().positive(),
|
|
514
|
-
side: z.enum(["RIGHT", "LEFT"]).default("RIGHT"),
|
|
515
|
-
body: z.string().min(1)
|
|
516
|
-
}))
|
|
517
|
-
});
|
|
518
|
-
var PostedReviewEvent = z.enum(["APPROVE", "COMMENT"]);
|
|
519
|
-
var GithubReviewState = z.enum([
|
|
520
|
-
"APPROVED",
|
|
521
|
-
"CHANGES_REQUESTED",
|
|
522
|
-
"COMMENTED"
|
|
523
|
-
]);
|
|
524
|
-
var DECIDING_REVIEW_STATES = /* @__PURE__ */ new Set(["APPROVED", "CHANGES_REQUESTED"]);
|
|
525
|
-
var GithubReviewDecision = z.enum([
|
|
526
|
-
"APPROVED",
|
|
527
|
-
"CHANGES_REQUESTED",
|
|
528
|
-
"REVIEW_REQUIRED"
|
|
529
|
-
]);
|
|
530
|
-
var ReviewChecksState = z.enum([
|
|
531
|
-
"SUCCESS",
|
|
532
|
-
"FAILURE",
|
|
533
|
-
"PENDING",
|
|
534
|
-
"ERROR",
|
|
535
|
-
"EXPECTED"
|
|
536
|
-
]);
|
|
537
|
-
var reviewPriorityShape = {
|
|
538
|
-
requestSource: z.enum(["direct", "team"]).default("team"),
|
|
539
|
-
isDraft: z.boolean().optional(),
|
|
540
|
-
checksState: ReviewChecksState.nullable().optional()
|
|
541
|
-
};
|
|
542
|
-
var GithubReview = z.object({
|
|
543
|
-
login: z.string().min(1),
|
|
544
|
-
state: GithubReviewState,
|
|
545
|
-
commit: CommitSha.nullable(),
|
|
546
|
-
isViewer: z.boolean(),
|
|
547
|
-
submittedAt: z.string().nullable().optional()
|
|
548
|
-
});
|
|
549
|
-
function decisionAsIfApprovalRequired(githubDecision, opinionatedWriterReviewStates) {
|
|
550
|
-
if (githubDecision) return githubDecision;
|
|
551
|
-
if (opinionatedWriterReviewStates.includes("CHANGES_REQUESTED")) return "CHANGES_REQUESTED";
|
|
552
|
-
if (opinionatedWriterReviewStates.includes("APPROVED")) return "APPROVED";
|
|
553
|
-
return "REVIEW_REQUIRED";
|
|
554
|
-
}
|
|
555
|
-
function hasStandingViewerApproval(draft) {
|
|
556
|
-
if (draft.reviewDecision !== "APPROVED") return false;
|
|
557
|
-
if (draft.requeuedHead !== void 0 && draft.requeuedHead === (draft.liveHead ?? draft.reviewedHead)) return false;
|
|
558
|
-
return (draft.githubReviews ?? []).some((review) => review.isViewer && review.state === "APPROVED");
|
|
559
|
-
}
|
|
560
|
-
var PriorReview = z.object({
|
|
561
|
-
head: CommitSha,
|
|
562
|
-
base: CommitSha.optional(),
|
|
563
|
-
verdict: ReviewVerdict,
|
|
564
|
-
summary: z.string(),
|
|
565
|
-
body: z.string(),
|
|
566
|
-
comments: z.array(ReviewComment),
|
|
567
|
-
wasPosted: z.boolean()
|
|
568
|
-
});
|
|
569
|
-
var ReviewThreadId = z.string().min(1).max(256).regex(NODE_ID_RE);
|
|
570
|
-
var TeamReviewThreadResult = z.object({
|
|
571
|
-
addressed: z.boolean(),
|
|
572
|
-
reason: z.string().trim().min(1).max(4e3)
|
|
573
|
-
}).strict();
|
|
574
|
-
var TeamReviewThreadNode = z.object({
|
|
575
|
-
id: ReviewThreadId,
|
|
576
|
-
path: z.string(),
|
|
577
|
-
line: z.number().int().positive().nullable(),
|
|
578
|
-
isResolved: z.boolean(),
|
|
579
|
-
viewerCanResolve: z.boolean(),
|
|
580
|
-
comments: z.object({
|
|
581
|
-
pageInfo: z.object({
|
|
582
|
-
hasNextPage: z.boolean(),
|
|
583
|
-
endCursor: z.string().nullable().optional()
|
|
584
|
-
}),
|
|
585
|
-
nodes: z.array(z.object({
|
|
586
|
-
body: z.string(),
|
|
587
|
-
author: z.object({ login: z.string() }).nullable(),
|
|
588
|
-
viewerDidAuthor: z.boolean(),
|
|
589
|
-
createdAt: z.string().datetime(),
|
|
590
|
-
url: z.string().url(),
|
|
591
|
-
originalCommit: z.object({ oid: CommitSha }).nullable()
|
|
592
|
-
}))
|
|
593
|
-
})
|
|
594
|
-
});
|
|
595
|
-
var TeamReviewThreadCommentsResponse = z.object({ data: z.object({ node: z.object({ comments: TeamReviewThreadNode.shape.comments }).nullable() }).nullable() });
|
|
596
|
-
var TeamReviewThreadsRepository = z.object({ pullRequest: z.object({ reviewThreads: z.object({
|
|
597
|
-
pageInfo: z.object({
|
|
598
|
-
hasNextPage: z.boolean(),
|
|
599
|
-
endCursor: z.string().nullable().optional()
|
|
600
|
-
}),
|
|
601
|
-
nodes: z.array(TeamReviewThreadNode)
|
|
602
|
-
}) }).nullable() });
|
|
603
|
-
var TeamReviewResolveResponse = z.object({
|
|
604
|
-
data: z.object({ resolveReviewThread: z.object({ thread: z.object({
|
|
605
|
-
id: ReviewThreadId,
|
|
606
|
-
isResolved: z.literal(true)
|
|
607
|
-
}) }) }).nullable(),
|
|
608
|
-
errors: z.array(z.unknown()).optional()
|
|
609
|
-
});
|
|
610
|
-
var TeamReviewThread = z.object({
|
|
611
|
-
id: ReviewThreadId,
|
|
612
|
-
path: z.string(),
|
|
613
|
-
line: z.number().int().positive().nullable(),
|
|
614
|
-
isResolved: z.boolean(),
|
|
615
|
-
viewerCanResolve: z.boolean(),
|
|
616
|
-
isNit: z.boolean(),
|
|
617
|
-
url: z.string().url(),
|
|
618
|
-
viewerComment: z.string().max(1500).optional(),
|
|
619
|
-
lastReplyBody: z.string().max(1500).optional(),
|
|
620
|
-
viewerCommentTruncated: z.boolean().optional(),
|
|
621
|
-
lastReplyTruncated: z.boolean().optional(),
|
|
622
|
-
lastReplyAuthor: z.string(),
|
|
623
|
-
lastReplyAt: z.string().datetime(),
|
|
624
|
-
judgement: TeamReviewThreadResult.extend({
|
|
625
|
-
head: CommitSha,
|
|
626
|
-
judgedAt: z.number().finite(),
|
|
627
|
-
lastReplyAt: z.string().datetime()
|
|
628
|
-
}).optional(),
|
|
629
|
-
resolveError: z.string().optional(),
|
|
630
|
-
resolveAttemptReplyAt: z.string().optional(),
|
|
631
|
-
judgeAttempt: z.object({
|
|
632
|
-
head: CommitSha,
|
|
633
|
-
lastReplyAt: z.string(),
|
|
634
|
-
retryAt: z.number().finite()
|
|
635
|
-
}).optional(),
|
|
636
|
-
unjudgeable: z.object({
|
|
637
|
-
head: CommitSha,
|
|
638
|
-
lastReplyAt: z.string(),
|
|
639
|
-
reason: z.string().min(1)
|
|
640
|
-
}).optional()
|
|
641
|
-
});
|
|
642
|
-
var TeamReviewCompareFiles = z.object({
|
|
643
|
-
merge_base_commit: z.object({ sha: CommitSha }),
|
|
644
|
-
files: z.array(z.object({
|
|
645
|
-
filename: z.string(),
|
|
646
|
-
previous_filename: z.string().optional(),
|
|
647
|
-
patch: z.string().optional()
|
|
648
|
-
})).max(300)
|
|
649
|
-
});
|
|
650
|
-
var ViewerThreadTally = z.object({
|
|
651
|
-
total: z.number().int().nonnegative(),
|
|
652
|
-
resolved: z.number().int().nonnegative()
|
|
653
|
-
});
|
|
654
|
-
var ReviewDraft = z.object({
|
|
655
|
-
...reviewPriorityShape,
|
|
656
|
-
key: z.string(),
|
|
657
|
-
repo: repoSlug,
|
|
658
|
-
number: z.number().int().positive(),
|
|
659
|
-
title: z.string(),
|
|
660
|
-
url: z.string(),
|
|
661
|
-
author: z.string(),
|
|
662
|
-
tier: z.enum(["stamp", "full"]),
|
|
663
|
-
reasons: z.array(z.string()),
|
|
664
|
-
reviewedHead: CommitSha,
|
|
665
|
-
reviewedBase: CommitSha.optional(),
|
|
666
|
-
verdict: storedVerdict,
|
|
667
|
-
summary: z.string(),
|
|
668
|
-
assessment: ReviewAssessment.optional(),
|
|
669
|
-
body: z.string(),
|
|
670
|
-
comments: z.array(DraftComment),
|
|
671
|
-
status: z.enum([
|
|
672
|
-
"ready",
|
|
673
|
-
"stale",
|
|
674
|
-
"posted",
|
|
675
|
-
"discarded",
|
|
676
|
-
"error"
|
|
677
|
-
]),
|
|
678
|
-
error: z.string().optional(),
|
|
679
|
-
threads: z.array(TeamReviewThread).optional(),
|
|
680
|
-
viewerThreads: ViewerThreadTally.optional(),
|
|
681
|
-
githubReviews: z.array(GithubReview).optional(),
|
|
682
|
-
reviewDecision: GithubReviewDecision.nullable().optional(),
|
|
683
|
-
liveHead: CommitSha.optional(),
|
|
684
|
-
prCreatedAt: z.string().optional(),
|
|
685
|
-
reviewedAt: z.number().finite().optional(),
|
|
686
|
-
postedAt: z.number().finite().optional(),
|
|
687
|
-
postedEvent: PostedReviewEvent.optional(),
|
|
688
|
-
priorReviewedHead: CommitSha.optional(),
|
|
689
|
-
requeuedHead: CommitSha.optional()
|
|
690
|
-
});
|
|
691
|
-
function canApproveAfterComment(draft) {
|
|
692
|
-
return draft.status === "posted" && draft.postedEvent === "COMMENT";
|
|
693
|
-
}
|
|
694
|
-
var TeamReviewAction = z.enum([
|
|
695
|
-
"approve",
|
|
696
|
-
"approve-only",
|
|
697
|
-
"comment",
|
|
698
|
-
"discard",
|
|
699
|
-
"requeue",
|
|
700
|
-
"resolve-thread"
|
|
701
|
-
]);
|
|
702
|
-
var TeamReviewActionRequest = z.object({
|
|
703
|
-
key: z.string().min(1),
|
|
704
|
-
head: CommitSha,
|
|
705
|
-
action: TeamReviewAction,
|
|
706
|
-
threadId: ReviewThreadId.optional(),
|
|
707
|
-
body: z.string(),
|
|
708
|
-
comments: z.array(ReviewComment)
|
|
709
|
-
}).refine((request) => request.action !== "resolve-thread" || request.threadId !== void 0, {
|
|
710
|
-
message: "resolve-thread requires threadId",
|
|
711
|
-
path: ["threadId"]
|
|
712
|
-
});
|
|
713
|
-
var TeamReviewActionResult = z.object({
|
|
714
|
-
key: z.string(),
|
|
715
|
-
ok: z.boolean(),
|
|
716
|
-
error: z.string().optional(),
|
|
717
|
-
warning: z.string().optional()
|
|
718
|
-
});
|
|
719
|
-
var ResumableReview = z.object({
|
|
720
|
-
sessionId: z.string().min(1),
|
|
721
|
-
workDir: z.string().min(1),
|
|
722
|
-
worktreePath: z.string().min(1),
|
|
723
|
-
head: CommitSha,
|
|
724
|
-
deadlineAt: z.number(),
|
|
725
|
-
remainingAwakeMs: z.number().nonnegative().optional(),
|
|
726
|
-
savedAt: z.number()
|
|
727
|
-
});
|
|
728
|
-
var QueuedReview = z.object({
|
|
729
|
-
...reviewPriorityShape,
|
|
730
|
-
reviewDecision: GithubReviewDecision.nullable().optional(),
|
|
731
|
-
key: z.string(),
|
|
732
|
-
repo: repoSlug,
|
|
733
|
-
number: z.number().int().positive(),
|
|
734
|
-
title: z.string(),
|
|
735
|
-
url: z.string(),
|
|
736
|
-
author: z.string(),
|
|
737
|
-
prCreatedAt: z.string().optional()
|
|
738
|
-
});
|
|
739
|
-
var TeamReviewStateEntry = z.object({
|
|
740
|
-
draft: ReviewDraft.nullable(),
|
|
741
|
-
reviewedHead: CommitSha.nullable(),
|
|
742
|
-
inFlight: z.boolean(),
|
|
743
|
-
skipReason: z.string().nullable(),
|
|
744
|
-
handReview: QueuedReview.optional(),
|
|
745
|
-
reviewAttempts: z.number().int().nonnegative().default(0),
|
|
746
|
-
resumable: ResumableReview.nullable().optional(),
|
|
747
|
-
reviewedAt: z.number().optional(),
|
|
748
|
-
threads: z.array(TeamReviewThread).optional(),
|
|
749
|
-
viewerThreads: ViewerThreadTally.optional(),
|
|
750
|
-
autoResolvedThreadIds: z.array(ReviewThreadId).optional(),
|
|
751
|
-
githubReviews: z.array(GithubReview).optional(),
|
|
752
|
-
reviewDecision: GithubReviewDecision.nullable().optional(),
|
|
753
|
-
liveHead: CommitSha.optional(),
|
|
754
|
-
requeuedHead: CommitSha.optional(),
|
|
755
|
-
priorReview: PriorReview.optional(),
|
|
756
|
-
discardedReviewHead: CommitSha.optional(),
|
|
757
|
-
updatedAt: z.number().finite()
|
|
758
|
-
});
|
|
759
|
-
z.record(z.string(), TeamReviewStateEntry);
|
|
760
|
-
var ReviewProgressPhase = z.enum([
|
|
761
|
-
"preparing",
|
|
762
|
-
"checkout",
|
|
763
|
-
"reviewing"
|
|
764
|
-
]);
|
|
765
|
-
var ReviewProgressStep = z.object({
|
|
766
|
-
at: z.number().finite(),
|
|
767
|
-
tool: z.string(),
|
|
768
|
-
detail: z.string()
|
|
769
|
-
});
|
|
770
|
-
var InFlightReview = z.object({
|
|
771
|
-
...reviewPriorityShape,
|
|
772
|
-
reviewDecision: GithubReviewDecision.nullable().optional(),
|
|
773
|
-
key: z.string(),
|
|
774
|
-
repo: repoSlug,
|
|
775
|
-
number: z.number().int().positive(),
|
|
776
|
-
title: z.string(),
|
|
777
|
-
url: z.string(),
|
|
778
|
-
author: z.string(),
|
|
779
|
-
tier: z.enum(["stamp", "full"]),
|
|
780
|
-
reasons: z.array(z.string()),
|
|
781
|
-
head: CommitSha,
|
|
782
|
-
phase: ReviewProgressPhase,
|
|
783
|
-
startedAt: z.number().finite(),
|
|
784
|
-
deadlineAt: z.number().finite().nullable(),
|
|
785
|
-
toolCalls: z.number().int().nonnegative(),
|
|
786
|
-
recentSteps: z.array(ReviewProgressStep),
|
|
787
|
-
prCreatedAt: z.string().optional(),
|
|
788
|
-
priorReviewedHead: CommitSha.optional()
|
|
789
|
-
});
|
|
790
|
-
var TeamReviewStatus = z.object({
|
|
791
|
-
...githubPollingShape,
|
|
792
|
-
type: z.literal("team-review-status"),
|
|
793
|
-
ts: z.number().finite(),
|
|
794
|
-
configured: z.boolean(),
|
|
795
|
-
reason: z.string().nullable().optional(),
|
|
796
|
-
drafts: z.array(ReviewDraft),
|
|
797
|
-
inFlight: z.array(InFlightReview),
|
|
798
|
-
queued: z.array(QueuedReview).default([]),
|
|
799
|
-
handReview: z.array(QueuedReview).default([]),
|
|
800
|
-
team: z.object({
|
|
801
|
-
org: z.string(),
|
|
802
|
-
slug: z.string(),
|
|
803
|
-
name: z.string(),
|
|
804
|
-
avatarUrl: z.string()
|
|
805
|
-
}).nullable().optional()
|
|
806
|
-
}).passthrough();
|
|
807
|
-
//#endregion
|
|
808
|
-
//#region shared/contracts/my-prs.ts
|
|
809
|
-
var MyPrStage = z.enum([
|
|
810
|
-
"merged",
|
|
811
|
-
"draft",
|
|
812
|
-
"conflicts",
|
|
813
|
-
"behind",
|
|
814
|
-
"checks-failing",
|
|
815
|
-
"changes-requested",
|
|
816
|
-
"unresolved-threads",
|
|
817
|
-
"checks-pending",
|
|
818
|
-
"needs-approval",
|
|
819
|
-
"ready",
|
|
820
|
-
"unknown"
|
|
821
|
-
]);
|
|
822
|
-
var nonnegativeInteger$1 = z.number().int().nonnegative();
|
|
823
|
-
var repositoryName = z.string().regex(REPO_SLUG_RE);
|
|
824
|
-
var pullRequestNumberText = z.string().regex(/^[1-9][0-9]*$/);
|
|
825
|
-
var pullRequestKeyFormat = z.templateLiteral([
|
|
826
|
-
repositoryName,
|
|
827
|
-
"#",
|
|
828
|
-
pullRequestNumberText
|
|
829
|
-
]);
|
|
830
|
-
var keepMergeableAttemptKeyFormat = z.templateLiteral([
|
|
831
|
-
pullRequestKeyFormat,
|
|
832
|
-
"@",
|
|
833
|
-
CommitSha
|
|
834
|
-
]);
|
|
835
|
-
var pullRequestKey = z.string().refine((value) => pullRequestKeyFormat.safeParse(value).success);
|
|
836
|
-
var keepMergeableAttemptKey = z.string().refine((value) => keepMergeableAttemptKeyFormat.safeParse(value).success);
|
|
837
|
-
z.discriminatedUnion("outcome", [z.strictObject({ outcome: z.literal("pushed") }), z.strictObject({
|
|
838
|
-
outcome: z.enum([
|
|
839
|
-
"no-change",
|
|
840
|
-
"failed",
|
|
841
|
-
"stopped",
|
|
842
|
-
"timed-out"
|
|
843
|
-
]),
|
|
844
|
-
reason: z.string().min(1)
|
|
845
|
-
})]);
|
|
846
|
-
var MyPrKeepMergeableAttempt = z.strictObject({
|
|
847
|
-
outcome: z.enum([
|
|
848
|
-
"pushed",
|
|
849
|
-
"no-change",
|
|
850
|
-
"failed",
|
|
851
|
-
"stopped",
|
|
852
|
-
"timed-out"
|
|
853
|
-
]),
|
|
854
|
-
reason: z.string().min(1).optional(),
|
|
855
|
-
at: z.number().finite()
|
|
856
|
-
});
|
|
857
|
-
var MyPrKeepMergeableAttemptRecord = MyPrKeepMergeableAttempt.extend({
|
|
858
|
-
key: pullRequestKey,
|
|
859
|
-
headRefOid: CommitSha,
|
|
860
|
-
baseRefOid: CommitSha,
|
|
861
|
-
consecutiveAttempts: z.number().int().min(1).optional()
|
|
862
|
-
});
|
|
863
|
-
var MyPrsState = z.strictObject({
|
|
864
|
-
keepMergeableKeys: z.array(pullRequestKey),
|
|
865
|
-
keepMergeableAttemptKeys: z.array(keepMergeableAttemptKey),
|
|
866
|
-
keepMergeableAttempts: z.array(MyPrKeepMergeableAttemptRecord).default([]),
|
|
867
|
-
mergeQueueKeys: z.array(pullRequestKey).default([]),
|
|
868
|
-
keepMergeablePushedHeadKeys: z.array(keepMergeableAttemptKey).default([])
|
|
869
|
-
});
|
|
870
|
-
var MyPrKeepMergeableRequest = z.object({
|
|
871
|
-
repo: repositoryName,
|
|
872
|
-
number: z.number().int().positive(),
|
|
873
|
-
keepMergeable: z.boolean()
|
|
874
|
-
});
|
|
875
|
-
var MyPrToggleResult = z.object({
|
|
876
|
-
key: z.string(),
|
|
877
|
-
ok: z.boolean(),
|
|
878
|
-
error: z.string().optional()
|
|
879
|
-
});
|
|
880
|
-
var MyPrKeepMergeableResult = MyPrToggleResult;
|
|
881
|
-
var MyPrMergeWhenReadyRequest = z.object({
|
|
882
|
-
repo: repositoryName,
|
|
883
|
-
number: z.number().int().positive(),
|
|
884
|
-
mergeWhenReady: z.boolean()
|
|
885
|
-
});
|
|
886
|
-
var MyPrMergeWhenReadyResult = MyPrToggleResult;
|
|
887
|
-
var MyPrMergeMethod = z.enum([
|
|
888
|
-
"MERGE",
|
|
889
|
-
"SQUASH",
|
|
890
|
-
"REBASE"
|
|
891
|
-
]);
|
|
892
|
-
var MyPrThread = z.object({
|
|
893
|
-
path: z.string(),
|
|
894
|
-
line: z.number().int().positive().nullable(),
|
|
895
|
-
isOutdated: z.boolean(),
|
|
896
|
-
url: z.url(),
|
|
897
|
-
author: z.string().nullable(),
|
|
898
|
-
excerpt: z.string(),
|
|
899
|
-
commentCount: z.number().int().positive(),
|
|
900
|
-
lastAuthor: z.string().nullable(),
|
|
901
|
-
lastActivityAt: z.string()
|
|
902
|
-
});
|
|
903
|
-
var MyPrReview = z.object({
|
|
904
|
-
reviewer: z.string().nullable(),
|
|
905
|
-
state: z.string(),
|
|
906
|
-
submittedAt: z.string().nullable()
|
|
907
|
-
});
|
|
908
|
-
var MyPrAutoRebase = z.object({
|
|
909
|
-
outcome: z.enum(["rebased", "failed"]),
|
|
910
|
-
at: z.number().finite(),
|
|
911
|
-
message: z.string()
|
|
912
|
-
});
|
|
913
|
-
var MyPr = z.object({
|
|
914
|
-
key: z.string(),
|
|
915
|
-
repo: repositoryName,
|
|
916
|
-
number: z.number().int().positive(),
|
|
917
|
-
title: z.string(),
|
|
918
|
-
url: z.url(),
|
|
919
|
-
isDraft: z.boolean(),
|
|
920
|
-
state: z.enum([
|
|
921
|
-
"OPEN",
|
|
922
|
-
"MERGED",
|
|
923
|
-
"CLOSED"
|
|
924
|
-
]),
|
|
925
|
-
createdAt: z.string(),
|
|
926
|
-
mergedAt: z.string().nullable(),
|
|
927
|
-
updatedAt: z.string(),
|
|
928
|
-
baseRefName: z.string(),
|
|
929
|
-
baseRefOid: CommitSha,
|
|
930
|
-
headRefName: z.string().min(1),
|
|
931
|
-
isCrossRepository: z.boolean(),
|
|
932
|
-
headRefOid: CommitSha,
|
|
933
|
-
isInMergeQueue: z.boolean(),
|
|
934
|
-
mergeMethod: MyPrMergeMethod,
|
|
935
|
-
mergeable: z.enum([
|
|
936
|
-
"MERGEABLE",
|
|
937
|
-
"CONFLICTING",
|
|
938
|
-
"UNKNOWN"
|
|
939
|
-
]),
|
|
940
|
-
mergeStateStatus: z.string(),
|
|
941
|
-
reviewDecision: z.enum([
|
|
942
|
-
"APPROVED",
|
|
943
|
-
"CHANGES_REQUESTED",
|
|
944
|
-
"REVIEW_REQUIRED"
|
|
945
|
-
]).nullable(),
|
|
946
|
-
checks: z.object({
|
|
947
|
-
state: z.enum([
|
|
948
|
-
"SUCCESS",
|
|
949
|
-
"FAILURE",
|
|
950
|
-
"PENDING",
|
|
951
|
-
"ERROR",
|
|
952
|
-
"EXPECTED"
|
|
953
|
-
]).nullable(),
|
|
954
|
-
failing: z.array(z.string()),
|
|
955
|
-
pendingCount: nonnegativeInteger$1
|
|
956
|
-
}),
|
|
957
|
-
unresolvedThreads: nonnegativeInteger$1,
|
|
958
|
-
threads: z.array(MyPrThread),
|
|
959
|
-
behindBy: nonnegativeInteger$1.nullable(),
|
|
960
|
-
reviewRequests: z.array(z.object({
|
|
961
|
-
name: z.string(),
|
|
962
|
-
isTeam: z.boolean(),
|
|
963
|
-
avatarUrl: z.string().nullable()
|
|
964
|
-
})),
|
|
965
|
-
approvals: nonnegativeInteger$1,
|
|
966
|
-
reviews: z.array(MyPrReview),
|
|
967
|
-
stage: MyPrStage,
|
|
968
|
-
autoRebase: MyPrAutoRebase.optional(),
|
|
969
|
-
keepMergeable: z.boolean().optional(),
|
|
970
|
-
keepMergeableAttempt: MyPrKeepMergeableAttempt.optional(),
|
|
971
|
-
isKeepMergeableFixInFlight: z.boolean().optional(),
|
|
972
|
-
mergeQueuePosition: z.number().int().positive().nullable().optional(),
|
|
973
|
-
isMergeQueueHeldForRepairPush: z.boolean().optional()
|
|
974
|
-
}).refine((pr) => pr.key === `${pr.repo}#${pr.number}`);
|
|
975
|
-
var MyPrsStatus = z.object({
|
|
976
|
-
...githubPollingShape,
|
|
977
|
-
type: z.literal("my-prs-status"),
|
|
978
|
-
ts: z.number().finite(),
|
|
979
|
-
configured: z.boolean(),
|
|
980
|
-
reason: z.string().nullable().optional(),
|
|
981
|
-
viewer: z.string().nullable(),
|
|
982
|
-
prs: z.array(MyPr),
|
|
983
|
-
truncatedNote: z.string().nullable().optional(),
|
|
984
|
-
isKeepMergeableEnabled: z.boolean().optional(),
|
|
985
|
-
isMergeQueueEnabled: z.boolean().optional()
|
|
986
|
-
}).passthrough();
|
|
987
|
-
var MyPrMergeRequest = z.object({
|
|
988
|
-
repo: repositoryName,
|
|
989
|
-
number: z.number().int().positive(),
|
|
990
|
-
headRefOid: CommitSha
|
|
991
|
-
});
|
|
992
|
-
var MyPrMergeKind = z.enum([
|
|
993
|
-
"merged",
|
|
994
|
-
"queued",
|
|
995
|
-
"auto-merge",
|
|
996
|
-
"unconfirmed"
|
|
997
|
-
]);
|
|
998
|
-
var MyPrMergeResult = z.object({
|
|
999
|
-
key: z.string(),
|
|
1000
|
-
ok: z.boolean(),
|
|
1001
|
-
kind: MyPrMergeKind.optional(),
|
|
1002
|
-
error: z.string().optional()
|
|
1003
|
-
});
|
|
1004
|
-
var CheckRun = z.object({
|
|
1005
|
-
__typename: z.literal("CheckRun"),
|
|
1006
|
-
name: z.string(),
|
|
1007
|
-
conclusion: z.string().nullable(),
|
|
1008
|
-
status: z.string()
|
|
1009
|
-
});
|
|
1010
|
-
var StatusContext = z.object({
|
|
1011
|
-
__typename: z.literal("StatusContext"),
|
|
1012
|
-
context: z.string(),
|
|
1013
|
-
state: z.string()
|
|
1014
|
-
});
|
|
1015
|
-
var MyPrSearchNode = z.object({
|
|
1016
|
-
__typename: z.literal("PullRequest"),
|
|
1017
|
-
id: z.string().regex(NODE_ID_RE),
|
|
1018
|
-
number: z.number().int().positive(),
|
|
1019
|
-
title: z.string(),
|
|
1020
|
-
url: z.url(),
|
|
1021
|
-
isDraft: z.boolean(),
|
|
1022
|
-
state: z.enum([
|
|
1023
|
-
"OPEN",
|
|
1024
|
-
"MERGED",
|
|
1025
|
-
"CLOSED"
|
|
1026
|
-
]),
|
|
1027
|
-
createdAt: z.string(),
|
|
1028
|
-
mergedAt: z.string().nullable(),
|
|
1029
|
-
updatedAt: z.string(),
|
|
1030
|
-
baseRefName: z.string(),
|
|
1031
|
-
baseRefOid: CommitSha,
|
|
1032
|
-
headRefName: z.string().min(1),
|
|
1033
|
-
isCrossRepository: z.boolean(),
|
|
1034
|
-
headRefOid: CommitSha,
|
|
1035
|
-
isInMergeQueue: z.boolean(),
|
|
1036
|
-
mergeable: z.enum([
|
|
1037
|
-
"MERGEABLE",
|
|
1038
|
-
"CONFLICTING",
|
|
1039
|
-
"UNKNOWN"
|
|
1040
|
-
]),
|
|
1041
|
-
mergeStateStatus: z.string(),
|
|
1042
|
-
reviewDecision: z.enum([
|
|
1043
|
-
"APPROVED",
|
|
1044
|
-
"CHANGES_REQUESTED",
|
|
1045
|
-
"REVIEW_REQUIRED"
|
|
1046
|
-
]).nullable(),
|
|
1047
|
-
repository: z.object({
|
|
1048
|
-
nameWithOwner: repositoryName,
|
|
1049
|
-
viewerDefaultMergeMethod: MyPrMergeMethod
|
|
1050
|
-
}),
|
|
1051
|
-
commits: z.object({ nodes: z.array(z.object({ commit: z.object({ statusCheckRollup: z.object({
|
|
1052
|
-
state: z.enum([
|
|
1053
|
-
"SUCCESS",
|
|
1054
|
-
"FAILURE",
|
|
1055
|
-
"PENDING",
|
|
1056
|
-
"ERROR",
|
|
1057
|
-
"EXPECTED"
|
|
1058
|
-
]).nullable(),
|
|
1059
|
-
contexts: z.object({ nodes: z.array(z.union([CheckRun, StatusContext])) })
|
|
1060
|
-
}).nullable() }) })) }),
|
|
1061
|
-
reviewThreads: z.object({
|
|
1062
|
-
pageInfo: z.object({ hasNextPage: z.boolean() }),
|
|
1063
|
-
nodes: z.array(z.object({ isResolved: z.boolean() }))
|
|
1064
|
-
}),
|
|
1065
|
-
reviewRequests: z.object({ nodes: z.array(z.object({ requestedReviewer: z.discriminatedUnion("__typename", [
|
|
1066
|
-
z.object({
|
|
1067
|
-
__typename: z.literal("User"),
|
|
1068
|
-
login: z.string()
|
|
1069
|
-
}),
|
|
1070
|
-
z.object({
|
|
1071
|
-
__typename: z.literal("Team"),
|
|
1072
|
-
slug: z.string(),
|
|
1073
|
-
avatarUrl: z.string().nullable(),
|
|
1074
|
-
organization: z.object({ login: z.string() })
|
|
1075
|
-
}),
|
|
1076
|
-
z.object({ __typename: z.enum(["Bot", "Mannequin"]) })
|
|
1077
|
-
]).nullable() })) }),
|
|
1078
|
-
latestOpinionatedReviews: z.object({ nodes: z.array(z.object({ state: z.string() })) }),
|
|
1079
|
-
latestReviews: z.object({ nodes: z.array(z.object({
|
|
1080
|
-
state: z.string(),
|
|
1081
|
-
submittedAt: z.string().nullable(),
|
|
1082
|
-
author: z.object({ login: z.string() }).nullable()
|
|
1083
|
-
})) })
|
|
1084
|
-
});
|
|
1085
|
-
var ThreadCommentAuthor = z.object({ login: z.string() }).nullable();
|
|
1086
|
-
var MyPrThreadNode = z.object({
|
|
1087
|
-
isResolved: z.boolean(),
|
|
1088
|
-
isOutdated: z.boolean(),
|
|
1089
|
-
path: z.string(),
|
|
1090
|
-
line: z.number().int().positive().nullable(),
|
|
1091
|
-
firstComment: z.object({
|
|
1092
|
-
totalCount: nonnegativeInteger$1,
|
|
1093
|
-
nodes: z.array(z.object({
|
|
1094
|
-
author: ThreadCommentAuthor,
|
|
1095
|
-
bodyText: z.string(),
|
|
1096
|
-
url: z.url(),
|
|
1097
|
-
createdAt: z.string()
|
|
1098
|
-
}))
|
|
1099
|
-
}),
|
|
1100
|
-
lastComment: z.object({ nodes: z.array(z.object({
|
|
1101
|
-
author: ThreadCommentAuthor,
|
|
1102
|
-
createdAt: z.string()
|
|
1103
|
-
})) })
|
|
1104
|
-
});
|
|
1105
|
-
var MyPrThreadsResponse = z.object({
|
|
1106
|
-
data: z.object({ repository: z.object({ pullRequest: z.object({ reviewThreads: z.object({
|
|
1107
|
-
pageInfo: z.object({
|
|
1108
|
-
hasNextPage: z.boolean(),
|
|
1109
|
-
endCursor: z.string().nullable()
|
|
1110
|
-
}),
|
|
1111
|
-
nodes: z.array(z.unknown())
|
|
1112
|
-
}) }).nullable() }).nullable() }),
|
|
1113
|
-
errors: z.array(z.unknown()).optional()
|
|
1114
|
-
});
|
|
1115
|
-
var MyPrMergeStateResponse = z.object({
|
|
1116
|
-
data: z.object({ repository: z.object({ pullRequest: z.object({
|
|
1117
|
-
state: z.string(),
|
|
1118
|
-
isInMergeQueue: z.boolean(),
|
|
1119
|
-
autoMergeRequest: z.object({ enabledAt: z.string().nullable() }).nullable()
|
|
1120
|
-
}).nullable() }).nullable() }),
|
|
1121
|
-
errors: z.array(z.unknown()).optional()
|
|
1122
|
-
});
|
|
1123
|
-
var MyPrSearchResponse = z.object({
|
|
1124
|
-
data: z.object({
|
|
1125
|
-
open: z.object({
|
|
1126
|
-
issueCount: nonnegativeInteger$1,
|
|
1127
|
-
nodes: z.array(z.unknown())
|
|
1128
|
-
}),
|
|
1129
|
-
merged: z.object({
|
|
1130
|
-
issueCount: nonnegativeInteger$1,
|
|
1131
|
-
nodes: z.array(z.unknown())
|
|
1132
|
-
})
|
|
1133
|
-
}),
|
|
1134
|
-
errors: z.array(z.unknown()).optional()
|
|
1135
|
-
});
|
|
1136
|
-
//#endregion
|
|
1137
396
|
//#region shared/contracts/workflows.ts
|
|
1138
397
|
var WORKFLOW_TRIGGERS = Object.freeze([
|
|
1139
398
|
"opened",
|
|
@@ -1308,11 +567,7 @@ var TaskTitleSettings = z.object({ refiner: z.object({
|
|
|
1308
567
|
enabled: optionalBoolean("taskTitle.refiner.enabled"),
|
|
1309
568
|
model: optionalString("taskTitle.refiner.model", true),
|
|
1310
569
|
minIntervalSeconds: optionalNumber("taskTitle.refiner.minIntervalSeconds", { min: 0 }),
|
|
1311
|
-
timeoutSeconds: optionalNumber("taskTitle.refiner.timeoutSeconds",
|
|
1312
|
-
min: 0,
|
|
1313
|
-
exclusiveMin: true,
|
|
1314
|
-
max: 2147483647 / 1e3
|
|
1315
|
-
})
|
|
570
|
+
timeoutSeconds: optionalNumber("taskTitle.refiner.timeoutSeconds", TASK_TITLE_TIMEOUT_RANGE)
|
|
1316
571
|
}, { error: "taskTitle.refiner must be an object" }).nullable().optional() }, { error: "taskTitle must be an object" }).nullable().optional();
|
|
1317
572
|
var BRANCH_GC_SETTINGS_SHAPE = {
|
|
1318
573
|
enabled: optionalBoolean("branchGc.enabled"),
|
|
@@ -1330,8 +585,8 @@ var BranchGcControlSettings = BranchGcFileSettings.omit({
|
|
|
1330
585
|
dryRun: true,
|
|
1331
586
|
worktrees: true
|
|
1332
587
|
}).nullable().optional();
|
|
1333
|
-
|
|
1334
|
-
|
|
588
|
+
Object.freeze(["enabled", "deleteUnmerged"]);
|
|
589
|
+
Object.freeze(["staleDays", "intervalMs"]);
|
|
1335
590
|
var PostTurnChecksSettings = optionalObject("postTurnChecks", { mode: z.enum(POST_TURN_CHECK_MODES, { error: "postTurnChecks.mode must be one of report, fix" }).optional() });
|
|
1336
591
|
var VisionsSettings = optionalObject("visions", {
|
|
1337
592
|
enabled: optionalBoolean("visions.enabled"),
|
|
@@ -1456,7 +711,7 @@ var telemetryShape = { enabled: optionalBoolean("telemetry.enabled") };
|
|
|
1456
711
|
var TelemetrySettings = z.object(telemetryShape, { error: "telemetry must be an object" }).strict().optional();
|
|
1457
712
|
var TelemetryFileSettings = z.object(telemetryShape, { error: "telemetry must be an object" }).passthrough().optional();
|
|
1458
713
|
var createBrowserConfigShape = (isAbsolutePath) => ({
|
|
1459
|
-
port: z.number().int().min(
|
|
714
|
+
port: z.number().int().min(PORT_RANGE.min).max(PORT_RANGE.max).optional(),
|
|
1460
715
|
autoRecoverSeconds: z.number().finite().nonnegative().optional(),
|
|
1461
716
|
inputGraceSeconds: z.number().finite().nonnegative().optional(),
|
|
1462
717
|
promptDetectionMs: z.number().finite().nonnegative().optional(),
|
|
@@ -1465,7 +720,8 @@ var createBrowserConfigShape = (isAbsolutePath) => ({
|
|
|
1465
720
|
replayBufferKB: optionalWholeNumber("replayBufferKB", REPLAY_BUFFER_KB_RANGE),
|
|
1466
721
|
cursorBlink: optionalBoolean("cursorBlink"),
|
|
1467
722
|
debugMode: optionalBoolean("debugMode"),
|
|
1468
|
-
|
|
723
|
+
conversationView: optionalBoolean("conversationView"),
|
|
724
|
+
streamerMode: optionalBoolean("streamerMode"),
|
|
1469
725
|
detectBackgroundAgents: optionalBoolean("detectBackgroundAgents"),
|
|
1470
726
|
recordSignals: optionalBoolean("recordSignals"),
|
|
1471
727
|
rtk: optionalBoolean("rtk"),
|
|
@@ -1532,6 +788,23 @@ function isSpawnableCommand(command) {
|
|
|
1532
788
|
if (AGENT_COMMAND_BASENAME_RE.test(command)) return true;
|
|
1533
789
|
return AGENT_COMMAND_ABSOLUTE_RE.test(command);
|
|
1534
790
|
}
|
|
791
|
+
var GIT_BRANCH_FORBIDDEN_PUNCTUATION_RE = /[~^:?*[\\]/;
|
|
792
|
+
var GIT_BRANCH_FORBIDDEN_SEQUENCES = [
|
|
793
|
+
"..",
|
|
794
|
+
"@{",
|
|
795
|
+
"//"
|
|
796
|
+
];
|
|
797
|
+
function isControlOrSpaceCharacter(character) {
|
|
798
|
+
const codePoint = character.charCodeAt(0);
|
|
799
|
+
return codePoint <= 32 || codePoint === 127;
|
|
800
|
+
}
|
|
801
|
+
function isGitBranchName(name) {
|
|
802
|
+
if (name === "" || name === "@" || name === "HEAD") return false;
|
|
803
|
+
if (name.startsWith("-") || name.startsWith("/") || name.endsWith("/") || name.endsWith(".")) return false;
|
|
804
|
+
if (GIT_BRANCH_FORBIDDEN_SEQUENCES.some((sequence) => name.includes(sequence))) return false;
|
|
805
|
+
if (GIT_BRANCH_FORBIDDEN_PUNCTUATION_RE.test(name) || [...name].some(isControlOrSpaceCharacter)) return false;
|
|
806
|
+
return name.split("/").every((component) => !component.startsWith(".") && !component.endsWith(".lock"));
|
|
807
|
+
}
|
|
1535
808
|
var CustomAgentDeclaration = z.object({
|
|
1536
809
|
id: z.string({ error: "customAgents[].id must be a string" }).regex(AGENT_ID_RE, { error: `customAgents[].id must be ${AGENT_ID_SHAPE_MESSAGE}` }),
|
|
1537
810
|
label: z.string({ error: "customAgents[].label must be a string" }).min(1, { error: "customAgents[].label must not be empty" }).max(60, { error: "customAgents[].label must be at most 60 characters" }),
|
|
@@ -1585,10 +858,13 @@ var ProjectConfig = z.object({
|
|
|
1585
858
|
name: z.string().optional(),
|
|
1586
859
|
customTitle: TaskTitle.optional(),
|
|
1587
860
|
taskTitleState: PersistedTaskTitle.optional().catch(void 0),
|
|
861
|
+
prLinks: SessionPrLinks.optional().catch(void 0),
|
|
1588
862
|
path: z.string(),
|
|
1589
863
|
repos: z.array(z.string()).min(2).optional(),
|
|
864
|
+
baseBranch: z.string().refine(isGitBranchName, { error: "projects[].baseBranch must be a git branch name" }).optional(),
|
|
1590
865
|
agent: z.string({ error: "projects[].agent must be a string" }).regex(AGENT_ID_RE, { error: `projects[].agent must be ${AGENT_ID_SHAPE_MESSAGE}` }).optional(),
|
|
1591
866
|
codexBypassHookTrust: z.boolean().optional(),
|
|
867
|
+
conversationView: z.boolean({ error: "projects[].conversationView must be a boolean" }).optional(),
|
|
1592
868
|
dangerouslySkipPermissions: z.boolean({ error: "projects[].dangerouslySkipPermissions must be a boolean" }).optional(),
|
|
1593
869
|
unguarded: z.boolean({ error: "projects[].unguarded must be a boolean" }).optional()
|
|
1594
870
|
}).passthrough();
|
|
@@ -1692,4 +968,4 @@ function configIssueMessage(error) {
|
|
|
1692
968
|
return error.issues[0]?.message || "settings are invalid";
|
|
1693
969
|
}
|
|
1694
970
|
//#endregion
|
|
1695
|
-
export {
|
|
971
|
+
export { KEEP_MERGEABLE_TIMEOUT_MINUTES_RANGE as A, USAGE_BUDGET_RANGE as B, normalizeLegacyConfigNumbers as C, FLYING_ANIMALS_DURATION_RANGE as D, FLYING_ANIMALS_DEFAULTS as E, POSTHOG_TRAFFIC_BASELINE_RANGE as F, WORKFLOWS_MAX_CONCURRENT_SESSIONS_RANGE as G, USAGE_RETAIN_DAYS_RANGE as H, POSTHOG_TRAFFIC_MIN_USERS_RANGE as I, CoherenceRisk as J, CoherenceOrient as K, POSTHOG_TRAFFIC_MULTIPLIER_RANGE as L, PORT_RANGE as M, POSITIVE_NUMBER_RANGE as N, FLYING_ANIMALS_GAP_RANGE as O, POSTHOG_FIX_TIMEOUT_RANGE as P, CoherenceWorkState as Q, REPLAY_BUFFER_KB_RANGE as R, USAGE_VENDOR_KEYS as S, FACTORY_MAX_LIVE_WORKERS_RANGE as T, USAGE_SCAN_INTERVAL_RANGE as U, USAGE_INTEGER_RANGES as V, WORKFLOWS_MAX_ACTIONS_PER_POLL_RANGE as W, CoherenceWorkCreated as X, CoherenceTicketCreated as Y, CoherenceWorkInspect as Z, WorkflowLabelName as _, ConfigUpdate as a, WorkflowsState as b, TASK_TITLE_SOURCE_PRIORITY as c, CHANGE_MAP_NARRATOR_ENGINES as d, DEFAULT_FACTORY_CHECKS as f, WorkflowCommentBody as g, UPDATE_CHANNELS as h, Config as i, NON_NEGATIVE_NUMBER_RANGE as j, FLYING_ANIMALS_SCALE_RANGE as k, configIssueMessage as l, POST_TURN_CHECK_MODES as m, BUILTIN_AGENT_IDS as n, PersistedTaskTitle as o, DEFAULT_FACTORY_PROTECTED_PATHS as p, CoherenceReadiness as q, BrowserConfig as r, RUNTIME_CONFIG_SCALAR_KEYS as s, AGENT_ID_SHAPE_MESSAGE as t, BranchGcFileSettings as u, WorkflowSearchNode as v, CHANGE_MAP_NARRATOR_TIMEOUT_RANGE as w, USAGE_COST_MODES as x, WorkflowsSettings as y, TASK_TITLE_TIMEOUT_RANGE as z };
|