@staff0rd/assist 0.845.0 → 0.846.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/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.845.0",
9
+ version: "0.846.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -13490,7 +13490,7 @@ var prsConfigHelp = [
13490
13490
  {
13491
13491
  key: "prs.slack",
13492
13492
  setter: 'assist config set prs.slack "#pull-requests"',
13493
- note: "Slack channel PRs are announced to (used by /prs-slack)"
13493
+ note: "Slack channel PRs are announced to, falling back to slack.channel (read by 'assist prs slack-channel', used by /prs-slack)"
13494
13494
  },
13495
13495
  {
13496
13496
  key: "prs.required",
@@ -30990,6 +30990,19 @@ function registerPrsRaise(prsCommand) {
30990
30990
  configHelp(raiseCommand, prsRaiseConfigHelp);
30991
30991
  }
30992
30992
 
30993
+ // src/commands/prs/prsSlackChannel.ts
30994
+ function prsSlackChannel() {
30995
+ const config = loadConfig();
30996
+ const channel = config.prs?.slack?.trim() || config.slack?.channel?.trim() || "";
30997
+ if (!channel) {
30998
+ console.error(
30999
+ 'No PR channel configured. Set prs.slack or slack.channel, e.g.: assist config set prs.slack "#pull-requests"'
31000
+ );
31001
+ process.exit(1);
31002
+ }
31003
+ console.log(channel);
31004
+ }
31005
+
30993
31006
  // src/commands/prs/status/fetchReviewThreads.ts
30994
31007
  import { execSync as execSync47 } from "child_process";
30995
31008
  var THREAD_QUERY2 = `query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { isResolved } } } } }`;
@@ -31292,6 +31305,9 @@ function registerPrsStatus(prsCommand) {
31292
31305
  prsCommand.command("status <repo...>").description(
31293
31306
  "Report every open pull request in each owner/repo, grouped by repo"
31294
31307
  ).option("--json", "Output as JSON").action(prsStatus);
31308
+ prsCommand.command("slack-channel").description(
31309
+ "Print the Slack channel PRs are announced to (prs.slack, else slack.channel)"
31310
+ ).action(prsSlackChannel);
31295
31311
  }
31296
31312
 
31297
31313
  // src/commands/readTime/readTime.ts
@@ -36188,6 +36204,23 @@ function highLevelPreviewPayload(subject) {
36188
36204
  };
36189
36205
  }
36190
36206
 
36207
+ // src/commands/review/highLevel/postHighLevelApproval.ts
36208
+ import { execFileSync as execFileSync22 } from "child_process";
36209
+ function postHighLevelApproval(repo, prNumber) {
36210
+ try {
36211
+ execFileSync22(
36212
+ "gh",
36213
+ ["pr", "review", String(prNumber), "--repo", repo, "--approve"],
36214
+ { stdio: ["ignore", "ignore", "pipe"], encoding: "utf8" }
36215
+ );
36216
+ } catch (error) {
36217
+ const stderr = error.stderr;
36218
+ throw new Error(
36219
+ typeof stderr === "string" && stderr.trim() ? stderr.trim() : `Could not approve ${repo}#${prNumber}`
36220
+ );
36221
+ }
36222
+ }
36223
+
36191
36224
  // src/commands/review/highLevel/saveHighLevelReview.ts
36192
36225
  import { mkdirSync as mkdirSync23, writeFileSync as writeFileSync40 } from "fs";
36193
36226
  import { dirname as dirname38 } from "path";
@@ -36222,9 +36255,22 @@ async function openHighLevelOverlay(sessionId, subject) {
36222
36255
  const path109 = saveHighLevelReview(record);
36223
36256
  console.log(`Verdict: ${record.verdict}`);
36224
36257
  console.log(`Saved ${path109}`);
36225
- console.log("Nothing was posted to GitHub.");
36258
+ if (record.verdict === "approve") approveOnGitHub(subject);
36259
+ else console.log("Nothing was posted to GitHub.");
36226
36260
  return record;
36227
36261
  }
36262
+ function approveOnGitHub(subject) {
36263
+ const target = `${subject.repo}#${subject.prNumber}`;
36264
+ try {
36265
+ postHighLevelApproval(subject.repo, subject.prNumber);
36266
+ } catch (error) {
36267
+ console.error(
36268
+ `Could not post the approval to ${target}: ${error.message}`
36269
+ );
36270
+ process.exit(1);
36271
+ }
36272
+ console.log(`Approval posted to ${target}.`);
36273
+ }
36228
36274
 
