@straiffi/archon 1.8.7 → 1.8.8

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 (68) hide show
  1. package/dist/client/assets/{ActivityView-D4Qh96zr.js → ActivityView--4X_m6mR.js} +1 -1
  2. package/dist/client/assets/{GitHubActionsDialog-Bg03OmVv.js → GitHubActionsDialog-DZ1lHM01.js} +1 -1
  3. package/dist/client/assets/{RepositoryGraphDialog-CS_hOqPw.js → RepositoryGraphDialog-B--YlQcV.js} +1 -1
  4. package/dist/client/assets/{VerificationDialog-BYH-Ek8n.js → VerificationDialog-BIWPtBg3.js} +1 -1
  5. package/dist/client/assets/{architectureDiagram-3BPJPVTR-2lxabjSl.js → architectureDiagram-3BPJPVTR-CY5xTOZJ.js} +1 -1
  6. package/dist/client/assets/{blockDiagram-GPEHLZMM-C80HvJmb.js → blockDiagram-GPEHLZMM-DkMi7gMh.js} +1 -1
  7. package/dist/client/assets/{c4Diagram-AAUBKEIU-BM3k_lKz.js → c4Diagram-AAUBKEIU-ZZxXBBU4.js} +1 -1
  8. package/dist/client/assets/channel-b2AN-U3x.js +1 -0
  9. package/dist/client/assets/{chunk-2J33WTMH-BTk3lX07.js → chunk-2J33WTMH-C9PiKMs-.js} +1 -1
  10. package/dist/client/assets/{chunk-3OPIFGDE-DAxdBZ_4.js → chunk-3OPIFGDE-B81aUmvi.js} +1 -1
  11. package/dist/client/assets/{chunk-5ZQYHXKU-BYm9s62a.js → chunk-5ZQYHXKU-Bk2Owm90.js} +1 -1
  12. package/dist/client/assets/{chunk-727SXJPM-iVUM8xuV.js → chunk-727SXJPM-Bx-79aJk.js} +1 -1
  13. package/dist/client/assets/{chunk-AQP2D5EJ-DVM7riMJ.js → chunk-AQP2D5EJ-GQNXYOf0.js} +1 -1
  14. package/dist/client/assets/{chunk-CSCIHK7Q-_D1FzP9B.js → chunk-CSCIHK7Q-BV22j6vn.js} +1 -1
  15. package/dist/client/assets/{chunk-KSCS5N6A-D3XouAHf.js → chunk-KSCS5N6A-C9LlcbWv.js} +1 -1
  16. package/dist/client/assets/{chunk-L5ZTLDWV-B7NYWgT4.js → chunk-L5ZTLDWV-D8PJqJnh.js} +1 -1
  17. package/dist/client/assets/{chunk-LZXEDZCA-Dgkkbb6A.js → chunk-LZXEDZCA-DcbPPozR.js} +2 -2
  18. package/dist/client/assets/{chunk-ND2GUHAM-CzO1oVCi.js → chunk-ND2GUHAM-NV-_2KqZ.js} +1 -1
  19. package/dist/client/assets/{chunk-NZK2D7GU-re0VVZne.js → chunk-NZK2D7GU-CbqA26gb.js} +1 -1
  20. package/dist/client/assets/{chunk-O5CBEL6O-BwsS59iy.js → chunk-O5CBEL6O-B0DMN44B.js} +1 -1
  21. package/dist/client/assets/{chunk-WU5MYG2G-CLyh-xCA.js → chunk-WU5MYG2G-CYpcnwf9.js} +1 -1
  22. package/dist/client/assets/classDiagram-4FO5ZUOK-C0exS5oM.js +1 -0
  23. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DkB9dQZ1.js +1 -0
  24. package/dist/client/assets/{dagre-BM42HDAG-x71fYlqQ.js → dagre-BM42HDAG-B5HD9fyK.js} +1 -1
  25. package/dist/client/assets/{diagram-2AECGRRQ-CMdwzuYj.js → diagram-2AECGRRQ-BCXvWFpM.js} +1 -1
  26. package/dist/client/assets/{diagram-5GNKFQAL-B3l6I4qJ.js → diagram-5GNKFQAL-CSpWGfAO.js} +1 -1
  27. package/dist/client/assets/{diagram-KO2AKTUF-BNhypLBW.js → diagram-KO2AKTUF-CFECGppT.js} +1 -1
  28. package/dist/client/assets/{diagram-LMA3HP47-CmrhbiDt.js → diagram-LMA3HP47-Dpb99QbZ.js} +1 -1
  29. package/dist/client/assets/{diagram-OG6HWLK6-CRobDMLl.js → diagram-OG6HWLK6-DJcTGnx0.js} +1 -1
  30. package/dist/client/assets/{erDiagram-TEJ5UH35-CqO7K0TS.js → erDiagram-TEJ5UH35-jWArJxNU.js} +1 -1
  31. package/dist/client/assets/{flowDiagram-I6XJVG4X-CuLTJZU0.js → flowDiagram-I6XJVG4X-DDF3P1hY.js} +1 -1
  32. package/dist/client/assets/{ganttDiagram-6RSMTGT7-Bm7v1eRG.js → ganttDiagram-6RSMTGT7-Corwr_18.js} +1 -1
  33. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-CNHZr-5i.js → gitGraphDiagram-PVQCEYII-WzlpszWn.js} +1 -1
  34. package/dist/client/assets/index-Dy-7h3lN.js +274 -0
  35. package/dist/client/assets/{infoDiagram-5YYISTIA-z27pUr2X.js → infoDiagram-5YYISTIA-C0VwTwNC.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-CDocZ0jf.js → ishikawaDiagram-YF4QCWOH-m9l3k2qX.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-JHISSGLW-CgP31lsU.js → journeyDiagram-JHISSGLW-DMhT8HTW.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-UN3LZRKU-DxTm1_fc.js → kanban-definition-UN3LZRKU-C2ZkcOi0.js} +1 -1
  39. package/dist/client/assets/{line-hrZ7m44_.js → line-gKkUdUWR.js} +1 -1
  40. package/dist/client/assets/{mermaid-parser.core-BThJAIK-.js → mermaid-parser.core-DdBfJWbP.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-CfVyP_kK.js → mermaid.core-DXnhq-eu.js} +3 -3
  42. package/dist/client/assets/{mindmap-definition-RKZ34NQL-CuISnLgW.js → mindmap-definition-RKZ34NQL-B0gX4aJy.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-4H26LBE5-DnWAdd44.js → pieDiagram-4H26LBE5-BHYdLmpx.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-Cb-RVl5A.js → quadrantDiagram-W4KKPZXB-C-H-yQwU.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-4Y6WPE33-DrXg_gCS.js → requirementDiagram-4Y6WPE33-DY_pSCFy.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-DzZjp_ZP.js → sankeyDiagram-5OEKKPKP-CC61HRGf.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-CQJ3PhQD.js → sequenceDiagram-3UESZ5HK-B8fXWNxw.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-AJRCARHV-B16j9pg1.js → stateDiagram-AJRCARHV-C_VYKsXW.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Ctk1r914.js +1 -0
  50. package/dist/client/assets/{timeline-definition-PNZ67QCA-bUG3mZQt.js → timeline-definition-PNZ67QCA-0fB4PIIX.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-CIIHVFJN-DALCJcZD.js → vennDiagram-CIIHVFJN-CfpVF7Aa.js} +1 -1
  52. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-DPQd3l9A.js → wardleyDiagram-YWT4CUSO-CgdK4FcC.js} +1 -1
  53. package/dist/client/assets/{xychartDiagram-2RQKCTM6-BIv1FqXG.js → xychartDiagram-2RQKCTM6-BEfatQYR.js} +1 -1
  54. package/dist/client/index.html +1 -1
  55. package/dist/server/index.js +41 -36
  56. package/dist/server/index.js.map +1 -1
  57. package/dist/server/lib/git.js +302 -11
  58. package/dist/server/lib/git.js.map +1 -1
  59. package/dist/server/lib/integrations/github.js +135 -65
  60. package/dist/server/lib/integrations/github.js.map +1 -1
  61. package/dist/server/lib/integrations/importedIssueImages.js +10 -15
  62. package/dist/server/lib/integrations/importedIssueImages.js.map +1 -1
  63. package/package.json +1 -1
  64. package/dist/client/assets/channel-HjENOCZ0.js +0 -1
  65. package/dist/client/assets/classDiagram-4FO5ZUOK-DnhdaVrK.js +0 -1
  66. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-C-BjeSGJ.js +0 -1
  67. package/dist/client/assets/index-LGNsdNYM.js +0 -274
  68. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-vNiFfHwm.js +0 -1
