@bridge_gpt/mcp-server 0.2.74 → 0.2.76

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 (102) hide show
  1. package/README.md +14 -7
  2. package/build/agent-launchers/prompt.js +9 -21
  3. package/build/agents.generated.js +6 -6
  4. package/build/authored-plan.js +542 -0
  5. package/build/bridge-permissions.js +8 -0
  6. package/build/codex-auto-recovery.js +25 -7
  7. package/build/commands.generated.js +7 -7
  8. package/build/conductor/bridge-api-client.js +807 -52
  9. package/build/conductor/declare-blocked.js +4 -0
  10. package/build/conductor/driver-pass.js +8 -0
  11. package/build/conductor/epic-implementer-cli.js +341 -96
  12. package/build/conductor/epic-server-journal.js +13 -0
  13. package/build/conductor/epic-server-recipe.js +15 -5
  14. package/build/conductor/epic-server-runtime.js +163 -45
  15. package/build/conductor/epic-server.js +13 -6
  16. package/build/conductor/gate-discovery.js +209 -9
  17. package/build/conductor/gate-settings-review.js +7 -11
  18. package/build/conductor/install-doctor.js +30 -2
  19. package/build/conductor/launch-plan.js +58 -12
  20. package/build/conductor/local-merge.js +54 -12
  21. package/build/conductor/open-decision-phrases.js +50 -0
  22. package/build/conductor/pr-ci-producer.js +12 -3
  23. package/build/conductor/prerequisite-inputs.js +181 -14
  24. package/build/conductor/readiness-sections.js +46 -13
  25. package/build/conductor/readiness.js +3 -40
  26. package/build/conductor/recovery-cli.js +12 -12
  27. package/build/conductor/repository-workflow-remedy.js +147 -7
  28. package/build/conductor/ui-readiness.js +224 -0
  29. package/build/conductor/wait-run-attention.js +9 -4
  30. package/build/conductor/wait-run-cli.js +9 -2
  31. package/build/connect-github-api.js +18 -0
  32. package/build/connect-github.js +35 -18
  33. package/build/docs.generated.js +3 -3
  34. package/build/drive-epic.js +787 -37
  35. package/build/epic-ci-workflow.js +3 -2
  36. package/build/epic-implementer-bin.js +200 -66
  37. package/build/epic-implementer-bundle-cli.js +61 -0
  38. package/build/epic-implementer-claude-hook-bin.js +1 -1
  39. package/build/epic-implementer-env.js +3 -4
  40. package/build/epic-integration-pr.js +5 -2
  41. package/build/epic-launch-context.js +8 -1
  42. package/build/epic-shared/cut-protocol.js +55 -3
  43. package/build/executor/completion-contract.js +24 -1
  44. package/build/executor/failure-reason-codes.js +2 -0
  45. package/build/executor/gate-qualification-job.js +193 -23
  46. package/build/executor/gate-qualification-tests-ran.js +232 -0
  47. package/build/executor/integration-job.js +56 -2
  48. package/build/executor/job-runner.js +13 -723
  49. package/build/executor/job-type-wrappers.js +734 -0
  50. package/build/executor/merge-job.js +45 -1
  51. package/build/executor/permissions.js +187 -2
  52. package/build/executor/preflight.js +6 -2
  53. package/build/executor/process-containment.js +8 -1
  54. package/build/executor/provider-checks.js +28 -5
  55. package/build/executor/reconcile-overlap-job.js +70 -17
  56. package/build/executor/required-verification.js +28 -2
  57. package/build/executor/required-work-ledger.js +7 -2
  58. package/build/executor/resume-pre-spawn.js +32 -8
  59. package/build/executor/runner.js +30 -5
  60. package/build/executor/types.js +9 -0
  61. package/build/executor/worker-database.js +6 -1
  62. package/build/executor/worker-guard-hook.js +24 -2
  63. package/build/executor/worktree.js +12 -1
  64. package/build/generated/ticket-status.js +20 -0
  65. package/build/index.js +627 -551
  66. package/build/init.js +16 -0
  67. package/build/install-bridge-conductor-answers.js +32 -1
  68. package/build/install-bridge-conductor-apply.js +21 -3
  69. package/build/install-bridge-conductor-assessment.js +185 -12
  70. package/build/install-bridge-conductor-compact.js +2 -0
  71. package/build/install-bridge-conductor-contracts.js +9 -1
  72. package/build/install-bridge-conductor-gate.js +257 -80
  73. package/build/install-bridge-conductor-setup.js +106 -6
  74. package/build/install-bridge-conductor-trial-report.js +170 -0
  75. package/build/install-bridge-conductor.js +740 -124
  76. package/build/mcp-host-config.js +54 -37
  77. package/build/phase-context-git-probe.js +16 -0
  78. package/build/pipelines.generated.js +15 -15
  79. package/build/plan-execution-ledger.js +27 -0
  80. package/build/plan-generation.js +17 -0
  81. package/build/plane/plane-freshness.js +43 -26
  82. package/build/printed-remedy-commands.js +62 -0
  83. package/build/readme.generated.js +1 -1
  84. package/build/repository-toolchains.js +11 -5
  85. package/build/scripts/saved-commands-config-field-driver.js +65 -0
  86. package/build/secret-redaction.js +3 -0
  87. package/build/setup-epic.js +51 -9
  88. package/build/test-support/create-preview-world.js +232 -0
  89. package/build/test-support/executor-source-files.js +1 -1
  90. package/build/ticket-delivery.js +65 -0
  91. package/build/v2-readiness-requirements.js +13 -4
  92. package/build/version.generated.js +3 -3
  93. package/build/worker-guard-hook-bin.js +2 -2
  94. package/build/worktree-core.js +51 -7
  95. package/docs/EPIC-IMPLEMENTER.md +83 -4
  96. package/docs/epic-implementer/getting-started.md +1 -1
  97. package/docs/install/github-app.md +79 -92
  98. package/package.json +1 -1
  99. package/pipelines/implement-ticket.json +2 -2
  100. package/build/conductor/epic-reconcile.js +0 -603
  101. package/build/conductor/epic-runtime.js +0 -2020
  102. package/build/conductor/epic-state.js +0 -774
