brainfile 0.19.0 → 0.20.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/README.md +18 -24
- package/dist/__tests__/helpers/mcp-wire.d.ts +45 -0
- package/dist/__tests__/helpers/mcp-wire.d.ts.map +1 -0
- package/dist/__tests__/helpers/mcp-wire.js +133 -0
- package/dist/__tests__/helpers/mcp-wire.js.map +1 -0
- package/dist/{chunk-YTFLC673.mjs → chunk-UOCQBEEW.mjs} +1486 -992
- package/dist/cli.mjs +916 -776
- package/dist/commands/adr.d.ts +1 -9
- package/dist/commands/adr.d.ts.map +1 -1
- package/dist/commands/adr.js +11 -88
- package/dist/commands/adr.js.map +1 -1
- package/dist/commands/archive.d.ts +2 -5
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +43 -11
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/brief.d.ts +31 -0
- package/dist/commands/brief.d.ts.map +1 -0
- package/dist/commands/brief.js +151 -0
- package/dist/commands/brief.js.map +1 -0
- package/dist/commands/complete.js +1 -1
- package/dist/commands/complete.js.map +1 -1
- package/dist/commands/log.js +31 -18
- package/dist/commands/log.js.map +1 -1
- package/dist/commands/mcp.d.ts +9 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +28 -17
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/migrate.js +10 -12
- package/dist/commands/migrate.js.map +1 -1
- package/dist/mcp/schemas.d.ts +297 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +328 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/tools/brief_tool.d.ts +14 -0
- package/dist/mcp/tools/brief_tool.d.ts.map +1 -0
- package/dist/mcp/tools/brief_tool.js +58 -0
- package/dist/mcp/tools/brief_tool.js.map +1 -0
- package/dist/mcp/tools/contract_tool.d.ts.map +1 -1
- package/dist/mcp/tools/contract_tool.js +37 -13
- package/dist/mcp/tools/contract_tool.js.map +1 -1
- package/dist/mcp/tools/get_task_tool.d.ts.map +1 -1
- package/dist/mcp/tools/get_task_tool.js +7 -2
- package/dist/mcp/tools/get_task_tool.js.map +1 -1
- package/dist/mcp/tools/list_tasks_tool.d.ts.map +1 -1
- package/dist/mcp/tools/list_tasks_tool.js +9 -3
- package/dist/mcp/tools/list_tasks_tool.js.map +1 -1
- package/dist/mcp/tools/search_tool.d.ts.map +1 -1
- package/dist/mcp/tools/search_tool.js +17 -4
- package/dist/mcp/tools/search_tool.js.map +1 -1
- package/dist/mcp/tools/subtask_tool.d.ts.map +1 -1
- package/dist/mcp/tools/subtask_tool.js +47 -13
- package/dist/mcp/tools/subtask_tool.js.map +1 -1
- package/dist/mcp/tools/task_add_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_add_tool.js +7 -2
- package/dist/mcp/tools/task_add_tool.js.map +1 -1
- package/dist/mcp/tools/task_complete_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_complete_tool.js +34 -6
- package/dist/mcp/tools/task_complete_tool.js.map +1 -1
- package/dist/mcp/tools/task_delete_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_delete_tool.js +7 -2
- package/dist/mcp/tools/task_delete_tool.js.map +1 -1
- package/dist/mcp/tools/task_move_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_move_tool.js +15 -6
- package/dist/mcp/tools/task_move_tool.js.map +1 -1
- package/dist/mcp/tools/task_patch_tool.d.ts.map +1 -1
- package/dist/mcp/tools/task_patch_tool.js +18 -6
- package/dist/mcp/tools/task_patch_tool.js.map +1 -1
- package/dist/schemas/board.json +1 -1
- package/dist/tui/theme.d.ts +98 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +141 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/{tui-P56H4X7N.mjs → tui-H3RI22S4.mjs} +1593 -1934
- package/dist/utils/cli-error.d.ts +20 -0
- package/dist/utils/cli-error.d.ts.map +1 -1
- package/dist/utils/cli-error.js +36 -0
- package/dist/utils/cli-error.js.map +1 -1
- package/package.json +3 -3
- package/dist/commands/rules.d.ts +0 -68
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js +0 -322
- package/dist/commands/rules.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_patch_tool.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task_patch_tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"task_patch_tool.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/task_patch_tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAa9D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CA8FlF"}
|
|
@@ -39,6 +39,7 @@ const path = __importStar(require("path"));
|
|
|
39
39
|
const core_1 = require("@brainfile/core");
|
|
40
40
|
const v2_detect_1 = require("../../utils/v2-detect");
|
|
41
41
|
const helpers_1 = require("../helpers");
|
|
42
|
+
const schemas_1 = require("../schemas");
|
|
42
43
|
function registerTaskPatchTool(server, defaultFile) {
|
|
43
44
|
server.registerTool('task_patch', {
|
|
44
45
|
title: 'Patch Task',
|
|
@@ -55,7 +56,8 @@ function registerTaskPatchTool(server, defaultFile) {
|
|
|
55
56
|
dueDate: zod_1.z.string().nullable().optional().describe('New due date (null to remove)'),
|
|
56
57
|
relatedFiles: zod_1.z.array(zod_1.z.string()).nullable().optional().describe('Related file paths (null to remove)'),
|
|
57
58
|
parentId: zod_1.z.string().nullable().optional().describe('Parent task ID (null to remove)')
|
|
58
|
-
})
|
|
59
|
+
}),
|
|
60
|
+
outputSchema: schemas_1.taskPatchOutputSchema
|
|
59
61
|
}, async ({ file, taskId, task, title, description, priority, tags, assignee, dueDate, relatedFiles, parentId }) => {
|
|
60
62
|
const filePath = file || defaultFile;
|
|
61
63
|
const rawTaskIds = taskId ?? task;
|
|
@@ -94,18 +96,28 @@ function registerTaskPatchTool(server, defaultFile) {
|
|
|
94
96
|
}
|
|
95
97
|
results.push({ taskId: id, success: true });
|
|
96
98
|
}
|
|
99
|
+
const successCount = results.filter(r => r.success).length;
|
|
100
|
+
const failureCount = results.length - successCount;
|
|
101
|
+
// Always the batch shape, so a single-task patch and a batch patch parse
|
|
102
|
+
// identically. Only the text branches.
|
|
103
|
+
const output = { success: failureCount === 0, successCount, failureCount, results };
|
|
97
104
|
if (!isBatch) {
|
|
98
105
|
const single = results[0];
|
|
99
106
|
if (!single?.success) {
|
|
100
|
-
return {
|
|
107
|
+
return {
|
|
108
|
+
content: [{ type: 'text', text: `Error: ${single?.error || 'Task not found'}` }],
|
|
109
|
+
structuredContent: output,
|
|
110
|
+
isError: true,
|
|
111
|
+
};
|
|
101
112
|
}
|
|
102
|
-
return {
|
|
113
|
+
return {
|
|
114
|
+
content: [{ type: 'text', text: `Task ${taskIds[0]} updated successfully` }],
|
|
115
|
+
structuredContent: output,
|
|
116
|
+
};
|
|
103
117
|
}
|
|
104
|
-
const successCount = results.filter(r => r.success).length;
|
|
105
|
-
const failureCount = results.length - successCount;
|
|
106
|
-
const output = { success: failureCount === 0, successCount, failureCount, results };
|
|
107
118
|
return {
|
|
108
119
|
content: [{ type: 'text', text: JSON.stringify(output, null, 2) }],
|
|
120
|
+
structuredContent: output,
|
|
109
121
|
isError: failureCount > 0 && successCount === 0,
|
|
110
122
|
};
|
|
111
123
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task_patch_tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/task_patch_tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"task_patch_tool.js","sourceRoot":"","sources":["../../../src/mcp/tools/task_patch_tool.ts"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1B,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;YAC3E,iBAAiB,EAAE,MAAM;YACzB,OAAO,EAAE,YAAY,GAAG,CAAC,IAAI,YAAY,KAAK,CAAC;SAChD,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/schemas/board.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://brainfile.md/v1/board.json",
|
|
4
4
|
"title": "Brainfile Board Schema",
|
|
5
|
-
"description": "Schema for Kanban-style task boards. In v2 (per-task file architecture), the board file is config-only: it defines columns,
|
|
5
|
+
"description": "Schema for Kanban-style task boards. In v2 (per-task file architecture), the board file is config-only: it defines columns, document types, and project metadata. Tasks are standalone .md files in .brainfile/tasks/ (active) and .brainfile/logs/ (completed), each validated against task.json. In v1 (legacy), tasks are embedded in column arrays within this file.",
|
|
6
6
|
"x-brainfile-renderer": "kanban",
|
|
7
7
|
"x-brainfile-columns-path": "$.columns",
|
|
8
8
|
"x-brainfile-title-field": "title",
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brainfile TUI v3 design system.
|
|
3
|
+
*
|
|
4
|
+
* Two rules drive everything here:
|
|
5
|
+
*
|
|
6
|
+
* 1. **Colour is signal only.** Priority, contract state and selection get
|
|
7
|
+
* colour; nothing else does. IDs and metadata are dim, titles are default
|
|
8
|
+
* foreground. There are no decorative accents and no theme colours for
|
|
9
|
+
* "chrome", because v3 has no chrome.
|
|
10
|
+
* 2. **Structure comes from typography.** A document's kind is a single glyph
|
|
11
|
+
* in column 1; hierarchy is two spaces of indent; separation is whitespace.
|
|
12
|
+
* The only box-drawing character that survives is the horizontal rule used
|
|
13
|
+
* for the header and footer boundaries.
|
|
14
|
+
*/
|
|
15
|
+
declare const RAW_PALETTE: {
|
|
16
|
+
readonly text: "#ffffff";
|
|
17
|
+
readonly textSecondary: "#a0a0a0";
|
|
18
|
+
readonly textMuted: "#606060";
|
|
19
|
+
readonly textDim: "#404040";
|
|
20
|
+
readonly critical: "#ef4444";
|
|
21
|
+
readonly high: "#f59e0b";
|
|
22
|
+
readonly medium: "#3b82f6";
|
|
23
|
+
readonly low: "#6b7280";
|
|
24
|
+
readonly contractDraft: "#606060";
|
|
25
|
+
readonly contractReady: "#06b6d4";
|
|
26
|
+
readonly contractInProgress: "#eab308";
|
|
27
|
+
readonly contractDelivered: "#c026d3";
|
|
28
|
+
readonly contractDone: "#22c55e";
|
|
29
|
+
readonly contractFailed: "#ef4444";
|
|
30
|
+
readonly success: "#22c55e";
|
|
31
|
+
readonly warning: "#eab308";
|
|
32
|
+
readonly error: "#ef4444";
|
|
33
|
+
readonly info: "#3b82f6";
|
|
34
|
+
readonly accent: "#7c3aed";
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* `NO_COLOR` (https://no-color.org): any non-empty value disables colour. The
|
|
38
|
+
* empty string is falsy in JS, which happens to be exactly the spec's rule.
|
|
39
|
+
*
|
|
40
|
+
* Gating happens HERE, at the prop layer, rather than by forcing `chalk.level`
|
|
41
|
+
* to 0 globally. Ink still applies `inverse` through `chalk.inverse`, and chalk
|
|
42
|
+
* level 0 (NO_COLOR / FORCE_COLOR=0) is a no-op — so selection also puts a
|
|
43
|
+
* cursor glyph in column 1 of `DocumentRow`. The palette gate keeps colour
|
|
44
|
+
* props `undefined`; the glyph is what a no-colour terminal can actually see.
|
|
45
|
+
*
|
|
46
|
+
* The Proxy means all ~107 `PALETTE.x` call sites need no change, and the check
|
|
47
|
+
* is a plain runtime read at module init, so it survives the esbuild bundle
|
|
48
|
+
* without depending on import order the way a `FORCE_COLOR` shim would.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isNoColor(env?: NodeJS.ProcessEnv): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* The palette the views see. Exported as a factory so the gate is testable
|
|
53
|
+
* without module-cache gymnastics — `PALETTE` itself is the one-shot
|
|
54
|
+
* application of it to the real environment.
|
|
55
|
+
*/
|
|
56
|
+
export declare function makePalette(noColor: boolean): typeof RAW_PALETTE;
|
|
57
|
+
export declare const NO_COLOR: boolean;
|
|
58
|
+
export declare const PALETTE: typeof RAW_PALETTE;
|
|
59
|
+
/** The only box-drawing character v3 uses: header and footer rules. */
|
|
60
|
+
export declare const RULE = "\u2500";
|
|
61
|
+
/**
|
|
62
|
+
* Document-type glyphs (column 1). A plain task deliberately renders *no*
|
|
63
|
+
* glyph — the blank column is what makes typed documents stand out.
|
|
64
|
+
*/
|
|
65
|
+
export declare const TYPE_GLYPHS: Record<string, string>;
|
|
66
|
+
export declare function getTypeGlyph(type?: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Plain (non-emoji) glyphs used by the chrome-free views. The v2 emoji set
|
|
69
|
+
* (📄 📁 🔍 📦 📋 🗑 …) is gone: emoji have unreliable terminal widths and
|
|
70
|
+
* broke column alignment, which is the whole point of the v3 list.
|
|
71
|
+
*/
|
|
72
|
+
export declare const GLYPHS: {
|
|
73
|
+
readonly pointer: "▸";
|
|
74
|
+
readonly cursor: "▌";
|
|
75
|
+
readonly collapsed: "▶";
|
|
76
|
+
readonly success: "✓";
|
|
77
|
+
readonly error: "✗";
|
|
78
|
+
readonly warning: "⚠";
|
|
79
|
+
readonly live: "●";
|
|
80
|
+
readonly subtaskOpen: "◻";
|
|
81
|
+
readonly subtaskDone: "☑";
|
|
82
|
+
readonly orphanParent: "←";
|
|
83
|
+
/** Board-list row glyph for a parent-with-children that is expanded (§A1). */
|
|
84
|
+
readonly parentExpanded: "▾";
|
|
85
|
+
/** Board-list row glyph for a parent-with-children that is collapsed (§A1). */
|
|
86
|
+
readonly parentCollapsed: "▸";
|
|
87
|
+
/** Detail body scroll indicator (§B2), e.g. `↕ 2/9`. */
|
|
88
|
+
readonly scroll: "↕";
|
|
89
|
+
};
|
|
90
|
+
export type ContractState = 'draft' | 'ready' | 'in_progress' | 'delivered' | 'done' | 'failed' | 'blocked';
|
|
91
|
+
/**
|
|
92
|
+
* Contract state → colour. Unlike v2 (which had two divergent, both-incomplete
|
|
93
|
+
* switch statements in TaskCard and TaskDetail) this is the single mapping, and
|
|
94
|
+
* it covers all six states the schema can produce.
|
|
95
|
+
*/
|
|
96
|
+
export declare function getContractStateColor(state?: string): string;
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/tui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;CA6BP,CAAC;AAEX;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAEvE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,WAAW,CAGhE;AAED,eAAO,MAAM,QAAQ,SAAc,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,OAAO,WAAmC,CAAC;AAEjE,uEAAuE;AACvE,eAAO,MAAM,IAAI,WAAM,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM9C,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;IAWjB,8EAA8E;;IAE9E,+EAA+E;;IAE/E,wDAAwD;;CAEhD,CAAC;AAEX,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,OAAO,GACP,aAAa,GACb,WAAW,GACX,MAAM,GACN,QAAQ,GACR,SAAS,CAAC;AAEd;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAiB5D"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Brainfile TUI v3 design system.
|
|
4
|
+
*
|
|
5
|
+
* Two rules drive everything here:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Colour is signal only.** Priority, contract state and selection get
|
|
8
|
+
* colour; nothing else does. IDs and metadata are dim, titles are default
|
|
9
|
+
* foreground. There are no decorative accents and no theme colours for
|
|
10
|
+
* "chrome", because v3 has no chrome.
|
|
11
|
+
* 2. **Structure comes from typography.** A document's kind is a single glyph
|
|
12
|
+
* in column 1; hierarchy is two spaces of indent; separation is whitespace.
|
|
13
|
+
* The only box-drawing character that survives is the horizontal rule used
|
|
14
|
+
* for the header and footer boundaries.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.GLYPHS = exports.TYPE_GLYPHS = exports.RULE = exports.PALETTE = exports.NO_COLOR = void 0;
|
|
18
|
+
exports.isNoColor = isNoColor;
|
|
19
|
+
exports.makePalette = makePalette;
|
|
20
|
+
exports.getTypeGlyph = getTypeGlyph;
|
|
21
|
+
exports.getContractStateColor = getContractStateColor;
|
|
22
|
+
const RAW_PALETTE = {
|
|
23
|
+
// Text hierarchy
|
|
24
|
+
text: '#ffffff',
|
|
25
|
+
textSecondary: '#a0a0a0',
|
|
26
|
+
textMuted: '#606060',
|
|
27
|
+
textDim: '#404040',
|
|
28
|
+
// Priority signal
|
|
29
|
+
critical: '#ef4444',
|
|
30
|
+
high: '#f59e0b',
|
|
31
|
+
medium: '#3b82f6',
|
|
32
|
+
low: '#6b7280',
|
|
33
|
+
// Contract-state signal (design §3: draft dim · ready cyan · in_progress
|
|
34
|
+
// yellow · delivered magenta · done green · failed/blocked red)
|
|
35
|
+
contractDraft: '#606060',
|
|
36
|
+
contractReady: '#06b6d4',
|
|
37
|
+
contractInProgress: '#eab308',
|
|
38
|
+
contractDelivered: '#c026d3',
|
|
39
|
+
contractDone: '#22c55e',
|
|
40
|
+
contractFailed: '#ef4444',
|
|
41
|
+
// Feedback
|
|
42
|
+
success: '#22c55e',
|
|
43
|
+
warning: '#eab308',
|
|
44
|
+
error: '#ef4444',
|
|
45
|
+
info: '#3b82f6',
|
|
46
|
+
accent: '#7c3aed',
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* `NO_COLOR` (https://no-color.org): any non-empty value disables colour. The
|
|
50
|
+
* empty string is falsy in JS, which happens to be exactly the spec's rule.
|
|
51
|
+
*
|
|
52
|
+
* Gating happens HERE, at the prop layer, rather than by forcing `chalk.level`
|
|
53
|
+
* to 0 globally. Ink still applies `inverse` through `chalk.inverse`, and chalk
|
|
54
|
+
* level 0 (NO_COLOR / FORCE_COLOR=0) is a no-op — so selection also puts a
|
|
55
|
+
* cursor glyph in column 1 of `DocumentRow`. The palette gate keeps colour
|
|
56
|
+
* props `undefined`; the glyph is what a no-colour terminal can actually see.
|
|
57
|
+
*
|
|
58
|
+
* The Proxy means all ~107 `PALETTE.x` call sites need no change, and the check
|
|
59
|
+
* is a plain runtime read at module init, so it survives the esbuild bundle
|
|
60
|
+
* without depending on import order the way a `FORCE_COLOR` shim would.
|
|
61
|
+
*/
|
|
62
|
+
function isNoColor(env = process.env) {
|
|
63
|
+
return Boolean(env.NO_COLOR);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The palette the views see. Exported as a factory so the gate is testable
|
|
67
|
+
* without module-cache gymnastics — `PALETTE` itself is the one-shot
|
|
68
|
+
* application of it to the real environment.
|
|
69
|
+
*/
|
|
70
|
+
function makePalette(noColor) {
|
|
71
|
+
if (!noColor)
|
|
72
|
+
return RAW_PALETTE;
|
|
73
|
+
return new Proxy(RAW_PALETTE, { get: () => undefined });
|
|
74
|
+
}
|
|
75
|
+
exports.NO_COLOR = isNoColor();
|
|
76
|
+
exports.PALETTE = makePalette(exports.NO_COLOR);
|
|
77
|
+
/** The only box-drawing character v3 uses: header and footer rules. */
|
|
78
|
+
exports.RULE = '─';
|
|
79
|
+
/**
|
|
80
|
+
* Document-type glyphs (column 1). A plain task deliberately renders *no*
|
|
81
|
+
* glyph — the blank column is what makes typed documents stand out.
|
|
82
|
+
*/
|
|
83
|
+
exports.TYPE_GLYPHS = {
|
|
84
|
+
epic: '▸',
|
|
85
|
+
spec: '◆',
|
|
86
|
+
adr: '●',
|
|
87
|
+
plan: '⎘',
|
|
88
|
+
task: '',
|
|
89
|
+
};
|
|
90
|
+
function getTypeGlyph(type) {
|
|
91
|
+
if (!type)
|
|
92
|
+
return '';
|
|
93
|
+
return exports.TYPE_GLYPHS[type.toLowerCase()] ?? '';
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Plain (non-emoji) glyphs used by the chrome-free views. The v2 emoji set
|
|
97
|
+
* (📄 📁 🔍 📦 📋 🗑 …) is gone: emoji have unreliable terminal widths and
|
|
98
|
+
* broke column alignment, which is the whole point of the v3 list.
|
|
99
|
+
*/
|
|
100
|
+
exports.GLYPHS = {
|
|
101
|
+
pointer: '▸',
|
|
102
|
+
cursor: '▌',
|
|
103
|
+
collapsed: '▶',
|
|
104
|
+
success: '✓',
|
|
105
|
+
error: '✗',
|
|
106
|
+
warning: '⚠',
|
|
107
|
+
live: '●',
|
|
108
|
+
subtaskOpen: '◻',
|
|
109
|
+
subtaskDone: '☑',
|
|
110
|
+
orphanParent: '←',
|
|
111
|
+
/** Board-list row glyph for a parent-with-children that is expanded (§A1). */
|
|
112
|
+
parentExpanded: '▾',
|
|
113
|
+
/** Board-list row glyph for a parent-with-children that is collapsed (§A1). */
|
|
114
|
+
parentCollapsed: '▸',
|
|
115
|
+
/** Detail body scroll indicator (§B2), e.g. `↕ 2/9`. */
|
|
116
|
+
scroll: '↕',
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Contract state → colour. Unlike v2 (which had two divergent, both-incomplete
|
|
120
|
+
* switch statements in TaskCard and TaskDetail) this is the single mapping, and
|
|
121
|
+
* it covers all six states the schema can produce.
|
|
122
|
+
*/
|
|
123
|
+
function getContractStateColor(state) {
|
|
124
|
+
switch (state?.toLowerCase()) {
|
|
125
|
+
case 'ready':
|
|
126
|
+
return exports.PALETTE.contractReady;
|
|
127
|
+
case 'in_progress':
|
|
128
|
+
return exports.PALETTE.contractInProgress;
|
|
129
|
+
case 'delivered':
|
|
130
|
+
return exports.PALETTE.contractDelivered;
|
|
131
|
+
case 'done':
|
|
132
|
+
return exports.PALETTE.contractDone;
|
|
133
|
+
case 'failed':
|
|
134
|
+
case 'blocked':
|
|
135
|
+
return exports.PALETTE.contractFailed;
|
|
136
|
+
case 'draft':
|
|
137
|
+
default:
|
|
138
|
+
return exports.PALETTE.contractDraft;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/tui/theme.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AA+CH,8BAEC;AAOD,kCAGC;AAqBD,oCAGC;AAwCD,sDAiBC;AA1ID,MAAM,WAAW,GAAG;IAClB,iBAAiB;IACjB,IAAI,EAAE,SAAS;IACf,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,SAAS;IAElB,kBAAkB;IAClB,QAAQ,EAAE,SAAS;IACnB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,SAAS;IACjB,GAAG,EAAE,SAAS;IAEd,yEAAyE;IACzE,gEAAgE;IAChE,aAAa,EAAE,SAAS;IACxB,aAAa,EAAE,SAAS;IACxB,kBAAkB,EAAE,SAAS;IAC7B,iBAAiB,EAAE,SAAS;IAC5B,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,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