clawvault 2.2.1 → 2.3.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/bin/clawvault.js +6 -0
- package/bin/register-task-commands.js +257 -0
- package/dist/chunk-MDIH26GC.js +183 -0
- package/dist/chunk-NGVAEFT2.js +352 -0
- package/dist/commands/archive.js +1 -1
- package/dist/commands/backlog.d.ts +53 -0
- package/dist/commands/backlog.js +119 -0
- package/dist/commands/blocked.d.ts +25 -0
- package/dist/commands/blocked.js +43 -0
- package/dist/commands/canvas.d.ts +20 -0
- package/dist/commands/canvas.js +309 -0
- package/dist/commands/context.js +3 -3
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/graph.js +2 -2
- package/dist/commands/link.js +3 -3
- package/dist/commands/migrate-observations.js +2 -2
- package/dist/commands/observe.js +3 -3
- package/dist/commands/rebuild.js +2 -2
- package/dist/commands/recover.js +2 -2
- package/dist/commands/reflect.js +1 -1
- package/dist/commands/replay.js +3 -3
- package/dist/commands/sleep.js +5 -5
- package/dist/commands/status.js +1 -1
- package/dist/commands/task.d.ts +71 -0
- package/dist/commands/task.js +189 -0
- package/dist/commands/wake.js +7 -7
- package/dist/index.js +38 -38
- package/dist/lib/canvas-layout.d.ts +115 -0
- package/dist/lib/canvas-layout.js +34 -0
- package/dist/lib/task-utils.d.ts +159 -0
- package/dist/lib/task-utils.js +46 -0
- package/package.json +2 -2
- package/dist/{chunk-WZI3OAE5.js → chunk-5WR6RRPX.js} +3 -3
- package/dist/{chunk-L6NB43WV.js → chunk-6BBTI7NV.js} +3 -3
- package/dist/{chunk-73P7XCQM.js → chunk-DPS7NYIU.js} +3 -3
- package/dist/{chunk-MILVYUPK.js → chunk-IWYZAXKJ.js} +3 -3
- package/dist/{chunk-H7JW4L7H.js → chunk-OZ7RIXTO.js} +3 -3
- package/dist/{chunk-LB6P4CD5.js → chunk-PTSEIWXZ.js} +6 -6
- package/dist/{chunk-I5X6J4FX.js → chunk-SOTWYGH7.js} +6 -6
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import {
|
|
2
|
+
completeTask,
|
|
3
|
+
createTask,
|
|
4
|
+
getStatusDisplay,
|
|
5
|
+
getStatusIcon,
|
|
6
|
+
listTasks,
|
|
7
|
+
readTask,
|
|
8
|
+
updateTask
|
|
9
|
+
} from "../chunk-NGVAEFT2.js";
|
|
10
|
+
|
|
11
|
+
// src/commands/task.ts
|
|
12
|
+
function taskAdd(vaultPath, title, options = {}) {
|
|
13
|
+
return createTask(vaultPath, title, {
|
|
14
|
+
owner: options.owner,
|
|
15
|
+
project: options.project,
|
|
16
|
+
priority: options.priority,
|
|
17
|
+
due: options.due,
|
|
18
|
+
content: options.content,
|
|
19
|
+
tags: options.tags
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function taskList(vaultPath, options = {}) {
|
|
23
|
+
const filters = {};
|
|
24
|
+
if (options.status) filters.status = options.status;
|
|
25
|
+
if (options.owner) filters.owner = options.owner;
|
|
26
|
+
if (options.project) filters.project = options.project;
|
|
27
|
+
if (options.priority) filters.priority = options.priority;
|
|
28
|
+
if (!options.status) {
|
|
29
|
+
const allTasks = listTasks(vaultPath, filters);
|
|
30
|
+
return allTasks.filter((t) => t.frontmatter.status !== "done");
|
|
31
|
+
}
|
|
32
|
+
return listTasks(vaultPath, filters);
|
|
33
|
+
}
|
|
34
|
+
function taskUpdate(vaultPath, slug, options) {
|
|
35
|
+
return updateTask(vaultPath, slug, {
|
|
36
|
+
status: options.status,
|
|
37
|
+
owner: options.owner,
|
|
38
|
+
project: options.project,
|
|
39
|
+
priority: options.priority,
|
|
40
|
+
blocked_by: options.blockedBy,
|
|
41
|
+
due: options.due
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function taskDone(vaultPath, slug) {
|
|
45
|
+
return completeTask(vaultPath, slug);
|
|
46
|
+
}
|
|
47
|
+
function taskShow(vaultPath, slug) {
|
|
48
|
+
return readTask(vaultPath, slug);
|
|
49
|
+
}
|
|
50
|
+
function formatTaskList(tasks) {
|
|
51
|
+
if (tasks.length === 0) {
|
|
52
|
+
return "No tasks found.\n";
|
|
53
|
+
}
|
|
54
|
+
const headers = ["STATUS", "OWNER", "PRIORITY", "PROJECT", "TITLE"];
|
|
55
|
+
const widths = [10, 12, 8, 16, 40];
|
|
56
|
+
let output = headers.map((h, i) => h.padEnd(widths[i])).join(" ") + "\n";
|
|
57
|
+
for (const task of tasks) {
|
|
58
|
+
const icon = getStatusIcon(task.frontmatter.status);
|
|
59
|
+
const statusDisplay = getStatusDisplay(task.frontmatter.status);
|
|
60
|
+
const status = `${icon} ${statusDisplay}`;
|
|
61
|
+
const owner = task.frontmatter.owner || "-";
|
|
62
|
+
const priority = task.frontmatter.priority || "low";
|
|
63
|
+
const project = task.frontmatter.project || "-";
|
|
64
|
+
const title = task.title.length > widths[4] ? task.title.slice(0, widths[4] - 3) + "..." : task.title;
|
|
65
|
+
const row = [
|
|
66
|
+
status.padEnd(widths[0]),
|
|
67
|
+
owner.padEnd(widths[1]),
|
|
68
|
+
priority.padEnd(widths[2]),
|
|
69
|
+
project.padEnd(widths[3]),
|
|
70
|
+
title
|
|
71
|
+
];
|
|
72
|
+
output += row.join(" ") + "\n";
|
|
73
|
+
}
|
|
74
|
+
return output;
|
|
75
|
+
}
|
|
76
|
+
function formatTaskDetails(task) {
|
|
77
|
+
let output = "";
|
|
78
|
+
output += `# ${task.title}
|
|
79
|
+
`;
|
|
80
|
+
output += "-".repeat(40) + "\n";
|
|
81
|
+
output += `Status: ${getStatusIcon(task.frontmatter.status)} ${getStatusDisplay(task.frontmatter.status)}
|
|
82
|
+
`;
|
|
83
|
+
if (task.frontmatter.owner) {
|
|
84
|
+
output += `Owner: ${task.frontmatter.owner}
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
if (task.frontmatter.project) {
|
|
88
|
+
output += `Project: ${task.frontmatter.project}
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
if (task.frontmatter.priority) {
|
|
92
|
+
output += `Priority: ${task.frontmatter.priority}
|
|
93
|
+
`;
|
|
94
|
+
}
|
|
95
|
+
if (task.frontmatter.due) {
|
|
96
|
+
output += `Due: ${task.frontmatter.due}
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
if (task.frontmatter.blocked_by) {
|
|
100
|
+
output += `Blocked by: ${task.frontmatter.blocked_by}
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
if (task.frontmatter.tags && task.frontmatter.tags.length > 0) {
|
|
104
|
+
output += `Tags: ${task.frontmatter.tags.join(", ")}
|
|
105
|
+
`;
|
|
106
|
+
}
|
|
107
|
+
output += `Created: ${task.frontmatter.created}
|
|
108
|
+
`;
|
|
109
|
+
output += `Updated: ${task.frontmatter.updated}
|
|
110
|
+
`;
|
|
111
|
+
if (task.frontmatter.completed) {
|
|
112
|
+
output += `Completed: ${task.frontmatter.completed}
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
output += `File: ${task.path}
|
|
116
|
+
`;
|
|
117
|
+
output += "-".repeat(40) + "\n";
|
|
118
|
+
const contentWithoutTitle = task.content.replace(/^#\s+.+\n/, "").trim();
|
|
119
|
+
if (contentWithoutTitle) {
|
|
120
|
+
output += "\n" + contentWithoutTitle + "\n";
|
|
121
|
+
}
|
|
122
|
+
return output;
|
|
123
|
+
}
|
|
124
|
+
async function taskCommand(vaultPath, action, args) {
|
|
125
|
+
const options = args.options || {};
|
|
126
|
+
switch (action) {
|
|
127
|
+
case "add": {
|
|
128
|
+
if (!args.title) {
|
|
129
|
+
throw new Error("Title is required for task add");
|
|
130
|
+
}
|
|
131
|
+
const task = taskAdd(vaultPath, args.title, options);
|
|
132
|
+
console.log(`\u2713 Created task: ${task.slug}`);
|
|
133
|
+
console.log(` Path: ${task.path}`);
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case "list": {
|
|
137
|
+
const tasks = taskList(vaultPath, options);
|
|
138
|
+
if (options.json) {
|
|
139
|
+
console.log(JSON.stringify(tasks, null, 2));
|
|
140
|
+
} else {
|
|
141
|
+
console.log(formatTaskList(tasks));
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
case "update": {
|
|
146
|
+
if (!args.slug) {
|
|
147
|
+
throw new Error("Task slug is required for update");
|
|
148
|
+
}
|
|
149
|
+
const task = taskUpdate(vaultPath, args.slug, options);
|
|
150
|
+
console.log(`\u2713 Updated task: ${task.slug}`);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
case "done": {
|
|
154
|
+
if (!args.slug) {
|
|
155
|
+
throw new Error("Task slug is required for done");
|
|
156
|
+
}
|
|
157
|
+
const task = taskDone(vaultPath, args.slug);
|
|
158
|
+
console.log(`\u2713 Completed task: ${task.slug}`);
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
case "show": {
|
|
162
|
+
if (!args.slug) {
|
|
163
|
+
throw new Error("Task slug is required for show");
|
|
164
|
+
}
|
|
165
|
+
const task = taskShow(vaultPath, args.slug);
|
|
166
|
+
if (!task) {
|
|
167
|
+
throw new Error(`Task not found: ${args.slug}`);
|
|
168
|
+
}
|
|
169
|
+
if (options.json) {
|
|
170
|
+
console.log(JSON.stringify(task, null, 2));
|
|
171
|
+
} else {
|
|
172
|
+
console.log(formatTaskDetails(task));
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
default:
|
|
177
|
+
throw new Error(`Unknown task action: ${action}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
export {
|
|
181
|
+
formatTaskDetails,
|
|
182
|
+
formatTaskList,
|
|
183
|
+
taskAdd,
|
|
184
|
+
taskCommand,
|
|
185
|
+
taskDone,
|
|
186
|
+
taskList,
|
|
187
|
+
taskShow,
|
|
188
|
+
taskUpdate
|
|
189
|
+
};
|
package/dist/commands/wake.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
recover
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-IWYZAXKJ.js";
|
|
4
|
+
import "../chunk-7ZRP733D.js";
|
|
4
5
|
import {
|
|
5
6
|
clearDirtyFlag
|
|
6
7
|
} from "../chunk-MZZJLQNQ.js";
|
|
8
|
+
import {
|
|
9
|
+
ClawVault
|
|
10
|
+
} from "../chunk-OTQW3OMC.js";
|
|
11
|
+
import "../chunk-FDJIZKCW.js";
|
|
7
12
|
import {
|
|
8
13
|
parseObservationMarkdown
|
|
9
14
|
} from "../chunk-K6XHCUFL.js";
|
|
15
|
+
import "../chunk-ZZA73MFY.js";
|
|
10
16
|
import {
|
|
11
17
|
listObservationFiles
|
|
12
18
|
} from "../chunk-Z2XBWN7A.js";
|
|
13
|
-
import "../chunk-7ZRP733D.js";
|
|
14
|
-
import {
|
|
15
|
-
ClawVault
|
|
16
|
-
} from "../chunk-OTQW3OMC.js";
|
|
17
|
-
import "../chunk-FDJIZKCW.js";
|
|
18
|
-
import "../chunk-ZZA73MFY.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/wake.ts
|
|
21
21
|
import * as fs from "fs";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerSyncBdCommand,
|
|
3
|
+
syncBdCommand
|
|
4
|
+
} from "./chunk-MGDEINGP.js";
|
|
5
|
+
import {
|
|
6
|
+
buildTemplateVariables,
|
|
7
|
+
renderTemplate
|
|
8
|
+
} from "./chunk-7766SIJP.js";
|
|
9
|
+
import {
|
|
10
|
+
reflectCommand,
|
|
11
|
+
registerReflectCommand
|
|
12
|
+
} from "./chunk-GJEGPO7U.js";
|
|
13
|
+
import {
|
|
14
|
+
registerReplayCommand,
|
|
15
|
+
replayCommand
|
|
16
|
+
} from "./chunk-6BBTI7NV.js";
|
|
1
17
|
import {
|
|
2
18
|
buildSessionRecap,
|
|
3
19
|
formatSessionRecapMarkdown,
|
|
@@ -7,47 +23,35 @@ import {
|
|
|
7
23
|
setupCommand
|
|
8
24
|
} from "./chunk-W463YRED.js";
|
|
9
25
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./chunk-MGDEINGP.js";
|
|
26
|
+
runReflection
|
|
27
|
+
} from "./chunk-GQVYQCY5.js";
|
|
13
28
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "./chunk-
|
|
29
|
+
graphCommand,
|
|
30
|
+
graphSummary
|
|
31
|
+
} from "./chunk-OZ7RIXTO.js";
|
|
17
32
|
import {
|
|
18
33
|
migrateObservations,
|
|
19
34
|
migrateObservationsCommand,
|
|
20
35
|
registerMigrateObservationsCommand
|
|
21
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-5WR6RRPX.js";
|
|
22
37
|
import {
|
|
23
38
|
SessionWatcher,
|
|
24
39
|
observeCommand,
|
|
25
40
|
registerObserveCommand
|
|
26
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-PTSEIWXZ.js";
|
|
42
|
+
import "./chunk-HRLWZGMA.js";
|
|
27
43
|
import {
|
|
28
44
|
parseSessionFile
|
|
29
45
|
} from "./chunk-P5EPF6MB.js";
|
|
30
46
|
import {
|
|
31
47
|
rebuildCommand,
|
|
32
48
|
registerRebuildCommand
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
reflectCommand,
|
|
36
|
-
registerReflectCommand
|
|
37
|
-
} from "./chunk-GJEGPO7U.js";
|
|
38
|
-
import "./chunk-HRLWZGMA.js";
|
|
39
|
-
import {
|
|
40
|
-
registerReplayCommand,
|
|
41
|
-
replayCommand
|
|
42
|
-
} from "./chunk-L6NB43WV.js";
|
|
49
|
+
} from "./chunk-DPS7NYIU.js";
|
|
43
50
|
import {
|
|
44
51
|
Compressor,
|
|
45
52
|
Observer,
|
|
46
53
|
Reflector
|
|
47
54
|
} from "./chunk-2HM7ZI4X.js";
|
|
48
|
-
import {
|
|
49
|
-
runReflection
|
|
50
|
-
} from "./chunk-GQVYQCY5.js";
|
|
51
55
|
import {
|
|
52
56
|
archiveCommand,
|
|
53
57
|
registerArchiveCommand
|
|
@@ -55,6 +59,16 @@ import {
|
|
|
55
59
|
import {
|
|
56
60
|
archiveObservations
|
|
57
61
|
} from "./chunk-MQUJNOHK.js";
|
|
62
|
+
import {
|
|
63
|
+
findNearestVaultPath,
|
|
64
|
+
getVaultPath,
|
|
65
|
+
resolveVaultPath
|
|
66
|
+
} from "./chunk-MXSSG3QU.js";
|
|
67
|
+
import {
|
|
68
|
+
checkOpenClawCompatibility,
|
|
69
|
+
compatCommand,
|
|
70
|
+
compatibilityExitCode
|
|
71
|
+
} from "./chunk-PAYUH64O.js";
|
|
58
72
|
import {
|
|
59
73
|
buildContext,
|
|
60
74
|
contextCommand,
|
|
@@ -63,14 +77,7 @@ import {
|
|
|
63
77
|
normalizeContextProfileInput,
|
|
64
78
|
registerContextCommand,
|
|
65
79
|
resolveContextProfile
|
|
66
|
-
} from "./chunk-
|
|
67
|
-
import "./chunk-K6XHCUFL.js";
|
|
68
|
-
import "./chunk-Z2XBWN7A.js";
|
|
69
|
-
import {
|
|
70
|
-
checkOpenClawCompatibility,
|
|
71
|
-
compatCommand,
|
|
72
|
-
compatibilityExitCode
|
|
73
|
-
} from "./chunk-PAYUH64O.js";
|
|
80
|
+
} from "./chunk-SOTWYGH7.js";
|
|
74
81
|
import {
|
|
75
82
|
ClawVault,
|
|
76
83
|
createVault,
|
|
@@ -91,21 +98,14 @@ import {
|
|
|
91
98
|
qmdEmbed,
|
|
92
99
|
qmdUpdate
|
|
93
100
|
} from "./chunk-FDJIZKCW.js";
|
|
94
|
-
import
|
|
95
|
-
graphCommand,
|
|
96
|
-
graphSummary
|
|
97
|
-
} from "./chunk-H7JW4L7H.js";
|
|
101
|
+
import "./chunk-K6XHCUFL.js";
|
|
98
102
|
import {
|
|
99
103
|
MEMORY_GRAPH_SCHEMA_VERSION,
|
|
100
104
|
buildOrUpdateMemoryGraphIndex,
|
|
101
105
|
getMemoryGraph,
|
|
102
106
|
loadMemoryGraphIndex
|
|
103
107
|
} from "./chunk-ZZA73MFY.js";
|
|
104
|
-
import
|
|
105
|
-
findNearestVaultPath,
|
|
106
|
-
getVaultPath,
|
|
107
|
-
resolveVaultPath
|
|
108
|
-
} from "./chunk-MXSSG3QU.js";
|
|
108
|
+
import "./chunk-Z2XBWN7A.js";
|
|
109
109
|
|
|
110
110
|
// src/index.ts
|
|
111
111
|
import * as fs from "fs";
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas layout utilities for ClawVault
|
|
3
|
+
* Handles JSON Canvas generation with proper positioning and grouping
|
|
4
|
+
*/
|
|
5
|
+
interface CanvasNode {
|
|
6
|
+
id: string;
|
|
7
|
+
type: 'text' | 'file' | 'group';
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
text?: string;
|
|
13
|
+
file?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
}
|
|
17
|
+
interface CanvasEdge {
|
|
18
|
+
id: string;
|
|
19
|
+
fromNode: string;
|
|
20
|
+
fromSide: 'top' | 'right' | 'bottom' | 'left';
|
|
21
|
+
toNode: string;
|
|
22
|
+
toSide: 'top' | 'right' | 'bottom' | 'left';
|
|
23
|
+
label?: string;
|
|
24
|
+
color?: string;
|
|
25
|
+
}
|
|
26
|
+
interface Canvas {
|
|
27
|
+
nodes: CanvasNode[];
|
|
28
|
+
edges: CanvasEdge[];
|
|
29
|
+
}
|
|
30
|
+
declare const CANVAS_COLORS: {
|
|
31
|
+
readonly RED: "1";
|
|
32
|
+
readonly ORANGE: "2";
|
|
33
|
+
readonly YELLOW: "3";
|
|
34
|
+
readonly GREEN: "4";
|
|
35
|
+
readonly CYAN: "5";
|
|
36
|
+
readonly PURPLE: "6";
|
|
37
|
+
};
|
|
38
|
+
declare const LAYOUT: {
|
|
39
|
+
readonly LEFT_COLUMN_X: 0;
|
|
40
|
+
readonly LEFT_COLUMN_WIDTH: 500;
|
|
41
|
+
readonly RIGHT_COLUMN_X: 550;
|
|
42
|
+
readonly RIGHT_COLUMN_WIDTH: 450;
|
|
43
|
+
readonly GROUP_PADDING: 20;
|
|
44
|
+
readonly NODE_SPACING: 15;
|
|
45
|
+
readonly GROUP_SPACING: 50;
|
|
46
|
+
readonly DEFAULT_NODE_WIDTH: 280;
|
|
47
|
+
readonly DEFAULT_NODE_HEIGHT: 80;
|
|
48
|
+
readonly FILE_NODE_HEIGHT: 60;
|
|
49
|
+
readonly SMALL_NODE_HEIGHT: 50;
|
|
50
|
+
readonly GROUP_HEADER_HEIGHT: 40;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Generate a 16-character lowercase hex ID
|
|
54
|
+
*/
|
|
55
|
+
declare function generateId(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Create a text node
|
|
58
|
+
*/
|
|
59
|
+
declare function createTextNode(x: number, y: number, width: number, height: number, text: string, color?: string): CanvasNode;
|
|
60
|
+
/**
|
|
61
|
+
* Create a file node
|
|
62
|
+
*/
|
|
63
|
+
declare function createFileNode(x: number, y: number, width: number, height: number, file: string, color?: string): CanvasNode;
|
|
64
|
+
/**
|
|
65
|
+
* Create a group node
|
|
66
|
+
*/
|
|
67
|
+
declare function createGroupNode(x: number, y: number, width: number, height: number, label: string, color?: string): CanvasNode;
|
|
68
|
+
/**
|
|
69
|
+
* Create an edge between nodes
|
|
70
|
+
*/
|
|
71
|
+
declare function createEdge(fromNode: string, fromSide: 'top' | 'right' | 'bottom' | 'left', toNode: string, toSide: 'top' | 'right' | 'bottom' | 'left', label?: string, color?: string): CanvasEdge;
|
|
72
|
+
/**
|
|
73
|
+
* Layout helper for vertical stacking of nodes within a group
|
|
74
|
+
*/
|
|
75
|
+
interface StackedLayout {
|
|
76
|
+
nodes: CanvasNode[];
|
|
77
|
+
totalHeight: number;
|
|
78
|
+
}
|
|
79
|
+
declare function stackNodesVertically(nodes: CanvasNode[], startX: number, startY: number, spacing?: number): StackedLayout;
|
|
80
|
+
/**
|
|
81
|
+
* Create a group with contained nodes
|
|
82
|
+
* Returns the group node and positioned child nodes
|
|
83
|
+
*/
|
|
84
|
+
interface GroupWithNodes {
|
|
85
|
+
group: CanvasNode;
|
|
86
|
+
nodes: CanvasNode[];
|
|
87
|
+
}
|
|
88
|
+
declare function createGroupWithNodes(groupX: number, groupY: number, groupWidth: number, label: string, childNodes: CanvasNode[], color?: string): GroupWithNodes;
|
|
89
|
+
/**
|
|
90
|
+
* Get priority color for a task
|
|
91
|
+
*/
|
|
92
|
+
declare function getPriorityColor(priority?: string): string | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Truncate text to fit within a certain width (approximate)
|
|
95
|
+
*/
|
|
96
|
+
declare function truncateText(text: string, maxChars: number): string;
|
|
97
|
+
/**
|
|
98
|
+
* Format markdown text for canvas node
|
|
99
|
+
* Replaces newlines with \n for JSON Canvas spec
|
|
100
|
+
*/
|
|
101
|
+
declare function formatCanvasText(lines: string[]): string;
|
|
102
|
+
/**
|
|
103
|
+
* Calculate the total height needed for a column of groups
|
|
104
|
+
*/
|
|
105
|
+
declare function calculateColumnHeight(groups: GroupWithNodes[]): number;
|
|
106
|
+
/**
|
|
107
|
+
* Position groups vertically in a column
|
|
108
|
+
*/
|
|
109
|
+
declare function positionGroupsVertically(groups: GroupWithNodes[], startY?: number): GroupWithNodes[];
|
|
110
|
+
/**
|
|
111
|
+
* Flatten groups and nodes into a single array
|
|
112
|
+
*/
|
|
113
|
+
declare function flattenGroups(groups: GroupWithNodes[]): CanvasNode[];
|
|
114
|
+
|
|
115
|
+
export { CANVAS_COLORS, type Canvas, type CanvasEdge, type CanvasNode, type GroupWithNodes, LAYOUT, type StackedLayout, calculateColumnHeight, createEdge, createFileNode, createGroupNode, createGroupWithNodes, createTextNode, flattenGroups, formatCanvasText, generateId, getPriorityColor, positionGroupsVertically, stackNodesVertically, truncateText };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CANVAS_COLORS,
|
|
3
|
+
LAYOUT,
|
|
4
|
+
calculateColumnHeight,
|
|
5
|
+
createEdge,
|
|
6
|
+
createFileNode,
|
|
7
|
+
createGroupNode,
|
|
8
|
+
createGroupWithNodes,
|
|
9
|
+
createTextNode,
|
|
10
|
+
flattenGroups,
|
|
11
|
+
formatCanvasText,
|
|
12
|
+
generateId,
|
|
13
|
+
getPriorityColor,
|
|
14
|
+
positionGroupsVertically,
|
|
15
|
+
stackNodesVertically,
|
|
16
|
+
truncateText
|
|
17
|
+
} from "../chunk-MDIH26GC.js";
|
|
18
|
+
export {
|
|
19
|
+
CANVAS_COLORS,
|
|
20
|
+
LAYOUT,
|
|
21
|
+
calculateColumnHeight,
|
|
22
|
+
createEdge,
|
|
23
|
+
createFileNode,
|
|
24
|
+
createGroupNode,
|
|
25
|
+
createGroupWithNodes,
|
|
26
|
+
createTextNode,
|
|
27
|
+
flattenGroups,
|
|
28
|
+
formatCanvasText,
|
|
29
|
+
generateId,
|
|
30
|
+
getPriorityColor,
|
|
31
|
+
positionGroupsVertically,
|
|
32
|
+
stackNodesVertically,
|
|
33
|
+
truncateText
|
|
34
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task utilities for ClawVault task tracking
|
|
3
|
+
* Handles task and backlog file read/write/query operations
|
|
4
|
+
*/
|
|
5
|
+
type TaskStatus = 'open' | 'in-progress' | 'blocked' | 'done';
|
|
6
|
+
type TaskPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
7
|
+
interface TaskFrontmatter {
|
|
8
|
+
status: TaskStatus;
|
|
9
|
+
owner?: string;
|
|
10
|
+
project?: string;
|
|
11
|
+
priority?: TaskPriority;
|
|
12
|
+
blocked_by?: string;
|
|
13
|
+
due?: string;
|
|
14
|
+
created: string;
|
|
15
|
+
updated: string;
|
|
16
|
+
completed?: string;
|
|
17
|
+
tags?: string[];
|
|
18
|
+
}
|
|
19
|
+
interface Task {
|
|
20
|
+
slug: string;
|
|
21
|
+
title: string;
|
|
22
|
+
content: string;
|
|
23
|
+
frontmatter: TaskFrontmatter;
|
|
24
|
+
path: string;
|
|
25
|
+
}
|
|
26
|
+
interface BacklogFrontmatter {
|
|
27
|
+
source?: string;
|
|
28
|
+
project?: string;
|
|
29
|
+
created: string;
|
|
30
|
+
tags?: string[];
|
|
31
|
+
}
|
|
32
|
+
interface BacklogItem {
|
|
33
|
+
slug: string;
|
|
34
|
+
title: string;
|
|
35
|
+
content: string;
|
|
36
|
+
frontmatter: BacklogFrontmatter;
|
|
37
|
+
path: string;
|
|
38
|
+
}
|
|
39
|
+
interface TaskFilterOptions {
|
|
40
|
+
status?: TaskStatus;
|
|
41
|
+
owner?: string;
|
|
42
|
+
project?: string;
|
|
43
|
+
priority?: TaskPriority;
|
|
44
|
+
}
|
|
45
|
+
interface BacklogFilterOptions {
|
|
46
|
+
project?: string;
|
|
47
|
+
source?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Slugify a title for use as filename
|
|
51
|
+
* Deterministic: same title = same slug
|
|
52
|
+
*/
|
|
53
|
+
declare function slugify(text: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Get the tasks directory path
|
|
56
|
+
*/
|
|
57
|
+
declare function getTasksDir(vaultPath: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Get the backlog directory path
|
|
60
|
+
*/
|
|
61
|
+
declare function getBacklogDir(vaultPath: string): string;
|
|
62
|
+
/**
|
|
63
|
+
* Ensure the tasks directory exists
|
|
64
|
+
*/
|
|
65
|
+
declare function ensureTasksDir(vaultPath: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Ensure the backlog directory exists
|
|
68
|
+
*/
|
|
69
|
+
declare function ensureBacklogDir(vaultPath: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Get task file path from slug
|
|
72
|
+
*/
|
|
73
|
+
declare function getTaskPath(vaultPath: string, slug: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Get backlog file path from slug
|
|
76
|
+
*/
|
|
77
|
+
declare function getBacklogPath(vaultPath: string, slug: string): string;
|
|
78
|
+
/**
|
|
79
|
+
* Read a task file and parse it
|
|
80
|
+
*/
|
|
81
|
+
declare function readTask(vaultPath: string, slug: string): Task | null;
|
|
82
|
+
/**
|
|
83
|
+
* Read a backlog item file and parse it
|
|
84
|
+
*/
|
|
85
|
+
declare function readBacklogItem(vaultPath: string, slug: string): BacklogItem | null;
|
|
86
|
+
/**
|
|
87
|
+
* List all tasks in the vault
|
|
88
|
+
*/
|
|
89
|
+
declare function listTasks(vaultPath: string, filters?: TaskFilterOptions): Task[];
|
|
90
|
+
/**
|
|
91
|
+
* List all backlog items in the vault
|
|
92
|
+
*/
|
|
93
|
+
declare function listBacklogItems(vaultPath: string, filters?: BacklogFilterOptions): BacklogItem[];
|
|
94
|
+
/**
|
|
95
|
+
* Create a new task
|
|
96
|
+
*/
|
|
97
|
+
declare function createTask(vaultPath: string, title: string, options?: {
|
|
98
|
+
owner?: string;
|
|
99
|
+
project?: string;
|
|
100
|
+
priority?: TaskPriority;
|
|
101
|
+
due?: string;
|
|
102
|
+
content?: string;
|
|
103
|
+
tags?: string[];
|
|
104
|
+
}): Task;
|
|
105
|
+
/**
|
|
106
|
+
* Update an existing task
|
|
107
|
+
*/
|
|
108
|
+
declare function updateTask(vaultPath: string, slug: string, updates: {
|
|
109
|
+
status?: TaskStatus;
|
|
110
|
+
owner?: string;
|
|
111
|
+
project?: string;
|
|
112
|
+
priority?: TaskPriority;
|
|
113
|
+
blocked_by?: string;
|
|
114
|
+
due?: string;
|
|
115
|
+
tags?: string[];
|
|
116
|
+
}): Task;
|
|
117
|
+
/**
|
|
118
|
+
* Mark a task as done
|
|
119
|
+
*/
|
|
120
|
+
declare function completeTask(vaultPath: string, slug: string): Task;
|
|
121
|
+
/**
|
|
122
|
+
* Create a new backlog item
|
|
123
|
+
*/
|
|
124
|
+
declare function createBacklogItem(vaultPath: string, title: string, options?: {
|
|
125
|
+
source?: string;
|
|
126
|
+
project?: string;
|
|
127
|
+
content?: string;
|
|
128
|
+
tags?: string[];
|
|
129
|
+
}): BacklogItem;
|
|
130
|
+
/**
|
|
131
|
+
* Promote a backlog item to a task
|
|
132
|
+
*/
|
|
133
|
+
declare function promoteBacklogItem(vaultPath: string, slug: string, options?: {
|
|
134
|
+
owner?: string;
|
|
135
|
+
priority?: TaskPriority;
|
|
136
|
+
due?: string;
|
|
137
|
+
}): Task;
|
|
138
|
+
/**
|
|
139
|
+
* Get blocked tasks
|
|
140
|
+
*/
|
|
141
|
+
declare function getBlockedTasks(vaultPath: string, project?: string): Task[];
|
|
142
|
+
/**
|
|
143
|
+
* Get active tasks (open or in-progress)
|
|
144
|
+
*/
|
|
145
|
+
declare function getActiveTasks(vaultPath: string, filters?: Omit<TaskFilterOptions, 'status'>): Task[];
|
|
146
|
+
/**
|
|
147
|
+
* Get recently completed tasks
|
|
148
|
+
*/
|
|
149
|
+
declare function getRecentlyCompletedTasks(vaultPath: string, limit?: number): Task[];
|
|
150
|
+
/**
|
|
151
|
+
* Format task status icon
|
|
152
|
+
*/
|
|
153
|
+
declare function getStatusIcon(status: TaskStatus): string;
|
|
154
|
+
/**
|
|
155
|
+
* Format task status display name
|
|
156
|
+
*/
|
|
157
|
+
declare function getStatusDisplay(status: TaskStatus): string;
|
|
158
|
+
|
|
159
|
+
export { type BacklogFilterOptions, type BacklogFrontmatter, type BacklogItem, type Task, type TaskFilterOptions, type TaskFrontmatter, type TaskPriority, type TaskStatus, completeTask, createBacklogItem, createTask, ensureBacklogDir, ensureTasksDir, getActiveTasks, getBacklogDir, getBacklogPath, getBlockedTasks, getRecentlyCompletedTasks, getStatusDisplay, getStatusIcon, getTaskPath, getTasksDir, listBacklogItems, listTasks, promoteBacklogItem, readBacklogItem, readTask, slugify, updateTask };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
completeTask,
|
|
3
|
+
createBacklogItem,
|
|
4
|
+
createTask,
|
|
5
|
+
ensureBacklogDir,
|
|
6
|
+
ensureTasksDir,
|
|
7
|
+
getActiveTasks,
|
|
8
|
+
getBacklogDir,
|
|
9
|
+
getBacklogPath,
|
|
10
|
+
getBlockedTasks,
|
|
11
|
+
getRecentlyCompletedTasks,
|
|
12
|
+
getStatusDisplay,
|
|
13
|
+
getStatusIcon,
|
|
14
|
+
getTaskPath,
|
|
15
|
+
getTasksDir,
|
|
16
|
+
listBacklogItems,
|
|
17
|
+
listTasks,
|
|
18
|
+
promoteBacklogItem,
|
|
19
|
+
readBacklogItem,
|
|
20
|
+
readTask,
|
|
21
|
+
slugify,
|
|
22
|
+
updateTask
|
|
23
|
+
} from "../chunk-NGVAEFT2.js";
|
|
24
|
+
export {
|
|
25
|
+
completeTask,
|
|
26
|
+
createBacklogItem,
|
|
27
|
+
createTask,
|
|
28
|
+
ensureBacklogDir,
|
|
29
|
+
ensureTasksDir,
|
|
30
|
+
getActiveTasks,
|
|
31
|
+
getBacklogDir,
|
|
32
|
+
getBacklogPath,
|
|
33
|
+
getBlockedTasks,
|
|
34
|
+
getRecentlyCompletedTasks,
|
|
35
|
+
getStatusDisplay,
|
|
36
|
+
getStatusIcon,
|
|
37
|
+
getTaskPath,
|
|
38
|
+
getTasksDir,
|
|
39
|
+
listBacklogItems,
|
|
40
|
+
listTasks,
|
|
41
|
+
promoteBacklogItem,
|
|
42
|
+
readBacklogItem,
|
|
43
|
+
readTask,
|
|
44
|
+
slugify,
|
|
45
|
+
updateTask
|
|
46
|
+
};
|