prreviewbuddy 0.76.9 → 0.77.1

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 CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.77.1
4
+
5
+ **Add review's options match the rest of the workspace.** The Agent menu draws the workspace's own
6
+ caret instead of the browser's, and Agent, Model and Base are sized as Settings sizes its fields,
7
+ up to 320px, instead of stretching across the dialog. The help under Model keeps the full width.
8
+
9
+ ## 0.77.0
10
+
11
+ **Add review shows what it started, and asks the base question as a question.** Once reviews
12
+ start, the ⌘P panel replaces its form with one row per review: Queued, Analysing, Ready or
13
+ Failed, with "1 of 3 reviews ready" above them. Each row links to its review once it exists. A
14
+ failed row says why, keeps the full text under Technical details, and has Retry, which runs it again
15
+ in the same batch with the same folder, agent, model and base, against the commits it was first
16
+ resolved to: a branch or pull request that has moved since is a fresh review's business, not a
17
+ retry's. When those commits are gone, the row says so and offers Start fresh review instead. Retry
18
+ stays available for as long as the panel is open. A pull request or branch whose review is already
19
+ being analysed elsewhere shows as Analysing and is followed to its end, never run a second time. The panel no longer closes on its
20
+ own, branch reviews included. Closing it still stops nothing. If the workspace server restarts
21
+ while it is open, rows that had started say Started and queued ones say Not started; neither is
22
+ counted as failed.
23
+
24
+ When a folder's `main` is a local branch and a remote branch at different commits, the Branch panel
25
+ now shows Choose a base branch with both options and how many commits each would review. Nothing is
26
+ chosen for you, and the choice lasts only for that panel. This replaces the terminal's refusal text,
27
+ which named a command to run. Agent and model refusals appear beside those fields, and
28
+ "How do I find model names?" shows the chosen agent's own way of listing its models.
29
+
3
30
  ## 0.76.9
4
31
 
5
32
  **Extension 0.29.3: the update toast counts the findings to look at again.** An update whose only
@@ -16705,6 +16705,54 @@ async function settleReview(workspaceId, reviewType = "standard", signal) {
16705
16705
  job
16706
16706
  };
16707
16707
  }
16708
+ var realReads = {
16709
+ job: (workspaceId) => {
16710
+ const jobId = loadWorkspace(workspaceId)?.jobId;
16711
+ return jobId ? loadJob(jobId) : null;
16712
+ },
16713
+ hasResult: (workspaceId) => Boolean(loadWorkspace(workspaceId)?.session?.result),
16714
+ driverGone,
16715
+ wait: (ms) => new Promise((resolve) => setTimeout(resolve, ms))
16716
+ };
16717
+ /**
16718
+ * Wait for a review that something else is analysing, and say how it ended, running nothing.
16719
+ *
16720
+ * `settleReview` is the wrong tool for a review already in progress: it drives the job, and a
16721
+ * second driver on a running job is the duplicate analysis this exists to avoid. This only reads
16722
+ * the job record until it ends, with the same outcomes `settleReview` reports. A driver that went
16723
+ * away mid-run ends the wait too, as a failure, rather than leaving it to the sweep half an hour on.
16724
+ */
16725
+ async function observeReview(workspaceId, reads = realReads, everyMs = 2e3) {
16726
+ for (;;) {
16727
+ const job = reads.job(workspaceId);
16728
+ if (!job) return {
16729
+ ok: false,
16730
+ reason: "The review’s analysis record could not be read.",
16731
+ stopped: false
16732
+ };
16733
+ if (isTerminal(job)) {
16734
+ if (job.phase !== "done") return {
16735
+ ok: false,
16736
+ reason: failureMessage(job),
16737
+ stopped: job.failure?.stopped === true
16738
+ };
16739
+ return reads.hasResult(workspaceId) ? {
16740
+ ok: true,
16741
+ job
16742
+ } : {
16743
+ ok: false,
16744
+ reason: "The analysis finished without recording a review.",
16745
+ stopped: false
16746
+ };
16747
+ }
16748
+ if (reads.driverGone(job.id)) return {
16749
+ ok: false,
16750
+ reason: `The analysis stopped: ${DRIVER_GONE}`,
16751
+ stopped: false
16752
+ };
16753
+ await reads.wait(everyMs);
16754
+ }
16755
+ }
16708
16756
  /**
16709
16757
  * Why a run ended, when it did not end by finishing.
16710
16758
  *
@@ -19413,4 +19461,4 @@ function lineageIds(id) {
19413
19461
  return [.../* @__PURE__ */ new Set([id, ...lineage.map((review) => review.id)])];
