@staff0rd/assist 0.1190.0 → 0.1190.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/.build-files CHANGED
@@ -38,6 +38,8 @@ chunk-2MG2THMQ.js
38
38
  chunk-2RUGZQUD.js
39
39
  chunk-2RYBRXTJ.js
40
40
  chunk-2T5HRFWP.js
41
+ chunk-2ZUJA3R6.js
42
+ chunk-3AYLDTHV.js
41
43
  chunk-3HNTLFII.js
42
44
  chunk-3JXMQFUS.js
43
45
  chunk-3KLTYFPV.js
@@ -52,6 +54,7 @@ chunk-4JIXM5NT.js
52
54
  chunk-4L7TQE67.js
53
55
  chunk-4Y4ADPEK.js
54
56
  chunk-4YAIQN3S.js
57
+ chunk-4YBU2KWW.js
55
58
  chunk-4YHDWC5E.js
56
59
  chunk-556BOFTS.js
57
60
  chunk-56USVTPP.js
@@ -62,6 +65,7 @@ chunk-5Q7MUHCK.js
62
65
  chunk-5QM5VR3J.js
63
66
  chunk-5QXAQCAJ.js
64
67
  chunk-5SXNWSSH.js
68
+ chunk-5V3LHEZ2.js
65
69
  chunk-5YO2D7JF.js
66
70
  chunk-627BOMSN.js
67
71
  chunk-655A7RGF.js
@@ -79,6 +83,7 @@ chunk-7HNRCA3N.js
79
83
  chunk-7KDF6H4R.js
80
84
  chunk-7KVL2L7Z.js
81
85
  chunk-7NZOH4LN.js
86
+ chunk-7PS3S6CV.js
82
87
  chunk-7SMQSAXT.js
83
88
  chunk-A2XSU5K6.js
84
89
  chunk-A7ONLVZD.js
@@ -91,12 +96,12 @@ chunk-AFQMD7AO.js
91
96
  chunk-AH7XVN5D.js
92
97
  chunk-ALAS5LZJ.js
93
98
  chunk-APZ6ZTDA.js
99
+ chunk-ATYWOLXK.js
94
100
  chunk-AVLELL42.js
95
101
  chunk-AYZKB6AU.js
96
102
  chunk-B2XNGBON.js
97
103
  chunk-B3JSQA5D.js
98
104
  chunk-B5ZOANOD.js
99
- chunk-B6B3AXRA.js
100
105
  chunk-B6RAZW2L.js
101
106
  chunk-B7B26YPF.js
102
107
  chunk-B7VOTF5Q.js
@@ -115,6 +120,7 @@ chunk-CDU6M5IX.js
115
120
  chunk-CGYVYHMM.js
116
121
  chunk-CUOHHT2F.js
117
122
  chunk-D24GLTCK.js
123
+ chunk-D33NLT35.js
118
124
  chunk-D6WBUFXT.js
119
125
  chunk-D7UZLH36.js
120
126
  chunk-DGQ7KOW4.js
@@ -143,7 +149,6 @@ chunk-F4XCHVD7.js
143
149
  chunk-F7QYFJB2.js
144
150
  chunk-FAYB2ZL6.js
145
151
  chunk-FCH7H3EL.js
146
- chunk-FDNJSWGJ.js
147
152
  chunk-FGCGH2CT.js
148
153
  chunk-FKM6PT3Q.js
149
154
  chunk-FLDRXYEM.js
@@ -161,19 +166,18 @@ chunk-GL5GKF5A.js
161
166
  chunk-GNNMJOUE.js
162
167
  chunk-GQF23TWI.js
163
168
  chunk-GRXFWFGP.js
169
+ chunk-GUGVH5LO.js
164
170
  chunk-GVI4JSG7.js
165
171
  chunk-GVVK5XFZ.js
166
172
  chunk-H2KHIEQF.js
167
173
  chunk-H63MI5HI.js
168
174
  chunk-H7EUPSJB.js
169
175
  chunk-HBEQCMHL.js
170
- chunk-HCSEDZIN.js
171
176
  chunk-HEFN57NV.js
172
177
  chunk-HI6T3DND.js
173
178
  chunk-HIOA4WIF.js
174
179
  chunk-HKGCLAZ7.js
175
180
  chunk-HN7MFXZ7.js
176
- chunk-HQBRU6QL.js
177
181
  chunk-HR7HIPYM.js
178
182
  chunk-HTWP3CTM.js
179
183
  chunk-HXWJKXQQ.js