36229
36275
  // src/commands/review/highLevel/printHighLevelChecklist.ts
36230
36276
  import chalk240 from "chalk";
@@ -42668,7 +42714,7 @@ async function auth() {
42668
42714
  }
42669
42715
 
42670
42716
  // src/commands/roam/postRoamActivity.ts
42671
- import { execFileSync as execFileSync22 } from "child_process";
42717
+ import { execFileSync as execFileSync23 } from "child_process";
42672
42718
  import { readdirSync as readdirSync22, readFileSync as readFileSync66, statSync as statSync14 } from "fs";
42673
42719
  import { join as join102 } from "path";
42674
42720
  function findPortFile(roamDir) {
@@ -42707,7 +42753,7 @@ function postRoamActivity(app, event) {
42707
42753
  const pid = PID_BY_APP[app] ?? 99999;
42708
42754
  const url = `http://127.0.0.1:${port}/api/v1/activity/${app}/${event}?pid=${pid}`;
42709
42755
  try {
42710
- execFileSync22("curl", ["-sf", "--max-time", "0.2", "-X", "POST", url], {
42756
+ execFileSync23("curl", ["-sf", "--max-time", "0.2", "-X", "POST", url], {
42711
42757
  stdio: "ignore"
42712
42758
  });
42713
42759
  } catch {
@@ -43119,11 +43165,11 @@ function formatLink(link3) {
43119
43165
  }
43120
43166
 
43121
43167
  // src/commands/sessions/daemon/listDaemonPids.ts
43122
- import { execFileSync as execFileSync23 } from "child_process";
43168
+ import { execFileSync as execFileSync24 } from "child_process";
43123
43169
  function listDaemonPids() {
43124
43170
  if (process.platform === "win32") return [];
43125
43171
  try {
43126
- const out = execFileSync23("ps", ["-eo", "pid=,args="], {
43172
+ const out = execFileSync24("ps", ["-eo", "pid=,args="], {
43127
43173
  encoding: "utf8"
43128
43174
  });
43129
43175
  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));
@@ -46994,7 +47040,7 @@ function releaseClient(client, clients, prPreview, verify) {
46994
47040
  }
46995
47041
 
46996
47042
  // src/commands/sessions/daemon/findPortHolderPid.ts
46997
- import { execFileSync as execFileSync24 } from "child_process";
47043
+ import { execFileSync as execFileSync25 } from "child_process";
46998
47044
  var PROBE_TIMEOUT_MS = 3e3;
46999
47045
  function findPortHolderPid(port) {
47000
47046
  try {
@@ -47004,7 +47050,7 @@ function findPortHolderPid(port) {
47004
47050
  }
47005
47051
  }
47006
47052
  function probe(command, args) {
47007
- return execFileSync24(command, args, {
47053
+ return execFileSync25(command, args, {
47008
47054
  encoding: "utf8",
47009
47055
  timeout: PROBE_TIMEOUT_MS,
47010
47056
  stdio: ["ignore", "pipe", "ignore"]
@@ -50632,7 +50678,7 @@ function summaryPathFor(jsonlPath2) {
50632
50678
  }
50633
50679
 
50634
50680
  // src/commands/sessions/summarise/summariseSession.ts
50635
- import { execFileSync as execFileSync25 } from "child_process";
50681
+ import { execFileSync as execFileSync26 } from "child_process";
50636
50682
  function summariseSession(jsonlPath2) {
50637
50683
  const firstMessage = extractFirstUserMessage(jsonlPath2);
50638
50684
  const backlogIds = scanSessionBacklogRefs(jsonlPath2);
@@ -50641,7 +50687,7 @@ function summariseSession(jsonlPath2) {
50641
50687
  }
50642
50688
  const prompt = buildPrompt6(firstMessage, backlogIds);
50643
50689
  try {
50644
- const output = execFileSync25("claude", ["-p", "--model", "haiku", prompt], {
50690
+ const output = execFileSync26("claude", ["-p", "--model", "haiku", prompt], {
50645
50691
  encoding: "utf8",
50646
50692
  timeout: 3e4,
50647
50693
  stdio: ["ignore", "pipe", "ignore"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.845.0",
3
+ "version": "0.846.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {