@kana-ai/edgar-ext-github 0.1.2 → 0.1.4
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/README.md +130 -74
- package/dist/src/api/app.d.ts +25 -6
- package/dist/src/api/app.js +72 -9
- package/dist/src/api/client.d.ts +9 -6
- package/dist/src/api/client.js +58 -19
- package/dist/src/api/commits.d.ts +4 -0
- package/dist/src/api/commits.js +69 -0
- package/dist/src/api/failures.d.ts +4 -0
- package/dist/src/api/failures.js +14 -1
- package/dist/src/feed/alerts.d.ts +9 -3
- package/dist/src/feed/alerts.js +66 -6
- package/dist/src/feed/service.d.ts +10 -1
- package/dist/src/feed/service.js +79 -16
- package/dist/src/index.d.ts +97 -1
- package/dist/src/index.js +17 -4
- package/dist/src/schemas/config.d.ts +1 -0
- package/dist/src/schemas/config.js +73 -29
- package/dist/src/schemas/github.d.ts +121 -1
- package/dist/src/schemas/github.js +37 -2
- package/dist/src/schemas/tools.d.ts +159 -2
- package/dist/src/schemas/tools.js +129 -6
- package/dist/src/tools/alerts.js +1 -0
- package/dist/src/tools/branch.d.ts +12 -0
- package/dist/src/tools/branch.js +69 -1
- package/dist/src/tools/pull-request.d.ts +55 -7
- package/dist/src/tools/pull-request.js +131 -42
- package/dist/src/tools/revert.d.ts +27 -0
- package/dist/src/tools/revert.js +98 -0
- package/dist/src/tools/screenshot.d.ts +1 -1
- package/dist/src/tools/screenshot.js +25 -11
- package/dist/src/tracker/cards.d.ts +1 -1
- package/dist/src/tracker/cards.js +84 -8
- package/dist/src/tracker/comments.d.ts +14 -2
- package/dist/src/tracker/comments.js +100 -4
- package/dist/src/tracker/port.d.ts +1 -1
- package/dist/src/tracker/port.js +4 -6
- package/dist/src/tracker/read-link.d.ts +2 -0
- package/dist/src/tracker/read-link.js +23 -0
- package/dist/src/tracker/states.d.ts +14 -3
- package/dist/src/tracker/states.js +37 -6
- package/dist/src/tracker/tools.d.ts +27 -0
- package/dist/src/tracker/tools.js +63 -7
- package/dist/src/tracker/transitions.d.ts +14 -3
- package/dist/src/tracker/transitions.js +57 -10
- package/edgar-extension.json +121 -7
- package/package.json +3 -3
- package/schemas/attach_screenshot.in.json +19 -0
- package/schemas/config.json +49 -23
- package/schemas/create_card.in.json +4 -0
- package/schemas/delete_closed_branches.in.json +26 -0
- package/schemas/delete_closed_branches.out.json +22 -0
- package/schemas/find_revert_pull_request.in.json +21 -0
- package/schemas/find_revert_pull_request.out.json +14 -0
- package/schemas/list_pull_requests.out.json +5 -1
- package/schemas/mark_seen.in.json +11 -0
- package/schemas/mark_seen.out.json +10 -0
- package/schemas/merged_pull_request.in.json +17 -0
- package/schemas/merged_pull_request.out.json +18 -0
- package/schemas/open_pull_request.in.json +73 -1
- package/schemas/park.in.json +15 -0
- package/schemas/park.out.json +10 -0
- package/schemas/pull_request_state.out.json +10 -1
- package/schemas/release_follow_ups.in.json +5 -0
- package/schemas/retitle.in.json +16 -0
- package/schemas/retitle.out.json +13 -0
- package/schemas/revert_pull_request.in.json +11 -0
- package/schemas/revert_pull_request.out.json +14 -0
- package/schemas/set_priority.in.json +16 -0
- package/schemas/set_priority.out.json +10 -0
- package/schemas/update_pull_request.in.json +28 -1
- package/schemas/wait_for_review.out.json +10 -1
|
@@ -1,15 +1,37 @@
|
|
|
1
|
-
import { defineTool, done } from "@kana-ai/edgar-sdk";
|
|
2
|
-
import { apiAccess } from "#api/client";
|
|
3
|
-
import {
|
|
1
|
+
import { defineTool, done, readBlock, retitled, skipped } from "@kana-ai/edgar-sdk";
|
|
2
|
+
import { apiAccess, github } from "#api/client";
|
|
3
|
+
import { issue } from "#schemas/github";
|
|
4
|
+
import { assignTool, batchCardsTool, closeTool, commentTool, countSightingTool, createCardTool, descriptionTool, findCardsTool, handBackTool, markSeenTool, moveTool, parkTool, releaseFollowUpsTool, restoreTool, retitleTool, setPriorityTool, } from "#schemas/tools";
|
|
4
5
|
import { assign, findAssignee, restoreAssignee } from "#tracker/assignee";
|
|
5
6
|
import { batchCards, countSightingOn, createCard, findCards } from "#tracker/cards";
|
|
6
|
-
import { postComment } from "#tracker/comments";
|
|
7
|
+
import { markSeen, postComment } from "#tracker/comments";
|
|
7
8
|
import { findDescription, restoreDescription, updateDescription } from "#tracker/description";
|
|
8
9
|
import { handBack } from "#tracker/hand-back";
|
|
9
|
-
import { releaseFollowUps, transition } from "#tracker/transitions";
|
|
10
|
+
import { park, releaseFollowUps, setPriority, transition } from "#tracker/transitions";
|
|
11
|
+
import { issueOf, settingsOf } from "#tracker/states";
|
|
12
|
+
/** Gives an issue that a feeder filed the title `retitled` makes of `text`, after `title_prefix` so the issue stays in scope. Only the title changes: the block already keeps the feeder's title in `decided.filed_as`, and a new title alone starts no run again. An issue a person wrote, or one already titled so, is `skipped`. */
|
|
13
|
+
async function retitle(ctx, card, text) {
|
|
14
|
+
const settings = settingsOf(ctx);
|
|
15
|
+
if (!settings.ok)
|
|
16
|
+
return settings.error;
|
|
17
|
+
const target = issueOf(settings.value, card);
|
|
18
|
+
if (!target.ok)
|
|
19
|
+
return target.error;
|
|
20
|
+
const read = await github(ctx, "GET", target.value.path, issue);
|
|
21
|
+
if (!read.ok)
|
|
22
|
+
return read.error;
|
|
23
|
+
const block = readBlock(read.value.body ?? "");
|
|
24
|
+
const prefix = settings.value.tracker.title_prefix;
|
|
25
|
+
const title = block.ok ? retitled(block.value, read.value.title, text, prefix) : undefined;
|
|
26
|
+
if (title === undefined)
|
|
27
|
+
return skipped();
|
|
28
|
+
const written = await github(ctx, "PATCH", target.value.path, issue, { title });
|
|
29
|
+
return written.ok ? done({ id: card, title }) : written.error;
|
|
30
|
+
}
|
|
10
31
|
/** The tools of the GitHub Issues tracker, by the names the default workflows call on a tracker. */
|
|
11
32
|
export const trackerTools = {
|
|
12
33
|
comment: defineTool({
|
|
34
|
+
publishes: true,
|
|
13
35
|
description: "Post a comment on a card, with an optional link on its own line",
|
|
14
36
|
input: commentTool.input,
|
|
15
37
|
output: commentTool.output,
|
|
@@ -35,20 +57,35 @@ export const trackerTools = {
|
|
|
35
57
|
}),
|
|
36
58
|
/** `parent` is not used: see the shortcut in the README. */
|
|
37
59
|
create_card: defineTool({
|
|
60
|
+
publishes: true,
|
|
38
61
|
description: "File a card, or return the open card that holds its fingerprint",
|
|
39
62
|
input: createCardTool.input,
|
|
40
63
|
output: createCardTool.output,
|
|
41
64
|
...apiAccess,
|
|
42
65
|
execute: async ({ spec }, ctx) => await createCard(ctx, spec),
|
|
43
66
|
}),
|
|
67
|
+
park: defineTool({
|
|
68
|
+
description: "Park a card until another card's pull request merges: move it to intake and write waits_for into its block",
|
|
69
|
+
input: parkTool.input,
|
|
70
|
+
output: parkTool.output,
|
|
71
|
+
...apiAccess,
|
|
72
|
+
execute: async ({ card, waits_for }, ctx) => await park(ctx, card, waits_for),
|
|
73
|
+
}),
|
|
44
74
|
release_follow_ups: defineTool({
|
|
45
|
-
description: "Move the cards that wait for a card's
|
|
75
|
+
description: "Move the cards that wait for a card's pull request to ready once it merged, or with column waiting_on_person to a person once it closed with no merge",
|
|
46
76
|
input: releaseFollowUpsTool.input,
|
|
47
77
|
output: releaseFollowUpsTool.output,
|
|
48
78
|
...apiAccess,
|
|
49
|
-
execute: async ({ card }, ctx) => await releaseFollowUps(ctx, card),
|
|
79
|
+
execute: async ({ card, column }, ctx) => await releaseFollowUps(ctx, card, column ?? "ready"),
|
|
50
80
|
}),
|
|
51
81
|
/** A retry with the same `seen_at` finds the sighting counted and writes nothing; with no `seen_at`, a retry whose first answer was lost counts it twice. */
|
|
82
|
+
set_priority: defineTool({
|
|
83
|
+
description: "Give a card the priority:<priority> label from EDGAR's analysis; skipped when the issue has a priority label already",
|
|
84
|
+
input: setPriorityTool.input,
|
|
85
|
+
output: setPriorityTool.output,
|
|
86
|
+
...apiAccess,
|
|
87
|
+
execute: async ({ card, priority }, ctx) => await setPriority(ctx, card, priority),
|
|
88
|
+
}),
|
|
52
89
|
count_sighting: defineTool({
|
|
53
90
|
description: "Count one more sighting of the fault that an open card holds: raise occurrences and last_seen in its block; a card with no block is not written",
|
|
54
91
|
input: countSightingTool.input,
|
|
@@ -78,8 +115,17 @@ export const trackerTools = {
|
|
|
78
115
|
...apiAccess,
|
|
79
116
|
execute: async ({ card }, ctx) => await handBack(ctx, card),
|
|
80
117
|
}),
|
|
118
|
+
/** GitHub keeps one reaction of a kind per account, so a retry adds none. */
|
|
119
|
+
mark_seen: defineTool({
|
|
120
|
+
description: "Mark a card seen with an eyes reaction, so the person who filed it knows EDGAR picked it up",
|
|
121
|
+
input: markSeenTool.input,
|
|
122
|
+
output: markSeenTool.output,
|
|
123
|
+
...apiAccess,
|
|
124
|
+
execute: async ({ card }, ctx) => await markSeen(ctx, card),
|
|
125
|
+
}),
|
|
81
126
|
/** A retry writes the same text again, which changes nothing; the lookup tells boot whether a call that did not end wrote it. */
|
|
82
127
|
update_description: defineTool({
|
|
128
|
+
publishes: true,
|
|
83
129
|
description: "Replace a card's description, keeping its edgar:v0 block",
|
|
84
130
|
input: descriptionTool.input,
|
|
85
131
|
output: descriptionTool.output,
|
|
@@ -89,6 +135,16 @@ export const trackerTools = {
|
|
|
89
135
|
lookup: "find_description",
|
|
90
136
|
execute: async ({ card, description }, ctx) => await updateDescription(ctx, card, description),
|
|
91
137
|
}),
|
|
138
|
+
retitle: defineTool({
|
|
139
|
+
description: "Give a card that a feeder filed a title in plain words, from the first sentence of a summary; skipped for a card a person wrote. The block keeps the feeder's title in decided.filed_as",
|
|
140
|
+
input: retitleTool.input,
|
|
141
|
+
output: retitleTool.output,
|
|
142
|
+
...apiAccess,
|
|
143
|
+
side_effect: true,
|
|
144
|
+
undo: "none",
|
|
145
|
+
undo_reason: "The plain title names the same fault, and the block keeps the title the feeder gave, so it stays true when a later stage is undone.",
|
|
146
|
+
execute: async ({ card, text }, ctx) => await retitle(ctx, card, text),
|
|
147
|
+
}),
|
|
92
148
|
restore_description: defineTool({
|
|
93
149
|
description: "Put back the description a card had before update_description",
|
|
94
150
|
input: restoreTool.input,
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import { type Outcome } from "@kana-ai/edgar-sdk";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
import type { setPriorityTool } from "#schemas/tools";
|
|
2
4
|
import { type State, type GithubCtx } from "#tracker/states";
|
|
5
|
+
import type { FollowUpColumn } from "#schemas/tools";
|
|
3
6
|
/** Moves a card to `target`: forward only unless `force`, and `skipped` for a name that is not an engine state or an open issue out of scope. An open state adds its column label and takes the others off, and opens a closed issue again; `done` closes it as completed and `cancelled` as not planned, and takes its column labels off. A move to any state but `waiting_on_person` takes edgar:waiting off, so the card no longer waits on a person. Labels change one at a time, so a label a person sets meanwhile stays. */
|
|
4
7
|
export declare function transition(ctx: GithubCtx, card: string, target: string, force?: boolean): Promise<Outcome<{
|
|
5
8
|
column: State;
|
|
6
9
|
}>>;
|
|
7
|
-
/** Sets a card's labels to `labels` whole, keeping the column labels that say its engine state. */
|
|
10
|
+
/** Sets a card's labels to `labels` whole, keeping the column labels that say its engine state and the priority label a person set; a priority label in `labels` is dropped, since only a person or `set_priority` sets a priority. */
|
|
8
11
|
export declare function setLabels(ctx: GithubCtx, card: string, labels: readonly string[]): Promise<Outcome<null>>;
|
|
9
|
-
/**
|
|
10
|
-
export declare function
|
|
12
|
+
/** Gives a card the `priority:<priority>` label, unless the issue has a `priority:` label already, which stays: then `skipped`. */
|
|
13
|
+
export declare function setPriority(ctx: GithubCtx, card: string, priority: z.infer<typeof setPriorityTool.input>["priority"]): Promise<Outcome<{
|
|
14
|
+
id: string;
|
|
15
|
+
}>>;
|
|
16
|
+
/** Parks a card until `waitsFor` merges: a forced move to `intake`, then `waits_for` in its block, a `request` block when it has none, so `release_follow_ups` finds it. The move goes first, so an issue out of scope is `skipped` with nothing written; a retry after a failed write moves nothing and writes the block. */
|
|
17
|
+
export declare function park(ctx: GithubCtx, card: string, waitsFor: string): Promise<Outcome<{
|
|
18
|
+
id: string;
|
|
19
|
+
}>>;
|
|
20
|
+
/** Moves each card in `intake` whose block waits for `card` to `column`, and answers the ids it moved. */
|
|
21
|
+
export declare function releaseFollowUps(ctx: GithubCtx, card: string, column: FollowUpColumn): Promise<Outcome<{
|
|
11
22
|
released: string[];
|
|
12
23
|
}>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { done, skipped } from "@kana-ai/edgar-sdk";
|
|
1
|
+
import { done, readBlock, skipped, withBlock } from "@kana-ai/edgar-sdk";
|
|
2
2
|
import { github } from "#api/client";
|
|
3
|
-
import { issue } from "#schemas/github";
|
|
3
|
+
import { issue, namedLabel } from "#schemas/github";
|
|
4
4
|
import { waitingOn } from "#tracker/cards";
|
|
5
|
-
import { WAITING, assigneeOf, ensureLabels, forward, isHeld, isState, issueOf, labelNames, openStates, relabel, settingsOf, stateOf, } from "#tracker/states";
|
|
5
|
+
import { WAITING, assigneeOf, ensureLabels, forward, isHeld, isState, issueOf, labelNames, openStates, priorityLabels, relabel, settingsOf, stateOf, } from "#tracker/states";
|
|
6
6
|
/** Moves a card to `target`: forward only unless `force`, and `skipped` for a name that is not an engine state or an open issue out of scope. An open state adds its column label and takes the others off, and opens a closed issue again; `done` closes it as completed and `cancelled` as not planned, and takes its column labels off. A move to any state but `waiting_on_person` takes edgar:waiting off, so the card no longer waits on a person. Labels change one at a time, so a label a person sets meanwhile stays. */
|
|
7
7
|
export async function transition(ctx, card, target, force = false) {
|
|
8
8
|
const settings = settingsOf(ctx);
|
|
@@ -60,7 +60,7 @@ export async function transition(ctx, card, target, force = false) {
|
|
|
60
60
|
const moved = await relabel(ctx, found.value.path, add, [...stale, ...waiting]);
|
|
61
61
|
return moved.ok ? done({ column: target }) : moved.error;
|
|
62
62
|
}
|
|
63
|
-
/** Sets a card's labels to `labels` whole, keeping the column labels that say its engine state. */
|
|
63
|
+
/** Sets a card's labels to `labels` whole, keeping the column labels that say its engine state and the priority label a person set; a priority label in `labels` is dropped, since only a person or `set_priority` sets a priority. */
|
|
64
64
|
export async function setLabels(ctx, card, labels) {
|
|
65
65
|
const settings = settingsOf(ctx);
|
|
66
66
|
if (!settings.ok)
|
|
@@ -73,16 +73,63 @@ export async function setLabels(ctx, card, labels) {
|
|
|
73
73
|
return read.error;
|
|
74
74
|
const columns = settings.value.columns;
|
|
75
75
|
const marks = new Set(openStates.map((state) => columns[state]));
|
|
76
|
-
const kept = labelNames(read.value).filter((name) => marks.has(name));
|
|
77
|
-
const
|
|
78
|
-
const
|
|
76
|
+
const kept = labelNames(read.value).filter((name) => marks.has(name) || priorityLabels.has(name));
|
|
77
|
+
const asked = labels.filter((name) => !priorityLabels.has(name));
|
|
78
|
+
const wanted = [...new Set([...kept, ...asked])];
|
|
79
|
+
const made = await ensureLabels(ctx, found.value.repo, asked);
|
|
79
80
|
if (!made.ok)
|
|
80
81
|
return made.error;
|
|
81
82
|
const written = await github(ctx, "PATCH", found.value.path, issue, { labels: wanted });
|
|
82
83
|
return written.ok ? done(null) : written.error;
|
|
83
84
|
}
|
|
84
|
-
/**
|
|
85
|
-
export async function
|
|
85
|
+
/** Gives a card the `priority:<priority>` label, unless the issue has a `priority:` label already, which stays: then `skipped`. */
|
|
86
|
+
export async function setPriority(ctx, card, priority) {
|
|
87
|
+
const settings = settingsOf(ctx);
|
|
88
|
+
if (!settings.ok)
|
|
89
|
+
return settings.error;
|
|
90
|
+
const found = issueOf(settings.value, card);
|
|
91
|
+
if (!found.ok)
|
|
92
|
+
return found.error;
|
|
93
|
+
const read = await github(ctx, "GET", found.value.path, issue);
|
|
94
|
+
if (!read.ok)
|
|
95
|
+
return read.error;
|
|
96
|
+
if (labelNames(read.value).some((name) => name.startsWith("priority:")))
|
|
97
|
+
return skipped();
|
|
98
|
+
const label = `priority:${priority}`;
|
|
99
|
+
const made = await ensureLabels(ctx, found.value.repo, [label]);
|
|
100
|
+
if (!made.ok)
|
|
101
|
+
return made.error;
|
|
102
|
+
const added = await github(ctx, "POST", `${found.value.path}/labels`, namedLabel.array(), {
|
|
103
|
+
labels: [label],
|
|
104
|
+
});
|
|
105
|
+
return added.ok ? done({ id: card }) : added.error;
|
|
106
|
+
}
|
|
107
|
+
/** Parks a card until `waitsFor` merges: a forced move to `intake`, then `waits_for` in its block, a `request` block when it has none, so `release_follow_ups` finds it. The move goes first, so an issue out of scope is `skipped` with nothing written; a retry after a failed write moves nothing and writes the block. */
|
|
108
|
+
export async function park(ctx, card, waitsFor) {
|
|
109
|
+
const moved = await transition(ctx, card, "intake", true);
|
|
110
|
+
if (moved.outcome !== "done")
|
|
111
|
+
return moved;
|
|
112
|
+
const settings = settingsOf(ctx);
|
|
113
|
+
if (!settings.ok)
|
|
114
|
+
return settings.error;
|
|
115
|
+
const found = issueOf(settings.value, card);
|
|
116
|
+
if (!found.ok)
|
|
117
|
+
return found.error;
|
|
118
|
+
const read = await github(ctx, "GET", found.value.path, issue);
|
|
119
|
+
if (!read.ok)
|
|
120
|
+
return read.error;
|
|
121
|
+
const current = read.value.body ?? "";
|
|
122
|
+
const block = readBlock(current);
|
|
123
|
+
if (!block.ok)
|
|
124
|
+
return block.error;
|
|
125
|
+
const next = withBlock(current, { ...(block.value ?? { kind: "request" }), waits_for: waitsFor });
|
|
126
|
+
if (next === current)
|
|
127
|
+
return done({ id: card });
|
|
128
|
+
const written = await github(ctx, "PATCH", found.value.path, issue, { body: next });
|
|
129
|
+
return written.ok ? done({ id: card }) : written.error;
|
|
130
|
+
}
|
|
131
|
+
/** Moves each card in `intake` whose block waits for `card` to `column`, and answers the ids it moved. */
|
|
132
|
+
export async function releaseFollowUps(ctx, card, column) {
|
|
86
133
|
const settings = settingsOf(ctx);
|
|
87
134
|
if (!settings.ok)
|
|
88
135
|
return settings.error;
|
|
@@ -91,7 +138,7 @@ export async function releaseFollowUps(ctx, card) {
|
|
|
91
138
|
return waiting.error;
|
|
92
139
|
const released = [];
|
|
93
140
|
for (const id of waiting.value) {
|
|
94
|
-
const moved = await transition(ctx, id,
|
|
141
|
+
const moved = await transition(ctx, id, column);
|
|
95
142
|
if (moved.outcome === "done")
|
|
96
143
|
released.push(id);
|
|
97
144
|
else if (moved.outcome !== "skipped")
|
package/edgar-extension.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "github",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"config_schema": "schemas/config.json",
|
|
6
6
|
"secrets": [
|
|
7
7
|
{
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"network:*.blob.core.windows.net",
|
|
20
20
|
"network:*.actions.githubusercontent.com",
|
|
21
21
|
"git:push",
|
|
22
|
-
"sandbox:read"
|
|
22
|
+
"sandbox:read",
|
|
23
|
+
"tracker:write"
|
|
23
24
|
],
|
|
24
25
|
"tools": [
|
|
25
26
|
{
|
|
@@ -33,14 +34,28 @@
|
|
|
33
34
|
"approval": "never",
|
|
34
35
|
"disabled": false
|
|
35
36
|
},
|
|
37
|
+
{
|
|
38
|
+
"name": "delete_closed_branches",
|
|
39
|
+
"description": "Delete the edgar/ branch of each pull request of each service's repository on github.com that closed, merged or not, within closed_within_hours, once no open pull request uses it",
|
|
40
|
+
"input_schema": "schemas/delete_closed_branches.in.json",
|
|
41
|
+
"output_schema": "schemas/delete_closed_branches.out.json",
|
|
42
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
43
|
+
"capabilities": ["network:api.github.com"],
|
|
44
|
+
"side_effect": true,
|
|
45
|
+
"undo": "none",
|
|
46
|
+
"undo_reason": "A deleted branch belongs to a pull request that is already closed, and its commits stay reachable from that pull request.",
|
|
47
|
+
"approval": "never",
|
|
48
|
+
"disabled": false
|
|
49
|
+
},
|
|
36
50
|
{
|
|
37
51
|
"name": "open_pull_request",
|
|
38
|
-
"description": "Open a pull request from a pushed edgar/ branch onto the default base",
|
|
52
|
+
"description": "Open a pull request from a pushed edgar/ branch onto base, else onto the default base",
|
|
39
53
|
"input_schema": "schemas/open_pull_request.in.json",
|
|
40
54
|
"output_schema": "schemas/open_pull_request.out.json",
|
|
41
55
|
"secrets": ["GITHUB_TOKEN"],
|
|
42
56
|
"capabilities": ["network:api.github.com"],
|
|
43
57
|
"side_effect": true,
|
|
58
|
+
"publishes": true,
|
|
44
59
|
"compensate": "close_pull_request",
|
|
45
60
|
"lookup": "find_pull_request",
|
|
46
61
|
"approval": "never",
|
|
@@ -54,6 +69,7 @@
|
|
|
54
69
|
"secrets": ["GITHUB_TOKEN"],
|
|
55
70
|
"capabilities": ["network:api.github.com"],
|
|
56
71
|
"side_effect": true,
|
|
72
|
+
"publishes": true,
|
|
57
73
|
"undo": "none",
|
|
58
74
|
"undo_reason": "The new title and body describe what the pull request holds, and they stay true when a later stage is undone.",
|
|
59
75
|
"approval": "never",
|
|
@@ -80,6 +96,7 @@
|
|
|
80
96
|
"secrets": ["GITHUB_TOKEN"],
|
|
81
97
|
"capabilities": ["network:api.github.com"],
|
|
82
98
|
"side_effect": false,
|
|
99
|
+
"publishes": true,
|
|
83
100
|
"approval": "never",
|
|
84
101
|
"disabled": false
|
|
85
102
|
},
|
|
@@ -91,6 +108,7 @@
|
|
|
91
108
|
"secrets": ["GITHUB_TOKEN"],
|
|
92
109
|
"capabilities": ["network:api.github.com"],
|
|
93
110
|
"side_effect": true,
|
|
111
|
+
"publishes": true,
|
|
94
112
|
"undo": "none",
|
|
95
113
|
"undo_reason": "A line of the note says what happened on the pull request, and it stays true when a later stage is undone.",
|
|
96
114
|
"approval": "never",
|
|
@@ -142,7 +160,7 @@
|
|
|
142
160
|
},
|
|
143
161
|
{
|
|
144
162
|
"name": "wait_for_review",
|
|
145
|
-
"description": "As pull_request_state, for a wait stage's recheck: skipped while the pull request is open
|
|
163
|
+
"description": "As pull_request_state, for a wait stage's recheck: skipped while the pull request is open, no review has decided and it does not conflict with its base, done once it is approved, has a change request, conflicts, or is merged or closed",
|
|
146
164
|
"input_schema": "schemas/wait_for_review.in.json",
|
|
147
165
|
"output_schema": "schemas/wait_for_review.out.json",
|
|
148
166
|
"secrets": ["GITHUB_TOKEN"],
|
|
@@ -256,6 +274,41 @@
|
|
|
256
274
|
"approval": "never",
|
|
257
275
|
"disabled": false
|
|
258
276
|
},
|
|
277
|
+
{
|
|
278
|
+
"name": "merged_pull_request",
|
|
279
|
+
"description": "The newest merged pull request of the card's edgar/ branch in the repository, with when it merged and its merge commit; skipped when there is none",
|
|
280
|
+
"input_schema": "schemas/merged_pull_request.in.json",
|
|
281
|
+
"output_schema": "schemas/merged_pull_request.out.json",
|
|
282
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
283
|
+
"capabilities": ["network:api.github.com"],
|
|
284
|
+
"side_effect": false,
|
|
285
|
+
"approval": "never",
|
|
286
|
+
"disabled": false
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"name": "revert_pull_request",
|
|
290
|
+
"description": "Open GitHub's revert of a merged pull request, as a new pull request that a person merges; the revert already open when there is one; skipped when the pull request is not merged",
|
|
291
|
+
"input_schema": "schemas/revert_pull_request.in.json",
|
|
292
|
+
"output_schema": "schemas/revert_pull_request.out.json",
|
|
293
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
294
|
+
"capabilities": ["network:api.github.com"],
|
|
295
|
+
"side_effect": true,
|
|
296
|
+
"compensate": "close_pull_request",
|
|
297
|
+
"lookup": "find_revert_pull_request",
|
|
298
|
+
"approval": "never",
|
|
299
|
+
"disabled": false
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "find_revert_pull_request",
|
|
303
|
+
"description": "Find the revert of a pull request; skipped when there is none",
|
|
304
|
+
"input_schema": "schemas/find_revert_pull_request.in.json",
|
|
305
|
+
"output_schema": "schemas/find_revert_pull_request.out.json",
|
|
306
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
307
|
+
"capabilities": ["network:api.github.com"],
|
|
308
|
+
"side_effect": false,
|
|
309
|
+
"approval": "never",
|
|
310
|
+
"disabled": false
|
|
311
|
+
},
|
|
259
312
|
{
|
|
260
313
|
"name": "dismiss_dependabot_alert",
|
|
261
314
|
"description": "Dismiss a Dependabot alert of a repository with one of GitHub's reasons and a comment; every call needs a person's approval",
|
|
@@ -264,6 +317,7 @@
|
|
|
264
317
|
"secrets": ["GITHUB_TOKEN"],
|
|
265
318
|
"capabilities": ["network:api.github.com"],
|
|
266
319
|
"side_effect": true,
|
|
320
|
+
"publishes": true,
|
|
267
321
|
"compensate": "reopen_dependabot_alert",
|
|
268
322
|
"lookup": "find_dependabot_dismissal",
|
|
269
323
|
"approval": "always",
|
|
@@ -299,6 +353,7 @@
|
|
|
299
353
|
"secrets": ["GITHUB_TOKEN"],
|
|
300
354
|
"capabilities": ["network:api.github.com"],
|
|
301
355
|
"side_effect": false,
|
|
356
|
+
"publishes": true,
|
|
302
357
|
"approval": "never",
|
|
303
358
|
"disabled": false
|
|
304
359
|
},
|
|
@@ -332,12 +387,24 @@
|
|
|
332
387
|
"secrets": ["GITHUB_TOKEN"],
|
|
333
388
|
"capabilities": ["network:api.github.com"],
|
|
334
389
|
"side_effect": false,
|
|
390
|
+
"publishes": true,
|
|
391
|
+
"approval": "never",
|
|
392
|
+
"disabled": false
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"name": "park",
|
|
396
|
+
"description": "Park a card until another card's pull request merges: move it to intake and write waits_for into its block",
|
|
397
|
+
"input_schema": "schemas/park.in.json",
|
|
398
|
+
"output_schema": "schemas/park.out.json",
|
|
399
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
400
|
+
"capabilities": ["network:api.github.com"],
|
|
401
|
+
"side_effect": false,
|
|
335
402
|
"approval": "never",
|
|
336
403
|
"disabled": false
|
|
337
404
|
},
|
|
338
405
|
{
|
|
339
406
|
"name": "release_follow_ups",
|
|
340
|
-
"description": "Move the cards that wait for a card's
|
|
407
|
+
"description": "Move the cards that wait for a card's pull request to ready once it merged, or with column waiting_on_person to a person once it closed with no merge",
|
|
341
408
|
"input_schema": "schemas/release_follow_ups.in.json",
|
|
342
409
|
"output_schema": "schemas/release_follow_ups.out.json",
|
|
343
410
|
"secrets": ["GITHUB_TOKEN"],
|
|
@@ -346,6 +413,17 @@
|
|
|
346
413
|
"approval": "never",
|
|
347
414
|
"disabled": false
|
|
348
415
|
},
|
|
416
|
+
{
|
|
417
|
+
"name": "set_priority",
|
|
418
|
+
"description": "Give a card the priority:<priority> label from EDGAR's analysis; skipped when the issue has a priority label already",
|
|
419
|
+
"input_schema": "schemas/set_priority.in.json",
|
|
420
|
+
"output_schema": "schemas/set_priority.out.json",
|
|
421
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
422
|
+
"capabilities": ["network:api.github.com"],
|
|
423
|
+
"side_effect": false,
|
|
424
|
+
"approval": "never",
|
|
425
|
+
"disabled": false
|
|
426
|
+
},
|
|
349
427
|
{
|
|
350
428
|
"name": "count_sighting",
|
|
351
429
|
"description": "Count one more sighting of the fault that an open card holds: raise occurrences and last_seen in its block; a card with no block is not written",
|
|
@@ -390,6 +468,17 @@
|
|
|
390
468
|
"approval": "never",
|
|
391
469
|
"disabled": false
|
|
392
470
|
},
|
|
471
|
+
{
|
|
472
|
+
"name": "mark_seen",
|
|
473
|
+
"description": "Mark a card seen with an eyes reaction, so the person who filed it knows EDGAR picked it up",
|
|
474
|
+
"input_schema": "schemas/mark_seen.in.json",
|
|
475
|
+
"output_schema": "schemas/mark_seen.out.json",
|
|
476
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
477
|
+
"capabilities": ["network:api.github.com"],
|
|
478
|
+
"side_effect": false,
|
|
479
|
+
"approval": "never",
|
|
480
|
+
"disabled": false
|
|
481
|
+
},
|
|
393
482
|
{
|
|
394
483
|
"name": "update_description",
|
|
395
484
|
"description": "Replace a card's description, keeping its edgar:v0 block",
|
|
@@ -398,11 +487,25 @@
|
|
|
398
487
|
"secrets": ["GITHUB_TOKEN"],
|
|
399
488
|
"capabilities": ["network:api.github.com"],
|
|
400
489
|
"side_effect": true,
|
|
490
|
+
"publishes": true,
|
|
401
491
|
"compensate": "restore_description",
|
|
402
492
|
"lookup": "find_description",
|
|
403
493
|
"approval": "never",
|
|
404
494
|
"disabled": false
|
|
405
495
|
},
|
|
496
|
+
{
|
|
497
|
+
"name": "retitle",
|
|
498
|
+
"description": "Give a card that a feeder filed a title in plain words, from the first sentence of a summary; skipped for a card a person wrote. The block keeps the feeder's title in decided.filed_as",
|
|
499
|
+
"input_schema": "schemas/retitle.in.json",
|
|
500
|
+
"output_schema": "schemas/retitle.out.json",
|
|
501
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
502
|
+
"capabilities": ["network:api.github.com"],
|
|
503
|
+
"side_effect": true,
|
|
504
|
+
"undo": "none",
|
|
505
|
+
"undo_reason": "The plain title names the same fault, and the block keeps the title the feeder gave, so it stays true when a later stage is undone.",
|
|
506
|
+
"approval": "never",
|
|
507
|
+
"disabled": false
|
|
508
|
+
},
|
|
406
509
|
{
|
|
407
510
|
"name": "restore_description",
|
|
408
511
|
"description": "Put back the description a card had before update_description",
|
|
@@ -466,7 +569,8 @@
|
|
|
466
569
|
"route": "events",
|
|
467
570
|
"signature": "hmac-sha256",
|
|
468
571
|
"secret": "GITHUB_WEBHOOK_SECRET",
|
|
469
|
-
"delivery_id_header": "X-GitHub-Delivery"
|
|
572
|
+
"delivery_id_header": "X-GitHub-Delivery",
|
|
573
|
+
"signature_header": "X-Hub-Signature-256"
|
|
470
574
|
}
|
|
471
575
|
],
|
|
472
576
|
"workflows": ["workflows/resume.toml"],
|
|
@@ -477,6 +581,7 @@
|
|
|
477
581
|
"list_cards",
|
|
478
582
|
"card",
|
|
479
583
|
"comments",
|
|
584
|
+
"mentions",
|
|
480
585
|
"attachments",
|
|
481
586
|
"comment",
|
|
482
587
|
"move",
|
|
@@ -493,12 +598,21 @@
|
|
|
493
598
|
"hooks": [],
|
|
494
599
|
"service": {
|
|
495
600
|
"secrets": ["GITHUB_TOKEN"],
|
|
496
|
-
"capabilities": ["network:api.github.com"]
|
|
601
|
+
"capabilities": ["network:api.github.com", "tracker:write"]
|
|
497
602
|
},
|
|
498
603
|
"git_credential": {
|
|
499
604
|
"secrets": ["GITHUB_TOKEN"],
|
|
500
605
|
"capabilities": ["network:api.github.com"]
|
|
501
606
|
},
|
|
607
|
+
"publish_commits": {
|
|
608
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
609
|
+
"capabilities": ["network:api.github.com"]
|
|
610
|
+
},
|
|
611
|
+
"read_link": {
|
|
612
|
+
"hosts": ["github.com"],
|
|
613
|
+
"secrets": ["GITHUB_TOKEN"],
|
|
614
|
+
"capabilities": ["network:api.github.com"]
|
|
615
|
+
},
|
|
502
616
|
"executables": {
|
|
503
617
|
"requires": [
|
|
504
618
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kana-ai/edgar-ext-github",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "EDGAR extension for GitHub: push edgar/ branches, open, watch, close and merge pull requests, and track GitHub issues as cards.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
".": "./dist/src/index.js"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@kana-ai/edgar-contracts": "0.1.
|
|
27
|
-
"@kana-ai/edgar-sdk": "0.1.
|
|
26
|
+
"@kana-ai/edgar-contracts": "0.1.4",
|
|
27
|
+
"@kana-ai/edgar-sdk": "0.1.4",
|
|
28
28
|
"zod": "4.6.7"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -23,6 +23,25 @@
|
|
|
23
23
|
"caption": {
|
|
24
24
|
"type": "string",
|
|
25
25
|
"minLength": 1
|
|
26
|
+
},
|
|
27
|
+
"url": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "uri"
|
|
30
|
+
},
|
|
31
|
+
"video": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"properties": {
|
|
34
|
+
"path": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"minLength": 1
|
|
37
|
+
},
|
|
38
|
+
"bytes": {
|
|
39
|
+
"type": "integer",
|
|
40
|
+
"minimum": 0,
|
|
41
|
+
"maximum": 9007199254740991
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"required": ["path", "bytes"]
|
|
26
45
|
}
|
|
27
46
|
},
|
|
28
47
|
"required": ["path", "bytes", "caption"]
|