opencode-swarm 7.0.1 → 7.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -162,9 +162,9 @@ export declare const COMMAND_REGISTRY: {
162
162
  };
163
163
  readonly council: {
164
164
  readonly handler: (ctx: CommandContext) => Promise<string>;
165
- readonly description: "Enter architect MODE: COUNCIL — multi-model deliberation [question] [--preset <name>] [--spec-review]";
166
- readonly args: "<question> [--preset <name>] [--spec-review]";
167
- readonly details: "Triggers the architect to convene a configurable General Council: each member independently web-searches, answers, and engages in one structured deliberation round on disagreements; an optional moderator pass synthesizes the final answer. --preset <name> selects a member group from council.general.presets. --spec-review switches to single-pass advisory mode for spec review. Requires council.general.enabled: true and a search API key in opencode-swarm.json.";
165
+ readonly description: "Enter architect MODE: COUNCIL — multi-model deliberation [question] [--spec-review]";
166
+ readonly args: "<question> [--spec-review]";
167
+ readonly details: string;
168
168
  };
169
169
  readonly 'pr-review': {
170
170
  readonly handler: (ctx: CommandContext) => Promise<string>;
@@ -2,8 +2,8 @@ import type { ToolName } from '../tools/tool-names';
2
2
  export declare const QA_AGENTS: readonly ["reviewer", "critic", "critic_oversight"];
3
3
  export declare const PIPELINE_AGENTS: readonly ["explorer", "coder", "test_engineer"];
4
4
  export declare const ORCHESTRATOR_NAME: "architect";
5
- export declare const ALL_SUBAGENT_NAMES: readonly ["sme", "docs", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "curator_init", "curator_phase", "council_member", "council_moderator", "reviewer", "critic", "critic_oversight", "explorer", "coder", "test_engineer"];
6
- export declare const ALL_AGENT_NAMES: readonly ["architect", "sme", "docs", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "curator_init", "curator_phase", "council_member", "council_moderator", "reviewer", "critic", "critic_oversight", "explorer", "coder", "test_engineer"];
5
+ export declare const ALL_SUBAGENT_NAMES: readonly ["sme", "docs", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "curator_init", "curator_phase", "council_generalist", "council_skeptic", "council_domain_expert", "reviewer", "critic", "critic_oversight", "explorer", "coder", "test_engineer"];
6
+ export declare const ALL_AGENT_NAMES: readonly ["architect", "sme", "docs", "designer", "critic_sounding_board", "critic_drift_verifier", "critic_hallucination_verifier", "curator_init", "curator_phase", "council_generalist", "council_skeptic", "council_domain_expert", "reviewer", "critic", "critic_oversight", "explorer", "coder", "test_engineer"];
7
7
  export declare const OPENCODE_NATIVE_AGENTS: Set<"compaction" | "title" | "build" | "general" | "plan" | "explore" | "summary">;
8
8
  export type QAAgentName = (typeof QA_AGENTS)[number];
9
9
  export type PipelineAgentName = (typeof PIPELINE_AGENTS)[number];
@@ -2,7 +2,7 @@ export type { AgentName, PipelineAgentName, QAAgentName, } from './constants';
2
2
  export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, DEFAULT_MODELS, isQAAgent, isSubagent, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS, } from './constants';
3
3
  export type { ApprovalEvidence, BaseEvidence, DiffEvidence, Evidence, EvidenceBundle, EvidenceType, EvidenceVerdict, NoteEvidence, ReviewEvidence, TestEvidence, } from './evidence-schema';
4
4
  export { ApprovalEvidenceSchema, BaseEvidenceSchema, DiffEvidenceSchema, EVIDENCE_MAX_JSON_BYTES, EVIDENCE_MAX_PATCH_BYTES, EVIDENCE_MAX_TASK_BYTES, EvidenceBundleSchema, EvidenceSchema, EvidenceTypeSchema, EvidenceVerdictSchema, NoteEvidenceSchema, ReviewEvidenceSchema, TestEvidenceSchema, } from './evidence-schema';
5
- export { loadAgentPrompt, loadPluginConfig, loadPluginConfigWithMeta, } from './loader';
5
+ export { loadAgentPrompt, loadPluginConfig, loadPluginConfigWithMeta, loadPluginConfigWithMetaAsync, } from './loader';
6
6
  export type { MigrationStatus, Phase, PhaseStatus, Plan, Task, TaskSize, TaskStatus, } from './plan-schema';
7
7
  export { MigrationStatusSchema, PhaseSchema, PhaseStatusSchema, PlanSchema, TaskSchema, TaskSizeSchema, TaskStatusSchema, } from './plan-schema';
