@pome-sh/checks 0.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +88 -0
  3. package/dist/_types/sdk/check-discrimination.d.ts +7 -0
  4. package/dist/_types/sdk/check-state-path.d.ts +71 -0
  5. package/dist/_types/sdk/checks.d.ts +93 -0
  6. package/dist/_types/sdk/db.d.ts +44 -0
  7. package/dist/_types/sdk/failure-injection-rules.d.ts +32 -0
  8. package/dist/_types/twin-github/src/check-kind.d.ts +3 -0
  9. package/dist/_types/twin-github/src/check-state.d.ts +77 -0
  10. package/dist/_types/twin-github/src/checks.d.ts +50 -0
  11. package/dist/_types/twin-github/src/seed.d.ts +92 -0
  12. package/dist/_types/twin-github/src/types.d.ts +244 -0
  13. package/dist/_types/twin-gmail/src/check-kind.d.ts +3 -0
  14. package/dist/_types/twin-gmail/src/check-state.d.ts +138 -0
  15. package/dist/_types/twin-gmail/src/checks.d.ts +19 -0
  16. package/dist/_types/twin-gmail/src/faults.d.ts +21 -0
  17. package/dist/_types/twin-gmail/src/seed.d.ts +247 -0
  18. package/dist/_types/twin-gmail/src/types.d.ts +150 -0
  19. package/dist/_types/twin-linear/src/check-kind.d.ts +3 -0
  20. package/dist/_types/twin-linear/src/check-state.d.ts +123 -0
  21. package/dist/_types/twin-linear/src/checks.d.ts +29 -0
  22. package/dist/_types/twin-linear/src/seed.d.ts +166 -0
  23. package/dist/_types/twin-linear/src/types.d.ts +366 -0
  24. package/dist/_types/twin-slack/src/check-kind.d.ts +3 -0
  25. package/dist/_types/twin-slack/src/check-state.d.ts +107 -0
  26. package/dist/_types/twin-slack/src/checks.d.ts +14 -0
  27. package/dist/_types/twin-slack/src/seed.d.ts +62 -0
  28. package/dist/_types/twin-slack/src/types.d.ts +182 -0
  29. package/dist/_types/twin-stripe/src/check-kind.d.ts +3 -0
  30. package/dist/_types/twin-stripe/src/check-state.d.ts +107 -0
  31. package/dist/_types/twin-stripe/src/checks.d.ts +22 -0
  32. package/dist/_types/twin-stripe/src/seed.d.ts +213 -0
  33. package/dist/_types/twin-stripe/src/types.d.ts +252 -0
  34. package/dist/_types/wire/index.d.ts +23 -0
  35. package/dist/_types/wire/otel/event-schema.d.ts +424 -0
  36. package/dist/_types/wire/otel/index.d.ts +25 -0
  37. package/dist/_types/wire/otel/legacy-shim.d.ts +105 -0
  38. package/dist/_types/wire/otel/map-span.d.ts +64 -0
  39. package/dist/_types/wire/otel/nano.d.ts +26 -0
  40. package/dist/_types/wire/otel/project.d.ts +42 -0
  41. package/dist/_types/wire/otel/semconv.d.ts +57 -0
  42. package/dist/_types/wire/otel/span-event.d.ts +198 -0
  43. package/dist/_types/wire/recorder-events.d.ts +526 -0
  44. package/dist/_types/wire/redaction.d.ts +2 -0
  45. package/dist/chunk-4WXX5VPA.js +238 -0
  46. package/dist/chunk-5SJ4PVO5.js +981 -0
  47. package/dist/chunk-GYFGMULG.js +1138 -0
  48. package/dist/chunk-IVENH4KX.js +814 -0
  49. package/dist/chunk-NORTPYDQ.js +1015 -0
  50. package/dist/chunk-SJ6SVRAA.js +432 -0
  51. package/dist/chunk-ZXE6LAM3.js +1 -0
  52. package/dist/dsl.d.ts +11 -0
  53. package/dist/dsl.js +2 -0
  54. package/dist/github.d.ts +2 -0
  55. package/dist/github.js +2 -0
  56. package/dist/gmail.d.ts +2 -0
  57. package/dist/gmail.js +2 -0
  58. package/dist/index.d.ts +163 -0
  59. package/dist/index.js +24 -0
  60. package/dist/linear.d.ts +2 -0
  61. package/dist/linear.js +2 -0
  62. package/dist/slack.d.ts +2 -0
  63. package/dist/slack.js +2 -0
  64. package/dist/stripe.d.ts +2 -0
  65. package/dist/stripe.js +2 -0
  66. package/package.json +93 -0
