@staff0rd/assist 0.1202.1 → 0.1204.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 (28) hide show
  1. package/agent/commands/github.md +5 -3
  2. package/dist/.build-files +22 -22
  3. package/dist/built-version +1 -1
  4. package/dist/{chunk-XPCGGN6W.js → chunk-3JFOEWFC.js} +122 -90
  5. package/dist/{chunk-ZXGBALZW.js → chunk-4WKQW6FW.js} +1 -1
  6. package/dist/{chunk-U5AOBFPH.js → chunk-F2ENQO3B.js} +1 -1
  7. package/dist/{chunk-HT7S6EQJ.js → chunk-HAIHM63W.js} +1 -1
  8. package/dist/{chunk-JS2XXDJN.js → chunk-IB4N6RMS.js} +1 -1
  9. package/dist/{chunk-ZQGAGLBO.js → chunk-IFOKZRUY.js} +2 -2
  10. package/dist/{chunk-OVZHJ4ES.js → chunk-IPURXJPM.js} +1 -1
  11. package/dist/{chunk-I6OGHKVJ.js → chunk-PKQVQB35.js} +1 -1
  12. package/dist/{cliHook-73D3GLQ6.js → cliHook-D2H77SJN.js} +2 -2
  13. package/dist/{cliHookCheck-PMQBVFAV.js → cliHookCheck-QGP5HUUS.js} +1 -1
  14. package/dist/{codexHook-WGJ4XIVO.js → codexHook-4SYBRXJ3.js} +2 -2
  15. package/dist/commands/sessions/web/bundle.js +1 -1
  16. package/dist/{commit-UBFHBWPL.js → commit-372ABD5B.js} +10 -2
  17. package/dist/{doctorNodes-EDNLU5OT.js → doctorNodes-IQ6GU6BS.js} +3 -3
  18. package/dist/{editHook-LIRUJTEJ.js → editHook-AXSWU67A.js} +2 -2
  19. package/dist/{editIssue-CJP5LATW.js → editIssue-QRWI7PJD.js} +72 -25
  20. package/dist/index.js +27 -21
  21. package/dist/{piHook-I3ZWJEB7.js → piHook-W5SV55KH.js} +2 -2
  22. package/dist/{restartNode-WKAQR5NV.js → restartNode-KWTNREIL.js} +5 -5
  23. package/dist/{runDaemon-EW2QXADG.js → runDaemon-LRVGQWNG.js} +2 -2
  24. package/dist/{signExtension-VA4VAIMH.js → signExtension-5CSL5JC4.js} +1 -1
  25. package/dist/{updateNode-W5JA5KK3.js → updateNode-FGXIND2Y.js} +5 -5
  26. package/dist/{web-XLS4FPGZ.js → web-L2C3WE7J.js} +5 -5
  27. package/dist/{web-JIN2AT54.js → web-TT4FDQO5.js} +5 -5
  28. package/package.json +1 -1
@@ -45,7 +45,7 @@ Display the result to the user.
45
45
 
46
46
  ## Action: edit
47
47
 
48
- Rework the issue's body in the assist web preview pane. This is what a bare issue reference runs. Run it and nothing else:
48
+ Rework the issue's body or title in the assist web preview pane. This is what a bare issue reference runs. Run it and nothing else:
49
49
 
50
50
  ```
51
51
  assist github issue edit <number> -R <owner>/<repo> [--screenshot '[Group/]Caption=path']... 2>&1
@@ -53,11 +53,13 @@ assist github issue edit <number> -R <owner>/<repo> [--screenshot '[Group/]Capti
53
53
 
54
54
  If you already know the body you want (e.g. the user asked for a specific rewrite), read the current body with `gh issue view`, compose the revision, and pass it with `--body -` on stdin so the first preview shows your proposal rather than the unchanged body.
55
55
 
56
+ To rename the issue (e.g. splitting a sub-task), pass `--title <title>`; the preview header shows `old → new` above the current body (or `--body`), and approval pushes both. Never rename with `gh issue edit` or `gh api`.
57
+
56
58
  When you already have an image or video to add to the issue (e.g. a file the user pointed at on disk), pass it with `--screenshot '[Group/]Caption=path'`, once per file, rather than asking the user to drop it into the preview. It is attached under the body's `## Screenshots` section for you; never author that section yourself.
57
59
 
58
60
  For a targeted change to the current body (strike items out, tick a box), run `assist github issue edit <number> -R <owner>/<repo> --fetch` first: it writes the current body to the working file and prints its path without opening a preview. Edit that file in place, then run the command without `--fetch` so the first preview shows your revision. Never run it without `--fetch` just to get the body.
59
61
 
60
- Do not check for a web session yourself — the command already knows. In a web session it fetches the issue's current body, opens it in the preview pane, and pushes the pane's markdown back on approval; outside one it just prints the issue, or with `--screenshot` attaches the files to the current body directly. Only the body is ever touched — the title, labels, assignees and state are left alone.
62
+ Do not check for a web session yourself — the command already knows. In a web session it fetches the issue's current body, opens it in the preview pane, and pushes the pane's markdown back on approval; outside one it just prints the issue, or with `--title` / `--screenshot` applies the rename / attaches the files directly. Only the body and title are ever touched — labels, assignees and state are left alone.
61
63
 
62
64
  Display the output so the user can see what happened. If the command exits non-zero, relay what it reported and stop — nothing was pushed. Two cases to relay verbatim:
63
65
 
@@ -180,7 +182,7 @@ List the available actions and their arguments:
180
182
 
