spur-board 0.69.0 → 0.70.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/dist/{chunk-a_l5UPaU.mjs → chunk-BBfFVeh3.mjs} +92 -42
- package/dist/{chunk-eiqYso44.mjs → chunk-BxDheuT8.mjs} +1 -1
- package/dist/{chunk-CxD6ZAl9.mjs → chunk-CmoLxaIV.mjs} +2 -2
- package/dist/cli.mjs +3 -3
- package/dist/client.mjs +1 -1
- package/dist/daemon.mjs +179 -33
- package/dist/mcp.mjs +3 -3
- package/package.json +1 -1
- package/skills/spur-board/references/how-board-works.md +4 -0
|
@@ -1464,6 +1464,20 @@ const checkSchema = z.strictObject({
|
|
|
1464
1464
|
state: z.enum(CHECK_STATES).describe("State of the latest run of this check on the head commit."),
|
|
1465
1465
|
completedAt: at$2.nullable().describe("When the latest run finished; null while it runs.")
|
|
1466
1466
|
});
|
|
1467
|
+
/**
|
|
1468
|
+
* Link and edit fields a feedback entry and a handed entry share: the direct URL, the newest edit
|
|
1469
|
+
* and a review's inline comments.
|
|
1470
|
+
*/
|
|
1471
|
+
const feedbackLinkShape = {
|
|
1472
|
+
url: webUrl.optional().describe("Web URL of the comment or review; missing in snapshots and handed entries written before it."),
|
|
1473
|
+
editedAt: at$2.optional().describe("When it was last edited; for a review the newest edit of its body or its inline comments. Missing when never edited or not yet read."),
|
|
1474
|
+
comments: z.array(z.strictObject({
|
|
1475
|
+
id: z.string().min(1).describe("Stable id of the inline review comment in the source."),
|
|
1476
|
+
url: webUrl.optional().describe("Web URL that opens the inline comment, a thread reply included, in its thread."),
|
|
1477
|
+
threadId: z.string().min(1).optional().describe("Id of the review thread the inline comment belongs to."),
|
|
1478
|
+
editedAt: at$2.optional().describe("When the inline comment was last edited; missing when never edited.")
|
|
1479
|
+
})).optional().describe("A review's inline comments, thread replies included, oldest first within each thread; missing for a comment and a review without inline comments.")
|
|
1480
|
+
};
|
|
1467
1481
|
const feedbackSchema = z.strictObject({
|
|
1468
1482
|
kind: z.enum(FEEDBACK_KINDS).describe("Whether this is a comment or a submitted review."),
|
|
1469
1483
|
id: z.string().min(1).describe("Stable id of the comment or review in the source."),
|
|
@@ -1473,7 +1487,8 @@ const feedbackSchema = z.strictObject({
|
|
|
1473
1487
|
}).nullable().describe("Who posted it; null for a deleted account."),
|
|
1474
1488
|
postedAt: at$2.describe("When the comment was posted or the review submitted."),
|
|
1475
1489
|
state: z.enum(REVIEW_STATES).optional().describe("State of this review; missing for a comment and in snapshots written before it."),
|
|
1476
|
-
statusComment: z.literal(true).optional().describe("True for a status comment of a reviewer service, marked by its last line; it is not external feedback. Missing otherwise.")
|
|
1490
|
+
statusComment: z.literal(true).optional().describe("True for a status comment of a reviewer service, marked by its last line; it is not external feedback. Missing otherwise."),
|
|
1491
|
+
...feedbackLinkShape
|
|
1477
1492
|
});
|
|
1478
1493
|
const prFactsSchema = z.strictObject({
|
|
1479
1494
|
repo: repoSlugSchema.describe("Repository as owner/name."),
|
|
@@ -2390,6 +2405,57 @@ function defineOperation(spec) {
|
|
|
2390
2405
|
};
|
|
2391
2406
|
}
|
|
2392
2407
|
//#endregion
|
|
2408
|
+
//#region ../contracts/src/ops/turn-schemas.ts
|
|
2409
|
+
/** One pull request comment or review a turn handed to its executor. */
|
|
2410
|
+
const turnHandedSchema = z.strictObject({
|
|
2411
|
+
...prRefSchema.shape,
|
|
2412
|
+
kind: z.enum(FEEDBACK_KINDS).describe("Whether this is a comment or a submitted review."),
|
|
2413
|
+
id: z.string().min(1).describe("Stable id of the comment or review in the source."),
|
|
2414
|
+
postedAt: z.iso.datetime().describe("When the comment was posted or the review submitted, ISO 8601 UTC."),
|
|
2415
|
+
...feedbackLinkShape
|
|
2416
|
+
}).describe("Pull request feedback a turn handed; an edit after the hand hands it again.");
|
|
2417
|
+
/** The return that opened the Dev visit a turn belongs to. */
|
|
2418
|
+
const turnReturnSchema = z.strictObject({
|
|
2419
|
+
by: actorIdSchema.describe("Who returned the task to Dev."),
|
|
2420
|
+
from: z.enum(COLUMN_IDS).describe("Column the task was returned from."),
|
|
2421
|
+
turn: turnIdSchema.describe("The turn the return closed."),
|
|
2422
|
+
block: blockIdSchema.describe("The code block the return opened."),
|
|
2423
|
+
reason: z.string().describe("Reason of the return, verbatim from its code block.")
|
|
2424
|
+
}).describe("The return that sent the task back to Dev and opened this visit.");
|
|
2425
|
+
const turnViewSchema = z.strictObject({
|
|
2426
|
+
id: turnIdSchema,
|
|
2427
|
+
task: taskKeySchema,
|
|
2428
|
+
column: z.enum(COLUMN_IDS).describe("Board column the turn belongs to."),
|
|
2429
|
+
addressee: z.enum(ADDRESSEE_ROLES).describe("Who executes the turn."),
|
|
2430
|
+
reason: z.string().describe("Why the turn was handed to the executor."),
|
|
2431
|
+
handed: z.array(turnHandedSchema).describe("Pull request feedback handed over with the turn."),
|
|
2432
|
+
returned: turnReturnSchema.optional().describe("The return that opened this Dev visit: who returned it, from which column, the closed turn, the code block and its reason. Missing when the visit did not start with a return."),
|
|
2433
|
+
head: commitShaSchema.nullable().describe("Head commit of the task's pull request when the turn was opened; null when the task had no pull request."),
|
|
2434
|
+
at: z.iso.datetime().describe("When the turn was opened, ISO 8601 UTC."),
|
|
2435
|
+
taken: z.strictObject({
|
|
2436
|
+
by: actorIdSchema,
|
|
2437
|
+
at: z.iso.datetime().describe("When the turn was taken, ISO 8601 UTC.")
|
|
2438
|
+
}).nullable().describe("Who took the turn and when; null until it is taken."),
|
|
2439
|
+
threads: z.array(z.strictObject({
|
|
2440
|
+
id: z.string().min(1).describe("Node ID of the review thread."),
|
|
2441
|
+
url: z.url({ protocol: /^https?$/ }).describe("Web URL of the thread's first comment."),
|
|
2442
|
+
outdated: z.boolean().describe("Whether the thread is on a diff line the head no longer has.")
|
|
2443
|
+
}).describe("One unresolved review thread.")).min(1).optional().describe("The unresolved review threads on the task's open pull request, read live, in a Dev turn of a project requiring resolved threads; absent when none, or when the pull request is closed, merged or missing. Fix or answer each thread, then resolve it.")
|
|
2444
|
+
}).describe("A turn: the executor of a column is asked to act on a task.");
|
|
2445
|
+
/** A turn as `task.get` shows it: who executes it, whether it was taken, and how it closed. */
|
|
2446
|
+
const taskTurnSchema = turnViewSchema.pick({
|
|
2447
|
+
id: true,
|
|
2448
|
+
column: true,
|
|
2449
|
+
addressee: true,
|
|
2450
|
+
at: true,
|
|
2451
|
+
taken: true,
|
|
2452
|
+
handed: true,
|
|
2453
|
+
returned: true
|
|
2454
|
+
}).extend({ closed: z.strictObject({
|
|
2455
|
+
at: z.iso.datetime().describe("When the turn closed, ISO 8601 UTC."),
|
|
2456
|
+
outcome: z.enum(TURN_OUTCOMES).describe("How the turn closed; turns closed by a return or a mode switch before those were recorded read moved.")
|
|
2457
|
+
}).nullable().describe("How and when the turn closed; null while it is open.") }).describe("A task's turn: the executor of a column is asked to act on it.");
|
|
2458
|
+
//#endregion
|
|
2393
2459
|
//#region ../contracts/src/ops/schemas.ts
|
|
2394
2460
|
/**
|
|
2395
2461
|
* A comment as every output returns it. `untrusted` is always `true`: the text comes from a
|
|
@@ -2427,43 +2493,6 @@ const blockViewSchema = z.strictObject({
|
|
|
2427
2493
|
unblockedBy: actorIdSchema.nullable().describe("Actor that unblocked the block; null while open."),
|
|
2428
2494
|
unblockedAt: z.iso.datetime().nullable().describe("When the block was unblocked; null while open.")
|
|
2429
2495
|
}).describe("A block on a task.");
|
|
2430
|
-
/** One pull request comment or review a turn handed to its executor. */
|
|
2431
|
-
const turnHandedSchema = z.strictObject({
|
|
2432
|
-
...prRefSchema.shape,
|
|
2433
|
-
kind: z.enum(FEEDBACK_KINDS).describe("Whether this is a comment or a submitted review."),
|
|
2434
|
-
id: z.string().min(1).describe("Stable id of the comment or review in the source."),
|
|
2435
|
-
postedAt: z.iso.datetime().describe("When the comment was posted or the review submitted, ISO 8601 UTC.")
|
|
2436
|
-
}).describe("Pull request feedback handed over with a turn.");
|
|
2437
|
-
const turnViewSchema = z.strictObject({
|
|
2438
|
-
id: turnIdSchema,
|
|
2439
|
-
task: taskKeySchema,
|
|
2440
|
-
column: z.enum(COLUMN_IDS).describe("Board column the turn belongs to."),
|
|
2441
|
-
addressee: z.enum(ADDRESSEE_ROLES).describe("Who executes the turn."),
|
|
2442
|
-
reason: z.string().describe("Why the turn was handed to the executor."),
|
|
2443
|
-
handed: z.array(turnHandedSchema).describe("Pull request feedback handed over with the turn."),
|
|
2444
|
-
head: commitShaSchema.nullable().describe("Head commit of the task's pull request when the turn was opened; null when the task had no pull request."),
|
|
2445
|
-
at: z.iso.datetime().describe("When the turn was opened, ISO 8601 UTC."),
|
|
2446
|
-
taken: z.strictObject({
|
|
2447
|
-
by: actorIdSchema,
|
|
2448
|
-
at: z.iso.datetime().describe("When the turn was taken, ISO 8601 UTC.")
|
|
2449
|
-
}).nullable().describe("Who took the turn and when; null until it is taken."),
|
|
2450
|
-
threads: z.array(z.strictObject({
|
|
2451
|
-
id: z.string().min(1).describe("Node ID of the review thread."),
|
|
2452
|
-
url: z.url({ protocol: /^https?$/ }).describe("Web URL of the thread's first comment."),
|
|
2453
|
-
outdated: z.boolean().describe("Whether the thread is on a diff line the head no longer has.")
|
|
2454
|
-
}).describe("One unresolved review thread.")).min(1).optional().describe("The unresolved review threads on the task's open pull request, read live, in a Dev turn of a project requiring resolved threads; absent when none, or when the pull request is closed, merged or missing. Fix or answer each thread, then resolve it.")
|
|
2455
|
-
}).describe("A turn: the executor of a column is asked to act on a task.");
|
|
2456
|
-
/** A turn as `task.get` shows it: who executes it, whether it was taken, and how it closed. */
|
|
2457
|
-
const taskTurnSchema = turnViewSchema.pick({
|
|
2458
|
-
id: true,
|
|
2459
|
-
column: true,
|
|
2460
|
-
addressee: true,
|
|
2461
|
-
at: true,
|
|
2462
|
-
taken: true
|
|
2463
|
-
}).extend({ closed: z.strictObject({
|
|
2464
|
-
at: z.iso.datetime().describe("When the turn closed, ISO 8601 UTC."),
|
|
2465
|
-
outcome: z.enum(TURN_OUTCOMES).describe("How the turn closed; turns closed by a return or a mode switch before those were recorded read moved.")
|
|
2466
|
-
}).nullable().describe("How and when the turn closed; null while it is open.") }).describe("A task's turn: the executor of a column is asked to act on it.");
|
|
2467
2496
|
/** One column move from the journal: a dispatcher move, a return to Dev or a correction. */
|
|
2468
2497
|
const moveViewSchema = z.strictObject({
|
|
2469
2498
|
at: z.iso.datetime().describe("When the task moved, ISO 8601 UTC."),
|
|
@@ -2746,7 +2775,21 @@ const handedReview = {
|
|
|
2746
2775
|
number: 42,
|
|
2747
2776
|
kind: "review",
|
|
2748
2777
|
id: "PRR_kwDOA1",
|
|
2749
|
-
postedAt: at
|
|
2778
|
+
postedAt: at,
|
|
2779
|
+
url: "https://github.com/acme/web/pull/42#pullrequestreview-2001",
|
|
2780
|
+
comments: [{
|
|
2781
|
+
id: "PRRC_kwDOA2",
|
|
2782
|
+
url: "https://github.com/acme/web/pull/42#discussion_r3001",
|
|
2783
|
+
threadId: "PRRT_kwDOA3"
|
|
2784
|
+
}]
|
|
2785
|
+
};
|
|
2786
|
+
/** The return from Review that opened the Dev visit, with its code block. */
|
|
2787
|
+
const returnFromReview = {
|
|
2788
|
+
by: "agent:rev/rev-1",
|
|
2789
|
+
from: "review",
|
|
2790
|
+
turn: "T2",
|
|
2791
|
+
block: codeBlock.id,
|
|
2792
|
+
reason: codeBlock.reason
|
|
2750
2793
|
};
|
|
2751
2794
|
const submittedSha = "9f2c4e1b7a3d5c8e0f1a2b3c4d5e6f708192a3b4";
|
|
2752
2795
|
const item = {
|
|
@@ -3045,9 +3088,13 @@ const OPERATIONS = [
|
|
|
3045
3088
|
input: { task: "PROJ-123" },
|
|
3046
3089
|
output: {
|
|
3047
3090
|
task,
|
|
3048
|
-
turn:
|
|
3091
|
+
turn: {
|
|
3092
|
+
...devTurn,
|
|
3093
|
+
handed: [handedReview],
|
|
3094
|
+
returned: returnFromReview
|
|
3095
|
+
},
|
|
3049
3096
|
links: [],
|
|
3050
|
-
blocks: [question],
|
|
3097
|
+
blocks: [question, codeBlock],
|
|
3051
3098
|
comments: [comment]
|
|
3052
3099
|
}
|
|
3053
3100
|
},
|
|
@@ -3071,6 +3118,7 @@ const OPERATIONS = [
|
|
|
3071
3118
|
by: "agent:rev/rev-1",
|
|
3072
3119
|
at
|
|
3073
3120
|
},
|
|
3121
|
+
handed: [],
|
|
3074
3122
|
closed: null
|
|
3075
3123
|
},
|
|
3076
3124
|
links: [],
|
|
@@ -3118,10 +3166,12 @@ const OPERATIONS = [
|
|
|
3118
3166
|
taken: {
|
|
3119
3167
|
by: "agent:web/web-7",
|
|
3120
3168
|
at: later
|
|
3121
|
-
}
|
|
3169
|
+
},
|
|
3170
|
+
handed: []
|
|
3122
3171
|
},
|
|
3123
3172
|
turns: [{
|
|
3124
3173
|
...devTurn,
|
|
3174
|
+
handed: [],
|
|
3125
3175
|
closed: {
|
|
3126
3176
|
at: later,
|
|
3127
3177
|
outcome: "submitted"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, c as tokenRequestStatusSchema, et as errorContextSchema, g as renderJsonError, o as tokenRequestResultSchema, rt as successEnvelopeSchema, tt as errorEnvelopeSchema } from "./chunk-BBfFVeh3.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { request } from "node:http";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as buildCatalogSnapshot, dt as configSchema, p as OPERATIONS, pt as plainHttpAllowed } from "./chunk-
|
|
2
|
-
import { o as CliError, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { d as buildCatalogSnapshot, dt as configSchema, p as OPERATIONS, pt as plainHttpAllowed } from "./chunk-BBfFVeh3.mjs";
|
|
2
|
+
import { o as CliError, t as fetchCatalogVersion } from "./chunk-BxDheuT8.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import { closeSync, constants, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { homedir } from "node:os";
|
package/dist/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Q as ERRORS, _t as SLACK_BOT_SCOPES, a as requestHashOf, dt as configSchema, f as roleCanUseOperation, mt as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, _t as SLACK_BOT_SCOPES, a as requestHashOf, dt as configSchema, f as roleCanUseOperation, mt as requiredSecretKeys, p as OPERATIONS, q as actorIdSchema, r as remoteDoctorReportSchema, rt as successEnvelopeSchema, u as SYSTEMD_SERVICE_SETTINGS } from "./chunk-BBfFVeh3.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
|
-
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-
|
|
4
|
-
import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-
|
|
3
|
+
import { a as requestTokenEnrollment, c as renderCliError, i as requestSkillReload, l as escapeTerminalControls, n as fetchTokenStatus, o as CliError, r as requestOperation, s as errorExitCode } from "./chunk-BxDheuT8.mjs";
|
|
4
|
+
import { a as memoryVerdictCache, c as loadClientConfig, d as resolveDaemonAddress, f as tokenInFolder, i as fileVerdictCache, l as loadEnrollmentConfig, n as cliPackageVersion, o as configFile, s as dataDirectory, t as checkCatalog, u as readConfiguredPort } from "./chunk-CmoLxaIV.mjs";
|
|
5
5
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
6
6
|
import { accessSync, chmodSync, closeSync, constants, cpSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
7
7
|
import { homedir, hostname, userInfo } from "node:os";
|
package/dist/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-
|
|
1
|
+
import { a as requestTokenEnrollment, i as requestSkillReload, n as fetchTokenStatus, r as requestOperation, t as fetchCatalogVersion } from "./chunk-BxDheuT8.mjs";
|
|
2
2
|
export { fetchCatalogVersion, fetchTokenStatus, requestOperation, requestSkillReload, requestTokenEnrollment };
|
package/dist/daemon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as SLACK_BOT_SCOPES, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, c as tokenRequestStatusSchema, ct as RESERVED_PROJECT, d as buildCatalogSnapshot, dt as configSchema, f as roleCanUseOperation, ft as defaultAddressee, gt as DISPATCHER_MODES, h as renderHttpProblem, ht as COLUMN_IDS, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as boardWideSpurProject, m as turnHandedSchema, mt as requiredSecretKeys, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as plainHttpAllowed, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as configBindings, v as SPACE_IDS, vt as TASK_HOLDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as parseRingMarker } from "./chunk-
|
|
1
|
+
import { $ as err, A as prSourceId, B as prFactsSchema, C as userIdSchema, D as AdapterError, E as eventPayloadSchemas, F as REVIEW_STATES, G as JIRA_PROJECT_KEY, H as ringMarker, I as SESSION_HEALTH_STATES, J as encodeActorId, K as REF_NUMBER, L as SESSION_STATUSES, M as sourceCursorSchema, N as trackerSourceId, O as batchSchema, P as PR_STATES, Q as ERRORS, R as isExternalAuthor, S as messageRefSchema, T as GATE_REASONS, U as sessionFactsSchema, V as prRefSchema, W as ticketFactsSchema, X as parseActorId, Y as errorCodeOf, Z as parseRef$1, _t as SLACK_BOT_SCOPES, a as requestHashOf, at as DEFAULT_LINK, b as inboundEventSchema, c as tokenRequestStatusSchema, ct as RESERVED_PROJECT, d as buildCatalogSnapshot, dt as configSchema, f as roleCanUseOperation, ft as defaultAddressee, gt as DISPATCHER_MODES, h as renderHttpProblem, ht as COLUMN_IDS, i as TOKEN_REQUEST_LIMITS, j as sessionTransitionSchema, k as entityRefSchema, l as BOARD_TICK_MS, lt as boardWideSpurProject, m as turnHandedSchema, mt as requiredSecretKeys, n as doctorReportSchema, nt as ok, o as tokenRequestResultSchema, p as OPERATIONS, pt as plainHttpAllowed, q as actorIdSchema, rt as successEnvelopeSchema, s as tokenRequestSchema, st as DEFAULT_SLACK_COMMAND, t as assertNever, ut as configBindings, v as SPACE_IDS, vt as TASK_HOLDS, w as EVENT_KINDS, x as interactionRefSchema, y as conversationRefSchema, z as parseRingMarker } from "./chunk-BBfFVeh3.mjs";
|
|
2
2
|
import { t as apiBaseUrl } from "./chunk-DAMwWWmT.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -8231,6 +8231,38 @@ async function moveViews(db, taskId, options) {
|
|
|
8231
8231
|
const query = db.selectFrom("event").selectAll().where("task_id", "=", taskId).where("kind", "in", MOVE_KINDS);
|
|
8232
8232
|
return ("after" in options ? await query.where("id", ">", options.after).orderBy("id").execute() : (await query.orderBy("id", "desc").limit(options.limit).execute()).reverse()).flatMap((row) => moveView(row) ?? []);
|
|
8233
8233
|
}
|
|
8234
|
+
/**
|
|
8235
|
+
* The return that opened the visit `turn` belongs to, or undefined. A `task.return` closes the
|
|
8236
|
+
* returned turn of the current visit and bumps the column epoch, so the visit it opens is the one
|
|
8237
|
+
* at the next epoch in the column it moved to. Read from ids and epochs, never from `at`: a later
|
|
8238
|
+
* move cannot add or remove it. The reason is the code block's current reason.
|
|
8239
|
+
*/
|
|
8240
|
+
async function turnReturn(db, turn) {
|
|
8241
|
+
const previous = await db.selectFrom("turn").select("id").where("task_id", "=", turn.task_id).where("epoch", "=", turn.epoch - 1).execute();
|
|
8242
|
+
if (previous.length === 0) return void 0;
|
|
8243
|
+
const labels = new Set(previous.map((row) => `T${String(row.id)}`));
|
|
8244
|
+
const moves = await db.selectFrom("event").select([
|
|
8245
|
+
"actor",
|
|
8246
|
+
"actor_ref",
|
|
8247
|
+
"payload"
|
|
8248
|
+
]).where("task_id", "=", turn.task_id).where("kind", "=", "task_moved").orderBy("id", "desc").execute();
|
|
8249
|
+
for (const row of moves) {
|
|
8250
|
+
const parsed = eventPayloadSchemas.task_moved.safeParse(JSON.parse(row.payload));
|
|
8251
|
+
if (!parsed.success) continue;
|
|
8252
|
+
const { from, to, turn: returned, block } = parsed.data;
|
|
8253
|
+
if (returned === void 0 || block === void 0 || to !== turn.column) continue;
|
|
8254
|
+
if (!labels.has(returned) || !/^B\d+$/.test(block)) continue;
|
|
8255
|
+
const opened = await db.selectFrom("block").select("reason").where("id", "=", Number(block.slice(1))).where("task_id", "=", turn.task_id).executeTakeFirst();
|
|
8256
|
+
if (opened === void 0) return void 0;
|
|
8257
|
+
return {
|
|
8258
|
+
by: eventActor(row),
|
|
8259
|
+
from,
|
|
8260
|
+
turn: returned,
|
|
8261
|
+
block,
|
|
8262
|
+
reason: opened.reason
|
|
8263
|
+
};
|
|
8264
|
+
}
|
|
8265
|
+
}
|
|
8234
8266
|
function taskView(task) {
|
|
8235
8267
|
return {
|
|
8236
8268
|
key: task.key,
|
|
@@ -11562,14 +11594,19 @@ async function turnFeedbackCursors(db, prs, count) {
|
|
|
11562
11594
|
}
|
|
11563
11595
|
/**
|
|
11564
11596
|
* The feedback on `ref` that the turns `turnFeedbackCursors` leaves out of `handled` handed over,
|
|
11565
|
-
* oldest first and once each. A later poll may have dropped
|
|
11566
|
-
* and the poll cursor, which still counts those turns, never
|
|
11597
|
+
* oldest first and once each, as the copy with the newest edit. A later poll may have dropped
|
|
11598
|
+
* these entries from the PR snapshot, and the poll cursor, which still counts those turns, never
|
|
11599
|
+
* pages back to them.
|
|
11567
11600
|
*/
|
|
11568
11601
|
async function recalledFeedback(db, ref) {
|
|
11569
11602
|
const entries = [];
|
|
11570
11603
|
for (const row of await prTurns(db, [ref])) {
|
|
11571
11604
|
if (!isRecalled(row)) continue;
|
|
11572
|
-
for (const entry of handedOn(row, ref))
|
|
11605
|
+
for (const entry of handedOn(row, ref)) {
|
|
11606
|
+
const index = entries.findIndex((old) => sameHanded(old, entry));
|
|
11607
|
+
if (index === -1) entries.push(entry);
|
|
11608
|
+
else if (isNewerEdit(entry, entries[index])) entries[index] = entry;
|
|
11609
|
+
}
|
|
11573
11610
|
}
|
|
11574
11611
|
return (await withoutStatusComments(db, entries)).sort((left, right) => isNewer(left, right) ? 1 : -1);
|
|
11575
11612
|
}
|
|
@@ -11600,6 +11637,35 @@ async function withoutStatusComments(db, entries) {
|
|
|
11600
11637
|
}
|
|
11601
11638
|
return entries.filter((entry) => !flagged.some((old) => sameHanded(old, entry)));
|
|
11602
11639
|
}
|
|
11640
|
+
/** Whether `left` carries a newer edit than `right`. */
|
|
11641
|
+
function isNewerEdit(left, right) {
|
|
11642
|
+
if (left.editedAt === void 0) return false;
|
|
11643
|
+
return right.editedAt === void 0 || Date.parse(left.editedAt) > Date.parse(right.editedAt);
|
|
11644
|
+
}
|
|
11645
|
+
/**
|
|
11646
|
+
* The edit baseline of feedback on `ref`: an entry edited after it counts as unhandled again.
|
|
11647
|
+
* Over the turns `turnFeedbackCursors` counts as `handled`, each copy of the entry gives its
|
|
11648
|
+
* `editedAt`; else, with a `url`, no bound (this version handed it unedited, so any edit counts);
|
|
11649
|
+
* else its turn's `created_at` (handed before entries had either). The newest copy wins. An entry
|
|
11650
|
+
* no turn handed gets the earliest `created_at` of the turns that handed a newer entry, or none.
|
|
11651
|
+
*/
|
|
11652
|
+
async function editBaselines(db, ref) {
|
|
11653
|
+
const turns = (await prTurns(db, [ref])).filter((row) => !isRecalled(row)).map((row) => ({
|
|
11654
|
+
at: Date.parse(row.created_at),
|
|
11655
|
+
entries: handedOn(row, ref)
|
|
11656
|
+
}));
|
|
11657
|
+
return (entry) => {
|
|
11658
|
+
let base;
|
|
11659
|
+
for (const { at, entries } of turns) for (const copy of entries) {
|
|
11660
|
+
if (!sameHanded(copy, entry)) continue;
|
|
11661
|
+
const own = copy.editedAt !== void 0 ? Date.parse(copy.editedAt) : copy.url !== void 0 ? -Infinity : at;
|
|
11662
|
+
base = base === void 0 ? own : Math.max(base, own);
|
|
11663
|
+
}
|
|
11664
|
+
if (base !== void 0) return base;
|
|
11665
|
+
const newer = turns.filter(({ entries }) => entries.some((copy) => isNewer(copy, entry)));
|
|
11666
|
+
return Math.min(Infinity, ...newer.map(({ at }) => at));
|
|
11667
|
+
};
|
|
11668
|
+
}
|
|
11603
11669
|
/** Whether two handed entries are the same feedback on the same PR. */
|
|
11604
11670
|
function sameHanded(left, right) {
|
|
11605
11671
|
return left.repo.toLowerCase() === right.repo.toLowerCase() && left.number === right.number && left.kind === right.kind && left.id === right.id;
|
|
@@ -11611,7 +11677,8 @@ function prTurns(db, prs) {
|
|
|
11611
11677
|
"link.number",
|
|
11612
11678
|
"turn.handed",
|
|
11613
11679
|
"turn.acked_at",
|
|
11614
|
-
"turn.closed_reason"
|
|
11680
|
+
"turn.closed_reason",
|
|
11681
|
+
"turn.created_at"
|
|
11615
11682
|
]).where("link.entity", "=", "pr").where("link.banned", "=", 0).where(sql`lower(link.repo)`, "in", prs.map((pr) => pr.repo.toLowerCase())).execute();
|
|
11616
11683
|
}
|
|
11617
11684
|
/** Whether a correction or a reroute closed the turn before anyone took it. */
|
|
@@ -15656,8 +15723,10 @@ function externalApproval(pr, agentLogin) {
|
|
|
15656
15723
|
* by its own state, or, in a snapshot written before entries had one, when it matches the
|
|
15657
15724
|
* reviewer's latest approval. An entry is handled once a turn handed it over, or an older one,
|
|
15658
15725
|
* unless a correction or a reroute closed that turn untaken, or once a handling submission
|
|
15659
|
-
* (`handlingSubmits`) on this PR was made at or after it
|
|
15660
|
-
*
|
|
15726
|
+
* (`handlingSubmits`) on this PR was made at or after it and its last edit. An edit after the
|
|
15727
|
+
* entry's baseline (`editBaselines`) makes it unhandled again, so it is handed once per edit.
|
|
15728
|
+
* The entries such an untaken turn handed over come from the turn when a later poll dropped them
|
|
15729
|
+
* from the snapshot (`recalledFeedback`).
|
|
15661
15730
|
* A reviewer service's status comment (`statusComment`) never counts, and neither a recall nor a
|
|
15662
15731
|
* reroute hands one over again (`withoutStatusComments` in `turns.ts`).
|
|
15663
15732
|
*/
|
|
@@ -15672,11 +15741,20 @@ async function unhandledFeedback(trx, task, project, pr) {
|
|
|
15672
15741
|
number: pr.number
|
|
15673
15742
|
}], "handled");
|
|
15674
15743
|
const fromSnapshot = entries.map((entry) => handedOf(pr, entry));
|
|
15675
|
-
|
|
15744
|
+
const recalled = (await recalledFeedback(trx, {
|
|
15676
15745
|
kind: "pr",
|
|
15677
15746
|
repo: pr.repo,
|
|
15678
15747
|
number: pr.number
|
|
15679
|
-
})).filter((entry) => !fromSnapshot.some((old) => sameHanded(old, entry)))
|
|
15748
|
+
})).filter((entry) => !fromSnapshot.some((old) => sameHanded(old, entry)));
|
|
15749
|
+
const baseline = await editBaselines(trx, {
|
|
15750
|
+
kind: "pr",
|
|
15751
|
+
repo: pr.repo,
|
|
15752
|
+
number: pr.number
|
|
15753
|
+
});
|
|
15754
|
+
return [...recalled, ...fromSnapshot].filter((entry) => {
|
|
15755
|
+
const edited = entry.editedAt === void 0 ? -Infinity : Date.parse(entry.editedAt);
|
|
15756
|
+
return !(Math.max(Date.parse(entry.postedAt), edited) <= newest) && (cursor === void 0 || isNewer(entry, cursor) || edited > baseline(entry));
|
|
15757
|
+
});
|
|
15680
15758
|
}
|
|
15681
15759
|
/**
|
|
15682
15760
|
* The submissions of `taskIds` that handle the external feedback posted before them on the PR
|
|
@@ -15749,7 +15827,10 @@ function handedOf(pr, entry) {
|
|
|
15749
15827
|
number: pr.number,
|
|
15750
15828
|
kind: entry.kind,
|
|
15751
15829
|
id: entry.id,
|
|
15752
|
-
postedAt: entry.postedAt
|
|
15830
|
+
postedAt: entry.postedAt,
|
|
15831
|
+
...entry.url === void 0 ? {} : { url: entry.url },
|
|
15832
|
+
...entry.editedAt === void 0 ? {} : { editedAt: entry.editedAt },
|
|
15833
|
+
...entry.comments === void 0 ? {} : { comments: entry.comments }
|
|
15753
15834
|
};
|
|
15754
15835
|
}
|
|
15755
15836
|
/** The clock passed `until` and a complete poll of each of `repos` started at or after it. */
|
|
@@ -16027,7 +16108,10 @@ async function applyOn(trx, task, read, result, ctx) {
|
|
|
16027
16108
|
at
|
|
16028
16109
|
});
|
|
16029
16110
|
const carried = replaced === void 0 ? [] : await carriedFeedback(trx, replaced);
|
|
16030
|
-
const handed = [...carried
|
|
16111
|
+
const handed = [...carried.map((old) => {
|
|
16112
|
+
const fresh = read.handed.find((entry) => sameHanded(old, entry));
|
|
16113
|
+
return fresh !== void 0 && isNewerEdit(fresh, old) ? fresh : old;
|
|
16114
|
+
}), ...read.handed.filter((entry) => !carried.some((old) => sameHanded(old, entry)))];
|
|
16031
16115
|
const reason = read.mergedOpen === void 0 || turn.kind === "reroute" ? turnReason(turn, replaced?.reason) : `${turnReason(turn)} (PR ${read.mergedOpen.repo}#${String(read.mergedOpen.number)} merged, ticket still open)`;
|
|
16032
16116
|
await openTurn(trx, {
|
|
16033
16117
|
task: current,
|
|
@@ -16135,7 +16219,8 @@ async function dispatchMergedTickets(trx, source, ctx) {
|
|
|
16135
16219
|
//#region ../core/src/app/task-turns.ts
|
|
16136
16220
|
/** How many closed turns `task.get --detail` shows. */
|
|
16137
16221
|
const DETAIL_TURNS = 5;
|
|
16138
|
-
function taskTurnView(turn) {
|
|
16222
|
+
async function taskTurnView(trx, turn) {
|
|
16223
|
+
const returned = await turnReturn(trx, turn);
|
|
16139
16224
|
return {
|
|
16140
16225
|
id: `T${String(turn.id)}`,
|
|
16141
16226
|
column: turn.column,
|
|
@@ -16145,6 +16230,8 @@ function taskTurnView(turn) {
|
|
|
16145
16230
|
by: turn.acked_by,
|
|
16146
16231
|
at: turn.acked_at
|
|
16147
16232
|
},
|
|
16233
|
+
handed: turnHanded(turn),
|
|
16234
|
+
...returned === void 0 ? {} : { returned },
|
|
16148
16235
|
closed: turn.closed_at === null || turn.closed_reason === null ? null : {
|
|
16149
16236
|
at: turn.closed_at,
|
|
16150
16237
|
outcome: turn.closed_reason
|
|
@@ -16157,11 +16244,14 @@ function taskTurnView(turn) {
|
|
|
16157
16244
|
*/
|
|
16158
16245
|
async function taskTurns(trx, task, detail) {
|
|
16159
16246
|
const open = await trx.selectFrom("turn").selectAll().where("task_id", "=", task.id).where("closed_at", "is", null).orderBy("id", "desc").executeTakeFirst();
|
|
16160
|
-
const turn = open === void 0 ? null : taskTurnView(open);
|
|
16247
|
+
const turn = open === void 0 ? null : await taskTurnView(trx, open);
|
|
16161
16248
|
if (!detail) return { turn };
|
|
16249
|
+
const closed = await trx.selectFrom("turn").selectAll().where("task_id", "=", task.id).where("closed_at", "is not", null).orderBy("id", "desc").limit(DETAIL_TURNS).execute();
|
|
16250
|
+
const turns = [];
|
|
16251
|
+
for (const row of closed) turns.push(await taskTurnView(trx, row));
|
|
16162
16252
|
return {
|
|
16163
16253
|
turn,
|
|
16164
|
-
turns
|
|
16254
|
+
turns
|
|
16165
16255
|
};
|
|
16166
16256
|
}
|
|
16167
16257
|
//#endregion
|
|
@@ -16197,9 +16287,13 @@ async function turnThreads(trx, taskId, project, turn) {
|
|
|
16197
16287
|
}]);
|
|
16198
16288
|
return threads.length === 0 ? void 0 : threads;
|
|
16199
16289
|
}
|
|
16200
|
-
/**
|
|
16290
|
+
/**
|
|
16291
|
+
* A turn as the worker and `task.get --why` read it, with the return that opened its visit and the
|
|
16292
|
+
* threads of a Dev turn.
|
|
16293
|
+
*/
|
|
16201
16294
|
async function turnView(trx, turn, task, project) {
|
|
16202
16295
|
const threads = await turnThreads(trx, task.id, project, turn);
|
|
16296
|
+
const returned = await turnReturn(trx, turn);
|
|
16203
16297
|
return {
|
|
16204
16298
|
id: `T${String(turn.id)}`,
|
|
16205
16299
|
task: task.key,
|
|
@@ -16207,6 +16301,7 @@ async function turnView(trx, turn, task, project) {
|
|
|
16207
16301
|
addressee: turn.role,
|
|
16208
16302
|
reason: turn.reason,
|
|
16209
16303
|
handed: turnHanded(turn),
|
|
16304
|
+
...returned === void 0 ? {} : { returned },
|
|
16210
16305
|
head: turn.head_sha,
|
|
16211
16306
|
at: turn.created_at,
|
|
16212
16307
|
taken: turn.acked_by === null || turn.acked_at === null ? null : {
|
|
@@ -19515,9 +19610,9 @@ function teamScopeDenied(error, query) {
|
|
|
19515
19610
|
return /\b(?:slug|name)\b/i.test(error.message) && /\bread:(?:org|discussion)\b/i.test(error.message);
|
|
19516
19611
|
}
|
|
19517
19612
|
const REVIEWER_FIELDS = "requestedReviewer { __typename ... on Bot { login } ... on Mannequin { login } ... on User { login } ... on Team { slug } ... on EnterpriseTeam { slug } } asCodeOwner";
|
|
19518
|
-
const REVIEW_FIELDS = "id author { __typename login } state commit { oid } submittedAt";
|
|
19519
|
-
const COMMENT_FIELDS = "nodes { id author { __typename login } createdAt body } pageInfo { hasPreviousPage startCursor }";
|
|
19520
|
-
const THREAD_FIELDS = "id isResolved isOutdated comments(
|
|
19613
|
+
const REVIEW_FIELDS = "id author { __typename login } state commit { oid } submittedAt url lastEditedAt";
|
|
19614
|
+
const COMMENT_FIELDS = "nodes { id author { __typename login } createdAt body url lastEditedAt } pageInfo { hasPreviousPage startCursor }";
|
|
19615
|
+
const THREAD_FIELDS = "id isResolved isOutdated comments(last: 100) { nodes { id url lastEditedAt pullRequestReview { id } } }";
|
|
19521
19616
|
const CLOSING_FIELDS = "nodes { number repository { nameWithOwner } } pageInfo { hasNextPage endCursor }";
|
|
19522
19617
|
const prFields = (number, closing = false) => `id number url title updatedAt mergedAt closedAt state isDraft mergeable mergeStateStatus
|
|
19523
19618
|
author { login } headRefName headRefOid
|
|
@@ -19530,7 +19625,7 @@ const prFields = (number, closing = false) => `id number url title updatedAt mer
|
|
|
19530
19625
|
reviewThreads(first: 100) { nodes { ${THREAD_FIELDS} } pageInfo { hasNextPage endCursor } }
|
|
19531
19626
|
reviewRequests(first: 100) { nodes { ${REVIEWER_FIELDS} } pageInfo { hasNextPage endCursor } }${closing ? `\n closingIssuesReferences(first: 100) { ${CLOSING_FIELDS} }` : ""}`;
|
|
19532
19627
|
const DISCOVERY_FIELDS = `nodes { number updatedAt author { login } state } pageInfo { hasNextPage endCursor }`;
|
|
19533
|
-
const INDEX_FIELDS = `number updatedAt state isDraft mergeable mergeStateStatus headRefOid statusCheckRollup { state contexts(first: 100) { totalCount nodes { ... on CheckRun { __typename name status conclusion completedAt } ... on StatusContext { __typename context state } } } } reviews(first: 100) { totalCount nodes { id state } } reviewThreads(first: 100) { totalCount nodes { isResolved } } reviewRequests(first: 100) { totalCount nodes { ${REVIEWER_FIELDS} } } comments(last: 1) { totalCount nodes { id } }`;
|
|
19628
|
+
const INDEX_FIELDS = `number updatedAt state isDraft mergeable mergeStateStatus headRefOid statusCheckRollup { state contexts(first: 100) { totalCount nodes { ... on CheckRun { __typename name status conclusion completedAt } ... on StatusContext { __typename context state } } } } reviews(first: 100) { totalCount nodes { id state lastEditedAt } } reviewThreads(first: 100) { totalCount nodes { isResolved } } reviewRequests(first: 100) { totalCount nodes { ${REVIEWER_FIELDS} } } comments(last: 1) { totalCount nodes { id } } edited: comments(first: 1, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { id updatedAt } }`;
|
|
19534
19629
|
function aliases(numbers, fields) {
|
|
19535
19630
|
return numbers.map((number, i) => `pr${String(i)}: repository(owner: $owner, name: $repo) { pullRequest(number: ${String(number)}) { ${fields(number)} } }`).join("\n");
|
|
19536
19631
|
}
|
|
@@ -19686,6 +19781,47 @@ function nextPage(connection) {
|
|
|
19686
19781
|
return endCursor;
|
|
19687
19782
|
}
|
|
19688
19783
|
//#endregion
|
|
19784
|
+
//#region ../adapters/src/github/feedbackLinks.ts
|
|
19785
|
+
const threadCommentWire = z.object({
|
|
19786
|
+
id: z.string().min(1),
|
|
19787
|
+
url: z.string().optional(),
|
|
19788
|
+
lastEditedAt: z.string().nullish(),
|
|
19789
|
+
pullRequestReview: z.object({ id: z.string().min(1) }).nullish()
|
|
19790
|
+
});
|
|
19791
|
+
const threadWire = z.object({
|
|
19792
|
+
id: z.string().min(1).optional(),
|
|
19793
|
+
isResolved: z.boolean(),
|
|
19794
|
+
isOutdated: z.boolean().optional(),
|
|
19795
|
+
comments: z.object({ nodes: z.array(threadCommentWire) }).optional()
|
|
19796
|
+
});
|
|
19797
|
+
/** The newest of the given edit times; undefined when none was edited. */
|
|
19798
|
+
function newestEdit(times) {
|
|
19799
|
+
return times.reduce((newest, time) => time == null || newest !== void 0 && Date.parse(newest) >= Date.parse(time) ? newest : time, void 0);
|
|
19800
|
+
}
|
|
19801
|
+
/** The link fields of a fact: each only when GitHub gave it, never guessed. */
|
|
19802
|
+
function linkOf(url, editedAt) {
|
|
19803
|
+
return {
|
|
19804
|
+
...url === void 0 ? {} : { url },
|
|
19805
|
+
...editedAt == null ? {} : { editedAt }
|
|
19806
|
+
};
|
|
19807
|
+
}
|
|
19808
|
+
/** Each review's inline comments by review id, in thread order and oldest first in a thread. */
|
|
19809
|
+
function inlineComments(threads) {
|
|
19810
|
+
const byReview = /* @__PURE__ */ new Map();
|
|
19811
|
+
for (const thread of threads) for (const node of thread.comments?.nodes ?? []) {
|
|
19812
|
+
const review = node.pullRequestReview?.id;
|
|
19813
|
+
if (review === void 0) continue;
|
|
19814
|
+
const list = byReview.get(review) ?? [];
|
|
19815
|
+
list.push({
|
|
19816
|
+
id: node.id,
|
|
19817
|
+
...linkOf(node.url, node.lastEditedAt),
|
|
19818
|
+
...thread.id === void 0 ? {} : { threadId: thread.id }
|
|
19819
|
+
});
|
|
19820
|
+
byReview.set(review, list);
|
|
19821
|
+
}
|
|
19822
|
+
return byReview;
|
|
19823
|
+
}
|
|
19824
|
+
//#endregion
|
|
19689
19825
|
//#region ../adapters/src/github/prBatch.ts
|
|
19690
19826
|
const KEPT_REVIEWS = [
|
|
19691
19827
|
"approved",
|
|
@@ -19720,14 +19856,18 @@ const reviewWire = z.object({
|
|
|
19720
19856
|
author: typedActor,
|
|
19721
19857
|
state: z.string(),
|
|
19722
19858
|
commit: z.object({ oid: z.string() }).nullable(),
|
|
19723
|
-
submittedAt: z.string().nullish()
|
|
19859
|
+
submittedAt: z.string().nullish(),
|
|
19860
|
+
url: z.string().optional(),
|
|
19861
|
+
lastEditedAt: z.string().nullish()
|
|
19724
19862
|
}).refine((review) => review.commit !== null || !review.author?.login || review.submittedAt == null || !KEPT_REVIEWS.includes(review.state.toLowerCase()), { path: ["commit"] });
|
|
19725
19863
|
const nodes = (node) => z.object({ nodes: z.array(node) });
|
|
19726
19864
|
const commentWire = z.object({
|
|
19727
19865
|
id: z.string().min(1),
|
|
19728
19866
|
author: typedActor,
|
|
19729
19867
|
createdAt: z.iso.datetime(),
|
|
19730
|
-
body: z.string().optional()
|
|
19868
|
+
body: z.string().optional(),
|
|
19869
|
+
url: z.string().optional(),
|
|
19870
|
+
lastEditedAt: z.iso.datetime().nullish()
|
|
19731
19871
|
});
|
|
19732
19872
|
const loginReviewer = (type) => z.object({
|
|
19733
19873
|
__typename: z.literal(type),
|
|
@@ -19765,12 +19905,7 @@ const prWire = z.object({
|
|
|
19765
19905
|
statusCheckRollup: z.object({ contexts: nodes(contextWire) }).nullish(),
|
|
19766
19906
|
reviews: nodes(reviewWire),
|
|
19767
19907
|
comments: nodes(commentWire),
|
|
19768
|
-
reviewThreads: nodes(
|
|
19769
|
-
id: z.string().optional(),
|
|
19770
|
-
isResolved: z.boolean(),
|
|
19771
|
-
isOutdated: z.boolean().optional(),
|
|
19772
|
-
comments: nodes(z.object({ url: z.string() })).optional()
|
|
19773
|
-
})),
|
|
19908
|
+
reviewThreads: nodes(threadWire),
|
|
19774
19909
|
reviewRequests: nodes(z.object({
|
|
19775
19910
|
requestedReviewer: reviewerWire,
|
|
19776
19911
|
asCodeOwner: z.boolean()
|
|
@@ -19901,7 +20036,8 @@ function isStatusComment(body) {
|
|
|
19901
20036
|
const last = body?.trimEnd().split("\n").at(-1);
|
|
19902
20037
|
return last !== void 0 && STATUS_LINE.test(last);
|
|
19903
20038
|
}
|
|
19904
|
-
function feedbackOf(reviews, comments, held) {
|
|
20039
|
+
function feedbackOf(reviews, comments, threads, held) {
|
|
20040
|
+
const inline = inlineComments(threads);
|
|
19905
20041
|
const entries = /* @__PURE__ */ new Map();
|
|
19906
20042
|
const add = (entry) => {
|
|
19907
20043
|
entries.set(`${entry.kind}:${entry.id}`, entry);
|
|
@@ -19912,17 +20048,22 @@ function feedbackOf(reviews, comments, held) {
|
|
|
19912
20048
|
id: node.id,
|
|
19913
20049
|
author: feedbackAuthor(node.author),
|
|
19914
20050
|
postedAt: node.createdAt,
|
|
19915
|
-
...isStatusComment(node.body) ? { statusComment: true } : {}
|
|
20051
|
+
...isStatusComment(node.body) ? { statusComment: true } : {},
|
|
20052
|
+
...linkOf(node.url, node.lastEditedAt)
|
|
19916
20053
|
});
|
|
19917
20054
|
for (const node of reviews) {
|
|
19918
20055
|
if (node.submittedAt == null) continue;
|
|
19919
20056
|
const state = REVIEW_STATES.find((known) => known === node.state.toLowerCase());
|
|
20057
|
+
const own = inline.get(node.id) ?? [];
|
|
20058
|
+
const editedAt = newestEdit([node.lastEditedAt, ...own.map((entry) => entry.editedAt)]);
|
|
19920
20059
|
add({
|
|
19921
20060
|
kind: "review",
|
|
19922
20061
|
id: node.id,
|
|
19923
20062
|
author: feedbackAuthor(node.author),
|
|
19924
20063
|
postedAt: node.submittedAt,
|
|
19925
|
-
...state === void 0 ? {} : { state }
|
|
20064
|
+
...state === void 0 ? {} : { state },
|
|
20065
|
+
...linkOf(node.url, editedAt),
|
|
20066
|
+
...own.length === 0 ? {} : { comments: own }
|
|
19926
20067
|
});
|
|
19927
20068
|
}
|
|
19928
20069
|
const tie = (entry) => `${entry.id}\u0000${entry.kind}`;
|
|
@@ -20061,7 +20202,7 @@ function normalizePr(repo, value, rule, feedbackComplete, held = []) {
|
|
|
20061
20202
|
updatedAt: wire.updatedAt,
|
|
20062
20203
|
...state === "merged" && wire.mergedAt !== null ? { mergedAt: wire.mergedAt } : {},
|
|
20063
20204
|
...state === "closed" && wire.closedAt !== null ? { closedAt: wire.closedAt } : {},
|
|
20064
|
-
feedback: feedbackOf(wire.reviews.nodes, wire.comments.nodes, held),
|
|
20205
|
+
feedback: feedbackOf(wire.reviews.nodes, wire.comments.nodes, wire.reviewThreads.nodes, held),
|
|
20065
20206
|
feedbackComplete
|
|
20066
20207
|
};
|
|
20067
20208
|
const parsed = prFactsSchema.safeParse(facts);
|
|
@@ -20096,7 +20237,8 @@ const indexAliasWire = z.object({ pullRequest: z.object({
|
|
|
20096
20237
|
}).nullable(),
|
|
20097
20238
|
reviews: counted(z.object({
|
|
20098
20239
|
id: z.string(),
|
|
20099
|
-
state: z.string()
|
|
20240
|
+
state: z.string(),
|
|
20241
|
+
lastEditedAt: z.string().nullable()
|
|
20100
20242
|
})),
|
|
20101
20243
|
reviewThreads: counted(z.object({ isResolved: z.boolean() })),
|
|
20102
20244
|
reviewRequests: counted(z.object({
|
|
@@ -20107,7 +20249,11 @@ const indexAliasWire = z.object({ pullRequest: z.object({
|
|
|
20107
20249
|
}).nullable(),
|
|
20108
20250
|
asCodeOwner: z.boolean()
|
|
20109
20251
|
})),
|
|
20110
|
-
comments: counted(z.object({ id: z.string() }))
|
|
20252
|
+
comments: counted(z.object({ id: z.string() })),
|
|
20253
|
+
edited: z.object({ nodes: z.array(z.object({
|
|
20254
|
+
id: z.string(),
|
|
20255
|
+
updatedAt: z.string()
|
|
20256
|
+
})) })
|
|
20111
20257
|
}) });
|
|
20112
20258
|
/** Reads one index alias; a shape that does not parse means the PR is read in full. */
|
|
20113
20259
|
function indexEntry(alias) {
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-
|
|
2
|
-
import { o as CliError, r as requestOperation } from "./chunk-
|
|
3
|
-
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-
|
|
1
|
+
import { Q as ERRORS, _ as renderMcpError, p as OPERATIONS } from "./chunk-BBfFVeh3.mjs";
|
|
2
|
+
import { o as CliError, r as requestOperation } from "./chunk-BxDheuT8.mjs";
|
|
3
|
+
import { a as memoryVerdictCache, c as loadClientConfig, r as compareCatalogs, t as checkCatalog } from "./chunk-CmoLxaIV.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { z } from "zod";
|
package/package.json
CHANGED
|
@@ -43,6 +43,7 @@ hides its inline comments; thread resolution and the head a comment was left on
|
|
|
43
43
|
change nothing for feedback. Bots (GitHub Apps) neither return a task, approve it nor block
|
|
44
44
|
an approval; their threads still count. Handled means handed by ID to a Dev turn, not answered; in shadow
|
|
45
45
|
mode, a later submit in Dev or an executor `none` column handles it.
|
|
46
|
+
An edit after the hand makes it unhandled again, returning a task right of Dev.
|
|
46
47
|
A status comment whose last line is a hidden `board-reviewer-progress` or
|
|
47
48
|
`board-reviewer-unavailable` marker is not external feedback. No required checks: non-skipped count. `projects[].reposWithoutCi` waives absent checks
|
|
48
49
|
for listed repos; never failed/skipped required ones.
|
|
@@ -78,6 +79,9 @@ A new head closes taken turns outside Dev; taken Dev turns survive pushes.
|
|
|
78
79
|
Right of Dev, red CI, a draft, a conflict, an external comment or an unresolved
|
|
79
80
|
thread where required returns the task to Dev at once, unless a turn is taken; then after its submit or return.
|
|
80
81
|
The Dev turn hands the comments, beside a return's `code` block.
|
|
82
|
+
Each handed entry has its `url`, `editedAt` once edited, and a review's inline
|
|
83
|
+
`comments` with `url` and `threadId`. Turns of a Dev visit opened by a return
|
|
84
|
+
show `returned`: who, from, the turn, the `code` block and the verbatim reason.
|
|
81
85
|
|
|
82
86
|
Closed turns receive no further Board sends; Obsolete queued rings are dropped;
|
|
83
87
|
a message already accepted by Spur cannot be retracted. Check `board inbox` and
|