@kana-ai/edgar-ext-github 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +469 -2
- package/agents/dismiss/agent.toml +4 -0
- package/agents/dismiss/instructions.md +25 -0
- package/dist/src/api/app.d.ts +16 -0
- package/dist/src/api/app.js +32 -0
- package/dist/src/api/client.d.ts +26 -0
- package/dist/src/api/client.js +103 -0
- package/dist/src/api/failures.d.ts +8 -0
- package/dist/src/api/failures.js +31 -0
- package/dist/src/feed/alerts.d.ts +26 -0
- package/dist/src/feed/alerts.js +117 -0
- package/dist/src/feed/cards.d.ts +32 -0
- package/dist/src/feed/cards.js +164 -0
- package/dist/src/feed/service.d.ts +28 -0
- package/dist/src/feed/service.js +163 -0
- package/dist/src/index.d.ts +490 -0
- package/dist/src/index.js +62 -0
- package/dist/src/schemas/config.d.ts +57 -0
- package/dist/src/schemas/config.js +89 -0
- package/dist/src/schemas/github.d.ts +417 -0
- package/dist/src/schemas/github.js +216 -0
- package/dist/src/schemas/tools.d.ts +620 -0
- package/dist/src/schemas/tools.js +501 -0
- package/dist/src/tools/alerts.d.ts +45 -0
- package/dist/src/tools/alerts.js +100 -0
- package/dist/src/tools/branch.d.ts +9 -0
- package/dist/src/tools/branch.js +48 -0
- package/dist/src/tools/checks.d.ts +118 -0
- package/dist/src/tools/checks.js +223 -0
- package/dist/src/tools/discussion.d.ts +41 -0
- package/dist/src/tools/discussion.js +66 -0
- package/dist/src/tools/pull-request.d.ts +195 -0
- package/dist/src/tools/pull-request.js +537 -0
- package/dist/src/tools/repository.d.ts +53 -0
- package/dist/src/tools/repository.js +134 -0
- package/dist/src/tools/screenshot.d.ts +21 -0
- package/dist/src/tools/screenshot.js +99 -0
- package/dist/src/tracker/assignee.d.ts +15 -0
- package/dist/src/tracker/assignee.js +65 -0
- package/dist/src/tracker/cards.d.ts +41 -0
- package/dist/src/tracker/cards.js +361 -0
- package/dist/src/tracker/comments.d.ts +9 -0
- package/dist/src/tracker/comments.js +68 -0
- package/dist/src/tracker/description.d.ts +19 -0
- package/dist/src/tracker/description.js +55 -0
- package/dist/src/tracker/hand-back.d.ts +8 -0
- package/dist/src/tracker/hand-back.js +60 -0
- package/dist/src/tracker/port.d.ts +2 -0
- package/dist/src/tracker/port.js +42 -0
- package/dist/src/tracker/states.d.ts +77 -0
- package/dist/src/tracker/states.js +189 -0
- package/dist/src/tracker/tools.d.ts +143 -0
- package/dist/src/tracker/tools.js +131 -0
- package/dist/src/tracker/transitions.d.ts +12 -0
- package/dist/src/tracker/transitions.js +101 -0
- package/edgar-extension.json +507 -0
- package/package.json +43 -3
- package/schemas/assign.in.json +15 -0
- package/schemas/assign.out.json +14 -0
- package/schemas/attach_screenshot.in.json +44 -0
- package/schemas/attach_screenshot.out.json +31 -0
- package/schemas/batch_cards.in.json +27 -0
- package/schemas/batch_cards.out.json +37 -0
- package/schemas/branch_protection.in.json +15 -0
- package/schemas/branch_protection.out.json +67 -0
- package/schemas/ci_run.in.json +12 -0
- package/schemas/ci_run.out.json +109 -0
- package/schemas/close.in.json +14 -0
- package/schemas/close.out.json +10 -0
- package/schemas/close_pull_request.in.json +21 -0
- package/schemas/close_pull_request.out.json +14 -0
- package/schemas/comment.in.json +19 -0
- package/schemas/comment.out.json +10 -0
- package/schemas/config.json +202 -0
- package/schemas/count_sighting.in.json +17 -0
- package/schemas/count_sighting.out.json +10 -0
- package/schemas/create_card.in.json +108 -0
- package/schemas/create_card.out.json +13 -0
- package/schemas/dependabot_alerts.in.json +49 -0
- package/schemas/dependabot_alerts.out.json +75 -0
- package/schemas/dismiss_dependabot_alert.in.json +26 -0
- package/schemas/dismiss_dependabot_alert.out.json +27 -0
- package/schemas/find_assignee.in.json +15 -0
- package/schemas/find_assignee.out.json +10 -0
- package/schemas/find_cards.in.json +18 -0
- package/schemas/find_cards.out.json +33 -0
- package/schemas/find_dependabot_dismissal.in.json +12 -0
- package/schemas/find_dependabot_dismissal.out.json +27 -0
- package/schemas/find_description.in.json +15 -0
- package/schemas/find_description.out.json +10 -0
- package/schemas/find_pull_request.in.json +25 -0
- package/schemas/find_pull_request.out.json +14 -0
- package/schemas/hand_back.in.json +11 -0
- package/schemas/hand_back.out.json +18 -0
- package/schemas/linked_pull_requests.in.json +15 -0
- package/schemas/linked_pull_requests.out.json +44 -0
- package/schemas/list_pull_requests.in.json +26 -0
- package/schemas/list_pull_requests.out.json +42 -0
- package/schemas/merge_pull_request.in.json +22 -0
- package/schemas/merge_pull_request.out.json +16 -0
- package/schemas/move.in.json +15 -0
- package/schemas/move.out.json +10 -0
- package/schemas/note_pull_request.in.json +15 -0
- package/schemas/note_pull_request.out.json +10 -0
- package/schemas/open_pull_request.in.json +113 -0
- package/schemas/open_pull_request.out.json +15 -0
- package/schemas/pull_request_checks.in.json +11 -0
- package/schemas/pull_request_checks.out.json +72 -0
- package/schemas/pull_request_discussion.in.json +11 -0
- package/schemas/pull_request_discussion.out.json +107 -0
- package/schemas/pull_request_state.in.json +11 -0
- package/schemas/pull_request_state.out.json +52 -0
- package/schemas/push_branch.in.json +21 -0
- package/schemas/push_branch.out.json +13 -0
- package/schemas/release_follow_ups.in.json +15 -0
- package/schemas/release_follow_ups.out.json +13 -0
- package/schemas/reopen_dependabot_alert.in.json +33 -0
- package/schemas/reopen_dependabot_alert.out.json +22 -0
- package/schemas/restore_assignee.in.json +20 -0
- package/schemas/restore_assignee.out.json +10 -0
- package/schemas/restore_description.in.json +20 -0
- package/schemas/restore_description.out.json +10 -0
- package/schemas/update_description.in.json +15 -0
- package/schemas/update_description.out.json +14 -0
- package/schemas/update_pull_request.in.json +81 -0
- package/schemas/update_pull_request.out.json +10 -0
- package/schemas/wait_for_checks.in.json +11 -0
- package/schemas/wait_for_checks.out.json +72 -0
- package/schemas/wait_for_merge.in.json +11 -0
- package/schemas/wait_for_merge.out.json +17 -0
- package/schemas/wait_for_passed_checks.in.json +11 -0
- package/schemas/wait_for_passed_checks.out.json +72 -0
- package/schemas/wait_for_review.in.json +11 -0
- package/schemas/wait_for_review.out.json +52 -0
- package/workflows/resume.toml +17 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
2
|
+
import { attemptAsync, done, err, ok, permanentFailure, } from "@kana-ai/edgar-sdk";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { github } from "#api/client";
|
|
5
|
+
import { forget, sweepAlerts } from "#feed/alerts";
|
|
6
|
+
import { redBranchCards, redPullCard, reviewCard } from "#feed/cards";
|
|
7
|
+
import { config } from "#schemas/config";
|
|
8
|
+
import { checkRuns, openPull, viewer } from "#schemas/github";
|
|
9
|
+
import { repoPath } from "#tools/pull-request";
|
|
10
|
+
const pause = async (signal, seconds) => await attemptAsync(async () => await sleep(seconds * 1000, undefined, { signal }), () => undefined);
|
|
11
|
+
/** What a part of the service does when the project did not set its table: it waits for the stop. */
|
|
12
|
+
async function idle(signal) {
|
|
13
|
+
while (!signal.aborted)
|
|
14
|
+
await pause(signal, 3600);
|
|
15
|
+
return done({});
|
|
16
|
+
}
|
|
17
|
+
/** The login EDGAR works as: `watch.login`, else the login of `GITHUB_TOKEN`. An App token cannot read `/user`, so an App needs `login`. */
|
|
18
|
+
async function loginOf(ctx, settings, watch) {
|
|
19
|
+
if (watch.login !== undefined)
|
|
20
|
+
return ok(watch.login);
|
|
21
|
+
if (settings.app !== undefined)
|
|
22
|
+
return err(permanentFailure("invalid", "[extensions.github.watch] login names the login of the App, such as edgar[bot], since an App's token cannot read /user"));
|
|
23
|
+
const me = await github(ctx, "GET", "/user", viewer);
|
|
24
|
+
return me.ok ? ok(me.value.login) : me;
|
|
25
|
+
}
|
|
26
|
+
/** The cards one repository asks for now: a review asked of EDGAR, each failed run on the newest commit of `base`, and red checks on EDGAR's own open pull requests. */
|
|
27
|
+
async function cardsOf(ctx, home, base, login) {
|
|
28
|
+
const repo = `/repos/${home.repo}`;
|
|
29
|
+
const open = await github(ctx, "GET", `${repo}/pulls?state=open&per_page=100`, z.array(openPull));
|
|
30
|
+
if (!open.ok)
|
|
31
|
+
return open;
|
|
32
|
+
const found = [];
|
|
33
|
+
for (const pull of open.value) {
|
|
34
|
+
const review = reviewCard(home, pull, login);
|
|
35
|
+
if (review !== undefined)
|
|
36
|
+
found.push(review);
|
|
37
|
+
if (pull.user?.login !== login)
|
|
38
|
+
continue;
|
|
39
|
+
const path = `${repo}/commits/${pull.head.sha}/check-runs?per_page=100`;
|
|
40
|
+
const runs = await github(ctx, "GET", path, checkRuns);
|
|
41
|
+
if (!runs.ok)
|
|
42
|
+
return runs;
|
|
43
|
+
const red = redPullCard(home, pull, runs.value.check_runs);
|
|
44
|
+
if (red !== undefined)
|
|
45
|
+
found.push(red);
|
|
46
|
+
}
|
|
47
|
+
const path = `${repo}/commits/${encodeURIComponent(base)}/check-runs?per_page=100`;
|
|
48
|
+
const runs = await github(ctx, "GET", path, checkRuns);
|
|
49
|
+
if (!runs.ok)
|
|
50
|
+
return runs;
|
|
51
|
+
found.push(...redBranchCards(home, base, runs.value.check_runs));
|
|
52
|
+
return ok(found);
|
|
53
|
+
}
|
|
54
|
+
/** One sweep over each watched repository; a fingerprint this process opened already is tracked, and EDGAR answers a repeat with the open card that holds it. After a sweep that read every repository on github.com, a fingerprint whose fault is gone is forgotten. A repository that fails is logged and the sweep goes on; a rate limit ends the sweep with its wait, since the limit is the token's; a refused token ends it. */
|
|
55
|
+
export async function sweep(ctx, settings, watch, login, opened) {
|
|
56
|
+
let read = 0;
|
|
57
|
+
let filed = 0;
|
|
58
|
+
let tracked = 0;
|
|
59
|
+
let whole = true;
|
|
60
|
+
const open = new Set();
|
|
61
|
+
for (const [service, repo] of Object.entries(watch.services)) {
|
|
62
|
+
const path = repoPath(repo);
|
|
63
|
+
if (path === undefined) {
|
|
64
|
+
ctx.log(`github watch: ${repo} of service ${service} is not on github.com, so it is not read`);
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const home = { service, repo: path, column: watch.card_column };
|
|
68
|
+
const found = await cardsOf(ctx, home, settings.default_base, login);
|
|
69
|
+
if (!found.ok) {
|
|
70
|
+
if (found.error.outcome === "permanent_failure" && found.error.kind === "unauthenticated")
|
|
71
|
+
return found;
|
|
72
|
+
ctx.log(`github watch: ${path}: ${found.error.message}`);
|
|
73
|
+
if (found.error.outcome === "temporary_failure" && found.error.kind === "rate_limited")
|
|
74
|
+
return ok({ read, filed, tracked, wait: found.error.retry_after ?? 0 });
|
|
75
|
+
whole = false;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
read += 1;
|
|
79
|
+
for (const card of found.value) {
|
|
80
|
+
const key = card.block.fingerprint ?? card.title;
|
|
81
|
+
open.add(key);
|
|
82
|
+
if (opened.has(key)) {
|
|
83
|
+
tracked += 1;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
const made = await ctx.cards.open(card);
|
|
87
|
+
if (!made.ok || made.value.outcome !== "done") {
|
|
88
|
+
const why = made.ok ? made.value.outcome : made.error.message;
|
|
89
|
+
ctx.log(`github watch: could not open "${card.title}": ${why}`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
opened.add(key);
|
|
93
|
+
filed += 1;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (whole)
|
|
97
|
+
forget(opened, open);
|
|
98
|
+
return ok({ read, filed, tracked, wait: 0 });
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The watch: with `[extensions.github.watch]` set, a sweep every `every_seconds` until the engine stops it; without it, it only waits. A refused token ends it with its permanent failure, which opens its breaker; a repository that fails waits for the next sweep, and after a rate limit the next sweep waits as long as GitHub asks.
|
|
102
|
+
* shortcut: what was filed lives in memory, so a restart asks for the open cards again, and EDGAR answers each with the card it has; upgrade when a service can keep state.
|
|
103
|
+
* shortcut: red checks on EDGAR's own pull request open a card that names the pull request's card, since a service cannot comment on a card or start a sub-run; upgrade when the engine takes a comment from a service.
|
|
104
|
+
*/
|
|
105
|
+
export async function watch(ctx) {
|
|
106
|
+
const parsed = config.safeParse(ctx.config ?? {});
|
|
107
|
+
if (!parsed.success)
|
|
108
|
+
return permanentFailure("invalid", "the [extensions.github] table does not match its schema");
|
|
109
|
+
const settings = parsed.data;
|
|
110
|
+
const table = settings.watch;
|
|
111
|
+
const signal = ctx.signal;
|
|
112
|
+
if (table === undefined)
|
|
113
|
+
return await idle(signal);
|
|
114
|
+
const login = await loginOf(ctx, settings, table);
|
|
115
|
+
if (!login.ok)
|
|
116
|
+
return login.error;
|
|
117
|
+
const opened = new Set();
|
|
118
|
+
while (!signal.aborted) {
|
|
119
|
+
const swept = await sweep(ctx, settings, table, login.value, opened);
|
|
120
|
+
if (!swept.ok)
|
|
121
|
+
return swept.error;
|
|
122
|
+
ctx.log(`github watch: ${JSON.stringify(swept.value)}`);
|
|
123
|
+
await pause(signal, Math.max(table.every_seconds, swept.value.wait));
|
|
124
|
+
}
|
|
125
|
+
return done({});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* The Dependabot feed: with `[extensions.github.dependabot]` set, a sweep every `every_seconds` until the engine stops it; without it, it only waits. A refused token ends it with its permanent failure, which opens its breaker; a repository that fails waits for the next sweep, and after a rate limit the next sweep waits as long as GitHub asks.
|
|
129
|
+
* shortcut: what was filed lives in memory, so a restart asks for the open cards again, and EDGAR answers each with the card it has; an alert that is still open after its card closed is filed again then. Upgrade when a service can keep state.
|
|
130
|
+
*/
|
|
131
|
+
export async function feedAlerts(ctx) {
|
|
132
|
+
const parsed = config.safeParse(ctx.config ?? {});
|
|
133
|
+
if (!parsed.success)
|
|
134
|
+
return permanentFailure("invalid", "the [extensions.github] table does not match its schema");
|
|
135
|
+
const table = parsed.data.dependabot;
|
|
136
|
+
const signal = ctx.signal;
|
|
137
|
+
if (table === undefined)
|
|
138
|
+
return await idle(signal);
|
|
139
|
+
const memory = { opened: new Set(), said: new Map() };
|
|
140
|
+
while (!signal.aborted) {
|
|
141
|
+
const swept = await sweepAlerts(ctx, table, memory);
|
|
142
|
+
if (!swept.ok)
|
|
143
|
+
return swept.error;
|
|
144
|
+
ctx.log(`github dependabot: ${JSON.stringify(swept.value)}`);
|
|
145
|
+
await pause(signal, Math.max(table.every_seconds, swept.value.wait));
|
|
146
|
+
}
|
|
147
|
+
return done({});
|
|
148
|
+
}
|
|
149
|
+
/** The one service of the extension: the watch and the Dependabot feed side by side, each off without its table. When one ends with a failure, the other is stopped and the service ends with that failure. */
|
|
150
|
+
export async function serve(ctx) {
|
|
151
|
+
const stop = new AbortController();
|
|
152
|
+
const signal = AbortSignal.any([ctx.signal, stop.signal]);
|
|
153
|
+
const failures = [];
|
|
154
|
+
const part = async (run) => {
|
|
155
|
+
const ended = await run({ ...ctx, signal });
|
|
156
|
+
if (ended.outcome === "done")
|
|
157
|
+
return;
|
|
158
|
+
failures.push(ended);
|
|
159
|
+
stop.abort();
|
|
160
|
+
};
|
|
161
|
+
await Promise.all([part(watch), part(feedAlerts)]);
|
|
162
|
+
return failures[0] ?? done({});
|
|
163
|
+
}
|
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
/** Every tool of the GitHub extension, by the name the manifest gives it. */
|
|
2
|
+
export declare const tools: {
|
|
3
|
+
open_pull_request: import("@kana-ai/edgar-sdk").Tool<{
|
|
4
|
+
repo: string;
|
|
5
|
+
branch: string;
|
|
6
|
+
title: string;
|
|
7
|
+
body: string;
|
|
8
|
+
review: string;
|
|
9
|
+
labels?: string[] | undefined;
|
|
10
|
+
large_diff_lines?: number | undefined;
|
|
11
|
+
path_notices?: {
|
|
12
|
+
prefix: string;
|
|
13
|
+
notice: string;
|
|
14
|
+
}[] | undefined;
|
|
15
|
+
checks?: {
|
|
16
|
+
results: {
|
|
17
|
+
check: string;
|
|
18
|
+
exit_code: number | null;
|
|
19
|
+
}[];
|
|
20
|
+
} | undefined;
|
|
21
|
+
not_verified?: string[] | undefined;
|
|
22
|
+
related?: string | string[] | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
url: string;
|
|
25
|
+
number: number;
|
|
26
|
+
}, "GITHUB_TOKEN">;
|
|
27
|
+
update_pull_request: import("@kana-ai/edgar-sdk").Tool<{
|
|
28
|
+
url: string;
|
|
29
|
+
title: string;
|
|
30
|
+
body: string;
|
|
31
|
+
large_diff_lines?: number | undefined;
|
|
32
|
+
path_notices?: {
|
|
33
|
+
prefix: string;
|
|
34
|
+
notice: string;
|
|
35
|
+
}[] | undefined;
|
|
36
|
+
checks?: {
|
|
37
|
+
results: {
|
|
38
|
+
check: string;
|
|
39
|
+
exit_code: number | null;
|
|
40
|
+
}[];
|
|
41
|
+
} | undefined;
|
|
42
|
+
not_verified?: string[] | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
url: string;
|
|
45
|
+
}, "GITHUB_TOKEN">;
|
|
46
|
+
attach_screenshot: import("@kana-ai/edgar-sdk").Tool<{
|
|
47
|
+
url: string;
|
|
48
|
+
shot: {
|
|
49
|
+
path: string;
|
|
50
|
+
bytes: number;
|
|
51
|
+
caption: string;
|
|
52
|
+
} | {
|
|
53
|
+
missing: string;
|
|
54
|
+
};
|
|
55
|
+
}, {
|
|
56
|
+
attached: true;
|
|
57
|
+
image: string;
|
|
58
|
+
} | {
|
|
59
|
+
attached: false;
|
|
60
|
+
missing: string;
|
|
61
|
+
}, "GITHUB_TOKEN">;
|
|
62
|
+
close_pull_request: import("@kana-ai/edgar-sdk").Tool<{
|
|
63
|
+
stage_output: {
|
|
64
|
+
url: string;
|
|
65
|
+
};
|
|
66
|
+
text?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
url: string;
|
|
69
|
+
state: "closed" | "merged" | "open";
|
|
70
|
+
}, "GITHUB_TOKEN">;
|
|
71
|
+
note_pull_request: import("@kana-ai/edgar-sdk").Tool<{
|
|
72
|
+
url: string;
|
|
73
|
+
text: string;
|
|
74
|
+
}, {
|
|
75
|
+
url: string;
|
|
76
|
+
}, "GITHUB_TOKEN">;
|
|
77
|
+
linked_pull_requests: import("@kana-ai/edgar-sdk").Tool<{
|
|
78
|
+
text: string;
|
|
79
|
+
repo: string;
|
|
80
|
+
}, {
|
|
81
|
+
pull_requests: {
|
|
82
|
+
url: string;
|
|
83
|
+
state: "closed" | "merged" | "open";
|
|
84
|
+
title: string;
|
|
85
|
+
body: string;
|
|
86
|
+
files: {
|
|
87
|
+
path: string;
|
|
88
|
+
patch: string;
|
|
89
|
+
}[];
|
|
90
|
+
}[];
|
|
91
|
+
}, "GITHUB_TOKEN">;
|
|
92
|
+
find_pull_request: import("@kana-ai/edgar-sdk").Tool<{
|
|
93
|
+
operation_id: string;
|
|
94
|
+
input: {
|
|
95
|
+
repo: string;
|
|
96
|
+
branch: string;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
url: string;
|
|
100
|
+
state: "closed" | "merged" | "open";
|
|
101
|
+
}, "GITHUB_TOKEN">;
|
|
102
|
+
list_pull_requests: import("@kana-ai/edgar-sdk").Tool<{
|
|
103
|
+
services: {
|
|
104
|
+
repo: string;
|
|
105
|
+
}[];
|
|
106
|
+
merged_within_hours?: number | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
pull_requests: {
|
|
109
|
+
url: string;
|
|
110
|
+
branch: string;
|
|
111
|
+
card: string;
|
|
112
|
+
unmerged: {
|
|
113
|
+
url: string;
|
|
114
|
+
state: "closed" | "open";
|
|
115
|
+
}[];
|
|
116
|
+
}[];
|
|
117
|
+
}, "GITHUB_TOKEN">;
|
|
118
|
+
pull_request_state: import("@kana-ai/edgar-sdk").Tool<{
|
|
119
|
+
url: string;
|
|
120
|
+
}, {
|
|
121
|
+
url: string;
|
|
122
|
+
state: "closed" | "merged" | "open";
|
|
123
|
+
merged: boolean;
|
|
124
|
+
review_state: "approved" | "changes_requested" | "pending";
|
|
125
|
+
approved_by: string[];
|
|
126
|
+
card: string | null;
|
|
127
|
+
commit: string;
|
|
128
|
+
branch: string;
|
|
129
|
+
head_repo: string | null;
|
|
130
|
+
}, "GITHUB_TOKEN">;
|
|
131
|
+
wait_for_review: import("@kana-ai/edgar-sdk").Tool<{
|
|
132
|
+
url: string;
|
|
133
|
+
}, {
|
|
134
|
+
url: string;
|
|
135
|
+
state: "closed" | "merged" | "open";
|
|
136
|
+
merged: boolean;
|
|
137
|
+
review_state: "approved" | "changes_requested" | "pending";
|
|
138
|
+
approved_by: string[];
|
|
139
|
+
card: string | null;
|
|
140
|
+
commit: string;
|
|
141
|
+
branch: string;
|
|
142
|
+
head_repo: string | null;
|
|
143
|
+
}, "GITHUB_TOKEN">;
|
|
144
|
+
wait_for_merge: import("@kana-ai/edgar-sdk").Tool<{
|
|
145
|
+
url: string;
|
|
146
|
+
}, {
|
|
147
|
+
url: string;
|
|
148
|
+
merged: boolean;
|
|
149
|
+
sha?: string | undefined;
|
|
150
|
+
}, "GITHUB_TOKEN">;
|
|
151
|
+
merge_pull_request: import("@kana-ai/edgar-sdk").Tool<{
|
|
152
|
+
url: string;
|
|
153
|
+
commit: string;
|
|
154
|
+
changed_files?: number | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
url: string;
|
|
157
|
+
merged: boolean;
|
|
158
|
+
commit: string;
|
|
159
|
+
}, "GITHUB_TOKEN">;
|
|
160
|
+
pull_request_checks: import("@kana-ai/edgar-sdk").Tool<{
|
|
161
|
+
url: string;
|
|
162
|
+
}, {
|
|
163
|
+
url: string;
|
|
164
|
+
commit: string;
|
|
165
|
+
state: "closed" | "failed" | "passed" | "pending";
|
|
166
|
+
merged: boolean;
|
|
167
|
+
checks: number;
|
|
168
|
+
failed: {
|
|
169
|
+
name: string;
|
|
170
|
+
url: string | null;
|
|
171
|
+
}[];
|
|
172
|
+
retry_after_seconds: number | null;
|
|
173
|
+
summary: string;
|
|
174
|
+
changed_files: number;
|
|
175
|
+
}, "GITHUB_TOKEN">;
|
|
176
|
+
wait_for_checks: import("@kana-ai/edgar-sdk").Tool<{
|
|
177
|
+
url: string;
|
|
178
|
+
}, {
|
|
179
|
+
url: string;
|
|
180
|
+
commit: string;
|
|
181
|
+
state: "closed" | "failed" | "passed" | "pending";
|
|
182
|
+
merged: boolean;
|
|
183
|
+
checks: number;
|
|
184
|
+
failed: {
|
|
185
|
+
name: string;
|
|
186
|
+
url: string | null;
|
|
187
|
+
}[];
|
|
188
|
+
retry_after_seconds: number | null;
|
|
189
|
+
summary: string;
|
|
190
|
+
changed_files: number;
|
|
191
|
+
}, "GITHUB_TOKEN">;
|
|
192
|
+
wait_for_passed_checks: import("@kana-ai/edgar-sdk").Tool<{
|
|
193
|
+
url: string;
|
|
194
|
+
}, {
|
|
195
|
+
url: string;
|
|
196
|
+
commit: string;
|
|
197
|
+
state: "closed" | "failed" | "passed" | "pending";
|
|
198
|
+
merged: boolean;
|
|
199
|
+
checks: number;
|
|
200
|
+
failed: {
|
|
201
|
+
name: string;
|
|
202
|
+
url: string | null;
|
|
203
|
+
}[];
|
|
204
|
+
retry_after_seconds: number | null;
|
|
205
|
+
summary: string;
|
|
206
|
+
changed_files: number;
|
|
207
|
+
}, "GITHUB_TOKEN">;
|
|
208
|
+
ci_run: import("@kana-ai/edgar-sdk").Tool<{
|
|
209
|
+
url: string;
|
|
210
|
+
}, {
|
|
211
|
+
url: string;
|
|
212
|
+
workflow: string | null;
|
|
213
|
+
status: string | null;
|
|
214
|
+
conclusion: string | null;
|
|
215
|
+
commit: string;
|
|
216
|
+
branch: string | null;
|
|
217
|
+
attempt: number;
|
|
218
|
+
jobs: {
|
|
219
|
+
id: number;
|
|
220
|
+
name: string;
|
|
221
|
+
status: string;
|
|
222
|
+
conclusion: string | null;
|
|
223
|
+
failed_steps: string[];
|
|
224
|
+
}[];
|
|
225
|
+
logs: {
|
|
226
|
+
job: number;
|
|
227
|
+
name: string;
|
|
228
|
+
gone: boolean;
|
|
229
|
+
errors: string[];
|
|
230
|
+
excerpt: string;
|
|
231
|
+
}[];
|
|
232
|
+
unread: number[];
|
|
233
|
+
}, "GITHUB_TOKEN">;
|
|
234
|
+
dependabot_alerts: import("@kana-ai/edgar-sdk").Tool<{
|
|
235
|
+
repo: string;
|
|
236
|
+
number?: number | undefined;
|
|
237
|
+
state?: ("auto_dismissed" | "dismissed" | "fixed" | "open")[] | undefined;
|
|
238
|
+
package?: string | undefined;
|
|
239
|
+
ghsa?: string[] | undefined;
|
|
240
|
+
cve?: string[] | undefined;
|
|
241
|
+
limit?: number | undefined;
|
|
242
|
+
}, {
|
|
243
|
+
alerts: {
|
|
244
|
+
number: number;
|
|
245
|
+
url: string;
|
|
246
|
+
state: string;
|
|
247
|
+
package: string | null;
|
|
248
|
+
ecosystem: string | null;
|
|
249
|
+
severity: string;
|
|
250
|
+
vulnerable_range: string;
|
|
251
|
+
first_patched: string | null;
|
|
252
|
+
manifest: string | null;
|
|
253
|
+
scope: string | null;
|
|
254
|
+
ghsa: string;
|
|
255
|
+
cve: string | null;
|
|
256
|
+
summary: string;
|
|
257
|
+
}[];
|
|
258
|
+
complete: boolean;
|
|
259
|
+
}, "GITHUB_TOKEN">;
|
|
260
|
+
branch_protection: import("@kana-ai/edgar-sdk").Tool<{
|
|
261
|
+
repo: string;
|
|
262
|
+
branch: string;
|
|
263
|
+
}, {
|
|
264
|
+
branch: string;
|
|
265
|
+
protected: boolean;
|
|
266
|
+
pull_request_required: boolean | null;
|
|
267
|
+
required_approvals: number | null;
|
|
268
|
+
required_checks: string[];
|
|
269
|
+
rules: {
|
|
270
|
+
type: string;
|
|
271
|
+
ruleset_id: number;
|
|
272
|
+
source: string;
|
|
273
|
+
}[];
|
|
274
|
+
classic: "none" | "read" | "unreadable";
|
|
275
|
+
}, "GITHUB_TOKEN">;
|
|
276
|
+
dismiss_dependabot_alert: import("@kana-ai/edgar-sdk").Tool<{
|
|
277
|
+
repo: string;
|
|
278
|
+
number: number;
|
|
279
|
+
reason: "fix_started" | "inaccurate" | "no_bandwidth" | "not_used" | "tolerable_risk";
|
|
280
|
+
comment: string;
|
|
281
|
+
}, {
|
|
282
|
+
repo: string;
|
|
283
|
+
number: number;
|
|
284
|
+
url: string;
|
|
285
|
+
reason: string;
|
|
286
|
+
reopen: boolean;
|
|
287
|
+
}, "GITHUB_TOKEN">;
|
|
288
|
+
reopen_dependabot_alert: import("@kana-ai/edgar-sdk").Tool<{
|
|
289
|
+
stage_output: {
|
|
290
|
+
repo: string;
|
|
291
|
+
number: number;
|
|
292
|
+
url: string;
|
|
293
|
+
reason: string;
|
|
294
|
+
reopen: boolean;
|
|
295
|
+
};
|
|
296
|
+
}, {
|
|
297
|
+
repo: string;
|
|
298
|
+
number: number;
|
|
299
|
+
url: string;
|
|
300
|
+
reopened: boolean;
|
|
301
|
+
}, "GITHUB_TOKEN">;
|
|
302
|
+
find_dependabot_dismissal: import("@kana-ai/edgar-sdk").Tool<{
|
|
303
|
+
operation_id: string;
|
|
304
|
+
input: unknown;
|
|
305
|
+
}, {
|
|
306
|
+
repo: string;
|
|
307
|
+
number: number;
|
|
308
|
+
url: string;
|
|
309
|
+
reason: string;
|
|
310
|
+
reopen: boolean;
|
|
311
|
+
}, "GITHUB_TOKEN">;
|
|
312
|
+
pull_request_discussion: import("@kana-ai/edgar-sdk").Tool<{
|
|
313
|
+
url: string;
|
|
314
|
+
}, {
|
|
315
|
+
url: string;
|
|
316
|
+
reviews: {
|
|
317
|
+
by: string | null;
|
|
318
|
+
at: string | null;
|
|
319
|
+
body: string;
|
|
320
|
+
state: string;
|
|
321
|
+
}[];
|
|
322
|
+
threads: {
|
|
323
|
+
by: string | null;
|
|
324
|
+
at: string | null;
|
|
325
|
+
body: string;
|
|
326
|
+
path: string;
|
|
327
|
+
line: number | null;
|
|
328
|
+
hunk: string;
|
|
329
|
+
replies: {
|
|
330
|
+
by: string | null;
|
|
331
|
+
at: string | null;
|
|
332
|
+
body: string;
|
|
333
|
+
}[];
|
|
334
|
+
}[];
|
|
335
|
+
conversation: {
|
|
336
|
+
by: string | null;
|
|
337
|
+
at: string | null;
|
|
338
|
+
body: string;
|
|
339
|
+
}[];
|
|
340
|
+
complete: boolean;
|
|
341
|
+
}, "GITHUB_TOKEN">;
|
|
342
|
+
comment: import("@kana-ai/edgar-sdk").Tool<{
|
|
343
|
+
card: string;
|
|
344
|
+
text: string;
|
|
345
|
+
link?: string;
|
|
346
|
+
}, {
|
|
347
|
+
id: string;
|
|
348
|
+
}, "GITHUB_TOKEN">;
|
|
349
|
+
move: import("@kana-ai/edgar-sdk").Tool<{
|
|
350
|
+
card: string;
|
|
351
|
+
column: string;
|
|
352
|
+
}, {
|
|
353
|
+
column: string;
|
|
354
|
+
}, "GITHUB_TOKEN">;
|
|
355
|
+
close: import("@kana-ai/edgar-sdk").Tool<{
|
|
356
|
+
card: string;
|
|
357
|
+
reason: string;
|
|
358
|
+
}, {
|
|
359
|
+
state: string;
|
|
360
|
+
}, "GITHUB_TOKEN">;
|
|
361
|
+
create_card: import("@kana-ai/edgar-sdk").Tool<{
|
|
362
|
+
spec: {
|
|
363
|
+
title: string;
|
|
364
|
+
description: string;
|
|
365
|
+
column?: string;
|
|
366
|
+
labels?: string[];
|
|
367
|
+
block: {
|
|
368
|
+
kind: "defect" | "investigation" | "question" | "request";
|
|
369
|
+
service?: string;
|
|
370
|
+
environment?: string;
|
|
371
|
+
fingerprint?: string;
|
|
372
|
+
first_seen?: string;
|
|
373
|
+
last_seen?: string;
|
|
374
|
+
occurrences?: number;
|
|
375
|
+
severity?: string;
|
|
376
|
+
window?: string;
|
|
377
|
+
waits_for?: string;
|
|
378
|
+
decided?: Record<string, string>;
|
|
379
|
+
origin?: {
|
|
380
|
+
extension: string;
|
|
381
|
+
channel: string;
|
|
382
|
+
thread: string;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
parent?: string;
|
|
387
|
+
}, {
|
|
388
|
+
id: string;
|
|
389
|
+
url: string;
|
|
390
|
+
}, "GITHUB_TOKEN">;
|
|
391
|
+
release_follow_ups: import("@kana-ai/edgar-sdk").Tool<{
|
|
392
|
+
card: string;
|
|
393
|
+
pull_request: string;
|
|
394
|
+
}, {
|
|
395
|
+
released: string[];
|
|
396
|
+
}, "GITHUB_TOKEN">;
|
|
397
|
+
count_sighting: import("@kana-ai/edgar-sdk").Tool<{
|
|
398
|
+
card: string;
|
|
399
|
+
seen_at?: string;
|
|
400
|
+
}, {
|
|
401
|
+
id: string;
|
|
402
|
+
}, "GITHUB_TOKEN">;
|
|
403
|
+
batch_cards: import("@kana-ai/edgar-sdk").Tool<{
|
|
404
|
+
batch: string;
|
|
405
|
+
except: string;
|
|
406
|
+
only?: string[] | undefined;
|
|
407
|
+
}, {
|
|
408
|
+
cards: {
|
|
409
|
+
id: string;
|
|
410
|
+
title: string;
|
|
411
|
+
url: string;
|
|
412
|
+
description: string;
|
|
413
|
+
}[];
|
|
414
|
+
skipped?: string[] | undefined;
|
|
415
|
+
}, "GITHUB_TOKEN">;
|
|
416
|
+
find_cards: import("@kana-ai/edgar-sdk").Tool<{
|
|
417
|
+
text: string;
|
|
418
|
+
except?: string;
|
|
419
|
+
}, {
|
|
420
|
+
cards: {
|
|
421
|
+
id: string;
|
|
422
|
+
title: string;
|
|
423
|
+
url: string;
|
|
424
|
+
state: string;
|
|
425
|
+
created_at: string;
|
|
426
|
+
}[];
|
|
427
|
+
}, "GITHUB_TOKEN">;
|
|
428
|
+
hand_back: import("@kana-ai/edgar-sdk").Tool<{
|
|
429
|
+
card: string;
|
|
430
|
+
}, {
|
|
431
|
+
id: string;
|
|
432
|
+
to: string;
|
|
433
|
+
previous: string;
|
|
434
|
+
}, "GITHUB_TOKEN">;
|
|
435
|
+
update_description: import("@kana-ai/edgar-sdk").Tool<{
|
|
436
|
+
card: string;
|
|
437
|
+
description: string;
|
|
438
|
+
}, {
|
|
439
|
+
id: string;
|
|
440
|
+
previous?: string | undefined;
|
|
441
|
+
}, "GITHUB_TOKEN">;
|
|
442
|
+
restore_description: import("@kana-ai/edgar-sdk").Tool<{
|
|
443
|
+
stage_output: {
|
|
444
|
+
id: string;
|
|
445
|
+
previous?: string | undefined;
|
|
446
|
+
};
|
|
447
|
+
}, {
|
|
448
|
+
id: string;
|
|
449
|
+
}, "GITHUB_TOKEN">;
|
|
450
|
+
find_description: import("@kana-ai/edgar-sdk").Tool<{
|
|
451
|
+
card: string;
|
|
452
|
+
description: string;
|
|
453
|
+
}, {
|
|
454
|
+
id: string;
|
|
455
|
+
}, "GITHUB_TOKEN">;
|
|
456
|
+
assign: import("@kana-ai/edgar-sdk").Tool<{
|
|
457
|
+
card: string;
|
|
458
|
+
user: string;
|
|
459
|
+
}, {
|
|
460
|
+
id: string;
|
|
461
|
+
previous?: string | undefined;
|
|
462
|
+
}, "GITHUB_TOKEN">;
|
|
463
|
+
restore_assignee: import("@kana-ai/edgar-sdk").Tool<{
|
|
464
|
+
stage_output: {
|
|
465
|
+
id: string;
|
|
466
|
+
previous?: string | undefined;
|
|
467
|
+
};
|
|
468
|
+
}, {
|
|
469
|
+
id: string;
|
|
470
|
+
}, "GITHUB_TOKEN">;
|
|
471
|
+
find_assignee: import("@kana-ai/edgar-sdk").Tool<{
|
|
472
|
+
card: string;
|
|
473
|
+
user: string;
|
|
474
|
+
}, {
|
|
475
|
+
id: string;
|
|
476
|
+
}, "GITHUB_TOKEN">;
|
|
477
|
+
push_branch: import("@kana-ai/edgar-sdk").Tool<{
|
|
478
|
+
repo: string;
|
|
479
|
+
branch?: string | undefined;
|
|
480
|
+
to?: string | undefined;
|
|
481
|
+
}, {
|
|
482
|
+
branch: string;
|
|
483
|
+
commit: string;
|
|
484
|
+
}, never>;
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* 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]`.
|
|
488
|
+
*/
|
|
489
|
+
declare const _default: import("@kana-ai/edgar-sdk").Extension;
|
|
490
|
+
export default _default;
|