181
183
  - `/github view <ref>` — print an issue to chat (ref optional; falls back to the session item's GitHub issue).
182
184
  - `/github <owner/repo#number>` — rework that issue in the web preview pane (see `edit`).
183
- - `/github edit [ref]` — rework the issue body in the web preview pane (what a bare `/github <ref>` runs; the command prints the issue instead when there is no web session).
185
+ - `/github edit [ref]` — rework the issue body or title (`--title`) in the web preview pane (what a bare `/github <ref>` runs; the command prints the issue instead when there is no web session).
184
186
  - `/github create <request>` — create an issue from a free-form request naming its repo, labels, project and milestone (previewed for approval before creating).
185
187
  - `/github associate <ref> [id]` — associate a GitHub issue with a backlog item (id optional; falls back to the session item).
186
188
  - `/github update [ref]` — post a concise session-summary comment to the issue (previewed for approval before posting).
package/dist/.build-files CHANGED
@@ -42,6 +42,7 @@ chunk-2RYBRXTJ.js
42
42
  chunk-2T5HRFWP.js
43
43
  chunk-2ZUJA3R6.js
44
44
  chunk-3HNTLFII.js
45
+ chunk-3JFOEWFC.js
45
46
  chunk-3JXMQFUS.js
46
47
  chunk-3KLTYFPV.js
47
48
  chunk-3NK55YVZ.js
@@ -53,6 +54,7 @@ chunk-4CP23TT2.js
53
54
  chunk-4HKB2TAG.js
54
55
  chunk-4JIXM5NT.js
55
56
  chunk-4L7TQE67.js
57
+ chunk-4WKQW6FW.js
56
58
  chunk-4Y4ADPEK.js
57
59
  chunk-4YAIQN3S.js
58
60
  chunk-4YHDWC5E.js
@@ -141,6 +143,7 @@ chunk-ETL3RMC4.js
141
143
  chunk-EU5YCR2M.js
142
144
  chunk-EW2ZM2PC.js
143
145
  chunk-EYM57SNL.js
146
+ chunk-F2ENQO3B.js
144
147
  chunk-F4XCHVD7.js
145
148
  chunk-F7QYFJB2.js
146
149
  chunk-FAYB2ZL6.js
@@ -167,6 +170,7 @@ chunk-GVVK5XFZ.js
167
170
  chunk-H2KHIEQF.js
168
171
  chunk-H63MI5HI.js
169
172
  chunk-H7EUPSJB.js
173
+ chunk-HAIHM63W.js
170
174
  chunk-HBEQCMHL.js
171
175
  chunk-HEFN57NV.js
172
176
  chunk-HI6T3DND.js
@@ -174,21 +178,22 @@ chunk-HIOA4WIF.js
174
178
  chunk-HKGCLAZ7.js
175
179
  chunk-HN7MFXZ7.js
176
180
  chunk-HR7HIPYM.js
177
- chunk-HT7S6EQJ.js
178
181
  chunk-HTWP3CTM.js
179
182
  chunk-HXWJKXQQ.js
180
183
  chunk-I3TEQBTO.js
181
- chunk-I6OGHKVJ.js
184
+ chunk-IB4N6RMS.js
182
185
  chunk-IBPSXDUB.js
183
186
  chunk-IBVCCKC3.js
184
187
  chunk-IDRVSAV5.js
185
188
  chunk-IFMJH2XY.js
189
+ chunk-IFOKZRUY.js
186
190
  chunk-IHZGFTOB.js
187
191
  chunk-IISY3AMC.js
188
192
  chunk-IKCS5JTK.js
189
193
  chunk-IOAF6P3G.js
190
194
  chunk-IOKBCYSG.js
191
195
  chunk-IOYGR6YV.js
196
+ chunk-IPURXJPM.js
192
197
  chunk-IS5SG2SN.js
193
198
  chunk-ISIVSUR5.js
194
199
  chunk-IULYBBGP.js
@@ -209,7 +214,6 @@ chunk-JNCFHWBK.js
209
214
  chunk-JNEYUOQ3.js
210
215
  chunk-JPM7HCLI.js
211
216
  chunk-JPRADR2E.js
212
- chunk-JS2XXDJN.js
213
217
  chunk-JUVR4JSY.js
214
218
  chunk-JVG5AJA2.js
215
219
  chunk-JVTCXR7C.js
@@ -261,7 +265,6 @@ chunk-ODLSWRTS.js
261
265
  chunk-OLE7XSNB.js
262
266
  chunk-OQ6AYXHB.js
263
267
  chunk-OU6Q5ZS3.js
264
- chunk-OVZHJ4ES.js
265
268
  chunk-OZNYQOQK.js
266
269
  chunk-P23ZWXGY.js
267
270
  chunk-P253KAVC.js
@@ -273,6 +276,7 @@ chunk-P7SERZI6.js
273
276
  chunk-PB3F4XB3.js
274
277
  chunk-PCJ25T4O.js
275
278
  chunk-PIDKNOD6.js
279
+ chunk-PKQVQB35.js
276
280
  chunk-PPPKJV3H.js
277
281
  chunk-PS3TSUFD.js
278
282
  chunk-PURNABFX.js
@@ -319,7 +323,6 @@ chunk-TSRTRJU4.js
319
323
  chunk-TUPSNHFZ.js
320
324
  chunk-TVQY3HPZ.js
321
325
  chunk-TZ5PVDAR.js
322
- chunk-U5AOBFPH.js
323
326
  chunk-UC5YRU4P.js
324
327
  chunk-UE5PIMY2.js
325
328
  chunk-UEWARAPX.js
@@ -362,7 +365,6 @@ chunk-XCMXBJ67.js
362
365
  chunk-XEJODD6D.js
363
366
  chunk-XJTXAL22.js
364
367
  chunk-XNCJ3OIJ.js
365
- chunk-XPCGGN6W.js
366
368
  chunk-XSJGIJEE.js
367
369
  chunk-XT3AOF2P.js
368
370
  chunk-XTPBXBZA.js
@@ -406,21 +408,19 @@ chunk-ZMW2VHAF.js
406
408
  chunk-ZN5LRXXN.js
407
409
  chunk-ZNA4X3WZ.js
408
410
  chunk-ZQCL465S.js
409
- chunk-ZQGAGLBO.js
410
411
  chunk-ZRIBI33P.js
411
412
  chunk-ZSHH4XS6.js
412
413
  chunk-ZWPML4IH.js
413
- chunk-ZXGBALZW.js
414
414
  chunk-ZYK7V4PG.js
415
415
  chunk-ZZVYRC77.js
416
416
  clean-N5ZBCTOB.js
417
- cliHook-73D3GLQ6.js
418
- cliHookCheck-PMQBVFAV.js
417
+ cliHook-D2H77SJN.js
418
+ cliHookCheck-QGP5HUUS.js
419
419
  cloneRepo-IUMKS26Z.js
420
420
  closeSession-ECJ6TFRX.js
421
421
  codeCommentConfirm-LGYBP6JX.js
422
422
  codeCommentSet-PI3AKFET.js
423
- codexHook-WGJ4XIVO.js
423
+ codexHook-4SYBRXJ3.js
424
424
  codexHookTrust-2IW2D4XD.js
425
425
  commands/deploy/build.yml
426
426
  commands/deploy/init/updateWorkflow.ts
@@ -452,7 +452,7 @@ comment-EFWTK74F.js
452
452
  comment-YXTD4LLT.js
453
453
  commentIssue-YGGK2GEG.js
454
454
  comments-Z46LCFIS.js
455
- commit-UBFHBWPL.js
455
+ commit-372ABD5B.js
456
456
  commits-QFWMYJC5.js
457
457
  configGet-BZTYR2DN.js
458
458
  configImportRepos-RFQEGD67.js
@@ -476,13 +476,13 @@ deps-RSUOIZPE.js
476
476
  docsConfirm-AQGXUXUM.js
477
477
  docsScreenshots-VV5F5SK5.js
478
478
  docsUnlock-JTCIE32Q.js
479
- doctorNodes-EDNLU5OT.js
479
+ doctorNodes-IQ6GU6BS.js
480
480
  done-YSG44MAX.js
481
481
  drainDaemon-IGOUGC72.js
482
482
  dropRetiredTables-JBLALSG5.js
483
483
  edit-JVAW5GKZ.js
484
- editHook-LIRUJTEJ.js
485
- editIssue-CJP5LATW.js
484
+ editHook-AXSWU67A.js
485
+ editIssue-QRWI7PJD.js
486
486
  editIssueComment-4X62P25Z.js
487
487
  exportBacklog-ZTMILEAX.js
488
488
  extension-YYRD5EM6.js
@@ -544,7 +544,7 @@ nodeLogs-43P3MY5C.js
544
544
  notify-ZLGE4CCO.js
545
545
  permitCliReads-LPRVXYMU.js
546
546
  phaseDone-YJAHCOSB.js
547
- piHook-I3ZWJEB7.js
547
+ piHook-W5SV55KH.js
548
548
  plan-CJ4PUZNL.js
549
549
  postSlackMessage-XBKKBMTS.js
550
550
  posted-MWD6MQLW.js
@@ -583,7 +583,7 @@ repos-HRCIMY6J.js
583
583
  resolveHarness-CRWWVE4U.js
584
584
  resolveModel-2I3SVZKR.js
585
585
  restartDaemon-Y7V2QF3N.js
586
- restartNode-WKAQR5NV.js
586
+ restartNode-KWTNREIL.js
587
587
  restructure-S6KIV6TM.js
588
588
  review-27MBRMYS.js
589
589
  reviewPrComments-ZFZRHG2I.js
@@ -591,7 +591,7 @@ rewindPhase-TCQMOWKB.js
591
591
  rulesAdd-ODST2JQ4.js
592
592
  run-D7UQIGJU.js
593
593
  run-DRGU5WNL.js
594
- runDaemon-EW2QXADG.js
594
+ runDaemon-LRVGQWNG.js
595
595
  runExtract-MJUEAUR5.js
596
596
  runParallelPhase-6GQMW5NT.js
597
597
  runRefine-K764J34T.js
@@ -613,7 +613,7 @@ show-GUW62FKK.js
613
613
  show-IWLHTZEP.js
614
614
  showClaudeCodeIcon-E4SAM3GN.js
615
615
  showCodexIcon-YUAKV4NI.js
616
- signExtension-VA4VAIMH.js
616
+ signExtension-5CSL5JC4.js
617
617
  simulateDivergence-VB4UL4UR.js
618
618
  skip-7Q3IVOBV.js
619
619
  slack-LGXMV376.js
@@ -641,7 +641,7 @@ unlinkNode-RKC44U2T.js
641
641
  unstar-YQDZUJV7.js
642
642
  update-FHGTCK6N.js
643
643
  update-W7ANHGDR.js
644
- updateNode-W5JA5KK3.js
644
+ updateNode-FGXIND2Y.js
645
645
  updatePhase-JEVJRAOR.js
646
646
  updatePlan-NIDFJK6O.js
647
647
  version-5K75T67C.js
@@ -649,8 +649,8 @@ viewIssue-N6W53LSK.js
649
649
  watchLoop-MV7DVGC6.js
650
650
  watchReport-A4W7UOAJ.js
651
651
  watchWait-5Y2J5VQY.js
652
- web-JIN2AT54.js
653
- web-XLS4FPGZ.js
652
+ web-L2C3WE7J.js
653
+ web-TT4FDQO5.js
654
654
  withPool-LEJ76IOJ.js
655
655
  wontdo-XAQGHSR5.js
656
656
  wontfix-VUVHWVNB.js
@@ -1 +1 @@
1
- 0.1202.1
1
+ 0.1204.0
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-JM57BCD6.js";
11
11
  import {
12
12
  firstBrokenHop
13
- } from "./chunk-I6OGHKVJ.js";
13
+ } from "./chunk-PKQVQB35.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-OVZHJ4ES.js";
50
+ } from "./chunk-IPURXJPM.js";
51
51
  import {
52
52
  findLinkSpec
53
53
  } from "./chunk-J2PPCMCR.js";
