reposets 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.
package/index.d.ts ADDED
@@ -0,0 +1,1680 @@
1
+ /**
2
+ * reposets
3
+ *
4
+ * CLI tool to sync GitHub repo settings, secrets, and rulesets
5
+ * across personal repositories.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+
10
+ import { AppDirs } from 'xdg-effect';
11
+ import { ConfigFile } from 'xdg-effect';
12
+ import type { ConfigFileService } from 'xdg-effect';
13
+ import { Context } from 'effect';
14
+ import { Effect } from 'effect';
15
+ import { FileSystem } from '@effect/platform/FileSystem';
16
+ import { Layer } from 'effect';
17
+ import { Option } from 'effect';
18
+ import { Ref } from 'effect';
19
+ import { Schema } from 'effect';
20
+ import { Tag } from 'effect/Context';
21
+ import { VoidIfEmpty } from 'effect/Types';
22
+ import { ConfigError as XdgConfigError } from 'xdg-effect';
23
+ import { XdgResolver } from 'xdg-effect';
24
+ import { YieldableError } from 'effect/Cause';
25
+
26
+ export { AppDirs }
27
+
28
+ /**
29
+ * Builds an API-compatible ruleset payload from the config-level Ruleset.
30
+ * Converts all shorthand fields into the GitHub API rules array format.
31
+ */
32
+ export declare function buildRulesetPayload(ruleset: Ruleset): RulesetPayload;
33
+
34
+ export declare type BypassActor = typeof BypassActorSchema.Type;
35
+
36
+ export declare const BypassActorSchema: Schema.Struct<{
37
+ actor_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
38
+ resolved: Schema.SchemaClass<string, string, never>;
39
+ }>]>>;
40
+ actor_type: Schema.Literal<["Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"]>;
41
+ bypass_mode: Schema.optionalWith<Schema.Literal<["always", "pull_request", "exempt"]>, {
42
+ default: () => "always";
43
+ }>;
44
+ }>;
45
+
46
+ export declare type Cleanup = typeof CleanupSchema.Type;
47
+
48
+ export declare const CleanupSchema: Schema.Struct<{
49
+ secrets: Schema.optionalWith<Schema.Struct<{
50
+ actions: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
51
+ preserve: Schema.Array$<typeof Schema.String>;
52
+ }>]>, {
53
+ default: () => CleanupScope;
54
+ }>;
55
+ dependabot: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
56
+ preserve: Schema.Array$<typeof Schema.String>;
57
+ }>]>, {
58
+ default: () => CleanupScope;
59
+ }>;
60
+ codespaces: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
61
+ preserve: Schema.Array$<typeof Schema.String>;
62
+ }>]>, {
63
+ default: () => CleanupScope;
64
+ }>;
65
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
66
+ preserve: Schema.Array$<typeof Schema.String>;
67
+ }>]>, {
68
+ default: () => CleanupScope;
69
+ }>;
70
+ }>, {
71
+ default: () => {
72
+ actions: CleanupScope;
73
+ dependabot: CleanupScope;
74
+ codespaces: CleanupScope;
75
+ environments: CleanupScope;
76
+ };
77
+ }>;
78
+ variables: Schema.optionalWith<Schema.Struct<{
79
+ actions: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
80
+ preserve: Schema.Array$<typeof Schema.String>;
81
+ }>]>, {
82
+ default: () => CleanupScope;
83
+ }>;
84
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
85
+ preserve: Schema.Array$<typeof Schema.String>;
86
+ }>]>, {
87
+ default: () => CleanupScope;
88
+ }>;
89
+ }>, {
90
+ default: () => {
91
+ actions: CleanupScope;
92
+ environments: CleanupScope;
93
+ };
94
+ }>;
95
+ rulesets: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
96
+ preserve: Schema.Array$<typeof Schema.String>;
97
+ }>]>, {
98
+ default: () => CleanupScope;
99
+ }>;
100
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
101
+ preserve: Schema.Array$<typeof Schema.String>;
102
+ }>]>, {
103
+ default: () => CleanupScope;
104
+ }>;
105
+ }>;
106
+
107
+ export declare type CleanupScope = typeof CleanupScopeSchema.Type;
108
+
109
+ export declare const CleanupScopeSchema: Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
110
+ preserve: Schema.Array$<typeof Schema.String>;
111
+ }>]>;
112
+
113
+ export declare type Config = typeof ConfigSchema.Type;
114
+
115
+ export { ConfigFile }
116
+
117
+ export declare const ConfigFilesLive: Layer.Layer<AppDirs | ConfigFileService<any> | XdgResolver, never, FileSystem>;
118
+
119
+ export declare const ConfigSchema: Schema.Struct<{
120
+ owner: Schema.optional<Schema.SchemaClass<string, string, never>>;
121
+ log_level: Schema.optionalWith<Schema.Literal<["silent", "info", "verbose", "debug"]>, {
122
+ default: () => "info";
123
+ }>;
124
+ settings: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.TypeLiteral<{
125
+ is_template: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
126
+ has_wiki: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
127
+ has_issues: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
128
+ has_projects: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
129
+ has_discussions: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
130
+ has_sponsorships: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
131
+ has_pull_requests: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
132
+ allow_forking: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
133
+ allow_merge_commit: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
134
+ allow_squash_merge: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
135
+ allow_rebase_merge: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
136
+ allow_auto_merge: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
137
+ allow_update_branch: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
138
+ squash_merge_commit_title: Schema.optional<Schema.Literal<["PR_TITLE", "COMMIT_OR_PR_TITLE"]>>;
139
+ squash_merge_commit_message: Schema.optional<Schema.Literal<["PR_BODY", "COMMIT_MESSAGES", "BLANK"]>>;
140
+ merge_commit_title: Schema.optional<Schema.Literal<["PR_TITLE", "MERGE_MESSAGE"]>>;
141
+ merge_commit_message: Schema.optional<Schema.Literal<["PR_BODY", "PR_TITLE", "BLANK"]>>;
142
+ delete_branch_on_merge: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
143
+ web_commit_signoff_required: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
144
+ }, readonly [{
145
+ readonly key: typeof Schema.String;
146
+ readonly value: typeof Schema.Unknown;
147
+ }]>>, {
148
+ default: () => {};
149
+ }>;
150
+ secrets: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
151
+ file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
152
+ }>, Schema.Struct<{
153
+ value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
154
+ }>, Schema.Struct<{
155
+ resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
156
+ }>]>>, {
157
+ default: () => {};
158
+ }>;
159
+ variables: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
160
+ file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
161
+ }>, Schema.Struct<{
162
+ value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
163
+ }>, Schema.Struct<{
164
+ resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
165
+ }>]>>, {
166
+ default: () => {};
167
+ }>;
168
+ rulesets: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Union<[Schema.Struct<{
169
+ name: Schema.SchemaClass<string, string, never>;
170
+ enforcement: Schema.Literal<["disabled", "active", "evaluate"]>;
171
+ conditions: Schema.optional<Schema.Struct<{
172
+ ref_name: Schema.optional<Schema.Struct<{
173
+ include: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
174
+ default: () => never[];
175
+ }>;
176
+ exclude: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
177
+ default: () => never[];
178
+ }>;
179
+ }>>;
180
+ }>>;
181
+ bypass_actors: Schema.optional<Schema.Array$<Schema.Struct<{
182
+ actor_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
183
+ resolved: Schema.SchemaClass<string, string, never>;
184
+ }>]>>;
185
+ actor_type: Schema.Literal<["Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"]>;
186
+ bypass_mode: Schema.optionalWith<Schema.Literal<["always", "pull_request", "exempt"]>, {
187
+ default: () => "always";
188
+ }>;
189
+ }>>>;
190
+ creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
191
+ update: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
192
+ deletion: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
193
+ required_linear_history: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
194
+ required_signatures: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
195
+ non_fast_forward: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
196
+ deployments: Schema.optional<Schema.Array$<typeof Schema.String>>;
197
+ targets: Schema.optional<Schema.Union<[Schema.Literal<["default", "all"]>, Schema.Array$<Schema.Union<[Schema.Struct<{
198
+ include: Schema.SchemaClass<string, string, never>;
199
+ }>, Schema.Struct<{
200
+ exclude: Schema.SchemaClass<string, string, never>;
201
+ }>]>>]>>;
202
+ status_checks: Schema.optional<Schema.Struct<{
203
+ update_branch: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
204
+ on_creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
205
+ default_integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
206
+ resolved: Schema.SchemaClass<string, string, never>;
207
+ }>]>>;
208
+ required: Schema.Array$<Schema.Struct<{
209
+ context: Schema.SchemaClass<string, string, never>;
210
+ integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
211
+ resolved: Schema.SchemaClass<string, string, never>;
212
+ }>]>>;
213
+ }>>;
214
+ }>>;
215
+ commit_message: Schema.optional<Schema.Array$<Schema.Struct<{
216
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
217
+ pattern: Schema.SchemaClass<string, string, never>;
218
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
219
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
220
+ }>>>;
221
+ commit_author_email: Schema.optional<Schema.Array$<Schema.Struct<{
222
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
223
+ pattern: Schema.SchemaClass<string, string, never>;
224
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
225
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
226
+ }>>>;
227
+ committer_email: Schema.optional<Schema.Array$<Schema.Struct<{
228
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
229
+ pattern: Schema.SchemaClass<string, string, never>;
230
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
231
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
232
+ }>>>;
233
+ type: Schema.Literal<["branch"]>;
234
+ pull_requests: Schema.optional<Schema.Struct<{
235
+ approvals: Schema.optionalWith<Schema.refine<number, typeof Schema.Int>, {
236
+ default: () => number;
237
+ }>;
238
+ dismiss_stale_reviews: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
239
+ default: () => boolean;
240
+ }>;
241
+ code_owner_review: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
242
+ default: () => boolean;
243
+ }>;
244
+ last_push_approval: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
245
+ default: () => boolean;
246
+ }>;
247
+ resolve_threads: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
248
+ default: () => boolean;
249
+ }>;
250
+ merge_methods: Schema.optional<Schema.Array$<Schema.Literal<["merge", "squash", "rebase"]>>>;
251
+ reviewers: Schema.optional<Schema.Array$<Schema.Struct<{
252
+ file_patterns: Schema.Array$<typeof Schema.String>;
253
+ minimum_approvals: Schema.refine<number, typeof Schema.Number>;
254
+ reviewer: Schema.Struct<{
255
+ id: Schema.refine<number, typeof Schema.Number>;
256
+ type: Schema.Literal<["Team"]>;
257
+ }>;
258
+ }>>>;
259
+ }>>;
260
+ merge_queue: Schema.optional<Schema.Struct<{
261
+ check_timeout: Schema.refine<number, typeof Schema.Int>;
262
+ grouping: Schema.Literal<["ALLGREEN", "HEADGREEN"]>;
263
+ max_build: Schema.refine<number, typeof Schema.Int>;
264
+ max_merge: Schema.refine<number, typeof Schema.Int>;
265
+ merge_method: Schema.Literal<["MERGE", "SQUASH", "REBASE"]>;
266
+ min_merge: Schema.refine<number, typeof Schema.Int>;
267
+ min_wait: Schema.refine<number, typeof Schema.Int>;
268
+ }>>;
269
+ copilot_review: Schema.optional<Schema.Struct<{
270
+ draft_prs: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
271
+ on_push: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
272
+ }>>;
273
+ code_scanning: Schema.optional<Schema.Array$<Schema.Struct<{
274
+ tool: Schema.SchemaClass<string, string, never>;
275
+ alerts: Schema.Literal<["none", "errors", "errors_and_warnings", "all"]>;
276
+ security_alerts: Schema.Literal<["none", "critical", "high_or_higher", "medium_or_higher", "all"]>;
277
+ }>>>;
278
+ workflows: Schema.optional<Schema.Struct<{
279
+ on_creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
280
+ required: Schema.Array$<Schema.Struct<{
281
+ path: Schema.SchemaClass<string, string, never>;
282
+ ref: Schema.optional<Schema.SchemaClass<string, string, never>>;
283
+ repository_id: Schema.Union<[typeof Schema.Int, Schema.Struct<{
284
+ resolved: Schema.SchemaClass<string, string, never>;
285
+ }>]>;
286
+ sha: Schema.optional<Schema.SchemaClass<string, string, never>>;
287
+ }>>;
288
+ }>>;
289
+ branch_name: Schema.optional<Schema.Array$<Schema.Struct<{
290
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
291
+ pattern: Schema.SchemaClass<string, string, never>;
292
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
293
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
294
+ }>>>;
295
+ }>, Schema.Struct<{
296
+ name: Schema.SchemaClass<string, string, never>;
297
+ enforcement: Schema.Literal<["disabled", "active", "evaluate"]>;
298
+ conditions: Schema.optional<Schema.Struct<{
299
+ ref_name: Schema.optional<Schema.Struct<{
300
+ include: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
301
+ default: () => never[];
302
+ }>;
303
+ exclude: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
304
+ default: () => never[];
305
+ }>;
306
+ }>>;
307
+ }>>;
308
+ bypass_actors: Schema.optional<Schema.Array$<Schema.Struct<{
309
+ actor_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
310
+ resolved: Schema.SchemaClass<string, string, never>;
311
+ }>]>>;
312
+ actor_type: Schema.Literal<["Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"]>;
313
+ bypass_mode: Schema.optionalWith<Schema.Literal<["always", "pull_request", "exempt"]>, {
314
+ default: () => "always";
315
+ }>;
316
+ }>>>;
317
+ creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
318
+ update: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
319
+ deletion: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
320
+ required_linear_history: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
321
+ required_signatures: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
322
+ non_fast_forward: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
323
+ deployments: Schema.optional<Schema.Array$<typeof Schema.String>>;
324
+ targets: Schema.optional<Schema.Union<[Schema.Literal<["default", "all"]>, Schema.Array$<Schema.Union<[Schema.Struct<{
325
+ include: Schema.SchemaClass<string, string, never>;
326
+ }>, Schema.Struct<{
327
+ exclude: Schema.SchemaClass<string, string, never>;
328
+ }>]>>]>>;
329
+ status_checks: Schema.optional<Schema.Struct<{
330
+ update_branch: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
331
+ on_creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
332
+ default_integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
333
+ resolved: Schema.SchemaClass<string, string, never>;
334
+ }>]>>;
335
+ required: Schema.Array$<Schema.Struct<{
336
+ context: Schema.SchemaClass<string, string, never>;
337
+ integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
338
+ resolved: Schema.SchemaClass<string, string, never>;
339
+ }>]>>;
340
+ }>>;
341
+ }>>;
342
+ commit_message: Schema.optional<Schema.Array$<Schema.Struct<{
343
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
344
+ pattern: Schema.SchemaClass<string, string, never>;
345
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
346
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
347
+ }>>>;
348
+ commit_author_email: Schema.optional<Schema.Array$<Schema.Struct<{
349
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
350
+ pattern: Schema.SchemaClass<string, string, never>;
351
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
352
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
353
+ }>>>;
354
+ committer_email: Schema.optional<Schema.Array$<Schema.Struct<{
355
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
356
+ pattern: Schema.SchemaClass<string, string, never>;
357
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
358
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
359
+ }>>>;
360
+ type: Schema.Literal<["tag"]>;
361
+ tag_name: Schema.optional<Schema.Array$<Schema.Struct<{
362
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
363
+ pattern: Schema.SchemaClass<string, string, never>;
364
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
365
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
366
+ }>>>;
367
+ }>]>>, {
368
+ default: () => {};
369
+ }>;
370
+ environments: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Struct<{
371
+ wait_timer: Schema.optional<Schema.refine<number, typeof Schema.Int>>;
372
+ prevent_self_review: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
373
+ reviewers: Schema.optional<Schema.Array$<Schema.Struct<{
374
+ type: Schema.Literal<["User", "Team"]>;
375
+ id: Schema.refine<number, typeof Schema.Number>;
376
+ }>>>;
377
+ deployment_branches: Schema.optional<Schema.Union<[Schema.Literal<["all", "protected"]>, Schema.Array$<Schema.Struct<{
378
+ name: Schema.SchemaClass<string, string, never>;
379
+ type: Schema.optionalWith<Schema.Literal<["branch", "tag"]>, {
380
+ default: () => "branch";
381
+ }>;
382
+ }>>]>>;
383
+ }>>, {
384
+ default: () => {};
385
+ }>;
386
+ groups: Schema.Record$<typeof Schema.String, Schema.Struct<{
387
+ owner: Schema.optional<Schema.SchemaClass<string, string, never>>;
388
+ repos: Schema.Array$<typeof Schema.String>;
389
+ credentials: Schema.optional<Schema.SchemaClass<string, string, never>>;
390
+ settings: Schema.optional<Schema.Array$<typeof Schema.String>>;
391
+ environments: Schema.optional<Schema.Array$<typeof Schema.String>>;
392
+ secrets: Schema.optional<Schema.Struct<{
393
+ actions: Schema.optional<Schema.Array$<typeof Schema.String>>;
394
+ dependabot: Schema.optional<Schema.Array$<typeof Schema.String>>;
395
+ codespaces: Schema.optional<Schema.Array$<typeof Schema.String>>;
396
+ environments: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Array$<typeof Schema.String>>>;
397
+ }>>;
398
+ variables: Schema.optional<Schema.Struct<{
399
+ actions: Schema.optional<Schema.Array$<typeof Schema.String>>;
400
+ environments: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Array$<typeof Schema.String>>>;
401
+ }>>;
402
+ rulesets: Schema.optional<Schema.Array$<typeof Schema.String>>;
403
+ cleanup: Schema.optional<Schema.Struct<{
404
+ secrets: Schema.optionalWith<Schema.Struct<{
405
+ actions: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
406
+ preserve: Schema.Array$<typeof Schema.String>;
407
+ }>]>, {
408
+ default: () => CleanupScope;
409
+ }>;
410
+ dependabot: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
411
+ preserve: Schema.Array$<typeof Schema.String>;
412
+ }>]>, {
413
+ default: () => CleanupScope;
414
+ }>;
415
+ codespaces: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
416
+ preserve: Schema.Array$<typeof Schema.String>;
417
+ }>]>, {
418
+ default: () => CleanupScope;
419
+ }>;
420
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
421
+ preserve: Schema.Array$<typeof Schema.String>;
422
+ }>]>, {
423
+ default: () => CleanupScope;
424
+ }>;
425
+ }>, {
426
+ default: () => {
427
+ actions: CleanupScope;
428
+ dependabot: CleanupScope;
429
+ codespaces: CleanupScope;
430
+ environments: CleanupScope;
431
+ };
432
+ }>;
433
+ variables: Schema.optionalWith<Schema.Struct<{
434
+ actions: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
435
+ preserve: Schema.Array$<typeof Schema.String>;
436
+ }>]>, {
437
+ default: () => CleanupScope;
438
+ }>;
439
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
440
+ preserve: Schema.Array$<typeof Schema.String>;
441
+ }>]>, {
442
+ default: () => CleanupScope;
443
+ }>;
444
+ }>, {
445
+ default: () => {
446
+ actions: CleanupScope;
447
+ environments: CleanupScope;
448
+ };
449
+ }>;
450
+ rulesets: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
451
+ preserve: Schema.Array$<typeof Schema.String>;
452
+ }>]>, {
453
+ default: () => CleanupScope;
454
+ }>;
455
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
456
+ preserve: Schema.Array$<typeof Schema.String>;
457
+ }>]>, {
458
+ default: () => CleanupScope;
459
+ }>;
460
+ }>>;
461
+ }>>;
462
+ }>;
463
+
464
+ export declare type CredentialProfile = typeof CredentialProfileSchema.Type;
465
+
466
+ export declare const CredentialProfileSchema: Schema.Struct<{
467
+ github_token: Schema.SchemaClass<string, string, never>;
468
+ op_service_account_token: Schema.optional<Schema.SchemaClass<string, string, never>>;
469
+ resolve: Schema.optional<Schema.Struct<{
470
+ op: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
471
+ file: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
472
+ value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>>;
473
+ }>>;
474
+ }>;
475
+
476
+ export declare class CredentialResolver extends CredentialResolver_base {
477
+ }
478
+
479
+ declare const CredentialResolver_base: Context.TagClass<CredentialResolver, "CredentialResolver", CredentialResolverService>;
480
+
481
+ export declare const CredentialResolverLive: Layer.Layer<CredentialResolver, never, OnePasswordClient>;
482
+
483
+ declare interface CredentialResolverService {
484
+ readonly resolveAll: (profile: CredentialProfile, basePath: string) => Effect.Effect<Map<string, string>, ResolveError>;
485
+ }
486
+
487
+ export declare type Credentials = typeof CredentialsSchema.Type;
488
+
489
+ export declare const CredentialsSchema: Schema.Struct<{
490
+ profiles: Schema.optionalWith<Schema.Record$<typeof Schema.String, Schema.Struct<{
491
+ github_token: Schema.SchemaClass<string, string, never>;
492
+ op_service_account_token: Schema.optional<Schema.SchemaClass<string, string, never>>;
493
+ resolve: Schema.optional<Schema.Struct<{
494
+ op: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
495
+ file: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
496
+ value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>>;
497
+ }>>;
498
+ }>>, {
499
+ default: () => {};
500
+ }>;
501
+ }>;
502
+
503
+ /**
504
+ * Encrypt a secret using libsodium's sealed box algorithm.
505
+ * Implementation based on tweetsodium using tweetnacl + blakejs.
506
+ *
507
+ * The sealed box format is: ephemeral_public_key (32 bytes) || ciphertext
508
+ */
509
+ export declare function encryptSecret(publicKey: string, secretValue: string): string;
510
+
511
+ declare interface EnvironmentInfo {
512
+ name: string;
513
+ }
514
+
515
+ export declare class GitHubApiError extends GitHubApiError_base<{
516
+ readonly message: string;
517
+ readonly status?: number;
518
+ }> {
519
+ }
520
+
521
+ declare const GitHubApiError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
522
+ readonly _tag: "GitHubApiError";
523
+ } & Readonly<A>;
524
+
525
+ export declare class GitHubClient extends GitHubClient_base {
526
+ }
527
+
528
+ declare const GitHubClient_base: Context.TagClass<GitHubClient, "GitHubClient", GitHubClientService>;
529
+
530
+ export declare function GitHubClientLive(token: string): Layer.Layer<GitHubClient>;
531
+
532
+ declare interface GitHubClientService {
533
+ readonly getOwnerType: (owner: string) => Effect.Effect<OwnerType, GitHubApiError>;
534
+ readonly syncSecret: (owner: string, repo: string, name: string, value: string, scope: SecretScope) => Effect.Effect<void, GitHubApiError>;
535
+ readonly syncVariable: (owner: string, repo: string, name: string, value: string) => Effect.Effect<void, GitHubApiError>;
536
+ readonly syncSettings: (owner: string, repo: string, settings: Record<string, unknown>) => Effect.Effect<void, GitHubApiError>;
537
+ readonly syncRuleset: (owner: string, repo: string, name: string, payload: RulesetPayload) => Effect.Effect<void, GitHubApiError>;
538
+ readonly listSecrets: (owner: string, repo: string, scope: SecretScope) => Effect.Effect<SecretInfo[], GitHubApiError>;
539
+ readonly listVariables: (owner: string, repo: string) => Effect.Effect<VariableInfo[], GitHubApiError>;
540
+ readonly listRulesets: (owner: string, repo: string) => Effect.Effect<RulesetInfo[], GitHubApiError>;
541
+ readonly deleteSecret: (owner: string, repo: string, name: string, scope: SecretScope) => Effect.Effect<void, GitHubApiError>;
542
+ readonly deleteVariable: (owner: string, repo: string, name: string) => Effect.Effect<void, GitHubApiError>;
543
+ readonly deleteRuleset: (owner: string, repo: string, rulesetId: number) => Effect.Effect<void, GitHubApiError>;
544
+ readonly syncEnvironment: (owner: string, repo: string, name: string, config: Record<string, unknown>) => Effect.Effect<void, GitHubApiError>;
545
+ readonly syncEnvironmentSecret: (owner: string, repo: string, envName: string, name: string, value: string) => Effect.Effect<void, GitHubApiError>;
546
+ readonly syncEnvironmentVariable: (owner: string, repo: string, envName: string, name: string, value: string) => Effect.Effect<void, GitHubApiError>;
547
+ readonly listEnvironments: (owner: string, repo: string) => Effect.Effect<EnvironmentInfo[], GitHubApiError>;
548
+ readonly listEnvironmentSecrets: (owner: string, repo: string, envName: string) => Effect.Effect<SecretInfo[], GitHubApiError>;
549
+ readonly listEnvironmentVariables: (owner: string, repo: string, envName: string) => Effect.Effect<VariableInfo[], GitHubApiError>;
550
+ readonly deleteEnvironment: (owner: string, repo: string, name: string) => Effect.Effect<void, GitHubApiError>;
551
+ readonly deleteEnvironmentSecret: (owner: string, repo: string, envName: string, name: string) => Effect.Effect<void, GitHubApiError>;
552
+ readonly deleteEnvironmentVariable: (owner: string, repo: string, envName: string, name: string) => Effect.Effect<void, GitHubApiError>;
553
+ }
554
+
555
+ export declare function GitHubClientTest(): {
556
+ layer: Layer.Layer<GitHubClient>;
557
+ calls: () => RecordedCall[];
558
+ };
559
+
560
+ export declare type Group = typeof GroupSchema.Type;
561
+
562
+ export declare const GroupSchema: Schema.Struct<{
563
+ owner: Schema.optional<Schema.SchemaClass<string, string, never>>;
564
+ repos: Schema.Array$<typeof Schema.String>;
565
+ credentials: Schema.optional<Schema.SchemaClass<string, string, never>>;
566
+ settings: Schema.optional<Schema.Array$<typeof Schema.String>>;
567
+ environments: Schema.optional<Schema.Array$<typeof Schema.String>>;
568
+ secrets: Schema.optional<Schema.Struct<{
569
+ actions: Schema.optional<Schema.Array$<typeof Schema.String>>;
570
+ dependabot: Schema.optional<Schema.Array$<typeof Schema.String>>;
571
+ codespaces: Schema.optional<Schema.Array$<typeof Schema.String>>;
572
+ environments: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Array$<typeof Schema.String>>>;
573
+ }>>;
574
+ variables: Schema.optional<Schema.Struct<{
575
+ actions: Schema.optional<Schema.Array$<typeof Schema.String>>;
576
+ environments: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Array$<typeof Schema.String>>>;
577
+ }>>;
578
+ rulesets: Schema.optional<Schema.Array$<typeof Schema.String>>;
579
+ cleanup: Schema.optional<Schema.Struct<{
580
+ secrets: Schema.optionalWith<Schema.Struct<{
581
+ actions: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
582
+ preserve: Schema.Array$<typeof Schema.String>;
583
+ }>]>, {
584
+ default: () => CleanupScope;
585
+ }>;
586
+ dependabot: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
587
+ preserve: Schema.Array$<typeof Schema.String>;
588
+ }>]>, {
589
+ default: () => CleanupScope;
590
+ }>;
591
+ codespaces: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
592
+ preserve: Schema.Array$<typeof Schema.String>;
593
+ }>]>, {
594
+ default: () => CleanupScope;
595
+ }>;
596
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
597
+ preserve: Schema.Array$<typeof Schema.String>;
598
+ }>]>, {
599
+ default: () => CleanupScope;
600
+ }>;
601
+ }>, {
602
+ default: () => {
603
+ actions: CleanupScope;
604
+ dependabot: CleanupScope;
605
+ codespaces: CleanupScope;
606
+ environments: CleanupScope;
607
+ };
608
+ }>;
609
+ variables: Schema.optionalWith<Schema.Struct<{
610
+ actions: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
611
+ preserve: Schema.Array$<typeof Schema.String>;
612
+ }>]>, {
613
+ default: () => CleanupScope;
614
+ }>;
615
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
616
+ preserve: Schema.Array$<typeof Schema.String>;
617
+ }>]>, {
618
+ default: () => CleanupScope;
619
+ }>;
620
+ }>, {
621
+ default: () => {
622
+ actions: CleanupScope;
623
+ environments: CleanupScope;
624
+ };
625
+ }>;
626
+ rulesets: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
627
+ preserve: Schema.Array$<typeof Schema.String>;
628
+ }>]>, {
629
+ default: () => CleanupScope;
630
+ }>;
631
+ environments: Schema.optionalWith<Schema.Union<[typeof Schema.Boolean, Schema.Struct<{
632
+ preserve: Schema.Array$<typeof Schema.String>;
633
+ }>]>, {
634
+ default: () => CleanupScope;
635
+ }>;
636
+ }>>;
637
+ }>;
638
+
639
+ /**
640
+ * Load config using the ConfigFileService. When a --config flag is provided,
641
+ * uses loadFrom with the resolved path. Otherwise uses discover to get both
642
+ * the config value and the file path (for configDir derivation).
643
+ *
644
+ * Returns config and configDir where configDir is the directory containing
645
+ * the config file.
646
+ */
647
+ export declare function loadConfigWithDir(configFile: ConfigFileService<Config>, configFlag: Option.Option<string>): Effect.Effect<{
648
+ config: Config;
649
+ configDir: string;
650
+ }, XdgConfigError>;
651
+
652
+ export declare type LogLevel = typeof LogLevelSchema.Type;
653
+
654
+ export declare const LogLevelSchema: Schema.Literal<["silent", "info", "verbose", "debug"]>;
655
+
656
+ export declare class OnePasswordClient extends OnePasswordClient_base {
657
+ }
658
+
659
+ declare const OnePasswordClient_base: Context.TagClass<OnePasswordClient, "OnePasswordClient", OnePasswordClientService>;
660
+
661
+ export declare const OnePasswordClientLive: Layer.Layer<OnePasswordClient, never, never>;
662
+
663
+ declare interface OnePasswordClientService {
664
+ readonly resolve: (reference: string, serviceAccountToken: string) => Effect.Effect<string, OnePasswordError>;
665
+ }
666
+
667
+ export declare function OnePasswordClientTest(stubs: Record<string, string>): Layer.Layer<OnePasswordClient>;
668
+
669
+ export declare class OnePasswordError extends OnePasswordError_base<{
670
+ readonly message: string;
671
+ }> {
672
+ }
673
+
674
+ declare const OnePasswordError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
675
+ readonly _tag: "OnePasswordError";
676
+ } & Readonly<A>;
677
+
678
+ declare type OwnerType = "User" | "Organization";
679
+
680
+ export declare interface RecordedCall {
681
+ method: string;
682
+ args: Record<string, unknown>;
683
+ }
684
+
685
+ export declare const ReposetsConfigFile: Tag<ConfigFileService<{
686
+ readonly owner?: string | undefined;
687
+ readonly log_level: "debug" | "info" | "silent" | "verbose";
688
+ readonly settings: {
689
+ readonly [x: string]: {
690
+ readonly [x: string]: unknown;
691
+ readonly is_template?: boolean | undefined;
692
+ readonly has_wiki?: boolean | undefined;
693
+ readonly has_issues?: boolean | undefined;
694
+ readonly has_projects?: boolean | undefined;
695
+ readonly has_discussions?: boolean | undefined;
696
+ readonly has_sponsorships?: boolean | undefined;
697
+ readonly has_pull_requests?: boolean | undefined;
698
+ readonly allow_forking?: boolean | undefined;
699
+ readonly allow_merge_commit?: boolean | undefined;
700
+ readonly allow_squash_merge?: boolean | undefined;
701
+ readonly allow_rebase_merge?: boolean | undefined;
702
+ readonly allow_auto_merge?: boolean | undefined;
703
+ readonly allow_update_branch?: boolean | undefined;
704
+ readonly squash_merge_commit_title?: "COMMIT_OR_PR_TITLE" | "PR_TITLE" | undefined;
705
+ readonly squash_merge_commit_message?: "BLANK" | "COMMIT_MESSAGES" | "PR_BODY" | undefined;
706
+ readonly merge_commit_title?: "MERGE_MESSAGE" | "PR_TITLE" | undefined;
707
+ readonly merge_commit_message?: "BLANK" | "PR_BODY" | "PR_TITLE" | undefined;
708
+ readonly delete_branch_on_merge?: boolean | undefined;
709
+ readonly web_commit_signoff_required?: boolean | undefined;
710
+ };
711
+ };
712
+ readonly secrets: {
713
+ readonly [x: string]: {
714
+ readonly file: {
715
+ readonly [x: string]: string;
716
+ };
717
+ } | {
718
+ readonly value: {
719
+ readonly [x: string]: string | {
720
+ readonly [x: string]: unknown;
721
+ };
722
+ };
723
+ } | {
724
+ readonly resolved: {
725
+ readonly [x: string]: string;
726
+ };
727
+ };
728
+ };
729
+ readonly variables: {
730
+ readonly [x: string]: {
731
+ readonly file: {
732
+ readonly [x: string]: string;
733
+ };
734
+ } | {
735
+ readonly value: {
736
+ readonly [x: string]: string | {
737
+ readonly [x: string]: unknown;
738
+ };
739
+ };
740
+ } | {
741
+ readonly resolved: {
742
+ readonly [x: string]: string;
743
+ };
744
+ };
745
+ };
746
+ readonly rulesets: {
747
+ readonly [x: string]: {
748
+ readonly name: string;
749
+ readonly enforcement: "active" | "disabled" | "evaluate";
750
+ readonly conditions?: {
751
+ readonly ref_name?: {
752
+ readonly include: readonly string[];
753
+ readonly exclude: readonly string[];
754
+ } | undefined;
755
+ } | undefined;
756
+ readonly bypass_actors?: readonly {
757
+ readonly actor_id?: number | {
758
+ readonly resolved: string;
759
+ } | undefined;
760
+ readonly actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
761
+ readonly bypass_mode: "always" | "exempt" | "pull_request";
762
+ }[] | undefined;
763
+ readonly creation?: boolean | undefined;
764
+ readonly update?: boolean | undefined;
765
+ readonly deletion?: boolean | undefined;
766
+ readonly required_linear_history?: boolean | undefined;
767
+ readonly required_signatures?: boolean | undefined;
768
+ readonly non_fast_forward?: boolean | undefined;
769
+ readonly deployments?: readonly string[] | undefined;
770
+ readonly targets?: "all" | "default" | readonly ({
771
+ readonly include: string;
772
+ } | {
773
+ readonly exclude: string;
774
+ })[] | undefined;
775
+ readonly status_checks?: {
776
+ readonly update_branch?: boolean | undefined;
777
+ readonly on_creation?: boolean | undefined;
778
+ readonly default_integration_id?: number | {
779
+ readonly resolved: string;
780
+ } | undefined;
781
+ readonly required: readonly {
782
+ readonly context: string;
783
+ readonly integration_id?: number | {
784
+ readonly resolved: string;
785
+ } | undefined;
786
+ }[];
787
+ } | undefined;
788
+ readonly commit_message?: readonly {
789
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
790
+ readonly pattern: string;
791
+ readonly name?: string | undefined;
792
+ readonly negate?: boolean | undefined;
793
+ }[] | undefined;
794
+ readonly commit_author_email?: readonly {
795
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
796
+ readonly pattern: string;
797
+ readonly name?: string | undefined;
798
+ readonly negate?: boolean | undefined;
799
+ }[] | undefined;
800
+ readonly committer_email?: readonly {
801
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
802
+ readonly pattern: string;
803
+ readonly name?: string | undefined;
804
+ readonly negate?: boolean | undefined;
805
+ }[] | undefined;
806
+ readonly type: "branch";
807
+ readonly pull_requests?: {
808
+ readonly approvals: number;
809
+ readonly dismiss_stale_reviews: boolean;
810
+ readonly code_owner_review: boolean;
811
+ readonly last_push_approval: boolean;
812
+ readonly resolve_threads: boolean;
813
+ readonly merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
814
+ readonly reviewers?: readonly {
815
+ readonly file_patterns: readonly string[];
816
+ readonly minimum_approvals: number;
817
+ readonly reviewer: {
818
+ readonly id: number;
819
+ readonly type: "Team";
820
+ };
821
+ }[] | undefined;
822
+ } | undefined;
823
+ readonly merge_queue?: {
824
+ readonly check_timeout: number;
825
+ readonly grouping: "ALLGREEN" | "HEADGREEN";
826
+ readonly max_build: number;
827
+ readonly max_merge: number;
828
+ readonly merge_method: "MERGE" | "REBASE" | "SQUASH";
829
+ readonly min_merge: number;
830
+ readonly min_wait: number;
831
+ } | undefined;
832
+ readonly copilot_review?: {
833
+ readonly draft_prs?: boolean | undefined;
834
+ readonly on_push?: boolean | undefined;
835
+ } | undefined;
836
+ readonly code_scanning?: readonly {
837
+ readonly tool: string;
838
+ readonly alerts: "all" | "errors" | "errors_and_warnings" | "none";
839
+ readonly security_alerts: "all" | "critical" | "high_or_higher" | "medium_or_higher" | "none";
840
+ }[] | undefined;
841
+ readonly workflows?: {
842
+ readonly on_creation?: boolean | undefined;
843
+ readonly required: readonly {
844
+ readonly path: string;
845
+ readonly ref?: string | undefined;
846
+ readonly repository_id: number | {
847
+ readonly resolved: string;
848
+ };
849
+ readonly sha?: string | undefined;
850
+ }[];
851
+ } | undefined;
852
+ readonly branch_name?: readonly {
853
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
854
+ readonly pattern: string;
855
+ readonly name?: string | undefined;
856
+ readonly negate?: boolean | undefined;
857
+ }[] | undefined;
858
+ } | {
859
+ readonly name: string;
860
+ readonly enforcement: "active" | "disabled" | "evaluate";
861
+ readonly conditions?: {
862
+ readonly ref_name?: {
863
+ readonly include: readonly string[];
864
+ readonly exclude: readonly string[];
865
+ } | undefined;
866
+ } | undefined;
867
+ readonly bypass_actors?: readonly {
868
+ readonly actor_id?: number | {
869
+ readonly resolved: string;
870
+ } | undefined;
871
+ readonly actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
872
+ readonly bypass_mode: "always" | "exempt" | "pull_request";
873
+ }[] | undefined;
874
+ readonly creation?: boolean | undefined;
875
+ readonly update?: boolean | undefined;
876
+ readonly deletion?: boolean | undefined;
877
+ readonly required_linear_history?: boolean | undefined;
878
+ readonly required_signatures?: boolean | undefined;
879
+ readonly non_fast_forward?: boolean | undefined;
880
+ readonly deployments?: readonly string[] | undefined;
881
+ readonly targets?: "all" | "default" | readonly ({
882
+ readonly include: string;
883
+ } | {
884
+ readonly exclude: string;
885
+ })[] | undefined;
886
+ readonly status_checks?: {
887
+ readonly update_branch?: boolean | undefined;
888
+ readonly on_creation?: boolean | undefined;
889
+ readonly default_integration_id?: number | {
890
+ readonly resolved: string;
891
+ } | undefined;
892
+ readonly required: readonly {
893
+ readonly context: string;
894
+ readonly integration_id?: number | {
895
+ readonly resolved: string;
896
+ } | undefined;
897
+ }[];
898
+ } | undefined;
899
+ readonly commit_message?: readonly {
900
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
901
+ readonly pattern: string;
902
+ readonly name?: string | undefined;
903
+ readonly negate?: boolean | undefined;
904
+ }[] | undefined;
905
+ readonly commit_author_email?: readonly {
906
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
907
+ readonly pattern: string;
908
+ readonly name?: string | undefined;
909
+ readonly negate?: boolean | undefined;
910
+ }[] | undefined;
911
+ readonly committer_email?: readonly {
912
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
913
+ readonly pattern: string;
914
+ readonly name?: string | undefined;
915
+ readonly negate?: boolean | undefined;
916
+ }[] | undefined;
917
+ readonly type: "tag";
918
+ readonly tag_name?: readonly {
919
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
920
+ readonly pattern: string;
921
+ readonly name?: string | undefined;
922
+ readonly negate?: boolean | undefined;
923
+ }[] | undefined;
924
+ };
925
+ };
926
+ readonly environments: {
927
+ readonly [x: string]: {
928
+ readonly wait_timer?: number | undefined;
929
+ readonly prevent_self_review?: boolean | undefined;
930
+ readonly reviewers?: readonly {
931
+ readonly type: "Team" | "User";
932
+ readonly id: number;
933
+ }[] | undefined;
934
+ readonly deployment_branches?: "all" | "protected" | readonly {
935
+ readonly name: string;
936
+ readonly type: "branch" | "tag";
937
+ }[] | undefined;
938
+ };
939
+ };
940
+ readonly groups: {
941
+ readonly [x: string]: {
942
+ readonly owner?: string | undefined;
943
+ readonly repos: readonly string[];
944
+ readonly credentials?: string | undefined;
945
+ readonly settings?: readonly string[] | undefined;
946
+ readonly environments?: readonly string[] | undefined;
947
+ readonly secrets?: {
948
+ readonly actions?: readonly string[] | undefined;
949
+ readonly dependabot?: readonly string[] | undefined;
950
+ readonly codespaces?: readonly string[] | undefined;
951
+ readonly environments?: {
952
+ readonly [x: string]: readonly string[];
953
+ } | undefined;
954
+ } | undefined;
955
+ readonly variables?: {
956
+ readonly actions?: readonly string[] | undefined;
957
+ readonly environments?: {
958
+ readonly [x: string]: readonly string[];
959
+ } | undefined;
960
+ } | undefined;
961
+ readonly rulesets?: readonly string[] | undefined;
962
+ readonly cleanup?: {
963
+ readonly secrets: {
964
+ readonly actions: boolean | {
965
+ readonly preserve: readonly string[];
966
+ };
967
+ readonly dependabot: boolean | {
968
+ readonly preserve: readonly string[];
969
+ };
970
+ readonly codespaces: boolean | {
971
+ readonly preserve: readonly string[];
972
+ };
973
+ readonly environments: boolean | {
974
+ readonly preserve: readonly string[];
975
+ };
976
+ };
977
+ readonly variables: {
978
+ readonly actions: boolean | {
979
+ readonly preserve: readonly string[];
980
+ };
981
+ readonly environments: boolean | {
982
+ readonly preserve: readonly string[];
983
+ };
984
+ };
985
+ readonly rulesets: boolean | {
986
+ readonly preserve: readonly string[];
987
+ };
988
+ readonly environments: boolean | {
989
+ readonly preserve: readonly string[];
990
+ };
991
+ } | undefined;
992
+ };
993
+ };
994
+ }>, ConfigFileService<{
995
+ readonly owner?: string | undefined;
996
+ readonly log_level: "debug" | "info" | "silent" | "verbose";
997
+ readonly settings: {
998
+ readonly [x: string]: {
999
+ readonly [x: string]: unknown;
1000
+ readonly is_template?: boolean | undefined;
1001
+ readonly has_wiki?: boolean | undefined;
1002
+ readonly has_issues?: boolean | undefined;
1003
+ readonly has_projects?: boolean | undefined;
1004
+ readonly has_discussions?: boolean | undefined;
1005
+ readonly has_sponsorships?: boolean | undefined;
1006
+ readonly has_pull_requests?: boolean | undefined;
1007
+ readonly allow_forking?: boolean | undefined;
1008
+ readonly allow_merge_commit?: boolean | undefined;
1009
+ readonly allow_squash_merge?: boolean | undefined;
1010
+ readonly allow_rebase_merge?: boolean | undefined;
1011
+ readonly allow_auto_merge?: boolean | undefined;
1012
+ readonly allow_update_branch?: boolean | undefined;
1013
+ readonly squash_merge_commit_title?: "COMMIT_OR_PR_TITLE" | "PR_TITLE" | undefined;
1014
+ readonly squash_merge_commit_message?: "BLANK" | "COMMIT_MESSAGES" | "PR_BODY" | undefined;
1015
+ readonly merge_commit_title?: "MERGE_MESSAGE" | "PR_TITLE" | undefined;
1016
+ readonly merge_commit_message?: "BLANK" | "PR_BODY" | "PR_TITLE" | undefined;
1017
+ readonly delete_branch_on_merge?: boolean | undefined;
1018
+ readonly web_commit_signoff_required?: boolean | undefined;
1019
+ };
1020
+ };
1021
+ readonly secrets: {
1022
+ readonly [x: string]: {
1023
+ readonly file: {
1024
+ readonly [x: string]: string;
1025
+ };
1026
+ } | {
1027
+ readonly value: {
1028
+ readonly [x: string]: string | {
1029
+ readonly [x: string]: unknown;
1030
+ };
1031
+ };
1032
+ } | {
1033
+ readonly resolved: {
1034
+ readonly [x: string]: string;
1035
+ };
1036
+ };
1037
+ };
1038
+ readonly variables: {
1039
+ readonly [x: string]: {
1040
+ readonly file: {
1041
+ readonly [x: string]: string;
1042
+ };
1043
+ } | {
1044
+ readonly value: {
1045
+ readonly [x: string]: string | {
1046
+ readonly [x: string]: unknown;
1047
+ };
1048
+ };
1049
+ } | {
1050
+ readonly resolved: {
1051
+ readonly [x: string]: string;
1052
+ };
1053
+ };
1054
+ };
1055
+ readonly rulesets: {
1056
+ readonly [x: string]: {
1057
+ readonly name: string;
1058
+ readonly enforcement: "active" | "disabled" | "evaluate";
1059
+ readonly conditions?: {
1060
+ readonly ref_name?: {
1061
+ readonly include: readonly string[];
1062
+ readonly exclude: readonly string[];
1063
+ } | undefined;
1064
+ } | undefined;
1065
+ readonly bypass_actors?: readonly {
1066
+ readonly actor_id?: number | {
1067
+ readonly resolved: string;
1068
+ } | undefined;
1069
+ readonly actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
1070
+ readonly bypass_mode: "always" | "exempt" | "pull_request";
1071
+ }[] | undefined;
1072
+ readonly creation?: boolean | undefined;
1073
+ readonly update?: boolean | undefined;
1074
+ readonly deletion?: boolean | undefined;
1075
+ readonly required_linear_history?: boolean | undefined;
1076
+ readonly required_signatures?: boolean | undefined;
1077
+ readonly non_fast_forward?: boolean | undefined;
1078
+ readonly deployments?: readonly string[] | undefined;
1079
+ readonly targets?: "all" | "default" | readonly ({
1080
+ readonly include: string;
1081
+ } | {
1082
+ readonly exclude: string;
1083
+ })[] | undefined;
1084
+ readonly status_checks?: {
1085
+ readonly update_branch?: boolean | undefined;
1086
+ readonly on_creation?: boolean | undefined;
1087
+ readonly default_integration_id?: number | {
1088
+ readonly resolved: string;
1089
+ } | undefined;
1090
+ readonly required: readonly {
1091
+ readonly context: string;
1092
+ readonly integration_id?: number | {
1093
+ readonly resolved: string;
1094
+ } | undefined;
1095
+ }[];
1096
+ } | undefined;
1097
+ readonly commit_message?: readonly {
1098
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1099
+ readonly pattern: string;
1100
+ readonly name?: string | undefined;
1101
+ readonly negate?: boolean | undefined;
1102
+ }[] | undefined;
1103
+ readonly commit_author_email?: readonly {
1104
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1105
+ readonly pattern: string;
1106
+ readonly name?: string | undefined;
1107
+ readonly negate?: boolean | undefined;
1108
+ }[] | undefined;
1109
+ readonly committer_email?: readonly {
1110
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1111
+ readonly pattern: string;
1112
+ readonly name?: string | undefined;
1113
+ readonly negate?: boolean | undefined;
1114
+ }[] | undefined;
1115
+ readonly type: "branch";
1116
+ readonly pull_requests?: {
1117
+ readonly approvals: number;
1118
+ readonly dismiss_stale_reviews: boolean;
1119
+ readonly code_owner_review: boolean;
1120
+ readonly last_push_approval: boolean;
1121
+ readonly resolve_threads: boolean;
1122
+ readonly merge_methods?: readonly ("merge" | "rebase" | "squash")[] | undefined;
1123
+ readonly reviewers?: readonly {
1124
+ readonly file_patterns: readonly string[];
1125
+ readonly minimum_approvals: number;
1126
+ readonly reviewer: {
1127
+ readonly id: number;
1128
+ readonly type: "Team";
1129
+ };
1130
+ }[] | undefined;
1131
+ } | undefined;
1132
+ readonly merge_queue?: {
1133
+ readonly check_timeout: number;
1134
+ readonly grouping: "ALLGREEN" | "HEADGREEN";
1135
+ readonly max_build: number;
1136
+ readonly max_merge: number;
1137
+ readonly merge_method: "MERGE" | "REBASE" | "SQUASH";
1138
+ readonly min_merge: number;
1139
+ readonly min_wait: number;
1140
+ } | undefined;
1141
+ readonly copilot_review?: {
1142
+ readonly draft_prs?: boolean | undefined;
1143
+ readonly on_push?: boolean | undefined;
1144
+ } | undefined;
1145
+ readonly code_scanning?: readonly {
1146
+ readonly tool: string;
1147
+ readonly alerts: "all" | "errors" | "errors_and_warnings" | "none";
1148
+ readonly security_alerts: "all" | "critical" | "high_or_higher" | "medium_or_higher" | "none";
1149
+ }[] | undefined;
1150
+ readonly workflows?: {
1151
+ readonly on_creation?: boolean | undefined;
1152
+ readonly required: readonly {
1153
+ readonly path: string;
1154
+ readonly ref?: string | undefined;
1155
+ readonly repository_id: number | {
1156
+ readonly resolved: string;
1157
+ };
1158
+ readonly sha?: string | undefined;
1159
+ }[];
1160
+ } | undefined;
1161
+ readonly branch_name?: readonly {
1162
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1163
+ readonly pattern: string;
1164
+ readonly name?: string | undefined;
1165
+ readonly negate?: boolean | undefined;
1166
+ }[] | undefined;
1167
+ } | {
1168
+ readonly name: string;
1169
+ readonly enforcement: "active" | "disabled" | "evaluate";
1170
+ readonly conditions?: {
1171
+ readonly ref_name?: {
1172
+ readonly include: readonly string[];
1173
+ readonly exclude: readonly string[];
1174
+ } | undefined;
1175
+ } | undefined;
1176
+ readonly bypass_actors?: readonly {
1177
+ readonly actor_id?: number | {
1178
+ readonly resolved: string;
1179
+ } | undefined;
1180
+ readonly actor_type: "DeployKey" | "Integration" | "OrganizationAdmin" | "RepositoryRole" | "Team";
1181
+ readonly bypass_mode: "always" | "exempt" | "pull_request";
1182
+ }[] | undefined;
1183
+ readonly creation?: boolean | undefined;
1184
+ readonly update?: boolean | undefined;
1185
+ readonly deletion?: boolean | undefined;
1186
+ readonly required_linear_history?: boolean | undefined;
1187
+ readonly required_signatures?: boolean | undefined;
1188
+ readonly non_fast_forward?: boolean | undefined;
1189
+ readonly deployments?: readonly string[] | undefined;
1190
+ readonly targets?: "all" | "default" | readonly ({
1191
+ readonly include: string;
1192
+ } | {
1193
+ readonly exclude: string;
1194
+ })[] | undefined;
1195
+ readonly status_checks?: {
1196
+ readonly update_branch?: boolean | undefined;
1197
+ readonly on_creation?: boolean | undefined;
1198
+ readonly default_integration_id?: number | {
1199
+ readonly resolved: string;
1200
+ } | undefined;
1201
+ readonly required: readonly {
1202
+ readonly context: string;
1203
+ readonly integration_id?: number | {
1204
+ readonly resolved: string;
1205
+ } | undefined;
1206
+ }[];
1207
+ } | undefined;
1208
+ readonly commit_message?: readonly {
1209
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1210
+ readonly pattern: string;
1211
+ readonly name?: string | undefined;
1212
+ readonly negate?: boolean | undefined;
1213
+ }[] | undefined;
1214
+ readonly commit_author_email?: readonly {
1215
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1216
+ readonly pattern: string;
1217
+ readonly name?: string | undefined;
1218
+ readonly negate?: boolean | undefined;
1219
+ }[] | undefined;
1220
+ readonly committer_email?: readonly {
1221
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1222
+ readonly pattern: string;
1223
+ readonly name?: string | undefined;
1224
+ readonly negate?: boolean | undefined;
1225
+ }[] | undefined;
1226
+ readonly type: "tag";
1227
+ readonly tag_name?: readonly {
1228
+ readonly operator: "contains" | "ends_with" | "regex" | "starts_with";
1229
+ readonly pattern: string;
1230
+ readonly name?: string | undefined;
1231
+ readonly negate?: boolean | undefined;
1232
+ }[] | undefined;
1233
+ };
1234
+ };
1235
+ readonly environments: {
1236
+ readonly [x: string]: {
1237
+ readonly wait_timer?: number | undefined;
1238
+ readonly prevent_self_review?: boolean | undefined;
1239
+ readonly reviewers?: readonly {
1240
+ readonly type: "Team" | "User";
1241
+ readonly id: number;
1242
+ }[] | undefined;
1243
+ readonly deployment_branches?: "all" | "protected" | readonly {
1244
+ readonly name: string;
1245
+ readonly type: "branch" | "tag";
1246
+ }[] | undefined;
1247
+ };
1248
+ };
1249
+ readonly groups: {
1250
+ readonly [x: string]: {
1251
+ readonly owner?: string | undefined;
1252
+ readonly repos: readonly string[];
1253
+ readonly credentials?: string | undefined;
1254
+ readonly settings?: readonly string[] | undefined;
1255
+ readonly environments?: readonly string[] | undefined;
1256
+ readonly secrets?: {
1257
+ readonly actions?: readonly string[] | undefined;
1258
+ readonly dependabot?: readonly string[] | undefined;
1259
+ readonly codespaces?: readonly string[] | undefined;
1260
+ readonly environments?: {
1261
+ readonly [x: string]: readonly string[];
1262
+ } | undefined;
1263
+ } | undefined;
1264
+ readonly variables?: {
1265
+ readonly actions?: readonly string[] | undefined;
1266
+ readonly environments?: {
1267
+ readonly [x: string]: readonly string[];
1268
+ } | undefined;
1269
+ } | undefined;
1270
+ readonly rulesets?: readonly string[] | undefined;
1271
+ readonly cleanup?: {
1272
+ readonly secrets: {
1273
+ readonly actions: boolean | {
1274
+ readonly preserve: readonly string[];
1275
+ };
1276
+ readonly dependabot: boolean | {
1277
+ readonly preserve: readonly string[];
1278
+ };
1279
+ readonly codespaces: boolean | {
1280
+ readonly preserve: readonly string[];
1281
+ };
1282
+ readonly environments: boolean | {
1283
+ readonly preserve: readonly string[];
1284
+ };
1285
+ };
1286
+ readonly variables: {
1287
+ readonly actions: boolean | {
1288
+ readonly preserve: readonly string[];
1289
+ };
1290
+ readonly environments: boolean | {
1291
+ readonly preserve: readonly string[];
1292
+ };
1293
+ };
1294
+ readonly rulesets: boolean | {
1295
+ readonly preserve: readonly string[];
1296
+ };
1297
+ readonly environments: boolean | {
1298
+ readonly preserve: readonly string[];
1299
+ };
1300
+ } | undefined;
1301
+ };
1302
+ };
1303
+ }>>;
1304
+
1305
+ export declare const ReposetsCredentialsFile: Tag<ConfigFileService<{
1306
+ readonly profiles: {
1307
+ readonly [x: string]: {
1308
+ readonly github_token: string;
1309
+ readonly op_service_account_token?: string | undefined;
1310
+ readonly resolve?: {
1311
+ readonly op?: {
1312
+ readonly [x: string]: string;
1313
+ } | undefined;
1314
+ readonly file?: {
1315
+ readonly [x: string]: string;
1316
+ } | undefined;
1317
+ readonly value?: {
1318
+ readonly [x: string]: string | {
1319
+ readonly [x: string]: unknown;
1320
+ };
1321
+ } | undefined;
1322
+ } | undefined;
1323
+ };
1324
+ };
1325
+ }>, ConfigFileService<{
1326
+ readonly profiles: {
1327
+ readonly [x: string]: {
1328
+ readonly github_token: string;
1329
+ readonly op_service_account_token?: string | undefined;
1330
+ readonly resolve?: {
1331
+ readonly op?: {
1332
+ readonly [x: string]: string;
1333
+ } | undefined;
1334
+ readonly file?: {
1335
+ readonly [x: string]: string;
1336
+ } | undefined;
1337
+ readonly value?: {
1338
+ readonly [x: string]: string | {
1339
+ readonly [x: string]: unknown;
1340
+ };
1341
+ } | undefined;
1342
+ } | undefined;
1343
+ };
1344
+ };
1345
+ }>>;
1346
+
1347
+ /**
1348
+ * Resolves a --config flag to a file path. If the flag points to a directory,
1349
+ * appends the config filename. If omitted, returns undefined.
1350
+ */
1351
+ export declare function resolveConfigFlag(configFlag: Option.Option<string>): string | undefined;
1352
+
1353
+ export declare type ResolvedRef = typeof ResolvedRefSchema.Type;
1354
+
1355
+ export declare const ResolvedRefSchema: Schema.Struct<{
1356
+ resolved: Schema.SchemaClass<string, string, never>;
1357
+ }>;
1358
+
1359
+ export declare class ResolveError extends ResolveError_base<{
1360
+ readonly message: string;
1361
+ }> {
1362
+ }
1363
+
1364
+ declare const ResolveError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
1365
+ readonly _tag: "ResolveError";
1366
+ } & Readonly<A>;
1367
+
1368
+ export declare type ResolveSection = typeof ResolveSectionSchema.Type;
1369
+
1370
+ export declare const ResolveSectionSchema: Schema.Struct<{
1371
+ op: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
1372
+ file: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
1373
+ value: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>>;
1374
+ }>;
1375
+
1376
+ export declare type Ruleset = typeof RulesetSchema.Type;
1377
+
1378
+ declare interface RulesetInfo {
1379
+ name: string;
1380
+ id: number;
1381
+ source_type?: string | undefined;
1382
+ }
1383
+
1384
+ /** API-compatible payload for creating/updating a ruleset. */
1385
+ export declare interface RulesetPayload {
1386
+ name: string;
1387
+ target: "branch" | "tag";
1388
+ enforcement: "disabled" | "active" | "evaluate";
1389
+ conditions?: Record<string, unknown>;
1390
+ bypass_actors?: ReadonlyArray<Record<string, unknown>>;
1391
+ rules?: ReadonlyArray<Record<string, unknown>>;
1392
+ }
1393
+
1394
+ export declare const RulesetSchema: Schema.Union<[Schema.Struct<{
1395
+ name: Schema.SchemaClass<string, string, never>;
1396
+ enforcement: Schema.Literal<["disabled", "active", "evaluate"]>;
1397
+ conditions: Schema.optional<Schema.Struct<{
1398
+ ref_name: Schema.optional<Schema.Struct<{
1399
+ include: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
1400
+ default: () => never[];
1401
+ }>;
1402
+ exclude: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
1403
+ default: () => never[];
1404
+ }>;
1405
+ }>>;
1406
+ }>>;
1407
+ bypass_actors: Schema.optional<Schema.Array$<Schema.Struct<{
1408
+ actor_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
1409
+ resolved: Schema.SchemaClass<string, string, never>;
1410
+ }>]>>;
1411
+ actor_type: Schema.Literal<["Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"]>;
1412
+ bypass_mode: Schema.optionalWith<Schema.Literal<["always", "pull_request", "exempt"]>, {
1413
+ default: () => "always";
1414
+ }>;
1415
+ }>>>;
1416
+ creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1417
+ update: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1418
+ deletion: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1419
+ required_linear_history: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1420
+ required_signatures: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1421
+ non_fast_forward: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1422
+ deployments: Schema.optional<Schema.Array$<typeof Schema.String>>;
1423
+ targets: Schema.optional<Schema.Union<[Schema.Literal<["default", "all"]>, Schema.Array$<Schema.Union<[Schema.Struct<{
1424
+ include: Schema.SchemaClass<string, string, never>;
1425
+ }>, Schema.Struct<{
1426
+ exclude: Schema.SchemaClass<string, string, never>;
1427
+ }>]>>]>>;
1428
+ status_checks: Schema.optional<Schema.Struct<{
1429
+ update_branch: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1430
+ on_creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1431
+ default_integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
1432
+ resolved: Schema.SchemaClass<string, string, never>;
1433
+ }>]>>;
1434
+ required: Schema.Array$<Schema.Struct<{
1435
+ context: Schema.SchemaClass<string, string, never>;
1436
+ integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
1437
+ resolved: Schema.SchemaClass<string, string, never>;
1438
+ }>]>>;
1439
+ }>>;
1440
+ }>>;
1441
+ commit_message: Schema.optional<Schema.Array$<Schema.Struct<{
1442
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1443
+ pattern: Schema.SchemaClass<string, string, never>;
1444
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1445
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1446
+ }>>>;
1447
+ commit_author_email: Schema.optional<Schema.Array$<Schema.Struct<{
1448
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1449
+ pattern: Schema.SchemaClass<string, string, never>;
1450
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1451
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1452
+ }>>>;
1453
+ committer_email: Schema.optional<Schema.Array$<Schema.Struct<{
1454
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1455
+ pattern: Schema.SchemaClass<string, string, never>;
1456
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1457
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1458
+ }>>>;
1459
+ type: Schema.Literal<["branch"]>;
1460
+ pull_requests: Schema.optional<Schema.Struct<{
1461
+ approvals: Schema.optionalWith<Schema.refine<number, typeof Schema.Int>, {
1462
+ default: () => number;
1463
+ }>;
1464
+ dismiss_stale_reviews: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
1465
+ default: () => boolean;
1466
+ }>;
1467
+ code_owner_review: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
1468
+ default: () => boolean;
1469
+ }>;
1470
+ last_push_approval: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
1471
+ default: () => boolean;
1472
+ }>;
1473
+ resolve_threads: Schema.optionalWith<Schema.SchemaClass<boolean, boolean, never>, {
1474
+ default: () => boolean;
1475
+ }>;
1476
+ merge_methods: Schema.optional<Schema.Array$<Schema.Literal<["merge", "squash", "rebase"]>>>;
1477
+ reviewers: Schema.optional<Schema.Array$<Schema.Struct<{
1478
+ file_patterns: Schema.Array$<typeof Schema.String>;
1479
+ minimum_approvals: Schema.refine<number, typeof Schema.Number>;
1480
+ reviewer: Schema.Struct<{
1481
+ id: Schema.refine<number, typeof Schema.Number>;
1482
+ type: Schema.Literal<["Team"]>;
1483
+ }>;
1484
+ }>>>;
1485
+ }>>;
1486
+ merge_queue: Schema.optional<Schema.Struct<{
1487
+ check_timeout: Schema.refine<number, typeof Schema.Int>;
1488
+ grouping: Schema.Literal<["ALLGREEN", "HEADGREEN"]>;
1489
+ max_build: Schema.refine<number, typeof Schema.Int>;
1490
+ max_merge: Schema.refine<number, typeof Schema.Int>;
1491
+ merge_method: Schema.Literal<["MERGE", "SQUASH", "REBASE"]>;
1492
+ min_merge: Schema.refine<number, typeof Schema.Int>;
1493
+ min_wait: Schema.refine<number, typeof Schema.Int>;
1494
+ }>>;
1495
+ copilot_review: Schema.optional<Schema.Struct<{
1496
+ draft_prs: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1497
+ on_push: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1498
+ }>>;
1499
+ code_scanning: Schema.optional<Schema.Array$<Schema.Struct<{
1500
+ tool: Schema.SchemaClass<string, string, never>;
1501
+ alerts: Schema.Literal<["none", "errors", "errors_and_warnings", "all"]>;
1502
+ security_alerts: Schema.Literal<["none", "critical", "high_or_higher", "medium_or_higher", "all"]>;
1503
+ }>>>;
1504
+ workflows: Schema.optional<Schema.Struct<{
1505
+ on_creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1506
+ required: Schema.Array$<Schema.Struct<{
1507
+ path: Schema.SchemaClass<string, string, never>;
1508
+ ref: Schema.optional<Schema.SchemaClass<string, string, never>>;
1509
+ repository_id: Schema.Union<[typeof Schema.Int, Schema.Struct<{
1510
+ resolved: Schema.SchemaClass<string, string, never>;
1511
+ }>]>;
1512
+ sha: Schema.optional<Schema.SchemaClass<string, string, never>>;
1513
+ }>>;
1514
+ }>>;
1515
+ branch_name: Schema.optional<Schema.Array$<Schema.Struct<{
1516
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1517
+ pattern: Schema.SchemaClass<string, string, never>;
1518
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1519
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1520
+ }>>>;
1521
+ }>, Schema.Struct<{
1522
+ name: Schema.SchemaClass<string, string, never>;
1523
+ enforcement: Schema.Literal<["disabled", "active", "evaluate"]>;
1524
+ conditions: Schema.optional<Schema.Struct<{
1525
+ ref_name: Schema.optional<Schema.Struct<{
1526
+ include: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
1527
+ default: () => never[];
1528
+ }>;
1529
+ exclude: Schema.optionalWith<Schema.Array$<typeof Schema.String>, {
1530
+ default: () => never[];
1531
+ }>;
1532
+ }>>;
1533
+ }>>;
1534
+ bypass_actors: Schema.optional<Schema.Array$<Schema.Struct<{
1535
+ actor_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
1536
+ resolved: Schema.SchemaClass<string, string, never>;
1537
+ }>]>>;
1538
+ actor_type: Schema.Literal<["Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"]>;
1539
+ bypass_mode: Schema.optionalWith<Schema.Literal<["always", "pull_request", "exempt"]>, {
1540
+ default: () => "always";
1541
+ }>;
1542
+ }>>>;
1543
+ creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1544
+ update: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1545
+ deletion: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1546
+ required_linear_history: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1547
+ required_signatures: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1548
+ non_fast_forward: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1549
+ deployments: Schema.optional<Schema.Array$<typeof Schema.String>>;
1550
+ targets: Schema.optional<Schema.Union<[Schema.Literal<["default", "all"]>, Schema.Array$<Schema.Union<[Schema.Struct<{
1551
+ include: Schema.SchemaClass<string, string, never>;
1552
+ }>, Schema.Struct<{
1553
+ exclude: Schema.SchemaClass<string, string, never>;
1554
+ }>]>>]>>;
1555
+ status_checks: Schema.optional<Schema.Struct<{
1556
+ update_branch: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1557
+ on_creation: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1558
+ default_integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
1559
+ resolved: Schema.SchemaClass<string, string, never>;
1560
+ }>]>>;
1561
+ required: Schema.Array$<Schema.Struct<{
1562
+ context: Schema.SchemaClass<string, string, never>;
1563
+ integration_id: Schema.optional<Schema.Union<[typeof Schema.Int, Schema.Struct<{
1564
+ resolved: Schema.SchemaClass<string, string, never>;
1565
+ }>]>>;
1566
+ }>>;
1567
+ }>>;
1568
+ commit_message: Schema.optional<Schema.Array$<Schema.Struct<{
1569
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1570
+ pattern: Schema.SchemaClass<string, string, never>;
1571
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1572
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1573
+ }>>>;
1574
+ commit_author_email: Schema.optional<Schema.Array$<Schema.Struct<{
1575
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1576
+ pattern: Schema.SchemaClass<string, string, never>;
1577
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1578
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1579
+ }>>>;
1580
+ committer_email: Schema.optional<Schema.Array$<Schema.Struct<{
1581
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1582
+ pattern: Schema.SchemaClass<string, string, never>;
1583
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1584
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1585
+ }>>>;
1586
+ type: Schema.Literal<["tag"]>;
1587
+ tag_name: Schema.optional<Schema.Array$<Schema.Struct<{
1588
+ operator: Schema.Literal<["starts_with", "ends_with", "contains", "regex"]>;
1589
+ pattern: Schema.SchemaClass<string, string, never>;
1590
+ name: Schema.optional<Schema.SchemaClass<string, string, never>>;
1591
+ negate: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
1592
+ }>>>;
1593
+ }>]>;
1594
+
1595
+ export declare type SecretGroup = typeof SecretGroupSchema.Type;
1596
+
1597
+ export declare const SecretGroupSchema: Schema.Union<[Schema.Struct<{
1598
+ file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
1599
+ }>, Schema.Struct<{
1600
+ value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
1601
+ }>, Schema.Struct<{
1602
+ resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
1603
+ }>]>;
1604
+
1605
+ declare interface SecretInfo {
1606
+ name: string;
1607
+ }
1608
+
1609
+ declare type SecretScope = "actions" | "dependabot" | "codespaces";
1610
+
1611
+ export declare class SyncEngine extends SyncEngine_base {
1612
+ }
1613
+
1614
+ declare const SyncEngine_base: Context.TagClass<SyncEngine, "SyncEngine", SyncEngineService>;
1615
+
1616
+ export declare const SyncEngineLive: Layer.Layer<SyncEngine, never, CredentialResolver | GitHubClient | SyncLogger>;
1617
+
1618
+ declare interface SyncEngineService {
1619
+ readonly syncAll: (config: Config, credentials: Credentials, options: SyncOptions) => Effect.Effect<void, SyncError>;
1620
+ }
1621
+
1622
+ export declare class SyncError extends SyncError_base<{
1623
+ readonly message: string;
1624
+ }> {
1625
+ }
1626
+
1627
+ declare const SyncError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
1628
+ readonly _tag: "SyncError";
1629
+ } & Readonly<A>;
1630
+
1631
+ export declare class SyncLogger extends SyncLogger_base {
1632
+ }
1633
+
1634
+ declare const SyncLogger_base: Context.TagClass<SyncLogger, "SyncLogger", SyncLoggerService>;
1635
+
1636
+ export declare interface SyncLoggerConfig {
1637
+ readonly dryRun: boolean;
1638
+ readonly logLevel: LogLevel;
1639
+ readonly output?: Ref.Ref<string[]>;
1640
+ }
1641
+
1642
+ export declare function SyncLoggerLive(config: SyncLoggerConfig): Layer.Layer<SyncLogger>;
1643
+
1644
+ declare interface SyncLoggerService {
1645
+ readonly groupStart: (name: string, repoCount: number) => Effect.Effect<void>;
1646
+ readonly repoStart: (owner: string, repo: string) => Effect.Effect<void>;
1647
+ readonly repoSkip: (owner: string, repo: string, reason: string) => Effect.Effect<void>;
1648
+ readonly syncSummary: (resource: "secret" | "variable" | "ruleset" | "environment", count: number, detail: string) => Effect.Effect<void>;
1649
+ readonly settingsApplied: () => Effect.Effect<void>;
1650
+ readonly cleanupSummary: (resource: string, count: number, names: string[]) => Effect.Effect<void>;
1651
+ readonly syncOperation: (verb: "sync" | "apply" | "delete" | "skip", resource: string, name: string, detail?: string, source?: string) => Effect.Effect<void>;
1652
+ readonly syncError: (context: string, message: string) => Effect.Effect<void>;
1653
+ readonly finish: () => Effect.Effect<void>;
1654
+ }
1655
+
1656
+ declare interface SyncOptions {
1657
+ readonly dryRun: boolean;
1658
+ readonly noCleanup: boolean;
1659
+ readonly groupFilter?: string | undefined;
1660
+ readonly repoFilter?: string | undefined;
1661
+ readonly configDir: string;
1662
+ }
1663
+
1664
+ export declare type VariableGroup = typeof VariableGroupSchema.Type;
1665
+
1666
+ export declare const VariableGroupSchema: Schema.Union<[Schema.Struct<{
1667
+ file: Schema.Record$<typeof Schema.String, typeof Schema.String>;
1668
+ }>, Schema.Struct<{
1669
+ value: Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, Schema.Record$<typeof Schema.String, typeof Schema.Unknown>]>>;
1670
+ }>, Schema.Struct<{
1671
+ resolved: Schema.Record$<typeof Schema.String, typeof Schema.String>;
1672
+ }>]>;
1673
+
1674
+ declare interface VariableInfo {
1675
+ name: string;
1676
+ }
1677
+
1678
+ export { XdgConfigError }
1679
+
1680
+ export { }