opencode-swarm 6.40.2 → 6.40.4
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 +8 -6
- package/dist/index.js +24 -17
- package/dist/services/handoff-service.d.ts +5 -0
- package/dist/state.d.ts +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -18236,7 +18236,7 @@ var KnowledgeConfigSchema = exports_external.object({
|
|
|
18236
18236
|
max_encounter_score: exports_external.number().min(1).max(20).default(10)
|
|
18237
18237
|
});
|
|
18238
18238
|
var CuratorConfigSchema = exports_external.object({
|
|
18239
|
-
enabled: exports_external.boolean().default(
|
|
18239
|
+
enabled: exports_external.boolean().default(false),
|
|
18240
18240
|
init_enabled: exports_external.boolean().default(true),
|
|
18241
18241
|
phase_enabled: exports_external.boolean().default(true),
|
|
18242
18242
|
max_summary_tokens: exports_external.number().min(500).max(8000).default(2000),
|
|
@@ -32444,16 +32444,18 @@ function formatCurationSummary(summary) {
|
|
|
32444
32444
|
import path10 from "path";
|
|
32445
32445
|
|
|
32446
32446
|
// src/tools/co-change-analyzer.ts
|
|
32447
|
-
import
|
|
32447
|
+
import * as child_process from "child_process";
|
|
32448
32448
|
import { randomUUID } from "crypto";
|
|
32449
32449
|
import { readdir, readFile as readFile2, stat } from "fs/promises";
|
|
32450
32450
|
import * as path9 from "path";
|
|
32451
32451
|
import { promisify } from "util";
|
|
32452
|
-
|
|
32452
|
+
function getExecFileAsync() {
|
|
32453
|
+
return promisify(child_process.execFile);
|
|
32454
|
+
}
|
|
32453
32455
|
async function parseGitLog(directory, maxCommits) {
|
|
32454
32456
|
const commitMap = new Map;
|
|
32455
32457
|
try {
|
|
32456
|
-
const { stdout } = await
|
|
32458
|
+
const { stdout } = await getExecFileAsync()("git", [
|
|
32457
32459
|
"log",
|
|
32458
32460
|
"--name-only",
|
|
32459
32461
|
"--pretty=format:COMMIT:%H",
|
|
@@ -32652,7 +32654,7 @@ async function detectDarkMatter(directory, options) {
|
|
|
32652
32654
|
const npmiThreshold = options?.npmiThreshold ?? 0.5;
|
|
32653
32655
|
const maxCommitsToAnalyze = options?.maxCommitsToAnalyze ?? 500;
|
|
32654
32656
|
try {
|
|
32655
|
-
const { stdout } = await
|
|
32657
|
+
const { stdout } = await getExecFileAsync()("git", ["rev-list", "--count", "HEAD"], {
|
|
32656
32658
|
cwd: directory,
|
|
32657
32659
|
timeout: 1e4
|
|
32658
32660
|
});
|
|
@@ -32812,7 +32814,7 @@ async function handleDarkMatterCommand(directory, args) {
|
|
|
32812
32814
|
[${entries.length} dark matter finding(s) saved to .swarm/knowledge.jsonl]`;
|
|
32813
32815
|
}
|
|
32814
32816
|
} catch (err) {
|
|
32815
|
-
console.warn("dark-matter: failed to save knowledge entries:", err
|
|
32817
|
+
console.warn("dark-matter: failed to save knowledge entries:", err);
|
|
32816
32818
|
return output;
|
|
32817
32819
|
}
|
|
32818
32820
|
}
|
package/dist/index.js
CHANGED
|
@@ -14957,7 +14957,7 @@ var init_schema = __esm(() => {
|
|
|
14957
14957
|
max_encounter_score: exports_external.number().min(1).max(20).default(10)
|
|
14958
14958
|
});
|
|
14959
14959
|
CuratorConfigSchema = exports_external.object({
|
|
14960
|
-
enabled: exports_external.boolean().default(
|
|
14960
|
+
enabled: exports_external.boolean().default(false),
|
|
14961
14961
|
init_enabled: exports_external.boolean().default(true),
|
|
14962
14962
|
phase_enabled: exports_external.boolean().default(true),
|
|
14963
14963
|
max_summary_tokens: exports_external.number().min(500).max(8000).default(2000),
|
|
@@ -41191,7 +41191,11 @@ function applyRehydrationCache(session) {
|
|
|
41191
41191
|
const evidence = evidenceMap.get(taskId);
|
|
41192
41192
|
if (evidence) {
|
|
41193
41193
|
const derivedState = evidenceToWorkflowState(evidence);
|
|
41194
|
-
|
|
41194
|
+
const existingIndex = existingState ? STATE_ORDER.indexOf(existingState) : -1;
|
|
41195
|
+
const derivedIndex = STATE_ORDER.indexOf(derivedState);
|
|
41196
|
+
if (derivedIndex > existingIndex) {
|
|
41197
|
+
session.taskWorkflowStates.set(taskId, derivedState);
|
|
41198
|
+
}
|
|
41195
41199
|
} else {
|
|
41196
41200
|
const existingIndex = existingState ? STATE_ORDER.indexOf(existingState) : -1;
|
|
41197
41201
|
const derivedIndex = STATE_ORDER.indexOf(planState);
|
|
@@ -46559,16 +46563,18 @@ import path17 from "path";
|
|
|
46559
46563
|
// src/tools/co-change-analyzer.ts
|
|
46560
46564
|
init_dist();
|
|
46561
46565
|
init_create_tool();
|
|
46562
|
-
import
|
|
46566
|
+
import * as child_process from "child_process";
|
|
46563
46567
|
import { randomUUID } from "crypto";
|
|
46564
46568
|
import { readdir as readdir2, readFile as readFile3, stat } from "fs/promises";
|
|
46565
46569
|
import * as path16 from "path";
|
|
46566
46570
|
import { promisify } from "util";
|
|
46567
|
-
|
|
46571
|
+
function getExecFileAsync() {
|
|
46572
|
+
return promisify(child_process.execFile);
|
|
46573
|
+
}
|
|
46568
46574
|
async function parseGitLog(directory, maxCommits) {
|
|
46569
46575
|
const commitMap = new Map;
|
|
46570
46576
|
try {
|
|
46571
|
-
const { stdout } = await
|
|
46577
|
+
const { stdout } = await getExecFileAsync()("git", [
|
|
46572
46578
|
"log",
|
|
46573
46579
|
"--name-only",
|
|
46574
46580
|
"--pretty=format:COMMIT:%H",
|
|
@@ -46767,7 +46773,7 @@ async function detectDarkMatter(directory, options) {
|
|
|
46767
46773
|
const npmiThreshold = options?.npmiThreshold ?? 0.5;
|
|
46768
46774
|
const maxCommitsToAnalyze = options?.maxCommitsToAnalyze ?? 500;
|
|
46769
46775
|
try {
|
|
46770
|
-
const { stdout } = await
|
|
46776
|
+
const { stdout } = await getExecFileAsync()("git", ["rev-list", "--count", "HEAD"], {
|
|
46771
46777
|
cwd: directory,
|
|
46772
46778
|
timeout: 1e4
|
|
46773
46779
|
});
|
|
@@ -46927,7 +46933,7 @@ async function handleDarkMatterCommand(directory, args2) {
|
|
|
46927
46933
|
[${entries.length} dark matter finding(s) saved to .swarm/knowledge.jsonl]`;
|
|
46928
46934
|
}
|
|
46929
46935
|
} catch (err2) {
|
|
46930
|
-
console.warn("dark-matter: failed to save knowledge entries:", err2
|
|
46936
|
+
console.warn("dark-matter: failed to save knowledge entries:", err2);
|
|
46931
46937
|
return output;
|
|
46932
46938
|
}
|
|
46933
46939
|
}
|
|
@@ -50707,7 +50713,8 @@ function createAgentActivityHooks(config3, directory) {
|
|
|
50707
50713
|
return;
|
|
50708
50714
|
swarmState.activeToolCalls.delete(input.callID);
|
|
50709
50715
|
const duration5 = Date.now() - entry.startTime;
|
|
50710
|
-
const
|
|
50716
|
+
const rawOutput = output.output;
|
|
50717
|
+
const success3 = rawOutput !== null && rawOutput !== undefined;
|
|
50711
50718
|
const key = entry.tool;
|
|
50712
50719
|
const existing = swarmState.toolAggregates.get(key) ?? {
|
|
50713
50720
|
tool: key,
|
|
@@ -58730,7 +58737,7 @@ var declare_scope = createSwarmTool({
|
|
|
58730
58737
|
});
|
|
58731
58738
|
// src/tools/diff.ts
|
|
58732
58739
|
init_dist();
|
|
58733
|
-
import
|
|
58740
|
+
import * as child_process2 from "child_process";
|
|
58734
58741
|
|
|
58735
58742
|
// src/diff/ast-diff.ts
|
|
58736
58743
|
init_tree_sitter();
|
|
@@ -59085,13 +59092,13 @@ var diff = createSwarmTool({
|
|
|
59085
59092
|
numstatArgs.push("--", ...typedArgs.paths);
|
|
59086
59093
|
fullDiffArgs.push("--", ...typedArgs.paths);
|
|
59087
59094
|
}
|
|
59088
|
-
const numstatOutput = execFileSync("git", numstatArgs, {
|
|
59095
|
+
const numstatOutput = child_process2.execFileSync("git", numstatArgs, {
|
|
59089
59096
|
encoding: "utf-8",
|
|
59090
59097
|
timeout: DIFF_TIMEOUT_MS,
|
|
59091
59098
|
maxBuffer: MAX_BUFFER_BYTES,
|
|
59092
59099
|
cwd: directory
|
|
59093
59100
|
});
|
|
59094
|
-
const fullDiffOutput = execFileSync("git", fullDiffArgs, {
|
|
59101
|
+
const fullDiffOutput = child_process2.execFileSync("git", fullDiffArgs, {
|
|
59095
59102
|
encoding: "utf-8",
|
|
59096
59103
|
timeout: DIFF_TIMEOUT_MS,
|
|
59097
59104
|
maxBuffer: MAX_BUFFER_BYTES,
|
|
@@ -59140,23 +59147,23 @@ var diff = createSwarmTool({
|
|
|
59140
59147
|
let oldContent;
|
|
59141
59148
|
let newContent;
|
|
59142
59149
|
if (base === "staged") {
|
|
59143
|
-
oldContent = execFileSync("git", ["show", `HEAD:${file3.path}`], {
|
|
59150
|
+
oldContent = child_process2.execFileSync("git", ["show", `HEAD:${file3.path}`], {
|
|
59144
59151
|
encoding: "utf-8",
|
|
59145
59152
|
timeout: 5000,
|
|
59146
59153
|
cwd: directory
|
|
59147
59154
|
});
|
|
59148
|
-
newContent = execFileSync("git", ["show", `:${file3.path}`], {
|
|
59155
|
+
newContent = child_process2.execFileSync("git", ["show", `:${file3.path}`], {
|
|
59149
59156
|
encoding: "utf-8",
|
|
59150
59157
|
timeout: 5000,
|
|
59151
59158
|
cwd: directory
|
|
59152
59159
|
});
|
|
59153
59160
|
} else if (base === "unstaged") {
|
|
59154
|
-
oldContent = execFileSync("git", ["show", `:${file3.path}`], {
|
|
59161
|
+
oldContent = child_process2.execFileSync("git", ["show", `:${file3.path}`], {
|
|
59155
59162
|
encoding: "utf-8",
|
|
59156
59163
|
timeout: 5000,
|
|
59157
59164
|
cwd: directory
|
|
59158
59165
|
});
|
|
59159
|
-
newContent = execFileSync("git", ["show", `HEAD:${file3.path}`], {
|
|
59166
|
+
newContent = child_process2.execFileSync("git", ["show", `HEAD:${file3.path}`], {
|
|
59160
59167
|
encoding: "utf-8",
|
|
59161
59168
|
timeout: 5000,
|
|
59162
59169
|
cwd: directory
|
|
@@ -59165,12 +59172,12 @@ var diff = createSwarmTool({
|
|
|
59165
59172
|
const pathModule = await import("path");
|
|
59166
59173
|
newContent = fsModule.readFileSync(pathModule.join(directory, file3.path), "utf-8");
|
|
59167
59174
|
} else {
|
|
59168
|
-
oldContent = execFileSync("git", ["show", `${base}:${file3.path}`], {
|
|
59175
|
+
oldContent = child_process2.execFileSync("git", ["show", `${base}:${file3.path}`], {
|
|
59169
59176
|
encoding: "utf-8",
|
|
59170
59177
|
timeout: 5000,
|
|
59171
59178
|
cwd: directory
|
|
59172
59179
|
});
|
|
59173
|
-
newContent = execFileSync("git", ["show", `HEAD:${file3.path}`], {
|
|
59180
|
+
newContent = child_process2.execFileSync("git", ["show", `HEAD:${file3.path}`], {
|
|
59174
59181
|
encoding: "utf-8",
|
|
59175
59182
|
timeout: 5000,
|
|
59176
59183
|
cwd: directory
|
|
@@ -59,3 +59,8 @@ export declare function getHandoffData(directory: string): Promise<HandoffData>;
|
|
|
59
59
|
* Targets under 2K tokens for efficient context injection.
|
|
60
60
|
*/
|
|
61
61
|
export declare function formatHandoffMarkdown(data: HandoffData): string;
|
|
62
|
+
/**
|
|
63
|
+
* Format handoff data as a continuation prompt for new agent sessions.
|
|
64
|
+
* Returns a terse markdown code block with essential context.
|
|
65
|
+
*/
|
|
66
|
+
export declare function formatContinuationPrompt(data: HandoffData): string;
|
package/dist/state.d.ts
CHANGED
|
@@ -319,7 +319,7 @@ export declare function buildRehydrationCache(directory: string): Promise<void>;
|
|
|
319
319
|
/**
|
|
320
320
|
* Synchronously applies the cached plan+evidence data to a session.
|
|
321
321
|
* Merge rules:
|
|
322
|
-
* - evidence-derived state:
|
|
322
|
+
* - evidence-derived state: only applied if it advances past existing state
|
|
323
323
|
* - plan-only derived state: only applied if it advances past existing state
|
|
324
324
|
* No-op when the cache has not been built yet.
|
|
325
325
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.40.
|
|
3
|
+
"version": "6.40.4",
|
|
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",
|