opencode-swarm 6.15.0 → 6.16.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 +28 -1
- package/dist/build/discovery.d.ts +4 -0
- package/dist/index.js +17525 -15394
- package/dist/lang/detector.d.ts +20 -0
- package/dist/lang/grammars/tree-sitter-dart.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-kotlin.wasm +0 -0
- package/dist/lang/grammars/tree-sitter-swift.wasm +0 -0
- package/dist/lang/index.d.ts +2 -0
- package/dist/lang/profiles.d.ts +71 -0
- package/dist/sast/semgrep.d.ts +4 -0
- package/dist/tools/lint.d.ts +18 -2
- package/dist/tools/test-runner.d.ts +1 -1
- package/package.json +4 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Detection Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides detectProjectLanguages() for scanning a project directory
|
|
5
|
+
* and getProfileForFile() for resolving a language profile from a file path.
|
|
6
|
+
* No tool logic — pure detection only.
|
|
7
|
+
*/
|
|
8
|
+
import { type LanguageProfile } from './profiles.js';
|
|
9
|
+
/**
|
|
10
|
+
* Resolve a language profile from a file path based on its extension.
|
|
11
|
+
* Returns undefined for files with no extension or unknown extensions.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getProfileForFile(filePath: string): LanguageProfile | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Scan a project directory (and immediate subdirectories) to detect active languages.
|
|
16
|
+
* Detection is based on presence of build indicator files or source files with known extensions.
|
|
17
|
+
* Returns unique profiles in priority order (Tier 1 first, then Tier 2, then Tier 3).
|
|
18
|
+
* Skips unreadable directories silently.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectProjectLanguages(projectDir: string): Promise<LanguageProfile[]>;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/lang/index.d.ts
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language Profile Registry - Pure Data Types
|
|
3
|
+
*
|
|
4
|
+
* This file defines the LanguageProfile interface and LanguageRegistry class.
|
|
5
|
+
* No tool logic, no subprocess calls - pure data definitions only.
|
|
6
|
+
*/
|
|
7
|
+
export interface BuildCommand {
|
|
8
|
+
name: string;
|
|
9
|
+
cmd: string;
|
|
10
|
+
detectFile?: string;
|
|
11
|
+
priority: number;
|
|
12
|
+
}
|
|
13
|
+
export interface TestFramework {
|
|
14
|
+
name: string;
|
|
15
|
+
detect: string;
|
|
16
|
+
cmd: string;
|
|
17
|
+
priority: number;
|
|
18
|
+
}
|
|
19
|
+
export interface LintTool {
|
|
20
|
+
name: string;
|
|
21
|
+
detect: string;
|
|
22
|
+
cmd: string;
|
|
23
|
+
priority: number;
|
|
24
|
+
}
|
|
25
|
+
export interface LanguageProfile {
|
|
26
|
+
id: string;
|
|
27
|
+
displayName: string;
|
|
28
|
+
tier: 1 | 2 | 3;
|
|
29
|
+
extensions: string[];
|
|
30
|
+
treeSitter: {
|
|
31
|
+
grammarId: string;
|
|
32
|
+
wasmFile: string;
|
|
33
|
+
};
|
|
34
|
+
build: {
|
|
35
|
+
detectFiles: string[];
|
|
36
|
+
commands: BuildCommand[];
|
|
37
|
+
};
|
|
38
|
+
test: {
|
|
39
|
+
detectFiles: string[];
|
|
40
|
+
frameworks: TestFramework[];
|
|
41
|
+
};
|
|
42
|
+
lint: {
|
|
43
|
+
detectFiles: string[];
|
|
44
|
+
linters: LintTool[];
|
|
45
|
+
};
|
|
46
|
+
audit: {
|
|
47
|
+
detectFiles: string[];
|
|
48
|
+
command: string | null;
|
|
49
|
+
outputFormat: 'json' | 'text';
|
|
50
|
+
};
|
|
51
|
+
sast: {
|
|
52
|
+
nativeRuleSet: string | null;
|
|
53
|
+
semgrepSupport: 'ga' | 'beta' | 'experimental' | 'none';
|
|
54
|
+
};
|
|
55
|
+
prompts: {
|
|
56
|
+
coderConstraints: string[];
|
|
57
|
+
reviewerChecklist: string[];
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare class LanguageRegistry {
|
|
61
|
+
private profiles;
|
|
62
|
+
private extensionIndex;
|
|
63
|
+
constructor();
|
|
64
|
+
register(profile: LanguageProfile): void;
|
|
65
|
+
get(id: string): LanguageProfile | undefined;
|
|
66
|
+
getById(id: string): LanguageProfile | undefined;
|
|
67
|
+
getByExtension(ext: string): LanguageProfile | undefined;
|
|
68
|
+
getAll(): LanguageProfile[];
|
|
69
|
+
getTier(tier: 1 | 2 | 3): LanguageProfile[];
|
|
70
|
+
}
|
|
71
|
+
export declare const LANGUAGE_REGISTRY: LanguageRegistry;
|
package/dist/sast/semgrep.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export interface SemgrepOptions {
|
|
|
15
15
|
timeoutMs?: number;
|
|
16
16
|
/** Working directory for Semgrep execution */
|
|
17
17
|
cwd?: string;
|
|
18
|
+
/** Language identifier for --lang flag (used with useAutoConfig) */
|
|
19
|
+
lang?: string;
|
|
20
|
+
/** When true, use --config auto instead of local rulesDir (for profile-driven languages) */
|
|
21
|
+
useAutoConfig?: boolean;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
20
24
|
* Result from Semgrep execution
|
package/dist/tools/lint.d.ts
CHANGED
|
@@ -3,10 +3,11 @@ export declare const MAX_OUTPUT_BYTES = 512000;
|
|
|
3
3
|
export declare const MAX_COMMAND_LENGTH = 500;
|
|
4
4
|
export declare const SUPPORTED_LINTERS: readonly ["biome", "eslint"];
|
|
5
5
|
export type SupportedLinter = (typeof SUPPORTED_LINTERS)[number];
|
|
6
|
+
export type AdditionalLinter = 'ruff' | 'clippy' | 'golangci-lint' | 'checkstyle' | 'ktlint' | 'dotnet-format' | 'cppcheck' | 'swiftlint' | 'dart-analyze' | 'rubocop';
|
|
6
7
|
export interface LintSuccessResult {
|
|
7
8
|
success: true;
|
|
8
9
|
mode: 'fix' | 'check';
|
|
9
|
-
linter: SupportedLinter;
|
|
10
|
+
linter: SupportedLinter | AdditionalLinter;
|
|
10
11
|
command: string[];
|
|
11
12
|
exitCode: number;
|
|
12
13
|
output: string;
|
|
@@ -15,7 +16,7 @@ export interface LintSuccessResult {
|
|
|
15
16
|
export interface LintErrorResult {
|
|
16
17
|
success: false;
|
|
17
18
|
mode: 'fix' | 'check';
|
|
18
|
-
linter?: SupportedLinter;
|
|
19
|
+
linter?: SupportedLinter | AdditionalLinter;
|
|
19
20
|
command?: string[];
|
|
20
21
|
exitCode?: number;
|
|
21
22
|
output?: string;
|
|
@@ -29,6 +30,21 @@ export declare function validateArgs(args: unknown): args is {
|
|
|
29
30
|
mode: 'fix' | 'check';
|
|
30
31
|
};
|
|
31
32
|
export declare function getLinterCommand(linter: SupportedLinter, mode: 'fix' | 'check'): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Build the shell command for an additional (non-JS/TS) linter.
|
|
35
|
+
* cppcheck has no --fix mode; csharp and some others behave differently.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getAdditionalLinterCommand(linter: AdditionalLinter, mode: 'fix' | 'check', cwd: string): string[];
|
|
38
|
+
/**
|
|
39
|
+
* Detect the first available additional (non-JS/TS) linter for the current project.
|
|
40
|
+
* Returns null when no additional linter is detected or its binary is unavailable.
|
|
41
|
+
*/
|
|
42
|
+
export declare function detectAdditionalLinter(cwd: string): 'ruff' | 'clippy' | 'golangci-lint' | 'checkstyle' | 'ktlint' | 'dotnet-format' | 'cppcheck' | 'swiftlint' | 'dart-analyze' | 'rubocop' | null;
|
|
32
43
|
export declare function detectAvailableLinter(): Promise<SupportedLinter | null>;
|
|
33
44
|
export declare function runLint(linter: SupportedLinter, mode: 'fix' | 'check'): Promise<LintResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Run an additional (non-JS/TS) linter.
|
|
47
|
+
* Follows the same structure as runLint() but uses getAdditionalLinterCommand().
|
|
48
|
+
*/
|
|
49
|
+
export declare function runAdditionalLint(linter: AdditionalLinter, mode: 'fix' | 'check', cwd: string): Promise<LintResult>;
|
|
34
50
|
export declare const lint: ReturnType<typeof tool>;
|
|
@@ -3,7 +3,7 @@ export declare const MAX_OUTPUT_BYTES = 512000;
|
|
|
3
3
|
export declare const MAX_COMMAND_LENGTH = 500;
|
|
4
4
|
export declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
5
5
|
export declare const MAX_TIMEOUT_MS = 300000;
|
|
6
|
-
export declare const SUPPORTED_FRAMEWORKS: readonly ["bun", "vitest", "jest", "mocha", "pytest", "cargo", "pester"];
|
|
6
|
+
export declare const SUPPORTED_FRAMEWORKS: readonly ["bun", "vitest", "jest", "mocha", "pytest", "cargo", "pester", "go-test", "maven", "gradle", "dotnet-test", "ctest", "swift-test", "dart-test", "rspec", "minitest"];
|
|
7
7
|
export type TestFramework = (typeof SUPPORTED_FRAMEWORKS)[number] | 'none';
|
|
8
8
|
export interface TestRunnerArgs {
|
|
9
9
|
scope?: 'all' | 'convention' | 'graph';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.16.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",
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
"@biomejs/biome": "2.3.14",
|
|
57
57
|
"bun-types": "latest",
|
|
58
58
|
"js-yaml": "^4.1.1",
|
|
59
|
+
"tree-sitter-dart": "1.0.0",
|
|
60
|
+
"tree-sitter-kotlin": "0.3.8",
|
|
61
|
+
"tree-sitter-swift": "0.7.1",
|
|
59
62
|
"typescript": "^5.7.3"
|
|
60
63
|
}
|
|
61
64
|
}
|