@kana-ai/edgar-ext-github 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +469 -2
  3. package/agents/dismiss/agent.toml +4 -0
  4. package/agents/dismiss/instructions.md +25 -0
  5. package/dist/src/api/app.d.ts +16 -0
  6. package/dist/src/api/app.js +32 -0
  7. package/dist/src/api/client.d.ts +26 -0
  8. package/dist/src/api/client.js +103 -0
  9. package/dist/src/api/failures.d.ts +8 -0
  10. package/dist/src/api/failures.js +31 -0
  11. package/dist/src/feed/alerts.d.ts +26 -0
  12. package/dist/src/feed/alerts.js +117 -0
  13. package/dist/src/feed/cards.d.ts +32 -0
  14. package/dist/src/feed/cards.js +164 -0
  15. package/dist/src/feed/service.d.ts +28 -0
  16. package/dist/src/feed/service.js +163 -0
  17. package/dist/src/index.d.ts +490 -0
  18. package/dist/src/index.js +62 -0
  19. package/dist/src/schemas/config.d.ts +57 -0
  20. package/dist/src/schemas/config.js +89 -0
  21. package/dist/src/schemas/github.d.ts +417 -0
  22. package/dist/src/schemas/github.js +216 -0
  23. package/dist/src/schemas/tools.d.ts +620 -0
  24. package/dist/src/schemas/tools.js +501 -0
  25. package/dist/src/tools/alerts.d.ts +45 -0
  26. package/dist/src/tools/alerts.js +100 -0
  27. package/dist/src/tools/branch.d.ts +9 -0
  28. package/dist/src/tools/branch.js +48 -0
  29. package/dist/src/tools/checks.d.ts +118 -0
  30. package/dist/src/tools/checks.js +223 -0
  31. package/dist/src/tools/discussion.d.ts +41 -0
  32. package/dist/src/tools/discussion.js +66 -0
  33. package/dist/src/tools/pull-request.d.ts +195 -0
  34. package/dist/src/tools/pull-request.js +537 -0
  35. package/dist/src/tools/repository.d.ts +53 -0
  36. package/dist/src/tools/repository.js +134 -0
  37. package/dist/src/tools/screenshot.d.ts +21 -0
  38. package/dist/src/tools/screenshot.js +99 -0
  39. package/dist/src/tracker/assignee.d.ts +15 -0
  40. package/dist/src/tracker/assignee.js +65 -0
  41. package/dist/src/tracker/cards.d.ts +41 -0
  42. package/dist/src/tracker/cards.js +361 -0
  43. package/dist/src/tracker/comments.d.ts +9 -0
  44. package/dist/src/tracker/comments.js +68 -0
  45. package/dist/src/tracker/description.d.ts +19 -0
  46. package/dist/src/tracker/description.js +55 -0
  47. package/dist/src/tracker/hand-back.d.ts +8 -0
  48. package/dist/src/tracker/hand-back.js +60 -0
  49. package/dist/src/tracker/port.d.ts +2 -0
  50. package/dist/src/tracker/port.js +42 -0
  51. package/dist/src/tracker/states.d.ts +77 -0
  52. package/dist/src/tracker/states.js +189 -0
  53. package/dist/src/tracker/tools.d.ts +143 -0
  54. package/dist/src/tracker/tools.js +131 -0
  55. package/dist/src/tracker/transitions.d.ts +12 -0
  56. package/dist/src/tracker/transitions.js +101 -0
  57. package/edgar-extension.json +507 -0
  58. package/package.json +43 -3
  59. package/schemas/assign.in.json +15 -0
  60. package/schemas/assign.out.json +14 -0
  61. package/schemas/attach_screenshot.in.json +44 -0
  62. package/schemas/attach_screenshot.out.json +31 -0
  63. package/schemas/batch_cards.in.json +27 -0
  64. package/schemas/batch_cards.out.json +37 -0
  65. package/schemas/branch_protection.in.json +15 -0
  66. package/schemas/branch_protection.out.json +67 -0
  67. package/schemas/ci_run.in.json +12 -0
  68. package/schemas/ci_run.out.json +109 -0
  69. package/schemas/close.in.json +14 -0
  70. package/schemas/close.out.json +10 -0
  71. package/schemas/close_pull_request.in.json +21 -0
  72. package/schemas/close_pull_request.out.json +14 -0
  73. package/schemas/comment.in.json +19 -0
  74. package/schemas/comment.out.json +10 -0
  75. package/schemas/config.json +202 -0
  76. package/schemas/count_sighting.in.json +17 -0
  77. package/schemas/count_sighting.out.json +10 -0
  78. package/schemas/create_card.in.json +108 -0
  79. package/schemas/create_card.out.json +13 -0
  80. package/schemas/dependabot_alerts.in.json +49 -0
  81. package/schemas/dependabot_alerts.out.json +75 -0
  82. package/schemas/dismiss_dependabot_alert.in.json +26 -0
  83. package/schemas/dismiss_dependabot_alert.out.json +27 -0
  84. package/schemas/find_assignee.in.json +15 -0
  85. package/schemas/find_assignee.out.json +10 -0
  86. package/schemas/find_cards.in.json +18 -0
  87. package/schemas/find_cards.out.json +33 -0
  88. package/schemas/find_dependabot_dismissal.in.json +12 -0
  89. package/schemas/find_dependabot_dismissal.out.json +27 -0
  90. package/schemas/find_description.in.json +15 -0
  91. package/schemas/find_description.out.json +10 -0
  92. package/schemas/find_pull_request.in.json +25 -0
  93. package/schemas/find_pull_request.out.json +14 -0
  94. package/schemas/hand_back.in.json +11 -0
  95. package/schemas/hand_back.out.json +18 -0
  96. package/schemas/linked_pull_requests.in.json +15 -0
  97. package/schemas/linked_pull_requests.out.json +44 -0
  98. package/schemas/list_pull_requests.in.json +26 -0
  99. package/schemas/list_pull_requests.out.json +42 -0
  100. package/schemas/merge_pull_request.in.json +22 -0
  101. package/schemas/merge_pull_request.out.json +16 -0
  102. package/schemas/move.in.json +15 -0
  103. package/schemas/move.out.json +10 -0
  104. package/schemas/note_pull_request.in.json +15 -0
  105. package/schemas/note_pull_request.out.json +10 -0
  106. package/schemas/open_pull_request.in.json +113 -0
  107. package/schemas/open_pull_request.out.json +15 -0
  108. package/schemas/pull_request_checks.in.json +11 -0
  109. package/schemas/pull_request_checks.out.json +72 -0
  110. package/schemas/pull_request_discussion.in.json +11 -0
  111. package/schemas/pull_request_discussion.out.json +107 -0
  112. package/schemas/pull_request_state.in.json +11 -0
  113. package/schemas/pull_request_state.out.json +52 -0
  114. package/schemas/push_branch.in.json +21 -0
  115. package/schemas/push_branch.out.json +13 -0
  116. package/schemas/release_follow_ups.in.json +15 -0
  117. package/schemas/release_follow_ups.out.json +13 -0
  118. package/schemas/reopen_dependabot_alert.in.json +33 -0
  119. package/schemas/reopen_dependabot_alert.out.json +22 -0
  120. package/schemas/restore_assignee.in.json +20 -0
  121. package/schemas/restore_assignee.out.json +10 -0
  122. package/schemas/restore_description.in.json +20 -0
  123. package/schemas/restore_description.out.json +10 -0
  124. package/schemas/update_description.in.json +15 -0
  125. package/schemas/update_description.out.json +14 -0
  126. package/schemas/update_pull_request.in.json +81 -0
  127. package/schemas/update_pull_request.out.json +10 -0
  128. package/schemas/wait_for_checks.in.json +11 -0
  129. package/schemas/wait_for_checks.out.json +72 -0
  130. package/schemas/wait_for_merge.in.json +11 -0
  131. package/schemas/wait_for_merge.out.json +17 -0
  132. package/schemas/wait_for_passed_checks.in.json +11 -0
  133. package/schemas/wait_for_passed_checks.out.json +72 -0
  134. package/schemas/wait_for_review.in.json +11 -0
  135. package/schemas/wait_for_review.out.json +52 -0
  136. package/workflows/resume.toml +17 -0
