opencode-swarm 7.0.2 → 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.
@@ -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).
@@ -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>;