opencode-swarm 7.19.3 → 7.20.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/dist/cli/index.js +109 -11
- package/dist/hooks/guardrails.d.ts +21 -0
- package/dist/index.js +417 -266
- package/dist/state.d.ts +2 -0
- package/dist/test-impact/analyzer.d.ts +8 -2
- package/dist/tools/test-runner.d.ts +11 -0
- package/package.json +1 -1
package/dist/state.d.ts
CHANGED
|
@@ -194,6 +194,8 @@ export interface AgentSessionState {
|
|
|
194
194
|
contextPressureWarningSent?: boolean;
|
|
195
195
|
/** Queue of advisory messages (e.g., SLOP, context pressure) pending injection into next messagesTransform */
|
|
196
196
|
pendingAdvisoryMessages?: string[];
|
|
197
|
+
/** Fingerprint of the most recent provider-failure transcript that received recovery guidance */
|
|
198
|
+
lastProviderRecoveryFingerprint?: string;
|
|
197
199
|
/** Timestamp when session was rehydrated from snapshot (0 if never rehydrated) */
|
|
198
200
|
sessionRehydratedAt: number;
|
|
199
201
|
/** Pattern type to detection count mapping */
|
|
@@ -3,6 +3,7 @@ export interface TestImpactResult {
|
|
|
3
3
|
unrelatedTests: string[];
|
|
4
4
|
untestedFiles: string[];
|
|
5
5
|
impactMap: Record<string, string[]>;
|
|
6
|
+
budgetExceeded?: boolean;
|
|
6
7
|
}
|
|
7
8
|
declare function normalizePath(p: string): string;
|
|
8
9
|
declare function isCacheStale(impactMap: Record<string, string[]>, generatedAtMs: number): boolean;
|
|
@@ -30,7 +31,12 @@ export declare const _internals: {
|
|
|
30
31
|
_clearGoModuleCache: typeof _clearGoModuleCache;
|
|
31
32
|
};
|
|
32
33
|
export declare function buildImpactMap(cwd: string): Promise<Record<string, string[]>>;
|
|
33
|
-
export
|
|
34
|
+
export interface LoadImpactMapOptions {
|
|
35
|
+
/** If true and cache is stale, return the stale map instead of rebuilding.
|
|
36
|
+
* Use for estimation-only reads where slight staleness is acceptable. */
|
|
37
|
+
skipRebuild?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function loadImpactMap(cwd: string, options?: LoadImpactMapOptions): Promise<Record<string, string[]>>;
|
|
34
40
|
declare function saveImpactMap(cwd: string, impactMap: Record<string, string[]>): Promise<void>;
|
|
35
|
-
export declare function analyzeImpact(changedFiles: string[], cwd: string): Promise<TestImpactResult>;
|
|
41
|
+
export declare function analyzeImpact(changedFiles: string[], cwd: string, budget?: number): Promise<TestImpactResult>;
|
|
36
42
|
export {};
|
|
@@ -5,6 +5,17 @@ export declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
|
5
5
|
export declare const MAX_TIMEOUT_MS = 300000;
|
|
6
6
|
export declare const MAX_SAFE_TEST_FILES = 50;
|
|
7
7
|
export declare const MAX_SAFE_SOURCE_FILES = 1;
|
|
8
|
+
/**
|
|
9
|
+
* Estimate the fan-out (number of unique test files) for given source files
|
|
10
|
+
* by reading the cached impact map without spawning a subprocess.
|
|
11
|
+
* This is a pre-resolution check to prevent session blocking.
|
|
12
|
+
*
|
|
13
|
+
* Completes in <100ms by design — reads only the cached JSON and performs
|
|
14
|
+
* in-memory Set collection.
|
|
15
|
+
*/
|
|
16
|
+
export declare function estimateFanOut(sourceFiles: string[], cwd: string): Promise<{
|
|
17
|
+
estimatedCount: number;
|
|
18
|
+
}>;
|
|
8
19
|
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"];
|
|
9
20
|
export type TestFramework = (typeof SUPPORTED_FRAMEWORKS)[number] | 'none';
|
|
10
21
|
export interface TestRunnerArgs {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.20.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",
|