opencode-hive 1.3.5 → 1.4.3
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 +85 -15
- package/dist/hive-core/src/services/configService.d.ts +28 -6
- package/dist/hive-core/src/services/contextService.d.ts +5 -2
- package/dist/hive-core/src/services/index.d.ts +2 -0
- package/dist/hive-core/src/services/networkService.d.ts +25 -0
- package/dist/hive-core/src/services/taskService.d.ts +10 -3
- package/dist/hive-core/src/services/worktreeService.d.ts +20 -4
- package/dist/hive-core/src/types.d.ts +24 -2
- package/dist/index.js +1343 -406
- package/dist/opencode-hive/src/agents/architect.d.ts +1 -1
- package/dist/opencode-hive/src/agents/forager.d.ts +1 -1
- package/dist/opencode-hive/src/agents/hive-helper.d.ts +6 -0
- package/dist/opencode-hive/src/agents/hive.d.ts +1 -1
- package/dist/opencode-hive/src/agents/hygienic.d.ts +1 -1
- package/dist/opencode-hive/src/agents/index.d.ts +6 -0
- package/dist/opencode-hive/src/agents/scout.d.ts +1 -1
- package/dist/opencode-hive/src/agents/swarm.d.ts +1 -1
- package/dist/opencode-hive/src/skills/registry.generated.d.ts +1 -1
- package/dist/opencode-hive/src/utils/plugin-manifest.d.ts +24 -0
- package/package.json +5 -2
- package/skills/docker-mastery/SKILL.md +3 -1
- package/skills/executing-plans/SKILL.md +14 -4
- package/skills/parallel-exploration/SKILL.md +12 -13
- package/skills/verification-reviewer/SKILL.md +111 -0
- package/skills/writing-plans/SKILL.md +3 -1
- package/templates/context/tools.md +83 -0
- package/templates/mcp-servers.json +27 -0
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install opencode-hive
|
|
|
24
24
|
|
|
25
25
|
1. Create `.opencode/mcp-servers.json` using the template:
|
|
26
26
|
- From this repo: `packages/opencode-hive/templates/mcp-servers.json`
|
|
27
|
-
- Or from npm: `node_modules/opencode-hive/templates/mcp-servers.json`
|
|
27
|
+
- Or from the installed npm package: `node_modules/opencode-hive/templates/mcp-servers.json`
|
|
28
28
|
2. Set `EXA_API_KEY` to enable `websearch_exa` (optional).
|
|
29
29
|
3. Restart OpenCode.
|
|
30
30
|
|
|
@@ -34,7 +34,7 @@ This enables tools like `grep_app_searchGitHub`, `context7_query-docs`, `websear
|
|
|
34
34
|
|
|
35
35
|
1. **Create Feature** — `hive_feature_create("dark-mode")`
|
|
36
36
|
2. **Write Plan** — AI generates structured plan
|
|
37
|
-
3. **Review** —
|
|
37
|
+
3. **Review** — Optional `vscode-hive` companion for overview/plan review and comments
|
|
38
38
|
4. **Approve** — `hive_plan_approve()`
|
|
39
39
|
5. **Execute** — Tasks run in isolated git worktrees
|
|
40
40
|
6. **Ship** — Clean commits, full audit trail
|
|
@@ -43,6 +43,17 @@ This enables tools like `grep_app_searchGitHub`, `context7_query-docs`, `websear
|
|
|
43
43
|
|
|
44
44
|
During planning, "don't execute" means "don't implement" (no code edits, no worktrees). Read-only exploration is explicitly allowed and encouraged, both via local tools and by delegating to Scout.
|
|
45
45
|
|
|
46
|
+
When delegation is warranted, synthesize the task before handing it off: name the file paths or search target, state the expected result, and say what done looks like. Workers do not inherit planner context.
|
|
47
|
+
|
|
48
|
+
For execution work, treat worker output as evidence to inspect, not proof to trust blindly. OpenCode is the supported execution harness in `1.4.0`; if you use `vscode-hive`, treat it as a review/sidebar companion. Read changed files yourself and run the shared verification commands on the main branch before claiming the batch is complete.
|
|
49
|
+
|
|
50
|
+
\`hive_network_query\` is an optional lookup, not a default step. There is no startup lookup: first orient on the live request and live repo state. planning, orchestration, and review roles get network access first. live-file verification still required even when network results look relevant.
|
|
51
|
+
|
|
52
|
+
### Local skill and model use cases
|
|
53
|
+
|
|
54
|
+
- **Local skill experiments:** keep a skill in `<project>/.opencode/skills/<id>/SKILL.md` or `<project>/.claude/skills/<id>/SKILL.md` and add it to `skills` or `autoLoadSkills` for that repo only.
|
|
55
|
+
- **Local model tuning:** set per-agent models or variants in `<project>/.hive/agent-hive.json` when you want a repository-specific routing setup without changing your global OpenCode defaults.
|
|
56
|
+
|
|
46
57
|
#### Canonical Delegation Threshold
|
|
47
58
|
|
|
48
59
|
- Delegate to Scout when you cannot name the file path upfront, expect to inspect 2+ files, or the question is open-ended ("how/where does X work?").
|
|
@@ -66,8 +77,8 @@ During planning, "don't execute" means "don't implement" (no code edits, no work
|
|
|
66
77
|
### Tasks
|
|
67
78
|
| Tool | Description |
|
|
68
79
|
|------|-------------|
|
|
69
|
-
| `hive_tasks_sync` | Generate tasks from plan |
|
|
70
|
-
| `hive_task_create` | Create manual task |
|
|
80
|
+
| `hive_tasks_sync` | Generate tasks from plan, or rewrite pending plan tasks with `refreshPending: true` after a plan amendment |
|
|
81
|
+
| `hive_task_create` | Create a manual task with explicit `dependsOn` and optional structured metadata |
|
|
71
82
|
| `hive_task_update` | Update task status/summary |
|
|
72
83
|
|
|
73
84
|
### Worktree
|
|
@@ -106,21 +117,40 @@ When using Dynamic Context Pruning (DCP), use a Hive-safe config in `~/.config/o
|
|
|
106
117
|
- `strategies.supersedeWrites.enabled: false`
|
|
107
118
|
- `strategies.purgeErrors.enabled: false`
|
|
108
119
|
|
|
109
|
-
For
|
|
120
|
+
For normal usage, set the OpenCode plugin entry to `"opencode-hive@latest"`. Keep `"opencode-hive"` only for local contributor testing with a symlinked checkout.
|
|
121
|
+
|
|
122
|
+
#### OpenCode alignment: honest hook contract and bounded recovery
|
|
123
|
+
|
|
124
|
+
Agent Hive aligns to the OpenCode surfaces that exist today. It does **not** depend on a first-class upstream Hive orchestration API, a native checkpoint API, or a hidden todo-sync surface.
|
|
110
125
|
|
|
111
|
-
|
|
126
|
+
At the current plugin/runtime layer, Hive relies on these supported hooks:
|
|
112
127
|
|
|
113
|
-
|
|
128
|
+
- `event`
|
|
129
|
+
- `config`
|
|
130
|
+
- `chat.message`
|
|
131
|
+
- `experimental.chat.messages.transform`
|
|
132
|
+
- `tool.execute.before`
|
|
114
133
|
|
|
115
|
-
|
|
134
|
+
That contract matters because some older wording implied deeper integration than OpenCode currently exposes. The recovery path in this branch is hook-timed and file-backed, not storage-level magic.
|
|
116
135
|
|
|
117
|
-
|
|
136
|
+
Todo ownership is intentionally modest:
|
|
137
|
+
|
|
138
|
+
- OpenCode todos remain **session-scoped** and **replace-all**.
|
|
139
|
+
- Hive does not add a new upstream todo API.
|
|
140
|
+
- This plugin does not expose a derived projected-todo field or stale refresh hints as part of its runtime contract.
|
|
141
|
+
- Worker and subagent sessions still follow normal OpenCode limits; they should not be described as independently syncing Hive task state.
|
|
142
|
+
- `.hive` remains the durable source of truth for plan/task/worktree state.
|
|
143
|
+
|
|
144
|
+
Compaction recovery uses durable Hive artifacts instead of transcript dumps:
|
|
118
145
|
|
|
119
146
|
- Global session state is written to `.hive/sessions.json`.
|
|
120
147
|
- Feature-local mirrors are written to `.hive/features/<feature>/sessions.json`.
|
|
121
148
|
- Session classification distinguishes `primary`, `subagent`, `task-worker`, and `unknown`.
|
|
122
|
-
- Primary and subagent recovery can replay the stored user directive once after compaction.
|
|
123
|
-
-
|
|
149
|
+
- Primary and subagent recovery can replay the stored user directive once after compaction, with `directiveRecoveryState` enforcing the one-replay-then-escalate contract.
|
|
150
|
+
- Task-worker recovery does **not** replay the whole user directive. Workers re-read `worker-prompt.md` and continue the current task from the existing worktree state.
|
|
151
|
+
- Recovery uses durable session metadata plus `worker-prompt.md` instead of an extra checkpoint artifact, idle child-session replay, or parent-scoped task rehydration.
|
|
152
|
+
|
|
153
|
+
In practice, the durable task-level recovery surface is the semantic `.hive` artifact set for that task, with `worker-prompt.md` plus bound feature/task/session metadata as the re-entry surface. Hive does **not** persist raw transcript dumps as its recovery contract.
|
|
124
154
|
|
|
125
155
|
Task-worker recovery is intentionally strict:
|
|
126
156
|
|
|
@@ -128,11 +158,26 @@ Task-worker recovery is intentionally strict:
|
|
|
128
158
|
- do not delegate
|
|
129
159
|
- do not re-read the full codebase
|
|
130
160
|
- re-read `worker-prompt.md`
|
|
161
|
+
- finish only the current task assignment
|
|
162
|
+
- do not merge
|
|
163
|
+
- do not start the next task
|
|
164
|
+
- do not use orchestration tools unless the worker prompt explicitly says so
|
|
131
165
|
- continue from the last known point
|
|
132
166
|
|
|
133
|
-
This split is deliberate:
|
|
167
|
+
This split is deliberate: primary and subagent sessions replay the stored user directive once after compaction, while task workers recover from their own bounded task contract instead of relying on parent-session replay.
|
|
168
|
+
|
|
169
|
+
Manual tasks follow the same DAG model as plan-backed tasks:
|
|
170
|
+
|
|
171
|
+
- `hive_task_create()` stores manual tasks with explicit `dependsOn` metadata instead of inferring sequential order.
|
|
172
|
+
- manual tasks are append-only.
|
|
173
|
+
- intermediate insertion requires plan amendment.
|
|
174
|
+
- dependencies on unfinished work require plan amendment.
|
|
175
|
+
- Structured manual-task fields such as `goal`, `description`, `acceptanceCriteria`, `files`, and `references` are turned into worker-facing `spec.md` content.
|
|
176
|
+
- If review feedback changes downstream sequencing or scope, update `plan.md` and run `hive_tasks_sync({ refreshPending: true })` so pending plan tasks pick up the new `dependsOn` graph and regenerated specs.
|
|
177
|
+
|
|
178
|
+
This recovery path applies to the built-in `forager-worker`, the runtime-only `hive-helper` bounded hard-task operational assistant, and custom agents derived from `forager-worker`. `hive-helper` handles merge recovery, state clarification, interrupted-state wrap-up, and safe manual-follow-up assistance while staying inside the current approved DAG boundary. It may summarize observable state, including `helperStatus`, and create safe append-only manual tasks, but it may never update plan-backed task state and must escalate DAG-changing requests for plan amendment. For the issue-72 style "task 3 is locally testable but task 4 has not started" situation, ask Helper to clarify the locally testable state and wrap-up surface first; ask it to create a safe manual follow-up only when the work can append after the current DAG; if you think you need `3b` / `3c` inserted before later plan-backed work, amend `plan.md` instead. `hive-helper` is intentionally OpenCode runtime-only in v1, not a custom base agent, and it does not appear in `.github/agents/` or `packages/vscode-hive/src/generators/`.
|
|
134
179
|
|
|
135
|
-
|
|
180
|
+
`hive-helper` also remains not a network consumer. It benefits indirectly from better upstream planning/orchestration/review decisions, but it does not call `hive_network_query` itself.
|
|
136
181
|
|
|
137
182
|
## Prompt Budgeting & Observability
|
|
138
183
|
|
|
@@ -183,7 +228,27 @@ Description.
|
|
|
183
228
|
|
|
184
229
|
## Configuration
|
|
185
230
|
|
|
186
|
-
Hive
|
|
231
|
+
Hive reads config from these locations, in order:
|
|
232
|
+
|
|
233
|
+
1. `<project>/.hive/agent-hive.json` (preferred)
|
|
234
|
+
2. `<project>/.opencode/agent_hive.json` (legacy fallback, used only when the new file is missing)
|
|
235
|
+
3. `~/.config/opencode/agent_hive.json` (global fallback)
|
|
236
|
+
|
|
237
|
+
If `.hive/agent-hive.json` exists but is invalid JSON or an invalid shape, Hive warns, skips the legacy project file, and falls back to the global config and defaults.
|
|
238
|
+
|
|
239
|
+
You can customize agent models, variants, disable skills, and disable MCP servers.
|
|
240
|
+
|
|
241
|
+
### Project-local config example
|
|
242
|
+
|
|
243
|
+
Create `.hive/agent-hive.json`:
|
|
244
|
+
|
|
245
|
+
```json
|
|
246
|
+
{
|
|
247
|
+
"$schema": "https://raw.githubusercontent.com/tctinh/agent-hive/main/packages/opencode-hive/schema/agent_hive.schema.json",
|
|
248
|
+
"agentMode": "unified",
|
|
249
|
+
"disableSkills": []
|
|
250
|
+
}
|
|
251
|
+
```
|
|
187
252
|
|
|
188
253
|
### Disable Skills or MCPs
|
|
189
254
|
|
|
@@ -287,6 +352,7 @@ Skill IDs must be safe directory names (no `/`, `\`, `..`, or `.`). Missing or i
|
|
|
287
352
|
|-------|------------------------|
|
|
288
353
|
| `hive-master` | `parallel-exploration` |
|
|
289
354
|
| `forager-worker` | `test-driven-development`, `verification-before-completion` |
|
|
355
|
+
| `hive-helper` | (none) |
|
|
290
356
|
| `scout-researcher` | (none) |
|
|
291
357
|
| `architect-planner` | `parallel-exploration` |
|
|
292
358
|
| `swarm-orchestrator` | (none) |
|
|
@@ -344,6 +410,10 @@ Define plugin-only custom subagents with `customAgents`. Freshly initialized `ag
|
|
|
344
410
|
- `baseAgent`: one of `forager-worker` or `hygienic-reviewer`
|
|
345
411
|
- `description`: delegation guidance injected into primary planner/orchestrator prompts
|
|
346
412
|
|
|
413
|
+
`hive-helper` is not a custom base agent. In v1 it stays runtime-only for isolated merge recovery and does not appear in `.github/agents/` and does not appear in `packages/vscode-hive/src/generators/`.
|
|
414
|
+
|
|
415
|
+
It is also not a network consumer; planning, orchestration, and review roles get network access first.
|
|
416
|
+
|
|
347
417
|
Published example (validated by `src/e2e/custom-agent-docs-example.test.ts`):
|
|
348
418
|
|
|
349
419
|
```json
|
|
@@ -411,7 +481,7 @@ Override models for specific agents:
|
|
|
411
481
|
|
|
412
482
|
## Pair with VS Code
|
|
413
483
|
|
|
414
|
-
For the full
|
|
484
|
+
For the full OpenCode-first workflow, install [vscode-hive](https://marketplace.visualstudio.com/items?itemName=tctinh.vscode-hive) as an optional review/sidebar companion for inline comments and approvals.
|
|
415
485
|
|
|
416
486
|
## License
|
|
417
487
|
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import type { AgentModelConfig, HiveConfig, ResolvedCustomAgentConfig } from '../types.js';
|
|
2
2
|
import type { SandboxConfig } from './dockerSandboxService.js';
|
|
3
3
|
/**
|
|
4
|
-
* ConfigService manages
|
|
4
|
+
* ConfigService manages Agent Hive config with read precedence:
|
|
5
|
+
* 1. <project>/.hive/agent-hive.json (preferred when present and valid)
|
|
6
|
+
* 2. <project>/.opencode/agent_hive.json (legacy fallback during migration)
|
|
7
|
+
* 3. ~/.config/opencode/agent_hive.json (fallback)
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
* - VSCode extension reads/writes this
|
|
8
|
-
* - OpenCode plugin reads this to enable features
|
|
9
|
-
* - Agent does NOT have tools to access this
|
|
9
|
+
* Writes remain global-only at ~/.config/opencode/agent_hive.json.
|
|
10
10
|
*/
|
|
11
11
|
export declare class ConfigService {
|
|
12
12
|
private configPath;
|
|
13
|
+
private projectConfigPath?;
|
|
14
|
+
private legacyProjectConfigPath?;
|
|
13
15
|
private cachedConfig;
|
|
14
16
|
private cachedCustomAgentConfigs;
|
|
15
|
-
|
|
17
|
+
private activeReadSourceType;
|
|
18
|
+
private activeReadPath;
|
|
19
|
+
private lastFallbackWarning;
|
|
20
|
+
constructor(projectRoot?: string);
|
|
16
21
|
/**
|
|
17
22
|
* Get config path
|
|
18
23
|
*/
|
|
@@ -21,6 +26,16 @@ export declare class ConfigService {
|
|
|
21
26
|
* Get the full config, merged with defaults.
|
|
22
27
|
*/
|
|
23
28
|
get(): HiveConfig;
|
|
29
|
+
getActiveReadSourceType(): 'project' | 'global';
|
|
30
|
+
getActiveReadPath(): string;
|
|
31
|
+
getLastFallbackWarning(): {
|
|
32
|
+
message: string;
|
|
33
|
+
sourceType: 'project' | 'global';
|
|
34
|
+
sourcePath: string;
|
|
35
|
+
fallbackType: 'global' | 'defaults';
|
|
36
|
+
fallbackPath?: string;
|
|
37
|
+
reason: 'parse_error' | 'validation_error' | 'read_error';
|
|
38
|
+
} | null;
|
|
24
39
|
/**
|
|
25
40
|
* Update config (partial merge).
|
|
26
41
|
*/
|
|
@@ -75,4 +90,11 @@ export declare class ConfigService {
|
|
|
75
90
|
getHookCadence(hookName: string, options?: {
|
|
76
91
|
safetyCritical?: boolean;
|
|
77
92
|
}): number;
|
|
93
|
+
private readStoredConfig;
|
|
94
|
+
private mergeWithDefaults;
|
|
95
|
+
private createProjectFallbackWarning;
|
|
96
|
+
private isValidStoredConfig;
|
|
97
|
+
private isStringArray;
|
|
98
|
+
private isValidAgentConfigDeclaration;
|
|
99
|
+
private isHookCadenceRecord;
|
|
78
100
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ContextFile } from '../types.js';
|
|
2
|
-
export type { ContextFile };
|
|
1
|
+
import type { ContextFile, ContextRole } from '../types.js';
|
|
2
|
+
export type { ContextFile, ContextRole };
|
|
3
3
|
export declare const RESERVED_OVERVIEW_CONTEXT = "overview";
|
|
4
4
|
export declare class ContextService {
|
|
5
5
|
private projectRoot;
|
|
@@ -9,6 +9,8 @@ export declare class ContextService {
|
|
|
9
9
|
list(featureName: string): ContextFile[];
|
|
10
10
|
getOverview(featureName: string): ContextFile | null;
|
|
11
11
|
listExecutionContext(featureName: string): ContextFile[];
|
|
12
|
+
listAgentsMdSyncContext(featureName: string): ContextFile[];
|
|
13
|
+
listNetworkContext(featureName: string): ContextFile[];
|
|
12
14
|
delete(featureName: string, fileName: string): boolean;
|
|
13
15
|
compile(featureName: string): string;
|
|
14
16
|
archive(featureName: string): {
|
|
@@ -22,4 +24,5 @@ export declare class ContextService {
|
|
|
22
24
|
newest?: string;
|
|
23
25
|
};
|
|
24
26
|
private normalizeFileName;
|
|
27
|
+
private classifyContextName;
|
|
25
28
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { FeatureService } from './featureService.js';
|
|
2
2
|
export { PlanService } from './planService.js';
|
|
3
3
|
export { TaskService } from './taskService.js';
|
|
4
|
+
export type { SyncOptions } from './taskService.js';
|
|
4
5
|
export { SubtaskService } from './subtaskService.js';
|
|
5
6
|
export { WorktreeService, createWorktreeService } from './worktreeService.js';
|
|
6
7
|
export type { WorktreeInfo, DiffResult, ApplyResult, CommitResult, MergeResult, WorktreeConfig } from './worktreeService.js';
|
|
7
8
|
export { ContextService } from './contextService.js';
|
|
9
|
+
export { NetworkService } from './networkService.js';
|
|
8
10
|
export { ReviewService } from './reviewService.js';
|
|
9
11
|
export { SessionService } from './sessionService.js';
|
|
10
12
|
export { ConfigService } from './configService.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface NetworkQueryOptions {
|
|
2
|
+
currentFeature?: string;
|
|
3
|
+
query: string;
|
|
4
|
+
maxFeatures: number;
|
|
5
|
+
maxSnippetsPerFeature: number;
|
|
6
|
+
maxSnippetChars: number;
|
|
7
|
+
}
|
|
8
|
+
export interface NetworkQueryResult {
|
|
9
|
+
feature: string;
|
|
10
|
+
sourceType: 'plan' | 'context';
|
|
11
|
+
sourceName: string;
|
|
12
|
+
path: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
snippet: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class NetworkService {
|
|
17
|
+
private readonly projectRoot;
|
|
18
|
+
private readonly contextService;
|
|
19
|
+
constructor(projectRoot: string);
|
|
20
|
+
query(options: NetworkQueryOptions): NetworkQueryResult[];
|
|
21
|
+
private collectMatches;
|
|
22
|
+
private matchPlan;
|
|
23
|
+
private matchContext;
|
|
24
|
+
private resolveDirectoryName;
|
|
25
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LockOptions } from '../utils/paths.js';
|
|
2
|
-
import { TaskStatus, TaskStatusType, TasksSyncResult, TaskInfo, Subtask, SubtaskType, WorkerSession } from '../types.js';
|
|
2
|
+
import { TaskStatus, TaskStatusType, TasksSyncResult, TaskInfo, Subtask, SubtaskType, WorkerSession, ManualTaskMetadata } from '../types.js';
|
|
3
3
|
/** Current schema version for TaskStatus */
|
|
4
4
|
export declare const TASK_STATUS_SCHEMA_VERSION = 1;
|
|
5
5
|
/** Fields that can be updated by background workers without clobbering completion-owned fields */
|
|
@@ -13,17 +13,21 @@ export interface CompletionFields {
|
|
|
13
13
|
summary?: string;
|
|
14
14
|
completedAt?: string;
|
|
15
15
|
}
|
|
16
|
+
export interface SyncOptions {
|
|
17
|
+
refreshPending?: boolean;
|
|
18
|
+
}
|
|
16
19
|
export declare class TaskService {
|
|
17
20
|
private projectRoot;
|
|
18
21
|
constructor(projectRoot: string);
|
|
19
|
-
sync(featureName: string): TasksSyncResult;
|
|
22
|
+
sync(featureName: string, options?: SyncOptions): TasksSyncResult;
|
|
20
23
|
/**
|
|
21
24
|
* Create a manual task with auto-incrementing index.
|
|
22
25
|
* Folder format: "01-task-name", "02-task-name", etc.
|
|
23
26
|
* Index ensures alphabetical sort = chronological order.
|
|
24
27
|
*/
|
|
25
|
-
create(featureName: string, name: string, order?: number): string;
|
|
28
|
+
create(featureName: string, name: string, order?: number, metadata?: ManualTaskMetadata): string;
|
|
26
29
|
private createFromPlan;
|
|
30
|
+
private refreshPendingTask;
|
|
27
31
|
buildSpecContent(params: {
|
|
28
32
|
featureName: string;
|
|
29
33
|
task: {
|
|
@@ -72,6 +76,7 @@ export declare class TaskService {
|
|
|
72
76
|
*/
|
|
73
77
|
private detectCycles;
|
|
74
78
|
writeSpec(featureName: string, taskFolder: string, content: string): string;
|
|
79
|
+
readSpec(featureName: string, taskFolder: string): string | null;
|
|
75
80
|
/**
|
|
76
81
|
* Update task status with locked atomic write.
|
|
77
82
|
* Uses file locking to prevent race conditions between concurrent updates.
|
|
@@ -108,6 +113,7 @@ export declare class TaskService {
|
|
|
108
113
|
private listFolders;
|
|
109
114
|
private deleteTask;
|
|
110
115
|
private getNextOrder;
|
|
116
|
+
private validateManualTaskDependsOn;
|
|
111
117
|
private parseTasksFromPlan;
|
|
112
118
|
createSubtask(featureName: string, taskFolder: string, name: string, type?: SubtaskType): Subtask;
|
|
113
119
|
updateSubtask(featureName: string, taskFolder: string, subtaskId: string, status: TaskStatusType): Subtask;
|
|
@@ -120,5 +126,6 @@ export declare class TaskService {
|
|
|
120
126
|
readSubtaskReport(featureName: string, taskFolder: string, subtaskId: string): string | null;
|
|
121
127
|
private listSubtaskFolders;
|
|
122
128
|
private findSubtaskFolder;
|
|
129
|
+
private buildManualTaskSpec;
|
|
123
130
|
private slugify;
|
|
124
131
|
}
|
|
@@ -22,12 +22,23 @@ export interface CommitResult {
|
|
|
22
22
|
sha: string;
|
|
23
23
|
message?: string;
|
|
24
24
|
}
|
|
25
|
+
export interface MergeOptions {
|
|
26
|
+
preserveConflicts?: boolean;
|
|
27
|
+
cleanup?: 'none' | 'worktree' | 'worktree+branch';
|
|
28
|
+
}
|
|
25
29
|
export interface MergeResult {
|
|
26
30
|
success: boolean;
|
|
27
31
|
merged: boolean;
|
|
32
|
+
strategy: 'merge' | 'squash' | 'rebase';
|
|
28
33
|
sha?: string;
|
|
29
|
-
filesChanged
|
|
30
|
-
conflicts
|
|
34
|
+
filesChanged: string[];
|
|
35
|
+
conflicts: string[];
|
|
36
|
+
conflictState: 'none' | 'aborted' | 'preserved';
|
|
37
|
+
cleanup: {
|
|
38
|
+
worktreeRemoved: boolean;
|
|
39
|
+
branchDeleted: boolean;
|
|
40
|
+
pruned: boolean;
|
|
41
|
+
};
|
|
31
42
|
error?: string;
|
|
32
43
|
}
|
|
33
44
|
export interface WorktreeConfig {
|
|
@@ -50,7 +61,11 @@ export declare class WorktreeService {
|
|
|
50
61
|
revertDiff(feature: string, step: string, baseBranch?: string): Promise<ApplyResult>;
|
|
51
62
|
private parseFilesFromDiff;
|
|
52
63
|
revertFromSavedDiff(diffPath: string): Promise<ApplyResult>;
|
|
53
|
-
remove(feature: string, step: string, deleteBranch?: boolean): Promise<
|
|
64
|
+
remove(feature: string, step: string, deleteBranch?: boolean): Promise<{
|
|
65
|
+
worktreeRemoved: boolean;
|
|
66
|
+
branchDeleted: boolean;
|
|
67
|
+
pruned: boolean;
|
|
68
|
+
}>;
|
|
54
69
|
list(feature?: string): Promise<WorktreeInfo[]>;
|
|
55
70
|
cleanup(feature?: string): Promise<{
|
|
56
71
|
removed: string[];
|
|
@@ -59,8 +74,9 @@ export declare class WorktreeService {
|
|
|
59
74
|
checkConflicts(feature: string, step: string, baseBranch?: string): Promise<string[]>;
|
|
60
75
|
checkConflictsFromSavedDiff(diffPath: string, reverse?: boolean): Promise<string[]>;
|
|
61
76
|
commitChanges(feature: string, step: string, message?: string): Promise<CommitResult>;
|
|
62
|
-
merge(feature: string, step: string, strategy?: "merge" | "squash" | "rebase", message?: string): Promise<MergeResult>;
|
|
77
|
+
merge(feature: string, step: string, strategy?: "merge" | "squash" | "rebase", message?: string, options?: MergeOptions): Promise<MergeResult>;
|
|
63
78
|
hasUncommittedChanges(feature: string, step: string): Promise<boolean>;
|
|
64
79
|
private parseConflictsFromError;
|
|
80
|
+
private getActiveConflictFiles;
|
|
65
81
|
}
|
|
66
82
|
export declare function createWorktreeService(projectDir: string): WorktreeService;
|
|
@@ -50,6 +50,16 @@ export interface WorkerSession {
|
|
|
50
50
|
/** Number of messages exchanged in session */
|
|
51
51
|
messageCount?: number;
|
|
52
52
|
}
|
|
53
|
+
export interface ManualTaskMetadata {
|
|
54
|
+
goal?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
acceptanceCriteria?: string[];
|
|
57
|
+
references?: string[];
|
|
58
|
+
files?: string[];
|
|
59
|
+
reason?: string;
|
|
60
|
+
source?: 'review' | 'operator' | 'ad_hoc';
|
|
61
|
+
dependsOn?: string[];
|
|
62
|
+
}
|
|
53
63
|
export interface TaskStatus {
|
|
54
64
|
/** Schema version for forward compatibility (default: 1) */
|
|
55
65
|
schemaVersion?: number;
|
|
@@ -71,6 +81,8 @@ export interface TaskStatus {
|
|
|
71
81
|
* Resolved from plan.md dependency annotations during hive_tasks_sync.
|
|
72
82
|
*/
|
|
73
83
|
dependsOn?: string[];
|
|
84
|
+
/** Structured metadata for manual tasks */
|
|
85
|
+
metadata?: ManualTaskMetadata;
|
|
74
86
|
}
|
|
75
87
|
export type ReviewDocument = 'plan' | 'overview';
|
|
76
88
|
export interface ReviewThread {
|
|
@@ -115,12 +127,18 @@ export interface FeatureInfo {
|
|
|
115
127
|
commentCount: number;
|
|
116
128
|
reviewCounts: ReviewCounts;
|
|
117
129
|
}
|
|
130
|
+
export type ContextRole = 'human' | 'scratchpad' | 'operational' | 'durable';
|
|
118
131
|
export interface ContextFile {
|
|
119
132
|
name: string;
|
|
120
133
|
content: string;
|
|
121
134
|
updatedAt: string;
|
|
135
|
+
role: ContextRole;
|
|
136
|
+
includeInExecution: boolean;
|
|
137
|
+
includeInAgentsMdSync: boolean;
|
|
138
|
+
includeInNetwork: boolean;
|
|
122
139
|
}
|
|
123
140
|
export type SessionKind = 'primary' | 'subagent' | 'task-worker' | 'unknown';
|
|
141
|
+
export type DirectiveRecoveryState = 'available' | 'consumed' | 'escalated';
|
|
124
142
|
export interface SessionInfo {
|
|
125
143
|
sessionId: string;
|
|
126
144
|
featureName?: string;
|
|
@@ -130,6 +148,7 @@ export interface SessionInfo {
|
|
|
130
148
|
sessionKind?: SessionKind;
|
|
131
149
|
workerPromptPath?: string;
|
|
132
150
|
directivePrompt?: string;
|
|
151
|
+
directiveRecoveryState?: DirectiveRecoveryState;
|
|
133
152
|
replayDirectivePending?: boolean;
|
|
134
153
|
startedAt: string;
|
|
135
154
|
lastActiveAt: string;
|
|
@@ -162,11 +181,11 @@ export interface AgentModelConfig {
|
|
|
162
181
|
/** Variant key for model reasoning/effort level (e.g., 'low', 'medium', 'high', 'max') */
|
|
163
182
|
variant?: string;
|
|
164
183
|
}
|
|
165
|
-
export declare const BUILT_IN_AGENT_NAMES: readonly ["hive-master", "architect-planner", "swarm-orchestrator", "scout-researcher", "forager-worker", "hygienic-reviewer"];
|
|
184
|
+
export declare const BUILT_IN_AGENT_NAMES: readonly ["hive-master", "architect-planner", "swarm-orchestrator", "scout-researcher", "forager-worker", "hive-helper", "hygienic-reviewer"];
|
|
166
185
|
export type BuiltInAgentName = (typeof BUILT_IN_AGENT_NAMES)[number];
|
|
167
186
|
export declare const CUSTOM_AGENT_BASES: readonly ["forager-worker", "hygienic-reviewer"];
|
|
168
187
|
export type CustomAgentBase = (typeof CUSTOM_AGENT_BASES)[number];
|
|
169
|
-
export declare const CUSTOM_AGENT_RESERVED_NAMES: readonly ["hive-master", "architect-planner", "swarm-orchestrator", "scout-researcher", "forager-worker", "hygienic-reviewer", "hive", "architect", "swarm", "scout", "forager", "hygienic", "receiver", "build", "plan", "code"];
|
|
188
|
+
export declare const CUSTOM_AGENT_RESERVED_NAMES: readonly ["hive-master", "architect-planner", "swarm-orchestrator", "scout-researcher", "forager-worker", "hive-helper", "hygienic-reviewer", "hive", "architect", "swarm", "scout", "forager", "hygienic", "receiver", "build", "plan", "code"];
|
|
170
189
|
export interface CustomAgentConfig {
|
|
171
190
|
baseAgent: CustomAgentBase;
|
|
172
191
|
description: string;
|
|
@@ -204,6 +223,8 @@ export interface HiveConfig {
|
|
|
204
223
|
'scout-researcher'?: AgentModelConfig;
|
|
205
224
|
/** Forager Worker */
|
|
206
225
|
'forager-worker'?: AgentModelConfig;
|
|
226
|
+
/** Hive Helper */
|
|
227
|
+
'hive-helper'?: AgentModelConfig;
|
|
207
228
|
/** Hygienic Reviewer */
|
|
208
229
|
'hygienic-reviewer'?: AgentModelConfig;
|
|
209
230
|
};
|
|
@@ -224,6 +245,7 @@ export declare const DEFAULT_AGENT_MODELS: {
|
|
|
224
245
|
readonly 'swarm-orchestrator': "github-copilot/claude-opus-4.5";
|
|
225
246
|
readonly 'scout-researcher': "zai-coding-plan/glm-4.7";
|
|
226
247
|
readonly 'forager-worker': "github-copilot/gpt-5.2-codex";
|
|
248
|
+
readonly 'hive-helper': "github-copilot/gpt-5.2-codex";
|
|
227
249
|
readonly 'hygienic-reviewer': "github-copilot/gpt-5.2-codex";
|
|
228
250
|
};
|
|
229
251
|
export declare const DEFAULT_HIVE_CONFIG: HiveConfig;
|