opencode-hive 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.
@@ -0,0 +1,54 @@
1
+ export type FeatureStatusType = 'planning' | 'approved' | 'executing' | 'completed';
2
+ export interface FeatureJson {
3
+ name: string;
4
+ status: FeatureStatusType;
5
+ ticket?: string;
6
+ sessionId?: string;
7
+ createdAt: string;
8
+ approvedAt?: string;
9
+ completedAt?: string;
10
+ }
11
+ export type TaskStatusType = 'pending' | 'in_progress' | 'done' | 'cancelled';
12
+ export type TaskOrigin = 'plan' | 'manual';
13
+ export interface TaskStatus {
14
+ status: TaskStatusType;
15
+ origin: TaskOrigin;
16
+ summary?: string;
17
+ startedAt?: string;
18
+ completedAt?: string;
19
+ }
20
+ export interface PlanComment {
21
+ id: string;
22
+ line: number;
23
+ body: string;
24
+ author: string;
25
+ timestamp: string;
26
+ }
27
+ export interface CommentsJson {
28
+ threads: PlanComment[];
29
+ }
30
+ export interface PlanReadResult {
31
+ content: string;
32
+ status: FeatureStatusType;
33
+ comments: PlanComment[];
34
+ }
35
+ export interface TasksSyncResult {
36
+ created: string[];
37
+ removed: string[];
38
+ kept: string[];
39
+ manual: string[];
40
+ }
41
+ export interface TaskInfo {
42
+ folder: string;
43
+ name: string;
44
+ status: TaskStatusType;
45
+ origin: TaskOrigin;
46
+ summary?: string;
47
+ }
48
+ export interface FeatureInfo {
49
+ name: string;
50
+ status: FeatureStatusType;
51
+ tasks: TaskInfo[];
52
+ hasPlan: boolean;
53
+ commentCount: number;
54
+ }
package/dist/types.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
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 getActiveFeaturePath(projectRoot: string): string;
13
+ export declare function ensureDir(dirPath: string): void;
14
+ export declare function fileExists(filePath: string): boolean;
15
+ export declare function readJson<T>(filePath: string): T | null;
16
+ export declare function writeJson<T>(filePath: string, data: T): void;
17
+ export declare function readText(filePath: string): string | null;
18
+ export declare function writeText(filePath: string, content: string): void;
@@ -0,0 +1,75 @@
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
+ const ACTIVE_FILE = 'active-feature';
13
+ export function getHivePath(projectRoot) {
14
+ return path.join(projectRoot, HIVE_DIR);
15
+ }
16
+ export function getFeaturesPath(projectRoot) {
17
+ return path.join(getHivePath(projectRoot), FEATURES_DIR);
18
+ }
19
+ export function getFeaturePath(projectRoot, featureName) {
20
+ return path.join(getFeaturesPath(projectRoot), featureName);
21
+ }
22
+ export function getPlanPath(projectRoot, featureName) {
23
+ return path.join(getFeaturePath(projectRoot, featureName), PLAN_FILE);
24
+ }
25
+ export function getCommentsPath(projectRoot, featureName) {
26
+ return path.join(getFeaturePath(projectRoot, featureName), COMMENTS_FILE);
27
+ }
28
+ export function getFeatureJsonPath(projectRoot, featureName) {
29
+ return path.join(getFeaturePath(projectRoot, featureName), FEATURE_FILE);
30
+ }
31
+ export function getContextPath(projectRoot, featureName) {
32
+ return path.join(getFeaturePath(projectRoot, featureName), CONTEXT_DIR);
33
+ }
34
+ export function getTasksPath(projectRoot, featureName) {
35
+ return path.join(getFeaturePath(projectRoot, featureName), TASKS_DIR);
36
+ }
37
+ export function getTaskPath(projectRoot, featureName, taskFolder) {
38
+ return path.join(getTasksPath(projectRoot, featureName), taskFolder);
39
+ }
40
+ export function getTaskStatusPath(projectRoot, featureName, taskFolder) {
41
+ return path.join(getTaskPath(projectRoot, featureName, taskFolder), STATUS_FILE);
42
+ }
43
+ export function getTaskReportPath(projectRoot, featureName, taskFolder) {
44
+ return path.join(getTaskPath(projectRoot, featureName, taskFolder), REPORT_FILE);
45
+ }
46
+ export function getActiveFeaturePath(projectRoot) {
47
+ return path.join(getHivePath(projectRoot), ACTIVE_FILE);
48
+ }
49
+ export function ensureDir(dirPath) {
50
+ if (!fs.existsSync(dirPath)) {
51
+ fs.mkdirSync(dirPath, { recursive: true });
52
+ }
53
+ }
54
+ export function fileExists(filePath) {
55
+ return fs.existsSync(filePath);
56
+ }
57
+ export function readJson(filePath) {
58
+ if (!fs.existsSync(filePath))
59
+ return null;
60
+ const content = fs.readFileSync(filePath, 'utf-8');
61
+ return JSON.parse(content);
62
+ }
63
+ export function writeJson(filePath, data) {
64
+ ensureDir(path.dirname(filePath));
65
+ fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
66
+ }
67
+ export function readText(filePath) {
68
+ if (!fs.existsSync(filePath))
69
+ return null;
70
+ return fs.readFileSync(filePath, 'utf-8');
71
+ }
72
+ export function writeText(filePath, content) {
73
+ ensureDir(path.dirname(filePath));
74
+ fs.writeFileSync(filePath, content);
75
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "opencode-hive",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "description": "OpenCode plugin for Agent Hive - from vibe coding to hive coding",
6
+ "license": "MIT WITH Commons-Clause",
7
+ "author": "tctinh",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/tctinh/agent-hive.git",
11
+ "directory": "packages/opencode-hive"
12
+ },
13
+ "homepage": "https://github.com/tctinh/agent-hive#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/tctinh/agent-hive/issues"
16
+ },
17
+ "keywords": [
18
+ "opencode",
19
+ "ai",
20
+ "hive",
21
+ "vibe-coding",
22
+ "workflow",
23
+ "planning",
24
+ "agent"
25
+ ],
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "scripts": {
29
+ "clean": "rm -rf dist",
30
+ "build": "npm run clean && tsc",
31
+ "dev": "opencode plugin dev",
32
+ "test": "bun test"
33
+ },
34
+ "peerDependencies": {
35
+ "@opencode-ai/plugin": ">=0.13.7"
36
+ },
37
+ "dependencies": {
38
+ "simple-git": "^3.27.0"
39
+ },
40
+ "devDependencies": {
41
+ "@opencode-ai/plugin": "^1.0.143",
42
+ "@types/bun": "^1.2.0",
43
+ "@types/node": "^20.0.0",
44
+ "typescript": "^5.0.0"
45
+ },
46
+ "files": ["dist/", "README.md"]
47
+ }