@staff0rd/assist 0.233.0 → 0.233.2
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/commands/sessions/web/bundle.js +38 -38
- package/dist/index.js +40 -37
- 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.233.
|
|
9
|
+
version: "0.233.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4933,13 +4933,13 @@ async function activity(options2) {
|
|
|
4933
4933
|
const activeDays = data.filter((d) => d.count > 0).length;
|
|
4934
4934
|
console.log(`${total} commits across ${activeDays} active days.`);
|
|
4935
4935
|
const weekly = /* @__PURE__ */ new Map();
|
|
4936
|
-
for (const { date, count:
|
|
4936
|
+
for (const { date, count: count5 } of data) {
|
|
4937
4937
|
const d = new Date(date);
|
|
4938
4938
|
d.setDate(d.getDate() - d.getDay());
|
|
4939
4939
|
const weekStart = d.toISOString().slice(0, 10);
|
|
4940
|
-
weekly.set(weekStart, (weekly.get(weekStart) ?? 0) +
|
|
4940
|
+
weekly.set(weekStart, (weekly.get(weekStart) ?? 0) + count5);
|
|
4941
4941
|
}
|
|
4942
|
-
const weeklyData = [...weekly.entries()].map(([date,
|
|
4942
|
+
const weeklyData = [...weekly.entries()].map(([date, count5]) => ({ date, count: count5 })).sort((a, b) => a.date.localeCompare(b.date));
|
|
4943
4943
|
const until = data[data.length - 1].date;
|
|
4944
4944
|
activityChart(weeklyData, { since, until });
|
|
4945
4945
|
}
|
|
@@ -5399,7 +5399,7 @@ async function add(options2) {
|
|
|
5399
5399
|
import chalk55 from "chalk";
|
|
5400
5400
|
|
|
5401
5401
|
// src/commands/backlog/insertPhaseAt.ts
|
|
5402
|
-
import { eq as eq14 } from "drizzle-orm";
|
|
5402
|
+
import { count, eq as eq14 } from "drizzle-orm";
|
|
5403
5403
|
|
|
5404
5404
|
// src/commands/backlog/shiftPhasesUp.ts
|
|
5405
5405
|
import { and as and3, desc, eq as eq13, gte } from "drizzle-orm";
|
|
@@ -5414,22 +5414,25 @@ async function shiftPhasesUp(db, itemId, fromIdx) {
|
|
|
5414
5414
|
// src/commands/backlog/insertPhaseAt.ts
|
|
5415
5415
|
async function insertPhaseAt(orm, itemId, phaseIdx, name, tasks, manualChecks, currentPhase) {
|
|
5416
5416
|
await orm.transaction(async (tx) => {
|
|
5417
|
+
const [row] = await tx.select({ cnt: count() }).from(planPhases).where(eq14(planPhases.itemId, itemId));
|
|
5418
|
+
const phaseCount = row?.cnt ?? 0;
|
|
5417
5419
|
await shiftPhasesUp(tx, itemId, phaseIdx);
|
|
5418
5420
|
await tx.insert(planPhases).values({ itemId, idx: phaseIdx, name, manualChecks });
|
|
5419
5421
|
if (tasks.length) {
|
|
5420
5422
|
await tx.insert(planTasks).values(tasks.map((task, i) => ({ itemId, phaseIdx, idx: i, task })));
|
|
5421
5423
|
}
|
|
5422
5424
|
if (currentPhase !== void 0 && currentPhase - 1 >= phaseIdx) {
|
|
5423
|
-
|
|
5425
|
+
const atReviewSlot = currentPhase - 1 >= phaseCount;
|
|
5426
|
+
await tx.update(items).set({ currentPhase: atReviewSlot ? phaseIdx + 1 : currentPhase + 1 }).where(eq14(items.id, itemId));
|
|
5424
5427
|
}
|
|
5425
5428
|
});
|
|
5426
5429
|
}
|
|
5427
5430
|
|
|
5428
5431
|
// src/commands/backlog/resolveInsertPosition.ts
|
|
5429
5432
|
import chalk54 from "chalk";
|
|
5430
|
-
import { count, eq as eq15 } from "drizzle-orm";
|
|
5433
|
+
import { count as count2, eq as eq15 } from "drizzle-orm";
|
|
5431
5434
|
async function resolveInsertPosition(orm, itemId, position) {
|
|
5432
|
-
const [row] = await orm.select({ cnt:
|
|
5435
|
+
const [row] = await orm.select({ cnt: count2() }).from(planPhases).where(eq15(planPhases.itemId, itemId));
|
|
5433
5436
|
const phaseCount = row?.cnt ?? 0;
|
|
5434
5437
|
if (position === void 0) return phaseCount;
|
|
5435
5438
|
const pos = Number.parseInt(position, 10);
|
|
@@ -5883,14 +5886,14 @@ import { and as and8, eq as eq21 } from "drizzle-orm";
|
|
|
5883
5886
|
|
|
5884
5887
|
// src/commands/backlog/findPhase.ts
|
|
5885
5888
|
import chalk68 from "chalk";
|
|
5886
|
-
import { and as and6, count as
|
|
5889
|
+
import { and as and6, count as count3, eq as eq19 } from "drizzle-orm";
|
|
5887
5890
|
async function findPhase(id, phase) {
|
|
5888
5891
|
const found = await findOneItem(id);
|
|
5889
5892
|
if (!found) return void 0;
|
|
5890
5893
|
const { orm, item } = found;
|
|
5891
5894
|
const itemId = item.id;
|
|
5892
5895
|
const phaseIdx = Number.parseInt(phase, 10) - 1;
|
|
5893
|
-
const [row] = await orm.select({ cnt:
|
|
5896
|
+
const [row] = await orm.select({ cnt: count3() }).from(planPhases).where(and6(eq19(planPhases.itemId, itemId), eq19(planPhases.idx, phaseIdx)));
|
|
5894
5897
|
if (!row || row.cnt === 0) {
|
|
5895
5898
|
console.log(
|
|
5896
5899
|
chalk68.red(`Phase ${phaseIdx + 1} not found on item #${itemId}.`)
|
|
@@ -5902,7 +5905,7 @@ async function findPhase(id, phase) {
|
|
|
5902
5905
|
}
|
|
5903
5906
|
|
|
5904
5907
|
// src/commands/backlog/reindexPhases.ts
|
|
5905
|
-
import { and as and7, asc as asc4, count as
|
|
5908
|
+
import { and as and7, asc as asc4, count as count4, eq as eq20 } from "drizzle-orm";
|
|
5906
5909
|
async function reindexPhases(db, itemId) {
|
|
5907
5910
|
const remaining = await db.select({ idx: planPhases.idx }).from(planPhases).where(eq20(planPhases.itemId, itemId)).orderBy(asc4(planPhases.idx));
|
|
5908
5911
|
for (let i = 0; i < remaining.length; i++) {
|
|
@@ -5921,7 +5924,7 @@ async function adjustCurrentPhase(db, item, removedIdx) {
|
|
|
5921
5924
|
return;
|
|
5922
5925
|
}
|
|
5923
5926
|
if (removedIdx !== currentIdx) return;
|
|
5924
|
-
const [row] = await db.select({ cnt:
|
|
5927
|
+
const [row] = await db.select({ cnt: count4() }).from(planPhases).where(eq20(planPhases.itemId, item.id));
|
|
5925
5928
|
const cnt = row?.cnt ?? 0;
|
|
5926
5929
|
await db.update(items).set({ currentPhase: cnt === 0 ? null : Math.min(currentPhase, cnt) }).where(eq20(items.id, item.id));
|
|
5927
5930
|
}
|
|
@@ -7482,7 +7485,7 @@ function calculateHalstead(node) {
|
|
|
7482
7485
|
// src/commands/complexity/shared/countSloc.ts
|
|
7483
7486
|
function countSloc(content) {
|
|
7484
7487
|
let inMultiLineComment = false;
|
|
7485
|
-
let
|
|
7488
|
+
let count5 = 0;
|
|
7486
7489
|
for (const line of content.split("\n")) {
|
|
7487
7490
|
const trimmed = line.trim();
|
|
7488
7491
|
if (inMultiLineComment) {
|
|
@@ -7490,7 +7493,7 @@ function countSloc(content) {
|
|
|
7490
7493
|
inMultiLineComment = false;
|
|
7491
7494
|
const afterComment = trimmed.substring(trimmed.indexOf("*/") + 2);
|
|
7492
7495
|
if (afterComment.trim().length > 0) {
|
|
7493
|
-
|
|
7496
|
+
count5++;
|
|
7494
7497
|
}
|
|
7495
7498
|
}
|
|
7496
7499
|
continue;
|
|
@@ -7502,7 +7505,7 @@ function countSloc(content) {
|
|
|
7502
7505
|
if (trimmed.includes("*/")) {
|
|
7503
7506
|
const afterComment = trimmed.substring(trimmed.indexOf("*/") + 2);
|
|
7504
7507
|
if (afterComment.trim().length > 0) {
|
|
7505
|
-
|
|
7508
|
+
count5++;
|
|
7506
7509
|
}
|
|
7507
7510
|
} else {
|
|
7508
7511
|
inMultiLineComment = true;
|
|
@@ -7510,10 +7513,10 @@ function countSloc(content) {
|
|
|
7510
7513
|
continue;
|
|
7511
7514
|
}
|
|
7512
7515
|
if (trimmed.length > 0) {
|
|
7513
|
-
|
|
7516
|
+
count5++;
|
|
7514
7517
|
}
|
|
7515
7518
|
}
|
|
7516
|
-
return
|
|
7519
|
+
return count5;
|
|
7517
7520
|
}
|
|
7518
7521
|
|
|
7519
7522
|
// src/commands/complexity/shared/index.ts
|
|
@@ -9916,11 +9919,11 @@ function printPromptsTable(rows) {
|
|
|
9916
9919
|
console.log(chalk111.dim(header));
|
|
9917
9920
|
console.log(chalk111.dim("-".repeat(header.length)));
|
|
9918
9921
|
for (const row of rows) {
|
|
9919
|
-
const
|
|
9922
|
+
const count5 = String(row.count).padStart(countWidth);
|
|
9920
9923
|
const tool = row.tool.padEnd(toolWidth);
|
|
9921
9924
|
const command = truncate(row.command, 60).padEnd(commandWidth);
|
|
9922
9925
|
console.log(
|
|
9923
|
-
`${chalk111.yellow(
|
|
9926
|
+
`${chalk111.yellow(count5)} ${tool} ${command} ${chalk111.dim(row.repos)}`
|
|
9924
9927
|
);
|
|
9925
9928
|
}
|
|
9926
9929
|
}
|
|
@@ -10530,8 +10533,8 @@ async function promptNavigation(currentPage, totalPages) {
|
|
|
10530
10533
|
});
|
|
10531
10534
|
return parseAction(action);
|
|
10532
10535
|
}
|
|
10533
|
-
function computeTotalPages(
|
|
10534
|
-
return Math.ceil(
|
|
10536
|
+
function computeTotalPages(count5) {
|
|
10537
|
+
return Math.ceil(count5 / PAGE_SIZE);
|
|
10535
10538
|
}
|
|
10536
10539
|
async function navigateAndDisplay(pullRequests, totalPages, currentPage) {
|
|
10537
10540
|
const delta = await promptNavigation(currentPage, totalPages);
|
|
@@ -13035,9 +13038,9 @@ function warnUnlocated(unlocated) {
|
|
|
13035
13038
|
}
|
|
13036
13039
|
|
|
13037
13040
|
// src/commands/review/postReviewToPr.ts
|
|
13038
|
-
async function confirmPost(prNumber,
|
|
13041
|
+
async function confirmPost(prNumber, count5, options2) {
|
|
13039
13042
|
if (!options2.prompt) return true;
|
|
13040
|
-
return promptConfirm(`Post ${
|
|
13043
|
+
return promptConfirm(`Post ${count5} comment(s) to PR #${prNumber}?`, false);
|
|
13041
13044
|
}
|
|
13042
13045
|
async function postReviewToPr(synthesisPath, options2) {
|
|
13043
13046
|
const prNumber = findCurrentPrNumber();
|
|
@@ -14061,9 +14064,9 @@ async function runReviewPipeline(paths, options2) {
|
|
|
14061
14064
|
}
|
|
14062
14065
|
|
|
14063
14066
|
// src/commands/review/reviewPr.ts
|
|
14064
|
-
function logPriorComments(
|
|
14065
|
-
if (
|
|
14066
|
-
console.log(`Including ${
|
|
14067
|
+
function logPriorComments(count5) {
|
|
14068
|
+
if (count5 === 0) return;
|
|
14069
|
+
console.log(`Including ${count5} prior review comment(s) in request.md.`);
|
|
14067
14070
|
}
|
|
14068
14071
|
function gatherChangedContext() {
|
|
14069
14072
|
const context = gatherContext();
|
|
@@ -14305,9 +14308,9 @@ function filterToSql(filter) {
|
|
|
14305
14308
|
}
|
|
14306
14309
|
|
|
14307
14310
|
// src/commands/seq/fetchSeqData.ts
|
|
14308
|
-
async function fetchSeqData(conn, filter,
|
|
14311
|
+
async function fetchSeqData(conn, filter, count5, from, to) {
|
|
14309
14312
|
const sqlFilter = filterToSql(filter);
|
|
14310
|
-
const sql4 = `select @Timestamp, @Level, @Exception, @Message from stream where ${sqlFilter} order by @Timestamp desc limit ${
|
|
14313
|
+
const sql4 = `select @Timestamp, @Level, @Exception, @Message from stream where ${sqlFilter} order by @Timestamp desc limit ${count5}`;
|
|
14311
14314
|
const params = new URLSearchParams({ q: sql4 });
|
|
14312
14315
|
if (from) params.set("fromDateUtc", from);
|
|
14313
14316
|
if (to) params.set("toDateUtc", to);
|
|
@@ -14477,12 +14480,12 @@ function resolveConnection2(name) {
|
|
|
14477
14480
|
async function seqQuery(filter, options2) {
|
|
14478
14481
|
rejectTimestampFilter(filter);
|
|
14479
14482
|
const conn = resolveConnection2(options2.connection);
|
|
14480
|
-
const
|
|
14483
|
+
const count5 = Number.parseInt(options2.count ?? "1000", 10);
|
|
14481
14484
|
const from = options2.from ? parseRelativeTime(options2.from) : void 0;
|
|
14482
14485
|
const to = options2.to ? parseRelativeTime(options2.to) : void 0;
|
|
14483
|
-
const events = from || to ? await fetchSeqData(conn, filter,
|
|
14486
|
+
const events = from || to ? await fetchSeqData(conn, filter, count5, from, to) : await fetchSeqEvents(
|
|
14484
14487
|
conn,
|
|
14485
|
-
new URLSearchParams({ filter, count: String(
|
|
14488
|
+
new URLSearchParams({ filter, count: String(count5) })
|
|
14486
14489
|
);
|
|
14487
14490
|
if (events.length === 0) {
|
|
14488
14491
|
console.log(chalk142.yellow("No events found."));
|
|
@@ -14498,10 +14501,10 @@ async function seqQuery(filter, options2) {
|
|
|
14498
14501
|
}
|
|
14499
14502
|
console.log(chalk142.dim(`
|
|
14500
14503
|
${events.length} events`));
|
|
14501
|
-
if (events.length >=
|
|
14504
|
+
if (events.length >= count5) {
|
|
14502
14505
|
console.log(
|
|
14503
14506
|
chalk142.yellow(
|
|
14504
|
-
`Results limited to ${
|
|
14507
|
+
`Results limited to ${count5}. Use --count to retrieve more.`
|
|
14505
14508
|
)
|
|
14506
14509
|
);
|
|
14507
14510
|
}
|
|
@@ -15536,13 +15539,13 @@ function logs(options2) {
|
|
|
15536
15539
|
console.log("No voice log file found");
|
|
15537
15540
|
return;
|
|
15538
15541
|
}
|
|
15539
|
-
const
|
|
15542
|
+
const count5 = Number.parseInt(options2.lines ?? "150", 10);
|
|
15540
15543
|
const content = readFileSync33(voicePaths.log, "utf-8").trim();
|
|
15541
15544
|
if (!content) {
|
|
15542
15545
|
console.log("Voice log is empty");
|
|
15543
15546
|
return;
|
|
15544
15547
|
}
|
|
15545
|
-
const lines = content.split("\n").slice(-
|
|
15548
|
+
const lines = content.split("\n").slice(-count5);
|
|
15546
15549
|
for (const line of lines) {
|
|
15547
15550
|
try {
|
|
15548
15551
|
const event = JSON.parse(line);
|
|
@@ -15689,10 +15692,10 @@ function isProcessAlive3(pid) {
|
|
|
15689
15692
|
return false;
|
|
15690
15693
|
}
|
|
15691
15694
|
}
|
|
15692
|
-
function readRecentLogs(
|
|
15695
|
+
function readRecentLogs(count5) {
|
|
15693
15696
|
if (!existsSync45(voicePaths.log)) return [];
|
|
15694
15697
|
const lines = readFileSync35(voicePaths.log, "utf-8").trim().split("\n");
|
|
15695
|
-
return lines.slice(-
|
|
15698
|
+
return lines.slice(-count5);
|
|
15696
15699
|
}
|
|
15697
15700
|
function status() {
|
|
15698
15701
|
if (!existsSync45(voicePaths.pid)) {
|