@closerepo/radar-contracts 2.0.0 → 2.1.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/index.d.ts +248 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5983,6 +5983,31 @@ declare const radarNotificationProjectionSchema: z.ZodObject<{
|
|
|
5983
5983
|
}, z.core.$strict>], "kind">;
|
|
5984
5984
|
}, z.core.$strict>;
|
|
5985
5985
|
type RadarNotificationProjection = z.infer<typeof radarNotificationProjectionSchema>;
|
|
5986
|
+
/** Browser-only clues must not widen the mini-program task contract or consume its quota. */
|
|
5987
|
+
declare const radarBrowserNotificationTopicSchema: z.ZodEnum<{
|
|
5988
|
+
improvement: "improvement";
|
|
5989
|
+
reset: "reset";
|
|
5990
|
+
clue: "clue";
|
|
5991
|
+
}>;
|
|
5992
|
+
declare const radarBrowserNotificationProjectionSchema: z.ZodObject<{
|
|
5993
|
+
topics: z.ZodArray<z.ZodEnum<{
|
|
5994
|
+
improvement: "improvement";
|
|
5995
|
+
reset: "reset";
|
|
5996
|
+
clue: "clue";
|
|
5997
|
+
}>>;
|
|
5998
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5999
|
+
kind: z.ZodLiteral<"reset">;
|
|
6000
|
+
webUrl: z.ZodURL;
|
|
6001
|
+
miniPath: z.ZodLiteral<"pages/index/index">;
|
|
6002
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6003
|
+
kind: z.ZodLiteral<"improvement">;
|
|
6004
|
+
webUrl: z.ZodURL;
|
|
6005
|
+
miniPath: z.ZodLiteral<"pages/index/index?page=challenge">;
|
|
6006
|
+
}, z.core.$strict>], "kind">;
|
|
6007
|
+
}, z.core.$strict>;
|
|
6008
|
+
type RadarBrowserNotificationProjection = z.infer<typeof radarBrowserNotificationProjectionSchema>;
|
|
6009
|
+
/** Clue notifications lead to the existing reset monitor, while their subscription stays independent. */
|
|
6010
|
+
declare function createRadarBrowserNotificationProjection(topic: z.infer<typeof radarBrowserNotificationTopicSchema>, locale: RadarWebsiteLocale): RadarBrowserNotificationProjection;
|
|
5986
6011
|
/** New notices use existing home/column routes; historical in-flight records retain their own snapshot. */
|
|
5987
6012
|
declare function createRadarNotificationProjection(topic: RadarNotificationTopic, locale: RadarWebsiteLocale): RadarNotificationProjection;
|
|
5988
6013
|
declare const radarNotificationTaskSchema: z.ZodObject<{
|
|
@@ -6245,12 +6270,23 @@ declare const radarBrowserSubscriptionViewSchema: z.ZodObject<{
|
|
|
6245
6270
|
}, z.core.$strict>>;
|
|
6246
6271
|
}, z.core.$strict>;
|
|
6247
6272
|
type RadarBrowserSubscriptionView = z.infer<typeof radarBrowserSubscriptionViewSchema>;
|
|
6273
|
+
type SubscriptionSelectionCommand<Topics> = Omit<Extract<RadarBrowserSubscriptionSave, {
|
|
6274
|
+
action: "register";
|
|
6275
|
+
}>, "topics"> & {
|
|
6276
|
+
topics: Topics;
|
|
6277
|
+
} | Omit<Extract<RadarBrowserSubscriptionSave, {
|
|
6278
|
+
action: "set_topics";
|
|
6279
|
+
}>, "topics"> & {
|
|
6280
|
+
topics: Topics;
|
|
6281
|
+
} | Exclude<RadarBrowserSubscriptionSave, {
|
|
6282
|
+
action: "register" | "set_topics";
|
|
6283
|
+
}>;
|
|
6248
6284
|
/** Target selection shared by the backend and controlled previews; restoration never takes a page locale. */
|
|
6249
|
-
declare function projectRadarBrowserSubscriptionSelection
|
|
6250
|
-
topics:
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6285
|
+
declare function projectRadarBrowserSubscriptionSelection<Topics extends RadarBrowserTopics>(current: {
|
|
6286
|
+
topics: Topics;
|
|
6287
|
+
locale: RadarWebsiteLocale | null;
|
|
6288
|
+
}, command: SubscriptionSelectionCommand<Topics>): {
|
|
6289
|
+
topics: Topics;
|
|
6254
6290
|
locale: "zh-Hans" | "zh-Hant" | "en" | "ja" | "ko" | null;
|
|
6255
6291
|
};
|
|
6256
6292
|
declare const radarBrowserSubscriptionRes: z.ZodObject<{
|
|
@@ -6352,6 +6388,212 @@ declare const radarBrowserSubscriptionErrorRes: z.ZodObject<{
|
|
|
6352
6388
|
}, z.core.$strict>;
|
|
6353
6389
|
/** An unsaved draft is a server-owned choice, never proof of permission or platform membership. */
|
|
6354
6390
|
declare function initialRadarBrowserSubscription(initialRevision: string): RadarBrowserSubscriptionView;
|
|
6391
|
+
/** V1 remains immutable for websites which reject unknown response fields. */
|
|
6392
|
+
declare const radarBrowserTopicsV2Schema: z.ZodObject<{
|
|
6393
|
+
reset: z.ZodBoolean;
|
|
6394
|
+
improvement: z.ZodBoolean;
|
|
6395
|
+
clue: z.ZodDefault<z.ZodBoolean>;
|
|
6396
|
+
}, z.core.$strict>;
|
|
6397
|
+
type RadarBrowserTopicsV2 = z.infer<typeof radarBrowserTopicsV2Schema>;
|
|
6398
|
+
declare const radarBrowserSubscriptionSaveV2Req: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6399
|
+
action: z.ZodLiteral<"register">;
|
|
6400
|
+
locale: z.ZodEnum<{
|
|
6401
|
+
"zh-Hans": "zh-Hans";
|
|
6402
|
+
"zh-Hant": "zh-Hant";
|
|
6403
|
+
en: "en";
|
|
6404
|
+
ja: "ja";
|
|
6405
|
+
ko: "ko";
|
|
6406
|
+
}>;
|
|
6407
|
+
registration: z.ZodObject<{
|
|
6408
|
+
fid: z.ZodString;
|
|
6409
|
+
}, z.core.$strict>;
|
|
6410
|
+
operationId: z.ZodUUID;
|
|
6411
|
+
expectedRevision: z.ZodString;
|
|
6412
|
+
topics: z.ZodObject<{
|
|
6413
|
+
reset: z.ZodBoolean;
|
|
6414
|
+
improvement: z.ZodBoolean;
|
|
6415
|
+
clue: z.ZodDefault<z.ZodBoolean>;
|
|
6416
|
+
}, z.core.$strict>;
|
|
6417
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6418
|
+
action: z.ZodLiteral<"set_topics">;
|
|
6419
|
+
operationId: z.ZodUUID;
|
|
6420
|
+
expectedRevision: z.ZodString;
|
|
6421
|
+
topics: z.ZodObject<{
|
|
6422
|
+
reset: z.ZodBoolean;
|
|
6423
|
+
improvement: z.ZodBoolean;
|
|
6424
|
+
clue: z.ZodDefault<z.ZodBoolean>;
|
|
6425
|
+
}, z.core.$strict>;
|
|
6426
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6427
|
+
action: z.ZodLiteral<"set_locale">;
|
|
6428
|
+
locale: z.ZodEnum<{
|
|
6429
|
+
"zh-Hans": "zh-Hans";
|
|
6430
|
+
"zh-Hant": "zh-Hant";
|
|
6431
|
+
en: "en";
|
|
6432
|
+
ja: "ja";
|
|
6433
|
+
ko: "ko";
|
|
6434
|
+
}>;
|
|
6435
|
+
operationId: z.ZodUUID;
|
|
6436
|
+
expectedRevision: z.ZodString;
|
|
6437
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6438
|
+
action: z.ZodLiteral<"restore">;
|
|
6439
|
+
registration: z.ZodObject<{
|
|
6440
|
+
fid: z.ZodString;
|
|
6441
|
+
}, z.core.$strict>;
|
|
6442
|
+
operationId: z.ZodUUID;
|
|
6443
|
+
expectedRevision: z.ZodString;
|
|
6444
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6445
|
+
action: z.ZodLiteral<"retry">;
|
|
6446
|
+
operationId: z.ZodUUID;
|
|
6447
|
+
expectedRevision: z.ZodString;
|
|
6448
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
6449
|
+
action: z.ZodLiteral<"cancel">;
|
|
6450
|
+
operationId: z.ZodUUID;
|
|
6451
|
+
expectedRevision: z.ZodString;
|
|
6452
|
+
}, z.core.$strict>], "action">;
|
|
6453
|
+
type RadarBrowserSubscriptionSaveV2 = z.infer<typeof radarBrowserSubscriptionSaveV2Req>;
|
|
6454
|
+
declare const radarBrowserSubscriptionViewV2Schema: z.ZodObject<{
|
|
6455
|
+
registrationState: z.ZodEnum<{
|
|
6456
|
+
ready: "ready";
|
|
6457
|
+
none: "none";
|
|
6458
|
+
invalid: "invalid";
|
|
6459
|
+
changing: "changing";
|
|
6460
|
+
}>;
|
|
6461
|
+
registrationKey: z.ZodNullable<z.ZodString>;
|
|
6462
|
+
manualRetryRequired: z.ZodBoolean;
|
|
6463
|
+
operation: z.ZodNullable<z.ZodObject<{
|
|
6464
|
+
id: z.ZodUUID;
|
|
6465
|
+
state: z.ZodEnum<{
|
|
6466
|
+
unknown: "unknown";
|
|
6467
|
+
pending: "pending";
|
|
6468
|
+
applied: "applied";
|
|
6469
|
+
rejected: "rejected";
|
|
6470
|
+
superseded: "superseded";
|
|
6471
|
+
not_found: "not_found";
|
|
6472
|
+
}>;
|
|
6473
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
6474
|
+
code: z.ZodEnum<{
|
|
6475
|
+
invalid_request: "invalid_request";
|
|
6476
|
+
origin_not_allowed: "origin_not_allowed";
|
|
6477
|
+
rate_limited: "rate_limited";
|
|
6478
|
+
dependency_unavailable: "dependency_unavailable";
|
|
6479
|
+
internal_error: "internal_error";
|
|
6480
|
+
identity_unavailable: "identity_unavailable";
|
|
6481
|
+
revision_conflict: "revision_conflict";
|
|
6482
|
+
operation_conflict: "operation_conflict";
|
|
6483
|
+
registration_conflict: "registration_conflict";
|
|
6484
|
+
provider_rejected: "provider_rejected";
|
|
6485
|
+
provider_rate_limited: "provider_rate_limited";
|
|
6486
|
+
provider_unavailable: "provider_unavailable";
|
|
6487
|
+
provider_timeout: "provider_timeout";
|
|
6488
|
+
}>;
|
|
6489
|
+
operationId: z.ZodOptional<z.ZodUUID>;
|
|
6490
|
+
correlationId: z.ZodUUID;
|
|
6491
|
+
stage: z.ZodString;
|
|
6492
|
+
saveOutcome: z.ZodEnum<{
|
|
6493
|
+
unknown: "unknown";
|
|
6494
|
+
not_saved: "not_saved";
|
|
6495
|
+
}>;
|
|
6496
|
+
reasonSummary: z.ZodString;
|
|
6497
|
+
retryable: z.ZodBoolean;
|
|
6498
|
+
cause: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6499
|
+
}, z.core.$strict>>;
|
|
6500
|
+
}, z.core.$strict>>;
|
|
6501
|
+
topicSettings: z.ZodObject<{
|
|
6502
|
+
state: z.ZodEnum<{
|
|
6503
|
+
initial: "initial";
|
|
6504
|
+
saved: "saved";
|
|
6505
|
+
}>;
|
|
6506
|
+
revision: z.ZodString;
|
|
6507
|
+
locale: z.ZodNullable<z.ZodEnum<{
|
|
6508
|
+
"zh-Hans": "zh-Hans";
|
|
6509
|
+
"zh-Hant": "zh-Hant";
|
|
6510
|
+
en: "en";
|
|
6511
|
+
ja: "ja";
|
|
6512
|
+
ko: "ko";
|
|
6513
|
+
}>>;
|
|
6514
|
+
topics: z.ZodObject<{
|
|
6515
|
+
reset: z.ZodBoolean;
|
|
6516
|
+
improvement: z.ZodBoolean;
|
|
6517
|
+
clue: z.ZodDefault<z.ZodBoolean>;
|
|
6518
|
+
}, z.core.$strict>;
|
|
6519
|
+
}, z.core.$strict>;
|
|
6520
|
+
}, z.core.$strict>;
|
|
6521
|
+
type RadarBrowserSubscriptionViewV2 = z.infer<typeof radarBrowserSubscriptionViewV2Schema>;
|
|
6522
|
+
declare const radarBrowserSubscriptionV2Res: z.ZodObject<{
|
|
6523
|
+
data: z.ZodObject<{
|
|
6524
|
+
registrationState: z.ZodEnum<{
|
|
6525
|
+
ready: "ready";
|
|
6526
|
+
none: "none";
|
|
6527
|
+
invalid: "invalid";
|
|
6528
|
+
changing: "changing";
|
|
6529
|
+
}>;
|
|
6530
|
+
registrationKey: z.ZodNullable<z.ZodString>;
|
|
6531
|
+
manualRetryRequired: z.ZodBoolean;
|
|
6532
|
+
operation: z.ZodNullable<z.ZodObject<{
|
|
6533
|
+
id: z.ZodUUID;
|
|
6534
|
+
state: z.ZodEnum<{
|
|
6535
|
+
unknown: "unknown";
|
|
6536
|
+
pending: "pending";
|
|
6537
|
+
applied: "applied";
|
|
6538
|
+
rejected: "rejected";
|
|
6539
|
+
superseded: "superseded";
|
|
6540
|
+
not_found: "not_found";
|
|
6541
|
+
}>;
|
|
6542
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
6543
|
+
code: z.ZodEnum<{
|
|
6544
|
+
invalid_request: "invalid_request";
|
|
6545
|
+
origin_not_allowed: "origin_not_allowed";
|
|
6546
|
+
rate_limited: "rate_limited";
|
|
6547
|
+
dependency_unavailable: "dependency_unavailable";
|
|
6548
|
+
internal_error: "internal_error";
|
|
6549
|
+
identity_unavailable: "identity_unavailable";
|
|
6550
|
+
revision_conflict: "revision_conflict";
|
|
6551
|
+
operation_conflict: "operation_conflict";
|
|
6552
|
+
registration_conflict: "registration_conflict";
|
|
6553
|
+
provider_rejected: "provider_rejected";
|
|
6554
|
+
provider_rate_limited: "provider_rate_limited";
|
|
6555
|
+
provider_unavailable: "provider_unavailable";
|
|
6556
|
+
provider_timeout: "provider_timeout";
|
|
6557
|
+
}>;
|
|
6558
|
+
operationId: z.ZodOptional<z.ZodUUID>;
|
|
6559
|
+
correlationId: z.ZodUUID;
|
|
6560
|
+
stage: z.ZodString;
|
|
6561
|
+
saveOutcome: z.ZodEnum<{
|
|
6562
|
+
unknown: "unknown";
|
|
6563
|
+
not_saved: "not_saved";
|
|
6564
|
+
}>;
|
|
6565
|
+
reasonSummary: z.ZodString;
|
|
6566
|
+
retryable: z.ZodBoolean;
|
|
6567
|
+
cause: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
6568
|
+
}, z.core.$strict>>;
|
|
6569
|
+
}, z.core.$strict>>;
|
|
6570
|
+
topicSettings: z.ZodObject<{
|
|
6571
|
+
state: z.ZodEnum<{
|
|
6572
|
+
initial: "initial";
|
|
6573
|
+
saved: "saved";
|
|
6574
|
+
}>;
|
|
6575
|
+
revision: z.ZodString;
|
|
6576
|
+
locale: z.ZodNullable<z.ZodEnum<{
|
|
6577
|
+
"zh-Hans": "zh-Hans";
|
|
6578
|
+
"zh-Hant": "zh-Hant";
|
|
6579
|
+
en: "en";
|
|
6580
|
+
ja: "ja";
|
|
6581
|
+
ko: "ko";
|
|
6582
|
+
}>>;
|
|
6583
|
+
topics: z.ZodObject<{
|
|
6584
|
+
reset: z.ZodBoolean;
|
|
6585
|
+
improvement: z.ZodBoolean;
|
|
6586
|
+
clue: z.ZodDefault<z.ZodBoolean>;
|
|
6587
|
+
}, z.core.$strict>;
|
|
6588
|
+
}, z.core.$strict>;
|
|
6589
|
+
}, z.core.$strict>;
|
|
6590
|
+
}, z.core.$strict>;
|
|
6591
|
+
/** Normalizing old storage never subscribes an existing user to a new topic. */
|
|
6592
|
+
declare function initialRadarBrowserSubscriptionV2(initialRevision: string): RadarBrowserSubscriptionViewV2;
|
|
6593
|
+
/** Only these explicit RPC adapters may cross the two externally consumed versions. */
|
|
6594
|
+
declare function projectRadarBrowserSubscriptionV1(view: RadarBrowserSubscriptionViewV2): RadarBrowserSubscriptionView;
|
|
6595
|
+
/** A legacy full stop must stop the hidden topic as well; ordinary edits preserve its saved selection. */
|
|
6596
|
+
declare function upgradeRadarBrowserSubscriptionCommandV1(command: RadarBrowserSubscriptionSave, current: RadarBrowserTopicsV2): RadarBrowserSubscriptionSaveV2;
|
|
6355
6597
|
//#endregion
|
|
6356
6598
|
//#region src/improvement-column.d.ts
|
|
6357
6599
|
declare const radarImprovementPageSize = 20;
|
|
@@ -7268,4 +7510,4 @@ declare const readRadarCodexModels: (response: Response) => Promise<{
|
|
|
7268
7510
|
/** Fixed model-catalog locator for one supported website language. */
|
|
7269
7511
|
declare const radarCodexModelsPath: (locale: RadarWebsiteLocale) => string;
|
|
7270
7512
|
//#endregion
|
|
7271
|
-
export { CreateRadarResetSourceErrorEnvelopeInputV2, RadarActivityFile, RadarActivityFileV2, RadarActivityFileV3, RadarActivityProgress, RadarActivityProgressV2, RadarActivityProgressV3, RadarActivityReactionId, RadarBrowserSubscriptionFailure, RadarBrowserSubscriptionRead, RadarBrowserSubscriptionSave, RadarBrowserSubscriptionView, RadarBrowserTopics, RadarCodexGuessChoice, RadarCodexGuessError, RadarCodexGuessSaveReq, RadarCodexGuessView, RadarCodexModel, RadarCodexModels, RadarCodexProgressChange, RadarCodexProgressChangeV2, RadarCodexProgressChangeV3, RadarCodexProgressChangesV1, RadarCodexProgressChangesV2, RadarCodexProgressChangesV3, RadarCodexProgressEntryV3, RadarCodexProgressEntryV5, RadarCodexProgressImprovementV5, RadarCodexProgressPostRoleV5, RadarCodexProgressPostV5, RadarCodexProgressResetEntryV5, RadarCodexProgressTitleV3, RadarCodexProgressV1, RadarCodexProgressV2, RadarCodexProgressV3, RadarCodexProgressV4, RadarCodexProgressV5, RadarCodexReleaseDirectory, RadarCodexReleaseMonth, RadarCodexReleaseNotes, RadarCodexTimePoint, RadarImprovementEntry, RadarImprovementHead, RadarImprovementPage, RadarNotificationProjection, RadarNotificationTarget, RadarNotificationTask, RadarNotificationTasks, RadarNotificationTopic, RadarResetActionDetailV1, RadarResetActionDetailV2, RadarResetActionItemV2, RadarResetActionSummaryV2, RadarResetActiveActionItemV2, RadarResetAnalysisV1, RadarResetClue, RadarResetClueSnapshot, RadarResetDetailChunkReferenceV2, RadarResetDetailChunkRequestV2, RadarResetDetailManifestV2, RadarResetDetailMultipartEncodeInputV2, RadarResetDetailMultipartParseInputV2, RadarResetDetailMultipartPartV2, RadarResetExportV1, RadarResetExportV2, RadarResetPendingActionV1, RadarResetPendingActionV2, RadarResetPositiveDecimalV2, RadarResetPrimarySourceV1, RadarResetPublicIdV2, RadarResetPublicationHomeFactsV2, RadarResetPublicationRevisionAvailableV2, RadarResetPublicationTiming, RadarResetReadActionsRequestV2, RadarResetReadActionsSuccessV2, RadarResetReadChangesRequestV2, RadarResetReadChangesSuccessV2, RadarResetReadDetailBatchRequestV2, RadarResetReadHeadRequestV2, RadarResetReadHeadSuccessV2, RadarResetSafeCauseSnapshotV2, RadarResetSafeCauseValueV2, RadarResetSha256V2, RadarResetSnapshotAvailableV1, RadarResetSourceContractErrorInputV2, RadarResetSourceContractErrorV2, RadarResetSourceErrorCodeV2, RadarResetSourceErrorEnvelopeV2, RadarResetSourceErrorV2, RadarResetSourceTranslations, RadarResetUInt64DecimalV2, RadarResetUtcTimestampV2, RadarTiboSourceStatus, RadarTitledActivityFile, RadarTitledActivityProgress, RadarWebsiteLocale, activeRadarResetClue, compareRadarNotificationTasks, compareRadarResetActionDetailsV1, compareRadarResetUtcTimestampsV1, createRadarCodexProgressCalendar, createRadarNotificationProjection, createRadarResetSourceErrorEnvelopeV2, encodeRadarActivityFile, encodeRadarActivityFileV2, encodeRadarActivityFileV3, encodeRadarResetDetailMultipartV2, encodeRadarTitledActivityFile, formatRadarResetPositiveDecimalV2, formatRadarResetUInt64DecimalV2, initialRadarBrowserSubscription, parseRadarCodexModels, parseRadarCodexProgressChangeV3, parseRadarCodexProgressChangesV3, parseRadarCodexProgressV1, parseRadarCodexProgressV2, parseRadarCodexProgressV3, parseRadarCodexProgressV4, parseRadarCodexProgressV5, parseRadarCodexReleaseDirectory, parseRadarCodexReleaseMonth, parseRadarCodexReleaseNotes, parseRadarResetActionDetailV1, parseRadarResetActionDetailV2, parseRadarResetActionSummaryV2, parseRadarResetAnalysisV1, parseRadarResetClueSnapshot, parseRadarResetDetailMultipartV2, parseRadarResetExportV1, parseRadarResetExportV2, parseRadarResetPendingActionV1, parseRadarResetPendingActionV2, parseRadarResetPositiveDecimalV2, parseRadarResetPublicationHomeFactsV2, parseRadarResetPublicationRevisionAvailableV2, parseRadarResetReadActionsRequestV2, parseRadarResetReadActionsSuccessV2, parseRadarResetReadChangesRequestV2, parseRadarResetReadChangesSuccessV2, parseRadarResetReadDetailBatchRequestV2, parseRadarResetReadHeadRequestV2, parseRadarResetReadHeadSuccessV2, parseRadarResetSnapshotAvailableV1, parseRadarResetSourceErrorEnvelopeV2, parseRadarResetUInt64DecimalV2, projectRadarBrowserSubscriptionSelection, projectRadarResetExportV1FromV2, projectRadarResetPrimarySourceV1, radarActivityEventIdSchema, radarActivityFileSchema, radarActivityFileUrl, radarActivityFileV2Schema, radarActivityFileV2Url, radarActivityFileV3Schema, radarActivityFileV3Url, radarActivityMaxBytes, radarActivityProgressSchema, radarActivityProgressV2Schema, radarActivityProgressV3Schema, radarActivityReactionCountsSchema, radarActivityReactionIdSchema, radarActivityReactionIds, radarBrowserRegistrationSchema, radarBrowserSubscriptionErrorRes, radarBrowserSubscriptionFailureSchema, radarBrowserSubscriptionOperationSchema, radarBrowserSubscriptionReadReq, radarBrowserSubscriptionRes, radarBrowserSubscriptionSaveReq, radarBrowserSubscriptionViewSchema, radarBrowserSubscriptionsPath, radarBrowserTopicsSchema, radarCodexGuessChoiceSchema, radarCodexGuessErrorSchema, radarCodexGuessSaveReqSchema, radarCodexGuessViewSchema, radarCodexModelIdSchema, radarCodexModelUrl, radarCodexModelsMaxBytes, radarCodexModelsPath, radarCodexModelsSchema, radarCodexProgressCalendar, radarCodexProgressChangeSchema, radarCodexProgressChangeV2Schema, radarCodexProgressChangeV3Schema, radarCodexProgressChangesV1Schema, radarCodexProgressChangesV2Schema, radarCodexProgressChangesV3Schema, radarCodexProgressEntrySchema, radarCodexProgressEntryV3Schema, radarCodexProgressEntryV5Schema, radarCodexProgressImprovementV5Schema, radarCodexProgressPostRoleV5Schema, radarCodexProgressPostV5Schema, radarCodexProgressPostsV5Schema, radarCodexProgressResetEntryV5Schema, radarCodexProgressScore, radarCodexProgressTitleV3Schema, radarCodexProgressV1Schema, radarCodexProgressV2MaxBytes, radarCodexProgressV2Schema, radarCodexProgressV3MaxBytes, radarCodexProgressV3Schema, radarCodexProgressV4MaxBytes, radarCodexProgressV4Schema, radarCodexProgressV5MaxBytes, radarCodexProgressV5Schema, radarCodexReleaseDirectoryMaxBytes, radarCodexReleaseDirectoryPath, radarCodexReleaseDirectorySchema, radarCodexReleaseIdentitySchema, radarCodexReleaseMonthMaxBytes, radarCodexReleaseMonthPath, radarCodexReleaseMonthSchema, radarCodexReleaseNotesMaxBytes, radarCodexReleaseNotesPath, radarCodexReleaseNotesSchema, radarCodexReleaseSectionsSchema, radarCodexReleaseUrl, radarCodexTimePointSchema, radarImprovementColumnPath, radarImprovementEligibilityReq, radarImprovementEligibilityRes, radarImprovementEntrySchema, radarImprovementErrorRes, radarImprovementHeadReq, radarImprovementHeadRes, radarImprovementPageMaxBytes, radarImprovementPageReq, radarImprovementPageRes, radarImprovementPageSize, radarNotificationProjectionSchema, radarNotificationTargetSchema, radarNotificationTaskPageSize, radarNotificationTaskSchema, radarNotificationTasksPath, radarNotificationTasksReq, radarNotificationTasksRes, radarNotificationTopicSchema, radarNotificationTopicsSchema, radarResetActionDetailV1Schema, radarResetActionDetailV2Schema, radarResetActionItemV2Schema, radarResetActionPageMaxBytesV2, radarResetActionPageMaxItemsV2, radarResetActionSummaryV2Schema, radarResetActiveActionItemV2Schema, radarResetAnalysisV1Schema, radarResetAnalyzerContractVersionV1, radarResetAudienceValues, radarResetChangeCoverageV2Schema, radarResetChangePageMaxBytesV2, radarResetChangePageMaxItemsV2, radarResetClueLifetimeMs, radarResetClueMaxBytes, radarResetCluePath, radarResetClueSchema, radarResetClueSnapshotSchema, radarResetContractVersionV1, radarResetContractVersionV2, radarResetDetailBatchMaxBytesV2, radarResetDetailBatchMaxChunksV2, radarResetDetailChunkReferenceV2Schema, radarResetDetailChunkRequestV2Schema, radarResetDetailManifestV2Schema, radarResetEffectValues, radarResetExportV1Schema, radarResetExportV2Schema, radarResetNoticeKindValues, radarResetPendingActionV1Schema, radarResetPendingActionV2Schema, radarResetPlanValues, radarResetPositiveDecimalV2Schema, radarResetProductValues, radarResetPublicDataLimits, radarResetPublicIdV2Schema, radarResetPublicationHomeFactsV2Schema, radarResetPublicationRevisionAvailableV2Schema, radarResetPublicationTimingSchema, radarResetReadActionsDataV2Schema, radarResetReadActionsRequestV2Schema, radarResetReadActionsSuccessV2Schema, radarResetReadChangesDataV2Schema, radarResetReadChangesRequestV2Schema, radarResetReadChangesSuccessV2Schema, radarResetReadDetailBatchRequestV2Schema, radarResetReadHeadDataV2Schema, radarResetReadHeadRequestV2Schema, radarResetReadHeadSuccessV2Schema, radarResetReasonBasisValues, radarResetReasonCategoryValues, radarResetSafeCauseSnapshotV2Schema, radarResetSeriesValues, radarResetSha256V2Schema, radarResetSnapshotAvailableV1Schema, radarResetSourceChangeV2Schema, radarResetSourceErrorCodeValuesV2, radarResetSourceErrorEnvelopeV2Schema, radarResetSourceErrorHttpStatusV2, radarResetSourceErrorIsRetryableV2, radarResetSourceErrorV2Schema, radarResetSourceMaxRpcCallsV2, radarResetSourceTranslationsSchema, radarResetUInt64DecimalV2Schema, radarResetUInt64DecimalV2ToBigInt, radarResetUtcTimestampV2Schema, radarResetWithdrawnActionItemV2Schema, radarTiboSourceStatusMaxBytes, radarTiboSourceStatusPath, radarTiboSourceStatusSchema, radarTitledActivityFileSchema, radarTitledActivityProgressSchema, radarWebsiteLocalePrefixes, radarWebsiteLocales, radarWebsiteOrigin, radarWebsitePagePaths, radarWebsitePageUrl, readRadarActivityFile, readRadarActivityFileV2, readRadarActivityFileV3, readRadarCodexModels, readRadarCodexReleaseDirectory, readRadarCodexReleaseMonth, readRadarCodexReleaseNotes, readRadarResetClueSnapshot, readRadarTiboSourceStatus, readRadarTitledActivityFile, redactRadarBrowserRegistrationReferences, toSafeCauseSnapshotV2 };
|
|
7513
|
+
export { CreateRadarResetSourceErrorEnvelopeInputV2, RadarActivityFile, RadarActivityFileV2, RadarActivityFileV3, RadarActivityProgress, RadarActivityProgressV2, RadarActivityProgressV3, RadarActivityReactionId, RadarBrowserNotificationProjection, RadarBrowserSubscriptionFailure, RadarBrowserSubscriptionRead, RadarBrowserSubscriptionSave, RadarBrowserSubscriptionSaveV2, RadarBrowserSubscriptionView, RadarBrowserSubscriptionViewV2, RadarBrowserTopics, RadarBrowserTopicsV2, RadarCodexGuessChoice, RadarCodexGuessError, RadarCodexGuessSaveReq, RadarCodexGuessView, RadarCodexModel, RadarCodexModels, RadarCodexProgressChange, RadarCodexProgressChangeV2, RadarCodexProgressChangeV3, RadarCodexProgressChangesV1, RadarCodexProgressChangesV2, RadarCodexProgressChangesV3, RadarCodexProgressEntryV3, RadarCodexProgressEntryV5, RadarCodexProgressImprovementV5, RadarCodexProgressPostRoleV5, RadarCodexProgressPostV5, RadarCodexProgressResetEntryV5, RadarCodexProgressTitleV3, RadarCodexProgressV1, RadarCodexProgressV2, RadarCodexProgressV3, RadarCodexProgressV4, RadarCodexProgressV5, RadarCodexReleaseDirectory, RadarCodexReleaseMonth, RadarCodexReleaseNotes, RadarCodexTimePoint, RadarImprovementEntry, RadarImprovementHead, RadarImprovementPage, RadarNotificationProjection, RadarNotificationTarget, RadarNotificationTask, RadarNotificationTasks, RadarNotificationTopic, RadarResetActionDetailV1, RadarResetActionDetailV2, RadarResetActionItemV2, RadarResetActionSummaryV2, RadarResetActiveActionItemV2, RadarResetAnalysisV1, RadarResetClue, RadarResetClueSnapshot, RadarResetDetailChunkReferenceV2, RadarResetDetailChunkRequestV2, RadarResetDetailManifestV2, RadarResetDetailMultipartEncodeInputV2, RadarResetDetailMultipartParseInputV2, RadarResetDetailMultipartPartV2, RadarResetExportV1, RadarResetExportV2, RadarResetPendingActionV1, RadarResetPendingActionV2, RadarResetPositiveDecimalV2, RadarResetPrimarySourceV1, RadarResetPublicIdV2, RadarResetPublicationHomeFactsV2, RadarResetPublicationRevisionAvailableV2, RadarResetPublicationTiming, RadarResetReadActionsRequestV2, RadarResetReadActionsSuccessV2, RadarResetReadChangesRequestV2, RadarResetReadChangesSuccessV2, RadarResetReadDetailBatchRequestV2, RadarResetReadHeadRequestV2, RadarResetReadHeadSuccessV2, RadarResetSafeCauseSnapshotV2, RadarResetSafeCauseValueV2, RadarResetSha256V2, RadarResetSnapshotAvailableV1, RadarResetSourceContractErrorInputV2, RadarResetSourceContractErrorV2, RadarResetSourceErrorCodeV2, RadarResetSourceErrorEnvelopeV2, RadarResetSourceErrorV2, RadarResetSourceTranslations, RadarResetUInt64DecimalV2, RadarResetUtcTimestampV2, RadarTiboSourceStatus, RadarTitledActivityFile, RadarTitledActivityProgress, RadarWebsiteLocale, activeRadarResetClue, compareRadarNotificationTasks, compareRadarResetActionDetailsV1, compareRadarResetUtcTimestampsV1, createRadarBrowserNotificationProjection, createRadarCodexProgressCalendar, createRadarNotificationProjection, createRadarResetSourceErrorEnvelopeV2, encodeRadarActivityFile, encodeRadarActivityFileV2, encodeRadarActivityFileV3, encodeRadarResetDetailMultipartV2, encodeRadarTitledActivityFile, formatRadarResetPositiveDecimalV2, formatRadarResetUInt64DecimalV2, initialRadarBrowserSubscription, initialRadarBrowserSubscriptionV2, parseRadarCodexModels, parseRadarCodexProgressChangeV3, parseRadarCodexProgressChangesV3, parseRadarCodexProgressV1, parseRadarCodexProgressV2, parseRadarCodexProgressV3, parseRadarCodexProgressV4, parseRadarCodexProgressV5, parseRadarCodexReleaseDirectory, parseRadarCodexReleaseMonth, parseRadarCodexReleaseNotes, parseRadarResetActionDetailV1, parseRadarResetActionDetailV2, parseRadarResetActionSummaryV2, parseRadarResetAnalysisV1, parseRadarResetClueSnapshot, parseRadarResetDetailMultipartV2, parseRadarResetExportV1, parseRadarResetExportV2, parseRadarResetPendingActionV1, parseRadarResetPendingActionV2, parseRadarResetPositiveDecimalV2, parseRadarResetPublicationHomeFactsV2, parseRadarResetPublicationRevisionAvailableV2, parseRadarResetReadActionsRequestV2, parseRadarResetReadActionsSuccessV2, parseRadarResetReadChangesRequestV2, parseRadarResetReadChangesSuccessV2, parseRadarResetReadDetailBatchRequestV2, parseRadarResetReadHeadRequestV2, parseRadarResetReadHeadSuccessV2, parseRadarResetSnapshotAvailableV1, parseRadarResetSourceErrorEnvelopeV2, parseRadarResetUInt64DecimalV2, projectRadarBrowserSubscriptionSelection, projectRadarBrowserSubscriptionV1, projectRadarResetExportV1FromV2, projectRadarResetPrimarySourceV1, radarActivityEventIdSchema, radarActivityFileSchema, radarActivityFileUrl, radarActivityFileV2Schema, radarActivityFileV2Url, radarActivityFileV3Schema, radarActivityFileV3Url, radarActivityMaxBytes, radarActivityProgressSchema, radarActivityProgressV2Schema, radarActivityProgressV3Schema, radarActivityReactionCountsSchema, radarActivityReactionIdSchema, radarActivityReactionIds, radarBrowserNotificationProjectionSchema, radarBrowserNotificationTopicSchema, radarBrowserRegistrationSchema, radarBrowserSubscriptionErrorRes, radarBrowserSubscriptionFailureSchema, radarBrowserSubscriptionOperationSchema, radarBrowserSubscriptionReadReq, radarBrowserSubscriptionRes, radarBrowserSubscriptionSaveReq, radarBrowserSubscriptionSaveV2Req, radarBrowserSubscriptionV2Res, radarBrowserSubscriptionViewSchema, radarBrowserSubscriptionViewV2Schema, radarBrowserSubscriptionsPath, radarBrowserTopicsSchema, radarBrowserTopicsV2Schema, radarCodexGuessChoiceSchema, radarCodexGuessErrorSchema, radarCodexGuessSaveReqSchema, radarCodexGuessViewSchema, radarCodexModelIdSchema, radarCodexModelUrl, radarCodexModelsMaxBytes, radarCodexModelsPath, radarCodexModelsSchema, radarCodexProgressCalendar, radarCodexProgressChangeSchema, radarCodexProgressChangeV2Schema, radarCodexProgressChangeV3Schema, radarCodexProgressChangesV1Schema, radarCodexProgressChangesV2Schema, radarCodexProgressChangesV3Schema, radarCodexProgressEntrySchema, radarCodexProgressEntryV3Schema, radarCodexProgressEntryV5Schema, radarCodexProgressImprovementV5Schema, radarCodexProgressPostRoleV5Schema, radarCodexProgressPostV5Schema, radarCodexProgressPostsV5Schema, radarCodexProgressResetEntryV5Schema, radarCodexProgressScore, radarCodexProgressTitleV3Schema, radarCodexProgressV1Schema, radarCodexProgressV2MaxBytes, radarCodexProgressV2Schema, radarCodexProgressV3MaxBytes, radarCodexProgressV3Schema, radarCodexProgressV4MaxBytes, radarCodexProgressV4Schema, radarCodexProgressV5MaxBytes, radarCodexProgressV5Schema, radarCodexReleaseDirectoryMaxBytes, radarCodexReleaseDirectoryPath, radarCodexReleaseDirectorySchema, radarCodexReleaseIdentitySchema, radarCodexReleaseMonthMaxBytes, radarCodexReleaseMonthPath, radarCodexReleaseMonthSchema, radarCodexReleaseNotesMaxBytes, radarCodexReleaseNotesPath, radarCodexReleaseNotesSchema, radarCodexReleaseSectionsSchema, radarCodexReleaseUrl, radarCodexTimePointSchema, radarImprovementColumnPath, radarImprovementEligibilityReq, radarImprovementEligibilityRes, radarImprovementEntrySchema, radarImprovementErrorRes, radarImprovementHeadReq, radarImprovementHeadRes, radarImprovementPageMaxBytes, radarImprovementPageReq, radarImprovementPageRes, radarImprovementPageSize, radarNotificationProjectionSchema, radarNotificationTargetSchema, radarNotificationTaskPageSize, radarNotificationTaskSchema, radarNotificationTasksPath, radarNotificationTasksReq, radarNotificationTasksRes, radarNotificationTopicSchema, radarNotificationTopicsSchema, radarResetActionDetailV1Schema, radarResetActionDetailV2Schema, radarResetActionItemV2Schema, radarResetActionPageMaxBytesV2, radarResetActionPageMaxItemsV2, radarResetActionSummaryV2Schema, radarResetActiveActionItemV2Schema, radarResetAnalysisV1Schema, radarResetAnalyzerContractVersionV1, radarResetAudienceValues, radarResetChangeCoverageV2Schema, radarResetChangePageMaxBytesV2, radarResetChangePageMaxItemsV2, radarResetClueLifetimeMs, radarResetClueMaxBytes, radarResetCluePath, radarResetClueSchema, radarResetClueSnapshotSchema, radarResetContractVersionV1, radarResetContractVersionV2, radarResetDetailBatchMaxBytesV2, radarResetDetailBatchMaxChunksV2, radarResetDetailChunkReferenceV2Schema, radarResetDetailChunkRequestV2Schema, radarResetDetailManifestV2Schema, radarResetEffectValues, radarResetExportV1Schema, radarResetExportV2Schema, radarResetNoticeKindValues, radarResetPendingActionV1Schema, radarResetPendingActionV2Schema, radarResetPlanValues, radarResetPositiveDecimalV2Schema, radarResetProductValues, radarResetPublicDataLimits, radarResetPublicIdV2Schema, radarResetPublicationHomeFactsV2Schema, radarResetPublicationRevisionAvailableV2Schema, radarResetPublicationTimingSchema, radarResetReadActionsDataV2Schema, radarResetReadActionsRequestV2Schema, radarResetReadActionsSuccessV2Schema, radarResetReadChangesDataV2Schema, radarResetReadChangesRequestV2Schema, radarResetReadChangesSuccessV2Schema, radarResetReadDetailBatchRequestV2Schema, radarResetReadHeadDataV2Schema, radarResetReadHeadRequestV2Schema, radarResetReadHeadSuccessV2Schema, radarResetReasonBasisValues, radarResetReasonCategoryValues, radarResetSafeCauseSnapshotV2Schema, radarResetSeriesValues, radarResetSha256V2Schema, radarResetSnapshotAvailableV1Schema, radarResetSourceChangeV2Schema, radarResetSourceErrorCodeValuesV2, radarResetSourceErrorEnvelopeV2Schema, radarResetSourceErrorHttpStatusV2, radarResetSourceErrorIsRetryableV2, radarResetSourceErrorV2Schema, radarResetSourceMaxRpcCallsV2, radarResetSourceTranslationsSchema, radarResetUInt64DecimalV2Schema, radarResetUInt64DecimalV2ToBigInt, radarResetUtcTimestampV2Schema, radarResetWithdrawnActionItemV2Schema, radarTiboSourceStatusMaxBytes, radarTiboSourceStatusPath, radarTiboSourceStatusSchema, radarTitledActivityFileSchema, radarTitledActivityProgressSchema, radarWebsiteLocalePrefixes, radarWebsiteLocales, radarWebsiteOrigin, radarWebsitePagePaths, radarWebsitePageUrl, readRadarActivityFile, readRadarActivityFileV2, readRadarActivityFileV3, readRadarCodexModels, readRadarCodexReleaseDirectory, readRadarCodexReleaseMonth, readRadarCodexReleaseNotes, readRadarResetClueSnapshot, readRadarTiboSourceStatus, readRadarTitledActivityFile, redactRadarBrowserRegistrationReferences, toSafeCauseSnapshotV2, upgradeRadarBrowserSubscriptionCommandV1 };
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,4 @@ X-Radar-Reset-Action-Id-B64: ${ln(k.encode(e.resetActionId))}\r\nX-Radar-Detail-
|
|
|
4
4
|
`)){let t=e.indexOf(`:`);if(t<=0||e.slice(t+1,t+2)!==` `)return j(`source_chunk_mismatch`,!1);let i=e.slice(0,t).toLowerCase(),a=e.slice(t+2);if(!r.has(i)||n.has(i)||a.length===0)return j(`source_chunk_mismatch`,!1);n.set(i,a)}return n.size===r.size?n:j(`source_chunk_mismatch`,!1)}function gn(e,t,n){for(let r=n;r<=e.byteLength-t.byteLength;r+=1)if(A(e,t,r))return r;return-1}async function _n(e,t){let n=Mt.parse({contractVersion:2,revision:t.revision,chunks:t.chunks});if(e.status!==200)return j(`source_chunk_mismatch`,!1);let r=M(e,`Content-Type`),i=/^multipart\/mixed; boundary=(radar-reset-v2-[0-9a-f]{48})$/u.exec(r);if(i===null)return j(`source_chunk_mismatch`,!1);let a=i[1];if(M(e,`Cache-Control`)!==`no-store`)return j(`source_chunk_mismatch`,!1);E.parse(M(e,`X-Radar-Correlation-Id`));let o=M(e,`X-Radar-Part-Count`);if(!/^[1-9][0-9]*$/u.test(o)||Number(o)>32||Number(o)!==n.chunks.length)return j(`source_chunk_mismatch`,!1);let s;try{s=on.decode(un(M(e,`X-Radar-Revision-B64`)))}catch(e){return j(`source_chunk_mismatch`,!1,e)}if(s!==n.revision)return j(`source_chunk_mismatch`,!1);let c=await mn(e),l=k.encode(`--${a}\r\n`),ee=k.encode(`--${a}--\r\n`),te=k.encode(`\r
|
|
5
5
|
\r
|
|
6
6
|
`),ne=k.encode(`\r
|
|
7
|
-
`),u=[],d=0;for(let e of n.chunks){if(!A(c,l,d))return j(`source_stream_incomplete`,!0);d+=l.byteLength;let t=gn(c,te,d);if(t<0)return j(`source_stream_incomplete`,!0);let n=hn(c.slice(d,t));if(d=t+te.byteLength,n.get(`content-type`)!==`application/octet-stream`)return j(`source_chunk_mismatch`,!1);let r;try{r=on.decode(un(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return j(`source_chunk_mismatch`,!1,e)}if(r!==e.resetActionId||n.get(`x-radar-detail-ordinal`)!==String(e.ordinal)||n.get(`x-radar-byte-size`)!==String(e.byteSize)||n.get(`x-radar-sha-256`)!==e.sha256)return j(`source_chunk_mismatch`,!1);if(d+e.byteSize+ne.byteLength>c.byteLength)return j(`source_stream_incomplete`,!0);let i=c.slice(d,d+e.byteSize);if(d+=e.byteSize,!A(c,ne,d)||(d+=ne.byteLength,await dn(i)!==e.sha256))return j(`source_chunk_mismatch`,!1);u.push({...e,bytes:i})}return!A(c,ee,d)||d+ee.byteLength!==c.byteLength?j(`source_stream_incomplete`,!0):u}const vn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function yn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=k.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function bn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return yn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return yn(String(e),n);if(e===void 0)return`undefined`;if(typeof e==`function`)return`[Function ${e.name||`anonymous`}]`;if(r.has(e))return`[Circular]`;if(t>=4)return`[DepthLimit]`;if(r.add(e),Array.isArray(e))return e.slice(0,16).map(e=>bn(e,t+1,n,r));let i={},a=e instanceof Error?[[`type`,e.constructor.name],[`name`,e.name],[`message`,e.message],...e.cause===void 0?[]:[[`cause`,e.cause]],...Object.entries(e)]:Object.entries(e);for(let[e,o]of a.slice(0,16)){let a=yn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=vn.test(a)?`[REDACTED]`:bn(o,t+1,n,r),n.remaining<=0))break}return i}function xn(e){let t=bn(e,0,{remaining:7e3},new Set),n=typeof t==`object`&&t&&!Array.isArray(t)?t:{type:e===null?`null`:typeof e,message:t};return Gt.parse(n),n}function Sn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function Cn(e){switch(e){case`source_invalid_request`:return 400;case`source_revision_unknown`:return 404;case`source_cursor_invalid`:case`source_chunk_mismatch`:return 409;case`source_response_over_capacity`:return 413;case`source_temporarily_unavailable`:case`source_rpc_transport_failure`:case`source_stream_incomplete`:return 503;case`source_integrity_conflict`:case`source_revision_identity_conflict`:case`source_sequence_exhausted`:return 500}}function wn(e){let t={contractVersion:2,ok:!1,error:{code:e.code,operation:e.operation,stage:e.stage,...e.revision===void 0?{}:{revision:e.revision},retryable:Sn(e.code),correlationId:e.correlationId,cause:xn(e.cause)}};return qt.parse(t)}const Tn=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),En=e.iso.date(),N=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:Tn,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),Dn=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:Tn}),e.strictObject({state:e.enum([`pending`,`failed`,`not_applicable`]),text:e.null()})]),P=e.strictObject({contractVersion:e.literal(1),generatedAt:e.iso.datetime(),timeZone:e.string().refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid source time zone`),startDate:En,endDate:En,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:En,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(N),summary:Dn})).length(28),undatedEntries:e.array(N)}).superRefine((e,t)=>{let n=Date.parse(`${e.startDate}T00:00:00Z`);for(let[r,i]of e.days.entries()){let e=new Date(n+r*864e5).toISOString().slice(0,10);(i.date!==e||i.dayNumber!==r+1)&&t.addIssue({code:`custom`,path:[`days`,r],message:`Days must be contiguous and numbered in order`}),i.entries.some(e=>e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`days`,r,`entries`],message:`Unresolved dates belong in undatedEntries`});let a=i.entries.filter(e=>e.deliveryState===`landed`),o=a.some(e=>e.category===`improvement`),s=a.some(e=>e.category!==`improvement`),c=o?s?`both`:`improvement`:s?`reset`:`unconfirmed`;(i.outcome!==c||a.length===0!=(i.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,r],message:`Outcome and summary must reflect landed evidence`})}e.days.at(-1)?.date!==e.endDate&&t.addIssue({code:`custom`,path:[`endDate`],message:`End must match the last activity day`}),e.undatedEntries.some(e=>e.dateBasis!==`unresolved`)&&t.addIssue({code:`custom`,path:[`undatedEntries`],message:`Undated entries must have unresolved dates`})});function On(e){return P.parse(e)}function kn(e){let t=e.filter(e=>e.deliveryState===`landed`),n=t.some(e=>e.category===`improvement`),r=t.some(e=>e.category!==`improvement`);return n?r?`both`:`improvement`:r?`reset`:`unconfirmed`}const An=524288,F=P.shape,jn=F.days.element,Mn=N.extend({date:F.startDate.nullable()}).superRefine((e,t)=>{e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}),Nn=e.strictObject({state:e.enum([`unconfirmed`,`ongoing`,`ended`]),sourceUrls:e.array(N.shape.sourceUrls.element)}).superRefine((e,t)=>{e.state!==`unconfirmed`&&e.sourceUrls.length===0&&t.addIssue({code:`custom`,path:[`sourceUrls`],message:`Confirmed lifecycle states require source evidence`})}),Pn=jn.omit({date:!0,entries:!0}).extend({entries:e.array(Mn),lifecycle:Nn}),I=e.strictObject({contractVersion:e.literal(2),generatedAt:F.generatedAt,timeZone:F.timeZone,processing:F.processing,days:e.array(Pn).length(28),unassignedEntries:e.array(Mn)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`});let e=r.entries.filter(e=>e.deliveryState===`landed`),i=kn(r.entries);(r.outcome!==i||e.length===0!=(r.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome and summary must reflect landed evidence`})}});function Fn(e){return I.parse(e)}const In=An,L=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Ln=N.extend({title:L}),Rn=I.shape,zn=Rn.days.element,Bn=zn.shape.entries.element.safeExtend({title:L}),Vn=zn.extend({title:L.nullable(),entries:e.array(Bn)}).superRefine((e,t)=>{e.title!==null!=(e.summary.state===`ready`)&&t.addIssue({code:`custom`,path:[`title`],message:`A daily title is available exactly when its summary is ready`})}),R=e.strictObject({...Rn,contractVersion:e.literal(3),days:e.array(Vn),unassignedEntries:e.array(Bn)}).superRefine((e,t)=>{let n=I.safeParse({contractVersion:2,generatedAt:e.generatedAt,timeZone:e.timeZone,processing:e.processing,days:e.days.map(({title:e,...t})=>({...t,entries:t.entries.map(({title:e,...t})=>t)})),unassignedEntries:e.unassignedEntries.map(({title:e,...t})=>t)});if(!n.success)for(let e of n.error.issues)t.addIssue({...e})});function Hn(e){return{improvementDays:e.days.filter(e=>e.outcome===`improvement`||e.outcome===`both`).length,resetDays:e.days.filter(e=>e.outcome===`reset`||e.outcome===`both`).length}}function Un(e){return R.parse(e)}const Wn=In,Gn=I.shape,Kn=R.shape.unassignedEntries,qn=Gn.days.element.omit({summary:!0}).extend({entries:Kn}),z=e.strictObject({...Gn,contractVersion:e.literal(4),days:e.array(qn).length(28),unassignedEntries:Kn}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Jn(e){return z.parse(e)}function Yn(e,t){let n=new Set;for(let r of e)n.has(r.eventId)&&t.addIssue({code:`custom`,message:`Duplicate activity eventId`}),n.add(r.eventId)}function Xn(e,t,n){let r=n.reduce((t,n)=>t+e.reactionCounts[n],0);(!Number.isSafeInteger(r)||r!==e.reactionTotal)&&t.addIssue({code:`custom`,path:[`reactionTotal`],message:`Total must equal all reaction counts`})}async function Zn(e,t,n){if(e.status!==200){let t={status:e.status,statusText:e.statusText};try{await e.body?.cancel()}catch(e){throw Error(`activity_file_http_error`,{cause:{...t,cancellationCause:e}})}throw Error(`activity_file_http_error`,{cause:t})}if(e.body===null)throw Error(`activity_file_body_missing`);let r=e.body.getReader(),i=[],a=0;try{for(;;){let e=await r.read();if(e.done)break;if(a+=e.value.byteLength,a>n)throw Error(`activity_file_too_large`,{cause:{maxBytes:n,observedBytes:a}});i.push(e.value)}let e=new Uint8Array(a),o=0;for(let t of i)e.set(t,o),o+=t.byteLength;return t.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(e)))}catch(e){try{await r.cancel()}catch{}throw Error(`activity_file_read_failed`,{cause:e})}finally{r.releaseLock()}}function Qn(e,t,n){let r=new TextEncoder().encode(JSON.stringify(t.parse(e)));if(r.byteLength>n)throw Error(`activity_file_too_large`,{cause:{byteLength:r.byteLength}});return r}const B=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],$n=e.enum(B),V=e.string().min(1).max(128),H=524288,er=`https://data.radarultra.com/activity/v1/latest.json`,tr=`https://data.radarultra.com/activity/v2/latest.json`,nr=N.extend({eventId:V}),rr=P.safeExtend({days:e.array(P.shape.days.element.extend({entries:e.array(nr)})).length(28),undatedEntries:e.array(nr)});function ir(e,t){Yn([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const ar=rr.superRefine(ir),or=e.record($n,e.number().int().nonnegative()),sr=e.strictObject({reactionCounts:or,reactionTotal:e.number().int().nonnegative()});function cr(e,t){Xn(e,t,B)}const lr=nr.extend(sr.shape).superRefine(cr),ur=rr.safeExtend({days:e.array(rr.shape.days.element.extend({entries:e.array(lr)})).length(28),undatedEntries:e.array(lr)}).superRefine(ir),U=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array($n).length(B.length).refine(e=>new Set(e).size===B.length,`Every reaction must occur exactly once`),progress:ur}),dr=R.shape,fr=dr.unassignedEntries.element.safeExtend({eventId:V}),pr=e.strictObject({...dr,days:e.array(dr.days.element.safeExtend({entries:e.array(fr)})).length(28),unassignedEntries:e.array(fr)}),mr=pr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=R.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e});Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),hr=fr.safeExtend(sr.shape).superRefine(cr),gr=pr.safeExtend({days:e.array(dr.days.element.safeExtend({entries:e.array(hr)})).length(28),unassignedEntries:e.array(hr)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=mr.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e})}),_r=U.extend({progress:gr}),vr=z.shape,yr=vr.unassignedEntries.element.safeExtend({eventId:V}),br=z.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(yr)})).length(28),unassignedEntries:e.array(yr)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),xr=yr.safeExtend(sr.shape).superRefine(cr),Sr=br.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(xr)})).length(28),unassignedEntries:e.array(xr)}),Cr=U.extend({progress:Sr});async function wr(e){return Zn(e,U,H)}async function Tr(e){return Zn(e,_r,H)}async function Er(e){return Zn(e,Cr,H)}function Dr(e){return Qn(e,U,H)}function Or(e){return Qn(e,_r,H)}function kr(e){return Qn(e,Cr,H)}const Ar=e.strictObject({changeId:e.string().min(1).max(128),eventId:e.string().min(1).max(128),revision:e.int().positive(),kind:e.enum([`created`,`updated`,`withdrawn`]),date:e.iso.date().nullable(),entry:N,receivedAt:e.iso.datetime().nullable(),acceptedAt:e.iso.datetime()}),jr=e.strictObject({contractVersion:e.literal(1),changes:e.array(Ar),nextCursor:e.string().min(1),hasMore:e.boolean()}),Mr=Ar.extend({dayNumber:P.shape.days.element.shape.dayNumber.nullable()}),Nr=jr.extend({contractVersion:e.literal(2),changes:e.array(Mr)}),Pr=e.int().min(0).max(2**53-1),Fr=e.int().min(1).max(28),Ir=e.enum([`yes`,`no`]).nullable(),Lr=e.strictObject({choice:Ir}),Rr=e.strictObject({yes:Pr,no:Pr,total:Pr}).superRefine((e,t)=>{(!Number.isSafeInteger(e.yes+e.no)||e.total!==e.yes+e.no)&&t.addIssue({code:`custom`,path:[`total`],message:`Total must equal the effective choices.`})}),zr=e.strictObject({dayNumber:Fr,state:e.enum([`unopened`,`open`,`closed`]),choice:Ir,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Rr}).superRefine((e,t)=>{let n=e.choice===null?`none`:e.outcome===`unconfirmed`?`waiting`:e.choice===e.outcome?`correct`:`incorrect`;e.personalResult!==n&&t.addIssue({code:`custom`,path:[`personalResult`],message:`Personal result must match the confirmed outcome and choice.`}),e.state!==`closed`&&e.outcome!==`unconfirmed`&&t.addIssue({code:`custom`,path:[`outcome`],message:`An open or unopened day cannot have a confirmed result.`}),e.state===`unopened`&&(e.choice!==null||e.counts.total!==0)&&t.addIssue({code:`custom`,path:[`state`],message:`An unopened day cannot have choices.`})}),Br=e.strictObject({revision:Pr,openDayNumber:Fr.nullable(),days:e.array(zr).length(28)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Every official day must occur once, in order.`});let i=e.openDayNumber===null||r.dayNumber<e.openDayNumber?`closed`:r.dayNumber===e.openDayNumber?`open`:`unopened`;r.state!==i&&t.addIssue({code:`custom`,path:[`days`,n,`state`],message:`Only the next official day may be open.`})}}),Vr=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`payload_too_large`,`unsupported_media_type`,`origin_not_allowed`,`rate_limited`,`dependency_unavailable`,`internal_error`,`day_closed`,`identity_unavailable`]),message:e.string().min(1).max(2048),requestId:e.string().min(1).max(128),operation:e.enum([`get_guesses`,`set_guess`]),stage:e.string().min(1).max(128),cause:e.record(e.string(),e.unknown()),saveOutcome:e.enum([`not_saved`,`unknown`]).optional()})}).superRefine(({error:e},t)=>{e.operation===`set_guess`!=(e.saveOutcome!==void 0)&&t.addIssue({code:`custom`,path:[`error`,`saveOutcome`],message:`Only save failures must include a save outcome.`})}),Hr=e.strictObject({"zh-Hans":b.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":b.shape.noticeTimeline.element.shape.sourceTextZh,ja:b.shape.noticeTimeline.element.shape.sourceTextZh,ko:b.shape.noticeTimeline.element.shape.sourceTextZh}),Ur=b.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:Hr}).strict(),Wr=e.strictObject({...b.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Ur).min(1).max(r.actionDetail.noticeTimeline)}),Gr=e.strictObject({...x.shape,noticeTimeline:e.array(Ur.omit({phase:!0}).extend({kinds:x.shape.noticeTimeline.element.shape.kinds}).strict()).min(1).max(r.actionDetail.noticeTimeline)}),Kr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},qr=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Kr)}),Jr=e=>({...e,noticeTimeline:e.noticeTimeline.map(Kr)}),Yr=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},W=Wr.superRefine((e,t)=>{Yr(b.safeParse(qr(e)),t)}),Xr=Gr.superRefine((e,t)=>{Yr(x.safeParse(Jr(e)),t)}),Zr=e.strictObject({...S.shape,contractVersion:e.literal(2),actions:e.array(W).min(1).max(r.analysis.actions),pendingResetActions:e.array(Xr).max(r.analysis.actions)}).superRefine((e,t)=>{Yr(S.safeParse({...e,contractVersion:1,actions:e.actions.map(qr),pendingResetActions:e.pendingResetActions.map(Jr)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),Qr=e=>W.parse(e),$r=e=>Xr.parse(e),ei=e=>Zr.parse(e);function ti(e){let t=ei(e);return S.parse({...t,contractVersion:1,actions:t.actions.map(qr),pendingResetActions:t.pendingResetActions.map(Jr)})}const G=b.shape.noticeTimeline.element.shape,ni=e.enum([`initial`,`supplement`,`correction`]).nullable(),ri=e.strictObject({authoredAt:G.authoredAt,role:ni,sourceUrl:G.sourceUrl,sourceText:G.sourceText,sourceTextZh:G.sourceTextZh}),ii=e.array(ri).min(1).superRefine((e,t)=>{let n=new Set,r;for(let[i,a]of e.entries()){if(n.has(a.sourceUrl)&&t.addIssue({code:`custom`,path:[i,`sourceUrl`],message:`An original post may appear only once per improvement`}),n.add(a.sourceUrl),!G.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=C(r.authoredAt,a.authoredAt);(e>0||e===0&&r.sourceUrl>a.sourceUrl)&&t.addIssue({code:`custom`,path:[i],message:`Posts must be ordered by authoredAt and sourceUrl`})}r=a}}),ai=Wn,oi=N.omit({description:!0}).extend({category:e.literal(`improvement`),title:L,posts:ii}),si=N.extend({category:e.enum([`direct_reset`,`reset_card`]),title:L}),ci=e.discriminatedUnion(`category`,[oi,si]),li=z.shape,ui=li.unassignedEntries.element.shape.date;function di(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const fi=e.discriminatedUnion(`category`,[oi.extend({date:ui}).superRefine(di),si.extend({date:ui}).superRefine(di)]),pi=e.strictObject({...li,contractVersion:e.literal(5),days:e.array(li.days.element.extend({entries:e.array(fi)})).length(28),unassignedEntries:e.array(fi)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function mi(e){return pi.parse(e)}const hi=`https://data.radarultra.com/activity/v3/latest.json`,gi=pi.shape,[_i,vi]=gi.unassignedEntries.element.options,yi=_i.safeExtend({eventId:V}),bi=vi.safeExtend({eventId:V}),xi=e.discriminatedUnion(`category`,[yi,bi]),Si=pi.safeExtend({days:e.array(gi.days.element.extend({entries:e.array(xi)})).length(28),unassignedEntries:e.array(xi)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Ci={reactionCounts:or,reactionTotal:e.number().int().nonnegative()},wi=(e,t)=>Xn(e,t,B),Ti=e.discriminatedUnion(`category`,[yi.safeExtend(Ci).superRefine(wi),bi.safeExtend(Ci).superRefine(wi)]),Ei=Si.safeExtend({days:e.array(gi.days.element.extend({entries:e.array(Ti)})).length(28),unassignedEntries:e.array(Ti)}),Di=U.extend({progress:Ei});async function Oi(e){return Zn(e,Di,H)}function ki(e){return Qn(e,Di,H)}const Ai=e.discriminatedUnion(`category`,[oi,N.extend({category:e.enum([`direct_reset`,`reset_card`])})]),ji=Mr.extend({entry:Ai}),Mi=Nr.extend({contractVersion:e.literal(3),changes:e.array(ji)});function Ni(e){return ji.parse(e)}function Pi(e){return Mi.parse(e)}const Fi=`https://radarultra.com`,Ii=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],Li={"zh-Hans":`/zh`,"zh-Hant":`/zh-hant`,en:``,ja:`/ja`,ko:`/ko`},Ri={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`},K=e.discriminatedUnion(`product`,[e.strictObject({product:e.literal(`cli`),version:e.string().regex(/^\d+\.\d+\.\d+$/)}),e.strictObject({product:e.literal(`app`),version:e.string().regex(/^\d{2}\.\d{3,4}$/)})]),q=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function J(e,t){return Fi+Li[t]+Ri[e]}function zi(e,t,n){let r=K.parse({product:e,version:t});return`${J(`changelog`,n)}/${r.product}/${r.version}`}function Bi(e,t){return`${J(`models`,t)}/${q.parse(e)}`}const Vi=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),Hi=Date.parse(`${Vi.startDate}T00:00:00Z`),Ui=(Date.parse(`${Vi.endDate}T00:00:00Z`)-Hi)/864e5+1,Wi=new Intl.DateTimeFormat(`en-CA`,{timeZone:Vi.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function Gi(e){let t=Wi.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-Hi)/864e5,i=r<0?`before`:r>=Ui?`ended`:`live`,a=Math.min(Ui,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const Ki=e.enum([`reset`,`improvement`]),qi=e.array(Ki).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),Ji=t=>e.url().refine(e=>Ii.some(n=>e===J(t,n)),`notification_target_url_invalid`),Yi=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:Ji(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:Ji(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),Xi=e.object({topics:qi,target:Yi}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`);function Zi(e,t){return Xi.parse({topics:[e],target:{kind:e,webUrl:J(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const Qi=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...Xi.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),C(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function $i(e,t){return C(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const ea=`/api/v1/notification-tasks`,ta=100,na=e.string().min(1).max(8192),ra=e.object({cursor:na.optional()}).strict(),ia=e.object({contractVersion:e.literal(1),roundCursor:na,notifications:e.array(Qi).max(100),nextCursor:na.nullable()}).strict().superRefine((e,t)=>{new Set(e.notifications.map(e=>e.notificationId)).size!==e.notifications.length&&t.addIssue({code:`custom`,message:`notification_task_duplicate`});for(let n=1;n<e.notifications.length;n++)$i(e.notifications.at(n-1),e.notifications.at(n))>=0&&t.addIssue({code:`custom`,message:`notification_task_order_invalid`});e.nextCursor!==null&&e.notifications.length===0&&t.addIssue({code:`custom`,message:`notification_task_empty_continuation`})}),aa=`/api/browser-notifications`,oa=e.string().min(1).max(128),sa=e.uuid(),ca=e.enum(Ii),la=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),ua=`[cdef][\\w-]{21}`,da=e.strictObject({fid:e.string().regex(RegExp(`^${ua}$`))});function fa(e){return e.replace(RegExp(`(^|[^\\w-])${ua}(?![\\w-])`,`g`),`$1[registration]`)}const Y={operationId:sa,expectedRevision:oa},pa=e.discriminatedUnion(`action`,[e.strictObject({...Y,action:e.literal(`register`),topics:la.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:ca,registration:da}),e.strictObject({...Y,action:e.literal(`set_topics`),topics:la}),e.strictObject({...Y,action:e.literal(`set_locale`),locale:ca}),e.strictObject({...Y,action:e.literal(`restore`),registration:da}),e.strictObject({...Y,action:e.literal(`retry`)}),e.strictObject({...Y,action:e.literal(`cancel`)})]),ma=e.strictObject({operationId:sa.optional(),expectedRevision:oa.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),ha=e.strictObject({code:e.enum([`invalid_request`,`identity_unavailable`,`origin_not_allowed`,`rate_limited`,`revision_conflict`,`operation_conflict`,`registration_conflict`,`dependency_unavailable`,`provider_rejected`,`provider_rate_limited`,`provider_unavailable`,`provider_timeout`,`internal_error`]),operationId:sa.optional(),correlationId:e.uuid(),stage:e.string().min(1).max(128),saveOutcome:e.enum([`not_saved`,`unknown`]),reasonSummary:e.string().min(1).max(2048),retryable:e.boolean(),cause:e.record(e.string(),e.unknown())}),ga=e.strictObject({id:sa,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:ha.optional()}),_a=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:oa,topics:la,locale:ca.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:ga.nullable()});function va(e,t){return{topics:t.action===`register`||t.action===`set_topics`?t.topics:e.topics,locale:t.action===`register`||t.action===`set_locale`?t.locale:e.locale}}const ya=e.strictObject({data:_a}),ba=e.strictObject({error:ha});function xa(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Sa=20,Ca=2*1024*1024,wa=`/api/v1/improvements`,Ta=e.string().min(1).max(1024),[Ea]=Si.shape.unassignedEntries.element.options,Da=Ea.safeExtend({date:e.iso.date().refine(e=>e>Vi.endDate,`improvement_must_follow_campaign`)}),Oa=e.strictObject({}),ka=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),Aa=e.strictObject({cursor:Ta.nullable(),limit:e.literal(20)}),ja=ka.extend({entries:e.array(Da).max(20),nextCursor:Ta.nullable()}).superRefine((e,t)=>{new Set(e.entries.map(e=>e.eventId)).size!==e.entries.length&&t.addIssue({code:`custom`,path:[`entries`],message:`Duplicate improvement identity`})}),Ma=e.strictObject({eventIds:e.array(V).min(1).max(128)}),Na=e.strictObject({eventIds:e.array(V).max(128)}),Pa=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`dependency_unavailable`,`internal_error`]),message:e.string(),requestId:e.uuid(),operation:e.string(),stage:e.string(),cause:e.record(e.string(),e.unknown())})}),Fa=`/tibo-source/v1/latest.json`,Ia=512*1024,La=e.iso.datetime({offset:!0}),Ra=b.shape.noticeTimeline.element,za=e.strictObject({contractVersion:e.literal(1),observedAt:La,check:e.strictObject({checkedAt:La,freshUntil:La,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:La,sourceUrl:Ra.shape.sourceUrl,sourceText:e.string(),sourceTranslations:Hr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function Ba(e){let t=e.body?.getReader();if(t===void 0)throw Error(`tibo_source_status_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>524288)throw Error(`tibo_source_status_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`tibo_source_status_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return za.parse(JSON.parse(o))}const Va=`/reset-clue/v1/latest.json`,Ha=4320*60*1e3,Ua=r.exportUtf8Bytes,Wa=W.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Re.nullable(),expiresAt:W.shape.noticeTimeline.element.shape.authoredAt}).strict().superRefine((e,t)=>{Date.parse(e.expiresAt)!==Date.parse(e.authoredAt)+2592e5&&t.addIssue({code:`custom`,message:`reset_clue_expiry_mismatch`,path:[`expiresAt`]})}),Ga=e.strictObject({contractVersion:e.literal(1),clue:Wa.nullable()}),Ka=e=>Ga.parse(e);function qa(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function Ja(e){let t=e.body?.getReader();if(t===void 0)throw Error(`reset_clue_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>Ua)throw Error(`reset_clue_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`reset_clue_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return Ka(JSON.parse(o))}const X=e.enum(Ii),Ya=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),Z=e.string().trim().min(1),Xa=e.url({protocol:/^https$/}),Q=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),Za=e.strictObject({operation:Z,stage:Z,cause:Gt});function Qa(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),value:t}),e.strictObject({state:e.literal(`pending`)}),e.strictObject({state:e.literal(`failed`),failure:Za})])}function $a(e,t){return e.superRefine((e,n)=>{new TextEncoder().encode(JSON.stringify(e)).byteLength>t&&n.addIssue({code:`custom`,message:`publication_utf8_size_limit_exceeded`})})}async function eo(e,t,n,r){let i=e.body?.getReader();if(i===void 0)throw Error(`${t}_body_missing`,{cause:{operation:t,stage:`read`,status:e.status}});let a=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if(o+=e.value.byteLength,o>n)throw Error(`publication_utf8_size_limit_exceeded`);a.push(e.value)}}catch(n){throw Error(`${t}_read_failed`,{cause:{operation:t,stage:`read`,status:e.status,bytes:o,cause:n}})}finally{try{await i.cancel()}catch{}i.releaseLock()}let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.byteLength;let l;try{l=new TextDecoder(`utf-8`,{fatal:!0}).decode(s)}catch(n){throw Error(`${t}_decode_failed`,{cause:{operation:t,stage:`decode`,status:e.status,cause:n}})}if(!e.ok)throw Error(`${t}_http_error`,{cause:{operation:t,stage:`http`,status:e.status,upstream:l.slice(0,4e3)}});try{return r.parse(JSON.parse(l))}catch(n){throw Error(`${t}_parse_failed`,{cause:{operation:t,stage:`parse`,status:e.status,cause:n}})}}const to=`/codex-releases/v2/directory.json`,no=128*1024,ro=128*1024,io=256*1024,ao=Q,oo={product:e.enum([`app`,`cli`]),version:Z,published:Q,month:Ya,revision:Z},so=e.strictObject(oo).superRefine(co);function co(e,t){let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});e.product===`cli`!=(e.published.kind===`instant`)&&t.addIssue({code:`custom`,path:[`published`],message:`product_date_precision_mismatch`}),(e.published.kind===`instant`?e.published.at:e.published.date).slice(0,7)!==e.month&&t.addIssue({code:`custom`,path:[`month`],message:`published_month_mismatch`})}function lo(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries()){let e=`${a.product}/${a.version}`;n.has(e)&&t.addIssue({code:`custom`,path:[`releases`,i],message:`duplicate_release_identity`}),n.add(e);let o=Date.parse(a.published.kind===`instant`?a.published.at:`${a.published.date}T00:00:00Z`);o>r&&t.addIssue({code:`custom`,path:[`releases`,i],message:`release_order_mismatch`}),r=o}}const uo=$a(e.strictObject({contractVersion:e.literal(2),releases:e.array(so),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{lo(e.releases,t);for(let n of[`app`,`cli`]){let r=e.releases.find(e=>e.product===n)?.version??null;e.latest[n]!==r&&t.addIssue({code:`custom`,path:[`latest`,n],message:`latest_release_mismatch`})}}),no),fo=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),po=e.union([Qa(e.strictObject({locale:X,points:e.array(Z).min(1).max(5)})),fo]),mo=e.strictObject({...oo,source:e.strictObject({kind:e.enum([`github`,`official`]),url:Xa}),summary:po,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{co(e,t),e.product===`cli`!=(e.source.kind===`github`)&&t.addIssue({code:`custom`,path:[`source`,`kind`],message:`product_source_mismatch`}),e.notesCount===0!=(e.summary.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`summary`],message:`curated_notes_summary_state_mismatch`})}),ho=$a(e.strictObject({contractVersion:e.literal(2),locale:X,month:Ya,releases:e.array(mo)}).superRefine((e,t)=>{lo(e.releases,t);for(let[n,r]of e.releases.entries())r.month!==e.month&&t.addIssue({code:`custom`,path:[`releases`,n,`month`],message:`file_month_mismatch`}),r.summary.state===`ready`&&r.summary.value.locale!==e.locale&&r.summary.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`releases`,n,`summary`,`value`,`locale`],message:`summary_locale_mismatch`})}),ro),go=e.array(e.strictObject({title:Z.nullable(),items:e.array(e.strictObject({text:Z,refs:Z.nullable()})).min(1)})).min(1),_o=$a(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:Z,revision:Z,locale:X,original:e.array(go.element),translation:e.union([Qa(go),fo]).nullable()}).superRefine((e,t)=>{let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});if(e.locale===`en`!=(e.translation===null)&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_locale_mismatch`}),e.locale!==`en`&&e.original.length===0!=(e.translation?.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`translation`],message:`curated_notes_translation_state_mismatch`}),e.translation?.state===`ready`){let n=e.translation.value;(n.length!==e.original.length||e.original.some((e,t)=>{let r=n.at(t);return r===void 0||e.title===null!=(r.title===null)||e.items.length!==r.items.length||e.items.some((e,t)=>e.refs!==r.items.at(t)?.refs)}))&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_structure_mismatch`})}}),io),vo=e=>uo.parse(e),yo=e=>ho.parse(e),bo=e=>_o.parse(e),xo=e=>eo(e,`codex_release_directory`,no,uo),So=e=>eo(e,`codex_release_month`,ro,ho),Co=e=>eo(e,`codex_release_notes`,io,_o);function wo(e,t){return`/codex-releases/v2/${X.parse(e)}/${Ya.parse(t)}.json`}function To(e,t,n){let r=K.parse({product:t,version:n});return`/codex-releases/v2/${X.parse(e)}/notes/${r.product}/${r.version}.json`}const Eo=128*1024;function $(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:Xa}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:Xa.nullable()})])}const Do=e.strictObject({input:Z,cached:Z,output:Z}),Oo=e.strictObject({modelId:q,name:Z,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:$(Q),chatgptRetirement:$(Q),apiRetirement:$(Q),credits:$(Do),apiPrice:$(Do),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:$(e.array(Z).min(1)),surfaces:$(e.array(Z).min(1)),about:Qa(e.strictObject({locale:X,paragraphs:e.array(Z).min(1)})),sources:e.array(e.strictObject({label:Z,url:Xa})).min(1)}).superRefine((e,t)=>{e.status===`retired`!=(e.group===`retired`)&&t.addIssue({code:`custom`,path:[`group`],message:`model_group_status_mismatch`}),e.status===`retiring`&&e.chatgptRetirement.state!==`known`&&t.addIssue({code:`custom`,path:[`chatgptRetirement`],message:`retiring_model_requires_announced_date`})}),ko=$a(e.strictObject({contractVersion:e.literal(1),locale:X,models:e.array(Oo),multipleBase:e.strictObject({modelId:q,name:Z}).nullable(),upcomingRetirement:e.strictObject({names:Z,modelIds:e.array(q).min(1),surface:e.enum([`api`,`chatgpt`]),at:Q}).nullable()}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.models.entries())n.has(i.modelId)&&t.addIssue({code:`custom`,path:[`models`,r,`modelId`],message:`duplicate_model_identity`}),n.add(i.modelId),i.about.state===`ready`&&i.about.value.locale!==e.locale&&i.about.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`models`,r,`about`,`value`,`locale`],message:`model_description_locale_mismatch`}),i.multiple!==null&&(e.multipleBase===null||i.credits.state!==`known`)&&t.addIssue({code:`custom`,path:[`models`,r,`multiple`],message:`multiple_requires_base_and_credits`});if(e.multipleBase!==null){let n=e.models.find(t=>t.modelId===e.multipleBase?.modelId);(n===void 0||n.group!==`current`||n.credits.state!==`known`||n.multiple!==`1`||n.name!==e.multipleBase.name)&&t.addIssue({code:`custom`,path:[`multipleBase`],message:`multiple_base_mismatch`})}let r=e.upcomingRetirement;if(r!==null){new Set(r.modelIds).size!==r.modelIds.length&&t.addIssue({code:`custom`,path:[`upcomingRetirement`,`modelIds`],message:`duplicate_retirement_model`});for(let n of r.modelIds){let i=e.models.find(e=>e.modelId===n),a=r.surface===`api`?i?.apiRetirement:i?.chatgptRetirement;(a?.state!==`known`||JSON.stringify(a.value)!==JSON.stringify(r.at))&&t.addIssue({code:`custom`,path:[`upcomingRetirement`],message:`retirement_model_date_mismatch`})}}}),Eo),Ao=e=>ko.parse(e),jo=e=>eo(e,`codex_models`,Eo,ko),Mo=e=>`/codex-models/v1/${X.parse(e)}.json`;export{an as RadarResetSourceContractErrorV2,qa as activeRadarResetClue,$i as compareRadarNotificationTasks,He as compareRadarResetActionDetailsV1,C as compareRadarResetUtcTimestampsV1,Gi as createRadarCodexProgressCalendar,Zi as createRadarNotificationProjection,wn as createRadarResetSourceErrorEnvelopeV2,Dr as encodeRadarActivityFile,kr as encodeRadarActivityFileV2,ki as encodeRadarActivityFileV3,pn as encodeRadarResetDetailMultipartV2,Or as encodeRadarTitledActivityFile,ct as formatRadarResetPositiveDecimalV2,st as formatRadarResetUInt64DecimalV2,xa as initialRadarBrowserSubscription,Ao as parseRadarCodexModels,Ni as parseRadarCodexProgressChangeV3,Pi as parseRadarCodexProgressChangesV3,On as parseRadarCodexProgressV1,Fn as parseRadarCodexProgressV2,Un as parseRadarCodexProgressV3,Jn as parseRadarCodexProgressV4,mi as parseRadarCodexProgressV5,vo as parseRadarCodexReleaseDirectory,yo as parseRadarCodexReleaseMonth,bo as parseRadarCodexReleaseNotes,We as parseRadarResetActionDetailV1,Qr as parseRadarResetActionDetailV2,bt as parseRadarResetActionSummaryV2,Ue as parseRadarResetAnalysisV1,Ka as parseRadarResetClueSnapshot,_n as parseRadarResetDetailMultipartV2,Ge as parseRadarResetExportV1,ei as parseRadarResetExportV2,Ke as parseRadarResetPendingActionV1,$r as parseRadarResetPendingActionV2,at as parseRadarResetPositiveDecimalV2,St as parseRadarResetPublicationHomeFactsV2,rn as parseRadarResetPublicationRevisionAvailableV2,Xt as parseRadarResetReadActionsRequestV2,en as parseRadarResetReadActionsSuccessV2,Zt as parseRadarResetReadChangesRequestV2,tn as parseRadarResetReadChangesSuccessV2,Qt as parseRadarResetReadDetailBatchRequestV2,Yt as parseRadarResetReadHeadRequestV2,$t as parseRadarResetReadHeadSuccessV2,oe as parseRadarResetSnapshotAvailableV1,nn as parseRadarResetSourceErrorEnvelopeV2,it as parseRadarResetUInt64DecimalV2,va as projectRadarBrowserSubscriptionSelection,ti as projectRadarResetExportV1FromV2,qe as projectRadarResetPrimarySourceV1,V as radarActivityEventIdSchema,U as radarActivityFileSchema,er as radarActivityFileUrl,Cr as radarActivityFileV2Schema,tr as radarActivityFileV2Url,Di as radarActivityFileV3Schema,hi as radarActivityFileV3Url,H as radarActivityMaxBytes,ar as radarActivityProgressSchema,br as radarActivityProgressV2Schema,Si as radarActivityProgressV3Schema,or as radarActivityReactionCountsSchema,$n as radarActivityReactionIdSchema,B as radarActivityReactionIds,da as radarBrowserRegistrationSchema,ba as radarBrowserSubscriptionErrorRes,ha as radarBrowserSubscriptionFailureSchema,ga as radarBrowserSubscriptionOperationSchema,ma as radarBrowserSubscriptionReadReq,ya as radarBrowserSubscriptionRes,pa as radarBrowserSubscriptionSaveReq,_a as radarBrowserSubscriptionViewSchema,aa as radarBrowserSubscriptionsPath,la as radarBrowserTopicsSchema,Ir as radarCodexGuessChoiceSchema,Vr as radarCodexGuessErrorSchema,Lr as radarCodexGuessSaveReqSchema,Br as radarCodexGuessViewSchema,q as radarCodexModelIdSchema,Bi as radarCodexModelUrl,Eo as radarCodexModelsMaxBytes,Mo as radarCodexModelsPath,ko as radarCodexModelsSchema,Vi as radarCodexProgressCalendar,Ar as radarCodexProgressChangeSchema,Mr as radarCodexProgressChangeV2Schema,ji as radarCodexProgressChangeV3Schema,jr as radarCodexProgressChangesV1Schema,Nr as radarCodexProgressChangesV2Schema,Mi as radarCodexProgressChangesV3Schema,N as radarCodexProgressEntrySchema,Ln as radarCodexProgressEntryV3Schema,ci as radarCodexProgressEntryV5Schema,oi as radarCodexProgressImprovementV5Schema,ni as radarCodexProgressPostRoleV5Schema,ri as radarCodexProgressPostV5Schema,ii as radarCodexProgressPostsV5Schema,si as radarCodexProgressResetEntryV5Schema,Hn as radarCodexProgressScore,L as radarCodexProgressTitleV3Schema,P as radarCodexProgressV1Schema,An as radarCodexProgressV2MaxBytes,I as radarCodexProgressV2Schema,In as radarCodexProgressV3MaxBytes,R as radarCodexProgressV3Schema,Wn as radarCodexProgressV4MaxBytes,z as radarCodexProgressV4Schema,ai as radarCodexProgressV5MaxBytes,pi as radarCodexProgressV5Schema,no as radarCodexReleaseDirectoryMaxBytes,to as radarCodexReleaseDirectoryPath,uo as radarCodexReleaseDirectorySchema,K as radarCodexReleaseIdentitySchema,ro as radarCodexReleaseMonthMaxBytes,wo as radarCodexReleaseMonthPath,ho as radarCodexReleaseMonthSchema,io as radarCodexReleaseNotesMaxBytes,To as radarCodexReleaseNotesPath,_o as radarCodexReleaseNotesSchema,go as radarCodexReleaseSectionsSchema,zi as radarCodexReleaseUrl,ao as radarCodexTimePointSchema,wa as radarImprovementColumnPath,Ma as radarImprovementEligibilityReq,Na as radarImprovementEligibilityRes,Da as radarImprovementEntrySchema,Pa as radarImprovementErrorRes,Oa as radarImprovementHeadReq,ka as radarImprovementHeadRes,Ca as radarImprovementPageMaxBytes,Aa as radarImprovementPageReq,ja as radarImprovementPageRes,Sa as radarImprovementPageSize,Xi as radarNotificationProjectionSchema,Yi as radarNotificationTargetSchema,ta as radarNotificationTaskPageSize,Qi as radarNotificationTaskSchema,ea as radarNotificationTasksPath,ra as radarNotificationTasksReq,ia as radarNotificationTasksRes,Ki as radarNotificationTopicSchema,qi as radarNotificationTopicsSchema,b as radarResetActionDetailV1Schema,W as radarResetActionDetailV2Schema,Dt as radarResetActionItemV2Schema,Ze as radarResetActionPageMaxBytesV2,Xe as radarResetActionPageMaxItemsV2,yt as radarResetActionSummaryV2Schema,Tt as radarResetActiveActionItemV2Schema,Pe as radarResetAnalysisV1Schema,n as radarResetAnalyzerContractVersionV1,s as radarResetAudienceValues,Ft as radarResetChangeCoverageV2Schema,$e as radarResetChangePageMaxBytesV2,Qe as radarResetChangePageMaxItemsV2,Ha as radarResetClueLifetimeMs,Ua as radarResetClueMaxBytes,Va as radarResetCluePath,Wa as radarResetClueSchema,Ga as radarResetClueSnapshotSchema,t as radarResetContractVersionV1,Je as radarResetContractVersionV2,tt as radarResetDetailBatchMaxBytesV2,et as radarResetDetailBatchMaxChunksV2,Ct as radarResetDetailChunkReferenceV2Schema,jt as radarResetDetailChunkRequestV2Schema,wt as radarResetDetailManifestV2Schema,a as radarResetEffectValues,S as radarResetExportV1Schema,Zr as radarResetExportV2Schema,Le as radarResetNoticeKindValues,x as radarResetPendingActionV1Schema,Xr as radarResetPendingActionV2Schema,c as radarResetPlanValues,w as radarResetPositiveDecimalV2Schema,o as radarResetProductValues,r as radarResetPublicDataLimits,E as radarResetPublicIdV2Schema,xt as radarResetPublicationHomeFactsV2Schema,Jt as radarResetPublicationRevisionAvailableV2Schema,Re as radarResetPublicationTimingSchema,Lt as radarResetReadActionsDataV2Schema,kt as radarResetReadActionsRequestV2Schema,Vt as radarResetReadActionsSuccessV2Schema,Rt as radarResetReadChangesDataV2Schema,At as radarResetReadChangesRequestV2Schema,Ht as radarResetReadChangesSuccessV2Schema,Mt as radarResetReadDetailBatchRequestV2Schema,It as radarResetReadHeadDataV2Schema,Ot as radarResetReadHeadRequestV2Schema,Bt as radarResetReadHeadSuccessV2Schema,ee as radarResetReasonBasisValues,l as radarResetReasonCategoryValues,Gt as radarResetSafeCauseSnapshotV2Schema,i as radarResetSeriesValues,D as radarResetSha256V2Schema,ae as radarResetSnapshotAvailableV1Schema,Pt as radarResetSourceChangeV2Schema,Ut as radarResetSourceErrorCodeValuesV2,qt as radarResetSourceErrorEnvelopeV2Schema,Cn as radarResetSourceErrorHttpStatusV2,Sn as radarResetSourceErrorIsRetryableV2,Kt as radarResetSourceErrorV2Schema,Ye as radarResetSourceMaxRpcCallsV2,Hr as radarResetSourceTranslationsSchema,rt as radarResetUInt64DecimalV2Schema,ot as radarResetUInt64DecimalV2ToBigInt,T as radarResetUtcTimestampV2Schema,Et as radarResetWithdrawnActionItemV2Schema,Ia as radarTiboSourceStatusMaxBytes,Fa as radarTiboSourceStatusPath,za as radarTiboSourceStatusSchema,_r as radarTitledActivityFileSchema,mr as radarTitledActivityProgressSchema,Li as radarWebsiteLocalePrefixes,Ii as radarWebsiteLocales,Fi as radarWebsiteOrigin,Ri as radarWebsitePagePaths,J as radarWebsitePageUrl,wr as readRadarActivityFile,Er as readRadarActivityFileV2,Oi as readRadarActivityFileV3,jo as readRadarCodexModels,xo as readRadarCodexReleaseDirectory,So as readRadarCodexReleaseMonth,Co as readRadarCodexReleaseNotes,Ja as readRadarResetClueSnapshot,Ba as readRadarTiboSourceStatus,Tr as readRadarTitledActivityFile,fa as redactRadarBrowserRegistrationReferences,xn as toSafeCauseSnapshotV2};
|
|
7
|
+
`),u=[],d=0;for(let e of n.chunks){if(!A(c,l,d))return j(`source_stream_incomplete`,!0);d+=l.byteLength;let t=gn(c,te,d);if(t<0)return j(`source_stream_incomplete`,!0);let n=hn(c.slice(d,t));if(d=t+te.byteLength,n.get(`content-type`)!==`application/octet-stream`)return j(`source_chunk_mismatch`,!1);let r;try{r=on.decode(un(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return j(`source_chunk_mismatch`,!1,e)}if(r!==e.resetActionId||n.get(`x-radar-detail-ordinal`)!==String(e.ordinal)||n.get(`x-radar-byte-size`)!==String(e.byteSize)||n.get(`x-radar-sha-256`)!==e.sha256)return j(`source_chunk_mismatch`,!1);if(d+e.byteSize+ne.byteLength>c.byteLength)return j(`source_stream_incomplete`,!0);let i=c.slice(d,d+e.byteSize);if(d+=e.byteSize,!A(c,ne,d)||(d+=ne.byteLength,await dn(i)!==e.sha256))return j(`source_chunk_mismatch`,!1);u.push({...e,bytes:i})}return!A(c,ee,d)||d+ee.byteLength!==c.byteLength?j(`source_stream_incomplete`,!0):u}const vn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function yn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=k.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function bn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return yn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return yn(String(e),n);if(e===void 0)return`undefined`;if(typeof e==`function`)return`[Function ${e.name||`anonymous`}]`;if(r.has(e))return`[Circular]`;if(t>=4)return`[DepthLimit]`;if(r.add(e),Array.isArray(e))return e.slice(0,16).map(e=>bn(e,t+1,n,r));let i={},a=e instanceof Error?[[`type`,e.constructor.name],[`name`,e.name],[`message`,e.message],...e.cause===void 0?[]:[[`cause`,e.cause]],...Object.entries(e)]:Object.entries(e);for(let[e,o]of a.slice(0,16)){let a=yn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=vn.test(a)?`[REDACTED]`:bn(o,t+1,n,r),n.remaining<=0))break}return i}function xn(e){let t=bn(e,0,{remaining:7e3},new Set),n=typeof t==`object`&&t&&!Array.isArray(t)?t:{type:e===null?`null`:typeof e,message:t};return Gt.parse(n),n}function Sn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function Cn(e){switch(e){case`source_invalid_request`:return 400;case`source_revision_unknown`:return 404;case`source_cursor_invalid`:case`source_chunk_mismatch`:return 409;case`source_response_over_capacity`:return 413;case`source_temporarily_unavailable`:case`source_rpc_transport_failure`:case`source_stream_incomplete`:return 503;case`source_integrity_conflict`:case`source_revision_identity_conflict`:case`source_sequence_exhausted`:return 500}}function wn(e){let t={contractVersion:2,ok:!1,error:{code:e.code,operation:e.operation,stage:e.stage,...e.revision===void 0?{}:{revision:e.revision},retryable:Sn(e.code),correlationId:e.correlationId,cause:xn(e.cause)}};return qt.parse(t)}const Tn=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),En=e.iso.date(),N=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:Tn,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),Dn=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:Tn}),e.strictObject({state:e.enum([`pending`,`failed`,`not_applicable`]),text:e.null()})]),P=e.strictObject({contractVersion:e.literal(1),generatedAt:e.iso.datetime(),timeZone:e.string().refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid source time zone`),startDate:En,endDate:En,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:En,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(N),summary:Dn})).length(28),undatedEntries:e.array(N)}).superRefine((e,t)=>{let n=Date.parse(`${e.startDate}T00:00:00Z`);for(let[r,i]of e.days.entries()){let e=new Date(n+r*864e5).toISOString().slice(0,10);(i.date!==e||i.dayNumber!==r+1)&&t.addIssue({code:`custom`,path:[`days`,r],message:`Days must be contiguous and numbered in order`}),i.entries.some(e=>e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`days`,r,`entries`],message:`Unresolved dates belong in undatedEntries`});let a=i.entries.filter(e=>e.deliveryState===`landed`),o=a.some(e=>e.category===`improvement`),s=a.some(e=>e.category!==`improvement`),c=o?s?`both`:`improvement`:s?`reset`:`unconfirmed`;(i.outcome!==c||a.length===0!=(i.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,r],message:`Outcome and summary must reflect landed evidence`})}e.days.at(-1)?.date!==e.endDate&&t.addIssue({code:`custom`,path:[`endDate`],message:`End must match the last activity day`}),e.undatedEntries.some(e=>e.dateBasis!==`unresolved`)&&t.addIssue({code:`custom`,path:[`undatedEntries`],message:`Undated entries must have unresolved dates`})});function On(e){return P.parse(e)}function kn(e){let t=e.filter(e=>e.deliveryState===`landed`),n=t.some(e=>e.category===`improvement`),r=t.some(e=>e.category!==`improvement`);return n?r?`both`:`improvement`:r?`reset`:`unconfirmed`}const An=524288,F=P.shape,jn=F.days.element,Mn=N.extend({date:F.startDate.nullable()}).superRefine((e,t)=>{e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}),Nn=e.strictObject({state:e.enum([`unconfirmed`,`ongoing`,`ended`]),sourceUrls:e.array(N.shape.sourceUrls.element)}).superRefine((e,t)=>{e.state!==`unconfirmed`&&e.sourceUrls.length===0&&t.addIssue({code:`custom`,path:[`sourceUrls`],message:`Confirmed lifecycle states require source evidence`})}),Pn=jn.omit({date:!0,entries:!0}).extend({entries:e.array(Mn),lifecycle:Nn}),I=e.strictObject({contractVersion:e.literal(2),generatedAt:F.generatedAt,timeZone:F.timeZone,processing:F.processing,days:e.array(Pn).length(28),unassignedEntries:e.array(Mn)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`});let e=r.entries.filter(e=>e.deliveryState===`landed`),i=kn(r.entries);(r.outcome!==i||e.length===0!=(r.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome and summary must reflect landed evidence`})}});function Fn(e){return I.parse(e)}const In=An,L=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Ln=N.extend({title:L}),Rn=I.shape,zn=Rn.days.element,Bn=zn.shape.entries.element.safeExtend({title:L}),Vn=zn.extend({title:L.nullable(),entries:e.array(Bn)}).superRefine((e,t)=>{e.title!==null!=(e.summary.state===`ready`)&&t.addIssue({code:`custom`,path:[`title`],message:`A daily title is available exactly when its summary is ready`})}),R=e.strictObject({...Rn,contractVersion:e.literal(3),days:e.array(Vn),unassignedEntries:e.array(Bn)}).superRefine((e,t)=>{let n=I.safeParse({contractVersion:2,generatedAt:e.generatedAt,timeZone:e.timeZone,processing:e.processing,days:e.days.map(({title:e,...t})=>({...t,entries:t.entries.map(({title:e,...t})=>t)})),unassignedEntries:e.unassignedEntries.map(({title:e,...t})=>t)});if(!n.success)for(let e of n.error.issues)t.addIssue({...e})});function Hn(e){return{improvementDays:e.days.filter(e=>e.outcome===`improvement`||e.outcome===`both`).length,resetDays:e.days.filter(e=>e.outcome===`reset`||e.outcome===`both`).length}}function Un(e){return R.parse(e)}const Wn=In,Gn=I.shape,Kn=R.shape.unassignedEntries,qn=Gn.days.element.omit({summary:!0}).extend({entries:Kn}),z=e.strictObject({...Gn,contractVersion:e.literal(4),days:e.array(qn).length(28),unassignedEntries:Kn}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Jn(e){return z.parse(e)}function Yn(e,t){let n=new Set;for(let r of e)n.has(r.eventId)&&t.addIssue({code:`custom`,message:`Duplicate activity eventId`}),n.add(r.eventId)}function Xn(e,t,n){let r=n.reduce((t,n)=>t+e.reactionCounts[n],0);(!Number.isSafeInteger(r)||r!==e.reactionTotal)&&t.addIssue({code:`custom`,path:[`reactionTotal`],message:`Total must equal all reaction counts`})}async function Zn(e,t,n){if(e.status!==200){let t={status:e.status,statusText:e.statusText};try{await e.body?.cancel()}catch(e){throw Error(`activity_file_http_error`,{cause:{...t,cancellationCause:e}})}throw Error(`activity_file_http_error`,{cause:t})}if(e.body===null)throw Error(`activity_file_body_missing`);let r=e.body.getReader(),i=[],a=0;try{for(;;){let e=await r.read();if(e.done)break;if(a+=e.value.byteLength,a>n)throw Error(`activity_file_too_large`,{cause:{maxBytes:n,observedBytes:a}});i.push(e.value)}let e=new Uint8Array(a),o=0;for(let t of i)e.set(t,o),o+=t.byteLength;return t.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(e)))}catch(e){try{await r.cancel()}catch{}throw Error(`activity_file_read_failed`,{cause:e})}finally{r.releaseLock()}}function Qn(e,t,n){let r=new TextEncoder().encode(JSON.stringify(t.parse(e)));if(r.byteLength>n)throw Error(`activity_file_too_large`,{cause:{byteLength:r.byteLength}});return r}const B=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],$n=e.enum(B),V=e.string().min(1).max(128),H=524288,er=`https://data.radarultra.com/activity/v1/latest.json`,tr=`https://data.radarultra.com/activity/v2/latest.json`,nr=N.extend({eventId:V}),rr=P.safeExtend({days:e.array(P.shape.days.element.extend({entries:e.array(nr)})).length(28),undatedEntries:e.array(nr)});function ir(e,t){Yn([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const ar=rr.superRefine(ir),or=e.record($n,e.number().int().nonnegative()),sr=e.strictObject({reactionCounts:or,reactionTotal:e.number().int().nonnegative()});function cr(e,t){Xn(e,t,B)}const lr=nr.extend(sr.shape).superRefine(cr),ur=rr.safeExtend({days:e.array(rr.shape.days.element.extend({entries:e.array(lr)})).length(28),undatedEntries:e.array(lr)}).superRefine(ir),U=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array($n).length(B.length).refine(e=>new Set(e).size===B.length,`Every reaction must occur exactly once`),progress:ur}),dr=R.shape,fr=dr.unassignedEntries.element.safeExtend({eventId:V}),pr=e.strictObject({...dr,days:e.array(dr.days.element.safeExtend({entries:e.array(fr)})).length(28),unassignedEntries:e.array(fr)}),mr=pr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=R.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e});Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),hr=fr.safeExtend(sr.shape).superRefine(cr),gr=pr.safeExtend({days:e.array(dr.days.element.safeExtend({entries:e.array(hr)})).length(28),unassignedEntries:e.array(hr)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=mr.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e})}),_r=U.extend({progress:gr}),vr=z.shape,yr=vr.unassignedEntries.element.safeExtend({eventId:V}),br=z.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(yr)})).length(28),unassignedEntries:e.array(yr)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),xr=yr.safeExtend(sr.shape).superRefine(cr),Sr=br.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(xr)})).length(28),unassignedEntries:e.array(xr)}),Cr=U.extend({progress:Sr});async function wr(e){return Zn(e,U,H)}async function Tr(e){return Zn(e,_r,H)}async function Er(e){return Zn(e,Cr,H)}function Dr(e){return Qn(e,U,H)}function Or(e){return Qn(e,_r,H)}function kr(e){return Qn(e,Cr,H)}const Ar=e.strictObject({changeId:e.string().min(1).max(128),eventId:e.string().min(1).max(128),revision:e.int().positive(),kind:e.enum([`created`,`updated`,`withdrawn`]),date:e.iso.date().nullable(),entry:N,receivedAt:e.iso.datetime().nullable(),acceptedAt:e.iso.datetime()}),jr=e.strictObject({contractVersion:e.literal(1),changes:e.array(Ar),nextCursor:e.string().min(1),hasMore:e.boolean()}),Mr=Ar.extend({dayNumber:P.shape.days.element.shape.dayNumber.nullable()}),Nr=jr.extend({contractVersion:e.literal(2),changes:e.array(Mr)}),Pr=e.int().min(0).max(2**53-1),Fr=e.int().min(1).max(28),Ir=e.enum([`yes`,`no`]).nullable(),Lr=e.strictObject({choice:Ir}),Rr=e.strictObject({yes:Pr,no:Pr,total:Pr}).superRefine((e,t)=>{(!Number.isSafeInteger(e.yes+e.no)||e.total!==e.yes+e.no)&&t.addIssue({code:`custom`,path:[`total`],message:`Total must equal the effective choices.`})}),zr=e.strictObject({dayNumber:Fr,state:e.enum([`unopened`,`open`,`closed`]),choice:Ir,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Rr}).superRefine((e,t)=>{let n=e.choice===null?`none`:e.outcome===`unconfirmed`?`waiting`:e.choice===e.outcome?`correct`:`incorrect`;e.personalResult!==n&&t.addIssue({code:`custom`,path:[`personalResult`],message:`Personal result must match the confirmed outcome and choice.`}),e.state!==`closed`&&e.outcome!==`unconfirmed`&&t.addIssue({code:`custom`,path:[`outcome`],message:`An open or unopened day cannot have a confirmed result.`}),e.state===`unopened`&&(e.choice!==null||e.counts.total!==0)&&t.addIssue({code:`custom`,path:[`state`],message:`An unopened day cannot have choices.`})}),Br=e.strictObject({revision:Pr,openDayNumber:Fr.nullable(),days:e.array(zr).length(28)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Every official day must occur once, in order.`});let i=e.openDayNumber===null||r.dayNumber<e.openDayNumber?`closed`:r.dayNumber===e.openDayNumber?`open`:`unopened`;r.state!==i&&t.addIssue({code:`custom`,path:[`days`,n,`state`],message:`Only the next official day may be open.`})}}),Vr=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`payload_too_large`,`unsupported_media_type`,`origin_not_allowed`,`rate_limited`,`dependency_unavailable`,`internal_error`,`day_closed`,`identity_unavailable`]),message:e.string().min(1).max(2048),requestId:e.string().min(1).max(128),operation:e.enum([`get_guesses`,`set_guess`]),stage:e.string().min(1).max(128),cause:e.record(e.string(),e.unknown()),saveOutcome:e.enum([`not_saved`,`unknown`]).optional()})}).superRefine(({error:e},t)=>{e.operation===`set_guess`!=(e.saveOutcome!==void 0)&&t.addIssue({code:`custom`,path:[`error`,`saveOutcome`],message:`Only save failures must include a save outcome.`})}),Hr=e.strictObject({"zh-Hans":b.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":b.shape.noticeTimeline.element.shape.sourceTextZh,ja:b.shape.noticeTimeline.element.shape.sourceTextZh,ko:b.shape.noticeTimeline.element.shape.sourceTextZh}),Ur=b.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:Hr}).strict(),Wr=e.strictObject({...b.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Ur).min(1).max(r.actionDetail.noticeTimeline)}),Gr=e.strictObject({...x.shape,noticeTimeline:e.array(Ur.omit({phase:!0}).extend({kinds:x.shape.noticeTimeline.element.shape.kinds}).strict()).min(1).max(r.actionDetail.noticeTimeline)}),Kr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},qr=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Kr)}),Jr=e=>({...e,noticeTimeline:e.noticeTimeline.map(Kr)}),Yr=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},W=Wr.superRefine((e,t)=>{Yr(b.safeParse(qr(e)),t)}),Xr=Gr.superRefine((e,t)=>{Yr(x.safeParse(Jr(e)),t)}),Zr=e.strictObject({...S.shape,contractVersion:e.literal(2),actions:e.array(W).min(1).max(r.analysis.actions),pendingResetActions:e.array(Xr).max(r.analysis.actions)}).superRefine((e,t)=>{Yr(S.safeParse({...e,contractVersion:1,actions:e.actions.map(qr),pendingResetActions:e.pendingResetActions.map(Jr)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),Qr=e=>W.parse(e),$r=e=>Xr.parse(e),ei=e=>Zr.parse(e);function ti(e){let t=ei(e);return S.parse({...t,contractVersion:1,actions:t.actions.map(qr),pendingResetActions:t.pendingResetActions.map(Jr)})}const G=b.shape.noticeTimeline.element.shape,ni=e.enum([`initial`,`supplement`,`correction`]).nullable(),ri=e.strictObject({authoredAt:G.authoredAt,role:ni,sourceUrl:G.sourceUrl,sourceText:G.sourceText,sourceTextZh:G.sourceTextZh}),ii=e.array(ri).min(1).superRefine((e,t)=>{let n=new Set,r;for(let[i,a]of e.entries()){if(n.has(a.sourceUrl)&&t.addIssue({code:`custom`,path:[i,`sourceUrl`],message:`An original post may appear only once per improvement`}),n.add(a.sourceUrl),!G.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=C(r.authoredAt,a.authoredAt);(e>0||e===0&&r.sourceUrl>a.sourceUrl)&&t.addIssue({code:`custom`,path:[i],message:`Posts must be ordered by authoredAt and sourceUrl`})}r=a}}),ai=Wn,oi=N.omit({description:!0}).extend({category:e.literal(`improvement`),title:L,posts:ii}),si=N.extend({category:e.enum([`direct_reset`,`reset_card`]),title:L}),ci=e.discriminatedUnion(`category`,[oi,si]),li=z.shape,ui=li.unassignedEntries.element.shape.date;function di(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const fi=e.discriminatedUnion(`category`,[oi.extend({date:ui}).superRefine(di),si.extend({date:ui}).superRefine(di)]),pi=e.strictObject({...li,contractVersion:e.literal(5),days:e.array(li.days.element.extend({entries:e.array(fi)})).length(28),unassignedEntries:e.array(fi)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function mi(e){return pi.parse(e)}const hi=`https://data.radarultra.com/activity/v3/latest.json`,gi=pi.shape,[_i,vi]=gi.unassignedEntries.element.options,yi=_i.safeExtend({eventId:V}),bi=vi.safeExtend({eventId:V}),xi=e.discriminatedUnion(`category`,[yi,bi]),Si=pi.safeExtend({days:e.array(gi.days.element.extend({entries:e.array(xi)})).length(28),unassignedEntries:e.array(xi)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Ci={reactionCounts:or,reactionTotal:e.number().int().nonnegative()},wi=(e,t)=>Xn(e,t,B),Ti=e.discriminatedUnion(`category`,[yi.safeExtend(Ci).superRefine(wi),bi.safeExtend(Ci).superRefine(wi)]),Ei=Si.safeExtend({days:e.array(gi.days.element.extend({entries:e.array(Ti)})).length(28),unassignedEntries:e.array(Ti)}),Di=U.extend({progress:Ei});async function Oi(e){return Zn(e,Di,H)}function ki(e){return Qn(e,Di,H)}const Ai=e.discriminatedUnion(`category`,[oi,N.extend({category:e.enum([`direct_reset`,`reset_card`])})]),ji=Mr.extend({entry:Ai}),Mi=Nr.extend({contractVersion:e.literal(3),changes:e.array(ji)});function Ni(e){return ji.parse(e)}function Pi(e){return Mi.parse(e)}const Fi=`https://radarultra.com`,Ii=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],Li={"zh-Hans":`/zh`,"zh-Hant":`/zh-hant`,en:``,ja:`/ja`,ko:`/ko`},Ri={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`},K=e.discriminatedUnion(`product`,[e.strictObject({product:e.literal(`cli`),version:e.string().regex(/^\d+\.\d+\.\d+$/)}),e.strictObject({product:e.literal(`app`),version:e.string().regex(/^\d{2}\.\d{3,4}$/)})]),q=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function J(e,t){return Fi+Li[t]+Ri[e]}function zi(e,t,n){let r=K.parse({product:e,version:t});return`${J(`changelog`,n)}/${r.product}/${r.version}`}function Bi(e,t){return`${J(`models`,t)}/${q.parse(e)}`}const Vi=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),Hi=Date.parse(`${Vi.startDate}T00:00:00Z`),Ui=(Date.parse(`${Vi.endDate}T00:00:00Z`)-Hi)/864e5+1,Wi=new Intl.DateTimeFormat(`en-CA`,{timeZone:Vi.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function Gi(e){let t=Wi.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-Hi)/864e5,i=r<0?`before`:r>=Ui?`ended`:`live`,a=Math.min(Ui,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const Ki=e.enum([`reset`,`improvement`]),qi=e.array(Ki).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),Ji=t=>e.url().refine(e=>Ii.some(n=>e===J(t,n)),`notification_target_url_invalid`),Yi=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:Ji(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:Ji(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),Xi=e.object({topics:qi,target:Yi}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),Zi=e.enum([`reset`,`improvement`,`clue`]),Qi=e.object({topics:e.array(Zi).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:Yi}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function $i(e,t){let n=ea(e===`clue`?`reset`:e,t);return Qi.parse({...n,topics:[e]})}function ea(e,t){return Xi.parse({topics:[e],target:{kind:e,webUrl:J(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const ta=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...Xi.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),C(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function na(e,t){return C(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const ra=`/api/v1/notification-tasks`,ia=100,aa=e.string().min(1).max(8192),oa=e.object({cursor:aa.optional()}).strict(),sa=e.object({contractVersion:e.literal(1),roundCursor:aa,notifications:e.array(ta).max(100),nextCursor:aa.nullable()}).strict().superRefine((e,t)=>{new Set(e.notifications.map(e=>e.notificationId)).size!==e.notifications.length&&t.addIssue({code:`custom`,message:`notification_task_duplicate`});for(let n=1;n<e.notifications.length;n++)na(e.notifications.at(n-1),e.notifications.at(n))>=0&&t.addIssue({code:`custom`,message:`notification_task_order_invalid`});e.nextCursor!==null&&e.notifications.length===0&&t.addIssue({code:`custom`,message:`notification_task_empty_continuation`})}),ca=`/api/browser-notifications`,la=e.string().min(1).max(128),ua=e.uuid(),da=e.enum(Ii),fa=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),pa=`[cdef][\\w-]{21}`,ma=e.strictObject({fid:e.string().regex(RegExp(`^${pa}$`))});function ha(e){return e.replace(RegExp(`(^|[^\\w-])${pa}(?![\\w-])`,`g`),`$1[registration]`)}const Y={operationId:ua,expectedRevision:la},ga=e.discriminatedUnion(`action`,[e.strictObject({...Y,action:e.literal(`register`),topics:fa.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:da,registration:ma}),e.strictObject({...Y,action:e.literal(`set_topics`),topics:fa}),e.strictObject({...Y,action:e.literal(`set_locale`),locale:da}),e.strictObject({...Y,action:e.literal(`restore`),registration:ma}),e.strictObject({...Y,action:e.literal(`retry`)}),e.strictObject({...Y,action:e.literal(`cancel`)})]),_a=e.strictObject({operationId:ua.optional(),expectedRevision:la.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),va=e.strictObject({code:e.enum([`invalid_request`,`identity_unavailable`,`origin_not_allowed`,`rate_limited`,`revision_conflict`,`operation_conflict`,`registration_conflict`,`dependency_unavailable`,`provider_rejected`,`provider_rate_limited`,`provider_unavailable`,`provider_timeout`,`internal_error`]),operationId:ua.optional(),correlationId:e.uuid(),stage:e.string().min(1).max(128),saveOutcome:e.enum([`not_saved`,`unknown`]),reasonSummary:e.string().min(1).max(2048),retryable:e.boolean(),cause:e.record(e.string(),e.unknown())}),ya=e.strictObject({id:ua,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:va.optional()}),ba=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:la,topics:fa,locale:da.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:ya.nullable()});function xa(e,t){return{topics:t.action===`register`||t.action===`set_topics`?t.topics:e.topics,locale:t.action===`register`||t.action===`set_locale`?t.locale:e.locale}}const Sa=e.strictObject({data:ba}),Ca=e.strictObject({error:va});function wa(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Ta=fa.extend({clue:e.boolean().default(!1)}),[Ea,Da,...Oa]=ga.options,ka=e.discriminatedUnion(`action`,[Ea.extend({topics:Ta.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),Da.extend({topics:Ta}),...Oa]),Aa=ba.extend({topicSettings:ba.shape.topicSettings.extend({topics:Ta})}),ja=e.strictObject({data:Aa});function Ma(e){return Aa.parse(wa(e))}function Na(e){let{clue:t,...n}=e.topicSettings.topics;return ba.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function Pa(e,t){return e.action!==`register`&&e.action!==`set_topics`?e:{...e,topics:{...e.topics,clue:e.action!==`register`&&(e.topics.reset||e.topics.improvement)&&t.clue}}}const Fa=20,Ia=2*1024*1024,La=`/api/v1/improvements`,Ra=e.string().min(1).max(1024),[za]=Si.shape.unassignedEntries.element.options,Ba=za.safeExtend({date:e.iso.date().refine(e=>e>Vi.endDate,`improvement_must_follow_campaign`)}),Va=e.strictObject({}),Ha=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),Ua=e.strictObject({cursor:Ra.nullable(),limit:e.literal(20)}),Wa=Ha.extend({entries:e.array(Ba).max(20),nextCursor:Ra.nullable()}).superRefine((e,t)=>{new Set(e.entries.map(e=>e.eventId)).size!==e.entries.length&&t.addIssue({code:`custom`,path:[`entries`],message:`Duplicate improvement identity`})}),Ga=e.strictObject({eventIds:e.array(V).min(1).max(128)}),Ka=e.strictObject({eventIds:e.array(V).max(128)}),qa=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`dependency_unavailable`,`internal_error`]),message:e.string(),requestId:e.uuid(),operation:e.string(),stage:e.string(),cause:e.record(e.string(),e.unknown())})}),Ja=`/tibo-source/v1/latest.json`,Ya=512*1024,Xa=e.iso.datetime({offset:!0}),Za=b.shape.noticeTimeline.element,Qa=e.strictObject({contractVersion:e.literal(1),observedAt:Xa,check:e.strictObject({checkedAt:Xa,freshUntil:Xa,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:Xa,sourceUrl:Za.shape.sourceUrl,sourceText:e.string(),sourceTranslations:Hr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function $a(e){let t=e.body?.getReader();if(t===void 0)throw Error(`tibo_source_status_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>524288)throw Error(`tibo_source_status_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`tibo_source_status_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return Qa.parse(JSON.parse(o))}const eo=`/reset-clue/v1/latest.json`,to=4320*60*1e3,no=r.exportUtf8Bytes,ro=W.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Re.nullable(),expiresAt:W.shape.noticeTimeline.element.shape.authoredAt}).strict().superRefine((e,t)=>{Date.parse(e.expiresAt)!==Date.parse(e.authoredAt)+2592e5&&t.addIssue({code:`custom`,message:`reset_clue_expiry_mismatch`,path:[`expiresAt`]})}),io=e.strictObject({contractVersion:e.literal(1),clue:ro.nullable()}),ao=e=>io.parse(e);function oo(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function so(e){let t=e.body?.getReader();if(t===void 0)throw Error(`reset_clue_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>no)throw Error(`reset_clue_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`reset_clue_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return ao(JSON.parse(o))}const X=e.enum(Ii),co=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),Z=e.string().trim().min(1),lo=e.url({protocol:/^https$/}),Q=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),uo=e.strictObject({operation:Z,stage:Z,cause:Gt});function fo(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),value:t}),e.strictObject({state:e.literal(`pending`)}),e.strictObject({state:e.literal(`failed`),failure:uo})])}function po(e,t){return e.superRefine((e,n)=>{new TextEncoder().encode(JSON.stringify(e)).byteLength>t&&n.addIssue({code:`custom`,message:`publication_utf8_size_limit_exceeded`})})}async function mo(e,t,n,r){let i=e.body?.getReader();if(i===void 0)throw Error(`${t}_body_missing`,{cause:{operation:t,stage:`read`,status:e.status}});let a=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if(o+=e.value.byteLength,o>n)throw Error(`publication_utf8_size_limit_exceeded`);a.push(e.value)}}catch(n){throw Error(`${t}_read_failed`,{cause:{operation:t,stage:`read`,status:e.status,bytes:o,cause:n}})}finally{try{await i.cancel()}catch{}i.releaseLock()}let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.byteLength;let l;try{l=new TextDecoder(`utf-8`,{fatal:!0}).decode(s)}catch(n){throw Error(`${t}_decode_failed`,{cause:{operation:t,stage:`decode`,status:e.status,cause:n}})}if(!e.ok)throw Error(`${t}_http_error`,{cause:{operation:t,stage:`http`,status:e.status,upstream:l.slice(0,4e3)}});try{return r.parse(JSON.parse(l))}catch(n){throw Error(`${t}_parse_failed`,{cause:{operation:t,stage:`parse`,status:e.status,cause:n}})}}const ho=`/codex-releases/v2/directory.json`,go=128*1024,_o=128*1024,vo=256*1024,yo=Q,bo={product:e.enum([`app`,`cli`]),version:Z,published:Q,month:co,revision:Z},xo=e.strictObject(bo).superRefine(So);function So(e,t){let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});e.product===`cli`!=(e.published.kind===`instant`)&&t.addIssue({code:`custom`,path:[`published`],message:`product_date_precision_mismatch`}),(e.published.kind===`instant`?e.published.at:e.published.date).slice(0,7)!==e.month&&t.addIssue({code:`custom`,path:[`month`],message:`published_month_mismatch`})}function Co(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries()){let e=`${a.product}/${a.version}`;n.has(e)&&t.addIssue({code:`custom`,path:[`releases`,i],message:`duplicate_release_identity`}),n.add(e);let o=Date.parse(a.published.kind===`instant`?a.published.at:`${a.published.date}T00:00:00Z`);o>r&&t.addIssue({code:`custom`,path:[`releases`,i],message:`release_order_mismatch`}),r=o}}const wo=po(e.strictObject({contractVersion:e.literal(2),releases:e.array(xo),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{Co(e.releases,t);for(let n of[`app`,`cli`]){let r=e.releases.find(e=>e.product===n)?.version??null;e.latest[n]!==r&&t.addIssue({code:`custom`,path:[`latest`,n],message:`latest_release_mismatch`})}}),go),To=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),Eo=e.union([fo(e.strictObject({locale:X,points:e.array(Z).min(1).max(5)})),To]),Do=e.strictObject({...bo,source:e.strictObject({kind:e.enum([`github`,`official`]),url:lo}),summary:Eo,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{So(e,t),e.product===`cli`!=(e.source.kind===`github`)&&t.addIssue({code:`custom`,path:[`source`,`kind`],message:`product_source_mismatch`}),e.notesCount===0!=(e.summary.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`summary`],message:`curated_notes_summary_state_mismatch`})}),Oo=po(e.strictObject({contractVersion:e.literal(2),locale:X,month:co,releases:e.array(Do)}).superRefine((e,t)=>{Co(e.releases,t);for(let[n,r]of e.releases.entries())r.month!==e.month&&t.addIssue({code:`custom`,path:[`releases`,n,`month`],message:`file_month_mismatch`}),r.summary.state===`ready`&&r.summary.value.locale!==e.locale&&r.summary.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`releases`,n,`summary`,`value`,`locale`],message:`summary_locale_mismatch`})}),_o),ko=e.array(e.strictObject({title:Z.nullable(),items:e.array(e.strictObject({text:Z,refs:Z.nullable()})).min(1)})).min(1),Ao=po(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:Z,revision:Z,locale:X,original:e.array(ko.element),translation:e.union([fo(ko),To]).nullable()}).superRefine((e,t)=>{let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});if(e.locale===`en`!=(e.translation===null)&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_locale_mismatch`}),e.locale!==`en`&&e.original.length===0!=(e.translation?.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`translation`],message:`curated_notes_translation_state_mismatch`}),e.translation?.state===`ready`){let n=e.translation.value;(n.length!==e.original.length||e.original.some((e,t)=>{let r=n.at(t);return r===void 0||e.title===null!=(r.title===null)||e.items.length!==r.items.length||e.items.some((e,t)=>e.refs!==r.items.at(t)?.refs)}))&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_structure_mismatch`})}}),vo),jo=e=>wo.parse(e),Mo=e=>Oo.parse(e),No=e=>Ao.parse(e),Po=e=>mo(e,`codex_release_directory`,go,wo),Fo=e=>mo(e,`codex_release_month`,_o,Oo),Io=e=>mo(e,`codex_release_notes`,vo,Ao);function Lo(e,t){return`/codex-releases/v2/${X.parse(e)}/${co.parse(t)}.json`}function Ro(e,t,n){let r=K.parse({product:t,version:n});return`/codex-releases/v2/${X.parse(e)}/notes/${r.product}/${r.version}.json`}const zo=128*1024;function $(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:lo}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:lo.nullable()})])}const Bo=e.strictObject({input:Z,cached:Z,output:Z}),Vo=e.strictObject({modelId:q,name:Z,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:$(Q),chatgptRetirement:$(Q),apiRetirement:$(Q),credits:$(Bo),apiPrice:$(Bo),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:$(e.array(Z).min(1)),surfaces:$(e.array(Z).min(1)),about:fo(e.strictObject({locale:X,paragraphs:e.array(Z).min(1)})),sources:e.array(e.strictObject({label:Z,url:lo})).min(1)}).superRefine((e,t)=>{e.status===`retired`!=(e.group===`retired`)&&t.addIssue({code:`custom`,path:[`group`],message:`model_group_status_mismatch`}),e.status===`retiring`&&e.chatgptRetirement.state!==`known`&&t.addIssue({code:`custom`,path:[`chatgptRetirement`],message:`retiring_model_requires_announced_date`})}),Ho=po(e.strictObject({contractVersion:e.literal(1),locale:X,models:e.array(Vo),multipleBase:e.strictObject({modelId:q,name:Z}).nullable(),upcomingRetirement:e.strictObject({names:Z,modelIds:e.array(q).min(1),surface:e.enum([`api`,`chatgpt`]),at:Q}).nullable()}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.models.entries())n.has(i.modelId)&&t.addIssue({code:`custom`,path:[`models`,r,`modelId`],message:`duplicate_model_identity`}),n.add(i.modelId),i.about.state===`ready`&&i.about.value.locale!==e.locale&&i.about.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`models`,r,`about`,`value`,`locale`],message:`model_description_locale_mismatch`}),i.multiple!==null&&(e.multipleBase===null||i.credits.state!==`known`)&&t.addIssue({code:`custom`,path:[`models`,r,`multiple`],message:`multiple_requires_base_and_credits`});if(e.multipleBase!==null){let n=e.models.find(t=>t.modelId===e.multipleBase?.modelId);(n===void 0||n.group!==`current`||n.credits.state!==`known`||n.multiple!==`1`||n.name!==e.multipleBase.name)&&t.addIssue({code:`custom`,path:[`multipleBase`],message:`multiple_base_mismatch`})}let r=e.upcomingRetirement;if(r!==null){new Set(r.modelIds).size!==r.modelIds.length&&t.addIssue({code:`custom`,path:[`upcomingRetirement`,`modelIds`],message:`duplicate_retirement_model`});for(let n of r.modelIds){let i=e.models.find(e=>e.modelId===n),a=r.surface===`api`?i?.apiRetirement:i?.chatgptRetirement;(a?.state!==`known`||JSON.stringify(a.value)!==JSON.stringify(r.at))&&t.addIssue({code:`custom`,path:[`upcomingRetirement`],message:`retirement_model_date_mismatch`})}}}),zo),Uo=e=>Ho.parse(e),Wo=e=>mo(e,`codex_models`,zo,Ho),Go=e=>`/codex-models/v1/${X.parse(e)}.json`;export{an as RadarResetSourceContractErrorV2,oo as activeRadarResetClue,na as compareRadarNotificationTasks,He as compareRadarResetActionDetailsV1,C as compareRadarResetUtcTimestampsV1,$i as createRadarBrowserNotificationProjection,Gi as createRadarCodexProgressCalendar,ea as createRadarNotificationProjection,wn as createRadarResetSourceErrorEnvelopeV2,Dr as encodeRadarActivityFile,kr as encodeRadarActivityFileV2,ki as encodeRadarActivityFileV3,pn as encodeRadarResetDetailMultipartV2,Or as encodeRadarTitledActivityFile,ct as formatRadarResetPositiveDecimalV2,st as formatRadarResetUInt64DecimalV2,wa as initialRadarBrowserSubscription,Ma as initialRadarBrowserSubscriptionV2,Uo as parseRadarCodexModels,Ni as parseRadarCodexProgressChangeV3,Pi as parseRadarCodexProgressChangesV3,On as parseRadarCodexProgressV1,Fn as parseRadarCodexProgressV2,Un as parseRadarCodexProgressV3,Jn as parseRadarCodexProgressV4,mi as parseRadarCodexProgressV5,jo as parseRadarCodexReleaseDirectory,Mo as parseRadarCodexReleaseMonth,No as parseRadarCodexReleaseNotes,We as parseRadarResetActionDetailV1,Qr as parseRadarResetActionDetailV2,bt as parseRadarResetActionSummaryV2,Ue as parseRadarResetAnalysisV1,ao as parseRadarResetClueSnapshot,_n as parseRadarResetDetailMultipartV2,Ge as parseRadarResetExportV1,ei as parseRadarResetExportV2,Ke as parseRadarResetPendingActionV1,$r as parseRadarResetPendingActionV2,at as parseRadarResetPositiveDecimalV2,St as parseRadarResetPublicationHomeFactsV2,rn as parseRadarResetPublicationRevisionAvailableV2,Xt as parseRadarResetReadActionsRequestV2,en as parseRadarResetReadActionsSuccessV2,Zt as parseRadarResetReadChangesRequestV2,tn as parseRadarResetReadChangesSuccessV2,Qt as parseRadarResetReadDetailBatchRequestV2,Yt as parseRadarResetReadHeadRequestV2,$t as parseRadarResetReadHeadSuccessV2,oe as parseRadarResetSnapshotAvailableV1,nn as parseRadarResetSourceErrorEnvelopeV2,it as parseRadarResetUInt64DecimalV2,xa as projectRadarBrowserSubscriptionSelection,Na as projectRadarBrowserSubscriptionV1,ti as projectRadarResetExportV1FromV2,qe as projectRadarResetPrimarySourceV1,V as radarActivityEventIdSchema,U as radarActivityFileSchema,er as radarActivityFileUrl,Cr as radarActivityFileV2Schema,tr as radarActivityFileV2Url,Di as radarActivityFileV3Schema,hi as radarActivityFileV3Url,H as radarActivityMaxBytes,ar as radarActivityProgressSchema,br as radarActivityProgressV2Schema,Si as radarActivityProgressV3Schema,or as radarActivityReactionCountsSchema,$n as radarActivityReactionIdSchema,B as radarActivityReactionIds,Qi as radarBrowserNotificationProjectionSchema,Zi as radarBrowserNotificationTopicSchema,ma as radarBrowserRegistrationSchema,Ca as radarBrowserSubscriptionErrorRes,va as radarBrowserSubscriptionFailureSchema,ya as radarBrowserSubscriptionOperationSchema,_a as radarBrowserSubscriptionReadReq,Sa as radarBrowserSubscriptionRes,ga as radarBrowserSubscriptionSaveReq,ka as radarBrowserSubscriptionSaveV2Req,ja as radarBrowserSubscriptionV2Res,ba as radarBrowserSubscriptionViewSchema,Aa as radarBrowserSubscriptionViewV2Schema,ca as radarBrowserSubscriptionsPath,fa as radarBrowserTopicsSchema,Ta as radarBrowserTopicsV2Schema,Ir as radarCodexGuessChoiceSchema,Vr as radarCodexGuessErrorSchema,Lr as radarCodexGuessSaveReqSchema,Br as radarCodexGuessViewSchema,q as radarCodexModelIdSchema,Bi as radarCodexModelUrl,zo as radarCodexModelsMaxBytes,Go as radarCodexModelsPath,Ho as radarCodexModelsSchema,Vi as radarCodexProgressCalendar,Ar as radarCodexProgressChangeSchema,Mr as radarCodexProgressChangeV2Schema,ji as radarCodexProgressChangeV3Schema,jr as radarCodexProgressChangesV1Schema,Nr as radarCodexProgressChangesV2Schema,Mi as radarCodexProgressChangesV3Schema,N as radarCodexProgressEntrySchema,Ln as radarCodexProgressEntryV3Schema,ci as radarCodexProgressEntryV5Schema,oi as radarCodexProgressImprovementV5Schema,ni as radarCodexProgressPostRoleV5Schema,ri as radarCodexProgressPostV5Schema,ii as radarCodexProgressPostsV5Schema,si as radarCodexProgressResetEntryV5Schema,Hn as radarCodexProgressScore,L as radarCodexProgressTitleV3Schema,P as radarCodexProgressV1Schema,An as radarCodexProgressV2MaxBytes,I as radarCodexProgressV2Schema,In as radarCodexProgressV3MaxBytes,R as radarCodexProgressV3Schema,Wn as radarCodexProgressV4MaxBytes,z as radarCodexProgressV4Schema,ai as radarCodexProgressV5MaxBytes,pi as radarCodexProgressV5Schema,go as radarCodexReleaseDirectoryMaxBytes,ho as radarCodexReleaseDirectoryPath,wo as radarCodexReleaseDirectorySchema,K as radarCodexReleaseIdentitySchema,_o as radarCodexReleaseMonthMaxBytes,Lo as radarCodexReleaseMonthPath,Oo as radarCodexReleaseMonthSchema,vo as radarCodexReleaseNotesMaxBytes,Ro as radarCodexReleaseNotesPath,Ao as radarCodexReleaseNotesSchema,ko as radarCodexReleaseSectionsSchema,zi as radarCodexReleaseUrl,yo as radarCodexTimePointSchema,La as radarImprovementColumnPath,Ga as radarImprovementEligibilityReq,Ka as radarImprovementEligibilityRes,Ba as radarImprovementEntrySchema,qa as radarImprovementErrorRes,Va as radarImprovementHeadReq,Ha as radarImprovementHeadRes,Ia as radarImprovementPageMaxBytes,Ua as radarImprovementPageReq,Wa as radarImprovementPageRes,Fa as radarImprovementPageSize,Xi as radarNotificationProjectionSchema,Yi as radarNotificationTargetSchema,ia as radarNotificationTaskPageSize,ta as radarNotificationTaskSchema,ra as radarNotificationTasksPath,oa as radarNotificationTasksReq,sa as radarNotificationTasksRes,Ki as radarNotificationTopicSchema,qi as radarNotificationTopicsSchema,b as radarResetActionDetailV1Schema,W as radarResetActionDetailV2Schema,Dt as radarResetActionItemV2Schema,Ze as radarResetActionPageMaxBytesV2,Xe as radarResetActionPageMaxItemsV2,yt as radarResetActionSummaryV2Schema,Tt as radarResetActiveActionItemV2Schema,Pe as radarResetAnalysisV1Schema,n as radarResetAnalyzerContractVersionV1,s as radarResetAudienceValues,Ft as radarResetChangeCoverageV2Schema,$e as radarResetChangePageMaxBytesV2,Qe as radarResetChangePageMaxItemsV2,to as radarResetClueLifetimeMs,no as radarResetClueMaxBytes,eo as radarResetCluePath,ro as radarResetClueSchema,io as radarResetClueSnapshotSchema,t as radarResetContractVersionV1,Je as radarResetContractVersionV2,tt as radarResetDetailBatchMaxBytesV2,et as radarResetDetailBatchMaxChunksV2,Ct as radarResetDetailChunkReferenceV2Schema,jt as radarResetDetailChunkRequestV2Schema,wt as radarResetDetailManifestV2Schema,a as radarResetEffectValues,S as radarResetExportV1Schema,Zr as radarResetExportV2Schema,Le as radarResetNoticeKindValues,x as radarResetPendingActionV1Schema,Xr as radarResetPendingActionV2Schema,c as radarResetPlanValues,w as radarResetPositiveDecimalV2Schema,o as radarResetProductValues,r as radarResetPublicDataLimits,E as radarResetPublicIdV2Schema,xt as radarResetPublicationHomeFactsV2Schema,Jt as radarResetPublicationRevisionAvailableV2Schema,Re as radarResetPublicationTimingSchema,Lt as radarResetReadActionsDataV2Schema,kt as radarResetReadActionsRequestV2Schema,Vt as radarResetReadActionsSuccessV2Schema,Rt as radarResetReadChangesDataV2Schema,At as radarResetReadChangesRequestV2Schema,Ht as radarResetReadChangesSuccessV2Schema,Mt as radarResetReadDetailBatchRequestV2Schema,It as radarResetReadHeadDataV2Schema,Ot as radarResetReadHeadRequestV2Schema,Bt as radarResetReadHeadSuccessV2Schema,ee as radarResetReasonBasisValues,l as radarResetReasonCategoryValues,Gt as radarResetSafeCauseSnapshotV2Schema,i as radarResetSeriesValues,D as radarResetSha256V2Schema,ae as radarResetSnapshotAvailableV1Schema,Pt as radarResetSourceChangeV2Schema,Ut as radarResetSourceErrorCodeValuesV2,qt as radarResetSourceErrorEnvelopeV2Schema,Cn as radarResetSourceErrorHttpStatusV2,Sn as radarResetSourceErrorIsRetryableV2,Kt as radarResetSourceErrorV2Schema,Ye as radarResetSourceMaxRpcCallsV2,Hr as radarResetSourceTranslationsSchema,rt as radarResetUInt64DecimalV2Schema,ot as radarResetUInt64DecimalV2ToBigInt,T as radarResetUtcTimestampV2Schema,Et as radarResetWithdrawnActionItemV2Schema,Ya as radarTiboSourceStatusMaxBytes,Ja as radarTiboSourceStatusPath,Qa as radarTiboSourceStatusSchema,_r as radarTitledActivityFileSchema,mr as radarTitledActivityProgressSchema,Li as radarWebsiteLocalePrefixes,Ii as radarWebsiteLocales,Fi as radarWebsiteOrigin,Ri as radarWebsitePagePaths,J as radarWebsitePageUrl,wr as readRadarActivityFile,Er as readRadarActivityFileV2,Oi as readRadarActivityFileV3,Wo as readRadarCodexModels,Po as readRadarCodexReleaseDirectory,Fo as readRadarCodexReleaseMonth,Io as readRadarCodexReleaseNotes,so as readRadarResetClueSnapshot,$a as readRadarTiboSourceStatus,Tr as readRadarTitledActivityFile,ha as redactRadarBrowserRegistrationReferences,xn as toSafeCauseSnapshotV2,Pa as upgradeRadarBrowserSubscriptionCommandV1};
|