8
8
  export type { AgentOverrideConfig, AutomationCapabilities, AutomationConfig, AutomationMode, PhaseCompleteConfig, PipelineConfig, PluginConfig, SwarmConfig, } from './schema';
@@ -22,6 +22,14 @@ export declare function loadPluginConfigWithMeta(directory: string): {
22
22
  config: PluginConfig;
23
23
  loadedFromFile: boolean;
24
24
  };
25
+ /**
26
+ * Async variant of `loadPluginConfigWithMeta`. Used by the plugin entry
27
+ * (issue #704) so initialization does not perform synchronous fs reads.
28
+ */
29
+ export declare function loadPluginConfigWithMetaAsync(directory: string): Promise<{
30
+ config: PluginConfig;
31
+ loadedFromFile: boolean;
32
+ }>;
25
33
  /**
26
34
  * Load custom prompt for an agent from the prompts directory.
27
35
  * Checks for {agent}.md (replaces default) and {agent}_append.md (appends).
@@ -20,7 +20,7 @@ import type { AgentSessionState } from '../state';
20
20
  import type { GeneralCouncilResult } from './general-council-types.js';
21
21
  /**
22
22
  * Push a GeneralCouncilResult into the architect's advisory queue. The body
23
- * is the synthesis markdown plus the moderator output when present.
23
+ * is the structural synthesis markdown returned by `convene_general_council`.
24
24
  *
25
25
  * Safe to call: missing session or empty advisory body silently skips.
26
26
  * Always idempotent at the architect-prompt level (no duplicate-suppression
@@ -2,10 +2,12 @@
2
2
  * General Council Mode — data contracts.
3
3
  *
4
4
  * Distinct from the Work Complete Council (`./types.ts`). The general council
5
- * is an advisory deliberation system: user-selected models each independently
6
- * web-search and answer a question, then optionally engage in a single
7
- * disagreement-targeted reconciliation round. A moderator agent synthesizes
8
- * the final user-facing answer.
5
+ * is an advisory deliberation system: a fixed three-agent council
6
+ * (council_generalist / council_skeptic / council_domain_expert) reviews a
7
+ * question using an architect-supplied RESEARCH CONTEXT block and a
8
+ * disagreement-targeted reconciliation round. The architect synthesizes the
9
+ * final user-facing answer directly using inline output rules — the
10
+ * dedicated council_moderator agent has been removed.
9
11
  *
10
12
  * No business logic, no I/O. Only types, interfaces, and defaults.
11
13
  */
