@task-mcp/cli 1.0.7 → 1.0.9
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/package.json +3 -3
- package/src/ansi.ts +44 -0
- package/src/commands/dashboard.ts +9 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@task-mcp/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Zero-dependency CLI for task-mcp with Bun native visualization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"directory": "packages/cli"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@task-mcp/mcp-server": "^1.0.
|
|
34
|
-
"@task-mcp/shared": "^1.0.
|
|
33
|
+
"@task-mcp/mcp-server": "^1.0.10",
|
|
34
|
+
"@task-mcp/shared": "^1.0.9"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/bun": "^1.1.14",
|
package/src/ansi.ts
CHANGED
|
@@ -378,6 +378,50 @@ export const icons = {
|
|
|
378
378
|
info: c.cyan("ℹ"),
|
|
379
379
|
};
|
|
380
380
|
|
|
381
|
+
/**
|
|
382
|
+
* Place multiple boxes side by side
|
|
383
|
+
* Each box is a multi-line string
|
|
384
|
+
*/
|
|
385
|
+
export function sideBySide(boxes: string[], gap: number = 2): string {
|
|
386
|
+
// Split each box into lines
|
|
387
|
+
const boxLines = boxes.map(b => b.split("\n"));
|
|
388
|
+
|
|
389
|
+
// Find max height
|
|
390
|
+
const maxHeight = Math.max(...boxLines.map(lines => lines.length));
|
|
391
|
+
|
|
392
|
+
// Find width of each box (using first line as reference)
|
|
393
|
+
const boxWidths = boxLines.map(lines => {
|
|
394
|
+
return Math.max(...lines.map(l => displayWidth(l)));
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// Pad each box to max height
|
|
398
|
+
const paddedBoxLines = boxLines.map((lines, i) => {
|
|
399
|
+
const width = boxWidths[i];
|
|
400
|
+
while (lines.length < maxHeight) {
|
|
401
|
+
lines.push(" ".repeat(width));
|
|
402
|
+
}
|
|
403
|
+
// Ensure each line is padded to box width
|
|
404
|
+
return lines.map(line => {
|
|
405
|
+
const lineWidth = displayWidth(line);
|
|
406
|
+
if (lineWidth < width) {
|
|
407
|
+
return line + " ".repeat(width - lineWidth);
|
|
408
|
+
}
|
|
409
|
+
return line;
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
// Combine lines horizontally
|
|
414
|
+
const result: string[] = [];
|
|
415
|
+
const gapStr = " ".repeat(gap);
|
|
416
|
+
|
|
417
|
+
for (let i = 0; i < maxHeight; i++) {
|
|
418
|
+
const lineParts = paddedBoxLines.map(lines => lines[i] ?? "");
|
|
419
|
+
result.push(lineParts.join(gapStr));
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return result.join("\n");
|
|
423
|
+
}
|
|
424
|
+
|
|
381
425
|
/**
|
|
382
426
|
* ASCII art text (simple implementation)
|
|
383
427
|
*/
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
pad,
|
|
15
15
|
truncate,
|
|
16
16
|
stripAnsi,
|
|
17
|
+
sideBySide,
|
|
17
18
|
type TableColumn,
|
|
18
19
|
} from "../ansi.js";
|
|
19
20
|
import {
|
|
@@ -428,19 +429,16 @@ export async function dashboard(projectId?: string): Promise<void> {
|
|
|
428
429
|
const analysisWidget = renderAnalysisWidget(tasks);
|
|
429
430
|
const inboxWidget = await renderInboxWidget();
|
|
430
431
|
|
|
431
|
-
// Print widgets
|
|
432
|
-
|
|
432
|
+
// Print widgets in 3-column grid layout
|
|
433
|
+
// Row 1: Overview | Schedule | Inbox
|
|
434
|
+
console.log(sideBySide([overview, timeWidget, inboxWidget]));
|
|
433
435
|
console.log();
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
console.log(
|
|
437
|
-
console.log();
|
|
438
|
-
console.log(depWidget);
|
|
439
|
-
console.log();
|
|
440
|
-
console.log(criticalPathWidget);
|
|
441
|
-
console.log();
|
|
442
|
-
console.log(analysisWidget);
|
|
436
|
+
|
|
437
|
+
// Row 2: Work Queue | Critical Path | Analysis
|
|
438
|
+
console.log(sideBySide([depWidget, criticalPathWidget, analysisWidget]));
|
|
443
439
|
console.log();
|
|
440
|
+
|
|
441
|
+
// Row 3: Hierarchy (full width or single)
|
|
444
442
|
console.log(hierarchyWidget);
|
|
445
443
|
console.log();
|
|
446
444
|
|