@staff0rd/assist 0.1202.0 → 0.1203.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.
@@ -9,10 +9,10 @@ import {
9
9
  import {
10
10
  buildDoctorProbes,
11
11
  diagnoseLink
12
- } from "./chunk-T2BRM7NE.js";
12
+ } from "./chunk-UMXLONC3.js";
13
13
  import "./chunk-VABNWHSE.js";
14
14
  import "./chunk-DS2YJZZY.js";
15
- import "./chunk-5JUSTCY7.js";
15
+ import "./chunk-5M3LCHCA.js";
16
16
  import {
17
17
  loadLinkSpecs
18
18
  } from "./chunk-J2PPCMCR.js";
@@ -30,7 +30,7 @@ import {
30
30
  detectPlatform
31
31
  } from "./chunk-E36L7ASL.js";
32
32
  import "./chunk-GIHVMELY.js";
33
- import "./chunk-LFA465WL.js";
33
+ import "./chunk-HG5Q3WTY.js";
34
34
  import "./chunk-5QM5VR3J.js";
35
35
  import "./chunk-UFSOFNXQ.js";
36
36
  import "./chunk-FLDRXYEM.js";
@@ -56,6 +56,18 @@ import {
56
56
  import "./chunk-Q6PZLPK4.js";
57
57
  import "./chunk-JJKKIBF5.js";
58
58
 
59
+ // src/commands/github/issue/parseEditIssueArgs.ts
60
+ var USAGE = "Usage: assist github issue edit <number> [-R <owner>/<repo>] [--body <body>] [--title <title>] [--fetch] [--parent <issue>] [--screenshot '[Group/]Caption=path']";
61
+ function parseEditIssueArgs(numberArg, options) {
62
+ const number = Number.parseInt(numberArg, 10);
63
+ const badTitle = options.title !== void 0 && (!options.title.trim() || options.parent || options.fetch);
64
+ if (!Number.isInteger(number) || number <= 0 || badTitle) {
65
+ console.error(USAGE);
66
+ process.exit(1);
67
+ }
68
+ return number;
69
+ }
70
+
59
71
  // src/commands/github/issue/fetchIssue.ts
60
72
  import { execFileSync } from "child_process";
61
73
  function fetchIssue(number, repo) {
@@ -156,6 +168,7 @@ function prepareIssueEdit(number, repo, fresh, proposed) {
156
168
  target,
157
169
  updatedAt: issue.updatedAt,
158
170
  body,
171
+ fetchedBody: issue.body,
159
172
  bodyPath,
160
173
  save
161
174
  };
@@ -187,8 +200,11 @@ ${rest}` : ""}`;
187
200
  }
188
201
 
189
202
  // src/commands/github/issue/pushIssueBody.ts
190
- function pushIssueBody(number, repo, bodyPath, attachments = []) {
191
- const repoArgs = repo ? ["--repo", repo] : [];
203
+ function pushIssueBody(number, repo, bodyPath, attachments = [], title) {
204
+ const repoArgs = [
205
+ ...title === void 0 ? [] : ["--title", title],
206
+ ...repo ? ["--repo", repo] : []
207
+ ];
192
208
  if (attachments.length > 0) {
193
209
  const body = mergeIssueScreenshots(
194
210
  readFileSync2(bodyPath, "utf8"),
@@ -246,16 +262,38 @@ function fetchIssueToWorkingFile(number, repo) {
246
262
  );
247
263
  }
248
264
 
265
+ // src/commands/github/issue/pushIssueTitle.ts
266
+ import { execFileSync as execFileSync3 } from "child_process";
267
+ function pushIssueTitle(number, repo, title) {
268
+ const repoArgs = repo ? ["--repo", repo] : [];
269
+ try {
270
+ execFileSync3(
271
+ "gh",
272
+ ["issue", "edit", String(number), "--title", title, ...repoArgs],
273
+ { stdio: "inherit" }
274
+ );
275
+ } catch {
276
+ process.exit(1);
277
+ }
278
+ }
279
+
249
280
  // src/commands/github/issue/pushUnchangedIssue.ts
250
- function pushUnchangedIssue(number, repo, target, fetchedAt, bodyPath, attachments = []) {
281
+ function pushUnchangedIssue(number, repo, target, fetchedAt, bodyPath, attachments = [], rename) {
251
282
  if (fetchIssue(number, repo).updatedAt !== fetchedAt) {
252
283
  console.error(
253
284
  `${target} was updated on GitHub after it was fetched. Nothing was pushed; the markdown is at ${bodyPath}`
254
285
  );
255
286
  process.exit(1);
256
287
  }
257
- pushIssueBody(number, repo, bodyPath, attachments);
258
- console.log(`Issue body updated on ${target}`);
288
+ if (rename && !rename.bodyChanged && attachments.length === 0) {
289
+ pushIssueTitle(number, repo, rename.title);
290
+ console.log(`Issue renamed on ${target}`);
291
+ return;
292
+ }
293
+ pushIssueBody(number, repo, bodyPath, attachments, rename?.title);
294
+ console.log(
295
+ rename ? `Issue renamed and body updated on ${target}` : `Issue body updated on ${target}`
296
+ );
259
297
  }
260
298
 
261
299
  // src/commands/github/issue/reviewProposedIssueEdit.ts
@@ -287,23 +325,26 @@ async function reviewProposedIssueEdit(title, body, working, screenshots = []) {
287
325
  }
288
326
 
289
327
  // src/commands/github/issue/previewIssueEdit.ts
290
- async function previewIssueEdit(number, repo, fresh, body, screenshots = []) {
328
+ async function previewIssueEdit(number, repo, fresh, body, screenshots = [], title) {
329
+ if (title !== void 0) validateIssueBody(title, "");
291
330
  const proposed = body ? await readBodyArgument(body) : void 0;
292
331
  const issue = prepareIssueEdit(number, repo, fresh, proposed);
332
+ const heading = title === void 0 ? issue.title : `${issue.title} \u2192 ${title}`;
293
333
  const edited = await reviewProposedIssueEdit(
294
- `Edit ${issue.target}: ${issue.title}`,
334
+ `Edit ${issue.target}: ${heading}`,
295
335
  issue.body,
296
336
  { path: issue.bodyPath, save: issue.save },
297
337
  screenshots
298
338
  );
299
- validateIssueBody(issue.title, edited.body);
339
+ validateIssueBody(title ?? issue.title, edited.body);
300
340
  pushUnchangedIssue(
301
341
  number,
302
342
  repo,
303
343
  issue.target,
304
344
  issue.updatedAt,
305
345
  issue.bodyPath,
306
- edited.screenshots
346
+ edited.screenshots,
347
+ title === void 0 ? void 0 : { title, bodyChanged: edited.body !== issue.fetchedBody }
307
348
  );
308
349
  }
309
350
 
@@ -326,25 +367,20 @@ function setIssueParent(number, repo, parentArg) {
326
367
  }
327
368
 
328
369
  // src/commands/github/issue/viewIssue.ts
329
- import { execFileSync as execFileSync3 } from "child_process";
370
+ import { execFileSync as execFileSync4 } from "child_process";
330
371
  function viewIssue(number, repo) {
331
372
  const args = ["issue", "view", String(number)];
332
373
  if (repo) args.push("--repo", repo);
333
374
  try {
334
- execFileSync3("gh", args, { stdio: "inherit" });
375
+ execFileSync4("gh", args, { stdio: "inherit" });
335
376
  } catch {
336
377
  process.exit(1);
337
378
  }
338
379
  }
339
380
 
340
381
  // src/commands/github/issue/editIssue.ts
341
- var USAGE = "Usage: assist github issue edit <number> [-R <owner>/<repo>] [--body <body>] [--fetch] [--parent <issue>] [--screenshot '[Group/]Caption=path']";
342
382
  async function editIssue(numberArg, options) {
343
- const number = Number.parseInt(numberArg, 10);
344
- if (!Number.isInteger(number) || number <= 0) {
345
- console.error(USAGE);
346
- process.exit(1);
347
- }
383
+ const number = parseEditIssueArgs(numberArg, options);
348
384
  const screenshots = parseScreenshotSpecs(options.screenshot);
349
385
  if (options.parent) {
350
386
  setIssueParent(number, options.repo, options.parent);
@@ -372,7 +408,8 @@ async function editIssue(numberArg, options) {
372
408
  options.repo,
373
409
  options.fresh,
374
410
  options.body,
375
- screenshots
411
+ screenshots,
412
+ options.title
376
413
  );
377
414
  }
378
415
  export {
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-TJGF3Z72.js";
18
18
  import {
19
19
  package_default
20
- } from "./chunk-LFA465WL.js";
20
+ } from "./chunk-HG5Q3WTY.js";
21
21
  import {
22
22
  adviceConfigHelp,
23
23
  askQuestionConfigHelp,
@@ -92,7 +92,7 @@ import { Command } from "commander";
92
92
  // src/commands/registerRootAction.ts
93
93
  function registerRootAction(program) {
94
94
  program.option("--no-open", "Do not open a browser on startup").action(
95
- async (options) => (await import("./web-UVCA72Y4.js")).web({
95
+ async (options) => (await import("./web-UE5IQYSZ.js")).web({
96
96
  port: "3100",
97
97
  open: options.open
98
98
  })
@@ -645,7 +645,7 @@ function registerShowCommands(cmd) {
645
645
 
646
646
  // src/commands/registerBacklog.ts
647
647
  function registerWebCommand(cmd) {
648
- cmd.command("web").description("Open the backlog tab in the web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(lazyAction(() => import("./web-4RWILJGP.js"), "web"));
648
+ cmd.command("web").description("Open the backlog tab in the web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(lazyAction(() => import("./web-L47WE5PN.js"), "web"));
649
649
  }
650
650
  var registrars = [
651
651
  registerItemCommands,
@@ -675,7 +675,7 @@ function registerBacklog(program) {
675
675
  const { setBacklogDir } = await import("./getBacklogDir-FJLWXTYN.js");
676
676
  setBacklogDir(thisCommand.opts().dir);
677
677
  }).action(
678
- async (options) => (await import("./web-4RWILJGP.js")).web({ port: "3100", open: options.open })
678
+ async (options) => (await import("./web-L47WE5PN.js")).web({ port: "3100", open: options.open })
679
679
  );
680
680
  for (const register of registrars) {
681
681
  register(cmd);
@@ -988,7 +988,7 @@ function registerExtension(program) {
988
988
  ).action(async (options) => {
989
989
  const { extension } = await import("./extension-YYRD5EM6.js");
990
990
  const { printExtensionUrl } = await import("./printExtensionUrl-IW2WTSNS.js");
991
- const { signExtension } = await import("./signExtension-PM2HRF6H.js");
991
+ const { signExtension } = await import("./signExtension-U2XVDHKS.js");
992
992
  if (options.url) return printExtensionUrl();
993
993
  return options.sign ? signExtension() : extension();
994
994
  });
@@ -1287,6 +1287,9 @@ function registerEditIssue(issueCommand) {
1287
1287
  ).option(
1288
1288
  "--body <body>",
1289
1289
  "Proposed replacement body to preview instead of the current one (- reads it from stdin)"
1290
+ ).option(
1291
+ "--title <title>",
1292
+ "Rename the issue, previewed with the body before it is pushed"
1290
1293
  ).option(
1291
1294
  "--fresh",
1292
1295
  "Discard any working file for the issue and re-fetch its body from GitHub"
@@ -1312,7 +1315,7 @@ Rejecting writes the pane's markdown to a working file and names it: revise that
1312
1315
  Only the body is touched \u2014 the title, labels, assignees and state are left alone.
1313
1316
  --parent sets the issue's parent instead of editing the body: nothing is previewed and no web session is needed. A bare number is read against --repo, or the current repo; a parent in another repository is allowed.
1314
1317
  When you already have an image or video to add (e.g. a file the user pointed at), pass it with --screenshot '[Group/]Caption=path' (once per file) rather than asking the reviewer to drop it in; a missing file or an extension gh cannot attach fails before anything is previewed. In a web session it arrives pre-staged beside the editable body, and the reviewer may also drop or paste more screenshots or video into the pane; on approval gh attaches them all (gh ${minGhAttachVersion}+) under the body's ## Screenshots section, after any images already there. Outside a web session the --screenshot files are attached directly to the current body (or --body). Never author a ## Screenshots section yourself.`
1315
- ).action(lazyAction(() => import("./editIssue-CJP5LATW.js"), "editIssue"));
1318
+ ).action(lazyAction(() => import("./editIssue-EQUY7FPR.js"), "editIssue"));
1316
1319
  internalCommand(editCommand, "/github");
1317
1320
  }
1318
1321
 
@@ -2689,7 +2692,7 @@ function registerDaemon(program) {
2689
2692
  const cmd = program.command("daemon").description("Long-lived daemon that owns web session PTYs");
2690
2693
  cmd.command("run").description(
2691
2694
  "Run the sessions daemon in the foreground (auto-spawned by assist sessions)"
2692
- ).action(lazyAction(() => import("./runDaemon-QNKKQSV4.js"), "runDaemon"));
2695
+ ).action(lazyAction(() => import("./runDaemon-74TI4YPY.js"), "runDaemon"));
2693
2696
  cmd.command("status").description(
2694
2697
  "Show sessions daemon status, live sessions, and any stray daemon processes"
2695
2698
  ).action(lazyAction(() => import("./daemonStatus-EAZHBC6O.js"), "daemonStatus"));
@@ -2713,7 +2716,7 @@ function registerDiagnoseCommands(nodes, calledBy5) {
2713
2716
  nodes.command("doctor [name]").description(
2714
2717
  "Probe each hop of every link (or one) in order and stop at the first failure with a remediation"
2715
2718
  ).option("--json", "Output as JSON").action(
2716
- async (name, _options, command) => (await import("./doctorNodes-Z6DCIXZJ.js")).doctorNodes(
2719
+ async (name, _options, command) => (await import("./doctorNodes-YEXSN73A.js")).doctorNodes(
2717
2720
  name,
2718
2721
  command.optsWithGlobals()
2719
2722
  )
@@ -2743,14 +2746,14 @@ function registerPeerActionCommands(nodes, calledBy5) {
2743
2746
  internalCommand(
2744
2747
  nodes.command("restart <name>").description(
2745
2748
  "Restart a linked node's daemon and/or web server, wait for its link to reconnect and print its version"
2746
- ).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-TPOSDMNH.js"), "restartNode")),
2749
+ ).option("--target <target>", "daemon, webserver or both", "both").action(lazyAction(() => import("./restartNode-PPVKRG3M.js"), "restartNode")),
2747
2750
  calledBy5
2748
2751
  );
2749
2752
  internalCommand(
2750
2753
  nodes.command("update <name>").description(
2751
2754
  "Run assist update on a linked node, restart it, wait for its link to reconnect and print its version"
2752
2755
  ).action(
2753
- async (name) => (await import("./updateNode-B2B4MX24.js")).updateNode(name)
2756
+ async (name) => (await import("./updateNode-RYHJFDJ3.js")).updateNode(name)
2754
2757
  ),
2755
2758
  calledBy5
2756
2759
  );
@@ -2813,7 +2816,7 @@ function registerSetStatusCommand(cmd) {
2813
2816
  // src/commands/sessions/registerSessionsWeb.ts
2814
2817
  function registerSessionsWeb(cmd) {
2815
2818
  const webCmd = cmd.command("web").description("Start the sessions web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(
2816
- async (options, command) => (await import("./web-UVCA72Y4.js")).web({
2819
+ async (options, command) => (await import("./web-UE5IQYSZ.js")).web({
2817
2820
  ...options,
2818
2821
  open: command.optsWithGlobals().open
2819
2822
  })
@@ -2828,7 +2831,7 @@ function registerSessionsWeb(cmd) {
2828
2831
  // src/commands/sessions/registerSessions.ts
2829
2832
  function registerSessions(program) {
2830
2833
  const cmd = program.command("sessions").description("Web dashboard for coding agent sessions").option("--no-open", "Do not open a browser on startup").action(
2831
- async (_options, command) => (await import("./web-UVCA72Y4.js")).web({
2834
+ async (_options, command) => (await import("./web-UE5IQYSZ.js")).web({
2832
2835
  port: "3100",
2833
2836
  open: command.optsWithGlobals().open
2834
2837
  })
@@ -2,20 +2,20 @@ import {
2
2
  linkStatus,
3
3
  postToPeer,
4
4
  startPeerAction
5
- } from "./chunk-IBG2UFAA.js";
6
- import "./chunk-S4FGQFSO.js";
7
- import "./chunk-T2BRM7NE.js";
5
+ } from "./chunk-Z3YTZ7KP.js";
6
+ import "./chunk-MPMCXTPX.js";
7
+ import "./chunk-UMXLONC3.js";
8
8
  import "./chunk-VABNWHSE.js";
9
9
  import "./chunk-DS2YJZZY.js";
10
10
  import "./chunk-4HKB2TAG.js";
11
- import "./chunk-5JUSTCY7.js";
11
+ import "./chunk-5M3LCHCA.js";
12
12
  import "./chunk-J2PPCMCR.js";
13
13
  import "./chunk-5CNDLMYO.js";
14
14
  import "./chunk-B7VOTF5Q.js";
15
15
  import "./chunk-E36L7ASL.js";
16
16
  import "./chunk-5H7EHZ3J.js";
17
17
  import "./chunk-GIHVMELY.js";
18
- import "./chunk-LFA465WL.js";
18
+ import "./chunk-HG5Q3WTY.js";
19
19
  import "./chunk-UFSOFNXQ.js";
20
20
  import "./chunk-FLDRXYEM.js";
21
21
  import "./chunk-GRXFWFGP.js";
@@ -133,7 +133,7 @@ import {
133
133
  isHello,
134
134
  linkVersionCheck,
135
135
  negotiateProtocol
136
- } from "./chunk-5JUSTCY7.js";
136
+ } from "./chunk-5M3LCHCA.js";
137
137
  import {
138
138
  loadLinkSpecs
139
139
  } from "./chunk-J2PPCMCR.js";
@@ -272,7 +272,7 @@ import {
272
272
  import "./chunk-APZ6ZTDA.js";
273
273
  import "./chunk-ZRIBI33P.js";
274
274
  import "./chunk-D7UZLH36.js";
275
- import "./chunk-LFA465WL.js";
275
+ import "./chunk-HG5Q3WTY.js";
276
276
  import "./chunk-EW2ZM2PC.js";
277
277
  import "./chunk-MYH4MQX2.js";
278
278
  import {
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-W7TRZLEM.js";
10
10
  import {
11
11
  package_default
12
- } from "./chunk-LFA465WL.js";
12
+ } from "./chunk-HG5Q3WTY.js";
13
13
 
14
14
  // src/commands/extension/signExtension.ts
15
15
  import { rm as rm2 } from "fs/promises";
@@ -2,13 +2,13 @@ import {
2
2
  linkStatus,
3
3
  postToPeer,
4
4
  startPeerAction
5
- } from "./chunk-IBG2UFAA.js";
6
- import "./chunk-S4FGQFSO.js";
7
- import "./chunk-T2BRM7NE.js";
5
+ } from "./chunk-Z3YTZ7KP.js";
6
+ import "./chunk-MPMCXTPX.js";
7
+ import "./chunk-UMXLONC3.js";
8
8
  import "./chunk-VABNWHSE.js";
9
9
  import "./chunk-DS2YJZZY.js";
10
10
  import "./chunk-4HKB2TAG.js";
11
- import "./chunk-5JUSTCY7.js";
11
+ import "./chunk-5M3LCHCA.js";
12
12
  import "./chunk-J2PPCMCR.js";
13
13
  import "./chunk-5CNDLMYO.js";
14
14
  import "./chunk-B7VOTF5Q.js";
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-A7ONLVZD.js";
20
20
  import "./chunk-GIHVMELY.js";
21
21
  import "./chunk-2EW62DM5.js";
22
- import "./chunk-LFA465WL.js";
22
+ import "./chunk-HG5Q3WTY.js";
23
23
  import "./chunk-UFSOFNXQ.js";
24
24
  import "./chunk-FLDRXYEM.js";
25
25
  import "./chunk-GRXFWFGP.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  web
3
- } from "./chunk-GNCIBOPQ.js";
3
+ } from "./chunk-VUZMT2LI.js";
4
4
  import "./chunk-SURCYYQ6.js";
5
5
  import "./chunk-JNCFHWBK.js";
6
6
  import "./chunk-JM57BCD6.js";
7
- import "./chunk-S4FGQFSO.js";
8
- import "./chunk-T2BRM7NE.js";
7
+ import "./chunk-MPMCXTPX.js";
8
+ import "./chunk-UMXLONC3.js";
9
9
  import "./chunk-VABNWHSE.js";
10
10
  import "./chunk-DS2YJZZY.js";
11
11
  import "./chunk-2RUGZQUD.js";
12
12
  import "./chunk-5QXAQCAJ.js";
13
13
  import "./chunk-4HKB2TAG.js";
14
- import "./chunk-5JUSTCY7.js";
14
+ import "./chunk-5M3LCHCA.js";
15
15
  import "./chunk-J2PPCMCR.js";
16
16
  import "./chunk-5CNDLMYO.js";
17
17
  import "./chunk-B7VOTF5Q.js";
@@ -139,7 +139,7 @@ import "./chunk-RW6YKTIM.js";
139
139
  import "./chunk-APZ6ZTDA.js";
140
140
  import "./chunk-ZRIBI33P.js";
141
141
  import "./chunk-D7UZLH36.js";
142
- import "./chunk-LFA465WL.js";
142
+ import "./chunk-HG5Q3WTY.js";
143
143
  import "./chunk-YUV5QBHU.js";
144
144
  import "./chunk-YVL3NXEB.js";
145
145
  import "./chunk-UEWARAPX.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  web
3
- } from "./chunk-GNCIBOPQ.js";
3
+ } from "./chunk-VUZMT2LI.js";
4
4
  import "./chunk-SURCYYQ6.js";
5
5
  import "./chunk-JNCFHWBK.js";
6
6
  import "./chunk-JM57BCD6.js";
7
- import "./chunk-S4FGQFSO.js";
8
- import "./chunk-T2BRM7NE.js";
7
+ import "./chunk-MPMCXTPX.js";
8
+ import "./chunk-UMXLONC3.js";
9
9
  import "./chunk-VABNWHSE.js";
10
10
  import "./chunk-DS2YJZZY.js";
11
11
  import "./chunk-2RUGZQUD.js";
12
12
  import "./chunk-5QXAQCAJ.js";
13
13
  import "./chunk-4HKB2TAG.js";
14
- import "./chunk-5JUSTCY7.js";
14
+ import "./chunk-5M3LCHCA.js";
15
15
  import "./chunk-J2PPCMCR.js";
16
16
  import "./chunk-5CNDLMYO.js";
17
17
  import "./chunk-B7VOTF5Q.js";
@@ -139,7 +139,7 @@ import "./chunk-RW6YKTIM.js";
139
139
  import "./chunk-APZ6ZTDA.js";
140
140
  import "./chunk-ZRIBI33P.js";
141
141
  import "./chunk-D7UZLH36.js";
142
- import "./chunk-LFA465WL.js";
142
+ import "./chunk-HG5Q3WTY.js";
143
143
  import "./chunk-YUV5QBHU.js";
144
144
  import "./chunk-YVL3NXEB.js";
145
145
  import "./chunk-UEWARAPX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.1202.0",
3
+ "version": "0.1203.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {