@staff0rd/assist 0.1062.1 → 0.1063.1
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/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.1063.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -16213,13 +16213,14 @@ function toAttachments(value) {
|
|
|
16213
16213
|
function toChecklist(value) {
|
|
16214
16214
|
if (!Array.isArray(value)) return void 0;
|
|
16215
16215
|
return value.flatMap((entry) => {
|
|
16216
|
-
const { id, ticked, comment: comment3 } = entry ?? {};
|
|
16216
|
+
const { id, ticked, comment: comment3, slice } = entry ?? {};
|
|
16217
16217
|
if (typeof id !== "string") return [];
|
|
16218
16218
|
return [
|
|
16219
16219
|
{
|
|
16220
16220
|
id,
|
|
16221
16221
|
ticked: ticked === true,
|
|
16222
|
-
...typeof comment3 === "string" && comment3 !== "" ? { comment: comment3 } : {}
|
|
16222
|
+
...typeof comment3 === "string" && comment3 !== "" ? { comment: comment3 } : {},
|
|
16223
|
+
...typeof slice === "number" && Number.isInteger(slice) ? { slice } : {}
|
|
16223
16224
|
}
|
|
16224
16225
|
];
|
|
16225
16226
|
});
|
|
@@ -16276,6 +16277,7 @@ function toPreviewDecision(msg) {
|
|
|
16276
16277
|
reviewEvent: REVIEW_EVENTS.find((event) => event === msg.reviewEvent),
|
|
16277
16278
|
reviewComments: toReviewComments(msg.reviewComments),
|
|
16278
16279
|
dismissed: msg.dismissed === true,
|
|
16280
|
+
restart: msg.restart === true,
|
|
16279
16281
|
answers: toAnswers(msg.answers)
|
|
16280
16282
|
};
|
|
16281
16283
|
}
|
|
@@ -41430,6 +41432,13 @@ function clearHighLevelDraft(repo, headRef, headSha) {
|
|
|
41430
41432
|
rmSync7(highLevelDraftPath(repo, headRef, headSha), { force: true });
|
|
41431
41433
|
}
|
|
41432
41434
|
|
|
41435
|
+
// src/commands/review/highLevel/discardHighLevelProgress.ts
|
|
41436
|
+
import { rmSync as rmSync8 } from "fs";
|
|
41437
|
+
function discardHighLevelProgress(repo, headRef, headSha) {
|
|
41438
|
+
clearHighLevelDraft(repo, headRef, headSha);
|
|
41439
|
+
rmSync8(highLevelReviewPath(repo, headRef, headSha), { force: true });
|
|
41440
|
+
}
|
|
41441
|
+
|
|
41433
41442
|
// src/commands/review/highLevel/saveHighLevelDraft.ts
|
|
41434
41443
|
function saveHighLevelDraft(draft) {
|
|
41435
41444
|
return writeJsonFile(
|
|
@@ -41670,7 +41679,8 @@ function submitHighLevelReview(record) {
|
|
|
41670
41679
|
}
|
|
41671
41680
|
|
|
41672
41681
|
// src/commands/review/highLevel/openHighLevelOverlay.ts
|
|
41673
|
-
async function openHighLevelOverlay(sessionId2, subject) {
|
|
41682
|
+
async function openHighLevelOverlay(sessionId2, subject, onRestart = async () => {
|
|
41683
|
+
}) {
|
|
41674
41684
|
const decision = await awaitPreviewApproval(
|
|
41675
41685
|
"High-level review",
|
|
41676
41686
|
{
|
|
@@ -41684,6 +41694,11 @@ async function openHighLevelOverlay(sessionId2, subject) {
|
|
|
41684
41694
|
},
|
|
41685
41695
|
{ rejectIsOutcome: true }
|
|
41686
41696
|
);
|
|
41697
|
+
if (decision.restart) {
|
|
41698
|
+
discardHighLevelProgress(subject.repo, subject.headRef, subject.headSha);
|
|
41699
|
+
await onRestart();
|
|
41700
|
+
return void 0;
|
|
41701
|
+
}
|
|
41687
41702
|
if (decision.dismissed) {
|
|
41688
41703
|
saveHighLevelDraft(buildHighLevelDraft(subject, decision));
|
|
41689
41704
|
console.log(
|
|
@@ -41899,7 +41914,11 @@ async function runHighLevelReview(number, options2 = {}) {
|
|
|
41899
41914
|
const subject = gatherSubject(resolvePrNumber2(number), force, slicing);
|
|
41900
41915
|
announceSavedReview(subject, force);
|
|
41901
41916
|
if (!session) return printHighLevelChecklist(subject);
|
|
41902
|
-
await openHighLevelOverlay(
|
|
41917
|
+
await openHighLevelOverlay(
|
|
41918
|
+
session,
|
|
41919
|
+
subject,
|
|
41920
|
+
() => runHighLevelReview(number, { force: true })
|
|
41921
|
+
);
|
|
41903
41922
|
}
|
|
41904
41923
|
|
|
41905
41924
|
// src/commands/review/reviewPr.ts
|
|
@@ -47563,10 +47582,10 @@ function emitWatchState(watchState) {
|
|
|
47563
47582
|
}
|
|
47564
47583
|
|
|
47565
47584
|
// src/commands/watch/clearBuildPending.ts
|
|
47566
|
-
import { rmSync as
|
|
47585
|
+
import { rmSync as rmSync12 } from "fs";
|
|
47567
47586
|
function clearBuildPending() {
|
|
47568
47587
|
try {
|
|
47569
|
-
|
|
47588
|
+
rmSync12(buildPendingPath(), { force: true });
|
|
47570
47589
|
} catch {
|
|
47571
47590
|
}
|
|
47572
47591
|
}
|
|
@@ -47589,7 +47608,7 @@ function isSyncPending() {
|
|
|
47589
47608
|
}
|
|
47590
47609
|
|
|
47591
47610
|
// src/commands/watch/reportSyncOrExit.ts
|
|
47592
|
-
import { rmSync as
|
|
47611
|
+
import { rmSync as rmSync13 } from "fs";
|
|
47593
47612
|
|
|
47594
47613
|
// src/commands/watch/toBuildOutcome.ts
|
|
47595
47614
|
function toBuildOutcome(result) {
|
|
@@ -47616,7 +47635,7 @@ async function runPostBuildSync() {
|
|
|
47616
47635
|
// src/commands/watch/reportSyncOrExit.ts
|
|
47617
47636
|
function clearPendingMarker() {
|
|
47618
47637
|
try {
|
|
47619
|
-
|
|
47638
|
+
rmSync13(syncPendingPath(), { force: true });
|
|
47620
47639
|
} catch {
|
|
47621
47640
|
}
|
|
47622
47641
|
}
|
|
@@ -48060,11 +48079,11 @@ ${buildWatchReport(from)}`);
|
|
|
48060
48079
|
}
|
|
48061
48080
|
|
|
48062
48081
|
// src/commands/watch/consumeMarker.ts
|
|
48063
|
-
import { existsSync as existsSync89, rmSync as
|
|
48082
|
+
import { existsSync as existsSync89, rmSync as rmSync14 } from "fs";
|
|
48064
48083
|
function consumeMarker(path109) {
|
|
48065
48084
|
try {
|
|
48066
48085
|
if (!existsSync89(path109)) return false;
|
|
48067
|
-
|
|
48086
|
+
rmSync14(path109);
|
|
48068
48087
|
return true;
|
|
48069
48088
|
} catch {
|
|
48070
48089
|
return false;
|
|
@@ -50599,14 +50618,14 @@ function createRunSession(id, { runName, runArgs, cwd, meta }) {
|
|
|
50599
50618
|
}
|
|
50600
50619
|
|
|
50601
50620
|
// src/commands/sessions/daemon/autoUpdate/autoUpdateControl.ts
|
|
50602
|
-
import { existsSync as existsSync95, rmSync as
|
|
50621
|
+
import { existsSync as existsSync95, rmSync as rmSync15, writeFileSync as writeFileSync59 } from "fs";
|
|
50603
50622
|
var paused;
|
|
50604
50623
|
var wake;
|
|
50605
50624
|
var holdReleased = false;
|
|
50606
50625
|
function persist2(value) {
|
|
50607
50626
|
try {
|
|
50608
50627
|
if (value) writeFileSync59(daemonPaths.autoUpdatePaused, "");
|
|
50609
|
-
else
|
|
50628
|
+
else rmSync15(daemonPaths.autoUpdatePaused, { force: true });
|
|
50610
50629
|
} catch {
|
|
50611
50630
|
}
|
|
50612
50631
|
}
|
|
@@ -51041,12 +51060,12 @@ function noteAutoUpdate(installDir, text20) {
|
|
|
51041
51060
|
|
|
51042
51061
|
// src/commands/sessions/daemon/autoUpdate/runUpdateLap.ts
|
|
51043
51062
|
import { spawn as spawn12 } from "child_process";
|
|
51044
|
-
import { rmSync as
|
|
51063
|
+
import { rmSync as rmSync16 } from "fs";
|
|
51045
51064
|
function clearLapSignals(cwd) {
|
|
51046
51065
|
const control = watchControlPaths(cwd);
|
|
51047
51066
|
if (!control) return;
|
|
51048
51067
|
for (const path109 of [control.check, control.stop])
|
|
51049
|
-
|
|
51068
|
+
rmSync16(path109, { force: true });
|
|
51050
51069
|
}
|
|
51051
51070
|
function runUpdateLap(cwd, onOutput) {
|
|
51052
51071
|
clearLapSignals(cwd);
|
|
@@ -51888,10 +51907,37 @@ function count9(value) {
|
|
|
51888
51907
|
}
|
|
51889
51908
|
function logPrDecision(id, requestId, d) {
|
|
51890
51909
|
daemonLog(
|
|
51891
|
-
`pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${count9(d.comments)} screenshots=${count9(d.screenshots)} checklist=${count9(d.checklist)} reviewEvent=${d.reviewEvent} reviewComments=${count9(d.reviewComments)} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true} draft=${d.draft} autoMerge=${d.autoMerge === true} autostart=${d.autostart === true} answers=${d.answers && typeof d.answers === "object" ? Object.keys(d.answers).length : 0}`
|
|
51910
|
+
`pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${count9(d.comments)} screenshots=${count9(d.screenshots)} checklist=${count9(d.checklist)} reviewEvent=${d.reviewEvent} reviewComments=${count9(d.reviewComments)} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true} draft=${d.draft} autoMerge=${d.autoMerge === true} autostart=${d.autostart === true} restart=${d.restart === true} answers=${d.answers && typeof d.answers === "object" ? Object.keys(d.answers).length : 0}`
|
|
51892
51911
|
);
|
|
51893
51912
|
}
|
|
51894
51913
|
|
|
51914
|
+
// src/commands/sessions/daemon/prDecisionMessage.ts
|
|
51915
|
+
var FORWARDED = [
|
|
51916
|
+
"reason",
|
|
51917
|
+
"comments",
|
|
51918
|
+
"screenshots",
|
|
51919
|
+
"body",
|
|
51920
|
+
"reviewAfter",
|
|
51921
|
+
"announceAfter",
|
|
51922
|
+
"draft",
|
|
51923
|
+
"autoMerge",
|
|
51924
|
+
"autostart",
|
|
51925
|
+
"checklist",
|
|
51926
|
+
"reviewEvent",
|
|
51927
|
+
"reviewComments",
|
|
51928
|
+
"dismissed",
|
|
51929
|
+
"restart",
|
|
51930
|
+
"answers"
|
|
51931
|
+
];
|
|
51932
|
+
function prDecisionMessage(requestId, d) {
|
|
51933
|
+
return {
|
|
51934
|
+
type: "pr-decision",
|
|
51935
|
+
requestId,
|
|
51936
|
+
decision: d.decision,
|
|
51937
|
+
...Object.fromEntries(FORWARDED.map((key) => [key, d[key]]))
|
|
51938
|
+
};
|
|
51939
|
+
}
|
|
51940
|
+
|
|
51895
51941
|
// src/commands/sessions/daemon/decidePrPreview.ts
|
|
51896
51942
|
function decidePrPreview(sessions, waiters, notify2, d) {
|
|
51897
51943
|
const id = d.sessionId;
|
|
@@ -51913,26 +51959,7 @@ function decidePrPreview(sessions, waiters, notify2, d) {
|
|
|
51913
51959
|
}
|
|
51914
51960
|
logPrDecision(id, requestId, d);
|
|
51915
51961
|
const waiter = waiters.get(id);
|
|
51916
|
-
if (waiter)
|
|
51917
|
-
sendTo(waiter, {
|
|
51918
|
-
type: "pr-decision",
|
|
51919
|
-
requestId,
|
|
51920
|
-
decision: d.decision,
|
|
51921
|
-
reason: d.reason,
|
|
51922
|
-
comments: d.comments,
|
|
51923
|
-
screenshots: d.screenshots,
|
|
51924
|
-
body: d.body,
|
|
51925
|
-
reviewAfter: d.reviewAfter,
|
|
51926
|
-
announceAfter: d.announceAfter,
|
|
51927
|
-
draft: d.draft,
|
|
51928
|
-
autoMerge: d.autoMerge,
|
|
51929
|
-
autostart: d.autostart,
|
|
51930
|
-
checklist: d.checklist,
|
|
51931
|
-
reviewEvent: d.reviewEvent,
|
|
51932
|
-
reviewComments: d.reviewComments,
|
|
51933
|
-
dismissed: d.dismissed,
|
|
51934
|
-
answers: d.answers
|
|
51935
|
-
});
|
|
51962
|
+
if (waiter) sendTo(waiter, prDecisionMessage(requestId, d));
|
|
51936
51963
|
waiters.delete(id);
|
|
51937
51964
|
session.pendingPrPreview = void 0;
|
|
51938
51965
|
notify2();
|
|
@@ -56546,7 +56573,7 @@ function autoUpdateReply() {
|
|
|
56546
56573
|
}
|
|
56547
56574
|
|
|
56548
56575
|
// src/commands/sessions/daemon/autoUpdate/applyAutoUpdateAction.ts
|
|
56549
|
-
import { rmSync as
|
|
56576
|
+
import { rmSync as rmSync17, writeFileSync as writeFileSync61 } from "fs";
|
|
56550
56577
|
function signalLap(installDir, marker2) {
|
|
56551
56578
|
const control = watchControlPaths(installDir);
|
|
56552
56579
|
if (control) writeFileSync61(control[marker2], "");
|
|
@@ -56557,7 +56584,7 @@ function applyAutoUpdateAction(action) {
|
|
|
56557
56584
|
if (action === "resume") {
|
|
56558
56585
|
if (!autoUpdateControl.paused()) return void 0;
|
|
56559
56586
|
const control = watchControlPaths(installDir);
|
|
56560
|
-
if (control)
|
|
56587
|
+
if (control) rmSync17(control.stop, { force: true });
|
|
56561
56588
|
autoUpdateControl.setPaused(false);
|
|
56562
56589
|
noteAutoUpdate(installDir, "resumed from Updates");
|
|
56563
56590
|
return void 0;
|