@@ -59,10 +61,12 @@ export interface GeneralCouncilResult {
59
61
  persistingDisagreements: string[];
60
62
  allSources: WebSearchResult[];
61
63
  /**
62
- * Final moderator output (when council.general.moderator: true and a moderator
63
- * model is configured). Populated by `convene-general-council.ts` after the
64
- * architect delegates the moderator prompt to `council_moderator`. Undefined
65
- * when no moderator pass is configured.
64
+ * @deprecated The dedicated council_moderator agent has been removed; the
65
+ * architect now synthesizes the final answer directly using inline output
66
+ * rules. This field is never populated post-refactor and the consumer in
67
+ * `general-council-advisory.ts` guards on its presence so omitting it is
68
+ * safe. Field kept on the type for backward compatibility with persisted
69
+ * evidence files.
66
70
  */
67
71
  moderatorOutput?: string;
68
72
  timestamp: string;
@@ -70,10 +74,17 @@ export interface GeneralCouncilResult {
70
74
  /**
71
75
  * Config shape — matched in schema.ts via GeneralCouncilConfigSchema.
72
76
  *
73
- * `enabled` defaults to false (feature gate). The moderator pass requires
74
- * a configured `moderatorModel`; when set, the architect delegates the
75
- * moderator prompt produced by `convene_general_council` to the dedicated
76
- * `council_moderator` agent (no `web_search` access — synthesis only).
77
+ * `enabled` defaults to false (feature gate). The council is now a fixed
78
+ * three-agent set (generalist / skeptic / domain_expert) registered when
79
+ * `enabled` is true; their models come from the reviewer / critic / sme
80
+ * swarm config entries respectively.
81
+ *
82
+ * Several fields are retained for backward compatibility with existing
83
+ * `opencode-swarm.json` files but are NO LONGER USED at runtime. See the
84
+ * per-field deprecation notes below. The schema in `schema.ts` is `.strict()`
85
+ * so removing these fields would break validation for users with stale
86
+ * configs; instead, they are accepted and ignored, and a deferred warning
87
+ * is surfaced when the legacy moderator fields are set.
77
88
  */
78
89
  export interface GeneralCouncilConfig {
79
90
  enabled: boolean;
@@ -83,16 +94,32 @@ export interface GeneralCouncilConfig {
83
94
  * `BRAVE_SEARCH_API_KEY` env vars depending on `searchProvider`.
84
95
  */
85
96
  searchApiKey?: string;
97
+ /**
98
+ * @deprecated Member selection is hardcoded to the three council agents
99
+ * (generalist / skeptic / domain_expert). This field is retained for
100
+ * backward compatibility but is ignored at runtime.
101
+ */
86
102
  members: GeneralCouncilMemberConfig[];
87
- /** Named groups of members for `/swarm council --preset <name>`. */
103
+ /**
104
+ * @deprecated Preset-based member selection is no longer supported.
105
+ * Retained for backward compatibility; ignored at runtime.
106
+ */
88
107
  presets: Record<string, GeneralCouncilMemberConfig[]>;
89
- /** When true, after Round 1 the architect routes disagreements back to disputing members. */
108
+ /** When true, after Round 1 the architect routes disagreements back to disputing agents. */
90
109
  deliberate: boolean;
91
- /** When true, the architect delegates a moderator pass to `council_moderator` after synthesis. */
110
+ /**
111
+ * @deprecated The dedicated council_moderator agent has been removed; the
112
+ * architect synthesizes the final answer directly. Retained for backward
113
+ * compatibility; ignored at runtime. A deferred warning is surfaced when
114
+ * this field is set to silence the deprecation explicitly.
115
+ */
92
116
  moderator: boolean;
93
- /** Required when `moderator: true` — model identifier for the council_moderator delegation. */
117
+ /**
118
+ * @deprecated See `moderator` — no longer used. Retained for backward
119
+ * compatibility; ignored at runtime.
120
+ */
94
121
  moderatorModel?: string;
95
- /** Hard cap on results returned per member per search call (1–20). Defaults to 5. */
122
+ /** Hard cap on results returned per architect web_search call (1–20). Defaults to 5. */
96
123
  maxSourcesPerMember: number;
97
124
  }
98
125
  export declare const GENERAL_COUNCIL_DEFAULTS: GeneralCouncilConfig;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Repo-graph builder hook tests (issue #704).
3
+ *
4
+ * These tests validate the contract that prevents the OpenCode Desktop hang:
5
+ * - calling `init()` returns control to the caller within a single
6
+ * macrotask (i.e. async-function-runs-sync-until-first-await is not
7
+ * reintroduced),
8
+ * - `toolAfter` waits for the initial scan before applying incremental
9
+ * updates (no race between the deferred init and the first write tool),
10
+ * - the homedir-refusal guard surfaces as a clean catch in `init()`.
11
+ */
12
+ export {};
@@ -4,6 +4,16 @@
4
4
  * Startup hook that builds or refreshes the repo dependency graph when a session starts.
5
5
  * Write-trigger hook that incrementally updates the graph when write tools are called.
6
6
  * Wrapped in try/catch — failures are logged but never block plugin initialization.
7
+ *
8
+ * Issue #704: the previous implementation called the synchronous
9
+ * `buildWorkspaceGraph` from inside an `async init()`. JS executes async
10
+ * function bodies synchronously up to the first `await`, so calling
11
+ * `init()` blocked the entire event loop on the recursive workspace scan,
12
+ * preventing the plugin host's `await server(...)` from ever resolving and
13
+ * hanging the OpenCode Desktop loading screen indefinitely. The fix wires
14
+ * the async builder, yields to the event loop before doing any work, and
15
+ * exposes the init promise so `toolAfter` can serialize incremental
16
+ * updates after the initial scan completes.
7
17
  */
8
18
  import { type RepoGraph } from '../tools/repo-graph';
9
19
  export interface RepoGraphBuilderHook {
@@ -21,7 +31,9 @@ export interface RepoGraphDeps {
21
31
  buildWorkspaceGraph: (workspace: string, options?: {
22
32
  maxFileSizeBytes?: number;
23
33
  maxFiles?: number;
24
- }) => RepoGraph;
34
+ walkBudgetMs?: number;
35
+ followSymlinks?: boolean;
36
+ }) => Promise<RepoGraph>;
25
37
  saveGraph: (workspace: string, graph: RepoGraph, options?: {
26
38
  createAtomic?: boolean;
27
39
  }) => Promise<void>;