opencode-hive 0.8.0 → 0.8.2
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 +19251 -587
- package/package.json +4 -2
- package/dist/e2e/opencode-runtime-smoke.test.d.ts +0 -1
- package/dist/e2e/opencode-runtime-smoke.test.js +0 -243
- package/dist/e2e/plugin-smoke.test.d.ts +0 -1
- package/dist/e2e/plugin-smoke.test.js +0 -127
- package/dist/services/contextService.d.ts +0 -15
- package/dist/services/contextService.js +0 -59
- package/dist/services/featureService.d.ts +0 -14
- package/dist/services/featureService.js +0 -107
- package/dist/services/featureService.test.d.ts +0 -1
- package/dist/services/featureService.test.js +0 -127
- package/dist/services/index.d.ts +0 -5
- package/dist/services/index.js +0 -4
- package/dist/services/planService.d.ts +0 -11
- package/dist/services/planService.js +0 -59
- package/dist/services/planService.test.d.ts +0 -1
- package/dist/services/planService.test.js +0 -115
- package/dist/services/sessionService.d.ts +0 -31
- package/dist/services/sessionService.js +0 -125
- package/dist/services/taskService.d.ts +0 -29
- package/dist/services/taskService.js +0 -382
- package/dist/services/taskService.test.d.ts +0 -1
- package/dist/services/taskService.test.js +0 -290
- package/dist/services/worktreeService.d.ts +0 -66
- package/dist/services/worktreeService.js +0 -498
- package/dist/services/worktreeService.test.d.ts +0 -1
- package/dist/services/worktreeService.test.js +0 -185
- package/dist/tools/contextTools.d.ts +0 -93
- package/dist/tools/contextTools.js +0 -83
- package/dist/tools/execTools.d.ts +0 -66
- package/dist/tools/execTools.js +0 -125
- package/dist/tools/featureTools.d.ts +0 -60
- package/dist/tools/featureTools.js +0 -73
- package/dist/tools/planTools.d.ts +0 -47
- package/dist/tools/planTools.js +0 -65
- package/dist/tools/sessionTools.d.ts +0 -35
- package/dist/tools/sessionTools.js +0 -95
- package/dist/tools/taskTools.d.ts +0 -79
- package/dist/tools/taskTools.js +0 -86
- package/dist/types.d.ts +0 -106
- package/dist/types.js +0 -1
- package/dist/utils/detection.d.ts +0 -12
- package/dist/utils/detection.js +0 -73
- package/dist/utils/paths.d.ts +0 -23
- package/dist/utils/paths.js +0 -92
- package/dist/utils/paths.test.d.ts +0 -1
- package/dist/utils/paths.test.js +0 -100
package/dist/utils/paths.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare function getHivePath(projectRoot: string): string;
|
|
2
|
-
export declare function getFeaturesPath(projectRoot: string): string;
|
|
3
|
-
export declare function getFeaturePath(projectRoot: string, featureName: string): string;
|
|
4
|
-
export declare function getPlanPath(projectRoot: string, featureName: string): string;
|
|
5
|
-
export declare function getCommentsPath(projectRoot: string, featureName: string): string;
|
|
6
|
-
export declare function getFeatureJsonPath(projectRoot: string, featureName: string): string;
|
|
7
|
-
export declare function getContextPath(projectRoot: string, featureName: string): string;
|
|
8
|
-
export declare function getTasksPath(projectRoot: string, featureName: string): string;
|
|
9
|
-
export declare function getTaskPath(projectRoot: string, featureName: string, taskFolder: string): string;
|
|
10
|
-
export declare function getTaskStatusPath(projectRoot: string, featureName: string, taskFolder: string): string;
|
|
11
|
-
export declare function getTaskReportPath(projectRoot: string, featureName: string, taskFolder: string): string;
|
|
12
|
-
export declare function getTaskSpecPath(projectRoot: string, featureName: string, taskFolder: string): string;
|
|
13
|
-
export declare function getSubtasksPath(projectRoot: string, featureName: string, taskFolder: string): string;
|
|
14
|
-
export declare function getSubtaskPath(projectRoot: string, featureName: string, taskFolder: string, subtaskFolder: string): string;
|
|
15
|
-
export declare function getSubtaskStatusPath(projectRoot: string, featureName: string, taskFolder: string, subtaskFolder: string): string;
|
|
16
|
-
export declare function getSubtaskSpecPath(projectRoot: string, featureName: string, taskFolder: string, subtaskFolder: string): string;
|
|
17
|
-
export declare function getSubtaskReportPath(projectRoot: string, featureName: string, taskFolder: string, subtaskFolder: string): string;
|
|
18
|
-
export declare function ensureDir(dirPath: string): void;
|
|
19
|
-
export declare function fileExists(filePath: string): boolean;
|
|
20
|
-
export declare function readJson<T>(filePath: string): T | null;
|
|
21
|
-
export declare function writeJson<T>(filePath: string, data: T): void;
|
|
22
|
-
export declare function readText(filePath: string): string | null;
|
|
23
|
-
export declare function writeText(filePath: string, content: string): void;
|
package/dist/utils/paths.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import * as path from 'path';
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
const HIVE_DIR = '.hive';
|
|
4
|
-
const FEATURES_DIR = 'features';
|
|
5
|
-
const TASKS_DIR = 'tasks';
|
|
6
|
-
const CONTEXT_DIR = 'context';
|
|
7
|
-
const PLAN_FILE = 'plan.md';
|
|
8
|
-
const COMMENTS_FILE = 'comments.json';
|
|
9
|
-
const FEATURE_FILE = 'feature.json';
|
|
10
|
-
const STATUS_FILE = 'status.json';
|
|
11
|
-
const REPORT_FILE = 'report.md';
|
|
12
|
-
export function getHivePath(projectRoot) {
|
|
13
|
-
return path.join(projectRoot, HIVE_DIR);
|
|
14
|
-
}
|
|
15
|
-
export function getFeaturesPath(projectRoot) {
|
|
16
|
-
return path.join(getHivePath(projectRoot), FEATURES_DIR);
|
|
17
|
-
}
|
|
18
|
-
export function getFeaturePath(projectRoot, featureName) {
|
|
19
|
-
return path.join(getFeaturesPath(projectRoot), featureName);
|
|
20
|
-
}
|
|
21
|
-
export function getPlanPath(projectRoot, featureName) {
|
|
22
|
-
return path.join(getFeaturePath(projectRoot, featureName), PLAN_FILE);
|
|
23
|
-
}
|
|
24
|
-
export function getCommentsPath(projectRoot, featureName) {
|
|
25
|
-
return path.join(getFeaturePath(projectRoot, featureName), COMMENTS_FILE);
|
|
26
|
-
}
|
|
27
|
-
export function getFeatureJsonPath(projectRoot, featureName) {
|
|
28
|
-
return path.join(getFeaturePath(projectRoot, featureName), FEATURE_FILE);
|
|
29
|
-
}
|
|
30
|
-
export function getContextPath(projectRoot, featureName) {
|
|
31
|
-
return path.join(getFeaturePath(projectRoot, featureName), CONTEXT_DIR);
|
|
32
|
-
}
|
|
33
|
-
export function getTasksPath(projectRoot, featureName) {
|
|
34
|
-
return path.join(getFeaturePath(projectRoot, featureName), TASKS_DIR);
|
|
35
|
-
}
|
|
36
|
-
export function getTaskPath(projectRoot, featureName, taskFolder) {
|
|
37
|
-
return path.join(getTasksPath(projectRoot, featureName), taskFolder);
|
|
38
|
-
}
|
|
39
|
-
export function getTaskStatusPath(projectRoot, featureName, taskFolder) {
|
|
40
|
-
return path.join(getTaskPath(projectRoot, featureName, taskFolder), STATUS_FILE);
|
|
41
|
-
}
|
|
42
|
-
export function getTaskReportPath(projectRoot, featureName, taskFolder) {
|
|
43
|
-
return path.join(getTaskPath(projectRoot, featureName, taskFolder), REPORT_FILE);
|
|
44
|
-
}
|
|
45
|
-
export function getTaskSpecPath(projectRoot, featureName, taskFolder) {
|
|
46
|
-
return path.join(getTaskPath(projectRoot, featureName, taskFolder), 'spec.md');
|
|
47
|
-
}
|
|
48
|
-
// Subtask paths
|
|
49
|
-
const SUBTASKS_DIR = 'subtasks';
|
|
50
|
-
const SPEC_FILE = 'spec.md';
|
|
51
|
-
export function getSubtasksPath(projectRoot, featureName, taskFolder) {
|
|
52
|
-
return path.join(getTaskPath(projectRoot, featureName, taskFolder), SUBTASKS_DIR);
|
|
53
|
-
}
|
|
54
|
-
export function getSubtaskPath(projectRoot, featureName, taskFolder, subtaskFolder) {
|
|
55
|
-
return path.join(getSubtasksPath(projectRoot, featureName, taskFolder), subtaskFolder);
|
|
56
|
-
}
|
|
57
|
-
export function getSubtaskStatusPath(projectRoot, featureName, taskFolder, subtaskFolder) {
|
|
58
|
-
return path.join(getSubtaskPath(projectRoot, featureName, taskFolder, subtaskFolder), STATUS_FILE);
|
|
59
|
-
}
|
|
60
|
-
export function getSubtaskSpecPath(projectRoot, featureName, taskFolder, subtaskFolder) {
|
|
61
|
-
return path.join(getSubtaskPath(projectRoot, featureName, taskFolder, subtaskFolder), SPEC_FILE);
|
|
62
|
-
}
|
|
63
|
-
export function getSubtaskReportPath(projectRoot, featureName, taskFolder, subtaskFolder) {
|
|
64
|
-
return path.join(getSubtaskPath(projectRoot, featureName, taskFolder, subtaskFolder), REPORT_FILE);
|
|
65
|
-
}
|
|
66
|
-
export function ensureDir(dirPath) {
|
|
67
|
-
if (!fs.existsSync(dirPath)) {
|
|
68
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export function fileExists(filePath) {
|
|
72
|
-
return fs.existsSync(filePath);
|
|
73
|
-
}
|
|
74
|
-
export function readJson(filePath) {
|
|
75
|
-
if (!fs.existsSync(filePath))
|
|
76
|
-
return null;
|
|
77
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
78
|
-
return JSON.parse(content);
|
|
79
|
-
}
|
|
80
|
-
export function writeJson(filePath, data) {
|
|
81
|
-
ensureDir(path.dirname(filePath));
|
|
82
|
-
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
|
|
83
|
-
}
|
|
84
|
-
export function readText(filePath) {
|
|
85
|
-
if (!fs.existsSync(filePath))
|
|
86
|
-
return null;
|
|
87
|
-
return fs.readFileSync(filePath, 'utf-8');
|
|
88
|
-
}
|
|
89
|
-
export function writeText(filePath, content) {
|
|
90
|
-
ensureDir(path.dirname(filePath));
|
|
91
|
-
fs.writeFileSync(filePath, content);
|
|
92
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/utils/paths.test.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from "bun:test";
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
import { getHivePath, getFeaturesPath, getFeaturePath, getPlanPath, getCommentsPath, getFeatureJsonPath, getContextPath, getTasksPath, getTaskPath, getTaskStatusPath, getTaskReportPath, ensureDir, fileExists, readJson, writeJson, readText, writeText, } from "./paths";
|
|
5
|
-
const TEST_ROOT = "/tmp/hive-test-paths";
|
|
6
|
-
describe("paths.ts", () => {
|
|
7
|
-
beforeEach(() => {
|
|
8
|
-
fs.rmSync(TEST_ROOT, { recursive: true, force: true });
|
|
9
|
-
fs.mkdirSync(TEST_ROOT, { recursive: true });
|
|
10
|
-
});
|
|
11
|
-
afterEach(() => {
|
|
12
|
-
fs.rmSync(TEST_ROOT, { recursive: true, force: true });
|
|
13
|
-
});
|
|
14
|
-
describe("path generators", () => {
|
|
15
|
-
it("getHivePath returns correct path", () => {
|
|
16
|
-
expect(getHivePath(TEST_ROOT)).toBe(path.join(TEST_ROOT, ".hive"));
|
|
17
|
-
});
|
|
18
|
-
it("getFeaturesPath returns correct path", () => {
|
|
19
|
-
expect(getFeaturesPath(TEST_ROOT)).toBe(path.join(TEST_ROOT, ".hive", "features"));
|
|
20
|
-
});
|
|
21
|
-
it("getFeaturePath returns correct path", () => {
|
|
22
|
-
expect(getFeaturePath(TEST_ROOT, "my-feature")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature"));
|
|
23
|
-
});
|
|
24
|
-
it("getPlanPath returns correct path", () => {
|
|
25
|
-
expect(getPlanPath(TEST_ROOT, "my-feature")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "plan.md"));
|
|
26
|
-
});
|
|
27
|
-
it("getCommentsPath returns correct path", () => {
|
|
28
|
-
expect(getCommentsPath(TEST_ROOT, "my-feature")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "comments.json"));
|
|
29
|
-
});
|
|
30
|
-
it("getFeatureJsonPath returns correct path", () => {
|
|
31
|
-
expect(getFeatureJsonPath(TEST_ROOT, "my-feature")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "feature.json"));
|
|
32
|
-
});
|
|
33
|
-
it("getContextPath returns correct path", () => {
|
|
34
|
-
expect(getContextPath(TEST_ROOT, "my-feature")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "context"));
|
|
35
|
-
});
|
|
36
|
-
it("getTasksPath returns correct path", () => {
|
|
37
|
-
expect(getTasksPath(TEST_ROOT, "my-feature")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "tasks"));
|
|
38
|
-
});
|
|
39
|
-
it("getTaskPath returns correct path", () => {
|
|
40
|
-
expect(getTaskPath(TEST_ROOT, "my-feature", "01-setup")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "tasks", "01-setup"));
|
|
41
|
-
});
|
|
42
|
-
it("getTaskStatusPath returns correct path", () => {
|
|
43
|
-
expect(getTaskStatusPath(TEST_ROOT, "my-feature", "01-setup")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "tasks", "01-setup", "status.json"));
|
|
44
|
-
});
|
|
45
|
-
it("getTaskReportPath returns correct path", () => {
|
|
46
|
-
expect(getTaskReportPath(TEST_ROOT, "my-feature", "01-setup")).toBe(path.join(TEST_ROOT, ".hive", "features", "my-feature", "tasks", "01-setup", "report.md"));
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
describe("file utilities", () => {
|
|
50
|
-
it("ensureDir creates directory recursively", () => {
|
|
51
|
-
const deepPath = path.join(TEST_ROOT, "a", "b", "c");
|
|
52
|
-
ensureDir(deepPath);
|
|
53
|
-
expect(fs.existsSync(deepPath)).toBe(true);
|
|
54
|
-
});
|
|
55
|
-
it("ensureDir is idempotent", () => {
|
|
56
|
-
const dirPath = path.join(TEST_ROOT, "existing");
|
|
57
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
58
|
-
expect(() => ensureDir(dirPath)).not.toThrow();
|
|
59
|
-
});
|
|
60
|
-
it("fileExists returns true for existing file", () => {
|
|
61
|
-
const filePath = path.join(TEST_ROOT, "exists.txt");
|
|
62
|
-
fs.writeFileSync(filePath, "content");
|
|
63
|
-
expect(fileExists(filePath)).toBe(true);
|
|
64
|
-
});
|
|
65
|
-
it("fileExists returns false for non-existing file", () => {
|
|
66
|
-
expect(fileExists(path.join(TEST_ROOT, "nope.txt"))).toBe(false);
|
|
67
|
-
});
|
|
68
|
-
it("writeJson and readJson roundtrip", () => {
|
|
69
|
-
const filePath = path.join(TEST_ROOT, "data.json");
|
|
70
|
-
const data = { name: "test", count: 42, nested: { value: true } };
|
|
71
|
-
writeJson(filePath, data);
|
|
72
|
-
const result = readJson(filePath);
|
|
73
|
-
expect(result).toEqual(data);
|
|
74
|
-
});
|
|
75
|
-
it("readJson returns null for non-existing file", () => {
|
|
76
|
-
expect(readJson(path.join(TEST_ROOT, "nope.json"))).toBeNull();
|
|
77
|
-
});
|
|
78
|
-
it("writeText and readText roundtrip", () => {
|
|
79
|
-
const filePath = path.join(TEST_ROOT, "text.md");
|
|
80
|
-
const content = "# Hello\n\nThis is content.";
|
|
81
|
-
writeText(filePath, content);
|
|
82
|
-
const result = readText(filePath);
|
|
83
|
-
expect(result).toBe(content);
|
|
84
|
-
});
|
|
85
|
-
it("readText returns null for non-existing file", () => {
|
|
86
|
-
expect(readText(path.join(TEST_ROOT, "nope.md"))).toBeNull();
|
|
87
|
-
});
|
|
88
|
-
it("writeJson creates parent directories", () => {
|
|
89
|
-
const filePath = path.join(TEST_ROOT, "deep", "nested", "data.json");
|
|
90
|
-
const expected = { test: true };
|
|
91
|
-
writeJson(filePath, expected);
|
|
92
|
-
expect(readJson(filePath)).toEqual(expected);
|
|
93
|
-
});
|
|
94
|
-
it("writeText creates parent directories", () => {
|
|
95
|
-
const filePath = path.join(TEST_ROOT, "deep", "nested", "file.txt");
|
|
96
|
-
writeText(filePath, "content");
|
|
97
|
-
expect(readText(filePath)).toBe("content");
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|