@openvtc/trust-tasks 0.23.2 → 0.23.3

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.
@@ -0,0 +1,1898 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/git-ns/bridge/event/0.4/payload.schema.json
4
+ */
5
+ import type { DriftItem, Ext, ForgeAccount, ForgeHost, ForgeId, NamespaceId, RepoResource } from "../../../../_shared/components.js";
6
+ /**
7
+ * One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.
8
+ */
9
+ export type ForgeEvent = RepoRenamed | RepoTransferred | RepoCreatedUnmanaged | RepoDeleted | RoleChanged | ProtectionChanged | InstallationRemoved | AccountLinked | BindCompleted | RoleMapReported | PullRequestOpened;
10
+ /**
11
+ * A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository.
12
+ */
13
+ export type MappedRole = "none" | "read" | "triage" | "write" | "maintain" | "admin";
14
+ /**
15
+ * `opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened.
16
+ */
17
+ export type PullRequestAction = "opened" | "reopened";
18
+ /**
19
+ * The bridge tells the VTC something happened on the forge — translated from the forge's webhook or found by an inspection sweep — together with any drift it now sees; or reports the role map it projects with, or a pull request opened or reopened on a governed repository.
20
+ */
21
+ export interface GitNamespacesBridgeEventPayload {
22
+ /**
23
+ * The namespace the event happened in.
24
+ */
25
+ namespace: NamespaceId;
26
+ event: ForgeEvent;
27
+ /**
28
+ * The complete outstanding drift for each repository the event concerns, replacing what the VTC held for those repositories. Absent: the event changes no repository's drift.
29
+ */
30
+ drift?: DriftItem[];
31
+ ext?: Ext;
32
+ }
33
+ export interface RepoRenamed {
34
+ type: "repoRenamed";
35
+ forgeId: ForgeId;
36
+ from: RepoResource;
37
+ to: RepoResource;
38
+ }
39
+ export interface RepoTransferred {
40
+ type: "repoTransferred";
41
+ forgeId: ForgeId;
42
+ from: RepoResource;
43
+ to: RepoResource;
44
+ }
45
+ export interface RepoCreatedUnmanaged {
46
+ type: "repoCreatedUnmanaged";
47
+ forgeId: ForgeId;
48
+ resource: RepoResource;
49
+ }
50
+ export interface RepoDeleted {
51
+ type: "repoDeleted";
52
+ forgeId: ForgeId;
53
+ resource: RepoResource;
54
+ }
55
+ export interface RoleChanged {
56
+ type: "roleChanged";
57
+ forgeId: ForgeId;
58
+ resource: RepoResource;
59
+ account: ForgeAccount;
60
+ /**
61
+ * The role the account now holds. Absent: the account holds no role now.
62
+ */
63
+ role?: string;
64
+ }
65
+ export interface ProtectionChanged {
66
+ type: "protectionChanged";
67
+ forgeId: ForgeId;
68
+ resource: RepoResource;
69
+ /**
70
+ * Whether the forge still refuses merges without a passing verify-trust check, with no bypass.
71
+ */
72
+ requiredCheck: boolean;
73
+ }
74
+ export interface InstallationRemoved {
75
+ type: "installationRemoved";
76
+ }
77
+ export interface AccountLinked {
78
+ type: "accountLinked";
79
+ /**
80
+ * The beginAccountLink job.
81
+ */
82
+ jobId: string;
83
+ account: ForgeAccount;
84
+ }
85
+ export interface BindCompleted {
86
+ type: "bindCompleted";
87
+ /**
88
+ * The beginBind job.
89
+ */
90
+ jobId: string;
91
+ /**
92
+ * The forge's id for the owner, which survives renames.
93
+ */
94
+ ownerId: ForgeId;
95
+ kind: "organization" | "user";
96
+ }
97
+ export interface RoleMapReported {
98
+ type: "roleMapReported";
99
+ roleMap: RoleMap;
100
+ /**
101
+ * The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.
102
+ *
103
+ * @minItems 1
104
+ * @maxItems 5
105
+ */
106
+ ladder: [MappedRole] | [MappedRole, MappedRole] | [MappedRole, MappedRole, MappedRole] | [MappedRole, MappedRole, MappedRole, MappedRole] | [MappedRole, MappedRole, MappedRole, MappedRole, MappedRole];
107
+ /**
108
+ * Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.
109
+ *
110
+ * @maxItems 1000
111
+ */
112
+ repos?: {
113
+ resource: RepoResource;
114
+ roleMap: RoleMap;
115
+ }[];
116
+ /**
117
+ * Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.
118
+ *
119
+ * @maxItems 10000
120
+ */
121
+ stale?: RepoResource[];
122
+ }
123
+ /**
124
+ * The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.
125
+ */
126
+ export interface RoleMap {
127
+ own: MappedRole;
128
+ maintain: MappedRole;
129
+ commit: MappedRole;
130
+ }
131
+ export interface PullRequestOpened {
132
+ type: "pullRequestOpened";
133
+ /**
134
+ * The forge's id for the repository the pull request targets.
135
+ */
136
+ forgeId: ForgeId;
137
+ /**
138
+ * The repository the pull request targets (its base repository).
139
+ */
140
+ resource: RepoResource;
141
+ /**
142
+ * The pull request's number in `resource`.
143
+ */
144
+ number: number;
145
+ action: PullRequestAction;
146
+ /**
147
+ * The account that opened the pull request.
148
+ */
149
+ author: ForgeAccount;
150
+ /**
151
+ * The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`.
152
+ */
153
+ actor: ForgeAccount;
154
+ /**
155
+ * Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts.
156
+ */
157
+ draft?: boolean;
158
+ /**
159
+ * Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know.
160
+ */
161
+ fromFork?: boolean;
162
+ }
163
+ /**
164
+ * The VTC has recorded the event. Nothing else is returned.
165
+ */
166
+ export interface GitNamespacesBridgeEventResponsePayload {
167
+ ext?: Ext;
168
+ }
169
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
170
+ export type { DriftItem, Ext, ForgeAccount, ForgeHost, ForgeId, NamespaceId, RepoResource };
171
+ /** Trust Task type URI. */
172
+ export declare const TYPE_URI: "https://trusttasks.org/spec/git-ns/bridge/event/0.4";
173
+ /** Stable alias for this specification's request payload shape. */
174
+ export type Payload = GitNamespacesBridgeEventPayload;
175
+ /** Trust Task response type URI (request type URI + "#response"). */
176
+ export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/git-ns/bridge/event/0.4#response";
177
+ /** Stable alias for this specification's success-response payload shape. */
178
+ export type Response = GitNamespacesBridgeEventResponsePayload;
179
+ /**
180
+ * This specification's payload schema, as a value.
181
+ *
182
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
183
+ * rather than only as a `.json` file because TypeScript types are erased
184
+ * at runtime: without a schema a consumer has nothing to validate, and
185
+ * every REQUIRED payload member is optional in practice. Cross-file
186
+ * `$ref`s are already inlined, so it needs no resolver.
187
+ */
188
+ export declare const PAYLOAD_SCHEMA: {
189
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
190
+ readonly $id: "https://trusttasks.org/spec/git-ns/bridge/event/0.4";
191
+ readonly title: "Git Namespaces — Bridge Event — payload";
192
+ readonly description: "The bridge tells the VTC something happened on the forge — translated from the forge's webhook or found by an inspection sweep — together with any drift it now sees; or reports the role map it projects with, or a pull request opened or reopened on a governed repository.";
193
+ readonly type: "object";
194
+ readonly additionalProperties: false;
195
+ readonly required: readonly ["namespace", "event"];
196
+ readonly properties: {
197
+ readonly namespace: {
198
+ readonly $ref: "#/$defs/NamespaceId";
199
+ readonly description: "The namespace the event happened in.";
200
+ };
201
+ readonly event: {
202
+ readonly $ref: "#/$defs/ForgeEvent";
203
+ };
204
+ readonly drift: {
205
+ readonly type: "array";
206
+ readonly items: {
207
+ readonly $ref: "#/$defs/DriftItem";
208
+ };
209
+ readonly description: "The complete outstanding drift for each repository the event concerns, replacing what the VTC held for those repositories. Absent: the event changes no repository's drift.";
210
+ };
211
+ readonly ext: {
212
+ readonly $ref: "#/$defs/Ext";
213
+ };
214
+ };
215
+ readonly $defs: {
216
+ readonly JobId: {
217
+ readonly type: "string";
218
+ readonly minLength: 1;
219
+ readonly maxLength: 128;
220
+ readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
221
+ };
222
+ readonly ForgeRole: {
223
+ readonly type: "string";
224
+ readonly minLength: 1;
225
+ readonly maxLength: 64;
226
+ readonly description: "A role in the forge's own vocabulary (`maintain`, `write`).";
227
+ };
228
+ readonly ForgeEvent: {
229
+ readonly title: "ForgeEvent";
230
+ readonly description: "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.";
231
+ readonly type: "object";
232
+ readonly oneOf: readonly [{
233
+ readonly title: "RepoRenamed";
234
+ readonly type: "object";
235
+ readonly additionalProperties: false;
236
+ readonly required: readonly ["type", "forgeId", "from", "to"];
237
+ readonly properties: {
238
+ readonly type: {
239
+ readonly const: "repoRenamed";
240
+ };
241
+ readonly forgeId: {
242
+ readonly $ref: "#/$defs/ForgeId";
243
+ };
244
+ readonly from: {
245
+ readonly $ref: "#/$defs/RepoResource";
246
+ };
247
+ readonly to: {
248
+ readonly $ref: "#/$defs/RepoResource";
249
+ };
250
+ };
251
+ }, {
252
+ readonly title: "RepoTransferred";
253
+ readonly type: "object";
254
+ readonly additionalProperties: false;
255
+ readonly required: readonly ["type", "forgeId", "from", "to"];
256
+ readonly properties: {
257
+ readonly type: {
258
+ readonly const: "repoTransferred";
259
+ };
260
+ readonly forgeId: {
261
+ readonly $ref: "#/$defs/ForgeId";
262
+ };
263
+ readonly from: {
264
+ readonly $ref: "#/$defs/RepoResource";
265
+ };
266
+ readonly to: {
267
+ readonly $ref: "#/$defs/RepoResource";
268
+ };
269
+ };
270
+ }, {
271
+ readonly title: "RepoCreatedUnmanaged";
272
+ readonly type: "object";
273
+ readonly additionalProperties: false;
274
+ readonly required: readonly ["type", "forgeId", "resource"];
275
+ readonly properties: {
276
+ readonly type: {
277
+ readonly const: "repoCreatedUnmanaged";
278
+ };
279
+ readonly forgeId: {
280
+ readonly $ref: "#/$defs/ForgeId";
281
+ };
282
+ readonly resource: {
283
+ readonly $ref: "#/$defs/RepoResource";
284
+ };
285
+ };
286
+ }, {
287
+ readonly title: "RepoDeleted";
288
+ readonly type: "object";
289
+ readonly additionalProperties: false;
290
+ readonly required: readonly ["type", "forgeId", "resource"];
291
+ readonly properties: {
292
+ readonly type: {
293
+ readonly const: "repoDeleted";
294
+ };
295
+ readonly forgeId: {
296
+ readonly $ref: "#/$defs/ForgeId";
297
+ };
298
+ readonly resource: {
299
+ readonly $ref: "#/$defs/RepoResource";
300
+ };
301
+ };
302
+ }, {
303
+ readonly title: "RoleChanged";
304
+ readonly type: "object";
305
+ readonly additionalProperties: false;
306
+ readonly required: readonly ["type", "forgeId", "resource", "account"];
307
+ readonly properties: {
308
+ readonly type: {
309
+ readonly const: "roleChanged";
310
+ };
311
+ readonly forgeId: {
312
+ readonly $ref: "#/$defs/ForgeId";
313
+ };
314
+ readonly resource: {
315
+ readonly $ref: "#/$defs/RepoResource";
316
+ };
317
+ readonly account: {
318
+ readonly $ref: "#/$defs/ForgeAccount";
319
+ };
320
+ readonly role: {
321
+ readonly $ref: "#/$defs/ForgeRole";
322
+ readonly description: "The role the account now holds. Absent: the account holds no role now.";
323
+ };
324
+ };
325
+ }, {
326
+ readonly title: "ProtectionChanged";
327
+ readonly type: "object";
328
+ readonly additionalProperties: false;
329
+ readonly required: readonly ["type", "forgeId", "resource", "requiredCheck"];
330
+ readonly properties: {
331
+ readonly type: {
332
+ readonly const: "protectionChanged";
333
+ };
334
+ readonly forgeId: {
335
+ readonly $ref: "#/$defs/ForgeId";
336
+ };
337
+ readonly resource: {
338
+ readonly $ref: "#/$defs/RepoResource";
339
+ };
340
+ readonly requiredCheck: {
341
+ readonly type: "boolean";
342
+ readonly description: "Whether the forge still refuses merges without a passing verify-trust check, with no bypass.";
343
+ };
344
+ };
345
+ }, {
346
+ readonly title: "InstallationRemoved";
347
+ readonly type: "object";
348
+ readonly additionalProperties: false;
349
+ readonly required: readonly ["type"];
350
+ readonly properties: {
351
+ readonly type: {
352
+ readonly const: "installationRemoved";
353
+ };
354
+ };
355
+ }, {
356
+ readonly title: "AccountLinked";
357
+ readonly type: "object";
358
+ readonly additionalProperties: false;
359
+ readonly required: readonly ["type", "jobId", "account"];
360
+ readonly properties: {
361
+ readonly type: {
362
+ readonly const: "accountLinked";
363
+ };
364
+ readonly jobId: {
365
+ readonly $ref: "#/$defs/JobId";
366
+ readonly description: "The beginAccountLink job.";
367
+ };
368
+ readonly account: {
369
+ readonly $ref: "#/$defs/ForgeAccount";
370
+ };
371
+ };
372
+ }, {
373
+ readonly title: "BindCompleted";
374
+ readonly type: "object";
375
+ readonly additionalProperties: false;
376
+ readonly required: readonly ["type", "jobId", "ownerId", "kind"];
377
+ readonly properties: {
378
+ readonly type: {
379
+ readonly const: "bindCompleted";
380
+ };
381
+ readonly jobId: {
382
+ readonly $ref: "#/$defs/JobId";
383
+ readonly description: "The beginBind job.";
384
+ };
385
+ readonly ownerId: {
386
+ readonly $ref: "#/$defs/ForgeId";
387
+ readonly description: "The forge's id for the owner, which survives renames.";
388
+ };
389
+ readonly kind: {
390
+ readonly type: "string";
391
+ readonly enum: readonly ["organization", "user"];
392
+ };
393
+ };
394
+ }, {
395
+ readonly title: "RoleMapReported";
396
+ readonly type: "object";
397
+ readonly additionalProperties: false;
398
+ readonly required: readonly ["type", "roleMap", "ladder"];
399
+ readonly properties: {
400
+ readonly type: {
401
+ readonly const: "roleMapReported";
402
+ };
403
+ readonly roleMap: {
404
+ readonly $ref: "#/$defs/RoleMap";
405
+ };
406
+ readonly ladder: {
407
+ readonly type: "array";
408
+ readonly minItems: 1;
409
+ readonly maxItems: 5;
410
+ readonly uniqueItems: true;
411
+ readonly description: "The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.";
412
+ readonly items: {
413
+ readonly $ref: "#/$defs/MappedRole";
414
+ };
415
+ };
416
+ readonly repos: {
417
+ readonly type: "array";
418
+ readonly maxItems: 1000;
419
+ readonly description: "Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.";
420
+ readonly items: {
421
+ readonly type: "object";
422
+ readonly additionalProperties: false;
423
+ readonly required: readonly ["resource", "roleMap"];
424
+ readonly properties: {
425
+ readonly resource: {
426
+ readonly $ref: "#/$defs/RepoResource";
427
+ };
428
+ readonly roleMap: {
429
+ readonly $ref: "#/$defs/RoleMap";
430
+ };
431
+ };
432
+ };
433
+ };
434
+ readonly stale: {
435
+ readonly type: "array";
436
+ readonly maxItems: 10000;
437
+ readonly uniqueItems: true;
438
+ readonly description: "Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.";
439
+ readonly items: {
440
+ readonly $ref: "#/$defs/RepoResource";
441
+ };
442
+ };
443
+ };
444
+ }, {
445
+ readonly title: "PullRequestOpened";
446
+ readonly type: "object";
447
+ readonly additionalProperties: false;
448
+ readonly required: readonly ["type", "forgeId", "resource", "number", "action", "author", "actor"];
449
+ readonly properties: {
450
+ readonly type: {
451
+ readonly const: "pullRequestOpened";
452
+ };
453
+ readonly forgeId: {
454
+ readonly $ref: "#/$defs/ForgeId";
455
+ readonly description: "The forge's id for the repository the pull request targets.";
456
+ };
457
+ readonly resource: {
458
+ readonly $ref: "#/$defs/RepoResource";
459
+ readonly description: "The repository the pull request targets (its base repository).";
460
+ };
461
+ readonly number: {
462
+ readonly type: "integer";
463
+ readonly minimum: 1;
464
+ readonly description: "The pull request's number in `resource`.";
465
+ };
466
+ readonly action: {
467
+ readonly title: "PullRequestAction";
468
+ readonly type: "string";
469
+ readonly enum: readonly ["opened", "reopened"];
470
+ readonly description: "`opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened.";
471
+ };
472
+ readonly author: {
473
+ readonly $ref: "#/$defs/ForgeAccount";
474
+ readonly description: "The account that opened the pull request.";
475
+ };
476
+ readonly actor: {
477
+ readonly $ref: "#/$defs/ForgeAccount";
478
+ readonly description: "The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`.";
479
+ };
480
+ readonly draft: {
481
+ readonly type: "boolean";
482
+ readonly description: "Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts.";
483
+ };
484
+ readonly fromFork: {
485
+ readonly type: "boolean";
486
+ readonly description: "Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know.";
487
+ };
488
+ };
489
+ }];
490
+ };
491
+ readonly Response: {
492
+ readonly $anchor: "response";
493
+ readonly title: "Git Namespaces — Bridge Event — response payload";
494
+ readonly description: "The VTC has recorded the event. Nothing else is returned.";
495
+ readonly type: "object";
496
+ readonly additionalProperties: false;
497
+ readonly required: readonly [];
498
+ readonly properties: {
499
+ readonly ext: {
500
+ readonly $ref: "#/$defs/Ext";
501
+ };
502
+ };
503
+ };
504
+ readonly MappedRole: {
505
+ readonly title: "MappedRole";
506
+ readonly type: "string";
507
+ readonly enum: readonly ["none", "read", "triage", "write", "maintain", "admin"];
508
+ readonly description: "A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository.";
509
+ };
510
+ readonly RoleMap: {
511
+ readonly title: "RoleMap";
512
+ readonly description: "The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.";
513
+ readonly type: "object";
514
+ readonly additionalProperties: false;
515
+ readonly required: readonly ["own", "maintain", "commit"];
516
+ readonly properties: {
517
+ readonly own: {
518
+ readonly $ref: "#/$defs/MappedRole";
519
+ };
520
+ readonly maintain: {
521
+ readonly $ref: "#/$defs/MappedRole";
522
+ };
523
+ readonly commit: {
524
+ readonly $ref: "#/$defs/MappedRole";
525
+ };
526
+ };
527
+ };
528
+ readonly Ext: {
529
+ readonly title: "Ext";
530
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
531
+ readonly type: "object";
532
+ readonly minProperties: 1;
533
+ readonly additionalProperties: true;
534
+ readonly propertyNames: {
535
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
536
+ };
537
+ };
538
+ readonly ForgeAccount: {
539
+ readonly title: "ForgeAccount";
540
+ readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
541
+ readonly type: "object";
542
+ readonly additionalProperties: false;
543
+ readonly required: readonly ["forge", "id", "login"];
544
+ readonly properties: {
545
+ readonly forge: {
546
+ readonly $ref: "#/$defs/ForgeHost";
547
+ };
548
+ readonly id: {
549
+ readonly $ref: "#/$defs/ForgeId";
550
+ };
551
+ readonly login: {
552
+ readonly type: "string";
553
+ readonly minLength: 1;
554
+ readonly maxLength: 100;
555
+ readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
556
+ };
557
+ };
558
+ };
559
+ readonly ForgeId: {
560
+ readonly title: "ForgeId";
561
+ readonly description: "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.";
562
+ readonly type: "string";
563
+ readonly minLength: 1;
564
+ readonly maxLength: 64;
565
+ };
566
+ readonly ForgeHost: {
567
+ readonly title: "ForgeHost";
568
+ readonly description: "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.";
569
+ readonly type: "string";
570
+ readonly minLength: 3;
571
+ readonly maxLength: 253;
572
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
573
+ };
574
+ readonly RepoResource: {
575
+ readonly title: "RepoResource";
576
+ readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
577
+ readonly type: "string";
578
+ readonly maxLength: 455;
579
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$";
580
+ };
581
+ readonly DriftItem: {
582
+ readonly title: "DriftItem";
583
+ readonly description: "One difference between the forge's observed state and the VTC's projection of a repository.";
584
+ readonly type: "object";
585
+ readonly additionalProperties: false;
586
+ readonly required: readonly ["type", "resource"];
587
+ readonly properties: {
588
+ readonly type: {
589
+ readonly type: "string";
590
+ readonly enum: readonly ["roleAdded", "roleRemoved", "roleChanged", "requiredCheckMissing", "protectionWeakened", "bootstrapMissing"];
591
+ readonly description: "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone.";
592
+ };
593
+ readonly resource: {
594
+ readonly $ref: "#/$defs/RepoResource";
595
+ };
596
+ readonly account: {
597
+ readonly $ref: "#/$defs/ForgeAccount";
598
+ readonly description: "Whose role differs, for the three role types.";
599
+ };
600
+ readonly observed: {
601
+ readonly type: "string";
602
+ readonly maxLength: 256;
603
+ readonly description: "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there.";
604
+ };
605
+ readonly expected: {
606
+ readonly type: "string";
607
+ readonly maxLength: 256;
608
+ readonly description: "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing.";
609
+ };
610
+ };
611
+ };
612
+ readonly NamespaceId: {
613
+ readonly title: "NamespaceId";
614
+ readonly description: "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.";
615
+ readonly type: "string";
616
+ readonly minLength: 1;
617
+ readonly maxLength: 128;
618
+ };
619
+ };
620
+ };
621
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
622
+ export declare const RESPONSE_PAYLOAD_SCHEMA: {
623
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
624
+ readonly $ref: "#/$defs/Response";
625
+ readonly $defs: {
626
+ readonly JobId: {
627
+ readonly type: "string";
628
+ readonly minLength: 1;
629
+ readonly maxLength: 128;
630
+ readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
631
+ };
632
+ readonly ForgeRole: {
633
+ readonly type: "string";
634
+ readonly minLength: 1;
635
+ readonly maxLength: 64;
636
+ readonly description: "A role in the forge's own vocabulary (`maintain`, `write`).";
637
+ };
638
+ readonly ForgeEvent: {
639
+ readonly title: "ForgeEvent";
640
+ readonly description: "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.";
641
+ readonly type: "object";
642
+ readonly oneOf: readonly [{
643
+ readonly title: "RepoRenamed";
644
+ readonly type: "object";
645
+ readonly additionalProperties: false;
646
+ readonly required: readonly ["type", "forgeId", "from", "to"];
647
+ readonly properties: {
648
+ readonly type: {
649
+ readonly const: "repoRenamed";
650
+ };
651
+ readonly forgeId: {
652
+ readonly $ref: "#/$defs/ForgeId";
653
+ };
654
+ readonly from: {
655
+ readonly $ref: "#/$defs/RepoResource";
656
+ };
657
+ readonly to: {
658
+ readonly $ref: "#/$defs/RepoResource";
659
+ };
660
+ };
661
+ }, {
662
+ readonly title: "RepoTransferred";
663
+ readonly type: "object";
664
+ readonly additionalProperties: false;
665
+ readonly required: readonly ["type", "forgeId", "from", "to"];
666
+ readonly properties: {
667
+ readonly type: {
668
+ readonly const: "repoTransferred";
669
+ };
670
+ readonly forgeId: {
671
+ readonly $ref: "#/$defs/ForgeId";
672
+ };
673
+ readonly from: {
674
+ readonly $ref: "#/$defs/RepoResource";
675
+ };
676
+ readonly to: {
677
+ readonly $ref: "#/$defs/RepoResource";
678
+ };
679
+ };
680
+ }, {
681
+ readonly title: "RepoCreatedUnmanaged";
682
+ readonly type: "object";
683
+ readonly additionalProperties: false;
684
+ readonly required: readonly ["type", "forgeId", "resource"];
685
+ readonly properties: {
686
+ readonly type: {
687
+ readonly const: "repoCreatedUnmanaged";
688
+ };
689
+ readonly forgeId: {
690
+ readonly $ref: "#/$defs/ForgeId";
691
+ };
692
+ readonly resource: {
693
+ readonly $ref: "#/$defs/RepoResource";
694
+ };
695
+ };
696
+ }, {
697
+ readonly title: "RepoDeleted";
698
+ readonly type: "object";
699
+ readonly additionalProperties: false;
700
+ readonly required: readonly ["type", "forgeId", "resource"];
701
+ readonly properties: {
702
+ readonly type: {
703
+ readonly const: "repoDeleted";
704
+ };
705
+ readonly forgeId: {
706
+ readonly $ref: "#/$defs/ForgeId";
707
+ };
708
+ readonly resource: {
709
+ readonly $ref: "#/$defs/RepoResource";
710
+ };
711
+ };
712
+ }, {
713
+ readonly title: "RoleChanged";
714
+ readonly type: "object";
715
+ readonly additionalProperties: false;
716
+ readonly required: readonly ["type", "forgeId", "resource", "account"];
717
+ readonly properties: {
718
+ readonly type: {
719
+ readonly const: "roleChanged";
720
+ };
721
+ readonly forgeId: {
722
+ readonly $ref: "#/$defs/ForgeId";
723
+ };
724
+ readonly resource: {
725
+ readonly $ref: "#/$defs/RepoResource";
726
+ };
727
+ readonly account: {
728
+ readonly $ref: "#/$defs/ForgeAccount";
729
+ };
730
+ readonly role: {
731
+ readonly $ref: "#/$defs/ForgeRole";
732
+ readonly description: "The role the account now holds. Absent: the account holds no role now.";
733
+ };
734
+ };
735
+ }, {
736
+ readonly title: "ProtectionChanged";
737
+ readonly type: "object";
738
+ readonly additionalProperties: false;
739
+ readonly required: readonly ["type", "forgeId", "resource", "requiredCheck"];
740
+ readonly properties: {
741
+ readonly type: {
742
+ readonly const: "protectionChanged";
743
+ };
744
+ readonly forgeId: {
745
+ readonly $ref: "#/$defs/ForgeId";
746
+ };
747
+ readonly resource: {
748
+ readonly $ref: "#/$defs/RepoResource";
749
+ };
750
+ readonly requiredCheck: {
751
+ readonly type: "boolean";
752
+ readonly description: "Whether the forge still refuses merges without a passing verify-trust check, with no bypass.";
753
+ };
754
+ };
755
+ }, {
756
+ readonly title: "InstallationRemoved";
757
+ readonly type: "object";
758
+ readonly additionalProperties: false;
759
+ readonly required: readonly ["type"];
760
+ readonly properties: {
761
+ readonly type: {
762
+ readonly const: "installationRemoved";
763
+ };
764
+ };
765
+ }, {
766
+ readonly title: "AccountLinked";
767
+ readonly type: "object";
768
+ readonly additionalProperties: false;
769
+ readonly required: readonly ["type", "jobId", "account"];
770
+ readonly properties: {
771
+ readonly type: {
772
+ readonly const: "accountLinked";
773
+ };
774
+ readonly jobId: {
775
+ readonly $ref: "#/$defs/JobId";
776
+ readonly description: "The beginAccountLink job.";
777
+ };
778
+ readonly account: {
779
+ readonly $ref: "#/$defs/ForgeAccount";
780
+ };
781
+ };
782
+ }, {
783
+ readonly title: "BindCompleted";
784
+ readonly type: "object";
785
+ readonly additionalProperties: false;
786
+ readonly required: readonly ["type", "jobId", "ownerId", "kind"];
787
+ readonly properties: {
788
+ readonly type: {
789
+ readonly const: "bindCompleted";
790
+ };
791
+ readonly jobId: {
792
+ readonly $ref: "#/$defs/JobId";
793
+ readonly description: "The beginBind job.";
794
+ };
795
+ readonly ownerId: {
796
+ readonly $ref: "#/$defs/ForgeId";
797
+ readonly description: "The forge's id for the owner, which survives renames.";
798
+ };
799
+ readonly kind: {
800
+ readonly type: "string";
801
+ readonly enum: readonly ["organization", "user"];
802
+ };
803
+ };
804
+ }, {
805
+ readonly title: "RoleMapReported";
806
+ readonly type: "object";
807
+ readonly additionalProperties: false;
808
+ readonly required: readonly ["type", "roleMap", "ladder"];
809
+ readonly properties: {
810
+ readonly type: {
811
+ readonly const: "roleMapReported";
812
+ };
813
+ readonly roleMap: {
814
+ readonly $ref: "#/$defs/RoleMap";
815
+ };
816
+ readonly ladder: {
817
+ readonly type: "array";
818
+ readonly minItems: 1;
819
+ readonly maxItems: 5;
820
+ readonly uniqueItems: true;
821
+ readonly description: "The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.";
822
+ readonly items: {
823
+ readonly $ref: "#/$defs/MappedRole";
824
+ };
825
+ };
826
+ readonly repos: {
827
+ readonly type: "array";
828
+ readonly maxItems: 1000;
829
+ readonly description: "Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.";
830
+ readonly items: {
831
+ readonly type: "object";
832
+ readonly additionalProperties: false;
833
+ readonly required: readonly ["resource", "roleMap"];
834
+ readonly properties: {
835
+ readonly resource: {
836
+ readonly $ref: "#/$defs/RepoResource";
837
+ };
838
+ readonly roleMap: {
839
+ readonly $ref: "#/$defs/RoleMap";
840
+ };
841
+ };
842
+ };
843
+ };
844
+ readonly stale: {
845
+ readonly type: "array";
846
+ readonly maxItems: 10000;
847
+ readonly uniqueItems: true;
848
+ readonly description: "Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.";
849
+ readonly items: {
850
+ readonly $ref: "#/$defs/RepoResource";
851
+ };
852
+ };
853
+ };
854
+ }, {
855
+ readonly title: "PullRequestOpened";
856
+ readonly type: "object";
857
+ readonly additionalProperties: false;
858
+ readonly required: readonly ["type", "forgeId", "resource", "number", "action", "author", "actor"];
859
+ readonly properties: {
860
+ readonly type: {
861
+ readonly const: "pullRequestOpened";
862
+ };
863
+ readonly forgeId: {
864
+ readonly $ref: "#/$defs/ForgeId";
865
+ readonly description: "The forge's id for the repository the pull request targets.";
866
+ };
867
+ readonly resource: {
868
+ readonly $ref: "#/$defs/RepoResource";
869
+ readonly description: "The repository the pull request targets (its base repository).";
870
+ };
871
+ readonly number: {
872
+ readonly type: "integer";
873
+ readonly minimum: 1;
874
+ readonly description: "The pull request's number in `resource`.";
875
+ };
876
+ readonly action: {
877
+ readonly title: "PullRequestAction";
878
+ readonly type: "string";
879
+ readonly enum: readonly ["opened", "reopened"];
880
+ readonly description: "`opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened.";
881
+ };
882
+ readonly author: {
883
+ readonly $ref: "#/$defs/ForgeAccount";
884
+ readonly description: "The account that opened the pull request.";
885
+ };
886
+ readonly actor: {
887
+ readonly $ref: "#/$defs/ForgeAccount";
888
+ readonly description: "The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`.";
889
+ };
890
+ readonly draft: {
891
+ readonly type: "boolean";
892
+ readonly description: "Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts.";
893
+ };
894
+ readonly fromFork: {
895
+ readonly type: "boolean";
896
+ readonly description: "Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know.";
897
+ };
898
+ };
899
+ }];
900
+ };
901
+ readonly Response: {
902
+ readonly $anchor: "response";
903
+ readonly title: "Git Namespaces — Bridge Event — response payload";
904
+ readonly description: "The VTC has recorded the event. Nothing else is returned.";
905
+ readonly type: "object";
906
+ readonly additionalProperties: false;
907
+ readonly required: readonly [];
908
+ readonly properties: {
909
+ readonly ext: {
910
+ readonly $ref: "#/$defs/Ext";
911
+ };
912
+ };
913
+ };
914
+ readonly MappedRole: {
915
+ readonly title: "MappedRole";
916
+ readonly type: "string";
917
+ readonly enum: readonly ["none", "read", "triage", "write", "maintain", "admin"];
918
+ readonly description: "A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository.";
919
+ };
920
+ readonly RoleMap: {
921
+ readonly title: "RoleMap";
922
+ readonly description: "The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.";
923
+ readonly type: "object";
924
+ readonly additionalProperties: false;
925
+ readonly required: readonly ["own", "maintain", "commit"];
926
+ readonly properties: {
927
+ readonly own: {
928
+ readonly $ref: "#/$defs/MappedRole";
929
+ };
930
+ readonly maintain: {
931
+ readonly $ref: "#/$defs/MappedRole";
932
+ };
933
+ readonly commit: {
934
+ readonly $ref: "#/$defs/MappedRole";
935
+ };
936
+ };
937
+ };
938
+ readonly Ext: {
939
+ readonly title: "Ext";
940
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
941
+ readonly type: "object";
942
+ readonly minProperties: 1;
943
+ readonly additionalProperties: true;
944
+ readonly propertyNames: {
945
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
946
+ };
947
+ };
948
+ readonly ForgeAccount: {
949
+ readonly title: "ForgeAccount";
950
+ readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
951
+ readonly type: "object";
952
+ readonly additionalProperties: false;
953
+ readonly required: readonly ["forge", "id", "login"];
954
+ readonly properties: {
955
+ readonly forge: {
956
+ readonly $ref: "#/$defs/ForgeHost";
957
+ };
958
+ readonly id: {
959
+ readonly $ref: "#/$defs/ForgeId";
960
+ };
961
+ readonly login: {
962
+ readonly type: "string";
963
+ readonly minLength: 1;
964
+ readonly maxLength: 100;
965
+ readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
966
+ };
967
+ };
968
+ };
969
+ readonly ForgeId: {
970
+ readonly title: "ForgeId";
971
+ readonly description: "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.";
972
+ readonly type: "string";
973
+ readonly minLength: 1;
974
+ readonly maxLength: 64;
975
+ };
976
+ readonly ForgeHost: {
977
+ readonly title: "ForgeHost";
978
+ readonly description: "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.";
979
+ readonly type: "string";
980
+ readonly minLength: 3;
981
+ readonly maxLength: 253;
982
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
983
+ };
984
+ readonly RepoResource: {
985
+ readonly title: "RepoResource";
986
+ readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
987
+ readonly type: "string";
988
+ readonly maxLength: 455;
989
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$";
990
+ };
991
+ readonly DriftItem: {
992
+ readonly title: "DriftItem";
993
+ readonly description: "One difference between the forge's observed state and the VTC's projection of a repository.";
994
+ readonly type: "object";
995
+ readonly additionalProperties: false;
996
+ readonly required: readonly ["type", "resource"];
997
+ readonly properties: {
998
+ readonly type: {
999
+ readonly type: "string";
1000
+ readonly enum: readonly ["roleAdded", "roleRemoved", "roleChanged", "requiredCheckMissing", "protectionWeakened", "bootstrapMissing"];
1001
+ readonly description: "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone.";
1002
+ };
1003
+ readonly resource: {
1004
+ readonly $ref: "#/$defs/RepoResource";
1005
+ };
1006
+ readonly account: {
1007
+ readonly $ref: "#/$defs/ForgeAccount";
1008
+ readonly description: "Whose role differs, for the three role types.";
1009
+ };
1010
+ readonly observed: {
1011
+ readonly type: "string";
1012
+ readonly maxLength: 256;
1013
+ readonly description: "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there.";
1014
+ };
1015
+ readonly expected: {
1016
+ readonly type: "string";
1017
+ readonly maxLength: 256;
1018
+ readonly description: "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing.";
1019
+ };
1020
+ };
1021
+ };
1022
+ readonly NamespaceId: {
1023
+ readonly title: "NamespaceId";
1024
+ readonly description: "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.";
1025
+ readonly type: "string";
1026
+ readonly minLength: 1;
1027
+ readonly maxLength: 128;
1028
+ };
1029
+ };
1030
+ };
1031
+ /**
1032
+ * SPEC.md §7.2 policy for the request variant, from this specification's
1033
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
1034
+ * per-specification and cannot be derived from the document alone, and
1035
+ * item 2 needs the schema this carries.
1036
+ */
1037
+ export declare const SPEC: {
1038
+ readonly typeUri: "https://trusttasks.org/spec/git-ns/bridge/event/0.4";
1039
+ readonly isBearer: false;
1040
+ readonly isProofRequired: true;
1041
+ readonly isRecipientRequired: true;
1042
+ readonly isIssuedAtRequired: true;
1043
+ readonly payloadSchema: {
1044
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1045
+ readonly $id: "https://trusttasks.org/spec/git-ns/bridge/event/0.4";
1046
+ readonly title: "Git Namespaces — Bridge Event — payload";
1047
+ readonly description: "The bridge tells the VTC something happened on the forge — translated from the forge's webhook or found by an inspection sweep — together with any drift it now sees; or reports the role map it projects with, or a pull request opened or reopened on a governed repository.";
1048
+ readonly type: "object";
1049
+ readonly additionalProperties: false;
1050
+ readonly required: readonly ["namespace", "event"];
1051
+ readonly properties: {
1052
+ readonly namespace: {
1053
+ readonly $ref: "#/$defs/NamespaceId";
1054
+ readonly description: "The namespace the event happened in.";
1055
+ };
1056
+ readonly event: {
1057
+ readonly $ref: "#/$defs/ForgeEvent";
1058
+ };
1059
+ readonly drift: {
1060
+ readonly type: "array";
1061
+ readonly items: {
1062
+ readonly $ref: "#/$defs/DriftItem";
1063
+ };
1064
+ readonly description: "The complete outstanding drift for each repository the event concerns, replacing what the VTC held for those repositories. Absent: the event changes no repository's drift.";
1065
+ };
1066
+ readonly ext: {
1067
+ readonly $ref: "#/$defs/Ext";
1068
+ };
1069
+ };
1070
+ readonly $defs: {
1071
+ readonly JobId: {
1072
+ readonly type: "string";
1073
+ readonly minLength: 1;
1074
+ readonly maxLength: 128;
1075
+ readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
1076
+ };
1077
+ readonly ForgeRole: {
1078
+ readonly type: "string";
1079
+ readonly minLength: 1;
1080
+ readonly maxLength: 64;
1081
+ readonly description: "A role in the forge's own vocabulary (`maintain`, `write`).";
1082
+ };
1083
+ readonly ForgeEvent: {
1084
+ readonly title: "ForgeEvent";
1085
+ readonly description: "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.";
1086
+ readonly type: "object";
1087
+ readonly oneOf: readonly [{
1088
+ readonly title: "RepoRenamed";
1089
+ readonly type: "object";
1090
+ readonly additionalProperties: false;
1091
+ readonly required: readonly ["type", "forgeId", "from", "to"];
1092
+ readonly properties: {
1093
+ readonly type: {
1094
+ readonly const: "repoRenamed";
1095
+ };
1096
+ readonly forgeId: {
1097
+ readonly $ref: "#/$defs/ForgeId";
1098
+ };
1099
+ readonly from: {
1100
+ readonly $ref: "#/$defs/RepoResource";
1101
+ };
1102
+ readonly to: {
1103
+ readonly $ref: "#/$defs/RepoResource";
1104
+ };
1105
+ };
1106
+ }, {
1107
+ readonly title: "RepoTransferred";
1108
+ readonly type: "object";
1109
+ readonly additionalProperties: false;
1110
+ readonly required: readonly ["type", "forgeId", "from", "to"];
1111
+ readonly properties: {
1112
+ readonly type: {
1113
+ readonly const: "repoTransferred";
1114
+ };
1115
+ readonly forgeId: {
1116
+ readonly $ref: "#/$defs/ForgeId";
1117
+ };
1118
+ readonly from: {
1119
+ readonly $ref: "#/$defs/RepoResource";
1120
+ };
1121
+ readonly to: {
1122
+ readonly $ref: "#/$defs/RepoResource";
1123
+ };
1124
+ };
1125
+ }, {
1126
+ readonly title: "RepoCreatedUnmanaged";
1127
+ readonly type: "object";
1128
+ readonly additionalProperties: false;
1129
+ readonly required: readonly ["type", "forgeId", "resource"];
1130
+ readonly properties: {
1131
+ readonly type: {
1132
+ readonly const: "repoCreatedUnmanaged";
1133
+ };
1134
+ readonly forgeId: {
1135
+ readonly $ref: "#/$defs/ForgeId";
1136
+ };
1137
+ readonly resource: {
1138
+ readonly $ref: "#/$defs/RepoResource";
1139
+ };
1140
+ };
1141
+ }, {
1142
+ readonly title: "RepoDeleted";
1143
+ readonly type: "object";
1144
+ readonly additionalProperties: false;
1145
+ readonly required: readonly ["type", "forgeId", "resource"];
1146
+ readonly properties: {
1147
+ readonly type: {
1148
+ readonly const: "repoDeleted";
1149
+ };
1150
+ readonly forgeId: {
1151
+ readonly $ref: "#/$defs/ForgeId";
1152
+ };
1153
+ readonly resource: {
1154
+ readonly $ref: "#/$defs/RepoResource";
1155
+ };
1156
+ };
1157
+ }, {
1158
+ readonly title: "RoleChanged";
1159
+ readonly type: "object";
1160
+ readonly additionalProperties: false;
1161
+ readonly required: readonly ["type", "forgeId", "resource", "account"];
1162
+ readonly properties: {
1163
+ readonly type: {
1164
+ readonly const: "roleChanged";
1165
+ };
1166
+ readonly forgeId: {
1167
+ readonly $ref: "#/$defs/ForgeId";
1168
+ };
1169
+ readonly resource: {
1170
+ readonly $ref: "#/$defs/RepoResource";
1171
+ };
1172
+ readonly account: {
1173
+ readonly $ref: "#/$defs/ForgeAccount";
1174
+ };
1175
+ readonly role: {
1176
+ readonly $ref: "#/$defs/ForgeRole";
1177
+ readonly description: "The role the account now holds. Absent: the account holds no role now.";
1178
+ };
1179
+ };
1180
+ }, {
1181
+ readonly title: "ProtectionChanged";
1182
+ readonly type: "object";
1183
+ readonly additionalProperties: false;
1184
+ readonly required: readonly ["type", "forgeId", "resource", "requiredCheck"];
1185
+ readonly properties: {
1186
+ readonly type: {
1187
+ readonly const: "protectionChanged";
1188
+ };
1189
+ readonly forgeId: {
1190
+ readonly $ref: "#/$defs/ForgeId";
1191
+ };
1192
+ readonly resource: {
1193
+ readonly $ref: "#/$defs/RepoResource";
1194
+ };
1195
+ readonly requiredCheck: {
1196
+ readonly type: "boolean";
1197
+ readonly description: "Whether the forge still refuses merges without a passing verify-trust check, with no bypass.";
1198
+ };
1199
+ };
1200
+ }, {
1201
+ readonly title: "InstallationRemoved";
1202
+ readonly type: "object";
1203
+ readonly additionalProperties: false;
1204
+ readonly required: readonly ["type"];
1205
+ readonly properties: {
1206
+ readonly type: {
1207
+ readonly const: "installationRemoved";
1208
+ };
1209
+ };
1210
+ }, {
1211
+ readonly title: "AccountLinked";
1212
+ readonly type: "object";
1213
+ readonly additionalProperties: false;
1214
+ readonly required: readonly ["type", "jobId", "account"];
1215
+ readonly properties: {
1216
+ readonly type: {
1217
+ readonly const: "accountLinked";
1218
+ };
1219
+ readonly jobId: {
1220
+ readonly $ref: "#/$defs/JobId";
1221
+ readonly description: "The beginAccountLink job.";
1222
+ };
1223
+ readonly account: {
1224
+ readonly $ref: "#/$defs/ForgeAccount";
1225
+ };
1226
+ };
1227
+ }, {
1228
+ readonly title: "BindCompleted";
1229
+ readonly type: "object";
1230
+ readonly additionalProperties: false;
1231
+ readonly required: readonly ["type", "jobId", "ownerId", "kind"];
1232
+ readonly properties: {
1233
+ readonly type: {
1234
+ readonly const: "bindCompleted";
1235
+ };
1236
+ readonly jobId: {
1237
+ readonly $ref: "#/$defs/JobId";
1238
+ readonly description: "The beginBind job.";
1239
+ };
1240
+ readonly ownerId: {
1241
+ readonly $ref: "#/$defs/ForgeId";
1242
+ readonly description: "The forge's id for the owner, which survives renames.";
1243
+ };
1244
+ readonly kind: {
1245
+ readonly type: "string";
1246
+ readonly enum: readonly ["organization", "user"];
1247
+ };
1248
+ };
1249
+ }, {
1250
+ readonly title: "RoleMapReported";
1251
+ readonly type: "object";
1252
+ readonly additionalProperties: false;
1253
+ readonly required: readonly ["type", "roleMap", "ladder"];
1254
+ readonly properties: {
1255
+ readonly type: {
1256
+ readonly const: "roleMapReported";
1257
+ };
1258
+ readonly roleMap: {
1259
+ readonly $ref: "#/$defs/RoleMap";
1260
+ };
1261
+ readonly ladder: {
1262
+ readonly type: "array";
1263
+ readonly minItems: 1;
1264
+ readonly maxItems: 5;
1265
+ readonly uniqueItems: true;
1266
+ readonly description: "The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.";
1267
+ readonly items: {
1268
+ readonly $ref: "#/$defs/MappedRole";
1269
+ };
1270
+ };
1271
+ readonly repos: {
1272
+ readonly type: "array";
1273
+ readonly maxItems: 1000;
1274
+ readonly description: "Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.";
1275
+ readonly items: {
1276
+ readonly type: "object";
1277
+ readonly additionalProperties: false;
1278
+ readonly required: readonly ["resource", "roleMap"];
1279
+ readonly properties: {
1280
+ readonly resource: {
1281
+ readonly $ref: "#/$defs/RepoResource";
1282
+ };
1283
+ readonly roleMap: {
1284
+ readonly $ref: "#/$defs/RoleMap";
1285
+ };
1286
+ };
1287
+ };
1288
+ };
1289
+ readonly stale: {
1290
+ readonly type: "array";
1291
+ readonly maxItems: 10000;
1292
+ readonly uniqueItems: true;
1293
+ readonly description: "Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.";
1294
+ readonly items: {
1295
+ readonly $ref: "#/$defs/RepoResource";
1296
+ };
1297
+ };
1298
+ };
1299
+ }, {
1300
+ readonly title: "PullRequestOpened";
1301
+ readonly type: "object";
1302
+ readonly additionalProperties: false;
1303
+ readonly required: readonly ["type", "forgeId", "resource", "number", "action", "author", "actor"];
1304
+ readonly properties: {
1305
+ readonly type: {
1306
+ readonly const: "pullRequestOpened";
1307
+ };
1308
+ readonly forgeId: {
1309
+ readonly $ref: "#/$defs/ForgeId";
1310
+ readonly description: "The forge's id for the repository the pull request targets.";
1311
+ };
1312
+ readonly resource: {
1313
+ readonly $ref: "#/$defs/RepoResource";
1314
+ readonly description: "The repository the pull request targets (its base repository).";
1315
+ };
1316
+ readonly number: {
1317
+ readonly type: "integer";
1318
+ readonly minimum: 1;
1319
+ readonly description: "The pull request's number in `resource`.";
1320
+ };
1321
+ readonly action: {
1322
+ readonly title: "PullRequestAction";
1323
+ readonly type: "string";
1324
+ readonly enum: readonly ["opened", "reopened"];
1325
+ readonly description: "`opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened.";
1326
+ };
1327
+ readonly author: {
1328
+ readonly $ref: "#/$defs/ForgeAccount";
1329
+ readonly description: "The account that opened the pull request.";
1330
+ };
1331
+ readonly actor: {
1332
+ readonly $ref: "#/$defs/ForgeAccount";
1333
+ readonly description: "The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`.";
1334
+ };
1335
+ readonly draft: {
1336
+ readonly type: "boolean";
1337
+ readonly description: "Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts.";
1338
+ };
1339
+ readonly fromFork: {
1340
+ readonly type: "boolean";
1341
+ readonly description: "Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know.";
1342
+ };
1343
+ };
1344
+ }];
1345
+ };
1346
+ readonly Response: {
1347
+ readonly $anchor: "response";
1348
+ readonly title: "Git Namespaces — Bridge Event — response payload";
1349
+ readonly description: "The VTC has recorded the event. Nothing else is returned.";
1350
+ readonly type: "object";
1351
+ readonly additionalProperties: false;
1352
+ readonly required: readonly [];
1353
+ readonly properties: {
1354
+ readonly ext: {
1355
+ readonly $ref: "#/$defs/Ext";
1356
+ };
1357
+ };
1358
+ };
1359
+ readonly MappedRole: {
1360
+ readonly title: "MappedRole";
1361
+ readonly type: "string";
1362
+ readonly enum: readonly ["none", "read", "triage", "write", "maintain", "admin"];
1363
+ readonly description: "A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository.";
1364
+ };
1365
+ readonly RoleMap: {
1366
+ readonly title: "RoleMap";
1367
+ readonly description: "The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.";
1368
+ readonly type: "object";
1369
+ readonly additionalProperties: false;
1370
+ readonly required: readonly ["own", "maintain", "commit"];
1371
+ readonly properties: {
1372
+ readonly own: {
1373
+ readonly $ref: "#/$defs/MappedRole";
1374
+ };
1375
+ readonly maintain: {
1376
+ readonly $ref: "#/$defs/MappedRole";
1377
+ };
1378
+ readonly commit: {
1379
+ readonly $ref: "#/$defs/MappedRole";
1380
+ };
1381
+ };
1382
+ };
1383
+ readonly Ext: {
1384
+ readonly title: "Ext";
1385
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
1386
+ readonly type: "object";
1387
+ readonly minProperties: 1;
1388
+ readonly additionalProperties: true;
1389
+ readonly propertyNames: {
1390
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1391
+ };
1392
+ };
1393
+ readonly ForgeAccount: {
1394
+ readonly title: "ForgeAccount";
1395
+ readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
1396
+ readonly type: "object";
1397
+ readonly additionalProperties: false;
1398
+ readonly required: readonly ["forge", "id", "login"];
1399
+ readonly properties: {
1400
+ readonly forge: {
1401
+ readonly $ref: "#/$defs/ForgeHost";
1402
+ };
1403
+ readonly id: {
1404
+ readonly $ref: "#/$defs/ForgeId";
1405
+ };
1406
+ readonly login: {
1407
+ readonly type: "string";
1408
+ readonly minLength: 1;
1409
+ readonly maxLength: 100;
1410
+ readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
1411
+ };
1412
+ };
1413
+ };
1414
+ readonly ForgeId: {
1415
+ readonly title: "ForgeId";
1416
+ readonly description: "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.";
1417
+ readonly type: "string";
1418
+ readonly minLength: 1;
1419
+ readonly maxLength: 64;
1420
+ };
1421
+ readonly ForgeHost: {
1422
+ readonly title: "ForgeHost";
1423
+ readonly description: "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.";
1424
+ readonly type: "string";
1425
+ readonly minLength: 3;
1426
+ readonly maxLength: 253;
1427
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
1428
+ };
1429
+ readonly RepoResource: {
1430
+ readonly title: "RepoResource";
1431
+ readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
1432
+ readonly type: "string";
1433
+ readonly maxLength: 455;
1434
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$";
1435
+ };
1436
+ readonly DriftItem: {
1437
+ readonly title: "DriftItem";
1438
+ readonly description: "One difference between the forge's observed state and the VTC's projection of a repository.";
1439
+ readonly type: "object";
1440
+ readonly additionalProperties: false;
1441
+ readonly required: readonly ["type", "resource"];
1442
+ readonly properties: {
1443
+ readonly type: {
1444
+ readonly type: "string";
1445
+ readonly enum: readonly ["roleAdded", "roleRemoved", "roleChanged", "requiredCheckMissing", "protectionWeakened", "bootstrapMissing"];
1446
+ readonly description: "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone.";
1447
+ };
1448
+ readonly resource: {
1449
+ readonly $ref: "#/$defs/RepoResource";
1450
+ };
1451
+ readonly account: {
1452
+ readonly $ref: "#/$defs/ForgeAccount";
1453
+ readonly description: "Whose role differs, for the three role types.";
1454
+ };
1455
+ readonly observed: {
1456
+ readonly type: "string";
1457
+ readonly maxLength: 256;
1458
+ readonly description: "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there.";
1459
+ };
1460
+ readonly expected: {
1461
+ readonly type: "string";
1462
+ readonly maxLength: 256;
1463
+ readonly description: "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing.";
1464
+ };
1465
+ };
1466
+ };
1467
+ readonly NamespaceId: {
1468
+ readonly title: "NamespaceId";
1469
+ readonly description: "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.";
1470
+ readonly type: "string";
1471
+ readonly minLength: 1;
1472
+ readonly maxLength: 128;
1473
+ };
1474
+ };
1475
+ };
1476
+ };
1477
+ /**
1478
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
1479
+ * tracks the *issuer* party's requirement because a response swaps the
1480
+ * parties (§7.3 item 5).
1481
+ */
1482
+ export declare const RESPONSE_SPEC: {
1483
+ readonly typeUri: "https://trusttasks.org/spec/git-ns/bridge/event/0.4#response";
1484
+ readonly isBearer: false;
1485
+ readonly isProofRequired: true;
1486
+ readonly isRecipientRequired: true;
1487
+ readonly isIssuedAtRequired: true;
1488
+ readonly payloadSchema: {
1489
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
1490
+ readonly $ref: "#/$defs/Response";
1491
+ readonly $defs: {
1492
+ readonly JobId: {
1493
+ readonly type: "string";
1494
+ readonly minLength: 1;
1495
+ readonly maxLength: 128;
1496
+ readonly description: "The VTC's identifier for a job, unique across the VTC's jobs.";
1497
+ };
1498
+ readonly ForgeRole: {
1499
+ readonly type: "string";
1500
+ readonly minLength: 1;
1501
+ readonly maxLength: 64;
1502
+ readonly description: "A role in the forge's own vocabulary (`maintain`, `write`).";
1503
+ };
1504
+ readonly ForgeEvent: {
1505
+ readonly title: "ForgeEvent";
1506
+ readonly description: "One forge-neutral event, discriminated by `type`. The specification's event table says what each type means and what the VTC does with it.";
1507
+ readonly type: "object";
1508
+ readonly oneOf: readonly [{
1509
+ readonly title: "RepoRenamed";
1510
+ readonly type: "object";
1511
+ readonly additionalProperties: false;
1512
+ readonly required: readonly ["type", "forgeId", "from", "to"];
1513
+ readonly properties: {
1514
+ readonly type: {
1515
+ readonly const: "repoRenamed";
1516
+ };
1517
+ readonly forgeId: {
1518
+ readonly $ref: "#/$defs/ForgeId";
1519
+ };
1520
+ readonly from: {
1521
+ readonly $ref: "#/$defs/RepoResource";
1522
+ };
1523
+ readonly to: {
1524
+ readonly $ref: "#/$defs/RepoResource";
1525
+ };
1526
+ };
1527
+ }, {
1528
+ readonly title: "RepoTransferred";
1529
+ readonly type: "object";
1530
+ readonly additionalProperties: false;
1531
+ readonly required: readonly ["type", "forgeId", "from", "to"];
1532
+ readonly properties: {
1533
+ readonly type: {
1534
+ readonly const: "repoTransferred";
1535
+ };
1536
+ readonly forgeId: {
1537
+ readonly $ref: "#/$defs/ForgeId";
1538
+ };
1539
+ readonly from: {
1540
+ readonly $ref: "#/$defs/RepoResource";
1541
+ };
1542
+ readonly to: {
1543
+ readonly $ref: "#/$defs/RepoResource";
1544
+ };
1545
+ };
1546
+ }, {
1547
+ readonly title: "RepoCreatedUnmanaged";
1548
+ readonly type: "object";
1549
+ readonly additionalProperties: false;
1550
+ readonly required: readonly ["type", "forgeId", "resource"];
1551
+ readonly properties: {
1552
+ readonly type: {
1553
+ readonly const: "repoCreatedUnmanaged";
1554
+ };
1555
+ readonly forgeId: {
1556
+ readonly $ref: "#/$defs/ForgeId";
1557
+ };
1558
+ readonly resource: {
1559
+ readonly $ref: "#/$defs/RepoResource";
1560
+ };
1561
+ };
1562
+ }, {
1563
+ readonly title: "RepoDeleted";
1564
+ readonly type: "object";
1565
+ readonly additionalProperties: false;
1566
+ readonly required: readonly ["type", "forgeId", "resource"];
1567
+ readonly properties: {
1568
+ readonly type: {
1569
+ readonly const: "repoDeleted";
1570
+ };
1571
+ readonly forgeId: {
1572
+ readonly $ref: "#/$defs/ForgeId";
1573
+ };
1574
+ readonly resource: {
1575
+ readonly $ref: "#/$defs/RepoResource";
1576
+ };
1577
+ };
1578
+ }, {
1579
+ readonly title: "RoleChanged";
1580
+ readonly type: "object";
1581
+ readonly additionalProperties: false;
1582
+ readonly required: readonly ["type", "forgeId", "resource", "account"];
1583
+ readonly properties: {
1584
+ readonly type: {
1585
+ readonly const: "roleChanged";
1586
+ };
1587
+ readonly forgeId: {
1588
+ readonly $ref: "#/$defs/ForgeId";
1589
+ };
1590
+ readonly resource: {
1591
+ readonly $ref: "#/$defs/RepoResource";
1592
+ };
1593
+ readonly account: {
1594
+ readonly $ref: "#/$defs/ForgeAccount";
1595
+ };
1596
+ readonly role: {
1597
+ readonly $ref: "#/$defs/ForgeRole";
1598
+ readonly description: "The role the account now holds. Absent: the account holds no role now.";
1599
+ };
1600
+ };
1601
+ }, {
1602
+ readonly title: "ProtectionChanged";
1603
+ readonly type: "object";
1604
+ readonly additionalProperties: false;
1605
+ readonly required: readonly ["type", "forgeId", "resource", "requiredCheck"];
1606
+ readonly properties: {
1607
+ readonly type: {
1608
+ readonly const: "protectionChanged";
1609
+ };
1610
+ readonly forgeId: {
1611
+ readonly $ref: "#/$defs/ForgeId";
1612
+ };
1613
+ readonly resource: {
1614
+ readonly $ref: "#/$defs/RepoResource";
1615
+ };
1616
+ readonly requiredCheck: {
1617
+ readonly type: "boolean";
1618
+ readonly description: "Whether the forge still refuses merges without a passing verify-trust check, with no bypass.";
1619
+ };
1620
+ };
1621
+ }, {
1622
+ readonly title: "InstallationRemoved";
1623
+ readonly type: "object";
1624
+ readonly additionalProperties: false;
1625
+ readonly required: readonly ["type"];
1626
+ readonly properties: {
1627
+ readonly type: {
1628
+ readonly const: "installationRemoved";
1629
+ };
1630
+ };
1631
+ }, {
1632
+ readonly title: "AccountLinked";
1633
+ readonly type: "object";
1634
+ readonly additionalProperties: false;
1635
+ readonly required: readonly ["type", "jobId", "account"];
1636
+ readonly properties: {
1637
+ readonly type: {
1638
+ readonly const: "accountLinked";
1639
+ };
1640
+ readonly jobId: {
1641
+ readonly $ref: "#/$defs/JobId";
1642
+ readonly description: "The beginAccountLink job.";
1643
+ };
1644
+ readonly account: {
1645
+ readonly $ref: "#/$defs/ForgeAccount";
1646
+ };
1647
+ };
1648
+ }, {
1649
+ readonly title: "BindCompleted";
1650
+ readonly type: "object";
1651
+ readonly additionalProperties: false;
1652
+ readonly required: readonly ["type", "jobId", "ownerId", "kind"];
1653
+ readonly properties: {
1654
+ readonly type: {
1655
+ readonly const: "bindCompleted";
1656
+ };
1657
+ readonly jobId: {
1658
+ readonly $ref: "#/$defs/JobId";
1659
+ readonly description: "The beginBind job.";
1660
+ };
1661
+ readonly ownerId: {
1662
+ readonly $ref: "#/$defs/ForgeId";
1663
+ readonly description: "The forge's id for the owner, which survives renames.";
1664
+ };
1665
+ readonly kind: {
1666
+ readonly type: "string";
1667
+ readonly enum: readonly ["organization", "user"];
1668
+ };
1669
+ };
1670
+ }, {
1671
+ readonly title: "RoleMapReported";
1672
+ readonly type: "object";
1673
+ readonly additionalProperties: false;
1674
+ readonly required: readonly ["type", "roleMap", "ladder"];
1675
+ readonly properties: {
1676
+ readonly type: {
1677
+ readonly const: "roleMapReported";
1678
+ };
1679
+ readonly roleMap: {
1680
+ readonly $ref: "#/$defs/RoleMap";
1681
+ };
1682
+ readonly ladder: {
1683
+ readonly type: "array";
1684
+ readonly minItems: 1;
1685
+ readonly maxItems: 5;
1686
+ readonly uniqueItems: true;
1687
+ readonly description: "The levels the forge offers as a direct role on a repository in the namespace, lowest first, without `none` (which every forge has). Every role in `roleMap` and in each `repos[].roleMap` is `none` or one of these.";
1688
+ readonly items: {
1689
+ readonly $ref: "#/$defs/MappedRole";
1690
+ };
1691
+ };
1692
+ readonly repos: {
1693
+ readonly type: "array";
1694
+ readonly maxItems: 1000;
1695
+ readonly description: "Repositories whose own map differs from `roleMap`, each at most once. Absent or empty: every repository uses `roleMap`.";
1696
+ readonly items: {
1697
+ readonly type: "object";
1698
+ readonly additionalProperties: false;
1699
+ readonly required: readonly ["resource", "roleMap"];
1700
+ readonly properties: {
1701
+ readonly resource: {
1702
+ readonly $ref: "#/$defs/RepoResource";
1703
+ };
1704
+ readonly roleMap: {
1705
+ readonly $ref: "#/$defs/RoleMap";
1706
+ };
1707
+ };
1708
+ };
1709
+ };
1710
+ readonly stale: {
1711
+ readonly type: "array";
1712
+ readonly maxItems: 10000;
1713
+ readonly uniqueItems: true;
1714
+ readonly description: "Repositories whose forge roles the bridge last projected under a different map from the one it now applies to them. Absent or empty: none.";
1715
+ readonly items: {
1716
+ readonly $ref: "#/$defs/RepoResource";
1717
+ };
1718
+ };
1719
+ };
1720
+ }, {
1721
+ readonly title: "PullRequestOpened";
1722
+ readonly type: "object";
1723
+ readonly additionalProperties: false;
1724
+ readonly required: readonly ["type", "forgeId", "resource", "number", "action", "author", "actor"];
1725
+ readonly properties: {
1726
+ readonly type: {
1727
+ readonly const: "pullRequestOpened";
1728
+ };
1729
+ readonly forgeId: {
1730
+ readonly $ref: "#/$defs/ForgeId";
1731
+ readonly description: "The forge's id for the repository the pull request targets.";
1732
+ };
1733
+ readonly resource: {
1734
+ readonly $ref: "#/$defs/RepoResource";
1735
+ readonly description: "The repository the pull request targets (its base repository).";
1736
+ };
1737
+ readonly number: {
1738
+ readonly type: "integer";
1739
+ readonly minimum: 1;
1740
+ readonly description: "The pull request's number in `resource`.";
1741
+ };
1742
+ readonly action: {
1743
+ readonly title: "PullRequestAction";
1744
+ readonly type: "string";
1745
+ readonly enum: readonly ["opened", "reopened"];
1746
+ readonly description: "`opened` — the pull request was just opened. `reopened` — a closed, unmerged pull request was reopened.";
1747
+ };
1748
+ readonly author: {
1749
+ readonly $ref: "#/$defs/ForgeAccount";
1750
+ readonly description: "The account that opened the pull request.";
1751
+ };
1752
+ readonly actor: {
1753
+ readonly $ref: "#/$defs/ForgeAccount";
1754
+ readonly description: "The account that performed this action: the author for `opened`, whoever reopened the pull request for `reopened`.";
1755
+ };
1756
+ readonly draft: {
1757
+ readonly type: "boolean";
1758
+ readonly description: "Whether the pull request is a draft. Absent: the bridge does not know, or the forge has no drafts.";
1759
+ };
1760
+ readonly fromFork: {
1761
+ readonly type: "boolean";
1762
+ readonly description: "Whether the pull request's head branch lives in another repository (a fork). Absent: the bridge does not know.";
1763
+ };
1764
+ };
1765
+ }];
1766
+ };
1767
+ readonly Response: {
1768
+ readonly $anchor: "response";
1769
+ readonly title: "Git Namespaces — Bridge Event — response payload";
1770
+ readonly description: "The VTC has recorded the event. Nothing else is returned.";
1771
+ readonly type: "object";
1772
+ readonly additionalProperties: false;
1773
+ readonly required: readonly [];
1774
+ readonly properties: {
1775
+ readonly ext: {
1776
+ readonly $ref: "#/$defs/Ext";
1777
+ };
1778
+ };
1779
+ };
1780
+ readonly MappedRole: {
1781
+ readonly title: "MappedRole";
1782
+ readonly type: "string";
1783
+ readonly enum: readonly ["none", "read", "triage", "write", "maintain", "admin"];
1784
+ readonly description: "A level of the bridge's forge-neutral role ladder, lowest first: the vocabulary role drift's `observed` and `expected` are reported in. `none` is no direct role on the repository.";
1785
+ };
1786
+ readonly RoleMap: {
1787
+ readonly title: "RoleMap";
1788
+ readonly description: "The forge role each repository right is given, as the forge applies it: after the forge's own ladder has rounded it down. `own` is the role `git.repo.own` projects to, `maintain` that of `git.repo.maintain`, `commit` that of `git.commit.sign` (`none` is fork-based contribution). There is no member for `git.ns.admin` or `git.repo.create`, which project to no forge role whatever a bridge is configured with. Ordered: `own` is at least `maintain`, which is at least `commit`, and `commit` is at most `write`.";
1789
+ readonly type: "object";
1790
+ readonly additionalProperties: false;
1791
+ readonly required: readonly ["own", "maintain", "commit"];
1792
+ readonly properties: {
1793
+ readonly own: {
1794
+ readonly $ref: "#/$defs/MappedRole";
1795
+ };
1796
+ readonly maintain: {
1797
+ readonly $ref: "#/$defs/MappedRole";
1798
+ };
1799
+ readonly commit: {
1800
+ readonly $ref: "#/$defs/MappedRole";
1801
+ };
1802
+ };
1803
+ };
1804
+ readonly Ext: {
1805
+ readonly title: "Ext";
1806
+ readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
1807
+ readonly type: "object";
1808
+ readonly minProperties: 1;
1809
+ readonly additionalProperties: true;
1810
+ readonly propertyNames: {
1811
+ readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
1812
+ };
1813
+ };
1814
+ readonly ForgeAccount: {
1815
+ readonly title: "ForgeAccount";
1816
+ readonly description: "A person's account on one forge. `id` is authoritative; `login` is for display only, because logins can be renamed and re-registered.";
1817
+ readonly type: "object";
1818
+ readonly additionalProperties: false;
1819
+ readonly required: readonly ["forge", "id", "login"];
1820
+ readonly properties: {
1821
+ readonly forge: {
1822
+ readonly $ref: "#/$defs/ForgeHost";
1823
+ };
1824
+ readonly id: {
1825
+ readonly $ref: "#/$defs/ForgeId";
1826
+ };
1827
+ readonly login: {
1828
+ readonly type: "string";
1829
+ readonly minLength: 1;
1830
+ readonly maxLength: 100;
1831
+ readonly description: "The account's current login, as the forge reported it when last seen. Display only.";
1832
+ };
1833
+ };
1834
+ };
1835
+ readonly ForgeId: {
1836
+ readonly title: "ForgeId";
1837
+ readonly description: "An identifier the forge itself assigns — a repository id, a user or organisation id — carried as a string so a forge whose ids are not numbers needs no new version. GitHub and Forgejo ids are decimal integers written as strings (`\"812736451\"`). Unlike a name, it survives renames and transfers, which is why rights and bindings are keyed by it.";
1838
+ readonly type: "string";
1839
+ readonly minLength: 1;
1840
+ readonly maxLength: 64;
1841
+ };
1842
+ readonly ForgeHost: {
1843
+ readonly title: "ForgeHost";
1844
+ readonly description: "The lowercased DNS host of a forge: `github.com`, a GitHub Enterprise Server host, `codeberg.org`, or a self-hosted Forgejo instance such as `git.example.org`. No scheme, no port, no path. The host is a segment of every resource, so a right never crosses forges.";
1845
+ readonly type: "string";
1846
+ readonly minLength: 3;
1847
+ readonly maxLength: 253;
1848
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$";
1849
+ };
1850
+ readonly RepoResource: {
1851
+ readonly title: "RepoResource";
1852
+ readonly description: "A forge-qualified resource naming exactly one repository: `<forge-host>/<owner>/<repo>`, lowercase.";
1853
+ readonly type: "string";
1854
+ readonly maxLength: 455;
1855
+ readonly pattern: "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+/[a-z0-9_-][a-z0-9._-]{0,99}/[a-z0-9_-][a-z0-9._-]{0,99}$";
1856
+ };
1857
+ readonly DriftItem: {
1858
+ readonly title: "DriftItem";
1859
+ readonly description: "One difference between the forge's observed state and the VTC's projection of a repository.";
1860
+ readonly type: "object";
1861
+ readonly additionalProperties: false;
1862
+ readonly required: readonly ["type", "resource"];
1863
+ readonly properties: {
1864
+ readonly type: {
1865
+ readonly type: "string";
1866
+ readonly enum: readonly ["roleAdded", "roleRemoved", "roleChanged", "requiredCheckMissing", "protectionWeakened", "bootstrapMissing"];
1867
+ readonly description: "`roleAdded` — someone holds a forge role the projection does not give them. `roleRemoved` — a projected role is missing. `roleChanged` — a projected role is present at another level. `requiredCheckMissing` — the verify-trust check is no longer required. `protectionWeakened` — branch protection or a ruleset is weaker than the projection in another way (force-push allowed, bypass actors added). `bootstrapMissing` — a bootstrap file or variable is gone.";
1868
+ };
1869
+ readonly resource: {
1870
+ readonly $ref: "#/$defs/RepoResource";
1871
+ };
1872
+ readonly account: {
1873
+ readonly $ref: "#/$defs/ForgeAccount";
1874
+ readonly description: "Whose role differs, for the three role types.";
1875
+ };
1876
+ readonly observed: {
1877
+ readonly type: "string";
1878
+ readonly maxLength: 256;
1879
+ readonly description: "What the forge shows, in the forge's own vocabulary (a role name such as `maintain`, a setting name). Absent when nothing is there.";
1880
+ };
1881
+ readonly expected: {
1882
+ readonly type: "string";
1883
+ readonly maxLength: 256;
1884
+ readonly description: "What the projection calls for, in the forge's own vocabulary. Absent when the projection calls for nothing.";
1885
+ };
1886
+ };
1887
+ };
1888
+ readonly NamespaceId: {
1889
+ readonly title: "NamespaceId";
1890
+ readonly description: "The VTC's opaque identifier for a namespace, assigned when it is bound. Stable for the life of the binding; never reused for another binding.";
1891
+ readonly type: "string";
1892
+ readonly minLength: 1;
1893
+ readonly maxLength: 128;
1894
+ };
1895
+ };
1896
+ };
1897
+ };
1898
+ //# sourceMappingURL=payload.d.ts.map