@staff0rd/assist 0.249.0 → 0.251.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/README.md +1 -1
- package/dist/commands/sessions/web/bundle.js +51 -51
- package/dist/index.js +37 -8
- 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.251.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -16303,15 +16303,23 @@ function requireRunConfigs() {
|
|
|
16303
16303
|
if (configs.length === 0) return exitNoRunConfigs();
|
|
16304
16304
|
return configs;
|
|
16305
16305
|
}
|
|
16306
|
-
function
|
|
16306
|
+
function lookupRunConfig(name) {
|
|
16307
16307
|
const configs = requireRunConfigs();
|
|
16308
16308
|
const exact = configs.find((r) => r.name === name);
|
|
16309
|
-
if (exact) return exact;
|
|
16309
|
+
if (exact) return { kind: "match", config: exact };
|
|
16310
16310
|
const suffixMatches = configs.filter((r) => r.name.endsWith(`:${name}`));
|
|
16311
|
-
if (suffixMatches.length === 1)
|
|
16311
|
+
if (suffixMatches.length === 1)
|
|
16312
|
+
return { kind: "match", config: suffixMatches[0] };
|
|
16312
16313
|
if (suffixMatches.length > 1)
|
|
16313
|
-
return
|
|
16314
|
-
return
|
|
16314
|
+
return { kind: "ambiguous", matches: suffixMatches };
|
|
16315
|
+
return { kind: "not-found" };
|
|
16316
|
+
}
|
|
16317
|
+
function findRunConfig(name) {
|
|
16318
|
+
const result = lookupRunConfig(name);
|
|
16319
|
+
if (result.kind === "match") return result.config;
|
|
16320
|
+
if (result.kind === "ambiguous")
|
|
16321
|
+
return exitWithAmbiguousConfig(name, result.matches);
|
|
16322
|
+
return exitWithConfigNotFound(name, requireRunConfigs());
|
|
16315
16323
|
}
|
|
16316
16324
|
|
|
16317
16325
|
// src/commands/run/formatConfiguredCommands.ts
|
|
@@ -16429,12 +16437,30 @@ function execRunConfig(config, args) {
|
|
|
16429
16437
|
config.quiet
|
|
16430
16438
|
);
|
|
16431
16439
|
}
|
|
16432
|
-
function
|
|
16440
|
+
function parseBacklogRunOptions(id, args) {
|
|
16441
|
+
let allowEdits = true;
|
|
16442
|
+
for (const arg of args) {
|
|
16443
|
+
if (arg === "--write" || arg === "-w") allowEdits = true;
|
|
16444
|
+
else if (arg === "--no-write") allowEdits = false;
|
|
16445
|
+
else {
|
|
16446
|
+
console.error(`error: unexpected argument '${arg}' for 'run ${id}'`);
|
|
16447
|
+
process.exit(1);
|
|
16448
|
+
}
|
|
16449
|
+
}
|
|
16450
|
+
return { allowEdits };
|
|
16451
|
+
}
|
|
16452
|
+
async function run3(name, args) {
|
|
16433
16453
|
if (!name) {
|
|
16434
16454
|
console.error("error: missing required argument 'name'");
|
|
16435
16455
|
console.error(formatConfiguredCommands());
|
|
16436
16456
|
process.exit(1);
|
|
16437
16457
|
}
|
|
16458
|
+
if (/^\d+$/.test(name) && lookupRunConfig(name).kind === "not-found") {
|
|
16459
|
+
const options2 = parseBacklogRunOptions(name, args);
|
|
16460
|
+
pullIfConfigured();
|
|
16461
|
+
await run2(name, options2);
|
|
16462
|
+
return;
|
|
16463
|
+
}
|
|
16438
16464
|
execRunConfig(findRunConfig(name), args);
|
|
16439
16465
|
}
|
|
16440
16466
|
|
|
@@ -16603,7 +16629,10 @@ function remove() {
|
|
|
16603
16629
|
|
|
16604
16630
|
// src/commands/run/registerRun.ts
|
|
16605
16631
|
function registerRun(program2) {
|
|
16606
|
-
const runCommand = program2.command("run").description("Run a configured command from assist.yml").argument("[name]", "Name of the configured command").argument("[args...]", "Arguments to pass to the command").allowUnknownOption().addHelpText(
|
|
16632
|
+
const runCommand = program2.command("run").description("Run a configured command from assist.yml").argument("[name]", "Name of the configured command").argument("[args...]", "Arguments to pass to the command").allowUnknownOption().addHelpText(
|
|
16633
|
+
"after",
|
|
16634
|
+
"\nA purely numeric name with no matching command is an alias for\n'assist backlog run <id>' (forwards --write/--no-write/-w)."
|
|
16635
|
+
).addHelpText("after", () => formatConfiguredCommands()).action((name, args) => run3(name, args));
|
|
16607
16636
|
runCommand.command("list").description("List configured run commands").option("-v, --verbose", "Show full command details").action((opts) => listRunConfigs(!!opts.verbose));
|
|
16608
16637
|
runCommand.command("add").description("Add a new run configuration to assist.yml").argument("<name>", "Name for the run configuration").argument("<command>", "Command to execute").argument("[args...]", "Static args to pass to the command").option(
|
|
16609
16638
|
"--cwd <dir>",
|