@staff0rd/assist 0.502.2 → 0.503.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 +377 -377
- package/dist/index.js +75 -51
- 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.503.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -13289,7 +13289,8 @@ function parsePreviewDecision(line, requestId) {
|
|
|
13289
13289
|
reason: msg.reason,
|
|
13290
13290
|
comments: Array.isArray(msg.comments) ? msg.comments : void 0,
|
|
13291
13291
|
screenshots: Array.isArray(msg.screenshots) ? msg.screenshots : void 0,
|
|
13292
|
-
reviewAfter: msg.reviewAfter === true
|
|
13292
|
+
reviewAfter: msg.reviewAfter === true,
|
|
13293
|
+
announceAfter: msg.announceAfter === true
|
|
13293
13294
|
}
|
|
13294
13295
|
};
|
|
13295
13296
|
} catch {
|
|
@@ -22090,19 +22091,6 @@ function appendScreenshots(body, screenshots) {
|
|
|
22090
22091
|
${screenshots.join("\n\n")}`;
|
|
22091
22092
|
}
|
|
22092
22093
|
|
|
22093
|
-
// src/commands/review/startChainedSession.ts
|
|
22094
|
-
async function startChainedSession(label2, start3) {
|
|
22095
|
-
if (process.env.ASSIST_SESSION !== "1") return;
|
|
22096
|
-
try {
|
|
22097
|
-
await start3();
|
|
22098
|
-
console.log(`Started ${label2}.`);
|
|
22099
|
-
} catch (error) {
|
|
22100
|
-
console.error(
|
|
22101
|
-
`Warning: could not start ${label2}: ${error instanceof Error ? error.message : String(error)}`
|
|
22102
|
-
);
|
|
22103
|
-
}
|
|
22104
|
-
}
|
|
22105
|
-
|
|
22106
22094
|
// src/commands/sessions/shared/requestSession.ts
|
|
22107
22095
|
function parseIncoming(line, type) {
|
|
22108
22096
|
try {
|
|
@@ -22143,29 +22131,80 @@ function requestSession(message3) {
|
|
|
22143
22131
|
});
|
|
22144
22132
|
}
|
|
22145
22133
|
|
|
22134
|
+
// src/commands/sessions/shared/requestClaudeSession.ts
|
|
22135
|
+
function requestClaudeSession(prompt, cwd) {
|
|
22136
|
+
return requestSession({ type: "create", prompt, cwd });
|
|
22137
|
+
}
|
|
22138
|
+
|
|
22139
|
+
// src/commands/review/startChainedSession.ts
|
|
22140
|
+
async function startChainedSession(label2, start3) {
|
|
22141
|
+
if (process.env.ASSIST_SESSION !== "1") return;
|
|
22142
|
+
try {
|
|
22143
|
+
await start3();
|
|
22144
|
+
console.log(`Started ${label2}.`);
|
|
22145
|
+
} catch (error) {
|
|
22146
|
+
console.error(
|
|
22147
|
+
`Warning: could not start ${label2}: ${error instanceof Error ? error.message : String(error)}`
|
|
22148
|
+
);
|
|
22149
|
+
}
|
|
22150
|
+
}
|
|
22151
|
+
|
|
22152
|
+
// src/commands/review/announcePr.ts
|
|
22153
|
+
function announcePr(prNumber) {
|
|
22154
|
+
return startChainedSession(
|
|
22155
|
+
`a Slack announce session for PR #${prNumber}`,
|
|
22156
|
+
() => requestClaudeSession(
|
|
22157
|
+
`/prs-slack ${prNumber} --no-confirm`,
|
|
22158
|
+
process.cwd()
|
|
22159
|
+
)
|
|
22160
|
+
);
|
|
22161
|
+
}
|
|
22162
|
+
|
|
22146
22163
|
// src/commands/sessions/shared/requestAssistSession.ts
|
|
22147
22164
|
function requestAssistSession(assistArgs, cwd) {
|
|
22148
22165
|
return requestSession({ type: "create-assist", assistArgs, cwd });
|
|
22149
22166
|
}
|
|
22150
22167
|
|
|
22151
22168
|
// src/commands/prs/chainReviewAndPost.ts
|
|
22152
|
-
function chainReviewAndPost(prNumber) {
|
|
22153
|
-
|
|
22154
|
-
|
|
22155
|
-
|
|
22156
|
-
|
|
22157
|
-
|
|
22158
|
-
|
|
22159
|
-
|
|
22160
|
-
|
|
22161
|
-
|
|
22162
|
-
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
|
|
22167
|
-
|
|
22168
|
-
|
|
22169
|
+
function chainReviewAndPost(prNumber, announce) {
|
|
22170
|
+
const args = [
|
|
22171
|
+
"review",
|
|
22172
|
+
"--no-prompt",
|
|
22173
|
+
"--submit",
|
|
22174
|
+
String(prNumber),
|
|
22175
|
+
"--address-comments"
|
|
22176
|
+
];
|
|
22177
|
+
if (announce) args.push("--announce");
|
|
22178
|
+
return startChainedSession(
|
|
22179
|
+
`a Review + Post session for PR #${prNumber}`,
|
|
22180
|
+
() => requestAssistSession(args, process.cwd())
|
|
22181
|
+
);
|
|
22182
|
+
}
|
|
22183
|
+
|
|
22184
|
+
// src/commands/prs/chainAfterRaise.ts
|
|
22185
|
+
async function chainAfterRaise(prNumber, choice) {
|
|
22186
|
+
const review2 = choice.reviewAfter === true;
|
|
22187
|
+
const announce = choice.announceAfter === true;
|
|
22188
|
+
if (!review2 && !announce) return;
|
|
22189
|
+
if (process.env.ASSIST_SESSION !== "1") return;
|
|
22190
|
+
const number = resolvePrNumber(prNumber);
|
|
22191
|
+
if (number === null) return;
|
|
22192
|
+
if (review2) await chainReviewAndPost(number, announce);
|
|
22193
|
+
else await announcePr(number);
|
|
22194
|
+
}
|
|
22195
|
+
function resolvePrNumber(prNumber) {
|
|
22196
|
+
if (prNumber !== null) return prNumber;
|
|
22197
|
+
try {
|
|
22198
|
+
const found = findCurrentPrNumber();
|
|
22199
|
+
if (found === null) warn("no pull request found for the current branch");
|
|
22200
|
+
return found;
|
|
22201
|
+
} catch (error) {
|
|
22202
|
+
warn(error instanceof Error ? error.message : String(error));
|
|
22203
|
+
return null;
|
|
22204
|
+
}
|
|
22205
|
+
}
|
|
22206
|
+
function warn(reason4) {
|
|
22207
|
+
console.error(`Warning: could not chain sessions after raising: ${reason4}`);
|
|
22169
22208
|
}
|
|
22170
22209
|
|
|
22171
22210
|
// src/commands/prs/previewAndPlace.ts
|
|
@@ -22179,7 +22218,7 @@ async function previewAndPlace(args) {
|
|
|
22179
22218
|
});
|
|
22180
22219
|
const body = appendScreenshots(args.body, decision.screenshots ?? []);
|
|
22181
22220
|
await placePr(args.prNumber, args.title, body, args.options);
|
|
22182
|
-
|
|
22221
|
+
await chainAfterRaise(args.prNumber, decision);
|
|
22183
22222
|
}
|
|
22184
22223
|
|
|
22185
22224
|
// src/commands/prs/raise.ts
|
|
@@ -24813,22 +24852,6 @@ function gatherContext() {
|
|
|
24813
24852
|
};
|
|
24814
24853
|
}
|
|
24815
24854
|
|
|
24816
|
-
// src/commands/sessions/shared/requestClaudeSession.ts
|
|
24817
|
-
function requestClaudeSession(prompt, cwd) {
|
|
24818
|
-
return requestSession({ type: "create", prompt, cwd });
|
|
24819
|
-
}
|
|
24820
|
-
|
|
24821
|
-
// src/commands/review/announcePr.ts
|
|
24822
|
-
function announcePr(prNumber) {
|
|
24823
|
-
return startChainedSession(
|
|
24824
|
-
`a Slack announce session for PR #${prNumber}`,
|
|
24825
|
-
() => requestClaudeSession(
|
|
24826
|
-
`/prs-slack ${prNumber} --no-confirm`,
|
|
24827
|
-
process.cwd()
|
|
24828
|
-
)
|
|
24829
|
-
);
|
|
24830
|
-
}
|
|
24831
|
-
|
|
24832
24855
|
// src/commands/review/postReviewToPr.ts
|
|
24833
24856
|
import { readFileSync as readFileSync41 } from "fs";
|
|
24834
24857
|
|
|
@@ -30013,7 +30036,7 @@ function decidePrPreview(sessions, waiters, notify2, d) {
|
|
|
30013
30036
|
const commentCount = Array.isArray(d.comments) ? d.comments.length : 0;
|
|
30014
30037
|
const screenshotCount = Array.isArray(d.screenshots) ? d.screenshots.length : 0;
|
|
30015
30038
|
daemonLog(
|
|
30016
|
-
`pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${commentCount} screenshots=${screenshotCount} reviewAfter=${d.reviewAfter === true}`
|
|
30039
|
+
`pr-decision received: id=${id} requestId=${requestId} decision=${d.decision} comments=${commentCount} screenshots=${screenshotCount} reviewAfter=${d.reviewAfter === true} announceAfter=${d.announceAfter === true}`
|
|
30017
30040
|
);
|
|
30018
30041
|
const waiter = waiters.get(id);
|
|
30019
30042
|
if (waiter)
|
|
@@ -30024,7 +30047,8 @@ function decidePrPreview(sessions, waiters, notify2, d) {
|
|
|
30024
30047
|
reason: d.reason,
|
|
30025
30048
|
comments: d.comments,
|
|
30026
30049
|
screenshots: d.screenshots,
|
|
30027
|
-
reviewAfter: d.reviewAfter
|
|
30050
|
+
reviewAfter: d.reviewAfter,
|
|
30051
|
+
announceAfter: d.announceAfter
|
|
30028
30052
|
});
|
|
30029
30053
|
waiters.delete(id);
|
|
30030
30054
|
session.pendingPrPreview = void 0;
|