@@ -0,0 +1,244 @@
1
+ import type { TwinDatabase } from "../../sdk/db.js";
2
+ export type { RecorderEvent } from "../../wire/index.js";
3
+ export type GitHubCloneDatabase = TwinDatabase;
4
+ export type GitHubStateSeed = {
5
+ users?: SeedUser[];
6
+ repositories: SeedRepository[];
7
+ };
8
+ export type SeedUser = {
9
+ login: string;
10
+ type?: "User" | "Organization";
11
+ name?: string;
12
+ };
13
+ export type SeedRepository = {
14
+ owner: string;
15
+ name: string;
16
+ description?: string;
17
+ private?: boolean;
18
+ default_branch?: string;
19
+ collaborators?: string[];
20
+ labels?: Array<{
21
+ name: string;
22
+ color?: string;
23
+ description?: string;
24
+ }>;
25
+ files?: Array<{
26
+ path: string;
27
+ content: string;
28
+ branch?: string;
29
+ }>;
30
+ issues?: Array<{
31
+ number?: number;
32
+ title: string;
33
+ body?: string;
34
+ state?: "open" | "closed";
35
+ labels?: string[];
36
+ assignees?: string[];
37
+ }>;
38
+ pull_requests?: Array<{
39
+ number?: number;
40
+ title: string;
41
+ body?: string;
42
+ head: string;
43
+ base?: string;
44
+ state?: "open" | "closed";
45
+ author?: string;
46
+ reviews?: Array<{
47
+ author: string;
48
+ state?: "APPROVED" | "CHANGES_REQUESTED" | "COMMENTED";
49
+ body?: string;
50
+ }>;
51
+ statuses?: Array<{
52
+ context?: string;
53
+ state?: "error" | "failure" | "pending" | "success";
54
+ description?: string;
55
+ }>;
56
+ }>;
57
+ };
58
+ export type RepoRow = {
59
+ id: number;
60
+ owner: string;
61
+ name: string;
62
+ full_name: string;
63
+ description: string;
64
+ private: 0 | 1;
65
+ default_branch: string;
66
+ fork: 0 | 1;
67
+ parent_full_name: string | null;
68
+ entity_counter: number;
69
+ created_at: string;
70
+ updated_at: string;
71
+ };
72
+ export type BranchRow = {
73
+ id: number;
74
+ repo_id: number;
75
+ name: string;
76
+ head_sha: string | null;
77
+ created_at: string;
78
+ updated_at: string;
79
+ };
80
+ export type CommitRow = {
81
+ sha: string;
82
+ repo_id: number;
83
+ message: string;
84
+ author_login: string;
85
+ committer_login: string;
86
+ parent_sha: string | null;
87
+ tree_sha: string;
88
+ created_at: string;
89
+ };
90
+ export type FileRow = {
91
+ repo_id: number;
92
+ branch: string;
93
+ path: string;
94
+ content: string;
95
+ sha: string;
96
+ size: number;
97
+ updated_at: string;
98
+ };
99
+ export type LabelRow = {
100
+ repo_id: number;
101
+ name: string;
102
+ color: string;
103
+ description: string;
104
+ };
105
+ export type IssueRow = {
106
+ repo_id: number;
107
+ number: number;
108
+ title: string;
109
+ body: string;
110
+ state: "open" | "closed";
111
+ user_login: string;
112
+ assignee_login: string | null;
113
+ created_at: string;
114
+ updated_at: string;
115
+ closed_at: string | null;
116
+ };
117
+ export type IssueCommentRow = {
118
+ id: number;
119
+ repo_id: number;
120
+ issue_number: number;
121
+ body: string;
122
+ user_login: string;
123
+ created_at: string;
124
+ updated_at: string;
125
+ };
126
+ export type PullRequestRow = {
127
+ repo_id: number;
128
+ number: number;
129
+ title: string;
130
+ body: string;
131
+ state: "open" | "closed";
132
+ user_login: string;
133
+ head_repo_id: number;
134
+ head_ref: string;
135
+ head_sha: string | null;
136
+ base_repo_id: number;
137
+ base_ref: string;
138
+ base_sha: string | null;
139
+ merged: 0 | 1;
140
+ merge_commit_sha: string | null;
141
+ created_at: string;
142
+ updated_at: string;
143
+ closed_at: string | null;
144
+ merged_at: string | null;
145
+ };
146
+ export type PullRequestReviewRow = {
147
+ id: number;
148
+ repo_id: number;
149
+ pull_number: number;
150
+ user_login: string;
151
+ state: "APPROVED" | "CHANGES_REQUESTED" | "COMMENTED";
152
+ body: string;
153
+ commit_sha: string | null;
154
+ submitted_at: string;
155
+ };
156
+ export type PullRequestFileRow = {
157
+ repo_id: number;
158
+ pull_number: number;
159
+ filename: string;
160
+ status: "added" | "modified" | "removed" | "renamed";
161
+ additions: number;
162
+ deletions: number;
163
+ changes: number;
164
+ blob_url: string;
165
+ raw_url: string;
166
+ contents_url: string;
167
+ patch: string;
168
+ };
169
+ export type CommitStatusRow = {
170
+ id: number;
171
+ repo_id: number;
172
+ sha: string;
173
+ state: "error" | "failure" | "pending" | "success";
174
+ context: string;
175
+ description: string;
176
+ target_url: string;
177
+ created_at: string;
178
+ updated_at: string;
179
+ };
180
+ export type MilestoneRow = {
181
+ repo_id: number;
182
+ number: number;
183
+ title: string;
184
+ state: "open" | "closed";
185
+ description: string;
186
+ due_on: string | null;
187
+ creator_login: string;
188
+ created_at: string;
189
+ updated_at: string;
190
+ closed_at: string | null;
191
+ };
192
+ export type TagRow = {
193
+ repo_id: number;
194
+ name: string;
195
+ commit_sha: string;
196
+ created_at: string;
197
+ };
198
+ export type ReleaseRow = {
199
+ id: number;
200
+ repo_id: number;
201
+ tag_name: string;
202
+ target_commitish: string;
203
+ name: string | null;
204
+ body: string;
205
+ draft: 0 | 1;
206
+ prerelease: 0 | 1;
207
+ author_login: string;
208
+ created_at: string;
209
+ published_at: string | null;
210
+ };
211
+ export type CheckRunRow = {
212
+ id: number;
213
+ repo_id: number;
214
+ head_sha: string;
215
+ name: string;
216
+ status: "queued" | "in_progress" | "completed";
217
+ conclusion: "success" | "failure" | "neutral" | "cancelled" | "timed_out" | "action_required" | "skipped" | "stale" | null;
218
+ details_url: string;
219
+ external_id: string;
220
+ output_title: string | null;
221
+ output_summary: string | null;
222
+ started_at: string;
223
+ completed_at: string | null;
224
+ };
225
+ export type PullRequestReviewCommentRow = {
226
+ id: number;
227
+ repo_id: number;
228
+ pull_number: number;
229
+ path: string;
230
+ body: string;
231
+ user_login: string;
232
+ created_at: string;
233
+ updated_at: string;
234
+ line: number | null;
235
+ side: "LEFT" | "RIGHT" | null;
236
+ commit_sha: string | null;
237
+ in_reply_to_id: number | null;
238
+ };
239
+ export type CollaboratorRow = {
240
+ repo_id: number;
241
+ login: string;
242
+ permission: string;
243
+ invitation_state: "pending" | "accepted";
244
+ };
@@ -0,0 +1,3 @@
1
+ import type { CheckDefinition } from "../../sdk/checks.js";
2
+ import type { GmailCheckState } from "./check-state.js";
3
+ export type Check<TArgs extends Record<string, string>> = CheckDefinition<GmailCheckState, TArgs>;
@@ -0,0 +1,138 @@
1
+ import { type CheckOutcome } from "../../sdk/checks.js";
2
+ /** A resolver must be able to say WHY it found nothing: the ways of finding
3
+ * nothing get different verdicts. Same shape and same reason as twin-github's.
4
+ *
5
+ * F-1197 added the pointers, also twin-github's: `path` is where the resolution
6
+ * landed, `searched` is the collection a failed lookup scanned. Both optional on
7
+ * the missing arm because gmail's commonest refusal is `state_incomplete` — the
8
+ * collection is absent from the export entirely, so there is nowhere to point
9
+ * and citing anything would be an affordance to nowhere. */
10
+ export type Resolved<T> = {
11
+ found: T;
12
+ path: string;
13
+ } | {
14
+ missing: string;
15
+ searched?: string;
16
+ };
17
+ /** The exported collections a pointer can address. Named because six
18
+ * declarations reach for them and a literal `"/messageLabels"` typed out six
19
+ * times is six chances to typo one into a pointer that resolves to nothing —
20
+ * and the mis-cased `/messagelabels` would look right in a diff. */
21
+ export declare const MESSAGES_PATH: string;
22
+ export declare const DRAFTS_PATH: string;
23
+ export declare const LABELS_PATH: string;
24
+ export declare const MESSAGE_LABELS_PATH: string;
25
+ /** The `skipped` outcome an unresolvable lookup produces, citing where it
26
+ * looked. Gmail abstains where twin-github fails — a message the export does
27
+ * not carry cannot be attested either way — so this is `missOutcome` with
28
+ * `skipped`, exactly as twin-slack's `missSkip` is. */
29
+ export declare function missSkip(miss: {
30
+ missing: string;
31
+ searched?: string;
32
+ }): CheckOutcome;
33
+ export interface GmailCheckStateMailbox {
34
+ email?: string;
35
+ displayName?: string;
36
+ }
37
+ export interface GmailCheckStateMessage {
38
+ mailboxEmail?: string;
39
+ id?: string;
40
+ threadId?: string;
41
+ from?: string;
42
+ to?: string[] | null;
43
+ cc?: string[] | null;
44
+ bcc?: string[] | null;
45
+ subject?: string;
46
+ bodyOmitted?: boolean;
47
+ }
48
+ export interface GmailCheckStateLabel {
49
+ mailboxEmail?: string;
50
+ id?: string;
51
+ name?: string;
52
+ type?: string;
53
+ }
54
+ export interface GmailCheckStateMessageLabel {
55
+ mailboxEmail?: string;
56
+ messageId?: string;
57
+ labelId?: string;
58
+ }
59
+ export interface GmailCheckStateDraft {
60
+ mailboxEmail?: string;
61
+ id?: string;
62
+ messageId?: string;
63
+ }
64
+ export interface GmailCheckStateBounds {
65
+ messageBodiesOmitted?: boolean;
66
+ largeMailbox?: boolean;
67
+ truncatedCollections?: string[] | null;
68
+ }
69
+ export interface GmailCheckState {
70
+ mailboxes?: GmailCheckStateMailbox[] | null;
71
+ messages?: GmailCheckStateMessage[] | null;
72
+ drafts?: GmailCheckStateDraft[] | null;
73
+ labels?: GmailCheckStateLabel[] | null;
74
+ messageLabels?: GmailCheckStateMessageLabel[] | null;
75
+ exportBounds?: GmailCheckStateBounds | null;
76
+ }
77
+ /**
78
+ * Was this collection capped on the way out?
79
+ *
80
+ * An export with no `exportBounds` block at all predates the cap and answers
81
+ * false — the same answer it would have given honestly. Treating absence as
82
+ * "truncated" would skip every criterion on an older snapshot.
83
+ */
84
+ export declare function isTruncated(state: GmailCheckState, collection: string): boolean;
85
+ /**
86
+ * The message a criterion names, with the outcomes a negative criterion must
87
+ * tell apart:
88
+ * - no `messages` key → `state_incomplete`; we cannot attest anything
89
+ * - present, id absent, collection CAPPED → `collection_truncated`; absent from
90
+ * a truncated list is not absent, and answering `not_found` here would
91
+ * false-fail a correct agent on a large mailbox
92
+ * - present, id absent, not capped → `message_not_found`
93
+ * - present in more than one mailbox → `message_ambiguous`
94
+ *
95
+ * The ambiguity arm is gmail's answer to github's `{repo}` slot. GitHub's legacy
96
+ * patterns took the repo as an optional qualifier and, absent it, scanned
97
+ * first-match-wins, so a two-repo world graded whichever sorted first. Gmail's
98
+ * corpus sentences carry no mailbox and ids are minted per mailbox, so rather
99
+ * than inventing a slot that would stop every existing criterion binding, this
100
+ * REFUSES on the world where the ambiguity is real.
101
+ */
102
+ export declare function resolveMessage(state: GmailCheckState, id: string): Resolved<GmailCheckStateMessage>;
103
+ /**
104
+ * Every label id that counts as `wanted`, lower-cased for comparison.
105
+ *
106
+ * Matches a label row by id OR by display name, because the corpus names both
107
+ * kinds: `Label_follow_up` is an id, `Follow Up` is the name of the same label.
108
+ * The bare `wanted` is always included so the join still works when the `labels`
109
+ * collection was capped away — a `messageLabels` row carries the bare id
110
+ * regardless.
111
+ */
112
+ export declare function labelIdsFor(state: GmailCheckState, wanted: string): Set<string>;
113
+ /**
114
+ * Does this message carry the named label?
115
+ *
116
+ * Reads the `messageLabels` join. A capped join is refused rather than answered:
117
+ * a missing row there is indistinguishable from a label that was never applied,
118
+ * and on a negative criterion that difference is a leaking agent's free point.
119
+ */
120
+ export declare function messageCarriesLabel(state: GmailCheckState, messageId: string, wanted: string): Resolved<boolean>;
121
+ /**
122
+ * The label a criterion names BY NAME.
123
+ *
124
+ * Deliberately does not fall back to the id. "A label named `Parity Complete`
125
+ * exists" asks about the display name; letting it also match an id would make
126
+ * the sentence mean two things, and `gmail.message-has-label` is the check that
127
+ * speaks ids.
128
+ */
129
+ export declare function resolveLabelByName(state: GmailCheckState, name: string): Resolved<GmailCheckStateLabel>;
130
+ /**
131
+ * Who a draft is addressed to — `to` + `cc`, from the backing MESSAGE.
132
+ *
133
+ * The exported draft row carries no addressing at all, so a predicate reading it
134
+ * alone would answer "no draft is addressed to anyone", always. A draft whose
135
+ * message did not survive the export contributes nothing rather than throwing;
136
+ * the caller decides whether that emptiness is answerable.
137
+ */
138
+ export declare function draftRecipients(state: GmailCheckState, draft: GmailCheckStateDraft): string[];
@@ -0,0 +1,19 @@
1
+ export type { Check } from "./check-kind.js";
2
+ export type { GmailCheckState, GmailCheckStateDraft, GmailCheckStateLabel, GmailCheckStateMailbox, GmailCheckStateMessage, GmailCheckStateMessageLabel, } from "./check-state.js";
3
+ export declare const GMAIL_CHECKS: readonly [import("./check-kind.js").Check<{
4
+ message: string;
5
+ label: string;
6
+ }>, import("./check-kind.js").Check<{
7
+ label: string;
8
+ }>, import("./check-kind.js").Check<{
9
+ email: string;
10
+ }>, import("./check-kind.js").Check<{
11
+ count: string;
12
+ }>, import("./check-kind.js").Check<{
13
+ mailbox: string;
14
+ count: string;
15
+ label: string;
16
+ }>, import("./check-kind.js").Check<{
17
+ label: string;
18
+ count: string;
19
+ }>, import("./check-kind.js").Check<Record<string, never>>];
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import type { GmailTwinDatabase } from "./types.js";
3
+ export declare const gmailFaultSchema: z.ZodObject<{
4
+ name: z.ZodEnum<{
5
+ "rate-limited": "rate-limited";
6
+ }>;
7
+ target: z.ZodDefault<z.ZodString>;
8
+ succeedFirst: z.ZodDefault<z.ZodNumber>;
9
+ throttleFor: z.ZodDefault<z.ZodNumber>;
10
+ retryAfterSeconds: z.ZodDefault<z.ZodNumber>;
11
+ }, z.core.$strict>;
12
+ export type GmailFault = z.output<typeof gmailFaultSchema>;
13
+ /**
14
+ * Increment the per-operation call counter and, if a `rate-limited` fault is
15
+ * armed for `operation`, throw a 429 during the throttle window. Deterministic
16
+ * and clock-free: calls 1..succeedFirst pass, the next `throttleFor` calls
17
+ * throw, every call after passes. EVERY matching call (including throttled
18
+ * ones) advances the counter, so an agent that retries with backoff clears the
19
+ * window while one that doesn't leaves those sends undelivered.
20
+ */
21
+ export declare function checkFault(db: GmailTwinDatabase, operation: string): void;
@@ -0,0 +1,247 @@
1
+ import { z } from "zod";
2
+ import type { GmailStateSeed, SeedMailbox } from "./types.js";
3
+ export declare const gmailSeedSchema: z.ZodObject<{
4
+ primaryMailbox: z.ZodObject<{
5
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
6
+ displayName: z.ZodDefault<z.ZodString>;
7
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
8
+ id: z.ZodOptional<z.ZodString>;
9
+ name: z.ZodString;
10
+ color: z.ZodOptional<z.ZodObject<{
11
+ textColor: z.ZodOptional<z.ZodString>;
12
+ backgroundColor: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strict>>;
14
+ }, z.core.$strict>>>;
15
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
16
+ labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
17
+ id: z.ZodOptional<z.ZodString>;
18
+ threadId: z.ZodOptional<z.ZodString>;
19
+ raw: z.ZodOptional<z.ZodString>;
20
+ from: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
21
+ to: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
22
+ cc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
23
+ bcc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
24
+ subject: z.ZodDefault<z.ZodString>;
25
+ text: z.ZodDefault<z.ZodString>;
26
+ html: z.ZodDefault<z.ZodString>;
27
+ date: z.ZodOptional<z.ZodString>;
28
+ messageId: z.ZodOptional<z.ZodString>;
29
+ inReplyTo: z.ZodOptional<z.ZodString>;
30
+ references: z.ZodDefault<z.ZodArray<z.ZodString>>;
31
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
32
+ filename: z.ZodString;
33
+ mimeType: z.ZodDefault<z.ZodString>;
34
+ disposition: z.ZodDefault<z.ZodEnum<{
35
+ attachment: "attachment";
36
+ inline: "inline";
37
+ }>>;
38
+ contentId: z.ZodOptional<z.ZodString>;
39
+ data: z.ZodString;
40
+ }, z.core.$strict>>>;
41
+ }, z.core.$strict>>>;
42
+ drafts: z.ZodDefault<z.ZodArray<z.ZodObject<{
43
+ id: z.ZodOptional<z.ZodString>;
44
+ threadId: z.ZodOptional<z.ZodString>;
45
+ raw: z.ZodOptional<z.ZodString>;
46
+ from: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
47
+ to: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
48
+ cc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
49
+ bcc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
50
+ subject: z.ZodDefault<z.ZodString>;
51
+ text: z.ZodDefault<z.ZodString>;
52
+ html: z.ZodDefault<z.ZodString>;
53
+ date: z.ZodOptional<z.ZodString>;
54
+ messageId: z.ZodOptional<z.ZodString>;
55
+ inReplyTo: z.ZodOptional<z.ZodString>;
56
+ references: z.ZodDefault<z.ZodArray<z.ZodString>>;
57
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
58
+ filename: z.ZodString;
59
+ mimeType: z.ZodDefault<z.ZodString>;
60
+ disposition: z.ZodDefault<z.ZodEnum<{
61
+ attachment: "attachment";
62
+ inline: "inline";
63
+ }>>;
64
+ contentId: z.ZodOptional<z.ZodString>;
65
+ data: z.ZodString;
66
+ }, z.core.$strict>>>;
67
+ }, z.core.$strict>>>;
68
+ filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
69
+ id: z.ZodOptional<z.ZodString>;
70
+ criteria: z.ZodDefault<z.ZodObject<{
71
+ from: z.ZodOptional<z.ZodString>;
72
+ to: z.ZodOptional<z.ZodString>;
73
+ subject: z.ZodOptional<z.ZodString>;
74
+ query: z.ZodOptional<z.ZodString>;
75
+ negatedQuery: z.ZodOptional<z.ZodString>;
76
+ hasAttachment: z.ZodOptional<z.ZodBoolean>;
77
+ excludeChats: z.ZodOptional<z.ZodBoolean>;
78
+ size: z.ZodOptional<z.ZodNumber>;
79
+ sizeComparison: z.ZodOptional<z.ZodEnum<{
80
+ larger: "larger";
81
+ smaller: "smaller";
82
+ }>>;
83
+ }, z.core.$strict>>;
84
+ action: z.ZodDefault<z.ZodObject<{
85
+ addLabelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
86
+ removeLabelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
87
+ forward: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
88
+ }, z.core.$strict>>;
89
+ }, z.core.$strict>>>;
90
+ forwardingAddresses: z.ZodDefault<z.ZodArray<z.ZodObject<{
91
+ forwardingEmail: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
92
+ verificationStatus: z.ZodDefault<z.ZodEnum<{
93
+ accepted: "accepted";
94
+ pending: "pending";
95
+ }>>;
96
+ }, z.core.$strict>>>;
97
+ sendAs: z.ZodDefault<z.ZodArray<z.ZodObject<{
98
+ sendAsEmail: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
99
+ displayName: z.ZodDefault<z.ZodString>;
100
+ replyToAddress: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
101
+ isPrimary: z.ZodDefault<z.ZodBoolean>;
102
+ isDefault: z.ZodDefault<z.ZodBoolean>;
103
+ verificationStatus: z.ZodDefault<z.ZodEnum<{
104
+ accepted: "accepted";
105
+ pending: "pending";
106
+ }>>;
107
+ }, z.core.$strict>>>;
108
+ }, z.core.$strict>;
109
+ mailboxes: z.ZodDefault<z.ZodArray<z.ZodObject<{
110
+ email: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
111
+ displayName: z.ZodDefault<z.ZodString>;
112
+ labels: z.ZodDefault<z.ZodArray<z.ZodObject<{
113
+ id: z.ZodOptional<z.ZodString>;
114
+ name: z.ZodString;
115
+ color: z.ZodOptional<z.ZodObject<{
116
+ textColor: z.ZodOptional<z.ZodString>;
117
+ backgroundColor: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$strict>>;
119
+ }, z.core.$strict>>>;
120
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
121
+ labels: z.ZodDefault<z.ZodArray<z.ZodString>>;
122
+ id: z.ZodOptional<z.ZodString>;
123
+ threadId: z.ZodOptional<z.ZodString>;
124
+ raw: z.ZodOptional<z.ZodString>;
125
+ from: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
126
+ to: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
127
+ cc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
128
+ bcc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
129
+ subject: z.ZodDefault<z.ZodString>;
130
+ text: z.ZodDefault<z.ZodString>;
131
+ html: z.ZodDefault<z.ZodString>;
132
+ date: z.ZodOptional<z.ZodString>;
133
+ messageId: z.ZodOptional<z.ZodString>;
134
+ inReplyTo: z.ZodOptional<z.ZodString>;
135
+ references: z.ZodDefault<z.ZodArray<z.ZodString>>;
136
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
137
+ filename: z.ZodString;
138
+ mimeType: z.ZodDefault<z.ZodString>;
139
+ disposition: z.ZodDefault<z.ZodEnum<{
140
+ attachment: "attachment";
141
+ inline: "inline";
142
+ }>>;
143
+ contentId: z.ZodOptional<z.ZodString>;
144
+ data: z.ZodString;
145
+ }, z.core.$strict>>>;
146
+ }, z.core.$strict>>>;
147
+ drafts: z.ZodDefault<z.ZodArray<z.ZodObject<{
148
+ id: z.ZodOptional<z.ZodString>;
149
+ threadId: z.ZodOptional<z.ZodString>;
150
+ raw: z.ZodOptional<z.ZodString>;
151
+ from: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
152
+ to: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
153
+ cc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
154
+ bcc: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
155
+ subject: z.ZodDefault<z.ZodString>;
156
+ text: z.ZodDefault<z.ZodString>;
157
+ html: z.ZodDefault<z.ZodString>;
158
+ date: z.ZodOptional<z.ZodString>;
159
+ messageId: z.ZodOptional<z.ZodString>;
160
+ inReplyTo: z.ZodOptional<z.ZodString>;
161
+ references: z.ZodDefault<z.ZodArray<z.ZodString>>;
162
+ attachments: z.ZodDefault<z.ZodArray<z.ZodObject<{
163
+ filename: z.ZodString;
164
+ mimeType: z.ZodDefault<z.ZodString>;
165
+ disposition: z.ZodDefault<z.ZodEnum<{
166
+ attachment: "attachment";
167
+ inline: "inline";
168
+ }>>;
169
+ contentId: z.ZodOptional<z.ZodString>;
170
+ data: z.ZodString;
171
+ }, z.core.$strict>>>;
172
+ }, z.core.$strict>>>;
173
+ filters: z.ZodDefault<z.ZodArray<z.ZodObject<{
174
+ id: z.ZodOptional<z.ZodString>;
175
+ criteria: z.ZodDefault<z.ZodObject<{
176
+ from: z.ZodOptional<z.ZodString>;
177
+ to: z.ZodOptional<z.ZodString>;
178
+ subject: z.ZodOptional<z.ZodString>;
179
+ query: z.ZodOptional<z.ZodString>;
180
+ negatedQuery: z.ZodOptional<z.ZodString>;
181
+ hasAttachment: z.ZodOptional<z.ZodBoolean>;
182
+ excludeChats: z.ZodOptional<z.ZodBoolean>;
183
+ size: z.ZodOptional<z.ZodNumber>;
184
+ sizeComparison: z.ZodOptional<z.ZodEnum<{
185
+ larger: "larger";
186
+ smaller: "smaller";
187
+ }>>;
188
+ }, z.core.$strict>>;
189
+ action: z.ZodDefault<z.ZodObject<{
190
+ addLabelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
191
+ removeLabelIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
192
+ forward: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
193
+ }, z.core.$strict>>;
194
+ }, z.core.$strict>>>;
195
+ forwardingAddresses: z.ZodDefault<z.ZodArray<z.ZodObject<{
196
+ forwardingEmail: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
197
+ verificationStatus: z.ZodDefault<z.ZodEnum<{
198
+ accepted: "accepted";
199
+ pending: "pending";
200
+ }>>;
201
+ }, z.core.$strict>>>;
202
+ sendAs: z.ZodDefault<z.ZodArray<z.ZodObject<{
203
+ sendAsEmail: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
204
+ displayName: z.ZodDefault<z.ZodString>;
205
+ replyToAddress: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
206
+ isPrimary: z.ZodDefault<z.ZodBoolean>;
207
+ isDefault: z.ZodDefault<z.ZodBoolean>;
208
+ verificationStatus: z.ZodDefault<z.ZodEnum<{
209
+ accepted: "accepted";
210
+ pending: "pending";
211
+ }>>;
212
+ }, z.core.$strict>>>;
213
+ }, z.core.$strict>>>;
214
+ deliveryMode: z.ZodDefault<z.ZodEnum<{
215
+ "sender-only": "sender-only";
216
+ "seeded-mailboxes": "seeded-mailboxes";
217
+ }>>;
218
+ clock: z.ZodDefault<z.ZodString>;
219
+ faults: z.ZodDefault<z.ZodArray<z.ZodObject<{
220
+ name: z.ZodEnum<{
221
+ "rate-limited": "rate-limited";
222
+ }>;
223
+ target: z.ZodDefault<z.ZodString>;
224
+ succeedFirst: z.ZodDefault<z.ZodNumber>;
225
+ throttleFor: z.ZodDefault<z.ZodNumber>;
226
+ retryAfterSeconds: z.ZodDefault<z.ZodNumber>;
227
+ }, z.core.$strict>>>;
228
+ }, z.core.$strict>;
229
+ export type ParsedGmailStateSeed = z.output<typeof gmailSeedSchema>;
230
+ export declare function parseSeed(input: unknown): ParsedGmailStateSeed;
231
+ /**
232
+ * `Record<string, string | undefined>` rather than `NodeJS.ProcessEnv`, which is
233
+ * structurally the same thing but an AMBIENT global. This signature is vendored
234
+ * into `@pome-sh/checks`'s published declarations, and an ambient reference there
235
+ * makes a consumer's `tsc` fail with TS2503 unless they happen to have
236
+ * `@types/node` installed — a dependency this package should not impose to
237
+ * describe a plain string map.
238
+ */
239
+ export declare function loadSeedFromEnv(env?: Record<string, string | undefined>): ParsedGmailStateSeed;
240
+ /** Primary agent mailbox used by default / scenario seeds. */
241
+ export declare const DEFAULT_GMAIL_AGENT_EMAIL = "pome-agent@pome-twin.test";
242
+ /**
243
+ * Multi-thread inbox used by `defaultSeedState` and CLI Gmail scenarios:
244
+ * welcome, build (+ reply), unread support, and an unsent draft.
245
+ */
246
+ export declare function agentPathInboxMailbox(email?: string): SeedMailbox;
247
+ export declare function defaultSeedState(): GmailStateSeed;