@staff0rd/assist 0.237.0 → 0.238.1
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 +2 -2
- package/dist/index.js +80 -50
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,7 +116,7 @@ The first backlog command in a repository that still has a local `.assist/backlo
|
|
|
116
116
|
- `assist backlog update-phase <id> <phase> [--name <n>] [--task <t...>] [--manual-check <c...>]` - Modify a plan phase (name, tasks, or manual checks)
|
|
117
117
|
- `assist backlog update-phase <id> <phase> [--add-task <text>] [--edit-task <n> <text>] [--remove-task <n>] [--add-check <text>] [--edit-check <n> <text>] [--remove-check <n>]` - Granular task and manual-check edits using 1-based indices matching `backlog show`: `--add-*` appends (repeatable), `--edit-*` replaces entry n in place, `--remove-*` deletes entry n and renumbers the rest (task ops cannot be combined with `--task`; check ops cannot be combined with `--manual-check`)
|
|
118
118
|
- `assist backlog remove-phase <id> <phase>` - Remove a plan phase from a backlog item
|
|
119
|
-
- `assist backlog next` - Pick and run the next backlog item, or open `/draft` if none remain
|
|
119
|
+
- `assist backlog next [id]` - Pick and run the next backlog item, or open `/draft` if none remain; pass an `id` to run that item first, then continue chaining
|
|
120
120
|
- `assist backlog refine [id]` - Alias for `refine`
|
|
121
121
|
- `assist backlog start <id>` - Set a backlog item to in-progress
|
|
122
122
|
- `assist backlog stop` - Revert all in-progress backlog items to todo and reset their phase to 1
|
|
@@ -237,7 +237,7 @@ The first backlog command in a repository that still has a local `.assist/backlo
|
|
|
237
237
|
- `assist sessions` - Start the web dashboard (same as `sessions web`)
|
|
238
238
|
- `assist sessions web [-p, --port <number>]` - Start the web dashboard with Sessions and Backlog tabs, xterm.js terminals (default port 3100)
|
|
239
239
|
- `assist sessions summarise [-f, --force] [-n, --limit <count>]` - Generate one-line summaries for unsummarised Claude sessions (force re-generates all; limit caps how many to process)
|
|
240
|
-
- `assist next` - Alias for `backlog next`
|
|
240
|
+
- `assist next [id]` - Alias for `backlog next [id]`
|
|
241
241
|
- `assist draft` (alias: `feat`) - Launch Claude in `/draft` mode, chain into next on `/next` signal
|
|
242
242
|
- `assist bug` - Launch Claude in `/bug` mode, chain into next on `/next` signal
|
|
243
243
|
- `assist refine [id]` - Launch Claude in `/refine` mode to refine a backlog item; prompts for selection when no id given
|
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.238.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -3798,12 +3798,14 @@ async function pickItem(items2, firstPick = false) {
|
|
|
3798
3798
|
const todo = items2.filter((i) => i.status === "todo");
|
|
3799
3799
|
return selectItem(todo, items2);
|
|
3800
3800
|
}
|
|
3801
|
-
async function next(options2) {
|
|
3801
|
+
async function next(options2, startId) {
|
|
3802
3802
|
if (blockedByHandover()) return;
|
|
3803
3803
|
pullIfConfigured();
|
|
3804
|
+
let pendingId = startId;
|
|
3804
3805
|
let firstPick = true;
|
|
3805
3806
|
while (true) {
|
|
3806
|
-
const id = await pickItem(await loadBacklog(), firstPick);
|
|
3807
|
+
const id = pendingId ?? await pickItem(await loadBacklog(), firstPick);
|
|
3808
|
+
pendingId = void 0;
|
|
3807
3809
|
firstPick = false;
|
|
3808
3810
|
if (id === void 0) return;
|
|
3809
3811
|
const completed = await run2(id, options2);
|
|
@@ -6330,8 +6332,8 @@ function registerRefineCommand(cmd) {
|
|
|
6330
6332
|
cmd.command("refine").argument("[id]", "Backlog item ID").description("Alias for refine").action((id) => refine(id));
|
|
6331
6333
|
}
|
|
6332
6334
|
function registerNextCommand(cmd) {
|
|
6333
|
-
cmd.command("next").description("Pick and run the next backlog item, or open /draft if none").option("-w, --write", "Run Claude with auto permission mode (default)").option("--no-write", "Run Claude without auto permission mode").action(
|
|
6334
|
-
(opts) => next({ allowEdits: opts.write !== false })
|
|
6335
|
+
cmd.command("next").argument("[id]", "Backlog item ID to run first").description("Pick and run the next backlog item, or open /draft if none").option("-w, --write", "Run Claude with auto permission mode (default)").option("--no-write", "Run Claude without auto permission mode").action(
|
|
6336
|
+
(id, opts) => next({ allowEdits: opts.write !== false }, id)
|
|
6335
6337
|
);
|
|
6336
6338
|
}
|
|
6337
6339
|
var registrars = [
|
|
@@ -9677,7 +9679,7 @@ async function reviewComments(number) {
|
|
|
9677
9679
|
|
|
9678
9680
|
// src/commands/registerLaunch.ts
|
|
9679
9681
|
function registerLaunch(program2) {
|
|
9680
|
-
program2.command("next").description("Alias for backlog next").action(() => next({ allowEdits: true }));
|
|
9682
|
+
program2.command("next").argument("[id]", "Backlog item ID to run first").description("Alias for backlog next").action((id) => next({ allowEdits: true }, id));
|
|
9681
9683
|
program2.command("draft").alias("feat").description(
|
|
9682
9684
|
"Launch Claude in /draft mode, chain into next on /next signal"
|
|
9683
9685
|
).action(() => launchMode("draft"));
|
|
@@ -11405,14 +11407,42 @@ import path36 from "path";
|
|
|
11405
11407
|
import chalk132 from "chalk";
|
|
11406
11408
|
|
|
11407
11409
|
// src/commands/refactor/extract/applyExtraction.ts
|
|
11408
|
-
import { SyntaxKind as
|
|
11410
|
+
import { SyntaxKind as SyntaxKind4 } from "ts-morph";
|
|
11411
|
+
|
|
11412
|
+
// src/commands/refactor/extract/addImportPreservingSuppressions.ts
|
|
11413
|
+
import {
|
|
11414
|
+
SyntaxKind as SyntaxKind2
|
|
11415
|
+
} from "ts-morph";
|
|
11416
|
+
var suppressionPattern = /^\s*(\/\/|\/\*)\s*biome-ignore(-all)?\b/;
|
|
11417
|
+
function countLeadingSuppressions(sourceFile) {
|
|
11418
|
+
let count6 = 0;
|
|
11419
|
+
for (const stmt of sourceFile.getStatementsWithComments()) {
|
|
11420
|
+
const kind = stmt.getKind();
|
|
11421
|
+
if ((kind === SyntaxKind2.SingleLineCommentTrivia || kind === SyntaxKind2.MultiLineCommentTrivia) && suppressionPattern.test(stmt.getText())) {
|
|
11422
|
+
count6++;
|
|
11423
|
+
} else {
|
|
11424
|
+
break;
|
|
11425
|
+
}
|
|
11426
|
+
}
|
|
11427
|
+
return count6;
|
|
11428
|
+
}
|
|
11429
|
+
function addImportPreservingSuppressions(sourceFile, structure) {
|
|
11430
|
+
if (sourceFile.getImportDeclarations().length > 0) {
|
|
11431
|
+
sourceFile.addImportDeclaration(structure);
|
|
11432
|
+
return;
|
|
11433
|
+
}
|
|
11434
|
+
sourceFile.insertImportDeclaration(
|
|
11435
|
+
countLeadingSuppressions(sourceFile),
|
|
11436
|
+
structure
|
|
11437
|
+
);
|
|
11438
|
+
}
|
|
11409
11439
|
|
|
11410
11440
|
// src/commands/refactor/extract/removeStaleImports.ts
|
|
11411
|
-
import { SyntaxKind as
|
|
11441
|
+
import { SyntaxKind as SyntaxKind3 } from "ts-morph";
|
|
11412
11442
|
function collectReferencedNames(sourceFile) {
|
|
11413
11443
|
const names = /* @__PURE__ */ new Set();
|
|
11414
|
-
for (const id of sourceFile.getDescendantsOfKind(
|
|
11415
|
-
if (id.getFirstAncestorByKind(
|
|
11444
|
+
for (const id of sourceFile.getDescendantsOfKind(SyntaxKind3.Identifier)) {
|
|
11445
|
+
if (id.getFirstAncestorByKind(SyntaxKind3.ImportDeclaration)) continue;
|
|
11416
11446
|
names.add(id.getText());
|
|
11417
11447
|
}
|
|
11418
11448
|
return names;
|
|
@@ -11455,7 +11485,7 @@ function updateImporters(functionName, sourceFile, importers) {
|
|
|
11455
11485
|
importDecl.remove();
|
|
11456
11486
|
}
|
|
11457
11487
|
}
|
|
11458
|
-
importerFile
|
|
11488
|
+
addImportPreservingSuppressions(importerFile, {
|
|
11459
11489
|
moduleSpecifier: relPath2,
|
|
11460
11490
|
namedImports: [alias ? { name: functionName, alias } : functionName]
|
|
11461
11491
|
});
|
|
@@ -11464,7 +11494,7 @@ function updateImporters(functionName, sourceFile, importers) {
|
|
|
11464
11494
|
|
|
11465
11495
|
// src/commands/refactor/extract/applyExtraction.ts
|
|
11466
11496
|
function isNameReferencedInSource(sourceFile, name) {
|
|
11467
|
-
return sourceFile.getDescendantsOfKind(
|
|
11497
|
+
return sourceFile.getDescendantsOfKind(SyntaxKind4.Identifier).some((id) => id.getText() === name);
|
|
11468
11498
|
}
|
|
11469
11499
|
async function applyExtraction(functionName, sourceFile, destPath, plan2, project) {
|
|
11470
11500
|
project.createSourceFile(destPath, plan2.destContent, { overwrite: false });
|
|
@@ -11476,7 +11506,7 @@ async function applyExtraction(functionName, sourceFile, destPath, plan2, projec
|
|
|
11476
11506
|
}
|
|
11477
11507
|
removeStaleImports(sourceFile);
|
|
11478
11508
|
if (isNameReferencedInSource(sourceFile, functionName)) {
|
|
11479
|
-
sourceFile
|
|
11509
|
+
addImportPreservingSuppressions(sourceFile, {
|
|
11480
11510
|
moduleSpecifier: plan2.destRelPath,
|
|
11481
11511
|
namedImports: [functionName]
|
|
11482
11512
|
});
|
|
@@ -11505,19 +11535,19 @@ async function applyExtraction(functionName, sourceFile, destPath, plan2, projec
|
|
|
11505
11535
|
|
|
11506
11536
|
// src/commands/refactor/extract/collectDependencies.ts
|
|
11507
11537
|
import {
|
|
11508
|
-
SyntaxKind as
|
|
11538
|
+
SyntaxKind as SyntaxKind8
|
|
11509
11539
|
} from "ts-morph";
|
|
11510
11540
|
|
|
11511
11541
|
// src/commands/refactor/extract/collectPrivateFunctions.ts
|
|
11512
|
-
import { SyntaxKind as
|
|
11542
|
+
import { SyntaxKind as SyntaxKind5 } from "ts-morph";
|
|
11513
11543
|
function isPrivate(fn) {
|
|
11514
11544
|
return !fn.isExported() && !fn.isDefaultExport();
|
|
11515
11545
|
}
|
|
11516
11546
|
function getCalledFunctionNames(fn) {
|
|
11517
11547
|
const names = /* @__PURE__ */ new Set();
|
|
11518
|
-
for (const call of fn.getDescendantsOfKind(
|
|
11548
|
+
for (const call of fn.getDescendantsOfKind(SyntaxKind5.CallExpression)) {
|
|
11519
11549
|
const expr = call.getExpression();
|
|
11520
|
-
if (expr.getKind() ===
|
|
11550
|
+
if (expr.getKind() === SyntaxKind5.Identifier) {
|
|
11521
11551
|
names.add(expr.getText());
|
|
11522
11552
|
}
|
|
11523
11553
|
}
|
|
@@ -11545,10 +11575,10 @@ function collectPrivateFunctions(target, fnMap) {
|
|
|
11545
11575
|
}
|
|
11546
11576
|
|
|
11547
11577
|
// src/commands/refactor/extract/collectPrivateStatements.ts
|
|
11548
|
-
import { SyntaxKind as
|
|
11578
|
+
import { SyntaxKind as SyntaxKind6 } from "ts-morph";
|
|
11549
11579
|
function getReferencedIdentifiers(fn) {
|
|
11550
11580
|
const names = /* @__PURE__ */ new Set();
|
|
11551
|
-
for (const id of fn.getDescendantsOfKind(
|
|
11581
|
+
for (const id of fn.getDescendantsOfKind(SyntaxKind6.Identifier)) {
|
|
11552
11582
|
names.add(id.getText());
|
|
11553
11583
|
}
|
|
11554
11584
|
return names;
|
|
@@ -11566,12 +11596,12 @@ function collectPrivateStatements(functions, stmtMap) {
|
|
|
11566
11596
|
|
|
11567
11597
|
// src/commands/refactor/extract/getFunctionMap.ts
|
|
11568
11598
|
import {
|
|
11569
|
-
SyntaxKind as
|
|
11599
|
+
SyntaxKind as SyntaxKind7
|
|
11570
11600
|
} from "ts-morph";
|
|
11571
11601
|
function getFunctionMap(sourceFile) {
|
|
11572
11602
|
const map = /* @__PURE__ */ new Map();
|
|
11573
11603
|
for (const fn of sourceFile.getDescendantsOfKind(
|
|
11574
|
-
|
|
11604
|
+
SyntaxKind7.FunctionDeclaration
|
|
11575
11605
|
)) {
|
|
11576
11606
|
const name = fn.getName();
|
|
11577
11607
|
if (name) map.set(name, fn);
|
|
@@ -11597,7 +11627,7 @@ function getPrivateStatementMap(sourceFile) {
|
|
|
11597
11627
|
|
|
11598
11628
|
// src/commands/refactor/extract/collectDependencies.ts
|
|
11599
11629
|
function getRemainingFunctions(sourceFile, extracted) {
|
|
11600
|
-
return sourceFile.getDescendantsOfKind(
|
|
11630
|
+
return sourceFile.getDescendantsOfKind(SyntaxKind8.FunctionDeclaration).filter((fn) => !extracted.has(fn));
|
|
11601
11631
|
}
|
|
11602
11632
|
function collectFnsUsedByRemaining(remaining, fnMap) {
|
|
11603
11633
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -11632,25 +11662,25 @@ function collectDependencies(target, sourceFile) {
|
|
|
11632
11662
|
|
|
11633
11663
|
// src/commands/refactor/extract/findFunction.ts
|
|
11634
11664
|
import {
|
|
11635
|
-
SyntaxKind as
|
|
11665
|
+
SyntaxKind as SyntaxKind9
|
|
11636
11666
|
} from "ts-morph";
|
|
11637
11667
|
function findFunction(sourceFile, functionName) {
|
|
11638
|
-
return sourceFile.getDescendantsOfKind(
|
|
11668
|
+
return sourceFile.getDescendantsOfKind(SyntaxKind9.FunctionDeclaration).find((fn) => fn.getName() === functionName);
|
|
11639
11669
|
}
|
|
11640
11670
|
|
|
11641
11671
|
// src/commands/refactor/extract/getExportedDependencyNames.ts
|
|
11642
|
-
import { SyntaxKind as
|
|
11672
|
+
import { SyntaxKind as SyntaxKind10 } from "ts-morph";
|
|
11643
11673
|
function getExportedDependencyNames(target, sourceFile) {
|
|
11644
11674
|
const calledNames = /* @__PURE__ */ new Set();
|
|
11645
|
-
for (const call of target.getDescendantsOfKind(
|
|
11675
|
+
for (const call of target.getDescendantsOfKind(SyntaxKind10.CallExpression)) {
|
|
11646
11676
|
const expr = call.getExpression();
|
|
11647
|
-
if (expr.getKind() ===
|
|
11677
|
+
if (expr.getKind() === SyntaxKind10.Identifier) {
|
|
11648
11678
|
calledNames.add(expr.getText());
|
|
11649
11679
|
}
|
|
11650
11680
|
}
|
|
11651
11681
|
const exported = [];
|
|
11652
11682
|
for (const fn of sourceFile.getDescendantsOfKind(
|
|
11653
|
-
|
|
11683
|
+
SyntaxKind10.FunctionDeclaration
|
|
11654
11684
|
)) {
|
|
11655
11685
|
const name = fn.getName();
|
|
11656
11686
|
if (name && calledNames.has(name) && fn.isExported()) {
|
|
@@ -11661,9 +11691,9 @@ function getExportedDependencyNames(target, sourceFile) {
|
|
|
11661
11691
|
}
|
|
11662
11692
|
|
|
11663
11693
|
// src/commands/refactor/extract/getStatementNames.ts
|
|
11664
|
-
import { SyntaxKind as
|
|
11694
|
+
import { SyntaxKind as SyntaxKind11 } from "ts-morph";
|
|
11665
11695
|
function getStatementNames(node) {
|
|
11666
|
-
if (node.getKind() ===
|
|
11696
|
+
if (node.getKind() === SyntaxKind11.VariableStatement) {
|
|
11667
11697
|
const stmt = node;
|
|
11668
11698
|
return stmt.getDeclarations().map((d) => d.getName());
|
|
11669
11699
|
}
|
|
@@ -11673,7 +11703,7 @@ function getStatementNames(node) {
|
|
|
11673
11703
|
|
|
11674
11704
|
// src/commands/refactor/extract/resolveImports.ts
|
|
11675
11705
|
import {
|
|
11676
|
-
SyntaxKind as
|
|
11706
|
+
SyntaxKind as SyntaxKind12
|
|
11677
11707
|
} from "ts-morph";
|
|
11678
11708
|
|
|
11679
11709
|
// src/commands/refactor/extract/matchImport.ts
|
|
@@ -11717,7 +11747,7 @@ function matchImport(importDecl, neededNames) {
|
|
|
11717
11747
|
function getReferencedNames(nodes) {
|
|
11718
11748
|
const names = /* @__PURE__ */ new Set();
|
|
11719
11749
|
for (const node of nodes) {
|
|
11720
|
-
for (const id of node.getDescendantsOfKind(
|
|
11750
|
+
for (const id of node.getDescendantsOfKind(SyntaxKind12.Identifier)) {
|
|
11721
11751
|
names.add(id.getText());
|
|
11722
11752
|
}
|
|
11723
11753
|
}
|
|
@@ -11732,7 +11762,7 @@ function getLocallyDeclaredNames(functions) {
|
|
|
11732
11762
|
names.add(param.getName());
|
|
11733
11763
|
}
|
|
11734
11764
|
for (const varDecl of fn.getDescendantsOfKind(
|
|
11735
|
-
|
|
11765
|
+
SyntaxKind12.VariableDeclaration
|
|
11736
11766
|
)) {
|
|
11737
11767
|
names.add(varDecl.getName());
|
|
11738
11768
|
}
|
|
@@ -11887,16 +11917,16 @@ function rewriteImportPaths(imports, sourcePath, destPath) {
|
|
|
11887
11917
|
}
|
|
11888
11918
|
|
|
11889
11919
|
// src/commands/refactor/extract/sourceReferencesName.ts
|
|
11890
|
-
import { SyntaxKind as
|
|
11920
|
+
import { SyntaxKind as SyntaxKind13 } from "ts-morph";
|
|
11891
11921
|
var DECLARATION_KINDS = /* @__PURE__ */ new Set([
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11922
|
+
SyntaxKind13.FunctionDeclaration,
|
|
11923
|
+
SyntaxKind13.ImportSpecifier,
|
|
11924
|
+
SyntaxKind13.ExportSpecifier
|
|
11895
11925
|
]);
|
|
11896
11926
|
function isInsideExtractedFunction(node, extracted) {
|
|
11897
11927
|
let current = node;
|
|
11898
11928
|
while (current) {
|
|
11899
|
-
if (current.getKind() !==
|
|
11929
|
+
if (current.getKind() !== SyntaxKind13.FunctionDeclaration) {
|
|
11900
11930
|
current = current.getParent();
|
|
11901
11931
|
continue;
|
|
11902
11932
|
}
|
|
@@ -11908,7 +11938,7 @@ function isInsideExtractedFunction(node, extracted) {
|
|
|
11908
11938
|
}
|
|
11909
11939
|
function sourceReferencesName(sourceFile, functionName, extractedNames) {
|
|
11910
11940
|
const extracted = new Set(extractedNames);
|
|
11911
|
-
for (const id of sourceFile.getDescendantsOfKind(
|
|
11941
|
+
for (const id of sourceFile.getDescendantsOfKind(SyntaxKind13.Identifier)) {
|
|
11912
11942
|
if (id.getText() !== functionName) continue;
|
|
11913
11943
|
const parent = id.getParent();
|
|
11914
11944
|
if (!parent || DECLARATION_KINDS.has(parent.getKind())) continue;
|
|
@@ -12139,24 +12169,24 @@ async function rename(source, destination, options2 = {}) {
|
|
|
12139
12169
|
import chalk135 from "chalk";
|
|
12140
12170
|
|
|
12141
12171
|
// src/commands/refactor/renameSymbol/findSymbol.ts
|
|
12142
|
-
import { SyntaxKind as
|
|
12172
|
+
import { SyntaxKind as SyntaxKind14 } from "ts-morph";
|
|
12143
12173
|
var declarationKinds = [
|
|
12144
|
-
|
|
12145
|
-
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
|
|
12174
|
+
SyntaxKind14.VariableDeclaration,
|
|
12175
|
+
SyntaxKind14.FunctionDeclaration,
|
|
12176
|
+
SyntaxKind14.ClassDeclaration,
|
|
12177
|
+
SyntaxKind14.InterfaceDeclaration,
|
|
12178
|
+
SyntaxKind14.TypeAliasDeclaration,
|
|
12179
|
+
SyntaxKind14.EnumDeclaration,
|
|
12180
|
+
SyntaxKind14.PropertyDeclaration,
|
|
12181
|
+
SyntaxKind14.MethodDeclaration,
|
|
12182
|
+
SyntaxKind14.Parameter
|
|
12153
12183
|
];
|
|
12154
12184
|
function isDeclaration(identifier) {
|
|
12155
12185
|
const parent = identifier.getParent();
|
|
12156
12186
|
return parent !== void 0 && declarationKinds.includes(parent.getKind());
|
|
12157
12187
|
}
|
|
12158
12188
|
function findSymbol(sourceFile, symbolName) {
|
|
12159
|
-
for (const id of sourceFile.getDescendantsOfKind(
|
|
12189
|
+
for (const id of sourceFile.getDescendantsOfKind(SyntaxKind14.Identifier)) {
|
|
12160
12190
|
if (id.getText() === symbolName && isDeclaration(id)) return id;
|
|
12161
12191
|
}
|
|
12162
12192
|
return void 0;
|