@diffohq/diffo 0.14.2 → 0.16.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 (118) hide show
  1. package/dist/cli.mjs +59 -9
  2. package/dist/client/assets/{abnfDiagram-O67JEVCF-CMnC6TpZ.js → abnfDiagram-O67JEVCF-BeUwVmdl.js} +1 -1
  3. package/dist/client/assets/{arc-DZk3sJZl.js → arc-DOjPzaV7.js} +1 -1
  4. package/dist/client/assets/architecture-7GRP2DOG-DRh1anq7.js +1 -0
  5. package/dist/client/assets/{architectureDiagram-NJMV4G6O-Dz9QZrKb.js → architectureDiagram-NJMV4G6O-BenBz3HF.js} +1 -1
  6. package/dist/client/assets/{blockDiagram-BEXU5L5S-EcyDxzoo.js → blockDiagram-BEXU5L5S-C3ubUdn6.js} +1 -1
  7. package/dist/client/assets/{c4Diagram-YGBWAQC7-BKJoKbJ0.js → c4Diagram-YGBWAQC7-Cd_s02_p.js} +1 -1
  8. package/dist/client/assets/channel-DgyVhp45.js +1 -0
  9. package/dist/client/assets/{chunk-3FUC2YCW-CvCppQd9.js → chunk-3FUC2YCW-DNC8xTT6.js} +1 -1
  10. package/dist/client/assets/{chunk-5DYCD2WN-BgEct2K6.js → chunk-5DYCD2WN-wrFKk0N8.js} +1 -1
  11. package/dist/client/assets/{chunk-742MDFTN-BqjxeZIP.js → chunk-742MDFTN-C6HG0C5O.js} +1 -1
  12. package/dist/client/assets/{chunk-7INBJB4K-tXIMGd-a.js → chunk-7INBJB4K-BNmRJXpH.js} +1 -1
  13. package/dist/client/assets/{chunk-7M6MHVWA-Dvn3lbjR.js → chunk-7M6MHVWA-CqmUCew2.js} +1 -1
  14. package/dist/client/assets/{chunk-7PRAP22T-Dhf_jRyf.js → chunk-7PRAP22T-POpt8059.js} +1 -1
  15. package/dist/client/assets/{chunk-GTNCS2PH-DrLr4ax6.js → chunk-GTNCS2PH-CGpv_nJF.js} +1 -1
  16. package/dist/client/assets/{chunk-GWA4HPMP-B19E2BR4.js → chunk-GWA4HPMP-rku5iuCc.js} +1 -1
  17. package/dist/client/assets/{chunk-MBY4JIJT-B39se3mh.js → chunk-MBY4JIJT-aVv2hMbS.js} +1 -1
  18. package/dist/client/assets/{chunk-NETBCI7D-DNqlAaqS.js → chunk-NETBCI7D-Vn26OS_d.js} +1 -1
  19. package/dist/client/assets/{chunk-O7XYJQB3-DKVir5ql.js → chunk-O7XYJQB3-CFlDerCD.js} +1 -1
  20. package/dist/client/assets/{chunk-UA2S7LBM-BJrTT987.js → chunk-UA2S7LBM-BG-lbrO7.js} +1 -1
  21. package/dist/client/assets/{chunk-WEXAMYUT-CVJkRDlB.js → chunk-WEXAMYUT-DzfflAIJ.js} +1 -1
  22. package/dist/client/assets/{chunk-XXDRQBXY-BxCscPzy.js → chunk-XXDRQBXY-DpTI1BY5.js} +1 -1
  23. package/dist/client/assets/{chunk-Z7XXMR3K-BN62CsO3.js → chunk-Z7XXMR3K-C3pZVvEc.js} +1 -1
  24. package/dist/client/assets/{chunk-ZIGJFQKS-D5CFKrxE.js → chunk-ZIGJFQKS-5Tn59Tz_.js} +1 -1
  25. package/dist/client/assets/{classDiagram-v2-NBCMYWYE-BKkAeVYM.js → classDiagram-v2-NBCMYWYE-B0Ai_5Sz.js} +1 -1
  26. package/dist/client/assets/{core-Q3dXPkAg.js → core-eaqB-6jU.js} +2 -2
  27. package/dist/client/assets/{cose-bilkent-JH36ORCC-YcS_RGCv.js → cose-bilkent-JH36ORCC-yTOAkSBk.js} +1 -1
  28. package/dist/client/assets/csharp-dmMxLVLW.js +1 -0
  29. package/dist/client/assets/css-BGIxQoYs.js +1 -0
  30. package/dist/client/assets/css-DUjzNfgv.js +1 -0
  31. package/dist/client/assets/{cynefin-OW5HDTMX-yrbryS5G.js → cynefin-OW5HDTMX-C1EbHivx.js} +1 -1
  32. package/dist/client/assets/{cynefinDiagram-VND7K2PF-Hc8uQFhv.js → cynefinDiagram-VND7K2PF-W4ejfT-C.js} +1 -1
  33. package/dist/client/assets/{dagre-6A5THRUB-KXPtswtI.js → dagre-6A5THRUB-DCLRwyBp.js} +1 -1
  34. package/dist/client/assets/{diagram-22UHCM2B-Y8pX48tu.js → diagram-22UHCM2B-B2uUz1Sf.js} +1 -1
  35. package/dist/client/assets/{diagram-3UASUU5V-CVa1vLpR.js → diagram-3UASUU5V-C2i6j0gK.js} +1 -1
  36. package/dist/client/assets/{diagram-ATOU4E4O-CneE7Zes.js → diagram-ATOU4E4O-CGRIsbJn.js} +1 -1
  37. package/dist/client/assets/{diagram-CDSNMT55-oZKmQM2r.js → diagram-CDSNMT55-CeLMGz-e.js} +1 -1
  38. package/dist/client/assets/{diagram-MLGK6HIB-DFI0Zy59.js → diagram-MLGK6HIB-DV1Yw1yk.js} +1 -1
  39. package/dist/client/assets/{diagram-MPIPVDR6-eArDdjHg.js → diagram-MPIPVDR6-CuFBeKe_.js} +1 -1
  40. package/dist/client/assets/{dist-D0R2sCr-.js → dist-BTwBvBOz.js} +1 -1
  41. package/dist/client/assets/{dist-Dpuu8gDL.js → dist-Cr2gbd4l.js} +1 -1
  42. package/dist/client/assets/{ebnfDiagram-ZINNZB2B-BGQz6GUg.js → ebnfDiagram-ZINNZB2B-4Z9n76nP.js} +1 -1
  43. package/dist/client/assets/{elk-276RUBZZ-BIfKEkPZ.js → elk-276RUBZZ-DA8ZR7dF.js} +1 -1
  44. package/dist/client/assets/{engine-oniguruma-CAQyYVrA.js → engine-oniguruma-BmQGvQrV.js} +1 -1
  45. package/dist/client/assets/{erDiagram-OPXOYQCR-DrJ1SBCa.js → erDiagram-OPXOYQCR-CTDqeRLt.js} +1 -1
  46. package/dist/client/assets/eventmodeling-NTZA5JFV-DOK7jJK9.js +1 -0
  47. package/dist/client/assets/flowDiagram-KWPJA3E3-p353nqex.js +1 -0
  48. package/dist/client/assets/{ganttDiagram-FUAMR5RP-C7I_nqgh.js → ganttDiagram-FUAMR5RP-Cj9f3Ref.js} +1 -1
  49. package/dist/client/assets/{gitGraph-4MIJSDKK-BJpLoDlb.js → gitGraph-4MIJSDKK-B3FiLaE0.js} +1 -1
  50. package/dist/client/assets/{gitGraphDiagram-X574FWY7-DFhuC-Rb.js → gitGraphDiagram-X574FWY7-DPZfXx_L.js} +1 -1
  51. package/dist/client/assets/{html-BcACZWSP.js → html-BMn1ogTm.js} +1 -1
  52. package/dist/client/assets/html-BlpXnbzK.js +1 -0
  53. package/dist/client/assets/index-Cqenoz2e.js +93 -0
  54. package/dist/client/assets/{info-A6RAGUB7-BLikVQLs.js → info-A6RAGUB7-BAlSTvkv.js} +1 -1
  55. package/dist/client/assets/{infoDiagram-VRGFBTTK-BuEHO71F.js → infoDiagram-VRGFBTTK-CbGiCy3i.js} +1 -1
  56. package/dist/client/assets/{ishikawaDiagram-OU5B5YK6-DFMfeW2E.js → ishikawaDiagram-OU5B5YK6-HwD-zBAB.js} +1 -1
  57. package/dist/client/assets/{journeyDiagram-ZHPQQLJL-CTB146da.js → journeyDiagram-ZHPQQLJL-CjmNA7v_.js} +1 -1
  58. package/dist/client/assets/{kanban-definition-PNTS6WVX-8r22deVT.js → kanban-definition-PNTS6WVX-DKiLBA-v.js} +1 -1
  59. package/dist/client/assets/{line-CSUq9tDd.js → line-QNZCtL87.js} +1 -1
  60. package/dist/client/assets/{linear-T3cnNwPj.js → linear-Cimo_Ktj.js} +1 -1
  61. package/dist/client/assets/{mermaid-parser.core-QCdEYrye.js → mermaid-parser.core-BrIOn0_H.js} +3 -3
  62. package/dist/client/assets/{mermaid.core-BRH8LAdQ.js → mermaid.core-DP4c5AXa.js} +4 -4
  63. package/dist/client/assets/{mindmap-definition-NLK3R4M7-F92n7hZW.js → mindmap-definition-NLK3R4M7-99gdOEjC.js} +1 -1
  64. package/dist/client/assets/{packet-AYTQ26CC-20aELlan.js → packet-AYTQ26CC-BxNPQbmA.js} +1 -1
  65. package/dist/client/assets/{pegDiagram-GJSIUBJH-DeFQFgFM.js → pegDiagram-GJSIUBJH-DcB3-w2f.js} +1 -1
  66. package/dist/client/assets/php-CUj1wjLQ.js +1 -0
  67. package/dist/client/assets/{pie-WAS4IAKB-ClBZY8bG.js → pie-WAS4IAKB-C8IolWbl.js} +1 -1
  68. package/dist/client/assets/{pieDiagram-5QR66LMP-CcDXekON.js → pieDiagram-5QR66LMP-CI7UHyLf.js} +1 -1
  69. package/dist/client/assets/{quadrantDiagram-O4NWA36T-BhpHJFDT.js → quadrantDiagram-O4NWA36T-B5M09rwy.js} +1 -1
  70. package/dist/client/assets/{radar-RG4KPBEZ-Dlr7Lw2F.js → radar-RG4KPBEZ-BWLNOZQF.js} +1 -1
  71. package/dist/client/assets/{railroad-74A4TZTK-DBtgFHX3.js → railroad-74A4TZTK-BBgrDybk.js} +1 -1
  72. package/dist/client/assets/railroad-abnf-HS5TGJTU-CrBkmUeQ.js +1 -0
  73. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Bxiu0IjD.js +1 -0
  74. package/dist/client/assets/railroad-peg-WCYAUIDC-DsYmbwPf.js +1 -0
  75. package/dist/client/assets/{railroadDiagram-XR7U4H2S-DyP83oqZ.js → railroadDiagram-XR7U4H2S-DfLKmOOV.js} +1 -1
  76. package/dist/client/assets/{requirementDiagram-PLB6GJNP-6tSvb8E_.js → requirementDiagram-PLB6GJNP-BRfCLMIV.js} +1 -1
  77. package/dist/client/assets/{ruby-D_UtGFHI.js → ruby-DgJVzwN8.js} +1 -1
  78. package/dist/client/assets/rust-DpiIf5JO.js +1 -0
  79. package/dist/client/assets/{sankeyDiagram-IPEJSGJF-DB3N2C4T.js → sankeyDiagram-IPEJSGJF-L0OovUCE.js} +1 -1
  80. package/dist/client/assets/{scss-DHtrkMkT.js → scss-8bKmll0B.js} +1 -1
  81. package/dist/client/assets/{sequenceDiagram-PO4LG4MO-BdLgUl7V.js → sequenceDiagram-PO4LG4MO-DihY5-ud.js} +1 -1
  82. package/dist/client/assets/sql-BOsskAmu.js +1 -0
  83. package/dist/client/assets/sql-CNu3Or2W.js +1 -0
  84. package/dist/client/assets/{src-BvmeK_-w.js → src-Dra0Xg0O.js} +1 -1
  85. package/dist/client/assets/{stateDiagram-v2-GCMORJYK-DgmIAAtq.js → stateDiagram-v2-GCMORJYK-BL_hIu6k.js} +1 -1
  86. package/dist/client/assets/{svelte-BUVJxsYv.js → svelte-DAcAPYhA.js} +1 -1
  87. package/dist/client/assets/{swimlanes-2SLR337P-CGuG0DXr.js → swimlanes-2SLR337P-ChQabuby.js} +1 -1
  88. package/dist/client/assets/swimlanesDiagram-TC7HE7FX-0xAZLtPg.js +8 -0
  89. package/dist/client/assets/{timeline-definition-EJHVYXUP-BWw3aGPy.js → timeline-definition-EJHVYXUP-BAK3-LpH.js} +1 -1
  90. package/dist/client/assets/{treeView-Q6P3EWNA-l8VtpJxe.js → treeView-Q6P3EWNA-ul5oNNwQ.js} +1 -1
  91. package/dist/client/assets/{treemap-WGGIJYW6-Cp_qtDl8.js → treemap-WGGIJYW6-N09mB4mw.js} +1 -1
  92. package/dist/client/assets/{usecaseDiagram-POWQR4AR-BXq3uA_V.js → usecaseDiagram-POWQR4AR-CKjVj1WA.js} +1 -1
  93. package/dist/client/assets/{vennDiagram-UO4OBE2U-0J7vWDX-.js → vennDiagram-UO4OBE2U-BJk8NCzk.js} +1 -1
  94. package/dist/client/assets/{vue-CSBlZ1UP.js → vue-rALd9gPk.js} +1 -1
  95. package/dist/client/assets/{wardley-WFR3VGLG-z_aeXQvi.js → wardley-WFR3VGLG-C79BQavk.js} +1 -1
  96. package/dist/client/assets/{wardleyDiagram-VNRHLVJA-DWf3HNTA.js → wardleyDiagram-VNRHLVJA-Dhj3Ep_D.js} +1 -1
  97. package/dist/client/assets/{xychartDiagram-PMCCYNJV-DWxpNFi9.js → xychartDiagram-PMCCYNJV-cJRwPI4L.js} +1 -1
  98. package/dist/client/index.html +1 -1
  99. package/package.json +1 -1
  100. package/plugin.json +1 -1
  101. package/skills/diffo/SKILL.md +6 -4
  102. package/dist/client/assets/architecture-7GRP2DOG-BFR0RRUB.js +0 -1
  103. package/dist/client/assets/channel-DqbS8I7B.js +0 -1
  104. package/dist/client/assets/csharp-oqKa8noW.js +0 -1
  105. package/dist/client/assets/css-CdtkT07m.js +0 -1
  106. package/dist/client/assets/css-LbU1hoFO.js +0 -1
  107. package/dist/client/assets/eventmodeling-NTZA5JFV-DmPAZ63r.js +0 -1
  108. package/dist/client/assets/flowDiagram-KWPJA3E3-8YgnZgsF.js +0 -1
  109. package/dist/client/assets/html-DDNsd9lV.js +0 -1
  110. package/dist/client/assets/index-C47xobM0.js +0 -93
  111. package/dist/client/assets/php-CQT4wx5i.js +0 -1
  112. package/dist/client/assets/railroad-abnf-HS5TGJTU-DnCwaKGs.js +0 -1
  113. package/dist/client/assets/railroad-ebnf-LZEXJU2U-Bn85hVcR.js +0 -1
  114. package/dist/client/assets/railroad-peg-WCYAUIDC-CHNLHRua.js +0 -1
  115. package/dist/client/assets/rust-Cfkwpbl8.js +0 -1
  116. package/dist/client/assets/sql-0Qcw9ht3.js +0 -1
  117. package/dist/client/assets/sql-CP0rg-5b.js +0 -1
  118. package/dist/client/assets/swimlanesDiagram-TC7HE7FX-CQzlAvK7.js +0 -8
