@staff0rd/assist 0.572.1 → 0.573.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/README.md +1 -0
- package/claude/commands/github.md +4 -4
- package/dist/commands/sessions/web/bundle.js +2 -2
- package/dist/index.js +164 -89
- 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.573.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -10067,13 +10067,19 @@ function resolveRepoGroup(cwd) {
|
|
|
10067
10067
|
const live = groupFromLiveTree(cwd);
|
|
10068
10068
|
if (live) return live;
|
|
10069
10069
|
const reaped = worktreeAttributionIncludingReaped(cwd);
|
|
10070
|
-
|
|
10070
|
+
if (!reaped) return void 0;
|
|
10071
|
+
const origin = currentOriginOfClone(reaped.clone) ?? reaped.origin;
|
|
10072
|
+
return hostedGroup(cwd, origin, reaped.clone);
|
|
10071
10073
|
}
|
|
10072
10074
|
function groupFromLiveTree(cwd) {
|
|
10073
10075
|
const clone = mainWorktree(cwd);
|
|
10074
10076
|
const origin = clone ? originForCwd(clone) : void 0;
|
|
10075
10077
|
return clone && origin ? hostedGroup(cwd, origin, clone) : void 0;
|
|
10076
10078
|
}
|
|
10079
|
+
function currentOriginOfClone(clone) {
|
|
10080
|
+
const main = mainWorktree(clone);
|
|
10081
|
+
return main ? originForCwd(main) : void 0;
|
|
10082
|
+
}
|
|
10077
10083
|
function hostedGroup(cwd, origin, clone) {
|
|
10078
10084
|
return { origin: isWindowsCwd(cwd) ? `windows:${origin}` : origin, clone };
|
|
10079
10085
|
}
|
|
@@ -16726,6 +16732,10 @@ var BUILTIN_DENIES = [
|
|
|
16726
16732
|
pattern: "gh issue create",
|
|
16727
16733
|
message: "Do not run 'gh issue create' directly. Use 'assist github issue create --title <title> --body <body> [-R <owner>/<repo>]' instead \u2014 it validates the title and body before delegating to gh, and gates the issue on the user's approval itself. Run 'assist github issue create --help' and follow its guidance to compose the body; it is authoritative on how approval is handled in this environment."
|
|
16728
16734
|
},
|
|
16735
|
+
{
|
|
16736
|
+
pattern: "gh issue comment",
|
|
16737
|
+
message: "Do not run 'gh issue comment' directly. Use 'assist github issue comment <number> --body <body> [-R <owner>/<repo>]' instead \u2014 it validates the body before delegating to gh, and gates the comment on the user's approval itself. Run 'assist github issue comment --help' and follow its guidance to compose the body; it is authoritative on how approval is handled in this environment."
|
|
16738
|
+
},
|
|
16729
16739
|
{
|
|
16730
16740
|
pattern: "git commit",
|
|
16731
16741
|
message: `Do not run 'git commit' directly. Use 'assist commit "<message>"' instead.`
|
|
@@ -20629,7 +20639,29 @@ function commits(org, options2) {
|
|
|
20629
20639
|
}
|
|
20630
20640
|
}
|
|
20631
20641
|
|
|
20632
|
-
// src/commands/github/
|
|
20642
|
+
// src/commands/github/parseSinceDate.ts
|
|
20643
|
+
import { InvalidArgumentError } from "commander";
|
|
20644
|
+
function parseSinceDate(value) {
|
|
20645
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
20646
|
+
throw new InvalidArgumentError("Expected a date in YYYY-MM-DD format.");
|
|
20647
|
+
}
|
|
20648
|
+
const date = /* @__PURE__ */ new Date(`${value}T00:00:00Z`);
|
|
20649
|
+
if (Number.isNaN(date.getTime()) || date.toISOString().slice(0, 10) !== value) {
|
|
20650
|
+
throw new InvalidArgumentError(`Not a valid calendar date: ${value}.`);
|
|
20651
|
+
}
|
|
20652
|
+
return value;
|
|
20653
|
+
}
|
|
20654
|
+
|
|
20655
|
+
// src/commands/github/parseTopCount.ts
|
|
20656
|
+
import { InvalidArgumentError as InvalidArgumentError2 } from "commander";
|
|
20657
|
+
function parseTopCount(value) {
|
|
20658
|
+
if (!/^\d+$/.test(value) || Number.parseInt(value, 10) < 1) {
|
|
20659
|
+
throw new InvalidArgumentError2("Expected a positive integer.");
|
|
20660
|
+
}
|
|
20661
|
+
return Number.parseInt(value, 10);
|
|
20662
|
+
}
|
|
20663
|
+
|
|
20664
|
+
// src/commands/github/issue/commentIssue.ts
|
|
20633
20665
|
import { execFileSync as execFileSync6 } from "child_process";
|
|
20634
20666
|
|
|
20635
20667
|
// src/shared/validateProposedContent.ts
|
|
@@ -20657,14 +20689,58 @@ function validateProposedContent(labels, title, body) {
|
|
|
20657
20689
|
}
|
|
20658
20690
|
}
|
|
20659
20691
|
|
|
20660
|
-
// src/commands/github/issue/
|
|
20692
|
+
// src/commands/github/issue/reviewProposedIssueComment.ts
|
|
20661
20693
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
20694
|
+
async function reviewProposedIssueComment(title, body) {
|
|
20695
|
+
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
20696
|
+
if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
|
|
20697
|
+
await awaitPreviewApproval("GitHub issue comment preview", {
|
|
20698
|
+
sessionId,
|
|
20699
|
+
requestId: randomUUID7(),
|
|
20700
|
+
title,
|
|
20701
|
+
body,
|
|
20702
|
+
prNumber: null,
|
|
20703
|
+
kind: "github-issue-comment"
|
|
20704
|
+
});
|
|
20705
|
+
}
|
|
20706
|
+
|
|
20707
|
+
// src/commands/github/issue/commentIssue.ts
|
|
20708
|
+
var USAGE = "Usage: assist github issue comment <number> --body <body> [-R <owner>/<repo>]";
|
|
20709
|
+
async function commentIssue(numberArg, options2) {
|
|
20710
|
+
const number = Number.parseInt(numberArg, 10);
|
|
20711
|
+
if (!Number.isInteger(number) || number <= 0 || !options2.body) {
|
|
20712
|
+
console.error(USAGE);
|
|
20713
|
+
process.exit(1);
|
|
20714
|
+
}
|
|
20715
|
+
const { body } = options2;
|
|
20716
|
+
const target = options2.repo ? `${options2.repo}#${number}` : `issue #${number}`;
|
|
20717
|
+
validateProposedContent(
|
|
20718
|
+
{ subject: "Comment", context: "GitHub issues" },
|
|
20719
|
+
"",
|
|
20720
|
+
body
|
|
20721
|
+
);
|
|
20722
|
+
await reviewProposedIssueComment(`Comment on ${target}`, body);
|
|
20723
|
+
const args = ["issue", "comment", String(number), "--body", body];
|
|
20724
|
+
if (options2.repo) args.push("--repo", options2.repo);
|
|
20725
|
+
try {
|
|
20726
|
+
execFileSync6("gh", args, { stdio: "inherit" });
|
|
20727
|
+
} catch {
|
|
20728
|
+
process.exit(1);
|
|
20729
|
+
}
|
|
20730
|
+
console.log(`Comment posted to ${target}`);
|
|
20731
|
+
}
|
|
20732
|
+
|
|
20733
|
+
// src/commands/github/issue/createIssue.ts
|
|
20734
|
+
import { execFileSync as execFileSync7 } from "child_process";
|
|
20735
|
+
|
|
20736
|
+
// src/commands/github/issue/reviewProposedIssue.ts
|
|
20737
|
+
import { randomUUID as randomUUID8 } from "crypto";
|
|
20662
20738
|
async function reviewProposedIssue(title, body) {
|
|
20663
20739
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
20664
20740
|
if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
|
|
20665
20741
|
await awaitPreviewApproval("GitHub issue preview", {
|
|
20666
20742
|
sessionId,
|
|
20667
|
-
requestId:
|
|
20743
|
+
requestId: randomUUID8(),
|
|
20668
20744
|
title,
|
|
20669
20745
|
body,
|
|
20670
20746
|
prNumber: null,
|
|
@@ -20673,10 +20749,10 @@ async function reviewProposedIssue(title, body) {
|
|
|
20673
20749
|
}
|
|
20674
20750
|
|
|
20675
20751
|
// src/commands/github/issue/createIssue.ts
|
|
20676
|
-
var
|
|
20752
|
+
var USAGE2 = "Usage: assist github issue create --title <title> --body <body> [-R <owner>/<repo>]";
|
|
20677
20753
|
async function createIssue(options2) {
|
|
20678
20754
|
if (!options2.title || !options2.body) {
|
|
20679
|
-
console.error(
|
|
20755
|
+
console.error(USAGE2);
|
|
20680
20756
|
process.exit(1);
|
|
20681
20757
|
}
|
|
20682
20758
|
const { title, body } = options2;
|
|
@@ -20689,32 +20765,47 @@ async function createIssue(options2) {
|
|
|
20689
20765
|
const args = ["issue", "create", "--title", title, "--body", body];
|
|
20690
20766
|
if (options2.repo) args.push("--repo", options2.repo);
|
|
20691
20767
|
try {
|
|
20692
|
-
|
|
20768
|
+
execFileSync7("gh", args, { stdio: "inherit" });
|
|
20693
20769
|
} catch {
|
|
20694
20770
|
process.exit(1);
|
|
20695
20771
|
}
|
|
20696
20772
|
}
|
|
20697
20773
|
|
|
20698
|
-
// src/commands/
|
|
20699
|
-
|
|
20700
|
-
|
|
20701
|
-
|
|
20702
|
-
|
|
20703
|
-
|
|
20704
|
-
|
|
20705
|
-
if (Number.isNaN(date.getTime()) || date.toISOString().slice(0, 10) !== value) {
|
|
20706
|
-
throw new InvalidArgumentError(`Not a valid calendar date: ${value}.`);
|
|
20774
|
+
// src/commands/prs/readBodyArgument.ts
|
|
20775
|
+
async function readBodyArgument(value) {
|
|
20776
|
+
if (value !== "-") return value;
|
|
20777
|
+
const body = (await readStdinBuffer()).toString("utf8").replace(/\n+$/, "");
|
|
20778
|
+
if (body.trim().length === 0) {
|
|
20779
|
+
console.error("Error: No body was provided on stdin.");
|
|
20780
|
+
process.exit(1);
|
|
20707
20781
|
}
|
|
20708
|
-
return
|
|
20782
|
+
return body;
|
|
20709
20783
|
}
|
|
20710
20784
|
|
|
20711
|
-
// src/commands/
|
|
20712
|
-
|
|
20713
|
-
|
|
20714
|
-
|
|
20715
|
-
|
|
20716
|
-
|
|
20717
|
-
|
|
20785
|
+
// src/commands/registerGithubIssue.ts
|
|
20786
|
+
function registerGithubIssue(githubCommand) {
|
|
20787
|
+
const issueCommand = githubCommand.command("issue").description("GitHub issue utilities");
|
|
20788
|
+
issueCommand.command("create").description("Create a GitHub issue").option("--title <title>", "Issue title").option("--body <body>", "Issue body").option(
|
|
20789
|
+
"-R, --repo <owner/repo>",
|
|
20790
|
+
"Target repository (defaults to the current repo)"
|
|
20791
|
+
).addHelpText(
|
|
20792
|
+
"after",
|
|
20793
|
+
"\nThere is no What/Why/How template: an issue reports a problem, and the target repo's own issue template is unknowable from here. Write the body as the repo's maintainers would expect.\nIn an assist web session the title and body are previewed for approve/reject first (with inline comments); nothing is created until it is approved."
|
|
20794
|
+
).action(createIssue);
|
|
20795
|
+
issueCommand.command("comment <number>").description("Comment on a GitHub issue (body of - reads it from stdin)").option("--body <body>", "Comment body (- reads it from stdin)").option(
|
|
20796
|
+
"-R, --repo <owner/repo>",
|
|
20797
|
+
"Target repository (defaults to the current repo)"
|
|
20798
|
+
).addHelpText(
|
|
20799
|
+
"after",
|
|
20800
|
+
"\nThe comment is outward-facing: write it for the repo's readers, not the team. It is rejected if it references Claude or an assist backlog item.\nIn an assist web session the body is previewed for approve/reject first (with inline comments); nothing is posted until it is approved."
|
|
20801
|
+
).action(
|
|
20802
|
+
async (number, options2) => {
|
|
20803
|
+
await commentIssue(number, {
|
|
20804
|
+
...options2,
|
|
20805
|
+
body: options2.body ? await readBodyArgument(options2.body) : void 0
|
|
20806
|
+
});
|
|
20807
|
+
}
|
|
20808
|
+
);
|
|
20718
20809
|
}
|
|
20719
20810
|
|
|
20720
20811
|
// src/commands/registerGithub.ts
|
|
@@ -20729,14 +20820,7 @@ function registerGithub(program2) {
|
|
|
20729
20820
|
"only report the top <n> repos by commit count",
|
|
20730
20821
|
parseTopCount
|
|
20731
20822
|
).option("--json", "Output as JSON").action(commits);
|
|
20732
|
-
|
|
20733
|
-
issueCommand.command("create").description("Create a GitHub issue").option("--title <title>", "Issue title").option("--body <body>", "Issue body").option(
|
|
20734
|
-
"-R, --repo <owner/repo>",
|
|
20735
|
-
"Target repository (defaults to the current repo)"
|
|
20736
|
-
).addHelpText(
|
|
20737
|
-
"after",
|
|
20738
|
-
"\nThere is no What/Why/How template: an issue reports a problem, and the target repo's own issue template is unknowable from here. Write the body as the repo's maintainers would expect.\nIn an assist web session the title and body are previewed for approve/reject first (with inline comments); nothing is created until it is approved."
|
|
20739
|
-
).action(createIssue);
|
|
20823
|
+
registerGithubIssue(githubCommand);
|
|
20740
20824
|
}
|
|
20741
20825
|
|
|
20742
20826
|
// src/commands/handover/countPendingHandovers.ts
|
|
@@ -21146,10 +21230,10 @@ function registerRefineLaunch(program2, resumeFlag) {
|
|
|
21146
21230
|
}
|
|
21147
21231
|
|
|
21148
21232
|
// src/commands/reviewPrComments.ts
|
|
21149
|
-
import { randomUUID as
|
|
21233
|
+
import { randomUUID as randomUUID9 } from "crypto";
|
|
21150
21234
|
|
|
21151
21235
|
// src/commands/review/checkoutPr.ts
|
|
21152
|
-
import { execFileSync as
|
|
21236
|
+
import { execFileSync as execFileSync9 } from "child_process";
|
|
21153
21237
|
import chalk164 from "chalk";
|
|
21154
21238
|
|
|
21155
21239
|
// src/commands/sessions/daemon/daemonLog.ts
|
|
@@ -21709,10 +21793,10 @@ async function moveToPrCheckoutTree() {
|
|
|
21709
21793
|
}
|
|
21710
21794
|
|
|
21711
21795
|
// src/commands/review/prHeadBranch.ts
|
|
21712
|
-
import { execFileSync as
|
|
21796
|
+
import { execFileSync as execFileSync8 } from "child_process";
|
|
21713
21797
|
function prHeadBranch(number) {
|
|
21714
21798
|
try {
|
|
21715
|
-
const out =
|
|
21799
|
+
const out = execFileSync8(
|
|
21716
21800
|
"gh",
|
|
21717
21801
|
["pr", "view", number, "--json", "headRefName", "-q", ".headRefName"],
|
|
21718
21802
|
{ encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }
|
|
@@ -21760,7 +21844,7 @@ async function checkoutPr(number) {
|
|
|
21760
21844
|
if (headRef && moveToExistingCheckout(number, headRef)) return;
|
|
21761
21845
|
await moveToPrCheckoutTree();
|
|
21762
21846
|
try {
|
|
21763
|
-
|
|
21847
|
+
execFileSync9("gh", ["pr", "checkout", number], { stdio: "inherit" });
|
|
21764
21848
|
} catch {
|
|
21765
21849
|
console.error(chalk164.red(`gh pr checkout ${number} failed; aborting.`));
|
|
21766
21850
|
process.exit(1);
|
|
@@ -21782,7 +21866,7 @@ async function reviewPrComments(number, options2 = {}) {
|
|
|
21782
21866
|
const resumeSessionId = options2.resumeSessionId;
|
|
21783
21867
|
validateAnnounce(number, announce);
|
|
21784
21868
|
if (number && !resumeSessionId) await checkoutPr(number);
|
|
21785
|
-
const claudeSessionId = resumeSessionId ??
|
|
21869
|
+
const claudeSessionId = resumeSessionId ?? randomUUID9();
|
|
21786
21870
|
emitActivity({
|
|
21787
21871
|
kind: "command",
|
|
21788
21872
|
name: "review-pr-comments",
|
|
@@ -21800,14 +21884,14 @@ async function reviewPrComments(number, options2 = {}) {
|
|
|
21800
21884
|
}
|
|
21801
21885
|
|
|
21802
21886
|
// src/commands/fixConflict.ts
|
|
21803
|
-
import { randomUUID as
|
|
21887
|
+
import { randomUUID as randomUUID10 } from "crypto";
|
|
21804
21888
|
function buildPrompt3(rebase) {
|
|
21805
21889
|
return rebase ? "/fix-conflict --rebase" : "/fix-conflict";
|
|
21806
21890
|
}
|
|
21807
21891
|
async function fixConflict(number, options2 = {}) {
|
|
21808
21892
|
const { resumeSessionId } = options2;
|
|
21809
21893
|
if (number && !resumeSessionId) await checkoutPr(number);
|
|
21810
|
-
const claudeSessionId = resumeSessionId ??
|
|
21894
|
+
const claudeSessionId = resumeSessionId ?? randomUUID10();
|
|
21811
21895
|
emitActivity({
|
|
21812
21896
|
kind: "command",
|
|
21813
21897
|
name: "fix-conflict",
|
|
@@ -22829,13 +22913,13 @@ function postReviewComment(vars) {
|
|
|
22829
22913
|
}
|
|
22830
22914
|
|
|
22831
22915
|
// src/commands/prs/reviewProposedPrComment.ts
|
|
22832
|
-
import { randomUUID as
|
|
22916
|
+
import { randomUUID as randomUUID11 } from "crypto";
|
|
22833
22917
|
async function reviewProposedPrComment(title, body, prNumber) {
|
|
22834
22918
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
22835
22919
|
if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
|
|
22836
22920
|
await awaitPreviewApproval("PR comment preview", {
|
|
22837
22921
|
sessionId,
|
|
22838
|
-
requestId:
|
|
22922
|
+
requestId: randomUUID11(),
|
|
22839
22923
|
title,
|
|
22840
22924
|
body,
|
|
22841
22925
|
prNumber,
|
|
@@ -22961,7 +23045,7 @@ async function comment2(path80, line, body, startLine) {
|
|
|
22961
23045
|
}
|
|
22962
23046
|
|
|
22963
23047
|
// src/commands/prs/edit.ts
|
|
22964
|
-
import { randomUUID as
|
|
23048
|
+
import { randomUUID as randomUUID12 } from "crypto";
|
|
22965
23049
|
|
|
22966
23050
|
// src/commands/prs/appendScreenshots.ts
|
|
22967
23051
|
function appendScreenshots(body, screenshots) {
|
|
@@ -22974,13 +23058,13 @@ ${screenshots.join("\n\n")}`;
|
|
|
22974
23058
|
}
|
|
22975
23059
|
|
|
22976
23060
|
// src/commands/prs/applyEdit.ts
|
|
22977
|
-
import { execFileSync as
|
|
23061
|
+
import { execFileSync as execFileSync10 } from "child_process";
|
|
22978
23062
|
function applyEdit(number, title, body) {
|
|
22979
23063
|
const args = ["pr", "edit", String(number)];
|
|
22980
23064
|
if (title) args.push("--title", title);
|
|
22981
23065
|
args.push("--body", body);
|
|
22982
23066
|
try {
|
|
22983
|
-
|
|
23067
|
+
execFileSync10("gh", args, { stdio: "inherit" });
|
|
22984
23068
|
} catch {
|
|
22985
23069
|
process.exit(1);
|
|
22986
23070
|
}
|
|
@@ -23158,7 +23242,7 @@ async function edit(options2) {
|
|
|
23158
23242
|
if (process.env.ASSIST_SESSION === "1" && sessionId) {
|
|
23159
23243
|
const decision = await awaitPreviewApproval("PR preview", {
|
|
23160
23244
|
sessionId,
|
|
23161
|
-
requestId:
|
|
23245
|
+
requestId: randomUUID12(),
|
|
23162
23246
|
title: options2.title ?? title,
|
|
23163
23247
|
body: newBody,
|
|
23164
23248
|
prNumber: number
|
|
@@ -23776,7 +23860,7 @@ function buildValidatedBody(options2, usage) {
|
|
|
23776
23860
|
}
|
|
23777
23861
|
|
|
23778
23862
|
// src/commands/prs/placePr.ts
|
|
23779
|
-
import { execFileSync as
|
|
23863
|
+
import { execFileSync as execFileSync11 } from "child_process";
|
|
23780
23864
|
|
|
23781
23865
|
// src/commands/prs/buildCreateArgs.ts
|
|
23782
23866
|
function buildEditArgs(number, title, body) {
|
|
@@ -23843,7 +23927,7 @@ async function recordPrActivity() {
|
|
|
23843
23927
|
// src/commands/prs/placePr.ts
|
|
23844
23928
|
function hasUpstream2() {
|
|
23845
23929
|
try {
|
|
23846
|
-
|
|
23930
|
+
execFileSync11(
|
|
23847
23931
|
"git",
|
|
23848
23932
|
["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"],
|
|
23849
23933
|
{ stdio: "pipe" }
|
|
@@ -23855,13 +23939,13 @@ function hasUpstream2() {
|
|
|
23855
23939
|
}
|
|
23856
23940
|
function ensureBranchPushed() {
|
|
23857
23941
|
const args = hasUpstream2() ? ["push"] : ["push", "--set-upstream", "origin", "HEAD"];
|
|
23858
|
-
|
|
23942
|
+
execFileSync11("git", args, { stdio: "inherit" });
|
|
23859
23943
|
}
|
|
23860
23944
|
async function placePr(prNumber, title, body, options2) {
|
|
23861
23945
|
const args = prNumber !== null ? buildEditArgs(prNumber, title, body) : buildCreateArgs(title, body, options2);
|
|
23862
23946
|
try {
|
|
23863
23947
|
if (prNumber === null && !options2.head) ensureBranchPushed();
|
|
23864
|
-
|
|
23948
|
+
execFileSync11("gh", args, { stdio: "inherit" });
|
|
23865
23949
|
} catch {
|
|
23866
23950
|
process.exit(1);
|
|
23867
23951
|
}
|
|
@@ -23869,7 +23953,7 @@ async function placePr(prNumber, title, body, options2) {
|
|
|
23869
23953
|
}
|
|
23870
23954
|
|
|
23871
23955
|
// src/commands/prs/previewAndPlace.ts
|
|
23872
|
-
import { randomUUID as
|
|
23956
|
+
import { randomUUID as randomUUID13 } from "crypto";
|
|
23873
23957
|
|
|
23874
23958
|
// src/commands/sessions/shared/requestSession.ts
|
|
23875
23959
|
function parseIncoming(line, type) {
|
|
@@ -24004,7 +24088,7 @@ function warn(reason4) {
|
|
|
24004
24088
|
async function previewAndPlace(args) {
|
|
24005
24089
|
const decision = await awaitPreviewApproval("PR preview", {
|
|
24006
24090
|
sessionId: args.sessionId,
|
|
24007
|
-
requestId:
|
|
24091
|
+
requestId: randomUUID13(),
|
|
24008
24092
|
title: args.title,
|
|
24009
24093
|
body: args.body,
|
|
24010
24094
|
prNumber: args.prNumber,
|
|
@@ -24024,9 +24108,9 @@ function resolveDraftState(options2, command) {
|
|
|
24024
24108
|
}
|
|
24025
24109
|
|
|
24026
24110
|
// src/commands/prs/raise.ts
|
|
24027
|
-
var
|
|
24111
|
+
var USAGE3 = "Usage: assist prs raise --title <title> --what <what> --why <why> [--how <how>] [--resolves <key>] [--force]";
|
|
24028
24112
|
async function raise(options2, command) {
|
|
24029
|
-
const { title, body } = buildValidatedBody(options2,
|
|
24113
|
+
const { title, body } = buildValidatedBody(options2, USAGE3);
|
|
24030
24114
|
const resolved = { ...options2, draft: resolveDraftState(options2, command) };
|
|
24031
24115
|
const existing = findCurrentPrNumber();
|
|
24032
24116
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
@@ -24125,17 +24209,6 @@ async function wontfix(commentId, reason4) {
|
|
|
24125
24209
|
}
|
|
24126
24210
|
}
|
|
24127
24211
|
|
|
24128
|
-
// src/commands/prs/readBodyArgument.ts
|
|
24129
|
-
async function readBodyArgument(value) {
|
|
24130
|
-
if (value !== "-") return value;
|
|
24131
|
-
const body = (await readStdinBuffer()).toString("utf8").replace(/\n+$/, "");
|
|
24132
|
-
if (body.trim().length === 0) {
|
|
24133
|
-
console.error("Error: No body was provided on stdin.");
|
|
24134
|
-
process.exit(1);
|
|
24135
|
-
}
|
|
24136
|
-
return body;
|
|
24137
|
-
}
|
|
24138
|
-
|
|
24139
24212
|
// src/commands/registerPrsComments.ts
|
|
24140
24213
|
function registerPrsComments(prsCommand) {
|
|
24141
24214
|
prsCommand.command("list-comments").description("List all comments on the current branch's pull request").action(() => {
|
|
@@ -26487,10 +26560,10 @@ function registerRefactor(program2) {
|
|
|
26487
26560
|
}
|
|
26488
26561
|
|
|
26489
26562
|
// src/commands/review/checkoutOnlySession.ts
|
|
26490
|
-
import { randomUUID as
|
|
26563
|
+
import { randomUUID as randomUUID14 } from "crypto";
|
|
26491
26564
|
async function checkoutOnlySession(number) {
|
|
26492
26565
|
await checkoutPr(number);
|
|
26493
|
-
const claudeSessionId =
|
|
26566
|
+
const claudeSessionId = randomUUID14();
|
|
26494
26567
|
emitActivity({ kind: "command", name: "review", claudeSessionId });
|
|
26495
26568
|
const { done: done2 } = spawnClaude("", {
|
|
26496
26569
|
permissionMode: "acceptEdits",
|
|
@@ -30122,9 +30195,9 @@ function registerVoice(program2) {
|
|
|
30122
30195
|
import { join as join83 } from "path";
|
|
30123
30196
|
|
|
30124
30197
|
// src/commands/watch/resolveUpstream.ts
|
|
30125
|
-
import { execFileSync as
|
|
30198
|
+
import { execFileSync as execFileSync12 } from "child_process";
|
|
30126
30199
|
function runGit2(args, cwd) {
|
|
30127
|
-
return
|
|
30200
|
+
return execFileSync12("git", args, {
|
|
30128
30201
|
encoding: "utf8",
|
|
30129
30202
|
stdio: ["pipe", "pipe", "pipe"],
|
|
30130
30203
|
cwd
|
|
@@ -30485,13 +30558,13 @@ import { spawn as spawn9 } from "child_process";
|
|
|
30485
30558
|
import { existsSync as existsSync68 } from "fs";
|
|
30486
30559
|
|
|
30487
30560
|
// src/commands/run/resolveCommand.ts
|
|
30488
|
-
import { execFileSync as
|
|
30561
|
+
import { execFileSync as execFileSync13 } from "child_process";
|
|
30489
30562
|
import { existsSync as existsSync67 } from "fs";
|
|
30490
30563
|
import { dirname as dirname35, join as join84, resolve as resolve19 } from "path";
|
|
30491
30564
|
function resolveCommand2(command) {
|
|
30492
30565
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
30493
30566
|
try {
|
|
30494
|
-
const gitPath =
|
|
30567
|
+
const gitPath = execFileSync13("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
30495
30568
|
const gitRoot = resolve19(dirname35(gitPath), "..");
|
|
30496
30569
|
const gitBash = join84(gitRoot, "bin", "bash.exe");
|
|
30497
30570
|
if (existsSync67(gitBash)) return gitBash;
|
|
@@ -30588,11 +30661,11 @@ async function reportBuildOrExit(entry) {
|
|
|
30588
30661
|
}
|
|
30589
30662
|
|
|
30590
30663
|
// src/commands/watch/fetchQuietly.ts
|
|
30591
|
-
import { execFileSync as
|
|
30664
|
+
import { execFileSync as execFileSync14 } from "child_process";
|
|
30592
30665
|
var MIN_FETCH_TIMEOUT_MS = 6e4;
|
|
30593
30666
|
function fetchQuietly(cwd, intervalMs) {
|
|
30594
30667
|
try {
|
|
30595
|
-
|
|
30668
|
+
execFileSync14("git", ["fetch", "--quiet"], {
|
|
30596
30669
|
stdio: ["pipe", "pipe", "pipe"],
|
|
30597
30670
|
cwd,
|
|
30598
30671
|
timeout: Math.max(intervalMs, MIN_FETCH_TIMEOUT_MS)
|
|
@@ -30892,7 +30965,7 @@ async function auth() {
|
|
|
30892
30965
|
}
|
|
30893
30966
|
|
|
30894
30967
|
// src/commands/roam/postRoamActivity.ts
|
|
30895
|
-
import { execFileSync as
|
|
30968
|
+
import { execFileSync as execFileSync15 } from "child_process";
|
|
30896
30969
|
import { readdirSync as readdirSync20, readFileSync as readFileSync52, statSync as statSync11 } from "fs";
|
|
30897
30970
|
import { join as join85 } from "path";
|
|
30898
30971
|
function findPortFile(roamDir) {
|
|
@@ -30925,7 +30998,7 @@ function postRoamActivity(app, event) {
|
|
|
30925
30998
|
}
|
|
30926
30999
|
const url = `http://127.0.0.1:${port}/api/v1/activity/${app}/${event}?pid=${app === "codex" ? 99998 : 99999}`;
|
|
30927
31000
|
try {
|
|
30928
|
-
|
|
31001
|
+
execFileSync15("curl", ["-sf", "--max-time", "0.2", "-X", "POST", url], {
|
|
30929
31002
|
stdio: "ignore"
|
|
30930
31003
|
});
|
|
30931
31004
|
} catch {
|
|
@@ -31401,11 +31474,11 @@ function screenshot(processName) {
|
|
|
31401
31474
|
}
|
|
31402
31475
|
|
|
31403
31476
|
// src/commands/sessions/daemon/listDaemonPids.ts
|
|
31404
|
-
import { execFileSync as
|
|
31477
|
+
import { execFileSync as execFileSync16 } from "child_process";
|
|
31405
31478
|
function listDaemonPids() {
|
|
31406
31479
|
if (process.platform === "win32") return [];
|
|
31407
31480
|
try {
|
|
31408
|
-
const out =
|
|
31481
|
+
const out = execFileSync16("ps", ["-eo", "pid=,args="], {
|
|
31409
31482
|
encoding: "utf8"
|
|
31410
31483
|
});
|
|
31411
31484
|
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));
|
|
@@ -31862,7 +31935,7 @@ var ClientHub = class extends Set {
|
|
|
31862
31935
|
};
|
|
31863
31936
|
|
|
31864
31937
|
// src/commands/sessions/daemon/createSession.ts
|
|
31865
|
-
import { randomUUID as
|
|
31938
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
31866
31939
|
|
|
31867
31940
|
// src/commands/sessions/daemon/sessionBase.ts
|
|
31868
31941
|
function sessionBase(id, status3) {
|
|
@@ -32058,7 +32131,7 @@ function spawnRun(opts) {
|
|
|
32058
32131
|
function createSession(id, { prompt, cwd, design, auto, harness, holdPty } = {}) {
|
|
32059
32132
|
if (harness && harness !== "claude")
|
|
32060
32133
|
return createHarnessSession(id, harness, prompt, cwd, holdPty);
|
|
32061
|
-
const claudeSessionId =
|
|
32134
|
+
const claudeSessionId = randomUUID15();
|
|
32062
32135
|
return {
|
|
32063
32136
|
...sessionBase(id, prompt ? "running" : "waiting"),
|
|
32064
32137
|
name: `Session ${id}`,
|
|
@@ -32654,7 +32727,8 @@ var PREVIEW_KINDS = [
|
|
|
32654
32727
|
"backlog-item",
|
|
32655
32728
|
"backlog-comment",
|
|
32656
32729
|
"pr-comment",
|
|
32657
|
-
"github-issue"
|
|
32730
|
+
"github-issue",
|
|
32731
|
+
"github-issue-comment"
|
|
32658
32732
|
];
|
|
32659
32733
|
function isPreviewKind(value) {
|
|
32660
32734
|
return PREVIEW_KINDS.includes(value);
|
|
@@ -32664,6 +32738,7 @@ function isPreviewKind(value) {
|
|
|
32664
32738
|
function previewTargetLabel(kind, itemType, prNumber, draft) {
|
|
32665
32739
|
if (kind === "backlog-comment") return "backlog comment";
|
|
32666
32740
|
if (kind === "pr-comment") return "pr comment";
|
|
32741
|
+
if (kind === "github-issue-comment") return "github issue comment";
|
|
32667
32742
|
if (kind === "github-issue") return "github issue";
|
|
32668
32743
|
if (kind === "backlog-item") return `backlog ${itemType}`;
|
|
32669
32744
|
if (prNumber !== null) return `edit #${prNumber}`;
|
|
@@ -34124,7 +34199,7 @@ function codexRespawnPlan(session) {
|
|
|
34124
34199
|
}
|
|
34125
34200
|
|
|
34126
34201
|
// src/commands/sessions/daemon/interactiveRespawnPlan.ts
|
|
34127
|
-
import { randomUUID as
|
|
34202
|
+
import { randomUUID as randomUUID16 } from "crypto";
|
|
34128
34203
|
function interactiveRespawnPlan(session, resumes) {
|
|
34129
34204
|
const { claudeSessionId, cwd, initialPrompt, design, auto } = session;
|
|
34130
34205
|
if (!resumes) return null;
|
|
@@ -34144,7 +34219,7 @@ function interactiveRespawnPlan(session, resumes) {
|
|
|
34144
34219
|
return null;
|
|
34145
34220
|
}
|
|
34146
34221
|
function freshClaudePlan(session, prompt, cwd) {
|
|
34147
|
-
const claudeSessionId =
|
|
34222
|
+
const claudeSessionId = randomUUID16();
|
|
34148
34223
|
return {
|
|
34149
34224
|
spawn: () => {
|
|
34150
34225
|
session.claudeSessionId = claudeSessionId;
|
|
@@ -35029,10 +35104,10 @@ function startReusedRunPty(session, assistArgs, itemId2, hold, clients, onStatus
|
|
|
35029
35104
|
}
|
|
35030
35105
|
|
|
35031
35106
|
// src/commands/sessions/daemon/createWatcherSession.ts
|
|
35032
|
-
import { randomUUID as
|
|
35107
|
+
import { randomUUID as randomUUID17 } from "crypto";
|
|
35033
35108
|
var WATCH_PROMPT = "/watch";
|
|
35034
35109
|
function createWatcherSession(id, cwd) {
|
|
35035
|
-
const claudeSessionId =
|
|
35110
|
+
const claudeSessionId = randomUUID17();
|
|
35036
35111
|
return {
|
|
35037
35112
|
...sessionBase(id, "running"),
|
|
35038
35113
|
name: `Session ${id}`,
|
|
@@ -36972,7 +37047,7 @@ function cleanupOwnedFiles() {
|
|
|
36972
37047
|
import * as net3 from "net";
|
|
36973
37048
|
|
|
36974
37049
|
// src/commands/sessions/daemon/findPortHolderPid.ts
|
|
36975
|
-
import { execFileSync as
|
|
37050
|
+
import { execFileSync as execFileSync17 } from "child_process";
|
|
36976
37051
|
var PROBE_TIMEOUT_MS = 3e3;
|
|
36977
37052
|
function findPortHolderPid(port) {
|
|
36978
37053
|
try {
|
|
@@ -36982,7 +37057,7 @@ function findPortHolderPid(port) {
|
|
|
36982
37057
|
}
|
|
36983
37058
|
}
|
|
36984
37059
|
function probe(command, args) {
|
|
36985
|
-
return
|
|
37060
|
+
return execFileSync17(command, args, {
|
|
36986
37061
|
encoding: "utf8",
|
|
36987
37062
|
timeout: PROBE_TIMEOUT_MS,
|
|
36988
37063
|
stdio: ["ignore", "pipe", "ignore"]
|
|
@@ -37189,7 +37264,7 @@ function summaryPathFor(jsonlPath2) {
|
|
|
37189
37264
|
}
|
|
37190
37265
|
|
|
37191
37266
|
// src/commands/sessions/summarise/summariseSession.ts
|
|
37192
|
-
import { execFileSync as
|
|
37267
|
+
import { execFileSync as execFileSync18 } from "child_process";
|
|
37193
37268
|
function summariseSession(jsonlPath2) {
|
|
37194
37269
|
const firstMessage = extractFirstUserMessage(jsonlPath2);
|
|
37195
37270
|
const backlogIds = scanSessionBacklogRefs(jsonlPath2);
|
|
@@ -37198,7 +37273,7 @@ function summariseSession(jsonlPath2) {
|
|
|
37198
37273
|
}
|
|
37199
37274
|
const prompt = buildPrompt6(firstMessage, backlogIds);
|
|
37200
37275
|
try {
|
|
37201
|
-
const output =
|
|
37276
|
+
const output = execFileSync18("claude", ["-p", "--model", "haiku", prompt], {
|
|
37202
37277
|
encoding: "utf8",
|
|
37203
37278
|
timeout: 3e4,
|
|
37204
37279
|
stdio: ["ignore", "pipe", "ignore"]
|