@@ -264,14 +268,12 @@ chunk-OZNYQOQK.js
264
268
  chunk-P23ZWXGY.js
265
269
  chunk-P253KAVC.js
266
270
  chunk-P26XSDFU.js
267
- chunk-P32NJP4J.js
268
271
  chunk-P56S7RYB.js
269
272
  chunk-P7FVAGFQ.js
270
273
  chunk-P7SERZI6.js
271
274
  chunk-PB3F4XB3.js
272
275
  chunk-PCJ25T4O.js
273
276
  chunk-PIDKNOD6.js
274
- chunk-POV5HHVD.js
275
277
  chunk-PPPKJV3H.js
276
278
  chunk-PS3TSUFD.js
277
279
  chunk-PURNABFX.js
@@ -319,6 +321,7 @@ chunk-TJM6UIF2.js
319
321
  chunk-TSRTRJU4.js
320
322
  chunk-TUPSNHFZ.js
321
323
  chunk-TVQY3HPZ.js
324
+ chunk-TYG43KXM.js
322
325
  chunk-TZ5PVDAR.js
323
326
  chunk-UC5YRU4P.js
324
327
  chunk-UE5PIMY2.js
@@ -350,7 +353,6 @@ chunk-W7TRZLEM.js
350
353
  chunk-WDODIKZ4.js
351
354
  chunk-WNX2SQIT.js
352
355
  chunk-WOGUXGZS.js
353
- chunk-WQDUWA74.js
354
356
  chunk-WTONCI74.js
355
357
  chunk-WUMARDUD.js
356
358
  chunk-WXQ3EA5H.js
@@ -360,7 +362,6 @@ chunk-X44VETJF.js
360
362
  chunk-XA3VSUG6.js
361
363
  chunk-XADYGSUA.js
362
364
  chunk-XCMXBJ67.js
363
- chunk-XDVNFYFU.js
364
365
  chunk-XEJODD6D.js
365
366
  chunk-XJTXAL22.js
366
367
  chunk-XNCJ3OIJ.js
@@ -380,7 +381,6 @@ chunk-YJ72SXVD.js
380
381
  chunk-YKVLG4SZ.js
381
382
  chunk-YNHPTUHS.js
382
383
  chunk-YNRNHUFX.js
383
- chunk-YO266JVW.js
384
384
  chunk-YOFY27RM.js
385
385
  chunk-YQ3CNWB3.js
386
386
  chunk-YRA6OXG2.js
@@ -474,7 +474,7 @@ deps-RSUOIZPE.js
474
474
  docsConfirm-AQGXUXUM.js
475
475
  docsScreenshots-VV5F5SK5.js
476
476
  docsUnlock-JTCIE32Q.js
477
- doctorNodes-IK3LA25C.js
477
+ doctorNodes-RZHPZ6WN.js
478
478
  done-YSG44MAX.js
479
479
  drainDaemon-ZHP2VY7D.js
480
480
  dropRetiredTables-JBLALSG5.js
@@ -485,7 +485,7 @@ editIssueComment-L6RLH4GX.js
485
485
  exportBacklog-ZTMILEAX.js
486
486
  extension-YYRD5EM6.js
487
487
  extract-SGYOCBTT.js
488
- fixConflict-5JCFZ2XI.js
488
+ fixConflict-5V3DTCGW.js
489
489
  fixStructure-4UTN5ED6.js
490
490
  fixed-URDHVG6F.js
491
491
  forbiddenStrings-CAQE3QI2.js
@@ -581,15 +581,15 @@ repos-HRCIMY6J.js
581
581
  resolveHarness-CRWWVE4U.js
582
582
  resolveModel-2I3SVZKR.js
583
583
  restartDaemon-Y7V2QF3N.js
584
- restartNode-FGWG6R32.js
584
+ restartNode-FQDJNBXD.js
585
585
  restructure-S6KIV6TM.js
586
- review-76EOEYFP.js
587
- reviewPrComments-KV5QES7A.js
586
+ review-Q2HDUBAA.js
587
+ reviewPrComments-PX4MPOTQ.js
588
588
  rewindPhase-TCQMOWKB.js
589
589
  rulesAdd-DR25M5KY.js
590
590
  run-D7UQIGJU.js
591
591
  run-DRGU5WNL.js
592
- runDaemon-WU7XFVP4.js
592
+ runDaemon-5SK76CAA.js
593
593
  runExtract-7H2MKKFQ.js
594
594
  runParallelPhase-6GQMW5NT.js
595
595
  runRefine-K764J34T.js