@@ -1564,69 +1564,6 @@ async function branchDiffBase(cwd) {
1564
1564
  }
1565
1565
  }
1566
1566
 
1567
- // src/shared/db/findItemBySessionId.ts
1568
- import { asc, eq } from "drizzle-orm";
1569
- async function fromPhaseSessions(db, conversationId) {
1570
- const rows = await db.select({ itemId: phaseSessions.itemId }).from(phaseSessions).where(eq(phaseSessions.claudeSessionId, conversationId)).orderBy(asc(phaseSessions.itemId), asc(phaseSessions.phaseIdx)).limit(1);
1571
- return rows[0]?.itemId;
1572
- }
1573
- async function fromPhaseUsage(db, conversationId) {
1574
- const rows = await db.select({ itemId: phaseUsage.itemId }).from(phaseUsage).where(eq(phaseUsage.claudeSessionId, conversationId)).orderBy(asc(phaseUsage.itemId), asc(phaseUsage.phaseIdx)).limit(1);
1575
- return rows[0]?.itemId;
1576
- }
1577
- async function findItemBySessionId(db, conversationId) {
1578
- return await fromPhaseSessions(db, conversationId) ?? await fromPhaseUsage(db, conversationId);
1579
- }
1580
-
1581
- // src/shared/db/listCommitRefs.ts
1582
- import { and, asc as asc2, eq as eq2 } from "drizzle-orm";
1583
- async function listCommitRefs(db, itemId2) {
1584
- const rows = await db.select({
1585
- ref: itemGitRefs.ref,
1586
- title: itemGitRefs.title,
1587
- url: itemGitRefs.url
1588
- }).from(itemGitRefs).where(and(eq2(itemGitRefs.itemId, itemId2), eq2(itemGitRefs.kind, "commit"))).orderBy(asc2(itemGitRefs.createdAt), asc2(itemGitRefs.ref));
1589
- return rows.map((row) => ({
1590
- sha: row.ref,
1591
- ...row.title ? { title: row.title } : {},
1592
- ...row.url ? { url: row.url } : {}
1593
- }));
1594
- }
1595
-
1596
- // src/shared/withTimeout.ts
1597
- function withTimeout(work, ms, label) {
1598
- let timer;
1599
- const expired = new Promise((_, reject) => {
1600
- timer = setTimeout(
1601
- () => reject(new Error(`${label} timed out after ${ms}ms`)),
1602
- ms
1603
- );
1604
- });
1605
- return Promise.race([work, expired]).finally(() => clearTimeout(timer));
1606
- }
1607
-
1608
- // src/commands/sessions/web/itemCommits.ts
1609
- var LOOKUP_TIMEOUT_MS = 3e3;
1610
- async function lookupItemCommits(sessionId) {
1611
- const db = await getDb();
1612
- const itemId2 = await findItemBySessionId(db, sessionId);
1613
- if (itemId2 === void 0) return [];
1614
- return listCommitRefs(db, itemId2);
1615
- }
1616
- async function itemCommits(sessionId) {
1617
- try {
1618
- if (!process.env.ASSIST_DATABASE_URL && !loadConfig().database.url)
1619
- return [];
1620
- return await withTimeout(
1621
- lookupItemCommits(sessionId),
1622
- LOOKUP_TIMEOUT_MS,
1623
- "item commits"
1624
- );
1625
- } catch {
1626
- return [];
1627
- }
1628
- }
1629
-
1630
1567
  // src/commands/sessions/web/resolveCommit.ts
