neondeck 1.0.0-beta.8 → 1.0.0-beta.9
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 +12 -0
- package/config/dashboard.json +2 -1
- package/config/dashboard.schema.json +8 -3
- package/dist/assets/{app-kQMyZcgk.js → app-ChpCY1hX.js} +115 -32
- package/dist/assets/app-ChpCY1hX.js.map +1 -0
- package/dist/assets/{autopilot-BB7mZq1T.js → autopilot-CMaU1iZd.js} +95 -14
- package/dist/assets/autopilot-CMaU1iZd.js.map +1 -0
- package/dist/assets/briefing-Bxg1ctBW.js +2 -0
- package/dist/assets/{briefing-DiyTAcGr.js → briefing-Cf4ZpqPr.js} +4 -4
- package/dist/assets/{briefing-DiyTAcGr.js.map → briefing-Cf4ZpqPr.js.map} +1 -1
- package/dist/assets/{briefings-DNfGmgfx.js → briefings-DtOcw7y6.js} +5 -5
- package/dist/assets/{briefings-DNfGmgfx.js.map → briefings-DtOcw7y6.js.map} +1 -1
- package/dist/assets/{command-run-DpsXopbz.js → command-run-B9uZYF9u.js} +4 -4
- package/dist/assets/{command-run-DpsXopbz.js.map → command-run-B9uZYF9u.js.map} +1 -1
- package/dist/assets/command-run-CNnU2WOV.js +2 -0
- package/dist/assets/{display-assistant-9iqf71qj.js → display-assistant-DEh-qGUl.js} +6 -6
- package/dist/assets/{display-assistant-9iqf71qj.js.map → display-assistant-DEh-qGUl.js.map} +1 -1
- package/dist/assets/fix-pr-ci-DFdWMhjV.js +2 -0
- package/dist/assets/{fix-pr-ci-DIJj3je4.js → fix-pr-ci-DolohowP.js} +2 -2
- package/dist/assets/{fix-pr-ci-DIJj3je4.js.map → fix-pr-ci-DolohowP.js.map} +1 -1
- package/dist/assets/{pr-reviews-D1kgrd3B.js → pr-reviews-CbYcf9Mj.js} +142 -9
- package/dist/assets/pr-reviews-CbYcf9Mj.js.map +1 -0
- package/dist/assets/{prepare-pr-worktree-DDlVS5Ug.js → prepare-pr-worktree-CwalJPIV.js} +1 -1
- package/dist/assets/{prepare-pr-worktree-D_QmohmG.js → prepare-pr-worktree-D3gy9Uof.js} +3 -3
- package/dist/assets/{prepare-pr-worktree-D_QmohmG.js.map → prepare-pr-worktree-D3gy9Uof.js.map} +1 -1
- package/dist/assets/{push-pr-autofix-D6c-v-4C.js → push-pr-autofix-DUXYeBds.js} +1 -1
- package/dist/assets/{push-pr-autofix-Dm6pEM39.js → push-pr-autofix-OOoR6FIp.js} +3 -3
- package/dist/assets/{push-pr-autofix-Dm6pEM39.js.map → push-pr-autofix-OOoR6FIp.js.map} +1 -1
- package/dist/assets/{review-pr-for-human-C25YX93Q.js → review-pr-for-human-5oA8Lnwm.js} +44 -16
- package/dist/assets/review-pr-for-human-5oA8Lnwm.js.map +1 -0
- package/dist/assets/{review-pr-for-human-BSlPTs2t.js → review-pr-for-human-CTIL0RRy.js} +1 -1
- package/dist/assets/{safety-Bjw5dbyq.js → safety-S_Ek3ETH.js} +7 -3
- package/dist/assets/safety-S_Ek3ETH.js.map +1 -0
- package/dist/assets/{scheduled-agent-instruction-Bk4kfeKF.js → scheduled-agent-instruction-C7Xz50tm.js} +1 -1
- package/dist/assets/{scheduled-agent-instruction-6sxkQZ7u.js → scheduled-agent-instruction-CEpmfBNA.js} +3 -3
- package/dist/assets/{scheduled-agent-instruction-6sxkQZ7u.js.map → scheduled-agent-instruction-CEpmfBNA.js.map} +1 -1
- package/dist/assets/{scheduler-tick-CpUBkC78.js → scheduler-tick-DO_6nnY9.js} +4 -4
- package/dist/assets/{scheduler-tick-CpUBkC78.js.map → scheduler-tick-DO_6nnY9.js.map} +1 -1
- package/dist/assets/{scheduler-workflow-C8Z2EPml.js → scheduler-workflow-CwK7no2d.js} +2 -2
- package/dist/assets/{scheduler-workflow-C8Z2EPml.js.map → scheduler-workflow-CwK7no2d.js.map} +1 -1
- package/dist/assets/skills/neon-pr-review/SKILL.md +1 -1
- package/dist/assets/skills/neondeck/SKILL.md +1 -1
- package/dist/assets/{triage-pr-event-CkVVzCjs.js → triage-pr-event-C2g4s1dt.js} +1 -1
- package/dist/assets/{triage-pr-event-CsiNPAxU.js → triage-pr-event-CCNMZZPE.js} +3 -3
- package/dist/assets/{triage-pr-event-CsiNPAxU.js.map → triage-pr-event-CCNMZZPE.js.map} +1 -1
- package/dist/assets/{verify-then-push-pr-autofix-CS4KZOs2.js → verify-then-push-pr-autofix-9Dzuwky_.js} +1 -1
- package/dist/assets/{verify-then-push-pr-autofix-DZ_Ksu9s.js → verify-then-push-pr-autofix-CHEU7V9v.js} +3 -3
- package/dist/assets/{verify-then-push-pr-autofix-DZ_Ksu9s.js.map → verify-then-push-pr-autofix-CHEU7V9v.js.map} +1 -1
- package/dist/config/dashboard.json +2 -1
- package/dist/config/dashboard.schema.json +8 -3
- package/dist/server.mjs +14 -14
- package/dist/skills/neon-pr-review/SKILL.md +1 -1
- package/dist/skills/neondeck/SKILL.md +1 -1
- package/package.json +1 -1
- package/src/modules/config/mutations/dashboard.ts +3 -0
- package/src/modules/github/index.ts +1 -0
- package/src/modules/github/pull-requests.ts +30 -3
- package/src/modules/github/reviews.ts +25 -0
- package/src/modules/pr-review-assist/schemas.ts +16 -6
- package/src/modules/pr-review-assist/service.ts +31 -7
- package/src/modules/pr-reviews/service.ts +221 -21
- package/src/modules/pr-reviews/store.ts +1 -0
- package/src/modules/pr-reviews/types.ts +2 -1
- package/src/modules/safety/policy-entries.ts +9 -0
- package/src/runtime-home/bootstrap.ts +6 -0
- package/src/runtime-home/dashboard-migrations.ts +101 -0
- package/src/runtime-home/files.ts +5 -5
- package/src/runtime-home/index.ts +1 -0
- package/src/runtime-home/schemas.ts +7 -4
- package/src/server/routes/github.ts +141 -30
- package/src/server/routes/reviews.ts +45 -1
- package/src/skills/neon-pr-review/SKILL.md +1 -1
- package/src/skills/neondeck/SKILL.md +1 -1
- package/web/dist/assets/GitHubPrReview-CybXdsHd.js +3 -0
- package/web/dist/assets/{MultiFileView-Ct2tUq4T.js → MultiFileView-BRXAY80r.js} +7 -7
- package/web/dist/assets/PrReviewPopoutPage-BAlIvAZL.js +1 -0
- package/web/dist/assets/index-D1VwAK0m.css +2 -0
- package/web/dist/assets/index-DLt_8zyR.js +44 -0
- package/web/dist/assets/{surfaces-CK-wQGjJ.js → surfaces-i0d1kpFn.js} +1 -1
- package/web/dist/index.html +2 -2
- package/dist/assets/app-kQMyZcgk.js.map +0 -1
- package/dist/assets/autopilot-BB7mZq1T.js.map +0 -1
- package/dist/assets/briefing-LON1W671.js +0 -2
- package/dist/assets/command-run-BIByV1D4.js +0 -2
- package/dist/assets/fix-pr-ci-Dqn8RwHg.js +0 -2
- package/dist/assets/pr-reviews-D1kgrd3B.js.map +0 -1
- package/dist/assets/review-pr-for-human-C25YX93Q.js.map +0 -1
- package/dist/assets/safety-Bjw5dbyq.js.map +0 -1
- package/web/dist/assets/GitHubPrReview-Dg9eIH1f.js +0 -2
- package/web/dist/assets/index-BATSzvO9.js +0 -44
- package/web/dist/assets/index-CtNuydm9.css +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#118](https://github.com/pandemicsyn/neondeck/pull/118) [`df66b2c`](https://github.com/pandemicsyn/neondeck/commit/df66b2c3b4e1dc75a97534cdc0db99396245062f) Thanks [@pandemicsyn](https://github.com/pandemicsyn)! - Keep ready dashboard notifications visible for one hour by default and allow configuring them to remain until dismissed.
|
|
8
|
+
|
|
9
|
+
- [#115](https://github.com/pandemicsyn/neondeck/pull/115) [`1e692f4`](https://github.com/pandemicsyn/neondeck/commit/1e692f44819715e102135ef2bd896c208786d310) Thanks [@pandemicsyn](https://github.com/pandemicsyn)! - Correct PR branch freshness findings, replace stale Neon-generated review artifacts on re-review while preserving human edits, and speed up the focused review pop-out loading path.
|
|
10
|
+
|
|
11
|
+
- [#116](https://github.com/pandemicsyn/neondeck/pull/116) [`8c972c0`](https://github.com/pandemicsyn/neondeck/commit/8c972c0e1898b5e0462d59d69badfc4e08f87dba) Thanks [@pandemicsyn](https://github.com/pandemicsyn)! - Complete the PR review workbench with in-dashboard artifacts, explicit finding anchors, manual report-only anchoring, workbench-started Neon reviews, reliable behind detection, and reserved whole-review submission.
|
|
12
|
+
|
|
13
|
+
- [#117](https://github.com/pandemicsyn/neondeck/pull/117) [`fc0618d`](https://github.com/pandemicsyn/neondeck/commit/fc0618dc456c67aa5362baf772ef2499a95d55ad) Thanks [@pandemicsyn](https://github.com/pandemicsyn)! - Add the Reviews tab once to existing dashboard work regions while preserving the configured default tab and respecting later user removal.
|
|
14
|
+
|
|
3
15
|
## 1.0.0-beta.8
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/config/dashboard.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./dashboard.schema.json",
|
|
3
|
+
"schemaVersion": 1,
|
|
3
4
|
"display": {
|
|
4
5
|
"preset": "xeneon-edge",
|
|
5
6
|
"width": 2560,
|
|
@@ -13,7 +14,7 @@
|
|
|
13
14
|
"toasts": {
|
|
14
15
|
"enabled": true,
|
|
15
16
|
"minimumLevel": "ready",
|
|
16
|
-
"readyDurationMs":
|
|
17
|
+
"readyDurationMs": 3600000,
|
|
17
18
|
"maxVisible": 3
|
|
18
19
|
}
|
|
19
20
|
},
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
"title": "Neondeck dashboard config",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": true,
|
|
7
|
-
"required": ["display", "theme", "layout"],
|
|
7
|
+
"required": ["schemaVersion", "display", "theme", "layout"],
|
|
8
8
|
"properties": {
|
|
9
9
|
"$schema": {
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"type": "integer",
|
|
14
|
+
"minimum": 1,
|
|
15
|
+
"description": "Version marker for one-time dashboard layout migrations."
|
|
16
|
+
},
|
|
12
17
|
"display": {
|
|
13
18
|
"type": "object",
|
|
14
19
|
"additionalProperties": false,
|
|
@@ -66,8 +71,8 @@
|
|
|
66
71
|
},
|
|
67
72
|
"readyDurationMs": {
|
|
68
73
|
"type": "integer",
|
|
69
|
-
"default":
|
|
70
|
-
"description": "Automatically dismiss ready toasts after this many milliseconds.
|
|
74
|
+
"default": 3600000,
|
|
75
|
+
"description": "Automatically dismiss ready toasts after this many milliseconds. Use 0 to keep them until dismissed. Nonzero values are clamped from 1000 through 86400000."
|
|
71
76
|
},
|
|
72
77
|
"maxVisible": {
|
|
73
78
|
"type": "integer",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as readLearningOperatorState, $i as
|
|
2
|
-
import { a as readBriefingState, c as settleBriefingObservation, i as readBriefingRunDetails, l as updateBriefingProfile, o as rotateBriefingSession, r as linkBriefingWorkflowObservation, s as runBriefingNow } from "./briefings-
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as runSchedulerTick, c as rollbackQuietly, d as supportedCommands, n as readSafetyPolicy, o as isSqliteBusy, s as readMetadataValue } from "./safety-
|
|
5
|
-
import { a as review_conversation_for_learning_default, r as review_pr_batch_for_learning_default, s as curate_learning_store_default, t as scheduler_tick_default } from "./scheduler-tick-
|
|
1
|
+
import { $ as readLearningOperatorState, $a as okAction, $i as readRepoHealthSnapshot, $n as runApprovedExecution, $r as listMcpAudit, $t as getGitHubPrFiles, A as readReport, Aa as subscribeNotificationEvents, Ai as listChatSessionCommandEvents, An as createBriefingTask, At as reviewKiloResult, Bt as readRepoFile, Ca as listWorkflowSummaries, Ci as readChatSession, Cn as setPrWatchPolling, Cr as bearerToken, D as fixPrReviewFeedback, Da as markNotificationRead, Di as createChatSession, Dr as readLocalApiToken, E as commentPrAutofixResult, Ea as listNotifications, Ei as archiveChatSession, Er as localApiTokenQueryParam, Fa as isRegisteredProvider, Fi as updateChatSessionCommandEvent, Fr as reloadRuntimeSkills, Ga as ConfigValidationError, Gi as listMemoryEvents, Gn as settleScheduledTaskWorkflowRun, Gr as logoutMcpOAuthServer, Gt as pushPrAutofix, Ha as ensureRuntimeHomeSync, Hi as listMemoryCandidates, Hr as getMcpRegistry, Ht as searchRepoFiles, I as recordConversationTurnAndMaybeQueueLearning, Ia as providerRuntimeRegistrations, Ii as formatChatSessionServerSentEvent, J as rejectSkillPatchCandidate, Ja as runtimePaths, Ji as formatConfigServerSentEvent, Jn as preparePrWorktree, Jr as addMcpServer, Jt as deleteGitHubPrReviewDraft, K as applySkillPatchCandidate, Ka as parseAppConfig, Ki as upsertMemory, Kr as readPublicMcpOAuthLogin, L as recordHandledPrFromWorkflowResult, La as readProviderConfigSync, Lt as patchRepoFiles, Ma as parseInput, Mi as renameChatSession, Mn as readTaskRecord, Mr as readRuntimeStatus, Mt as recordDocsDriftFixTaskBoundary, Ni as restoreChatSession, Nn as removeTask, Nr as listRuntimeSkills, Oa as resolveNotification, Oi as createChatSessionCommandEvent, Ot as listKiloResultStates, Pa as installFlueExecutionContextTracker, Pi as switchChatSession, Pn as setTaskEnabled, Pr as loadRuntimeSkill, Pt as fixPrCiFailure, Qa as invalidInputAction, Qr as listMcpApprovals, Qt as getGitHubPrFileDiff, Ra as loadNeondeckEnv, Ri as subscribeChatSessionEvents, Rt as readRepoCheckoutStatus, Sa as addWorkflowSummary, Si as listChatSessions, Sn as removePrWatch, Sr as readHostMetrics, St as searchKiloSessions, T as approvePreparedDiffPushWithPolicy, Ta as addNotification, Ti as searchChatSessions, Tr as localApiTokenMatches, Ua as readRuntimeJson, Ui as archiveMemory, Ut as writeRepoFile, Va as ensureRuntimeHome, Vi as decideMemoryCandidate, Vt as replaceRepoFile, Wi as listMemories, Wr as completeMcpOAuthCallback, Wt as listRepoEditEvents, Xa as asJsonValue, Xi as subscribeConfigEvents, Xr as setMcpServerEnabled, Xt as getGitHubPrBranchPermissions, Y as restoreSkillPatchCandidate, Yi as replayConfigEventsAfter, Yn as verifyPrWorktree, Yr as removeMcpServer, Yt as deleteGitHubPrReviewDraftComment, Za as failedAction, Zn as syncExeDevCheckout, Zr as updateMcpServer, Zt as getGitHubPrEventState, _a as readPreparedDiffFileDiff, _n as addPrWatch, _r as triagePrEvent, _t as readKiloSession, aa as cleanupWorktrees, ai as listGitHubPrQueue, an as postGitHubPrComment, ba as runPreparedDiffVerification, bi as referenceChatSession, bn as listPrWatches, bt as readKiloSessionMessages, c as abandonPreparedDiffWithRevisionAbort, ca as readWorktreeStatus, cn as postGitHubPrThreadReply, cr as updateRepoAutopilotPolicy, d as failAutopilotAdmission, dn as refreshPrWatchEventState, dr as updateAgentModels, dt as readKiloTaskDiff, ea as readRepoRegistrySnapshot, ei as resolveMcpApprovalWithPaths, en as getGitHubPrRequestedChanges, eo as __commonJSMin, er as listExecutionApprovals, et as readWorkflowObservability, f as recordAutopilotAdmissionRun, fr as updateWorktreePolicy, ft as readKiloTaskEvents, ga as readPreparedDiffChangedFiles, gr as reloadConfig, h as settleAutopilotAdmissionTriage, hr as updateDashboardLayout, ht as startKiloTask, i as runAutopilotRecoveryAction, ia as listWorktrees, in as patchGitHubPrReviewDraftComment, it as listLearningReviews, j as readReportHtml, ja as nonEmptyStringSchema, ji as pinChatSession, jn as listTaskRecords, jt as verifyKiloResult, k as listReports, ka as formatNotificationServerSentEvent, ki as linkChatSessionContext, kn as createAgentInstructionTask, kt as promoteKiloResult, l as runPreparedDiffRevision, la as releaseWorktreeLock, ln as postGitHubPrThreadResolution, lr as readProviderConfig, lt as abortKiloTask, m as settleAutopilotAdmissionPrepare, ma as openPreparedDiffWorktree, mr as applyDashboardPreset, mt as readKiloTaskStatus, nn as getGitHubPrReviewThreads, no as __require, nr as resolveExecutionApproval, nt as loadAutomationLearningMemoryContext, o as readAutopilotState, oa as createWorktree, on as postGitHubPrReview, or as readExecutionPolicy, p as recordAutopilotAdmissionTerminalFact, pa as listPreparedDiffs, pr as updateExecutionPolicy, pt as readKiloTaskSessions, q as listSkillPatchCandidates, qa as parseDashboardConfig, qi as readNeonSessionState, qr as startMcpOAuthLogin, r as readAutopilotRecoveryOptions, ri as getGitHubPullRequest, rn as listPrWatchEventWatermarks, rr as checkExecutionPolicy, rt as attachLearningReviewRunId, s as autopilotStateSchema, sa as lockWorktree, sn as postGitHubPrReviewDraftComment, ta as repoFullName, tn as getGitHubPrReviewDraft, tr as requestExecutionApproval, tt as recordFlueObservation, u as beginAutopilotAdmissionPrepare, ua as syncWorktree, un as putGitHubPrReviewDraft, ur as updateProviderConfig, ut as listKiloTasks, va as readPreparedDiffSummary, vi as listChatSessionActivity, vn as addRefWatch, vt as readKiloSessionChildren, wa as setWorkflowSummaryRunId, wi as readChatSessionMessages, wn as resolvePrReference, wr as localApiAuthHeader, xa as readApprovalRecord, xi as refreshChatSessionSummary, xn as listRefWatches, xt as readUnavailableSessionAdapter, ya as requestPreparedDiffRevision, yt as readKiloSessionDiff, zt as readRepoDiff } from "./autopilot-CMaU1iZd.js";
|
|
2
|
+
import { a as readBriefingState, c as settleBriefingObservation, i as readBriefingRunDetails, l as updateBriefingProfile, o as rotateBriefingSession, r as linkBriefingWorkflowObservation, s as runBriefingNow } from "./briefings-DtOcw7y6.js";
|
|
3
|
+
import { a as recentPrReviews, c as reservePrReviewSubmission, d as readPrReview, f as readPrReviewForTarget, i as failPrReview, l as startPrReview, m as subscribePrReviewEvents, n as beginPrReviewSubmissionAttempt, o as reconcilePrReviewSubmission, p as formatPrReviewServerSentEvent, s as releasePrReviewSubmission, t as attachPrReviewAttemptRun, u as submitPrReview } from "./pr-reviews-CbYcf9Mj.js";
|
|
4
|
+
import { a as runSchedulerTick, c as rollbackQuietly, d as supportedCommands, n as readSafetyPolicy, o as isSqliteBusy, s as readMetadataValue } from "./safety-S_Ek3ETH.js";
|
|
5
|
+
import { a as review_conversation_for_learning_default, r as review_pr_batch_for_learning_default, s as curate_learning_store_default, t as scheduler_tick_default } from "./scheduler-tick-DO_6nnY9.js";
|
|
6
6
|
import { getRun, invoke, listRuns, observe, registerProvider } from "@flue/runtime";
|
|
7
7
|
import { createHash, randomUUID } from "node:crypto";
|
|
8
8
|
import * as v from "valibot";
|
|
@@ -578,7 +578,7 @@ async function startPrepareAfterTriage(event, paths) {
|
|
|
578
578
|
const admission = await beginAutopilotAdmissionPrepare({ triageRunId: event.runId }, paths);
|
|
579
579
|
if (!admission) return;
|
|
580
580
|
try {
|
|
581
|
-
const { runId } = await invoke((await import("./prepare-pr-worktree-
|
|
581
|
+
const { runId } = await invoke((await import("./prepare-pr-worktree-CwalJPIV.js")).default, { input: {
|
|
582
582
|
repoId: admission.repoId,
|
|
583
583
|
prNumber: admission.prNumber,
|
|
584
584
|
eventId: admission.eventFingerprint,
|
|
@@ -861,8 +861,8 @@ async function invokeWorkflowForRuntimeHome(paths, dispatch, invokeWorkflow) {
|
|
|
861
861
|
return invokeWorkflow(dispatch.workflow, dispatch.input);
|
|
862
862
|
}
|
|
863
863
|
async function invokeAutopilotWorkflow(workflow, input) {
|
|
864
|
-
if (workflow === "push-pr-autofix") return invokeWorkflow((await import("./push-pr-autofix-
|
|
865
|
-
return invokeWorkflow((await import("./verify-then-push-pr-autofix-
|
|
864
|
+
if (workflow === "push-pr-autofix") return invokeWorkflow((await import("./push-pr-autofix-DUXYeBds.js")).default, { input });
|
|
865
|
+
return invokeWorkflow((await import("./verify-then-push-pr-autofix-9Dzuwky_.js")).default, { input });
|
|
866
866
|
}
|
|
867
867
|
async function recordDispatchFailure(preparedDiff, mode, dispatch, approvalId, error, paths) {
|
|
868
868
|
await addWorkflowSummary({
|
|
@@ -1419,8 +1419,7 @@ function createGitHubRoutes(paths) {
|
|
|
1419
1419
|
routes.post("/prs/:owner/:repo/:number/reviews", async (c) => {
|
|
1420
1420
|
const target = prTargetFromParams(c.req.param("owner"), c.req.param("repo"), c.req.param("number"));
|
|
1421
1421
|
if (!target.ok) return c.json(target.result, 400);
|
|
1422
|
-
const
|
|
1423
|
-
const reviewInputObject = objectField$1(reviewInput);
|
|
1422
|
+
const reviewInputObject = objectField$1(await safeJsonBody(c));
|
|
1424
1423
|
const requestedHeadSha = typeof reviewInputObject.headSha === "string" ? reviewInputObject.headSha : null;
|
|
1425
1424
|
const durableReview = readPrReviewForTarget(target.input.repo, target.input.prNumber, paths);
|
|
1426
1425
|
if (durableReview && (durableReview.status !== "ready" || !requestedHeadSha || durableReview.headSha !== requestedHeadSha)) return c.json({
|
|
@@ -1430,30 +1429,88 @@ function createGitHubRoutes(paths) {
|
|
|
1430
1429
|
message: durableReview.status !== "ready" ? "The durable review must be ready before it can be submitted." : "The durable review does not match the pull request head being submitted.",
|
|
1431
1430
|
data: { reviewId: durableReview.id }
|
|
1432
1431
|
}, 409);
|
|
1433
|
-
const
|
|
1434
|
-
if (
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1432
|
+
const verdict = reviewInputObject.verdict;
|
|
1433
|
+
if (verdict !== "comment" && verdict !== "approve" && verdict !== "request-changes") return c.json({
|
|
1434
|
+
ok: false,
|
|
1435
|
+
action: "github_pr_review_post",
|
|
1436
|
+
changed: false,
|
|
1437
|
+
message: "A review verdict is required."
|
|
1438
|
+
}, 400);
|
|
1439
|
+
const reserved = durableReview ? reservePrReviewSubmission({
|
|
1440
|
+
repoFullName: target.input.repo,
|
|
1441
|
+
prNumber: target.input.prNumber,
|
|
1442
|
+
headSha: requestedHeadSha ?? "",
|
|
1443
|
+
verdict
|
|
1444
|
+
}, paths) : null;
|
|
1445
|
+
if (durableReview && !reserved) return c.json({
|
|
1446
|
+
ok: false,
|
|
1447
|
+
action: "github_pr_review_post",
|
|
1448
|
+
changed: false,
|
|
1449
|
+
message: "The durable review changed before submission could be reserved. Refresh and try again.",
|
|
1450
|
+
data: { reviewId: durableReview.id }
|
|
1451
|
+
}, 409);
|
|
1452
|
+
const releaseReservation = () => {
|
|
1453
|
+
if (reserved) releasePrReviewSubmission({
|
|
1454
|
+
reviewId: reserved.id,
|
|
1455
|
+
headSha: reserved.headSha
|
|
1456
|
+
}, paths);
|
|
1457
|
+
};
|
|
1458
|
+
const endSubmissionAttempt = reserved ? beginPrReviewSubmissionAttempt(reserved.id) : () => {};
|
|
1459
|
+
let githubAccepted = false;
|
|
1460
|
+
try {
|
|
1461
|
+
const savedDraftResult = await putGitHubPrReviewDraft(target.input, {
|
|
1462
|
+
headSha: requestedHeadSha ?? "",
|
|
1463
|
+
body: typeof reviewInputObject.body === "string" ? reviewInputObject.body : null,
|
|
1464
|
+
verdict,
|
|
1465
|
+
reanchorHeadSha: true
|
|
1466
|
+
}, paths);
|
|
1467
|
+
if (!savedDraftResult.ok) {
|
|
1468
|
+
releaseReservation();
|
|
1469
|
+
return c.json(savedDraftResult, 400);
|
|
1470
|
+
}
|
|
1471
|
+
const savedDraft = objectField$1(objectField$1(savedDraftResult.data).draft);
|
|
1472
|
+
if (typeof savedDraft.id !== "string") {
|
|
1473
|
+
releaseReservation();
|
|
1474
|
+
return c.json({
|
|
1448
1475
|
ok: false,
|
|
1449
1476
|
action: "github_pr_review_post",
|
|
1450
|
-
changed:
|
|
1451
|
-
message: "
|
|
1452
|
-
data: result.data
|
|
1477
|
+
changed: false,
|
|
1478
|
+
message: "Review draft could not be saved before submission."
|
|
1453
1479
|
}, 409);
|
|
1454
1480
|
}
|
|
1481
|
+
const result = await postGitHubPrReview(target.input, {
|
|
1482
|
+
draftId: savedDraft.id,
|
|
1483
|
+
headSha: requestedHeadSha ?? "",
|
|
1484
|
+
commentIds: Array.isArray(reviewInputObject.commentIds) ? reviewInputObject.commentIds.filter((id) => typeof id === "string") : void 0
|
|
1485
|
+
}, paths);
|
|
1486
|
+
if (!result.ok) {
|
|
1487
|
+
releaseReservation();
|
|
1488
|
+
return c.json(result, 400);
|
|
1489
|
+
}
|
|
1490
|
+
githubAccepted = true;
|
|
1491
|
+
const data = objectField$1(result.data);
|
|
1492
|
+
const draft = objectField$1(data.draft);
|
|
1493
|
+
const review = objectField$1(data.review);
|
|
1494
|
+
const submittedVerdict = prReviewVerdict(draft.verdict) ?? verdict;
|
|
1495
|
+
const submitted = reserved ? submitPrReview({
|
|
1496
|
+
reviewId: reserved.id,
|
|
1497
|
+
verdict: submittedVerdict,
|
|
1498
|
+
githubReviewUrl: typeof review.url === "string" ? review.url : null
|
|
1499
|
+
}, paths) : null;
|
|
1500
|
+
if (reserved && !submitted) return c.json({
|
|
1501
|
+
ok: false,
|
|
1502
|
+
action: "github_pr_review_post",
|
|
1503
|
+
changed: true,
|
|
1504
|
+
message: "GitHub accepted the review, but Neondeck could not settle its reserved durable review record.",
|
|
1505
|
+
data: result.data
|
|
1506
|
+
}, 409);
|
|
1507
|
+
return c.json(result, 200);
|
|
1508
|
+
} catch (error) {
|
|
1509
|
+
if (!githubAccepted) releaseReservation();
|
|
1510
|
+
throw error;
|
|
1511
|
+
} finally {
|
|
1512
|
+
endSubmissionAttempt();
|
|
1455
1513
|
}
|
|
1456
|
-
return c.json(result, result.ok ? 200 : 400);
|
|
1457
1514
|
});
|
|
1458
1515
|
routes.post("/prs/:owner/:repo/:number/review-threads/:threadId/reply", async (c) => {
|
|
1459
1516
|
const target = prTargetFromParams(c.req.param("owner"), c.req.param("repo"), c.req.param("number"));
|
|
@@ -1498,6 +1555,9 @@ function createGitHubRoutes(paths) {
|
|
|
1498
1555
|
function objectField$1(value) {
|
|
1499
1556
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
1500
1557
|
}
|
|
1558
|
+
function prReviewVerdict(value) {
|
|
1559
|
+
return value === "comment" || value === "approve" || value === "request-changes" ? value : null;
|
|
1560
|
+
}
|
|
1501
1561
|
function prTargetFromParams(owner, repo, numberText) {
|
|
1502
1562
|
const number = Number(numberText);
|
|
1503
1563
|
if (!Number.isInteger(number) || number <= 0) return {
|
|
@@ -1794,7 +1854,7 @@ async function externalReviewQueueAllowed(paths) {
|
|
|
1794
1854
|
}
|
|
1795
1855
|
async function invokeReviewPrWorkflow(input) {
|
|
1796
1856
|
const { invoke } = await import("@flue/runtime");
|
|
1797
|
-
return invoke((await import("./review-pr-for-human-
|
|
1857
|
+
return invoke((await import("./review-pr-for-human-CTIL0RRy.js")).default, { input });
|
|
1798
1858
|
}
|
|
1799
1859
|
async function addHandoffAudit(summary, paths, options = {}) {
|
|
1800
1860
|
return addWorkflowSummary({
|
|
@@ -3044,12 +3104,35 @@ function createReviewRoutes(paths) {
|
|
|
3044
3104
|
}, 400);
|
|
3045
3105
|
}
|
|
3046
3106
|
});
|
|
3107
|
+
routes.post("/reviews/:id/reconcile", async (c) => {
|
|
3108
|
+
try {
|
|
3109
|
+
const result = await reconcilePrReviewSubmission({ reviewId: c.req.param("id") }, paths);
|
|
3110
|
+
const message = result.outcome === "submitted" ? "Recovered the submitted review from GitHub." : result.outcome === "ready" ? "GitHub has no matching review; the local draft is ready to submit again." : result.outcome === "pending" ? "GitHub has not reported the review yet. Wait a moment, then check again." : `The review is already ${result.review.status}.`;
|
|
3111
|
+
return c.json({
|
|
3112
|
+
ok: true,
|
|
3113
|
+
action: "pr_review_submission_reconcile",
|
|
3114
|
+
changed: result.outcome === "submitted" || result.outcome === "ready",
|
|
3115
|
+
message,
|
|
3116
|
+
review: result.review,
|
|
3117
|
+
reviewId: result.review.id,
|
|
3118
|
+
runId: result.review.runId ?? ""
|
|
3119
|
+
}, result.outcome === "pending" ? 202 : 200);
|
|
3120
|
+
} catch (error) {
|
|
3121
|
+
const message = errorMessage$1(error);
|
|
3122
|
+
return c.json({
|
|
3123
|
+
ok: false,
|
|
3124
|
+
action: "pr_review_submission_reconcile",
|
|
3125
|
+
changed: false,
|
|
3126
|
+
message
|
|
3127
|
+
}, message === "GITHUB_TOKEN is not configured." ? 503 : 502);
|
|
3128
|
+
}
|
|
3129
|
+
});
|
|
3047
3130
|
return routes;
|
|
3048
3131
|
}
|
|
3049
3132
|
function groupReviews(reviews, awaiting) {
|
|
3050
3133
|
return {
|
|
3051
3134
|
awaiting,
|
|
3052
|
-
inProgress: reviews.filter((review) => review.status === "reviewing"),
|
|
3135
|
+
inProgress: reviews.filter((review) => review.status === "reviewing" || review.status === "submitting"),
|
|
3053
3136
|
needsAction: reviews.filter((review) => review.status === "ready" || review.status === "failed"),
|
|
3054
3137
|
submitted: reviews.filter((review) => review.status === "submitted")
|
|
3055
3138
|
};
|
|
@@ -3889,4 +3972,4 @@ var app_default = await createApp();
|
|
|
3889
3972
|
//#endregion
|
|
3890
3973
|
export { app_default as default };
|
|
3891
3974
|
|
|
3892
|
-
//# sourceMappingURL=app-
|
|
3975
|
+
//# sourceMappingURL=app-ChpCY1hX.js.map
|