@@ -611,7 +611,7 @@ show-GUW62FKK.js
611
611
  show-IWLHTZEP.js
612
612
  showClaudeCodeIcon-E4SAM3GN.js
613
613
  showCodexIcon-YUAKV4NI.js
614
- signExtension-TCXQ2SCU.js
614
+ signExtension-UDDHW7XN.js
615
615
  simulateDivergence-VB4UL4UR.js
616
616
  skip-7Q3IVOBV.js
617
617
  slack-VILAGICW.js
@@ -639,7 +639,7 @@ unlinkNode-RKC44U2T.js
639
639
  unstar-YQDZUJV7.js
640
640
  update-FHGTCK6N.js
641
641
  update-W7ANHGDR.js
642
- updateNode-7WC2GOV2.js
642
+ updateNode-E3ZFQC5W.js
643
643
  updatePhase-JEVJRAOR.js
644
644
  updatePlan-QZVWDL2U.js
645
645
  version-5K75T67C.js
@@ -647,8 +647,8 @@ viewIssue-N6W53LSK.js
647
647
  watchLoop-MV7DVGC6.js
648
648
  watchReport-A4W7UOAJ.js
649
649
  watchWait-5Y2J5VQY.js
650
- web-5MHF6REH.js
651
- web-F7IAGDHJ.js
650
+ web-5JW4TDMO.js
651
+ web-OS6IBX7Z.js
652
652
  withPool-LEJ76IOJ.js
653
653
  wontdo-XAQGHSR5.js
654
654
  wontfix-XV5XJADI.js
