@staff0rd/assist 0.160.0 → 0.162.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 +85 -64
- 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.162.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -337,6 +337,18 @@ function printVerboseDetails(item) {
|
|
|
337
337
|
// src/commands/backlog/run.ts
|
|
338
338
|
import chalk8 from "chalk";
|
|
339
339
|
|
|
340
|
+
// src/commands/backlog/buildCommentLines.ts
|
|
341
|
+
function buildCommentLines(comments2) {
|
|
342
|
+
if (!comments2?.length) return [];
|
|
343
|
+
return ["", "Comments:", ...comments2.map(formatPromptComment)];
|
|
344
|
+
}
|
|
345
|
+
function formatPromptComment(entry) {
|
|
346
|
+
const tag = entry.type === "summary" ? "[summary]" : "[comment]";
|
|
347
|
+
const phase = entry.phase !== void 0 ? ` (phase ${entry.phase + 1})` : "";
|
|
348
|
+
return `${tag}${phase} ${entry.timestamp}
|
|
349
|
+
${entry.text}`;
|
|
350
|
+
}
|
|
351
|
+
|
|
340
352
|
// src/commands/backlog/buildAuthoredPhasePrompt.ts
|
|
341
353
|
function buildAuthoredPhasePrompt(item, phaseIndex, phase) {
|
|
342
354
|
const manualChecks = phase.manualChecks ?? [];
|
|
@@ -349,7 +361,6 @@ function buildAuthoredPhasePrompt(item, phaseIndex, phase) {
|
|
|
349
361
|
"When you have completed all tasks for this phase, run /verify to check your work.",
|
|
350
362
|
...buildManualCheckLines(manualChecks),
|
|
351
363
|
"",
|
|
352
|
-
`You can run \`assist backlog comments ${item.id}\` to read prior phase notes and comments.`,
|
|
353
364
|
`Post concise comments for any notable findings or changes using \`assist backlog comment ${item.id} "<text>"\`.`,
|
|
354
365
|
"",
|
|
355
366
|
`Once verify passes${confirmSuffix}, run: assist backlog phase-done ${item.id} ${phaseIndex} "<summary>"`,
|
|
@@ -365,6 +376,7 @@ function buildContextLines(item, phaseIndex, phase) {
|
|
|
365
376
|
"",
|
|
366
377
|
"Acceptance criteria:",
|
|
367
378
|
ac,
|
|
379
|
+
...buildCommentLines(item.comments),
|
|
368
380
|
"",
|
|
369
381
|
`Phase ${phaseIndex + 1}: ${phase.name}`,
|
|
370
382
|
"Tasks:",
|
|
@@ -403,10 +415,10 @@ function buildReviewPrompt(item, phaseIndex) {
|
|
|
403
415
|
"For each criterion, inspect the code and report PASS or FAIL with a brief explanation:",
|
|
404
416
|
"",
|
|
405
417
|
acLines,
|
|
418
|
+
...buildCommentLines(item.comments),
|
|
406
419
|
"",
|
|
407
420
|
"If any criterion fails, fix the issue and re-verify before proceeding.",
|
|
408
421
|
"",
|
|
409
|
-
`You can run \`assist backlog comments ${item.id}\` to read prior phase notes and comments.`,
|
|
410
422
|
`Post concise comments for any notable findings or changes using \`assist backlog comment ${item.id} "<text>"\`.`,
|
|
411
423
|
"",
|
|
412
424
|
"After all criteria pass, ask the user to confirm any manual checks",
|
|
@@ -8946,26 +8958,44 @@ var seqAuth = createConnectionAuth({
|
|
|
8946
8958
|
});
|
|
8947
8959
|
|
|
8948
8960
|
// src/commands/seq/seqQuery.ts
|
|
8949
|
-
import
|
|
8961
|
+
import chalk107 from "chalk";
|
|
8950
8962
|
|
|
8951
|
-
// src/commands/seq/
|
|
8963
|
+
// src/commands/seq/fetchSeqEvents.ts
|
|
8952
8964
|
import chalk104 from "chalk";
|
|
8965
|
+
async function fetchSeqEvents(conn, params) {
|
|
8966
|
+
const url = `${conn.url}/api/events?${params}`;
|
|
8967
|
+
const response = await fetch(url, {
|
|
8968
|
+
headers: {
|
|
8969
|
+
Accept: "application/json",
|
|
8970
|
+
"X-Seq-ApiKey": conn.apiToken
|
|
8971
|
+
}
|
|
8972
|
+
});
|
|
8973
|
+
if (!response.ok) {
|
|
8974
|
+
const body = await response.text();
|
|
8975
|
+
console.error(chalk104.red(`Seq returned ${response.status}: ${body}`));
|
|
8976
|
+
process.exit(1);
|
|
8977
|
+
}
|
|
8978
|
+
return response.json();
|
|
8979
|
+
}
|
|
8980
|
+
|
|
8981
|
+
// src/commands/seq/formatEvent.ts
|
|
8982
|
+
import chalk105 from "chalk";
|
|
8953
8983
|
function levelColor(level) {
|
|
8954
8984
|
switch (level) {
|
|
8955
8985
|
case "Fatal":
|
|
8956
|
-
return
|
|
8986
|
+
return chalk105.bgRed.white;
|
|
8957
8987
|
case "Error":
|
|
8958
|
-
return
|
|
8988
|
+
return chalk105.red;
|
|
8959
8989
|
case "Warning":
|
|
8960
|
-
return
|
|
8990
|
+
return chalk105.yellow;
|
|
8961
8991
|
case "Information":
|
|
8962
|
-
return
|
|
8992
|
+
return chalk105.cyan;
|
|
8963
8993
|
case "Debug":
|
|
8964
|
-
return
|
|
8994
|
+
return chalk105.gray;
|
|
8965
8995
|
case "Verbose":
|
|
8966
|
-
return
|
|
8996
|
+
return chalk105.dim;
|
|
8967
8997
|
default:
|
|
8968
|
-
return
|
|
8998
|
+
return chalk105.white;
|
|
8969
8999
|
}
|
|
8970
9000
|
}
|
|
8971
9001
|
function levelAbbrev(level) {
|
|
@@ -9006,31 +9036,31 @@ function formatTimestamp(iso) {
|
|
|
9006
9036
|
function formatEvent(event) {
|
|
9007
9037
|
const color = levelColor(event.Level);
|
|
9008
9038
|
const abbrev = levelAbbrev(event.Level);
|
|
9009
|
-
const ts8 =
|
|
9039
|
+
const ts8 = chalk105.dim(formatTimestamp(event.Timestamp));
|
|
9010
9040
|
const msg = renderMessage(event);
|
|
9011
9041
|
const lines = [`${ts8} ${color(`[${abbrev}]`)} ${msg}`];
|
|
9012
9042
|
if (event.Exception) {
|
|
9013
9043
|
for (const line of event.Exception.split("\n")) {
|
|
9014
|
-
lines.push(
|
|
9044
|
+
lines.push(chalk105.red(` ${line}`));
|
|
9015
9045
|
}
|
|
9016
9046
|
}
|
|
9017
9047
|
return lines.join("\n");
|
|
9018
9048
|
}
|
|
9019
9049
|
|
|
9020
9050
|
// src/commands/seq/resolveConnection.ts
|
|
9021
|
-
import
|
|
9051
|
+
import chalk106 from "chalk";
|
|
9022
9052
|
function resolveConnection2(name) {
|
|
9023
9053
|
const connections = loadConnections2();
|
|
9024
9054
|
if (connections.length === 0) {
|
|
9025
9055
|
console.error(
|
|
9026
|
-
|
|
9056
|
+
chalk106.red("No Seq connections configured. Run 'assist seq auth' first.")
|
|
9027
9057
|
);
|
|
9028
9058
|
process.exit(1);
|
|
9029
9059
|
}
|
|
9030
9060
|
const target = name ?? getDefaultConnection() ?? connections[0].name;
|
|
9031
9061
|
const connection = connections.find((c) => c.name === target);
|
|
9032
9062
|
if (!connection) {
|
|
9033
|
-
console.error(
|
|
9063
|
+
console.error(chalk106.red(`Seq connection "${target}" not found.`));
|
|
9034
9064
|
process.exit(1);
|
|
9035
9065
|
}
|
|
9036
9066
|
return connection;
|
|
@@ -9041,21 +9071,12 @@ async function seqQuery(filter, options2) {
|
|
|
9041
9071
|
const conn = resolveConnection2(options2.connection);
|
|
9042
9072
|
const count = Number.parseInt(options2.count ?? "1000", 10);
|
|
9043
9073
|
const params = new URLSearchParams({ filter, count: String(count) });
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
headers: {
|
|
9047
|
-
Accept: "application/json",
|
|
9048
|
-
"X-Seq-ApiKey": conn.apiToken
|
|
9049
|
-
}
|
|
9050
|
-
});
|
|
9051
|
-
if (!response.ok) {
|
|
9052
|
-
const body = await response.text();
|
|
9053
|
-
console.error(chalk106.red(`Seq returned ${response.status}: ${body}`));
|
|
9054
|
-
process.exit(1);
|
|
9074
|
+
if (options2.from) {
|
|
9075
|
+
params.set("fromDateUtc", options2.from);
|
|
9055
9076
|
}
|
|
9056
|
-
const events = await
|
|
9077
|
+
const events = await fetchSeqEvents(conn, params);
|
|
9057
9078
|
if (events.length === 0) {
|
|
9058
|
-
console.log(
|
|
9079
|
+
console.log(chalk107.yellow("No events found."));
|
|
9059
9080
|
return;
|
|
9060
9081
|
}
|
|
9061
9082
|
if (options2.json) {
|
|
@@ -9066,11 +9087,11 @@ async function seqQuery(filter, options2) {
|
|
|
9066
9087
|
for (const event of chronological) {
|
|
9067
9088
|
console.log(formatEvent(event));
|
|
9068
9089
|
}
|
|
9069
|
-
console.log(
|
|
9090
|
+
console.log(chalk107.dim(`
|
|
9070
9091
|
${events.length} events`));
|
|
9071
9092
|
if (events.length >= count) {
|
|
9072
9093
|
console.log(
|
|
9073
|
-
|
|
9094
|
+
chalk107.yellow(
|
|
9074
9095
|
`Results limited to ${count}. Use --count to retrieve more.`
|
|
9075
9096
|
)
|
|
9076
9097
|
);
|
|
@@ -9078,11 +9099,11 @@ ${events.length} events`));
|
|
|
9078
9099
|
}
|
|
9079
9100
|
|
|
9080
9101
|
// src/commands/seq/seqSetConnection.ts
|
|
9081
|
-
import
|
|
9102
|
+
import chalk108 from "chalk";
|
|
9082
9103
|
function seqSetConnection(name) {
|
|
9083
9104
|
const connections = loadConnections2();
|
|
9084
9105
|
if (!connections.find((c) => c.name === name)) {
|
|
9085
|
-
console.error(
|
|
9106
|
+
console.error(chalk108.red(`Connection "${name}" not found.`));
|
|
9086
9107
|
process.exit(1);
|
|
9087
9108
|
}
|
|
9088
9109
|
setDefaultConnection(name);
|
|
@@ -9097,7 +9118,7 @@ function registerSeq(program2) {
|
|
|
9097
9118
|
auth2.command("list").description("List configured connections").action(() => seqAuth.list());
|
|
9098
9119
|
auth2.command("remove <name>").description("Remove a configured connection").action((name) => seqAuth.remove(name));
|
|
9099
9120
|
cmd.command("set-connection <name>").description("Set the default Seq connection").action((name) => seqSetConnection(name));
|
|
9100
|
-
cmd.command("query <filter>").description("Query Seq events with a filter expression").option("-c, --connection <name>", "Connection to use").option("-n, --count <n>", "Number of events to fetch", "50").option("--json", "Output raw JSON").action((filter, options2) => seqQuery(filter, options2));
|
|
9121
|
+
cmd.command("query <filter>").description("Query Seq events with a filter expression").option("-c, --connection <name>", "Connection to use").option("-n, --count <n>", "Number of events to fetch", "50").option("--from <date>", "Start date (UTC) for the query window").option("--json", "Output raw JSON").action((filter, options2) => seqQuery(filter, options2));
|
|
9101
9122
|
}
|
|
9102
9123
|
|
|
9103
9124
|
// src/commands/transcript/shared.ts
|
|
@@ -9621,14 +9642,14 @@ import {
|
|
|
9621
9642
|
import { dirname as dirname20, join as join30 } from "path";
|
|
9622
9643
|
|
|
9623
9644
|
// src/commands/transcript/summarise/processStagedFile/validateStagedContent.ts
|
|
9624
|
-
import
|
|
9645
|
+
import chalk109 from "chalk";
|
|
9625
9646
|
var FULL_TRANSCRIPT_REGEX = /^\[Full Transcript\]\(([^)]+)\)/;
|
|
9626
9647
|
function validateStagedContent(filename, content) {
|
|
9627
9648
|
const firstLine = content.split("\n")[0];
|
|
9628
9649
|
const match = firstLine.match(FULL_TRANSCRIPT_REGEX);
|
|
9629
9650
|
if (!match) {
|
|
9630
9651
|
console.error(
|
|
9631
|
-
|
|
9652
|
+
chalk109.red(
|
|
9632
9653
|
`Staged file ${filename} missing [Full Transcript](<path>) link on first line.`
|
|
9633
9654
|
)
|
|
9634
9655
|
);
|
|
@@ -9637,7 +9658,7 @@ function validateStagedContent(filename, content) {
|
|
|
9637
9658
|
const contentAfterLink = content.slice(firstLine.length).trim();
|
|
9638
9659
|
if (!contentAfterLink) {
|
|
9639
9660
|
console.error(
|
|
9640
|
-
|
|
9661
|
+
chalk109.red(
|
|
9641
9662
|
`Staged file ${filename} has no summary content after the transcript link.`
|
|
9642
9663
|
)
|
|
9643
9664
|
);
|
|
@@ -10030,7 +10051,7 @@ function registerVoice(program2) {
|
|
|
10030
10051
|
|
|
10031
10052
|
// src/commands/roam/auth.ts
|
|
10032
10053
|
import { randomBytes } from "crypto";
|
|
10033
|
-
import
|
|
10054
|
+
import chalk110 from "chalk";
|
|
10034
10055
|
|
|
10035
10056
|
// src/lib/openBrowser.ts
|
|
10036
10057
|
import { execSync as execSync38 } from "child_process";
|
|
@@ -10205,13 +10226,13 @@ async function auth() {
|
|
|
10205
10226
|
saveGlobalConfig(config);
|
|
10206
10227
|
const state = randomBytes(16).toString("hex");
|
|
10207
10228
|
console.log(
|
|
10208
|
-
|
|
10229
|
+
chalk110.yellow("\nEnsure this Redirect URI is set in your Roam OAuth app:")
|
|
10209
10230
|
);
|
|
10210
|
-
console.log(
|
|
10211
|
-
console.log(
|
|
10212
|
-
console.log(
|
|
10231
|
+
console.log(chalk110.white("http://localhost:14523/callback\n"));
|
|
10232
|
+
console.log(chalk110.blue("Opening browser for authorization..."));
|
|
10233
|
+
console.log(chalk110.dim("Waiting for authorization callback..."));
|
|
10213
10234
|
const { code, redirectUri } = await authorizeInBrowser(clientId, state);
|
|
10214
|
-
console.log(
|
|
10235
|
+
console.log(chalk110.dim("Exchanging code for tokens..."));
|
|
10215
10236
|
const tokens = await exchangeToken({
|
|
10216
10237
|
code,
|
|
10217
10238
|
clientId,
|
|
@@ -10227,7 +10248,7 @@ async function auth() {
|
|
|
10227
10248
|
};
|
|
10228
10249
|
saveGlobalConfig(config);
|
|
10229
10250
|
console.log(
|
|
10230
|
-
|
|
10251
|
+
chalk110.green("Roam credentials and tokens saved to ~/.assist.yml")
|
|
10231
10252
|
);
|
|
10232
10253
|
}
|
|
10233
10254
|
|
|
@@ -10440,7 +10461,7 @@ import { execSync as execSync40 } from "child_process";
|
|
|
10440
10461
|
import { existsSync as existsSync40, mkdirSync as mkdirSync13, unlinkSync as unlinkSync11, writeFileSync as writeFileSync28 } from "fs";
|
|
10441
10462
|
import { tmpdir as tmpdir6 } from "os";
|
|
10442
10463
|
import { join as join39, resolve as resolve5 } from "path";
|
|
10443
|
-
import
|
|
10464
|
+
import chalk111 from "chalk";
|
|
10444
10465
|
|
|
10445
10466
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
10446
10467
|
var captureWindowPs1 = `
|
|
@@ -10591,22 +10612,22 @@ function screenshot(processName) {
|
|
|
10591
10612
|
const config = loadConfig();
|
|
10592
10613
|
const outputDir = resolve5(config.screenshot.outputDir);
|
|
10593
10614
|
const outputPath = buildOutputPath(outputDir, processName);
|
|
10594
|
-
console.log(
|
|
10615
|
+
console.log(chalk111.gray(`Capturing window for process "${processName}" ...`));
|
|
10595
10616
|
try {
|
|
10596
10617
|
runPowerShellScript(processName, outputPath);
|
|
10597
|
-
console.log(
|
|
10618
|
+
console.log(chalk111.green(`Screenshot saved: ${outputPath}`));
|
|
10598
10619
|
} catch (error) {
|
|
10599
10620
|
const msg = error instanceof Error ? error.message : String(error);
|
|
10600
|
-
console.error(
|
|
10621
|
+
console.error(chalk111.red(`Failed to capture screenshot: ${msg}`));
|
|
10601
10622
|
process.exit(1);
|
|
10602
10623
|
}
|
|
10603
10624
|
}
|
|
10604
10625
|
|
|
10605
10626
|
// src/commands/statusLine.ts
|
|
10606
|
-
import
|
|
10627
|
+
import chalk113 from "chalk";
|
|
10607
10628
|
|
|
10608
10629
|
// src/commands/buildLimitsSegment.ts
|
|
10609
|
-
import
|
|
10630
|
+
import chalk112 from "chalk";
|
|
10610
10631
|
var FIVE_HOUR_SECONDS = 5 * 3600;
|
|
10611
10632
|
var SEVEN_DAY_SECONDS = 7 * 86400;
|
|
10612
10633
|
function formatTimeLeft(resetsAt) {
|
|
@@ -10629,10 +10650,10 @@ function projectUsage(pct, resetsAt, windowSeconds) {
|
|
|
10629
10650
|
function colorizeRateLimit(pct, resetsAt, windowSeconds) {
|
|
10630
10651
|
const label2 = `${Math.round(pct)}%`;
|
|
10631
10652
|
const projected = projectUsage(pct, resetsAt, windowSeconds);
|
|
10632
|
-
if (projected == null) return
|
|
10633
|
-
if (projected > 100) return
|
|
10634
|
-
if (projected > 75) return
|
|
10635
|
-
return
|
|
10653
|
+
if (projected == null) return chalk112.green(label2);
|
|
10654
|
+
if (projected > 100) return chalk112.red(label2);
|
|
10655
|
+
if (projected > 75) return chalk112.yellow(label2);
|
|
10656
|
+
return chalk112.green(label2);
|
|
10636
10657
|
}
|
|
10637
10658
|
function formatLimit(pct, resetsAt, windowSeconds, fallbackLabel) {
|
|
10638
10659
|
const timeLabel = resetsAt ? formatTimeLeft(resetsAt) : fallbackLabel;
|
|
@@ -10658,14 +10679,14 @@ function buildLimitsSegment(rateLimits) {
|
|
|
10658
10679
|
}
|
|
10659
10680
|
|
|
10660
10681
|
// src/commands/statusLine.ts
|
|
10661
|
-
|
|
10682
|
+
chalk113.level = 3;
|
|
10662
10683
|
function formatNumber(num) {
|
|
10663
10684
|
return num.toLocaleString("en-US");
|
|
10664
10685
|
}
|
|
10665
10686
|
function colorizePercent(pct) {
|
|
10666
10687
|
const label2 = `${Math.round(pct)}%`;
|
|
10667
|
-
if (pct > 80) return
|
|
10668
|
-
if (pct > 40) return
|
|
10688
|
+
if (pct > 80) return chalk113.red(label2);
|
|
10689
|
+
if (pct > 40) return chalk113.yellow(label2);
|
|
10669
10690
|
return label2;
|
|
10670
10691
|
}
|
|
10671
10692
|
async function statusLine() {
|
|
@@ -10688,7 +10709,7 @@ import { fileURLToPath as fileURLToPath7 } from "url";
|
|
|
10688
10709
|
// src/commands/sync/syncClaudeMd.ts
|
|
10689
10710
|
import * as fs23 from "fs";
|
|
10690
10711
|
import * as path46 from "path";
|
|
10691
|
-
import
|
|
10712
|
+
import chalk114 from "chalk";
|
|
10692
10713
|
async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
10693
10714
|
const source = path46.join(claudeDir, "CLAUDE.md");
|
|
10694
10715
|
const target = path46.join(targetBase, "CLAUDE.md");
|
|
@@ -10697,12 +10718,12 @@ async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
|
10697
10718
|
const targetContent = fs23.readFileSync(target, "utf-8");
|
|
10698
10719
|
if (sourceContent !== targetContent) {
|
|
10699
10720
|
console.log(
|
|
10700
|
-
|
|
10721
|
+
chalk114.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
|
|
10701
10722
|
);
|
|
10702
10723
|
console.log();
|
|
10703
10724
|
printDiff(targetContent, sourceContent);
|
|
10704
10725
|
const confirm = options2?.yes || await promptConfirm(
|
|
10705
|
-
|
|
10726
|
+
chalk114.red("Overwrite existing CLAUDE.md?"),
|
|
10706
10727
|
false
|
|
10707
10728
|
);
|
|
10708
10729
|
if (!confirm) {
|
|
@@ -10718,7 +10739,7 @@ async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
|
10718
10739
|
// src/commands/sync/syncSettings.ts
|
|
10719
10740
|
import * as fs24 from "fs";
|
|
10720
10741
|
import * as path47 from "path";
|
|
10721
|
-
import
|
|
10742
|
+
import chalk115 from "chalk";
|
|
10722
10743
|
async function syncSettings(claudeDir, targetBase, options2) {
|
|
10723
10744
|
const source = path47.join(claudeDir, "settings.json");
|
|
10724
10745
|
const target = path47.join(targetBase, "settings.json");
|
|
@@ -10734,14 +10755,14 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
10734
10755
|
if (mergedContent !== normalizedTarget) {
|
|
10735
10756
|
if (!options2?.yes) {
|
|
10736
10757
|
console.log(
|
|
10737
|
-
|
|
10758
|
+
chalk115.yellow(
|
|
10738
10759
|
"\n\u26A0\uFE0F Warning: settings.json differs from existing file"
|
|
10739
10760
|
)
|
|
10740
10761
|
);
|
|
10741
10762
|
console.log();
|
|
10742
10763
|
printDiff(targetContent, mergedContent);
|
|
10743
10764
|
const confirm = await promptConfirm(
|
|
10744
|
-
|
|
10765
|
+
chalk115.red("Overwrite existing settings.json?"),
|
|
10745
10766
|
false
|
|
10746
10767
|
);
|
|
10747
10768
|
if (!confirm) {
|