@zcy2nn/agent-forge 1.1.2 → 1.1.4
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/agent-forge.schema.json +2 -133
- package/dist/cli/index.js +99 -317
- package/dist/cli/providers.d.ts +0 -44
- package/dist/config/constants.d.ts +3 -4
- package/dist/config/index.d.ts +0 -1
- package/dist/config/schema.d.ts +2 -72
- package/dist/hooks/filter-available-skills/index.d.ts +4 -13
- package/dist/index.js +301 -1297
- package/dist/tools/index.d.ts +0 -1
- package/dist/tui.js +5 -32
- package/package.json +1 -1
- package/src/skills/brainstorming/SKILL.md +5 -6
- package/src/skills/brainstorming/spec-document-reviewer-prompt.md +1 -1
- package/src/skills/codemap/README.md +3 -3
- package/src/skills/codemap/SKILL.md +5 -5
- package/src/skills/codemap/codemap.md +4 -4
- package/src/skills/codemap/scripts/codemap.mjs +1 -1
- package/src/skills/codemap/scripts/codemap.test.ts +1 -1
- package/src/skills/requesting-code-review/SKILL.md +1 -1
- package/src/skills/subagent-driven-development/SKILL.md +1 -1
- package/src/skills/writing-plans/SKILL.md +2 -2
- package/dist/agents/council.d.ts +0 -27
- package/dist/agents/councillor.d.ts +0 -2
- package/dist/agents/implementer.d.ts +0 -2
- package/dist/agents/reviewer.d.ts +0 -2
- package/dist/cli/skill-sync.d.ts +0 -23
- package/dist/config/council-schema.d.ts +0 -127
- package/dist/council/council-manager.d.ts +0 -49
- package/dist/council/index.d.ts +0 -1
- package/dist/tools/council.d.ts +0 -10
- package/dist/utils/package-root.d.ts +0 -1
- package/src/skills/using-git-worktrees/SKILL.md +0 -226
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { ast_grep_replace, ast_grep_search } from './ast-grep';
|
|
2
|
-
export { createCouncilTool } from './council';
|
|
3
2
|
export type { PresetManager } from './preset-manager';
|
|
4
3
|
export { createPresetManager } from './preset-manager';
|
|
5
4
|
export { createSkillTool } from './skill';
|
package/dist/tui.js
CHANGED
|
@@ -30,20 +30,6 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
30
30
|
return to;
|
|
31
31
|
};
|
|
32
32
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
-
var __returnValue = (v) => v;
|
|
34
|
-
function __exportSetter(name, newValue) {
|
|
35
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
-
}
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, {
|
|
40
|
-
get: all[name],
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
set: __exportSetter.bind(all, name)
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
47
33
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
48
34
|
|
|
49
35
|
// src/tui.ts
|
|
@@ -53,28 +39,17 @@ import { createElement, insert, setProp } from "@opentui/solid";
|
|
|
53
39
|
|
|
54
40
|
// src/config/constants.ts
|
|
55
41
|
var SUBAGENT_NAMES = [
|
|
56
|
-
"researcher"
|
|
57
|
-
"reviewer",
|
|
58
|
-
"implementer",
|
|
59
|
-
"council",
|
|
60
|
-
"councillor"
|
|
42
|
+
"researcher"
|
|
61
43
|
];
|
|
62
44
|
var ORCHESTRATOR_NAME = "orchestrator";
|
|
63
45
|
var ALL_AGENT_NAMES = [ORCHESTRATOR_NAME, ...SUBAGENT_NAMES];
|
|
64
46
|
var PROTECTED_AGENTS = new Set([
|
|
65
47
|
"orchestrator",
|
|
66
|
-
"researcher"
|
|
67
|
-
"reviewer",
|
|
68
|
-
"implementer",
|
|
69
|
-
"councillor"
|
|
48
|
+
"researcher"
|
|
70
49
|
]);
|
|
71
50
|
var DEFAULT_MODELS = {
|
|
72
51
|
orchestrator: undefined,
|
|
73
|
-
|
|
74
|
-
researcher: "openai/gpt-5.4-mini",
|
|
75
|
-
implementer: "openai/gpt-5.4-mini",
|
|
76
|
-
council: "openai/gpt-5.4-mini",
|
|
77
|
-
councillor: "openai/gpt-5.4-mini"
|
|
52
|
+
researcher: "openai/gpt-5.4-mini"
|
|
78
53
|
};
|
|
79
54
|
var POLL_INTERVAL_BACKGROUND_MS = 2000;
|
|
80
55
|
var DEFAULT_TIMEOUT_MS = 2 * 60 * 1000;
|
|
@@ -83,9 +58,7 @@ var DEFAULT_MAX_SUBAGENT_DEPTH = 3;
|
|
|
83
58
|
var PHASE_REMINDER_TEXT = `!IMPORTANT! Recall the workflow rules:
|
|
84
59
|
Understand → choose the best parallelized path based on your capabilities and agents delegation rules → recall session reuse rules → execute → verify.
|
|
85
60
|
If delegating, launch the specialist in the same turn you mention it !END!`;
|
|
86
|
-
var
|
|
87
|
-
var COUNCILLOR_STAGGER_MS = 250;
|
|
88
|
-
var DEFAULT_DISABLED_AGENTS = ["council"];
|
|
61
|
+
var DEFAULT_DISABLED_AGENTS = [];
|
|
89
62
|
|
|
90
63
|
// src/tui-state.ts
|
|
91
64
|
import * as fs from "node:fs";
|
|
@@ -157,7 +130,7 @@ function recordTuiAgentModel(input) {
|
|
|
157
130
|
|
|
158
131
|
// src/tui.ts
|
|
159
132
|
var PLUGIN_NAME = "agent-forge";
|
|
160
|
-
var FALLBACK_SIDEBAR_AGENTS = SUBAGENT_NAMES.filter((agent) =>
|
|
133
|
+
var FALLBACK_SIDEBAR_AGENTS = SUBAGENT_NAMES.filter((agent) => !DEFAULT_DISABLED_AGENTS.includes(agent));
|
|
161
134
|
var BORDER = { type: "single" };
|
|
162
135
|
function readPackageVersion() {
|
|
163
136
|
try {
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ You MUST create a task for each of these items and complete them in order:
|
|
|
34
34
|
3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
35
35
|
4. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
36
36
|
5. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
37
|
-
6. **Write design doc** — save to `docs/
|
|
37
|
+
6. **Write design doc** — save to `docs/agent-forge/specs/YYYY-MM-DD-<topic>-design.md`
|
|
38
38
|
7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below)
|
|
39
39
|
8. **User reviews written spec** — ask user to review the spec file before proceeding
|
|
40
40
|
9. **Transition to implementation** — invoke writing-plans skill to create implementation plan
|
|
@@ -71,7 +71,7 @@ digraph brainstorming {
|
|
|
71
71
|
}
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
**The terminal state is invoking writing-plans.**
|
|
74
|
+
**The terminal state is invoking writing-plans.** Except for Simple tasks, do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
|
|
75
75
|
|
|
76
76
|
## The Process
|
|
77
77
|
|
|
@@ -116,10 +116,9 @@ digraph brainstorming {
|
|
|
116
116
|
|
|
117
117
|
**Documentation:**
|
|
118
118
|
|
|
119
|
-
- Write the validated design (spec) to `docs/
|
|
119
|
+
- Write the validated design (spec) to `docs/agent-forge/specs/YYYY-MM-DD-<topic>-design.md`
|
|
120
120
|
- (User preferences for spec location override this default)
|
|
121
121
|
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
|
122
|
-
- Commit the design document to git
|
|
123
122
|
|
|
124
123
|
**Spec Self-Review:**
|
|
125
124
|
After writing the spec document, look at it with fresh eyes:
|
|
@@ -134,14 +133,14 @@ Fix any issues inline. No need to re-review — just fix and move on.
|
|
|
134
133
|
**User Review Gate:**
|
|
135
134
|
After the spec review loop passes, ask the user to review the written spec before proceeding:
|
|
136
135
|
|
|
137
|
-
> "Spec written
|
|
136
|
+
> "Spec written to `<path>`. Please review it and let me know if you want to make any changes before we start writing out the implementation plan."
|
|
138
137
|
|
|
139
138
|
Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user approves.
|
|
140
139
|
|
|
141
140
|
**Implementation:**
|
|
142
141
|
|
|
143
142
|
- Invoke the writing-plans skill to create a detailed implementation plan
|
|
144
|
-
-
|
|
143
|
+
- Except for Simple tasks, do NOT invoke any other skill. writing-plans is the next step.
|
|
145
144
|
|
|
146
145
|
## Key Principles
|
|
147
146
|
|
|
@@ -4,7 +4,7 @@ Use this template when dispatching a spec document reviewer subagent.
|
|
|
4
4
|
|
|
5
5
|
**Purpose:** Verify the spec is complete, consistent, and ready for implementation planning.
|
|
6
6
|
|
|
7
|
-
**Dispatch after:** Spec document is written to docs/
|
|
7
|
+
**Dispatch after:** Spec document is written to docs/agent-forge/specs/
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
Task tool (general-purpose):
|
|
@@ -7,10 +7,10 @@ Repository understanding and hierarchical codemap generation.
|
|
|
7
7
|
Codemap helps orchestrators map and understand codebases by:
|
|
8
8
|
|
|
9
9
|
1. Selecting relevant code/config files using LLM judgment
|
|
10
|
-
2. Creating `.
|
|
10
|
+
2. Creating `.agf/codemap.json` for change tracking
|
|
11
11
|
3. Generating empty `codemap.md` templates for fixers to fill in
|
|
12
12
|
|
|
13
|
-
Legacy `.
|
|
13
|
+
Legacy `.agf/cartography.json` state is migrated to `.agf/codemap.json` automatically.
|
|
14
14
|
|
|
15
15
|
## Commands
|
|
16
16
|
|
|
@@ -27,7 +27,7 @@ node codemap.mjs update --root /repo
|
|
|
27
27
|
|
|
28
28
|
## Outputs
|
|
29
29
|
|
|
30
|
-
### .
|
|
30
|
+
### .agf/codemap.json
|
|
31
31
|
|
|
32
32
|
```json
|
|
33
33
|
{
|
|
@@ -17,13 +17,13 @@ You help users understand and map repositories by creating hierarchical codemaps
|
|
|
17
17
|
|
|
18
18
|
### Step 1: Check for Existing State
|
|
19
19
|
|
|
20
|
-
**First, check if `.
|
|
20
|
+
**First, check if `.agf/codemap.json` exists in the repo root.**
|
|
21
21
|
|
|
22
|
-
If it does not exist, check for legacy state at `.
|
|
22
|
+
If it does not exist, check for legacy state at `.agf/cartography.json`.
|
|
23
23
|
|
|
24
|
-
If legacy state exists: move `.
|
|
24
|
+
If legacy state exists: move `.agf/cartography.json` to `.agf/codemap.json`, then continue with change detection.
|
|
25
25
|
|
|
26
|
-
If `.
|
|
26
|
+
If `.agf/codemap.json` exists: Skip to Step 3 (Detect Changes) - no need to re-initialize.
|
|
27
27
|
|
|
28
28
|
If neither file exists: Continue to Step 2 (Initialize).
|
|
29
29
|
|
|
@@ -47,7 +47,7 @@ node ~/.config/opencode/skills/codemap/scripts/codemap.mjs init \
|
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
This creates:
|
|
50
|
-
- `.
|
|
50
|
+
- `.agf/codemap.json` - File and folder hashes for change detection
|
|
51
51
|
- Empty `codemap.md` files in all relevant subdirectories
|
|
52
52
|
|
|
53
53
|
4. **Delegate codemap writing to Implementer agents** - Spawn one implementer per folder to read code and create or update its specific `codemap.md` file.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- Provide a command-style skill package that standardizes repository mapping workflows for unfamiliar codebases.
|
|
6
6
|
- Define the task contract used by Orchestrator/implementer agents via `SKILL.md` and operational guidance via `README.md`.
|
|
7
|
-
- Generate and evolve change-aware codemap state artifacts (`.
|
|
7
|
+
- Generate and evolve change-aware codemap state artifacts (`.agf/codemap.json`) and scaffold placeholders (`codemap.md`).
|
|
8
8
|
|
|
9
9
|
## Design
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
- `cmdInit`, `cmdChanges`, `cmdUpdate`
|
|
15
15
|
- `selectFiles`, `computeFileHash`, `computeFolderHash`, `createEmptyCodemap`
|
|
16
16
|
- `loadState`, `saveState`, `migrateLegacyState`
|
|
17
|
-
- Persistence model: JSON state at `.
|
|
17
|
+
- Persistence model: JSON state at `.agf/codemap.json` with `metadata`, `file_hashes`, and `folder_hashes`.
|
|
18
18
|
- Testing layer: `scripts/codemap.test.ts` validates pattern matching, hash determinism, and migration behavior.
|
|
19
19
|
- The script intentionally avoids network and mutates only filesystem-local state and codemap templates.
|
|
20
20
|
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
|
|
23
23
|
- Entry point `main(argv)` parses command and arguments (`init|changes|update`, `--root`, `--include`, `--exclude`, `--exception`) and dispatches via strict branches.
|
|
24
24
|
- `cmdInit()` computes include/exclude candidate sets using `selectFiles()` and writes:
|
|
25
|
-
1) `.
|
|
25
|
+
1) `.agf/codemap.json` via `saveState()`
|
|
26
26
|
2) one `codemap.md` per discovered folder via `createEmptyCodemap()`.
|
|
27
27
|
- `cmdChanges()` reloads state (`loadState()` + `migrateLegacyState()`), recomputes current hashes, emits added/removed/modified diffs and affected folder list, and exits non-zero if state is absent.
|
|
28
28
|
- `cmdUpdate()` recomputes full state from existing metadata and persists it, used after targeted fixers finish updates.
|
|
29
|
-
- `codemap` skill invocation path in SKILL workflow is explicit: Step 1 checks `.
|
|
29
|
+
- `codemap` skill invocation path in SKILL workflow is explicit: Step 1 checks `.agf/codemap.json` or `.agf/cartography.json`, then Step 2/3 selects init or incremental path.
|
|
30
30
|
|
|
31
31
|
## Integration
|
|
32
32
|
|
|
@@ -14,7 +14,7 @@ import path from 'node:path';
|
|
|
14
14
|
import { fileURLToPath } from 'node:url';
|
|
15
15
|
|
|
16
16
|
export const VERSION = '1.0.0';
|
|
17
|
-
export const STATE_DIR = '.
|
|
17
|
+
export const STATE_DIR = '.agf';
|
|
18
18
|
export const STATE_FILE = 'codemap.json';
|
|
19
19
|
export const LEGACY_STATE_FILE = 'cartography.json';
|
|
20
20
|
export const CODEMAP_FILE = 'codemap.md';
|
|
@@ -111,7 +111,7 @@ describe('selectFiles', () => {
|
|
|
111
111
|
describe('loadState', () => {
|
|
112
112
|
test('migrates legacy cartography state', () => {
|
|
113
113
|
const root = createTempDir();
|
|
114
|
-
const slimDir = path.join(root, '.
|
|
114
|
+
const slimDir = path.join(root, '.agf');
|
|
115
115
|
mkdirSync(slimDir);
|
|
116
116
|
|
|
117
117
|
const legacyState = { metadata: { version: '1.0.0' } };
|
|
@@ -58,7 +58,7 @@ HEAD_SHA=$(git rev-parse HEAD)
|
|
|
58
58
|
|
|
59
59
|
[Dispatch superpowers:code-reviewer subagent]
|
|
60
60
|
WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
|
|
61
|
-
PLAN_OR_REQUIREMENTS: Task 2 from docs/
|
|
61
|
+
PLAN_OR_REQUIREMENTS: Task 2 from docs/agent-forge/plans/deployment-plan.md
|
|
62
62
|
BASE_SHA: a7981ec
|
|
63
63
|
HEAD_SHA: 3df7661
|
|
64
64
|
DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
|
|
@@ -128,7 +128,7 @@ Implementer subagents report one of four statuses. Handle each appropriately:
|
|
|
128
128
|
```
|
|
129
129
|
You: I'm using Subagent-Driven Development to execute this plan.
|
|
130
130
|
|
|
131
|
-
[Read plan file once: docs/
|
|
131
|
+
[Read plan file once: docs/agent-forge/plans/feature-plan.md]
|
|
132
132
|
[Extract all 5 tasks with full text and context]
|
|
133
133
|
[Create TodoWrite with all tasks]
|
|
134
134
|
|
|
@@ -15,7 +15,7 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
|
|
|
15
15
|
|
|
16
16
|
**Context:** This should be run in a dedicated worktree (created by brainstorming skill).
|
|
17
17
|
|
|
18
|
-
**Save plans to:** `docs/
|
|
18
|
+
**Save plans to:** `docs/agent-forge/plans/YYYY-MM-DD-<feature-name>.md`
|
|
19
19
|
- (User preferences for plan location override this default)
|
|
20
20
|
|
|
21
21
|
## Scope Check
|
|
@@ -148,7 +148,7 @@ If you find issues, fix them inline. No need to re-review — just fix and move
|
|
|
148
148
|
|
|
149
149
|
After saving the plan, offer execution choice:
|
|
150
150
|
|
|
151
|
-
**"Plan complete and saved to `docs/
|
|
151
|
+
**"Plan complete and saved to `docs/agent-forge/plans/<filename>.md`. Two execution options:**
|
|
152
152
|
|
|
153
153
|
**1. Subagent-Driven (recommended)** - I dispatch a fresh subagent per task, review between tasks, fast iteration
|
|
154
154
|
|
package/dist/agents/council.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type AgentDefinition } from './orchestrator';
|
|
2
|
-
export declare function createCouncilAgent(model: string, customPrompt?: string, customAppendPrompt?: string): AgentDefinition;
|
|
3
|
-
/**
|
|
4
|
-
* Build the prompt for a specific councillor session.
|
|
5
|
-
*
|
|
6
|
-
* Returns the raw user prompt — the agent factory (councillor.ts) provides
|
|
7
|
-
* the system prompt with tool-aware instructions. No duplication.
|
|
8
|
-
*
|
|
9
|
-
* If a per-councillor prompt override is provided, it is prepended as
|
|
10
|
-
* role/guidance context before the user's question.
|
|
11
|
-
*/
|
|
12
|
-
export declare function formatCouncillorPrompt(userPrompt: string, councillorPrompt?: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Format councillor results for the council agent to synthesize.
|
|
15
|
-
*
|
|
16
|
-
* Formats councillor results as structured data that the council agent
|
|
17
|
-
* (which called the tool) will receive as the tool response. The council
|
|
18
|
-
* agent's system prompt contains synthesis instructions.
|
|
19
|
-
* Returns a special message when all councillors failed to produce output.
|
|
20
|
-
*/
|
|
21
|
-
export declare function formatCouncillorResults(originalPrompt: string, councillorResults: Array<{
|
|
22
|
-
name: string;
|
|
23
|
-
model: string;
|
|
24
|
-
status: string;
|
|
25
|
-
result?: string;
|
|
26
|
-
error?: string;
|
|
27
|
-
}>): string;
|
package/dist/cli/skill-sync.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface SkillSyncResult {
|
|
2
|
-
installed: number;
|
|
3
|
-
skipped: number;
|
|
4
|
-
/** Skills that were already correctly symlinked (no change needed) */
|
|
5
|
-
unchanged: number;
|
|
6
|
-
/** Skills installed via file copy (symlink unavailable) */
|
|
7
|
-
copied: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Ensure all built-in skills are symlinked into OpenCode's skills directory.
|
|
11
|
-
*
|
|
12
|
-
* - If a symlink already points to the correct source → skip (unchanged).
|
|
13
|
-
* - If a directory or stale symlink exists → replace with fresh symlink.
|
|
14
|
-
* - If symlink creation fails (e.g. Windows without junction support) →
|
|
15
|
-
* fall back to file copy.
|
|
16
|
-
* - If the source path doesn't exist in the package → skip.
|
|
17
|
-
*
|
|
18
|
-
* @param packageRoot - Absolute path to the agent-forge package root
|
|
19
|
-
* (the directory containing `src/skills/`). Defaults to auto-detected via resolvePackageRoot().
|
|
20
|
-
* @param skillsDirOverride - Override for the target skills directory
|
|
21
|
-
* (useful in tests). Defaults to `<configDir>/skills`.
|
|
22
|
-
*/
|
|
23
|
-
export declare function syncBuiltinSkills(packageRoot?: string, skillsDirOverride?: string): SkillSyncResult;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration for a single councillor within a preset.
|
|
4
|
-
* Each councillor is an independent LLM that processes the same prompt.
|
|
5
|
-
*
|
|
6
|
-
* Councillors run as agent sessions with read-only codebase access
|
|
7
|
-
* (read, glob, grep, lsp, list). They can examine the codebase but
|
|
8
|
-
* cannot modify files or spawn subagents.
|
|
9
|
-
*/
|
|
10
|
-
export declare const CouncillorConfigSchema: z.ZodObject<{
|
|
11
|
-
model: z.ZodString;
|
|
12
|
-
variant: z.ZodOptional<z.ZodString>;
|
|
13
|
-
prompt: z.ZodOptional<z.ZodString>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
export type CouncillorConfig = z.infer<typeof CouncillorConfigSchema>;
|
|
16
|
-
/**
|
|
17
|
-
* A named preset grouping several councillors.
|
|
18
|
-
*
|
|
19
|
-
* All keys are treated as councillor names mapping to councillor configs.
|
|
20
|
-
* The reserved key `"master"` is silently ignored (legacy from when
|
|
21
|
-
* council-master was a separate agent).
|
|
22
|
-
*/
|
|
23
|
-
export declare const CouncilPresetSchema: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>, z.ZodTransform<Record<string, {
|
|
24
|
-
model: string;
|
|
25
|
-
variant?: string | undefined;
|
|
26
|
-
prompt?: string | undefined;
|
|
27
|
-
}>, Record<string, Record<string, unknown>>>>;
|
|
28
|
-
export type CouncilPreset = z.infer<typeof CouncilPresetSchema>;
|
|
29
|
-
/**
|
|
30
|
-
* Execution mode for councillors.
|
|
31
|
-
* - parallel: Run all councillors concurrently (default, fastest for multi-model systems)
|
|
32
|
-
* - serial: Run councillors one at a time (required for single-model systems to avoid conflicts)
|
|
33
|
-
*/
|
|
34
|
-
export declare const CouncillorExecutionModeSchema: z.ZodDefault<z.ZodEnum<{
|
|
35
|
-
parallel: "parallel";
|
|
36
|
-
serial: "serial";
|
|
37
|
-
}>>;
|
|
38
|
-
/**
|
|
39
|
-
* Top-level council configuration.
|
|
40
|
-
*
|
|
41
|
-
* Example JSONC:
|
|
42
|
-
* ```jsonc
|
|
43
|
-
* {
|
|
44
|
-
* "council": {
|
|
45
|
-
* "presets": {
|
|
46
|
-
* "default": {
|
|
47
|
-
* "alpha": { "model": "openai/gpt-5.4-mini" },
|
|
48
|
-
* "beta": { "model": "openai/gpt-5.3-codex" },
|
|
49
|
-
* "gamma": { "model": "google/gemini-3-pro" }
|
|
50
|
-
* }
|
|
51
|
-
* },
|
|
52
|
-
* "timeout": 180000,
|
|
53
|
-
* "councillor_execution_mode": "serial"
|
|
54
|
-
* }
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
export declare const CouncilConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
59
|
-
presets: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>, z.ZodTransform<Record<string, {
|
|
60
|
-
model: string;
|
|
61
|
-
variant?: string | undefined;
|
|
62
|
-
prompt?: string | undefined;
|
|
63
|
-
}>, Record<string, Record<string, unknown>>>>>;
|
|
64
|
-
timeout: z.ZodDefault<z.ZodNumber>;
|
|
65
|
-
default_preset: z.ZodDefault<z.ZodString>;
|
|
66
|
-
councillor_execution_mode: z.ZodDefault<z.ZodEnum<{
|
|
67
|
-
parallel: "parallel";
|
|
68
|
-
serial: "serial";
|
|
69
|
-
}>>;
|
|
70
|
-
councillor_retries: z.ZodDefault<z.ZodNumber>;
|
|
71
|
-
master: z.ZodOptional<z.ZodUnknown>;
|
|
72
|
-
master_timeout: z.ZodOptional<z.ZodUnknown>;
|
|
73
|
-
master_fallback: z.ZodOptional<z.ZodUnknown>;
|
|
74
|
-
}, z.core.$strip>, z.ZodTransform<{
|
|
75
|
-
presets: Record<string, Record<string, {
|
|
76
|
-
model: string;
|
|
77
|
-
variant?: string | undefined;
|
|
78
|
-
prompt?: string | undefined;
|
|
79
|
-
}>>;
|
|
80
|
-
timeout: number;
|
|
81
|
-
default_preset: string;
|
|
82
|
-
councillor_execution_mode: "parallel" | "serial";
|
|
83
|
-
councillor_retries: number;
|
|
84
|
-
_deprecated: string[] | undefined;
|
|
85
|
-
_legacyMasterModel: string | undefined;
|
|
86
|
-
}, {
|
|
87
|
-
presets: Record<string, Record<string, {
|
|
88
|
-
model: string;
|
|
89
|
-
variant?: string | undefined;
|
|
90
|
-
prompt?: string | undefined;
|
|
91
|
-
}>>;
|
|
92
|
-
timeout: number;
|
|
93
|
-
default_preset: string;
|
|
94
|
-
councillor_execution_mode: "parallel" | "serial";
|
|
95
|
-
councillor_retries: number;
|
|
96
|
-
master?: unknown;
|
|
97
|
-
master_timeout?: unknown;
|
|
98
|
-
master_fallback?: unknown;
|
|
99
|
-
}>>;
|
|
100
|
-
export type CouncilConfig = z.infer<typeof CouncilConfigSchema>;
|
|
101
|
-
export type CouncillorExecutionMode = z.infer<typeof CouncillorExecutionModeSchema>;
|
|
102
|
-
/**
|
|
103
|
-
* A sensible default council configuration that users can copy into their
|
|
104
|
-
* opencode.jsonc. Provides a 3-councillor preset using common models.
|
|
105
|
-
*
|
|
106
|
-
* Users should replace models with ones they have access to.
|
|
107
|
-
*
|
|
108
|
-
* ```jsonc
|
|
109
|
-
* "council": DEFAULT_COUNCIL_CONFIG
|
|
110
|
-
* ```
|
|
111
|
-
*/
|
|
112
|
-
export declare const DEFAULT_COUNCIL_CONFIG: z.input<typeof CouncilConfigSchema>;
|
|
113
|
-
/**
|
|
114
|
-
* Result of a council session.
|
|
115
|
-
*/
|
|
116
|
-
export interface CouncilResult {
|
|
117
|
-
success: boolean;
|
|
118
|
-
result?: string;
|
|
119
|
-
error?: string;
|
|
120
|
-
councillorResults: Array<{
|
|
121
|
-
name: string;
|
|
122
|
-
model: string;
|
|
123
|
-
status: 'completed' | 'failed' | 'timed_out';
|
|
124
|
-
result?: string;
|
|
125
|
-
error?: string;
|
|
126
|
-
}>;
|
|
127
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Council Manager
|
|
3
|
-
*
|
|
4
|
-
* Orchestrates multi-LLM council sessions: launches councillors in
|
|
5
|
-
* parallel and collects their results for the council agent to synthesize.
|
|
6
|
-
*/
|
|
7
|
-
import type { PluginInput } from '@opencode-ai/plugin';
|
|
8
|
-
import type { PluginConfig } from '../config';
|
|
9
|
-
import type { CouncilResult } from '../config/council-schema';
|
|
10
|
-
import type { SubagentDepthTracker } from '../utils/subagent-depth';
|
|
11
|
-
export declare class CouncilManager {
|
|
12
|
-
private client;
|
|
13
|
-
private directory;
|
|
14
|
-
private config?;
|
|
15
|
-
private depthTracker?;
|
|
16
|
-
private tmuxEnabled;
|
|
17
|
-
private deprecatedFields?;
|
|
18
|
-
private legacyMasterModel?;
|
|
19
|
-
constructor(ctx: PluginInput, config?: PluginConfig, depthTracker?: SubagentDepthTracker, tmuxEnabled?: boolean);
|
|
20
|
-
/** Return deprecated config fields detected during parsing (for tool warnings). */
|
|
21
|
-
getDeprecatedFields(): string[] | undefined;
|
|
22
|
-
/** Return the legacy master.model if it was used as fallback. */
|
|
23
|
-
getLegacyMasterModel(): string | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Run a full council session.
|
|
26
|
-
*
|
|
27
|
-
* 1. Look up the preset
|
|
28
|
-
* 2. Launch all councillors in parallel
|
|
29
|
-
* 3. Collect results (respecting timeout)
|
|
30
|
-
* 4. Return formatted councillor results for synthesis
|
|
31
|
-
*/
|
|
32
|
-
runCouncil(prompt: string, presetName: string | undefined, parentSessionId: string): Promise<CouncilResult>;
|
|
33
|
-
/**
|
|
34
|
-
* Inject a start notification into the parent session so the user
|
|
35
|
-
* sees immediate feedback while councillors are spinning up.
|
|
36
|
-
*/
|
|
37
|
-
private sendStartNotification;
|
|
38
|
-
/**
|
|
39
|
-
* Run a single agent session: create → register → prompt → extract → cleanup.
|
|
40
|
-
*/
|
|
41
|
-
private runAgentSession;
|
|
42
|
-
private runCouncillors;
|
|
43
|
-
/**
|
|
44
|
-
* Run a single councillor with retry logic for empty responses.
|
|
45
|
-
* Only retries on "Empty response from provider" errors — timeouts
|
|
46
|
-
* and other failures are returned immediately.
|
|
47
|
-
*/
|
|
48
|
-
private runCouncillorWithRetry;
|
|
49
|
-
}
|
package/dist/council/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { CouncilManager } from './council-manager';
|
package/dist/tools/council.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type PluginInput, type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
-
import type { CouncilManager } from '../council/council-manager';
|
|
3
|
-
/**
|
|
4
|
-
* Creates the council_session tool for multi-LLM orchestration.
|
|
5
|
-
*
|
|
6
|
-
* This tool triggers a full council session: parallel councillors →
|
|
7
|
-
* formatted results returned to the council agent for synthesis.
|
|
8
|
-
* Available to the council agent.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createCouncilTool(_ctx: PluginInput, councilManager: CouncilManager): Record<string, ToolDefinition>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function resolvePackageRoot(): string;
|