opencode-swarm 7.99.4 → 7.99.6

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.
@@ -14,7 +14,7 @@ import { extractFileSymbols } from '../../lang/symbol-graph';
14
14
  import { extractPythonSymbols, extractTSSymbols } from '../symbols';
15
15
  import { extractFileOntology } from './ontology';
16
16
  import { safeRealpathSync } from './safe-realpath';
17
- import type { BuildWorkspaceGraphOptions, GraphEdge, GraphNode, RepoGraph, SymbolEdge } from './types';
17
+ import type { BuildWorkspaceGraphOptions, GraphEdge, GraphNode, RepoGraph, RepoGraphDiagnostics, SymbolEdge } from './types';
18
18
  /**
19
19
  * _internals DI seam for safeRealpathSync.
20
20
  * Defaults to the real implementation. Tests can override this to inject
@@ -141,6 +141,8 @@ export interface AsyncScanResult {
141
141
  edges: GraphEdge[];
142
142
  /** Symbol-to-symbol reference edges (schema >= 1.2.0). */
143
143
  symbolEdges: SymbolEdge[];
144
+ /** Optional file-level diagnostics collected during async scanning. */
145
+ diagnostics?: RepoGraphDiagnostics;
144
146
  }
145
147
  /**
146
148
  * Scan a single file and extract its graph node and edges.
@@ -157,11 +159,11 @@ export declare function scanFile(filePath: string, absoluteRoot: string, maxFile
157
159
  * (extractFileSymbols) to populate exportRanges and symbolEdges.
158
160
  *
159
161
  * Fail-open: if extractFileSymbols returns null (grammar unavailable,
160
- * timeout, parse error), falls back to a minimal file-level node with
161
- * empty exports/imports/symbolEdges never throws.
162
+ * timeout, parse error), falls back to the file-level scanner so imports,
163
+ * exports, and dependency edges are preserved.
162
164
  *
163
- * Oversized, binary, or unreadable files return { node: null, edges: [], symbolEdges: [] }
164
- * matching the sync scanFile contract.
165
+ * Oversized, binary, or unreadable files return
166
+ * { node: null, edges: [], symbolEdges: [] } with bounded diagnostics.
165
167
  *
166
168
  * @param filePath - Absolute path to the file to scan
167
169
  * @param absoluteRoot - Absolute path to workspace root
@@ -1,7 +1,8 @@
1
- import type { BlastRadiusResult, CallerReference, ContextPackResult, DeadExportsResult, FileOntology, FileReference, GraphNode, LocalizationBlock, PackageBoundarySummary, RepoGraph, SymbolReference } from './types';
1
+ import type { BlastRadiusResult, CallerReference, ContextPackResult, DeadExportsResult, FileOntology, FileReference, GraphHealthResult, GraphNode, LocalizationBlock, PackageBoundarySummary, RepoGraph, SymbolReference } from './types';
2
2
  export declare function getGraphNode(graph: RepoGraph, input: string): GraphNode | undefined;
3
3
  export declare function resetQueryCache(): void;
4
4
  export declare function isGraphFresh(graph: RepoGraph | null, maxAgeMs?: number): boolean;
5
+ export declare function getGraphHealth(graph: RepoGraph | null, workspaceRoot?: string): GraphHealthResult;
5
6
  export declare function getImporters(graph: RepoGraph, filePath: string): FileReference[];
6
7
  export declare function getDependencies(graph: RepoGraph, filePath: string): FileReference[];
7
8
  export declare function getSymbolConsumers(graph: RepoGraph, filePath: string, symbolName: string): SymbolReference[];
@@ -22,6 +22,10 @@ export declare const REPO_GRAPH_FILENAME = "repo-graph.json";
22
22
  * symbol reference edges). Both fields are optional, so 1.0.0 and 1.1.0 graphs
23
23
  * still load without corruption. New queries may use these fields to provide
24
24
  * more precise context-packing and symbol-level navigation.
25
+ *
26
+ * Diagnostics are additive and optional on all schema versions. Old graphs
27
+ * without diagnostics remain readable; graph-health queries surface empty
28
+ * diagnostics with an explicit rebuild note.
25
29
  */
26
30
  export declare const GRAPH_SCHEMA_VERSION = "1.2.0";
27
31
  /**
@@ -248,6 +252,37 @@ export interface DeadExportsResult {
248
252
  /** Human-readable note describing scope and limitations of the result. */
249
253
  note: string;
250
254
  }
