opencode-swarm 7.49.1 → 7.50.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 +1 -1
- package/dist/cli/index.js +30 -9
- package/dist/hooks/scope-guard.d.ts +24 -0
- package/dist/index.js +1315 -440
- package/dist/tools/apply-patch.d.ts +48 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,8 +39,8 @@ Most AI coding tools let one model write code and ask that same model whether th
|
|
|
39
39
|
- 🔁 **Resumable sessions** — all state saved to `.swarm/`; pick up any project any day
|
|
40
40
|
- 🌐 **20 languages** — TypeScript, Python, Go, Rust, Java, Kotlin, C/C++, C#, Ruby, Swift, Dart, PHP, JavaScript, CSS, Bash, PowerShell, INI, Regex (extending: see [docs/adding-a-language.md](docs/adding-a-language.md))
|
|
41
41
|
- 🛡️ **Built-in security** — SAST, secrets scanning, dependency audit per task
|
|
42
|
+
- 🔒 **Scope enforcement** — Validates write targets against declared scope with cross-process persistence, TTL expiry, and scope-aware destructive command blocking. **Handles both single-string and array-based path arguments** (`files[]`, `paths[]`, `targetFiles[]`) to prevent scope bypass via multi-file tool calls.
|
|
42
43
|
- 📝 **Shell write detection** — Static analysis of POSIX/PowerShell/cmd commands to detect file writes (redirects, builtins, in-place editors, network downloads, archive extraction, git destructive ops) before execution
|
|
43
|
-
- 🔒 **Scope enforcement** — Validates write targets against declared scope with cross-process persistence, TTL expiry, and scope-aware destructive command blocking
|
|
44
44
|
- 🆓 **Free tier** — works with OpenCode Zen's free model roster
|
|
45
45
|
- ⚙️ **Fully configurable** — override any agent's model, disable agents, tune guardrails
|
|
46
46
|
|
package/dist/cli/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var package_default;
|
|
|
52
52
|
var init_package = __esm(() => {
|
|
53
53
|
package_default = {
|
|
54
54
|
name: "opencode-swarm",
|
|
55
|
-
version: "7.
|
|
55
|
+
version: "7.50.1",
|
|
56
56
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
57
57
|
main: "dist/index.js",
|
|
58
58
|
types: "dist/index.d.ts",
|
|
@@ -16987,6 +16987,10 @@ var init_tool_metadata = __esm(() => {
|
|
|
16987
16987
|
lean_turbo_status: {
|
|
16988
16988
|
description: "returns Lean Turbo configuration and active status for the current session",
|
|
16989
16989
|
agents: ["architect"]
|
|
16990
|
+
},
|
|
16991
|
+
apply_patch: {
|
|
16992
|
+
description: "Apply a unified diff patch to workspace files with exact context matching, atomic writes, and path validation",
|
|
16993
|
+
agents: ["coder"]
|
|
16990
16994
|
}
|
|
16991
16995
|
};
|
|
16992
16996
|
TOOL_NAMES = Object.keys(TOOL_METADATA);
|
|
@@ -52410,10 +52414,33 @@ function classifyAndCluster(testResults, history) {
|
|
|
52410
52414
|
}
|
|
52411
52415
|
|
|
52412
52416
|
// src/test-impact/flaky-detector.ts
|
|
52417
|
+
function computeCombinedFlakyScore(recent) {
|
|
52418
|
+
const totalRuns = recent.length;
|
|
52419
|
+
if (totalRuns < 2) {
|
|
52420
|
+
return { alternationCount: 0, flakyScore: 0 };
|
|
52421
|
+
}
|
|
52422
|
+
let alternationCount = 0;
|
|
52423
|
+
let passCount = 0;
|
|
52424
|
+
for (let i = 0;i < recent.length; i++) {
|
|
52425
|
+
if (recent[i].result === "pass") {
|
|
52426
|
+
passCount++;
|
|
52427
|
+
}
|
|
52428
|
+
if (i > 0 && recent[i].result !== recent[i - 1].result) {
|
|
52429
|
+
alternationCount++;
|
|
52430
|
+
}
|
|
52431
|
+
}
|
|
52432
|
+
const alternationScore = alternationCount / totalRuns;
|
|
52433
|
+
const passRate = passCount / totalRuns;
|
|
52434
|
+
const passRateVarianceScore = 4 * passRate * (1 - passRate);
|
|
52435
|
+
return {
|
|
52436
|
+
alternationCount,
|
|
52437
|
+
flakyScore: (alternationScore + passRateVarianceScore) / 2
|
|
52438
|
+
};
|
|
52439
|
+
}
|
|
52413
52440
|
function detectFlakyTests(allHistory) {
|
|
52414
52441
|
const grouped = new Map;
|
|
52415
52442
|
for (const record3 of allHistory) {
|
|
52416
|
-
const key = `${record3.testFile.toLowerCase()}
|
|
52443
|
+
const key = `${record3.testFile.toLowerCase()}\x00${record3.testName.toLowerCase()}`;
|
|
52417
52444
|
if (!grouped.has(key)) {
|
|
52418
52445
|
grouped.set(key, {
|
|
52419
52446
|
records: [],
|
|
@@ -52435,13 +52462,7 @@ function detectFlakyTests(allHistory) {
|
|
|
52435
52462
|
if (totalRuns < 2) {
|
|
52436
52463
|
continue;
|
|
52437
52464
|
}
|
|
52438
|
-
|
|
52439
|
-
for (let i = 1;i < recent.length; i++) {
|
|
52440
|
-
if (recent[i].result !== recent[i - 1].result) {
|
|
52441
|
-
alternationCount++;
|
|
52442
|
-
}
|
|
52443
|
-
}
|
|
52444
|
-
const flakyScore = totalRuns >= 2 ? alternationCount / totalRuns : 0;
|
|
52465
|
+
const { alternationCount, flakyScore } = computeCombinedFlakyScore(recent);
|
|
52445
52466
|
const isQuarantined = flakyScore > FLAKY_THRESHOLD && totalRuns >= MIN_RUNS_FOR_QUARANTINE;
|
|
52446
52467
|
const recentResults = recent.map((r) => r.result);
|
|
52447
52468
|
const testFile = entry.originalFile;
|
|
@@ -41,3 +41,27 @@ export declare function createScopeGuardHook(config: Partial<ScopeGuardConfig>,
|
|
|
41
41
|
* @returns true if the file is within scope, false otherwise
|
|
42
42
|
*/
|
|
43
43
|
export declare function isFileInScope(filePath: string, scopeEntries: string[], directory?: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Sanitize a raw file path string to prevent log injection and null-byte attacks.
|
|
46
|
+
* Replaces C0 control characters (0x00-0x1F), DEL (0x7F), C1 control characters
|
|
47
|
+
* (0x80-0x9F), and strips remaining ANSI CSI sequences.
|
|
48
|
+
*
|
|
49
|
+
* All matched control characters are replaced with underscores rather than removed,
|
|
50
|
+
* so that the resulting string can still be passed to `path.resolve()` without
|
|
51
|
+
* triggering `ERR_INVALID_ARG_VALUE` on embedded null bytes.
|
|
52
|
+
*
|
|
53
|
+
* Extracted from the original inline sanitization in the scope guard
|
|
54
|
+
* to support reuse across single-path and multi-path code paths.
|
|
55
|
+
*
|
|
56
|
+
* @param raw - The unsanitized file path string
|
|
57
|
+
* @returns The sanitized file path string safe for logging and scope matching
|
|
58
|
+
*/
|
|
59
|
+
declare function sanitizePath(raw: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Internal implementation details exposed for unit testing.
|
|
62
|
+
* DO NOT use these in production code.
|
|
63
|
+
*/
|
|
64
|
+
export declare const _internals: {
|
|
65
|
+
sanitizePath: typeof sanitizePath;
|
|
66
|
+
};
|
|
67
|
+
export {};
|