@@ -21,7 +21,7 @@ import { resolveSessionTargetForExecution } from './lib/sessionTargets.js';
21
21
  import { createChatMessage, getChatMessage, updateChatMessageContent } from './lib/chatMessages.js';
22
22
  import { attachChatTicketProposalsToMessageContent } from './lib/chatTicketProposals.js';
23
23
  import { createCorsOriginResolver, parseCorsOrigins } from './lib/cors.js';
24
- import { abortGitOperation, branchExistsLocally, commitGitChanges, createWorktreeAsync, deleteWorktree, getBundleReviewDiffForCwd, getGitDiffData, getGitDiffFiles, getGitStatus, getGitUnifiedDiff, getLocalProjectBranch, getProjectBranch, getProjectBranchSuggestions, getSelectedGitUnifiedDiff, getUnpushedCommitDiffForCwd, getUnpushedCommitSummaryForCwd, hasKnownBranchRef, listUnpushedCommitsForCwd, pullGitBranch, pushCurrentBranch, rebaseGitBranchOntoBase, resolveExistingWorktreePath, resolveWorktreePath, squashUnpushedCommitsForCwd, summarizeTicketDiffFiles, switchProjectBranch, syncWorktreeFilesAsync, undoLatestUnpushedCommitForCwd, UnpushedCommitDiffSelectionError } from './lib/git.js';
24
+ import { abortGitOperation, branchExistsLocally, commitGitChanges, createWorktreeAsync, deleteWorktree, getBundleReviewDiffForCwd, getGitDiffDataAsync, getGitDiffFiles, getGitStatus, getGitStatusAsync, getGitUnifiedDiff, getGitUnifiedDiffAsync, getLocalProjectBranch, getProjectBranch, getProjectBranchSuggestions, getSelectedGitUnifiedDiff, getUnpushedCommitDiffForCwd, getUnpushedCommitSummaryForCwd, getUnpushedCommitSummaryForCwdAsync, hasKnownBranchRef, listUnpushedCommitsForCwd, pullGitBranch, pushCurrentBranch, rebaseGitBranchOntoBase, resolveExistingWorktreePath, resolveWorktreePath, squashUnpushedCommitsForCwd, summarizeTicketDiffFiles, switchProjectBranch, syncWorktreeFilesAsync, undoLatestUnpushedCommitForCwd, UnpushedCommitDiffSelectionError } from './lib/git.js';
25
25
  import config from './lib/config.js';