19414
19462
  }
19415
19463
  //#endregion
19416
- export { resolveWorkspacePort as $, PHASES as $n, explanationOf as $r, readNotification as $t, parsePullRequestLink as A, readAgentPreference as Ai, MANAGED_ROOT as An, activityLabel as Ar, storeArchitecture as At, ensureServer as B, checkCodeFreshness as Bn, queueRemove as Br, branchOf as Bt, completeRun as C, DetachedHeadError as Ci, renderMarkdown as Cn, reviewedRepositories as Cr, describeRuntimes as Ct, relativeTime as D, resolveAgent as Di, renderInlineText as Dn, workspaceStamps as Dr, partFiles as Dt, stopRun as E, git as Ei, escapeHtml as En, workspaceRevision as Er, loadArchitecture as Et, queueForReview as F, agentById as Fi, removeWorktree as Fn, offersLifecycle as Fr, REPOSITORY_SCOPE as Ft, stopChild as G, forgeResolver as Gn, isQuestionOutstanding as Gr, createPrUpdate as Gt, reviewsUrl as H, followedBranch as Hn, readQueue as Hr, categoryOf as Ht, settleQueue as I, agentFor as Ii, requestJobStop as In, parseLifecycle as Ir, ancestorsOf as It, writeServerRecord as J, endedAt as Jn, resolvedByConversation as Jr, markAllRead as Jt, stopServer as K, fillFileUrlTemplate as Kn, issuesOutstanding as Kr, eventName as Kt, readIndexToken as L, detectAgents as Li, describeMovement as Ln, sectionOf as Lr, isArchitectureId as Lt, runBatch as M, CONFIG_PATH as Mi, holdWorktree as Mn, lifecycleChip as Mr, trackedFiles as Mt, activateQueued as N, STORE_ROOT as Ni, isWorktreeHeld as Nn, lifecycleItemLabel as Nr, ownersOf as Nt, batchIdentity as O, resolveModel as Oi, modelHelpLines as On, LIFECYCLES as Or, readArchitecture as Ot, compactQueue as P, AGENT_IDS as Pi, readMarker as Pn, lifecyclePill as Pr, QUOTE_LIMITS as Pt, parseWorkspacePort as Q, saveJob as Qn, explanationActionOf as Qr, pruneNotifications as Qt, bootstrapUrl as R, AgentCancelledError as Ri, describeSubject as Rn, queueAdd as Rr, writeJsonAtomically as Rt, beginRun as S, originRemote as Si, GITHUB_MARKDOWN as Sn, reviewedCommit as Sr, RUNTIME_WORDS as St, reportRun as T, resolveBase as Ti, CODE_COPY_CLASS as Tn, touchWorkspace as Tr, checkArchitecture as Tt, serverEntryExists as U, reviewedShaOf as Un, doneVerb as Ur, createArchitectureNotification as Ut, readServerRecord as V, checkReview as Vn, queueStamp as Vr, subjectOf as Vt, spawnServer as W, fetchHead as Wn, isIssueOutstanding as Wr, createPrState as Wt, MAX_WORKSPACE_PORT as X, isTerminal as Xn, processDiscussion as Xr, markReadForReview as Xt, DEFAULT_WORKSPACE_PORT as Y, fail as Yn, reviewerDispositions as Yr, markRead as Yt, MIN_WORKSPACE_PORT as Z, loadJob as Zn, recommendationsOf as Zr, moveIds as Zt, recordKissRun as _, objectWithAnyOf as _i, EXPLAIN_SIMPLY_PROMPT as _n, mutateWorkspace as _r, PACKAGE_NAME as _t, wasBlocked as a, currentGradeIn as ai, unreadCount as an, isClaimed as ar, reanalyseReview as at, track as b, kissOutcome as bi, authorPreview as bn, previousKissResult as br, mapRuntimes as bt, RefreshUnavailableError as c, gradeScale as ci, ASK_REREAD_CEILING_MS as cn, groupByLineage as cr, append as ct, mergeUpdateInto as d, reassessIn as di, saveRefresh as dn, kissDecisionRefusal as dr, stamp as dt, isExplanationAction as ei, readStateOf as en, isLiveJob as er, statedWorkspacePort as et, updateReview as f, sourcePhrase as fi, storedConversation as fn, kissDecisionsOf as fr, deliver as ft, runningJobs as g, extractJsonText as gi, agentEnvOf as gn, matchingWorkspaceIds as gr, BUILD_VERSION as gt, liveUpdateFor as h, asString$1 as hi, isUnchanged as hn, loadWorkspace as hr, telemetryUploadEnabled as ht, liveJobsFor as i, assessmentLookup as ii, unreadAround as in, clearClaim as ir, settleReview as it, unsupportedReason as j, writeAgentPreference as ji, createWorktree as jn, isLifecycle as jr, storedScopes as jt, extractPullRequestLinks as k, clearAgentPreference as ki, ReviewBeingDeletedError as kn, activityAttributes as kr, repositoryKey as kt, cancelUpdate as l, isGradeFor as li, adoptLegacyBaseline as ln, indexKeptIds as lr, readEvents as lt, UpdateAlreadyRunningError as m, followUpFindingId as mi, refreshPrContext as mn, lineagePosition as mr, telemetryUploadConsent as mt, deleteReview as n, ANALYSIS_ONLY as ni, retireNotification as nn, progressSteps as nr, failureOf as nt, discardJob as o, findingAssessment as oi, withUsageRecorded as on, decideKissRecommendation as or, runJob as ot, askCheckout as p, wasReassessed as pi, unforeseenFailure as pn, latestKissRun as pr, recordTelemetryUploadConsent as pt, workspaceUrl as q, allJobs as qn, questionsOutstanding as qr, listNotifications as qt, lineageIds as r, analysisRefOf as ri, toneOf as rn, purposeOf as rr, prepareReview as rt, FETCH_TIMEOUT_MS as s, findingIn as si, existingPaths as sn, followedRefName as sr, startJob as st, deleteLineage as t, withExplanation as ti, removeNotification as tn, phasesFor as tr, writePortPreference as tt, cancellableHere as u, promptGrade as ui, prepareConversationWithin as un, indexReviewGroups as ur, record as ut, startKissJob as v, describeAuthorship as vi, chatConversationSection as vn, positionInLineage as vr, feedbackUrl as vt, endRun as w, isCommitReview as wi, CODE_BLOCK_CLASS as wn, summarise as wr, ARCHITECTURE_DIR as wt, RUN_KINDS as x, resolveTarget as xi, hasAuthorContent as xn, recentWorkspaces as xr, recordRuntimeBestEffort as xt, isDriving as y, WITHHELD_REASON as yi, UNESTABLISHED_MOTIVATION as yn, presentedKissRunOf as yr, waitingHistory as yt, clearServerRecordOwnedBy as z, AgentUnavailableError as zi, findExistingReview as zn, queueAddMany as zr, announceJob as zt };
19464
+ export { resolveWorkspacePort as $, saveJob as $n, explanationActionOf as $r, pruneNotifications as $t, parsePullRequestLink as A, git as Ai, ReviewBeingDeletedError as An, activityAttributes as Ar, repositoryKey as At, ensureServer as B, agentById as Bi, findExistingReview as Bn, queueAddMany as Br, announceJob as Bt, completeRun as C, originRemote as Ci, GITHUB_MARKDOWN as Cn, reviewedCommit as Cr, RUNTIME_WORDS as Ct, relativeTime as D, AmbiguousRefError as Di, escapeHtml as Dn, workspaceRevision as Dr, loadArchitecture as Dt, stopRun as E, resolveBase as Ei, CODE_COPY_CLASS as En, touchWorkspace as Er, checkArchitecture as Et, queueForReview as F, readAgentPreference as Fi, readMarker as Fn, lifecyclePill as Fr, QUOTE_LIMITS as Ft, stopChild as G, fetchHead as Gn, isIssueOutstanding as Gr, createPrState as Gt, reviewsUrl as H, detectAgents as Hi, checkReview as Hn, queueStamp as Hr, subjectOf as Ht, settleQueue as I, writeAgentPreference as Ii, removeWorktree as In, offersLifecycle as Ir, REPOSITORY_SCOPE as It, writeServerRecord as J, allJobs as Jn, questionsOutstanding as Jr, listNotifications as Jt, stopServer as K, forgeResolver as Kn, isQuestionOutstanding as Kr, createPrUpdate as Kt, readIndexToken as L, CONFIG_PATH as Li, requestJobStop as Ln, parseLifecycle as Lr, ancestorsOf as Lt, runBatch as M, resolveAgent as Mi, createWorktree as Mn, isLifecycle as Mr, storedScopes as Mt, activateQueued as N, resolveModel as Ni, holdWorktree as Nn, lifecycleChip as Nr, trackedFiles as Nt, batchIdentity as O, shortNameOf as Oi, renderInlineText as On, workspaceStamps as Or, partFiles as Ot, compactQueue as P, clearAgentPreference as Pi, isWorktreeHeld as Pn, lifecycleItemLabel as Pr, ownersOf as Pt, parseWorkspacePort as Q, loadJob as Qn, recommendationsOf as Qr, moveIds as Qt, bootstrapUrl as R, STORE_ROOT as Ri, describeMovement as Rn, sectionOf as Rr, isArchitectureId as Rt, beginRun as S, resolveTarget as Si, hasAuthorContent as Sn, recentWorkspaces as Sr, recordRuntimeBestEffort as St, reportRun as T, isCommitReview as Ti, CODE_BLOCK_CLASS as Tn, summarise as Tr, ARCHITECTURE_DIR as Tt, serverEntryExists as U, AgentCancelledError as Ui, followedBranch as Un, readQueue as Ur, categoryOf as Ut, readServerRecord as V, agentFor as Vi, checkCodeFreshness as Vn, queueRemove as Vr, branchOf as Vt, spawnServer as W, AgentUnavailableError as Wi, reviewedShaOf as Wn, doneVerb as Wr, createArchitectureNotification as Wt, MAX_WORKSPACE_PORT as X, fail as Xn, reviewerDispositions as Xr, markRead as Xt, DEFAULT_WORKSPACE_PORT as Y, endedAt as Yn, resolvedByConversation as Yr, markAllRead as Yt, MIN_WORKSPACE_PORT as Z, isTerminal as Zn, processDiscussion as Zr, markReadForReview as Zt, recordKissRun as _, extractJsonText as _i, agentEnvOf as _n, matchingWorkspaceIds as _r, BUILD_VERSION as _t, wasBlocked as a, assessmentLookup as ai, unreadAround as an, clearClaim as ar, settleReview as at, track as b, WITHHELD_REASON as bi, UNESTABLISHED_MOTIVATION as bn, presentedKissRunOf as br, waitingHistory as bt, RefreshUnavailableError as c, findingIn as ci, existingPaths as cn, followedRefName as cr, startJob as ct, mergeUpdateInto as d, promptGrade as di, prepareConversationWithin as dn, indexReviewGroups as dr, record as dt, explanationOf as ei, readNotification as en, PHASES as er, statedWorkspacePort as et, updateReview as f, reassessIn as fi, saveRefresh as fn, kissDecisionRefusal as fr, stamp as ft, runningJobs as g, asString$1 as gi, isUnchanged as gn, loadWorkspace as gr, telemetryUploadEnabled as gt, liveUpdateFor as h, followUpFindingId as hi, refreshPrContext as hn, lineagePosition as hr, telemetryUploadConsent as ht, liveJobsFor as i, analysisRefOf as ii, toneOf as in, purposeOf as ir, prepareReview as it, unsupportedReason as j, refExists as ji, MANAGED_ROOT as jn, activityLabel as jr, storeArchitecture as jt, extractPullRequestLinks as k, shorthandOf as ki, modelHelpLines as kn, LIFECYCLES as kr, readArchitecture as kt, cancelUpdate as l, gradeScale as li, ASK_REREAD_CEILING_MS as ln, groupByLineage as lr, append as lt, UpdateAlreadyRunningError as m, wasReassessed as mi, unforeseenFailure as mn, latestKissRun as mr, recordTelemetryUploadConsent as mt, deleteReview as n, withExplanation as ni, removeNotification as nn, phasesFor as nr, failureOf as nt, discardJob as o, currentGradeIn as oi, unreadCount as on, isClaimed as or, reanalyseReview as ot, askCheckout as p, sourcePhrase as pi, storedConversation as pn, kissDecisionsOf as pr, deliver as pt, workspaceUrl as q, fillFileUrlTemplate as qn, issuesOutstanding as qr, eventName as qt, lineageIds as r, ANALYSIS_ONLY as ri, retireNotification as rn, progressSteps as rr, observeReview as rt, FETCH_TIMEOUT_MS as s, findingAssessment as si, withUsageRecorded as sn, decideKissRecommendation as sr, runJob as st, deleteLineage as t, isExplanationAction as ti, readStateOf as tn, isLiveJob as tr, writePortPreference as tt, cancellableHere as u, isGradeFor as ui, adoptLegacyBaseline as un, indexKeptIds as ur, readEvents as ut, startKissJob as v, objectWithAnyOf as vi, EXPLAIN_SIMPLY_PROMPT as vn, mutateWorkspace as vr, PACKAGE_NAME as vt, endRun as w, DetachedHeadError as wi, renderMarkdown as wn, reviewedRepositories as wr, describeRuntimes as wt, RUN_KINDS as x, kissOutcome as xi, authorPreview as xn, previousKissResult as xr, mapRuntimes as xt, isDriving as y, describeAuthorship as yi, chatConversationSection as yn, positionInLineage as yr, feedbackUrl as yt, clearServerRecordOwnedBy as z, AGENT_IDS as zi, describeSubject as zn, queueAdd as zr, writeJsonAtomically as zt };
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $n as PHASES, Ai as readAgentPreference, An as MANAGED_ROOT, B as ensureServer, Cr as reviewedRepositories, D as relativeTime, Di as resolveAgent, Ei as git, F as queueForReview, Fi as agentById, Fn as removeWorktree, Gn as forgeResolver, H as reviewsUrl, K as stopServer, L as readIndexToken, Li as detectAgents, Ln as describeMovement, M as runBatch, Mi as CONFIG_PATH, Ni as STORE_ROOT, O as batchIdentity, Oi as resolveModel, On as modelHelpLines, Pi as AGENT_IDS, Pn as readMarker, Q as parseWorkspacePort, R as bootstrapUrl, Rn as describeSubject, X as MAX_WORKSPACE_PORT, Y as DEFAULT_WORKSPACE_PORT, Z as MIN_WORKSPACE_PORT, Zn as loadJob, _ as recordKissRun, _r as mutateWorkspace, _t as PACKAGE_NAME, a as wasBlocked, at as reanalyseReview, bi as kissOutcome, ct as append, d as mergeUpdateInto, dt as stamp, et as statedWorkspacePort, f as updateReview, ft as deliver, g as runningJobs, gr as matchingWorkspaceIds, gt as BUILD_VERSION, h as liveUpdateFor, hr as loadWorkspace, ht as telemetryUploadEnabled, i as liveJobsFor, ir as clearClaim, it as settleReview, ji as writeAgentPreference, m as UpdateAlreadyRunningError, mt as telemetryUploadConsent, n as deleteReview$1, nr as progressSteps, pt as recordTelemetryUploadConsent, q as workspaceUrl, qn as allJobs, rr as purposeOf, rt as prepareReview, sr as followedRefName, st as startJob, tt as writePortPreference, ut as record$1, vr as positionInLineage, wr as summarise, xi as resolveTarget, xr as recentWorkspaces, yi as WITHHELD_REASON, zn as findExistingReview } from "./delete_review-BX3lu5Q7.js";
2
+ import { Ai as git, B as ensureServer, Bi as agentById, Bn as findExistingReview, D as relativeTime, F as queueForReview, Fi as readAgentPreference, Fn as readMarker, H as reviewsUrl, Hi as detectAgents, Ii as writeAgentPreference, In as removeWorktree, Jn as allJobs, K as stopServer, Kn as forgeResolver, L as readIndexToken, Li as CONFIG_PATH, M as runBatch, Mi as resolveAgent, Ni as resolveModel, O as batchIdentity, Q as parseWorkspacePort, Qn as loadJob, R as bootstrapUrl, Ri as STORE_ROOT, Rn as describeMovement, Si as resolveTarget, Sr as recentWorkspaces, Tr as summarise, X as MAX_WORKSPACE_PORT, Y as DEFAULT_WORKSPACE_PORT, Z as MIN_WORKSPACE_PORT, _ as recordKissRun, _r as matchingWorkspaceIds, _t as BUILD_VERSION, a as wasBlocked, ar as clearClaim, at as settleReview, bi as WITHHELD_REASON, cr as followedRefName, ct as startJob, d as mergeUpdateInto, dt as record$1, er as PHASES, et as statedWorkspacePort, f as updateReview, ft as stamp, g as runningJobs, gr as loadWorkspace, gt as telemetryUploadEnabled, h as liveUpdateFor, ht as telemetryUploadConsent, i as liveJobsFor, ir as purposeOf, it as prepareReview, jn as MANAGED_ROOT, kn as modelHelpLines, lt as append, m as UpdateAlreadyRunningError, mt as recordTelemetryUploadConsent, n as deleteReview$1, ot as reanalyseReview, pt as deliver, q as workspaceUrl, rr as progressSteps, tt as writePortPreference, vr as mutateWorkspace, vt as PACKAGE_NAME, wr as reviewedRepositories, xi as kissOutcome, yr as positionInLineage, zi as AGENT_IDS, zn as describeSubject } from "./delete_review-BHOzMQ0_.js";
3
3
  import { basename, dirname, join, resolve } from "node:path";
4
4
  import { spawn } from "node:child_process";
5
5
  import { existsSync, mkdirSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";