@fullstackhouse/cerber 1.7.0 → 1.8.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.
Files changed (66) hide show
  1. package/README.md +3 -1
  2. package/dist/core/autoreview.js +5 -3
  3. package/dist/core/config.js +6 -0
  4. package/dist/core/gh.js +31 -4
  5. package/dist/server/daemon.js +46 -11
  6. package/dist/server/index.js +6 -1
  7. package/package.json +1 -1
  8. package/web/dist/assets/{abnfDiagram-WEYOIA3C-Fh0yGAPG.js → abnfDiagram-WEYOIA3C-Byu0V-va.js} +1 -1
  9. package/web/dist/assets/{arc-Cb1J4kng.js → arc-B2JkMPj1.js} +1 -1
  10. package/web/dist/assets/{architectureDiagram-ZHVYKT53-BwxCVhjO.js → architectureDiagram-ZHVYKT53-BhiToh5-.js} +1 -1
  11. package/web/dist/assets/{blockDiagram-RJAE7QA3-Czr1-oa6.js → blockDiagram-RJAE7QA3-Bpn7ABSU.js} +1 -1
  12. package/web/dist/assets/{c4Diagram-XDPPPE54-ZWephAkD.js → c4Diagram-XDPPPE54-BLicpimi.js} +1 -1
  13. package/web/dist/assets/channel-BzNthqrt.js +1 -0
  14. package/web/dist/assets/{chunk-2E7WHVMD-9Ra4B9GU.js → chunk-2E7WHVMD-CldzK0s1.js} +1 -1
  15. package/web/dist/assets/{chunk-2Q5K7J3B-B7nbgFC1.js → chunk-2Q5K7J3B-DLJFVpOe.js} +1 -1
  16. package/web/dist/assets/{chunk-4EMNKR2T-CUVvjeAx.js → chunk-4EMNKR2T-DhyrsCV6.js} +1 -1
  17. package/web/dist/assets/{chunk-55XCU76K-DZ3RW9-h.js → chunk-55XCU76K-DqkniNh0.js} +1 -1
  18. package/web/dist/assets/{chunk-5VM5RSS4-BY-uxMkf.js → chunk-5VM5RSS4-D490ZqBr.js} +1 -1
  19. package/web/dist/assets/{chunk-JWPE2WC7-BJYQI99_.js → chunk-JWPE2WC7-BF47y5tL.js} +1 -1
  20. package/web/dist/assets/{chunk-VQ5W62QI-Dm8jJYkz.js → chunk-VQ5W62QI-Ps3FOd8p.js} +1 -1
  21. package/web/dist/assets/{chunk-XXDRQBXY-CZhz6VLZ.js → chunk-XXDRQBXY-CZykyw7d.js} +1 -1
  22. package/web/dist/assets/{chunk-ZCHMQSOR-D6zBviZp.js → chunk-ZCHMQSOR-BuqMV1C-.js} +2 -2
  23. package/web/dist/assets/{classDiagram-v2-4MYWR3UA-Lvv4Rf4Q.js → classDiagram-v2-4MYWR3UA-Bq8rjGeN.js} +1 -1
  24. package/web/dist/assets/{cose-bilkent-JH36ORCC-V9TmXird.js → cose-bilkent-JH36ORCC-BMAY8FhU.js} +1 -1
  25. package/web/dist/assets/{cynefin-EF2NZ3EQ-CcAG0DdN.js → cynefin-EF2NZ3EQ-BKK4Ttdt.js} +1 -1
  26. package/web/dist/assets/{cynefinDiagram-WF24UDRP-CtbdsXNX.js → cynefinDiagram-WF24UDRP-ugSDoiXQ.js} +1 -1
  27. package/web/dist/assets/{dagre-NK4GIZVX-KKp07WGv.js → dagre-NK4GIZVX-DYiCFUqp.js} +1 -1
  28. package/web/dist/assets/{diagram-CBK3MWTC-OmZxbfpK.js → diagram-CBK3MWTC-v55VlJ49.js} +1 -1
  29. package/web/dist/assets/{diagram-I5XIIV2D-B4A3VXFh.js → diagram-I5XIIV2D-C3MwODzX.js} +1 -1
  30. package/web/dist/assets/{diagram-ODIL2UCW-C6AL0pfJ.js → diagram-ODIL2UCW-CXMTjzRh.js} +1 -1
  31. package/web/dist/assets/{diagram-PFBEJUXE-9n22hgzP.js → diagram-PFBEJUXE-B6lb9fho.js} +1 -1
  32. package/web/dist/assets/{diagram-RJA3I4VV-BZahmd4j.js → diagram-RJA3I4VV-BosfCVJv.js} +1 -1
  33. package/web/dist/assets/{diagram-TYUNFSNR-Vyr_m4Hx.js → diagram-TYUNFSNR-Dl0JqGRc.js} +1 -1
  34. package/web/dist/assets/{ebnfDiagram-V4P3TTPT-BZokt2V8.js → ebnfDiagram-V4P3TTPT-DNluvG80.js} +1 -1
  35. package/web/dist/assets/{elk-QONTBCTQ-35jgsktE.js → elk-QONTBCTQ-N6nCTkF0.js} +1 -1
  36. package/web/dist/assets/{erDiagram-KYQIGQAA-DnORD9ar.js → erDiagram-KYQIGQAA-CvdUroIb.js} +1 -1
  37. package/web/dist/assets/{flowDiagram-IUGLLWBU-DIloo7Vk.js → flowDiagram-IUGLLWBU-kxX9XCk_.js} +1 -1
  38. package/web/dist/assets/{ganttDiagram-R7GPNTJY-uCf1-IbQ.js → ganttDiagram-R7GPNTJY-CfIuoEUS.js} +1 -1
  39. package/web/dist/assets/{gitGraphDiagram-PDYL7XHY-Dps9Z6YN.js → gitGraphDiagram-PDYL7XHY-35qvQc4T.js} +1 -1
  40. package/web/dist/assets/{index-DbkXcP68.js → index-C6naBGI_.js} +49 -49
  41. package/web/dist/assets/{infoDiagram-MVDRKAX5-CSzv2WOS.js → infoDiagram-MVDRKAX5-Dl1tHRrP.js} +1 -1
  42. package/web/dist/assets/{ishikawaDiagram-HPEHV2GE-CfOyv1nx.js → ishikawaDiagram-HPEHV2GE-D0hdtJ3r.js} +1 -1
  43. package/web/dist/assets/{journeyDiagram-BOSHW7O7-B9GewZrz.js → journeyDiagram-BOSHW7O7-B_Q6luFr.js} +1 -1
  44. package/web/dist/assets/{kanban-definition-FNSA4HC5-Dk60DC_q.js → kanban-definition-FNSA4HC5-CxauoEVj.js} +1 -1
  45. package/web/dist/assets/{linear-CFibZx3K.js → linear-VaQ1U06V.js} +1 -1
  46. package/web/dist/assets/{mermaid.core-DSlXNYTz.js → mermaid.core-C-LPkHEo.js} +4 -4
  47. package/web/dist/assets/{mindmap-definition-6OY57UG3-nPEcKx2O.js → mindmap-definition-6OY57UG3-CxFqh8vX.js} +1 -1
  48. package/web/dist/assets/{pegDiagram-ECIUJNBX-BF7-dOgl.js → pegDiagram-ECIUJNBX-BzEzQLRW.js} +1 -1
  49. package/web/dist/assets/{pieDiagram-GNMPY74T-D3xpwkOg.js → pieDiagram-GNMPY74T-B6e5Egd5.js} +1 -1
  50. package/web/dist/assets/{quadrantDiagram-D57K4MC3-wvZrxdaZ.js → quadrantDiagram-D57K4MC3-CNhFRMsS.js} +1 -1
  51. package/web/dist/assets/{railroadDiagram-Y72NRBL7-Bhmlwnxc.js → railroadDiagram-Y72NRBL7-Cj4GWRW6.js} +1 -1
  52. package/web/dist/assets/{requirementDiagram-EQYSW5RA-BISS6nU8.js → requirementDiagram-EQYSW5RA-cbs9y8Ur.js} +1 -1
  53. package/web/dist/assets/{sankeyDiagram-SY24JHO5-B13SKEJi.js → sankeyDiagram-SY24JHO5-CJvdLSft.js} +1 -1
  54. package/web/dist/assets/{sequenceDiagram-BLEHNHQU-CFoMSq2Y.js → sequenceDiagram-BLEHNHQU-BrrXSZh5.js} +1 -1
  55. package/web/dist/assets/{sizeCapture-INFHLROL-B_9ZQIpO.js → sizeCapture-INFHLROL-B3_xE-0l.js} +1 -1
  56. package/web/dist/assets/{stateDiagram-v2-A6IESKWZ-0f03epu-.js → stateDiagram-v2-A6IESKWZ-CmzZmz9Z.js} +1 -1
  57. package/web/dist/assets/{swimlanes-B3ENRKFQ-VbPJcmFg.js → swimlanes-B3ENRKFQ-DSR69SU8.js} +1 -1
  58. package/web/dist/assets/swimlanesDiagram-AYQRV4AK-CVp59Aeo.js +8 -0
  59. package/web/dist/assets/{timeline-definition-JXYKGLGB-BL-ztRYD.js → timeline-definition-JXYKGLGB-Djiy0FdU.js} +1 -1
  60. package/web/dist/assets/{usecaseDiagram-WPOLBNNX-dNJWmkMH.js → usecaseDiagram-WPOLBNNX-cwhemWO9.js} +1 -1
  61. package/web/dist/assets/{vennDiagram-Q3Y3IDCW-7Usz7k8p.js → vennDiagram-Q3Y3IDCW-DnaPc_7z.js} +1 -1
  62. package/web/dist/assets/{wardleyDiagram-IVAIDKWA-C0eZqxRB.js → wardleyDiagram-IVAIDKWA-C-hYpSBW.js} +1 -1
  63. package/web/dist/assets/{xychartDiagram-4URNHDU4-z6jTf4_g.js → xychartDiagram-4URNHDU4-2Hse10CD.js} +1 -1
  64. package/web/dist/index.html +1 -1
  65. package/web/dist/assets/channel-B2B4MLqH.js +0 -1
  66. package/web/dist/assets/swimlanesDiagram-AYQRV4AK-gEpmrKi3.js +0 -8
