opencode-swarm 6.16.1 → 6.17.1
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 +17 -0
- package/dist/commands/dark-matter.d.ts +5 -0
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/knowledge.d.ts +15 -0
- package/dist/config/evidence-schema.d.ts +3 -3
- package/dist/config/schema.d.ts +35 -0
- package/dist/hooks/delegation-gate.d.ts +10 -3
- package/dist/hooks/hive-promoter.d.ts +16 -0
- package/dist/hooks/knowledge-curator.d.ts +17 -0
- package/dist/hooks/knowledge-injector.d.ts +20 -0
- package/dist/hooks/knowledge-migrator.d.ts +10 -0
- package/dist/hooks/knowledge-reader.d.ts +18 -0
- package/dist/hooks/knowledge-store.d.ts +19 -0
- package/dist/hooks/knowledge-types.d.ts +101 -0
- package/dist/hooks/knowledge-validator.d.ts +28 -0
- package/dist/index.js +4156 -426
- package/dist/state.d.ts +8 -2
- package/dist/tools/co-change-analyzer.d.ts +43 -0
- package/package.json +2 -1
package/dist/state.d.ts
CHANGED
|
@@ -59,6 +59,8 @@ export interface AgentSessionState {
|
|
|
59
59
|
architectWriteCount: number;
|
|
60
60
|
/** Last task ID that was delegated to coder (for zero-delegation detection) */
|
|
61
61
|
lastCoderDelegationTaskId: string | null;
|
|
62
|
+
/** Current task ID being worked on (set when coder delegation fires, used for per-task gate tracking) */
|
|
63
|
+
currentTaskId: string | null;
|
|
62
64
|
/** Gate names observed for current task (taskId → Set of gates) */
|
|
63
65
|
gateLog: Map<string, Set<string>>;
|
|
64
66
|
/** Reviewer delegations per phase (phaseNumber → count) */
|
|
@@ -69,12 +71,16 @@ export interface AgentSessionState {
|
|
|
69
71
|
taskId: string;
|
|
70
72
|
timestamp: number;
|
|
71
73
|
} | null;
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
+
/** Task IDs for which partial gate warning has already been issued (prevents per-task spam) */
|
|
75
|
+
partialGateWarningsIssuedForTask: Set<string>;
|
|
74
76
|
/** Whether architect attempted self-fix write after gate failure */
|
|
75
77
|
selfFixAttempted: boolean;
|
|
76
78
|
/** Phases that have already received a catastrophic zero-reviewer warning */
|
|
77
79
|
catastrophicPhaseWarnings: Set<number>;
|
|
80
|
+
/** Number of consecutive coder delegations without reviewer/test_engineer between them */
|
|
81
|
+
qaSkipCount: number;
|
|
82
|
+
/** Task IDs skipped without QA (for audit trail), reset when reviewer/test_engineer fires */
|
|
83
|
+
qaSkipTaskIds: string[];
|
|
78
84
|
/** Timestamp of most recent phase completion */
|
|
79
85
|
lastPhaseCompleteTimestamp: number;
|
|
80
86
|
/** Phase number of most recent phase completion */
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SwarmKnowledgeEntry } from '../hooks/knowledge-types.js';
|
|
2
|
+
export interface CoChangeEntry {
|
|
3
|
+
fileA: string;
|
|
4
|
+
fileB: string;
|
|
5
|
+
coChangeCount: number;
|
|
6
|
+
npmi: number;
|
|
7
|
+
lift: number;
|
|
8
|
+
hasStaticEdge: boolean;
|
|
9
|
+
totalCommits: number;
|
|
10
|
+
commitsA: number;
|
|
11
|
+
commitsB: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DarkMatterOptions {
|
|
14
|
+
minCommits?: number;
|
|
15
|
+
minCoChanges?: number;
|
|
16
|
+
npmiThreshold?: number;
|
|
17
|
+
maxCommitsToAnalyze?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Parses git log to extract commit -> files mapping.
|
|
21
|
+
* Returns empty Map on timeout or error.
|
|
22
|
+
*/
|
|
23
|
+
export declare function parseGitLog(directory: string, maxCommits: number): Promise<Map<string, Set<string>>>;
|
|
24
|
+
/**
|
|
25
|
+
* Builds co-change matrix from commit -> files mapping.
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildCoChangeMatrix(commitMap: Map<string, Set<string>>): Map<string, CoChangeEntry>;
|
|
28
|
+
/**
|
|
29
|
+
* Detects static import edges between files.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getStaticEdges(directory: string): Promise<Set<string>>;
|
|
32
|
+
/**
|
|
33
|
+
* Main entry point: detects dark matter (hidden couplings).
|
|
34
|
+
*/
|
|
35
|
+
export declare function detectDarkMatter(directory: string, options?: DarkMatterOptions): Promise<CoChangeEntry[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Converts dark matter findings to knowledge entries.
|
|
38
|
+
*/
|
|
39
|
+
export declare function darkMatterToKnowledgeEntries(pairs: CoChangeEntry[], projectName: string): SwarmKnowledgeEntry[];
|
|
40
|
+
/**
|
|
41
|
+
* Formats dark matter findings as markdown output.
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatDarkMatterOutput(pairs: CoChangeEntry[]): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.1",
|
|
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",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@opencode-ai/sdk": "^1.1.53",
|
|
50
50
|
"@vscode/tree-sitter-wasm": "^0.3.0",
|
|
51
51
|
"p-limit": "^7.3.0",
|
|
52
|
+
"proper-lockfile": "^4.1.2",
|
|
52
53
|
"web-tree-sitter": "^0.25.0",
|
|
53
54
|
"zod": "^4.1.8"
|
|
54
55
|
},
|