@kaban-board/tui 0.1.2 → 0.2.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/index.js +20 -20
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
2
|
-
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __getProtoOf = Object.getPrototypeOf;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
@@ -16,7 +16,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
16
16
|
});
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
-
var __require =
|
|
19
|
+
var __require = import.meta.require;
|
|
20
20
|
|
|
21
21
|
// src/index.ts
|
|
22
22
|
import { BoardService as BoardService2, createDb as createDb2, TaskService } from "@kaban-board/core";
|
|
@@ -59,7 +59,7 @@ import { BoxRenderable, TextRenderable } from "@opentui/core";
|
|
|
59
59
|
function truncate(str, maxLength) {
|
|
60
60
|
if (str.length <= maxLength)
|
|
61
61
|
return str;
|
|
62
|
-
return `${str.slice(0, maxLength - 1)}
|
|
62
|
+
return `${str.slice(0, maxLength - 1)}\u2026`;
|
|
63
63
|
}
|
|
64
64
|
function truncateMiddle(str, maxLength) {
|
|
65
65
|
if (str.length <= maxLength)
|
|
@@ -95,9 +95,9 @@ function formatRelativeTime(date) {
|
|
|
95
95
|
}
|
|
96
96
|
function createSectionDivider(renderer, options) {
|
|
97
97
|
const { label, width, id } = options;
|
|
98
|
-
const labelWithPadding =
|
|
98
|
+
const labelWithPadding = `\u2500 ${label} `;
|
|
99
99
|
const remainingWidth = width - labelWithPadding.length;
|
|
100
|
-
const line = "
|
|
100
|
+
const line = "\u2500".repeat(Math.max(0, remainingWidth));
|
|
101
101
|
const row = new BoxRenderable(renderer, {
|
|
102
102
|
id: `${id}-divider`,
|
|
103
103
|
width: "100%",
|
|
@@ -1227,7 +1227,7 @@ var DESC_VISIBLE_LINES = 4;
|
|
|
1227
1227
|
var LABEL_WIDTH = 12;
|
|
1228
1228
|
function formatDate(date) {
|
|
1229
1229
|
if (!date)
|
|
1230
|
-
return "
|
|
1230
|
+
return "\u2014";
|
|
1231
1231
|
return date.toLocaleString("en-US", {
|
|
1232
1232
|
month: "short",
|
|
1233
1233
|
day: "numeric",
|
|
@@ -1333,7 +1333,7 @@ async function showViewTaskModal(state, actions, taskIdOverride) {
|
|
|
1333
1333
|
});
|
|
1334
1334
|
const columnBullet = new TextRenderable12(renderer, {
|
|
1335
1335
|
id: "view-column-bullet",
|
|
1336
|
-
content: "
|
|
1336
|
+
content: "\u25CF ",
|
|
1337
1337
|
fg: statusColor
|
|
1338
1338
|
});
|
|
1339
1339
|
const columnValue = new TextRenderable12(renderer, {
|
|
@@ -1357,7 +1357,7 @@ async function showViewTaskModal(state, actions, taskIdOverride) {
|
|
|
1357
1357
|
});
|
|
1358
1358
|
const assigneeValue = new TextRenderable12(renderer, {
|
|
1359
1359
|
id: "view-assignee-value",
|
|
1360
|
-
content: task.assignedTo ?? "
|
|
1360
|
+
content: task.assignedTo ?? "\u2014 unassigned",
|
|
1361
1361
|
fg: task.assignedTo ? COLORS.success : COLORS.textDim
|
|
1362
1362
|
});
|
|
1363
1363
|
assigneeRow.add(assigneeLabel);
|
|
@@ -1393,7 +1393,7 @@ async function showViewTaskModal(state, actions, taskIdOverride) {
|
|
|
1393
1393
|
});
|
|
1394
1394
|
const labelsValue = new TextRenderable12(renderer, {
|
|
1395
1395
|
id: "view-labels-value",
|
|
1396
|
-
content: "
|
|
1396
|
+
content: "\u2014 none",
|
|
1397
1397
|
fg: COLORS.textDim
|
|
1398
1398
|
});
|
|
1399
1399
|
labelsRow.add(labelsLabel);
|
|
@@ -1475,7 +1475,7 @@ async function showViewTaskModal(state, actions, taskIdOverride) {
|
|
|
1475
1475
|
}
|
|
1476
1476
|
function updateDescriptionContent(scrollOffset) {
|
|
1477
1477
|
if (!hasDescription) {
|
|
1478
|
-
descLineRenderables[0].content = "
|
|
1478
|
+
descLineRenderables[0].content = "\u2014 no description";
|
|
1479
1479
|
descLineRenderables[0].fg = COLORS.textDim;
|
|
1480
1480
|
for (let i = 1;i < DESC_VISIBLE_LINES; i++) {
|
|
1481
1481
|
descLineRenderables[i].content = " ";
|
|
@@ -1491,10 +1491,10 @@ async function showViewTaskModal(state, actions, taskIdOverride) {
|
|
|
1491
1491
|
let displayContent = truncate(lineContent, DIALOG_WIDTH2 - 12);
|
|
1492
1492
|
if (isLastLine && hasMore) {
|
|
1493
1493
|
const remaining = totalDescLines - scrollOffset - DESC_VISIBLE_LINES;
|
|
1494
|
-
displayContent = `${truncate(lineContent, DIALOG_WIDTH2 - 18)}
|
|
1494
|
+
displayContent = `${truncate(lineContent, DIALOG_WIDTH2 - 18)} \u25BC ${remaining}+`;
|
|
1495
1495
|
}
|
|
1496
1496
|
if (i === 0 && hasLess) {
|
|
1497
|
-
displayContent =
|
|
1497
|
+
displayContent = `\u25B2 ${scrollOffset}+ ${truncate(lineContent, DIALOG_WIDTH2 - 18)}`;
|
|
1498
1498
|
}
|
|
1499
1499
|
descLineRenderables[i].content = displayContent || " ";
|
|
1500
1500
|
descLineRenderables[i].fg = i === 0 && hasLess || isLastLine && hasMore ? COLORS.textDim : COLORS.text;
|
|
@@ -1508,7 +1508,7 @@ async function showViewTaskModal(state, actions, taskIdOverride) {
|
|
|
1508
1508
|
});
|
|
1509
1509
|
const footerLine = new TextRenderable12(renderer, {
|
|
1510
1510
|
id: "view-footer-line",
|
|
1511
|
-
content: "
|
|
1511
|
+
content: "\u2500".repeat(DIALOG_WIDTH2 - 4),
|
|
1512
1512
|
fg: COLORS.border
|
|
1513
1513
|
});
|
|
1514
1514
|
footerDivider.add(footerLine);
|
|
@@ -1607,8 +1607,8 @@ async function copyTaskId(state) {
|
|
|
1607
1607
|
state.viewTaskRuntime.copyTimeoutId = null;
|
|
1608
1608
|
}
|
|
1609
1609
|
try {
|
|
1610
|
-
const { exec } = await import("
|
|
1611
|
-
const { promisify } = await import("
|
|
1610
|
+
const { exec } = await import("child_process");
|
|
1611
|
+
const { promisify } = await import("util");
|
|
1612
1612
|
const execAsync = promisify(exec);
|
|
1613
1613
|
if (process.platform === "darwin") {
|
|
1614
1614
|
await execAsync(`echo -n "${taskId}" | pbcopy`);
|
|
@@ -1618,7 +1618,7 @@ async function copyTaskId(state) {
|
|
|
1618
1618
|
const originalContent = idValue.content.toString();
|
|
1619
1619
|
idValue.content = "Copied!";
|
|
1620
1620
|
idValue.fg = COLORS.success;
|
|
1621
|
-
copyHint.content = "
|
|
1621
|
+
copyHint.content = "\u2713";
|
|
1622
1622
|
copyHint.fg = COLORS.success;
|
|
1623
1623
|
state.viewTaskRuntime.copyTimeoutId = setTimeout(() => {
|
|
1624
1624
|
if (state.viewTaskRuntime) {
|
|
@@ -1632,7 +1632,7 @@ async function copyTaskId(state) {
|
|
|
1632
1632
|
} catch {
|
|
1633
1633
|
idValue.content = "Failed!";
|
|
1634
1634
|
idValue.fg = COLORS.danger;
|
|
1635
|
-
copyHint.content = "
|
|
1635
|
+
copyHint.content = "\u2717";
|
|
1636
1636
|
copyHint.fg = COLORS.danger;
|
|
1637
1637
|
state.viewTaskRuntime.copyTimeoutId = setTimeout(() => {
|
|
1638
1638
|
if (state.viewTaskRuntime) {
|
|
@@ -1842,8 +1842,8 @@ function handleKeypress(state, key) {
|
|
|
1842
1842
|
}
|
|
1843
1843
|
|
|
1844
1844
|
// src/lib/project.ts
|
|
1845
|
-
import { existsSync, mkdirSync, writeFileSync } from "
|
|
1846
|
-
import { resolve } from "
|
|
1845
|
+
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
1846
|
+
import { resolve } from "path";
|
|
1847
1847
|
import { BoardService, createDb, DEFAULT_CONFIG, initializeSchema } from "@kaban-board/core";
|
|
1848
1848
|
function findKabanRoot(startDir) {
|
|
1849
1849
|
let dir = startDir;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaban-board/tui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Terminal User Interface for Kaban - Kanban for AI Agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target
|
|
13
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target bun --packages external && chmod +x ./dist/index.js",
|
|
14
14
|
"build:bin": "bun build --compile --minify ./src/index.ts --outfile ./dist/kaban-tui",
|
|
15
15
|
"dev": "bun run ./src/index.ts",
|
|
16
16
|
"test": "bun test",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepublishOnly": "npm run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@kaban-board/core": "0.
|
|
21
|
+
"@kaban-board/core": "0.2.0",
|
|
22
22
|
"@opentui/core": "^0.1.69"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"typescript": "^5.0.0"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
|
-
"
|
|
29
|
+
"bun": ">=1.0.0"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"url": "https://github.com/beshkenadze/kaban/issues"
|
|
39
39
|
},
|
|
40
40
|
"license": "MIT",
|
|
41
|
+
"author": "Aleksandr Beshkenadze <beshkenadze@gmail.com>",
|
|
41
42
|
"keywords": [
|
|
42
43
|
"kanban",
|
|
43
44
|
"tui",
|