@@ -1 +1 @@
1
- 0.1190.0
1
+ 0.1190.2
@@ -206,10 +206,6 @@ ${output}` : "";
206
206
  return `worktree ${worktreePath} install${where} failed (${reason})${tail}`;
207
207
  }
208
208
 
209
- // src/commands/sessions/daemon/worktree/seedWorktree.ts
210
- import { copyFileSync, existsSync as existsSync4, mkdirSync } from "fs";
211
- import { dirname as dirname3, join as join4 } from "path";
212
-
213
209
  // src/commands/sessions/daemon/worktree/installPaths.ts
214
210
  import { resolve as resolve2 } from "path";
215
211
 
@@ -580,6 +576,8 @@ function runInstall(worktreePath, clone, install, onSeeded, onInstalling = () =>
580
576
  }
581
577
 
582
578
  // src/commands/sessions/daemon/worktree/seedWorktree.ts
579
+ import { copyFileSync, existsSync as existsSync4, mkdirSync } from "fs";
580
+ import { dirname as dirname3, join as join4 } from "path";
583
581
  function seedWorktree(worktreePath, clone, onSeeded = () => {
584
582
  }, onInstalling) {
585
583
  const cfg = worktreeConfigFor(clone);
@@ -623,6 +621,7 @@ export {
623
621
  installFailureMessage,
624
622
  killTree,
625
623
  stopInstall,
624
+ runInstall,
626
625
  seedWorktree,
627
626
  prCliCommands,
628
627
  worktreeWithBranch
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-JM57BCD6.js";
11
11
  import {
12
12
  firstBrokenHop
13
- } from "./chunk-FDNJSWGJ.js";
13
+ } from "./chunk-GUGVH5LO.js";
14
14
  import {
15
15
  describePeerError,
16
16
  fetchPeerJson
@@ -47,7 +47,7 @@ import {
47
47
  import {
48
48
  ASSIST_VERSION,
49
49
  PROTOCOL_VERSION
50
- } from "./chunk-XDVNFYFU.js";
50
+ } from "./chunk-ATYWOLXK.js";
51
51
  import {
52
52
  findLinkSpec
53
53
  } from "./chunk-J2PPCMCR.js";
@@ -2748,12 +2748,81 @@ async function getReviewSynthesis(req, res) {
2748
2748
  }
2749
2749
  }
2750
2750
 
2751
- // src/commands/sessions/web/githubFileContent.ts
2751
+ // src/commands/sessions/web/githubAttachment.ts
2752
2752
  import { execFile as execFile4 } from "child_process";
2753
2753
  import { promisify as promisify4 } from "util";
2754
+
2755
+ // src/commands/sessions/web/signedAttachmentUrl.ts
2756
+ var ASSET_ID = /^[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i;
2757
+ var RENDERED_HOSTS = /* @__PURE__ */ new Set([
2758
+ "private-user-images.githubusercontent.com",
2759
+ "github.com"
2760
+ ]);
2761
+ function isAttachmentAssetId(assetId) {
2762
+ return ASSET_ID.test(assetId);
2763
+ }
2764
+ function signedAttachmentUrl(bodyHtml, assetId) {
2765
+ for (const [, raw] of bodyHtml.matchAll(/\b(?:src|href)="(https:[^"]+)"/g)) {
2766
+ const url = raw.replace(/&/g, "&");
2767
+ if (!url.toLowerCase().includes(assetId.toLowerCase())) continue;
2768
+ if (RENDERED_HOSTS.has(new URL(url).hostname)) return url;
2769
+ }
2770
+ return null;
2771
+ }
2772
+
2773
+ // src/commands/sessions/web/githubAttachment.ts
2754
2774
  var execFileAsync4 = promisify4(execFile4);
2755
- var MAX_FILE_BYTES2 = 2 * 1024 * 1024;
2756
2775
  var REPO = /^[\w.-]+\/[\w.-]+$/;
2776
+ var PR = /^\d+$/;
2777
+ var CACHE_TTL_MS2 = 6e4;
2778
+ var bodyHtmlCache = /* @__PURE__ */ new Map();
2779
+ async function prBodyHtml(repo, pr) {
2780
+ const key = `${repo}#${pr}`;
2781
+ const now = Date.now();
2782
+ const cached2 = bodyHtmlCache.get(key);
2783
+ if (cached2 && cached2.expires > now) return cached2.html;
2784
+ const { stdout } = await execFileAsync4(
2785
+ "gh",
2786
+ [
2787
+ "api",
2788
+ "-H",
2789
+ "Accept: application/vnd.github.html+json",
2790
+ `repos/${repo}/issues/${pr}`,
2791
+ "--jq",
2792
+ '.body_html // ""'
2793
+ ],
2794
+ { encoding: "utf8", windowsHide: true, maxBuffer: 8 * 1024 * 1024 }
2795
+ );
2796
+ bodyHtmlCache.set(key, { html: stdout, expires: now + CACHE_TTL_MS2 });
2797
+ return stdout;
2798
+ }
2799
+ async function githubAttachment(req, res) {
2800
+ const params = new URL(req.url ?? "/", "http://localhost").searchParams;
2801
+ const repo = params.get("repo") ?? "";
2802
+ const pr = params.get("pr") ?? "";
2803
+ const asset = params.get("asset") ?? "";
2804
+ if (!REPO.test(repo) || !PR.test(pr) || !isAttachmentAssetId(asset)) {
2805
+ respondJson(res, 400, { error: "Invalid repo, pr or asset" });
2806
+ return;
2807
+ }
2808
+ try {
2809
+ const signed = signedAttachmentUrl(await prBodyHtml(repo, pr), asset);
2810
+ res.writeHead(302, {
2811
+ Location: signed ?? `https://github.com/user-attachments/assets/${asset}`,
2812
+ "Cache-Control": "no-store"
2813
+ });
2814
+ res.end();
2815
+ } catch (error) {
2816
+ respondJson(res, 502, { error: ghFailure(error) });
2817
+ }
2818
+ }
2819
+
2820
+ // src/commands/sessions/web/githubFileContent.ts
2821
+ import { execFile as execFile5 } from "child_process";
2822
+ import { promisify as promisify5 } from "util";
2823
+ var execFileAsync5 = promisify5(execFile5);
2824
+ var MAX_FILE_BYTES2 = 2 * 1024 * 1024;
2825
+ var REPO2 = /^[\w.-]+\/[\w.-]+$/;
2757
2826
  var SHA = /^[0-9a-f]{7,40}$/i;
