opencode-swarm-plugin 0.29.0 → 0.30.2
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/CHANGELOG.md +94 -0
- package/README.md +3 -6
- package/bin/swarm.test.ts +163 -0
- package/bin/swarm.ts +304 -72
- package/dist/hive.d.ts.map +1 -1
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18825 -3469
- package/dist/memory-tools.d.ts +209 -0
- package/dist/memory-tools.d.ts.map +1 -0
- package/dist/memory.d.ts +124 -0
- package/dist/memory.d.ts.map +1 -0
- package/dist/plugin.js +18775 -3430
- package/dist/schemas/index.d.ts +7 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/worker-handoff.d.ts +78 -0
- package/dist/schemas/worker-handoff.d.ts.map +1 -0
- package/dist/swarm-orchestrate.d.ts +50 -0
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-review.d.ts +4 -0
- package/dist/swarm-review.d.ts.map +1 -1
- package/docs/planning/ADR-008-worker-handoff-protocol.md +293 -0
- package/examples/plugin-wrapper-template.ts +157 -28
- package/package.json +3 -1
- package/src/hive.integration.test.ts +114 -0
- package/src/hive.ts +33 -22
- package/src/index.ts +41 -8
- package/src/memory-tools.test.ts +111 -0
- package/src/memory-tools.ts +273 -0
- package/src/memory.integration.test.ts +266 -0
- package/src/memory.test.ts +334 -0
- package/src/memory.ts +441 -0
- package/src/schemas/index.ts +18 -0
- package/src/schemas/worker-handoff.test.ts +271 -0
- package/src/schemas/worker-handoff.ts +131 -0
- package/src/swarm-orchestrate.ts +262 -24
- package/src/swarm-prompts.ts +48 -5
- package/src/swarm-review.ts +7 -0
- package/src/swarm.integration.test.ts +386 -9
package/bin/swarm.ts
CHANGED
|
@@ -32,7 +32,15 @@ import {
|
|
|
32
32
|
migrateBeadsToHive,
|
|
33
33
|
mergeHistoricBeads,
|
|
34
34
|
importJsonlToPGLite,
|
|
35
|
+
ensureHiveDirectory,
|
|
36
|
+
getHiveAdapter,
|
|
35
37
|
} from "../src/hive";
|
|
38
|
+
import {
|
|
39
|
+
legacyDatabaseExists,
|
|
40
|
+
getMigrationStatus,
|
|
41
|
+
migrateLegacyMemories,
|
|
42
|
+
} from "swarm-mail";
|
|
43
|
+
import { getSwarmMail } from "swarm-mail";
|
|
36
44
|
|
|
37
45
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
38
46
|
const pkg = JSON.parse(
|
|
@@ -71,6 +79,68 @@ const magenta = (s: string) => `\x1b[35m${s}\x1b[0m`;
|
|
|
71
79
|
|
|
72
80
|
const PACKAGE_NAME = "opencode-swarm-plugin";
|
|
73
81
|
|
|
82
|
+
// ============================================================================
|
|
83
|
+
// File Operation Helpers
|
|
84
|
+
// ============================================================================
|
|
85
|
+
|
|
86
|
+
type FileStatus = "created" | "updated" | "unchanged";
|
|
87
|
+
|
|
88
|
+
interface FileStats {
|
|
89
|
+
created: number;
|
|
90
|
+
updated: number;
|
|
91
|
+
unchanged: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Write a file with status logging (created/updated/unchanged)
|
|
96
|
+
* @param path - File path to write
|
|
97
|
+
* @param content - Content to write
|
|
98
|
+
* @param label - Label for logging (e.g., "Plugin", "Command")
|
|
99
|
+
* @returns Status of the operation
|
|
100
|
+
*/
|
|
101
|
+
function writeFileWithStatus(path: string, content: string, label: string): FileStatus {
|
|
102
|
+
const exists = existsSync(path);
|
|
103
|
+
|
|
104
|
+
if (exists) {
|
|
105
|
+
const current = readFileSync(path, "utf-8");
|
|
106
|
+
if (current === content) {
|
|
107
|
+
p.log.message(dim(` ${label}: ${path} (unchanged)`));
|
|
108
|
+
return "unchanged";
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
writeFileSync(path, content);
|
|
113
|
+
const status: FileStatus = exists ? "updated" : "created";
|
|
114
|
+
p.log.success(`${label}: ${path} (${status})`);
|
|
115
|
+
return status;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Create a directory with logging
|
|
120
|
+
* @param path - Directory path to create
|
|
121
|
+
* @returns true if created, false if already exists
|
|
122
|
+
*/
|
|
123
|
+
function mkdirWithStatus(path: string): boolean {
|
|
124
|
+
if (!existsSync(path)) {
|
|
125
|
+
mkdirSync(path, { recursive: true });
|
|
126
|
+
p.log.message(dim(` Created directory: ${path}`));
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Remove a file with logging
|
|
134
|
+
* @param path - File path to remove
|
|
135
|
+
* @param label - Label for logging
|
|
136
|
+
*/
|
|
137
|
+
function rmWithStatus(path: string, label: string): void {
|
|
138
|
+
if (existsSync(path)) {
|
|
139
|
+
rmSync(path);
|
|
140
|
+
p.log.message(dim(` Removed ${label}: ${path}`));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
74
144
|
// ============================================================================
|
|
75
145
|
// Seasonal Messages (inspired by Astro's Houston)
|
|
76
146
|
// ============================================================================
|
|
@@ -363,22 +433,13 @@ const DEPENDENCIES: Dependency[] = [
|
|
|
363
433
|
description: "AI-powered static analysis for pre-completion bug scanning",
|
|
364
434
|
},
|
|
365
435
|
{
|
|
366
|
-
name: "
|
|
367
|
-
command: "
|
|
368
|
-
checkArgs: ["
|
|
369
|
-
required: false,
|
|
370
|
-
install: "npm install -g semantic-memory",
|
|
371
|
-
installType: "npm",
|
|
372
|
-
description: "Learning persistence with vector search",
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
name: "Redis",
|
|
376
|
-
command: "redis-cli",
|
|
377
|
-
checkArgs: ["ping"],
|
|
436
|
+
name: "Ollama",
|
|
437
|
+
command: "ollama",
|
|
438
|
+
checkArgs: ["--version"],
|
|
378
439
|
required: false,
|
|
379
|
-
install: "brew install
|
|
440
|
+
install: "brew install ollama && ollama pull mxbai-embed-large",
|
|
380
441
|
installType: "brew",
|
|
381
|
-
description: "
|
|
442
|
+
description: "Local embeddings for semantic memory (embedded in plugin)",
|
|
382
443
|
},
|
|
383
444
|
];
|
|
384
445
|
|
|
@@ -1165,8 +1226,8 @@ function getFixCommand(dep: Dependency): string | null {
|
|
|
1165
1226
|
switch (dep.name) {
|
|
1166
1227
|
case "OpenCode":
|
|
1167
1228
|
return "brew install sst/tap/opencode";
|
|
1168
|
-
case "
|
|
1169
|
-
return "
|
|
1229
|
+
case "Ollama":
|
|
1230
|
+
return "brew install ollama && ollama pull mxbai-embed-large";
|
|
1170
1231
|
case "Redis":
|
|
1171
1232
|
return "brew install redis && brew services start redis";
|
|
1172
1233
|
case "CASS (Coding Agent Session Search)":
|
|
@@ -1318,6 +1379,7 @@ async function setup() {
|
|
|
1318
1379
|
let isReinstall = false;
|
|
1319
1380
|
|
|
1320
1381
|
// Check if already configured FIRST
|
|
1382
|
+
p.log.step("Checking existing configuration...");
|
|
1321
1383
|
const configDir = join(homedir(), ".config", "opencode");
|
|
1322
1384
|
const pluginDir = join(configDir, "plugin");
|
|
1323
1385
|
const commandDir = join(configDir, "command");
|
|
@@ -1428,6 +1490,8 @@ async function setup() {
|
|
|
1428
1490
|
}
|
|
1429
1491
|
if (action === "reinstall") {
|
|
1430
1492
|
isReinstall = true;
|
|
1493
|
+
p.log.step("Reinstalling swarm configuration...");
|
|
1494
|
+
p.log.message(dim(" This will check dependencies, sync skills, and update config files"));
|
|
1431
1495
|
}
|
|
1432
1496
|
// action === "reinstall" - fall through to full setup
|
|
1433
1497
|
}
|
|
@@ -1558,11 +1622,13 @@ async function setup() {
|
|
|
1558
1622
|
}
|
|
1559
1623
|
|
|
1560
1624
|
// Check for .beads → .hive migration
|
|
1625
|
+
p.log.step("Checking for legacy .beads directory...");
|
|
1561
1626
|
const cwd = process.cwd();
|
|
1562
1627
|
const migrationCheck = checkBeadsMigrationNeeded(cwd);
|
|
1563
1628
|
if (migrationCheck.needed) {
|
|
1564
|
-
p.log.
|
|
1565
|
-
p.log.message(dim("
|
|
1629
|
+
p.log.warn("Found legacy .beads directory");
|
|
1630
|
+
p.log.message(dim(" Path: " + migrationCheck.beadsPath));
|
|
1631
|
+
p.log.message(dim(" Will rename to .hive/ and merge history"));
|
|
1566
1632
|
|
|
1567
1633
|
const shouldMigrate = await p.confirm({
|
|
1568
1634
|
message: "Migrate .beads to .hive? (recommended)",
|
|
@@ -1581,17 +1647,23 @@ async function setup() {
|
|
|
1581
1647
|
try {
|
|
1582
1648
|
const result = await migrateBeadsToHive(cwd);
|
|
1583
1649
|
if (result.migrated) {
|
|
1584
|
-
migrateSpinner.stop("
|
|
1585
|
-
p.log.success("
|
|
1650
|
+
migrateSpinner.stop("Renamed .beads/ → .hive/");
|
|
1651
|
+
p.log.success("Directory migration complete");
|
|
1586
1652
|
|
|
1587
1653
|
// Merge historic beads into issues.jsonl
|
|
1654
|
+
migrateSpinner.start("Merging historic cells...");
|
|
1588
1655
|
const mergeResult = await mergeHistoricBeads(cwd);
|
|
1589
1656
|
if (mergeResult.merged > 0) {
|
|
1590
|
-
|
|
1657
|
+
migrateSpinner.stop("Historic cells merged");
|
|
1658
|
+
p.log.success(`Merged ${mergeResult.merged} cells (${mergeResult.skipped} already present)`);
|
|
1659
|
+
} else {
|
|
1660
|
+
migrateSpinner.stop("No historic cells to merge");
|
|
1591
1661
|
}
|
|
1592
1662
|
|
|
1593
1663
|
// Import JSONL into PGLite database
|
|
1664
|
+
migrateSpinner.start("Importing to database...");
|
|
1594
1665
|
const importResult = await importJsonlToPGLite(cwd);
|
|
1666
|
+
migrateSpinner.stop("Database import complete");
|
|
1595
1667
|
if (importResult.imported > 0 || importResult.updated > 0) {
|
|
1596
1668
|
p.log.success(`Database: ${importResult.imported} imported, ${importResult.updated} updated`);
|
|
1597
1669
|
}
|
|
@@ -1606,10 +1678,121 @@ async function setup() {
|
|
|
1606
1678
|
} else {
|
|
1607
1679
|
p.log.warn("Skipping migration - .beads will continue to work but is deprecated");
|
|
1608
1680
|
}
|
|
1681
|
+
} else {
|
|
1682
|
+
p.log.message(dim(" No legacy .beads directory found"));
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
// Check for legacy semantic-memory migration
|
|
1686
|
+
p.log.step("Checking for legacy semantic-memory database...");
|
|
1687
|
+
if (legacyDatabaseExists()) {
|
|
1688
|
+
p.log.warn("Found legacy semantic-memory database");
|
|
1689
|
+
|
|
1690
|
+
const migrationStatus = await getMigrationStatus();
|
|
1691
|
+
if (migrationStatus) {
|
|
1692
|
+
const { total, withEmbeddings } = migrationStatus;
|
|
1693
|
+
p.log.message(dim(` Memories: ${total} total (${withEmbeddings} with embeddings)`));
|
|
1694
|
+
p.log.message(dim(` Will migrate to swarm-mail unified database`));
|
|
1695
|
+
|
|
1696
|
+
const shouldMigrate = await p.confirm({
|
|
1697
|
+
message: "Migrate to swarm-mail database? (recommended)",
|
|
1698
|
+
initialValue: true,
|
|
1699
|
+
});
|
|
1700
|
+
|
|
1701
|
+
if (p.isCancel(shouldMigrate)) {
|
|
1702
|
+
p.cancel("Setup cancelled");
|
|
1703
|
+
process.exit(0);
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
if (shouldMigrate) {
|
|
1707
|
+
const migrateSpinner = p.spinner();
|
|
1708
|
+
migrateSpinner.start("Connecting to target database...");
|
|
1709
|
+
|
|
1710
|
+
try {
|
|
1711
|
+
// Get swarm-mail database for this project
|
|
1712
|
+
const targetDb = await getSwarmMail(cwd);
|
|
1713
|
+
migrateSpinner.message("Migrating memories...");
|
|
1714
|
+
|
|
1715
|
+
// Run migration with progress updates
|
|
1716
|
+
const result = await migrateLegacyMemories({
|
|
1717
|
+
targetDb,
|
|
1718
|
+
onProgress: (msg) => {
|
|
1719
|
+
// Update spinner message for key milestones
|
|
1720
|
+
if (msg.includes("complete") || msg.includes("Progress:")) {
|
|
1721
|
+
migrateSpinner.message(msg.replace("[migrate] ", ""));
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
});
|
|
1725
|
+
|
|
1726
|
+
migrateSpinner.stop("Semantic memory migration complete");
|
|
1727
|
+
|
|
1728
|
+
if (result.migrated > 0) {
|
|
1729
|
+
p.log.success(`Migrated ${result.migrated} memories to swarm-mail`);
|
|
1730
|
+
}
|
|
1731
|
+
if (result.skipped > 0) {
|
|
1732
|
+
p.log.message(dim(` Skipped ${result.skipped} (already exist)`));
|
|
1733
|
+
}
|
|
1734
|
+
if (result.failed > 0) {
|
|
1735
|
+
p.log.warn(`Failed to migrate ${result.failed} memories`);
|
|
1736
|
+
for (const error of result.errors.slice(0, 3)) {
|
|
1737
|
+
p.log.message(dim(` ${error}`));
|
|
1738
|
+
}
|
|
1739
|
+
if (result.errors.length > 3) {
|
|
1740
|
+
p.log.message(dim(` ... and ${result.errors.length - 3} more errors`));
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
} catch (error) {
|
|
1744
|
+
migrateSpinner.stop("Migration failed");
|
|
1745
|
+
p.log.error(error instanceof Error ? error.message : String(error));
|
|
1746
|
+
}
|
|
1747
|
+
} else {
|
|
1748
|
+
p.log.warn("Skipping migration - legacy semantic-memory will continue to work but is deprecated");
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
} else {
|
|
1752
|
+
p.log.message(dim(" No legacy semantic-memory database found"));
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
// Check for legacy semantic-memory MCP server in OpenCode config
|
|
1756
|
+
p.log.step("Checking for legacy MCP servers...");
|
|
1757
|
+
const opencodeConfigPath = join(configDir, 'config.json');
|
|
1758
|
+
if (existsSync(opencodeConfigPath)) {
|
|
1759
|
+
try {
|
|
1760
|
+
const opencodeConfig = JSON.parse(readFileSync(opencodeConfigPath, 'utf-8'));
|
|
1761
|
+
if (opencodeConfig.mcpServers?.['semantic-memory']) {
|
|
1762
|
+
p.log.warn('Found legacy semantic-memory MCP server');
|
|
1763
|
+
p.log.message(dim(' Semantic memory is now embedded in the plugin'));
|
|
1764
|
+
|
|
1765
|
+
const removeMcp = await p.confirm({
|
|
1766
|
+
message: 'Remove from MCP servers config?',
|
|
1767
|
+
initialValue: true,
|
|
1768
|
+
});
|
|
1769
|
+
|
|
1770
|
+
if (p.isCancel(removeMcp)) {
|
|
1771
|
+
p.cancel('Setup cancelled');
|
|
1772
|
+
process.exit(0);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
if (removeMcp) {
|
|
1776
|
+
delete opencodeConfig.mcpServers['semantic-memory'];
|
|
1777
|
+
writeFileSync(opencodeConfigPath, JSON.stringify(opencodeConfig, null, 2));
|
|
1778
|
+
p.log.success('Removed semantic-memory from MCP servers');
|
|
1779
|
+
p.log.message(dim(` Updated: ${opencodeConfigPath}`));
|
|
1780
|
+
} else {
|
|
1781
|
+
p.log.warn('Keeping legacy MCP - you may see duplicate semantic-memory tools');
|
|
1782
|
+
}
|
|
1783
|
+
} else {
|
|
1784
|
+
p.log.message(dim(' No legacy MCP servers found'));
|
|
1785
|
+
}
|
|
1786
|
+
} catch (error) {
|
|
1787
|
+
p.log.message(dim(' Could not parse OpenCode config (skipping MCP check)'));
|
|
1788
|
+
}
|
|
1789
|
+
} else {
|
|
1790
|
+
p.log.message(dim(' No OpenCode config found (skipping MCP check)'));
|
|
1609
1791
|
}
|
|
1610
1792
|
|
|
1611
1793
|
// Model selection
|
|
1612
|
-
p.log.step("
|
|
1794
|
+
p.log.step("Configuring swarm agents...");
|
|
1795
|
+
p.log.message(dim(" Coordinator handles orchestration, worker executes tasks"));
|
|
1613
1796
|
|
|
1614
1797
|
const coordinatorModel = await p.select({
|
|
1615
1798
|
message: "Select coordinator model (for orchestration/planning):",
|
|
@@ -1705,41 +1888,41 @@ async function setup() {
|
|
|
1705
1888
|
process.exit(0);
|
|
1706
1889
|
}
|
|
1707
1890
|
|
|
1891
|
+
p.log.success("Selected models:");
|
|
1892
|
+
p.log.message(dim(` Coordinator: ${coordinatorModel}`));
|
|
1893
|
+
p.log.message(dim(` Worker: ${workerModel}`));
|
|
1894
|
+
|
|
1708
1895
|
p.log.step("Setting up OpenCode integration...");
|
|
1709
1896
|
|
|
1897
|
+
// Track file operation statistics
|
|
1898
|
+
const stats: FileStats = { created: 0, updated: 0, unchanged: 0 };
|
|
1899
|
+
|
|
1710
1900
|
// Create directories if needed
|
|
1901
|
+
p.log.step("Creating configuration directories...");
|
|
1711
1902
|
const skillsDir = join(configDir, "skills");
|
|
1712
1903
|
for (const dir of [pluginDir, commandDir, agentDir, swarmAgentDir, skillsDir]) {
|
|
1713
|
-
|
|
1714
|
-
mkdirSync(dir, { recursive: true });
|
|
1715
|
-
}
|
|
1904
|
+
mkdirWithStatus(dir);
|
|
1716
1905
|
}
|
|
1717
1906
|
|
|
1718
|
-
|
|
1719
|
-
p.log.
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
p.log.success("Command: " + commandPath);
|
|
1907
|
+
// Write plugin and command files
|
|
1908
|
+
p.log.step("Writing configuration files...");
|
|
1909
|
+
stats[writeFileWithStatus(pluginPath, getPluginWrapper(), "Plugin")]++;
|
|
1910
|
+
stats[writeFileWithStatus(commandPath, SWARM_COMMAND, "Command")]++;
|
|
1723
1911
|
|
|
1724
1912
|
// Write nested agent files (swarm/planner.md, swarm/worker.md)
|
|
1725
1913
|
// This is the format used by Task(subagent_type="swarm/worker")
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
writeFileSync(workerAgentPath, getWorkerAgent(workerModel as string));
|
|
1730
|
-
p.log.success("Worker agent: " + workerAgentPath);
|
|
1914
|
+
p.log.step("Writing agent configuration...");
|
|
1915
|
+
stats[writeFileWithStatus(plannerAgentPath, getPlannerAgent(coordinatorModel as string), "Planner agent")]++;
|
|
1916
|
+
stats[writeFileWithStatus(workerAgentPath, getWorkerAgent(workerModel as string), "Worker agent")]++;
|
|
1731
1917
|
|
|
1732
1918
|
// Clean up legacy flat agent files if they exist
|
|
1733
|
-
if (existsSync(legacyPlannerPath)) {
|
|
1734
|
-
|
|
1735
|
-
p.log.message(dim(" Removed legacy: " + legacyPlannerPath));
|
|
1736
|
-
}
|
|
1737
|
-
if (existsSync(legacyWorkerPath)) {
|
|
1738
|
-
rmSync(legacyWorkerPath);
|
|
1739
|
-
p.log.message(dim(" Removed legacy: " + legacyWorkerPath));
|
|
1919
|
+
if (existsSync(legacyPlannerPath) || existsSync(legacyWorkerPath)) {
|
|
1920
|
+
p.log.step("Cleaning up legacy agent files...");
|
|
1740
1921
|
}
|
|
1922
|
+
rmWithStatus(legacyPlannerPath, "legacy planner");
|
|
1923
|
+
rmWithStatus(legacyWorkerPath, "legacy worker");
|
|
1741
1924
|
|
|
1742
|
-
p.log.
|
|
1925
|
+
p.log.message(dim(` Skills directory: ${skillsDir}`));
|
|
1743
1926
|
|
|
1744
1927
|
// Show bundled skills info (and optionally sync to global skills dir)
|
|
1745
1928
|
const bundledSkillsPath = join(__dirname, "..", "global-skills");
|
|
@@ -1850,17 +2033,29 @@ async function setup() {
|
|
|
1850
2033
|
}
|
|
1851
2034
|
}
|
|
1852
2035
|
|
|
2036
|
+
// Show setup summary
|
|
2037
|
+
const totalFiles = stats.created + stats.updated + stats.unchanged;
|
|
2038
|
+
const summaryParts: string[] = [];
|
|
2039
|
+
if (stats.created > 0) summaryParts.push(`${stats.created} created`);
|
|
2040
|
+
if (stats.updated > 0) summaryParts.push(`${stats.updated} updated`);
|
|
2041
|
+
if (stats.unchanged > 0) summaryParts.push(`${stats.unchanged} unchanged`);
|
|
2042
|
+
|
|
2043
|
+
p.log.message("");
|
|
2044
|
+
p.log.success(`Setup complete: ${totalFiles} files (${summaryParts.join(", ")})`);
|
|
2045
|
+
|
|
1853
2046
|
p.note(
|
|
1854
|
-
'cd your-project\
|
|
2047
|
+
'cd your-project\nswarm init\nopencode\n/swarm "your task"\n\nSkills: Use skills_list to see available skills',
|
|
1855
2048
|
"Next steps",
|
|
1856
2049
|
);
|
|
1857
2050
|
|
|
1858
|
-
p.outro("
|
|
2051
|
+
p.outro("Run 'swarm doctor' to verify installation.");
|
|
1859
2052
|
}
|
|
1860
2053
|
|
|
1861
2054
|
async function init() {
|
|
1862
2055
|
p.intro("swarm init v" + VERSION);
|
|
1863
2056
|
|
|
2057
|
+
const projectPath = process.cwd();
|
|
2058
|
+
|
|
1864
2059
|
const gitDir = existsSync(".git");
|
|
1865
2060
|
if (!gitDir) {
|
|
1866
2061
|
p.log.error("Not in a git repository");
|
|
@@ -1869,12 +2064,15 @@ async function init() {
|
|
|
1869
2064
|
process.exit(1);
|
|
1870
2065
|
}
|
|
1871
2066
|
|
|
2067
|
+
// Check for existing .hive or .beads directories
|
|
2068
|
+
const hiveDir = existsSync(".hive");
|
|
1872
2069
|
const beadsDir = existsSync(".beads");
|
|
1873
|
-
|
|
1874
|
-
|
|
2070
|
+
|
|
2071
|
+
if (hiveDir) {
|
|
2072
|
+
p.log.warn("Hive already initialized in this project (.hive/ exists)");
|
|
1875
2073
|
|
|
1876
2074
|
const reinit = await p.confirm({
|
|
1877
|
-
message: "
|
|
2075
|
+
message: "Continue anyway?",
|
|
1878
2076
|
initialValue: false,
|
|
1879
2077
|
});
|
|
1880
2078
|
|
|
@@ -1882,25 +2080,54 @@ async function init() {
|
|
|
1882
2080
|
p.outro("Aborted");
|
|
1883
2081
|
process.exit(0);
|
|
1884
2082
|
}
|
|
2083
|
+
} else if (beadsDir) {
|
|
2084
|
+
// Offer migration from .beads to .hive
|
|
2085
|
+
p.log.warn("Found legacy .beads/ directory");
|
|
2086
|
+
|
|
2087
|
+
const migrate = await p.confirm({
|
|
2088
|
+
message: "Migrate .beads/ to .hive/?",
|
|
2089
|
+
initialValue: true,
|
|
2090
|
+
});
|
|
2091
|
+
|
|
2092
|
+
if (!p.isCancel(migrate) && migrate) {
|
|
2093
|
+
const s = p.spinner();
|
|
2094
|
+
s.start("Migrating .beads/ to .hive/...");
|
|
2095
|
+
|
|
2096
|
+
const result = await migrateBeadsToHive(projectPath);
|
|
2097
|
+
|
|
2098
|
+
if (result.migrated) {
|
|
2099
|
+
s.stop("Migration complete");
|
|
2100
|
+
p.log.success("Renamed .beads/ to .hive/");
|
|
2101
|
+
|
|
2102
|
+
// Merge historic beads if beads.base.jsonl exists
|
|
2103
|
+
const mergeResult = await mergeHistoricBeads(projectPath);
|
|
2104
|
+
if (mergeResult.merged > 0) {
|
|
2105
|
+
p.log.success(`Merged ${mergeResult.merged} historic cells`);
|
|
2106
|
+
}
|
|
2107
|
+
} else {
|
|
2108
|
+
s.stop("Migration skipped: " + result.reason);
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
1885
2111
|
}
|
|
1886
2112
|
|
|
1887
2113
|
const s = p.spinner();
|
|
1888
|
-
s.start("Initializing
|
|
1889
|
-
|
|
1890
|
-
const success = await runInstall("bd init");
|
|
2114
|
+
s.start("Initializing hive...");
|
|
1891
2115
|
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
2116
|
+
try {
|
|
2117
|
+
// Create .hive directory using our function (no bd CLI needed)
|
|
2118
|
+
ensureHiveDirectory(projectPath);
|
|
2119
|
+
|
|
2120
|
+
s.stop("Hive initialized");
|
|
2121
|
+
p.log.success("Created .hive/ directory");
|
|
1895
2122
|
|
|
1896
|
-
const
|
|
1897
|
-
message: "Create your first
|
|
2123
|
+
const createCell = await p.confirm({
|
|
2124
|
+
message: "Create your first cell?",
|
|
1898
2125
|
initialValue: true,
|
|
1899
2126
|
});
|
|
1900
2127
|
|
|
1901
|
-
if (!p.isCancel(
|
|
2128
|
+
if (!p.isCancel(createCell) && createCell) {
|
|
1902
2129
|
const title = await p.text({
|
|
1903
|
-
message: "
|
|
2130
|
+
message: "Cell title:",
|
|
1904
2131
|
placeholder: "Implement user authentication",
|
|
1905
2132
|
validate: (v) => (v.length === 0 ? "Title required" : undefined),
|
|
1906
2133
|
});
|
|
@@ -1917,17 +2144,22 @@ async function init() {
|
|
|
1917
2144
|
});
|
|
1918
2145
|
|
|
1919
2146
|
if (!p.isCancel(typeResult)) {
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
2147
|
+
const cellSpinner = p.spinner();
|
|
2148
|
+
cellSpinner.start("Creating cell...");
|
|
2149
|
+
|
|
2150
|
+
try {
|
|
2151
|
+
// Use HiveAdapter to create the cell (no bd CLI needed)
|
|
2152
|
+
const adapter = await getHiveAdapter(projectPath);
|
|
2153
|
+
const cell = await adapter.createCell(projectPath, {
|
|
2154
|
+
title: title as string,
|
|
2155
|
+
type: typeResult as "feature" | "bug" | "task" | "chore",
|
|
2156
|
+
priority: 2,
|
|
2157
|
+
});
|
|
2158
|
+
|
|
2159
|
+
cellSpinner.stop("Cell created: " + cell.id);
|
|
2160
|
+
} catch (error) {
|
|
2161
|
+
cellSpinner.stop("Failed to create cell");
|
|
2162
|
+
p.log.error(error instanceof Error ? error.message : String(error));
|
|
1931
2163
|
}
|
|
1932
2164
|
}
|
|
1933
2165
|
}
|
|
@@ -1953,9 +2185,9 @@ async function init() {
|
|
|
1953
2185
|
}
|
|
1954
2186
|
|
|
1955
2187
|
p.outro("Project initialized! Use '/swarm' in OpenCode to get started.");
|
|
1956
|
-
}
|
|
1957
|
-
s.stop("Failed to initialize
|
|
1958
|
-
p.log.error(
|
|
2188
|
+
} catch (error) {
|
|
2189
|
+
s.stop("Failed to initialize hive");
|
|
2190
|
+
p.log.error(error instanceof Error ? error.message : String(error));
|
|
1959
2191
|
p.outro("Aborted");
|
|
1960
2192
|
process.exit(1);
|
|
1961
2193
|
}
|
package/dist/hive.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hive.d.ts","sourceRoot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HANGED
|
@@ -34,6 +34,7 @@ import type { Plugin } from "@opencode-ai/plugin";
|
|
|
34
34
|
* - repo-crawl:* - GitHub API tools for repository research
|
|
35
35
|
* - skills:* - Agent skills discovery, activation, and execution
|
|
36
36
|
* - mandate:* - Agent voting system for collaborative knowledge curation
|
|
37
|
+
* - semantic-memory:* - Semantic memory with vector embeddings (Ollama + PGLite)
|
|
37
38
|
*
|
|
38
39
|
* @param input - Plugin context from OpenCode
|
|
39
40
|
* @returns Plugin hooks including tools, events, and tool execution hooks
|
|
@@ -138,6 +139,84 @@ export { swarmTools, SwarmError, DecompositionError, formatSubtaskPrompt, format
|
|
|
138
139
|
* Note: hiveTools includes both hive_* and beads_* (legacy aliases)
|
|
139
140
|
*/
|
|
140
141
|
export declare const allTools: {
|
|
142
|
+
readonly "semantic-memory_store": {
|
|
143
|
+
description: string;
|
|
144
|
+
args: {
|
|
145
|
+
information: import("zod").ZodString;
|
|
146
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
147
|
+
tags: import("zod").ZodOptional<import("zod").ZodString>;
|
|
148
|
+
metadata: import("zod").ZodOptional<import("zod").ZodString>;
|
|
149
|
+
};
|
|
150
|
+
execute(args: {
|
|
151
|
+
information: string;
|
|
152
|
+
collection?: string | undefined;
|
|
153
|
+
tags?: string | undefined;
|
|
154
|
+
metadata?: string | undefined;
|
|
155
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
156
|
+
};
|
|
157
|
+
readonly "semantic-memory_find": {
|
|
158
|
+
description: string;
|
|
159
|
+
args: {
|
|
160
|
+
query: import("zod").ZodString;
|
|
161
|
+
limit: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
162
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
163
|
+
expand: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
164
|
+
fts: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
165
|
+
};
|
|
166
|
+
execute(args: {
|
|
167
|
+
query: string;
|
|
168
|
+
limit?: number | undefined;
|
|
169
|
+
collection?: string | undefined;
|
|
170
|
+
expand?: boolean | undefined;
|
|
171
|
+
fts?: boolean | undefined;
|
|
172
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
173
|
+
};
|
|
174
|
+
readonly "semantic-memory_get": {
|
|
175
|
+
description: string;
|
|
176
|
+
args: {
|
|
177
|
+
id: import("zod").ZodString;
|
|
178
|
+
};
|
|
179
|
+
execute(args: {
|
|
180
|
+
id: string;
|
|
181
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
182
|
+
};
|
|
183
|
+
readonly "semantic-memory_remove": {
|
|
184
|
+
description: string;
|
|
185
|
+
args: {
|
|
186
|
+
id: import("zod").ZodString;
|
|
187
|
+
};
|
|
188
|
+
execute(args: {
|
|
189
|
+
id: string;
|
|
190
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
191
|
+
};
|
|
192
|
+
readonly "semantic-memory_validate": {
|
|
193
|
+
description: string;
|
|
194
|
+
args: {
|
|
195
|
+
id: import("zod").ZodString;
|
|
196
|
+
};
|
|
197
|
+
execute(args: {
|
|
198
|
+
id: string;
|
|
199
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
200
|
+
};
|
|
201
|
+
readonly "semantic-memory_list": {
|
|
202
|
+
description: string;
|
|
203
|
+
args: {
|
|
204
|
+
collection: import("zod").ZodOptional<import("zod").ZodString>;
|
|
205
|
+
};
|
|
206
|
+
execute(args: {
|
|
207
|
+
collection?: string | undefined;
|
|
208
|
+
}, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
209
|
+
};
|
|
210
|
+
readonly "semantic-memory_stats": {
|
|
211
|
+
description: string;
|
|
212
|
+
args: {};
|
|
213
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
214
|
+
};
|
|
215
|
+
readonly "semantic-memory_check": {
|
|
216
|
+
description: string;
|
|
217
|
+
args: {};
|
|
218
|
+
execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
219
|
+
};
|
|
141
220
|
readonly mandate_file: {
|
|
142
221
|
description: string;
|
|
143
222
|
args: {
|
|
@@ -1441,4 +1520,19 @@ export { guardrailOutput, truncateWithBoundaries, createMetrics, DEFAULT_GUARDRA
|
|
|
1441
1520
|
* ```
|
|
1442
1521
|
*/
|
|
1443
1522
|
export { SWARM_COMPACTION_CONTEXT, createCompactionHook } from "./compaction-hook";
|
|
1523
|
+
/**
|
|
1524
|
+
* Re-export memory module
|
|
1525
|
+
*
|
|
1526
|
+
* Includes:
|
|
1527
|
+
* - memoryTools - All semantic-memory tools (store, find, get, remove, validate, list, stats, check)
|
|
1528
|
+
* - createMemoryAdapter - Factory function for memory adapter
|
|
1529
|
+
* - resetMemoryCache - Cache management for testing
|
|
1530
|
+
*
|
|
1531
|
+
* Types:
|
|
1532
|
+
* - MemoryAdapter - Memory adapter interface
|
|
1533
|
+
* - StoreArgs, FindArgs, IdArgs, ListArgs - Tool argument types
|
|
1534
|
+
* - StoreResult, FindResult, StatsResult, HealthResult, OperationResult - Result types
|
|
1535
|
+
*/
|
|
1536
|
+
export { memoryTools, createMemoryAdapter, resetMemoryCache, type MemoryAdapter, type StoreArgs, type FindArgs, type IdArgs, type ListArgs, type StoreResult, type FindResult, type StatsResult, type HealthResult, type OperationResult, } from "./memory-tools";
|
|
1537
|
+
export type { Memory, SearchResult, SearchOptions } from "swarm-mail";
|
|
1444
1538
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts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