zenox 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # zenox
2
+
3
+ OpenCode plugin for intelligent agent orchestration with specialized subagents and parallel background tasks.
4
+
5
+ ## Features
6
+
7
+ - **4 Specialized Subagents**: Explorer, Librarian, Oracle, UI-Planner
8
+ - **Background Tasks**: Parallel agent execution for comprehensive research
9
+ - **Auto-Loaded MCP Servers**: exa, grep_app, sequential-thinking
10
+ - **Smart Orchestration**: Automatically teaches Build/Plan agents how to delegate
11
+ - **Portable**: Install on any machine via opencode.json
12
+
13
+ ## Installation
14
+
15
+ Add to your `opencode.json`:
16
+
17
+ ```json
18
+ {
19
+ "plugin": ["zenox@0.1.0"]
20
+ }
21
+ ```
22
+
23
+ Restart OpenCode and the plugin is ready to use.
24
+
25
+ ## Agents
26
+
27
+ ### @explorer
28
+ Fast codebase search specialist.
29
+ - "Where is X implemented?"
30
+ - "Find all files containing Y"
31
+ - Pattern matching and locating implementations
32
+
33
+ **Model**: `anthropic/claude-haiku-4-5`
34
+
35
+ ### @librarian
36
+ Open-source research agent.
37
+ - "How does library X work?"
38
+ - "Show me implementation examples"
39
+ - Finding official documentation
40
+
41
+ **Model**: `anthropic/claude-sonnet-4-5`
42
+
43
+ ### @oracle
44
+ Strategic technical advisor.
45
+ - Architecture decisions
46
+ - Code review and debugging strategy
47
+ - Technical trade-offs analysis
48
+
49
+ **Model**: `openai/gpt-5.2-high`
50
+
51
+ ### @ui-planner
52
+ Designer-turned-developer.
53
+ - Beautiful UI/UX implementation
54
+ - Frontend aesthetics and animations
55
+ - Visual design without mockups
56
+
57
+ **Model**: `google/gemini-3-pro-high`
58
+
59
+ ## Background Tasks
60
+
61
+ For parallel research, use background tasks instead of sequential agents:
62
+
63
+ ```
64
+ // Launch parallel research (all run simultaneously)
65
+ background_task(agent="explorer", description="Find auth code", prompt="...")
66
+ background_task(agent="explorer", description="Find db layer", prompt="...")
67
+ background_task(agent="librarian", description="Best practices", prompt="...")
68
+
69
+ // Continue working while they run...
70
+ // [NOTIFICATION: All background tasks complete!]
71
+
72
+ // Retrieve results
73
+ background_output(task_id="bg_abc123")
74
+ ```
75
+
76
+ ### When to Use
77
+
78
+ | Scenario | Use Background Tasks |
79
+ |----------|---------------------|
80
+ | Comprehensive exploration | YES - fire 3-4 agents in parallel |
81
+ | Codebase + external docs | YES - explore + librarian in parallel |
82
+ | Result A needed before B | NO - use sequential Task |
83
+
84
+ ## Configuration (Optional)
85
+
86
+ Create `~/.config/opencode/zenox.json` or `.opencode/zenox.json`:
87
+
88
+ ```json
89
+ {
90
+ "agents": {
91
+ "explorer": { "model": "anthropic/claude-sonnet-4" },
92
+ "oracle": { "model": "openai/gpt-4o" }
93
+ },
94
+ "disabled_agents": [],
95
+ "disabled_mcps": []
96
+ }
97
+ ```
98
+
99
+ ## Auto-Loaded MCP Servers
100
+
101
+ | MCP Server | Description |
102
+ |------------|-------------|
103
+ | `exa` | Web search, code context, URL crawling |
104
+ | `grep_app` | GitHub code search across millions of repos |
105
+ | `sequential-thinking` | Structured reasoning for complex problems |
106
+
107
+ ## Development
108
+
109
+ ```bash
110
+ bun install
111
+ bun run build
112
+ bun run typecheck
113
+ ```
114
+
115
+ ## Credits
116
+
117
+ - **[OpenCode](https://opencode.ai)** — The CLI tool this plugin extends
118
+ - **[oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode)** by YeonGyu Kim — Inspiration for orchestration patterns
119
+
120
+ ## License
121
+
122
+ MIT
@@ -0,0 +1,2 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ export declare const explorerAgent: AgentConfig;
@@ -0,0 +1,5 @@
1
+ export { explorerAgent } from "./explorer";
2
+ export { librarianAgent } from "./librarian";
3
+ export { oracleAgent } from "./oracle";
4
+ export { uiPlannerAgent } from "./ui-planner";
5
+ export type { BuiltinAgentName, AgentOverrideConfig, AgentOverrides } from "./types";
@@ -0,0 +1,2 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ export declare const librarianAgent: AgentConfig;
@@ -0,0 +1,2 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ export declare const oracleAgent: AgentConfig;
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ export type AgentFactory = (model?: string) => AgentConfig;
3
+ export type BuiltinAgentName = "explorer" | "librarian" | "oracle" | "ui-planner";
4
+ export type AgentOverrideConfig = Partial<AgentConfig> & {
5
+ prompt_append?: string;
6
+ };
7
+ export type AgentOverrides = Partial<Record<BuiltinAgentName, AgentOverrideConfig>>;
@@ -0,0 +1,2 @@
1
+ import type { AgentConfig } from "@opencode-ai/sdk";
2
+ export declare const uiPlannerAgent: AgentConfig;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Background Task System
3
+ *
4
+ * Provides parallel agent execution via fire-and-forget background sessions.
5
+ */
6
+ export { BackgroundManager } from "./manager";
7
+ export { createBackgroundTools, type BackgroundTools } from "./tools";
8
+ export type { BackgroundTask, TaskStatus, LaunchInput, CompletionNotification, } from "./types";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * BackgroundManager - Minimal background task orchestration
3
+ *
4
+ * Handles:
5
+ * - Launching background agent sessions (fire-and-forget)
6
+ * - Tracking task status
7
+ * - Detecting completion via session.idle events
8
+ * - Generating completion notifications
9
+ */
10
+ import type { OpencodeClient } from "@opencode-ai/sdk";
11
+ import type { BackgroundTask, LaunchInput, CompletionNotification } from "./types";
12
+ export declare class BackgroundManager {
13
+ private tasks;
14
+ private mainSessionID;
15
+ setMainSession(sessionID: string): void;
16
+ getMainSession(): string | undefined;
17
+ private generateTaskId;
18
+ launch(client: OpencodeClient, input: LaunchInput): Promise<BackgroundTask>;
19
+ getTask(taskId: string): BackgroundTask | undefined;
20
+ findTaskBySessionID(sessionID: string): BackgroundTask | undefined;
21
+ getOutput(client: OpencodeClient, taskId: string): Promise<string | undefined>;
22
+ cancel(client: OpencodeClient, taskId: string): Promise<boolean>;
23
+ handleSessionIdle(sessionID: string): CompletionNotification | null;
24
+ getCompletionStatus(): CompletionNotification;
25
+ listActiveTasks(): BackgroundTask[];
26
+ listAllTasks(): BackgroundTask[];
27
+ clearCompleted(): void;
28
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Background Task Tools
3
+ *
4
+ * Three tools for background task management:
5
+ * - background_task: Launch a background agent
6
+ * - background_output: Get result from completed task
7
+ * - background_cancel: Cancel a running task
8
+ */
9
+ import { type ToolDefinition } from "@opencode-ai/plugin";
10
+ import type { OpencodeClient } from "@opencode-ai/sdk";
11
+ import type { BackgroundManager } from "./manager";
12
+ export type BackgroundTools = {
13
+ [key: string]: ToolDefinition;
14
+ };
15
+ export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): BackgroundTools;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Background Task System Types
3
+ * Minimal interfaces for fire-and-forget parallel agent execution
4
+ */
5
+ export type TaskStatus = "running" | "completed" | "failed" | "cancelled";
6
+ export interface BackgroundTask {
7
+ id: string;
8
+ sessionID: string;
9
+ agent: string;
10
+ description: string;
11
+ prompt: string;
12
+ status: TaskStatus;
13
+ startedAt: Date;
14
+ completedAt?: Date;
15
+ error?: string;
16
+ }
17
+ export interface LaunchInput {
18
+ agent: string;
19
+ prompt: string;
20
+ description: string;
21
+ parentSessionID: string;
22
+ }
23
+ export interface CompletionNotification {
24
+ allComplete: boolean;
25
+ message: string;
26
+ completedTasks: BackgroundTask[];
27
+ runningCount: number;
28
+ }
@@ -0,0 +1,2 @@
1
+ export { ZenoxConfigSchema, AgentNameSchema, AgentOverrideConfigSchema, AgentOverridesSchema, type ZenoxConfig, type AgentName, type AgentOverrideConfig, type AgentOverrides, } from "./schema";
2
+ export { loadPluginConfig } from "./loader";
@@ -0,0 +1,6 @@
1
+ import { type ZenoxConfig } from "./schema";
2
+ /**
3
+ * Load plugin configuration from user and project paths
4
+ * Project config takes priority over user config
5
+ */
6
+ export declare function loadPluginConfig(projectDirectory: string): ZenoxConfig;
@@ -0,0 +1,179 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Agent names that can be configured
4
+ */
5
+ export declare const AgentNameSchema: z.ZodEnum<["explorer", "librarian", "oracle", "ui-planner"]>;
6
+ export type AgentName = z.infer<typeof AgentNameSchema>;
7
+ /**
8
+ * Configuration for overriding an agent's settings
9
+ * Only model override is supported - keeps it simple
10
+ */
11
+ export declare const AgentOverrideConfigSchema: z.ZodObject<{
12
+ model: z.ZodOptional<z.ZodString>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ model?: string | undefined;
15
+ }, {
16
+ model?: string | undefined;
17
+ }>;
18
+ export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>;
19
+ /**
20
+ * Agent overrides mapping
21
+ */
22
+ export declare const AgentOverridesSchema: z.ZodObject<{
23
+ explorer: z.ZodOptional<z.ZodObject<{
24
+ model: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ model?: string | undefined;
27
+ }, {
28
+ model?: string | undefined;
29
+ }>>;
30
+ librarian: z.ZodOptional<z.ZodObject<{
31
+ model: z.ZodOptional<z.ZodString>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ model?: string | undefined;
34
+ }, {
35
+ model?: string | undefined;
36
+ }>>;
37
+ oracle: z.ZodOptional<z.ZodObject<{
38
+ model: z.ZodOptional<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ model?: string | undefined;
41
+ }, {
42
+ model?: string | undefined;
43
+ }>>;
44
+ "ui-planner": z.ZodOptional<z.ZodObject<{
45
+ model: z.ZodOptional<z.ZodString>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ model?: string | undefined;
48
+ }, {
49
+ model?: string | undefined;
50
+ }>>;
51
+ }, "strip", z.ZodTypeAny, {
52
+ explorer?: {
53
+ model?: string | undefined;
54
+ } | undefined;
55
+ librarian?: {
56
+ model?: string | undefined;
57
+ } | undefined;
58
+ oracle?: {
59
+ model?: string | undefined;
60
+ } | undefined;
61
+ "ui-planner"?: {
62
+ model?: string | undefined;
63
+ } | undefined;
64
+ }, {
65
+ explorer?: {
66
+ model?: string | undefined;
67
+ } | undefined;
68
+ librarian?: {
69
+ model?: string | undefined;
70
+ } | undefined;
71
+ oracle?: {
72
+ model?: string | undefined;
73
+ } | undefined;
74
+ "ui-planner"?: {
75
+ model?: string | undefined;
76
+ } | undefined;
77
+ }>;
78
+ export type AgentOverrides = z.infer<typeof AgentOverridesSchema>;
79
+ /**
80
+ * Main configuration schema for zenox
81
+ */
82
+ export declare const ZenoxConfigSchema: z.ZodObject<{
83
+ $schema: z.ZodOptional<z.ZodString>;
84
+ agents: z.ZodOptional<z.ZodObject<{
85
+ explorer: z.ZodOptional<z.ZodObject<{
86
+ model: z.ZodOptional<z.ZodString>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ model?: string | undefined;
89
+ }, {
90
+ model?: string | undefined;
91
+ }>>;
92
+ librarian: z.ZodOptional<z.ZodObject<{
93
+ model: z.ZodOptional<z.ZodString>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ model?: string | undefined;
96
+ }, {
97
+ model?: string | undefined;
98
+ }>>;
99
+ oracle: z.ZodOptional<z.ZodObject<{
100
+ model: z.ZodOptional<z.ZodString>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ model?: string | undefined;
103
+ }, {
104
+ model?: string | undefined;
105
+ }>>;
106
+ "ui-planner": z.ZodOptional<z.ZodObject<{
107
+ model: z.ZodOptional<z.ZodString>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ model?: string | undefined;
110
+ }, {
111
+ model?: string | undefined;
112
+ }>>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ explorer?: {
115
+ model?: string | undefined;
116
+ } | undefined;
117
+ librarian?: {
118
+ model?: string | undefined;
119
+ } | undefined;
120
+ oracle?: {
121
+ model?: string | undefined;
122
+ } | undefined;
123
+ "ui-planner"?: {
124
+ model?: string | undefined;
125
+ } | undefined;
126
+ }, {
127
+ explorer?: {
128
+ model?: string | undefined;
129
+ } | undefined;
130
+ librarian?: {
131
+ model?: string | undefined;
132
+ } | undefined;
133
+ oracle?: {
134
+ model?: string | undefined;
135
+ } | undefined;
136
+ "ui-planner"?: {
137
+ model?: string | undefined;
138
+ } | undefined;
139
+ }>>;
140
+ disabled_agents: z.ZodOptional<z.ZodArray<z.ZodEnum<["explorer", "librarian", "oracle", "ui-planner"]>, "many">>;
141
+ disabled_mcps: z.ZodOptional<z.ZodArray<z.ZodEnum<["exa", "grep_app", "sequential-thinking"]>, "many">>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ $schema?: string | undefined;
144
+ agents?: {
145
+ explorer?: {
146
+ model?: string | undefined;
147
+ } | undefined;
148
+ librarian?: {
149
+ model?: string | undefined;
150
+ } | undefined;
151
+ oracle?: {
152
+ model?: string | undefined;
153
+ } | undefined;
154
+ "ui-planner"?: {
155
+ model?: string | undefined;
156
+ } | undefined;
157
+ } | undefined;
158
+ disabled_agents?: ("explorer" | "librarian" | "oracle" | "ui-planner")[] | undefined;
159
+ disabled_mcps?: ("exa" | "grep_app" | "sequential-thinking")[] | undefined;
160
+ }, {
161
+ $schema?: string | undefined;
162
+ agents?: {
163
+ explorer?: {
164
+ model?: string | undefined;
165
+ } | undefined;
166
+ librarian?: {
167
+ model?: string | undefined;
168
+ } | undefined;
169
+ oracle?: {
170
+ model?: string | undefined;
171
+ } | undefined;
172
+ "ui-planner"?: {
173
+ model?: string | undefined;
174
+ } | undefined;
175
+ } | undefined;
176
+ disabled_agents?: ("explorer" | "librarian" | "oracle" | "ui-planner")[] | undefined;
177
+ disabled_mcps?: ("exa" | "grep_app" | "sequential-thinking")[] | undefined;
178
+ }>;
179
+ export type ZenoxConfig = z.infer<typeof ZenoxConfigSchema>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * zenox - OpenCode Plugin for Intelligent Agent Orchestration
3
+ *
4
+ * This plugin provides:
5
+ * 1. Specialized subagents: explorer, librarian, oracle, ui-planner
6
+ * 2. Orchestration injection into Build/Plan agents for smart delegation
7
+ * 3. Auto-loaded MCP servers: exa, grep_app, sequential-thinking
8
+ * 4. Background task system for parallel agent execution
9
+ * 5. Optional configuration via zenox.json for model/MCP overrides
10
+ */
11
+ import type { Plugin } from "@opencode-ai/plugin";
12
+ declare const ZenoxPlugin: Plugin;
13
+ export default ZenoxPlugin;
14
+ export type { BuiltinAgentName, AgentOverrideConfig, AgentOverrides, } from "./agents";
15
+ export type { ZenoxConfig, AgentName, } from "./config";
16
+ export type { McpName } from "./mcp";
17
+ export type { BackgroundTask, TaskStatus } from "./background";