2758
2827
  function validPath(path7) {
2759
2828
  return path7.length > 0 && !path7.startsWith("/") && path7.split("/").every((part) => part !== "" && part !== "..");
@@ -2763,13 +2832,13 @@ async function githubFileContent(req, res) {
2763
2832
  const repo = params.get("repo") ?? "";
2764
2833
  const sha = params.get("sha") ?? "";
2765
2834
  const path7 = params.get("path") ?? "";
2766
- if (!REPO.test(repo) || !SHA.test(sha) || !validPath(path7)) {
2835
+ if (!REPO2.test(repo) || !SHA.test(sha) || !validPath(path7)) {
2767
2836
  respondJson(res, 400, { error: "Invalid repo, sha or path" });
2768
2837
  return;
2769
2838
  }
2770
2839
  const encodedPath = path7.split("/").map(encodeURIComponent).join("/");
2771
2840
  try {
2772
- const { stdout } = await execFileAsync4(
2841
+ const { stdout } = await execFileAsync5(
2773
2842
  "gh",
2774
2843
  [
2775
2844
  "api",
@@ -2796,7 +2865,7 @@ function githubUrl(req, res) {
2796
2865
  }
2797
2866
 
2798
2867
  // src/commands/sessions/web/gitBranchInfo.ts
2799
- var CACHE_TTL_MS2 = 3e4;
2868
+ var CACHE_TTL_MS3 = 3e4;
2800
2869
  var EMPTY = {
2801
2870
  branch: null,
2802
2871
  defaultBranch: null,
@@ -2833,7 +2902,7 @@ async function gitBranchInfo(cwd) {
2833
2902
  } catch {
2834
2903
  value = EMPTY;
2835
2904
  }
2836
- cache2.set(cwd, { value, expires: now + CACHE_TTL_MS2 });
2905
+ cache2.set(cwd, { value, expires: now + CACHE_TTL_MS3 });
2837
2906
  return value;
2838
2907
  }
2839
2908
 
@@ -3645,13 +3714,13 @@ function linkRefKey({ owner, repo, number }) {
3645
3714
  }
3646
3715
 
3647
3716
  // src/commands/sessions/web/linkStatus/linkStateCache.ts
3648
- var CACHE_TTL_MS3 = 5 * 6e4;
3717
+ var CACHE_TTL_MS4 = 5 * 6e4;
3649
3718
  var entries = /* @__PURE__ */ new Map();
3650
3719
  var linkStateCache = {
3651
3720
  get(key) {
3652
3721
  const hit = entries.get(key);
3653
3722
  if (!hit) return void 0;
3654
- if (Date.now() - hit.at < CACHE_TTL_MS3) return hit.state;
3723
+ if (Date.now() - hit.at < CACHE_TTL_MS4) return hit.state;
3655
3724
  entries.delete(key);
3656
3725
  return void 0;
3657
3726
  },
@@ -3682,7 +3751,7 @@ async function fetchLinkStateChunks(refs, query) {
3682
3751
  }
3683
3752
 
3684
3753
  // src/commands/sessions/web/linkStatus/queryLinkStates.ts
3685
- import { execFile as execFile5 } from "child_process";
3754
+ import { execFile as execFile6 } from "child_process";
3686
3755
 
3687
3756
  // src/commands/sessions/web/linkStatus/linkItemState.ts
3688
3757
  function issueState({ state, stateReason }) {
@@ -3724,7 +3793,7 @@ function linkStatusQuery(refs) {
3724
3793
  // src/commands/sessions/web/linkStatus/queryLinkStates.ts
3725
3794
  function runGraphql(input) {
3726
3795
  return new Promise((resolve3, reject) => {
3727
- const child2 = execFile5(
3796
+ const child2 = execFile6(
3728
3797
  "gh",
3729
3798
  ["api", "graphql", "--input", "-"],
3730
3799
  { encoding: "utf8", windowsHide: true, maxBuffer: 16 * 1024 * 1024 },
@@ -3842,7 +3911,7 @@ function rankFilePaths(paths, query, limit) {
3842
3911
 
3843
3912
  // src/commands/sessions/web/listFiles.ts
3844
3913
  var MAX_RESULTS = 20;
3845
- var CACHE_TTL_MS4 = 5e3;
3914
+ var CACHE_TTL_MS5 = 5e3;
3846
3915
  var LS_FILES_MAX_BUFFER = 32 * 1024 * 1024;
3847
3916
  var fileListCache = /* @__PURE__ */ new Map();
3848
3917
  async function repoFiles(cwd) {
@@ -3854,7 +3923,7 @@ async function repoFiles(cwd) {
3854
3923
  { maxBuffer: LS_FILES_MAX_BUFFER }
3855
3924
  );
3856
3925
  const files = [...new Set(output.split(/\r?\n/).filter(Boolean))];
3857
- fileListCache.set(cwd, { files, expires: Date.now() + CACHE_TTL_MS4 });
3926
+ fileListCache.set(cwd, { files, expires: Date.now() + CACHE_TTL_MS5 });
3858
3927
  return files;
3859
3928
  }
3860
3929
  async function listFiles(req, res) {
@@ -3979,7 +4048,7 @@ async function fetchFeeds(urls, onProgress) {
3979
4048
  }
3980
4049
 
3981
4050
  // src/commands/sessions/web/listNewsItems.ts
3982
- var CACHE_TTL_MS5 = 15 * 6e4;
4051
+ var CACHE_TTL_MS6 = 15 * 6e4;
3983
4052
  var cache3;
3984
4053
  async function listNewsItems(_req, res) {
3985
4054
  const { orm } = await getReady();
@@ -3988,7 +4057,7 @@ async function listNewsItems(_req, res) {
3988
4057
  const now = Date.now();
3989
4058
  if (!cache3 || cache3.feedsKey !== feedsKey || cache3.expires <= now) {
3990
4059
  const items2 = fetchFeeds(urls);
3991
- cache3 = { feedsKey, expires: now + CACHE_TTL_MS5, items: items2 };
4060
+ cache3 = { feedsKey, expires: now + CACHE_TTL_MS6, items: items2 };
3992
4061
  items2.catch(() => {
3993
4062
  if (cache3?.items === items2) cache3 = void 0;
3994
4063
  });
@@ -4003,10 +4072,10 @@ function newsNavConfig(_req, res) {
4003
4072
  }
4004
4073
 
4005
4074
  // src/commands/sessions/web/releases/ghJson.ts
4006
- import { execFile as execFile6 } from "child_process";
4007
- import { promisify as promisify5 } from "util";
4008
- var execFileAsync5 = promisify5(execFile6);
4009
- var CACHE_TTL_MS6 = 3e4;
4075
+ import { execFile as execFile7 } from "child_process";
4076
+ import { promisify as promisify6 } from "util";
4077
+ var execFileAsync6 = promisify6(execFile7);
4078
+ var CACHE_TTL_MS7 = 3e4;
4010
4079
  var cache4 = /* @__PURE__ */ new Map();
4011
4080
  function partialGraphqlData(error) {
4012
4081
  const stdout = error.stdout;
@@ -4020,7 +4089,7 @@ function partialGraphqlData(error) {
4020
4089
  }
4021
4090
  async function runGh(cwd, args) {
4022
4091
  try {
4023
- const { stdout } = await execFileAsync5("gh", args, {
4092
+ const { stdout } = await execFileAsync6("gh", args, {
4024
4093
  encoding: "utf8",
4025
4094
  windowsHide: true,
4026
4095
  cwd,
@@ -4036,7 +4105,7 @@ async function runGh(cwd, args) {
4036
4105
  function ghJson(cwd, args) {
4037
4106
  const key = [cwd, ...args].join("\0");
4038
4107
  const hit = cache4.get(key);
4039
- if (hit && Date.now() - hit.at < CACHE_TTL_MS6)
4108
+ if (hit && Date.now() - hit.at < CACHE_TTL_MS7)
4040
4109
  return hit.result;
4041
4110
  const result = runGh(cwd, args);
4042
4111
  cache4.set(key, { at: Date.now(), result });
@@ -5456,8 +5525,8 @@ function listUsageJobs(req, res) {
5456
5525
 
5457
5526
  // src/commands/sessions/web/openInCode.ts
5458
5527
  import { exec } from "child_process";
5459
- import { promisify as promisify6 } from "util";
5460
- var execAsync = promisify6(exec);
5528
+ import { promisify as promisify7 } from "util";
5529
+ var execAsync = promisify7(exec);
5461
5530
  async function openInCode(req, res) {
5462
5531
  const cwd = getCwdParam(req, res);
5463
5532
  if (!cwd) return;
@@ -5473,10 +5542,10 @@ async function openInCode(req, res) {
5473
5542
  }
5474
5543
 
5475
5544
  // src/commands/sessions/web/createCachedGhJson.ts
5476
- import { execFile as execFile7 } from "child_process";
5477
- import { promisify as promisify7 } from "util";
5478
- var execFileAsync6 = promisify7(execFile7);
5479
- var CACHE_TTL_MS7 = 3e4;
5545
+ import { execFile as execFile8 } from "child_process";
5546
+ import { promisify as promisify8 } from "util";
5547
+ var execFileAsync7 = promisify8(execFile8);
5548
+ var CACHE_TTL_MS8 = 3e4;
5480
5549
  function createCachedGhJson(args, parse, fallback, options = {}) {
5481
5550
  const { cacheFallback = true } = options;
5482
5551
  const cache5 = /* @__PURE__ */ new Map();
@@ -5487,7 +5556,7 @@ function createCachedGhJson(args, parse, fallback, options = {}) {
5487
5556
  if (cached2 && cached2.expires > now) return cached2.value;
5488
5557
  let value = fallback;
5489
5558
  try {
5490
- const { stdout } = await execFileAsync6("gh", [...args, ...extraArgs], {
5559
+ const { stdout } = await execFileAsync7("gh", [...args, ...extraArgs], {
5491
5560
  encoding: "utf8",
5492
5561
  windowsHide: true,
5493
5562
  cwd
@@ -5497,7 +5566,7 @@ function createCachedGhJson(args, parse, fallback, options = {}) {
5497
5566
  value = fallback;
5498
5567
  }
5499
5568
  if (cacheFallback || value !== fallback)
5500
- cache5.set(key, { value, expires: now + CACHE_TTL_MS7 });
5569
+ cache5.set(key, { value, expires: now + CACHE_TTL_MS8 });
5501
5570
  return value;
5502
5571
  };
5503
5572
  }
@@ -5556,12 +5625,12 @@ async function previewImage(req, res) {
5556
5625
  }
5557
5626
 
5558
5627
  // src/commands/sessions/web/getCurrentBranch.ts
5559
- import { execFile as execFile8 } from "child_process";
5560
- import { promisify as promisify8 } from "util";
5561
- var execFileAsync7 = promisify8(execFile8);
5628
+ import { execFile as execFile9 } from "child_process";
5629
+ import { promisify as promisify9 } from "util";
5630
+ var execFileAsync8 = promisify9(execFile9);
5562
5631
  async function getCurrentBranch(cwd) {
5563
5632
  try {
5564
- const { stdout } = await execFileAsync7(
5633
+ const { stdout } = await execFileAsync8(
5565
5634
  "git",
5566
5635
  ["rev-parse", "--abbrev-ref", "HEAD"],
5567
5636
  { encoding: "utf8", windowsHide: true, cwd }
@@ -7176,11 +7245,11 @@ async function uploadPrImage(req, res) {
7176
7245
  import { readFile as readFile2, stat as stat3, writeFile } from "fs/promises";
7177
7246
 
7178
7247
  // src/commands/sessions/web/formatWithOxfmt.ts
7179
- import { execFile as execFile9 } from "child_process";
7248
+ import { execFile as execFile10 } from "child_process";
7180
7249
  import { existsSync as existsSync7 } from "fs";
7181
7250
  import { dirname as dirname2, join as join7 } from "path";
7182
- import { promisify as promisify9 } from "util";
7183
- var execFileAsync8 = promisify9(execFile9);
7251
+ import { promisify as promisify10 } from "util";
7252
+ var execFileAsync9 = promisify10(execFile10);
7184
7253
  var TIMEOUT_MS = 15e3;
7185
7254
  function findOxfmtScript(root) {
7186
7255
  let dir = root;
@@ -7195,7 +7264,7 @@ function findOxfmtScript(root) {
7195
7264
  async function formatWithOxfmt(target, root) {
7196
7265
  const script = findOxfmtScript(root);
7197
7266
  if (!script) return;
7198
- await execFileAsync8(process.execPath, [script, target], {
7267
+ await execFileAsync9(process.execPath, [script, target], {
7199
7268
  cwd: root,
7200
7269
  windowsHide: true,
7201
7270
  timeout: TIMEOUT_MS
@@ -7387,6 +7456,7 @@ var routes2 = {
7387
7456
  "POST /api/self-update": selfUpdate,
7388
7457
  "GET /api/github-url": githubUrl,
7389
7458
  "GET /api/github-file": githubFileContent,
7459
+ "GET /api/github-attachment": githubAttachment,
7390
7460
  "GET /api/git-status": gitStatus,
7391
7461
  "GET /api/diff": diff,
7392
7462
  "GET /api/diff-scopes": diffScopes,
@@ -14,7 +14,7 @@ import {
14
14
  isHello,
15
15
  linkVersionCheck,
16
16
  negotiateProtocol
17
- } from "./chunk-XDVNFYFU.js";
17
+ } from "./chunk-ATYWOLXK.js";
18
18
 
19
19
  // src/commands/sessions/nodes/probePeerHello.ts
20
20
  var HELLO_TIMEOUT_MS = 5e3;
@@ -2,9 +2,10 @@ import {
2
2
  allocateTree,
3
3
  installFailureMessage,
4
4
  prCliCommands,
5
+ runInstall,
5
6
  seedWorktree,
6
7
  worktreeWithBranch
7
- } from "./chunk-HCSEDZIN.js";
8
+ } from "./chunk-2ZUJA3R6.js";
8
9
  import {
9
10
  loadPersistedSessions
10
11
  } from "./chunk-UPGNKZVA.js";
@@ -14,6 +15,9 @@ import {
14
15
  import {
15
16
  azCliProblem
16
17
  } from "./chunk-UN4ABKA7.js";
18
+ import {
19
+ worktreeConfigFor
20
+ } from "./chunk-664TLOAJ.js";
17
21
  import {
18
22
  inWebSession
19
23
  } from "./chunk-HKGCLAZ7.js";
@@ -157,6 +161,64 @@ function currentBranch() {
157
161
  return gitSyncOrNull(process.cwd(), ["rev-parse", "--abbrev-ref", "HEAD"]);
158
162
  }
159
163
 
164
+ // src/commands/review/changedInstall.ts
165
+ import { join } from "path";
166
+ var LOCKFILES = [
167
+ "package-lock.json",
168
+ "pnpm-lock.yaml",
169
+ "yarn.lock",
170
+ "bun.lockb"
171
+ ];
172
+ function lockfileChanged(tree, before, rel) {
173
+ const files = LOCKFILES.map((name) => join(rel, name));
174
+ const changed = gitSyncOrNull(tree, [
175
+ "diff",
176
+ "--name-only",
177
+ before,
178
+ "HEAD",
179
+ "--",
180
+ ...files
181
+ ]);
182
+ return Boolean(changed);
183
+ }
184
+ function changedInstall(tree, before, install) {
185
+ if (Array.isArray(install))
186
+ return install.filter((rel) => lockfileChanged(tree, before, rel));
187
+ if (install === false) return false;
188
+ return lockfileChanged(tree, before, ".") ? install : false;
189
+ }
190
+
191
+ // src/commands/review/reinstallChangedDeps.ts
192
+ function installedPaths(install) {
193
+ return Array.isArray(install) ? install : ["."];
194
+ }
195
+ function reinstallChangedDeps(tree, before) {
196
+ const cfg = worktreeConfigFor(tree);
197
+ if (!before || !cfg.enabled) return Promise.resolve();
198
+ const install = changedInstall(tree, before, cfg.install);
199
+ if (install === false || Array.isArray(install) && !install.length)
200
+ return Promise.resolve();
201
+ const paths = installedPaths(install);
202
+ const where = paths.join(", ");
203
+ console.log(`Lockfile changed in ${where}; reinstalling deps\u2026`);
204
+ for (const rel of paths)
205
+ appendDaemonLog(
206
+ `worktree ${tree} reinstalling deps in ${rel}: lockfile changed by pr checkout`
207
+ );
208
+ return new Promise(
209
+ (resolve) => runInstall(tree, tree, install, (outcome) => {
210
+ if (outcome.ok)
211
+ appendDaemonLog(`worktree ${tree} reinstalled deps in ${where}`);
212
+ else {
213
+ const message = installFailureMessage(tree, outcome);
214
+ console.warn(message);
215
+ appendDaemonLog(message);
216
+ }
217
+ resolve();
218
+ })
219
+ );
220
+ }
221
+
160
222
  // src/commands/review/checkoutPr.ts
161
223
  function currentBranch2() {
162
224
  return gitSyncOrNull(process.cwd(), ["rev-parse", "--abbrev-ref", "HEAD"]);
@@ -181,6 +243,7 @@ async function checkoutPr(number) {
181
243
  await moveToPrCheckoutTree();
182
244
  const branch = currentBranch2();
183
245
  const from = branch === "HEAD" ? gitSyncOrNull(process.cwd(), ["rev-parse", "HEAD"]) : branch;
246
+ const before = gitSyncOrNull(process.cwd(), ["rev-parse", "HEAD"]);
184
247
  const stale = headRef ? clearStalePrBranch(process.cwd(), headRef) : "absent";
185
248
  try {
186
249
  execFileSync2(commands.checkout.file, commands.checkout.args, {
@@ -189,6 +252,7 @@ async function checkoutPr(number) {
189
252
  } catch {
190
253
  failCheckout(number, headRef, stale, from, commands.checkout);
191
254
  }
255
+ await reinstallChangedDeps(process.cwd(), before);
192
256
  }
193
257
 
194
258
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  firstBrokenHop
3
- } from "./chunk-FDNJSWGJ.js";
3
+ } from "./chunk-GUGVH5LO.js";
4
4
  import {
5
5
  describePeerError
6
6
  } from "./chunk-VABNWHSE.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5CNDLMYO.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-P32NJP4J.js";
6
+ } from "./chunk-TYG43KXM.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-UFSOFNXQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  checkoutPr
3
- } from "./chunk-YO266JVW.js";
3
+ } from "./chunk-5V3LHEZ2.js";
4
4
  import {
5
5
  launchBlocker
6
6
  } from "./chunk-AFQMD7AO.js";