@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.
- package/dist/cli.js +36 -15
- 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
|
|
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
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
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
|
-
|
|
1002
|
+
const parts = [`${stats.cases} case${stats.cases !== 1 ? "s" : ""}`];
|
|
996
1003
|
if (stats.scanned > 0) {
|
|
997
|
-
|
|
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(
|
|
1002
|
-
console.log(
|
|
1003
|
-
console.log(chalk2.dim("
|
|
1004
|
-
console.log(chalk2.dim(
|
|
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() {
|