@mastra/github-signals 0.3.0 → 0.4.0-alpha.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/CHANGELOG.md +28 -0
- package/LICENSE.md +6 -4
- package/dist/index.cjs +190 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +190 -70
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export type GithubPRSubscription = {
|
|
|
37
37
|
lastNotificationKind?: string;
|
|
38
38
|
lastNotificationPriority?: 'medium' | 'high';
|
|
39
39
|
lastNotificationSummary?: string;
|
|
40
|
+
lastNotificationDedupeKey?: string;
|
|
40
41
|
};
|
|
41
42
|
export type GithubSignalsThreadMetadata = {
|
|
42
43
|
subscriptions: GithubPRSubscription[];
|
|
@@ -246,7 +247,7 @@ export declare class GitcrawlSyncClient implements GithubSignalsSyncClient {
|
|
|
246
247
|
}
|
|
247
248
|
export declare class GithubSignals extends SignalProvider<'github-signals'> {
|
|
248
249
|
#private;
|
|
249
|
-
readonly id:
|
|
250
|
+
readonly id: 'github-signals';
|
|
250
251
|
readonly name = "GitHub Signals";
|
|
251
252
|
static signals: {
|
|
252
253
|
subscribeToPR(input: GithubSubscribePRSignalInput): AgentSignalInput;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB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sBAAsB,CAAA;KAAE,GACtF,OAAO,CAAC,qBAAqB,CAAC,CAShC;IAEK,uBAAuB,CAC3B,KAAK,EAAE,mBAAmB,GAAG;QAAE,EAAE,EAAE,mBAAmB,CAAA;KAAE,GACvD,OAAO,CAAC,qBAAqB,CAAC,CAQhC;IAEK,qBAAqB,CACzB,KAAK,EAAE,mBAAmB,EAC1B,OAAO,GAAE;QAAE,eAAe,CAAC,EAAE,OAAO,CAAA;KAAO,GAC1C,OAAO,CAAC,OAAO,CAAC,CAsBlB;IAED,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAOrD;IAED,eAAe,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAEnD;IAED,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAE1D;IAED,iBAAiB,IAAI,MAAM,CAE1B;IAED,cAAc,IAAI,IAAI,CAKrB;IAED;;;;;OAKG;IACM,IAAI,IAAI,IAAI,CAGpB;IAEK,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAEK,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAwClF;IAEK,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoDlE;CAkhCF"}
|
package/dist/index.js
CHANGED
|
@@ -124,7 +124,8 @@ function getGithubMetadata(threadMetadata) {
|
|
|
124
124
|
...readString(rawSubscription.lastNotificationAt) ? { lastNotificationAt: readString(rawSubscription.lastNotificationAt) } : {},
|
|
125
125
|
...readString(rawSubscription.lastNotificationKind) ? { lastNotificationKind: readString(rawSubscription.lastNotificationKind) } : {},
|
|
126
126
|
...rawSubscription.lastNotificationPriority === "medium" || rawSubscription.lastNotificationPriority === "high" ? { lastNotificationPriority: rawSubscription.lastNotificationPriority } : {},
|
|
127
|
-
...readString(rawSubscription.lastNotificationSummary) ? { lastNotificationSummary: readString(rawSubscription.lastNotificationSummary) } : {}
|
|
127
|
+
...readString(rawSubscription.lastNotificationSummary) ? { lastNotificationSummary: readString(rawSubscription.lastNotificationSummary) } : {},
|
|
128
|
+
...readString(rawSubscription.lastNotificationDedupeKey) ? { lastNotificationDedupeKey: readString(rawSubscription.lastNotificationDedupeKey) } : {}
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
131
|
return {
|
|
@@ -254,6 +255,22 @@ function getCommentNotificationSummary(pr, snapshot) {
|
|
|
254
255
|
if (!snapshot.latestCommentAuthor || !snapshot.latestCommentBody) return void 0;
|
|
255
256
|
return `${snapshot.latestCommentAuthor} commented on ${pr}: ${getCommentExcerpt(snapshot.latestCommentBody)}`;
|
|
256
257
|
}
|
|
258
|
+
function isNoisyBotComment(input) {
|
|
259
|
+
const author = input.author?.toLowerCase();
|
|
260
|
+
const body = input.body?.toLowerCase().trim();
|
|
261
|
+
if (!author || !body) return false;
|
|
262
|
+
if (author.includes("coderabbit")) return body.includes("## review skipped") || body.includes("review_stack_entry_start") || body.includes("review change stack") || body.includes("storage.googleapis.com/coderabbit_public_assets/review-stack") || body.includes("no actionable comments were generated") || body.includes("actions performed") && body.includes("review triggered");
|
|
263
|
+
if (author === "vercel[bot]") return body.startsWith("[vc]:");
|
|
264
|
+
if (author === "socket-security[bot]") return body.includes("review the following changes in direct dependencies");
|
|
265
|
+
if (author === "dane-ai-mastra[bot]") return body.includes("mastra-pr-automation") || body.includes("## pr triage") || body.includes("## pr complexity score");
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
function hasNoisyLatestBotComment(snapshot) {
|
|
269
|
+
return isNoisyBotComment({
|
|
270
|
+
author: snapshot.latestCommentAuthor,
|
|
271
|
+
body: snapshot.latestCommentBody
|
|
272
|
+
});
|
|
273
|
+
}
|
|
257
274
|
const githubActivityNotificationPriority = {
|
|
258
275
|
high: 0,
|
|
259
276
|
medium: 1
|
|
@@ -273,7 +290,7 @@ function compareGithubActivityNotifications(a, b) {
|
|
|
273
290
|
return getGithubActivityNotificationRank(a) - getGithubActivityNotificationRank(b);
|
|
274
291
|
}
|
|
275
292
|
function classifyGithubCommentActivityNotification(input) {
|
|
276
|
-
if (isBotOnlyActivity(input.snapshot)) return void 0;
|
|
293
|
+
if (isBotOnlyActivity(input.snapshot) || hasNoisyLatestBotComment(input.snapshot)) return void 0;
|
|
277
294
|
const summary = getCommentNotificationSummary(`${input.subscription.owner}/${input.subscription.repo}#${input.subscription.number}`, input.snapshot);
|
|
278
295
|
if (!summary) return void 0;
|
|
279
296
|
return {
|
|
@@ -428,7 +445,7 @@ function classifyGithubActivityNotification(input) {
|
|
|
428
445
|
};
|
|
429
446
|
}
|
|
430
447
|
if (input.snapshot.ciState === "pending" && input.subscription.lastObservedCiState === "pending") return void 0;
|
|
431
|
-
if (isBotOnlyActivity(input.snapshot)) return void 0;
|
|
448
|
+
if (isBotOnlyActivity(input.snapshot) || hasNoisyLatestBotComment(input.snapshot)) return void 0;
|
|
432
449
|
const commentSummary = getCommentNotificationSummary(pr, input.snapshot);
|
|
433
450
|
return {
|
|
434
451
|
kind: "pull-request-activity",
|
|
@@ -828,12 +845,6 @@ var GithubSignals = class extends SignalProvider {
|
|
|
828
845
|
return false;
|
|
829
846
|
}
|
|
830
847
|
const key = this.#pollingKey(input);
|
|
831
|
-
for (const [pollingKey, state] of this.#polling.entries()) {
|
|
832
|
-
if (pollingKey === key) continue;
|
|
833
|
-
this.#invalidatePollingThread(pollingKey);
|
|
834
|
-
clearInterval(state.timer);
|
|
835
|
-
this.#polling.delete(pollingKey);
|
|
836
|
-
}
|
|
837
848
|
if (this.#polling.has(key)) return true;
|
|
838
849
|
const runPoll = (pollOptions = {}) => {
|
|
839
850
|
this.#pollThread(input, pollOptions).catch((error) => {
|
|
@@ -989,75 +1000,127 @@ var GithubSignals = class extends SignalProvider {
|
|
|
989
1000
|
threadId: context?.agent?.threadId ?? threadContext.threadId,
|
|
990
1001
|
resourceId: context?.agent?.resourceId ?? threadContext.resourceId
|
|
991
1002
|
});
|
|
1003
|
+
const prSchema = z.object({
|
|
1004
|
+
number: z.number().int().positive(),
|
|
1005
|
+
owner: z.string().optional(),
|
|
1006
|
+
repo: z.string().optional()
|
|
1007
|
+
});
|
|
1008
|
+
const subscribeSchema = z.object({
|
|
1009
|
+
prs: z.array(prSchema).min(1),
|
|
1010
|
+
mode: z.enum(["working", "review"]).optional()
|
|
1011
|
+
});
|
|
1012
|
+
const unsubscribeSchema = z.object({
|
|
1013
|
+
prs: z.array(prSchema).min(1).optional(),
|
|
1014
|
+
all: z.boolean().optional()
|
|
1015
|
+
}).refine((input) => [!!input.prs, input.all === true].filter(Boolean).length === 1, { message: "Provide exactly one of prs or all." });
|
|
1016
|
+
const dedupePrs = (prs) => {
|
|
1017
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
1018
|
+
for (const pr of prs) byKey.set(`${pr.owner ?? ""}/${pr.repo ?? ""}#${pr.number}`, pr);
|
|
1019
|
+
return [...byKey.values()];
|
|
1020
|
+
};
|
|
1021
|
+
const getSubscribeMessage = (result) => result.terminalState ? `Not subscribed to ${result.owner}/${result.repo}#${result.number} in review mode because it is already ${result.terminalState}.` : result.syncResult?.ok === false ? `Subscribed to ${result.owner}/${result.repo}#${result.number} in ${result.mode} mode, but gitcrawl sync failed: ${result.syncResult.error}` : `Subscribed to ${result.owner}/${result.repo}#${result.number} in ${result.mode} mode.`;
|
|
1022
|
+
const getUnsubscribeMessage = (result) => result.removed ? `Unsubscribed from ${result.owner}/${result.repo}#${result.number}.` : `No GitHub subscription found for ${result.owner}/${result.repo}#${result.number}.`;
|
|
992
1023
|
return {
|
|
993
1024
|
...args.tools,
|
|
994
1025
|
github_subscribe_pr: createGithubTool({
|
|
995
1026
|
id: "github_subscribe_pr",
|
|
996
|
-
description: "Subscribe this thread to
|
|
997
|
-
inputSchema:
|
|
998
|
-
number: z.number().int().positive(),
|
|
999
|
-
owner: z.string().optional(),
|
|
1000
|
-
repo: z.string().optional(),
|
|
1001
|
-
mode: z.enum(["working", "review"]).optional()
|
|
1002
|
-
}),
|
|
1027
|
+
description: "Subscribe this thread to one or more GitHub pull requests. Use review mode for new commits, authorized latest PR comments, review-thread-state changes including all threads resolved, and PR close or merge updates. Use working mode for all actionable PR activity. Omitted mode defaults to working. Do not subscribe for a one-off inspection.",
|
|
1028
|
+
inputSchema: subscribeSchema,
|
|
1003
1029
|
execute: async (input, context) => {
|
|
1030
|
+
const subscribeInput = input;
|
|
1004
1031
|
const executionThreadContext = getExecutionThreadContext(context);
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
+
const mode = normalizeGithubSubscriptionMode(subscribeInput.mode);
|
|
1033
|
+
const requestedPrs = dedupePrs(subscribeInput.prs);
|
|
1034
|
+
const results = [];
|
|
1035
|
+
for (const pr of requestedPrs) try {
|
|
1036
|
+
const result = await this.#subscribe({
|
|
1037
|
+
id: `github-tool-subscribe-${randomUUID()}`,
|
|
1038
|
+
owner: pr.owner,
|
|
1039
|
+
repo: pr.repo,
|
|
1040
|
+
number: pr.number,
|
|
1041
|
+
mode,
|
|
1042
|
+
threadId: executionThreadContext.threadId,
|
|
1043
|
+
resourceId: executionThreadContext.resourceId
|
|
1044
|
+
});
|
|
1045
|
+
results.push({
|
|
1046
|
+
subscribed: !result.terminalState,
|
|
1047
|
+
mode: result.mode ?? mode,
|
|
1048
|
+
owner: result.owner,
|
|
1049
|
+
repo: result.repo,
|
|
1050
|
+
number: result.number,
|
|
1051
|
+
...result.terminalState ? {
|
|
1052
|
+
terminalState: result.terminalState,
|
|
1053
|
+
reason: "terminal"
|
|
1054
|
+
} : {},
|
|
1055
|
+
syncStatus: result.syncResult?.ok === false ? "error" : result.syncResult ? "success" : void 0,
|
|
1056
|
+
message: getSubscribeMessage(result)
|
|
1057
|
+
});
|
|
1058
|
+
} catch (error) {
|
|
1059
|
+
results.push({
|
|
1060
|
+
subscribed: false,
|
|
1061
|
+
mode,
|
|
1062
|
+
owner: pr.owner ?? "",
|
|
1063
|
+
repo: pr.repo ?? "",
|
|
1064
|
+
number: pr.number,
|
|
1065
|
+
reason: "error",
|
|
1066
|
+
syncStatus: "error",
|
|
1067
|
+
message: `Could not subscribe to PR #${pr.number}: ${error instanceof Error ? error.message : String(error)}`
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
const subscriptions = await this.#getSubscriptionSummaries(executionThreadContext).catch(() => []);
|
|
1071
|
+
const response = {
|
|
1072
|
+
subscribed: results.some((result) => result.subscribed),
|
|
1073
|
+
results,
|
|
1074
|
+
subscriptions
|
|
1032
1075
|
};
|
|
1076
|
+
if (results.length === 1) Object.assign(response, results[0]);
|
|
1077
|
+
return response;
|
|
1033
1078
|
}
|
|
1034
1079
|
}),
|
|
1035
1080
|
github_unsubscribe_pr: createGithubTool({
|
|
1036
1081
|
id: "github_unsubscribe_pr",
|
|
1037
|
-
description: "Unsubscribe this thread from
|
|
1038
|
-
inputSchema:
|
|
1039
|
-
number: z.number().int().positive(),
|
|
1040
|
-
owner: z.string().optional(),
|
|
1041
|
-
repo: z.string().optional()
|
|
1042
|
-
}),
|
|
1082
|
+
description: "Unsubscribe this thread from one or more GitHub pull requests, or unsubscribe all current PRs.",
|
|
1083
|
+
inputSchema: unsubscribeSchema,
|
|
1043
1084
|
execute: async (input, context) => {
|
|
1044
1085
|
const executionThreadContext = getExecutionThreadContext(context);
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1086
|
+
const unsubscribeInput = input;
|
|
1087
|
+
const requestedPrs = unsubscribeInput.all ? await this.#getSubscriptionSummaries(executionThreadContext) : dedupePrs(unsubscribeInput.prs ?? []);
|
|
1088
|
+
const results = [];
|
|
1089
|
+
for (const pr of requestedPrs) try {
|
|
1090
|
+
const result = await this.#unsubscribe({
|
|
1091
|
+
id: `github-tool-unsubscribe-${randomUUID()}`,
|
|
1092
|
+
owner: pr.owner,
|
|
1093
|
+
repo: pr.repo,
|
|
1094
|
+
number: pr.number,
|
|
1095
|
+
threadId: executionThreadContext.threadId,
|
|
1096
|
+
resourceId: executionThreadContext.resourceId
|
|
1097
|
+
});
|
|
1098
|
+
results.push({
|
|
1099
|
+
owner: result.owner,
|
|
1100
|
+
repo: result.repo,
|
|
1101
|
+
number: result.number,
|
|
1102
|
+
unsubscribed: result.removed ?? false,
|
|
1103
|
+
message: getUnsubscribeMessage(result)
|
|
1104
|
+
});
|
|
1105
|
+
} catch (error) {
|
|
1106
|
+
results.push({
|
|
1107
|
+
owner: pr.owner ?? "",
|
|
1108
|
+
repo: pr.repo ?? "",
|
|
1109
|
+
number: pr.number,
|
|
1110
|
+
unsubscribed: false,
|
|
1111
|
+
reason: "error",
|
|
1112
|
+
message: `Could not unsubscribe from PR #${pr.number}: ${error instanceof Error ? error.message : String(error)}`
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
const subscriptions = await this.#getSubscriptionSummaries(executionThreadContext).catch(() => []);
|
|
1116
|
+
const response = {
|
|
1117
|
+
unsubscribed: results.some((result) => result.unsubscribed),
|
|
1118
|
+
results,
|
|
1119
|
+
subscriptions,
|
|
1120
|
+
remainingSubscriptions: subscriptions.length
|
|
1060
1121
|
};
|
|
1122
|
+
if (results.length === 1) Object.assign(response, results[0]);
|
|
1123
|
+
return response;
|
|
1061
1124
|
}
|
|
1062
1125
|
})
|
|
1063
1126
|
};
|
|
@@ -1096,6 +1159,19 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1096
1159
|
#invalidatePollingThread(key) {
|
|
1097
1160
|
this.#pollingThreadGenerations.set(key, (this.#pollingThreadGenerations.get(key) ?? 0) + 1);
|
|
1098
1161
|
}
|
|
1162
|
+
#invalidatePollingForThread(input) {
|
|
1163
|
+
const key = this.#pollingKey(input);
|
|
1164
|
+
this.#invalidatePollingThread(key);
|
|
1165
|
+
const state = this.#polling.get(key);
|
|
1166
|
+
if (!state) return;
|
|
1167
|
+
clearInterval(state.timer);
|
|
1168
|
+
this.#polling.delete(key);
|
|
1169
|
+
this.#notifyPollingChanged({
|
|
1170
|
+
threadId: input.threadId,
|
|
1171
|
+
resourceId: input.resourceId,
|
|
1172
|
+
running: false
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1099
1175
|
#getNotificationAgent(_input) {
|
|
1100
1176
|
if (this.#agent) return this.#agent;
|
|
1101
1177
|
const agentId = _input?.agentId ?? this.#options.agentId;
|
|
@@ -1105,6 +1181,16 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1105
1181
|
const { loadedThread } = await this.#loadThread(input);
|
|
1106
1182
|
return getGithubMetadata(loadedThread.metadata).subscriptions;
|
|
1107
1183
|
}
|
|
1184
|
+
async #getSubscriptionSummaries(input) {
|
|
1185
|
+
return (await this.#getThreadSubscriptions(input)).map((subscription) => ({
|
|
1186
|
+
owner: subscription.owner,
|
|
1187
|
+
repo: subscription.repo,
|
|
1188
|
+
number: subscription.number,
|
|
1189
|
+
subscribedAt: subscription.subscribedAt,
|
|
1190
|
+
updatedAt: subscription.updatedAt,
|
|
1191
|
+
...subscription.lastSyncStatus ? { lastSyncStatus: subscription.lastSyncStatus } : {}
|
|
1192
|
+
}));
|
|
1193
|
+
}
|
|
1108
1194
|
#notifySubscriptionsChanged(input) {
|
|
1109
1195
|
this.#subscriptionsChangedHandler?.(input);
|
|
1110
1196
|
}
|
|
@@ -1200,6 +1286,7 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1200
1286
|
nextSubscription.lastNotificationKind = primaryNotification.kind;
|
|
1201
1287
|
nextSubscription.lastNotificationPriority = primaryNotification.priority;
|
|
1202
1288
|
nextSubscription.lastNotificationSummary = primaryNotification.summary;
|
|
1289
|
+
nextSubscription.lastNotificationDedupeKey = primaryNotification.dedupeKey;
|
|
1203
1290
|
if (!terminalState) shouldKeepSubscription = notifications.every((notification) => notification.kind !== "pull-request-merged");
|
|
1204
1291
|
}
|
|
1205
1292
|
}
|
|
@@ -1350,6 +1437,10 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1350
1437
|
if (!comments.some((comment) => comment.body || comment.url || comment.updatedAt)) return snapshot;
|
|
1351
1438
|
for (const comment of comments) {
|
|
1352
1439
|
if (isCurrentGeneration && !isCurrentGeneration()) return snapshot;
|
|
1440
|
+
if (isNoisyBotComment({
|
|
1441
|
+
author: comment.author,
|
|
1442
|
+
body: comment.body
|
|
1443
|
+
})) continue;
|
|
1353
1444
|
if (!await this.#isAuthorizedAuthor(owner, repo, comment.author, {
|
|
1354
1445
|
authorType: comment.authorType,
|
|
1355
1446
|
isBot: comment.isBot
|
|
@@ -1455,15 +1546,20 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1455
1546
|
if (!input.isCurrentGeneration()) return [];
|
|
1456
1547
|
if (!authorized) continue;
|
|
1457
1548
|
}
|
|
1458
|
-
|
|
1549
|
+
const notificationInput = this.#createGithubNotificationInput({
|
|
1459
1550
|
subscription: input.subscription,
|
|
1460
1551
|
snapshot: input.snapshot,
|
|
1461
1552
|
notification,
|
|
1462
1553
|
dedupeSuffix: input.snapshot.contentHash ?? input.snapshot.githubUpdatedAt ?? String(Date.now()),
|
|
1463
1554
|
previousGithubUpdatedAt: input.previousGithubUpdatedAt,
|
|
1464
1555
|
previousContentHash: input.previousContentHash
|
|
1465
|
-
})
|
|
1466
|
-
|
|
1556
|
+
});
|
|
1557
|
+
if (input.subscription.lastNotificationDedupeKey ? input.subscription.lastNotificationDedupeKey === notificationInput.dedupeKey : input.subscription.lastNotificationKind === notification.kind && input.subscription.lastNotificationSummary === notification.summary) continue;
|
|
1558
|
+
notificationInputs.push(notificationInput);
|
|
1559
|
+
sent.push({
|
|
1560
|
+
...notification,
|
|
1561
|
+
dedupeKey: notificationInput.dedupeKey
|
|
1562
|
+
});
|
|
1467
1563
|
}
|
|
1468
1564
|
if (notificationInputs.length > 0) {
|
|
1469
1565
|
const target = {
|
|
@@ -1518,7 +1614,12 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1518
1614
|
...existing?.lastObservedReviewStateHash ? { lastObservedReviewStateHash: existing.lastObservedReviewStateHash } : {},
|
|
1519
1615
|
...existing?.lastObservedCommentUrl ? { lastObservedCommentUrl: existing.lastObservedCommentUrl } : {},
|
|
1520
1616
|
...existing?.lastObservedCommentAuthor ? { lastObservedCommentAuthor: existing.lastObservedCommentAuthor } : {},
|
|
1521
|
-
...typeof existing?.lastObservedCommentIsBot === "boolean" ? { lastObservedCommentIsBot: existing.lastObservedCommentIsBot } : {}
|
|
1617
|
+
...typeof existing?.lastObservedCommentIsBot === "boolean" ? { lastObservedCommentIsBot: existing.lastObservedCommentIsBot } : {},
|
|
1618
|
+
...existing?.lastNotificationAt ? { lastNotificationAt: existing.lastNotificationAt } : {},
|
|
1619
|
+
...existing?.lastNotificationKind ? { lastNotificationKind: existing.lastNotificationKind } : {},
|
|
1620
|
+
...existing?.lastNotificationPriority ? { lastNotificationPriority: existing.lastNotificationPriority } : {},
|
|
1621
|
+
...existing?.lastNotificationSummary ? { lastNotificationSummary: existing.lastNotificationSummary } : {},
|
|
1622
|
+
...existing?.lastNotificationDedupeKey ? { lastNotificationDedupeKey: existing.lastNotificationDedupeKey } : {}
|
|
1522
1623
|
};
|
|
1523
1624
|
let syncResult;
|
|
1524
1625
|
let baselineSnapshot;
|
|
@@ -1546,8 +1647,12 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1546
1647
|
if (snapshot) applySnapshotCursor(subscription, snapshot);
|
|
1547
1648
|
} else subscription.lastSyncStatus = "skipped";
|
|
1548
1649
|
const terminalState = mode === "review" ? getGithubTerminalState(baselineSnapshot) : void 0;
|
|
1650
|
+
const subscriptions = terminalState ? githubMetadata.subscriptions.filter((candidate) => !(candidate.owner === owner && candidate.repo === repo && candidate.number === input.number)) : existingIndex >= 0 ? githubMetadata.subscriptions.map((existingSubscription, index) => index === existingIndex ? subscription : existingSubscription) : [...githubMetadata.subscriptions, subscription];
|
|
1549
1651
|
if (terminalState) {
|
|
1550
|
-
|
|
1652
|
+
this.#invalidatePollingForThread({
|
|
1653
|
+
threadId: input.threadId,
|
|
1654
|
+
resourceId: input.resourceId
|
|
1655
|
+
});
|
|
1551
1656
|
await threadStore.saveThread({ thread: {
|
|
1552
1657
|
...loadedThread,
|
|
1553
1658
|
id: input.threadId,
|
|
@@ -1565,6 +1670,10 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1565
1670
|
threadId: input.threadId,
|
|
1566
1671
|
resourceId: input.resourceId
|
|
1567
1672
|
});
|
|
1673
|
+
else await this.startPollingForThread({
|
|
1674
|
+
threadId: input.threadId,
|
|
1675
|
+
resourceId: input.resourceId
|
|
1676
|
+
});
|
|
1568
1677
|
return {
|
|
1569
1678
|
owner,
|
|
1570
1679
|
repo,
|
|
@@ -1574,7 +1683,10 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1574
1683
|
syncResult
|
|
1575
1684
|
};
|
|
1576
1685
|
}
|
|
1577
|
-
|
|
1686
|
+
this.#invalidatePollingForThread({
|
|
1687
|
+
threadId: input.threadId,
|
|
1688
|
+
resourceId: input.resourceId
|
|
1689
|
+
});
|
|
1578
1690
|
await threadStore.saveThread({ thread: {
|
|
1579
1691
|
...loadedThread,
|
|
1580
1692
|
id: input.threadId,
|
|
@@ -1614,6 +1726,10 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1614
1726
|
const subscriptions = githubMetadata.subscriptions.filter((subscription) => !(subscription.owner === owner && subscription.repo === repo && subscription.number === input.number));
|
|
1615
1727
|
const removed = subscriptions.length !== githubMetadata.subscriptions.length;
|
|
1616
1728
|
if (removed) {
|
|
1729
|
+
this.#invalidatePollingForThread({
|
|
1730
|
+
threadId: input.threadId,
|
|
1731
|
+
resourceId: input.resourceId
|
|
1732
|
+
});
|
|
1617
1733
|
await threadStore.saveThread({ thread: {
|
|
1618
1734
|
...loadedThread,
|
|
1619
1735
|
id: input.threadId,
|
|
@@ -1631,6 +1747,10 @@ var GithubSignals = class extends SignalProvider {
|
|
|
1631
1747
|
threadId: input.threadId,
|
|
1632
1748
|
resourceId: input.resourceId
|
|
1633
1749
|
});
|
|
1750
|
+
else await this.startPollingForThread({
|
|
1751
|
+
threadId: input.threadId,
|
|
1752
|
+
resourceId: input.resourceId
|
|
1753
|
+
});
|
|
1634
1754
|
}
|
|
1635
1755
|
return {
|
|
1636
1756
|
owner,
|