opencode-swarm 6.47.2 → 6.49.0
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 +153 -31
- package/dist/cli/index.js +2811 -2560
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/registry.d.ts +4 -0
- package/dist/index.js +2056 -836
- package/dist/lang/framework-detector.d.ts +74 -0
- package/dist/lang/profiles.d.ts +1 -0
- package/dist/services/tool-doctor.d.ts +20 -0
- package/dist/services/tool-doctor.test.d.ts +1 -0
- package/dist/tools/index.d.ts +7 -4
- package/dist/tools/placeholder-scan.d.ts +2 -0
- package/dist/tools/quality-budget.d.ts +2 -0
- package/dist/tools/syntax-check.d.ts +2 -0
- package/dist/tools/test-runner.d.ts +4 -0
- package/dist/tools/update-task-status.d.ts +5 -0
- package/dist/tools/verify-six-tools-registration.test.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework Detection Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides deterministic multi-signal framework detection.
|
|
5
|
+
* Laravel detection uses at least 2 of 3 signals to avoid false positives.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Detection signals for Laravel framework identification.
|
|
9
|
+
* Each signal independently indicates a Laravel project.
|
|
10
|
+
*/
|
|
11
|
+
export interface LaravelDetectionSignals {
|
|
12
|
+
/** artisan file present in project root (no extension) */
|
|
13
|
+
hasArtisanFile: boolean;
|
|
14
|
+
/** laravel/framework present in composer.json require dependencies */
|
|
15
|
+
hasLaravelFrameworkDep: boolean;
|
|
16
|
+
/** config/app.php present (Laravel config directory structure) */
|
|
17
|
+
hasConfigApp: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Resolved command overlay for a detected Laravel project.
|
|
21
|
+
* All fields are set to best-available commands for CI-quality use.
|
|
22
|
+
*/
|
|
23
|
+
export interface LaravelCommandOverlay {
|
|
24
|
+
/** Primary test command. Always php artisan test for Laravel. */
|
|
25
|
+
testCommand: string;
|
|
26
|
+
/** Lint/format command. Pint if detected, PHP-CS-Fixer otherwise, null if neither. */
|
|
27
|
+
lintCommand: string | null;
|
|
28
|
+
/** Static analysis command. PHPStan if phpstan config is present, null otherwise. */
|
|
29
|
+
staticAnalysisCommand: string | null;
|
|
30
|
+
/** Dependency audit command (always composer audit --locked --format=json for Laravel). */
|
|
31
|
+
auditCommand: string;
|
|
32
|
+
/** Whether --parallel flag is supported (Pest parallel testing via artisan). */
|
|
33
|
+
supportsParallel: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Detect whether a directory is a Laravel project.
|
|
37
|
+
* Uses multi-signal detection: at least 2 of 3 signals must be present
|
|
38
|
+
* to minimize false positives against generic Composer PHP projects.
|
|
39
|
+
*
|
|
40
|
+
* Signals checked:
|
|
41
|
+
* 1. artisan file in project root (strong signal — only Laravel projects have this)
|
|
42
|
+
* 2. laravel/framework in composer.json require section
|
|
43
|
+
* 3. config/app.php file (Laravel directory structure)
|
|
44
|
+
*
|
|
45
|
+
* @param directory - Absolute path to the project root
|
|
46
|
+
* @returns true if project is a Laravel project, false otherwise
|
|
47
|
+
*/
|
|
48
|
+
export declare function detectLaravelProject(directory: string): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get individual Laravel detection signals for a directory.
|
|
51
|
+
* Exposed for testing and diagnostic purposes.
|
|
52
|
+
*
|
|
53
|
+
* @param directory - Absolute path to the project root
|
|
54
|
+
* @returns LaravelDetectionSignals with each signal's boolean state
|
|
55
|
+
*/
|
|
56
|
+
export declare function getLaravelSignals(directory: string): LaravelDetectionSignals;
|
|
57
|
+
/**
|
|
58
|
+
* Get the Laravel command overlay for a project directory.
|
|
59
|
+
* Returns null if the directory is not a Laravel project.
|
|
60
|
+
*
|
|
61
|
+
* Command selection logic:
|
|
62
|
+
* - testCommand: always 'php artisan test' (wraps both PHPUnit and Pest)
|
|
63
|
+
* - lintCommand: 'vendor/bin/pint --test' if pint.json present,
|
|
64
|
+
* 'vendor/bin/php-cs-fixer fix --dry-run --diff' if .php-cs-fixer.php present,
|
|
65
|
+
* null otherwise
|
|
66
|
+
* - staticAnalysisCommand: 'vendor/bin/phpstan analyse' if phpstan.neon or phpstan.neon.dist present,
|
|
67
|
+
* null otherwise
|
|
68
|
+
* - auditCommand: always 'composer audit --locked --format=json'
|
|
69
|
+
* - supportsParallel: true (php artisan test --parallel is supported)
|
|
70
|
+
*
|
|
71
|
+
* @param directory - Absolute path to the project root
|
|
72
|
+
* @returns LaravelCommandOverlay if Laravel detected, null if not a Laravel project
|
|
73
|
+
*/
|
|
74
|
+
export declare function getLaravelCommandOverlay(directory: string): LaravelCommandOverlay | null;
|
package/dist/lang/profiles.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Doctor Service
|
|
3
|
+
*
|
|
4
|
+
* Validates that every tool name in TOOL_NAMES has a corresponding
|
|
5
|
+
* registration in the plugin's tool: {} block in src/index.ts.
|
|
6
|
+
*
|
|
7
|
+
* Also validates:
|
|
8
|
+
* - AGENT_TOOL_MAP alignment: tools assigned to agents are registered in the plugin
|
|
9
|
+
* - Class 3 tool binary readiness: external binaries needed by lint tools are available
|
|
10
|
+
*/
|
|
11
|
+
import type { ConfigDoctorResult } from './config-doctor';
|
|
12
|
+
/** Result of tool registration coherence check */
|
|
13
|
+
export type ToolDoctorResult = ConfigDoctorResult;
|
|
14
|
+
/**
|
|
15
|
+
* Run tool registration coherence check
|
|
16
|
+
*
|
|
17
|
+
* Verifies that every entry in TOOL_NAMES has a corresponding key
|
|
18
|
+
* in the plugin's tool: {} block in src/index.ts.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runToolDoctor(_directory: string, pluginRoot?: string): ToolDoctorResult;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -21,9 +21,9 @@ export { knowledgeRemove } from './knowledge-remove';
|
|
|
21
21
|
export { lint } from './lint';
|
|
22
22
|
export { phase_complete } from './phase-complete';
|
|
23
23
|
export { pkg_audit } from './pkg-audit';
|
|
24
|
-
export { type PlaceholderFinding, type PlaceholderScanInput, type PlaceholderScanResult, placeholderScan, } from './placeholder-scan';
|
|
24
|
+
export { type PlaceholderFinding, type PlaceholderScanInput, type PlaceholderScanResult, placeholder_scan, placeholderScan, } from './placeholder-scan';
|
|
25
25
|
export { type PreCheckBatchInput, type PreCheckBatchResult, pre_check_batch, runPreCheckBatch, type ToolResult, } from './pre-check-batch';
|
|
26
|
-
export { type QualityBudgetInput, type QualityBudgetResult, qualityBudget, } from './quality-budget';
|
|
26
|
+
export { type QualityBudgetInput, type QualityBudgetResult, quality_budget, qualityBudget, } from './quality-budget';
|
|
27
27
|
export { retrieve_summary } from './retrieve-summary';
|
|
28
28
|
export { type SastScanFinding, type SastScanInput, type SastScanResult, sast_scan, sastScan, } from './sast-scan';
|
|
29
29
|
export type { SavePlanArgs, SavePlanResult } from './save-plan';
|
|
@@ -32,9 +32,12 @@ export { type SbomGenerateInput, type SbomGenerateResult, sbom_generate, } from
|
|
|
32
32
|
export { schema_drift } from './schema-drift';
|
|
33
33
|
export { search } from './search';
|
|
34
34
|
export { type SecretFinding, type SecretscanResult, secretscan, } from './secretscan';
|
|
35
|
-
|
|
35
|
+
import { suggestPatch } from './suggest-patch';
|
|
36
|
+
export { suggestPatch };
|
|
37
|
+
export type { SuggestPatchArgs } from './suggest-patch';
|
|
38
|
+
export declare const suggest_patch: typeof suggestPatch;
|
|
36
39
|
export { symbols } from './symbols';
|
|
37
|
-
export { type SyntaxCheckFileResult, type SyntaxCheckInput, type SyntaxCheckResult, syntaxCheck, } from './syntax-check';
|
|
40
|
+
export { type SyntaxCheckFileResult, type SyntaxCheckInput, type SyntaxCheckResult, syntax_check, syntaxCheck, } from './syntax-check';
|
|
38
41
|
export { test_runner } from './test-runner';
|
|
39
42
|
export { todo_extract } from './todo-extract';
|
|
40
43
|
export { executeUpdateTaskStatus, type UpdateTaskStatusArgs, type UpdateTaskStatusResult, update_task_status, } from './update-task-status';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { tool } from '@opencode-ai/plugin';
|
|
1
2
|
import type { EvidenceVerdict } from '../config/evidence-schema';
|
|
2
3
|
export interface PlaceholderScanInput {
|
|
3
4
|
changed_files: string[];
|
|
@@ -24,3 +25,4 @@ export interface PlaceholderScanResult {
|
|
|
24
25
|
* Scan files for placeholder content (TODO/FIXME comments, stub implementations, etc.)
|
|
25
26
|
*/
|
|
26
27
|
export declare function placeholderScan(input: PlaceholderScanInput, directory: string): Promise<PlaceholderScanResult>;
|
|
28
|
+
export declare const placeholder_scan: ReturnType<typeof tool>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { tool } from '@opencode-ai/plugin';
|
|
1
2
|
import type { QualityBudgetConfig } from '../config/schema';
|
|
2
3
|
import { type QualityMetrics, type QualityViolation } from '../quality/metrics';
|
|
3
4
|
export interface QualityBudgetInput {
|
|
@@ -22,3 +23,4 @@ export interface QualityBudgetResult {
|
|
|
22
23
|
* and compares against configured thresholds to ensure code quality.
|
|
23
24
|
*/
|
|
24
25
|
export declare function qualityBudget(input: QualityBudgetInput, directory: string): Promise<QualityBudgetResult>;
|
|
26
|
+
export declare const quality_budget: ReturnType<typeof tool>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { tool } from '@opencode-ai/plugin';
|
|
1
2
|
import type { PluginConfig } from '../config';
|
|
2
3
|
import type { EvidenceVerdict } from '../config/evidence-schema';
|
|
3
4
|
export interface SyntaxCheckInput {
|
|
@@ -33,3 +34,4 @@ export interface SyntaxCheckResult {
|
|
|
33
34
|
* Respects config.gates.syntax_check.enabled - returns skipped if disabled
|
|
34
35
|
*/
|
|
35
36
|
export declare function syntaxCheck(input: SyntaxCheckInput, directory: string, config?: PluginConfig): Promise<SyntaxCheckResult>;
|
|
37
|
+
export declare const syntax_check: ReturnType<typeof tool>;
|
|
@@ -13,6 +13,7 @@ export interface TestRunnerArgs {
|
|
|
13
13
|
timeout_ms?: number;
|
|
14
14
|
allow_full_suite?: boolean;
|
|
15
15
|
}
|
|
16
|
+
export type RegressionOutcome = 'pass' | 'skip' | 'regression' | 'scope_exceeded' | 'error';
|
|
16
17
|
export interface TestTotals {
|
|
17
18
|
passed: number;
|
|
18
19
|
failed: number;
|
|
@@ -30,6 +31,7 @@ export interface TestSuccessResult {
|
|
|
30
31
|
coveragePercent?: number;
|
|
31
32
|
rawOutput?: string;
|
|
32
33
|
message?: string;
|
|
34
|
+
outcome?: RegressionOutcome;
|
|
33
35
|
}
|
|
34
36
|
export interface TestErrorResult {
|
|
35
37
|
success: false;
|
|
@@ -43,6 +45,8 @@ export interface TestErrorResult {
|
|
|
43
45
|
error: string;
|
|
44
46
|
rawOutput?: string;
|
|
45
47
|
message?: string;
|
|
48
|
+
outcome?: RegressionOutcome;
|
|
49
|
+
attempted_scope?: 'graph';
|
|
46
50
|
}
|
|
47
51
|
export type TestResult = TestSuccessResult | TestErrorResult;
|
|
48
52
|
export declare function detectTestFramework(cwd: string): Promise<TestFramework>;
|
|
@@ -21,6 +21,8 @@ export interface UpdateTaskStatusResult {
|
|
|
21
21
|
new_status?: string;
|
|
22
22
|
current_phase?: number;
|
|
23
23
|
errors?: string[];
|
|
24
|
+
/** Present when the call failed due to lock contention. Instructs the caller to retry. */
|
|
25
|
+
recovery_guidance?: string;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Validate that the status is one of the allowed values.
|
|
@@ -72,7 +74,10 @@ export declare function recoverTaskStateFromDelegations(taskId: string): void;
|
|
|
72
74
|
/**
|
|
73
75
|
* Execute the update_task_status tool.
|
|
74
76
|
* Validates the task_id and status, then updates the task status in the plan.
|
|
77
|
+
* Uses file locking on plan.json to prevent concurrent writes from corrupting the plan.
|
|
78
|
+
* Only one concurrent call wins the lock; others return success: false with recovery_guidance: "retry".
|
|
75
79
|
* @param args - The update task status arguments
|
|
80
|
+
* @param fallbackDir - Fallback working directory if args.working_directory is not provided
|
|
76
81
|
* @returns UpdateTaskStatusResult with success status and details
|
|
77
82
|
*/
|
|
78
83
|
export declare function executeUpdateTaskStatus(args: UpdateTaskStatusArgs, fallbackDir?: string): Promise<UpdateTaskStatusResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.49.0",
|
|
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",
|