1631
1568
  var GIT_EMPTY_TREE_HASH = "4b825dc642cb6eb9a060e54bf8d69288fbee4904";
1632
1569
  async function commitBase(cwd, sha) {
@@ -1696,6 +1633,82 @@ function remember(key, commit) {
1696
1633
  resolved.set(key, { commit, expiresAt: now + REVALIDATE_AFTER_MS });
1697
1634
  }
1698
1635
 
1636
+ // src/shared/withTimeout.ts
1637
+ function withTimeout(work, ms, label) {
1638
+ let timer;
1639
+ const expired = new Promise((_, reject) => {
1640
+ timer = setTimeout(
1641
+ () => reject(new Error(`${label} timed out after ${ms}ms`)),
1642
+ ms
1643
+ );
1644
+ });
1645
+ return Promise.race([work, expired]).finally(() => clearTimeout(timer));
1646
+ }
1647
+
1648
+ // src/shared/db/findItemBySessionId.ts
1649
+ import { asc, eq } from "drizzle-orm";
1650
+ async function fromPhaseSessions(db, conversationId) {
1651
+ const rows = await db.select({ itemId: phaseSessions.itemId }).from(phaseSessions).where(eq(phaseSessions.claudeSessionId, conversationId)).orderBy(asc(phaseSessions.itemId), asc(phaseSessions.phaseIdx)).limit(1);
1652
+ return rows[0]?.itemId;
1653
+ }
1654
+ async function fromPhaseUsage(db, conversationId) {
1655
+ const rows = await db.select({ itemId: phaseUsage.itemId }).from(phaseUsage).where(eq(phaseUsage.claudeSessionId, conversationId)).orderBy(asc(phaseUsage.itemId), asc(phaseUsage.phaseIdx)).limit(1);
1656
+ return rows[0]?.itemId;
1657
+ }
1658
+ async function findItemBySessionId(db, conversationId) {
1659
+ return await fromPhaseSessions(db, conversationId) ?? await fromPhaseUsage(db, conversationId);
1660
+ }
1661
+
1662
+ // src/shared/db/listCommitRefs.ts
1663
+ import { and, asc as asc2, eq as eq2 } from "drizzle-orm";
1664
+ async function listCommitRefs(db, itemId2) {
1665
+ const rows = await db.select({
1666
+ ref: itemGitRefs.ref,
1667
+ title: itemGitRefs.title,
1668
+ url: itemGitRefs.url
1669
+ }).from(itemGitRefs).where(and(eq2(itemGitRefs.itemId, itemId2), eq2(itemGitRefs.kind, "commit"))).orderBy(asc2(itemGitRefs.createdAt), asc2(itemGitRefs.ref));
1670
+ return rows.map((row) => ({
1671
+ sha: row.ref,
1672
+ ...row.title ? { title: row.title } : {},
1673
+ ...row.url ? { url: row.url } : {}
1674
+ }));
1675
+ }
1676
+
1677
+ // src/shared/db/listItemConversationIds.ts
1678
+ import { asc as asc3, eq as eq3 } from "drizzle-orm";
1679
+ async function listItemConversationIds(db, itemId2) {
1680
+ const sessions = await db.select({ id: phaseSessions.claudeSessionId }).from(phaseSessions).where(eq3(phaseSessions.itemId, itemId2)).orderBy(asc3(phaseSessions.phaseIdx), asc3(phaseSessions.createdAt));
1681
+ const usage = await db.select({ id: phaseUsage.claudeSessionId }).from(phaseUsage).where(eq3(phaseUsage.itemId, itemId2)).orderBy(asc3(phaseUsage.phaseIdx));
1682
+ const ids = [...sessions, ...usage].map((row) => row.id).filter((id) => Boolean(id));
1683
+ return [...new Set(ids)];
1684
+ }
1685
+
1686
+ // src/commands/sessions/web/itemCommitSources.ts
1687
+ var LOOKUP_TIMEOUT_MS = 3e3;
1688
+ var NONE = { commits: [], conversationIds: [] };
1689
+ async function lookupItemCommitSources(sessionId) {
1690
+ const db = await getDb();
1691
+ const itemId2 = await findItemBySessionId(db, sessionId);
1692
+ if (itemId2 === void 0) return NONE;
1693
+ return {
1694
+ commits: await listCommitRefs(db, itemId2),
1695
+ conversationIds: await listItemConversationIds(db, itemId2)
1696
+ };
1697
+ }
1698
+ async function itemCommitSources(sessionId) {
1699
+ try {
1700
+ if (!process.env.ASSIST_DATABASE_URL && !loadConfig().database.url)
1701
+ return NONE;
1702
+ return await withTimeout(
1703
+ lookupItemCommitSources(sessionId),
1704
+ LOOKUP_TIMEOUT_MS,
1705
+ "item commits"
1706
+ );
1707
+ } catch {
1708
+ return NONE;
1709
+ }
1710
+ }
1711
+
1699
1712
  // src/commands/sessions/web/parseTranscriptCommitShas.ts
1700
1713
  var COMMIT_OUTPUT = [
1701
1714
  /^\[[^\]\n]+ ([0-9a-f]{7,40})\] /gm,
@@ -1739,6 +1752,26 @@ async function transcriptCommits(cwd, session) {
1739
1752
  return shas.map((sha) => ({ sha }));
1740
1753
  }
1741
1754
 
1755
+ // src/commands/sessions/web/sessionCommits.ts
1756
+ async function sessionCommits(cwd, session) {
1757
+ const sources = await itemCommitSources(session.conversationId);
1758
+ const conversationIds = /* @__PURE__ */ new Set([
1759
+ ...sources.conversationIds,
1760
+ session.conversationId
1761
+ ]);
1762
+ const commits = [...sources.commits];
1763
+ const seen = new Set(commits.map((commit) => commit.sha));
1764
+ for (const conversationId of conversationIds) {
1765
+ const target = { ...session, conversationId };
1766
+ for (const commit of await transcriptCommits(cwd, target)) {
1767
+ if (seen.has(commit.sha)) continue;
1768
+ seen.add(commit.sha);
1769
+ commits.push(commit);
1770
+ }
1771
+ }
1772
+ return commits;
1773
+ }
1774
+
1742
1775
  // src/commands/sessions/web/committedPaths.ts
1743
1776
  var cache = /* @__PURE__ */ new Map();
1744
1777
  var inFlight = /* @__PURE__ */ new Map();
@@ -1762,8 +1795,7 @@ async function committedPaths(cwd, session) {
1762
1795
  return lookup;
1763
1796
  }
1764
1797
  async function loadCommittedPaths(key, cwd, session) {
1765
- const itemCommitRefs = await itemCommits(session.conversationId);
1766
- const commits = itemCommitRefs.length > 0 ? itemCommitRefs : await transcriptCommits(cwd, session);
1798
+ const commits = await sessionCommits(cwd, session);
1767
1799
  const bases = /* @__PURE__ */ new Map();
1768
1800
  for (const commit of commits) {
1769
1801
  const resolved2 = await resolveCommitCached(key, cwd, commit.sha);
@@ -3295,12 +3327,12 @@ function allowAppOrigin(req, res, pathname) {
3295
3327
  }
3296
3328
 
3297
3329
  // src/shared/db/dismissInboxMessage.ts
3298
- import { and as and2, eq as eq3, isNull } from "drizzle-orm";
3330
+ import { and as and2, eq as eq4, isNull } from "drizzle-orm";
3299
3331
  async function dismissInboxMessage(orm, source, messageId) {
3300
3332
  const dismissed = await orm.update(inboxMessages).set({ dismissedAt: /* @__PURE__ */ new Date() }).where(
3301
3333
  and2(
3302
- eq3(inboxMessages.source, source),
3303
- eq3(inboxMessages.messageId, messageId),
3334
+ eq4(inboxMessages.source, source),
3335
+ eq4(inboxMessages.messageId, messageId),
3304
3336
  isNull(inboxMessages.dismissedAt)
3305
3337
  )
3306
3338
  ).returning({ messageId: inboxMessages.messageId });
@@ -5214,14 +5246,14 @@ function slashCommands(req, res) {
5214
5246
  }
5215
5247
 
5216
5248
  // src/shared/db/countUsagePeaks.ts
5217
- import { count, eq as eq4 } from "drizzle-orm";
5249
+ import { count, eq as eq5 } from "drizzle-orm";
5218
5250
  async function countUsagePeaks(db, window) {
5219
- const [row] = await db.select({ value: count() }).from(usagePeaks).where(window ? eq4(usagePeaks.window, window) : void 0);
5251
+ const [row] = await db.select({ value: count() }).from(usagePeaks).where(window ? eq5(usagePeaks.window, window) : void 0);
5220
5252
  return row?.value ?? 0;
5221
5253
  }
5222
5254
 
5223
5255
  // src/shared/db/listUsagePeaks.ts
5224
- import { and as and3, desc as desc2, eq as eq5, getTableColumns } from "drizzle-orm";
5256
+ import { and as and3, desc as desc2, eq as eq6, getTableColumns } from "drizzle-orm";
5225
5257
 
5226
5258
  // src/shared/db/avgContextPerCycle.ts
5227
5259
  import { count as count2, sql } from "drizzle-orm";
@@ -5246,10 +5278,10 @@ async function listUsagePeaks(db, options) {
5246
5278
  }).from(usagePeaks).leftJoin(
5247
5279
  avgContext,
5248
5280
  and3(
5249
- eq5(usagePeaks.window, avgContext.window),
5250
- eq5(usagePeaks.resetsAt, avgContext.resetsAt)
5281
+ eq6(usagePeaks.window, avgContext.window),
5282
+ eq6(usagePeaks.resetsAt, avgContext.resetsAt)
5251
5283
  )
5252
- ).where(options?.window ? eq5(usagePeaks.window, options.window) : void 0).orderBy(
5284
+ ).where(options?.window ? eq6(usagePeaks.window, options.window) : void 0).orderBy(
5253
5285
  desc2(usagePeaks.resetsAt),
5254
5286
  usagePeaks.window,
5255
5287
  desc2(usagePeaks.createdAt),
@@ -5289,26 +5321,26 @@ function listUsageHistory(req, res) {
5289
5321
  }
5290
5322
 
5291
5323
  // src/shared/db/countItemUsageByOrigin.ts
5292
- import { asc as asc3, desc as desc3, eq as eq6, sql as sql2 } from "drizzle-orm";
5324
+ import { asc as asc4, desc as desc3, eq as eq7, sql as sql2 } from "drizzle-orm";
5293
5325
  async function countItemUsageByOrigin(db) {
5294
5326
  const count4 = sql2`count(distinct ${phaseUsage.itemId})::int`;
5295
- const rows = await db.select({ origin: items.origin, count: count4 }).from(items).innerJoin(phaseUsage, eq6(phaseUsage.itemId, items.id)).groupBy(items.origin).orderBy(desc3(count4), asc3(items.origin));
5327
+ const rows = await db.select({ origin: items.origin, count: count4 }).from(items).innerJoin(phaseUsage, eq7(phaseUsage.itemId, items.id)).groupBy(items.origin).orderBy(desc3(count4), asc4(items.origin));
5296
5328
  return rows.map((row) => ({ origin: row.origin, count: Number(row.count) }));
5297
5329
  }
5298
5330
 
5299
5331
  // src/shared/db/itemUsageWhere.ts
5300
- import { and as and4, eq as eq7, notInArray } from "drizzle-orm";
5332
+ import { and as and4, eq as eq8, notInArray } from "drizzle-orm";
5301
5333
  function parseItemUsageStatus(value) {
5302
5334
  return value === "done" || value === "running" ? value : void 0;
5303
5335
  }
5304
5336
  function statusClause(status) {
5305
- if (status === "done") return eq7(items.status, "done");
5337
+ if (status === "done") return eq8(items.status, "done");
5306
5338
  if (status === "running") return notInArray(items.status, ["done", "wontdo"]);
5307
5339
  return void 0;
5308
5340
  }
5309
5341
  function itemUsageWhere(filter) {
5310
5342
  return and4(
5311
- filter?.origin ? eq7(items.origin, filter.origin) : void 0,
5343
+ filter?.origin ? eq8(items.origin, filter.origin) : void 0,
5312
5344
  statusClause(filter?.status)
5313
5345
  );
5314
5346
  }
@@ -5333,7 +5365,7 @@ function parseItemUsageSort(field, direction) {
5333
5365
  }
5334
5366
 
5335
5367
  // src/shared/db/itemUsageStats.ts
5336
- import { eq as eq8, sql as sql3 } from "drizzle-orm";
5368
+ import { eq as eq9, sql as sql3 } from "drizzle-orm";
5337
5369
  function median(value) {
5338
5370
  return sql3`coalesce(percentile_cont(0.5) within group (order by (${value})::double precision), 0)`;
5339
5371
  }
@@ -5349,7 +5381,7 @@ async function itemUsageStats(db, options) {
5349
5381
  ),
5350
5382
  medianActiveMs: median(totals.activeMs),
5351
5383
  medianTokens: median(sql3`${totals.tokensUp} + ${totals.tokensDown}`)
5352
- }).from(items).innerJoin(totals, eq8(totals.itemId, items.id)).leftJoin(planned, eq8(planned.itemId, items.id)).where(itemUsageWhere(options));
5384
+ }).from(items).innerJoin(totals, eq9(totals.itemId, items.id)).leftJoin(planned, eq9(planned.itemId, items.id)).where(itemUsageWhere(options));
5353
5385
  return {
5354
5386
  itemCount: Number(row?.itemCount ?? 0),
5355
5387
  doneCount: Number(row?.doneCount ?? 0),
@@ -5361,7 +5393,7 @@ async function itemUsageStats(db, options) {
5361
5393
  }
5362
5394
 
5363
5395
  // src/shared/db/listItemUsageSummaries.ts
5364
- import { eq as eq9 } from "drizzle-orm";
5396
+ import { eq as eq10 } from "drizzle-orm";
5365
5397
 
5366
5398
  // src/shared/db/itemUsageOrderBy.ts
5367
5399
  import { desc as desc4, sql as sql4 } from "drizzle-orm";
@@ -5422,7 +5454,7 @@ async function listItemUsageSummaries(db, options) {
5422
5454
  activeMs: totals.activeMs,
5423
5455
  peakContextPct: totals.peakContextPct,
5424
5456
  lastPhaseAt: lastPhase.atIso
5425
- }).from(items).innerJoin(totals, eq9(totals.itemId, items.id)).leftJoin(planned, eq9(planned.itemId, items.id)).leftJoin(lastPhase, eq9(lastPhase.itemId, items.id)).where(itemUsageWhere(options)).orderBy(
5457
+ }).from(items).innerJoin(totals, eq10(totals.itemId, items.id)).leftJoin(planned, eq10(planned.itemId, items.id)).leftJoin(lastPhase, eq10(lastPhase.itemId, items.id)).where(itemUsageWhere(options)).orderBy(
5426
5458
  ...itemUsageOrderBy({ totals, planned, lastPhase }, options?.sort)
5427
5459
  );
