drizzy-agent 0.6.3 → 0.7.1
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 +3 -3
- package/dist/agents/builtin-agents/{atlas-agent.d.ts → orchestrator-agent.d.ts} +1 -1
- package/dist/agents/coder-junior/gpt-5-3-codex.d.ts +1 -1
- package/dist/agents/coder-junior/gpt-5-4.d.ts +1 -1
- package/dist/agents/coder-junior/gpt.d.ts +1 -1
- package/dist/agents/env-context.d.ts +1 -1
- package/dist/agents/{atlas → orchestrator}/agent.d.ts +9 -9
- package/dist/agents/{atlas → orchestrator}/default.d.ts +3 -3
- package/dist/agents/{atlas → orchestrator}/gemini.d.ts +3 -3
- package/dist/agents/{atlas → orchestrator}/gpt.d.ts +3 -3
- package/dist/agents/orchestrator/index.d.ts +2 -0
- package/dist/agents/{atlas → orchestrator}/prompt-section-builder.d.ts +1 -1
- package/dist/agents/types.d.ts +2 -2
- package/dist/cli/index.js +26 -26
- package/dist/config/schema/agent-names.d.ts +3 -3
- package/dist/config/schema/agent-overrides.d.ts +1 -1
- package/dist/config/schema/drizzy-agent-config.d.ts +2 -2
- package/dist/config/schema/hooks.d.ts +1 -1
- package/dist/create-hooks.d.ts +1 -1
- package/dist/drizzy-agent.schema.json +2 -2
- package/dist/features/boulder-state/types.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/hook-message-injector/injector.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/{atlas → orchestrator}/event-handler.d.ts +3 -3
- package/dist/hooks/orchestrator/hook-name.d.ts +1 -0
- package/dist/hooks/orchestrator/idle-event.d.ts +8 -0
- package/dist/hooks/orchestrator/index.d.ts +3 -0
- package/dist/hooks/{atlas/atlas-hook.d.ts → orchestrator/orchestrator-hook.d.ts} +2 -2
- package/dist/hooks/{atlas → orchestrator}/types.d.ts +1 -1
- package/dist/hooks/planner-md-only/agent-resolution.d.ts +1 -1
- package/dist/index.js +196 -196
- package/dist/plugin/hooks/create-continuation-hooks.d.ts +2 -2
- package/dist/shared/agent-display-names.d.ts +1 -1
- package/dist/shared/agent-model-defaults.d.ts +2 -2
- package/dist/tools/call-drizzy-agent/background-agent-executor.d.ts +5 -0
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/background-executor.d.ts +2 -2
- package/dist/tools/call-drizzy-agent/constants.d.ts +2 -0
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/index.d.ts +1 -1
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/session-creator.d.ts +2 -2
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/subagent-session-creator.d.ts +2 -2
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/sync-executor.d.ts +2 -2
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/tools.d.ts +1 -1
- package/dist/tools/{call-omo-agent → call-drizzy-agent}/types.d.ts +3 -3
- package/dist/tools/delegate-task/constants.d.ts +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/package.json +12 -12
- package/dist/agents/atlas/index.d.ts +0 -2
- package/dist/hooks/atlas/hook-name.d.ts +0 -1
- package/dist/hooks/atlas/idle-event.d.ts +0 -8
- package/dist/hooks/atlas/index.d.ts +0 -3
- package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
- package/dist/tools/call-omo-agent/constants.d.ts +0 -2
- /package/dist/hooks/{atlas → orchestrator}/boulder-continuation-injector.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/coder-path.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/is-abort-error.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/recent-model-resolver.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/session-last-agent.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/subagent-session-id.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/system-reminder-templates.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/tool-execute-after.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/tool-execute-before.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/verification-reminders.d.ts +0 -0
- /package/dist/hooks/{atlas → orchestrator}/write-edit-tool-policy.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → call-drizzy-agent}/completion-poller.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → call-drizzy-agent}/message-dir.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → call-drizzy-agent}/message-processor.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → call-drizzy-agent}/message-storage-directory.d.ts +0 -0
- /package/dist/tools/{call-omo-agent → call-drizzy-agent}/tool-context-with-metadata.d.ts +0 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ DrizzyAgent provides **discipline agents** that work together to complete coding
|
|
|
16
16
|
| **Oracle** | Architecture consultant - debugging, complex logic decisions | GPT-5.4 / Kimi K2.5 / Gemini 3.1 Pro / Claude Opus 4.6 |
|
|
17
17
|
| **Librarian** | Documentation/code search - external references, OSS examples | Gemini 3 Flash / GLM-4.7 / Claude Sonnet 4.5 |
|
|
18
18
|
| **Explore** | Fast codebase grep - pattern discovery, cross-layer search | Custom resolver (Claude / Copilot / OpenAI) |
|
|
19
|
-
| **
|
|
19
|
+
| **Orchestrator** | Runs Planner-generated plans step by step | Kimi K2.5 / Claude Sonnet 4.6 / GPT-5.4 / Gemini 3.1 Pro |
|
|
20
20
|
| **Researcher** | Deep research orchestrator - multi-source investigation with cited reports | Gemini 3.1 Pro / Kimi K2.5 / Claude Sonnet 4.6 / GPT-5.4 / GLM-4.7 Free |
|
|
21
21
|
| **Coder Junior** | Delegated sub-tasks from Coder via category system | Claude Sonnet 4.6 / GPT-5.4 / Gemini 3 Flash |
|
|
22
22
|
| **Researcher Junior** | Focused web research subagent for parallel sub-topic investigation | Kimi K2.5 / Claude Sonnet 4.6 / GPT-5.4 / GLM-4.7 Free |
|
|
@@ -24,7 +24,7 @@ DrizzyAgent provides **discipline agents** that work together to complete coding
|
|
|
24
24
|
| **Plan Reviewer** | Plan quality review - verifiability, completeness checks | GPT-5.4 / Kimi K2.5 / Claude Opus 4.6 / Gemini 3.1 Pro |
|
|
25
25
|
| **Multimodal Looker** | Image and visual analysis | GPT-5.4 / Kimi K2.5 / Gemini 3 Flash |
|
|
26
26
|
|
|
27
|
-
Main selectable agents: **Coder**, **GPTCoder**, **Planner**, **
|
|
27
|
+
Main selectable agents: **Coder**, **GPTCoder**, **Planner**, **Orchestrator**, **Researcher**.
|
|
28
28
|
Subagent-only specialists include **Researcher Junior**, **Oracle**, **Librarian**, **Explore**, and other focused helpers.
|
|
29
29
|
|
|
30
30
|
## Key Features
|
|
@@ -214,7 +214,7 @@ bun test
|
|
|
214
214
|
|
|
215
215
|
```
|
|
216
216
|
src/
|
|
217
|
-
├── agents/ # 13 agents (Coder, GPTCoder, Oracle, Librarian, Explore,
|
|
217
|
+
├── agents/ # 13 agents (Coder, GPTCoder, Oracle, Librarian, Explore, Orchestrator, Planner, Researcher, Researcher Junior, Plan Consultant, Plan Reviewer, Coder Junior, Multimodal Looker)
|
|
218
218
|
├── hooks/ # 46 lifecycle hooks
|
|
219
219
|
├── tools/ # 26 built-in tools
|
|
220
220
|
├── features/ # Core feature modules
|
|
@@ -2,7 +2,7 @@ import type { AgentConfig } from "@opencode-ai/sdk";
|
|
|
2
2
|
import type { AgentOverrides } from "../types";
|
|
3
3
|
import type { CategoriesConfig, CategoryConfig } from "../../config/schema";
|
|
4
4
|
import type { AvailableAgent, AvailableSkill } from "../dynamic-agent-prompt-builder";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function maybeCreateOrchestratorConfig(input: {
|
|
6
6
|
disabledAgents: string[];
|
|
7
7
|
agentOverrides: AgentOverrides;
|
|
8
8
|
uiSelectedModel?: string;
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* GPTCoder-style prompt adapted for a focused executor:
|
|
5
5
|
* - Same autonomy, reporting, parallelism, and tool usage patterns
|
|
6
|
-
* - CAN spawn explore/librarian via
|
|
6
|
+
* - CAN spawn explore/librarian via call_drizzy_agent for research
|
|
7
7
|
*/
|
|
8
8
|
export declare function buildGpt53CodexCoderJuniorPrompt(useTaskSystem: boolean, promptAppend?: string): string;
|
|
@@ -6,6 +6,6 @@
|
|
|
6
6
|
* - Deterministic tool usage (always/never, not try/maybe)
|
|
7
7
|
* - Prose-first output style
|
|
8
8
|
* - Nuanced autonomy (focus unless directly conflicting)
|
|
9
|
-
* - CAN spawn explore/librarian via
|
|
9
|
+
* - CAN spawn explore/librarian via call_drizzy_agent for research
|
|
10
10
|
*/
|
|
11
11
|
export declare function buildGpt54CoderJuniorPrompt(useTaskSystem: boolean, promptAppend?: string): string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* GPTCoder-style prompt adapted for a focused executor:
|
|
5
5
|
* - Same autonomy, reporting, parallelism, and tool usage patterns
|
|
6
|
-
* - CAN spawn explore/librarian via
|
|
6
|
+
* - CAN spawn explore/librarian via call_drizzy_agent for research
|
|
7
7
|
* - Used as fallback for GPT models without a model-specific prompt
|
|
8
8
|
*/
|
|
9
9
|
export declare function buildGptCoderJuniorPrompt(useTaskSystem: boolean, promptAppend?: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Creates
|
|
2
|
+
* Creates Drizzy-specific environment context (timezone, locale).
|
|
3
3
|
* Note: Working directory, platform, and date are already provided by OpenCode's system.ts,
|
|
4
4
|
* so we only include fields that OpenCode doesn't provide to avoid duplication.
|
|
5
5
|
* See: https://github.com/code-yeongyu/oh-my-openagent/issues/379
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Orchestrator - Master Orchestrator Agent
|
|
3
3
|
*
|
|
4
4
|
* Orchestrates work via task() to complete ALL tasks in a todo list until fully done.
|
|
5
5
|
* You are the conductor of a symphony of specialized agents.
|
|
@@ -13,11 +13,11 @@ import type { AgentConfig } from "@opencode-ai/sdk";
|
|
|
13
13
|
import type { AgentPromptMetadata } from "../types";
|
|
14
14
|
import type { AvailableAgent, AvailableSkill } from "../dynamic-agent-prompt-builder";
|
|
15
15
|
import type { CategoryConfig } from "../../config/schema";
|
|
16
|
-
export type
|
|
16
|
+
export type OrchestratorPromptSource = "default" | "gpt" | "gemini";
|
|
17
17
|
/**
|
|
18
|
-
* Determines which
|
|
18
|
+
* Determines which Orchestrator prompt to use based on model.
|
|
19
19
|
*/
|
|
20
|
-
export declare function
|
|
20
|
+
export declare function getOrchestratorPromptSource(model?: string): OrchestratorPromptSource;
|
|
21
21
|
export interface OrchestratorContext {
|
|
22
22
|
model?: string;
|
|
23
23
|
availableAgents?: AvailableAgent[];
|
|
@@ -25,11 +25,11 @@ export interface OrchestratorContext {
|
|
|
25
25
|
userCategories?: Record<string, CategoryConfig>;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Gets the appropriate
|
|
28
|
+
* Gets the appropriate Orchestrator prompt based on model.
|
|
29
29
|
*/
|
|
30
|
-
export declare function
|
|
31
|
-
export declare function
|
|
32
|
-
export declare namespace
|
|
30
|
+
export declare function getOrchestratorPrompt(model?: string): string;
|
|
31
|
+
export declare function createOrchestratorAgent(ctx: OrchestratorContext): AgentConfig;
|
|
32
|
+
export declare namespace createOrchestratorAgent {
|
|
33
33
|
var mode: "all";
|
|
34
34
|
}
|
|
35
|
-
export declare const
|
|
35
|
+
export declare const orchestratorPromptMetadata: AgentPromptMetadata;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Default
|
|
2
|
+
* Default Orchestrator system prompt optimized for Claude series models.
|
|
3
3
|
*
|
|
4
4
|
* Key characteristics:
|
|
5
5
|
* - Optimized for Claude's tendency to be "helpful" by forcing explicit delegation
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - Detailed workflow steps with narrative context
|
|
8
8
|
* - Extended reasoning sections
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
export declare function
|
|
10
|
+
export declare const ORCHESTRATOR_SYSTEM_PROMPT: string;
|
|
11
|
+
export declare function getDefaultOrchestratorPrompt(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Gemini-optimized
|
|
2
|
+
* Gemini-optimized Orchestrator System Prompt
|
|
3
3
|
*
|
|
4
4
|
* Key differences from Claude/GPT variants:
|
|
5
5
|
* - EXTREME delegation enforcement (Gemini strongly prefers doing work itself)
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - Repeated tool-call mandates (Gemini skips tool calls in favor of reasoning)
|
|
8
8
|
* - Consequence-driven framing (Gemini ignores soft warnings)
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
export declare function
|
|
10
|
+
export declare const ORCHESTRATOR_GEMINI_SYSTEM_PROMPT: string;
|
|
11
|
+
export declare function getGeminiOrchestratorPrompt(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GPT-5.4 Optimized
|
|
2
|
+
* GPT-5.4 Optimized Orchestrator System Prompt
|
|
3
3
|
*
|
|
4
4
|
* Tuned for GPT-5.4 system prompt design principles:
|
|
5
5
|
* - Prose-first output style
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* - XML-style section tags for clear structure
|
|
8
8
|
* - Scope discipline (no extra features)
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
export declare function
|
|
10
|
+
export declare const ORCHESTRATOR_GPT_SYSTEM_PROMPT: string;
|
|
11
|
+
export declare function getGptOrchestratorPrompt(): string;
|
package/dist/agents/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AgentConfig } from "@opencode-ai/sdk";
|
|
2
2
|
/**
|
|
3
3
|
* Agent mode determines UI model selection behavior:
|
|
4
|
-
* - "primary": Respects user's UI-selected model (coder,
|
|
4
|
+
* - "primary": Respects user's UI-selected model (coder, orchestrator)
|
|
5
5
|
* - "subagent": Uses own fallback chain, ignores UI selection (oracle, explore, etc.)
|
|
6
6
|
* - "all": Available in both contexts (OpenCode compatibility)
|
|
7
7
|
*/
|
|
@@ -56,7 +56,7 @@ export declare function isGptModel(model: string): boolean;
|
|
|
56
56
|
export declare function isGpt5_4Model(model: string): boolean;
|
|
57
57
|
export declare function isGpt5_3CodexModel(model: string): boolean;
|
|
58
58
|
export declare function isGeminiModel(model: string): boolean;
|
|
59
|
-
export type BuiltinAgentName = "coder" | "gptcoder" | "oracle" | "librarian" | "explore" | "multimodal-looker" | "plan-consultant" | "plan-reviewer" | "
|
|
59
|
+
export type BuiltinAgentName = "coder" | "gptcoder" | "oracle" | "librarian" | "explore" | "multimodal-looker" | "plan-consultant" | "plan-reviewer" | "orchestrator" | "coder-junior" | "researcher" | "researcher-junior";
|
|
60
60
|
export type OverridableAgentName = "build" | BuiltinAgentName;
|
|
61
61
|
export type AgentName = BuiltinAgentName;
|
|
62
62
|
export type AgentOverrideConfig = Partial<AgentConfig> & {
|
package/dist/cli/index.js
CHANGED
|
@@ -3488,7 +3488,7 @@ var init_agent_model_defaults = __esm(() => {
|
|
|
3488
3488
|
],
|
|
3489
3489
|
includeInInstall: true
|
|
3490
3490
|
},
|
|
3491
|
-
|
|
3491
|
+
orchestrator: {
|
|
3492
3492
|
chain: [{ providers: ["kimi-for-coding"], model: "k2p5" }, { providers: CLAUDE_PROVIDERS, model: "claude-sonnet-4-6" }, { providers: CLAUDE_PROVIDERS, model: "claude-sonnet-4-5" }, { providers: OPENAI_PROVIDERS, model: "gpt-5.4", variant: "medium" }, { providers: GEMINI_PROVIDERS, model: "gemini-3.1-pro" }],
|
|
3493
3493
|
includeInInstall: true
|
|
3494
3494
|
},
|
|
@@ -20813,7 +20813,7 @@ var BuiltinAgentNameSchema = exports_external.enum([
|
|
|
20813
20813
|
"multimodal-looker",
|
|
20814
20814
|
"plan-consultant",
|
|
20815
20815
|
"plan-reviewer",
|
|
20816
|
-
"
|
|
20816
|
+
"orchestrator",
|
|
20817
20817
|
"coder-junior",
|
|
20818
20818
|
"researcher",
|
|
20819
20819
|
"researcher-junior"
|
|
@@ -20839,7 +20839,7 @@ var OverridableAgentNameSchema = exports_external.enum([
|
|
|
20839
20839
|
"librarian",
|
|
20840
20840
|
"explore",
|
|
20841
20841
|
"multimodal-looker",
|
|
20842
|
-
"
|
|
20842
|
+
"orchestrator"
|
|
20843
20843
|
]);
|
|
20844
20844
|
// src/config/schema/fallback-models.ts
|
|
20845
20845
|
var FallbackModelsSchema = exports_external.union([exports_external.string(), exports_external.array(exports_external.string())]);
|
|
@@ -20909,7 +20909,7 @@ var AgentOverridesSchema = exports_external.object({
|
|
|
20909
20909
|
librarian: AgentOverrideConfigSchema.optional(),
|
|
20910
20910
|
explore: AgentOverrideConfigSchema.optional(),
|
|
20911
20911
|
"multimodal-looker": AgentOverrideConfigSchema.optional(),
|
|
20912
|
-
|
|
20912
|
+
orchestrator: AgentOverrideConfigSchema.optional(),
|
|
20913
20913
|
researcher: AgentOverrideConfigSchema.optional(),
|
|
20914
20914
|
"researcher-junior": AgentOverrideConfigSchema.optional()
|
|
20915
20915
|
});
|
|
@@ -21095,7 +21095,7 @@ var HookNameSchema = exports_external.enum([
|
|
|
21095
21095
|
"no-coder-gpt",
|
|
21096
21096
|
"no-gptcoder-non-gpt",
|
|
21097
21097
|
"start-work",
|
|
21098
|
-
"
|
|
21098
|
+
"orchestrator",
|
|
21099
21099
|
"unstable-agent-babysitter",
|
|
21100
21100
|
"task-resume-info",
|
|
21101
21101
|
"stop-continuation-guard",
|
|
@@ -24036,8 +24036,8 @@ var AGENT_NAME_MAP = {
|
|
|
24036
24036
|
planner: "planner",
|
|
24037
24037
|
"Prometheus (Planner)": "planner",
|
|
24038
24038
|
prometheus: "planner",
|
|
24039
|
-
|
|
24040
|
-
|
|
24039
|
+
Orchestrator: "orchestrator",
|
|
24040
|
+
orchestrator: "orchestrator",
|
|
24041
24041
|
"Plan Consultant": "plan-consultant",
|
|
24042
24042
|
metis: "plan-consultant",
|
|
24043
24043
|
"plan-consultant": "plan-consultant",
|
|
@@ -24063,7 +24063,7 @@ var BUILTIN_AGENT_NAMES = new Set([
|
|
|
24063
24063
|
"plan-reviewer",
|
|
24064
24064
|
"planner",
|
|
24065
24065
|
"prometheus",
|
|
24066
|
-
"
|
|
24066
|
+
"orchestrator",
|
|
24067
24067
|
"build"
|
|
24068
24068
|
]);
|
|
24069
24069
|
function migrateAgentNames(agents) {
|
|
@@ -24081,7 +24081,7 @@ function migrateAgentNames(agents) {
|
|
|
24081
24081
|
// src/shared/migration/hook-names.ts
|
|
24082
24082
|
var HOOK_NAME_MAP = {
|
|
24083
24083
|
"anthropic-auto-compact": "anthropic-context-window-limit-recovery",
|
|
24084
|
-
"coder-orchestrator": "
|
|
24084
|
+
"coder-orchestrator": "orchestrator",
|
|
24085
24085
|
"coder-gpt-hephaestus-reminder": "no-coder-gpt",
|
|
24086
24086
|
"no-coder-gpt": "no-coder-gpt",
|
|
24087
24087
|
"coder-junior-notepad": "coder-junior-notepad",
|
|
@@ -24271,7 +24271,7 @@ var AGENT_DISPLAY_NAMES = {
|
|
|
24271
24271
|
coder: "Coder",
|
|
24272
24272
|
gptcoder: "GPTCoder",
|
|
24273
24273
|
planner: "Planner",
|
|
24274
|
-
|
|
24274
|
+
orchestrator: "Orchestrator",
|
|
24275
24275
|
"coder-junior": "Coder Junior",
|
|
24276
24276
|
planConsultant: "Plan Consultant",
|
|
24277
24277
|
planReviewer: "Plan Reviewer",
|
|
@@ -24319,8 +24319,8 @@ var LEGACY_AGENT_REQUIREMENT_OVERRIDES = {
|
|
|
24319
24319
|
gptcoder: {
|
|
24320
24320
|
requiresProvider: AGENT_MODEL_DEFAULTS.gptcoder.requiresAnyProvider
|
|
24321
24321
|
},
|
|
24322
|
-
|
|
24323
|
-
fallbackChain: pickFallbackEntries(AGENT_MODEL_DEFAULTS.
|
|
24322
|
+
orchestrator: {
|
|
24323
|
+
fallbackChain: pickFallbackEntries(AGENT_MODEL_DEFAULTS.orchestrator.chain, ["claude-sonnet-4-6", "gpt-5.4"])
|
|
24324
24324
|
}
|
|
24325
24325
|
};
|
|
24326
24326
|
var LEGACY_CATEGORY_REQUIREMENT_OVERRIDES = {
|
|
@@ -26376,7 +26376,7 @@ async function executeOnCompleteHook(options) {
|
|
|
26376
26376
|
|
|
26377
26377
|
// src/cli/run/agent-resolver.ts
|
|
26378
26378
|
var import_picocolors13 = __toESM(require_picocolors(), 1);
|
|
26379
|
-
var CORE_AGENT_ORDER = ["coder", "gptcoder", "planner", "
|
|
26379
|
+
var CORE_AGENT_ORDER = ["coder", "gptcoder", "planner", "orchestrator", "researcher"];
|
|
26380
26380
|
var DEFAULT_AGENT = "coder";
|
|
26381
26381
|
var normalizeAgentName = (agent) => {
|
|
26382
26382
|
if (!agent)
|
|
@@ -29286,7 +29286,7 @@ function createMcpOAuthCommand() {
|
|
|
29286
29286
|
// package.json
|
|
29287
29287
|
var package_default = {
|
|
29288
29288
|
name: "drizzy-agent",
|
|
29289
|
-
version: "0.
|
|
29289
|
+
version: "0.7.1",
|
|
29290
29290
|
description: "DrizzyAgent - AI agent plugin for OpenCode",
|
|
29291
29291
|
main: "dist/index.js",
|
|
29292
29292
|
types: "dist/index.d.ts",
|
|
@@ -29362,17 +29362,17 @@ var package_default = {
|
|
|
29362
29362
|
typescript: "^5.7.3"
|
|
29363
29363
|
},
|
|
29364
29364
|
optionalDependencies: {
|
|
29365
|
-
"drizzy-agent-darwin-arm64": "0.
|
|
29366
|
-
"drizzy-agent-darwin-x64": "0.
|
|
29367
|
-
"drizzy-agent-darwin-x64-baseline": "0.
|
|
29368
|
-
"drizzy-agent-linux-arm64": "0.
|
|
29369
|
-
"drizzy-agent-linux-arm64-musl": "0.
|
|
29370
|
-
"drizzy-agent-linux-x64": "0.
|
|
29371
|
-
"drizzy-agent-linux-x64-baseline": "0.
|
|
29372
|
-
"drizzy-agent-linux-x64-musl": "0.
|
|
29373
|
-
"drizzy-agent-linux-x64-musl-baseline": "0.
|
|
29374
|
-
"drizzy-agent-windows-x64": "0.
|
|
29375
|
-
"drizzy-agent-windows-x64-baseline": "0.
|
|
29365
|
+
"drizzy-agent-darwin-arm64": "0.7.1",
|
|
29366
|
+
"drizzy-agent-darwin-x64": "0.7.1",
|
|
29367
|
+
"drizzy-agent-darwin-x64-baseline": "0.7.1",
|
|
29368
|
+
"drizzy-agent-linux-arm64": "0.7.1",
|
|
29369
|
+
"drizzy-agent-linux-arm64-musl": "0.7.1",
|
|
29370
|
+
"drizzy-agent-linux-x64": "0.7.1",
|
|
29371
|
+
"drizzy-agent-linux-x64-baseline": "0.7.1",
|
|
29372
|
+
"drizzy-agent-linux-x64-musl": "0.7.1",
|
|
29373
|
+
"drizzy-agent-linux-x64-musl-baseline": "0.7.1",
|
|
29374
|
+
"drizzy-agent-windows-x64": "0.7.1",
|
|
29375
|
+
"drizzy-agent-windows-x64-baseline": "0.7.1"
|
|
29376
29376
|
},
|
|
29377
29377
|
overrides: {
|
|
29378
29378
|
"@opencode-ai/sdk": "^1.2.24"
|
|
@@ -29436,7 +29436,7 @@ Agent resolution order:
|
|
|
29436
29436
|
4) Coder (fallback)
|
|
29437
29437
|
|
|
29438
29438
|
Available core agents:
|
|
29439
|
-
Coder, GPTCoder, Planner,
|
|
29439
|
+
Coder, GPTCoder, Planner, Orchestrator, Researcher
|
|
29440
29440
|
|
|
29441
29441
|
Unlike 'opencode run', this command waits until:
|
|
29442
29442
|
- All todos are completed or cancelled
|
|
@@ -7,7 +7,7 @@ export declare const BuiltinAgentNameSchema: z.ZodEnum<{
|
|
|
7
7
|
librarian: "librarian";
|
|
8
8
|
explore: "explore";
|
|
9
9
|
"multimodal-looker": "multimodal-looker";
|
|
10
|
-
|
|
10
|
+
orchestrator: "orchestrator";
|
|
11
11
|
"coder-junior": "coder-junior";
|
|
12
12
|
researcher: "researcher";
|
|
13
13
|
"researcher-junior": "researcher-junior";
|
|
@@ -29,7 +29,7 @@ export declare const OverridableAgentNameSchema: z.ZodEnum<{
|
|
|
29
29
|
librarian: "librarian";
|
|
30
30
|
explore: "explore";
|
|
31
31
|
"multimodal-looker": "multimodal-looker";
|
|
32
|
-
|
|
32
|
+
orchestrator: "orchestrator";
|
|
33
33
|
"coder-junior": "coder-junior";
|
|
34
34
|
"plan-consultant": "plan-consultant";
|
|
35
35
|
"plan-reviewer": "plan-reviewer";
|
|
@@ -45,7 +45,7 @@ export declare const AgentNameSchema: z.ZodEnum<{
|
|
|
45
45
|
librarian: "librarian";
|
|
46
46
|
explore: "explore";
|
|
47
47
|
"multimodal-looker": "multimodal-looker";
|
|
48
|
-
|
|
48
|
+
orchestrator: "orchestrator";
|
|
49
49
|
"coder-junior": "coder-junior";
|
|
50
50
|
researcher: "researcher";
|
|
51
51
|
"researcher-junior": "researcher-junior";
|
|
@@ -1177,7 +1177,7 @@ export declare const AgentOverridesSchema: z.ZodObject<{
|
|
|
1177
1177
|
variant: z.ZodOptional<z.ZodString>;
|
|
1178
1178
|
}, z.core.$strip>>;
|
|
1179
1179
|
}, z.core.$strip>>;
|
|
1180
|
-
|
|
1180
|
+
orchestrator: z.ZodOptional<z.ZodObject<{
|
|
1181
1181
|
model: z.ZodOptional<z.ZodString>;
|
|
1182
1182
|
fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
1183
1183
|
variant: z.ZodOptional<z.ZodString>;
|
|
@@ -13,7 +13,7 @@ export declare const DrizzyAgentConfigSchema: z.ZodObject<{
|
|
|
13
13
|
"git-master": "git-master";
|
|
14
14
|
}>>>;
|
|
15
15
|
disabled_hooks: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
16
|
-
|
|
16
|
+
orchestrator: "orchestrator";
|
|
17
17
|
"ralph-loop": "ralph-loop";
|
|
18
18
|
"start-work": "start-work";
|
|
19
19
|
"gpt-permission-continuation": "gpt-permission-continuation";
|
|
@@ -1169,7 +1169,7 @@ export declare const DrizzyAgentConfigSchema: z.ZodObject<{
|
|
|
1169
1169
|
variant: z.ZodOptional<z.ZodString>;
|
|
1170
1170
|
}, z.core.$strip>>;
|
|
1171
1171
|
}, z.core.$strip>>;
|
|
1172
|
-
|
|
1172
|
+
orchestrator: z.ZodOptional<z.ZodObject<{
|
|
1173
1173
|
model: z.ZodOptional<z.ZodString>;
|
|
1174
1174
|
fallback_models: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
1175
1175
|
variant: z.ZodOptional<z.ZodString>;
|
package/dist/create-hooks.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare function createHooks(args: {
|
|
|
34
34
|
todoContinuationEnforcer: ReturnType<typeof import("./hooks").createTodoContinuationEnforcer> | null;
|
|
35
35
|
unstableAgentBabysitter: ReturnType<typeof import("./plugin/unstable-agent-babysitter").createUnstableAgentBabysitter> | null;
|
|
36
36
|
backgroundNotificationHook: ReturnType<typeof import("./hooks").createBackgroundNotificationHook> | null;
|
|
37
|
-
|
|
37
|
+
orchestratorHook: ReturnType<typeof import("./hooks").createOrchestratorHook> | null;
|
|
38
38
|
claudeCodeHooks: ReturnType<typeof import("./hooks").createClaudeCodeHooksHook> | null;
|
|
39
39
|
keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
|
|
40
40
|
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"no-coder-gpt",
|
|
84
84
|
"no-gptcoder-non-gpt",
|
|
85
85
|
"start-work",
|
|
86
|
-
"
|
|
86
|
+
"orchestrator",
|
|
87
87
|
"unstable-agent-babysitter",
|
|
88
88
|
"task-resume-info",
|
|
89
89
|
"stop-continuation-guard",
|
|
@@ -2977,7 +2977,7 @@
|
|
|
2977
2977
|
},
|
|
2978
2978
|
"additionalProperties": false
|
|
2979
2979
|
},
|
|
2980
|
-
"
|
|
2980
|
+
"orchestrator": {
|
|
2981
2981
|
"type": "object",
|
|
2982
2982
|
"properties": {
|
|
2983
2983
|
"model": {
|
|
@@ -13,7 +13,7 @@ export interface BoulderState {
|
|
|
13
13
|
session_ids: string[];
|
|
14
14
|
/** Plan name derived from filename */
|
|
15
15
|
plan_name: string;
|
|
16
|
-
/** Agent type to use when resuming (e.g., '
|
|
16
|
+
/** Agent type to use when resuming (e.g., 'orchestrator') */
|
|
17
17
|
agent?: string;
|
|
18
18
|
/** Absolute path to the git worktree root where work happens */
|
|
19
19
|
worktree_path?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `call_omo_agent`:\n\n```\n// Agent 1: Find the refactoring target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ncall_omo_agent(\n subagent_type=\"explore\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Find definition(s)\nLspGotoDefinition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nLspDocumentSymbols(filePath) // Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // Search by name\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ncall_omo_agent(\n subagent_type=\"explore\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: `LspGotoDefinition` to grasp context\n- **Impact analysis**: `LspFindReferences` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Read-only consultation for complex architectural decisions and debugging\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
1
|
+
export declare const REFACTOR_TEMPLATE = "# Intelligent Refactor Command\n\n## Usage\n```\n/refactor <refactoring-target> [--scope=<file|module|project>] [--strategy=<safe|aggressive>]\n\nArguments:\n refactoring-target: What to refactor. Can be:\n - File path: src/auth/handler.ts\n - Symbol name: \"AuthService class\"\n - Pattern: \"all functions using deprecated API\"\n - Description: \"extract validation logic into separate module\"\n\nOptions:\n --scope: Refactoring scope (default: module)\n - file: Single file only\n - module: Module/directory scope\n - project: Entire codebase\n\n --strategy: Risk tolerance (default: safe)\n - safe: Conservative, maximum test coverage required\n - aggressive: Allow broader changes with adequate coverage\n```\n\n## What This Command Does\n\nPerforms intelligent, deterministic refactoring with full codebase awareness. Unlike blind search-and-replace, this command:\n\n1. **Understands your intent** - Analyzes what you actually want to achieve\n2. **Maps the codebase** - Builds a definitive codemap before touching anything\n3. **Assesses risk** - Evaluates test coverage and determines verification strategy\n4. **Plans meticulously** - Creates a detailed plan with Plan agent\n5. **Executes precisely** - Step-by-step refactoring with LSP and AST-grep\n6. **Verifies constantly** - Runs tests after each change to ensure zero regression\n\n---\n\n# PHASE 0: INTENT GATE (MANDATORY FIRST STEP)\n\n**BEFORE ANY ACTION, classify and validate the request.**\n\n## Step 0.1: Parse Request Type\n\n| Signal | Classification | Action |\n|--------|----------------|--------|\n| Specific file/symbol | Explicit | Proceed to codebase analysis |\n| \"Refactor X to Y\" | Clear transformation | Proceed to codebase analysis |\n| \"Improve\", \"Clean up\" | Open-ended | **MUST ask**: \"What specific improvement?\" |\n| Ambiguous scope | Uncertain | **MUST ask**: \"Which modules/files?\" |\n| Missing context | Incomplete | **MUST ask**: \"What's the desired outcome?\" |\n\n## Step 0.2: Validate Understanding\n\nBefore proceeding, confirm:\n- [ ] Target is clearly identified\n- [ ] Desired outcome is understood\n- [ ] Scope is defined (file/module/project)\n- [ ] Success criteria can be articulated\n\n**If ANY of above is unclear, ASK CLARIFYING QUESTION:**\n\n```\nI want to make sure I understand the refactoring goal correctly.\n\n**What I understood**: [interpretation]\n**What I'm unsure about**: [specific ambiguity]\n\nOptions I see:\n1. [Option A] - [implications]\n2. [Option B] - [implications]\n\n**My recommendation**: [suggestion with reasoning]\n\nShould I proceed with [recommendation], or would you prefer differently?\n```\n\n## Step 0.3: Create Initial Todos\n\n**IMMEDIATELY after understanding the request, create todos:**\n\n```\nTodoWrite([\n {\"id\": \"phase-1\", \"content\": \"PHASE 1: Codebase Analysis - launch parallel explore agents\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-2\", \"content\": \"PHASE 2: Build Codemap - map dependencies and impact zones\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-3\", \"content\": \"PHASE 3: Test Assessment - analyze test coverage and verification strategy\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-4\", \"content\": \"PHASE 4: Plan Generation - invoke Plan agent for detailed refactoring plan\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-5\", \"content\": \"PHASE 5: Execute Refactoring - step-by-step with continuous verification\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"phase-6\", \"content\": \"PHASE 6: Final Verification - full test suite and regression check\", \"status\": \"pending\", \"priority\": \"high\"}\n])\n```\n\n---\n\n# PHASE 1: CODEBASE ANALYSIS (PARALLEL EXPLORATION)\n\n**Mark phase-1 as in_progress.**\n\n## 1.1: Launch Parallel Explore Agents (BACKGROUND)\n\nFire ALL of these simultaneously using `call_drizzy_agent`:\n\n```\n// Agent 1: Find the refactoring target\ncall_drizzy_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all occurrences and definitions of [TARGET]. \n Report: file paths, line numbers, usage patterns.\"\n)\n\n// Agent 2: Find related code\ncall_drizzy_agent(\n subagent_type=\"explore\", \n run_in_background=true,\n prompt=\"Find all code that imports, uses, or depends on [TARGET].\n Report: dependency chains, import graphs.\"\n)\n\n// Agent 3: Find similar patterns\ncall_drizzy_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find similar code patterns to [TARGET] in the codebase.\n Report: analogous implementations, established conventions.\"\n)\n\n// Agent 4: Find tests\ncall_drizzy_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find all test files related to [TARGET].\n Report: test file paths, test case names, coverage indicators.\"\n)\n\n// Agent 5: Architecture context\ncall_drizzy_agent(\n subagent_type=\"explore\",\n run_in_background=true,\n prompt=\"Find architectural patterns and module organization around [TARGET].\n Report: module boundaries, layer structure, design patterns in use.\"\n)\n```\n\n## 1.2: Direct Tool Exploration (WHILE AGENTS RUN)\n\nWhile background agents are running, use direct tools:\n\n### LSP Tools for Precise Analysis:\n\n```typescript\n// Find definition(s)\nLspGotoDefinition(filePath, line, character) // Where is it defined?\n\n// Find ALL usages across workspace\nLspFindReferences(filePath, line, character, includeDeclaration=true)\n\n// Get file structure\nLspDocumentSymbols(filePath) // Hierarchical outline\nLspWorkspaceSymbols(filePath, query=\"[target_symbol]\") // Search by name\n\n// Get current diagnostics\nlsp_diagnostics(filePath) // Errors, warnings before we start\n```\n\n### AST-Grep for Pattern Analysis:\n\n```typescript\n// Find structural patterns\nast_grep_search(\n pattern=\"function $NAME($$$) { $$$ }\", // or relevant pattern\n lang=\"typescript\", // or relevant language\n paths=[\"src/\"]\n)\n\n// Preview refactoring (DRY RUN)\nast_grep_replace(\n pattern=\"[old_pattern]\",\n rewrite=\"[new_pattern]\",\n lang=\"[language]\",\n dryRun=true // ALWAYS preview first\n)\n```\n\n### Grep for Text Patterns:\n\n```\ngrep(pattern=\"[search_term]\", path=\"src/\", include=\"*.ts\")\n```\n\n## 1.3: Collect Background Results\n\n```\nbackground_output(task_id=\"[agent_1_id]\")\nbackground_output(task_id=\"[agent_2_id]\")\n...\n```\n\n**Mark phase-1 as completed after all results collected.**\n\n---\n\n# PHASE 2: BUILD CODEMAP (DEPENDENCY MAPPING)\n\n**Mark phase-2 as in_progress.**\n\n## 2.1: Construct Definitive Codemap\n\nBased on Phase 1 results, build:\n\n```\n## CODEMAP: [TARGET]\n\n### Core Files (Direct Impact)\n- `path/to/file.ts:L10-L50` - Primary definition\n- `path/to/file2.ts:L25` - Key usage\n\n### Dependency Graph\n```\n[TARGET] \n\u251C\u2500\u2500 imports from: \n\u2502 \u251C\u2500\u2500 module-a (types)\n\u2502 \u2514\u2500\u2500 module-b (utils)\n\u251C\u2500\u2500 imported by:\n\u2502 \u251C\u2500\u2500 consumer-1.ts\n\u2502 \u251C\u2500\u2500 consumer-2.ts\n\u2502 \u2514\u2500\u2500 consumer-3.ts\n\u2514\u2500\u2500 used by:\n \u251C\u2500\u2500 handler.ts (direct call)\n \u2514\u2500\u2500 service.ts (dependency injection)\n```\n\n### Impact Zones\n| Zone | Risk Level | Files Affected | Test Coverage |\n|------|------------|----------------|---------------|\n| Core | HIGH | 3 files | 85% covered |\n| Consumers | MEDIUM | 8 files | 70% covered |\n| Edge | LOW | 2 files | 50% covered |\n\n### Established Patterns\n- Pattern A: [description] - used in N places\n- Pattern B: [description] - established convention\n```\n\n## 2.2: Identify Refactoring Constraints\n\nBased on codemap:\n- **MUST follow**: [existing patterns identified]\n- **MUST NOT break**: [critical dependencies]\n- **Safe to change**: [isolated code zones]\n- **Requires migration**: [breaking changes impact]\n\n**Mark phase-2 as completed.**\n\n---\n\n# PHASE 3: TEST ASSESSMENT (VERIFICATION STRATEGY)\n\n**Mark phase-3 as in_progress.**\n\n## 3.1: Detect Test Infrastructure\n\n```bash\n# Check for test commands\ncat package.json | jq '.scripts | keys[] | select(test(\"test\"))'\n\n# Or for Python\nls -la pytest.ini pyproject.toml setup.cfg\n\n# Or for Go\nls -la *_test.go\n```\n\n## 3.2: Analyze Test Coverage\n\n```\n// Find all tests related to target\ncall_drizzy_agent(\n subagent_type=\"explore\",\n run_in_background=false, // Need this synchronously\n prompt=\"Analyze test coverage for [TARGET]:\n 1. Which test files cover this code?\n 2. What test cases exist?\n 3. Are there integration tests?\n 4. What edge cases are tested?\n 5. Estimated coverage percentage?\"\n)\n```\n\n## 3.3: Determine Verification Strategy\n\nBased on test analysis:\n\n| Coverage Level | Strategy |\n|----------------|----------|\n| HIGH (>80%) | Run existing tests after each step |\n| MEDIUM (50-80%) | Run tests + add safety assertions |\n| LOW (<50%) | **PAUSE**: Propose adding tests first |\n| NONE | **BLOCK**: Refuse aggressive refactoring |\n\n**If coverage is LOW or NONE, ask user:**\n\n```\nTest coverage for [TARGET] is [LEVEL].\n\n**Risk Assessment**: Refactoring without adequate tests is dangerous.\n\nOptions:\n1. Add tests first, then refactor (RECOMMENDED)\n2. Proceed with extra caution, manual verification required\n3. Abort refactoring\n\nWhich approach do you prefer?\n```\n\n## 3.4: Document Verification Plan\n\n```\n## VERIFICATION PLAN\n\n### Test Commands\n- Unit: `bun test` / `npm test` / `pytest` / etc.\n- Integration: [command if exists]\n- Type check: `tsc --noEmit` / `pyright` / etc.\n\n### Verification Checkpoints\nAfter each refactoring step:\n1. lsp_diagnostics \u2192 zero new errors\n2. Run test command \u2192 all pass\n3. Type check \u2192 clean\n\n### Regression Indicators\n- [Specific test that must pass]\n- [Behavior that must be preserved]\n- [API contract that must not change]\n```\n\n**Mark phase-3 as completed.**\n\n---\n\n# PHASE 4: PLAN GENERATION (PLAN AGENT)\n\n**Mark phase-4 as in_progress.**\n\n## 4.1: Invoke Plan Agent\n\n```\nTask(\n subagent_type=\"plan\",\n prompt=\"Create a detailed refactoring plan:\n\n ## Refactoring Goal\n [User's original request]\n\n ## Codemap (from Phase 2)\n [Insert codemap here]\n\n ## Test Coverage (from Phase 3)\n [Insert verification plan here]\n\n ## Constraints\n - MUST follow existing patterns: [list]\n - MUST NOT break: [critical paths]\n - MUST run tests after each step\n\n ## Requirements\n 1. Break down into atomic refactoring steps\n 2. Each step must be independently verifiable\n 3. Order steps by dependency (what must happen first)\n 4. Specify exact files and line ranges for each step\n 5. Include rollback strategy for each step\n 6. Define commit checkpoints\"\n)\n```\n\n## 4.2: Review and Validate Plan\n\nAfter receiving plan from Plan agent:\n\n1. **Verify completeness**: All identified files addressed?\n2. **Verify safety**: Each step reversible?\n3. **Verify order**: Dependencies respected?\n4. **Verify verification**: Test commands specified?\n\n## 4.3: Register Detailed Todos\n\nConvert Plan agent output into granular todos:\n\n```\nTodoWrite([\n // Each step from the plan becomes a todo\n {\"id\": \"refactor-1\", \"content\": \"Step 1: [description]\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"verify-1\", \"content\": \"Verify Step 1: run tests\", \"status\": \"pending\", \"priority\": \"high\"},\n {\"id\": \"refactor-2\", \"content\": \"Step 2: [description]\", \"status\": \"pending\", \"priority\": \"medium\"},\n {\"id\": \"verify-2\", \"content\": \"Verify Step 2: run tests\", \"status\": \"pending\", \"priority\": \"medium\"},\n // ... continue for all steps\n])\n```\n\n**Mark phase-4 as completed.**\n\n---\n\n# PHASE 5: EXECUTE REFACTORING (DETERMINISTIC EXECUTION)\n\n**Mark phase-5 as in_progress.**\n\n## 5.1: Execution Protocol\n\nFor EACH refactoring step:\n\n### Pre-Step\n1. Mark step todo as `in_progress`\n2. Read current file state\n3. Verify lsp_diagnostics is baseline\n\n### Execute Step\nUse appropriate tool:\n\n**For Symbol Renames:**\n```typescript\nlsp_prepare_rename(filePath, line, character) // Validate rename is possible\nlsp_rename(filePath, line, character, newName) // Execute rename\n```\n\n**For Pattern Transformations:**\n```typescript\n// Preview first\nast_grep_replace(pattern, rewrite, lang, dryRun=true)\n\n// If preview looks good, execute\nast_grep_replace(pattern, rewrite, lang, dryRun=false)\n```\n\n**For Structural Changes:**\n```typescript\n// Use Edit tool for precise changes\nedit(filePath, oldString, newString)\n```\n\n### Post-Step Verification (MANDATORY)\n\n```typescript\n// 1. Check diagnostics\nlsp_diagnostics(filePath) // Must be clean or same as baseline\n\n// 2. Run tests\nbash(\"bun test\") // Or appropriate test command\n\n// 3. Type check\nbash(\"tsc --noEmit\") // Or appropriate type check\n```\n\n### Step Completion\n1. If verification passes \u2192 Mark step todo as `completed`\n2. If verification fails \u2192 **STOP AND FIX**\n\n## 5.2: Failure Recovery Protocol\n\nIf ANY verification fails:\n\n1. **STOP** immediately\n2. **REVERT** the failed change\n3. **DIAGNOSE** what went wrong\n4. **OPTIONS**:\n - Fix the issue and retry\n - Skip this step (if optional)\n - Consult oracle agent for help\n - Ask user for guidance\n\n**NEVER proceed to next step with broken tests.**\n\n## 5.3: Commit Checkpoints\n\nAfter each logical group of changes:\n\n```bash\ngit add [changed-files]\ngit commit -m \"refactor(scope): description\n\n[details of what was changed and why]\"\n```\n\n**Mark phase-5 as completed when all refactoring steps done.**\n\n---\n\n# PHASE 6: FINAL VERIFICATION (REGRESSION CHECK)\n\n**Mark phase-6 as in_progress.**\n\n## 6.1: Full Test Suite\n\n```bash\n# Run complete test suite\nbun test # or npm test, pytest, go test, etc.\n```\n\n## 6.2: Type Check\n\n```bash\n# Full type check\ntsc --noEmit # or equivalent\n```\n\n## 6.3: Lint Check\n\n```bash\n# Run linter\neslint . # or equivalent\n```\n\n## 6.4: Build Verification (if applicable)\n\n```bash\n# Ensure build still works\nbun run build # or npm run build, etc.\n```\n\n## 6.5: Final Diagnostics\n\n```typescript\n// Check all changed files\nfor (file of changedFiles) {\n lsp_diagnostics(file) // Must all be clean\n}\n```\n\n## 6.6: Generate Summary\n\n```markdown\n## Refactoring Complete\n\n### What Changed\n- [List of changes made]\n\n### Files Modified\n- `path/to/file.ts` - [what changed]\n- `path/to/file2.ts` - [what changed]\n\n### Verification Results\n- Tests: PASSED (X/Y passing)\n- Type Check: CLEAN\n- Lint: CLEAN\n- Build: SUCCESS\n\n### No Regressions Detected\nAll existing tests pass. No new errors introduced.\n```\n\n**Mark phase-6 as completed.**\n\n---\n\n# CRITICAL RULES\n\n## NEVER DO\n- Skip lsp_diagnostics check after changes\n- Proceed with failing tests\n- Make changes without understanding impact\n- Use `as any`, `@ts-ignore`, `@ts-expect-error`\n- Delete tests to make them pass\n- Commit broken code\n- Refactor without understanding existing patterns\n\n## ALWAYS DO\n- Understand before changing\n- Preview before applying (ast_grep dryRun=true)\n- Verify after every change\n- Follow existing codebase patterns\n- Keep todos updated in real-time\n- Commit at logical checkpoints\n- Report issues immediately\n\n## ABORT CONDITIONS\nIf any of these occur, **STOP and consult user**:\n- Test coverage is zero for target code\n- Changes would break public API\n- Refactoring scope is unclear\n- 3 consecutive verification failures\n- User-defined constraints violated\n\n---\n\n# Tool Usage Philosophy\n\nYou already know these tools. Use them intelligently:\n\n## LSP Tools\nLeverage LSP tools for precision analysis. Key patterns:\n- **Understand before changing**: `LspGotoDefinition` to grasp context\n- **Impact analysis**: `LspFindReferences` to map all usages before modification\n- **Safe refactoring**: `lsp_prepare_rename` \u2192 `lsp_rename` for symbol renames\n- **Continuous verification**: `lsp_diagnostics` after every change\n\n## AST-Grep\nUse `ast_grep_search` and `ast_grep_replace` for structural transformations.\n**Critical**: Always `dryRun=true` first, review, then execute.\n\n## Agents\n- `explore`: Parallel codebase pattern discovery\n- `plan`: Detailed refactoring plan generation\n- `oracle`: Read-only consultation for complex architectural decisions and debugging\n- `librarian`: **Use proactively** when encountering deprecated methods or library migration tasks. Query official docs and OSS examples for modern replacements.\n\n## Deprecated Code & Library Migration\nWhen you encounter deprecated methods/APIs during refactoring:\n1. Fire `librarian` to find the recommended modern alternative\n2. **DO NOT auto-upgrade to latest version** unless user explicitly requests migration\n3. If user requests library migration, use `librarian` to fetch latest API docs before making changes\n\n---\n\n**Remember: Refactoring without tests is reckless. Refactoring without understanding is destructive. This command ensures you do neither.**\n\n<user-request>\n$ARGUMENTS\n</user-request>\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const START_WORK_TEMPLATE = "You are starting a Coder work session.\n\n## ARGUMENTS\n\n- `/start-work [plan-name] [--worktree <path>]`\n - `plan-name` (optional): name or partial match of the plan to start\n - `--worktree <path>` (optional): absolute path to an existing git worktree to work in\n - If specified and valid: hook pre-sets worktree_path in boulder.json\n - If specified but invalid: you must run `git worktree add <path> <branch>` first\n - If omitted: you MUST choose or create a worktree (see Worktree Setup below)\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Planner-generated plan files at `.drizzy/plans/`\n\n2. **Check for active boulder state**: Read `.drizzy/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.drizzy/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Worktree Setup** (when `worktree_path` not already set in boulder.json):\n 1. `git worktree list --porcelain` \u2014 see available worktrees\n 2. Create: `git worktree add <absolute-path> <branch-or-HEAD>`\n 3. Update boulder.json to add `\"worktree_path\": \"<absolute-path>\"`\n 4. All work happens inside that worktree directory\n\n5. **Create/Update boulder.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\",\n \"worktree_path\": \"/absolute/path/to/git/worktree\"\n }\n ```\n\n6. **Read the plan file** and start executing tasks according to
|
|
1
|
+
export declare const START_WORK_TEMPLATE = "You are starting a Coder work session.\n\n## ARGUMENTS\n\n- `/start-work [plan-name] [--worktree <path>]`\n - `plan-name` (optional): name or partial match of the plan to start\n - `--worktree <path>` (optional): absolute path to an existing git worktree to work in\n - If specified and valid: hook pre-sets worktree_path in boulder.json\n - If specified but invalid: you must run `git worktree add <path> <branch>` first\n - If omitted: you MUST choose or create a worktree (see Worktree Setup below)\n\n## WHAT TO DO\n\n1. **Find available plans**: Search for Planner-generated plan files at `.drizzy/plans/`\n\n2. **Check for active boulder state**: Read `.drizzy/boulder.json` if it exists\n\n3. **Decision logic**:\n - If `.drizzy/boulder.json` exists AND plan is NOT complete (has unchecked boxes):\n - **APPEND** current session to session_ids\n - Continue work on existing plan\n - If no active plan OR plan is complete:\n - List available plan files\n - If ONE plan: auto-select it\n - If MULTIPLE plans: show list with timestamps, ask user to select\n\n4. **Worktree Setup** (when `worktree_path` not already set in boulder.json):\n 1. `git worktree list --porcelain` \u2014 see available worktrees\n 2. Create: `git worktree add <absolute-path> <branch-or-HEAD>`\n 3. Update boulder.json to add `\"worktree_path\": \"<absolute-path>\"`\n 4. All work happens inside that worktree directory\n\n5. **Create/Update boulder.json**:\n ```json\n {\n \"active_plan\": \"/absolute/path/to/plan.md\",\n \"started_at\": \"ISO_TIMESTAMP\",\n \"session_ids\": [\"session_id_1\", \"session_id_2\"],\n \"plan_name\": \"plan-name\",\n \"worktree_path\": \"/absolute/path/to/git/worktree\"\n }\n ```\n\n6. **Read the plan file** and start executing tasks according to orchestrator workflow\n\n## OUTPUT FORMAT\n\nWhen listing plans for selection:\n```\nAvailable Work Plans\n\nCurrent Time: {ISO timestamp}\nSession ID: {current session id}\n\n1. [plan-name-1.md] - Modified: {date} - Progress: 3/10 tasks\n2. [plan-name-2.md] - Modified: {date} - Progress: 0/5 tasks\n\nWhich plan would you like to work on? (Enter number or plan name)\n```\n\nWhen resuming existing work:\n```\nResuming Work Session\n\nActive Plan: {plan-name}\nProgress: {completed}/{total} tasks\nSessions: {count} (appending current session)\nWorktree: {worktree_path}\n\nReading plan and continuing from last incomplete task...\n```\n\nWhen auto-selecting single plan:\n```\nStarting Work Session\n\nPlan: {plan-name}\nSession ID: {session_id}\nStarted: {timestamp}\nWorktree: {worktree_path}\n\nReading plan and beginning execution...\n```\n\n## CRITICAL\n\n- The session_id is injected by the hook - use it directly\n- Always update boulder.json BEFORE starting work\n- Always set worktree_path in boulder.json before executing any tasks\n- Read the FULL plan file before delegating any tasks\n- Follow orchestrator delegation protocols (7-section format)";
|
|
@@ -52,7 +52,7 @@ export declare function generatePartId(): string;
|
|
|
52
52
|
*
|
|
53
53
|
* Features degraded on beta:
|
|
54
54
|
* - Hook message injection (e.g., continuation prompts, context injection) won't persist
|
|
55
|
-
* -
|
|
55
|
+
* - Orchestrator hook's injected messages won't be visible in SQLite backend
|
|
56
56
|
* - Todo continuation enforcer's injected prompts won't persist
|
|
57
57
|
* - Ralph loop's continuation prompts won't persist
|
|
58
58
|
*
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export { createResearcherResearchOnlyHook } from "./researcher-research-only";
|
|
|
35
35
|
export { createCoderJuniorNotepadHook } from "./coder-junior-notepad";
|
|
36
36
|
export { createTaskResumeInfoHook } from "./task-resume-info";
|
|
37
37
|
export { createStartWorkHook } from "./start-work";
|
|
38
|
-
export {
|
|
38
|
+
export { createOrchestratorHook } from "./orchestrator";
|
|
39
39
|
export { createDelegateTaskRetryHook } from "./delegate-task-retry";
|
|
40
40
|
export { createQuestionLabelTruncatorHook } from "./question-label-truncator";
|
|
41
41
|
export { createStopContinuationGuardHook, type StopContinuationGuard } from "./stop-continuation-guard";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type {
|
|
3
|
-
export declare function
|
|
2
|
+
import type { OrchestratorHookOptions, SessionState } from "./types";
|
|
3
|
+
export declare function createOrchestratorEventHandler(input: {
|
|
4
4
|
ctx: PluginInput;
|
|
5
|
-
options?:
|
|
5
|
+
options?: OrchestratorHookOptions;
|
|
6
6
|
sessions: Map<string, SessionState>;
|
|
7
7
|
getState: (sessionID: string) => SessionState;
|
|
8
8
|
}): (arg: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HOOK_NAME = "orchestrator";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { OrchestratorHookOptions, SessionState } from "./types";
|
|
3
|
+
export declare function handleOrchestratorSessionIdle(input: {
|
|
4
|
+
ctx: PluginInput;
|
|
5
|
+
options?: OrchestratorHookOptions;
|
|
6
|
+
getState: (sessionID: string) => SessionState;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
}): Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type {
|
|
3
|
-
export declare function
|
|
2
|
+
import type { OrchestratorHookOptions } from "./types";
|
|
3
|
+
export declare function createOrchestratorHook(ctx: PluginInput, options?: OrchestratorHookOptions): {
|
|
4
4
|
handler: (arg: {
|
|
5
5
|
event: {
|
|
6
6
|
type: string;
|