@staff0rd/assist 0.729.0 → 0.730.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 +4 -3
- package/allowed.cli-reads +1 -0
- package/claude/commands/show.md +28 -0
- package/dist/allowed.cli-reads +1 -0
- package/dist/commands/sessions/web/bundle.js +418 -418
- package/dist/index.js +66 -31
- 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.730.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -858,8 +858,7 @@ var assistConfigShape = {
|
|
|
858
858
|
}).optional(),
|
|
859
859
|
next: z3.strictObject({
|
|
860
860
|
peers: z3.array(z3.string()).optional(),
|
|
861
|
-
|
|
862
|
-
issueRepos: z3.array(z3.string()).optional()
|
|
861
|
+
repos: z3.array(z3.string()).optional()
|
|
863
862
|
}).optional(),
|
|
864
863
|
deny: z3.array(
|
|
865
864
|
z3.strictObject({
|
|
@@ -12566,14 +12565,9 @@ var nextConfigHelp = [
|
|
|
12566
12565
|
note: "GitHub logins whose open, non-draft PRs the web /next view lists for review alongside PRs requesting your review; PRs you approved with no newer commits are hidden"
|
|
12567
12566
|
},
|
|
12568
12567
|
{
|
|
12569
|
-
key: "next.
|
|
12570
|
-
setter: "assist config set next.
|
|
12571
|
-
note: "owner/name GitHub repos the web /next view reads peer PRs from (default: the selected repo)"
|
|
12572
|
-
},
|
|
12573
|
-
{
|
|
12574
|
-
key: "next.issueRepos",
|
|
12575
|
-
setter: "assist config set next.issueRepos owner/api,owner/web -g --repo",
|
|
12576
|
-
note: "owner/name GitHub repos the web /next view reads issues assigned to you from (default: the selected repo)"
|
|
12568
|
+
key: "next.repos",
|
|
12569
|
+
setter: "assist config set next.repos owner/api,owner/web -g --repo",
|
|
12570
|
+
note: "owner/name GitHub repos the web /next view reads peer PRs and issues assigned to you from (default: the selected repo)"
|
|
12577
12571
|
}
|
|
12578
12572
|
];
|
|
12579
12573
|
|
|
@@ -13869,8 +13863,7 @@ function nextScope(cwd) {
|
|
|
13869
13863
|
return {
|
|
13870
13864
|
selfRepo: githubRepo(cwd),
|
|
13871
13865
|
peers: next3?.peers ?? [],
|
|
13872
|
-
|
|
13873
|
-
issueRepos: next3?.issueRepos ?? null
|
|
13866
|
+
repos: next3?.repos ?? null
|
|
13874
13867
|
};
|
|
13875
13868
|
}
|
|
13876
13869
|
|
|
@@ -13886,11 +13879,11 @@ function errorMessage(error) {
|
|
|
13886
13879
|
if (typeof stderr === "string" && stderr.trim()) return stderr.trim();
|
|
13887
13880
|
return error instanceof Error ? error.message : String(error);
|
|
13888
13881
|
}
|
|
13889
|
-
async function sectionAcross(repos2, load3, compare
|
|
13882
|
+
async function sectionAcross(repos2, load3, compare) {
|
|
13890
13883
|
if (repos2.length === 0)
|
|
13891
13884
|
return {
|
|
13892
13885
|
items: [],
|
|
13893
|
-
error:
|
|
13886
|
+
error: "No GitHub repo to read: set next.repos or select a repo with a GitHub origin."
|
|
13894
13887
|
};
|
|
13895
13888
|
const results = await Promise.allSettled(repos2.map((repo) => load3(repo)));
|
|
13896
13889
|
const items2 = [];
|
|
@@ -13910,18 +13903,17 @@ async function nextItems(req, res) {
|
|
|
13910
13903
|
const cwd = getCwdParam(req, res);
|
|
13911
13904
|
if (!cwd) return;
|
|
13912
13905
|
const scope = nextScope(cwd);
|
|
13906
|
+
const repos2 = scopeRepos(scope.repos, scope.selfRepo);
|
|
13913
13907
|
const [peerPrs, assignedIssues] = await Promise.all([
|
|
13914
13908
|
sectionAcross(
|
|
13915
|
-
|
|
13909
|
+
repos2,
|
|
13916
13910
|
(repo) => fetchPeerPrs(cwd, repo, scope.peers),
|
|
13917
|
-
(a, b) => a.requestedAt.localeCompare(b.requestedAt)
|
|
13918
|
-
"next.prRepos"
|
|
13911
|
+
(a, b) => a.requestedAt.localeCompare(b.requestedAt)
|
|
13919
13912
|
),
|
|
13920
13913
|
sectionAcross(
|
|
13921
|
-
|
|
13914
|
+
repos2,
|
|
13922
13915
|
(repo) => fetchAssignedIssues(cwd, repo),
|
|
13923
|
-
(a, b) => a.createdAt.localeCompare(b.createdAt)
|
|
13924
|
-
"next.issueRepos"
|
|
13916
|
+
(a, b) => a.createdAt.localeCompare(b.createdAt)
|
|
13925
13917
|
)
|
|
13926
13918
|
]);
|
|
13927
13919
|
const body = { scope, peerPrs, assignedIssues };
|
|
@@ -36241,6 +36233,46 @@ function registerSeq(program2) {
|
|
|
36241
36233
|
configHelp(cmd, seqConfigHelp);
|
|
36242
36234
|
}
|
|
36243
36235
|
|
|
36236
|
+
// src/commands/show.ts
|
|
36237
|
+
import { randomUUID as randomUUID19 } from "crypto";
|
|
36238
|
+
|
|
36239
|
+
// src/commands/sessions/shared/sendShowPreview.ts
|
|
36240
|
+
async function sendShowPreview(request) {
|
|
36241
|
+
const socket = await connectToDaemon();
|
|
36242
|
+
await new Promise((resolve26, reject) => {
|
|
36243
|
+
socket.on("error", reject);
|
|
36244
|
+
socket.on("close", () => resolve26());
|
|
36245
|
+
socket.end(
|
|
36246
|
+
`${JSON.stringify({ type: "pr-preview", kind: "show", prNumber: null, ...request })}
|
|
36247
|
+
`
|
|
36248
|
+
);
|
|
36249
|
+
});
|
|
36250
|
+
}
|
|
36251
|
+
|
|
36252
|
+
// src/commands/show.ts
|
|
36253
|
+
async function show2(options2) {
|
|
36254
|
+
const body = await readBodyArgument(options2.body);
|
|
36255
|
+
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
36256
|
+
if (process.env.ASSIST_SESSION !== "1" || !sessionId) {
|
|
36257
|
+
console.log(body);
|
|
36258
|
+
return;
|
|
36259
|
+
}
|
|
36260
|
+
await sendShowPreview({
|
|
36261
|
+
sessionId,
|
|
36262
|
+
requestId: randomUUID19(),
|
|
36263
|
+
title: options2.title ?? "Show",
|
|
36264
|
+
body
|
|
36265
|
+
});
|
|
36266
|
+
console.log("Opened in the assist web UI preview pane.");
|
|
36267
|
+
}
|
|
36268
|
+
|
|
36269
|
+
// src/commands/registerShow.ts
|
|
36270
|
+
function registerShow(program2) {
|
|
36271
|
+
program2.command("show").description(
|
|
36272
|
+
"Open markdown in the session's web preview pane so long links, paths and snippets can be clicked and copied unbroken; prints it outside a web session"
|
|
36273
|
+
).option("--title <title>", "Pane title").requiredOption("--body <markdown|->", "Markdown to show, or - for stdin").action(show2);
|
|
36274
|
+
}
|
|
36275
|
+
|
|
36244
36276
|
// src/commands/registerSignal.ts
|
|
36245
36277
|
function registerSignal(program2) {
|
|
36246
36278
|
const signalCommand = program2.command("signal").description("Write an assist signal file");
|
|
@@ -36298,7 +36330,7 @@ function readSlackParts(files) {
|
|
|
36298
36330
|
}
|
|
36299
36331
|
|
|
36300
36332
|
// src/commands/slack/reviewProposedSlackMessage.ts
|
|
36301
|
-
import { randomUUID as
|
|
36333
|
+
import { randomUUID as randomUUID20 } from "crypto";
|
|
36302
36334
|
async function reviewProposedSlackMessage(target, body, workingPath) {
|
|
36303
36335
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
36304
36336
|
if (process.env.ASSIST_SESSION !== "1" || !sessionId) return;
|
|
@@ -36308,7 +36340,7 @@ async function reviewProposedSlackMessage(target, body, workingPath) {
|
|
|
36308
36340
|
part ? `Slack message ${part.index} of ${part.total}` : "Slack message preview",
|
|
36309
36341
|
{
|
|
36310
36342
|
sessionId,
|
|
36311
|
-
requestId:
|
|
36343
|
+
requestId: randomUUID20(),
|
|
36312
36344
|
title: part ? `${destination} (${part.index}/${part.total})` : destination,
|
|
36313
36345
|
body,
|
|
36314
36346
|
prNumber: null,
|
|
@@ -40509,7 +40541,7 @@ var ClientHub = class extends Set {
|
|
|
40509
40541
|
};
|
|
40510
40542
|
|
|
40511
40543
|
// src/commands/sessions/daemon/createSession.ts
|
|
40512
|
-
import { randomUUID as
|
|
40544
|
+
import { randomUUID as randomUUID21 } from "crypto";
|
|
40513
40545
|
|
|
40514
40546
|
// src/commands/sessions/daemon/sessionBase.ts
|
|
40515
40547
|
function sessionBase(id, status3) {
|
|
@@ -40715,7 +40747,7 @@ function spawnRun(opts) {
|
|
|
40715
40747
|
function createSession(id, { prompt, cwd, design, auto, harness, holdPty } = {}) {
|
|
40716
40748
|
if (harness && harness !== "claude")
|
|
40717
40749
|
return createHarnessSession(id, harness, prompt, cwd, holdPty);
|
|
40718
|
-
const claudeSessionId =
|
|
40750
|
+
const claudeSessionId = randomUUID21();
|
|
40719
40751
|
return {
|
|
40720
40752
|
...sessionBase(id, prompt ? "running" : "waiting"),
|
|
40721
40753
|
name: `Session ${id}`,
|
|
@@ -41358,7 +41390,8 @@ var PREVIEW_KINDS = [
|
|
|
41358
41390
|
"github-issue-edit",
|
|
41359
41391
|
"miro-board",
|
|
41360
41392
|
"slack-post",
|
|
41361
|
-
"high-level-review"
|
|
41393
|
+
"high-level-review",
|
|
41394
|
+
"show"
|
|
41362
41395
|
];
|
|
41363
41396
|
function isPreviewKind(value) {
|
|
41364
41397
|
return PREVIEW_KINDS.includes(value);
|
|
@@ -41384,6 +41417,7 @@ function previewTargetLabel(kind, itemType, prNumber, draft) {
|
|
|
41384
41417
|
if (kind === "miro-board") return "miro anchors";
|
|
41385
41418
|
if (kind === "slack-post") return "slack post";
|
|
41386
41419
|
if (kind === "high-level-review") return "high-level review";
|
|
41420
|
+
if (kind === "show") return "show";
|
|
41387
41421
|
if (kind === "backlog-item") return `backlog ${itemType}`;
|
|
41388
41422
|
if (prNumber !== null) return `edit #${prNumber}`;
|
|
41389
41423
|
return draft ? "create draft" : "create";
|
|
@@ -41415,7 +41449,7 @@ function setPrPreview(sessions, waiters, notify2, client, d) {
|
|
|
41415
41449
|
draft: kind === "pr" && prNumber === null ? draft : void 0,
|
|
41416
41450
|
metadata: parsePreviewMetadata(d.metadata)
|
|
41417
41451
|
};
|
|
41418
|
-
waiters.set(id, client);
|
|
41452
|
+
if (kind !== "show") waiters.set(id, client);
|
|
41419
41453
|
const target = previewTargetLabel(kind, itemType, prNumber, draft);
|
|
41420
41454
|
daemonLog(
|
|
41421
41455
|
`pr-preview set: id=${id} requestId=${d.requestId} kind=${kind} target=${target}`
|
|
@@ -42895,7 +42929,7 @@ function codexRespawnPlan(session) {
|
|
|
42895
42929
|
}
|
|
42896
42930
|
|
|
42897
42931
|
// src/commands/sessions/daemon/interactiveRespawnPlan.ts
|
|
42898
|
-
import { randomUUID as
|
|
42932
|
+
import { randomUUID as randomUUID22 } from "crypto";
|
|
42899
42933
|
function interactiveRespawnPlan(session, resumes) {
|
|
42900
42934
|
const { claudeSessionId, cwd, initialPrompt, design, auto } = session;
|
|
42901
42935
|
if (!resumes) return null;
|
|
@@ -42915,7 +42949,7 @@ function interactiveRespawnPlan(session, resumes) {
|
|
|
42915
42949
|
return null;
|
|
42916
42950
|
}
|
|
42917
42951
|
function freshClaudePlan(session, prompt, cwd) {
|
|
42918
|
-
const claudeSessionId =
|
|
42952
|
+
const claudeSessionId = randomUUID22();
|
|
42919
42953
|
return {
|
|
42920
42954
|
spawn: () => {
|
|
42921
42955
|
session.claudeSessionId = claudeSessionId;
|
|
@@ -43925,10 +43959,10 @@ function startReusedRunPty(session, assistArgs, itemId2, hold, clients, onStatus
|
|
|
43925
43959
|
}
|
|
43926
43960
|
|
|
43927
43961
|
// src/commands/sessions/daemon/createWatcherSession.ts
|
|
43928
|
-
import { randomUUID as
|
|
43962
|
+
import { randomUUID as randomUUID23 } from "crypto";
|
|
43929
43963
|
var WATCH_PROMPT = "/watch";
|
|
43930
43964
|
function createWatcherSession(id, cwd) {
|
|
43931
|
-
const claudeSessionId =
|
|
43965
|
+
const claudeSessionId = randomUUID23();
|
|
43932
43966
|
return {
|
|
43933
43967
|
...sessionBase(id, "running"),
|
|
43934
43968
|
name: `Session ${id}`,
|
|
@@ -47278,6 +47312,7 @@ registerCriteriaExtension(program);
|
|
|
47278
47312
|
registerLitellm(program);
|
|
47279
47313
|
registerRavendb(program);
|
|
47280
47314
|
registerSeq(program);
|
|
47315
|
+
registerShow(program);
|
|
47281
47316
|
registerSlack(program);
|
|
47282
47317
|
registerSql(program);
|
|
47283
47318
|
registerTranscript(program);
|