@sealant/mend 0.37.0-next.1197 → 0.37.0-next.1397
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/agent-skill.md +287 -0
- package/dist/{chunk-EX5C6Y5A.js → chunk-ACIZ2XQQ.js} +10385 -7026
- package/dist/{dashboard-3WCED6AO.js → dashboard-7YGTCNL2.js} +109 -193
- package/dist/main.js +19540 -18890
- package/man/mend-access-keys-create.1 +27 -0
- package/man/mend-access-keys-list.1 +17 -0
- package/man/mend-access-keys-revoke.1 +15 -0
- package/man/mend-accounts.1 +1 -1
- package/man/mend-adopt.1 +6 -1
- package/man/mend-agent-install.1 +15 -0
- package/man/mend-agent-logins.1 +1 -1
- package/man/mend-attach.1 +1 -1
- package/man/mend-change.1 +18 -0
- package/man/mend-codex.1 +9 -1
- package/man/mend-comment-add.1 +24 -0
- package/man/mend-comment-send.1 +18 -0
- package/man/mend-completions.1 +1 -1
- package/man/mend-connect-executor.1 +24 -0
- package/man/mend-connect-pi.1 +4 -1
- package/man/mend-connect-status.1 +15 -0
- package/man/mend-connect.1 +36 -1
- package/man/mend-continue.1 +1 -1
- package/man/mend-diff.1 +24 -0
- package/man/mend-doctor.1 +12 -3
- package/man/mend-doppler-connect.1 +11 -0
- package/man/mend-doppler-disconnect.1 +11 -0
- package/man/mend-doppler-status.1 +11 -0
- package/man/mend-doppler-use.1 +15 -0
- package/man/mend-doppler.1 +15 -0
- package/man/mend-dotfiles-repo.1 +1 -1
- package/man/mend-dotfiles-sync.1 +1 -1
- package/man/mend-dotfiles.1 +1 -1
- package/man/mend-env-cluster.1 +1 -1
- package/man/mend-env-load.1 +1 -1
- package/man/mend-env-show.1 +1 -1
- package/man/mend-folder-create.1 +1 -1
- package/man/mend-folder-list.1 +1 -1
- package/man/mend-folder-push.1 +1 -1
- package/man/mend-folder-rm.1 +1 -1
- package/man/mend-git-author.1 +1 -1
- package/man/mend-git-check.1 +20 -0
- package/man/mend-handoff.1 +1 -1
- package/man/mend-help.1 +5 -1
- package/man/mend-history.1 +18 -0
- package/man/mend-interrupt.1 +15 -0
- package/man/mend-invite.1 +3 -3
- package/man/mend-keys-init.1 +1 -1
- package/man/mend-keys-mode.1 +2 -2
- package/man/mend-keys-share.1 +1 -1
- package/man/mend-keys-show.1 +1 -1
- package/man/mend-land.1 +6 -3
- package/man/mend-login.1 +8 -2
- package/man/mend-logout.1 +6 -2
- package/man/mend-logs.1 +1 -1
- package/man/mend-man.1 +1 -1
- package/man/mend-mcp-add.1 +45 -0
- package/man/mend-mcp-forget.1 +18 -0
- package/man/mend-mcp-off.1 +18 -0
- package/man/mend-mcp-on.1 +18 -0
- package/man/mend-mcp-remove.1 +18 -0
- package/man/mend-mcp.1 +24 -0
- package/man/mend-members.1 +3 -3
- package/man/mend-memory-import.1 +1 -1
- package/man/mend-memory-rm.1 +1 -1
- package/man/mend-memory-show.1 +1 -1
- package/man/mend-memory.1 +1 -1
- package/man/mend-message.1 +6 -3
- package/man/mend-models.1 +1 -1
- package/man/mend-operator-exposure.1 +1 -1
- package/man/mend-operator-gate.1 +1 -1
- package/man/mend-operator-grant-owner.1 +2 -2
- package/man/mend-operator-org-add-member.1 +20 -0
- package/man/mend-operator-org-create.1 +1 -1
- package/man/mend-operator-org-invite-owner.1 +2 -2
- package/man/mend-operator-org-list.1 +2 -2
- package/man/mend-operator-org-rename.1 +1 -1
- package/man/mend-operator-reset-link.1 +1 -1
- package/man/mend-org-leave.1 +17 -0
- package/man/mend-org-switch.1 +14 -0
- package/man/mend-org.1 +15 -0
- package/man/mend-pair.1 +1 -1
- package/man/mend-preview.1 +31 -0
- package/man/mend-projects-image.1 +20 -0
- package/man/mend-projects-purge.1 +18 -0
- package/man/mend-projects-removed.1 +15 -0
- package/man/mend-projects-restore.1 +18 -0
- package/man/mend-projects-rm.1 +15 -0
- package/man/mend-projects.1 +3 -3
- package/man/mend-proof-get.1 +21 -0
- package/man/mend-proof-list.1 +15 -0
- package/man/mend-pull.1 +1 -1
- package/man/mend-refresh.1 +1 -1
- package/man/mend-rejoin.1 +1 -1
- package/man/mend-resource-add.1 +17 -25
- package/man/mend-resource-env.1 +21 -0
- package/man/mend-resource-list.1 +10 -12
- package/man/mend-resource-load.1 +33 -0
- package/man/mend-resource-remove.1 +16 -16
- package/man/mend-resource-reset.1 +24 -0
- package/man/mend-resource-start.1 +28 -7
- package/man/mend-resource-stop.1 +27 -0
- package/man/mend-resource-use.1 +12 -9
- package/man/mend-respond.1 +21 -0
- package/man/mend-resume.1 +1 -1
- package/man/mend-run.1 +1 -1
- package/man/mend-screen-look.1 +21 -0
- package/man/mend-secrets-add.1 +1 -1
- package/man/mend-secrets-rm.1 +1 -1
- package/man/mend-secrets.1 +1 -1
- package/man/mend-server-logs.1 +1 -1
- package/man/mend-server-restart.1 +1 -1
- package/man/mend-server-setup.1 +46 -1
- package/man/mend-server-start.1 +1 -1
- package/man/mend-server-status.1 +8 -1
- package/man/mend-server-stop.1 +1 -1
- package/man/mend-server-upgrade.1 +1 -1
- package/man/mend-server.1 +1 -1
- package/man/mend-service-add.1 +1 -1
- package/man/mend-service-connect.1 +1 -1
- package/man/mend-service-init.1 +3 -3
- package/man/mend-service-list.1 +3 -3
- package/man/mend-service-logs.1 +1 -1
- package/man/mend-service-restart.1 +1 -1
- package/man/mend-service-run.1 +4 -4
- package/man/mend-service-stop.1 +1 -1
- package/man/mend-session-share.1 +2 -2
- package/man/mend-sessions.1 +2 -2
- package/man/mend-settings.1 +1 -1
- package/man/mend-setup-session.1 +25 -0
- package/man/mend-shell.1 +1 -1
- package/man/mend-skills-push.1 +1 -1
- package/man/mend-skills.1 +1 -1
- package/man/mend-snake.1 +1 -1
- package/man/mend-ssh-keys-remove.1 +1 -1
- package/man/mend-ssh-keys.1 +1 -1
- package/man/mend-ssh-setup.1 +1 -1
- package/man/mend-ssh.1 +1 -1
- package/man/mend-stop.1 +4 -1
- package/man/mend-ui.1 +1 -1
- package/man/mend-uninstall.1 +1 -1
- package/man/mend-version.1 +1 -1
- package/man/mend-wait.1 +4 -1
- package/man/mend-workspace-replace.1 +2 -2
- package/man/mend-worktrees-rm.1 +1 -1
- package/man/mend-worktrees.1 +1 -1
- package/man/mend.1 +139 -13
- package/package.json +4 -3
- package/man/mend-resource-approve.1 +0 -38
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ADOPT_MODE_ORDER,
|
|
3
|
+
CheckpointId,
|
|
3
4
|
HARNESS_COMMANDS,
|
|
4
5
|
LIVE_STATUSES,
|
|
6
|
+
Schema_exports,
|
|
7
|
+
SealantRunId,
|
|
8
|
+
SequenceNumber,
|
|
9
|
+
SessionId,
|
|
10
|
+
Sha,
|
|
11
|
+
Timestamp,
|
|
12
|
+
WorktreeId,
|
|
5
13
|
agentIsLive,
|
|
6
14
|
agentOutcome,
|
|
15
|
+
assembleReviewInstruction,
|
|
16
|
+
buildReviewFiles,
|
|
7
17
|
captureLineOf,
|
|
8
|
-
checkpointSourceWords,
|
|
9
18
|
createSseParser,
|
|
10
19
|
cwdFacts,
|
|
11
20
|
deriveAdoptOffer,
|
|
12
21
|
eventFamilies,
|
|
13
22
|
hasPersonFacts,
|
|
14
23
|
isPendingId,
|
|
15
|
-
launchPhaseOf,
|
|
16
24
|
matchProjectByCwd,
|
|
17
25
|
mayStillBeWorking,
|
|
18
26
|
noReviewFollowUpLine,
|
|
@@ -26,12 +34,108 @@ import {
|
|
|
26
34
|
sessionWorkspaceLines,
|
|
27
35
|
submitDashboardAdoption,
|
|
28
36
|
takesReviewFollowUp,
|
|
29
|
-
|
|
37
|
+
visibleWhitespace,
|
|
30
38
|
workspaceLineList,
|
|
31
39
|
workspaceReadsOf,
|
|
32
40
|
worktreeJoinLine,
|
|
33
41
|
wrapWords
|
|
34
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-ACIZ2XQQ.js";
|
|
43
|
+
|
|
44
|
+
// ../../packages/domain/src/workbench/checkpoint.ts
|
|
45
|
+
var CheckpointTrigger = Schema_exports.Literals([
|
|
46
|
+
"session-start",
|
|
47
|
+
"command-settle",
|
|
48
|
+
"turn-boundary",
|
|
49
|
+
"review-open",
|
|
50
|
+
"user-mark",
|
|
51
|
+
"proof-capture"
|
|
52
|
+
]);
|
|
53
|
+
var CheckpointSourceKind = Schema_exports.Literals(["stop-final", "stop-reading"]);
|
|
54
|
+
var CheckpointSource = class extends Schema_exports.Class("CheckpointSource")({
|
|
55
|
+
kind: CheckpointSourceKind,
|
|
56
|
+
captureN: Schema_exports.NullOr(Schema_exports.Int),
|
|
57
|
+
observedAt: Timestamp
|
|
58
|
+
}) {
|
|
59
|
+
};
|
|
60
|
+
var checkpointSourceWords = (source, at) => [
|
|
61
|
+
source.kind === "stop-final" ? "from the Stop's final save" : "from a Stop reading that did not save",
|
|
62
|
+
...source.captureN === null ? [] : [`capture ${source.captureN}`],
|
|
63
|
+
at
|
|
64
|
+
].join(" \xB7 ");
|
|
65
|
+
var Checkpoint = class extends Schema_exports.Class("Checkpoint")({
|
|
66
|
+
id: CheckpointId,
|
|
67
|
+
worktreeId: WorktreeId,
|
|
68
|
+
/**
|
|
69
|
+
* Provenance: the conversation whose activity triggered the snapshot. Null
|
|
70
|
+
* for worktree-level triggers (the worktree-start checkpoint, review opened
|
|
71
|
+
* with no live session) and for checkpoints whose session was deleted.
|
|
72
|
+
*/
|
|
73
|
+
sessionId: Schema_exports.NullOr(SessionId),
|
|
74
|
+
/** Position in the worktree's chain, dense from 0 (the worktree-start checkpoint). */
|
|
75
|
+
ordinal: Schema_exports.Int,
|
|
76
|
+
/**
|
|
77
|
+
* Hidden ref: `refs/mend/checkpoints/<worktreeId>/<ordinal>` for new rows;
|
|
78
|
+
* legacy rows keep their stored session-scoped refs, which stay resolvable.
|
|
79
|
+
*/
|
|
80
|
+
ref: Schema_exports.String,
|
|
81
|
+
sha: Sha,
|
|
82
|
+
/** Null only before the session's first platform run, or on honest legacy gaps. */
|
|
83
|
+
sealantRunId: Schema_exports.NullOr(SealantRunId),
|
|
84
|
+
/** Record sequence the supervisor had seen when the snapshot was taken. */
|
|
85
|
+
seq: SequenceNumber,
|
|
86
|
+
trigger: CheckpointTrigger,
|
|
87
|
+
createdAt: Timestamp,
|
|
88
|
+
/** Absent when the checkpoint observed the executor itself (`CheckpointSource`). */
|
|
89
|
+
source: Schema_exports.optionalKey(CheckpointSource)
|
|
90
|
+
}) {
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// ../../packages/domain/src/workbench/launch-phase.ts
|
|
94
|
+
var LAUNCH_WAITING_PREFIX = "waiting \xB7 the previous session in this worktree";
|
|
95
|
+
var LAUNCH_WAITING_SAVING = `${LAUNCH_WAITING_PREFIX} is saving`;
|
|
96
|
+
var LAUNCH_BOOTING = "booting";
|
|
97
|
+
var LAUNCH_QUEUED = "queued \xB7 waiting for a worker";
|
|
98
|
+
var LAUNCH_BUILDING_PREFIX = "building the workspace image";
|
|
99
|
+
var LAUNCH_PREPARING = "preparing the workspace \xB7 no runtime yet \xB7 after an update, building the image takes about 8 minutes";
|
|
100
|
+
var LAUNCH_BUILDING_IMAGE_LEGACY = "building the workspace image (first launch after an update, ~8 min)";
|
|
101
|
+
var LAUNCH_PHASE_PREFIXES = [
|
|
102
|
+
LAUNCH_WAITING_PREFIX,
|
|
103
|
+
LAUNCH_BOOTING,
|
|
104
|
+
LAUNCH_QUEUED,
|
|
105
|
+
LAUNCH_PREPARING,
|
|
106
|
+
LAUNCH_BUILDING_IMAGE_LEGACY,
|
|
107
|
+
LAUNCH_BUILDING_PREFIX
|
|
108
|
+
];
|
|
109
|
+
var phaseWordsOf = (summary) => {
|
|
110
|
+
for (const prefix of LAUNCH_PHASE_PREFIXES) {
|
|
111
|
+
if (summary.startsWith(prefix)) return { at: 0, words: summary };
|
|
112
|
+
const at = summary.indexOf(` \xB7 ${prefix}`);
|
|
113
|
+
if (at >= 0) return { at, words: summary.slice(at + 3) };
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
};
|
|
117
|
+
var withoutLaunchPhase = (summary) => {
|
|
118
|
+
if (summary === null) return null;
|
|
119
|
+
const phase = phaseWordsOf(summary);
|
|
120
|
+
if (phase === null) return summary;
|
|
121
|
+
return phase.at === 0 ? null : summary.slice(0, phase.at);
|
|
122
|
+
};
|
|
123
|
+
var launchPhaseOf = (summary) => {
|
|
124
|
+
if (summary === null) return null;
|
|
125
|
+
const phase = phaseWordsOf(summary);
|
|
126
|
+
if (phase === null) return null;
|
|
127
|
+
if (phase.words.startsWith(LAUNCH_WAITING_PREFIX)) {
|
|
128
|
+
return { kind: "waiting-previous", words: phase.words };
|
|
129
|
+
}
|
|
130
|
+
if (phase.words.startsWith(LAUNCH_BOOTING)) return { kind: "booting", words: phase.words };
|
|
131
|
+
if (phase.words.startsWith(LAUNCH_QUEUED)) return { kind: "queued", words: phase.words };
|
|
132
|
+
if (phase.words === LAUNCH_BUILDING_IMAGE_LEGACY)
|
|
133
|
+
return { kind: "preparing", words: phase.words };
|
|
134
|
+
if (phase.words.startsWith(LAUNCH_BUILDING_PREFIX)) {
|
|
135
|
+
return { kind: "building", words: phase.words };
|
|
136
|
+
}
|
|
137
|
+
return { kind: "preparing", words: phase.words };
|
|
138
|
+
};
|
|
35
139
|
|
|
36
140
|
// src/dashboard.tsx
|
|
37
141
|
import { CliRenderEvents, createCliRenderer } from "@opentui/core";
|
|
@@ -635,6 +739,7 @@ var workspaceFactRows = (session, viewer, facts, width) => workspaceLineList(
|
|
|
635
739
|
sessionWorkspaceLines({
|
|
636
740
|
sessionId: session.id,
|
|
637
741
|
livePeople: session.livePeople ?? [],
|
|
742
|
+
resourceStatusLines: session.resourceStatusLines ?? [],
|
|
638
743
|
viewer: viewer?.userId ?? null,
|
|
639
744
|
wait: facts?.wait ?? null,
|
|
640
745
|
retirement: facts?.retirement ?? null,
|
|
@@ -1161,195 +1266,6 @@ import { useKeyboard, useTerminalDimensions } from "@opentui/react";
|
|
|
1161
1266
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
1162
1267
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
1163
1268
|
|
|
1164
|
-
// src/review-model.ts
|
|
1165
|
-
import * as path from "node:path";
|
|
1166
|
-
var FILETYPE_BY_EXTENSION = {
|
|
1167
|
-
c: "c",
|
|
1168
|
-
cc: "cpp",
|
|
1169
|
-
cpp: "cpp",
|
|
1170
|
-
css: "css",
|
|
1171
|
-
go: "go",
|
|
1172
|
-
h: "c",
|
|
1173
|
-
hpp: "cpp",
|
|
1174
|
-
html: "html",
|
|
1175
|
-
java: "java",
|
|
1176
|
-
js: "javascript",
|
|
1177
|
-
json: "json",
|
|
1178
|
-
jsx: "javascript",
|
|
1179
|
-
md: "markdown",
|
|
1180
|
-
mjs: "javascript",
|
|
1181
|
-
py: "python",
|
|
1182
|
-
rb: "ruby",
|
|
1183
|
-
rs: "rust",
|
|
1184
|
-
sh: "bash",
|
|
1185
|
-
sql: "sql",
|
|
1186
|
-
swift: "swift",
|
|
1187
|
-
toml: "toml",
|
|
1188
|
-
ts: "typescript",
|
|
1189
|
-
tsx: "tsx",
|
|
1190
|
-
yaml: "yaml",
|
|
1191
|
-
yml: "yaml",
|
|
1192
|
-
zsh: "bash"
|
|
1193
|
-
};
|
|
1194
|
-
var filetypeOf = (name) => {
|
|
1195
|
-
const extension = path.extname(name).slice(1).toLowerCase();
|
|
1196
|
-
return extension === "" ? void 0 : FILETYPE_BY_EXTENSION[extension] ?? extension;
|
|
1197
|
-
};
|
|
1198
|
-
var statusOf = (patch) => {
|
|
1199
|
-
if (/^new file mode /m.test(patch)) return "added";
|
|
1200
|
-
if (/^deleted file mode /m.test(patch)) return "deleted";
|
|
1201
|
-
if (/^rename (?:from|to) /m.test(patch)) return "renamed";
|
|
1202
|
-
return "modified";
|
|
1203
|
-
};
|
|
1204
|
-
var isLikelyGenerated = (name) => /(^|\/)(?:dist|build|generated)(?:\/|$)/i.test(name) || /(?:\.generated\.|\.min\.(?:js|css)$|(?:^|\/)(?:pnpm-lock\.yaml|package-lock\.json|yarn\.lock)$)/i.test(
|
|
1205
|
-
name
|
|
1206
|
-
);
|
|
1207
|
-
var visibleWhitespace = (patch) => {
|
|
1208
|
-
let inHunk = false;
|
|
1209
|
-
return patch.split("\n").map((line) => {
|
|
1210
|
-
if (line.startsWith("diff --git ")) inHunk = false;
|
|
1211
|
-
if (line.startsWith("@@ ")) inHunk = true;
|
|
1212
|
-
const hunkContent = inHunk && /^[+ -]/.test(line);
|
|
1213
|
-
if (!hunkContent) return line;
|
|
1214
|
-
const prefix = line.slice(0, 1);
|
|
1215
|
-
const content = line.slice(1).replaceAll(" ", "\u2192\xB7\xB7\xB7\xB7").replaceAll(" ", "\xB7");
|
|
1216
|
-
return `${prefix}${content}`;
|
|
1217
|
-
}).join("\n");
|
|
1218
|
-
};
|
|
1219
|
-
var splitFilePatches = (diff) => {
|
|
1220
|
-
const starts = [...diff.matchAll(/^diff --git /gm)].map((match) => match.index);
|
|
1221
|
-
return starts.map((start, index) => {
|
|
1222
|
-
const end = starts[index + 1] ?? diff.length;
|
|
1223
|
-
const patch = diff.slice(start, end);
|
|
1224
|
-
return patch.endsWith("\n") ? patch : `${patch}
|
|
1225
|
-
`;
|
|
1226
|
-
});
|
|
1227
|
-
};
|
|
1228
|
-
var parseRows = (patch) => {
|
|
1229
|
-
const patchLines = patch.split("\n");
|
|
1230
|
-
const lines = [];
|
|
1231
|
-
const hunks = [];
|
|
1232
|
-
let unifiedRow = 0;
|
|
1233
|
-
let splitRow = 0;
|
|
1234
|
-
let hunkIndex = -1;
|
|
1235
|
-
let oldLine = 0;
|
|
1236
|
-
let newLine = 0;
|
|
1237
|
-
for (let index = 0; index < patchLines.length; index += 1) {
|
|
1238
|
-
const header = patchLines[index] ?? "";
|
|
1239
|
-
const hunkMatch = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(header);
|
|
1240
|
-
if (hunkMatch === null) continue;
|
|
1241
|
-
hunkIndex += 1;
|
|
1242
|
-
oldLine = Number(hunkMatch[1]);
|
|
1243
|
-
newLine = Number(hunkMatch[2]);
|
|
1244
|
-
hunks.push({ index: hunkIndex, header, unifiedRow, splitRow });
|
|
1245
|
-
const body = [];
|
|
1246
|
-
let bodyIndex = index + 1;
|
|
1247
|
-
while (bodyIndex < patchLines.length) {
|
|
1248
|
-
const bodyLine = patchLines[bodyIndex] ?? "";
|
|
1249
|
-
if (bodyLine.startsWith("@@ ")) break;
|
|
1250
|
-
if (bodyLine.startsWith("+")) {
|
|
1251
|
-
body.push({ kind: "addition" });
|
|
1252
|
-
} else if (bodyLine.startsWith("-")) {
|
|
1253
|
-
body.push({ kind: "deletion" });
|
|
1254
|
-
} else if (bodyLine.startsWith(" ")) {
|
|
1255
|
-
body.push({ kind: "context" });
|
|
1256
|
-
}
|
|
1257
|
-
bodyIndex += 1;
|
|
1258
|
-
}
|
|
1259
|
-
let cursor = 0;
|
|
1260
|
-
while (cursor < body.length) {
|
|
1261
|
-
const current = body[cursor];
|
|
1262
|
-
if (current?.kind === "context") {
|
|
1263
|
-
lines.push({
|
|
1264
|
-
kind: "context",
|
|
1265
|
-
oldLine,
|
|
1266
|
-
newLine,
|
|
1267
|
-
unifiedRow,
|
|
1268
|
-
splitRow,
|
|
1269
|
-
hunk: hunkIndex,
|
|
1270
|
-
commentable: true
|
|
1271
|
-
});
|
|
1272
|
-
oldLine += 1;
|
|
1273
|
-
newLine += 1;
|
|
1274
|
-
unifiedRow += 1;
|
|
1275
|
-
splitRow += 1;
|
|
1276
|
-
cursor += 1;
|
|
1277
|
-
continue;
|
|
1278
|
-
}
|
|
1279
|
-
const groupStart = cursor;
|
|
1280
|
-
while (cursor < body.length && body[cursor]?.kind !== "context") cursor += 1;
|
|
1281
|
-
const group = body.slice(groupStart, cursor);
|
|
1282
|
-
let deletionOffset = 0;
|
|
1283
|
-
let additionOffset = 0;
|
|
1284
|
-
for (const entry of group) {
|
|
1285
|
-
if (entry.kind === "deletion") {
|
|
1286
|
-
lines.push({
|
|
1287
|
-
kind: entry.kind,
|
|
1288
|
-
oldLine,
|
|
1289
|
-
newLine: null,
|
|
1290
|
-
unifiedRow,
|
|
1291
|
-
splitRow: splitRow + deletionOffset,
|
|
1292
|
-
hunk: hunkIndex,
|
|
1293
|
-
// ReviewComment persists a line number but no old/new side. Like
|
|
1294
|
-
// the web review, deletions therefore abstain instead of storing
|
|
1295
|
-
// a confidently wrong new-file anchor.
|
|
1296
|
-
commentable: false
|
|
1297
|
-
});
|
|
1298
|
-
oldLine += 1;
|
|
1299
|
-
deletionOffset += 1;
|
|
1300
|
-
} else {
|
|
1301
|
-
lines.push({
|
|
1302
|
-
kind: entry.kind,
|
|
1303
|
-
oldLine: null,
|
|
1304
|
-
newLine,
|
|
1305
|
-
unifiedRow,
|
|
1306
|
-
splitRow: splitRow + additionOffset,
|
|
1307
|
-
hunk: hunkIndex,
|
|
1308
|
-
commentable: true
|
|
1309
|
-
});
|
|
1310
|
-
newLine += 1;
|
|
1311
|
-
additionOffset += 1;
|
|
1312
|
-
}
|
|
1313
|
-
unifiedRow += 1;
|
|
1314
|
-
}
|
|
1315
|
-
splitRow += Math.max(deletionOffset, additionOffset);
|
|
1316
|
-
}
|
|
1317
|
-
index = bodyIndex - 1;
|
|
1318
|
-
}
|
|
1319
|
-
return { lines, hunks, unifiedRows: unifiedRow, splitRows: splitRow };
|
|
1320
|
-
};
|
|
1321
|
-
var buildReviewFiles = (diff, stats) => {
|
|
1322
|
-
const patches = splitFilePatches(diff);
|
|
1323
|
-
return stats.map((stat, index) => {
|
|
1324
|
-
const patch = patches[index] ?? "";
|
|
1325
|
-
const rows = parseRows(patch);
|
|
1326
|
-
return {
|
|
1327
|
-
...stat,
|
|
1328
|
-
patch,
|
|
1329
|
-
filetype: filetypeOf(stat.path),
|
|
1330
|
-
status: statusOf(patch),
|
|
1331
|
-
binary: /^Binary files |^GIT binary patch$/m.test(patch),
|
|
1332
|
-
likelyGenerated: isLikelyGenerated(stat.path),
|
|
1333
|
-
...rows
|
|
1334
|
-
};
|
|
1335
|
-
});
|
|
1336
|
-
};
|
|
1337
|
-
var assembleReviewInstruction = (change, comments) => {
|
|
1338
|
-
const points = comments.map((comment, index) => {
|
|
1339
|
-
const anchor = comment.file === null ? "the change as a whole" : `${comment.file}${comment.line === null ? "" : `:${comment.line}${comment.endLine === null || comment.endLine === comment.line ? "" : `-${comment.endLine}`}`}`;
|
|
1340
|
-
const proposal = comment.suggestion === null ? "" : `
|
|
1341
|
-
Proposed replacement:
|
|
1342
|
-
${comment.suggestion.split("\n").map((line) => ` ${line}`).join("\n")}`;
|
|
1343
|
-
return `${index + 1}. ${anchor} \u2014 ${comment.body}${proposal}`;
|
|
1344
|
-
}).join("\n");
|
|
1345
|
-
return `This is a follow-up on your earlier work in this worktree, responding to review feedback. The branch ${change.branch} is already checked out with your work on it: keep working there, and do not start a new branch or reset it.
|
|
1346
|
-
|
|
1347
|
-
Review comments:
|
|
1348
|
-
${points}
|
|
1349
|
-
|
|
1350
|
-
Address each point using your own judgment about how. Check your work with the repository's own build, tests, or typecheck; a check that still fails is something to report, not to force green. Report honestly what you changed and what you did not \u2014 if a point cannot or should not be done, say so plainly.`;
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
1269
|
// src/terminal.ts
|
|
1354
1270
|
import { spawn } from "node:child_process";
|
|
1355
1271
|
var openUrl = (target) => {
|