@anraktech/sync 0.9.0 → 0.10.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/cli.js +36 -15
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -980,28 +980,49 @@ function startAIAgent(ctx) {
980
980
  { role: "system", content: buildSystemPrompt(ctx.config) }
981
981
  ];
982
982
  const rl = createInterface({ input: stdin, output: stdout });
983
- const cols = Math.min(process.stdout.columns || 70, 70);
984
- const line = chalk2.dim("\u2500".repeat(cols));
983
+ const W = Math.min(process.stdout.columns || 60, 60);
985
984
  const watchDisplay = ctx.config.watchFolder.startsWith(HOME) ? "~" + ctx.config.watchFolder.slice(HOME.length) : ctx.config.watchFolder;
986
985
  const stats = ctx.bootStats;
987
- console.log("");
988
- console.log(line);
989
- console.log("");
990
- console.log(` ${chalk2.bold("AnrakLegal Sync")} ${chalk2.dim(`v${PKG_VERSION}`)}`);
991
- console.log("");
992
- console.log(` ${chalk2.dim("Folder")} ${watchDisplay}`);
993
- console.log(` ${chalk2.dim("Server")} ${ctx.config.apiUrl}`);
986
+ const pad = (s, len) => {
987
+ const visible = s.replace(/\x1b\[[0-9;]*m/g, "");
988
+ const diff = len - visible.length;
989
+ return diff > 0 ? s + " ".repeat(diff) : s;
990
+ };
991
+ const inner = W - 4;
992
+ const title = ` AnrakLegal Sync v${PKG_VERSION} `;
993
+ const topRest = W - 2 - title.length;
994
+ const topLeft = Math.max(1, 1);
995
+ const topRight = Math.max(1, topRest - topLeft);
996
+ const top = chalk2.dim("\u256D" + "\u2500".repeat(topLeft)) + chalk2.bold(title) + chalk2.dim("\u2500".repeat(topRight) + "\u256E");
997
+ const bot = chalk2.dim("\u2570" + "\u2500".repeat(W - 2) + "\u256F");
998
+ const empty = chalk2.dim("\u2502") + " ".repeat(W - 2) + chalk2.dim("\u2502");
999
+ const row = (s) => chalk2.dim("\u2502") + " " + pad(s, inner) + " " + chalk2.dim("\u2502");
1000
+ let statusLine = "";
994
1001
  if (stats) {
995
- console.log(` ${chalk2.dim("Cases")} ${stats.cases} on server`);
1002
+ const parts = [`${stats.cases} case${stats.cases !== 1 ? "s" : ""}`];
996
1003
  if (stats.scanned > 0) {
997
- console.log(` ${chalk2.dim("Files")} ${stats.scanned} scanned${stats.queued > 0 ? `, ${chalk2.yellow(String(stats.queued))} synced` : chalk2.green(" \xB7 up to date")}`);
1004
+ parts.push(`${stats.scanned} files scanned`);
998
1005
  }
1006
+ if (stats.queued > 0) {
1007
+ parts.push(chalk2.yellow(`${stats.queued} synced`));
1008
+ } else {
1009
+ parts.push(chalk2.green("up to date"));
1010
+ }
1011
+ statusLine = parts.join(chalk2.dim(" \xB7 "));
999
1012
  }
1000
1013
  console.log("");
1001
- console.log(line);
1002
- console.log("");
1003
- console.log(chalk2.dim(" Type a message to get started. Examples:"));
1004
- console.log(chalk2.dim(' "show my cases" "look at downloads" "sync my desktop"'));
1014
+ console.log(top);
1015
+ console.log(empty);
1016
+ console.log(row(`${chalk2.dim("Folder")} ${watchDisplay}`));
1017
+ console.log(row(`${chalk2.dim("Server")} ${ctx.config.apiUrl}`));
1018
+ if (statusLine) {
1019
+ console.log(row(`${chalk2.dim("Status")} ${statusLine}`));
1020
+ }
1021
+ console.log(empty);
1022
+ console.log(row(chalk2.dim("Type naturally to manage your files.")));
1023
+ console.log(row(chalk2.dim('"show my cases" \xB7 "look at downloads" \xB7 "sync"')));
1024
+ console.log(empty);
1025
+ console.log(bot);
1005
1026
  console.log("");
1006
1027
  const PROMPT = `${chalk2.bold.blue("\u276F")} `;
1007
1028
  async function promptLoop() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anraktech/sync",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "AnrakLegal desktop file sync agent — watches local folders and syncs to case management",
5
5
  "type": "module",
6
6
  "bin": {