package/dist/cli.mjs CHANGED
@@ -355,8 +355,12 @@ function buildConnectAsk(isDev, repoPath, home) {
355
355
  * Payloads must stand alone: an agent can reach a poll without the skill in
356
356
  * context (a fresh session, a compacted context), so every instruction to poll
357
357
  * restates how to hold the poll — attended, never detached. Mirrors the skill.
358
+ *
359
+ * "Has a background task" is not enough: Codex backgrounds a long command and
360
+ * ends its turn, and nothing wakes it when the poll returns. Only a task whose
361
+ * completion resumes the session counts; everyone else holds the turn open.
358
362
  */
359
- const POLL_STANCE = "a tracked background task if your harness has one, the foreground if not — never a detached process";
363
+ const POLL_STANCE = "a tracked background task when its completion wakes you on its own, so the reviewer can keep talking to you in chat meanwhile; if it would not, hold it in the foreground and do not end your turn while it runs — never a detached process";
360
364
  /**
361
365
  * The tab-title doctrine — the few words an agent hands its first poll, which
362
366
  * become the browser tab's name. Stated once and interpolated into every
@@ -393,6 +397,24 @@ function nextStepFor(kind, actionable) {
393
397
  function prOpenNote(worktree, pr) {
394
398
  return `this is pull request #${pr.number} by @${pr.author.login} — not your code. It is checked out at \`${worktree}\`; run your investigation from there (tests, grep, the code itself) and leave it as you found it. The reviewer's public comments go to GitHub when they finish; you never post there. \`${CLI} help agent\` has the pull-request section.`;
395
399
  }
400
+ /**
401
+ * Printed by `diffo <PR>` instead of opening when the pull request is the
402
+ * user's own and was not spelled `diffo pr <PR>`. The one name covers two
403
+ * reviews that teach the agent opposite things — a local branch review where
404
+ * the agent fixes the user's own work, or the GitHub pull request review where
405
+ * it drafts comments for an author — so the user decides, through the agent,
406
+ * before anything is checked out.
407
+ */
408
+ function ownPrAsk(target, pr, checkout) {
409
+ const base = `\`${CLI} --base ${pr.base.ref}\``;
410
+ const where = !checkout.sameRepo ? `${base} from a checkout of \`${pr.owner}/${pr.repo}\` on \`${pr.head.ref}\` (this checkout is a different repo)` : checkout.branch === pr.head.ref ? `${base}, right here` : `\`git checkout ${pr.head.ref}\` then ${base} (this checkout is on ${checkout.branch || "no branch"})`;
411
+ return [
412
+ `pull request #${pr.number} "${pr.title}" is yours (@${pr.viewer.login}), so nothing was opened: a pull request of your own names two different reviews, and the user picks.`,
413
+ ` - Branch review — local only, nothing touches GitHub: ${where}. The review is of the user's own work and the agent fixes what they flag.`,
414
+ ` - PR review — the GitHub pull request: \`${CLI} pr ${target}\`. Checked out in a worktree of its own; the agent is a copilot that drafts review comments, and the user's review posts to GitHub when they submit.`,
415
+ "ask: the commands above are for you, not the user. Say nothing about the CLI, exit codes, or that nothing opened — the user only reviews code. Ask exactly this, and nothing more: \"This pull request is yours. Branch review (local, I fix what you flag) or PR review (the GitHub pull request, I draft comments)?\" Then run the matching command. Someone who wants to fix their own changes means the branch review. Never pick for them."
416
+ ].join("\n");
417
+ }
396
418
  const ACK_NEXT_STEP = {
397
419
  reply: `When every thread is handled, run \`${CLI_COMMANDS.poll}\` again to keep listening (${POLL_STANCE}).`,
398
420
  replyMore: "Interim reply posted — the reviewer still sees you working on this thread. Post the follow-up as a plain reply (no --more) BEFORE your next poll: re-polling closes the batch and counts the promise as never kept.",
@@ -406,6 +428,15 @@ const ACK_NEXT_STEP = {
406
428
  };
407
429
  /** The pull-request section of `diffo help agent`. */
408
430
  const HELP_AGENT_PR = `Reviewing a pull request (\`diffo <PR URL | owner/repo#N | #N>\`):
431
+ - The user's own pull request is not opened: the CLI stops and prints two
432
+ commands — a branch review (\`diffo --base <base>\`: local, nothing touches
433
+ GitHub, you fix what they flag) or a PR review (\`diffo pr <PR>\`: the
434
+ GitHub pull request, you draft comments). The commands are for you, and so
435
+ is the stop: say nothing about the CLI or what did not open. Ask the user
436
+ exactly "This pull request is yours. Branch review (local, I fix what you
437
+ flag) or PR review (the GitHub pull request, I draft comments)?", then run
438
+ their choice. Never pick for them; fixing their own changes means the
439
+ branch review.
409
440
  - You did not write this code. It is checked out in a Diffo worktree whose
410
441
  path the open prints; work from there — run the tests, read the code — and
411
442
  leave it as you found it (\`git checkout -- .\`). Never commit or push.
@@ -1350,7 +1381,8 @@ The target:
1350
1381
  (the short forms resolve against this repo's origin)
1351
1382
 
1352
1383
  For the reviewer:
1353
- pr <target> Review a pull request (the same as \`diffo <target>\`;
1384
+ pr <target> Review a pull request (the same as \`diffo <target>\`,
1385
+ and the explicit answer for a pull request of your own;
1354
1386
  help pr explains the flow)
1355
1387
  status Show this repo's review server, if one is running
1356
1388
  (--json for a machine-readable answer)
@@ -1538,6 +1570,11 @@ reviews and comments are imported as threads; the agent you invite is a
1538
1570
  copilot for code it did not write. Your public comments post to GitHub as one
1539
1571
  review when you finish; nothing leaves before that.
1540
1572
 
1573
+ A pull request of your own is two reviews in one name, so \`diffo <PR>\` stops
1574
+ and asks which: a branch review (\`diffo --base <base>\` on the branch — local,
1575
+ nothing touches GitHub, your agent fixes what you flag) or a PR review
1576
+ (\`diffo pr <PR>\` — the GitHub pull request, your comments post when you submit).
1577
+
1541
1578
  Needs the GitHub CLI signed in: gh auth login --hostname <host>. Every GitHub
1542
1579
  call goes through your own gh; diffo holds no token.
1543
1580
 
@@ -1567,8 +1604,8 @@ Usage: diffo poll [--title "<what the change is>"]
1567
1604
 
1568
1605
  Blocks (streaming whitespace heartbeats) until the reviewer acts, then prints
1569
1606
  one JSON payload naming the review threads to act on, and exits. Run it
1570
- attended, a tracked background task or the foreground, never detached: a
1571
- payload that reaches a process nobody is listening to never reaches you.
1607
+ attended: ${POLL_STANCE}. A payload that reaches a process nobody is
1608
+ listening to never reaches you.
1572
1609
  Safe to re-run any time: feedback is held in the review itself, so
1573
1610
  nothing is lost when a poll is killed or times out; the next poll gets it.
1574
1611
 
@@ -1843,6 +1880,7 @@ function looksLikePr(word) {
1843
1880
  }
1844
1881
  function parseCliArgs(argv) {
1845
1882
  let target;
1883
+ let explicitPr = false;
1846
1884
  let rest = argv;
1847
1885
  if (argv[0] !== void 0 && !argv[0].startsWith("-")) {
1848
1886
  if (argv[0] === "help") return parseHelp(argv.slice(1));
@@ -1855,6 +1893,7 @@ function parseCliArgs(argv) {
1855
1893
  message: "pr needs a pull request: a URL, owner/repo#N, #N, or N"
1856
1894
  };
1857
1895
  target = argv[1];
1896
+ explicitPr = true;
1858
1897
  rest = argv.slice(2);
1859
1898
  } else if (VERBS.has(argv[0])) return parseVerb(argv[0], argv.slice(1));
1860
1899
  else {
@@ -1939,7 +1978,8 @@ function parseCliArgs(argv) {
1939
1978
  ...target !== void 0 ? { target } : {},
1940
1979
  port,
1941
1980
  open: !values["no-open"],
1942
- foreground: values.foreground === true
1981
+ foreground: values.foreground === true,
1982
+ explicitPr
1943
1983
  };
1944
1984
  }
1945
1985
  /**
@@ -8138,7 +8178,7 @@ function serverSpawnArgs(entry, execArgv, port, base, target) {
8138
8178
  const args = [
8139
8179
  ...execArgv,
8140
8180
  entry,
8141
- ...target !== void 0 ? [target] : [],
8181
+ ...target !== void 0 ? ["pr", target] : [],
8142
8182
  "--no-open",
8143
8183
  "--foreground"
8144
8184
  ];
@@ -9006,7 +9046,8 @@ if (command.kind === "telemetry") {
9006
9046
  }
9007
9047
  if (command.kind === "poll") {
9008
9048
  const port = await requireServer();
9009
- process.stderr.write("diffo: waiting for the reviewer. Keep this process attended: a tracked\nbackground task or the foreground, never detached. If it dies, just\nre-run it; feedback is held in the review and survives.\n");
9049
+ process.stderr.write(`diffo: waiting for the reviewer. Keep this process attended: ${POLL_STANCE}.\nIf it dies, just re-run it; feedback is held in the review and survives.
9050
+ `);
9010
9051
  try {
9011
9052
  const path = command.title === null ? "/api/agent/poll" : `/api/agent/poll?title=${encodeURIComponent(command.title)}`;
9012
9053
  const res = await fetch(apiUrl(port, path), { headers: sessionHeaders() });
@@ -9171,7 +9212,7 @@ function rebuildDevClient(foreground) {
9171
9212
  * there as an ordinary branch review, and the forge rides along so the server
9172
9213
  * can pull the conversation and post the reviewer's comments.
9173
9214
  */
9174
- async function openPullRequest(ref, baseOverride) {
9215
+ async function openPullRequest(target, ref, baseOverride, explicitPr) {
9175
9216
  const forge = new GhClient();
9176
9217
  const auth = await forge.authStatus(ref.host);
9177
9218
  if (!auth.ok) fail(auth.message);
@@ -9181,6 +9222,15 @@ async function openPullRequest(ref, baseOverride) {
9181
9222
  } catch (err) {
9182
9223
  fail(`could not read pull request #${ref.number} from ${ref.host}/${ref.owner}/${ref.repo}: ${err.message}`);
9183
9224
  }
9225
+ if (pr.viewer.isAuthor && !explicitPr) {
9226
+ const origin = parseRemoteUrl(getRemoteUrl(repoPath) ?? "");
9227
+ const sameRepo = origin !== null && origin.host === ref.host && origin.owner.toLowerCase() === ref.owner.toLowerCase() && origin.repo.toLowerCase() === ref.repo.toLowerCase();
9228
+ console.log(ownPrAsk(target, pr, {
9229
+ branch: getBranchName(repoPath),
9230
+ sameRepo
9231
+ }));
9232
+ process.exit(0);
9233
+ }
9184
9234
  if (pr.state !== "open") process.stderr.write(`diffo: pull request #${pr.number} is ${pr.state}, opening it read-mostly\n`);
9185
9235
  const mainRepo = mainRepoOf(repoPath);
9186
9236
  const db = new DiffoDb();
@@ -9212,7 +9262,7 @@ if (command.target !== void 0) {
9212
9262
  const parsed = parseTarget(command.target, getRemoteUrl(repoPath));
9213
9263
  if (!parsed.ok) fail(parsed.error);
9214
9264
  if (parsed.target.kind === "pr") {
9215
- prOpen = await openPullRequest(parsed.target.ref, command.spec.kind === "branch" ? command.spec.base.replace(/^origin\//, "") : void 0);
9265
+ prOpen = await openPullRequest(command.target, parsed.target.ref, command.spec.kind === "branch" ? command.spec.base.replace(/^origin\//, "") : void 0, command.explicitPr);
9216
9266
  root = prOpen.prepared.path;
9217
9267
  repoPath = resolve(root);
9218
9268
  spec = {
@@ -1 +1 @@
1
- import{m as e,t}from"./mermaid-parser.core-QCdEYrye.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-BvmeK_-w.js";import"./chunk-O7XYJQB3-DKVir5ql.js";import{n as i,r as a,t as o}from"./chunk-GTNCS2PH-DrLr4ax6.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-BRH8LAdQ.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=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 l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
1
+ import{m as e,t}from"./mermaid-parser.core-BrIOn0_H.js";import{n}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as r}from"./src-Dra0Xg0O.js";import"./chunk-O7XYJQB3-CFlDerCD.js";import{n as i,r as a,t as o}from"./chunk-GTNCS2PH-CGpv_nJF.js";import{t as s}from"./chunk-JWPE2WC7-DVXcaiue.js";import"./mermaid.core-DP4c5AXa.js";var c=e().RailroadAbnf.parser.LangiumParser,l=n(e=>{let t=e.alternatives.map(u);return t.length===1?t[0]:{type:`choice`,alternatives:t}},`transformAlternation`),u=n(e=>{let t=e.elements.map(f);return t.length===1?t[0]:{type:`sequence`,elements:t}},`transformConcatenation`),d=n(e=>{if(e.includes(`*`)){let[t,n]=e.split(`*`);return{min:t?parseInt(t,10):0,max:n?parseInt(n,10):1/0}}let t=parseInt(e,10);return{min:t,max:t}},`parseRepeat`),f=n(e=>{let t=p(e.primary);if(!e.repeat)return t;let{min:n,max:r}=d(e.repeat);return n===0&&r===1?{type:`optional`,element:t}:{type:`repetition`,element:t,min:n,max:r}},`transformElement`),p=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 l(e.element);case`AbnfOptionalGroup`:return{type:`optional`,element:l(e.element)};default:throw Error(`Unsupported ABNF primary node: ${e.$type}`)}},`transformPrimary`),m=n(e=>({name:e.name,definition:l(e.definition)}),`transformRule`),h=n(e=>{s(e,o),e.title&&o.setTitle(e.title),e.rules.map(e=>o.addRule(m(e)))},`populateDb`),g={parser:{parse:n(e=>{o.clear(),r.debug(`[ABNF Parser] Starting Langium parse`);let n=c.parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new t(n);let i=n.value;r.debug(`[ABNF Parser] Parsed rules:`,i.rules.length),h(i),r.debug(`[ABNF Parser] Parse complete`)},`parse`),parser:{yy:o}},db:o,renderer:a,styles:i};export{g as diagram};
@@ -1 +1 @@
1
- import{n as e,t}from"./path-fybaL0A-.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-D0R2sCr-.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i){if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
1
+ import{n as e,t}from"./path-fybaL0A-.js";import{a as n,c as r,d as i,f as a,i as o,l as s,m as c,n as l,o as u,p as d,r as f,u as p}from"./dist-BTwBvBOz.js";function m(e){return e.innerRadius}function h(e){return e.outerRadius}function g(e){return e.startAngle}function _(e){return e.endAngle}function v(e){return e&&e.padAngle}function y(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function b(e,t,n,r,i,a,o){var c=e-n,l=t-r,u=(o?a:-a)/d(c*c+l*l),f=u*l,p=-u*c,m=e+f,h=t+p,g=n+f,_=r+p,v=(m+g)/2,y=(h+_)/2,b=g-m,x=_-h,S=b*b+x*x,C=i-a,w=m*_-g*h,T=(x<0?-1:1)*d(s(0,C*C*S-w*w)),E=(w*x-b*T)/S,D=(-w*b-x*T)/S,O=(w*x+b*T)/S,k=(-w*b+x*T)/S,A=E-v,j=D-y,M=O-v,N=k-y;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-f,y01:-p,x11:E*(i/C-1),y11:D*(i/C-1)}}function x(){var s=m,x=h,S=e(0),C=null,w=g,T=_,E=v,D=null,O=t(k);function k(){var e,t,m=+s.apply(this,arguments),h=+x.apply(this,arguments),g=w.apply(this,arguments)-r,_=T.apply(this,arguments)-r,v=l(_-g),k=_>g;if(D||=e=O(),h<m&&(t=h,h=m,m=t),!(h>1e-12))D.moveTo(0,0);else if(v>c-1e-12)D.moveTo(h*u(g),h*a(g)),D.arc(0,0,h,g,_,!k),m>1e-12&&(D.moveTo(m*u(_),m*a(_)),D.arc(0,0,m,_,g,k));else{var A=g,j=_,M=g,N=_,P=v,F=v,I=E.apply(this,arguments)/2,L=I>1e-12&&(C?+C.apply(this,arguments):d(m*m+h*h)),R=p(l(h-m)/2,+S.apply(this,arguments)),z=R,B=R,V,H;if(L>1e-12){var U=o(L/m*a(I)),W=o(L/h*a(I));(P-=U*2)>1e-12?(U*=k?1:-1,M+=U,N-=U):(P=0,M=N=(g+_)/2),(F-=W*2)>1e-12?(W*=k?1:-1,A+=W,j-=W):(F=0,A=j=(g+_)/2)}var G=h*u(A),K=h*a(A),q=m*u(N),J=m*a(N);if(R>1e-12){var Y=h*u(j),X=h*a(j),Z=m*u(M),Q=m*a(M),$;if(v<i){if($=y(G,K,Z,Q,Y,X,q,J)){var ee=G-$[0],te=K-$[1],ne=Y-$[0],re=X-$[1],ie=1/a(f((ee*ne+te*re)/(d(ee*ee+te*te)*d(ne*ne+re*re)))/2),ae=d($[0]*$[0]+$[1]*$[1]);z=p(R,(m-ae)/(ie-1)),B=p(R,(h-ae)/(ie+1))}else z=B=0}}F>1e-12?B>1e-12?(V=b(Z,Q,G,K,h,B,k),H=b(Y,X,q,J,h,B,k),D.moveTo(V.cx+V.x01,V.cy+V.y01),B<R?D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,B,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,h,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),!k),D.arc(H.cx,H.cy,B,n(H.y11,H.x11),n(H.y01,H.x01),!k))):(D.moveTo(G,K),D.arc(0,0,h,A,j,!k)):D.moveTo(G,K),!(m>1e-12)||!(P>1e-12)?D.lineTo(q,J):z>1e-12?(V=b(q,J,Y,X,m,-z,k),H=b(G,K,Z,Q,m,-z,k),D.lineTo(V.cx+V.x01,V.cy+V.y01),z<R?D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(H.y01,H.x01),!k):(D.arc(V.cx,V.cy,z,n(V.y01,V.x01),n(V.y11,V.x11),!k),D.arc(0,0,m,n(V.cy+V.y11,V.cx+V.x11),n(H.cy+H.y11,H.cx+H.x11),k),D.arc(H.cx,H.cy,z,n(H.y11,H.x11),n(H.y01,H.x01),!k))):D.arc(0,0,m,N,M,k)}if(D.closePath(),e)return D=null,e+``||null}return k.centroid=function(){var e=(+s.apply(this,arguments)+ +x.apply(this,arguments))/2,t=(+w.apply(this,arguments)+ +T.apply(this,arguments))/2-i/2;return[u(t)*e,a(t)*e]},k.innerRadius=function(t){return arguments.length?(s=typeof t==`function`?t:e(+t),k):s},k.outerRadius=function(t){return arguments.length?(x=typeof t==`function`?t:e(+t),k):x},k.cornerRadius=function(t){return arguments.length?(S=typeof t==`function`?t:e(+t),k):S},k.padRadius=function(t){return arguments.length?(C=t==null?null:typeof t==`function`?t:e(+t),k):C},k.startAngle=function(t){return arguments.length?(w=typeof t==`function`?t:e(+t),k):w},k.endAngle=function(t){return arguments.length?(T=typeof t==`function`?t:e(+t),k):T},k.padAngle=function(t){return arguments.length?(E=typeof t==`function`?t:e(+t),k):E},k.context=function(e){return arguments.length?(D=e??null,k):D},k}export{x as t};
@@ -0,0 +1 @@
1
+ import"./chunk-FOHPRMQF-DzxwRta7.js";import{M as e}from"./mermaid-parser.core-BrIOn0_H.js";export{e as createArchitectureServices};