255
+ export interface GraphExtractionFailure {
256
+ file: string;
257
+ language: string;
258
+ reason: string;
259
+ }
260
+ export interface GraphUnresolvedImport {
261
+ file: string;
262
+ specifier: string;
263
+ }
264
+ export interface RepoGraphDiagnostics {
265
+ extractionFailures?: GraphExtractionFailure[];
266
+ unresolvedImports?: GraphUnresolvedImport[];
267
+ oversizedFiles?: string[];
268
+ unsupportedFiles?: string[];
269
+ binaryFiles?: string[];
270
+ unreadableFiles?: string[];
271
+ lowConfidenceEdgeCount?: number;
272
+ }
273
+ export interface GraphHealthResult {
274
+ schemaVersion: string | null;
275
+ fresh: boolean;
276
+ staleFiles: string[];
277
+ extractionFailures: GraphExtractionFailure[];
278
+ unresolvedImports: GraphUnresolvedImport[];
279
+ oversizedFiles: string[];
280
+ unsupportedFiles: string[];
281
+ binaryFiles: string[];
282
+ unreadableFiles: string[];
283
+ lowConfidenceEdgeCount: number;
284
+ notes: string[];
285
+ }
251
286
  export interface BlastRadiusResult {
252
287
  target: string[];
253
288
  directDependents: string[];
@@ -299,6 +334,8 @@ export interface RepoGraph {
299
334
  };
300
335
  /** Symbol-level reference edges (schema >= 1.2.0; absent on older graphs). */
301
336
  symbolEdges?: SymbolEdge[];
337
+ /** Optional bounded diagnostics from the last graph build. */
338
+ diagnostics?: RepoGraphDiagnostics;
302
339
  }
303
340
  /**
304
341
  * Options for building a workspace graph.
@@ -21,8 +21,8 @@ export { updateGraphForFiles } from './repo-graph/incremental';
21
21
  export type { ExtractFileOntologyInput } from './repo-graph/ontology';
22
22
  export { extractFileOntology } from './repo-graph/ontology';
23
23
  export type { DeadExportsOptions } from './repo-graph/query';
24
- export { buildOntologyPreflightPacket, getBlastRadius, getCallers, getContextPack, getDeadExports, getDependencies, getFileOntology, getGraphNode, getImporters, getKeyFiles, getLocalizationContext, getPackageBoundaries, getSymbolConsumers, isGraphFresh, resetQueryCache, } from './repo-graph/query';
24
+ export { buildOntologyPreflightPacket, getBlastRadius, getCallers, getContextPack, getDeadExports, getDependencies, getFileOntology, getGraphHealth, getGraphNode, getImporters, getKeyFiles, getLocalizationContext, getPackageBoundaries, getSymbolConsumers, isGraphFresh, resetQueryCache, } from './repo-graph/query';
25
25
  export { getGraphPath, loadGraph, loadGraphSync, loadOrCreateGraph, saveGraph, saveIfDirty, } from './repo-graph/storage';
26
- export type { BlastRadiusResult, BuildWorkspaceGraphOptions, CallerReference, ContextPackResult, ContextPackSpan, ConventionFact, DataOperationFact, DeadExportCandidate, DeadExportsResult, FileOntology, FileReference, FileRole, GraphEdge, GraphNode, LocalizationBlock, OntologyFinding, PackageBoundarySummary, RepoGraph, RouteFact, RouteMethod, SecurityFact, SymbolEdge, SymbolReference, } from './repo-graph/types';
26
+ export type { BlastRadiusResult, BuildWorkspaceGraphOptions, CallerReference, ContextPackResult, ContextPackSpan, ConventionFact, DataOperationFact, DeadExportCandidate, DeadExportsResult, FileOntology, FileReference, FileRole, GraphEdge, GraphExtractionFailure, GraphHealthResult, GraphNode, GraphUnresolvedImport, LocalizationBlock, OntologyFinding, PackageBoundarySummary, RepoGraph, RepoGraphDiagnostics, RouteFact, RouteMethod, SecurityFact, SymbolEdge, SymbolReference, } from './repo-graph/types';
27
27
  export { createEmptyGraph, GRAPH_SCHEMA_VERSION, isSchemaVersionAtLeast, normalizeGraphPath, REPO_GRAPH_FILENAME, updateGraphMetadata, } from './repo-graph/types';
28
28
  export { validateGraphEdge, validateGraphNode, validateWorkspace, } from './repo-graph/validation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.99.4",
3
+ "version": "7.99.6",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",