@@ -4,11 +4,14 @@
4
4
  * The whole point of this command is that it needs no Bridge web session: a user who has
5
5
  * a Bridge API key can connect GitHub without ever opening the setup UI. The flow is
6
6
  *
7
- * mint → browser (install on GitHub) → poll → pick a repository → confirm
7
+ * mint → browser (sign in to GitHub, prove access, confirm) → poll → pick a
8
+ * repository → confirm
8
9
  *
9
10
  * and the browser half authenticates to *GitHub*, not to Bridge. Bridge never asks for,
10
11
  * accepts, echoes, or transports a GitHub credential. The only thing crossing between
11
12
  * the browser and this process is a Bridge-issued state nonce, held in memory.
13
+ * BAPI-1697: the browser page proves the person can change at least one repository of
14
+ * the installation, and candidates are limited to those repositories.
12
15
  *
13
16
  * Two properties are load-bearing and easy to erode:
14
17
  *
@@ -33,9 +36,10 @@ const USAGE = `Usage: connect-github [--repo <repo_name>] [--handoff | --resume
33
36
 
34
37
  Connect a GitHub repository to a Bridge project from your terminal.
35
38
 
36
- Opens the GitHub App install page in your browser, waits for you to install it,
37
- then asks which repository to connect. You are never asked for a GitHub token or
38
- password — you authenticate to GitHub in the browser.
39
+ Opens a Bridge page in your browser. You sign in to GitHub there, choose or install
40
+ the GitHub App installation, and confirm. Bridge connects only repositories you can
41
+ change on GitHub. Then this command asks which repository to connect. You are never
42
+ asked for a GitHub token or password — you authenticate to GitHub in the browser.
39
43
 
40
44
  If you do not administer the GitHub organization yourself, use the delegated
41
45
  handoff: mint a link with --handoff, send it to whoever does, and finish with
@@ -44,7 +48,7 @@ handoff: mint a link with --handoff, send it to whoever does, and finish with
44
48
  Options:
45
49
  --repo <repo_name> Bridge project to connect (inferred from this directory
46
50
  when omitted; you will be asked to confirm).
47
- --handoff Print a shareable install link (valid 72 hours) instead of
51
+ --handoff Print a shareable connect link (valid 72 hours) instead of
48
52
  connecting here. Does not open a browser or wait.
49
53
  --resume Look up an outstanding handoff and finish connecting it.
50
54
  Works from any machine holding this project's API key.
@@ -280,7 +284,7 @@ export async function openGithubInstallPage(deps, installUrl) {
280
284
  // ---------------------------------------------------------------------------
281
285
  const STEPS = [
282
286
  "Connect GitHub",
283
- "Complete GitHub in browser",
287
+ "Sign in to GitHub and confirm in browser",
284
288
  "Verify connection",
285
289
  "Choose repository",
286
290
  "Confirm connection",
@@ -298,7 +302,8 @@ function candidateLabel(c) {
298
302
  const OUTCOME_MESSAGES = {
299
303
  expired: "The connection request expired before GitHub reported back. Run connect-github again.",
300
304
  invalid: "This connection request is no longer valid. Run connect-github again.",
301
- "verification-failed": "Bridge could not verify the GitHub installation. Run connect-github again.",
305
+ "verification-failed": "Bridge could not confirm your GitHub access to that installation. You need push " +
306
+ "access to at least one of its repositories. Run connect-github again.",
302
307
  "no-repositories": "The GitHub App installation did not include any repositories Bridge can access. " +
303
308
  "Re-run connect-github and grant access to at least one repository.",
304
309
  conflict: "This GitHub installation or project is already connected to a different Bridge " +
@@ -315,6 +320,17 @@ const FAILURE_MESSAGES = {
315
320
  deadline: "Timed out waiting for GitHub. If you completed the install, run connect-github again " +
316
321
  "to pick up the connection.",
317
322
  };
323
+ /**
324
+ * Show who proved GitHub access before the admin picks a repository (BAPI-1697).
325
+ *
326
+ * Both values come from the server's stored proof and were validated as GitHub logins
327
+ * by the parser. Nothing is printed when either is missing (an older server).
328
+ */
329
+ function reportProvenIdentity(deps, login, account) {
330
+ if (!login || !account)
331
+ return;
332
+ deps.stderr(`GitHub access confirmed by ${login} for the ${account} account.`);
333
+ }
318
334
  /** The no-connection-made framing, used for every unsuccessful terminal path. */
319
335
  function reportNoConnection(deps, detail) {
320
336
  deps.stderr("");
@@ -397,8 +413,8 @@ export async function runGithubConnectionFlow(deps, api, repoName) {
397
413
  deps.stderr("Your request to install the GitHub App was sent to an organization owner for approval.");
398
414
  deps.stderr("That approval happens on GitHub and does not return here, so this command cannot " +
399
415
  "wait for it.");
400
- deps.stderr("Once an owner approves the install, finish the connection with the manual steps in " +
401
- "the GitHub App setup guide (docs/install/github-app.md).");
416
+ deps.stderr("Once an owner approves the install, run connect-github again to finish the connection. " +
417
+ "See the GitHub App setup guide (docs/install/github-app.md).");
402
418
  return 1;
403
419
  }
404
420
  if (result.status === "connected") {
@@ -413,6 +429,7 @@ export async function runGithubConnectionFlow(deps, api, repoName) {
413
429
  if (candidates.length === 0) {
414
430
  return reportNoConnection(deps, OUTCOME_MESSAGES["no-repositories"]);
415
431
  }
432
+ reportProvenIdentity(deps, result.provenGithubLogin, result.provenGithubAccount);
416
433
  renderStep(deps, 3);
417
434
  const selected = await chooseCandidate(deps, candidates);
418
435
  if (!selected)
@@ -460,8 +477,8 @@ export async function runGithubHandoffMintFlow(deps, api, repoName) {
460
477
  deps.stderr("");
461
478
  deps.stderr(`Send this link to whoever administers your GitHub organization.`);
462
479
  deps.stderr(`It works once and expires ${formatExpiry(minted.value.expiresAt)}.`);
463
- deps.stderr("They'll finish in their browser — ask them to ping you, then run " +
464
- "`connect-github --resume`.");
480
+ deps.stderr("They'll sign in to GitHub and confirm in their browser — ask them to ping you, " +
481
+ "then run `connect-github --resume`.");
465
482
  return 0;
466
483
  }
467
484
  /** Render an expiry for humans without pretending to know the reader's locale. */
@@ -489,7 +506,8 @@ const HANDOFF_STATUS_MESSAGES = {
489
506
  pending: "Nobody has completed the link yet. Ask them to open it, then run connect-github --resume again.",
490
507
  expired: "The link expired before it was used. Run connect-github --handoff to create a new one.",
491
508
  revoked: "This link was revoked. Run connect-github --handoff to create a new one.",
492
- "verification-failed": "Bridge could not verify the GitHub installation. Run connect-github --handoff to create a new link.",
509
+ "verification-failed": "Bridge could not confirm GitHub access for this link, or the confirmation is more " +
510
+ "than 72 hours old. Run connect-github --handoff to create a new link.",
493
511
  "no-repositories": "The GitHub App installation did not include any repositories Bridge can access. " +
494
512
  "Create a new link with connect-github --handoff and ask them to grant access to at least one repository.",
495
513
  conflict: "This GitHub installation or project is already connected to a different Bridge " +
@@ -572,14 +590,12 @@ export async function runGithubHandoffResumeFlow(deps, api, repoName) {
572
590
  if (selected.status !== "staged") {
573
591
  const message = HANDOFF_STATUS_MESSAGES[selected.status] ?? HANDOFF_STATUS_MESSAGES.failed;
574
592
  if (selected.status === "pending" || selected.status === "expired") {
575
- // AC-8 fallback. Bridge cannot safely discover an existing installation on an org
576
- // it was never called back about, so this deliberately does NOT claim to have
577
- // detected one — it points at the documented manual path instead.
593
+ // AC-8 (BAPI-1697): an existing installation no longer dead-ends. The link signs
594
+ // the recipient in to GitHub first and offers the installations they can change.
578
595
  deps.stderr("");
579
596
  deps.stderr(message);
580
- deps.stderr("If the GitHub App is already installed on that organization, GitHub may not " +
581
- "send Bridge a callback at all. In that case follow the manual installation-ID " +
582
- "steps in the GitHub App setup guide (docs/install/github-app.md).");
597
+ deps.stderr("If the GitHub App is already installed on that organization, the same link " +
598
+ "still works: it asks them to sign in to GitHub and choose the installation.");
583
599
  // `pending` is a live state, not a failure; `expired` is terminal.
584
600
  return selected.status === "pending" ? 0 : 1;
585
601
  }
@@ -591,6 +607,7 @@ export async function runGithubHandoffResumeFlow(deps, api, repoName) {
591
607
  if (candidates.length === 0) {
592
608
  return reportNoConnection(deps, OUTCOME_MESSAGES["no-repositories"]);
593
609
  }
610
+ reportProvenIdentity(deps, selected.provenGithubLogin, selected.provenGithubAccount);
594
611
  const chosen = await chooseCandidate(deps, candidates);
595
612
  if (!chosen)
596
613
  return 1;