5428
5460
  const rows = options?.limit === void 0 ? await query : await query.limit(options.limit).offset(options.offset ?? 0);
@@ -5449,7 +5481,7 @@ function listUsageItems(req, res) {
5449
5481
  }
5450
5482
 
5451
5483
  // src/shared/db/jobRunTotals.ts
5452
- import { and as and5, desc as desc5, eq as eq10, gte, sql as sql6 } from "drizzle-orm";
5484
+ import { and as and5, desc as desc5, eq as eq11, gte, sql as sql6 } from "drizzle-orm";
5453
5485
  var total = (column) => sql6`coalesce(sum(${column}), 0)`.mapWith(Number);
5454
5486
  async function jobRunTotals(db, since) {
5455
5487
  const inWindow = gte(jobRuns.startedAt, since);
@@ -5467,7 +5499,7 @@ async function jobRunTotals(db, since) {
5467
5499
  Number
5468
5500
  )
5469
5501
  }).from(jobRuns).where(inWindow),
5470
- db.select({ kind: jobRuns.kind, startedAt: jobRuns.startedAt }).from(jobRuns).where(and5(inWindow, eq10(jobRuns.status, "failed"))).orderBy(desc5(jobRuns.startedAt)).limit(1)
5502
+ db.select({ kind: jobRuns.kind, startedAt: jobRuns.startedAt }).from(jobRuns).where(and5(inWindow, eq11(jobRuns.status, "failed"))).orderBy(desc5(jobRuns.startedAt)).limit(1)
5471
5503
  ]);