@@ -0,0 +1,62 @@
1
+ import { defineExtension, defineService } from "@kana-ai/edgar-sdk";
2
+ import { HOST, LOG_HOSTS, TOKEN, apiAccess } from "#api/client";
3
+ import { serve } from "#feed/service";
4
+ import { config } from "#schemas/config";
5
+ import { alertTools } from "#tools/alerts";
6
+ import { pushBranch } from "#tools/branch";
7
+ import { checkTools } from "#tools/checks";
8
+ import { discussionTools } from "#tools/discussion";
9
+ import { pullRequestTools } from "#tools/pull-request";
10
+ import { repositoryTools } from "#tools/repository";
11
+ import { tracker } from "#tracker/port";
12
+ import { trackerTools } from "#tracker/tools";
13
+ /** Every tool of the GitHub extension, by the name the manifest gives it. */
14
+ export const tools = {
15
+ push_branch: pushBranch,
16
+ ...pullRequestTools,
17
+ ...checkTools,
18
+ ...discussionTools,
19
+ ...repositoryTools,
20
+ ...alertTools,
21
+ ...trackerTools,
22
+ };
23
+ /**
24
+ * The GitHub extension: branches, pull requests, Dependabot alerts, the `events` webhook, the service that watches each repository of `[extensions.github.watch]` and files the alerts of each repository of `[extensions.github.dependabot]`, and the GitHub Issues tracker of a project that writes `[extensions.github.columns]`.
25
+ */
26
+ export default defineExtension({
27
+ name: "github",
28
+ config,
29
+ secrets: {
30
+ [TOKEN]: {
31
+ hosts: [HOST, ...LOG_HOSTS],
32
+ help: "Make a fine-grained token with Contents, Issues and Pull requests set to Read and write on the repositories EDGAR works on. With [extensions.github] app, set the App's private key (the PEM file) instead. The extension's README lists the permission of each tool.",
33
+ },
34
+ GITHUB_WEBHOOK_SECRET: { hosts: [] },
35
+ },
36
+ capabilities: [
37
+ ...apiAccess.capabilities,
38
+ ...LOG_HOSTS.map((host) => `network:${host}`),
39
+ "git:push",
40
+ "sandbox:read",
41
+ ],
42
+ tracker,
43
+ tools,
44
+ workflows: ["workflows/resume.toml"],
45
+ roles: ["agents/dismiss"],
46
+ service: defineService({ ...apiAccess, run: serve }),
47
+ executables: {
48
+ requires: [
49
+ {
50
+ name: "git",
51
+ reason: "The tool push_branch runs git in the sandbox of the run to push the branch.",
52
+ },
53
+ ],
54
+ },
55
+ webhooks: {
56
+ events: {
57
+ signature: "hmac-sha256",
58
+ secret: "GITHUB_WEBHOOK_SECRET",
59
+ delivery_id_header: "X-GitHub-Delivery",
60
+ },
61
+ },
62
+ });
@@ -0,0 +1,57 @@
1
+ import { z } from "zod";
2
+ /** The severities of a Dependabot alert, the worst last. */
3
+ export declare const severities: readonly ["low", "medium", "high", "critical"];
4
+ /** The extension's `[extensions.github]` table; `columns` and `tracker` come together, and make GitHub Issues a tracker of the project. */
5
+ export declare const config: z.ZodObject<{
6
+ default_base: z.ZodDefault<z.ZodString>;
7
+ app: z.ZodOptional<z.ZodObject<{
8
+ id: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
9
+ installation: z.ZodNumber;
10
+ }, z.core.$strict>>;
11
+ watch: z.ZodOptional<z.ZodObject<{
12
+ services: z.ZodRecord<z.ZodString, z.ZodString>;
13
+ login: z.ZodOptional<z.ZodString>;
14
+ every_seconds: z.ZodDefault<z.ZodNumber>;
15
+ card_column: z.ZodDefault<z.ZodString>;
16
+ }, z.core.$strict>>;
17
+ dependabot: z.ZodOptional<z.ZodObject<{
18
+ services: z.ZodRecord<z.ZodString, z.ZodString>;
19
+ every_seconds: z.ZodDefault<z.ZodNumber>;
20
+ severity_min: z.ZodDefault<z.ZodEnum<{
21
+ critical: "critical";
22
+ high: "high";
23
+ low: "low";
24
+ medium: "medium";
25
+ }>>;
26
+ max_per_run: z.ZodDefault<z.ZodNumber>;
27
+ card_column: z.ZodDefault<z.ZodString>;
28
+ }, z.core.$strict>>;
29
+ columns: z.ZodOptional<z.ZodObject<{
30
+ intake: z.ZodString;
31
+ ready: z.ZodString;
32
+ working: z.ZodString;
33
+ in_review: z.ZodString;
34
+ waiting_on_person: z.ZodString;
35
+ in_testing: z.ZodString;
36
+ }, z.core.$strict>>;
37
+ tracker: z.ZodOptional<z.ZodObject<{
38
+ repos: z.ZodRecord<z.ZodString, z.ZodObject<{
39
+ repo: z.ZodString;
40
+ service: z.ZodString;
41
+ }, z.core.$strict>>;
42
+ title_prefix: z.ZodOptional<z.ZodString>;
43
+ labels: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
+ assignee: z.ZodOptional<z.ZodString>;
45
+ assignee_only: z.ZodDefault<z.ZodBoolean>;
46
+ }, z.core.$strict>>;
47
+ }, z.core.$strict>;
48
+ /** The parsed `[extensions.github]` table. */
49
+ export type Config = z.infer<typeof config>;
50
+ /** The parsed `[extensions.github.dependabot]` table. */
51
+ export type DependabotFeed = NonNullable<Config["dependabot"]>;
52
+ /** The parsed `[extensions.github.tracker]` table. */
53
+ export type TrackerTable = NonNullable<Config["tracker"]>;
54
+ /** The parsed `[extensions.github.columns]` table. */
55
+ export type Columns = NonNullable<Config["columns"]>;
56
+ /** An open engine state, which an issue label marks. */
57
+ export type OpenState = keyof Columns;
@@ -0,0 +1,89 @@
1
+ import { z } from "zod";
2
+ /** The severities of a Dependabot alert, the worst last. */
3
+ export const severities = ["low", "medium", "high", "critical"];
4
+ const service = z.string().regex(/^[a-z][a-z0-9_]{0,63}$/);
5
+ const repository = z.string().regex(/^[\w.-]+\/[\w.-]+$/);
6
+ const label = z.string().min(1);
7
+ /** The extension's `[extensions.github]` table; `columns` and `tracker` come together, and make GitHub Issues a tracker of the project. */
8
+ export const config = z
9
+ .strictObject({
10
+ default_base: z.string().min(1).default("main"),
11
+ app: z
12
+ .strictObject({
13
+ id: z.union([z.number().int().positive(), z.string().min(1)]),
14
+ installation: z.number().int().positive(),
15
+ })
16
+ .optional()
17
+ .describe("sign in as this GitHub App installation; GITHUB_TOKEN then holds the App's private key"),
18
+ watch: z
19
+ .strictObject({
20
+ services: z
21
+ .record(service, z.string().min(1))
22
+ .describe("each service of the project to watch, with its repository as owner/name"),
23
+ login: z
24
+ .string()
25
+ .min(1)
26
+ .optional()
27
+ .describe("the GitHub login EDGAR works as; the default is the login of GITHUB_TOKEN, and an App needs it, such as edgar[bot]"),
28
+ every_seconds: z.number().int().min(30).max(3600).default(60),
29
+ card_column: z.string().min(1).default("intake"),
30
+ })
31
+ .optional()
32
+ .describe("the service reads each repository every every_seconds and opens a card for a review asked of EDGAR, a red default branch, and red checks on EDGAR's own pull request"),
33
+ dependabot: z
34
+ .strictObject({
35
+ services: z
36
+ .record(repository, service)
37
+ .describe("each repository to read, as owner/name, with the service of the project that its cards name"),
38
+ every_seconds: z.number().int().min(60).max(86_400).default(300),
39
+ severity_min: z
40
+ .enum(severities)
41
+ .default("low")
42
+ .describe("an alert under this severity opens no card"),
43
+ max_per_run: z
44
+ .number()
45
+ .int()
46
+ .min(1)
47
+ .max(100)
48
+ .default(10)
49
+ .describe("the most cards one sweep opens, the worst first; the rest wait"),
50
+ card_column: z.string().min(1).default("intake"),
51
+ })
52
+ .optional()
53
+ .describe("the service reads the open Dependabot alerts of each repository every every_seconds and opens one card for each advisory of a package"),
54
+ columns: z
55
+ .strictObject({
56
+ intake: label,
57
+ ready: label,
58
+ working: label,
59
+ in_review: label,
60
+ waiting_on_person: label,
61
+ in_testing: label,
62
+ })
63
+ .optional()
64
+ .describe("the issue label of each open engine state; with tracker, it makes GitHub Issues a tracker of the project; done closes an issue as completed, and cancelled closes it as not planned"),
65
+ tracker: z
66
+ .strictObject({
67
+ repos: z
68
+ .record(z.string().regex(/^[A-Z][A-Z0-9]{0,9}$/), z.strictObject({ repo: repository, service }))
69
+ .refine((repos) => Object.keys(repos).length > 0, "name at least one repository")
70
+ .describe("each repository whose issues are cards, by the key of its card ids (API makes API-123), with its repository as owner/name and the service its cards name"),
71
+ title_prefix: z.string().min(1).optional(),
72
+ labels: z.array(label).optional(),
73
+ assignee: z
74
+ .string()
75
+ .min(1)
76
+ .optional()
77
+ .describe("the GitHub login of `assignee_only`; the default is the login of GITHUB_TOKEN, and an App needs it, such as edgar[bot]"),
78
+ assignee_only: z
79
+ .boolean()
80
+ .default(false)
81
+ .describe("true: an issue is in scope only while it is assigned to `assignee` or labelled edgar:waiting, and EDGAR assigns each issue it files to `assignee`"),
82
+ })
83
+ .optional()
84
+ .describe("GitHub Issues as a tracker of the project, with columns"),
85
+ })
86
+ .refine((table) => (table.columns === undefined) === (table.tracker === undefined), {
87
+ message: "write [extensions.github.columns] and [extensions.github.tracker] together",
88
+ path: ["columns"],
89
+ });
@@ -0,0 +1,417 @@
1
+ import { z } from "zod";
2
+ /** A pull request as the REST API answers it, with the fields the tools read. */
3
+ export declare const pull: z.ZodObject<{
4
+ html_url: z.ZodString;
5
+ number: z.ZodNumber;
6
+ state: z.ZodEnum<{
7
+ closed: "closed";
8
+ open: "open";
9
+ }>;
10
+ merged_at: z.ZodNullable<z.ZodString>;
11
+ merge_commit_sha: z.ZodNullable<z.ZodString>;
12
+ updated_at: z.ZodString;
13
+ head: z.ZodObject<{
14
+ ref: z.ZodString;
15
+ sha: z.ZodString;
16
+ repo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
17
+ full_name: z.ZodString;
18
+ }, z.core.$strip>>>;
19
+ }, z.core.$strip>;
20
+ }, z.core.$strip>;
21
+ /** A pull request with its body, which `update_pull_request` and `attach_screenshot` keep a part of. */
22
+ export declare const pullBody: z.ZodObject<{
23
+ html_url: z.ZodString;
24
+ number: z.ZodNumber;
25
+ state: z.ZodEnum<{
26
+ closed: "closed";
27
+ open: "open";
28
+ }>;
29
+ merged_at: z.ZodNullable<z.ZodString>;
30
+ merge_commit_sha: z.ZodNullable<z.ZodString>;
31
+ updated_at: z.ZodString;
32
+ head: z.ZodObject<{
33
+ ref: z.ZodString;
34
+ sha: z.ZodString;
35
+ repo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
36
+ full_name: z.ZodString;
37
+ }, z.core.$strip>>>;
38
+ }, z.core.$strip>;
39
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
+ }, z.core.$strip>;
41
+ /** A blob, a tree or a commit as the Git database API answers its creation, or a commit of a list. */
42
+ export declare const gitObject: z.ZodObject<{
43
+ sha: z.ZodString;
44
+ }, z.core.$strip>;
45
+ /** A ref as `GET` and `POST /repos/{owner}/{repo}/git/refs` answer it. */
46
+ export declare const gitRef: z.ZodObject<{
47
+ ref: z.ZodString;
48
+ object: z.ZodObject<{
49
+ sha: z.ZodString;
50
+ }, z.core.$strip>;
51
+ }, z.core.$strip>;
52
+ /** The answer of `PUT /repos/{owner}/{repo}/contents/{path}`: the commit that holds the file. */
53
+ export declare const storedFile: z.ZodObject<{
54
+ commit: z.ZodObject<{
55
+ sha: z.ZodString;
56
+ }, z.core.$strip>;
57
+ }, z.core.$strip>;
58
+ /** One pull request as `GET /repos/{owner}/{repo}/pulls/{n}` answers it, which a list does not: with the number of files it changes. */
59
+ export declare const onePull: z.ZodObject<{
60
+ html_url: z.ZodString;
61
+ number: z.ZodNumber;
62
+ state: z.ZodEnum<{
63
+ closed: "closed";
64
+ open: "open";
65
+ }>;
66
+ merged_at: z.ZodNullable<z.ZodString>;
67
+ merge_commit_sha: z.ZodNullable<z.ZodString>;
68
+ updated_at: z.ZodString;
69
+ head: z.ZodObject<{
70
+ ref: z.ZodString;
71
+ sha: z.ZodString;
72
+ repo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
73
+ full_name: z.ZodString;
74
+ }, z.core.$strip>>>;
75
+ }, z.core.$strip>;
76
+ changed_files: z.ZodNumber;
77
+ }, z.core.$strip>;
78
+ /** A pull request with the words a person reads, for a role that checks whether it fixes a card. */
79
+ export declare const linkedPull: z.ZodObject<{
80
+ html_url: z.ZodString;
81
+ number: z.ZodNumber;
82
+ state: z.ZodEnum<{
83
+ closed: "closed";
84
+ open: "open";
85
+ }>;
86
+ merged_at: z.ZodNullable<z.ZodString>;
87
+ merge_commit_sha: z.ZodNullable<z.ZodString>;
88
+ updated_at: z.ZodString;
89
+ head: z.ZodObject<{
90
+ ref: z.ZodString;
91
+ sha: z.ZodString;
92
+ repo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
93
+ full_name: z.ZodString;
94
+ }, z.core.$strip>>>;
95
+ }, z.core.$strip>;
96
+ title: z.ZodString;
97
+ body: z.ZodNullable<z.ZodString>;
98
+ }, z.core.$strip>;
99
+ /** One file of `GET /repos/{owner}/{repo}/pulls/{n}/files`; a binary or very large file has no `patch`. */
100
+ export declare const pullFile: z.ZodObject<{
101
+ filename: z.ZodString;
102
+ patch: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>;
104
+ /** An open pull request as `GET /repos/{owner}/{repo}/pulls?state=open` lists it, with who wrote it and who is asked to review it or is assigned. */
105
+ export declare const openPull: z.ZodObject<{
106
+ html_url: z.ZodString;
107
+ number: z.ZodNumber;
108
+ state: z.ZodEnum<{
109
+ closed: "closed";
110
+ open: "open";
111
+ }>;
112
+ merged_at: z.ZodNullable<z.ZodString>;
113
+ merge_commit_sha: z.ZodNullable<z.ZodString>;
114
+ updated_at: z.ZodString;
115
+ head: z.ZodObject<{
116
+ ref: z.ZodString;
117
+ sha: z.ZodString;
118
+ repo: z.ZodOptional<z.ZodNullable<z.ZodObject<{
119
+ full_name: z.ZodString;
120
+ }, z.core.$strip>>>;
121
+ }, z.core.$strip>;
122
+ title: z.ZodString;
123
+ user: z.ZodNullable<z.ZodObject<{
124
+ login: z.ZodString;
125
+ }, z.core.$strip>>;
126
+ requested_reviewers: z.ZodDefault<z.ZodArray<z.ZodObject<{
127
+ login: z.ZodString;
128
+ }, z.core.$strip>>>;
129
+ assignees: z.ZodDefault<z.ZodArray<z.ZodObject<{
130
+ login: z.ZodString;
131
+ }, z.core.$strip>>>;
132
+ }, z.core.$strip>;
133
+ /** The user a token signs in as, from `GET /user`. */
134
+ export declare const viewer: z.ZodObject<{
135
+ login: z.ZodString;
136
+ }, z.core.$strip>;
137
+ /** One review of a pull request, with the head commit it was made on. */
138
+ export declare const review: z.ZodObject<{
139
+ user: z.ZodNullable<z.ZodObject<{
140
+ id: z.ZodNumber;
141
+ login: z.ZodString;
142
+ }, z.core.$strip>>;
143
+ state: z.ZodString;
144
+ commit_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
+ }, z.core.$strip>;
146
+ /** The files a comparison of two refs changes, from `GET /repos/{owner}/{repo}/compare/{base}...{head}`; GitHub lists at most 300. */
147
+ export declare const comparison: z.ZodObject<{
148
+ files: z.ZodDefault<z.ZodArray<z.ZodObject<{
149
+ filename: z.ZodString;
150
+ changes: z.ZodNumber;
151
+ }, z.core.$strip>>>;
152
+ }, z.core.$strip>;
153
+ /** The answer of a merge. */
154
+ export declare const merge: z.ZodObject<{
155
+ sha: z.ZodString;
156
+ merged: z.ZodBoolean;
157
+ }, z.core.$strip>;
158
+ /** The body of an error answer. */
159
+ export declare const errorBody: z.ZodObject<{
160
+ message: z.ZodOptional<z.ZodString>;
161
+ documentation_url: z.ZodOptional<z.ZodString>;
162
+ }, z.core.$strip>;
163
+ /** One check run of a commit, from `GET /repos/{owner}/{repo}/commits/{ref}/check-runs`. */
164
+ export declare const checkRun: z.ZodObject<{
165
+ id: z.ZodOptional<z.ZodNumber>;
166
+ head_sha: z.ZodOptional<z.ZodString>;
167
+ name: z.ZodString;
168
+ status: z.ZodString;
169
+ conclusion: z.ZodNullable<z.ZodString>;
170
+ html_url: z.ZodNullable<z.ZodString>;
171
+ details_url: z.ZodNullable<z.ZodString>;
172
+ }, z.core.$strip>;
173
+ /** The check runs of a commit. */
174
+ export declare const checkRuns: z.ZodObject<{
175
+ total_count: z.ZodNumber;
176
+ check_runs: z.ZodArray<z.ZodObject<{
177
+ id: z.ZodOptional<z.ZodNumber>;
178
+ head_sha: z.ZodOptional<z.ZodString>;
179
+ name: z.ZodString;
180
+ status: z.ZodString;
181
+ conclusion: z.ZodNullable<z.ZodString>;
182
+ html_url: z.ZodNullable<z.ZodString>;
183
+ details_url: z.ZodNullable<z.ZodString>;
184
+ }, z.core.$strip>>;
185
+ }, z.core.$strip>;
186
+ /** The combined status of a commit, from `GET /repos/{owner}/{repo}/commits/{ref}/status`. */
187
+ export declare const combinedStatus: z.ZodObject<{
188
+ statuses: z.ZodArray<z.ZodObject<{
189
+ context: z.ZodString;
190
+ state: z.ZodString;
191
+ target_url: z.ZodNullable<z.ZodString>;
192
+ }, z.core.$strip>>;
193
+ }, z.core.$strip>;
194
+ /** A Dependabot alert, from `GET /repos/{owner}/{repo}/dependabot/alerts`; the dismissal fields are set on a dismissed alert. */
195
+ export declare const alert: z.ZodObject<{
196
+ number: z.ZodNumber;
197
+ state: z.ZodString;
198
+ html_url: z.ZodString;
199
+ dismissed_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
200
+ dismissed_comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
201
+ dependency: z.ZodObject<{
202
+ package: z.ZodOptional<z.ZodNullable<z.ZodObject<{
203
+ ecosystem: z.ZodString;
204
+ name: z.ZodString;
205
+ }, z.core.$strip>>>;
206
+ manifest_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
207
+ scope: z.ZodOptional<z.ZodNullable<z.ZodString>>;
208
+ }, z.core.$strip>;
209
+ security_advisory: z.ZodObject<{
210
+ ghsa_id: z.ZodString;
211
+ cve_id: z.ZodNullable<z.ZodString>;
212
+ summary: z.ZodString;
213
+ severity: z.ZodString;
214
+ }, z.core.$strip>;
215
+ security_vulnerability: z.ZodObject<{
216
+ severity: z.ZodString;
217
+ vulnerable_version_range: z.ZodString;
218
+ first_patched_version: z.ZodNullable<z.ZodObject<{
219
+ identifier: z.ZodString;
220
+ }, z.core.$strip>>;
221
+ }, z.core.$strip>;
222
+ }, z.core.$strip>;
223
+ /** A review with its author and words, from `GET .../pulls/{n}/reviews`. */
224
+ export declare const said: z.ZodObject<{
225
+ user: z.ZodNullable<z.ZodObject<{
226
+ login: z.ZodString;
227
+ }, z.core.$strip>>;
228
+ state: z.ZodString;
229
+ body: z.ZodNullable<z.ZodString>;
230
+ submitted_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
+ }, z.core.$strip>;
232
+ /** A comment on a line of a pull request's diff, from `GET .../pulls/{n}/comments`. */
233
+ export declare const lineComment: z.ZodObject<{
234
+ id: z.ZodNumber;
235
+ in_reply_to_id: z.ZodOptional<z.ZodNumber>;
236
+ user: z.ZodNullable<z.ZodObject<{
237
+ login: z.ZodString;
238
+ }, z.core.$strip>>;
239
+ body: z.ZodString;
240
+ path: z.ZodString;
241
+ line: z.ZodNullable<z.ZodNumber>;
242
+ original_line: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
243
+ diff_hunk: z.ZodString;
244
+ created_at: z.ZodString;
245
+ }, z.core.$strip>;
246
+ /** A comment of a pull request's conversation, from `GET .../issues/{n}/comments`. */
247
+ export declare const issueComment: z.ZodObject<{
248
+ user: z.ZodNullable<z.ZodObject<{
249
+ login: z.ZodString;
250
+ }, z.core.$strip>>;
251
+ body: z.ZodString;
252
+ created_at: z.ZodString;
253
+ }, z.core.$strip>;
254
+ /** A comment of a pull request as the note tool reads and writes it; GitHub gives `body` as null for an empty one. */
255
+ export declare const note: z.ZodObject<{
256
+ id: z.ZodNumber;
257
+ html_url: z.ZodString;
258
+ body: z.ZodNullable<z.ZodString>;
259
+ }, z.core.$strip>;
260
+ /** A GitHub Actions workflow run, from `GET .../actions/runs/{id}`. */
261
+ export declare const workflowRun: z.ZodObject<{
262
+ id: z.ZodNumber;
263
+ name: z.ZodNullable<z.ZodString>;
264
+ html_url: z.ZodString;
265
+ status: z.ZodNullable<z.ZodString>;
266
+ conclusion: z.ZodNullable<z.ZodString>;
267
+ head_sha: z.ZodString;
268
+ head_branch: z.ZodNullable<z.ZodString>;
269
+ run_attempt: z.ZodNumber;
270
+ }, z.core.$strip>;
271
+ /** The jobs of a run's latest attempt, from `GET .../actions/runs/{id}/jobs`. */
272
+ export declare const jobs: z.ZodObject<{
273
+ jobs: z.ZodArray<z.ZodObject<{
274
+ id: z.ZodNumber;
275
+ name: z.ZodString;
276
+ status: z.ZodString;
277
+ conclusion: z.ZodNullable<z.ZodString>;
278
+ steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
279
+ name: z.ZodString;
280
+ conclusion: z.ZodNullable<z.ZodString>;
281
+ }, z.core.$strip>>>;
282
+ }, z.core.$strip>>;
283
+ }, z.core.$strip>;
284
+ /** A branch with its protection as a reader sees it, from `GET .../branches/{branch}`. */
285
+ export declare const branch: z.ZodObject<{
286
+ name: z.ZodString;
287
+ protected: z.ZodBoolean;
288
+ protection: z.ZodOptional<z.ZodNullable<z.ZodObject<{
289
+ required_status_checks: z.ZodOptional<z.ZodNullable<z.ZodObject<{
290
+ contexts: z.ZodArray<z.ZodString>;
291
+ }, z.core.$strip>>>;
292
+ }, z.core.$strip>>>;
293
+ }, z.core.$strip>;
294
+ /** One rule that applies to a branch, from `GET .../rules/branches/{branch}`. */
295
+ export declare const rule: z.ZodObject<{
296
+ type: z.ZodString;
297
+ ruleset_id: z.ZodNumber;
298
+ ruleset_source: z.ZodString;
299
+ parameters: z.ZodOptional<z.ZodObject<{
300
+ required_approving_review_count: z.ZodOptional<z.ZodNumber>;
301
+ required_status_checks: z.ZodOptional<z.ZodArray<z.ZodObject<{
302
+ context: z.ZodString;
303
+ }, z.core.$strip>>>;
304
+ }, z.core.$strip>>;
305
+ }, z.core.$strip>;
306
+ /** A classic branch protection rule, from `GET .../branches/{branch}/protection`; admins only. */
307
+ export declare const classicProtection: z.ZodObject<{
308
+ required_pull_request_reviews: z.ZodOptional<z.ZodObject<{
309
+ required_approving_review_count: z.ZodDefault<z.ZodNumber>;
310
+ }, z.core.$strip>>;
311
+ required_status_checks: z.ZodOptional<z.ZodNullable<z.ZodObject<{
312
+ contexts: z.ZodArray<z.ZodString>;
313
+ }, z.core.$strip>>>;
314
+ }, z.core.$strip>;
315
+ /** An issue as `GET /repos/{owner}/{repo}/issues` lists it and `GET .../issues/{n}` answers it, with the fields a card reads; a pull request has `pull_request`. */
316
+ export declare const issue: z.ZodObject<{
317
+ number: z.ZodNumber;
318
+ title: z.ZodString;
319
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
320
+ state: z.ZodEnum<{
321
+ closed: "closed";
322
+ open: "open";
323
+ }>;
324
+ state_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
325
+ html_url: z.ZodString;
326
+ labels: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
327
+ name: z.ZodString;
328
+ }, z.core.$strip>]>>;
329
+ assignees: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
330
+ login: z.ZodString;
331
+ }, z.core.$strip>>>>;
332
+ pull_request: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
333
+ }, z.core.$strip>;
334
+ /** One comment of an issue, from `GET .../issues/{n}/comments`. */
335
+ export declare const cardComment: z.ZodObject<{
336
+ id: z.ZodNumber;
337
+ user: z.ZodNullable<z.ZodObject<{
338
+ login: z.ZodString;
339
+ }, z.core.$strip>>;
340
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
341
+ created_at: z.ZodString;
342
+ }, z.core.$strip>;
343
+ /** A label as `GET /repos/{owner}/{repo}/labels/{name}` and its `POST` answer it. */
344
+ export declare const namedLabel: z.ZodObject<{
345
+ name: z.ZodString;
346
+ }, z.core.$strip>;
347
+ /** A user as `GET /users/{username}` answers it; `email` is null unless the user made it public. */
348
+ export declare const user: z.ZodObject<{
349
+ login: z.ZodString;
350
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
351
+ email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
352
+ }, z.core.$strip>;
353
+ /** The issues of `GET /search/issues` that match, each with the repository it is in. */
354
+ export declare const foundIssues: z.ZodObject<{
355
+ items: z.ZodArray<z.ZodObject<{
356
+ number: z.ZodNumber;
357
+ title: z.ZodString;
358
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ state: z.ZodEnum<{
360
+ closed: "closed";
361
+ open: "open";
362
+ }>;
363
+ state_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
364
+ html_url: z.ZodString;
365
+ labels: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
366
+ name: z.ZodString;
367
+ }, z.core.$strip>]>>;
368
+ assignees: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
369
+ login: z.ZodString;
370
+ }, z.core.$strip>>>>;
371
+ pull_request: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
372
+ repository_url: z.ZodString;
373
+ created_at: z.ZodString;
374
+ }, z.core.$strip>>;
375
+ }, z.core.$strip>;
376
+ /** A user as an issue or an event names them; `type` is `Bot` for an App. */
377
+ export declare const actor: z.ZodObject<{
378
+ login: z.ZodString;
379
+ type: z.ZodOptional<z.ZodString>;
380
+ }, z.core.$strip>;
381
+ /** An issue with its writer and the time it was made, which `hand_back` and `find_cards` read. */
382
+ export declare const issueBy: z.ZodObject<{
383
+ number: z.ZodNumber;
384
+ title: z.ZodString;
385
+ body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
386
+ state: z.ZodEnum<{
387
+ closed: "closed";
388
+ open: "open";
389
+ }>;
390
+ state_reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
391
+ html_url: z.ZodString;
392
+ labels: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
393
+ name: z.ZodString;
394
+ }, z.core.$strip>]>>;
395
+ assignees: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
396
+ login: z.ZodString;
397
+ }, z.core.$strip>>>>;
398
+ pull_request: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, z.core.$strip>>>;
399
+ user: z.ZodNullable<z.ZodObject<{
400
+ login: z.ZodString;
401
+ type: z.ZodOptional<z.ZodString>;
402
+ }, z.core.$strip>>;
403
+ created_at: z.ZodString;
404
+ }, z.core.$strip>;
405
+ /** One event of an issue, from `GET .../issues/{n}/events`; an `assigned` event names who assigned whom. */
406
+ export declare const issueEvent: z.ZodObject<{
407
+ event: z.ZodString;
408
+ created_at: z.ZodString;
409
+ actor: z.ZodNullable<z.ZodObject<{
410
+ login: z.ZodString;
411
+ type: z.ZodOptional<z.ZodString>;
412
+ }, z.core.$strip>>;
413
+ assignee: z.ZodOptional<z.ZodNullable<z.ZodObject<{
414
+ login: z.ZodString;
415
+ type: z.ZodOptional<z.ZodString>;
416
+ }, z.core.$strip>>>;
417
+ }, z.core.$strip>;