package/README.md CHANGED
@@ -88,7 +88,9 @@ PRs, review on click) or `--no-poll` (no GitHub polling at all) — or flip thos
88
88
  switches in the cockpit's Settings, which persist in `~/.cerber/config.json`
89
89
  and apply on the next poll. Settings also takes per-repo exceptions
90
90
  (`daemon.autoReviewRepos`): keep a busy repo to the click while the rest are
91
- drafted, or draft one repo with auto-review otherwise off.
91
+ drafted, or draft one repo with auto-review otherwise off. And it can leave
92
+ PRs that only a team of yours was asked to review to the click
93
+ (`daemon.autoReviewTeamRequests`), while the ones naming you are still drafted.
92
94
 
93
95
  ## Contents
94
96
 
@@ -1,5 +1,7 @@
1
- export function autoReviewFor(knobs, owner, repo) {
2
- const want = `${owner}/${repo}`.toLowerCase();
1
+ export function autoReviewFor(knobs, pr) {
2
+ if (pr.requestedViaTeam !== false && !knobs.autoReviewTeamRequests)
3
+ return false;
4
+ const want = `${pr.owner}/${pr.repo}`.toLowerCase();
3
5
  for (const [key, on] of Object.entries(knobs.autoReviewRepos)) {
4
6
  if (key.toLowerCase() === want)
5
7
  return on;
@@ -18,7 +20,7 @@ export function anyAutoReview(knobs) {
18
20
  * the config's own `autoReview: false` — never the flag.
19
21
  */
20
22
  export function capAutoReview(knobs, flag) {
21
- return flag ? knobs : { autoReview: false, autoReviewRepos: {} };
23
+ return flag ? knobs : { autoReview: false, autoReviewRepos: {}, autoReviewTeamRequests: false };
22
24
  }
23
25
  /**
24
26
  * One exception set (`true`/`false`) or removed (`null`), the rest left as they
@@ -43,6 +43,12 @@ export const DaemonConfigSchema = z.object({
43
43
  }
44
44
  })
45
45
  .default({}),
46
+ /**
47
+ * Draft PRs whose review was requested only from a team you are on. Off
48
+ * leaves them waiting for a click, in every repo — a request naming you is
49
+ * drafted either way. Resolved by `autoReviewFor` too.
50
+ */
51
+ autoReviewTeamRequests: z.boolean().default(true),
46
52
  /**
47
53
  * Tap this machine's notification centre when a PR is worth coming back for
48
54
  * — the draft landing, or the arrival itself when nothing is going to be
package/dist/core/gh.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { execFile } from "node:child_process";
2
2
  import { promisify } from "node:util";
3
- import { PrInfoSchema } from "./artifact.js";
3
+ import { PrInfoSchema, artifactId } from "./artifact.js";
4
4
  const execFileAsync = promisify(execFile);
5
5
  const MAX_BUFFER = 64 * 1024 * 1024;
6
6
  /**
@@ -206,6 +206,7 @@ export function mapSearchResults(raw) {
206
206
  updatedAt: r.updatedAt,
207
207
  isDraft: r.isDraft,
208
208
  author: r.author?.login ?? "",
209
+ requestedViaTeam: false,
209
210
  },
210
211
  ];
211
212
  });
@@ -533,8 +534,10 @@ export async function fetchPriorRemarks(ref, people) {
533
534
  * `author` is your own open PRs, which that search returns only when a team
534
535
  * you are on was requested — GitHub will not let anyone request a review from
535
536
  * a PR's author — so self-reviewing one would otherwise mean pasting its URL
536
- * every time. Both are the same search with one flag changed, so they cannot
537
- * drift apart on what "open" means or which repos are read-only.
537
+ * every time. `user-review-requested` is the inbox narrowed to requests naming
538
+ * you, leaving out the ones made only of a team you are on. All three are the
539
+ * same search with one qualifier changed, so they cannot drift apart on what
540
+ * "open" means or which repos are read-only.
538
541
  */
539
542
  export function searchPrsArgs(search, repoFilter, limit = 50, updatedSince = null) {
540
543
  const args = [
@@ -545,7 +548,9 @@ export function searchPrsArgs(search, repoFilter, limit = 50, updatedSince = nul
545
548
  "archived:false",
546
549
  // Only the author search is ever given one (`ownPrUpdatedSince`).
547
550
  ...(updatedSince ? [`updated:>=${updatedSince}`] : []),
548
- `--${search}=@me`,
551
+ // gh has a flag for the other two and none for this one, so it goes in
552
+ // as a qualifier — which is what each flag turns into anyway.
553
+ search === "user-review-requested" ? `${search}:@me` : `--${search}=@me`,
549
554
  "--state=open",
550
555
  "--limit",
551
556
  String(limit),
@@ -562,6 +567,28 @@ export async function searchAwaitingMe(repoFilter, limit = 50) {
562
567
  const out = await gh(searchAwaitingArgs(repoFilter, limit));
563
568
  return mapSearchResults(JSON.parse(out));
564
569
  }
570
+ /** Open PRs where the current gh user's review is requested by name — a request of a team they are on does not count. */
571
+ export async function searchNamingMe(repoFilter, limit = 50) {
572
+ const out = await gh(searchPrsArgs("user-review-requested", repoFilter, limit));
573
+ return mapSearchResults(JSON.parse(out));
574
+ }
575
+ /**
576
+ * Mark each awaiting PR with whether the request named you or only a team
577
+ * you are on.
578
+ *
579
+ * `review-requested:@me` matches both and cannot say which, so whatever the
580
+ * by-name search lacks is a team's request. Its page holds a subset of the
581
+ * awaiting one's, so it is only incomplete when more than a page of PRs name
582
+ * you — and then the overflow reads as team-only, which at worst leaves a
583
+ * draft to the click rather than writing one nobody wanted. `named` is null
584
+ * when that search was not run or failed: then nothing is marked either way.
585
+ */
586
+ export function markTeamRequests(awaiting, named) {
587
+ if (named === null)
588
+ return awaiting.map((pr) => ({ ...pr, requestedViaTeam: null }));
589
+ const ids = new Set(named.map((pr) => artifactId(pr)));
590
+ return awaiting.map((pr) => ({ ...pr, requestedViaTeam: !ids.has(artifactId(pr)) }));
591
+ }
565
592
  /**
566
593
  * Open PRs the current gh user opened, drafts included. They come to the inbox
567
594
  * to be reviewed on demand and never automatically — see `isOwnPr` (`own.ts`).
@@ -2,7 +2,7 @@ import { SCHEMA_VERSION, artifactId, artifactKey } from "../core/artifact.js";
2
2
  import { evaluateAutoSend } from "../core/autosend.js";
3
3
  import { anyAutoReview, autoReviewFor, capAutoReview } from "../core/autoreview.js";
4
4
  import { loadConfig } from "../core/config.js";
5
- import { classifyReply, currentLogin, fetchConversation, fetchLastReviewRequest, fetchOwnReview, fetchPrInfo, fetchReviewRequests, lastMentionOfYou, lastWordOfYours, ownPrUpdatedSince, searchAuthoredByMe, searchAwaitingMe, stillRequested, submitReview, } from "../core/gh.js";
5
+ import { classifyReply, currentLogin, fetchConversation, fetchLastReviewRequest, fetchOwnReview, fetchPrInfo, fetchReviewRequests, lastMentionOfYou, lastWordOfYours, markTeamRequests, ownPrUpdatedSince, searchAuthoredByMe, searchAwaitingMe, searchNamingMe, stillRequested, submitReview, } from "../core/gh.js";
6
6
  import { withWriter } from "../core/history.js";
7
7
  import { isOwnPr } from "../core/own.js";
8
8
  import { pendingNews, notice, notify } from "../core/notify.js";
@@ -29,6 +29,18 @@ export function dedupeDiscovered(refs) {
29
29
  return true;
30
30
  });
31
31
  }
32
+ function awaitingPr(ref, reply) {
33
+ return { id: artifactId(ref), reply, requestedViaTeam: ref.requestedViaTeam };
34
+ }
35
+ /**
36
+ * Whether the last poll found this PR asking only a team of yours, or null if
37
+ * it could not tell. A row the awaiting search did not return — your own PR,
38
+ * one pulled in by hand — was asked of nobody, so of no team either.
39
+ */
40
+ export function requestedViaTeam(awaiting, id) {
41
+ const entry = awaiting.find((a) => a.id === id);
42
+ return entry ? entry.requestedViaTeam : false;
43
+ }
32
44
  /**
33
45
  * A pure discovery stub: enough artifact for the queue to show an awaiting row.
34
46
  * The AI run that follows (automatic or clicked) replaces it wholesale.
@@ -255,6 +267,7 @@ export function startDaemon(opts) {
255
267
  notify: false,
256
268
  autoReview: opts.autoReview,
257
269
  autoReviewRepos: {},
270
+ autoReviewTeamRequests: opts.autoReview,
258
271
  trustedRuns: false,
259
272
  polls: 0,
260
273
  errors: 0,
@@ -294,14 +307,25 @@ export function startDaemon(opts) {
294
307
  * PR decides nothing — a team you are on can be requested on your own PR,
295
308
  * and `isOwnPr` reads the author either way.
296
309
  */
297
- async function discover(me, ownPrMaxAgeDays) {
310
+ async function discover(me, ownPrMaxAgeDays, teamRequestsDrafted) {
298
311
  const filters = opts.repos.length > 0 ? opts.repos : [undefined];
299
312
  // Your own PRs only: a review request is never aged out. One that went
300
313
  // stale leaves the search, and the reaper below drops its stub like any
301
314
  // other the search stopped returning — a draft of yours stays put.
302
315
  const since = ownPrUpdatedSince(ownPrMaxAgeDays);
303
- const [awaiting, authored] = await Promise.all([
316
+ const [awaiting, named, authored] = await Promise.all([
304
317
  Promise.all(filters.map((repo) => searchAwaitingMe(repo))),
318
+ // It only tells your requests from your teams', which changes nothing
319
+ // while both are drafted — so it is only asked while they are not.
320
+ // Failing, it costs that distinction for one poll rather than the poll:
321
+ // discovery and the announcements go ahead, and a row nobody could
322
+ // classify waits for the click like a team's.
323
+ teamRequestsDrafted
324
+ ? Promise.resolve(null)
325
+ : Promise.all(filters.map((repo) => searchNamingMe(repo))).catch((err) => {
326
+ log(`could not tell team review requests from yours: ${err instanceof Error ? err.message : String(err)}`);
327
+ return null;
328
+ }),
305
329
  me === null
306
330
  ? Promise.resolve(null)
307
331
  : Promise.all(filters.map((repo) => searchAuthoredByMe(repo, since))).catch((err) => {
@@ -310,7 +334,7 @@ export function startDaemon(opts) {
310
334
  }),
311
335
  ]);
312
336
  return {
313
- refs: dedupeDiscovered([...awaiting.flat(), ...(authored ?? []).flat()]),
337
+ refs: dedupeDiscovered([...markTeamRequests(awaiting.flat(), named?.flat() ?? null), ...(authored ?? []).flat()]),
314
338
  ownSearched: authored !== null,
315
339
  };
316
340
  }
@@ -730,14 +754,14 @@ export function startDaemon(opts) {
730
754
  }
731
755
  catch {
732
756
  // Without knowing who you are, no comment can be attributed to you.
733
- return refs.map((ref) => ({ id: artifactId(ref), reply: "unknown" }));
757
+ return refs.map((ref) => awaitingPr(ref, "unknown"));
734
758
  }
735
759
  return pool(refs, opts.parallel, async (ref) => {
736
760
  try {
737
- return { id: artifactId(ref), reply: classifyReply(await fetchConversation(ref), login) };
761
+ return awaitingPr(ref, classifyReply(await fetchConversation(ref), login));
738
762
  }
739
763
  catch {
740
- return { id: artifactId(ref), reply: "unknown" };
764
+ return awaitingPr(ref, "unknown");
741
765
  }
742
766
  });
743
767
  }
@@ -832,7 +856,10 @@ export function startDaemon(opts) {
832
856
  // Your own PRs are never drafted unasked, whatever auto-review says for
833
857
  // their repo: they are in the inbox for a self-review on demand. The same
834
858
  // predicate decides when a tap is due, which keeps them quiet there too.
835
- const drafts = (pr) => !isOwnPr(pr, me) && autoReviewFor(autoReview, pr.owner, pr.repo);
859
+ // Whether only a team was asked is read off the published list rather
860
+ // than the PR, because the cockpit reads it there too.
861
+ const drafts = (pr) => !isOwnPr(pr, me) &&
862
+ autoReviewFor(autoReview, { ...pr, requestedViaTeam: requestedViaTeam(status.awaiting, artifactId(pr)) });
836
863
  status.pollEnabled = knobs.poll;
837
864
  // What the cockpit's bell defers to: a loop that isn't polling announces
838
865
  // nothing, whatever the notify toggle says.
@@ -846,7 +873,14 @@ export function startDaemon(opts) {
846
873
  status.autoReviewRepos = autoReview.autoReviewRepos;
847
874
  // Recomputed too, so a trust rule added mid-run shows up in the strip.
848
875
  status.trustedRuns = anyAutoReview(autoReview) && opts.trust !== false && config.trust.length > 0;
849
- return { knobs, drafts, drafting: anyAutoReview(autoReview), notifyOn, announcing };
876
+ return {
877
+ knobs,
878
+ drafts,
879
+ drafting: anyAutoReview(autoReview),
880
+ teamRequestsDrafted: autoReview.autoReviewTeamRequests,
881
+ notifyOn,
882
+ announcing,
883
+ };
850
884
  }
851
885
  /** Everything a poll writes is the poll's — including the reviews it starts,
852
886
  * which stamp themselves as runs from inside this. */
@@ -867,7 +901,7 @@ export function startDaemon(opts) {
867
901
  // what tells your own PRs apart from the ones awaiting you. Null is "gh
868
902
  // could not say", and then no own PR is brought in at all — see `discover`.
869
903
  const me = await currentLogin().catch(() => null);
870
- const { knobs, drafts, drafting, notifyOn, announcing } = applyKnobs(config, me);
904
+ const { knobs, drafts, drafting, teamRequestsDrafted, notifyOn, announcing } = applyKnobs(config, me);
871
905
  if (!knobs.poll) {
872
906
  // Deliberately off is not an outage — don't leave a stale error up, or
873
907
  // a list of PRs we are no longer checking are still awaiting you.
@@ -876,7 +910,7 @@ export function startDaemon(opts) {
876
910
  status.lastSummary = "polling off (settings) — the queue only shows what you review by hand";
877
911
  return;
878
912
  }
879
- const { refs, ownSearched } = await discover(me, knobs.ownPrMaxAgeDays);
913
+ const { refs, ownSearched } = await discover(me, knobs.ownPrMaxAgeDays, knobs.autoReviewTeamRequests);
880
914
  // Your own PRs are synced into the queue with the rest, but nobody is
881
915
  // asking you for them: they are not "awaiting" in anything the strip
882
916
  // counts, and the cockpit's open-requests tab — "GitHub still lists you
@@ -889,6 +923,7 @@ export function startDaemon(opts) {
889
923
  // and the rows the cockpit can name always come from one answer.
890
924
  // A failed poll leaves the last good list up; lastPollError says so.
891
925
  status.awaiting = await classifyAll(asked);
926
+ status.autoReviewTeamRequests = teamRequestsDrafted;
892
927
  const { discovered } = await syncQueue(refs, ownSearched);
893
928
  if (drafting) {
894
929
  // A repo excepted from auto-review is discovered like any other — it
@@ -6,7 +6,7 @@ import { promises as fs } from "node:fs";
6
6
  import path from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import { randomUUID } from "node:crypto";
9
- import { isPureStub } from "./daemon.js";
9
+ import { isPureStub, requestedViaTeam } from "./daemon.js";
10
10
  import { ArtifactStatusSchema, SCHEMA_VERSION, SeveritySchema, VerdictSchema, artifactId, artifactKey, } from "../core/artifact.js";
11
11
  import { toMarkdown } from "../core/export.js";
12
12
  import { isOwnPr } from "../core/own.js";
@@ -266,6 +266,7 @@ export async function buildApp(opts) {
266
266
  // and must not hang on GitHub: a gh that cannot say in time marks nothing
267
267
  // as yours, and Send's own guard still refuses what GitHub would.
268
268
  const me = await loginWithin(LOGIN_WAIT_MS);
269
+ const awaiting = opts.daemon?.status().awaiting ?? [];
269
270
  return c.json(artifacts.map((a) => ({
270
271
  id: a.id,
271
272
  key: artifactKey(a.id),
@@ -309,6 +310,10 @@ export async function buildApp(opts) {
309
310
  // A PR you opened: listed apart from the ones awaiting you, and sent
310
311
  // as a comment only (`ownPrRefusal`).
311
312
  own: isOwnPr(a.pr, me),
313
+ // Only a team of yours was asked, as of the last poll — what the bell
314
+ // and the row's explanation need to tell "waits for a click" from
315
+ // "being drafted" under `autoReviewTeamRequests`.
316
+ requestedViaTeam: requestedViaTeam(awaiting, a.id),
312
317
  costUsd: a.run?.costUsd ?? null,
313
318
  withSource: a.run?.withSource ?? null,
314
319
  trusted: a.run?.trusted ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullstackhouse/cerber",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "AI code-review cockpit: Claude reviews your PRs into local artifacts; nothing reaches GitHub until you say so.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -1 +1 @@
1
- import{g as p,r as u,d as a}from"./chunk-2E7WHVMD-9Ra4B9GU.js";import{p as f}from"./chunk-JWPE2WC7-BJYQI99_.js";import{_ as n,l as o}from"./mermaid.core-DSlXNYTz.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ-CcAG0DdN.js";import"./index-DbkXcP68.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
1
+ import{g as p,r as u,d as a}from"./chunk-2E7WHVMD-CldzK0s1.js";import{p as f}from"./chunk-JWPE2WC7-BF47y5tL.js";import{_ as n,l as o}from"./mermaid.core-C-LPkHEo.js";import{M as c,b as d}from"./cynefin-EF2NZ3EQ-BKK4Ttdt.js";import"./index-C6naBGI_.js";var v=d().RailroadAbnf.parser.LangiumParser,i=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},B={parser:R,db:a,renderer:u,styles:p};export{B as diagram};
@@ -1 +1 @@
1
- import{a5 as ln,a6 as an,a7 as H,a8 as j,a9 as B,aa as un,ab as g,ac as tn,ad as L,ae as _,af as rn,ag as o,ah as on,ai as sn,aj as fn}from"./mermaid.core-DSlXNYTz.js";function cn(l){return l.innerRadius}function gn(l){return l.outerRadius}function yn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,A,C,a){var I=E-l,i=q-h,n=C-v,d=a-A,u=d*I-n*i;if(!(u*u<g))return u=(n*(h-A)-d*(l-v))/u,[l+u*I,h+u*i]}function W(l,h,E,q,v,A,C){var a=l-E,I=h-q,i=(C?A:-A)/L(a*a+I*I),n=i*I,d=-i*a,u=l+n,s=h+d,f=E+n,c=q+d,F=(u+f)/2,t=(s+c)/2,m=f-u,y=c-s,R=m*m+y*y,T=v-A,P=u*c-f*s,O=(y<0?-1:1)*L(on(0,T*T*R-P*P)),S=(P*y-m*O)/R,z=(-P*m-y*O)/R,w=(P*y+m*O)/R,p=(-P*m+y*O)/R,x=S-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(S=w,z=p),{cx:S,cy:z,x01:-n,y01:-d,x11:S*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=gn,E=B(0),q=null,v=yn,A=dn,C=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=I()),s<u&&(d=s,s=u,u=d),!(s>g))a.moveTo(0,0);else if(F>tn-g)a.moveTo(s*H(f),s*j(f)),a.arc(0,0,s,f,c,!t),u>g&&(a.moveTo(u*H(c),u*j(c)),a.arc(0,0,u,c,f,t));else{var m=f,y=c,R=f,T=c,P=F,O=F,S=C.apply(this,arguments)/2,z=S>g&&(q?+q.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(z>g){var G=sn(z/u*j(S)),M=sn(z/s*j(S));(P-=G*2)>g?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(O-=M*2)>g?(M*=t?1:-1,m+=M,y-=M):(O=0,m=y=(f+c)/2)}var J=s*H(m),K=s*j(m),N=u*H(T),Q=u*j(T);if(w>g){var U=s*H(y),V=s*j(y),X=u*H(R),Y=u*j(R),D;if(F<an)if(D=pn(J,K,X,Y,U,V,N,Q)){var Z=J-D[0],$=K-D[1],b=U-D[0],k=V-D[1],nn=1/j(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(D[0]*D[0]+D[1]*D[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}O>g?x>g?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,y,!t)):a.moveTo(J,K),!(u>g)||!(P>g)?a.lineTo(N,Q):p>g?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,j(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:B(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:B(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
1
+ import{a5 as ln,a6 as an,a7 as H,a8 as j,a9 as B,aa as un,ab as g,ac as tn,ad as L,ae as _,af as rn,ag as o,ah as on,ai as sn,aj as fn}from"./mermaid.core-C-LPkHEo.js";function cn(l){return l.innerRadius}function gn(l){return l.outerRadius}function yn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,E,q,v,A,C,a){var I=E-l,i=q-h,n=C-v,d=a-A,u=d*I-n*i;if(!(u*u<g))return u=(n*(h-A)-d*(l-v))/u,[l+u*I,h+u*i]}function W(l,h,E,q,v,A,C){var a=l-E,I=h-q,i=(C?A:-A)/L(a*a+I*I),n=i*I,d=-i*a,u=l+n,s=h+d,f=E+n,c=q+d,F=(u+f)/2,t=(s+c)/2,m=f-u,y=c-s,R=m*m+y*y,T=v-A,P=u*c-f*s,O=(y<0?-1:1)*L(on(0,T*T*R-P*P)),S=(P*y-m*O)/R,z=(-P*m-y*O)/R,w=(P*y+m*O)/R,p=(-P*m+y*O)/R,x=S-F,e=z-t,r=w-F,G=p-t;return x*x+e*e>r*r+G*G&&(S=w,z=p),{cx:S,cy:z,x01:-n,y01:-d,x11:S*(v/T-1),y11:z*(v/T-1)}}function hn(){var l=cn,h=gn,E=B(0),q=null,v=yn,A=dn,C=mn,a=null,I=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-un,c=A.apply(this,arguments)-un,F=rn(c-f),t=c>f;if(a||(a=n=I()),s<u&&(d=s,s=u,u=d),!(s>g))a.moveTo(0,0);else if(F>tn-g)a.moveTo(s*H(f),s*j(f)),a.arc(0,0,s,f,c,!t),u>g&&(a.moveTo(u*H(c),u*j(c)),a.arc(0,0,u,c,f,t));else{var m=f,y=c,R=f,T=c,P=F,O=F,S=C.apply(this,arguments)/2,z=S>g&&(q?+q.apply(this,arguments):L(u*u+s*s)),w=_(rn(s-u)/2,+E.apply(this,arguments)),p=w,x=w,e,r;if(z>g){var G=sn(z/u*j(S)),M=sn(z/s*j(S));(P-=G*2)>g?(G*=t?1:-1,R+=G,T-=G):(P=0,R=T=(f+c)/2),(O-=M*2)>g?(M*=t?1:-1,m+=M,y-=M):(O=0,m=y=(f+c)/2)}var J=s*H(m),K=s*j(m),N=u*H(T),Q=u*j(T);if(w>g){var U=s*H(y),V=s*j(y),X=u*H(R),Y=u*j(R),D;if(F<an)if(D=pn(J,K,X,Y,U,V,N,Q)){var Z=J-D[0],$=K-D[1],b=U-D[0],k=V-D[1],nn=1/j(fn((Z*b+$*k)/(L(Z*Z+$*$)*L(b*b+k*k)))/2),en=L(D[0]*D[0]+D[1]*D[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}O>g?x>g?(e=W(X,Y,J,K,s,x,t),r=W(U,V,N,Q,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(J,K),a.arc(0,0,s,m,y,!t)):a.moveTo(J,K),!(u>g)||!(P>g)?a.lineTo(N,Q):p>g?(e=W(N,Q,U,V,u,-p,t),r=W(J,K,X,Y,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[H(d)*n,j(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:B(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:B(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:B(+n),i):E},i.padRadius=function(n){return arguments.length?(q=n==null?null:typeof n=="function"?n:B(+n),i):q},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:B(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:B(+n),i):A},i.padAngle=function(n){return arguments.length?(C=typeof n=="function"?n:B(+n),i):C},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};