@staff0rd/assist 0.89.1 → 0.90.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.
Files changed (2) hide show
  1. package/dist/index.js +22 -13
  2. 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.89.1",
9
+ version: "0.90.0",
10
10
  type: "module",
11
11
  main: "dist/index.js",
12
12
  bin: {
@@ -2250,6 +2250,11 @@ function printVerboseDetails(item) {
2250
2250
  }
2251
2251
  console.log();
2252
2252
  }
2253
+ function filterItems(items, options2) {
2254
+ if (options2.status) return items.filter((i) => i.status === options2.status);
2255
+ if (!options2.all) return items.filter((i) => i.status !== "done");
2256
+ return items;
2257
+ }
2253
2258
  async function list2(options2) {
2254
2259
  const backlogPath = getBacklogPath();
2255
2260
  if (!existsSync14(backlogPath)) {
@@ -2260,10 +2265,7 @@ async function list2(options2) {
2260
2265
  );
2261
2266
  return;
2262
2267
  }
2263
- let items = loadBacklog();
2264
- if (options2.status) {
2265
- items = items.filter((item) => item.status === options2.status);
2266
- }
2268
+ const items = filterItems(loadBacklog(), options2);
2267
2269
  if (items.length === 0) {
2268
2270
  console.log(chalk27.dim("Backlog is empty."));
2269
2271
  return;
@@ -2460,7 +2462,7 @@ async function web(options2) {
2460
2462
  function registerBacklog(program2) {
2461
2463
  const backlogCommand = program2.command("backlog").description("Manage a backlog of work items").action(() => web({ port: "3000" }));
2462
2464
  backlogCommand.command("init").description("Create an empty assist.backlog.yml").action(init6);
2463
- backlogCommand.command("list").description("List all backlog items").option("--status <type>", "Filter by status (todo, in-progress, done)").option("-v, --verbose", "Show all item details").action(list2);
2465
+ backlogCommand.command("list").description("List all backlog items").option("--status <type>", "Filter by status (todo, in-progress, done)").option("-a, --all", "Include done items").option("-v, --verbose", "Show all item details").action(list2);
2464
2466
  backlogCommand.command("add").description("Add a new backlog item").action(add);
2465
2467
  backlogCommand.command("start <id>").description("Set a backlog item to in-progress").action(start);
2466
2468
  backlogCommand.command("done <id>").description("Set a backlog item to done").action(done);
@@ -5968,9 +5970,16 @@ function run2(name, args) {
5968
5970
  }
5969
5971
 
5970
5972
  // src/commands/statusLine.ts
5973
+ import chalk52 from "chalk";
5971
5974
  function formatNumber(num) {
5972
5975
  return num.toLocaleString("en-US");
5973
5976
  }
5977
+ function colorizePercent(pct) {
5978
+ const label2 = `${pct}%`;
5979
+ if (pct > 80) return chalk52.red(label2);
5980
+ if (pct > 40) return chalk52.yellow(label2);
5981
+ return label2;
5982
+ }
5974
5983
  async function statusLine() {
5975
5984
  const inputData = await readStdin();
5976
5985
  const data = JSON.parse(inputData);
@@ -5981,7 +5990,7 @@ async function statusLine() {
5981
5990
  const formattedInput = formatNumber(totalInput);
5982
5991
  const formattedOutput = formatNumber(totalOutput);
5983
5992
  console.log(
5984
- `${model} | Tokens - ${formattedOutput} \u2191 : ${formattedInput} \u2193 | Context - ${usedPct}%`
5993
+ `${model} | Tokens - ${formattedOutput} \u2191 : ${formattedInput} \u2193 | Context - ${colorizePercent(usedPct)}`
5985
5994
  );
5986
5995
  }
5987
5996
 
@@ -5994,7 +6003,7 @@ import { fileURLToPath as fileURLToPath5 } from "url";
5994
6003
  // src/commands/sync/syncClaudeMd.ts
5995
6004
  import * as fs21 from "fs";
5996
6005
  import * as path27 from "path";
5997
- import chalk52 from "chalk";
6006
+ import chalk53 from "chalk";
5998
6007
  async function syncClaudeMd(claudeDir, targetBase) {
5999
6008
  const source = path27.join(claudeDir, "CLAUDE.md");
6000
6009
  const target = path27.join(targetBase, "CLAUDE.md");
@@ -6003,12 +6012,12 @@ async function syncClaudeMd(claudeDir, targetBase) {
6003
6012
  const targetContent = fs21.readFileSync(target, "utf-8");
6004
6013
  if (sourceContent !== targetContent) {
6005
6014
  console.log(
6006
- chalk52.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
6015
+ chalk53.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
6007
6016
  );
6008
6017
  console.log();
6009
6018
  printDiff(targetContent, sourceContent);
6010
6019
  const confirm = await promptConfirm(
6011
- chalk52.red("Overwrite existing CLAUDE.md?"),
6020
+ chalk53.red("Overwrite existing CLAUDE.md?"),
6012
6021
  false
6013
6022
  );
6014
6023
  if (!confirm) {
@@ -6024,7 +6033,7 @@ async function syncClaudeMd(claudeDir, targetBase) {
6024
6033
  // src/commands/sync/syncSettings.ts
6025
6034
  import * as fs22 from "fs";
6026
6035
  import * as path28 from "path";
6027
- import chalk53 from "chalk";
6036
+ import chalk54 from "chalk";
6028
6037
  async function syncSettings(claudeDir, targetBase, options2) {
6029
6038
  const source = path28.join(claudeDir, "settings.json");
6030
6039
  const target = path28.join(targetBase, "settings.json");
@@ -6036,14 +6045,14 @@ async function syncSettings(claudeDir, targetBase, options2) {
6036
6045
  if (normalizedSource !== normalizedTarget) {
6037
6046
  if (!options2?.yes) {
6038
6047
  console.log(
6039
- chalk53.yellow(
6048
+ chalk54.yellow(
6040
6049
  "\n\u26A0\uFE0F Warning: settings.json differs from existing file"
6041
6050
  )
6042
6051
  );
6043
6052
  console.log();
6044
6053
  printDiff(targetContent, sourceContent);
6045
6054
  const confirm = await promptConfirm(
6046
- chalk53.red("Overwrite existing settings.json?"),
6055
+ chalk54.red("Overwrite existing settings.json?"),
6047
6056
  false
6048
6057
  );
6049
6058
  if (!confirm) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staff0rd/assist",
3
- "version": "0.89.1",
3
+ "version": "0.90.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "bin": {