5472
5504
  return {
5473
5505
  runs: byKind.reduce((sum, row) => sum + row.runs, 0),
@@ -5478,11 +5510,11 @@ async function jobRunTotals(db, since) {
5478
5510
  }
5479
5511
 
5480
5512
  // src/shared/db/listJobRuns.ts
5481
- import { and as and6, count as count3, desc as desc6, eq as eq11 } from "drizzle-orm";
5513
+ import { and as and6, count as count3, desc as desc6, eq as eq12 } from "drizzle-orm";
5482
5514
  async function listJobRuns(db, range, filters = {}) {
5483
5515
  const where = and6(
5484
- filters.kind ? eq11(jobRuns.kind, filters.kind) : void 0,
5485
- filters.trigger ? eq11(jobRuns.trigger, filters.trigger) : void 0
5516
+ filters.kind ? eq12(jobRuns.kind, filters.kind) : void 0,
5517
+ filters.trigger ? eq12(jobRuns.trigger, filters.trigger) : void 0
5486
5518
  );
5487
5519
  const [rows, [{ total: total2 }]] = await Promise.all([
5488
5520
  db.select().from(jobRuns).where(where).orderBy(desc6(jobRuns.startedAt), desc6(jobRuns.id)).limit(range.limit).offset(range.offset),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  firstBrokenHop
3
- } from "./chunk-I6OGHKVJ.js";
3
+ } from "./chunk-PKQVQB35.js";
4
4
  import {
5
5
  describePeerError
6
6
  } from "./chunk-VABNWHSE.js";
@@ -1,7 +1,7 @@
1
1
  // package.json
2
2
  var package_default = {
3
3
  name: "@staff0rd/assist",
4
- version: "0.1202.1",
4
+ version: "0.1204.0",
5
5
  type: "module",
6
6
  main: "dist/index.js",
7
7
  bin: {
@@ -14,7 +14,7 @@ import {
14
14
  isHello,
15
15
  linkVersionCheck,
16
16
  negotiateProtocol
17
- } from "./chunk-OVZHJ4ES.js";
17
+ } from "./chunk-IPURXJPM.js";
18
18
 
19
19
  // src/commands/sessions/nodes/probePeerHello.ts
20
20
  var HELLO_TIMEOUT_MS = 5e3;
@@ -21,7 +21,7 @@ import {
21
21
  isApprovedRead,
22
22
  resolvePermission,
23
23
  splitCompound
24
- } from "./chunk-ZQGAGLBO.js";
24
+ } from "./chunk-IFOKZRUY.js";
25
25
  import {
26
26
  inWebSession
27
27
  } from "./chunk-HKGCLAZ7.js";
@@ -311,7 +311,7 @@ var PATTERN_DENIES = [
311
311
  },
312
312
  {
313
313
  pattern: "gh issue edit",
314
- message: "Do not run 'gh issue edit' directly. Use 'assist github issue edit <number> [-R <owner>/<repo>] [--body <body>]' instead \u2014 it opens the body in the assist web preview pane and pushes nothing back until the user approves it. When you already know the body you want, pass it with --body (--body - reads stdin) so the first preview shows your proposal; without --body the pane shows the issue's current body. To make a targeted change to the current body, run it with --fetch first, which writes that body to a working file and prints its path without opening a preview; edit the file, then re-run without --fetch so the first preview shows your revision. Run 'assist github issue edit --help' for how the working file and the preview pane fit together; it is authoritative on how approval is handled in this environment. To remove an assignee, use 'assist github issue unassign <number> [-R <owner>/<repo>] [--assignee <login>...]' (it removes you when --assignee is omitted)."
314
+ message: "Do not run 'gh issue edit' directly. Use 'assist github issue edit <number> [-R <owner>/<repo>] [--body <body>] [--title <title>]' instead \u2014 it opens the body in the assist web preview pane and pushes nothing back until the user approves it. To rename an issue, use 'assist github issue edit <number> --title <title>'. When you already know the body you want, pass it with --body (--body - reads stdin) so the first preview shows your proposal; without --body the pane shows the issue's current body. To make a targeted change to the current body, run it with --fetch first, which writes that body to a working file and prints its path without opening a preview; edit the file, then re-run without --fetch so the first preview shows your revision. Run 'assist github issue edit --help' for how the working file and the preview pane fit together; it is authoritative on how approval is handled in this environment. To remove an assignee, use 'assist github issue unassign <number> [-R <owner>/<repo>] [--assignee <login>...]' (it removes you when --assignee is omitted)."
315
315
  },
316
316
  {
317
317
  pattern: "gh issue comment",
@@ -331,7 +331,7 @@ var PATTERN_DENIES = [
331
331
  enabled: () => loadConfig().cliHook?.blockNpmRun !== false
332
332
  }
333
333
  ];
334
- var GH_ISSUE_API_MESSAGE = "Do not write to GitHub issues with 'gh api' (REST issue endpoints or GraphQL issue mutations) \u2014 it bypasses the content validation and the approval pane that every outward-facing issue write goes through. Use 'assist github issue create --title <title> --body <body>' to open an issue, 'assist github issue edit <number>' to rework one's body, 'assist github issue comment <number> --body <body>' to post a comment, or 'assist github issue edit-comment <comment-id> --body <body>' to amend a comment that is already posted. Each validates the content and gates it on the user's approval before anything reaches GitHub; run the command's --help for how to compose it. To remove an assignee, use 'assist github issue unassign <number> [-R <owner>/<repo>] [--assignee <login>...]' (it removes you when --assignee is omitted).";
334
+ var GH_ISSUE_API_MESSAGE = "Do not write to GitHub issues with 'gh api' (REST issue endpoints or GraphQL issue mutations) \u2014 it bypasses the content validation and the approval pane that every outward-facing issue write goes through. Use 'assist github issue create --title <title> --body <body>' to open an issue, 'assist github issue edit <number>' to rework one's body, 'assist github issue edit <number> --title <title>' to rename one, 'assist github issue comment <number> --body <body>' to post a comment, or 'assist github issue edit-comment <comment-id> --body <body>' to amend a comment that is already posted. Each validates the content and gates it on the user's approval before anything reaches GitHub; run the command's --help for how to compose it. To remove an assignee, use 'assist github issue unassign <number> [-R <owner>/<repo>] [--assignee <login>...]' (it removes you when --assignee is omitted).";
335
335
  var BRANCH_CREATION_MESSAGE = "Do not create branches with raw git. Use the /branch command, or 'assist branch <slug> [--jira <KEY>]' \u2014 it branches off the fresh remote default and enforces the team naming convention.";
336
336
  var CLOSE_WITH_COMMENT_MESSAGE = "Do not post a comment through 'gh issue close', 'gh issue reopen' or 'gh pr close' with --comment/-c \u2014 it goes to GitHub without the approval pane. Post the comment first with 'assist github issue comment <number> --body <body> [-R <owner>/<repo>]', which validates it and gates it on the user's approval, then run the same close/reopen without --comment.";
337
337
  var CLOSE_WITH_COMMENT_REGEX = /gh (?:issue (?:close|reopen)|pr close)[^;&|]*? (?:--comment|-c)/;
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5CNDLMYO.js";
4
4
  import {
5
5
  package_default
6
- } from "./chunk-U5AOBFPH.js";
6
+ } from "./chunk-F2ENQO3B.js";
7
7
  import {
8
8
  loadConfig
9
9
  } from "./chunk-UFSOFNXQ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  buildDoctorProbes,
3
3
  diagnoseLink
4
- } from "./chunk-HT7S6EQJ.js";
4
+ } from "./chunk-HAIHM63W.js";
5
5
  import {
6
6
  findLinkSpec
7
7
  } from "./chunk-J2PPCMCR.js";