26
26
  import { autoConfigProject, ProjectAutoConfigError } from './lib/projectAutoConfig.js';
27
27
  import { analyzeRepoPath, createInitialCommit, ensureInitialCommitForWorktrees, initializeGitRepo, isInitialCommitRequiredError, } from './lib/projectRepos.js';
@@ -1446,8 +1446,8 @@ const bundlePullRequestDiscoveryErrorTimestamps = new Map();
1446
1446
  const bundlePullRequestSyncInFlight = new Map();
1447
1447
  const bundlePullRequestSyncErrorTimestamps = new Map();
1448
1448
  const getBundlePullRequestDiscoveryKey = (projectId, bundleId) => `${projectId}:${bundleId}`;
1449
- const startPassiveGitHubWork = (label, callback) => {
1450
- setImmediate(() => {
1449
+ const startPassiveGitHubWork = (response, label, callback) => {
1450
+ const start = () => setImmediate(() => {
1451
1451
  try {
1452
1452
  callback();
1453
1453
  }
@@ -1455,6 +1455,11 @@ const startPassiveGitHubWork = (label, callback) => {
1455
1455
  console.warn(`[integrations] github passive work failed ${label}`, error);
1456
1456
  }
1457
1457
  });
1458
+ if (response.writableFinished) {
1459
+ start();
1460
+ return;
1461
+ }
1462
+ response.once('finish', start);
1458
1463
  };
1459
1464
  const isBundlePullRequestDiscoveryCoolingDown = (timestamps, key, cooldownMs) => {
1460
1465
  const lastAttemptAt = timestamps.get(key);
@@ -2019,7 +2024,7 @@ const buildBundleTickets = (projectId, bundleId, broadcaster) => {
2019
2024
  value: details,
2020
2025
  };
2021
2026
  };
2022
- const getCurrentReviewWorkspaceSignature = (ticket) => {
2027
+ const getCurrentReviewWorkspaceSignature = async (ticket) => {
2023
2028
  if (!ticket) {
2024
2029
  return null;
2025
2030
  }
@@ -2027,9 +2032,9 @@ const getCurrentReviewWorkspaceSignature = (ticket) => {
2027
2032
  if ('error' in workspace) {
2028
2033
  return null;
2029
2034
  }
2030
- return getGitStatus(workspace.cwd, workspace.branch, workspace.project).workspace_signature ?? null;
2035
+ return (await getGitStatusAsync(workspace.cwd, workspace.branch, workspace.project)).workspace_signature ?? null;
2031
2036
  };
2032
- const getCurrentReviewDiffSignature = (ticket) => {
2037
+ const getCurrentReviewDiffSignature = async (ticket) => {
2033
2038
  if (!ticket) {
2034
2039
  return null;
2035
2040
  }
@@ -2037,9 +2042,9 @@ const getCurrentReviewDiffSignature = (ticket) => {
2037
2042
  if ('error' in workspace) {
2038
2043
  return null;
2039
2044
  }
2040
- return computeDiffSignature(getGitUnifiedDiff(workspace.cwd));
2045
+ return computeDiffSignature(await getGitUnifiedDiffAsync(workspace.cwd));
2041
2046
  };
2042
- const getBundleReviewFindings = (projectId, bundleId) => {
2047
+ const getBundleReviewFindings = async (projectId, bundleId) => {
2043
2048
  const bundle = getBundle(bundleId, projectId);
2044
2049
  if (!bundle) {
2045
2050
  return null;
@@ -2070,13 +2075,13 @@ const getBundleReviewFindings = (projectId, bundleId) => {
2070
2075
  return buildReviewFindingsResponse({
2071
2076
  context,
2072
2077
  isContextRunning: tickets.some(ticket => ticket.agent_status === 'running'),
2073
- currentWorkspaceSignature: getCurrentReviewWorkspaceSignature(representativeTicket),
2078
+ currentWorkspaceSignature: await getCurrentReviewWorkspaceSignature(representativeTicket),
2074
2079
  currentDiffSignature: latestReviewRun && latestReviewRun.workspace_signature === null
2075
- ? getCurrentReviewDiffSignature(representativeTicket)
2080
+ ? await getCurrentReviewDiffSignature(representativeTicket)
2076
2081
  : null,
2077
2082
  });
2078
2083
  };
2079
- const getTicketReviewFindings = (ticketId) => {
2084
+ const getTicketReviewFindings = async (ticketId) => {
2080
2085
  const ticket = getTicketRouteContext(ticketId);
2081
2086
  if (!ticket) {
2082
2087
  return null;
@@ -2090,9 +2095,9 @@ const getTicketReviewFindings = (ticketId) => {
2090
2095
  return buildReviewFindingsResponse({
2091
2096
  context,
2092
2097
  isContextRunning: ticket.agent_status === 'running',
2093
- currentWorkspaceSignature: getCurrentReviewWorkspaceSignature(ticket),
2098
+ currentWorkspaceSignature: await getCurrentReviewWorkspaceSignature(ticket),
2094
2099
  currentDiffSignature: latestReviewRun && latestReviewRun.workspace_signature === null
2095
- ? getCurrentReviewDiffSignature(ticket)
2100
+ ? await getCurrentReviewDiffSignature(ticket)
2096
2101
  : null,
2097
2102
  });
2098
2103
  };
@@ -2739,7 +2744,7 @@ app.post('/projects/:id/chat-sessions/:sessionId/stop', async (req, res) => {
2739
2744
  }
2740
2745
  return res.status(result.status).json(result.value);
2741
2746
  });
2742
- app.get('/projects/:id/chat-sessions/:sessionId/diff', (req, res) => {
2747
+ app.get('/projects/:id/chat-sessions/:sessionId/diff', async (req, res) => {
2743
2748
  const project = getProjectById(req.params.id);
2744
2749
  if (!project) {
2745
2750
  return res.status(404).json({ error: 'Not found' });
@@ -2752,14 +2757,14 @@ app.get('/projects/:id/chat-sessions/:sessionId/diff', (req, res) => {
2752
2757
  if (!workspace.target_available || !workspace.cwd) {
2753
2758
  return res.status(409).json({ error: workspace.target_unavailable_reason ?? 'Chat target is unavailable.' });
2754
2759
  }
2755
- const diffData = getGitDiffData(workspace.cwd);
2760
+ const diffData = await getGitDiffDataAsync(workspace.cwd);
2756
2761
  return res.json({
2757
2762
  stats: summarizeTicketDiffFiles(diffData.files),
2758
2763
  files: diffData.files,
2759
2764
  diff: diffData.diff,
2760
2765
  });
2761
2766
  });
2762
- app.get('/projects/:id/chat-sessions/:sessionId/git-status', (req, res) => {
2767
+ app.get('/projects/:id/chat-sessions/:sessionId/git-status', async (req, res) => {
2763
2768
  const project = getProjectById(req.params.id);
2764
2769
  if (!project) {
2765
2770
  return res.status(404).json({ error: 'Not found' });
@@ -2772,7 +2777,7 @@ app.get('/projects/:id/chat-sessions/:sessionId/git-status', (req, res) => {
2772
2777
  if (!workspace.target_available || !workspace.cwd) {
2773
2778
  return res.status(409).json({ error: workspace.target_unavailable_reason ?? 'Chat target is unavailable.' });
2774
2779
  }
2775
- return res.json(getGitStatus(workspace.cwd, workspace.branch, project));
2780
+ return res.json(await getGitStatusAsync(workspace.cwd, workspace.branch, project));
2776
2781
  });
2777
2782
  app.delete('/projects/:id/chat-sessions/:sessionId', (req, res) => {
2778
2783
  const project = getProjectById(req.params.id);
@@ -3353,14 +3358,14 @@ app.get('/tickets/:id', async (req, res) => {
3353
3358
  res.json(ticket);
3354
3359
  if (passivePullRequestContext) {
3355
3360
  const { project, bundle } = passivePullRequestContext;
3356
- startPassiveGitHubWork('ticket-open-pr-sync', () => {
3361
+ startPassiveGitHubWork(res, 'ticket-open-pr-sync', () => {
3357
3362
  startTrackedBundlePullRequestSyncIfNeeded(project, bundle);
3358
3363
  startBundlePullRequestDiscoveryIfNeeded(project, bundle);
3359
3364
  });
3360
3365
  }
3361
3366
  return;
3362
3367
  });
3363
- app.get('/tickets/:id/review-findings', (req, res) => {
3368
+ app.get('/tickets/:id/review-findings', async (req, res) => {
3364
3369
  const ticket = getTicketRouteContext(req.params.id);
3365
3370
  if (!ticket) {
3366
3371
  return res.status(404).json({ error: 'Not found' });
@@ -3368,7 +3373,7 @@ app.get('/tickets/:id/review-findings', (req, res) => {
3368
3373
  if (!matchesTicketProjectContext(ticket, req)) {
3369
3374
  return res.status(404).json({ error: 'Not found' });
3370
3375
  }
3371
- const response = getTicketReviewFindings(ticket.id);
3376
+ const response = await getTicketReviewFindings(ticket.id);
3372
3377
  if (!response) {
3373
3378
  return res.status(404).json({ error: 'Not found' });
3374
3379
  }
@@ -3384,7 +3389,7 @@ app.get('/tickets/:id/agent-runs', (req, res) => {
3384
3389
  }
3385
3390
  return res.json({ runs: listAgentRunsForParent('ticket', ticket.id) });
3386
3391
  });
3387
- app.get('/tickets/:id/diff', (req, res) => {
3392
+ app.get('/tickets/:id/diff', async (req, res) => {
3388
3393
  const ticket = getTicketRouteContext(req.params.id);
3389
3394
  if (!ticket) {
3390
3395
  return res.status(404).json({ error: 'Not found' });
@@ -3397,7 +3402,7 @@ app.get('/tickets/:id/diff', (req, res) => {
3397
3402
  const { status, error } = workspace;
3398
3403
  return res.status(status).json({ error });
3399
3404
  }
3400
- const diffData = getGitDiffData(workspace.cwd);
3405
+ const diffData = await getGitDiffDataAsync(workspace.cwd);
3401
3406
  return res.json({
3402
3407
  stats: summarizeTicketDiffFiles(diffData.files),
3403
3408
  files: diffData.files,
@@ -3418,7 +3423,7 @@ app.get('/tickets/:id/committed-diff', (req, res) => {
3418
3423
  }
3419
3424
  return sendUnpushedCommitDiff(res, workspace, getCommitHashQuery(req));
3420
3425
  });
3421
- app.get('/tickets/:id/git-status', (req, res) => {
3426
+ app.get('/tickets/:id/git-status', async (req, res) => {
3422
3427
  const ticket = getTicketRouteContext(req.params.id);
3423
3428
  if (!ticket) {
3424
3429
  return res.status(404).json({ error: 'Not found' });
@@ -3431,9 +3436,9 @@ app.get('/tickets/:id/git-status', (req, res) => {
3431
3436
  return res.status(workspace.status).json({ error: workspace.error });
3432
3437
  }
3433
3438
  const refreshRemote = req.query.refresh_remote === 'true';
3434
- return res.json(getGitStatus(workspace.cwd, workspace.branch, workspace.project, { refreshRemote }));
3439
+ return res.json(await getGitStatusAsync(workspace.cwd, workspace.branch, workspace.project, { refreshRemote }));
3435
3440
  });
3436
- app.get('/tickets/:id/git-commits', (req, res) => {
3441
+ app.get('/tickets/:id/git-commits', async (req, res) => {
3437
3442
  const ticket = getTicketRouteContext(req.params.id);
3438
3443
  if (!ticket) {
3439
3444
  return res.status(404).json({ error: 'Not found' });
@@ -3445,7 +3450,7 @@ app.get('/tickets/:id/git-commits', (req, res) => {
3445
3450
  if ('error' in workspace) {
3446
3451
  return res.status(workspace.status).json({ error: workspace.error });
3447
3452
  }
3448
- const summary = getUnpushedCommitSummaryForCwd(workspace.cwd, workspace.branch, workspace.project);
3453
+ const summary = await getUnpushedCommitSummaryForCwdAsync(workspace.cwd, workspace.branch, workspace.project);
3449
3454
  return res.json({ commits: summary.commits, total_count: summary.totalCount });
3450
3455
  });
3451
3456
  app.get('/bundles', async (req, res) => {
@@ -3465,7 +3470,7 @@ app.get('/bundles', async (req, res) => {
3465
3470
  timing.mark('serialize_bundles');
3466
3471
  timing.end({ count: serializedBundles.length });
3467
3472
  res.json(serializedBundles);
3468
- startPassiveGitHubWork('project-bundle-pr-sync', () => {
3473
+ startPassiveGitHubWork(res, 'project-bundle-pr-sync', () => {
3469
3474
  startProjectBundlePullRequestSyncIfNeeded(result.project, bundles);
3470
3475
  });
3471
3476
  });
@@ -3493,16 +3498,16 @@ app.get('/bundles/:id/conversation', (req, res) => {
3493
3498
  }
3494
3499
  const payload = serializeBundleConversationDetails(result.project, bundle);
3495
3500
  res.json(payload);
3496
- startPassiveGitHubWork('bundle-conversation-pr-discovery', () => {
3501
+ startPassiveGitHubWork(res, 'bundle-conversation-pr-discovery', () => {
3497
3502
  startBundlePullRequestDiscoveryIfNeeded(result.project, bundle);
3498
3503
  });
3499
3504
  });
3500
- app.get('/bundles/:id/review-findings', (req, res) => {
3505
+ app.get('/bundles/:id/review-findings', async (req, res) => {
3501
3506
  const result = getRequiredProject(req);
3502
3507
  if ('error' in result) {
3503
3508
  return res.status(400).json({ error: result.error });
3504
3509
  }
3505
- const response = getBundleReviewFindings(result.project.id, req.params.id);
3510
+ const response = await getBundleReviewFindings(result.project.id, req.params.id);
3506
3511
  if (!response) {
3507
3512
  return res.status(404).json({ error: 'Bundle not found' });
3508
3513
  }
@@ -6873,7 +6878,7 @@ app.post('/projects/:id/git-abort', async (req, res) => {
6873
6878
  return res.status(500).json({ error: 'Unable to determine project branch' });
6874
6879
  }
6875
6880
  });
6876
- app.get('/projects/:id/diff', (req, res) => {
6881
+ app.get('/projects/:id/diff', async (req, res) => {
6877
6882
  const project = getProjectById(req.params.id);
6878
6883
  if (!project) {
6879
6884
  return res.status(404).json({ error: 'Not found' });
@@ -6882,7 +6887,7 @@ app.get('/projects/:id/diff', (req, res) => {
6882
6887
  if ('error' in workspace) {
6883
6888
  return res.status(workspace.status).json({ error: workspace.error });
6884
6889
  }
6885
- const diffData = getGitDiffData(workspace.cwd);
6890
+ const diffData = await getGitDiffDataAsync(workspace.cwd);
6886
6891
  return res.json({
6887
6892
  stats: summarizeTicketDiffFiles(diffData.files),
6888
6893
  files: diffData.files,
@@ -6900,7 +6905,7 @@ app.get('/projects/:id/committed-diff', (req, res) => {
6900
6905
  }
6901
6906
  return sendUnpushedCommitDiff(res, workspace, getCommitHashQuery(req));
6902
6907
  });
6903
- app.get('/projects/:id/git-status', (req, res) => {
6908
+ app.get('/projects/:id/git-status', async (req, res) => {
6904
6909
  const project = getProjectById(req.params.id);
6905
6910
  if (!project) {
6906
6911
  return res.status(404).json({ error: 'Not found' });
@@ -6910,9 +6915,9 @@ app.get('/projects/:id/git-status', (req, res) => {
6910
6915
  return res.status(workspace.status).json({ error: workspace.error });
6911
6916
  }
6912
6917
  const refreshRemote = req.query.refresh_remote === 'true';
6913
- return res.json(getGitStatus(workspace.cwd, workspace.branch, workspace.project, { refreshRemote }));
6918
+ return res.json(await getGitStatusAsync(workspace.cwd, workspace.branch, workspace.project, { refreshRemote }));
6914
6919
  });
6915
- app.get('/projects/:id/git-commits', (req, res) => {
6920
+ app.get('/projects/:id/git-commits', async (req, res) => {
6916
6921
  const project = getProjectById(req.params.id);
6917
6922
  if (!project) {
6918
6923
  return res.status(404).json({ error: 'Not found' });
@@ -6921,7 +6926,7 @@ app.get('/projects/:id/git-commits', (req, res) => {
6921
6926
  if ('error' in workspace) {
6922
6927
  return res.status(workspace.status).json({ error: workspace.error });
6923
6928
  }
6924
- const summary = getUnpushedCommitSummaryForCwd(workspace.cwd, workspace.branch, workspace.project);
6929
+ const summary = await getUnpushedCommitSummaryForCwdAsync(workspace.cwd, workspace.branch, workspace.project);
6925
6930
  return res.json({ commits: summary.commits, total_count: summary.totalCount });
6926
6931
  });
6927
6932
  app.post('/projects/:id/git-commit', async (req, res) => {