@staff0rd/assist 0.625.0 → 0.626.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/README.md +1 -1
- package/dist/commands/sessions/web/bundle.js +388 -388
- package/dist/index.js +36 -17
- package/package.json +1 -1
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.626.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -13796,6 +13796,7 @@ function toPreviewDecision(msg) {
|
|
|
13796
13796
|
reviewAfter: msg.reviewAfter === true,
|
|
13797
13797
|
announceAfter: msg.announceAfter === true,
|
|
13798
13798
|
draft: typeof msg.draft === "boolean" ? msg.draft : void 0,
|
|
13799
|
+
autoMerge: msg.autoMerge === true,
|
|
13799
13800
|
selection: toSelection(msg.selection)
|
|
13800
13801
|
};
|
|
13801
13802
|
}
|
|
@@ -26534,6 +26535,22 @@ function warn(reason4) {
|
|
|
26534
26535
|
console.error(`Warning: could not chain sessions after raising: ${reason4}`);
|
|
26535
26536
|
}
|
|
26536
26537
|
|
|
26538
|
+
// src/commands/prs/enableAutoMerge.ts
|
|
26539
|
+
import { execFileSync as execFileSync16 } from "child_process";
|
|
26540
|
+
function enableAutoMerge() {
|
|
26541
|
+
try {
|
|
26542
|
+
execFileSync16(
|
|
26543
|
+
"gh",
|
|
26544
|
+
["pr", "merge", getCurrentBranch2(), "--auto", "--squash"],
|
|
26545
|
+
{ stdio: "inherit" }
|
|
26546
|
+
);
|
|
26547
|
+
} catch (error) {
|
|
26548
|
+
console.error(
|
|
26549
|
+
`Warning: could not enable auto-merge: ${error instanceof Error ? error.message : String(error)}`
|
|
26550
|
+
);
|
|
26551
|
+
}
|
|
26552
|
+
}
|
|
26553
|
+
|
|
26537
26554
|
// src/commands/prs/previewAndPlace.ts
|
|
26538
26555
|
async function previewAndPlace(args) {
|
|
26539
26556
|
const decision = await awaitPreviewApproval("PR preview", {
|
|
@@ -26547,6 +26564,7 @@ async function previewAndPlace(args) {
|
|
|
26547
26564
|
const body = appendScreenshots(args.body, decision.screenshots ?? []);
|
|
26548
26565
|
const options2 = decision.draft === void 0 ? args.options : { ...args.options, draft: decision.draft };
|
|
26549
26566
|
await placePr(args.prNumber, args.title, body, options2);
|
|
26567
|
+
if (decision.autoMerge === true) enableAutoMerge();
|
|
26550
26568
|
await chainAfterRaise(args.prNumber, decision);
|
|
26551
26569
|
}
|
|
26552
26570
|
|
|
@@ -33289,9 +33307,9 @@ function registerVoice(program2) {
|
|
|
33289
33307
|
}
|
|
33290
33308
|
|
|
33291
33309
|
// src/commands/watch/resolveUpstream.ts
|
|
33292
|
-
import { execFileSync as
|
|
33310
|
+
import { execFileSync as execFileSync17 } from "child_process";
|
|
33293
33311
|
function runGit3(args, cwd) {
|
|
33294
|
-
return
|
|
33312
|
+
return execFileSync17("git", args, {
|
|
33295
33313
|
encoding: "utf8",
|
|
33296
33314
|
stdio: ["pipe", "pipe", "pipe"],
|
|
33297
33315
|
cwd
|
|
@@ -33697,13 +33715,13 @@ import { spawn as spawn9 } from "child_process";
|
|
|
33697
33715
|
import { existsSync as existsSync81 } from "fs";
|
|
33698
33716
|
|
|
33699
33717
|
// src/commands/run/resolveCommand.ts
|
|
33700
|
-
import { execFileSync as
|
|
33718
|
+
import { execFileSync as execFileSync18 } from "child_process";
|
|
33701
33719
|
import { existsSync as existsSync80 } from "fs";
|
|
33702
33720
|
import { dirname as dirname37, join as join92, resolve as resolve20 } from "path";
|
|
33703
33721
|
function resolveCommand2(command) {
|
|
33704
33722
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
33705
33723
|
try {
|
|
33706
|
-
const gitPath =
|
|
33724
|
+
const gitPath = execFileSync18("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
33707
33725
|
const gitRoot = resolve20(dirname37(gitPath), "..");
|
|
33708
33726
|
const gitBash = join92(gitRoot, "bin", "bash.exe");
|
|
33709
33727
|
if (existsSync80(gitBash)) return gitBash;
|
|
@@ -33825,11 +33843,11 @@ async function reportSyncOrExit() {
|
|
|
33825
33843
|
}
|
|
33826
33844
|
|
|
33827
33845
|
// src/commands/watch/fetchQuietly.ts
|
|
33828
|
-
import { execFileSync as
|
|
33846
|
+
import { execFileSync as execFileSync19 } from "child_process";
|
|
33829
33847
|
var MIN_FETCH_TIMEOUT_MS = 6e4;
|
|
33830
33848
|
function fetchQuietly(cwd, intervalMs) {
|
|
33831
33849
|
try {
|
|
33832
|
-
|
|
33850
|
+
execFileSync19("git", ["fetch", "--quiet"], {
|
|
33833
33851
|
stdio: ["pipe", "pipe", "pipe"],
|
|
33834
33852
|
cwd,
|
|
33835
33853
|
timeout: Math.max(intervalMs, MIN_FETCH_TIMEOUT_MS)
|
|
@@ -34131,7 +34149,7 @@ async function auth() {
|
|
|
34131
34149
|
}
|
|
34132
34150
|
|
|
34133
34151
|
// src/commands/roam/postRoamActivity.ts
|
|
34134
|
-
import { execFileSync as
|
|
34152
|
+
import { execFileSync as execFileSync20 } from "child_process";
|
|
34135
34153
|
import { readdirSync as readdirSync21, readFileSync as readFileSync60, statSync as statSync12 } from "fs";
|
|
34136
34154
|
import { join as join93 } from "path";
|
|
34137
34155
|
function findPortFile(roamDir) {
|
|
@@ -34170,7 +34188,7 @@ function postRoamActivity(app, event) {
|
|
|
34170
34188
|
const pid = PID_BY_APP[app] ?? 99999;
|
|
34171
34189
|
const url = `http://127.0.0.1:${port}/api/v1/activity/${app}/${event}?pid=${pid}`;
|
|
34172
34190
|
try {
|
|
34173
|
-
|
|
34191
|
+
execFileSync20("curl", ["-sf", "--max-time", "0.2", "-X", "POST", url], {
|
|
34174
34192
|
stdio: "ignore"
|
|
34175
34193
|
});
|
|
34176
34194
|
} catch {
|
|
@@ -34648,11 +34666,11 @@ function screenshot(processName) {
|
|
|
34648
34666
|
}
|
|
34649
34667
|
|
|
34650
34668
|
// src/commands/sessions/daemon/listDaemonPids.ts
|
|
34651
|
-
import { execFileSync as
|
|
34669
|
+
import { execFileSync as execFileSync21 } from "child_process";
|
|
34652
34670
|
function listDaemonPids() {
|
|
34653
34671
|
if (process.platform === "win32") return [];
|
|
34654
34672
|
try {
|
|
34655
|
-
const out =
|
|
34673
|
+
const out = execFileSync21("ps", ["-eo", "pid=,args="], {
|
|
34656
34674
|
encoding: "utf8"
|
|
34657
34675
|
});
|
|
34658
34676
|
return out.split("\n").filter((line) => line.includes("assist") && / daemon run\b/.test(line)).map((line) => Number.parseInt(line.trim(), 10)).filter((pid) => Number.isInteger(pid));
|
|
@@ -35875,7 +35893,7 @@ function decidePrPreview(sessions, waiters, notify2, d) {
|
|
|
35875
35893
|
const commentCount = Array.isArray(d.comments) ? d.comments.length : 0;
|
|
35876
35894
|
const screenshotCount = Array.isArray(d.screenshots) ? d.screenshots.length : 0;
|
|
35877
35895
|
daemonLog(
|
|
35878
|
-
`pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${commentCount} screenshots=${screenshotCount} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true} draft=${d.draft}`
|
|
35896
|
+
`pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${commentCount} screenshots=${screenshotCount} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true} draft=${d.draft} autoMerge=${d.autoMerge === true}`
|
|
35879
35897
|
);
|
|
35880
35898
|
const waiter = waiters.get(id);
|
|
35881
35899
|
if (waiter)
|
|
@@ -35889,7 +35907,8 @@ function decidePrPreview(sessions, waiters, notify2, d) {
|
|
|
35889
35907
|
body: d.body,
|
|
35890
35908
|
reviewAfter: d.reviewAfter,
|
|
35891
35909
|
announceAfter: d.announceAfter,
|
|
35892
|
-
draft: d.draft
|
|
35910
|
+
draft: d.draft,
|
|
35911
|
+
autoMerge: d.autoMerge
|
|
35893
35912
|
});
|
|
35894
35913
|
waiters.delete(id);
|
|
35895
35914
|
session.pendingPrPreview = void 0;
|
|
@@ -40369,7 +40388,7 @@ function cleanupOwnedFiles() {
|
|
|
40369
40388
|
import * as net3 from "net";
|
|
40370
40389
|
|
|
40371
40390
|
// src/commands/sessions/daemon/findPortHolderPid.ts
|
|
40372
|
-
import { execFileSync as
|
|
40391
|
+
import { execFileSync as execFileSync22 } from "child_process";
|
|
40373
40392
|
var PROBE_TIMEOUT_MS = 3e3;
|
|
40374
40393
|
function findPortHolderPid(port) {
|
|
40375
40394
|
try {
|
|
@@ -40379,7 +40398,7 @@ function findPortHolderPid(port) {
|
|
|
40379
40398
|
}
|
|
40380
40399
|
}
|
|
40381
40400
|
function probe(command, args) {
|
|
40382
|
-
return
|
|
40401
|
+
return execFileSync22(command, args, {
|
|
40383
40402
|
encoding: "utf8",
|
|
40384
40403
|
timeout: PROBE_TIMEOUT_MS,
|
|
40385
40404
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -40618,7 +40637,7 @@ function summaryPathFor(jsonlPath2) {
|
|
|
40618
40637
|
}
|
|
40619
40638
|
|
|
40620
40639
|
// src/commands/sessions/summarise/summariseSession.ts
|
|
40621
|
-
import { execFileSync as
|
|
40640
|
+
import { execFileSync as execFileSync23 } from "child_process";
|
|
40622
40641
|
function summariseSession(jsonlPath2) {
|
|
40623
40642
|
const firstMessage = extractFirstUserMessage(jsonlPath2);
|
|
40624
40643
|
const backlogIds = scanSessionBacklogRefs(jsonlPath2);
|
|
@@ -40627,7 +40646,7 @@ function summariseSession(jsonlPath2) {
|
|
|
40627
40646
|
}
|
|
40628
40647
|
const prompt = buildPrompt6(firstMessage, backlogIds);
|
|
40629
40648
|
try {
|
|
40630
|
-
const output =
|
|
40649
|
+
const output = execFileSync23("claude", ["-p", "--model", "haiku", prompt], {
|
|
40631
40650
|
encoding: "utf8",
|
|
40632
40651
|
timeout: 3e4,
|
|
40633
40652
|
stdio: ["ignore", "pipe", "ignore"]
|