opencode-swarm-plugin 0.31.7 → 0.33.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/.turbo/turbo-build.log +4 -4
- package/.turbo/turbo-test.log +324 -316
- package/CHANGELOG.md +394 -0
- package/README.md +129 -181
- package/bin/swarm.test.ts +31 -0
- package/bin/swarm.ts +635 -140
- package/dist/compaction-hook.d.ts +1 -1
- package/dist/compaction-hook.d.ts.map +1 -1
- package/dist/hive.d.ts.map +1 -1
- package/dist/index.d.ts +17 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +653 -139
- package/dist/memory-tools.d.ts.map +1 -1
- package/dist/memory.d.ts +5 -4
- package/dist/memory.d.ts.map +1 -1
- package/dist/observability-tools.d.ts +116 -0
- package/dist/observability-tools.d.ts.map +1 -0
- package/dist/plugin.js +648 -136
- package/dist/skills.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts +29 -5
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +66 -0
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm.d.ts +17 -2
- package/dist/swarm.d.ts.map +1 -1
- package/evals/lib/{data-loader.test.ts → data-loader.evalite-test.ts} +7 -6
- package/evals/lib/data-loader.ts +1 -1
- package/evals/scorers/{outcome-scorers.test.ts → outcome-scorers.evalite-test.ts} +1 -1
- package/examples/plugin-wrapper-template.ts +316 -12
- package/global-skills/swarm-coordination/SKILL.md +118 -8
- package/package.json +3 -2
- package/src/compaction-hook.ts +5 -3
- package/src/hive.integration.test.ts +83 -1
- package/src/hive.ts +37 -12
- package/src/index.ts +25 -1
- package/src/mandate-storage.integration.test.ts +601 -0
- package/src/memory-tools.ts +6 -4
- package/src/memory.integration.test.ts +117 -49
- package/src/memory.test.ts +41 -217
- package/src/memory.ts +12 -8
- package/src/observability-tools.test.ts +346 -0
- package/src/observability-tools.ts +594 -0
- package/src/repo-crawl.integration.test.ts +441 -0
- package/src/skills.integration.test.ts +1192 -0
- package/src/skills.test.ts +42 -1
- package/src/skills.ts +8 -4
- package/src/structured.integration.test.ts +817 -0
- package/src/swarm-deferred.integration.test.ts +157 -0
- package/src/swarm-deferred.test.ts +38 -0
- package/src/swarm-mail.integration.test.ts +15 -19
- package/src/swarm-orchestrate.integration.test.ts +282 -0
- package/src/swarm-orchestrate.test.ts +123 -0
- package/src/swarm-orchestrate.ts +279 -201
- package/src/swarm-prompts.test.ts +481 -0
- package/src/swarm-prompts.ts +297 -0
- package/src/swarm-research.integration.test.ts +544 -0
- package/src/swarm-research.test.ts +698 -0
- package/src/swarm-research.ts +472 -0
- package/src/swarm-review.integration.test.ts +290 -0
- package/src/swarm.integration.test.ts +23 -20
- package/src/swarm.ts +6 -3
- package/src/tool-adapter.integration.test.ts +1221 -0
package/src/hive.ts
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
syncMemories,
|
|
23
23
|
type HiveAdapter,
|
|
24
24
|
type Cell as AdapterCell,
|
|
25
|
-
|
|
25
|
+
getSwarmMailLibSQL,
|
|
26
26
|
resolvePartialId,
|
|
27
27
|
} from "swarm-mail";
|
|
28
28
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -508,7 +508,7 @@ export async function getHiveAdapter(projectKey: string): Promise<HiveAdapter> {
|
|
|
508
508
|
return adapterCache.get(projectKey)!;
|
|
509
509
|
}
|
|
510
510
|
|
|
511
|
-
const swarmMail = await
|
|
511
|
+
const swarmMail = await getSwarmMailLibSQL(projectKey);
|
|
512
512
|
const db = await swarmMail.getDatabase();
|
|
513
513
|
const adapter = createHiveAdapter(db, projectKey);
|
|
514
514
|
|
|
@@ -1158,7 +1158,7 @@ export const hive_sync = tool({
|
|
|
1158
1158
|
);
|
|
1159
1159
|
|
|
1160
1160
|
// 2b. Sync memories to JSONL
|
|
1161
|
-
const swarmMail = await
|
|
1161
|
+
const swarmMail = await getSwarmMailLibSQL(projectKey);
|
|
1162
1162
|
const db = await swarmMail.getDatabase();
|
|
1163
1163
|
const hivePath = join(projectKey, ".hive");
|
|
1164
1164
|
let memoriesSynced = 0;
|
|
@@ -1217,18 +1217,43 @@ export const hive_sync = tool({
|
|
|
1217
1217
|
const hasRemote = remoteCheckResult.stdout.trim() !== "";
|
|
1218
1218
|
|
|
1219
1219
|
if (hasRemote) {
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1220
|
+
// Check for unstaged changes that would block pull --rebase
|
|
1221
|
+
const statusResult = await runGitCommand(["status", "--porcelain"]);
|
|
1222
|
+
const hasUnstagedChanges = statusResult.stdout.trim() !== "";
|
|
1223
|
+
let didStash = false;
|
|
1224
|
+
|
|
1225
|
+
if (hasUnstagedChanges) {
|
|
1226
|
+
// Stash all changes (including untracked) before pull
|
|
1227
|
+
const stashResult = await runGitCommand(["stash", "push", "-u", "-m", "hive_sync: auto-stash before pull"]);
|
|
1228
|
+
if (stashResult.exitCode === 0) {
|
|
1229
|
+
didStash = true;
|
|
1230
|
+
}
|
|
1231
|
+
// If stash fails (e.g., nothing to stash), continue anyway
|
|
1232
|
+
}
|
|
1225
1233
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1234
|
+
try {
|
|
1235
|
+
const pullResult = await withTimeout(
|
|
1236
|
+
runGitCommand(["pull", "--rebase"]),
|
|
1237
|
+
TIMEOUT_MS,
|
|
1229
1238
|
"git pull --rebase",
|
|
1230
|
-
pullResult.exitCode,
|
|
1231
1239
|
);
|
|
1240
|
+
|
|
1241
|
+
if (pullResult.exitCode !== 0) {
|
|
1242
|
+
throw new HiveError(
|
|
1243
|
+
`Failed to pull: ${pullResult.stderr}`,
|
|
1244
|
+
"git pull --rebase",
|
|
1245
|
+
pullResult.exitCode,
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
} finally {
|
|
1249
|
+
// Pop stash if we stashed
|
|
1250
|
+
if (didStash) {
|
|
1251
|
+
const popResult = await runGitCommand(["stash", "pop"]);
|
|
1252
|
+
if (popResult.exitCode !== 0) {
|
|
1253
|
+
// Stash pop failed - likely a conflict. Log warning but don't fail sync.
|
|
1254
|
+
console.warn(`[hive_sync] Warning: stash pop failed. Your changes are in 'git stash list'. Error: ${popResult.stderr}`);
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1232
1257
|
}
|
|
1233
1258
|
}
|
|
1234
1259
|
}
|
package/src/index.ts
CHANGED
|
@@ -47,6 +47,8 @@ import { repoCrawlTools } from "./repo-crawl";
|
|
|
47
47
|
import { skillsTools, setSkillsProjectDirectory } from "./skills";
|
|
48
48
|
import { mandateTools } from "./mandates";
|
|
49
49
|
import { memoryTools } from "./memory-tools";
|
|
50
|
+
import { observabilityTools } from "./observability-tools";
|
|
51
|
+
import { researchTools } from "./swarm-research";
|
|
50
52
|
import {
|
|
51
53
|
guardrailOutput,
|
|
52
54
|
DEFAULT_GUARDRAIL_CONFIG,
|
|
@@ -154,7 +156,7 @@ export const SwarmPlugin: Plugin = async (
|
|
|
154
156
|
* - mandate:file, mandate:vote, mandate:query, etc.
|
|
155
157
|
* - semantic-memory:store, semantic-memory:find, semantic-memory:get, etc.
|
|
156
158
|
*/
|
|
157
|
-
|
|
159
|
+
tool: {
|
|
158
160
|
...hiveTools,
|
|
159
161
|
...swarmMailTools,
|
|
160
162
|
...structuredTools,
|
|
@@ -165,6 +167,8 @@ export const SwarmPlugin: Plugin = async (
|
|
|
165
167
|
...skillsTools,
|
|
166
168
|
...mandateTools,
|
|
167
169
|
...memoryTools,
|
|
170
|
+
...observabilityTools,
|
|
171
|
+
...researchTools,
|
|
168
172
|
},
|
|
169
173
|
|
|
170
174
|
/**
|
|
@@ -679,3 +683,23 @@ export {
|
|
|
679
683
|
type OperationResult,
|
|
680
684
|
} from "./memory-tools";
|
|
681
685
|
export type { Memory, SearchResult, SearchOptions } from "swarm-mail";
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Re-export swarm-research module
|
|
689
|
+
*
|
|
690
|
+
* Includes:
|
|
691
|
+
* - discoverDocTools - Discover available documentation tools
|
|
692
|
+
* - getInstalledVersions - Get installed package versions from lockfile
|
|
693
|
+
* - researchTools - Plugin tools for tool discovery and version detection
|
|
694
|
+
*
|
|
695
|
+
* Types:
|
|
696
|
+
* - DiscoveredTool - Tool discovery result interface
|
|
697
|
+
* - VersionInfo - Package version information
|
|
698
|
+
*/
|
|
699
|
+
export {
|
|
700
|
+
discoverDocTools,
|
|
701
|
+
getInstalledVersions,
|
|
702
|
+
researchTools,
|
|
703
|
+
type DiscoveredTool,
|
|
704
|
+
type VersionInfo,
|
|
705
|
+
} from "./swarm-research";
|