@eliya-oss/agent-diff 0.1.0-alpha.169 → 0.1.0-alpha.170

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 (3) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/main.js +208 -17
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.170
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(marks): marking a file read asks whether to settle the threads it still holds.
8
+
9
+ <details><summary>What it asks</summary>
10
+
11
+ `m` and `M` open a box naming the file, or the layer on a reading order, and counting its open
12
+ threads. The first answer settles those threads and marks; the second marks and leaves them open;
13
+ escape marks nothing. The last layer of a file also counts the threads no layer explains, and
14
+ remarks are never counted, because a remark is triaged rather than settled.
15
+
16
+ </details>
17
+
3
18
  ## 0.1.0-alpha.169
4
19
 
5
20
  ### Patch Changes
package/dist/main.js CHANGED
@@ -11421,7 +11421,7 @@ var init_pane = __esmMin((() => {
11421
11421
  //#region package.json
11422
11422
  init_drafts();
11423
11423
  init_pane();
11424
- var version$1 = "0.1.0-alpha.169";
11424
+ var version$1 = "0.1.0-alpha.170";
11425
11425
  //#endregion
11426
11426
  //#region src/cli/upgrade.ts
11427
11427
  var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf$1, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
@@ -14085,7 +14085,7 @@ var init_tree = __esmMin((() => {
14085
14085
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
14086
14086
  };
14087
14087
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
14088
- })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refSaidOf, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14088
+ })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, coveredBy, lastLayerOf, threadsInLayer, threadsOpenOn, askedRows, withAsking, asksAbout, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refSaidOf, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14089
14089
  var init_model$1 = __esmMin((() => {
14090
14090
  init_dist();
14091
14091
  init_patch();
@@ -14140,6 +14140,8 @@ var init_model$1 = __esmMin((() => {
14140
14140
  railRows: 12,
14141
14141
  railScroll: -1,
14142
14142
  settingsIndex: 0,
14143
+ asking: void 0,
14144
+ askIndex: 0,
14143
14145
  now: 0,
14144
14146
  focusWas: "diff"
14145
14147
  };
@@ -14513,6 +14515,54 @@ var init_model$1 = __esmMin((() => {
14513
14515
  stand: stands.reduce(louder, "gone")
14514
14516
  };
14515
14517
  };
14518
+ coveredBy = (layer, path, entry) => entry.side === "new" && layer.spans.some((span) => span.path === path && entry.start <= span.end && entry.end >= span.start);
14519
+ lastLayerOf = (state, fileIndex, layerIndex) => state.layers.every((layer, at) => at === layerIndex || !layer.spans.some((span) => span.path === state.patches[fileIndex]?.path) || readIn(state, at, fileIndex));
14520
+ threadsInLayer = (state, fileIndex, layerIndex) => {
14521
+ const patch = state.patches[fileIndex];
14522
+ const layer = state.layers[layerIndex];
14523
+ if (patch === void 0 || layer === void 0) return [];
14524
+ return threadsOpenOn(state, fileIndex).filter((entry) => coveredBy(layer, patch.path, entry));
14525
+ };
14526
+ threadsOpenOn = (state, fileIndex, layerIndex) => {
14527
+ const patch = state.patches[fileIndex];
14528
+ if (patch === void 0) return [];
14529
+ const open = state.sent.filter((entry) => entry.file === patch.path && entry.removed !== true && entry.settled !== true);
14530
+ const layer = layerIndex === void 0 ? void 0 : state.layers[layerIndex];
14531
+ if (layer === void 0 || layerIndex === void 0) return open;
14532
+ const last = lastLayerOf(state, fileIndex, layerIndex);
14533
+ const claimed = (entry) => state.layers.some((one) => coveredBy(one, patch.path, entry));
14534
+ return open.filter((entry) => coveredBy(layer, patch.path, entry) || last && !claimed(entry));
14535
+ };
14536
+ askedRows = (state) => {
14537
+ const asking = state.asking;
14538
+ const what = asking?.layer === void 0 ? "file" : "layer";
14539
+ const many = (asking?.threads.length ?? 0) === 1 ? "it" : "them";
14540
+ return [`Settle ${many} and mark the ${what} read`, `Mark the ${what} read and leave ${many} open`].map((title, at) => ({
14541
+ title,
14542
+ here: at === state.askIndex
14543
+ }));
14544
+ };
14545
+ withAsking = (state, asking) => ({
14546
+ ...state,
14547
+ screen: "settling",
14548
+ returnTo: state.screen,
14549
+ asking,
14550
+ askIndex: 0
14551
+ });
14552
+ asksAbout = (state) => {
14553
+ const asking = state.asking;
14554
+ if (asking === void 0) return {
14555
+ name: "",
14556
+ path: false,
14557
+ tail: ""
14558
+ };
14559
+ const many = asking.threads.length;
14560
+ return {
14561
+ name: asking.layer ?? asking.path,
14562
+ path: asking.layer === void 0,
14563
+ tail: ` still holds ${many} open thread${many === 1 ? "" : "s"}`
14564
+ };
14565
+ };
14516
14566
  hiddenLines = (state) => shownOf(state)?.gaps.reduce((total, gap) => total + gap.hidden, 0) ?? 0;
14517
14567
  rowsUnder = (patch, entry) => patch.rows.filter((row) => match$3(row.newLine, {
14518
14568
  onNone: () => false,
@@ -15538,6 +15588,39 @@ var init_command = __esmMin((() => {
15538
15588
  hint: "base",
15539
15589
  rank: 5
15540
15590
  }),
15591
+ command({
15592
+ action: "ask.take",
15593
+ title: "Take the answer under the cursor",
15594
+ category: "Files",
15595
+ keys: ["return"],
15596
+ screens: ["settling"],
15597
+ listed: false
15598
+ }),
15599
+ command({
15600
+ action: "ask.next",
15601
+ title: "Next answer",
15602
+ category: "Files",
15603
+ keys: ["down", "j"],
15604
+ screens: ["settling"],
15605
+ listed: false
15606
+ }),
15607
+ command({
15608
+ action: "ask.prev",
15609
+ title: "Previous answer",
15610
+ category: "Files",
15611
+ keys: ["up", "k"],
15612
+ screens: ["settling"],
15613
+ listed: false
15614
+ }),
15615
+ command({
15616
+ action: "back",
15617
+ title: "Mark nothing",
15618
+ category: "Files",
15619
+ keys: ["escape", "q"],
15620
+ screens: ["settling"],
15621
+ hint: "back",
15622
+ listed: false
15623
+ }),
15541
15624
  command({
15542
15625
  action: "base.set",
15543
15626
  title: "Use the one under the cursor",
@@ -16138,7 +16221,7 @@ var init_match = __esmMin((() => {
16138
16221
  }));
16139
16222
  //#endregion
16140
16223
  //#region src/tui/reduce.ts
16141
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, atLayer, moveLayer, inRail, railScrolled, movePanel, layerDown, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, paneShown, panesShown, focusStepped, togglePanel, toggleNav, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, foldMoved, overFold, readingThread, overThread, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, BACK_FROM, goBack, walkMatches, openPalette, openKeys, openSettings, moveSettings, flipSetting, moveRef, withChoices, withRefs, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withRemarks, withSent, withArrived, withColumns, laidOver, onLayerHolding, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withAround, withNoticeHere, withNotice;
16224
+ var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, atLayer, moveLayer, inRail, railScrolled, movePanel, layerDown, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, paneShown, panesShown, focusStepped, togglePanel, toggleNav, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, foldMoved, overFold, readingThread, overThread, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, BACK_FROM, goBack, walkMatches, openPalette, openKeys, openSettings, moveSettings, flipSetting, moveAsk, moveRef, withChoices, withRefs, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withRemarks, withSent, withArrived, withColumns, laidOver, onLayerHolding, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withAround, withNoticeHere, withNotice;
16142
16225
  var init_reduce = __esmMin((() => {
16143
16226
  init_dist();
16144
16227
  init_patch();
@@ -16647,6 +16730,11 @@ var init_reduce = __esmMin((() => {
16647
16730
  ...state,
16648
16731
  screen: state.returnTo,
16649
16732
  query: ""
16733
+ }),
16734
+ settling: (state) => ({
16735
+ ...state,
16736
+ screen: state.returnTo,
16737
+ asking: void 0
16650
16738
  })
16651
16739
  };
16652
16740
  goBack = (state) => BACK_FROM[state.screen]?.(state) ?? outOfDiff(state);
@@ -16684,6 +16772,10 @@ var init_reduce = __esmMin((() => {
16684
16772
  const held = chosenNow(state);
16685
16773
  return withChosen(state, wanted.name, !(held[wanted.name] ?? wanted.byDefault));
16686
16774
  };
16775
+ moveAsk = (state, delta) => ({
16776
+ ...state,
16777
+ askIndex: clamp(state.askIndex + delta, 0, askedRows(state).length - 1)
16778
+ });
16687
16779
  moveRef = (state, delta) => ({
16688
16780
  ...state,
16689
16781
  refIndex: clamp(state.refIndex + delta, 0, Math.max(0, refsShown(state).length - 1))
@@ -16819,6 +16911,9 @@ var init_reduce = __esmMin((() => {
16819
16911
  "match.next": (state) => walkMatches(state, 1),
16820
16912
  "match.prev": (state) => walkMatches(state, -1),
16821
16913
  "selection.copy": (state) => state,
16914
+ "ask.take": (state) => state,
16915
+ "ask.next": (state) => moveAsk(state, 1),
16916
+ "ask.prev": (state) => moveAsk(state, -1),
16822
16917
  back: goBack,
16823
16918
  quit: (state) => state
16824
16919
  };
@@ -17974,7 +18069,7 @@ var init_diffview = __esmMin((() => {
17974
18069
  }));
17975
18070
  //#endregion
17976
18071
  //#region src/tui/render.ts
17977
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, SENDS, REPLIES, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, LEGEND_ROWS, LEGEND, legendText, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, makeReaderParts, makeSettingsParts, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, remarksOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, standingOnThread, standingOnRemark, standingOnDismissed, offeredIn, readerTitle, voicesOf, readerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks, pickingTitle, YOURS, YOUR_REF, pickedTail, REMARK_MARK, remarkWhere, wherePart, panelFile, panelWhere, panelBody, panelMark, lostCode, lostEntry, writtenOn, foldLine, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelPicked, panelText, Screen;
18072
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, SENDS, REPLIES, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, LEGEND_ROWS, LEGEND, legendText, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, askText, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, makeAskParts, makeReaderParts, makeSettingsParts, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, remarksOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, standingOnThread, standingOnRemark, standingOnDismissed, offeredIn, readerTitle, voicesOf, readerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks, pickingTitle, YOURS, YOUR_REF, pickedTail, REMARK_MARK, remarkWhere, wherePart, panelFile, panelWhere, panelBody, panelMark, lostCode, lostEntry, writtenOn, foldLine, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelPicked, panelText, Screen;
17978
18073
  var init_render = __esmMin((() => {
17979
18074
  init_dist();
17980
18075
  init_command();
@@ -18359,6 +18454,13 @@ var init_render = __esmMin((() => {
18359
18454
  }
18360
18455
  return new StyledText(drawn);
18361
18456
  };
18457
+ askText = (state, room) => {
18458
+ const drawn = askedRows(state).map((row) => {
18459
+ const head = `${row.here ? marks().cursor : " "} ${row.title}`;
18460
+ return row.here ? bg(palette.selection)(fg(palette.ink)(`${head.padEnd(room)}\n`)) : fg(palette.muted)(`${head.padEnd(room)}\n`);
18461
+ });
18462
+ return new StyledText(drawn);
18463
+ };
18362
18464
  SETTING_LEAD = 4;
18363
18465
  settingsText = (rows, room) => {
18364
18466
  const drawn = rows.flatMap((row) => {
@@ -18392,7 +18494,8 @@ var init_render = __esmMin((() => {
18392
18494
  keys: makeKeysParts(renderer),
18393
18495
  settings: makeSettingsParts(renderer),
18394
18496
  reader: makeReaderParts(renderer),
18395
- bases: makeBaseParts(renderer)
18497
+ bases: makeBaseParts(renderer),
18498
+ ask: makeAskParts(renderer)
18396
18499
  });
18397
18500
  makeBaseParts = (renderer) => {
18398
18501
  const box = makePalette(renderer);
@@ -18410,6 +18513,19 @@ var init_render = __esmMin((() => {
18410
18513
  choices
18411
18514
  };
18412
18515
  };
18516
+ makeAskParts = (renderer) => {
18517
+ const box = makePalette(renderer);
18518
+ const title = bar(renderer, "ask-title", palette.faint);
18519
+ const choices = makeChoices(renderer);
18520
+ box.id = "ask";
18521
+ box.add(title);
18522
+ box.add(choices);
18523
+ return {
18524
+ box,
18525
+ title,
18526
+ choices
18527
+ };
18528
+ };
18413
18529
  makeReaderParts = (renderer) => {
18414
18530
  const box = makePalette(renderer);
18415
18531
  const title = bar(renderer, "reader-title", palette.faint);
@@ -19268,6 +19384,7 @@ var init_render = __esmMin((() => {
19268
19384
  keysQuery;
19269
19385
  keysChoices;
19270
19386
  keysLegend;
19387
+ ask;
19271
19388
  reader;
19272
19389
  foundBox;
19273
19390
  renderer;
@@ -19320,6 +19437,7 @@ var init_render = __esmMin((() => {
19320
19437
  this.keysLegend = modals.keys.legend;
19321
19438
  this.baseBox = modals.bases;
19322
19439
  this.reader = modals.reader;
19440
+ this.ask = modals.ask;
19323
19441
  this.foundBox = modals.found;
19324
19442
  this.assemble(renderer);
19325
19443
  }
@@ -19448,6 +19566,7 @@ var init_render = __esmMin((() => {
19448
19566
  this.paintSettings(state);
19449
19567
  this.paintBases(state);
19450
19568
  this.paintReader(state);
19569
+ this.paintAsk(state);
19451
19570
  this.paintFound(state);
19452
19571
  this.paintReport(state);
19453
19572
  this.scrim.visible = state.screen !== "branches" && state.screen !== "review";
@@ -19514,6 +19633,24 @@ var init_render = __esmMin((() => {
19514
19633
  this.settings.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
19515
19634
  this.settings.top = panelTop(this.renderer.height, PANEL_QUARTER);
19516
19635
  }
19636
+ paintAsk(state) {
19637
+ this.ask.box.visible = state.screen === "settling";
19638
+ if (state.screen !== "settling") {
19639
+ this.ask.title.content = "";
19640
+ this.ask.choices.content = "";
19641
+ return;
19642
+ }
19643
+ const room = panelWidth(this.renderer.width);
19644
+ const asked = asksAbout(state);
19645
+ const forName = Math.max(8, room - MODAL_ROOM - asked.tail.length);
19646
+ const name = asked.path ? clipPath(asked.name, forName) : clipMiddle(asked.name, forName);
19647
+ this.ask.title.content = `${name}${asked.tail}`;
19648
+ this.ask.choices.content = askText(state, room - MODAL_ROOM);
19649
+ this.ask.box.height = askedRows(state).length + PALETTE_CHROME;
19650
+ this.ask.box.width = room;
19651
+ this.ask.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
19652
+ this.ask.box.top = panelTop(this.renderer.height, PANEL_QUARTER);
19653
+ }
19517
19654
  paintReader(state) {
19518
19655
  const entry = panelEntry(state);
19519
19656
  this.reader.box.visible = state.screen === "thread" && entry !== void 0;
@@ -19713,6 +19850,7 @@ var init_render = __esmMin((() => {
19713
19850
  this.keys,
19714
19851
  this.settings,
19715
19852
  this.reader.box,
19853
+ this.ask.box,
19716
19854
  this.baseBox.box
19717
19855
  ]);
19718
19856
  }
@@ -20076,7 +20214,7 @@ var init_upgrade = __esmMin((() => {
20076
20214
  }));
20077
20215
  //#endregion
20078
20216
  //#region src/tui/app.ts
20079
- var LEAVING_MS, LOOK_MS, LEAST_TERM, AGE_TICK_MS, LEAVING_SAID, NOTHING_WRITTEN, WORTH_TIMING_MS, TIMES_KEPT, SLOWEST_KEPT, NOTHING_COUNTED, READING_PULL, FORGE_QUIET, countOf, leavingSaid, LAYERS_ASK_LEAD, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, ranAside, onThePath, saveEditor, editorTold, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
20217
+ var LEAVING_MS, LOOK_MS, LEAST_TERM, AGE_TICK_MS, LEAVING_SAID, NOTHING_WRITTEN, WORTH_TIMING_MS, TIMES_KEPT, SLOWEST_KEPT, NOTHING_COUNTED, READING_PULL, FORGE_QUIET, countOf, leavingSaid, LAYERS_ASK_LEAD, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, ranAside, onThePath, saveEditor, editorTold, copyToClipboard, lineUnder, asKey, openedPull, markedIs, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
20080
20218
  var init_app = __esmMin((() => {
20081
20219
  init_dist();
20082
20220
  init_report();
@@ -20226,6 +20364,7 @@ var init_app = __esmMin((() => {
20226
20364
  if (!opened) return "could not reach the pull request";
20227
20365
  return state.length === 0 ? "opened the pull request" : `opened the ${state} pull request`;
20228
20366
  };
20367
+ markedIs = (path, settled) => settled === 0 ? `marked ${path}` : `marked ${path} and settled ${settled} thread${settled === 1 ? "" : "s"}`;
20229
20368
  LISTENS = /* @__PURE__ */ new Set([
20230
20369
  "keys",
20231
20370
  "palette",
@@ -20243,7 +20382,8 @@ var init_app = __esmMin((() => {
20243
20382
  "settings",
20244
20383
  "base",
20245
20384
  "editor",
20246
- "thread"
20385
+ "thread",
20386
+ "settling"
20247
20387
  ]);
20248
20388
  overReview = (screen) => OVER.has(screen);
20249
20389
  writesInto = (screen) => WRITES.has(screen);
@@ -20716,6 +20856,9 @@ var init_app = __esmMin((() => {
20716
20856
  "layers.ask": () => this.askForLayers(),
20717
20857
  "file.vouch": () => this.vouch(false),
20718
20858
  "file.vouch.next": () => this.vouch(true),
20859
+ "ask.take": () => this.tookTheAnswer(),
20860
+ "ask.next": () => sync(() => this.commit(reduce(this.measured(), "ask.next"))),
20861
+ "ask.prev": () => sync(() => this.commit(reduce(this.measured(), "ask.prev"))),
20719
20862
  "thread.settle": () => this.settleHere(),
20720
20863
  "thread.settleRead": () => this.settleWhatIsRead(),
20721
20864
  "thread.remove": () => this.removeHere(),
@@ -21517,33 +21660,81 @@ var init_app = __esmMin((() => {
21517
21660
  }
21518
21661
  vouch(advance) {
21519
21662
  return gen({ self: this }, function* () {
21520
- const branch = selectedBranch(this.state);
21521
21663
  const patch = selectedPatch(this.state);
21522
- if (branch === void 0 || patch === void 0) return;
21664
+ const branch = selectedBranch(this.state);
21665
+ if (patch === void 0 || branch === void 0) return;
21523
21666
  if (advance && this.readHere()) {
21524
21667
  this.commit(alongFrom(this.state));
21525
21668
  return;
21526
21669
  }
21527
- const report = yield* this.vouching(branch.branch, patch.path);
21670
+ const threads = (this.readHere() ? [] : this.threadsToAsk()).flatMap((entry) => entry.id === void 0 ? [] : [entry.id]);
21671
+ if (threads.length === 0) {
21672
+ yield* this.marking(patch.path, advance, 0);
21673
+ return;
21674
+ }
21675
+ const layer = this.layerAsked(threads.length);
21676
+ this.commit(withAsking(this.measured(), {
21677
+ path: patch.path,
21678
+ layer,
21679
+ threads,
21680
+ advance
21681
+ }));
21682
+ });
21683
+ }
21684
+ layerAsked(asked) {
21685
+ if (this.partHereNow() === void 0) return void 0;
21686
+ if (threadsInLayer(this.state, this.state.patchIndex, this.state.layerIndex).length !== asked) return void 0;
21687
+ return this.state.layers[this.state.layerIndex]?.title;
21688
+ }
21689
+ threadsToAsk() {
21690
+ const layered = this.partHereNow() === void 0 ? void 0 : this.state.layerIndex;
21691
+ return threadsOpenOn(this.state, this.state.patchIndex, layered);
21692
+ }
21693
+ tookTheAnswer() {
21694
+ return gen({ self: this }, function* () {
21695
+ const asking = this.state.asking;
21696
+ const branch = selectedBranch(this.state);
21697
+ if (asking === void 0 || branch === void 0) return;
21698
+ const settling = this.state.askIndex === 0;
21699
+ const named = asking.layer ?? asking.path;
21700
+ if (settling) yield* this.settleThese(branch.branch, asking.threads);
21701
+ this.commit(reduce(this.measured(), "back"));
21702
+ yield* this.marking(asking.path, asking.advance, settling ? asking.threads.length : 0, named);
21703
+ });
21704
+ }
21705
+ settleThese(branch, ids) {
21706
+ return gen({ self: this }, function* () {
21707
+ for (const id of ids) yield* this.settling(branch, id);
21708
+ const sent = yield* this.loadSent(branch);
21709
+ this.commit(withSent(this.state, sent));
21710
+ });
21711
+ }
21712
+ marking(path, advance, settled, named = path) {
21713
+ return gen({ self: this }, function* () {
21714
+ const branch = selectedBranch(this.state);
21715
+ if (branch === void 0) return;
21716
+ const report = yield* this.vouching(branch.branch, path);
21528
21717
  const next = withVouched(this.state, report.vouched, report.parts);
21529
21718
  if (!advance) {
21530
- this.commit(withNotice(next, this.markedSaid(report, patch.path)));
21719
+ this.commit(withNotice(next, this.markedSaid(report, path, settled, named)));
21531
21720
  return;
21532
21721
  }
21533
- this.movedOn(next, patch.path);
21722
+ this.movedOn(next, named, settled);
21534
21723
  });
21535
21724
  }
21536
- markedSaid(report, path) {
21725
+ markedSaid(report, path, settled, named) {
21537
21726
  const part = this.partHereNow();
21538
- return (part === void 0 ? report.vouched.includes(path) : report.parts.includes(part)) ? `marked ${path}` : `unmarked ${path}`;
21727
+ return (part === void 0 ? report.vouched.includes(path) : report.parts.includes(part)) ? markedIs(named, settled) : `unmarked ${named}`;
21539
21728
  }
21540
- movedOn(next, path) {
21729
+ movedOn(next, path, settled) {
21730
+ const said = markedIs(path, settled);
21541
21731
  const target = nextUnreviewed(next, next.patchIndex);
21542
21732
  if (target === void 0) {
21543
- this.commit(withNotice(next, "every file reviewed"));
21733
+ const done = settled === 0 ? "every file reviewed" : `${said}, and every file reviewed`;
21734
+ this.commit(withNotice(next, done));
21544
21735
  return;
21545
21736
  }
21546
- this.commit(withNotice(atFile(next, target), `marked ${path}`));
21737
+ this.commit(withNotice(atFile(next, target), said));
21547
21738
  }
21548
21739
  forgetLeaving() {
21549
21740
  if (this.leaving === void 0) return;
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "bin": {
24
24
  "adiff": "./bin/adiff.js"
25
25
  },
26
- "version": "0.1.0-alpha.169",
26
+ "version": "0.1.0-alpha.170",
27
27
  "description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
28
28
  "license": "MIT",
29
29
  "repository": {