@task-mcp/shared 1.0.20 → 1.0.21
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 +1 -6
- package/dist/algorithms/critical-path.d.ts +0 -46
- package/dist/algorithms/critical-path.d.ts.map +0 -1
- package/dist/algorithms/critical-path.js +0 -320
- package/dist/algorithms/critical-path.js.map +0 -1
- package/dist/algorithms/critical-path.test.d.ts +0 -2
- package/dist/algorithms/critical-path.test.d.ts.map +0 -1
- package/dist/algorithms/critical-path.test.js +0 -194
- package/dist/algorithms/critical-path.test.js.map +0 -1
- package/dist/algorithms/dependency-integrity.d.ts +0 -81
- package/dist/algorithms/dependency-integrity.d.ts.map +0 -1
- package/dist/algorithms/dependency-integrity.js +0 -207
- package/dist/algorithms/dependency-integrity.js.map +0 -1
- package/dist/algorithms/dependency-integrity.test.d.ts +0 -2
- package/dist/algorithms/dependency-integrity.test.d.ts.map +0 -1
- package/dist/algorithms/dependency-integrity.test.js +0 -309
- package/dist/algorithms/dependency-integrity.test.js.map +0 -1
- package/dist/algorithms/index.d.ts +0 -5
- package/dist/algorithms/index.d.ts.map +0 -1
- package/dist/algorithms/index.js +0 -5
- package/dist/algorithms/index.js.map +0 -1
- package/dist/algorithms/tech-analysis.d.ts +0 -106
- package/dist/algorithms/tech-analysis.d.ts.map +0 -1
- package/dist/algorithms/tech-analysis.js +0 -344
- package/dist/algorithms/tech-analysis.js.map +0 -1
- package/dist/algorithms/tech-analysis.test.d.ts +0 -2
- package/dist/algorithms/tech-analysis.test.d.ts.map +0 -1
- package/dist/algorithms/tech-analysis.test.js +0 -338
- package/dist/algorithms/tech-analysis.test.js.map +0 -1
- package/dist/algorithms/topological-sort.d.ts +0 -41
- package/dist/algorithms/topological-sort.d.ts.map +0 -1
- package/dist/algorithms/topological-sort.js +0 -165
- package/dist/algorithms/topological-sort.js.map +0 -1
- package/dist/algorithms/topological-sort.test.d.ts +0 -2
- package/dist/algorithms/topological-sort.test.d.ts.map +0 -1
- package/dist/algorithms/topological-sort.test.js +0 -162
- package/dist/algorithms/topological-sort.test.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -7
- package/dist/index.js.map +0 -1
- package/dist/schemas/inbox.d.ts +0 -55
- package/dist/schemas/inbox.d.ts.map +0 -1
- package/dist/schemas/inbox.js +0 -25
- package/dist/schemas/inbox.js.map +0 -1
- package/dist/schemas/index.d.ts +0 -7
- package/dist/schemas/index.d.ts.map +0 -1
- package/dist/schemas/index.js +0 -17
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/project.d.ts +0 -177
- package/dist/schemas/project.d.ts.map +0 -1
- package/dist/schemas/project.js +0 -56
- package/dist/schemas/project.js.map +0 -1
- package/dist/schemas/response-format.d.ts +0 -148
- package/dist/schemas/response-format.d.ts.map +0 -1
- package/dist/schemas/response-format.js +0 -18
- package/dist/schemas/response-format.js.map +0 -1
- package/dist/schemas/response-schema.d.ts +0 -307
- package/dist/schemas/response-schema.d.ts.map +0 -1
- package/dist/schemas/response-schema.js +0 -75
- package/dist/schemas/response-schema.js.map +0 -1
- package/dist/schemas/response-schema.test.d.ts +0 -2
- package/dist/schemas/response-schema.test.d.ts.map +0 -1
- package/dist/schemas/response-schema.test.js +0 -256
- package/dist/schemas/response-schema.test.js.map +0 -1
- package/dist/schemas/state.d.ts +0 -17
- package/dist/schemas/state.d.ts.map +0 -1
- package/dist/schemas/state.js +0 -17
- package/dist/schemas/state.js.map +0 -1
- package/dist/schemas/task.d.ts +0 -881
- package/dist/schemas/task.d.ts.map +0 -1
- package/dist/schemas/task.js +0 -189
- package/dist/schemas/task.js.map +0 -1
- package/dist/schemas/view.d.ts +0 -143
- package/dist/schemas/view.d.ts.map +0 -1
- package/dist/schemas/view.js +0 -48
- package/dist/schemas/view.js.map +0 -1
- package/dist/utils/dashboard-renderer.d.ts +0 -93
- package/dist/utils/dashboard-renderer.d.ts.map +0 -1
- package/dist/utils/dashboard-renderer.js +0 -424
- package/dist/utils/dashboard-renderer.js.map +0 -1
- package/dist/utils/dashboard-renderer.test.d.ts +0 -2
- package/dist/utils/dashboard-renderer.test.d.ts.map +0 -1
- package/dist/utils/dashboard-renderer.test.js +0 -774
- package/dist/utils/dashboard-renderer.test.js.map +0 -1
- package/dist/utils/date.d.ts +0 -94
- package/dist/utils/date.d.ts.map +0 -1
- package/dist/utils/date.js +0 -323
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/date.test.d.ts +0 -2
- package/dist/utils/date.test.d.ts.map +0 -1
- package/dist/utils/date.test.js +0 -276
- package/dist/utils/date.test.js.map +0 -1
- package/dist/utils/hierarchy.d.ts +0 -102
- package/dist/utils/hierarchy.d.ts.map +0 -1
- package/dist/utils/hierarchy.js +0 -236
- package/dist/utils/hierarchy.js.map +0 -1
- package/dist/utils/hierarchy.test.d.ts +0 -2
- package/dist/utils/hierarchy.test.d.ts.map +0 -1
- package/dist/utils/hierarchy.test.js +0 -436
- package/dist/utils/hierarchy.test.js.map +0 -1
- package/dist/utils/id.d.ts +0 -60
- package/dist/utils/id.d.ts.map +0 -1
- package/dist/utils/id.js +0 -118
- package/dist/utils/id.js.map +0 -1
- package/dist/utils/id.test.d.ts +0 -2
- package/dist/utils/id.test.d.ts.map +0 -1
- package/dist/utils/id.test.js +0 -193
- package/dist/utils/id.test.js.map +0 -1
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -34
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/natural-language.d.ts +0 -57
- package/dist/utils/natural-language.d.ts.map +0 -1
- package/dist/utils/natural-language.js +0 -211
- package/dist/utils/natural-language.js.map +0 -1
- package/dist/utils/natural-language.test.d.ts +0 -2
- package/dist/utils/natural-language.test.d.ts.map +0 -1
- package/dist/utils/natural-language.test.js +0 -197
- package/dist/utils/natural-language.test.js.map +0 -1
- package/dist/utils/priority-queue.d.ts +0 -17
- package/dist/utils/priority-queue.d.ts.map +0 -1
- package/dist/utils/priority-queue.js +0 -62
- package/dist/utils/priority-queue.js.map +0 -1
- package/dist/utils/priority-queue.test.d.ts +0 -2
- package/dist/utils/priority-queue.test.d.ts.map +0 -1
- package/dist/utils/priority-queue.test.js +0 -82
- package/dist/utils/priority-queue.test.js.map +0 -1
- package/dist/utils/projection.d.ts +0 -65
- package/dist/utils/projection.d.ts.map +0 -1
- package/dist/utils/projection.js +0 -180
- package/dist/utils/projection.js.map +0 -1
- package/dist/utils/projection.test.d.ts +0 -2
- package/dist/utils/projection.test.d.ts.map +0 -1
- package/dist/utils/projection.test.js +0 -336
- package/dist/utils/projection.test.js.map +0 -1
- package/dist/utils/terminal-ui.d.ts +0 -208
- package/dist/utils/terminal-ui.d.ts.map +0 -1
- package/dist/utils/terminal-ui.js +0 -611
- package/dist/utils/terminal-ui.js.map +0 -1
- package/dist/utils/terminal-ui.test.d.ts +0 -2
- package/dist/utils/terminal-ui.test.d.ts.map +0 -1
- package/dist/utils/terminal-ui.test.js +0 -683
- package/dist/utils/terminal-ui.test.js.map +0 -1
- package/dist/utils/workspace.d.ts +0 -100
- package/dist/utils/workspace.d.ts.map +0 -1
- package/dist/utils/workspace.js +0 -173
- package/dist/utils/workspace.js.map +0 -1
- package/dist/utils/workspace.test.d.ts +0 -2
- package/dist/utils/workspace.test.d.ts.map +0 -1
- package/dist/utils/workspace.test.js +0 -97
- package/dist/utils/workspace.test.js.map +0 -1
- package/src/algorithms/critical-path.test.ts +0 -241
- package/src/algorithms/dependency-integrity.test.ts +0 -348
- package/src/algorithms/tech-analysis.test.ts +0 -413
- package/src/algorithms/topological-sort.test.ts +0 -190
- package/src/schemas/response-schema.test.ts +0 -314
- package/src/utils/dashboard-renderer.test.ts +0 -983
- package/src/utils/date.test.ts +0 -329
- package/src/utils/hierarchy.test.ts +0 -505
- package/src/utils/id.test.ts +0 -235
- package/src/utils/natural-language.test.ts +0 -242
- package/src/utils/priority-queue.test.ts +0 -103
- package/src/utils/projection.test.ts +0 -425
- package/src/utils/terminal-ui.test.ts +0 -831
- package/src/utils/workspace.test.ts +0 -125
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import {
|
|
3
|
-
normalizeWorkspace,
|
|
4
|
-
detectWorkspaceSync,
|
|
5
|
-
detectWorkspace,
|
|
6
|
-
getWorkspaceFromPath,
|
|
7
|
-
getGitRepoRoot,
|
|
8
|
-
getGitRepoRootSync,
|
|
9
|
-
} from "./workspace";
|
|
10
|
-
|
|
11
|
-
describe("normalizeWorkspace", () => {
|
|
12
|
-
test("converts to lowercase", () => {
|
|
13
|
-
expect(normalizeWorkspace("MyProject")).toBe("myproject");
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
test("replaces spaces with hyphens", () => {
|
|
17
|
-
expect(normalizeWorkspace("my project")).toBe("my-project");
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test("removes special characters", () => {
|
|
21
|
-
expect(normalizeWorkspace("my@project!")).toBe("myproject");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
test("handles empty string", () => {
|
|
25
|
-
expect(normalizeWorkspace("")).toBe("default");
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
test("keeps hyphens and underscores", () => {
|
|
29
|
-
expect(normalizeWorkspace("my-project_name")).toBe("my-project_name");
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
test("trims leading and trailing hyphens", () => {
|
|
33
|
-
expect(normalizeWorkspace("--my-project--")).toBe("my-project");
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
test("handles multiple spaces", () => {
|
|
37
|
-
// Multiple spaces become multiple hyphens, then cleaned by special char removal
|
|
38
|
-
expect(normalizeWorkspace("my project")).toBe("my-project");
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test("handles mixed case with special chars", () => {
|
|
42
|
-
expect(normalizeWorkspace("My@Project#Name")).toBe("myprojectname");
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe("getWorkspaceFromPath", () => {
|
|
47
|
-
test("extracts workspace from path", () => {
|
|
48
|
-
expect(getWorkspaceFromPath("/home/user/projects/my-app")).toBe("my-app");
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("handles path with .tasks suffix", () => {
|
|
52
|
-
expect(getWorkspaceFromPath("/projects/my-app/.tasks")).toBe("my-app");
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
test("handles path with trailing slash", () => {
|
|
56
|
-
expect(getWorkspaceFromPath("/projects/my-app/.tasks/")).toBe("my-app");
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test("normalizes the extracted name", () => {
|
|
60
|
-
expect(getWorkspaceFromPath("/projects/My App")).toBe("my-app");
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe("getGitRepoRootSync", () => {
|
|
65
|
-
test("returns string or null for current directory", () => {
|
|
66
|
-
const result = getGitRepoRootSync();
|
|
67
|
-
expect(result === null || typeof result === "string").toBe(true);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
test("returns null for non-git directory", () => {
|
|
71
|
-
const result = getGitRepoRootSync("/tmp");
|
|
72
|
-
expect(result).toBeNull();
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
describe("getGitRepoRoot", () => {
|
|
77
|
-
test("returns string or null for current directory", async () => {
|
|
78
|
-
const result = await getGitRepoRoot();
|
|
79
|
-
expect(result === null || typeof result === "string").toBe(true);
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
test("returns null for non-git directory", async () => {
|
|
83
|
-
const result = await getGitRepoRoot("/tmp");
|
|
84
|
-
expect(result).toBeNull();
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
describe("detectWorkspaceSync", () => {
|
|
89
|
-
test("returns a workspace name", () => {
|
|
90
|
-
const workspace = detectWorkspaceSync();
|
|
91
|
-
expect(typeof workspace).toBe("string");
|
|
92
|
-
expect(workspace.length).toBeGreaterThan(0);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test("uses tasksDir path when provided and no git repo", () => {
|
|
96
|
-
// This tests the fallback to tasksDir when in a non-git directory
|
|
97
|
-
const workspace = detectWorkspaceSync("/some/path/my-project/.tasks");
|
|
98
|
-
expect(typeof workspace).toBe("string");
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
test("returns normalized workspace name", () => {
|
|
102
|
-
const workspace = detectWorkspaceSync();
|
|
103
|
-
// Should be lowercase with no special characters except - and _
|
|
104
|
-
expect(workspace).toMatch(/^[a-z0-9_-]+$/);
|
|
105
|
-
});
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
describe("detectWorkspace", () => {
|
|
109
|
-
test("returns a workspace name asynchronously", async () => {
|
|
110
|
-
const workspace = await detectWorkspace();
|
|
111
|
-
expect(typeof workspace).toBe("string");
|
|
112
|
-
expect(workspace.length).toBeGreaterThan(0);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test("uses tasksDir path when provided", async () => {
|
|
116
|
-
const workspace = await detectWorkspace("/some/path/test-project/.tasks");
|
|
117
|
-
expect(typeof workspace).toBe("string");
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
test("returns normalized workspace name", async () => {
|
|
121
|
-
const workspace = await detectWorkspace();
|
|
122
|
-
// Should be lowercase with no special characters except - and _
|
|
123
|
-
expect(workspace).toMatch(/^[a-z0-9_-]+$/);
|
|
124
|
-
});
|
|
125
|
-
});
|