opencode-swarm 6.11.0 → 6.13.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 +427 -520
- package/dist/background/trigger.d.ts +4 -0
- package/dist/config/constants.d.ts +2 -0
- package/dist/config/evidence-schema.d.ts +4 -4
- package/dist/config/plan-schema.d.ts +28 -1
- package/dist/config/schema.d.ts +53 -22
- package/dist/hooks/extractors.d.ts +14 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/messages-transform.d.ts +13 -0
- package/dist/hooks/pipeline-tracker.d.ts +5 -0
- package/dist/hooks/system-enhancer.d.ts +11 -0
- package/dist/index.js +1414 -417
- package/dist/sast/rules/index.d.ts +2 -2
- package/dist/state.d.ts +20 -0
- package/dist/tools/test-runner.d.ts +2 -2
- package/dist/tools/tool-names.d.ts +10 -0
- package/dist/utils/tool-output.d.ts +10 -0
- package/package.json +1 -2
package/dist/state.d.ts
CHANGED
|
@@ -55,6 +55,26 @@ export interface AgentSessionState {
|
|
|
55
55
|
windows: Record<string, InvocationWindow>;
|
|
56
56
|
/** Last tool-call threshold at which a compaction hint was issued */
|
|
57
57
|
lastCompactionHint: number;
|
|
58
|
+
/** Count of architect direct writes to non-.swarm/ files */
|
|
59
|
+
architectWriteCount: number;
|
|
60
|
+
/** Last task ID that was delegated to coder (for zero-delegation detection) */
|
|
61
|
+
lastCoderDelegationTaskId: string | null;
|
|
62
|
+
/** Gate names observed for current task (taskId → Set of gates) */
|
|
63
|
+
gateLog: Map<string, Set<string>>;
|
|
64
|
+
/** Reviewer delegations per phase (phaseNumber → count) */
|
|
65
|
+
reviewerCallCount: Map<number, number>;
|
|
66
|
+
/** Last gate failure for self-fix detection */
|
|
67
|
+
lastGateFailure: {
|
|
68
|
+
tool: string;
|
|
69
|
+
taskId: string;
|
|
70
|
+
timestamp: number;
|
|
71
|
+
} | null;
|
|
72
|
+
/** Whether partial gate warning has been issued for this session */
|
|
73
|
+
partialGateWarningIssued: boolean;
|
|
74
|
+
/** Whether architect attempted self-fix write after gate failure */
|
|
75
|
+
selfFixAttempted: boolean;
|
|
76
|
+
/** Phases that have already received a catastrophic zero-reviewer warning */
|
|
77
|
+
catastrophicPhaseWarnings: Set<number>;
|
|
58
78
|
}
|
|
59
79
|
/**
|
|
60
80
|
* Represents a single agent invocation window with isolated guardrail budgets.
|
|
@@ -43,6 +43,6 @@ export interface TestErrorResult {
|
|
|
43
43
|
message?: string;
|
|
44
44
|
}
|
|
45
45
|
export type TestResult = TestSuccessResult | TestErrorResult;
|
|
46
|
-
export declare function detectTestFramework(): Promise<TestFramework>;
|
|
47
|
-
export declare function runTests(framework: TestFramework, scope: 'all' | 'convention' | 'graph', files: string[], coverage: boolean, timeout_ms: number): Promise<TestResult>;
|
|
46
|
+
export declare function detectTestFramework(cwd?: string): Promise<TestFramework>;
|
|
47
|
+
export declare function runTests(framework: TestFramework, scope: 'all' | 'convention' | 'graph', files: string[], coverage: boolean, timeout_ms: number, cwd?: string): Promise<TestResult>;
|
|
48
48
|
export declare const test_runner: ReturnType<typeof tool>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central registry of all tool names used by the swarm.
|
|
3
|
+
* Used for constants and agent setup references.
|
|
4
|
+
*/
|
|
5
|
+
/** Union type of all valid tool names */
|
|
6
|
+
export type ToolName = 'diff' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks';
|
|
7
|
+
/** Readonly array of all tool names */
|
|
8
|
+
export declare const TOOL_NAMES: readonly ToolName[];
|
|
9
|
+
/** Set for O(1) tool name validation */
|
|
10
|
+
export declare const TOOL_NAME_SET: ReadonlySet<ToolName>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncate tool output to a maximum number of lines.
|
|
3
|
+
* Adds a footer with omitted line count and guidance.
|
|
4
|
+
*
|
|
5
|
+
* @param output - The tool output to truncate
|
|
6
|
+
* @param maxLines - Maximum number of lines to keep
|
|
7
|
+
* @param toolName - Optional tool name for the footer
|
|
8
|
+
* @returns Truncated output with footer, or original if within limit
|
|
9
|
+
*/
|
|
10
|
+
export declare function truncateToolOutput(output: string, maxLines: number, toolName?: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.13.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",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"clean": "rm -rf dist",
|
|
30
30
|
"copy-grammars": "bun run scripts/copy-grammars.ts",
|
|
31
31
|
"build": "rm -rf dist && bun run copy-grammars && bun build src/index.ts --outdir dist --target bun --format esm && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && bun run scripts/copy-grammars.ts --to-dist && tsc --emitDeclarationOnly",
|
|
32
|
-
"postinstall": "bun run copy-grammars",
|
|
33
32
|
"typecheck": "tsc --noEmit",
|
|
34
33
|
"test": "bun test",
|
|
35
34
|
"lint": "biome lint .",
|