prtape-cli 0.0.0-stage → 0.1.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.
- package/LICENSE +21 -0
- package/README.md +138 -2
- package/dist/adapters/claude.d.ts +2 -0
- package/dist/adapters/claude.js +309 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/bash-edits.d.ts +41 -0
- package/dist/bash-edits.js +440 -0
- package/dist/bash-edits.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +214 -0
- package/dist/cli.js.map +1 -0
- package/dist/decision.d.ts +7 -0
- package/dist/decision.js +224 -0
- package/dist/decision.js.map +1 -0
- package/dist/discover.d.ts +32 -0
- package/dist/discover.js +179 -0
- package/dist/discover.js.map +1 -0
- package/dist/display.d.ts +28 -0
- package/dist/display.js +311 -0
- package/dist/display.js.map +1 -0
- package/dist/env.d.ts +5 -0
- package/dist/env.js +11 -0
- package/dist/env.js.map +1 -0
- package/dist/gh.d.ts +46 -0
- package/dist/gh.js +190 -0
- package/dist/gh.js.map +1 -0
- package/dist/glance.d.ts +15 -0
- package/dist/glance.js +75 -0
- package/dist/glance.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/orphan.d.ts +44 -0
- package/dist/orphan.js +152 -0
- package/dist/orphan.js.map +1 -0
- package/dist/png.d.ts +2 -0
- package/dist/png.js +13 -0
- package/dist/png.js.map +1 -0
- package/dist/privacy.d.ts +7 -0
- package/dist/privacy.js +39 -0
- package/dist/privacy.js.map +1 -0
- package/dist/redact.d.ts +17 -0
- package/dist/redact.js +101 -0
- package/dist/redact.js.map +1 -0
- package/dist/run.d.ts +48 -0
- package/dist/run.js +218 -0
- package/dist/run.js.map +1 -0
- package/dist/summary.d.ts +7 -0
- package/dist/summary.js +134 -0
- package/dist/summary.js.map +1 -0
- package/dist/tests-detect.d.ts +19 -0
- package/dist/tests-detect.js +97 -0
- package/dist/tests-detect.js.map +1 -0
- package/dist/text.d.ts +8 -0
- package/dist/text.js +31 -0
- package/dist/text.js.map +1 -0
- package/dist/timeline/format.d.ts +28 -0
- package/dist/timeline/format.js +127 -0
- package/dist/timeline/format.js.map +1 -0
- package/dist/timeline/md.d.ts +17 -0
- package/dist/timeline/md.js +129 -0
- package/dist/timeline/md.js.map +1 -0
- package/dist/timeline/svg.d.ts +7 -0
- package/dist/timeline/svg.js +260 -0
- package/dist/timeline/svg.js.map +1 -0
- package/dist/timeline/wrap.d.ts +7 -0
- package/dist/timeline/wrap.js +77 -0
- package/dist/timeline/wrap.js.map +1 -0
- package/dist/types.d.ts +96 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/package.json +57 -4
package/dist/display.js
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { decisionFromEvents } from "./decision.js";
|
|
2
|
+
import { redact } from "./redact.js";
|
|
3
|
+
import { hasPrivatePath, stripPrivatePaths } from "./privacy.js";
|
|
4
|
+
import { rollupTests, withSteps } from "./summary.js";
|
|
5
|
+
import { displayTestCommand } from "./tests-detect.js";
|
|
6
|
+
import { oneLine } from "./text.js";
|
|
7
|
+
const MARKER = /\[REDACTED_[A-Z0-9_]+\]/;
|
|
8
|
+
/** Locked KEY DECISION copy. The short form drops the second clause. */
|
|
9
|
+
export const LOCKED_DECISION = "Ship the redacted timeline; secrets stay off the PR.";
|
|
10
|
+
/**
|
|
11
|
+
* Reviewer-facing copy. Sentences and shell assignments that contain a secret
|
|
12
|
+
* are deleted. Nothing is replaced with a `[REDACTED_*]` token.
|
|
13
|
+
*/
|
|
14
|
+
export function presentSummary(input, options = {}) {
|
|
15
|
+
const probed = [input.title, input.decision, ...input.files.map((file) => file.path), ...input.tests.map((test) => test.command)].join("\n");
|
|
16
|
+
const maskedCount = redact(probed, options).match(/\[REDACTED_[A-Z0-9_]+\]/g)?.length ?? 0;
|
|
17
|
+
const secretsStripped = maskedCount > 0;
|
|
18
|
+
const decision = scrubDecision(input.decision, input, options);
|
|
19
|
+
const title = scrubTitle(input.title, options);
|
|
20
|
+
const events = input.events.map((event) => scrubEvent(event, options)).filter((event) => event !== undefined);
|
|
21
|
+
return {
|
|
22
|
+
secretsStripped,
|
|
23
|
+
maskedCount,
|
|
24
|
+
summary: withSteps({
|
|
25
|
+
...input,
|
|
26
|
+
title: title || "Coding-agent session",
|
|
27
|
+
decision,
|
|
28
|
+
cwd: publicCwd(input.cwd),
|
|
29
|
+
branch: input.branch ? stripPrivatePaths(input.branch) || undefined : undefined,
|
|
30
|
+
events,
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const FENCE_LANG = /^(?:text|bash|sh|shell|md|markdown|json|javascript|js|ts|typescript|python|py|diff|plaintext)\s+/i;
|
|
35
|
+
export function scrubTitle(text, options = {}) {
|
|
36
|
+
// Emails never lead the title. A sentence that is only an address is dropped.
|
|
37
|
+
const clean = scrubProse(stripFenceLang(stripPastedWrappers(text)), { ...options, emails: true });
|
|
38
|
+
const sentences = splitSentences(clean)
|
|
39
|
+
.map((sentence) => stripFenceLang(sentence))
|
|
40
|
+
.filter((sentence) => sentence && !isOnlyEmail(sentence));
|
|
41
|
+
const task = sentences.find((sentence) => isTaskSentence(sentence)) ??
|
|
42
|
+
sentences.find((sentence) => !isMetaInstruction(sentence) && !isConstraintSentence(sentence)) ??
|
|
43
|
+
sentences[0] ??
|
|
44
|
+
"";
|
|
45
|
+
return task;
|
|
46
|
+
}
|
|
47
|
+
const TASK_VERBS = /^(?:fix|make|add|find|implement|update|run|change|correct|strip|remove|keep|請|修正|修|新增|實作|更新|執行|找出|改)/i;
|
|
48
|
+
function stripFenceLang(text) {
|
|
49
|
+
return text.replace(FENCE_LANG, "").trim();
|
|
50
|
+
}
|
|
51
|
+
function isConstraintSentence(sentence) {
|
|
52
|
+
if (isTaskSentence(sentence))
|
|
53
|
+
return false;
|
|
54
|
+
return /不要|別[刪跳]|don't\b|do not\b|must not\b|\bnever\b/i.test(sentence);
|
|
55
|
+
}
|
|
56
|
+
function isTaskSentence(sentence) {
|
|
57
|
+
return TASK_VERBS.test(sentence.trim());
|
|
58
|
+
}
|
|
59
|
+
/** Language, format, and disclaimer lines Claude Code puts ahead of the task. */
|
|
60
|
+
function isMetaInstruction(sentence) {
|
|
61
|
+
const text = sentence.trim().replace(/[.!?。]+$/g, "");
|
|
62
|
+
return (/^(?:respond|answer|reply)\b(?:\s+\w+){0,6}\s+in\b/i.test(text) ||
|
|
63
|
+
/^be concise\b/i.test(text) ||
|
|
64
|
+
/^keep (?:it|this|your (?:answer|response)) (?:brief|short|concise)\b/i.test(text) ||
|
|
65
|
+
/^this is an intentional\b/i.test(text) ||
|
|
66
|
+
/\bnot a real\b.+\b(?:incident|customer|bug|session)\b/i.test(text) ||
|
|
67
|
+
/^(?:note|context)\s*:/i.test(text));
|
|
68
|
+
}
|
|
69
|
+
/** Drop Claude Code wrappers such as `<pasted_content id="...">...</pasted_content>`. */
|
|
70
|
+
export function stripPastedWrappers(text) {
|
|
71
|
+
let current = text;
|
|
72
|
+
for (let pass = 0; pass < 4; pass += 1) {
|
|
73
|
+
const next = current.replace(/<([A-Za-z][\w:-]*)\b[^>]*>[\s\S]*?<\/\1>/g, (full) => full.replace(/^<[^>]*>/, "").replace(/<\/[^>]*>$/, ""));
|
|
74
|
+
if (next === current)
|
|
75
|
+
break;
|
|
76
|
+
current = next;
|
|
77
|
+
}
|
|
78
|
+
return current
|
|
79
|
+
.replace(/<\/?[A-Za-z][\w:-]*\b[^>]*>/g, " ")
|
|
80
|
+
.replace(/[ \t]{2,}/g, " ")
|
|
81
|
+
.trim();
|
|
82
|
+
}
|
|
83
|
+
export function scrubProse(text, options = {}) {
|
|
84
|
+
const withoutFences = text.replace(/```[\s\S]*?```/g, "\n").replace(/~~~[\s\S]*?~~~/g, "\n");
|
|
85
|
+
const kept = splitSentences(withoutFences)
|
|
86
|
+
.filter((sentence) => !isPathReferenceSentence(sentence))
|
|
87
|
+
.map((sentence) => cleanDisplayMarkdown(stripPrivatePaths(sentence)).trim())
|
|
88
|
+
.filter((sentence) => sentence && !isPathReferenceSentence(sentence) && !sentenceHasSecret(sentence, options));
|
|
89
|
+
return oneLine(kept.join(" "));
|
|
90
|
+
}
|
|
91
|
+
function splitSentences(text) {
|
|
92
|
+
const sentences = [];
|
|
93
|
+
for (const line of text.split(/\n+/)) {
|
|
94
|
+
let current = "";
|
|
95
|
+
const chars = [...line];
|
|
96
|
+
for (let index = 0; index < chars.length; index += 1) {
|
|
97
|
+
const ch = chars[index] ?? "";
|
|
98
|
+
current += ch;
|
|
99
|
+
const next = chars[index + 1];
|
|
100
|
+
const cjkEnd = ch === "。" || ch === "!" || ch === "?";
|
|
101
|
+
const enEnd = (ch === "." || ch === "!" || ch === "?") && (next === undefined || /\s/.test(next));
|
|
102
|
+
if (!cjkEnd && !enEnd)
|
|
103
|
+
continue;
|
|
104
|
+
const trimmed = current.trim();
|
|
105
|
+
if (trimmed)
|
|
106
|
+
sentences.push(trimmed);
|
|
107
|
+
current = "";
|
|
108
|
+
if (next && /\s/.test(next))
|
|
109
|
+
index += 1;
|
|
110
|
+
}
|
|
111
|
+
const rest = current.trim();
|
|
112
|
+
if (rest)
|
|
113
|
+
sentences.push(rest);
|
|
114
|
+
}
|
|
115
|
+
return sentences;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A sentence whose job is to point at a private path. Drop the whole sentence
|
|
119
|
+
* so deletion does not leave "完整輸出存在 。" or "The full output is saved at ."
|
|
120
|
+
*/
|
|
121
|
+
export function isPathReferenceSentence(sentence) {
|
|
122
|
+
const hadPath = hasPrivatePath(sentence) || /`{2,}|`\s*`/.test(sentence);
|
|
123
|
+
const core = locatorCore(sentence);
|
|
124
|
+
if (!core)
|
|
125
|
+
return hadPath;
|
|
126
|
+
if (!isLocatorCore(core))
|
|
127
|
+
return false;
|
|
128
|
+
return hadPath || isLocatorCore(core);
|
|
129
|
+
}
|
|
130
|
+
function locatorCore(sentence) {
|
|
131
|
+
return cleanDisplayMarkdown(stripPrivatePaths(sentence))
|
|
132
|
+
.replace(/`+/g, "")
|
|
133
|
+
.replace(/[。!?.!?]+/g, "")
|
|
134
|
+
.replace(/\s+/g, " ")
|
|
135
|
+
.trim();
|
|
136
|
+
}
|
|
137
|
+
const LOCATOR_WORDS = new Set([
|
|
138
|
+
"the",
|
|
139
|
+
"a",
|
|
140
|
+
"an",
|
|
141
|
+
"full",
|
|
142
|
+
"output",
|
|
143
|
+
"outputs",
|
|
144
|
+
"log",
|
|
145
|
+
"logs",
|
|
146
|
+
"file",
|
|
147
|
+
"files",
|
|
148
|
+
"checkout",
|
|
149
|
+
"note",
|
|
150
|
+
"notes",
|
|
151
|
+
"is",
|
|
152
|
+
"are",
|
|
153
|
+
"was",
|
|
154
|
+
"were",
|
|
155
|
+
"saved",
|
|
156
|
+
"written",
|
|
157
|
+
"stored",
|
|
158
|
+
"located",
|
|
159
|
+
"kept",
|
|
160
|
+
"live",
|
|
161
|
+
"lives",
|
|
162
|
+
"at",
|
|
163
|
+
"in",
|
|
164
|
+
"under",
|
|
165
|
+
"to",
|
|
166
|
+
"on",
|
|
167
|
+
"and",
|
|
168
|
+
"of",
|
|
169
|
+
]);
|
|
170
|
+
function isLocatorCore(core) {
|
|
171
|
+
if (/^(?:完整|修正前的|修正後的)?輸出存在$/.test(core))
|
|
172
|
+
return true;
|
|
173
|
+
if (/^(?:日誌|日志|記錄|檔案)(?:在|位於|存在)$/.test(core))
|
|
174
|
+
return true;
|
|
175
|
+
const words = core
|
|
176
|
+
.replace(/\/[^\s]+/g, " ")
|
|
177
|
+
.split(/\s+/)
|
|
178
|
+
.map((word) => word.trim())
|
|
179
|
+
.filter(Boolean);
|
|
180
|
+
if (words.length === 0 || words.length > 12)
|
|
181
|
+
return false;
|
|
182
|
+
if (words.some((word) => /[\u3400-\u9fff]/.test(word)))
|
|
183
|
+
return false;
|
|
184
|
+
return words.every((word) => LOCATOR_WORDS.has(word.toLowerCase().replace(/^[("']+|[)"',]+$/g, "")));
|
|
185
|
+
}
|
|
186
|
+
/** Drop markdown markers and empty code spans left behind when a path was deleted. */
|
|
187
|
+
export function cleanDisplayMarkdown(text) {
|
|
188
|
+
return text
|
|
189
|
+
.replace(/```[\s\S]*?```/g, " ")
|
|
190
|
+
.replace(/~~~[\s\S]*?~~~/g, " ")
|
|
191
|
+
.replace(/`{1,3}\s*`{1,3}/g, "")
|
|
192
|
+
.replace(/\*\*([^*]+)\*\*/g, "$1")
|
|
193
|
+
.replace(/__([^_]+)__/g, "$1")
|
|
194
|
+
.replace(/(^|[^\w*])\*([^*\n]+)\*(?!\*)/g, "$1$2")
|
|
195
|
+
.replace(/`([^`]+)`/g, "$1")
|
|
196
|
+
.replace(/`+/g, "")
|
|
197
|
+
.replace(/^\s{0,3}#{1,6}\s+/gm, "")
|
|
198
|
+
.replace(/[ \t]{2,}/g, " ")
|
|
199
|
+
.trim();
|
|
200
|
+
}
|
|
201
|
+
export function scrubCommand(command, options = {}) {
|
|
202
|
+
const displayed = displayTestCommand(command);
|
|
203
|
+
const source = displayed || command;
|
|
204
|
+
const pieces = source.split(/\s*(?:&&|\|\||;)\s*/);
|
|
205
|
+
const kept = pieces.map((piece) => scrubCommandPiece(piece, options)).filter((piece) => piece.length > 0);
|
|
206
|
+
return oneLine(stripPrivatePaths(kept.join(" && ")));
|
|
207
|
+
}
|
|
208
|
+
function scrubDecision(text, summary, options) {
|
|
209
|
+
const prose = scrubProse(text, options);
|
|
210
|
+
const explicit = explicitSentence(prose);
|
|
211
|
+
if (explicit && explicit.replace(/[。..]$/u, "") === "Ship the redacted timeline")
|
|
212
|
+
return LOCKED_DECISION;
|
|
213
|
+
if (explicit && !isStatusBoilerplate(explicit))
|
|
214
|
+
return finishSentence(explicit);
|
|
215
|
+
const derived = decisionFromEvents(summary);
|
|
216
|
+
if (derived)
|
|
217
|
+
return derived;
|
|
218
|
+
return fallbackDecision(summary);
|
|
219
|
+
}
|
|
220
|
+
/** One short statement. A multi-sentence status report is not a decision. */
|
|
221
|
+
function explicitSentence(prose) {
|
|
222
|
+
const sentences = splitSentences(prose).filter((sentence) => sentence.length >= 12 && sentence.length <= 180);
|
|
223
|
+
if (sentences.length !== 1)
|
|
224
|
+
return undefined;
|
|
225
|
+
return sentences[0];
|
|
226
|
+
}
|
|
227
|
+
function isStatusBoilerplate(sentence) {
|
|
228
|
+
return (/^(?:修好了|完成了|done\b)/i.test(sentence) ||
|
|
229
|
+
/全部通過|測試通過/.test(sentence) ||
|
|
230
|
+
/\b(?:tests?|suite) (?:passed|passes|pass)\b/i.test(sentence) ||
|
|
231
|
+
/^fixed the .+ so the (?:suite|tests)/i.test(sentence) ||
|
|
232
|
+
/^the tests passed\b/i.test(sentence) ||
|
|
233
|
+
/^原因與修正[::]?$/.test(sentence) ||
|
|
234
|
+
/^修正前的失敗結果/.test(sentence));
|
|
235
|
+
}
|
|
236
|
+
function finishSentence(sentence) {
|
|
237
|
+
const trimmed = sentence.trim();
|
|
238
|
+
if (/[。!?.!?]$/.test(trimmed))
|
|
239
|
+
return trimmed;
|
|
240
|
+
return `${trimmed}.`;
|
|
241
|
+
}
|
|
242
|
+
function fallbackDecision(summary) {
|
|
243
|
+
const count = summary.files.length;
|
|
244
|
+
const files = count === 0 ? "" : `Edited ${count} file${count === 1 ? "" : "s"}`;
|
|
245
|
+
const outcome = rollupTests(summary.tests);
|
|
246
|
+
if (files && outcome === "pass")
|
|
247
|
+
return `${files} and the tests passed.`;
|
|
248
|
+
if (files && outcome === "fail")
|
|
249
|
+
return `${files}, and the tests failed.`;
|
|
250
|
+
if (files)
|
|
251
|
+
return `${files}.`;
|
|
252
|
+
if (outcome === "pass")
|
|
253
|
+
return "The tests passed.";
|
|
254
|
+
if (outcome === "fail")
|
|
255
|
+
return "The tests failed.";
|
|
256
|
+
return "The session is ready for review.";
|
|
257
|
+
}
|
|
258
|
+
function scrubCommandPiece(piece, options) {
|
|
259
|
+
let rest = piece.trim();
|
|
260
|
+
const kept = [];
|
|
261
|
+
const env = /^([A-Za-z_][A-Za-z0-9_]*)=(?:"([^"]*)"|'([^']*)'|(\S+))\s*/;
|
|
262
|
+
let match = env.exec(rest);
|
|
263
|
+
while (match) {
|
|
264
|
+
const key = match[1] ?? "";
|
|
265
|
+
const value = match[2] ?? match[3] ?? match[4] ?? "";
|
|
266
|
+
if (!sentenceHasSecret(`${key}=${value}`, options))
|
|
267
|
+
kept.push(`${key}=${value}`);
|
|
268
|
+
rest = rest.slice(match[0].length);
|
|
269
|
+
match = env.exec(rest);
|
|
270
|
+
}
|
|
271
|
+
const words = rest.split(/\s+/).filter((word) => word && !sentenceHasSecret(word, options));
|
|
272
|
+
return [...kept, ...words].join(" ").trim();
|
|
273
|
+
}
|
|
274
|
+
function scrubPiece(text, options) {
|
|
275
|
+
const stripped = stripPrivatePaths(text).replace(/^\/+/, "");
|
|
276
|
+
if (!stripped || sentenceHasSecret(stripped, options))
|
|
277
|
+
return "";
|
|
278
|
+
return oneLine(stripped);
|
|
279
|
+
}
|
|
280
|
+
function scrubEvent(event, options) {
|
|
281
|
+
if (event.kind === "read") {
|
|
282
|
+
const path = event.path ? scrubPiece(event.path, options) : "";
|
|
283
|
+
return { kind: "read", path: path || undefined };
|
|
284
|
+
}
|
|
285
|
+
if (event.kind === "edit") {
|
|
286
|
+
const path = scrubPiece(event.path, options);
|
|
287
|
+
if (!path)
|
|
288
|
+
return undefined;
|
|
289
|
+
return { kind: "edit", path, action: event.action };
|
|
290
|
+
}
|
|
291
|
+
if (event.kind === "test") {
|
|
292
|
+
const command = scrubCommand(event.command, options);
|
|
293
|
+
if (!command)
|
|
294
|
+
return undefined;
|
|
295
|
+
return { ...event, command };
|
|
296
|
+
}
|
|
297
|
+
return event;
|
|
298
|
+
}
|
|
299
|
+
function publicCwd(cwd) {
|
|
300
|
+
if (!cwd)
|
|
301
|
+
return undefined;
|
|
302
|
+
const stripped = stripPrivatePaths(cwd).trim();
|
|
303
|
+
return stripped || undefined;
|
|
304
|
+
}
|
|
305
|
+
function sentenceHasSecret(text, options) {
|
|
306
|
+
return MARKER.test(redact(text, options));
|
|
307
|
+
}
|
|
308
|
+
function isOnlyEmail(text) {
|
|
309
|
+
return /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\.?$/.test(text.trim());
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../src/display.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,MAAM,GAAG,yBAAyB,CAAC;AAEzC,wEAAwE;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,sDAAsD,CAAC;AAUtF;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,KAAqB,EAAE,UAAyB,EAAE;IAC/E,MAAM,MAAM,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IA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AAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QAC/B,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC;IAC/B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAC,GAAuB;IACxC,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,MAAM,QAAQ,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/C,OAAO,QAAQ,IAAI,SAAS,CAAC;AAC/B,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,OAAsB;IAC7D,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,qDAAqD,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/env.d.ts
ADDED
package/dist/env.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Current names are PRTAPE_*. AGENTTAPE_* still works.
|
|
3
|
+
* When the new name is set, even to an empty string, it wins.
|
|
4
|
+
*/
|
|
5
|
+
export function envValue(suffix, env = process.env) {
|
|
6
|
+
const current = `PRTAPE_${suffix}`;
|
|
7
|
+
if (env[current] !== undefined)
|
|
8
|
+
return env[current];
|
|
9
|
+
return env[`AGENTTAPE_${suffix}`];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=env.js.map
|
package/dist/env.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,MAAyB,OAAO,CAAC,GAAG;IAC3E,MAAM,OAAO,GAAG,UAAU,MAAM,EAAE,CAAC;IACnC,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;IACpD,OAAO,GAAG,CAAC,aAAa,MAAM,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/gh.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export interface CommandResult {
|
|
2
|
+
code: number;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CommandRunner {
|
|
7
|
+
(command: string, args: string[], options: {
|
|
8
|
+
cwd: string;
|
|
9
|
+
input?: string;
|
|
10
|
+
}): Promise<CommandResult>;
|
|
11
|
+
}
|
|
12
|
+
export interface PrRef {
|
|
13
|
+
number: number;
|
|
14
|
+
url: string;
|
|
15
|
+
commentId: number;
|
|
16
|
+
/** True when an existing PRtape or AgentTape comment was edited instead of created. */
|
|
17
|
+
updated: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare class GhError extends Error {
|
|
20
|
+
constructor(message: string);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The only network path in PRtape. `gh` talks to GitHub when the user
|
|
24
|
+
* runs `prtape pr` without `--dry-run`. There is no telemetry.
|
|
25
|
+
*/
|
|
26
|
+
export declare function defaultRunner(command: string, args: string[], options: {
|
|
27
|
+
cwd: string;
|
|
28
|
+
input?: string;
|
|
29
|
+
}): Promise<CommandResult>;
|
|
30
|
+
export declare function explainGhFailure(result: CommandResult): string;
|
|
31
|
+
/**
|
|
32
|
+
* PNG comments and the mermaid fallback both match. Other review chatter does not.
|
|
33
|
+
* `<!-- prtape -->` is the marker id. Visible headings say PRtape.
|
|
34
|
+
* Older AgentTape comments still match so a rerun updates them.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isPrtapeComment(body: string): boolean;
|
|
37
|
+
/** @deprecated Use isPrtapeComment. Kept so older imports still find both markers. */
|
|
38
|
+
export declare function isAgentTapeComment(body: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Create or update one PRtape comment on the pull request.
|
|
41
|
+
* A second run PATCHes the latest matching comment from the current `gh` user
|
|
42
|
+
* instead of calling `gh pr comment` again.
|
|
43
|
+
*/
|
|
44
|
+
/** Head branch of the pull request that will receive the comment. Undefined when gh cannot answer. */
|
|
45
|
+
export declare function pullRequestHead(cwd: string, runner?: CommandRunner, prNumber?: number): Promise<string | undefined>;
|
|
46
|
+
export declare function postComment(cwd: string, body: string, runner?: CommandRunner, prNumber?: number): Promise<PrRef>;
|
package/dist/gh.js
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
export class GhError extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = "GhError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The only network path in PRtape. `gh` talks to GitHub when the user
|
|
10
|
+
* runs `prtape pr` without `--dry-run`. There is no telemetry.
|
|
11
|
+
*/
|
|
12
|
+
export function defaultRunner(command, args, options) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const child = spawn(command, args, { cwd: options.cwd, stdio: ["pipe", "pipe", "pipe"] });
|
|
15
|
+
const stdout = [];
|
|
16
|
+
const stderr = [];
|
|
17
|
+
child.stdout.on("data", (chunk) => stdout.push(chunk));
|
|
18
|
+
child.stderr.on("data", (chunk) => stderr.push(chunk));
|
|
19
|
+
child.on("error", (error) => {
|
|
20
|
+
if (error.code === "ENOENT") {
|
|
21
|
+
resolve({ code: 127, stdout: "", stderr: `${command} not found` });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
reject(error);
|
|
25
|
+
});
|
|
26
|
+
child.on("close", (code) => {
|
|
27
|
+
resolve({
|
|
28
|
+
code: code ?? 1,
|
|
29
|
+
stdout: Buffer.concat(stdout).toString("utf8"),
|
|
30
|
+
stderr: Buffer.concat(stderr).toString("utf8"),
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
if (options.input !== undefined)
|
|
34
|
+
child.stdin.end(options.input);
|
|
35
|
+
else
|
|
36
|
+
child.stdin.end();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export function explainGhFailure(result) {
|
|
40
|
+
const text = `${result.stderr}\n${result.stdout}`;
|
|
41
|
+
if (result.code === 127 || /not found|ENOENT/i.test(text)) {
|
|
42
|
+
return "gh is not installed.";
|
|
43
|
+
}
|
|
44
|
+
if (/not logged into|gh auth login|GH_TOKEN|GITHUB_TOKEN|HTTP 401|HTTP 403|authentication required|set up authentication/i.test(text)) {
|
|
45
|
+
return "gh is not authenticated.";
|
|
46
|
+
}
|
|
47
|
+
if (/no pull requests? found|no prs? found/i.test(text)) {
|
|
48
|
+
return "No pull request for this branch.";
|
|
49
|
+
}
|
|
50
|
+
const detail = result.stderr.trim().split("\n").find((line) => line.trim()) ?? "gh failed.";
|
|
51
|
+
return detail;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* PNG comments and the mermaid fallback both match. Other review chatter does not.
|
|
55
|
+
* `<!-- prtape -->` is the marker id. Visible headings say PRtape.
|
|
56
|
+
* Older AgentTape comments still match so a rerun updates them.
|
|
57
|
+
*/
|
|
58
|
+
export function isPrtapeComment(body) {
|
|
59
|
+
return (body.includes("<!-- prtape -->") ||
|
|
60
|
+
body.includes(" ||
|
|
61
|
+
body.includes("### PRtape") ||
|
|
62
|
+
body.includes("Redacted locally by PRtape") ||
|
|
63
|
+
body.includes(" ||
|
|
64
|
+
body.includes("### AgentTape") ||
|
|
65
|
+
body.includes("Redacted locally by AgentTape"));
|
|
66
|
+
}
|
|
67
|
+
/** @deprecated Use isPrtapeComment. Kept so older imports still find both markers. */
|
|
68
|
+
export function isAgentTapeComment(body) {
|
|
69
|
+
return isPrtapeComment(body);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create or update one PRtape comment on the pull request.
|
|
73
|
+
* A second run PATCHes the latest matching comment from the current `gh` user
|
|
74
|
+
* instead of calling `gh pr comment` again.
|
|
75
|
+
*/
|
|
76
|
+
/** Head branch of the pull request that will receive the comment. Undefined when gh cannot answer. */
|
|
77
|
+
export async function pullRequestHead(cwd, runner = defaultRunner, prNumber) {
|
|
78
|
+
const selector = prNumber !== undefined ? [String(prNumber)] : [];
|
|
79
|
+
const view = await runner("gh", ["pr", "view", ...selector, "--json", "headRefName"], { cwd });
|
|
80
|
+
if (view.code !== 0)
|
|
81
|
+
return undefined;
|
|
82
|
+
try {
|
|
83
|
+
const parsed = JSON.parse(view.stdout);
|
|
84
|
+
return typeof parsed.headRefName === "string" && parsed.headRefName.trim() ? parsed.headRefName.trim() : undefined;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export async function postComment(cwd, body, runner = defaultRunner, prNumber) {
|
|
91
|
+
const selector = prNumber !== undefined ? [String(prNumber)] : [];
|
|
92
|
+
const view = await runner("gh", ["pr", "view", ...selector, "--json", "number,url,title"], { cwd });
|
|
93
|
+
if (view.code !== 0)
|
|
94
|
+
throw new GhError(explainGhFailure(view));
|
|
95
|
+
let parsed;
|
|
96
|
+
try {
|
|
97
|
+
parsed = JSON.parse(view.stdout);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
throw new GhError("gh pr view did not return JSON.");
|
|
101
|
+
}
|
|
102
|
+
if (typeof parsed.number !== "number") {
|
|
103
|
+
throw new GhError("No pull request for this branch.");
|
|
104
|
+
}
|
|
105
|
+
const url = typeof parsed.url === "string" ? parsed.url : "";
|
|
106
|
+
const repo = ownerRepo(url) ?? (await repoSlug(cwd, runner));
|
|
107
|
+
if (!repo)
|
|
108
|
+
throw new GhError("Could not resolve owner/repo for the pull request comment.");
|
|
109
|
+
const login = await currentLogin(cwd, runner);
|
|
110
|
+
const existing = login ? await latestAgentTapeComment(cwd, runner, repo, parsed.number, login) : undefined;
|
|
111
|
+
const payload = JSON.stringify({ body });
|
|
112
|
+
if (existing) {
|
|
113
|
+
const patched = await runner("gh", ["api", "--method", "PATCH", `repos/${repo}/issues/comments/${existing.id}`, "--input", "-"], { cwd, input: payload });
|
|
114
|
+
if (patched.code !== 0)
|
|
115
|
+
throw new GhError(explainGhFailure(patched));
|
|
116
|
+
return { number: parsed.number, url, commentId: existing.id, updated: true };
|
|
117
|
+
}
|
|
118
|
+
const created = await runner("gh", ["api", "--method", "POST", `repos/${repo}/issues/${parsed.number}/comments`, "--input", "-"], { cwd, input: payload });
|
|
119
|
+
if (created.code !== 0)
|
|
120
|
+
throw new GhError(explainGhFailure(created));
|
|
121
|
+
let commentId = 0;
|
|
122
|
+
try {
|
|
123
|
+
const createdBody = JSON.parse(created.stdout);
|
|
124
|
+
if (typeof createdBody.id === "number")
|
|
125
|
+
commentId = createdBody.id;
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
commentId = 0;
|
|
129
|
+
}
|
|
130
|
+
return { number: parsed.number, url, commentId, updated: false };
|
|
131
|
+
}
|
|
132
|
+
function ownerRepo(url) {
|
|
133
|
+
const match = /^https:\/\/github\.com\/([^/]+)\/([^/]+?)(?:\.git)?\/pull\/\d+/.exec(url);
|
|
134
|
+
if (!match?.[1] || !match[2])
|
|
135
|
+
return undefined;
|
|
136
|
+
return `${match[1]}/${match[2]}`;
|
|
137
|
+
}
|
|
138
|
+
async function repoSlug(cwd, runner) {
|
|
139
|
+
const view = await runner("gh", ["repo", "view", "--json", "nameWithOwner"], { cwd });
|
|
140
|
+
if (view.code !== 0)
|
|
141
|
+
return undefined;
|
|
142
|
+
try {
|
|
143
|
+
const parsed = JSON.parse(view.stdout);
|
|
144
|
+
return typeof parsed.nameWithOwner === "string" ? parsed.nameWithOwner : undefined;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
async function currentLogin(cwd, runner) {
|
|
151
|
+
const user = await runner("gh", ["api", "user"], { cwd });
|
|
152
|
+
if (user.code !== 0)
|
|
153
|
+
return undefined;
|
|
154
|
+
try {
|
|
155
|
+
const parsed = JSON.parse(user.stdout);
|
|
156
|
+
return typeof parsed.login === "string" ? parsed.login : undefined;
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async function latestAgentTapeComment(cwd, runner, repo, prNumber, login) {
|
|
163
|
+
const listed = await runner("gh", ["api", "--paginate", `repos/${repo}/issues/${prNumber}/comments`], { cwd });
|
|
164
|
+
if (listed.code !== 0)
|
|
165
|
+
throw new GhError(explainGhFailure(listed));
|
|
166
|
+
let comments = [];
|
|
167
|
+
try {
|
|
168
|
+
const parsed = JSON.parse(listed.stdout);
|
|
169
|
+
if (Array.isArray(parsed))
|
|
170
|
+
comments = parsed;
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
throw new GhError("gh api did not return pull request comments as JSON.");
|
|
174
|
+
}
|
|
175
|
+
const mine = comments.filter((comment) => {
|
|
176
|
+
return (comment.user?.login === login &&
|
|
177
|
+
typeof comment.body === "string" &&
|
|
178
|
+
isPrtapeComment(comment.body) &&
|
|
179
|
+
typeof comment.id === "number");
|
|
180
|
+
});
|
|
181
|
+
mine.sort((a, b) => {
|
|
182
|
+
const byTime = String(b.created_at ?? "").localeCompare(String(a.created_at ?? ""));
|
|
183
|
+
if (byTime !== 0)
|
|
184
|
+
return byTime;
|
|
185
|
+
return Number(b.id) - Number(a.id);
|
|
186
|
+
});
|
|
187
|
+
const latest = mine[0];
|
|
188
|
+
return typeof latest?.id === "number" ?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;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,OAAO,CAAC,sDAAsD,CAAC,CAAC;IAC5E,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE;QACvC,OAAO,CACL,OAAO,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK;YAC7B,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ;YAChC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC;YAC7B,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,CAC/B,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;QACpF,IAAI,MAAM,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC;QAChC,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,OAAO,MAAM,EAAE,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC"}
|
package/dist/glance.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-glance failures: what broke, how to fix it, and the text-timeline fallback.
|
|
3
|
+
* These strings are the product contract. Do not shorten them into a bare exit code.
|
|
4
|
+
*/
|
|
5
|
+
/** Custom ref namespace. Never a branch under refs/heads, so it cannot merge into main. */
|
|
6
|
+
export declare const ORPHAN_REF_PREFIX = "refs/prtape";
|
|
7
|
+
export declare function orphanRef(anchor: string): string;
|
|
8
|
+
export declare function glanceMissingGh(): string;
|
|
9
|
+
export declare function glanceUnauth(): string;
|
|
10
|
+
export declare function glancePushDenied(): string;
|
|
11
|
+
export declare function glancePushOther(detail: string): string;
|
|
12
|
+
export declare function glanceNoOrigin(): string;
|
|
13
|
+
export declare function glanceRaster(): string;
|
|
14
|
+
export declare function glanceRepoUnreadable(detail: string): string;
|
|
15
|
+
export declare function isPermissionFailure(text: string): boolean;
|